Version 2.9.0-17.0.dev

Merge commit '4b9aa2bd7ecb0c868d9062e68162afae489fc31d' into dev
diff --git a/BUILD.gn b/BUILD.gn
index 8e24f90..c758c49 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -80,24 +80,12 @@
   ]
 }
 
-if (dont_use_nnbd) {
-  group("create_sdk") {
-    public_deps = [ "sdk:create_sdk" ]
-  }
-} else {
-  group("create_sdk") {
-    public_deps = [ "sdk_nnbd:create_sdk" ]
-  }
+group("create_sdk") {
+  public_deps = [ "sdk:create_sdk" ]
 }
 
-if (dont_use_nnbd) {
-  group("create_platform_sdk") {
-    public_deps = [ "sdk:create_platform_sdk" ]
-  }
-} else {
-  group("create_platform_sdk") {
-    public_deps = [ "sdk_nnbd:create_platform_sdk" ]
-  }
+group("create_platform_sdk") {
+  public_deps = [ "sdk:create_platform_sdk" ]
 }
 
 group("dart2js") {
diff --git a/DEPS b/DEPS
index 0ab9437..aea200d 100644
--- a/DEPS
+++ b/DEPS
@@ -39,7 +39,7 @@
 
   # Checked-in SDK version. The checked-in SDK is a Dart SDK distribution in a
   # cipd package used to run Dart scripts in the build and test infrastructure.
-  "sdk_tag": "version:2.9.0-10.0.dev",
+  "sdk_tag": "version:2.9.0-16.0.dev",
 
   # co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
   # hashes. It requires access to the dart-build-access group, which EngProd
@@ -70,7 +70,7 @@
   "bazel_worker_tag": "v0.1.22",
   "benchmark_harness_rev": "81641290dea44c34138a109a37e215482f405f81",
   "boolean_selector_rev": "1309eabed510cc3b7536fd4367d39b97ebee3d69",
-  "boringssl_gen_rev": "b9e27cff1ff0803e97ab1f88764a83be4aa94a6d",
+  "boringssl_gen_rev": "429ccb1877f7987a6f3988228bc2440e61293499",
   "boringssl_rev" : "4dfd5af70191b068aebe567b8e29ce108cee85ce",
   "browser-compat-data_tag": "v1.0.22",
   "charcode_rev": "9085e6b6127f084d66c0a94810a808121459012a",
@@ -107,7 +107,7 @@
   "http_retry_tag": "0.1.1",
   "http_rev": "a131e563c09349f624d5421237183a06fb10552d",
   "http_throttle_tag" : "1.0.2",
-  "icu_rev" : "5005010d694e16571b8dfbf07d70817841f80a69",
+  "icu_rev" : "8d29692df640668ed7e4d1817715440c4e05697a",
   "idl_parser_rev": "5fb1ebf49d235b5a70c9f49047e83b0654031eb7",
   "intl_tag": "0.16.1",
   "jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
@@ -505,7 +505,7 @@
       "packages": [
           {
               "package": "dart/benchmarks/fficall",
-              "version": "version:1",
+              "version": "ebF5aRXKDananlaN4Y8b0bbCNHT1MnkGbWqfpCpiND4C",
           },
       ],
       "dep_type": "cipd",
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 5f27094..bfaf1df 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -19,49 +19,6 @@
     return path.endswith('.cc') or path.endswith('.h')
 
 
-def _CheckNnbdSdkSync(input_api, output_api):
-    files = [git_file.LocalPath() for git_file in input_api.AffectedTextFiles()]
-    unsynchronized_files = []
-    for file in files:
-        if file.startswith('sdk/'):
-            nnbd_file = 'sdk_nnbd/' + file[4:]
-            if not nnbd_file in files:
-                unsynchronized_files.append(nnbd_file)
-    if unsynchronized_files:
-        return [
-            output_api.PresubmitPromptWarning(
-                'Changes were made to sdk/ that were not made to sdk_nnbd/\n'
-                'Please update these files as well:\n'
-                '\n'
-                '%s' % ('\n'.join(unsynchronized_files)))
-        ]
-    return []
-
-
-def _CheckSdkDdcRuntimeSync(input_api, output_api):
-    files = [git_file.LocalPath() for git_file in input_api.AffectedTextFiles()]
-    unsynchronized_files = []
-    runtime_lib = 'lib/_internal/js_dev_runtime/private/ddc_runtime/'
-    for nnbd_file in files:
-        if nnbd_file.startswith('sdk_nnbd/' + runtime_lib):
-            file = 'sdk/' + nnbd_file[9:]
-            if not file in files:
-                unsynchronized_files.append(file)
-    if unsynchronized_files:
-        return [
-            output_api.PresubmitPromptWarning(
-                'Changes were made to '
-                'sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/ '
-                'that were not made to '
-                'sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/ '
-                'Please copy those changes (without Null Safety syntax) to '
-                'these files as well:\n'
-                '\n'
-                '%s' % ('\n'.join(unsynchronized_files)))
-        ]
-    return []
-
-
 def _CheckNnbdTestSync(input_api, output_api):
     """Make sure that any forked SDK tests are kept in sync. If a CL touches
     a test, the test's counterpart (if it exists at all) should be in the CL
@@ -369,8 +326,6 @@
 
 def _CommonChecks(input_api, output_api):
     results = []
-    results.extend(_CheckNnbdSdkSync(input_api, output_api))
-    results.extend(_CheckSdkDdcRuntimeSync(input_api, output_api))
     results.extend(_CheckNnbdTestSync(input_api, output_api))
     results.extend(_CheckValidHostsInDEPS(input_api, output_api))
     results.extend(_CheckDartFormat(input_api, output_api))
diff --git a/WATCHLISTS b/WATCHLISTS
index a0c46b6..c4e7dea 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -28,7 +28,6 @@
       'filepath': (
         '^pkg/compiler|'
         '^sdk/lib/_internal/js_runtime|'
-        '^sdk_nnbd/lib/_internal/js_runtime|'
         '^tests/compiler/dart2js'
       )
     },
@@ -36,7 +35,6 @@
       'filepath': (
         '^pkg/dev_compiler|'
         '^sdk/lib/_internal/js_dev_runtime|'
-        '^sdk_nnbd/lib/_internal/js_dev_runtime|'
         '^tests/compiler/dartdevc_native'
       )
     },
diff --git a/benchmarks/FfiCall/dart/FfiCall.dart b/benchmarks/FfiCall/dart/FfiCall.dart
index b790a85..e6afd40 100644
--- a/benchmarks/FfiCall/dart/FfiCall.dart
+++ b/benchmarks/FfiCall/dart/FfiCall.dart
@@ -297,6 +297,67 @@
 Function20PointerUint8 function20PointerUint8 = ffiTestFunctions.lookupFunction<
     Function20PointerUint8, Function20PointerUint8>("Function20PointerUint8");
 
+final function1handle = ffiTestFunctions.lookupFunction<Handle Function(Handle),
+    Object Function(Object)>("Function1Handle");
+
+final function2handle = ffiTestFunctions.lookupFunction<
+    Handle Function(Handle, Handle),
+    Object Function(Object, Object)>("Function2Handle");
+
+final function4handle = ffiTestFunctions.lookupFunction<
+    Handle Function(Handle, Handle, Handle, Handle),
+    Object Function(Object, Object, Object, Object)>("Function4Handle");
+
+final function10handle = ffiTestFunctions.lookupFunction<
+    Handle Function(Handle, Handle, Handle, Handle, Handle, Handle, Handle,
+        Handle, Handle, Handle),
+    Object Function(Object, Object, Object, Object, Object, Object, Object,
+        Object, Object, Object)>("Function10Handle");
+
+final function20handle = ffiTestFunctions.lookupFunction<
+    Handle Function(
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle),
+    Object Function(
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object)>("Function20Handle");
+
 //
 // Trampoline call.
 //
@@ -597,6 +658,69 @@
   return x;
 }
 
+Object doCall1Handle(int length, Object p1) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function1handle(x);
+  }
+  return x;
+}
+
+Object doCall2Handle(int length, Object p1, Object p2) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function2handle(x, p2);
+  }
+  return x;
+}
+
+Object doCall4Handle(int length, Object p1, Object p2, Object p3, Object p4) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function4handle(x, p2, p3, p4);
+  }
+  return x;
+}
+
+Object doCall10Handle(int length, Object p1, Object p2, Object p3, Object p4,
+    Object p5, Object p6, Object p7, Object p8, Object p9, Object p10) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function10handle(x, p2, p3, p4, p5, p6, p7, p8, p9, p10);
+  }
+  return x;
+}
+
+Object doCall20Handle(
+    int length,
+    Object p1,
+    Object p2,
+    Object p3,
+    Object p4,
+    Object p5,
+    Object p6,
+    Object p7,
+    Object p8,
+    Object p9,
+    Object p10,
+    Object p11,
+    Object p12,
+    Object p13,
+    Object p14,
+    Object p15,
+    Object p16,
+    Object p17,
+    Object p18,
+    Object p19,
+    Object p20) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function20handle(x, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13,
+        p14, p15, p16, p17, p18, p19, p20);
+  }
+  return x;
+}
+
 //
 // Benchmark fixtures.
 //
@@ -1106,6 +1230,109 @@
   }
 }
 
+class MyClass {
+  int a;
+  MyClass(this.a);
+}
+
+class Handlex01 extends BenchmarkBase {
+  Handlex01() : super("FfiCall.Handlex01");
+
+  void run() {
+    final p1 = MyClass(123);
+    final x = doCall1Handle(N, p1);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex02 extends BenchmarkBase {
+  Handlex02() : super("FfiCall.Handlex02");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final x = doCall2Handle(N, p1, p2);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex04 extends BenchmarkBase {
+  Handlex04() : super("FfiCall.Handlex04");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final p3 = MyClass(3);
+    final p4 = MyClass(4);
+    final x = doCall4Handle(N, p1, p2, p3, p4);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex10 extends BenchmarkBase {
+  Handlex10() : super("FfiCall.Handlex10");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final p3 = MyClass(3);
+    final p4 = MyClass(4);
+    final p5 = MyClass(5);
+    final p6 = MyClass(6);
+    final p7 = MyClass(7);
+    final p8 = MyClass(8);
+    final p9 = MyClass(9);
+    final p10 = MyClass(10);
+    final x = doCall10Handle(N, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex20 extends BenchmarkBase {
+  Handlex20() : super("FfiCall.Handlex20");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final p3 = MyClass(3);
+    final p4 = MyClass(4);
+    final p5 = MyClass(5);
+    final p6 = MyClass(6);
+    final p7 = MyClass(7);
+    final p8 = MyClass(8);
+    final p9 = MyClass(9);
+    final p10 = MyClass(10);
+    final p11 = MyClass(11);
+    final p12 = MyClass(12);
+    final p13 = MyClass(13);
+    final p14 = MyClass(14);
+    final p15 = MyClass(15);
+    final p16 = MyClass(16);
+    final p17 = MyClass(17);
+    final p18 = MyClass(18);
+    final p19 = MyClass(19);
+    final p20 = MyClass(20);
+    final x = doCall20Handle(N, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
+        p12, p13, p14, p15, p16, p17, p18, p19, p20);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
 //
 // Main driver.
 //
@@ -1144,6 +1371,11 @@
     () => PointerUint8x04(),
     () => PointerUint8x10(),
     () => PointerUint8x20(),
+    () => Handlex01(),
+    () => Handlex02(),
+    () => Handlex04(),
+    () => Handlex10(),
+    () => Handlex20(),
   ];
   benchmarks.forEach((benchmark) => benchmark().report());
 }
diff --git a/benchmarks/FfiCall/dart2/FfiCall.dart b/benchmarks/FfiCall/dart2/FfiCall.dart
index b790a85..e6afd40 100644
--- a/benchmarks/FfiCall/dart2/FfiCall.dart
+++ b/benchmarks/FfiCall/dart2/FfiCall.dart
@@ -297,6 +297,67 @@
 Function20PointerUint8 function20PointerUint8 = ffiTestFunctions.lookupFunction<
     Function20PointerUint8, Function20PointerUint8>("Function20PointerUint8");
 
+final function1handle = ffiTestFunctions.lookupFunction<Handle Function(Handle),
+    Object Function(Object)>("Function1Handle");
+
+final function2handle = ffiTestFunctions.lookupFunction<
+    Handle Function(Handle, Handle),
+    Object Function(Object, Object)>("Function2Handle");
+
+final function4handle = ffiTestFunctions.lookupFunction<
+    Handle Function(Handle, Handle, Handle, Handle),
+    Object Function(Object, Object, Object, Object)>("Function4Handle");
+
+final function10handle = ffiTestFunctions.lookupFunction<
+    Handle Function(Handle, Handle, Handle, Handle, Handle, Handle, Handle,
+        Handle, Handle, Handle),
+    Object Function(Object, Object, Object, Object, Object, Object, Object,
+        Object, Object, Object)>("Function10Handle");
+
+final function20handle = ffiTestFunctions.lookupFunction<
+    Handle Function(
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle,
+        Handle),
+    Object Function(
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object,
+        Object)>("Function20Handle");
+
 //
 // Trampoline call.
 //
@@ -597,6 +658,69 @@
   return x;
 }
 
+Object doCall1Handle(int length, Object p1) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function1handle(x);
+  }
+  return x;
+}
+
+Object doCall2Handle(int length, Object p1, Object p2) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function2handle(x, p2);
+  }
+  return x;
+}
+
+Object doCall4Handle(int length, Object p1, Object p2, Object p3, Object p4) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function4handle(x, p2, p3, p4);
+  }
+  return x;
+}
+
+Object doCall10Handle(int length, Object p1, Object p2, Object p3, Object p4,
+    Object p5, Object p6, Object p7, Object p8, Object p9, Object p10) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function10handle(x, p2, p3, p4, p5, p6, p7, p8, p9, p10);
+  }
+  return x;
+}
+
+Object doCall20Handle(
+    int length,
+    Object p1,
+    Object p2,
+    Object p3,
+    Object p4,
+    Object p5,
+    Object p6,
+    Object p7,
+    Object p8,
+    Object p9,
+    Object p10,
+    Object p11,
+    Object p12,
+    Object p13,
+    Object p14,
+    Object p15,
+    Object p16,
+    Object p17,
+    Object p18,
+    Object p19,
+    Object p20) {
+  Object x = p1;
+  for (int i = 0; i < length; i++) {
+    x = function20handle(x, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13,
+        p14, p15, p16, p17, p18, p19, p20);
+  }
+  return x;
+}
+
 //
 // Benchmark fixtures.
 //
@@ -1106,6 +1230,109 @@
   }
 }
 
+class MyClass {
+  int a;
+  MyClass(this.a);
+}
+
+class Handlex01 extends BenchmarkBase {
+  Handlex01() : super("FfiCall.Handlex01");
+
+  void run() {
+    final p1 = MyClass(123);
+    final x = doCall1Handle(N, p1);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex02 extends BenchmarkBase {
+  Handlex02() : super("FfiCall.Handlex02");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final x = doCall2Handle(N, p1, p2);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex04 extends BenchmarkBase {
+  Handlex04() : super("FfiCall.Handlex04");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final p3 = MyClass(3);
+    final p4 = MyClass(4);
+    final x = doCall4Handle(N, p1, p2, p3, p4);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex10 extends BenchmarkBase {
+  Handlex10() : super("FfiCall.Handlex10");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final p3 = MyClass(3);
+    final p4 = MyClass(4);
+    final p5 = MyClass(5);
+    final p6 = MyClass(6);
+    final p7 = MyClass(7);
+    final p8 = MyClass(8);
+    final p9 = MyClass(9);
+    final p10 = MyClass(10);
+    final x = doCall10Handle(N, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
+class Handlex20 extends BenchmarkBase {
+  Handlex20() : super("FfiCall.Handlex20");
+
+  void run() {
+    final p1 = MyClass(123);
+    final p2 = MyClass(2);
+    final p3 = MyClass(3);
+    final p4 = MyClass(4);
+    final p5 = MyClass(5);
+    final p6 = MyClass(6);
+    final p7 = MyClass(7);
+    final p8 = MyClass(8);
+    final p9 = MyClass(9);
+    final p10 = MyClass(10);
+    final p11 = MyClass(11);
+    final p12 = MyClass(12);
+    final p13 = MyClass(13);
+    final p14 = MyClass(14);
+    final p15 = MyClass(15);
+    final p16 = MyClass(16);
+    final p17 = MyClass(17);
+    final p18 = MyClass(18);
+    final p19 = MyClass(19);
+    final p20 = MyClass(20);
+    final x = doCall20Handle(N, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
+        p12, p13, p14, p15, p16, p17, p18, p19, p20);
+
+    if (!identical(p1, x)) {
+      throw Exception("$name: Unexpected result: $x");
+    }
+  }
+}
+
 //
 // Main driver.
 //
@@ -1144,6 +1371,11 @@
     () => PointerUint8x04(),
     () => PointerUint8x10(),
     () => PointerUint8x20(),
+    () => Handlex01(),
+    () => Handlex02(),
+    () => Handlex04(),
+    () => Handlex10(),
+    () => Handlex20(),
   ];
   benchmarks.forEach((benchmark) => benchmark().report());
 }
diff --git a/benchmarks/FfiCall/dart2/native/.gitignore b/benchmarks/FfiCall/dart2/native/.gitignore
deleted file mode 100644
index 4baa5ba..0000000
--- a/benchmarks/FfiCall/dart2/native/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-out/
diff --git a/benchmarks/FfiCall/dart2/native/Makefile b/benchmarks/FfiCall/dart2/native/Makefile
deleted file mode 100644
index 5e5d716..0000000
--- a/benchmarks/FfiCall/dart2/native/Makefile
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-# TODO(37531): Remove this makefile and build with sdk instead when
-# benchmark runner gets support for that.
-
-CC=gcc
-CCARM=arm-linux-gnueabihf-gcc
-CCARM64=aarch64-linux-gnu-gcc
-CFLAGS=-Wall -g -O -fPIC
-
-# Bump this whenever the benchmark is updated.
-VERSION=1
-
-.PHONY: all clean
-
-all: out/linux/x64/libnative_functions.so out/linux/ia32/libnative_functions.so out/linux/arm64/libnative_functions.so out/linux/arm/libnative_functions.so
-
-cipd:
-	cipd create -name dart/benchmarks/fficall -in out -install-mode copy -tag version:$(VERSION)
-
-clean:
-	rm -rf *.o *.so out
-
-out/linux/x64:
-	mkdir -p out/linux/x64
-
-out/linux/x64/native_functions.o: native_functions.c | out/linux/x64
-	$(CC) $(CFLAGS) -c -o $@ native_functions.c
-
-out/linux/x64/libnative_functions.so: out/linux/x64/native_functions.o
-	$(CC) $(CFLAGS) -s -shared -o $@ out/linux/x64/native_functions.o
-
-out/linux/ia32:
-	mkdir -p out/linux/ia32
-
-out/linux/ia32/native_functions.o: native_functions.c | out/linux/ia32
-	$(CC) $(CFLAGS) -m32 -c -o $@ native_functions.c
-
-out/linux/ia32/libnative_functions.so: out/linux/ia32/native_functions.o
-	$(CC) $(CFLAGS) -m32 -s -shared -o $@ out/linux/ia32/native_functions.o
-
-out/linux/arm64:
-	mkdir -p out/linux/arm64
-
-out/linux/arm64/native_functions.o: native_functions.c | out/linux/arm64
-	$(CCARM64) $(CFLAGS) -c -o $@ native_functions.c
-
-out/linux/arm64/libnative_functions.so: out/linux/arm64/native_functions.o
-	$(CCARM64) $(CFLAGS) -s -shared -o $@ out/linux/arm64/native_functions.o
-
-out/linux/arm:
-	mkdir -p out/linux/arm
-
-out/linux/arm/native_functions.o: native_functions.c | out/linux/arm
-	$(CCARM) $(CFLAGS) -c -o $@ native_functions.c
-
-out/linux/arm/libnative_functions.so: out/linux/arm/native_functions.o
-	$(CCARM) $(CFLAGS) -s -shared -o $@ out/linux/arm/native_functions.o
diff --git a/benchmarks/FfiCall/dart2/native/native_functions.c b/benchmarks/FfiCall/dart2/native/native_functions.c
deleted file mode 100644
index 9fcee4d..0000000
--- a/benchmarks/FfiCall/dart2/native/native_functions.c
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include <stdint.h>
-
-uint8_t Function1Uint8(uint8_t x) { return x + 42; }
-
-uint16_t Function1Uint16(uint16_t x) { return x + 42; }
-
-uint32_t Function1Uint32(uint32_t x) { return x + 42; }
-
-uint64_t Function1Uint64(uint64_t x) { return x + 42; }
-
-int8_t Function1Int8(int8_t x) { return x + 42; }
-
-int16_t Function1Int16(int16_t x) { return x + 42; }
-
-int32_t Function1Int32(int32_t x) { return x + 42; }
-
-int32_t Function2Int32(int32_t a, int32_t b) {
-  return a + b;
-}
-
-int32_t Function4Int32(int32_t a, int32_t b, int32_t c, int32_t d) {
-  return a + b + c + d;
-}
-
-int32_t Function10Int32(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e,
-                        int32_t f, int32_t g, int32_t h, int32_t i, int32_t j) {
-  return a + b + c + d + e + f + g + h + i + j;
-}
-
-int32_t Function20Int32(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e,
-                        int32_t f, int32_t g, int32_t h, int32_t i, int32_t j,
-                        int32_t k, int32_t l, int32_t m, int32_t n, int32_t o,
-                        int32_t p, int32_t q, int32_t r, int32_t s, int32_t t) {
-  return a + b + c + d + e + f + g + h + i + j + k + l + m + n + o +
-                   p + q + r + s + t;
-}
-
-int64_t Function1Int64(int64_t x) { return x + 42; }
-
-int64_t Function2Int64(int64_t a, int64_t b) {
-  return a + b;
-}
-
-int64_t Function4Int64(int64_t a, int64_t b, int64_t c, int64_t d) {
-  return a + b + c + d;
-}
-
-int64_t Function10Int64(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e,
-                        int64_t f, int64_t g, int64_t h, int64_t i, int64_t j) {
-  return a + b + c + d + e + f + g + h + i + j;
-}
-
-int64_t Function20Int64(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e,
-                        int64_t f, int64_t g, int64_t h, int64_t i, int64_t j,
-                        int64_t k, int64_t l, int64_t m, int64_t n, int64_t o,
-                        int64_t p, int64_t q, int64_t r, int64_t s, int64_t t) {
-  return a + b + c + d + e + f + g + h + i + j + k + l + m + n + o +
-                   p + q + r + s + t;
-}
-
-float Function1Float(float x) { return x + 42.0f; }
-
-float Function2Float(float a, float b) {
-  return a + b;
-}
-
-float Function4Float(float a, float b, float c, float d) {
-  return a + b + c + d;
-}
-
-float Function10Float(float a, float b, float c, float d, float e, float f,
-                      float g, float h, float i, float j) {
-  return a + b + c + d + e + f + g + h + i + j;
-}
-
-float Function20Float(float a, float b, float c, float d, float e, float f,
-                      float g, float h, float i, float j, float k, float l,
-                      float m, float n, float o, float p, float q, float r,
-                      float s, float t) {
-  return a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p +
-                 q + r + s + t;
-}
-
-double Function1Double(double x) { return x + 42.0; }
-
-double Function2Double(double a, double b) {
-  return a + b;
-}
-
-double Function4Double(double a, double b, double c, double d) {
-  return a + b + c + d;
-}
-
-double Function10Double(double a, double b, double c, double d, double e,
-                        double f, double g, double h, double i, double j) {
-  return a + b + c + d + e + f + g + h + i + j;
-}
-
-double Function20Double(double a, double b, double c, double d, double e,
-                        double f, double g, double h, double i, double j,
-                        double k, double l, double m, double n, double o,
-                        double p, double q, double r, double s, double t) {
-  return a + b + c + d + e + f + g + h + i + j + k + l + m + n + o +
-                  p + q + r + s + t;
-}
-
-uint8_t *Function1PointerUint8(uint8_t *a) { return a + 1; }
-
-uint8_t *Function2PointerUint8(uint8_t *a, uint8_t *b) { return a + 1; }
-
-uint8_t *Function4PointerUint8(uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d) {
-  return a + 1;
-}
-
-uint8_t *Function10PointerUint8(uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d,
-                                uint8_t *e, uint8_t *f, uint8_t *g, uint8_t *h,
-                                uint8_t *i, uint8_t *j) {
-  return a + 1;
-}
-
-uint8_t *Function20PointerUint8(uint8_t *a, uint8_t *b, uint8_t *c, uint8_t *d,
-                                uint8_t *e, uint8_t *f, uint8_t *g, uint8_t *h,
-                                uint8_t *i, uint8_t *j, uint8_t *k, uint8_t *l,
-                                uint8_t *m, uint8_t *n, uint8_t *o, uint8_t *p,
-                                uint8_t *q, uint8_t *r, uint8_t *s,
-                                uint8_t *t) {
-  return a + 1;
-}
diff --git a/benchmarks/FfiCall/native/Makefile b/benchmarks/FfiCall/native/Makefile
index 5e5d716..eec4593 100644
--- a/benchmarks/FfiCall/native/Makefile
+++ b/benchmarks/FfiCall/native/Makefile
@@ -10,15 +10,12 @@
 CCARM64=aarch64-linux-gnu-gcc
 CFLAGS=-Wall -g -O -fPIC
 
-# Bump this whenever the benchmark is updated.
-VERSION=1
-
 .PHONY: all clean
 
 all: out/linux/x64/libnative_functions.so out/linux/ia32/libnative_functions.so out/linux/arm64/libnative_functions.so out/linux/arm/libnative_functions.so
 
 cipd:
-	cipd create -name dart/benchmarks/fficall -in out -install-mode copy -tag version:$(VERSION)
+	cipd create -name dart/benchmarks/fficall -in out -install-mode copy
 
 clean:
 	rm -rf *.o *.so out
diff --git a/benchmarks/FfiCall/native/native_functions.c b/benchmarks/FfiCall/native/native_functions.c
index 9fcee4d..e781749 100644
--- a/benchmarks/FfiCall/native/native_functions.c
+++ b/benchmarks/FfiCall/native/native_functions.c
@@ -130,3 +130,51 @@
                                 uint8_t *t) {
   return a + 1;
 }
+
+void* Function1Handle(void* a) {
+  return a;
+}
+
+void* Function2Handle(void* a, void* b) {
+  return a;
+}
+
+void* Function4Handle(void* a, void* b, void* c, void* d) {
+  return a;
+}
+
+void* Function10Handle(void* a,
+                       void* b,
+                       void* c,
+                       void* d,
+                       void* e,
+                       void* f,
+                       void* g,
+                       void* h,
+                       void* i,
+                       void* j) {
+  return a;
+}
+
+void* Function20Handle(void* a,
+                       void* b,
+                       void* c,
+                       void* d,
+                       void* e,
+                       void* f,
+                       void* g,
+                       void* h,
+                       void* i,
+                       void* j,
+                       void* k,
+                       void* l,
+                       void* m,
+                       void* n,
+                       void* o,
+                       void* p,
+                       void* q,
+                       void* r,
+                       void* s,
+                       void* t) {
+  return a;
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
index 6db7f6d..544b978 100644
--- a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
@@ -1270,6 +1270,7 @@
       Iterable<Variable> writtenVariables,
       Iterable<Variable> capturedVariables) {
     Map<Variable, VariableModel<Variable, Type>> newVariableInfo;
+
     for (Variable variable in writtenVariables) {
       VariableModel<Variable, Type> info = infoFor(variable);
       if (info.promotedTypes != null) {
@@ -1278,6 +1279,7 @@
                 variableInfo))[variable] = info.discardPromotions();
       }
     }
+
     for (Variable variable in capturedVariables) {
       VariableModel<Variable, Type> info = variableInfo[variable];
       if (info == null) {
@@ -1291,8 +1293,14 @@
                 variableInfo))[variable] = info.writeCapture();
       }
     }
-    if (newVariableInfo == null) return this;
-    return new FlowModel<Variable, Type>._(reachable, newVariableInfo);
+
+    FlowModel<Variable, Type> result = newVariableInfo == null
+        ? this
+        : new FlowModel<Variable, Type>._(reachable, newVariableInfo);
+
+    result = result.joinUnassigned(written: writtenVariables);
+
+    return result;
   }
 
   /// Updates the state to reflect a control path that is known to have
@@ -2433,8 +2441,6 @@
 
   @override
   void for_end() {
-    FlowModel<Variable, Type> afterUpdate = _current;
-
     _WhileContext<Variable, Type> context =
         _stack.removeLast() as _WhileContext<Variable, Type>;
     // Tail of the stack: falseCondition, break
@@ -2442,7 +2448,6 @@
     FlowModel<Variable, Type> falseCondition = context._conditionInfo.ifFalse;
 
     _current = _join(falseCondition, breakState);
-    _current = _current.joinUnassigned(other: afterUpdate);
   }
 
   @override
@@ -2481,9 +2486,6 @@
     _stack.add(new _SimpleContext(_current));
     _current = _current.removePromotedAll(_assignedVariables._anywhere._written,
         _assignedVariables._anywhere._captured);
-    _current = _current.joinUnassigned(
-      written: _assignedVariables._anywhere._written,
-    );
   }
 
   @override
@@ -2752,9 +2754,8 @@
 
     AssignedVariablesNodeInfo<Variable> info =
         _assignedVariables._getInfoForNode(body);
-    FlowModel<Variable, Type> beforeCatch = beforeBody
-        .removePromotedAll(info._written, info._captured)
-        .joinUnassigned(other: afterBody);
+    FlowModel<Variable, Type> beforeCatch =
+        beforeBody.removePromotedAll(info._written, info._captured);
 
     context._beforeCatch = beforeCatch;
     context._afterBodyAndCatches = afterBody;
@@ -2843,9 +2844,7 @@
   void whileStatement_end() {
     _WhileContext<Variable, Type> context =
         _stack.removeLast() as _WhileContext<Variable, Type>;
-    FlowModel<Variable, Type> afterBody = _current;
     _current = _join(context._conditionInfo.ifFalse, context._breakModel);
-    _current = _current.joinUnassigned(other: afterBody);
   }
 
   @override
diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id.dart
index efd6cbf..77377cd 100644
--- a/pkg/_fe_analyzer_shared/lib/src/testing/id.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/testing/id.dart
@@ -125,7 +125,9 @@
   static const String stmtPrefix = "stmt: ";
   static const String errorPrefix = "error: ";
 
-  static IdValue decode(Uri sourceUri, Annotation annotation, String text) {
+  static IdValue decode(Uri sourceUri, Annotation annotation, String text,
+      {bool preserveWhitespaceInAnnotations: false,
+      bool preserveInfixWhitespace: false}) {
     int offset = annotation.offset;
     Id id;
     String expected;
@@ -182,8 +184,15 @@
       id = new NodeId(offset, IdKind.node);
       expected = text;
     }
-    // Remove newlines.
-    expected = expected.replaceAll(new RegExp(r'\s*(\n\s*)+\s*'), '');
+    if (preserveWhitespaceInAnnotations) {
+      // Keep all whitespace.
+    } else if (preserveInfixWhitespace) {
+      // Remove heading and trailing whitespace.
+      expected = expected.trim();
+    } else {
+      // Remove unneeded whitespace.
+      expected = expected.replaceAll(new RegExp(r'\s*(\n\s*)+\s*'), '');
+    }
     return new IdValue(id, annotation, expected);
   }
 }
diff --git a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart
index f210251..a32f0da 100644
--- a/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart
@@ -219,7 +219,9 @@
 // TODO(johnniwinther): Support an empty marker set.
 void computeExpectedMap(Uri sourceUri, String filename, AnnotatedCode code,
     Map<String, MemberAnnotations<IdValue>> maps,
-    {void onFailure(String message)}) {
+    {void onFailure(String message),
+    bool preserveWhitespaceInAnnotations: false,
+    bool preserveInfixWhitespaceInAnnotations: false}) {
   List<String> mapKeys = maps.keys.toList();
   Map<String, AnnotatedCode> split = splitByPrefixes(code, mapKeys);
 
@@ -229,7 +231,9 @@
     Map<Id, IdValue> expectedValues = fileAnnotations[sourceUri];
     for (Annotation annotation in code.annotations) {
       String text = annotation.text;
-      IdValue idValue = IdValue.decode(sourceUri, annotation, text);
+      IdValue idValue = IdValue.decode(sourceUri, annotation, text,
+          preserveWhitespaceInAnnotations: preserveWhitespaceInAnnotations,
+          preserveInfixWhitespace: preserveInfixWhitespaceInAnnotations);
       if (idValue.id.isGlobal) {
         if (fileAnnotations.globalData.containsKey(idValue.id)) {
           onFailure("Error in test '$filename': "
@@ -259,7 +263,9 @@
 TestData computeTestData(FileSystemEntity testFile,
     {Iterable<String> supportedMarkers,
     Uri createTestUri(Uri uri, String fileName),
-    void onFailure(String message)}) {
+    void onFailure(String message),
+    bool preserveWhitespaceInAnnotations: false,
+    bool preserveInfixWhitespaceInAnnotations: false}) {
   Uri entryPoint;
 
   String testName;
@@ -300,7 +306,10 @@
   }
   computeExpectedMap(entryPoint, testFile.uri.pathSegments.last,
       code[entryPoint], expectedMaps,
-      onFailure: onFailure);
+      onFailure: onFailure,
+      preserveWhitespaceInAnnotations: preserveWhitespaceInAnnotations,
+      preserveInfixWhitespaceInAnnotations:
+          preserveInfixWhitespaceInAnnotations);
   Map<String, String> memorySourceFiles = {
     entryPoint.path: code[entryPoint].sourceCode
   };
@@ -317,7 +326,10 @@
       code[libFileUri] = annotatedLibCode;
       computeExpectedMap(
           libFileUri, libFileName, annotatedLibCode, expectedMaps,
-          onFailure: onFailure);
+          onFailure: onFailure,
+          preserveWhitespaceInAnnotations: preserveWhitespaceInAnnotations,
+          preserveInfixWhitespaceInAnnotations:
+              preserveInfixWhitespaceInAnnotations);
     }
   }
 
@@ -713,7 +725,9 @@
     void onFailure(String message),
     RunTestFunction<T> runTest,
     List<String> skipList,
-    Map<String, List<String>> skipMap}) async {
+    Map<String, List<String>> skipMap,
+    bool preserveWhitespaceInAnnotations: false,
+    bool preserveInfixWhitespaceInAnnotations: false}) async {
   MarkerOptions markerOptions =
       new MarkerOptions.fromDataDir(dataDir, shouldFindScript: shards == 1);
   // TODO(johnniwinther): Support --show to show actual data for an input.
@@ -775,7 +789,10 @@
     TestData testData = computeTestData(entity,
         supportedMarkers: markerOptions.supportedMarkers,
         createTestUri: createTestUri,
-        onFailure: onFailure);
+        onFailure: onFailure,
+        preserveWhitespaceInAnnotations: preserveWhitespaceInAnnotations,
+        preserveInfixWhitespaceInAnnotations:
+            preserveInfixWhitespaceInAnnotations);
     print('Test: ${testData.testFileUri}');
 
     Map<String, TestResult<T>> results = await runTest(testData,
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/do.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/do.dart
index b9671f8..c07e4e4 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/do.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/do.dart
@@ -40,7 +40,7 @@
 condition() {
   late int v1, v2;
   do {
-    /*unassigned*/ v1; // assigned in the condition, but not yet
+    v1;
   } while ((v1 = 0) + (v2 = 0) >= 0);
   v2;
 }
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/for.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/for.dart
index dc59c89..11bec64 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/for.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/for.dart
@@ -2,6 +2,56 @@
 // 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.
 
+for_assignedInBody_body(bool b) {
+  late int v;
+  for (;;) {
+    if (b) {
+      v = 0;
+    } else {
+      v;
+    }
+    v;
+  }
+  v;
+}
+
+for_assignedInBody_condition() {
+  bool firstTime = true;
+  late int v;
+  for (; firstTime || v > 0;) {
+    firstTime = false;
+    v = 5;
+  }
+  v;
+}
+
+for_assignedInBody_initializer() {
+  bool firstTime = true;
+  late int v;
+  for (var x = /*unassigned*/ v;;) {
+    v = 5;
+  }
+  v;
+}
+
+for_assignedInCondition() {
+  bool firstTime = true;
+  late int v;
+  for (var x = /*unassigned*/ v; (v = 0) > 0;) {
+    v;
+  }
+  v;
+}
+
+for_assignedInUpdater() {
+  bool firstTime = true;
+  late int v;
+  for (var x = /*unassigned*/ v;; v = 0) {
+    v;
+  }
+  v;
+}
+
 for_body(bool c) {
   late int v;
   for (; c;) {
@@ -77,7 +127,7 @@
 for_updaters(bool c) {
   late int v1, v2, v3, v4;
   for (; c; v1 = 0, v2 = 0, v3 = 0, /*unassigned*/ v4) {
-    /*unassigned*/ v1;
+    v1;
   }
   v2;
 }
@@ -115,7 +165,7 @@
 
 collection_for_updaters(bool c) {
   late int v1, v2, v3, v4;
-  [for (; c; v1 = 0, v2 = 0, v3 = 0, /*unassigned*/ v4) /*unassigned*/ v1 ];
+  [for (; c; v1 = 0, v2 = 0, v3 = 0, /*unassigned*/ v4) v1];
   v2;
 }
 
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/issue41284.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/issue41284.dart
index 59f4591..9c3a817 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/issue41284.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/issue41284.dart
@@ -8,7 +8,7 @@
     local = 0;
     return;
   } finally {
-    print(/*unassigned*/ local);
+    print(local);
   }
   local;
 }
@@ -22,7 +22,7 @@
     local = 42;
     rethrow;
   } finally {
-    print(/*unassigned*/ local);
+    print(local);
   }
   local;
 }
diff --git a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/while.dart b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/while.dart
index f5a898c..66188b4 100644
--- a/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/while.dart
+++ b/pkg/_fe_analyzer_shared/test/flow_analysis/definite_unassignment/data/while.dart
@@ -2,6 +2,29 @@
 // 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.
 
+assignedInBody_body(bool b) {
+  late int v;
+  while (true) {
+    if (b) {
+      v = 0;
+    } else {
+      v;
+    }
+    v;
+  }
+  v;
+}
+
+assignedInBody_condition() {
+  bool firstTime = true;
+  late int v;
+  while (firstTime || v > 0) {
+    firstTime = false;
+    v = 5;
+  }
+  v;
+}
+
 condition() {
   late int v;
   while ((v = 0) >= 0) {
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
index 141ef76..b8f7eb1 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
@@ -846,11 +846,11 @@
     hash = JenkinsSmiHash.combine(hash, label.hashCode);
     hash = JenkinsSmiHash.combine(hash, className.hashCode);
     hash = JenkinsSmiHash.combine(hash, variableName.hashCode);
-    hash = JenkinsSmiHash.combine(hash, attributes.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(attributes));
     hash = JenkinsSmiHash.combine(hash, dartElement.hashCode);
     hash = JenkinsSmiHash.combine(hash, range.hashCode);
     hash = JenkinsSmiHash.combine(hash, codeRange.hashCode);
-    hash = JenkinsSmiHash.combine(hash, children.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(children));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -1106,7 +1106,7 @@
     hash = JenkinsSmiHash.combine(hash, element.hashCode);
     hash = JenkinsSmiHash.combine(hash, range.hashCode);
     hash = JenkinsSmiHash.combine(hash, codeRange.hashCode);
-    hash = JenkinsSmiHash.combine(hash, children.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(children));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -1206,7 +1206,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, uri.hashCode);
-    hash = JenkinsSmiHash.combine(hash, labels.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(labels));
     return JenkinsSmiHash.finish(hash);
   }
 
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
index b347e96..39e2e89 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
@@ -533,7 +533,7 @@
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, title.hashCode);
     hash = JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = JenkinsSmiHash.combine(hash, diagnostics.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(diagnostics));
     hash = JenkinsSmiHash.combine(hash, edit.hashCode);
     hash = JenkinsSmiHash.combine(hash, command.hashCode);
     return JenkinsSmiHash.finish(hash);
@@ -640,8 +640,8 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, diagnostics.hashCode);
-    hash = JenkinsSmiHash.combine(hash, only.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(diagnostics));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(only));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -786,7 +786,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, codeActionKinds.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(codeActionKinds));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -1015,8 +1015,8 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
-    hash = JenkinsSmiHash.combine(hash, codeActionKinds.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(codeActionKinds));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -1353,7 +1353,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, resolveProvider.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -1717,7 +1717,7 @@
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, label.hashCode);
     hash = JenkinsSmiHash.combine(hash, textEdit.hashCode);
-    hash = JenkinsSmiHash.combine(hash, additionalTextEdits.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(additionalTextEdits));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -2004,7 +2004,7 @@
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, title.hashCode);
     hash = JenkinsSmiHash.combine(hash, command.hashCode);
-    hash = JenkinsSmiHash.combine(hash, arguments.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(arguments));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -2516,8 +2516,8 @@
     hash = JenkinsSmiHash.combine(hash, insertText.hashCode);
     hash = JenkinsSmiHash.combine(hash, insertTextFormat.hashCode);
     hash = JenkinsSmiHash.combine(hash, textEdit.hashCode);
-    hash = JenkinsSmiHash.combine(hash, additionalTextEdits.hashCode);
-    hash = JenkinsSmiHash.combine(hash, commitCharacters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(additionalTextEdits));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(commitCharacters));
     hash = JenkinsSmiHash.combine(hash, command.hashCode);
     hash = JenkinsSmiHash.combine(hash, data.hashCode);
     return JenkinsSmiHash.finish(hash);
@@ -2673,7 +2673,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, isIncomplete.hashCode);
-    hash = JenkinsSmiHash.combine(hash, items.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(items));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -2759,7 +2759,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, resolveProvider.hashCode);
-    hash = JenkinsSmiHash.combine(hash, triggerCharacters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(triggerCharacters));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -3040,10 +3040,10 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, triggerCharacters.hashCode);
-    hash = JenkinsSmiHash.combine(hash, allCommitCharacters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(triggerCharacters));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(allCommitCharacters));
     hash = JenkinsSmiHash.combine(hash, resolveProvider.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -3233,7 +3233,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, items.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(items));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -3816,7 +3816,7 @@
     hash = JenkinsSmiHash.combine(hash, code.hashCode);
     hash = JenkinsSmiHash.combine(hash, source.hashCode);
     hash = JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = JenkinsSmiHash.combine(hash, relatedInformation.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(relatedInformation));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -4132,7 +4132,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, textDocument.hashCode);
-    hash = JenkinsSmiHash.combine(hash, contentChanges.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(contentChanges));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -4210,7 +4210,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, changes.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(changes));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -4291,7 +4291,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, watchers.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(watchers));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -5262,7 +5262,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, resolveProvider.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -5362,7 +5362,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, firstTriggerCharacter.hashCode);
-    hash = JenkinsSmiHash.combine(hash, moreTriggerCharacter.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(moreTriggerCharacter));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -5652,8 +5652,8 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, firstTriggerCharacter.hashCode);
-    hash = JenkinsSmiHash.combine(hash, moreTriggerCharacter.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(moreTriggerCharacter));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -6011,7 +6011,7 @@
     hash = JenkinsSmiHash.combine(hash, deprecated.hashCode);
     hash = JenkinsSmiHash.combine(hash, range.hashCode);
     hash = JenkinsSmiHash.combine(hash, selectionRange.hashCode);
-    hash = JenkinsSmiHash.combine(hash, children.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(children));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -6194,7 +6194,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, commands.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(commands));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -6287,7 +6287,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, command.hashCode);
-    hash = JenkinsSmiHash.combine(hash, arguments.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(arguments));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -6363,7 +6363,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, commands.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(commands));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -7347,7 +7347,7 @@
     hash = JenkinsSmiHash.combine(hash, initializationOptions.hashCode);
     hash = JenkinsSmiHash.combine(hash, capabilities.hashCode);
     hash = JenkinsSmiHash.combine(hash, trace.hashCode);
-    hash = JenkinsSmiHash.combine(hash, workspaceFolders.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(workspaceFolders));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -8793,7 +8793,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, uri.hashCode);
-    hash = JenkinsSmiHash.combine(hash, diagnostics.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(diagnostics));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -9371,7 +9371,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, registrations.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(registrations));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -9874,7 +9874,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, prepareProvider.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -11362,7 +11362,7 @@
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, type.hashCode);
     hash = JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = JenkinsSmiHash.combine(hash, actions.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(actions));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -11487,7 +11487,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, signatures.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(signatures));
     hash = JenkinsSmiHash.combine(hash, activeSignature.hashCode);
     hash = JenkinsSmiHash.combine(hash, activeParameter.hashCode);
     return JenkinsSmiHash.finish(hash);
@@ -11556,7 +11556,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, triggerCharacters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(triggerCharacters));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -11653,8 +11653,8 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, triggerCharacters.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(triggerCharacters));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -11782,7 +11782,7 @@
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, label.hashCode);
     hash = JenkinsSmiHash.combine(hash, documentation.hashCode);
-    hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(parameters));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -12176,7 +12176,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, syncKind.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -12943,7 +12943,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, valueSet.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(valueSet));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -13443,7 +13443,7 @@
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, snippetSupport.hashCode);
     hash = JenkinsSmiHash.combine(hash, commitCharactersSupport.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentationFormat.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentationFormat));
     hash = JenkinsSmiHash.combine(hash, deprecatedSupport.hashCode);
     hash = JenkinsSmiHash.combine(hash, preselectSupport.hashCode);
     return JenkinsSmiHash.finish(hash);
@@ -13521,7 +13521,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, valueSet.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(valueSet));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -14198,7 +14198,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, dynamicRegistration.hashCode);
-    hash = JenkinsSmiHash.combine(hash, contentFormat.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(contentFormat));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -14880,7 +14880,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, documentationFormat.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentationFormat));
     hash = JenkinsSmiHash.combine(hash, parameterInformation.hashCode);
     return JenkinsSmiHash.finish(hash);
   }
@@ -14956,7 +14956,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, valueSet.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(valueSet));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -15384,7 +15384,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, textDocument.hashCode);
-    hash = JenkinsSmiHash.combine(hash, edits.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(edits));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -15818,7 +15818,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -15943,7 +15943,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, includeText.hashCode);
-    hash = JenkinsSmiHash.combine(hash, documentSelector.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(documentSelector));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -16391,7 +16391,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, unregisterations.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(unregisterations));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -17216,7 +17216,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, valueSet.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(valueSet));
     return JenkinsSmiHash.finish(hash);
   }
 
@@ -17330,7 +17330,7 @@
   int get hashCode {
     var hash = 0;
     hash = JenkinsSmiHash.combine(hash, documentChanges.hashCode);
-    hash = JenkinsSmiHash.combine(hash, resourceOperations.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(resourceOperations));
     hash = JenkinsSmiHash.combine(hash, failureHandling.hashCode);
     return JenkinsSmiHash.finish(hash);
   }
@@ -17465,7 +17465,7 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, changes.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(changes));
     hash = JenkinsSmiHash.combine(hash, documentChanges.hashCode);
     return JenkinsSmiHash.finish(hash);
   }
@@ -17672,8 +17672,8 @@
   @override
   int get hashCode {
     var hash = 0;
-    hash = JenkinsSmiHash.combine(hash, added.hashCode);
-    hash = JenkinsSmiHash.combine(hash, removed.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(added));
+    hash = JenkinsSmiHash.combine(hash, lspHashCode(removed));
     return JenkinsSmiHash.finish(hash);
   }
 
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart
index aa3d457..21a84d3 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_special.dart
@@ -6,6 +6,8 @@
 
 import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
 import 'package:analysis_server/src/lsp/json_parsing.dart';
+import 'package:analysis_server/src/protocol/protocol_internal.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
 
 const jsonRpcVersion = '2.0';
 
@@ -19,6 +21,37 @@
 
 ErrorOr<R> failure<R>(ErrorOr<dynamic> error) => ErrorOr<R>.error(error.error);
 
+/// Returns if two objects are equal, recursively checking items in
+/// Maps/Lists.
+bool lspEquals(dynamic obj1, dynamic obj2) {
+  if (obj1 is List && obj2 is List) {
+    return listEqual(obj1, obj2, lspEquals);
+  } else if (obj1 is Map && obj2 is Map) {
+    return mapEqual(obj1, obj2, lspEquals);
+  } else {
+    return obj1.runtimeType == obj2.runtimeType && obj1 == obj2;
+  }
+}
+
+/// Returns an objects hash code, recursively combining hashes for items in
+/// Maps/Lists.
+int lspHashCode(dynamic obj) {
+  var hash = 0;
+  if (obj is List) {
+    for (var element in obj) {
+      hash = JenkinsSmiHash.combine(hash, lspHashCode(element));
+    }
+  } else if (obj is Map) {
+    for (var key in obj.keys) {
+      hash = JenkinsSmiHash.combine(hash, lspHashCode(key));
+      hash = JenkinsSmiHash.combine(hash, lspHashCode(obj[key]));
+    }
+  } else {
+    hash = obj.hashCode;
+  }
+  return JenkinsSmiHash.finish(hash);
+}
+
 Object specToJson(Object obj) {
   if (obj is ToJsonable) {
     return obj.toJson();
@@ -46,10 +79,11 @@
         _which = 2;
 
   @override
-  int get hashCode => map((t) => t.hashCode, (t) => t.hashCode);
+  int get hashCode => map(lspHashCode, lspHashCode);
 
   @override
-  bool operator ==(o) => o is Either2<T1, T2> && o._t1 == _t1 && o._t2 == _t2;
+  bool operator ==(o) =>
+      o is Either2<T1, T2> && lspEquals(o._t1, _t1) && lspEquals(o._t2, _t2);
 
   T map<T>(T Function(T1) f1, T Function(T2) f2) {
     return _which == 1 ? f1(_t1) : f2(_t2);
@@ -84,12 +118,14 @@
         _which = 3;
 
   @override
-  int get hashCode =>
-      map((t) => t.hashCode, (t) => t.hashCode, (t) => t.hashCode);
+  int get hashCode => map(lspHashCode, lspHashCode, lspHashCode);
 
   @override
   bool operator ==(o) =>
-      o is Either3<T1, T2, T3> && o._t1 == _t1 && o._t2 == _t2 && o._t3 == _t3;
+      o is Either3<T1, T2, T3> &&
+      lspEquals(o._t1, _t1) &&
+      lspEquals(o._t2, _t2) &&
+      lspEquals(o._t3, _t3);
 
   T map<T>(T Function(T1) f1, T Function(T2) f2, T Function(T3) f3) {
     switch (_which) {
@@ -146,16 +182,15 @@
         _which = 4;
 
   @override
-  int get hashCode => map((t) => t.hashCode, (t) => t.hashCode,
-      (t) => t.hashCode, (t) => t.hashCode);
+  int get hashCode => map(lspHashCode, lspHashCode, lspHashCode, lspHashCode);
 
   @override
   bool operator ==(o) =>
       o is Either4<T1, T2, T3, T4> &&
-      o._t1 == _t1 &&
-      o._t2 == _t2 &&
-      o._t3 == _t3 &&
-      o._t4 == _t4;
+      lspEquals(o._t1, _t1) &&
+      lspEquals(o._t2, _t2) &&
+      lspEquals(o._t3, _t3) &&
+      lspEquals(o._t4, _t4);
 
   T map<T>(T Function(T1) f1, T Function(T2) f2, T Function(T3) f3,
       T Function(T4) f4) {
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
index 3af7d6f..6931804 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart
@@ -25,6 +25,7 @@
 import 'package:analyzer/dart/analysis/session.dart'
     show InconsistentAnalysisException;
 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine;
+import 'package:collection/collection.dart' show groupBy;
 
 class CodeActionHandler extends MessageHandler<CodeActionParams,
     List<Either2<Command, CodeAction>>> {
@@ -96,29 +97,52 @@
   /// version of each document being modified so it's important to call this
   /// immediately after computing edits to ensure the document is not modified
   /// before the version number is read.
-  Either2<Command, CodeAction> _createAssistAction(Assist assist) {
-    return Either2<Command, CodeAction>.t2(CodeAction(
+  CodeAction _createAssistAction(Assist assist) {
+    return CodeAction(
       assist.change.message,
       toCodeActionKind(assist.change.id, CodeActionKind.Refactor),
       const [],
       createWorkspaceEdit(server, assist.change.edits),
       null,
-    ));
+    );
   }
 
   /// Creates a CodeAction to apply this fix. Note: This code will fetch the
   /// version of each document being modified so it's important to call this
   /// immediately after computing edits to ensure the document is not modified
   /// before the version number is read.
-  Either2<Command, CodeAction> _createFixAction(
-      Fix fix, Diagnostic diagnostic) {
-    return Either2<Command, CodeAction>.t2(CodeAction(
+  CodeAction _createFixAction(Fix fix, Diagnostic diagnostic) {
+    return CodeAction(
       fix.change.message,
       toCodeActionKind(fix.change.id, CodeActionKind.QuickFix),
       [diagnostic],
       createWorkspaceEdit(server, fix.change.edits),
       null,
-    ));
+    );
+  }
+
+  /// Dedupes actions that perform the same edit and merge their diagnostics
+  /// together. This avoids duplicates where there are multiple errors on
+  /// the same line that have the same fix (for example importing a
+  /// library that fixes multiple unresolved types).
+  List<CodeAction> _dedupeActions(Iterable<CodeAction> actions) {
+    final groups = groupBy(actions, (CodeAction action) => action.edit);
+    return groups.keys.map((edit) {
+      final first = groups[edit].first;
+      // Avoid constructing new CodeActions if there was only one in this group.
+      if (groups[edit].length == 1) {
+        return first;
+      }
+      // Build a new CodeAction that merges the diagnostics from each same
+      // code action onto a single one.
+      return CodeAction(
+          first.title,
+          first.kind,
+          // Merge diagnostics from all of the CodeActions.
+          groups[edit].expand((r) => r.diagnostics).toList(),
+          first.edit,
+          first.command);
+    }).toList();
   }
 
   Future<List<Either2<Command, CodeAction>>> _getAssistActions(
@@ -145,7 +169,11 @@
       final assists = await processor.compute();
       assists.sort(Assist.SORT_BY_RELEVANCE);
 
-      return assists.map(_createAssistAction).toList();
+      final assistActions = _dedupeActions(assists.map(_createAssistAction));
+
+      return assistActions
+          .map((action) => Either2<Command, CodeAction>.t2(action))
+          .toList();
     } on InconsistentAnalysisException {
       // If an InconsistentAnalysisException occurs, it's likely the user modified
       // the source and therefore is no longer interested in the results, so
@@ -172,6 +200,7 @@
       _getFixActions(kinds, supportsLiterals, range, unit),
     ]);
     final flatResults = results.expand((x) => x).toList();
+
     return success(flatResults);
   }
 
@@ -188,7 +217,7 @@
     }
 
     final lineInfo = unit.lineInfo;
-    final codeActions = <Either2<Command, CodeAction>>[];
+    final codeActions = <CodeAction>[];
     final fixContributor = DartFixContributor();
 
     try {
@@ -216,7 +245,12 @@
           }
         }
       }
-      return codeActions;
+
+      final dedupedActions = _dedupeActions(codeActions);
+
+      return dedupedActions
+          .map((action) => Either2<Command, CodeAction>.t2(action))
+          .toList();
     } on InconsistentAnalysisException {
       // If an InconsistentAnalysisException occurs, it's likely the user modified
       // the source and therefore is no longer interested in the results, so
diff --git a/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart b/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
index bcfdd0a..64bb954 100644
--- a/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
+++ b/pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart
@@ -522,18 +522,14 @@
   /// given absolute path.
   bool shouldSendFlutterOutlineFor(String file) {
     // Outlines should only be sent for open (priority) files in the workspace.
-    return initializationOptions.flutterOutline &&
-        priorityFiles.contains(file) &&
-        contextManager.isInAnalysisRoot(file);
+    return initializationOptions.flutterOutline && priorityFiles.contains(file);
   }
 
   /// Returns `true` if outlines should be sent for [file] with the given
   /// absolute path.
   bool shouldSendOutlineFor(String file) {
     // Outlines should only be sent for open (priority) files in the workspace.
-    return initializationOptions.outline &&
-        priorityFiles.contains(file) &&
-        contextManager.isInAnalysisRoot(file);
+    return initializationOptions.outline && priorityFiles.contains(file);
   }
 
   void showErrorMessageToUser(String message) {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index f4d50d32..de6425d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -125,8 +125,6 @@
       ..replacementLength = range.length;
 
     // Request Dart specific completions from each contributor
-    var suggestionMap = <String, CompletionSuggestion>{};
-    var constructorMap = <String, List<String>>{};
     var builder = SuggestionBuilder(dartRequest, listener: listener);
     var contributors = <DartCompletionContributor>[
       ArgListContributor(),
@@ -154,31 +152,6 @@
       contributors.add(ImportedReferenceContributor());
     }
 
-    void addSuggestionToMap(CompletionSuggestion newSuggestion) {
-      // TODO(brianwilkerson) After all contributors are using SuggestionBuilder
-      //  move this logic into SuggestionBuilder.
-      var key = newSuggestion.completion;
-
-      // Append parenthesis for constructors to disambiguate from classes.
-      if (_isConstructor(newSuggestion)) {
-        key += '()';
-        var className = _getConstructorClassName(newSuggestion);
-        _ensureList(constructorMap, className).add(key);
-      }
-
-      // Local declarations hide both the class and its constructors.
-      if (!_isClass(newSuggestion)) {
-        var constructorKeys = constructorMap[key];
-        constructorKeys?.forEach(suggestionMap.remove);
-      }
-
-      var oldSuggestion = suggestionMap[key];
-      if (oldSuggestion == null ||
-          oldSuggestion.relevance < newSuggestion.relevance) {
-        suggestionMap[key] = newSuggestion;
-      }
-    }
-
     try {
       for (var contributor in contributors) {
         var contributorTag =
@@ -188,9 +161,6 @@
         performance.logElapseTime(contributorTag);
         request.checkAborted();
       }
-      for (var newSuggestion in builder.suggestions) {
-        addSuggestionToMap(newSuggestion);
-      }
     } on InconsistentAnalysisException {
       // The state of the code being analyzed has changed, so results are likely
       // to be inconsistent. Just abort the operation.
@@ -198,7 +168,7 @@
     }
 
     // Adjust suggestion relevance before returning
-    var suggestions = suggestionMap.values.toList();
+    var suggestions = builder.suggestions.toList();
     const SORT_TAG = 'DartCompletionManager - sort';
     performance.logStartTime(SORT_TAG);
     if (ranking != null) {
@@ -336,33 +306,6 @@
       }
     }
   }
-
-  static List<String> _ensureList(Map<String, List<String>> map, String key) {
-    var list = map[key];
-    if (list == null) {
-      list = <String>[];
-      map[key] = list;
-    }
-    return list;
-  }
-
-  static String _getConstructorClassName(CompletionSuggestion suggestion) {
-    var completion = suggestion.completion;
-    var dotIndex = completion.indexOf('.');
-    if (dotIndex != -1) {
-      return completion.substring(0, dotIndex);
-    } else {
-      return completion;
-    }
-  }
-
-  static bool _isClass(CompletionSuggestion suggestion) {
-    return suggestion.element?.kind == protocol.ElementKind.CLASS;
-  }
-
-  static bool _isConstructor(CompletionSuggestion suggestion) {
-    return suggestion.element?.kind == protocol.ElementKind.CONSTRUCTOR;
-  }
 }
 
 /// The information about a requested list of completions within a Dart file.
@@ -429,9 +372,8 @@
   DartType get contextType {
     if (!_hasComputedContextType) {
       var entity = target.entity;
-      if (entity is AstNode) {
-        _contextType = featureComputer.computeContextType(entity);
-      }
+      _contextType = featureComputer.computeContextType(
+          target.containingNode, entity.offset);
       _hasComputedContextType = true;
     }
     return _contextType;
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
index a33b3a4..6e236a5 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
@@ -27,6 +27,7 @@
 import 'package:analyzer/dart/element/type_provider.dart';
 import 'package:analyzer/dart/element/type_system.dart';
 import 'package:analyzer/src/dart/resolver/body_inference_context.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
 
 /// Convert a relevance score (assumed to be between `0.0` and `1.0` inclusive)
 /// to a relevance value between `0` and `1000`. If the score is outside that
@@ -71,10 +72,11 @@
   /// Initialize a newly created feature computer.
   FeatureComputer(this.typeSystem, this.typeProvider);
 
-  /// Return the type imposed on the given [node] based on its context, or
-  /// `null` if the context does not impose any type.
-  DartType computeContextType(AstNode node) {
-    var type = node.parent?.accept(_ContextTypeVisitor(typeProvider, node));
+  /// Return the type imposed when completing at the given [offset], where the
+  /// offset is within the given [node], or `null` if the context does not
+  /// impose any type.
+  DartType computeContextType(AstNode node, int offset) {
+    var type = node.accept(_ContextTypeVisitor(typeProvider, offset));
     if (type == null || type.isDynamic) {
       return null;
     }
@@ -282,13 +284,13 @@
 class _ContextTypeVisitor extends SimpleAstVisitor<DartType> {
   final TypeProvider typeProvider;
 
-  AstNode childNode;
+  int offset;
 
-  _ContextTypeVisitor(this.typeProvider, this.childNode);
+  _ContextTypeVisitor(this.typeProvider, this.offset);
 
   @override
   DartType visitAdjacentStrings(AdjacentStrings node) {
-    if (childNode == node.strings[0]) {
+    if (offset == node.offset) {
       return _visitParent(node);
     }
     return typeProvider.stringType;
@@ -296,12 +298,57 @@
 
   @override
   DartType visitArgumentList(ArgumentList node) {
-    return (childNode as Expression).staticParameterElement?.type;
+    if (range
+        .endStart(node.leftParenthesis, node.rightParenthesis)
+        .contains(offset)) {
+      final paramElts = node.functionType?.parameters;
+      if (paramElts == null || paramElts.isEmpty) {
+        return null;
+      }
+
+      // Required parameters
+      final positionalParamElts =
+          paramElts.where((param) => !param.isNamed)?.toList(growable: false);
+      var i = 0;
+      if (positionalParamElts.isNotEmpty) {
+        for (;
+            i < node.arguments.length && i < positionalParamElts.length;
+            i++) {
+          // We don't need to compare offsets between commas, tests show that
+          // such tests aren't needed, also the commas and their respective
+          // offsets aren't accessible with existing getters and setters.
+          if (node.arguments[i].contains(offset)) {
+            return positionalParamElts[i].type;
+          }
+        }
+        // The case where the user is filling out the required parameters
+        if (i < positionalParamElts.length) {
+          return positionalParamElts[i].type;
+        }
+      }
+      // Named and positional parameters
+      if (positionalParamElts.length < paramElts.length) {
+        for (; i < node.arguments.length && i < paramElts.length; i++) {
+          if (node.arguments[i].contains(offset)) {
+            if (node.arguments[i] is NamedExpression) {
+              var namedExpression = node.arguments[i] as NamedExpression;
+              var needle = paramElts
+                  .where((paramElt) =>
+                      paramElt.isNamed &&
+                      paramElt.name == namedExpression.name.label.name)
+                  ?.first;
+              return needle?.type;
+            }
+          }
+        }
+      }
+    }
+    return null;
   }
 
   @override
   DartType visitAsExpression(AsExpression node) {
-    if (childNode == node.type) {
+    if (node.asOperator.end < offset) {
       return node.expression.staticType;
     }
     return null;
@@ -309,7 +356,10 @@
 
   @override
   DartType visitAssertInitializer(AssertInitializer node) {
-    if (childNode == node.condition) {
+    if (range
+        .endStart(node.leftParenthesis,
+            node.message?.beginToken?.previous ?? node.rightParenthesis)
+        .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -317,7 +367,10 @@
 
   @override
   DartType visitAssertStatement(AssertStatement node) {
-    if (childNode == node.condition) {
+    if (range
+        .endStart(node.leftParenthesis,
+            node.message?.beginToken?.previous ?? node.rightParenthesis)
+        .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -325,7 +378,8 @@
 
   @override
   DartType visitAssignmentExpression(AssignmentExpression node) {
-    if (childNode == node.rightHandSide) {
+    if (node.operator.end <= offset) {
+      // RHS
       if (node.operator.type == TokenType.EQ) {
         return node.leftHandSide.staticType;
       }
@@ -347,15 +401,15 @@
 
   @override
   DartType visitBinaryExpression(BinaryExpression node) {
-    if (childNode == node.rightOperand) {
-      return (childNode as Expression).staticParameterElement?.type;
+    if (node.operator.end <= offset) {
+      return node.rightOperand.staticParameterElement?.type;
     }
     return _visitParent(node);
   }
 
   @override
   DartType visitCascadeExpression(CascadeExpression node) {
-    if (childNode == node.target) {
+    if (node.target != null && offset == node.target.offset) {
       return _visitParent(node);
     }
     return null;
@@ -363,7 +417,7 @@
 
   @override
   DartType visitConditionalExpression(ConditionalExpression node) {
-    if (childNode == node.condition) {
+    if (offset <= node.question.offset) {
       return typeProvider.boolType;
     } else {
       return _visitParent(node);
@@ -372,7 +426,7 @@
 
   @override
   DartType visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    if (childNode == node.expression) {
+    if (node.equals != null && node.equals.end <= offset) {
       var element = node.fieldName.staticElement;
       if (element is FieldElement) {
         return element.type;
@@ -383,7 +437,7 @@
 
   @override
   DartType visitDefaultFormalParameter(DefaultFormalParameter node) {
-    if (childNode == node.defaultValue) {
+    if (node.separator != null && node.separator.end <= offset) {
       return node.parameter.declaredElement.type;
     }
     return null;
@@ -391,7 +445,9 @@
 
   @override
   DartType visitDoStatement(DoStatement node) {
-    if (childNode == node.condition) {
+    if (range
+        .endStart(node.leftParenthesis, node.rightParenthesis)
+        .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -399,7 +455,7 @@
 
   @override
   DartType visitExpressionFunctionBody(ExpressionFunctionBody node) {
-    if (childNode == node.expression) {
+    if (range.endEnd(node.functionDefinition, node).contains(offset)) {
       var parent = node.parent;
       if (parent is MethodDeclaration) {
         return BodyInferenceContext.of(parent.body).contextType;
@@ -416,7 +472,9 @@
 
   @override
   DartType visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
-    if (childNode == node.iterable) {
+    if (range
+        .startOffsetEndOffset(node.inKeyword.end, node.end)
+        .contains(offset)) {
       var parent = node.parent;
       if ((parent is ForStatement && parent.awaitKeyword != null) ||
           (parent is ForElement && parent.awaitKeyword != null)) {
@@ -429,7 +487,7 @@
 
   @override
   DartType visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
-    if (childNode == node.iterable) {
+    if (range.endEnd(node.inKeyword, node).contains(offset)) {
       var parent = node.parent;
       if ((parent is ForStatement && parent.awaitKeyword != null) ||
           (parent is ForElement && parent.awaitKeyword != null)) {
@@ -442,7 +500,11 @@
 
   @override
   DartType visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
-    if (childNode == node.condition) {
+    if (node.leftSeparator != null &&
+        node.rightSeparator != null &&
+        range
+            .endStart(node.leftSeparator, node.rightSeparator)
+            .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -450,7 +512,11 @@
 
   @override
   DartType visitForPartsWithExpression(ForPartsWithExpression node) {
-    if (childNode == node.condition) {
+    if (node.leftSeparator != null &&
+        node.rightSeparator != null &&
+        range
+            .endStart(node.leftSeparator, node.rightSeparator)
+            .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -459,7 +525,7 @@
   @override
   DartType visitFunctionExpressionInvocation(
       FunctionExpressionInvocation node) {
-    if (childNode == node.function) {
+    if (node.function.contains(offset)) {
       return _visitParent(node);
     }
     return null;
@@ -467,7 +533,9 @@
 
   @override
   DartType visitIfElement(IfElement node) {
-    if (childNode == node.condition) {
+    if (range
+        .endStart(node.leftParenthesis, node.rightParenthesis)
+        .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -475,7 +543,9 @@
 
   @override
   DartType visitIfStatement(IfStatement node) {
-    if (childNode == node.condition) {
+    if (range
+        .endStart(node.leftParenthesis, node.rightParenthesis)
+        .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -483,7 +553,7 @@
 
   @override
   DartType visitIndexExpression(IndexExpression node) {
-    if (childNode == node.index) {
+    if (range.endStart(node.leftBracket, node.rightBracket).contains(offset)) {
       var parameters = node.staticElement?.parameters;
       if (parameters != null && parameters.isNotEmpty) {
         return parameters[0].type;
@@ -494,15 +564,23 @@
 
   @override
   DartType visitIsExpression(IsExpression node) {
-    if (childNode == node.type) {
+    if (node.isOperator.end < offset) {
       return node.expression.staticType;
     }
     return null;
   }
 
   @override
+  DartType visitLabel(Label node) {
+    if (node.colon.end <= offset) {
+      return _visitParent(node);
+    }
+    return null;
+  }
+
+  @override
   DartType visitListLiteral(ListLiteral node) {
-    if (node.elements.contains(childNode)) {
+    if (range.endStart(node.leftBracket, node.rightBracket).contains(offset)) {
       return (node.staticType as InterfaceType).typeArguments[0];
     }
     return null;
@@ -513,7 +591,7 @@
     var literal = node.thisOrAncestorOfType<SetOrMapLiteral>();
     if (literal != null && literal.staticType.isDartCoreMap) {
       var typeArguments = (literal.staticType as InterfaceType).typeArguments;
-      if (childNode == node.key) {
+      if (offset <= node.separator.offset) {
         return typeArguments[0];
       } else {
         return typeArguments[1];
@@ -524,7 +602,7 @@
 
   @override
   DartType visitMethodInvocation(MethodInvocation node) {
-    if (childNode == node.target || childNode == node.methodName) {
+    if (offset == node.offset) {
       return _visitParent(node);
     }
     return null;
@@ -532,10 +610,10 @@
 
   @override
   DartType visitNamedExpression(NamedExpression node) {
-    if (childNode == node.expression) {
+    if (node.name.end <= offset) {
       return _visitParent(node);
     }
-    return super.visitNamedExpression(node);
+    return null;
   }
 
   @override
@@ -545,7 +623,7 @@
 
   @override
   DartType visitPostfixExpression(PostfixExpression node) {
-    return (childNode as Expression).staticParameterElement?.type;
+    return node.operand.staticParameterElement?.type;
   }
 
   @override
@@ -555,7 +633,7 @@
 
   @override
   DartType visitPrefixExpression(PrefixExpression node) {
-    return (childNode as Expression).staticParameterElement?.type;
+    return node.operand.staticParameterElement?.type;
   }
 
   @override
@@ -565,7 +643,7 @@
 
   @override
   DartType visitReturnStatement(ReturnStatement node) {
-    if (childNode == node.expression) {
+    if (node.returnKeyword.end < offset) {
       var functionBody = node.thisOrAncestorOfType<FunctionBody>();
       if (functionBody != null) {
         return BodyInferenceContext.of(functionBody).contextType;
@@ -577,7 +655,7 @@
   @override
   DartType visitSetOrMapLiteral(SetOrMapLiteral node) {
     var type = node.staticType;
-    if (node.elements.contains(childNode) &&
+    if (range.endStart(node.leftBracket, node.rightBracket).contains(offset) &&
         (type.isDartCoreMap || type.isDartCoreSet)) {
       return (type as InterfaceType).typeArguments[0];
     }
@@ -585,8 +663,20 @@
   }
 
   @override
+  DartType visitSimpleIdentifier(SimpleIdentifier node) {
+    return _visitParent(node);
+  }
+
+  @override
+  DartType visitSimpleStringLiteral(SimpleStringLiteral node) {
+    // The only completion inside of a String literal would be a directive,
+    // where the context type would not be of value.
+    return null;
+  }
+
+  @override
   DartType visitSpreadElement(SpreadElement node) {
-    if (childNode == node.expression) {
+    if (node.spreadOperator.end <= offset) {
       var currentNode = node.parent;
       while (currentNode != null) {
         if (currentNode is ListLiteral) {
@@ -606,7 +696,7 @@
 
   @override
   DartType visitSwitchCase(SwitchCase node) {
-    if (childNode == node.expression) {
+    if (range.endStart(node.keyword, node.colon).contains(offset)) {
       var parent = node.parent;
       if (parent is SwitchStatement) {
         return parent.expression?.staticType;
@@ -617,7 +707,7 @@
 
   @override
   DartType visitVariableDeclaration(VariableDeclaration node) {
-    if (childNode == node.initializer) {
+    if (node.equals != null && node.equals.end < offset) {
       var parent = node.parent;
       if (parent is VariableDeclarationList) {
         return parent.type?.type;
@@ -628,7 +718,9 @@
 
   @override
   DartType visitWhileStatement(WhileStatement node) {
-    if (childNode == node.condition) {
+    if (range
+        .endStart(node.leftParenthesis, node.rightParenthesis)
+        .contains(offset)) {
       return typeProvider.boolType;
     }
     return null;
@@ -636,7 +728,7 @@
 
   @override
   DartType visitYieldStatement(YieldStatement node) {
-    if (childNode == node.expression) {
+    if (range.endStart(node.yieldKeyword, node.semicolon).contains(offset)) {
       var functionBody = node.thisOrAncestorOfType<FunctionBody>();
       if (functionBody != null) {
         return BodyInferenceContext.of(functionBody).contextType;
@@ -653,7 +745,27 @@
     if (parent == null) {
       return null;
     }
-    childNode = node;
     return parent.accept(this);
   }
 }
+
+/// Some useful extensions on [AstNode] for this computer.
+extension AstNodeFeatureComputerExtension on AstNode {
+  bool contains(int o) => offset <= o && o <= end;
+
+  /// Return the [FunctionType], if there is one, for this [AstNode].
+  FunctionType get functionType {
+    if (parent is MethodInvocation) {
+      var type = (parent as MethodInvocation).staticInvokeType;
+      if (type is FunctionType) {
+        return type;
+      }
+    } else if (parent is FunctionExpressionInvocation) {
+      var type = (parent as FunctionExpressionInvocation).staticInvokeType;
+      if (type is FunctionType) {
+        return type;
+      }
+    }
+    return null;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 3076e34..1aeb413 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -14,10 +14,18 @@
 import 'package:analysis_server/src/services/correction/dart/add_diagnostic_property_reference.dart';
 import 'package:analysis_server/src/services/correction/dart/add_return_type.dart';
 import 'package:analysis_server/src/services/correction/dart/add_type_annotation.dart';
+import 'package:analysis_server/src/services/correction/dart/assign_to_local_variable.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_add_all_to_spread.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_class_to_mixin.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_conditional_expression_to_if_element.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_documentation_into_block.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_documentation_into_line.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_into_async_body.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_into_block_body.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_into_final_field.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_into_getter.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_map_from_iterable_to_for_literal.dart';
+import 'package:analysis_server/src/services/correction/dart/convert_part_of_to_uri.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_quotes.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_to_expression_function_body.dart';
 import 'package:analysis_server/src/services/correction/dart/convert_to_generic_function_syntax.dart';
@@ -59,7 +67,6 @@
 import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
 import 'package:analyzer_plugin/utilities/range_factory.dart';
 import 'package:meta/meta.dart';
-import 'package:path/path.dart' hide context;
 
 typedef _SimpleIdentifierVisitor = void Function(SimpleIdentifier node);
 
@@ -75,10 +82,18 @@
     AddDiagnosticPropertyReference.newInstance,
     AddReturnType.newInstance,
     AddTypeAnnotation.newInstance,
+    AssignToLocalVariable.newInstance,
     ConvertAddAllToSpread.newInstance,
+    ConvertClassToMixin.newInstance,
     ConvertConditionalExpressionToIfElement.newInstance,
+    ConvertDocumentationIntoBlock.newInstance,
     ConvertDocumentationIntoLine.newInstance,
+    ConvertIntoAsyncBody.newInstance,
+    ConvertIntoBlockBody.newInstance,
+    ConvertIntoFinalField.newInstance,
+    ConvertIntoGetter.newInstance,
     ConvertMapFromIterableToForLiteral.newInstance,
+    ConvertPartOfToUri.newInstance,
     ConvertToDoubleQuotes.newInstance,
     ConvertToSingleQuotes.newInstance,
     ConvertToExpressionFunctionBody.newInstance,
@@ -117,14 +132,6 @@
       return assists;
     }
     await _addProposal_addNotNullAssert();
-    await _addProposal_assignToLocalVariable();
-    await _addProposal_convertClassToMixin();
-    await _addProposal_convertDocumentationIntoBlock();
-    await _addProposal_convertIntoFinalField();
-    await _addProposal_convertIntoGetter();
-    await _addProposal_convertPartOfToUri();
-    await _addProposal_convertToAsyncFunctionBody();
-    await _addProposal_convertToBlockFunctionBody();
     await _addProposal_convertToFieldParameter();
     await _addProposal_convertToForIndexLoop();
     await _addProposal_convertToIsNot_onIs();
@@ -191,7 +198,7 @@
 
     // Calculate only specific assists for edit.dartFix
     if (assistKind == DartAssistKind.CONVERT_CLASS_TO_MIXIN) {
-      await _addProposal_convertClassToMixin();
+      await compute(ConvertClassToMixin());
     } else if (assistKind == DartAssistKind.CONVERT_TO_INT_LITERAL) {
       await compute(ConvertToIntLiteral());
     } else if (assistKind == DartAssistKind.CONVERT_TO_SPREAD) {
@@ -300,351 +307,6 @@
     }
   }
 
-  Future<void> _addProposal_assignToLocalVariable() async {
-    // prepare enclosing ExpressionStatement
-    ExpressionStatement expressionStatement;
-    // ignore: unnecessary_this
-    for (var node = this.node; node != null; node = node.parent) {
-      if (node is ExpressionStatement) {
-        expressionStatement = node;
-        break;
-      }
-      if (node is ArgumentList ||
-          node is AssignmentExpression ||
-          node is Statement ||
-          node is ThrowExpression) {
-        return;
-      }
-    }
-    if (expressionStatement == null) {
-      return;
-    }
-    // prepare expression
-    var expression = expressionStatement.expression;
-    var offset = expression.offset;
-    // prepare expression type
-    var type = expression.staticType;
-    if (type.isVoid) {
-      return;
-    }
-    // prepare excluded names
-    var excluded = <String>{};
-    var scopedNameFinder = ScopedNameFinder(offset);
-    expression.accept(scopedNameFinder);
-    excluded.addAll(scopedNameFinder.locals.keys.toSet());
-    var suggestions =
-        getVariableNameSuggestionsForExpression(type, expression, excluded);
-
-    if (suggestions.isNotEmpty) {
-      var changeBuilder = _newDartChangeBuilder();
-      await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-        builder.addInsertion(offset, (DartEditBuilder builder) {
-          builder.write('var ');
-          builder.addSimpleLinkedEdit('NAME', suggestions[0],
-              kind: LinkedEditSuggestionKind.VARIABLE,
-              suggestions: suggestions);
-          builder.write(' = ');
-        });
-      });
-      _addAssistFromBuilder(
-          changeBuilder, DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
-    }
-  }
-
-  Future<void> _addProposal_convertClassToMixin() async {
-    var classDeclaration = node.thisOrAncestorOfType<ClassDeclaration>();
-    if (classDeclaration == null) {
-      return;
-    }
-    if (selectionOffset > classDeclaration.name.end ||
-        selectionEnd < classDeclaration.classKeyword.offset) {
-      return;
-    }
-    if (classDeclaration.members
-        .any((member) => member is ConstructorDeclaration)) {
-      return;
-    }
-    var finder = _SuperclassReferenceFinder();
-    classDeclaration.accept(finder);
-    var referencedClasses = finder.referencedClasses;
-    var superclassConstraints = <InterfaceType>[];
-    var interfaces = <InterfaceType>[];
-
-    var classElement = classDeclaration.declaredElement;
-    for (var type in classElement.mixins) {
-      if (referencedClasses.contains(type.element)) {
-        superclassConstraints.add(type);
-      } else {
-        interfaces.add(type);
-      }
-    }
-    var extendsClause = classDeclaration.extendsClause;
-    if (extendsClause != null) {
-      if (referencedClasses.length > superclassConstraints.length) {
-        superclassConstraints.insert(0, classElement.supertype);
-      } else {
-        interfaces.insert(0, classElement.supertype);
-      }
-    }
-    interfaces.addAll(classElement.interfaces);
-
-    var changeBuilder = _newDartChangeBuilder();
-    await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-      builder.addReplacement(
-          range.startStart(
-              classDeclaration.abstractKeyword ?? classDeclaration.classKeyword,
-              classDeclaration.leftBracket), (DartEditBuilder builder) {
-        builder.write('mixin ');
-        builder.write(classDeclaration.name.name);
-        builder.writeTypeParameters(
-            classDeclaration.declaredElement.typeParameters);
-        builder.writeTypes(superclassConstraints, prefix: ' on ');
-        builder.writeTypes(interfaces, prefix: ' implements ');
-        builder.write(' ');
-      });
-    });
-    _addAssistFromBuilder(changeBuilder, DartAssistKind.CONVERT_CLASS_TO_MIXIN);
-  }
-
-  Future<void> _addProposal_convertDocumentationIntoBlock() async {
-    var comment = node.thisOrAncestorOfType<Comment>();
-    if (comment == null || !comment.isDocumentation) {
-      return;
-    }
-    var tokens = comment.tokens;
-    if (tokens.isEmpty ||
-        tokens.any((Token token) =>
-            token is! DocumentationCommentToken ||
-            token.type != TokenType.SINGLE_LINE_COMMENT)) {
-      return;
-    }
-    var prefix = utils.getNodePrefix(comment);
-
-    var changeBuilder = _newDartChangeBuilder();
-    await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-      builder.addReplacement(range.node(comment), (DartEditBuilder builder) {
-        builder.writeln('/**');
-        for (var token in comment.tokens) {
-          builder.write(prefix);
-          builder.write(' *');
-          builder.writeln(token.lexeme.substring('///'.length));
-        }
-        builder.write(prefix);
-        builder.write(' */');
-      });
-    });
-    _addAssistFromBuilder(
-        changeBuilder, DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK);
-  }
-
-  Future<void> _addProposal_convertIntoFinalField() async {
-    // Find the enclosing getter.
-    MethodDeclaration getter;
-    for (var n = node; n != null; n = n.parent) {
-      if (n is MethodDeclaration) {
-        getter = n;
-        break;
-      }
-      if (n is SimpleIdentifier ||
-          n is TypeAnnotation ||
-          n is TypeArgumentList) {
-        continue;
-      }
-      break;
-    }
-    if (getter == null || !getter.isGetter) {
-      return;
-    }
-    // Check that there is no corresponding setter.
-    {
-      var element = getter.declaredElement;
-      if (element == null) {
-        return;
-      }
-      var enclosing = element.enclosingElement;
-      if (enclosing is ClassElement) {
-        if (enclosing.getSetter(element.name) != null) {
-          return;
-        }
-      }
-    }
-    // Try to find the returned expression.
-    Expression expression;
-    {
-      var body = getter.body;
-      if (body is ExpressionFunctionBody) {
-        expression = body.expression;
-      } else if (body is BlockFunctionBody) {
-        List<Statement> statements = body.block.statements;
-        if (statements.length == 1) {
-          var statement = statements.first;
-          if (statement is ReturnStatement) {
-            expression = statement.expression;
-          }
-        }
-      }
-    }
-    // Use the returned expression as the field initializer.
-    if (expression != null) {
-      var code = 'final';
-      if (getter.returnType != null) {
-        code += ' ' + _getNodeText(getter.returnType);
-      }
-      code += ' ' + _getNodeText(getter.name);
-      if (expression is! NullLiteral) {
-        code += ' = ' + _getNodeText(expression);
-      }
-      code += ';';
-      var replacementRange =
-          range.startEnd(getter.returnType ?? getter.propertyKeyword, getter);
-      var changeBuilder = _newDartChangeBuilder();
-      await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-        builder.addSimpleReplacement(replacementRange, code);
-      });
-      _addAssistFromBuilder(
-          changeBuilder, DartAssistKind.CONVERT_INTO_FINAL_FIELD);
-    }
-  }
-
-  Future<void> _addProposal_convertIntoGetter() async {
-    // Find the enclosing field declaration.
-    FieldDeclaration fieldDeclaration;
-    for (var n = node; n != null; n = n.parent) {
-      if (n is FieldDeclaration) {
-        fieldDeclaration = n;
-        break;
-      }
-      if (n is SimpleIdentifier ||
-          n is VariableDeclaration ||
-          n is VariableDeclarationList ||
-          n is TypeAnnotation ||
-          n is TypeArgumentList) {
-        continue;
-      }
-      break;
-    }
-    if (fieldDeclaration == null) {
-      return;
-    }
-    // The field must be final and has only one variable.
-    var fieldList = fieldDeclaration.fields;
-    if (!fieldList.isFinal || fieldList.variables.length != 1) {
-      return;
-    }
-    var field = fieldList.variables.first;
-    // Prepare the initializer.
-    var initializer = field.initializer;
-    if (initializer == null) {
-      return;
-    }
-    // Add proposal.
-    var code = '';
-    if (fieldList.type != null) {
-      code += _getNodeText(fieldList.type) + ' ';
-    }
-    code += 'get';
-    code += ' ' + _getNodeText(field.name);
-    code += ' => ' + _getNodeText(initializer);
-    code += ';';
-    var replacementRange = range.startEnd(fieldList.keyword, fieldDeclaration);
-    var changeBuilder = _newDartChangeBuilder();
-    await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-      builder.addSimpleReplacement(replacementRange, code);
-    });
-    _addAssistFromBuilder(changeBuilder, DartAssistKind.CONVERT_INTO_GETTER);
-  }
-
-  Future<void> _addProposal_convertPartOfToUri() async {
-    var directive = node.thisOrAncestorOfType<PartOfDirective>();
-    if (directive == null || directive.libraryName == null) {
-      return;
-    }
-    var libraryPath = context.resolveResult.libraryElement.source.fullName;
-    var partPath = context.resolveResult.path;
-    var relativePath = relative(libraryPath, from: dirname(partPath));
-    var uri = Uri.file(relativePath).toString();
-    var replacementRange = range.node(directive.libraryName);
-    var changeBuilder = _newDartChangeBuilder();
-    await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-      builder.addSimpleReplacement(replacementRange, "'$uri'");
-    });
-    _addAssistFromBuilder(changeBuilder, DartAssistKind.CONVERT_PART_OF_TO_URI);
-  }
-
-  Future<void> _addProposal_convertToAsyncFunctionBody() async {
-    var body = _getEnclosingFunctionBody();
-    if (body == null ||
-        body is EmptyFunctionBody ||
-        body.isAsynchronous ||
-        body.isGenerator) {
-      return;
-    }
-
-    // Function bodies can be quite large, e.g. Flutter build() methods.
-    // It is surprising to see this Quick Assist deep in a function body.
-    if (body is BlockFunctionBody &&
-        selectionOffset > body.block.beginToken.end) {
-      return;
-    }
-    if (body is ExpressionFunctionBody &&
-        selectionOffset > body.beginToken.end) {
-      return;
-    }
-
-    var parent = body.parent;
-    if (parent is ConstructorDeclaration) {
-      return;
-    }
-
-    var changeBuilder = _newDartChangeBuilder();
-    await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-      builder.convertFunctionFromSyncToAsync(body, typeProvider);
-    });
-    _addAssistFromBuilder(
-        changeBuilder, DartAssistKind.CONVERT_INTO_ASYNC_BODY);
-  }
-
-  Future<void> _addProposal_convertToBlockFunctionBody() async {
-    var body = _getEnclosingFunctionBody();
-    // prepare expression body
-    if (body is! ExpressionFunctionBody || body.isGenerator) {
-      return;
-    }
-
-    var returnValue = (body as ExpressionFunctionBody).expression;
-
-    // Return expressions can be quite large, e.g. Flutter build() methods.
-    // It is surprising to see this Quick Assist deep in the function body.
-    if (selectionOffset >= returnValue.offset) {
-      return;
-    }
-
-    var returnValueType = returnValue.staticType;
-    var returnValueCode = _getNodeText(returnValue);
-    // prepare prefix
-    var prefix = utils.getNodePrefix(body.parent);
-    var indent = utils.getIndent(1);
-
-    var changeBuilder = _newDartChangeBuilder();
-    await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
-      builder.addReplacement(range.node(body), (DartEditBuilder builder) {
-        if (body.isAsynchronous) {
-          builder.write('async ');
-        }
-        builder.write('{$eol$prefix$indent');
-        if (!returnValueType.isVoid && !returnValueType.isBottom) {
-          builder.write('return ');
-        }
-        builder.write(returnValueCode);
-        builder.write(';');
-        builder.selectHere();
-        builder.write('$eol$prefix}');
-      });
-    });
-    _addAssistFromBuilder(
-        changeBuilder, DartAssistKind.CONVERT_INTO_BLOCK_BODY);
-  }
-
   Future<void> _addProposal_convertToFieldParameter() async {
     if (node == null) {
       return;
@@ -2714,29 +2376,6 @@
     }
   }
 
-  FunctionBody _getEnclosingFunctionBody() {
-    // This is duplicated from [CorrectionProducer] and should be replaced by
-    // that method when the assists that reference it are converted to be
-    // producers.
-    var closure = node.thisOrAncestorOfType<FunctionExpression>();
-    if (closure != null) {
-      return closure.body;
-    }
-    var function = node.thisOrAncestorOfType<FunctionDeclaration>();
-    if (function != null) {
-      return function.functionExpression.body;
-    }
-    var constructor = node.thisOrAncestorOfType<ConstructorDeclaration>();
-    if (constructor != null) {
-      return constructor.body;
-    }
-    var method = node.thisOrAncestorOfType<MethodDeclaration>();
-    if (method != null) {
-      return method.body;
-    }
-    return null;
-  }
-
   /// Returns the text of the given node in the unit.
   String _getNodeText(AstNode node) {
     return utils.getNodeText(node);
@@ -2872,41 +2511,3 @@
     visitor(node);
   }
 }
-
-/// A visitor used to find all of the classes that define members referenced via
-/// `super`.
-class _SuperclassReferenceFinder extends RecursiveAstVisitor<void> {
-  final List<ClassElement> referencedClasses = <ClassElement>[];
-
-  _SuperclassReferenceFinder();
-
-  @override
-  void visitSuperExpression(SuperExpression node) {
-    var parent = node.parent;
-    if (parent is BinaryExpression) {
-      _addElement(parent.staticElement);
-    } else if (parent is IndexExpression) {
-      _addElement(parent.staticElement);
-    } else if (parent is MethodInvocation) {
-      _addIdentifier(parent.methodName);
-    } else if (parent is PrefixedIdentifier) {
-      _addIdentifier(parent.identifier);
-    } else if (parent is PropertyAccess) {
-      _addIdentifier(parent.propertyName);
-    }
-    return super.visitSuperExpression(node);
-  }
-
-  void _addElement(Element element) {
-    if (element is ExecutableElement) {
-      var enclosingElement = element.enclosingElement;
-      if (enclosingElement is ClassElement) {
-        referencedClasses.add(enclosingElement);
-      }
-    }
-  }
-
-  void _addIdentifier(SimpleIdentifier identifier) {
-    _addElement(identifier.staticElement);
-  }
-}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
index bbce0d6..b470bf4 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
@@ -356,6 +356,8 @@
   ResourceProvider get resourceProvider =>
       resolvedResult.session.resourceProvider;
 
+  int get selectionEnd => _context.selectionEnd;
+
   int get selectionLength => _context.selectionLength;
 
   int get selectionOffset => _context.selectionOffset;
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart b/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart
new file mode 100644
index 0000000..956a58c
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/assign_to_local_variable.dart
@@ -0,0 +1,69 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/protocol_server.dart';
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analysis_server/src/services/correction/name_suggestion.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/utilities.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+
+class AssignToLocalVariable extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    // prepare enclosing ExpressionStatement
+    ExpressionStatement expressionStatement;
+    // ignore: unnecessary_this
+    for (var node = this.node; node != null; node = node.parent) {
+      if (node is ExpressionStatement) {
+        expressionStatement = node;
+        break;
+      }
+      if (node is ArgumentList ||
+          node is AssignmentExpression ||
+          node is Statement ||
+          node is ThrowExpression) {
+        return;
+      }
+    }
+    if (expressionStatement == null) {
+      return;
+    }
+    // prepare expression
+    var expression = expressionStatement.expression;
+    var offset = expression.offset;
+    // prepare expression type
+    var type = expression.staticType;
+    if (type.isVoid) {
+      return;
+    }
+    // prepare excluded names
+    var excluded = <String>{};
+    var scopedNameFinder = ScopedNameFinder(offset);
+    expression.accept(scopedNameFinder);
+    excluded.addAll(scopedNameFinder.locals.keys.toSet());
+    var suggestions =
+        getVariableNameSuggestionsForExpression(type, expression, excluded);
+
+    if (suggestions.isNotEmpty) {
+      await builder.addFileEdit(file, (builder) {
+        builder.addInsertion(offset, (builder) {
+          builder.write('var ');
+          builder.addSimpleLinkedEdit('NAME', suggestions[0],
+              kind: LinkedEditSuggestionKind.VARIABLE,
+              suggestions: suggestions);
+          builder.write(' = ');
+        });
+      });
+    }
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static AssignToLocalVariable newInstance() => AssignToLocalVariable();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart
new file mode 100644
index 0000000..52e5f04
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_mixin.dart
@@ -0,0 +1,113 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+
+class ConvertClassToMixin extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_CLASS_TO_MIXIN;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    var classDeclaration = node.thisOrAncestorOfType<ClassDeclaration>();
+    if (classDeclaration == null) {
+      return;
+    }
+    if (selectionOffset > classDeclaration.name.end ||
+        selectionEnd < classDeclaration.classKeyword.offset) {
+      return;
+    }
+    if (classDeclaration.members
+        .any((member) => member is ConstructorDeclaration)) {
+      return;
+    }
+    var finder = _SuperclassReferenceFinder();
+    classDeclaration.accept(finder);
+    var referencedClasses = finder.referencedClasses;
+    var superclassConstraints = <InterfaceType>[];
+    var interfaces = <InterfaceType>[];
+
+    var classElement = classDeclaration.declaredElement;
+    for (var type in classElement.mixins) {
+      if (referencedClasses.contains(type.element)) {
+        superclassConstraints.add(type);
+      } else {
+        interfaces.add(type);
+      }
+    }
+    var extendsClause = classDeclaration.extendsClause;
+    if (extendsClause != null) {
+      if (referencedClasses.length > superclassConstraints.length) {
+        superclassConstraints.insert(0, classElement.supertype);
+      } else {
+        interfaces.insert(0, classElement.supertype);
+      }
+    }
+    interfaces.addAll(classElement.interfaces);
+
+    await builder.addFileEdit(file, (builder) {
+      builder.addReplacement(
+          range.startStart(
+              classDeclaration.abstractKeyword ?? classDeclaration.classKeyword,
+              classDeclaration.leftBracket), (builder) {
+        builder.write('mixin ');
+        builder.write(classDeclaration.name.name);
+        builder.writeTypeParameters(
+            classDeclaration.declaredElement.typeParameters);
+        builder.writeTypes(superclassConstraints, prefix: ' on ');
+        builder.writeTypes(interfaces, prefix: ' implements ');
+        builder.write(' ');
+      });
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertClassToMixin newInstance() => ConvertClassToMixin();
+}
+
+/// A visitor used to find all of the classes that define members referenced via
+/// `super`.
+class _SuperclassReferenceFinder extends RecursiveAstVisitor<void> {
+  final List<ClassElement> referencedClasses = <ClassElement>[];
+
+  _SuperclassReferenceFinder();
+
+  @override
+  void visitSuperExpression(SuperExpression node) {
+    var parent = node.parent;
+    if (parent is BinaryExpression) {
+      _addElement(parent.staticElement);
+    } else if (parent is IndexExpression) {
+      _addElement(parent.staticElement);
+    } else if (parent is MethodInvocation) {
+      _addIdentifier(parent.methodName);
+    } else if (parent is PrefixedIdentifier) {
+      _addIdentifier(parent.identifier);
+    } else if (parent is PropertyAccess) {
+      _addIdentifier(parent.propertyName);
+    }
+    return super.visitSuperExpression(node);
+  }
+
+  void _addElement(Element element) {
+    if (element is ExecutableElement) {
+      var enclosingElement = element.enclosingElement;
+      if (enclosingElement is ClassElement) {
+        referencedClasses.add(enclosingElement);
+      }
+    }
+  }
+
+  void _addIdentifier(SimpleIdentifier identifier) {
+    _addElement(identifier.staticElement);
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart
new file mode 100644
index 0000000..c24612c
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_documentation_into_block.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/scanner/token.dart';
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+
+class ConvertDocumentationIntoBlock extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    var comment = node.thisOrAncestorOfType<Comment>();
+    if (comment == null || !comment.isDocumentation) {
+      return;
+    }
+    var tokens = comment.tokens;
+    if (tokens.isEmpty ||
+        tokens.any((Token token) =>
+            token is! DocumentationCommentToken ||
+            token.type != TokenType.SINGLE_LINE_COMMENT)) {
+      return;
+    }
+    var prefix = utils.getNodePrefix(comment);
+
+    await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+      builder.addReplacement(range.node(comment), (DartEditBuilder builder) {
+        builder.writeln('/**');
+        for (var token in comment.tokens) {
+          builder.write(prefix);
+          builder.write(' *');
+          builder.writeln(token.lexeme.substring('///'.length));
+        }
+        builder.write(prefix);
+        builder.write(' */');
+      });
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertDocumentationIntoBlock newInstance() =>
+      ConvertDocumentationIntoBlock();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart
new file mode 100644
index 0000000..5b5dffb
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_async_body.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+
+class ConvertIntoAsyncBody extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_INTO_ASYNC_BODY;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    var body = getEnclosingFunctionBody();
+    if (body == null ||
+        body is EmptyFunctionBody ||
+        body.isAsynchronous ||
+        body.isGenerator) {
+      return;
+    }
+
+    // Function bodies can be quite large, e.g. Flutter build() methods.
+    // It is surprising to see this Quick Assist deep in a function body.
+    if (body is BlockFunctionBody &&
+        selectionOffset > body.block.beginToken.end) {
+      return;
+    }
+    if (body is ExpressionFunctionBody &&
+        selectionOffset > body.beginToken.end) {
+      return;
+    }
+
+    var parent = body.parent;
+    if (parent is ConstructorDeclaration) {
+      return;
+    }
+
+    await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+      builder.convertFunctionFromSyncToAsync(body, typeProvider);
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertIntoAsyncBody newInstance() => ConvertIntoAsyncBody();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart
new file mode 100644
index 0000000..5a64e75
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_block_body.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+
+class ConvertIntoBlockBody extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_INTO_BLOCK_BODY;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    var body = getEnclosingFunctionBody();
+    // prepare expression body
+    if (body is! ExpressionFunctionBody || body.isGenerator) {
+      return;
+    }
+
+    var returnValue = (body as ExpressionFunctionBody).expression;
+
+    // Return expressions can be quite large, e.g. Flutter build() methods.
+    // It is surprising to see this Quick Assist deep in the function body.
+    if (selectionOffset >= returnValue.offset) {
+      return;
+    }
+
+    var returnValueType = returnValue.staticType;
+    var returnValueCode = utils.getNodeText(returnValue);
+    // prepare prefix
+    var prefix = utils.getNodePrefix(body.parent);
+    var indent = utils.getIndent(1);
+
+    await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+      builder.addReplacement(range.node(body), (DartEditBuilder builder) {
+        if (body.isAsynchronous) {
+          builder.write('async ');
+        }
+        builder.write('{$eol$prefix$indent');
+        if (!returnValueType.isVoid && !returnValueType.isBottom) {
+          builder.write('return ');
+        }
+        builder.write(returnValueCode);
+        builder.write(';');
+        builder.selectHere();
+        builder.write('$eol$prefix}');
+      });
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertIntoBlockBody newInstance() => ConvertIntoBlockBody();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart
new file mode 100644
index 0000000..10162a1
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_final_field.dart
@@ -0,0 +1,86 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+
+class ConvertIntoFinalField extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_INTO_FINAL_FIELD;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    // Find the enclosing getter.
+    MethodDeclaration getter;
+    for (var n = node; n != null; n = n.parent) {
+      if (n is MethodDeclaration) {
+        getter = n;
+        break;
+      }
+      if (n is SimpleIdentifier ||
+          n is TypeAnnotation ||
+          n is TypeArgumentList) {
+        continue;
+      }
+      break;
+    }
+    if (getter == null || !getter.isGetter) {
+      return;
+    }
+    // Check that there is no corresponding setter.
+    {
+      var element = getter.declaredElement;
+      if (element == null) {
+        return;
+      }
+      var enclosing = element.enclosingElement;
+      if (enclosing is ClassElement) {
+        if (enclosing.getSetter(element.name) != null) {
+          return;
+        }
+      }
+    }
+    // Try to find the returned expression.
+    Expression expression;
+    {
+      var body = getter.body;
+      if (body is ExpressionFunctionBody) {
+        expression = body.expression;
+      } else if (body is BlockFunctionBody) {
+        List<Statement> statements = body.block.statements;
+        if (statements.length == 1) {
+          var statement = statements.first;
+          if (statement is ReturnStatement) {
+            expression = statement.expression;
+          }
+        }
+      }
+    }
+    // Use the returned expression as the field initializer.
+    if (expression != null) {
+      var code = 'final';
+      if (getter.returnType != null) {
+        code += ' ' + utils.getNodeText(getter.returnType);
+      }
+      code += ' ' + utils.getNodeText(getter.name);
+      if (expression is! NullLiteral) {
+        code += ' = ' + utils.getNodeText(expression);
+      }
+      code += ';';
+      var replacementRange =
+          range.startEnd(getter.returnType ?? getter.propertyKeyword, getter);
+      await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+        builder.addSimpleReplacement(replacementRange, code);
+      });
+    }
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertIntoFinalField newInstance() => ConvertIntoFinalField();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart
new file mode 100644
index 0000000..ac1a37d
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_getter.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+
+class ConvertIntoGetter extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_INTO_GETTER;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    // Find the enclosing field declaration.
+    FieldDeclaration fieldDeclaration;
+    for (var n = node; n != null; n = n.parent) {
+      if (n is FieldDeclaration) {
+        fieldDeclaration = n;
+        break;
+      }
+      if (n is SimpleIdentifier ||
+          n is VariableDeclaration ||
+          n is VariableDeclarationList ||
+          n is TypeAnnotation ||
+          n is TypeArgumentList) {
+        continue;
+      }
+      break;
+    }
+    if (fieldDeclaration == null) {
+      return;
+    }
+    // The field must be final and has only one variable.
+    var fieldList = fieldDeclaration.fields;
+    if (!fieldList.isFinal || fieldList.variables.length != 1) {
+      return;
+    }
+    var field = fieldList.variables.first;
+    // Prepare the initializer.
+    var initializer = field.initializer;
+    if (initializer == null) {
+      return;
+    }
+    // Add proposal.
+    var code = '';
+    if (fieldList.type != null) {
+      code += utils.getNodeText(fieldList.type) + ' ';
+    }
+    code += 'get';
+    code += ' ' + utils.getNodeText(field.name);
+    code += ' => ' + utils.getNodeText(initializer);
+    code += ';';
+    var replacementRange = range.startEnd(fieldList.keyword, fieldDeclaration);
+    await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+      builder.addSimpleReplacement(replacementRange, code);
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertIntoGetter newInstance() => ConvertIntoGetter();
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
new file mode 100644
index 0000000..22a647e
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/correction/assist.dart';
+import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer_plugin/utilities/assist/assist.dart';
+import 'package:analyzer_plugin/utilities/change_builder/change_builder_dart.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
+import 'package:path/path.dart';
+
+class ConvertPartOfToUri extends CorrectionProducer {
+  @override
+  AssistKind get assistKind => DartAssistKind.CONVERT_PART_OF_TO_URI;
+
+  @override
+  Future<void> compute(DartChangeBuilder builder) async {
+    var directive = node.thisOrAncestorOfType<PartOfDirective>();
+    if (directive == null || directive.libraryName == null) {
+      return;
+    }
+    var libraryPath = resolvedResult.libraryElement.source.fullName;
+    var partPath = resolvedResult.path;
+    var relativePath = relative(libraryPath, from: dirname(partPath));
+    var uri = Uri.file(relativePath).toString();
+    var replacementRange = range.node(directive.libraryName);
+    await builder.addFileEdit(file, (DartFileEditBuilder builder) {
+      builder.addSimpleReplacement(replacementRange, "'$uri'");
+    });
+  }
+
+  /// Return an instance of this class. Used as a tear-off in `AssistProcessor`.
+  static ConvertPartOfToUri newInstance() => ConvertPartOfToUri();
+}
diff --git a/pkg/analysis_server/lib/src/status/element_writer.dart b/pkg/analysis_server/lib/src/status/element_writer.dart
index 71f5835..ca4d836 100644
--- a/pkg/analysis_server/lib/src/status/element_writer.dart
+++ b/pkg/analysis_server/lib/src/status/element_writer.dart
@@ -39,7 +39,6 @@
     properties['nameOffset'] = element.nameOffset;
     if (element is ClassElement) {
       properties['hasNonFinalField'] = element.hasNonFinalField;
-      properties['hasReferenceToSuper'] = element.hasReferenceToSuper;
       properties['hasStaticMember'] = element.hasStaticMember;
       properties['interfaces'] = element.interfaces;
       properties['isAbstract'] = element.isAbstract;
diff --git a/pkg/analysis_server/test/lsp/code_actions_abstract.dart b/pkg/analysis_server/test/lsp/code_actions_abstract.dart
index 95ff6e6..a9b288c 100644
--- a/pkg/analysis_server/test/lsp/code_actions_abstract.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_abstract.dart
@@ -57,18 +57,21 @@
 
   CodeAction findEditAction(List<Either2<Command, CodeAction>> actions,
       CodeActionKind actionKind, String title) {
-    for (var codeAction in actions) {
-      final codeActionLiteral =
-          codeAction.map((cmd) => null, (action) => action);
-      if (codeActionLiteral?.kind == actionKind &&
-          codeActionLiteral?.title == title) {
-        // We're specifically looking for an action that contains an edit.
-        assert(codeActionLiteral.command == null);
-        assert(codeActionLiteral.edit != null);
-        return codeActionLiteral;
-      }
-    }
-    return null;
+    return findEditActions(actions, actionKind, title)
+        .firstWhere((element) => true, orElse: () => null);
+  }
+
+  List<CodeAction> findEditActions(List<Either2<Command, CodeAction>> actions,
+      CodeActionKind actionKind, String title) {
+    return actions
+        .map((action) => action.map((cmd) => null, (action) => action))
+        .where((action) => action?.kind == actionKind && action?.title == title)
+        .map((action) {
+      // Expect matching actions to contain an edit and not a command.
+      assert(action.command == null);
+      assert(action.edit != null);
+      return action;
+    }).toList();
   }
 
   /// Verifies that executing the given code actions command on the server
diff --git a/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart b/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
index f2485a1..3c1d73b 100644
--- a/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
@@ -94,6 +94,47 @@
     expect(contents[mainFilePath], equals(expectedContent));
   }
 
+  Future<void> test_noDuplicates() async {
+    const content = '''
+    var a = [Test, Test, Te[[]]st];
+    ''';
+
+    await newFile(mainFilePath, content: withoutMarkers(content));
+    await initialize(
+      textDocumentCapabilities: withCodeActionKinds(
+          emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
+    );
+
+    final codeActions = await getCodeActions(mainFileUri.toString(),
+        range: rangeFromMarkers(content));
+    final createClassActions = findEditActions(codeActions,
+        CodeActionKind('quickfix.create.class'), "Create class 'Test'");
+
+    expect(createClassActions, hasLength(1));
+    expect(createClassActions.first.diagnostics, hasLength(3));
+  }
+
+  Future<void> test_noDuplicates_withDocumentChangesSupport() async {
+    const content = '''
+    var a = [Test, Test, Te[[]]st];
+    ''';
+
+    await newFile(mainFilePath, content: withoutMarkers(content));
+    await initialize(
+        textDocumentCapabilities: withCodeActionKinds(
+            emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
+        workspaceCapabilities: withApplyEditSupport(
+            withDocumentChangesSupport(emptyWorkspaceClientCapabilities)));
+
+    final codeActions = await getCodeActions(mainFileUri.toString(),
+        range: rangeFromMarkers(content));
+    final createClassActions = findEditActions(codeActions,
+        CodeActionKind('quickfix.create.class'), "Create class 'Test'");
+
+    expect(createClassActions, hasLength(1));
+    expect(createClassActions.first.diagnostics, hasLength(3));
+  }
+
   Future<void> test_nonDartFile() async {
     await newFile(pubspecFilePath, content: simplePubspecContent);
     await initialize(
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
index 83b8b06..cdb2c73 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
@@ -8,7 +8,7 @@
 import 'package:analysis_server/src/services/completion/completion_core.dart';
 import 'package:analysis_server/src/services/completion/completion_performance.dart';
 import 'package:analysis_server/src/services/completion/dart/completion_manager.dart'
-    show DartCompletionManager, DartCompletionRequestImpl;
+    show DartCompletionRequestImpl;
 import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart';
 import 'package:analysis_server/src/services/completion/dart/utilities.dart';
 import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
@@ -68,35 +68,6 @@
   }
 }
 
-/// Base class for tests that validate [DartCompletionManager] suggestions.
-class DartCompletionManagerTest extends _BaseDartCompletionContributorTest {
-  DartCompletionManager completionManager;
-
-  @nonVirtual
-  @override
-  Future<List<CompletionSuggestion>> computeContributedSuggestions(
-      DartCompletionRequest request) async {
-    final baseRequest = CompletionRequestImpl(request.result, completionOffset,
-        useNewRelevance, CompletionPerformance());
-    return completionManager.computeSuggestions(baseRequest);
-  }
-
-  /// Display sorted suggestions.
-  void printSuggestions() {
-    suggestions.sort(completionComparator);
-    for (var s in suggestions) {
-      print(
-          '[${s.relevance}] ${s.completion} • ${s.element?.kind?.name ?? ""} ${s.kind.name} ${s.element?.location?.file ?? ""}');
-    }
-  }
-
-  @override
-  void setUp() {
-    super.setUp();
-    completionManager = DartCompletionManager();
-  }
-}
-
 abstract class _BaseDartCompletionContributorTest extends AbstractContextTest {
   static const String _UNCHECKED = '__UNCHECKED__';
   String testFile;
diff --git a/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_relevance_test.dart b/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_relevance_test.dart
index 32cd07f..3e64f9e 100644
--- a/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_relevance_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_relevance_test.dart
@@ -3,10 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:analyzer_plugin/protocol/protocol_common.dart';
-import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../completion_contributor_util.dart';
+import 'completion_relevance.dart';
 
 void main() {
   defineReflectiveSuite(() {
@@ -15,16 +14,14 @@
 }
 
 @reflectiveTest
-class BoolAssignmentRelevanceTest extends DartCompletionManagerTest {
-  @failingTest
+class BoolAssignmentRelevanceTest extends CompletionRelevanceTest {
   Future<void> test_boolLiterals_imported() async {
-    addTestSource('''
+    await addTestFile('''
 foo() {
   bool b;
   b = ^
 }
 ''');
-    await computeSuggestions();
 
     var trueSuggestion = suggestionWith(
         completion: 'true', kind: CompletionSuggestionKind.KEYWORD);
@@ -37,23 +34,16 @@
         element: ElementKind.CONSTRUCTOR,
         kind: CompletionSuggestionKind.INVOCATION);
 
-    expect(
-        trueSuggestion.relevance, greaterThan(boolFromEnvironment.relevance));
-    expect(
-        falseSuggestion.relevance, greaterThan(boolFromEnvironment.relevance));
+    assertOrder([trueSuggestion, falseSuggestion, boolFromEnvironment]);
   }
 
-  /// These are 2 failing tests for http://dartbug.com/37907:
-  /// "Suggest `false` above other results when autocompleting a bool setter"
-  @failingTest
   Future<void> test_boolLiterals_local() async {
-    addTestSource('''
+    await addTestFile('''
 foo() {
   bool b;
   b = ^
 }
 ''');
-    await computeSuggestions();
 
     var trueSuggestion = suggestionWith(
         completion: 'true', kind: CompletionSuggestionKind.KEYWORD);
@@ -66,7 +56,6 @@
         element: ElementKind.LOCAL_VARIABLE,
         kind: CompletionSuggestionKind.INVOCATION);
 
-    expect(trueSuggestion.relevance, greaterThan(bLocalVar.relevance));
-    expect(falseSuggestion.relevance, greaterThan(bLocalVar.relevance));
+    assertOrder([trueSuggestion, falseSuggestion, bLocalVar]);
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/relevance/completion_relevance.dart b/pkg/analysis_server/test/services/completion/dart/relevance/completion_relevance.dart
index c46ba90..9a363e9 100644
--- a/pkg/analysis_server/test/services/completion/dart/relevance/completion_relevance.dart
+++ b/pkg/analysis_server/test/services/completion/dart/relevance/completion_relevance.dart
@@ -28,17 +28,18 @@
     var previous = suggestions[0];
     for (var i = 1; i < length; i++) {
       var current = suggestions[i];
-      if (current.relevance >= previous.relevance) {
-        suggestions.sort(
-            (first, second) => second.relevance.compareTo(first.relevance));
+      if (current.relevance > previous.relevance) {
+        suggestions.sort((first, second) => second.relevance - first.relevance);
         var buffer = StringBuffer();
-        buffer.write('Suggestions are not in the expected order. ');
-        buffer.writeln('To accept the current state, use');
+        buffer.writeln('Actual sort order does not match expected order.');
+        buffer.writeln('To accept the actual sort order, use:');
         buffer.writeln();
+        buffer.writeln('    assertOrder([');
         for (var suggestion in suggestions) {
           var completion = suggestion.completion;
-          buffer.writeln("  suggestionWith(completion: '$completion'),");
+          buffer.writeln("      suggestionWith(completion: '$completion'),");
         }
+        buffer.writeln('    ]);');
         fail(buffer.toString());
       }
       previous = current;
diff --git a/pkg/analysis_server/test/services/completion/dart/relevance/deprecated_member_relevance_test.dart b/pkg/analysis_server/test/services/completion/dart/relevance/deprecated_member_relevance_test.dart
index fd10530..d13808c 100644
--- a/pkg/analysis_server/test/services/completion/dart/relevance/deprecated_member_relevance_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/relevance/deprecated_member_relevance_test.dart
@@ -3,10 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:analyzer_plugin/protocol/protocol_common.dart';
-import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../completion_contributor_util.dart';
+import 'completion_relevance.dart';
 
 void main() {
   defineReflectiveSuite(() {
@@ -15,9 +14,9 @@
 }
 
 @reflectiveTest
-class DeprecatedMemberRelevanceTest extends DartCompletionManagerTest {
+class DeprecatedMemberRelevanceTest extends CompletionRelevanceTest {
   Future<void> test_deprecated() async {
-    addTestSource('''
+    await addTestFile('''
 class A {
   void a1() { }
   @deprecated
@@ -29,18 +28,16 @@
   a.^
 }
 ''');
-    await computeSuggestions();
 
-    expect(
-        suggestionWith(
-                completion: 'a2',
-                element: ElementKind.METHOD,
-                kind: CompletionSuggestionKind.INVOCATION)
-            .relevance,
-        lessThan(suggestionWith(
-                completion: 'a1',
-                element: ElementKind.METHOD,
-                kind: CompletionSuggestionKind.INVOCATION)
-            .relevance));
+    assertOrder([
+      suggestionWith(
+          completion: 'a1',
+          element: ElementKind.METHOD,
+          kind: CompletionSuggestionKind.INVOCATION),
+      suggestionWith(
+          completion: 'a2',
+          element: ElementKind.METHOD,
+          kind: CompletionSuggestionKind.INVOCATION),
+    ]);
   }
 }
diff --git a/pkg/analysis_server/test/services/completion/dart/relevance/instance_member_relevance_test.dart b/pkg/analysis_server/test/services/completion/dart/relevance/instance_member_relevance_test.dart
index c73b71b..9b59000 100644
--- a/pkg/analysis_server/test/services/completion/dart/relevance/instance_member_relevance_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/relevance/instance_member_relevance_test.dart
@@ -3,11 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analyzer_plugin/protocol/protocol_common.dart';
-import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
-import '../../../../client/completion_driver_test.dart';
+import 'completion_relevance.dart';
 
 void main() {
   defineReflectiveSuite(() {
@@ -16,7 +14,7 @@
 }
 
 @reflectiveTest
-class InstanceMemberRelevanceTest extends AbstractCompletionDriverTest {
+class InstanceMemberRelevanceTest extends CompletionRelevanceTest {
   @override
   AnalysisServerOptions get serverOptions =>
       AnalysisServerOptions()..useNewRelevance = true;
@@ -24,37 +22,6 @@
   @override
   bool get supportsAvailableSuggestions => true;
 
-  /// Assert that all of the given completions were produced and that the
-  /// suggestions are ordered in decreasing order based on relevance scores.
-  void assertOrder(List<CompletionSuggestion> suggestions) {
-    var length = suggestions.length;
-    expect(length, greaterThan(1),
-        reason: 'Test must specify more than one suggestion');
-    var inOrder = true;
-    var previous = suggestions[0];
-    for (var i = 1; i < length; i++) {
-      var current = suggestions[i];
-      if (current.relevance >= previous.relevance) {
-        inOrder = false;
-      }
-      previous = current;
-    }
-    if (!inOrder) {
-      suggestions.sort((first, second) => second.relevance - first.relevance);
-      var buffer = StringBuffer();
-      buffer.writeln('Actual sort order does not match expected order.');
-      buffer.writeln('To accept the actual sort order, use:');
-      buffer.writeln();
-      buffer.writeln('    assertOrder([');
-      for (var suggestion in suggestions) {
-        var completion = suggestion.completion;
-        buffer.writeln("      suggestionWith(completion: '$completion'),");
-      }
-      buffer.writeln('    ]);');
-      fail(buffer.toString());
-    }
-  }
-
   Future<void> test_contextType() async {
     await addTestFile(r'''
 class A {}
diff --git a/pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart b/pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart
index 28d30aa..67da9e2 100644
--- a/pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart
+++ b/pkg/analysis_server/test/src/services/completion/dart/feature_computer_test.dart
@@ -17,6 +17,9 @@
 
 @reflectiveTest
 class FeatureComputerTest extends AbstractSingleUnitTest {
+  @override
+  bool verifyNoTestUnitErrors = false;
+
   Future<void> assertContextType(String content, String expectedType) async {
     var index = content.indexOf('^');
     if (index < 0) {
@@ -24,10 +27,13 @@
     }
     content = content.substring(0, index) + content.substring(index + 1);
     await resolveTestUnit(content);
+    // TODO(jwren) Consider changing this from the NodeLocator to the optype
+    // node finding logic to be more consistent with what the user behavior
+    // here will be.
     var node = NodeLocator(index).searchWithin(testUnit);
     var computer = FeatureComputer(
         testAnalysisResult.typeSystem, testAnalysisResult.typeProvider);
-    var type = computer.computeContextType(node);
+    var type = computer.computeContextType(node, index);
 
     if (expectedType == null) {
       expect(type, null);
@@ -36,37 +42,225 @@
     }
   }
 
-  Future<void> test_adjacentString_afterFirst() async {
+  Future<void> test_argumentList_named() async {
     await assertContextType('''
-void f(String s) {}
-void g() {
-  f('a' ^'b');
+void f({int i, String s, bool b}) {}
+void g(int j) {
+  f(i:^);
+}
+''', 'int');
+  }
+
+  Future<void> test_argumentList_named2() async {
+    await assertContextType('''
+void f({int i, String s, bool b}) {}
+void g(int j) {
+  f(s:^);
 }
 ''', 'String');
   }
 
-  Future<void> test_adjacentString_beforeFirst() async {
+  Future<void> test_argumentList_named_with_requiredPositional() async {
     await assertContextType('''
-void f(String s) {}
-void g() {
-  f(^'a' 'b');
+void f(String s, {int i}) {}
+void g(int j) {
+  f('str', i: ^);
 }
-''', 'String');
+''', 'int');
   }
 
-  Future<void> test_argumentList() async {
+  Future<void>
+      test_argumentList_named_with_requiredPositional_defaultValue() async {
     await assertContextType('''
-void f(int i) {}
+void f(String s, {int i = 0}) {}
+void g(int j) {
+  f('str', i: ^);
+}
+''', 'int');
+  }
+
+  Future<void> test_argumentList_noParameters() async {
+    await assertContextType('''
+void f() {}
+void g() {
+  f(^);
+}
+''', null);
+  }
+
+  Future<void> test_argumentList_noParameters_whitespace() async {
+    await assertContextType('''
+void f() {}
+void g() {
+  f(  ^  );
+}
+''', null);
+  }
+
+  Future<void> test_argumentList_noParameters_whitespace_left() async {
+    await assertContextType('''
+void f() {}
+void g() {
+  f(  ^);
+}
+''', null);
+  }
+
+  Future<void> test_argumentList_noParameters_whitespace_right() async {
+    await assertContextType('''
+void f() {}
+void g() {
+  f(^  );
+}
+''', null);
+  }
+
+  Future<void> test_argumentList_positional() async {
+    await assertContextType('''
+void f([int i]) {}
+void g(int j) {
+  f(i:^);
+}
+''', 'int');
+  }
+
+  Future<void> test_argumentList_positional_completionInLabel() async {
+    await assertContextType('''
+void f([int i = 2]) {}
+void g(int j) {
+  f(^i:);
+}
+''', null);
+  }
+
+  Future<void> test_argumentList_positional_completionInLabel2() async {
+    await assertContextType('''
+void f(String s, bool b, [int i = 2]) {}
+void g(int j) {
+  f(i^:);
+}
+''', null);
+  }
+
+  Future<void> test_argumentList_positional_whitespace() async {
+    await assertContextType('''
+void f([int i]) {}
+void g(int j) {
+  f(i:  ^  );
+}
+''', 'int');
+  }
+
+  Future<void> test_argumentList_positional_with_requiredPositional() async {
+    await assertContextType('''
+void f(String s, bool b, [int i]) {}
+void g(int j) {
+  f('', 3, i:^);
+}
+''', 'int');
+  }
+
+  Future<void>
+      test_argumentList_positional_with_requiredPositional_defaultValue() async {
+    await assertContextType('''
+void f(String s, bool b, [int i = 2]) {}
+void g(int j) {
+  f('', 3, i:^);
+}
+''', 'int');
+  }
+
+  Future<void> test_argumentList_requiredPositional_first() async {
+    await assertContextType('''
+void f(int i, String str, bool b) {}
 void g(int j) {
   f(^j);
 }
 ''', 'int');
   }
 
-  Future<void> test_assertInitializer() async {
+  Future<void> test_argumentList_requiredPositional_first_implicit() async {
+    await assertContextType('''
+void f(int i, String str, bool b) {}
+void g() {
+  f(^);
+}
+''', 'int');
+  }
+
+  Future<void> test_argumentList_requiredPositional_last() async {
+    await assertContextType('''
+void f(int i, String str, bool b) {}
+void g(int j) {
+  f(1, '2', t^);
+}
+''', 'bool');
+  }
+
+  Future<void> test_argumentList_requiredPositional_last_implicit() async {
+    await assertContextType('''
+void f(int i, String str, bool b, num n) {}
+void g(int j) {
+  f(1, '2', ^);
+}
+''', 'bool');
+  }
+
+  Future<void> test_argumentList_requiredPositional_middle() async {
+    await assertContextType('''
+void f(int i, String str, bool b) {}
+void g(int j) {
+  f(1, w^);
+}
+''', 'String');
+  }
+
+  Future<void> test_argumentList_requiredPositional_middle2() async {
+    await assertContextType('''
+void f(int i, String str, bool b) {}
+void g(int j) {
+  f(1, ^, );
+}
+''', 'String');
+  }
+
+  Future<void> test_argumentList_requiredPositional_middle_implicit() async {
+    await assertContextType('''
+void f(int i, String str, bool b) {}
+void g(int j) {
+  f(1, ^ );
+}
+''', 'String');
+  }
+
+  Future<void> test_assertInitializer_with_identifier() async {
     await assertContextType('''
 class C {
-  C(int i) : assert(^i > 0);
+  C(int i) : assert(b^);
+}
+''', 'bool');
+  }
+
+  Future<void> test_assertInitializer_with_identifier_whitespace() async {
+    await assertContextType('''
+class C {
+  C(int i) : assert(  b^  );
+}
+''', 'bool');
+  }
+
+  Future<void> test_assertInitializer_without_identifier() async {
+    await assertContextType('''
+class C {
+  C(int i) : assert(^);
+}
+''', 'bool');
+  }
+
+  Future<void> test_assertInitializer_without_identifier_whitespace() async {
+    await assertContextType('''
+class C {
+  C(int i) : assert(  ^  );
 }
 ''', 'bool');
   }
@@ -81,12 +275,60 @@
 
   Future<void> test_assignmentExpression_withType() async {
     await assertContextType('''
-void g(String s) {
-  int i = ^s.length;
+void g() {
+  int i = ^a;
 }
 ''', 'int');
   }
 
+  Future<void> test_binaryExpression_RHS() async {
+    await assertContextType('''
+class C {
+  C(int i) : assert(0 < i^);
+}
+''', 'num');
+  }
+
+  Future<void> test_ifElement() async {
+    await assertContextType('''
+void f(bool b, int e) {
+  var m = <int, String>{if (^) e : ''};
+}
+''', 'bool');
+  }
+
+  Future<void> test_ifElement_identifier() async {
+    await assertContextType('''
+void f(bool b, int e) {
+  var m = <int, String>{if (b^) e : ''};
+}
+''', 'bool');
+  }
+
+  Future<void> test_ifStatement_condition() async {
+    await assertContextType('''
+void foo() {
+  if(^) {}
+}
+''', 'bool');
+  }
+
+  Future<void> test_ifStatement_condition2() async {
+    await assertContextType('''
+void foo() {
+  if(t^) {}
+}
+''', 'bool');
+  }
+
+  Future<void> test_ifStatement_condition_whitespace() async {
+    await assertContextType('''
+void foo() {
+  if(  ^  ) {}
+}
+''', 'bool');
+  }
+
   Future<void> test_listLiteral_beforeTypeParameter() async {
     await assertContextType('''
 void f(int e) {
@@ -103,6 +345,14 @@
 ''', 'int');
   }
 
+  Future<void> test_listLiteral_element_empty() async {
+    await assertContextType('''
+void f(int e) {
+  var l = <int>[^];
+}
+''', 'int');
+  }
+
   Future<void> test_listLiteral_typeParameter() async {
     await assertContextType('''
 void f(int e) {
@@ -158,7 +408,7 @@
   Future<void> test_setOrMapLiteral_map_element() async {
     await assertContextType('''
 void f(bool b, int e) {
-  var m = <int, String>{^if (b) e : ''};
+  var m = <int, String>{^ : ''};
 }
 ''', 'int');
   }
diff --git a/pkg/analysis_server/test/tool/completion_metrics/metrics_util_test.dart b/pkg/analysis_server/test/tool/completion_metrics/metrics_util_test.dart
index 2826928..0c4b3e1 100644
--- a/pkg/analysis_server/test/tool/completion_metrics/metrics_util_test.dart
+++ b/pkg/analysis_server/test/tool/completion_metrics/metrics_util_test.dart
@@ -78,56 +78,56 @@
 
   group('MeanReciprocalRankComputer', () {
     test('empty', () {
-      var mrrc = MeanReciprocalRankComputer('');
-      expect(mrrc.count, equals(0));
-      expect(mrrc.mrr, equals(0));
+      var computer = MeanReciprocalRankComputer('');
+      expect(computer.count, equals(0));
+      expect(computer.mrr, equals(0));
     });
 
     test('clear', () {
-      var mrrc = MeanReciprocalRankComputer('');
-      mrrc.addRank(2);
-      expect(mrrc.count, equals(1));
-      expect(mrrc.mrr, equals(1 / 2));
-      expect(mrrc.mrr_5, equals(1 / 2));
+      var computer = MeanReciprocalRankComputer('');
+      computer.addRank(2);
+      expect(computer.count, equals(1));
+      expect(computer.mrr, equals(1 / 2));
+      expect(computer.mrr_5, equals(1 / 2));
 
-      mrrc.clear();
-      expect(mrrc.count, equals(0));
-      expect(mrrc.mrr, equals(0));
-      expect(mrrc.mrr_5, equals(0));
+      computer.clear();
+      expect(computer.count, equals(0));
+      expect(computer.mrr, equals(0));
+      expect(computer.mrr_5, equals(0));
     });
 
-    test('mmr- single value', () {
-      var mrrc = MeanReciprocalRankComputer('');
-      mrrc.addRank(3);
-      mrrc.addRank(3);
-      mrrc.addRank(3);
-      mrrc.addRank(3);
-      mrrc.addRank(3);
-      expect(mrrc.count, equals(5));
-      expect(mrrc.mrr, doubleEquals(1 / 3));
-      expect(mrrc.mrr_5, doubleEquals(1 / 3));
+    test('mrr- single value', () {
+      var computer = MeanReciprocalRankComputer('');
+      computer.addRank(3);
+      computer.addRank(3);
+      computer.addRank(3);
+      computer.addRank(3);
+      computer.addRank(3);
+      expect(computer.count, equals(5));
+      expect(computer.mrr, doubleEquals(1 / 3));
+      expect(computer.mrr_5, doubleEquals(1 / 3));
     });
 
-    test('mmr- example', () {
-      var mrrc = MeanReciprocalRankComputer('');
-      mrrc.addRank(3);
-      mrrc.addRank(2);
-      mrrc.addRank(1);
-      expect(mrrc.count, equals(3));
-      expect(mrrc.mrr, doubleEquals(11 / 18));
-      expect(mrrc.mrr_5, doubleEquals(11 / 18));
+    test('mrr- example', () {
+      var computer = MeanReciprocalRankComputer('');
+      computer.addRank(3);
+      computer.addRank(2);
+      computer.addRank(1);
+      expect(computer.count, equals(3));
+      expect(computer.mrr, doubleEquals(11 / 18));
+      expect(computer.mrr_5, doubleEquals(11 / 18));
     });
 
-    test('mmr- max rank', () {
-      var mrrc = MeanReciprocalRankComputer('');
-      mrrc.addRank(6);
-      mrrc.addRank(5);
-      mrrc.addRank(4);
-      mrrc.addRank(3);
-      mrrc.addRank(2);
-      mrrc.addRank(1);
-      expect(mrrc.count, equals(6));
-      expect(mrrc.mrr, greaterThan(mrrc.mrr_5));
+    test('mrr- max rank', () {
+      var computer = MeanReciprocalRankComputer('');
+      computer.addRank(6);
+      computer.addRank(5);
+      computer.addRank(4);
+      computer.addRank(3);
+      computer.addRank(2);
+      computer.addRank(1);
+      expect(computer.count, equals(6));
+      expect(computer.mrr, greaterThan(computer.mrr_5));
     });
   });
 
diff --git a/pkg/analysis_server/test/tool/lsp_spec/generated_classes_test.dart b/pkg/analysis_server/test/tool/lsp_spec/generated_classes_test.dart
index ca011cc..2ef1bdc 100644
--- a/pkg/analysis_server/test/tool/lsp_spec/generated_classes_test.dart
+++ b/pkg/analysis_server/test/tool/lsp_spec/generated_classes_test.dart
@@ -13,6 +13,7 @@
       final b = TextDocumentIdentifier('/a');
 
       expect(a, equals(b));
+      expect(a.hashCode, equals(b.hashCode));
     });
 
     test('with list fields can be checked for equality', () {
@@ -22,6 +23,7 @@
           [CodeActionKind.QuickFix]);
 
       expect(a, equals(b));
+      expect(a.hashCode, equals(b.hashCode));
     });
 
     test('with aliased list fields can be checked for equality', () {
@@ -31,6 +33,7 @@
           [DocumentFilter('dart', 'file', null)]);
 
       expect(a, equals(b));
+      expect(a.hashCode, equals(b.hashCode));
     });
 
     test('with map fields can be checked for equality', () {
@@ -42,6 +45,15 @@
       }, null);
 
       expect(a, equals(b));
+      expect(a.hashCode, equals(b.hashCode));
+    });
+
+    test('with unions of lists can be checked for equality', () {
+      final a = Either2<List<String>, List<int>>.t1(['test']);
+      final b = Either2<List<String>, List<int>>.t1(['test']);
+
+      expect(a, equals(b));
+      expect(a.hashCode, equals(b.hashCode));
     });
 
     test('with union fields can be checked for equality', () {
@@ -51,6 +63,7 @@
           SignatureInformation('a', Either2<String, MarkupContent>.t1('a'), []);
 
       expect(a, equals(b));
+      expect(a.hashCode, equals(b.hashCode));
     });
 
     test('consider subclasses when checking for equality', () {
diff --git a/pkg/analysis_server/tool/completion_metrics/completion_metrics.dart b/pkg/analysis_server/tool/completion_metrics/completion_metrics.dart
index 01d9d48..7f9cd67 100644
--- a/pkg/analysis_server/tool/completion_metrics/completion_metrics.dart
+++ b/pkg/analysis_server/tool/completion_metrics/completion_metrics.dart
@@ -211,7 +211,7 @@
   MeanReciprocalRankComputer topLevelMrrComputer =
       MeanReciprocalRankComputer('non-type member completions');
 
-  Map<String, MeanReciprocalRankComputer> locationMmrComputers = {};
+  Map<String, MeanReciprocalRankComputer> locationMrrComputers = {};
 
   ArithmeticMeanComputer charsBeforeTop =
       ArithmeticMeanComputer('chars_before_top');
@@ -259,7 +259,7 @@
   /// as well as the longest sets of results to compute.
   void recordCompletionResult(CompletionResult result) {
     _recordTime(result);
-    _recordMmr(result);
+    _recordMrr(result);
     _recordWorstResult(result);
     _recordSlowestResult(result);
     _recordMissingInformation(result);
@@ -279,8 +279,8 @@
     }
   }
 
-  /// Record the MMR for the [result].
-  void _recordMmr(CompletionResult result) {
+  /// Record the MRR for the [result].
+  void _recordMrr(CompletionResult result) {
     var rank = result.place.rank;
     // Record globally.
     successfulMrrComputer.addRank(rank);
@@ -299,7 +299,7 @@
     // Record by completion location.
     var location = result.completionLocation;
     if (location != null) {
-      var computer = locationMmrComputers.putIfAbsent(
+      var computer = locationMrrComputers.putIfAbsent(
           location, () => MeanReciprocalRankComputer(location));
       computer.addRank(rank);
     }
@@ -517,7 +517,7 @@
 
     if (verbose) {
       var lines = <LocationTableLine>[];
-      for (var entry in metrics.locationMmrComputers.entries) {
+      for (var entry in metrics.locationMrrComputers.entries) {
         var count = entry.value.count;
         var mrr = (1 / entry.value.mrr);
         var mrr_5 = (1 / entry.value.mrr_5);
@@ -531,7 +531,7 @@
       }
       lines.sort((first, second) => second.product.compareTo(first.product));
       var table = <List<String>>[];
-      table.add(['Location', 'Product', 'Count', 'Mmr', 'Mmr_5']);
+      table.add(['Location', 'Product', 'Count', 'Mrr', 'Mrr_5']);
       for (var line in lines) {
         var location = line.label;
         var product = line.product.truncate().toString();
@@ -1036,7 +1036,7 @@
   }
 }
 
-/// The data to be printed on a single line in the table of mmr values per
+/// The data to be printed on a single line in the table of mrr values per
 /// completion location.
 class LocationTableLine {
   final String label;
diff --git a/pkg/analysis_server/tool/completion_metrics/metrics_util.dart b/pkg/analysis_server/tool/completion_metrics/metrics_util.dart
index 07979bc..cadc262 100644
--- a/pkg/analysis_server/tool/completion_metrics/metrics_util.dart
+++ b/pkg/analysis_server/tool/completion_metrics/metrics_util.dart
@@ -132,10 +132,10 @@
 
   void printMean() {
     print('Mean Reciprocal Rank \'$name\' (total = $count)');
-    print('mmr   = ${mrr.toStringAsFixed(6)} '
+    print('mrr   = ${mrr.toStringAsFixed(6)} '
         '(inverse = ${(1 / mrr).toStringAsFixed(3)})');
 
-    print('mmr_5 = ${mrr_5.toStringAsFixed(6)} '
+    print('mrr_5 = ${mrr_5.toStringAsFixed(6)} '
         '(inverse = ${(1 / mrr_5).toStringAsFixed(3)})');
   }
 }
diff --git a/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart b/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart
index 5b185dc..833a1a6 100644
--- a/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart
+++ b/pkg/analysis_server/tool/completion_metrics/relevance_metrics.dart
@@ -786,7 +786,7 @@
   @override
   void visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
     // There are no completions.
-    var contextType = featureComputer.computeContextType(node);
+    var contextType = featureComputer.computeContextType(node, node.offset);
     if (contextType != null) {
       var memberType = _returnType(node.staticElement);
       if (memberType != null) {
@@ -1018,7 +1018,7 @@
       }
     }
     if (node.target != null) {
-      var contextType = featureComputer.computeContextType(node);
+      var contextType = featureComputer.computeContextType(node, node.offset);
       if (contextType != null) {
         var memberType = _returnType(member);
         if (memberType != null) {
@@ -1139,7 +1139,7 @@
       }
     }
     if (!(member is PropertyAccessorElement && member.isSetter)) {
-      var contextType = featureComputer.computeContextType(node);
+      var contextType = featureComputer.computeContextType(node, node.offset);
       if (contextType != null) {
         var memberType = _returnType(member);
         if (memberType != null) {
@@ -1610,7 +1610,7 @@
     _recordTokenDistance(node);
     _recordTokenType(context, node, allowedKeywords: allowedKeywords);
     if (node != null) {
-      var contextType = featureComputer.computeContextType(node);
+      var contextType = featureComputer.computeContextType(node, node.offset);
       _recordContextType(contextType);
       if (contextType != null) {
         var elementType = _returnType(_leftMostElement(node));
diff --git a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
index 23df9cc..6fd1691 100644
--- a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
+++ b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
@@ -516,8 +516,14 @@
     ..indent()
     ..writeIndentedln('var hash = 0;');
   for (var field in _getAllFields(interface)) {
-    buffer.writeIndentedln(
-        'hash = JenkinsSmiHash.combine(hash, ${field.name}.hashCode);');
+    final type = resolveTypeAlias(field.type);
+    if (type is ArrayType || type is MapType) {
+      buffer.writeIndentedln(
+          'hash = JenkinsSmiHash.combine(hash, lspHashCode(${field.name}));');
+    } else {
+      buffer.writeIndentedln(
+          'hash = JenkinsSmiHash.combine(hash, ${field.name}.hashCode);');
+    }
   }
   buffer
     ..writeIndentedln('return JenkinsSmiHash.finish(hash);')
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index be27aee..5ee8c86 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.39.11-dev
+* Deprecated `ClassElement.hasReferenceToSuper`.
+  It was used internally, should not be part of API.
+
 ## 0.39.10
 * Restored the default constructor in internal `SummaryBuilder`,
   and the `featureSet` named parameter in `build`, for `build_resolvers`
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 33ef4c3..8423b11 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -2106,6 +2106,9 @@
   /// Return the name of the extension being selected.
   Identifier get extensionName;
 
+  /// Whether this override is null aware (as opposed to non-null).
+  bool get isNullAware;
+
   /// Return the forced extension element.
   ///
   /// Return `null` if the AST structure has not been resolved.
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 308face..2cbd964 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -82,6 +82,7 @@
   /// hence cannot be used as a mixin), or `false` if this element represents a
   /// mixin, even if the mixin has a reference to `super`, because it is allowed
   /// to be used as a mixin.
+  @Deprecated('It was used internally, should not be part of API')
   bool get hasReferenceToSuper;
 
   /// Return `true` if this class declares a static member.
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index de961aa..3e905b1 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -242,6 +242,7 @@
   CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS,
   CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS,
   CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
+  CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE,
   CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
   CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
   CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
@@ -389,6 +390,7 @@
   HintCode.INVALID_IMMUTABLE_ANNOTATION,
   HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN,
   HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS,
+  HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER,
   HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION,
   HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE,
   HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER,
@@ -706,6 +708,7 @@
   // ignore: deprecated_member_use_from_same_package
   StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
   StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE,
+  StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR,
   StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION,
   StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD,
   StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
diff --git a/pkg/analyzer/lib/source/source_range.dart b/pkg/analyzer/lib/source/source_range.dart
index 4338164..4ac7a92 100644
--- a/pkg/analyzer/lib/source/source_range.dart
+++ b/pkg/analyzer/lib/source/source_range.dart
@@ -46,9 +46,9 @@
   }
 
   /**
-   * Return `true` if [x] is in the interval `[offset, offset + length)`.
+   * Return `true` if [x] is in the interval `[offset, offset + length]`.
    */
-  bool contains(int x) => offset <= x && x < offset + length;
+  bool contains(int x) => offset <= x && x <= offset + length;
 
   /**
    * Return `true` if [x] is in the interval `(offset, offset + length)`.
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 5eded9d..a7092a1 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -91,7 +91,7 @@
 /// TODO(scheglov) Clean up the list of implicitly analyzed files.
 class AnalysisDriver implements AnalysisDriverGeneric {
   /// The version of data format, should be incremented on every format change.
-  static const int DATA_VERSION = 101;
+  static const int DATA_VERSION = 102;
 
   /// The length of the list returned by [_computeDeclaredVariablesSignature].
   static const int _declaredVariablesSignatureLength = 4;
diff --git a/pkg/analyzer/lib/src/dart/analysis/feature_set_provider.dart b/pkg/analyzer/lib/src/dart/analysis/feature_set_provider.dart
index 0048c0b..5183048 100644
--- a/pkg/analyzer/lib/src/dart/analysis/feature_set_provider.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/feature_set_provider.dart
@@ -31,7 +31,7 @@
         _packageDefaultFeatureSet = packageDefaultFeatureSet,
         _nonPackageDefaultFeatureSet = nonPackageDefaultFeatureSet;
 
-  /// Return the [FeatureSet] for the Dart file with the given [uri].
+  /// Return the [FeatureSet] for the package that contains the file.
   FeatureSet getFeatureSet(String path, Uri uri) {
     if (uri.isScheme('dart')) {
       var pathSegments = uri.pathSegments;
@@ -57,15 +57,16 @@
 
     var package = _packages.packageForPath(path);
     if (package != null) {
-      var languageVersion = package.languageVersion;
-      languageVersion ??= ExperimentStatus.currentVersion;
-      return _packageDefaultFeatureSet.restrictToVersion(languageVersion);
+      return _packageDefaultFeatureSet;
     }
 
     return _nonPackageDefaultFeatureSet;
   }
 
-  /// Return the language version configured for the file.
+  /// Return the language version for the package that contains the file.
+  ///
+  /// Each individual file might use `// @dart` to override this version, to
+  /// be either lower, or higher than the package language version.
   Version getLanguageVersion(String path, Uri uri) {
     var package = _packages.packageForPath(path);
     if (package != null) {
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 5ef3e94..3339fb8a 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -12,10 +12,12 @@
 import 'package:analyzer/dart/ast/ast.dart';
 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
 import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/error/error.dart';
 import 'package:analyzer/error/listener.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/dart/analysis/byte_store.dart';
 import 'package:analyzer/src/dart/analysis/defined_names.dart';
+import 'package:analyzer/src/dart/analysis/experiments.dart';
 import 'package:analyzer/src/dart/analysis/feature_set_provider.dart';
 import 'package:analyzer/src/dart/analysis/library_graph.dart';
 import 'package:analyzer/src/dart/analysis/performance_logger.dart';
@@ -24,6 +26,7 @@
 import 'package:analyzer/src/dart/ast/ast.dart';
 import 'package:analyzer/src/dart/scanner/reader.dart';
 import 'package:analyzer/src/dart/scanner/scanner.dart';
+import 'package:analyzer/src/error/codes.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -37,6 +40,7 @@
 import 'package:convert/convert.dart';
 import 'package:crypto/crypto.dart';
 import 'package:meta/meta.dart';
+import 'package:pub_semver/pub_semver.dart';
 
 var counterFileStateRefresh = 0;
 var counterUnlinkedLinkedBytes = 0;
@@ -567,6 +571,36 @@
     return _fsState.getFileForUri(absoluteUri);
   }
 
+  /// Return the language version specified in the [versionToken], or the
+  /// language version from the [FeatureSetProvider].
+  Version _getLanguageVersion(
+    LanguageVersionToken versionToken,
+    AnalysisErrorListener errorListener,
+  ) {
+    if (versionToken != null) {
+      var latestVersion = ExperimentStatus.currentVersion;
+      if (versionToken.major > latestVersion.major ||
+          versionToken.major == latestVersion.major &&
+              versionToken.minor > latestVersion.minor) {
+        errorListener.onError(
+          AnalysisError(
+            source,
+            versionToken.offset,
+            versionToken.length,
+            HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER,
+            [latestVersion.major, latestVersion.minor],
+          ),
+        );
+        // Fall-through, use the package language version.
+      } else {
+        return Version(versionToken.major, versionToken.minor, 0);
+      }
+    }
+
+    var featureSetProvider = _fsState.featureSetProvider;
+    return featureSetProvider.getLanguageVersion(path, uri);
+  }
+
   /**
    * Invalidate any data that depends on the current unlinked data of the file,
    * because [refresh] is going to recompute the unlinked data.
@@ -599,14 +633,17 @@
     });
     LineInfo lineInfo = LineInfo(scanner.lineStarts);
 
+    var languageVersion = _getLanguageVersion(
+      scanner.languageVersion,
+      errorListener,
+    );
+    var featureSet = _featureSet.restrictToVersion(languageVersion);
+
     bool useFasta = analysisOptions.useFastaParser;
-    // Pass the feature set from the scanner to the parser
-    // because the scanner may have detected a language version comment
-    // and downgraded the feature set it holds.
     Parser parser = Parser(
       source,
       errorListener,
-      featureSet: scanner.featureSet,
+      featureSet: featureSet,
       useFasta: useFasta,
     );
     parser.enableOptionalNewAndConst = true;
@@ -616,7 +653,10 @@
     try {
       unit = parser.parseCompilationUnit(token);
       unit.lineInfo = lineInfo;
-      _setLanguageVersion(unit, scanner.languageVersion);
+
+      var unitImpl = unit as CompilationUnitImpl;
+      unitImpl.languageVersionMajor = languageVersion.major;
+      unitImpl.languageVersionMinor = languageVersion.minor;
     } catch (e) {
       throw StateError('''
 Parser error.
@@ -647,22 +687,6 @@
     return directive.uri;
   }
 
-  /// Set the language version into the [unit], from the [languageVersionToken]
-  /// override, or the configured from the [FeatureSetProvider].
-  void _setLanguageVersion(
-    CompilationUnitImpl unit,
-    LanguageVersionToken languageVersionToken,
-  ) {
-    if (languageVersionToken != null) {
-      unit.languageVersionMajor = languageVersionToken.major;
-      unit.languageVersionMinor = languageVersionToken.minor;
-    } else {
-      var version = _fsState.featureSetProvider.getLanguageVersion(path, uri);
-      unit.languageVersionMajor = version.major;
-      unit.languageVersionMinor = version.minor;
-    }
-  }
-
   static UnlinkedUnit2Builder serializeAstUnlinked2(CompilationUnit unit) {
     var exports = <UnlinkedNamespaceDirectiveBuilder>[];
     var imports = <UnlinkedNamespaceDirectiveBuilder>[];
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 283c6c6..b1077be 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -3926,6 +3926,13 @@
   }
 
   @override
+  bool get isNullAware {
+    var nextType = argumentList.endToken.next.type;
+    return nextType == TokenType.QUESTION_PERIOD ||
+        nextType == TokenType.QUESTION_PERIOD_OPEN_SQUARE_BRACKET;
+  }
+
+  @override
   Precedence get precedence => Precedence.postfix;
 
   @override
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 4c42716..0690039 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -685,10 +685,12 @@
     return definingClass != null && !definingClass.isDartCoreObject;
   }
 
+  @Deprecated('It was used internally, should not be part of API')
   @override
   bool get hasReferenceToSuper => hasModifier(Modifier.REFERENCES_SUPER);
 
   /// Set whether this class references 'super'.
+  /// TODO(scheglov) Remove it.
   set hasReferenceToSuper(bool isReferencedSuper) {
     setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper);
   }
@@ -782,9 +784,6 @@
 
   @override
   bool get isValidMixin {
-    if (hasReferenceToSuper) {
-      return false;
-    }
     if (!supertype.isDartCoreObject) {
       return false;
     }
@@ -3402,6 +3401,7 @@
   @override
   bool get hasNonFinalField => false;
 
+  @Deprecated('It was used internally, should not be part of API')
   @override
   bool get hasReferenceToSuper => false;
 
@@ -5878,6 +5878,18 @@
     return super.name;
   }
 
+  /// Return the error reported during type inference for this method, or
+  /// `null` if this method is not a subject of type inference, or there was
+  /// no error.
+  TopLevelInferenceError get typeInferenceError {
+    if (linkedNode != null) {
+      return linkedContext.getTypeInferenceError(linkedNode);
+    }
+
+    // We don't support type inference errors without linking.
+    return null;
+  }
+
   @override
   T accept<T>(ElementVisitor<T> visitor) => visitor.visitMethodElement(this);
 }
@@ -6421,7 +6433,9 @@
     _type = type;
   }
 
-  @override
+  /// Return the error reported during type inference for this variable, or
+  /// `null` if this variable is not a subject of type inference, or there was
+  /// no error.
   TopLevelInferenceError get typeInferenceError {
     if (linkedNode != null) {
       return linkedContext.getTypeInferenceError(linkedNode);
@@ -6704,16 +6718,6 @@
   DartType get type => ElementTypeProvider.current.getVariableType(this);
 
   @override
-  TopLevelInferenceError get typeInferenceError {
-    if (linkedNode != null) {
-      return linkedContext.getTypeInferenceError(linkedNode);
-    }
-
-    // We don't support type inference errors without linking.
-    return null;
-  }
-
-  @override
   DartType get typeInternal {
     if (linkedNode != null) {
       if (_type != null) return _type;
@@ -7846,13 +7850,6 @@
     _type = type;
   }
 
-  /// Return the error reported during type inference for this variable, or
-  /// `null` if this variable is not a subject of type inference, or there was
-  /// no error.
-  TopLevelInferenceError get typeInferenceError {
-    return null;
-  }
-
   /// Gets the element's type, without going through the indirection of
   /// [ElementTypeProvider].
   ///
diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
index 0890f77..a9b2866 100644
--- a/pkg/analyzer/lib/src/dart/error/hint_codes.dart
+++ b/pkg/analyzer/lib/src/dart/error/hint_codes.dart
@@ -742,6 +742,15 @@
           correction: "Specify a Dart language version override with a comment "
               "like '// @dart = 2.0'.");
 
+  static const HintCode INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER =
+      HintCodeWithUniqueName(
+    'INVALID_LANGUAGE_VERSION_OVERRIDE',
+    'INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER',
+    "The language version override can't specify a version greater than the "
+        "latest known language version: {0}.{1}",
+    correction: "Try removing the language version override.",
+  );
+
   static const HintCode INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION =
       HintCodeWithUniqueName(
     'INVALID_LANGUAGE_VERSION_OVERRIDE',
diff --git a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
index 5935eaa..e7a02e5 100644
--- a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
@@ -136,6 +136,10 @@
     var receiverExpression = arguments[0];
     var receiverType = receiverExpression.staticType;
 
+    if (node.isNullAware) {
+      receiverType = _typeSystem.promoteToNonNull(receiverType);
+    }
+
     var typeArgumentTypes = _inferTypeArguments(node, receiverType);
     nodeImpl.typeArgumentTypes = typeArgumentTypes;
 
diff --git a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
index 1ce46ce..7448242 100644
--- a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
@@ -85,7 +85,6 @@
 
   /// The flag specifying if currently visited class references 'super'
   /// expression.
-  /// TODO(scheglov) put into summary
   bool _hasReferenceToSuper = false;
 
   factory ResolutionVisitor({
diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
index 4e9ba42..1ec5fe2 100644
--- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart
+++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
@@ -273,7 +273,7 @@
 
   @override
   void visitConstructorDeclaration(ConstructorDeclaration node) {
-    if (node.declaredElement.isFactory) {
+    if (!_isNonNullableByDefault && node.declaredElement.isFactory) {
       if (node.body is BlockFunctionBody) {
         // Check the block for a return statement, if not, create the hint.
         if (!ExitDetector.exits(node.body)) {
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index 21f7582..754ed2f 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -4248,6 +4248,26 @@
           hasPublishedDocs: true);
 
   /**
+   * A method `m` of a class `C` is subject to override inference if it is
+   * missing one or more component types of its signature, and one or more of
+   * the direct superinterfaces of `C` has a member named `m` (*that is, `C.m`
+   * overrides one or more declarations*).  Each missing type is filled in with
+   * the corresponding type from the combined member signature `s` of `m` in
+   * the direct superinterfaces of `C`.
+   *
+   * A compile-time error occurs if `s` does not exist.
+   *
+   * Parameters:
+   * 0: the name of the class where override error was detected
+   * 1: the list of candidate signatures which cannot be combined
+   */
+  static const CompileTimeErrorCode NO_COMBINED_SUPER_SIGNATURE =
+      CompileTimeErrorCode('NO_COMBINED_SUPER_SIGNATURE',
+          "No valid combined signature in superinterfaces of '{0}': {1}.",
+          correction: "Try providing explicit types for this method's "
+              "parameters and return type.");
+
+  /**
    * Parameters:
    * 0: the name of the superclass that does not define an implicitly invoked
    *    constructor
@@ -7343,6 +7363,20 @@
   /**
    * Parameters:
    * 0: the return type as declared in the return statement
+   * 1: the expected return type as defined by the enclosing class
+   * 2: the name of the constructor
+   */
+  static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR =
+      StaticTypeWarningCodeWithUniqueName(
+          'RETURN_OF_INVALID_TYPE',
+          'StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR',
+          "A value of type '{0}' can't be returned from constructor '{2}' "
+              "because it has a return type of '{1}'.",
+          hasPublishedDocs: true);
+
+  /**
+   * Parameters:
+   * 0: the return type as declared in the return statement
    * 1: the expected return type as defined by the method
    * 2: the name of the method
    */
diff --git a/pkg/analyzer/lib/src/error/inheritance_override.dart b/pkg/analyzer/lib/src/error/inheritance_override.dart
index 7b6902e..f7a930a 100644
--- a/pkg/analyzer/lib/src/error/inheritance_override.dart
+++ b/pkg/analyzer/lib/src/error/inheritance_override.dart
@@ -18,6 +18,7 @@
 import 'package:analyzer/src/error/getter_setter_types_verifier.dart';
 import 'package:analyzer/src/generated/resolver.dart' show TypeSystemImpl;
 import 'package:analyzer/src/generated/type_system.dart';
+import 'package:analyzer/src/summary/idl.dart';
 import 'package:meta/meta.dart';
 
 class InheritanceOverrideVerifier {
@@ -174,6 +175,11 @@
           _checkDeclaredMember(field.name, libraryUri, fieldElement.setter);
         }
       } else if (member is MethodDeclaration) {
+        var hasError = _reportNoCombinedSuperSignature(member);
+        if (hasError) {
+          continue;
+        }
+
         _checkDeclaredMember(member.name, libraryUri, member.declaredElement,
             methodParameterNodes: member.parameters?.parameters);
       }
@@ -700,6 +706,26 @@
     }
   }
 
+  bool _reportNoCombinedSuperSignature(MethodDeclaration node) {
+    var element = node.declaredElement;
+    if (element is MethodElementImpl) {
+      var inferenceError = element.typeInferenceError;
+      if (inferenceError?.kind ==
+          TopLevelInferenceErrorKind.overrideNoCombinedSuperSignature) {
+        reporter.reportErrorForNode(
+          CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE,
+          node.name,
+          [
+            classElement.name,
+            inferenceError.arguments[0],
+          ],
+        );
+        return true;
+      }
+    }
+    return false;
+  }
+
   static bool _constantValuesEqual(DartObject x, DartObject y) {
     // If either constant value couldn't be computed due to an error, the
     // corresponding DartObject will be `null`.  Since an error has already been
diff --git a/pkg/analyzer/lib/src/error/return_type_verifier.dart b/pkg/analyzer/lib/src/error/return_type_verifier.dart
index f926e3d..9f9218c 100644
--- a/pkg/analyzer/lib/src/error/return_type_verifier.dart
+++ b/pkg/analyzer/lib/src/error/return_type_verifier.dart
@@ -140,24 +140,29 @@
     var S = getStaticType(expression);
 
     void reportTypeError() {
-      String displayName = enclosingExecutable.element.displayName;
-      if (displayName.isEmpty) {
+      if (enclosingExecutable.isClosure) {
         _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE,
           expression,
           [S, T],
         );
+      } else if (enclosingExecutable.isConstructor) {
+        _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR,
+          expression,
+          [S, T, enclosingExecutable.displayName],
+        );
+      } else if (enclosingExecutable.isFunction) {
+        _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION,
+          expression,
+          [S, T, enclosingExecutable.displayName],
+        );
       } else if (enclosingExecutable.isMethod) {
         _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD,
           expression,
-          [S, T, displayName],
-        );
-      } else {
-        _errorReporter.reportErrorForNode(
-          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION,
-          expression,
-          [S, T, displayName],
+          [S, T, enclosingExecutable.displayName],
         );
       }
     }
@@ -236,24 +241,29 @@
     var S = getStaticType(expression);
 
     void reportTypeError() {
-      String displayName = enclosingExecutable.element.displayName;
-      if (displayName.isEmpty) {
+      if (enclosingExecutable.isClosure) {
         _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE,
           expression,
           [S, T],
         );
+      } else if (enclosingExecutable.isConstructor) {
+        _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR,
+          expression,
+          [S, T, enclosingExecutable.displayName],
+        );
+      } else if (enclosingExecutable.isFunction) {
+        _errorReporter.reportErrorForNode(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION,
+          expression,
+          [S, T, enclosingExecutable.displayName],
+        );
       } else if (enclosingExecutable.isMethod) {
         _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD,
           expression,
-          [S, T, displayName],
-        );
-      } else {
-        _errorReporter.reportErrorForNode(
-          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION,
-          expression,
-          [S, T, displayName],
+          [S, T, enclosingExecutable.displayName],
         );
       }
     }
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 9fda12a..cc900ea 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -412,7 +412,11 @@
     }
 
     if (node.isNullAware) {
-      targetType = _typeSystem.promoteToNonNull(targetType);
+      if (target is ExtensionOverride) {
+        // https://github.com/dart-lang/language/pull/953
+      } else {
+        targetType = _typeSystem.promoteToNonNull(targetType);
+      }
     }
 
     String getterMethodName = TokenType.INDEX.lexeme;
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index cdc3a4c..1e0e343 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -71,6 +71,32 @@
 
   EnclosingExecutableContext.empty() : this(null);
 
+  String get displayName {
+    var element = this.element;
+    if (element is ConstructorElement) {
+      var className = element.enclosingElement.displayName;
+      var constructorName = element.displayName;
+      return constructorName.isEmpty
+          ? className
+          : '$className.$constructorName';
+    } else {
+      return element.displayName;
+    }
+  }
+
+  bool get isClosure {
+    return element is FunctionElement && element.displayName.isEmpty;
+  }
+
+  bool get isConstructor => element is ConstructorElement;
+
+  bool get isFunction {
+    if (element is FunctionElement) {
+      return element.displayName.isNotEmpty;
+    }
+    return element is PropertyAccessorElement;
+  }
+
   bool get isMethod => element is MethodElement;
 
   bool get isSynchronous => !isAsynchronous;
@@ -821,10 +847,13 @@
   void visitIndexExpression(IndexExpression node) {
     _checkForArgumentTypeNotAssignableForArgument(node.index);
     if (node.isNullAware) {
-      _checkForUnnecessaryNullAware(
-        node.realTarget,
-        node.question ?? node.period ?? node.leftBracket,
-      );
+      var target = node.realTarget;
+      if (_isExpressionWithType(target)) {
+        _checkForUnnecessaryNullAware(
+          target,
+          node.question ?? node.period ?? node.leftBracket,
+        );
+      }
     }
     super.visitIndexExpression(node);
   }
@@ -918,9 +947,7 @@
       _checkForStaticAccessToInstanceMember(typeReference, methodName);
       _checkForInstanceAccessToStaticMember(
           typeReference, node.target, methodName);
-
-      // For `C?.foo()` the type of `C` is not set, it is not an expression.
-      if (target.staticType != null) {
+      if (_isExpressionWithType(target)) {
         _checkForUnnecessaryNullAware(target, node.operator);
       }
     } else {
@@ -1025,9 +1052,7 @@
     _checkForStaticAccessToInstanceMember(typeReference, propertyName);
     _checkForInstanceAccessToStaticMember(
         typeReference, node.target, propertyName);
-
-    // For `C?.x` the type of `C` is not set, because it is not an expression.
-    if (target.staticType != null) {
+    if (_isExpressionWithType(target)) {
       _checkForUnnecessaryNullAware(target, node.operator);
     }
 
@@ -5364,6 +5389,22 @@
     }
     return null;
   }
+
+  static bool _isExpressionWithType(Expression node) {
+    if (node is ExtensionOverride) {
+      return false;
+    }
+
+    // For `C?.foo()` the type of `C` is not set, it is not an expression.
+    if (node is Identifier) {
+      var element = node.staticElement;
+      if (element is ClassElement || element is ExtensionElement) {
+        return false;
+      }
+    }
+
+    return true;
+  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 0b52455..db4a3c17 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -414,10 +414,17 @@
       }
 
       if (typeSystem.isPotentiallyNonNullable(returnType)) {
-        errorReporter.reportErrorForNode(
-          CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY,
-          errorNode,
-        );
+        if (errorNode is ConstructorDeclaration) {
+          errorReporter.reportErrorForName(
+            CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY,
+            errorNode,
+          );
+        } else {
+          errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY,
+            errorNode,
+          );
+        }
       }
     }
   }
@@ -807,24 +814,41 @@
   @override
   void visitConstructorDeclaration(ConstructorDeclaration node) {
     ExecutableElement outerFunction = _enclosingFunction;
-    try {
-      _flowAnalysis?.topLevelDeclaration_enter(
-          node, node.parameters, node.body);
-      _flowAnalysis?.executableDeclaration_enter(node, node.parameters, false);
+    _enclosingFunction = node.declaredElement;
+
+    if (_flowAnalysis != null) {
+      _flowAnalysis.topLevelDeclaration_enter(node, node.parameters, node.body);
+      _flowAnalysis.executableDeclaration_enter(node, node.parameters, false);
+    } else {
       _promoteManager.enterFunctionBody(node.body);
-      _enclosingFunction = node.declaredElement;
-      FunctionType type = _enclosingFunction.type;
-      InferenceContext.setType(node.body, type.returnType);
-      super.visitConstructorDeclaration(node);
-    } finally {
-      _flowAnalysis?.executableDeclaration_exit(node.body, false);
-      _flowAnalysis?.topLevelDeclaration_exit();
-      _promoteManager.exitFunctionBody();
-      _enclosingFunction = outerFunction;
     }
+
+    var returnType = _enclosingFunction.type.returnType;
+    InferenceContext.setType(node.body, returnType);
+
+    super.visitConstructorDeclaration(node);
+
+    if (_flowAnalysis != null) {
+      var bodyContext = BodyInferenceContext.of(node.body);
+      if (node.factoryKeyword != null) {
+        checkForBodyMayCompleteNormally(
+          returnType: bodyContext?.contextType,
+          body: node.body,
+          errorNode: node,
+        );
+      }
+      _flowAnalysis.executableDeclaration_exit(node.body, false);
+      _flowAnalysis.topLevelDeclaration_exit();
+      nullSafetyDeadCodeVerifier?.flowEnd(node);
+    } else {
+      _promoteManager.exitFunctionBody();
+    }
+
     ConstructorElementImpl constructor = node.declaredElement;
     constructor.constantInitializers =
         _createCloner().cloneNodeList(node.initializers);
+
+    _enclosingFunction = outerFunction;
   }
 
   @override
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index 257823f..125e54a 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -7272,13 +7272,15 @@
 
   @override
   TopLevelInferenceErrorBuilder get topLevelTypeInferenceError {
-    assert(kind == idl.LinkedNodeKind.simpleFormalParameter ||
+    assert(kind == idl.LinkedNodeKind.methodDeclaration ||
+        kind == idl.LinkedNodeKind.simpleFormalParameter ||
         kind == idl.LinkedNodeKind.variableDeclaration);
     return _variantField_32;
   }
 
   set topLevelTypeInferenceError(TopLevelInferenceErrorBuilder value) {
-    assert(kind == idl.LinkedNodeKind.simpleFormalParameter ||
+    assert(kind == idl.LinkedNodeKind.methodDeclaration ||
+        kind == idl.LinkedNodeKind.simpleFormalParameter ||
         kind == idl.LinkedNodeKind.variableDeclaration);
     _variantField_32 = value;
   }
@@ -8063,6 +8065,7 @@
     LinkedNodeBuilder methodDeclaration_typeParameters,
     int informativeId,
     bool methodDeclaration_hasOperatorEqualWithParameterTypeFromObject,
+    TopLevelInferenceErrorBuilder topLevelTypeInferenceError,
   })  : _kind = idl.LinkedNodeKind.methodDeclaration,
         _variantField_24 = actualReturnType,
         _variantField_4 = annotatedNode_metadata,
@@ -8072,7 +8075,8 @@
         _variantField_9 = methodDeclaration_typeParameters,
         _variantField_36 = informativeId,
         _variantField_31 =
-            methodDeclaration_hasOperatorEqualWithParameterTypeFromObject;
+            methodDeclaration_hasOperatorEqualWithParameterTypeFromObject,
+        _variantField_32 = topLevelTypeInferenceError;
 
   LinkedNodeBuilder.methodInvocation({
     LinkedNodeTypeBuilder invocationExpression_invokeType,
@@ -8739,6 +8743,7 @@
       methodDeclaration_returnType?.flushInformative();
       methodDeclaration_typeParameters?.flushInformative();
       informativeId = null;
+      topLevelTypeInferenceError?.flushInformative();
     } else if (kind == idl.LinkedNodeKind.methodInvocation) {
       invocationExpression_invokeType?.flushInformative();
       methodInvocation_methodName?.flushInformative();
@@ -9939,6 +9944,8 @@
       signature.addBool(
           this.methodDeclaration_hasOperatorEqualWithParameterTypeFromObject ==
               true);
+      signature.addBool(this.topLevelTypeInferenceError != null);
+      this.topLevelTypeInferenceError?.collectApiSignature(signature);
       signature.addString(this.name ?? '');
     } else if (kind == idl.LinkedNodeKind.methodInvocation) {
       signature.addInt(this.kind == null ? 0 : this.kind.index);
@@ -12948,7 +12955,8 @@
 
   @override
   idl.TopLevelInferenceError get topLevelTypeInferenceError {
-    assert(kind == idl.LinkedNodeKind.simpleFormalParameter ||
+    assert(kind == idl.LinkedNodeKind.methodDeclaration ||
+        kind == idl.LinkedNodeKind.simpleFormalParameter ||
         kind == idl.LinkedNodeKind.variableDeclaration);
     _variantField_32 ??= const _TopLevelInferenceErrorReader()
         .vTableGet(_bc, _bcOffset, 32, null);
@@ -14085,6 +14093,10 @@
         _result["methodDeclaration_hasOperatorEqualWithParameterTypeFromObject"] =
             methodDeclaration_hasOperatorEqualWithParameterTypeFromObject;
       }
+      if (topLevelTypeInferenceError != null) {
+        _result["topLevelTypeInferenceError"] =
+            topLevelTypeInferenceError.toJson();
+      }
     }
     if (kind == idl.LinkedNodeKind.methodInvocation) {
       if (invocationExpression_invokeType != null) {
@@ -15441,6 +15453,7 @@
         "methodDeclaration_hasOperatorEqualWithParameterTypeFromObject":
             methodDeclaration_hasOperatorEqualWithParameterTypeFromObject,
         "name": name,
+        "topLevelTypeInferenceError": topLevelTypeInferenceError,
       };
     }
     if (kind == idl.LinkedNodeKind.methodInvocation) {
@@ -17655,7 +17668,6 @@
     implements idl.TopLevelInferenceError {
   List<String> _arguments;
   idl.TopLevelInferenceErrorKind _kind;
-  int _slot;
 
   @override
   List<String> get arguments => _arguments ??= <String>[];
@@ -17674,29 +17686,16 @@
     this._kind = value;
   }
 
-  @override
-  int get slot => _slot ??= 0;
-
-  /// The slot id (which is unique within the compilation unit) identifying the
-  /// target of type inference with which this [TopLevelInferenceError] is
-  /// associated.
-  set slot(int value) {
-    assert(value == null || value >= 0);
-    this._slot = value;
-  }
-
   TopLevelInferenceErrorBuilder(
-      {List<String> arguments, idl.TopLevelInferenceErrorKind kind, int slot})
+      {List<String> arguments, idl.TopLevelInferenceErrorKind kind})
       : _arguments = arguments,
-        _kind = kind,
-        _slot = slot;
+        _kind = kind;
 
   /// Flush [informative] data recursively.
   void flushInformative() {}
 
   /// Accumulate non-[informative] data into [signature].
   void collectApiSignature(api_sig.ApiSignature signature) {
-    signature.addInt(this._slot ?? 0);
     signature.addInt(this._kind == null ? 0 : this._kind.index);
     if (this._arguments == null) {
       signature.addInt(0);
@@ -17716,13 +17715,10 @@
     }
     fbBuilder.startTable();
     if (offset_arguments != null) {
-      fbBuilder.addOffset(2, offset_arguments);
+      fbBuilder.addOffset(1, offset_arguments);
     }
     if (_kind != null && _kind != idl.TopLevelInferenceErrorKind.assignment) {
-      fbBuilder.addUint8(1, _kind.index);
-    }
-    if (_slot != null && _slot != 0) {
-      fbBuilder.addUint32(0, _slot);
+      fbBuilder.addUint8(0, _kind.index);
     }
     return fbBuilder.endTable();
   }
@@ -17747,27 +17743,20 @@
 
   List<String> _arguments;
   idl.TopLevelInferenceErrorKind _kind;
-  int _slot;
 
   @override
   List<String> get arguments {
     _arguments ??= const fb.ListReader<String>(fb.StringReader())
-        .vTableGet(_bc, _bcOffset, 2, const <String>[]);
+        .vTableGet(_bc, _bcOffset, 1, const <String>[]);
     return _arguments;
   }
 
   @override
   idl.TopLevelInferenceErrorKind get kind {
     _kind ??= const _TopLevelInferenceErrorKindReader().vTableGet(
-        _bc, _bcOffset, 1, idl.TopLevelInferenceErrorKind.assignment);
+        _bc, _bcOffset, 0, idl.TopLevelInferenceErrorKind.assignment);
     return _kind;
   }
-
-  @override
-  int get slot {
-    _slot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0);
-    return _slot;
-  }
 }
 
 abstract class _TopLevelInferenceErrorMixin
@@ -17781,9 +17770,6 @@
     if (kind != idl.TopLevelInferenceErrorKind.assignment) {
       _result["kind"] = kind.toString().split('.')[1];
     }
-    if (slot != 0) {
-      _result["slot"] = slot;
-    }
     return _result;
   }
 
@@ -17791,7 +17777,6 @@
   Map<String, Object> toMap() => {
         "arguments": arguments,
         "kind": kind,
-        "slot": slot,
       };
 
   @override
diff --git a/pkg/analyzer/lib/src/summary/format.fbs b/pkg/analyzer/lib/src/summary/format.fbs
index 3455b9f..e797d29 100644
--- a/pkg/analyzer/lib/src/summary/format.fbs
+++ b/pkg/analyzer/lib/src/summary/format.fbs
@@ -437,9 +437,7 @@
 
   overrideConflictFieldType,
 
-  overrideConflictReturnType,
-
-  overrideConflictParameterType
+  overrideNoCombinedSuperSignature
 }
 
 /// Enum of token types, corresponding to AST token types.
@@ -1267,15 +1265,10 @@
 /// Summary information about a top-level type inference error.
 table TopLevelInferenceError {
   /// The [kind] specific arguments.
-  arguments:[string] (id: 2);
+  arguments:[string] (id: 1);
 
   /// The kind of the error.
-  kind:TopLevelInferenceErrorKind (id: 1);
-
-  /// The slot id (which is unique within the compilation unit) identifying the
-  /// target of type inference with which this [TopLevelInferenceError] is
-  /// associated.
-  slot:uint (id: 0);
+  kind:TopLevelInferenceErrorKind (id: 0);
 }
 
 table UnlinkedInformativeData {
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/idl.dart
index c7f6e2b..da3a10a 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/idl.dart
@@ -1494,6 +1494,7 @@
   LinkedNode get throwExpression_expression;
 
   @VariantId(32, variantList: [
+    LinkedNodeKind.methodDeclaration,
     LinkedNodeKind.simpleFormalParameter,
     LinkedNodeKind.variableDeclaration,
   ])
@@ -1904,18 +1905,12 @@
 /// Summary information about a top-level type inference error.
 abstract class TopLevelInferenceError extends base.SummaryClass {
   /// The [kind] specific arguments.
-  @Id(2)
+  @Id(1)
   List<String> get arguments;
 
   /// The kind of the error.
-  @Id(1)
-  TopLevelInferenceErrorKind get kind;
-
-  /// The slot id (which is unique within the compilation unit) identifying the
-  /// target of type inference with which this [TopLevelInferenceError] is
-  /// associated.
   @Id(0)
-  int get slot;
+  TopLevelInferenceErrorKind get kind;
 }
 
 /// Enum used to indicate the kind of the error during top-level inference.
@@ -1924,8 +1919,7 @@
   instanceGetter,
   dependencyCycle,
   overrideConflictFieldType,
-  overrideConflictReturnType,
-  overrideConflictParameterType
+  overrideNoCombinedSuperSignature,
 }
 
 @Variant('kind')
diff --git a/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart b/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart
index 497e564..bbdd1d7 100644
--- a/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart
+++ b/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart
@@ -964,6 +964,7 @@
       isSet: node.isSetter,
       isStatic: node.isStatic,
     );
+    builder.topLevelTypeInferenceError = LazyAst.getTypeInferenceError(node);
     _storeClassMember(builder, node);
     _storeInformativeId(builder, node);
     _writeActualReturnType(builder, node);
diff --git a/pkg/analyzer/lib/src/summary2/lazy_ast.dart b/pkg/analyzer/lib/src/summary2/lazy_ast.dart
index 9d54a9c..7b39a78 100644
--- a/pkg/analyzer/lib/src/summary2/lazy_ast.dart
+++ b/pkg/analyzer/lib/src/summary2/lazy_ast.dart
@@ -1432,6 +1432,7 @@
   bool _hasMetadata = false;
   bool _hasReturnType = false;
   bool _hasReturnTypeNode = false;
+  bool _hasTypeInferenceError = false;
 
   LazyMethodDeclaration(this.data);
 
@@ -1474,6 +1475,16 @@
     return LazyAst.getReturnType(node);
   }
 
+  static TopLevelInferenceError getTypeInferenceError(MethodDeclaration node) {
+    var lazy = get(node);
+    if (lazy != null && !lazy._hasTypeInferenceError) {
+      var error = lazy.data.topLevelTypeInferenceError;
+      LazyAst.setTypeInferenceError(node, error);
+      lazy._hasTypeInferenceError = true;
+    }
+    return LazyAst.getTypeInferenceError(node);
+  }
+
   static bool isAbstract(MethodDeclaration node) {
     var lazy = get(node);
     if (lazy != null) {
diff --git a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
index c15876f..21beafa 100644
--- a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
+++ b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
@@ -644,6 +644,8 @@
   TopLevelInferenceError getTypeInferenceError(AstNode node) {
     if (node is DefaultFormalParameter) {
       return getTypeInferenceError(node.parameter);
+    } else if (node is MethodDeclaration) {
+      return LazyMethodDeclaration.getTypeInferenceError(node);
     } else if (node is SimpleFormalParameter) {
       return LazyFormalParameter.getTypeInferenceError(node);
     } else if (node is VariableDeclaration) {
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index 6492436..c087b8e 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -1082,7 +1082,7 @@
 
   void validateHasType(AstNode n, PropertyAccessorElement e) {
     if (e.hasImplicitReturnType) {
-      var variable = e.declaration.variable as VariableElementImpl;
+      var variable = e.declaration.variable as NonParameterVariableElementImpl;
       TopLevelInferenceError error = variable.typeInferenceError;
       if (error != null) {
         if (error.kind == TopLevelInferenceErrorKind.dependencyCycle) {
diff --git a/pkg/analyzer/lib/src/task/strong_mode.dart b/pkg/analyzer/lib/src/task/strong_mode.dart
index 3371051..441661e 100644
--- a/pkg/analyzer/lib/src/task/strong_mode.dart
+++ b/pkg/analyzer/lib/src/task/strong_mode.dart
@@ -443,37 +443,62 @@
     }
 
     var name = Name(element.library.source.uri, element.name);
-    List<ExecutableElement> overriddenElements =
-        inheritance.getOverridden2(currentClassElement, name);
+    var overriddenElements = inheritance.getOverridden2(
+      currentClassElement,
+      name,
+    );
     if (overriddenElements == null ||
         !_allSameElementKind(element, overriddenElements)) {
       return;
     }
 
     FunctionType combinedSignatureType;
-    FunctionType getCombinedSignatureType() {
-      if (combinedSignatureType == null) {
-        var combinedSignature = inheritance.combineSignatures(
-          targetClass: currentClassElement,
-          candidates: overriddenElements,
-          doTopMerge: true,
-          name: name,
+    var hasImplicitType = element.hasImplicitReturnType ||
+        element.parameters.any((e) => e.hasImplicitType);
+    if (hasImplicitType) {
+      var conflicts = <Conflict>[];
+      var combinedSignature = inheritance.combineSignatures(
+        targetClass: currentClassElement,
+        candidates: overriddenElements,
+        doTopMerge: true,
+        name: name,
+        conflicts: conflicts,
+      );
+      if (combinedSignature != null) {
+        combinedSignatureType = _toOverriddenFunctionType(
+          element,
+          combinedSignature,
         );
-        if (combinedSignature != null) {
-          combinedSignatureType = _toOverriddenFunctionType(
-            element,
-            combinedSignature,
-          );
+        if (combinedSignatureType != null) {}
+      } else {
+        var conflictExplanation = '<unknown>';
+        if (conflicts.length == 1) {
+          var conflict = conflicts.single;
+          if (conflict is CandidatesConflict) {
+            conflictExplanation = conflict.candidates.map((candidate) {
+              var className = candidate.enclosingElement.name;
+              var typeStr = candidate.type.getDisplayString(
+                withNullability: typeSystem.isNonNullableByDefault,
+              );
+              return '$className.${name.name} ($typeStr)';
+            }).join(', ');
+          }
         }
+
+        LazyAst.setTypeInferenceError(
+          element.linkedNode,
+          TopLevelInferenceErrorBuilder(
+            kind: TopLevelInferenceErrorKind.overrideNoCombinedSuperSignature,
+            arguments: [conflictExplanation],
+          ),
+        );
       }
-      return combinedSignatureType;
     }
 
     //
     // Infer the return type.
     //
     if (element.hasImplicitReturnType && element.displayName != '[]=') {
-      var combinedSignatureType = getCombinedSignatureType();
       if (combinedSignatureType != null) {
         element.returnType = combinedSignatureType.returnType;
       } else {
@@ -491,7 +516,6 @@
         _inferParameterCovariance(parameter, index, overriddenElements);
 
         if (parameter.hasImplicitType) {
-          var combinedSignatureType = getCombinedSignatureType();
           _inferParameterType(parameter, index, combinedSignatureType);
         }
       }
@@ -531,12 +555,6 @@
       }
     } else {
       parameter.type = DynamicTypeImpl.instance;
-      LazyAst.setTypeInferenceError(
-        parameter.linkedNode,
-        TopLevelInferenceErrorBuilder(
-          kind: TopLevelInferenceErrorKind.overrideConflictParameterType,
-        ),
-      );
     }
   }
 
diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart
index f957a1d..9754f24 100644
--- a/pkg/analyzer/test/generated/simple_resolver_test.dart
+++ b/pkg/analyzer/test/generated/simple_resolver_test.dart
@@ -652,6 +652,7 @@
     );
   }
 
+  @Deprecated('It was used internally, should not be part of API')
   test_hasReferenceToSuper() async {
     await assertNoErrorsInCode(r'''
 class A {}
@@ -860,7 +861,7 @@
     expect(a.isValidMixin, isTrue);
   }
 
-  test_isValidMixin_super() async {
+  test_isValidMixin_super_toString() async {
     await assertNoErrorsInCode(r'''
 class A {
   toString() {
@@ -871,7 +872,7 @@
     verifyTestResolved();
 
     var a = findElement.class_('A');
-    expect(a.isValidMixin, isFalse);
+    expect(a.isValidMixin, isTrue);
   }
 
   test_isValidMixin_valid() async {
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 9f11614..fddb087 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -3562,9 +3562,9 @@
     SourceRange r = SourceRange(5, 10);
     expect(r.contains(5), isTrue);
     expect(r.contains(10), isTrue);
-    expect(r.contains(14), isTrue);
+    expect(r.contains(15), isTrue);
     expect(r.contains(0), isFalse);
-    expect(r.contains(15), isFalse);
+    expect(r.contains(16), isFalse);
   }
 
   void test_containsExclusive() {
diff --git a/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart b/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart
index d24901e..0696a67 100644
--- a/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart
@@ -196,18 +196,6 @@
           libFolder: newFolder('/packages/aaa/lib'),
           languageVersion: null,
         ),
-        'bbb': Package(
-          name: 'bbb',
-          rootFolder: newFolder('/packages/bbb'),
-          libFolder: newFolder('/packages/bbb/lib'),
-          languageVersion: Version(2, 7, 0),
-        ),
-        'ccc': Package(
-          name: 'ccc',
-          rootFolder: newFolder('/packages/ccc'),
-          libFolder: newFolder('/packages/ccc/lib'),
-          languageVersion: Version(2, 9, 0),
-        ),
       },
     );
 
@@ -226,14 +214,6 @@
     _assertNonNullableForPath('/packages/aaa/lib/b.dart', true);
     _assertNonNullableForPath('/packages/aaa/test/c.dart', true);
 
-    _assertNonNullableForPath('/packages/bbb/a.dart', false);
-    _assertNonNullableForPath('/packages/bbb/lib/b.dart', false);
-    _assertNonNullableForPath('/packages/bbb/test/c.dart', false);
-
-    _assertNonNullableForPath('/packages/ccc/a.dart', true);
-    _assertNonNullableForPath('/packages/ccc/lib/b.dart', true);
-    _assertNonNullableForPath('/packages/ccc/test/c.dart', true);
-
     _assertNonNullableForPath('/other/file.dart', false);
   }
 
diff --git a/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart b/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart
index f738f6f..cbb0bde 100644
--- a/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart
@@ -10,11 +10,13 @@
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
+import '../constant/potentially_constant_test.dart';
 import 'driver_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(ExtensionOverrideTest);
+    defineReflectiveTests(ExtensionOverrideWithNullSafetyTest);
   });
 }
 
@@ -311,20 +313,20 @@
     validateBinaryExpression();
   }
 
-  test_operator_onTearoff() async {
+  test_operator_onTearOff() async {
     // https://github.com/dart-lang/sdk/issues/38653
     await assertErrorsInCode('''
-f(){
-  E(null).v++;
-}
-extension E on Object{
+extension E on int {
   v() {}
 }
+
+f(){
+  E(0).v++;
+}
 ''', [
-      error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 15, 1),
+      error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 45, 1),
     ]);
-    findDeclarationAndOverride(
-        declarationName: 'E ', overrideSearch: 'E(null)');
+    findDeclarationAndOverride(declarationName: 'E ', overrideSearch: 'E(0)');
     validateOverride();
   }
 
@@ -518,7 +520,7 @@
     validatePropertyAccess();
   }
 
-  test_tearoff() async {
+  test_tearOff() async {
     await assertNoErrorsInCode('''
 class C {}
 
@@ -601,3 +603,95 @@
     expect(resolvedElement, expectedElement);
   }
 }
+
+@reflectiveTest
+class ExtensionOverrideWithNullSafetyTest extends ExtensionOverrideTest
+    with WithNullSafetyMixin {
+  test_indexExpression_read_nullAware() async {
+    await assertNoErrorsInCode('''
+extension E on int {
+  int operator [](int index) => 0;
+}
+
+void f(int? a) {
+  E(a)?.[0];
+}
+''');
+
+    assertIndexExpression(
+      findNode.index('[0]'),
+      readElement: findElement.method('[]', of: 'E'),
+      writeElement: null,
+      type: 'int?',
+    );
+  }
+
+  test_indexExpression_write_nullAware() async {
+    await assertNoErrorsInCode('''
+extension E on int {
+  operator []=(int index, int value) {}
+}
+
+void f(int? a) {
+  E(a)?.[0] = 1;
+}
+''');
+
+    assertIndexExpression(
+      findNode.index('[0]'),
+      readElement: null,
+      writeElement: findElement.method('[]=', of: 'E'),
+      type: 'int?',
+    );
+  }
+
+  test_methodInvocation_nullAware() async {
+    await assertNoErrorsInCode('''
+extension E on int {
+  int foo() => 0;
+}
+
+void f(int? a) {
+  E(a)?.foo();
+}
+''');
+
+    assertMethodInvocation2(
+      findNode.methodInvocation('foo();'),
+      element: findElement.method('foo'),
+      typeArgumentTypes: [],
+      invokeType: 'int Function()',
+      type: 'int?',
+    );
+  }
+
+  test_propertyAccess_getter_nullAware() async {
+    await assertNoErrorsInCode('''
+extension E on int {
+  int get foo => 0;
+}
+
+void f(int? a) {
+  E(a)?.foo;
+}
+''');
+
+    assertPropertyAccess2(
+      findNode.propertyAccess('?.foo'),
+      element: findElement.getter('foo'),
+      type: 'int?',
+    );
+  }
+
+  test_propertyAccess_setter_nullAware() async {
+    await assertNoErrorsInCode('''
+extension E on int {
+  set foo(int _) {}
+}
+
+void f(int? a) {
+  E(a)?.foo = 0;
+}
+''');
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/resolution/language_version_test.dart b/pkg/analyzer/test/src/dart/resolution/language_version_test.dart
index 1864e3d..70b7de1 100644
--- a/pkg/analyzer/test/src/dart/resolution/language_version_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/language_version_test.dart
@@ -6,18 +6,20 @@
 import 'package:analyzer/src/context/packages.dart';
 import 'package:analyzer/src/dart/analysis/experiments.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/test_utilities/mock_sdk.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'driver_resolution.dart';
 
 main() {
   defineReflectiveSuite(() {
-    defineReflectiveTests(DefaultNonNullableTest);
+    defineReflectiveTests(NullSafetyUsingAllowedExperimentsTest);
+    defineReflectiveTests(NullSafetyExperimentGlobalTest);
   });
 }
 
 @reflectiveTest
-class DefaultNonNullableTest extends DriverResolutionTest {
+class NullSafetyExperimentGlobalTest extends _FeaturesTest {
   @override
   AnalysisOptionsImpl get analysisOptions => AnalysisOptionsImpl()
     ..contextFeatures = FeatureSet.fromEnableFlags(
@@ -46,12 +48,7 @@
   ]
 }
 ''');
-    driver.configure(
-      packages: findPackagesFrom(
-        resourceProvider,
-        getFolder('/test'),
-      ),
-    );
+    _configureTestWithJsonConfig();
 
     newFile('/aaa/lib/a.dart', content: r'''
 int a = 0;
@@ -89,12 +86,7 @@
   ]
 }
 ''');
-    driver.configure(
-      packages: findPackagesFrom(
-        resourceProvider,
-        getFolder('/test'),
-      ),
-    );
+    _configureTestWithJsonConfig();
 
     newFile('/aaa/lib/a.dart', content: r'''
 int a = 0;
@@ -113,3 +105,114 @@
     assertType(findElement.topVar('z').type, 'double');
   }
 }
+
+@reflectiveTest
+class NullSafetyUsingAllowedExperimentsTest extends _FeaturesTest {
+  @override
+  bool get typeToStringWithNullability => true;
+
+  test_jsonConfig_disable() async {
+    _configureAllowedExperimentsTestNullSafety();
+
+    newFile('/test/.dart_tool/package_config.json', content: '''
+{
+  "configVersion": 2,
+  "packages": [
+    {
+      "name": "test",
+      "rootUri": "../",
+      "packageUri": "lib/",
+      "languageVersion": "2.8"
+    }
+  ]
+}
+''');
+    _configureTestWithJsonConfig();
+
+    await assertNoErrorsInCode('''
+var x = 0;
+''');
+    assertType(findElement.topVar('x').type, 'int*');
+
+    // Upgrade the language version to `2.9`, so enabled Null Safety.
+    _changeTestFile();
+    await assertNoErrorsInCode('''
+// @dart = 2.9
+var x = 0;
+''');
+    assertType(findElement.topVar('x').type, 'int');
+  }
+
+  test_jsonConfig_enable() async {
+    _configureAllowedExperimentsTestNullSafety();
+
+    newFile('/test/.dart_tool/package_config.json', content: '''
+{
+  "configVersion": 2,
+  "packages": [
+    {
+      "name": "test",
+      "rootUri": "../",
+      "packageUri": "lib/"
+    }
+  ]
+}
+''');
+    _configureTestWithJsonConfig();
+
+    await assertNoErrorsInCode('''
+var x = 0;
+''');
+    assertType(findElement.topVar('x').type, 'int');
+
+    // Downgrade the version to `2.8`, so disable Null Safety.
+    _changeTestFile();
+    await assertNoErrorsInCode('''
+// @dart = 2.8
+var x = 0;
+''');
+    assertType(findElement.topVar('x').type, 'int*');
+  }
+
+  void _changeTestFile() {
+    var path = convertPath('/test/lib/test.dart');
+    driver.changeFile(path);
+  }
+
+  void _configureAllowedExperimentsTestNullSafety() {
+    _newSdkExperimentsFile(r'''
+{
+  "version": 1,
+  "experimentSets": {
+    "nullSafety": ["non-nullable"]
+  },
+  "sdk": {
+    "default": {
+      "experimentSet": "nullSafety"
+    }
+  },
+  "packages": {
+    "test": {
+      "experimentSet": "nullSafety"
+    }
+  }
+}
+''');
+  }
+
+  void _newSdkExperimentsFile(String content) {
+    newFile('$sdkRoot/lib/_internal/allowed_experiments.json',
+        content: content);
+  }
+}
+
+class _FeaturesTest extends DriverResolutionTest {
+  void _configureTestWithJsonConfig() {
+    driver.configure(
+      packages: findPackagesFrom(
+        resourceProvider,
+        getFolder('/test'),
+      ),
+    );
+  }
+}
diff --git a/pkg/analyzer/test/src/dart/resolution/library_element_test.dart b/pkg/analyzer/test/src/dart/resolution/library_element_test.dart
index 29a98ec..49f98f6 100644
--- a/pkg/analyzer/test/src/dart/resolution/library_element_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/library_element_test.dart
@@ -49,20 +49,56 @@
 
     newFile('/test/lib/b.dart', content: r'''
 // @dart = 2.6
-class B {}
+class A {}
+''');
+
+    newFile('/test/lib/c.dart', content: r'''
+// @dart = 2.9
+class A {}
+''');
+
+    newFile('/test/lib/d.dart', content: r'''
+// @dart = 2.99
+class A {}
+''');
+
+    newFile('/test/lib/e.dart', content: r'''
+// @dart = 3.0
+class A {}
+''');
+
+    newFile('/aaa/lib/a.dart', content: r'''
+class A {}
+''');
+
+    newFile('/aaa/lib/b.dart', content: r'''
+// @dart = 2.99
+class A {}
 ''');
 
     newFile('/aaa/lib/c.dart', content: r'''
-class C {}
+// @dart = 3.0
+class A {}
 ''');
 
+    // No override.
     await _assertLanguageVersion('package:test/a.dart', 2, 7);
+
+    // Valid override, less than the latest supported language version.
     await _assertLanguageVersion('package:test/b.dart', 2, 6);
-    await _assertLanguageVersion(
-      'package:aaa/c.dart',
-      ExperimentStatus.currentVersion.major,
-      ExperimentStatus.currentVersion.minor,
-    );
+
+    // Valid override, even if greater than the package language version.
+    await _assertLanguageVersion('package:test/c.dart', 2, 9);
+
+    // Invalid override: minor is greater than the latest minor.
+    await _assertLanguageVersion('package:test/d.dart', 2, 7);
+
+    // Invalid override: major is greater than the latest major.
+    await _assertLanguageVersion('package:test/e.dart', 2, 7);
+
+    await _assertLanguageVersionCurrent('package:aaa/a.dart');
+    await _assertLanguageVersionCurrent('package:aaa/b.dart');
+    await _assertLanguageVersionCurrent('package:aaa/c.dart');
   }
 
   Future<void> _assertLanguageVersion(
@@ -74,4 +110,12 @@
     expect(element.languageVersionMajor, major);
     expect(element.languageVersionMinor, minor);
   }
+
+  Future<void> _assertLanguageVersionCurrent(String uriStr) async {
+    await _assertLanguageVersion(
+      uriStr,
+      ExperimentStatus.currentVersion.major,
+      ExperimentStatus.currentVersion.minor,
+    );
+  }
 }
diff --git a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart
index 825805e..c19c96d 100644
--- a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart
@@ -22,6 +22,26 @@
     ..contextFeatures = FeatureSet.forTesting(
         sdkVersion: '2.7.0', additionalFeatures: [Feature.non_nullable]);
 
+  test_factoryConstructor_named_blockBody() async {
+    await assertErrorsInCode(r'''
+class A {
+  factory A.named() {}
+}
+''', [
+      error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 20, 7),
+    ]);
+  }
+
+  test_factoryConstructor_unnamed_blockBody() async {
+    await assertErrorsInCode(r'''
+class A {
+  factory A() {}
+}
+''', [
+      error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 20, 1),
+    ]);
+  }
+
   test_function_future_int_blockBody_async() async {
     await assertErrorsInCode(r'''
 Future<int> foo() async {}
@@ -219,6 +239,22 @@
 ''');
   }
 
+  test_generativeConstructor_blockBody() async {
+    await assertNoErrorsInCode(r'''
+class A {
+  A() {}
+}
+''');
+  }
+
+  test_generativeConstructor_emptyBody() async {
+    await assertNoErrorsInCode(r'''
+class A {
+  A();
+}
+''');
+  }
+
   test_method_future_int_blockBody_async() async {
     await assertErrorsInCode(r'''
 class A {
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart
new file mode 100644
index 0000000..9c62cae
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart
@@ -0,0 +1,79 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/context/packages.dart';
+import 'package:analyzer/src/dart/analysis/experiments.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/error/hint_codes.dart';
+import 'package:meta/meta.dart';
+import 'package:pub_semver/pub_semver.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../dart/constant/potentially_constant_test.dart';
+import '../dart/resolution/driver_resolution.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(InvalidLanguageOverrideGreaterTest);
+  });
+}
+
+@reflectiveTest
+class InvalidLanguageOverrideGreaterTest extends DriverResolutionTest
+    with WithNullSafetyMixin {
+  test_greaterThanLatest() async {
+    var latestVersion = ExperimentStatus.currentVersion;
+    await assertErrorsInCode('''
+// @dart = ${latestVersion.major}.${latestVersion.minor + 1}
+class A {}
+''', [
+      error(HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, 0, 15),
+    ]);
+    _assertUnitLanguageVersion(
+      major: latestVersion.major,
+      minor: latestVersion.minor,
+    );
+  }
+
+  test_greaterThanPackage() async {
+    _configureTestPackageLanguageVersion('2.5');
+    await assertNoErrorsInCode(r'''
+// @dart = 2.9
+int? a;
+''');
+    _assertUnitLanguageVersion(major: 2, minor: 9);
+  }
+
+  test_lessThanPackage() async {
+    _configureTestPackageLanguageVersion('2.5');
+    await assertNoErrorsInCode(r'''
+// @dart = 2.4
+class A {}
+''');
+    _assertUnitLanguageVersion(major: 2, minor: 4);
+  }
+
+  void _assertUnitLanguageVersion({
+    @required int major,
+    @required int minor,
+  }) {
+    var unitImpl = result.unit as CompilationUnitImpl;
+    expect(unitImpl.languageVersionMajor, major);
+    expect(unitImpl.languageVersionMinor, minor);
+  }
+
+  void _configureTestPackageLanguageVersion(String versionStr) {
+    driver.configure(
+      packages: Packages({
+        'test': Package(
+          name: 'test',
+          rootFolder: getFolder('/test'),
+          libFolder: getFolder('/test/lib'),
+          languageVersion: Version.parse(versionStr + '.0'),
+        ),
+      }),
+    );
+  }
+}
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart
index 5e72381..1495c82 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart
@@ -16,17 +16,21 @@
 @reflectiveTest
 class InvalidLanguageOverrideTest extends DriverResolutionTest {
   test_correct_11_12() async {
-    await assertNoErrorsInCode(r'''
+    await assertErrorsInCode(r'''
 // @dart = 11.12
 int i = 0;
-''');
+''', [
+      error(HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, 0, 16),
+    ]);
   }
 
   test_correct_2_10() async {
-    await assertNoErrorsInCode(r'''
+    await assertErrorsInCode(r'''
 // @dart = 2.10
 int i = 0;
-''');
+''', [
+      error(HintCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, 0, 15),
+    ]);
   }
 
   test_correct_withMultipleWhitespace() async {
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart
index baaff61..b46af7a 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart
@@ -209,17 +209,17 @@
   test_method_normalParamType_superclass_interface() async {
     await assertErrorsInCode('''
 abstract class I<U> {
-  m(U u) => null;
+  void m(U u) => null;
 }
 abstract class J<V> {
-  m(V v) => null;
+  void m(V v) => null;
 }
 class B extends I<int> implements J<String> {
-  m(double d) {}
+  void m(double d) {}
 }
 ''', [
-      error(CompileTimeErrorCode.INVALID_OVERRIDE, 132, 1),
-      error(CompileTimeErrorCode.INVALID_OVERRIDE, 132, 1),
+      error(CompileTimeErrorCode.INVALID_OVERRIDE, 147, 1),
+      error(CompileTimeErrorCode.INVALID_OVERRIDE, 147, 1),
     ]);
   }
 
@@ -244,17 +244,17 @@
     // language/override_inheritance_generic_test/08
     await assertErrorsInCode('''
 abstract class I<U> {
-  m(U u) => null;
+  void m(U u) => null;
 }
 abstract class J<V> {
-  m(V v) => null;
+  void m(V v) => null;
 }
 class B implements I<int>, J<String> {
-  m(double d) {}
+  void m(double d) {}
 }
 ''', [
-      error(CompileTimeErrorCode.INVALID_OVERRIDE, 125, 1),
-      error(CompileTimeErrorCode.INVALID_OVERRIDE, 125, 1),
+      error(CompileTimeErrorCode.INVALID_OVERRIDE, 140, 1),
+      error(CompileTimeErrorCode.INVALID_OVERRIDE, 140, 1),
     ]);
   }
 
diff --git a/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart b/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart
new file mode 100644
index 0000000..d93e2ef
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart
@@ -0,0 +1,76 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/error/codes.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../dart/resolution/driver_resolution.dart';
+
+main() {
+  defineReflectiveSuite(() {
+    defineReflectiveTests(NoCombinedSuperSignatureTest);
+  });
+}
+
+@reflectiveTest
+class NoCombinedSuperSignatureTest extends DriverResolutionTest {
+  test_conflictingParameter() async {
+    await assertErrorsInCode('''
+abstract class A {
+  void foo(int x);
+}
+
+abstract class B {
+  void foo(double x);
+}
+
+abstract class C implements A, B {
+  foo(num x);
+}
+''', [
+      error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 122, 3),
+    ]);
+  }
+
+  /// If the method is subject to override inference, it is already an error
+  /// when no combined super signature exist.
+  ///
+  /// It does not matter that the conflicting component (the return type here)
+  /// was resolved.
+  test_conflictingReturnType() async {
+    await assertErrorsInCode('''
+abstract class A {
+  int foo(int x);
+}
+
+abstract class B {
+  double foo(int x);
+}
+
+abstract class C implements A, B {
+  Never foo(x);
+}
+''', [
+      error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 126, 3),
+    ]);
+  }
+
+  test_noInvalidOverrideErrors() async {
+    await assertErrorsInCode('''
+abstract class A {
+  String foo(String a);
+}
+
+abstract class B {
+  int foo(int a);
+}
+
+abstract class C implements A, B {
+  foo(a);
+}
+''', [
+      error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 123, 3),
+    ]);
+  }
+}
diff --git a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart
index 78fe5ce..f078f04 100644
--- a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart
@@ -17,6 +17,39 @@
 
 @reflectiveTest
 class ReturnOfInvalidTypeTest extends DriverResolutionTest {
+  test_closure() async {
+    await assertErrorsInCode('''
+typedef Td = int Function();
+Td f() {
+  return () => "hello";
+}
+''', [
+      error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 53, 7),
+    ]);
+  }
+
+  test_factoryConstructor_named() async {
+    await assertErrorsInCode('''
+class C {
+  factory C.named() => 7;
+}
+''', [
+      error(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, 33, 1),
+    ]);
+  }
+
+  test_factoryConstructor_unnamed() async {
+    await assertErrorsInCode('''
+class C {
+  factory C() => 7;
+}
+''', [
+      error(
+          StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, 27, 1),
+    ]);
+  }
+
   test_function_async_block__to_Future_void() async {
     await assertNoErrorsInCode(r'''
 Future<void> f1() async {}
diff --git a/pkg/analyzer/test/src/diagnostics/test_all.dart b/pkg/analyzer/test/src/diagnostics/test_all.dart
index 2b75e35..9fb2370 100644
--- a/pkg/analyzer/test/src/diagnostics/test_all.dart
+++ b/pkg/analyzer/test/src/diagnostics/test_all.dart
@@ -139,14 +139,10 @@
     as field_in_struct_with_initializer;
 import 'field_initialized_by_multiple_initializers_test.dart'
     as field_initialized_by_multiple_initializers;
-import 'final_initialized_in_delcaration_and_constructor_test.dart'
-    as final_initialized_in_declaration_and_constructor;
 import 'field_initialized_in_initializer_and_declaration_test.dart'
     as field_initialized_in_initializer_and_declaration;
 import 'field_initialized_in_parameter_and_initializer_test.dart'
     as field_initialized_in_parameter_and_initializer;
-import 'final_initialized_multiple_times_test.dart'
-    as final_initialized_multiple_times;
 import 'field_initializer_factory_constructor_test.dart'
     as field_initializer_factory_constructor;
 import 'field_initializer_in_struct_test.dart' as field_initializer_in_struct;
@@ -158,6 +154,10 @@
     as field_initializer_redirecting_constructor;
 import 'field_initializing_formal_not_assignable_test.dart'
     as field_initializing_formal_not_assignable;
+import 'final_initialized_in_delcaration_and_constructor_test.dart'
+    as final_initialized_in_declaration_and_constructor;
+import 'final_initialized_multiple_times_test.dart'
+    as final_initialized_multiple_times;
 import 'final_not_initialized_constructor_test.dart'
     as final_not_initialized_constructor;
 import 'final_not_initialized_test.dart' as final_not_initialized;
@@ -219,6 +219,8 @@
     as invalid_factory_name_not_a_class;
 import 'invalid_field_type_in_struct_test.dart' as invalid_field_type_in_struct;
 import 'invalid_immutable_annotation_test.dart' as invalid_immutable_annotation;
+import 'invalid_language_override_greater_test.dart'
+    as invalid_language_override_greater;
 import 'invalid_language_override_test.dart' as invalid_language_override;
 import 'invalid_literal_annotation_test.dart' as invalid_literal_annotation;
 import 'invalid_modifier_on_constructor_test.dart'
@@ -312,6 +314,7 @@
 import 'new_with_non_type_test.dart' as new_with_non_type;
 import 'new_with_undefined_constructor_test.dart'
     as new_with_undefined_constructor;
+import 'no_combined_super_signature_test.dart' as no_combined_super_signature;
 import 'no_default_super_constructor_test.dart' as no_default_super_constructor;
 import 'non_abstract_class_inherits_abstract_member_test.dart'
     as non_abstract_class_inherits_abstract_member;
@@ -677,6 +680,7 @@
     invalid_factory_name_not_a_class.main();
     invalid_field_type_in_struct.main();
     invalid_immutable_annotation.main();
+    invalid_language_override_greater.main();
     invalid_language_override.main();
     invalid_literal_annotation.main();
     invalid_modifier_on_constructor.main();
@@ -739,6 +743,7 @@
     must_call_super.main();
     new_with_non_type.main();
     new_with_undefined_constructor.main();
+    no_combined_super_signature.main();
     no_default_super_constructor.main();
     non_abstract_class_inherits_abstract_member.main();
     non_bool_condition.main();
diff --git a/pkg/analyzer/test/src/summary/element_text.dart b/pkg/analyzer/test/src/summary/element_text.dart
index a2fd724..ab54d35 100644
--- a/pkg/analyzer/test/src/summary/element_text.dart
+++ b/pkg/analyzer/test/src/summary/element_text.dart
@@ -545,6 +545,7 @@
 
     writeName(e);
     writeCodeRange(e);
+    writeTypeInferenceError(e);
 
     writeTypeParameterElements(e.typeParameters);
     writeParameterElements(e.parameters);
@@ -857,8 +858,6 @@
       buffer.write('*/');
     }
 
-    writeVariableTypeInferenceError(e);
-
     if (defaultValue != null) {
       buffer.write(defaultValueSeparator);
       writeNode(defaultValue);
@@ -992,7 +991,7 @@
     writeName(e);
     writeCodeRange(e);
 
-    writeVariableTypeInferenceError(e);
+    writeTypeInferenceError(e);
 
     if (withFullyResolvedAst) {
       buffer.writeln(';');
@@ -1035,6 +1034,23 @@
     buffer.write(' ');
   }
 
+  void writeTypeInferenceError(Element e) {
+    TopLevelInferenceError inferenceError;
+    if (e is MethodElementImpl) {
+      inferenceError = e.typeInferenceError;
+    } else if (e is NonParameterVariableElementImpl) {
+      inferenceError = e.typeInferenceError;
+    }
+
+    if (inferenceError != null) {
+      String kindName = inferenceError.kind.toString();
+      if (kindName.startsWith('TopLevelInferenceErrorKind.')) {
+        kindName = kindName.substring('TopLevelInferenceErrorKind.'.length);
+      }
+      buffer.write('/*error: $kindName*/');
+    }
+  }
+
   void writeTypeParameterElement(TypeParameterElement e) {
     writeMetadata(e, '', '\n');
     // TODO (kallentu) : Clean up TypeParameterElementImpl casting once
@@ -1091,19 +1107,6 @@
     }
   }
 
-  void writeVariableTypeInferenceError(VariableElement e) {
-    if (e is VariableElementImpl) {
-      TopLevelInferenceError inferenceError = e.typeInferenceError;
-      if (inferenceError != null) {
-        String kindName = inferenceError.kind.toString();
-        if (kindName.startsWith('TopLevelInferenceErrorKind.')) {
-          kindName = kindName.substring('TopLevelInferenceErrorKind.'.length);
-        }
-        buffer.write('/*error: $kindName*/');
-      }
-    }
-  }
-
   /// Assert that the [accessor] of the [property] is correctly linked to
   /// the same enclosing element as the [property].
   void _assertSyntheticAccessorEnclosing(
diff --git a/pkg/analyzer/test/src/summary/top_level_inference_test.dart b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
index 954c0ac..7b2e7bf 100644
--- a/pkg/analyzer/test/src/summary/top_level_inference_test.dart
+++ b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
@@ -2112,32 +2112,28 @@
 ''');
   }
 
-  test_method_error_conflict_parameterType_generic() async {
+  test_method_error_hasMethod_noParameter_required() async {
     var library = await _encodeDecodeLibrary(r'''
-class A<T> {
-  void m(T a) {}
+class A {
+  void m(int a) {}
 }
-class B<E> {
-  void m(E a) {}
-}
-class C extends A<int> implements B<double> {
-  void m(a) {}
+class B extends A {
+  void m(a, b) {}
 }
 ''');
+    // It's an error to add a new required parameter, but it is not a
+    // top-level type inference error.
     checkElementText(library, r'''
-class A<T> {
-  void m(T a) {}
+class A {
+  void m(int a) {}
 }
-class B<E> {
-  void m(E a) {}
-}
-class C extends A<int> implements B<double> {
-  void m(dynamic a/*error: overrideConflictParameterType*/) {}
+class B extends A {
+  void m(int a, dynamic b) {}
 }
 ''');
   }
 
-  test_method_error_conflict_parameterType_notGeneric() async {
+  test_method_error_noCombinedSuperSignature1() async {
     var library = await _encodeDecodeLibrary(r'''
 class A {
   void m(int a) {}
@@ -2146,48 +2142,50 @@
   void m(String a) {}
 }
 class C extends A implements B {
-  void m(a) {}
-}
-''');
-    checkElementText(library, r'''
-class A {
-  void m(int a) {}
-}
-class B {
-  void m(String a) {}
-}
-class C extends A implements B {
-  void m(dynamic a/*error: overrideConflictParameterType*/) {}
-}
-''');
-  }
-
-  test_method_error_conflict_returnType_generic() async {
-    var library = await _encodeDecodeLibrary(r'''
-class A<K, V> {
-  V m(K a) {}
-}
-class B<T> {
-  T m(int a) {}
-}
-class C extends A<int, String> implements B<double> {
   m(a) {}
 }
 ''');
     checkElementText(library, r'''
-class A<K, V> {
-  V m(K a) {}
+class A {
+  void m(int a) {}
 }
-class B<T> {
-  T m(int a) {}
+class B {
+  void m(String a) {}
 }
-class C extends A<int, String> implements B<double> {
-  dynamic m(dynamic a/*error: overrideConflictParameterType*/) {}
+class C extends A implements B {
+  dynamic m/*error: overrideNoCombinedSuperSignature*/(dynamic a) {}
 }
 ''');
   }
 
-  test_method_error_conflict_returnType_notGeneric() async {
+  test_method_error_noCombinedSuperSignature2() async {
+    var library = await _encodeDecodeLibrary(r'''
+abstract class A {
+  int foo(int x);
+}
+
+abstract class B {
+  double foo(int x);
+}
+
+abstract class C implements A, B {
+  Never foo(x);
+}
+''');
+    checkElementText(library, r'''
+abstract class A {
+  int foo(int x);
+}
+abstract class B {
+  double foo(int x);
+}
+abstract class C implements A, B {
+  Null foo/*error: overrideNoCombinedSuperSignature*/(dynamic x);
+}
+''');
+  }
+
+  test_method_error_noCombinedSuperSignature3() async {
     var library = await _encodeDecodeLibrary(r'''
 class A {
   int m() {}
@@ -2208,28 +2206,57 @@
   String m() {}
 }
 class C extends A implements B {
-  dynamic m() {}
+  dynamic m/*error: overrideNoCombinedSuperSignature*/() {}
 }
 ''');
   }
 
-  test_method_error_hasMethod_noParameter_required() async {
+  test_method_error_noCombinedSuperSignature_generic1() async {
     var library = await _encodeDecodeLibrary(r'''
-class A {
-  void m(int a) {}
+class A<T> {
+  void m(T a) {}
 }
-class B extends A {
-  void m(a, b) {}
+class B<E> {
+  void m(E a) {}
+}
+class C extends A<int> implements B<double> {
+  m(a) {}
 }
 ''');
-    // It's an error to add a new required parameter, but it is not a
-    // top-level type inference error.
     checkElementText(library, r'''
-class A {
-  void m(int a) {}
+class A<T> {
+  void m(T a) {}
 }
-class B extends A {
-  void m(int a, dynamic b) {}
+class B<E> {
+  void m(E a) {}
+}
+class C extends A<int> implements B<double> {
+  dynamic m/*error: overrideNoCombinedSuperSignature*/(dynamic a) {}
+}
+''');
+  }
+
+  test_method_error_noCombinedSuperSignature_generic2() async {
+    var library = await _encodeDecodeLibrary(r'''
+class A<K, V> {
+  V m(K a) {}
+}
+class B<T> {
+  T m(int a) {}
+}
+class C extends A<int, String> implements B<double> {
+  m(a) {}
+}
+''');
+    checkElementText(library, r'''
+class A<K, V> {
+  V m(K a) {}
+}
+class B<T> {
+  T m(int a) {}
+}
+class C extends A<int, String> implements B<double> {
+  dynamic m/*error: overrideNoCombinedSuperSignature*/(dynamic a) {}
 }
 ''');
   }
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index edbcf0e..ecc1aa4 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -583,17 +583,17 @@
 abstract class Bottom implements Left, Right {}
 
 abstract class TakesLeft {
-  m(Left x);
+  void m(Left x);
 }
 abstract class TakesRight {
-  m(Right x);
+  void m(Right x);
 }
 abstract class TakesTop implements TakesLeft, TakesRight {
-  m(Top x); // works today
+  void m(Top x); // works today
 }
 abstract class TakesBottom implements TakesLeft, TakesRight {
   // LUB(Left, Right) == Top, so this is an implicit cast from Top to Bottom.
-  m(covariant Bottom x);
+  void m(covariant Bottom x);
 }
     ''');
   }
@@ -2820,11 +2820,11 @@
 class B {}
 
 class Base {
-    m(A a) {}
+  void m(A a) {}
 }
 
 class I1 {
-    m(B a) {}
+  void m(B a) {}
 }
 
 class /*error:INCONSISTENT_INHERITANCE*/T1
@@ -2832,7 +2832,7 @@
     implements I1 {}
 
 class T2 extends Base implements I1 {
-    m(a) {}
+  void m(dynamic a) {}
 }
 
 class /*error:INCONSISTENT_INHERITANCE*/T3
@@ -2844,7 +2844,7 @@
     implements I1;
 
 class T4 extends Object with Base implements I1 {
-    m(a) {}
+  void m(dynamic a) {}
 }
 ''');
   }
@@ -3586,15 +3586,15 @@
 class B {}
 
 abstract class I1 {
-    m(A a);
+  void m(A a);
 }
 
 class Base {
-    m(B a) {}
+  void m(B a) {}
 }
 
 class T1 extends Base implements I1 {
-  /*error:INVALID_OVERRIDE*/m(B a) {}
+  void /*error:INVALID_OVERRIDE*/m(B a) {}
 }
 
 class /*error:INCONSISTENT_INHERITANCE*/T2
@@ -3609,15 +3609,15 @@
 class B {}
 
 abstract class I1 {
-    m(A a);
+  void m(A a);
 }
 
 class M {
-    m(B a) {}
+  void m(B a) {}
 }
 
 class T1 extends Object with M implements I1 {
-  /*error:INVALID_OVERRIDE*/m(B a) {}
+  void /*error:INVALID_OVERRIDE*/m(B a) {}
 }
 
 class /*error:INCONSISTENT_INHERITANCE*/T2
diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md
index 2d947ba..a7a82ea 100644
--- a/pkg/analyzer/tool/diagnostics/diagnostics.md
+++ b/pkg/analyzer/tool/diagnostics/diagnostics.md
@@ -5554,6 +5554,9 @@
 
 ### return_of_invalid_type
 
+_A value of type '{0}' can't be returned from constructor '{2}' because it has a
+return type of '{1}'._
+
 _A value of type '{0}' can't be returned from function '{2}' because it has a
 return type of '{1}'._
 
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 9090b5d..0b8f922 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -424,6 +424,10 @@
 
   FunctionEntity get throwAbstractClassInstantiationError;
 
+  /// Recognizes the `checkConcurrentModificationError` helper without needing
+  /// it to be resolved.
+  bool isCheckConcurrentModificationError(MemberEntity member);
+
   FunctionEntity get checkConcurrentModificationError;
 
   FunctionEntity get throwConcurrentModificationError;
@@ -442,16 +446,10 @@
 
   FunctionEntity get getRuntimeTypeInfo;
 
-  FunctionEntity get getTypeArgumentByIndex;
-
   FunctionEntity get computeSignature;
 
   FunctionEntity get getRuntimeTypeArguments;
 
-  FunctionEntity get getRuntimeTypeArgument;
-
-  FunctionEntity get getRuntimeTypeArgumentIntercepted;
-
   FunctionEntity get checkDeferredIsLoaded;
 
   FunctionEntity get throwNoSuchMethod;
@@ -476,8 +474,6 @@
 
   FunctionEntity get instantiatedGenericFunctionType;
 
-  FunctionEntity get extractFunctionTypeObjectFromInternal;
-
   // From dart:_rti
 
   FunctionEntity get findType;
@@ -1732,12 +1728,20 @@
       _findHelperFunction('throwUnsupportedError');
 
   @override
-  FunctionEntity get throwTypeError => _findHelperFunction('throwTypeError');
+  FunctionEntity get throwTypeError => _findRtiFunction('throwTypeError');
 
   @override
   FunctionEntity get throwAbstractClassInstantiationError =>
       _findHelperFunction('throwAbstractClassInstantiationError');
 
+  @override
+  bool isCheckConcurrentModificationError(MemberEntity member) {
+    return member.name == 'checkConcurrentModificationError' &&
+        member.isFunction &&
+        member.isTopLevel &&
+        member.library == jsHelperLibrary;
+  }
+
   FunctionEntity _cachedCheckConcurrentModificationError;
   @override
   FunctionEntity get checkConcurrentModificationError =>
@@ -1800,10 +1804,6 @@
       _findHelperFunction('getRuntimeTypeInfo');
 
   @override
-  FunctionEntity get getTypeArgumentByIndex =>
-      _findHelperFunction('getTypeArgumentByIndex');
-
-  @override
   FunctionEntity get computeSignature =>
       _findHelperFunction('computeSignature');
 
@@ -1812,14 +1812,6 @@
       _findHelperFunction('getRuntimeTypeArguments');
 
   @override
-  FunctionEntity get getRuntimeTypeArgument =>
-      _findHelperFunction('getRuntimeTypeArgument');
-
-  @override
-  FunctionEntity get getRuntimeTypeArgumentIntercepted =>
-      _findHelperFunction('getRuntimeTypeArgumentIntercepted');
-
-  @override
   FunctionEntity get checkDeferredIsLoaded =>
       _findHelperFunction('checkDeferredIsLoaded');
 
@@ -1890,10 +1882,6 @@
       _findHelperFunction('instantiatedGenericFunctionType');
 
   @override
-  FunctionEntity get extractFunctionTypeObjectFromInternal =>
-      _findHelperFunction('extractFunctionTypeObjectFromInternal');
-
-  @override
   bool isInstantiationClass(ClassEntity cls) {
     return cls.library == _jsHelperLibrary &&
         cls.name != 'Instantiation' &&
diff --git a/pkg/compiler/lib/src/ir/closure.dart b/pkg/compiler/lib/src/ir/closure.dart
index 3546f5c..8d0c0c1 100644
--- a/pkg/compiler/lib/src/ir/closure.dart
+++ b/pkg/compiler/lib/src/ir/closure.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:kernel/ast.dart' as ir;
+import 'package:kernel/src/printer.dart' as ir;
 import 'package:kernel/text/ast_to_text.dart' as ir show debugNodeToString;
 
 /// Collection of scope data collected for a single member.
@@ -420,5 +421,11 @@
       'kind=$kind,typeDeclaration=${typeDeclaration.toStringInternal()}';
 
   @override
+  String toText(ir.AstTextStrategy strategy) => type.toText(strategy);
+
+  @override
+  void toTextInternal(ir.AstPrinter printer) => type.toTextInternal(printer);
+
+  @override
   String leakingDebugToString() => ir.debugNodeToString(this);
 }
diff --git a/pkg/compiler/lib/src/ir/constants.dart b/pkg/compiler/lib/src/ir/constants.dart
index ee22f63..c63a3b4 100644
--- a/pkg/compiler/lib/src/ir/constants.dart
+++ b/pkg/compiler/lib/src/ir/constants.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:kernel/ast.dart' as ir;
+import 'package:kernel/src/printer.dart' as ir;
 import 'package:kernel/type_environment.dart' as ir;
 import 'package:front_end/src/api_prototype/constant_evaluator.dart' as ir;
 import 'package:front_end/src/api_unstable/dart2js.dart' as ir;
@@ -204,4 +205,11 @@
 
   @override
   String toStringInternal() => 'constant=${constant.toStringInternal()}';
+
+  @override
+  String toText(ir.AstTextStrategy strategy) => constant.toText(strategy);
+
+  @override
+  void toTextInternal(ir.AstPrinter printer) =>
+      constant.toTextInternal(printer);
 }
diff --git a/pkg/compiler/lib/src/ir/impact.dart b/pkg/compiler/lib/src/ir/impact.dart
index 6872dc8..c176e35 100644
--- a/pkg/compiler/lib/src/ir/impact.dart
+++ b/pkg/compiler/lib/src/ir/impact.dart
@@ -298,13 +298,11 @@
 
       case ir.AsyncMarker.Async:
         ir.DartType elementType = const ir.DynamicType();
-        if (returnType is ir.InterfaceType) {
-          if (returnType.classNode == typeEnvironment.coreTypes.futureOrClass) {
-            elementType = returnType.typeArguments.first;
-          } else if (returnType.classNode ==
-              typeEnvironment.coreTypes.futureClass) {
-            elementType = returnType.typeArguments.first;
-          }
+        if (returnType is ir.InterfaceType &&
+            returnType.classNode == typeEnvironment.coreTypes.futureClass) {
+          elementType = returnType.typeArguments.first;
+        } else if (returnType is ir.FutureOrType) {
+          elementType = returnType.typeArgument;
         }
         registerAsync(elementType);
         break;
diff --git a/pkg/compiler/lib/src/ir/scope_visitor.dart b/pkg/compiler/lib/src/ir/scope_visitor.dart
index 3be2758..22be758 100644
--- a/pkg/compiler/lib/src/ir/scope_visitor.dart
+++ b/pkg/compiler/lib/src/ir/scope_visitor.dart
@@ -635,6 +635,11 @@
   }
 
   @override
+  InitializerComplexity visitFutureOrType(ir.FutureOrType node) {
+    return visitNode(node.typeArgument);
+  }
+
+  @override
   InitializerComplexity visitFunctionType(ir.FunctionType node) {
     InitializerComplexity complexity = visitNode(node.returnType);
     complexity = complexity.combine(visitNodes(node.positionalParameters));
diff --git a/pkg/compiler/lib/src/ir/static_type.dart b/pkg/compiler/lib/src/ir/static_type.dart
index 7e6ebbf..2d25175 100644
--- a/pkg/compiler/lib/src/ir/static_type.dart
+++ b/pkg/compiler/lib/src/ir/static_type.dart
@@ -742,8 +742,7 @@
     assert(
         node.promotedType == null ||
             promotedType == typeEnvironment.nullType ||
-            promotedType is ir.InterfaceType &&
-                promotedType.classNode == typeEnvironment.futureOrClass ||
+            promotedType is ir.FutureOrType ||
             typeEnvironment.isSubtypeOf(promotedType, node.promotedType,
                 ir.SubtypeCheckMode.ignoringNullabilities),
         "Unexpected promotion of ${node.variable} in ${node.parent}. "
diff --git a/pkg/compiler/lib/src/ir/util.dart b/pkg/compiler/lib/src/ir/util.dart
index 40a8d77..7132491 100644
--- a/pkg/compiler/lib/src/ir/util.dart
+++ b/pkg/compiler/lib/src/ir/util.dart
@@ -205,6 +205,11 @@
   }
 
   @override
+  bool visitFutureOrType(ir.FutureOrType node) {
+    return visit(node.typeArgument);
+  }
+
+  @override
   bool visitBottomType(ir.BottomType node) => false;
 
   @override
diff --git a/pkg/compiler/lib/src/ir/visitors.dart b/pkg/compiler/lib/src/ir/visitors.dart
index 5a65825..6ff419b 100644
--- a/pkg/compiler/lib/src/ir/visitors.dart
+++ b/pkg/compiler/lib/src/ir/visitors.dart
@@ -148,18 +148,19 @@
   @override
   DartType visitInterfaceType(ir.InterfaceType node) {
     ClassEntity cls = elementMap.getClass(node.classNode);
-    if (cls.name == 'FutureOr' &&
-        cls.library == elementMap.commonElements.asyncLibrary) {
-      return _convertNullability(
-          _dartTypes.futureOrType(visitTypes(node.typeArguments).single),
-          node.nullability);
-    }
     return _convertNullability(
         _dartTypes.interfaceType(cls, visitTypes(node.typeArguments)),
         node.nullability);
   }
 
   @override
+  DartType visitFutureOrType(ir.FutureOrType node) {
+    return _convertNullability(
+        _dartTypes.futureOrType(visitType(node.typeArgument)),
+        node.declaredNullability);
+  }
+
+  @override
   DartType visitVoidType(ir.VoidType node) {
     return _dartTypes.voidType();
   }
diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
index f5d5d1d..65ed146 100644
--- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
@@ -98,11 +98,8 @@
   BackendImpact _getRuntimeTypeArgument;
 
   BackendImpact get getRuntimeTypeArgument {
-    return _getRuntimeTypeArgument ??= new BackendImpact(globalUses: [
-      _commonElements.getRuntimeTypeArgumentIntercepted,
-      _commonElements.getRuntimeTypeArgument,
-      _commonElements.getTypeArgumentByIndex,
-    ], otherImpacts: [
+    return _getRuntimeTypeArgument ??=
+        new BackendImpact(globalUses: [], otherImpacts: [
       newRtiImpact,
     ]);
   }
@@ -167,7 +164,6 @@
 
   BackendImpact get typeVariableBoundCheck {
     return _typeVariableBoundCheck ??= new BackendImpact(staticUses: [
-      _commonElements.throwTypeError,
       _commonElements.checkTypeBound,
     ]);
   }
@@ -671,7 +667,6 @@
         globalUses: [
           _commonElements.jsArrayTypedConstructor,
           _commonElements.setRuntimeTypeInfo,
-          _commonElements.getTypeArgumentByIndex
         ]);
   }
 
diff --git a/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart
index 9ed1e17..a0a9e15 100644
--- a/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart
@@ -104,8 +104,8 @@
   ///
   /// ```
   /// $signature:: function() {
-  ///   return H.instantiatedGenericFunctionType(
-  ///       H.extractFunctionTypeObjectFromInternal(this._genericClosure),
+  ///   return H.instantiatedGenericFunctionTypeNewRti(
+  ///       H.closureFunctionType(this._genericClosure),
   ///       this.$ti);
   /// }
   /// ```
diff --git a/pkg/compiler/lib/src/kernel/kernel_impact.dart b/pkg/compiler/lib/src/kernel/kernel_impact.dart
index 1698b28..e4c569a 100644
--- a/pkg/compiler/lib/src/kernel/kernel_impact.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_impact.dart
@@ -137,10 +137,6 @@
   Object _computeReceiverConstraint(
       ir.DartType receiverType, ClassRelation relation) {
     if (receiverType is ir.InterfaceType) {
-      if (receiverType.classNode == typeEnvironment.futureOrClass) {
-        // CFE encodes FutureOr as an interface type!
-        return null;
-      }
       return new StrongModeConstraint(commonElements, _nativeBasicData,
           elementMap.getClass(receiverType.classNode), relation);
     }
diff --git a/pkg/compiler/lib/src/serialization/abstract_source.dart b/pkg/compiler/lib/src/serialization/abstract_source.dart
index a6564cc..6a2fc22 100644
--- a/pkg/compiler/lib/src/serialization/abstract_source.dart
+++ b/pkg/compiler/lib/src/serialization/abstract_source.dart
@@ -272,6 +272,10 @@
         return new ir.TypedefType(typedef, nullability, typeArguments);
       case DartTypeNodeKind.dynamicType:
         return const ir.DynamicType();
+      case DartTypeNodeKind.futureOrType:
+        ir.Nullability nullability = readEnum(ir.Nullability.values);
+        ir.DartType typeArgument = _readDartTypeNode(functionTypeVariables);
+        return new ir.FutureOrType(typeArgument, nullability);
     }
     throw new UnsupportedError("Unexpected DartTypeKind $kind");
   }
diff --git a/pkg/compiler/lib/src/serialization/helpers.dart b/pkg/compiler/lib/src/serialization/helpers.dart
index fee1be6..b2c6d10 100644
--- a/pkg/compiler/lib/src/serialization/helpers.dart
+++ b/pkg/compiler/lib/src/serialization/helpers.dart
@@ -119,6 +119,7 @@
   exactInterfaceType,
   doesNotComplete,
   neverType,
+  futureOrType,
 }
 
 const String functionTypeNodeTag = 'function-type-node';
@@ -195,6 +196,14 @@
   }
 
   @override
+  void visitFutureOrType(
+      ir.FutureOrType node, List<ir.TypeParameter> functionTypeVariables) {
+    _sink.writeEnum(DartTypeNodeKind.futureOrType);
+    _sink.writeEnum(node.declaredNullability);
+    _sink._writeDartTypeNode(node.typeArgument, functionTypeVariables);
+  }
+
+  @override
   void visitFunctionType(
       ir.FunctionType node, List<ir.TypeParameter> functionTypeVariables) {
     _sink.writeEnum(DartTypeNodeKind.functionType);
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index d5b39b7..4cd396f 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -365,8 +365,6 @@
         return false;
       case 'USE_CONTENT_SECURITY_POLICY':
         return options.useContentSecurityPolicy;
-      case 'USE_NEW_RTI':
-        return true;
       case 'VARIANCE':
         return options.enableVariance;
       case 'NNBD':
@@ -3257,7 +3255,8 @@
     if (type is ir.InterfaceType ||
         type is ir.DynamicType ||
         type is ir.TypedefType ||
-        type is ir.FunctionType) {
+        type is ir.FunctionType ||
+        type is ir.FutureOrType) {
       ConstantValue constant =
           _elementMap.getConstantValue(_memberContextNode, node);
       stack.add(graph.addConstant(constant, closedWorld,
@@ -3951,9 +3950,9 @@
     //
     //     r = extractTypeArguments<Map>(e, f)
     // -->
-    //     interceptor = getInterceptor(e);
-    //     T1 = getRuntimeTypeArgumentIntercepted(interceptor, e, 'Map', 0);
-    //     T2 = getRuntimeTypeArgumentIntercepted(interceptor, e, 'Map', 1);
+    //     environment = HInstanceEnvironment(e);
+    //     T1 = HTypeEval( environment, 'Map.K');
+    //     T2 = HTypeEval( environment, 'Map.V');
     //     r = f<T1, T2>();
     //
     // TODO(sra): Should we add a check before the variable extraction? We could
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 73ab2b7..afcc43f 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -2089,7 +2089,7 @@
       _nativeData.registerAllowInterop();
     }
 
-    if (element == _commonElements.checkConcurrentModificationError) {
+    if (_commonElements.isCheckConcurrentModificationError(element)) {
       // Manually inline the [checkConcurrentModificationError] function.  This
       // function is only called from a for-loop update.  Ideally we would just
       // generate the conditionalcontrol flow in the builder but it adds basic
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 3dbabb7..f075382 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -1606,7 +1606,7 @@
       if (node.inputs.length == 2) {
         return handleArrayTypeInfo(node);
       }
-    } else if (element == commonElements.checkConcurrentModificationError) {
+    } else if (commonElements.isCheckConcurrentModificationError(element)) {
       if (node.inputs.length == 2) {
         HInstruction firstArgument = node.inputs[0];
         if (firstArgument is HConstant) {
@@ -1679,7 +1679,7 @@
       if (user is HInterceptor) continue;
       if (user is HInvokeStatic) {
         MemberEntity element = user.element;
-        if (element == commonElements.checkConcurrentModificationError) {
+        if (commonElements.isCheckConcurrentModificationError(element)) {
           // CME check escapes the array, but we don't care.
           continue;
         }
@@ -3729,8 +3729,8 @@
         if (user is HIdentity && user.usedBy.length == 1) {
           HInstruction user2 = user.usedBy.single;
           if (user2 is HInvokeStatic &&
-              user2.element ==
-                  closedWorld.commonElements.checkConcurrentModificationError) {
+              closedWorld.commonElements
+                  .isCheckConcurrentModificationError(user2.element)) {
             return null;
           }
         }
@@ -3791,9 +3791,8 @@
             }
           }
           if (use is HInvokeStatic) {
-            if (use.element ==
-                closedWorld.commonElements.checkConcurrentModificationError)
-              return true;
+            if (closedWorld.commonElements
+                .isCheckConcurrentModificationError(use.element)) return true;
           }
 
           return false;
diff --git a/pkg/compiler/test/analyses/analysis_helper.dart b/pkg/compiler/test/analyses/analysis_helper.dart
index ba0e1f5..90a11a2 100644
--- a/pkg/compiler/test/analyses/analysis_helper.dart
+++ b/pkg/compiler/test/analyses/analysis_helper.dart
@@ -310,8 +310,7 @@
     assert(
         node is! ir.Expression ||
             staticType == typeEnvironment.nullType ||
-            staticType is ir.InterfaceType &&
-                staticType.classNode == typeEnvironment.futureOrClass ||
+            staticType is ir.FutureOrType ||
             typeEnvironment.isSubtypeOf(
                 staticType,
                 _getStaticTypeFromExpression(node),
diff --git a/pkg/compiler/test/helpers/ir_types.dart b/pkg/compiler/test/helpers/ir_types.dart
index a777fab..e5cbaa3 100644
--- a/pkg/compiler/test/helpers/ir_types.dart
+++ b/pkg/compiler/test/helpers/ir_types.dart
@@ -102,6 +102,13 @@
   }
 
   @override
+  void visitFutureOrType(ir.FutureOrType node, StringBuffer sb) {
+    sb.write('FutureOr<');
+    writeType(node.typeArgument, sb);
+    sb.write('>');
+  }
+
+  @override
   void visitBottomType(ir.BottomType node, StringBuffer sb) {
     sb.write('<bottom>');
   }
diff --git a/pkg/compiler/test/helpers/memory_compiler.dart b/pkg/compiler/test/helpers/memory_compiler.dart
index b6dbd63..e688d5b 100644
--- a/pkg/compiler/test/helpers/memory_compiler.dart
+++ b/pkg/compiler/test/helpers/memory_compiler.dart
@@ -29,7 +29,7 @@
 bool isDart2jsNnbd =
     !Platform.environment['DART_CONFIGURATION'].endsWith('Legacy');
 
-String sdkPath = isDart2jsNnbd ? 'sdk_nnbd/lib' : 'sdk/lib';
+String sdkPath = 'sdk/lib';
 
 String sdkLibrariesSpecificationPath = '$sdkPath/libraries.json';
 
diff --git a/pkg/compiler/test/impact/data/classes.dart b/pkg/compiler/test/impact/data/classes.dart
index 9261709..067ac76 100644
--- a/pkg/compiler/test/impact/data/classes.dart
+++ b/pkg/compiler/test/impact/data/classes.dart
@@ -269,10 +269,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -322,10 +319,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -344,7 +338,12 @@
 class ForwardingConstructorGenericClass<
     S> = ForwardingConstructorGenericSuperClass<S> with EmptyMixin;
 
-/*member: testForwardingConstructorGeneric:static=[ForwardingConstructorGenericClass.(1),checkTypeBound(4),throwTypeError(1)],type=[inst:JSNull]*/
+/*member: testForwardingConstructorGeneric:
+ static=[
+  ForwardingConstructorGenericClass.(1),
+  checkTypeBound(4)],
+ type=[inst:JSNull]
+*/
 testForwardingConstructorGeneric() {
   new ForwardingConstructorGenericClass<int>(null);
 }
@@ -400,10 +399,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -454,10 +450,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -475,8 +468,8 @@
 List<T> staticGenericMethod<T>(T arg) => [arg];
 
 /*spec:nnbd-off.member: testStaticGenericMethod:
-  static=[staticGenericMethod<bool>(1)],
-  type=[inst:JSBool]
+ static=[staticGenericMethod<bool>(1)],
+ type=[inst:JSBool]
 */
 /*spec:nnbd-sdk.member: testStaticGenericMethod:
  static=[staticGenericMethod<bool*>(1)],
@@ -486,13 +479,18 @@
   staticGenericMethod<bool>(true);
 }
 
-/*spec:nnbd-off.member: testInstanceGenericMethod:dynamic=[exact:GenericClass.genericMethod<bool>(1)],static=[GenericClass.generative(0),checkTypeBound(4),throwTypeError(1)],type=[inst:JSBool]*/
+/*spec:nnbd-off.member: testInstanceGenericMethod:
+ dynamic=[exact:GenericClass.genericMethod<bool>(1)],
+ static=[
+  GenericClass.generative(0),
+  checkTypeBound(4)],
+ type=[inst:JSBool]
+*/
 /*spec:nnbd-sdk.member: testInstanceGenericMethod:
  dynamic=[exact:GenericClass.genericMethod<bool*>(1)],
  static=[
   GenericClass.generative(0),
-  checkTypeBound(4),
-  throwTypeError(1)],
+  checkTypeBound(4)],
  type=[inst:JSBool]
 */
 testInstanceGenericMethod() {
@@ -516,10 +514,14 @@
 /*member: testNamedMixinInstantiation:static=[NamedMixin.(0)]*/
 testNamedMixinInstantiation() => new NamedMixin();
 
-/*member: testGenericMixinInstantiation:static=[GenericSub.(0),checkTypeBound(4),throwTypeError(1)]*/
+/*member: testGenericMixinInstantiation:static=[
+  GenericSub.(0),
+  checkTypeBound(4)]*/
 testGenericMixinInstantiation() => new GenericSub<int, String>();
 
-/*member: testGenericNamedMixinInstantiation:static=[GenericNamedMixin.(0),checkTypeBound(4),throwTypeError(1)]*/
+/*member: testGenericNamedMixinInstantiation:static=[
+  GenericNamedMixin.(0),
+  checkTypeBound(4)]*/
 testGenericNamedMixinInstantiation() => new GenericNamedMixin<int, String>();
 
 class Class {
@@ -563,10 +565,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -618,10 +617,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
diff --git a/pkg/compiler/test/impact/data/constants/lib.dart b/pkg/compiler/test/impact/data/constants/lib.dart
index b3b226f..6f53ca7 100644
--- a/pkg/compiler/test/impact/data/constants/lib.dart
+++ b/pkg/compiler/test/impact/data/constants/lib.dart
@@ -77,10 +77,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -130,10 +127,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
diff --git a/pkg/compiler/test/impact/data/constants/main.dart b/pkg/compiler/test/impact/data/constants/main.dart
index 3a80aee..23b811d 100644
--- a/pkg/compiler/test/impact/data/constants/main.dart
+++ b/pkg/compiler/test/impact/data/constants/main.dart
@@ -91,7 +91,9 @@
 /*member: symbolLiteral:static=[Symbol.(1)],type=[inst:Symbol]*/
 symbolLiteral() => #foo;
 
-/*spec:nnbd-off.member: listLiteral:type=[inst:JSBool,inst:List<bool>]*/
+/*spec:nnbd-off.member: listLiteral:type=[
+  inst:JSBool,
+  inst:List<bool>]*/
 /*spec:nnbd-sdk.member: listLiteral:type=[
   inst:JSBool,
   inst:List<bool*>]*/
@@ -112,7 +114,15 @@
 */
 instanceConstant() => const Class(true, false);
 
-/*spec:nnbd-off.member: typeLiteral:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String]*/
+/*spec:nnbd-off.member: typeLiteral:
+ static=[
+  createRuntimeType(1),
+  typeLiteral(1)],
+ type=[
+  inst:Type,
+  inst:_Type,
+  lit:String]
+*/
 /*spec:nnbd-sdk.member: typeLiteral:
  static=[
   createRuntimeType(1),
@@ -163,7 +173,9 @@
 /*member: symbolLiteralRef:static=[Symbol.(1)],type=[inst:Symbol]*/
 symbolLiteralRef() => symbolLiteralField;
 
-/*spec:nnbd-off.member: listLiteralRef:type=[inst:JSBool,inst:List<bool>]*/
+/*spec:nnbd-off.member: listLiteralRef:type=[
+  inst:JSBool,
+  inst:List<bool>]*/
 /*spec:nnbd-sdk.member: listLiteralRef:type=[
   inst:JSBool,
   inst:List<bool*>]*/
@@ -184,7 +196,15 @@
 */
 instanceConstantRef() => instanceConstantField;
 
-/*spec:nnbd-off.member: typeLiteralRef:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String]*/
+/*spec:nnbd-off.member: typeLiteralRef:
+ static=[
+  createRuntimeType(1),
+  typeLiteral(1)],
+ type=[
+  inst:Type,
+  inst:_Type,
+  lit:String]
+*/
 /*spec:nnbd-sdk.member: typeLiteralRef:
  static=[
   createRuntimeType(1),
@@ -225,7 +245,9 @@
 symbolLiteralDeferred() => defer.symbolLiteralField;
 
 // TODO(johnniwinther): Should we record that this is deferred?
-/*spec:nnbd-off.member: listLiteralDeferred:type=[inst:JSBool,inst:List<bool>]*/
+/*spec:nnbd-off.member: listLiteralDeferred:type=[
+  inst:JSBool,
+  inst:List<bool>]*/
 /*spec:nnbd-sdk.member: listLiteralDeferred:type=[
   inst:JSBool,
   inst:List<bool*>]*/
@@ -249,7 +271,15 @@
 */
 instanceConstantDeferred() => defer.instanceConstantField;
 
-/*spec:nnbd-off.member: typeLiteralDeferred:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String{defer}]*/
+/*spec:nnbd-off.member: typeLiteralDeferred:
+ static=[
+  createRuntimeType(1),
+  typeLiteral(1)],
+ type=[
+  inst:Type,
+  inst:_Type,
+  lit:String{defer}]
+*/
 /*spec:nnbd-sdk.member: typeLiteralDeferred:
  static=[
   createRuntimeType(1),
diff --git a/pkg/compiler/test/impact/data/constructors.dart b/pkg/compiler/test/impact/data/constructors.dart
index cba8812..d627d72 100644
--- a/pkg/compiler/test/impact/data/constructors.dart
+++ b/pkg/compiler/test/impact/data/constructors.dart
@@ -51,7 +51,9 @@
   new Class.generative();
 }
 
-/*member: testConstructorInvokeGeneric:static=[GenericClass.generative(0),checkTypeBound(4),throwTypeError(1)]*/
+/*member: testConstructorInvokeGeneric:static=[
+  GenericClass.generative(0),
+  checkTypeBound(4)]*/
 testConstructorInvokeGeneric() {
   new GenericClass<int, String>.generative();
 }
@@ -71,7 +73,9 @@
   new Class.fact();
 }
 
-/*member: testFactoryInvokeGeneric:static=[GenericClass.fact(0),checkTypeBound(4),throwTypeError(1)]*/
+/*member: testFactoryInvokeGeneric:static=[
+  GenericClass.fact(0),
+  checkTypeBound(4)]*/
 testFactoryInvokeGeneric() {
   new GenericClass<int, String>.fact();
 }
@@ -91,7 +95,9 @@
   new Class.redirect();
 }
 
-/*member: testRedirectingFactoryInvokeGeneric:static=[GenericClass.generative(0),checkTypeBound(4),throwTypeError(1)]*/
+/*member: testRedirectingFactoryInvokeGeneric:static=[
+  GenericClass.generative(0),
+  checkTypeBound(4)]*/
 testRedirectingFactoryInvokeGeneric() {
   new GenericClass<int, String>.redirect();
 }
diff --git a/pkg/compiler/test/impact/data/expressions.dart b/pkg/compiler/test/impact/data/expressions.dart
index c5c9e6d..e4ee98b 100644
--- a/pkg/compiler/test/impact/data/expressions.dart
+++ b/pkg/compiler/test/impact/data/expressions.dart
@@ -225,10 +225,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -278,10 +275,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -585,10 +579,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -638,10 +629,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -860,10 +848,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -913,10 +898,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -965,10 +947,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1018,10 +997,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1070,10 +1046,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1123,10 +1096,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1175,10 +1145,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1228,10 +1195,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1280,10 +1244,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1333,10 +1294,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1471,10 +1429,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2),
   throwRuntimeError(1)],
@@ -1524,10 +1479,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2),
   throwRuntimeError(1)],
diff --git a/pkg/compiler/test/impact/data/extract_type_arguments.dart b/pkg/compiler/test/impact/data/extract_type_arguments.dart
index 510414b..ad21686 100644
--- a/pkg/compiler/test/impact/data/extract_type_arguments.dart
+++ b/pkg/compiler/test/impact/data/extract_type_arguments.dart
@@ -49,10 +49,7 @@
   _isTop(1),
   extractTypeArguments<A<dynamic>>(2),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -105,10 +102,7 @@
   _isTop(1),
   extractTypeArguments<A<dynamic>*>(2),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -160,10 +154,7 @@
   _isTop(1),
   extractTypeArguments<B<dynamic,dynamic>>(2),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -216,10 +207,7 @@
   _isTop(1),
   extractTypeArguments<B<dynamic,dynamic>*>(2),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
diff --git a/pkg/compiler/test/impact/data/future_or.dart b/pkg/compiler/test/impact/data/future_or.dart
index 0e51f38..9b6cf6b 100644
--- a/pkg/compiler/test/impact/data/future_or.dart
+++ b/pkg/compiler/test/impact/data/future_or.dart
@@ -6,15 +6,28 @@
 
 import "dart:async";
 
-/*spec:nnbd-off.member: main:dynamic=[runtimeType],runtimeType=[unknown:FutureOr<int>],static=[Future.value(1),checkTypeBound(4),print(1),throwTypeError(1)],type=[inst:JSDouble,inst:JSInt,inst:JSNumber,inst:JSPositiveInt,inst:JSUInt31,inst:JSUInt32]*/
+/*spec:nnbd-off.member: main:
+ dynamic=[runtimeType],
+ runtimeType=[unknown:FutureOr<int>],
+ static=[
+  Future.value(1),
+  checkTypeBound(4),
+  print(1)],
+ type=[
+  inst:JSDouble,
+  inst:JSInt,
+  inst:JSNumber,
+  inst:JSPositiveInt,
+  inst:JSUInt31,
+  inst:JSUInt32]
+*/
 /*spec:nnbd-sdk.member: main:
  dynamic=[runtimeType],
  runtimeType=[unknown:FutureOr<int*>*],
  static=[
   Future.value(1),
   checkTypeBound(4),
-  print(1),
-  throwTypeError(1)],
+  print(1)],
  type=[
   inst:JSDouble,
   inst:JSInt,
diff --git a/pkg/compiler/test/impact/data/initializers.dart b/pkg/compiler/test/impact/data/initializers.dart
index 1fe3d3a..79bbcee 100644
--- a/pkg/compiler/test/impact/data/initializers.dart
+++ b/pkg/compiler/test/impact/data/initializers.dart
@@ -478,10 +478,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -531,10 +528,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -550,5 +544,16 @@
   ClassGeneric(T arg);
 }
 
-/*member: testGenericClass:static=[ClassGeneric.(1),checkTypeBound(4),throwTypeError(1)],type=[inst:JSDouble,inst:JSInt,inst:JSNumber,inst:JSPositiveInt,inst:JSUInt31,inst:JSUInt32]*/
+/*member: testGenericClass:
+ static=[
+  ClassGeneric.(1),
+  checkTypeBound(4)],
+ type=[
+  inst:JSDouble,
+  inst:JSInt,
+  inst:JSNumber,
+  inst:JSPositiveInt,
+  inst:JSUInt31,
+  inst:JSUInt32]
+*/
 testGenericClass() => new ClassGeneric<int>(0);
diff --git a/pkg/compiler/test/impact/data/injected_cast.dart b/pkg/compiler/test/impact/data/injected_cast.dart
index 1a4863b..8a24d2c 100644
--- a/pkg/compiler/test/impact/data/injected_cast.dart
+++ b/pkg/compiler/test/impact/data/injected_cast.dart
@@ -195,9 +195,52 @@
 /*member: Class2.:static=[Object.(0)]*/
 class Class2<T> {
   /*spec:nnbd-off.member: Class2.field2:
-   static=%,
-   type=[inst:%,param:Class2.T]
-   */
+   static=[
+    Rti._bind(1),
+    Rti._eval(1),
+    _arrayInstanceType(1),
+    _asBool(1),
+    _asBoolQ(1),
+    _asBoolS(1),
+    _asDouble(1),
+    _asDoubleQ(1),
+    _asDoubleS(1),
+    _asInt(1),
+    _asIntQ(1),
+    _asIntS(1),
+    _asNum(1),
+    _asNumQ(1),
+    _asNumS(1),
+    _asObject(1),
+    _asString(1),
+    _asStringQ(1),
+    _asStringS(1),
+    _asTop(1),
+    _generalAsCheckImplementation(1),
+    _generalIsTestImplementation(1),
+    _installSpecializedIsTest(1),
+    _instanceType(1),
+    _isBool(1),
+    _isInt(1),
+    _isNum(1),
+    _isObject(1),
+    _isString(1),
+    _isTop(1),
+    findType(1),
+    getRuntimeTypeInfo(1),
+    instanceType(1),
+    setRuntimeTypeInfo(2)],
+   type=[
+    inst:Closure,
+    inst:JSArray<dynamic>,
+    inst:JSBool,
+    inst:JSExtendableArray<dynamic>,
+    inst:JSFixedArray<dynamic>,
+    inst:JSMutableArray<dynamic>,
+    inst:JSNull,
+    inst:JSUnmodifiableArray<dynamic>,
+    param:Class2.T]
+  */
   /*spec:nnbd-sdk.member: Class2.field2:
    static=[
     Rti._bind(1),
@@ -234,10 +277,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -256,10 +296,50 @@
 
 /*spec:nnbd-off.member: method2:
  dynamic=[Class2.field2=],
- static=%,
+ static=[
+  Rti._bind(1),
+  Rti._eval(1),
+  _arrayInstanceType(1),
+  _asBool(1),
+  _asBoolQ(1),
+  _asBoolS(1),
+  _asDouble(1),
+  _asDoubleQ(1),
+  _asDoubleS(1),
+  _asInt(1),
+  _asIntQ(1),
+  _asIntS(1),
+  _asNum(1),
+  _asNumQ(1),
+  _asNumS(1),
+  _asObject(1),
+  _asString(1),
+  _asStringQ(1),
+  _asStringS(1),
+  _asTop(1),
+  _generalAsCheckImplementation(1),
+  _generalIsTestImplementation(1),
+  _installSpecializedIsTest(1),
+  _instanceType(1),
+  _isBool(1),
+  _isInt(1),
+  _isNum(1),
+  _isObject(1),
+  _isString(1),
+  _isTop(1),
+  findType(1),
+  getRuntimeTypeInfo(1),
+  instanceType(1),
+  setRuntimeTypeInfo(2)],
  type=[
   impl:A,
-  inst:%,
+  inst:Closure,
+  inst:JSArray<dynamic>,
+  inst:JSBool,
+  inst:JSExtendableArray<dynamic>,
+  inst:JSFixedArray<dynamic>,
+  inst:JSMutableArray<dynamic>,
+  inst:JSUnmodifiableArray<dynamic>,
   is:Class2<A>]
 */
 /*spec:nnbd-sdk.member: method2:
@@ -299,10 +379,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -696,9 +773,50 @@
 /*member: Class5.:static=[Object.(0)]*/
 class Class5<T1, T2> {
   /*spec:nnbd-off.member: Class5.method5:
-   static=%,
+   static=[
+    Rti._bind(1),
+    Rti._eval(1),
+    _arrayInstanceType(1),
+    _asBool(1),
+    _asBoolQ(1),
+    _asBoolS(1),
+    _asDouble(1),
+    _asDoubleQ(1),
+    _asDoubleS(1),
+    _asInt(1),
+    _asIntQ(1),
+    _asIntS(1),
+    _asNum(1),
+    _asNumQ(1),
+    _asNumS(1),
+    _asObject(1),
+    _asString(1),
+    _asStringQ(1),
+    _asStringS(1),
+    _asTop(1),
+    _generalAsCheckImplementation(1),
+    _generalIsTestImplementation(1),
+    _installSpecializedIsTest(1),
+    _instanceType(1),
+    _isBool(1),
+    _isInt(1),
+    _isNum(1),
+    _isObject(1),
+    _isString(1),
+    _isTop(1),
+    findType(1),
+    getRuntimeTypeInfo(1),
+    instanceType(1),
+    setRuntimeTypeInfo(2)],
    type=[
-    inst:%,
+    inst:Closure,
+    inst:JSArray<dynamic>,
+    inst:JSBool,
+    inst:JSExtendableArray<dynamic>,
+    inst:JSFixedArray<dynamic>,
+    inst:JSMutableArray<dynamic>,
+    inst:JSNull,
+    inst:JSUnmodifiableArray<dynamic>,
     param:C,
     param:Class5.T1,
     param:Class5.T2,
@@ -742,10 +860,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -769,11 +884,51 @@
 
 /*spec:nnbd-off.member: method5:
  dynamic=[Class5.method5<D,E>(5)],
- static=%,
+ static=[
+  Rti._bind(1),
+  Rti._eval(1),
+  _arrayInstanceType(1),
+  _asBool(1),
+  _asBoolQ(1),
+  _asBoolS(1),
+  _asDouble(1),
+  _asDoubleQ(1),
+  _asDoubleS(1),
+  _asInt(1),
+  _asIntQ(1),
+  _asIntS(1),
+  _asNum(1),
+  _asNumQ(1),
+  _asNumS(1),
+  _asObject(1),
+  _asString(1),
+  _asStringQ(1),
+  _asStringS(1),
+  _asTop(1),
+  _generalAsCheckImplementation(1),
+  _generalIsTestImplementation(1),
+  _installSpecializedIsTest(1),
+  _instanceType(1),
+  _isBool(1),
+  _isInt(1),
+  _isNum(1),
+  _isObject(1),
+  _isString(1),
+  _isTop(1),
+  findType(1),
+  getRuntimeTypeInfo(1),
+  instanceType(1),
+  setRuntimeTypeInfo(2)],
  type=[
   impl:A,
   impl:D,
-  inst:%,
+  inst:Closure,
+  inst:JSArray<dynamic>,
+  inst:JSBool,
+  inst:JSExtendableArray<dynamic>,
+  inst:JSFixedArray<dynamic>,
+  inst:JSMutableArray<dynamic>,
+  inst:JSUnmodifiableArray<dynamic>,
   is:Class5<A,B>,
   param:B,
   param:C,
@@ -816,10 +971,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -845,9 +997,50 @@
 /*member: Class6.:static=[Object.(0)]*/
 class Class6<T1, T2> {
   /*spec:nnbd-off.member: Class6.method6:
-   static=%,
+   static=[
+    Rti._bind(1),
+    Rti._eval(1),
+    _arrayInstanceType(1),
+    _asBool(1),
+    _asBoolQ(1),
+    _asBoolS(1),
+    _asDouble(1),
+    _asDoubleQ(1),
+    _asDoubleS(1),
+    _asInt(1),
+    _asIntQ(1),
+    _asIntS(1),
+    _asNum(1),
+    _asNumQ(1),
+    _asNumS(1),
+    _asObject(1),
+    _asString(1),
+    _asStringQ(1),
+    _asStringS(1),
+    _asTop(1),
+    _generalAsCheckImplementation(1),
+    _generalIsTestImplementation(1),
+    _installSpecializedIsTest(1),
+    _instanceType(1),
+    _isBool(1),
+    _isInt(1),
+    _isNum(1),
+    _isObject(1),
+    _isString(1),
+    _isTop(1),
+    findType(1),
+    getRuntimeTypeInfo(1),
+    instanceType(1),
+    setRuntimeTypeInfo(2)],
    type=[
-    inst:%,
+    inst:Closure,
+    inst:JSArray<dynamic>,
+    inst:JSBool,
+    inst:JSExtendableArray<dynamic>,
+    inst:JSFixedArray<dynamic>,
+    inst:JSMutableArray<dynamic>,
+    inst:JSNull,
+    inst:JSUnmodifiableArray<dynamic>,
     param:C,
     param:Class6.T1,
     param:Class6.T2,
@@ -891,10 +1084,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -918,11 +1108,51 @@
 
 /*spec:nnbd-off.member: method6:
  dynamic=[Class6.method6<D,E>(1,b,c,d,e)],
- static=%,
+ static=[
+  Rti._bind(1),
+  Rti._eval(1),
+  _arrayInstanceType(1),
+  _asBool(1),
+  _asBoolQ(1),
+  _asBoolS(1),
+  _asDouble(1),
+  _asDoubleQ(1),
+  _asDoubleS(1),
+  _asInt(1),
+  _asIntQ(1),
+  _asIntS(1),
+  _asNum(1),
+  _asNumQ(1),
+  _asNumS(1),
+  _asObject(1),
+  _asString(1),
+  _asStringQ(1),
+  _asStringS(1),
+  _asTop(1),
+  _generalAsCheckImplementation(1),
+  _generalIsTestImplementation(1),
+  _installSpecializedIsTest(1),
+  _instanceType(1),
+  _isBool(1),
+  _isInt(1),
+  _isNum(1),
+  _isObject(1),
+  _isString(1),
+  _isTop(1),
+  findType(1),
+  getRuntimeTypeInfo(1),
+  instanceType(1),
+  setRuntimeTypeInfo(2)],
  type=[
   impl:A,
   impl:D,
-  inst:%,
+  inst:Closure,
+  inst:JSArray<dynamic>,
+  inst:JSBool,
+  inst:JSExtendableArray<dynamic>,
+  inst:JSFixedArray<dynamic>,
+  inst:JSMutableArray<dynamic>,
+  inst:JSUnmodifiableArray<dynamic>,
   is:Class6<A,B>,
   param:B,
   param:C,
@@ -965,10 +1195,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1093,7 +1320,53 @@
 
 /*member: F.:static=[Object.(0)]*/
 class F<T> {
-  /*spec:nnbd-off.member: F.method:static=%,type=[inst:%,param:List<F.T>]*/
+  /*spec:nnbd-off.member: F.method:
+   static=[
+    Rti._bind(1),
+    Rti._eval(1),
+    _arrayInstanceType(1),
+    _asBool(1),
+    _asBoolQ(1),
+    _asBoolS(1),
+    _asDouble(1),
+    _asDoubleQ(1),
+    _asDoubleS(1),
+    _asInt(1),
+    _asIntQ(1),
+    _asIntS(1),
+    _asNum(1),
+    _asNumQ(1),
+    _asNumS(1),
+    _asObject(1),
+    _asString(1),
+    _asStringQ(1),
+    _asStringS(1),
+    _asTop(1),
+    _generalAsCheckImplementation(1),
+    _generalIsTestImplementation(1),
+    _installSpecializedIsTest(1),
+    _instanceType(1),
+    _isBool(1),
+    _isInt(1),
+    _isNum(1),
+    _isObject(1),
+    _isString(1),
+    _isTop(1),
+    findType(1),
+    getRuntimeTypeInfo(1),
+    instanceType(1),
+    setRuntimeTypeInfo(2)],
+   type=[
+    inst:Closure,
+    inst:JSArray<dynamic>,
+    inst:JSBool,
+    inst:JSExtendableArray<dynamic>,
+    inst:JSFixedArray<dynamic>,
+    inst:JSMutableArray<dynamic>,
+    inst:JSNull,
+    inst:JSUnmodifiableArray<dynamic>,
+    param:List<F.T>]
+  */
   /*spec:nnbd-sdk.member: F.method:
    static=[
     Rti._bind(1),
@@ -1130,10 +1403,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -1149,7 +1419,53 @@
   */
   T method(List<T> list) => null;
 
-  /*spec:nnbd-off.member: F.field:static=%,type=[inst:%,param:F.T]*/
+  /*spec:nnbd-off.member: F.field:
+   static=[
+    Rti._bind(1),
+    Rti._eval(1),
+    _arrayInstanceType(1),
+    _asBool(1),
+    _asBoolQ(1),
+    _asBoolS(1),
+    _asDouble(1),
+    _asDoubleQ(1),
+    _asDoubleS(1),
+    _asInt(1),
+    _asIntQ(1),
+    _asIntS(1),
+    _asNum(1),
+    _asNumQ(1),
+    _asNumS(1),
+    _asObject(1),
+    _asString(1),
+    _asStringQ(1),
+    _asStringS(1),
+    _asTop(1),
+    _generalAsCheckImplementation(1),
+    _generalIsTestImplementation(1),
+    _installSpecializedIsTest(1),
+    _instanceType(1),
+    _isBool(1),
+    _isInt(1),
+    _isNum(1),
+    _isObject(1),
+    _isString(1),
+    _isTop(1),
+    findType(1),
+    getRuntimeTypeInfo(1),
+    instanceType(1),
+    setRuntimeTypeInfo(2)],
+   type=[
+    inst:Closure,
+    inst:JSArray<dynamic>,
+    inst:JSBool,
+    inst:JSExtendableArray<dynamic>,
+    inst:JSFixedArray<dynamic>,
+    inst:JSMutableArray<dynamic>,
+    inst:JSNull,
+    inst:JSUnmodifiableArray<dynamic>,
+    param:F.T]
+  */
   /*spec:nnbd-sdk.member: F.field:
    static=[
     Rti._bind(1),
@@ -1186,10 +1502,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -1211,8 +1524,53 @@
 
 /*spec:nnbd-off.member: method8:
  dynamic=[G.method(1)],
- static=%,
- type=[impl:List<int>,inst:%,is:G,param:Iterable<int>]
+ static=[
+  Rti._bind(1),
+  Rti._eval(1),
+  _arrayInstanceType(1),
+  _asBool(1),
+  _asBoolQ(1),
+  _asBoolS(1),
+  _asDouble(1),
+  _asDoubleQ(1),
+  _asDoubleS(1),
+  _asInt(1),
+  _asIntQ(1),
+  _asIntS(1),
+  _asNum(1),
+  _asNumQ(1),
+  _asNumS(1),
+  _asObject(1),
+  _asString(1),
+  _asStringQ(1),
+  _asStringS(1),
+  _asTop(1),
+  _generalAsCheckImplementation(1),
+  _generalIsTestImplementation(1),
+  _installSpecializedIsTest(1),
+  _instanceType(1),
+  _isBool(1),
+  _isInt(1),
+  _isNum(1),
+  _isObject(1),
+  _isString(1),
+  _isTop(1),
+  findType(1),
+  getRuntimeTypeInfo(1),
+  instanceType(1),
+  setRuntimeTypeInfo(2)],
+ type=[
+  impl:List<int>,
+  inst:Closure,
+  inst:JSArray<dynamic>,
+  inst:JSBool,
+  inst:JSExtendableArray<dynamic>,
+  inst:JSFixedArray<dynamic>,
+  inst:JSMutableArray<dynamic>,
+  inst:JSNull,
+  inst:JSUnmodifiableArray<dynamic>,
+  is:G,
+  param:Iterable<int>]
 */
 /*spec:nnbd-sdk.member: method8:
  dynamic=[G.method(1)],
@@ -1251,10 +1609,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
diff --git a/pkg/compiler/test/impact/data/invokes.dart b/pkg/compiler/test/impact/data/invokes.dart
index 113213f..e2ab209 100644
--- a/pkg/compiler/test/impact/data/invokes.dart
+++ b/pkg/compiler/test/impact/data/invokes.dart
@@ -322,10 +322,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -377,10 +374,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -493,10 +487,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -545,10 +536,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -596,10 +584,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -648,10 +633,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -699,10 +681,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -751,10 +730,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -802,10 +778,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -854,10 +827,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1314,10 +1284,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1367,10 +1334,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
diff --git a/pkg/compiler/test/impact/data/jsinterop.dart b/pkg/compiler/test/impact/data/jsinterop.dart
index 260af92..2068a85 100644
--- a/pkg/compiler/test/impact/data/jsinterop.dart
+++ b/pkg/compiler/test/impact/data/jsinterop.dart
@@ -94,10 +94,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
@@ -147,10 +144,7 @@
     _isString(1),
     _isTop(1),
     findType(1),
-    getRuntimeTypeArgument(3),
-    getRuntimeTypeArgumentIntercepted(4),
     getRuntimeTypeInfo(1),
-    getTypeArgumentByIndex(2),
     instanceType(1),
     setRuntimeTypeInfo(2)],
    type=[
diff --git a/pkg/compiler/test/impact/data/jsinterop_setter1.dart b/pkg/compiler/test/impact/data/jsinterop_setter1.dart
index d0dfa5c..48c7426 100644
--- a/pkg/compiler/test/impact/data/jsinterop_setter1.dart
+++ b/pkg/compiler/test/impact/data/jsinterop_setter1.dart
@@ -221,12 +221,10 @@
   print(file.name);
 }
 
-/*spec:nnbd-off.member: main:
- static=[
- _doStuff,
- allowInterop<Function>(1),
- set:foo]
-*/
+/*spec:nnbd-off.member: main:static=[
+  _doStuff,
+  allowInterop<Function>(1),
+  set:foo]*/
 /*spec:nnbd-sdk.member: main:static=[
   _doStuff,
   allowInterop<Function*>(1),
diff --git a/pkg/compiler/test/impact/data/jsinterop_setter2.dart b/pkg/compiler/test/impact/data/jsinterop_setter2.dart
index f5df446..f334e80 100644
--- a/pkg/compiler/test/impact/data/jsinterop_setter2.dart
+++ b/pkg/compiler/test/impact/data/jsinterop_setter2.dart
@@ -44,10 +44,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -108,10 +105,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -243,12 +237,10 @@
   print(file.name);
 }
 
-/*spec:nnbd-off.member: main:
- static=[
+/*spec:nnbd-off.member: main:static=[
   _doStuff,
   allowInterop<void Function(String,File)>(1),
-  set:foo]
-*/
+  set:foo]*/
 /*spec:nnbd-sdk.member: main:static=[
   _doStuff,
   allowInterop<void Function(String*,File*)*>(1),
diff --git a/pkg/compiler/test/impact/data/literals.dart b/pkg/compiler/test/impact/data/literals.dart
index 9c0bcfa..61b7aa1 100644
--- a/pkg/compiler/test/impact/data/literals.dart
+++ b/pkg/compiler/test/impact/data/literals.dart
@@ -131,7 +131,15 @@
 /*member: testIfNullConstSymbol:static=[Symbol.(1)],type=[inst:Symbol]*/
 testIfNullConstSymbol() => const Symbol(null ?? 'foo');
 
-/*spec:nnbd-off.member: testTypeLiteral:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:Object]*/
+/*spec:nnbd-off.member: testTypeLiteral:
+ static=[
+  createRuntimeType(1),
+  typeLiteral(1)],
+ type=[
+  inst:Type,
+  inst:_Type,
+  lit:Object]
+*/
 /*spec:nnbd-sdk.member: testTypeLiteral:
  static=[
   createRuntimeType(1),
@@ -159,7 +167,9 @@
 /*member: testEmptyListLiteralConstant:type=[inst:List<dynamic>]*/
 testEmptyListLiteralConstant() => const [];
 
-/*spec:nnbd-off.member: testNonEmptyListLiteral:type=[inst:JSBool,inst:List<bool>]*/
+/*spec:nnbd-off.member: testNonEmptyListLiteral:type=[
+  inst:JSBool,
+  inst:List<bool>]*/
 /*spec:nnbd-sdk.member: testNonEmptyListLiteral:type=[
   inst:JSBool,
   inst:List<bool*>]*/
@@ -184,7 +194,10 @@
 */
 testEmptyMapLiteralConstant() => const {};
 
-/*spec:nnbd-off.member: testNonEmptyMapLiteral:type=[inst:JSBool,inst:JSNull,inst:Map<Null,bool>]*/
+/*spec:nnbd-off.member: testNonEmptyMapLiteral:type=[
+  inst:JSBool,
+  inst:JSNull,
+  inst:Map<Null,bool>]*/
 /*spec:nnbd-sdk.member: testNonEmptyMapLiteral:type=[
   inst:JSBool,
   inst:JSNull,
diff --git a/pkg/compiler/test/impact/data/runtime_type.dart b/pkg/compiler/test/impact/data/runtime_type.dart
index b61973e..71cf1bc 100644
--- a/pkg/compiler/test/impact/data/runtime_type.dart
+++ b/pkg/compiler/test/impact/data/runtime_type.dart
@@ -7,7 +7,10 @@
 /*member: Class1a.:static=[Object.(0)]*/
 class Class1a<T> {
   /*spec:nnbd-off.member: Class1a.==:
-   dynamic=[this:Class1a.runtimeType,Object.runtimeType,Type.==],
+   dynamic=[
+    Object.runtimeType,
+    Type.==,
+    this:Class1a.runtimeType],
    runtimeType=[equals:Class1a<Class1a.T>==Object]
   */
   /*spec:nnbd-sdk.member: Class1a.==:
@@ -143,10 +146,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -201,10 +201,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -259,10 +256,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -319,10 +313,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -376,10 +367,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -432,10 +420,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -488,10 +473,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -546,10 +528,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -604,10 +583,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -663,10 +639,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -720,10 +693,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -778,10 +748,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -832,10 +799,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -886,10 +850,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -944,10 +905,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -1005,10 +963,7 @@
   _isString(1),
   _isTop(1),
   findType(1),
-  getRuntimeTypeArgument(3),
-  getRuntimeTypeArgumentIntercepted(4),
   getRuntimeTypeInfo(1),
-  getTypeArgumentByIndex(2),
   instanceType(1),
   setRuntimeTypeInfo(2)],
  type=[
@@ -2939,7 +2894,47 @@
 */
 notEquals4(Class3 a, Class4 b) => a?.runtimeType != b?.runtimeType;
 
-/*member: main:dynamic=[exact:Class1a.==],static=[Class1a.(0),Class1b.(0),Class1c.(0),Class1d.(0),Class2.(0),Class3.(0),Class4.(0),almostEquals1(1),almostEquals10(1),almostEquals11(1),almostEquals12(1),almostEquals2(1),almostEquals3(1),almostEquals4(1),almostEquals5(1),almostEquals6(1),almostEquals7(1),almostEquals8(1),almostEquals9(1),almostToString1(1),almostToString2(1),almostToString3(1),almostToString4(1),checkTypeBound(4),equals1(2),notEquals1(2),notEquals2(2),notEquals3(2),notEquals4(2),print(1),throwTypeError(1),toString1(1),toString2(1),toString3(1),toString4(1),toString5(1),toString6(1),unknown(1)]*/
+/*member: main:
+ dynamic=[exact:Class1a.==],
+ static=[
+  Class1a.(0),
+  Class1b.(0),
+  Class1c.(0),
+  Class1d.(0),
+  Class2.(0),
+  Class3.(0),
+  Class4.(0),
+  almostEquals1(1),
+  almostEquals10(1),
+  almostEquals11(1),
+  almostEquals12(1),
+  almostEquals2(1),
+  almostEquals3(1),
+  almostEquals4(1),
+  almostEquals5(1),
+  almostEquals6(1),
+  almostEquals7(1),
+  almostEquals8(1),
+  almostEquals9(1),
+  almostToString1(1),
+  almostToString2(1),
+  almostToString3(1),
+  almostToString4(1),
+  checkTypeBound(4),
+  equals1(2),
+  notEquals1(2),
+  notEquals2(2),
+  notEquals3(2),
+  notEquals4(2),
+  print(1),
+  toString1(1),
+  toString2(1),
+  toString3(1),
+  toString4(1),
+  toString5(1),
+  toString6(1),
+  unknown(1)]
+*/
 main() {
   Class1a<int> c1a = new Class1a<int>();
   Class1b<int> c1b = new Class1b<int>();
diff --git a/pkg/compiler/test/rti/emission/marker.options b/pkg/compiler/test/rti/emission/marker.options
index bf1a85d..fcd9518 100644
--- a/pkg/compiler/test/rti/emission/marker.options
+++ b/pkg/compiler/test/rti/emission/marker.options
@@ -1,4 +1,4 @@
-spec:nnbd-off=pkg/compiler/test/rti/rti_emission_test.dart
-prod:nnbd-off=pkg/compiler/test/rti/rti_emission_test.dart
-spec:nnbd-sdk=pkg/compiler/test/rti/rti_emission_test.dart
-prod:nnbd-sdk=pkg/compiler/test/rti/rti_emission_test.dart
\ No newline at end of file
+spec:nnbd-off=pkg/compiler/test/rti/rti_emission_test_helper.dart
+prod:nnbd-off=pkg/compiler/test/rti/rti_emission_test_helper.dart
+spec:nnbd-sdk=pkg/compiler/test/rti/rti_emission_test_helper.dart
+prod:nnbd-sdk=pkg/compiler/test/rti/rti_emission_test_helper.dart
diff --git a/pkg/compiler/test/rti/rti_emission0_test.dart b/pkg/compiler/test/rti/rti_emission0_test.dart
new file mode 100644
index 0000000..396b46d
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_emission0_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart = 2.7
+
+import 'rti_emission_test_helper.dart';
+
+main(List<String> args) {
+  runTests(args, 0);
+}
diff --git a/pkg/compiler/test/rti/rti_emission1_test.dart b/pkg/compiler/test/rti/rti_emission1_test.dart
new file mode 100644
index 0000000..6e3fe93
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_emission1_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart = 2.7
+
+import 'rti_emission_test_helper.dart';
+
+main(List<String> args) {
+  runTests(args, 1);
+}
diff --git a/pkg/compiler/test/rti/rti_emission2_test.dart b/pkg/compiler/test/rti/rti_emission2_test.dart
new file mode 100644
index 0000000..bd8883d
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_emission2_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart = 2.7
+
+import 'rti_emission_test_helper.dart';
+
+main(List<String> args) {
+  runTests(args, 2);
+}
diff --git a/pkg/compiler/test/rti/rti_emission3_test.dart b/pkg/compiler/test/rti/rti_emission3_test.dart
new file mode 100644
index 0000000..444b9a0
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_emission3_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart = 2.7
+
+import 'rti_emission_test_helper.dart';
+
+main(List<String> args) {
+  runTests(args, 3);
+}
diff --git a/pkg/compiler/test/rti/rti_emission_test.dart b/pkg/compiler/test/rti/rti_emission_test.dart
deleted file mode 100644
index 66364a9..0000000
--- a/pkg/compiler/test/rti/rti_emission_test.dart
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright (c) 2018, 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.
-
-// @dart = 2.7
-
-import 'dart:io';
-import 'package:_fe_analyzer_shared/src/testing/features.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/closure.dart';
-import 'package:compiler/src/common.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
-import 'package:compiler/src/elements/entities.dart';
-import 'package:compiler/src/js_backend/runtime_types.dart';
-import 'package:compiler/src/js_emitter/model.dart';
-import 'package:compiler/src/js_model/element_map.dart';
-import 'package:compiler/src/js_model/js_strategy.dart';
-import 'package:compiler/src/js_model/js_world.dart';
-import 'package:kernel/ast.dart' as ir;
-import '../equivalence/id_equivalence.dart';
-import '../equivalence/id_equivalence_helper.dart';
-import '../helpers/program_lookup.dart';
-
-main(List<String> args) {
-  asyncTest(() async {
-    Directory dataDir =
-        new Directory.fromUri(Platform.script.resolve('emission'));
-    await checkTests(dataDir, const RtiEmissionDataComputer(), args: args);
-  });
-}
-
-class Tags {
-  static const String isChecks = 'checks';
-  static const String indirectInstance = 'indirectInstance';
-  static const String directInstance = 'instance';
-  static const String checkedInstance = 'checkedInstance';
-  static const String typeArgument = 'typeArgument';
-  static const String checkedTypeArgument = 'checkedTypeArgument';
-  static const String typeLiteral = 'typeLiteral';
-  static const String functionType = 'functionType';
-}
-
-abstract class ComputeValueMixin {
-  Compiler get compiler;
-  ProgramLookup lookup;
-
-  JsBackendStrategy get backendStrategy => compiler.backendStrategy;
-
-  RuntimeTypesImpl get checksBuilder =>
-      backendStrategy.rtiChecksBuilderForTesting;
-
-  String getClassValue(ClassEntity element) {
-    lookup ??= new ProgramLookup(backendStrategy);
-    Class cls = lookup.getClass(element);
-    Features features = new Features();
-    if (cls != null) {
-      features.addElement(Tags.isChecks);
-      for (StubMethod stub in cls.isChecks) {
-        features.addElement(Tags.isChecks, stub.name.key);
-      }
-      if (cls.functionTypeIndex != null) {
-        features.add(Tags.functionType);
-      }
-    }
-    ClassUse classUse = checksBuilder.classUseMapForTesting[element];
-    if (classUse != null) {
-      if (classUse.directInstance) {
-        features.add(Tags.directInstance);
-      } else if (classUse.instance) {
-        features.add(Tags.indirectInstance);
-      }
-
-      if (classUse.checkedInstance) {
-        features.add(Tags.checkedInstance);
-      }
-      if (classUse.typeArgument) {
-        features.add(Tags.typeArgument);
-      }
-      if (classUse.checkedTypeArgument) {
-        features.add(Tags.checkedTypeArgument);
-      }
-      if (classUse.typeLiteral) {
-        features.add(Tags.typeLiteral);
-      }
-    }
-    return features.getText();
-  }
-
-  String getMemberValue(MemberEntity member) {
-    if (member.enclosingClass != null && member.enclosingClass.isClosure) {
-      return getClassValue(member.enclosingClass);
-    }
-    return null;
-  }
-}
-
-class RtiEmissionDataComputer extends DataComputer<String> {
-  const RtiEmissionDataComputer();
-
-  @override
-  void computeMemberData(Compiler compiler, MemberEntity member,
-      Map<Id, ActualData<String>> actualMap,
-      {bool verbose: false}) {
-    JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
-    JsToElementMap elementMap = closedWorld.elementMap;
-    MemberDefinition definition = elementMap.getMemberDefinition(member);
-    new RtiEmissionIrComputer(compiler.reporter, actualMap, elementMap,
-            compiler, closedWorld.closureDataLookup)
-        .run(definition.node);
-  }
-
-  @override
-  void computeClassData(
-      Compiler compiler, ClassEntity cls, Map<Id, ActualData<String>> actualMap,
-      {bool verbose: false}) {
-    JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
-    JsToElementMap elementMap = closedWorld.elementMap;
-    new RtiEmissionIrComputer(compiler.reporter, actualMap, elementMap,
-            compiler, closedWorld.closureDataLookup)
-        .computeForClass(elementMap.getClassDefinition(cls).node);
-  }
-
-  @override
-  DataInterpreter<String> get dataValidator => const StringDataInterpreter();
-}
-
-class RtiEmissionIrComputer extends IrDataExtractor<String>
-    with ComputeValueMixin {
-  final JsToElementMap _elementMap;
-  final ClosureData _closureDataLookup;
-  @override
-  final Compiler compiler;
-
-  RtiEmissionIrComputer(
-      DiagnosticReporter reporter,
-      Map<Id, ActualData<String>> actualMap,
-      this._elementMap,
-      this.compiler,
-      this._closureDataLookup)
-      : super(reporter, actualMap);
-
-  @override
-  String computeClassValue(Id id, ir.Class node) {
-    return getClassValue(_elementMap.getClass(node));
-  }
-
-  @override
-  String computeMemberValue(Id id, ir.Member node) {
-    return getMemberValue(_elementMap.getMember(node));
-  }
-
-  @override
-  String computeNodeValue(Id id, ir.TreeNode node) {
-    if (node is ir.FunctionExpression || node is ir.FunctionDeclaration) {
-      ClosureRepresentationInfo info = _closureDataLookup.getClosureInfo(node);
-      return getMemberValue(info.callMethod);
-    }
-    return null;
-  }
-}
diff --git a/pkg/compiler/test/rti/rti_emission_test_helper.dart b/pkg/compiler/test/rti/rti_emission_test_helper.dart
new file mode 100644
index 0000000..107c597
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_emission_test_helper.dart
@@ -0,0 +1,164 @@
+// Copyright (c) 2018, 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.
+
+// @dart = 2.7
+
+import 'dart:io';
+import 'package:_fe_analyzer_shared/src/testing/features.dart';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/closure.dart';
+import 'package:compiler/src/common.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/elements/entities.dart';
+import 'package:compiler/src/js_backend/runtime_types.dart';
+import 'package:compiler/src/js_emitter/model.dart';
+import 'package:compiler/src/js_model/element_map.dart';
+import 'package:compiler/src/js_model/js_strategy.dart';
+import 'package:compiler/src/js_model/js_world.dart';
+import 'package:kernel/ast.dart' as ir;
+import '../equivalence/id_equivalence.dart';
+import '../equivalence/id_equivalence_helper.dart';
+import '../helpers/program_lookup.dart';
+
+runTests(List<String> args, [int shardIndex]) {
+  asyncTest(() async {
+    Directory dataDir =
+        new Directory.fromUri(Platform.script.resolve('emission'));
+    await checkTests(dataDir, const RtiEmissionDataComputer(),
+        args: args,
+        shardIndex: shardIndex ?? 0,
+        shards: shardIndex != null ? 4 : 1);
+  });
+}
+
+class Tags {
+  static const String isChecks = 'checks';
+  static const String indirectInstance = 'indirectInstance';
+  static const String directInstance = 'instance';
+  static const String checkedInstance = 'checkedInstance';
+  static const String typeArgument = 'typeArgument';
+  static const String checkedTypeArgument = 'checkedTypeArgument';
+  static const String typeLiteral = 'typeLiteral';
+  static const String functionType = 'functionType';
+}
+
+abstract class ComputeValueMixin {
+  Compiler get compiler;
+  ProgramLookup lookup;
+
+  JsBackendStrategy get backendStrategy => compiler.backendStrategy;
+
+  RuntimeTypesImpl get checksBuilder =>
+      backendStrategy.rtiChecksBuilderForTesting;
+
+  String getClassValue(ClassEntity element) {
+    lookup ??= new ProgramLookup(backendStrategy);
+    Class cls = lookup.getClass(element);
+    Features features = new Features();
+    if (cls != null) {
+      features.addElement(Tags.isChecks);
+      for (StubMethod stub in cls.isChecks) {
+        features.addElement(Tags.isChecks, stub.name.key);
+      }
+      if (cls.functionTypeIndex != null) {
+        features.add(Tags.functionType);
+      }
+    }
+    ClassUse classUse = checksBuilder.classUseMapForTesting[element];
+    if (classUse != null) {
+      if (classUse.directInstance) {
+        features.add(Tags.directInstance);
+      } else if (classUse.instance) {
+        features.add(Tags.indirectInstance);
+      }
+
+      if (classUse.checkedInstance) {
+        features.add(Tags.checkedInstance);
+      }
+      if (classUse.typeArgument) {
+        features.add(Tags.typeArgument);
+      }
+      if (classUse.checkedTypeArgument) {
+        features.add(Tags.checkedTypeArgument);
+      }
+      if (classUse.typeLiteral) {
+        features.add(Tags.typeLiteral);
+      }
+    }
+    return features.getText();
+  }
+
+  String getMemberValue(MemberEntity member) {
+    if (member.enclosingClass != null && member.enclosingClass.isClosure) {
+      return getClassValue(member.enclosingClass);
+    }
+    return null;
+  }
+}
+
+class RtiEmissionDataComputer extends DataComputer<String> {
+  const RtiEmissionDataComputer();
+
+  @override
+  void computeMemberData(Compiler compiler, MemberEntity member,
+      Map<Id, ActualData<String>> actualMap,
+      {bool verbose: false}) {
+    JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
+    JsToElementMap elementMap = closedWorld.elementMap;
+    MemberDefinition definition = elementMap.getMemberDefinition(member);
+    new RtiEmissionIrComputer(compiler.reporter, actualMap, elementMap,
+            compiler, closedWorld.closureDataLookup)
+        .run(definition.node);
+  }
+
+  @override
+  void computeClassData(
+      Compiler compiler, ClassEntity cls, Map<Id, ActualData<String>> actualMap,
+      {bool verbose: false}) {
+    JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
+    JsToElementMap elementMap = closedWorld.elementMap;
+    new RtiEmissionIrComputer(compiler.reporter, actualMap, elementMap,
+            compiler, closedWorld.closureDataLookup)
+        .computeForClass(elementMap.getClassDefinition(cls).node);
+  }
+
+  @override
+  DataInterpreter<String> get dataValidator => const StringDataInterpreter();
+}
+
+class RtiEmissionIrComputer extends IrDataExtractor<String>
+    with ComputeValueMixin {
+  final JsToElementMap _elementMap;
+  final ClosureData _closureDataLookup;
+  @override
+  final Compiler compiler;
+
+  RtiEmissionIrComputer(
+      DiagnosticReporter reporter,
+      Map<Id, ActualData<String>> actualMap,
+      this._elementMap,
+      this.compiler,
+      this._closureDataLookup)
+      : super(reporter, actualMap);
+
+  @override
+  String computeClassValue(Id id, ir.Class node) {
+    return getClassValue(_elementMap.getClass(node));
+  }
+
+  @override
+  String computeMemberValue(Id id, ir.Member node) {
+    return getMemberValue(_elementMap.getMember(node));
+  }
+
+  @override
+  String computeNodeValue(Id id, ir.TreeNode node) {
+    if (node is ir.FunctionExpression || node is ir.FunctionDeclaration) {
+      ClosureRepresentationInfo info = _closureDataLookup.getClosureInfo(node);
+      return getMemberValue(info.callMethod);
+    }
+    return null;
+  }
+}
diff --git a/pkg/compiler/test/rti/rti_need2_test.dart b/pkg/compiler/test/rti/rti_need2_test.dart
new file mode 100644
index 0000000..8911126
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_need2_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart = 2.7
+
+import 'rti_need_test_helper.dart';
+
+main(List<String> args) {
+  runTests(args, 2);
+}
diff --git a/pkg/compiler/test/rti/rti_need3_test.dart b/pkg/compiler/test/rti/rti_need3_test.dart
new file mode 100644
index 0000000..a23252a
--- /dev/null
+++ b/pkg/compiler/test/rti/rti_need3_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart = 2.7
+
+import 'rti_need_test_helper.dart';
+
+main(List<String> args) {
+  runTests(args, 3);
+}
diff --git a/pkg/compiler/test/rti/rti_need_test_helper.dart b/pkg/compiler/test/rti/rti_need_test_helper.dart
index faa8983..4170976 100644
--- a/pkg/compiler/test/rti/rti_need_test_helper.dart
+++ b/pkg/compiler/test/rti/rti_need_test_helper.dart
@@ -38,7 +38,7 @@
         options: [],
         args: args,
         shardIndex: shardIndex ?? 0,
-        shards: shardIndex != null ? 2 : 1);
+        shards: shardIndex != null ? 4 : 1);
   });
 }
 
diff --git a/pkg/compiler/test/rti/show.dart b/pkg/compiler/test/rti/show.dart
index f6ffb3a..1e8d6a7 100644
--- a/pkg/compiler/test/rti/show.dart
+++ b/pkg/compiler/test/rti/show.dart
@@ -9,7 +9,7 @@
 import 'package:args/args.dart';
 import '../equivalence/id_equivalence_helper.dart';
 import '../equivalence/show_helper.dart';
-import 'rti_emission_test.dart';
+import 'rti_emission_test_helper.dart';
 import 'rti_need_test_helper.dart';
 
 main(List<String> args) async {
diff --git a/pkg/compiler/tool/modular_test_suite.dart b/pkg/compiler/tool/modular_test_suite.dart
index 9f75ae8..a318ff1 100644
--- a/pkg/compiler/tool/modular_test_suite.dart
+++ b/pkg/compiler/tool/modular_test_suite.dart
@@ -132,10 +132,7 @@
         return;
       }
       sources = ['dart:core'];
-      extraArgs = [
-        '--libraries-file',
-        '$rootScheme:///sdk_nnbd/lib/libraries.json'
-      ];
+      extraArgs = ['--libraries-file', '$rootScheme:///sdk/lib/libraries.json'];
       assert(transitiveDependencies.isEmpty);
     } else {
       sources = module.sources.map(sourceToImportUri).toList();
@@ -342,7 +339,7 @@
     if (_options.verbose) print("\nstep: d8 on $module");
     List<String> d8Args = [
       sdkRoot
-          .resolve('sdk_nnbd/lib/_internal/js_runtime/lib/preambles/d8.js')
+          .resolve('sdk/lib/_internal/js_runtime/lib/preambles/d8.js')
           .toFilePath(),
       root.resolveUri(toUri(module, jsId)).toFilePath(),
     ];
diff --git a/pkg/compiler/tool/update_id_tests.dart b/pkg/compiler/tool/update_id_tests.dart
index 445a7a8..ba805bc 100644
--- a/pkg/compiler/tool/update_id_tests.dart
+++ b/pkg/compiler/tool/update_id_tests.dart
@@ -22,7 +22,7 @@
   'pkg/compiler/test/member_usage/member_usage_test.dart',
   'pkg/compiler/test/optimization/optimization_test.dart',
   'pkg/compiler/test/rti/rti_need_test_helper.dart',
-  'pkg/compiler/test/rti/rti_emission_test.dart',
+  'pkg/compiler/test/rti/rti_emission_test_helper.dart',
   'pkg/compiler/test/static_type/static_type_test.dart',
   'pkg/compiler/test/static_type/type_promotion_test.dart',
   'pkg/compiler/test/equivalence/id_testing_test.dart',
diff --git a/pkg/dev_compiler/lib/src/compiler/shared_command.dart b/pkg/dev_compiler/lib/src/compiler/shared_command.dart
index 2c6e470..f1b8d93 100644
--- a/pkg/dev_compiler/lib/src/compiler/shared_command.dart
+++ b/pkg/dev_compiler/lib/src/compiler/shared_command.dart
@@ -339,9 +339,7 @@
         // TODO(sigmund): extract all source-map normalization outside ddc. This
         // custom logic is BUILD specific and could be shared with other tools
         // like dart2js.
-        var shortPath = uri.path
-            .replaceAll('/sdk/', '/dart-sdk/')
-            .replaceAll('/sdk_nnbd/', '/dart-sdk/');
+        var shortPath = uri.path.replaceAll('/sdk/', '/dart-sdk/');
         var multiRootPath = "${multiRootOutputPath ?? ''}$shortPath";
         multiRootPath = p.url.relative(multiRootPath, from: sourceMapDir);
         return multiRootPath;
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index 5b1adc5..d7fcce0 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -647,7 +647,7 @@
 
     // FutureOr types have a runtime normalization step that will call
     // generic() as needed.
-    var genericCall = c == _coreTypes.futureOrClass
+    var genericCall = c == _coreTypes.deprecatedFutureOrClass
         ? runtimeCall('normalizeFutureOr(#)', [genericArgs])
         : runtimeCall('generic(#)', [genericArgs]);
 
@@ -755,6 +755,7 @@
     }
 
     js_ast.Expression emitDeferredType(DartType t) {
+      assert(isKnownDartTypeImplementor(t));
       if (t is InterfaceType) {
         _declareBeforeUse(t.classNode);
         if (t.typeArguments.isNotEmpty) {
@@ -762,6 +763,9 @@
               t, t.typeArguments.map(emitDeferredType));
         }
         return _emitInterfaceType(t, emitNullability: false);
+      } else if (t is FutureOrType) {
+        _declareBeforeUse(_coreTypes.deprecatedFutureOrClass);
+        return _emitFutureOrTypeWithArgument(emitDeferredType(t.typeArgument));
       } else if (t is TypeParameterType) {
         return _emitTypeParameterType(t, emitNullability: false);
       }
@@ -771,6 +775,7 @@
     bool shouldDefer(InterfaceType t) {
       var visited = <DartType>{};
       bool defer(DartType t) {
+        assert(isKnownDartTypeImplementor(t));
         if (t is InterfaceType) {
           var tc = t.classNode;
           if (c == tc) return true;
@@ -780,6 +785,13 @@
           return mixin != null && defer(mixin.asInterfaceType) ||
               defer(tc.supertype.asInterfaceType);
         }
+        if (t is FutureOrType) {
+          if (c == _coreTypes.deprecatedFutureOrClass) return true;
+          if (!visited.add(t)) return false;
+          if (defer(t.typeArgument)) return true;
+          return defer(
+              _coreTypes.deprecatedFutureOrClass.supertype.asInterfaceType);
+        }
         if (t is TypedefType) {
           return t.typeArguments.any(defer);
         }
@@ -1023,8 +1035,7 @@
       return null;
     }
 
-    if (c.enclosingLibrary == _coreTypes.asyncLibrary &&
-        c == _coreTypes.futureOrClass) {
+    if (c == _coreTypes.deprecatedFutureOrClass) {
       // These methods are difficult to place in the runtime or patch files.
       // * They need to be callable from the class but they can't be static
       //   methods on the FutureOr class in Dart because they reference the
@@ -2314,6 +2325,11 @@
         _emitTopLevelMemberName(n, suffix: suffix));
   }
 
+  js_ast.PropertyAccess _emitFutureOrNameNoInterop({String suffix = ''}) {
+    return js_ast.PropertyAccess(emitLibraryName(_coreTypes.asyncLibrary),
+        propertyName('FutureOr' + suffix));
+  }
+
   /// Emits the member name portion of a top-level member.
   ///
   /// NOTE: usually you should use [_emitTopLevelName] instead of this. This
@@ -2468,10 +2484,15 @@
   /// If we're emitting the type information for `foo`, we cannot refer to `C`
   /// yet, so we must evaluate foo's type lazily.
   bool _canEmitTypeAtTopLevel(DartType type) {
+    assert(isKnownDartTypeImplementor(type));
     if (type is InterfaceType) {
       return !_pendingClasses.contains(type.classNode) &&
           type.typeArguments.every(_canEmitTypeAtTopLevel);
     }
+    if (type is FutureOrType) {
+      return !_pendingClasses.contains(_coreTypes.deprecatedFutureOrClass) &&
+          _canEmitTypeAtTopLevel(type.typeArgument);
+    }
     if (type is FunctionType) {
       // Generic functions are always safe to emit, because they're lazy until
       // type arguments are applied.
@@ -2520,8 +2541,8 @@
           : _emitNullabilityWrapper(runtimeCall('Never'), type.nullability);
 
   /// Normalizes `FutureOr` types and emits the normalized version.
-  js_ast.Expression _normalizeFutureOr(InterfaceType futureOr) {
-    var typeArgument = futureOr.typeArguments.single;
+  js_ast.Expression _normalizeFutureOr(FutureOrType futureOr) {
+    var typeArgument = futureOr.typeArgument;
     if (typeArgument is DynamicType) {
       // FutureOr<dynamic> --> dynamic
       return visitDynamicType(typeArgument);
@@ -2531,7 +2552,6 @@
       return visitVoidType(typeArgument);
     }
 
-    var normalizedType = futureOr;
     if (typeArgument is InterfaceType &&
         typeArgument.classNode == _coreTypes.objectClass) {
       // Normalize FutureOr of Object, Object?, Object*.
@@ -2542,30 +2562,33 @@
       var nullability = nullable
           ? Nullability.nullable
           : legacy ? Nullability.legacy : Nullability.nonNullable;
-      normalizedType = typeArgument.withDeclaredNullability(nullability);
+      return _emitInterfaceType(
+          typeArgument.withDeclaredNullability(nullability));
     } else if (typeArgument is NeverType) {
       // FutureOr<Never> --> Future<Never>
-      normalizedType = InterfaceType(
-          _coreTypes.futureClass, futureOr.nullability, [typeArgument]);
+      return _emitInterfaceType(InterfaceType(
+          _coreTypes.futureClass, futureOr.nullability, [typeArgument]));
     } else if (typeArgument is InterfaceType &&
         typeArgument.classNode == _coreTypes.nullClass) {
       // FutureOr<Null> --> Future<Null>?
-      normalizedType = InterfaceType(
-          _coreTypes.futureClass, Nullability.nullable, [typeArgument]);
-    } else if (futureOr.nullability == Nullability.nullable &&
+      return _emitInterfaceType(InterfaceType(
+          _coreTypes.futureClass, Nullability.nullable, [typeArgument]));
+    } else if (futureOr.declaredNullability == Nullability.nullable &&
         typeArgument.nullability == Nullability.nullable) {
       // FutureOr<T?>? --> FutureOr<T?>
-      normalizedType =
-          futureOr.withDeclaredNullability(Nullability.nonNullable);
+      return _emitFutureOrType(
+          futureOr.withDeclaredNullability(Nullability.nonNullable));
     }
-    return _emitInterfaceType(normalizedType);
+    return _emitFutureOrType(futureOr);
   }
 
   @override
   js_ast.Expression visitInterfaceType(InterfaceType type) =>
-      type.classNode == _coreTypes.futureOrClass
-          ? _normalizeFutureOr(type)
-          : _emitInterfaceType(type);
+      _emitInterfaceType(type);
+
+  @override
+  js_ast.Expression visitFutureOrType(FutureOrType type) =>
+      _normalizeFutureOr(type);
 
   /// Emits the representation of [type].
   ///
@@ -2653,6 +2676,41 @@
     return _typeTable.nameType(type, typeRep);
   }
 
+  /// Emits the representation of a FutureOr [type].
+  js_ast.Expression _emitFutureOrType(FutureOrType type) {
+    _declareBeforeUse(_coreTypes.deprecatedFutureOrClass);
+
+    var arg = type.typeArgument;
+    js_ast.Expression typeRep;
+    if (arg != const DynamicType()) {
+      // We force nullability to non-nullable to prevent caching nullable
+      // and non-nullable generic types separately (e.g., C<T> and C<T>?).
+      // Forward-defined types will only have nullability wrappers around
+      // their type arguments (not the generic type itself).
+      typeRep = _emitFutureOrTypeWithArgument(_emitType(arg));
+      if (_cacheTypes) {
+        typeRep = _typeTable.nameType(
+            type.withDeclaredNullability(Nullability.nonNullable), typeRep);
+      }
+    }
+
+    typeRep ??= _emitFutureOrNameNoInterop();
+
+    if (type.declaredNullability == Nullability.undetermined) {
+      throw UnsupportedError('Undetermined Nullability');
+    }
+
+    // Emit non-nullable version directly.
+    typeRep = _emitNullabilityWrapper(typeRep, type.declaredNullability);
+    if (!_cacheTypes || type.nullability == Nullability.nonNullable) {
+      return typeRep;
+    }
+
+    // Hoist the nullable or legacy versions of the type to the top level and
+    // use it everywhere it appears.
+    return _typeTable.nameType(type, typeRep);
+  }
+
   /// Wraps [typeRep] in the appropriate wrapper for the given [nullability].
   ///
   /// Non-nullable and undetermined nullability will not cause any wrappers to
@@ -2688,6 +2746,14 @@
     return js.call('#(#)', [genericName, typeArgs]);
   }
 
+  js_ast.Expression _emitFutureOrTypeWithArgument(js_ast.Expression typeArg) {
+    var genericName = _emitFutureOrNameNoInterop(suffix: '\$');
+    return js.call('#(#)', [
+      genericName,
+      [typeArg]
+    ]);
+  }
+
   @override
   js_ast.Expression visitFunctionType(type,
       {Member member, bool lazy = false}) {
@@ -3143,16 +3209,8 @@
   }
 
   /// Returns true if the underlying type does not accept a null value.
-  bool _mustBeNonNullable(DartType type) {
-    if (type.nullability == Nullability.nonNullable) {
-      if (type is InterfaceType && type.classNode == _coreTypes.futureOrClass) {
-        // A `FutureOr<T>` can still accept null if `T` can.
-        return _mustBeNonNullable(type.typeArguments.single);
-      }
-      return true;
-    }
-    return false;
-  }
+  bool _mustBeNonNullable(DartType type) =>
+      type.nullability == Nullability.nonNullable;
 
   /// Emits argument initializers, which handles optional/named args, as well
   /// as generic type checks needed due to our covariance.
@@ -4784,6 +4842,9 @@
           if (type is InterfaceType) {
             return _emitTopLevelNameNoInterop(type.classNode, suffix: '\$');
           }
+          if (type is FutureOrType) {
+            return _emitFutureOrNameNoInterop(suffix: '\$');
+          }
         }
         if (name == 'unwrapType' && firstArg is TypeLiteral) {
           return _emitType(firstArg.type);
diff --git a/pkg/dev_compiler/lib/src/kernel/js_typerep.dart b/pkg/dev_compiler/lib/src/kernel/js_typerep.dart
index e9ea6e4..4c4dd95 100644
--- a/pkg/dev_compiler/lib/src/kernel/js_typerep.dart
+++ b/pkg/dev_compiler/lib/src/kernel/js_typerep.dart
@@ -7,6 +7,7 @@
 import 'package:kernel/kernel.dart';
 import 'package:kernel/type_environment.dart';
 import '../compiler/js_typerep.dart';
+import 'kernel_helpers.dart';
 
 class JSTypeRep extends SharedJSTypeRep<DartType> {
   final TypeEnvironment types;
@@ -32,6 +33,8 @@
       type = (type as TypeParameterType).parameter.bound;
     }
     if (type == null) return JSType.jsUnknown;
+    assert(isKnownDartTypeImplementor(type));
+
     // Note that this should be changed if Dart gets non-nullable types
     if (type == const BottomType()) return JSType.jsNull;
 
@@ -47,13 +50,13 @@
       if (c == coreTypes.boolClass || c == _jsBool) return JSType.jsBoolean;
       if (c == coreTypes.stringClass || c == _jsString) return JSType.jsString;
       if (c == coreTypes.objectClass) return JSType.jsUnknown;
-      if (c == coreTypes.futureOrClass) {
-        var argumentRep = typeFor(type.typeArguments[0]);
-        if (argumentRep is JSObject || argumentRep is JSNull) {
-          return JSType.jsObject;
-        }
-        return JSType.jsUnknown;
+    }
+    if (type is FutureOrType) {
+      var argumentRep = typeFor(type.typeArgument);
+      if (argumentRep is JSObject || argumentRep is JSNull) {
+        return JSType.jsObject;
       }
+      return JSType.jsUnknown;
     }
     if (type == const DynamicType() || type == const VoidType()) {
       return JSType.jsUnknown;
diff --git a/pkg/dev_compiler/lib/src/kernel/kernel_helpers.dart b/pkg/dev_compiler/lib/src/kernel/kernel_helpers.dart
index 03e4d95..7baad48 100644
--- a/pkg/dev_compiler/lib/src/kernel/kernel_helpers.dart
+++ b/pkg/dev_compiler/lib/src/kernel/kernel_helpers.dart
@@ -321,3 +321,22 @@
     visit(node.finalizer);
   }
 }
+
+/// Ensures that all of the known DartType implementors are handled.
+///
+/// The goal of the function is to catch a new unhandled implementor of
+/// [DartType] in a chain of if-else statements analysing possibilities for an
+/// object of DartType. It doesn't introduce a run-time overhead in production
+/// code if used in an assert.
+bool isKnownDartTypeImplementor(DartType t) {
+  return t is BottomType ||
+      t is DynamicType ||
+      t is FunctionType ||
+      t is FutureOrType ||
+      t is InterfaceType ||
+      t is InvalidType ||
+      t is NeverType ||
+      t is TypeParameterType ||
+      t is TypedefType ||
+      t is VoidType;
+}
diff --git a/pkg/dev_compiler/lib/src/kernel/type_table.dart b/pkg/dev_compiler/lib/src/kernel/type_table.dart
index ee44a72..2d6b5cf 100644
--- a/pkg/dev_compiler/lib/src/kernel/type_table.dart
+++ b/pkg/dev_compiler/lib/src/kernel/type_table.dart
@@ -7,14 +7,18 @@
 import '../compiler/js_names.dart' as js_ast;
 import '../js_ast/js_ast.dart' as js_ast;
 import '../js_ast/js_ast.dart' show js;
+import 'kernel_helpers.dart';
 
 Set<TypeParameter> freeTypeParameters(DartType t) {
+  assert(isKnownDartTypeImplementor(t));
   var result = <TypeParameter>{};
   void find(DartType t) {
     if (t is TypeParameterType) {
       result.add(t.parameter);
     } else if (t is InterfaceType) {
       t.typeArguments.forEach(find);
+    } else if (t is FutureOrType) {
+      find(t.typeArgument);
     } else if (t is TypedefType) {
       t.typeArguments.forEach(find);
     } else if (t is FunctionType) {
@@ -68,9 +72,10 @@
   /// 'L' and 'N' are prepended to a type name to represent a legacy or nullable
   /// flavor of a type.
   String _typeString(DartType type, {bool flat = false}) {
-    var nullability = type.nullability == Nullability.legacy
+    var nullability = type.declaredNullability == Nullability.legacy
         ? 'L'
-        : type.nullability == Nullability.nullable ? 'N' : '';
+        : type.declaredNullability == Nullability.nullable ? 'N' : '';
+    assert(isKnownDartTypeImplementor(type));
     if (type is InterfaceType) {
       var name = '${type.classNode.name}$nullability';
       var typeArgs = type.typeArguments;
@@ -78,6 +83,11 @@
       if (typeArgs.every((p) => p == const DynamicType())) return name;
       return "${name}Of${typeArgs.map(_typeString).join("\$")}";
     }
+    if (type is FutureOrType) {
+      var name = 'FutureOr$nullability';
+      if (type.typeArgument == const DynamicType()) return name;
+      return '${name}Of${_typeString(type.typeArgument)}';
+    }
     if (type is TypedefType) {
       var name = '${type.typedefNode.name}$nullability';
       var typeArgs = type.typeArguments;
diff --git a/pkg/dev_compiler/test/modular_suite.dart b/pkg/dev_compiler/test/modular_suite.dart
index 033d682..e368ee2 100644
--- a/pkg/dev_compiler/test/modular_suite.dart
+++ b/pkg/dev_compiler/test/modular_suite.dart
@@ -77,7 +77,7 @@
       sources = ['dart:core'];
       extraArgs = [
         '--libraries-file',
-        '$rootScheme:///sdk_nnbd/lib/libraries.json',
+        '$rootScheme:///sdk/lib/libraries.json',
         '--enable-experiment',
         'non-nullable',
       ];
@@ -157,7 +157,7 @@
       extraArgs = [
         '--compile-sdk',
         '--libraries-file',
-        '$rootScheme:///sdk_nnbd/lib/libraries.json',
+        '$rootScheme:///sdk/lib/libraries.json',
         '--enable-experiment',
         'non-nullable',
       ];
diff --git a/pkg/dev_compiler/test/modular_suite_nnbd.dart b/pkg/dev_compiler/test/modular_suite_nnbd.dart
index 9c52552..c1a624b 100644
--- a/pkg/dev_compiler/test/modular_suite_nnbd.dart
+++ b/pkg/dev_compiler/test/modular_suite_nnbd.dart
@@ -77,7 +77,7 @@
       sources = ['dart:core'];
       extraArgs = [
         '--libraries-file',
-        '$rootScheme:///sdk_nnbd/lib/libraries.json',
+        '$rootScheme:///sdk/lib/libraries.json',
       ];
       assert(transitiveDependencies.isEmpty);
     } else {
@@ -159,7 +159,7 @@
       extraArgs = [
         '--compile-sdk',
         '--libraries-file',
-        '$rootScheme:///sdk_nnbd/lib/libraries.json',
+        '$rootScheme:///sdk/lib/libraries.json',
       ];
       assert(transitiveDependencies.isEmpty);
     } else {
diff --git a/pkg/dev_compiler/test/nullable_inference_test.dart b/pkg/dev_compiler/test/nullable_inference_test.dart
index 8a8b513..bbaefa1 100644
--- a/pkg/dev_compiler/test/nullable_inference_test.dart
+++ b/pkg/dev_compiler/test/nullable_inference_test.dart
@@ -9,6 +9,7 @@
 import 'package:kernel/kernel.dart';
 import 'package:kernel/class_hierarchy.dart';
 import 'package:kernel/type_environment.dart';
+import 'package:kernel/src/printer.dart';
 import 'package:kernel/target/targets.dart';
 import 'package:test/test.dart';
 
@@ -17,6 +18,11 @@
 import 'package:dev_compiler/src/kernel/js_typerep.dart';
 import 'package:dev_compiler/src/kernel/target.dart';
 
+const AstTextStrategy astTextStrategy = AstTextStrategy(
+    includeLibraryNamesInTypes: true,
+    includeLibraryNamesInMembers: true,
+    useMultiline: false);
+
 void main() {
   test('empty main', () async {
     await expectNotNull('main() {}', '');
@@ -72,7 +78,7 @@
 
   test('constructor', () async {
     await expectNotNull(
-        'library a; class C {} main() { new C(); }', 'new a::C::•()');
+        'library a; class C {} main() { new C(); }', 'new a::C()');
   });
 
   group('operator', () {
@@ -249,8 +255,8 @@
   });
 
   test('function expression', () async {
-    await expectNotNull('main() { () => null; f() {}; f; }',
-        '() → dart.core::Null? => null, f');
+    await expectNotNull(
+        'main() { () => null; f() {}; f; }', 'dart.core::Null? () => null, f');
   });
 
   test('cascades (kernel BlockExpression)', () async {
@@ -302,7 +308,7 @@
         var y = (x = null) == null;
         print(x);
         print(y);
-      }''', '1, (x = null).{dart.core::Object::==}(null), y');
+      }''', '1, (x = null).{dart.core::Object.==}(null), y');
     });
     test('declaration from variable transitive', () async {
       await expectNotNull('''main() {
@@ -339,8 +345,8 @@
       }''',
           // arithmetic operation results on `i` are themselves not null, even
           // though `i` is nullable.
-          '0, i.{dart.core::num::<}(10), 10, i = i.{dart.core::num::+}(1), '
-              'i.{dart.core::num::+}(1), 1, i.{dart.core::num::>=}(10), 10');
+          '0, i.{dart.core::num.<}(10), 10, i = i.{dart.core::num.+}(1), '
+              'i.{dart.core::num.+}(1), 1, i.{dart.core::num.>=}(10), 10');
     });
     test('for-in', () async {
       await expectNotNull('''main() {
@@ -362,7 +368,7 @@
           print(z);
         }
         f(42);
-      }''', '0, () → void => dart.core::print("g"), "g", g, y, 1, z, f, 42');
+      }''', '0, void () => dart.core::print("g"), "g", g, y, 1, z, f, 42');
     });
     test('assignment to closure variable', () async {
       await expectNotNull('''main() {
@@ -391,8 +397,7 @@
       await expectNotNull('''main() {
         var x = () => 42;
         var y = (() => x = null);
-      }''',
-          '() → dart.core::int* => 42, 42, () → dart.core::Null? => x = null');
+      }''', 'dart.core::int* () => 42, 42, dart.core::Null? () => x = null');
     });
     test('do not depend on unrelated variables', () async {
       await expectNotNull('''main() {
@@ -481,7 +486,7 @@
       await expectNotNull(
           'library b; $imports class C { @notNull m() {} } '
               'main() { var c = new C(); c.m(); }',
-          'new b::C::•(), c.{b::C::m}(), c');
+          'new b::C(), c.{b::C.m}(), c');
     });
   });
 }
@@ -505,9 +510,9 @@
             // Print integer values as integers
             return BigInt.from(c.value).toString();
           }
-          return c.toConstantText();
+          return c.toText(astTextStrategy);
         }
-        return e.leakingDebugToString();
+        return e.toText(astTextStrategy);
       })
       // Filter out our own NotNull annotations.  The library prefix changes
       // per test, so just filter on the suffix.
diff --git a/pkg/dev_compiler/tool/check_nnbd_sdk.dart b/pkg/dev_compiler/tool/check_nnbd_sdk.dart
index 3825350..01eddae 100644
--- a/pkg/dev_compiler/tool/check_nnbd_sdk.dart
+++ b/pkg/dev_compiler/tool/check_nnbd_sdk.dart
@@ -37,7 +37,7 @@
 
   var librariesJson = args['libraries'] != null
       ? resolveInputUri(args['libraries'] as String)
-      : Platform.script.resolve('../../../sdk_nnbd/lib/libraries.json');
+      : Platform.script.resolve('../../../sdk/lib/libraries.json');
   var target = args['target'] as String;
   patch.main([
     '--libraries',
@@ -115,8 +115,7 @@
   var result = Process.runSync(dart.toFilePath(), [
     // The NNBD dart binaries / snapshots require this flag to be enabled at
     // VM level.
-    if (analyzerSnapshot.contains('NNBD'))
-      '--enable-experiment=non-nullable',
+    if (analyzerSnapshot.contains('NNBD')) '--enable-experiment=non-nullable',
     analyzerSnapshot,
     '--dart-sdk=${sdkDir}',
     '--format',
@@ -198,7 +197,7 @@
 final _parser = ArgParser()
   ..addOption('libraries',
       help: 'Path to the nnbd libraries.json (defaults to the one under '
-          'sdk_nnbd/lib/libraries.json.')
+          'sdk/lib/libraries.json.')
   ..addOption('out',
       help: 'Path to an output folder (defaults to a new tmp folder).')
   ..addOption('target',
diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
index 9a9da8c..9f21e27 100644
--- a/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
+++ b/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
@@ -9,7 +9,7 @@
 /// The set of experiments enabled for SDK and packages.
 ///
 /// This are derived from an `allowed_experiments.json` file whose default is
-/// located in `sdk_nnbd/lib/_internal/allowed_experiments.json`.
+/// located in `sdk/lib/_internal/allowed_experiments.json`.
 class AllowedExperimentalFlags {
   /// The set of experiments that are enabled for all SDK libraries other than
   /// for those which are specified in [sdkLibraryExperiments].
diff --git a/pkg/front_end/lib/src/fasta/builder/builtin_type_builder.dart b/pkg/front_end/lib/src/fasta/builder/builtin_type_builder.dart
index daecfe9..be14b32 100644
--- a/pkg/front_end/lib/src/fasta/builder/builtin_type_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/builtin_type_builder.dart
@@ -22,14 +22,12 @@
   DartType buildType(LibraryBuilder library,
       NullabilityBuilder nullabilityBuilder, List<TypeBuilder> arguments,
       [bool notInstanceContext]) {
-    // TODO(dmitryas): Use [nullabilityBuilder].
-    return type;
+    return type.withDeclaredNullability(nullabilityBuilder.build(library));
   }
 
   DartType buildTypesWithBuiltArguments(LibraryBuilder library,
       Nullability nullability, List<DartType> arguments) {
-    // TODO(dmitryas): Use [nullability].
-    return type;
+    return type.withDeclaredNullability(nullability);
   }
 
   String get debugName => "BuiltinTypeBuilder";
diff --git a/pkg/front_end/lib/src/fasta/builder/class_builder.dart b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
index bde7581..1bfd961 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -16,6 +16,7 @@
         Field,
         FunctionNode,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         InvalidType,
         Member,
@@ -552,12 +553,20 @@
   }
 
   @override
-  InterfaceType buildTypesWithBuiltArguments(LibraryBuilder library,
+  DartType buildTypesWithBuiltArguments(LibraryBuilder library,
       Nullability nullability, List<DartType> arguments) {
     assert(arguments == null || cls.typeParameters.length == arguments.length);
     if (isNullClass) {
       nullability = Nullability.nullable;
     }
+    if (name == "FutureOr") {
+      LibraryBuilder parentLibrary = parent;
+      if (parentLibrary.importUri.scheme == "dart" &&
+          parentLibrary.importUri.path == "async") {
+        assert(arguments != null && arguments.length == 1);
+        return new FutureOrType(arguments.single, nullability);
+      }
+    }
     return arguments == null
         ? rawType(nullability)
         : new InterfaceType(cls, nullability, arguments);
@@ -607,7 +616,7 @@
   }
 
   @override
-  InterfaceType buildType(LibraryBuilder library,
+  DartType buildType(LibraryBuilder library,
       NullabilityBuilder nullabilityBuilder, List<TypeBuilder> arguments,
       [bool notInstanceContext]) {
     return buildTypesWithBuiltArguments(
@@ -682,9 +691,6 @@
       } else if (decl is NeverTypeBuilder) {
         fail(superClassType, messageExtendsNever, aliasBuilder);
       } else if (decl is ClassBuilder) {
-        if (decl.cls == coreTypes.futureOrClass) {
-          fail(superClassType, messageExtendsFutureOr, aliasBuilder);
-        }
         superClass = decl;
       }
     }
@@ -713,6 +719,10 @@
                 templateImplementsSuperClass.withArguments(interface.name),
                 this.charOffset,
                 noLength);
+          } else if (interface.cls.name == "FutureOr" &&
+              interface.cls.enclosingLibrary.importUri.scheme == "dart" &&
+              interface.cls.enclosingLibrary.importUri.path == "async") {
+            addProblem(messageImplementsFutureOr, this.charOffset, noLength);
           } else if (implemented.contains(interface)) {
             // Aggregate repetitions.
             problems ??= new Map<ClassBuilder, int>();
@@ -720,8 +730,6 @@
             problems[interface] += 1;
             problemsOffsets ??= new Map<ClassBuilder, int>();
             problemsOffsets[interface] ??= charOffset;
-          } else if (interface.cls == coreTypes.futureOrClass) {
-            fail(type, messageImplementsFutureOr, aliasBuilder);
           } else {
             implemented.add(interface);
           }
diff --git a/pkg/front_end/lib/src/fasta/builder/field_builder.dart b/pkg/front_end/lib/src/fasta/builder/field_builder.dart
index 02a38dd..81af315 100644
--- a/pkg/front_end/lib/src/fasta/builder/field_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/field_builder.dart
@@ -8,7 +8,6 @@
 
 import 'package:kernel/ast.dart' hide MapEntry;
 import 'package:kernel/core_types.dart';
-import 'package:kernel/src/future_or.dart';
 import 'package:kernel/src/legacy_erasure.dart';
 
 import '../constant_context.dart' show ConstantContext;
@@ -834,7 +833,7 @@
       if (_lateSetter != null) {
         _lateSetter.function.positionalParameters.single.type = value;
       }
-      if (!isPotentiallyNullable(_type, null) && !_forceIncludeIsSetField) {
+      if (!_type.isPotentiallyNullable && !_forceIncludeIsSetField) {
         // We only need the is-set field if the field is potentially nullable.
         //  Otherwise we use `null` to signal that the field is uninitialized.
         _lateIsSetField = null;
diff --git a/pkg/front_end/lib/src/fasta/builder/future_or_type_builder.dart b/pkg/front_end/lib/src/fasta/builder/future_or_type_builder.dart
new file mode 100644
index 0000000..fc823fc
--- /dev/null
+++ b/pkg/front_end/lib/src/fasta/builder/future_or_type_builder.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library fasta.future_or_type_builder;
+
+import 'package:kernel/ast.dart' show DartType, FutureOrType, Nullability;
+
+import 'builtin_type_builder.dart';
+import 'library_builder.dart';
+import 'nullability_builder.dart';
+import 'type_builder.dart';
+
+class FutureOrTypeBuilder extends BuiltinTypeBuilder {
+  FutureOrTypeBuilder(
+      DartType type, LibraryBuilder compilationUnit, int charOffset)
+      : super("FutureOr", type, compilationUnit, charOffset);
+
+  String get debugName => "FutureOrTypeBuilder";
+
+  DartType buildType(LibraryBuilder library,
+      NullabilityBuilder nullabilityBuilder, List<TypeBuilder> arguments,
+      [bool notInstanceContext]) {
+    return new FutureOrType(
+        arguments.single.build(library, null, notInstanceContext),
+        nullabilityBuilder.build(library));
+  }
+
+  DartType buildTypesWithBuiltArguments(LibraryBuilder library,
+      Nullability nullability, List<DartType> arguments) {
+    return new FutureOrType(arguments.single, nullability);
+  }
+}
diff --git a/pkg/front_end/lib/src/fasta/builder/nullability_builder.dart b/pkg/front_end/lib/src/fasta/builder/nullability_builder.dart
index 54a2786..4d7b983 100644
--- a/pkg/front_end/lib/src/fasta/builder/nullability_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/nullability_builder.dart
@@ -35,6 +35,8 @@
   const NullabilityBuilder.omitted()
       : _syntacticNullability = SyntacticNullability.omitted;
 
+  bool get isOmitted => _syntacticNullability == SyntacticNullability.omitted;
+
   factory NullabilityBuilder.fromNullability(Nullability nullability) {
     switch (nullability) {
       case Nullability.nullable:
@@ -47,13 +49,10 @@
     }
   }
 
-  Nullability build(LibraryBuilder libraryBuilder, {Nullability ifOmitted}) {
-    // TODO(dmitryas): Ensure that either ifOmitted is set or libraryBuilder is
-    // provided;
-    //assert(libraryBuilder != null || ifOmitted != null);
-    ifOmitted ??= (libraryBuilder == null ? Nullability.legacy : null);
+  Nullability build(LibraryBuilder libraryBuilder) {
+    assert(libraryBuilder != null);
 
-    ifOmitted ??= libraryBuilder.isNonNullableByDefault
+    Nullability ifOmitted = libraryBuilder.isNonNullableByDefault
         ? Nullability.nonNullable
         : Nullability.legacy;
     switch (_syntacticNullability) {
diff --git a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
index f049e93..0e438d5 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
@@ -17,9 +17,11 @@
         getAsTypeArguments;
 
 import 'package:kernel/type_algebra.dart'
-    show FreshTypeParameters, getFreshTypeParameters, substitute;
-
-import 'package:kernel/src/future_or.dart';
+    show
+        FreshTypeParameters,
+        getFreshTypeParameters,
+        substitute,
+        uniteNullabilities;
 
 import '../fasta_codes.dart'
     show
@@ -79,7 +81,7 @@
   bool get fromDill => false;
 
   Typedef build(SourceLibraryBuilder libraryBuilder) {
-    typedef..type ??= buildThisType();
+    typedef.type ??= buildThisType();
 
     TypeBuilder type = this.type;
     if (type is FunctionTypeBuilder) {
@@ -250,8 +252,6 @@
       [bool notInstanceContext]) {
     DartType thisType = buildThisType();
     if (thisType is InvalidType) return thisType;
-    // TODO(dmitryas): Remove the following comment when FutureOr has its own
-    // encoding and isn't represented as an InterfaceType.
 
     // The following won't work if the right-hand side of the typedef is a
     // FutureOr.
@@ -266,7 +266,7 @@
       nullability = nullabilityBuilder.build(library);
     } else {
       nullability = uniteNullabilities(
-          thisType.nullability, nullabilityBuilder.build(library));
+          thisType.declaredNullability, nullabilityBuilder.build(library));
     }
     if (typedef.typeParameters.isEmpty && arguments == null) {
       return thisType.withDeclaredNullability(nullability);
diff --git a/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart
index 8ec76cb..b73ea20 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart
@@ -89,16 +89,22 @@
     }
     // If the bound is not set yet, the actual value is not important yet as it
     // will be set later.
-    Nullability nullabilityIfOmitted = parameter.bound != null &&
-            library != null &&
-            library.isNonNullableByDefault
-        ? TypeParameterType.computeNullabilityFromBound(parameter)
-        : Nullability.legacy;
-    DartType type = buildTypesWithBuiltArguments(
-        library,
-        nullabilityBuilder.build(library, ifOmitted: nullabilityIfOmitted),
-        null);
-    if (parameter.bound == null) {
+    bool needsPostUpdate = false;
+    Nullability nullability;
+    if (nullabilityBuilder.isOmitted) {
+      if (parameter.bound != null) {
+        nullability = library.isNonNullableByDefault
+            ? TypeParameterType.computeNullabilityFromBound(parameter)
+            : Nullability.legacy;
+      } else {
+        nullability = Nullability.legacy;
+        needsPostUpdate = true;
+      }
+    } else {
+      nullability = nullabilityBuilder.build(library);
+    }
+    DartType type = buildTypesWithBuiltArguments(library, nullability, null);
+    if (needsPostUpdate) {
       if (library is SourceLibraryBuilder) {
         library.pendingNullabilities.add(type);
       } else {
diff --git a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
index ecd72f5..abe8522 100644
--- a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
@@ -11,10 +11,9 @@
 
 import 'package:kernel/core_types.dart' show CoreTypes;
 
-import 'package:kernel/type_algebra.dart' show Substitution;
+import 'package:kernel/type_algebra.dart' show Substitution, uniteNullabilities;
 import 'package:kernel/type_environment.dart';
 
-import 'package:kernel/src/future_or.dart';
 import 'package:kernel/src/legacy_erasure.dart';
 import 'package:kernel/src/nnbd_top_merge.dart';
 import 'package:kernel/src/norm.dart';
@@ -331,8 +330,6 @@
 
   final Class futureClass;
 
-  final Class futureOrClass;
-
   final Class functionClass;
 
   final Class nullClass;
@@ -354,7 +351,6 @@
   ClassHierarchyBuilder(this.objectClassBuilder, this.loader, this.coreTypes)
       : objectClass = objectClassBuilder.cls,
         futureClass = coreTypes.futureClass,
-        futureOrClass = coreTypes.futureOrClass,
         functionClass = coreTypes.functionClass,
         nullClass = coreTypes.nullClass {
     types = new Types(this);
@@ -2550,9 +2546,6 @@
   Class get functionClass => hierarchy.functionClass;
 
   @override
-  Class get futureOrClass => hierarchy.futureOrClass;
-
-  @override
   Class get nullClass => hierarchy.nullClass;
 
   @override
diff --git a/pkg/front_end/lib/src/fasta/kernel/collections.dart b/pkg/front_end/lib/src/fasta/kernel/collections.dart
index ce75ae0..7944ba5 100644
--- a/pkg/front_end/lib/src/fasta/kernel/collections.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/collections.dart
@@ -19,6 +19,8 @@
         transformList,
         visitList;
 
+import 'package:kernel/src/printer.dart';
+
 import 'package:kernel/type_environment.dart' show StaticTypeContext;
 
 import 'package:kernel/visitor.dart'
@@ -106,8 +108,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -172,8 +174,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -234,8 +236,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -323,8 +325,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -351,6 +353,16 @@
 
   @override
   R accept<R>(TreeVisitor<R> v) => v.defaultTreeNode(this);
+
+  @override
+  String toStringInternal() => toText(defaultAstTextStrategy);
+
+  @override
+  String toText(AstTextStrategy strategy) {
+    AstPrinter state = new AstPrinter(strategy);
+    toTextInternal(state);
+    return state.getText();
+  }
 }
 
 /// A spread element in a map literal.
@@ -387,8 +399,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -433,8 +445,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -480,8 +492,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -554,8 +566,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
diff --git a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
index 3efb93e..e39ecdb 100644
--- a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
@@ -1899,7 +1899,7 @@
         if (constant is DoubleConstant && intFolder.isInt(constant)) {
           value = new BigInt.from(constant.value).toString();
         } else {
-          value = constant.toString();
+          value = constant.value.toString();
         }
         Object last = concatenated.last;
         if (last is StringBuffer) {
@@ -2677,6 +2677,11 @@
   }
 
   @override
+  bool visitFutureOrType(FutureOrType node) {
+    return node.typeArgument.accept(this);
+  }
+
+  @override
   bool visitFunctionType(FunctionType node) {
     final List<TypeParameter> parameters = node.typeParameters;
     _availableVariables.addAll(parameters);
diff --git a/pkg/front_end/lib/src/fasta/kernel/forest.dart b/pkg/front_end/lib/src/fasta/kernel/forest.dart
index 3716eac..90787ec0 100644
--- a/pkg/front_end/lib/src/fasta/kernel/forest.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/forest.dart
@@ -7,6 +7,7 @@
 import 'dart:core' hide MapEntry;
 
 import 'package:kernel/ast.dart';
+import 'package:kernel/src/printer.dart';
 
 import '../problems.dart' show unsupported;
 
@@ -761,7 +762,14 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    for (int index = 0; index < declarations.length; index++) {
+      if (index > 0) {
+        printer.write(', ');
+      }
+      printer.writeVariableDeclaration(declarations[index],
+          includeModifiersAndType: index == 0);
+    }
+    printer.write(';');
   }
 }
diff --git a/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart b/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
index 77b02bc..e52b549 100644
--- a/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
@@ -10,6 +10,7 @@
 
 import 'package:kernel/src/assumptions.dart';
 import 'package:kernel/src/legacy_erasure.dart';
+import 'package:kernel/src/printer.dart';
 
 import '../builder/field_builder.dart';
 import '../constant_context.dart';
@@ -58,8 +59,8 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('<implicit-field-type:$fieldBuilder>');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('<implicit-field-type:$fieldBuilder>');
   }
 
   void addOverride(ImplicitFieldType other);
diff --git a/pkg/front_end/lib/src/fasta/kernel/implicit_type_argument.dart b/pkg/front_end/lib/src/fasta/kernel/implicit_type_argument.dart
index 065fea3..2ab9dfb 100644
--- a/pkg/front_end/lib/src/fasta/kernel/implicit_type_argument.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/implicit_type_argument.dart
@@ -7,6 +7,7 @@
 import 'package:kernel/ast.dart'
     show DartType, DartTypeVisitor, DartTypeVisitor1, Nullability, Visitor;
 import 'package:kernel/src/assumptions.dart';
+import 'package:kernel/src/printer.dart';
 
 import '../problems.dart' show unhandled, unsupported;
 
@@ -42,15 +43,15 @@
 
   @override
   ImplicitTypeArgument withDeclaredNullability(Nullability nullability) {
-    return unsupported("withNullability", -1, null);
+    return unsupported("withDeclaredNullability", -1, null);
   }
 
   @override
   bool equals(Object other, Assumptions assumptions) => this == other;
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('<implicit-type-argument>');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('<implicit-type-argument>');
   }
 
   @override
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
index bf8815e..d596dfa 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -6,7 +6,6 @@
 
 import 'package:_fe_analyzer_shared/src/util/link.dart';
 import 'package:kernel/ast.dart';
-import 'package:kernel/src/future_or.dart';
 import 'package:kernel/type_algebra.dart' show Substitution;
 import 'package:kernel/type_environment.dart';
 
@@ -2097,17 +2096,17 @@
     bool inferenceNeeded = node.keyType is ImplicitTypeArgument;
     bool typeContextIsMap = node.keyType is! ImplicitTypeArgument;
     bool typeContextIsIterable = false;
+    DartType unfuturedTypeContext =
+        inferrer.typeSchemaEnvironment.unfutureType(typeContext);
     if (!inferrer.isTopLevel && inferenceNeeded) {
       // Ambiguous set/map literal
-      DartType context =
-          inferrer.typeSchemaEnvironment.unfutureType(typeContext);
-      if (context is InterfaceType) {
+      if (unfuturedTypeContext is InterfaceType) {
         typeContextIsMap = typeContextIsMap ||
-            inferrer.classHierarchy
-                .isSubtypeOf(context.classNode, inferrer.coreTypes.mapClass);
-        typeContextIsIterable = typeContextIsIterable ||
             inferrer.classHierarchy.isSubtypeOf(
-                context.classNode, inferrer.coreTypes.iterableClass);
+                unfuturedTypeContext.classNode, inferrer.coreTypes.mapClass);
+        typeContextIsIterable = typeContextIsIterable ||
+            inferrer.classHierarchy.isSubtypeOf(unfuturedTypeContext.classNode,
+                inferrer.coreTypes.iterableClass);
         if (node.entries.isEmpty &&
             typeContextIsIterable &&
             !typeContextIsMap) {
@@ -2157,7 +2156,7 @@
       DartType spreadTypeContext = const UnknownType();
       if (typeContextIsIterable && !typeContextIsMap) {
         spreadTypeContext = inferrer.typeSchemaEnvironment.getTypeAsInstanceOf(
-            typeContext,
+            unfuturedTypeContext,
             inferrer.coreTypes.iterableClass,
             inferrer.library.library,
             inferrer.coreTypes);
@@ -5389,8 +5388,7 @@
         if ((variable.isLate && variable.isFinal) ||
             variable.isLateFinalWithoutInitializer) {
           if (isDefinitelyAssigned &&
-              isPotentiallyNonNullable(
-                  declaredOrInferredType, inferrer.coreTypes.futureOrClass)) {
+              declaredOrInferredType.isPotentiallyNonNullable) {
             return new ExpressionInferenceResult(
                 resultType,
                 inferrer.helper.wrapInProblem(
@@ -5455,7 +5453,7 @@
       result.add(node);
 
       VariableDeclaration isSetVariable;
-      if (isPotentiallyNullable(node.type, inferrer.coreTypes.futureOrClass)) {
+      if (node.type.isPotentiallyNullable) {
         isSetVariable = new VariableDeclaration(
             '${late_lowering.lateLocalPrefix}'
             '${node.name}'
@@ -5631,8 +5629,7 @@
             declaredOrInferredType is! InvalidType) {
           if (variable.isLate || variable.lateGetter != null) {
             if (isDefinitelyUnassigned &&
-                isPotentiallyNonNullable(
-                    declaredOrInferredType, inferrer.coreTypes.futureOrClass)) {
+                declaredOrInferredType.isPotentiallyNonNullable) {
               return new ExpressionInferenceResult(
                   resultType,
                   inferrer.helper.wrapInProblem(
@@ -5644,8 +5641,7 @@
             }
           } else {
             if (isUnassigned &&
-                isPotentiallyNonNullable(
-                    declaredOrInferredType, inferrer.coreTypes.futureOrClass)) {
+                declaredOrInferredType.isPotentiallyNonNullable) {
               return new ExpressionInferenceResult(
                   resultType,
                   inferrer.helper.wrapInProblem(
@@ -5845,9 +5841,7 @@
   void reportNonNullableInNullAwareWarningIfNeeded(
       DartType operandType, String operationName, int offset) {
     if (!inferrer.isTopLevel && inferrer.isNonNullableByDefault) {
-      if (operandType is! InvalidType &&
-          !isPotentiallyNullable(
-              operandType, inferrer.coreTypes.futureOrClass)) {
+      if (operandType is! InvalidType && !operandType.isPotentiallyNullable) {
         inferrer.library.addProblem(
             templateNonNullableInNullAware.withArguments(
                 operationName, operandType, inferrer.isNonNullableByDefault),
diff --git a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
index 0d21e59..991d0cd 100644
--- a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
@@ -22,6 +22,7 @@
 
 import 'package:kernel/ast.dart';
 import 'package:kernel/text/ast_to_text.dart' show Precedence, Printer;
+import 'package:kernel/src/printer.dart';
 import 'package:kernel/core_types.dart';
 
 import '../fasta_codes.dart'
@@ -279,8 +280,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter state) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -326,8 +327,17 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('try ');
+    printer.writeStatement(tryBlock);
+    for (Catch catchBlock in catchBlocks) {
+      printer.write(' ');
+      printer.writeCatch(catchBlock);
+    }
+    if (finallyBlock != null) {
+      printer.write(' finally ');
+      printer.writeStatement(finallyBlock);
+    }
   }
 }
 
@@ -344,11 +354,6 @@
   String toString() {
     return "SwitchCaseImpl(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 class BreakStatementImpl extends BreakStatement {
@@ -365,8 +370,14 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isContinue) {
+      printer.write('continue ');
+    } else {
+      printer.write('break ');
+    }
+    printer.write(printer.getLabelName(target));
+    printer.write(';');
   }
 }
 
@@ -431,6 +442,11 @@
 
   ExpressionInferenceResult acceptInference(
       InferenceVisitor visitor, DartType typeContext);
+
+  @override
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
+  }
 }
 
 /// Front end specific implementation of [Argument].
@@ -500,12 +516,6 @@
   String toString() {
     return "ArgumentsImpl(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    // TODO(jensj): Make (much) better.
-    return "";
-  }
 }
 
 /// Internal expression representing a cascade expression.
@@ -575,8 +585,22 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in cascade {');
+    printer.incIndentation();
+    for (Expression expression in expressions) {
+      printer.newLine();
+      printer.writeExpression(expression);
+      printer.write(';');
+    }
+    printer.decIndentation();
+    if (expressions.isNotEmpty) {
+      printer.newLine();
+    }
+    printer.write('} => ');
+    printer.write(printer.getVariableName(variable));
   }
 }
 
@@ -624,8 +648,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in ');
+    printer.writeExpression(expression);
   }
 }
 
@@ -661,8 +688,19 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isConst) {
+      printer.write('const ');
+    } else {
+      printer.write('new ');
+    }
+    printer.writeClassName(target.enclosingClass.reference);
+    printer.writeTypeArguments(arguments.types);
+    if (target.name.name.isNotEmpty) {
+      printer.write('.');
+      printer.write(target.name.name);
+    }
+    printer.writeArguments(arguments, includeTypeArguments: false);
   }
 }
 
@@ -683,11 +721,6 @@
   String toString() {
     return "FunctionDeclarationImpl(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Concrete shadow object representing a super initializer in kernel form.
@@ -709,11 +742,6 @@
   String toString() {
     return "InvalidSuperInitializerJudgment(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an if-null expression.
@@ -764,8 +792,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(left, minimumPrecedence: Precedence.CONDITIONAL);
+    printer.write(' ?? ');
+    printer.writeExpression(right,
+        minimumPrecedence: Precedence.CONDITIONAL + 1);
   }
 }
 
@@ -822,8 +853,12 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (literal == null) {
+      printer.write('$value');
+    } else {
+      printer.write(literal);
+    }
   }
 }
 
@@ -861,8 +896,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(literal);
   }
 }
 
@@ -880,11 +915,6 @@
   String toString() {
     return "ShadowInvalidInitializer(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Concrete shadow object representing an invalid initializer in kernel form.
@@ -908,11 +938,6 @@
   String toString() {
     return "ShadowInvalidFieldInitializer(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 class ExpressionInvocation extends InternalExpression {
@@ -958,8 +983,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(expression);
+    printer.writeArguments(arguments);
   }
 }
 
@@ -987,11 +1013,6 @@
   String toString() {
     return "NamedFunctionExpressionJudgment(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing a null-aware method invocation.
@@ -1046,8 +1067,24 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    Expression methodInvocation = invocation;
+    if (methodInvocation is MethodInvocation) {
+      Expression receiver = methodInvocation.receiver;
+      if (receiver is VariableGet && receiver.variable == variable) {
+        // Special-case the usual use of this node.
+        printer.writeExpression(variable.initializer);
+        printer.write('?.');
+        printer.writeInterfaceMemberName(
+            methodInvocation.interfaceTargetReference, methodInvocation.name);
+        printer.writeArguments(methodInvocation.arguments);
+        return;
+      }
+    }
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in null-aware ');
+    printer.writeExpression(methodInvocation);
   }
 }
 
@@ -1103,8 +1140,23 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    Expression propertyGet = read;
+    if (propertyGet is PropertyGet) {
+      Expression receiver = propertyGet.receiver;
+      if (receiver is VariableGet && receiver.variable == variable) {
+        // Special-case the usual use of this node.
+        printer.writeExpression(variable.initializer);
+        printer.write('?.');
+        printer.writeInterfaceMemberName(
+            propertyGet.interfaceTargetReference, propertyGet.name);
+        return;
+      }
+    }
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in null-aware ');
+    printer.writeExpression(propertyGet);
   }
 }
 
@@ -1160,8 +1212,25 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    Expression propertySet = write;
+    if (propertySet is PropertySet) {
+      Expression receiver = propertySet.receiver;
+      if (receiver is VariableGet && receiver.variable == variable) {
+        // Special-case the usual use of this node.
+        printer.writeExpression(variable.initializer);
+        printer.write('?.');
+        printer.writeInterfaceMemberName(
+            propertySet.interfaceTargetReference, propertySet.name);
+        printer.write(' = ');
+        printer.writeExpression(propertySet.value);
+        return;
+      }
+    }
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in null-aware ');
+    printer.writeExpression(propertySet);
   }
 }
 
@@ -1178,8 +1247,17 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isArrow) {
+      printer.write('=>');
+    } else {
+      printer.write('return');
+    }
+    if (expression != null) {
+      printer.write(' ');
+      printer.writeExpression(expression);
+    }
+    printer.write(';');
   }
 }
 
@@ -1351,6 +1429,13 @@
   // This is set in `InferenceVisitor.visitVariableDeclaration` when late
   // lowering is enabled.
   DartType lateType;
+
+  @override
+  void toTextInternal(AstPrinter printer) {
+    printer.writeVariableDeclaration(this,
+        isLate: isLate || lateGetter != null, type: lateType ?? type);
+    printer.write(';');
+  }
 }
 
 /// Front end specific implementation of [VariableGet].
@@ -1372,11 +1457,6 @@
   String toString() {
     return "VariableGetImpl(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Front end specific implementation of [LoadLibrary].
@@ -1391,8 +1471,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(import.name);
+    printer.write('.loadLibrary');
+    printer.writeArguments(arguments);
   }
 }
 
@@ -1434,8 +1516,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(import.name);
+    printer.write('.loadLibrary');
   }
 }
 
@@ -1508,8 +1591,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in if-null ');
+    printer.writeExpression(read);
+    printer.write(' ?? ');
+    printer.writeExpression(write);
   }
 }
 
@@ -1573,8 +1661,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(read);
+    printer.write(' ?? ');
+    printer.writeExpression(write);
   }
 }
 
@@ -1698,11 +1788,6 @@
   String toString() {
     return "CompoundExtensionSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an compound property assignment.
@@ -1792,11 +1877,6 @@
   String toString() {
     return "CompoundPropertySet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an compound property assignment.
@@ -1862,11 +1942,6 @@
   String toString() {
     return "PropertyPostIncDec(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an local variable post inc/dec expression.
@@ -1920,11 +1995,6 @@
   String toString() {
     return "LocalPostIncDec(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an static member post inc/dec expression.
@@ -1978,11 +2048,6 @@
   String toString() {
     return "StaticPostIncDec(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an static member post inc/dec expression.
@@ -2036,11 +2101,6 @@
   String toString() {
     return "SuperPostIncDec(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an index get expression.
@@ -2087,11 +2147,6 @@
   String toString() {
     return "IndexGet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an index set expression.
@@ -2166,11 +2221,6 @@
   String toString() {
     return "IndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing a  super index set expression.
@@ -2232,11 +2282,6 @@
   String toString() {
     return "SuperIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an extension index set expression.
@@ -2322,11 +2367,6 @@
   String toString() {
     return "ExtensionIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an if-null index assignment.
@@ -2429,11 +2469,6 @@
   String toString() {
     return "IfNullIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an if-null super index set expression.
@@ -2521,11 +2556,6 @@
   String toString() {
     return "IfNullSuperIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an if-null super index set expression.
@@ -2639,11 +2669,6 @@
   String toString() {
     return "IfNullExtensionIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing a compound index assignment.
@@ -2742,11 +2767,6 @@
   String toString() {
     return "CompoundIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing a null-aware compound assignment.
@@ -2859,11 +2879,6 @@
   String toString() {
     return "NullAwareCompoundSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an null-aware if-null property set.
@@ -2951,11 +2966,6 @@
   String toString() {
     return "NullAwareIfNullSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing a compound super index assignment.
@@ -3047,11 +3057,6 @@
   String toString() {
     return "CompoundSuperIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing a compound extension index assignment.
@@ -3180,11 +3185,6 @@
   String toString() {
     return "CompoundExtensionIndexSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an assignment to an extension setter.
@@ -3272,11 +3272,6 @@
   String toString() {
     return "ExtensionSet(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression representing an null-aware extension expression.
@@ -3328,11 +3323,6 @@
   String toString() {
     return "NullAwareExtension(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Front end specific implementation of [PropertySet].
@@ -3353,11 +3343,6 @@
   String toString() {
     return "PropertySetImpl(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal representation of a read of an extension instance member.
@@ -3409,11 +3394,6 @@
   String toString() {
     return "ExtensionTearOff(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression for an equals or not-equals expression.
@@ -3459,11 +3439,6 @@
   String toString() {
     return "EqualsExpression(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression for a binary expression.
@@ -3508,11 +3483,6 @@
   String toString() {
     return "BinaryExpression(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression for a unary expression.
@@ -3550,11 +3520,6 @@
   String toString() {
     return "UnaryExpression(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Internal expression for a parenthesized expression.
@@ -3591,11 +3556,6 @@
   String toString() {
     return "ParenthesizedExpression(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 /// Creates a [Let] of [variable] with the given [body] using
diff --git a/pkg/front_end/lib/src/fasta/kernel/invalid_type.dart b/pkg/front_end/lib/src/fasta/kernel/invalid_type.dart
index 7e474a3..d6bbd9a 100644
--- a/pkg/front_end/lib/src/fasta/kernel/invalid_type.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/invalid_type.dart
@@ -48,6 +48,11 @@
   }
 
   @override
+  bool visitFutureOrType(FutureOrType node, Set<TypedefType> visitedTypedefs) {
+    return node.typeArgument.accept1(this, visitedTypedefs);
+  }
+
+  @override
   bool visitNeverType(NeverType node, Set<TypedefType> visitedTypedefs) =>
       false;
 
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index 440a118..0755e0d 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -48,7 +48,6 @@
 
 import 'package:kernel/reference_from_index.dart' show IndexedClass;
 
-import 'package:kernel/src/future_or.dart';
 import 'package:kernel/type_algebra.dart' show substitute;
 import 'package:kernel/target/changed_structure_notifier.dart'
     show ChangedStructureNotifier;
@@ -975,8 +974,7 @@
                   fieldBuilder.fileUri);
             }
           } else if (fieldBuilder.fieldType is! InvalidType &&
-              isPotentiallyNonNullable(
-                  fieldBuilder.fieldType, loader.coreTypes.futureOrClass) &&
+              fieldBuilder.fieldType.isPotentiallyNonNullable &&
               (cls.constructors.isNotEmpty || cls.isMixinDeclaration)) {
             SourceLibraryBuilder library = builder.library;
             if (library.isNonNullableByDefault) {
@@ -1019,10 +1017,9 @@
                       .withLocation(fieldBuilder.fileUri,
                           fieldBuilder.charOffset, fieldBuilder.name.length)
                 ]);
-          } else if (fieldBuilder.type is! InvalidType &&
+          } else if (fieldBuilder.field.type is! InvalidType &&
               !fieldBuilder.isLate &&
-              isPotentiallyNonNullable(
-                  fieldBuilder.field.type, loader.coreTypes.futureOrClass)) {
+              fieldBuilder.field.type.isPotentiallyNonNullable) {
             SourceLibraryBuilder library = builder.library;
             if (library.isNonNullableByDefault) {
               library.addProblem(
diff --git a/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart b/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart
index f2fab9d..9cfb1fc 100644
--- a/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart
@@ -4,7 +4,6 @@
 
 import 'package:kernel/ast.dart' hide MapEntry;
 import 'package:kernel/core_types.dart';
-import 'package:kernel/src/future_or.dart';
 
 import '../names.dart';
 
@@ -28,7 +27,7 @@
     Expression createVariableWrite(Expression value),
     Expression createIsSetRead(),
     Expression createIsSetWrite(Expression value)}) {
-  if (isPotentiallyNullable(type, coreTypes.futureOrClass)) {
+  if (type.isPotentiallyNullable) {
     // Generate:
     //
     //    if (!_#isSet#field) {
@@ -55,9 +54,7 @@
           // If [type] is a type variable with undetermined nullability we need
           // to create a read of the field that is promoted to the type variable
           // type.
-          createVariableRead(
-              needsPromotion:
-                  isPotentiallyNonNullable(type, coreTypes.futureOrClass)))
+          createVariableRead(needsPromotion: type.isPotentiallyNonNullable))
         ..fileOffset = fileOffset
     ])
       ..fileOffset = fileOffset;
@@ -122,7 +119,7 @@
   VariableDeclaration temp =
       new VariableDeclaration.forValue(initializer, type: type)
         ..fileOffset = fileOffset;
-  if (isPotentiallyNullable(type, coreTypes.futureOrClass)) {
+  if (type.isPotentiallyNullable) {
     // Generate:
     //
     //    if (!_#isSet#field) {
@@ -159,9 +156,7 @@
           // If [type] is a type variable with undetermined nullability we need
           // to create a read of the field that is promoted to the type variable
           // type.
-          createVariableRead(
-              needsPromotion:
-                  isPotentiallyNonNullable(type, coreTypes.futureOrClass)))
+          createVariableRead(needsPromotion: type.isPotentiallyNonNullable))
         ..fileOffset = fileOffset
     ])
       ..fileOffset = fileOffset;
@@ -229,16 +224,14 @@
         ..fileOffset = fileOffset)
     ..fileOffset = fileOffset)
     ..fileOffset = fileOffset;
-  if (isPotentiallyNullable(type, coreTypes.futureOrClass)) {
+  if (type.isPotentiallyNullable) {
     // Generate:
     //
     //    return _#isSet#field ? _#field : throw '...';
     return new ReturnStatement(
         new ConditionalExpression(
             createIsSetRead()..fileOffset = fileOffset,
-            createVariableRead(
-                needsPromotion:
-                    isPotentiallyNonNullable(type, coreTypes.futureOrClass))
+            createVariableRead(needsPromotion: type.isPotentiallyNonNullable)
               ..fileOffset = fileOffset,
             exception,
             type)
@@ -292,7 +285,7 @@
       createVariableWrite(new VariableGet(parameter)..fileOffset = fileOffset)
         ..fileOffset = fileOffset);
 
-  if (isPotentiallyNullable(type, coreTypes.futureOrClass)) {
+  if (type.isPotentiallyNullable) {
     // Generate:
     //
     //    _#isSet#field = true;
@@ -348,7 +341,7 @@
     }
   }
 
-  if (isPotentiallyNullable(type, coreTypes.futureOrClass)) {
+  if (type.isPotentiallyNullable) {
     // Generate:
     //
     //    if (_#isSet#field) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart b/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart
index 643e2e0..3716204 100644
--- a/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart
@@ -9,6 +9,7 @@
         DartTypeVisitor,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         InvalidType,
         NamedType,
@@ -1024,6 +1025,10 @@
     return anyTypeVariables(node.typeArguments);
   }
 
+  bool visitFutureOrType(FutureOrType node) {
+    return node.typeArgument.accept(this);
+  }
+
   bool visitFunctionType(FunctionType node) {
     if (anyTypeVariables(node.positionalParameters)) return true;
     for (TypeParameter variable in node.typeParameters) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/type_builder_computer.dart b/pkg/front_end/lib/src/fasta/kernel/type_builder_computer.dart
index 4368752..2d362e8 100644
--- a/pkg/front_end/lib/src/fasta/kernel/type_builder_computer.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/type_builder_computer.dart
@@ -15,6 +15,7 @@
         DartTypeVisitor,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         InvalidType,
         Library,
@@ -29,6 +30,7 @@
 import '../builder/dynamic_type_builder.dart';
 import '../builder/formal_parameter_builder.dart';
 import '../builder/function_type_builder.dart';
+import '../builder/future_or_type_builder.dart';
 import '../builder/library_builder.dart';
 import '../builder/named_type_builder.dart';
 import '../builder/never_type_builder.dart';
@@ -44,14 +46,17 @@
 
   const TypeBuilderComputer(this.loader);
 
+  @override
   TypeBuilder defaultDartType(DartType node) {
     throw "Unsupported";
   }
 
+  @override
   TypeBuilder visitInvalidType(InvalidType node) {
     throw "Not implemented";
   }
 
+  @override
   TypeBuilder visitDynamicType(DynamicType node) {
     // 'dynamic' is always nullable.
     return new NamedTypeBuilder(
@@ -60,6 +65,7 @@
           new DynamicTypeBuilder(const DynamicType(), loader.coreLibrary, -1));
   }
 
+  @override
   TypeBuilder visitVoidType(VoidType node) {
     // 'void' is always nullable.
     return new NamedTypeBuilder(
@@ -67,16 +73,19 @@
       ..bind(new VoidTypeBuilder(const VoidType(), loader.coreLibrary, -1));
   }
 
+  @override
   TypeBuilder visitBottomType(BottomType node) {
     throw "Not implemented";
   }
 
+  @override
   TypeBuilder visitNeverType(NeverType node) {
     return new NamedTypeBuilder(
         "Never", new NullabilityBuilder.fromNullability(node.nullability), null)
       ..bind(new NeverTypeBuilder(node, loader.coreLibrary, -1));
   }
 
+  @override
   TypeBuilder visitInterfaceType(InterfaceType node) {
     ClassBuilder cls =
         loader.computeClassBuilderFromTargetClass(node.classNode);
@@ -94,6 +103,14 @@
   }
 
   @override
+  TypeBuilder visitFutureOrType(FutureOrType node) {
+    TypeBuilder argument = node.typeArgument.accept(this);
+    return new NamedTypeBuilder("FutureOr",
+        new NullabilityBuilder.fromNullability(node.nullability), [argument])
+      ..bind(new FutureOrTypeBuilder(node, loader.coreLibrary, -1));
+  }
+
+  @override
   TypeBuilder visitFunctionType(FunctionType node) {
     TypeBuilder returnType = node.returnType.accept(this);
     // We could compute the type variables here. However, the current
diff --git a/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart b/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart
index e8d844c..d6682d4 100644
--- a/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart
@@ -16,6 +16,7 @@
         DynamicType,
         Field,
         FunctionType,
+        FutureOrType,
         InvalidType,
         InstanceConstant,
         IntConstant,
@@ -264,26 +265,36 @@
     addNullability(node.nullability);
   }
 
+  void visitFutureOrType(FutureOrType node) {
+    result.add("FutureOr<");
+    node.typeArgument.accept(this);
+    result.add(">");
+    addNullability(node.declaredNullability);
+  }
+
   void defaultConstant(Constant node) {}
 
   void visitNullConstant(NullConstant node) {
-    result.add(node);
+    result.add('${node.value}');
   }
 
   void visitBoolConstant(BoolConstant node) {
-    result.add(node);
+    result.add('${node.value}');
   }
 
   void visitIntConstant(IntConstant node) {
-    result.add(node);
+    result.add('${node.value}');
   }
 
   void visitDoubleConstant(DoubleConstant node) {
-    result.add(node);
+    result.add('${node.value}');
   }
 
   void visitSymbolConstant(SymbolConstant node) {
-    result.add(node);
+    String text = node.libraryReference != null
+        ? '#${node.libraryReference.asLibrary.importUri}::${node.name}'
+        : '#${node.name}';
+    result.add(text);
   }
 
   void visitStringConstant(StringConstant node) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/verifier.dart b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
index fc54be6..f17aaef 100644
--- a/pkg/front_end/lib/src/fasta/kernel/verifier.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
@@ -263,12 +263,6 @@
     return false;
   }
 
-  bool isFutureOrClass(Class c) {
-    return c.name == "FutureOr" &&
-        c.enclosingLibrary.importUri.scheme == "dart" &&
-        c.enclosingLibrary.importUri.path == "async";
-  }
-
   bool isObjectClass(Class c) {
     return c.name == "Object" &&
         c.enclosingLibrary.importUri.scheme == "dart" &&
@@ -282,16 +276,12 @@
             isObjectClass(node.classNode) &&
             (node.nullability == Nullability.nullable ||
                 node.nullability == Nullability.legacy) ||
-        node is InterfaceType &&
-            isFutureOrClass(node.classNode) &&
-            isTopType(node.typeArguments.single);
+        node is FutureOrType && isTopType(node.typeArgument);
   }
 
   bool isFutureOrNull(DartType node) {
     return isNullType(node) ||
-        node is InterfaceType &&
-            isFutureOrClass(node.classNode) &&
-            isFutureOrNull(node.typeArguments.single);
+        node is FutureOrType && isFutureOrNull(node.typeArgument);
   }
 
   @override
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 98fea49..e6fa5c6 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -66,8 +66,6 @@
         findTypeArgumentIssuesForInvocation,
         getGenericTypeName;
 
-import 'package:kernel/src/future_or.dart';
-
 import 'package:kernel/type_algebra.dart' show substitute;
 
 import 'package:kernel/type_environment.dart'
@@ -3046,7 +3044,7 @@
           !fieldBuilder.isLate &&
           !fieldBuilder.isExternal &&
           fieldType is! InvalidType &&
-          isPotentiallyNonNullable(fieldType, typeEnvironment.futureOrClass) &&
+          fieldType.isPotentiallyNonNullable &&
           !fieldBuilder.hasInitializer) {
         addProblem(
             templateFieldNonNullableWithoutInitializerError.withArguments(
@@ -3069,8 +3067,7 @@
       bool isOptionalNamed = !formal.isNamedRequired && formal.isNamed;
       bool isOptional = isOptionalPositional || isOptionalNamed;
       if (isOptional &&
-          isPotentiallyNonNullable(
-              formal.variable.type, typeEnvironment.futureOrClass) &&
+          formal.variable.type.isPotentiallyNonNullable &&
           !formal.hasDeclaredInitializer) {
         addProblem(
             templateOptionalNonNullableWithoutInitializerError.withArguments(
diff --git a/pkg/front_end/lib/src/fasta/type_inference/factor_type.dart b/pkg/front_end/lib/src/fasta/type_inference/factor_type.dart
index c72ca48..572423e 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/factor_type.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/factor_type.dart
@@ -16,7 +16,7 @@
 
   // * Else if T is R? and Null <: S then factor(R, S)
   // * Else if T is R? then factor(R, S)?
-  if (T.nullability == Nullability.nullable) {
+  if (T.declaredNullability == Nullability.nullable) {
     DartType R = T.withDeclaredNullability(Nullability.nonNullable);
     if (identical(R, T)) {
       return T;
@@ -32,7 +32,7 @@
 
   // * Else if T is R* and Null <: S then factor(R, S)
   // * Else if T is R* then factor(R, S)*
-  if (T.nullability == Nullability.legacy) {
+  if (T.declaredNullability == Nullability.legacy) {
     DartType R = T.withDeclaredNullability(Nullability.nonNullable);
     DartType factor_RS = factorType(typeEnvironment, R, S);
     if (typeEnvironment.isSubtypeOf(
@@ -45,8 +45,8 @@
 
   // * Else if T is FutureOr<R> and Future<R> <: S then factor(R, S)
   // * Else if T is FutureOr<R> and R <: S then factor(Future<R>, S)
-  if (T is InterfaceType && T.classNode == typeEnvironment.futureOrClass) {
-    DartType R = T.typeArguments[0];
+  if (T is FutureOrType) {
+    DartType R = T.typeArgument;
     DartType future_R = typeEnvironment.futureType(R, Nullability.nonNullable);
     if (typeEnvironment.isSubtypeOf(
         future_R, S, SubtypeCheckMode.withNullabilities)) {
diff --git a/pkg/front_end/lib/src/fasta/type_inference/standard_bounds.dart b/pkg/front_end/lib/src/fasta/type_inference/standard_bounds.dart
index 30fe070..a8a9bf4 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/standard_bounds.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/standard_bounds.dart
@@ -12,6 +12,7 @@
         DartType,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         InvalidType,
         Library,
@@ -29,8 +30,6 @@
 
 import 'package:kernel/type_environment.dart';
 
-import 'package:kernel/src/future_or.dart';
-
 import 'package:kernel/src/legacy_erasure.dart';
 
 import 'type_schema.dart' show UnknownType;
@@ -70,83 +69,81 @@
     // MORETOP(Object, T) = true.
     if (s is InterfaceType &&
         s.classNode == coreTypes.objectClass &&
-        s.nullability == Nullability.nonNullable) {
+        s.declaredNullability == Nullability.nonNullable) {
       return true;
     }
 
     // MORETOP(S, Object) = false.
     if (t is InterfaceType &&
         t.classNode == coreTypes.objectClass &&
-        t.nullability == Nullability.nonNullable) {
+        t.declaredNullability == Nullability.nonNullable) {
       return false;
     }
 
     // MORETOP(S*, T*) = MORETOP(S, T).
-    if (s.nullability == Nullability.legacy &&
-        t.nullability == Nullability.legacy) {
+    if (s.declaredNullability == Nullability.legacy &&
+        t.declaredNullability == Nullability.legacy) {
       DartType nonNullableS =
           s.withDeclaredNullability(Nullability.nonNullable);
-      assert(s != nonNullableS);
+      assert(!identical(s, nonNullableS));
       DartType nonNullableT =
           t.withDeclaredNullability(Nullability.nonNullable);
-      assert(t != nonNullableT);
+      assert(!identical(t, nonNullableT));
       return moretop(nonNullableS, nonNullableT);
     }
 
     // MORETOP(S, T*) = true.
-    if (s.nullability == Nullability.nonNullable &&
-        t.nullability == Nullability.legacy) {
+    if (s.declaredNullability == Nullability.nonNullable &&
+        t.declaredNullability == Nullability.legacy) {
       return true;
     }
 
     // MORETOP(S*, T) = false.
-    if (s.nullability == Nullability.legacy &&
-        t.nullability == Nullability.nonNullable) {
+    if (s.declaredNullability == Nullability.legacy &&
+        t.declaredNullability == Nullability.nonNullable) {
       return false;
     }
 
     // MORETOP(S?, T?) == MORETOP(S, T).
-    if (s.nullability == Nullability.nullable &&
-        t.nullability == Nullability.nullable) {
+    if (s.declaredNullability == Nullability.nullable &&
+        t.declaredNullability == Nullability.nullable) {
       DartType nonNullableS =
           s.withDeclaredNullability(Nullability.nonNullable);
-      assert(s != nonNullableS);
+      assert(!identical(s, nonNullableS));
       DartType nonNullableT =
           t.withDeclaredNullability(Nullability.nonNullable);
-      assert(t != nonNullableT);
+      assert(!identical(t, nonNullableT));
       return moretop(nonNullableS, nonNullableT);
     }
 
     // MORETOP(S, T?) = true.
-    if (s.nullability == Nullability.nonNullable &&
-        t.nullability == Nullability.nullable) {
+    if (s.declaredNullability == Nullability.nonNullable &&
+        t.declaredNullability == Nullability.nullable) {
       return true;
     }
 
     // MORETOP(S?, T) = false.
-    if (s.nullability == Nullability.nullable &&
-        t.nullability == Nullability.nonNullable) {
+    if (s.declaredNullability == Nullability.nullable &&
+        t.declaredNullability == Nullability.nonNullable) {
       return false;
     }
 
     // TODO(dmitryas): Update the following after the spec is updated.
-    if (s.nullability == Nullability.nullable &&
-        t.nullability == Nullability.legacy) {
+    if (s.declaredNullability == Nullability.nullable &&
+        t.declaredNullability == Nullability.legacy) {
       return true;
     }
-    if (s.nullability == Nullability.legacy &&
-        t.nullability == Nullability.nullable) {
+    if (s.declaredNullability == Nullability.legacy &&
+        t.declaredNullability == Nullability.nullable) {
       return false;
     }
 
     // MORETOP(FutureOr<S>, FutureOr<T>) = MORETOP(S, T).
-    if (s is InterfaceType &&
-        s.classNode == coreTypes.futureOrClass &&
-        s.nullability == Nullability.nonNullable &&
-        t is InterfaceType &&
-        t.classNode == coreTypes.futureOrClass &&
-        t.nullability == Nullability.nonNullable) {
-      return moretop(s.typeArguments.single, t.typeArguments.single);
+    if (s is FutureOrType &&
+        s.declaredNullability == Nullability.nonNullable &&
+        t is FutureOrType &&
+        t.declaredNullability == Nullability.nonNullable) {
+      return moretop(s.typeArgument, t.typeArgument);
     }
 
     return internalProblem(
@@ -164,12 +161,12 @@
     assert(coreTypes.isBottom(t) || coreTypes.isNull(t));
 
     // MOREBOTTOM(Never, T) = true.
-    if (s is NeverType && s.nullability == Nullability.nonNullable) {
+    if (s is NeverType && s.declaredNullability == Nullability.nonNullable) {
       return true;
     }
 
     // MOREBOTTOM(S, Never) = false.
-    if (t is NeverType && t.nullability == Nullability.nonNullable) {
+    if (t is NeverType && t.declaredNullability == Nullability.nonNullable) {
       return false;
     }
 
@@ -184,8 +181,8 @@
     }
 
     // MOREBOTTOM(S?, T?) = MOREBOTTOM(S, T).
-    if (t.nullability == Nullability.nullable &&
-        s.nullability == Nullability.nullable) {
+    if (t.declaredNullability == Nullability.nullable &&
+        s.declaredNullability == Nullability.nullable) {
       DartType nonNullableS =
           s.withDeclaredNullability(Nullability.nonNullable);
       assert(s != nonNullableS);
@@ -196,20 +193,20 @@
     }
 
     // MOREBOTTOM(S, T?) = true.
-    if (s.nullability == Nullability.nonNullable &&
-        t.nullability == Nullability.nullable) {
+    if (s.declaredNullability == Nullability.nonNullable &&
+        t.declaredNullability == Nullability.nullable) {
       return true;
     }
 
     // MOREBOTTOM(S?, T) = false.
-    if (s.nullability == Nullability.nullable &&
-        t.nullability == Nullability.nonNullable) {
+    if (s.declaredNullability == Nullability.nullable &&
+        t.declaredNullability == Nullability.nonNullable) {
       return false;
     }
 
-    // MOREBOTTOM(S*, T*) = MOREBOTTOM(S, T).
-    if (s.nullability == Nullability.legacy &&
-        t.nullability == Nullability.legacy) {
+    // MOREBOTTOM(S*, T*) = MOREBOTTOM(S, T)
+    if (s.declaredNullability == Nullability.legacy &&
+        t.declaredNullability == Nullability.legacy) {
       DartType nonNullableS =
           s.withDeclaredNullability(Nullability.nonNullable);
       assert(s != nonNullableS);
@@ -220,24 +217,24 @@
     }
 
     // MOREBOTTOM(S, T*) = true.
-    if (s.nullability == Nullability.nonNullable &&
-        t.nullability == Nullability.legacy) {
+    if (s.declaredNullability == Nullability.nonNullable &&
+        t.declaredNullability == Nullability.legacy) {
       return true;
     }
 
     // MOREBOTTOM(S*, T) = false.
-    if (s.nullability == Nullability.legacy &&
-        t.nullability == Nullability.nonNullable) {
+    if (s.declaredNullability == Nullability.legacy &&
+        t.declaredNullability == Nullability.nonNullable) {
       return false;
     }
 
     // TODO(dmitryas): Update the following after the spec is updated.
-    if (s.nullability == Nullability.nullable &&
-        t.nullability == Nullability.legacy) {
+    if (s.declaredNullability == Nullability.nullable &&
+        t.declaredNullability == Nullability.legacy) {
       return true;
     }
-    if (s.nullability == Nullability.legacy &&
-        t.nullability == Nullability.nullable) {
+    if (s.declaredNullability == Nullability.legacy &&
+        t.declaredNullability == Nullability.nullable) {
       return false;
     }
 
@@ -340,16 +337,14 @@
       if (coreTypes.isNull(type2)) {
         return morebottom(type1, type2) ? type1 : type2;
       }
-      Nullability type2Nullability =
-          computeNullability(type2, coreTypes.futureOrClass);
+      Nullability type2Nullability = type2.declaredNullability;
       if (type2Nullability == Nullability.legacy ||
           type2Nullability == Nullability.nullable) {
         return type1;
       }
       return const NeverType(Nullability.nonNullable);
     } else if (coreTypes.isNull(type2)) {
-      Nullability type1Nullability =
-          computeNullability(type1, coreTypes.futureOrClass);
+      Nullability type1Nullability = type1.declaredNullability;
       if (type1Nullability == Nullability.legacy ||
           type1Nullability == Nullability.nullable) {
         return type2;
@@ -372,26 +367,20 @@
       if (coreTypes.isObject(type2)) {
         return moretop(type2, type1) ? type1 : type2;
       }
-      Nullability type2Nullability =
-          computeNullability(type2, coreTypes.futureOrClass);
-      if (type2Nullability == Nullability.nonNullable) {
+      if (type2.declaredNullability == Nullability.nonNullable) {
         return type2;
       }
       type2 = type2.withDeclaredNullability(Nullability.nonNullable);
-      type2Nullability = computeNullability(type2, coreTypes.futureOrClass);
-      if (type2Nullability == Nullability.nonNullable) {
+      if (type2.declaredNullability == Nullability.nonNullable) {
         return type2;
       }
       return const NeverType(Nullability.nonNullable);
     } else if (coreTypes.isObject(type2)) {
-      Nullability type1Nullability =
-          computeNullability(type1, coreTypes.futureOrClass);
-      if (type1Nullability == Nullability.nonNullable) {
+      if (type1.declaredNullability == Nullability.nonNullable) {
         return type1;
       }
       type1 = type1.withDeclaredNullability(Nullability.nonNullable);
-      type1Nullability = computeNullability(type1, coreTypes.futureOrClass);
-      if (type1Nullability == Nullability.nonNullable) {
+      if (type1.declaredNullability == Nullability.nonNullable) {
         return type1;
       }
       return const NeverType(Nullability.nonNullable);
@@ -424,70 +413,63 @@
         type1.withDeclaredNullability(Nullability.nonNullable);
     DartType nonNullableType2 =
         type2.withDeclaredNullability(Nullability.nonNullable);
-
     if (isSubtypeOf(nonNullableType1, nonNullableType2,
         SubtypeCheckMode.withNullabilities)) {
-      return type1.withDeclaredNullability(
-          intersectNullabilities(type1.nullability, type2.nullability));
+      return type1.withDeclaredNullability(intersectNullabilities(
+          type1.declaredNullability, type2.declaredNullability));
     }
     if (isSubtypeOf(nonNullableType2, nonNullableType1,
         SubtypeCheckMode.withNullabilities)) {
-      return type2.withDeclaredNullability(
-          intersectNullabilities(type1.nullability, type2.nullability));
+      return type2.withDeclaredNullability(intersectNullabilities(
+          type1.declaredNullability, type2.declaredNullability));
     }
 
     // See https://github.com/dart-lang/sdk/issues/37439#issuecomment-519654959.
-    if (type1 is InterfaceType && type1.classNode == coreTypes.futureOrClass) {
-      if (type2 is InterfaceType) {
-        if (type2.classNode == coreTypes.futureOrClass) {
-          // GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>
-          DartType argument = getStandardLowerBound(
-              type1.typeArguments[0], type2.typeArguments[0], clientLibrary);
-          return new InterfaceType(coreTypes.futureOrClass,
-              argument.nullability, <DartType>[argument]);
-        }
-        if (type2.classNode == coreTypes.futureClass) {
-          // GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>
-          return new InterfaceType(
-              coreTypes.futureClass,
-              intersectNullabilities(
-                  computeNullabilityOfFutureOr(type1, coreTypes.futureOrClass),
-                  type2.nullability),
-              <DartType>[
-                getStandardLowerBound(type1.typeArguments[0],
-                    type2.typeArguments[0], clientLibrary)
-              ]);
-        }
+    if (type1 is FutureOrType) {
+      if (type2 is FutureOrType) {
+        // GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>
+        DartType argument = getStandardLowerBound(
+            type1.typeArgument, type2.typeArgument, clientLibrary);
+        return new FutureOrType(argument, argument.declaredNullability);
+      }
+      if (type2 is InterfaceType && type2.classNode == coreTypes.futureClass) {
+        // GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>
+        return new InterfaceType(
+            coreTypes.futureClass,
+            intersectNullabilities(
+                type1.declaredNullability, type2.declaredNullability),
+            <DartType>[
+              getStandardLowerBound(
+                  type1.typeArgument, type2.typeArguments[0], clientLibrary)
+            ]);
       }
       // GLB(FutureOr<A>, B) == GLB(A, B)
-      return getStandardLowerBound(
-          type1.typeArguments[0], type2, clientLibrary);
+      return getStandardLowerBound(type1.typeArgument, type2, clientLibrary);
     }
     // The if-statement below handles the following rule:
     //     GLB(A, FutureOr<B>) ==  GLB(FutureOr<B>, A)
     // It's broken down into sub-cases instead of making a recursive call to
     // avoid making the checks that were already made above.  Note that at this
     // point it's not possible for type1 to be a FutureOr.
-    if (type2 is InterfaceType && type2.classNode == coreTypes.futureOrClass) {
+    if (type2 is FutureOrType) {
       if (type1 is InterfaceType && type1.classNode == coreTypes.futureClass) {
         // GLB(Future<A>, FutureOr<B>) == Future<GLB(B, A)>
         return new InterfaceType(
             coreTypes.futureClass,
-            intersectNullabilities(type1.nullability,
-                computeNullabilityOfFutureOr(type2, coreTypes.futureOrClass)),
+            intersectNullabilities(
+                type1.declaredNullability, type2.declaredNullability),
             <DartType>[
               getStandardLowerBound(
-                  type2.typeArguments[0], type1.typeArguments[0], clientLibrary)
+                  type2.typeArgument, type1.typeArguments[0], clientLibrary)
             ]);
       }
       // GLB(A, FutureOr<B>) == GLB(B, A)
-      return getStandardLowerBound(
-          type2.typeArguments[0], type1, clientLibrary);
+      return getStandardLowerBound(type2.typeArgument, type1, clientLibrary);
     }
 
     // DOWN(T1, T2) = Never otherwise.
-    return new NeverType(
-        intersectNullabilities(type1.nullability, type2.nullability));
+    return new NeverType(intersectNullabilities(
+        type1.declaredNullability, type2.declaredNullability));
   }
 
   DartType _getNullabilityObliviousStandardLowerBound(
@@ -564,52 +546,46 @@
     }
 
     // See https://github.com/dart-lang/sdk/issues/37439#issuecomment-519654959.
-    if (type1 is InterfaceType && type1.classNode == coreTypes.futureOrClass) {
-      if (type2 is InterfaceType) {
-        if (type2.classNode == coreTypes.futureOrClass) {
-          // GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>
-          DartType argument = getStandardLowerBound(
-              type1.typeArguments[0], type2.typeArguments[0], clientLibrary);
-          return new InterfaceType(coreTypes.futureOrClass,
-              argument.nullability, <DartType>[argument]);
-        }
-        if (type2.classNode == coreTypes.futureClass) {
-          // GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>
-          return new InterfaceType(
-              coreTypes.futureClass,
-              intersectNullabilities(
-                  computeNullabilityOfFutureOr(type1, coreTypes.futureOrClass),
-                  type2.nullability),
-              <DartType>[
-                getStandardLowerBound(type1.typeArguments[0],
-                    type2.typeArguments[0], clientLibrary)
-              ]);
-        }
+    if (type1 is FutureOrType) {
+      if (type2 is FutureOrType) {
+        // GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>
+        DartType argument = getStandardLowerBound(
+            type1.typeArgument, type2.typeArgument, clientLibrary);
+        return new FutureOrType(argument, argument.declaredNullability);
+      }
+      if (type2 is InterfaceType && type2.classNode == coreTypes.futureClass) {
+        // GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>
+        return new InterfaceType(
+            coreTypes.futureClass,
+            intersectNullabilities(
+                type1.declaredNullability, type2.declaredNullability),
+            <DartType>[
+              getStandardLowerBound(
+                  type1.typeArgument, type2.typeArguments[0], clientLibrary)
+            ]);
       }
       // GLB(FutureOr<A>, B) == GLB(A, B)
-      return getStandardLowerBound(
-          type1.typeArguments[0], type2, clientLibrary);
+      return getStandardLowerBound(type1.typeArgument, type2, clientLibrary);
     }
     // The if-statement below handles the following rule:
     //     GLB(A, FutureOr<B>) ==  GLB(FutureOr<B>, A)
     // It's broken down into sub-cases instead of making a recursive call to
     // avoid making the checks that were already made above.  Note that at this
     // point it's not possible for type1 to be a FutureOr.
-    if (type2 is InterfaceType && type2.classNode == coreTypes.futureOrClass) {
-      if (type1 is InterfaceType && type1.classNode == coreTypes.futureClass) {
+    if (type2 is FutureOrType) {
+      if (type1 is FutureOrType) {
         // GLB(Future<A>, FutureOr<B>) == Future<GLB(B, A)>
         return new InterfaceType(
             coreTypes.futureClass,
-            intersectNullabilities(type1.nullability,
-                computeNullabilityOfFutureOr(type2, coreTypes.futureOrClass)),
+            intersectNullabilities(
+                type1.declaredNullability, type2.declaredNullability),
             <DartType>[
               getStandardLowerBound(
-                  type2.typeArguments[0], type1.typeArguments[0], clientLibrary)
+                  type2.typeArgument, type1.typeArgument, clientLibrary)
             ]);
       }
       // GLB(A, FutureOr<B>) == GLB(B, A)
-      return getStandardLowerBound(
-          type2.typeArguments[0], type1, clientLibrary);
+      return getStandardLowerBound(type2.typeArgument, type1, clientLibrary);
     }
 
     // No subtype relation, so the lower bound is bottom.
@@ -702,14 +678,12 @@
       if (coreTypes.isObject(type2)) {
         return moretop(type1, type2) ? type1 : type2;
       }
-      if (computeNullability(type2, coreTypes.futureOrClass) ==
-          Nullability.nonNullable) {
+      if (type2.declaredNullability == Nullability.nonNullable) {
         return type1;
       }
       return type1.withDeclaredNullability(Nullability.nullable);
     } else if (coreTypes.isObject(type2)) {
-      if (computeNullability(type1, coreTypes.futureOrClass) ==
-          Nullability.nonNullable) {
+      if (type1.declaredNullability == Nullability.nonNullable) {
         return type2;
       }
       return type2.withDeclaredNullability(Nullability.nullable);
@@ -745,24 +719,40 @@
       if (type2 is InterfaceType &&
           type2.classNode == coreTypes.functionClass) {
         // UP(T Function<...>(...), Function) = Function
-        return coreTypes.functionRawType(
-            uniteNullabilities(type1.nullability, type2.nullability));
+        return coreTypes.functionRawType(uniteNullabilities(
+            type1.declaredNullability, type2.declaredNullability));
       }
 
       // UP(T Function<...>(...), T2) = Object
-      return coreTypes.objectRawType(
-          uniteNullabilities(type1.nullability, type2.nullability));
+      return coreTypes.objectRawType(uniteNullabilities(
+          type1.declaredNullability, type2.declaredNullability));
     } else if (type2 is FunctionType) {
       if (type1 is InterfaceType &&
           type1.classNode == coreTypes.functionClass) {
         // UP(Function, T Function<...>(...)) = Function
-        return coreTypes.functionRawType(
-            uniteNullabilities(type1.nullability, type2.nullability));
+        return coreTypes.functionRawType(uniteNullabilities(
+            type1.declaredNullability, type2.declaredNullability));
       }
 
       // UP(T1, T Function<...>(...)) = Object
-      return coreTypes.objectRawType(
-          uniteNullabilities(type1.nullability, type2.nullability));
+      return coreTypes.objectRawType(uniteNullabilities(
+          type1.declaredNullability, type2.declaredNullability));
+    }
+
+    if (type1 is FutureOrType || type2 is FutureOrType) {
+      if (isSubtypeOf(type1, type2, SubtypeCheckMode.withNullabilities)) {
+        return type2;
+      }
+      if (isSubtypeOf(type2, type1, SubtypeCheckMode.withNullabilities)) {
+        return type1;
+      }
+      if (type1 is FutureOrType && type2 is FutureOrType) {
+        return new FutureOrType(
+            getStandardUpperBound(
+                type1.typeArgument, type2.typeArgument, clientLibrary),
+            uniteNullabilities(
+                type1.declaredNullability, type2.declaredNullability));
+      }
     }
 
     // UP(T1, T2) = T2 if T1 <: T2
@@ -791,8 +781,8 @@
     //   Note that both types must be class types at this point.
     if (isSubtypeOf(nonNonNullableType2, nonNonNullableType1,
         SubtypeCheckMode.withNullabilities)) {
-      return type1.withDeclaredNullability(
-          uniteNullabilities(type1.nullability, type2.nullability));
+      return type1.withDeclaredNullability(uniteNullabilities(
+          type1.declaredNullability, type2.declaredNullability));
     }
 
     // UP(C<T0, ..., Tn>, C<S0, ..., Sn>) = C<R0,..., Rn> where Ri is UP(Ti, Si)
@@ -820,7 +810,8 @@
         }
         return new InterfaceType(
             klass,
-            uniteNullabilities(type1.nullability, type2.nullability),
+            uniteNullabilities(
+                type1.declaredNullability, type2.declaredNullability),
             typeArguments);
       }
     }
@@ -878,8 +869,8 @@
 
     // The fallback result for whenever the following rule applies:
     //     DOWN(T Function<...>(...), S Function<...>(...)) = Never otherwise.
-    final DartType fallbackResult =
-        new NeverType(intersectNullabilities(f.nullability, g.nullability));
+    final DartType fallbackResult = new NeverType(
+        intersectNullabilities(f.declaredNullability, g.declaredNullability));
 
     if (haveNamed && haveOptionalPositional) return fallbackResult;
     if (haveNamed &&
@@ -989,7 +980,7 @@
         f.returnType, substitution.substituteType(g.returnType), clientLibrary);
 
     return new FunctionType(positionalParameters, returnType,
-        intersectNullabilities(f.nullability, g.nullability),
+        intersectNullabilities(f.declaredNullability, g.declaredNullability),
         namedParameters: namedParameters,
         typeParameters: typeParameters,
         requiredParameterCount: minPos);
@@ -1042,8 +1033,8 @@
 
     // The return value for whenever the following applies:
     //     UP(T Function<...>(...), S Function<...>(...)) = Function otherwise
-    final DartType fallbackResult = coreTypes
-        .functionRawType(uniteNullabilities(f.nullability, g.nullability));
+    final DartType fallbackResult = coreTypes.functionRawType(
+        uniteNullabilities(f.declaredNullability, g.declaredNullability));
 
     if (haveNamed && haveOptionalPositional) return fallbackResult;
     if (!haveNamed && f.requiredParameterCount != g.requiredParameterCount) {
@@ -1157,7 +1148,7 @@
         f.returnType, substitution.substituteType(g.returnType), clientLibrary);
 
     return new FunctionType(positionalParameters, returnType,
-        uniteNullabilities(f.nullability, g.nullability),
+        uniteNullabilities(f.declaredNullability, g.declaredNullability),
         namedParameters: namedParameters,
         typeParameters: typeParameters,
         requiredParameterCount: f.requiredParameterCount);
@@ -1171,12 +1162,12 @@
       //   otherwise X1 if T2 <: X1
       //   otherwise UP(B1[Object/X1], T2)
       if (isSubtypeOf(type1, type2, SubtypeCheckMode.withNullabilities)) {
-        return type2.withDeclaredNullability(
-            uniteNullabilities(type1.nullability, type2.nullability));
+        return type2.withDeclaredNullability(uniteNullabilities(
+            type1.declaredNullability, type2.declaredNullability));
       }
       if (isSubtypeOf(type2, type1, SubtypeCheckMode.withNullabilities)) {
-        return type1.withDeclaredNullability(
-            uniteNullabilities(type1.nullability, type2.nullability));
+        return type1.withDeclaredNullability(uniteNullabilities(
+            type1.declaredNullability, type2.declaredNullability));
       }
       Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{
         type1.parameter: coreTypes.objectNonNullableRawType
@@ -1185,8 +1176,8 @@
               substitute(type1.parameter.bound, substitution),
               type2,
               clientLibrary)
-          .withDeclaredNullability(
-              uniteNullabilities(type1.nullability, type2.nullability));
+          .withDeclaredNullability(uniteNullabilities(
+              type1.declaredNullability, type2.declaredNullability));
     } else {
       // UP(X1 & B1, T2) =
       //   T2 if X1 <: T2
@@ -1195,12 +1186,12 @@
       DartType demoted =
           new TypeParameterType(type1.parameter, type1.declaredNullability);
       if (isSubtypeOf(demoted, type2, SubtypeCheckMode.withNullabilities)) {
-        return type2.withDeclaredNullability(
-            uniteNullabilities(type1.nullability, type2.nullability));
+        return type2.withDeclaredNullability(uniteNullabilities(
+            type1.declaredNullability, type2.declaredNullability));
       }
       if (isSubtypeOf(type2, demoted, SubtypeCheckMode.withNullabilities)) {
-        return demoted.withDeclaredNullability(
-            uniteNullabilities(type1.nullability, type2.nullability));
+        return demoted.withDeclaredNullability(uniteNullabilities(
+            type1.declaredNullability, type2.declaredNullability));
       }
       Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{
         type1.parameter: coreTypes.objectNonNullableRawType
@@ -1209,8 +1200,8 @@
               substitute(type1.promotedBound, substitution),
               type2,
               clientLibrary)
-          .withDeclaredNullability(
-              uniteNullabilities(type1.nullability, type2.nullability));
+          .withDeclaredNullability(uniteNullabilities(
+              type1.declaredNullability, type2.declaredNullability));
     }
   }
 
@@ -1273,10 +1264,12 @@
 
     // The standard upper bound of a function type and an interface type T is
     // the standard upper bound of Function and T.
-    if (type1 is FunctionType && type2 is InterfaceType) {
+    if (type1 is FunctionType &&
+        (type2 is InterfaceType || type2 is FutureOrType)) {
       type1 = coreTypes.functionLegacyRawType;
     }
-    if (type2 is FunctionType && type1 is InterfaceType) {
+    if (type2 is FunctionType &&
+        (type1 is InterfaceType || type2 is FutureOrType)) {
       type2 = coreTypes.functionLegacyRawType;
     }
 
@@ -1291,6 +1284,22 @@
           type1, type2, clientLibrary);
     }
 
+    if (type1 is FutureOrType || type2 is FutureOrType) {
+      if (isSubtypeOf(type1, type2, SubtypeCheckMode.ignoringNullabilities)) {
+        return type2;
+      }
+      if (isSubtypeOf(type2, type1, SubtypeCheckMode.ignoringNullabilities)) {
+        return type1;
+      }
+      if (type1 is FutureOrType && type2 is FutureOrType) {
+        return new FutureOrType(
+            getStandardUpperBound(
+                type1.typeArgument, type2.typeArgument, clientLibrary),
+            uniteNullabilities(
+                type1.declaredNullability, type2.declaredNullability));
+      }
+    }
+
     if (type1 is InvalidType || type2 is InvalidType) {
       return const InvalidType();
     }
@@ -1389,7 +1398,7 @@
     DartType returnType =
         getStandardLowerBound(f.returnType, g.returnType, clientLibrary);
     return new FunctionType(positionalParameters, returnType,
-        intersectNullabilities(f.nullability, g.nullability),
+        intersectNullabilities(f.declaredNullability, g.declaredNullability),
         namedParameters: namedParameters,
         requiredParameterCount: requiredParameterCount);
   }
@@ -1418,7 +1427,7 @@
     if (f.requiredParameterCount != g.requiredParameterCount) {
       return new InterfaceType(
           coreTypes.functionClass,
-          uniteNullabilities(f.nullability, g.nullability),
+          uniteNullabilities(f.declaredNullability, g.declaredNullability),
           const <DynamicType>[]);
     }
     int requiredParameterCount = f.requiredParameterCount;
@@ -1468,7 +1477,7 @@
     DartType returnType =
         getStandardUpperBound(f.returnType, g.returnType, clientLibrary);
     return new FunctionType(positionalParameters, returnType,
-        uniteNullabilities(f.nullability, g.nullability),
+        uniteNullabilities(f.declaredNullability, g.declaredNullability),
         namedParameters: namedParameters,
         requiredParameterCount: requiredParameterCount);
   }
@@ -1500,9 +1509,7 @@
     if (isSubtypeOf(type2, type1, SubtypeCheckMode.withNullabilities)) {
       return type1;
     }
-    if (type1 is InterfaceType &&
-        type2 is InterfaceType &&
-        identical(type1.classNode, type2.classNode)) {
+    if (identical(type1.classNode, type2.classNode)) {
       List<DartType> tArgs1 = type1.typeArguments;
       List<DartType> tArgs2 = type2.typeArguments;
       List<TypeParameter> tParams = type1.classNode.typeParameters;
@@ -1526,8 +1533,11 @@
           tArgs[i] = getStandardUpperBound(tArgs1[i], tArgs2[i], clientLibrary);
         }
       }
-      return new InterfaceType(type1.classNode,
-          uniteNullabilities(type1.nullability, type2.nullability), tArgs);
+      return new InterfaceType(
+          type1.classNode,
+          uniteNullabilities(
+              type1.declaredNullability, type2.declaredNullability),
+          tArgs);
     }
     return getLegacyLeastUpperBound(type1, type2, clientLibrary);
   }
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_constraint_gatherer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_constraint_gatherer.dart
index f83901e..33af2bb 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_constraint_gatherer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_constraint_gatherer.dart
@@ -8,6 +8,7 @@
         DartType,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         Library,
         Member,
@@ -22,12 +23,11 @@
 
 import 'package:kernel/core_types.dart';
 
-import 'package:kernel/type_algebra.dart' show substitute, Substitution;
+import 'package:kernel/type_algebra.dart'
+    show Substitution, substitute, uniteNullabilities;
 
 import 'package:kernel/type_environment.dart';
 
-import 'package:kernel/src/future_or.dart';
-
 import 'type_schema.dart' show UnknownType;
 
 import '../names.dart' show callName;
@@ -61,8 +61,6 @@
 
   Class get functionClass;
 
-  Class get futureOrClass;
-
   Class get nullClass;
 
   void addUpperBound(
@@ -295,16 +293,14 @@
     if (identical(subtype, supertype)) return true;
 
     // Handle FutureOr<T> union type.
-    if (subtype is InterfaceType &&
-        identical(subtype.classNode, futureOrClass)) {
-      DartType subtypeArg = subtype.typeArguments[0];
-      if (supertype is InterfaceType &&
-          identical(supertype.classNode, futureOrClass)) {
+    if (subtype is FutureOrType) {
+      DartType subtypeArg = subtype.typeArgument;
+      if (supertype is FutureOrType) {
         // `FutureOr<P>` is a subtype match for `FutureOr<Q>` with respect to
         // `L` under constraints `C`:
         // - If `P` is a subtype match for `Q` with respect to `L` under
         //   constraints `C`.
-        DartType supertypeArg = supertype.typeArguments[0];
+        DartType supertypeArg = supertype.typeArgument;
         return _isSubtypeMatch(subtypeArg, supertypeArg);
       }
 
@@ -318,13 +314,11 @@
           futureType(subtypeArg, _currentLibrary.nonNullable);
       return _isSubtypeMatch(subtypeFuture, supertype) &&
           _isSubtypeMatch(subtypeArg, supertype) &&
-          new IsSubtypeOf.basedSolelyOnNullabilities(
-                  subtype, supertype, futureOrClass)
+          new IsSubtypeOf.basedSolelyOnNullabilities(subtype, supertype)
               .isSubtypeWhenUsingNullabilities();
     }
 
-    if (supertype is InterfaceType &&
-        identical(supertype.classNode, futureOrClass)) {
+    if (supertype is FutureOrType) {
       // `P` is a subtype match for `FutureOr<Q>` with respect to `L` under
       // constraints `C`:
       // - If `P` is a subtype match for `Future<Q>` with respect to `L` under
@@ -346,10 +340,9 @@
       // should be united.  Also, computeNullability is used to fetch the
       // nullability of the argument because it can be a FutureOr itself.
       Nullability unitedNullability = uniteNullabilities(
-          computeNullability(supertype.typeArguments[0], futureOrClass),
-          supertype.nullability);
+          supertype.typeArgument.nullability, supertype.nullability);
       DartType supertypeArg =
-          supertype.typeArguments[0].withDeclaredNullability(unitedNullability);
+          supertype.typeArgument.withDeclaredNullability(unitedNullability);
       DartType supertypeFuture = futureType(supertypeArg, unitedNullability);
 
       // The match against FutureOr<X> succeeds if the match against either
@@ -481,9 +474,6 @@
   Class get functionClass => environment.coreTypes.functionClass;
 
   @override
-  Class get futureOrClass => environment.coreTypes.futureOrClass;
-
-  @override
   Class get nullClass => environment.coreTypes.nullClass;
 
   @override
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
index aeb2a72..8261db92 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
@@ -11,6 +11,7 @@
         DartTypeVisitor,
         Field,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         Member,
         NamedType,
@@ -95,6 +96,11 @@
   }
 
   @override
+  bool visitFutureOrType(FutureOrType node) {
+    return node.typeArgument.accept(this);
+  }
+
+  @override
   bool visitTypedefType(TypedefType node) {
     return node.unalias.accept(this);
   }
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index b5533c4..e814390 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -23,8 +23,6 @@
 
 import 'package:kernel/src/bounds_checks.dart' show calculateBounds;
 
-import 'package:kernel/src/future_or.dart';
-
 import 'package:kernel/src/legacy_erasure.dart';
 
 import '../../base/instrumentation.dart'
@@ -418,8 +416,7 @@
     }
     if (inferrer.library.isNonNullableByDefault &&
         (containsInvalidType(returnType) ||
-            isPotentiallyNonNullable(
-                returnType, inferrer.coreTypes.futureOrClass)) &&
+            returnType.isPotentiallyNonNullable) &&
         inferrer.flowAnalysis.isReachable) {
       Statement resultStatement =
           inferenceResult.hasChanged ? inferenceResult.statement : body;
@@ -709,11 +706,9 @@
     //   * FutureOr<T> where T is a double context
     //
     // We check directly, rather than using isAssignable because it's simpler.
-    while (typeContext is InterfaceType &&
-        typeContext.classNode == coreTypes.futureOrClass &&
-        typeContext.typeArguments.isNotEmpty) {
-      InterfaceType type = typeContext;
-      typeContext = type.typeArguments.first;
+    while (typeContext is FutureOrType) {
+      FutureOrType type = typeContext;
+      typeContext = type.typeArgument;
     }
     return typeContext is InterfaceType &&
         typeContext.classNode == coreTypes.doubleClass;
@@ -950,8 +945,7 @@
       if (callMember is Procedure && callMember.kind == ProcedureKind.Method) {
         if (_shouldTearOffCall(contextType, expressionType)) {
           needsTearoff = true;
-          if (isNonNullableByDefault &&
-              isPotentiallyNullable(expressionType, coreTypes.futureOrClass)) {
+          if (isNonNullableByDefault && expressionType.isPotentiallyNullable) {
             return AssignabilityKind.unassignableCantTearoff;
           }
           expressionType =
@@ -1201,7 +1195,7 @@
     DartType receiverBound = resolveTypeParameter(receiverType);
 
     bool isReceiverTypePotentiallyNullable = isNonNullableByDefault &&
-        isPotentiallyNullable(receiverType, coreTypes.futureOrClass) &&
+        receiverType.isPotentiallyNullable &&
         // Calls to `==` are always on a non-null receiver.
         name != equalsName;
 
@@ -2513,7 +2507,7 @@
         bool isOptionalNamed =
             i >= function.positionalParameters.length && !formal.isRequired;
         if ((isOptionalPositional || isOptionalNamed) &&
-            isPotentiallyNonNullable(formal.type, coreTypes.futureOrClass) &&
+            formal.type.isPotentiallyNonNullable &&
             !formal.hasDeclaredInitializer) {
           library.addProblem(
               templateOptionalNonNullableWithoutInitializerError.withArguments(
@@ -3540,8 +3534,7 @@
   }
 
   DartType wrapFutureOrType(DartType type) {
-    if (type is InterfaceType &&
-        identical(type.classNode, coreTypes.futureOrClass)) {
+    if (type is FutureOrType) {
       return type;
     }
     // TODO(paulberry): If [type] is a subtype of `Future`, should we just
@@ -3549,8 +3542,7 @@
     if (type == null) {
       return coreTypes.futureRawType(library.nullable);
     }
-    return new InterfaceType(
-        coreTypes.futureOrClass, library.nonNullable, <DartType>[type]);
+    return new FutureOrType(type, library.nonNullable);
   }
 
   DartType wrapFutureType(DartType type, Nullability nullability) {
@@ -3619,9 +3611,8 @@
   }
 
   bool _shouldTearOffCall(DartType contextType, DartType expressionType) {
-    if (contextType is InterfaceType &&
-        contextType.classNode == typeSchemaEnvironment.futureOrClass) {
-      contextType = (contextType as InterfaceType).typeArguments[0];
+    if (contextType is FutureOrType) {
+      contextType = (contextType as FutureOrType).typeArgument;
     }
     if (contextType is FunctionType) return true;
     if (contextType is InterfaceType &&
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart
index 0fabd3d..0e93526 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart
@@ -8,12 +8,14 @@
         DartTypeVisitor,
         DartTypeVisitor1,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         NamedType,
         Nullability,
         TypedefType,
         Visitor;
 import 'package:kernel/src/assumptions.dart';
+import 'package:kernel/src/printer.dart';
 
 import 'package:kernel/import_table.dart' show ImportTable;
 
@@ -60,10 +62,10 @@
   const UnknownType();
 
   @override
-  Nullability get nullability => null;
+  Nullability get declaredNullability => null;
 
   @override
-  Nullability get declaredNullability => null;
+  Nullability get nullability => null;
 
   @override
   bool operator ==(Object other) => equals(other, null);
@@ -91,8 +93,8 @@
   UnknownType withDeclaredNullability(Nullability nullability) => this;
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('?');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('?');
   }
 
   @override
@@ -132,6 +134,11 @@
   }
 
   @override
+  bool visitFutureOrType(FutureOrType node) {
+    return node.typeArgument.accept(this);
+  }
+
+  @override
   bool visitTypedefType(TypedefType node) {
     for (DartType typeArgument in node.typeArguments) {
       if (!typeArgument.accept(this)) return false;
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
index a3fcd38..69783e1 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
@@ -8,6 +8,7 @@
         DartType,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         Library,
         NamedType,
@@ -111,8 +112,6 @@
 
   Class get futureClass => coreTypes.futureClass;
 
-  Class get futureOrClass => coreTypes.futureOrClass;
-
   Class get objectClass => coreTypes.objectClass;
 
   InterfaceType get objectNonNullableRawType {
@@ -361,10 +360,8 @@
       DartType subtype, DartType supertype) {
     if (subtype is UnknownType) return const IsSubtypeOf.always();
     DartType unwrappedSupertype = supertype;
-    while (unwrappedSupertype is InterfaceType &&
-        unwrappedSupertype.classNode == futureOrClass) {
-      unwrappedSupertype =
-          (unwrappedSupertype as InterfaceType).typeArguments.single;
+    while (unwrappedSupertype is FutureOrType) {
+      unwrappedSupertype = (unwrappedSupertype as FutureOrType).typeArgument;
     }
     if (unwrappedSupertype is UnknownType) {
       return const IsSubtypeOf.always();
diff --git a/pkg/front_end/lib/src/testing/id_testing_utils.dart b/pkg/front_end/lib/src/testing/id_testing_utils.dart
index ff03fe7..97eed20 100644
--- a/pkg/front_end/lib/src/testing/id_testing_utils.dart
+++ b/pkg/front_end/lib/src/testing/id_testing_utils.dart
@@ -479,6 +479,13 @@
     }
   }
 
+  void visitFutureOrType(FutureOrType node) {
+    sb.write('FutureOr<');
+    visit(node.typeArgument);
+    sb.write('>');
+    sb.write(nullabilityToText(node.declaredNullability, typeRepresentation));
+  }
+
   void visitFunctionType(FunctionType node) {
     visit(node.returnType);
     sb.write(' Function');
diff --git a/pkg/front_end/test/ast_nodes_has_to_string_test.dart b/pkg/front_end/test/ast_nodes_has_to_string_test.dart
index dd3cbf7..28a3810 100644
--- a/pkg/front_end/test/ast_nodes_has_to_string_test.dart
+++ b/pkg/front_end/test/ast_nodes_has_to_string_test.dart
@@ -72,7 +72,10 @@
     print("OK");
     exitCode = 0;
   } else {
-    print("Missing toString() on $toGo classes!");
+    String classes = classMap.values
+        .map((list) => list.map((cls) => cls.name).join(', '))
+        .join(', ');
+    print("Missing toString() on $toGo class(es): ${classes}");
 
     if (args.length == 1 && args.single == "--interactive") {
       for (Uri uri in classMap.keys) {
diff --git a/pkg/front_end/test/fasta/type_inference/factor_type_test.dart b/pkg/front_end/test/fasta/type_inference/factor_type_test.dart
index c56155d..c8ed120 100644
--- a/pkg/front_end/test/fasta/type_inference/factor_type_test.dart
+++ b/pkg/front_end/test/fasta/type_inference/factor_type_test.dart
@@ -47,8 +47,8 @@
       new InterfaceType(coreTypes.futureClass, Nullability.nonNullable, [type]);
 
   @override
-  DartType futureOrNone(DartType type) => new InterfaceType(
-      coreTypes.futureOrClass, Nullability.nonNullable, [type]);
+  DartType futureOrNone(DartType type) =>
+      new FutureOrType(type, Nullability.nonNullable);
 
   @override
   DartType get dynamicType => const DynamicType();
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index 4fc2204..4b0a818 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -423,6 +423,7 @@
 function's
 fuse
 futured
+futureor
 g
 gardening
 generation
@@ -879,6 +880,7 @@
 removal
 remover
 reparse
+repeating
 replacements
 replacer
 replaces
@@ -1157,6 +1159,7 @@
 unlinked
 unlower
 unmark
+unneeded
 unordered
 unpaired
 unparsed
@@ -1174,6 +1177,7 @@
 urls
 usage
 usr
+usual
 usually
 utf16
 utf8
diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt
index ef9be39..2e12861 100644
--- a/pkg/front_end/test/spell_checking_list_common.txt
+++ b/pkg/front_end/test/spell_checking_list_common.txt
@@ -2416,6 +2416,7 @@
 relying
 remain
 remainder
+remained
 remaining
 remains
 remember
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index e6deb54..1df02b2 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -210,6 +210,8 @@
 flagged
 floor
 fluctuate
+foo"bar"baz
+foo'bar'baz
 foo1
 foo10
 foo12
@@ -223,6 +225,9 @@
 foo7
 foo8
 foo9
+foo\"bar'baz
+foo\"bar\"baz
+foo\"bar\'baz
 foos
 forbidden
 forces
@@ -277,6 +282,23 @@
 interpolate
 inv
 invalidating
+invocation1a
+invocation1b
+invocation2a
+invocation2b
+invocation3a
+invocation3b
+invocation4a
+invocation4b
+invocation5a
+invocation5b
+invocation6a
+invocation6b
+invocation7a
+invocation7b
+invocation7c
+invocation7d
+invocation7e
 ioo
 isolate
 isolates
@@ -502,6 +524,8 @@
 supermixin
 supplement
 suspension
+t\b\f\u
+t\u0008\f\u
 tails
 talk
 templates
@@ -539,6 +563,7 @@
 unregistered
 untransformed
 untrimmed
+unusual
 upload
 uppercase
 upward
diff --git a/pkg/front_end/test/text_representation/data/constants.dart b/pkg/front_end/test/text_representation/data/constants.dart
index 4e7ab5b..cb45a66 100644
--- a/pkg/front_end/test/text_representation/data/constants.dart
+++ b/pkg/front_end/test/text_representation/data/constants.dart
@@ -15,7 +15,7 @@
 
   const Class2(
       this.
-          /*normal.Class2.T%*/
+          /*normal|limited.Class2.T%*/
           /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class2.T%*/
           field1);
 }
@@ -25,11 +25,11 @@
 
   const Class3(
       T
-          /*normal.Class3.T%*/
+          /*normal|limited.Class3.T%*/
           /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class3.T%*/
           field1,
       this.
-          /*normal.Class3.S%*/
+          /*normal|limited.Class3.S%*/
           /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class3.S%*/
           field2)
       : super(field1);
@@ -40,14 +40,14 @@
 
   const Class4(
       T
-          /*normal.Class4.T%*/
+          /*normal|limited.Class4.T%*/
           /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class4.T%*/
           field1,
       S
-          /*normal.Class4.S%*/
+          /*normal|limited.Class4.S%*/
           /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class4.S%*/
           shadowedField2,
-      this. /*normal.Class4.S%*/
+      this. /*normal|limited.Class4.S%*/
           /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class4.S%*/
           field2)
       : super(field1, shadowedField2);
@@ -61,92 +61,96 @@
 const stringConstant = /*foo*/ "foo";
 const symbolConstant = /*#name*/ #name;
 const privateSymbolConstant =
-    /*normal.#_privateName*/
+    /*normal|limited.#_privateName*/
     /*verbose.#library org-dartlang-test:///a/b/c/main.dart::_privateName*/
     #_privateName;
-const listConstant1 = /*<dynamic>[]*/ [];
+const listConstant1 = /*const <dynamic>[]*/ [];
 const listConstant2 = <int>
-    /*normal.<int>[]*/
-    /*verbose.<dart.core::int>[]*/
+    /*normal|limited.const <int>[]*/
+    /*verbose.const <dart.core::int>[]*/
     [];
 const listConstant3 = <int>
-    /*normal.<int>[0]*/
-    /*verbose.<dart.core::int>[0]*/
+    /*normal|limited.const <int>[0]*/
+    /*verbose.const <dart.core::int>[0]*/
     [0];
 const listConstant4 = <int?>
-    /*normal.<int?>[0, 1]*/
-    /*verbose.<dart.core::int?>[0, 1]*/
+    /*normal|limited.const <int?>[0, 1]*/
+    /*verbose.const <dart.core::int?>[0, 1]*/
     [0, 1];
 const setConstant1 = <int>
-    /*normal.<int>{}*/
-    /*verbose.<dart.core::int>{}*/
+    /*normal|limited.const <int>{}*/
+    /*verbose.const <dart.core::int>{}*/
     {};
 const setConstant2 = <int>
-    /*normal.<int>{0}*/
-    /*verbose.<dart.core::int>{0}*/
+    /*normal|limited.const <int>{0}*/
+    /*verbose.const <dart.core::int>{0}*/
     {0};
 const setConstant3 = <int?>
-    /*normal.<int?>{0, 1}*/
-    /*verbose.<dart.core::int?>{0, 1}*/
+    /*normal|limited.const <int?>{0, 1}*/
+    /*verbose.const <dart.core::int?>{0, 1}*/
     {0, 1};
-const mapConstant1 = /*<dynamic, dynamic>{}*/ {};
+const mapConstant1 = /*const <dynamic, dynamic>{}*/ {};
 const mapConstant2 = <int, String>
-    /*normal.<int, String>{}*/
-    /*verbose.<dart.core::int, dart.core::String>{}*/
+    /*normal|limited.const <int, String>{}*/
+    /*verbose.const <dart.core::int, dart.core::String>{}*/
     {};
 const mapConstant3 = <int, String>
-    /*normal.<int, String>{0: foo}*/
-    /*verbose.<dart.core::int, dart.core::String>{0: foo}*/
+    /*normal|limited.const <int, String>{0: foo}*/
+    /*verbose.const <dart.core::int, dart.core::String>{0: foo}*/
     {0: "foo"};
 const mapConstant4 = <int, String?>
-    /*normal.<int, String?>{0: foo, 1: bar}*/
-    /*verbose.<dart.core::int, dart.core::String?>{0: foo, 1: bar}*/
+    /*normal|limited.const <int, String?>{0: foo, 1: bar}*/
+    /*verbose.const <dart.core::int, dart.core::String?>{0: foo, 1: bar}*/
     {0: "foo", 1: "bar"};
 const tearOffConstant =
-    /*normal.id*/
+    /*normal|limited.id*/
     /*verbose.library org-dartlang-test:///a/b/c/main.dart::id*/
     id;
 const int Function(int) partialInitializationConstant =
-    /*normal.<int>id*/
-    /*verbose.<dart.core::int>library org-dartlang-test:///a/b/c/main.dart::id*/
+    /*normal|limited.id<int>*/
+    /*verbose.library org-dartlang-test:///a/b/c/main.dart::id<dart.core::int>*/
     id;
 const boolHasEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{bool.hasEnvironment(foo)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::bool.hasEnvironment(foo)}*/
     bool.hasEnvironment("foo");
 const boolFromEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{bool.fromEnvironment(foo, defaultValue: true)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::bool.fromEnvironment(foo, defaultValue: true)}*/
     bool.fromEnvironment("foo", defaultValue: true);
 const intFromEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{int.fromEnvironment(foo, defaultValue: 87)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::int.fromEnvironment(foo, defaultValue: 87)}*/
     int.fromEnvironment("foo", defaultValue: 87);
 const stringFromEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{String.fromEnvironment(foo, defaultValue: bar)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::String.fromEnvironment(foo, defaultValue: bar)}*/
     String.fromEnvironment("foo", defaultValue: "bar");
 const instanceConstant1 = const
-    /*normal.Class1<dynamic>{}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class1<dynamic>{}*/
+    /*normal|limited.const Class1<dynamic>{}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class1<dynamic>{}*/
     Class1();
 const instanceConstant2 = const
-    /*normal.Class1<int>{}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class1<dart.core::int>{}*/
+    /*normal|limited.const Class1<int>{}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class1<dart.core::int>{}*/
     Class1<int>();
 const instanceConstant3 = const
-    /*normal.Class1<int>{}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class1<dart.core::int>{}*/
+    /*normal|limited.const Class1<int>{}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class1<dart.core::int>{}*/
     Class1<int>();
 const instanceConstant4 = const
-    /*normal.Class2<int>{Class2.field1: 0}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class2<dart.core::int>{Class2.field1: 0}*/
+    /*normal|limited.const Class2<int>{Class2.field1: 0}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class2<dart.core::int>{library org-dartlang-test:///a/b/c/main.dart::Class2.field1: 0}*/
     Class2(0);
 const instanceConstant5 = const
-    /*normal.Class2<num>{Class2.field1: 42}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class2<dart.core::num>{Class2.field1: 42}*/
+    /*normal|limited.const Class2<num>{Class2.field1: 42}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class2<dart.core::num>{library org-dartlang-test:///a/b/c/main.dart::Class2.field1: 42}*/
     Class2<num>(42);
 const instanceConstant6 = const
-    /*normal.Class3<int, String>{Class3.field2: foo, Class2.field1: 42}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class3<dart.core::int, dart.core::String>{Class3.field2: foo, Class2.field1: 42}*/
+    /*normal|limited.const Class3<int, String>{Class3.field2: foo, Class2.field1: 42}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class3<dart.core::int, dart.core::String>{library org-dartlang-test:///a/b/c/main.dart::Class3.field2: foo, library org-dartlang-test:///a/b/c/main.dart::Class2.field1: 42}*/
     Class3<int, String>(42, "foo");
 const instanceConstant7 = const
-    /*normal.Class4<int, String?>{Class4.field2: baz, Class3.field2: foo, Class2.field1: 42}*/
-    /*verbose.library org-dartlang-test:///a/b/c/main.dart::Class4<dart.core::int, dart.core::String?>{Class4.field2: baz, Class3.field2: foo, Class2.field1: 42}*/
+    /*normal|limited.const Class4<int, String?>{Class4.field2: baz, Class3.field2: foo, Class2.field1: 42}*/
+    /*verbose.const library org-dartlang-test:///a/b/c/main.dart::Class4<dart.core::int, dart.core::String?>{library org-dartlang-test:///a/b/c/main.dart::Class4.field2: baz, library org-dartlang-test:///a/b/c/main.dart::Class3.field2: foo, library org-dartlang-test:///a/b/c/main.dart::Class2.field1: 42}*/
     Class4<int, String?>(42, "foo", "baz");
diff --git a/pkg/front_end/test/text_representation/data/constants_opt_out.dart b/pkg/front_end/test/text_representation/data/constants_opt_out.dart
index 3f3ce69..a5d4519 100644
--- a/pkg/front_end/test/text_representation/data/constants_opt_out.dart
+++ b/pkg/front_end/test/text_representation/data/constants_opt_out.dart
@@ -16,14 +16,16 @@
 class Class2<T> {
   final T field1;
 
-  const Class2(this. /*normal.Class2.T**/ /*verbose.test::Class2.T**/ field1);
+  const Class2(
+      this. /*normal|limited.Class2.T**/ /*verbose.test::Class2.T**/ field1);
 }
 
 class Class3<T, S> extends Class2<T> {
   final S field2;
 
-  const Class3(T /*normal.Class3.T**/ /*verbose.test::Class3.T**/ field1,
-      this. /*normal.Class3.S**/ /*verbose.test::Class3.S**/ field2)
+  const Class3(
+      T /*normal|limited.Class3.T**/ /*verbose.test::Class3.T**/ field1,
+      this. /*normal|limited.Class3.S**/ /*verbose.test::Class3.S**/ field2)
       : super(field1);
 }
 
@@ -31,9 +33,9 @@
   final S field2;
 
   const Class4(
-      T /*normal.Class4.T**/ /*verbose.test::Class4.T**/ field1,
-      S /*normal.Class4.S**/ /*verbose.test::Class4.S**/ shadowedField2,
-      this. /*normal.Class4.S**/ /*verbose.test::Class4.S**/ field2)
+      T /*normal|limited.Class4.T**/ /*verbose.test::Class4.T**/ field1,
+      S /*normal|limited.Class4.S**/ /*verbose.test::Class4.S**/ shadowedField2,
+      this. /*normal|limited.Class4.S**/ /*verbose.test::Class4.S**/ field2)
       : super(field1, shadowedField2);
 }
 
@@ -45,77 +47,91 @@
 const stringConstant = /*foo*/ "foo";
 const symbolConstant = /*#name*/ #name;
 const privateSymbolConstant =
-/*normal.#_privateName*/
+/*normal|limited.#_privateName*/
     /*verbose.#test::_privateName*/
     #_privateName;
-const listConstant1 = /*<dynamic>[]*/ [];
-const listConstant2 =
-    <int> /*normal.<int*>[]*/ /*verbose.<dart.core::int*>[]*/ [];
-const listConstant3 =
-    <int> /*normal.<int*>[0]*/ /*verbose.<dart.core::int*>[0]*/ [0];
-const listConstant4 =
-    <int> /*normal.<int*>[0, 1]*/ /*verbose.<dart.core::int*>[0, 1]*/ [0, 1];
-const setConstant1 =
-    <int> /*normal.<int*>{}*/ /*verbose.<dart.core::int*>{}*/ {};
-const setConstant2 =
-    <int> /*normal.<int*>{0}*/ /*verbose.<dart.core::int*>{0}*/ {0};
-const setConstant3 =
-    <int> /*normal.<int*>{0, 1}*/ /*verbose.<dart.core::int*>{0, 1}*/ {0, 1};
-const mapConstant1 = /*<dynamic, dynamic>{}*/ {};
+const listConstant1 = /*const <dynamic>[]*/ [];
+const listConstant2 = <
+    int> /*normal|limited.const <int*>[]*/ /*verbose.const <dart.core::int*>[]*/ [];
+const listConstant3 = <
+    int> /*normal|limited.const <int*>[0]*/ /*verbose.const <dart.core::int*>[0]*/ [
+  0
+];
+const listConstant4 = <
+    int> /*normal|limited.const <int*>[0, 1]*/ /*verbose.const <dart.core::int*>[0, 1]*/ [
+  0,
+  1
+];
+const setConstant1 = <
+    int> /*normal|limited.const <int*>{}*/ /*verbose.const <dart.core::int*>{}*/ {};
+const setConstant2 = <
+    int> /*normal|limited.const <int*>{0}*/ /*verbose.const <dart.core::int*>{0}*/ {
+  0
+};
+const setConstant3 = <
+    int> /*normal|limited.const <int*>{0, 1}*/ /*verbose.const <dart.core::int*>{0, 1}*/ {
+  0,
+  1
+};
+const mapConstant1 = /*const <dynamic, dynamic>{}*/ {};
 const mapConstant2 = <int, String>
-    /*normal.<int*, String*>{}*/
-    /*verbose.<dart.core::int*, dart.core::String*>{}*/
+    /*normal|limited.const <int*, String*>{}*/
+    /*verbose.const <dart.core::int*, dart.core::String*>{}*/
     {};
 const mapConstant3 = <int, String>
-    /*normal.<int*, String*>{0: foo}*/
-    /*verbose.<dart.core::int*, dart.core::String*>{0: foo}*/
+    /*normal|limited.const <int*, String*>{0: foo}*/
+    /*verbose.const <dart.core::int*, dart.core::String*>{0: foo}*/
     {0: "foo"};
 const mapConstant4 = <int, String>
-    /*normal.<int*, String*>{0: foo, 1: bar}*/
-    /*verbose.<dart.core::int*, dart.core::String*>{0: foo, 1: bar}*/
+    /*normal|limited.const <int*, String*>{0: foo, 1: bar}*/
+    /*verbose.const <dart.core::int*, dart.core::String*>{0: foo, 1: bar}*/
     {0: "foo", 1: "bar"};
-const tearOffConstant = /*normal.id*/ /*verbose.test::id*/ id;
+const tearOffConstant = /*normal|limited.id*/ /*verbose.test::id*/ id;
 const int Function(int) partialInitializationConstant =
-    /*normal.<int*>id*/
-    /*verbose.<dart.core::int*>test::id*/
+    /*normal|limited.id<int*>*/
+    /*verbose.test::id<dart.core::int*>*/
     id;
 const boolHasEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{bool.hasEnvironment(foo)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::bool.hasEnvironment(foo)}*/
     bool.hasEnvironment("foo");
 const boolFromEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{bool.fromEnvironment(foo, defaultValue: true)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::bool.fromEnvironment(foo, defaultValue: true)}*/
     bool.fromEnvironment("foo", defaultValue: true);
 const intFromEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{int.fromEnvironment(foo, defaultValue: 87)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::int.fromEnvironment(foo, defaultValue: 87)}*/
     int.fromEnvironment("foo", defaultValue: 87);
 const stringFromEnvironmentConstant = const
-    /*unevaluated{FileUriExpression()}*/
+    /*normal|limited.unevaluated{String.fromEnvironment(foo, defaultValue: bar)}*/
+    /*verbose.unevaluated{{org-dartlang-test:///a/b/c/main.dart}dart.core::String.fromEnvironment(foo, defaultValue: bar)}*/
     String.fromEnvironment("foo", defaultValue: "bar");
 const instanceConstant1 = const
-    /*normal.Class1<dynamic>{}*/
-    /*verbose.test::Class1<dynamic>{}*/
+    /*normal|limited.const Class1<dynamic>{}*/
+    /*verbose.const test::Class1<dynamic>{}*/
     Class1();
 const instanceConstant2 = const
-    /*normal.Class1<int*>{}*/
-    /*verbose.test::Class1<dart.core::int*>{}*/
+    /*normal|limited.const Class1<int*>{}*/
+    /*verbose.const test::Class1<dart.core::int*>{}*/
     Class1<int>();
 const instanceConstant3 = const
-    /*normal.Class1<int*>{}*/
-    /*verbose.test::Class1<dart.core::int*>{}*/
+    /*normal|limited.const Class1<int*>{}*/
+    /*verbose.const test::Class1<dart.core::int*>{}*/
     Class1<int>();
 const instanceConstant4 = const
-    /*normal.Class2<int*>{Class2.field1: 0}*/
-    /*verbose.test::Class2<dart.core::int*>{Class2.field1: 0}*/
+    /*normal|limited.const Class2<int*>{Class2.field1: 0}*/
+    /*verbose.const test::Class2<dart.core::int*>{test::Class2.field1: 0}*/
     Class2(0);
 const instanceConstant5 = const
-    /*normal.Class2<num*>{Class2.field1: 42}*/
-    /*verbose.test::Class2<dart.core::num*>{Class2.field1: 42}*/
+    /*normal|limited.const Class2<num*>{Class2.field1: 42}*/
+    /*verbose.const test::Class2<dart.core::num*>{test::Class2.field1: 42}*/
     Class2<num>(42);
 const instanceConstant6 = const
-    /*normal.Class3<int*, String*>{Class3.field2: foo, Class2.field1: 42}*/
-    /*verbose.test::Class3<dart.core::int*, dart.core::String*>{Class3.field2: foo, Class2.field1: 42}*/
+    /*normal|limited.const Class3<int*, String*>{Class3.field2: foo, Class2.field1: 42}*/
+    /*verbose.const test::Class3<dart.core::int*, dart.core::String*>{test::Class3.field2: foo, test::Class2.field1: 42}*/
     Class3<int, String>(42, "foo");
 const instanceConstant7 = const
-    /*normal.Class4<int*, String*>{Class4.field2: baz, Class3.field2: foo, Class2.field1: 42}*/
-    /*verbose.test::Class4<dart.core::int*, dart.core::String*>{Class4.field2: baz, Class3.field2: foo, Class2.field1: 42}*/
+    /*normal|limited.const Class4<int*, String*>{Class4.field2: baz, Class3.field2: foo, Class2.field1: 42}*/
+    /*verbose.const test::Class4<dart.core::int*, dart.core::String*>{test::Class4.field2: baz, test::Class3.field2: foo, test::Class2.field1: 42}*/
     Class4<int, String>(42, "foo", "baz");
diff --git a/pkg/front_end/test/text_representation/data/expressions.dart b/pkg/front_end/test/text_representation/data/expressions.dart
new file mode 100644
index 0000000..cbad9e3
--- /dev/null
+++ b/pkg/front_end/test/text_representation/data/expressions.dart
@@ -0,0 +1,485 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*library: nnbd=true*/
+library expressions;
+
+import 'dart:math' deferred as prefix;
+
+class Class {
+  Class();
+  Class.named();
+
+  var field;
+  get getter => 0;
+  set setter(/*dynamic*/ _) {}
+  method1() {}
+  method2(/*dynamic*/ a) {}
+  method3([/*dynamic*/ a]) {}
+  method4(/*dynamic*/ a, [/*dynamic*/ b]) {}
+  method5({/*dynamic*/ a}) {}
+  method6(/*dynamic*/ a, {/*dynamic*/ b}) {}
+  method7({/*dynamic*/ a, /*dynamic*/ b}) {}
+  genericMethod1<T>() {}
+  genericMethod2<T, S>() {}
+  _privateMethod() {}
+
+  static var staticField;
+  static get staticGetter => 42;
+  static set staticSetter(/*dynamic*/ _) {}
+  static staticMethod() {}
+}
+
+class SubClass extends Class {
+  /*member: SubClass.exprThis:this*/
+  exprThis() => this;
+
+  /*normal|limited.member: SubClass.exprSuperFieldGet:super.{Class.field}*/
+  /*verbose.member: SubClass.exprSuperFieldGet:super.{expressions::Class.field}*/
+  exprSuperFieldGet() => super.field;
+
+  /*normal|limited.member: SubClass.exprSuperGetterGet:super.{Class.getter}*/
+  /*verbose.member: SubClass.exprSuperGetterGet:super.{expressions::Class.getter}*/
+  exprSuperGetterGet() => super.getter;
+
+  /*normal|limited.member: SubClass.exprSuperMethodTearOff:super.{Class.method1}*/
+  /*verbose.member: SubClass.exprSuperMethodTearOff:super.{expressions::Class.method1}*/
+  exprSuperMethodTearOff() => super.method1;
+
+  /*normal|limited.member: SubClass.exprSuperFieldSet:super.{Class.field} = 42*/
+  /*verbose.member: SubClass.exprSuperFieldSet:super.{expressions::Class.field} = 42*/
+  exprSuperFieldSet() => super.field = 42;
+
+  /*normal|limited.member: SubClass.exprSuperSetterSet:super.{Class.setter} = 42*/
+  /*verbose.member: SubClass.exprSuperSetterSet:super.{expressions::Class.setter} = 42*/
+  exprSuperSetterSet() => super.setter = 42;
+
+  /*normal|limited.member: SubClass.exprSuperMethodInvocation:super.{Class.method1}()*/
+  /*verbose.member: SubClass.exprSuperMethodInvocation:super.{expressions::Class.method1}()*/
+  exprSuperMethodInvocation() => super.method1();
+}
+
+class GenericClass<T, S> {
+  GenericClass();
+  GenericClass.named();
+}
+
+var topLevelField;
+get topLevelGetter => 42;
+set topLevelSetter(/*dynamic*/ _) {}
+topLevelMethod() {}
+
+T genericTopLevelMethod1<T>(T /*T%*/ t) => t;
+T genericTopLevelMethod2<T, S>(T /*T%*/ t, S /*S%*/ s) => t;
+
+/*member: exprNullLiteral:null*/
+exprNullLiteral() => null;
+
+/*member: exprBoolLiteralTrue:true*/
+exprBoolLiteralTrue() => true;
+
+/*member: exprBoolLiteralFalse:false*/
+exprBoolLiteralFalse() => false;
+
+/*member: exprIntLiteral:42*/
+exprIntLiteral() => 42;
+
+/*member: exprDoubleLiteral:3.14*/
+exprDoubleLiteral() => 3.14;
+
+/*member: exprStringLiteralEmpty:""*/
+exprStringLiteralEmpty() => "";
+
+/*member: exprStringLiteralNonEmpty:"foo"*/
+exprStringLiteralNonEmpty() => "foo";
+
+/*member: exprStringLiteralSingleQuote:"foo'bar'baz"*/
+exprStringLiteralSingleQuote() => "foo'bar'baz";
+
+/*member: exprStringLiteralDoubleQuote:"foo\"bar\"baz"*/
+exprStringLiteralDoubleQuote() => 'foo"bar"baz';
+
+/*member: exprStringLiteralSingleDoubleQuote:"foo\"bar'baz"*/
+exprStringLiteralSingleDoubleQuote() => "foo\"bar\'baz";
+
+/*member: exprStringLiteralEscapes:"\r\n\t\u0008\f\u0000"*/
+exprStringLiteralEscapes() => "\r\n\t\b\f\u0000";
+
+/*member: exprSymbolLiteral:#foo*/
+exprSymbolLiteral() => #foo;
+
+/*normal|limited.member: exprPrivateSymbolLiteral:#_bar*/
+/*verbose.member: exprPrivateSymbolLiteral:#expressions::_bar*/
+exprPrivateSymbolLiteral() => #_bar;
+
+/*normal|limited.member: exprTypeLiteral:Object*/
+/*verbose.member: exprTypeLiteral:dart.core::Object*/
+exprTypeLiteral() => Object;
+
+/*member: exprVariableGet:variable*/
+exprVariableGet(variable) => variable;
+
+/*member: exprVariableSet:variable = 42*/
+exprVariableSet(variable) => variable = 42;
+
+/*normal|limited.member: exprInstanceFieldGet:variable.{Class.field}*/
+/*verbose.member: exprInstanceFieldGet:variable.{expressions::Class.field}*/
+exprInstanceFieldGet(Class variable) => variable.field;
+
+/*normal|limited.member: exprInstanceGetterGet:variable.{Class.getter}*/
+/*verbose.member: exprInstanceGetterGet:variable.{expressions::Class.getter}*/
+exprInstanceGetterGet(Class variable) => variable.getter;
+
+/*normal|limited.member: exprInstanceMethodTearOff:variable.{Class.method1}*/
+/*verbose.member: exprInstanceMethodTearOff:variable.{expressions::Class.method1}*/
+exprInstanceMethodTearOff(Class variable) => variable.method1;
+
+/*member: exprDynamicGet:variable.field*/
+exprDynamicGet(variable) => variable.field;
+
+/*normal|limited.member: exprObjectGet:variable.{Object.runtimeType}*/
+/*verbose.member: exprObjectGet:variable.{dart.core::Object.runtimeType}*/
+exprObjectGet(variable) => variable.runtimeType;
+
+/*normal|limited.member: exprInstanceFieldSet:variable.{Class.field} = 42*/
+/*verbose.member: exprInstanceFieldSet:variable.{expressions::Class.field} = 42*/
+exprInstanceFieldSet(Class variable) => variable.field = 42;
+
+/*normal|limited.member: exprInstanceSetterSet:variable.{Class.setter} = 42*/
+/*verbose.member: exprInstanceSetterSet:variable.{expressions::Class.setter} = 42*/
+exprInstanceSetterSet(Class variable) => variable.setter = 42;
+
+/*member: exprDynamicSet:variable.field = 42*/
+exprDynamicSet(variable) => variable.field = 42;
+
+/*normal|limited.member: exprInstanceInvocation1:variable.{Class.method1}()*/
+/*verbose.member: exprInstanceInvocation1:variable.{expressions::Class.method1}()*/
+exprInstanceInvocation1(Class variable) => variable.method1();
+
+/*normal|limited.member: exprInstanceInvocation2:variable.{Class.method2}(42)*/
+/*verbose.member: exprInstanceInvocation2:variable.{expressions::Class.method2}(42)*/
+exprInstanceInvocation2(Class variable) => variable.method2(42);
+
+/*normal|limited.member: exprInstanceInvocation3a:variable.{Class.method3}()*/
+/*verbose.member: exprInstanceInvocation3a:variable.{expressions::Class.method3}()*/
+exprInstanceInvocation3a(Class variable) => variable.method3();
+
+/*normal|limited.member: exprInstanceInvocation3b:variable.{Class.method3}(42)*/
+/*verbose.member: exprInstanceInvocation3b:variable.{expressions::Class.method3}(42)*/
+exprInstanceInvocation3b(Class variable) => variable.method3(42);
+
+/*normal|limited.member: exprInstanceInvocation4a:variable.{Class.method4}(42)*/
+/*verbose.member: exprInstanceInvocation4a:variable.{expressions::Class.method4}(42)*/
+exprInstanceInvocation4a(Class variable) => variable.method4(42);
+
+/*normal|limited.member: exprInstanceInvocation4b:variable.{Class.method4}(42, 87)*/
+/*verbose.member: exprInstanceInvocation4b:variable.{expressions::Class.method4}(42, 87)*/
+exprInstanceInvocation4b(Class variable) => variable.method4(42, 87);
+
+/*normal|limited.member: exprInstanceInvocation5a:variable.{Class.method5}()*/
+/*verbose.member: exprInstanceInvocation5a:variable.{expressions::Class.method5}()*/
+exprInstanceInvocation5a(Class variable) => variable.method5();
+
+/*normal|limited.member: exprInstanceInvocation5b:variable.{Class.method5}(a: 42)*/
+/*verbose.member: exprInstanceInvocation5b:variable.{expressions::Class.method5}(a: 42)*/
+exprInstanceInvocation5b(Class variable) => variable.method5(a: 42);
+
+/*normal|limited.member: exprInstanceInvocation6a:variable.{Class.method6}(42)*/
+/*verbose.member: exprInstanceInvocation6a:variable.{expressions::Class.method6}(42)*/
+exprInstanceInvocation6a(Class variable) => variable.method6(42);
+
+/*normal|limited.member: exprInstanceInvocation6b:variable.{Class.method6}(42, b: 87)*/
+/*verbose.member: exprInstanceInvocation6b:variable.{expressions::Class.method6}(42, b: 87)*/
+exprInstanceInvocation6b(Class variable) => variable.method6(42, b: 87);
+
+/*normal|limited.member: exprInstanceInvocation7a:variable.{Class.method7}()*/
+/*verbose.member: exprInstanceInvocation7a:variable.{expressions::Class.method7}()*/
+exprInstanceInvocation7a(Class variable) => variable.method7();
+
+/*normal|limited.member: exprInstanceInvocation7b:variable.{Class.method7}(a: 42)*/
+/*verbose.member: exprInstanceInvocation7b:variable.{expressions::Class.method7}(a: 42)*/
+exprInstanceInvocation7b(Class variable) => variable.method7(a: 42);
+
+/*normal|limited.member: exprInstanceInvocation7c:variable.{Class.method7}(b: 87)*/
+/*verbose.member: exprInstanceInvocation7c:variable.{expressions::Class.method7}(b: 87)*/
+exprInstanceInvocation7c(Class variable) => variable.method7(b: 87);
+
+/*normal|limited.member: exprInstanceInvocation7d:variable.{Class.method7}(a: 42, b: 87)*/
+/*verbose.member: exprInstanceInvocation7d:variable.{expressions::Class.method7}(a: 42, b: 87)*/
+exprInstanceInvocation7d(Class variable) => variable.method7(a: 42, b: 87);
+
+/*normal|limited.member: exprInstanceInvocation7e:variable.{Class.method7}(b: 87, a: 42)*/
+/*verbose.member: exprInstanceInvocation7e:variable.{expressions::Class.method7}(b: 87, a: 42)*/
+exprInstanceInvocation7e(Class variable) => variable.method7(b: 87, a: 42);
+
+/*normal|limited.member: exprGenericInvocation1a:variable.{Class.genericMethod1}<dynamic>()*/
+/*verbose.member: exprGenericInvocation1a:variable.{expressions::Class.genericMethod1}<dynamic>()*/
+exprGenericInvocation1a(Class variable) => variable.genericMethod1();
+
+/*normal|limited.member: exprGenericInvocation1b:variable.{Class.genericMethod1}<int>()*/
+/*verbose.member: exprGenericInvocation1b:variable.{expressions::Class.genericMethod1}<dart.core::int>()*/
+exprGenericInvocation1b(Class variable) => variable.genericMethod1<int>();
+
+/*normal|limited.member: exprGenericInvocation2a:variable.{Class.genericMethod2}<dynamic, dynamic>()*/
+/*verbose.member: exprGenericInvocation2a:variable.{expressions::Class.genericMethod2}<dynamic, dynamic>()*/
+exprGenericInvocation2a(Class variable) => variable.genericMethod2();
+
+/*normal|limited.member: exprGenericInvocation2b:variable.{Class.genericMethod2}<int, String>()*/
+/*verbose.member: exprGenericInvocation2b:variable.{expressions::Class.genericMethod2}<dart.core::int, dart.core::String>()*/
+exprGenericInvocation2b(Class variable) =>
+    variable.genericMethod2<int, String>();
+
+/*member: exprDynamicInvocation:variable.method1()*/
+exprDynamicInvocation(variable) => variable.method1();
+
+/*normal|limited.member: exprObjectInvocation:variable.{Object.toString}()*/
+/*verbose.member: exprObjectInvocation:variable.{dart.core::Object.toString}()*/
+exprObjectInvocation(variable) => variable.toString();
+
+/*normal|limited.member: exprPrivateInstanceInvocation:variable.{Class._privateMethod}()*/
+/*verbose.member: exprPrivateInstanceInvocation:variable.{expressions::Class._privateMethod}()*/
+exprPrivateInstanceInvocation(Class variable) => variable._privateMethod();
+
+/*normal|limited.member: exprPrivateDynamicInvocation:variable._privateMethod()*/
+/*verbose.member: exprPrivateDynamicInvocation:variable.expressions::_privateMethod()*/
+exprPrivateDynamicInvocation(variable) => variable._privateMethod();
+
+/*normal|limited.member: exprTopLevelFieldGet:topLevelField*/
+/*verbose.member: exprTopLevelFieldGet:expressions::topLevelField*/
+exprTopLevelFieldGet() => topLevelField;
+
+/*normal|limited.member: exprTopLevelGetterGet:topLevelGetter*/
+/*verbose.member: exprTopLevelGetterGet:expressions::topLevelGetter*/
+exprTopLevelGetterGet() => topLevelGetter;
+
+/*normal|limited.member: exprTopLevelMethodTearOff:topLevelMethod*/
+/*verbose.member: exprTopLevelMethodTearOff:expressions::topLevelMethod*/
+exprTopLevelMethodTearOff() => topLevelMethod;
+
+/*normal|limited.member: exprTopLevelFieldSet:topLevelField = 42*/
+/*verbose.member: exprTopLevelFieldSet:expressions::topLevelField = 42*/
+exprTopLevelFieldSet() => topLevelField = 42;
+
+/*normal|limited.member: exprTopLevelSetterSet:topLevelSetter = 42*/
+/*verbose.member: exprTopLevelSetterSet:expressions::topLevelSetter = 42*/
+exprTopLevelSetterSet() => topLevelSetter = 42;
+
+/*normal|limited.member: exprTopLevelMethodInvocation:topLevelMethod()*/
+/*verbose.member: exprTopLevelMethodInvocation:expressions::topLevelMethod()*/
+exprTopLevelMethodInvocation() => topLevelMethod();
+
+/*normal|limited.member: exprStaticFieldGet:Class.staticField*/
+/*verbose.member: exprStaticFieldGet:expressions::Class.staticField*/
+exprStaticFieldGet() => Class.staticField;
+
+/*normal|limited.member: exprStaticGetterGet:Class.staticGetter*/
+/*verbose.member: exprStaticGetterGet:expressions::Class.staticGetter*/
+exprStaticGetterGet() => Class.staticGetter;
+
+/*normal|limited.member: exprStaticMethodTearOff:Class.staticMethod*/
+/*verbose.member: exprStaticMethodTearOff:expressions::Class.staticMethod*/
+exprStaticMethodTearOff() => Class.staticMethod;
+
+/*normal|limited.member: exprStaticFieldSet:Class.staticField = 42*/
+/*verbose.member: exprStaticFieldSet:expressions::Class.staticField = 42*/
+exprStaticFieldSet() => Class.staticField = 42;
+
+/*normal|limited.member: exprStaticSetterSet:Class.staticSetter = 42*/
+/*verbose.member: exprStaticSetterSet:expressions::Class.staticSetter = 42*/
+exprStaticSetterSet() => Class.staticSetter = 42;
+
+/*normal|limited.member: exprStaticMethodInvocation:Class.staticMethod()*/
+/*verbose.member: exprStaticMethodInvocation:expressions::Class.staticMethod()*/
+exprStaticMethodInvocation() => Class.staticMethod();
+
+/*normal|limited.member: exprInstantiation1:genericTopLevelMethod1<int>*/
+/*verbose.member: exprInstantiation1:expressions::genericTopLevelMethod1<dart.core::int>*/
+int Function(int) exprInstantiation1 = genericTopLevelMethod1;
+
+/*normal|limited.member: exprInstantiation2:genericTopLevelMethod2<bool, String>*/
+/*verbose.member: exprInstantiation2:expressions::genericTopLevelMethod2<dart.core::bool, dart.core::String>*/
+bool Function(bool, String) exprInstantiation2 = genericTopLevelMethod2;
+
+/*member: exprNot:!b*/
+exprNot(bool b) => !b;
+
+/*member: exprAnd:a && b*/
+exprAnd(bool a, bool b) => a && b;
+
+/*member: exprOr:a || b*/
+exprOr(bool a, bool b) => a || b;
+
+/*normal|limited.member: exprConditional1:c ?{int} 0 : 1*/
+/*verbose.member: exprConditional1:c ?{dart.core::int} 0 : 1*/
+exprConditional1(bool c) => c ? 0 : 1;
+
+/*normal|limited.member: exprConditional2:c ?{List<num>} <num>[] : <int>[]*/
+/*verbose.member: exprConditional2:c ?{dart.core::List<dart.core::num>} <dart.core::num>[] : <dart.core::int>[]*/
+exprConditional2(bool c) => c ? <num>[] : <int>[];
+
+/*member: exprStringConcatenation:"foo${a}bar${b}"*/
+exprStringConcatenation(int a, int b) => 'foo${a}bar$b';
+
+/*normal|limited.member: exprNew:new Class()*/
+/*verbose.member: exprNew:new expressions::Class()*/
+exprNew() => new Class();
+
+/*normal|limited.member: exprNewNamed:new Class.named()*/
+/*verbose.member: exprNewNamed:new expressions::Class.named()*/
+exprNewNamed() => new Class.named();
+
+/*normal|limited.member: exprNewGeneric:new GenericClass<int, bool>()*/
+/*verbose.member: exprNewGeneric:new expressions::GenericClass<dart.core::int, dart.core::bool>()*/
+exprNewGeneric() => new GenericClass<int, bool>();
+
+/*normal|limited.member: exprNewGenericNamed:new GenericClass<int, bool>.named()*/
+/*verbose.member: exprNewGenericNamed:new expressions::GenericClass<dart.core::int, dart.core::bool>.named()*/
+exprNewGenericNamed() => new GenericClass<int, bool>.named();
+
+/*normal|limited.member: exprIs:o is List<int>*/
+/*verbose.member: exprIs:o is{ForNonNullableByDefault} dart.core::List<dart.core::int>*/
+exprIs(o) => o is List<int>;
+
+/*normal|limited.member: exprAs:o as List<int>*/
+/*verbose.member: exprAs:o as{ForNonNullableByDefault} dart.core::List<dart.core::int>*/
+exprAs(o) => o as List<int>;
+
+/*member: exprNullCheck:o!*/
+exprNullCheck(o) => o!;
+
+/*member: exprThrow:throw "foo"*/
+exprThrow() => throw "foo";
+
+/*member: exprEmptyList:<dynamic>[]*/
+exprEmptyList() => [];
+
+/*normal|limited.member: exprEmptyTypedList:<int>[]*/
+/*verbose.member: exprEmptyTypedList:<dart.core::int>[]*/
+exprEmptyTypedList() => <int>[];
+
+/*normal|limited.member: exprList:<int>[0, 1]*/
+/*verbose.member: exprList:<dart.core::int>[0, 1]*/
+exprList() => [0, 1];
+
+/*normal|limited.member: exprEmptySet:<int>{}*/
+/*verbose.member: exprEmptySet:<dart.core::int>{}*/
+exprEmptySet() => <int>{};
+
+/*normal|limited.member: exprSet:<int>{0, 1}*/
+/*verbose.member: exprSet:<dart.core::int>{0, 1}*/
+exprSet() => {0, 1};
+
+/*member: exprEmptyMap:<dynamic, dynamic>{}*/
+exprEmptyMap() => {};
+
+/*normal|limited.member: exprEmptyTypedMap:<int, String>{}*/
+/*verbose.member: exprEmptyTypedMap:<dart.core::int, dart.core::String>{}*/
+exprEmptyTypedMap() => <int, String>{};
+
+/*normal|limited.member: exprMap:<int, String>{0: "foo", 1: "bar"}*/
+/*verbose.member: exprMap:<dart.core::int, dart.core::String>{0: "foo", 1: "bar"}*/
+exprMap() => {0: "foo", 1: "bar"};
+
+/*member: exprAwait:await o*/
+exprAwait(o) async => await o;
+
+/*member: exprLoadLibrary:prefix.loadLibrary()*/
+exprLoadLibrary() => prefix.loadLibrary();
+
+/*normal|limited.member: exprCheckLibraryIsLoaded:let final dynamic #0 = prefix.checkLibraryIsLoaded() in max<int>(0, 1)*/
+/*verbose.member: exprCheckLibraryIsLoaded:let final dynamic #0 = prefix.checkLibraryIsLoaded() in dart.math::max<dart.core::int>(0, 1)*/
+exprCheckLibraryIsLoaded() => prefix.max(0, 1);
+
+/*normal|limited.member: exprFunctionExpression:int (int i) => i*/
+/*verbose.member: exprFunctionExpression:dart.core::int (dart.core::int i) => i*/
+exprFunctionExpression() => (int i) => i;
+
+/*normal.member: exprFunctionExpressionBlock:int (int i) {
+  return i;
+}*/
+/*verbose.member: exprFunctionExpressionBlock:dart.core::int (dart.core::int i) {
+  return i;
+}*/
+/*limited.member: exprFunctionExpressionBlock:int (int i) { return i; }*/
+exprFunctionExpressionBlock() => (int i) {
+      return i;
+    };
+
+/*normal|limited.member: exprGenericFunctionExpression:T% <T extends Object?>(T% t) => t*/
+/*verbose.member: exprGenericFunctionExpression:T% <T extends dart.core::Object?>(T% t) => t*/
+exprGenericFunctionExpression() => <T>(T t) => t;
+
+/*normal.member: exprGenericFunctionExpressionBlock:T% <T extends Object?>(T% t) {
+  return t;
+}*/
+/*verbose.member: exprGenericFunctionExpressionBlock:T% <T extends dart.core::Object?>(T% t) {
+  return t;
+}*/
+/*limited.member: exprGenericFunctionExpressionBlock:T% <T extends Object?>(T% t) { return t; }*/
+exprGenericFunctionExpressionBlock() => <T>(T t) {
+      return t;
+    };
+
+/*normal|limited.member: exprNullAware:let final Class? #0 = variable in #0.{Object.==}(null) ?{dynamic} null : #0{Class}.{Class.field}*/
+/*verbose.member: exprNullAware:let final expressions::Class? #0 = variable in #0.{dart.core::Object.==}(null) ?{dynamic} null : #0{expressions::Class}.{expressions::Class.field}*/
+exprNullAware(Class? variable) => variable?.field;
+
+/*normal|limited.member: exprIfNull:let final int? #0 = i in #0.{num.==}(null) ?{int} 42 : #0{int}*/
+/*verbose.member: exprIfNull:let final dart.core::int? #0 = i in #0.{dart.core::num.==}(null) ?{dart.core::int} 42 : #0{dart.core::int}*/
+exprIfNull(int? i) => i ?? 42;
+
+/*normal|limited.member: exprNestedDeep:<Object>[1, <Object>[2, <Object>[3, <int>[4]]]]*/
+/*verbose.member: exprNestedDeep:<dart.core::Object>[1, <dart.core::Object>[2, <dart.core::Object>[3, <dart.core::int>[4]]]]*/
+exprNestedDeep() => [
+      1,
+      [
+        2,
+        [
+          3,
+          [4]
+        ]
+      ]
+    ];
+
+/*normal.member: exprNestedTooDeep:<Object>[1, <Object>[2, <Object>[3, <Object>[4, <int>[5]]]]]*/
+/*verbose.member: exprNestedTooDeep:<dart.core::Object>[1, <dart.core::Object>[2, <dart.core::Object>[3, <dart.core::Object>[4, <dart.core::int>[5]]]]]*/
+/*limited.member: exprNestedTooDeep:<Object>[1, <Object>[2, <Object>[3, <Object>[4, <int>[...]]]]]*/
+exprNestedTooDeep() => [
+      1,
+      [
+        2,
+        [
+          3,
+          [
+            4,
+            [5]
+          ]
+        ]
+      ]
+    ];
+
+/*normal|limited.member: exprManySiblings:<int>[1, 2, 3, 4]*/
+/*verbose.member: exprManySiblings:<dart.core::int>[1, 2, 3, 4]*/
+exprManySiblings() => [1, 2, 3, 4];
+
+/*normal.member: exprTooManySiblings:<int>[1, 2, 3, 4, 5]*/
+/*verbose.member: exprTooManySiblings:<dart.core::int>[1, 2, 3, 4, 5]*/
+/*limited.member: exprTooManySiblings:<int>[...]*/
+exprTooManySiblings() => [1, 2, 3, 4, 5];
+
+/*normal|limited.member: exprPrecedence1:1.{int.unary-}().{num.*}(2).{num.+}(3.{num./}(4)).{double.-}(5)*/
+/*verbose.member: exprPrecedence1:1.{dart.core::int.unary-}().{dart.core::num.*}(2).{dart.core::num.+}(3.{dart.core::num./}(4)).{dart.core::double.-}(5)*/
+exprPrecedence1() => -1 * 2 + 3 / 4 - 5;
+
+/*normal|limited.member: exprPrecedence2:1.{num.*}(2.{num.+}(3)).{num./}(4.{num.-}(5)).{double.unary-}()*/
+/*verbose.member: exprPrecedence2:1.{dart.core::num.*}(2.{dart.core::num.+}(3)).{dart.core::num./}(4.{dart.core::num.-}(5)).{dart.core::double.unary-}()*/
+exprPrecedence2() => -(1 * (2 + 3) / (4 - 5));
+
+/*normal|limited.member: exprPrecedence3:b ?{int} 0 : 1.{num.+}(2)*/
+/*verbose.member: exprPrecedence3:b ?{dart.core::int} 0 : 1.{dart.core::num.+}(2)*/
+exprPrecedence3(bool b) => b ? 0 : 1 + 2;
+
+/*normal|limited.member: exprPrecedence4:(b ?{int} 0 : 1).{num.+}(2)*/
+/*verbose.member: exprPrecedence4:(b ?{dart.core::int} 0 : 1).{dart.core::num.+}(2)*/
+exprPrecedence4(bool b) => (b ? 0 : 1) + 2;
diff --git a/pkg/front_end/test/text_representation/data/marker.options b/pkg/front_end/test/text_representation/data/marker.options
index a42cf6d..cd9d285 100644
--- a/pkg/front_end/test/text_representation/data/marker.options
+++ b/pkg/front_end/test/text_representation/data/marker.options
@@ -1,2 +1,3 @@
 normal=pkg/front_end/test/text_representation/text_representation_test.dart
-verbose=pkg/front_end/test/text_representation/text_representation_test.dart
\ No newline at end of file
+verbose=pkg/front_end/test/text_representation/text_representation_test.dart
+limited=pkg/front_end/test/text_representation/text_representation_test.dart
\ No newline at end of file
diff --git a/pkg/front_end/test/text_representation/data/statements.dart b/pkg/front_end/test/text_representation/data/statements.dart
new file mode 100644
index 0000000..7bf9169
--- /dev/null
+++ b/pkg/front_end/test/text_representation/data/statements.dart
@@ -0,0 +1,725 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*library: nnbd=true*/
+
+/*member: stmtEmpty:
+;*/
+stmtEmpty() {
+  ;
+}
+
+/*member: stmtExpression:
+o;*/
+stmtExpression(o) {
+  o;
+}
+
+/*member: stmtEmptyBlock:
+{}*/
+stmtEmptyBlock(o) {
+  {}
+}
+
+/*normal|verbose.member: stmtBlock:
+{
+  o;
+}*/
+/*limited.member: stmtBlock:
+{ o; }*/
+stmtBlock(o) {
+  {
+    o;
+  }
+}
+
+/*member: stmtAssert:
+assert(b);*/
+stmtAssert(bool b) {
+  assert(b);
+}
+
+/*member: stmtAssertMessage:
+assert(b, m);*/
+stmtAssertMessage(bool b, String m) {
+  assert(b, m);
+}
+
+/*normal|verbose.member: stmtLabeledStatement:
+label0:
+break label0;*/
+/*limited.member: stmtLabeledStatement:
+label0: break label0;*/
+stmtLabeledStatement() {
+  label:
+  break label;
+}
+
+/*member: stmtWhileTrue:
+while (true) {}*/
+stmtWhileTrue() {
+  while (true) {}
+}
+
+/*normal|verbose.member: stmtWhileBreak:
+label0:
+while (b) break label0;*/
+/*limited.member: stmtWhileBreak:
+label0: while (b) break label0;*/
+stmtWhileBreak(bool b) {
+  while (b) break;
+}
+
+/*member: stmtWhileEmptyBlock:
+while (b) {}*/
+stmtWhileEmptyBlock(bool b) {
+  while (b) {}
+}
+
+/*normal|verbose.member: stmtWhileBlockBreak:
+label0:
+while (b) {
+  break label0;
+}*/
+/*limited.member: stmtWhileBlockBreak:
+label0: while (b) { break label0; }*/
+stmtWhileBlockBreak(bool b) {
+  while (b) {
+    break;
+  }
+}
+
+/*member: stmtDoTrue:
+do {} while (true);*/
+stmtDoTrue() {
+  do {} while (true);
+}
+
+/*normal|verbose.member: stmtDoBreak:
+label0:
+do {
+  break label0;
+} while (true);*/
+/*limited.member: stmtDoBreak:
+label0: do { break label0; } while (true);*/
+stmtDoBreak() {
+  do {
+    break;
+  } while (true);
+}
+
+/*member: stmtForEmpty:
+for (; ; ) ;*/
+stmtForEmpty() {
+  for (;;);
+}
+
+/*normal.member: stmtFor:
+for (int i = 0; i.{num.<}(list.{List.length}); i = i.{num.+}(1)) {
+  list.{List.[]}(i);
+}*/
+/*verbose.member: stmtFor:
+for (dart.core::int i = 0; i.{dart.core::num.<}(list.{dart.core::List.length}); i = i.{dart.core::num.+}(1)) {
+  list.{dart.core::List.[]}(i);
+}*/
+/*limited.member: stmtFor:
+for (int i = 0; i.{num.<}(list.{List.length}); i = i.{num.+}(1)) { list.{List.[]}(i); }*/
+stmtFor(List list) {
+  for (int i = 0; i < list.length; i++) {
+    list[i];
+  }
+}
+
+/*normal.member: stmtForMulti:
+for (int i = 0, j = 0; i.{num.<}(list.{List.length}); i = i.{num.+}(1), j = j.{num.+}(1)) {
+  list.{List.[]}(i);
+}*/
+/*verbose.member: stmtForMulti:
+for (dart.core::int i = 0, j = 0; i.{dart.core::num.<}(list.{dart.core::List.length}); i = i.{dart.core::num.+}(1), j = j.{dart.core::num.+}(1)) {
+  list.{dart.core::List.[]}(i);
+}*/
+/*limited.member: stmtForMulti:
+for (int i = 0, j = 0; i.{num.<}(list.{List.length}); i = i.{num.+}(1), j = j.{num.+}(1)) { list.{List.[]}(i); }*/
+stmtForMulti(List list) {
+  for (int i = 0, j = 0; i < list.length; i++, j++) {
+    list[i];
+  }
+}
+
+/*member: stmtForInEmpty:
+for (dynamic e in list) ;*/
+stmtForInEmpty(List list) {
+  for (var e in list);
+}
+
+/*member: stmtForInEmptyBlock:
+for (dynamic e in list) {}*/
+stmtForInEmptyBlock(List list) {
+  for (var e in list) {}
+}
+
+/*normal|verbose.member: stmtForInBreak:
+label0:
+for (dynamic e in list) {
+  break label0;
+}*/
+/*limited.member: stmtForInBreak:
+label0: for (dynamic e in list) { break label0; }*/
+stmtForInBreak(List list) {
+  for (var e in list) {
+    break;
+  }
+}
+
+/*normal|verbose.member: stmtSwitch1:
+label0:
+switch (i) {
+  case 0:
+    break label0;
+  case 1:
+    continue "default:";
+  case 2:
+  case 3:
+  default:
+    return;
+}*/
+/*limited.member: stmtSwitch1:
+label0: switch (i) { case 0: break label0; case 1: continue "default:"; case 2: case 3: default: return; }*/
+stmtSwitch1(int i) {
+  switch (i) {
+    case 0:
+      break;
+    case 1:
+      continue label2;
+    label2:
+    case 2:
+    case 3:
+    default:
+      return;
+  }
+}
+
+/*normal|verbose.member: stmtSwitch2:
+label0:
+switch (i) {
+  case 0:
+  case 1:
+    break label0;
+  case 2:
+  case 3:
+    {
+      continue "case 0:";
+    }
+  default:
+    return;
+}*/
+/*limited.member: stmtSwitch2:
+label0: switch (i) { case 0: case 1: break label0; case 2: case 3: { continue "case 0:"; } default: return; }*/
+stmtSwitch2(int i) {
+  switch (i) {
+    label0:
+    case 0:
+    case 1:
+      break;
+    case 2:
+    case 3:
+      {
+        continue label0;
+      }
+    default:
+      return;
+  }
+}
+
+/*normal|verbose.member: stmtSwitch3:
+label0:
+switch (i) {
+  default:
+    break label0;
+}*/
+/*limited.member: stmtSwitch3:
+label0: switch (i) { default: break label0; }*/
+stmtSwitch3(int i) {
+  switch (i) {
+    default:
+      break;
+  }
+}
+
+/*member: stmtIf:
+if (b) return;*/
+stmtIf(bool b) {
+  if (b) return;
+}
+
+/*normal|verbose.member: stmtIfBlock:
+if (b) {
+  return;
+}*/
+/*limited.member: stmtIfBlock:
+if (b) { return; }*/
+stmtIfBlock(bool b) {
+  if (b) {
+    return;
+  }
+}
+
+/*member: stmtIfThen:
+if (b) return 0; else return 1;*/
+stmtIfThen(bool b) {
+  if (b)
+    return 0;
+  else
+    return 1;
+}
+
+/*normal|verbose.member: stmtIfThenBlock:
+if (b) {
+  return 0;
+} else {
+  return 1;
+}*/
+/*limited.member: stmtIfThenBlock:
+if (b) { return 0; } else { return 1; }*/
+stmtIfThenBlock(bool b) {
+  if (b) {
+    return 0;
+  } else {
+    return 1;
+  }
+}
+
+/*member: stmtReturn:
+return;*/
+stmtReturn() {
+  return;
+}
+
+/*member: stmtReturnExpression:
+return 1;*/
+stmtReturnExpression() {
+  return 1;
+}
+
+/*member: stmtTryCatchExceptionEmpty:
+try {} catch (e) {}*/
+stmtTryCatchExceptionEmpty() {
+  try {} catch (e) {}
+}
+
+/*normal|limited.member: stmtTryCatchExplicitOnEmpty:
+try {} on Object {}*/
+/*verbose.member: stmtTryCatchExplicitOnEmpty:
+try {} on dart.core::Object {}*/
+stmtTryCatchExplicitOnEmpty() {
+  try {} on Object {}
+}
+
+/*member: stmtTryCatchExplicitOnExceptionEmpty:
+try {} catch (e) {}*/
+stmtTryCatchExplicitOnExceptionEmpty() {
+  try {} on Object catch (e) {}
+}
+
+/*normal|verbose.member: stmtTryCatchException:
+try {
+  return;
+} catch (e) {
+  return;
+}*/
+/*limited.member: stmtTryCatchException:
+try { return; } catch (e) { return; }*/
+stmtTryCatchException() {
+  try {
+    return;
+  } catch (e) {
+    return;
+  }
+}
+
+/*normal|verbose.member: stmtTryCatchExceptionStackTrace:
+try {
+  return;
+} catch (e, s) {
+  return;
+}*/
+/*limited.member: stmtTryCatchExceptionStackTrace:
+try { return; } catch (e, s) { return; }*/
+stmtTryCatchExceptionStackTrace() {
+  try {
+    return;
+  } catch (e, s) {
+    return;
+  }
+}
+
+/*normal.member: stmtTryCatchOnEmpty:
+try {
+  return;
+} on String {
+  return;
+}*/
+/*verbose.member: stmtTryCatchOnEmpty:
+try {
+  return;
+} on dart.core::String {
+  return;
+}*/
+/*limited.member: stmtTryCatchOnEmpty:
+try { return; } on String { return; }*/
+stmtTryCatchOnEmpty() {
+  try {
+    return;
+  } on String {
+    return;
+  }
+}
+
+/*normal.member: stmtTryCatchOnException:
+try {
+  return;
+} on String catch (e) {
+  return;
+}*/
+/*verbose.member: stmtTryCatchOnException:
+try {
+  return;
+} on dart.core::String catch (e) {
+  return;
+}*/
+/*limited.member: stmtTryCatchOnException:
+try { return; } on String catch (e) { return; }*/
+stmtTryCatchOnException() {
+  try {
+    return;
+  } on String catch (e) {
+    return;
+  }
+}
+
+/*normal.member: stmtTryCatchOnExceptionStackTrace:
+try {
+  return;
+} on String catch (e, s) {
+  return;
+}*/
+/*verbose.member: stmtTryCatchOnExceptionStackTrace:
+try {
+  return;
+} on dart.core::String catch (e, s) {
+  return;
+}*/
+/*limited.member: stmtTryCatchOnExceptionStackTrace:
+try { return; } on String catch (e, s) { return; }*/
+stmtTryCatchOnExceptionStackTrace() {
+  try {
+    return;
+  } on String catch (e, s) {
+    return;
+  }
+}
+
+/*normal.member: stmtTryCatchOnMultiple:
+try {
+  return;
+} on int catch (e) {
+  return;
+} on String catch (e, s) {
+  return;
+} catch (e) {
+  return;
+}*/
+/*verbose.member: stmtTryCatchOnMultiple:
+try {
+  return;
+} on dart.core::int catch (e) {
+  return;
+} on dart.core::String catch (e, s) {
+  return;
+} catch (e) {
+  return;
+}*/
+/*limited.member: stmtTryCatchOnMultiple:
+try { return; } on int catch (e) { return; } on String catch (e, s) { return; } catch (e) { return; }*/
+stmtTryCatchOnMultiple() {
+  try {
+    return;
+  } on int catch (e) {
+    return;
+  } on String catch (e, s) {
+    return;
+  } catch (e) {
+    return;
+  }
+}
+
+/*member: stmtTryFinallyEmpty:
+try {} finally {}*/
+stmtTryFinallyEmpty() {
+  try {} finally {}
+}
+
+/*normal|verbose.member: stmtTryFinally:
+try {
+  return;
+} finally {
+  return;
+}*/
+/*limited.member: stmtTryFinally:
+try { return; } finally { return; }*/
+stmtTryFinally() {
+  try {
+    return;
+  } finally {
+    return;
+  }
+}
+
+/*normal|verbose.member: stmtTryCatchFinally:
+try {
+  return;
+} catch (e) {
+  return;
+} finally {
+  return;
+}*/
+/*limited.member: stmtTryCatchFinally:
+try { return; } catch (e) { return; } finally { return; }*/
+stmtTryCatchFinally() {
+  try {
+    return;
+  } catch (e) {
+    return;
+  } finally {
+    return;
+  }
+}
+
+/*normal|verbose.member: stmtTryCatchFinallyNested:
+try {
+  try {
+    return;
+  } catch (e) {
+    return;
+  }
+} finally {
+  return;
+}*/
+/*limited.member: stmtTryCatchFinallyNested:
+try { try { return; } catch (e) { return; } } finally { return; }*/
+stmtTryCatchFinallyNested() {
+  try {
+    try {
+      return;
+    } catch (e) {
+      return;
+    }
+  } finally {
+    return;
+  }
+}
+
+/*member: stmtYield:
+yield 0;*/
+stmtYield() sync* {
+  yield 0;
+}
+
+/*normal|limited.member: stmtYieldStar:
+yield* <int>[0];*/
+/*verbose.member: stmtYieldStar:
+yield* <dart.core::int>[0];*/
+stmtYieldStar() sync* {
+  yield* [0];
+}
+
+/*member: stmtVariableDeclaration:
+dynamic o;*/
+stmtVariableDeclaration() {
+  var o;
+}
+
+/*normal|limited.member: stmtVariableDeclarationInitializer:
+int o = 42;*/
+/*verbose.member: stmtVariableDeclarationInitializer:
+dart.core::int o = 42;*/
+stmtVariableDeclarationInitializer() {
+  var o = 42;
+}
+
+/*normal|limited.member: stmtVariableDeclarationFinal:
+final int o = 42;*/
+/*verbose.member: stmtVariableDeclarationFinal:
+final dart.core::int o = 42;*/
+stmtVariableDeclarationFinal() {
+  final o = 42;
+}
+
+/*normal|limited.member: stmtVariableDeclarationLate:
+late int i = 42;*/
+/*verbose.member: stmtVariableDeclarationLate:
+late dart.core::int i = 42;*/
+stmtVariableDeclarationLate() {
+  late int i = 42;
+}
+
+/*normal.member: stmtVariableDeclarations:
+{
+  int i;
+  int j = 42;
+}*/
+/*verbose.member: stmtVariableDeclarations:
+{
+  dart.core::int i;
+  dart.core::int j = 42;
+}*/
+/*limited.member: stmtVariableDeclarations:
+{ int i; int j = 42; }*/
+stmtVariableDeclarations() {
+  {
+    int i, j = 42;
+  }
+}
+
+/*normal|limited.member: stmtFunctionDeclarationPositional:
+int localFunction(dynamic a, [dynamic b = 0]) => 0;*/
+/*verbose.member: stmtFunctionDeclarationPositional:
+dart.core::int localFunction(dynamic a, [dynamic b = 0]) => 0;*/
+stmtFunctionDeclarationPositional() {
+  int localFunction(a, [b = 0]) => 0;
+}
+
+/*normal.member: stmtFunctionDeclarationNamed:
+int localFunction(dynamic a, {dynamic b = 0, required dynamic c}) {
+  return 0;
+}*/
+/*verbose.member: stmtFunctionDeclarationNamed:
+dart.core::int localFunction(dynamic a, {dynamic b = 0, required dynamic c}) {
+  return 0;
+}*/
+/*limited.member: stmtFunctionDeclarationNamed:
+int localFunction(dynamic a, {dynamic b = 0, required dynamic c}) { return 0; }*/
+stmtFunctionDeclarationNamed() {
+  int localFunction(a, {b: 0, required c}) {
+    return 0;
+  }
+}
+
+/*normal|limited.member: stmtFunctionDeclarationGeneric:
+T% localFunction<T extends Object?, S extends num>(T% t, dynamic S) => t;*/
+/*verbose.member: stmtFunctionDeclarationGeneric:
+T% localFunction<T extends dart.core::Object?, S extends dart.core::num>(T% t, dynamic S) => t;*/
+stmtFunctionDeclarationGeneric() {
+  T localFunction<T, S extends num>(T t, S) => t;
+}
+
+/*normal|verbose.member: stmtNestedDeep:
+{
+  1;
+  {
+    2;
+    {
+      3;
+      {
+        4;
+      }
+    }
+  }
+}*/
+/*limited.member: stmtNestedDeep:
+{ 1; { 2; { 3; { 4; } } } }*/
+stmtNestedDeep() {
+  {
+    1;
+    {
+      2;
+      {
+        3;
+        {
+          4;
+        }
+      }
+    }
+  }
+}
+
+/*normal|verbose.member: stmtNestedTooDeep:
+{
+  1;
+  {
+    2;
+    {
+      3;
+      {
+        4;
+        {
+          5;
+          {
+            6;
+          }
+        }
+      }
+    }
+  }
+}*/
+/*limited.member: stmtNestedTooDeep:
+{ 1; { 2; { 3; { 4; { ... } } } } }*/
+stmtNestedTooDeep() {
+  {
+    1;
+    {
+      2;
+      {
+        3;
+        {
+          4;
+          {
+            5;
+            {
+              6;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+/*normal|verbose.member: stmtManySiblings:
+{
+  1;
+  2;
+  3;
+  4;
+}*/
+/*limited.member: stmtManySiblings:
+{ 1; 2; 3; 4; }*/
+stmtManySiblings() {
+  {
+    1;
+    2;
+    3;
+    4;
+  }
+}
+
+/*normal|verbose.member: stmtTooManySiblings:
+{
+  1;
+  2;
+  3;
+  4;
+  5;
+}*/
+/*limited.member: stmtTooManySiblings:
+{ ... }*/
+stmtTooManySiblings() {
+  {
+    1;
+    2;
+    3;
+    4;
+    5;
+  }
+}
diff --git a/pkg/front_end/test/text_representation/data/types.dart b/pkg/front_end/test/text_representation/data/types.dart
index 3be8e6b..029481c 100644
--- a/pkg/front_end/test/text_representation/data/types.dart
+++ b/pkg/front_end/test/text_representation/data/types.dart
@@ -5,53 +5,72 @@
 /*library: nnbd=true*/
 library test;
 
+import 'dart:async';
+
 typedef void Typedef1();
 typedef void Typedef2<T>(T o);
 typedef Typedef3 = void Function();
 typedef Typedef4<T> = void Function(T);
 typedef Typedef5<T> = void Function<S>(T, S);
 
-boolType(bool /*normal.bool*/ /*verbose.dart.core::bool*/ o1,
-    bool? /*normal.bool?*/ /*verbose.dart.core::bool?*/ o2) {}
-numType(num /*normal.num*/ /*verbose.dart.core::num*/ o1,
-    num? /*normal.num?*/ /*verbose.dart.core::num?*/ o2) {}
-intType(int /*normal.int*/ /*verbose.dart.core::int*/ o1,
-    int? /*normal.int?*/ /*verbose.dart.core::int?*/ o2) {}
-doubleType(double /*normal.double*/ /*verbose.dart.core::double*/ o1,
-    double? /*normal.double?*/ /*verbose.dart.core::double?*/ o2) {}
-stringType(String /*normal.String*/ /*verbose.dart.core::String*/ o1,
-    String? /*normal.String?*/ /*verbose.dart.core::String?*/ o2) {}
+boolType(bool /*normal|limited.bool*/ /*verbose.dart.core::bool*/ o1,
+    bool? /*normal|limited.bool?*/ /*verbose.dart.core::bool?*/ o2) {}
+numType(num /*normal|limited.num*/ /*verbose.dart.core::num*/ o1,
+    num? /*normal|limited.num?*/ /*verbose.dart.core::num?*/ o2) {}
+intType(int /*normal|limited.int*/ /*verbose.dart.core::int*/ o1,
+    int? /*normal|limited.int?*/ /*verbose.dart.core::int?*/ o2) {}
+doubleType(double /*normal|limited.double*/ /*verbose.dart.core::double*/ o1,
+    double? /*normal|limited.double?*/ /*verbose.dart.core::double?*/ o2) {}
+stringType(String /*normal|limited.String*/ /*verbose.dart.core::String*/ o1,
+    String? /*normal|limited.String?*/ /*verbose.dart.core::String?*/ o2) {}
 voidType(void /*void*/ o) {}
 dynamicType(dynamic /*dynamic*/ o) {}
 neverType(Never /*Never*/ o1, Never? /*Never?*/ o2) {}
-objectType(Object /*normal.Object*/ /*verbose.dart.core::Object*/ o1,
-    Object? /*normal.Object?*/ /*verbose.dart.core::Object?*/ o2) {}
+objectType(Object /*normal|limited.Object*/ /*verbose.dart.core::Object*/ o1,
+    Object? /*normal|limited.Object?*/ /*verbose.dart.core::Object?*/ o2) {}
 genericType1(
     List<int>
-        /*normal.List<int>*/
+        /*normal|limited.List<int>*/
         /*verbose.dart.core::List<dart.core::int>*/
         o1,
     List<int>?
-        /*normal.List<int>?*/
+        /*normal|limited.List<int>?*/
         /*verbose.dart.core::List<dart.core::int>?*/
         o2,
     List<int?>
-        /*normal.List<int?>*/
+        /*normal|limited.List<int?>*/
         /*verbose.dart.core::List<dart.core::int?>*/
         o3,
     List<int?>?
-        /*normal.List<int?>?*/
+        /*normal|limited.List<int?>?*/
         /*verbose.dart.core::List<dart.core::int?>?*/
         o4) {}
 genericType2(
     Map<int, String>
-        /*normal.Map<int, String>*/
+        /*normal|limited.Map<int, String>*/
         /*verbose.dart.core::Map<dart.core::int, dart.core::String>*/
         o1,
     Map<int, String?>?
-        /*normal.Map<int, String?>?*/
+        /*normal|limited.Map<int, String?>?*/
         /*verbose.dart.core::Map<dart.core::int, dart.core::String?>?*/
         o2) {}
+futureOrType(
+    FutureOr<int>
+        /*normal|limited.FutureOr<int>*/
+        /*verbose.FutureOr<dart.core::int>*/
+        o1,
+    FutureOr<int>?
+        /*normal|limited.FutureOr<int>?*/
+        /*verbose.FutureOr<dart.core::int>?*/
+        o2,
+    FutureOr<int?>
+        /*normal|limited.FutureOr<int?>*/
+        /*verbose.FutureOr<dart.core::int?>*/
+        o3,
+    FutureOr<int?>?
+        /*normal|limited.FutureOr<int?>?*/
+        /*verbose.FutureOr<dart.core::int?>?*/
+        o4) {}
 typeVariableType1<T>(T /*T%*/ o1, T? /*T?*/ o2) {}
 typeVariableType2<T extends num>(T /*T*/ o1, T? /*T?*/ o2) {}
 typeVariableType3<T extends S, S>(
@@ -64,65 +83,65 @@
     void Function()? /*void Function()?*/ o2) {}
 functionType2(
     int Function(int)
-        /*normal.int Function(int)*/
+        /*normal|limited.int Function(int)*/
         /*verbose.dart.core::int Function(dart.core::int)*/
         o1,
     int? Function(int?)
-        /*normal.int? Function(int?)*/
+        /*normal|limited.int? Function(int?)*/
         /*verbose.dart.core::int? Function(dart.core::int?)*/
         o2) {}
 functionType3(
     int Function(int, String)
-        /*normal.int Function(int, String)*/
+        /*normal|limited.int Function(int, String)*/
         /*verbose.dart.core::int Function(dart.core::int, dart.core::String)*/
         o) {}
 functionType4(
     int Function([int])
-        /*normal.int Function([int])*/
+        /*normal|limited.int Function([int])*/
         /*verbose.dart.core::int Function([dart.core::int])*/
         o1,
     int Function([int?])
-        /*normal.int Function([int?])*/
+        /*normal|limited.int Function([int?])*/
         /*verbose.dart.core::int Function([dart.core::int?])*/
         o2) {}
 functionType5(
     int Function([int, String])
-        /*normal.int Function([int, String])*/
+        /*normal|limited.int Function([int, String])*/
         /*verbose.dart.core::int Function([dart.core::int, dart.core::String])*/
         o) {}
 functionType6(
     int Function({int a})
-        /*normal.int Function({a: int})*/
-        /*verbose.dart.core::int Function({a: int})*/
+        /*normal|limited.int Function({a: int})*/
+        /*verbose.dart.core::int Function({a: dart.core::int})*/
         o1,
     int Function({int? a})
-        /*normal.int Function({a: int?})*/
-        /*verbose.dart.core::int Function({a: int?})*/
+        /*normal|limited.int Function({a: int?})*/
+        /*verbose.dart.core::int Function({a: dart.core::int?})*/
         o2) {}
 functionType7(
     int Function({int a, String b})
-        /*normal.int Function({a: int, b: String})*/
-        /*verbose.dart.core::int Function({a: int, b: String})*/
+        /*normal|limited.int Function({a: int, b: String})*/
+        /*verbose.dart.core::int Function({a: dart.core::int, b: dart.core::String})*/
         o) {}
 functionType8(
     int Function(int, {String b})
-        /*normal.int Function(int, {b: String})*/
-        /*verbose.dart.core::int Function(dart.core::int, {b: String})*/
+        /*normal|limited.int Function(int, {b: String})*/
+        /*verbose.dart.core::int Function(dart.core::int, {b: dart.core::String})*/
         o) {}
 functionType9(
     int Function({required int a, String b})
-        /*normal.int Function({required a: int, b: String})*/
-        /*verbose.dart.core::int Function({required a: int, b: String})*/
+        /*normal|limited.int Function({required a: int, b: String})*/
+        /*verbose.dart.core::int Function({required a: dart.core::int, b: dart.core::String})*/
         o) {}
 functionType10(
     int Function({int a, required String b})
-        /*normal.int Function({a: int, required b: String})*/
-        /*verbose.dart.core::int Function({a: int, required b: String})*/
+        /*normal|limited.int Function({a: int, required b: String})*/
+        /*verbose.dart.core::int Function({a: dart.core::int, required b: dart.core::String})*/
         o) {}
 functionType11(
     int Function({required int a, required String b})
-        /*normal.int Function({required a: int, required b: String})*/
-        /*verbose.dart.core::int Function({required a: int, required b: String})*/
+        /*normal|limited.int Function({required a: int, required b: String})*/
+        /*verbose.dart.core::int Function({required a: dart.core::int, required b: dart.core::String})*/
         o) {}
 genericFunctionType1(void Function<T>() /*void Function<T>()*/ o) {}
 genericFunctionType2(T Function<T>(T, T?) /*T% Function<T>(T%, T?)*/ o) {}
@@ -130,83 +149,85 @@
     T Function<T, S>(T, S, T?, S?) /*T% Function<T, S>(T%, S%, T?, S?)*/ o) {}
 genericFunctionType4(
     T Function<T extends num>([T, T?])
-        /*normal.T Function<T extends num>([T, T?])*/
+        /*normal|limited.T Function<T extends num>([T, T?])*/
         /*verbose.T Function<T extends dart.core::num>([T, T?])*/
         o) {}
 // TODO(johnniwinther): Support interdependent function type variables.
 //genericFunctionType5(T Function<T, S extends T>([T, S]) o) {}
 //genericFunctionType6(T Function<T extends S, S>([T, S]) o) {}
-typedefType1(Typedef1 /*normal.Typedef1*/ /*verbose.test::Typedef1*/ o) {}
+typedefType1(
+    Typedef1 /*normal|limited.Typedef1*/ /*verbose.test::Typedef1*/ o) {}
 typedefType2(
     Typedef2
-        /*normal.Typedef2<dynamic>*/
+        /*normal|limited.Typedef2<dynamic>*/
         /*verbose.test::Typedef2<dynamic>*/
         o) {}
 typedefType3(
     Typedef2<int>
-        /*normal.Typedef2<int>*/
+        /*normal|limited.Typedef2<int>*/
         /*verbose.test::Typedef2<dart.core::int>*/
         o1,
     Typedef2<int?>
-        /*normal.Typedef2<int?>*/
+        /*normal|limited.Typedef2<int?>*/
         /*verbose.test::Typedef2<dart.core::int?>*/
         o2) {}
-typedefType4(Typedef3 /*normal.Typedef3*/ /*verbose.test::Typedef3*/ o) {}
+typedefType4(
+    Typedef3 /*normal|limited.Typedef3*/ /*verbose.test::Typedef3*/ o) {}
 typedefType5(
     Typedef4
-        /*normal.Typedef4<dynamic>*/
+        /*normal|limited.Typedef4<dynamic>*/
 /*verbose.test::Typedef4<dynamic>*/
         o) {}
 typedefType7(
     Typedef4<int>
-        /*normal.Typedef4<int>*/
+        /*normal|limited.Typedef4<int>*/
         /*verbose.test::Typedef4<dart.core::int>*/
         o1,
     Typedef4<int>?
-        /*normal.Typedef4<int>?*/
+        /*normal|limited.Typedef4<int>?*/
         /*verbose.test::Typedef4<dart.core::int>?*/
         o2) {}
 typedefType8(
     Typedef5
-        /*normal.Typedef5<dynamic>*/
+        /*normal|limited.Typedef5<dynamic>*/
         /*verbose.test::Typedef5<dynamic>*/
         o) {}
 typedefType9(
     Typedef5<int>
-        /*normal.Typedef5<int>*/
+        /*normal|limited.Typedef5<int>*/
         /*verbose.test::Typedef5<dart.core::int>*/
         o1,
     Typedef5<int?>?
-        /*normal.Typedef5<int?>?*/
+        /*normal|limited.Typedef5<int?>?*/
         /*verbose.test::Typedef5<dart.core::int?>?*/
         o2) {}
 
 method() {
   var /*dynamic Function<T>(T%, T?)*/ o1 =
-      /*normal.typeVariableType1*/
+      /*normal|limited.typeVariableType1*/
       /*verbose.test::typeVariableType1*/
       typeVariableType1;
-  var /*normal.dynamic Function<T extends num>(T, T?)*/
+  var /*normal|limited.dynamic Function<T extends num>(T, T?)*/
       /*verbose.dynamic Function<T extends dart.core::num>(T, T?)*/ o2 =
-      /*normal.typeVariableType2*/
+      /*normal|limited.typeVariableType2*/
       /*verbose.test::typeVariableType2*/
       typeVariableType2;
   var /*dynamic Function<T extends S%, S>(T%, S%, T?, S?)*/ o3 =
-      /*normal.typeVariableType3*/
+      /*normal|limited.typeVariableType3*/
       /*verbose.test::typeVariableType3*/
       typeVariableType3;
   var /*dynamic Function<T, S extends T%>(T%, S%, T?, S?)*/ o4 =
-      /*normal.typeVariableType4*/
+      /*normal|limited.typeVariableType4*/
       /*verbose.test::typeVariableType4*/
       typeVariableType4;
-  var /*normal.dynamic Function<T extends Object>(T, T?)*/
+  var /*normal|limited.dynamic Function<T extends Object>(T, T?)*/
       /*verbose.dynamic Function<T extends dart.core::Object>(T, T?)*/ o5 =
-      /*normal.typeVariableType5*/
+      /*normal|limited.typeVariableType5*/
       /*verbose.test::typeVariableType5*/
       typeVariableType5;
-  var /*normal.dynamic Function<T extends Object?>(T%, T?)*/
+  var /*normal|limited.dynamic Function<T extends Object?>(T%, T?)*/
       /*verbose.dynamic Function<T extends dart.core::Object?>(T%, T?)*/ o6 =
-      /*normal.typeVariableType6*/
+      /*normal|limited.typeVariableType6*/
       /*verbose.test::typeVariableType6*/
       typeVariableType6;
 
diff --git a/pkg/front_end/test/text_representation/data/types_opt_out.dart b/pkg/front_end/test/text_representation/data/types_opt_out.dart
index 85c5a2c..5db349b 100644
--- a/pkg/front_end/test/text_representation/data/types_opt_out.dart
+++ b/pkg/front_end/test/text_representation/data/types_opt_out.dart
@@ -7,31 +7,41 @@
 /*library: nnbd=false*/
 library test;
 
+import 'dart:async';
+
 typedef void Typedef1();
 typedef void Typedef2<T>(T o);
 typedef Typedef3 = void Function();
 typedef Typedef4<T> = void Function(T);
 typedef Typedef5<T> = void Function<S>(T, S);
 
-boolType(bool /*normal.bool**/ /*verbose.dart.core::bool**/ o) {}
-numType(num /*normal.num**/ /*verbose.dart.core::num**/ o) {}
-intType(int /*normal.int**/ /*verbose.dart.core::int**/ o) {}
-doubleType(double /*normal.double**/ /*verbose.dart.core::double**/ o) {}
-stringType(String /*normal.String**/ /*verbose.dart.core::String**/ o) {}
+boolType(bool /*normal|limited.bool**/ /*verbose.dart.core::bool**/ o) {}
+numType(num /*normal|limited.num**/ /*verbose.dart.core::num**/ o) {}
+intType(int /*normal|limited.int**/ /*verbose.dart.core::int**/ o) {}
+doubleType(
+    double /*normal|limited.double**/ /*verbose.dart.core::double**/ o) {}
+stringType(
+    String /*normal|limited.String**/ /*verbose.dart.core::String**/ o) {}
 voidType(void /*void*/ o) {}
 dynamicType(dynamic /*dynamic*/ o) {}
 neverType(Never /*Never**/ o) {}
-objectType(Object /*normal.Object**/ /*verbose.dart.core::Object**/ o) {}
+objectType(
+    Object /*normal|limited.Object**/ /*verbose.dart.core::Object**/ o) {}
 genericType1(
     List<int>
-        /*normal.List<int*>**/
+        /*normal|limited.List<int*>**/
         /*verbose.dart.core::List<dart.core::int*>**/
         o) {}
 genericType2(
     Map<int, String>
-        /*normal.Map<int*, String*>**/
+        /*normal|limited.Map<int*, String*>**/
         /*verbose.dart.core::Map<dart.core::int*, dart.core::String*>**/
         o) {}
+futureOrType(
+    FutureOr<int>
+        /*normal|limited.FutureOr<int*>**/
+        /*verbose.FutureOr<dart.core::int*>**/
+        o) {}
 typeVariableType1<T>(T /*T**/ o) {}
 typeVariableType2<T extends num>(T /*T**/ o) {}
 typeVariableType3<T extends S, S>(T /*T**/ o, S /*S**/ p) {}
@@ -40,113 +50,114 @@
 functionType1(void Function() /*void Function()**/ o) {}
 functionType2(
     int Function(int)
-        /*normal.int* Function(int*)**/
+        /*normal|limited.int* Function(int*)**/
         /*verbose.dart.core::int* Function(dart.core::int*)**/
         o) {}
 functionType3(
     int Function(int, String)
-        /*normal.int* Function(int*, String*)**/
+        /*normal|limited.int* Function(int*, String*)**/
         /*verbose.dart.core::int* Function(dart.core::int*, dart.core::String*)**/
         o) {}
 functionType4(
     int Function([int])
-        /*normal.int* Function([int*])**/
+        /*normal|limited.int* Function([int*])**/
         /*verbose.dart.core::int* Function([dart.core::int*])**/
         o) {}
 functionType5(
     int Function([int, String])
-        /*normal.int* Function([int*, String*])**/
+        /*normal|limited.int* Function([int*, String*])**/
         /*verbose.dart.core::int* Function([dart.core::int*, dart.core::String*])**/
         o) {}
 functionType6(
     int Function({int a})
-        /*normal.int* Function({a: int*})**/
-        /*verbose.dart.core::int* Function({a: int*})**/
+        /*normal|limited.int* Function({a: int*})**/
+        /*verbose.dart.core::int* Function({a: dart.core::int*})**/
         o) {}
 functionType7(
     int Function({int a, String b})
-        /*normal.int* Function({a: int*, b: String*})**/
-        /*verbose.dart.core::int* Function({a: int*, b: String*})**/
+        /*normal|limited.int* Function({a: int*, b: String*})**/
+        /*verbose.dart.core::int* Function({a: dart.core::int*, b: dart.core::String*})**/
         o) {}
 functionType8(
     int Function(int, {String b})
-        /*normal.int* Function(int*, {b: String*})**/
-        /*verbose.dart.core::int* Function(dart.core::int*, {b: String*})**/
+        /*normal|limited.int* Function(int*, {b: String*})**/
+        /*verbose.dart.core::int* Function(dart.core::int*, {b: dart.core::String*})**/
         o) {}
 functionType9(
     int Function({int a, String b})
-        /*normal.int* Function({a: int*, b: String*})**/
-        /*verbose.dart.core::int* Function({a: int*, b: String*})**/
+        /*normal|limited.int* Function({a: int*, b: String*})**/
+        /*verbose.dart.core::int* Function({a: dart.core::int*, b: dart.core::String*})**/
         o) {}
 genericFunctionType1(void Function<T>() /*void Function<T>()**/ o) {}
 genericFunctionType2(T Function<T>(T) /*T* Function<T>(T*)**/ o) {}
 genericFunctionType3(T Function<T, S>(T, S) /*T* Function<T, S>(T*, S*)**/ o) {}
 genericFunctionType4(
     T Function<T extends num>([T])
-        /*normal.T* Function<T extends num*>([T*])**/
+        /*normal|limited.T* Function<T extends num*>([T*])**/
         /*verbose.T* Function<T extends dart.core::num*>([T*])**/
         o) {}
 // TODO(johnniwinther): Support interdependent function type variables.
 //genericFunctionType5(T Function<T, S extends T>([T, S]) o) {}
 //genericFunctionType6(T Function<T extends S, S>([T, S]) o) {}
-typedefType1(Typedef1 /*normal.Typedef1**/ /*verbose.test::Typedef1**/ o) {}
+typedefType1(
+    Typedef1 /*normal|limited.Typedef1**/ /*verbose.test::Typedef1**/ o) {}
 typedefType2(
     Typedef2
-        /*normal.Typedef2<dynamic>**/
+        /*normal|limited.Typedef2<dynamic>**/
         /*verbose.test::Typedef2<dynamic>**/
         o) {}
 typedefType3(
     Typedef2<int>
-        /*normal.Typedef2<int*>**/
+        /*normal|limited.Typedef2<int*>**/
         /*verbose.test::Typedef2<dart.core::int*>**/
         o) {}
 typedefType4(
     Typedef3
-        /*normal.Typedef3**/
+        /*normal|limited.Typedef3**/
         /*verbose.test::Typedef3**/
         o) {}
 typedefType5(
     Typedef4
-        /*normal.Typedef4<dynamic>**/
+        /*normal|limited.Typedef4<dynamic>**/
         /*verbose.test::Typedef4<dynamic>**/
         o) {}
 typedefType7(
     Typedef4<int>
-        /*normal.Typedef4<int*>**/
+        /*normal|limited.Typedef4<int*>**/
         /*verbose.test::Typedef4<dart.core::int*>**/
         o) {}
 typedefType8(
     Typedef5
-        /*normal.Typedef5<dynamic>**/
+        /*normal|limited.Typedef5<dynamic>**/
         /*verbose.test::Typedef5<dynamic>**/
         o) {}
 typedefType9(
     Typedef5<int>
-        /*normal.Typedef5<int*>**/
+        /*normal|limited.Typedef5<int*>**/
         /*verbose.test::Typedef5<dart.core::int*>**/
         o) {}
 
 method() {
   var /*dynamic Function<T>(T*)**/ o1 =
-      /*normal.typeVariableType1*/
+      /*normal|limited.typeVariableType1*/
       /*verbose.test::typeVariableType1*/
       typeVariableType1;
-  var /*normal.dynamic Function<T extends num*>(T*)**/
+  var /*normal|limited.dynamic Function<T extends num*>(T*)**/
       /*verbose.dynamic Function<T extends dart.core::num*>(T*)**/ o2 =
-      /*normal.typeVariableType2*/
+      /*normal|limited.typeVariableType2*/
       /*verbose.test::typeVariableType2*/
       typeVariableType2;
   var /*dynamic Function<T extends S*, S>(T*, S*)**/ o3 =
-      /*normal.typeVariableType3*/
+      /*normal|limited.typeVariableType3*/
       /*verbose.test::typeVariableType3*/
       typeVariableType3;
   var /*dynamic Function<T, S extends T*>(T*, S*)**/ o4 =
-      /*normal.typeVariableType4*/
+      /*normal|limited.typeVariableType4*/
       /*verbose.test::typeVariableType4*/
       typeVariableType4;
-  var /*normal.dynamic Function<T extends Object*>(T*)**/
+  var /*normal|limited.dynamic Function<T extends Object*>(T*)**/
       /*verbose.dynamic Function<T extends dart.core::Object*>(T*)**/ o5 =
-      /*normal.typeVariableType5*/
+      /*normal|limited.typeVariableType5*/
       /*verbose.test::typeVariableType5*/
       typeVariableType5;
 
diff --git a/pkg/front_end/test/text_representation/empty_reference_test.dart b/pkg/front_end/test/text_representation/empty_reference_test.dart
new file mode 100644
index 0000000..362672b
--- /dev/null
+++ b/pkg/front_end/test/text_representation/empty_reference_test.dart
@@ -0,0 +1,152 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import 'package:kernel/ast.dart';
+import 'text_representation_test.dart';
+
+testExpression(Expression node, String normal,
+    {String verbose, String limited}) {
+  Expect.stringEquals(normal, node.toText(normalStrategy),
+      "Unexpected normal strategy text for ${node.runtimeType}");
+  Expect.stringEquals(verbose ?? normal, node.toText(verboseStrategy),
+      "Unexpected verbose strategy text for ${node.runtimeType}");
+  Expect.stringEquals(limited ?? normal, node.toText(limitedStrategy),
+      "Unexpected limited strategy text for ${node.runtimeType}");
+}
+
+testType(DartType node, String normal, {String verbose, String limited}) {
+  Expect.stringEquals(normal, node.toText(normalStrategy),
+      "Unexpected normal strategy text for ${node.runtimeType}");
+  Expect.stringEquals(verbose ?? normal, node.toText(verboseStrategy),
+      "Unexpected verbose strategy text for ${node.runtimeType}");
+  Expect.stringEquals(limited ?? normal, node.toText(limitedStrategy),
+      "Unexpected limited strategy text for ${node.runtimeType}");
+}
+
+main() {
+  testTypes();
+  testMembers();
+}
+
+void testTypes() {
+  testType(new InterfaceType.byReference(null, Nullability.nonNullable, []),
+      '<missing-class-reference>');
+  testType(new TypedefType.byReference(null, Nullability.nonNullable, []),
+      '<missing-typedef-reference>');
+
+  Reference unlinkedClassName = new Reference();
+  testType(
+      new InterfaceType.byReference(
+          unlinkedClassName, Nullability.nonNullable, []),
+      '<unlinked-class-reference>');
+  testType(
+      new TypedefType.byReference(
+          unlinkedClassName, Nullability.nonNullable, []),
+      '<unlinked-typedef-reference>');
+
+  CanonicalName root = new CanonicalName.root();
+  Reference rootReference = new Reference()..canonicalName = root;
+  testType(
+      new InterfaceType.byReference(rootReference, Nullability.nonNullable, []),
+      '<root>');
+  testType(
+      new TypedefType.byReference(rootReference, Nullability.nonNullable, []),
+      '<root>');
+
+  CanonicalName library = root.getChild('library');
+  Reference libraryReference = new Reference()..canonicalName = library;
+  testType(
+      new InterfaceType.byReference(
+          libraryReference, Nullability.nonNullable, []),
+      'library');
+  testType(
+      new TypedefType.byReference(
+          libraryReference, Nullability.nonNullable, []),
+      'library');
+
+  CanonicalName className = library.getChild('Class');
+  Reference classNameReference = new Reference()..canonicalName = className;
+  testType(
+      new InterfaceType.byReference(
+          classNameReference, Nullability.nonNullable, []),
+      'Class',
+      verbose: 'library::Class');
+  testType(
+      new TypedefType.byReference(
+          classNameReference, Nullability.nonNullable, []),
+      'Class',
+      verbose: 'library::Class');
+}
+
+void testMembers() {
+  testExpression(new PropertyGet(new IntLiteral(0), new Name('foo')), '''
+0.foo''');
+  testExpression(new StaticGet(null), '''
+<missing-member-reference>''');
+
+  Reference unlinkedMemberName = new Reference();
+  testExpression(
+      new PropertyGet.byReference(
+          new IntLiteral(0), new Name('foo'), unlinkedMemberName),
+      '''
+0.foo''');
+  testExpression(new StaticGet.byReference(unlinkedMemberName), '''
+<unlinked-member-reference>''');
+
+  CanonicalName root = new CanonicalName.root();
+  Reference rootReference = new Reference()..canonicalName = root;
+  testExpression(
+      new PropertyGet.byReference(
+          new IntLiteral(0), new Name('foo'), rootReference),
+      '''
+0.foo''');
+  testExpression(new StaticGet.byReference(rootReference), '''
+<root>''');
+
+  CanonicalName library = root.getChild('library');
+  Reference libraryReference = new Reference()..canonicalName = library;
+  testExpression(
+      new PropertyGet.byReference(
+          new IntLiteral(0), new Name('foo'), libraryReference),
+      '''
+0.foo''');
+  testExpression(new StaticGet.byReference(libraryReference), '''
+library''');
+
+  CanonicalName topLevelMemberName = library.getChild('member');
+  Reference topLevelMemberNameReference = new Reference()
+    ..canonicalName = topLevelMemberName;
+  testExpression(
+      new PropertyGet.byReference(
+          new IntLiteral(0), new Name('foo'), topLevelMemberNameReference),
+      '''
+0.foo''');
+  testExpression(new StaticGet.byReference(topLevelMemberNameReference), '''
+member''', verbose: '''
+library::member''');
+
+  CanonicalName className = library.getChild('Class');
+  Reference classNameReference = new Reference()..canonicalName = className;
+  testExpression(
+      new PropertyGet.byReference(
+          new IntLiteral(0), new Name('foo'), classNameReference),
+      '''
+0.foo''');
+  testExpression(new StaticGet.byReference(classNameReference), '''
+Class''', verbose: '''
+library::Class''');
+
+  CanonicalName classMemberName = className.getChild('member');
+  Reference classMemberNameReference = new Reference()
+    ..canonicalName = classMemberName;
+  testExpression(
+      new PropertyGet.byReference(
+          new IntLiteral(0), new Name('foo'), classMemberNameReference),
+      '''
+0.foo''');
+  testExpression(new StaticGet.byReference(classMemberNameReference), '''
+Class.member''', verbose: '''
+library::Class.member''');
+}
diff --git a/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart b/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
new file mode 100644
index 0000000..308fa9e
--- /dev/null
+++ b/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
@@ -0,0 +1,657 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import 'package:front_end/src/fasta/kernel/forest.dart';
+import 'package:front_end/src/fasta/kernel/internal_ast.dart';
+import 'package:kernel/ast.dart';
+import 'text_representation_test.dart';
+
+testStatement(Statement node, String normal, {String verbose, String limited}) {
+  Expect.stringEquals(normal, node.toText(normalStrategy),
+      "Unexpected normal strategy text for ${node.runtimeType}");
+  Expect.stringEquals(verbose ?? normal, node.toText(verboseStrategy),
+      "Unexpected verbose strategy text for ${node.runtimeType}");
+  Expect.stringEquals(limited ?? normal, node.toText(limitedStrategy),
+      "Unexpected limited strategy text for ${node.runtimeType}");
+}
+
+testExpression(Expression node, String normal,
+    {String verbose, String limited}) {
+  Expect.stringEquals(normal, node.toText(normalStrategy),
+      "Unexpected normal strategy text for ${node.runtimeType}");
+  Expect.stringEquals(verbose ?? normal, node.toText(verboseStrategy),
+      "Unexpected verbose strategy text for ${node.runtimeType}");
+  Expect.stringEquals(limited ?? normal, node.toText(limitedStrategy),
+      "Unexpected limited strategy text for ${node.runtimeType}");
+}
+
+final Uri dummyUri = Uri.parse('test:dummy');
+
+main() {
+  _testVariableDeclarations();
+  _testTryStatement();
+  _testForInStatementWithSynthesizedVariable();
+  _testSwitchCaseImpl();
+  _testBreakStatementImpl();
+  _testCascade();
+  _testDeferredCheck();
+  _testFactoryConstructorInvocationJudgment();
+  _testFunctionDeclarationImpl();
+  _testIfNullExpression();
+  _testIntLiterals();
+  _testExpressionInvocation();
+  _testNamedFunctionExpressionJudgment();
+  _testNullAwareMethodInvocation();
+  _testNullAwarePropertyGet();
+  _testNullAwarePropertySet();
+  _testReturnStatementImpl();
+  _testVariableDeclarationImpl();
+  _testVariableGetImpl();
+  _testLoadLibraryImpl();
+  _testLoadLibraryTearOff();
+  _testIfNullPropertySet();
+  _testIfNullSet();
+  _testCompoundExtensionSet();
+  _testCompoundPropertySet();
+  _testPropertyPostIncDec();
+  _testLocalPostIncDec();
+  _testStaticPostIncDec();
+  _testSuperPostIncDec();
+  _testIndexGet();
+  _testIndexSet();
+  _testSuperIndexSet();
+  _testExtensionIndexSet();
+  _testIfNullIndexSet();
+  _testIfNullSuperIndexSet();
+  _testIfNullExtensionIndexSet();
+  _testCompoundIndexSet();
+  _testNullAwareCompoundSet();
+  _testNullAwareIfNullSet();
+  _testCompoundSuperIndexSet();
+  _testCompoundExtensionIndexSet();
+  _testExtensionSet();
+  _testNullAwareExtension();
+  _testPropertySetImpl();
+  _testExtensionTearOff();
+  _testEqualsExpression();
+  _testBinaryExpression();
+  _testUnaryExpression();
+  _testParenthesizedExpression();
+  _testSpreadElement();
+  _testIfElement();
+  _testForElement();
+  _testForInElement();
+  _testSpreadMapEntry();
+  _testIfMapEntry();
+  _testForMapEntry();
+  _testForInMapEntry();
+}
+
+void _testVariableDeclarations() {
+  testStatement(
+      const Forest().variablesDeclaration(
+          [new VariableDeclaration('a'), new VariableDeclaration('b')],
+          dummyUri),
+      '''
+dynamic a, b;''');
+  testStatement(
+      const Forest().variablesDeclaration([
+        new VariableDeclaration('a', type: const VoidType()),
+        new VariableDeclaration('b', initializer: new NullLiteral())
+      ], dummyUri),
+      '''
+void a, b = null;''');
+}
+
+void _testTryStatement() {
+  Block emptyBlock1 = new Block([]);
+  Block emptyBlock2 = new Block([]);
+  Block returnBlock1 = new Block([new ReturnStatement()]);
+  Block returnBlock2 = new Block([new ReturnStatement()]);
+  Catch emptyCatchBlock =
+      new Catch(new VariableDeclaration('e'), new Block([]));
+  Catch emptyCatchBlockOnVoid = new Catch(
+      new VariableDeclaration('e'), new Block([]),
+      guard: const VoidType());
+  Catch returnCatchBlock = new Catch(
+      new VariableDeclaration('e'), new Block([new ReturnStatement()]));
+  Catch returnCatchBlockOnVoid = new Catch(
+      new VariableDeclaration('e'), new Block([new ReturnStatement()]),
+      guard: const VoidType());
+
+  testStatement(new TryStatement(emptyBlock1, [], emptyBlock2), '''
+try {} finally {}''');
+
+  testStatement(new TryStatement(returnBlock1, [], returnBlock2), '''
+try {
+  return;
+} finally {
+  return;
+}''', limited: '''
+try { return; } finally { return; }''');
+
+  testStatement(new TryStatement(emptyBlock1, [emptyCatchBlock], null), '''
+try {} catch (e) {}''');
+
+  testStatement(
+      new TryStatement(emptyBlock1, [emptyCatchBlockOnVoid], null), '''
+try {} on void catch (e) {}''');
+
+  testStatement(
+      new TryStatement(
+          emptyBlock1, [emptyCatchBlockOnVoid, emptyCatchBlock], null),
+      '''
+try {} on void catch (e) {} catch (e) {}''');
+
+  testStatement(
+      new TryStatement(
+          emptyBlock1, [emptyCatchBlockOnVoid, emptyCatchBlock], emptyBlock2),
+      '''
+try {} on void catch (e) {} catch (e) {} finally {}''');
+
+  testStatement(new TryStatement(returnBlock1, [returnCatchBlock], null), '''
+try {
+  return;
+} catch (e) {
+  return;
+}''', limited: '''
+try { return; } catch (e) { return; }''');
+
+  testStatement(
+      new TryStatement(returnBlock1, [returnCatchBlockOnVoid], null), '''
+try {
+  return;
+} on void catch (e) {
+  return;
+}''',
+      limited: '''
+try { return; } on void catch (e) { return; }''');
+
+  testStatement(
+      new TryStatement(
+          returnBlock1, [returnCatchBlockOnVoid, returnCatchBlock], null),
+      '''
+try {
+  return;
+} on void catch (e) {
+  return;
+} catch (e) {
+  return;
+}''',
+      limited: '''
+try { return; } on void catch (e) { return; } catch (e) { return; }''');
+
+  testStatement(
+      new TryStatement(returnBlock1, [returnCatchBlockOnVoid, returnCatchBlock],
+          returnBlock2),
+      '''
+try {
+  return;
+} on void catch (e) {
+  return;
+} catch (e) {
+  return;
+} finally {
+  return;
+}''',
+      limited: '''
+try { return; } on void catch (e) { return; } catch (e) { return; } finally { return; }''');
+}
+
+void _testForInStatementWithSynthesizedVariable() {
+  // TODO(johnniwinther): Test ForInStatementWithSynthesizedVariable
+}
+
+void _testSwitchCaseImpl() {
+  Expression expression = new NullLiteral();
+  Expression case0 = new IntLiteral(0);
+  Expression case1 = new IntLiteral(1);
+  Expression case2 = new IntLiteral(2);
+  Block emptyBlock = new Block([]);
+  Block returnBlock1 = new Block([new ReturnStatement()]);
+  Block returnBlock2 = new Block([new ReturnStatement()]);
+
+  testStatement(
+      new SwitchStatement(expression, [
+        new SwitchCaseImpl([case0], [0], emptyBlock, hasLabel: false)
+      ]),
+      '''
+switch (null) {
+  case 0:
+}''',
+      limited: '''
+switch (null) { case 0: }''');
+
+  testStatement(
+      new SwitchStatement(expression, [
+        new SwitchCaseImpl([], [0], emptyBlock,
+            hasLabel: false, isDefault: true)
+      ]),
+      '''
+switch (null) {
+  default:
+}''',
+      limited: '''
+switch (null) { default: }''');
+
+  testStatement(
+      new SwitchStatement(expression, [
+        new SwitchCaseImpl([case0, case1], [0, 1], returnBlock1,
+            hasLabel: false),
+        new SwitchCaseImpl([case2], [0], returnBlock2,
+            hasLabel: true, isDefault: true)
+      ]),
+      '''
+switch (null) {
+  case 0:
+  case 1:
+    return;
+  case 2:
+  default:
+    return;
+}''',
+      limited: '''
+switch (null) { case 0: case 1: return; case 2: default: return; }''');
+}
+
+void _testBreakStatementImpl() {
+  WhileStatement whileStatement =
+      new WhileStatement(new BoolLiteral(true), new Block([]));
+  LabeledStatement labeledStatement = new LabeledStatement(whileStatement);
+  testStatement(
+      new BreakStatementImpl(isContinue: false)
+        ..target = labeledStatement
+        ..targetStatement = whileStatement,
+      '''
+break label0;''');
+  testStatement(
+      new BreakStatementImpl(isContinue: true)
+        ..target = labeledStatement
+        ..targetStatement = whileStatement,
+      '''
+continue label0;''');
+}
+
+void _testCascade() {
+  VariableDeclaration variable =
+      new VariableDeclaration.forValue(new IntLiteral(0));
+  Cascade cascade = new Cascade(variable, isNullAware: false);
+  testExpression(cascade, '''
+let final dynamic #0 = 0 in cascade {} => #0''');
+
+  cascade.addCascadeExpression(new PropertySet(
+      new VariableGet(variable), new Name('foo'), new IntLiteral(1)));
+  testExpression(cascade, '''
+let final dynamic #0 = 0 in cascade {
+  #0.foo = 1;
+} => #0''', limited: '''
+let final dynamic #0 = 0 in cascade { #0.foo = 1; } => #0''');
+
+  cascade.addCascadeExpression(new PropertySet(
+      new VariableGet(variable), new Name('bar'), new IntLiteral(2)));
+  testExpression(cascade, '''
+let final dynamic #0 = 0 in cascade {
+  #0.foo = 1;
+  #0.bar = 2;
+} => #0''', limited: '''
+let final dynamic #0 = 0 in cascade { #0.foo = 1; #0.bar = 2; } => #0''');
+}
+
+void _testDeferredCheck() {
+  Library library = new Library(dummyUri);
+  LibraryDependency dependency =
+      LibraryDependency.deferredImport(library, 'pre');
+  VariableDeclaration check =
+      new VariableDeclaration.forValue(new CheckLibraryIsLoaded(dependency));
+  testExpression(new DeferredCheck(check, new IntLiteral(0)), '''
+let final dynamic #0 = pre.checkLibraryIsLoaded() in 0''');
+}
+
+void _testFactoryConstructorInvocationJudgment() {
+  Library library = new Library(dummyUri);
+  Class cls = new Class(name: 'Class');
+  library.addClass(cls);
+  Procedure factoryConstructor = new Procedure(
+      new Name(''), ProcedureKind.Factory, new FunctionNode(null));
+  cls.addMember(factoryConstructor);
+
+  testExpression(
+      new FactoryConstructorInvocationJudgment(
+          factoryConstructor, new ArgumentsImpl([])),
+      '''
+new Class()''',
+      verbose: '''
+new library test:dummy::Class()''');
+
+  testExpression(
+      new FactoryConstructorInvocationJudgment(
+          factoryConstructor,
+          new ArgumentsImpl([new IntLiteral(0)],
+              types: [const VoidType()],
+              named: [new NamedExpression('bar', new IntLiteral(1))])),
+      '''
+new Class<void>(0, bar: 1)''',
+      verbose: '''
+new library test:dummy::Class<void>(0, bar: 1)''');
+
+  factoryConstructor.name = new Name('foo');
+  testExpression(
+      new FactoryConstructorInvocationJudgment(
+          factoryConstructor,
+          new ArgumentsImpl([new IntLiteral(0)],
+              types: [const VoidType()],
+              named: [new NamedExpression('bar', new IntLiteral(1))])),
+      '''
+new Class<void>.foo(0, bar: 1)''',
+      verbose: '''
+new library test:dummy::Class<void>.foo(0, bar: 1)''');
+}
+
+void _testFunctionDeclarationImpl() {
+  testStatement(
+      new FunctionDeclarationImpl(new VariableDeclarationImpl('foo', 0),
+          new FunctionNode(new Block([]))),
+      '''
+dynamic foo() {}''');
+}
+
+void _testIfNullExpression() {
+  testExpression(new IfNullExpression(new IntLiteral(0), new IntLiteral(1)), '''
+0 ?? 1''');
+}
+
+void _testIntLiterals() {
+  testExpression(new IntJudgment(0, null), '0');
+  testExpression(new IntJudgment(0, 'foo'), 'foo');
+  testExpression(new ShadowLargeIntLiteral('bar', TreeNode.noOffset), 'bar');
+}
+
+void _testExpressionInvocation() {
+  testExpression(
+      new ExpressionInvocation(new IntLiteral(0), new ArgumentsImpl([])), '''
+0()''');
+  testExpression(
+      new ExpressionInvocation(
+          new IntLiteral(0),
+          new ArgumentsImpl([
+            new IntLiteral(1)
+          ], types: [
+            const VoidType(),
+            const DynamicType()
+          ], named: [
+            new NamedExpression('foo', new IntLiteral(2)),
+            new NamedExpression('bar', new IntLiteral(3))
+          ])),
+      '''
+0<void, dynamic>(1, foo: 2, bar: 3)''');
+}
+
+void _testNamedFunctionExpressionJudgment() {
+  testExpression(
+      new NamedFunctionExpressionJudgment(new VariableDeclarationImpl('foo', 0,
+          initializer:
+              new FunctionExpression(new FunctionNode(new Block([]))))),
+      '''
+let dynamic foo = dynamic () {} in foo''');
+}
+
+void _testNullAwareMethodInvocation() {
+  VariableDeclaration variable =
+      new VariableDeclaration.forValue(new IntLiteral(0));
+
+  // The usual use of this node.
+  testExpression(
+      new NullAwareMethodInvocation(
+          variable,
+          new MethodInvocation(new VariableGet(variable), new Name('foo'),
+              new ArgumentsImpl([]))),
+      '''
+0?.foo()''');
+
+  // An unusual use of this node.
+  testExpression(
+      new NullAwareMethodInvocation(variable,
+          new PropertyGet(new VariableGet(variable), new Name('foo'))),
+      '''
+let final dynamic #0 = 0 in null-aware #0.foo''');
+}
+
+void _testNullAwarePropertyGet() {
+  VariableDeclaration variable =
+      new VariableDeclaration.forValue(new IntLiteral(0));
+
+  // The usual use of this node.
+  testExpression(
+      new NullAwarePropertyGet(variable,
+          new PropertyGet(new VariableGet(variable), new Name('foo'))),
+      '''
+0?.foo''');
+
+  // An unusual use of this node.
+  testExpression(
+      new NullAwarePropertyGet(
+          variable,
+          new MethodInvocation(new VariableGet(variable), new Name('foo'),
+              new ArgumentsImpl([]))),
+      '''
+let final dynamic #0 = 0 in null-aware #0.foo()''');
+}
+
+void _testNullAwarePropertySet() {
+  VariableDeclaration variable =
+      new VariableDeclaration.forValue(new IntLiteral(0));
+
+  testExpression(
+      new NullAwarePropertySet(
+          variable,
+          new PropertySet(
+              new VariableGet(variable), new Name('foo'), new IntLiteral(1))),
+      '''
+0?.foo = 1''');
+
+  testExpression(
+      new NullAwarePropertySet(
+          variable,
+          new MethodInvocation(new VariableGet(variable), new Name('foo'),
+              new ArgumentsImpl([]))),
+      '''
+let final dynamic #0 = 0 in null-aware #0.foo()''');
+}
+
+void _testReturnStatementImpl() {
+  testStatement(new ReturnStatementImpl(false), '''
+return;''');
+  testStatement(new ReturnStatementImpl(true), '''
+=>;''');
+  testStatement(new ReturnStatementImpl(false, new IntLiteral(0)), '''
+return 0;''');
+  testStatement(new ReturnStatementImpl(true, new IntLiteral(0)), '''
+=> 0;''');
+}
+
+void _testVariableDeclarationImpl() {
+  testStatement(new VariableDeclarationImpl('foo', 0), '''
+dynamic foo;''');
+  testStatement(
+      new VariableDeclarationImpl('foo', 0, initializer: new IntLiteral(0)), '''
+dynamic foo = 0;''');
+  testStatement(
+      new VariableDeclarationImpl('foo', 0,
+          type: const VoidType(),
+          initializer: new IntLiteral(0),
+          isFinal: true,
+          isRequired: true),
+      '''
+required final void foo;''');
+  testStatement(
+      new VariableDeclarationImpl('foo', 0,
+          type: const VoidType(), initializer: new IntLiteral(0), isLate: true),
+      '''
+late void foo = 0;''');
+  testStatement(
+      new VariableDeclarationImpl('foo', 0,
+          type: const VoidType(), initializer: new IntLiteral(0))
+        ..lateGetter = new VariableDeclarationImpl('foo#getter', 0),
+      '''
+late void foo = 0;''');
+  testStatement(
+      new VariableDeclarationImpl('foo', 0,
+          type: const VoidType(), initializer: new IntLiteral(0))
+        ..lateGetter = new VariableDeclarationImpl('foo#getter', 0)
+        ..lateType = const DynamicType(),
+      '''
+late dynamic foo = 0;''');
+}
+
+void _testVariableGetImpl() {
+  VariableDeclaration variable = new VariableDeclaration('foo');
+  testExpression(
+      new VariableGetImpl(variable, null, null, forNullGuardedAccess: false),
+      '''
+foo''');
+  testExpression(
+      new VariableGetImpl(variable, null, null, forNullGuardedAccess: true), '''
+foo''');
+  testExpression(
+      new VariableGetImpl(variable, null, null, forNullGuardedAccess: false)
+        ..promotedType = const VoidType(),
+      '''
+foo{void}''');
+}
+
+void _testLoadLibraryImpl() {
+  Library library = new Library(dummyUri);
+  LibraryDependency dependency =
+      LibraryDependency.deferredImport(library, 'pre');
+  testExpression(new LoadLibraryImpl(dependency, new ArgumentsImpl([])), '''
+pre.loadLibrary()''');
+  testExpression(
+      new LoadLibraryImpl(dependency, new ArgumentsImpl([new IntLiteral(0)])),
+      '''
+pre.loadLibrary(0)''');
+}
+
+void _testLoadLibraryTearOff() {
+  Library library = new Library(dummyUri);
+  LibraryDependency dependency =
+      LibraryDependency.deferredImport(library, 'pre');
+
+  testExpression(new LoadLibraryTearOff(dependency, null), ''' 
+pre.loadLibrary''');
+
+  Procedure procedure = new Procedure(new Name('get#loadLibrary'),
+      ProcedureKind.Getter, new FunctionNode(new Block([])));
+  testExpression(new LoadLibraryTearOff(dependency, procedure), ''' 
+pre.loadLibrary''');
+}
+
+void _testIfNullPropertySet() {
+  VariableDeclaration variable =
+      new VariableDeclarationImpl.forValue(new IntLiteral(0));
+  testExpression(
+      new IfNullPropertySet(
+          variable,
+          new PropertyGet(new VariableGet(variable), new Name('foo')),
+          new PropertySet(
+              new VariableGet(variable), new Name('foo'), new IntLiteral(1)),
+          forEffect: false),
+      '''
+let final dynamic #0 = 0 in if-null #0.foo ?? #0.foo = 1''');
+
+  testExpression(
+      new IfNullPropertySet(
+          variable,
+          new PropertyGet(new VariableGet(variable), new Name('foo')),
+          new PropertySet(
+              new VariableGet(variable), new Name('foo'), new IntLiteral(1)),
+          forEffect: true),
+      '''
+let final dynamic #0 = 0 in if-null #0.foo ?? #0.foo = 1''');
+}
+
+void _testIfNullSet() {
+  VariableDeclaration variable = new VariableDeclaration('foo');
+  testExpression(
+      new IfNullSet(new VariableGet(variable),
+          new VariableSet(variable, new IntLiteral(1)),
+          forEffect: false),
+      '''
+foo ?? foo = 1''');
+
+  testExpression(
+      new IfNullSet(new VariableGet(variable),
+          new VariableSet(variable, new IntLiteral(1)),
+          forEffect: true),
+      '''
+foo ?? foo = 1''');
+}
+
+void _testCompoundExtensionSet() {}
+
+void _testCompoundPropertySet() {}
+
+void _testPropertyPostIncDec() {}
+
+void _testLocalPostIncDec() {}
+
+void _testStaticPostIncDec() {}
+
+void _testSuperPostIncDec() {}
+
+void _testIndexGet() {}
+
+void _testIndexSet() {}
+
+void _testSuperIndexSet() {}
+
+void _testExtensionIndexSet() {}
+
+void _testIfNullIndexSet() {}
+
+void _testIfNullSuperIndexSet() {}
+
+void _testIfNullExtensionIndexSet() {}
+
+void _testCompoundIndexSet() {}
+
+void _testNullAwareCompoundSet() {}
+
+void _testNullAwareIfNullSet() {}
+
+void _testCompoundSuperIndexSet() {}
+
+void _testCompoundExtensionIndexSet() {}
+
+void _testExtensionSet() {}
+
+void _testNullAwareExtension() {}
+
+void _testPropertySetImpl() {}
+
+void _testExtensionTearOff() {}
+
+void _testEqualsExpression() {}
+
+void _testBinaryExpression() {}
+
+void _testUnaryExpression() {}
+
+void _testParenthesizedExpression() {}
+
+void _testSpreadElement() {}
+
+void _testIfElement() {}
+
+void _testForElement() {}
+
+void _testForInElement() {}
+
+void _testSpreadMapEntry() {}
+
+void _testIfMapEntry() {}
+
+void _testForMapEntry() {}
+
+void _testForInMapEntry() {}
diff --git a/pkg/front_end/test/text_representation/text_representation_test.dart b/pkg/front_end/test/text_representation/text_representation_test.dart
index 376423f..ef127c6 100644
--- a/pkg/front_end/test/text_representation/text_representation_test.dart
+++ b/pkg/front_end/test/text_representation/text_representation_test.dart
@@ -13,9 +13,56 @@
 import 'package:front_end/src/base/nnbd_mode.dart';
 import 'package:front_end/src/testing/id_testing_helper.dart';
 import 'package:kernel/ast.dart';
+import 'package:kernel/src/printer.dart';
 
 const String normalMarker = 'normal';
 const String verboseMarker = 'verbose';
+const String limitedMarker = 'limited';
+
+const String statementMarker = 'stmt';
+const String expressionMarker = 'expr';
+
+const AstTextStrategy normalStrategy = const AstTextStrategy(
+    includeLibraryNamesInMembers: false,
+    includeLibraryNamesInTypes: false,
+    includeAuxiliaryProperties: false,
+    useMultiline: true,
+    maxExpressionDepth: null,
+    maxExpressionsLength: null,
+    maxStatementDepth: null,
+    maxStatementsLength: null);
+
+const AstTextStrategy verboseStrategy = const AstTextStrategy(
+    includeLibraryNamesInMembers: true,
+    includeLibraryNamesInTypes: true,
+    includeAuxiliaryProperties: true,
+    useMultiline: true,
+    maxExpressionDepth: null,
+    maxExpressionsLength: null,
+    maxStatementDepth: null,
+    maxStatementsLength: null);
+
+const AstTextStrategy limitedStrategy = const AstTextStrategy(
+    includeLibraryNamesInMembers: false,
+    includeLibraryNamesInTypes: false,
+    includeAuxiliaryProperties: false,
+    useMultiline: false,
+    maxExpressionDepth: 5,
+    maxExpressionsLength: 4,
+    maxStatementDepth: 5,
+    maxStatementsLength: 4);
+
+AstTextStrategy getStrategy(String marker) {
+  switch (marker) {
+    case normalMarker:
+      return normalStrategy;
+    case verboseMarker:
+      return verboseStrategy;
+    case limitedMarker:
+      return limitedStrategy;
+  }
+  throw new UnsupportedError("Unexpected marker '${marker}'.");
+}
 
 main(List<String> args) async {
   Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
@@ -23,9 +70,11 @@
       args: args,
       createUriForFileName: createUriForFileName,
       onFailure: onFailure,
+      preserveWhitespaceInAnnotations: true,
       runTest: runTestFor(const TextRepresentationDataComputer(), [
         const TextRepresentationConfig(normalMarker, 'normal'),
         const TextRepresentationConfig(verboseMarker, 'verbose'),
+        const TextRepresentationConfig(limitedMarker, 'limited'),
       ]));
 }
 
@@ -52,7 +101,7 @@
       Map<Id, ActualData<String>> actualMap,
       {bool verbose}) {
     new TextRepresentationDataExtractor(
-            compilerResult, actualMap, config.marker == verboseMarker)
+            compilerResult, actualMap, getStrategy(config.marker))
         .computeForLibrary(library);
   }
 
@@ -64,7 +113,7 @@
       Map<Id, ActualData<String>> actualMap,
       {bool verbose}) {
     member.accept(new TextRepresentationDataExtractor(
-        compilerResult, actualMap, config.marker == verboseMarker));
+        compilerResult, actualMap, getStrategy(config.marker)));
   }
 
   @override
@@ -72,10 +121,10 @@
 }
 
 class TextRepresentationDataExtractor extends CfeDataExtractor<String> {
-  final bool verbose;
+  final AstTextStrategy strategy;
 
   TextRepresentationDataExtractor(InternalCompilerResult compilerResult,
-      Map<Id, ActualData<String>> actualMap, this.verbose)
+      Map<Id, ActualData<String>> actualMap, this.strategy)
       : super(compilerResult, actualMap);
 
   @override
@@ -84,15 +133,60 @@
   }
 
   @override
+  visitProcedure(Procedure node) {
+    if (!node.name.name.startsWith(expressionMarker) &&
+        !node.name.name.startsWith(statementMarker)) {
+      node.function.accept(this);
+    }
+    computeForMember(node);
+  }
+
+  @override
+  visitField(Field node) {
+    if (!node.name.name.startsWith(expressionMarker) &&
+        !node.name.name.startsWith(statementMarker)) {
+      node.initializer?.accept(this);
+    }
+    computeForMember(node);
+  }
+
+  @override
+  String computeMemberValue(Id id, Member node) {
+    if (node.name.name == 'stmtVariableDeclarationMulti') {
+      print(node);
+    }
+    if (node.name.name.startsWith(expressionMarker)) {
+      if (node is Procedure) {
+        Statement body = node.function.body;
+        if (body is ReturnStatement) {
+          return body.expression.toText(strategy);
+        }
+      } else if (node is Field && node.initializer != null) {
+        return node.initializer.toText(strategy);
+      }
+    } else if (node.name.name.startsWith(statementMarker)) {
+      if (node is Procedure) {
+        Statement body = node.function.body;
+        if (body is Block && body.statements.length == 1) {
+          // Prefix with newline to make multiline text representations more
+          // readable.
+          return '\n${body.statements.single.toText(strategy)}';
+        }
+      }
+    }
+    return null;
+  }
+
+  @override
   String computeNodeValue(Id id, TreeNode node) {
     if (node is ConstantExpression) {
-      return node.constant.toConstantText(verbose: verbose);
+      return node.constant.toText(strategy);
     } else if (node is VariableDeclaration) {
       DartType type = node.type;
       if (type is FunctionType && type.typedefType != null) {
-        return type.typedefType.toTypeText(verbose: verbose);
+        return type.typedefType.toText(strategy);
       } else {
-        return type.toTypeText(verbose: verbose);
+        return type.toText(strategy);
       }
     }
     return null;
diff --git a/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.strong.transformed.expect b/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.strong.transformed.expect
index c23b449..641de72 100644
--- a/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/extensions/deferred_explicit_access.dart.strong.transformed.expect
@@ -16,7 +16,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.strong.transformed.expect b/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.strong.transformed.expect
index 6597e46..de913ab 100644
--- a/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/extensions/deferred_import_hidden.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/async_function.dart.strong.transformed.expect b/pkg/front_end/testcases/general/async_function.dart.strong.transformed.expect
index c8cb04c..742f696 100644
--- a/pkg/front_end/testcases/general/async_function.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/async_function.dart.strong.transformed.expect
@@ -9,7 +9,7 @@
 static field core::List<core::String*>* stringList = <core::String*>["bar"];
 static method asyncString() → asy::Future<core::String*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::String*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::String*>();
-  asy::FutureOr<core::String*>* :return_value;
+  FutureOr<core::String*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -36,7 +36,7 @@
 }
 static method asyncString2() → asy::Future<core::String*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::String*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::String*>();
-  asy::FutureOr<core::String*>* :return_value;
+  FutureOr<core::String*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -182,7 +182,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/async_nested.dart.strong.transformed.expect b/pkg/front_end/testcases/general/async_nested.dart.strong.transformed.expect
index ee2359b..8e2f1b6 100644
--- a/pkg/front_end/testcases/general/async_nested.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/async_nested.dart.strong.transformed.expect
@@ -29,7 +29,7 @@
 }
 static method main() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/await.dart.strong.transformed.expect b/pkg/front_end/testcases/general/await.dart.strong.transformed.expect
index e8481b7..7d6f5ee 100644
--- a/pkg/front_end/testcases/general/await.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/await.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/await_complex.dart.outline.expect b/pkg/front_end/testcases/general/await_complex.dart.outline.expect
index b470953..6082104 100644
--- a/pkg/front_end/testcases/general/await_complex.dart.outline.expect
+++ b/pkg/front_end/testcases/general/await_complex.dart.outline.expect
@@ -57,9 +57,9 @@
   ;
 static method controlFlow() → dynamic
   ;
-static method future<T extends core::Object* = dynamic>(self::future::T* value) → asy::FutureOr<self::future::T*>*
+static method future<T extends core::Object* = dynamic>(self::future::T* value) → FutureOr<self::future::T*>*
   ;
-static method id<T extends core::Object* = dynamic>(self::id::T* value) → asy::FutureOr<self::id::T*>*
+static method id<T extends core::Object* = dynamic>(self::id::T* value) → FutureOr<self::id::T*>*
   ;
 static method intStream() → asy::Stream<core::int*>*
   ;
diff --git a/pkg/front_end/testcases/general/await_complex.dart.strong.expect b/pkg/front_end/testcases/general/await_complex.dart.strong.expect
index 4d830b1..ed855de 100644
--- a/pkg/front_end/testcases/general/await_complex.dart.strong.expect
+++ b/pkg/front_end/testcases/general/await_complex.dart.strong.expect
@@ -123,7 +123,7 @@
 }
 static method asserts() → dynamic async {
   for (final core::Function* #t1 in <core::Function*>[#C1, #C2]) {
-    final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t1 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+    final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t1 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
     assert(await func.call<core::bool*>(true));
     assert(self::id<core::bool*>(true) as{TypeError} core::bool*, await func.call<core::String*>("message"));
     assert(await func.call<core::bool*>(true), await func.call<core::String*>("message"));
@@ -139,7 +139,7 @@
 }
 static method controlFlow() → dynamic async {
   for (final core::Function* #t2 in <core::Function*>[#C1, #C2]) {
-    final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t2 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+    final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t2 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
     core::int* c = 0;
     for (core::int* i = await func.call<core::int*>(0); await func.call<core::bool*>(i.{core::num::<}(5)); await func.call<core::int*>(let final core::int* #t3 = i in let final core::int* #t4 = i = #t3.{core::num::+}(1) in #t3)) {
       c = c.{core::num::+}(1);
@@ -222,9 +222,9 @@
     self::expectList(<dynamic>[42], await testStream2.call().{asy::Stream::toList}());
   }
 }
-static method future<T extends core::Object* = dynamic>(self::future::T* value) → asy::FutureOr<self::future::T*>* async 
+static method future<T extends core::Object* = dynamic>(self::future::T* value) → FutureOr<self::future::T*>* async 
   return value;
-static method id<T extends core::Object* = dynamic>(self::id::T* value) → asy::FutureOr<self::id::T*>*
+static method id<T extends core::Object* = dynamic>(self::id::T* value) → FutureOr<self::id::T*>*
   return value;
 static method intStream() → asy::Stream<core::int*>* async* {
   yield 42;
diff --git a/pkg/front_end/testcases/general/await_complex.dart.strong.transformed.expect b/pkg/front_end/testcases/general/await_complex.dart.strong.transformed.expect
index 72a8cdc..f627da3 100644
--- a/pkg/front_end/testcases/general/await_complex.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/await_complex.dart.strong.transformed.expect
@@ -58,7 +58,7 @@
   return 1;
 static method staticMembers() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -114,7 +114,7 @@
 }
 static method topLevelMembers() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -165,7 +165,7 @@
 }
 static method instanceMembers() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -217,7 +217,7 @@
 }
 static method others() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -269,7 +269,7 @@
 }
 static method conditionals() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -341,7 +341,7 @@
 }
 static method asserts() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -358,7 +358,7 @@
           for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
             final core::Function* #t26 = :sync-for-iterator.{core::Iterator::current};
             {
-              final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t26 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+              final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t26 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
               assert {
                 [yield] let dynamic #t27 = asy::_awaitHelper(func.call<core::bool*>(true), :async_op_then, :async_op_error, :async_op) in null;
                 assert(_in::unsafeCast<core::bool*>(:result));
@@ -414,7 +414,7 @@
 }
 static method controlFlow() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -437,7 +437,7 @@
           for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
             final core::Function* #t33 = :sync-for-iterator.{core::Iterator::current};
             {
-              final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t33 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+              final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t33 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
               core::int* c = 0;
               {
                 dynamic #t34 = true;
@@ -547,7 +547,7 @@
               }
               [yield] let dynamic #t51 = asy::_awaitHelper((() → asy::Future<dynamic>* /* originally async */ {
                 final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-                asy::FutureOr<dynamic>* :return_value;
+                FutureOr<dynamic>* :return_value;
                 dynamic :async_stack_trace;
                 (dynamic) →* dynamic :async_op_then;
                 (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -577,7 +577,7 @@
               self::expect(42, :result);
               [yield] let dynamic #t53 = asy::_awaitHelper((() → asy::Future<dynamic>* /* originally async */ {
                 final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-                asy::FutureOr<dynamic>* :return_value;
+                FutureOr<dynamic>* :return_value;
                 dynamic :async_stack_trace;
                 (dynamic) →* dynamic :async_op_then;
                 (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -697,9 +697,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method future<T extends core::Object* = dynamic>(self::future::T* value) → asy::FutureOr<self::future::T*>* /* originally async */ {
+static method future<T extends core::Object* = dynamic>(self::future::T* value) → FutureOr<self::future::T*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<self::future::T*>* :async_completer = new asy::_AsyncAwaitCompleter::•<self::future::T*>();
-  asy::FutureOr<self::future::T*>* :return_value;
+  FutureOr<self::future::T*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -724,7 +724,7 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method id<T extends core::Object* = dynamic>(self::id::T* value) → asy::FutureOr<self::id::T*>*
+static method id<T extends core::Object* = dynamic>(self::id::T* value) → FutureOr<self::id::T*>*
   return value;
 static method intStream() → asy::Stream<core::int*>* /* originally async* */ {
   asy::_AsyncStarStreamController<core::int*>* :controller;
@@ -763,7 +763,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/await_in_cascade.dart.strong.transformed.expect b/pkg/front_end/testcases/general/await_in_cascade.dart.strong.transformed.expect
index 0bb1652..cc9a56d 100644
--- a/pkg/front_end/testcases/general/await_in_cascade.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/await_in_cascade.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
     ;
   method m() → asy::Future<core::List<core::int*>*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-    asy::FutureOr<core::List<core::int*>*>* :return_value;
+    FutureOr<core::List<core::int*>*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -43,7 +43,7 @@
   }
   method _m() → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -81,7 +81,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/bug33196.dart.outline.expect b/pkg/front_end/testcases/general/bug33196.dart.outline.expect
index 628cf31..7ebb44e 100644
--- a/pkg/front_end/testcases/general/bug33196.dart.outline.expect
+++ b/pkg/front_end/testcases/general/bug33196.dart.outline.expect
@@ -1,11 +1,10 @@
 library;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 
 static method main() → dynamic
   ;
-static method returnsString() → asy::FutureOr<core::String*>*
+static method returnsString() → FutureOr<core::String*>*
   ;
diff --git a/pkg/front_end/testcases/general/bug33196.dart.strong.expect b/pkg/front_end/testcases/general/bug33196.dart.strong.expect
index 83b0714..f76933a 100644
--- a/pkg/front_end/testcases/general/bug33196.dart.strong.expect
+++ b/pkg/front_end/testcases/general/bug33196.dart.strong.expect
@@ -1,14 +1,13 @@
 library;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 
 static method main() → dynamic {
-  asy::FutureOr<core::String*>* result = self::returnsString();
+  FutureOr<core::String*>* result = self::returnsString();
   core::print(result.{core::Object::runtimeType});
 }
-static method returnsString() → asy::FutureOr<core::String*>* async {
+static method returnsString() → FutureOr<core::String*>* async {
   return "oh no";
 }
diff --git a/pkg/front_end/testcases/general/bug33196.dart.strong.transformed.expect b/pkg/front_end/testcases/general/bug33196.dart.strong.transformed.expect
index 75b721f..79fa612 100644
--- a/pkg/front_end/testcases/general/bug33196.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/bug33196.dart.strong.transformed.expect
@@ -1,17 +1,17 @@
 library;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
+import "dart:async" as asy;
 
 import "dart:async";
 
 static method main() → dynamic {
-  asy::FutureOr<core::String*>* result = self::returnsString();
+  FutureOr<core::String*>* result = self::returnsString();
   core::print(result.{core::Object::runtimeType});
 }
-static method returnsString() → asy::FutureOr<core::String*>* /* originally async */ {
+static method returnsString() → FutureOr<core::String*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::String*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::String*>();
-  asy::FutureOr<core::String*>* :return_value;
+  FutureOr<core::String*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/bug33206.dart.strong.transformed.expect b/pkg/front_end/testcases/general/bug33206.dart.strong.transformed.expect
index d58c87d..ec77cde 100644
--- a/pkg/front_end/testcases/general/bug33206.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/bug33206.dart.strong.transformed.expect
@@ -42,7 +42,7 @@
 }
 static method f1() → asy::Future<core::List<core::Object*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::Object*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::Object*>*>();
-  asy::FutureOr<core::List<core::Object*>*>* :return_value;
+  FutureOr<core::List<core::Object*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -71,7 +71,7 @@
   return <core::Object*>[2];
 static method f3() → asy::Future<core::Object*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::Object*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::Object*>();
-  asy::FutureOr<core::Object*>* :return_value;
+  FutureOr<core::Object*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -98,7 +98,7 @@
 }
 static method foo() → asy::Future<self::X*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<self::X*>* :async_completer = new asy::_AsyncAwaitCompleter::•<self::X*>();
-  asy::FutureOr<self::X*>* :return_value;
+  FutureOr<self::X*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -134,7 +134,7 @@
 }
 static method main() → asy::Future<void>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<void>* :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
-  asy::FutureOr<void>* :return_value;
+  FutureOr<void>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/check_deferred_before_args2.dart.strong.transformed.expect b/pkg/front_end/testcases/general/check_deferred_before_args2.dart.strong.transformed.expect
index 8f401c4..4987b9e 100644
--- a/pkg/front_end/testcases/general/check_deferred_before_args2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/check_deferred_before_args2.dart.strong.transformed.expect
@@ -9,7 +9,7 @@
 static method main() → dynamic {}
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/control_flow_collection_inference.dart.strong.transformed.expect b/pkg/front_end/testcases/general/control_flow_collection_inference.dart.strong.transformed.expect
index 178b13f..d9d87e4 100644
--- a/pkg/front_end/testcases/general/control_flow_collection_inference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/control_flow_collection_inference.dart.strong.transformed.expect
@@ -2320,7 +2320,7 @@
 }
 static method testForElementErrors(core::Map<core::int*, core::int*>* map, core::List<core::int*>* list) → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.strong.transformed.expect b/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.strong.transformed.expect
index 901cb0b..c1b245b 100644
--- a/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/error_recovery/empty_await_for.dart.strong.transformed.expect
@@ -17,7 +17,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/future_or_test.dart.strong.expect b/pkg/front_end/testcases/general/future_or_test.dart.strong.expect
index c0976ca..d6f9ef6 100644
--- a/pkg/front_end/testcases/general/future_or_test.dart.strong.expect
+++ b/pkg/front_end/testcases/general/future_or_test.dart.strong.expect
@@ -46,7 +46,7 @@
     : super core::Object::•()
     ;
   method baz() → asy::Future<core::int*>* async 
-    return this.{self::C::b}.{self::B::bar}() as{TypeError} asy::FutureOr<core::int*>*;
+    return this.{self::C::b}.{self::B::bar}() as{TypeError} FutureOr<core::int*>*;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
   abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*;
diff --git a/pkg/front_end/testcases/general/future_or_test.dart.strong.transformed.expect b/pkg/front_end/testcases/general/future_or_test.dart.strong.transformed.expect
index efdff61..ecb9632 100644
--- a/pkg/front_end/testcases/general/future_or_test.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/future_or_test.dart.strong.transformed.expect
@@ -29,7 +29,7 @@
     ;
   method bar() → asy::Future<dynamic>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -72,7 +72,7 @@
     ;
   method baz() → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -82,7 +82,7 @@
       try {
         #L2:
         {
-          :return_value = this.{self::C::b}.{self::B::bar}() as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = this.{self::C::b}.{self::B::bar}() as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/general/issue40662.dart.strong.transformed.expect b/pkg/front_end/testcases/general/issue40662.dart.strong.transformed.expect
index b0b7fca..b39c1af 100644
--- a/pkg/front_end/testcases/general/issue40662.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/issue40662.dart.strong.transformed.expect
@@ -10,7 +10,7 @@
 }
 static method foo(core::int* x) → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -52,7 +52,7 @@
 }
 static method main() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general/sdk_diagnostic.dart.outline.expect b/pkg/front_end/testcases/general/sdk_diagnostic.dart.outline.expect
index 5e3f107..6d17367 100644
--- a/pkg/front_end/testcases/general/sdk_diagnostic.dart.outline.expect
+++ b/pkg/front_end/testcases/general/sdk_diagnostic.dart.outline.expect
@@ -12,7 +12,7 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
diff --git a/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.expect b/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.expect
index f857339..95ddfbe 100644
--- a/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.expect
+++ b/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.expect
@@ -12,14 +12,14 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
 // pkg/front_end/testcases/general/sdk_diagnostic.dart:12:8: Error: Too few positional arguments: 1 required, 0 given.
 //   print(incorrectArgument: "fisk");
 //        ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
+// sdk/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
 // void print(Object? object) {
 //      ^^^^^
 //
diff --git a/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.transformed.expect b/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.transformed.expect
index f857339..95ddfbe 100644
--- a/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/sdk_diagnostic.dart.strong.transformed.expect
@@ -12,14 +12,14 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
 // pkg/front_end/testcases/general/sdk_diagnostic.dart:12:8: Error: Too few positional arguments: 1 required, 0 given.
 //   print(incorrectArgument: "fisk");
 //        ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
+// sdk/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
 // void print(Object? object) {
 //      ^^^^^
 //
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/async_function.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/async_function.dart.weak.transformed.expect
index c8cb04c..742f696 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/async_function.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/async_function.dart.weak.transformed.expect
@@ -9,7 +9,7 @@
 static field core::List<core::String*>* stringList = <core::String*>["bar"];
 static method asyncString() → asy::Future<core::String*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::String*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::String*>();
-  asy::FutureOr<core::String*>* :return_value;
+  FutureOr<core::String*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -36,7 +36,7 @@
 }
 static method asyncString2() → asy::Future<core::String*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::String*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::String*>();
-  asy::FutureOr<core::String*>* :return_value;
+  FutureOr<core::String*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -182,7 +182,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/async_nested.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/async_nested.dart.weak.transformed.expect
index ee2359b..8e2f1b6 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/async_nested.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/async_nested.dart.weak.transformed.expect
@@ -29,7 +29,7 @@
 }
 static method main() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/await.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/await.dart.weak.transformed.expect
index e8481b7..7d6f5ee 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/await.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/await.dart.weak.transformed.expect
@@ -6,7 +6,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.expect
index 4d830b1..ed855de 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.expect
@@ -123,7 +123,7 @@
 }
 static method asserts() → dynamic async {
   for (final core::Function* #t1 in <core::Function*>[#C1, #C2]) {
-    final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t1 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+    final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t1 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
     assert(await func.call<core::bool*>(true));
     assert(self::id<core::bool*>(true) as{TypeError} core::bool*, await func.call<core::String*>("message"));
     assert(await func.call<core::bool*>(true), await func.call<core::String*>("message"));
@@ -139,7 +139,7 @@
 }
 static method controlFlow() → dynamic async {
   for (final core::Function* #t2 in <core::Function*>[#C1, #C2]) {
-    final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t2 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+    final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t2 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
     core::int* c = 0;
     for (core::int* i = await func.call<core::int*>(0); await func.call<core::bool*>(i.{core::num::<}(5)); await func.call<core::int*>(let final core::int* #t3 = i in let final core::int* #t4 = i = #t3.{core::num::+}(1) in #t3)) {
       c = c.{core::num::+}(1);
@@ -222,9 +222,9 @@
     self::expectList(<dynamic>[42], await testStream2.call().{asy::Stream::toList}());
   }
 }
-static method future<T extends core::Object* = dynamic>(self::future::T* value) → asy::FutureOr<self::future::T*>* async 
+static method future<T extends core::Object* = dynamic>(self::future::T* value) → FutureOr<self::future::T*>* async 
   return value;
-static method id<T extends core::Object* = dynamic>(self::id::T* value) → asy::FutureOr<self::id::T*>*
+static method id<T extends core::Object* = dynamic>(self::id::T* value) → FutureOr<self::id::T*>*
   return value;
 static method intStream() → asy::Stream<core::int*>* async* {
   yield 42;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.transformed.expect
index 72a8cdc..f627da3 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/await_complex.dart.weak.transformed.expect
@@ -58,7 +58,7 @@
   return 1;
 static method staticMembers() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -114,7 +114,7 @@
 }
 static method topLevelMembers() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -165,7 +165,7 @@
 }
 static method instanceMembers() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -217,7 +217,7 @@
 }
 static method others() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -269,7 +269,7 @@
 }
 static method conditionals() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -341,7 +341,7 @@
 }
 static method asserts() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -358,7 +358,7 @@
           for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
             final core::Function* #t26 = :sync-for-iterator.{core::Iterator::current};
             {
-              final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t26 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+              final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t26 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
               assert {
                 [yield] let dynamic #t27 = asy::_awaitHelper(func.call<core::bool*>(true), :async_op_then, :async_op_error, :async_op) in null;
                 assert(_in::unsafeCast<core::bool*>(:result));
@@ -414,7 +414,7 @@
 }
 static method controlFlow() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -437,7 +437,7 @@
           for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
             final core::Function* #t33 = :sync-for-iterator.{core::Iterator::current};
             {
-              final <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>* func = #t33 as{TypeError} <T extends core::Object* = dynamic>(T*) →* asy::FutureOr<T*>*;
+              final <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>* func = #t33 as{TypeError} <T extends core::Object* = dynamic>(T*) →* FutureOr<T*>*;
               core::int* c = 0;
               {
                 dynamic #t34 = true;
@@ -547,7 +547,7 @@
               }
               [yield] let dynamic #t51 = asy::_awaitHelper((() → asy::Future<dynamic>* /* originally async */ {
                 final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-                asy::FutureOr<dynamic>* :return_value;
+                FutureOr<dynamic>* :return_value;
                 dynamic :async_stack_trace;
                 (dynamic) →* dynamic :async_op_then;
                 (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -577,7 +577,7 @@
               self::expect(42, :result);
               [yield] let dynamic #t53 = asy::_awaitHelper((() → asy::Future<dynamic>* /* originally async */ {
                 final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-                asy::FutureOr<dynamic>* :return_value;
+                FutureOr<dynamic>* :return_value;
                 dynamic :async_stack_trace;
                 (dynamic) →* dynamic :async_op_then;
                 (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -697,9 +697,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method future<T extends core::Object* = dynamic>(self::future::T* value) → asy::FutureOr<self::future::T*>* /* originally async */ {
+static method future<T extends core::Object* = dynamic>(self::future::T* value) → FutureOr<self::future::T*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<self::future::T*>* :async_completer = new asy::_AsyncAwaitCompleter::•<self::future::T*>();
-  asy::FutureOr<self::future::T*>* :return_value;
+  FutureOr<self::future::T*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -724,7 +724,7 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method id<T extends core::Object* = dynamic>(self::id::T* value) → asy::FutureOr<self::id::T*>*
+static method id<T extends core::Object* = dynamic>(self::id::T* value) → FutureOr<self::id::T*>*
   return value;
 static method intStream() → asy::Stream<core::int*>* /* originally async* */ {
   asy::_AsyncStarStreamController<core::int*>* :controller;
@@ -763,7 +763,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/await_in_cascade.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/await_in_cascade.dart.weak.transformed.expect
index 0bb1652..cc9a56d 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/await_in_cascade.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/await_in_cascade.dart.weak.transformed.expect
@@ -12,7 +12,7 @@
     ;
   method m() → asy::Future<core::List<core::int*>*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-    asy::FutureOr<core::List<core::int*>*>* :return_value;
+    FutureOr<core::List<core::int*>*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -43,7 +43,7 @@
   }
   method _m() → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -81,7 +81,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.expect
index 83b0714..f76933a 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.expect
@@ -1,14 +1,13 @@
 library;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 
 static method main() → dynamic {
-  asy::FutureOr<core::String*>* result = self::returnsString();
+  FutureOr<core::String*>* result = self::returnsString();
   core::print(result.{core::Object::runtimeType});
 }
-static method returnsString() → asy::FutureOr<core::String*>* async {
+static method returnsString() → FutureOr<core::String*>* async {
   return "oh no";
 }
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.transformed.expect
index 75b721f..79fa612 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/bug33196.dart.weak.transformed.expect
@@ -1,17 +1,17 @@
 library;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
+import "dart:async" as asy;
 
 import "dart:async";
 
 static method main() → dynamic {
-  asy::FutureOr<core::String*>* result = self::returnsString();
+  FutureOr<core::String*>* result = self::returnsString();
   core::print(result.{core::Object::runtimeType});
 }
-static method returnsString() → asy::FutureOr<core::String*>* /* originally async */ {
+static method returnsString() → FutureOr<core::String*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::String*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::String*>();
-  asy::FutureOr<core::String*>* :return_value;
+  FutureOr<core::String*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/bug33206.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/bug33206.dart.weak.transformed.expect
index d58c87d..ec77cde 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/bug33206.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/bug33206.dart.weak.transformed.expect
@@ -42,7 +42,7 @@
 }
 static method f1() → asy::Future<core::List<core::Object*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::Object*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::Object*>*>();
-  asy::FutureOr<core::List<core::Object*>*>* :return_value;
+  FutureOr<core::List<core::Object*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -71,7 +71,7 @@
   return <core::Object*>[2];
 static method f3() → asy::Future<core::Object*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::Object*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::Object*>();
-  asy::FutureOr<core::Object*>* :return_value;
+  FutureOr<core::Object*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -98,7 +98,7 @@
 }
 static method foo() → asy::Future<self::X*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<self::X*>* :async_completer = new asy::_AsyncAwaitCompleter::•<self::X*>();
-  asy::FutureOr<self::X*>* :return_value;
+  FutureOr<self::X*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -134,7 +134,7 @@
 }
 static method main() → asy::Future<void>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<void>* :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
-  asy::FutureOr<void>* :return_value;
+  FutureOr<void>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/check_deferred_before_args2.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/check_deferred_before_args2.dart.weak.transformed.expect
index 8f401c4..4987b9e 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/check_deferred_before_args2.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/check_deferred_before_args2.dart.weak.transformed.expect
@@ -9,7 +9,7 @@
 static method main() → dynamic {}
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/control_flow_collection_inference.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/control_flow_collection_inference.dart.weak.transformed.expect
index 68516e9..cc12197 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/control_flow_collection_inference.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/control_flow_collection_inference.dart.weak.transformed.expect
@@ -2320,7 +2320,7 @@
 }
 static method testForElementErrors(core::Map<core::int*, core::int*>* map, core::List<core::int*>* list) → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart
new file mode 100644
index 0000000..7238168
--- /dev/null
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2018, 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.
+
+// @dart=2.6
+
+import 'dart:async';
+
+// The test checks that the nullability of FutureOr<null> is `nullable` even in
+// an opted-out library.
+
+FutureOr<Null> get foo => null;
+
+main() {}
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.outline.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.outline.expect
new file mode 100644
index 0000000..eebe192
--- /dev/null
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.outline.expect
@@ -0,0 +1,10 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+import "dart:async";
+
+static get foo() → FutureOr<core::Null?>?
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.strong.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.strong.expect
new file mode 100644
index 0000000..ce0981a
--- /dev/null
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.strong.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+import "dart:async";
+
+static get foo() → FutureOr<core::Null?>?
+  return null;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.strong.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.strong.transformed.expect
new file mode 100644
index 0000000..ce0981a
--- /dev/null
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.strong.transformed.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+import "dart:async";
+
+static get foo() → FutureOr<core::Null?>?
+  return null;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.weak.expect
new file mode 100644
index 0000000..9a73a4f
--- /dev/null
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.weak.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+import "dart:async";
+
+static get foo() → FutureOr<core::Null?>*
+  return null;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.weak.transformed.expect
new file mode 100644
index 0000000..9a73a4f
--- /dev/null
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_null_test.dart.weak.transformed.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+import "dart:async";
+
+static get foo() → FutureOr<core::Null?>*
+  return null;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.expect
index c0976ca..d6f9ef6 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.expect
@@ -46,7 +46,7 @@
     : super core::Object::•()
     ;
   method baz() → asy::Future<core::int*>* async 
-    return this.{self::C::b}.{self::B::bar}() as{TypeError} asy::FutureOr<core::int*>*;
+    return this.{self::C::b}.{self::B::bar}() as{TypeError} FutureOr<core::int*>*;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
   abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*;
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.transformed.expect
index efdff61..ecb9632 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/future_or_test.dart.weak.transformed.expect
@@ -29,7 +29,7 @@
     ;
   method bar() → asy::Future<dynamic>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -72,7 +72,7 @@
     ;
   method baz() → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -82,7 +82,7 @@
       try {
         #L2:
         {
-          :return_value = this.{self::C::b}.{self::B::bar}() as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = this.{self::C::b}.{self::B::bar}() as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.outline.expect b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.outline.expect
index 99ede4e..bca3a48 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.outline.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.outline.expect
@@ -12,7 +12,7 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// org-dartlang-sdk:///sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.expect b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.expect
index 38cadb6..2bde57c 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.expect
@@ -12,14 +12,14 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// org-dartlang-sdk:///sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
 // pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart:14:8: Error: Too few positional arguments: 1 required, 0 given.
 //   print(incorrectArgument: "fisk");
 //        ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
+// org-dartlang-sdk:///sdk/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
 // void print(Object? object) {
 //      ^^^^^
 //
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.transformed.expect
index 38cadb6..2bde57c 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.strong.transformed.expect
@@ -12,14 +12,14 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// org-dartlang-sdk:///sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
 // pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart:14:8: Error: Too few positional arguments: 1 required, 0 given.
 //   print(incorrectArgument: "fisk");
 //        ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
+// org-dartlang-sdk:///sdk/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
 // void print(Object? object) {
 //      ^^^^^
 //
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.expect
index 38cadb6..abfc065 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.expect
@@ -12,14 +12,14 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
 // pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart:14:8: Error: Too few positional arguments: 1 required, 0 given.
 //   print(incorrectArgument: "fisk");
 //        ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
+// sdk/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
 // void print(Object? object) {
 //      ^^^^^
 //
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.transformed.expect
index 38cadb6..abfc065 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart.weak.transformed.expect
@@ -12,14 +12,14 @@
 //
 // class C extends Iterable<Object> {
 //       ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
+// sdk/lib/core/iterable.dart:158:19: Context: 'Iterable.iterator' is defined here.
 //   Iterator<E> get iterator;
 //                   ^^^^^^^^
 //
 // pkg/front_end/testcases/general_nnbd_opt_out/sdk_diagnostic.dart:14:8: Error: Too few positional arguments: 1 required, 0 given.
 //   print(incorrectArgument: "fisk");
 //        ^
-// org-dartlang-sdk:///sdk_nnbd/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
+// sdk/lib/core/print.dart:8:6: Context: Found this candidate, but the arguments don't match.
 // void print(Object? object) {
 //      ^^^^^
 //
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect
index 047b515..5ea6e57 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.1.expect
@@ -10,13 +10,13 @@
     abstract member-signature get length() → dart.core::int*;
     abstract member-signature operator [](dart.core::int* index) → dart.core::int*;
     abstract member-signature operator []=(dart.core::int* index, generic-covariant-impl dart.core::int* value) → void;
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ iterator() → dart.core::Iterator<dart.core::int*>
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ iterator() → dart.core::Iterator<dart.core::int*>
       return new dart._internal::ListIterator::•<dart.core::int*>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ elementAt(dart.core::int index) → dart.core::int*
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ elementAt(dart.core::int index) → dart.core::int*
       return this.{dart.core::List::[]}(index);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ followedBy(generic-covariant-impl dart.core::Iterable<dart.core::int*> other) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ followedBy(generic-covariant-impl dart.core::Iterable<dart.core::int*> other) → dart.core::Iterable<dart.core::int*>
       return dart._internal::FollowedByIterable::firstEfficient<dart.core::int*>(this, other);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ forEach((dart.core::int*) → void action) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ forEach((dart.core::int*) → void action) → void {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         action.call(this.{dart.core::List::[]}(i));
@@ -26,11 +26,11 @@
       }
     }
     @#C3
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ isEmpty() → dart.core::bool
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isEmpty() → dart.core::bool
       return this.{dart.core::List::length}.{dart.core::num::==}(0);
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ isNotEmpty() → dart.core::bool
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isNotEmpty() → dart.core::bool
       return !this.{dart.collection::ListMixin::isEmpty};
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ contains(dart.core::Object? element) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ contains(dart.core::Object? element) → dart.core::bool {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         if(this.{dart.core::List::[]}(i).{dart.core::Object::==}(element))
@@ -41,7 +41,7 @@
       }
       return false;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ every((dart.core::int*) → dart.core::bool test) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ every((dart.core::int*) → dart.core::bool test) → dart.core::bool {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         if(!test.call(this.{dart.core::List::[]}(i)))
@@ -52,7 +52,7 @@
       }
       return true;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ any((dart.core::int*) → dart.core::bool test) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ any((dart.core::int*) → dart.core::bool test) → dart.core::bool {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         if(test.call(this.{dart.core::List::[]}(i)))
@@ -63,7 +63,7 @@
       }
       return false;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ firstWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ firstWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         dart.core::int* element = this.{dart.core::List::[]}(i);
@@ -77,7 +77,7 @@
         return orElse{() → dart.core::int*}.call();
       throw dart._internal::IterableElementError::noElement();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ lastWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = length.{dart.core::num::-}(1); i.{dart.core::num::>=}(0); i = i.{dart.core::num::-}(1)) {
         dart.core::int* element = this.{dart.core::List::[]}(i);
@@ -91,7 +91,7 @@
         return orElse{() → dart.core::int*}.call();
       throw dart._internal::IterableElementError::noElement();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ singleWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ singleWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       late dart.core::int* match;
       dart.core::bool matchFound = false;
@@ -114,7 +114,7 @@
         return orElse{() → dart.core::int*}.call();
       throw dart._internal::IterableElementError::noElement();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ join([dart.core::String separator = #C4]) → dart.core::String {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ join([dart.core::String separator = #C4]) → dart.core::String {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         return "";
       dart.core::StringBuffer buffer = let final dart.core::StringBuffer #t1 = new dart.core::StringBuffer::•() in block {
@@ -122,15 +122,15 @@
       } =>#t1;
       return buffer.{dart.core::StringBuffer::toString}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ where((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ where((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*>
       return new dart._internal::WhereIterable::•<dart.core::int*>(this, test);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ whereType<T extends dart.core::Object? = dynamic>() → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::whereType::T%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ whereType<T extends dart.core::Object? = dynamic>() → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::whereType::T%>
       return new dart._internal::WhereTypeIterable::•<main::_WithListMixin&Object&ListMixin::whereType::T%>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ map<T extends dart.core::Object? = dynamic>((dart.core::int*) → main::_WithListMixin&Object&ListMixin::map::T% f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::map::T%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ map<T extends dart.core::Object? = dynamic>((dart.core::int*) → main::_WithListMixin&Object&ListMixin::map::T% f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::map::T%>
       return new dart._internal::MappedListIterable::•<dart.core::int*, main::_WithListMixin&Object&ListMixin::map::T%>(this, f);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ expand<T extends dart.core::Object? = dynamic>((dart.core::int*) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%> f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ expand<T extends dart.core::Object? = dynamic>((dart.core::int*) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%> f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%>
       return new dart._internal::ExpandIterable::•<dart.core::int*, main::_WithListMixin&Object&ListMixin::expand::T%>(this, f);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ reduce(generic-covariant-impl (dart.core::int*, dart.core::int*) → dart.core::int* combine) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reduce(generic-covariant-impl (dart.core::int*, dart.core::int*) → dart.core::int* combine) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       if(length.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
@@ -143,7 +143,7 @@
       }
       return value;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ fold<T extends dart.core::Object? = dynamic>(main::_WithListMixin&Object&ListMixin::fold::T% initialValue, (main::_WithListMixin&Object&ListMixin::fold::T%, dart.core::int*) → main::_WithListMixin&Object&ListMixin::fold::T% combine) → main::_WithListMixin&Object&ListMixin::fold::T% {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fold<T extends dart.core::Object? = dynamic>(main::_WithListMixin&Object&ListMixin::fold::T% initialValue, (main::_WithListMixin&Object&ListMixin::fold::T%, dart.core::int*) → main::_WithListMixin&Object&ListMixin::fold::T% combine) → main::_WithListMixin&Object&ListMixin::fold::T% {
       main::_WithListMixin&Object&ListMixin::fold::T% value = initialValue;
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
@@ -154,17 +154,17 @@
       }
       return value;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ skip(dart.core::int count) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skip(dart.core::int count) → dart.core::Iterable<dart.core::int*>
       return new dart._internal::SubListIterable::•<dart.core::int*>(this, count, null);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ skipWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skipWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
       return new dart._internal::SkipWhileIterable::•<dart.core::int*>(this, test);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ take(dart.core::int count) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ take(dart.core::int count) → dart.core::Iterable<dart.core::int*>
       return new dart._internal::SubListIterable::•<dart.core::int*>(this, 0, count);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ takeWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ takeWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
       return new dart._internal::TakeWhileIterable::•<dart.core::int*>(this, test);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ toList({dart.core::bool growable = #C5}) → dart.core::List<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toList({dart.core::bool growable = #C5}) → dart.core::List<dart.core::int*> {
       if(this.{dart.collection::ListMixin::isEmpty})
         return dart.core::List::empty<dart.core::int*>(growable: growable);
       dart.core::int* first = this.{dart.core::List::[]}(0);
@@ -174,14 +174,14 @@
       }
       return result;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ toSet() → dart.core::Set<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toSet() → dart.core::Set<dart.core::int*> {
       dart.core::Set<dart.core::int*> result = dart.collection::LinkedHashSet::•<dart.core::int*>();
       for (dart.core::int i = 0; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
         result.{dart.core::Set::add}(this.{dart.core::List::[]}(i));
       }
       return result;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ addAll(generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ addAll(generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
       dart.core::int i = this.{dart.core::List::length};
       {
         dart.core::Iterator<dart.core::int*> :sync-for-iterator = iterable.{dart.core::Iterable::iterator};
@@ -195,7 +195,7 @@
         }
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ remove(dart.core::Object? element) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ remove(dart.core::Object? element) → dart.core::bool {
       for (dart.core::int i = 0; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
         if(this.{dart.core::List::[]}(i).{dart.core::Object::==}(element)) {
           this.{dart.collection::ListMixin::_closeGap}(i, i.{dart.core::num::+}(1));
@@ -204,7 +204,7 @@
       }
       return false;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ _closeGap(dart.core::int start, dart.core::int end) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _closeGap(dart.core::int start, dart.core::int end) → void {
       dart.core::int length = this.{dart.core::List::length};
       assert(0.{dart.core::num::<=}(start));
       assert(start.{dart.core::num::<}(end));
@@ -215,13 +215,13 @@
       }
       this.{dart.core::List::length} = length.{dart.core::num::-}(size);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeWhere((dart.core::int*) → dart.core::bool test) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeWhere((dart.core::int*) → dart.core::bool test) → void {
       this.{dart.collection::ListMixin::_filter}(test, false);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ retainWhere((dart.core::int*) → dart.core::bool test) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ retainWhere((dart.core::int*) → dart.core::bool test) → void {
       this.{dart.collection::ListMixin::_filter}(test, true);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ _filter((dart.core::int*) → dart.core::bool test, dart.core::bool retainMatching) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _filter((dart.core::int*) → dart.core::bool test, dart.core::bool retainMatching) → void {
       dart.core::List<dart.core::int*> retained = <dart.core::int*>[];
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
@@ -238,12 +238,12 @@
         this.{dart.core::List::length} = retained.{dart.core::List::length};
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ cast<R extends dart.core::Object? = dynamic>() → dart.core::List<main::_WithListMixin&Object&ListMixin::cast::R%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ cast<R extends dart.core::Object? = dynamic>() → dart.core::List<main::_WithListMixin&Object&ListMixin::cast::R%>
       return dart.core::List::castFrom<dart.core::int*, main::_WithListMixin&Object&ListMixin::cast::R%>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ sort([(dart.core::int*, dart.core::int*) →? dart.core::int compare = #C2]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sort([(dart.core::int*, dart.core::int*) →? dart.core::int compare = #C2]) → void {
       dart._internal::Sort::sort<dart.core::int*>(this, let final (dart.core::int*, dart.core::int*) →? dart.core::int #t2 = compare in #t2.{dart.core::Object::==}(null) ?{(dart.core::int*, dart.core::int*) → dart.core::int} #C6 : #t2{(dart.core::int*, dart.core::int*) → dart.core::int});
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ shuffle([dart.math::Random? random = #C2]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ shuffle([dart.math::Random? random = #C2]) → void {
       random.{dart.core::Object::==}(null) ?{dart.math::Random} random = dart.math::Random::•() : null;
       if(random{dart.math::Random}.{dart.core::Object::==}(null))
         throw "!";
@@ -256,10 +256,10 @@
         this.{dart.core::List::[]=}(pos, tmp);
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ asMap() → dart.core::Map<dart.core::int, dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ asMap() → dart.core::Map<dart.core::int, dart.core::int*> {
       return new dart._internal::ListMapView::•<dart.core::int*>(this);
     }
-    operator /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ +(generic-covariant-impl dart.core::List<dart.core::int*> other) → dart.core::List<dart.core::int*>
+    operator /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ +(generic-covariant-impl dart.core::List<dart.core::int*> other) → dart.core::List<dart.core::int*>
       return block {
         final dart.core::List<dart.core::int*> #t3 = <dart.core::int*>[];
         {
@@ -277,7 +277,7 @@
           }
         }
       } =>#t3;
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ sublist(dart.core::int start, [dart.core::int? end = #C2]) → dart.core::List<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sublist(dart.core::int start, [dart.core::int? end = #C2]) → dart.core::List<dart.core::int*> {
       dart.core::int listLength = this.{dart.core::List::length};
       end.{dart.core::num::==}(null) ?{dart.core::int} end = listLength : null;
       if(end{dart.core::int}.{dart.core::num::==}(null))
@@ -285,24 +285,24 @@
       dart.core::RangeError::checkValidRange(start, end{dart.core::int}, listLength);
       return dart.core::List::from<dart.core::int*>(this.{dart.collection::ListMixin::getRange}(start, end{dart.core::int}));
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ getRange(dart.core::int start, dart.core::int end) → dart.core::Iterable<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ getRange(dart.core::int start, dart.core::int end) → dart.core::Iterable<dart.core::int*> {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       return new dart._internal::SubListIterable::•<dart.core::int*>(this, start, end);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeRange(dart.core::int start, dart.core::int end) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeRange(dart.core::int start, dart.core::int end) → void {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       if(end.{dart.core::num::>}(start)) {
         this.{dart.collection::ListMixin::_closeGap}(start, end);
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ fillRange(dart.core::int start, dart.core::int end, [generic-covariant-impl dart.core::int? fill = #C2]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fillRange(dart.core::int start, dart.core::int end, [generic-covariant-impl dart.core::int? fill = #C2]) → void {
       dart.core::int* value = let dart.core::int? #t6 = fill in #t6.==(null) ?{dart.core::int*} #t6 : #t6{dart.core::int*};
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       for (dart.core::int i = start; i.{dart.core::num::<}(end); i = i.{dart.core::num::+}(1)) {
         this.{dart.core::List::[]=}(i, value);
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ setRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable, [dart.core::int skipCount = #C7]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable, [dart.core::int skipCount = #C7]) → void {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       dart.core::int length = end.{dart.core::num::-}(start);
       if(length.{dart.core::num::==}(0))
@@ -332,7 +332,7 @@
         }
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ replaceRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> newContents) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ replaceRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> newContents) → void {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       if(start.{dart.core::num::==}(this.{dart.core::List::length})) {
         this.{dart.collection::ListMixin::addAll}(newContents);
@@ -382,7 +382,7 @@
           this.{dart.collection::ListMixin::setRange}(start, insertEnd, newContents);
         }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ indexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int start = #C7]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int start = #C7]) → dart.core::int {
       if(start.{dart.core::num::<}(0))
         start = 0;
       for (dart.core::int i = start; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
@@ -391,7 +391,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ indexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int start = #C7]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int start = #C7]) → dart.core::int {
       if(start.{dart.core::num::<}(0))
         start = 0;
       for (dart.core::int i = start; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
@@ -400,7 +400,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ lastIndexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int? start = #C2]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int? start = #C2]) → dart.core::int {
       if(start.{dart.core::num::==}(null) || start{dart.core::int}.{dart.core::num::>=}(this.{dart.core::List::length}))
         start = this.{dart.core::List::length}.{dart.core::num::-}(1);
       if(start{dart.core::int}.{dart.core::num::==}(null))
@@ -411,7 +411,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ lastIndexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int? start = #C2]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int? start = #C2]) → dart.core::int {
       if(start.{dart.core::num::==}(null) || start{dart.core::int}.{dart.core::num::>=}(this.{dart.core::List::length}))
         start = this.{dart.core::List::length}.{dart.core::num::-}(1);
       if(start{dart.core::int}.{dart.core::num::==}(null))
@@ -422,7 +422,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ insert(dart.core::int index, generic-covariant-impl dart.core::int* element) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insert(dart.core::int index, generic-covariant-impl dart.core::int* element) → void {
       dart.core::ArgumentError::checkNotNull<dart.core::int>(index, "index");
       dart.core::RangeError::checkValueInInterval(index, 0, this.{dart.core::List::length}, "index");
       if(index.{dart.core::num::==}(this.{dart.core::List::length})) {
@@ -433,12 +433,12 @@
       this.{dart.collection::ListMixin::setRange}(index.{dart.core::num::+}(1), this.{dart.core::List::length}, this, index);
       this.{dart.core::List::[]=}(index, element);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeAt(dart.core::int index) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeAt(dart.core::int index) → dart.core::int* {
       dart.core::int* result = this.{dart.core::List::[]}(index);
       this.{dart.collection::ListMixin::_closeGap}(index, index.{dart.core::num::+}(1));
       return result;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ insertAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insertAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
       dart.core::RangeError::checkValueInInterval(index, 0, this.{dart.core::List::length}, "index");
       if(index.{dart.core::num::==}(this.{dart.core::List::length})) {
         this.{dart.collection::ListMixin::addAll}(iterable);
@@ -465,7 +465,7 @@
       }
       this.{dart.collection::ListMixin::setAll}(index, iterable);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ setAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
       if(iterable is{ForNonNullableByDefault} dart.core::List<dynamic>) {
         this.{dart.collection::ListMixin::setRange}(index, index.{dart.core::num::+}(iterable.{dart.core::Iterable::length}), iterable);
       }
@@ -481,9 +481,9 @@
         }
       }
     }
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ reversed() → dart.core::Iterable<dart.core::int*>
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reversed() → dart.core::Iterable<dart.core::int*>
       return new dart._internal::ReversedListIterable::•<dart.core::int*>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ toString() → dart.core::String
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toString() → dart.core::String
       return dart.collection::IterableBase::iterableToFullString(this, "[", "]");
     abstract member-signature get _identityHashCode() → dart.core::int*;
     abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*;
@@ -495,40 +495,40 @@
     abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic;
     abstract member-signature get runtimeType() → dart.core::Type*;
     abstract member-signature set length(dart.core::int* newLength) → void;
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ first() → dart.core::int* {
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       return this.{dart.core::List::[]}(0);
     }
-    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ first(generic-covariant-impl dart.core::int* value) → void {
+    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first(generic-covariant-impl dart.core::int* value) → void {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       this.{dart.core::List::[]=}(0, value);
     }
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ last() → dart.core::int* {
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       return this.{dart.core::List::[]}(this.{dart.core::List::length}.{dart.core::num::-}(1));
     }
-    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ last(generic-covariant-impl dart.core::int* value) → void {
+    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last(generic-covariant-impl dart.core::int* value) → void {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       this.{dart.core::List::[]=}(this.{dart.core::List::length}.{dart.core::num::-}(1), value);
     }
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ single() → dart.core::int* {
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ single() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       if(this.{dart.core::List::length}.{dart.core::num::>}(1))
         throw dart._internal::IterableElementError::tooMany();
       return this.{dart.core::List::[]}(0);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ add(generic-covariant-impl dart.core::int* element) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ add(generic-covariant-impl dart.core::int* element) → void {
       this.{dart.core::List::[]=}(let final dart.core::int #t9 = this.{dart.core::List::length} in let final dart.core::int #t10 = this.{dart.core::List::length} = #t9.{dart.core::num::+}(1) in #t9, element);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ clear() → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ clear() → void {
       this.{dart.core::List::length} = 0;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeLast() → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeLast() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0)) {
         throw dart._internal::IterableElementError::noElement();
       }
@@ -536,7 +536,7 @@
       this.{dart.core::List::length} = this.{dart.core::List::length}.{dart.core::num::-}(1);
       return result;
     }
-    static method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ _compareAny(dynamic a, dynamic b) → dart.core::int {
+    static method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _compareAny(dynamic a, dynamic b) → dart.core::int {
       return dart.core::Comparable::compare(a as{ForNonNullableByDefault} dart.core::Comparable<dynamic>, b as{ForNonNullableByDefault} dart.core::Comparable<dynamic>);
     }
   }
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect
index 047b515..5ea6e57 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_22.yaml.world.2.expect
@@ -10,13 +10,13 @@
     abstract member-signature get length() → dart.core::int*;
     abstract member-signature operator [](dart.core::int* index) → dart.core::int*;
     abstract member-signature operator []=(dart.core::int* index, generic-covariant-impl dart.core::int* value) → void;
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ iterator() → dart.core::Iterator<dart.core::int*>
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ iterator() → dart.core::Iterator<dart.core::int*>
       return new dart._internal::ListIterator::•<dart.core::int*>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ elementAt(dart.core::int index) → dart.core::int*
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ elementAt(dart.core::int index) → dart.core::int*
       return this.{dart.core::List::[]}(index);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ followedBy(generic-covariant-impl dart.core::Iterable<dart.core::int*> other) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ followedBy(generic-covariant-impl dart.core::Iterable<dart.core::int*> other) → dart.core::Iterable<dart.core::int*>
       return dart._internal::FollowedByIterable::firstEfficient<dart.core::int*>(this, other);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ forEach((dart.core::int*) → void action) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ forEach((dart.core::int*) → void action) → void {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         action.call(this.{dart.core::List::[]}(i));
@@ -26,11 +26,11 @@
       }
     }
     @#C3
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ isEmpty() → dart.core::bool
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isEmpty() → dart.core::bool
       return this.{dart.core::List::length}.{dart.core::num::==}(0);
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ isNotEmpty() → dart.core::bool
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isNotEmpty() → dart.core::bool
       return !this.{dart.collection::ListMixin::isEmpty};
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ contains(dart.core::Object? element) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ contains(dart.core::Object? element) → dart.core::bool {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         if(this.{dart.core::List::[]}(i).{dart.core::Object::==}(element))
@@ -41,7 +41,7 @@
       }
       return false;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ every((dart.core::int*) → dart.core::bool test) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ every((dart.core::int*) → dart.core::bool test) → dart.core::bool {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         if(!test.call(this.{dart.core::List::[]}(i)))
@@ -52,7 +52,7 @@
       }
       return true;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ any((dart.core::int*) → dart.core::bool test) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ any((dart.core::int*) → dart.core::bool test) → dart.core::bool {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         if(test.call(this.{dart.core::List::[]}(i)))
@@ -63,7 +63,7 @@
       }
       return false;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ firstWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ firstWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
         dart.core::int* element = this.{dart.core::List::[]}(i);
@@ -77,7 +77,7 @@
         return orElse{() → dart.core::int*}.call();
       throw dart._internal::IterableElementError::noElement();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ lastWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = length.{dart.core::num::-}(1); i.{dart.core::num::>=}(0); i = i.{dart.core::num::-}(1)) {
         dart.core::int* element = this.{dart.core::List::[]}(i);
@@ -91,7 +91,7 @@
         return orElse{() → dart.core::int*}.call();
       throw dart._internal::IterableElementError::noElement();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ singleWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ singleWhere((dart.core::int*) → dart.core::bool test, {generic-covariant-impl () →? dart.core::int* orElse = #C2}) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       late dart.core::int* match;
       dart.core::bool matchFound = false;
@@ -114,7 +114,7 @@
         return orElse{() → dart.core::int*}.call();
       throw dart._internal::IterableElementError::noElement();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ join([dart.core::String separator = #C4]) → dart.core::String {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ join([dart.core::String separator = #C4]) → dart.core::String {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         return "";
       dart.core::StringBuffer buffer = let final dart.core::StringBuffer #t1 = new dart.core::StringBuffer::•() in block {
@@ -122,15 +122,15 @@
       } =>#t1;
       return buffer.{dart.core::StringBuffer::toString}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ where((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ where((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*>
       return new dart._internal::WhereIterable::•<dart.core::int*>(this, test);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ whereType<T extends dart.core::Object? = dynamic>() → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::whereType::T%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ whereType<T extends dart.core::Object? = dynamic>() → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::whereType::T%>
       return new dart._internal::WhereTypeIterable::•<main::_WithListMixin&Object&ListMixin::whereType::T%>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ map<T extends dart.core::Object? = dynamic>((dart.core::int*) → main::_WithListMixin&Object&ListMixin::map::T% f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::map::T%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ map<T extends dart.core::Object? = dynamic>((dart.core::int*) → main::_WithListMixin&Object&ListMixin::map::T% f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::map::T%>
       return new dart._internal::MappedListIterable::•<dart.core::int*, main::_WithListMixin&Object&ListMixin::map::T%>(this, f);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ expand<T extends dart.core::Object? = dynamic>((dart.core::int*) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%> f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ expand<T extends dart.core::Object? = dynamic>((dart.core::int*) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%> f) → dart.core::Iterable<main::_WithListMixin&Object&ListMixin::expand::T%>
       return new dart._internal::ExpandIterable::•<dart.core::int*, main::_WithListMixin&Object&ListMixin::expand::T%>(this, f);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ reduce(generic-covariant-impl (dart.core::int*, dart.core::int*) → dart.core::int* combine) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reduce(generic-covariant-impl (dart.core::int*, dart.core::int*) → dart.core::int* combine) → dart.core::int* {
       dart.core::int length = this.{dart.core::List::length};
       if(length.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
@@ -143,7 +143,7 @@
       }
       return value;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ fold<T extends dart.core::Object? = dynamic>(main::_WithListMixin&Object&ListMixin::fold::T% initialValue, (main::_WithListMixin&Object&ListMixin::fold::T%, dart.core::int*) → main::_WithListMixin&Object&ListMixin::fold::T% combine) → main::_WithListMixin&Object&ListMixin::fold::T% {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fold<T extends dart.core::Object? = dynamic>(main::_WithListMixin&Object&ListMixin::fold::T% initialValue, (main::_WithListMixin&Object&ListMixin::fold::T%, dart.core::int*) → main::_WithListMixin&Object&ListMixin::fold::T% combine) → main::_WithListMixin&Object&ListMixin::fold::T% {
       main::_WithListMixin&Object&ListMixin::fold::T% value = initialValue;
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
@@ -154,17 +154,17 @@
       }
       return value;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ skip(dart.core::int count) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skip(dart.core::int count) → dart.core::Iterable<dart.core::int*>
       return new dart._internal::SubListIterable::•<dart.core::int*>(this, count, null);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ skipWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skipWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
       return new dart._internal::SkipWhileIterable::•<dart.core::int*>(this, test);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ take(dart.core::int count) → dart.core::Iterable<dart.core::int*>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ take(dart.core::int count) → dart.core::Iterable<dart.core::int*>
       return new dart._internal::SubListIterable::•<dart.core::int*>(this, 0, count);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ takeWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ takeWhile((dart.core::int*) → dart.core::bool test) → dart.core::Iterable<dart.core::int*> {
       return new dart._internal::TakeWhileIterable::•<dart.core::int*>(this, test);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ toList({dart.core::bool growable = #C5}) → dart.core::List<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toList({dart.core::bool growable = #C5}) → dart.core::List<dart.core::int*> {
       if(this.{dart.collection::ListMixin::isEmpty})
         return dart.core::List::empty<dart.core::int*>(growable: growable);
       dart.core::int* first = this.{dart.core::List::[]}(0);
@@ -174,14 +174,14 @@
       }
       return result;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ toSet() → dart.core::Set<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toSet() → dart.core::Set<dart.core::int*> {
       dart.core::Set<dart.core::int*> result = dart.collection::LinkedHashSet::•<dart.core::int*>();
       for (dart.core::int i = 0; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
         result.{dart.core::Set::add}(this.{dart.core::List::[]}(i));
       }
       return result;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ addAll(generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ addAll(generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
       dart.core::int i = this.{dart.core::List::length};
       {
         dart.core::Iterator<dart.core::int*> :sync-for-iterator = iterable.{dart.core::Iterable::iterator};
@@ -195,7 +195,7 @@
         }
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ remove(dart.core::Object? element) → dart.core::bool {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ remove(dart.core::Object? element) → dart.core::bool {
       for (dart.core::int i = 0; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
         if(this.{dart.core::List::[]}(i).{dart.core::Object::==}(element)) {
           this.{dart.collection::ListMixin::_closeGap}(i, i.{dart.core::num::+}(1));
@@ -204,7 +204,7 @@
       }
       return false;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ _closeGap(dart.core::int start, dart.core::int end) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _closeGap(dart.core::int start, dart.core::int end) → void {
       dart.core::int length = this.{dart.core::List::length};
       assert(0.{dart.core::num::<=}(start));
       assert(start.{dart.core::num::<}(end));
@@ -215,13 +215,13 @@
       }
       this.{dart.core::List::length} = length.{dart.core::num::-}(size);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeWhere((dart.core::int*) → dart.core::bool test) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeWhere((dart.core::int*) → dart.core::bool test) → void {
       this.{dart.collection::ListMixin::_filter}(test, false);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ retainWhere((dart.core::int*) → dart.core::bool test) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ retainWhere((dart.core::int*) → dart.core::bool test) → void {
       this.{dart.collection::ListMixin::_filter}(test, true);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ _filter((dart.core::int*) → dart.core::bool test, dart.core::bool retainMatching) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _filter((dart.core::int*) → dart.core::bool test, dart.core::bool retainMatching) → void {
       dart.core::List<dart.core::int*> retained = <dart.core::int*>[];
       dart.core::int length = this.{dart.core::List::length};
       for (dart.core::int i = 0; i.{dart.core::num::<}(length); i = i.{dart.core::num::+}(1)) {
@@ -238,12 +238,12 @@
         this.{dart.core::List::length} = retained.{dart.core::List::length};
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ cast<R extends dart.core::Object? = dynamic>() → dart.core::List<main::_WithListMixin&Object&ListMixin::cast::R%>
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ cast<R extends dart.core::Object? = dynamic>() → dart.core::List<main::_WithListMixin&Object&ListMixin::cast::R%>
       return dart.core::List::castFrom<dart.core::int*, main::_WithListMixin&Object&ListMixin::cast::R%>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ sort([(dart.core::int*, dart.core::int*) →? dart.core::int compare = #C2]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sort([(dart.core::int*, dart.core::int*) →? dart.core::int compare = #C2]) → void {
       dart._internal::Sort::sort<dart.core::int*>(this, let final (dart.core::int*, dart.core::int*) →? dart.core::int #t2 = compare in #t2.{dart.core::Object::==}(null) ?{(dart.core::int*, dart.core::int*) → dart.core::int} #C6 : #t2{(dart.core::int*, dart.core::int*) → dart.core::int});
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ shuffle([dart.math::Random? random = #C2]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ shuffle([dart.math::Random? random = #C2]) → void {
       random.{dart.core::Object::==}(null) ?{dart.math::Random} random = dart.math::Random::•() : null;
       if(random{dart.math::Random}.{dart.core::Object::==}(null))
         throw "!";
@@ -256,10 +256,10 @@
         this.{dart.core::List::[]=}(pos, tmp);
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ asMap() → dart.core::Map<dart.core::int, dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ asMap() → dart.core::Map<dart.core::int, dart.core::int*> {
       return new dart._internal::ListMapView::•<dart.core::int*>(this);
     }
-    operator /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ +(generic-covariant-impl dart.core::List<dart.core::int*> other) → dart.core::List<dart.core::int*>
+    operator /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ +(generic-covariant-impl dart.core::List<dart.core::int*> other) → dart.core::List<dart.core::int*>
       return block {
         final dart.core::List<dart.core::int*> #t3 = <dart.core::int*>[];
         {
@@ -277,7 +277,7 @@
           }
         }
       } =>#t3;
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ sublist(dart.core::int start, [dart.core::int? end = #C2]) → dart.core::List<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sublist(dart.core::int start, [dart.core::int? end = #C2]) → dart.core::List<dart.core::int*> {
       dart.core::int listLength = this.{dart.core::List::length};
       end.{dart.core::num::==}(null) ?{dart.core::int} end = listLength : null;
       if(end{dart.core::int}.{dart.core::num::==}(null))
@@ -285,24 +285,24 @@
       dart.core::RangeError::checkValidRange(start, end{dart.core::int}, listLength);
       return dart.core::List::from<dart.core::int*>(this.{dart.collection::ListMixin::getRange}(start, end{dart.core::int}));
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ getRange(dart.core::int start, dart.core::int end) → dart.core::Iterable<dart.core::int*> {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ getRange(dart.core::int start, dart.core::int end) → dart.core::Iterable<dart.core::int*> {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       return new dart._internal::SubListIterable::•<dart.core::int*>(this, start, end);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeRange(dart.core::int start, dart.core::int end) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeRange(dart.core::int start, dart.core::int end) → void {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       if(end.{dart.core::num::>}(start)) {
         this.{dart.collection::ListMixin::_closeGap}(start, end);
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ fillRange(dart.core::int start, dart.core::int end, [generic-covariant-impl dart.core::int? fill = #C2]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fillRange(dart.core::int start, dart.core::int end, [generic-covariant-impl dart.core::int? fill = #C2]) → void {
       dart.core::int* value = let dart.core::int? #t6 = fill in #t6.==(null) ?{dart.core::int*} #t6 : #t6{dart.core::int*};
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       for (dart.core::int i = start; i.{dart.core::num::<}(end); i = i.{dart.core::num::+}(1)) {
         this.{dart.core::List::[]=}(i, value);
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ setRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable, [dart.core::int skipCount = #C7]) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable, [dart.core::int skipCount = #C7]) → void {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       dart.core::int length = end.{dart.core::num::-}(start);
       if(length.{dart.core::num::==}(0))
@@ -332,7 +332,7 @@
         }
       }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ replaceRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> newContents) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ replaceRange(dart.core::int start, dart.core::int end, generic-covariant-impl dart.core::Iterable<dart.core::int*> newContents) → void {
       dart.core::RangeError::checkValidRange(start, end, this.{dart.core::List::length});
       if(start.{dart.core::num::==}(this.{dart.core::List::length})) {
         this.{dart.collection::ListMixin::addAll}(newContents);
@@ -382,7 +382,7 @@
           this.{dart.collection::ListMixin::setRange}(start, insertEnd, newContents);
         }
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ indexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int start = #C7]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int start = #C7]) → dart.core::int {
       if(start.{dart.core::num::<}(0))
         start = 0;
       for (dart.core::int i = start; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
@@ -391,7 +391,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ indexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int start = #C7]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int start = #C7]) → dart.core::int {
       if(start.{dart.core::num::<}(0))
         start = 0;
       for (dart.core::int i = start; i.{dart.core::num::<}(this.{dart.core::List::length}); i = i.{dart.core::num::+}(1)) {
@@ -400,7 +400,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ lastIndexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int? start = #C2]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexOf(generic-covariant-impl dart.core::Object? element, [dart.core::int? start = #C2]) → dart.core::int {
       if(start.{dart.core::num::==}(null) || start{dart.core::int}.{dart.core::num::>=}(this.{dart.core::List::length}))
         start = this.{dart.core::List::length}.{dart.core::num::-}(1);
       if(start{dart.core::int}.{dart.core::num::==}(null))
@@ -411,7 +411,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ lastIndexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int? start = #C2]) → dart.core::int {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexWhere((dart.core::int*) → dart.core::bool test, [dart.core::int? start = #C2]) → dart.core::int {
       if(start.{dart.core::num::==}(null) || start{dart.core::int}.{dart.core::num::>=}(this.{dart.core::List::length}))
         start = this.{dart.core::List::length}.{dart.core::num::-}(1);
       if(start{dart.core::int}.{dart.core::num::==}(null))
@@ -422,7 +422,7 @@
       }
       return 1.{dart.core::int::unary-}();
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ insert(dart.core::int index, generic-covariant-impl dart.core::int* element) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insert(dart.core::int index, generic-covariant-impl dart.core::int* element) → void {
       dart.core::ArgumentError::checkNotNull<dart.core::int>(index, "index");
       dart.core::RangeError::checkValueInInterval(index, 0, this.{dart.core::List::length}, "index");
       if(index.{dart.core::num::==}(this.{dart.core::List::length})) {
@@ -433,12 +433,12 @@
       this.{dart.collection::ListMixin::setRange}(index.{dart.core::num::+}(1), this.{dart.core::List::length}, this, index);
       this.{dart.core::List::[]=}(index, element);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeAt(dart.core::int index) → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeAt(dart.core::int index) → dart.core::int* {
       dart.core::int* result = this.{dart.core::List::[]}(index);
       this.{dart.collection::ListMixin::_closeGap}(index, index.{dart.core::num::+}(1));
       return result;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ insertAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insertAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
       dart.core::RangeError::checkValueInInterval(index, 0, this.{dart.core::List::length}, "index");
       if(index.{dart.core::num::==}(this.{dart.core::List::length})) {
         this.{dart.collection::ListMixin::addAll}(iterable);
@@ -465,7 +465,7 @@
       }
       this.{dart.collection::ListMixin::setAll}(index, iterable);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ setAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setAll(dart.core::int index, generic-covariant-impl dart.core::Iterable<dart.core::int*> iterable) → void {
       if(iterable is{ForNonNullableByDefault} dart.core::List<dynamic>) {
         this.{dart.collection::ListMixin::setRange}(index, index.{dart.core::num::+}(iterable.{dart.core::Iterable::length}), iterable);
       }
@@ -481,9 +481,9 @@
         }
       }
     }
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ reversed() → dart.core::Iterable<dart.core::int*>
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reversed() → dart.core::Iterable<dart.core::int*>
       return new dart._internal::ReversedListIterable::•<dart.core::int*>(this);
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ toString() → dart.core::String
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toString() → dart.core::String
       return dart.collection::IterableBase::iterableToFullString(this, "[", "]");
     abstract member-signature get _identityHashCode() → dart.core::int*;
     abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*;
@@ -495,40 +495,40 @@
     abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic;
     abstract member-signature get runtimeType() → dart.core::Type*;
     abstract member-signature set length(dart.core::int* newLength) → void;
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ first() → dart.core::int* {
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       return this.{dart.core::List::[]}(0);
     }
-    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ first(generic-covariant-impl dart.core::int* value) → void {
+    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first(generic-covariant-impl dart.core::int* value) → void {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       this.{dart.core::List::[]=}(0, value);
     }
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ last() → dart.core::int* {
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       return this.{dart.core::List::[]}(this.{dart.core::List::length}.{dart.core::num::-}(1));
     }
-    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ last(generic-covariant-impl dart.core::int* value) → void {
+    set /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last(generic-covariant-impl dart.core::int* value) → void {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       this.{dart.core::List::[]=}(this.{dart.core::List::length}.{dart.core::num::-}(1), value);
     }
-    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ single() → dart.core::int* {
+    get /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ single() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0))
         throw dart._internal::IterableElementError::noElement();
       if(this.{dart.core::List::length}.{dart.core::num::>}(1))
         throw dart._internal::IterableElementError::tooMany();
       return this.{dart.core::List::[]}(0);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ add(generic-covariant-impl dart.core::int* element) → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ add(generic-covariant-impl dart.core::int* element) → void {
       this.{dart.core::List::[]=}(let final dart.core::int #t9 = this.{dart.core::List::length} in let final dart.core::int #t10 = this.{dart.core::List::length} = #t9.{dart.core::num::+}(1) in #t9, element);
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ clear() → void {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ clear() → void {
       this.{dart.core::List::length} = 0;
     }
-    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ removeLast() → dart.core::int* {
+    method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeLast() → dart.core::int* {
       if(this.{dart.core::List::length}.{dart.core::num::==}(0)) {
         throw dart._internal::IterableElementError::noElement();
       }
@@ -536,7 +536,7 @@
       this.{dart.core::List::length} = this.{dart.core::List::length}.{dart.core::num::-}(1);
       return result;
     }
-    static method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk_nnbd/lib/collection/list.dart */ _compareAny(dynamic a, dynamic b) → dart.core::int {
+    static method /*isNonNullableByDefault, from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _compareAny(dynamic a, dynamic b) → dart.core::int {
       return dart.core::Comparable::compare(a as{ForNonNullableByDefault} dart.core::Comparable<dynamic>, b as{ForNonNullableByDefault} dart.core::Comparable<dynamic>);
     }
   }
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.1.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.1.expect
index 670cd63..43db6c1 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.1.expect
@@ -3,7 +3,7 @@
 
   static method whatever() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -55,7 +55,7 @@
   }
   static method main() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.2.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.2.expect
index c7f7622..7c8a833 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_3.yaml.world.2.expect
@@ -3,7 +3,7 @@
 
   static method whatever() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -55,7 +55,7 @@
   }
   static method main() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.1.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.1.expect
index 2b435c3..2d18386 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.1.expect
@@ -21,7 +21,7 @@
   }
   static method main() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -50,7 +50,7 @@
   }
   static method /* from org-dartlang-test:///myPart.dart */ whatever() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.2.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.2.expect
index 5244396..faded3a 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.2.expect
@@ -21,7 +21,7 @@
   }
   static method main() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -50,7 +50,7 @@
   }
   static method /* from org-dartlang-test:///myPart.dart */ whatever() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.3.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.3.expect
index 0f63e01..73c17b9 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.3.expect
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/no_outline_change_5.yaml.world.3.expect
@@ -21,7 +21,7 @@
   }
   static method main() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -51,7 +51,7 @@
   }
   static method /* from org-dartlang-test:///myPart.dart */ whatever() → dynamic /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dynamic>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dynamic>();
-    dart.async::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/async_await.dart.outline.expect b/pkg/front_end/testcases/inference/async_await.dart.outline.expect
index a45961c..63dc8a8 100644
--- a/pkg/front_end/testcases/inference/async_await.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/async_await.dart.outline.expect
@@ -18,11 +18,11 @@
   abstract member-signature method toString() → core::String*;
   abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic;
   abstract member-signature get runtimeType() → core::Type*;
-  abstract member-signature method then<R extends core::Object* = dynamic>((core::int*) →* asy::FutureOr<self::MyFuture::then::R*>* onValue, {core::Function* onError}) → asy::Future<self::MyFuture::then::R*>*;
+  abstract member-signature method then<R extends core::Object* = dynamic>((core::int*) →* FutureOr<self::MyFuture::then::R*>* onValue, {core::Function* onError}) → asy::Future<self::MyFuture::then::R*>*;
   abstract member-signature method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<core::int*>*;
-  abstract member-signature method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<core::int*>*;
+  abstract member-signature method whenComplete(() →* FutureOr<void>* action) → asy::Future<core::int*>*;
   abstract member-signature method asStream() → asy::Stream<core::int*>*;
-  abstract member-signature method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<core::int*>* onTimeout}) → asy::Future<core::int*>*;
+  abstract member-signature method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<core::int*>onTimeout}) → asy::Future<core::int*>*;
 }
 static method test() → void
   ;
diff --git a/pkg/front_end/testcases/inference/async_await.dart.strong.expect b/pkg/front_end/testcases/inference/async_await.dart.strong.expect
index 0d56006..5bb8c93 100644
--- a/pkg/front_end/testcases/inference/async_await.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/async_await.dart.strong.expect
@@ -19,22 +19,22 @@
   abstract member-signature method toString() → core::String*;
   abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic;
   abstract member-signature get runtimeType() → core::Type*;
-  abstract member-signature method then<R extends core::Object* = dynamic>((core::int*) →* asy::FutureOr<self::MyFuture::then::R*>* onValue, {core::Function* onError = #C1}) → asy::Future<self::MyFuture::then::R*>*;
+  abstract member-signature method then<R extends core::Object* = dynamic>((core::int*) →* FutureOr<self::MyFuture::then::R*>* onValue, {core::Function* onError = #C1}) → asy::Future<self::MyFuture::then::R*>*;
   abstract member-signature method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<core::int*>*;
-  abstract member-signature method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<core::int*>*;
+  abstract member-signature method whenComplete(() →* FutureOr<void>* action) → asy::Future<core::int*>*;
   abstract member-signature method asStream() → asy::Stream<core::int*>*;
-  abstract member-signature method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<core::int*>* onTimeout = #C1}) → asy::Future<core::int*>*;
+  abstract member-signature method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<core::int*>onTimeout = #C1}) → asy::Future<core::int*>*;
 }
 static method test() → void async {
   core::int* x0;
   asy::Future<core::int*>* x1;
   asy::Future<asy::Future<core::int*>*>* x2;
-  asy::Future<asy::FutureOr<core::int*>*>* x3;
+  asy::Future<FutureOr<core::int*>*>* x3;
   asy::Future<self::MyFuture*>* x4;
-  asy::FutureOr<core::int*>* x5;
-  asy::FutureOr<asy::Future<core::int*>*>* x6;
-  asy::FutureOr<asy::FutureOr<core::int*>*>* x7;
-  asy::FutureOr<self::MyFuture*>* x8;
+  FutureOr<core::int*>* x5;
+  FutureOr<asy::Future<core::int*>*>* x6;
+  FutureOr<FutureOr<core::int*>*>* x7;
+  FutureOr<self::MyFuture*>* x8;
   self::MyFuture* x9;
   function test0() → asy::Future<core::int*>* async 
     return x0;
@@ -42,7 +42,7 @@
     return x1;
   function test2() → asy::Future<asy::Future<core::int*>*>* async 
     return x2;
-  function test3() → asy::Future<asy::FutureOr<core::int*>*>* async 
+  function test3() → asy::Future<FutureOr<core::int*>*>* async 
     return x3;
   function test4() → asy::Future<self::MyFuture*>* async 
     return x4;
@@ -50,7 +50,7 @@
     return x5;
   function test6() → asy::Future<asy::Future<core::int*>*>* async 
     return x6;
-  function test7() → asy::Future<asy::FutureOr<core::int*>*>* async 
+  function test7() → asy::Future<FutureOr<core::int*>*>* async 
     return x7;
   function test8() → asy::Future<self::MyFuture*>* async 
     return x8;
@@ -59,11 +59,11 @@
   core::int* y0 = await x0;
   core::int* y1 = await x1;
   asy::Future<core::int*>* y2 = await x2;
-  asy::FutureOr<core::int*>* y3 = await x3;
+  FutureOr<core::int*>* y3 = await x3;
   self::MyFuture* y4 = await x4;
   core::int* y5 = await x5;
   asy::Future<core::int*>* y6 = await x6;
-  asy::FutureOr<core::int*>* y7 = await x7;
+  FutureOr<core::int*>* y7 = await x7;
   self::MyFuture* y8 = await x8;
   core::int* y9 = await x9;
 }
diff --git a/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect
index 196321a..c8fb6d9 100644
--- a/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect
@@ -20,15 +20,15 @@
   abstract member-signature method toString() → core::String*;
   abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic;
   abstract member-signature get runtimeType() → core::Type*;
-  abstract member-signature method then<R extends core::Object* = dynamic>((core::int*) →* asy::FutureOr<self::MyFuture::then::R*>* onValue, {core::Function* onError = #C1}) → asy::Future<self::MyFuture::then::R*>*;
+  abstract member-signature method then<R extends core::Object* = dynamic>((core::int*) →* FutureOr<self::MyFuture::then::R*>* onValue, {core::Function* onError = #C1}) → asy::Future<self::MyFuture::then::R*>*;
   abstract member-signature method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<core::int*>*;
-  abstract member-signature method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<core::int*>*;
+  abstract member-signature method whenComplete(() →* FutureOr<void>* action) → asy::Future<core::int*>*;
   abstract member-signature method asStream() → asy::Stream<core::int*>*;
-  abstract member-signature method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<core::int*>* onTimeout = #C1}) → asy::Future<core::int*>*;
+  abstract member-signature method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<core::int*>onTimeout = #C1}) → asy::Future<core::int*>*;
 }
 static method test() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -42,16 +42,16 @@
         core::int* x0;
         asy::Future<core::int*>* x1;
         asy::Future<asy::Future<core::int*>*>* x2;
-        asy::Future<asy::FutureOr<core::int*>*>* x3;
+        asy::Future<FutureOr<core::int*>*>* x3;
         asy::Future<self::MyFuture*>* x4;
-        asy::FutureOr<core::int*>* x5;
-        asy::FutureOr<asy::Future<core::int*>*>* x6;
-        asy::FutureOr<asy::FutureOr<core::int*>*>* x7;
-        asy::FutureOr<self::MyFuture*>* x8;
+        FutureOr<core::int*>* x5;
+        FutureOr<asy::Future<core::int*>*>* x6;
+        FutureOr<FutureOr<core::int*>*>* x7;
+        FutureOr<self::MyFuture*>* x8;
         self::MyFuture* x9;
         function test0() → asy::Future<core::int*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-          asy::FutureOr<core::int*>* :return_value;
+          FutureOr<core::int*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -78,7 +78,7 @@
         }
         function test1() → asy::Future<core::int*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-          asy::FutureOr<core::int*>* :return_value;
+          FutureOr<core::int*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -105,7 +105,7 @@
         }
         function test2() → asy::Future<asy::Future<core::int*>*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<asy::Future<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<asy::Future<core::int*>*>();
-          asy::FutureOr<asy::Future<core::int*>*>* :return_value;
+          FutureOr<asy::Future<core::int*>*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -130,9 +130,9 @@
           :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
           return :async_completer.{asy::Completer::future};
         }
-        function test3() → asy::Future<asy::FutureOr<core::int*>*>* /* originally async */ {
-          final asy::_AsyncAwaitCompleter<asy::FutureOr<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<asy::FutureOr<core::int*>*>();
-          asy::FutureOr<asy::FutureOr<core::int*>*>* :return_value;
+        function test3() → asy::Future<FutureOr<core::int*>*>* /* originally async */ {
+          final asy::_AsyncAwaitCompleter<FutureOr<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<FutureOr<core::int*>*>();
+          FutureOr<FutureOr<core::int*>*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -159,7 +159,7 @@
         }
         function test4() → asy::Future<self::MyFuture*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<self::MyFuture*>* :async_completer = new asy::_AsyncAwaitCompleter::•<self::MyFuture*>();
-          asy::FutureOr<self::MyFuture*>* :return_value;
+          FutureOr<self::MyFuture*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -186,7 +186,7 @@
         }
         function test5() → asy::Future<core::int*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-          asy::FutureOr<core::int*>* :return_value;
+          FutureOr<core::int*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -213,7 +213,7 @@
         }
         function test6() → asy::Future<asy::Future<core::int*>*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<asy::Future<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<asy::Future<core::int*>*>();
-          asy::FutureOr<asy::Future<core::int*>*>* :return_value;
+          FutureOr<asy::Future<core::int*>*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -238,9 +238,9 @@
           :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
           return :async_completer.{asy::Completer::future};
         }
-        function test7() → asy::Future<asy::FutureOr<core::int*>*>* /* originally async */ {
-          final asy::_AsyncAwaitCompleter<asy::FutureOr<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<asy::FutureOr<core::int*>*>();
-          asy::FutureOr<asy::FutureOr<core::int*>*>* :return_value;
+        function test7() → asy::Future<FutureOr<core::int*>*>* /* originally async */ {
+          final asy::_AsyncAwaitCompleter<FutureOr<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<FutureOr<core::int*>*>();
+          FutureOr<FutureOr<core::int*>*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -267,7 +267,7 @@
         }
         function test8() → asy::Future<self::MyFuture*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<self::MyFuture*>* :async_completer = new asy::_AsyncAwaitCompleter::•<self::MyFuture*>();
-          asy::FutureOr<self::MyFuture*>* :return_value;
+          FutureOr<self::MyFuture*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -294,7 +294,7 @@
         }
         function test9() → asy::Future<core::int*>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-          asy::FutureOr<core::int*>* :return_value;
+          FutureOr<core::int*>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -326,7 +326,7 @@
         [yield] let dynamic #t3 = asy::_awaitHelper(x2, :async_op_then, :async_op_error, :async_op) in null;
         asy::Future<core::int*>* y2 = _in::unsafeCast<asy::Future<core::int*>*>(:result);
         [yield] let dynamic #t4 = asy::_awaitHelper(x3, :async_op_then, :async_op_error, :async_op) in null;
-        asy::FutureOr<core::int*>* y3 = _in::unsafeCast<asy::FutureOr<core::int*>*>(:result);
+        FutureOr<core::int*>* y3 = _in::unsafeCast<FutureOr<core::int*>*>(:result);
         [yield] let dynamic #t5 = asy::_awaitHelper(x4, :async_op_then, :async_op_error, :async_op) in null;
         self::MyFuture* y4 = _in::unsafeCast<self::MyFuture*>(:result);
         [yield] let dynamic #t6 = asy::_awaitHelper(x5, :async_op_then, :async_op_error, :async_op) in null;
@@ -334,7 +334,7 @@
         [yield] let dynamic #t7 = asy::_awaitHelper(x6, :async_op_then, :async_op_error, :async_op) in null;
         asy::Future<core::int*>* y6 = _in::unsafeCast<asy::Future<core::int*>*>(:result);
         [yield] let dynamic #t8 = asy::_awaitHelper(x7, :async_op_then, :async_op_error, :async_op) in null;
-        asy::FutureOr<core::int*>* y7 = _in::unsafeCast<asy::FutureOr<core::int*>*>(:result);
+        FutureOr<core::int*>* y7 = _in::unsafeCast<FutureOr<core::int*>*>(:result);
         [yield] let dynamic #t9 = asy::_awaitHelper(x8, :async_op_then, :async_op_error, :async_op) in null;
         self::MyFuture* y8 = _in::unsafeCast<self::MyFuture*>(:result);
         [yield] let dynamic #t10 = asy::_awaitHelper(x9, :async_op_then, :async_op_error, :async_op) in null;
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect
index 9e8bfe0..bcf04f1 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect
@@ -9,7 +9,7 @@
 static field () →* asy::Future<core::int*>* f = () → asy::Future<core::int*>* => self::futureInt;
 static field () →* asy::Future<core::int*>* g = () → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect
index a2f9251..8aa532e 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
 
 static field () →* asy::Future<core::int*>* f = () → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.outline.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.outline.expect
index d290a5b..01ef3de 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.outline.expect
@@ -1,12 +1,12 @@
 library test;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
+import "dart:async" as asy;
 
 import "dart:async";
 
-static field asy::FutureOr<core::int*>* futureOrInt;
-static field () →* asy::FutureOr<core::int*>* f;
+static field FutureOr<core::int*>* futureOrInt;
+static field () →* FutureOr<core::int*>* f;
 static field () →* asy::Future<core::int*>* g;
 static method main() → dynamic
   ;
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.expect
index dfb8367..a44a6a9 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.expect
@@ -1,12 +1,12 @@
 library test;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
+import "dart:async" as asy;
 
 import "dart:async";
 
-static field asy::FutureOr<core::int*>* futureOrInt = null;
-static field () →* asy::FutureOr<core::int*>* f = () → asy::FutureOr<core::int*>* => self::futureOrInt;
+static field FutureOr<core::int*>* futureOrInt = null;
+static field () →* FutureOr<core::int*>* f = () → FutureOr<core::int*>* => self::futureOrInt;
 static field () →* asy::Future<core::int*>* g = () → asy::Future<core::int*>* async => self::futureOrInt;
 static method main() → dynamic {
   self::f;
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect
index ced9ed5..5aaec68 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect
@@ -1,15 +1,15 @@
 library test;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
+import "dart:async" as asy;
 
 import "dart:async";
 
-static field asy::FutureOr<core::int*>* futureOrInt = null;
-static field () →* asy::FutureOr<core::int*>* f = () → asy::FutureOr<core::int*>* => self::futureOrInt;
+static field FutureOr<core::int*>* futureOrInt = null;
+static field () →* FutureOr<core::int*>* f = () → FutureOr<core::int*>* => self::futureOrInt;
 static field () →* asy::Future<core::int*>* g = () → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect
index fd7e37e..a5d1dcd 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect
@@ -10,7 +10,7 @@
 static method test() → dynamic {
   () →* asy::Future<core::num*>* f = () → asy::Future<core::num*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::num*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::num*>();
-    asy::FutureOr<core::num*>* :return_value;
+    FutureOr<core::num*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect
index 162f7e1..bd71f4d 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect
@@ -10,7 +10,7 @@
 static method test() → dynamic {
   () →* asy::Future<core::num*>* f = () → asy::Future<core::num*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::num*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::num*>();
-    asy::FutureOr<core::num*>* :return_value;
+    FutureOr<core::num*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect
index 96bc953..d2c6c6f 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect
@@ -10,7 +10,7 @@
 static method test() → dynamic {
   () →* asy::Future<core::num*>* f = () → asy::Future<core::num*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::num*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::num*>();
-    asy::FutureOr<core::num*>* :return_value;
+    FutureOr<core::num*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect
index ddd3553..2c79978 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -21,7 +21,7 @@
       {
         () →* asy::Future<core::Null?>* f = () → asy::Future<core::Null?>* /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::Null?>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::Null?>();
-          asy::FutureOr<core::Null?>* :return_value;
+          FutureOr<core::Null?>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect
index 50305c2..4f7a9d4 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect
index 23df51a..07cc11f 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
 
 static method main() → asy::Future<dynamic>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.outline.expect
index 8ea5838..e66e007 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.outline.expect
@@ -13,7 +13,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError, () →* void onDone, core::bool* cancelOnError}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect
index 38e3f97..92e2cc4 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect
@@ -13,7 +13,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError = #C1, () →* void onDone = #C1, core::bool* cancelOnError = #C1}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test = #C1}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect
index d5efbac..7b05a6e 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect
@@ -14,7 +14,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError = #C1, () →* void onDone = #C1, core::bool* cancelOnError = #C1}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test = #C1}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
@@ -61,7 +61,7 @@
   return null;
 static method f() → asy::Future<dynamic>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -245,7 +245,7 @@
 }
 static method main() → asy::Future<dynamic>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.outline.expect
index 4e930eb..c2ee04e 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.outline.expect
@@ -13,7 +13,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError, () →* void onDone, core::bool* cancelOnError}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect
index c107453..9d4d940 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect
@@ -40,7 +40,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError = #C1, () →* void onDone = #C1, core::bool* cancelOnError = #C1}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test = #C1}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.transformed.expect
index a13701f..75885b7 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.transformed.expect
@@ -40,7 +40,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError = #C1, () →* void onDone = #C1, core::bool* cancelOnError = #C1}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test = #C1}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect
index 13fcd9e..15e7182 100644
--- a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
 
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then.dart.outline.expect b/pkg/front_end/testcases/inference/future_then.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then.dart.strong.expect b/pkg/front_end/testcases/inference/future_then.dart.strong.expect
index 5377410..85edb25 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect
index 0eeff1d..cd39650 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<dynamic>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -66,7 +66,7 @@
   });
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -95,7 +95,7 @@
   });
   asy::Future<core::int*>* t3 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -122,7 +122,7 @@
   });
   asy::Future<core::int*>* t4 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -153,7 +153,7 @@
   });
   asy::Future<core::int*>* t7 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -180,7 +180,7 @@
   });
   asy::Future<core::int*>* t8 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect
index bfe642f..364a4b1 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect
index d64c01e..5b866b3 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<dynamic>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -66,7 +66,7 @@
   });
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -95,7 +95,7 @@
   });
   asy::Future<core::int*>* t3 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -122,7 +122,7 @@
   });
   asy::Future<core::int*>* t4 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -153,7 +153,7 @@
   });
   asy::Future<core::int*>* t7 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -180,7 +180,7 @@
   });
   asy::Future<core::int*>* t8 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect
index 0e11686..897efb5 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect
index 2859787..8258efc 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<dynamic>* f;
   self::MyFuture<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -66,7 +66,7 @@
   });
   self::MyFuture<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -95,7 +95,7 @@
   });
   self::MyFuture<core::int*>* t3 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -122,7 +122,7 @@
   });
   self::MyFuture<core::int*>* t4 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -153,7 +153,7 @@
   });
   self::MyFuture<core::int*>* t7 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -180,7 +180,7 @@
   });
   self::MyFuture<core::int*>* t8 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect
index 718a135..f3f324c 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect
index 9692dbf..df2cae6 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<dynamic>* f;
   self::MyFuture<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -66,7 +66,7 @@
   });
   self::MyFuture<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -95,7 +95,7 @@
   });
   self::MyFuture<core::int*>* t3 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -122,7 +122,7 @@
   });
   self::MyFuture<core::int*>* t4 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -153,7 +153,7 @@
   });
   self::MyFuture<core::int*>* t7 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -180,7 +180,7 @@
   });
   self::MyFuture<core::int*>* t8 = f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect
index acbacf2..fb93003 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect
index f2070d2..85c2fb2 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   asy::Future<dynamic>* f;
   asy::Future<core::int*>* t1 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -66,7 +66,7 @@
   });
   asy::Future<core::int*>* t2 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -95,7 +95,7 @@
   });
   asy::Future<core::int*>* t3 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -122,7 +122,7 @@
   });
   asy::Future<core::int*>* t4 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -153,7 +153,7 @@
   });
   asy::Future<core::int*>* t7 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -180,7 +180,7 @@
   });
   asy::Future<core::int*>* t8 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect
index 234a7ad..aaf781c 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect
index 69952d5..2ff65cf 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   asy::Future<dynamic>* f;
   asy::Future<core::int*>* t1 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -66,7 +66,7 @@
   });
   asy::Future<core::int*>* t2 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -95,7 +95,7 @@
   });
   asy::Future<core::int*>* t3 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -122,7 +122,7 @@
   });
   asy::Future<core::int*>* t4 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -153,7 +153,7 @@
   });
   asy::Future<core::int*>* t7 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -180,7 +180,7 @@
   });
   asy::Future<core::int*>* t8 = f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect
index c68921b..390633b 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async => x ?{core::int*} 2 : await asy::Future::value<core::int*>(3));
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async {
-    return (await x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+    return (await x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
-  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect
index 960ec7b..d466ab6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -73,7 +73,7 @@
   });
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -85,7 +85,7 @@
         #L2:
         {
           [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -100,9 +100,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect
index 80bb963..f52ac69 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async => x ?{core::int*} 2 : await new self::MyFuture::value<core::int*>(3));
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async {
-    return (await x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+    return (await x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
-  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect
index 7651455..0738d0a1 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -73,7 +73,7 @@
   });
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -85,7 +85,7 @@
         #L2:
         {
           [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -100,9 +100,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect
index 7c4b09e..9b83c6d 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   self::MyFuture<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async => x ?{core::int*} 2 : await asy::Future::value<core::int*>(3));
   self::MyFuture<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async {
-    return (await x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+    return (await x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
-  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect
index 95b376b..12e2069 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   self::MyFuture<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -73,7 +73,7 @@
   });
   self::MyFuture<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -85,7 +85,7 @@
         #L2:
         {
           [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -100,9 +100,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect
index a90b064..bf3ab6b 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   self::MyFuture<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async => x ?{core::int*} 2 : await new self::MyFuture::value<core::int*>(3));
   self::MyFuture<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async {
-    return (await x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+    return (await x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
-  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect
index 4c3c430..8142e71 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::bool*>* f;
   self::MyFuture<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -73,7 +73,7 @@
   });
   self::MyFuture<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -85,7 +85,7 @@
         #L2:
         {
           [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -100,9 +100,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  self::MyFuture<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*);
+  self::MyFuture<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::bool* x) → FutureOr<core::int*>* {
+    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart b/pkg/front_end/testcases/inference/future_then_conditional_5.dart
index 2816ab3..de773b9 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart
@@ -27,10 +27,10 @@
   });
   Future<int> t5 = f. /*@ typeArgs=int* */ /*@target=Future.then*/ then(
       /*info:INFERRED_TYPE_CLOSURE,error:INVALID_CAST_FUNCTION_EXPR*/
-      /*@ returnType=FutureOr<int*>* */ (/*@ type=bool* */ x) =>
+      /*@ returnType=FutureOr<int*> */ (/*@ type=bool* */ x) =>
           x ? 2 : new MyFuture<int>.value(3));
   Future<int> t6 = f. /*@ typeArgs=int* */ /*@target=Future.then*/ then(
-      /*@ returnType=FutureOr<int*>* */ (/*@ type=bool* */ x) {
+      /*@ returnType=FutureOr<int*> */ (/*@ type=bool* */ x) {
     return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
   });
 }
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect
index 33d4ac3..8bb9c69 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   asy::Future<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async => x ?{core::int*} 2 : await new self::MyFuture::value<core::int*>(3));
   asy::Future<core::int*>* t2 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async {
-    return (await x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+    return (await x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
-  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>);
+  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> {
+    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect
index ab7955f..b3e2352 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   asy::Future<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -73,7 +73,7 @@
   });
   asy::Future<core::int*>* t2 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -85,7 +85,7 @@
         #L2:
         {
           [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -100,9 +100,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> => (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>);
+  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> {
+    return (x ?{core::Object*} 2 : new self::MyFuture::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart b/pkg/front_end/testcases/inference/future_then_conditional_6.dart
index 7d2572e..9ee9c32 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart
@@ -25,10 +25,10 @@
   });
   Future<int> t5 = f. /*@ typeArgs=int* */ /*@target=Future.then*/ then(
       /*info:INFERRED_TYPE_CLOSURE,error:INVALID_CAST_FUNCTION_EXPR*/
-      /*@ returnType=FutureOr<int*>* */ (/*@ type=bool* */ x) =>
+      /*@ returnType=FutureOr<int*> */ (/*@ type=bool* */ x) =>
           x ? 2 : new Future<int>.value(3));
   Future<int> t6 = f. /*@ typeArgs=int* */ /*@target=Future.then*/ then(
-      /*@ returnType=FutureOr<int*>* */ (/*@ type=bool* */ x) {
+      /*@ returnType=FutureOr<int*> */ (/*@ type=bool* */ x) {
     return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new Future<int>.value(3);
   });
 }
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect
index 9d0829f..7ff41c8 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   asy::Future<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async => x ?{core::int*} 2 : await asy::Future::value<core::int*>(3));
   asy::Future<core::int*>* t2 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* async {
-    return (await x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+    return (await x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
   });
-  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>);
+  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> {
+    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect
index c72af11..f5032974 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   asy::Future<core::bool*>* f;
   asy::Future<core::int*>* t1 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -73,7 +73,7 @@
   });
   asy::Future<core::int*>* t2 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -85,7 +85,7 @@
         #L2:
         {
           [yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (_in::unsafeCast<core::bool*>(:result) ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -100,9 +100,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → asy::FutureOr<core::int*>* {
-    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> => (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>);
+  asy::Future<core::int*>* t6 = f.{asy::Future::then}<core::int*>((core::bool* x) → FutureOr<core::int*> {
+    return (x ?{core::Object*} 2 : asy::Future::value<core::int*>(3)) as{TypeError} FutureOr<core::int*>;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_explicit_future.dart b/pkg/front_end/testcases/inference/future_then_explicit_future.dart
index c14e152..c1d7db6 100644
--- a/pkg/front_end/testcases/inference/future_then_explicit_future.dart
+++ b/pkg/front_end/testcases/inference/future_then_explicit_future.dart
@@ -12,7 +12,7 @@
   var /*@type=Future<Future<List<int*>*>*>**/ x = f. /*@target=Future.then*/ then<
           Future<List<int>>>(
       /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/
-      /*@returnType=FutureOr<Future<List<int*>*>*>**/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
+      /*@returnType=FutureOr<Future<List<int*>*>*>*/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
   Future<List<int>> y = x;
 }
 
diff --git a/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.expect
index 14fac01..8cb973a 100644
--- a/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.expect
@@ -2,12 +2,11 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:99: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
+// pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:98: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
 //  - 'List' is from 'dart:core'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'Future' is from 'dart:async'.
-//       /*@returnType=FutureOr<Future<List<int*>*>*>**/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
-//                                                                                                   ^
+//       /*@returnType=FutureOr<Future<List<int*>*>*>*/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
+//                                                                                                  ^
 //
 // pkg/front_end/testcases/inference/future_then_explicit_future.dart:16:25: Error: A value of type 'Future<Future<List<int>>>' can't be assigned to a variable of type 'Future<List<int>>'.
 //  - 'Future' is from 'dart:async'.
@@ -23,12 +22,11 @@
 
 static method m1() → dynamic {
   asy::Future<core::int*>* f;
-  asy::Future<asy::Future<core::List<core::int*>*>*>* x = f.{asy::Future::then}<asy::Future<core::List<core::int*>*>*>((core::int* x) → asy::FutureOr<asy::Future<core::List<core::int*>*>*>* => let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:99: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
+  asy::Future<asy::Future<core::List<core::int*>*>*>* x = f.{asy::Future::then}<asy::Future<core::List<core::int*>*>*>((core::int* x) → FutureOr<asy::Future<core::List<core::int*>*>*> => let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:98: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
  - 'List' is from 'dart:core'.
- - 'FutureOr' is from 'dart:async'.
  - 'Future' is from 'dart:async'.
-      /*@returnType=FutureOr<Future<List<int*>*>*>**/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
-                                                                                                  ^" in <dynamic>[] as{TypeError} asy::FutureOr<asy::Future<core::List<core::int*>*>*>*);
+      /*@returnType=FutureOr<Future<List<int*>*>*>*/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
+                                                                                                 ^" in <dynamic>[] as{TypeError} FutureOr<asy::Future<core::List<core::int*>*>*>);
   asy::Future<core::List<core::int*>*>* y = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:16:25: Error: A value of type 'Future<Future<List<int>>>' can't be assigned to a variable of type 'Future<List<int>>'.
  - 'Future' is from 'dart:async'.
  - 'List' is from 'dart:core'.
diff --git a/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.transformed.expect
index 14fac01..8cb973a 100644
--- a/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_explicit_future.dart.strong.transformed.expect
@@ -2,12 +2,11 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:99: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
+// pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:98: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
 //  - 'List' is from 'dart:core'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'Future' is from 'dart:async'.
-//       /*@returnType=FutureOr<Future<List<int*>*>*>**/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
-//                                                                                                   ^
+//       /*@returnType=FutureOr<Future<List<int*>*>*>*/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
+//                                                                                                  ^
 //
 // pkg/front_end/testcases/inference/future_then_explicit_future.dart:16:25: Error: A value of type 'Future<Future<List<int>>>' can't be assigned to a variable of type 'Future<List<int>>'.
 //  - 'Future' is from 'dart:async'.
@@ -23,12 +22,11 @@
 
 static method m1() → dynamic {
   asy::Future<core::int*>* f;
-  asy::Future<asy::Future<core::List<core::int*>*>*>* x = f.{asy::Future::then}<asy::Future<core::List<core::int*>*>*>((core::int* x) → asy::FutureOr<asy::Future<core::List<core::int*>*>*>* => let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:99: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
+  asy::Future<asy::Future<core::List<core::int*>*>*>* x = f.{asy::Future::then}<asy::Future<core::List<core::int*>*>*>((core::int* x) → FutureOr<asy::Future<core::List<core::int*>*>*> => let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:98: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'FutureOr<Future<List<int>>>'.
  - 'List' is from 'dart:core'.
- - 'FutureOr' is from 'dart:async'.
  - 'Future' is from 'dart:async'.
-      /*@returnType=FutureOr<Future<List<int*>*>*>**/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
-                                                                                                  ^" in <dynamic>[] as{TypeError} asy::FutureOr<asy::Future<core::List<core::int*>*>*>*);
+      /*@returnType=FutureOr<Future<List<int*>*>*>*/ (/*@type=int**/ x) => /*@typeArgs=dynamic*/ []);
+                                                                                                 ^" in <dynamic>[] as{TypeError} FutureOr<asy::Future<core::List<core::int*>*>*>);
   asy::Future<core::List<core::int*>*>* y = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:16:25: Error: A value of type 'Future<Future<List<int>>>' can't be assigned to a variable of type 'Future<List<int>>'.
  - 'Future' is from 'dart:async'.
  - 'List' is from 'dart:core'.
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect
index 609e27d..643b5a2 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect
index 6fe1ddc..dd021c0 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,22 +25,22 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::int*>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::Future<core::int*>* async => let final core::int* #t1 = x in #t1.{core::num::==}(null) ?{core::int*} await asy::Future::value<core::int*>(3) : #t1);
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::Future<core::int*>* async {
-    return (let final core::int* #t2 = await x in #t2.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t2) as{TypeError} asy::FutureOr<core::int*>*;
+    return (let final core::int* #t2 = await x in #t2.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t2) as{TypeError} FutureOr<core::int*>*;
   });
-  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::FutureOr<core::int*>* => (let final core::int* #t3 = x in #t3.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t3) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::FutureOr<core::int*>* {
-    return (let final core::int* #t4 = x in #t4.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t4) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::int* x) → FutureOr<core::int*>* => (let final core::int* #t3 = x in #t3.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t3) as{TypeError} FutureOr<core::int*>*);
+  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::int* x) → FutureOr<core::int*>* {
+    return (let final core::int* #t4 = x in #t4.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t4) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect
index cde2c2e..1332feb 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect
@@ -13,7 +13,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -26,18 +26,18 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
   self::MyFuture<core::int*>* f;
   asy::Future<core::int*>* t1 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -74,7 +74,7 @@
   });
   asy::Future<core::int*>* t2 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -86,7 +86,7 @@
         #L2:
         {
           [yield] let dynamic #t3 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
-          :return_value = (let final core::int* #t4 = _in::unsafeCast<core::int*>(:result) in #t4.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t4) as{TypeError} asy::FutureOr<core::int*>*;
+          :return_value = (let final core::int* #t4 = _in::unsafeCast<core::int*>(:result) in #t4.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t4) as{TypeError} FutureOr<core::int*>*;
           break #L2;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -101,9 +101,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   });
-  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::FutureOr<core::int*>* => (let final core::int* #t5 = x in #t5.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t5) as{TypeError} asy::FutureOr<core::int*>*);
-  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::int* x) → asy::FutureOr<core::int*>* {
-    return (let final core::int* #t6 = x in #t6.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t6) as{TypeError} asy::FutureOr<core::int*>*;
+  asy::Future<core::int*>* t5 = f.{self::MyFuture::then}<core::int*>((core::int* x) → FutureOr<core::int*>* => (let final core::int* #t5 = x in #t5.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t5) as{TypeError} FutureOr<core::int*>*);
+  asy::Future<core::int*>* t6 = f.{self::MyFuture::then}<core::int*>((core::int* x) → FutureOr<core::int*>* {
+    return (let final core::int* #t6 = x in #t6.{core::num::==}(null) ?{core::Object*} asy::Future::value<core::int*>(3) : #t6) as{TypeError} FutureOr<core::int*>*;
   });
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect
index 965a593..45ce919 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method main() → void
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect
index 60fb617..554f81c 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect
@@ -21,7 +21,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -34,11 +34,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect
index 1b093f5..aab8523 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect
@@ -21,7 +21,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -34,11 +34,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect
index 965a593..45ce919 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method main() → void
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect
index 5851a4f..2b7ae10 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect
@@ -20,7 +20,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,11 +33,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect
index bf7c9dd..0abc13a 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect
@@ -20,7 +20,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,11 +33,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect
index 21b5e7d..9fbc310 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect
index 84101e4..8c6f9d6 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect
@@ -20,7 +20,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,11 +33,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect
index 44f84be..dbcbdae 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect
@@ -20,7 +20,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,11 +33,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect
index 40acc44..0736982 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method g1(core::bool* x) → asy::Future<core::int*>*
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect
index 2fbacc6..44341e0 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,21 +25,21 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method g1(core::bool* x) → asy::Future<core::int*>* async {
-  return (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+  return (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
 }
 static method g2(core::bool* x) → asy::Future<core::int*>* async 
-  return (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+  return (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
 static method g3(core::bool* x) → asy::Future<core::int*>* async {
   core::Object* y = x ?{core::Object*} 42 : asy::Future::value<core::int*>(42);
-  return y as{TypeError} asy::FutureOr<core::int*>*;
+  return y as{TypeError} FutureOr<core::int*>*;
 }
 static method main() → dynamic {}
 
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect
index 6b1e090..69bb43f 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,16 +25,16 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method g1(core::bool* x) → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -44,7 +44,7 @@
     try {
       #L1:
       {
-        :return_value = (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+        :return_value = (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
         break #L1;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -61,7 +61,7 @@
 }
 static method g2(core::bool* x) → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -71,7 +71,7 @@
     try {
       #L2:
       {
-        :return_value = (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+        :return_value = (x ?{core::Object*} 42 : asy::Future::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
         break #L2;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -88,7 +88,7 @@
 }
 static method g3(core::bool* x) → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -99,7 +99,7 @@
       #L3:
       {
         core::Object* y = x ?{core::Object*} 42 : asy::Future::value<core::int*>(42);
-        :return_value = y as{TypeError} asy::FutureOr<core::int*>*;
+        :return_value = y as{TypeError} FutureOr<core::int*>*;
         break #L3;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect
index 40acc44..0736982 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method g1(core::bool* x) → asy::Future<core::int*>*
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect
index 155f1e3..d9af93a 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,21 +25,21 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method g1(core::bool* x) → asy::Future<core::int*>* async {
-  return (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+  return (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
 }
 static method g2(core::bool* x) → asy::Future<core::int*>* async 
-  return (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+  return (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
 static method g3(core::bool* x) → asy::Future<core::int*>* async {
   core::Object* y = x ?{core::Object*} 42 : new self::MyFuture::value<dynamic>(42);
-  return y as{TypeError} asy::FutureOr<core::int*>*;
+  return y as{TypeError} FutureOr<core::int*>*;
 }
 static method main() → dynamic {}
 
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect
index f7c1ef7..1d9a0b9 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,16 +25,16 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static method g1(core::bool* x) → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -44,7 +44,7 @@
     try {
       #L1:
       {
-        :return_value = (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+        :return_value = (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
         break #L1;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -61,7 +61,7 @@
 }
 static method g2(core::bool* x) → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -71,7 +71,7 @@
     try {
       #L2:
       {
-        :return_value = (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} asy::FutureOr<core::int*>*;
+        :return_value = (x ?{core::Object*} 42 : new self::MyFuture::value<core::int*>(42)) as{TypeError} FutureOr<core::int*>*;
         break #L2;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -88,7 +88,7 @@
 }
 static method g3(core::bool* x) → asy::Future<core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-  asy::FutureOr<core::int*>* :return_value;
+  FutureOr<core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -99,7 +99,7 @@
       #L3:
       {
         core::Object* y = x ?{core::Object*} 42 : new self::MyFuture::value<dynamic>(42);
-        :return_value = y as{TypeError} asy::FutureOr<core::int*>*;
+        :return_value = y as{TypeError} FutureOr<core::int*>*;
         break #L3;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect
index e87f86e..7921c42 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field self::MyFuture<dynamic>* f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect
index 3e86661..0826f74 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect
@@ -3,7 +3,6 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/inference/future_union_downwards.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
-//  - 'FutureOr' is from 'dart:async'.
 //         new /*@ typeArgs=int* */ Future.value('hi'));
 //                                               ^
 //
@@ -20,7 +19,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,18 +32,17 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field self::MyFuture<dynamic>* f;
 static field asy::Future<core::int*>* t1 = self::f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* => asy::Future::value<core::int*>(let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
- - 'FutureOr' is from 'dart:async'.
         new /*@ typeArgs=int* */ Future.value('hi'));
-                                              ^" in "hi" as{TypeError} asy::FutureOr<core::int*>?));
+                                              ^" in "hi" as{TypeError} FutureOr<core::int*>?));
 static field asy::Future<core::List<core::int*>*>* t2 = self::f.{self::MyFuture::then}<core::List<core::int*>*>((dynamic _) → core::List<core::int*>* => <core::int*>[3]);
 static method g2() → asy::Future<core::List<core::int*>*>* async {
   return <core::int*>[3];
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect
index d6315be..20b1196 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect
@@ -3,7 +3,6 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/inference/future_union_downwards.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
-//  - 'FutureOr' is from 'dart:async'.
 //         new /*@ typeArgs=int* */ Future.value('hi'));
 //                                               ^
 //
@@ -20,7 +19,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,22 +32,21 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field self::MyFuture<dynamic>* f;
 static field asy::Future<core::int*>* t1 = self::f.{self::MyFuture::then}<core::int*>((dynamic _) → asy::Future<core::int*>* => asy::Future::value<core::int*>(let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
- - 'FutureOr' is from 'dart:async'.
         new /*@ typeArgs=int* */ Future.value('hi'));
-                                              ^" in "hi" as{TypeError} asy::FutureOr<core::int*>?));
+                                              ^" in "hi" as{TypeError} FutureOr<core::int*>?));
 static field asy::Future<core::List<core::int*>*>* t2 = self::f.{self::MyFuture::then}<core::List<core::int*>*>((dynamic _) → core::List<core::int*>* => <core::int*>[3]);
 static method g2() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -75,7 +73,7 @@
 }
 static method g3() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect
index e87f86e..7921c42 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field self::MyFuture<dynamic>* f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect
index 4986c0e..6b596a6 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field self::MyFuture<dynamic>* f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect
index da8788c..0cfbbe0 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field self::MyFuture<dynamic>* f;
@@ -37,7 +37,7 @@
 static field asy::Future<core::List<core::int*>*>* t2 = self::f.{self::MyFuture::then}<core::List<core::int*>*>((dynamic _) → core::List<core::int*>* => <core::int*>[3]);
 static method g2() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -64,7 +64,7 @@
 }
 static method g3() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect
index bd74f36..6865d8a 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field asy::Future<dynamic>* f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect
index e906a6b..8079a12 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect
@@ -3,7 +3,6 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
-//  - 'FutureOr' is from 'dart:async'.
 //         new /*@ typeArgs=int* */ Future.value('hi'));
 //                                               ^
 //
@@ -20,7 +19,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,18 +32,17 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field asy::Future<dynamic>* f;
 static field asy::Future<core::int*>* t1 = self::f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* => asy::Future::value<core::int*>(let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
- - 'FutureOr' is from 'dart:async'.
         new /*@ typeArgs=int* */ Future.value('hi'));
-                                              ^" in "hi" as{TypeError} asy::FutureOr<core::int*>?));
+                                              ^" in "hi" as{TypeError} FutureOr<core::int*>?));
 static field asy::Future<core::List<core::int*>*>* t2 = self::f.{asy::Future::then}<core::List<core::int*>*>((dynamic _) → core::List<core::int*>* => <core::int*>[3]);
 static method g2() → asy::Future<core::List<core::int*>*>* async {
   return <core::int*>[3];
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect
index e8603e3..4afaee7 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect
@@ -3,7 +3,6 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
-//  - 'FutureOr' is from 'dart:async'.
 //         new /*@ typeArgs=int* */ Future.value('hi'));
 //                                               ^
 //
@@ -20,7 +19,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -33,22 +32,21 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field asy::Future<dynamic>* f;
 static field asy::Future<core::int*>* t1 = self::f.{asy::Future::then}<core::int*>((dynamic _) → asy::Future<core::int*>* => asy::Future::value<core::int*>(let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:47: Error: The argument type 'String' can't be assigned to the parameter type 'FutureOr<int>'.
- - 'FutureOr' is from 'dart:async'.
         new /*@ typeArgs=int* */ Future.value('hi'));
-                                              ^" in "hi" as{TypeError} asy::FutureOr<core::int*>?));
+                                              ^" in "hi" as{TypeError} FutureOr<core::int*>?));
 static field asy::Future<core::List<core::int*>*>* t2 = self::f.{asy::Future::then}<core::List<core::int*>*>((dynamic _) → core::List<core::int*>* => <core::int*>[3]);
 static method g2() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -75,7 +73,7 @@
 }
 static method g3() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect
index bd74f36..6865d8a 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect
@@ -12,7 +12,7 @@
     ;
   method noSuchMethod(core::Invocation* invocation) → dynamic
     ;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError}) → self::MyFuture<self::MyFuture::then::S*>*
     ;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#catchError, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#test: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#whenComplete, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#asStream, 0, const <core::Type*>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol*, dynamic>(const <core::Symbol*, dynamic>{}))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#timeout, 0, const <core::Type*>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#onTimeout: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field asy::Future<dynamic>* f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect
index c3fde44..cc86cc0 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field asy::Future<dynamic>* f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect
index 1926d67..6cd0409 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
     : super core::Object::•() {}
   method noSuchMethod(core::Invocation* invocation) → dynamic
     return null;
-  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* asy::FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
+  method then<S extends core::Object* = dynamic>((self::MyFuture::T*) →* FutureOr<self::MyFuture::then::S*>* f, {core::Function* onError = #C1}) → self::MyFuture<self::MyFuture::then::S*>*
     return null;
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
@@ -25,11 +25,11 @@
   abstract member-signature get runtimeType() → core::Type*;
   member-signature no-such-method-forwarder method catchError(core::Function* onError, {(core::Object*) →* core::bool* test = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C4: test}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method whenComplete(() →* asy::FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method whenComplete(() →* FutureOr<void>* action) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
   member-signature no-such-method-forwarder method asStream() → asy::Stream<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C8, 0, #C3, #C6, core::Map::unmodifiable<core::Symbol*, dynamic>(#C7))) as{TypeError,ForDynamic} asy::Stream<self::MyFuture::T*>*;
-  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* asy::FutureOr<self::MyFuture::T*>* onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
+  member-signature no-such-method-forwarder method timeout(core::Duration* timeLimit, {generic-covariant-impl () →* FutureOr<self::MyFuture::T*>onTimeout = #C1}) → asy::Future<self::MyFuture::T*>*
     return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withType(#C9, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol*, dynamic>(<core::Symbol*, dynamic>{#C10: onTimeout}))) as{TypeError,ForDynamic} asy::Future<self::MyFuture::T*>*;
 }
 static field asy::Future<dynamic>* f;
@@ -37,7 +37,7 @@
 static field asy::Future<core::List<core::int*>*>* t2 = self::f.{asy::Future::then}<core::List<core::int*>*>((dynamic _) → core::List<core::int*>* => <core::int*>[3]);
 static method g2() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -64,7 +64,7 @@
 }
 static method g3() → asy::Future<core::List<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::List<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::List<core::int*>*>();
-  asy::FutureOr<core::List<core::int*>*>* :return_value;
+  FutureOr<core::List<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect
index 2ab55bf..33182fc 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect
@@ -23,7 +23,7 @@
 }
 static method foo() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect
index 708e39c..8b0d132 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect
@@ -9,6 +9,6 @@
   return x;
 static method test() → dynamic async {
   asy::Future<core::String*>* f;
-  core::String* s = await self::id<asy::FutureOr<core::String*>*>(f);
+  core::String* s = await self::id<FutureOr<core::String*>*>(f);
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect
index a653b4c..3529676 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect
@@ -10,7 +10,7 @@
   return x;
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -22,7 +22,7 @@
       #L1:
       {
         asy::Future<core::String*>* f;
-        [yield] let dynamic #t1 = asy::_awaitHelper(self::id<asy::FutureOr<core::String*>*>(f), :async_op_then, :async_op_error, :async_op) in null;
+        [yield] let dynamic #t1 = asy::_awaitHelper(self::id<FutureOr<core::String*>*>(f), :async_op_then, :async_op_error, :async_op) in null;
         core::String* s = _in::unsafeCast<core::String*>(:result);
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect
index 53d3ff0..98d6862 100644
--- a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect
@@ -33,7 +33,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
index cdd5f42..ec3999b 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
@@ -3,13 +3,11 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
-//  - 'FutureOr' is from 'dart:async'.
 // Try correcting the operator to an existing operator, or defining a '+' operator.
 //                           /*@ type=int* */ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
 //                                                                                                                           ^
 //
 // pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'.
-//  - 'FutureOr' is from 'dart:async'.
 //                   /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@ returnType=String* */ (String
 //                                                                                                               ^
 //
@@ -24,15 +22,13 @@
 static method test() → dynamic {
   core::Iterable<asy::Future<core::int*>*>* list = <core::int*>[1, 2, 3].{core::Iterable::map}<asy::Future<core::int*>*>(#C1);
   asy::Future<core::List<core::int*>*>* results = asy::Future::wait<core::int*>(list);
-  asy::Future<core::String*>* results2 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → asy::FutureOr<core::String*>* => list.{core::Iterable::fold}<asy::FutureOr<core::String*>*>("", (asy::FutureOr<core::String*>* x, core::int* y) → asy::FutureOr<core::String*>* => invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
- - 'FutureOr' is from 'dart:async'.
+  asy::Future<core::String*>* results2 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → FutureOr<core::String*>* => list.{core::Iterable::fold}<FutureOr<core::String*>*>("", (FutureOr<core::String*>* x, core::int* y) → FutureOr<core::String*>* => invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
 Try correcting the operator to an existing operator, or defining a '+' operator.
                           /*@ type=int* */ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
-                                                                                                                          ^" as{TypeError,ForDynamic} asy::FutureOr<core::String*>*));
-  asy::Future<core::String*>* results3 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → asy::FutureOr<core::String*>* => list.{core::Iterable::fold}<asy::FutureOr<core::String*>*>("", let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'.
- - 'FutureOr' is from 'dart:async'.
+                                                                                                                          ^" as{TypeError,ForDynamic} FutureOr<core::String*>*));
+  asy::Future<core::String*>* results3 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → FutureOr<core::String*>* => list.{core::Iterable::fold}<FutureOr<core::String*>*>("", let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'.
                   /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@ returnType=String* */ (String
-                                                                                                              ^" in ((core::String* x, core::int* y) → core::String* => x.{core::String::+}(y.{core::int::toString}())) as{TypeError} (asy::FutureOr<core::String*>*, core::int*) → asy::FutureOr<core::String*>*));
+                                                                                                              ^" in ((core::String* x, core::int* y) → core::String* => x.{core::String::+}(y.{core::int::toString}())) as{TypeError} (FutureOr<core::String*>*, core::int*) → FutureOr<core::String*>*));
   asy::Future<core::String*>* results4 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → core::String* => list.{core::Iterable::fold}<core::String*>("", (core::String* x, core::int* y) → core::String* => x.{core::String::+}(y.{core::int::toString}())));
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect
index e4d612d..9864c5c 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect
@@ -3,13 +3,11 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
-//  - 'FutureOr' is from 'dart:async'.
 // Try correcting the operator to an existing operator, or defining a '+' operator.
 //                           /*@ type=int* */ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
 //                                                                                                                           ^
 //
 // pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'.
-//  - 'FutureOr' is from 'dart:async'.
 //                   /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@ returnType=String* */ (String
 //                                                                                                               ^
 //
@@ -24,15 +22,13 @@
 static method test() → dynamic {
   core::Iterable<asy::Future<core::int*>*>* list = <core::int*>[1, 2, 3].{core::Iterable::map}<asy::Future<core::int*>*>(#C1);
   asy::Future<core::List<core::int*>*>* results = asy::Future::wait<core::int*>(list);
-  asy::Future<core::String*>* results2 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → asy::FutureOr<core::String*>* => list.{core::Iterable::fold}<asy::FutureOr<core::String*>*>("", (asy::FutureOr<core::String*>* x, core::int* y) → asy::FutureOr<core::String*>* => invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
- - 'FutureOr' is from 'dart:async'.
+  asy::Future<core::String*>* results2 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → FutureOr<core::String*>* => list.{core::Iterable::fold}<FutureOr<core::String*>*>("", (FutureOr<core::String*>* x, core::int* y) → FutureOr<core::String*>* => invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
 Try correcting the operator to an existing operator, or defining a '+' operator.
                           /*@ type=int* */ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
                                                                                                                           ^"));
-  asy::Future<core::String*>* results3 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → asy::FutureOr<core::String*>* => list.{core::Iterable::fold}<asy::FutureOr<core::String*>*>("", let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'.
- - 'FutureOr' is from 'dart:async'.
+  asy::Future<core::String*>* results3 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → FutureOr<core::String*>* => list.{core::Iterable::fold}<FutureOr<core::String*>*>("", let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'.
                   /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@ returnType=String* */ (String
-                                                                                                              ^" in ((core::String* x, core::int* y) → core::String* => x.{core::String::+}(y.{core::int::toString}())) as{TypeError} (asy::FutureOr<core::String*>*, core::int*) → asy::FutureOr<core::String*>*));
+                                                                                                              ^" in ((core::String* x, core::int* y) → core::String* => x.{core::String::+}(y.{core::int::toString}())) as{TypeError} (FutureOr<core::String*>*, core::int*) → FutureOr<core::String*>*));
   asy::Future<core::String*>* results4 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) → core::String* => list.{core::Iterable::fold}<core::String*>("", (core::String* x, core::int* y) → core::String* => x.{core::String::+}(y.{core::int::toString}())));
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect
index 86f1078..0a2e77a 100644
--- a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
     return 42;
   function f1() → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -38,7 +38,7 @@
   }
   function f3() → asy::Future<core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::int*>();
-    asy::FutureOr<core::int*>* :return_value;
+    FutureOr<core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect
index a35b11a..86ed9fd 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect
@@ -60,7 +60,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError, () →* void onDone, core::bool* cancelOnError}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect
index 14c4b10..52aef63 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect
@@ -103,7 +103,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError = #C1, () →* void onDone = #C1, core::bool* cancelOnError = #C1}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test = #C1}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect
index f57d8a3..cc617d0 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect
@@ -57,7 +57,7 @@
     ;
   method foo(generic-covariant-impl self::Bar::T* t) → dynamic /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -127,7 +127,7 @@
     ;
   method foo(generic-covariant-impl self::Baz::S* t) → dynamic /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -200,7 +200,7 @@
   abstract member-signature method listen((self::MyStream::T*) →* void onData, {core::Function* onError = #C1, () →* void onDone = #C1, core::bool* cancelOnError = #C1}) → asy::StreamSubscription<self::MyStream::T*>*;
   abstract member-signature method where((self::MyStream::T*) →* core::bool* test) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method map<S extends core::Object* = dynamic>((self::MyStream::T*) →* self::MyStream::map::S* convert) → asy::Stream<self::MyStream::map::S*>*;
-  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
+  abstract member-signature method asyncMap<E extends core::Object* = dynamic>((self::MyStream::T*) →* FutureOr<self::MyStream::asyncMap::E*>* convert) → asy::Stream<self::MyStream::asyncMap::E*>*;
   abstract member-signature method asyncExpand<E extends core::Object* = dynamic>((self::MyStream::T*) →* asy::Stream<self::MyStream::asyncExpand::E*>* convert) → asy::Stream<self::MyStream::asyncExpand::E*>*;
   abstract member-signature method handleError(core::Function* onError, {(dynamic) →* core::bool* test = #C1}) → asy::Stream<self::MyStream::T*>*;
   abstract member-signature method expand<S extends core::Object* = dynamic>((self::MyStream::T*) →* core::Iterable<self::MyStream::expand::S*>* convert) → asy::Stream<self::MyStream::expand::S*>*;
@@ -245,7 +245,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect
index 62c551c..892d477 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect
@@ -4,7 +4,6 @@
 //
 // pkg/front_end/testcases/inference/local_return_and_yield.dart:19:38: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //     return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
 //                                      ^
 //
@@ -22,9 +21,8 @@
   function b() → asy::Future<(core::int*) →* core::int*>* async {
     return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/local_return_and_yield.dart:19:38: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
     return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
-                                     ^" in ((dynamic x) → dynamic => x) as{TypeError} asy::FutureOr<(core::int*) →* core::int*>*;
+                                     ^" in ((dynamic x) → dynamic => x) as{TypeError} FutureOr<(core::int*) →* core::int*>*;
   }
   function c() → core::Iterable<(core::int*) →* core::int*>* sync* {
     yield(core::int* x) → core::int* => x;
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
index a58b854..0bbb7a1 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
@@ -4,7 +4,6 @@
 //
 // pkg/front_end/testcases/inference/local_return_and_yield.dart:19:38: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //     return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
 //                                      ^
 //
@@ -21,7 +20,7 @@
   }
   function b() → asy::Future<(core::int*) →* core::int*>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<(core::int*) →* core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<(core::int*) →* core::int*>();
-    asy::FutureOr<(core::int*) →* core::int*>* :return_value;
+    FutureOr<(core::int*) →* core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -33,9 +32,8 @@
         {
           :return_value = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/local_return_and_yield.dart:19:38: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
     return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
-                                     ^" in ((dynamic x) → dynamic => x) as{TypeError} asy::FutureOr<(core::int*) →* core::int*>*;
+                                     ^" in ((dynamic x) → dynamic => x) as{TypeError} FutureOr<(core::int*) →* core::int*>*;
           break #L1;
         }
         asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect
index 143acd8..6b3c264 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect
@@ -8,9 +8,9 @@
     : super core::Object::•()
     ;
   method op(core::double* b) → void {
-    core::double* r1 = this.{self::C::a}.{core::num::+}(b) as{TypeError} core::double*;
-    core::double* r2 = this.{self::C::a}.{core::num::-}(b) as{TypeError} core::double*;
-    core::double* r3 = this.{self::C::a}.{core::num::*}(b) as{TypeError} core::double*;
+    core::double* r1 = this.{self::C::a}.{core::num::+}(b);
+    core::double* r2 = this.{self::C::a}.{core::num::-}(b);
+    core::double* r3 = this.{self::C::a}.{core::num::*}(b);
     core::double* r4 = this.{self::C::a}.{core::num::/}(b);
   }
   abstract member-signature get _identityHashCode() → core::int*;
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect
index 3dfcba9..470be38 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect
@@ -8,14 +8,14 @@
     : super core::Object::•()
     ;
   method op(generic-covariant-impl self::C::T* b) → void {
-    self::C::T* r1 = this.{self::C::a}.{core::num::+}(b);
-    self::C::T* r2 = this.{self::C::a}.{core::num::-}(b);
-    self::C::T* r3 = this.{self::C::a}.{core::num::*}(b);
+    self::C::T* r1 = this.{self::C::a}.{core::num::+}(b) as{TypeError} self::C::T*;
+    self::C::T* r2 = this.{self::C::a}.{core::num::-}(b) as{TypeError} self::C::T*;
+    self::C::T* r3 = this.{self::C::a}.{core::num::*}(b) as{TypeError} self::C::T*;
   }
   method opEq(generic-covariant-impl self::C::T* b) → void {
-    this.{self::C::a} = this.{self::C::a}.{core::num::+}(b);
-    this.{self::C::a} = this.{self::C::a}.{core::num::-}(b);
-    this.{self::C::a} = this.{self::C::a}.{core::num::*}(b);
+    this.{self::C::a} = this.{self::C::a}.{core::num::+}(b) as{TypeError} self::C::T*;
+    this.{self::C::a} = this.{self::C::a}.{core::num::-}(b) as{TypeError} self::C::T*;
+    this.{self::C::a} = this.{self::C::a}.{core::num::*}(b) as{TypeError} self::C::T*;
   }
   abstract member-signature get _identityHashCode() → core::int*;
   abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*;
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
index dc1653d..5cb4fa2 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
@@ -4,7 +4,6 @@
 //
 // pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:36: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
 //                                    ^
 //
@@ -21,9 +20,8 @@
 static method b() → asy::Future<(core::int*) →* core::int*>* async {
   return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:36: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
-                                   ^" in ((dynamic x) → dynamic => x) as{TypeError} asy::FutureOr<(core::int*) →* core::int*>*;
+                                   ^" in ((dynamic x) → dynamic => x) as{TypeError} FutureOr<(core::int*) →* core::int*>*;
 }
 static method c() → core::Iterable<(core::int*) →* core::int*>* sync* {
   yield(core::int* x) → core::int* => x;
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
index c6c16e4..816f890 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
@@ -4,7 +4,6 @@
 //
 // pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:36: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
 //                                    ^
 //
@@ -20,7 +19,7 @@
 }
 static method b() → asy::Future<(core::int*) →* core::int*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<(core::int*) →* core::int*>* :async_completer = new asy::_AsyncAwaitCompleter::•<(core::int*) →* core::int*>();
-  asy::FutureOr<(core::int*) →* core::int*>* :return_value;
+  FutureOr<(core::int*) →* core::int*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -32,9 +31,8 @@
       {
         :return_value = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:36: Error: A value of type 'Future<dynamic Function(dynamic)>' can't be assigned to a variable of type 'FutureOr<int Function(int)>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   return /*@ returnType=dynamic */ (/*@ type=dynamic */ x) => x;
-                                   ^" in ((dynamic x) → dynamic => x) as{TypeError} asy::FutureOr<(core::int*) →* core::int*>*;
+                                   ^" in ((dynamic x) → dynamic => x) as{TypeError} FutureOr<(core::int*) →* core::int*>*;
         break #L1;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
diff --git a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
index b2e5cd6..2941922 100644
--- a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
@@ -29,7 +29,7 @@
 
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect
index ea7b0cb..927baff 100644
--- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect
@@ -45,7 +45,7 @@
   return null;
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.expect
index 0f62abd..b69e0ea 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.expect
@@ -61,7 +61,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -85,10 +84,10 @@
       return local4 = #t3;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     if(local6.==(null))
       return local6 = #t5;
     else
@@ -126,10 +125,10 @@
       return local4 = #t11;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t13) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t13) → dynamic
     if(local6.==(null))
       return local6 = #t13;
     else
@@ -186,10 +185,10 @@
       return local4 = #t22;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t24) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t24) → dynamic
     if(local6.==(null))
       return local6 = #t24;
     else
@@ -227,10 +226,10 @@
       return local4 = #t30;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t32) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t32) → dynamic
     if(local6.==(null))
       return local6 = #t32;
     else
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.transformed.expect
index 0f62abd..b69e0ea 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.strong.transformed.expect
@@ -61,7 +61,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -85,10 +84,10 @@
       return local4 = #t3;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     if(local6.==(null))
       return local6 = #t5;
     else
@@ -126,10 +125,10 @@
       return local4 = #t11;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t13) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t13) → dynamic
     if(local6.==(null))
       return local6 = #t13;
     else
@@ -186,10 +185,10 @@
       return local4 = #t22;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t24) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t24) → dynamic
     if(local6.==(null))
       return local6 = #t24;
     else
@@ -227,10 +226,10 @@
       return local4 = #t30;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t32) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t32) → dynamic
     if(local6.==(null))
       return local6 = #t32;
     else
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect
index 0f62abd..b69e0ea 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect
@@ -61,7 +61,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -85,10 +84,10 @@
       return local4 = #t3;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     if(local6.==(null))
       return local6 = #t5;
     else
@@ -126,10 +125,10 @@
       return local4 = #t11;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t13) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t13) → dynamic
     if(local6.==(null))
       return local6 = #t13;
     else
@@ -186,10 +185,10 @@
       return local4 = #t22;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t24) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t24) → dynamic
     if(local6.==(null))
       return local6 = #t24;
     else
@@ -227,10 +226,10 @@
       return local4 = #t30;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t32) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t32) → dynamic
     if(local6.==(null))
       return local6 = #t32;
     else
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect
index 0f62abd..b69e0ea 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect
@@ -61,7 +61,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -85,10 +84,10 @@
       return local4 = #t3;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     if(local6.==(null))
       return local6 = #t5;
     else
@@ -126,10 +125,10 @@
       return local4 = #t11;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t13) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t13) → dynamic
     if(local6.==(null))
       return local6 = #t13;
     else
@@ -186,10 +185,10 @@
       return local4 = #t22;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t24) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t24) → dynamic
     if(local6.==(null))
       return local6 = #t24;
     else
@@ -227,10 +226,10 @@
       return local4 = #t30;
     else
       throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
-  final asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t32) → dynamic
+  final FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t32) → dynamic
     if(local6.==(null))
       return local6 = #t32;
     else
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.expect
index 7594fd4..94edad5 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.expect
@@ -93,7 +93,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -113,11 +112,11 @@
     return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
   function #local4#set(core::int #t3) → dynamic
     return local4 = #t3;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     return local6 = #t5;
   T? local7;
   core::bool #local7#isSet = false;
@@ -168,11 +167,11 @@
     return let final core::int? #t14 = local4 in #t14.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t14{core::int};
   function #local4#set(core::int #t15) → dynamic
     return local4 = #t15;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t17) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t17) → dynamic
     return local6 = #t17;
   T? local7;
   core::bool #local7#isSet = false;
@@ -240,11 +239,11 @@
     return let final core::int? #t27 = local4 in #t27.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t27{core::int};
   function #local4#set(core::int #t28) → dynamic
     return local4 = #t28;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t30) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t30) → dynamic
     return local6 = #t30;
   self::methodDirect::T? local7;
   core::bool #local7#isSet = false;
@@ -295,11 +294,11 @@
     return let final core::int? #t39 = local4 in #t39.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t39{core::int};
   function #local4#set(core::int #t40) → dynamic
     return local4 = #t40;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t42) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t42) → dynamic
     return local6 = #t42;
   self::methodConditional::T? local7;
   core::bool #local7#isSet = false;
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.transformed.expect
index 7594fd4..94edad5 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.strong.transformed.expect
@@ -93,7 +93,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -113,11 +112,11 @@
     return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
   function #local4#set(core::int #t3) → dynamic
     return local4 = #t3;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     return local6 = #t5;
   T? local7;
   core::bool #local7#isSet = false;
@@ -168,11 +167,11 @@
     return let final core::int? #t14 = local4 in #t14.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t14{core::int};
   function #local4#set(core::int #t15) → dynamic
     return local4 = #t15;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t17) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t17) → dynamic
     return local6 = #t17;
   T? local7;
   core::bool #local7#isSet = false;
@@ -240,11 +239,11 @@
     return let final core::int? #t27 = local4 in #t27.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t27{core::int};
   function #local4#set(core::int #t28) → dynamic
     return local4 = #t28;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t30) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t30) → dynamic
     return local6 = #t30;
   self::methodDirect::T? local7;
   core::bool #local7#isSet = false;
@@ -295,11 +294,11 @@
     return let final core::int? #t39 = local4 in #t39.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t39{core::int};
   function #local4#set(core::int #t40) → dynamic
     return local4 = #t40;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t42) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t42) → dynamic
     return local6 = #t42;
   self::methodConditional::T? local7;
   core::bool #local7#isSet = false;
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect
index 7594fd4..94edad5 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect
@@ -93,7 +93,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -113,11 +112,11 @@
     return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
   function #local4#set(core::int #t3) → dynamic
     return local4 = #t3;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     return local6 = #t5;
   T? local7;
   core::bool #local7#isSet = false;
@@ -168,11 +167,11 @@
     return let final core::int? #t14 = local4 in #t14.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t14{core::int};
   function #local4#set(core::int #t15) → dynamic
     return local4 = #t15;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t17) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t17) → dynamic
     return local6 = #t17;
   T? local7;
   core::bool #local7#isSet = false;
@@ -240,11 +239,11 @@
     return let final core::int? #t27 = local4 in #t27.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t27{core::int};
   function #local4#set(core::int #t28) → dynamic
     return local4 = #t28;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t30) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t30) → dynamic
     return local6 = #t30;
   self::methodDirect::T? local7;
   core::bool #local7#isSet = false;
@@ -295,11 +294,11 @@
     return let final core::int? #t39 = local4 in #t39.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t39{core::int};
   function #local4#set(core::int #t40) → dynamic
     return local4 = #t40;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t42) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t42) → dynamic
     return local6 = #t42;
   self::methodConditional::T? local7;
   core::bool #local7#isSet = false;
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect
index 7594fd4..94edad5 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect
@@ -93,7 +93,6 @@
 import self as self;
 import "dart:core" as core;
 import "dart:_internal" as _in;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -113,11 +112,11 @@
     return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
   function #local4#set(core::int #t3) → dynamic
     return local4 = #t3;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t5) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t5) → dynamic
     return local6 = #t5;
   T? local7;
   core::bool #local7#isSet = false;
@@ -168,11 +167,11 @@
     return let final core::int? #t14 = local4 in #t14.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t14{core::int};
   function #local4#set(core::int #t15) → dynamic
     return local4 = #t15;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t17) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t17) → dynamic
     return local6 = #t17;
   T? local7;
   core::bool #local7#isSet = false;
@@ -240,11 +239,11 @@
     return let final core::int? #t27 = local4 in #t27.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t27{core::int};
   function #local4#set(core::int #t28) → dynamic
     return local4 = #t28;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t30) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t30) → dynamic
     return local6 = #t30;
   self::methodDirect::T? local7;
   core::bool #local7#isSet = false;
@@ -295,11 +294,11 @@
     return let final core::int? #t39 = local4 in #t39.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t39{core::int};
   function #local4#set(core::int #t40) → dynamic
     return local4 = #t40;
-  asy::FutureOr<core::int> local5;
-  asy::FutureOr<core::int>? local6;
-  function #local6#get() → asy::FutureOr<core::int>
-    return let final asy::FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{asy::FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{asy::FutureOr<core::int>};
-  function #local6#set(asy::FutureOr<core::int> #t42) → dynamic
+  FutureOr<core::int>local5;
+  FutureOr<core::int>? local6;
+  function #local6#get() → FutureOr<core::int>
+    return let final FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{FutureOr<core::int>};
+  function #local6#set(FutureOr<core::int>#t42) → dynamic
     return local6 = #t42;
   self::methodConditional::T? local7;
   core::bool #local7#isSet = false;
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.outline.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.outline.expect
index 0cc888e..ac02afe 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.outline.expect
@@ -1,71 +1,70 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class C<T extends core::Object? = dynamic> extends core::Object {
-  field asy::FutureOr<dynamic>? _#C#field1;
+  field FutureOr<dynamic>? _#C#field1;
   field core::bool _#C#field1#isSet;
-  field asy::FutureOr<dynamic>? _#C#field2;
+  field FutureOr<dynamic>? _#C#field2;
   field core::bool _#C#field2#isSet;
-  generic-covariant-impl field asy::FutureOr<self::C::T%>? _#C#field3;
+  generic-covariant-impl field FutureOr<self::C::T%>? _#C#field3;
   field core::bool _#C#field3#isSet;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field4;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field4;
   field core::bool _#C#field4#isSet;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field5;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field5;
   field core::bool _#C#field5#isSet;
   synthetic constructor •() → self::C<self::C::T%>
     ;
-  get field1() → asy::FutureOr<dynamic>;
-  set field1(asy::FutureOr<dynamic> #t1) → void;
-  get field2() → asy::FutureOr<dynamic>?;
-  set field2(asy::FutureOr<dynamic>? #t2) → void;
-  get field3() → asy::FutureOr<self::C::T%>;
-  set field3(asy::FutureOr<self::C::T%> #t3) → void;
-  get field4() → asy::FutureOr<self::C::T?>;
-  set field4(asy::FutureOr<self::C::T?> #t4) → void;
-  get field5() → asy::FutureOr<self::C::T?>?;
-  set field5(asy::FutureOr<self::C::T?>? #t5) → void;
+  get field1() → FutureOr<dynamic>;
+  set field1(FutureOr<dynamic>#t1) → void;
+  get field2() → FutureOr<dynamic>?;
+  set field2(FutureOr<dynamic>? #t2) → void;
+  get field3() → FutureOr<self::C::T%>;
+  set field3(FutureOr<self::C::T%>#t3) → void;
+  get field4() → FutureOr<self::C::T?>;
+  set field4(FutureOr<self::C::T?>#t4) → void;
+  get field5() → FutureOr<self::C::T?>?;
+  set field5(FutureOr<self::C::T?>? #t5) → void;
   method method() → dynamic
     ;
 }
-static field asy::FutureOr<dynamic>? _#field1;
+static field FutureOr<dynamic>? _#field1;
 static field core::bool _#field1#isSet;
-static field asy::FutureOr<dynamic>? _#field2;
+static field FutureOr<dynamic>? _#field2;
 static field core::bool _#field2#isSet;
-static field asy::FutureOr<dynamic>? _#field3;
+static field FutureOr<dynamic>? _#field3;
 static field core::bool _#field3#isSet;
-static field asy::FutureOr<core::int>? _#field4;
+static field FutureOr<core::int>? _#field4;
 static field core::bool _#field4#isSet;
-static field asy::FutureOr<core::int?>? _#field5;
+static field FutureOr<core::int?>? _#field5;
 static field core::bool _#field5#isSet;
-static field asy::FutureOr<core::int?>? _#field6;
+static field FutureOr<core::int?>? _#field6;
 static field core::bool _#field6#isSet;
-static method method1() → asy::FutureOr<dynamic>
+static method method1() → FutureOr<dynamic>
   ;
-static method method2() → asy::FutureOr<dynamic>?
+static method method2() → FutureOr<dynamic>?
   ;
-static method method3() → asy::FutureOr<dynamic>
+static method method3() → FutureOr<dynamic>
   ;
-static method method4() → asy::FutureOr<core::int>
+static method method4() → FutureOr<core::int>
   ;
-static method method5() → asy::FutureOr<core::int?>
+static method method5() → FutureOr<core::int?>
   ;
-static method method6() → asy::FutureOr<core::int?>?
+static method method6() → FutureOr<core::int?>?
   ;
-static get field1() → asy::FutureOr<dynamic>;
-static set field1(asy::FutureOr<dynamic> #t6) → void;
-static get field2() → asy::FutureOr<dynamic>?;
-static set field2(asy::FutureOr<dynamic>? #t7) → void;
-static get field3() → asy::FutureOr<dynamic>;
-static set field3(asy::FutureOr<dynamic> #t8) → void;
-static get field4() → asy::FutureOr<core::int>;
-static set field4(asy::FutureOr<core::int> #t9) → void;
-static get field5() → asy::FutureOr<core::int?>;
-static set field5(asy::FutureOr<core::int?> #t10) → void;
-static get field6() → asy::FutureOr<core::int?>?;
-static set field6(asy::FutureOr<core::int?>? #t11) → void;
+static get field1() → FutureOr<dynamic>;
+static set field1(FutureOr<dynamic>#t6) → void;
+static get field2() → FutureOr<dynamic>?;
+static set field2(FutureOr<dynamic>? #t7) → void;
+static get field3() → FutureOr<dynamic>;
+static set field3(FutureOr<dynamic>#t8) → void;
+static get field4() → FutureOr<core::int>;
+static set field4(FutureOr<core::int>#t9) → void;
+static get field5() → FutureOr<core::int?>;
+static set field5(FutureOr<core::int?>#t10) → void;
+static get field6() → FutureOr<core::int?>?;
+static set field6(FutureOr<core::int?>? #t11) → void;
 static method main() → dynamic
   ;
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.expect
index e3a3c24..c8d8ea6 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.expect
@@ -1,178 +1,177 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 import "dart:_internal" as _in;
 
 import "dart:async";
 
 class C<T extends core::Object? = dynamic> extends core::Object {
-  field asy::FutureOr<dynamic>? _#C#field1 = null;
+  field FutureOr<dynamic>? _#C#field1 = null;
   field core::bool _#C#field1#isSet = false;
-  field asy::FutureOr<dynamic>? _#C#field2 = null;
+  field FutureOr<dynamic>? _#C#field2 = null;
   field core::bool _#C#field2#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T%>? _#C#field3 = null;
+  generic-covariant-impl field FutureOr<self::C::T%>? _#C#field3 = null;
   field core::bool _#C#field3#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field4 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field4 = null;
   field core::bool _#C#field4#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field5 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field5 = null;
   field core::bool _#C#field5#isSet = false;
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  get field1() → asy::FutureOr<dynamic>
-    return this.{self::C::_#C#field1#isSet} ?{asy::FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
-  set field1(asy::FutureOr<dynamic> #t1) → void {
+  get field1() → FutureOr<dynamic>
+    return this.{self::C::_#C#field1#isSet} ?{FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
+  set field1(FutureOr<dynamic>#t1) → void {
     this.{self::C::_#C#field1#isSet} = true;
     this.{self::C::_#C#field1} = #t1;
   }
-  get field2() → asy::FutureOr<dynamic>?
-    return this.{self::C::_#C#field2#isSet} ?{asy::FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
-  set field2(asy::FutureOr<dynamic>? #t2) → void {
+  get field2() → FutureOr<dynamic>?
+    return this.{self::C::_#C#field2#isSet} ?{FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
+  set field2(FutureOr<dynamic>? #t2) → void {
     this.{self::C::_#C#field2#isSet} = true;
     this.{self::C::_#C#field2} = #t2;
   }
-  get field3() → asy::FutureOr<self::C::T%>
-    return this.{self::C::_#C#field3#isSet} ?{asy::FutureOr<self::C::T%>} let final asy::FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
-  set field3(asy::FutureOr<self::C::T%> #t4) → void {
+  get field3() → FutureOr<self::C::T%>
+    return this.{self::C::_#C#field3#isSet} ?{FutureOr<self::C::T%>} let final FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
+  set field3(FutureOr<self::C::T%>#t4) → void {
     this.{self::C::_#C#field3#isSet} = true;
     this.{self::C::_#C#field3} = #t4;
   }
-  get field4() → asy::FutureOr<self::C::T?>
-    return this.{self::C::_#C#field4#isSet} ?{asy::FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
-  set field4(asy::FutureOr<self::C::T?> #t5) → void {
+  get field4() → FutureOr<self::C::T?>
+    return this.{self::C::_#C#field4#isSet} ?{FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
+  set field4(FutureOr<self::C::T?>#t5) → void {
     this.{self::C::_#C#field4#isSet} = true;
     this.{self::C::_#C#field4} = #t5;
   }
-  get field5() → asy::FutureOr<self::C::T?>?
-    return this.{self::C::_#C#field5#isSet} ?{asy::FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
-  set field5(asy::FutureOr<self::C::T?>? #t6) → void {
+  get field5() → FutureOr<self::C::T?>?
+    return this.{self::C::_#C#field5#isSet} ?{FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
+  set field5(FutureOr<self::C::T?>? #t6) → void {
     this.{self::C::_#C#field5#isSet} = true;
     this.{self::C::_#C#field5} = #t6;
   }
   method method() → dynamic {
-    asy::FutureOr<dynamic>? local1;
+    FutureOr<dynamic>? local1;
     core::bool #local1#isSet = false;
-    function #local1#get() → asy::FutureOr<dynamic>
-      return #local1#isSet ?{asy::FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
-    function #local1#set(asy::FutureOr<dynamic> #t7) → dynamic {
+    function #local1#get() → FutureOr<dynamic>
+      return #local1#isSet ?{FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
+    function #local1#set(FutureOr<dynamic>#t7) → dynamic {
       #local1#isSet = true;
       return local1 = #t7;
     }
-    asy::FutureOr<dynamic>? local2;
+    FutureOr<dynamic>? local2;
     core::bool #local2#isSet = false;
-    function #local2#get() → asy::FutureOr<dynamic>?
-      return #local2#isSet ?{asy::FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
-    function #local2#set(asy::FutureOr<dynamic>? #t8) → dynamic {
+    function #local2#get() → FutureOr<dynamic>?
+      return #local2#isSet ?{FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
+    function #local2#set(FutureOr<dynamic>? #t8) → dynamic {
       #local2#isSet = true;
       return local2 = #t8;
     }
-    asy::FutureOr<self::C::T%>? local3;
+    FutureOr<self::C::T%>? local3;
     core::bool #local3#isSet = false;
-    function #local3#get() → asy::FutureOr<self::C::T%>
-      return #local3#isSet ?{asy::FutureOr<self::C::T%>} local3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
-    function #local3#set(asy::FutureOr<self::C::T%> #t9) → dynamic {
+    function #local3#get() → FutureOr<self::C::T%>
+      return #local3#isSet ?{FutureOr<self::C::T%>} local3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
+    function #local3#set(FutureOr<self::C::T%>#t9) → dynamic {
       #local3#isSet = true;
       return local3 = #t9;
     }
-    asy::FutureOr<self::C::T?>? local4;
+    FutureOr<self::C::T?>? local4;
     core::bool #local4#isSet = false;
-    function #local4#get() → asy::FutureOr<self::C::T?>
-      return #local4#isSet ?{asy::FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
-    function #local4#set(asy::FutureOr<self::C::T?> #t10) → dynamic {
+    function #local4#get() → FutureOr<self::C::T?>
+      return #local4#isSet ?{FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
+    function #local4#set(FutureOr<self::C::T?>#t10) → dynamic {
       #local4#isSet = true;
       return local4 = #t10;
     }
-    asy::FutureOr<self::C::T?>? local5;
+    FutureOr<self::C::T?>? local5;
     core::bool #local5#isSet = false;
-    function #local5#get() → asy::FutureOr<self::C::T?>?
-      return #local5#isSet ?{asy::FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
-    function #local5#set(asy::FutureOr<self::C::T?>? #t11) → dynamic {
+    function #local5#get() → FutureOr<self::C::T?>?
+      return #local5#isSet ?{FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
+    function #local5#set(FutureOr<self::C::T?>? #t11) → dynamic {
       #local5#isSet = true;
       return local5 = #t11;
     }
   }
 }
-static field asy::FutureOr<dynamic>? _#field1 = null;
+static field FutureOr<dynamic>? _#field1 = null;
 static field core::bool _#field1#isSet = false;
-static field asy::FutureOr<dynamic>? _#field2 = null;
+static field FutureOr<dynamic>? _#field2 = null;
 static field core::bool _#field2#isSet = false;
-static field asy::FutureOr<dynamic>? _#field3 = null;
+static field FutureOr<dynamic>? _#field3 = null;
 static field core::bool _#field3#isSet = false;
-static field asy::FutureOr<core::int>? _#field4 = null;
+static field FutureOr<core::int>? _#field4 = null;
 static field core::bool _#field4#isSet = false;
-static field asy::FutureOr<core::int?>? _#field5 = null;
+static field FutureOr<core::int?>? _#field5 = null;
 static field core::bool _#field5#isSet = false;
-static field asy::FutureOr<core::int?>? _#field6 = null;
+static field FutureOr<core::int?>? _#field6 = null;
 static field core::bool _#field6#isSet = false;
-static method method1() → asy::FutureOr<dynamic>
+static method method1() → FutureOr<dynamic>
   return null;
-static method method2() → asy::FutureOr<dynamic>?
+static method method2() → FutureOr<dynamic>?
   return null;
-static method method3() → asy::FutureOr<dynamic>
+static method method3() → FutureOr<dynamic>
   return null;
-static method method4() → asy::FutureOr<core::int>
+static method method4() → FutureOr<core::int>
   return 0;
-static method method5() → asy::FutureOr<core::int?>
+static method method5() → FutureOr<core::int?>
   return null;
-static method method6() → asy::FutureOr<core::int?>?
+static method method6() → FutureOr<core::int?>?
   return null;
-static get field1() → asy::FutureOr<dynamic> {
+static get field1() → FutureOr<dynamic> {
   if(!self::_#field1#isSet) {
     self::_#field1 = self::method1();
     self::_#field1#isSet = true;
   }
   return self::_#field1;
 }
-static set field1(asy::FutureOr<dynamic> #t12) → void {
+static set field1(FutureOr<dynamic>#t12) → void {
   self::_#field1#isSet = true;
   self::_#field1 = #t12;
 }
-static get field2() → asy::FutureOr<dynamic>? {
+static get field2() → FutureOr<dynamic>? {
   if(!self::_#field2#isSet) {
     self::_#field2 = self::method2();
     self::_#field2#isSet = true;
   }
   return self::_#field2;
 }
-static set field2(asy::FutureOr<dynamic>? #t13) → void {
+static set field2(FutureOr<dynamic>? #t13) → void {
   self::_#field2#isSet = true;
   self::_#field2 = #t13;
 }
-static get field3() → asy::FutureOr<dynamic> {
+static get field3() → FutureOr<dynamic> {
   if(!self::_#field3#isSet) {
     self::_#field3 = self::method3();
     self::_#field3#isSet = true;
   }
   return self::_#field3;
 }
-static set field3(asy::FutureOr<dynamic> #t14) → void {
+static set field3(FutureOr<dynamic>#t14) → void {
   self::_#field3#isSet = true;
   self::_#field3 = #t14;
 }
-static get field4() → asy::FutureOr<core::int>
-  return let final asy::FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{asy::FutureOr<core::int>} self::_#field4 = self::method4() : #t15{asy::FutureOr<core::int>};
-static set field4(asy::FutureOr<core::int> #t16) → void
+static get field4() → FutureOr<core::int>
+  return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{FutureOr<core::int>} self::_#field4 = self::method4() : #t15{FutureOr<core::int>};
+static set field4(FutureOr<core::int>#t16) → void
   self::_#field4 = #t16;
-static get field5() → asy::FutureOr<core::int?> {
+static get field5() → FutureOr<core::int?> {
   if(!self::_#field5#isSet) {
     self::_#field5 = self::method5();
     self::_#field5#isSet = true;
   }
   return self::_#field5;
 }
-static set field5(asy::FutureOr<core::int?> #t17) → void {
+static set field5(FutureOr<core::int?>#t17) → void {
   self::_#field5#isSet = true;
   self::_#field5 = #t17;
 }
-static get field6() → asy::FutureOr<core::int?>? {
+static get field6() → FutureOr<core::int?>? {
   if(!self::_#field6#isSet) {
     self::_#field6 = self::method6();
     self::_#field6#isSet = true;
   }
   return self::_#field6;
 }
-static set field6(asy::FutureOr<core::int?>? #t18) → void {
+static set field6(FutureOr<core::int?>? #t18) → void {
   self::_#field6#isSet = true;
   self::_#field6 = #t18;
 }
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.transformed.expect
index e3a3c24..c8d8ea6 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.strong.transformed.expect
@@ -1,178 +1,177 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 import "dart:_internal" as _in;
 
 import "dart:async";
 
 class C<T extends core::Object? = dynamic> extends core::Object {
-  field asy::FutureOr<dynamic>? _#C#field1 = null;
+  field FutureOr<dynamic>? _#C#field1 = null;
   field core::bool _#C#field1#isSet = false;
-  field asy::FutureOr<dynamic>? _#C#field2 = null;
+  field FutureOr<dynamic>? _#C#field2 = null;
   field core::bool _#C#field2#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T%>? _#C#field3 = null;
+  generic-covariant-impl field FutureOr<self::C::T%>? _#C#field3 = null;
   field core::bool _#C#field3#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field4 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field4 = null;
   field core::bool _#C#field4#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field5 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field5 = null;
   field core::bool _#C#field5#isSet = false;
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  get field1() → asy::FutureOr<dynamic>
-    return this.{self::C::_#C#field1#isSet} ?{asy::FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
-  set field1(asy::FutureOr<dynamic> #t1) → void {
+  get field1() → FutureOr<dynamic>
+    return this.{self::C::_#C#field1#isSet} ?{FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
+  set field1(FutureOr<dynamic>#t1) → void {
     this.{self::C::_#C#field1#isSet} = true;
     this.{self::C::_#C#field1} = #t1;
   }
-  get field2() → asy::FutureOr<dynamic>?
-    return this.{self::C::_#C#field2#isSet} ?{asy::FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
-  set field2(asy::FutureOr<dynamic>? #t2) → void {
+  get field2() → FutureOr<dynamic>?
+    return this.{self::C::_#C#field2#isSet} ?{FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
+  set field2(FutureOr<dynamic>? #t2) → void {
     this.{self::C::_#C#field2#isSet} = true;
     this.{self::C::_#C#field2} = #t2;
   }
-  get field3() → asy::FutureOr<self::C::T%>
-    return this.{self::C::_#C#field3#isSet} ?{asy::FutureOr<self::C::T%>} let final asy::FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
-  set field3(asy::FutureOr<self::C::T%> #t4) → void {
+  get field3() → FutureOr<self::C::T%>
+    return this.{self::C::_#C#field3#isSet} ?{FutureOr<self::C::T%>} let final FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
+  set field3(FutureOr<self::C::T%>#t4) → void {
     this.{self::C::_#C#field3#isSet} = true;
     this.{self::C::_#C#field3} = #t4;
   }
-  get field4() → asy::FutureOr<self::C::T?>
-    return this.{self::C::_#C#field4#isSet} ?{asy::FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
-  set field4(asy::FutureOr<self::C::T?> #t5) → void {
+  get field4() → FutureOr<self::C::T?>
+    return this.{self::C::_#C#field4#isSet} ?{FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
+  set field4(FutureOr<self::C::T?>#t5) → void {
     this.{self::C::_#C#field4#isSet} = true;
     this.{self::C::_#C#field4} = #t5;
   }
-  get field5() → asy::FutureOr<self::C::T?>?
-    return this.{self::C::_#C#field5#isSet} ?{asy::FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
-  set field5(asy::FutureOr<self::C::T?>? #t6) → void {
+  get field5() → FutureOr<self::C::T?>?
+    return this.{self::C::_#C#field5#isSet} ?{FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
+  set field5(FutureOr<self::C::T?>? #t6) → void {
     this.{self::C::_#C#field5#isSet} = true;
     this.{self::C::_#C#field5} = #t6;
   }
   method method() → dynamic {
-    asy::FutureOr<dynamic>? local1;
+    FutureOr<dynamic>? local1;
     core::bool #local1#isSet = false;
-    function #local1#get() → asy::FutureOr<dynamic>
-      return #local1#isSet ?{asy::FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
-    function #local1#set(asy::FutureOr<dynamic> #t7) → dynamic {
+    function #local1#get() → FutureOr<dynamic>
+      return #local1#isSet ?{FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
+    function #local1#set(FutureOr<dynamic>#t7) → dynamic {
       #local1#isSet = true;
       return local1 = #t7;
     }
-    asy::FutureOr<dynamic>? local2;
+    FutureOr<dynamic>? local2;
     core::bool #local2#isSet = false;
-    function #local2#get() → asy::FutureOr<dynamic>?
-      return #local2#isSet ?{asy::FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
-    function #local2#set(asy::FutureOr<dynamic>? #t8) → dynamic {
+    function #local2#get() → FutureOr<dynamic>?
+      return #local2#isSet ?{FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
+    function #local2#set(FutureOr<dynamic>? #t8) → dynamic {
       #local2#isSet = true;
       return local2 = #t8;
     }
-    asy::FutureOr<self::C::T%>? local3;
+    FutureOr<self::C::T%>? local3;
     core::bool #local3#isSet = false;
-    function #local3#get() → asy::FutureOr<self::C::T%>
-      return #local3#isSet ?{asy::FutureOr<self::C::T%>} local3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
-    function #local3#set(asy::FutureOr<self::C::T%> #t9) → dynamic {
+    function #local3#get() → FutureOr<self::C::T%>
+      return #local3#isSet ?{FutureOr<self::C::T%>} local3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
+    function #local3#set(FutureOr<self::C::T%>#t9) → dynamic {
       #local3#isSet = true;
       return local3 = #t9;
     }
-    asy::FutureOr<self::C::T?>? local4;
+    FutureOr<self::C::T?>? local4;
     core::bool #local4#isSet = false;
-    function #local4#get() → asy::FutureOr<self::C::T?>
-      return #local4#isSet ?{asy::FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
-    function #local4#set(asy::FutureOr<self::C::T?> #t10) → dynamic {
+    function #local4#get() → FutureOr<self::C::T?>
+      return #local4#isSet ?{FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
+    function #local4#set(FutureOr<self::C::T?>#t10) → dynamic {
       #local4#isSet = true;
       return local4 = #t10;
     }
-    asy::FutureOr<self::C::T?>? local5;
+    FutureOr<self::C::T?>? local5;
     core::bool #local5#isSet = false;
-    function #local5#get() → asy::FutureOr<self::C::T?>?
-      return #local5#isSet ?{asy::FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
-    function #local5#set(asy::FutureOr<self::C::T?>? #t11) → dynamic {
+    function #local5#get() → FutureOr<self::C::T?>?
+      return #local5#isSet ?{FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
+    function #local5#set(FutureOr<self::C::T?>? #t11) → dynamic {
       #local5#isSet = true;
       return local5 = #t11;
     }
   }
 }
-static field asy::FutureOr<dynamic>? _#field1 = null;
+static field FutureOr<dynamic>? _#field1 = null;
 static field core::bool _#field1#isSet = false;
-static field asy::FutureOr<dynamic>? _#field2 = null;
+static field FutureOr<dynamic>? _#field2 = null;
 static field core::bool _#field2#isSet = false;
-static field asy::FutureOr<dynamic>? _#field3 = null;
+static field FutureOr<dynamic>? _#field3 = null;
 static field core::bool _#field3#isSet = false;
-static field asy::FutureOr<core::int>? _#field4 = null;
+static field FutureOr<core::int>? _#field4 = null;
 static field core::bool _#field4#isSet = false;
-static field asy::FutureOr<core::int?>? _#field5 = null;
+static field FutureOr<core::int?>? _#field5 = null;
 static field core::bool _#field5#isSet = false;
-static field asy::FutureOr<core::int?>? _#field6 = null;
+static field FutureOr<core::int?>? _#field6 = null;
 static field core::bool _#field6#isSet = false;
-static method method1() → asy::FutureOr<dynamic>
+static method method1() → FutureOr<dynamic>
   return null;
-static method method2() → asy::FutureOr<dynamic>?
+static method method2() → FutureOr<dynamic>?
   return null;
-static method method3() → asy::FutureOr<dynamic>
+static method method3() → FutureOr<dynamic>
   return null;
-static method method4() → asy::FutureOr<core::int>
+static method method4() → FutureOr<core::int>
   return 0;
-static method method5() → asy::FutureOr<core::int?>
+static method method5() → FutureOr<core::int?>
   return null;
-static method method6() → asy::FutureOr<core::int?>?
+static method method6() → FutureOr<core::int?>?
   return null;
-static get field1() → asy::FutureOr<dynamic> {
+static get field1() → FutureOr<dynamic> {
   if(!self::_#field1#isSet) {
     self::_#field1 = self::method1();
     self::_#field1#isSet = true;
   }
   return self::_#field1;
 }
-static set field1(asy::FutureOr<dynamic> #t12) → void {
+static set field1(FutureOr<dynamic>#t12) → void {
   self::_#field1#isSet = true;
   self::_#field1 = #t12;
 }
-static get field2() → asy::FutureOr<dynamic>? {
+static get field2() → FutureOr<dynamic>? {
   if(!self::_#field2#isSet) {
     self::_#field2 = self::method2();
     self::_#field2#isSet = true;
   }
   return self::_#field2;
 }
-static set field2(asy::FutureOr<dynamic>? #t13) → void {
+static set field2(FutureOr<dynamic>? #t13) → void {
   self::_#field2#isSet = true;
   self::_#field2 = #t13;
 }
-static get field3() → asy::FutureOr<dynamic> {
+static get field3() → FutureOr<dynamic> {
   if(!self::_#field3#isSet) {
     self::_#field3 = self::method3();
     self::_#field3#isSet = true;
   }
   return self::_#field3;
 }
-static set field3(asy::FutureOr<dynamic> #t14) → void {
+static set field3(FutureOr<dynamic>#t14) → void {
   self::_#field3#isSet = true;
   self::_#field3 = #t14;
 }
-static get field4() → asy::FutureOr<core::int>
-  return let final asy::FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{asy::FutureOr<core::int>} self::_#field4 = self::method4() : #t15{asy::FutureOr<core::int>};
-static set field4(asy::FutureOr<core::int> #t16) → void
+static get field4() → FutureOr<core::int>
+  return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{FutureOr<core::int>} self::_#field4 = self::method4() : #t15{FutureOr<core::int>};
+static set field4(FutureOr<core::int>#t16) → void
   self::_#field4 = #t16;
-static get field5() → asy::FutureOr<core::int?> {
+static get field5() → FutureOr<core::int?> {
   if(!self::_#field5#isSet) {
     self::_#field5 = self::method5();
     self::_#field5#isSet = true;
   }
   return self::_#field5;
 }
-static set field5(asy::FutureOr<core::int?> #t17) → void {
+static set field5(FutureOr<core::int?>#t17) → void {
   self::_#field5#isSet = true;
   self::_#field5 = #t17;
 }
-static get field6() → asy::FutureOr<core::int?>? {
+static get field6() → FutureOr<core::int?>? {
   if(!self::_#field6#isSet) {
     self::_#field6 = self::method6();
     self::_#field6#isSet = true;
   }
   return self::_#field6;
 }
-static set field6(asy::FutureOr<core::int?>? #t18) → void {
+static set field6(FutureOr<core::int?>? #t18) → void {
   self::_#field6#isSet = true;
   self::_#field6 = #t18;
 }
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect
index e3a3c24..c8d8ea6 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect
@@ -1,178 +1,177 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 import "dart:_internal" as _in;
 
 import "dart:async";
 
 class C<T extends core::Object? = dynamic> extends core::Object {
-  field asy::FutureOr<dynamic>? _#C#field1 = null;
+  field FutureOr<dynamic>? _#C#field1 = null;
   field core::bool _#C#field1#isSet = false;
-  field asy::FutureOr<dynamic>? _#C#field2 = null;
+  field FutureOr<dynamic>? _#C#field2 = null;
   field core::bool _#C#field2#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T%>? _#C#field3 = null;
+  generic-covariant-impl field FutureOr<self::C::T%>? _#C#field3 = null;
   field core::bool _#C#field3#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field4 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field4 = null;
   field core::bool _#C#field4#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field5 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field5 = null;
   field core::bool _#C#field5#isSet = false;
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  get field1() → asy::FutureOr<dynamic>
-    return this.{self::C::_#C#field1#isSet} ?{asy::FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
-  set field1(asy::FutureOr<dynamic> #t1) → void {
+  get field1() → FutureOr<dynamic>
+    return this.{self::C::_#C#field1#isSet} ?{FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
+  set field1(FutureOr<dynamic>#t1) → void {
     this.{self::C::_#C#field1#isSet} = true;
     this.{self::C::_#C#field1} = #t1;
   }
-  get field2() → asy::FutureOr<dynamic>?
-    return this.{self::C::_#C#field2#isSet} ?{asy::FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
-  set field2(asy::FutureOr<dynamic>? #t2) → void {
+  get field2() → FutureOr<dynamic>?
+    return this.{self::C::_#C#field2#isSet} ?{FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
+  set field2(FutureOr<dynamic>? #t2) → void {
     this.{self::C::_#C#field2#isSet} = true;
     this.{self::C::_#C#field2} = #t2;
   }
-  get field3() → asy::FutureOr<self::C::T%>
-    return this.{self::C::_#C#field3#isSet} ?{asy::FutureOr<self::C::T%>} let final asy::FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
-  set field3(asy::FutureOr<self::C::T%> #t4) → void {
+  get field3() → FutureOr<self::C::T%>
+    return this.{self::C::_#C#field3#isSet} ?{FutureOr<self::C::T%>} let final FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
+  set field3(FutureOr<self::C::T%>#t4) → void {
     this.{self::C::_#C#field3#isSet} = true;
     this.{self::C::_#C#field3} = #t4;
   }
-  get field4() → asy::FutureOr<self::C::T?>
-    return this.{self::C::_#C#field4#isSet} ?{asy::FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
-  set field4(asy::FutureOr<self::C::T?> #t5) → void {
+  get field4() → FutureOr<self::C::T?>
+    return this.{self::C::_#C#field4#isSet} ?{FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
+  set field4(FutureOr<self::C::T?>#t5) → void {
     this.{self::C::_#C#field4#isSet} = true;
     this.{self::C::_#C#field4} = #t5;
   }
-  get field5() → asy::FutureOr<self::C::T?>?
-    return this.{self::C::_#C#field5#isSet} ?{asy::FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
-  set field5(asy::FutureOr<self::C::T?>? #t6) → void {
+  get field5() → FutureOr<self::C::T?>?
+    return this.{self::C::_#C#field5#isSet} ?{FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
+  set field5(FutureOr<self::C::T?>? #t6) → void {
     this.{self::C::_#C#field5#isSet} = true;
     this.{self::C::_#C#field5} = #t6;
   }
   method method() → dynamic {
-    asy::FutureOr<dynamic>? local1;
+    FutureOr<dynamic>? local1;
     core::bool #local1#isSet = false;
-    function #local1#get() → asy::FutureOr<dynamic>
-      return #local1#isSet ?{asy::FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
-    function #local1#set(asy::FutureOr<dynamic> #t7) → dynamic {
+    function #local1#get() → FutureOr<dynamic>
+      return #local1#isSet ?{FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
+    function #local1#set(FutureOr<dynamic>#t7) → dynamic {
       #local1#isSet = true;
       return local1 = #t7;
     }
-    asy::FutureOr<dynamic>? local2;
+    FutureOr<dynamic>? local2;
     core::bool #local2#isSet = false;
-    function #local2#get() → asy::FutureOr<dynamic>?
-      return #local2#isSet ?{asy::FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
-    function #local2#set(asy::FutureOr<dynamic>? #t8) → dynamic {
+    function #local2#get() → FutureOr<dynamic>?
+      return #local2#isSet ?{FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
+    function #local2#set(FutureOr<dynamic>? #t8) → dynamic {
       #local2#isSet = true;
       return local2 = #t8;
     }
-    asy::FutureOr<self::C::T%>? local3;
+    FutureOr<self::C::T%>? local3;
     core::bool #local3#isSet = false;
-    function #local3#get() → asy::FutureOr<self::C::T%>
-      return #local3#isSet ?{asy::FutureOr<self::C::T%>} local3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
-    function #local3#set(asy::FutureOr<self::C::T%> #t9) → dynamic {
+    function #local3#get() → FutureOr<self::C::T%>
+      return #local3#isSet ?{FutureOr<self::C::T%>} local3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
+    function #local3#set(FutureOr<self::C::T%>#t9) → dynamic {
       #local3#isSet = true;
       return local3 = #t9;
     }
-    asy::FutureOr<self::C::T?>? local4;
+    FutureOr<self::C::T?>? local4;
     core::bool #local4#isSet = false;
-    function #local4#get() → asy::FutureOr<self::C::T?>
-      return #local4#isSet ?{asy::FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
-    function #local4#set(asy::FutureOr<self::C::T?> #t10) → dynamic {
+    function #local4#get() → FutureOr<self::C::T?>
+      return #local4#isSet ?{FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
+    function #local4#set(FutureOr<self::C::T?>#t10) → dynamic {
       #local4#isSet = true;
       return local4 = #t10;
     }
-    asy::FutureOr<self::C::T?>? local5;
+    FutureOr<self::C::T?>? local5;
     core::bool #local5#isSet = false;
-    function #local5#get() → asy::FutureOr<self::C::T?>?
-      return #local5#isSet ?{asy::FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
-    function #local5#set(asy::FutureOr<self::C::T?>? #t11) → dynamic {
+    function #local5#get() → FutureOr<self::C::T?>?
+      return #local5#isSet ?{FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
+    function #local5#set(FutureOr<self::C::T?>? #t11) → dynamic {
       #local5#isSet = true;
       return local5 = #t11;
     }
   }
 }
-static field asy::FutureOr<dynamic>? _#field1 = null;
+static field FutureOr<dynamic>? _#field1 = null;
 static field core::bool _#field1#isSet = false;
-static field asy::FutureOr<dynamic>? _#field2 = null;
+static field FutureOr<dynamic>? _#field2 = null;
 static field core::bool _#field2#isSet = false;
-static field asy::FutureOr<dynamic>? _#field3 = null;
+static field FutureOr<dynamic>? _#field3 = null;
 static field core::bool _#field3#isSet = false;
-static field asy::FutureOr<core::int>? _#field4 = null;
+static field FutureOr<core::int>? _#field4 = null;
 static field core::bool _#field4#isSet = false;
-static field asy::FutureOr<core::int?>? _#field5 = null;
+static field FutureOr<core::int?>? _#field5 = null;
 static field core::bool _#field5#isSet = false;
-static field asy::FutureOr<core::int?>? _#field6 = null;
+static field FutureOr<core::int?>? _#field6 = null;
 static field core::bool _#field6#isSet = false;
-static method method1() → asy::FutureOr<dynamic>
+static method method1() → FutureOr<dynamic>
   return null;
-static method method2() → asy::FutureOr<dynamic>?
+static method method2() → FutureOr<dynamic>?
   return null;
-static method method3() → asy::FutureOr<dynamic>
+static method method3() → FutureOr<dynamic>
   return null;
-static method method4() → asy::FutureOr<core::int>
+static method method4() → FutureOr<core::int>
   return 0;
-static method method5() → asy::FutureOr<core::int?>
+static method method5() → FutureOr<core::int?>
   return null;
-static method method6() → asy::FutureOr<core::int?>?
+static method method6() → FutureOr<core::int?>?
   return null;
-static get field1() → asy::FutureOr<dynamic> {
+static get field1() → FutureOr<dynamic> {
   if(!self::_#field1#isSet) {
     self::_#field1 = self::method1();
     self::_#field1#isSet = true;
   }
   return self::_#field1;
 }
-static set field1(asy::FutureOr<dynamic> #t12) → void {
+static set field1(FutureOr<dynamic>#t12) → void {
   self::_#field1#isSet = true;
   self::_#field1 = #t12;
 }
-static get field2() → asy::FutureOr<dynamic>? {
+static get field2() → FutureOr<dynamic>? {
   if(!self::_#field2#isSet) {
     self::_#field2 = self::method2();
     self::_#field2#isSet = true;
   }
   return self::_#field2;
 }
-static set field2(asy::FutureOr<dynamic>? #t13) → void {
+static set field2(FutureOr<dynamic>? #t13) → void {
   self::_#field2#isSet = true;
   self::_#field2 = #t13;
 }
-static get field3() → asy::FutureOr<dynamic> {
+static get field3() → FutureOr<dynamic> {
   if(!self::_#field3#isSet) {
     self::_#field3 = self::method3();
     self::_#field3#isSet = true;
   }
   return self::_#field3;
 }
-static set field3(asy::FutureOr<dynamic> #t14) → void {
+static set field3(FutureOr<dynamic>#t14) → void {
   self::_#field3#isSet = true;
   self::_#field3 = #t14;
 }
-static get field4() → asy::FutureOr<core::int>
-  return let final asy::FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{asy::FutureOr<core::int>} self::_#field4 = self::method4() : #t15{asy::FutureOr<core::int>};
-static set field4(asy::FutureOr<core::int> #t16) → void
+static get field4() → FutureOr<core::int>
+  return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{FutureOr<core::int>} self::_#field4 = self::method4() : #t15{FutureOr<core::int>};
+static set field4(FutureOr<core::int>#t16) → void
   self::_#field4 = #t16;
-static get field5() → asy::FutureOr<core::int?> {
+static get field5() → FutureOr<core::int?> {
   if(!self::_#field5#isSet) {
     self::_#field5 = self::method5();
     self::_#field5#isSet = true;
   }
   return self::_#field5;
 }
-static set field5(asy::FutureOr<core::int?> #t17) → void {
+static set field5(FutureOr<core::int?>#t17) → void {
   self::_#field5#isSet = true;
   self::_#field5 = #t17;
 }
-static get field6() → asy::FutureOr<core::int?>? {
+static get field6() → FutureOr<core::int?>? {
   if(!self::_#field6#isSet) {
     self::_#field6 = self::method6();
     self::_#field6#isSet = true;
   }
   return self::_#field6;
 }
-static set field6(asy::FutureOr<core::int?>? #t18) → void {
+static set field6(FutureOr<core::int?>? #t18) → void {
   self::_#field6#isSet = true;
   self::_#field6 = #t18;
 }
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect
index e3a3c24..c8d8ea6 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect
@@ -1,178 +1,177 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 import "dart:_internal" as _in;
 
 import "dart:async";
 
 class C<T extends core::Object? = dynamic> extends core::Object {
-  field asy::FutureOr<dynamic>? _#C#field1 = null;
+  field FutureOr<dynamic>? _#C#field1 = null;
   field core::bool _#C#field1#isSet = false;
-  field asy::FutureOr<dynamic>? _#C#field2 = null;
+  field FutureOr<dynamic>? _#C#field2 = null;
   field core::bool _#C#field2#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T%>? _#C#field3 = null;
+  generic-covariant-impl field FutureOr<self::C::T%>? _#C#field3 = null;
   field core::bool _#C#field3#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field4 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field4 = null;
   field core::bool _#C#field4#isSet = false;
-  generic-covariant-impl field asy::FutureOr<self::C::T?>? _#C#field5 = null;
+  generic-covariant-impl field FutureOr<self::C::T?>? _#C#field5 = null;
   field core::bool _#C#field5#isSet = false;
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  get field1() → asy::FutureOr<dynamic>
-    return this.{self::C::_#C#field1#isSet} ?{asy::FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
-  set field1(asy::FutureOr<dynamic> #t1) → void {
+  get field1() → FutureOr<dynamic>
+    return this.{self::C::_#C#field1#isSet} ?{FutureOr<dynamic>} this.{self::C::_#C#field1} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
+  set field1(FutureOr<dynamic>#t1) → void {
     this.{self::C::_#C#field1#isSet} = true;
     this.{self::C::_#C#field1} = #t1;
   }
-  get field2() → asy::FutureOr<dynamic>?
-    return this.{self::C::_#C#field2#isSet} ?{asy::FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
-  set field2(asy::FutureOr<dynamic>? #t2) → void {
+  get field2() → FutureOr<dynamic>?
+    return this.{self::C::_#C#field2#isSet} ?{FutureOr<dynamic>?} this.{self::C::_#C#field2} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
+  set field2(FutureOr<dynamic>? #t2) → void {
     this.{self::C::_#C#field2#isSet} = true;
     this.{self::C::_#C#field2} = #t2;
   }
-  get field3() → asy::FutureOr<self::C::T%>
-    return this.{self::C::_#C#field3#isSet} ?{asy::FutureOr<self::C::T%>} let final asy::FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
-  set field3(asy::FutureOr<self::C::T%> #t4) → void {
+  get field3() → FutureOr<self::C::T%>
+    return this.{self::C::_#C#field3#isSet} ?{FutureOr<self::C::T%>} let final FutureOr<self::C::T%>? #t3 = this.{self::C::_#C#field3} in #t3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
+  set field3(FutureOr<self::C::T%>#t4) → void {
     this.{self::C::_#C#field3#isSet} = true;
     this.{self::C::_#C#field3} = #t4;
   }
-  get field4() → asy::FutureOr<self::C::T?>
-    return this.{self::C::_#C#field4#isSet} ?{asy::FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
-  set field4(asy::FutureOr<self::C::T?> #t5) → void {
+  get field4() → FutureOr<self::C::T?>
+    return this.{self::C::_#C#field4#isSet} ?{FutureOr<self::C::T?>} this.{self::C::_#C#field4} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
+  set field4(FutureOr<self::C::T?>#t5) → void {
     this.{self::C::_#C#field4#isSet} = true;
     this.{self::C::_#C#field4} = #t5;
   }
-  get field5() → asy::FutureOr<self::C::T?>?
-    return this.{self::C::_#C#field5#isSet} ?{asy::FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
-  set field5(asy::FutureOr<self::C::T?>? #t6) → void {
+  get field5() → FutureOr<self::C::T?>?
+    return this.{self::C::_#C#field5#isSet} ?{FutureOr<self::C::T?>?} this.{self::C::_#C#field5} : throw new _in::LateInitializationErrorImpl::•("Field 'field5' has not been initialized.");
+  set field5(FutureOr<self::C::T?>? #t6) → void {
     this.{self::C::_#C#field5#isSet} = true;
     this.{self::C::_#C#field5} = #t6;
   }
   method method() → dynamic {
-    asy::FutureOr<dynamic>? local1;
+    FutureOr<dynamic>? local1;
     core::bool #local1#isSet = false;
-    function #local1#get() → asy::FutureOr<dynamic>
-      return #local1#isSet ?{asy::FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
-    function #local1#set(asy::FutureOr<dynamic> #t7) → dynamic {
+    function #local1#get() → FutureOr<dynamic>
+      return #local1#isSet ?{FutureOr<dynamic>} local1 : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
+    function #local1#set(FutureOr<dynamic>#t7) → dynamic {
       #local1#isSet = true;
       return local1 = #t7;
     }
-    asy::FutureOr<dynamic>? local2;
+    FutureOr<dynamic>? local2;
     core::bool #local2#isSet = false;
-    function #local2#get() → asy::FutureOr<dynamic>?
-      return #local2#isSet ?{asy::FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
-    function #local2#set(asy::FutureOr<dynamic>? #t8) → dynamic {
+    function #local2#get() → FutureOr<dynamic>?
+      return #local2#isSet ?{FutureOr<dynamic>?} local2 : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
+    function #local2#set(FutureOr<dynamic>? #t8) → dynamic {
       #local2#isSet = true;
       return local2 = #t8;
     }
-    asy::FutureOr<self::C::T%>? local3;
+    FutureOr<self::C::T%>? local3;
     core::bool #local3#isSet = false;
-    function #local3#get() → asy::FutureOr<self::C::T%>
-      return #local3#isSet ?{asy::FutureOr<self::C::T%>} local3{asy::FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
-    function #local3#set(asy::FutureOr<self::C::T%> #t9) → dynamic {
+    function #local3#get() → FutureOr<self::C::T%>
+      return #local3#isSet ?{FutureOr<self::C::T%>} local3{FutureOr<self::C::T%>} : throw new _in::LateInitializationErrorImpl::•("Local 'local3' has not been initialized.");
+    function #local3#set(FutureOr<self::C::T%>#t9) → dynamic {
       #local3#isSet = true;
       return local3 = #t9;
     }
-    asy::FutureOr<self::C::T?>? local4;
+    FutureOr<self::C::T?>? local4;
     core::bool #local4#isSet = false;
-    function #local4#get() → asy::FutureOr<self::C::T?>
-      return #local4#isSet ?{asy::FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
-    function #local4#set(asy::FutureOr<self::C::T?> #t10) → dynamic {
+    function #local4#get() → FutureOr<self::C::T?>
+      return #local4#isSet ?{FutureOr<self::C::T?>} local4 : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
+    function #local4#set(FutureOr<self::C::T?>#t10) → dynamic {
       #local4#isSet = true;
       return local4 = #t10;
     }
-    asy::FutureOr<self::C::T?>? local5;
+    FutureOr<self::C::T?>? local5;
     core::bool #local5#isSet = false;
-    function #local5#get() → asy::FutureOr<self::C::T?>?
-      return #local5#isSet ?{asy::FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
-    function #local5#set(asy::FutureOr<self::C::T?>? #t11) → dynamic {
+    function #local5#get() → FutureOr<self::C::T?>?
+      return #local5#isSet ?{FutureOr<self::C::T?>?} local5 : throw new _in::LateInitializationErrorImpl::•("Local 'local5' has not been initialized.");
+    function #local5#set(FutureOr<self::C::T?>? #t11) → dynamic {
       #local5#isSet = true;
       return local5 = #t11;
     }
   }
 }
-static field asy::FutureOr<dynamic>? _#field1 = null;
+static field FutureOr<dynamic>? _#field1 = null;
 static field core::bool _#field1#isSet = false;
-static field asy::FutureOr<dynamic>? _#field2 = null;
+static field FutureOr<dynamic>? _#field2 = null;
 static field core::bool _#field2#isSet = false;
-static field asy::FutureOr<dynamic>? _#field3 = null;
+static field FutureOr<dynamic>? _#field3 = null;
 static field core::bool _#field3#isSet = false;
-static field asy::FutureOr<core::int>? _#field4 = null;
+static field FutureOr<core::int>? _#field4 = null;
 static field core::bool _#field4#isSet = false;
-static field asy::FutureOr<core::int?>? _#field5 = null;
+static field FutureOr<core::int?>? _#field5 = null;
 static field core::bool _#field5#isSet = false;
-static field asy::FutureOr<core::int?>? _#field6 = null;
+static field FutureOr<core::int?>? _#field6 = null;
 static field core::bool _#field6#isSet = false;
-static method method1() → asy::FutureOr<dynamic>
+static method method1() → FutureOr<dynamic>
   return null;
-static method method2() → asy::FutureOr<dynamic>?
+static method method2() → FutureOr<dynamic>?
   return null;
-static method method3() → asy::FutureOr<dynamic>
+static method method3() → FutureOr<dynamic>
   return null;
-static method method4() → asy::FutureOr<core::int>
+static method method4() → FutureOr<core::int>
   return 0;
-static method method5() → asy::FutureOr<core::int?>
+static method method5() → FutureOr<core::int?>
   return null;
-static method method6() → asy::FutureOr<core::int?>?
+static method method6() → FutureOr<core::int?>?
   return null;
-static get field1() → asy::FutureOr<dynamic> {
+static get field1() → FutureOr<dynamic> {
   if(!self::_#field1#isSet) {
     self::_#field1 = self::method1();
     self::_#field1#isSet = true;
   }
   return self::_#field1;
 }
-static set field1(asy::FutureOr<dynamic> #t12) → void {
+static set field1(FutureOr<dynamic>#t12) → void {
   self::_#field1#isSet = true;
   self::_#field1 = #t12;
 }
-static get field2() → asy::FutureOr<dynamic>? {
+static get field2() → FutureOr<dynamic>? {
   if(!self::_#field2#isSet) {
     self::_#field2 = self::method2();
     self::_#field2#isSet = true;
   }
   return self::_#field2;
 }
-static set field2(asy::FutureOr<dynamic>? #t13) → void {
+static set field2(FutureOr<dynamic>? #t13) → void {
   self::_#field2#isSet = true;
   self::_#field2 = #t13;
 }
-static get field3() → asy::FutureOr<dynamic> {
+static get field3() → FutureOr<dynamic> {
   if(!self::_#field3#isSet) {
     self::_#field3 = self::method3();
     self::_#field3#isSet = true;
   }
   return self::_#field3;
 }
-static set field3(asy::FutureOr<dynamic> #t14) → void {
+static set field3(FutureOr<dynamic>#t14) → void {
   self::_#field3#isSet = true;
   self::_#field3 = #t14;
 }
-static get field4() → asy::FutureOr<core::int>
-  return let final asy::FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{asy::FutureOr<core::int>} self::_#field4 = self::method4() : #t15{asy::FutureOr<core::int>};
-static set field4(asy::FutureOr<core::int> #t16) → void
+static get field4() → FutureOr<core::int>
+  return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{FutureOr<core::int>} self::_#field4 = self::method4() : #t15{FutureOr<core::int>};
+static set field4(FutureOr<core::int>#t16) → void
   self::_#field4 = #t16;
-static get field5() → asy::FutureOr<core::int?> {
+static get field5() → FutureOr<core::int?> {
   if(!self::_#field5#isSet) {
     self::_#field5 = self::method5();
     self::_#field5#isSet = true;
   }
   return self::_#field5;
 }
-static set field5(asy::FutureOr<core::int?> #t17) → void {
+static set field5(FutureOr<core::int?>#t17) → void {
   self::_#field5#isSet = true;
   self::_#field5 = #t17;
 }
-static get field6() → asy::FutureOr<core::int?>? {
+static get field6() → FutureOr<core::int?>? {
   if(!self::_#field6#isSet) {
     self::_#field6 = self::method6();
     self::_#field6#isSet = true;
   }
   return self::_#field6;
 }
-static set field6(asy::FutureOr<core::int?>? #t18) → void {
+static set field6(FutureOr<core::int?>? #t18) → void {
   self::_#field6#isSet = true;
   self::_#field6 = #t18;
 }
diff --git a/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect
index cd697a5..1129833 100644
--- a/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/later.dart.strong.transformed.expect
@@ -138,7 +138,7 @@
 }
 static method hest() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -193,7 +193,7 @@
 }
 static method fisk() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -221,7 +221,7 @@
         function #f#get() → core::Function
           return let final core::Function? #t15 = f in #t15.==(null) ?{core::Function} f = () → asy::Future<dynamic> /* originally async */ {
             final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-            asy::FutureOr<dynamic>? :return_value;
+            FutureOr<dynamic>? :return_value;
             dynamic :async_stack_trace;
             (dynamic) → dynamic :async_op_then;
             (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect
index cd697a5..1129833 100644
--- a/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect
@@ -138,7 +138,7 @@
 }
 static method hest() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -193,7 +193,7 @@
 }
 static method fisk() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -221,7 +221,7 @@
         function #f#get() → core::Function
           return let final core::Function? #t15 = f in #t15.==(null) ?{core::Function} f = () → asy::Future<dynamic> /* originally async */ {
             final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-            asy::FutureOr<dynamic>? :return_value;
+            FutureOr<dynamic>? :return_value;
             dynamic :async_stack_trace;
             (dynamic) → dynamic :async_op_then;
             (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/constant_null_is.dart.outline.expect b/pkg/front_end/testcases/nnbd/constant_null_is.dart.outline.expect
index 6c26486..e959da7 100644
--- a/pkg/front_end/testcases/nnbd/constant_null_is.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/constant_null_is.dart.outline.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -26,14 +25,14 @@
 static const field core::bool c2 = null is{ForNonNullableByDefault} core::Null?;
 static const field core::bool c3 = null is{ForNonNullableByDefault} Never?;
 static const field core::bool c4 = null is{ForNonNullableByDefault} Never;
-static const field core::bool c5 = null is{ForNonNullableByDefault} asy::FutureOr<core::int?>;
-static const field core::bool c6 = null is{ForNonNullableByDefault} asy::FutureOr<core::int>;
-static const field core::bool c7 = null is{ForNonNullableByDefault} asy::FutureOr<core::int>?;
-static const field core::bool c8 = null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>;
-static const field core::bool c9 = null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?;
-static const field core::bool c10 = null is{ForNonNullableByDefault} asy::FutureOr<Never>;
-static const field core::bool c11 = null is{ForNonNullableByDefault} asy::FutureOr<Never?>;
-static const field core::bool c12 = null is{ForNonNullableByDefault} asy::FutureOr<Never>?;
+static const field core::bool c5 = null is{ForNonNullableByDefault} FutureOr<core::int?>;
+static const field core::bool c6 = null is{ForNonNullableByDefault} FutureOr<core::int>;
+static const field core::bool c7 = null is{ForNonNullableByDefault} FutureOr<core::int>?;
+static const field core::bool c8 = null is{ForNonNullableByDefault} FutureOr<core::Null?>;
+static const field core::bool c9 = null is{ForNonNullableByDefault} FutureOr<core::Null?>?;
+static const field core::bool c10 = null is{ForNonNullableByDefault} FutureOr<Never>;
+static const field core::bool c11 = null is{ForNonNullableByDefault} FutureOr<Never?>;
+static const field core::bool c12 = null is{ForNonNullableByDefault} FutureOr<Never>?;
 static const field self::Class<core::int> e1 = const self::Class::constructor1<core::int>(null);
 static const field self::Class<core::int?> e2 = const self::Class::constructor1<core::int?>(null);
 static const field self::Class<core::Null?> e3 = const self::Class::constructor1<core::Null?>(null);
diff --git a/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.expect b/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.expect
index 0584096..38d97af 100644
--- a/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -52,14 +51,14 @@
   self::expect(null is{ForNonNullableByDefault} core::Null?, #C2, "null is Null");
   self::expect(null is{ForNonNullableByDefault} Never?, #C2, "null is Never?");
   self::expect(null is{ForNonNullableByDefault} Never, #C3, "null is Never");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>, #C3, "null is FutureOr<int>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>, #C3, "null is FutureOr<Never>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>, #C3, "null is FutureOr<int>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>, #C3, "null is FutureOr<Never>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
   self::expect(new self::Class::constructor1<core::int>(null).{self::Class::field}, (#C4).{self::Class::field}, "Class<int>.constructor1(null).field");
   self::expect(true, new self::Class::constructor1<core::int?>(null).{self::Class::field}, "new Class<int?>.constructor1(null).field");
   self::expect(!self::isWeakMode, (#C5).{self::Class::field}, "const Class<int?>.constructor1(null).field");
diff --git a/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.transformed.expect
index 0584096..38d97af 100644
--- a/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/constant_null_is.dart.strong.transformed.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -52,14 +51,14 @@
   self::expect(null is{ForNonNullableByDefault} core::Null?, #C2, "null is Null");
   self::expect(null is{ForNonNullableByDefault} Never?, #C2, "null is Never?");
   self::expect(null is{ForNonNullableByDefault} Never, #C3, "null is Never");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>, #C3, "null is FutureOr<int>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>, #C3, "null is FutureOr<Never>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>, #C3, "null is FutureOr<int>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>, #C3, "null is FutureOr<Never>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
   self::expect(new self::Class::constructor1<core::int>(null).{self::Class::field}, (#C4).{self::Class::field}, "Class<int>.constructor1(null).field");
   self::expect(true, new self::Class::constructor1<core::int?>(null).{self::Class::field}, "new Class<int?>.constructor1(null).field");
   self::expect(!self::isWeakMode, (#C5).{self::Class::field}, "const Class<int?>.constructor1(null).field");
diff --git a/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.expect b/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.expect
index 525b38f..1c2af1f 100644
--- a/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -52,14 +51,14 @@
   self::expect(null is{ForNonNullableByDefault} core::Null?, #C2, "null is Null");
   self::expect(null is{ForNonNullableByDefault} Never?, #C2, "null is Never?");
   self::expect(null is{ForNonNullableByDefault} Never, #C3, "null is Never");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>, #C3, "null is FutureOr<int>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>, #C3, "null is FutureOr<Never>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>, #C3, "null is FutureOr<int>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>, #C3, "null is FutureOr<Never>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
   self::expect(new self::Class::constructor1<core::int>(null).{self::Class::field}, (#C4).{self::Class::field}, "Class<int>.constructor1(null).field");
   self::expect(true, new self::Class::constructor1<core::int?>(null).{self::Class::field}, "new Class<int?>.constructor1(null).field");
   self::expect(!self::isWeakMode, (#C4).{self::Class::field}, "const Class<int?>.constructor1(null).field");
diff --git a/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.transformed.expect
index 525b38f..1c2af1f 100644
--- a/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/constant_null_is.dart.weak.transformed.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -52,14 +51,14 @@
   self::expect(null is{ForNonNullableByDefault} core::Null?, #C2, "null is Null");
   self::expect(null is{ForNonNullableByDefault} Never?, #C2, "null is Never?");
   self::expect(null is{ForNonNullableByDefault} Never, #C3, "null is Never");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>, #C3, "null is FutureOr<int>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>, #C3, "null is FutureOr<Never>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>, #C3, "null is FutureOr<int>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>, #C3, "null is FutureOr<Never>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
   self::expect(new self::Class::constructor1<core::int>(null).{self::Class::field}, (#C4).{self::Class::field}, "Class<int>.constructor1(null).field");
   self::expect(true, new self::Class::constructor1<core::int?>(null).{self::Class::field}, "new Class<int?>.constructor1(null).field");
   self::expect(!self::isWeakMode, (#C4).{self::Class::field}, "const Class<int?>.constructor1(null).field");
diff --git a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.expect b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.expect
index 9751d45..fefe271f 100644
--- a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.expect
@@ -60,14 +60,13 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect = <T extends core::Object? = dynamic>(T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -84,7 +83,7 @@
 static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null? fieldConditional = <T extends core::Object? = dynamic>(core::bool b, T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
@@ -113,7 +112,7 @@
 static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect::T% value) → dynamic {
   late final self::methodDirect::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -130,7 +129,7 @@
 static method methodConditional<T extends core::Object? = dynamic>(core::bool b, self::methodConditional::T% value) → dynamic {
   late final self::methodConditional::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
diff --git a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.transformed.expect
index 9751d45..fefe271f 100644
--- a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.strong.transformed.expect
@@ -60,14 +60,13 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect = <T extends core::Object? = dynamic>(T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -84,7 +83,7 @@
 static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null? fieldConditional = <T extends core::Object? = dynamic>(core::bool b, T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
@@ -113,7 +112,7 @@
 static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect::T% value) → dynamic {
   late final self::methodDirect::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -130,7 +129,7 @@
 static method methodConditional<T extends core::Object? = dynamic>(core::bool b, self::methodConditional::T% value) → dynamic {
   late final self::methodConditional::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
diff --git a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.expect b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.expect
index 9751d45..fefe271f 100644
--- a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.expect
@@ -60,14 +60,13 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect = <T extends core::Object? = dynamic>(T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -84,7 +83,7 @@
 static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null? fieldConditional = <T extends core::Object? = dynamic>(core::bool b, T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
@@ -113,7 +112,7 @@
 static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect::T% value) → dynamic {
   late final self::methodDirect::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -130,7 +129,7 @@
 static method methodConditional<T extends core::Object? = dynamic>(core::bool b, self::methodConditional::T% value) → dynamic {
   late final self::methodConditional::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
diff --git a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.transformed.expect
index 9751d45..fefe271f 100644
--- a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.weak.transformed.expect
@@ -60,14 +60,13 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect = <T extends core::Object? = dynamic>(T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -84,7 +83,7 @@
 static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null? fieldConditional = <T extends core::Object? = dynamic>(core::bool b, T% value) → core::Null? {
   late final T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
@@ -113,7 +112,7 @@
 static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect::T% value) → dynamic {
   late final self::methodDirect::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   local2 = value;
   local4 = 0;
   local6 = 0;
@@ -130,7 +129,7 @@
 static method methodConditional<T extends core::Object? = dynamic>(core::bool b, self::methodConditional::T% value) → dynamic {
   late final self::methodConditional::T% local2;
   late final core::int local4;
-  late final asy::FutureOr<core::int> local6;
+  late final FutureOr<core::int>local6;
   if(b) {
     local2 = value;
     local4 = 0;
diff --git a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.expect b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.expect
index ba765a9..8d264c0 100644
--- a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.expect
@@ -92,7 +92,6 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -101,8 +100,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late T% local7 = value;
   let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/definitely_unassigned.dart:34:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
   local1; // error
@@ -129,8 +128,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late T% local7 = value;
   if(b) {
     local1 = value;
@@ -170,8 +169,8 @@
   late self::methodDirect::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late self::methodDirect::T% local7 = value;
   let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/definitely_unassigned.dart:16:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
   local1; // error
@@ -198,8 +197,8 @@
   late self::methodConditional::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late self::methodConditional::T% local7 = value;
   if(b) {
     local1 = value;
diff --git a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.transformed.expect
index 9f695f8..47c5912 100644
--- a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.strong.transformed.expect
@@ -92,7 +92,6 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -101,8 +100,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → T%
     return value;
   late T% local7 = #local7#initializer.call();
@@ -131,8 +130,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → T%
     return value;
   late T% local7 = #local7#initializer.call();
@@ -174,8 +173,8 @@
   late self::methodDirect::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → self::methodDirect::T%
     return value;
   late self::methodDirect::T% local7 = #local7#initializer.call();
@@ -204,8 +203,8 @@
   late self::methodConditional::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → self::methodConditional::T%
     return value;
   late self::methodConditional::T% local7 = #local7#initializer.call();
diff --git a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.expect b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.expect
index ba765a9..8d264c0 100644
--- a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.expect
@@ -92,7 +92,6 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -101,8 +100,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late T% local7 = value;
   let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/definitely_unassigned.dart:34:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
   local1; // error
@@ -129,8 +128,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late T% local7 = value;
   if(b) {
     local1 = value;
@@ -170,8 +169,8 @@
   late self::methodDirect::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late self::methodDirect::T% local7 = value;
   let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/definitely_unassigned.dart:16:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
   local1; // error
@@ -198,8 +197,8 @@
   late self::methodConditional::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   late self::methodConditional::T% local7 = value;
   if(b) {
     local1 = value;
diff --git a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.transformed.expect
index 9f695f8..47c5912 100644
--- a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.weak.transformed.expect
@@ -92,7 +92,6 @@
 //
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -101,8 +100,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → T%
     return value;
   late T% local7 = #local7#initializer.call();
@@ -131,8 +130,8 @@
   late T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → T%
     return value;
   late T% local7 = #local7#initializer.call();
@@ -174,8 +173,8 @@
   late self::methodDirect::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → self::methodDirect::T%
     return value;
   late self::methodDirect::T% local7 = #local7#initializer.call();
@@ -204,8 +203,8 @@
   late self::methodConditional::T% local2;
   core::int local3;
   late core::int local4;
-  asy::FutureOr<core::int> local5;
-  late asy::FutureOr<core::int> local6;
+  FutureOr<core::int>local5;
+  late FutureOr<core::int>local6;
   function #local7#initializer() → self::methodConditional::T%
     return value;
   late self::methodConditional::T% local7 = #local7#initializer.call();
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart b/pkg/front_end/testcases/nnbd/extension_never.dart
new file mode 100644
index 0000000..43a3fe1
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+extension Extension on Never {
+  extensionMethod() {}
+}
+
+implicitAccess(Never never) {
+  never.extensionMethod();
+  never.missingMethod();
+}
+
+explicitAccess(Never never) {
+  Extension(never).extensionMethod();
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart.outline.expect b/pkg/front_end/testcases/nnbd/extension_never.dart.outline.expect
new file mode 100644
index 0000000..718b500
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart.outline.expect
@@ -0,0 +1,17 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+extension Extension on Never {
+  method extensionMethod = self::Extension|extensionMethod;
+  tearoff extensionMethod = self::Extension|get#extensionMethod;
+}
+static method Extension|extensionMethod(final Never #this) → dynamic
+  ;
+static method Extension|get#extensionMethod(final Never #this) → () → dynamic
+  return () → dynamic => self::Extension|extensionMethod(#this);
+static method implicitAccess(Never never) → dynamic
+  ;
+static method explicitAccess(Never never) → dynamic
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart.strong.expect b/pkg/front_end/testcases/nnbd/extension_never.dart.strong.expect
new file mode 100644
index 0000000..5c20141
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart.strong.expect
@@ -0,0 +1,18 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+extension Extension on Never {
+  method extensionMethod = self::Extension|extensionMethod;
+  tearoff extensionMethod = self::Extension|get#extensionMethod;
+}
+static method Extension|extensionMethod(final Never #this) → dynamic {}
+static method Extension|get#extensionMethod(final Never #this) → () → dynamic
+  return () → dynamic => self::Extension|extensionMethod(#this);
+static method implicitAccess(Never never) → dynamic {
+  never.extensionMethod();
+  never.missingMethod();
+}
+static method explicitAccess(Never never) → dynamic {
+  self::Extension|extensionMethod(never);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/extension_never.dart.strong.transformed.expect
new file mode 100644
index 0000000..5c20141
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart.strong.transformed.expect
@@ -0,0 +1,18 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+extension Extension on Never {
+  method extensionMethod = self::Extension|extensionMethod;
+  tearoff extensionMethod = self::Extension|get#extensionMethod;
+}
+static method Extension|extensionMethod(final Never #this) → dynamic {}
+static method Extension|get#extensionMethod(final Never #this) → () → dynamic
+  return () → dynamic => self::Extension|extensionMethod(#this);
+static method implicitAccess(Never never) → dynamic {
+  never.extensionMethod();
+  never.missingMethod();
+}
+static method explicitAccess(Never never) → dynamic {
+  self::Extension|extensionMethod(never);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/extension_never.dart.textual_outline.expect
new file mode 100644
index 0000000..f7e75d5
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart.textual_outline.expect
@@ -0,0 +1,5 @@
+extension Extension ;
+on Never (){ }
+implicitAccess(Never never) { }
+explicitAccess(Never never) { }
+main() { }
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart.weak.expect b/pkg/front_end/testcases/nnbd/extension_never.dart.weak.expect
new file mode 100644
index 0000000..5c20141
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart.weak.expect
@@ -0,0 +1,18 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+extension Extension on Never {
+  method extensionMethod = self::Extension|extensionMethod;
+  tearoff extensionMethod = self::Extension|get#extensionMethod;
+}
+static method Extension|extensionMethod(final Never #this) → dynamic {}
+static method Extension|get#extensionMethod(final Never #this) → () → dynamic
+  return () → dynamic => self::Extension|extensionMethod(#this);
+static method implicitAccess(Never never) → dynamic {
+  never.extensionMethod();
+  never.missingMethod();
+}
+static method explicitAccess(Never never) → dynamic {
+  self::Extension|extensionMethod(never);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/extension_never.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/extension_never.dart.weak.transformed.expect
new file mode 100644
index 0000000..5c20141
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/extension_never.dart.weak.transformed.expect
@@ -0,0 +1,18 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+extension Extension on Never {
+  method extensionMethod = self::Extension|extensionMethod;
+  tearoff extensionMethod = self::Extension|get#extensionMethod;
+}
+static method Extension|extensionMethod(final Never #this) → dynamic {}
+static method Extension|get#extensionMethod(final Never #this) → () → dynamic
+  return () → dynamic => self::Extension|extensionMethod(#this);
+static method implicitAccess(Never never) → dynamic {
+  never.extensionMethod();
+  never.missingMethod();
+}
+static method explicitAccess(Never never) → dynamic {
+  self::Extension|extensionMethod(never);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/future_or_variables.dart.outline.expect b/pkg/front_end/testcases/nnbd/future_or_variables.dart.outline.expect
index 7b9faa0..920efc0 100644
--- a/pkg/front_end/testcases/nnbd/future_or_variables.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/future_or_variables.dart.outline.expect
@@ -1,43 +1,42 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class Class1 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1;
-  field asy::FutureOr<core::int?> instanceField2;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3;
-  static field asy::FutureOr<dynamic> staticField1;
-  static field asy::FutureOr<core::int?> staticField2;
-  static field asy::FutureOr<asy::FutureOr<dynamic>> staticField3;
+  field FutureOr<dynamic>instanceField1;
+  field FutureOr<core::int?>instanceField2;
+  field FutureOr<FutureOr<dynamic>>instanceField3;
+  static field FutureOr<dynamic>staticField1;
+  static field FutureOr<core::int?>staticField2;
+  static field FutureOr<FutureOr<dynamic>>staticField3;
   synthetic constructor •() → self::Class1
     ;
-  method instanceMethod1([asy::FutureOr<dynamic> parameter1, asy::FutureOr<core::int?> parameter2, asy::FutureOr<asy::FutureOr<dynamic>> parameter3]) → void
+  method instanceMethod1([FutureOr<dynamic>parameter1, FutureOr<core::int?>parameter2, FutureOr<FutureOr<dynamic>>parameter3]) → void
     ;
-  method instanceMethod2({asy::FutureOr<dynamic> parameter1, asy::FutureOr<core::int?> parameter2, asy::FutureOr<asy::FutureOr<dynamic>> parameter3}) → void
+  method instanceMethod2({FutureOr<dynamic>parameter1, FutureOr<core::int?>parameter2, FutureOr<FutureOr<dynamic>>parameter3}) → void
     ;
-  static method staticMethod1([asy::FutureOr<dynamic> parameter1, asy::FutureOr<core::int?> parameter2, asy::FutureOr<asy::FutureOr<dynamic>> parameter3]) → void
+  static method staticMethod1([FutureOr<dynamic>parameter1, FutureOr<core::int?>parameter2, FutureOr<FutureOr<dynamic>>parameter3]) → void
     ;
-  static method staticMethod2({asy::FutureOr<dynamic> parameter1, asy::FutureOr<core::int?> parameter2, asy::FutureOr<asy::FutureOr<dynamic>> parameter3}) → void
+  static method staticMethod2({FutureOr<dynamic>parameter1, FutureOr<core::int?>parameter2, FutureOr<FutureOr<dynamic>>parameter3}) → void
     ;
 }
 class Class2 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1;
-  field asy::FutureOr<core::int?> instanceField2;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3;
-  constructor constructor1(asy::FutureOr<dynamic> instanceField1, asy::FutureOr<core::int?> instanceField2, asy::FutureOr<asy::FutureOr<dynamic>> instanceField3) → self::Class2
+  field FutureOr<dynamic>instanceField1;
+  field FutureOr<core::int?>instanceField2;
+  field FutureOr<FutureOr<dynamic>>instanceField3;
+  constructor constructor1(FutureOr<dynamic>instanceField1, FutureOr<core::int?>instanceField2, FutureOr<FutureOr<dynamic>>instanceField3) → self::Class2
     ;
   constructor constructor2() → self::Class2
     ;
 }
-static field asy::FutureOr<dynamic> topLevelField1;
-static field asy::FutureOr<core::int?> topLevelField2;
-static field asy::FutureOr<asy::FutureOr<dynamic>> topLevelField3;
-static method toplevelMethod1([asy::FutureOr<dynamic> parameter1, asy::FutureOr<core::int?> parameter2, asy::FutureOr<asy::FutureOr<dynamic>> parameter3]) → void
+static field FutureOr<dynamic>topLevelField1;
+static field FutureOr<core::int?>topLevelField2;
+static field FutureOr<FutureOr<dynamic>>topLevelField3;
+static method toplevelMethod1([FutureOr<dynamic>parameter1, FutureOr<core::int?>parameter2, FutureOr<FutureOr<dynamic>>parameter3]) → void
   ;
-static method toplevelMethod2({asy::FutureOr<dynamic> parameter1, asy::FutureOr<core::int?> parameter2, asy::FutureOr<asy::FutureOr<dynamic>> parameter3}) → void
+static method toplevelMethod2({FutureOr<dynamic>parameter1, FutureOr<core::int?>parameter2, FutureOr<FutureOr<dynamic>>parameter3}) → void
   ;
 static method main() → dynamic
   ;
diff --git a/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.expect b/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.expect
index 1a70453..88659fb 100644
--- a/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.expect
@@ -1,50 +1,49 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class Class1 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1 = null;
-  field asy::FutureOr<core::int?> instanceField2 = null;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3 = null;
-  static field asy::FutureOr<dynamic> staticField1 = null;
-  static field asy::FutureOr<core::int?> staticField2 = null;
-  static field asy::FutureOr<asy::FutureOr<dynamic>> staticField3 = null;
+  field FutureOr<dynamic>instanceField1 = null;
+  field FutureOr<core::int?>instanceField2 = null;
+  field FutureOr<FutureOr<dynamic>>instanceField3 = null;
+  static field FutureOr<dynamic>staticField1 = null;
+  static field FutureOr<core::int?>staticField2 = null;
+  static field FutureOr<FutureOr<dynamic>>staticField3 = null;
   synthetic constructor •() → self::Class1
     : super core::Object::•()
     ;
-  method instanceMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  method instanceMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
-  static method staticMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  static method staticMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  method instanceMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  method instanceMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
+  static method staticMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  static method staticMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 class Class2 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1;
-  field asy::FutureOr<core::int?> instanceField2;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3;
-  constructor constructor1(asy::FutureOr<dynamic> instanceField1, asy::FutureOr<core::int?> instanceField2, asy::FutureOr<asy::FutureOr<dynamic>> instanceField3) → self::Class2
+  field FutureOr<dynamic>instanceField1;
+  field FutureOr<core::int?>instanceField2;
+  field FutureOr<FutureOr<dynamic>>instanceField3;
+  constructor constructor1(FutureOr<dynamic>instanceField1, FutureOr<core::int?>instanceField2, FutureOr<FutureOr<dynamic>>instanceField3) → self::Class2
     : self::Class2::instanceField1 = instanceField1, self::Class2::instanceField2 = instanceField2, self::Class2::instanceField3 = instanceField3, super core::Object::•()
     ;
   constructor constructor2() → self::Class2
     : self::Class2::instanceField3 = null, self::Class2::instanceField2 = null, self::Class2::instanceField1 = null, super core::Object::•()
     ;
 }
-static field asy::FutureOr<dynamic> topLevelField1;
-static field asy::FutureOr<core::int?> topLevelField2;
-static field asy::FutureOr<asy::FutureOr<dynamic>> topLevelField3;
-static method toplevelMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-static method toplevelMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+static field FutureOr<dynamic>topLevelField1;
+static field FutureOr<core::int?>topLevelField2;
+static field FutureOr<FutureOr<dynamic>>topLevelField3;
+static method toplevelMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+static method toplevelMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 static method main() → dynamic {
-  asy::FutureOr<dynamic> local1;
-  asy::FutureOr<core::int?> local2;
-  asy::FutureOr<asy::FutureOr<dynamic>> local3;
+  FutureOr<dynamic>local1;
+  FutureOr<core::int?>local2;
+  FutureOr<FutureOr<dynamic>>local3;
   core::print(local1);
   core::print(local2);
   core::print(local3);
-  function localFunction1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  function localFunction2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  function localFunction1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  function localFunction2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.transformed.expect
index 1a70453..88659fb 100644
--- a/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/future_or_variables.dart.strong.transformed.expect
@@ -1,50 +1,49 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class Class1 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1 = null;
-  field asy::FutureOr<core::int?> instanceField2 = null;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3 = null;
-  static field asy::FutureOr<dynamic> staticField1 = null;
-  static field asy::FutureOr<core::int?> staticField2 = null;
-  static field asy::FutureOr<asy::FutureOr<dynamic>> staticField3 = null;
+  field FutureOr<dynamic>instanceField1 = null;
+  field FutureOr<core::int?>instanceField2 = null;
+  field FutureOr<FutureOr<dynamic>>instanceField3 = null;
+  static field FutureOr<dynamic>staticField1 = null;
+  static field FutureOr<core::int?>staticField2 = null;
+  static field FutureOr<FutureOr<dynamic>>staticField3 = null;
   synthetic constructor •() → self::Class1
     : super core::Object::•()
     ;
-  method instanceMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  method instanceMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
-  static method staticMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  static method staticMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  method instanceMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  method instanceMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
+  static method staticMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  static method staticMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 class Class2 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1;
-  field asy::FutureOr<core::int?> instanceField2;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3;
-  constructor constructor1(asy::FutureOr<dynamic> instanceField1, asy::FutureOr<core::int?> instanceField2, asy::FutureOr<asy::FutureOr<dynamic>> instanceField3) → self::Class2
+  field FutureOr<dynamic>instanceField1;
+  field FutureOr<core::int?>instanceField2;
+  field FutureOr<FutureOr<dynamic>>instanceField3;
+  constructor constructor1(FutureOr<dynamic>instanceField1, FutureOr<core::int?>instanceField2, FutureOr<FutureOr<dynamic>>instanceField3) → self::Class2
     : self::Class2::instanceField1 = instanceField1, self::Class2::instanceField2 = instanceField2, self::Class2::instanceField3 = instanceField3, super core::Object::•()
     ;
   constructor constructor2() → self::Class2
     : self::Class2::instanceField3 = null, self::Class2::instanceField2 = null, self::Class2::instanceField1 = null, super core::Object::•()
     ;
 }
-static field asy::FutureOr<dynamic> topLevelField1;
-static field asy::FutureOr<core::int?> topLevelField2;
-static field asy::FutureOr<asy::FutureOr<dynamic>> topLevelField3;
-static method toplevelMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-static method toplevelMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+static field FutureOr<dynamic>topLevelField1;
+static field FutureOr<core::int?>topLevelField2;
+static field FutureOr<FutureOr<dynamic>>topLevelField3;
+static method toplevelMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+static method toplevelMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 static method main() → dynamic {
-  asy::FutureOr<dynamic> local1;
-  asy::FutureOr<core::int?> local2;
-  asy::FutureOr<asy::FutureOr<dynamic>> local3;
+  FutureOr<dynamic>local1;
+  FutureOr<core::int?>local2;
+  FutureOr<FutureOr<dynamic>>local3;
   core::print(local1);
   core::print(local2);
   core::print(local3);
-  function localFunction1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  function localFunction2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  function localFunction1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  function localFunction2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.expect b/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.expect
index 1a70453..88659fb 100644
--- a/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.expect
@@ -1,50 +1,49 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class Class1 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1 = null;
-  field asy::FutureOr<core::int?> instanceField2 = null;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3 = null;
-  static field asy::FutureOr<dynamic> staticField1 = null;
-  static field asy::FutureOr<core::int?> staticField2 = null;
-  static field asy::FutureOr<asy::FutureOr<dynamic>> staticField3 = null;
+  field FutureOr<dynamic>instanceField1 = null;
+  field FutureOr<core::int?>instanceField2 = null;
+  field FutureOr<FutureOr<dynamic>>instanceField3 = null;
+  static field FutureOr<dynamic>staticField1 = null;
+  static field FutureOr<core::int?>staticField2 = null;
+  static field FutureOr<FutureOr<dynamic>>staticField3 = null;
   synthetic constructor •() → self::Class1
     : super core::Object::•()
     ;
-  method instanceMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  method instanceMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
-  static method staticMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  static method staticMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  method instanceMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  method instanceMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
+  static method staticMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  static method staticMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 class Class2 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1;
-  field asy::FutureOr<core::int?> instanceField2;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3;
-  constructor constructor1(asy::FutureOr<dynamic> instanceField1, asy::FutureOr<core::int?> instanceField2, asy::FutureOr<asy::FutureOr<dynamic>> instanceField3) → self::Class2
+  field FutureOr<dynamic>instanceField1;
+  field FutureOr<core::int?>instanceField2;
+  field FutureOr<FutureOr<dynamic>>instanceField3;
+  constructor constructor1(FutureOr<dynamic>instanceField1, FutureOr<core::int?>instanceField2, FutureOr<FutureOr<dynamic>>instanceField3) → self::Class2
     : self::Class2::instanceField1 = instanceField1, self::Class2::instanceField2 = instanceField2, self::Class2::instanceField3 = instanceField3, super core::Object::•()
     ;
   constructor constructor2() → self::Class2
     : self::Class2::instanceField3 = null, self::Class2::instanceField2 = null, self::Class2::instanceField1 = null, super core::Object::•()
     ;
 }
-static field asy::FutureOr<dynamic> topLevelField1;
-static field asy::FutureOr<core::int?> topLevelField2;
-static field asy::FutureOr<asy::FutureOr<dynamic>> topLevelField3;
-static method toplevelMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-static method toplevelMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+static field FutureOr<dynamic>topLevelField1;
+static field FutureOr<core::int?>topLevelField2;
+static field FutureOr<FutureOr<dynamic>>topLevelField3;
+static method toplevelMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+static method toplevelMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 static method main() → dynamic {
-  asy::FutureOr<dynamic> local1;
-  asy::FutureOr<core::int?> local2;
-  asy::FutureOr<asy::FutureOr<dynamic>> local3;
+  FutureOr<dynamic>local1;
+  FutureOr<core::int?>local2;
+  FutureOr<FutureOr<dynamic>>local3;
   core::print(local1);
   core::print(local2);
   core::print(local3);
-  function localFunction1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  function localFunction2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  function localFunction1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  function localFunction2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.transformed.expect
index 1a70453..88659fb 100644
--- a/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/future_or_variables.dart.weak.transformed.expect
@@ -1,50 +1,49 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class Class1 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1 = null;
-  field asy::FutureOr<core::int?> instanceField2 = null;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3 = null;
-  static field asy::FutureOr<dynamic> staticField1 = null;
-  static field asy::FutureOr<core::int?> staticField2 = null;
-  static field asy::FutureOr<asy::FutureOr<dynamic>> staticField3 = null;
+  field FutureOr<dynamic>instanceField1 = null;
+  field FutureOr<core::int?>instanceField2 = null;
+  field FutureOr<FutureOr<dynamic>>instanceField3 = null;
+  static field FutureOr<dynamic>staticField1 = null;
+  static field FutureOr<core::int?>staticField2 = null;
+  static field FutureOr<FutureOr<dynamic>>staticField3 = null;
   synthetic constructor •() → self::Class1
     : super core::Object::•()
     ;
-  method instanceMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  method instanceMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
-  static method staticMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  static method staticMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  method instanceMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  method instanceMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
+  static method staticMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  static method staticMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 class Class2 extends core::Object {
-  field asy::FutureOr<dynamic> instanceField1;
-  field asy::FutureOr<core::int?> instanceField2;
-  field asy::FutureOr<asy::FutureOr<dynamic>> instanceField3;
-  constructor constructor1(asy::FutureOr<dynamic> instanceField1, asy::FutureOr<core::int?> instanceField2, asy::FutureOr<asy::FutureOr<dynamic>> instanceField3) → self::Class2
+  field FutureOr<dynamic>instanceField1;
+  field FutureOr<core::int?>instanceField2;
+  field FutureOr<FutureOr<dynamic>>instanceField3;
+  constructor constructor1(FutureOr<dynamic>instanceField1, FutureOr<core::int?>instanceField2, FutureOr<FutureOr<dynamic>>instanceField3) → self::Class2
     : self::Class2::instanceField1 = instanceField1, self::Class2::instanceField2 = instanceField2, self::Class2::instanceField3 = instanceField3, super core::Object::•()
     ;
   constructor constructor2() → self::Class2
     : self::Class2::instanceField3 = null, self::Class2::instanceField2 = null, self::Class2::instanceField1 = null, super core::Object::•()
     ;
 }
-static field asy::FutureOr<dynamic> topLevelField1;
-static field asy::FutureOr<core::int?> topLevelField2;
-static field asy::FutureOr<asy::FutureOr<dynamic>> topLevelField3;
-static method toplevelMethod1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-static method toplevelMethod2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+static field FutureOr<dynamic>topLevelField1;
+static field FutureOr<core::int?>topLevelField2;
+static field FutureOr<FutureOr<dynamic>>topLevelField3;
+static method toplevelMethod1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+static method toplevelMethod2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 static method main() → dynamic {
-  asy::FutureOr<dynamic> local1;
-  asy::FutureOr<core::int?> local2;
-  asy::FutureOr<asy::FutureOr<dynamic>> local3;
+  FutureOr<dynamic>local1;
+  FutureOr<core::int?>local2;
+  FutureOr<FutureOr<dynamic>>local3;
   core::print(local1);
   core::print(local2);
   core::print(local3);
-  function localFunction1([asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1]) → void {}
-  function localFunction2({asy::FutureOr<dynamic> parameter1 = #C1, asy::FutureOr<core::int?> parameter2 = #C1, asy::FutureOr<asy::FutureOr<dynamic>> parameter3 = #C1}) → void {}
+  function localFunction1([FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1]) → void {}
+  function localFunction2({FutureOr<dynamic>parameter1 = #C1, FutureOr<core::int?>parameter2 = #C1, FutureOr<FutureOr<dynamic>>parameter3 = #C1}) → void {}
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/issue40600.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue40600.dart.outline.expect
index 1e771ac..57db9b1 100644
--- a/pkg/front_end/testcases/nnbd/issue40600.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue40600.dart.outline.expect
@@ -1,33 +1,32 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
 class B<Y extends core::Object? = dynamic> extends core::Object {
   synthetic constructor •() → self::B<self::B::Y%>
     ;
-  method bar(generic-covariant-impl asy::FutureOr<self::B::Y%> y) → dynamic
+  method bar(generic-covariant-impl FutureOr<self::B::Y%>y) → dynamic
     ;
 }
 class A<X extends core::Object? = dynamic> extends core::Object {
   generic-covariant-impl final field self::B<self::A::X%> b;
   synthetic constructor •() → self::A<self::A::X%>
     ;
-  method foo([generic-covariant-impl asy::FutureOr<self::A::X%>? x]) → dynamic
+  method foo([generic-covariant-impl FutureOr<self::A::X%>? x]) → dynamic
     ;
 }
 class C<T extends core::Object? = dynamic> extends core::Object {
   synthetic constructor •() → self::C<self::C::T%>
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::C::T%> = asy::FutureOr<self::C::T%>>(generic-covariant-impl asy::FutureOr<self::C::T%> x) → asy::FutureOr<self::C::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::C::T%> = FutureOr<self::C::T%>>(generic-covariant-impl FutureOr<self::C::T%>x) → FutureOr<self::C::T%>
     ;
 }
 class D<T extends core::Object? = dynamic> extends self::C<self::D::T%> {
   synthetic constructor •() → self::D<self::D::T%>
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::D::T%> = asy::FutureOr<self::D::T%>>(generic-covariant-impl asy::FutureOr<self::D::T%> x) → asy::FutureOr<self::D::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::D::T%> = FutureOr<self::D::T%>>(generic-covariant-impl FutureOr<self::D::T%>x) → FutureOr<self::D::T%>
     ;
 }
 static method main() → dynamic
diff --git a/pkg/front_end/testcases/nnbd/issue40600.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue40600.dart.strong.expect
index df7df7b..8e9c78d 100644
--- a/pkg/front_end/testcases/nnbd/issue40600.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/issue40600.dart.strong.expect
@@ -9,16 +9,16 @@
   synthetic constructor •() → self::B<self::B::Y%>
     : super core::Object::•()
     ;
-  method bar(generic-covariant-impl asy::FutureOr<self::B::Y%> y) → dynamic {}
+  method bar(generic-covariant-impl FutureOr<self::B::Y%>y) → dynamic {}
 }
 class A<X extends core::Object? = dynamic> extends core::Object {
   generic-covariant-impl final field self::B<self::A::X%> b = new self::B::•<self::A::X%>();
   synthetic constructor •() → self::A<self::A::X%>
     : super core::Object::•()
     ;
-  method foo([generic-covariant-impl asy::FutureOr<self::A::X%>? x = #C1]) → dynamic {
+  method foo([generic-covariant-impl FutureOr<self::A::X%>? x = #C1]) → dynamic {
     if(x is{ForNonNullableByDefault} asy::Future<self::A::X%>) {
-      this.{self::A::b}.{self::B::bar}(x{asy::Future<self::A::X%>} as{ForNonNullableByDefault} asy::FutureOr<self::A::X%>);
+      this.{self::A::b}.{self::B::bar}(x{asy::Future<self::A::X%>} as{ForNonNullableByDefault} FutureOr<self::A::X%>);
     }
   }
 }
@@ -26,14 +26,14 @@
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::C::T%> = asy::FutureOr<self::C::T%>>(generic-covariant-impl asy::FutureOr<self::C::T%> x) → asy::FutureOr<self::C::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::C::T%> = FutureOr<self::C::T%>>(generic-covariant-impl FutureOr<self::C::T%>x) → FutureOr<self::C::T%>
     return x;
 }
 class D<T extends core::Object? = dynamic> extends self::C<self::D::T%> {
   synthetic constructor •() → self::D<self::D::T%>
     : super self::C::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::D::T%> = asy::FutureOr<self::D::T%>>(generic-covariant-impl asy::FutureOr<self::D::T%> x) → asy::FutureOr<self::D::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::D::T%> = FutureOr<self::D::T%>>(generic-covariant-impl FutureOr<self::D::T%>x) → FutureOr<self::D::T%>
     return x;
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue40600.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue40600.dart.strong.transformed.expect
index fc3b7ae..cba6e85 100644
--- a/pkg/front_end/testcases/nnbd/issue40600.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue40600.dart.strong.transformed.expect
@@ -9,14 +9,14 @@
   synthetic constructor •() → self::B<self::B::Y%>
     : super core::Object::•()
     ;
-  method bar(generic-covariant-impl asy::FutureOr<self::B::Y%> y) → dynamic {}
+  method bar(generic-covariant-impl FutureOr<self::B::Y%>y) → dynamic {}
 }
 class A<X extends core::Object? = dynamic> extends core::Object {
   generic-covariant-impl final field self::B<self::A::X%> b = new self::B::•<self::A::X%>();
   synthetic constructor •() → self::A<self::A::X%>
     : super core::Object::•()
     ;
-  method foo([generic-covariant-impl asy::FutureOr<self::A::X%>? x = #C1]) → dynamic {
+  method foo([generic-covariant-impl FutureOr<self::A::X%>? x = #C1]) → dynamic {
     if(x is{ForNonNullableByDefault} asy::Future<self::A::X%>) {
       this.{self::A::b}.{self::B::bar}(x{asy::Future<self::A::X%>});
     }
@@ -26,14 +26,14 @@
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::C::T%> = asy::FutureOr<self::C::T%>>(generic-covariant-impl asy::FutureOr<self::C::T%> x) → asy::FutureOr<self::C::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::C::T%> = FutureOr<self::C::T%>>(generic-covariant-impl FutureOr<self::C::T%>x) → FutureOr<self::C::T%>
     return x;
 }
 class D<T extends core::Object? = dynamic> extends self::C<self::D::T%> {
   synthetic constructor •() → self::D<self::D::T%>
     : super self::C::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::D::T%> = asy::FutureOr<self::D::T%>>(generic-covariant-impl asy::FutureOr<self::D::T%> x) → asy::FutureOr<self::D::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::D::T%> = FutureOr<self::D::T%>>(generic-covariant-impl FutureOr<self::D::T%>x) → FutureOr<self::D::T%>
     return x;
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue40600.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue40600.dart.weak.expect
index df7df7b..8e9c78d 100644
--- a/pkg/front_end/testcases/nnbd/issue40600.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/issue40600.dart.weak.expect
@@ -9,16 +9,16 @@
   synthetic constructor •() → self::B<self::B::Y%>
     : super core::Object::•()
     ;
-  method bar(generic-covariant-impl asy::FutureOr<self::B::Y%> y) → dynamic {}
+  method bar(generic-covariant-impl FutureOr<self::B::Y%>y) → dynamic {}
 }
 class A<X extends core::Object? = dynamic> extends core::Object {
   generic-covariant-impl final field self::B<self::A::X%> b = new self::B::•<self::A::X%>();
   synthetic constructor •() → self::A<self::A::X%>
     : super core::Object::•()
     ;
-  method foo([generic-covariant-impl asy::FutureOr<self::A::X%>? x = #C1]) → dynamic {
+  method foo([generic-covariant-impl FutureOr<self::A::X%>? x = #C1]) → dynamic {
     if(x is{ForNonNullableByDefault} asy::Future<self::A::X%>) {
-      this.{self::A::b}.{self::B::bar}(x{asy::Future<self::A::X%>} as{ForNonNullableByDefault} asy::FutureOr<self::A::X%>);
+      this.{self::A::b}.{self::B::bar}(x{asy::Future<self::A::X%>} as{ForNonNullableByDefault} FutureOr<self::A::X%>);
     }
   }
 }
@@ -26,14 +26,14 @@
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::C::T%> = asy::FutureOr<self::C::T%>>(generic-covariant-impl asy::FutureOr<self::C::T%> x) → asy::FutureOr<self::C::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::C::T%> = FutureOr<self::C::T%>>(generic-covariant-impl FutureOr<self::C::T%>x) → FutureOr<self::C::T%>
     return x;
 }
 class D<T extends core::Object? = dynamic> extends self::C<self::D::T%> {
   synthetic constructor •() → self::D<self::D::T%>
     : super self::C::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::D::T%> = asy::FutureOr<self::D::T%>>(generic-covariant-impl asy::FutureOr<self::D::T%> x) → asy::FutureOr<self::D::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::D::T%> = FutureOr<self::D::T%>>(generic-covariant-impl FutureOr<self::D::T%>x) → FutureOr<self::D::T%>
     return x;
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue40600.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue40600.dart.weak.transformed.expect
index fc3b7ae..cba6e85 100644
--- a/pkg/front_end/testcases/nnbd/issue40600.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue40600.dart.weak.transformed.expect
@@ -9,14 +9,14 @@
   synthetic constructor •() → self::B<self::B::Y%>
     : super core::Object::•()
     ;
-  method bar(generic-covariant-impl asy::FutureOr<self::B::Y%> y) → dynamic {}
+  method bar(generic-covariant-impl FutureOr<self::B::Y%>y) → dynamic {}
 }
 class A<X extends core::Object? = dynamic> extends core::Object {
   generic-covariant-impl final field self::B<self::A::X%> b = new self::B::•<self::A::X%>();
   synthetic constructor •() → self::A<self::A::X%>
     : super core::Object::•()
     ;
-  method foo([generic-covariant-impl asy::FutureOr<self::A::X%>? x = #C1]) → dynamic {
+  method foo([generic-covariant-impl FutureOr<self::A::X%>? x = #C1]) → dynamic {
     if(x is{ForNonNullableByDefault} asy::Future<self::A::X%>) {
       this.{self::A::b}.{self::B::bar}(x{asy::Future<self::A::X%>});
     }
@@ -26,14 +26,14 @@
   synthetic constructor •() → self::C<self::C::T%>
     : super core::Object::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::C::T%> = asy::FutureOr<self::C::T%>>(generic-covariant-impl asy::FutureOr<self::C::T%> x) → asy::FutureOr<self::C::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::C::T%> = FutureOr<self::C::T%>>(generic-covariant-impl FutureOr<self::C::T%>x) → FutureOr<self::C::T%>
     return x;
 }
 class D<T extends core::Object? = dynamic> extends self::C<self::D::T%> {
   synthetic constructor •() → self::D<self::D::T%>
     : super self::C::•()
     ;
-  method baz<generic-covariant-impl X extends asy::FutureOr<self::D::T%> = asy::FutureOr<self::D::T%>>(generic-covariant-impl asy::FutureOr<self::D::T%> x) → asy::FutureOr<self::D::T%>
+  method baz<generic-covariant-impl X extends FutureOr<self::D::T%> = FutureOr<self::D::T%>>(generic-covariant-impl FutureOr<self::D::T%>x) → FutureOr<self::D::T%>
     return x;
 }
 static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect
index f8f325c..3ac2da4 100644
--- a/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41114.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect
index f8f325c..3ac2da4 100644
--- a/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41114.dart.weak.transformed.expect
@@ -5,7 +5,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect
index ac884f2..96a261f 100644
--- a/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41156.dart.strong.transformed.expect
@@ -57,7 +57,7 @@
   };
   (core::int) → asy::Future<core::String> y1 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -84,7 +84,7 @@
   };
   (core::int) → asy::Future<core::String> y2 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -110,7 +110,7 @@
   };
   (core::int) → asy::Future<core::String> y3 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -137,7 +137,7 @@
   };
   (core::int) → asy::Future<core::String> y4 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -164,7 +164,7 @@
   };
   (core::int) → asy::Future<core::String> y5 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -190,7 +190,7 @@
   };
   (core::int) → asy::Future<core::String> y6 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -218,7 +218,7 @@
 }
 static method errors() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -270,7 +270,7 @@
         };
         (core::int) → asy::Future<core::String> y2 = (core::int v) → asy::Future<core::String> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::String> :async_completer = new asy::_AsyncAwaitCompleter::•<core::String>();
-          asy::FutureOr<core::String>? :return_value;
+          FutureOr<core::String>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -304,7 +304,7 @@
         };
         (core::int) → asy::Future<core::String> y3 = (core::int v) → asy::Future<Never> /* originally async */ {
           final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-          asy::FutureOr<Never>? :return_value;
+          FutureOr<Never>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -339,7 +339,7 @@
         };
         (core::int) → asy::Future<core::String> y5 = (core::int v) → asy::Future<core::String> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::String> :async_completer = new asy::_AsyncAwaitCompleter::•<core::String>();
-          asy::FutureOr<core::String>? :return_value;
+          FutureOr<core::String>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -373,7 +373,7 @@
         };
         (core::int) → asy::Future<core::String> y6 = (core::int v) → asy::Future<Never> /* originally async */ {
           final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-          asy::FutureOr<Never>? :return_value;
+          FutureOr<Never>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect
index ac884f2..96a261f 100644
--- a/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41156.dart.weak.transformed.expect
@@ -57,7 +57,7 @@
   };
   (core::int) → asy::Future<core::String> y1 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -84,7 +84,7 @@
   };
   (core::int) → asy::Future<core::String> y2 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -110,7 +110,7 @@
   };
   (core::int) → asy::Future<core::String> y3 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -137,7 +137,7 @@
   };
   (core::int) → asy::Future<core::String> y4 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -164,7 +164,7 @@
   };
   (core::int) → asy::Future<core::String> y5 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -190,7 +190,7 @@
   };
   (core::int) → asy::Future<core::String> y6 = (core::int v) → asy::Future<Never> /* originally async */ {
     final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-    asy::FutureOr<Never>? :return_value;
+    FutureOr<Never>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -218,7 +218,7 @@
 }
 static method errors() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -270,7 +270,7 @@
         };
         (core::int) → asy::Future<core::String> y2 = (core::int v) → asy::Future<core::String> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::String> :async_completer = new asy::_AsyncAwaitCompleter::•<core::String>();
-          asy::FutureOr<core::String>? :return_value;
+          FutureOr<core::String>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -304,7 +304,7 @@
         };
         (core::int) → asy::Future<core::String> y3 = (core::int v) → asy::Future<Never> /* originally async */ {
           final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-          asy::FutureOr<Never>? :return_value;
+          FutureOr<Never>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -339,7 +339,7 @@
         };
         (core::int) → asy::Future<core::String> y5 = (core::int v) → asy::Future<core::String> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::String> :async_completer = new asy::_AsyncAwaitCompleter::•<core::String>();
-          asy::FutureOr<core::String>? :return_value;
+          FutureOr<core::String>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -373,7 +373,7 @@
         };
         (core::int) → asy::Future<core::String> y6 = (core::int v) → asy::Future<Never> /* originally async */ {
           final asy::_AsyncAwaitCompleter<Never> :async_completer = new asy::_AsyncAwaitCompleter::•<Never>();
-          asy::FutureOr<Never>? :return_value;
+          FutureOr<Never>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect
index 9f84dd0..2864cb5 100644
--- a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.expect
@@ -4,13 +4,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test1() async => await getNull(); // error
 //                               ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test4() async => await getFutureNull(); // error
 //                               ^
 //
@@ -21,13 +19,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test1() async => await getNull(); // error
 //                                 ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test4() async => await getFutureNull(); // error
 //                                 ^
 //
@@ -66,9 +62,8 @@
 static method test1() → asy::Future<core::bool> async 
   return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test1() async => await getNull(); // error
-                              ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                              ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
 static method test2() → asy::Future<core::bool>
   return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<core::bool>;
 static method test3() → core::bool
@@ -76,9 +71,8 @@
 static method test4() → asy::Future<core::bool> async 
   return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test4() async => await getFutureNull(); // error
-                              ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                              ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
 static method test5() → asy::Future<core::bool>
   return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
  - 'Future' is from 'dart:async'.
@@ -92,9 +86,8 @@
   function test1() → asy::Future<core::bool> async 
     return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test1() async => await getNull(); // error
-                                ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                                ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
   function test2() → asy::Future<core::bool>
     return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<core::bool>;
   function test3() → core::bool
@@ -102,9 +95,8 @@
   function test4() → asy::Future<core::bool> async 
     return let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test4() async => await getFutureNull(); // error
-                                ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                                ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
   function test5() → asy::Future<core::bool>
     return let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
  - 'Future' is from 'dart:async'.
diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect
index a2acb2e..58e2737 100644
--- a/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.strong.transformed.expect
@@ -4,13 +4,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test1() async => await getNull(); // error
 //                               ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test4() async => await getFutureNull(); // error
 //                               ^
 //
@@ -21,13 +19,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test1() async => await getNull(); // error
 //                                 ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test4() async => await getFutureNull(); // error
 //                                 ^
 //
@@ -59,7 +55,7 @@
   return null;
 static method getFutureNull() → asy::Future<dynamic> /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -86,7 +82,7 @@
 }
 static method getFutureBool() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -113,7 +109,7 @@
 }
 static method test1() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -126,11 +122,10 @@
       {
         final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test1() async => await getNull(); // error
                               ^";
         [yield] let dynamic #t2 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null;
-        :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+        :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
         break #L3;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -151,7 +146,7 @@
   return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
 static method test4() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -164,11 +159,10 @@
       {
         final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test4() async => await getFutureNull(); // error
                               ^";
         [yield] let dynamic #t4 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null;
-        :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+        :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
         break #L4;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -192,7 +186,7 @@
   return self::getFutureBool();
 static method test7() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -219,7 +213,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -231,7 +225,7 @@
       {
         function test1() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -244,11 +238,10 @@
               {
                 final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test1() async => await getNull(); // error
                                 ^";
                 [yield] let dynamic #t7 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null;
-                :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
                 break #L7;
               }
               asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -269,7 +262,7 @@
           return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
         function test4() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -282,11 +275,10 @@
               {
                 final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test4() async => await getFutureNull(); // error
                                 ^";
                 [yield] let dynamic #t9 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null;
-                :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
                 break #L8;
               }
               asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -310,7 +302,7 @@
           return self::getFutureBool();
         function test7() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -340,7 +332,7 @@
   Future<bool> var1 = (() async => await getNull())(); // error
                                                    ^" in (() → asy::Future<dynamic> /* originally async */ {
           final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-          asy::FutureOr<dynamic>? :return_value;
+          FutureOr<dynamic>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -374,7 +366,7 @@
   Future<bool> var4 = (() async => await getFutureNull())(); // error
                                                          ^" in (() → asy::Future<dynamic> /* originally async */ {
           final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-          asy::FutureOr<dynamic>? :return_value;
+          FutureOr<dynamic>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -408,7 +400,7 @@
         asy::Future<core::bool> var6 = (() → asy::Future<core::bool> => self::getFutureBool()).call();
         asy::Future<core::bool> var7 = (() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect
index 9f84dd0..2864cb5 100644
--- a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.expect
@@ -4,13 +4,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test1() async => await getNull(); // error
 //                               ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test4() async => await getFutureNull(); // error
 //                               ^
 //
@@ -21,13 +19,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test1() async => await getNull(); // error
 //                                 ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test4() async => await getFutureNull(); // error
 //                                 ^
 //
@@ -66,9 +62,8 @@
 static method test1() → asy::Future<core::bool> async 
   return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test1() async => await getNull(); // error
-                              ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                              ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
 static method test2() → asy::Future<core::bool>
   return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<core::bool>;
 static method test3() → core::bool
@@ -76,9 +71,8 @@
 static method test4() → asy::Future<core::bool> async 
   return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test4() async => await getFutureNull(); // error
-                              ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                              ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
 static method test5() → asy::Future<core::bool>
   return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:18:25: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
  - 'Future' is from 'dart:async'.
@@ -92,9 +86,8 @@
   function test1() → asy::Future<core::bool> async 
     return let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test1() async => await getNull(); // error
-                                ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                                ^" in await self::getNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
   function test2() → asy::Future<core::bool>
     return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} asy::Future<core::bool>;
   function test3() → core::bool
@@ -102,9 +95,8 @@
   function test4() → asy::Future<core::bool> async 
     return let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test4() async => await getFutureNull(); // error
-                                ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                                ^" in await self::getFutureNull() as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
   function test5() → asy::Future<core::bool>
     return let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:27:27: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'Future<bool>'.
  - 'Future' is from 'dart:async'.
diff --git a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect
index a2acb2e..58e2737 100644
--- a/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437a.dart.weak.transformed.expect
@@ -4,13 +4,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test1() async => await getNull(); // error
 //                               ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 // Future<bool> test4() async => await getFutureNull(); // error
 //                               ^
 //
@@ -21,13 +19,11 @@
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test1() async => await getNull(); // error
 //                                 ^
 //
 // pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
 //  - 'Future' is from 'dart:async'.
-//  - 'FutureOr' is from 'dart:async'.
 //   Future<bool> test4() async => await getFutureNull(); // error
 //                                 ^
 //
@@ -59,7 +55,7 @@
   return null;
 static method getFutureNull() → asy::Future<dynamic> /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -86,7 +82,7 @@
 }
 static method getFutureBool() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -113,7 +109,7 @@
 }
 static method test1() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -126,11 +122,10 @@
       {
         final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:14:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test1() async => await getNull(); // error
                               ^";
         [yield] let dynamic #t2 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null;
-        :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+        :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
         break #L3;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -151,7 +146,7 @@
   return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
 static method test4() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -164,11 +159,10 @@
       {
         final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:17:31: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
 Future<bool> test4() async => await getFutureNull(); // error
                               ^";
         [yield] let dynamic #t4 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null;
-        :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+        :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
         break #L4;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -192,7 +186,7 @@
   return self::getFutureBool();
 static method test7() → asy::Future<core::bool> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-  asy::FutureOr<core::bool>? :return_value;
+  FutureOr<core::bool>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -219,7 +213,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -231,7 +225,7 @@
       {
         function test1() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -244,11 +238,10 @@
               {
                 final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:23:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test1() async => await getNull(); // error
                                 ^";
                 [yield] let dynamic #t7 = asy::_awaitHelper(self::getNull(), :async_op_then, :async_op_error, :async_op) in null;
-                :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
                 break #L7;
               }
               asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -269,7 +262,7 @@
           return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
         function test4() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -282,11 +275,10 @@
               {
                 final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437a.dart:26:33: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<bool>'.
  - 'Future' is from 'dart:async'.
- - 'FutureOr' is from 'dart:async'.
   Future<bool> test4() async => await getFutureNull(); // error
                                 ^";
                 [yield] let dynamic #t9 = asy::_awaitHelper(self::getFutureNull(), :async_op_then, :async_op_error, :async_op) in null;
-                :return_value = :result as{TypeError,ForNonNullableByDefault} asy::FutureOr<core::bool>;
+                :return_value = :result as{TypeError,ForNonNullableByDefault} FutureOr<core::bool>;
                 break #L8;
               }
               asy::_completeOnAsyncReturn(:async_completer, :return_value);
@@ -310,7 +302,7 @@
           return self::getFutureBool();
         function test7() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -340,7 +332,7 @@
   Future<bool> var1 = (() async => await getNull())(); // error
                                                    ^" in (() → asy::Future<dynamic> /* originally async */ {
           final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-          asy::FutureOr<dynamic>? :return_value;
+          FutureOr<dynamic>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -374,7 +366,7 @@
   Future<bool> var4 = (() async => await getFutureNull())(); // error
                                                          ^" in (() → asy::Future<dynamic> /* originally async */ {
           final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-          asy::FutureOr<dynamic>? :return_value;
+          FutureOr<dynamic>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -408,7 +400,7 @@
         asy::Future<core::bool> var6 = (() → asy::Future<core::bool> => self::getFutureBool()).call();
         asy::Future<core::bool> var7 = (() → asy::Future<core::bool> /* originally async */ {
           final asy::_AsyncAwaitCompleter<core::bool> :async_completer = new asy::_AsyncAwaitCompleter::•<core::bool>();
-          asy::FutureOr<core::bool>? :return_value;
+          FutureOr<core::bool>? :return_value;
           dynamic :async_stack_trace;
           (dynamic) → dynamic :async_op_then;
           (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect
index 32e2663..17b627a 100644
--- a/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.strong.transformed.expect
@@ -139,7 +139,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect
index 32e2663..17b627a 100644
--- a/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437b.dart.weak.transformed.expect
@@ -139,7 +139,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect
index cf1bf6a..06f62bb 100644
--- a/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.strong.transformed.expect
@@ -234,7 +234,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect
index cf1bf6a..06f62bb 100644
--- a/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41437c.dart.weak.transformed.expect
@@ -234,7 +234,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect
index 40f6682..303fbeb 100644
--- a/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41602.dart.strong.transformed.expect
@@ -17,7 +17,7 @@
 
 static method returnFutureOfVoid() → asy::Future<void> /* originally async */ {
   final asy::_AsyncAwaitCompleter<void> :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
-  asy::FutureOr<void>? :return_value;
+  FutureOr<void>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -42,7 +42,7 @@
 static method returnVoid() → void {}
 static method returnVoidAsync() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -66,7 +66,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -96,7 +96,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect
index 40f6682..303fbeb 100644
--- a/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue41602.dart.weak.transformed.expect
@@ -17,7 +17,7 @@
 
 static method returnFutureOfVoid() → asy::Future<void> /* originally async */ {
   final asy::_AsyncAwaitCompleter<void> :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
-  asy::FutureOr<void>? :return_value;
+  FutureOr<void>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -42,7 +42,7 @@
 static method returnVoid() → void {}
 static method returnVoidAsync() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -66,7 +66,7 @@
 }
 static method test() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -96,7 +96,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart b/pkg/front_end/testcases/nnbd/issue41697.dart
new file mode 100644
index 0000000..726edd9
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+typedef G<T> = void Function<S extends T>(S);
+typedef H<T> = void Function<S extends FutureOr<T>>(S, FutureOr<T>);
+// TODO(johnniwinther): Enable and use these when #41951 is fixed to test that
+//  updating self referencing type parameters works.
+//typedef I<T> = void Function<S extends FutureOr<S>>(S, T);
+//typedef J<T> = void Function<S extends FutureOr<S>?>(S, T);
+//typedef K<T> = void Function<S extends FutureOr<S?>>(S, T);
+
+class C<T> {
+  G<T> field1;
+  H<T> field2;
+
+  C(this.field1, this.field2);
+}
+
+test1(C<num> c) {
+  var f1 = c.field1 = <S extends num>(S s) {
+    return s + 1; // ok
+  };
+  var f2 = c.field2 = <S extends FutureOr<num>>(S s, FutureOr<num> t) async {
+    return (await t) + 1; // ok
+  };
+}
+
+test2(C<num?> c) {
+  var f1 = c.field1 = <S extends num?>(S s) {
+    return s + 1; // error
+  };
+  var f2 = c.field2 = <S extends FutureOr<num?>>(S s, FutureOr<num?> t) async {
+    return (await t) + 1; // error
+  };
+}
+
+test3<S extends num?>(S s) => s + 1; // error
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.outline.expect
new file mode 100644
index 0000000..f8add27
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.outline.expect
@@ -0,0 +1,22 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+import "dart:async";
+
+typedef G<invariant T extends core::Object? = dynamic> = <S extends T% = dynamic>(S%) → void;
+typedef H<invariant T extends core::Object? = dynamic> = <S extends FutureOr<T%> = dynamic>(S%, FutureOr<T%>) → void;
+class C<T extends core::Object? = dynamic> extends core::Object {
+  generic-covariant-impl field <S extends self::C::T% = dynamic>(S%) → void field1;
+  generic-covariant-impl field <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2;
+  constructor •(<S extends self::C::T% = dynamic>(S%) → void field1, <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2) → self::C<self::C::T%>
+    ;
+}
+static method test1(self::C<core::num> c) → dynamic
+  ;
+static method test2(self::C<core::num?> c) → dynamic
+  ;
+static method test3<S extends core::num? = core::num?>(self::test3::S% s) → dynamic
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.strong.expect
new file mode 100644
index 0000000..1d85ea2
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.strong.expect
@@ -0,0 +1,56 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//     return s + 1; // error
+//              ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+//     return (await t) + 1; // error
+//                      ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+// test3<S extends num?>(S s) => s + 1; // error
+//                                 ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+import "dart:async";
+
+typedef G<invariant T extends core::Object? = dynamic> = <S extends T% = dynamic>(S%) → void;
+typedef H<invariant T extends core::Object? = dynamic> = <S extends FutureOr<T%> = dynamic>(S%, FutureOr<T%>) → void;
+class C<T extends core::Object? = dynamic> extends core::Object {
+  generic-covariant-impl field <S extends self::C::T% = dynamic>(S%) → void field1;
+  generic-covariant-impl field <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2;
+  constructor •(<S extends self::C::T% = dynamic>(S%) → void field1, <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2) → self::C<self::C::T%>
+    : self::C::field1 = field1, self::C::field2 = field2, super core::Object::•()
+    ;
+}
+static method test1(self::C<core::num> c) → dynamic {
+  <S extends core::num = core::num>(S) → core::num f1 = c.{self::C::field1} = <S extends core::num = core::num>(S s) → core::num {
+    return s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num> = FutureOr<core::num>>(S, FutureOr<core::num>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num> = FutureOr<core::num>>(S s, FutureOr<core::num>t) → asy::Future<core::num> async {
+    return (await t).{core::num::+}(1);
+  };
+}
+static method test2(self::C<core::num?> c) → dynamic {
+  <S extends core::num? = core::num?>(S%) → core::num f1 = c.{self::C::field1} = <S extends core::num? = core::num?>(S% s) → core::num {
+    return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+    return s + 1; // error
+             ^" in s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S%, FutureOr<core::num?>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S% s, FutureOr<core::num?>t) → asy::Future<core::num> async {
+    return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+    return (await t) + 1; // error
+                     ^" in (await t).{core::num::+}(1);
+  };
+}
+static method test3<S extends core::num? = core::num?>(self::test3::S% s) → dynamic
+  return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+test3<S extends num?>(S s) => s + 1; // error
+                                ^" in s.{core::num::+}(1);
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect
new file mode 100644
index 0000000..6179e4f
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.strong.transformed.expect
@@ -0,0 +1,110 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//     return s + 1; // error
+//              ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+//     return (await t) + 1; // error
+//                      ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+// test3<S extends num?>(S s) => s + 1; // error
+//                                 ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+import "dart:_internal" as _in;
+
+import "dart:async";
+
+typedef G<invariant T extends core::Object? = dynamic> = <S extends T% = dynamic>(S%) → void;
+typedef H<invariant T extends core::Object? = dynamic> = <S extends FutureOr<T%> = dynamic>(S%, FutureOr<T%>) → void;
+class C<T extends core::Object? = dynamic> extends core::Object {
+  generic-covariant-impl field <S extends self::C::T% = dynamic>(S%) → void field1;
+  generic-covariant-impl field <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2;
+  constructor •(<S extends self::C::T% = dynamic>(S%) → void field1, <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2) → self::C<self::C::T%>
+    : self::C::field1 = field1, self::C::field2 = field2, super core::Object::•()
+    ;
+}
+static method test1(self::C<core::num> c) → dynamic {
+  <S extends core::num = core::num>(S) → core::num f1 = c.{self::C::field1} = <S extends core::num = core::num>(S s) → core::num {
+    return s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num> = FutureOr<core::num>>(S, FutureOr<core::num>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num> = FutureOr<core::num>>(S s, FutureOr<core::num>t) → asy::Future<core::num> /* originally async */ {
+    final asy::_AsyncAwaitCompleter<core::num> :async_completer = new asy::_AsyncAwaitCompleter::•<core::num>();
+    FutureOr<core::num>? :return_value;
+    dynamic :async_stack_trace;
+    (dynamic) → dynamic :async_op_then;
+    (core::Object, core::StackTrace) → dynamic :async_op_error;
+    core::int :await_jump_var = 0;
+    dynamic :await_ctx_var;
+    dynamic :saved_try_context_var0;
+    function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding 
+      try {
+        #L1:
+        {
+          [yield] let dynamic #t1 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null;
+          :return_value = _in::unsafeCast<core::num>(:result).{core::num::+}(1);
+          break #L1;
+        }
+        asy::_completeOnAsyncReturn(:async_completer, :return_value);
+        return;
+      }
+      on dynamic catch(dynamic exception, core::StackTrace stack_trace) {
+        :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+      }
+    :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+    :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+    :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+    :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+    return :async_completer.{asy::Completer::future};
+  };
+}
+static method test2(self::C<core::num?> c) → dynamic {
+  <S extends core::num? = core::num?>(S%) → core::num f1 = c.{self::C::field1} = <S extends core::num? = core::num?>(S% s) → core::num {
+    return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+    return s + 1; // error
+             ^" in s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S%, FutureOr<core::num?>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S% s, FutureOr<core::num?>t) → asy::Future<core::num> /* originally async */ {
+    final asy::_AsyncAwaitCompleter<core::num> :async_completer = new asy::_AsyncAwaitCompleter::•<core::num>();
+    FutureOr<core::num>? :return_value;
+    dynamic :async_stack_trace;
+    (dynamic) → dynamic :async_op_then;
+    (core::Object, core::StackTrace) → dynamic :async_op_error;
+    core::int :await_jump_var = 0;
+    dynamic :await_ctx_var;
+    dynamic :saved_try_context_var0;
+    function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding 
+      try {
+        #L2:
+        {
+          final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+    return (await t) + 1; // error
+                     ^";
+          [yield] let dynamic #t4 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null;
+          :return_value = _in::unsafeCast<core::num?>(:result).{core::num::+}(1);
+          break #L2;
+        }
+        asy::_completeOnAsyncReturn(:async_completer, :return_value);
+        return;
+      }
+      on dynamic catch(dynamic exception, core::StackTrace stack_trace) {
+        :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+      }
+    :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+    :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+    :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+    :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+    return :async_completer.{asy::Completer::future};
+  };
+}
+static method test3<S extends core::num? = core::num?>(self::test3::S% s) → dynamic
+  return let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+test3<S extends num?>(S s) => s + 1; // error
+                                ^" in s.{core::num::+}(1);
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.textual_outline.expect
new file mode 100644
index 0000000..12ddfd2
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.textual_outline.expect
@@ -0,0 +1,15 @@
+import 'dart:async';
+
+typedef G<T> = void Function<S extends T>(S);
+typedef H<T> = void Function<S extends FutureOr<T>>(S, FutureOr<T>);
+
+class C<T> {
+  G<T> field1;
+  H<T> field2;
+  C(this.field1, this.field2);
+}
+
+test1(C<num> c) {}
+test2(C<num?> c) {}
+test3<S extends num?>(S s) => s + 1;
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..7db15d5
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.textual_outline_modelled.expect
@@ -0,0 +1,14 @@
+import 'dart:async';
+
+class C<T> {
+  C(this.field1, this.field2);
+  G<T> field1;
+  H<T> field2;
+}
+
+main() {}
+test1(C<num> c) {}
+test2(C<num?> c) {}
+test3<S extends num?>(S s) => s + 1;
+typedef G<T> = void Function<S extends T>(S);
+typedef H<T> = void Function<S extends FutureOr<T>>(S, FutureOr<T>);
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.weak.expect
new file mode 100644
index 0000000..1d85ea2
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.weak.expect
@@ -0,0 +1,56 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//     return s + 1; // error
+//              ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+//     return (await t) + 1; // error
+//                      ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+// test3<S extends num?>(S s) => s + 1; // error
+//                                 ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+
+import "dart:async";
+
+typedef G<invariant T extends core::Object? = dynamic> = <S extends T% = dynamic>(S%) → void;
+typedef H<invariant T extends core::Object? = dynamic> = <S extends FutureOr<T%> = dynamic>(S%, FutureOr<T%>) → void;
+class C<T extends core::Object? = dynamic> extends core::Object {
+  generic-covariant-impl field <S extends self::C::T% = dynamic>(S%) → void field1;
+  generic-covariant-impl field <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2;
+  constructor •(<S extends self::C::T% = dynamic>(S%) → void field1, <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2) → self::C<self::C::T%>
+    : self::C::field1 = field1, self::C::field2 = field2, super core::Object::•()
+    ;
+}
+static method test1(self::C<core::num> c) → dynamic {
+  <S extends core::num = core::num>(S) → core::num f1 = c.{self::C::field1} = <S extends core::num = core::num>(S s) → core::num {
+    return s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num> = FutureOr<core::num>>(S, FutureOr<core::num>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num> = FutureOr<core::num>>(S s, FutureOr<core::num>t) → asy::Future<core::num> async {
+    return (await t).{core::num::+}(1);
+  };
+}
+static method test2(self::C<core::num?> c) → dynamic {
+  <S extends core::num? = core::num?>(S%) → core::num f1 = c.{self::C::field1} = <S extends core::num? = core::num?>(S% s) → core::num {
+    return let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+    return s + 1; // error
+             ^" in s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S%, FutureOr<core::num?>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S% s, FutureOr<core::num?>t) → asy::Future<core::num> async {
+    return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+    return (await t) + 1; // error
+                     ^" in (await t).{core::num::+}(1);
+  };
+}
+static method test3<S extends core::num? = core::num?>(self::test3::S% s) → dynamic
+  return let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+test3<S extends num?>(S s) => s + 1; // error
+                                ^" in s.{core::num::+}(1);
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect
new file mode 100644
index 0000000..6179e4f
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697.dart.weak.transformed.expect
@@ -0,0 +1,110 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//     return s + 1; // error
+//              ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+//     return (await t) + 1; // error
+//                      ^
+//
+// pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+// test3<S extends num?>(S s) => s + 1; // error
+//                                 ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:async" as asy;
+import "dart:_internal" as _in;
+
+import "dart:async";
+
+typedef G<invariant T extends core::Object? = dynamic> = <S extends T% = dynamic>(S%) → void;
+typedef H<invariant T extends core::Object? = dynamic> = <S extends FutureOr<T%> = dynamic>(S%, FutureOr<T%>) → void;
+class C<T extends core::Object? = dynamic> extends core::Object {
+  generic-covariant-impl field <S extends self::C::T% = dynamic>(S%) → void field1;
+  generic-covariant-impl field <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2;
+  constructor •(<S extends self::C::T% = dynamic>(S%) → void field1, <S extends FutureOr<self::C::T%> = dynamic>(S%, FutureOr<self::C::T%>) → void field2) → self::C<self::C::T%>
+    : self::C::field1 = field1, self::C::field2 = field2, super core::Object::•()
+    ;
+}
+static method test1(self::C<core::num> c) → dynamic {
+  <S extends core::num = core::num>(S) → core::num f1 = c.{self::C::field1} = <S extends core::num = core::num>(S s) → core::num {
+    return s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num> = FutureOr<core::num>>(S, FutureOr<core::num>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num> = FutureOr<core::num>>(S s, FutureOr<core::num>t) → asy::Future<core::num> /* originally async */ {
+    final asy::_AsyncAwaitCompleter<core::num> :async_completer = new asy::_AsyncAwaitCompleter::•<core::num>();
+    FutureOr<core::num>? :return_value;
+    dynamic :async_stack_trace;
+    (dynamic) → dynamic :async_op_then;
+    (core::Object, core::StackTrace) → dynamic :async_op_error;
+    core::int :await_jump_var = 0;
+    dynamic :await_ctx_var;
+    dynamic :saved_try_context_var0;
+    function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding 
+      try {
+        #L1:
+        {
+          [yield] let dynamic #t1 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null;
+          :return_value = _in::unsafeCast<core::num>(:result).{core::num::+}(1);
+          break #L1;
+        }
+        asy::_completeOnAsyncReturn(:async_completer, :return_value);
+        return;
+      }
+      on dynamic catch(dynamic exception, core::StackTrace stack_trace) {
+        :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+      }
+    :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+    :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+    :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+    :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+    return :async_completer.{asy::Completer::future};
+  };
+}
+static method test2(self::C<core::num?> c) → dynamic {
+  <S extends core::num? = core::num?>(S%) → core::num f1 = c.{self::C::field1} = <S extends core::num? = core::num?>(S% s) → core::num {
+    return let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:33:14: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+    return s + 1; // error
+             ^" in s.{core::num::+}(1);
+  };
+  <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S%, FutureOr<core::num?>) → asy::Future<core::num> f2 = c.{self::C::field2} = <S extends FutureOr<core::num?> = FutureOr<core::num?>>(S% s, FutureOr<core::num?>t) → asy::Future<core::num> /* originally async */ {
+    final asy::_AsyncAwaitCompleter<core::num> :async_completer = new asy::_AsyncAwaitCompleter::•<core::num>();
+    FutureOr<core::num>? :return_value;
+    dynamic :async_stack_trace;
+    (dynamic) → dynamic :async_op_then;
+    (core::Object, core::StackTrace) → dynamic :async_op_error;
+    core::int :await_jump_var = 0;
+    dynamic :await_ctx_var;
+    dynamic :saved_try_context_var0;
+    function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding 
+      try {
+        #L2:
+        {
+          final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:36:22: Error: Operator '+' cannot be called on 'num?' because it is potentially null.
+    return (await t) + 1; // error
+                     ^";
+          [yield] let dynamic #t4 = asy::_awaitHelper(t, :async_op_then, :async_op_error, :async_op) in null;
+          :return_value = _in::unsafeCast<core::num?>(:result).{core::num::+}(1);
+          break #L2;
+        }
+        asy::_completeOnAsyncReturn(:async_completer, :return_value);
+        return;
+      }
+      on dynamic catch(dynamic exception, core::StackTrace stack_trace) {
+        :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+      }
+    :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
+    :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
+    :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
+    :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+    return :async_completer.{asy::Completer::future};
+  };
+}
+static method test3<S extends core::num? = core::num?>(self::test3::S% s) → dynamic
+  return let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697.dart:40:33: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+test3<S extends num?>(S s) => s + 1; // error
+                                ^" in s.{core::num::+}(1);
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart b/pkg/front_end/testcases/nnbd/issue41697b.dart
new file mode 100644
index 0000000..8d8fb9f
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+test1<S extends num>(S s) {
+  var t = s + 1; // ok
+}
+
+test2<S extends num?>(S s) {
+  var t = s + 1; // error
+}
+
+test3<S extends int>(S s) {
+  var t = s + 1; // ok
+}
+
+test4<S extends int?>(S s) {
+  var t = s + 1; // error
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.outline.expect
new file mode 100644
index 0000000..f86a56b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.outline.expect
@@ -0,0 +1,14 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+static method test1<S extends core::num = core::num>(self::test1::S s) → dynamic
+  ;
+static method test2<S extends core::num? = core::num?>(self::test2::S% s) → dynamic
+  ;
+static method test3<S extends core::int = core::int>(self::test3::S s) → dynamic
+  ;
+static method test4<S extends core::int? = core::int?>(self::test4::S% s) → dynamic
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.strong.expect
new file mode 100644
index 0000000..4be6607
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.strong.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+import self as self;
+import "dart:core" as core;
+
+static method test1<S extends core::num = core::num>(self::test1::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test2<S extends core::num? = core::num?>(self::test2::S% s) → dynamic {
+  core::num t = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method test3<S extends core::int = core::int>(self::test3::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test4<S extends core::int? = core::int?>(self::test4::S% s) → dynamic {
+  core::num t = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.strong.transformed.expect
new file mode 100644
index 0000000..4be6607
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.strong.transformed.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+import self as self;
+import "dart:core" as core;
+
+static method test1<S extends core::num = core::num>(self::test1::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test2<S extends core::num? = core::num?>(self::test2::S% s) → dynamic {
+  core::num t = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method test3<S extends core::int = core::int>(self::test3::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test4<S extends core::int? = core::int?>(self::test4::S% s) → dynamic {
+  core::num t = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.textual_outline.expect
new file mode 100644
index 0000000..bb7a9cf
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.textual_outline.expect
@@ -0,0 +1,5 @@
+test1<S extends num>(S s) {}
+test2<S extends num?>(S s) {}
+test3<S extends int>(S s) {}
+test4<S extends int?>(S s) {}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..bd48016
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.textual_outline_modelled.expect
@@ -0,0 +1,5 @@
+main() {}
+test1<S extends num>(S s) {}
+test2<S extends num?>(S s) {}
+test3<S extends int>(S s) {}
+test4<S extends int?>(S s) {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.weak.expect
new file mode 100644
index 0000000..4be6607
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.weak.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+import self as self;
+import "dart:core" as core;
+
+static method test1<S extends core::num = core::num>(self::test1::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test2<S extends core::num? = core::num?>(self::test2::S% s) → dynamic {
+  core::num t = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method test3<S extends core::int = core::int>(self::test3::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test4<S extends core::int? = core::int?>(self::test4::S% s) → dynamic {
+  core::num t = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue41697b.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue41697b.dart.weak.transformed.expect
new file mode 100644
index 0000000..4be6607
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41697b.dart.weak.transformed.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+// pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+//   var t = s + 1; // error
+//             ^
+//
+import self as self;
+import "dart:core" as core;
+
+static method test1<S extends core::num = core::num>(self::test1::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test2<S extends core::num? = core::num?>(self::test2::S% s) → dynamic {
+  core::num t = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method test3<S extends core::int = core::int>(self::test3::S s) → dynamic {
+  core::num t = s.{core::num::+}(1);
+}
+static method test4<S extends core::int? = core::int?>(self::test4::S% s) → dynamic {
+  core::num t = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null.
+  var t = s + 1; // error
+            ^" in s.{core::num::+}(1);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart b/pkg/front_end/testcases/nnbd/issue42143.dart
new file mode 100644
index 0000000..a711b13
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart
@@ -0,0 +1,6 @@
+import 'dart:async';
+
+void h1<T extends FutureOr<T?>?>(T? t) {}
+void h2<S extends FutureOr<S?>>(S? s) {}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.outline.expect
new file mode 100644
index 0000000..a3735a1
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.outline.expect
@@ -0,0 +1,11 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "dart:async";
+
+static method h1<T extends FutureOr<self::h1::T?>? = FutureOr<dynamic>?>(self::h1::T? t) → void
+  ;
+static method h2<S extends FutureOr<self::h2::S?> = FutureOr<dynamic>>(self::h2::S? s) → void
+  ;
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.strong.expect
new file mode 100644
index 0000000..dd9388c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.strong.expect
@@ -0,0 +1,8 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "dart:async";
+
+static method h1<T extends FutureOr<self::h1::T?>? = FutureOr<dynamic>?>(self::h1::T? t) → void {}
+static method h2<S extends FutureOr<self::h2::S?> = FutureOr<dynamic>>(self::h2::S? s) → void {}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.strong.transformed.expect
new file mode 100644
index 0000000..dd9388c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.strong.transformed.expect
@@ -0,0 +1,8 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "dart:async";
+
+static method h1<T extends FutureOr<self::h1::T?>? = FutureOr<dynamic>?>(self::h1::T? t) → void {}
+static method h2<S extends FutureOr<self::h2::S?> = FutureOr<dynamic>>(self::h2::S? s) → void {}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.textual_outline.expect
new file mode 100644
index 0000000..ea78e47
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.textual_outline.expect
@@ -0,0 +1,5 @@
+import 'dart:async';
+
+void h1<T extends FutureOr<T?>?>(T? t) {}
+void h2<S extends FutureOr<S?>>(S? s) {}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..993350a
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.textual_outline_modelled.expect
@@ -0,0 +1,5 @@
+import 'dart:async';
+
+main() {}
+void h1<T extends FutureOr<T?>?>(T? t) {}
+void h2<S extends FutureOr<S?>>(S? s) {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.weak.expect
new file mode 100644
index 0000000..dd9388c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.weak.expect
@@ -0,0 +1,8 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "dart:async";
+
+static method h1<T extends FutureOr<self::h1::T?>? = FutureOr<dynamic>?>(self::h1::T? t) → void {}
+static method h2<S extends FutureOr<self::h2::S?> = FutureOr<dynamic>>(self::h2::S? s) → void {}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue42143.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue42143.dart.weak.transformed.expect
new file mode 100644
index 0000000..dd9388c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42143.dart.weak.transformed.expect
@@ -0,0 +1,8 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+import "dart:async";
+
+static method h1<T extends FutureOr<self::h1::T?>? = FutureOr<dynamic>?>(self::h1::T? t) → void {}
+static method h2<S extends FutureOr<self::h2::S?> = FutureOr<dynamic>>(self::h2::S? s) → void {}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect
index 8763bcb..37d882a 100644
--- a/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/later.dart.strong.transformed.expect
@@ -125,7 +125,7 @@
 }
 static method hest() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -180,7 +180,7 @@
 }
 static method fisk() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -203,7 +203,7 @@
         function #f#initializer() → core::Function
           return () → asy::Future<dynamic> /* originally async */ {
             final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-            asy::FutureOr<dynamic>? :return_value;
+            FutureOr<dynamic>? :return_value;
             dynamic :async_stack_trace;
             (dynamic) → dynamic :async_op_then;
             (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect
index 8763bcb..37d882a 100644
--- a/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/later.dart.weak.transformed.expect
@@ -125,7 +125,7 @@
 }
 static method hest() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -180,7 +180,7 @@
 }
 static method fisk() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -203,7 +203,7 @@
         function #f#initializer() → core::Function
           return () → asy::Future<dynamic> /* originally async */ {
             final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-            asy::FutureOr<dynamic>? :return_value;
+            FutureOr<dynamic>? :return_value;
             dynamic :async_stack_trace;
             (dynamic) → dynamic :async_op_then;
             (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.outline.expect b/pkg/front_end/testcases/nnbd/return_null.dart.outline.expect
index 94a68bd..db5d4bcf 100644
--- a/pkg/front_end/testcases/nnbd/return_null.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/return_null.dart.outline.expect
@@ -25,11 +25,11 @@
   ;
 static method returnAsync1() → asy::Future<dynamic>
   ;
-static method returnAsync2() → asy::FutureOr<dynamic>
+static method returnAsync2() → FutureOr<dynamic>
   ;
-static method returnAsync3() → asy::FutureOr<core::int>
+static method returnAsync3() → FutureOr<core::int>
   ;
-static method returnAsync4() → asy::FutureOr<core::int?>
+static method returnAsync4() → FutureOr<core::int?>
   ;
 static method returnAsync5() → dynamic
   ;
diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect b/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect
index f5bbf44..b9743eb 100644
--- a/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/return_null.dart.strong.expect
@@ -98,13 +98,13 @@
        ^" in null;
 }
 static method returnAsync1() → asy::Future<dynamic> async {}
-static method returnAsync2() → asy::FutureOr<dynamic> async {}
-static method returnAsync3() → asy::FutureOr<core::int> async {
+static method returnAsync2() → FutureOr<dynamic> async {}
+static method returnAsync3() → FutureOr<core::int> async {
   return let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:27:15: Error: A non-null value must be returned since the return type 'int' doesn't allow null.
 FutureOr<int> returnAsync3() async {} // error
               ^" in null;
 }
-static method returnAsync4() → asy::FutureOr<core::int?> async {}
+static method returnAsync4() → FutureOr<core::int?> async {}
 static method returnAsync5() → dynamic async {}
 static method returnAsync6() → asy::Future<core::int?> async {
   return null;
@@ -167,13 +167,13 @@
   ^" in null;
   }
   function returnAsync1() → asy::Future<dynamic> async {}
-  function returnAsync2() → asy::FutureOr<dynamic> async {}
-  function returnAsync3() → asy::FutureOr<core::int> async {
+  function returnAsync2() → FutureOr<dynamic> async {}
+  function returnAsync3() → FutureOr<core::int> async {
     return let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:83:3: Error: A non-null value must be returned since the return type 'int' doesn't allow null.
   FutureOr<int> returnAsync3() async {} // error
   ^" in null;
   }
-  function returnAsync4() → asy::FutureOr<core::int?> async {}
+  function returnAsync4() → FutureOr<core::int?> async {}
   function returnAsync5() → asy::Future<core::Null?> async {}
   function returnAsync6() → asy::Future<core::int?> async {
     return null;
diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect
index 10abd90..e9cbf0c 100644
--- a/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/return_null.dart.strong.transformed.expect
@@ -99,7 +99,7 @@
 }
 static method returnAsync1() → asy::Future<dynamic> /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -121,9 +121,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method returnAsync2() → asy::FutureOr<dynamic> /* originally async */ {
+static method returnAsync2() → FutureOr<dynamic> /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -145,9 +145,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method returnAsync3() → asy::FutureOr<core::int> /* originally async */ {
+static method returnAsync3() → FutureOr<core::int> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int>();
-  asy::FutureOr<core::int>? :return_value;
+  FutureOr<core::int>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -174,9 +174,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method returnAsync4() → asy::FutureOr<core::int?> /* originally async */ {
+static method returnAsync4() → FutureOr<core::int?> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-  asy::FutureOr<core::int?>? :return_value;
+  FutureOr<core::int?>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -200,7 +200,7 @@
 }
 static method returnAsync5() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -224,7 +224,7 @@
 }
 static method returnAsync6() → asy::Future<core::int?> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-  asy::FutureOr<core::int?>? :return_value;
+  FutureOr<core::int?>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -251,7 +251,7 @@
 }
 static method returnAsync7() → asy::Future<core::int?> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-  asy::FutureOr<core::int?>? :return_value;
+  FutureOr<core::int?>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -368,7 +368,7 @@
   }
   function returnAsync1() → asy::Future<dynamic> /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>? :return_value;
+    FutureOr<dynamic>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -390,9 +390,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   }
-  function returnAsync2() → asy::FutureOr<dynamic> /* originally async */ {
+  function returnAsync2() → FutureOr<dynamic> /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>? :return_value;
+    FutureOr<dynamic>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -414,9 +414,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   }
-  function returnAsync3() → asy::FutureOr<core::int> /* originally async */ {
+  function returnAsync3() → FutureOr<core::int> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int>();
-    asy::FutureOr<core::int>? :return_value;
+    FutureOr<core::int>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -443,9 +443,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   }
-  function returnAsync4() → asy::FutureOr<core::int?> /* originally async */ {
+  function returnAsync4() → FutureOr<core::int?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-    asy::FutureOr<core::int?>? :return_value;
+    FutureOr<core::int?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -469,7 +469,7 @@
   }
   function returnAsync5() → asy::Future<core::Null?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::Null?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::Null?>();
-    asy::FutureOr<core::Null?>? :return_value;
+    FutureOr<core::Null?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -493,7 +493,7 @@
   }
   function returnAsync6() → asy::Future<core::int?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-    asy::FutureOr<core::int?>? :return_value;
+    FutureOr<core::int?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -520,7 +520,7 @@
   }
   function returnAsync7() → asy::Future<core::int?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-    asy::FutureOr<core::int?>? :return_value;
+    FutureOr<core::int?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect b/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect
index 397d54c..c0505b5 100644
--- a/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/return_null.dart.weak.expect
@@ -98,13 +98,13 @@
        ^" in null;
 }
 static method returnAsync1() → asy::Future<dynamic> async {}
-static method returnAsync2() → asy::FutureOr<dynamic> async {}
-static method returnAsync3() → asy::FutureOr<core::int> async {
+static method returnAsync2() → FutureOr<dynamic> async {}
+static method returnAsync3() → FutureOr<core::int> async {
   return let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:27:15: Error: A non-null value must be returned since the return type 'int' doesn't allow null.
 FutureOr<int> returnAsync3() async {} // error
               ^" in null;
 }
-static method returnAsync4() → asy::FutureOr<core::int?> async {}
+static method returnAsync4() → FutureOr<core::int?> async {}
 static method returnAsync5() → dynamic async {}
 static method returnAsync6() → asy::Future<core::int?> async {
   return null;
@@ -167,13 +167,13 @@
   ^" in null;
   }
   function returnAsync1() → asy::Future<dynamic> async {}
-  function returnAsync2() → asy::FutureOr<dynamic> async {}
-  function returnAsync3() → asy::FutureOr<core::int> async {
+  function returnAsync2() → FutureOr<dynamic> async {}
+  function returnAsync3() → FutureOr<core::int> async {
     return let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/return_null.dart:83:3: Error: A non-null value must be returned since the return type 'int' doesn't allow null.
   FutureOr<int> returnAsync3() async {} // error
   ^" in null;
   }
-  function returnAsync4() → asy::FutureOr<core::int?> async {}
+  function returnAsync4() → FutureOr<core::int?> async {}
   function returnAsync5() → asy::Future<core::Null?> async {}
   function returnAsync6() → asy::Future<core::int?> async {
     return null;
diff --git a/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect
index 418e161..755ad61 100644
--- a/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/return_null.dart.weak.transformed.expect
@@ -99,7 +99,7 @@
 }
 static method returnAsync1() → asy::Future<dynamic> /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -121,9 +121,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method returnAsync2() → asy::FutureOr<dynamic> /* originally async */ {
+static method returnAsync2() → FutureOr<dynamic> /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -145,9 +145,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method returnAsync3() → asy::FutureOr<core::int> /* originally async */ {
+static method returnAsync3() → FutureOr<core::int> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int>();
-  asy::FutureOr<core::int>? :return_value;
+  FutureOr<core::int>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -174,9 +174,9 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method returnAsync4() → asy::FutureOr<core::int?> /* originally async */ {
+static method returnAsync4() → FutureOr<core::int?> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-  asy::FutureOr<core::int?>? :return_value;
+  FutureOr<core::int?>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -200,7 +200,7 @@
 }
 static method returnAsync5() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>? :return_value;
+  FutureOr<dynamic>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -224,7 +224,7 @@
 }
 static method returnAsync6() → asy::Future<core::int?> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-  asy::FutureOr<core::int?>? :return_value;
+  FutureOr<core::int?>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -251,7 +251,7 @@
 }
 static method returnAsync7() → asy::Future<core::int?> /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-  asy::FutureOr<core::int?>? :return_value;
+  FutureOr<core::int?>? :return_value;
   dynamic :async_stack_trace;
   (dynamic) → dynamic :async_op_then;
   (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -368,7 +368,7 @@
   }
   function returnAsync1() → asy::Future<dynamic> /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>? :return_value;
+    FutureOr<dynamic>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -390,9 +390,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   }
-  function returnAsync2() → asy::FutureOr<dynamic> /* originally async */ {
+  function returnAsync2() → FutureOr<dynamic> /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>? :return_value;
+    FutureOr<dynamic>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -414,9 +414,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   }
-  function returnAsync3() → asy::FutureOr<core::int> /* originally async */ {
+  function returnAsync3() → FutureOr<core::int> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int>();
-    asy::FutureOr<core::int>? :return_value;
+    FutureOr<core::int>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -443,9 +443,9 @@
     :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
     return :async_completer.{asy::Completer::future};
   }
-  function returnAsync4() → asy::FutureOr<core::int?> /* originally async */ {
+  function returnAsync4() → FutureOr<core::int?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-    asy::FutureOr<core::int?>? :return_value;
+    FutureOr<core::int?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -469,7 +469,7 @@
   }
   function returnAsync5() → asy::Future<core::Null?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::Null?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::Null?>();
-    asy::FutureOr<core::Null?>? :return_value;
+    FutureOr<core::Null?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -493,7 +493,7 @@
   }
   function returnAsync6() → asy::Future<core::int?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-    asy::FutureOr<core::int?>? :return_value;
+    FutureOr<core::int?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
@@ -520,7 +520,7 @@
   }
   function returnAsync7() → asy::Future<core::int?> /* originally async */ {
     final asy::_AsyncAwaitCompleter<core::int?> :async_completer = new asy::_AsyncAwaitCompleter::•<core::int?>();
-    asy::FutureOr<core::int?>? :return_value;
+    FutureOr<core::int?>? :return_value;
     dynamic :async_stack_trace;
     (dynamic) → dynamic :async_op_then;
     (core::Object, core::StackTrace) → dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.expect b/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.expect
index 486b1e3..2a5dc83 100644
--- a/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 import "constant_null_is_lib.dart" as con;
 
 import "dart:async";
@@ -54,14 +53,14 @@
   self::expect(null is{ForNonNullableByDefault} core::Null?, #C2, "null is Null");
   self::expect(null is{ForNonNullableByDefault} Never?, #C2, "null is Never?");
   self::expect(null is{ForNonNullableByDefault} Never, #C3, "null is Never");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>, #C3, "null is FutureOr<int>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>, #C3, "null is FutureOr<Never>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>, #C3, "null is FutureOr<int>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>, #C3, "null is FutureOr<Never>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
   self::expect(new self::Class::constructor1<core::int>(null).{self::Class::field}, (#C4).{self::Class::field}, "Class<int>.constructor1(null).field");
   self::expect(true, new self::Class::constructor1<core::int?>(null).{self::Class::field}, "new Class<int?>.constructor1(null).field");
   self::expect(!self::isWeakMode, (#C4).{self::Class::field}, "const Class<int?>.constructor1(null).field");
diff --git a/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.transformed.expect
index 486b1e3..2a5dc83 100644
--- a/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd_mixed/constant_null_is.dart.weak.transformed.expect
@@ -1,7 +1,6 @@
 library /*isNonNullableByDefault*/;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 import "constant_null_is_lib.dart" as con;
 
 import "dart:async";
@@ -54,14 +53,14 @@
   self::expect(null is{ForNonNullableByDefault} core::Null?, #C2, "null is Null");
   self::expect(null is{ForNonNullableByDefault} Never?, #C2, "null is Never?");
   self::expect(null is{ForNonNullableByDefault} Never, #C3, "null is Never");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>, #C3, "null is FutureOr<int>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>, #C3, "null is FutureOr<Never>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
-  self::expect(null is{ForNonNullableByDefault} asy::FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int?>, #C2, "null is FutureOr<int?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>, #C3, "null is FutureOr<int>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::int>?, #C2, "null is FutureOr<int>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>, #C2, "null is FutureOr<Null>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<core::Null?>?, #C2, "null is FutureOr<Null>?");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>, #C3, "null is FutureOr<Never>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never?>, #C2, "null is FutureOr<Never?>");
+  self::expect(null is{ForNonNullableByDefault} FutureOr<Never>?, #C2, "null is FutureOr<Never>?");
   self::expect(new self::Class::constructor1<core::int>(null).{self::Class::field}, (#C4).{self::Class::field}, "Class<int>.constructor1(null).field");
   self::expect(true, new self::Class::constructor1<core::int?>(null).{self::Class::field}, "new Class<int?>.constructor1(null).field");
   self::expect(!self::isWeakMode, (#C4).{self::Class::field}, "const Class<int?>.constructor1(null).field");
diff --git a/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.expect b/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.expect
index b1a5732..2aeca98 100644
--- a/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.expect
@@ -1,12 +1,11 @@
 library /*isNonNullableByDefault*/;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 import "org-dartlang-testcase:///issue39666_lib.dart";
 
-class A<X extends asy::FutureOr<core::List<dynamic>> = asy::FutureOr<core::List<dynamic>>> extends core::Object {
+class A<X extends FutureOr<core::List<dynamic>> = FutureOr<core::List<dynamic>>> extends core::Object {
   synthetic constructor •() → self::A<self::A::X>
     : super core::Object::•()
     ;
@@ -15,12 +14,11 @@
 
 library;
 import self as self2;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 
-class A<X extends asy::FutureOr<core::List<dynamic>*>* = asy::FutureOr<core::List<dynamic>*>*> extends core::Object {
+class A<X extends FutureOr<core::List<dynamic>*>* = FutureOr<core::List<dynamic>*>*> extends core::Object {
   synthetic constructor •() → self2::A<self2::A::X*>*
     : super core::Object::•()
     ;
diff --git a/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.transformed.expect
index b1a5732..2aeca98 100644
--- a/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd_mixed/issue39666.dart.weak.transformed.expect
@@ -1,12 +1,11 @@
 library /*isNonNullableByDefault*/;
 import self as self;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 import "org-dartlang-testcase:///issue39666_lib.dart";
 
-class A<X extends asy::FutureOr<core::List<dynamic>> = asy::FutureOr<core::List<dynamic>>> extends core::Object {
+class A<X extends FutureOr<core::List<dynamic>> = FutureOr<core::List<dynamic>>> extends core::Object {
   synthetic constructor •() → self::A<self::A::X>
     : super core::Object::•()
     ;
@@ -15,12 +14,11 @@
 
 library;
 import self as self2;
-import "dart:async" as asy;
 import "dart:core" as core;
 
 import "dart:async";
 
-class A<X extends asy::FutureOr<core::List<dynamic>*>* = asy::FutureOr<core::List<dynamic>*>*> extends core::Object {
+class A<X extends FutureOr<core::List<dynamic>*>* = FutureOr<core::List<dynamic>*>*> extends core::Object {
   synthetic constructor •() → self2::A<self2::A::X*>*
     : super core::Object::•()
     ;
diff --git a/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect
index 5c57233..64235dc 100644
--- a/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd_mixed/issue41602.dart.weak.transformed.expect
@@ -6,7 +6,7 @@
 
 static method returnFutureOfVoid() → asy::Future<void>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<void>* :async_completer = new asy::_AsyncAwaitCompleter::•<void>();
-  asy::FutureOr<void>* :return_value;
+  FutureOr<void>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -31,7 +31,7 @@
 static method returnVoid() → void {}
 static method returnVoidAsync() → void /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -55,7 +55,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
index bcd8340..a524d96 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.expect
@@ -3,20 +3,17 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
 //   FutureOr<AAlias> foLegacyNonNullable = null; // error
 //                                          ^
 //
 // pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
 //   FutureOr<AAliasNonNullable> foNonNullable = null; // error
 //                                               ^
 //
 import self as self;
 import "issue41501_lib.dart" as opt;
-import "dart:async" as asy;
 
 import "dart:async";
 import "org-dartlang-testcase:///issue41501_lib.dart";
@@ -24,27 +21,24 @@
 typedef AAliasNonNullable = opt::A;
 typedef AAliasNullable = opt::A?;
 static method test() → dynamic {
-  asy::FutureOr<opt::A> foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
- - 'FutureOr' is from 'dart:async'.
+  FutureOr<opt::A>foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
   FutureOr<AAlias> foLegacyNonNullable = null; // error
-                                         ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
-  asy::FutureOr<opt::A?> foLegacyNullable = null;
-  asy::FutureOr<opt::A> foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
- - 'FutureOr' is from 'dart:async'.
+                                         ^" in null as{TypeError,ForNonNullableByDefault} FutureOr<opt::A>;
+  FutureOr<opt::A?>foLegacyNullable = null;
+  FutureOr<opt::A>foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
   FutureOr<AAliasNonNullable> foNonNullable = null; // error
-                                              ^" in null as{TypeError,ForNonNullableByDefault} asy::FutureOr<opt::A>;
-  asy::FutureOr<opt::A?> foNullable = null;
-  asy::FutureOr<opt::A?> foNonNullableNullable = null;
-  asy::FutureOr<opt::A?> foNullableNullable = null;
+                                              ^" in null as{TypeError,ForNonNullableByDefault} FutureOr<opt::A>;
+  FutureOr<opt::A?>foNullable = null;
+  FutureOr<opt::A?>foNonNullableNullable = null;
+  FutureOr<opt::A?>foNullableNullable = null;
 }
 static method main() → dynamic {}
 
 library opted_out_lib;
 import self as opt;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 import "org-dartlang-testcase:///issue41501.dart";
@@ -66,7 +60,7 @@
   abstract member-signature get runtimeType() → core::Type*;
 }
 static method test() → dynamic {
-  asy::FutureOr<opt::A*>* foLegacy = null;
-  asy::FutureOr<opt::A*>* foNonNullable = null;
-  asy::FutureOr<opt::A*>* foNullable = null;
+  FutureOr<opt::A*>* foLegacy = null;
+  FutureOr<opt::A*>* foNonNullable = null;
+  FutureOr<opt::A*>* foNullable = null;
 }
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
index 8b84923..bbac695 100644
--- a/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart.weak.transformed.expect
@@ -3,20 +3,17 @@
 // Problems in library:
 //
 // pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
 //   FutureOr<AAlias> foLegacyNonNullable = null; // error
 //                                          ^
 //
 // pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
 //   FutureOr<AAliasNonNullable> foNonNullable = null; // error
 //                                               ^
 //
 import self as self;
 import "issue41501_lib.dart" as opt;
-import "dart:async" as asy;
 
 import "dart:async";
 import "org-dartlang-testcase:///issue41501_lib.dart";
@@ -24,27 +21,24 @@
 typedef AAliasNonNullable = opt::A;
 typedef AAliasNullable = opt::A?;
 static method test() → dynamic {
-  asy::FutureOr<opt::A> foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
- - 'FutureOr' is from 'dart:async'.
+  FutureOr<opt::A>foLegacyNonNullable = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
   FutureOr<AAlias> foLegacyNonNullable = null; // error
                                          ^" in null;
-  asy::FutureOr<opt::A?> foLegacyNullable = null;
-  asy::FutureOr<opt::A> foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
- - 'FutureOr' is from 'dart:async'.
+  FutureOr<opt::A?>foLegacyNullable = null;
+  FutureOr<opt::A>foNonNullable = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: A value of type 'Null' can't be assigned to a variable of type 'FutureOr<A>'.
  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'.
   FutureOr<AAliasNonNullable> foNonNullable = null; // error
                                               ^" in null;
-  asy::FutureOr<opt::A?> foNullable = null;
-  asy::FutureOr<opt::A?> foNonNullableNullable = null;
-  asy::FutureOr<opt::A?> foNullableNullable = null;
+  FutureOr<opt::A?>foNullable = null;
+  FutureOr<opt::A?>foNonNullableNullable = null;
+  FutureOr<opt::A?>foNullableNullable = null;
 }
 static method main() → dynamic {}
 
 library opted_out_lib;
 import self as opt;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 import "org-dartlang-testcase:///issue41501.dart";
@@ -66,7 +60,7 @@
   abstract member-signature get runtimeType() → core::Type*;
 }
 static method test() → dynamic {
-  asy::FutureOr<opt::A*>* foLegacy = null;
-  asy::FutureOr<opt::A*>* foNonNullable = null;
-  asy::FutureOr<opt::A*>* foNullable = null;
+  FutureOr<opt::A*>* foLegacy = null;
+  FutureOr<opt::A*>* foNonNullable = null;
+  FutureOr<opt::A*>* foNullable = null;
 }
diff --git a/pkg/front_end/testcases/regress/issue_34850.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_34850.dart.strong.transformed.expect
index 26e9724..6413088 100644
--- a/pkg/front_end/testcases/regress/issue_34850.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_34850.dart.strong.transformed.expect
@@ -61,7 +61,7 @@
 static method Future<List extends core::Object* = dynamic>() → invalid-type {}
 static method f2() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -88,7 +88,7 @@
 }
 static method f3() → invalid-type /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -115,7 +115,7 @@
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/regress/issue_37681.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_37681.dart.strong.transformed.expect
index c48ca70..2382e0e 100644
--- a/pkg/front_end/testcases/regress/issue_37681.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_37681.dart.strong.transformed.expect
@@ -21,7 +21,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -37,7 +37,7 @@
       {
         function f_async() → core::int* /* originally async */ {
           final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-          asy::FutureOr<dynamic>* :return_value;
+          FutureOr<dynamic>* :return_value;
           dynamic :async_stack_trace;
           (dynamic) →* dynamic :async_op_then;
           (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.expect
index c5c9adf..baa9471 100644
--- a/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.expect
@@ -1,7 +1,6 @@
 library test;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -22,5 +21,5 @@
   abstract member-signature get runtimeType() → core::Type*;
 }
 static method main() → dynamic {
-  asy::FutureOr<() →* void>* x = let final self::C* #t1 = new self::C::•() in #t1.==(null) ?{() →* void} null : #t1.{self::C::call};
+  FutureOr<() →* void>* x = let final self::C* #t1 = new self::C::•() in #t1.==(null) ?{() →* void} null : #t1.{self::C::call};
 }
diff --git a/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.transformed.expect
index c5c9adf..baa9471 100644
--- a/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/call_method_implicit_tear_off_future_or.dart.strong.transformed.expect
@@ -1,7 +1,6 @@
 library test;
 import self as self;
 import "dart:core" as core;
-import "dart:async" as asy;
 
 import "dart:async";
 
@@ -22,5 +21,5 @@
   abstract member-signature get runtimeType() → core::Type*;
 }
 static method main() → dynamic {
-  asy::FutureOr<() →* void>* x = let final self::C* #t1 = new self::C::•() in #t1.==(null) ?{() →* void} null : #t1.{self::C::call};
+  FutureOr<() →* void>* x = let final self::C* #t1 = new self::C::•() in #t1.==(null) ?{() →* void} null : #t1.{self::C::call};
 }
diff --git a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.outline.expect b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.outline.expect
index b9db314..a7d30a3 100644
--- a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.outline.expect
+++ b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.outline.expect
@@ -19,13 +19,13 @@
   ;
 static method lhmfun() → asy::Future<col::LinkedHashMap<core::int*, core::bool*>*>*
   ;
-static method mapfun2() → asy::FutureOr<core::Map<core::int*, core::bool*>*>*
+static method mapfun2() → FutureOr<core::Map<core::int*, core::bool*>*>*
   ;
-static method setfun2() → asy::FutureOr<core::Set<core::int*>*>*
+static method setfun2() → FutureOr<core::Set<core::int*>*>*
   ;
-static method iterablefun2() → asy::FutureOr<core::Iterable<core::int*>*>*
+static method iterablefun2() → FutureOr<core::Iterable<core::int*>*>*
   ;
-static method lhsfun2() → asy::FutureOr<col::LinkedHashSet<core::int*>*>*
+static method lhsfun2() → FutureOr<col::LinkedHashSet<core::int*>*>*
   ;
-static method lhmfun2() → asy::FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*
+static method lhmfun2() → FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*
   ;
diff --git a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.expect b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.expect
index 11b9194..151f50a 100644
--- a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.expect
+++ b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.expect
@@ -34,14 +34,12 @@
 //
 // pkg/front_end/testcases/set_literals/disambiguation_rule.dart:38:43: Error: A value of type 'Set<dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashSet<int>>'.
 //  - 'Set' is from 'dart:core'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'LinkedHashSet' is from 'dart:collection'.
 // FutureOr<LinkedHashSet<int>> lhsfun2() => {};
 //                                           ^
 //
 // pkg/front_end/testcases/set_literals/disambiguation_rule.dart:39:49: Error: A value of type 'Map<dynamic, dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashMap<int, bool>>'.
 //  - 'Map' is from 'dart:core'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'LinkedHashMap' is from 'dart:collection'.
 // FutureOr<LinkedHashMap<int, bool>> lhmfun2() => {};
 //                                                 ^
@@ -103,23 +101,21 @@
 Change the type of the map literal or the context in which it is used.
 Future<LinkedHashMap<int, bool>> lhmfun() async => {};
                                                    ^" in <dynamic, dynamic>{};
-static method mapfun2() → asy::FutureOr<core::Map<core::int*, core::bool*>*>*
+static method mapfun2() → FutureOr<core::Map<core::int*, core::bool*>*>*
   return <core::int*, core::bool*>{};
-static method setfun2() → asy::FutureOr<core::Set<core::int*>*>*
+static method setfun2() → FutureOr<core::Set<core::int*>*>*
   return let final core::Set<core::int*>* #t11 = col::LinkedHashSet::•<core::int*>() in #t11;
-static method iterablefun2() → asy::FutureOr<core::Iterable<core::int*>*>*
+static method iterablefun2() → FutureOr<core::Iterable<core::int*>*>*
   return let final core::Set<core::int*>* #t12 = col::LinkedHashSet::•<core::int*>() in #t12;
-static method lhsfun2() → asy::FutureOr<col::LinkedHashSet<core::int*>*>*
+static method lhsfun2() → FutureOr<col::LinkedHashSet<core::int*>*>*
   return let final<BottomType> #t13 = invalid-expression "pkg/front_end/testcases/set_literals/disambiguation_rule.dart:38:43: Error: A value of type 'Set<dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashSet<int>>'.
  - 'Set' is from 'dart:core'.
- - 'FutureOr' is from 'dart:async'.
  - 'LinkedHashSet' is from 'dart:collection'.
 FutureOr<LinkedHashSet<int>> lhsfun2() => {};
-                                          ^" in (let final core::Set<dynamic>* #t14 = col::LinkedHashSet::•<dynamic>() in #t14) as{TypeError} asy::FutureOr<col::LinkedHashSet<core::int*>*>*;
-static method lhmfun2() → asy::FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*
+                                          ^" in (let final core::Set<dynamic>* #t14 = col::LinkedHashSet::•<dynamic>() in #t14) as{TypeError} FutureOr<col::LinkedHashSet<core::int*>*>*;
+static method lhmfun2() → FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*
   return let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/set_literals/disambiguation_rule.dart:39:49: Error: A value of type 'Map<dynamic, dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashMap<int, bool>>'.
  - 'Map' is from 'dart:core'.
- - 'FutureOr' is from 'dart:async'.
  - 'LinkedHashMap' is from 'dart:collection'.
 FutureOr<LinkedHashMap<int, bool>> lhmfun2() => {};
-                                                ^" in <dynamic, dynamic>{} as{TypeError} asy::FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*;
+                                                ^" in <dynamic, dynamic>{} as{TypeError} FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*;
diff --git a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.transformed.expect b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.transformed.expect
index 16c9b4b..c55d845 100644
--- a/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/set_literals/disambiguation_rule.dart.strong.transformed.expect
@@ -34,14 +34,12 @@
 //
 // pkg/front_end/testcases/set_literals/disambiguation_rule.dart:38:43: Error: A value of type 'Set<dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashSet<int>>'.
 //  - 'Set' is from 'dart:core'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'LinkedHashSet' is from 'dart:collection'.
 // FutureOr<LinkedHashSet<int>> lhsfun2() => {};
 //                                           ^
 //
 // pkg/front_end/testcases/set_literals/disambiguation_rule.dart:39:49: Error: A value of type 'Map<dynamic, dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashMap<int, bool>>'.
 //  - 'Map' is from 'dart:core'.
-//  - 'FutureOr' is from 'dart:async'.
 //  - 'LinkedHashMap' is from 'dart:collection'.
 // FutureOr<LinkedHashMap<int, bool>> lhmfun2() => {};
 //                                                 ^
@@ -57,7 +55,7 @@
 
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -118,7 +116,7 @@
 }
 static method mapfun() → asy::Future<core::Map<core::int*, core::bool*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::Map<core::int*, core::bool*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::Map<core::int*, core::bool*>*>();
-  asy::FutureOr<core::Map<core::int*, core::bool*>*>* :return_value;
+  FutureOr<core::Map<core::int*, core::bool*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -145,7 +143,7 @@
 }
 static method setfun() → asy::Future<core::Set<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::Set<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::Set<core::int*>*>();
-  asy::FutureOr<core::Set<core::int*>*>* :return_value;
+  FutureOr<core::Set<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -172,7 +170,7 @@
 }
 static method iterablefun() → asy::Future<core::Iterable<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<core::Iterable<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<core::Iterable<core::int*>*>();
-  asy::FutureOr<core::Iterable<core::int*>*>* :return_value;
+  FutureOr<core::Iterable<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -199,7 +197,7 @@
 }
 static method lhsfun() → asy::Future<col::LinkedHashSet<core::int*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<col::LinkedHashSet<core::int*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<col::LinkedHashSet<core::int*>*>();
-  asy::FutureOr<col::LinkedHashSet<core::int*>*>* :return_value;
+  FutureOr<col::LinkedHashSet<core::int*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -232,7 +230,7 @@
 }
 static method lhmfun() → asy::Future<col::LinkedHashMap<core::int*, core::bool*>*>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<col::LinkedHashMap<core::int*, core::bool*>*>* :async_completer = new asy::_AsyncAwaitCompleter::•<col::LinkedHashMap<core::int*, core::bool*>*>();
-  asy::FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>* :return_value;
+  FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -263,23 +261,21 @@
   :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
   return :async_completer.{asy::Completer::future};
 }
-static method mapfun2() → asy::FutureOr<core::Map<core::int*, core::bool*>*>*
+static method mapfun2() → FutureOr<core::Map<core::int*, core::bool*>*>*
   return <core::int*, core::bool*>{};
-static method setfun2() → asy::FutureOr<core::Set<core::int*>*>*
+static method setfun2() → FutureOr<core::Set<core::int*>*>*
   return let final core::Set<core::int*>* #t21 = col::LinkedHashSet::•<core::int*>() in #t21;
-static method iterablefun2() → asy::FutureOr<core::Iterable<core::int*>*>*
+static method iterablefun2() → FutureOr<core::Iterable<core::int*>*>*
   return let final core::Set<core::int*>* #t22 = col::LinkedHashSet::•<core::int*>() in #t22;
-static method lhsfun2() → asy::FutureOr<col::LinkedHashSet<core::int*>*>*
+static method lhsfun2() → FutureOr<col::LinkedHashSet<core::int*>*>*
   return let final<BottomType> #t23 = invalid-expression "pkg/front_end/testcases/set_literals/disambiguation_rule.dart:38:43: Error: A value of type 'Set<dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashSet<int>>'.
  - 'Set' is from 'dart:core'.
- - 'FutureOr' is from 'dart:async'.
  - 'LinkedHashSet' is from 'dart:collection'.
 FutureOr<LinkedHashSet<int>> lhsfun2() => {};
-                                          ^" in (let final core::Set<dynamic>* #t24 = col::LinkedHashSet::•<dynamic>() in #t24) as{TypeError} asy::FutureOr<col::LinkedHashSet<core::int*>*>*;
-static method lhmfun2() → asy::FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*
+                                          ^" in (let final core::Set<dynamic>* #t24 = col::LinkedHashSet::•<dynamic>() in #t24) as{TypeError} FutureOr<col::LinkedHashSet<core::int*>*>*;
+static method lhmfun2() → FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*
   return let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/set_literals/disambiguation_rule.dart:39:49: Error: A value of type 'Map<dynamic, dynamic>' can't be assigned to a variable of type 'FutureOr<LinkedHashMap<int, bool>>'.
  - 'Map' is from 'dart:core'.
- - 'FutureOr' is from 'dart:async'.
  - 'LinkedHashMap' is from 'dart:collection'.
 FutureOr<LinkedHashMap<int, bool>> lhmfun2() => {};
-                                                ^" in <dynamic, dynamic>{} as{TypeError} asy::FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*;
+                                                ^" in <dynamic, dynamic>{} as{TypeError} FutureOr<col::LinkedHashMap<core::int*, core::bool*>*>*;
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index 6fec5fe..e5a6a25 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -156,6 +156,7 @@
 late_lowering/override: FormatterCrash
 late_lowering/uninitialized_non_nullable_late_fields: FormatterCrash
 nnbd/covariant_late_field: FormatterCrash
+nnbd/extension_never: FormatterCrash
 nnbd/forbidden_supers: FormatterCrash
 nnbd/infer_if_null: FormatterCrash
 nnbd/inheritance_from_opt_in: FormatterCrash
diff --git a/pkg/front_end/tool/_fasta/bench_maker.dart b/pkg/front_end/tool/_fasta/bench_maker.dart
index f31999a..5ab2e3e 100644
--- a/pkg/front_end/tool/_fasta/bench_maker.dart
+++ b/pkg/front_end/tool/_fasta/bench_maker.dart
@@ -276,6 +276,14 @@
   }
 
   @override
+  void visitFutureOrType(FutureOrType node, StringBuffer sb) {
+    sb.write("FutureOr<");
+    node.typeArgument.accept1(this, sb);
+    sb.write(">");
+    writeNullability(node.declaredNullability, sb);
+  }
+
+  @override
   void visitFunctionType(FunctionType node, StringBuffer sb) {
     writeTypeParameters(node.typeParameters, sb);
     sb.write("(");
diff --git a/pkg/front_end/tool/_fasta/generate_experimental_flags.dart b/pkg/front_end/tool/_fasta/generate_experimental_flags.dart
index 8978f14..35fee30 100644
--- a/pkg/front_end/tool/_fasta/generate_experimental_flags.dart
+++ b/pkg/front_end/tool/_fasta/generate_experimental_flags.dart
@@ -37,7 +37,7 @@
 
 Uri computeAllowListFile() {
   return Platform.script
-      .resolve("../../../../sdk_nnbd/lib/_internal/allowed_experiments.json");
+      .resolve("../../../../sdk/lib/_internal/allowed_experiments.json");
 }
 
 String generateKernelFile() {
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index a7b7311..c0d3f99 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -82,15 +82,9 @@
 import 'type_algebra.dart';
 import 'type_environment.dart';
 import 'src/assumptions.dart';
+import 'src/printer.dart';
 import 'src/text_util.dart';
 
-/// Set this `true` to use fully qualified names in types for debugging.
-const bool _verboseTypeToString = false;
-
-/// Set this `true` to use fully qualified names in classes, extensions,
-/// typedefs and members for debugging.
-const bool _verboseMemberToString = false;
-
 /// Any type of node in the IR.
 abstract class Node {
   const Node();
@@ -115,7 +109,7 @@
   ///
   /// This method is called internally by toString methods to create conciser
   /// textual representations.
-  String toStringInternal();
+  String toStringInternal() => toText(defaultAstTextStrategy);
 
   /// Returns the textual representation of this node for use in debugging.
   ///
@@ -126,6 +120,14 @@
   /// Synthetic names are cached globally to retain consistency across different
   /// [leakingDebugToString] calls (hence the memory leak).
   String leakingDebugToString() => astToText.debugNodeToString(this);
+
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    toTextInternal(printer);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer);
 }
 
 /// A mutable AST node with a parent pointer.
@@ -633,8 +635,13 @@
 
   /// Returns a possibly synthesized name for this library, consistent with
   /// the names across all [toString] calls.
+  @override
   String toString() => libraryNameToString(this);
-  String toStringInternal() => libraryNameToString(this);
+
+  @override
+  void toTextInternal(AstPrinter printer) {
+    printer.write(libraryNameToString(this));
+  }
 
   Location _getLocationInEnclosingFile(int offset) {
     return _getLocationInComponent(enclosingComponent, fileUri, offset);
@@ -726,8 +733,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -764,8 +771,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -798,8 +805,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -875,9 +882,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return qualifiedTypedefNameToString(this,
-        includeLibraryName: _verboseMemberToString);
+  void toTextInternal(AstPrinter printer) {
+    printer.writeTypedefName(reference);
   }
 }
 
@@ -1388,16 +1394,13 @@
     return coreTypes.thisInterfaceType(this, nullability);
   }
 
-  /// Returns a possibly synthesized name for this class, consistent with
-  /// the names used across all [toString] calls.
-  // TODO(johnniwinther): Remove test dependencies on Class.toString();
   @override
-  String toString() =>
-      qualifiedClassNameToString(this, includeLibraryName: true);
+  String toString() => 'Class(${toStringInternal()})';
 
   @override
-  String toStringInternal() => qualifiedClassNameToString(this,
-      includeLibraryName: _verboseMemberToString);
+  void toTextInternal(AstPrinter printer) {
+    printer.writeClassName(reference);
+  }
 
   visitChildren(Visitor v) {
     visitList(annotations, v);
@@ -1502,9 +1505,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return qualifiedExtensionNameToString(this,
-        includeLibraryName: _verboseMemberToString);
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExtensionName(reference);
   }
 }
 
@@ -1670,8 +1672,9 @@
   String toString() => toStringInternal();
 
   @override
-  String toStringInternal() => qualifiedMemberNameToString(this,
-      includeLibraryName: _verboseMemberToString);
+  void toTextInternal(AstPrinter printer) {
+    printer.writeMemberName(reference);
+  }
 
   void addAnnotation(Expression node) {
     if (annotations.isEmpty) {
@@ -2468,8 +2471,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2519,8 +2522,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2571,8 +2574,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2619,8 +2622,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2654,8 +2657,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2683,8 +2686,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2842,8 +2845,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
@@ -2950,6 +2953,16 @@
 
   R accept<R>(ExpressionVisitor<R> v);
   R accept1<R, A>(ExpressionVisitor1<R, A> v, A arg);
+
+  int get precedence => astToText.Precedence.of(this);
+
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeExpression(this);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer);
 }
 
 /// An expression containing compile-time errors.
@@ -2978,8 +2991,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('<invalid:');
+    printer.write(message);
+    printer.write('>');
   }
 }
 
@@ -3014,8 +3029,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(printer.getVariableName(variable));
+    if (promotedType != null) {
+      printer.write('{');
+      printer.writeType(promotedType);
+      printer.write('}');
+    }
   }
 }
 
@@ -3054,8 +3074,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(printer.getVariableName(variable));
+    printer.write(' = ');
+    printer.writeExpression(value);
   }
 }
 
@@ -3124,8 +3146,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "${receiver.toStringInternal()}.${name.toStringInternal()}";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(receiver,
+        minimumPrecedence: astToText.Precedence.PRIMARY);
+    printer.write('.');
+    printer.writeInterfaceMemberName(interfaceTargetReference, name);
   }
 }
 
@@ -3189,8 +3214,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(receiver,
+        minimumPrecedence: astToText.Precedence.PRIMARY);
+    printer.write('.');
+    printer.writeInterfaceMemberName(interfaceTargetReference, name);
+    printer.write(' = ');
+    printer.writeExpression(value);
   }
 }
 
@@ -3212,6 +3242,8 @@
     targetReference = getMemberReference(target);
   }
 
+  Name get name => target?.name;
+
   visitChildren(Visitor v) {
     receiver?.accept(v);
     target?.acceptReference(v);
@@ -3241,8 +3273,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(receiver,
+        minimumPrecedence: astToText.Precedence.PRIMARY);
+    printer.write('.');
+    printer.writeInterfaceMemberName(targetReference, name);
   }
 }
 
@@ -3269,6 +3304,8 @@
     targetReference = getMemberReference(target);
   }
 
+  Name get name => target?.name;
+
   visitChildren(Visitor v) {
     receiver?.accept(v);
     target?.acceptReference(v);
@@ -3299,8 +3336,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(receiver,
+        minimumPrecedence: astToText.Precedence.PRIMARY);
+    printer.write('.');
+    printer.writeInterfaceMemberName(targetReference, name);
+    printer.write(' = ');
+    printer.writeExpression(value);
   }
 }
 
@@ -3370,8 +3412,12 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(receiver,
+        minimumPrecedence: astToText.Precedence.PRIMARY);
+    printer.write('.');
+    printer.writeInterfaceMemberName(targetReference, name);
+    printer.writeArguments(arguments);
   }
 }
 
@@ -3428,8 +3474,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('super.');
+    printer.writeInterfaceMemberName(interfaceTargetReference, name);
   }
 }
 
@@ -3484,8 +3531,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('super.');
+    printer.writeInterfaceMemberName(interfaceTargetReference, name);
+    printer.write(' = ');
+    printer.writeExpression(value);
   }
 }
 
@@ -3522,8 +3572,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeMemberName(targetReference);
   }
 }
 
@@ -3573,8 +3623,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeMemberName(targetReference);
+    printer.write(' = ');
+    printer.writeExpression(value);
   }
 }
 
@@ -3629,10 +3681,35 @@
     return "Arguments(${toStringInternal()})";
   }
 
-  @override
-  String toStringInternal() {
-    // TODO(jensj): Make (much) better.
-    return "";
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeArguments(this);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer, {bool includeTypeArguments: true}) {
+    if (includeTypeArguments) {
+      printer.writeTypeArguments(types);
+    }
+    printer.write('(');
+    for (int index = 0; index < positional.length; index++) {
+      if (index > 0) {
+        printer.write(', ');
+      }
+      printer.writeExpression(positional[index]);
+    }
+    if (named.isNotEmpty) {
+      if (positional.isNotEmpty) {
+        printer.write(', ');
+      }
+      for (int index = 0; index < named.length; index++) {
+        if (index > 0) {
+          printer.write(', ');
+        }
+        printer.writeNamedExpression(named[index]);
+      }
+    }
+    printer.write(')');
   }
 }
 
@@ -3663,9 +3740,16 @@
     return "NamedExpression(${toStringInternal()})";
   }
 
-  @override
-  String toStringInternal() {
-    return "";
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    toTextInternal(printer);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer) {
+    printer.write(name);
+    printer.write(': ');
+    printer.writeExpression(value);
   }
 }
 
@@ -3803,8 +3887,12 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(receiver,
+        minimumPrecedence: astToText.Precedence.PRIMARY);
+    printer.write('.');
+    printer.writeInterfaceMemberName(interfaceTargetReference, name);
+    printer.writeArguments(arguments);
   }
 }
 
@@ -3868,8 +3956,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('super.');
+    printer.writeInterfaceMemberName(interfaceTargetReference, name);
+    printer.writeArguments(arguments);
   }
 }
 
@@ -3929,9 +4019,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "${targetReference.toStringInternal()}, "
-        "${arguments.toStringInternal()}";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeMemberName(targetReference);
+    printer.writeArguments(arguments);
   }
 }
 
@@ -4007,8 +4097,19 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isConst) {
+      printer.write('const ');
+    } else {
+      printer.write('new ');
+    }
+    printer.writeClassName(target.enclosingClass.reference);
+    printer.writeTypeArguments(arguments.types);
+    if (target.name.name.isNotEmpty) {
+      printer.write('.');
+      printer.write(target.name.name);
+    }
+    printer.writeArguments(arguments, includeTypeArguments: false);
   }
 }
 
@@ -4050,8 +4151,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(expression);
+    printer.writeTypeArguments(typeArguments);
   }
 }
 
@@ -4089,8 +4191,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('!');
+    printer.writeExpression(operand,
+        minimumPrecedence: astToText.Precedence.PREFIX);
   }
 }
 
@@ -4134,8 +4238,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    int minimumPrecedence = precedence;
+    printer.writeExpression(left, minimumPrecedence: minimumPrecedence);
+    printer.write(' $operator ');
+    printer.writeExpression(right, minimumPrecedence: minimumPrecedence + 1);
   }
 }
 
@@ -4192,10 +4299,19 @@
   }
 
   @override
-  String toStringInternal() {
-    return "${condition.toStringInternal()} ? "
-        "${then.toStringInternal()} : "
-        "${otherwise.toStringInternal()}";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(condition,
+        minimumPrecedence: astToText.Precedence.LOGICAL_OR);
+    printer.write(' ?');
+    if (staticType != null) {
+      printer.write('{');
+      printer.writeType(staticType);
+      printer.write('}');
+    }
+    printer.write(' ');
+    printer.writeExpression(then);
+    printer.write(' : ');
+    printer.writeExpression(otherwise);
   }
 }
 
@@ -4234,8 +4350,18 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('"');
+    for (Expression part in expressions) {
+      if (part is StringLiteral) {
+        printer.write(escapeString(part.value));
+      } else {
+        printer.write(r'${');
+        printer.writeExpression(part);
+        printer.write('}');
+      }
+    }
+    printer.write('"');
   }
 }
 
@@ -4278,8 +4404,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    bool first = true;
+    for (Expression part in lists) {
+      if (!first) {
+        printer.write(' + ');
+      }
+      printer.writeExpression(part);
+      first = false;
+    }
   }
 }
 
@@ -4325,8 +4458,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    bool first = true;
+    for (Expression part in sets) {
+      if (!first) {
+        printer.write(' + ');
+      }
+      printer.writeExpression(part);
+      first = false;
+    }
   }
 }
 
@@ -4378,8 +4518,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    bool first = true;
+    for (Expression part in maps) {
+      if (!first) {
+        printer.write(' + ');
+      }
+      printer.writeExpression(part);
+      first = false;
+    }
   }
 }
 
@@ -4447,8 +4594,41 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeClassName(classReference);
+    printer.writeTypeArguments(typeArguments);
+    printer.write('{');
+    bool first = true;
+    fieldValues.forEach((Reference fieldRef, Expression value) {
+      if (!first) {
+        printer.write(', ');
+      }
+      printer.writeName(fieldRef.asField.name);
+      printer.write(': ');
+      printer.writeExpression(value);
+      first = false;
+    });
+    for (AssertStatement assert_ in asserts) {
+      if (!first) {
+        printer.write(', ');
+      }
+      printer.write('assert(');
+      printer.writeExpression(assert_.condition);
+      if (assert_.message != null) {
+        printer.write(', ');
+        printer.writeExpression(assert_.message);
+      }
+      printer.write(')');
+      first = false;
+    }
+    for (Expression unusedArgument in unusedArguments) {
+      if (!first) {
+        printer.write(', ');
+      }
+      printer.writeExpression(unusedArgument);
+      first = false;
+    }
+    printer.write('}');
   }
 }
 
@@ -4494,8 +4674,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (printer.includeAuxiliaryProperties) {
+      printer.write('{');
+      printer.write(fileUri.toString());
+      printer.write('}');
+    }
+    printer.writeExpression(expression);
   }
 }
 
@@ -4551,8 +4736,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(operand,
+        minimumPrecedence: astToText.Precedence.BITWISE_OR);
+    printer.write(' is');
+    if (printer.includeAuxiliaryProperties && isForNonNullableByDefault) {
+      printer.write('{ForNonNullableByDefault}');
+    }
+    printer.write(' ');
+    printer.writeType(type);
   }
 }
 
@@ -4653,8 +4845,30 @@
   }
 
   @override
-  String toStringInternal() {
-    return "${operand.toStringInternal()} as ${type.toStringInternal()}";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(operand,
+        minimumPrecedence: astToText.Precedence.BITWISE_OR);
+    printer.write(' as');
+    if (printer.includeAuxiliaryProperties) {
+      List<String> flags = <String>[];
+      if (isTypeError) {
+        flags.add('TypeError');
+      }
+      if (isCovarianceCheck) {
+        flags.add('CovarianceCheck');
+      }
+      if (isForDynamic) {
+        flags.add('ForDynamic');
+      }
+      if (isForNonNullableByDefault) {
+        flags.add('ForNonNullableByDefault');
+      }
+      if (flags.isNotEmpty) {
+        printer.write('{${flags.join(',')}}');
+      }
+    }
+    printer.write(' ');
+    printer.writeType(type);
   }
 }
 
@@ -4697,8 +4911,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(operand,
+        minimumPrecedence: astToText.Precedence.POSTFIX);
+    printer.write('!');
   }
 }
 
@@ -4728,8 +4944,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "$value";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('"');
+    printer.write(escapeString(value));
+    printer.write('"');
   }
 }
 
@@ -4755,8 +4973,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "$value";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('$value');
   }
 }
 
@@ -4778,8 +4996,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "$value";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('$value');
   }
 }
 
@@ -4801,8 +5019,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "$value";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('$value');
   }
 }
 
@@ -4822,8 +5040,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "null";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('null');
   }
 }
 
@@ -4848,8 +5066,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "#$value";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('#');
+    printer.write(value);
   }
 }
 
@@ -4879,8 +5098,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "${type.toStringInternal()}";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeType(type);
   }
 }
 
@@ -4900,8 +5119,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('this');
   }
 }
 
@@ -4924,8 +5143,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('rethrow');
   }
 }
 
@@ -4961,8 +5180,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('throw ');
+    printer.writeExpression(expression);
   }
 }
 
@@ -5001,8 +5221,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isConst) {
+      printer.write('const ');
+    }
+    printer.write('<');
+    printer.writeType(typeArgument);
+    printer.write('>[');
+    printer.writeExpressions(expressions);
+    printer.write(']');
   }
 }
 
@@ -5041,8 +5268,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isConst) {
+      printer.write('const ');
+    }
+    printer.write('<');
+    printer.writeType(typeArgument);
+    printer.write('>{');
+    printer.writeExpressions(expressions);
+    printer.write('}');
   }
 }
 
@@ -5088,8 +5322,22 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (isConst) {
+      printer.write('const ');
+    }
+    printer.write('<');
+    printer.writeType(keyType);
+    printer.write(', ');
+    printer.writeType(valueType);
+    printer.write('>{');
+    for (int index = 0; index < entries.length; index++) {
+      if (index > 0) {
+        printer.write(', ');
+      }
+      printer.writeMapEntry(entries[index]);
+    }
+    printer.write('}');
   }
 }
 
@@ -5125,9 +5373,16 @@
     return "MapEntry(${toStringInternal()})";
   }
 
-  @override
-  String toStringInternal() {
-    return "";
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    toTextInternal(printer);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(key);
+    printer.write(': ');
+    printer.writeExpression(value);
   }
 }
 
@@ -5164,8 +5419,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('await ');
+    printer.writeExpression(operand);
   }
 }
 
@@ -5209,8 +5465,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeFunctionNode(function, '');
   }
 }
 
@@ -5244,8 +5500,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeConstant(constant);
   }
 }
 
@@ -5287,8 +5543,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('let ');
+    printer.writeVariableDeclaration(variable);
+    printer.write(' in ');
+    printer.writeExpression(body);
   }
 }
 
@@ -5330,8 +5589,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('block ');
+    printer.writeBlock(body.statements);
+    printer.write(' => ');
+    printer.writeExpression(value);
   }
 }
 
@@ -5371,8 +5633,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(import.name);
+    printer.write('.loadLibrary()');
   }
 }
 
@@ -5400,8 +5663,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(import.name);
+    printer.write('.checkLibraryIsLoaded()');
   }
 }
 
@@ -5412,6 +5676,14 @@
 abstract class Statement extends TreeNode {
   R accept<R>(StatementVisitor<R> v);
   R accept1<R, A>(StatementVisitor1<R, A> v, A arg);
+
+  void toTextInternal(AstPrinter printer);
+
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeStatement(this);
+    return printer.getText();
+  }
 }
 
 class ExpressionStatement extends Statement {
@@ -5442,8 +5714,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeExpression(expression);
+    printer.write(';');
   }
 }
 
@@ -5481,8 +5754,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeBlock(statements);
   }
 }
 
@@ -5526,8 +5799,9 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('assert ');
+    printer.writeBlock(statements);
   }
 }
 
@@ -5545,8 +5819,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(';');
   }
 }
 
@@ -5596,8 +5870,14 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('assert(');
+    printer.writeExpression(condition);
+    if (message != null) {
+      printer.write(', ');
+      printer.writeExpression(message);
+    }
+    printer.write(');');
   }
 }
 
@@ -5634,8 +5914,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write(printer.getLabelName(this));
+    printer.write(':');
+    printer.newLine();
+    printer.writeStatement(body);
   }
 }
 
@@ -5677,8 +5960,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('break ');
+    printer.write(printer.getLabelName(target));
+    printer.write(';');
   }
 }
 
@@ -5717,8 +6002,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('while (');
+    printer.writeExpression(condition);
+    printer.write(') ');
+    printer.writeStatement(body);
   }
 }
 
@@ -5757,8 +6045,12 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('do ');
+    printer.writeStatement(body);
+    printer.write(' while (');
+    printer.writeExpression(condition);
+    printer.write(');');
   }
 }
 
@@ -5805,8 +6097,23 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('for (');
+    for (int index = 0; index < variables.length; index++) {
+      if (index > 0) {
+        printer.write(', ');
+      }
+      printer.writeVariableDeclaration(variables[index],
+          includeModifiersAndType: index == 0);
+    }
+    printer.write('; ');
+    if (condition != null) {
+      printer.writeExpression(condition);
+    }
+    printer.write('; ');
+    printer.writeExpressions(updates);
+    printer.write(') ');
+    printer.writeStatement(body);
   }
 }
 
@@ -5860,8 +6167,14 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('for (');
+    printer.writeVariableDeclaration(variable);
+
+    printer.write(' in ');
+    printer.writeExpression(iterable);
+    printer.write(') ');
+    printer.writeStatement(body);
   }
 }
 
@@ -5901,8 +6214,18 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('switch (');
+    printer.writeExpression(expression);
+    printer.write(') {');
+    printer.incIndentation();
+    for (SwitchCase switchCase in cases) {
+      printer.newLine();
+      printer.writeSwitchCase(switchCase);
+    }
+    printer.decIndentation();
+    printer.newLine();
+    printer.write('}');
   }
 }
 
@@ -5954,9 +6277,39 @@
     return "SwitchCase(${toStringInternal()})";
   }
 
-  @override
-  String toStringInternal() {
-    return "";
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    toTextInternal(printer);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer) {
+    for (int index = 0; index < expressions.length; index++) {
+      if (index > 0) {
+        printer.newLine();
+      }
+      printer.write('case ');
+      printer.writeExpression(expressions[index]);
+      printer.write(':');
+    }
+    if (isDefault) {
+      if (expressions.isNotEmpty) {
+        printer.newLine();
+      }
+      printer.write('default:');
+    }
+    printer.incIndentation();
+    Statement block = body;
+    if (block is Block) {
+      for (Statement statement in block.statements) {
+        printer.newLine();
+        printer.writeStatement(statement);
+      }
+    } else {
+      printer.write(' ');
+      printer.writeStatement(body);
+    }
+    printer.decIndentation();
   }
 }
 
@@ -5979,8 +6332,10 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('continue ');
+    printer.write(printer.getSwitchCaseName(target));
+    printer.write(';');
   }
 }
 
@@ -6026,8 +6381,15 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('if (');
+    printer.writeExpression(condition);
+    printer.write(') ');
+    printer.writeStatement(then);
+    if (otherwise != null) {
+      printer.write(' else ');
+      printer.writeStatement(otherwise);
+    }
   }
 }
 
@@ -6059,8 +6421,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('return');
+    if (expression != null) {
+      printer.write(' ');
+      printer.writeExpression(expression);
+    }
+    printer.write(';');
   }
 }
 
@@ -6097,8 +6464,13 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('try ');
+    printer.writeStatement(body);
+    for (Catch catchClause in catches) {
+      printer.write(' ');
+      printer.writeCatch(catchClause);
+    }
   }
 }
 
@@ -6146,9 +6518,49 @@
     return "Catch(${toStringInternal()})";
   }
 
-  @override
-  String toStringInternal() {
-    return "";
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    toTextInternal(printer);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer) {
+    bool isImplicitType(DartType type) {
+      if (type is DynamicType) {
+        return true;
+      }
+      if (type is InterfaceType &&
+          type.className.node != null &&
+          type.classNode.name == 'Object') {
+        Uri uri = type.classNode.enclosingLibrary?.importUri;
+        return uri?.scheme == 'dart' &&
+            uri?.path == 'core' &&
+            type.nullability == Nullability.nonNullable;
+      }
+      return false;
+    }
+
+    if (exception != null) {
+      if (!isImplicitType(guard)) {
+        printer.write('on ');
+        printer.writeType(guard);
+        printer.write(' ');
+      }
+      printer.write('catch (');
+      printer.writeVariableDeclaration(exception,
+          includeModifiersAndType: false);
+      if (stackTrace != null) {
+        printer.write(', ');
+        printer.writeVariableDeclaration(stackTrace,
+            includeModifiersAndType: false);
+      }
+      printer.write(') ');
+    } else {
+      printer.write('on ');
+      printer.writeType(guard);
+      printer.write(' ');
+    }
+    printer.writeStatement(body);
   }
 }
 
@@ -6187,8 +6599,14 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    if (body is! TryCatch) {
+      // This is a `try {} catch (e) {} finally {}`. Avoid repeating `try`.
+      printer.write('try ');
+    }
+    printer.writeStatement(body);
+    printer.write(' finally ');
+    printer.writeStatement(finalizer);
   }
 }
 
@@ -6241,8 +6659,14 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.write('yield');
+    if (isYieldStar) {
+      printer.write('*');
+    }
+    printer.write(' ');
+    printer.writeExpression(expression);
+    printer.write(';');
   }
 }
 
@@ -6447,8 +6871,10 @@
     return "VariableDeclaration(${toStringInternal()})";
   }
 
-  String toStringInternal() {
-    return name ?? "null-named VariableDeclaration (${hashCode})";
+  @override
+  void toTextInternal(AstPrinter printer) {
+    printer.writeVariableDeclaration(this);
+    printer.write(';');
   }
 }
 
@@ -6490,8 +6916,11 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeFunctionNode(function, printer.getVariableName(variable));
+    if (function.body is ReturnStatement) {
+      printer.write(';');
+    }
   }
 }
 
@@ -6509,7 +6938,7 @@
 ///
 /// The [toString] method returns a human-readable string that includes the
 /// library name for private names; uniqueness is not guaranteed.
-abstract class Name implements Node {
+abstract class Name extends Node {
   final int hashCode;
   final String name;
   Reference get libraryName;
@@ -6547,6 +6976,11 @@
   /// Note that this adds some nodes to a static map to ensure consistent
   /// naming, but that it thus also leaks memory.
   String leakingDebugToString() => astToText.debugNodeToString(this);
+
+  @override
+  void toTextInternal(AstPrinter printer) {
+    printer.writeName(this);
+  }
 }
 
 class _PrivateName extends Name {
@@ -6558,6 +6992,7 @@
         super._internal(_computeHashCode(name, libraryName), name);
 
   String toString() => toStringInternal();
+
   String toStringInternal() => library != null ? '$library::$name' : name;
 
   Library get library => libraryName.asLibrary;
@@ -6578,7 +7013,6 @@
   _PublicName(String name) : super._internal(name.hashCode, name);
 
   String toString() => toStringInternal();
-  String toStringInternal() => name;
 }
 
 // ------------------------------------------------------------------------
@@ -6697,21 +7131,16 @@
 
   bool equals(Object other, Assumptions assumptions);
 
-  @override
-  String toStringInternal() {
-    return toTypeText(verbose: _verboseTypeToString);
-  }
-
   /// Returns a textual representation of the this type.
   ///
   /// If [verbose] is `true`, qualified names will include the library name/uri.
-  String toTypeText({bool verbose: false}) {
-    StringBuffer sb = new StringBuffer();
-    toTypeTextInternal(sb, verbose: verbose);
-    return sb.toString();
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeType(this);
+    return printer.getText();
   }
 
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false});
+  void toTextInternal(AstPrinter printer);
 }
 
 /// The type arising from invalid type annotations.
@@ -6742,11 +7171,15 @@
 
   @override
   Nullability get declaredNullability {
-    throw "InvalidType doesn't have nullability.";
+    // TODO(johnniwinther,dmitryas): Consider implementing invalidNullability.
+    return Nullability.legacy;
   }
 
   @override
-  Nullability get nullability => throw "InvalidType doesn't have nullability.";
+  Nullability get nullability {
+    // TODO(johnniwinther,dmitryas): Consider implementing invalidNullability.
+    return Nullability.legacy;
+  }
 
   @override
   InvalidType withDeclaredNullability(Nullability declaredNullability) => this;
@@ -6757,8 +7190,8 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write("<invalid>");
+  void toTextInternal(AstPrinter printer) {
+    printer.write("<invalid>");
   }
 }
 
@@ -6799,8 +7232,8 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write("dynamic");
+  void toTextInternal(AstPrinter printer) {
+    printer.write("dynamic");
   }
 }
 
@@ -6841,8 +7274,8 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write("void");
+  void toTextInternal(AstPrinter printer) {
+    printer.write("void");
   }
 }
 
@@ -6890,9 +7323,9 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write("Never");
-    sb.write(nullabilityToString(nullability));
+  void toTextInternal(AstPrinter printer) {
+    printer.write("Never");
+    printer.write(nullabilityToString(declaredNullability));
   }
 }
 
@@ -6933,8 +7366,8 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write("<bottom>");
+  void toTextInternal(AstPrinter printer) {
+    printer.write("<bottom>");
   }
 }
 
@@ -7031,43 +7464,10 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write(
-        qualifiedClassNameToString(classNode, includeLibraryName: verbose));
-    if (typeArguments.isNotEmpty) {
-      sb.write("<");
-      String comma = "";
-      for (DartType typeArgument in typeArguments) {
-        sb.write(comma);
-        typeArgument.toTypeTextInternal(sb, verbose: verbose);
-        comma = ", ";
-      }
-      sb.write(">");
-    }
-    sb.write(nullabilityToString(nullability));
-  }
-
-  @override
-  String toStringInternal() {
-    // TODO(johnniwinther): Unify this with [toTypeTextInternal].
-    StringBuffer sb = new StringBuffer();
-    if (_verboseTypeToString) {
-      sb.write(className.toStringInternal());
-    } else {
-      sb.write(classNode.name);
-    }
-    if (typeArguments.isNotEmpty) {
-      sb.write("<");
-      String comma = "";
-      for (DartType typeArgument in typeArguments) {
-        sb.write(comma);
-        sb.write(typeArgument.toStringInternal());
-        comma = ", ";
-      }
-      sb.write(">");
-    }
-    sb.write(nullabilityToString(nullability));
-    return sb.toString();
+  void toTextInternal(AstPrinter printer) {
+    printer.writeClassName(className, forType: true);
+    printer.writeTypeArguments(typeArguments);
+    printer.write(nullabilityToString(declaredNullability));
   }
 }
 
@@ -7251,60 +7651,39 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    returnType.toTypeTextInternal(sb, verbose: verbose);
-    sb.write(" Function");
-    if (typeParameters.isNotEmpty) {
-      sb.write("<");
-      String comma = "";
-      for (TypeParameter typeParameter in typeParameters) {
-        sb.write(comma);
-        sb.write(typeParameter.name);
-        DartType bound = typeParameter.bound;
-
-        bool isTopObject(DartType type) {
-          if (type is InterfaceType &&
-              type.className.node != null &&
-              type.classNode.name == 'Object') {
-            Uri uri = type.classNode.enclosingLibrary?.importUri;
-            return uri?.scheme == 'dart' &&
-                uri?.path == 'core' &&
-                (type.nullability == Nullability.legacy ||
-                    type.nullability == Nullability.nullable);
-          }
-          return false;
-        }
-
-        if (!isTopObject(bound) || isTopObject(typeParameter.defaultType)) {
-          // Include explicit bounds only.
-          sb.write(' extends ');
-          bound.toTypeTextInternal(sb, verbose: verbose);
-        }
-        comma = ", ";
-      }
-      sb.write(">");
-    }
-    sb.write("(");
+  void toTextInternal(AstPrinter printer) {
+    printer.writeType(returnType);
+    printer.write(" Function");
+    printer.writeTypeParameters(typeParameters);
+    printer.write("(");
     for (int i = 0; i < positionalParameters.length; i++) {
-      if (i > 0) sb.write(", ");
-      if (i == requiredParameterCount) sb.write("[");
-      positionalParameters[i].toTypeTextInternal(sb, verbose: verbose);
+      if (i > 0) {
+        printer.write(", ");
+      }
+      if (i == requiredParameterCount) {
+        printer.write("[");
+      }
+      printer.writeType(positionalParameters[i]);
     }
-    if (requiredParameterCount < positionalParameters.length) sb.write("]");
+    if (requiredParameterCount < positionalParameters.length) {
+      printer.write("]");
+    }
 
     if (namedParameters.isNotEmpty) {
       if (positionalParameters.isNotEmpty) {
-        sb.write(", ");
+        printer.write(", ");
       }
-      sb.write("{");
+      printer.write("{");
       for (int i = 0; i < namedParameters.length; i++) {
-        if (i > 0) sb.write(", ");
-        namedParameters[i].toTypeTextInternal(sb, includeLibraryName: verbose);
+        if (i > 0) {
+          printer.write(", ");
+        }
+        printer.writeNamedType(namedParameters[i]);
       }
-      sb.write("}");
+      printer.write("}");
     }
-    sb.write(")");
-    sb.write(nullabilityToString(nullability));
+    printer.write(")");
+    printer.write(nullabilityToString(declaredNullability));
   }
 }
 
@@ -7406,20 +7785,83 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write(
-        qualifiedTypedefNameToString(typedefNode, includeLibraryName: verbose));
-    if (typeArguments.isNotEmpty) {
-      sb.write("<");
-      String comma = "";
-      for (DartType typeArgument in typeArguments) {
-        sb.write(comma);
-        typeArgument.toTypeTextInternal(sb, verbose: verbose);
-        comma = ", ";
+  void toTextInternal(AstPrinter printer) {
+    printer.writeTypedefName(typedefReference);
+    printer.writeTypeArguments(typeArguments);
+    printer.write(nullabilityToString(declaredNullability));
+  }
+}
+
+class FutureOrType extends DartType {
+  final DartType typeArgument;
+
+  final Nullability declaredNullability;
+
+  FutureOrType(this.typeArgument, this.declaredNullability);
+
+  @override
+  Nullability get nullability {
+    return uniteNullabilities(typeArgument.nullability, declaredNullability);
+  }
+
+  @override
+  R accept<R>(DartTypeVisitor<R> v) => v.visitFutureOrType(this);
+
+  @override
+  R accept1<R, A>(DartTypeVisitor1<R, A> v, A arg) {
+    return v.visitFutureOrType(this, arg);
+  }
+
+  @override
+  void visitChildren(Visitor v) {
+    typeArgument.accept(v);
+  }
+
+  @override
+  bool operator ==(Object other) => equals(other, null);
+
+  @override
+  bool equals(Object other, Assumptions assumptions) {
+    if (identical(this, other)) return true;
+    if (other is FutureOrType) {
+      if (declaredNullability != other.declaredNullability) return false;
+      if (!typeArgument.equals(other.typeArgument, assumptions)) {
+        return false;
       }
-      sb.write(">");
+      return true;
+    } else {
+      return false;
     }
-    sb.write(nullabilityToString(nullability));
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0x12345678;
+    hash = 0x3fffffff & (hash * 31 + (hash ^ typeArgument.hashCode));
+    int nullabilityHash =
+        (0x33333333 >> declaredNullability.index) ^ 0x33333333;
+    hash = 0x3fffffff & (hash * 31 + (hash ^ nullabilityHash));
+    return hash;
+  }
+
+  @override
+  FutureOrType withDeclaredNullability(Nullability declaredNullability) {
+    return declaredNullability == this.declaredNullability
+        ? this
+        : new FutureOrType(typeArgument, declaredNullability);
+  }
+
+  @override
+  String toString() {
+    return "FutureOrType(${toStringInternal()})";
+  }
+
+  @override
+  void toTextInternal(AstPrinter printer) {
+    printer.write("FutureOr<");
+    printer.writeType(typeArgument);
+    printer.write(">");
+    printer.write(nullabilityToString(declaredNullability));
   }
 }
 
@@ -7465,16 +7907,19 @@
     return "NamedType(${toStringInternal()})";
   }
 
-  void toTypeTextInternal(StringBuffer sb, {bool includeLibraryName: false}) {
-    if (isRequired) sb.write("required ");
-    sb.write("$name: ${type.toStringInternal()}");
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeNamedType(this);
+    return printer.getText();
   }
 
-  @override
-  String toStringInternal() {
-    StringBuffer sb = new StringBuffer();
-    toTypeTextInternal(sb, includeLibraryName: _verboseTypeToString);
-    return sb.toString();
+  void toTextInternal(AstPrinter printer) {
+    if (isRequired) {
+      printer.write("required ");
+    }
+    printer.write(name);
+    printer.write(': ');
+    printer.writeType(type);
   }
 }
 
@@ -7489,7 +7934,8 @@
 class TypeParameterType extends DartType {
   /// The declared nullability of a type-parameter type.
   ///
-  /// When a [TypeParameterType] represents an intersection, [declaredNullability] is the nullability of the left-hand side.
+  /// When a [TypeParameterType] represents an intersection,
+  /// [declaredNullability] is the nullability of the left-hand side.
   @override
   Nullability declaredNullability;
 
@@ -7657,11 +8103,8 @@
     bool nullabilityDependsOnItself = false;
     {
       DartType type = typeParameter.bound;
-      while (type is InterfaceType &&
-          type.classNode.name == "FutureOr" &&
-          type.classNode.enclosingLibrary.importUri.scheme == "dart" &&
-          type.classNode.enclosingLibrary.importUri.path == "async") {
-        type = (type as InterfaceType).typeArguments.single;
+      while (type is FutureOrType) {
+        type = (type as FutureOrType).typeArgument;
       }
       if (type is TypeParameterType && type.parameter == typeParameter) {
         // Intersection types can't appear in the bound.
@@ -7771,24 +8214,23 @@
   }
 
   @override
-  void toTypeTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write(qualifiedTypeParameterNameToString(parameter,
-        includeLibraryName: verbose));
-    sb.write(nullabilityToString(declaredNullability));
+  void toTextInternal(AstPrinter printer) {
+    printer.writeTypeParameterName(parameter);
+    printer.write(nullabilityToString(declaredNullability));
     if (promotedBound != null) {
-      sb.write(" & ");
-      sb.write(promotedBound.toStringInternal());
-      sb.write(" /* '");
-      sb.write(nullabilityToString(declaredNullability));
-      sb.write("' & '");
+      printer.write(" & ");
+      printer.write(promotedBound.toStringInternal());
+      printer.write(" /* '");
+      printer.write(nullabilityToString(declaredNullability));
+      printer.write("' & '");
       if (promotedBound is InvalidType) {
-        sb.write(nullabilityToString(Nullability.undetermined));
+        printer.write(nullabilityToString(Nullability.undetermined));
       } else {
-        sb.write(nullabilityToString(promotedBound.nullability));
+        printer.write(nullabilityToString(promotedBound.nullability));
       }
-      sb.write("' = '");
-      sb.write(nullabilityToString(nullability));
-      sb.write("' */");
+      printer.write("' = '");
+      printer.write(nullabilityToString(declaredNullability));
+      printer.write("' */");
     }
   }
 }
@@ -7996,9 +8438,9 @@
     return "TypeParameter(${toStringInternal()})";
   }
 
-  String toStringInternal() {
-    return qualifiedTypeParameterNameToString(this,
-        includeLibraryName: _verboseMemberToString);
+  @override
+  void toTextInternal(AstPrinter printer) {
+    printer.writeTypeParameterName(this);
   }
 
   bool get isFunctionTypeTypeParameter => parent == null;
@@ -8054,24 +8496,9 @@
   }
 
   @override
-  String toStringInternal() {
-    StringBuffer sb = new StringBuffer();
-    if (_verboseTypeToString) {
-      sb.write(className.toStringInternal());
-    } else {
-      sb.write(classNode.name);
-    }
-    if (typeArguments.isNotEmpty) {
-      sb.write("<");
-      String comma = "";
-      for (DartType typeArgument in typeArguments) {
-        sb.write(comma);
-        sb.write(typeArgument.toStringInternal());
-        comma = ", ";
-      }
-      sb.write(">");
-    }
-    return sb.toString();
+  void toTextInternal(AstPrinter printer) {
+    printer.writeClassName(className, forType: true);
+    printer.writeTypeArguments(typeArguments);
   }
 }
 
@@ -8099,16 +8526,18 @@
   int get hashCode;
   bool operator ==(Object other);
 
+  String toString() => throw '$runtimeType';
+
   /// Returns a textual representation of the this constant.
   ///
   /// If [verbose] is `true`, qualified names will include the library name/uri.
-  String toConstantText({bool verbose: false}) {
-    StringBuffer sb = new StringBuffer();
-    toConstantTextInternal(sb, verbose: verbose);
-    return sb.toString();
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeConstant(this);
+    return printer.getText();
   }
 
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false});
+  void toTextInternal(AstPrinter printer);
 
   /// Gets the type of this constant.
   DartType getType(StaticTypeContext context);
@@ -8123,17 +8552,14 @@
 
   PrimitiveConstant(this.value);
 
-  String toString() => toStringInternal();
-  String toStringInternal() => '$value';
-
   int get hashCode => value.hashCode;
 
   bool operator ==(Object other) =>
       other is PrimitiveConstant<T> && other.value == value;
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write(value);
+  void toTextInternal(AstPrinter printer) {
+    printer.write('$value');
   }
 }
 
@@ -8146,6 +8572,9 @@
 
   DartType getType(StaticTypeContext context) =>
       context.typeEnvironment.nullType;
+
+  @override
+  String toString() => 'NullConstant(${toStringInternal()})';
 }
 
 class BoolConstant extends PrimitiveConstant<bool> {
@@ -8157,6 +8586,9 @@
 
   DartType getType(StaticTypeContext context) =>
       context.typeEnvironment.coreTypes.boolRawType(context.nonNullable);
+
+  @override
+  String toString() => 'BoolConstant(${toStringInternal()})';
 }
 
 /// An integer constant on a non-JS target.
@@ -8169,6 +8601,9 @@
 
   DartType getType(StaticTypeContext context) =>
       context.typeEnvironment.coreTypes.intRawType(context.nonNullable);
+
+  @override
+  String toString() => 'IntConstant(${toStringInternal()})';
 }
 
 /// A double constant on a non-JS target or any numeric constant on a JS target.
@@ -8185,6 +8620,9 @@
 
   DartType getType(StaticTypeContext context) =>
       context.typeEnvironment.coreTypes.doubleRawType(context.nonNullable);
+
+  @override
+  String toString() => 'DoubleConstant(${toStringInternal()})';
 }
 
 class StringConstant extends PrimitiveConstant<String> {
@@ -8211,13 +8649,8 @@
   R accept<R>(ConstantVisitor<R> v) => v.visitSymbolConstant(this);
   R acceptReference<R>(Visitor<R> v) => v.visitSymbolConstantReference(this);
 
-  String toString() => toStringInternal();
-
-  String toStringInternal() {
-    return libraryReference != null
-        ? '#${libraryReference.asLibrary.importUri}::$name'
-        : '#$name';
-  }
+  @override
+  String toString() => 'StringConstant(${toStringInternal()})';
 
   int get hashCode => _Hash.hash2(name, libraryReference);
 
@@ -8231,13 +8664,13 @@
       context.typeEnvironment.coreTypes.symbolRawType(context.nonNullable);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('#');
-    if (verbose && libraryReference != null) {
-      sb.write(libraryNameToString(libraryReference.asLibrary));
-      sb.write('::');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('#');
+    if (printer.includeAuxiliaryProperties && libraryReference != null) {
+      printer.write(libraryNameToString(libraryReference.asLibrary));
+      printer.write('::');
     }
-    sb.write(name);
+    printer.write(name);
   }
 }
 
@@ -8261,25 +8694,23 @@
   R acceptReference<R>(Visitor<R> v) => v.visitMapConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('<');
-    keyType.toTypeTextInternal(sb, verbose: verbose);
-    sb.write(', ');
-    valueType.toTypeTextInternal(sb, verbose: verbose);
-    sb.write('>{');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('const <');
+    printer.writeType(keyType);
+    printer.write(', ');
+    printer.writeType(valueType);
+    printer.write('>{');
     for (int i = 0; i < entries.length; i++) {
       if (i > 0) {
-        sb.write(', ');
+        printer.write(', ');
       }
-      entries[i].toConstantTextInternal(sb, includeLibraryName: verbose);
+      printer.writeConstantMapEntry(entries[i]);
     }
-    sb.write('}');
+    printer.write('}');
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() {
-    return '${this.runtimeType}<$keyType, $valueType>($entries)';
-  }
+  @override
+  String toString() => 'MapConstant(${toStringInternal()})';
 
   int _cachedHashCode;
   int get hashCode {
@@ -8303,19 +8734,28 @@
   final Constant value;
   ConstantMapEntry(this.key, this.value);
 
-  String toString() => toStringInternal();
-  String toStringInternal() => '$key: $value';
+  @override
+  String toString() => 'ConstantMapEntry(${toStringInternal()})';
 
+  @override
   int get hashCode => _Hash.hash2(key, value);
 
+  @override
   bool operator ==(Object other) =>
       other is ConstantMapEntry && other.key == key && other.value == value;
 
-  void toConstantTextInternal(StringBuffer sb,
-      {bool includeLibraryName: false}) {
-    key.toConstantTextInternal(sb, verbose: includeLibraryName);
-    sb.write(': ');
-    value.toConstantTextInternal(sb, verbose: includeLibraryName);
+  String toStringInternal() => toText(defaultAstTextStrategy);
+
+  String toText(AstTextStrategy strategy) {
+    AstPrinter printer = new AstPrinter(strategy);
+    printer.writeConstantMapEntry(this);
+    return printer.getText();
+  }
+
+  void toTextInternal(AstPrinter printer) {
+    printer.writeConstant(key);
+    printer.write(': ');
+    printer.writeConstant(value);
   }
 }
 
@@ -8336,23 +8776,21 @@
   R acceptReference<R>(Visitor<R> v) => v.visitListConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('<');
-    typeArgument.toTypeTextInternal(sb, verbose: verbose);
-    sb.write('>[');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('const <');
+    printer.writeType(typeArgument);
+    printer.write('>[');
     for (int i = 0; i < entries.length; i++) {
       if (i > 0) {
-        sb.write(', ');
+        printer.write(', ');
       }
-      entries[i].toConstantTextInternal(sb, verbose: verbose);
+      printer.writeConstant(entries[i]);
     }
-    sb.write(']');
+    printer.write(']');
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() {
-    return '${runtimeType}<${typeArgument.toStringInternal()}>($entries)';
-  }
+  @override
+  String toString() => 'ListConstant(${toStringInternal()})';
 
   int _cachedHashCode;
   int get hashCode {
@@ -8387,23 +8825,21 @@
   R acceptReference<R>(Visitor<R> v) => v.visitSetConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('<');
-    typeArgument.toTypeTextInternal(sb, verbose: verbose);
-    sb.write('>{');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('const <');
+    printer.writeType(typeArgument);
+    printer.write('>{');
     for (int i = 0; i < entries.length; i++) {
       if (i > 0) {
-        sb.write(', ');
+        printer.write(', ');
       }
-      entries[i].toConstantTextInternal(sb, verbose: verbose);
+      printer.writeConstant(entries[i]);
     }
-    sb.write('}');
+    printer.write('}');
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() {
-    return '${runtimeType}<${typeArgument.toStringInternal()}>($entries)';
-  }
+  @override
+  String toString() => 'SetConstant(${toStringInternal()})';
 
   int _cachedHashCode;
   int get hashCode {
@@ -8445,47 +8881,24 @@
   R acceptReference<R>(Visitor<R> v) => v.visitInstanceConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write(
-        qualifiedClassNameToString(classNode, includeLibraryName: verbose));
-    if (typeArguments.isNotEmpty) {
-      sb.write('<');
-      for (int i = 0; i < typeArguments.length; i++) {
-        if (i > 0) {
-          sb.write(', ');
-        }
-        typeArguments[i].toTypeTextInternal(sb, verbose: verbose);
-      }
-      sb.write('>');
-    }
-    sb.write('{');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('const ');
+    printer.writeClassName(classReference);
+    printer.writeTypeArguments(typeArguments);
+    printer.write('{');
     String comma = '';
     fieldValues.forEach((Reference fieldRef, Constant constant) {
-      sb.write(comma);
-      sb.write(qualifiedMemberNameToString(fieldRef.asField));
-      sb.write(': ');
-      constant.toConstantTextInternal(sb, verbose: verbose);
+      printer.write(comma);
+      printer.writeMemberName(fieldRef);
+      printer.write(': ');
+      printer.writeConstant(constant);
       comma = ', ';
     });
-    sb.write('}');
+    printer.write('}');
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() {
-    final sb = new StringBuffer();
-    sb.write('${classReference.asClass}');
-    if (!classReference.asClass.typeParameters.isEmpty) {
-      sb.write('<');
-      sb.write(typeArguments.map((type) => type.toStringInternal()).join(', '));
-      sb.write('>');
-    }
-    sb.write(' {');
-    fieldValues.forEach((Reference fieldRef, Constant constant) {
-      sb.write('${fieldRef.asField.name}: $constant, ');
-    });
-    sb.write('}');
-    return sb.toString();
-  }
+  @override
+  String toString() => 'InstanceConstant(${toStringInternal()})';
 
   int _cachedHashCode;
   int get hashCode {
@@ -8524,23 +8937,13 @@
       v.visitPartialInstantiationConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('<');
-    for (int i = 0; i < types.length; i++) {
-      if (i > 0) {
-        sb.write(',');
-      }
-      types[i].toTypeTextInternal(sb, verbose: verbose);
-    }
-    sb.write('>');
-    tearOffConstant.toConstantTextInternal(sb, verbose: verbose);
+  void toTextInternal(AstPrinter printer) {
+    printer.writeConstant(tearOffConstant);
+    printer.writeTypeArguments(types);
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() {
-    return '${runtimeType}(${tearOffConstant.procedure}<'
-        '${types.map((t) => t.toStringInternal()).join(', ')}>)';
-  }
+  @override
+  String toString() => 'PartialInstantiationConstant(${toStringInternal()})';
 
   int get hashCode => _Hash.combineFinish(
       tearOffConstant.hashCode, _Hash.combineListHash(types));
@@ -8581,15 +8984,12 @@
   R acceptReference<R>(Visitor<R> v) => v.visitTearOffConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write(
-        qualifiedMemberNameToString(procedure, includeLibraryName: verbose));
+  void toTextInternal(AstPrinter printer) {
+    printer.writeMemberName(procedureReference);
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() {
-    return '${runtimeType}(${procedure})';
-  }
+  @override
+  String toString() => 'TearOffConstant(${toStringInternal()})';
 
   int get hashCode => procedureReference.hashCode;
 
@@ -8617,12 +9017,12 @@
       v.visitTypeLiteralConstantReference(this);
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    type.toTypeTextInternal(sb, verbose: verbose);
+  void toTextInternal(AstPrinter printer) {
+    printer.writeType(type);
   }
 
-  String toString() => toStringInternal();
-  String toStringInternal() => '${runtimeType}(${type})';
+  @override
+  String toString() => 'TypeLiteralConstant(${toStringInternal()})';
 
   int get hashCode => type.hashCode;
 
@@ -8656,21 +9056,16 @@
   Expression asExpression() => expression;
 
   @override
-  void toConstantTextInternal(StringBuffer sb, {bool verbose: false}) {
-    sb.write('unevaluated{');
-    sb.write(expression);
-    sb.write('}');
+  void toTextInternal(AstPrinter printer) {
+    printer.write('unevaluated{');
+    printer.writeExpression(expression);
+    printer.write('}');
   }
 
   @override
   String toString() {
     return "UnevaluatedConstant(${toStringInternal()})";
   }
-
-  @override
-  String toStringInternal() {
-    return "";
-  }
 }
 
 // ------------------------------------------------------------------------
@@ -8836,8 +9231,8 @@
   }
 
   @override
-  String toStringInternal() {
-    return "";
+  void toTextInternal(AstPrinter printer) {
+    // TODO(johnniwinther): Implement this.
   }
 }
 
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index 616045f..9a32677 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -2190,8 +2190,21 @@
         return new NeverType(Nullability.values[nullabilityIndex]);
       case Tag.InterfaceType:
         int nullabilityIndex = readByte();
-        return new InterfaceType.byReference(readClassReference(),
-            Nullability.values[nullabilityIndex], readDartTypeList());
+        Reference reference = readClassReference();
+        List<DartType> typeArguments = readDartTypeList();
+        {
+          CanonicalName canonicalName = reference.canonicalName;
+          if (canonicalName.name == "FutureOr" &&
+              canonicalName.parent != null &&
+              canonicalName.parent.name == "dart:async" &&
+              canonicalName.parent.parent != null &&
+              canonicalName.parent.parent.isRoot) {
+            return new FutureOrType(
+                typeArguments.single, Nullability.values[nullabilityIndex]);
+          }
+        }
+        return new InterfaceType.byReference(
+            reference, Nullability.values[nullabilityIndex], typeArguments);
       case Tag.SimpleInterfaceType:
         int nullabilityIndex = readByte();
         return new InterfaceType.byReference(readClassReference(),
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index 553698e..57ccd2f 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -2069,6 +2069,26 @@
   }
 
   @override
+  void visitFutureOrType(FutureOrType node) {
+    // TODO(dmitryas): Remove special treatment of FutureOr when the VM supports
+    // the new encoding: just write the tag.
+    assert(_knownCanonicalNameNonRootTops != null &&
+        _knownCanonicalNameNonRootTops.isNotEmpty);
+    CanonicalName root = _knownCanonicalNameNonRootTops.first;
+    while (!root.isRoot) {
+      root = root.parent;
+    }
+    CanonicalName canonicalNameOfFutureOr =
+        root.getChild("dart:async").getChild("FutureOr");
+    writeByte(Tag.InterfaceType);
+    writeByte(node.declaredNullability.index);
+    checkCanonicalName(canonicalNameOfFutureOr);
+    writeUInt30(canonicalNameOfFutureOr.index + 1);
+    writeUInt30(1); // Type argument count.
+    writeNode(node.typeArgument);
+  }
+
+  @override
   void visitSupertype(Supertype node) {
     // Writing nullability below is only necessary because
     // BinaryBuilder.readSupertype reads the supertype as an InterfaceType and
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index 346f56d..19a824a 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -12,7 +12,6 @@
 import 'ast.dart' hide MapEntry;
 import 'core_types.dart';
 import 'type_algebra.dart';
-import 'src/future_or.dart';
 import 'src/heap.dart';
 import 'src/legacy_erasure.dart';
 import 'src/norm.dart';
diff --git a/pkg/kernel/lib/core_types.dart b/pkg/kernel/lib/core_types.dart
index 0c441d3..7c82be8 100644
--- a/pkg/kernel/lib/core_types.dart
+++ b/pkg/kernel/lib/core_types.dart
@@ -74,10 +74,10 @@
 
   Library _asyncLibrary;
   Class _futureClass;
+  Class _deprecatedFutureOrClass;
   Class _stackTraceClass;
   Class _streamClass;
   Class _asyncAwaitCompleterClass;
-  Class _futureOrClass;
   Constructor _asyncAwaitCompleterConstructor;
   Procedure _asyncAwaitCompleterStartProcedure;
   Procedure _completeOnAsyncReturnProcedure;
@@ -160,9 +160,6 @@
   InterfaceType _streamLegacyRawType;
   InterfaceType _streamNullableRawType;
   InterfaceType _streamNonNullableRawType;
-  InterfaceType _futureOrLegacyRawType;
-  InterfaceType _futureOrNullableRawType;
-  InterfaceType _futureOrNonNullableRawType;
   InterfaceType _pragmaLegacyRawType;
   InterfaceType _pragmaNullableRawType;
   InterfaceType _pragmaNonNullableRawType;
@@ -297,9 +294,10 @@
     return _futureClass ??= index.getClass('dart:core', 'Future');
   }
 
-  Class get futureOrClass {
-    return _futureOrClass ??= (index.tryGetClass('dart:core', 'FutureOr') ??
-        index.getClass('dart:async', 'FutureOr'));
+  // TODO(dmitryas): Remove it when FutureOrType is fully supported.
+  Class get deprecatedFutureOrClass {
+    return _deprecatedFutureOrClass ??=
+        index.getClass('dart:async', 'FutureOr');
   }
 
   Procedure get identicalProcedure {
@@ -1118,39 +1116,6 @@
     }
   }
 
-  InterfaceType get futureOrLegacyRawType {
-    return _futureOrLegacyRawType ??= _legacyRawTypes[futureOrClass] ??=
-        new InterfaceType(futureOrClass, Nullability.legacy,
-            const <DartType>[const DynamicType()]);
-  }
-
-  InterfaceType get futureOrNullableRawType {
-    return _futureOrNullableRawType ??= _nullableRawTypes[futureOrClass] ??=
-        new InterfaceType(futureOrClass, Nullability.nullable,
-            const <DartType>[const DynamicType()]);
-  }
-
-  InterfaceType get futureOrNonNullableRawType {
-    return _futureOrNonNullableRawType ??=
-        _nonNullableRawTypes[futureOrClass] ??= new InterfaceType(futureOrClass,
-            Nullability.nonNullable, const <DartType>[const DynamicType()]);
-  }
-
-  InterfaceType futureOrRawType(Nullability nullability) {
-    switch (nullability) {
-      case Nullability.legacy:
-        return futureOrLegacyRawType;
-      case Nullability.nullable:
-        return futureOrNullableRawType;
-      case Nullability.nonNullable:
-        return futureOrNonNullableRawType;
-      case Nullability.undetermined:
-      default:
-        throw new StateError(
-            "Unsupported nullability $nullability on an InterfaceType.");
-    }
-  }
-
   InterfaceType get pragmaLegacyRawType {
     return _pragmaLegacyRawType ??= _legacyRawTypes[pragmaClass] ??=
         new InterfaceType(pragmaClass, Nullability.legacy, const <DartType>[]);
@@ -1287,17 +1252,20 @@
 
     // TOP(T?) is true iff TOP(T) or OBJECT(T).
     // TOP(T*) is true iff TOP(T) or OBJECT(T).
-    if (type.nullability == Nullability.nullable ||
-        type.nullability == Nullability.legacy) {
+    if (type.declaredNullability == Nullability.nullable ||
+        type.declaredNullability == Nullability.legacy) {
       DartType nonNullableType =
           type.withDeclaredNullability(Nullability.nonNullable);
-      assert(type != nonNullableType);
+      assert(
+          !identical(type, nonNullableType),
+          "Setting the declared nullability of type '${type}' "
+          "to non-nullable was supposed to change the type, but it remained the same.");
       return isTop(nonNullableType) || isObject(nonNullableType);
     }
 
     // TOP(FutureOr<T>) is TOP(T).
-    if (type is InterfaceType && type.classNode == futureOrClass) {
-      return isTop(type.typeArguments.single);
+    if (type is FutureOrType) {
+      return isTop(type.typeArgument);
     }
 
     return false;
@@ -1318,10 +1286,8 @@
     }
 
     // OBJECT(FutureOr<T>) is OBJECT(T).
-    if (type is InterfaceType &&
-        type.classNode == futureOrClass &&
-        type.nullability == Nullability.nonNullable) {
-      return isObject(type.typeArguments.single);
+    if (type is FutureOrType && type.nullability == Nullability.nonNullable) {
+      return isObject(type.typeArgument);
     }
 
     return false;
diff --git a/pkg/kernel/lib/src/bounds_checks.dart b/pkg/kernel/lib/src/bounds_checks.dart
index 4e48572..2597bba 100644
--- a/pkg/kernel/lib/src/bounds_checks.dart
+++ b/pkg/kernel/lib/src/bounds_checks.dart
@@ -9,6 +9,7 @@
         DartType,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         InvalidType,
         Library,
@@ -320,6 +321,9 @@
             allowSuperBounded: true) ??
         const <TypeArgumentIssue>[]);
     return result.isEmpty ? null : result;
+  } else if (type is FutureOrType) {
+    variables = typeEnvironment.coreTypes.futureClass.typeParameters;
+    arguments = <DartType>[type.typeArgument];
   } else {
     return null;
   }
@@ -380,6 +384,9 @@
   } else if (type is TypedefType) {
     variables = type.typedefNode.typeParameters;
     arguments = type.typeArguments;
+  } else if (type is FutureOrType) {
+    variables = typeEnvironment.coreTypes.futureClass.typeParameters;
+    arguments = <DartType>[type.typeArgument];
   }
   substitutionMap =
       new Map<TypeParameter, DartType>.fromIterables(variables, arguments);
@@ -532,6 +539,11 @@
         typeParameters: type.typeParameters,
         requiredParameterCount: type.requiredParameterCount,
         typedefType: type.typedefType);
+  } else if (type is FutureOrType) {
+    return new FutureOrType(
+        convertSuperBoundedToRegularBounded(
+            typeEnvironment, type.typeArgument, bottomType),
+        type.declaredNullability);
   }
   return type;
 }
@@ -592,6 +604,13 @@
   }
 
   @override
+  int visitFutureOrType(FutureOrType node,
+      Map<TypeParameter, Map<DartType, int>> computedVariances) {
+    return computeVariance(typeParameter, node.typeArgument,
+        computedVariances: computedVariances);
+  }
+
+  @override
   int visitTypedefType(TypedefType node,
       Map<TypeParameter, Map<DartType, int>> computedVariances) {
     int result = Variance.unrelated;
diff --git a/pkg/kernel/lib/src/dart_type_equivalence.dart b/pkg/kernel/lib/src/dart_type_equivalence.dart
index 731a5fe..cdb6586 100644
--- a/pkg/kernel/lib/src/dart_type_equivalence.dart
+++ b/pkg/kernel/lib/src/dart_type_equivalence.dart
@@ -148,7 +148,7 @@
 
   @override
   bool visitInterfaceType(InterfaceType node, DartType other) {
-    // First, check Object*, FutureOr<Object?>, etc.
+    // First, check Object*, Object?.
     if (equateTopTypes && coreTypes.isTop(node)) {
       return coreTypes.isTop(other);
     }
@@ -173,6 +173,26 @@
   }
 
   @override
+  bool visitFutureOrType(FutureOrType node, DartType other) {
+    // First, check FutureOr<dynamic>, FutureOr<Object?>, etc.
+    if (equateTopTypes && coreTypes.isTop(node)) {
+      return coreTypes.isTop(other);
+    }
+
+    if (other is FutureOrType) {
+      if (!_checkAndRegisterNullabilities(
+          node.declaredNullability, other.declaredNullability)) {
+        return false;
+      }
+      if (!node.typeArgument.accept1(this, other.typeArgument)) {
+        return false;
+      }
+      return true;
+    }
+    return false;
+  }
+
+  @override
   bool visitInvalidType(InvalidType node, DartType other) {
     return other is InvalidType;
   }
diff --git a/pkg/kernel/lib/src/future_or.dart b/pkg/kernel/lib/src/future_or.dart
deleted file mode 100644
index eb8b729..0000000
--- a/pkg/kernel/lib/src/future_or.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// TODO(dmitryas):  Delete the file when a special representation for FutureOr
-// is landed.
-
-import '../ast.dart';
-
-Nullability uniteNullabilities(Nullability a, Nullability b) {
-  if (a == Nullability.nullable || b == Nullability.nullable) {
-    return Nullability.nullable;
-  }
-  if (a == Nullability.legacy || b == Nullability.legacy) {
-    return Nullability.legacy;
-  }
-  if (a == Nullability.undetermined || b == Nullability.undetermined) {
-    return Nullability.undetermined;
-  }
-  return Nullability.nonNullable;
-}
-
-Nullability intersectNullabilities(Nullability a, Nullability b) {
-  if (a == Nullability.nonNullable || b == Nullability.nonNullable) {
-    return Nullability.nonNullable;
-  }
-  if (a == Nullability.undetermined || b == Nullability.undetermined) {
-    return Nullability.undetermined;
-  }
-  if (a == Nullability.legacy || b == Nullability.legacy) {
-    return Nullability.legacy;
-  }
-  return Nullability.nullable;
-}
-
-Nullability computeNullabilityOfFutureOr(
-    InterfaceType futureOr, Class futureOrClass) {
-  assert(_isFutureOr(futureOr, futureOrClass));
-
-  // Performance note: the algorithm is linear.
-  DartType argument = futureOr.typeArguments.single;
-  if (argument is InterfaceType && argument.classNode == futureOrClass) {
-    return uniteNullabilities(
-        computeNullabilityOfFutureOr(argument, futureOrClass),
-        futureOr.nullability);
-  }
-  if (argument is TypeParameterType && argument.promotedBound != null) {
-    DartType promotedBound = argument.promotedBound;
-    if (_isFutureOr(promotedBound, futureOrClass)) {
-      return uniteNullabilities(
-          intersectNullabilities(argument.declaredNullability,
-              computeNullabilityOfFutureOr(promotedBound, futureOrClass)),
-          futureOr.nullability);
-    }
-  }
-  Nullability argumentNullability =
-      argument is InvalidType ? Nullability.undetermined : argument.nullability;
-  return uniteNullabilities(argumentNullability, futureOr.nullability);
-}
-
-bool _isFutureOr(DartType type, Class futureOrClass) {
-  if (type is InterfaceType) {
-    if (futureOrClass != null) {
-      return type.classNode == futureOrClass;
-    } else {
-      return type.classNode.name == 'FutureOr' &&
-          type.classNode.enclosingLibrary.importUri.scheme == 'dart' &&
-          type.classNode.enclosingLibrary.importUri.path == 'async';
-    }
-  }
-  return false;
-}
-
-Nullability computeNullability(DartType type, Class futureOrClass) {
-  if (_isFutureOr(type, futureOrClass)) {
-    return computeNullabilityOfFutureOr(type, futureOrClass);
-  }
-  return type is InvalidType ? Nullability.undetermined : type.nullability;
-}
-
-bool isPotentiallyNullable(DartType type, Class futureOrClass) {
-  Nullability nullability = computeNullability(type, futureOrClass);
-  return nullability == Nullability.nullable ||
-      nullability == Nullability.undetermined;
-}
-
-bool isPotentiallyNonNullable(DartType type, Class futureOrClass) {
-  Nullability nullability = computeNullability(type, futureOrClass);
-  return nullability == Nullability.nonNullable ||
-      nullability == Nullability.undetermined;
-}
diff --git a/pkg/kernel/lib/src/merge_visitor.dart b/pkg/kernel/lib/src/merge_visitor.dart
index fe2cd6e..275b7d88 100644
--- a/pkg/kernel/lib/src/merge_visitor.dart
+++ b/pkg/kernel/lib/src/merge_visitor.dart
@@ -169,6 +169,26 @@
   }
 
   @override
+  DartType visitFutureOrType(FutureOrType a, DartType b) {
+    if (b is FutureOrType) {
+      Nullability nullability = mergeNullability(a.nullability, b.nullability);
+      if (nullability != null) {
+        return mergeFutureOrTypes(a, b, nullability);
+      }
+    }
+    return null;
+  }
+
+  DartType mergeFutureOrTypes(
+      FutureOrType a, FutureOrType b, Nullability nullability) {
+    DartType newTypeArgument = a.typeArgument.accept1(this, b.typeArgument);
+    if (newTypeArgument == null) {
+      return null;
+    }
+    return new FutureOrType(newTypeArgument, nullability);
+  }
+
+  @override
   DartType visitDynamicType(DynamicType a, DartType b) {
     if (b is DynamicType) {
       return a;
diff --git a/pkg/kernel/lib/src/norm.dart b/pkg/kernel/lib/src/norm.dart
index dff554c..ac209fb 100644
--- a/pkg/kernel/lib/src/norm.dart
+++ b/pkg/kernel/lib/src/norm.dart
@@ -4,8 +4,8 @@
 
 import '../ast.dart' hide MapEntry;
 import '../core_types.dart';
+import '../type_algebra.dart';
 
-import 'future_or.dart';
 import 'replacement_visitor.dart';
 
 /// Returns normalization of [type].
@@ -41,56 +41,50 @@
 
   @override
   DartType visitInterfaceType(InterfaceType node) {
-    if (node.classNode == coreTypes.futureOrClass) {
-      DartType typeArgument = node.typeArguments.single;
-      typeArgument = typeArgument.accept(this) ?? typeArgument;
-      if (coreTypes.isTop(typeArgument)) {
-        Nullability nullabilityAsProperty =
-            computeNullability(typeArgument, coreTypes.futureOrClass);
-        assert(nullabilityAsProperty == Nullability.nullable ||
-            nullabilityAsProperty == Nullability.legacy);
-        // [typeArgument] is nullable because it's a top type.  No need to unite
-        // the nullabilities of [node] and [typeArgument].
-        return typeArgument.withDeclaredNullability(nullabilityAsProperty);
-      } else if (typeArgument is InterfaceType &&
-          typeArgument.classNode == coreTypes.objectClass &&
-          typeArgument.nullability == Nullability.nonNullable) {
-        assert(!coreTypes.isTop(typeArgument));
-        // [typeArgument] is non-nullable, so the union of that and the
-        // nullability of [node] is the nullability of [node].
-        return typeArgument.withDeclaredNullability(
-            computeNullability(node, coreTypes.futureOrClass));
-      } else if (typeArgument is NeverType &&
-          typeArgument.nullability == Nullability.nonNullable) {
-        assert(!coreTypes.isTop(typeArgument));
-        assert(!coreTypes.isObject(typeArgument));
-        // [typeArgument] is non-nullable, so the union of that and the
-        // nullability of [node] is the nullability of [node].
-        return new InterfaceType(
-            coreTypes.futureClass,
-            computeNullability(node, coreTypes.futureOrClass),
-            <DartType>[typeArgument]);
-      } else if (coreTypes.isNull(typeArgument)) {
-        assert(!coreTypes.isTop(typeArgument));
-        assert(!coreTypes.isObject(typeArgument));
-        assert(!coreTypes.isBottom(typeArgument));
-        return new InterfaceType(
-            coreTypes.futureClass,
-            uniteNullabilities(typeArgument.nullability,
-                computeNullability(node, coreTypes.futureOrClass)),
-            <DartType>[typeArgument]);
-      }
+    return super
+        .visitInterfaceType(node)
+        ?.withDeclaredNullability(node.nullability);
+  }
+
+  @override
+  DartType visitFutureOrType(FutureOrType node) {
+    DartType typeArgument = node.typeArgument;
+    typeArgument = typeArgument.accept(this) ?? typeArgument;
+    if (coreTypes.isTop(typeArgument)) {
+      assert(typeArgument.nullability == Nullability.nullable ||
+          typeArgument.nullability == Nullability.legacy);
+      // [typeArgument] is nullable because it's a top type.  No need to unite
+      // the nullabilities of [node] and [typeArgument].
+      return typeArgument;
+    } else if (typeArgument is InterfaceType &&
+        typeArgument.classNode == coreTypes.objectClass &&
+        typeArgument.nullability == Nullability.nonNullable) {
+      assert(!coreTypes.isTop(typeArgument));
+      // [typeArgument] is non-nullable, so the union of that and the
+      // nullability of [node] is the nullability of [node].
+      return typeArgument.withDeclaredNullability(node.nullability);
+    } else if (typeArgument is NeverType &&
+        typeArgument.nullability == Nullability.nonNullable) {
+      assert(!coreTypes.isTop(typeArgument));
+      assert(!coreTypes.isObject(typeArgument));
+      // [typeArgument] is non-nullable, so the union of that and the
+      // nullability of [node] is the nullability of [node].
+      return new InterfaceType(
+          coreTypes.futureClass, node.nullability, <DartType>[typeArgument]);
+    } else if (coreTypes.isNull(typeArgument)) {
       assert(!coreTypes.isTop(typeArgument));
       assert(!coreTypes.isObject(typeArgument));
       assert(!coreTypes.isBottom(typeArgument));
-      assert(!coreTypes.isNull(typeArgument));
       return new InterfaceType(
-          coreTypes.futureOrClass,
-          computeNullability(node, coreTypes.futureOrClass),
+          coreTypes.futureClass,
+          uniteNullabilities(typeArgument.nullability, node.nullability),
           <DartType>[typeArgument]);
     }
-    return super.visitInterfaceType(node)?.withDeclaredNullability(
-        computeNullability(node, coreTypes.futureOrClass));
+    assert(!coreTypes.isTop(typeArgument));
+    assert(!coreTypes.isObject(typeArgument));
+    assert(!coreTypes.isBottom(typeArgument));
+    assert(!coreTypes.isNull(typeArgument));
+    return new FutureOrType(typeArgument, node.nullability);
   }
 
   @override
diff --git a/pkg/kernel/lib/src/printer.dart b/pkg/kernel/lib/src/printer.dart
new file mode 100644
index 0000000..82670c4
--- /dev/null
+++ b/pkg/kernel/lib/src/printer.dart
@@ -0,0 +1,453 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import '../ast.dart';
+import 'text_util.dart';
+
+/// AST printer strategy used by default in `Node.toString`.
+///
+/// Don't use this for testing. Instead use [astTextStrategyForTesting] or
+/// make an explicit strategy for the test to avoid test dependency on the
+/// `Node.toString` implementation.
+const AstTextStrategy defaultAstTextStrategy = const AstTextStrategy();
+
+/// Strategy used for printing AST nodes.
+///
+/// This is used to avoid dependency on the `Node.toString` implementations
+/// in testing.
+const AstTextStrategy astTextStrategyForTesting = const AstTextStrategy(
+    includeLibraryNamesInMembers: true,
+    includeLibraryNamesInTypes: true,
+    includeAuxiliaryProperties: false,
+    useMultiline: false);
+
+class AstTextStrategy {
+  /// If `true`, references to classes and typedefs in types are prefixed by the
+  /// name of their enclosing library.
+  final bool includeLibraryNamesInTypes;
+
+  /// If `true`, references to members, classes and typedefs are prefixed by the
+  /// name of their enclosing library.
+  final bool includeLibraryNamesInMembers;
+
+  /// If `true`, auxiliary node properties are on include in the textual
+  /// representation.
+  final bool includeAuxiliaryProperties;
+
+  /// If `true`, newlines are used to separate statements.
+  final bool useMultiline;
+
+  /// If [useMultiline] is `true`, [indentation] is used for indentation.
+  final String indentation;
+
+  /// If non-null, a maximum of [maxStatementDepth] nested statements are
+  /// printed. If exceeded, '...' is printed instead.
+  final int maxStatementDepth;
+
+  /// If non-null, a maximum of [maxStatementsLength] statements are printed
+  /// within the same block.
+  final int maxStatementsLength;
+
+  /// If non-null, a maximum of [maxExpressionDepth] nested expression are
+  /// printed. If exceeded, '...' is printed instead.
+  final int maxExpressionDepth;
+
+  /// If non-null, a maximum of [maxExpressionsLength] expression are printed
+  /// within the same list of expressions, for instance in list/set literals.
+  /// If exceeded, '...' is printed instead.
+  final int maxExpressionsLength;
+
+  const AstTextStrategy(
+      {this.includeLibraryNamesInTypes: false,
+      this.includeLibraryNamesInMembers: false,
+      this.includeAuxiliaryProperties: false,
+      this.useMultiline: true,
+      this.indentation: '  ',
+      this.maxStatementDepth: null,
+      this.maxStatementsLength: null,
+      this.maxExpressionDepth: null,
+      this.maxExpressionsLength: null});
+}
+
+class AstPrinter {
+  final AstTextStrategy _strategy;
+  final StringBuffer _sb = new StringBuffer();
+  int _statementLevel = 0;
+  int _expressionLevel = 0;
+  int _indentationLevel = 0;
+  Map<LabeledStatement, String> _labelNames;
+  Map<VariableDeclaration, String> _variableNames;
+
+  AstPrinter(this._strategy);
+
+  bool get includeAuxiliaryProperties => _strategy.includeAuxiliaryProperties;
+
+  void incIndentation() {
+    _indentationLevel++;
+  }
+
+  void decIndentation() {
+    _indentationLevel--;
+  }
+
+  void write(String value) {
+    _sb.write(value);
+  }
+
+  void writeClassName(Reference reference, {bool forType: false}) {
+    _sb.write(qualifiedClassNameToStringByReference(reference,
+        includeLibraryName: forType
+            ? _strategy.includeLibraryNamesInTypes
+            : _strategy.includeLibraryNamesInMembers));
+  }
+
+  void writeTypedefName(Reference reference) {
+    _sb.write(qualifiedTypedefNameToStringByReference(reference,
+        includeLibraryName: _strategy.includeLibraryNamesInTypes));
+  }
+
+  void writeExtensionName(Reference reference) {
+    _sb.write(qualifiedExtensionNameToStringByReference(reference,
+        includeLibraryName: _strategy.includeLibraryNamesInMembers));
+  }
+
+  void writeMemberName(Reference reference) {
+    _sb.write(qualifiedMemberNameToStringByReference(reference,
+        includeLibraryName: _strategy.includeLibraryNamesInMembers));
+  }
+
+  void writeInterfaceMemberName(Reference reference, Name name) {
+    if (name != null && (reference == null || reference.node == null)) {
+      writeName(name);
+    } else {
+      write('{');
+      _sb.write(qualifiedMemberNameToStringByReference(reference,
+          includeLibraryName: _strategy.includeLibraryNamesInMembers));
+      write('}');
+    }
+  }
+
+  void writeName(Name name) {
+    _sb.write(nameToString(name,
+        includeLibraryName: _strategy.includeLibraryNamesInMembers));
+  }
+
+  void writeNamedType(NamedType node) {
+    node.toTextInternal(this);
+  }
+
+  void writeTypeParameterName(TypeParameter parameter) {
+    _sb.write(qualifiedTypeParameterNameToString(parameter,
+        includeLibraryName: _strategy.includeLibraryNamesInTypes));
+  }
+
+  void newLine() {
+    if (_strategy.useMultiline) {
+      _sb.writeln();
+      _sb.write(_strategy.indentation * _indentationLevel);
+    } else {
+      _sb.write(' ');
+    }
+  }
+
+  String getLabelName(LabeledStatement node) {
+    _labelNames ??= {};
+    return _labelNames[node] ??= 'label${_labelNames.length}';
+  }
+
+  String getVariableName(VariableDeclaration node) {
+    if (node.name != null) {
+      return node.name;
+    }
+    _variableNames ??= {};
+    return _variableNames[node] ??= '#${_variableNames.length}';
+  }
+
+  String getSwitchCaseName(SwitchCase node) {
+    if (node.isDefault) {
+      return '"default:"';
+    } else {
+      return '"case ${node.expressions.first.toText(_strategy)}:"';
+    }
+  }
+
+  void writeStatement(Statement node) {
+    int oldStatementLevel = _statementLevel;
+    _statementLevel++;
+    if (_strategy.maxStatementDepth != null &&
+        _statementLevel > _strategy.maxStatementDepth) {
+      _sb.write('...');
+    } else {
+      node.toTextInternal(this);
+    }
+    _statementLevel = oldStatementLevel;
+  }
+
+  void writeExpression(Expression node, {int minimumPrecedence}) {
+    int oldExpressionLevel = _expressionLevel;
+    _expressionLevel++;
+    if (_strategy.maxExpressionDepth != null &&
+        _expressionLevel > _strategy.maxExpressionDepth) {
+      _sb.write('...');
+    } else {
+      bool needsParentheses =
+          minimumPrecedence != null && node.precedence < minimumPrecedence;
+      if (needsParentheses) {
+        _sb.write('(');
+      }
+      node.toTextInternal(this);
+      if (needsParentheses) {
+        _sb.write(')');
+      }
+    }
+    _expressionLevel = oldExpressionLevel;
+  }
+
+  void writeNamedExpression(NamedExpression node) {
+    node.toTextInternal(this);
+  }
+
+  void writeCatch(Catch node) {
+    node.toTextInternal(this);
+  }
+
+  void writeSwitchCase(SwitchCase node) {
+    node.toTextInternal(this);
+  }
+
+  void writeType(DartType node) {
+    node.toTextInternal(this);
+  }
+
+  void writeConstant(Constant node) {
+    node.toTextInternal(this);
+  }
+
+  void writeMapEntry(MapEntry node) {
+    node.toTextInternal(this);
+  }
+
+  /// Writes [types] to the printer buffer separated by ', '.
+  void writeTypes(List<DartType> types) {
+    for (int index = 0; index < types.length; index++) {
+      if (index > 0) {
+        _sb.write(', ');
+      }
+      writeType(types[index]);
+    }
+  }
+
+  /// If [types] is non-empty, writes [types] to the printer buffer delimited by
+  /// '<' and '>', and separated by ', '.
+  void writeTypeArguments(List<DartType> types) {
+    if (types.isNotEmpty) {
+      _sb.write('<');
+      writeTypes(types);
+      _sb.write('>');
+    }
+  }
+
+  /// If [typeParameters] is non-empty, writes [typeParameters] to the printer
+  /// buffer delimited by '<' and '>', and separated by ', '.
+  ///
+  /// The bound of a type parameter is included, as 'T extends Bound', if the
+  /// bound is neither `Object?` nor `Object*`.
+  void writeTypeParameters(List<TypeParameter> typeParameters) {
+    if (typeParameters.isNotEmpty) {
+      _sb.write("<");
+      String comma = "";
+      for (TypeParameter typeParameter in typeParameters) {
+        _sb.write(comma);
+        _sb.write(typeParameter.name);
+        DartType bound = typeParameter.bound;
+
+        bool isTopObject(DartType type) {
+          if (type is InterfaceType &&
+              type.className.node != null &&
+              type.classNode.name == 'Object') {
+            Uri uri = type.classNode.enclosingLibrary?.importUri;
+            return uri?.scheme == 'dart' &&
+                uri?.path == 'core' &&
+                (type.nullability == Nullability.legacy ||
+                    type.nullability == Nullability.nullable);
+          }
+          return false;
+        }
+
+        if (!isTopObject(bound) || isTopObject(typeParameter.defaultType)) {
+          // Include explicit bounds only.
+          _sb.write(' extends ');
+          writeType(bound);
+        }
+        comma = ", ";
+      }
+      _sb.write(">");
+    }
+  }
+
+  /// Writes [expressions] to the printer buffer separated by ', '.
+  void writeExpressions(List<Expression> expressions) {
+    if (expressions.isNotEmpty &&
+        _strategy.maxExpressionDepth != null &&
+        _expressionLevel + 1 > _strategy.maxExpressionDepth) {
+      // The maximum expression depth will be exceeded for all [expressions].
+      // Print the list as one occurrence '...' instead one per expression.
+      _sb.write('...');
+    } else if (_strategy.maxExpressionsLength != null &&
+        expressions.length > _strategy.maxExpressionsLength) {
+      _sb.write('...');
+    } else {
+      for (int index = 0; index < expressions.length; index++) {
+        if (index > 0) {
+          _sb.write(', ');
+        }
+        writeExpression(expressions[index]);
+      }
+    }
+  }
+
+  /// Writes [statements] to the printer buffer delimited by '{' and '}'.
+  ///
+  /// If using a multiline strategy, the statements printed on separate lines
+  /// that are indented one level.
+  void writeBlock(List<Statement> statements) {
+    if (statements.isEmpty) {
+      write('{}');
+    } else {
+      write('{');
+      incIndentation();
+      writeStatements(statements);
+      decIndentation();
+      newLine();
+      write('}');
+    }
+  }
+
+  /// Writes [statements] to the printer buffer.
+  ///
+  /// If using a multiline strategy, the statements printed on separate lines
+  /// that are indented one level.
+  void writeStatements(List<Statement> statements) {
+    if (statements.isNotEmpty &&
+        _strategy.maxStatementDepth != null &&
+        _statementLevel + 1 > _strategy.maxStatementDepth) {
+      // The maximum statement depth will be exceeded for all [statements].
+      // Print the list as one occurrence '...' instead one per statement.
+      _sb.write(' ...');
+    } else if (_strategy.maxStatementsLength != null &&
+        statements.length > _strategy.maxStatementsLength) {
+      _sb.write(' ...');
+    } else {
+      for (Statement statement in statements) {
+        newLine();
+        writeStatement(statement);
+      }
+    }
+  }
+
+  /// Writes arguments [node] to the printer buffer.
+  ///
+  /// If [includeTypeArguments] is `true` type arguments in [node] are included.
+  /// Otherwise only the positional and named arguments are included.
+  void writeArguments(Arguments node, {bool includeTypeArguments: true}) {
+    node.toTextInternal(this, includeTypeArguments: includeTypeArguments);
+  }
+
+  /// Writes the variable declaration [node] to the printer buffer.
+  ///
+  /// If [includeModifiersAndType] is `true`, the declaration is prefixed by
+  /// the modifiers and declared type of the variable. Otherwise only the
+  /// name and the initializer, if present, are included.
+  ///
+  /// If [isLate] and [type] are provided, these values are used instead of
+  /// the corresponding properties on [node].
+  void writeVariableDeclaration(VariableDeclaration node,
+      {bool includeModifiersAndType: true, bool isLate, DartType type}) {
+    if (includeModifiersAndType) {
+      if (node.isRequired) {
+        _sb.write('required ');
+      }
+      if (isLate ?? node.isLate) {
+        _sb.write('late ');
+      }
+      if (node.isFinal) {
+        _sb.write('final ');
+      }
+      if (node.isConst) {
+        _sb.write('const ');
+      }
+      writeType(type ?? node.type);
+      _sb.write(' ');
+    }
+    _sb.write(getVariableName(node));
+    if (node.initializer != null && !node.isRequired) {
+      _sb.write(' = ');
+      writeExpression(node.initializer);
+    }
+  }
+
+  void writeFunctionNode(FunctionNode node, String name) {
+    writeType(node.returnType);
+    _sb.write(' ');
+    _sb.write(name);
+    if (node.typeParameters.isNotEmpty) {
+      _sb.write('<');
+      for (int index = 0; index < node.typeParameters.length; index++) {
+        if (index > 0) {
+          _sb.write(', ');
+        }
+        _sb.write(node.typeParameters[index].name);
+        _sb.write(' extends ');
+        writeType(node.typeParameters[index].bound);
+      }
+      _sb.write('>');
+    }
+    _sb.write('(');
+    for (int index = 0; index < node.positionalParameters.length; index++) {
+      if (index > 0) {
+        _sb.write(', ');
+      }
+      if (index == node.requiredParameterCount) {
+        _sb.write('[');
+      }
+      writeVariableDeclaration(node.positionalParameters[index]);
+    }
+    if (node.requiredParameterCount < node.positionalParameters.length) {
+      _sb.write(']');
+    }
+    if (node.namedParameters.isNotEmpty) {
+      if (node.positionalParameters.isNotEmpty) {
+        _sb.write(', ');
+      }
+      _sb.write('{');
+      for (int index = 0; index < node.namedParameters.length; index++) {
+        if (index > 0) {
+          _sb.write(', ');
+        }
+        writeVariableDeclaration(node.namedParameters[index]);
+      }
+      _sb.write('}');
+    }
+    _sb.write(')');
+    Statement body = node.body;
+    if (body != null) {
+      if (body is ReturnStatement) {
+        _sb.write(' => ');
+        writeExpression(body.expression);
+      } else {
+        _sb.write(' ');
+        writeStatement(body);
+      }
+    } else {
+      _sb.write(';');
+    }
+  }
+
+  void writeConstantMapEntry(ConstantMapEntry node) {
+    node.toTextInternal(this);
+  }
+
+  /// Returns the text written to this printer.
+  String getText() => _sb.toString();
+}
diff --git a/pkg/kernel/lib/src/replacement_visitor.dart b/pkg/kernel/lib/src/replacement_visitor.dart
index c05bae0..72ddff6 100644
--- a/pkg/kernel/lib/src/replacement_visitor.dart
+++ b/pkg/kernel/lib/src/replacement_visitor.dart
@@ -159,6 +159,24 @@
   }
 
   @override
+  DartType visitFutureOrType(FutureOrType node) {
+    Nullability newNullability = visitNullability(node);
+    DartType newTypeArgument = node.typeArgument.accept(this);
+    return createFutureOrType(node, newNullability, newTypeArgument);
+  }
+
+  DartType createFutureOrType(
+      FutureOrType node, Nullability newNullability, DartType newTypeArgument) {
+    if (newNullability == null && newTypeArgument == null) {
+      // No nullability or type arguments needed to be substituted.
+      return null;
+    } else {
+      return new FutureOrType(newTypeArgument ?? node.typeArgument,
+          newNullability ?? node.declaredNullability);
+    }
+  }
+
+  @override
   DartType visitDynamicType(DynamicType node) => null;
 
   @override
diff --git a/pkg/kernel/lib/src/text_util.dart b/pkg/kernel/lib/src/text_util.dart
index fd3f6d7..c04deb8 100644
--- a/pkg/kernel/lib/src/text_util.dart
+++ b/pkg/kernel/lib/src/text_util.dart
@@ -18,6 +18,16 @@
   throw "Unknown Nullability: $nullability";
 }
 
+String nameToString(Name node, {bool includeLibraryName: false}) {
+  if (node == null) {
+    return 'null';
+  } else if (node.library != null && includeLibraryName) {
+    return '${libraryNameToString(node.library)}::${node.name}';
+  } else {
+    return node.name;
+  }
+}
+
 String libraryNameToString(Library node) {
   return node == null ? 'null' : node.name ?? 'library ${node.importUri}';
 }
@@ -33,6 +43,47 @@
   }
 }
 
+String qualifiedCanonicalNameToString(CanonicalName canonicalName,
+    {bool includeLibraryName: false}) {
+  if (canonicalName.isRoot) {
+    return '<root>';
+  } else if (canonicalName.parent.isRoot) {
+    return canonicalName.name;
+  } else if (canonicalName.parent.parent.isRoot) {
+    if (!includeLibraryName) {
+      return canonicalName.name;
+    }
+    String parentName = qualifiedCanonicalNameToString(canonicalName.parent,
+        includeLibraryName: includeLibraryName);
+    return '$parentName::${canonicalName.name}';
+  } else {
+    String parentName = qualifiedCanonicalNameToString(canonicalName.parent,
+        includeLibraryName: includeLibraryName);
+    return '$parentName.${canonicalName.name}';
+  }
+}
+
+String qualifiedClassNameToStringByReference(Reference reference,
+    {bool includeLibraryName: false}) {
+  if (reference == null) {
+    return '<missing-class-reference>';
+  } else {
+    Class node = reference.node;
+    if (node != null) {
+      return qualifiedClassNameToString(node,
+          includeLibraryName: includeLibraryName);
+    } else {
+      CanonicalName canonicalName = reference.canonicalName;
+      if (canonicalName != null) {
+        return qualifiedCanonicalNameToString(canonicalName,
+            includeLibraryName: includeLibraryName);
+      } else {
+        return '<unlinked-class-reference>';
+      }
+    }
+  }
+}
+
 String classNameToString(Class node) {
   return node == null
       ? 'null'
@@ -50,6 +101,27 @@
   }
 }
 
+String qualifiedExtensionNameToStringByReference(Reference reference,
+    {bool includeLibraryName: false}) {
+  if (reference == null) {
+    return '<missing-extension-reference>';
+  } else {
+    Extension node = reference.node;
+    if (node != null) {
+      return qualifiedExtensionNameToString(node,
+          includeLibraryName: includeLibraryName);
+    } else {
+      CanonicalName canonicalName = reference.canonicalName;
+      if (canonicalName != null) {
+        return qualifiedCanonicalNameToString(canonicalName,
+            includeLibraryName: includeLibraryName);
+      } else {
+        return '<unlinked-extension-reference>';
+      }
+    }
+  }
+}
+
 String extensionNameToString(Extension node) {
   return node == null
       ? 'null'
@@ -68,6 +140,27 @@
   }
 }
 
+String qualifiedTypedefNameToStringByReference(Reference reference,
+    {bool includeLibraryName: false}) {
+  if (reference == null) {
+    return '<missing-typedef-reference>';
+  } else {
+    Typedef node = reference.node;
+    if (node != null) {
+      return qualifiedTypedefNameToString(node,
+          includeLibraryName: includeLibraryName);
+    } else {
+      CanonicalName canonicalName = reference.canonicalName;
+      if (canonicalName != null) {
+        return qualifiedCanonicalNameToString(canonicalName,
+            includeLibraryName: includeLibraryName);
+      } else {
+        return '<unlinked-typedef-reference>';
+      }
+    }
+  }
+}
+
 String typedefNameToString(Typedef node) {
   return node == null
       ? 'null'
@@ -90,6 +183,27 @@
   }
 }
 
+String qualifiedMemberNameToStringByReference(Reference reference,
+    {bool includeLibraryName: false}) {
+  if (reference == null) {
+    return '<missing-member-reference>';
+  } else {
+    Member node = reference.node;
+    if (node != null) {
+      return qualifiedMemberNameToString(node,
+          includeLibraryName: includeLibraryName);
+    } else {
+      CanonicalName canonicalName = reference.canonicalName;
+      if (canonicalName != null) {
+        return qualifiedCanonicalNameToString(canonicalName,
+            includeLibraryName: includeLibraryName);
+      } else {
+        return '<unlinked-member-reference>';
+      }
+    }
+  }
+}
+
 String memberNameToString(Member node) {
   return node.name?.name ??
       "null-named member ${node.runtimeType} ${node.hashCode}";
@@ -121,3 +235,44 @@
   return node.name ??
       "null-named TypeParameter ${node.runtimeType} ${node.hashCode}";
 }
+
+String getEscapedCharacter(int codeUnit) {
+  switch (codeUnit) {
+    case 9:
+      return r'\t';
+    case 10:
+      return r'\n';
+    case 11:
+      return r'\v';
+    case 12:
+      return r'\f';
+    case 13:
+      return r'\r';
+    case 34:
+      return r'\"';
+    case 36:
+      return r'\$';
+    case 92:
+      return r'\\';
+    default:
+      if (codeUnit < 32 || codeUnit > 126) {
+        return r'\u' + '$codeUnit'.padLeft(4, '0');
+      } else {
+        return null;
+      }
+  }
+}
+
+String escapeString(String string) {
+  StringBuffer buffer;
+  for (int i = 0; i < string.length; ++i) {
+    String character = getEscapedCharacter(string.codeUnitAt(i));
+    if (character != null) {
+      buffer ??= new StringBuffer(string.substring(0, i));
+      buffer.write(character);
+    } else {
+      buffer?.write(string[i]);
+    }
+  }
+  return buffer == null ? string : buffer.toString();
+}
diff --git a/pkg/kernel/lib/src/types.dart b/pkg/kernel/lib/src/types.dart
index 2ae3573..a50dde0 100644
--- a/pkg/kernel/lib/src/types.dart
+++ b/pkg/kernel/lib/src/types.dart
@@ -9,6 +9,7 @@
         DartType,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         InvalidType,
         Library,
@@ -30,8 +31,6 @@
 
 import '../type_environment.dart' show IsSubtypeOf, SubtypeCheckMode;
 
-import 'future_or.dart';
-
 class Types {
   final ClassHierarchyBase hierarchy;
 
@@ -91,67 +90,21 @@
       return const IsSubtypeOf.never();
     }
     if (s is NeverType) {
-      return new IsSubtypeOf.basedSolelyOnNullabilities(
-          s, t, hierarchy.coreTypes.futureOrClass);
+      return new IsSubtypeOf.basedSolelyOnNullabilities(s, t);
     }
 
     if (t is InterfaceType) {
       Class cls = t.classNode;
-      if (cls == hierarchy.coreTypes.objectClass &&
-          !(s is InterfaceType &&
-              s.classNode == hierarchy.coreTypes.futureOrClass)) {
-        return new IsSubtypeOf.basedSolelyOnNullabilities(
-            s, t, hierarchy.coreTypes.futureOrClass);
+      if (cls == hierarchy.coreTypes.objectClass && s is! FutureOrType) {
+        return new IsSubtypeOf.basedSolelyOnNullabilities(s, t);
       }
-      if (cls == hierarchy.coreTypes.futureOrClass) {
-        const IsFutureOrSubtypeOf relation = const IsFutureOrSubtypeOf();
-        if (s is DynamicType) {
-          return relation.isDynamicRelated(s, t, this);
-        } else if (s is VoidType) {
-          return relation.isVoidRelated(s, t, this);
-        } else if (s is InterfaceType) {
-          return s.classNode == hierarchy.coreTypes.futureOrClass
-              ? relation.isFutureOrRelated(s, t, this)
-              : relation.isInterfaceRelated(s, t, this);
-        } else if (s is FunctionType) {
-          return relation.isFunctionRelated(s, t, this);
-        } else if (s is TypeParameterType) {
-          return s.promotedBound == null
-              ? relation.isTypeParameterRelated(s, t, this)
-              : relation.isIntersectionRelated(s, t, this);
-        } else if (s is TypedefType) {
-          return relation.isTypedefRelated(s, t, this);
-        }
-      } else {
-        const IsInterfaceSubtypeOf relation = const IsInterfaceSubtypeOf();
-        if (s is DynamicType) {
-          return relation.isDynamicRelated(s, t, this);
-        } else if (s is VoidType) {
-          return relation.isVoidRelated(s, t, this);
-        } else if (s is InterfaceType) {
-          return s.classNode == hierarchy.coreTypes.futureOrClass
-              ? relation.isFutureOrRelated(s, t, this)
-              : relation.isInterfaceRelated(s, t, this);
-        } else if (s is FunctionType) {
-          return relation.isFunctionRelated(s, t, this);
-        } else if (s is TypeParameterType) {
-          return s.promotedBound == null
-              ? relation.isTypeParameterRelated(s, t, this)
-              : relation.isIntersectionRelated(s, t, this);
-        } else if (s is TypedefType) {
-          return relation.isTypedefRelated(s, t, this);
-        }
-      }
-    } else if (t is FunctionType) {
-      const IsFunctionSubtypeOf relation = const IsFunctionSubtypeOf();
+      const IsInterfaceSubtypeOf relation = const IsInterfaceSubtypeOf();
       if (s is DynamicType) {
         return relation.isDynamicRelated(s, t, this);
       } else if (s is VoidType) {
         return relation.isVoidRelated(s, t, this);
       } else if (s is InterfaceType) {
-        return s.classNode == hierarchy.coreTypes.futureOrClass
-            ? relation.isFutureOrRelated(s, t, this)
-            : relation.isInterfaceRelated(s, t, this);
+        return relation.isInterfaceRelated(s, t, this);
       } else if (s is FunctionType) {
         return relation.isFunctionRelated(s, t, this);
       } else if (s is TypeParameterType) {
@@ -160,6 +113,27 @@
             : relation.isIntersectionRelated(s, t, this);
       } else if (s is TypedefType) {
         return relation.isTypedefRelated(s, t, this);
+      } else if (s is FutureOrType) {
+        return relation.isFutureOrRelated(s, t, this);
+      }
+    } else if (t is FunctionType) {
+      const IsFunctionSubtypeOf relation = const IsFunctionSubtypeOf();
+      if (s is DynamicType) {
+        return relation.isDynamicRelated(s, t, this);
+      } else if (s is VoidType) {
+        return relation.isVoidRelated(s, t, this);
+      } else if (s is InterfaceType) {
+        return relation.isInterfaceRelated(s, t, this);
+      } else if (s is FunctionType) {
+        return relation.isFunctionRelated(s, t, this);
+      } else if (s is TypeParameterType) {
+        return s.promotedBound == null
+            ? relation.isTypeParameterRelated(s, t, this)
+            : relation.isIntersectionRelated(s, t, this);
+      } else if (s is TypedefType) {
+        return relation.isTypedefRelated(s, t, this);
+      } else if (s is FutureOrType) {
+        return relation.isFutureOrRelated(s, t, this);
       }
     } else if (t is TypeParameterType) {
       if (t.promotedBound == null) {
@@ -170,9 +144,7 @@
         } else if (s is VoidType) {
           return relation.isVoidRelated(s, t, this);
         } else if (s is InterfaceType) {
-          return s.classNode == hierarchy.coreTypes.futureOrClass
-              ? relation.isFutureOrRelated(s, t, this)
-              : relation.isInterfaceRelated(s, t, this);
+          return relation.isInterfaceRelated(s, t, this);
         } else if (s is FunctionType) {
           return relation.isFunctionRelated(s, t, this);
         } else if (s is TypeParameterType) {
@@ -181,6 +153,8 @@
               : relation.isIntersectionRelated(s, t, this);
         } else if (s is TypedefType) {
           return relation.isTypedefRelated(s, t, this);
+        } else if (s is FutureOrType) {
+          return relation.isFutureOrRelated(s, t, this);
         }
       } else {
         const IsIntersectionSubtypeOf relation =
@@ -190,9 +164,7 @@
         } else if (s is VoidType) {
           return relation.isVoidRelated(s, t, this);
         } else if (s is InterfaceType) {
-          return s.classNode == hierarchy.coreTypes.futureOrClass
-              ? relation.isFutureOrRelated(s, t, this)
-              : relation.isInterfaceRelated(s, t, this);
+          return relation.isInterfaceRelated(s, t, this);
         } else if (s is FunctionType) {
           return relation.isFunctionRelated(s, t, this);
         } else if (s is TypeParameterType) {
@@ -201,6 +173,8 @@
               : relation.isIntersectionRelated(s, t, this);
         } else if (s is TypedefType) {
           return relation.isTypedefRelated(s, t, this);
+        } else if (s is FutureOrType) {
+          return relation.isFutureOrRelated(s, t, this);
         }
       }
     } else if (t is TypedefType) {
@@ -210,9 +184,7 @@
       } else if (s is VoidType) {
         return relation.isVoidRelated(s, t, this);
       } else if (s is InterfaceType) {
-        return s.classNode == hierarchy.coreTypes.futureOrClass
-            ? relation.isFutureOrRelated(s, t, this)
-            : relation.isInterfaceRelated(s, t, this);
+        return relation.isInterfaceRelated(s, t, this);
       } else if (s is FunctionType) {
         return relation.isFunctionRelated(s, t, this);
       } else if (s is TypeParameterType) {
@@ -221,6 +193,27 @@
             : relation.isIntersectionRelated(s, t, this);
       } else if (s is TypedefType) {
         return relation.isTypedefRelated(s, t, this);
+      } else if (s is FutureOrType) {
+        return relation.isFutureOrRelated(s, t, this);
+      }
+    } else if (t is FutureOrType) {
+      const IsFutureOrSubtypeOf relation = const IsFutureOrSubtypeOf();
+      if (s is DynamicType) {
+        return relation.isDynamicRelated(s, t, this);
+      } else if (s is VoidType) {
+        return relation.isVoidRelated(s, t, this);
+      } else if (s is InterfaceType) {
+        return relation.isInterfaceRelated(s, t, this);
+      } else if (s is FunctionType) {
+        return relation.isFunctionRelated(s, t, this);
+      } else if (s is TypeParameterType) {
+        return s.promotedBound == null
+            ? relation.isTypeParameterRelated(s, t, this)
+            : relation.isIntersectionRelated(s, t, this);
+      } else if (s is TypedefType) {
+        return relation.isTypedefRelated(s, t, this);
+      } else if (s is FutureOrType) {
+        return relation.isFutureOrRelated(s, t, this);
       }
     } else if (t is NeverType) {
       const IsNeverTypeSubtypeOf relation = const IsNeverTypeSubtypeOf();
@@ -238,6 +231,8 @@
             : relation.isIntersectionRelated(s, t, this);
       } else if (s is TypedefType) {
         return relation.isTypedefRelated(s, t, this);
+      } else if (s is FutureOrType) {
+        return relation.isFutureOrRelated(s, t, this);
       }
     } else {
       throw "Unhandled type: ${t.runtimeType}";
@@ -278,8 +273,6 @@
 
   static List<Object> typeChecksForTesting;
 
-  Class get futureOrClass => hierarchy.coreTypes.futureOrClass;
-
   InterfaceType getTypeAsInstanceOf(InterfaceType type, Class superclass,
       Library clientLibrary, CoreTypes coreTypes) {
     return hierarchy.getTypeAsInstanceOf(
@@ -319,7 +312,7 @@
 
   IsSubtypeOf isFunctionRelated(FunctionType s, T t, Types types);
 
-  IsSubtypeOf isFutureOrRelated(InterfaceType futureOr, T t, Types types);
+  IsSubtypeOf isFutureOrRelated(FutureOrType s, T t, Types types);
 
   IsSubtypeOf isTypeParameterRelated(TypeParameterType s, T t, Types types);
 
@@ -335,8 +328,7 @@
     if (s.classNode == types.hierarchy.coreTypes.nullClass) {
       // This is an optimization, to avoid instantiating unnecessary type
       // arguments in getKernelTypeAsInstanceOf.
-      return new IsSubtypeOf.basedSolelyOnNullabilities(
-          s, t, types.hierarchy.coreTypes.futureOrClass);
+      return new IsSubtypeOf.basedSolelyOnNullabilities(s, t);
     }
     List<DartType> asSupertypeArguments =
         types.hierarchy.getTypeArgumentsAsInstanceOf(s, t.classNode);
@@ -346,32 +338,28 @@
     return types
         .areTypeArgumentsOfSubtypeKernel(
             asSupertypeArguments, t.typeArguments, t.classNode.typeParameters)
-        .and(new IsSubtypeOf.basedSolelyOnNullabilities(
-            s, t, types.hierarchy.coreTypes.futureOrClass));
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
   IsSubtypeOf isTypeParameterRelated(
       TypeParameterType s, InterfaceType t, Types types) {
-    return types.performNullabilityAwareSubtypeCheck(s.parameter.bound, t).and(
-        new IsSubtypeOf.basedSolelyOnNullabilities(
-            s, t, types.hierarchy.coreTypes.futureOrClass));
+    return types
+        .performNullabilityAwareSubtypeCheck(s.parameter.bound, t)
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
-  IsSubtypeOf isFutureOrRelated(
-      InterfaceType futureOr, InterfaceType t, Types types) {
-    List<DartType> arguments = futureOr.typeArguments;
+  IsSubtypeOf isFutureOrRelated(FutureOrType s, InterfaceType t, Types types) {
     // Rules 7.1 and 7.2.
     return types
-        .performNullabilityAwareSubtypeCheck(arguments.single, t)
+        .performNullabilityAwareSubtypeCheck(s.typeArgument, t)
         .andSubtypeCheckFor(
             new InterfaceType(types.hierarchy.coreTypes.futureClass,
-                Nullability.nonNullable, arguments),
+                Nullability.nonNullable, [s.typeArgument]),
             t,
             types)
-        .and(new IsSubtypeOf.basedSolelyOnNullabilities(
-            futureOr, t, types.hierarchy.coreTypes.futureOrClass));
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
@@ -389,17 +377,16 @@
   @override
   IsSubtypeOf isFunctionRelated(FunctionType s, InterfaceType t, Types types) {
     return t.classNode == types.hierarchy.coreTypes.functionClass
-        ? new IsSubtypeOf.basedSolelyOnNullabilities(
-            s, t, types.hierarchy.coreTypes.futureOrClass)
+        ? new IsSubtypeOf.basedSolelyOnNullabilities(s, t)
         : const IsSubtypeOf.never(); // Rule 14.
   }
 
   @override
   IsSubtypeOf isTypedefRelated(TypedefType s, InterfaceType t, Types types) {
     // Rule 5.
-    return types.performNullabilityAwareSubtypeCheck(s.unalias, t).and(
-        new IsSubtypeOf.basedSolelyOnNullabilities(
-            s, t, types.hierarchy.coreTypes.futureOrClass));
+    return types
+        .performNullabilityAwareSubtypeCheck(s.unalias, t)
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
@@ -505,16 +492,14 @@
         }
       }
     }
-    return result.and(
-        new IsSubtypeOf.basedSolelyOnNullabilities(s, t, types.futureOrClass));
+    return result.and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
   IsSubtypeOf isInterfaceRelated(InterfaceType s, FunctionType t, Types types) {
     if (s.classNode == types.hierarchy.coreTypes.nullClass) {
       // Rule 4.
-      return new IsSubtypeOf.basedSolelyOnNullabilities(
-          s, t, types.futureOrClass);
+      return new IsSubtypeOf.basedSolelyOnNullabilities(s, t);
     }
     return const IsSubtypeOf.never();
   }
@@ -525,8 +510,7 @@
   }
 
   @override
-  IsSubtypeOf isFutureOrRelated(
-      InterfaceType futureOr, FunctionType t, Types types) {
+  IsSubtypeOf isFutureOrRelated(FutureOrType s, FunctionType t, Types types) {
     return const IsSubtypeOf.never();
   }
 
@@ -542,8 +526,9 @@
   IsSubtypeOf isTypeParameterRelated(
       TypeParameterType s, FunctionType t, Types types) {
     // Rule 13.
-    return types.performNullabilityAwareSubtypeCheck(s.parameter.bound, t).and(
-        new IsSubtypeOf.basedSolelyOnNullabilities(s, t, types.futureOrClass));
+    return types
+        .performNullabilityAwareSubtypeCheck(s.parameter.bound, t)
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
@@ -574,8 +559,7 @@
       // additional constraint, namely that they will be equal at run time.
       return result;
     }
-    return result.and(
-        new IsSubtypeOf.basedSolelyOnNullabilities(s, t, types.futureOrClass));
+    return result.and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
@@ -593,8 +577,7 @@
         // additional constraint, namely that they will be equal at run time.
         return const IsSubtypeOf.always();
       }
-      return new IsSubtypeOf.basedSolelyOnNullabilities(
-          intersection, t, types.futureOrClass);
+      return new IsSubtypeOf.basedSolelyOnNullabilities(intersection, t);
     }
 
     // Rule 12.
@@ -609,8 +592,7 @@
       InterfaceType s, TypeParameterType t, Types types) {
     if (s.classNode == types.hierarchy.coreTypes.nullClass) {
       // Rule 4.
-      return new IsSubtypeOf.basedSolelyOnNullabilities(
-          s, t, types.futureOrClass);
+      return new IsSubtypeOf.basedSolelyOnNullabilities(s, t);
     }
     return const IsSubtypeOf.never();
   }
@@ -629,7 +611,7 @@
 
   @override
   IsSubtypeOf isFutureOrRelated(
-      InterfaceType futureOr, TypeParameterType t, Types types) {
+      FutureOrType s, TypeParameterType t, Types types) {
     return const IsSubtypeOf.never();
   }
 
@@ -664,9 +646,8 @@
   }
 
   @override
-  IsSubtypeOf isFutureOrRelated(
-      InterfaceType futureOr, TypedefType t, Types types) {
-    return types.performNullabilityAwareSubtypeCheck(futureOr, t.unalias);
+  IsSubtypeOf isFutureOrRelated(FutureOrType s, TypedefType t, Types types) {
+    return types.performNullabilityAwareSubtypeCheck(s, t.unalias);
   }
 
   @override
@@ -692,47 +673,36 @@
   }
 }
 
-class IsFutureOrSubtypeOf extends TypeRelation<InterfaceType> {
+class IsFutureOrSubtypeOf extends TypeRelation<FutureOrType> {
   const IsFutureOrSubtypeOf();
 
   @override
-  IsSubtypeOf isInterfaceRelated(
-      InterfaceType s, InterfaceType futureOr, Types types) {
-    List<DartType> arguments = futureOr.typeArguments;
-
-    Nullability unitedNullability = computeNullabilityOfFutureOr(
-        futureOr, types.hierarchy.coreTypes.futureOrClass);
-
+  IsSubtypeOf isInterfaceRelated(InterfaceType s, FutureOrType t, Types types) {
     return types
         // Rule 11.
         .performNullabilityAwareSubtypeCheck(
-            s, arguments.single.withDeclaredNullability(unitedNullability))
+            s, t.typeArgument.withDeclaredNullability(t.nullability))
         // Rule 10.
         .orSubtypeCheckFor(
             s,
             new InterfaceType(types.hierarchy.coreTypes.futureClass,
-                unitedNullability, arguments),
+                t.nullability, [t.typeArgument]),
             types);
   }
 
   @override
-  IsSubtypeOf isFutureOrRelated(
-      InterfaceType sFutureOr, InterfaceType tFutureOr, Types types) {
+  IsSubtypeOf isFutureOrRelated(FutureOrType s, FutureOrType t, Types types) {
     // This follows from combining rules 7, 10, and 11.
-    DartType sArgument = sFutureOr.typeArguments.single;
-    DartType tArgument = tFutureOr.typeArguments.single;
+    DartType sArgument = s.typeArgument;
+    DartType tArgument = t.typeArgument;
     DartType sFutureOfArgument = new InterfaceType(
         types.hierarchy.coreTypes.futureClass,
         Nullability.nonNullable,
-        sFutureOr.typeArguments);
+        [sArgument]);
     DartType tFutureOfArgument = new InterfaceType(
         types.hierarchy.coreTypes.futureClass,
         Nullability.nonNullable,
-        tFutureOr.typeArguments);
-    Nullability sNullability = computeNullabilityOfFutureOr(
-        sFutureOr, types.hierarchy.coreTypes.futureOrClass);
-    Nullability tNullability = computeNullabilityOfFutureOr(
-        tFutureOr, types.hierarchy.coreTypes.futureOrClass);
+        [tArgument]);
     // The following is an optimized is-subtype-of test for the case where
     // both LHS and RHS are FutureOrs.  It's based on the following:
     // FutureOr<X> <: FutureOr<Y> iff X <: Y OR (X <: Future<Y> AND
@@ -770,82 +740,63 @@
         .or(types
             .performNullabilityAwareSubtypeCheck(sArgument, tFutureOfArgument)
             .andSubtypeCheckFor(sFutureOfArgument, tArgument, types))
-        .and(new IsSubtypeOf.basedSolelyOnNullabilities(
-            sFutureOr.withDeclaredNullability(sNullability),
-            tFutureOr.withDeclaredNullability(tNullability),
-            types.futureOrClass));
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   @override
-  IsSubtypeOf isDynamicRelated(
-      DynamicType s, InterfaceType futureOr, Types types) {
+  IsSubtypeOf isDynamicRelated(DynamicType s, FutureOrType t, Types types) {
     // Rule 11.
-    DartType argument = futureOr.typeArguments.single;
     return types.performNullabilityAwareSubtypeCheck(
-        s,
-        argument.withDeclaredNullability(computeNullabilityOfFutureOr(
-            futureOr, types.hierarchy.coreTypes.futureOrClass)));
+        s, t.typeArgument.withDeclaredNullability(t.nullability));
   }
 
   @override
-  IsSubtypeOf isVoidRelated(VoidType s, InterfaceType futureOr, Types types) {
+  IsSubtypeOf isVoidRelated(VoidType s, FutureOrType t, Types types) {
     // Rule 11.
-    DartType argument = futureOr.typeArguments.single;
     return types.performNullabilityAwareSubtypeCheck(
-        s,
-        argument.withDeclaredNullability(computeNullabilityOfFutureOr(
-            futureOr, types.hierarchy.coreTypes.futureOrClass)));
+        s, t.typeArgument.withDeclaredNullability(t.nullability));
   }
 
   @override
   IsSubtypeOf isTypeParameterRelated(
-      TypeParameterType s, InterfaceType futureOr, Types types) {
-    List<DartType> arguments = futureOr.typeArguments;
-    Nullability unitedNullability = computeNullabilityOfFutureOr(
-        futureOr, types.hierarchy.coreTypes.futureOrClass);
+      TypeParameterType s, FutureOrType t, Types types) {
     // TODO(dmitryas): Revise the original optimization.
     return types
         // Rule 11.
         .performNullabilityAwareSubtypeCheck(
-            s, arguments.single.withDeclaredNullability(unitedNullability))
+            s, t.typeArgument.withDeclaredNullability(t.nullability))
         // Rule 13.
         .orSubtypeCheckFor(
             s.parameter.bound.withDeclaredNullability(
                 combineNullabilitiesForSubstitution(
                     s.parameter.bound.nullability, s.nullability)),
-            futureOr,
+            t,
             types)
         // Rule 10.
         .orSubtypeCheckFor(
             s,
             new InterfaceType(types.hierarchy.coreTypes.futureClass,
-                unitedNullability, arguments),
+                t.nullability, [t.typeArgument]),
             types);
   }
 
   @override
-  IsSubtypeOf isFunctionRelated(
-      FunctionType s, InterfaceType futureOr, Types types) {
+  IsSubtypeOf isFunctionRelated(FunctionType s, FutureOrType t, Types types) {
     // Rule 11.
-    DartType argument = futureOr.typeArguments.single;
     return types.performNullabilityAwareSubtypeCheck(
-        s,
-        argument.withDeclaredNullability(computeNullabilityOfFutureOr(
-            futureOr, types.hierarchy.coreTypes.futureOrClass)));
+        s, t.typeArgument.withDeclaredNullability(t.nullability));
   }
 
   @override
   IsSubtypeOf isIntersectionRelated(
-      TypeParameterType intersection, InterfaceType futureOr, Types types) {
-    return isTypeParameterRelated(intersection, futureOr, types) // Rule 8.
-        .orSubtypeCheckFor(
-            intersection.promotedBound, futureOr, types); // Rule 12.
+      TypeParameterType intersection, FutureOrType t, Types types) {
+    return isTypeParameterRelated(intersection, t, types) // Rule 8.
+        .orSubtypeCheckFor(intersection.promotedBound, t, types); // Rule 12.
   }
 
   @override
-  IsSubtypeOf isTypedefRelated(
-      TypedefType s, InterfaceType futureOr, Types types) {
-    return types.performNullabilityAwareSubtypeCheck(s.unalias, futureOr);
+  IsSubtypeOf isTypedefRelated(TypedefType s, FutureOrType t, Types types) {
+    return types.performNullabilityAwareSubtypeCheck(s.unalias, t);
   }
 }
 
@@ -875,8 +826,7 @@
       InterfaceType s, TypeParameterType intersection, Types types) {
     if (s.classNode == types.hierarchy.coreTypes.nullClass) {
       // Rule 4.
-      return new IsSubtypeOf.basedSolelyOnNullabilities(
-          s, intersection, types.futureOrClass);
+      return new IsSubtypeOf.basedSolelyOnNullabilities(s, intersection);
     }
     return const IsSubtypeOf.never();
   }
@@ -895,7 +845,7 @@
 
   @override
   IsSubtypeOf isFutureOrRelated(
-      InterfaceType futureOr, TypeParameterType intersection, Types types) {
+      FutureOrType s, TypeParameterType intersection, Types types) {
     return const IsSubtypeOf.never();
   }
 
@@ -949,15 +899,15 @@
     return const IsSubtypeOf.never();
   }
 
-  IsSubtypeOf isFutureOrRelated(
-      InterfaceType futureOr, NeverType t, Types types) {
+  IsSubtypeOf isFutureOrRelated(FutureOrType s, NeverType t, Types types) {
     return const IsSubtypeOf.never();
   }
 
   IsSubtypeOf isTypeParameterRelated(
       TypeParameterType s, NeverType t, Types types) {
-    return types.performNullabilityAwareSubtypeCheck(s.bound, t).and(
-        new IsSubtypeOf.basedSolelyOnNullabilities(s, t, types.futureOrClass));
+    return types
+        .performNullabilityAwareSubtypeCheck(s.bound, t)
+        .and(new IsSubtypeOf.basedSolelyOnNullabilities(s, t));
   }
 
   IsSubtypeOf isTypedefRelated(TypedefType s, NeverType t, Types types) {
diff --git a/pkg/kernel/lib/testing/type_parser_environment.dart b/pkg/kernel/lib/testing/type_parser_environment.dart
index 6789f0d..2e07a3e 100644
--- a/pkg/kernel/lib/testing/type_parser_environment.dart
+++ b/pkg/kernel/lib/testing/type_parser_environment.dart
@@ -10,6 +10,7 @@
         DartType,
         DynamicType,
         FunctionType,
+        FutureOrType,
         InterfaceType,
         Library,
         NamedType,
@@ -233,6 +234,10 @@
       kernelArguments[i] =
           arguments[i].accept<Node, TypeParserEnvironment>(this, environment);
     }
+    if (name == "FutureOr") {
+      return new FutureOrType(kernelArguments.single,
+          interpretParsedNullability(node.parsedNullability));
+    }
     if (declaration is Class) {
       Nullability nullability =
           interpretParsedNullability(node.parsedNullability);
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
index fb03e1f..9f6528a 100644
--- a/pkg/kernel/lib/text/ast_to_text.dart
+++ b/pkg/kernel/lib/text/ast_to_text.dart
@@ -10,6 +10,7 @@
 
 import '../ast.dart';
 import '../import_table.dart';
+import '../src/text_util.dart';
 
 abstract class Namer<T> {
   int index = 0;
@@ -1386,47 +1387,6 @@
     writeExpression(node.otherwise);
   }
 
-  String getEscapedCharacter(int codeUnit) {
-    switch (codeUnit) {
-      case 9:
-        return r'\t';
-      case 10:
-        return r'\n';
-      case 11:
-        return r'\v';
-      case 12:
-        return r'\f';
-      case 13:
-        return r'\r';
-      case 34:
-        return r'\"';
-      case 36:
-        return r'\$';
-      case 92:
-        return r'\\';
-      default:
-        if (codeUnit < 32 || codeUnit > 126) {
-          return r'\u' + '$codeUnit'.padLeft(4, '0');
-        } else {
-          return null;
-        }
-    }
-  }
-
-  String escapeString(String string) {
-    StringBuffer buffer;
-    for (int i = 0; i < string.length; ++i) {
-      String character = getEscapedCharacter(string.codeUnitAt(i));
-      if (character != null) {
-        buffer ??= new StringBuffer(string.substring(0, i));
-        buffer.write(character);
-      } else {
-        buffer?.write(string[i]);
-      }
-    }
-    return buffer == null ? string : buffer.toString();
-  }
-
   visitStringConcatenation(StringConcatenation node) {
     if (state == WORD) {
       writeSpace();
@@ -2200,6 +2160,14 @@
     writeNullability(node.nullability);
   }
 
+  visitFutureOrType(FutureOrType node) {
+    writeWord('FutureOr');
+    writeSymbol('<');
+    writeNode(node.typeArgument);
+    writeSymbol('>');
+    writeNullability(node.declaredNullability);
+  }
+
   visitFunctionType(FunctionType node) {
     writeFunctionType(node);
   }
@@ -2261,7 +2229,45 @@
     writeIndentation();
     writeConstantReference(node);
     writeSpaced('=');
-    endLine('$node');
+    endLine('${node.runtimeType}');
+  }
+
+  visitNullConstant(NullConstant node) {
+    writeIndentation();
+    writeConstantReference(node);
+    writeSpaced('=');
+    endLine('${node.value}');
+  }
+
+  visitBoolConstant(BoolConstant node) {
+    writeIndentation();
+    writeConstantReference(node);
+    writeSpaced('=');
+    endLine('${node.value}');
+  }
+
+  visitIntConstant(IntConstant node) {
+    writeIndentation();
+    writeConstantReference(node);
+    writeSpaced('=');
+    endLine('${node.value}');
+  }
+
+  visitDoubleConstant(DoubleConstant node) {
+    writeIndentation();
+    writeConstantReference(node);
+    writeSpaced('=');
+    endLine('${node.value}');
+  }
+
+  visitSymbolConstant(SymbolConstant node) {
+    writeIndentation();
+    writeConstantReference(node);
+    writeSpaced('=');
+    String text = node.libraryReference != null
+        ? '#${node.libraryReference.asLibrary.importUri}::${node.name}'
+        : '#${node.name}';
+    endLine('${text}');
   }
 
   visitListConstant(ListConstant node) {
diff --git a/pkg/kernel/lib/text/text_serializer.dart b/pkg/kernel/lib/text/text_serializer.dart
index 0d3f673..829959c 100644
--- a/pkg/kernel/lib/text/text_serializer.dart
+++ b/pkg/kernel/lib/text/text_serializer.dart
@@ -879,6 +879,7 @@
   String visitInterfaceType(InterfaceType _) => "interface";
   String visitNeverType(NeverType _) => "never";
   String visitTypedefType(TypedefType _) => "typedef";
+  String visitFutureOrType(FutureOrType _) => "futureor";
 }
 
 const TextSerializer<InvalidType> invalidTypeSerializer =
@@ -1007,6 +1008,17 @@
       tuple.first.reference, Nullability.legacy, tuple.second);
 }
 
+TextSerializer<FutureOrType> futureOrTypeSerializer =
+    new Wrapped(unwrapFutureOrType, wrapFutureOrType, dartTypeSerializer);
+
+DartType unwrapFutureOrType(FutureOrType node) {
+  return node.typeArgument;
+}
+
+FutureOrType wrapFutureOrType(DartType typeArgument) {
+  return new FutureOrType(typeArgument, Nullability.legacy);
+}
+
 Case<DartType> dartTypeSerializer =
     new Case.uninitialized(const DartTypeTagger());
 
@@ -1578,6 +1590,7 @@
     "interface": interfaceTypeSerializer,
     "never": neverTypeSerializer,
     "typedef": typedefTypeSerializer,
+    "futureor": futureOrTypeSerializer,
   });
   statementSerializer.registerTags({
     "expr": expressionStatementSerializer,
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index 9a57117..09c16af 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -263,9 +263,19 @@
     return const DynamicType();
   }
 
+  static DartType elementTypeFromFutureOr(DartType type) {
+    if (type is FutureOrType) {
+      return type.typeArgument;
+    }
+    return const DynamicType();
+  }
+
   DartType elementTypeFromReturnType(Class expected) =>
       elementTypeFrom(expected, enclosingFunction.returnType);
 
+  DartType elementTypeFromAsyncReturnType() =>
+      elementTypeFromFutureOr(enclosingFunction.returnType);
+
   Statement createContinuationPoint([Expression value]) {
     if (value == null) value = new NullLiteral();
     capturedTryDepth = math.max(capturedTryDepth, currentTryDepth);
@@ -1290,10 +1300,10 @@
     // "FutureOr<T>".
     DartType valueType = elementTypeFromReturnType(helper.futureClass);
     if (valueType == const DynamicType()) {
-      valueType = elementTypeFromReturnType(helper.futureOrClass);
+      valueType = elementTypeFromAsyncReturnType();
     }
-    final DartType returnType = new InterfaceType(helper.futureOrClass,
-        staticTypeContext.nullable, <DartType>[valueType]);
+    final DartType returnType =
+        new FutureOrType(valueType, staticTypeContext.nullable);
     var completerTypeArguments = <DartType>[valueType];
 
     final completerType = new InterfaceType(helper.asyncAwaitCompleterClass,
@@ -1396,7 +1406,6 @@
   final Library coreLibrary;
   final CoreTypes coreTypes;
   final Class futureClass;
-  final Class futureOrClass;
   final Class iterableClass;
   final Class streamClass;
   final Member streamIteratorCancel;
@@ -1437,7 +1446,6 @@
       this.coreLibrary,
       this.coreTypes,
       this.futureClass,
-      this.futureOrClass,
       this.iterableClass,
       this.streamClass,
       this.streamIteratorCancel,
@@ -1478,7 +1486,6 @@
         coreTypes.coreLibrary,
         coreTypes,
         coreTypes.futureClass,
-        coreTypes.futureOrClass,
         coreTypes.iterableClass,
         coreTypes.streamClass,
         coreTypes.streamIteratorCancel,
diff --git a/pkg/kernel/lib/type_algebra.dart b/pkg/kernel/lib/type_algebra.dart
index adfbd34..03a6921 100644
--- a/pkg/kernel/lib/type_algebra.dart
+++ b/pkg/kernel/lib/type_algebra.dart
@@ -378,12 +378,22 @@
   }
 
   TypeParameter freshTypeParameter(TypeParameter node) {
-    var fresh = new TypeParameter(node.name);
-    substitution[node] = new TypeParameterType.forAlphaRenaming(node, fresh);
+    TypeParameter fresh = new TypeParameter(node.name);
+    TypeParameterType typeParameterType = substitution[node] =
+        new TypeParameterType.forAlphaRenaming(node, fresh);
     fresh.bound = visit(node.bound);
     if (node.defaultType != null) {
       fresh.defaultType = visit(node.defaultType);
     }
+    // If the bound was changed from substituting the bound we need to update
+    // implicit nullability to be based on the new bound. If the bound wasn't
+    // changed the computation below results in the same nullability.
+    //
+    // If the type variable occurred in the bound then the bound was
+    // of the form `Foo<...T..>` or `FutureOr<T>` and the nullability therefore
+    // has not changed.
+    typeParameterType.declaredNullability =
+        TypeParameterType.computeNullabilityFromBound(fresh);
     return fresh;
   }
 }
@@ -397,7 +407,7 @@
 /// and `int`.  The function computes the nullability for the replacement as
 /// per the following table:
 ///
-/// | arg \ var |  !  |  ?  |  *  |  %  |
+/// |  a  \  b  |  !  |  ?  |  *  |  %  |
 /// |-----------|-----|-----|-----|-----|
 /// |     !     |  !  |  ?  |  *  |  !  |
 /// |     ?     | N/A |  ?  |  ?  |  ?  |
@@ -413,7 +423,7 @@
   // with whatever is easier to implement.  In this implementation, we extend
   // the table function as follows:
   //
-  // | arg \ var |  !  |  ?  |  *  |  %  |
+  // |  a  \  b  |  !  |  ?  |  *  |  %  |
   // |-----------|-----|-----|-----|-----|
   // |     !     |  !  |  ?  |  *  |  !  |
   // |     ?     |  ?  |  ?  |  ?  |  ?  |
@@ -490,6 +500,13 @@
     return new InterfaceType(node.classNode, node.nullability, typeArguments);
   }
 
+  DartType visitFutureOrType(FutureOrType node) {
+    int before = useCounter;
+    DartType typeArgument = node.typeArgument.accept(this);
+    if (useCounter == before) return node;
+    return new FutureOrType(typeArgument, node.declaredNullability);
+  }
+
   DartType visitTypedefType(TypedefType node) {
     if (node.typeArguments.isEmpty) return node;
     int before = useCounter;
@@ -805,6 +822,10 @@
     return node.typeArguments.any(visit);
   }
 
+  bool visitFutureOrType(FutureOrType node) {
+    return visit(node.typeArgument);
+  }
+
   bool visitTypedefType(TypedefType node) {
     return node.typeArguments.any(visit);
   }
@@ -853,6 +874,10 @@
     return node.typeArguments.any(visit);
   }
 
+  bool visitFutureOrType(FutureOrType node) {
+    return visit(node.typeArgument);
+  }
+
   bool visitTypedefType(TypedefType node) {
     return node.typeArguments.any(visit);
   }
@@ -878,3 +903,29 @@
     return node.defaultType.accept(this);
   }
 }
+
+Nullability uniteNullabilities(Nullability a, Nullability b) {
+  if (a == Nullability.nullable || b == Nullability.nullable) {
+    return Nullability.nullable;
+  }
+  if (a == Nullability.legacy || b == Nullability.legacy) {
+    return Nullability.legacy;
+  }
+  if (a == Nullability.undetermined || b == Nullability.undetermined) {
+    return Nullability.undetermined;
+  }
+  return Nullability.nonNullable;
+}
+
+Nullability intersectNullabilities(Nullability a, Nullability b) {
+  if (a == Nullability.nonNullable || b == Nullability.nonNullable) {
+    return Nullability.nonNullable;
+  }
+  if (a == Nullability.undetermined || b == Nullability.undetermined) {
+    return Nullability.undetermined;
+  }
+  if (a == Nullability.legacy || b == Nullability.legacy) {
+    return Nullability.legacy;
+  }
+  return Nullability.nullable;
+}
diff --git a/pkg/kernel/lib/type_environment.dart b/pkg/kernel/lib/type_environment.dart
index a5ef956..2426f31 100644
--- a/pkg/kernel/lib/type_environment.dart
+++ b/pkg/kernel/lib/type_environment.dart
@@ -7,7 +7,6 @@
 import 'class_hierarchy.dart';
 import 'core_types.dart';
 
-import 'src/future_or.dart';
 import 'src/hierarchy_based_type_environment.dart'
     show HierarchyBasedTypeEnvironment;
 import 'src/types.dart';
@@ -31,7 +30,6 @@
   Class get intClass => coreTypes.intClass;
   Class get numClass => coreTypes.numClass;
   Class get functionClass => coreTypes.functionClass;
-  Class get futureOrClass => coreTypes.futureOrClass;
   Class get objectClass => coreTypes.objectClass;
 
   InterfaceType get objectLegacyRawType => coreTypes.objectLegacyRawType;
@@ -86,9 +84,9 @@
   /// This implements the function `flatten` from the spec, which unwraps a
   /// layer of Future or FutureOr from a type.
   DartType unfutureType(DartType type) {
+    if (type is FutureOrType) return type.typeArgument;
     if (type is InterfaceType) {
-      if (type.classNode == coreTypes.futureOrClass ||
-          type.classNode == coreTypes.futureClass) {
+      if (type.classNode == coreTypes.futureClass) {
         return type.typeArguments[0];
       }
       // It is a compile-time error to implement, extend, or mixin FutureOr so
@@ -104,6 +102,16 @@
     return type;
   }
 
+  /// Returns the non-type parameter type bound of [type].
+  DartType _resolveTypeParameterType(DartType type) {
+    while (type is TypeParameterType) {
+      TypeParameterType typeParameterType = type;
+      type =
+          typeParameterType.promotedBound ?? typeParameterType.parameter.bound;
+    }
+    return type;
+  }
+
   /// Returns the type of the element in the for-in statement [node] with
   /// [iterableType] as the static type of the iterable expression.
   ///
@@ -112,11 +120,7 @@
   DartType forInElementType(ForInStatement node, DartType iterableType) {
     // TODO(johnniwinther): Update this to use the type of
     //  `iterable.iterator.current` if inference is updated accordingly.
-    while (iterableType is TypeParameterType) {
-      TypeParameterType typeParameterType = iterableType;
-      iterableType =
-          typeParameterType.promotedBound ?? typeParameterType.parameter.bound;
-    }
+    iterableType = _resolveTypeParameterType(iterableType);
     if (node.isAsync) {
       List<DartType> typeArguments =
           getTypeArgumentsAsInstanceOf(iterableType, coreTypes.streamClass);
@@ -176,6 +180,9 @@
   /// the upper bound), then that type variable is returned.
   /// Otherwise `num` is returned.
   DartType getTypeOfOverloadedArithmetic(DartType type1, DartType type2) {
+    type1 = _resolveTypeParameterType(type1);
+    type2 = _resolveTypeParameterType(type2);
+
     if (type1 == type2) return type1;
 
     if (type1 is InterfaceType && type2 is InterfaceType) {
@@ -276,7 +283,7 @@
   /// `Rn` is the result of [IsSubtypeOf.basedSolelyOnNullabilities] on the
   /// types `List<int>?` and `List<num>*`.
   factory IsSubtypeOf.basedSolelyOnNullabilities(
-      DartType subtype, DartType supertype, Class futureOrClass) {
+      DartType subtype, DartType supertype) {
     if (subtype is InvalidType) {
       if (supertype is InvalidType) {
         return const IsSubtypeOf.always();
@@ -287,34 +294,24 @@
       return const IsSubtypeOf.onlyIfIgnoringNullabilities();
     }
 
-    if (isPotentiallyNullable(subtype, futureOrClass) &&
-        isPotentiallyNonNullable(supertype, futureOrClass)) {
+    if (subtype.isPotentiallyNullable && supertype.isPotentiallyNonNullable) {
       // It's a special case to test X% <: X%, FutureOr<X%> <: FutureOr<X%>,
       // FutureOr<FutureOr<X%>> <: FutureOr<FutureOr<X%>>, etc, where X is a
       // type parameter.  In that case, the nullabilities of the subtype and the
       // supertype are related, that is, they are both nullable or non-nullable
       // at run time.
-      if (computeNullability(subtype, futureOrClass) ==
-              Nullability.undetermined &&
-          computeNullability(supertype, futureOrClass) ==
-              Nullability.undetermined) {
+      if (subtype.nullability == Nullability.undetermined &&
+          supertype.nullability == Nullability.undetermined) {
         DartType unwrappedSubtype = subtype;
         DartType unwrappedSupertype = supertype;
-        while (unwrappedSubtype is InterfaceType &&
-            unwrappedSubtype.classNode == futureOrClass) {
-          unwrappedSubtype =
-              (unwrappedSubtype as InterfaceType).typeArguments.single;
+        while (unwrappedSubtype is FutureOrType) {
+          unwrappedSubtype = (unwrappedSubtype as FutureOrType).typeArgument;
         }
-        while (unwrappedSupertype is InterfaceType &&
-            unwrappedSupertype.classNode == futureOrClass) {
+        while (unwrappedSupertype is FutureOrType) {
           unwrappedSupertype =
-              (unwrappedSupertype as InterfaceType).typeArguments.single;
+              (unwrappedSupertype as FutureOrType).typeArgument;
         }
-        Nullability unwrappedSubtypeNullability =
-            computeNullability(unwrappedSubtype, futureOrClass);
-        Nullability unwrappedSupertypeNullability =
-            computeNullability(unwrappedSupertype, futureOrClass);
-        if (unwrappedSubtypeNullability == unwrappedSupertypeNullability) {
+        if (unwrappedSubtype.nullability == unwrappedSupertype.nullability) {
           // The relationship between the types must be established elsewhere.
           return const IsSubtypeOf.always();
         }
diff --git a/pkg/kernel/lib/visitor.dart b/pkg/kernel/lib/visitor.dart
index 978882b..fadb45f 100644
--- a/pkg/kernel/lib/visitor.dart
+++ b/pkg/kernel/lib/visitor.dart
@@ -276,6 +276,7 @@
   R visitVoidType(VoidType node) => defaultDartType(node);
   R visitBottomType(BottomType node) => defaultDartType(node);
   R visitInterfaceType(InterfaceType node) => defaultDartType(node);
+  R visitFutureOrType(FutureOrType node) => defaultDartType(node);
   R visitFunctionType(FunctionType node) => defaultDartType(node);
   R visitTypeParameterType(TypeParameterType node) => defaultDartType(node);
   R visitTypedefType(TypedefType node) => defaultDartType(node);
@@ -290,6 +291,7 @@
   R visitVoidType(VoidType node, T arg) => defaultDartType(node, arg);
   R visitBottomType(BottomType node, T arg) => defaultDartType(node, arg);
   R visitInterfaceType(InterfaceType node, T arg) => defaultDartType(node, arg);
+  R visitFutureOrType(FutureOrType node, T arg) => defaultDartType(node, arg);
   R visitFunctionType(FunctionType node, T arg) => defaultDartType(node, arg);
   R visitTypeParameterType(TypeParameterType node, T arg) =>
       defaultDartType(node, arg);
@@ -527,6 +529,7 @@
   R visitVoidType(VoidType node) => defaultDartType(node);
   R visitBottomType(BottomType node) => defaultDartType(node);
   R visitInterfaceType(InterfaceType node) => defaultDartType(node);
+  R visitFutureOrType(FutureOrType node) => defaultDartType(node);
   R visitFunctionType(FunctionType node) => defaultDartType(node);
   R visitTypeParameterType(TypeParameterType node) => defaultDartType(node);
   R visitTypedefType(TypedefType node) => defaultDartType(node);
diff --git a/pkg/kernel/test/type_parser.dart b/pkg/kernel/test/type_parser.dart
index 79ce776..62b5a0f 100644
--- a/pkg/kernel/test/type_parser.dart
+++ b/pkg/kernel/test/type_parser.dart
@@ -172,8 +172,7 @@
           Nullability nullability = parseOptionalNullability();
           return new TypedefType(target, nullability, typeArguments);
         } else if (target is TypeParameter) {
-          Nullability nullability =
-              parseOptionalNullability(Nullability.undetermined);
+          Nullability nullability = parseOptionalNullability(null);
           DartType promotedBound;
           switch (peekToken()) {
             case Token.LeftAngle:
@@ -185,7 +184,11 @@
             default:
               break;
           }
-          return new TypeParameterType(target, nullability, promotedBound);
+          return new TypeParameterType(
+              target,
+              nullability ??
+                  TypeParameterType.computeNullabilityFromBound(target),
+              promotedBound);
         }
         return fail("Unexpected lookup result for $name: $target");
 
diff --git a/pkg/modular_test/lib/src/loader.dart b/pkg/modular_test/lib/src/loader.dart
index 4efd9e6..65d5558 100644
--- a/pkg/modular_test/lib/src/loader.dart
+++ b/pkg/modular_test/lib/src/loader.dart
@@ -204,8 +204,6 @@
 Future<Module> _createSdkModule(Uri root) async {
   List<Uri> sources = [
     Uri.parse('sdk/lib/libraries.json'),
-    // TODO(#38701) Cleanup after merging the forked SDK into mainline.
-    Uri.parse('sdk_nnbd/lib/libraries.json'),
   ];
 
   // Include all dart2js, ddc, vm library sources and patch files.
@@ -213,8 +211,6 @@
   // it doesn't list files that are transitively imported.
   var sdkLibrariesAndPatchesRoots = [
     'sdk/lib/',
-    // TODO(#38701) Cleanup after merging the forked SDK into mainline.
-    'sdk_nnbd/lib/',
     'runtime/lib/',
     'runtime/bin/',
   ];
diff --git a/pkg/native_stack_traces/CHANGELOG.md b/pkg/native_stack_traces/CHANGELOG.md
index 9e00323..10e8638 100644
--- a/pkg/native_stack_traces/CHANGELOG.md
+++ b/pkg/native_stack_traces/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Changelog
 
+## 0.3.7
+
+- Added buildId accessor for retrieving GNU build IDs from DWARF files that
+  include them.
+
 ## 0.3.6
 
 - Adjusts RegExp for stack trace header line to be more flexible in what it
diff --git a/pkg/native_stack_traces/lib/src/constants.dart b/pkg/native_stack_traces/lib/src/constants.dart
index 980e8e0..c44d615 100644
--- a/pkg/native_stack_traces/lib/src/constants.dart
+++ b/pkg/native_stack_traces/lib/src/constants.dart
@@ -2,6 +2,13 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// The section name in which the build ID is stored as a note.
+const String buildIdSectionName = ".note.gnu.build-id";
+// The type of a build ID note.
+const int buildIdNoteType = 3;
+// The name of a build ID note.
+const String buildIdNoteName = "GNU";
+
 // The dynamic symbol name for the VM instructions section.
 const String vmSymbolName = "_kDartVmSnapshotInstructions";
 
diff --git a/pkg/native_stack_traces/lib/src/dwarf.dart b/pkg/native_stack_traces/lib/src/dwarf.dart
index 96b93c9..72f7623 100644
--- a/pkg/native_stack_traces/lib/src/dwarf.dart
+++ b/pkg/native_stack_traces/lib/src/dwarf.dart
@@ -1214,6 +1214,18 @@
         vmStartAddress, isolateStartAddress);
   }
 
+  /// The build ID for the debugging information.
+  ///
+  /// Returns null if there is no build ID information recorded.
+  String get buildId {
+    final sections = _elf.namedSections(constants.buildIdSectionName);
+    if (sections.isEmpty) return null;
+    final Note note = sections.single;
+    if (note.type != constants.buildIdNoteType) return null;
+    if (note.name != constants.buildIdNoteName) return null;
+    return note.description.map((i) => i.toRadixString(16)).join();
+  }
+
   /// The call information for the given virtual address. There may be
   /// multiple [CallInfo] objects returned for a single virtual address when
   /// code has been inlined.
diff --git a/pkg/native_stack_traces/lib/src/elf.dart b/pkg/native_stack_traces/lib/src/elf.dart
index cee46f0..b0c7c54 100644
--- a/pkg/native_stack_traces/lib/src/elf.dart
+++ b/pkg/native_stack_traces/lib/src/elf.dart
@@ -322,7 +322,7 @@
       ..writeln(paddedHex(paddr, wordSize))
       ..write('Size in file: ')
       ..writeln(filesz)
-      ..write('Size in memory')
+      ..write('Size in memory: ')
       ..writeln(memsz)
       ..write('Alignment: 0x')
       ..write(paddedHex(align, wordSize));
@@ -421,6 +421,7 @@
   static const _SHT_STRTAB = 3;
   static const _SHT_HASH = 5;
   static const _SHT_DYNAMIC = 6;
+  static const _SHT_NOTE = 7;
   static const _SHT_NOBITS = 8;
   static const _SHT_DYNSYM = 11;
 
@@ -437,6 +438,7 @@
     _SHT_STRTAB: "SHT_STRTAB",
     _SHT_HASH: "SHT_HASH",
     _SHT_DYNAMIC: "SHT_DYNAMIC",
+    _SHT_NOTE: "SHT_NOTE",
     _SHT_NOBITS: "SHT_NOBITS",
     _SHT_DYNSYM: "SHT_DYNSYM",
   };
@@ -545,6 +547,8 @@
         return SymbolTable.fromReader(reader, entry);
       case SectionHeaderEntry._SHT_DYNSYM:
         return SymbolTable.fromReader(reader, entry);
+      case SectionHeaderEntry._SHT_NOTE:
+        return Note.fromReader(reader, entry);
       default:
         return Section._(entry);
     }
@@ -574,6 +578,55 @@
   }
 }
 
+/// A section that contains a single note.
+class Note extends Section {
+  final int type;
+  final String name;
+  final Uint8List description;
+
+  Note._(entry, this.type, this.name, this.description) : super._(entry);
+
+  static Note fromReader(Reader originalReader, SectionHeaderEntry entry) {
+    final reader = originalReader.refocusedCopy(entry.offset, entry.size);
+    final nameLength = reader.readBytes(4);
+    final descriptionLength = reader.readBytes(4);
+    final type = reader.readBytes(4);
+    final nameEnd = reader.offset + nameLength;
+    final name = reader.readNullTerminatedString();
+    assert(reader.offset == nameEnd);
+    assert(reader.length - reader.offset == descriptionLength);
+    final descriptionStart = reader.offset;
+    final descriptionEnd = descriptionStart + descriptionLength;
+    final description =
+        Uint8List.sublistView(reader.bdata, descriptionStart, descriptionEnd);
+    return Note._(entry, type, name, description);
+  }
+
+  void writeToStringBuffer(StringBuffer buffer) {
+    buffer
+      ..write('Section "')
+      ..write(headerEntry.name)
+      ..writeln('" is a note:');
+    buffer
+      ..write('  Type: ')
+      ..writeln(type);
+    buffer
+      ..write('  Name: "')
+      ..write(name)
+      ..writeln('"');
+    buffer
+      ..write('  Description: ')
+      ..writeln(description);
+  }
+
+  @override
+  String toString() {
+    final buffer = StringBuffer();
+    writeToStringBuffer(buffer);
+    return buffer.toString();
+  }
+}
+
 /// A map from table offsets to strings, used to store names of ELF objects.
 class StringTable extends Section {
   final _entries;
diff --git a/pkg/native_stack_traces/pubspec.yaml b/pkg/native_stack_traces/pubspec.yaml
index 3b0ad2d..b086b607 100644
--- a/pkg/native_stack_traces/pubspec.yaml
+++ b/pkg/native_stack_traces/pubspec.yaml
@@ -1,11 +1,11 @@
 name: native_stack_traces
 description: Utilities for working with non-symbolic stack traces.
-version: 0.3.6
+version: 0.3.7
 
 homepage: https://github.com/dart-lang/sdk/tree/master/pkg/native_stack_traces
 
 environment:
-  sdk: '>=2.7.1 <3.0.0'
+  sdk: '>=2.8.0 <3.0.0'
 
 executables:
   decode:
diff --git a/pkg/nnbd_migration/bin/migrate.dart b/pkg/nnbd_migration/bin/migrate.dart
index d6202e2..5401871 100644
--- a/pkg/nnbd_migration/bin/migrate.dart
+++ b/pkg/nnbd_migration/bin/migrate.dart
@@ -11,10 +11,13 @@
   var cli = MigrationCli(binaryName: 'nnbd_migration');
   ArgResults argResults;
   try {
-    argResults = MigrationCli.createParser().parse(args);
-  } on FormatException catch (e) {
-    cli.handleArgParsingException(e);
+    try {
+      argResults = MigrationCli.createParser().parse(args);
+    } on FormatException catch (e) {
+      cli.handleArgParsingException(e);
+    }
+    await cli.decodeCommandLineArgs(argResults)?.run();
+  } on MigrationExit catch (migrationExit) {
+    exitCode = migrationExit.exitCode;
   }
-  if (cli.exitCode == null) await cli.run(argResults);
-  exitCode = cli.exitCode;
 }
diff --git a/pkg/nnbd_migration/lib/migration_cli.dart b/pkg/nnbd_migration/lib/migration_cli.dart
index 2c45a14..4d74b5d 100644
--- a/pkg/nnbd_migration/lib/migration_cli.dart
+++ b/pkg/nnbd_migration/lib/migration_cli.dart
@@ -89,8 +89,6 @@
 
 @visibleForTesting
 class DependencyChecker {
-  static final _pubName = Platform.isWindows ? 'pub.bat' : 'pub';
-
   /// The directory which contains the package being migrated.
   final String _directory;
   final Context _pathContext;
@@ -101,16 +99,15 @@
       this._directory, this._pathContext, this._logger, this._processManager);
 
   bool check() {
-    var pubPath = _pathContext.join(getSdkPath(), 'bin', _pubName);
-    var result = _processManager.runSync(
-        pubPath, ['outdated', '--mode=null-safety', '--json'],
-        workingDirectory: _directory);
-
+    var pubPath = _pathContext.join(getSdkPath(), 'bin', 'dart');
+    var pubArguments = ['pub', 'outdated', '--mode=null-safety', '--json'];
     var preNullSafetyPackages = <String, String>{};
     try {
+      var result = _processManager.runSync(pubPath, pubArguments,
+          workingDirectory: _directory);
       if ((result.stderr as String).isNotEmpty) {
         throw FormatException(
-            '`pub outdated --mode=null-safety` exited with exit code '
+            '`dart pub outdated --mode=null-safety` exited with exit code '
             '${result.exitCode} and stderr:\n\n${result.stderr}');
       }
       var outdatedOutput = jsonDecode(result.stdout as String);
@@ -139,6 +136,12 @@
         var version = json.expectType<String>(current['version'], 'version');
         preNullSafetyPackages[name] = version;
       }
+    } on ProcessException catch (e) {
+      _logger.stderr(
+          'Warning: Could not execute `$pubPath ${pubArguments.join(' ')}`: '
+          '"${e.message}"');
+      // Allow the program to continue; users should be allowed to attempt to
+      // migrate when `pub outdated` is misbehaving, or if there is a bug above.
     } on FormatException catch (e) {
       _logger.stderr('Warning: ${e.message}');
       // Allow the program to continue; users should be allowed to attempt to
@@ -156,7 +159,7 @@
       }
       _logger.stderr('');
       _logger.stderr('It is highly recommended to upgrade all dependencies to '
-          'versions which have migrated. Use `$_pubName outdated '
+          'versions which have migrated. Use `dart pub outdated '
           '--mode=null-safety` to check the status of dependencies.');
       _logger.stderr('');
       _logger.stderr('Visit https://dart.dev/tools/pub/cmd/pub-outdated for '
@@ -195,13 +198,22 @@
   @override
   FutureOr<int> run() async {
     var cli = MigrationCli(binaryName: 'dart $name');
-    await cli.run(argResults, isVerbose: verbose);
-    return cli.exitCode;
+    try {
+      await cli.decodeCommandLineArgs(argResults, isVerbose: verbose)?.run();
+    } on MigrationExit catch (migrationExit) {
+      return migrationExit.exitCode;
+    }
+    return 0;
   }
 }
 
-/// Command-line API for the migration tool, with additional methods exposed for
-/// testing.
+/// Command-line API for the migration tool, with additional parameters exposed
+/// for testing.
+///
+/// Recommended usage: create an instance of this object and call
+/// [decodeCommandLineArgs].  If it returns non-null, call
+/// [MigrationCliRunner.run] on the result.  If either method throws a
+/// [MigrationExit], exit with the error code contained therein.
 class MigrationCli {
   /// The name of the executable, for reporting in help messages.
   final String binaryName;
@@ -224,34 +236,12 @@
   final ResourceProvider resourceProvider;
 
   /// Logger instance we use to give feedback to the user.
-  Logger logger;
-
-  /// The result of parsing command-line options.
-  @visibleForTesting
-  /*late*/ CommandLineOptions options;
-
-  /// The exit code that should be used when the process terminates, or `null`
-  /// if there is still more work to do.
-  int exitCode;
-
-  final Map<String, List<AnalysisError>> fileErrors = {};
-
-  final Map<String, LineInfo> lineInfo = {};
+  final Logger logger;
 
   /// The environment variables, tracked to help users debug if SDK_PATH was
   /// specified and that resulted in any [ExperimentStatusException]s.
   final Map<String, String> _environmentVariables;
 
-  DartFixListener _dartFixListener;
-
-  _FixCodeProcessor _fixCodeProcessor;
-
-  AnalysisContextCollection _contextCollection;
-
-  bool _hasExceptions = false;
-
-  bool _hasAnalysisErrors = false;
-
   MigrationCli({
     @required this.binaryName,
     @visibleForTesting this.loggerFactory = _defaultLoggerFactory,
@@ -264,71 +254,23 @@
             resourceProvider ?? PhysicalResourceProvider.INSTANCE,
         _environmentVariables = environmentVariables ?? Platform.environment;
 
-  @visibleForTesting
-  DriverBasedAnalysisContext get analysisContext {
-    // Handle the case of more than one analysis context being found (typically,
-    // the current directory and one or more sub-directories).
-    if (hasMultipleAnalysisContext) {
-      return contextCollection.contextFor(options.directory)
-          as DriverBasedAnalysisContext;
-    } else {
-      return contextCollection.contexts.single as DriverBasedAnalysisContext;
-    }
-  }
-
-  Ansi get ansi => logger.ansi;
-
-  AnalysisContextCollection get contextCollection {
-    _contextCollection ??= AnalysisContextCollectionImpl(
-        includedPaths: [options.directory],
-        resourceProvider: resourceProvider,
-        sdkPath: pathContext.normalize(options.sdkPath));
-    return _contextCollection;
-  }
-
-  @visibleForTesting
-  bool get hasMultipleAnalysisContext {
-    return contextCollection.contexts.length > 1;
-  }
-
-  @visibleForTesting
-  bool get isPreviewServerRunning =>
-      _fixCodeProcessor?.isPreviewServerRunnning ?? false;
-
   Context get pathContext => resourceProvider.pathContext;
 
-  /// Blocks until an interrupt signal (control-C) is received.  Tests may
-  /// override this method to simulate control-C.
-  @visibleForTesting
-  Future<void> blockUntilSignalInterrupt() {
-    Stream<ProcessSignal> stream = ProcessSignal.sigint.watch();
-    return stream.first;
-  }
-
-  NonNullableFix createNonNullableFix(DartFixListener listener,
-      ResourceProvider resourceProvider, LineInfo getLineInfo(String path),
-      {List<String> included = const <String>[],
-      int preferredPort,
-      String summaryPath}) {
-    return NonNullableFix(listener, resourceProvider, getLineInfo,
-        included: included,
-        preferredPort: preferredPort,
-        summaryPath: summaryPath);
-  }
-
-  /// Parses and validates command-line arguments, and stores the results in
-  /// [options].
+  /// Parses and validates command-line arguments, and creates a
+  /// [MigrationCliRunner] that is prepared to perform migration.
   ///
-  /// If no additional work should be done (e.g. because the user asked for
-  /// help, or supplied a bad option), a nonzero value is stored in [exitCode].
-  @visibleForTesting
-  void decodeCommandLineArgs(ArgResults argResults, {bool isVerbose}) {
+  /// If the user asked for help, it is printed using the logger configured in
+  /// the constructor, and `null` is returned.
+  ///
+  /// If the user supplied a bad option, a message is printed using the logger
+  /// configured in the constructor, and [MigrationExit] is thrown.
+  MigrationCliRunner decodeCommandLineArgs(ArgResults argResults,
+      {bool isVerbose}) {
     try {
       isVerbose ??= argResults[CommandLineOptions.verboseFlag] as bool;
       if (argResults[CommandLineOptions.helpFlag] as bool) {
         _showUsage(isVerbose);
-        exitCode = 0;
-        return;
+        return null;
       }
       var rest = argResults.rest;
       String migratePath;
@@ -363,7 +305,7 @@
       if (applyChanges && webPreview) {
         throw _BadArgException('--apply-changes requires --no-web-preview');
       }
-      options = CommandLineOptions(
+      var options = CommandLineOptions(
           applyChanges: applyChanges,
           directory: migratePath,
           ignoreErrors: argResults[CommandLineOptions.ignoreErrorsFlag] as bool,
@@ -377,15 +319,14 @@
               argResults[CommandLineOptions.skipPubOutdatedFlag] as bool,
           summary: argResults[CommandLineOptions.summaryOption] as String,
           webPreview: webPreview);
-
-      if (isVerbose) {
-        logger = loggerFactory(true);
-      }
+      return MigrationCliRunner(this, options,
+          logger: isVerbose ? loggerFactory(true) : null);
     } on Object catch (exception) {
       handleArgParsingException(exception);
     }
   }
 
+  @alwaysThrows
   void handleArgParsingException(Object exception) {
     String message;
     if (exception is FormatException) {
@@ -398,301 +339,7 @@
     }
     logger.stderr(message);
     _showUsage(false);
-    exitCode = 1;
-    return;
-  }
-
-  /// Runs the full migration process.
-  void run(ArgResults argResults, {bool isVerbose}) async {
-    decodeCommandLineArgs(argResults, isVerbose: isVerbose);
-    if (exitCode != null) return;
-    if (!options.skipPubOutdated) {
-      _checkDependencies();
-    }
-    if (exitCode != null) return;
-
-    logger.stdout('Migrating ${options.directory}');
-    logger.stdout('');
-
-    if (hasMultipleAnalysisContext) {
-      logger.stdout(
-          'Note: more than one project found; migrating the top-level project.');
-      logger.stdout('');
-    }
-
-    DriverBasedAnalysisContext context = analysisContext;
-
-    List<String> previewUrls;
-    NonNullableFix nonNullableFix;
-
-    logger.stdout(ansi.emphasized('Analyzing project...'));
-    _fixCodeProcessor = _FixCodeProcessor(context, this);
-    _dartFixListener = DartFixListener(
-        DriverProviderImpl(resourceProvider, context), _exceptionReported);
-    nonNullableFix = createNonNullableFix(
-        _dartFixListener, resourceProvider, _fixCodeProcessor.getLineInfo,
-        included: [options.directory],
-        preferredPort: options.previewPort,
-        summaryPath: options.summary);
-    nonNullableFix.rerunFunction = _rerunFunction;
-    _fixCodeProcessor.registerCodeTask(nonNullableFix);
-    _fixCodeProcessor.nonNullableFixTask = nonNullableFix;
-
-    try {
-      await _fixCodeProcessor.runFirstPhase(singlePhaseProgress: true);
-      _checkForErrors();
-    } on ExperimentStatusException catch (e) {
-      logger.stdout(e.toString());
-      final sdkPathVar = _environmentVariables['SDK_PATH'];
-      if (sdkPathVar != null) {
-        logger.stdout('$sdkPathEnvironmentVariableSet: $sdkPathVar');
-      }
-      exitCode = 1;
-    }
-    if (exitCode != null) return;
-
-    logger.stdout('');
-    logger.stdout(ansi.emphasized('Generating migration suggestions...'));
-    previewUrls = await _fixCodeProcessor.runLaterPhases(resetProgress: true);
-
-    if (exitCode != null) return;
-
-    if (options.applyChanges) {
-      logger.stdout(ansi.emphasized('Applying changes:'));
-
-      var allEdits = _dartFixListener.sourceChange.edits;
-      _applyMigrationSuggestions(allEdits);
-
-      logger.stdout('');
-      logger.stdout(
-          'Applied ${allEdits.length} ${_pluralize(allEdits.length, 'edit')}.');
-
-      // Note: do not open the web preview if apply-changes is specified, as we
-      // currently cannot tell the web preview to disable the "apply migration"
-      // button.
-      exitCode = 0;
-      return;
-    }
-
-    if (options.webPreview) {
-      String url = previewUrls.first;
-      assert(previewUrls.length <= 1,
-          'Got unexpected extra preview URLs from server');
-
-      // TODO(#41809): Open a browser automatically.
-      logger.stdout('''
-View the migration suggestions by visiting:
-
-  ${ansi.emphasized(url)}
-
-Use this interactive web view to review, improve, or apply the results.
-''');
-
-      logger.stdout('When finished with the preview, hit ctrl-c '
-          'to terminate this process.');
-      logger.stdout('');
-
-      // Block until sigint (ctrl-c).
-      await blockUntilSignalInterrupt();
-      nonNullableFix.shutdownServer();
-    } else {
-      logger.stdout(ansi.emphasized('Summary of changes:'));
-
-      _displayChangeSummary(_dartFixListener);
-
-      logger.stdout('');
-      logger.stdout('To apply these changes, re-run the tool with '
-          '--${CommandLineOptions.applyChangesFlag}.');
-    }
-    exitCode = 0;
-  }
-
-  /// Perform the indicated source edits to the given source, returning the
-  /// resulting transformed text.
-  String _applyEdits(SourceFileEdit sourceFileEdit, String source) {
-    List<SourceEdit> edits = _sortEdits(sourceFileEdit);
-    return SourceEdit.applySequence(source, edits);
-  }
-
-  void _applyMigrationSuggestions(List<SourceFileEdit> edits) {
-    // Apply the changes to disk.
-    for (SourceFileEdit sourceFileEdit in edits) {
-      String relPath =
-          pathContext.relative(sourceFileEdit.file, from: options.directory);
-      int count = sourceFileEdit.edits.length;
-      logger.stdout('  $relPath ($count ${_pluralize(count, 'change')})');
-
-      String source;
-      var file = resourceProvider.getFile(sourceFileEdit.file);
-      try {
-        source = file.readAsStringSync();
-      } catch (_) {}
-
-      if (source == null) {
-        logger.stdout('    Unable to retrieve source for file.');
-      } else {
-        source = _applyEdits(sourceFileEdit, source);
-
-        try {
-          file.writeAsStringSync(source);
-        } catch (e) {
-          logger.stdout('    Unable to write source for file: $e');
-        }
-      }
-    }
-  }
-
-  void _checkDependencies() {
-    var successful = DependencyChecker(
-            options.directory, pathContext, logger, processManager)
-        .check();
-    if (!successful) {
-      exitCode = 1;
-    }
-  }
-
-  void _checkForErrors() {
-    if (fileErrors.isEmpty) {
-      logger.stdout('No analysis issues found.');
-    } else {
-      logger.stdout('');
-
-      int issueCount =
-          fileErrors.values.map((list) => list.length).reduce((a, b) => a + b);
-      logger.stdout(
-          '$issueCount analysis ${_pluralize(issueCount, 'issue')} found:');
-      List<AnalysisError> allErrors = fileErrors.values
-          .fold(<AnalysisError>[], (list, element) => list..addAll(element));
-      _displayIssues(logger, options.directory, allErrors, lineInfo);
-      var importErrorCount = allErrors.where(_isUriError).length;
-
-      logger.stdout('');
-      logger.stdout(
-          'Note: analysis errors will result in erroneous migration suggestions.');
-
-      _hasAnalysisErrors = true;
-      if (options.ignoreErrors) {
-        logger.stdout('Continuing with migration suggestions due to the use of '
-            '--${CommandLineOptions.ignoreErrorsFlag}.');
-      } else {
-        // Fail with how to continue.
-        logger.stdout('');
-        if (importErrorCount != 0) {
-          logger.stdout(
-              'Unresolved URIs found.  Did you forget to run "pub get"?');
-          logger.stdout('');
-        }
-        logger.stdout(
-            'Please fix the analysis issues (or, force generation of migration '
-            'suggestions by re-running with '
-            '--${CommandLineOptions.ignoreErrorsFlag}).');
-        exitCode = 1;
-        return;
-      }
-    }
-  }
-
-  void _displayChangeSummary(DartFixListener migrationResults) {
-    Map<String, List<DartFixSuggestion>> fileSuggestions = {};
-    for (DartFixSuggestion suggestion in migrationResults.suggestions) {
-      String file = suggestion.location.file;
-      fileSuggestions.putIfAbsent(file, () => <DartFixSuggestion>[]);
-      fileSuggestions[file].add(suggestion);
-    }
-
-    // present a diff-like view
-    var diffStyle = DiffStyle(logger.ansi);
-    for (SourceFileEdit sourceFileEdit in migrationResults.sourceChange.edits) {
-      String file = sourceFileEdit.file;
-      String relPath = pathContext.relative(file, from: options.directory);
-      var edits = sourceFileEdit.edits;
-      int count = edits.length;
-
-      logger.stdout('');
-      logger.stdout('${ansi.emphasized(relPath)} '
-          '($count ${_pluralize(count, 'change')}):');
-
-      String source;
-      try {
-        source = resourceProvider.getFile(file).readAsStringSync();
-      } catch (_) {}
-
-      if (source == null) {
-        logger.stdout('  (unable to retrieve source for file)');
-      } else {
-        for (var line
-            in diffStyle.formatDiff(source, _sourceEditsToAtomicEdits(edits))) {
-          logger.stdout('  $line');
-        }
-      }
-    }
-  }
-
-  void _displayIssues(Logger logger, String directory,
-      List<AnalysisError> issues, Map<String, LineInfo> lineInfo) {
-    issues.sort((AnalysisError one, AnalysisError two) {
-      if (one.source != two.source) {
-        return one.source.fullName.compareTo(two.source.fullName);
-      }
-      return one.offset - two.offset;
-    });
-
-    _IssueRenderer renderer =
-        _IssueRenderer(logger, directory, pathContext, lineInfo);
-    for (AnalysisError issue in issues) {
-      renderer.render(issue);
-    }
-  }
-
-  void _exceptionReported(String detail) {
-    if (_hasExceptions) return;
-    _hasExceptions = true;
-    if (options.ignoreExceptions) {
-      logger.stdout('''
-Exception(s) occurred during migration.  Attempting to perform
-migration anyway due to the use of --${CommandLineOptions.ignoreExceptionsFlag}.
-
-To see exception details, re-run without --${CommandLineOptions.ignoreExceptionsFlag}.
-''');
-    } else {
-      exitCode = 1;
-      if (_hasAnalysisErrors) {
-        logger.stderr('''
-Aborting migration due to an exception.  This may be due to a bug in
-the migration tool, or it may be due to errors in the source code
-being migrated.  If possible, try to fix errors in the source code and
-re-try migrating.  If that doesn't work, consider filing a bug report
-at:
-''');
-      } else {
-        logger.stderr('''
-Aborting migration due to an exception.  This most likely is due to a
-bug in the migration tool.  Please consider filing a bug report at:
-''');
-      }
-      logger.stderr('https://github.com/dart-lang/sdk/issues/new');
-      logger.stderr('''
-To attempt to perform migration anyway, you may re-run with
---${CommandLineOptions.ignoreExceptionsFlag}.
-
-Exception details:
-''');
-      logger.stderr(detail);
-    }
-  }
-
-  bool _isUriError(AnalysisError error) =>
-      error.errorCode == CompileTimeErrorCode.URI_DOES_NOT_EXIST;
-
-  Future<void> _rerunFunction() async {
-    logger.stdout(ansi.emphasized('Recalculating migration suggestions...'));
-
-    _dartFixListener.reset();
-    _fixCodeProcessor.prepareToRerun();
-    await _fixCodeProcessor.runFirstPhase();
-    // TODO(paulberry): check for errors (see
-    // https://github.com/dart-lang/sdk/issues/41712)
-    await _fixCodeProcessor.runLaterPhases();
+    throw MigrationExit(1);
   }
 
   void _showUsage(bool isVerbose) {
@@ -708,15 +355,6 @@
     }
   }
 
-  List<SourceEdit> _sortEdits(SourceFileEdit sourceFileEdit) {
-    // Sort edits in reverse offset order.
-    List<SourceEdit> edits = sourceFileEdit.edits.toList();
-    edits.sort((a, b) {
-      return b.offset - a.offset;
-    });
-    return edits;
-  }
-
   static ArgParser createParser({bool hide = true}) {
     var parser = ArgParser();
     parser.addFlag(CommandLineOptions.helpFlag,
@@ -784,6 +422,420 @@
             'With --no-web-preview, the proposed changes are instead printed to '
             'the console.');
   }
+}
+
+/// Internals of the command-line API for the migration tool, with additional
+/// methods exposed for testing.
+///
+/// This class may be used directly by clients that with to run migration but
+/// provide their own command-line interface.
+class MigrationCliRunner {
+  final MigrationCli cli;
+
+  /// Logger instance we use to give feedback to the user.
+  final Logger logger;
+
+  /// The result of parsing command-line options.
+  final CommandLineOptions options;
+
+  final Map<String, List<AnalysisError>> fileErrors = {};
+
+  final Map<String, LineInfo> lineInfo = {};
+
+  DartFixListener _dartFixListener;
+
+  _FixCodeProcessor _fixCodeProcessor;
+
+  AnalysisContextCollection _contextCollection;
+
+  bool _hasExceptions = false;
+
+  bool _hasAnalysisErrors = false;
+
+  MigrationCliRunner(this.cli, this.options, {Logger logger})
+      : logger = logger ?? cli.logger;
+
+  @visibleForTesting
+  DriverBasedAnalysisContext get analysisContext {
+    // Handle the case of more than one analysis context being found (typically,
+    // the current directory and one or more sub-directories).
+    if (hasMultipleAnalysisContext) {
+      return contextCollection.contextFor(options.directory)
+          as DriverBasedAnalysisContext;
+    } else {
+      return contextCollection.contexts.single as DriverBasedAnalysisContext;
+    }
+  }
+
+  Ansi get ansi => logger.ansi;
+
+  AnalysisContextCollection get contextCollection {
+    _contextCollection ??= AnalysisContextCollectionImpl(
+        includedPaths: [options.directory],
+        resourceProvider: resourceProvider,
+        sdkPath: pathContext.normalize(options.sdkPath));
+    return _contextCollection;
+  }
+
+  @visibleForTesting
+  bool get hasMultipleAnalysisContext {
+    return contextCollection.contexts.length > 1;
+  }
+
+  @visibleForTesting
+  bool get isPreviewServerRunning =>
+      _fixCodeProcessor?.isPreviewServerRunnning ?? false;
+
+  Context get pathContext => resourceProvider.pathContext;
+
+  ResourceProvider get resourceProvider => cli.resourceProvider;
+
+  /// Blocks until an interrupt signal (control-C) is received.  Tests may
+  /// override this method to simulate control-C.
+  @visibleForTesting
+  Future<void> blockUntilSignalInterrupt() {
+    Stream<ProcessSignal> stream = ProcessSignal.sigint.watch();
+    return stream.first;
+  }
+
+  /// Computes the set of file paths that should be analyzed by the migration
+  /// engine.  May be overridden by a derived class.
+  ///
+  /// All files to be migrated must be included in the returned set.  It is
+  /// permissible for the set to contain additional files that could help the
+  /// migration tool build up a more complete nullability graph (for example
+  /// generated files, or usages of the code-to-be-migrated by one one of its
+  /// clients).
+  ///
+  /// By default returns the set of all `.dart` files contained in the context.
+  Set<String> computePathsToProcess(DriverBasedAnalysisContext context) =>
+      context.contextRoot
+          .analyzedFiles()
+          .where((s) => s.endsWith('.dart'))
+          .toSet();
+
+  NonNullableFix createNonNullableFix(DartFixListener listener,
+      ResourceProvider resourceProvider, LineInfo getLineInfo(String path),
+      {List<String> included = const <String>[],
+      int preferredPort,
+      String summaryPath}) {
+    return NonNullableFix(listener, resourceProvider, getLineInfo,
+        included: included,
+        preferredPort: preferredPort,
+        summaryPath: summaryPath);
+  }
+
+  /// Runs the full migration process.
+  ///
+  /// If something goes wrong, a message is printed using the logger configured
+  /// in the constructor, and [MigrationExit] is thrown.
+  Future<void> run() async {
+    if (!options.skipPubOutdated) {
+      _checkDependencies();
+    }
+
+    logger.stdout('Migrating ${options.directory}');
+    logger.stdout('');
+
+    if (hasMultipleAnalysisContext) {
+      logger.stdout(
+          'Note: more than one project found; migrating the top-level project.');
+      logger.stdout('');
+    }
+
+    DriverBasedAnalysisContext context = analysisContext;
+
+    List<String> previewUrls;
+    NonNullableFix nonNullableFix;
+
+    logger.stdout(ansi.emphasized('Analyzing project...'));
+    _fixCodeProcessor = _FixCodeProcessor(context, this);
+    _dartFixListener = DartFixListener(
+        DriverProviderImpl(resourceProvider, context), _exceptionReported);
+    nonNullableFix = createNonNullableFix(
+        _dartFixListener, resourceProvider, _fixCodeProcessor.getLineInfo,
+        included: [options.directory],
+        preferredPort: options.previewPort,
+        summaryPath: options.summary);
+    nonNullableFix.rerunFunction = _rerunFunction;
+    _fixCodeProcessor.registerCodeTask(nonNullableFix);
+    _fixCodeProcessor.nonNullableFixTask = nonNullableFix;
+
+    try {
+      await _fixCodeProcessor.runFirstPhase(singlePhaseProgress: true);
+      _checkForErrors();
+    } on ExperimentStatusException catch (e) {
+      logger.stdout(e.toString());
+      final sdkPathVar = cli._environmentVariables['SDK_PATH'];
+      if (sdkPathVar != null) {
+        logger.stdout('$sdkPathEnvironmentVariableSet: $sdkPathVar');
+      }
+      throw MigrationExit(1);
+    }
+
+    logger.stdout('');
+    logger.stdout(ansi.emphasized('Generating migration suggestions...'));
+    previewUrls = await _fixCodeProcessor.runLaterPhases(resetProgress: true);
+
+    if (options.applyChanges) {
+      logger.stdout(ansi.emphasized('Applying changes:'));
+
+      var allEdits = _dartFixListener.sourceChange.edits;
+      _applyMigrationSuggestions(allEdits);
+
+      logger.stdout('');
+      logger.stdout(
+          'Applied ${allEdits.length} ${_pluralize(allEdits.length, 'edit')}.');
+
+      // Note: do not open the web preview if apply-changes is specified, as we
+      // currently cannot tell the web preview to disable the "apply migration"
+      // button.
+      return;
+    }
+
+    if (options.webPreview) {
+      String url = previewUrls.first;
+      assert(previewUrls.length <= 1,
+          'Got unexpected extra preview URLs from server');
+
+      // TODO(#41809): Open a browser automatically.
+      logger.stdout('''
+View the migration suggestions by visiting:
+
+  ${ansi.emphasized(url)}
+
+Use this interactive web view to review, improve, or apply the results.
+''');
+
+      logger.stdout('When finished with the preview, hit ctrl-c '
+          'to terminate this process.');
+      logger.stdout('');
+
+      // Block until sigint (ctrl-c).
+      await blockUntilSignalInterrupt();
+      nonNullableFix.shutdownServer();
+    } else {
+      logger.stdout(ansi.emphasized('Summary of changes:'));
+
+      _displayChangeSummary(_dartFixListener);
+
+      logger.stdout('');
+      logger.stdout('To apply these changes, re-run the tool with '
+          '--${CommandLineOptions.applyChangesFlag}.');
+    }
+  }
+
+  /// Determines whether a migrated version of the file at [path] should be
+  /// output by the migration too.  May be overridden by a derived class.
+  ///
+  /// This method should return `false` for files that are being considered by
+  /// the migration tool for information only (for example generated files, or
+  /// usages of the code-to-be-migrated by one one of its clients).
+  ///
+  /// By default returns `true` if the file is contained within the context
+  /// root.  This means that if a client overrides [computePathsToProcess] to
+  /// return additional paths that aren't inside the user's project, but doesn't
+  /// override this method, then those additional paths will be analyzed but not
+  /// migrated.
+  bool shouldBeMigrated(DriverBasedAnalysisContext context, String path) {
+    return context.contextRoot.isAnalyzed(path);
+  }
+
+  /// Perform the indicated source edits to the given source, returning the
+  /// resulting transformed text.
+  String _applyEdits(SourceFileEdit sourceFileEdit, String source) {
+    List<SourceEdit> edits = _sortEdits(sourceFileEdit);
+    return SourceEdit.applySequence(source, edits);
+  }
+
+  void _applyMigrationSuggestions(List<SourceFileEdit> edits) {
+    // Apply the changes to disk.
+    for (SourceFileEdit sourceFileEdit in edits) {
+      String relPath =
+          pathContext.relative(sourceFileEdit.file, from: options.directory);
+      int count = sourceFileEdit.edits.length;
+      logger.stdout('  $relPath ($count ${_pluralize(count, 'change')})');
+
+      String source;
+      var file = resourceProvider.getFile(sourceFileEdit.file);
+      try {
+        source = file.readAsStringSync();
+      } catch (_) {}
+
+      if (source == null) {
+        logger.stdout('    Unable to retrieve source for file.');
+      } else {
+        source = _applyEdits(sourceFileEdit, source);
+
+        try {
+          file.writeAsStringSync(source);
+        } catch (e) {
+          logger.stdout('    Unable to write source for file: $e');
+        }
+      }
+    }
+  }
+
+  void _checkDependencies() {
+    var successful = DependencyChecker(
+            options.directory, pathContext, logger, cli.processManager)
+        .check();
+    if (!successful) {
+      throw MigrationExit(1);
+    }
+  }
+
+  void _checkForErrors() {
+    if (fileErrors.isEmpty) {
+      logger.stdout('No analysis issues found.');
+    } else {
+      logger.stdout('');
+
+      int issueCount =
+          fileErrors.values.map((list) => list.length).reduce((a, b) => a + b);
+      logger.stdout(
+          '$issueCount analysis ${_pluralize(issueCount, 'issue')} found:');
+      List<AnalysisError> allErrors = fileErrors.values
+          .fold(<AnalysisError>[], (list, element) => list..addAll(element));
+      _displayIssues(logger, options.directory, allErrors, lineInfo);
+      var importErrorCount = allErrors.where(_isUriError).length;
+
+      logger.stdout('');
+      logger.stdout(
+          'Note: analysis errors will result in erroneous migration suggestions.');
+
+      _hasAnalysisErrors = true;
+      if (options.ignoreErrors) {
+        logger.stdout('Continuing with migration suggestions due to the use of '
+            '--${CommandLineOptions.ignoreErrorsFlag}.');
+      } else {
+        // Fail with how to continue.
+        logger.stdout('');
+        if (importErrorCount != 0) {
+          logger.stdout(
+              'Unresolved URIs found.  Did you forget to run "pub get"?');
+          logger.stdout('');
+        }
+        logger.stdout(
+            'Please fix the analysis issues (or, force generation of migration '
+            'suggestions by re-running with '
+            '--${CommandLineOptions.ignoreErrorsFlag}).');
+        throw MigrationExit(1);
+      }
+    }
+  }
+
+  void _displayChangeSummary(DartFixListener migrationResults) {
+    Map<String, List<DartFixSuggestion>> fileSuggestions = {};
+    for (DartFixSuggestion suggestion in migrationResults.suggestions) {
+      String file = suggestion.location.file;
+      fileSuggestions.putIfAbsent(file, () => <DartFixSuggestion>[]);
+      fileSuggestions[file].add(suggestion);
+    }
+
+    // present a diff-like view
+    var diffStyle = DiffStyle(logger.ansi);
+    for (SourceFileEdit sourceFileEdit in migrationResults.sourceChange.edits) {
+      String file = sourceFileEdit.file;
+      String relPath = pathContext.relative(file, from: options.directory);
+      var edits = sourceFileEdit.edits;
+      int count = edits.length;
+
+      logger.stdout('');
+      logger.stdout('${ansi.emphasized(relPath)} '
+          '($count ${_pluralize(count, 'change')}):');
+
+      String source;
+      try {
+        source = resourceProvider.getFile(file).readAsStringSync();
+      } catch (_) {}
+
+      if (source == null) {
+        logger.stdout('  (unable to retrieve source for file)');
+      } else {
+        for (var line
+            in diffStyle.formatDiff(source, _sourceEditsToAtomicEdits(edits))) {
+          logger.stdout('  $line');
+        }
+      }
+    }
+  }
+
+  void _displayIssues(Logger logger, String directory,
+      List<AnalysisError> issues, Map<String, LineInfo> lineInfo) {
+    issues.sort((AnalysisError one, AnalysisError two) {
+      if (one.source != two.source) {
+        return one.source.fullName.compareTo(two.source.fullName);
+      }
+      return one.offset - two.offset;
+    });
+
+    _IssueRenderer renderer =
+        _IssueRenderer(logger, directory, pathContext, lineInfo);
+    for (AnalysisError issue in issues) {
+      renderer.render(issue);
+    }
+  }
+
+  void _exceptionReported(String detail) {
+    if (_hasExceptions) return;
+    _hasExceptions = true;
+    if (options.ignoreExceptions) {
+      logger.stdout('''
+Exception(s) occurred during migration.  Attempting to perform
+migration anyway due to the use of --${CommandLineOptions.ignoreExceptionsFlag}.
+
+To see exception details, re-run without --${CommandLineOptions.ignoreExceptionsFlag}.
+''');
+    } else {
+      if (_hasAnalysisErrors) {
+        logger.stderr('''
+Aborting migration due to an exception.  This may be due to a bug in
+the migration tool, or it may be due to errors in the source code
+being migrated.  If possible, try to fix errors in the source code and
+re-try migrating.  If that doesn't work, consider filing a bug report
+at:
+''');
+      } else {
+        logger.stderr('''
+Aborting migration due to an exception.  This most likely is due to a
+bug in the migration tool.  Please consider filing a bug report at:
+''');
+      }
+      logger.stderr('https://github.com/dart-lang/sdk/issues/new');
+      logger.stderr('''
+To attempt to perform migration anyway, you may re-run with
+--${CommandLineOptions.ignoreExceptionsFlag}.
+
+Exception details:
+''');
+      logger.stderr(detail);
+      throw MigrationExit(1);
+    }
+  }
+
+  bool _isUriError(AnalysisError error) =>
+      error.errorCode == CompileTimeErrorCode.URI_DOES_NOT_EXIST;
+
+  Future<void> _rerunFunction() async {
+    logger.stdout(ansi.emphasized('Recalculating migration suggestions...'));
+
+    _dartFixListener.reset();
+    _fixCodeProcessor.prepareToRerun();
+    await _fixCodeProcessor.runFirstPhase();
+    // TODO(paulberry): check for errors (see
+    // https://github.com/dart-lang/sdk/issues/41712)
+    await _fixCodeProcessor.runLaterPhases();
+  }
+
+  List<SourceEdit> _sortEdits(SourceFileEdit sourceFileEdit) {
+    // Sort edits in reverse offset order.
+    List<SourceEdit> edits = sourceFileEdit.edits.toList();
+    edits.sort((a, b) {
+      return b.offset - a.offset;
+    });
+    return edits;
+  }
 
   static Map<int, List<AtomicEdit>> _sourceEditsToAtomicEdits(
       List<SourceEdit> edits) {
@@ -794,6 +846,14 @@
   }
 }
 
+/// Exception thrown by [MigrationCli] if the client should exit.
+class MigrationExit {
+  /// The exit code that the client should set.
+  final int exitCode;
+
+  MigrationExit(this.exitCode);
+}
+
 /// An abstraction over the static methods on [Process].
 ///
 /// Used in tests to run mock processes.
@@ -823,6 +883,8 @@
 }
 
 class _FixCodeProcessor extends Object {
+  static const numPhases = 3;
+
   final DriverBasedAnalysisContext context;
 
   NonNullableFix _task;
@@ -831,13 +893,13 @@
 
   _ProgressBar _progressBar;
 
-  final MigrationCli _migrationCli;
+  final MigrationCliRunner _migrationCli;
 
   /// The task used to migrate to NNBD.
   NonNullableFix nonNullableFixTask;
 
   _FixCodeProcessor(this.context, this._migrationCli)
-      : pathsToProcess = _computePathsToProcess(context);
+      : pathsToProcess = _migrationCli.computePathsToProcess(context);
 
   bool get isPreviewServerRunnning =>
       nonNullableFixTask?.isPreviewServerRunning ?? false;
@@ -847,7 +909,7 @@
 
   void prepareToRerun() {
     var driver = context.driver;
-    pathsToProcess = _computePathsToProcess(context);
+    pathsToProcess = _migrationCli.computePathsToProcess(context);
     pathsToProcess.forEach(driver.changeFile);
   }
 
@@ -868,10 +930,8 @@
           var result = await driver.getResolvedLibrary(path);
           if (result != null) {
             for (var unit in result.units) {
-              if (pathsToProcess.contains(unit.path) &&
-                  !pathsProcessed.contains(unit.path)) {
+              if (!pathsProcessed.contains(unit.path)) {
                 await process(unit);
-                if (_migrationCli.exitCode != null) return;
                 pathsProcessed.add(unit.path);
               }
             }
@@ -888,7 +948,6 @@
         continue;
       }
       await process(result);
-      if (_migrationCli.exitCode != null) return;
     }
   }
 
@@ -899,7 +958,7 @@
   Future<void> runFirstPhase({bool singlePhaseProgress = false}) async {
     // All tasks should be registered; [numPhases] should be finalized.
     _progressBar = _ProgressBar(
-        pathsToProcess.length * (singlePhaseProgress ? 1 : _task.numPhases));
+        pathsToProcess.length * (singlePhaseProgress ? 1 : numPhases));
 
     // Process package
     _task.processPackage(context.contextRoot.root);
@@ -916,38 +975,34 @@
       }
       if (_migrationCli.options.ignoreErrors ||
           _migrationCli.fileErrors.isEmpty) {
-        await _task.processUnit(0, result);
+        await _task.prepareUnit(result);
       }
     });
   }
 
   Future<List<String>> runLaterPhases({bool resetProgress = false}) async {
     if (resetProgress) {
-      _progressBar =
-          _ProgressBar(pathsToProcess.length * (_task.numPhases - 1));
+      _progressBar = _ProgressBar(pathsToProcess.length * (numPhases - 1));
     }
 
-    for (var phase = 1; phase < _task.numPhases; phase++) {
-      await processResources((ResolvedUnitResult result) async {
-        _progressBar.tick();
-        await _task.processUnit(phase, result);
-      });
-    }
+    await processResources((ResolvedUnitResult result) async {
+      _progressBar.tick();
+      await _task.processUnit(result);
+    });
+    await processResources((ResolvedUnitResult result) async {
+      _progressBar.tick();
+      if (_migrationCli.shouldBeMigrated(context, result.path)) {
+        await _task.finalizeUnit(result);
+      }
+    });
     var state = await _task.finish();
-    if (_migrationCli.exitCode == null && _migrationCli.options.webPreview) {
+    if (_migrationCli.options.webPreview) {
       await _task.startPreviewServer(state);
     }
     _progressBar.complete();
 
     return nonNullableFixTask.previewUrls;
   }
-
-  static Set<String> _computePathsToProcess(
-          DriverBasedAnalysisContext context) =>
-      context.contextRoot
-          .analyzedFiles()
-          .where((s) => s.endsWith('.dart'))
-          .toSet();
 }
 
 /// Given a Logger and an analysis issue, render the issue to the logger.
diff --git a/pkg/nnbd_migration/lib/src/edge_builder.dart b/pkg/nnbd_migration/lib/src/edge_builder.dart
index cbfb4cc..8399281 100644
--- a/pkg/nnbd_migration/lib/src/edge_builder.dart
+++ b/pkg/nnbd_migration/lib/src/edge_builder.dart
@@ -1362,7 +1362,12 @@
   DecoratedType visitReturnStatement(ReturnStatement node) {
     DecoratedType returnType = _currentFunctionType.returnType;
     Expression returnValue = node.expression;
-    final isAsync = node.thisOrAncestorOfType<FunctionBody>().isAsynchronous;
+    var functionBody = node.thisOrAncestorOfType<FunctionBody>();
+    if (functionBody.isGenerator) {
+      // Do not connect the return value to the return type.
+      return _dispatch(returnValue);
+    }
+    final isAsync = functionBody.isAsynchronous;
     if (returnValue == null) {
       var target =
           NullabilityNodeTarget.text('implicit null return').withCodeRef(node);
diff --git a/pkg/nnbd_migration/lib/src/fix_builder.dart b/pkg/nnbd_migration/lib/src/fix_builder.dart
index 99bf8fc..01fe7f3 100644
--- a/pkg/nnbd_migration/lib/src/fix_builder.dart
+++ b/pkg/nnbd_migration/lib/src/fix_builder.dart
@@ -293,9 +293,13 @@
 
 /// Implementation of [MigrationResolutionHooks] that interfaces with
 /// [FixBuilder].
-class MigrationResolutionHooksImpl implements MigrationResolutionHooks {
+class MigrationResolutionHooksImpl
+    with ResolutionUtils
+    implements MigrationResolutionHooks {
   FixBuilder _fixBuilder;
 
+  TypeProvider get typeProvider => _fixBuilder.typeProvider;
+
   final Expando<List<CollectionElement>> _collectionElements = Expando();
 
   final Expando<bool> _shouldStayNullAware = Expando();
@@ -583,8 +587,18 @@
     return type;
   }
 
+  Element get _elementToString =>
+      _fixBuilder.typeProvider.objectType.getMethod('toString');
+  Element get _elementHashCode =>
+      _fixBuilder.typeProvider.objectType.getGetter('hashCode');
+  Element get _elementRuntimeType =>
+      _fixBuilder.typeProvider.objectType.getMethod('runtimeType');
+  Element get _elementNoSuchMethod =>
+      _fixBuilder.typeProvider.objectType.getGetter('noSuchMethod');
+
   bool _needsNullCheckDueToStructure(Expression node) {
     var parent = node.parent;
+
     if (parent is BinaryExpression) {
       if (identical(node, parent.leftOperand)) {
         var operatorType = parent.operator.type;
@@ -597,16 +611,22 @@
         }
       }
     } else if (parent is PrefixedIdentifier) {
-      // TODO(paulberry): ok for toString etc. if the shape is correct
+      if (isDeclaredOnObject(parent.identifier.name)) {
+        return false;
+      }
       return identical(node, parent.prefix);
     } else if (parent is PropertyAccess) {
+      if (isDeclaredOnObject(parent.propertyName.name)) {
+        return false;
+      }
       // TODO(paulberry): what about cascaded?
-      // TODO(paulberry): ok for toString etc. if the shape is correct
       return parent.operator.type == TokenType.PERIOD &&
           identical(node, parent.target);
     } else if (parent is MethodInvocation) {
+      if (isDeclaredOnObject(parent.methodName.name)) {
+        return false;
+      }
       // TODO(paulberry): what about cascaded?
-      // TODO(paulberry): ok for toString etc. if the shape is correct
       return parent.operator.type == TokenType.PERIOD &&
           identical(node, parent.target);
     } else if (parent is IndexExpression) {
diff --git a/pkg/nnbd_migration/lib/src/front_end/non_nullable_fix.dart b/pkg/nnbd_migration/lib/src/front_end/non_nullable_fix.dart
index bf769d4..b34a302 100644
--- a/pkg/nnbd_migration/lib/src/front_end/non_nullable_fix.dart
+++ b/pkg/nnbd_migration/lib/src/front_end/non_nullable_fix.dart
@@ -91,12 +91,17 @@
 
   bool get isPreviewServerRunning => _server != null;
 
-  int get numPhases => 3;
-
   InstrumentationListener createInstrumentationListener(
           {MigrationSummary migrationSummary}) =>
       InstrumentationListener(migrationSummary: migrationSummary);
 
+  Future<void> finalizeUnit(ResolvedUnitResult result) async {
+    if (!_packageIsNNBD) {
+      return;
+    }
+    migration.finalizeInput(result);
+  }
+
   Future<MigrationState> finish() async {
     migration.finish();
     final state = MigrationState(
@@ -105,6 +110,13 @@
     return state;
   }
 
+  Future<void> prepareUnit(ResolvedUnitResult result) async {
+    if (!_packageIsNNBD) {
+      return;
+    }
+    migration.prepareInput(result);
+  }
+
   /// Processes the non-source files of the package rooted at [pkgFolder].
   ///
   /// This means updating the pubspec.yaml file and the package_config.json
@@ -138,23 +150,11 @@
     }
   }
 
-  Future<void> processUnit(int phase, ResolvedUnitResult result) async {
+  Future<void> processUnit(ResolvedUnitResult result) async {
     if (!_packageIsNNBD) {
       return;
     }
-    switch (phase) {
-      case 0:
-        migration.prepareInput(result);
-        break;
-      case 1:
-        migration.processInput(result);
-        break;
-      case 2:
-        migration.finalizeInput(result);
-        break;
-      default:
-        throw ArgumentError('Unsupported phase $phase');
-    }
+    migration.processInput(result);
   }
 
   Future<MigrationState> rerun() async {
diff --git a/pkg/nnbd_migration/lib/src/front_end/resources/resources.g.dart b/pkg/nnbd_migration/lib/src/front_end/resources/resources.g.dart
index d6e90ed..f86160d 100644
--- a/pkg/nnbd_migration/lib/src/front_end/resources/resources.g.dart
+++ b/pkg/nnbd_migration/lib/src/front_end/resources/resources.g.dart
@@ -635,7 +635,7 @@
 ''';
 
 String _migration_js;
-// migration_dart md5 is '45896e96651e161c6def4d377a5a9d10'
+// migration_dart md5 is '7ab04e2be35dbf566710573204ca4c44'
 String _migration_js_base64 = '''
 KGZ1bmN0aW9uIGRhcnRQcm9ncmFtKCl7ZnVuY3Rpb24gY29weVByb3BlcnRpZXMoYSxiKXt2YXIgdD1P
 YmplY3Qua2V5cyhhKQpmb3IodmFyIHM9MDtzPHQubGVuZ3RoO3MrKyl7dmFyIHI9dFtzXQpiW3JdPWFb
@@ -2120,2315 +2120,2319 @@
 dCgpLHM9Qy5DRC56USgkLmZpKCkub2Zmc2V0SGVpZ2h0KSxyPXdpbmRvdy5pbm5lckhlaWdodCxxPUMu
 Q0QuelEoJC5EVygpLm9mZnNldEhlaWdodCkKaWYodHlwZW9mIHIhPT0ibnVtYmVyIilyZXR1cm4gci5I
 TigpCmlmKHQuYm90dG9tPnItKHErMTQpKUouZGgoYSkKZWxzZSBpZih0LnRvcDxzKzE0KUouZGgoYSl9
-LApmRzpmdW5jdGlvbihhLGIpe3ZhciB0LHMscgppZihhIT1udWxsKXt0PWRvY3VtZW50CnM9dC5nZXRF
-bGVtZW50QnlJZCgibyIrSC5kKGEpKQpyPXQucXVlcnlTZWxlY3RvcigiLmxpbmUtIitILmQoYikpCmlm
-KHMhPW51bGwpe0wucU8ocykKSi5kUihzKS5pKDAsInRhcmdldCIpfWVsc2UgaWYociE9bnVsbClMLnFP
-KHIucGFyZW50RWxlbWVudCkKaWYociE9bnVsbClKLmRSKHUuaC5hKHIucGFyZW50Tm9kZSkpLmkoMCwi
-aGlnaGxpZ2h0Iil9ZWxzZSBMLnFPKCQuRDkoKSl9LAphZjpmdW5jdGlvbihhLGIsYyxkLGUpe3ZhciB0
-LHMscj1MLkc2KHdpbmRvdy5sb2NhdGlvbi5ocmVmKSxxPUwuYUsod2luZG93LmxvY2F0aW9uLmhyZWYp
-CmlmKHIhPW51bGwpe3Q9ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm8iK0guZChyKSkKaWYodCE9bnVs
-bClKLmRSKHQpLlIoMCwidGFyZ2V0Iil9aWYocSE9bnVsbCl7cz1kb2N1bWVudC5xdWVyeVNlbGVjdG9y
-KCIubGluZS0iK0guZChxKSkKaWYocyE9bnVsbClKLmRSKHMucGFyZW50RWxlbWVudCkuUigwLCJoaWdo
-bGlnaHQiKX1pZihhPT13aW5kb3cubG9jYXRpb24ucGF0aG5hbWUpe0wuZkcoYixjKQplLiQwKCl9ZWxz
-ZSBMLkc3KGEsYixjLGQsZSl9LApRNDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscj1QLmhLKGEpLHE9dS5O
-CnE9UC5GbChxLHEpCmZvcih0PXIuZ2hZKCksdD10LmdQdSh0KSx0PXQuZ2t6KHQpO3QuRigpOyl7cz10
-LmdsKCkKcS5ZKDAscy5hLHMuYil9Zm9yKHQ9Yi5nUHUoYiksdD10Lmdreih0KTt0LkYoKTspe3M9dC5n
-bCgpCnEuWSgwLHMuYSxzLmIpfXEuWSgwLCJhdXRoVG9rZW4iLCQuVUUoKSkKcmV0dXJuIHIubm0oMCxx
-KS53KDApfSwKVDE6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscCxvLG4sbSxsLGs9JC5oTCgpCkoubDUo
-aywiIikKaWYoYT09bnVsbCl7dD1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJwIikKdC50ZXh0Q29udGVu
-dD0iU2VlIGRldGFpbHMgYWJvdXQgYSBwcm9wb3NlZCBlZGl0LiIKQy5MdC5zUCh0LEguVk0oWyJwbGFj
-ZWhvbGRlciJdLHUucykpCmsuYXBwZW5kQ2hpbGQodCkKQy5MdC5GRih0KQpyZXR1cm59cz1hLmQKcj0k
-Lm5VKCkKcT1yLnpmKHMpCnA9YS5iCm89ZG9jdW1lbnQKbj1yLkhQKHMsSi5UMChvLnF1ZXJ5U2VsZWN0
-b3IoIi5yb290IikudGV4dENvbnRlbnQpKQptPWEuYwpsPW8uY3JlYXRlRWxlbWVudCgicCIpCmsuYXBw
-ZW5kQ2hpbGQobCkKbC5hcHBlbmRDaGlsZChvLmNyZWF0ZVRleHROb2RlKEguZChwKSsiIGF0ICIpKQpy
-PXUuTgpyPVcuSjYoTC5RNChhLmUsUC5FRihbImxpbmUiLEouaihtKV0scixyKSkpCnIuYXBwZW5kQ2hp
-bGQoby5jcmVhdGVUZXh0Tm9kZShILmQobikrIjoiK0guZChtKSsiLiIpKQpsLmFwcGVuZENoaWxkKHIp
-CkouZGgobCkKTC5DQyhhLGsscSkKTC5GeihhLGspfSwKTEg6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMs
-cixxLHAsbyxuLG0sbCxrLGosaSxoLGc9JC55UCgpCkoubDUoZywiIikKaWYoYi5nQShiKT09PTApe3Q9
-ZG9jdW1lbnQKcz10LmNyZWF0ZUVsZW1lbnQoInAiKQpnLmFwcGVuZENoaWxkKHMpCnMuYXBwZW5kQ2hp
-bGQodC5jcmVhdGVUZXh0Tm9kZSgiTm8gcHJvcG9zZWQgZWRpdHMiKSl9ZWxzZSBmb3IoZz1iLmdQdShi
-KSxnPWcuZ2t6KGcpLHQ9dS5RLHI9dC5DKCJ+KDEpIikscT11Lk0sdD10LmQ7Zy5GKCk7KXtwPWcuZ2wo
-KQpvPWRvY3VtZW50CnM9by5jcmVhdGVFbGVtZW50KCJwIikKbj0kLnlQKCkKbi5hcHBlbmRDaGlsZChz
-KQpzLmFwcGVuZENoaWxkKG8uY3JlYXRlVGV4dE5vZGUoSC5kKHAuYSkrIjoiKSkKbT1vLmNyZWF0ZUVs
-ZW1lbnQoInVsIikKbi5hcHBlbmRDaGlsZChtKQpmb3IocD1KLklUKHAuYik7cC5GKCk7KXtuPXAuZ2wo
-KQpsPW8uY3JlYXRlRWxlbWVudCgibGkiKQptLmFwcGVuZENoaWxkKGwpCkouZFIobCkuaSgwLCJlZGl0
-IikKaz1vLmNyZWF0ZUVsZW1lbnQoImEiKQpsLmFwcGVuZENoaWxkKGspCmsuY2xhc3NMaXN0LmFkZCgi
-ZWRpdC1saW5rIikKaj1uLmMKaT1ILmQoaikKay5zZXRBdHRyaWJ1dGUoImRhdGEtIituZXcgVy5TeShu
-ZXcgVy5pNyhrKSkuTygib2Zmc2V0IiksaSkKaD1uLmEKaT1ILmQoaCkKay5zZXRBdHRyaWJ1dGUoImRh
-dGEtIituZXcgVy5TeShuZXcgVy5pNyhrKSkuTygibGluZSIpLGkpCmsuYXBwZW5kQ2hpbGQoby5jcmVh
-dGVUZXh0Tm9kZSgibGluZSAiK0guZChoKSkpCmk9ci5iKG5ldyBMLkVFKGosaCxhKSkKcS5iKG51bGwp
-ClcuSkUoaywiY2xpY2siLGksITEsdCkKbC5hcHBlbmRDaGlsZChvLmNyZWF0ZVRleHROb2RlKCI6ICIr
-SC5kKG4uYikpKX19aWYoYylMLlQxKG51bGwpfSwKRnI6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMscj13
-aW5kb3cubG9jYXRpb24scT1QLmhLKChyJiZDLkV4KS5nRHIocikrSC5kKGEpKQpyPXUuTgpyPVAuRmwo
-cixyKQppZihiIT1udWxsKXIuWSgwLCJvZmZzZXQiLEguZChiKSkKaWYoYyE9bnVsbClyLlkoMCwibGlu
-ZSIsSC5kKGMpKQpyLlkoMCwiYXV0aFRva2VuIiwkLlVFKCkpCnE9cS5ubSgwLHIpCnI9d2luZG93Lmhp
-c3RvcnkKdD11LnoKcz1xLncoMCkKci50b1N0cmluZwpyLnB1c2hTdGF0ZShuZXcgUC5CZihbXSxbXSku
-UHYoUC5GbCh0LHQpKSwiIixzKX0sCkVuOmZ1bmN0aW9uKGEpe3ZhciB0PUouYmIoZG9jdW1lbnQucXVl
-cnlTZWxlY3RvcigiLnJvb3QiKS50ZXh0Q29udGVudCwiLyIpCmlmKEMueEIubihhLHQpKXJldHVybiBD
-LnhCLkcoYSx0Lmxlbmd0aCkKZWxzZSByZXR1cm4gYX0sCkJYOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxy
-PXt9CnIuYT1hCmE9TC5FbihhKQpyLmE9YQokLkQ5KCkudGV4dENvbnRlbnQ9YQp0PWRvY3VtZW50CnM9
-dS5oCkguRGgocyxzLCJUIiwicXVlcnlTZWxlY3RvckFsbCIpCnQ9bmV3IFcud3oodC5xdWVyeVNlbGVj
-dG9yQWxsKCIubmF2LXBhbmVsIC5uYXYtbGluayIpLHUuVCkKdC5LKHQsbmV3IEwuVlMocikpfSwKQkU6
-ZnVuY3Rpb24oYSxiLGMpe3ZhciB0PSIucmVnaW9ucyIscz1kb2N1bWVudCxyPXMucXVlcnlTZWxlY3Rv
-cih0KSxxPXMucXVlcnlTZWxlY3RvcigiLmNvZGUiKQpKLnRIKHIsYi5hLCQuS0coKSkKSi50SChxLGIu
-YiwkLktHKCkpCkwuTEgoYSxiLmQsYykKTC52VSgpCkwueVgoIi5jb2RlIiwhMCkKTC55WCh0LCEwKX0s
-CnRYOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEscCxvLG4sbSxsLGssaixpLGgsZz1kb2N1bWVudCxm
-PWcuY3JlYXRlRWxlbWVudCgidWwiKQphLmFwcGVuZENoaWxkKGYpCmZvcih0PWIubGVuZ3RoLHM9dS5N
-LHI9MDtyPGIubGVuZ3RoO2IubGVuZ3RoPT09dHx8KDAsSC5saykoYiksKytyKXtxPWJbcl0KcD1nLmNy
-ZWF0ZUVsZW1lbnQoImxpIikKZi5hcHBlbmRDaGlsZChwKQpvPUouUkUocCkKaWYocS5hPT09Qy5ZMil7
-by5nUChwKS5pKDAsImRpciIpCm49Zy5jcmVhdGVFbGVtZW50KCJzcGFuIikKcC5hcHBlbmRDaGlsZChu
-KQpvPUouUkUobikKby5nUChuKS5pKDAsImFycm93IikKby5zaGYobiwiJiN4MjVCQzsiKQptPWcuY3Jl
-YXRlRWxlbWVudCgic3BhbiIpCnAuYXBwZW5kQ2hpbGQobSkKSi5sNShtLCImI3gxRjRDMTsiKQpwLmFw
-cGVuZENoaWxkKGcuY3JlYXRlVGV4dE5vZGUocS5iKSkKTC50WChwLHEuYykKTC5reihuKX1lbHNle28u
-c2hmKHAsIiYjeDFGNEM0OyIpCmw9Zy5jcmVhdGVFbGVtZW50KCJhIikKcC5hcHBlbmRDaGlsZChsKQpv
-PUouUkUobCkKby5nUChsKS5pKDAsIm5hdi1saW5rIikKbC5zZXRBdHRyaWJ1dGUoImRhdGEtIituZXcg
-Vy5TeShuZXcgVy5pNyhsKSkuTygibmFtZSIpLHEuZCkKbC5zZXRBdHRyaWJ1dGUoImhyZWYiLHEuZSkK
-bC5hcHBlbmRDaGlsZChnLmNyZWF0ZVRleHROb2RlKHEuYikpCm89by5nVmwobCkKaz1vLiR0aQpqPWsu
-QygifigxKSIpLmIobmV3IEwuVEQoKSkKcy5iKG51bGwpClcuSkUoby5hLG8uYixqLCExLGsuZCkKaT1x
-LmYKaWYodHlwZW9mIGkhPT0ibnVtYmVyIilyZXR1cm4gaS5vcygpCmlmKGk+MCl7aD1nLmNyZWF0ZUVs
-ZW1lbnQoInNwYW4iKQpwLmFwcGVuZENoaWxkKGgpCkouZFIoaCkuaSgwLCJlZGl0LWNvdW50IikKbz0i
-IitpKyIgIgppZihpPT09MSlrPSJlZGl0IgplbHNlIGs9ImVkaXRzIgpoLnNldEF0dHJpYnV0ZSgidGl0
-bGUiLG8raykKaC5hcHBlbmRDaGlsZChnLmNyZWF0ZVRleHROb2RlKEMuam4udyhpKSkpfX19fSwKRno6
-ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxqLGk9YS5hCmlmKGk9PW51bGwpcmV0
-dXJuCnQ9ZG9jdW1lbnQKcz10LmNyZWF0ZUVsZW1lbnQoInAiKQpyPWIuYXBwZW5kQ2hpbGQocykKcz10
-LmNyZWF0ZUVsZW1lbnQoInNwYW4iKQpxPXUucwpKLk11KHMsSC5WTShbInR5cGUtZGVzY3JpcHRpb24i
-XSxxKSkKcy5hcHBlbmRDaGlsZCh0LmNyZWF0ZVRleHROb2RlKCJBY3Rpb25zIikpCnIuYXBwZW5kQ2hp
-bGQocykKci5hcHBlbmRDaGlsZCh0LmNyZWF0ZVRleHROb2RlKCI6IikpCnA9dC5jcmVhdGVFbGVtZW50
-KCJwIikKYi5hcHBlbmRDaGlsZChwKQpmb3Iocz1pLmxlbmd0aCxvPXUuWCxuPTA7bjxpLmxlbmd0aDtp
-Lmxlbmd0aD09PXN8fCgwLEgubGspKGkpLCsrbil7bT1pW25dCmw9dC5jcmVhdGVFbGVtZW50KCJhIikK
-cC5hcHBlbmRDaGlsZChsKQpsLmFwcGVuZENoaWxkKHQuY3JlYXRlVGV4dE5vZGUobS5hKSkKbC5zZXRB
-dHRyaWJ1dGUoImhyZWYiLG0uYikKaz1vLmIoSC5WTShbImFkZC1oaW50LWxpbmsiLCJiZWZvcmUtYXBw
-bHkiLCJidXR0b24iXSxxKSkKaj1KLmRSKGwpCmouVjEoMCkKai5GVigwLGspfX0sCkNDOmZ1bmN0aW9u
-KGE4LGE5LGIwKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxqLGksaCxnLGYsZSxkLGMsYixhLGEwLGEx
-LGEyLGEzLGE0LGE1LGE2LGE3CmZvcih0PWE4LmYscz10Lmxlbmd0aCxyPXUucyxxPXUuWCxwPXUuUSxv
-PXAuQygifigxKSIpLG49dS5NLHA9cC5kLG09MDttPHQubGVuZ3RoO3QubGVuZ3RoPT09c3x8KDAsSC5s
-aykodCksKyttKXtsPXRbbV0Kaz1kb2N1bWVudApqPWsuY3JlYXRlRWxlbWVudCgicCIpCmk9cS5iKEgu
-Vk0oWyJ0cmFjZSJdLHIpKQpoPUouZFIoaikKaC5WMSgwKQpoLkZWKDAsaSkKZz1hOS5hcHBlbmRDaGls
-ZChqKQpqPWsuY3JlYXRlRWxlbWVudCgic3BhbiIpCmk9cS5iKEguVk0oWyJ0eXBlLWRlc2NyaXB0aW9u
-Il0scikpCmg9Si5kUihqKQpoLlYxKDApCmguRlYoMCxpKQpqLmFwcGVuZENoaWxkKGsuY3JlYXRlVGV4
-dE5vZGUobC5hKSkKZy5hcHBlbmRDaGlsZChqKQpnLmFwcGVuZENoaWxkKGsuY3JlYXRlVGV4dE5vZGUo
-IjoiKSkKaj1rLmNyZWF0ZUVsZW1lbnQoInVsIikKaT1xLmIoSC5WTShbInRyYWNlIl0scikpCmg9Si5k
-UihqKQpoLlYxKDApCmguRlYoMCxpKQpmPWcuYXBwZW5kQ2hpbGQoaikKZm9yKGo9bC5iLGk9ai5sZW5n
-dGgsZT0wO2U8ai5sZW5ndGg7ai5sZW5ndGg9PT1pfHwoMCxILmxrKShqKSwrK2Upe2Q9altlXQpjPWsu
-Y3JlYXRlRWxlbWVudCgibGkiKQpmLmFwcGVuZENoaWxkKGMpCmI9ay5jcmVhdGVFbGVtZW50KCJzcGFu
-IikKYT1xLmIoSC5WTShbImZ1bmN0aW9uIl0scikpCmg9Si5kUihiKQpoLlYxKDApCmguRlYoMCxhKQph
-PWQuYgpMLmtEKGIsYT09bnVsbD8idW5rbm93biI6YSkKYy5hcHBlbmRDaGlsZChiKQphMD1kLmMKaWYo
-YTAhPW51bGwpe2MuYXBwZW5kQ2hpbGQoay5jcmVhdGVUZXh0Tm9kZSgiICgiKSkKYTE9YTAuYgphMj1r
-LmNyZWF0ZUVsZW1lbnQoImEiKQphMi5hcHBlbmRDaGlsZChrLmNyZWF0ZVRleHROb2RlKEguZChhMC5j
-KSsiOiIrSC5kKGExKSkpCmEyLnNldEF0dHJpYnV0ZSgiaHJlZiIsYTAuYSkKYTIuY2xhc3NMaXN0LmFk
-ZCgibmF2LWxpbmsiKQpjLmFwcGVuZENoaWxkKGEyKQpjLmFwcGVuZENoaWxkKGsuY3JlYXRlVGV4dE5v
-ZGUoIikiKSl9Yy5hcHBlbmRDaGlsZChrLmNyZWF0ZVRleHROb2RlKCI6ICIpKQpiPWQuYQpMLmtEKGMs
-Yj09bnVsbD8idW5rbm93biI6YikKYj1kLmQKaWYoYi5sZW5ndGghPT0wKXthPWsuY3JlYXRlRWxlbWVu
-dCgicCIpCmEzPXEuYihILlZNKFsiZHJhd2VyIiwiYmVmb3JlLWFwcGx5Il0scikpCmg9Si5kUihhKQpo
-LlYxKDApCmguRlYoMCxhMykKYTQ9Yy5hcHBlbmRDaGlsZChhKQpmb3IoYT1iLmxlbmd0aCxhNT0wO2E1
-PGIubGVuZ3RoO2IubGVuZ3RoPT09YXx8KDAsSC5saykoYiksKythNSl7YTY9YlthNV0KYTM9ay5jcmVh
-dGVFbGVtZW50KCJidXR0b24iKQphNz1vLmIobmV3IEwuQVMoYTYsYTApKQpuLmIobnVsbCkKVy5KRShh
-MywiY2xpY2siLGE3LCExLHApCmEzLmFwcGVuZENoaWxkKGsuY3JlYXRlVGV4dE5vZGUoTS5PWChhNi5h
-KSkpCmE0LmFwcGVuZENoaWxkKGEzKX19fX19LAprRDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscj1ILlZN
-KGIuc3BsaXQoIi4iKSx1LnMpLHE9Qy5ObS5ndEgocikscD1kb2N1bWVudAphLmFwcGVuZENoaWxkKHAu
-Y3JlYXRlVGV4dE5vZGUocSkpCmZvcihxPUgucUMociwxLG51bGwsdS5OKSxxPW5ldyBILmE3KHEscS5n
-QShxKSxxLiR0aS5DKCJhNzxhTC5FPiIpKSx0PUouUkUoYSk7cS5GKCk7KXtzPXEuZAp0Lm56KGEsImJl
-Zm9yZWVuZCIsIiYjODIwMzsuIixudWxsLG51bGwpCmEuYXBwZW5kQ2hpbGQocC5jcmVhdGVUZXh0Tm9k
-ZShzKSl9fSwKZTpmdW5jdGlvbiBlKCl7fSwKVlc6ZnVuY3Rpb24gVlcoYSxiLGMpe3RoaXMuYT1hCnRo
-aXMuYj1iCnRoaXMuYz1jfSwKb1o6ZnVuY3Rpb24gb1ooKXt9LApqcjpmdW5jdGlvbiBqcigpe30sCnFs
-OmZ1bmN0aW9uIHFsKCl7fSwKeTg6ZnVuY3Rpb24geTgoKXt9LApIaTpmdW5jdGlvbiBIaSgpe30sCkJU
-OmZ1bmN0aW9uIEJUKCl7fSwKTDpmdW5jdGlvbiBMKCl7fSwKV3g6ZnVuY3Rpb24gV3goYSxiKXt0aGlz
-LmE9YQp0aGlzLmI9Yn0sCkFPOmZ1bmN0aW9uIEFPKGEpe3RoaXMuYT1hfSwKZE46ZnVuY3Rpb24gZE4o
-YSl7dGhpcy5hPWF9LApIbzpmdW5jdGlvbiBIbyhhKXt0aGlzLmE9YX0sCnh6OmZ1bmN0aW9uIHh6KGEs
-Yil7dGhpcy5hPWEKdGhpcy5iPWJ9LApJQzpmdW5jdGlvbiBJQygpe30sCmZDOmZ1bmN0aW9uIGZDKGEs
-Yil7dGhpcy5hPWEKdGhpcy5iPWJ9LApuVDpmdW5jdGlvbiBuVChhLGIsYyl7dGhpcy5hPWEKdGhpcy5i
-PWIKdGhpcy5jPWN9LApCWjpmdW5jdGlvbiBCWihhKXt0aGlzLmE9YX0sCkdIOmZ1bmN0aW9uIEdIKCl7
-fSwKRUU6ZnVuY3Rpb24gRUUoYSxiLGMpe3RoaXMuYT1hCnRoaXMuYj1iCnRoaXMuYz1jfSwKUUw6ZnVu
-Y3Rpb24gUUwoYSxiKXt0aGlzLmE9YQp0aGlzLmI9Yn0sClZTOmZ1bmN0aW9uIFZTKGEpe3RoaXMuYT1h
-fSwKVEQ6ZnVuY3Rpb24gVEQoKXt9LApBUzpmdW5jdGlvbiBBUyhhLGIpe3RoaXMuYT1hCnRoaXMuYj1i
-fSwKWEE6ZnVuY3Rpb24gWEEoKXt9LAptSzpmdW5jdGlvbihhKXt2YXIgdCxzLHIscSxwLG8sbj1ILlZN
-KFtdLHUuZmgpCmZvcih0PUouSVQodS5SLmIoYSkpO3QuRigpOyl7cz10LmdsKCkKcj1KLlU2KHMpCnE9
-TC5wMihILmMwKHIucShzLCJ0eXBlIikpKQpwPUguYzAoci5xKHMsIm5hbWUiKSkKbz1yLnEocywic3Vi
-dHJlZSIpCm89bz09bnVsbD9udWxsOkwubUsobykKQy5ObS5pKG4sbmV3IEwuWloocSxwLG8sSC5jMChy
-LnEocywicGF0aCIpKSxILmMwKHIucShzLCJocmVmIikpLEguV1koci5xKHMsImVkaXRDb3VudCIpKSkp
-fXJldHVybiBufSwKVkQ6ZnVuY3Rpb24oYSl7dmFyIHQscyxyPUguVk0oW10sdS5KKQpmb3IodD1hLmxl
-bmd0aCxzPTA7czxhLmxlbmd0aDthLmxlbmd0aD09PXR8fCgwLEgubGspKGEpLCsrcylDLk5tLmkocixh
-W3NdLkx0KCkpCnJldHVybiByfSwKcDI6ZnVuY3Rpb24oYSl7c3dpdGNoKGEpe2Nhc2UiZGlyZWN0b3J5
-IjpyZXR1cm4gQy5ZMgpjYXNlImZpbGUiOnJldHVybiBDLnJmCmRlZmF1bHQ6dGhyb3cgSC5iKFAuUFYo
-IlVucmVjb2duaXplZCBuYXZpZ2F0aW9uIHRyZWUgbm9kZSB0eXBlOiAiK0guZChhKSkpfX0sCnZ5OmZ1
-bmN0aW9uKGEpe3N3aXRjaChhKXtjYXNlIEMuWTI6cmV0dXJuImRpcmVjdG9yeSIKY2FzZSBDLnJmOnJl
-dHVybiJmaWxlIn10aHJvdyBILmIoUC5QVigiVW5yZWNvZ25pemVkIG5hdmlnYXRpb24gdHJlZSBub2Rl
-IHR5cGU6ICIrYS53KDApKSl9LApaWjpmdW5jdGlvbiBaWihhLGIsYyxkLGUsZil7dmFyIF89dGhpcwpf
-LmE9YQpfLmI9YgpfLmM9YwpfLmQ9ZApfLmU9ZQpfLmY9Zn0sCk85OmZ1bmN0aW9uIE85KGEpe3RoaXMu
-Yj1hfSwKSVY6ZnVuY3Rpb24gSVYoYSxiLGMsZCl7dmFyIF89dGhpcwpfLmQ9YQpfLmU9YgpfLmY9Ywpf
-LnI9ZH19LFg9ewpDTDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAsbz1iLnhaKGEpCmIuaEsoYSkK
-aWYobyE9bnVsbClhPUouS1YoYSxvLmxlbmd0aCkKdD11LnMKcz1ILlZNKFtdLHQpCnI9SC5WTShbXSx0
-KQp0PWEubGVuZ3RoCmlmKHQhPT0wJiZiLnI0KEMueEIuVyhhLDApKSl7aWYoMD49dClyZXR1cm4gSC5P
-SChhLDApCkMuTm0uaShyLGFbMF0pCnE9MX1lbHNle0MuTm0uaShyLCIiKQpxPTB9Zm9yKHA9cTtwPHQ7
-KytwKWlmKGIucjQoQy54Qi5XKGEscCkpKXtDLk5tLmkocyxDLnhCLk5qKGEscSxwKSkKQy5ObS5pKHIs
-YVtwXSkKcT1wKzF9aWYocTx0KXtDLk5tLmkocyxDLnhCLkcoYSxxKSkKQy5ObS5pKHIsIiIpfXJldHVy
-biBuZXcgWC5XRChiLG8scyxyKX0sCldEOmZ1bmN0aW9uIFdEKGEsYixjLGQpe3ZhciBfPXRoaXMKXy5h
-PWEKXy5iPWIKXy5kPWMKXy5lPWR9LApJNzpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFguZHYoYSl9LApk
-djpmdW5jdGlvbiBkdihhKXt0aGlzLmE9YX19LE89ewpSaDpmdW5jdGlvbigpe3ZhciB0LHM9bnVsbApp
-ZihQLnVvKCkuZ0ZpKCkhPT0iZmlsZSIpcmV0dXJuICQuRWIoKQp0PVAudW8oKQppZighQy54Qi5UYyh0
-LmdJaSh0KSwiLyIpKXJldHVybiAkLkViKCkKaWYoUC5LTChzLCJhL2IiLHMscyxzLHMscykudDQoKT09
-PSJhXFxiIilyZXR1cm4gJC5LaygpCnJldHVybiAkLmJEKCl9LAp6TDpmdW5jdGlvbiB6TCgpe319LEU9
-e09GOmZ1bmN0aW9uIE9GKGEsYixjKXt0aGlzLmQ9YQp0aGlzLmU9Ygp0aGlzLmY9Y319LEY9e3J1OmZ1
-bmN0aW9uIHJ1KGEsYixjLGQpe3ZhciBfPXRoaXMKXy5kPWEKXy5lPWIKXy5mPWMKXy5yPWR9fSxEPXsK
-Ulg6ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwPW51bGwKdHJ5e3A9UC51bygpfWNhdGNoKHQpe2lmKHUu
-ZzguYyhILlJ1KHQpKSl7cz0kLkZmCmlmKHMhPW51bGwpcmV0dXJuIHMKdGhyb3cgdH1lbHNlIHRocm93
-IHR9aWYoSi5STShwLCQuSTYpKXJldHVybiAkLkZmCiQuSTY9cAppZigkLkhrKCk9PSQuRWIoKSlzPSQu
-RmY9cC5aSSgiLiIpLncoMCkKZWxzZXtyPXAudDQoKQpxPXIubGVuZ3RoLTEKcz0kLkZmPXE9PT0wP3I6
-Qy54Qi5OaihyLDAscSl9cmV0dXJuIHN9fQp2YXIgdz1bQyxILEosUCxXLE0sVSxCLFQsTCxYLE8sRSxG
-LERdCmh1bmtIZWxwZXJzLnNldEZ1bmN0aW9uTmFtZXNJZk5lY2Vzc2FyeSh3KQp2YXIgJD17fQpILmVv
-LnByb3RvdHlwZT17fQpKLnZCLnByb3RvdHlwZT17CkROOmZ1bmN0aW9uKGEsYil7cmV0dXJuIGE9PT1i
-fSwKZ2lPOmZ1bmN0aW9uKGEpe3JldHVybiBILmVRKGEpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4iSW5z
-dGFuY2Ugb2YgJyIrSC5kKEguTShhKSkrIicifSwKZTc6ZnVuY3Rpb24oYSxiKXt1Lm8uYihiKQp0aHJv
-dyBILmIoUC5scihhLGIuZ1dhKCksYi5nbmQoKSxiLmdWbSgpKSl9fQpKLnlFLnByb3RvdHlwZT17Cnc6
-ZnVuY3Rpb24oYSl7cmV0dXJuIFN0cmluZyhhKX0sCmdpTzpmdW5jdGlvbihhKXtyZXR1cm4gYT81MTkw
-MTg6MjE4MTU5fSwKJGlhMjoxfQpKLllFLnByb3RvdHlwZT17CkROOmZ1bmN0aW9uKGEsYil7cmV0dXJu
-IG51bGw9PWJ9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiJudWxsIn0sCmdpTzpmdW5jdGlvbihhKXtyZXR1
-cm4gMH0sCmU3OmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuU2ooYSx1Lm8uYihiKSl9LAokaWM4OjF9
-CkouTUYucHJvdG90eXBlPXsKZ2lPOmZ1bmN0aW9uKGEpe3JldHVybiAwfSwKdzpmdW5jdGlvbihhKXty
-ZXR1cm4gU3RyaW5nKGEpfSwKJGl2bToxfQpKLmlDLnByb3RvdHlwZT17fQpKLmtkLnByb3RvdHlwZT17
-fQpKLmM1LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9YVskLncoKV0KaWYodD09bnVsbCly
-ZXR1cm4gdGhpcy50KGEpCnJldHVybiJKYXZhU2NyaXB0IGZ1bmN0aW9uIGZvciAiK0guZChKLmoodCkp
-fSwKJFM6ZnVuY3Rpb24oKXtyZXR1cm57ZnVuYzoxLG9wdDpbLCwsLCwsLCwsLCwsLCwsLF19fSwKJGlF
-SDoxfQpKLmpkLnByb3RvdHlwZT17Cmk6ZnVuY3Rpb24oYSxiKXtILnQ2KGEpLmQuYihiKQppZighIWEu
-Zml4ZWQkbGVuZ3RoKUgudmgoUC5MNCgiYWRkIikpCmEucHVzaChiKX0sClc0OmZ1bmN0aW9uKGEsYil7
-dmFyIHQKaWYoISFhLmZpeGVkJGxlbmd0aClILnZoKFAuTDQoInJlbW92ZUF0IikpCnQ9YS5sZW5ndGgK
-aWYoYj49dCl0aHJvdyBILmIoUC54KGIsbnVsbCkpCnJldHVybiBhLnNwbGljZShiLDEpWzBdfSwKVUc6
-ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMscgpILnQ2KGEpLkMoImNYPDE+IikuYihjKQppZighIWEuZml4
-ZWQkbGVuZ3RoKUgudmgoUC5MNCgiaW5zZXJ0QWxsIikpCnQ9YS5sZW5ndGgKUC53QShiLDAsdCwiaW5k
-ZXgiKQpzPWMubGVuZ3RoCnRoaXMuc0EoYSx0K3MpCnI9YitzCnRoaXMuWVcoYSxyLGEubGVuZ3RoLGEs
-YikKdGhpcy52ZyhhLGIscixjKX0sCm12OmZ1bmN0aW9uKGEpe2lmKCEhYS5maXhlZCRsZW5ndGgpSC52
-aChQLkw0KCJyZW1vdmVMYXN0IikpCmlmKGEubGVuZ3RoPT09MCl0aHJvdyBILmIoSC5IWShhLC0xKSkK
-cmV0dXJuIGEucG9wKCl9LApGVjpmdW5jdGlvbihhLGIpe3ZhciB0CkgudDYoYSkuQygiY1g8MT4iKS5i
-KGIpCmlmKCEhYS5maXhlZCRsZW5ndGgpSC52aChQLkw0KCJhZGRBbGwiKSkKZm9yKHQ9Si5JVChiKTt0
-LkYoKTspYS5wdXNoKHQuZ2woKSl9LApLOmZ1bmN0aW9uKGEsYil7dmFyIHQscwpILnQ2KGEpLkMoIn4o
-MSkiKS5iKGIpCnQ9YS5sZW5ndGgKZm9yKHM9MDtzPHQ7KytzKXtiLiQxKGFbc10pCmlmKGEubGVuZ3Ro
-IT09dCl0aHJvdyBILmIoUC5hNChhKSl9fSwKRTI6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0PUgudDYoYSkK
-cmV0dXJuIG5ldyBILkE4KGEsdC5LcShjKS5DKCIxKDIpIikuYihiKSx0LkMoIkA8MT4iKS5LcShjKS5D
-KCJBODwxLDI+IikpfSwKSDpmdW5jdGlvbihhLGIpe3ZhciB0LHM9bmV3IEFycmF5KGEubGVuZ3RoKQpz
-LmZpeGVkJGxlbmd0aD1BcnJheQpmb3IodD0wO3Q8YS5sZW5ndGg7Kyt0KXRoaXMuWShzLHQsSC5kKGFb
-dF0pKQpyZXR1cm4gcy5qb2luKGIpfSwKTjA6ZnVuY3Rpb24oYSxiLGMsZCl7dmFyIHQscyxyCmQuYihi
-KQpILnQ2KGEpLktxKGQpLkMoIjEoMSwyKSIpLmIoYykKdD1hLmxlbmd0aApmb3Iocz1iLHI9MDtyPHQ7
-KytyKXtzPWMuJDIocyxhW3JdKQppZihhLmxlbmd0aCE9PXQpdGhyb3cgSC5iKFAuYTQoYSkpfXJldHVy
-biBzfSwKSHQ6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG89SC50NihhKQpvLkMoImEyKDEpIiku
-YihiKQpvLkMoIjEoKSIpLmIobnVsbCkKdD1hLmxlbmd0aApmb3Iocz1udWxsLHI9ITEscT0wO3E8dDsr
-K3Epe3A9YVtxXQppZihILm9UKGIuJDEocCkpKXtpZihyKXRocm93IEguYihILmRVKCkpCnM9cApyPSEw
-fWlmKHQhPT1hLmxlbmd0aCl0aHJvdyBILmIoUC5hNChhKSl9aWYocilyZXR1cm4gcwp0aHJvdyBILmIo
-SC5XcCgpKX0sCkU6ZnVuY3Rpb24oYSxiKXtpZihiPDB8fGI+PWEubGVuZ3RoKXJldHVybiBILk9IKGEs
-YikKcmV0dXJuIGFbYl19LApENjpmdW5jdGlvbihhLGIsYyl7aWYoYjwwfHxiPmEubGVuZ3RoKXRocm93
-IEguYihQLlRFKGIsMCxhLmxlbmd0aCwic3RhcnQiLG51bGwpKQppZihjPGJ8fGM+YS5sZW5ndGgpdGhy
-b3cgSC5iKFAuVEUoYyxiLGEubGVuZ3RoLCJlbmQiLG51bGwpKQppZihiPT09YylyZXR1cm4gSC5WTShb
-XSxILnQ2KGEpKQpyZXR1cm4gSC5WTShhLnNsaWNlKGIsYyksSC50NihhKSl9LApndEg6ZnVuY3Rpb24o
-YSl7aWYoYS5sZW5ndGg+MClyZXR1cm4gYVswXQp0aHJvdyBILmIoSC5XcCgpKX0sCmdyWjpmdW5jdGlv
-bihhKXt2YXIgdD1hLmxlbmd0aAppZih0PjApcmV0dXJuIGFbdC0xXQp0aHJvdyBILmIoSC5XcCgpKX0s
-CllXOmZ1bmN0aW9uKGEsYixjLGQsZSl7dmFyIHQscyxyPUgudDYoYSkKci5DKCJjWDwxPiIpLmIoZCkK
-aWYoISFhLmltbXV0YWJsZSRsaXN0KUgudmgoUC5MNCgic2V0UmFuZ2UiKSkKUC5qQihiLGMsYS5sZW5n
-dGgpCnQ9Yy1iCmlmKHQ9PT0wKXJldHVybgpQLmsxKGUsInNraXBDb3VudCIpCnIuQygiek08MT4iKS5i
-KGQpCnI9Si5VNihkKQppZihlK3Q+ci5nQShkKSl0aHJvdyBILmIoSC5hcigpKQppZihlPGIpZm9yKHM9
-dC0xO3M+PTA7LS1zKWFbYitzXT1yLnEoZCxlK3MpCmVsc2UgZm9yKHM9MDtzPHQ7KytzKWFbYitzXT1y
-LnEoZCxlK3MpfSwKdmc6ZnVuY3Rpb24oYSxiLGMsZCl7cmV0dXJuIHRoaXMuWVcoYSxiLGMsZCwwKX0s
-ClZyOmZ1bmN0aW9uKGEsYil7dmFyIHQscwpILnQ2KGEpLkMoImEyKDEpIikuYihiKQp0PWEubGVuZ3Ro
-CmZvcihzPTA7czx0Oysrcyl7aWYoSC5vVChiLiQxKGFbc10pKSlyZXR1cm4hMAppZihhLmxlbmd0aCE9
-PXQpdGhyb3cgSC5iKFAuYTQoYSkpfXJldHVybiExfSwKdGc6ZnVuY3Rpb24oYSxiKXt2YXIgdApmb3Io
-dD0wO3Q8YS5sZW5ndGg7Kyt0KWlmKEouUk0oYVt0XSxiKSlyZXR1cm4hMApyZXR1cm4hMX0sCmdsMDpm
-dW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGg9PT0wfSwKZ29yOmZ1bmN0aW9uKGEpe3JldHVybiBhLmxl
-bmd0aCE9PTB9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLldFKGEsIlsiLCJdIil9LApna3o6ZnVuY3Rp
-b24oYSl7cmV0dXJuIG5ldyBKLm0xKGEsYS5sZW5ndGgsSC50NihhKS5DKCJtMTwxPiIpKX0sCmdpTzpm
-dW5jdGlvbihhKXtyZXR1cm4gSC5lUShhKX0sCmdBOmZ1bmN0aW9uKGEpe3JldHVybiBhLmxlbmd0aH0s
-CnNBOmZ1bmN0aW9uKGEsYil7aWYoISFhLmZpeGVkJGxlbmd0aClILnZoKFAuTDQoInNldCBsZW5ndGgi
-KSkKaWYoYjwwKXRocm93IEguYihQLlRFKGIsMCxudWxsLCJuZXdMZW5ndGgiLG51bGwpKQphLmxlbmd0
-aD1ifSwKcTpmdW5jdGlvbihhLGIpe0guU2MoYikKaWYoYj49YS5sZW5ndGh8fGI8MCl0aHJvdyBILmIo
-SC5IWShhLGIpKQpyZXR1cm4gYVtiXX0sClk6ZnVuY3Rpb24oYSxiLGMpe0gudDYoYSkuZC5iKGMpCmlm
-KCEhYS5pbW11dGFibGUkbGlzdClILnZoKFAuTDQoImluZGV4ZWQgc2V0IikpCmlmKGI+PWEubGVuZ3Ro
-fHxiPDApdGhyb3cgSC5iKEguSFkoYSxiKSkKYVtiXT1jfSwKJGliUToxLAokaWNYOjEsCiRpek06MX0K
-Si5Qby5wcm90b3R5cGU9e30KSi5tMS5wcm90b3R5cGU9ewpnbDpmdW5jdGlvbigpe3JldHVybiB0aGlz
-LmR9LApGOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLHI9cy5hLHE9ci5sZW5ndGgKaWYocy5iIT09cSl0
-aHJvdyBILmIoSC5sayhyKSkKdD1zLmMKaWYodD49cSl7cy5zTShudWxsKQpyZXR1cm4hMX1zLnNNKHJb
-dF0pOysrcy5jCnJldHVybiEwfSwKc006ZnVuY3Rpb24oYSl7dGhpcy5kPXRoaXMuJHRpLmQuYihhKX0s
-CiRpQW46MX0KSi5xSS5wcm90b3R5cGU9ewp5dTpmdW5jdGlvbihhKXt2YXIgdAppZihhPj0tMjE0NzQ4
-MzY0OCYmYTw9MjE0NzQ4MzY0NylyZXR1cm4gYXwwCmlmKGlzRmluaXRlKGEpKXt0PWE8MD9NYXRoLmNl
-aWwoYSk6TWF0aC5mbG9vcihhKQpyZXR1cm4gdCswfXRocm93IEguYihQLkw0KCIiK2ErIi50b0ludCgp
-IikpfSwKelE6ZnVuY3Rpb24oYSl7aWYoYT4wKXtpZihhIT09MS8wKXJldHVybiBNYXRoLnJvdW5kKGEp
-fWVsc2UgaWYoYT4tMS8wKXJldHVybiAwLU1hdGgucm91bmQoMC1hKQp0aHJvdyBILmIoUC5MNCgiIith
-KyIucm91bmQoKSIpKX0sCldaOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEKaWYoYjwyfHxiPjM2KXRo
-cm93IEguYihQLlRFKGIsMiwzNiwicmFkaXgiLG51bGwpKQp0PWEudG9TdHJpbmcoYikKaWYoQy54Qi5t
-KHQsdC5sZW5ndGgtMSkhPT00MSlyZXR1cm4gdApzPS9eKFtcZGEtel0rKSg/OlwuKFtcZGEtel0rKSk/
-XChlXCsoXGQrKVwpJC8uZXhlYyh0KQppZihzPT1udWxsKUgudmgoUC5MNCgiVW5leHBlY3RlZCB0b1N0
-cmluZyByZXN1bHQ6ICIrdCkpCnI9cy5sZW5ndGgKaWYoMT49cilyZXR1cm4gSC5PSChzLDEpCnQ9c1sx
-XQppZigzPj1yKXJldHVybiBILk9IKHMsMykKcT0rc1szXQpyPXNbMl0KaWYociE9bnVsbCl7dCs9cgpx
-LT1yLmxlbmd0aH1yZXR1cm4gdCtDLnhCLkl4KCIwIixxKX0sCnc6ZnVuY3Rpb24oYSl7aWYoYT09PTAm
-JjEvYTwwKXJldHVybiItMC4wIgplbHNlIHJldHVybiIiK2F9LApnaU86ZnVuY3Rpb24oYSl7dmFyIHQs
-cyxyLHEscD1hfDAKaWYoYT09PXApcmV0dXJuIDUzNjg3MDkxMSZwCnQ9TWF0aC5hYnMoYSkKcz1NYXRo
-LmxvZyh0KS8wLjY5MzE0NzE4MDU1OTk0NTN8MApyPU1hdGgucG93KDIscykKcT10PDE/dC9yOnIvdApy
-ZXR1cm4gNTM2ODcwOTExJigocSo5MDA3MTk5MjU0NzQwOTkyfDApKyhxKjM1NDIyNDMxODExNzY1MjF8
-MCkpKjU5OTE5NytzKjEyNTl9LAp6WTpmdW5jdGlvbihhLGIpe3ZhciB0PWElYgppZih0PT09MClyZXR1
-cm4gMAppZih0PjApcmV0dXJuIHQKaWYoYjwwKXJldHVybiB0LWIKZWxzZSByZXR1cm4gdCtifSwKd0c6
-ZnVuY3Rpb24oYSxiKXt2YXIgdAppZihhPjApdD10aGlzLnAzKGEsYikKZWxzZXt0PWI+MzE/MzE6Ygp0
-PWE+PnQ+Pj4wfXJldHVybiB0fSwKYmY6ZnVuY3Rpb24oYSxiKXtpZihiPDApdGhyb3cgSC5iKEgudEwo
-YikpCnJldHVybiB0aGlzLnAzKGEsYil9LApwMzpmdW5jdGlvbihhLGIpe3JldHVybiBiPjMxPzA6YT4+
-PmJ9LAokaUNQOjEsCiRpRks6MX0KSi5iVS5wcm90b3R5cGU9eyRpS046MX0KSi5WQS5wcm90b3R5cGU9
-e30KSi5Eci5wcm90b3R5cGU9ewptOmZ1bmN0aW9uKGEsYil7aWYoYjwwKXRocm93IEguYihILkhZKGEs
-YikpCmlmKGI+PWEubGVuZ3RoKUgudmgoSC5IWShhLGIpKQpyZXR1cm4gYS5jaGFyQ29kZUF0KGIpfSwK
-VzpmdW5jdGlvbihhLGIpe2lmKGI+PWEubGVuZ3RoKXRocm93IEguYihILkhZKGEsYikpCnJldHVybiBh
-LmNoYXJDb2RlQXQoYil9LApkZDpmdW5jdGlvbihhLGIpe3JldHVybiBuZXcgSC51bihiLGEsMCl9LApo
-OmZ1bmN0aW9uKGEsYil7aWYodHlwZW9mIGIhPSJzdHJpbmciKXRocm93IEguYihQLkwzKGIsbnVsbCxu
-dWxsKSkKcmV0dXJuIGErYn0sClRjOmZ1bmN0aW9uKGEsYil7dmFyIHQ9Yi5sZW5ndGgscz1hLmxlbmd0
-aAppZih0PnMpcmV0dXJuITEKcmV0dXJuIGI9PT10aGlzLkcoYSxzLXQpfSwKaTc6ZnVuY3Rpb24oYSxi
-LGMsZCl7dmFyIHQscwpjPVAuakIoYixjLGEubGVuZ3RoKQp0PWEuc3Vic3RyaW5nKDAsYikKcz1hLnN1
-YnN0cmluZyhjKQpyZXR1cm4gdCtkK3N9LApRaTpmdW5jdGlvbihhLGIsYyl7dmFyIHQKaWYoIUgub2so
-YykpSC52aChILnRMKGMpKQppZih0eXBlb2YgYyE9PSJudW1iZXIiKXJldHVybiBjLkooKQppZihjPDB8
-fGM+YS5sZW5ndGgpdGhyb3cgSC5iKFAuVEUoYywwLGEubGVuZ3RoLG51bGwsbnVsbCkpCnQ9YytiLmxl
-bmd0aAppZih0PmEubGVuZ3RoKXJldHVybiExCnJldHVybiBiPT09YS5zdWJzdHJpbmcoYyx0KX0sCm46
-ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhpcy5RaShhLGIsMCl9LApOajpmdW5jdGlvbihhLGIsYyl7aWYo
-IUgub2soYikpSC52aChILnRMKGIpKQppZihjPT1udWxsKWM9YS5sZW5ndGgKaWYodHlwZW9mIGIhPT0i
-bnVtYmVyIilyZXR1cm4gYi5KKCkKaWYoYjwwKXRocm93IEguYihQLngoYixudWxsKSkKaWYoYj5jKXRo
-cm93IEguYihQLngoYixudWxsKSkKaWYoYz5hLmxlbmd0aCl0aHJvdyBILmIoUC54KGMsbnVsbCkpCnJl
-dHVybiBhLnN1YnN0cmluZyhiLGMpfSwKRzpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLk5qKGEsYixu
-dWxsKX0sCmhjOmZ1bmN0aW9uKGEpe3JldHVybiBhLnRvTG93ZXJDYXNlKCl9LApiUzpmdW5jdGlvbihh
-KXt2YXIgdCxzLHIscT1hLnRyaW0oKSxwPXEubGVuZ3RoCmlmKHA9PT0wKXJldHVybiBxCmlmKHRoaXMu
-VyhxLDApPT09MTMzKXt0PUoubW0ocSwxKQppZih0PT09cClyZXR1cm4iIn1lbHNlIHQ9MApzPXAtMQpy
-PXRoaXMubShxLHMpPT09MTMzP0ouYzEocSxzKTpwCmlmKHQ9PT0wJiZyPT09cClyZXR1cm4gcQpyZXR1
-cm4gcS5zdWJzdHJpbmcodCxyKX0sCkl4OmZ1bmN0aW9uKGEsYil7dmFyIHQscwppZigwPj1iKXJldHVy
-biIiCmlmKGI9PT0xfHxhLmxlbmd0aD09PTApcmV0dXJuIGEKaWYoYiE9PWI+Pj4wKXRocm93IEguYihD
-LkVxKQpmb3IodD1hLHM9IiI7ITA7KXtpZigoYiYxKT09PTEpcz10K3MKYj1iPj4+MQppZihiPT09MCli
-cmVhawp0Kz10fXJldHVybiBzfSwKWFU6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0CmlmKGM8MHx8Yz5hLmxl
-bmd0aCl0aHJvdyBILmIoUC5URShjLDAsYS5sZW5ndGgsbnVsbCxudWxsKSkKdD1hLmluZGV4T2YoYixj
-KQpyZXR1cm4gdH0sCk9ZOmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuWFUoYSxiLDApfSwKUGs6ZnVu
-Y3Rpb24oYSxiLGMpe3ZhciB0LHMKaWYoYz09bnVsbCljPWEubGVuZ3RoCmVsc2UgaWYoYzwwfHxjPmEu
-bGVuZ3RoKXRocm93IEguYihQLlRFKGMsMCxhLmxlbmd0aCxudWxsLG51bGwpKQp0PWIubGVuZ3RoCnM9
-YS5sZW5ndGgKaWYoYyt0PnMpYz1zLXQKcmV0dXJuIGEubGFzdEluZGV4T2YoYixjKX0sCmNuOmZ1bmN0
-aW9uKGEsYil7cmV0dXJuIHRoaXMuUGsoYSxiLG51bGwpfSwKSXM6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0
-PWEubGVuZ3RoCmlmKGM+dCl0aHJvdyBILmIoUC5URShjLDAsdCxudWxsLG51bGwpKQpyZXR1cm4gSC5t
-MihhLGIsYyl9LAp0ZzpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLklzKGEsYiwwKX0sCnc6ZnVuY3Rp
-b24oYSl7cmV0dXJuIGF9LApnaU86ZnVuY3Rpb24oYSl7dmFyIHQscyxyCmZvcih0PWEubGVuZ3RoLHM9
-MCxyPTA7cjx0Oysrcil7cz01MzY4NzA5MTEmcythLmNoYXJDb2RlQXQocikKcz01MzY4NzA5MTEmcyso
-KDUyNDI4NyZzKTw8MTApCnNePXM+PjZ9cz01MzY4NzA5MTEmcysoKDY3MTA4ODYzJnMpPDwzKQpzXj1z
-Pj4xMQpyZXR1cm4gNTM2ODcwOTExJnMrKCgxNjM4MyZzKTw8MTUpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0
-dXJuIGEubGVuZ3RofSwKcTpmdW5jdGlvbihhLGIpe0guU2MoYikKaWYoYj49YS5sZW5ndGh8fCExKXRo
-cm93IEguYihILkhZKGEsYikpCnJldHVybiBhW2JdfSwKJGl2WDoxLAokaXFVOjF9CkgucWoucHJvdG90
-eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS5sZW5ndGh9LApxOmZ1bmN0aW9uKGEsYil7
-cmV0dXJuIEMueEIubSh0aGlzLmEsSC5TYyhiKSl9fQpILmJRLnByb3RvdHlwZT17fQpILmFMLnByb3Rv
-dHlwZT17CmdrejpmdW5jdGlvbihhKXt2YXIgdD10aGlzCnJldHVybiBuZXcgSC5hNyh0LHQuZ0EodCks
-SC5MaCh0KS5DKCJhNzxhTC5FPiIpKX0sCmdsMDpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5nQSh0aGlz
-KT09PTB9LApIOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHE9dGhpcyxwPXEuZ0EocSkKaWYoYi5sZW5n
-dGghPT0wKXtpZihwPT09MClyZXR1cm4iIgp0PUguZChxLkUoMCwwKSkKaWYocCE9PXEuZ0EocSkpdGhy
-b3cgSC5iKFAuYTQocSkpCmZvcihzPXQscj0xO3I8cDsrK3Ipe3M9cytiK0guZChxLkUoMCxyKSkKaWYo
-cCE9PXEuZ0EocSkpdGhyb3cgSC5iKFAuYTQocSkpfXJldHVybiBzLmNoYXJDb2RlQXQoMCk9PTA/czpz
-fWVsc2V7Zm9yKHI9MCxzPSIiO3I8cDsrK3Ipe3MrPUguZChxLkUoMCxyKSkKaWYocCE9PXEuZ0EocSkp
-dGhyb3cgSC5iKFAuYTQocSkpfXJldHVybiBzLmNoYXJDb2RlQXQoMCk9PTA/czpzfX0sCmV2OmZ1bmN0
-aW9uKGEsYil7cmV0dXJuIHRoaXMuR0coMCxILkxoKHRoaXMpLkMoImEyKGFMLkUpIikuYihiKSl9LApF
-MjpmdW5jdGlvbihhLGIsYyl7dmFyIHQ9SC5MaCh0aGlzKQpyZXR1cm4gbmV3IEguQTgodGhpcyx0Lktx
-KGMpLkMoIjEoYUwuRSkiKS5iKGIpLHQuQygiQDxhTC5FPiIpLktxKGMpLkMoIkE4PDEsMj4iKSl9LAp0
-dDpmdW5jdGlvbihhLGIpe3ZhciB0LHM9dGhpcyxyPUguVk0oW10sSC5MaChzKS5DKCJqZDxhTC5FPiIp
-KQpDLk5tLnNBKHIscy5nQShzKSkKZm9yKHQ9MDt0PHMuZ0Eocyk7Kyt0KUMuTm0uWShyLHQscy5FKDAs
-dCkpCnJldHVybiByfSwKYnI6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMudHQoYSwhMCl9fQpILm5ILnBy
-b3RvdHlwZT17CmdVRDpmdW5jdGlvbigpe3ZhciB0PUouSG0odGhpcy5hKSxzPXRoaXMuYwppZihzPT1u
-dWxsfHxzPnQpcmV0dXJuIHQKcmV0dXJuIHN9LApnQXM6ZnVuY3Rpb24oKXt2YXIgdD1KLkhtKHRoaXMu
-YSkscz10aGlzLmIKaWYocz50KXJldHVybiB0CnJldHVybiBzfSwKZ0E6ZnVuY3Rpb24oYSl7dmFyIHQs
-cz1KLkhtKHRoaXMuYSkscj10aGlzLmIKaWYocj49cylyZXR1cm4gMAp0PXRoaXMuYwppZih0PT1udWxs
-fHx0Pj1zKXJldHVybiBzLXIKaWYodHlwZW9mIHQhPT0ibnVtYmVyIilyZXR1cm4gdC5ITigpCnJldHVy
-biB0LXJ9LApFOmZ1bmN0aW9uKGEsYil7dmFyIHQscz10aGlzLHI9cy5nQXMoKStiCmlmKGI+PTApe3Q9
-cy5nVUQoKQppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJldHVybiBILnBZKHQpCnQ9cj49dH1lbHNlIHQ9
-ITAKaWYodCl0aHJvdyBILmIoUC5DZihiLHMsImluZGV4IixudWxsLG51bGwpKQpyZXR1cm4gSi5HQShz
-LmEscil9fQpILmE3LnByb3RvdHlwZT17CmdsOmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuZH0sCkY6ZnVu
-Y3Rpb24oKXt2YXIgdCxzPXRoaXMscj1zLmEscT1KLlU2KHIpLHA9cS5nQShyKQppZihzLmIhPT1wKXRo
-cm93IEguYihQLmE0KHIpKQp0PXMuYwppZih0Pj1wKXtzLnNJKG51bGwpCnJldHVybiExfXMuc0kocS5F
-KHIsdCkpOysrcy5jCnJldHVybiEwfSwKc0k6ZnVuY3Rpb24oYSl7dGhpcy5kPXRoaXMuJHRpLmQuYihh
-KX0sCiRpQW46MX0KSC5pMS5wcm90b3R5cGU9ewpna3o6ZnVuY3Rpb24oYSl7dmFyIHQ9SC5MaCh0aGlz
-KQpyZXR1cm4gbmV3IEguTUgoSi5JVCh0aGlzLmEpLHRoaXMuYix0LkMoIkA8MT4iKS5LcSh0LmNoWzFd
-KS5DKCJNSDwxLDI+IikpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIEouSG0odGhpcy5hKX19CkgueHku
-cHJvdG90eXBlPXskaWJROjF9CkguTUgucHJvdG90eXBlPXsKRjpmdW5jdGlvbigpe3ZhciB0PXRoaXMs
-cz10LmIKaWYocy5GKCkpe3Quc0kodC5jLiQxKHMuZ2woKSkpCnJldHVybiEwfXQuc0kobnVsbCkKcmV0
-dXJuITF9LApnbDpmdW5jdGlvbigpe3JldHVybiB0aGlzLmF9LApzSTpmdW5jdGlvbihhKXt0aGlzLmE9
-dGhpcy4kdGkuY2hbMV0uYihhKX19CkguQTgucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJu
-IEouSG0odGhpcy5hKX0sCkU6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhpcy5iLiQxKEouR0EodGhpcy5h
-LGIpKX19CkguVTUucHJvdG90eXBlPXsKZ2t6OmZ1bmN0aW9uKGEpe3JldHVybiBuZXcgSC5TTyhKLklU
-KHRoaXMuYSksdGhpcy5iLHRoaXMuJHRpLkMoIlNPPDE+IikpfX0KSC5TTy5wcm90b3R5cGU9ewpGOmZ1
-bmN0aW9uKCl7dmFyIHQscwpmb3IodD10aGlzLmEscz10aGlzLmI7dC5GKCk7KWlmKEgub1Qocy4kMSh0
-LmdsKCkpKSlyZXR1cm4hMApyZXR1cm4hMX0sCmdsOmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuYS5nbCgp
-fX0KSC5TVS5wcm90b3R5cGU9e30KSC5SZS5wcm90b3R5cGU9ewpZOmZ1bmN0aW9uKGEsYixjKXtILkxo
-KHRoaXMpLkMoIlJlLkUiKS5iKGMpCnRocm93IEguYihQLkw0KCJDYW5ub3QgbW9kaWZ5IGFuIHVubW9k
-aWZpYWJsZSBsaXN0IikpfX0KSC5YQy5wcm90b3R5cGU9e30KSC53di5wcm90b3R5cGU9ewpnaU86ZnVu
-Y3Rpb24oYSl7dmFyIHQ9dGhpcy5faGFzaENvZGUKaWYodCE9bnVsbClyZXR1cm4gdAp0PTUzNjg3MDkx
-MSY2NjQ1OTcqSi5oZih0aGlzLmEpCnRoaXMuX2hhc2hDb2RlPXQKcmV0dXJuIHR9LAp3OmZ1bmN0aW9u
-KGEpe3JldHVybidTeW1ib2woIicrSC5kKHRoaXMuYSkrJyIpJ30sCkROOmZ1bmN0aW9uKGEsYil7aWYo
-Yj09bnVsbClyZXR1cm4hMQpyZXR1cm4gYiBpbnN0YW5jZW9mIEgud3YmJnRoaXMuYT09Yi5hfSwKJGlH
-RDoxfQpILlBELnByb3RvdHlwZT17fQpILldVLnByb3RvdHlwZT17CmdsMDpmdW5jdGlvbihhKXtyZXR1
-cm4gdGhpcy5nQSh0aGlzKT09PTB9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLm5PKHRoaXMpfSwKWTpm
-dW5jdGlvbihhLGIsYyl7dmFyIHQ9SC5MaCh0aGlzKQp0LmQuYihiKQp0LmNoWzFdLmIoYykKcmV0dXJu
-IEguZGMoKX0sCmdQdTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5xNChhLEguTGgodGhpcykuQygiTjM8
-MSwyPiIpKX0sCnE0OmZ1bmN0aW9uKGEsYil7dmFyIHQ9dGhpcwpyZXR1cm4gUC5sMChmdW5jdGlvbigp
-e3ZhciBzPWEKdmFyIHI9MCxxPTEscCxvLG4sbQpyZXR1cm4gZnVuY3Rpb24gJGFzeW5jJGdQdShjLGQp
-e2lmKGM9PT0xKXtwPWQKcj1xfXdoaWxlKHRydWUpc3dpdGNoKHIpe2Nhc2UgMDpvPXQuZ1YoKSxvPW8u
-Z2t6KG8pLG49SC5MaCh0KSxuPW4uQygiQDwxPiIpLktxKG4uY2hbMV0pLkMoIk4zPDEsMj4iKQpjYXNl
-IDI6aWYoIW8uRigpKXtyPTMKYnJlYWt9bT1vLmdsKCkKcj00CnJldHVybiBuZXcgUC5OMyhtLHQucSgw
-LG0pLG4pCmNhc2UgNDpyPTIKYnJlYWsKY2FzZSAzOnJldHVybiBQLlRoKCkKY2FzZSAxOnJldHVybiBQ
-LlltKHApfX19LGIpfSwKJGlaMDoxfQpILkxQLnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVy
-biB0aGlzLmF9LAp4NDpmdW5jdGlvbihhKXtpZih0eXBlb2YgYSE9InN0cmluZyIpcmV0dXJuITEKaWYo
-Il9fcHJvdG9fXyI9PT1hKXJldHVybiExCnJldHVybiB0aGlzLmIuaGFzT3duUHJvcGVydHkoYSl9LApx
-OmZ1bmN0aW9uKGEsYil7aWYoIXRoaXMueDQoYikpcmV0dXJuIG51bGwKcmV0dXJuIHRoaXMuRChiKX0s
-CkQ6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYltILnkoYSldfSwKSzpmdW5jdGlvbihhLGIpe3ZhciB0
-LHMscixxLHA9SC5MaCh0aGlzKQpwLkMoIn4oMSwyKSIpLmIoYikKdD10aGlzLmMKZm9yKHM9dC5sZW5n
-dGgscD1wLmNoWzFdLHI9MDtyPHM7KytyKXtxPXRbcl0KYi4kMihxLHAuYih0aGlzLkQocSkpKX19LApn
-VjpmdW5jdGlvbigpe3JldHVybiBuZXcgSC5YUih0aGlzLEguTGgodGhpcykuQygiWFI8MT4iKSl9fQpI
-LlhSLnByb3RvdHlwZT17CmdrejpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEuYwpyZXR1cm4gbmV3IEou
-bTEodCx0Lmxlbmd0aCxILnQ2KHQpLkMoIm0xPDE+IikpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRo
-aXMuYS5jLmxlbmd0aH19CkguTEkucHJvdG90eXBlPXsKZ1dhOmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcy5h
-CnJldHVybiB0fSwKZ25kOmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscD10aGlzCmlmKHAuYz09PTEpcmV0
-dXJuIEMuaFUKdD1wLmQKcz10Lmxlbmd0aC1wLmUubGVuZ3RoLXAuZgppZihzPT09MClyZXR1cm4gQy5o
-VQpyPVtdCmZvcihxPTA7cTxzOysrcSl7aWYocT49dC5sZW5ndGgpcmV0dXJuIEguT0godCxxKQpyLnB1
-c2godFtxXSl9cmV0dXJuIEouekMocil9LApnVm06ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwLG8sbixt
-LGw9dGhpcwppZihsLmMhPT0wKXJldHVybiBDLkR4CnQ9bC5lCnM9dC5sZW5ndGgKcj1sLmQKcT1yLmxl
-bmd0aC1zLWwuZgppZihzPT09MClyZXR1cm4gQy5EeApwPW5ldyBILk41KHUuZW8pCmZvcihvPTA7bzxz
-Oysrbyl7aWYobz49dC5sZW5ndGgpcmV0dXJuIEguT0godCxvKQpuPXRbb10KbT1xK28KaWYobTwwfHxt
-Pj1yLmxlbmd0aClyZXR1cm4gSC5PSChyLG0pCnAuWSgwLG5ldyBILnd2KG4pLHJbbV0pfXJldHVybiBu
-ZXcgSC5QRChwLHUuZ0YpfSwKJGl2UToxfQpILkNqLnByb3RvdHlwZT17CiQyOmZ1bmN0aW9uKGEsYil7
-dmFyIHQKSC55KGEpCnQ9dGhpcy5hCnQuYj10LmIrIiQiK0guZChhKQpDLk5tLmkodGhpcy5iLGEpCkMu
-Tm0uaSh0aGlzLmMsYik7Kyt0LmF9LAokUzoxMn0KSC5mOS5wcm90b3R5cGU9ewpxUzpmdW5jdGlvbihh
-KXt2YXIgdCxzLHI9dGhpcyxxPW5ldyBSZWdFeHAoci5hKS5leGVjKGEpCmlmKHE9PW51bGwpcmV0dXJu
-IG51bGwKdD1PYmplY3QuY3JlYXRlKG51bGwpCnM9ci5iCmlmKHMhPT0tMSl0LmFyZ3VtZW50cz1xW3Mr
-MV0Kcz1yLmMKaWYocyE9PS0xKXQuYXJndW1lbnRzRXhwcj1xW3MrMV0Kcz1yLmQKaWYocyE9PS0xKXQu
-ZXhwcj1xW3MrMV0Kcz1yLmUKaWYocyE9PS0xKXQubWV0aG9kPXFbcysxXQpzPXIuZgppZihzIT09LTEp
-dC5yZWNlaXZlcj1xW3MrMV0KcmV0dXJuIHR9fQpILlcwLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7
-dmFyIHQ9dGhpcy5iCmlmKHQ9PW51bGwpcmV0dXJuIk5vU3VjaE1ldGhvZEVycm9yOiAiK0guZCh0aGlz
-LmEpCnJldHVybiJOb1N1Y2hNZXRob2RFcnJvcjogbWV0aG9kIG5vdCBmb3VuZDogJyIrdCsiJyBvbiBu
-dWxsIn19CkguYXoucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMscj0iTm9TdWNo
-TWV0aG9kRXJyb3I6IG1ldGhvZCBub3QgZm91bmQ6ICciLHE9cy5iCmlmKHE9PW51bGwpcmV0dXJuIk5v
-U3VjaE1ldGhvZEVycm9yOiAiK0guZChzLmEpCnQ9cy5jCmlmKHQ9PW51bGwpcmV0dXJuIHIrcSsiJyAo
-IitILmQocy5hKSsiKSIKcmV0dXJuIHIrcSsiJyBvbiAnIit0KyInICgiK0guZChzLmEpKyIpIn19Ckgu
-dlYucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEKcmV0dXJuIHQubGVuZ3RoPT09
-MD8iRXJyb3IiOiJFcnJvcjogIit0fX0KSC5icS5wcm90b3R5cGU9e30KSC5BbS5wcm90b3R5cGU9ewok
-MTpmdW5jdGlvbihhKXtpZih1LmJVLmMoYSkpaWYoYS4kdGhyb3duSnNFcnJvcj09bnVsbClhLiR0aHJv
-d25Kc0Vycm9yPXRoaXMuYQpyZXR1cm4gYX0sCiRTOjF9CkguWE8ucHJvdG90eXBlPXsKdzpmdW5jdGlv
-bihhKXt2YXIgdCxzPXRoaXMuYgppZihzIT1udWxsKXJldHVybiBzCnM9dGhpcy5hCnQ9cyE9PW51bGwm
-JnR5cGVvZiBzPT09Im9iamVjdCI/cy5zdGFjazpudWxsCnJldHVybiB0aGlzLmI9dD09bnVsbD8iIjp0
-fSwKJGlHejoxfQpILlRwLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5jb25zdHJ1
-Y3RvcixzPXQ9PW51bGw/bnVsbDp0Lm5hbWUKcmV0dXJuIkNsb3N1cmUgJyIrSC5OUShzPT1udWxsPyJ1
-bmtub3duIjpzKSsiJyJ9LAokaUVIOjEsCmdRbDpmdW5jdGlvbigpe3JldHVybiB0aGlzfSwKJEM6IiQx
-IiwKJFI6MSwKJEQ6bnVsbH0KSC5sYy5wcm90b3R5cGU9e30KSC56eC5wcm90b3R5cGU9ewp3OmZ1bmN0
-aW9uKGEpe3ZhciB0PXRoaXMuJHN0YXRpY19uYW1lCmlmKHQ9PW51bGwpcmV0dXJuIkNsb3N1cmUgb2Yg
-dW5rbm93biBzdGF0aWMgbWV0aG9kIgpyZXR1cm4iQ2xvc3VyZSAnIitILk5RKHQpKyInIn19CkguclQu
-cHJvdG90eXBlPXsKRE46ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzCmlmKGI9PW51bGwpcmV0dXJuITEK
-aWYodD09PWIpcmV0dXJuITAKaWYoIShiIGluc3RhbmNlb2YgSC5yVCkpcmV0dXJuITEKcmV0dXJuIHQu
-YT09PWIuYSYmdC5iPT09Yi5iJiZ0LmM9PT1iLmN9LApnaU86ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlz
-LmMKaWYocz09bnVsbCl0PUguZVEodGhpcy5hKQplbHNlIHQ9dHlwZW9mIHMhPT0ib2JqZWN0Ij9KLmhm
-KHMpOkguZVEocykKcmV0dXJuKHReSC5lUSh0aGlzLmIpKT4+PjB9LAp3OmZ1bmN0aW9uKGEpe3ZhciB0
-PXRoaXMuYwppZih0PT1udWxsKXQ9dGhpcy5hCnJldHVybiJDbG9zdXJlICciK0guZCh0aGlzLmQpKyIn
-IG9mICIrKCJJbnN0YW5jZSBvZiAnIitILmQoSC5NKHQpKSsiJyIpfX0KSC5FcS5wcm90b3R5cGU9ewp3
-OmZ1bmN0aW9uKGEpe3JldHVybiJSdW50aW1lRXJyb3I6ICIrSC5kKHRoaXMuYSl9fQpILmtZLnByb3Rv
-dHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIkFzc2VydGlvbiBmYWlsZWQ6ICIrUC5wKHRoaXMuYSl9
-fQpILk41LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmF9LApnbDA6ZnVuY3Rp
-b24oYSl7cmV0dXJuIHRoaXMuYT09PTB9LApnVjpmdW5jdGlvbigpe3JldHVybiBuZXcgSC5pNSh0aGlz
-LEguTGgodGhpcykuQygiaTU8MT4iKSl9LAp4NDpmdW5jdGlvbihhKXt2YXIgdCxzCmlmKHR5cGVvZiBh
-PT0ic3RyaW5nIil7dD10aGlzLmIKaWYodD09bnVsbClyZXR1cm4hMQpyZXR1cm4gdGhpcy5YdSh0LGEp
-fWVsc2V7cz10aGlzLkNYKGEpCnJldHVybiBzfX0sCkNYOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuZApp
-Zih0PT1udWxsKXJldHVybiExCnJldHVybiB0aGlzLkZoKHRoaXMuQnQodCxKLmhmKGEpJjB4M2ZmZmZm
-ZiksYSk+PTB9LApxOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEscD10aGlzLG89bnVsbAppZih0eXBl
-b2YgYj09InN0cmluZyIpe3Q9cC5iCmlmKHQ9PW51bGwpcmV0dXJuIG8Kcz1wLmoyKHQsYikKcj1zPT1u
-dWxsP286cy5iCnJldHVybiByfWVsc2UgaWYodHlwZW9mIGI9PSJudW1iZXIiJiYoYiYweDNmZmZmZmYp
-PT09Yil7cT1wLmMKaWYocT09bnVsbClyZXR1cm4gbwpzPXAuajIocSxiKQpyPXM9PW51bGw/bzpzLmIK
-cmV0dXJuIHJ9ZWxzZSByZXR1cm4gcC5hYShiKX0sCmFhOmZ1bmN0aW9uKGEpe3ZhciB0LHMscj10aGlz
-LmQKaWYocj09bnVsbClyZXR1cm4gbnVsbAp0PXRoaXMuQnQocixKLmhmKGEpJjB4M2ZmZmZmZikKcz10
-aGlzLkZoKHQsYSkKaWYoczwwKXJldHVybiBudWxsCnJldHVybiB0W3NdLmJ9LApZOmZ1bmN0aW9uKGEs
-YixjKXt2YXIgdCxzLHIscSxwLG8sbj10aGlzLG09SC5MaChuKQptLmQuYihiKQptLmNoWzFdLmIoYykK
-aWYodHlwZW9mIGI9PSJzdHJpbmciKXt0PW4uYgpuLkVIKHQ9PW51bGw/bi5iPW4ueksoKTp0LGIsYyl9
-ZWxzZSBpZih0eXBlb2YgYj09Im51bWJlciImJihiJjB4M2ZmZmZmZik9PT1iKXtzPW4uYwpuLkVIKHM9
-PW51bGw/bi5jPW4ueksoKTpzLGIsYyl9ZWxzZXtyPW4uZAppZihyPT1udWxsKXI9bi5kPW4ueksoKQpx
-PUouaGYoYikmMHgzZmZmZmZmCnA9bi5CdChyLHEpCmlmKHA9PW51bGwpbi5FSShyLHEsW24uSG4oYixj
-KV0pCmVsc2V7bz1uLkZoKHAsYikKaWYobz49MClwW29dLmI9YwplbHNlIHAucHVzaChuLkhuKGIsYykp
-fX19LApLOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyPXRoaXMKSC5MaChyKS5DKCJ+KDEsMikiKS5iKGIp
-CnQ9ci5lCnM9ci5yCmZvcig7dCE9bnVsbDspe2IuJDIodC5hLHQuYikKaWYocyE9PXIucil0aHJvdyBI
-LmIoUC5hNChyKSkKdD10LmN9fSwKRUg6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHM9dGhpcyxyPUguTGgo
-cykKci5kLmIoYikKci5jaFsxXS5iKGMpCnQ9cy5qMihhLGIpCmlmKHQ9PW51bGwpcy5FSShhLGIscy5I
-bihiLGMpKQplbHNlIHQuYj1jfSwKa3M6ZnVuY3Rpb24oKXt0aGlzLnI9dGhpcy5yKzEmNjcxMDg4NjN9
-LApIbjpmdW5jdGlvbihhLGIpe3ZhciB0LHM9dGhpcyxyPUguTGgocykscT1uZXcgSC5kYihyLmQuYihh
-KSxyLmNoWzFdLmIoYikpCmlmKHMuZT09bnVsbClzLmU9cy5mPXEKZWxzZXt0PXMuZgpxLmQ9dApzLmY9
-dC5jPXF9KytzLmEKcy5rcygpCnJldHVybiBxfSwKRmg6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzCmlmKGE9
-PW51bGwpcmV0dXJuLTEKdD1hLmxlbmd0aApmb3Iocz0wO3M8dDsrK3MpaWYoSi5STShhW3NdLmEsYikp
-cmV0dXJuIHMKcmV0dXJuLTF9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLm5PKHRoaXMpfSwKajI6ZnVu
-Y3Rpb24oYSxiKXtyZXR1cm4gYVtiXX0sCkJ0OmZ1bmN0aW9uKGEsYil7cmV0dXJuIGFbYl19LApFSTpm
-dW5jdGlvbihhLGIsYyl7YVtiXT1jfSwKcm46ZnVuY3Rpb24oYSxiKXtkZWxldGUgYVtiXX0sClh1OmZ1
-bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuajIoYSxiKSE9bnVsbH0sCnpLOmZ1bmN0aW9uKCl7dmFyIHQ9
-Ijxub24taWRlbnRpZmllci1rZXk+IixzPU9iamVjdC5jcmVhdGUobnVsbCkKdGhpcy5FSShzLHQscykK
-dGhpcy5ybihzLHQpCnJldHVybiBzfSwKJGlGbzoxfQpILmRiLnByb3RvdHlwZT17fQpILmk1LnByb3Rv
-dHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEuYX0sCmdsMDpmdW5jdGlvbihhKXtyZXR1
-cm4gdGhpcy5hLmE9PT0wfSwKZ2t6OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYSxzPW5ldyBILk42KHQs
-dC5yLHRoaXMuJHRpLkMoIk42PDE+IikpCnMuYz10LmUKcmV0dXJuIHN9LAp0ZzpmdW5jdGlvbihhLGIp
-e3JldHVybiB0aGlzLmEueDQoYil9fQpILk42LnByb3RvdHlwZT17CmdsOmZ1bmN0aW9uKCl7cmV0dXJu
-IHRoaXMuZH0sCkY6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLHM9dC5hCmlmKHQuYiE9PXMucil0aHJvdyBI
-LmIoUC5hNChzKSkKZWxzZXtzPXQuYwppZihzPT1udWxsKXt0LnNxWShudWxsKQpyZXR1cm4hMX1lbHNl
-e3Quc3FZKHMuYSkKdC5jPXQuYy5jCnJldHVybiEwfX19LApzcVk6ZnVuY3Rpb24oYSl7dGhpcy5kPXRo
-aXMuJHRpLmQuYihhKX0sCiRpQW46MX0KSC5kQy5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1
-cm4gdGhpcy5hKGEpfSwKJFM6MX0KSC53Ti5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3JldHVy
-biB0aGlzLmEoYSxiKX0sCiRTOjQ0fQpILlZYLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVy
-biB0aGlzLmEoSC55KGEpKX0sCiRTOjQwfQpILlZSLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0
-dXJuIlJlZ0V4cC8iK3RoaXMuYSsiLyIrdGhpcy5iLmZsYWdzfSwKZ0hjOmZ1bmN0aW9uKCl7dmFyIHQ9
-dGhpcyxzPXQuYwppZihzIT1udWxsKXJldHVybiBzCnM9dC5iCnJldHVybiB0LmM9SC52NCh0LmEscy5t
-dWx0aWxpbmUsIXMuaWdub3JlQ2FzZSxzLnVuaWNvZGUscy5kb3RBbGwsITApfSwKZGQ6ZnVuY3Rpb24o
-YSxiKXtyZXR1cm4gbmV3IEguS1codGhpcyxiLDApfSwKVVo6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzPXRo
-aXMuZ0hjKCkKcy5sYXN0SW5kZXg9Ygp0PXMuZXhlYyhhKQppZih0PT1udWxsKXJldHVybiBudWxsCnJl
-dHVybiBuZXcgSC5FSyh0KX0sCiRpdlg6MSwKJGl3TDoxfQpILkVLLnByb3RvdHlwZT17CnE6ZnVuY3Rp
-b24oYSxiKXt2YXIgdApILlNjKGIpCnQ9dGhpcy5iCmlmKGI+PXQubGVuZ3RoKXJldHVybiBILk9IKHQs
-YikKcmV0dXJuIHRbYl19LAokaU9kOjEsCiRpaWI6MX0KSC5LVy5wcm90b3R5cGU9ewpna3o6ZnVuY3Rp
-b24oYSl7cmV0dXJuIG5ldyBILlBiKHRoaXMuYSx0aGlzLmIsdGhpcy5jKX19CkguUGIucHJvdG90eXBl
-PXsKZ2w6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5kfSwKRjpmdW5jdGlvbigpe3ZhciB0LHMscixxLHA9
-dGhpcyxvPXAuYgppZihvPT1udWxsKXJldHVybiExCnQ9cC5jCmlmKHQ8PW8ubGVuZ3RoKXtzPXAuYQpy
-PXMuVVoobyx0KQppZihyIT1udWxsKXtwLmQ9cgpvPXIuYgp0PW8uaW5kZXgKcT10K29bMF0ubGVuZ3Ro
-CmlmKHQ9PT1xKXtpZihzLmIudW5pY29kZSl7bz1wLmMKdD1vKzEKcz1wLmIKaWYodDxzLmxlbmd0aCl7
-bz1KLnJZKHMpLm0ocyxvKQppZihvPj01NTI5NiYmbzw9NTYzMTkpe289Qy54Qi5tKHMsdCkKbz1vPj01
-NjMyMCYmbzw9NTczNDN9ZWxzZSBvPSExfWVsc2Ugbz0hMX1lbHNlIG89ITEKcT0obz9xKzE6cSkrMX1w
-LmM9cQpyZXR1cm4hMH19cC5iPXAuZD1udWxsCnJldHVybiExfSwKJGlBbjoxfQpILnRRLnByb3RvdHlw
-ZT17CnE6ZnVuY3Rpb24oYSxiKXtILlNjKGIpCmlmKGIhPT0wKUgudmgoUC54KGIsbnVsbCkpCnJldHVy
-biB0aGlzLmN9LAokaU9kOjF9CkgudW4ucHJvdG90eXBlPXsKZ2t6OmZ1bmN0aW9uKGEpe3JldHVybiBu
-ZXcgSC5TZCh0aGlzLmEsdGhpcy5iLHRoaXMuYyl9fQpILlNkLnByb3RvdHlwZT17CkY6ZnVuY3Rpb24o
-KXt2YXIgdCxzLHI9dGhpcyxxPXIuYyxwPXIuYixvPXAubGVuZ3RoLG49ci5hLG09bi5sZW5ndGgKaWYo
-cStvPm0pe3IuZD1udWxsCnJldHVybiExfXQ9bi5pbmRleE9mKHAscSkKaWYodDwwKXtyLmM9bSsxCnIu
-ZD1udWxsCnJldHVybiExfXM9dCtvCnIuZD1uZXcgSC50USh0LHApCnIuYz1zPT09ci5jP3MrMTpzCnJl
-dHVybiEwfSwKZ2w6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5kfSwKJGlBbjoxfQpILkVULnByb3RvdHlw
-ZT17JGlFVDoxLCRpZXE6MX0KSC5MWi5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5s
-ZW5ndGh9LAokaVhqOjF9CkguRGcucHJvdG90eXBlPXsKcTpmdW5jdGlvbihhLGIpe0guU2MoYikKSC5v
-ZChiLGEsYS5sZW5ndGgpCnJldHVybiBhW2JdfSwKWTpmdW5jdGlvbihhLGIsYyl7SC5JZyhjKQpILm9k
-KGIsYSxhLmxlbmd0aCkKYVtiXT1jfSwKJGliUToxLAokaWNYOjEsCiRpek06MX0KSC5QZy5wcm90b3R5
-cGU9ewpZOmZ1bmN0aW9uKGEsYixjKXtILlNjKGMpCkgub2QoYixhLGEubGVuZ3RoKQphW2JdPWN9LAok
-aWJROjEsCiRpY1g6MSwKJGl6TToxfQpILnhqLnByb3RvdHlwZT17CnE6ZnVuY3Rpb24oYSxiKXtILlNj
-KGIpCkgub2QoYixhLGEubGVuZ3RoKQpyZXR1cm4gYVtiXX19CkguZEUucHJvdG90eXBlPXsKcTpmdW5j
-dGlvbihhLGIpe0guU2MoYikKSC5vZChiLGEsYS5sZW5ndGgpCnJldHVybiBhW2JdfX0KSC5aQS5wcm90
-b3R5cGU9ewpxOmZ1bmN0aW9uKGEsYil7SC5TYyhiKQpILm9kKGIsYSxhLmxlbmd0aCkKcmV0dXJuIGFb
-Yl19fQpILndmLnByb3RvdHlwZT17CnE6ZnVuY3Rpb24oYSxiKXtILlNjKGIpCkgub2QoYixhLGEubGVu
-Z3RoKQpyZXR1cm4gYVtiXX19CkguUHEucHJvdG90eXBlPXsKcTpmdW5jdGlvbihhLGIpe0guU2MoYikK
-SC5vZChiLGEsYS5sZW5ndGgpCnJldHVybiBhW2JdfX0KSC5lRS5wcm90b3R5cGU9ewpnQTpmdW5jdGlv
-bihhKXtyZXR1cm4gYS5sZW5ndGh9LApxOmZ1bmN0aW9uKGEsYil7SC5TYyhiKQpILm9kKGIsYSxhLmxl
-bmd0aCkKcmV0dXJuIGFbYl19fQpILlY2LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiBh
-Lmxlbmd0aH0sCnE6ZnVuY3Rpb24oYSxiKXtILlNjKGIpCkgub2QoYixhLGEubGVuZ3RoKQpyZXR1cm4g
-YVtiXX0sCiRpVjY6MSwKJGluNjoxfQpILlJHLnByb3RvdHlwZT17fQpILlZQLnByb3RvdHlwZT17fQpI
-LldCLnByb3RvdHlwZT17fQpILlpHLnByb3RvdHlwZT17fQpILkpjLnByb3RvdHlwZT17CkM6ZnVuY3Rp
-b24oYSl7cmV0dXJuIEguY0Uodi50eXBlVW5pdmVyc2UsdGhpcyxhKX0sCktxOmZ1bmN0aW9uKGEpe3Jl
-dHVybiBILnY1KHYudHlwZVVuaXZlcnNlLHRoaXMsYSl9fQpILkcucHJvdG90eXBlPXt9CkgudTkucHJv
-dG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hfX0KSC5oei5wcm90b3R5cGU9e30KSC5p
-TS5wcm90b3R5cGU9e30KUC50aC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEs
-cz10LmEKdC5hPW51bGwKcy4kMCgpfSwKJFM6MTB9ClAuaGEucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24o
-YSl7dmFyIHQscwp0aGlzLmEuYT11Lk0uYihhKQp0PXRoaXMuYgpzPXRoaXMuYwp0LmZpcnN0Q2hpbGQ/
-dC5yZW1vdmVDaGlsZChzKTp0LmFwcGVuZENoaWxkKHMpfSwKJFM6MjB9ClAuVnMucHJvdG90eXBlPXsK
-JDA6ZnVuY3Rpb24oKXt0aGlzLmEuJDAoKX0sCiRDOiIkMCIsCiRSOjAsCiRTOjB9ClAuRnQucHJvdG90
-eXBlPXsKJDA6ZnVuY3Rpb24oKXt0aGlzLmEuJDAoKX0sCiRDOiIkMCIsCiRSOjAsCiRTOjB9ClAuVzMu
-cHJvdG90eXBlPXsKQ1k6ZnVuY3Rpb24oYSxiKXtpZihzZWxmLnNldFRpbWVvdXQhPW51bGwpc2VsZi5z
-ZXRUaW1lb3V0KEgudFIobmV3IFAueUgodGhpcyxiKSwwKSxhKQplbHNlIHRocm93IEguYihQLkw0KCJg
-c2V0VGltZW91dCgpYCBub3QgZm91bmQuIikpfX0KUC55SC5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigp
-e3RoaXMuYi4kMCgpfSwKJEM6IiQwIiwKJFI6MCwKJFM6Mn0KUC5paC5wcm90b3R5cGU9ewphTTpmdW5j
-dGlvbihhLGIpe3ZhciB0LHMscj10aGlzLiR0aQpyLkMoIjEvIikuYihiKQp0PSF0aGlzLmJ8fHIuQygi
-Yjg8MT4iKS5jKGIpCnM9dGhpcy5hCmlmKHQpcy5YZihiKQplbHNlIHMuWDIoci5kLmIoYikpfSwKdzA6
-ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEKaWYodGhpcy5iKXQuWkwoYSxiKQplbHNlIHQuTmsoYSxi
-KX19ClAuV00ucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS4kMigwLGEpfSwK
-JFM6NDl9ClAuU1gucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt0aGlzLmEuJDIoMSxuZXcgSC5i
-cShhLHUubC5iKGIpKSl9LAokQzoiJDIiLAokUjoyLAokUzoyMX0KUC5Hcy5wcm90b3R5cGU9ewokMjpm
-dW5jdGlvbihhLGIpe3RoaXMuYShILlNjKGEpLGIpfSwKJFM6MjZ9ClAuRnkucHJvdG90eXBlPXsKdzpm
-dW5jdGlvbihhKXtyZXR1cm4iSXRlcmF0aW9uTWFya2VyKCIrdGhpcy5iKyIsICIrSC5kKHRoaXMuYSkr
-IikifX0KUC5HVi5wcm90b3R5cGU9ewpnbDpmdW5jdGlvbigpe3ZhciB0PXRoaXMuYwppZih0PT1udWxs
-KXJldHVybiB0aGlzLmIKcmV0dXJuIHRoaXMuJHRpLmQuYih0LmdsKCkpfSwKRjpmdW5jdGlvbigpe3Zh
-ciB0LHMscixxLHA9dGhpcwpmb3IoOyEwOyl7dD1wLmMKaWYodCE9bnVsbClpZih0LkYoKSlyZXR1cm4h
-MAplbHNlIHAuYz1udWxsCnM9ZnVuY3Rpb24oYSxiLGMpe3ZhciBvLG49Ygp3aGlsZSh0cnVlKXRyeXty
-ZXR1cm4gYShuLG8pfWNhdGNoKG0pe289bQpuPWN9fShwLmEsMCwxKQppZihzIGluc3RhbmNlb2YgUC5G
-eSl7cj1zLmIKaWYocj09PTIpe3Q9cC5kCmlmKHQ9PW51bGx8fHQubGVuZ3RoPT09MCl7cC5zRUMobnVs
-bCkKcmV0dXJuITF9aWYoMD49dC5sZW5ndGgpcmV0dXJuIEguT0godCwtMSkKcC5hPXQucG9wKCkKY29u
-dGludWV9ZWxzZXt0PXMuYQppZihyPT09Myl0aHJvdyB0CmVsc2V7cT1KLklUKHQpCmlmKHEgaW5zdGFu
-Y2VvZiBQLkdWKXt0PXAuZAppZih0PT1udWxsKXQ9cC5kPVtdCkMuTm0uaSh0LHAuYSkKcC5hPXEuYQpj
-b250aW51ZX1lbHNle3AuYz1xCmNvbnRpbnVlfX19fWVsc2V7cC5zRUMocykKcmV0dXJuITB9fXJldHVy
-biExfSwKc0VDOmZ1bmN0aW9uKGEpe3RoaXMuYj10aGlzLiR0aS5kLmIoYSl9LAokaUFuOjF9ClAucTQu
-cHJvdG90eXBlPXsKZ2t6OmZ1bmN0aW9uKGEpe3JldHVybiBuZXcgUC5HVih0aGlzLmEoKSx0aGlzLiR0
-aS5DKCJHVjwxPiIpKX19ClAuYjgucHJvdG90eXBlPXt9ClAuUGYucHJvdG90eXBlPXsKdzA6ZnVuY3Rp
-b24oYSxiKXt2YXIgdAppZihhPT1udWxsKWE9bmV3IFAubigpCnQ9dGhpcy5hCmlmKHQuYSE9PTApdGhy
-b3cgSC5iKFAuUFYoIkZ1dHVyZSBhbHJlYWR5IGNvbXBsZXRlZCIpKQp0Lk5rKGEsYil9LApwbTpmdW5j
-dGlvbihhKXtyZXR1cm4gdGhpcy53MChhLG51bGwpfX0KUC5aZi5wcm90b3R5cGU9ewphTTpmdW5jdGlv
-bihhLGIpe3ZhciB0CnRoaXMuJHRpLkMoIjEvIikuYihiKQp0PXRoaXMuYQppZih0LmEhPT0wKXRocm93
-IEguYihQLlBWKCJGdXR1cmUgYWxyZWFkeSBjb21wbGV0ZWQiKSkKdC5YZihiKX19ClAuRmUucHJvdG90
-eXBlPXsKSFI6ZnVuY3Rpb24oYSl7aWYoKHRoaXMuYyYxNSkhPT02KXJldHVybiEwCnJldHVybiB0aGlz
-LmIuYi5idih1LmFsLmIodGhpcy5kKSxhLmEsdS5jSix1LkspfSwKS3c6ZnVuY3Rpb24oYSl7dmFyIHQ9
-dGhpcy5lLHM9dS56LHI9dS5LLHE9dGhpcy4kdGkuQygiMi8iKSxwPXRoaXMuYi5iCmlmKHUuRS5jKHQp
-KXJldHVybiBxLmIocC5ycCh0LGEuYSxhLmIscyxyLHUubCkpCmVsc2UgcmV0dXJuIHEuYihwLmJ2KHUu
-dy5iKHQpLGEuYSxzLHIpKX19ClAudnMucHJvdG90eXBlPXsKU3E6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0
-LHMscixxPXRoaXMuJHRpCnEuS3EoYykuQygiMS8oMikiKS5iKGEpCnQ9JC5YMwppZih0IT09Qy5OVSl7
-Yy5DKCJAPDAvPiIpLktxKHEuZCkuQygiMSgyKSIpLmIoYSkKaWYoYiE9bnVsbCliPVAuVkgoYix0KX1z
-PW5ldyBQLnZzKCQuWDMsYy5DKCJ2czwwPiIpKQpyPWI9PW51bGw/MTozCnRoaXMueGYobmV3IFAuRmUo
-cyxyLGEsYixxLkMoIkA8MT4iKS5LcShjKS5DKCJGZTwxLDI+IikpKQpyZXR1cm4gc30sClc3OmZ1bmN0
-aW9uKGEsYil7cmV0dXJuIHRoaXMuU3EoYSxudWxsLGIpfSwKUWQ6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0
-LHM9dGhpcy4kdGkKcy5LcShjKS5DKCIxLygyKSIpLmIoYSkKdD1uZXcgUC52cygkLlgzLGMuQygidnM8
-MD4iKSkKdGhpcy54ZihuZXcgUC5GZSh0LChiPT1udWxsPzE6Myl8MTYsYSxiLHMuQygiQDwxPiIpLktx
-KGMpLkMoIkZlPDEsMj4iKSkpCnJldHVybiB0fSwKeGY6ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlzLHI9
-cy5hCmlmKHI8PTEpe2EuYT11LnguYihzLmMpCnMuYz1hfWVsc2V7aWYocj09PTIpe3Q9dS5fLmIocy5j
-KQpyPXQuYQppZihyPDQpe3QueGYoYSkKcmV0dXJufXMuYT1yCnMuYz10LmN9UC5UayhudWxsLG51bGws
-cy5iLHUuTS5iKG5ldyBQLmRhKHMsYSkpKX19LApqUTpmdW5jdGlvbihhKXt2YXIgdCxzLHIscSxwLG89
-dGhpcyxuPXt9Cm4uYT1hCmlmKGE9PW51bGwpcmV0dXJuCnQ9by5hCmlmKHQ8PTEpe3M9dS54LmIoby5j
-KQpyPW8uYz1hCmlmKHMhPW51bGwpe2Zvcig7cT1yLmEscSE9bnVsbDtyPXEpO3IuYT1zfX1lbHNle2lm
-KHQ9PT0yKXtwPXUuXy5iKG8uYykKdD1wLmEKaWYodDw0KXtwLmpRKGEpCnJldHVybn1vLmE9dApvLmM9
-cC5jfW4uYT1vLk44KGEpClAuVGsobnVsbCxudWxsLG8uYix1Lk0uYihuZXcgUC5vUShuLG8pKSl9fSwK
-YWg6ZnVuY3Rpb24oKXt2YXIgdD11LnguYih0aGlzLmMpCnRoaXMuYz1udWxsCnJldHVybiB0aGlzLk44
-KHQpfSwKTjg6ZnVuY3Rpb24oYSl7dmFyIHQscyxyCmZvcih0PWEscz1udWxsO3QhPW51bGw7cz10LHQ9
-cil7cj10LmEKdC5hPXN9cmV0dXJuIHN9LApISDpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMscj1zLiR0
-aQpyLkMoIjEvIikuYihhKQppZihyLkMoImI4PDE+IikuYyhhKSlpZihyLmMoYSkpUC5BOShhLHMpCmVs
-c2UgUC5rMyhhLHMpCmVsc2V7dD1zLmFoKCkKci5kLmIoYSkKcy5hPTQKcy5jPWEKUC5IWihzLHQpfX0s
-ClgyOmZ1bmN0aW9uKGEpe3ZhciB0LHM9dGhpcwpzLiR0aS5kLmIoYSkKdD1zLmFoKCkKcy5hPTQKcy5j
-PWEKUC5IWihzLHQpfSwKWkw6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzPXRoaXMKdS5sLmIoYikKdD1zLmFo
-KCkKcy5hPTgKcy5jPW5ldyBQLkN3KGEsYikKUC5IWihzLHQpfSwKWGY6ZnVuY3Rpb24oYSl7dmFyIHQ9
-dGhpcyxzPXQuJHRpCnMuQygiMS8iKS5iKGEpCmlmKHMuQygiYjg8MT4iKS5jKGEpKXt0LmNVKGEpCnJl
-dHVybn10LmE9MQpQLlRrKG51bGwsbnVsbCx0LmIsdS5NLmIobmV3IFAuckgodCxhKSkpfSwKY1U6ZnVu
-Y3Rpb24oYSl7dmFyIHQ9dGhpcyxzPXQuJHRpCnMuQygiYjg8MT4iKS5iKGEpCmlmKHMuYyhhKSl7aWYo
-YS5hPT09OCl7dC5hPTEKUC5UayhudWxsLG51bGwsdC5iLHUuTS5iKG5ldyBQLktGKHQsYSkpKX1lbHNl
-IFAuQTkoYSx0KQpyZXR1cm59UC5rMyhhLHQpfSwKTms6ZnVuY3Rpb24oYSxiKXt0aGlzLmE9MQpQLlRr
-KG51bGwsbnVsbCx0aGlzLmIsdS5NLmIobmV3IFAuWkwodGhpcyxhLGIpKSl9LAokaWI4OjF9ClAuZGEu
-cHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXtQLkhaKHRoaXMuYSx0aGlzLmIpfSwKJFM6MH0KUC5vUS5w
-cm90b3R5cGU9ewokMDpmdW5jdGlvbigpe1AuSFoodGhpcy5iLHRoaXMuYS5hKX0sCiRTOjB9ClAucFYu
-cHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnQuYT0wCnQuSEgoYSl9LAokUzox
-MH0KUC5VNy5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3UubC5iKGIpCnRoaXMuYS5aTChhLGIp
-fSwKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuJDIoYSxudWxsKX0sCiRDOiIkMiIsCiREOmZ1bmN0
-aW9uKCl7cmV0dXJuW251bGxdfSwKJFM6Mjl9ClAudnIucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXt0
-aGlzLmEuWkwodGhpcy5iLHRoaXMuYyl9LAokUzowfQpQLnJILnByb3RvdHlwZT17CiQwOmZ1bmN0aW9u
-KCl7dmFyIHQ9dGhpcy5hCnQuWDIodC4kdGkuZC5iKHRoaXMuYikpfSwKJFM6MH0KUC5LRi5wcm90b3R5
-cGU9ewokMDpmdW5jdGlvbigpe1AuQTkodGhpcy5iLHRoaXMuYSl9LAokUzowfQpQLlpMLnByb3RvdHlw
-ZT17CiQwOmZ1bmN0aW9uKCl7dGhpcy5hLlpMKHRoaXMuYix0aGlzLmMpfSwKJFM6MH0KUC5SVC5wcm90
-b3R5cGU9ewokMDpmdW5jdGlvbigpe3ZhciB0LHMscixxLHAsbyxuPXRoaXMsbT1udWxsCnRyeXtyPW4u
-YwptPXIuYi5iLnp6KHUuZk8uYihyLmQpLHUueil9Y2F0Y2gocSl7dD1ILlJ1KHEpCnM9SC50cyhxKQpp
-ZihuLmQpe3I9dS5uLmIobi5hLmEuYykuYQpwPXQKcD1yPT1udWxsP3A9PW51bGw6cj09PXAKcj1wfWVs
-c2Ugcj0hMQpwPW4uYgppZihyKXAuYj11Lm4uYihuLmEuYS5jKQplbHNlIHAuYj1uZXcgUC5Ddyh0LHMp
-CnAuYT0hMApyZXR1cm59aWYodS5jLmMobSkpe2lmKG0gaW5zdGFuY2VvZiBQLnZzJiZtLmE+PTQpe2lm
-KG0uYT09PTgpe3I9bi5iCnIuYj11Lm4uYihtLmMpCnIuYT0hMH1yZXR1cm59bz1uLmEuYQpyPW4uYgpy
-LmI9bS5XNyhuZXcgUC5qWihvKSx1LnopCnIuYT0hMX19LAokUzoyfQpQLmpaLnByb3RvdHlwZT17CiQx
-OmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmF9LAokUzozOX0KUC5ycS5wcm90b3R5cGU9ewokMDpmdW5j
-dGlvbigpe3ZhciB0LHMscixxLHAsbyxuLG09dGhpcwp0cnl7cj1tLmIKcT1yLiR0aQpwPXEuZApvPXAu
-YihtLmMpCm0uYS5iPXIuYi5iLmJ2KHEuQygiMi8oMSkiKS5iKHIuZCksbyxxLkMoIjIvIikscCl9Y2F0
-Y2gobil7dD1ILlJ1KG4pCnM9SC50cyhuKQpyPW0uYQpyLmI9bmV3IFAuQ3codCxzKQpyLmE9ITB9fSwK
-JFM6Mn0KUC5SVy5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe3ZhciB0LHMscixxLHAsbyxuLG0sbD10
-aGlzCnRyeXt0PXUubi5iKGwuYS5hLmMpCnE9bC5jCmlmKEgub1QocS5IUih0KSkmJnEuZSE9bnVsbCl7
-cD1sLmIKcC5iPXEuS3codCkKcC5hPSExfX1jYXRjaChvKXtzPUguUnUobykKcj1ILnRzKG8pCnE9dS5u
-LmIobC5hLmEuYykKcD1xLmEKbj1zCm09bC5iCmlmKHA9PW51bGw/bj09bnVsbDpwPT09biltLmI9cQpl
-bHNlIG0uYj1uZXcgUC5DdyhzLHIpCm0uYT0hMH19LAokUzoyfQpQLk9NLnByb3RvdHlwZT17fQpQLnFo
-LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3ZhciB0LHMscj10aGlzLHE9e30scD1uZXcgUC52cygk
-LlgzLHUuZkopCnEuYT0wCnQ9SC5MaChyKQpzPXQuQygifigxKSIpLmIobmV3IFAuQjUocSxyKSkKdS5N
-LmIobmV3IFAudU8ocSxwKSkKVy5KRShyLmEsci5iLHMsITEsdC5kKQpyZXR1cm4gcH19ClAuQjUucHJv
-dG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7SC5MaCh0aGlzLmIpLmQuYihhKTsrK3RoaXMuYS5hfSwKJFM6
-ZnVuY3Rpb24oKXtyZXR1cm4gSC5MaCh0aGlzLmIpLkMoImM4KDEpIil9fQpQLnVPLnByb3RvdHlwZT17
-CiQwOmZ1bmN0aW9uKCl7dGhpcy5iLkhIKHRoaXMuYS5hKX0sCiRTOjB9ClAuTU8ucHJvdG90eXBlPXt9
-ClAua1QucHJvdG90eXBlPXt9ClAueEkucHJvdG90eXBlPXt9ClAuQ3cucHJvdG90eXBlPXsKdzpmdW5j
-dGlvbihhKXtyZXR1cm4gSC5kKHRoaXMuYSl9LAokaVhTOjF9ClAubTAucHJvdG90eXBlPXskaUpCOjF9
-ClAucEsucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXt2YXIgdCxzPXRoaXMuYSxyPXMuYQpzPXI9PW51
-bGw/cy5hPW5ldyBQLm4oKTpyCnI9dGhpcy5iCmlmKHI9PW51bGwpdGhyb3cgSC5iKHMpCnQ9SC5iKHMp
-CnQuc3RhY2s9ci53KDApCnRocm93IHR9LAokUzowfQpQLkppLnByb3RvdHlwZT17CmJIOmZ1bmN0aW9u
-KGEpe3ZhciB0LHMscixxPW51bGwKdS5NLmIoYSkKdHJ5e2lmKEMuTlU9PT0kLlgzKXthLiQwKCkKcmV0
-dXJufVAuVDgocSxxLHRoaXMsYSx1LkgpfWNhdGNoKHIpe3Q9SC5SdShyKQpzPUgudHMocikKUC5MMihx
-LHEsdGhpcyx0LHUubC5iKHMpKX19LApEbDpmdW5jdGlvbihhLGIsYyl7dmFyIHQscyxyLHE9bnVsbApj
-LkMoIn4oMCkiKS5iKGEpCmMuYihiKQp0cnl7aWYoQy5OVT09PSQuWDMpe2EuJDEoYikKcmV0dXJufVAu
-eXYocSxxLHRoaXMsYSxiLHUuSCxjKX1jYXRjaChyKXt0PUguUnUocikKcz1ILnRzKHIpClAuTDIocSxx
-LHRoaXMsdCx1LmwuYihzKSl9fSwKUlQ6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gbmV3IFAuaGoodGhpcyxi
-LkMoIjAoKSIpLmIoYSksYil9LApHWTpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFAuVnAodGhpcyx1Lk0u
-YihhKSl9LApQeTpmdW5jdGlvbihhLGIpe3JldHVybiBuZXcgUC5PUih0aGlzLGIuQygifigwKSIpLmIo
-YSksYil9LApxOmZ1bmN0aW9uKGEsYil7cmV0dXJuIG51bGx9LAp6ejpmdW5jdGlvbihhLGIpe2IuQygi
-MCgpIikuYihhKQppZigkLlgzPT09Qy5OVSlyZXR1cm4gYS4kMCgpCnJldHVybiBQLlQ4KG51bGwsbnVs
-bCx0aGlzLGEsYil9LApidjpmdW5jdGlvbihhLGIsYyxkKXtjLkMoIkA8MD4iKS5LcShkKS5DKCIxKDIp
-IikuYihhKQpkLmIoYikKaWYoJC5YMz09PUMuTlUpcmV0dXJuIGEuJDEoYikKcmV0dXJuIFAueXYobnVs
-bCxudWxsLHRoaXMsYSxiLGMsZCl9LApycDpmdW5jdGlvbihhLGIsYyxkLGUsZil7ZC5DKCJAPDA+Iiku
-S3EoZSkuS3EoZikuQygiMSgyLDMpIikuYihhKQplLmIoYikKZi5iKGMpCmlmKCQuWDM9PT1DLk5VKXJl
-dHVybiBhLiQyKGIsYykKcmV0dXJuIFAuUXgobnVsbCxudWxsLHRoaXMsYSxiLGMsZCxlLGYpfSwKTGo6
-ZnVuY3Rpb24oYSxiLGMsZCl7cmV0dXJuIGIuQygiQDwwPiIpLktxKGMpLktxKGQpLkMoIjEoMiwzKSIp
-LmIoYSl9fQpQLmhqLnByb3RvdHlwZT17CiQwOmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuYS56eih0aGlz
-LmIsdGhpcy5jKX0sCiRTOmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuYy5DKCIwKCkiKX19ClAuVnAucHJv
-dG90eXBlPXsKJDA6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5hLmJIKHRoaXMuYil9LAokUzoyfQpQLk9S
-LnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYwpyZXR1cm4gdGhpcy5hLkRsKHRo
-aXMuYix0LmIoYSksdCl9LAokUzpmdW5jdGlvbigpe3JldHVybiB0aGlzLmMuQygifigwKSIpfX0KUC5i
-Ni5wcm90b3R5cGU9ewpna3o6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcyxzPW5ldyBQLmxtKHQsdC5yLEgu
-TGgodCkuQygibG08MT4iKSkKcy5jPXQuZQpyZXR1cm4gc30sCmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0
-aGlzLmF9LAp0ZzpmdW5jdGlvbihhLGIpe3ZhciB0LHMKaWYodHlwZW9mIGI9PSJzdHJpbmciJiZiIT09
-Il9fcHJvdG9fXyIpe3Q9dGhpcy5iCmlmKHQ9PW51bGwpcmV0dXJuITEKcmV0dXJuIHUueS5iKHRbYl0p
-IT1udWxsfWVsc2V7cz10aGlzLlBSKGIpCnJldHVybiBzfX0sClBSOmZ1bmN0aW9uKGEpe3ZhciB0PXRo
-aXMuZAppZih0PT1udWxsKXJldHVybiExCnJldHVybiB0aGlzLkRGKHRbdGhpcy5OKGEpXSxhKT49MH0s
-Cmk6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHI9dGhpcwpILkxoKHIpLmQuYihiKQppZih0eXBlb2YgYj09
-InN0cmluZyImJmIhPT0iX19wcm90b19fIil7dD1yLmIKcmV0dXJuIHIuYlEodD09bnVsbD9yLmI9UC5U
-MigpOnQsYil9ZWxzZSBpZih0eXBlb2YgYj09Im51bWJlciImJihiJjEwNzM3NDE4MjMpPT09Yil7cz1y
-LmMKcmV0dXJuIHIuYlEocz09bnVsbD9yLmM9UC5UMigpOnMsYil9ZWxzZSByZXR1cm4gci5CNyhiKX0s
-CkI3OmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxPXRoaXMKSC5MaChxKS5kLmIoYSkKdD1xLmQKaWYodD09
-bnVsbCl0PXEuZD1QLlQyKCkKcz1xLk4oYSkKcj10W3NdCmlmKHI9PW51bGwpdFtzXT1bcS55byhhKV0K
-ZWxzZXtpZihxLkRGKHIsYSk+PTApcmV0dXJuITEKci5wdXNoKHEueW8oYSkpfXJldHVybiEwfSwKUjpm
-dW5jdGlvbihhLGIpe3ZhciB0PXRoaXMKaWYodHlwZW9mIGI9PSJzdHJpbmciJiZiIT09Il9fcHJvdG9f
-XyIpcmV0dXJuIHQuTCh0LmIsYikKZWxzZSBpZih0eXBlb2YgYj09Im51bWJlciImJihiJjEwNzM3NDE4
-MjMpPT09YilyZXR1cm4gdC5MKHQuYyxiKQplbHNlIHJldHVybiB0LnFnKGIpfSwKcWc6ZnVuY3Rpb24o
-YSl7dmFyIHQscyxyLHEscD10aGlzLG89cC5kCmlmKG89PW51bGwpcmV0dXJuITEKdD1wLk4oYSkKcz1v
-W3RdCnI9cC5ERihzLGEpCmlmKHI8MClyZXR1cm4hMQpxPXMuc3BsaWNlKHIsMSlbMF0KaWYoMD09PXMu
-bGVuZ3RoKWRlbGV0ZSBvW3RdCnAuR1MocSkKcmV0dXJuITB9LApiUTpmdW5jdGlvbihhLGIpe0guTGgo
-dGhpcykuZC5iKGIpCmlmKHUueS5iKGFbYl0pIT1udWxsKXJldHVybiExCmFbYl09dGhpcy55byhiKQpy
-ZXR1cm4hMH0sCkw6ZnVuY3Rpb24oYSxiKXt2YXIgdAppZihhPT1udWxsKXJldHVybiExCnQ9dS55LmIo
-YVtiXSkKaWYodD09bnVsbClyZXR1cm4hMQp0aGlzLkdTKHQpCmRlbGV0ZSBhW2JdCnJldHVybiEwfSwK
-UzpmdW5jdGlvbigpe3RoaXMucj0xMDczNzQxODIzJnRoaXMucisxfSwKeW86ZnVuY3Rpb24oYSl7dmFy
-IHQscz10aGlzLHI9bmV3IFAuYm4oSC5MaChzKS5kLmIoYSkpCmlmKHMuZT09bnVsbClzLmU9cy5mPXIK
-ZWxzZXt0PXMuZgpyLmM9dApzLmY9dC5iPXJ9KytzLmEKcy5TKCkKcmV0dXJuIHJ9LApHUzpmdW5jdGlv
-bihhKXt2YXIgdD10aGlzLHM9YS5jLHI9YS5iCmlmKHM9PW51bGwpdC5lPXIKZWxzZSBzLmI9cgppZihy
-PT1udWxsKXQuZj1zCmVsc2Ugci5jPXM7LS10LmEKdC5TKCl9LApOOmZ1bmN0aW9uKGEpe3JldHVybiBK
-LmhmKGEpJjEwNzM3NDE4MjN9LApERjpmdW5jdGlvbihhLGIpe3ZhciB0LHMKaWYoYT09bnVsbClyZXR1
-cm4tMQp0PWEubGVuZ3RoCmZvcihzPTA7czx0OysrcylpZihKLlJNKGFbc10uYSxiKSlyZXR1cm4gcwpy
-ZXR1cm4tMX19ClAuYm4ucHJvdG90eXBlPXt9ClAubG0ucHJvdG90eXBlPXsKZ2w6ZnVuY3Rpb24oKXty
-ZXR1cm4gdGhpcy5kfSwKRjpmdW5jdGlvbigpe3ZhciB0PXRoaXMscz10LmEKaWYodC5iIT09cy5yKXRo
-cm93IEguYihQLmE0KHMpKQplbHNle3M9dC5jCmlmKHM9PW51bGwpe3Quc2oobnVsbCkKcmV0dXJuITF9
-ZWxzZXt0LnNqKHQuJHRpLmQuYihzLmEpKQp0LmM9dC5jLmIKcmV0dXJuITB9fX0sCnNqOmZ1bmN0aW9u
-KGEpe3RoaXMuZD10aGlzLiR0aS5kLmIoYSl9LAokaUFuOjF9ClAubVcucHJvdG90eXBlPXt9ClAudXku
-cHJvdG90eXBlPXskaWJROjEsJGljWDoxLCRpek06MX0KUC5sRC5wcm90b3R5cGU9ewpna3o6ZnVuY3Rp
-b24oYSl7cmV0dXJuIG5ldyBILmE3KGEsdGhpcy5nQShhKSxILnpLKGEpLkMoImE3PGxELkU+IikpfSwK
-RTpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLnEoYSxiKX0sCks6ZnVuY3Rpb24oYSxiKXt2YXIgdCxz
-CkgueksoYSkuQygifihsRC5FKSIpLmIoYikKdD10aGlzLmdBKGEpCmZvcihzPTA7czx0Oysrcyl7Yi4k
-MSh0aGlzLnEoYSxzKSkKaWYodCE9PXRoaXMuZ0EoYSkpdGhyb3cgSC5iKFAuYTQoYSkpfX0sCmdvcjpm
-dW5jdGlvbihhKXtyZXR1cm4gdGhpcy5nQShhKSE9PTB9LApFMjpmdW5jdGlvbihhLGIsYyl7dmFyIHQ9
-SC56SyhhKQpyZXR1cm4gbmV3IEguQTgoYSx0LktxKGMpLkMoIjEobEQuRSkiKS5iKGIpLHQuQygiQDxs
-RC5FPiIpLktxKGMpLkMoIkE4PDEsMj4iKSl9LApkdTpmdW5jdGlvbihhLGIsYyxkKXt2YXIgdApILnpL
-KGEpLkMoImxELkUiKS5iKGQpClAuakIoYixjLHRoaXMuZ0EoYSkpCmZvcih0PWI7dDxjOysrdCl0aGlz
-LlkoYSx0LGQpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gUC5XRShhLCJbIiwiXSIpfX0KUC5pbC5wcm90
-b3R5cGU9e30KUC5yYS5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3ZhciB0LHM9dGhpcy5hCmlm
-KCFzLmEpdGhpcy5iLmErPSIsICIKcy5hPSExCnM9dGhpcy5iCnQ9cy5hKz1ILmQoYSkKcy5hPXQrIjog
-IgpzLmErPUguZChiKX0sCiRTOjR9ClAuWWsucHJvdG90eXBlPXsKSzpmdW5jdGlvbihhLGIpe3ZhciB0
-LHMKSC5MaCh0aGlzKS5DKCJ+KFlrLkssWWsuVikiKS5iKGIpCmZvcih0PUouSVQodGhpcy5nVigpKTt0
-LkYoKTspe3M9dC5nbCgpCmIuJDIocyx0aGlzLnEoMCxzKSl9fSwKZ1B1OmZ1bmN0aW9uKGEpe3JldHVy
-biBKLk0xKHRoaXMuZ1YoKSxuZXcgUC55USh0aGlzKSxILkxoKHRoaXMpLkMoIk4zPFlrLkssWWsuVj4i
-KSl9LAp4NDpmdW5jdGlvbihhKXtyZXR1cm4gSi56bCh0aGlzLmdWKCksYSl9LApnQTpmdW5jdGlvbihh
-KXtyZXR1cm4gSi5IbSh0aGlzLmdWKCkpfSwKZ2wwOmZ1bmN0aW9uKGEpe3JldHVybiBKLnVVKHRoaXMu
-Z1YoKSl9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLm5PKHRoaXMpfSwKJGlaMDoxfQpQLnlRLnByb3Rv
-dHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYSxzPUguTGgodCkKcy5DKCJZay5LIikuYihh
-KQpyZXR1cm4gbmV3IFAuTjMoYSx0LnEoMCxhKSxzLkMoIkA8WWsuSz4iKS5LcShzLkMoIllrLlYiKSku
-QygiTjM8MSwyPiIpKX0sCiRTOmZ1bmN0aW9uKCl7cmV0dXJuIEguTGgodGhpcy5hKS5DKCJOMzxZay5L
-LFlrLlY+KFlrLkspIil9fQpQLktQLnByb3RvdHlwZT17Clk6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0PUgu
-TGgodGhpcykKdC5kLmIoYikKdC5jaFsxXS5iKGMpCnRocm93IEguYihQLkw0KCJDYW5ub3QgbW9kaWZ5
-IHVubW9kaWZpYWJsZSBtYXAiKSl9fQpQLlBuLnByb3RvdHlwZT17CnE6ZnVuY3Rpb24oYSxiKXtyZXR1
-cm4gdGhpcy5hLnEoMCxiKX0sClk6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0PUguTGgodGhpcykKdGhpcy5h
-LlkoMCx0LmQuYihiKSx0LmNoWzFdLmIoYykpfSwKeDQ6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS54
-NChhKX0sCks6ZnVuY3Rpb24oYSxiKXt0aGlzLmEuSygwLEguTGgodGhpcykuQygifigxLDIpIikuYihi
-KSl9LApnbDA6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0LmdsMCh0KX0sCmdBOmZ1bmN0
-aW9uKGEpe3ZhciB0PXRoaXMuYQpyZXR1cm4gdC5nQSh0KX0sCnc6ZnVuY3Rpb24oYSl7cmV0dXJuIEou
-aih0aGlzLmEpfSwKZ1B1OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYQpyZXR1cm4gdC5nUHUodCl9LAok
-aVowOjF9ClAuR2oucHJvdG90eXBlPXt9ClAubGYucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1
-cm4gUC5XRSh0aGlzLCJ7IiwifSIpfX0KUC5Wai5wcm90b3R5cGU9eyRpYlE6MSwkaWNYOjEsJGl4dTox
-fQpQLlh2LnByb3RvdHlwZT17CkZWOmZ1bmN0aW9uKGEsYil7dmFyIHQKZm9yKHQ9Si5JVChILkxoKHRo
-aXMpLkMoImNYPDE+IikuYihiKSk7dC5GKCk7KXRoaXMuaSgwLHQuZ2woKSl9LAp3OmZ1bmN0aW9uKGEp
-e3JldHVybiBQLldFKHRoaXMsInsiLCJ9Iil9LApIOmZ1bmN0aW9uKGEsYil7dmFyIHQscz1QLnJqKHRo
-aXMsdGhpcy5yLEguTGgodGhpcykuZCkKaWYoIXMuRigpKXJldHVybiIiCmlmKGI9PT0iIil7dD0iIgpk
-byB0Kz1ILmQocy5kKQp3aGlsZShzLkYoKSl9ZWxzZXt0PUguZChzLmQpCmZvcig7cy5GKCk7KXQ9dCti
-K0guZChzLmQpfXJldHVybiB0LmNoYXJDb2RlQXQoMCk9PTA/dDp0fSwKJGliUToxLAokaWNYOjEsCiRp
-eHU6MX0KUC5uWS5wcm90b3R5cGU9e30KUC5UQy5wcm90b3R5cGU9e30KUC5SVS5wcm90b3R5cGU9e30K
-UC51dy5wcm90b3R5cGU9ewpxOmZ1bmN0aW9uKGEsYil7dmFyIHQscz10aGlzLmIKaWYocz09bnVsbCly
-ZXR1cm4gdGhpcy5jLnEoMCxiKQplbHNlIGlmKHR5cGVvZiBiIT0ic3RyaW5nIilyZXR1cm4gbnVsbApl
-bHNle3Q9c1tiXQpyZXR1cm4gdHlwZW9mIHQ9PSJ1bmRlZmluZWQiP3RoaXMuZmIoYik6dH19LApnQTpm
-dW5jdGlvbihhKXtyZXR1cm4gdGhpcy5iPT1udWxsP3RoaXMuYy5hOnRoaXMuQ2YoKS5sZW5ndGh9LApn
-bDA6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuZ0EodGhpcyk9PT0wfSwKZ1Y6ZnVuY3Rpb24oKXtpZih0
-aGlzLmI9PW51bGwpe3ZhciB0PXRoaXMuYwpyZXR1cm4gbmV3IEguaTUodCxILkxoKHQpLkMoImk1PDE+
-IikpfXJldHVybiBuZXcgUC5pOCh0aGlzKX0sClk6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMscj10aGlz
-CmlmKHIuYj09bnVsbClyLmMuWSgwLGIsYykKZWxzZSBpZihyLng0KGIpKXt0PXIuYgp0W2JdPWMKcz1y
-LmEKaWYocz09bnVsbD90IT1udWxsOnMhPT10KXNbYl09bnVsbH1lbHNlIHIuWEsoKS5ZKDAsYixjKX0s
-Cng0OmZ1bmN0aW9uKGEpe2lmKHRoaXMuYj09bnVsbClyZXR1cm4gdGhpcy5jLng0KGEpCnJldHVybiBP
-YmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGhpcy5hLGEpfSwKSzpmdW5jdGlvbihh
-LGIpe3ZhciB0LHMscixxLHA9dGhpcwp1LmNBLmIoYikKaWYocC5iPT1udWxsKXJldHVybiBwLmMuSygw
-LGIpCnQ9cC5DZigpCmZvcihzPTA7czx0Lmxlbmd0aDsrK3Mpe3I9dFtzXQpxPXAuYltyXQppZih0eXBl
-b2YgcT09InVuZGVmaW5lZCIpe3E9UC5RZShwLmFbcl0pCnAuYltyXT1xfWIuJDIocixxKQppZih0IT09
-cC5jKXRocm93IEguYihQLmE0KHApKX19LApDZjpmdW5jdGlvbigpe3ZhciB0PXUuai5iKHRoaXMuYykK
-aWYodD09bnVsbCl0PXRoaXMuYz1ILlZNKE9iamVjdC5rZXlzKHRoaXMuYSksdS5zKQpyZXR1cm4gdH0s
-ClhLOmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscCxvPXRoaXMKaWYoby5iPT1udWxsKXJldHVybiBvLmMK
-dD1QLkZsKHUuTix1LnopCnM9by5DZigpCmZvcihyPTA7cT1zLmxlbmd0aCxyPHE7KytyKXtwPXNbcl0K
-dC5ZKDAscCxvLnEoMCxwKSl9aWYocT09PTApQy5ObS5pKHMsbnVsbCkKZWxzZSBDLk5tLnNBKHMsMCkK
-by5hPW8uYj1udWxsCnJldHVybiBvLmM9dH0sCmZiOmZ1bmN0aW9uKGEpe3ZhciB0CmlmKCFPYmplY3Qu
-cHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGhpcy5hLGEpKXJldHVybiBudWxsCnQ9UC5RZSh0
-aGlzLmFbYV0pCnJldHVybiB0aGlzLmJbYV09dH19ClAuaTgucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24o
-YSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0LmdBKHQpfSwKRTpmdW5jdGlvbihhLGIpe3ZhciB0PXRoaXMu
-YQppZih0LmI9PW51bGwpdD10LmdWKCkuRSgwLGIpCmVsc2V7dD10LkNmKCkKaWYoYjwwfHxiPj10Lmxl
-bmd0aClyZXR1cm4gSC5PSCh0LGIpCnQ9dFtiXX1yZXR1cm4gdH0sCmdrejpmdW5jdGlvbihhKXt2YXIg
-dD10aGlzLmEKaWYodC5iPT1udWxsKXt0PXQuZ1YoKQp0PXQuZ2t6KHQpfWVsc2V7dD10LkNmKCkKdD1u
-ZXcgSi5tMSh0LHQubGVuZ3RoLEgudDYodCkuQygibTE8MT4iKSl9cmV0dXJuIHR9LAp0ZzpmdW5jdGlv
-bihhLGIpe3JldHVybiB0aGlzLmEueDQoYil9fQpQLkNWLnByb3RvdHlwZT17CnlyOmZ1bmN0aW9uKGEs
-YTAsYTEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrLGosaSxoLGcsZixlLGQsYyxiPSJJbnZhbGlkIGJh
-c2U2NCBlbmNvZGluZyBsZW5ndGggIgphMT1QLmpCKGEwLGExLGEubGVuZ3RoKQp0PSQuVjcoKQpmb3Io
-cz1hMCxyPXMscT1udWxsLHA9LTEsbz0tMSxuPTA7czxhMTtzPW0pe209cysxCmw9Qy54Qi5XKGEscykK
-aWYobD09PTM3KXtrPW0rMgppZihrPD1hMSl7aj1ILm9vKEMueEIuVyhhLG0pKQppPUgub28oQy54Qi5X
-KGEsbSsxKSkKaD1qKjE2K2ktKGkmMjU2KQppZihoPT09MzcpaD0tMQptPWt9ZWxzZSBoPS0xfWVsc2Ug
-aD1sCmlmKDA8PWgmJmg8PTEyNyl7aWYoaDwwfHxoPj10Lmxlbmd0aClyZXR1cm4gSC5PSCh0LGgpCmc9
-dFtoXQppZihnPj0wKXtoPUMueEIubSgiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlq
-a2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsZykKaWYoaD09PWwpY29udGludWUKbD1ofWVsc2V7
-aWYoZz09PS0xKXtpZihwPDApe2Y9cT09bnVsbD9udWxsOnEuYS5sZW5ndGgKaWYoZj09bnVsbClmPTAK
-cD1mKyhzLXIpCm89c30rK24KaWYobD09PTYxKWNvbnRpbnVlfWw9aH1pZihnIT09LTIpe2lmKHE9PW51
-bGwpcT1uZXcgUC5SbigiIikKcS5hKz1DLnhCLk5qKGEscixzKQpxLmErPUguTHcobCkKcj1tCmNvbnRp
-bnVlfX10aHJvdyBILmIoUC5ycigiSW52YWxpZCBiYXNlNjQgZGF0YSIsYSxzKSl9aWYocSE9bnVsbCl7
-Zj1xLmErPUMueEIuTmooYSxyLGExKQplPWYubGVuZ3RoCmlmKHA+PTApUC54TShhLG8sYTEscCxuLGUp
-CmVsc2V7ZD1DLmpuLnpZKGUtMSw0KSsxCmlmKGQ9PT0xKXRocm93IEguYihQLnJyKGIsYSxhMSkpCmZv
-cig7ZDw0Oyl7Zis9Ij0iCnEuYT1mOysrZH19Zj1xLmEKcmV0dXJuIEMueEIuaTcoYSxhMCxhMSxmLmNo
-YXJDb2RlQXQoMCk9PTA/ZjpmKX1jPWExLWEwCmlmKHA+PTApUC54TShhLG8sYTEscCxuLGMpCmVsc2V7
-ZD1DLmpuLnpZKGMsNCkKaWYoZD09PTEpdGhyb3cgSC5iKFAucnIoYixhLGExKSkKaWYoZD4xKWE9Qy54
-Qi5pNyhhLGExLGExLGQ9PT0yPyI9PSI6Ij0iKX1yZXR1cm4gYX19ClAuVTgucHJvdG90eXBlPXt9ClAu
-VWsucHJvdG90eXBlPXt9ClAud0kucHJvdG90eXBlPXt9ClAuWmkucHJvdG90eXBlPXt9ClAuVWQucHJv
-dG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdD1QLnAodGhpcy5hKQpyZXR1cm4odGhpcy5iIT1udWxs
-PyJDb252ZXJ0aW5nIG9iamVjdCB0byBhbiBlbmNvZGFibGUgb2JqZWN0IGZhaWxlZDoiOiJDb252ZXJ0
-aW5nIG9iamVjdCBkaWQgbm90IHJldHVybiBhbiBlbmNvZGFibGUgb2JqZWN0OiIpKyIgIit0fX0KUC5L
-OC5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiJDeWNsaWMgZXJyb3IgaW4gSlNPTiBzdHJp
-bmdpZnkifX0KUC5ieS5wcm90b3R5cGU9ewpwVzpmdW5jdGlvbihhLGIsYyl7dmFyIHQKdS5lcC5iKGMp
-CnQ9UC5CUyhiLHRoaXMuZ0hlKCkuYSkKcmV0dXJuIHR9LApPQjpmdW5jdGlvbihhLGIpe3ZhciB0CnUu
-YmMuYihiKQp0PVAudVgoYSx0aGlzLmdaRSgpLmIsbnVsbCkKcmV0dXJuIHR9LApnWkU6ZnVuY3Rpb24o
-KXtyZXR1cm4gQy5uWH0sCmdIZTpmdW5jdGlvbigpe3JldHVybiBDLkEzfX0KUC5vai5wcm90b3R5cGU9
-e30KUC5NeC5wcm90b3R5cGU9e30KUC5TaC5wcm90b3R5cGU9ewp2cDpmdW5jdGlvbihhKXt2YXIgdCxz
-LHIscSxwLG8sbj1hLmxlbmd0aApmb3IodD1KLnJZKGEpLHM9dGhpcy5jLHI9MCxxPTA7cTxuOysrcSl7
-cD10LlcoYSxxKQppZihwPjkyKWNvbnRpbnVlCmlmKHA8MzIpe2lmKHE+cilzLmErPUMueEIuTmooYSxy
-LHEpCnI9cSsxCnMuYSs9SC5Mdyg5MikKc3dpdGNoKHApe2Nhc2UgODpzLmErPUguTHcoOTgpCmJyZWFr
-CmNhc2UgOTpzLmErPUguTHcoMTE2KQpicmVhawpjYXNlIDEwOnMuYSs9SC5MdygxMTApCmJyZWFrCmNh
-c2UgMTI6cy5hKz1ILkx3KDEwMikKYnJlYWsKY2FzZSAxMzpzLmErPUguTHcoMTE0KQpicmVhawpkZWZh
-dWx0OnMuYSs9SC5MdygxMTcpCnMuYSs9SC5Mdyg0OCkKcy5hKz1ILkx3KDQ4KQpvPXA+Pj40JjE1CnMu
-YSs9SC5MdyhvPDEwPzQ4K286ODcrbykKbz1wJjE1CnMuYSs9SC5MdyhvPDEwPzQ4K286ODcrbykKYnJl
-YWt9fWVsc2UgaWYocD09PTM0fHxwPT09OTIpe2lmKHE+cilzLmErPUMueEIuTmooYSxyLHEpCnI9cSsx
-CnMuYSs9SC5Mdyg5MikKcy5hKz1ILkx3KHApfX1pZihyPT09MClzLmErPUguZChhKQplbHNlIGlmKHI8
-bilzLmErPXQuTmooYSxyLG4pfSwKSm46ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEKZm9yKHQ9dGhpcy5h
-LHM9dC5sZW5ndGgscj0wO3I8czsrK3Ipe3E9dFtyXQppZihhPT1udWxsP3E9PW51bGw6YT09PXEpdGhy
-b3cgSC5iKG5ldyBQLks4KGEsbnVsbCkpfUMuTm0uaSh0LGEpfSwKaVU6ZnVuY3Rpb24oYSl7dmFyIHQs
-cyxyLHEscD10aGlzCmlmKHAudE0oYSkpcmV0dXJuCnAuSm4oYSkKdHJ5e3Q9cC5iLiQxKGEpCmlmKCFw
-LnRNKHQpKXtyPVAuR3koYSxudWxsLHAuZ1ZLKCkpCnRocm93IEguYihyKX1yPXAuYQppZigwPj1yLmxl
-bmd0aClyZXR1cm4gSC5PSChyLC0xKQpyLnBvcCgpfWNhdGNoKHEpe3M9SC5SdShxKQpyPVAuR3koYSxz
-LHAuZ1ZLKCkpCnRocm93IEguYihyKX19LAp0TTpmdW5jdGlvbihhKXt2YXIgdCxzLHI9dGhpcwppZih0
-eXBlb2YgYT09Im51bWJlciIpe2lmKCFpc0Zpbml0ZShhKSlyZXR1cm4hMQpyLmMuYSs9Qy5DRC53KGEp
-CnJldHVybiEwfWVsc2UgaWYoYT09PSEwKXtyLmMuYSs9InRydWUiCnJldHVybiEwfWVsc2UgaWYoYT09
-PSExKXtyLmMuYSs9ImZhbHNlIgpyZXR1cm4hMH1lbHNlIGlmKGE9PW51bGwpe3IuYy5hKz0ibnVsbCIK
-cmV0dXJuITB9ZWxzZSBpZih0eXBlb2YgYT09InN0cmluZyIpe3Q9ci5jCnQuYSs9JyInCnIudnAoYSkK
-dC5hKz0nIicKcmV0dXJuITB9ZWxzZSBpZih1LmouYyhhKSl7ci5KbihhKQpyLmxLKGEpCnQ9ci5hCmlm
-KDA+PXQubGVuZ3RoKXJldHVybiBILk9IKHQsLTEpCnQucG9wKCkKcmV0dXJuITB9ZWxzZSBpZih1Lkcu
-YyhhKSl7ci5KbihhKQpzPXIuancoYSkKdD1yLmEKaWYoMD49dC5sZW5ndGgpcmV0dXJuIEguT0godCwt
-MSkKdC5wb3AoKQpyZXR1cm4gc31lbHNlIHJldHVybiExfSwKbEs6ZnVuY3Rpb24oYSl7dmFyIHQscyxy
-PXRoaXMuYwpyLmErPSJbIgp0PUouVTYoYSkKaWYodC5nb3IoYSkpe3RoaXMuaVUodC5xKGEsMCkpCmZv
-cihzPTE7czx0LmdBKGEpOysrcyl7ci5hKz0iLCIKdGhpcy5pVSh0LnEoYSxzKSl9fXIuYSs9Il0ifSwK
-anc6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscCxvLG49dGhpcyxtPXt9CmlmKGEuZ2wwKGEpKXtuLmMu
-YSs9Int9IgpyZXR1cm4hMH10PWEuZ0EoYSkqMgpzPW5ldyBBcnJheSh0KQpzLmZpeGVkJGxlbmd0aD1B
-cnJheQpyPW0uYT0wCm0uYj0hMAphLksoMCxuZXcgUC50aShtLHMpKQppZighbS5iKXJldHVybiExCnE9
-bi5jCnEuYSs9InsiCmZvcihwPSciJztyPHQ7cis9MixwPScsIicpe3EuYSs9cApuLnZwKEgueShzW3Jd
-KSkKcS5hKz0nIjonCm89cisxCmlmKG8+PXQpcmV0dXJuIEguT0gocyxvKQpuLmlVKHNbb10pfXEuYSs9
-In0iCnJldHVybiEwfX0KUC50aS5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3ZhciB0LHMKaWYo
-dHlwZW9mIGEhPSJzdHJpbmciKXRoaXMuYS5iPSExCnQ9dGhpcy5iCnM9dGhpcy5hCkMuTm0uWSh0LHMu
-YSsrLGEpCkMuTm0uWSh0LHMuYSsrLGIpfSwKJFM6NH0KUC50dS5wcm90b3R5cGU9ewpnVks6ZnVuY3Rp
-b24oKXt2YXIgdD10aGlzLmMuYQpyZXR1cm4gdC5jaGFyQ29kZUF0KDApPT0wP3Q6dH19ClAudTUucHJv
-dG90eXBlPXsKZ1pFOmZ1bmN0aW9uKCl7cmV0dXJuIEMuUWt9fQpQLkUzLnByb3RvdHlwZT17CldKOmZ1
-bmN0aW9uKGEpe3ZhciB0LHMscj1QLmpCKDAsbnVsbCxhLmxlbmd0aCkscT1yLTAKaWYocT09PTApcmV0
-dXJuIG5ldyBVaW50OEFycmF5KDApCnQ9bmV3IFVpbnQ4QXJyYXkocSozKQpzPW5ldyBQLlJ3KHQpCmlm
-KHMuR3goYSwwLHIpIT09cilzLk82KEouYTYoYSxyLTEpLDApCnJldHVybiBuZXcgVWludDhBcnJheSh0
-LnN1YmFycmF5KDAsSC5yTSgwLHMuYix0Lmxlbmd0aCkpKX19ClAuUncucHJvdG90eXBlPXsKTzY6ZnVu
-Y3Rpb24oYSxiKXt2YXIgdCxzPXRoaXMscj1zLmMscT1zLmIscD1xKzEsbz1yLmxlbmd0aAppZigoYiY2
-NDUxMik9PT01NjMyMCl7dD02NTUzNisoKGEmMTAyMyk8PDEwKXxiJjEwMjMKcy5iPXAKaWYocT49byly
-ZXR1cm4gSC5PSChyLHEpCnJbcV09MjQwfHQ+Pj4xOApxPXMuYj1wKzEKaWYocD49bylyZXR1cm4gSC5P
-SChyLHApCnJbcF09MTI4fHQ+Pj4xMiY2MwpwPXMuYj1xKzEKaWYocT49bylyZXR1cm4gSC5PSChyLHEp
-CnJbcV09MTI4fHQ+Pj42JjYzCnMuYj1wKzEKaWYocD49bylyZXR1cm4gSC5PSChyLHApCnJbcF09MTI4
-fHQmNjMKcmV0dXJuITB9ZWxzZXtzLmI9cAppZihxPj1vKXJldHVybiBILk9IKHIscSkKcltxXT0yMjR8
-YT4+PjEyCnE9cy5iPXArMQppZihwPj1vKXJldHVybiBILk9IKHIscCkKcltwXT0xMjh8YT4+PjYmNjMK
-cy5iPXErMQppZihxPj1vKXJldHVybiBILk9IKHIscSkKcltxXT0xMjh8YSY2MwpyZXR1cm4hMX19LApH
-eDpmdW5jdGlvbihhLGIsYyl7dmFyIHQscyxyLHEscCxvLG4sbT10aGlzCmlmKGIhPT1jJiYoQy54Qi5t
-KGEsYy0xKSY2NDUxMik9PT01NTI5NiktLWMKZm9yKHQ9bS5jLHM9dC5sZW5ndGgscj1iO3I8YzsrK3Ip
-e3E9Qy54Qi5XKGEscikKaWYocTw9MTI3KXtwPW0uYgppZihwPj1zKWJyZWFrCm0uYj1wKzEKdFtwXT1x
-fWVsc2UgaWYoKHEmNjQ1MTIpPT09NTUyOTYpe2lmKG0uYiszPj1zKWJyZWFrCm89cisxCmlmKG0uTzYo
-cSxDLnhCLlcoYSxvKSkpcj1vfWVsc2UgaWYocTw9MjA0Nyl7cD1tLmIKbj1wKzEKaWYobj49cylicmVh
-awptLmI9bgppZihwPj1zKXJldHVybiBILk9IKHQscCkKdFtwXT0xOTJ8cT4+PjYKbS5iPW4rMQp0W25d
-PTEyOHxxJjYzfWVsc2V7cD1tLmIKaWYocCsyPj1zKWJyZWFrCm49bS5iPXArMQppZihwPj1zKXJldHVy
-biBILk9IKHQscCkKdFtwXT0yMjR8cT4+PjEyCnA9bS5iPW4rMQppZihuPj1zKXJldHVybiBILk9IKHQs
-bikKdFtuXT0xMjh8cT4+PjYmNjMKbS5iPXArMQppZihwPj1zKXJldHVybiBILk9IKHQscCkKdFtwXT0x
-Mjh8cSY2M319cmV0dXJuIHJ9fQpQLkdZLnByb3RvdHlwZT17CldKOmZ1bmN0aW9uKGEpe3ZhciB0LHMs
-cixxLHAsbyxuLG0sbAp1LkwuYihhKQp0PVAua3koITEsYSwwLG51bGwpCmlmKHQhPW51bGwpcmV0dXJu
-IHQKcz1QLmpCKDAsbnVsbCxKLkhtKGEpKQpyPVAuY1AoYSwwLHMpCmlmKHI+MCl7cT1QLkhNKGEsMCxy
-KQppZihyPT09cylyZXR1cm4gcQpwPW5ldyBQLlJuKHEpCm89cgpuPSExfWVsc2V7bz0wCnA9bnVsbApu
-PSEwfWlmKHA9PW51bGwpcD1uZXcgUC5SbigiIikKbT1uZXcgUC5ieighMSxwKQptLmM9bgptLk1FKGEs
-byxzKQppZihtLmU+MCl7SC52aChQLnJyKCJVbmZpbmlzaGVkIFVURi04IG9jdGV0IHNlcXVlbmNlIixh
-LHMpKQpwLmErPUguTHcoNjU1MzMpCm0uZj1tLmU9bS5kPTB9bD1wLmEKcmV0dXJuIGwuY2hhckNvZGVB
-dCgwKT09MD9sOmx9fQpQLmJ6LnByb3RvdHlwZT17Ck1FOmZ1bmN0aW9uKGEsYixjKXt2YXIgdCxzLHIs
-cSxwLG8sbixtLGwsayxqLGksaD10aGlzLGc9IkJhZCBVVEYtOCBlbmNvZGluZyAweCIKdS5MLmIoYSkK
-dD1oLmQKcz1oLmUKcj1oLmYKaC5mPWguZT1oLmQ9MAokbGFiZWwwJDA6Zm9yKHE9Si5VNihhKSxwPWgu
-YixvPWI7ITA7bz1qKXskbGFiZWwxJDE6aWYocz4wKXtkb3tpZihvPT09YylicmVhayAkbGFiZWwwJDAK
-bj1xLnEoYSxvKQppZih0eXBlb2YgbiE9PSJudW1iZXIiKXJldHVybiBuLnpNKCkKaWYoKG4mMTkyKSE9
-PTEyOCl7bT1QLnJyKGcrQy5qbi5XWihuLDE2KSxhLG8pCnRocm93IEguYihtKX1lbHNle3Q9KHQ8PDZ8
-biY2Myk+Pj4wOy0tczsrK299fXdoaWxlKHM+MCkKbT1yLTEKaWYobTwwfHxtPj00KXJldHVybiBILk9I
-KEMuR2IsbSkKaWYodDw9Qy5HYlttXSl7bT1QLnJyKCJPdmVybG9uZyBlbmNvZGluZyBvZiAweCIrQy5q
-bi5XWih0LDE2KSxhLG8tci0xKQp0aHJvdyBILmIobSl9aWYodD4xMTE0MTExKXttPVAucnIoIkNoYXJh
-Y3RlciBvdXRzaWRlIHZhbGlkIFVuaWNvZGUgcmFuZ2U6IDB4IitDLmpuLldaKHQsMTYpLGEsby1yLTEp
-CnRocm93IEguYihtKX1pZighaC5jfHx0IT09NjUyNzkpcC5hKz1ILkx3KHQpCmguYz0hMX1mb3IobT1v
-PGM7bTspe2w9UC5jUChhLG8sYykKaWYobD4wKXtoLmM9ITEKaz1vK2wKcC5hKz1QLkhNKGEsbyxrKQpp
-ZihrPT09YylicmVha31lbHNlIGs9bwpqPWsrMQpuPXEucShhLGspCmlmKHR5cGVvZiBuIT09Im51bWJl
-ciIpcmV0dXJuIG4uSigpCmlmKG48MCl7aT1QLnJyKCJOZWdhdGl2ZSBVVEYtOCBjb2RlIHVuaXQ6IC0w
-eCIrQy5qbi5XWigtbiwxNiksYSxqLTEpCnRocm93IEguYihpKX1lbHNle2lmKChuJjIyNCk9PT0xOTIp
-e3Q9biYzMQpzPTEKcj0xCmNvbnRpbnVlICRsYWJlbDAkMH1pZigobiYyNDApPT09MjI0KXt0PW4mMTUK
-cz0yCnI9Mgpjb250aW51ZSAkbGFiZWwwJDB9aWYoKG4mMjQ4KT09PTI0MCYmbjwyNDUpe3Q9biY3CnM9
-MwpyPTMKY29udGludWUgJGxhYmVsMCQwfWk9UC5ycihnK0Muam4uV1oobiwxNiksYSxqLTEpCnRocm93
-IEguYihpKX19YnJlYWsgJGxhYmVsMCQwfWlmKHM+MCl7aC5kPXQKaC5lPXMKaC5mPXJ9fX0KUC5XRi5w
-cm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3ZhciB0LHMscgp1LmZvLmIoYSkKdD10aGlzLmIKcz10
-aGlzLmEKdC5hKz1zLmEKcj10LmErPUguZChhLmEpCnQuYT1yKyI6ICIKdC5hKz1QLnAoYikKcy5hPSIs
-ICJ9LAokUzo0Mn0KUC5hMi5wcm90b3R5cGU9e30KUC5pUC5wcm90b3R5cGU9ewpETjpmdW5jdGlvbihh
-LGIpe2lmKGI9PW51bGwpcmV0dXJuITEKcmV0dXJuIGIgaW5zdGFuY2VvZiBQLmlQJiZ0aGlzLmE9PT1i
-LmEmJiEwfSwKZ2lPOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYQpyZXR1cm4odF5DLmpuLndHKHQsMzAp
-KSYxMDczNzQxODIzfSwKdzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLHM9UC5HcShILnRKKHQpKSxyPVAu
-aDAoSC5OUyh0KSkscT1QLmgwKEguakEodCkpLHA9UC5oMChILklYKHQpKSxvPVAuaDAoSC5jaCh0KSks
-bj1QLmgwKEguSmQodCkpLG09UC5WeChILm8xKHQpKSxsPXMrIi0iK3IrIi0iK3ErIiAiK3ArIjoiK28r
-IjoiK24rIi4iK20KcmV0dXJuIGx9fQpQLkNQLnByb3RvdHlwZT17fQpQLlhTLnByb3RvdHlwZT17fQpQ
-LkM2LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCmlmKHQhPW51bGwpcmV0dXJu
-IkFzc2VydGlvbiBmYWlsZWQ6ICIrUC5wKHQpCnJldHVybiJBc3NlcnRpb24gZmFpbGVkIn19ClAubi5w
-cm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiJUaHJvdyBvZiBudWxsLiJ9fQpQLnUucHJvdG90
-eXBlPXsKZ1o6ZnVuY3Rpb24oKXtyZXR1cm4iSW52YWxpZCBhcmd1bWVudCIrKCF0aGlzLmE/IihzKSI6
-IiIpfSwKZ3U6ZnVuY3Rpb24oKXtyZXR1cm4iIn0sCnc6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscD10
-aGlzLG89cC5jLG49byE9bnVsbD8iICgiK28rIikiOiIiCm89cC5kCnQ9bz09bnVsbD8iIjoiOiAiK0gu
-ZChvKQpzPXAuZ1ooKStuK3QKaWYoIXAuYSlyZXR1cm4gcwpyPXAuZ3UoKQpxPVAucChwLmIpCnJldHVy
-biBzK3IrIjogIitxfX0KUC5iSi5wcm90b3R5cGU9ewpnWjpmdW5jdGlvbigpe3JldHVybiJSYW5nZUVy
-cm9yIn0sCmd1OmZ1bmN0aW9uKCl7dmFyIHQscyxyPXRoaXMuZQppZihyPT1udWxsKXtyPXRoaXMuZgp0
-PXIhPW51bGw/IjogTm90IGxlc3MgdGhhbiBvciBlcXVhbCB0byAiK0guZChyKToiIn1lbHNle3M9dGhp
-cy5mCmlmKHM9PW51bGwpdD0iOiBOb3QgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvICIrSC5kKHIpCmVs
-c2UgaWYocz5yKXQ9IjogTm90IGluIHJhbmdlICIrSC5kKHIpKyIuLiIrSC5kKHMpKyIsIGluY2x1c2l2
-ZSIKZWxzZSB0PXM8cj8iOiBWYWxpZCB2YWx1ZSByYW5nZSBpcyBlbXB0eSI6IjogT25seSB2YWxpZCB2
-YWx1ZSBpcyAiK0guZChyKX1yZXR1cm4gdH19ClAuZVkucHJvdG90eXBlPXsKZ1o6ZnVuY3Rpb24oKXty
-ZXR1cm4iUmFuZ2VFcnJvciJ9LApndTpmdW5jdGlvbigpe3ZhciB0LHM9SC5TYyh0aGlzLmIpCmlmKHR5
-cGVvZiBzIT09Im51bWJlciIpcmV0dXJuIHMuSigpCmlmKHM8MClyZXR1cm4iOiBpbmRleCBtdXN0IG5v
-dCBiZSBuZWdhdGl2ZSIKdD10aGlzLmYKaWYodD09PTApcmV0dXJuIjogbm8gaW5kaWNlcyBhcmUgdmFs
-aWQiCnJldHVybiI6IGluZGV4IHNob3VsZCBiZSBsZXNzIHRoYW4gIitILmQodCl9LApnQTpmdW5jdGlv
-bihhKXtyZXR1cm4gdGhpcy5mfX0KUC5tcC5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3ZhciB0LHMs
-cixxLHAsbyxuLG0sbD10aGlzLGs9e30saj1uZXcgUC5SbigiIikKay5hPSIiCmZvcih0PWwuYyxzPXQu
-bGVuZ3RoLHI9MCxxPSIiLHA9IiI7cjxzOysrcixwPSIsICIpe289dFtyXQpqLmE9cStwCnE9ai5hKz1Q
-LnAobykKay5hPSIsICJ9bC5kLksoMCxuZXcgUC5XRihrLGopKQpuPVAucChsLmEpCm09ai53KDApCnQ9
-Ik5vU3VjaE1ldGhvZEVycm9yOiBtZXRob2Qgbm90IGZvdW5kOiAnIitILmQobC5iLmEpKyInXG5SZWNl
-aXZlcjogIituKyJcbkFyZ3VtZW50czogWyIrbSsiXSIKcmV0dXJuIHR9fQpQLnViLnByb3RvdHlwZT17
-Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIlVuc3VwcG9ydGVkIG9wZXJhdGlvbjogIit0aGlzLmF9fQpQLmRz
-LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0IT1udWxsPyJVbmlt
-cGxlbWVudGVkRXJyb3I6ICIrdDoiVW5pbXBsZW1lbnRlZEVycm9yIn19ClAubGoucHJvdG90eXBlPXsK
-dzpmdW5jdGlvbihhKXtyZXR1cm4iQmFkIHN0YXRlOiAiK3RoaXMuYX19ClAuVVYucHJvdG90eXBlPXsK
-dzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEKaWYodD09bnVsbClyZXR1cm4iQ29uY3VycmVudCBtb2Rp
-ZmljYXRpb24gZHVyaW5nIGl0ZXJhdGlvbi4iCnJldHVybiJDb25jdXJyZW50IG1vZGlmaWNhdGlvbiBk
-dXJpbmcgaXRlcmF0aW9uOiAiK1AucCh0KSsiLiJ9fQpQLms1LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24o
-YSl7cmV0dXJuIk91dCBvZiBNZW1vcnkifSwKJGlYUzoxfQpQLktZLnByb3RvdHlwZT17Cnc6ZnVuY3Rp
-b24oYSl7cmV0dXJuIlN0YWNrIE92ZXJmbG93In0sCiRpWFM6MX0KUC5jLnByb3RvdHlwZT17Cnc6ZnVu
-Y3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0PT1udWxsPyJSZWFkaW5nIHN0YXRpYyB2YXJpYWJs
-ZSBkdXJpbmcgaXRzIGluaXRpYWxpemF0aW9uIjoiUmVhZGluZyBzdGF0aWMgdmFyaWFibGUgJyIrdCsi
-JyBkdXJpbmcgaXRzIGluaXRpYWxpemF0aW9uIn19ClAuQ0QucHJvdG90eXBlPXsKdzpmdW5jdGlvbihh
-KXtyZXR1cm4iRXhjZXB0aW9uOiAiK3RoaXMuYX0sCiRpUno6MX0KUC5hRS5wcm90b3R5cGU9ewp3OmZ1
-bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrLGosaSxoPXRoaXMuYSxnPWghPW51bGwmJiIi
-IT09aD8iRm9ybWF0RXhjZXB0aW9uOiAiK0guZChoKToiRm9ybWF0RXhjZXB0aW9uIixmPXRoaXMuYyxl
-PXRoaXMuYgppZih0eXBlb2YgZT09InN0cmluZyIpe2lmKGYhPW51bGwpaD1mPDB8fGY+ZS5sZW5ndGgK
-ZWxzZSBoPSExCmlmKGgpZj1udWxsCmlmKGY9PW51bGwpe3Q9ZS5sZW5ndGg+Nzg/Qy54Qi5OaihlLDAs
-NzUpKyIuLi4iOmUKcmV0dXJuIGcrIlxuIit0fWZvcihzPTEscj0wLHE9ITEscD0wO3A8ZjsrK3Ape289
-Qy54Qi5XKGUscCkKaWYobz09PTEwKXtpZihyIT09cHx8IXEpKytzCnI9cCsxCnE9ITF9ZWxzZSBpZihv
-PT09MTMpeysrcwpyPXArMQpxPSEwfX1nPXM+MT9nKygiIChhdCBsaW5lICIrcysiLCBjaGFyYWN0ZXIg
-IisoZi1yKzEpKyIpXG4iKTpnKygiIChhdCBjaGFyYWN0ZXIgIisoZisxKSsiKVxuIikKbj1lLmxlbmd0
-aApmb3IocD1mO3A8bjsrK3Ape289Qy54Qi5tKGUscCkKaWYobz09PTEwfHxvPT09MTMpe249cApicmVh
-a319aWYobi1yPjc4KWlmKGYtcjw3NSl7bT1yKzc1Cmw9cgprPSIiCmo9Ii4uLiJ9ZWxzZXtpZihuLWY8
-NzUpe2w9bi03NQptPW4Kaj0iIn1lbHNle2w9Zi0zNgptPWYrMzYKaj0iLi4uIn1rPSIuLi4ifWVsc2V7
-bT1uCmw9cgprPSIiCmo9IiJ9aT1DLnhCLk5qKGUsbCxtKQpyZXR1cm4gZytrK2kraisiXG4iK0MueEIu
-SXgoIiAiLGYtbCtrLmxlbmd0aCkrIl5cbiJ9ZWxzZSByZXR1cm4gZiE9bnVsbD9nKygiIChhdCBvZmZz
-ZXQgIitILmQoZikrIikiKTpnfSwKJGlSejoxfQpQLkVILnByb3RvdHlwZT17fQpQLktOLnByb3RvdHlw
-ZT17fQpQLmNYLnByb3RvdHlwZT17CkUyOmZ1bmN0aW9uKGEsYixjKXt2YXIgdD1ILkxoKHRoaXMpCnJl
-dHVybiBILksxKHRoaXMsdC5LcShjKS5DKCIxKGNYLkUpIikuYihiKSx0LkMoImNYLkUiKSxjKX0sCmV2
-OmZ1bmN0aW9uKGEsYil7dmFyIHQ9SC5MaCh0aGlzKQpyZXR1cm4gbmV3IEguVTUodGhpcyx0LkMoImEy
-KGNYLkUpIikuYihiKSx0LkMoIlU1PGNYLkU+IikpfSwKZ0E6ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlz
-Lmdreih0aGlzKQpmb3IodD0wO3MuRigpOykrK3QKcmV0dXJuIHR9LApnbDA6ZnVuY3Rpb24oYSl7cmV0
-dXJuIXRoaXMuZ2t6KHRoaXMpLkYoKX0sCmdyODpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMuZ2t6KHRo
-aXMpCmlmKCFzLkYoKSl0aHJvdyBILmIoSC5XcCgpKQp0PXMuZ2woKQppZihzLkYoKSl0aHJvdyBILmIo
-SC5kVSgpKQpyZXR1cm4gdH0sCkU6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIKUC5rMShiLCJpbmRleCIp
-CmZvcih0PXRoaXMuZ2t6KHRoaXMpLHM9MDt0LkYoKTspe3I9dC5nbCgpCmlmKGI9PT1zKXJldHVybiBy
-Oysrc310aHJvdyBILmIoUC5DZihiLHRoaXMsImluZGV4IixudWxsLHMpKX0sCnc6ZnVuY3Rpb24oYSl7
-cmV0dXJuIFAuRVAodGhpcywiKCIsIikiKX19ClAuQW4ucHJvdG90eXBlPXt9ClAuek0ucHJvdG90eXBl
-PXskaWJROjEsJGljWDoxfQpQLlowLnByb3RvdHlwZT17fQpQLk4zLnByb3RvdHlwZT17Cnc6ZnVuY3Rp
-b24oYSl7cmV0dXJuIk1hcEVudHJ5KCIrSC5kKHRoaXMuYSkrIjogIitILmQodGhpcy5iKSsiKSJ9fQpQ
-LmM4LnByb3RvdHlwZT17CmdpTzpmdW5jdGlvbihhKXtyZXR1cm4gUC5rLnByb3RvdHlwZS5naU8uY2Fs
-bCh0aGlzLHRoaXMpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4ibnVsbCJ9fQpQLkZLLnByb3RvdHlwZT17
-fQpQLmsucHJvdG90eXBlPXtjb25zdHJ1Y3RvcjpQLmssJGlrOjEsCkROOmZ1bmN0aW9uKGEsYil7cmV0
-dXJuIHRoaXM9PT1ifSwKZ2lPOmZ1bmN0aW9uKGEpe3JldHVybiBILmVRKHRoaXMpfSwKdzpmdW5jdGlv
-bihhKXtyZXR1cm4iSW5zdGFuY2Ugb2YgJyIrSC5kKEguTSh0aGlzKSkrIicifSwKZTc6ZnVuY3Rpb24o
-YSxiKXt1Lm8uYihiKQp0aHJvdyBILmIoUC5scih0aGlzLGIuZ1dhKCksYi5nbmQoKSxiLmdWbSgpKSl9
-LAp0b1N0cmluZzpmdW5jdGlvbigpe3JldHVybiB0aGlzLncodGhpcyl9fQpQLk9kLnByb3RvdHlwZT17
-fQpQLmliLnByb3RvdHlwZT17JGlPZDoxfQpQLnh1LnByb3RvdHlwZT17fQpQLkd6LnByb3RvdHlwZT17
-fQpQLnFVLnByb3RvdHlwZT17JGl2WDoxfQpQLlJuLnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3Jl
-dHVybiB0aGlzLmEubGVuZ3RofSwKdzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEKcmV0dXJuIHQuY2hh
-ckNvZGVBdCgwKT09MD90OnR9LAokaUJMOjF9ClAuR0QucHJvdG90eXBlPXt9ClAubjEucHJvdG90eXBl
-PXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscQp1LmYuYihhKQpILnkoYikKdD1KLnJZKGIpLk9Z
-KGIsIj0iKQppZih0PT09LTEpe2lmKGIhPT0iIilhLlkoMCxQLmt1KGIsMCxiLmxlbmd0aCx0aGlzLmEs
-ITApLCIiKX1lbHNlIGlmKHQhPT0wKXtzPUMueEIuTmooYiwwLHQpCnI9Qy54Qi5HKGIsdCsxKQpxPXRo
-aXMuYQphLlkoMCxQLmt1KHMsMCxzLmxlbmd0aCxxLCEwKSxQLmt1KHIsMCxyLmxlbmd0aCxxLCEwKSl9
-cmV0dXJuIGF9LAokUzoxOX0KUC5jUy5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3Rocm93IEgu
-YihQLnJyKCJJbGxlZ2FsIElQdjQgYWRkcmVzcywgIithLHRoaXMuYSxiKSl9LAokUzo0Nn0KUC5WQy5w
-cm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3Rocm93IEguYihQLnJyKCJJbGxlZ2FsIElQdjYgYWRk
-cmVzcywgIithLHRoaXMuYSxiKSl9LAokMTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy4kMihhLG51bGwp
-fSwKJFM6NDd9ClAuSlQucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdAppZihiLWE+NCl0
-aGlzLmEuJDIoImFuIElQdjYgcGFydCBjYW4gb25seSBjb250YWluIGEgbWF4aW11bSBvZiA0IGhleCBk
-aWdpdHMiLGEpCnQ9UC5RQShDLnhCLk5qKHRoaXMuYixhLGIpLG51bGwsMTYpCmlmKHR5cGVvZiB0IT09
-Im51bWJlciIpcmV0dXJuIHQuSigpCmlmKHQ8MHx8dD42NTUzNSl0aGlzLmEuJDIoImVhY2ggcGFydCBt
-dXN0IGJlIGluIHRoZSByYW5nZSBvZiBgMHgwLi4weEZGRkZgIixhKQpyZXR1cm4gdH0sCiRTOjQ4fQpQ
-LkRuLnByb3RvdHlwZT17CmdrdTpmdW5jdGlvbigpe3JldHVybiB0aGlzLmJ9LApnSmY6ZnVuY3Rpb24o
-YSl7dmFyIHQ9dGhpcy5jCmlmKHQ9PW51bGwpcmV0dXJuIiIKaWYoQy54Qi5uKHQsIlsiKSlyZXR1cm4g
-Qy54Qi5Oaih0LDEsdC5sZW5ndGgtMSkKcmV0dXJuIHR9LApndHA6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhp
-cy5kCmlmKHQ9PW51bGwpcmV0dXJuIFAud0sodGhpcy5hKQpyZXR1cm4gdH0sCmd0UDpmdW5jdGlvbigp
-e3ZhciB0PXRoaXMuZgpyZXR1cm4gdD09bnVsbD8iIjp0fSwKZ0thOmZ1bmN0aW9uKCl7dmFyIHQ9dGhp
-cy5yCnJldHVybiB0PT1udWxsPyIiOnR9LApubTpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAsbyxu
-LG0sbD10aGlzCnUuWC5iKG51bGwpCnUuay5iKGIpCnQ9bC5hCnM9dD09PSJmaWxlIgpyPWwuYgpxPWwu
-ZApwPWwuYwppZighKHAhPW51bGwpKXA9ci5sZW5ndGghPT0wfHxxIT1udWxsfHxzPyIiOm51bGwKbz1s
-LmUKaWYoIXMpbj1wIT1udWxsJiZvLmxlbmd0aCE9PTAKZWxzZSBuPSEwCmlmKG4mJiFDLnhCLm4obywi
-LyIpKW89Ii8iK28KbT1QLmxlKG51bGwsMCwwLGIpCnJldHVybiBuZXcgUC5Ebih0LHIscCxxLG8sbSxs
-LnIpfSwKZ0ZqOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLngKaWYocyE9bnVsbClyZXR1cm4gcwp0PXRo
-aXMuZQppZih0Lmxlbmd0aCE9PTAmJkMueEIuVyh0LDApPT09NDcpdD1DLnhCLkcodCwxKQpzPXQ9PT0i
-Ij9DLnhEOlAuQUYobmV3IEguQTgoSC5WTSh0LnNwbGl0KCIvIiksdS5zKSx1LmRPLmIoUC5QSCgpKSx1
-LmRvKSx1Lk4pCnRoaXMuc282KHMpCnJldHVybiBzfSwKZ2hZOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlz
-CmlmKHMuUT09bnVsbCl7dD1zLmYKcy5zUkgobmV3IFAuR2ooUC5XWCh0PT1udWxsPyIiOnQpLHUuVykp
-fXJldHVybiBzLlF9LApKaDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAsbwpmb3IodD0wLHM9MDtD
-LnhCLlFpKGIsIi4uLyIscyk7KXtzKz0zOysrdH1yPUMueEIuY24oYSwiLyIpCndoaWxlKCEwKXtpZigh
-KHI+MCYmdD4wKSlicmVhawpxPUMueEIuUGsoYSwiLyIsci0xKQppZihxPDApYnJlYWsKcD1yLXEKbz1w
-IT09MgppZighb3x8cD09PTMpaWYoQy54Qi5tKGEscSsxKT09PTQ2KW89IW98fEMueEIubShhLHErMik9
-PT00NgplbHNlIG89ITEKZWxzZSBvPSExCmlmKG8pYnJlYWs7LS10CnI9cX1yZXR1cm4gQy54Qi5pNyhh
-LHIrMSxudWxsLEMueEIuRyhiLHMtMyp0KSl9LApaSTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5tUyhQ
-LmhLKGEpKX0sCm1TOmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrPXRoaXMsaj1udWxs
-CmlmKGEuZ0ZpKCkubGVuZ3RoIT09MCl7dD1hLmdGaSgpCmlmKGEuZ2NqKCkpe3M9YS5na3UoKQpyPWEu
-Z0pmKGEpCnE9YS5neEEoKT9hLmd0cChhKTpqfWVsc2V7cT1qCnI9cQpzPSIifXA9UC54ZShhLmdJaShh
-KSkKbz1hLmdRRCgpP2EuZ3RQKCk6an1lbHNle3Q9ay5hCmlmKGEuZ2NqKCkpe3M9YS5na3UoKQpyPWEu
-Z0pmKGEpCnE9UC53QihhLmd4QSgpP2EuZ3RwKGEpOmosdCkKcD1QLnhlKGEuZ0lpKGEpKQpvPWEuZ1FE
-KCk/YS5ndFAoKTpqfWVsc2V7cz1rLmIKcj1rLmMKcT1rLmQKaWYoYS5nSWkoYSk9PT0iIil7cD1rLmUK
-bz1hLmdRRCgpP2EuZ3RQKCk6ay5mfWVsc2V7aWYoYS5ndFQoKSlwPVAueGUoYS5nSWkoYSkpCmVsc2V7
-bj1rLmUKaWYobi5sZW5ndGg9PT0wKWlmKHI9PW51bGwpcD10Lmxlbmd0aD09PTA/YS5nSWkoYSk6UC54
-ZShhLmdJaShhKSkKZWxzZSBwPVAueGUoIi8iK2EuZ0lpKGEpKQplbHNle209ay5KaChuLGEuZ0lpKGEp
-KQpsPXQubGVuZ3RoPT09MAppZighbHx8ciE9bnVsbHx8Qy54Qi5uKG4sIi8iKSlwPVAueGUobSkKZWxz
-ZSBwPVAud0YobSwhbHx8ciE9bnVsbCl9fW89YS5nUUQoKT9hLmd0UCgpOmp9fX1yZXR1cm4gbmV3IFAu
-RG4odCxzLHIscSxwLG8sYS5nWjgoKT9hLmdLYSgpOmopfSwKZ2NqOmZ1bmN0aW9uKCl7cmV0dXJuIHRo
-aXMuYyE9bnVsbH0sCmd4QTpmdW5jdGlvbigpe3JldHVybiB0aGlzLmQhPW51bGx9LApnUUQ6ZnVuY3Rp
-b24oKXtyZXR1cm4gdGhpcy5mIT1udWxsfSwKZ1o4OmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuciE9bnVs
-bH0sCmd0VDpmdW5jdGlvbigpe3JldHVybiBDLnhCLm4odGhpcy5lLCIvIil9LAp0NDpmdW5jdGlvbigp
-e3ZhciB0LHMscj10aGlzLHE9ci5hCmlmKHEhPT0iIiYmcSE9PSJmaWxlIil0aHJvdyBILmIoUC5MNCgi
-Q2Fubm90IGV4dHJhY3QgYSBmaWxlIHBhdGggZnJvbSBhICIrSC5kKHEpKyIgVVJJIikpCnE9ci5mCmlm
-KChxPT1udWxsPyIiOnEpIT09IiIpdGhyb3cgSC5iKFAuTDQoIkNhbm5vdCBleHRyYWN0IGEgZmlsZSBw
-YXRoIGZyb20gYSBVUkkgd2l0aCBhIHF1ZXJ5IGNvbXBvbmVudCIpKQpxPXIucgppZigocT09bnVsbD8i
-IjpxKSE9PSIiKXRocm93IEguYihQLkw0KCJDYW5ub3QgZXh0cmFjdCBhIGZpbGUgcGF0aCBmcm9tIGEg
-VVJJIHdpdGggYSBmcmFnbWVudCBjb21wb25lbnQiKSkKdD0kLndRKCkKaWYoSC5vVCh0KSlxPVAubW4o
-cikKZWxzZXtpZihyLmMhPW51bGwmJnIuZ0pmKHIpIT09IiIpSC52aChQLkw0KCJDYW5ub3QgZXh0cmFj
-dCBhIG5vbi1XaW5kb3dzIGZpbGUgcGF0aCBmcm9tIGEgZmlsZSBVUkkgd2l0aCBhbiBhdXRob3JpdHki
-KSkKcz1yLmdGaigpClAua0UocywhMSkKcT1QLnZnKEMueEIubihyLmUsIi8iKT8iLyI6IiIscywiLyIp
-CnE9cS5jaGFyQ29kZUF0KDApPT0wP3E6cX1yZXR1cm4gcX0sCnc6ZnVuY3Rpb24oYSl7dmFyIHQscyxy
-LHE9dGhpcyxwPXEueQppZihwPT1udWxsKXtwPXEuYQp0PXAubGVuZ3RoIT09MD9wKyI6IjoiIgpzPXEu
-YwpyPXM9PW51bGwKaWYoIXJ8fHA9PT0iZmlsZSIpe3A9dCsiLy8iCnQ9cS5iCmlmKHQubGVuZ3RoIT09
-MClwPXArdCsiQCIKaWYoIXIpcCs9cwp0PXEuZAppZih0IT1udWxsKXA9cCsiOiIrSC5kKHQpfWVsc2Ug
-cD10CnArPXEuZQp0PXEuZgppZih0IT1udWxsKXA9cCsiPyIrdAp0PXEucgppZih0IT1udWxsKXA9cCsi
-IyIrdApwPXEueT1wLmNoYXJDb2RlQXQoMCk9PTA/cDpwfXJldHVybiBwfSwKRE46ZnVuY3Rpb24oYSxi
-KXt2YXIgdCxzLHI9dGhpcwppZihiPT1udWxsKXJldHVybiExCmlmKHI9PT1iKXJldHVybiEwCmlmKHUu
-di5jKGIpKWlmKHIuYT09Yi5nRmkoKSlpZihyLmMhPW51bGw9PT1iLmdjaigpKWlmKHIuYj09Yi5na3Uo
-KSlpZihyLmdKZihyKT09Yi5nSmYoYikpaWYoci5ndHAocik9PWIuZ3RwKGIpKWlmKHIuZT09PWIuZ0lp
-KGIpKXt0PXIuZgpzPXQ9PW51bGwKaWYoIXM9PT1iLmdRRCgpKXtpZihzKXQ9IiIKaWYodD09PWIuZ3RQ
-KCkpe3Q9ci5yCnM9dD09bnVsbAppZighcz09PWIuZ1o4KCkpe2lmKHMpdD0iIgp0PXQ9PT1iLmdLYSgp
-fWVsc2UgdD0hMX1lbHNlIHQ9ITF9ZWxzZSB0PSExfWVsc2UgdD0hMQplbHNlIHQ9ITEKZWxzZSB0PSEx
-CmVsc2UgdD0hMQplbHNlIHQ9ITEKZWxzZSB0PSExCmVsc2UgdD0hMQpyZXR1cm4gdH0sCmdpTzpmdW5j
-dGlvbihhKXt2YXIgdD10aGlzLnoKcmV0dXJuIHQ9PW51bGw/dGhpcy56PUMueEIuZ2lPKHRoaXMudygw
-KSk6dH0sCnNvNjpmdW5jdGlvbihhKXt0aGlzLng9dS5hLmIoYSl9LApzUkg6ZnVuY3Rpb24oYSl7dGhp
-cy5RPXUuZi5iKGEpfSwKJGlpRDoxLApnRmk6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5hfSwKZ0lpOmZ1
-bmN0aW9uKGEpe3JldHVybiB0aGlzLmV9fQpQLmUxLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3Ro
-cm93IEguYihQLnJyKCJJbnZhbGlkIHBvcnQiLHRoaXMuYSx0aGlzLmIrMSkpfSwKJFM6MTN9ClAuTlku
-cHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQ9IklsbGVnYWwgcGF0aCBjaGFyYWN0ZXIgIgpI
-LnkoYSkKaWYoSi56bChhLCIvIikpaWYodGhpcy5hKXRocm93IEguYihQLnhZKHQrYSkpCmVsc2UgdGhy
-b3cgSC5iKFAuTDQodCthKSl9LAokUzoxM30KUC5SWi5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXty
-ZXR1cm4gUC5lUChDLlpKLEgueShhKSxDLnhNLCExKX0sCiRTOjV9ClAuTUUucHJvdG90eXBlPXsKJDI6
-ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmIscz10aGlzLmEKdC5hKz1zLmEKcy5hPSImIgpzPXQuYSs9
-SC5kKFAuZVAoQy5GMyxhLEMueE0sITApKQppZihiIT1udWxsJiZiLmxlbmd0aCE9PTApe3QuYT1zKyI9
-Igp0LmErPUguZChQLmVQKEMuRjMsYixDLnhNLCEwKSl9fSwKJFM6MjJ9ClAueTUucHJvdG90eXBlPXsK
-JDI6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzCkgueShhKQppZihiPT1udWxsfHx0eXBlb2YgYj09InN0cmlu
-ZyIpdGhpcy5hLiQyKGEsSC55KGIpKQplbHNlIGZvcih0PUouSVQodS5SLmIoYikpLHM9dGhpcy5hO3Qu
-RigpOylzLiQyKGEsSC55KHQuZ2woKSkpfSwKJFM6MTJ9ClAuUEUucHJvdG90eXBlPXsKZ2xSOmZ1bmN0
-aW9uKCl7dmFyIHQscyxyLHEscD10aGlzLG89bnVsbCxuPXAuYwppZihuIT1udWxsKXJldHVybiBuCm49
-cC5iCmlmKDA+PW4ubGVuZ3RoKXJldHVybiBILk9IKG4sMCkKdD1wLmEKbj1uWzBdKzEKcz1DLnhCLlhV
-KHQsIj8iLG4pCnI9dC5sZW5ndGgKaWYocz49MCl7cT1QLlBJKHQscysxLHIsQy5WQywhMSkKcj1zfWVs
-c2UgcT1vCnJldHVybiBwLmM9bmV3IFAucWUoImRhdGEiLG8sbyxvLFAuUEkodCxuLHIsQy5XZCwhMSks
-cSxvKX0sCnc6ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlzLmIKaWYoMD49cy5sZW5ndGgpcmV0dXJuIEgu
-T0gocywwKQp0PXRoaXMuYQpyZXR1cm4gc1swXT09PS0xPyJkYXRhOiIrdDp0fX0KUC5xMy5wcm90b3R5
-cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFVpbnQ4QXJyYXkoOTYpfSwKJFM6MjN9ClAueUku
-cHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEKaWYoYT49dC5sZW5ndGgpcmV0
-dXJuIEguT0godCxhKQp0PXRbYV0KSi5DTSh0LDAsOTYsYikKcmV0dXJuIHR9LAokUzoyNH0KUC5jNi5w
-cm90b3R5cGU9ewokMzpmdW5jdGlvbihhLGIsYyl7dmFyIHQscyxyLHEKZm9yKHQ9Yi5sZW5ndGgscz1h
-Lmxlbmd0aCxyPTA7cjx0Oysrcil7cT1DLnhCLlcoYixyKV45NgppZihxPj1zKXJldHVybiBILk9IKGEs
-cSkKYVtxXT1jfX19ClAucWQucHJvdG90eXBlPXsKJDM6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMscixx
-CmZvcih0PUMueEIuVyhiLDApLHM9Qy54Qi5XKGIsMSkscj1hLmxlbmd0aDt0PD1zOysrdCl7cT0odF45
-Nik+Pj4wCmlmKHE+PXIpcmV0dXJuIEguT0goYSxxKQphW3FdPWN9fX0KUC5VZi5wcm90b3R5cGU9ewpn
-Y2o6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5jPjB9LApneEE6ZnVuY3Rpb24oKXt2YXIgdCxzCmlmKHRo
-aXMuYz4wKXt0PXRoaXMuZAppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJldHVybiB0LmgoKQpzPXRoaXMu
-ZQppZih0eXBlb2YgcyE9PSJudW1iZXIiKXJldHVybiBILnBZKHMpCnM9dCsxPHMKdD1zfWVsc2UgdD0h
-MQpyZXR1cm4gdH0sCmdRRDpmdW5jdGlvbigpe3ZhciB0PXRoaXMuZgppZih0eXBlb2YgdCE9PSJudW1i
-ZXIiKXJldHVybiB0LkooKQpyZXR1cm4gdDx0aGlzLnJ9LApnWjg6ZnVuY3Rpb24oKXtyZXR1cm4gdGhp
-cy5yPHRoaXMuYS5sZW5ndGh9LApnTnc6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5iPT09NCYmQy54Qi5u
-KHRoaXMuYSwiZmlsZSIpfSwKZ3ZoOmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuYj09PTQmJkMueEIubih0
-aGlzLmEsImh0dHAiKX0sCmdSZTpmdW5jdGlvbigpe3JldHVybiB0aGlzLmI9PT01JiZDLnhCLm4odGhp
-cy5hLCJodHRwcyIpfSwKZ3RUOmZ1bmN0aW9uKCl7cmV0dXJuIEMueEIuUWkodGhpcy5hLCIvIix0aGlz
-LmUpfSwKZ0ZpOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLHI9InBhY2thZ2UiLHE9cy5iCmlmKHE8PTAp
-cmV0dXJuIiIKdD1zLngKaWYodCE9bnVsbClyZXR1cm4gdAppZihzLmd2aCgpKXE9cy54PSJodHRwIgpl
-bHNlIGlmKHMuZ1JlKCkpe3MueD0iaHR0cHMiCnE9Imh0dHBzIn1lbHNlIGlmKHMuZ053KCkpe3MueD0i
-ZmlsZSIKcT0iZmlsZSJ9ZWxzZSBpZihxPT09NyYmQy54Qi5uKHMuYSxyKSl7cy54PXIKcT1yfWVsc2V7
-cT1DLnhCLk5qKHMuYSwwLHEpCnMueD1xfXJldHVybiBxfSwKZ2t1OmZ1bmN0aW9uKCl7dmFyIHQ9dGhp
-cy5jLHM9dGhpcy5iKzMKcmV0dXJuIHQ+cz9DLnhCLk5qKHRoaXMuYSxzLHQtMSk6IiJ9LApnSmY6ZnVu
-Y3Rpb24oYSl7dmFyIHQ9dGhpcy5jCnJldHVybiB0PjA/Qy54Qi5Oaih0aGlzLmEsdCx0aGlzLmQpOiIi
-fSwKZ3RwOmZ1bmN0aW9uKGEpe3ZhciB0LHM9dGhpcwppZihzLmd4QSgpKXt0PXMuZAppZih0eXBlb2Yg
-dCE9PSJudW1iZXIiKXJldHVybiB0LmgoKQpyZXR1cm4gUC5RQShDLnhCLk5qKHMuYSx0KzEscy5lKSxu
-dWxsLG51bGwpfWlmKHMuZ3ZoKCkpcmV0dXJuIDgwCmlmKHMuZ1JlKCkpcmV0dXJuIDQ0MwpyZXR1cm4g
-MH0sCmdJaTpmdW5jdGlvbihhKXtyZXR1cm4gQy54Qi5Oaih0aGlzLmEsdGhpcy5lLHRoaXMuZil9LApn
-dFA6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLmYscz10aGlzLnIKaWYodHlwZW9mIHQhPT0ibnVtYmVyIily
-ZXR1cm4gdC5KKCkKcmV0dXJuIHQ8cz9DLnhCLk5qKHRoaXMuYSx0KzEscyk6IiJ9LApnS2E6ZnVuY3Rp
-b24oKXt2YXIgdD10aGlzLnIscz10aGlzLmEKcmV0dXJuIHQ8cy5sZW5ndGg/Qy54Qi5HKHMsdCsxKToi
-In0sCmdGajpmdW5jdGlvbigpe3ZhciB0LHMscj10aGlzLmUscT10aGlzLmYscD10aGlzLmEKaWYoQy54
-Qi5RaShwLCIvIixyKSl7aWYodHlwZW9mIHIhPT0ibnVtYmVyIilyZXR1cm4gci5oKCk7KytyfWlmKHI9
-PXEpcmV0dXJuIEMueEQKdD1ILlZNKFtdLHUucykKcz1yCndoaWxlKCEwKXtpZih0eXBlb2YgcyE9PSJu
-dW1iZXIiKXJldHVybiBzLkooKQppZih0eXBlb2YgcSE9PSJudW1iZXIiKXJldHVybiBILnBZKHEpCmlm
-KCEoczxxKSlicmVhawppZihDLnhCLm0ocCxzKT09PTQ3KXtDLk5tLmkodCxDLnhCLk5qKHAscixzKSkK
-cj1zKzF9KytzfUMuTm0uaSh0LEMueEIuTmoocCxyLHEpKQpyZXR1cm4gUC5BRih0LHUuTil9LApnaFk6
-ZnVuY3Rpb24oKXt2YXIgdD10aGlzLmYKaWYodHlwZW9mIHQhPT0ibnVtYmVyIilyZXR1cm4gdC5KKCkK
-aWYodD49dGhpcy5yKXJldHVybiBDLldPCnJldHVybiBuZXcgUC5HaihQLldYKHRoaXMuZ3RQKCkpLHUu
-Vyl9LAprWDpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMuZAppZih0eXBlb2YgcyE9PSJudW1iZXIiKXJl
-dHVybiBzLmgoKQp0PXMrMQpyZXR1cm4gdCthLmxlbmd0aD09PXRoaXMuZSYmQy54Qi5RaSh0aGlzLmEs
-YSx0KX0sCk45OmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcyxzPXQucixyPXQuYQppZihzPj1yLmxlbmd0aCly
-ZXR1cm4gdApyZXR1cm4gbmV3IFAuVWYoQy54Qi5OaihyLDAscyksdC5iLHQuYyx0LmQsdC5lLHQuZixz
-LHQueCl9LApubTpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrLGo9dGhpcyxpPW51
-bGwKdS5YLmIobnVsbCkKdS5rLmIoYikKdD1qLmdGaSgpCnM9dD09PSJmaWxlIgpyPWouYwpxPXI+MD9D
-LnhCLk5qKGouYSxqLmIrMyxyKToiIgpwPWouZ3hBKCk/ai5ndHAoaik6aQpyPWouYwppZihyPjApbz1D
-LnhCLk5qKGouYSxyLGouZCkKZWxzZSBvPXEubGVuZ3RoIT09MHx8cCE9bnVsbHx8cz8iIjppCnI9ai5h
-Cm49Qy54Qi5OaihyLGouZSxqLmYpCmlmKCFzKW09byE9bnVsbCYmbi5sZW5ndGghPT0wCmVsc2UgbT0h
-MAppZihtJiYhQy54Qi5uKG4sIi8iKSluPSIvIituCmw9UC5sZShpLDAsMCxiKQptPWoucgprPW08ci5s
-ZW5ndGg/Qy54Qi5HKHIsbSsxKTppCnJldHVybiBuZXcgUC5Ebih0LHEsbyxwLG4sbCxrKX0sClpJOmZ1
-bmN0aW9uKGEpe3JldHVybiB0aGlzLm1TKFAuaEsoYSkpfSwKbVM6ZnVuY3Rpb24oYSl7aWYoYSBpbnN0
-YW5jZW9mIFAuVWYpcmV0dXJuIHRoaXMudTEodGhpcyxhKQpyZXR1cm4gdGhpcy52cygpLm1TKGEpfSwK
-dTE6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxqLGksaCxnLGYsZT1iLmIKaWYo
-ZT4wKXJldHVybiBiCnQ9Yi5jCmlmKHQ+MCl7cz1hLmIKaWYoczw9MClyZXR1cm4gYgppZihhLmdOdygp
-KXI9Yi5lIT1iLmYKZWxzZSBpZihhLmd2aCgpKXI9IWIua1goIjgwIikKZWxzZSByPSFhLmdSZSgpfHwh
-Yi5rWCgiNDQzIikKaWYocil7cT1zKzEKcD1DLnhCLk5qKGEuYSwwLHEpK0MueEIuRyhiLmEsZSsxKQpl
-PWIuZAppZih0eXBlb2YgZSE9PSJudW1iZXIiKXJldHVybiBlLmgoKQpvPWIuZQppZih0eXBlb2YgbyE9
-PSJudW1iZXIiKXJldHVybiBvLmgoKQpuPWIuZgppZih0eXBlb2YgbiE9PSJudW1iZXIiKXJldHVybiBu
-LmgoKQpyZXR1cm4gbmV3IFAuVWYocCxzLHQrcSxlK3EsbytxLG4rcSxiLnIrcSxhLngpfWVsc2UgcmV0
-dXJuIHRoaXMudnMoKS5tUyhiKX1tPWIuZQplPWIuZgppZihtPT1lKXt0PWIucgppZih0eXBlb2YgZSE9
-PSJudW1iZXIiKXJldHVybiBlLkooKQppZihlPHQpe3M9YS5mCmlmKHR5cGVvZiBzIT09Im51bWJlciIp
-cmV0dXJuIHMuSE4oKQpxPXMtZQpyZXR1cm4gbmV3IFAuVWYoQy54Qi5OaihhLmEsMCxzKStDLnhCLkco
-Yi5hLGUpLGEuYixhLmMsYS5kLGEuZSxlK3EsdCtxLGEueCl9ZT1iLmEKaWYodDxlLmxlbmd0aCl7cz1h
-LnIKcmV0dXJuIG5ldyBQLlVmKEMueEIuTmooYS5hLDAscykrQy54Qi5HKGUsdCksYS5iLGEuYyxhLmQs
-YS5lLGEuZix0KyhzLXQpLGEueCl9cmV0dXJuIGEuTjkoKX10PWIuYQppZihDLnhCLlFpKHQsIi8iLG0p
-KXtzPWEuZQppZih0eXBlb2YgcyE9PSJudW1iZXIiKXJldHVybiBzLkhOKCkKaWYodHlwZW9mIG0hPT0i
-bnVtYmVyIilyZXR1cm4gSC5wWShtKQpxPXMtbQpwPUMueEIuTmooYS5hLDAscykrQy54Qi5HKHQsbSkK
-aWYodHlwZW9mIGUhPT0ibnVtYmVyIilyZXR1cm4gZS5oKCkKcmV0dXJuIG5ldyBQLlVmKHAsYS5iLGEu
-YyxhLmQscyxlK3EsYi5yK3EsYS54KX1sPWEuZQprPWEuZgppZihsPT1rJiZhLmM+MCl7Zm9yKDtDLnhC
-LlFpKHQsIi4uLyIsbSk7KXtpZih0eXBlb2YgbSE9PSJudW1iZXIiKXJldHVybiBtLmgoKQptKz0zfWlm
-KHR5cGVvZiBsIT09Im51bWJlciIpcmV0dXJuIGwuSE4oKQppZih0eXBlb2YgbSE9PSJudW1iZXIiKXJl
-dHVybiBILnBZKG0pCnE9bC1tKzEKcD1DLnhCLk5qKGEuYSwwLGwpKyIvIitDLnhCLkcodCxtKQppZih0
-eXBlb2YgZSE9PSJudW1iZXIiKXJldHVybiBlLmgoKQpyZXR1cm4gbmV3IFAuVWYocCxhLmIsYS5jLGEu
-ZCxsLGUrcSxiLnIrcSxhLngpfWo9YS5hCmZvcihpPWw7Qy54Qi5RaShqLCIuLi8iLGkpOyl7aWYodHlw
-ZW9mIGkhPT0ibnVtYmVyIilyZXR1cm4gaS5oKCkKaSs9M31oPTAKd2hpbGUoITApe2lmKHR5cGVvZiBt
-IT09Im51bWJlciIpcmV0dXJuIG0uaCgpCmc9bSszCmlmKHR5cGVvZiBlIT09Im51bWJlciIpcmV0dXJu
-IEgucFkoZSkKaWYoIShnPD1lJiZDLnhCLlFpKHQsIi4uLyIsbSkpKWJyZWFrOysraAptPWd9Zj0iIgp3
-aGlsZSghMCl7aWYodHlwZW9mIGshPT0ibnVtYmVyIilyZXR1cm4gay5vcygpCmlmKHR5cGVvZiBpIT09
-Im51bWJlciIpcmV0dXJuIEgucFkoaSkKaWYoIShrPmkpKWJyZWFrOy0tawppZihDLnhCLm0oaixrKT09
-PTQ3KXtpZihoPT09MCl7Zj0iLyIKYnJlYWt9LS1oCmY9Ii8ifX1pZihrPT09aSYmYS5iPD0wJiYhQy54
-Qi5RaShqLCIvIixsKSl7bS09aCozCmY9IiJ9cT1rLW0rZi5sZW5ndGgKcmV0dXJuIG5ldyBQLlVmKEMu
-eEIuTmooaiwwLGspK2YrQy54Qi5HKHQsbSksYS5iLGEuYyxhLmQsbCxlK3EsYi5yK3EsYS54KX0sCnQ0
-OmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscD10aGlzCmlmKHAuYj49MCYmIXAuZ053KCkpdGhyb3cgSC5i
-KFAuTDQoIkNhbm5vdCBleHRyYWN0IGEgZmlsZSBwYXRoIGZyb20gYSAiK0guZChwLmdGaSgpKSsiIFVS
-SSIpKQp0PXAuZgpzPXAuYQppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJldHVybiB0LkooKQppZih0PHMu
-bGVuZ3RoKXtpZih0PHAucil0aHJvdyBILmIoUC5MNCgiQ2Fubm90IGV4dHJhY3QgYSBmaWxlIHBhdGgg
-ZnJvbSBhIFVSSSB3aXRoIGEgcXVlcnkgY29tcG9uZW50IikpCnRocm93IEguYihQLkw0KCJDYW5ub3Qg
-ZXh0cmFjdCBhIGZpbGUgcGF0aCBmcm9tIGEgVVJJIHdpdGggYSBmcmFnbWVudCBjb21wb25lbnQiKSl9
-cj0kLndRKCkKaWYoSC5vVChyKSl0PVAubW4ocCkKZWxzZXtxPXAuZAppZih0eXBlb2YgcSE9PSJudW1i
-ZXIiKXJldHVybiBILnBZKHEpCmlmKHAuYzxxKUgudmgoUC5MNCgiQ2Fubm90IGV4dHJhY3QgYSBub24t
-V2luZG93cyBmaWxlIHBhdGggZnJvbSBhIGZpbGUgVVJJIHdpdGggYW4gYXV0aG9yaXR5IikpCnQ9Qy54
-Qi5OaihzLHAuZSx0KX1yZXR1cm4gdH0sCmdpTzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLnkKcmV0dXJu
-IHQ9PW51bGw/dGhpcy55PUMueEIuZ2lPKHRoaXMuYSk6dH0sCkROOmZ1bmN0aW9uKGEsYil7aWYoYj09
-bnVsbClyZXR1cm4hMQppZih0aGlzPT09YilyZXR1cm4hMApyZXR1cm4gdS52LmMoYikmJnRoaXMuYT09
-PWIudygwKX0sCnZzOmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcyxzPW51bGwscj10LmdGaSgpLHE9dC5na3Uo
-KSxwPXQuYz4wP3QuZ0pmKHQpOnMsbz10Lmd4QSgpP3QuZ3RwKHQpOnMsbj10LmEsbT10LmYsbD1DLnhC
-Lk5qKG4sdC5lLG0pLGs9dC5yCmlmKHR5cGVvZiBtIT09Im51bWJlciIpcmV0dXJuIG0uSigpCm09bTxr
-P3QuZ3RQKCk6cwpyZXR1cm4gbmV3IFAuRG4ocixxLHAsbyxsLG0sazxuLmxlbmd0aD90LmdLYSgpOnMp
-fSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hfSwKJGlpRDoxfQpQLnFlLnByb3RvdHlwZT17fQpX
-LnFFLnByb3RvdHlwZT17fQpXLkdoLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIFN0cmlu
-ZyhhKX0sCiRpR2g6MX0KVy5mWS5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiBTdHJpbmco
-YSl9fQpXLm5CLnByb3RvdHlwZT17JGluQjoxfQpXLkF6LnByb3RvdHlwZT17JGlBejoxfQpXLlFQLnBy
-b3RvdHlwZT17JGlRUDoxfQpXLm54LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiBhLmxl
-bmd0aH19Clcub0oucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIGEubGVuZ3RofX0KVy5p
-ZC5wcm90b3R5cGU9e30KVy5RRi5wcm90b3R5cGU9e30KVy5OaC5wcm90b3R5cGU9ewp3OmZ1bmN0aW9u
-KGEpe3JldHVybiBTdHJpbmcoYSl9fQpXLklCLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJu
-IlJlY3RhbmdsZSAoIitILmQoYS5sZWZ0KSsiLCAiK0guZChhLnRvcCkrIikgIitILmQoYS53aWR0aCkr
-IiB4ICIrSC5kKGEuaGVpZ2h0KX0sCkROOmZ1bmN0aW9uKGEsYil7aWYoYj09bnVsbClyZXR1cm4hMQpy
-ZXR1cm4gdS5xLmMoYikmJmEubGVmdD09PWIubGVmdCYmYS50b3A9PT1iLnRvcCYmYS53aWR0aD09PWIu
-d2lkdGgmJmEuaGVpZ2h0PT09Yi5oZWlnaHR9LApnaU86ZnVuY3Rpb24oYSl7cmV0dXJuIFcuckUoQy5D
-RC5naU8oYS5sZWZ0KSxDLkNELmdpTyhhLnRvcCksQy5DRC5naU8oYS53aWR0aCksQy5DRC5naU8oYS5o
-ZWlnaHQpKX0sCiRpdG46MX0KVy5uNy5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5s
-ZW5ndGh9fQpXLnd6LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEubGVuZ3Ro
-fSwKcTpmdW5jdGlvbihhLGIpe3ZhciB0CkguU2MoYikKdD10aGlzLmEKaWYoYjwwfHxiPj10Lmxlbmd0
-aClyZXR1cm4gSC5PSCh0LGIpCnJldHVybiB0aGlzLiR0aS5kLmIodFtiXSl9LApZOmZ1bmN0aW9uKGEs
-YixjKXt0aGlzLiR0aS5kLmIoYykKdGhyb3cgSC5iKFAuTDQoIkNhbm5vdCBtb2RpZnkgbGlzdCIpKX19
-ClcuY3YucHJvdG90eXBlPXsKZ1FnOmZ1bmN0aW9uKGEpe3JldHVybiBuZXcgVy5pNyhhKX0sCmdQOmZ1
-bmN0aW9uKGEpe3JldHVybiBuZXcgVy5JNChhKX0sCnNQOmZ1bmN0aW9uKGEsYil7dmFyIHQKdS5YLmIo
-YikKdD10aGlzLmdQKGEpCnQuVjEoMCkKdC5GVigwLGIpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gYS5s
-b2NhbE5hbWV9LApGRjpmdW5jdGlvbihhKXt2YXIgdD0hIWEuc2Nyb2xsSW50b1ZpZXdJZk5lZWRlZApp
-Zih0KWEuc2Nyb2xsSW50b1ZpZXdJZk5lZWRlZCgpCmVsc2UgYS5zY3JvbGxJbnRvVmlldygpfSwKbno6
-ZnVuY3Rpb24oYSxiLGMsZCxlKXt2YXIgdCxzPXRoaXMucjYoYSxjLGQsZSkKc3dpdGNoKGIudG9Mb3dl
-ckNhc2UoKSl7Y2FzZSJiZWZvcmViZWdpbiI6YS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShzLGEpCmJy
-ZWFrCmNhc2UiYWZ0ZXJiZWdpbiI6dD1hLmNoaWxkTm9kZXMKYS5pbnNlcnRCZWZvcmUocyx0Lmxlbmd0
-aD4wP3RbMF06bnVsbCkKYnJlYWsKY2FzZSJiZWZvcmVlbmQiOmEuYXBwZW5kQ2hpbGQocykKYnJlYWsK
-Y2FzZSJhZnRlcmVuZCI6YS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShzLGEubmV4dFNpYmxpbmcpCmJy
-ZWFrCmRlZmF1bHQ6SC52aChQLnhZKCJJbnZhbGlkIHBvc2l0aW9uICIrYikpfX0sCnI2OmZ1bmN0aW9u
-KGEsYixjLGQpe3ZhciB0LHMscixxCmlmKGM9PW51bGwpe2lmKGQ9PW51bGwpe3Q9JC5sdAppZih0PT1u
-dWxsKXt0PUguVk0oW10sdS5pKQpzPW5ldyBXLnZEKHQpCkMuTm0uaSh0LFcuVHcobnVsbCkpCkMuTm0u
-aSh0LFcuQmwoKSkKJC5sdD1zCmQ9c31lbHNlIGQ9dH10PSQuRVUKaWYodD09bnVsbCl7dD1uZXcgVy5L
-byhkKQokLkVVPXQKYz10fWVsc2V7dC5hPWQKYz10fX1lbHNlIGlmKGQhPW51bGwpdGhyb3cgSC5iKFAu
-eFkoInZhbGlkYXRvciBjYW4gb25seSBiZSBwYXNzZWQgaWYgdHJlZVNhbml0aXplciBpcyBudWxsIikp
-CmlmKCQueG89PW51bGwpe3Q9ZG9jdW1lbnQKcz10LmltcGxlbWVudGF0aW9uLmNyZWF0ZUhUTUxEb2N1
-bWVudCgiIikKJC54bz1zCiQuQk89cy5jcmVhdGVSYW5nZSgpCnM9JC54by5jcmVhdGVFbGVtZW50KCJi
-YXNlIikKdS5jUi5iKHMpCnMuaHJlZj10LmJhc2VVUkkKJC54by5oZWFkLmFwcGVuZENoaWxkKHMpfXQ9
-JC54bwppZih0LmJvZHk9PW51bGwpe3M9dC5jcmVhdGVFbGVtZW50KCJib2R5IikKdC5ib2R5PXUuWS5i
-KHMpfXQ9JC54bwppZih1LlkuYyhhKSlyPXQuYm9keQplbHNle3I9dC5jcmVhdGVFbGVtZW50KGEudGFn
-TmFtZSkKJC54by5ib2R5LmFwcGVuZENoaWxkKHIpfWlmKCJjcmVhdGVDb250ZXh0dWFsRnJhZ21lbnQi
-IGluIHdpbmRvdy5SYW5nZS5wcm90b3R5cGUmJiFDLk5tLnRnKEMuU3EsYS50YWdOYW1lKSl7JC5CTy5z
-ZWxlY3ROb2RlQ29udGVudHMocikKcT0kLkJPLmNyZWF0ZUNvbnRleHR1YWxGcmFnbWVudChiKX1lbHNl
-e3IuaW5uZXJIVE1MPWIKcT0kLnhvLmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKQpmb3IoO3Q9ci5maXJz
-dENoaWxkLHQhPW51bGw7KXEuYXBwZW5kQ2hpbGQodCl9dD0kLnhvLmJvZHkKaWYocj09bnVsbD90IT1u
-dWxsOnIhPT10KUouTHQocikKYy5QbihxKQpkb2N1bWVudC5hZG9wdE5vZGUocSkKcmV0dXJuIHF9LApB
-SDpmdW5jdGlvbihhLGIsYyl7cmV0dXJuIHRoaXMucjYoYSxiLGMsbnVsbCl9LApzaGY6ZnVuY3Rpb24o
-YSxiKXt0aGlzLllDKGEsYil9LApwazpmdW5jdGlvbihhLGIsYyl7YS50ZXh0Q29udGVudD1udWxsCmEu
-YXBwZW5kQ2hpbGQodGhpcy5yNihhLGIsbnVsbCxjKSl9LApZQzpmdW5jdGlvbihhLGIpe3JldHVybiB0
-aGlzLnBrKGEsYixudWxsKX0sCmdWbDpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFcuZXUoYSwiY2xpY2si
-LCExLHUuUSl9LAokaWN2OjEsCmduczpmdW5jdGlvbihhKXtyZXR1cm4gYS50YWdOYW1lfX0KVy5Ddi5w
-cm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gdS5oLmModS5BLmIoYSkpfSwKJFM6MjV9Clcu
-ZWEucHJvdG90eXBlPXskaWVhOjF9ClcuRDAucHJvdG90eXBlPXsKT246ZnVuY3Rpb24oYSxiLGMsZCl7
-dS5VLmIoYykKaWYoYyE9bnVsbCl0aGlzLnYoYSxiLGMsZCl9LApCOmZ1bmN0aW9uKGEsYixjKXtyZXR1
-cm4gdGhpcy5PbihhLGIsYyxudWxsKX0sCnY6ZnVuY3Rpb24oYSxiLGMsZCl7cmV0dXJuIGEuYWRkRXZl
-bnRMaXN0ZW5lcihiLEgudFIodS5VLmIoYyksMSksZCl9LAokaUQwOjF9ClcuaEgucHJvdG90eXBlPXsk
-aWhIOjF9ClcuaDQucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIGEubGVuZ3RofX0KVy5i
-ci5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9fQpXLlZiLnByb3RvdHlw
-ZT17fQpXLk83LnByb3RvdHlwZT17CmVvOmZ1bmN0aW9uKGEsYixjLGQpe3JldHVybiBhLm9wZW4oYixj
-LCEwKX0sCiRpTzc6MX0KVy53YS5wcm90b3R5cGU9e30KVy5TZy5wcm90b3R5cGU9eyRpU2c6MX0KVy51
-OC5wcm90b3R5cGU9ewpnRHI6ZnVuY3Rpb24oYSl7aWYoIm9yaWdpbiIgaW4gYSlyZXR1cm4gYS5vcmln
-aW4KcmV0dXJuIEguZChhLnByb3RvY29sKSsiLy8iK0guZChhLmhvc3QpfSwKdzpmdW5jdGlvbihhKXty
-ZXR1cm4gU3RyaW5nKGEpfSwKJGl1ODoxfQpXLkFqLnByb3RvdHlwZT17JGlBajoxfQpXLmU3LnByb3Rv
-dHlwZT17CmdyODpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEscz10LmNoaWxkTm9kZXMubGVuZ3RoCmlm
-KHM9PT0wKXRocm93IEguYihQLlBWKCJObyBlbGVtZW50cyIpKQppZihzPjEpdGhyb3cgSC5iKFAuUFYo
-Ik1vcmUgdGhhbiBvbmUgZWxlbWVudCIpKQpyZXR1cm4gdC5maXJzdENoaWxkfSwKRlY6ZnVuY3Rpb24o
-YSxiKXt2YXIgdCxzLHIscQp1LmVoLmIoYikKdD1iLmEKcz10aGlzLmEKaWYodCE9PXMpZm9yKHI9dC5j
-aGlsZE5vZGVzLmxlbmd0aCxxPTA7cTxyOysrcSlzLmFwcGVuZENoaWxkKHQuZmlyc3RDaGlsZCkKcmV0
-dXJufSwKWTpmdW5jdGlvbihhLGIsYyl7dmFyIHQscwp1LkEuYihjKQp0PXRoaXMuYQpzPXQuY2hpbGRO
-b2RlcwppZihiPDB8fGI+PXMubGVuZ3RoKXJldHVybiBILk9IKHMsYikKdC5yZXBsYWNlQ2hpbGQoYyxz
-W2JdKX0sCmdrejpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEuY2hpbGROb2RlcwpyZXR1cm4gbmV3IFcu
-VzkodCx0Lmxlbmd0aCxILnpLKHQpLkMoIlc5PEdtLkU+IikpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJu
-IHRoaXMuYS5jaGlsZE5vZGVzLmxlbmd0aH0sCnE6ZnVuY3Rpb24oYSxiKXt2YXIgdApILlNjKGIpCnQ9
-dGhpcy5hLmNoaWxkTm9kZXMKaWYoYjwwfHxiPj10Lmxlbmd0aClyZXR1cm4gSC5PSCh0LGIpCnJldHVy
-biB0W2JdfX0KVy51SC5wcm90b3R5cGU9ewp3ZzpmdW5jdGlvbihhKXt2YXIgdD1hLnBhcmVudE5vZGUK
-aWYodCE9bnVsbCl0LnJlbW92ZUNoaWxkKGEpfSwKRDQ6ZnVuY3Rpb24oYSl7dmFyIHQKZm9yKDt0PWEu
-Zmlyc3RDaGlsZCx0IT1udWxsOylhLnJlbW92ZUNoaWxkKHQpfSwKdzpmdW5jdGlvbihhKXt2YXIgdD1h
-Lm5vZGVWYWx1ZQpyZXR1cm4gdD09bnVsbD90aGlzLlUoYSk6dH0sCiRpdUg6MX0KVy5CSC5wcm90b3R5
-cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9LApxOmZ1bmN0aW9uKGEsYil7SC5TYyhi
-KQppZihiPj4+MCE9PWJ8fGI+PWEubGVuZ3RoKXRocm93IEguYihQLkNmKGIsYSxudWxsLG51bGwsbnVs
-bCkpCnJldHVybiBhW2JdfSwKWTpmdW5jdGlvbihhLGIsYyl7dS5BLmIoYykKdGhyb3cgSC5iKFAuTDQo
-IkNhbm5vdCBhc3NpZ24gZWxlbWVudCBvZiBpbW11dGFibGUgTGlzdC4iKSl9LApFOmZ1bmN0aW9uKGEs
-Yil7aWYoYjwwfHxiPj1hLmxlbmd0aClyZXR1cm4gSC5PSChhLGIpCnJldHVybiBhW2JdfSwKJGliUTox
-LAokaVhqOjEsCiRpY1g6MSwKJGl6TToxfQpXLlNOLnByb3RvdHlwZT17fQpXLmV3LnByb3RvdHlwZT17
-JGlldzoxfQpXLmxwLnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiBhLmxlbmd0aH19Clcu
-VGIucHJvdG90eXBlPXsKcjY6ZnVuY3Rpb24oYSxiLGMsZCl7dmFyIHQscwppZigiY3JlYXRlQ29udGV4
-dHVhbEZyYWdtZW50IiBpbiB3aW5kb3cuUmFuZ2UucHJvdG90eXBlKXJldHVybiB0aGlzLkRXKGEsYixj
-LGQpCnQ9Vy5VOSgiPHRhYmxlPiIrSC5kKGIpKyI8L3RhYmxlPiIsYyxkKQpzPWRvY3VtZW50LmNyZWF0
-ZURvY3VtZW50RnJhZ21lbnQoKQpzLnRvU3RyaW5nCnQudG9TdHJpbmcKbmV3IFcuZTcocykuRlYoMCxu
-ZXcgVy5lNyh0KSkKcmV0dXJuIHN9fQpXLkl2LnByb3RvdHlwZT17CnI2OmZ1bmN0aW9uKGEsYixjLGQp
-e3ZhciB0LHMscixxCmlmKCJjcmVhdGVDb250ZXh0dWFsRnJhZ21lbnQiIGluIHdpbmRvdy5SYW5nZS5w
-cm90b3R5cGUpcmV0dXJuIHRoaXMuRFcoYSxiLGMsZCkKdD1kb2N1bWVudApzPXQuY3JlYXRlRG9jdW1l
-bnRGcmFnbWVudCgpCnQ9Qy5JZS5yNih0LmNyZWF0ZUVsZW1lbnQoInRhYmxlIiksYixjLGQpCnQudG9T
-dHJpbmcKdD1uZXcgVy5lNyh0KQpyPXQuZ3I4KHQpCnIudG9TdHJpbmcKdD1uZXcgVy5lNyhyKQpxPXQu
-Z3I4KHQpCnMudG9TdHJpbmcKcS50b1N0cmluZwpuZXcgVy5lNyhzKS5GVigwLG5ldyBXLmU3KHEpKQpy
-ZXR1cm4gc319ClcuV1AucHJvdG90eXBlPXsKcjY6ZnVuY3Rpb24oYSxiLGMsZCl7dmFyIHQscyxyCmlm
-KCJjcmVhdGVDb250ZXh0dWFsRnJhZ21lbnQiIGluIHdpbmRvdy5SYW5nZS5wcm90b3R5cGUpcmV0dXJu
-IHRoaXMuRFcoYSxiLGMsZCkKdD1kb2N1bWVudApzPXQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpCnQ9
-Qy5JZS5yNih0LmNyZWF0ZUVsZW1lbnQoInRhYmxlIiksYixjLGQpCnQudG9TdHJpbmcKdD1uZXcgVy5l
-Nyh0KQpyPXQuZ3I4KHQpCnMudG9TdHJpbmcKci50b1N0cmluZwpuZXcgVy5lNyhzKS5GVigwLG5ldyBX
-LmU3KHIpKQpyZXR1cm4gc319ClcueVkucHJvdG90eXBlPXsKcGs6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0
-LHMKYS50ZXh0Q29udGVudD1udWxsCnQ9YS5jb250ZW50CnQudG9TdHJpbmcKSi5iVCh0KQpzPXRoaXMu
-cjYoYSxiLG51bGwsYykKYS5jb250ZW50LmFwcGVuZENoaWxkKHMpfSwKWUM6ZnVuY3Rpb24oYSxiKXty
-ZXR1cm4gdGhpcy5wayhhLGIsbnVsbCl9LAokaXlZOjF9ClcudzYucHJvdG90eXBlPXt9ClcuSzUucHJv
-dG90eXBlPXsKUG86ZnVuY3Rpb24oYSxiLGMpe3ZhciB0PVcuUDEoYS5vcGVuKGIsYykpCnJldHVybiB0
-fSwKZ21XOmZ1bmN0aW9uKGEpe3JldHVybiBhLmxvY2F0aW9ufSwKJGlLNToxLAokaXY2OjF9ClcuQ20u
-cHJvdG90eXBlPXskaUNtOjF9ClcuQ1EucHJvdG90eXBlPXskaUNROjF9ClcudzQucHJvdG90eXBlPXsK
-dzpmdW5jdGlvbihhKXtyZXR1cm4iUmVjdGFuZ2xlICgiK0guZChhLmxlZnQpKyIsICIrSC5kKGEudG9w
-KSsiKSAiK0guZChhLndpZHRoKSsiIHggIitILmQoYS5oZWlnaHQpfSwKRE46ZnVuY3Rpb24oYSxiKXtp
-ZihiPT1udWxsKXJldHVybiExCnJldHVybiB1LnEuYyhiKSYmYS5sZWZ0PT09Yi5sZWZ0JiZhLnRvcD09
-PWIudG9wJiZhLndpZHRoPT09Yi53aWR0aCYmYS5oZWlnaHQ9PT1iLmhlaWdodH0sCmdpTzpmdW5jdGlv
-bihhKXtyZXR1cm4gVy5yRShDLkNELmdpTyhhLmxlZnQpLEMuQ0QuZ2lPKGEudG9wKSxDLkNELmdpTyhh
-LndpZHRoKSxDLkNELmdpTyhhLmhlaWdodCkpfX0KVy5yaC5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihh
-KXtyZXR1cm4gYS5sZW5ndGh9LApxOmZ1bmN0aW9uKGEsYil7SC5TYyhiKQppZihiPj4+MCE9PWJ8fGI+
-PWEubGVuZ3RoKXRocm93IEguYihQLkNmKGIsYSxudWxsLG51bGwsbnVsbCkpCnJldHVybiBhW2JdfSwK
-WTpmdW5jdGlvbihhLGIsYyl7dS5BLmIoYykKdGhyb3cgSC5iKFAuTDQoIkNhbm5vdCBhc3NpZ24gZWxl
-bWVudCBvZiBpbW11dGFibGUgTGlzdC4iKSl9LApFOmZ1bmN0aW9uKGEsYil7aWYoYjwwfHxiPj1hLmxl
-bmd0aClyZXR1cm4gSC5PSChhLGIpCnJldHVybiBhW2JdfSwKJGliUToxLAokaVhqOjEsCiRpY1g6MSwK
-JGl6TToxfQpXLmNmLnByb3RvdHlwZT17Cks6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwCnUuRi5i
-KGIpCmZvcih0PXRoaXMuZ1YoKSxzPXQubGVuZ3RoLHI9dGhpcy5hLHE9MDtxPHQubGVuZ3RoO3QubGVu
-Z3RoPT09c3x8KDAsSC5saykodCksKytxKXtwPXRbcV0KYi4kMihwLHIuZ2V0QXR0cmlidXRlKHApKX19
-LApnVjpmdW5jdGlvbigpe3ZhciB0LHMscixxLHA9dGhpcy5hLmF0dHJpYnV0ZXMsbz1ILlZNKFtdLHUu
-cykKZm9yKHQ9cC5sZW5ndGgscz11Lmg5LHI9MDtyPHQ7KytyKXtpZihyPj1wLmxlbmd0aClyZXR1cm4g
-SC5PSChwLHIpCnE9cy5iKHBbcl0pCmlmKHEubmFtZXNwYWNlVVJJPT1udWxsKUMuTm0uaShvLHEubmFt
-ZSl9cmV0dXJuIG99LApnbDA6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuZ1YoKS5sZW5ndGg9PT0wfX0K
-Vy5pNy5wcm90b3R5cGU9ewp4NDpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hLmhhc0F0dHJpYnV0ZShh
-KX0sCnE6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhpcy5hLmdldEF0dHJpYnV0ZShILnkoYikpfSwKWTpm
-dW5jdGlvbihhLGIsYyl7dGhpcy5hLnNldEF0dHJpYnV0ZShiLGMpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0
-dXJuIHRoaXMuZ1YoKS5sZW5ndGh9fQpXLlN5LnByb3RvdHlwZT17Cng0OmZ1bmN0aW9uKGEpe3JldHVy
-biB0aGlzLmEuYS5oYXNBdHRyaWJ1dGUoImRhdGEtIit0aGlzLk8oYSkpfSwKcTpmdW5jdGlvbihhLGIp
-e3JldHVybiB0aGlzLmEuYS5nZXRBdHRyaWJ1dGUoImRhdGEtIit0aGlzLk8oSC55KGIpKSl9LApZOmZ1
-bmN0aW9uKGEsYixjKXt0aGlzLmEuYS5zZXRBdHRyaWJ1dGUoImRhdGEtIit0aGlzLk8oYiksYyl9LApL
-OmZ1bmN0aW9uKGEsYil7dGhpcy5hLksoMCxuZXcgVy5LUyh0aGlzLHUuRi5iKGIpKSl9LApnVjpmdW5j
-dGlvbigpe3ZhciB0PUguVk0oW10sdS5zKQp0aGlzLmEuSygwLG5ldyBXLkEzKHRoaXMsdCkpCnJldHVy
-biB0fSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuZ1YoKS5sZW5ndGh9LApnbDA6ZnVuY3Rpb24o
-YSl7cmV0dXJuIHRoaXMuZ1YoKS5sZW5ndGg9PT0wfSwKazpmdW5jdGlvbihhKXt2YXIgdCxzLHI9SC5W
-TShhLnNwbGl0KCItIiksdS5zKQpmb3IodD0xO3Q8ci5sZW5ndGg7Kyt0KXtzPXJbdF0KaWYocy5sZW5n
-dGg+MClDLk5tLlkocix0LHNbMF0udG9VcHBlckNhc2UoKStKLktWKHMsMSkpfXJldHVybiBDLk5tLkgo
-ciwiIil9LApPOmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxLHAKZm9yKHQ9YS5sZW5ndGgscz0wLHI9IiI7
-czx0Oysrcyl7cT1hW3NdCnA9cS50b0xvd2VyQ2FzZSgpCnI9KHEhPT1wJiZzPjA/cisiLSI6cikrcH1y
-ZXR1cm4gci5jaGFyQ29kZUF0KDApPT0wP3I6cn19ClcuS1MucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24o
-YSxiKXtpZihKLnJZKGEpLm4oYSwiZGF0YS0iKSl0aGlzLmIuJDIodGhpcy5hLmsoQy54Qi5HKGEsNSkp
-LGIpfSwKJFM6MTR9ClcuQTMucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXtpZihKLnJZKGEpLm4o
-YSwiZGF0YS0iKSlDLk5tLmkodGhpcy5iLHRoaXMuYS5rKEMueEIuRyhhLDUpKSl9LAokUzoxNH0KVy5J
-NC5wcm90b3R5cGU9ewpERzpmdW5jdGlvbigpe3ZhciB0LHMscixxLHA9UC5Mcyh1Lk4pCmZvcih0PXRo
-aXMuYS5jbGFzc05hbWUuc3BsaXQoIiAiKSxzPXQubGVuZ3RoLHI9MDtyPHM7KytyKXtxPUouVDAodFty
-XSkKaWYocS5sZW5ndGghPT0wKXAuaSgwLHEpfXJldHVybiBwfSwKWDpmdW5jdGlvbihhKXt0aGlzLmEu
-Y2xhc3NOYW1lPXUuQy5iKGEpLkgoMCwiICIpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS5j
-bGFzc0xpc3QubGVuZ3RofSwKVjE6ZnVuY3Rpb24oYSl7dGhpcy5hLmNsYXNzTmFtZT0iIn0sCnRnOmZ1
-bmN0aW9uKGEsYil7dmFyIHQ9dGhpcy5hLmNsYXNzTGlzdC5jb250YWlucyhiKQpyZXR1cm4gdH0sCmk6
-ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEuY2xhc3NMaXN0LHM9dC5jb250YWlucyhiKQp0LmFkZChi
-KQpyZXR1cm4hc30sClI6ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEuY2xhc3NMaXN0LHM9dC5jb250
-YWlucyhiKQp0LnJlbW92ZShiKQpyZXR1cm4gc30sCkZWOmZ1bmN0aW9uKGEsYil7Vy5UTih0aGlzLmEs
-dS5YLmIoYikpfX0KVy5Gay5wcm90b3R5cGU9e30KVy5STy5wcm90b3R5cGU9e30KVy5ldS5wcm90b3R5
-cGU9e30KVy54Qy5wcm90b3R5cGU9e30KVy52Ti5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1
-cm4gdGhpcy5hLiQxKHUuQi5iKGEpKX0sCiRTOjI3fQpXLkpRLnByb3RvdHlwZT17CkNZOmZ1bmN0aW9u
-KGEpe3ZhciB0CmlmKCQub3IuYT09PTApe2Zvcih0PTA7dDwyNjI7Kyt0KSQub3IuWSgwLEMuY21bdF0s
-Vy5wUygpKQpmb3IodD0wO3Q8MTI7Kyt0KSQub3IuWSgwLEMuQklbdF0sVy5WNCgpKX19LAppMDpmdW5j
-dGlvbihhKXtyZXR1cm4gJC5BTigpLnRnKDAsVy5yUyhhKSl9LApFYjpmdW5jdGlvbihhLGIsYyl7dmFy
-IHQ9JC5vci5xKDAsSC5kKFcuclMoYSkpKyI6OiIrYikKaWYodD09bnVsbCl0PSQub3IucSgwLCIqOjoi
-K2IpCmlmKHQ9PW51bGwpcmV0dXJuITEKcmV0dXJuIEgueGQodC4kNChhLGIsYyx0aGlzKSl9LAokaWtG
-OjF9ClcuR20ucHJvdG90eXBlPXsKZ2t6OmZ1bmN0aW9uKGEpe3JldHVybiBuZXcgVy5XOShhLHRoaXMu
-Z0EoYSksSC56SyhhKS5DKCJXOTxHbS5FPiIpKX19ClcudkQucHJvdG90eXBlPXsKaTA6ZnVuY3Rpb24o
-YSl7cmV0dXJuIEMuTm0uVnIodGhpcy5hLG5ldyBXLlV2KGEpKX0sCkViOmZ1bmN0aW9uKGEsYixjKXty
-ZXR1cm4gQy5ObS5Wcih0aGlzLmEsbmV3IFcuRWcoYSxiLGMpKX0sCiRpa0Y6MX0KVy5Vdi5wcm90b3R5
-cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gdS5lLmIoYSkuaTAodGhpcy5hKX0sCiRTOjE1fQpXLkVn
-LnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVybiB1LmUuYihhKS5FYih0aGlzLmEsdGhpcy5i
-LHRoaXMuYyl9LAokUzoxNX0KVy5tNi5wcm90b3R5cGU9ewpDWTpmdW5jdGlvbihhLGIsYyxkKXt2YXIg
-dCxzLHIKdGhpcy5hLkZWKDAsYykKdD1iLmV2KDAsbmV3IFcuRW8oKSkKcz1iLmV2KDAsbmV3IFcuV2so
-KSkKdGhpcy5iLkZWKDAsdCkKcj10aGlzLmMKci5GVigwLEMueEQpCnIuRlYoMCxzKX0sCmkwOmZ1bmN0
-aW9uKGEpe3JldHVybiB0aGlzLmEudGcoMCxXLnJTKGEpKX0sCkViOmZ1bmN0aW9uKGEsYixjKXt2YXIg
-dD10aGlzLHM9Vy5yUyhhKSxyPXQuYwppZihyLnRnKDAsSC5kKHMpKyI6OiIrYikpcmV0dXJuIHQuZC5E
-dChjKQplbHNlIGlmKHIudGcoMCwiKjo6IitiKSlyZXR1cm4gdC5kLkR0KGMpCmVsc2V7cj10LmIKaWYo
-ci50ZygwLEguZChzKSsiOjoiK2IpKXJldHVybiEwCmVsc2UgaWYoci50ZygwLCIqOjoiK2IpKXJldHVy
-biEwCmVsc2UgaWYoci50ZygwLEguZChzKSsiOjoqIikpcmV0dXJuITAKZWxzZSBpZihyLnRnKDAsIio6
-OioiKSlyZXR1cm4hMH1yZXR1cm4hMX0sCiRpa0Y6MX0KVy5Fby5wcm90b3R5cGU9ewokMTpmdW5jdGlv
-bihhKXtyZXR1cm4hQy5ObS50ZyhDLkJJLEgueShhKSl9LAokUzo3fQpXLldrLnByb3RvdHlwZT17CiQx
-OmZ1bmN0aW9uKGEpe3JldHVybiBDLk5tLnRnKEMuQkksSC55KGEpKX0sCiRTOjd9ClcuY3QucHJvdG90
-eXBlPXsKRWI6ZnVuY3Rpb24oYSxiLGMpe2lmKHRoaXMuakYoYSxiLGMpKXJldHVybiEwCmlmKGI9PT0i
-dGVtcGxhdGUiJiZjPT09IiIpcmV0dXJuITAKaWYoYS5nZXRBdHRyaWJ1dGUoInRlbXBsYXRlIik9PT0i
-IilyZXR1cm4gdGhpcy5lLnRnKDAsYikKcmV0dXJuITF9fQpXLklBLnByb3RvdHlwZT17CiQxOmZ1bmN0
-aW9uKGEpe3JldHVybiJURU1QTEFURTo6IitILmQoSC55KGEpKX0sCiRTOjV9ClcuT3cucHJvdG90eXBl
-PXsKaTA6ZnVuY3Rpb24oYSl7dmFyIHQKaWYodS5hTy5jKGEpKXJldHVybiExCnQ9dS5nNy5jKGEpCmlm
-KHQmJlcuclMoYSk9PT0iZm9yZWlnbk9iamVjdCIpcmV0dXJuITEKaWYodClyZXR1cm4hMApyZXR1cm4h
-MX0sCkViOmZ1bmN0aW9uKGEsYixjKXtpZihiPT09ImlzInx8Qy54Qi5uKGIsIm9uIikpcmV0dXJuITEK
-cmV0dXJuIHRoaXMuaTAoYSl9LAokaWtGOjF9ClcuVzkucHJvdG90eXBlPXsKRjpmdW5jdGlvbigpe3Zh
-ciB0PXRoaXMscz10LmMrMSxyPXQuYgppZihzPHIpe3Quc3AoSi53Mih0LmEscykpCnQuYz1zCnJldHVy
-biEwfXQuc3AobnVsbCkKdC5jPXIKcmV0dXJuITF9LApnbDpmdW5jdGlvbigpe3JldHVybiB0aGlzLmR9
-LApzcDpmdW5jdGlvbihhKXt0aGlzLmQ9dGhpcy4kdGkuZC5iKGEpfSwKJGlBbjoxfQpXLmRXLnByb3Rv
-dHlwZT17CmdtVzpmdW5jdGlvbihhKXtyZXR1cm4gVy5ISCh0aGlzLmEubG9jYXRpb24pfSwKJGlEMDox
-LAokaXY2OjF9ClcuRmIucHJvdG90eXBlPXt9Clcua0YucHJvdG90eXBlPXt9ClcubWsucHJvdG90eXBl
-PXskaXkwOjF9ClcuS28ucHJvdG90eXBlPXsKUG46ZnVuY3Rpb24oYSl7bmV3IFcuZm0odGhpcykuJDIo
-YSxudWxsKX0sCkVQOmZ1bmN0aW9uKGEsYil7aWYoYj09bnVsbClKLkx0KGEpCmVsc2UgYi5yZW1vdmVD
-aGlsZChhKX0sCkk0OmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEscCxvPSEwLG49bnVsbCxtPW51bGwK
-dHJ5e249Si5pZyhhKQptPW4uYS5nZXRBdHRyaWJ1dGUoImlzIikKdS5oLmIoYSkKdD1mdW5jdGlvbihj
-KXtpZighKGMuYXR0cmlidXRlcyBpbnN0YW5jZW9mIE5hbWVkTm9kZU1hcCkpcmV0dXJuIHRydWUKdmFy
-IGw9Yy5jaGlsZE5vZGVzCmlmKGMubGFzdENoaWxkJiZjLmxhc3RDaGlsZCE9PWxbbC5sZW5ndGgtMV0p
-cmV0dXJuIHRydWUKaWYoYy5jaGlsZHJlbilpZighKGMuY2hpbGRyZW4gaW5zdGFuY2VvZiBIVE1MQ29s
-bGVjdGlvbnx8Yy5jaGlsZHJlbiBpbnN0YW5jZW9mIE5vZGVMaXN0KSlyZXR1cm4gdHJ1ZQp2YXIgaz0w
-CmlmKGMuY2hpbGRyZW4paz1jLmNoaWxkcmVuLmxlbmd0aApmb3IodmFyIGo9MDtqPGs7aisrKXt2YXIg
-aT1jLmNoaWxkcmVuW2pdCmlmKGkuaWQ9PSdhdHRyaWJ1dGVzJ3x8aS5uYW1lPT0nYXR0cmlidXRlcyd8
-fGkuaWQ9PSdsYXN0Q2hpbGQnfHxpLm5hbWU9PSdsYXN0Q2hpbGQnfHxpLmlkPT0nY2hpbGRyZW4nfHxp
-Lm5hbWU9PSdjaGlsZHJlbicpcmV0dXJuIHRydWV9cmV0dXJuIGZhbHNlfShhKQpvPUgub1QodCk/ITA6
-IShhLmF0dHJpYnV0ZXMgaW5zdGFuY2VvZiBOYW1lZE5vZGVNYXApfWNhdGNoKHEpe0guUnUocSl9cz0i
-ZWxlbWVudCB1bnByaW50YWJsZSIKdHJ5e3M9Si5qKGEpfWNhdGNoKHEpe0guUnUocSl9dHJ5e3I9Vy5y
-UyhhKQp0aGlzLmtSKHUuaC5iKGEpLGIsbyxzLHIsdS5HLmIobiksSC55KG0pKX1jYXRjaChxKXtpZihI
-LlJ1KHEpIGluc3RhbmNlb2YgUC51KXRocm93IHEKZWxzZXt0aGlzLkVQKGEsYikKd2luZG93CnA9IlJl
-bW92aW5nIGNvcnJ1cHRlZCBlbGVtZW50ICIrSC5kKHMpCmlmKHR5cGVvZiBjb25zb2xlIT0idW5kZWZp
-bmVkIil3aW5kb3cuY29uc29sZS53YXJuKHApfX19LAprUjpmdW5jdGlvbihhLGIsYyxkLGUsZixnKXt2
-YXIgdCxzLHIscSxwLG8sbj10aGlzCmlmKGMpe24uRVAoYSxiKQp3aW5kb3cKdD0iUmVtb3ZpbmcgZWxl
-bWVudCBkdWUgdG8gY29ycnVwdGVkIGF0dHJpYnV0ZXMgb24gPCIrZCsiPiIKaWYodHlwZW9mIGNvbnNv
-bGUhPSJ1bmRlZmluZWQiKXdpbmRvdy5jb25zb2xlLndhcm4odCkKcmV0dXJufWlmKCFuLmEuaTAoYSkp
-e24uRVAoYSxiKQp3aW5kb3cKdD0iUmVtb3ZpbmcgZGlzYWxsb3dlZCBlbGVtZW50IDwiK0guZChlKSsi
-PiBmcm9tICIrSC5kKGIpCmlmKHR5cGVvZiBjb25zb2xlIT0idW5kZWZpbmVkIil3aW5kb3cuY29uc29s
-ZS53YXJuKHQpCnJldHVybn1pZihnIT1udWxsKWlmKCFuLmEuRWIoYSwiaXMiLGcpKXtuLkVQKGEsYikK
-d2luZG93CnQ9IlJlbW92aW5nIGRpc2FsbG93ZWQgdHlwZSBleHRlbnNpb24gPCIrSC5kKGUpKycgaXM9
-IicrZysnIj4nCmlmKHR5cGVvZiBjb25zb2xlIT0idW5kZWZpbmVkIil3aW5kb3cuY29uc29sZS53YXJu
-KHQpCnJldHVybn10PWYuZ1YoKQpzPUguVk0odC5zbGljZSgwKSxILnQ2KHQpLkMoImpkPDE+IikpCmZv
-cihyPWYuZ1YoKS5sZW5ndGgtMSx0PWYuYTtyPj0wOy0tcil7aWYocj49cy5sZW5ndGgpcmV0dXJuIEgu
-T0gocyxyKQpxPXNbcl0KcD1uLmEKbz1KLmNIKHEpCkgueShxKQppZighcC5FYihhLG8sdC5nZXRBdHRy
-aWJ1dGUocSkpKXt3aW5kb3cKcD0iUmVtb3ZpbmcgZGlzYWxsb3dlZCBhdHRyaWJ1dGUgPCIrSC5kKGUp
-KyIgIitxKyc9IicrSC5kKHQuZ2V0QXR0cmlidXRlKHEpKSsnIj4nCmlmKHR5cGVvZiBjb25zb2xlIT0i
-dW5kZWZpbmVkIil3aW5kb3cuY29uc29sZS53YXJuKHApCnQucmVtb3ZlQXR0cmlidXRlKHEpfX1pZih1
-LmFXLmMoYSkpbi5QbihhLmNvbnRlbnQpfSwKJGlvbjoxfQpXLmZtLnByb3RvdHlwZT17CiQyOmZ1bmN0
-aW9uKGEsYil7dmFyIHQscyxyLHEscD10aGlzLmEKc3dpdGNoKGEubm9kZVR5cGUpe2Nhc2UgMTpwLkk0
-KGEsYikKYnJlYWsKY2FzZSA4OmNhc2UgMTE6Y2FzZSAzOmNhc2UgNDpicmVhawpkZWZhdWx0OnAuRVAo
-YSxiKX10PWEubGFzdENoaWxkCmZvcihwPXUuQTtudWxsIT10Oyl7cz1udWxsCnRyeXtzPXQucHJldmlv
-dXNTaWJsaW5nfWNhdGNoKHIpe0guUnUocikKcT1wLmIodCkKYS5yZW1vdmVDaGlsZChxKQp0PW51bGwK
-cz1hLmxhc3RDaGlsZH1pZih0IT1udWxsKXRoaXMuJDIodCxhKQp0PXAuYihzKX19LAokUzozMH0KVy5M
-ZS5wcm90b3R5cGU9e30KVy5LNy5wcm90b3R5cGU9e30KVy5yQi5wcm90b3R5cGU9e30KVy5YVy5wcm90
-b3R5cGU9e30KVy5vYS5wcm90b3R5cGU9e30KUC5pSi5wcm90b3R5cGU9ewpWSDpmdW5jdGlvbihhKXt2
-YXIgdCxzPXRoaXMuYSxyPXMubGVuZ3RoCmZvcih0PTA7dDxyOysrdClpZihzW3RdPT09YSlyZXR1cm4g
-dApDLk5tLmkocyxhKQpDLk5tLmkodGhpcy5iLG51bGwpCnJldHVybiByfSwKUHY6ZnVuY3Rpb24oYSl7
-dmFyIHQscyxyLHE9dGhpcyxwPXt9CmlmKGE9PW51bGwpcmV0dXJuIGEKaWYoSC5sKGEpKXJldHVybiBh
-CmlmKHR5cGVvZiBhPT0ibnVtYmVyIilyZXR1cm4gYQppZih0eXBlb2YgYT09InN0cmluZyIpcmV0dXJu
-IGEKaWYoYSBpbnN0YW5jZW9mIFAuaVApcmV0dXJuIG5ldyBEYXRlKGEuYSkKaWYodS5mdi5jKGEpKXRo
-cm93IEguYihQLlNZKCJzdHJ1Y3R1cmVkIGNsb25lIG9mIFJlZ0V4cCIpKQppZih1LmM4LmMoYSkpcmV0
-dXJuIGEKaWYodS5kLmMoYSkpcmV0dXJuIGEKaWYodS5JLmMoYSkpcmV0dXJuIGEKdD11LmRELmMoYSl8
-fCExCmlmKHQpcmV0dXJuIGEKaWYodS5HLmMoYSkpe3M9cS5WSChhKQp0PXEuYgppZihzPj10Lmxlbmd0
-aClyZXR1cm4gSC5PSCh0LHMpCnI9cC5hPXRbc10KaWYociE9bnVsbClyZXR1cm4gcgpyPXt9CnAuYT1y
-CkMuTm0uWSh0LHMscikKYS5LKDAsbmV3IFAubFIocCxxKSkKcmV0dXJuIHAuYX1pZih1LmouYyhhKSl7
-cz1xLlZIKGEpCnA9cS5iCmlmKHM+PXAubGVuZ3RoKXJldHVybiBILk9IKHAscykKcj1wW3NdCmlmKHIh
-PW51bGwpcmV0dXJuIHIKcmV0dXJuIHEuZWsoYSxzKX1pZih1LmVILmMoYSkpe3M9cS5WSChhKQp0PXEu
-YgppZihzPj10Lmxlbmd0aClyZXR1cm4gSC5PSCh0LHMpCnI9cC5iPXRbc10KaWYociE9bnVsbClyZXR1
-cm4gcgpyPXt9CnAuYj1yCkMuTm0uWSh0LHMscikKcS5pbShhLG5ldyBQLmpnKHAscSkpCnJldHVybiBw
-LmJ9dGhyb3cgSC5iKFAuU1koInN0cnVjdHVyZWQgY2xvbmUgb2Ygb3RoZXIgdHlwZSIpKX0sCmVrOmZ1
-bmN0aW9uKGEsYil7dmFyIHQscz1KLlU2KGEpLHI9cy5nQShhKSxxPW5ldyBBcnJheShyKQpDLk5tLlko
-dGhpcy5iLGIscSkKZm9yKHQ9MDt0PHI7Kyt0KUMuTm0uWShxLHQsdGhpcy5QdihzLnEoYSx0KSkpCnJl
-dHVybiBxfX0KUC5sUi5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3RoaXMuYS5hW2FdPXRoaXMu
-Yi5QdihiKX0sCiRTOjR9ClAuamcucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt0aGlzLmEuYlth
-XT10aGlzLmIuUHYoYil9LAokUzo0fQpQLkJmLnByb3RvdHlwZT17CmltOmZ1bmN0aW9uKGEsYil7dmFy
-IHQscyxyLHEKdS5iOC5iKGIpCmZvcih0PU9iamVjdC5rZXlzKGEpLHM9dC5sZW5ndGgscj0wO3I8czsr
-K3Ipe3E9dFtyXQpiLiQyKHEsYVtxXSl9fX0KUC5Bcy5wcm90b3R5cGU9ewpUOmZ1bmN0aW9uKGEpe3Zh
-ciB0CkgueShhKQp0PSQuaEcoKS5iCmlmKHR5cGVvZiBhIT0ic3RyaW5nIilILnZoKEgudEwoYSkpCmlm
-KHQudGVzdChhKSlyZXR1cm4gYQp0aHJvdyBILmIoUC5MMyhhLCJ2YWx1ZSIsIk5vdCBhIHZhbGlkIGNs
-YXNzIHRva2VuIikpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5ERygpLkgoMCwiICIpfSwKZ2t6
-OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuREcoKQpyZXR1cm4gUC5yaih0LHQucixILkxoKHQpLmQpfSwK
-Z0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuREcoKS5hfSwKdGc6ZnVuY3Rpb24oYSxiKXt0aGlzLlQo
-YikKcmV0dXJuIHRoaXMuREcoKS50ZygwLGIpfSwKaTpmdW5jdGlvbihhLGIpe3RoaXMuVChiKQpyZXR1
-cm4gSC54ZCh0aGlzLk9TKG5ldyBQLkdFKGIpKSl9LApSOmZ1bmN0aW9uKGEsYil7dmFyIHQscwp0aGlz
-LlQoYikKdD10aGlzLkRHKCkKcz10LlIoMCxiKQp0aGlzLlgodCkKcmV0dXJuIHN9LApGVjpmdW5jdGlv
-bihhLGIpe3RoaXMuT1MobmV3IFAuTjcodGhpcyx1LlguYihiKSkpfSwKVjE6ZnVuY3Rpb24oYSl7dGhp
-cy5PUyhuZXcgUC51USgpKX0sCk9TOmZ1bmN0aW9uKGEpe3ZhciB0LHMKdS5jaC5iKGEpCnQ9dGhpcy5E
-RygpCnM9YS4kMSh0KQp0aGlzLlgodCkKcmV0dXJuIHN9fQpQLkdFLnByb3RvdHlwZT17CiQxOmZ1bmN0
-aW9uKGEpe3JldHVybiB1LkMuYihhKS5pKDAsdGhpcy5hKX0sCiRTOjMxfQpQLk43LnByb3RvdHlwZT17
-CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYixzPUgudDYodCkKcmV0dXJuIHUuQy5iKGEpLkZWKDAs
-bmV3IEguQTgodCxzLkMoInFVKDEpIikuYih0aGlzLmEuZ3VNKCkpLHMuQygiQTg8MSxxVT4iKSkpfSwK
-JFM6MTF9ClAudVEucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dS5DLmIoYSkKaWYoYS5hPjApe2Eu
-Yj1hLmM9YS5kPWEuZT1hLmY9bnVsbAphLmE9MAphLlMoKX1yZXR1cm4gbnVsbH0sCiRTOjExfQpQLmhG
-LnByb3RvdHlwZT17JGloRjoxfQpQLlBDLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0CnUu
-Wi5iKGEpCnQ9ZnVuY3Rpb24oYixjLGQpe3JldHVybiBmdW5jdGlvbigpe3JldHVybiBiKGMsZCx0aGlz
-LEFycmF5LnByb3RvdHlwZS5zbGljZS5hcHBseShhcmd1bWVudHMpKX19KFAuUjQsYSwhMSkKUC5EbSh0
-LCQudygpLGEpCnJldHVybiB0fSwKJFM6MX0KUC5tdC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXty
-ZXR1cm4gbmV3IHRoaXMuYShhKX0sCiRTOjF9ClAuTnoucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7
-cmV0dXJuIG5ldyBQLnI3KGEpfSwKJFM6MzN9ClAuUVMucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7
-cmV0dXJuIG5ldyBQLlR6KGEsdS5hbSl9LAokUzozNH0KUC5ucC5wcm90b3R5cGU9ewokMTpmdW5jdGlv
-bihhKXtyZXR1cm4gbmV3IFAuRTQoYSl9LAokUzozNX0KUC5FNC5wcm90b3R5cGU9ewpxOmZ1bmN0aW9u
-KGEsYil7aWYodHlwZW9mIGIhPSJzdHJpbmciJiZ0eXBlb2YgYiE9Im51bWJlciIpdGhyb3cgSC5iKFAu
-eFkoInByb3BlcnR5IGlzIG5vdCBhIFN0cmluZyBvciBudW0iKSkKcmV0dXJuIFAuTDcodGhpcy5hW2Jd
-KX0sClk6ZnVuY3Rpb24oYSxiLGMpe2lmKHR5cGVvZiBiIT0ic3RyaW5nIiYmdHlwZW9mIGIhPSJudW1i
-ZXIiKXRocm93IEguYihQLnhZKCJwcm9wZXJ0eSBpcyBub3QgYSBTdHJpbmcgb3IgbnVtIikpCnRoaXMu
-YVtiXT1QLndZKGMpfSwKRE46ZnVuY3Rpb24oYSxiKXtpZihiPT1udWxsKXJldHVybiExCnJldHVybiBi
-IGluc3RhbmNlb2YgUC5FNCYmdGhpcy5hPT09Yi5hfSwKdzpmdW5jdGlvbihhKXt2YXIgdCxzCnRyeXt0
-PVN0cmluZyh0aGlzLmEpCnJldHVybiB0fWNhdGNoKHMpe0guUnUocykKdD10aGlzLnhiKDApCnJldHVy
-biB0fX0sClY3OmZ1bmN0aW9uKGEsYil7dmFyIHQscz10aGlzLmEKaWYoYj09bnVsbCl0PW51bGwKZWxz
-ZXt0PUgudDYoYikKdD1QLkNIKG5ldyBILkE4KGIsdC5DKCJAKDEpIikuYihQLmlHKCkpLHQuQygiQTg8
-MSxAPiIpKSwhMCx1LnopfXJldHVybiBQLkw3KHNbYV0uYXBwbHkocyx0KSl9LApnaU86ZnVuY3Rpb24o
-YSl7cmV0dXJuIDB9fQpQLnI3LnByb3RvdHlwZT17fQpQLlR6LnByb3RvdHlwZT17CmNQOmZ1bmN0aW9u
-KGEpe3ZhciB0PXRoaXMscz1hPDB8fGE+PXQuZ0EodCkKaWYocyl0aHJvdyBILmIoUC5URShhLDAsdC5n
-QSh0KSxudWxsLG51bGwpKX0sCnE6ZnVuY3Rpb24oYSxiKXtpZih0eXBlb2YgYj09Im51bWJlciImJmI9
-PT1DLmpuLnl1KGIpKXRoaXMuY1AoSC5TYyhiKSkKcmV0dXJuIHRoaXMuJHRpLmQuYih0aGlzLlVyKDAs
-YikpfSwKWTpmdW5jdGlvbihhLGIsYyl7dmFyIHQKdGhpcy4kdGkuZC5iKGMpCnQ9Qy5qbi55dShiKQpp
-ZihiPT09dCl0aGlzLmNQKGIpCnRoaXMuZTQoMCxiLGMpfSwKZ0E6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhp
-cy5hLmxlbmd0aAppZih0eXBlb2YgdD09PSJudW1iZXIiJiZ0Pj4+MD09PXQpcmV0dXJuIHQKdGhyb3cg
-SC5iKFAuUFYoIkJhZCBKc0FycmF5IGxlbmd0aCIpKX0sCiRpYlE6MSwKJGljWDoxLAokaXpNOjF9ClAu
-Y28ucHJvdG90eXBlPXt9ClAubmQucHJvdG90eXBlPXskaW5kOjF9ClAuS2UucHJvdG90eXBlPXsKREc6
-ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwPXRoaXMuYS5nZXRBdHRyaWJ1dGUoImNsYXNzIiksbz1QLkxz
-KHUuTikKaWYocD09bnVsbClyZXR1cm4gbwpmb3IodD1wLnNwbGl0KCIgIikscz10Lmxlbmd0aCxyPTA7
-cjxzOysrcil7cT1KLlQwKHRbcl0pCmlmKHEubGVuZ3RoIT09MClvLmkoMCxxKX1yZXR1cm4gb30sClg6
-ZnVuY3Rpb24oYSl7dGhpcy5hLnNldEF0dHJpYnV0ZSgiY2xhc3MiLGEuSCgwLCIgIikpfX0KUC5kNS5w
-cm90b3R5cGU9ewpnUDpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFAuS2UoYSl9LApzaGY6ZnVuY3Rpb24o
-YSxiKXt0aGlzLllDKGEsYil9LApyNjpmdW5jdGlvbihhLGIsYyxkKXt2YXIgdCxzLHIscSxwLG8KaWYo
-ZD09bnVsbCl7dD1ILlZNKFtdLHUuaSkKZD1uZXcgVy52RCh0KQpDLk5tLmkodCxXLlR3KG51bGwpKQpD
-Lk5tLmkodCxXLkJsKCkpCkMuTm0uaSh0LG5ldyBXLk93KCkpfWM9bmV3IFcuS28oZCkKcz0nPHN2ZyB2
-ZXJzaW9uPSIxLjEiPicrSC5kKGIpKyI8L3N2Zz4iCnQ9ZG9jdW1lbnQKcj10LmJvZHkKcT0ociYmQy5S
-WSkuQUgocixzLGMpCnA9dC5jcmVhdGVEb2N1bWVudEZyYWdtZW50KCkKcS50b1N0cmluZwp0PW5ldyBX
-LmU3KHEpCm89dC5ncjgodCkKZm9yKDt0PW8uZmlyc3RDaGlsZCx0IT1udWxsOylwLmFwcGVuZENoaWxk
-KHQpCnJldHVybiBwfSwKbno6ZnVuY3Rpb24oYSxiLGMsZCxlKXt0aHJvdyBILmIoUC5MNCgiQ2Fubm90
-IGludm9rZSBpbnNlcnRBZGphY2VudEh0bWwgb24gU1ZHLiIpKX0sCmdWbDpmdW5jdGlvbihhKXtyZXR1
-cm4gbmV3IFcuZXUoYSwiY2xpY2siLCExLHUuUSl9LAokaWQ1OjF9ClAubjYucHJvdG90eXBlPXskaWJR
-OjEsJGljWDoxLCRpek06MSwkaWVxOjF9Ck0uSDcucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1
-cm4gdGhpcy5ifX0KVS5MTC5wcm90b3R5cGU9ewpMdDpmdW5jdGlvbigpe3JldHVybiBQLkVGKFsibm9k
-ZUlkIix0aGlzLmIsImtpbmQiLHRoaXMuYS5hXSx1Lk4sdS5LKX19ClUuTUQucHJvdG90eXBlPXsKJDE6
-ZnVuY3Rpb24oYSl7cmV0dXJuIHUuZ3AuYihhKS5hPT09dGhpcy5hLnEoMCwia2luZCIpfSwKJFM6MzZ9
-ClUuZDIucHJvdG90eXBlPXsKTHQ6ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwPXRoaXMsbz11Lk4sbj11
-LkssbT1QLkZsKG8sbiksbD1wLmEKaWYobCE9bnVsbCl7dD1ILlZNKFtdLHUuSikKZm9yKHM9bC5sZW5n
-dGgscj0wO3I8bC5sZW5ndGg7bC5sZW5ndGg9PT1zfHwoMCxILmxrKShsKSwrK3Ipe3E9bFtyXQpDLk5t
-LmkodCxQLkVGKFsiZGVzY3JpcHRpb24iLHEuYSwiaHJlZiIscS5iXSxvLG4pKX1tLlkoMCwiZWRpdHMi
-LHQpfW0uWSgwLCJleHBsYW5hdGlvbiIscC5iKQptLlkoMCwibGluZSIscC5jKQptLlkoMCwiZGlzcGxh
-eVBhdGgiLHAuZCkKbS5ZKDAsInVyaVBhdGgiLHAuZSkKbz1wLmYKaWYobyE9bnVsbCl7bj1ILlZNKFtd
-LHUuSikKZm9yKGw9by5sZW5ndGgscj0wO3I8by5sZW5ndGg7by5sZW5ndGg9PT1sfHwoMCxILmxrKShv
-KSwrK3IpQy5ObS5pKG4sb1tyXS5MdCgpKQptLlkoMCwidHJhY2VzIixuKX1yZXR1cm4gbX19ClUuU2Uu
-cHJvdG90eXBlPXsKTHQ6ZnVuY3Rpb24oKXtyZXR1cm4gUC5FRihbImRlc2NyaXB0aW9uIix0aGlzLmEs
-ImhyZWYiLHRoaXMuYl0sdS5OLHUuSyl9fQpVLk1sLnByb3RvdHlwZT17Ckx0OmZ1bmN0aW9uKCl7cmV0
-dXJuIFAuRUYoWyJocmVmIix0aGlzLmEsImxpbmUiLHRoaXMuYiwicGF0aCIsdGhpcy5jXSx1Lk4sdS5L
-KX19ClUueUQucHJvdG90eXBlPXsKTHQ6ZnVuY3Rpb24oKXt2YXIgdCxzLHIscT1ILlZNKFtdLHUuSikK
-Zm9yKHQ9dGhpcy5iLHM9dC5sZW5ndGgscj0wO3I8dC5sZW5ndGg7dC5sZW5ndGg9PT1zfHwoMCxILmxr
-KSh0KSwrK3IpQy5ObS5pKHEsdFtyXS5MdCgpKQpyZXR1cm4gUC5FRihbImRlc2NyaXB0aW9uIix0aGlz
-LmEsImVudHJpZXMiLHFdLHUuTix1LkspfX0KVS53Yi5wcm90b3R5cGU9ewpMdDpmdW5jdGlvbigpe3Zh
-ciB0LHMscj10aGlzLHE9UC5GbCh1Lk4sdS5LKQpxLlkoMCwiZGVzY3JpcHRpb24iLHIuYSkKdD1yLmIK
-aWYodCE9bnVsbClxLlkoMCwiZnVuY3Rpb24iLHQpCnQ9ci5jCmlmKHQhPW51bGwpcS5ZKDAsImxpbmsi
-LHQuTHQoKSkKdD1yLmQKaWYodC5sZW5ndGghPT0wKXtzPUgudDYodCkKcS5ZKDAsImhpbnRBY3Rpb25z
-IixuZXcgSC5BOCh0LHMuQygiWjA8cVUsaz4oMSkiKS5iKG5ldyBVLmIwKCkpLHMuQygiQTg8MSxaMDxx
-VSxrPj4iKSkuYnIoMCkpfXJldHVybiBxfX0KVS5hTi5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXty
-ZXR1cm4gVS5ueih1LlMuYShhKSl9LAokUzozN30KVS5iMC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihh
-KXtyZXR1cm4gdS5ELmIoYSkuTHQoKX0sCiRTOjM4fQpCLmo4LnByb3RvdHlwZT17Ckx0OmZ1bmN0aW9u
-KCl7cmV0dXJuIFAuRUYoWyJsaW5lIix0aGlzLmEsImV4cGxhbmF0aW9uIix0aGlzLmIsIm9mZnNldCIs
-dGhpcy5jXSx1Lk4sdS5LKX19CkIucXAucHJvdG90eXBlPXsKTHQ6ZnVuY3Rpb24oKXt2YXIgdCxzLHIs
-cSxwLG8sbixtPXRoaXMsbD11Lk4saz1QLkZsKGwsdS5kMykKZm9yKHQ9bS5kLHQ9dC5nUHUodCksdD10
-Lmdreih0KSxzPXUuSyxyPXUuSjt0LkYoKTspe3E9dC5nbCgpCnA9cS5hCm89SC5WTShbXSxyKQpmb3Io
-cT1KLklUKHEuYik7cS5GKCk7KXtuPXEuZ2woKQpDLk5tLmkobyxQLkVGKFsibGluZSIsbi5hLCJleHBs
-YW5hdGlvbiIsbi5iLCJvZmZzZXQiLG4uY10sbCxzKSl9ay5ZKDAscCxvKX1yZXR1cm4gUC5FRihbInJl
-Z2lvbnMiLG0uYSwibmF2aWdhdGlvbkNvbnRlbnQiLG0uYiwic291cmNlQ29kZSIsbS5jLCJlZGl0cyIs
-a10sbCxzKX19ClQubVEucHJvdG90eXBlPXt9CkwuZS5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2
-YXIgdCxzLHIscSxwLG8sbgp1LkIuYihhKQp0PXdpbmRvdy5sb2NhdGlvbi5wYXRobmFtZQpzPUwuRzYo
-d2luZG93LmxvY2F0aW9uLmhyZWYpCnI9TC5hSyh3aW5kb3cubG9jYXRpb24uaHJlZikKTC5HZSgpCmlm
-KHQhPT0iLyImJnQhPT1KLlQwKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIi5yb290IikudGV4dENvbnRl
-bnQpKUwuRzcodCxzLHIsITAsbmV3IEwuVlcodCxzLHIpKQpxPWRvY3VtZW50CnA9Si5xRihxLnF1ZXJ5
-U2VsZWN0b3IoIi5hcHBseS1taWdyYXRpb24iKSkKbz1wLiR0aQpuPW8uQygifigxKSIpLmIobmV3IEwu
-b1ooKSkKdS5NLmIobnVsbCkKVy5KRShwLmEscC5iLG4sITEsby5kKQpvPUoucUYocS5xdWVyeVNlbGVj
-dG9yKCIucmVydW4tbWlncmF0aW9uIikpCm49by4kdGkKVy5KRShvLmEsby5iLG4uQygifigxKSIpLmIo
-bmV3IEwueTgoKSksITEsbi5kKQpuPUoucUYocS5xdWVyeVNlbGVjdG9yKCIucmVwb3J0LXByb2JsZW0i
-KSkKbz1uLiR0aQpXLkpFKG4uYSxuLmIsby5DKCJ+KDEpIikuYihuZXcgTC5IaSgpKSwhMSxvLmQpCnE9
-Si5xRihxLnF1ZXJ5U2VsZWN0b3IoIi5wb3B1cC1wYW5lIC5jbG9zZSIpKQpvPXEuJHRpClcuSkUocS5h
-LHEuYixvLkMoIn4oMSkiKS5iKG5ldyBMLkJUKCkpLCExLG8uZCl9LAokUzoxNn0KTC5WVy5wcm90b3R5
-cGU9ewokMDpmdW5jdGlvbigpe0wuRnIodGhpcy5hLHRoaXMuYix0aGlzLmMpfSwKJFM6MH0KTC5vWi5w
-cm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzLHIscQp1LlYuYihhKQppZihILm9UKHdpbmRv
-dy5jb25maXJtKCJUaGlzIHdpbGwgYXBwbHkgdGhlIGNoYW5nZXMgeW91J3ZlIHByZXZpZXdlZCB0byB5
-b3VyIHdvcmtpbmcgZGlyZWN0b3J5LiBJdCBpcyByZWNvbW1lbmRlZCB5b3UgY29tbWl0IGFueSBjaGFu
-Z2VzIHlvdSBtYWRlIGJlZm9yZSBkb2luZyB0aGlzLiIpKSl7dD1MLnR5KCIvYXBwbHktbWlncmF0aW9u
-IixudWxsKS5XNyhuZXcgTC5qcigpLHUuUCkKcz1uZXcgTC5xbCgpCnUuYmYuYihudWxsKQpyPXQuJHRp
-CnE9JC5YMwppZihxIT09Qy5OVSlzPVAuVkgocyxxKQp0LnhmKG5ldyBQLkZlKG5ldyBQLnZzKHEsciks
-MixudWxsLHMsci5DKCJAPDE+IikuS3Eoci5kKS5DKCJGZTwxLDI+IikpKX19LAokUzozfQpMLmpyLnBy
-b3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0CnUuUy5iKGEpCnQ9ZG9jdW1lbnQuYm9keQp0LmNs
-YXNzTGlzdC5yZW1vdmUoInByb3Bvc2VkIikKdC5jbGFzc0xpc3QuYWRkKCJhcHBsaWVkIil9LAokUzo0
-MX0KTC5xbC5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe0wuQzIoIkNvdWxkIG5vdCBhcHBseSBt
-aWdyYXRpb24iLGEsYil9LAokQzoiJDIiLAokUjoyLAokUzo0fQpMLnk4LnByb3RvdHlwZT17CiQxOmZ1
-bmN0aW9uKGEpe3JldHVybiB0aGlzLnhuKHUuVi5iKGEpKX0sCnhuOmZ1bmN0aW9uKGEpe3ZhciB0PTAs
-cz1QLkZYKHUuUCkscj0xLHEscD1bXSxvLG4sbSxsCnZhciAkYXN5bmMkJDE9UC5seihmdW5jdGlvbihi
-LGMpe2lmKGI9PT0xKXtxPWMKdD1yfXdoaWxlKHRydWUpc3dpdGNoKHQpe2Nhc2UgMDpyPTMKZG9jdW1l
-bnQuYm9keS5jbGFzc0xpc3QuYWRkKCJyZXJ1bm5pbmciKQp0PTYKcmV0dXJuIFAualEoTC50eSgiL3Jl
-cnVuLW1pZ3JhdGlvbiIsbnVsbCksJGFzeW5jJCQxKQpjYXNlIDY6d2luZG93LmxvY2F0aW9uLnJlbG9h
-ZCgpCnAucHVzaCg1KQp0PTQKYnJlYWsKY2FzZSAzOnI9MgpsPXEKbz1ILlJ1KGwpCm49SC50cyhsKQpM
-LkMyKCJGYWlsZWQgdG8gcmVydW4gbWlncmF0aW9uIixvLG4pCnAucHVzaCg1KQp0PTQKYnJlYWsKY2Fz
-ZSAyOnA9WzFdCmNhc2UgNDpyPTEKZG9jdW1lbnQuYm9keS5jbGFzc0xpc3QucmVtb3ZlKCJyZXJ1bm5p
-bmciKQp0PXAucG9wKCkKYnJlYWsKY2FzZSA1OnJldHVybiBQLnlDKG51bGwscykKY2FzZSAxOnJldHVy
-biBQLmYzKHEscyl9fSkKcmV0dXJuIFAuREkoJGFzeW5jJCQxLHMpfSwKJFM6MTd9CkwuSGkucHJvdG90
-eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQKdS5WLmIoYSkKdD11Lk4KQy5vbC5Qbyh3aW5kb3csUC5Y
-ZCgiaHR0cHMiLCJnaXRodWIuY29tIiwiZGFydC1sYW5nL3Nkay9pc3N1ZXMvbmV3IixQLkVGKFsidGl0
-bGUiLCJDdXN0b21lci1yZXBvcnRlZCBpc3N1ZSB3aXRoIE5OQkQgbWlncmF0aW9uIHRvb2wiLCJsYWJl
-bHMiLCJhcmVhLWFuYWx5emVyLGFuYWx5emVyLW5uYmQtbWlncmF0aW9uLHR5cGUtYnVnIiwiYm9keSIs
-IiMjIyMgU3RlcHMgdG8gcmVwcm9kdWNlXG5cbiMjIyMgV2hhdCBkaWQgeW91IGV4cGVjdCB0byBoYXBw
-ZW4/XG5cbiMjIyMgV2hhdCBhY3R1YWxseSBoYXBwZW5lZD9cblxuX1NjcmVlbnNob3RzIGFyZSBhcHBy
-ZWNpYXRlZF9cblxuKipEYXJ0IFNESyB2ZXJzaW9uKio6ICIrSC5kKGRvY3VtZW50LmdldEVsZW1lbnRC
-eUlkKCJzZGstdmVyc2lvbiIpLnRleHRDb250ZW50KSsiXG5cblRoYW5rcyBmb3IgZmlsaW5nIVxuIl0s
-dCx0KSkudygwKSwicmVwb3J0LXByb2JsZW0iKX0sCiRTOjN9CkwuQlQucHJvdG90eXBlPXsKJDE6ZnVu
-Y3Rpb24oYSl7dmFyIHQKdS5WLmIoYSkKdD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucG9wdXAtcGFu
-ZSIpLnN0eWxlCnJldHVybiB0LmRpc3BsYXk9Im5vbmUifSwKJFM6NDN9CkwuTC5wcm90b3R5cGU9ewok
-MTpmdW5jdGlvbihhKXt2YXIgdCxzLHIKdS5CLmIoYSkKdD13aW5kb3cubG9jYXRpb24ucGF0aG5hbWUK
-cz1MLkc2KHdpbmRvdy5sb2NhdGlvbi5ocmVmKQpyPUwuYUsod2luZG93LmxvY2F0aW9uLmhyZWYpCmlm
-KHQubGVuZ3RoPjEpTC5HNyh0LHMsciwhMSxudWxsKQplbHNle0wuQkUodCxuZXcgQi5xcCgiIiwiIiwi
-IixDLkNNKSwhMCkKTC5CWCgiJm5ic3A7IixudWxsKX19LAokUzoxNn0KTC5XeC5wcm90b3R5cGU9ewok
-MTpmdW5jdGlvbihhKXt2YXIgdCxzLHIscT0iY29sbGFwc2VkIgp1LlYuYihhKQp0PXRoaXMuYQpzPUou
-UkUodCkKcj10aGlzLmIKaWYoIXMuZ1AodCkudGcoMCxxKSl7cy5nUCh0KS5pKDAscSkKSi5kUihyKS5p
-KDAscSl9ZWxzZXtzLmdQKHQpLlIoMCxxKQpKLmRSKHIpLlIoMCxxKX19LAokUzozfQpMLkFPLnByb3Rv
-dHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PUoucUYodS5oLmIoYSkpLHM9dC4kdGkscj1zLkMoIn4o
-MSkiKS5iKG5ldyBMLmROKHRoaXMuYSkpCnUuTS5iKG51bGwpClcuSkUodC5hLHQuYixyLCExLHMuZCl9
-LAokUzo2fQpMLmROLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0CnUuVi5iKGEpCnQ9ZG9j
-dW1lbnQucXVlcnlTZWxlY3RvcigidGFibGVbZGF0YS1wYXRoXSIpCnQudG9TdHJpbmcKTC50MihhLHRo
-aXMuYSx0LmdldEF0dHJpYnV0ZSgiZGF0YS0iK25ldyBXLlN5KG5ldyBXLmk3KHQpKS5PKCJwYXRoIikp
-KX0sCiRTOjN9CkwuSG8ucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQscyxyCnUuaC5iKGEp
-CnQ9Si5xRihhKQpzPXQuJHRpCnI9cy5DKCJ+KDEpIikuYihuZXcgTC54eihhLHRoaXMuYSkpCnUuTS5i
-KG51bGwpClcuSkUodC5hLHQuYixyLCExLHMuZCl9LAokUzo2fQpMLnh6LnByb3RvdHlwZT17CiQxOmZ1
-bmN0aW9uKGEpe3ZhciB0LHM9bnVsbAp1LlYuYihhKQp0PXRoaXMuYQpMLmhYKHRoaXMuYixQLlFBKHQu
-Z2V0QXR0cmlidXRlKCJkYXRhLSIrbmV3IFcuU3kobmV3IFcuaTcodCkpLk8oIm9mZnNldCIpKSxzLHMp
-LFAuUUEodC5nZXRBdHRyaWJ1dGUoImRhdGEtIituZXcgVy5TeShuZXcgVy5pNyh0KSkuTygibGluZSIp
-KSxzLHMpKX0sCiRTOjN9CkwuSUMucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQ9Si5xRih1
-LmguYihhKSkscz10LiR0aQpzLkMoIn4oMSkiKS5iKEwuaVMoKSkKdS5NLmIobnVsbCkKVy5KRSh0LmEs
-dC5iLEwuaVMoKSwhMSxzLmQpfSwKJFM6Nn0KTC5mQy5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt1
-LnAuYihhKQp0aGlzLmEuYU0oMCx0aGlzLmIpfSwKJFM6NDV9CkwublQucHJvdG90eXBlPXsKJDA6ZnVu
-Y3Rpb24oKXtMLkZyKHRoaXMuYS5hLHRoaXMuYix0aGlzLmMpfSwKJFM6MH0KTC5CWi5wcm90b3R5cGU9
-ewokMDpmdW5jdGlvbigpe0wuRnIodGhpcy5hLmEsbnVsbCxudWxsKX0sCiRTOjB9CkwuR0gucHJvdG90
-eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dS5oLmIoYSkKJC56QigpLnRvU3RyaW5nCnUubS5hKCQub3coKS5x
-KDAsImhsanMiKSkuVjcoImhpZ2hsaWdodEJsb2NrIixbYV0pfSwKJFM6Nn0KTC5FRS5wcm90b3R5cGU9
-ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzCnUuVi5iKGEpCnQ9dGhpcy5hCnM9dGhpcy5iCkwuYWYod2lu
-ZG93LmxvY2F0aW9uLnBhdGhuYW1lLHQscywhMCxuZXcgTC5RTCh0LHMpKQpMLmhYKHRoaXMuYyx0LHMp
-fSwKJFM6M30KTC5RTC5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe0wuRnIod2luZG93LmxvY2F0aW9u
-LnBhdGhuYW1lLHRoaXMuYSx0aGlzLmIpfSwKJFM6MH0KTC5WUy5wcm90b3R5cGU9ewokMTpmdW5jdGlv
-bihhKXt2YXIgdCxzPSJzZWxlY3RlZC1maWxlIgp1LmguYihhKQphLnRvU3RyaW5nCnQ9Si5SRShhKQpp
-ZihhLmdldEF0dHJpYnV0ZSgiZGF0YS0iK25ldyBXLlN5KG5ldyBXLmk3KGEpKS5PKCJuYW1lIikpPT09
-dGhpcy5hLmEpdC5nUChhKS5pKDAscykKZWxzZSB0LmdQKGEpLlIoMCxzKX0sCiRTOjZ9CkwuVEQucHJv
-dG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIEwudDIodS5WLmIoYSksITAsbnVsbCl9LAokUzox
-OH0KTC5BUy5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5QTCh1LlYuYihhKSl9
-LApQTDpmdW5jdGlvbihhKXt2YXIgdD0wLHM9UC5GWCh1LlApLHI9MSxxLHA9W10sbz10aGlzLG4sbSxs
-LGssagp2YXIgJGFzeW5jJCQxPVAubHooZnVuY3Rpb24oYixjKXtpZihiPT09MSl7cT1jCnQ9cn13aGls
-ZSh0cnVlKXN3aXRjaCh0KXtjYXNlIDA6cj0zCmw9dS5OCnQ9NgpyZXR1cm4gUC5qUShMLnR5KEwuUTQo
-Ii9hcHBseS1oaW50IixQLkZsKGwsbCkpLG8uYS5MdCgpKSwkYXN5bmMkJDEpCmNhc2UgNjpsPW8uYgpM
-Lkc3KGwuYyxudWxsLGwuYiwhMSxudWxsKQpkb2N1bWVudC5ib2R5LmNsYXNzTGlzdC5hZGQoIm5lZWRz
-LXJlcnVuIikKcj0xCnQ9NQpicmVhawpjYXNlIDM6cj0yCmo9cQpuPUguUnUoaikKbT1ILnRzKGopCkwu
-QzIoIkNvdWxkIG5vdCBhcHBseSBoaW50IixuLG0pCnQ9NQpicmVhawpjYXNlIDI6dD0xCmJyZWFrCmNh
-c2UgNTpyZXR1cm4gUC55QyhudWxsLHMpCmNhc2UgMTpyZXR1cm4gUC5mMyhxLHMpfX0pCnJldHVybiBQ
-LkRJKCRhc3luYyQkMSxzKX0sCiRTOjE3fQpMLlhBLnByb3RvdHlwZT17CkViOmZ1bmN0aW9uKGEsYixj
-KXtyZXR1cm4hMH0sCmkwOmZ1bmN0aW9uKGEpe3JldHVybiEwfSwKJGlrRjoxfQpMLlpaLnByb3RvdHlw
-ZT17Ckx0OmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLHI9UC5GbCh1Lk4sdS5LKQpyLlkoMCwidHlwZSIs
-TC52eShzLmEpKQpyLlkoMCwibmFtZSIscy5iKQp0PXMuYwppZih0IT1udWxsKXIuWSgwLCJzdWJ0cmVl
-IixMLlZEKHQpKQp0PXMuZAppZih0IT1udWxsKXIuWSgwLCJwYXRoIix0KQp0PXMuZQppZih0IT1udWxs
-KXIuWSgwLCJocmVmIix0KQp0PXMuZgppZih0IT1udWxsKXIuWSgwLCJlZGl0Q291bnQiLHQpCnJldHVy
-biByfX0KTC5POS5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmJ9fQpNLmxJLnBy
-b3RvdHlwZT17CldPOmZ1bmN0aW9uKGEsYil7dmFyIHQscz1udWxsCk0uWUYoImFic29sdXRlIixILlZN
-KFtiLG51bGwsbnVsbCxudWxsLG51bGwsbnVsbCxudWxsXSx1LnMpKQp0PXRoaXMuYQp0PXQuWXIoYik+
-MCYmIXQuaEsoYikKaWYodClyZXR1cm4gYgp0PUQuUlgoKQpyZXR1cm4gdGhpcy5xNygwLHQsYixzLHMs
-cyxzLHMscyl9LAp6ZjpmdW5jdGlvbihhKXt2YXIgdCxzLHI9WC5DTChhLHRoaXMuYSkKci5JVigpCnQ9
-ci5kCnM9dC5sZW5ndGgKaWYocz09PTApe3Q9ci5iCnJldHVybiB0PT1udWxsPyIuIjp0fWlmKHM9PT0x
-KXt0PXIuYgpyZXR1cm4gdD09bnVsbD8iLiI6dH1pZigwPj1zKXJldHVybiBILk9IKHQsLTEpCnQucG9w
-KCkKQy5ObS5tdihyLmUpCnIuSVYoKQpyZXR1cm4gci53KDApfSwKcTc6ZnVuY3Rpb24oYSxiLGMsZCxl
-LGYsZyxoLGkpe3ZhciB0PUguVk0oW2IsYyxkLGUsZixnLGgsaV0sdS5zKQpNLllGKCJqb2luIix0KQpy
-ZXR1cm4gdGhpcy5JUChuZXcgSC5VNSh0LHUuYkIuYihuZXcgTS5NaSgpKSx1LmNjKSl9LApJUDpmdW5j
-dGlvbihhKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsawp1LlguYihhKQpmb3IodD1hLiR0aSxzPXQuQygi
-YTIoY1guRSkiKS5iKG5ldyBNLnE3KCkpLHI9YS5na3ooYSksdD1uZXcgSC5TTyhyLHMsdC5DKCJTTzxj
-WC5FPiIpKSxzPXRoaXMuYSxxPSExLHA9ITEsbz0iIjt0LkYoKTspe249ci5nbCgpCmlmKHMuaEsobikm
-JnApe209WC5DTChuLHMpCmw9by5jaGFyQ29kZUF0KDApPT0wP286bwpvPUMueEIuTmoobCwwLHMuU3Ao
-bCwhMCkpCm0uYj1vCmlmKHMuZHMobykpQy5ObS5ZKG0uZSwwLHMuZ21JKCkpCm89bS53KDApfWVsc2Ug
-aWYocy5ZcihuKT4wKXtwPSFzLmhLKG4pCm89SC5kKG4pfWVsc2V7az1uLmxlbmd0aAppZihrIT09MCl7
-aWYoMD49aylyZXR1cm4gSC5PSChuLDApCms9cy5VZChuWzBdKX1lbHNlIGs9ITEKaWYoIWspaWYocSlv
-Kz1zLmdtSSgpCm8rPW59cT1zLmRzKG4pfXJldHVybiBvLmNoYXJDb2RlQXQoMCk9PTA/bzpvfSwKbzU6
-ZnVuY3Rpb24oYSl7dmFyIHQKaWYoIXRoaXMueTMoYSkpcmV0dXJuIGEKdD1YLkNMKGEsdGhpcy5hKQp0
-LnJSKCkKcmV0dXJuIHQudygwKX0sCnkzOmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxr
-CmEudG9TdHJpbmcKdD10aGlzLmEKcz10LllyKGEpCmlmKHMhPT0wKXtpZih0PT09JC5LaygpKWZvcihy
-PTA7cjxzOysrcilpZihDLnhCLlcoYSxyKT09PTQ3KXJldHVybiEwCnE9cwpwPTQ3fWVsc2V7cT0wCnA9
-bnVsbH1mb3Iobz1uZXcgSC5xaihhKS5hLG49by5sZW5ndGgscj1xLG09bnVsbDtyPG47KytyLG09cCxw
-PWwpe2w9Qy54Qi5tKG8scikKaWYodC5yNChsKSl7aWYodD09PSQuS2soKSYmbD09PTQ3KXJldHVybiEw
-CmlmKHAhPW51bGwmJnQucjQocCkpcmV0dXJuITAKaWYocD09PTQ2KWs9bT09bnVsbHx8bT09PTQ2fHx0
-LnI0KG0pCmVsc2Ugaz0hMQppZihrKXJldHVybiEwfX1pZihwPT1udWxsKXJldHVybiEwCmlmKHQucjQo
-cCkpcmV0dXJuITAKaWYocD09PTQ2KXQ9bT09bnVsbHx8dC5yNChtKXx8bT09PTQ2CmVsc2UgdD0hMQpp
-Zih0KXJldHVybiEwCnJldHVybiExfSwKSFA6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG8sbixt
-PXRoaXMsbD0nVW5hYmxlIHRvIGZpbmQgYSBwYXRoIHRvICInCmI9bS5XTygwLGIpCnQ9bS5hCmlmKHQu
-WXIoYik8PTAmJnQuWXIoYSk+MClyZXR1cm4gbS5vNShhKQppZih0LllyKGEpPD0wfHx0LmhLKGEpKWE9
-bS5XTygwLGEpCmlmKHQuWXIoYSk8PTAmJnQuWXIoYik+MCl0aHJvdyBILmIoWC5JNyhsK0guZChhKSsn
-IiBmcm9tICInK0guZChiKSsnIi4nKSkKcz1YLkNMKGIsdCkKcy5yUigpCnI9WC5DTChhLHQpCnIuclIo
-KQpxPXMuZApwPXEubGVuZ3RoCmlmKHAhPT0wKXtpZigwPj1wKXJldHVybiBILk9IKHEsMCkKcT1KLlJN
-KHFbMF0sIi4iKX1lbHNlIHE9ITEKaWYocSlyZXR1cm4gci53KDApCnE9cy5iCnA9ci5iCmlmKHEhPXAp
-cT1xPT1udWxsfHxwPT1udWxsfHwhdC5OYyhxLHApCmVsc2UgcT0hMQppZihxKXJldHVybiByLncoMCkK
-d2hpbGUoITApe3E9cy5kCnA9cS5sZW5ndGgKaWYocCE9PTApe289ci5kCm49by5sZW5ndGgKaWYobiE9
-PTApe2lmKDA+PXApcmV0dXJuIEguT0gocSwwKQpxPXFbMF0KaWYoMD49bilyZXR1cm4gSC5PSChvLDAp
-Cm89dC5OYyhxLG9bMF0pCnE9b31lbHNlIHE9ITF9ZWxzZSBxPSExCmlmKCFxKWJyZWFrCkMuTm0uVzQo
-cy5kLDApCkMuTm0uVzQocy5lLDEpCkMuTm0uVzQoci5kLDApCkMuTm0uVzQoci5lLDEpfXE9cy5kCnA9
-cS5sZW5ndGgKaWYocCE9PTApe2lmKDA+PXApcmV0dXJuIEguT0gocSwwKQpxPUouUk0ocVswXSwiLi4i
-KX1lbHNlIHE9ITEKaWYocSl0aHJvdyBILmIoWC5JNyhsK0guZChhKSsnIiBmcm9tICInK0guZChiKSsn
-Ii4nKSkKcT11Lk4KQy5ObS5VRyhyLmQsMCxQLk84KHMuZC5sZW5ndGgsIi4uIiwhMSxxKSkKQy5ObS5Z
-KHIuZSwwLCIiKQpDLk5tLlVHKHIuZSwxLFAuTzgocy5kLmxlbmd0aCx0LmdtSSgpLCExLHEpKQp0PXIu
-ZApxPXQubGVuZ3RoCmlmKHE9PT0wKXJldHVybiIuIgppZihxPjEmJkouUk0oQy5ObS5ncloodCksIi4i
-KSl7dD1yLmQKaWYoMD49dC5sZW5ndGgpcmV0dXJuIEguT0godCwtMSkKdC5wb3AoKQp0PXIuZQpDLk5t
-Lm12KHQpCkMuTm0ubXYodCkKQy5ObS5pKHQsIiIpfXIuYj0iIgpyLklWKCkKcmV0dXJuIHIudygwKX19
-Ck0uTWkucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIEgueShhKSE9bnVsbH0sCiRTOjd9
-Ck0ucTcucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIEgueShhKSE9PSIifSwKJFM6N30K
-TS5Oby5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtILnkoYSkKcmV0dXJuIGE9PW51bGw/Im51bGwi
-OiciJythKyciJ30sCiRTOjV9CkIuZnYucHJvdG90eXBlPXsKeFo6ZnVuY3Rpb24oYSl7dmFyIHQscz10
-aGlzLllyKGEpCmlmKHM+MClyZXR1cm4gSi5sZChhLDAscykKaWYodGhpcy5oSyhhKSl7aWYoMD49YS5s
-ZW5ndGgpcmV0dXJuIEguT0goYSwwKQp0PWFbMF19ZWxzZSB0PW51bGwKcmV0dXJuIHR9LApOYzpmdW5j
-dGlvbihhLGIpe3JldHVybiBhPT1ifX0KWC5XRC5wcm90b3R5cGU9ewpJVjpmdW5jdGlvbigpe3ZhciB0
-LHMscj10aGlzCndoaWxlKCEwKXt0PXIuZAppZighKHQubGVuZ3RoIT09MCYmSi5STShDLk5tLmdyWih0
-KSwiIikpKWJyZWFrCnQ9ci5kCmlmKDA+PXQubGVuZ3RoKXJldHVybiBILk9IKHQsLTEpCnQucG9wKCkK
-Qy5ObS5tdihyLmUpfXQ9ci5lCnM9dC5sZW5ndGgKaWYocyE9PTApQy5ObS5ZKHQscy0xLCIiKX0sCnJS
-OmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscCxvLG49dGhpcyxtPUguVk0oW10sdS5zKQpmb3IodD1uLmQs
-cz10Lmxlbmd0aCxyPTAscT0wO3E8dC5sZW5ndGg7dC5sZW5ndGg9PT1zfHwoMCxILmxrKSh0KSwrK3Ep
-e3A9dFtxXQpvPUouaWEocCkKaWYoIShvLkROKHAsIi4iKXx8by5ETihwLCIiKSkpaWYoby5ETihwLCIu
-LiIpKXtvPW0ubGVuZ3RoCmlmKG8hPT0wKXtpZigwPj1vKXJldHVybiBILk9IKG0sLTEpCm0ucG9wKCl9
-ZWxzZSArK3J9ZWxzZSBDLk5tLmkobSxwKX1pZihuLmI9PW51bGwpQy5ObS5VRyhtLDAsUC5POChyLCIu
-LiIsITEsdS5OKSkKaWYobS5sZW5ndGg9PT0wJiZuLmI9PW51bGwpQy5ObS5pKG0sIi4iKQpuLnNuSiht
-KQp0PW4uYQpuLnNQaChQLk84KG0ubGVuZ3RoKzEsdC5nbUkoKSwhMCx1Lk4pKQpzPW4uYgppZihzPT1u
-dWxsfHxtLmxlbmd0aD09PTB8fCF0LmRzKHMpKUMuTm0uWShuLmUsMCwiIikKcz1uLmIKaWYocyE9bnVs
-bCYmdD09PSQuS2soKSl7cy50b1N0cmluZwpuLmI9SC55cyhzLCIvIiwiXFwiKX1uLklWKCl9LAp3OmZ1
-bmN0aW9uKGEpe3ZhciB0LHMscj10aGlzLHE9ci5iCnE9cSE9bnVsbD9xOiIiCmZvcih0PTA7dDxyLmQu
-bGVuZ3RoOysrdCl7cz1yLmUKaWYodD49cy5sZW5ndGgpcmV0dXJuIEguT0gocyx0KQpzPXErSC5kKHNb
-dF0pCnE9ci5kCmlmKHQ+PXEubGVuZ3RoKXJldHVybiBILk9IKHEsdCkKcT1zK0guZChxW3RdKX1xKz1I
-LmQoQy5ObS5nclooci5lKSkKcmV0dXJuIHEuY2hhckNvZGVBdCgwKT09MD9xOnF9LApzbko6ZnVuY3Rp
-b24oYSl7dGhpcy5kPXUuYS5iKGEpfSwKc1BoOmZ1bmN0aW9uKGEpe3RoaXMuZT11LmEuYihhKX19Clgu
-ZHYucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4iUGF0aEV4Y2VwdGlvbjogIit0aGlzLmF9
-LAokaVJ6OjF9Ck8uekwucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5nb2ModGhp
-cyl9fQpFLk9GLnByb3RvdHlwZT17ClVkOmZ1bmN0aW9uKGEpe3JldHVybiBDLnhCLnRnKGEsIi8iKX0s
-CnI0OmZ1bmN0aW9uKGEpe3JldHVybiBhPT09NDd9LApkczpmdW5jdGlvbihhKXt2YXIgdD1hLmxlbmd0
-aApyZXR1cm4gdCE9PTAmJkMueEIubShhLHQtMSkhPT00N30sClNwOmZ1bmN0aW9uKGEsYil7aWYoYS5s
-ZW5ndGghPT0wJiZDLnhCLlcoYSwwKT09PTQ3KXJldHVybiAxCnJldHVybiAwfSwKWXI6ZnVuY3Rpb24o
-YSl7cmV0dXJuIHRoaXMuU3AoYSwhMSl9LApoSzpmdW5jdGlvbihhKXtyZXR1cm4hMX0sCmdvYzpmdW5j
-dGlvbigpe3JldHVybiJwb3NpeCJ9LApnbUk6ZnVuY3Rpb24oKXtyZXR1cm4iLyJ9fQpGLnJ1LnByb3Rv
-dHlwZT17ClVkOmZ1bmN0aW9uKGEpe3JldHVybiBDLnhCLnRnKGEsIi8iKX0sCnI0OmZ1bmN0aW9uKGEp
-e3JldHVybiBhPT09NDd9LApkczpmdW5jdGlvbihhKXt2YXIgdD1hLmxlbmd0aAppZih0PT09MClyZXR1
-cm4hMQppZihDLnhCLm0oYSx0LTEpIT09NDcpcmV0dXJuITAKcmV0dXJuIEMueEIuVGMoYSwiOi8vIikm
-JnRoaXMuWXIoYSk9PT10fSwKU3A6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwPWEubGVuZ3RoCmlm
-KHA9PT0wKXJldHVybiAwCmlmKEMueEIuVyhhLDApPT09NDcpcmV0dXJuIDEKZm9yKHQ9MDt0PHA7Kyt0
-KXtzPUMueEIuVyhhLHQpCmlmKHM9PT00NylyZXR1cm4gMAppZihzPT09NTgpe2lmKHQ9PT0wKXJldHVy
-biAwCnI9Qy54Qi5YVShhLCIvIixDLnhCLlFpKGEsIi8vIix0KzEpP3QrMzp0KQppZihyPD0wKXJldHVy
-biBwCmlmKCFifHxwPHIrMylyZXR1cm4gcgppZighQy54Qi5uKGEsImZpbGU6Ly8iKSlyZXR1cm4gcgpp
-ZighQi5ZdShhLHIrMSkpcmV0dXJuIHIKcT1yKzMKcmV0dXJuIHA9PT1xP3E6cis0fX1yZXR1cm4gMH0s
-CllyOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLlNwKGEsITEpfSwKaEs6ZnVuY3Rpb24oYSl7cmV0dXJu
-IGEubGVuZ3RoIT09MCYmQy54Qi5XKGEsMCk9PT00N30sCmdvYzpmdW5jdGlvbigpe3JldHVybiJ1cmwi
-fSwKZ21JOmZ1bmN0aW9uKCl7cmV0dXJuIi8ifX0KTC5JVi5wcm90b3R5cGU9ewpVZDpmdW5jdGlvbihh
-KXtyZXR1cm4gQy54Qi50ZyhhLCIvIil9LApyNDpmdW5jdGlvbihhKXtyZXR1cm4gYT09PTQ3fHxhPT09
-OTJ9LApkczpmdW5jdGlvbihhKXt2YXIgdD1hLmxlbmd0aAppZih0PT09MClyZXR1cm4hMQp0PUMueEIu
-bShhLHQtMSkKcmV0dXJuISh0PT09NDd8fHQ9PT05Mil9LApTcDpmdW5jdGlvbihhLGIpe3ZhciB0LHMs
-cj1hLmxlbmd0aAppZihyPT09MClyZXR1cm4gMAp0PUMueEIuVyhhLDApCmlmKHQ9PT00NylyZXR1cm4g
-MQppZih0PT09OTIpe2lmKHI8Mnx8Qy54Qi5XKGEsMSkhPT05MilyZXR1cm4gMQpzPUMueEIuWFUoYSwi
-XFwiLDIpCmlmKHM+MCl7cz1DLnhCLlhVKGEsIlxcIixzKzEpCmlmKHM+MClyZXR1cm4gc31yZXR1cm4g
-cn1pZihyPDMpcmV0dXJuIDAKaWYoIUIuT1ModCkpcmV0dXJuIDAKaWYoQy54Qi5XKGEsMSkhPT01OCly
-ZXR1cm4gMApyPUMueEIuVyhhLDIpCmlmKCEocj09PTQ3fHxyPT09OTIpKXJldHVybiAwCnJldHVybiAz
-fSwKWXI6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuU3AoYSwhMSl9LApoSzpmdW5jdGlvbihhKXtyZXR1
-cm4gdGhpcy5ZcihhKT09PTF9LApPdDpmdW5jdGlvbihhLGIpe3ZhciB0CmlmKGE9PT1iKXJldHVybiEw
-CmlmKGE9PT00NylyZXR1cm4gYj09PTkyCmlmKGE9PT05MilyZXR1cm4gYj09PTQ3CmlmKChhXmIpIT09
-MzIpcmV0dXJuITEKdD1hfDMyCnJldHVybiB0Pj05NyYmdDw9MTIyfSwKTmM6ZnVuY3Rpb24oYSxiKXt2
-YXIgdCxzLHIKaWYoYT09YilyZXR1cm4hMAp0PWEubGVuZ3RoCmlmKHQhPT1iLmxlbmd0aClyZXR1cm4h
-MQpmb3Iocz1KLnJZKGIpLHI9MDtyPHQ7KytyKWlmKCF0aGlzLk90KEMueEIuVyhhLHIpLHMuVyhiLHIp
-KSlyZXR1cm4hMQpyZXR1cm4hMH0sCmdvYzpmdW5jdGlvbigpe3JldHVybiJ3aW5kb3dzIn0sCmdtSTpm
-dW5jdGlvbigpe3JldHVybiJcXCJ9fTsoZnVuY3Rpb24gYWxpYXNlcygpe3ZhciB0PUoudkIucHJvdG90
-eXBlCnQuVT10LncKdC5Taj10LmU3CnQ9Si5NRi5wcm90b3R5cGUKdC50PXQudwp0PVAuY1gucHJvdG90
-eXBlCnQuR0c9dC5ldgp0PVAuay5wcm90b3R5cGUKdC54Yj10LncKdD1XLmN2LnByb3RvdHlwZQp0LkRX
-PXQucjYKdD1XLm02LnByb3RvdHlwZQp0LmpGPXQuRWIKdD1QLkU0LnByb3RvdHlwZQp0LlVyPXQucQp0
-LmU0PXQuWX0pKCk7KGZ1bmN0aW9uIGluc3RhbGxUZWFyT2Zmcygpe3ZhciB0PWh1bmtIZWxwZXJzLl9z
-dGF0aWNfMSxzPWh1bmtIZWxwZXJzLl9zdGF0aWNfMCxyPWh1bmtIZWxwZXJzLmluc3RhbGxJbnN0YW5j
-ZVRlYXJPZmYscT1odW5rSGVscGVycy5pbnN0YWxsU3RhdGljVGVhck9mZixwPWh1bmtIZWxwZXJzLl9p
-bnN0YW5jZV8xdQp0KFAsIkVYIiwiWlYiLDgpCnQoUCwieXQiLCJvQSIsOCkKdChQLCJxVyIsIkJ6Iiw4
-KQpzKFAsIlVJIiwiZU4iLDIpCnIoUC5QZi5wcm90b3R5cGUsImdZSiIsMCwxLG51bGwsWyIkMiIsIiQx
-Il0sWyJ3MCIsInBtIl0sMjgsMCkKdChQLCJDeSIsIk5DIiwxKQp0KFAsIlBIIiwiTXQiLDUpCnEoVywi
-cFMiLDQsbnVsbCxbIiQ0Il0sWyJxRCJdLDksMCkKcShXLCJWNCIsNCxudWxsLFsiJDQiXSxbIlFXIl0s
-OSwwKQpwKFAuQXMucHJvdG90eXBlLCJndU0iLCJUIiw1KQp0KFAsImlHIiwid1kiLDEpCnQoUCwidzAi
-LCJMNyIsMzIpCnQoTCwiaVMiLCJpNiIsMTgpfSkoKTsoZnVuY3Rpb24gaW5oZXJpdGFuY2UoKXt2YXIg
-dD1odW5rSGVscGVycy5taXhpbixzPWh1bmtIZWxwZXJzLmluaGVyaXQscj1odW5rSGVscGVycy5pbmhl
-cml0TWFueQpzKFAuayxudWxsKQpyKFAuayxbSC5lbyxKLnZCLEoubTEsUC5uWSxQLmNYLEguYTcsUC5B
-bixILlNVLEguUmUsSC53dixQLlBuLEguV1UsSC5MSSxILlRwLEguZjksUC5YUyxILmJxLEguWE8sUC5Z
-ayxILmRiLEguTjYsSC5WUixILkVLLEguUGIsSC50USxILlNkLEguSmMsSC5HLFAuVzMsUC5paCxQLkZ5
-LFAuR1YsUC5iOCxQLlBmLFAuRmUsUC52cyxQLk9NLFAucWgsUC5NTyxQLmtULFAueEksUC5DdyxQLm0w
-LFAuWHYsUC5ibixQLmxtLFAubEQsUC5LUCxQLmxmLFAuVEMsUC5VayxQLlNoLFAuUncsUC5ieixQLmEy
-LFAuaVAsUC5GSyxQLms1LFAuS1ksUC5DRCxQLmFFLFAuRUgsUC56TSxQLlowLFAuTjMsUC5jOCxQLk9k
-LFAuaWIsUC5HeixQLnFVLFAuUm4sUC5HRCxQLkRuLFAuUEUsUC5VZixXLmlkLFcuRmssVy5KUSxXLkdt
-LFcudkQsVy5tNixXLk93LFcuVzksVy5kVyxXLkZiLFcua0YsVy5tayxXLktvLFAuaUosUC5FNCxQLm42
-LE0uSDcsVS5MTCxVLmQyLFUuU2UsVS5NbCxVLnlELFUud2IsQi5qOCxCLnFwLFQubVEsTC5YQSxMLlpa
-LEwuTzksTS5sSSxPLnpMLFguV0QsWC5kdl0pCnIoSi52QixbSi55RSxKLllFLEouTUYsSi5qZCxKLnFJ
-LEouRHIsSC5FVCxXLkQwLFcuQXosVy5MZSxXLk5oLFcuSUIsVy5uNyxXLmVhLFcuYnIsVy5TZyxXLnU4
-LFcuSzcsVy5YVyxQLmhGXSkKcihKLk1GLFtKLmlDLEoua2QsSi5jNV0pCnMoSi5QbyxKLmpkKQpyKEou
-cUksW0ouYlUsSi5WQV0pCnMoUC51eSxQLm5ZKQpyKFAudXksW0guWEMsVy53eixXLmU3XSkKcyhILnFq
-LEguWEMpCnIoUC5jWCxbSC5iUSxILmkxLEguVTUsSC5YUixQLm1XLEgudW5dKQpyKEguYlEsW0guYUws
-SC5pNSxQLnh1XSkKcihILmFMLFtILm5ILEguQTgsUC5pOF0pCnMoSC54eSxILmkxKQpyKFAuQW4sW0gu
-TUgsSC5TT10pCnMoUC5SVSxQLlBuKQpzKFAuR2osUC5SVSkKcyhILlBELFAuR2opCnMoSC5MUCxILldV
-KQpyKEguVHAsW0guQ2osSC5BbSxILmxjLEguZEMsSC53TixILlZYLFAudGgsUC5oYSxQLlZzLFAuRnQs
-UC55SCxQLldNLFAuU1gsUC5HcyxQLmRhLFAub1EsUC5wVixQLlU3LFAudnIsUC5ySCxQLktGLFAuWkws
-UC5SVCxQLmpaLFAucnEsUC5SVyxQLkI1LFAudU8sUC5wSyxQLmhqLFAuVnAsUC5PUixQLnJhLFAueVEs
-UC50aSxQLldGLFAubjEsUC5jUyxQLlZDLFAuSlQsUC5lMSxQLk5ZLFAuUlosUC5NRSxQLnk1LFAucTMs
-UC55SSxQLmM2LFAucWQsVy5DdixXLktTLFcuQTMsVy52TixXLlV2LFcuRWcsVy5FbyxXLldrLFcuSUEs
-Vy5mbSxQLmxSLFAuamcsUC5HRSxQLk43LFAudVEsUC5QQyxQLm10LFAuTnosUC5RUyxQLm5wLFUuTUQs
-VS5hTixVLmIwLEwuZSxMLlZXLEwub1osTC5qcixMLnFsLEwueTgsTC5IaSxMLkJULEwuTCxMLld4LEwu
-QU8sTC5kTixMLkhvLEwueHosTC5JQyxMLmZDLEwublQsTC5CWixMLkdILEwuRUUsTC5RTCxMLlZTLEwu
-VEQsTC5BUyxNLk1pLE0ucTcsTS5Ob10pCnIoUC5YUyxbSC5XMCxILmF6LEgudlYsSC5FcSxQLkM2LEgu
-dTksUC5VZCxQLm4sUC51LFAubXAsUC51YixQLmRzLFAubGosUC5VVixQLmNdKQpyKEgubGMsW0guengs
-SC5yVF0pCnMoSC5rWSxQLkM2KQpzKFAuaWwsUC5ZaykKcihQLmlsLFtILk41LFAudXcsVy5jZixXLlN5
-XSkKcihQLm1XLFtILktXLFAucTRdKQpzKEguTFosSC5FVCkKcihILkxaLFtILlJHLEguV0JdKQpzKEgu
-VlAsSC5SRykKcyhILkRnLEguVlApCnMoSC5aRyxILldCKQpzKEguUGcsSC5aRykKcihILlBnLFtILnhq
-LEguZEUsSC5aQSxILndmLEguUHEsSC5lRSxILlY2XSkKcihILnU5LFtILmh6LEguaU1dKQpzKFAuWmYs
-UC5QZikKcyhQLkppLFAubTApCnMoUC5iNixQLlh2KQpzKFAuVmosUC5UQykKcihQLlVrLFtQLkNWLFAu
-WmksUC5ieV0pCnMoUC53SSxQLmtUKQpyKFAud0ksW1AuVTgsUC5vaixQLk14LFAuRTMsUC5HWV0pCnMo
-UC5LOCxQLlVkKQpzKFAudHUsUC5TaCkKcyhQLnU1LFAuWmkpCnIoUC5GSyxbUC5DUCxQLktOXSkKcihQ
-LnUsW1AuYkosUC5lWV0pCnMoUC5xZSxQLkRuKQpyKFcuRDAsW1cudUgsVy53YSxXLks1LFcuQ21dKQpy
-KFcudUgsW1cuY3YsVy5ueCxXLlFGLFcuQ1FdKQpyKFcuY3YsW1cucUUsUC5kNV0pCnIoVy5xRSxbVy5H
-aCxXLmZZLFcubkIsVy5RUCxXLmg0LFcuU04sVy5scCxXLlRiLFcuSXYsVy5XUCxXLnlZXSkKcyhXLm9K
-LFcuTGUpCnMoVy5oSCxXLkF6KQpzKFcuVmIsVy5RRikKcyhXLk83LFcud2EpCnIoVy5lYSxbVy53NixX
-LmV3XSkKcyhXLkFqLFcudzYpCnMoVy5yQixXLks3KQpzKFcuQkgsVy5yQikKcyhXLnc0LFcuSUIpCnMo
-Vy5vYSxXLlhXKQpzKFcucmgsVy5vYSkKcyhXLmk3LFcuY2YpCnMoUC5BcyxQLlZqKQpyKFAuQXMsW1cu
-STQsUC5LZV0pCnMoVy5STyxQLnFoKQpzKFcuZXUsVy5STykKcyhXLnhDLFAuTU8pCnMoVy5jdCxXLm02
-KQpzKFAuQmYsUC5pSikKcihQLkU0LFtQLnI3LFAuY29dKQpzKFAuVHosUC5jbykKcyhQLm5kLFAuZDUp
-CnMoQi5mdixPLnpMKQpyKEIuZnYsW0UuT0YsRi5ydSxMLklWXSkKdChILlhDLEguUmUpCnQoSC5SRyxQ
-LmxEKQp0KEguVlAsSC5TVSkKdChILldCLFAubEQpCnQoSC5aRyxILlNVKQp0KFAublksUC5sRCkKdChQ
-LlRDLFAubGYpCnQoUC5SVSxQLktQKQp0KFcuTGUsVy5pZCkKdChXLks3LFAubEQpCnQoVy5yQixXLkdt
-KQp0KFcuWFcsUC5sRCkKdChXLm9hLFcuR20pCnQoUC5jbyxQLmxEKX0pKCkKdmFyIHY9e3R5cGVVbml2
-ZXJzZTp7ZUM6bmV3IE1hcCgpLHRSOnt9LGVUOnt9LHRQVjp7fSxzRUE6W119LG1hbmdsZWRHbG9iYWxO
-YW1lczp7S046ImludCIsQ1A6ImRvdWJsZSIsRks6Im51bSIscVU6IlN0cmluZyIsYTI6ImJvb2wiLGM4
-OiJOdWxsIix6TToiTGlzdCJ9LG1hbmdsZWROYW1lczp7fSxnZXRUeXBlRnJvbU5hbWU6Z2V0R2xvYmFs
-RnJvbU5hbWUsbWV0YWRhdGE6W10sdHlwZXM6WyJjOCgpIiwiQChAKSIsIn4oKSIsImM4KEFqKSIsImM4
-KEAsQCkiLCJxVShxVSkiLCJjOChjdikiLCJhMihxVSkiLCJ+KH4oKSkiLCJhMihjdixxVSxxVSxKUSki
-LCJjOChAKSIsIn4oeHU8cVU+KSIsImM4KHFVLEApIiwiYzgocVUpIiwiYzgocVUscVUpIiwiYTIoa0Yp
-IiwiYzgoZWEpIiwiYjg8Yzg+KEFqKSIsIn4oQWopIiwiWjA8cVUscVU+KFowPHFVLHFVPixxVSkiLCJj
-OCh+KCkpIiwiYzgoQCxHeikiLCJ+KHFVLHFVKSIsIm42KEtOKSIsIm42KEAsQCkiLCJhMih1SCkiLCJj
-OChLTixAKSIsIkAoZWEpIiwifihrW0d6XSkiLCJjOChAW0d6XSkiLCJ+KHVILHVIKSIsImEyKHh1PHFV
-PikiLCJrKEApIiwicjcoQCkiLCJUejxAPihAKSIsIkU0KEApIiwiYTIoSDcpIiwiTEwoQCkiLCJaMDxx
-VSxrPihMTCkiLCJ2czxAPihAKSIsIkAocVUpIiwiYzgoWjA8cVUsaz4pIiwiYzgoR0QsQCkiLCJxVShB
-aikiLCJAKEAscVUpIiwiYzgoZXcpIiwifihxVSxLTikiLCJ+KHFVW0BdKSIsIktOKEtOLEtOKSIsIn4o
-QCkiXSxpbnRlcmNlcHRvcnNCeVRhZzpudWxsLGxlYWZUYWdzOm51bGx9CkgueGIodi50eXBlVW5pdmVy
-c2UsSlNPTi5wYXJzZSgneyJjNSI6Ik1GIiwiaUMiOiJNRiIsImtkIjoiTUYiLCJyeCI6ImVhIiwiZTUi
-OiJlYSIsIlkwIjoiZDUiLCJ0cCI6ImQ1IiwidjAiOiJldyIsIk1yIjoicUUiLCJlTCI6InFFIiwiSTAi
-OiJ1SCIsImhzIjoidUgiLCJYZyI6IlFGIiwibnIiOiJBaiIsInk0IjoidzYiLCJhUCI6IkNtIiwieGMi
-OiJueCIsImtKIjoibngiLCJ6VSI6IkRnIiwiZGYiOiJFVCIsInlFIjp7ImEyIjpbXX0sIllFIjp7ImM4
-IjpbXX0sIk1GIjp7InZtIjpbXSwiRUgiOltdfSwiamQiOnsiek0iOlsiMSJdLCJiUSI6WyIxIl0sImNY
-IjpbIjEiXX0sIlBvIjp7ImpkIjpbIjEiXSwiek0iOlsiMSJdLCJiUSI6WyIxIl0sImNYIjpbIjEiXX0s
-Im0xIjp7IkFuIjpbIjEiXX0sInFJIjp7IkNQIjpbXSwiRksiOltdfSwiYlUiOnsiS04iOltdLCJDUCI6
-W10sIkZLIjpbXX0sIlZBIjp7IkNQIjpbXSwiRksiOltdfSwiRHIiOnsicVUiOltdLCJ2WCI6W119LCJx
-aiI6eyJSZSI6WyJLTiJdLCJsRCI6WyJLTiJdLCJ6TSI6WyJLTiJdLCJiUSI6WyJLTiJdLCJjWCI6WyJL
-TiJdLCJsRC5FIjoiS04iLCJSZS5FIjoiS04ifSwiYlEiOnsiY1giOlsiMSJdfSwiYUwiOnsiYlEiOlsi
-MSJdLCJjWCI6WyIxIl19LCJuSCI6eyJhTCI6WyIxIl0sImJRIjpbIjEiXSwiY1giOlsiMSJdLCJhTC5F
-IjoiMSIsImNYLkUiOiIxIn0sImE3Ijp7IkFuIjpbIjEiXX0sImkxIjp7ImNYIjpbIjIiXSwiY1guRSI6
-IjIifSwieHkiOnsiaTEiOlsiMSIsIjIiXSwiYlEiOlsiMiJdLCJjWCI6WyIyIl0sImNYLkUiOiIyIn0s
-Ik1IIjp7IkFuIjpbIjIiXX0sIkE4Ijp7ImFMIjpbIjIiXSwiYlEiOlsiMiJdLCJjWCI6WyIyIl0sImFM
-LkUiOiIyIiwiY1guRSI6IjIifSwiVTUiOnsiY1giOlsiMSJdLCJjWC5FIjoiMSJ9LCJTTyI6eyJBbiI6
-WyIxIl19LCJYQyI6eyJSZSI6WyIxIl0sImxEIjpbIjEiXSwiek0iOlsiMSJdLCJiUSI6WyIxIl0sImNY
-IjpbIjEiXX0sInd2Ijp7IkdEIjpbXX0sIlBEIjp7IkdqIjpbIjEiLCIyIl0sIlJVIjpbIjEiLCIyIl0s
-IlBuIjpbIjEiLCIyIl0sIktQIjpbIjEiLCIyIl0sIlowIjpbIjEiLCIyIl19LCJXVSI6eyJaMCI6WyIx
-IiwiMiJdfSwiTFAiOnsiV1UiOlsiMSIsIjIiXSwiWjAiOlsiMSIsIjIiXX0sIlhSIjp7ImNYIjpbIjEi
-XSwiY1guRSI6IjEifSwiTEkiOnsidlEiOltdfSwiVzAiOnsiWFMiOltdfSwiYXoiOnsiWFMiOltdfSwi
-dlYiOnsiWFMiOltdfSwiWE8iOnsiR3oiOltdfSwiVHAiOnsiRUgiOltdfSwibGMiOnsiRUgiOltdfSwi
-engiOnsiRUgiOltdfSwiclQiOnsiRUgiOltdfSwiRXEiOnsiWFMiOltdfSwia1kiOnsiWFMiOltdfSwi
-TjUiOnsiRm8iOlsiMSIsIjIiXSwiWWsiOlsiMSIsIjIiXSwiWjAiOlsiMSIsIjIiXSwiWWsuSyI6IjEi
-LCJZay5WIjoiMiJ9LCJpNSI6eyJiUSI6WyIxIl0sImNYIjpbIjEiXSwiY1guRSI6IjEifSwiTjYiOnsi
-QW4iOlsiMSJdfSwiVlIiOnsid0wiOltdLCJ2WCI6W119LCJFSyI6eyJpYiI6W10sIk9kIjpbXX0sIktX
-Ijp7ImNYIjpbImliIl0sImNYLkUiOiJpYiJ9LCJQYiI6eyJBbiI6WyJpYiJdfSwidFEiOnsiT2QiOltd
-fSwidW4iOnsiY1giOlsiT2QiXSwiY1guRSI6Ik9kIn0sIlNkIjp7IkFuIjpbIk9kIl19LCJFVCI6eyJl
-cSI6W119LCJMWiI6eyJYaiI6WyJAIl0sIkVUIjpbXSwiZXEiOltdfSwiRGciOnsibEQiOlsiQ1AiXSwi
-WGoiOlsiQCJdLCJ6TSI6WyJDUCJdLCJFVCI6W10sImJRIjpbIkNQIl0sIlNVIjpbIkNQIl0sImVxIjpb
-XSwiY1giOlsiQ1AiXSwibEQuRSI6IkNQIn0sIlBnIjp7ImxEIjpbIktOIl0sInpNIjpbIktOIl0sIlhq
-IjpbIkAiXSwiRVQiOltdLCJiUSI6WyJLTiJdLCJTVSI6WyJLTiJdLCJlcSI6W10sImNYIjpbIktOIl19
-LCJ4aiI6eyJsRCI6WyJLTiJdLCJ6TSI6WyJLTiJdLCJYaiI6WyJAIl0sIkVUIjpbXSwiYlEiOlsiS04i
-XSwiU1UiOlsiS04iXSwiZXEiOltdLCJjWCI6WyJLTiJdLCJsRC5FIjoiS04ifSwiZEUiOnsibEQiOlsi
-S04iXSwiek0iOlsiS04iXSwiWGoiOlsiQCJdLCJFVCI6W10sImJRIjpbIktOIl0sIlNVIjpbIktOIl0s
-ImVxIjpbXSwiY1giOlsiS04iXSwibEQuRSI6IktOIn0sIlpBIjp7ImxEIjpbIktOIl0sInpNIjpbIktO
-Il0sIlhqIjpbIkAiXSwiRVQiOltdLCJiUSI6WyJLTiJdLCJTVSI6WyJLTiJdLCJlcSI6W10sImNYIjpb
-IktOIl0sImxELkUiOiJLTiJ9LCJ3ZiI6eyJsRCI6WyJLTiJdLCJ6TSI6WyJLTiJdLCJYaiI6WyJAIl0s
-IkVUIjpbXSwiYlEiOlsiS04iXSwiU1UiOlsiS04iXSwiZXEiOltdLCJjWCI6WyJLTiJdLCJsRC5FIjoi
-S04ifSwiUHEiOnsibEQiOlsiS04iXSwiek0iOlsiS04iXSwiWGoiOlsiQCJdLCJFVCI6W10sImJRIjpb
-IktOIl0sIlNVIjpbIktOIl0sImVxIjpbXSwiY1giOlsiS04iXSwibEQuRSI6IktOIn0sImVFIjp7ImxE
-IjpbIktOIl0sInpNIjpbIktOIl0sIlhqIjpbIkAiXSwiRVQiOltdLCJiUSI6WyJLTiJdLCJTVSI6WyJL
-TiJdLCJlcSI6W10sImNYIjpbIktOIl0sImxELkUiOiJLTiJ9LCJWNiI6eyJuNiI6W10sImxEIjpbIktO
-Il0sInpNIjpbIktOIl0sIlhqIjpbIkAiXSwiRVQiOltdLCJiUSI6WyJLTiJdLCJTVSI6WyJLTiJdLCJl
-cSI6W10sImNYIjpbIktOIl0sImxELkUiOiJLTiJ9LCJ1OSI6eyJYUyI6W119LCJoeiI6eyJYUyI6W119
-LCJpTSI6eyJYUyI6W119LCJHViI6eyJBbiI6WyIxIl19LCJxNCI6eyJjWCI6WyIxIl0sImNYLkUiOiIx
-In0sIlpmIjp7IlBmIjpbIjEiXX0sInZzIjp7ImI4IjpbIjEiXX0sIkN3Ijp7IlhTIjpbXX0sIm0wIjp7
-IkpCIjpbXX0sIkppIjp7IkpCIjpbXX0sImI2Ijp7Ilh2IjpbIjEiXSwieHUiOlsiMSJdLCJiUSI6WyIx
-Il0sImNYIjpbIjEiXX0sImxtIjp7IkFuIjpbIjEiXX0sIm1XIjp7ImNYIjpbIjEiXX0sInV5Ijp7ImxE
-IjpbIjEiXSwiek0iOlsiMSJdLCJiUSI6WyIxIl0sImNYIjpbIjEiXX0sImlsIjp7IllrIjpbIjEiLCIy
-Il0sIlowIjpbIjEiLCIyIl19LCJZayI6eyJaMCI6WyIxIiwiMiJdfSwiUG4iOnsiWjAiOlsiMSIsIjIi
-XX0sIkdqIjp7IlJVIjpbIjEiLCIyIl0sIlBuIjpbIjEiLCIyIl0sIktQIjpbIjEiLCIyIl0sIlowIjpb
-IjEiLCIyIl19LCJWaiI6eyJsZiI6WyIxIl0sInh1IjpbIjEiXSwiYlEiOlsiMSJdLCJjWCI6WyIxIl19
-LCJYdiI6eyJ4dSI6WyIxIl0sImJRIjpbIjEiXSwiY1giOlsiMSJdfSwidXciOnsiWWsiOlsicVUiLCJA
-Il0sIlowIjpbInFVIiwiQCJdLCJZay5LIjoicVUiLCJZay5WIjoiQCJ9LCJpOCI6eyJhTCI6WyJxVSJd
-LCJiUSI6WyJxVSJdLCJjWCI6WyJxVSJdLCJhTC5FIjoicVUiLCJjWC5FIjoicVUifSwiQ1YiOnsiVWsi
-Olsiek08S04+IiwicVUiXSwiVWsuUyI6InpNPEtOPiJ9LCJVOCI6eyJ3SSI6WyJ6TTxLTj4iLCJxVSJd
-fSwiWmkiOnsiVWsiOlsicVUiLCJ6TTxLTj4iXX0sIlVkIjp7IlhTIjpbXX0sIks4Ijp7IlhTIjpbXX0s
-ImJ5Ijp7IlVrIjpbImsiLCJxVSJdLCJVay5TIjoiayJ9LCJvaiI6eyJ3SSI6WyJrIiwicVUiXX0sIk14
-Ijp7IndJIjpbInFVIiwiayJdfSwidTUiOnsiVWsiOlsicVUiLCJ6TTxLTj4iXSwiVWsuUyI6InFVIn0s
-IkUzIjp7IndJIjpbInFVIiwiek08S04+Il19LCJHWSI6eyJ3SSI6WyJ6TTxLTj4iLCJxVSJdfSwiQ1Ai
-OnsiRksiOltdfSwiQzYiOnsiWFMiOltdfSwibiI6eyJYUyI6W119LCJ1Ijp7IlhTIjpbXX0sImJKIjp7
-IlhTIjpbXX0sImVZIjp7IlhTIjpbXX0sIm1wIjp7IlhTIjpbXX0sInViIjp7IlhTIjpbXX0sImRzIjp7
-IlhTIjpbXX0sImxqIjp7IlhTIjpbXX0sIlVWIjp7IlhTIjpbXX0sIms1Ijp7IlhTIjpbXX0sIktZIjp7
-IlhTIjpbXX0sImMiOnsiWFMiOltdfSwiQ0QiOnsiUnoiOltdfSwiYUUiOnsiUnoiOltdfSwiS04iOnsi
-RksiOltdfSwiek0iOnsiYlEiOlsiMSJdLCJjWCI6WyIxIl19LCJpYiI6eyJPZCI6W119LCJ4dSI6eyJi
-USI6WyIxIl0sImNYIjpbIjEiXX0sInFVIjp7InZYIjpbXX0sIlJuIjp7IkJMIjpbXX0sIkRuIjp7ImlE
-IjpbXX0sIlVmIjp7ImlEIjpbXX0sInFlIjp7ImlEIjpbXX0sInFFIjp7ImN2IjpbXSwidUgiOltdLCJE
-MCI6W119LCJHaCI6eyJjdiI6W10sInVIIjpbXSwiRDAiOltdfSwiZlkiOnsiY3YiOltdLCJ1SCI6W10s
-IkQwIjpbXX0sIm5CIjp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119LCJRUCI6eyJjdiI6W10sInVIIjpb
-XSwiRDAiOltdfSwibngiOnsidUgiOltdLCJEMCI6W119LCJRRiI6eyJ1SCI6W10sIkQwIjpbXX0sIklC
-Ijp7InRuIjpbIkZLIl19LCJ3eiI6eyJsRCI6WyIxIl0sInpNIjpbIjEiXSwiYlEiOlsiMSJdLCJjWCI6
-WyIxIl0sImxELkUiOiIxIn0sImN2Ijp7InVIIjpbXSwiRDAiOltdfSwiaEgiOnsiQXoiOltdfSwiaDQi
-OnsiY3YiOltdLCJ1SCI6W10sIkQwIjpbXX0sIlZiIjp7InVIIjpbXSwiRDAiOltdfSwiTzciOnsiRDAi
-OltdfSwid2EiOnsiRDAiOltdfSwiQWoiOnsiZWEiOltdfSwiZTciOnsibEQiOlsidUgiXSwiek0iOlsi
-dUgiXSwiYlEiOlsidUgiXSwiY1giOlsidUgiXSwibEQuRSI6InVIIn0sInVIIjp7IkQwIjpbXX0sIkJI
-Ijp7IkdtIjpbInVIIl0sImxEIjpbInVIIl0sInpNIjpbInVIIl0sIlhqIjpbInVIIl0sImJRIjpbInVI
-Il0sImNYIjpbInVIIl0sImxELkUiOiJ1SCIsIkdtLkUiOiJ1SCJ9LCJTTiI6eyJjdiI6W10sInVIIjpb
-XSwiRDAiOltdfSwiZXciOnsiZWEiOltdfSwibHAiOnsiY3YiOltdLCJ1SCI6W10sIkQwIjpbXX0sIlRi
-Ijp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119LCJJdiI6eyJjdiI6W10sInVIIjpbXSwiRDAiOltdfSwi
-V1AiOnsiY3YiOltdLCJ1SCI6W10sIkQwIjpbXX0sInlZIjp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119
-LCJ3NiI6eyJlYSI6W119LCJLNSI6eyJ2NiI6W10sIkQwIjpbXX0sIkNtIjp7IkQwIjpbXX0sIkNRIjp7
-InVIIjpbXSwiRDAiOltdfSwidzQiOnsidG4iOlsiRksiXX0sInJoIjp7IkdtIjpbInVIIl0sImxEIjpb
-InVIIl0sInpNIjpbInVIIl0sIlhqIjpbInVIIl0sImJRIjpbInVIIl0sImNYIjpbInVIIl0sImxELkUi
-OiJ1SCIsIkdtLkUiOiJ1SCJ9LCJjZiI6eyJZayI6WyJxVSIsInFVIl0sIlowIjpbInFVIiwicVUiXX0s
-Imk3Ijp7IllrIjpbInFVIiwicVUiXSwiWjAiOlsicVUiLCJxVSJdLCJZay5LIjoicVUiLCJZay5WIjoi
-cVUifSwiU3kiOnsiWWsiOlsicVUiLCJxVSJdLCJaMCI6WyJxVSIsInFVIl0sIllrLksiOiJxVSIsIllr
-LlYiOiJxVSJ9LCJJNCI6eyJsZiI6WyJxVSJdLCJ4dSI6WyJxVSJdLCJiUSI6WyJxVSJdLCJjWCI6WyJx
-VSJdfSwiUk8iOnsicWgiOlsiMSJdfSwiZXUiOnsiUk8iOlsiMSJdLCJxaCI6WyIxIl19LCJ4QyI6eyJN
-TyI6WyIxIl19LCJKUSI6eyJrRiI6W119LCJ2RCI6eyJrRiI6W119LCJtNiI6eyJrRiI6W119LCJjdCI6
-eyJrRiI6W119LCJPdyI6eyJrRiI6W119LCJXOSI6eyJBbiI6WyIxIl19LCJkVyI6eyJ2NiI6W10sIkQw
-IjpbXX0sIm1rIjp7InkwIjpbXX0sIktvIjp7Im9uIjpbXX0sIkFzIjp7ImxmIjpbInFVIl0sInh1Ijpb
-InFVIl0sImJRIjpbInFVIl0sImNYIjpbInFVIl19LCJyNyI6eyJFNCI6W119LCJUeiI6eyJsRCI6WyIx
-Il0sInpNIjpbIjEiXSwiYlEiOlsiMSJdLCJFNCI6W10sImNYIjpbIjEiXSwibEQuRSI6IjEifSwibmQi
-OnsiZDUiOltdLCJjdiI6W10sInVIIjpbXSwiRDAiOltdfSwiS2UiOnsibGYiOlsicVUiXSwieHUiOlsi
-cVUiXSwiYlEiOlsicVUiXSwiY1giOlsicVUiXX0sImQ1Ijp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119
-LCJuNiI6eyJ6TSI6WyJLTiJdLCJiUSI6WyJLTiJdLCJlcSI6W10sImNYIjpbIktOIl19LCJYQSI6eyJr
-RiI6W119LCJkdiI6eyJSeiI6W119LCJPRiI6eyJmdiI6W119LCJydSI6eyJmdiI6W119LCJJViI6eyJm
-diI6W119fScpKQpILkZGKHYudHlwZVVuaXZlcnNlLEpTT04ucGFyc2UoJ3siYlEiOjEsIlhDIjoxLCJN
-TyI6MSwia1QiOjIsIm1XIjoxLCJ1eSI6MSwiaWwiOjIsIlZqIjoxLCJuWSI6MSwiVEMiOjEsImNvIjox
-fScpKQp2YXIgdT0oZnVuY3Rpb24gcnRpaSgpe3ZhciB0PUguTjAKcmV0dXJue2JxOnQoIkdoIiksbjp0
-KCJDdyIpLGNSOnQoIm5CIiksZDp0KCJBeiIpLFk6dCgiUVAiKSxnRjp0KCJQRDxHRCxAPiIpLGd3OnQo
-ImJRPEA+IiksaDp0KCJjdiIpLGJVOnQoIlhTIiksQjp0KCJlYSIpLHI6dCgiRDAiKSxnODp0KCJSeiIp
-LGM4OnQoImhIIiksWjp0KCJFSCIpLGM6dCgiYjg8QD4iKSxEOnQoIkxMIiksZ3A6dCgiSDciKSxJOnQo
-IlNnIiksbzp0KCJ2USIpLGVoOnQoImNYPHVIPiIpLFg6dCgiY1g8cVU+IiksUjp0KCJjWDxAPiIpLGZB
-OnQoImpkPFNlPiIpLGdpOnQoImpkPGo4PiIpLEo6dCgiamQ8WjA8cVUsaz4+IiksZmg6dCgiamQ8Wlo+
-IiksaTp0KCJqZDxrRj4iKSxzOnQoImpkPHFVPiIpLGhoOnQoImpkPHlEPiIpLGFKOnQoImpkPHdiPiIp
-LGI6dCgiamQ8QD4iKSx0OnQoImpkPEtOPiIpLGVIOnQoInZtIiksZzp0KCJjNSIpLGFVOnQoIlhqPEA+
-IiksYW06dCgiVHo8QD4iKSxlbzp0KCJONTxHRCxAPiIpLG06dCgiRTQiKSxkejp0KCJoRiIpLGY0OnQo
-InpNPGo4PiIpLGQzOnQoInpNPFowPHFVLGs+PiIpLGV3OnQoInpNPGs+IiksYTp0KCJ6TTxxVT4iKSxq
-OnQoInpNPEA+IiksTDp0KCJ6TTxLTj4iKSxhXzp0KCJ1OCIpLFM6dCgiWjA8cVUsaz4iKSxmOnQoIlow
-PHFVLHFVPiIpLGs6dCgiWjA8cVUsQD4iKSxHOnQoIlowPEAsQD4iKSxkdjp0KCJBODxxVSxxVT4iKSxk
-bzp0KCJBODxxVSxAPiIpLFY6dCgiQWoiKSxkRDp0KCJFVCIpLGJtOnQoIlY2IiksQTp0KCJ1SCIpLGU6
-dCgia0YiKSxQOnQoImM4IiksSzp0KCJrIikscDp0KCJldyIpLHE6dCgidG48Rks+IiksZnY6dCgid0wi
-KSxhdjp0KCJKYyIpLGFPOnQoIm5kIiksQzp0KCJ4dTxxVT4iKSxsOnQoIkd6IiksTjp0KCJxVSIpLGRH
-OnQoInFVKHFVKSIpLGc3OnQoImQ1IiksZm86dCgiR0QiKSxhVzp0KCJ5WSIpLHU6dCgiZXEiKSxnYzp0
-KCJuNiIpLGFrOnQoImtkIiksVzp0KCJHajxxVSxxVT4iKSx2OnQoImlEIiksY2M6dCgiVTU8cVU+Iiks
-ZzQ6dCgiSzUiKSxjaTp0KCJ2NiIpLGcyOnQoIkNtIiksYmo6dCgiWmY8Tzc+IiksaDk6dCgiQ1EiKSxh
-Yzp0KCJlNyIpLFE6dCgiZXU8QWo+IiksVDp0KCJ3ejxjdj4iKSx4OnQoIkZlPEAsQD4iKSxhbzp0KCJ2
-czxPNz4iKSxfOnQoInZzPEA+IiksZko6dCgidnM8S04+IiksTzp0KCJKUSIpLHk6dCgiYm4iKSxjSjp0
-KCJhMiIpLGFsOnQoImEyKGspIiksYkI6dCgiYTIocVUpIiksYmY6dCgiYTIoQCkiKSx6OnQoIkAiKSxm
-Tzp0KCJAKCkiKSxVOnQoIkAoZWEpIiksdzp0KCJAKGspIiksZXA6dCgiQChrLGspIiksRTp0KCJAKGss
-R3opIiksY2g6dCgiQCh4dTxxVT4pIiksZE86dCgiQChxVSkiKSxiYzp0KCJAKEApIiksYjg6dCgiQChA
-LEApIiksZWc6dCgiS04iKSxIOnQoIn4iKSxNOnQoIn4oKSIpLGFuOnQoIn4oZXcpIiksRjp0KCJ+KHFV
-LHFVKSIpLGNBOnQoIn4ocVUsQCkiKX19KSgpOyhmdW5jdGlvbiBjb25zdGFudHMoKXt2YXIgdD1odW5r
-SGVscGVycy5tYWtlQ29uc3RMaXN0CkMuUlk9Vy5RUC5wcm90b3R5cGUKQy5CWj1XLlZiLnByb3RvdHlw
-ZQpDLkR0PVcuTzcucHJvdG90eXBlCkMuT2s9Si52Qi5wcm90b3R5cGUKQy5ObT1KLmpkLnByb3RvdHlw
-ZQpDLmpuPUouYlUucHJvdG90eXBlCkMuQ0Q9Si5xSS5wcm90b3R5cGUKQy54Qj1KLkRyLnByb3RvdHlw
-ZQpDLkRHPUouYzUucHJvdG90eXBlCkMuRXg9Vy51OC5wcm90b3R5cGUKQy5MdD1XLlNOLnByb3RvdHlw
-ZQpDLlpRPUouaUMucHJvdG90eXBlCkMuSWU9Vy5UYi5wcm90b3R5cGUKQy52Qj1KLmtkLnByb3RvdHlw
-ZQpDLm9sPVcuSzUucHJvdG90eXBlCkMueTg9bmV3IFAuVTgoKQpDLmg5PW5ldyBQLkNWKCkKQy5PND1m
-dW5jdGlvbiBnZXRUYWdGYWxsYmFjayhvKSB7CiAgdmFyIHMgPSBPYmplY3QucHJvdG90eXBlLnRvU3Ry
-aW5nLmNhbGwobyk7CiAgcmV0dXJuIHMuc3Vic3RyaW5nKDgsIHMubGVuZ3RoIC0gMSk7Cn0KQy5ZcT1m
-dW5jdGlvbigpIHsKICB2YXIgdG9TdHJpbmdGdW5jdGlvbiA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJp
-bmc7CiAgZnVuY3Rpb24gZ2V0VGFnKG8pIHsKICAgIHZhciBzID0gdG9TdHJpbmdGdW5jdGlvbi5jYWxs
-KG8pOwogICAgcmV0dXJuIHMuc3Vic3RyaW5nKDgsIHMubGVuZ3RoIC0gMSk7CiAgfQogIGZ1bmN0aW9u
-IGdldFVua25vd25UYWcob2JqZWN0LCB0YWcpIHsKICAgIGlmICgvXkhUTUxbQS1aXS4qRWxlbWVudCQv
-LnRlc3QodGFnKSkgewogICAgICB2YXIgbmFtZSA9IHRvU3RyaW5nRnVuY3Rpb24uY2FsbChvYmplY3Qp
-OwogICAgICBpZiAobmFtZSA9PSAiW29iamVjdCBPYmplY3RdIikgcmV0dXJuIG51bGw7CiAgICAgIHJl
-dHVybiAiSFRNTEVsZW1lbnQiOwogICAgfQogIH0KICBmdW5jdGlvbiBnZXRVbmtub3duVGFnR2VuZXJp
-Y0Jyb3dzZXIob2JqZWN0LCB0YWcpIHsKICAgIGlmIChzZWxmLkhUTUxFbGVtZW50ICYmIG9iamVjdCBp
-bnN0YW5jZW9mIEhUTUxFbGVtZW50KSByZXR1cm4gIkhUTUxFbGVtZW50IjsKICAgIHJldHVybiBnZXRV
-bmtub3duVGFnKG9iamVjdCwgdGFnKTsKICB9CiAgZnVuY3Rpb24gcHJvdG90eXBlRm9yVGFnKHRhZykg
-ewogICAgaWYgKHR5cGVvZiB3aW5kb3cgPT0gInVuZGVmaW5lZCIpIHJldHVybiBudWxsOwogICAgaWYg
-KHR5cGVvZiB3aW5kb3dbdGFnXSA9PSAidW5kZWZpbmVkIikgcmV0dXJuIG51bGw7CiAgICB2YXIgY29u
-c3RydWN0b3IgPSB3aW5kb3dbdGFnXTsKICAgIGlmICh0eXBlb2YgY29uc3RydWN0b3IgIT0gImZ1bmN0
-aW9uIikgcmV0dXJuIG51bGw7CiAgICByZXR1cm4gY29uc3RydWN0b3IucHJvdG90eXBlOwogIH0KICBm
-dW5jdGlvbiBkaXNjcmltaW5hdG9yKHRhZykgeyByZXR1cm4gbnVsbDsgfQogIHZhciBpc0Jyb3dzZXIg
-PSB0eXBlb2YgbmF2aWdhdG9yID09ICJvYmplY3QiOwogIHJldHVybiB7CiAgICBnZXRUYWc6IGdldFRh
-ZywKICAgIGdldFVua25vd25UYWc6IGlzQnJvd3NlciA/IGdldFVua25vd25UYWdHZW5lcmljQnJvd3Nl
-ciA6IGdldFVua25vd25UYWcsCiAgICBwcm90b3R5cGVGb3JUYWc6IHByb3RvdHlwZUZvclRhZywKICAg
-IGRpc2NyaW1pbmF0b3I6IGRpc2NyaW1pbmF0b3IgfTsKfQpDLndiPWZ1bmN0aW9uKGdldFRhZ0ZhbGxi
-YWNrKSB7CiAgcmV0dXJuIGZ1bmN0aW9uKGhvb2tzKSB7CiAgICBpZiAodHlwZW9mIG5hdmlnYXRvciAh
-PSAib2JqZWN0IikgcmV0dXJuIGhvb2tzOwogICAgdmFyIHVhID0gbmF2aWdhdG9yLnVzZXJBZ2VudDsK
-ICAgIGlmICh1YS5pbmRleE9mKCJEdW1wUmVuZGVyVHJlZSIpID49IDApIHJldHVybiBob29rczsKICAg
-IGlmICh1YS5pbmRleE9mKCJDaHJvbWUiKSA+PSAwKSB7CiAgICAgIGZ1bmN0aW9uIGNvbmZpcm0ocCkg
-ewogICAgICAgIHJldHVybiB0eXBlb2Ygd2luZG93ID09ICJvYmplY3QiICYmIHdpbmRvd1twXSAmJiB3
-aW5kb3dbcF0ubmFtZSA9PSBwOwogICAgICB9CiAgICAgIGlmIChjb25maXJtKCJXaW5kb3ciKSAmJiBj
-b25maXJtKCJIVE1MRWxlbWVudCIpKSByZXR1cm4gaG9va3M7CiAgICB9CiAgICBob29rcy5nZXRUYWcg
-PSBnZXRUYWdGYWxsYmFjazsKICB9Owp9CkMuS1U9ZnVuY3Rpb24oaG9va3MpIHsKICBpZiAodHlwZW9m
-IGRhcnRFeHBlcmltZW50YWxGaXh1cEdldFRhZyAhPSAiZnVuY3Rpb24iKSByZXR1cm4gaG9va3M7CiAg
-aG9va3MuZ2V0VGFnID0gZGFydEV4cGVyaW1lbnRhbEZpeHVwR2V0VGFnKGhvb2tzLmdldFRhZyk7Cn0K
-Qy5mUT1mdW5jdGlvbihob29rcykgewogIHZhciBnZXRUYWcgPSBob29rcy5nZXRUYWc7CiAgdmFyIHBy
-b3RvdHlwZUZvclRhZyA9IGhvb2tzLnByb3RvdHlwZUZvclRhZzsKICBmdW5jdGlvbiBnZXRUYWdGaXhl
-ZChvKSB7CiAgICB2YXIgdGFnID0gZ2V0VGFnKG8pOwogICAgaWYgKHRhZyA9PSAiRG9jdW1lbnQiKSB7
-CiAgICAgIGlmICghIW8ueG1sVmVyc2lvbikgcmV0dXJuICIhRG9jdW1lbnQiOwogICAgICByZXR1cm4g
-IiFIVE1MRG9jdW1lbnQiOwogICAgfQogICAgcmV0dXJuIHRhZzsKICB9CiAgZnVuY3Rpb24gcHJvdG90
-eXBlRm9yVGFnRml4ZWQodGFnKSB7CiAgICBpZiAodGFnID09ICJEb2N1bWVudCIpIHJldHVybiBudWxs
-OwogICAgcmV0dXJuIHByb3RvdHlwZUZvclRhZyh0YWcpOwogIH0KICBob29rcy5nZXRUYWcgPSBnZXRU
-YWdGaXhlZDsKICBob29rcy5wcm90b3R5cGVGb3JUYWcgPSBwcm90b3R5cGVGb3JUYWdGaXhlZDsKfQpD
-LmRrPWZ1bmN0aW9uKGhvb2tzKSB7CiAgdmFyIHVzZXJBZ2VudCA9IHR5cGVvZiBuYXZpZ2F0b3IgPT0g
-Im9iamVjdCIgPyBuYXZpZ2F0b3IudXNlckFnZW50IDogIiI7CiAgaWYgKHVzZXJBZ2VudC5pbmRleE9m
-KCJGaXJlZm94IikgPT0gLTEpIHJldHVybiBob29rczsKICB2YXIgZ2V0VGFnID0gaG9va3MuZ2V0VGFn
-OwogIHZhciBxdWlja01hcCA9IHsKICAgICJCZWZvcmVVbmxvYWRFdmVudCI6ICJFdmVudCIsCiAgICAi
-RGF0YVRyYW5zZmVyIjogIkNsaXBib2FyZCIsCiAgICAiR2VvR2VvbG9jYXRpb24iOiAiR2VvbG9jYXRp
-b24iLAogICAgIkxvY2F0aW9uIjogIiFMb2NhdGlvbiIsCiAgICAiV29ya2VyTWVzc2FnZUV2ZW50Ijog
-Ik1lc3NhZ2VFdmVudCIsCiAgICAiWE1MRG9jdW1lbnQiOiAiIURvY3VtZW50In07CiAgZnVuY3Rpb24g
-Z2V0VGFnRmlyZWZveChvKSB7CiAgICB2YXIgdGFnID0gZ2V0VGFnKG8pOwogICAgcmV0dXJuIHF1aWNr
-TWFwW3RhZ10gfHwgdGFnOwogIH0KICBob29rcy5nZXRUYWcgPSBnZXRUYWdGaXJlZm94Owp9CkMueGk9
-ZnVuY3Rpb24oaG9va3MpIHsKICB2YXIgdXNlckFnZW50ID0gdHlwZW9mIG5hdmlnYXRvciA9PSAib2Jq
-ZWN0IiA/IG5hdmlnYXRvci51c2VyQWdlbnQgOiAiIjsKICBpZiAodXNlckFnZW50LmluZGV4T2YoIlRy
-aWRlbnQvIikgPT0gLTEpIHJldHVybiBob29rczsKICB2YXIgZ2V0VGFnID0gaG9va3MuZ2V0VGFnOwog
-IHZhciBxdWlja01hcCA9IHsKICAgICJCZWZvcmVVbmxvYWRFdmVudCI6ICJFdmVudCIsCiAgICAiRGF0
-YVRyYW5zZmVyIjogIkNsaXBib2FyZCIsCiAgICAiSFRNTERERWxlbWVudCI6ICJIVE1MRWxlbWVudCIs
-CiAgICAiSFRNTERURWxlbWVudCI6ICJIVE1MRWxlbWVudCIsCiAgICAiSFRNTFBocmFzZUVsZW1lbnQi
-OiAiSFRNTEVsZW1lbnQiLAogICAgIlBvc2l0aW9uIjogIkdlb3Bvc2l0aW9uIgogIH07CiAgZnVuY3Rp
-b24gZ2V0VGFnSUUobykgewogICAgdmFyIHRhZyA9IGdldFRhZyhvKTsKICAgIHZhciBuZXdUYWcgPSBx
-dWlja01hcFt0YWddOwogICAgaWYgKG5ld1RhZykgcmV0dXJuIG5ld1RhZzsKICAgIGlmICh0YWcgPT0g
-Ik9iamVjdCIpIHsKICAgICAgaWYgKHdpbmRvdy5EYXRhVmlldyAmJiAobyBpbnN0YW5jZW9mIHdpbmRv
-dy5EYXRhVmlldykpIHJldHVybiAiRGF0YVZpZXciOwogICAgfQogICAgcmV0dXJuIHRhZzsKICB9CiAg
-ZnVuY3Rpb24gcHJvdG90eXBlRm9yVGFnSUUodGFnKSB7CiAgICB2YXIgY29uc3RydWN0b3IgPSB3aW5k
-b3dbdGFnXTsKICAgIGlmIChjb25zdHJ1Y3RvciA9PSBudWxsKSByZXR1cm4gbnVsbDsKICAgIHJldHVy
-biBjb25zdHJ1Y3Rvci5wcm90b3R5cGU7CiAgfQogIGhvb2tzLmdldFRhZyA9IGdldFRhZ0lFOwogIGhv
-b2tzLnByb3RvdHlwZUZvclRhZyA9IHByb3RvdHlwZUZvclRhZ0lFOwp9CkMuaTc9ZnVuY3Rpb24oaG9v
-a3MpIHsgcmV0dXJuIGhvb2tzOyB9CgpDLkN0PW5ldyBQLmJ5KCkKQy5FcT1uZXcgUC5rNSgpCkMueE09
-bmV3IFAudTUoKQpDLlFrPW5ldyBQLkUzKCkKQy5OVT1uZXcgUC5KaSgpCkMuQWQ9bmV3IE0uSDcoMCwi
-SGludEFjdGlvbktpbmQuYWRkTnVsbGFibGVIaW50IikKQy5uZT1uZXcgTS5INygxLCJIaW50QWN0aW9u
-S2luZC5hZGROb25OdWxsYWJsZUhpbnQiKQpDLm15PW5ldyBNLkg3KDIsIkhpbnRBY3Rpb25LaW5kLmNo
-YW5nZVRvTnVsbGFibGVIaW50IikKQy5yeD1uZXcgTS5INygzLCJIaW50QWN0aW9uS2luZC5jaGFuZ2VU
-b05vbk51bGxhYmxlSGludCIpCkMud1Y9bmV3IE0uSDcoNCwiSGludEFjdGlvbktpbmQucmVtb3ZlTnVs
-bGFibGVIaW50IikKQy5mUj1uZXcgTS5INyg1LCJIaW50QWN0aW9uS2luZC5yZW1vdmVOb25OdWxsYWJs
-ZUhpbnQiKQpDLkEzPW5ldyBQLk14KG51bGwpCkMublg9bmV3IFAub2oobnVsbCkKQy5HYj1ILlZNKHQo
-WzEyNywyMDQ3LDY1NTM1LDExMTQxMTFdKSx1LnQpCkMuYWs9SC5WTSh0KFswLDAsMzI3NzYsMzM3OTIs
-MSwxMDI0MCwwLDBdKSx1LnQpCkMuY209SC5WTSh0KFsiKjo6Y2xhc3MiLCIqOjpkaXIiLCIqOjpkcmFn
-Z2FibGUiLCIqOjpoaWRkZW4iLCIqOjppZCIsIio6OmluZXJ0IiwiKjo6aXRlbXByb3AiLCIqOjppdGVt
-cmVmIiwiKjo6aXRlbXNjb3BlIiwiKjo6bGFuZyIsIio6OnNwZWxsY2hlY2siLCIqOjp0aXRsZSIsIio6
-OnRyYW5zbGF0ZSIsIkE6OmFjY2Vzc2tleSIsIkE6OmNvb3JkcyIsIkE6OmhyZWZsYW5nIiwiQTo6bmFt
-ZSIsIkE6OnNoYXBlIiwiQTo6dGFiaW5kZXgiLCJBOjp0YXJnZXQiLCJBOjp0eXBlIiwiQVJFQTo6YWNj
-ZXNza2V5IiwiQVJFQTo6YWx0IiwiQVJFQTo6Y29vcmRzIiwiQVJFQTo6bm9ocmVmIiwiQVJFQTo6c2hh
-cGUiLCJBUkVBOjp0YWJpbmRleCIsIkFSRUE6OnRhcmdldCIsIkFVRElPOjpjb250cm9scyIsIkFVRElP
-Ojpsb29wIiwiQVVESU86Om1lZGlhZ3JvdXAiLCJBVURJTzo6bXV0ZWQiLCJBVURJTzo6cHJlbG9hZCIs
-IkJETzo6ZGlyIiwiQk9EWTo6YWxpbmsiLCJCT0RZOjpiZ2NvbG9yIiwiQk9EWTo6bGluayIsIkJPRFk6
-OnRleHQiLCJCT0RZOjp2bGluayIsIkJSOjpjbGVhciIsIkJVVFRPTjo6YWNjZXNza2V5IiwiQlVUVE9O
-OjpkaXNhYmxlZCIsIkJVVFRPTjo6bmFtZSIsIkJVVFRPTjo6dGFiaW5kZXgiLCJCVVRUT046OnR5cGUi
-LCJCVVRUT046OnZhbHVlIiwiQ0FOVkFTOjpoZWlnaHQiLCJDQU5WQVM6OndpZHRoIiwiQ0FQVElPTjo6
-YWxpZ24iLCJDT0w6OmFsaWduIiwiQ09MOjpjaGFyIiwiQ09MOjpjaGFyb2ZmIiwiQ09MOjpzcGFuIiwi
-Q09MOjp2YWxpZ24iLCJDT0w6OndpZHRoIiwiQ09MR1JPVVA6OmFsaWduIiwiQ09MR1JPVVA6OmNoYXIi
-LCJDT0xHUk9VUDo6Y2hhcm9mZiIsIkNPTEdST1VQOjpzcGFuIiwiQ09MR1JPVVA6OnZhbGlnbiIsIkNP
-TEdST1VQOjp3aWR0aCIsIkNPTU1BTkQ6OmNoZWNrZWQiLCJDT01NQU5EOjpjb21tYW5kIiwiQ09NTUFO
-RDo6ZGlzYWJsZWQiLCJDT01NQU5EOjpsYWJlbCIsIkNPTU1BTkQ6OnJhZGlvZ3JvdXAiLCJDT01NQU5E
-Ojp0eXBlIiwiREFUQTo6dmFsdWUiLCJERUw6OmRhdGV0aW1lIiwiREVUQUlMUzo6b3BlbiIsIkRJUjo6
-Y29tcGFjdCIsIkRJVjo6YWxpZ24iLCJETDo6Y29tcGFjdCIsIkZJRUxEU0VUOjpkaXNhYmxlZCIsIkZP
-TlQ6OmNvbG9yIiwiRk9OVDo6ZmFjZSIsIkZPTlQ6OnNpemUiLCJGT1JNOjphY2NlcHQiLCJGT1JNOjph
-dXRvY29tcGxldGUiLCJGT1JNOjplbmN0eXBlIiwiRk9STTo6bWV0aG9kIiwiRk9STTo6bmFtZSIsIkZP
-Uk06Om5vdmFsaWRhdGUiLCJGT1JNOjp0YXJnZXQiLCJGUkFNRTo6bmFtZSIsIkgxOjphbGlnbiIsIkgy
-OjphbGlnbiIsIkgzOjphbGlnbiIsIkg0OjphbGlnbiIsIkg1OjphbGlnbiIsIkg2OjphbGlnbiIsIkhS
-OjphbGlnbiIsIkhSOjpub3NoYWRlIiwiSFI6OnNpemUiLCJIUjo6d2lkdGgiLCJIVE1MOjp2ZXJzaW9u
-IiwiSUZSQU1FOjphbGlnbiIsIklGUkFNRTo6ZnJhbWVib3JkZXIiLCJJRlJBTUU6OmhlaWdodCIsIklG
-UkFNRTo6bWFyZ2luaGVpZ2h0IiwiSUZSQU1FOjptYXJnaW53aWR0aCIsIklGUkFNRTo6d2lkdGgiLCJJ
-TUc6OmFsaWduIiwiSU1HOjphbHQiLCJJTUc6OmJvcmRlciIsIklNRzo6aGVpZ2h0IiwiSU1HOjpoc3Bh
-Y2UiLCJJTUc6OmlzbWFwIiwiSU1HOjpuYW1lIiwiSU1HOjp1c2VtYXAiLCJJTUc6OnZzcGFjZSIsIklN
-Rzo6d2lkdGgiLCJJTlBVVDo6YWNjZXB0IiwiSU5QVVQ6OmFjY2Vzc2tleSIsIklOUFVUOjphbGlnbiIs
-IklOUFVUOjphbHQiLCJJTlBVVDo6YXV0b2NvbXBsZXRlIiwiSU5QVVQ6OmF1dG9mb2N1cyIsIklOUFVU
-OjpjaGVja2VkIiwiSU5QVVQ6OmRpc2FibGVkIiwiSU5QVVQ6OmlucHV0bW9kZSIsIklOUFVUOjppc21h
-cCIsIklOUFVUOjpsaXN0IiwiSU5QVVQ6Om1heCIsIklOUFVUOjptYXhsZW5ndGgiLCJJTlBVVDo6bWlu
-IiwiSU5QVVQ6Om11bHRpcGxlIiwiSU5QVVQ6Om5hbWUiLCJJTlBVVDo6cGxhY2Vob2xkZXIiLCJJTlBV
-VDo6cmVhZG9ubHkiLCJJTlBVVDo6cmVxdWlyZWQiLCJJTlBVVDo6c2l6ZSIsIklOUFVUOjpzdGVwIiwi
-SU5QVVQ6OnRhYmluZGV4IiwiSU5QVVQ6OnR5cGUiLCJJTlBVVDo6dXNlbWFwIiwiSU5QVVQ6OnZhbHVl
-IiwiSU5TOjpkYXRldGltZSIsIktFWUdFTjo6ZGlzYWJsZWQiLCJLRVlHRU46OmtleXR5cGUiLCJLRVlH
-RU46Om5hbWUiLCJMQUJFTDo6YWNjZXNza2V5IiwiTEFCRUw6OmZvciIsIkxFR0VORDo6YWNjZXNza2V5
-IiwiTEVHRU5EOjphbGlnbiIsIkxJOjp0eXBlIiwiTEk6OnZhbHVlIiwiTElOSzo6c2l6ZXMiLCJNQVA6
-Om5hbWUiLCJNRU5VOjpjb21wYWN0IiwiTUVOVTo6bGFiZWwiLCJNRU5VOjp0eXBlIiwiTUVURVI6Omhp
-Z2giLCJNRVRFUjo6bG93IiwiTUVURVI6Om1heCIsIk1FVEVSOjptaW4iLCJNRVRFUjo6dmFsdWUiLCJP
-QkpFQ1Q6OnR5cGVtdXN0bWF0Y2giLCJPTDo6Y29tcGFjdCIsIk9MOjpyZXZlcnNlZCIsIk9MOjpzdGFy
-dCIsIk9MOjp0eXBlIiwiT1BUR1JPVVA6OmRpc2FibGVkIiwiT1BUR1JPVVA6OmxhYmVsIiwiT1BUSU9O
-OjpkaXNhYmxlZCIsIk9QVElPTjo6bGFiZWwiLCJPUFRJT046OnNlbGVjdGVkIiwiT1BUSU9OOjp2YWx1
-ZSIsIk9VVFBVVDo6Zm9yIiwiT1VUUFVUOjpuYW1lIiwiUDo6YWxpZ24iLCJQUkU6OndpZHRoIiwiUFJP
-R1JFU1M6Om1heCIsIlBST0dSRVNTOjptaW4iLCJQUk9HUkVTUzo6dmFsdWUiLCJTRUxFQ1Q6OmF1dG9j
-b21wbGV0ZSIsIlNFTEVDVDo6ZGlzYWJsZWQiLCJTRUxFQ1Q6Om11bHRpcGxlIiwiU0VMRUNUOjpuYW1l
-IiwiU0VMRUNUOjpyZXF1aXJlZCIsIlNFTEVDVDo6c2l6ZSIsIlNFTEVDVDo6dGFiaW5kZXgiLCJTT1VS
-Q0U6OnR5cGUiLCJUQUJMRTo6YWxpZ24iLCJUQUJMRTo6Ymdjb2xvciIsIlRBQkxFOjpib3JkZXIiLCJU
-QUJMRTo6Y2VsbHBhZGRpbmciLCJUQUJMRTo6Y2VsbHNwYWNpbmciLCJUQUJMRTo6ZnJhbWUiLCJUQUJM
-RTo6cnVsZXMiLCJUQUJMRTo6c3VtbWFyeSIsIlRBQkxFOjp3aWR0aCIsIlRCT0RZOjphbGlnbiIsIlRC
-T0RZOjpjaGFyIiwiVEJPRFk6OmNoYXJvZmYiLCJUQk9EWTo6dmFsaWduIiwiVEQ6OmFiYnIiLCJURDo6
-YWxpZ24iLCJURDo6YXhpcyIsIlREOjpiZ2NvbG9yIiwiVEQ6OmNoYXIiLCJURDo6Y2hhcm9mZiIsIlRE
-Ojpjb2xzcGFuIiwiVEQ6OmhlYWRlcnMiLCJURDo6aGVpZ2h0IiwiVEQ6Om5vd3JhcCIsIlREOjpyb3dz
-cGFuIiwiVEQ6OnNjb3BlIiwiVEQ6OnZhbGlnbiIsIlREOjp3aWR0aCIsIlRFWFRBUkVBOjphY2Nlc3Nr
-ZXkiLCJURVhUQVJFQTo6YXV0b2NvbXBsZXRlIiwiVEVYVEFSRUE6OmNvbHMiLCJURVhUQVJFQTo6ZGlz
-YWJsZWQiLCJURVhUQVJFQTo6aW5wdXRtb2RlIiwiVEVYVEFSRUE6Om5hbWUiLCJURVhUQVJFQTo6cGxh
-Y2Vob2xkZXIiLCJURVhUQVJFQTo6cmVhZG9ubHkiLCJURVhUQVJFQTo6cmVxdWlyZWQiLCJURVhUQVJF
-QTo6cm93cyIsIlRFWFRBUkVBOjp0YWJpbmRleCIsIlRFWFRBUkVBOjp3cmFwIiwiVEZPT1Q6OmFsaWdu
-IiwiVEZPT1Q6OmNoYXIiLCJURk9PVDo6Y2hhcm9mZiIsIlRGT09UOjp2YWxpZ24iLCJUSDo6YWJiciIs
-IlRIOjphbGlnbiIsIlRIOjpheGlzIiwiVEg6OmJnY29sb3IiLCJUSDo6Y2hhciIsIlRIOjpjaGFyb2Zm
-IiwiVEg6OmNvbHNwYW4iLCJUSDo6aGVhZGVycyIsIlRIOjpoZWlnaHQiLCJUSDo6bm93cmFwIiwiVEg6
-OnJvd3NwYW4iLCJUSDo6c2NvcGUiLCJUSDo6dmFsaWduIiwiVEg6OndpZHRoIiwiVEhFQUQ6OmFsaWdu
-IiwiVEhFQUQ6OmNoYXIiLCJUSEVBRDo6Y2hhcm9mZiIsIlRIRUFEOjp2YWxpZ24iLCJUUjo6YWxpZ24i
-LCJUUjo6Ymdjb2xvciIsIlRSOjpjaGFyIiwiVFI6OmNoYXJvZmYiLCJUUjo6dmFsaWduIiwiVFJBQ0s6
-OmRlZmF1bHQiLCJUUkFDSzo6a2luZCIsIlRSQUNLOjpsYWJlbCIsIlRSQUNLOjpzcmNsYW5nIiwiVUw6
-OmNvbXBhY3QiLCJVTDo6dHlwZSIsIlZJREVPOjpjb250cm9scyIsIlZJREVPOjpoZWlnaHQiLCJWSURF
-Tzo6bG9vcCIsIlZJREVPOjptZWRpYWdyb3VwIiwiVklERU86Om11dGVkIiwiVklERU86OnByZWxvYWQi
-LCJWSURFTzo6d2lkdGgiXSksdS5zKQpDLlZDPUguVk0odChbMCwwLDY1NDkwLDQ1MDU1LDY1NTM1LDM0
-ODE1LDY1NTM0LDE4NDMxXSksdS50KQpDLm1LPUguVk0odChbMCwwLDI2NjI0LDEwMjMsNjU1MzQsMjA0
-Nyw2NTUzNCwyMDQ3XSksdS50KQpDLlNxPUguVk0odChbIkhFQUQiLCJBUkVBIiwiQkFTRSIsIkJBU0VG
-T05UIiwiQlIiLCJDT0wiLCJDT0xHUk9VUCIsIkVNQkVEIiwiRlJBTUUiLCJGUkFNRVNFVCIsIkhSIiwi
-SU1BR0UiLCJJTUciLCJJTlBVVCIsIklTSU5ERVgiLCJMSU5LIiwiTUVUQSIsIlBBUkFNIiwiU09VUkNF
-IiwiU1RZTEUiLCJUSVRMRSIsIldCUiJdKSx1LnMpCkMuZG49SC5WTSh0KFtdKSxILk4wKCJqZDxMTD4i
-KSkKQy54RD1ILlZNKHQoW10pLHUucykKQy5oVT1ILlZNKHQoW10pLHUuYikKQy50bz1ILlZNKHQoWzAs
-MCwzMjcyMiwxMjI4Nyw2NTUzNCwzNDgxNSw2NTUzNCwxODQzMV0pLHUudCkKQy5yaz1ILlZNKHQoW0Mu
-QWQsQy5uZSxDLm15LEMucngsQy53VixDLmZSXSksSC5OMCgiamQ8SDc+IikpCkMuRjM9SC5WTSh0KFsw
-LDAsMjQ1NzYsMTAyMyw2NTUzNCwzNDgxNSw2NTUzNCwxODQzMV0pLHUudCkKQy5lYT1ILlZNKHQoWzAs
-MCwzMjc1NCwxMTI2Myw2NTUzNCwzNDgxNSw2NTUzNCwxODQzMV0pLHUudCkKQy5aSj1ILlZNKHQoWzAs
-MCwzMjcyMiwxMjI4Nyw2NTUzNSwzNDgxNSw2NTUzNCwxODQzMV0pLHUudCkKQy5XZD1ILlZNKHQoWzAs
-MCw2NTQ5MCwxMjI4Nyw2NTUzNSwzNDgxNSw2NTUzNCwxODQzMV0pLHUudCkKQy5ReD1ILlZNKHQoWyJi
-aW5kIiwiaWYiLCJyZWYiLCJyZXBlYXQiLCJzeW50YXgiXSksdS5zKQpDLkJJPUguVk0odChbIkE6Omhy
-ZWYiLCJBUkVBOjpocmVmIiwiQkxPQ0tRVU9URTo6Y2l0ZSIsIkJPRFk6OmJhY2tncm91bmQiLCJDT01N
-QU5EOjppY29uIiwiREVMOjpjaXRlIiwiRk9STTo6YWN0aW9uIiwiSU1HOjpzcmMiLCJJTlBVVDo6c3Jj
-IiwiSU5TOjpjaXRlIiwiUTo6Y2l0ZSIsIlZJREVPOjpwb3N0ZXIiXSksdS5zKQpDLkNNPW5ldyBILkxQ
-KDAse30sQy54RCxILk4wKCJMUDxxVSx6TTxqOD4+IikpCkMuV089bmV3IEguTFAoMCx7fSxDLnhELEgu
-TjAoIkxQPHFVLHFVPiIpKQpDLmlIPUguVk0odChbXSksSC5OMCgiamQ8R0Q+IikpCkMuRHg9bmV3IEgu
-TFAoMCx7fSxDLmlILEguTjAoIkxQPEdELEA+IikpCkMuWTI9bmV3IEwuTzkoIk5hdmlnYXRpb25UcmVl
-Tm9kZVR5cGUuZGlyZWN0b3J5IikKQy5yZj1uZXcgTC5POSgiTmF2aWdhdGlvblRyZWVOb2RlVHlwZS5m
-aWxlIikKQy5UZT1uZXcgSC53digiY2FsbCIpCkMud1E9bmV3IFAuRnkobnVsbCwyKX0pKCk7KGZ1bmN0
-aW9uIHN0YXRpY0ZpZWxkcygpeyQueWo9MAokLm1KPW51bGwKJC5QND1udWxsCiQuTkY9bnVsbAokLlRY
-PW51bGwKJC54Nz1udWxsCiQubnc9bnVsbAokLnZ2PW51bGwKJC5Cdj1udWxsCiQuUzY9bnVsbAokLms4
-PW51bGwKJC5tZz1udWxsCiQuVUQ9ITEKJC5YMz1DLk5VCiQueGc9W10KJC54bz1udWxsCiQuQk89bnVs
-bAokLmx0PW51bGwKJC5FVT1udWxsCiQub3I9UC5GbCh1Lk4sdS5aKQokLkk2PW51bGwKJC5GZj1udWxs
-fSkoKTsoZnVuY3Rpb24gbGF6eUluaXRpYWxpemVycygpe3ZhciB0PWh1bmtIZWxwZXJzLmxhenkKdCgk
-LCJmYSIsInciLGZ1bmN0aW9uKCl7cmV0dXJuIEguWWcoIl8kZGFydF9kYXJ0Q2xvc3VyZSIpfSkKdCgk
-LCJZMiIsIlVOIixmdW5jdGlvbigpe3JldHVybiBILllnKCJfJGRhcnRfanMiKX0pCnQoJCwiVTIiLCJT
-biIsZnVuY3Rpb24oKXtyZXR1cm4gSC5jTShILlM3KHsKdG9TdHJpbmc6ZnVuY3Rpb24oKXtyZXR1cm4i
-JHJlY2VpdmVyJCJ9fSkpfSkKdCgkLCJ4cSIsImxxIixmdW5jdGlvbigpe3JldHVybiBILmNNKEguUzco
-eyRtZXRob2QkOm51bGwsCnRvU3RyaW5nOmZ1bmN0aW9uKCl7cmV0dXJuIiRyZWNlaXZlciQifX0pKX0p
-CnQoJCwiUjEiLCJOOSIsZnVuY3Rpb24oKXtyZXR1cm4gSC5jTShILlM3KG51bGwpKX0pCnQoJCwiZk4i
-LCJpSSIsZnVuY3Rpb24oKXtyZXR1cm4gSC5jTShmdW5jdGlvbigpe3ZhciAkYXJndW1lbnRzRXhwciQ9
-JyRhcmd1bWVudHMkJwp0cnl7bnVsbC4kbWV0aG9kJCgkYXJndW1lbnRzRXhwciQpfWNhdGNoKHMpe3Jl
-dHVybiBzLm1lc3NhZ2V9fSgpKX0pCnQoJCwicWkiLCJLZiIsZnVuY3Rpb24oKXtyZXR1cm4gSC5jTShI
-LlM3KHZvaWQgMCkpfSkKdCgkLCJyWiIsIlpoIixmdW5jdGlvbigpe3JldHVybiBILmNNKGZ1bmN0aW9u
-KCl7dmFyICRhcmd1bWVudHNFeHByJD0nJGFyZ3VtZW50cyQnCnRyeXsodm9pZCAwKS4kbWV0aG9kJCgk
-YXJndW1lbnRzRXhwciQpfWNhdGNoKHMpe3JldHVybiBzLm1lc3NhZ2V9fSgpKX0pCnQoJCwia3EiLCJy
-TiIsZnVuY3Rpb24oKXtyZXR1cm4gSC5jTShILk1qKG51bGwpKX0pCnQoJCwidHQiLCJjMyIsZnVuY3Rp
-b24oKXtyZXR1cm4gSC5jTShmdW5jdGlvbigpe3RyeXtudWxsLiRtZXRob2QkfWNhdGNoKHMpe3JldHVy
-biBzLm1lc3NhZ2V9fSgpKX0pCnQoJCwiZHQiLCJISyIsZnVuY3Rpb24oKXtyZXR1cm4gSC5jTShILk1q
-KHZvaWQgMCkpfSkKdCgkLCJBNyIsInIxIixmdW5jdGlvbigpe3JldHVybiBILmNNKGZ1bmN0aW9uKCl7
-dHJ5eyh2b2lkIDApLiRtZXRob2QkfWNhdGNoKHMpe3JldHVybiBzLm1lc3NhZ2V9fSgpKX0pCnQoJCwi
-V2MiLCJ1dCIsZnVuY3Rpb24oKXtyZXR1cm4gUC5PaigpfSkKdCgkLCJraCIsInJmIixmdW5jdGlvbigp
-e3JldHVybiBQLldJKCl9KQp0KCQsImJ0IiwiVjciLGZ1bmN0aW9uKCl7cmV0dXJuIEguRFEoSC5YRihI
-LlZNKFstMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwt
-MiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMiwtMSwt
-MiwtMiwtMiwtMiwtMiw2MiwtMiw2MiwtMiw2Myw1Miw1Myw1NCw1NSw1Niw1Nyw1OCw1OSw2MCw2MSwt
-MiwtMiwtMiwtMSwtMiwtMiwtMiwwLDEsMiwzLDQsNSw2LDcsOCw5LDEwLDExLDEyLDEzLDE0LDE1LDE2
-LDE3LDE4LDE5LDIwLDIxLDIyLDIzLDI0LDI1LC0yLC0yLC0yLC0yLDYzLC0yLDI2LDI3LDI4LDI5LDMw
-LDMxLDMyLDMzLDM0LDM1LDM2LDM3LDM4LDM5LDQwLDQxLDQyLDQzLDQ0LDQ1LDQ2LDQ3LDQ4LDQ5LDUw
-LDUxLC0yLC0yLC0yLC0yLC0yXSx1LnQpKSl9KQp0KCQsIk01Iiwid1EiLGZ1bmN0aW9uKCl7cmV0dXJu
-IHR5cGVvZiBwcm9jZXNzIT0idW5kZWZpbmVkIiYmT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxs
-KHByb2Nlc3MpPT0iW29iamVjdCBwcm9jZXNzXSImJnByb2Nlc3MucGxhdGZvcm09PSJ3aW4zMiJ9KQp0
-KCQsIm1mIiwiejQiLGZ1bmN0aW9uKCl7cmV0dXJuIFAubnUoIl5bXFwtXFwuMC05QS1aX2Eten5dKiQi
-KX0pCnQoJCwiSkciLCJ2WiIsZnVuY3Rpb24oKXtyZXR1cm4gUC51eCgpfSkKdCgkLCJTQyIsIkFOIixm
-dW5jdGlvbigpe3JldHVybiBQLnRNKFsiQSIsIkFCQlIiLCJBQ1JPTllNIiwiQUREUkVTUyIsIkFSRUEi
-LCJBUlRJQ0xFIiwiQVNJREUiLCJBVURJTyIsIkIiLCJCREkiLCJCRE8iLCJCSUciLCJCTE9DS1FVT1RF
-IiwiQlIiLCJCVVRUT04iLCJDQU5WQVMiLCJDQVBUSU9OIiwiQ0VOVEVSIiwiQ0lURSIsIkNPREUiLCJD
-T0wiLCJDT0xHUk9VUCIsIkNPTU1BTkQiLCJEQVRBIiwiREFUQUxJU1QiLCJERCIsIkRFTCIsIkRFVEFJ
-TFMiLCJERk4iLCJESVIiLCJESVYiLCJETCIsIkRUIiwiRU0iLCJGSUVMRFNFVCIsIkZJR0NBUFRJT04i
-LCJGSUdVUkUiLCJGT05UIiwiRk9PVEVSIiwiRk9STSIsIkgxIiwiSDIiLCJIMyIsIkg0IiwiSDUiLCJI
-NiIsIkhFQURFUiIsIkhHUk9VUCIsIkhSIiwiSSIsIklGUkFNRSIsIklNRyIsIklOUFVUIiwiSU5TIiwi
-S0JEIiwiTEFCRUwiLCJMRUdFTkQiLCJMSSIsIk1BUCIsIk1BUksiLCJNRU5VIiwiTUVURVIiLCJOQVYi
-LCJOT0JSIiwiT0wiLCJPUFRHUk9VUCIsIk9QVElPTiIsIk9VVFBVVCIsIlAiLCJQUkUiLCJQUk9HUkVT
-UyIsIlEiLCJTIiwiU0FNUCIsIlNFQ1RJT04iLCJTRUxFQ1QiLCJTTUFMTCIsIlNPVVJDRSIsIlNQQU4i
-LCJTVFJJS0UiLCJTVFJPTkciLCJTVUIiLCJTVU1NQVJZIiwiU1VQIiwiVEFCTEUiLCJUQk9EWSIsIlRE
-IiwiVEVYVEFSRUEiLCJURk9PVCIsIlRIIiwiVEhFQUQiLCJUSU1FIiwiVFIiLCJUUkFDSyIsIlRUIiwi
-VSIsIlVMIiwiVkFSIiwiVklERU8iLCJXQlIiXSx1Lk4pfSkKdCgkLCJYNCIsImhHIixmdW5jdGlvbigp
-e3JldHVybiBQLm51KCJeXFxTKyQiKX0pCnQoJCwid08iLCJvdyIsZnVuY3Rpb24oKXtyZXR1cm4gdS5t
-LmIoUC5ORChzZWxmKSl9KQp0KCQsImt0IiwiUjgiLGZ1bmN0aW9uKCl7cmV0dXJuIEguWWcoIl8kZGFy
-dF9kYXJ0T2JqZWN0Iil9KQp0KCQsImZLIiwia0kiLGZ1bmN0aW9uKCl7cmV0dXJuIGZ1bmN0aW9uIERh
-cnRPYmplY3QoYSl7dGhpcy5vPWF9fSkKdCgkLCJxdCIsInpCIixmdW5jdGlvbigpe3JldHVybiBuZXcg
-VC5tUSgpfSkKdCgkLCJPbCIsIlVFIixmdW5jdGlvbigpe3JldHVybiBQLmhLKEMub2wuZ21XKFcueDMo
-KSkuaHJlZikuZ2hZKCkucSgwLCJhdXRoVG9rZW4iKX0pCnQoJCwiaFQiLCJ5UCIsZnVuY3Rpb24oKXty
-ZXR1cm4gVy5acigpLnF1ZXJ5U2VsZWN0b3IoIi5lZGl0LWxpc3QgLnBhbmVsLWNvbnRlbnQiKX0pCnQo
-JCwiVzYiLCJoTCIsZnVuY3Rpb24oKXtyZXR1cm4gVy5acigpLnF1ZXJ5U2VsZWN0b3IoIi5lZGl0LXBh
-bmVsIC5wYW5lbC1jb250ZW50Iil9KQp0KCQsIlRSIiwiRFciLGZ1bmN0aW9uKCl7cmV0dXJuIFcuWnIo
-KS5xdWVyeVNlbGVjdG9yKCJmb290ZXIiKX0pCnQoJCwiRVkiLCJmaSIsZnVuY3Rpb24oKXtyZXR1cm4g
-Vy5acigpLnF1ZXJ5U2VsZWN0b3IoImhlYWRlciIpfSkKdCgkLCJhdiIsIkQ5IixmdW5jdGlvbigpe3Jl
-dHVybiBXLlpyKCkucXVlcnlTZWxlY3RvcigiI3VuaXQtbmFtZSIpfSkKdCgkLCJmZSIsIktHIixmdW5j
-dGlvbigpe3JldHVybiBuZXcgTC5YQSgpfSkKdCgkLCJtTSIsIm5VIixmdW5jdGlvbigpe3JldHVybiBu
-ZXcgTS5sSSgkLkhrKCkpfSkKdCgkLCJ5ciIsImJEIixmdW5jdGlvbigpe3JldHVybiBuZXcgRS5PRihQ
-Lm51KCIvIiksUC5udSgiW14vXSQiKSxQLm51KCJeLyIpKX0pCnQoJCwiTWsiLCJLayIsZnVuY3Rpb24o
-KXtyZXR1cm4gbmV3IEwuSVYoUC5udSgiWy9cXFxcXSIpLFAubnUoIlteL1xcXFxdJCIpLFAubnUoIl4o
-XFxcXFxcXFxbXlxcXFxdK1xcXFxbXlxcXFwvXSt8W2EtekEtWl06Wy9cXFxcXSkiKSxQLm51KCJeWy9c
-XFxcXSg/IVsvXFxcXF0pIikpfSkKdCgkLCJhayIsIkViIixmdW5jdGlvbigpe3JldHVybiBuZXcgRi5y
-dShQLm51KCIvIiksUC5udSgiKF5bYS16QS1aXVstKy5hLXpBLVpcXGRdKjovL3xbXi9dKSQiKSxQLm51
-KCJbYS16QS1aXVstKy5hLXpBLVpcXGRdKjovL1teL10qIiksUC5udSgiXi8iKSl9KQp0KCQsImxzIiwi
-SGsiLGZ1bmN0aW9uKCl7cmV0dXJuIE8uUmgoKX0pfSkoKTsoZnVuY3Rpb24gbmF0aXZlU3VwcG9ydCgp
-eyFmdW5jdGlvbigpe3ZhciB0PWZ1bmN0aW9uKGEpe3ZhciBuPXt9Cm5bYV09MQpyZXR1cm4gT2JqZWN0
-LmtleXMoaHVua0hlbHBlcnMuY29udmVydFRvRmFzdE9iamVjdChuKSlbMF19CnYuZ2V0SXNvbGF0ZVRh
-Zz1mdW5jdGlvbihhKXtyZXR1cm4gdCgiX19fZGFydF8iK2Erdi5pc29sYXRlVGFnKX0KdmFyIHM9Il9f
-X2RhcnRfaXNvbGF0ZV90YWdzXyIKdmFyIHI9T2JqZWN0W3NdfHwoT2JqZWN0W3NdPU9iamVjdC5jcmVh
-dGUobnVsbCkpCnZhciBxPSJfWnhZeFgiCmZvcih2YXIgcD0wOztwKyspe3ZhciBvPXQocSsiXyIrcCsi
-XyIpCmlmKCEobyBpbiByKSl7cltvXT0xCnYuaXNvbGF0ZVRhZz1vCmJyZWFrfX12LmRpc3BhdGNoUHJv
-cGVydHlOYW1lPXYuZ2V0SXNvbGF0ZVRhZygiZGlzcGF0Y2hfcmVjb3JkIil9KCkKaHVua0hlbHBlcnMu
-c2V0T3JVcGRhdGVJbnRlcmNlcHRvcnNCeVRhZyh7RE9NRXJyb3I6Si52QixET01JbXBsZW1lbnRhdGlv
-bjpKLnZCLE1lZGlhRXJyb3I6Si52QixOYXZpZ2F0b3I6Si52QixOYXZpZ2F0b3JDb25jdXJyZW50SGFy
-ZHdhcmU6Si52QixOYXZpZ2F0b3JVc2VyTWVkaWFFcnJvcjpKLnZCLE92ZXJjb25zdHJhaW5lZEVycm9y
-OkoudkIsUG9zaXRpb25FcnJvcjpKLnZCLFJhbmdlOkoudkIsU1FMRXJyb3I6Si52QixEYXRhVmlldzpI
-LkVULEFycmF5QnVmZmVyVmlldzpILkVULEZsb2F0MzJBcnJheTpILkRnLEZsb2F0NjRBcnJheTpILkRn
-LEludDE2QXJyYXk6SC54aixJbnQzMkFycmF5OkguZEUsSW50OEFycmF5OkguWkEsVWludDE2QXJyYXk6
-SC53ZixVaW50MzJBcnJheTpILlBxLFVpbnQ4Q2xhbXBlZEFycmF5OkguZUUsQ2FudmFzUGl4ZWxBcnJh
-eTpILmVFLFVpbnQ4QXJyYXk6SC5WNixIVE1MQXVkaW9FbGVtZW50OlcucUUsSFRNTEJSRWxlbWVudDpX
-LnFFLEhUTUxCdXR0b25FbGVtZW50OlcucUUsSFRNTENhbnZhc0VsZW1lbnQ6Vy5xRSxIVE1MQ29udGVu
-dEVsZW1lbnQ6Vy5xRSxIVE1MRExpc3RFbGVtZW50OlcucUUsSFRNTERhdGFFbGVtZW50OlcucUUsSFRN
-TERhdGFMaXN0RWxlbWVudDpXLnFFLEhUTUxEZXRhaWxzRWxlbWVudDpXLnFFLEhUTUxEaWFsb2dFbGVt
-ZW50OlcucUUsSFRNTERpdkVsZW1lbnQ6Vy5xRSxIVE1MRW1iZWRFbGVtZW50OlcucUUsSFRNTEZpZWxk
-U2V0RWxlbWVudDpXLnFFLEhUTUxIUkVsZW1lbnQ6Vy5xRSxIVE1MSGVhZEVsZW1lbnQ6Vy5xRSxIVE1M
-SGVhZGluZ0VsZW1lbnQ6Vy5xRSxIVE1MSHRtbEVsZW1lbnQ6Vy5xRSxIVE1MSUZyYW1lRWxlbWVudDpX
-LnFFLEhUTUxJbWFnZUVsZW1lbnQ6Vy5xRSxIVE1MSW5wdXRFbGVtZW50OlcucUUsSFRNTExJRWxlbWVu
-dDpXLnFFLEhUTUxMYWJlbEVsZW1lbnQ6Vy5xRSxIVE1MTGVnZW5kRWxlbWVudDpXLnFFLEhUTUxMaW5r
-RWxlbWVudDpXLnFFLEhUTUxNYXBFbGVtZW50OlcucUUsSFRNTE1lZGlhRWxlbWVudDpXLnFFLEhUTUxN
-ZW51RWxlbWVudDpXLnFFLEhUTUxNZXRhRWxlbWVudDpXLnFFLEhUTUxNZXRlckVsZW1lbnQ6Vy5xRSxI
-VE1MTW9kRWxlbWVudDpXLnFFLEhUTUxPTGlzdEVsZW1lbnQ6Vy5xRSxIVE1MT2JqZWN0RWxlbWVudDpX
-LnFFLEhUTUxPcHRHcm91cEVsZW1lbnQ6Vy5xRSxIVE1MT3B0aW9uRWxlbWVudDpXLnFFLEhUTUxPdXRw
-dXRFbGVtZW50OlcucUUsSFRNTFBhcmFtRWxlbWVudDpXLnFFLEhUTUxQaWN0dXJlRWxlbWVudDpXLnFF
-LEhUTUxQcmVFbGVtZW50OlcucUUsSFRNTFByb2dyZXNzRWxlbWVudDpXLnFFLEhUTUxRdW90ZUVsZW1l
-bnQ6Vy5xRSxIVE1MU2NyaXB0RWxlbWVudDpXLnFFLEhUTUxTaGFkb3dFbGVtZW50OlcucUUsSFRNTFNs
-b3RFbGVtZW50OlcucUUsSFRNTFNvdXJjZUVsZW1lbnQ6Vy5xRSxIVE1MU3BhbkVsZW1lbnQ6Vy5xRSxI
-VE1MU3R5bGVFbGVtZW50OlcucUUsSFRNTFRhYmxlQ2FwdGlvbkVsZW1lbnQ6Vy5xRSxIVE1MVGFibGVD
-ZWxsRWxlbWVudDpXLnFFLEhUTUxUYWJsZURhdGFDZWxsRWxlbWVudDpXLnFFLEhUTUxUYWJsZUhlYWRl
-ckNlbGxFbGVtZW50OlcucUUsSFRNTFRhYmxlQ29sRWxlbWVudDpXLnFFLEhUTUxUZXh0QXJlYUVsZW1l
-bnQ6Vy5xRSxIVE1MVGltZUVsZW1lbnQ6Vy5xRSxIVE1MVGl0bGVFbGVtZW50OlcucUUsSFRNTFRyYWNr
-RWxlbWVudDpXLnFFLEhUTUxVTGlzdEVsZW1lbnQ6Vy5xRSxIVE1MVW5rbm93bkVsZW1lbnQ6Vy5xRSxI
-VE1MVmlkZW9FbGVtZW50OlcucUUsSFRNTERpcmVjdG9yeUVsZW1lbnQ6Vy5xRSxIVE1MRm9udEVsZW1l
-bnQ6Vy5xRSxIVE1MRnJhbWVFbGVtZW50OlcucUUsSFRNTEZyYW1lU2V0RWxlbWVudDpXLnFFLEhUTUxN
-YXJxdWVlRWxlbWVudDpXLnFFLEhUTUxFbGVtZW50OlcucUUsSFRNTEFuY2hvckVsZW1lbnQ6Vy5HaCxI
-VE1MQXJlYUVsZW1lbnQ6Vy5mWSxIVE1MQmFzZUVsZW1lbnQ6Vy5uQixCbG9iOlcuQXosSFRNTEJvZHlF
-bGVtZW50OlcuUVAsQ0RBVEFTZWN0aW9uOlcubngsQ2hhcmFjdGVyRGF0YTpXLm54LENvbW1lbnQ6Vy5u
-eCxQcm9jZXNzaW5nSW5zdHJ1Y3Rpb246Vy5ueCxUZXh0OlcubngsQ1NTU3R5bGVEZWNsYXJhdGlvbjpX
-Lm9KLE1TU3R5bGVDU1NQcm9wZXJ0aWVzOlcub0osQ1NTMlByb3BlcnRpZXM6Vy5vSixYTUxEb2N1bWVu
-dDpXLlFGLERvY3VtZW50OlcuUUYsRE9NRXhjZXB0aW9uOlcuTmgsRE9NUmVjdFJlYWRPbmx5OlcuSUIs
-RE9NVG9rZW5MaXN0OlcubjcsRWxlbWVudDpXLmN2LEFib3J0UGF5bWVudEV2ZW50OlcuZWEsQW5pbWF0
-aW9uRXZlbnQ6Vy5lYSxBbmltYXRpb25QbGF5YmFja0V2ZW50OlcuZWEsQXBwbGljYXRpb25DYWNoZUVy
-cm9yRXZlbnQ6Vy5lYSxCYWNrZ3JvdW5kRmV0Y2hDbGlja0V2ZW50OlcuZWEsQmFja2dyb3VuZEZldGNo
-RXZlbnQ6Vy5lYSxCYWNrZ3JvdW5kRmV0Y2hGYWlsRXZlbnQ6Vy5lYSxCYWNrZ3JvdW5kRmV0Y2hlZEV2
-ZW50OlcuZWEsQmVmb3JlSW5zdGFsbFByb21wdEV2ZW50OlcuZWEsQmVmb3JlVW5sb2FkRXZlbnQ6Vy5l
-YSxCbG9iRXZlbnQ6Vy5lYSxDYW5NYWtlUGF5bWVudEV2ZW50OlcuZWEsQ2xpcGJvYXJkRXZlbnQ6Vy5l
-YSxDbG9zZUV2ZW50OlcuZWEsQ3VzdG9tRXZlbnQ6Vy5lYSxEZXZpY2VNb3Rpb25FdmVudDpXLmVhLERl
-dmljZU9yaWVudGF0aW9uRXZlbnQ6Vy5lYSxFcnJvckV2ZW50OlcuZWEsRXh0ZW5kYWJsZUV2ZW50Olcu
-ZWEsRXh0ZW5kYWJsZU1lc3NhZ2VFdmVudDpXLmVhLEZldGNoRXZlbnQ6Vy5lYSxGb250RmFjZVNldExv
-YWRFdmVudDpXLmVhLEZvcmVpZ25GZXRjaEV2ZW50OlcuZWEsR2FtZXBhZEV2ZW50OlcuZWEsSGFzaENo
-YW5nZUV2ZW50OlcuZWEsSW5zdGFsbEV2ZW50OlcuZWEsTWVkaWFFbmNyeXB0ZWRFdmVudDpXLmVhLE1l
-ZGlhS2V5TWVzc2FnZUV2ZW50OlcuZWEsTWVkaWFRdWVyeUxpc3RFdmVudDpXLmVhLE1lZGlhU3RyZWFt
-RXZlbnQ6Vy5lYSxNZWRpYVN0cmVhbVRyYWNrRXZlbnQ6Vy5lYSxNZXNzYWdlRXZlbnQ6Vy5lYSxNSURJ
-Q29ubmVjdGlvbkV2ZW50OlcuZWEsTUlESU1lc3NhZ2VFdmVudDpXLmVhLE11dGF0aW9uRXZlbnQ6Vy5l
-YSxOb3RpZmljYXRpb25FdmVudDpXLmVhLFBhZ2VUcmFuc2l0aW9uRXZlbnQ6Vy5lYSxQYXltZW50UmVx
-dWVzdEV2ZW50OlcuZWEsUGF5bWVudFJlcXVlc3RVcGRhdGVFdmVudDpXLmVhLFBvcFN0YXRlRXZlbnQ6
-Vy5lYSxQcmVzZW50YXRpb25Db25uZWN0aW9uQXZhaWxhYmxlRXZlbnQ6Vy5lYSxQcmVzZW50YXRpb25D
-b25uZWN0aW9uQ2xvc2VFdmVudDpXLmVhLFByb21pc2VSZWplY3Rpb25FdmVudDpXLmVhLFB1c2hFdmVu
-dDpXLmVhLFJUQ0RhdGFDaGFubmVsRXZlbnQ6Vy5lYSxSVENEVE1GVG9uZUNoYW5nZUV2ZW50OlcuZWEs
-UlRDUGVlckNvbm5lY3Rpb25JY2VFdmVudDpXLmVhLFJUQ1RyYWNrRXZlbnQ6Vy5lYSxTZWN1cml0eVBv
-bGljeVZpb2xhdGlvbkV2ZW50OlcuZWEsU2Vuc29yRXJyb3JFdmVudDpXLmVhLFNwZWVjaFJlY29nbml0
-aW9uRXJyb3I6Vy5lYSxTcGVlY2hSZWNvZ25pdGlvbkV2ZW50OlcuZWEsU3BlZWNoU3ludGhlc2lzRXZl
-bnQ6Vy5lYSxTdG9yYWdlRXZlbnQ6Vy5lYSxTeW5jRXZlbnQ6Vy5lYSxUcmFja0V2ZW50OlcuZWEsVHJh
-bnNpdGlvbkV2ZW50OlcuZWEsV2ViS2l0VHJhbnNpdGlvbkV2ZW50OlcuZWEsVlJEZXZpY2VFdmVudDpX
-LmVhLFZSRGlzcGxheUV2ZW50OlcuZWEsVlJTZXNzaW9uRXZlbnQ6Vy5lYSxNb2pvSW50ZXJmYWNlUmVx
-dWVzdEV2ZW50OlcuZWEsVVNCQ29ubmVjdGlvbkV2ZW50OlcuZWEsSURCVmVyc2lvbkNoYW5nZUV2ZW50
-OlcuZWEsQXVkaW9Qcm9jZXNzaW5nRXZlbnQ6Vy5lYSxPZmZsaW5lQXVkaW9Db21wbGV0aW9uRXZlbnQ6
-Vy5lYSxXZWJHTENvbnRleHRFdmVudDpXLmVhLEV2ZW50OlcuZWEsSW5wdXRFdmVudDpXLmVhLEV2ZW50
-VGFyZ2V0OlcuRDAsRmlsZTpXLmhILEhUTUxGb3JtRWxlbWVudDpXLmg0LEhpc3Rvcnk6Vy5icixIVE1M
-RG9jdW1lbnQ6Vy5WYixYTUxIdHRwUmVxdWVzdDpXLk83LFhNTEh0dHBSZXF1ZXN0RXZlbnRUYXJnZXQ6
-Vy53YSxJbWFnZURhdGE6Vy5TZyxMb2NhdGlvbjpXLnU4LE1vdXNlRXZlbnQ6Vy5BaixEcmFnRXZlbnQ6
-Vy5BaixQb2ludGVyRXZlbnQ6Vy5BaixXaGVlbEV2ZW50OlcuQWosRG9jdW1lbnRGcmFnbWVudDpXLnVI
-LFNoYWRvd1Jvb3Q6Vy51SCxEb2N1bWVudFR5cGU6Vy51SCxOb2RlOlcudUgsTm9kZUxpc3Q6Vy5CSCxS
-YWRpb05vZGVMaXN0OlcuQkgsSFRNTFBhcmFncmFwaEVsZW1lbnQ6Vy5TTixQcm9ncmVzc0V2ZW50Olcu
-ZXcsUmVzb3VyY2VQcm9ncmVzc0V2ZW50OlcuZXcsSFRNTFNlbGVjdEVsZW1lbnQ6Vy5scCxIVE1MVGFi
-bGVFbGVtZW50OlcuVGIsSFRNTFRhYmxlUm93RWxlbWVudDpXLkl2LEhUTUxUYWJsZVNlY3Rpb25FbGVt
-ZW50OlcuV1AsSFRNTFRlbXBsYXRlRWxlbWVudDpXLnlZLENvbXBvc2l0aW9uRXZlbnQ6Vy53NixGb2N1
-c0V2ZW50OlcudzYsS2V5Ym9hcmRFdmVudDpXLnc2LFRleHRFdmVudDpXLnc2LFRvdWNoRXZlbnQ6Vy53
-NixVSUV2ZW50OlcudzYsV2luZG93OlcuSzUsRE9NV2luZG93OlcuSzUsRGVkaWNhdGVkV29ya2VyR2xv
-YmFsU2NvcGU6Vy5DbSxTZXJ2aWNlV29ya2VyR2xvYmFsU2NvcGU6Vy5DbSxTaGFyZWRXb3JrZXJHbG9i
-YWxTY29wZTpXLkNtLFdvcmtlckdsb2JhbFNjb3BlOlcuQ20sQXR0cjpXLkNRLENsaWVudFJlY3Q6Vy53
-NCxET01SZWN0OlcudzQsTmFtZWROb2RlTWFwOlcucmgsTW96TmFtZWRBdHRyTWFwOlcucmgsSURCS2V5
-UmFuZ2U6UC5oRixTVkdTY3JpcHRFbGVtZW50OlAubmQsU1ZHQUVsZW1lbnQ6UC5kNSxTVkdBbmltYXRl
-RWxlbWVudDpQLmQ1LFNWR0FuaW1hdGVNb3Rpb25FbGVtZW50OlAuZDUsU1ZHQW5pbWF0ZVRyYW5zZm9y
-bUVsZW1lbnQ6UC5kNSxTVkdBbmltYXRpb25FbGVtZW50OlAuZDUsU1ZHQ2lyY2xlRWxlbWVudDpQLmQ1
-LFNWR0NsaXBQYXRoRWxlbWVudDpQLmQ1LFNWR0RlZnNFbGVtZW50OlAuZDUsU1ZHRGVzY0VsZW1lbnQ6
-UC5kNSxTVkdEaXNjYXJkRWxlbWVudDpQLmQ1LFNWR0VsbGlwc2VFbGVtZW50OlAuZDUsU1ZHRkVCbGVu
-ZEVsZW1lbnQ6UC5kNSxTVkdGRUNvbG9yTWF0cml4RWxlbWVudDpQLmQ1LFNWR0ZFQ29tcG9uZW50VHJh
-bnNmZXJFbGVtZW50OlAuZDUsU1ZHRkVDb21wb3NpdGVFbGVtZW50OlAuZDUsU1ZHRkVDb252b2x2ZU1h
-dHJpeEVsZW1lbnQ6UC5kNSxTVkdGRURpZmZ1c2VMaWdodGluZ0VsZW1lbnQ6UC5kNSxTVkdGRURpc3Bs
-YWNlbWVudE1hcEVsZW1lbnQ6UC5kNSxTVkdGRURpc3RhbnRMaWdodEVsZW1lbnQ6UC5kNSxTVkdGRUZs
-b29kRWxlbWVudDpQLmQ1LFNWR0ZFRnVuY0FFbGVtZW50OlAuZDUsU1ZHRkVGdW5jQkVsZW1lbnQ6UC5k
-NSxTVkdGRUZ1bmNHRWxlbWVudDpQLmQ1LFNWR0ZFRnVuY1JFbGVtZW50OlAuZDUsU1ZHRkVHYXVzc2lh
-bkJsdXJFbGVtZW50OlAuZDUsU1ZHRkVJbWFnZUVsZW1lbnQ6UC5kNSxTVkdGRU1lcmdlRWxlbWVudDpQ
-LmQ1LFNWR0ZFTWVyZ2VOb2RlRWxlbWVudDpQLmQ1LFNWR0ZFTW9ycGhvbG9neUVsZW1lbnQ6UC5kNSxT
-VkdGRU9mZnNldEVsZW1lbnQ6UC5kNSxTVkdGRVBvaW50TGlnaHRFbGVtZW50OlAuZDUsU1ZHRkVTcGVj
-dWxhckxpZ2h0aW5nRWxlbWVudDpQLmQ1LFNWR0ZFU3BvdExpZ2h0RWxlbWVudDpQLmQ1LFNWR0ZFVGls
-ZUVsZW1lbnQ6UC5kNSxTVkdGRVR1cmJ1bGVuY2VFbGVtZW50OlAuZDUsU1ZHRmlsdGVyRWxlbWVudDpQ
-LmQ1LFNWR0ZvcmVpZ25PYmplY3RFbGVtZW50OlAuZDUsU1ZHR0VsZW1lbnQ6UC5kNSxTVkdHZW9tZXRy
-eUVsZW1lbnQ6UC5kNSxTVkdHcmFwaGljc0VsZW1lbnQ6UC5kNSxTVkdJbWFnZUVsZW1lbnQ6UC5kNSxT
-VkdMaW5lRWxlbWVudDpQLmQ1LFNWR0xpbmVhckdyYWRpZW50RWxlbWVudDpQLmQ1LFNWR01hcmtlckVs
-ZW1lbnQ6UC5kNSxTVkdNYXNrRWxlbWVudDpQLmQ1LFNWR01ldGFkYXRhRWxlbWVudDpQLmQ1LFNWR1Bh
-dGhFbGVtZW50OlAuZDUsU1ZHUGF0dGVybkVsZW1lbnQ6UC5kNSxTVkdQb2x5Z29uRWxlbWVudDpQLmQ1
-LFNWR1BvbHlsaW5lRWxlbWVudDpQLmQ1LFNWR1JhZGlhbEdyYWRpZW50RWxlbWVudDpQLmQ1LFNWR1Jl
-Y3RFbGVtZW50OlAuZDUsU1ZHU2V0RWxlbWVudDpQLmQ1LFNWR1N0b3BFbGVtZW50OlAuZDUsU1ZHU3R5
-bGVFbGVtZW50OlAuZDUsU1ZHU1ZHRWxlbWVudDpQLmQ1LFNWR1N3aXRjaEVsZW1lbnQ6UC5kNSxTVkdT
-eW1ib2xFbGVtZW50OlAuZDUsU1ZHVFNwYW5FbGVtZW50OlAuZDUsU1ZHVGV4dENvbnRlbnRFbGVtZW50
-OlAuZDUsU1ZHVGV4dEVsZW1lbnQ6UC5kNSxTVkdUZXh0UGF0aEVsZW1lbnQ6UC5kNSxTVkdUZXh0UG9z
-aXRpb25pbmdFbGVtZW50OlAuZDUsU1ZHVGl0bGVFbGVtZW50OlAuZDUsU1ZHVXNlRWxlbWVudDpQLmQ1
-LFNWR1ZpZXdFbGVtZW50OlAuZDUsU1ZHR3JhZGllbnRFbGVtZW50OlAuZDUsU1ZHQ29tcG9uZW50VHJh
-bnNmZXJGdW5jdGlvbkVsZW1lbnQ6UC5kNSxTVkdGRURyb3BTaGFkb3dFbGVtZW50OlAuZDUsU1ZHTVBh
-dGhFbGVtZW50OlAuZDUsU1ZHRWxlbWVudDpQLmQ1fSkKaHVua0hlbHBlcnMuc2V0T3JVcGRhdGVMZWFm
-VGFncyh7RE9NRXJyb3I6dHJ1ZSxET01JbXBsZW1lbnRhdGlvbjp0cnVlLE1lZGlhRXJyb3I6dHJ1ZSxO
-YXZpZ2F0b3I6dHJ1ZSxOYXZpZ2F0b3JDb25jdXJyZW50SGFyZHdhcmU6dHJ1ZSxOYXZpZ2F0b3JVc2Vy
-TWVkaWFFcnJvcjp0cnVlLE92ZXJjb25zdHJhaW5lZEVycm9yOnRydWUsUG9zaXRpb25FcnJvcjp0cnVl
-LFJhbmdlOnRydWUsU1FMRXJyb3I6dHJ1ZSxEYXRhVmlldzp0cnVlLEFycmF5QnVmZmVyVmlldzpmYWxz
-ZSxGbG9hdDMyQXJyYXk6dHJ1ZSxGbG9hdDY0QXJyYXk6dHJ1ZSxJbnQxNkFycmF5OnRydWUsSW50MzJB
-cnJheTp0cnVlLEludDhBcnJheTp0cnVlLFVpbnQxNkFycmF5OnRydWUsVWludDMyQXJyYXk6dHJ1ZSxV
-aW50OENsYW1wZWRBcnJheTp0cnVlLENhbnZhc1BpeGVsQXJyYXk6dHJ1ZSxVaW50OEFycmF5OmZhbHNl
-LEhUTUxBdWRpb0VsZW1lbnQ6dHJ1ZSxIVE1MQlJFbGVtZW50OnRydWUsSFRNTEJ1dHRvbkVsZW1lbnQ6
-dHJ1ZSxIVE1MQ2FudmFzRWxlbWVudDp0cnVlLEhUTUxDb250ZW50RWxlbWVudDp0cnVlLEhUTUxETGlz
-dEVsZW1lbnQ6dHJ1ZSxIVE1MRGF0YUVsZW1lbnQ6dHJ1ZSxIVE1MRGF0YUxpc3RFbGVtZW50OnRydWUs
-SFRNTERldGFpbHNFbGVtZW50OnRydWUsSFRNTERpYWxvZ0VsZW1lbnQ6dHJ1ZSxIVE1MRGl2RWxlbWVu
-dDp0cnVlLEhUTUxFbWJlZEVsZW1lbnQ6dHJ1ZSxIVE1MRmllbGRTZXRFbGVtZW50OnRydWUsSFRNTEhS
-RWxlbWVudDp0cnVlLEhUTUxIZWFkRWxlbWVudDp0cnVlLEhUTUxIZWFkaW5nRWxlbWVudDp0cnVlLEhU
-TUxIdG1sRWxlbWVudDp0cnVlLEhUTUxJRnJhbWVFbGVtZW50OnRydWUsSFRNTEltYWdlRWxlbWVudDp0
-cnVlLEhUTUxJbnB1dEVsZW1lbnQ6dHJ1ZSxIVE1MTElFbGVtZW50OnRydWUsSFRNTExhYmVsRWxlbWVu
-dDp0cnVlLEhUTUxMZWdlbmRFbGVtZW50OnRydWUsSFRNTExpbmtFbGVtZW50OnRydWUsSFRNTE1hcEVs
-ZW1lbnQ6dHJ1ZSxIVE1MTWVkaWFFbGVtZW50OnRydWUsSFRNTE1lbnVFbGVtZW50OnRydWUsSFRNTE1l
-dGFFbGVtZW50OnRydWUsSFRNTE1ldGVyRWxlbWVudDp0cnVlLEhUTUxNb2RFbGVtZW50OnRydWUsSFRN
-TE9MaXN0RWxlbWVudDp0cnVlLEhUTUxPYmplY3RFbGVtZW50OnRydWUsSFRNTE9wdEdyb3VwRWxlbWVu
-dDp0cnVlLEhUTUxPcHRpb25FbGVtZW50OnRydWUsSFRNTE91dHB1dEVsZW1lbnQ6dHJ1ZSxIVE1MUGFy
-YW1FbGVtZW50OnRydWUsSFRNTFBpY3R1cmVFbGVtZW50OnRydWUsSFRNTFByZUVsZW1lbnQ6dHJ1ZSxI
-VE1MUHJvZ3Jlc3NFbGVtZW50OnRydWUsSFRNTFF1b3RlRWxlbWVudDp0cnVlLEhUTUxTY3JpcHRFbGVt
-ZW50OnRydWUsSFRNTFNoYWRvd0VsZW1lbnQ6dHJ1ZSxIVE1MU2xvdEVsZW1lbnQ6dHJ1ZSxIVE1MU291
-cmNlRWxlbWVudDp0cnVlLEhUTUxTcGFuRWxlbWVudDp0cnVlLEhUTUxTdHlsZUVsZW1lbnQ6dHJ1ZSxI
-VE1MVGFibGVDYXB0aW9uRWxlbWVudDp0cnVlLEhUTUxUYWJsZUNlbGxFbGVtZW50OnRydWUsSFRNTFRh
-YmxlRGF0YUNlbGxFbGVtZW50OnRydWUsSFRNTFRhYmxlSGVhZGVyQ2VsbEVsZW1lbnQ6dHJ1ZSxIVE1M
-VGFibGVDb2xFbGVtZW50OnRydWUsSFRNTFRleHRBcmVhRWxlbWVudDp0cnVlLEhUTUxUaW1lRWxlbWVu
-dDp0cnVlLEhUTUxUaXRsZUVsZW1lbnQ6dHJ1ZSxIVE1MVHJhY2tFbGVtZW50OnRydWUsSFRNTFVMaXN0
-RWxlbWVudDp0cnVlLEhUTUxVbmtub3duRWxlbWVudDp0cnVlLEhUTUxWaWRlb0VsZW1lbnQ6dHJ1ZSxI
-VE1MRGlyZWN0b3J5RWxlbWVudDp0cnVlLEhUTUxGb250RWxlbWVudDp0cnVlLEhUTUxGcmFtZUVsZW1l
-bnQ6dHJ1ZSxIVE1MRnJhbWVTZXRFbGVtZW50OnRydWUsSFRNTE1hcnF1ZWVFbGVtZW50OnRydWUsSFRN
-TEVsZW1lbnQ6ZmFsc2UsSFRNTEFuY2hvckVsZW1lbnQ6dHJ1ZSxIVE1MQXJlYUVsZW1lbnQ6dHJ1ZSxI
-VE1MQmFzZUVsZW1lbnQ6dHJ1ZSxCbG9iOmZhbHNlLEhUTUxCb2R5RWxlbWVudDp0cnVlLENEQVRBU2Vj
-dGlvbjp0cnVlLENoYXJhY3RlckRhdGE6dHJ1ZSxDb21tZW50OnRydWUsUHJvY2Vzc2luZ0luc3RydWN0
-aW9uOnRydWUsVGV4dDp0cnVlLENTU1N0eWxlRGVjbGFyYXRpb246dHJ1ZSxNU1N0eWxlQ1NTUHJvcGVy
-dGllczp0cnVlLENTUzJQcm9wZXJ0aWVzOnRydWUsWE1MRG9jdW1lbnQ6dHJ1ZSxEb2N1bWVudDpmYWxz
-ZSxET01FeGNlcHRpb246dHJ1ZSxET01SZWN0UmVhZE9ubHk6ZmFsc2UsRE9NVG9rZW5MaXN0OnRydWUs
-RWxlbWVudDpmYWxzZSxBYm9ydFBheW1lbnRFdmVudDp0cnVlLEFuaW1hdGlvbkV2ZW50OnRydWUsQW5p
-bWF0aW9uUGxheWJhY2tFdmVudDp0cnVlLEFwcGxpY2F0aW9uQ2FjaGVFcnJvckV2ZW50OnRydWUsQmFj
-a2dyb3VuZEZldGNoQ2xpY2tFdmVudDp0cnVlLEJhY2tncm91bmRGZXRjaEV2ZW50OnRydWUsQmFja2dy
-b3VuZEZldGNoRmFpbEV2ZW50OnRydWUsQmFja2dyb3VuZEZldGNoZWRFdmVudDp0cnVlLEJlZm9yZUlu
-c3RhbGxQcm9tcHRFdmVudDp0cnVlLEJlZm9yZVVubG9hZEV2ZW50OnRydWUsQmxvYkV2ZW50OnRydWUs
-Q2FuTWFrZVBheW1lbnRFdmVudDp0cnVlLENsaXBib2FyZEV2ZW50OnRydWUsQ2xvc2VFdmVudDp0cnVl
-LEN1c3RvbUV2ZW50OnRydWUsRGV2aWNlTW90aW9uRXZlbnQ6dHJ1ZSxEZXZpY2VPcmllbnRhdGlvbkV2
-ZW50OnRydWUsRXJyb3JFdmVudDp0cnVlLEV4dGVuZGFibGVFdmVudDp0cnVlLEV4dGVuZGFibGVNZXNz
-YWdlRXZlbnQ6dHJ1ZSxGZXRjaEV2ZW50OnRydWUsRm9udEZhY2VTZXRMb2FkRXZlbnQ6dHJ1ZSxGb3Jl
-aWduRmV0Y2hFdmVudDp0cnVlLEdhbWVwYWRFdmVudDp0cnVlLEhhc2hDaGFuZ2VFdmVudDp0cnVlLElu
-c3RhbGxFdmVudDp0cnVlLE1lZGlhRW5jcnlwdGVkRXZlbnQ6dHJ1ZSxNZWRpYUtleU1lc3NhZ2VFdmVu
-dDp0cnVlLE1lZGlhUXVlcnlMaXN0RXZlbnQ6dHJ1ZSxNZWRpYVN0cmVhbUV2ZW50OnRydWUsTWVkaWFT
-dHJlYW1UcmFja0V2ZW50OnRydWUsTWVzc2FnZUV2ZW50OnRydWUsTUlESUNvbm5lY3Rpb25FdmVudDp0
-cnVlLE1JRElNZXNzYWdlRXZlbnQ6dHJ1ZSxNdXRhdGlvbkV2ZW50OnRydWUsTm90aWZpY2F0aW9uRXZl
-bnQ6dHJ1ZSxQYWdlVHJhbnNpdGlvbkV2ZW50OnRydWUsUGF5bWVudFJlcXVlc3RFdmVudDp0cnVlLFBh
-eW1lbnRSZXF1ZXN0VXBkYXRlRXZlbnQ6dHJ1ZSxQb3BTdGF0ZUV2ZW50OnRydWUsUHJlc2VudGF0aW9u
-Q29ubmVjdGlvbkF2YWlsYWJsZUV2ZW50OnRydWUsUHJlc2VudGF0aW9uQ29ubmVjdGlvbkNsb3NlRXZl
-bnQ6dHJ1ZSxQcm9taXNlUmVqZWN0aW9uRXZlbnQ6dHJ1ZSxQdXNoRXZlbnQ6dHJ1ZSxSVENEYXRhQ2hh
-bm5lbEV2ZW50OnRydWUsUlRDRFRNRlRvbmVDaGFuZ2VFdmVudDp0cnVlLFJUQ1BlZXJDb25uZWN0aW9u
-SWNlRXZlbnQ6dHJ1ZSxSVENUcmFja0V2ZW50OnRydWUsU2VjdXJpdHlQb2xpY3lWaW9sYXRpb25FdmVu
-dDp0cnVlLFNlbnNvckVycm9yRXZlbnQ6dHJ1ZSxTcGVlY2hSZWNvZ25pdGlvbkVycm9yOnRydWUsU3Bl
-ZWNoUmVjb2duaXRpb25FdmVudDp0cnVlLFNwZWVjaFN5bnRoZXNpc0V2ZW50OnRydWUsU3RvcmFnZUV2
-ZW50OnRydWUsU3luY0V2ZW50OnRydWUsVHJhY2tFdmVudDp0cnVlLFRyYW5zaXRpb25FdmVudDp0cnVl
-LFdlYktpdFRyYW5zaXRpb25FdmVudDp0cnVlLFZSRGV2aWNlRXZlbnQ6dHJ1ZSxWUkRpc3BsYXlFdmVu
-dDp0cnVlLFZSU2Vzc2lvbkV2ZW50OnRydWUsTW9qb0ludGVyZmFjZVJlcXVlc3RFdmVudDp0cnVlLFVT
-QkNvbm5lY3Rpb25FdmVudDp0cnVlLElEQlZlcnNpb25DaGFuZ2VFdmVudDp0cnVlLEF1ZGlvUHJvY2Vz
-c2luZ0V2ZW50OnRydWUsT2ZmbGluZUF1ZGlvQ29tcGxldGlvbkV2ZW50OnRydWUsV2ViR0xDb250ZXh0
-RXZlbnQ6dHJ1ZSxFdmVudDpmYWxzZSxJbnB1dEV2ZW50OmZhbHNlLEV2ZW50VGFyZ2V0OmZhbHNlLEZp
-bGU6dHJ1ZSxIVE1MRm9ybUVsZW1lbnQ6dHJ1ZSxIaXN0b3J5OnRydWUsSFRNTERvY3VtZW50OnRydWUs
-WE1MSHR0cFJlcXVlc3Q6dHJ1ZSxYTUxIdHRwUmVxdWVzdEV2ZW50VGFyZ2V0OmZhbHNlLEltYWdlRGF0
-YTp0cnVlLExvY2F0aW9uOnRydWUsTW91c2VFdmVudDp0cnVlLERyYWdFdmVudDp0cnVlLFBvaW50ZXJF
-dmVudDp0cnVlLFdoZWVsRXZlbnQ6dHJ1ZSxEb2N1bWVudEZyYWdtZW50OnRydWUsU2hhZG93Um9vdDp0
-cnVlLERvY3VtZW50VHlwZTp0cnVlLE5vZGU6ZmFsc2UsTm9kZUxpc3Q6dHJ1ZSxSYWRpb05vZGVMaXN0
-OnRydWUsSFRNTFBhcmFncmFwaEVsZW1lbnQ6dHJ1ZSxQcm9ncmVzc0V2ZW50OnRydWUsUmVzb3VyY2VQ
-cm9ncmVzc0V2ZW50OnRydWUsSFRNTFNlbGVjdEVsZW1lbnQ6dHJ1ZSxIVE1MVGFibGVFbGVtZW50OnRy
-dWUsSFRNTFRhYmxlUm93RWxlbWVudDp0cnVlLEhUTUxUYWJsZVNlY3Rpb25FbGVtZW50OnRydWUsSFRN
-TFRlbXBsYXRlRWxlbWVudDp0cnVlLENvbXBvc2l0aW9uRXZlbnQ6dHJ1ZSxGb2N1c0V2ZW50OnRydWUs
-S2V5Ym9hcmRFdmVudDp0cnVlLFRleHRFdmVudDp0cnVlLFRvdWNoRXZlbnQ6dHJ1ZSxVSUV2ZW50OmZh
-bHNlLFdpbmRvdzp0cnVlLERPTVdpbmRvdzp0cnVlLERlZGljYXRlZFdvcmtlckdsb2JhbFNjb3BlOnRy
-dWUsU2VydmljZVdvcmtlckdsb2JhbFNjb3BlOnRydWUsU2hhcmVkV29ya2VyR2xvYmFsU2NvcGU6dHJ1
-ZSxXb3JrZXJHbG9iYWxTY29wZTp0cnVlLEF0dHI6dHJ1ZSxDbGllbnRSZWN0OnRydWUsRE9NUmVjdDp0
-cnVlLE5hbWVkTm9kZU1hcDp0cnVlLE1vek5hbWVkQXR0ck1hcDp0cnVlLElEQktleVJhbmdlOnRydWUs
-U1ZHU2NyaXB0RWxlbWVudDp0cnVlLFNWR0FFbGVtZW50OnRydWUsU1ZHQW5pbWF0ZUVsZW1lbnQ6dHJ1
-ZSxTVkdBbmltYXRlTW90aW9uRWxlbWVudDp0cnVlLFNWR0FuaW1hdGVUcmFuc2Zvcm1FbGVtZW50OnRy
-dWUsU1ZHQW5pbWF0aW9uRWxlbWVudDp0cnVlLFNWR0NpcmNsZUVsZW1lbnQ6dHJ1ZSxTVkdDbGlwUGF0
-aEVsZW1lbnQ6dHJ1ZSxTVkdEZWZzRWxlbWVudDp0cnVlLFNWR0Rlc2NFbGVtZW50OnRydWUsU1ZHRGlz
-Y2FyZEVsZW1lbnQ6dHJ1ZSxTVkdFbGxpcHNlRWxlbWVudDp0cnVlLFNWR0ZFQmxlbmRFbGVtZW50OnRy
-dWUsU1ZHRkVDb2xvck1hdHJpeEVsZW1lbnQ6dHJ1ZSxTVkdGRUNvbXBvbmVudFRyYW5zZmVyRWxlbWVu
-dDp0cnVlLFNWR0ZFQ29tcG9zaXRlRWxlbWVudDp0cnVlLFNWR0ZFQ29udm9sdmVNYXRyaXhFbGVtZW50
-OnRydWUsU1ZHRkVEaWZmdXNlTGlnaHRpbmdFbGVtZW50OnRydWUsU1ZHRkVEaXNwbGFjZW1lbnRNYXBF
-bGVtZW50OnRydWUsU1ZHRkVEaXN0YW50TGlnaHRFbGVtZW50OnRydWUsU1ZHRkVGbG9vZEVsZW1lbnQ6
-dHJ1ZSxTVkdGRUZ1bmNBRWxlbWVudDp0cnVlLFNWR0ZFRnVuY0JFbGVtZW50OnRydWUsU1ZHRkVGdW5j
-R0VsZW1lbnQ6dHJ1ZSxTVkdGRUZ1bmNSRWxlbWVudDp0cnVlLFNWR0ZFR2F1c3NpYW5CbHVyRWxlbWVu
-dDp0cnVlLFNWR0ZFSW1hZ2VFbGVtZW50OnRydWUsU1ZHRkVNZXJnZUVsZW1lbnQ6dHJ1ZSxTVkdGRU1l
-cmdlTm9kZUVsZW1lbnQ6dHJ1ZSxTVkdGRU1vcnBob2xvZ3lFbGVtZW50OnRydWUsU1ZHRkVPZmZzZXRF
-bGVtZW50OnRydWUsU1ZHRkVQb2ludExpZ2h0RWxlbWVudDp0cnVlLFNWR0ZFU3BlY3VsYXJMaWdodGlu
-Z0VsZW1lbnQ6dHJ1ZSxTVkdGRVNwb3RMaWdodEVsZW1lbnQ6dHJ1ZSxTVkdGRVRpbGVFbGVtZW50OnRy
-dWUsU1ZHRkVUdXJidWxlbmNlRWxlbWVudDp0cnVlLFNWR0ZpbHRlckVsZW1lbnQ6dHJ1ZSxTVkdGb3Jl
-aWduT2JqZWN0RWxlbWVudDp0cnVlLFNWR0dFbGVtZW50OnRydWUsU1ZHR2VvbWV0cnlFbGVtZW50OnRy
-dWUsU1ZHR3JhcGhpY3NFbGVtZW50OnRydWUsU1ZHSW1hZ2VFbGVtZW50OnRydWUsU1ZHTGluZUVsZW1l
-bnQ6dHJ1ZSxTVkdMaW5lYXJHcmFkaWVudEVsZW1lbnQ6dHJ1ZSxTVkdNYXJrZXJFbGVtZW50OnRydWUs
-U1ZHTWFza0VsZW1lbnQ6dHJ1ZSxTVkdNZXRhZGF0YUVsZW1lbnQ6dHJ1ZSxTVkdQYXRoRWxlbWVudDp0
-cnVlLFNWR1BhdHRlcm5FbGVtZW50OnRydWUsU1ZHUG9seWdvbkVsZW1lbnQ6dHJ1ZSxTVkdQb2x5bGlu
-ZUVsZW1lbnQ6dHJ1ZSxTVkdSYWRpYWxHcmFkaWVudEVsZW1lbnQ6dHJ1ZSxTVkdSZWN0RWxlbWVudDp0
-cnVlLFNWR1NldEVsZW1lbnQ6dHJ1ZSxTVkdTdG9wRWxlbWVudDp0cnVlLFNWR1N0eWxlRWxlbWVudDp0
-cnVlLFNWR1NWR0VsZW1lbnQ6dHJ1ZSxTVkdTd2l0Y2hFbGVtZW50OnRydWUsU1ZHU3ltYm9sRWxlbWVu
-dDp0cnVlLFNWR1RTcGFuRWxlbWVudDp0cnVlLFNWR1RleHRDb250ZW50RWxlbWVudDp0cnVlLFNWR1Rl
-eHRFbGVtZW50OnRydWUsU1ZHVGV4dFBhdGhFbGVtZW50OnRydWUsU1ZHVGV4dFBvc2l0aW9uaW5nRWxl
-bWVudDp0cnVlLFNWR1RpdGxlRWxlbWVudDp0cnVlLFNWR1VzZUVsZW1lbnQ6dHJ1ZSxTVkdWaWV3RWxl
-bWVudDp0cnVlLFNWR0dyYWRpZW50RWxlbWVudDp0cnVlLFNWR0NvbXBvbmVudFRyYW5zZmVyRnVuY3Rp
-b25FbGVtZW50OnRydWUsU1ZHRkVEcm9wU2hhZG93RWxlbWVudDp0cnVlLFNWR01QYXRoRWxlbWVudDp0
-cnVlLFNWR0VsZW1lbnQ6ZmFsc2V9KQpILkxaLiRuYXRpdmVTdXBlcmNsYXNzVGFnPSJBcnJheUJ1ZmZl
-clZpZXciCkguUkcuJG5hdGl2ZVN1cGVyY2xhc3NUYWc9IkFycmF5QnVmZmVyVmlldyIKSC5WUC4kbmF0
-aXZlU3VwZXJjbGFzc1RhZz0iQXJyYXlCdWZmZXJWaWV3IgpILkRnLiRuYXRpdmVTdXBlcmNsYXNzVGFn
-PSJBcnJheUJ1ZmZlclZpZXciCkguV0IuJG5hdGl2ZVN1cGVyY2xhc3NUYWc9IkFycmF5QnVmZmVyVmll
-dyIKSC5aRy4kbmF0aXZlU3VwZXJjbGFzc1RhZz0iQXJyYXlCdWZmZXJWaWV3IgpILlBnLiRuYXRpdmVT
-dXBlcmNsYXNzVGFnPSJBcnJheUJ1ZmZlclZpZXcifSkoKQpjb252ZXJ0QWxsVG9GYXN0T2JqZWN0KHcp
-CmNvbnZlcnRUb0Zhc3RPYmplY3QoJCk7KGZ1bmN0aW9uKGEpe2lmKHR5cGVvZiBkb2N1bWVudD09PSJ1
-bmRlZmluZWQiKXthKG51bGwpCnJldHVybn1pZih0eXBlb2YgZG9jdW1lbnQuY3VycmVudFNjcmlwdCE9
-J3VuZGVmaW5lZCcpe2EoZG9jdW1lbnQuY3VycmVudFNjcmlwdCkKcmV0dXJufXZhciB0PWRvY3VtZW50
-LnNjcmlwdHMKZnVuY3Rpb24gb25Mb2FkKGIpe2Zvcih2YXIgcj0wO3I8dC5sZW5ndGg7KytyKXRbcl0u
-cmVtb3ZlRXZlbnRMaXN0ZW5lcigibG9hZCIsb25Mb2FkLGZhbHNlKQphKGIudGFyZ2V0KX1mb3IodmFy
-IHM9MDtzPHQubGVuZ3RoOysrcyl0W3NdLmFkZEV2ZW50TGlzdGVuZXIoImxvYWQiLG9uTG9hZCxmYWxz
-ZSl9KShmdW5jdGlvbihhKXt2LmN1cnJlbnRTY3JpcHQ9YQppZih0eXBlb2YgZGFydE1haW5SdW5uZXI9
-PT0iZnVuY3Rpb24iKWRhcnRNYWluUnVubmVyKEwuSXEsW10pCmVsc2UgTC5JcShbXSl9KX0pKCkKLy8j
-IHNvdXJjZU1hcHBpbmdVUkw9bWlncmF0aW9uLmpzLm1hcAo=
+LApmRzpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAKaWYoYSE9bnVsbCl7dD1kb2N1bWVudApzPXQu
+Z2V0RWxlbWVudEJ5SWQoIm8iK0guZChhKSkKcj10LnF1ZXJ5U2VsZWN0b3IoIi5saW5lLSIrSC5kKGIp
+KQppZihzIT1udWxsKXtMLnFPKHMpCkouZFIocykuaSgwLCJ0YXJnZXQiKX1lbHNlIGlmKHIhPW51bGwp
+TC5xTyhyLnBhcmVudEVsZW1lbnQpCmlmKHIhPW51bGwpSi5kUih1LmguYShyLnBhcmVudE5vZGUpKS5p
+KDAsImhpZ2hsaWdodCIpfWVsc2V7dD1kb2N1bWVudApxPXUuaApILkRoKHEscSwiVCIsInF1ZXJ5U2Vs
+ZWN0b3JBbGwiKQp0PXQucXVlcnlTZWxlY3RvckFsbCgiLmxpbmUtbm8iKQpwPW5ldyBXLnd6KHQsdS5U
+KQppZihwLmdBKHApPT09MClyZXR1cm4KTC5xTyhxLmIoQy50NS5ndEgodCkpKX19LAphZjpmdW5jdGlv
+bihhLGIsYyxkLGUpe3ZhciB0LHMscj1MLkc2KHdpbmRvdy5sb2NhdGlvbi5ocmVmKSxxPUwuYUsod2lu
+ZG93LmxvY2F0aW9uLmhyZWYpCmlmKHIhPW51bGwpe3Q9ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm8i
+K0guZChyKSkKaWYodCE9bnVsbClKLmRSKHQpLlIoMCwidGFyZ2V0Iil9aWYocSE9bnVsbCl7cz1kb2N1
+bWVudC5xdWVyeVNlbGVjdG9yKCIubGluZS0iK0guZChxKSkKaWYocyE9bnVsbClKLmRSKHMucGFyZW50
+RWxlbWVudCkuUigwLCJoaWdobGlnaHQiKX1pZihhPT13aW5kb3cubG9jYXRpb24ucGF0aG5hbWUpe0wu
+ZkcoYixjKQplLiQwKCl9ZWxzZSBMLkc3KGEsYixjLGQsZSl9LApRNDpmdW5jdGlvbihhLGIpe3ZhciB0
+LHMscj1QLmhLKGEpLHE9dS5OCnE9UC5GbChxLHEpCmZvcih0PXIuZ2hZKCksdD10LmdQdSh0KSx0PXQu
+Z2t6KHQpO3QuRigpOyl7cz10LmdsKCkKcS5ZKDAscy5hLHMuYil9Zm9yKHQ9Yi5nUHUoYiksdD10Lmdr
+eih0KTt0LkYoKTspe3M9dC5nbCgpCnEuWSgwLHMuYSxzLmIpfXEuWSgwLCJhdXRoVG9rZW4iLCQuVUUo
+KSkKcmV0dXJuIHIubm0oMCxxKS53KDApfSwKVDE6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscCxvLG4s
+bSxsLGs9JC5oTCgpCkoubDUoaywiIikKaWYoYT09bnVsbCl7dD1kb2N1bWVudC5jcmVhdGVFbGVtZW50
+KCJwIikKdC50ZXh0Q29udGVudD0iU2VlIGRldGFpbHMgYWJvdXQgYSBwcm9wb3NlZCBlZGl0LiIKQy5M
+dC5zUCh0LEguVk0oWyJwbGFjZWhvbGRlciJdLHUucykpCmsuYXBwZW5kQ2hpbGQodCkKQy5MdC5GRih0
+KQpyZXR1cm59cz1hLmQKcj0kLm5VKCkKcT1yLnpmKHMpCnA9YS5iCm89ZG9jdW1lbnQKbj1yLkhQKHMs
+Si5UMChvLnF1ZXJ5U2VsZWN0b3IoIi5yb290IikudGV4dENvbnRlbnQpKQptPWEuYwpsPW8uY3JlYXRl
+RWxlbWVudCgicCIpCmsuYXBwZW5kQ2hpbGQobCkKbC5hcHBlbmRDaGlsZChvLmNyZWF0ZVRleHROb2Rl
+KEguZChwKSsiIGF0ICIpKQpyPXUuTgpyPVcuSjYoTC5RNChhLmUsUC5FRihbImxpbmUiLEouaihtKV0s
+cixyKSkpCnIuYXBwZW5kQ2hpbGQoby5jcmVhdGVUZXh0Tm9kZShILmQobikrIjoiK0guZChtKSsiLiIp
+KQpsLmFwcGVuZENoaWxkKHIpCkouZGgobCkKTC5DQyhhLGsscSkKTC5GeihhLGspfSwKTEg6ZnVuY3Rp
+b24oYSxiLGMpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrLGosaSxoLGc9JC55UCgpCkoubDUoZywiIikK
+aWYoYi5nQShiKT09PTApe3Q9ZG9jdW1lbnQKcz10LmNyZWF0ZUVsZW1lbnQoInAiKQpnLmFwcGVuZENo
+aWxkKHMpCnMuYXBwZW5kQ2hpbGQodC5jcmVhdGVUZXh0Tm9kZSgiTm8gcHJvcG9zZWQgZWRpdHMiKSl9
+ZWxzZSBmb3IoZz1iLmdQdShiKSxnPWcuZ2t6KGcpLHQ9dS5RLHI9dC5DKCJ+KDEpIikscT11Lk0sdD10
+LmQ7Zy5GKCk7KXtwPWcuZ2woKQpvPWRvY3VtZW50CnM9by5jcmVhdGVFbGVtZW50KCJwIikKbj0kLnlQ
+KCkKbi5hcHBlbmRDaGlsZChzKQpzLmFwcGVuZENoaWxkKG8uY3JlYXRlVGV4dE5vZGUoSC5kKHAuYSkr
+IjoiKSkKbT1vLmNyZWF0ZUVsZW1lbnQoInVsIikKbi5hcHBlbmRDaGlsZChtKQpmb3IocD1KLklUKHAu
+Yik7cC5GKCk7KXtuPXAuZ2woKQpsPW8uY3JlYXRlRWxlbWVudCgibGkiKQptLmFwcGVuZENoaWxkKGwp
+CkouZFIobCkuaSgwLCJlZGl0IikKaz1vLmNyZWF0ZUVsZW1lbnQoImEiKQpsLmFwcGVuZENoaWxkKGsp
+CmsuY2xhc3NMaXN0LmFkZCgiZWRpdC1saW5rIikKaj1uLmMKaT1ILmQoaikKay5zZXRBdHRyaWJ1dGUo
+ImRhdGEtIituZXcgVy5TeShuZXcgVy5pNyhrKSkuTygib2Zmc2V0IiksaSkKaD1uLmEKaT1ILmQoaCkK
+ay5zZXRBdHRyaWJ1dGUoImRhdGEtIituZXcgVy5TeShuZXcgVy5pNyhrKSkuTygibGluZSIpLGkpCmsu
+YXBwZW5kQ2hpbGQoby5jcmVhdGVUZXh0Tm9kZSgibGluZSAiK0guZChoKSkpCmk9ci5iKG5ldyBMLkVF
+KGosaCxhKSkKcS5iKG51bGwpClcuSkUoaywiY2xpY2siLGksITEsdCkKbC5hcHBlbmRDaGlsZChvLmNy
+ZWF0ZVRleHROb2RlKCI6ICIrSC5kKG4uYikpKX19aWYoYylMLlQxKG51bGwpfSwKRnI6ZnVuY3Rpb24o
+YSxiLGMpe3ZhciB0LHMscj13aW5kb3cubG9jYXRpb24scT1QLmhLKChyJiZDLkV4KS5nRHIocikrSC5k
+KGEpKQpyPXUuTgpyPVAuRmwocixyKQppZihiIT1udWxsKXIuWSgwLCJvZmZzZXQiLEguZChiKSkKaWYo
+YyE9bnVsbClyLlkoMCwibGluZSIsSC5kKGMpKQpyLlkoMCwiYXV0aFRva2VuIiwkLlVFKCkpCnE9cS5u
+bSgwLHIpCnI9d2luZG93Lmhpc3RvcnkKdD11LnoKcz1xLncoMCkKci50b1N0cmluZwpyLnB1c2hTdGF0
+ZShuZXcgUC5CZihbXSxbXSkuUHYoUC5GbCh0LHQpKSwiIixzKX0sCkVuOmZ1bmN0aW9uKGEpe3ZhciB0
+PUouYmIoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnJvb3QiKS50ZXh0Q29udGVudCwiLyIpCmlmKEMu
+eEIubihhLHQpKXJldHVybiBDLnhCLkcoYSx0Lmxlbmd0aCkKZWxzZSByZXR1cm4gYX0sCkJYOmZ1bmN0
+aW9uKGEsYil7dmFyIHQscyxyPXt9CnIuYT1hCmE9TC5FbihhKQpyLmE9YQokLkQ5KCkudGV4dENvbnRl
+bnQ9YQp0PWRvY3VtZW50CnM9dS5oCkguRGgocyxzLCJUIiwicXVlcnlTZWxlY3RvckFsbCIpCnQ9bmV3
+IFcud3oodC5xdWVyeVNlbGVjdG9yQWxsKCIubmF2LXBhbmVsIC5uYXYtbGluayIpLHUuVCkKdC5LKHQs
+bmV3IEwuVlMocikpfSwKQkU6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0PSIucmVnaW9ucyIscz1kb2N1bWVu
+dCxyPXMucXVlcnlTZWxlY3Rvcih0KSxxPXMucXVlcnlTZWxlY3RvcigiLmNvZGUiKQpKLnRIKHIsYi5h
+LCQuS0coKSkKSi50SChxLGIuYiwkLktHKCkpCkwuTEgoYSxiLmQsYykKTC52VSgpCkwueVgoIi5jb2Rl
+IiwhMCkKTC55WCh0LCEwKX0sCnRYOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEscCxvLG4sbSxsLGss
+aixpLGgsZz1kb2N1bWVudCxmPWcuY3JlYXRlRWxlbWVudCgidWwiKQphLmFwcGVuZENoaWxkKGYpCmZv
+cih0PWIubGVuZ3RoLHM9dS5NLHI9MDtyPGIubGVuZ3RoO2IubGVuZ3RoPT09dHx8KDAsSC5saykoYiks
+KytyKXtxPWJbcl0KcD1nLmNyZWF0ZUVsZW1lbnQoImxpIikKZi5hcHBlbmRDaGlsZChwKQpvPUouUkUo
+cCkKaWYocS5hPT09Qy5ZMil7by5nUChwKS5pKDAsImRpciIpCm49Zy5jcmVhdGVFbGVtZW50KCJzcGFu
+IikKcC5hcHBlbmRDaGlsZChuKQpvPUouUkUobikKby5nUChuKS5pKDAsImFycm93IikKby5zaGYobiwi
+JiN4MjVCQzsiKQptPWcuY3JlYXRlRWxlbWVudCgic3BhbiIpCnAuYXBwZW5kQ2hpbGQobSkKSi5sNSht
+LCImI3gxRjRDMTsiKQpwLmFwcGVuZENoaWxkKGcuY3JlYXRlVGV4dE5vZGUocS5iKSkKTC50WChwLHEu
+YykKTC5reihuKX1lbHNle28uc2hmKHAsIiYjeDFGNEM0OyIpCmw9Zy5jcmVhdGVFbGVtZW50KCJhIikK
+cC5hcHBlbmRDaGlsZChsKQpvPUouUkUobCkKby5nUChsKS5pKDAsIm5hdi1saW5rIikKbC5zZXRBdHRy
+aWJ1dGUoImRhdGEtIituZXcgVy5TeShuZXcgVy5pNyhsKSkuTygibmFtZSIpLHEuZCkKbC5zZXRBdHRy
+aWJ1dGUoImhyZWYiLHEuZSkKbC5hcHBlbmRDaGlsZChnLmNyZWF0ZVRleHROb2RlKHEuYikpCm89by5n
+VmwobCkKaz1vLiR0aQpqPWsuQygifigxKSIpLmIobmV3IEwuVEQoKSkKcy5iKG51bGwpClcuSkUoby5h
+LG8uYixqLCExLGsuZCkKaT1xLmYKaWYodHlwZW9mIGkhPT0ibnVtYmVyIilyZXR1cm4gaS5vcygpCmlm
+KGk+MCl7aD1nLmNyZWF0ZUVsZW1lbnQoInNwYW4iKQpwLmFwcGVuZENoaWxkKGgpCkouZFIoaCkuaSgw
+LCJlZGl0LWNvdW50IikKbz0iIitpKyIgIgppZihpPT09MSlrPSJlZGl0IgplbHNlIGs9ImVkaXRzIgpo
+LnNldEF0dHJpYnV0ZSgidGl0bGUiLG8raykKaC5hcHBlbmRDaGlsZChnLmNyZWF0ZVRleHROb2RlKEMu
+am4udyhpKSkpfX19fSwKRno6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxqLGk9
+YS5hCmlmKGk9PW51bGwpcmV0dXJuCnQ9ZG9jdW1lbnQKcz10LmNyZWF0ZUVsZW1lbnQoInAiKQpyPWIu
+YXBwZW5kQ2hpbGQocykKcz10LmNyZWF0ZUVsZW1lbnQoInNwYW4iKQpxPXUucwpKLk11KHMsSC5WTShb
+InR5cGUtZGVzY3JpcHRpb24iXSxxKSkKcy5hcHBlbmRDaGlsZCh0LmNyZWF0ZVRleHROb2RlKCJBY3Rp
+b25zIikpCnIuYXBwZW5kQ2hpbGQocykKci5hcHBlbmRDaGlsZCh0LmNyZWF0ZVRleHROb2RlKCI6Iikp
+CnA9dC5jcmVhdGVFbGVtZW50KCJwIikKYi5hcHBlbmRDaGlsZChwKQpmb3Iocz1pLmxlbmd0aCxvPXUu
+WCxuPTA7bjxpLmxlbmd0aDtpLmxlbmd0aD09PXN8fCgwLEgubGspKGkpLCsrbil7bT1pW25dCmw9dC5j
+cmVhdGVFbGVtZW50KCJhIikKcC5hcHBlbmRDaGlsZChsKQpsLmFwcGVuZENoaWxkKHQuY3JlYXRlVGV4
+dE5vZGUobS5hKSkKbC5zZXRBdHRyaWJ1dGUoImhyZWYiLG0uYikKaz1vLmIoSC5WTShbImFkZC1oaW50
+LWxpbmsiLCJiZWZvcmUtYXBwbHkiLCJidXR0b24iXSxxKSkKaj1KLmRSKGwpCmouVjEoMCkKai5GVigw
+LGspfX0sCkNDOmZ1bmN0aW9uKGE4LGE5LGIwKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxqLGksaCxn
+LGYsZSxkLGMsYixhLGEwLGExLGEyLGEzLGE0LGE1LGE2LGE3CmZvcih0PWE4LmYscz10Lmxlbmd0aCxy
+PXUucyxxPXUuWCxwPXUuUSxvPXAuQygifigxKSIpLG49dS5NLHA9cC5kLG09MDttPHQubGVuZ3RoO3Qu
+bGVuZ3RoPT09c3x8KDAsSC5saykodCksKyttKXtsPXRbbV0Kaz1kb2N1bWVudApqPWsuY3JlYXRlRWxl
+bWVudCgicCIpCmk9cS5iKEguVk0oWyJ0cmFjZSJdLHIpKQpoPUouZFIoaikKaC5WMSgwKQpoLkZWKDAs
+aSkKZz1hOS5hcHBlbmRDaGlsZChqKQpqPWsuY3JlYXRlRWxlbWVudCgic3BhbiIpCmk9cS5iKEguVk0o
+WyJ0eXBlLWRlc2NyaXB0aW9uIl0scikpCmg9Si5kUihqKQpoLlYxKDApCmguRlYoMCxpKQpqLmFwcGVu
+ZENoaWxkKGsuY3JlYXRlVGV4dE5vZGUobC5hKSkKZy5hcHBlbmRDaGlsZChqKQpnLmFwcGVuZENoaWxk
+KGsuY3JlYXRlVGV4dE5vZGUoIjoiKSkKaj1rLmNyZWF0ZUVsZW1lbnQoInVsIikKaT1xLmIoSC5WTShb
+InRyYWNlIl0scikpCmg9Si5kUihqKQpoLlYxKDApCmguRlYoMCxpKQpmPWcuYXBwZW5kQ2hpbGQoaikK
+Zm9yKGo9bC5iLGk9ai5sZW5ndGgsZT0wO2U8ai5sZW5ndGg7ai5sZW5ndGg9PT1pfHwoMCxILmxrKShq
+KSwrK2Upe2Q9altlXQpjPWsuY3JlYXRlRWxlbWVudCgibGkiKQpmLmFwcGVuZENoaWxkKGMpCmI9ay5j
+cmVhdGVFbGVtZW50KCJzcGFuIikKYT1xLmIoSC5WTShbImZ1bmN0aW9uIl0scikpCmg9Si5kUihiKQpo
+LlYxKDApCmguRlYoMCxhKQphPWQuYgpMLmtEKGIsYT09bnVsbD8idW5rbm93biI6YSkKYy5hcHBlbmRD
+aGlsZChiKQphMD1kLmMKaWYoYTAhPW51bGwpe2MuYXBwZW5kQ2hpbGQoay5jcmVhdGVUZXh0Tm9kZSgi
+ICgiKSkKYTE9YTAuYgphMj1rLmNyZWF0ZUVsZW1lbnQoImEiKQphMi5hcHBlbmRDaGlsZChrLmNyZWF0
+ZVRleHROb2RlKEguZChhMC5jKSsiOiIrSC5kKGExKSkpCmEyLnNldEF0dHJpYnV0ZSgiaHJlZiIsYTAu
+YSkKYTIuY2xhc3NMaXN0LmFkZCgibmF2LWxpbmsiKQpjLmFwcGVuZENoaWxkKGEyKQpjLmFwcGVuZENo
+aWxkKGsuY3JlYXRlVGV4dE5vZGUoIikiKSl9Yy5hcHBlbmRDaGlsZChrLmNyZWF0ZVRleHROb2RlKCI6
+ICIpKQpiPWQuYQpMLmtEKGMsYj09bnVsbD8idW5rbm93biI6YikKYj1kLmQKaWYoYi5sZW5ndGghPT0w
+KXthPWsuY3JlYXRlRWxlbWVudCgicCIpCmEzPXEuYihILlZNKFsiZHJhd2VyIiwiYmVmb3JlLWFwcGx5
+Il0scikpCmg9Si5kUihhKQpoLlYxKDApCmguRlYoMCxhMykKYTQ9Yy5hcHBlbmRDaGlsZChhKQpmb3Io
+YT1iLmxlbmd0aCxhNT0wO2E1PGIubGVuZ3RoO2IubGVuZ3RoPT09YXx8KDAsSC5saykoYiksKythNSl7
+YTY9YlthNV0KYTM9ay5jcmVhdGVFbGVtZW50KCJidXR0b24iKQphNz1vLmIobmV3IEwuQVMoYTYsYTAp
+KQpuLmIobnVsbCkKVy5KRShhMywiY2xpY2siLGE3LCExLHApCmEzLmFwcGVuZENoaWxkKGsuY3JlYXRl
+VGV4dE5vZGUoTS5PWChhNi5hKSkpCmE0LmFwcGVuZENoaWxkKGEzKX19fX19LAprRDpmdW5jdGlvbihh
+LGIpe3ZhciB0LHMscj1ILlZNKGIuc3BsaXQoIi4iKSx1LnMpLHE9Qy5ObS5ndEgocikscD1kb2N1bWVu
+dAphLmFwcGVuZENoaWxkKHAuY3JlYXRlVGV4dE5vZGUocSkpCmZvcihxPUgucUMociwxLG51bGwsdS5O
+KSxxPW5ldyBILmE3KHEscS5nQShxKSxxLiR0aS5DKCJhNzxhTC5FPiIpKSx0PUouUkUoYSk7cS5GKCk7
+KXtzPXEuZAp0Lm56KGEsImJlZm9yZWVuZCIsIiYjODIwMzsuIixudWxsLG51bGwpCmEuYXBwZW5kQ2hp
+bGQocC5jcmVhdGVUZXh0Tm9kZShzKSl9fSwKZTpmdW5jdGlvbiBlKCl7fSwKVlc6ZnVuY3Rpb24gVlco
+YSxiLGMpe3RoaXMuYT1hCnRoaXMuYj1iCnRoaXMuYz1jfSwKb1o6ZnVuY3Rpb24gb1ooKXt9LApqcjpm
+dW5jdGlvbiBqcigpe30sCnFsOmZ1bmN0aW9uIHFsKCl7fSwKeTg6ZnVuY3Rpb24geTgoKXt9LApIaTpm
+dW5jdGlvbiBIaSgpe30sCkJUOmZ1bmN0aW9uIEJUKCl7fSwKTDpmdW5jdGlvbiBMKCl7fSwKV3g6ZnVu
+Y3Rpb24gV3goYSxiKXt0aGlzLmE9YQp0aGlzLmI9Yn0sCkFPOmZ1bmN0aW9uIEFPKGEpe3RoaXMuYT1h
+fSwKZE46ZnVuY3Rpb24gZE4oYSl7dGhpcy5hPWF9LApIbzpmdW5jdGlvbiBIbyhhKXt0aGlzLmE9YX0s
+Cnh6OmZ1bmN0aW9uIHh6KGEsYil7dGhpcy5hPWEKdGhpcy5iPWJ9LApJQzpmdW5jdGlvbiBJQygpe30s
+CmZDOmZ1bmN0aW9uIGZDKGEsYil7dGhpcy5hPWEKdGhpcy5iPWJ9LApuVDpmdW5jdGlvbiBuVChhLGIs
+Yyl7dGhpcy5hPWEKdGhpcy5iPWIKdGhpcy5jPWN9LApCWjpmdW5jdGlvbiBCWihhKXt0aGlzLmE9YX0s
+CkdIOmZ1bmN0aW9uIEdIKCl7fSwKRUU6ZnVuY3Rpb24gRUUoYSxiLGMpe3RoaXMuYT1hCnRoaXMuYj1i
+CnRoaXMuYz1jfSwKUUw6ZnVuY3Rpb24gUUwoYSxiKXt0aGlzLmE9YQp0aGlzLmI9Yn0sClZTOmZ1bmN0
+aW9uIFZTKGEpe3RoaXMuYT1hfSwKVEQ6ZnVuY3Rpb24gVEQoKXt9LApBUzpmdW5jdGlvbiBBUyhhLGIp
+e3RoaXMuYT1hCnRoaXMuYj1ifSwKWEE6ZnVuY3Rpb24gWEEoKXt9LAptSzpmdW5jdGlvbihhKXt2YXIg
+dCxzLHIscSxwLG8sbj1ILlZNKFtdLHUuZmgpCmZvcih0PUouSVQodS5SLmIoYSkpO3QuRigpOyl7cz10
+LmdsKCkKcj1KLlU2KHMpCnE9TC5wMihILmMwKHIucShzLCJ0eXBlIikpKQpwPUguYzAoci5xKHMsIm5h
+bWUiKSkKbz1yLnEocywic3VidHJlZSIpCm89bz09bnVsbD9udWxsOkwubUsobykKQy5ObS5pKG4sbmV3
+IEwuWloocSxwLG8sSC5jMChyLnEocywicGF0aCIpKSxILmMwKHIucShzLCJocmVmIikpLEguV1koci5x
+KHMsImVkaXRDb3VudCIpKSkpfXJldHVybiBufSwKVkQ6ZnVuY3Rpb24oYSl7dmFyIHQscyxyPUguVk0o
+W10sdS5KKQpmb3IodD1hLmxlbmd0aCxzPTA7czxhLmxlbmd0aDthLmxlbmd0aD09PXR8fCgwLEgubGsp
+KGEpLCsrcylDLk5tLmkocixhW3NdLkx0KCkpCnJldHVybiByfSwKcDI6ZnVuY3Rpb24oYSl7c3dpdGNo
+KGEpe2Nhc2UiZGlyZWN0b3J5IjpyZXR1cm4gQy5ZMgpjYXNlImZpbGUiOnJldHVybiBDLnJmCmRlZmF1
+bHQ6dGhyb3cgSC5iKFAuUFYoIlVucmVjb2duaXplZCBuYXZpZ2F0aW9uIHRyZWUgbm9kZSB0eXBlOiAi
+K0guZChhKSkpfX0sCnZ5OmZ1bmN0aW9uKGEpe3N3aXRjaChhKXtjYXNlIEMuWTI6cmV0dXJuImRpcmVj
+dG9yeSIKY2FzZSBDLnJmOnJldHVybiJmaWxlIn10aHJvdyBILmIoUC5QVigiVW5yZWNvZ25pemVkIG5h
+dmlnYXRpb24gdHJlZSBub2RlIHR5cGU6ICIrYS53KDApKSl9LApaWjpmdW5jdGlvbiBaWihhLGIsYyxk
+LGUsZil7dmFyIF89dGhpcwpfLmE9YQpfLmI9YgpfLmM9YwpfLmQ9ZApfLmU9ZQpfLmY9Zn0sCk85OmZ1
+bmN0aW9uIE85KGEpe3RoaXMuYj1hfSwKSVY6ZnVuY3Rpb24gSVYoYSxiLGMsZCl7dmFyIF89dGhpcwpf
+LmQ9YQpfLmU9YgpfLmY9YwpfLnI9ZH19LFg9ewpDTDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAs
+bz1iLnhaKGEpCmIuaEsoYSkKaWYobyE9bnVsbClhPUouS1YoYSxvLmxlbmd0aCkKdD11LnMKcz1ILlZN
+KFtdLHQpCnI9SC5WTShbXSx0KQp0PWEubGVuZ3RoCmlmKHQhPT0wJiZiLnI0KEMueEIuVyhhLDApKSl7
+aWYoMD49dClyZXR1cm4gSC5PSChhLDApCkMuTm0uaShyLGFbMF0pCnE9MX1lbHNle0MuTm0uaShyLCIi
+KQpxPTB9Zm9yKHA9cTtwPHQ7KytwKWlmKGIucjQoQy54Qi5XKGEscCkpKXtDLk5tLmkocyxDLnhCLk5q
+KGEscSxwKSkKQy5ObS5pKHIsYVtwXSkKcT1wKzF9aWYocTx0KXtDLk5tLmkocyxDLnhCLkcoYSxxKSkK
+Qy5ObS5pKHIsIiIpfXJldHVybiBuZXcgWC5XRChiLG8scyxyKX0sCldEOmZ1bmN0aW9uIFdEKGEsYixj
+LGQpe3ZhciBfPXRoaXMKXy5hPWEKXy5iPWIKXy5kPWMKXy5lPWR9LApJNzpmdW5jdGlvbihhKXtyZXR1
+cm4gbmV3IFguZHYoYSl9LApkdjpmdW5jdGlvbiBkdihhKXt0aGlzLmE9YX19LE89ewpSaDpmdW5jdGlv
+bigpe3ZhciB0LHM9bnVsbAppZihQLnVvKCkuZ0ZpKCkhPT0iZmlsZSIpcmV0dXJuICQuRWIoKQp0PVAu
+dW8oKQppZighQy54Qi5UYyh0LmdJaSh0KSwiLyIpKXJldHVybiAkLkViKCkKaWYoUC5LTChzLCJhL2Ii
+LHMscyxzLHMscykudDQoKT09PSJhXFxiIilyZXR1cm4gJC5LaygpCnJldHVybiAkLmJEKCl9LAp6TDpm
+dW5jdGlvbiB6TCgpe319LEU9e09GOmZ1bmN0aW9uIE9GKGEsYixjKXt0aGlzLmQ9YQp0aGlzLmU9Ygp0
+aGlzLmY9Y319LEY9e3J1OmZ1bmN0aW9uIHJ1KGEsYixjLGQpe3ZhciBfPXRoaXMKXy5kPWEKXy5lPWIK
+Xy5mPWMKXy5yPWR9fSxEPXsKUlg6ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwPW51bGwKdHJ5e3A9UC51
+bygpfWNhdGNoKHQpe2lmKHUuZzguYyhILlJ1KHQpKSl7cz0kLkZmCmlmKHMhPW51bGwpcmV0dXJuIHMK
+dGhyb3cgdH1lbHNlIHRocm93IHR9aWYoSi5STShwLCQuSTYpKXJldHVybiAkLkZmCiQuSTY9cAppZigk
+LkhrKCk9PSQuRWIoKSlzPSQuRmY9cC5aSSgiLiIpLncoMCkKZWxzZXtyPXAudDQoKQpxPXIubGVuZ3Ro
+LTEKcz0kLkZmPXE9PT0wP3I6Qy54Qi5OaihyLDAscSl9cmV0dXJuIHN9fQp2YXIgdz1bQyxILEosUCxX
+LE0sVSxCLFQsTCxYLE8sRSxGLERdCmh1bmtIZWxwZXJzLnNldEZ1bmN0aW9uTmFtZXNJZk5lY2Vzc2Fy
+eSh3KQp2YXIgJD17fQpILmVvLnByb3RvdHlwZT17fQpKLnZCLnByb3RvdHlwZT17CkROOmZ1bmN0aW9u
+KGEsYil7cmV0dXJuIGE9PT1ifSwKZ2lPOmZ1bmN0aW9uKGEpe3JldHVybiBILmVRKGEpfSwKdzpmdW5j
+dGlvbihhKXtyZXR1cm4iSW5zdGFuY2Ugb2YgJyIrSC5kKEguTShhKSkrIicifSwKZTc6ZnVuY3Rpb24o
+YSxiKXt1Lm8uYihiKQp0aHJvdyBILmIoUC5scihhLGIuZ1dhKCksYi5nbmQoKSxiLmdWbSgpKSl9fQpK
+LnlFLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIFN0cmluZyhhKX0sCmdpTzpmdW5jdGlv
+bihhKXtyZXR1cm4gYT81MTkwMTg6MjE4MTU5fSwKJGlhMjoxfQpKLllFLnByb3RvdHlwZT17CkROOmZ1
+bmN0aW9uKGEsYil7cmV0dXJuIG51bGw9PWJ9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiJudWxsIn0sCmdp
+TzpmdW5jdGlvbihhKXtyZXR1cm4gMH0sCmU3OmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuU2ooYSx1
+Lm8uYihiKSl9LAokaWM4OjF9CkouTUYucHJvdG90eXBlPXsKZ2lPOmZ1bmN0aW9uKGEpe3JldHVybiAw
+fSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gU3RyaW5nKGEpfSwKJGl2bToxfQpKLmlDLnByb3RvdHlwZT17
+fQpKLmtkLnByb3RvdHlwZT17fQpKLmM1LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9YVsk
+LncoKV0KaWYodD09bnVsbClyZXR1cm4gdGhpcy50KGEpCnJldHVybiJKYXZhU2NyaXB0IGZ1bmN0aW9u
+IGZvciAiK0guZChKLmoodCkpfSwKJFM6ZnVuY3Rpb24oKXtyZXR1cm57ZnVuYzoxLG9wdDpbLCwsLCws
+LCwsLCwsLCwsLF19fSwKJGlFSDoxfQpKLmpkLnByb3RvdHlwZT17Cmk6ZnVuY3Rpb24oYSxiKXtILnQ2
+KGEpLmQuYihiKQppZighIWEuZml4ZWQkbGVuZ3RoKUgudmgoUC5MNCgiYWRkIikpCmEucHVzaChiKX0s
+Clc0OmZ1bmN0aW9uKGEsYil7dmFyIHQKaWYoISFhLmZpeGVkJGxlbmd0aClILnZoKFAuTDQoInJlbW92
+ZUF0IikpCnQ9YS5sZW5ndGgKaWYoYj49dCl0aHJvdyBILmIoUC54KGIsbnVsbCkpCnJldHVybiBhLnNw
+bGljZShiLDEpWzBdfSwKVUc6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMscgpILnQ2KGEpLkMoImNYPDE+
+IikuYihjKQppZighIWEuZml4ZWQkbGVuZ3RoKUgudmgoUC5MNCgiaW5zZXJ0QWxsIikpCnQ9YS5sZW5n
+dGgKUC53QShiLDAsdCwiaW5kZXgiKQpzPWMubGVuZ3RoCnRoaXMuc0EoYSx0K3MpCnI9YitzCnRoaXMu
+WVcoYSxyLGEubGVuZ3RoLGEsYikKdGhpcy52ZyhhLGIscixjKX0sCm12OmZ1bmN0aW9uKGEpe2lmKCEh
+YS5maXhlZCRsZW5ndGgpSC52aChQLkw0KCJyZW1vdmVMYXN0IikpCmlmKGEubGVuZ3RoPT09MCl0aHJv
+dyBILmIoSC5IWShhLC0xKSkKcmV0dXJuIGEucG9wKCl9LApGVjpmdW5jdGlvbihhLGIpe3ZhciB0Ckgu
+dDYoYSkuQygiY1g8MT4iKS5iKGIpCmlmKCEhYS5maXhlZCRsZW5ndGgpSC52aChQLkw0KCJhZGRBbGwi
+KSkKZm9yKHQ9Si5JVChiKTt0LkYoKTspYS5wdXNoKHQuZ2woKSl9LApLOmZ1bmN0aW9uKGEsYil7dmFy
+IHQscwpILnQ2KGEpLkMoIn4oMSkiKS5iKGIpCnQ9YS5sZW5ndGgKZm9yKHM9MDtzPHQ7KytzKXtiLiQx
+KGFbc10pCmlmKGEubGVuZ3RoIT09dCl0aHJvdyBILmIoUC5hNChhKSl9fSwKRTI6ZnVuY3Rpb24oYSxi
+LGMpe3ZhciB0PUgudDYoYSkKcmV0dXJuIG5ldyBILkE4KGEsdC5LcShjKS5DKCIxKDIpIikuYihiKSx0
+LkMoIkA8MT4iKS5LcShjKS5DKCJBODwxLDI+IikpfSwKSDpmdW5jdGlvbihhLGIpe3ZhciB0LHM9bmV3
+IEFycmF5KGEubGVuZ3RoKQpzLmZpeGVkJGxlbmd0aD1BcnJheQpmb3IodD0wO3Q8YS5sZW5ndGg7Kyt0
+KXRoaXMuWShzLHQsSC5kKGFbdF0pKQpyZXR1cm4gcy5qb2luKGIpfSwKTjA6ZnVuY3Rpb24oYSxiLGMs
+ZCl7dmFyIHQscyxyCmQuYihiKQpILnQ2KGEpLktxKGQpLkMoIjEoMSwyKSIpLmIoYykKdD1hLmxlbmd0
+aApmb3Iocz1iLHI9MDtyPHQ7KytyKXtzPWMuJDIocyxhW3JdKQppZihhLmxlbmd0aCE9PXQpdGhyb3cg
+SC5iKFAuYTQoYSkpfXJldHVybiBzfSwKSHQ6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG89SC50
+NihhKQpvLkMoImEyKDEpIikuYihiKQpvLkMoIjEoKSIpLmIobnVsbCkKdD1hLmxlbmd0aApmb3Iocz1u
+dWxsLHI9ITEscT0wO3E8dDsrK3Epe3A9YVtxXQppZihILm9UKGIuJDEocCkpKXtpZihyKXRocm93IEgu
+YihILmRVKCkpCnM9cApyPSEwfWlmKHQhPT1hLmxlbmd0aCl0aHJvdyBILmIoUC5hNChhKSl9aWYocily
+ZXR1cm4gcwp0aHJvdyBILmIoSC5XcCgpKX0sCkU6ZnVuY3Rpb24oYSxiKXtpZihiPDB8fGI+PWEubGVu
+Z3RoKXJldHVybiBILk9IKGEsYikKcmV0dXJuIGFbYl19LApENjpmdW5jdGlvbihhLGIsYyl7aWYoYjww
+fHxiPmEubGVuZ3RoKXRocm93IEguYihQLlRFKGIsMCxhLmxlbmd0aCwic3RhcnQiLG51bGwpKQppZihj
+PGJ8fGM+YS5sZW5ndGgpdGhyb3cgSC5iKFAuVEUoYyxiLGEubGVuZ3RoLCJlbmQiLG51bGwpKQppZihi
+PT09YylyZXR1cm4gSC5WTShbXSxILnQ2KGEpKQpyZXR1cm4gSC5WTShhLnNsaWNlKGIsYyksSC50Nihh
+KSl9LApndEg6ZnVuY3Rpb24oYSl7aWYoYS5sZW5ndGg+MClyZXR1cm4gYVswXQp0aHJvdyBILmIoSC5X
+cCgpKX0sCmdyWjpmdW5jdGlvbihhKXt2YXIgdD1hLmxlbmd0aAppZih0PjApcmV0dXJuIGFbdC0xXQp0
+aHJvdyBILmIoSC5XcCgpKX0sCllXOmZ1bmN0aW9uKGEsYixjLGQsZSl7dmFyIHQscyxyPUgudDYoYSkK
+ci5DKCJjWDwxPiIpLmIoZCkKaWYoISFhLmltbXV0YWJsZSRsaXN0KUgudmgoUC5MNCgic2V0UmFuZ2Ui
+KSkKUC5qQihiLGMsYS5sZW5ndGgpCnQ9Yy1iCmlmKHQ9PT0wKXJldHVybgpQLmsxKGUsInNraXBDb3Vu
+dCIpCnIuQygiek08MT4iKS5iKGQpCnI9Si5VNihkKQppZihlK3Q+ci5nQShkKSl0aHJvdyBILmIoSC5h
+cigpKQppZihlPGIpZm9yKHM9dC0xO3M+PTA7LS1zKWFbYitzXT1yLnEoZCxlK3MpCmVsc2UgZm9yKHM9
+MDtzPHQ7KytzKWFbYitzXT1yLnEoZCxlK3MpfSwKdmc6ZnVuY3Rpb24oYSxiLGMsZCl7cmV0dXJuIHRo
+aXMuWVcoYSxiLGMsZCwwKX0sClZyOmZ1bmN0aW9uKGEsYil7dmFyIHQscwpILnQ2KGEpLkMoImEyKDEp
+IikuYihiKQp0PWEubGVuZ3RoCmZvcihzPTA7czx0Oysrcyl7aWYoSC5vVChiLiQxKGFbc10pKSlyZXR1
+cm4hMAppZihhLmxlbmd0aCE9PXQpdGhyb3cgSC5iKFAuYTQoYSkpfXJldHVybiExfSwKdGc6ZnVuY3Rp
+b24oYSxiKXt2YXIgdApmb3IodD0wO3Q8YS5sZW5ndGg7Kyt0KWlmKEouUk0oYVt0XSxiKSlyZXR1cm4h
+MApyZXR1cm4hMX0sCmdsMDpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGg9PT0wfSwKZ29yOmZ1bmN0
+aW9uKGEpe3JldHVybiBhLmxlbmd0aCE9PTB9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLldFKGEsIlsi
+LCJdIil9LApna3o6ZnVuY3Rpb24oYSl7cmV0dXJuIG5ldyBKLm0xKGEsYS5sZW5ndGgsSC50NihhKS5D
+KCJtMTwxPiIpKX0sCmdpTzpmdW5jdGlvbihhKXtyZXR1cm4gSC5lUShhKX0sCmdBOmZ1bmN0aW9uKGEp
+e3JldHVybiBhLmxlbmd0aH0sCnNBOmZ1bmN0aW9uKGEsYil7aWYoISFhLmZpeGVkJGxlbmd0aClILnZo
+KFAuTDQoInNldCBsZW5ndGgiKSkKaWYoYjwwKXRocm93IEguYihQLlRFKGIsMCxudWxsLCJuZXdMZW5n
+dGgiLG51bGwpKQphLmxlbmd0aD1ifSwKcTpmdW5jdGlvbihhLGIpe0guU2MoYikKaWYoYj49YS5sZW5n
+dGh8fGI8MCl0aHJvdyBILmIoSC5IWShhLGIpKQpyZXR1cm4gYVtiXX0sClk6ZnVuY3Rpb24oYSxiLGMp
+e0gudDYoYSkuZC5iKGMpCmlmKCEhYS5pbW11dGFibGUkbGlzdClILnZoKFAuTDQoImluZGV4ZWQgc2V0
+IikpCmlmKGI+PWEubGVuZ3RofHxiPDApdGhyb3cgSC5iKEguSFkoYSxiKSkKYVtiXT1jfSwKJGliUTox
+LAokaWNYOjEsCiRpek06MX0KSi5Qby5wcm90b3R5cGU9e30KSi5tMS5wcm90b3R5cGU9ewpnbDpmdW5j
+dGlvbigpe3JldHVybiB0aGlzLmR9LApGOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLHI9cy5hLHE9ci5s
+ZW5ndGgKaWYocy5iIT09cSl0aHJvdyBILmIoSC5sayhyKSkKdD1zLmMKaWYodD49cSl7cy5zTShudWxs
+KQpyZXR1cm4hMX1zLnNNKHJbdF0pOysrcy5jCnJldHVybiEwfSwKc006ZnVuY3Rpb24oYSl7dGhpcy5k
+PXRoaXMuJHRpLmQuYihhKX0sCiRpQW46MX0KSi5xSS5wcm90b3R5cGU9ewp5dTpmdW5jdGlvbihhKXt2
+YXIgdAppZihhPj0tMjE0NzQ4MzY0OCYmYTw9MjE0NzQ4MzY0NylyZXR1cm4gYXwwCmlmKGlzRmluaXRl
+KGEpKXt0PWE8MD9NYXRoLmNlaWwoYSk6TWF0aC5mbG9vcihhKQpyZXR1cm4gdCswfXRocm93IEguYihQ
+Lkw0KCIiK2ErIi50b0ludCgpIikpfSwKelE6ZnVuY3Rpb24oYSl7aWYoYT4wKXtpZihhIT09MS8wKXJl
+dHVybiBNYXRoLnJvdW5kKGEpfWVsc2UgaWYoYT4tMS8wKXJldHVybiAwLU1hdGgucm91bmQoMC1hKQp0
+aHJvdyBILmIoUC5MNCgiIithKyIucm91bmQoKSIpKX0sCldaOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxy
+LHEKaWYoYjwyfHxiPjM2KXRocm93IEguYihQLlRFKGIsMiwzNiwicmFkaXgiLG51bGwpKQp0PWEudG9T
+dHJpbmcoYikKaWYoQy54Qi5tKHQsdC5sZW5ndGgtMSkhPT00MSlyZXR1cm4gdApzPS9eKFtcZGEtel0r
+KSg/OlwuKFtcZGEtel0rKSk/XChlXCsoXGQrKVwpJC8uZXhlYyh0KQppZihzPT1udWxsKUgudmgoUC5M
+NCgiVW5leHBlY3RlZCB0b1N0cmluZyByZXN1bHQ6ICIrdCkpCnI9cy5sZW5ndGgKaWYoMT49cilyZXR1
+cm4gSC5PSChzLDEpCnQ9c1sxXQppZigzPj1yKXJldHVybiBILk9IKHMsMykKcT0rc1szXQpyPXNbMl0K
+aWYociE9bnVsbCl7dCs9cgpxLT1yLmxlbmd0aH1yZXR1cm4gdCtDLnhCLkl4KCIwIixxKX0sCnc6ZnVu
+Y3Rpb24oYSl7aWYoYT09PTAmJjEvYTwwKXJldHVybiItMC4wIgplbHNlIHJldHVybiIiK2F9LApnaU86
+ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscD1hfDAKaWYoYT09PXApcmV0dXJuIDUzNjg3MDkxMSZwCnQ9
+TWF0aC5hYnMoYSkKcz1NYXRoLmxvZyh0KS8wLjY5MzE0NzE4MDU1OTk0NTN8MApyPU1hdGgucG93KDIs
+cykKcT10PDE/dC9yOnIvdApyZXR1cm4gNTM2ODcwOTExJigocSo5MDA3MTk5MjU0NzQwOTkyfDApKyhx
+KjM1NDIyNDMxODExNzY1MjF8MCkpKjU5OTE5NytzKjEyNTl9LAp6WTpmdW5jdGlvbihhLGIpe3ZhciB0
+PWElYgppZih0PT09MClyZXR1cm4gMAppZih0PjApcmV0dXJuIHQKaWYoYjwwKXJldHVybiB0LWIKZWxz
+ZSByZXR1cm4gdCtifSwKd0c6ZnVuY3Rpb24oYSxiKXt2YXIgdAppZihhPjApdD10aGlzLnAzKGEsYikK
+ZWxzZXt0PWI+MzE/MzE6Ygp0PWE+PnQ+Pj4wfXJldHVybiB0fSwKYmY6ZnVuY3Rpb24oYSxiKXtpZihi
+PDApdGhyb3cgSC5iKEgudEwoYikpCnJldHVybiB0aGlzLnAzKGEsYil9LApwMzpmdW5jdGlvbihhLGIp
+e3JldHVybiBiPjMxPzA6YT4+PmJ9LAokaUNQOjEsCiRpRks6MX0KSi5iVS5wcm90b3R5cGU9eyRpS046
+MX0KSi5WQS5wcm90b3R5cGU9e30KSi5Eci5wcm90b3R5cGU9ewptOmZ1bmN0aW9uKGEsYil7aWYoYjww
+KXRocm93IEguYihILkhZKGEsYikpCmlmKGI+PWEubGVuZ3RoKUgudmgoSC5IWShhLGIpKQpyZXR1cm4g
+YS5jaGFyQ29kZUF0KGIpfSwKVzpmdW5jdGlvbihhLGIpe2lmKGI+PWEubGVuZ3RoKXRocm93IEguYihI
+LkhZKGEsYikpCnJldHVybiBhLmNoYXJDb2RlQXQoYil9LApkZDpmdW5jdGlvbihhLGIpe3JldHVybiBu
+ZXcgSC51bihiLGEsMCl9LApoOmZ1bmN0aW9uKGEsYil7aWYodHlwZW9mIGIhPSJzdHJpbmciKXRocm93
+IEguYihQLkwzKGIsbnVsbCxudWxsKSkKcmV0dXJuIGErYn0sClRjOmZ1bmN0aW9uKGEsYil7dmFyIHQ9
+Yi5sZW5ndGgscz1hLmxlbmd0aAppZih0PnMpcmV0dXJuITEKcmV0dXJuIGI9PT10aGlzLkcoYSxzLXQp
+fSwKaTc6ZnVuY3Rpb24oYSxiLGMsZCl7dmFyIHQscwpjPVAuakIoYixjLGEubGVuZ3RoKQp0PWEuc3Vi
+c3RyaW5nKDAsYikKcz1hLnN1YnN0cmluZyhjKQpyZXR1cm4gdCtkK3N9LApRaTpmdW5jdGlvbihhLGIs
+Yyl7dmFyIHQKaWYoIUgub2soYykpSC52aChILnRMKGMpKQppZih0eXBlb2YgYyE9PSJudW1iZXIiKXJl
+dHVybiBjLkooKQppZihjPDB8fGM+YS5sZW5ndGgpdGhyb3cgSC5iKFAuVEUoYywwLGEubGVuZ3RoLG51
+bGwsbnVsbCkpCnQ9YytiLmxlbmd0aAppZih0PmEubGVuZ3RoKXJldHVybiExCnJldHVybiBiPT09YS5z
+dWJzdHJpbmcoYyx0KX0sCm46ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhpcy5RaShhLGIsMCl9LApOajpm
+dW5jdGlvbihhLGIsYyl7aWYoIUgub2soYikpSC52aChILnRMKGIpKQppZihjPT1udWxsKWM9YS5sZW5n
+dGgKaWYodHlwZW9mIGIhPT0ibnVtYmVyIilyZXR1cm4gYi5KKCkKaWYoYjwwKXRocm93IEguYihQLngo
+YixudWxsKSkKaWYoYj5jKXRocm93IEguYihQLngoYixudWxsKSkKaWYoYz5hLmxlbmd0aCl0aHJvdyBI
+LmIoUC54KGMsbnVsbCkpCnJldHVybiBhLnN1YnN0cmluZyhiLGMpfSwKRzpmdW5jdGlvbihhLGIpe3Jl
+dHVybiB0aGlzLk5qKGEsYixudWxsKX0sCmhjOmZ1bmN0aW9uKGEpe3JldHVybiBhLnRvTG93ZXJDYXNl
+KCl9LApiUzpmdW5jdGlvbihhKXt2YXIgdCxzLHIscT1hLnRyaW0oKSxwPXEubGVuZ3RoCmlmKHA9PT0w
+KXJldHVybiBxCmlmKHRoaXMuVyhxLDApPT09MTMzKXt0PUoubW0ocSwxKQppZih0PT09cClyZXR1cm4i
+In1lbHNlIHQ9MApzPXAtMQpyPXRoaXMubShxLHMpPT09MTMzP0ouYzEocSxzKTpwCmlmKHQ9PT0wJiZy
+PT09cClyZXR1cm4gcQpyZXR1cm4gcS5zdWJzdHJpbmcodCxyKX0sCkl4OmZ1bmN0aW9uKGEsYil7dmFy
+IHQscwppZigwPj1iKXJldHVybiIiCmlmKGI9PT0xfHxhLmxlbmd0aD09PTApcmV0dXJuIGEKaWYoYiE9
+PWI+Pj4wKXRocm93IEguYihDLkVxKQpmb3IodD1hLHM9IiI7ITA7KXtpZigoYiYxKT09PTEpcz10K3MK
+Yj1iPj4+MQppZihiPT09MClicmVhawp0Kz10fXJldHVybiBzfSwKWFU6ZnVuY3Rpb24oYSxiLGMpe3Zh
+ciB0CmlmKGM8MHx8Yz5hLmxlbmd0aCl0aHJvdyBILmIoUC5URShjLDAsYS5sZW5ndGgsbnVsbCxudWxs
+KSkKdD1hLmluZGV4T2YoYixjKQpyZXR1cm4gdH0sCk9ZOmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMu
+WFUoYSxiLDApfSwKUGs6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMKaWYoYz09bnVsbCljPWEubGVuZ3Ro
+CmVsc2UgaWYoYzwwfHxjPmEubGVuZ3RoKXRocm93IEguYihQLlRFKGMsMCxhLmxlbmd0aCxudWxsLG51
+bGwpKQp0PWIubGVuZ3RoCnM9YS5sZW5ndGgKaWYoYyt0PnMpYz1zLXQKcmV0dXJuIGEubGFzdEluZGV4
+T2YoYixjKX0sCmNuOmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuUGsoYSxiLG51bGwpfSwKSXM6ZnVu
+Y3Rpb24oYSxiLGMpe3ZhciB0PWEubGVuZ3RoCmlmKGM+dCl0aHJvdyBILmIoUC5URShjLDAsdCxudWxs
+LG51bGwpKQpyZXR1cm4gSC5tMihhLGIsYyl9LAp0ZzpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLklz
+KGEsYiwwKX0sCnc6ZnVuY3Rpb24oYSl7cmV0dXJuIGF9LApnaU86ZnVuY3Rpb24oYSl7dmFyIHQscyxy
+CmZvcih0PWEubGVuZ3RoLHM9MCxyPTA7cjx0Oysrcil7cz01MzY4NzA5MTEmcythLmNoYXJDb2RlQXQo
+cikKcz01MzY4NzA5MTEmcysoKDUyNDI4NyZzKTw8MTApCnNePXM+PjZ9cz01MzY4NzA5MTEmcysoKDY3
+MTA4ODYzJnMpPDwzKQpzXj1zPj4xMQpyZXR1cm4gNTM2ODcwOTExJnMrKCgxNjM4MyZzKTw8MTUpfSwK
+Z0E6ZnVuY3Rpb24oYSl7cmV0dXJuIGEubGVuZ3RofSwKcTpmdW5jdGlvbihhLGIpe0guU2MoYikKaWYo
+Yj49YS5sZW5ndGh8fCExKXRocm93IEguYihILkhZKGEsYikpCnJldHVybiBhW2JdfSwKJGl2WDoxLAok
+aXFVOjF9CkgucWoucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS5sZW5ndGh9
+LApxOmZ1bmN0aW9uKGEsYil7cmV0dXJuIEMueEIubSh0aGlzLmEsSC5TYyhiKSl9fQpILmJRLnByb3Rv
+dHlwZT17fQpILmFMLnByb3RvdHlwZT17CmdrejpmdW5jdGlvbihhKXt2YXIgdD10aGlzCnJldHVybiBu
+ZXcgSC5hNyh0LHQuZ0EodCksSC5MaCh0KS5DKCJhNzxhTC5FPiIpKX0sCmdsMDpmdW5jdGlvbihhKXty
+ZXR1cm4gdGhpcy5nQSh0aGlzKT09PTB9LApIOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHE9dGhpcyxw
+PXEuZ0EocSkKaWYoYi5sZW5ndGghPT0wKXtpZihwPT09MClyZXR1cm4iIgp0PUguZChxLkUoMCwwKSkK
+aWYocCE9PXEuZ0EocSkpdGhyb3cgSC5iKFAuYTQocSkpCmZvcihzPXQscj0xO3I8cDsrK3Ipe3M9cyti
+K0guZChxLkUoMCxyKSkKaWYocCE9PXEuZ0EocSkpdGhyb3cgSC5iKFAuYTQocSkpfXJldHVybiBzLmNo
+YXJDb2RlQXQoMCk9PTA/czpzfWVsc2V7Zm9yKHI9MCxzPSIiO3I8cDsrK3Ipe3MrPUguZChxLkUoMCxy
+KSkKaWYocCE9PXEuZ0EocSkpdGhyb3cgSC5iKFAuYTQocSkpfXJldHVybiBzLmNoYXJDb2RlQXQoMCk9
+PTA/czpzfX0sCmV2OmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuR0coMCxILkxoKHRoaXMpLkMoImEy
+KGFMLkUpIikuYihiKSl9LApFMjpmdW5jdGlvbihhLGIsYyl7dmFyIHQ9SC5MaCh0aGlzKQpyZXR1cm4g
+bmV3IEguQTgodGhpcyx0LktxKGMpLkMoIjEoYUwuRSkiKS5iKGIpLHQuQygiQDxhTC5FPiIpLktxKGMp
+LkMoIkE4PDEsMj4iKSl9LAp0dDpmdW5jdGlvbihhLGIpe3ZhciB0LHM9dGhpcyxyPUguVk0oW10sSC5M
+aChzKS5DKCJqZDxhTC5FPiIpKQpDLk5tLnNBKHIscy5nQShzKSkKZm9yKHQ9MDt0PHMuZ0Eocyk7Kyt0
+KUMuTm0uWShyLHQscy5FKDAsdCkpCnJldHVybiByfSwKYnI6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMu
+dHQoYSwhMCl9fQpILm5ILnByb3RvdHlwZT17CmdVRDpmdW5jdGlvbigpe3ZhciB0PUouSG0odGhpcy5h
+KSxzPXRoaXMuYwppZihzPT1udWxsfHxzPnQpcmV0dXJuIHQKcmV0dXJuIHN9LApnQXM6ZnVuY3Rpb24o
+KXt2YXIgdD1KLkhtKHRoaXMuYSkscz10aGlzLmIKaWYocz50KXJldHVybiB0CnJldHVybiBzfSwKZ0E6
+ZnVuY3Rpb24oYSl7dmFyIHQscz1KLkhtKHRoaXMuYSkscj10aGlzLmIKaWYocj49cylyZXR1cm4gMAp0
+PXRoaXMuYwppZih0PT1udWxsfHx0Pj1zKXJldHVybiBzLXIKaWYodHlwZW9mIHQhPT0ibnVtYmVyIily
+ZXR1cm4gdC5ITigpCnJldHVybiB0LXJ9LApFOmZ1bmN0aW9uKGEsYil7dmFyIHQscz10aGlzLHI9cy5n
+QXMoKStiCmlmKGI+PTApe3Q9cy5nVUQoKQppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJldHVybiBILnBZ
+KHQpCnQ9cj49dH1lbHNlIHQ9ITAKaWYodCl0aHJvdyBILmIoUC5DZihiLHMsImluZGV4IixudWxsLG51
+bGwpKQpyZXR1cm4gSi5HQShzLmEscil9fQpILmE3LnByb3RvdHlwZT17CmdsOmZ1bmN0aW9uKCl7cmV0
+dXJuIHRoaXMuZH0sCkY6ZnVuY3Rpb24oKXt2YXIgdCxzPXRoaXMscj1zLmEscT1KLlU2KHIpLHA9cS5n
+QShyKQppZihzLmIhPT1wKXRocm93IEguYihQLmE0KHIpKQp0PXMuYwppZih0Pj1wKXtzLnNJKG51bGwp
+CnJldHVybiExfXMuc0kocS5FKHIsdCkpOysrcy5jCnJldHVybiEwfSwKc0k6ZnVuY3Rpb24oYSl7dGhp
+cy5kPXRoaXMuJHRpLmQuYihhKX0sCiRpQW46MX0KSC5pMS5wcm90b3R5cGU9ewpna3o6ZnVuY3Rpb24o
+YSl7dmFyIHQ9SC5MaCh0aGlzKQpyZXR1cm4gbmV3IEguTUgoSi5JVCh0aGlzLmEpLHRoaXMuYix0LkMo
+IkA8MT4iKS5LcSh0LmNoWzFdKS5DKCJNSDwxLDI+IikpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIEou
+SG0odGhpcy5hKX19CkgueHkucHJvdG90eXBlPXskaWJROjF9CkguTUgucHJvdG90eXBlPXsKRjpmdW5j
+dGlvbigpe3ZhciB0PXRoaXMscz10LmIKaWYocy5GKCkpe3Quc0kodC5jLiQxKHMuZ2woKSkpCnJldHVy
+biEwfXQuc0kobnVsbCkKcmV0dXJuITF9LApnbDpmdW5jdGlvbigpe3JldHVybiB0aGlzLmF9LApzSTpm
+dW5jdGlvbihhKXt0aGlzLmE9dGhpcy4kdGkuY2hbMV0uYihhKX19CkguQTgucHJvdG90eXBlPXsKZ0E6
+ZnVuY3Rpb24oYSl7cmV0dXJuIEouSG0odGhpcy5hKX0sCkU6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhp
+cy5iLiQxKEouR0EodGhpcy5hLGIpKX19CkguVTUucHJvdG90eXBlPXsKZ2t6OmZ1bmN0aW9uKGEpe3Jl
+dHVybiBuZXcgSC5TTyhKLklUKHRoaXMuYSksdGhpcy5iLHRoaXMuJHRpLkMoIlNPPDE+IikpfX0KSC5T
+Ty5wcm90b3R5cGU9ewpGOmZ1bmN0aW9uKCl7dmFyIHQscwpmb3IodD10aGlzLmEscz10aGlzLmI7dC5G
+KCk7KWlmKEgub1Qocy4kMSh0LmdsKCkpKSlyZXR1cm4hMApyZXR1cm4hMX0sCmdsOmZ1bmN0aW9uKCl7
+cmV0dXJuIHRoaXMuYS5nbCgpfX0KSC5TVS5wcm90b3R5cGU9e30KSC5SZS5wcm90b3R5cGU9ewpZOmZ1
+bmN0aW9uKGEsYixjKXtILkxoKHRoaXMpLkMoIlJlLkUiKS5iKGMpCnRocm93IEguYihQLkw0KCJDYW5u
+b3QgbW9kaWZ5IGFuIHVubW9kaWZpYWJsZSBsaXN0IikpfX0KSC5YQy5wcm90b3R5cGU9e30KSC53di5w
+cm90b3R5cGU9ewpnaU86ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5faGFzaENvZGUKaWYodCE9bnVsbCly
+ZXR1cm4gdAp0PTUzNjg3MDkxMSY2NjQ1OTcqSi5oZih0aGlzLmEpCnRoaXMuX2hhc2hDb2RlPXQKcmV0
+dXJuIHR9LAp3OmZ1bmN0aW9uKGEpe3JldHVybidTeW1ib2woIicrSC5kKHRoaXMuYSkrJyIpJ30sCkRO
+OmZ1bmN0aW9uKGEsYil7aWYoYj09bnVsbClyZXR1cm4hMQpyZXR1cm4gYiBpbnN0YW5jZW9mIEgud3Ym
+JnRoaXMuYT09Yi5hfSwKJGlHRDoxfQpILlBELnByb3RvdHlwZT17fQpILldVLnByb3RvdHlwZT17Cmds
+MDpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5nQSh0aGlzKT09PTB9LAp3OmZ1bmN0aW9uKGEpe3JldHVy
+biBQLm5PKHRoaXMpfSwKWTpmdW5jdGlvbihhLGIsYyl7dmFyIHQ9SC5MaCh0aGlzKQp0LmQuYihiKQp0
+LmNoWzFdLmIoYykKcmV0dXJuIEguZGMoKX0sCmdQdTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5xNChh
+LEguTGgodGhpcykuQygiTjM8MSwyPiIpKX0sCnE0OmZ1bmN0aW9uKGEsYil7dmFyIHQ9dGhpcwpyZXR1
+cm4gUC5sMChmdW5jdGlvbigpe3ZhciBzPWEKdmFyIHI9MCxxPTEscCxvLG4sbQpyZXR1cm4gZnVuY3Rp
+b24gJGFzeW5jJGdQdShjLGQpe2lmKGM9PT0xKXtwPWQKcj1xfXdoaWxlKHRydWUpc3dpdGNoKHIpe2Nh
+c2UgMDpvPXQuZ1YoKSxvPW8uZ2t6KG8pLG49SC5MaCh0KSxuPW4uQygiQDwxPiIpLktxKG4uY2hbMV0p
+LkMoIk4zPDEsMj4iKQpjYXNlIDI6aWYoIW8uRigpKXtyPTMKYnJlYWt9bT1vLmdsKCkKcj00CnJldHVy
+biBuZXcgUC5OMyhtLHQucSgwLG0pLG4pCmNhc2UgNDpyPTIKYnJlYWsKY2FzZSAzOnJldHVybiBQLlRo
+KCkKY2FzZSAxOnJldHVybiBQLlltKHApfX19LGIpfSwKJGlaMDoxfQpILkxQLnByb3RvdHlwZT17CmdB
+OmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmF9LAp4NDpmdW5jdGlvbihhKXtpZih0eXBlb2YgYSE9InN0
+cmluZyIpcmV0dXJuITEKaWYoIl9fcHJvdG9fXyI9PT1hKXJldHVybiExCnJldHVybiB0aGlzLmIuaGFz
+T3duUHJvcGVydHkoYSl9LApxOmZ1bmN0aW9uKGEsYil7aWYoIXRoaXMueDQoYikpcmV0dXJuIG51bGwK
+cmV0dXJuIHRoaXMuRChiKX0sCkQ6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYltILnkoYSldfSwKSzpm
+dW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHA9SC5MaCh0aGlzKQpwLkMoIn4oMSwyKSIpLmIoYikKdD10
+aGlzLmMKZm9yKHM9dC5sZW5ndGgscD1wLmNoWzFdLHI9MDtyPHM7KytyKXtxPXRbcl0KYi4kMihxLHAu
+Yih0aGlzLkQocSkpKX19LApnVjpmdW5jdGlvbigpe3JldHVybiBuZXcgSC5YUih0aGlzLEguTGgodGhp
+cykuQygiWFI8MT4iKSl9fQpILlhSLnByb3RvdHlwZT17CmdrejpmdW5jdGlvbihhKXt2YXIgdD10aGlz
+LmEuYwpyZXR1cm4gbmV3IEoubTEodCx0Lmxlbmd0aCxILnQ2KHQpLkMoIm0xPDE+IikpfSwKZ0E6ZnVu
+Y3Rpb24oYSl7cmV0dXJuIHRoaXMuYS5jLmxlbmd0aH19CkguTEkucHJvdG90eXBlPXsKZ1dhOmZ1bmN0
+aW9uKCl7dmFyIHQ9dGhpcy5hCnJldHVybiB0fSwKZ25kOmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscD10
+aGlzCmlmKHAuYz09PTEpcmV0dXJuIEMuaFUKdD1wLmQKcz10Lmxlbmd0aC1wLmUubGVuZ3RoLXAuZgpp
+ZihzPT09MClyZXR1cm4gQy5oVQpyPVtdCmZvcihxPTA7cTxzOysrcSl7aWYocT49dC5sZW5ndGgpcmV0
+dXJuIEguT0godCxxKQpyLnB1c2godFtxXSl9cmV0dXJuIEouekMocil9LApnVm06ZnVuY3Rpb24oKXt2
+YXIgdCxzLHIscSxwLG8sbixtLGw9dGhpcwppZihsLmMhPT0wKXJldHVybiBDLkR4CnQ9bC5lCnM9dC5s
+ZW5ndGgKcj1sLmQKcT1yLmxlbmd0aC1zLWwuZgppZihzPT09MClyZXR1cm4gQy5EeApwPW5ldyBILk41
+KHUuZW8pCmZvcihvPTA7bzxzOysrbyl7aWYobz49dC5sZW5ndGgpcmV0dXJuIEguT0godCxvKQpuPXRb
+b10KbT1xK28KaWYobTwwfHxtPj1yLmxlbmd0aClyZXR1cm4gSC5PSChyLG0pCnAuWSgwLG5ldyBILnd2
+KG4pLHJbbV0pfXJldHVybiBuZXcgSC5QRChwLHUuZ0YpfSwKJGl2UToxfQpILkNqLnByb3RvdHlwZT17
+CiQyOmZ1bmN0aW9uKGEsYil7dmFyIHQKSC55KGEpCnQ9dGhpcy5hCnQuYj10LmIrIiQiK0guZChhKQpD
+Lk5tLmkodGhpcy5iLGEpCkMuTm0uaSh0aGlzLmMsYik7Kyt0LmF9LAokUzoxMn0KSC5mOS5wcm90b3R5
+cGU9ewpxUzpmdW5jdGlvbihhKXt2YXIgdCxzLHI9dGhpcyxxPW5ldyBSZWdFeHAoci5hKS5leGVjKGEp
+CmlmKHE9PW51bGwpcmV0dXJuIG51bGwKdD1PYmplY3QuY3JlYXRlKG51bGwpCnM9ci5iCmlmKHMhPT0t
+MSl0LmFyZ3VtZW50cz1xW3MrMV0Kcz1yLmMKaWYocyE9PS0xKXQuYXJndW1lbnRzRXhwcj1xW3MrMV0K
+cz1yLmQKaWYocyE9PS0xKXQuZXhwcj1xW3MrMV0Kcz1yLmUKaWYocyE9PS0xKXQubWV0aG9kPXFbcysx
+XQpzPXIuZgppZihzIT09LTEpdC5yZWNlaXZlcj1xW3MrMV0KcmV0dXJuIHR9fQpILlcwLnByb3RvdHlw
+ZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5iCmlmKHQ9PW51bGwpcmV0dXJuIk5vU3VjaE1ldGhv
+ZEVycm9yOiAiK0guZCh0aGlzLmEpCnJldHVybiJOb1N1Y2hNZXRob2RFcnJvcjogbWV0aG9kIG5vdCBm
+b3VuZDogJyIrdCsiJyBvbiBudWxsIn19CkguYXoucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIg
+dCxzPXRoaXMscj0iTm9TdWNoTWV0aG9kRXJyb3I6IG1ldGhvZCBub3QgZm91bmQ6ICciLHE9cy5iCmlm
+KHE9PW51bGwpcmV0dXJuIk5vU3VjaE1ldGhvZEVycm9yOiAiK0guZChzLmEpCnQ9cy5jCmlmKHQ9PW51
+bGwpcmV0dXJuIHIrcSsiJyAoIitILmQocy5hKSsiKSIKcmV0dXJuIHIrcSsiJyBvbiAnIit0KyInICgi
+K0guZChzLmEpKyIpIn19CkgudlYucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEK
+cmV0dXJuIHQubGVuZ3RoPT09MD8iRXJyb3IiOiJFcnJvcjogIit0fX0KSC5icS5wcm90b3R5cGU9e30K
+SC5BbS5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtpZih1LmJVLmMoYSkpaWYoYS4kdGhyb3duSnNF
+cnJvcj09bnVsbClhLiR0aHJvd25Kc0Vycm9yPXRoaXMuYQpyZXR1cm4gYX0sCiRTOjF9CkguWE8ucHJv
+dG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMuYgppZihzIT1udWxsKXJldHVybiBzCnM9
+dGhpcy5hCnQ9cyE9PW51bGwmJnR5cGVvZiBzPT09Im9iamVjdCI/cy5zdGFjazpudWxsCnJldHVybiB0
+aGlzLmI9dD09bnVsbD8iIjp0fSwKJGlHejoxfQpILlRwLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7
+dmFyIHQ9dGhpcy5jb25zdHJ1Y3RvcixzPXQ9PW51bGw/bnVsbDp0Lm5hbWUKcmV0dXJuIkNsb3N1cmUg
+JyIrSC5OUShzPT1udWxsPyJ1bmtub3duIjpzKSsiJyJ9LAokaUVIOjEsCmdRbDpmdW5jdGlvbigpe3Jl
+dHVybiB0aGlzfSwKJEM6IiQxIiwKJFI6MSwKJEQ6bnVsbH0KSC5sYy5wcm90b3R5cGU9e30KSC56eC5w
+cm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuJHN0YXRpY19uYW1lCmlmKHQ9PW51bGwp
+cmV0dXJuIkNsb3N1cmUgb2YgdW5rbm93biBzdGF0aWMgbWV0aG9kIgpyZXR1cm4iQ2xvc3VyZSAnIitI
+Lk5RKHQpKyInIn19CkguclQucHJvdG90eXBlPXsKRE46ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzCmlm
+KGI9PW51bGwpcmV0dXJuITEKaWYodD09PWIpcmV0dXJuITAKaWYoIShiIGluc3RhbmNlb2YgSC5yVCkp
+cmV0dXJuITEKcmV0dXJuIHQuYT09PWIuYSYmdC5iPT09Yi5iJiZ0LmM9PT1iLmN9LApnaU86ZnVuY3Rp
+b24oYSl7dmFyIHQscz10aGlzLmMKaWYocz09bnVsbCl0PUguZVEodGhpcy5hKQplbHNlIHQ9dHlwZW9m
+IHMhPT0ib2JqZWN0Ij9KLmhmKHMpOkguZVEocykKcmV0dXJuKHReSC5lUSh0aGlzLmIpKT4+PjB9LAp3
+OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYwppZih0PT1udWxsKXQ9dGhpcy5hCnJldHVybiJDbG9zdXJl
+ICciK0guZCh0aGlzLmQpKyInIG9mICIrKCJJbnN0YW5jZSBvZiAnIitILmQoSC5NKHQpKSsiJyIpfX0K
+SC5FcS5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiJSdW50aW1lRXJyb3I6ICIrSC5kKHRo
+aXMuYSl9fQpILmtZLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIkFzc2VydGlvbiBmYWls
+ZWQ6ICIrUC5wKHRoaXMuYSl9fQpILk41LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0
+aGlzLmF9LApnbDA6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYT09PTB9LApnVjpmdW5jdGlvbigpe3Jl
+dHVybiBuZXcgSC5pNSh0aGlzLEguTGgodGhpcykuQygiaTU8MT4iKSl9LAp4NDpmdW5jdGlvbihhKXt2
+YXIgdCxzCmlmKHR5cGVvZiBhPT0ic3RyaW5nIil7dD10aGlzLmIKaWYodD09bnVsbClyZXR1cm4hMQpy
+ZXR1cm4gdGhpcy5YdSh0LGEpfWVsc2V7cz10aGlzLkNYKGEpCnJldHVybiBzfX0sCkNYOmZ1bmN0aW9u
+KGEpe3ZhciB0PXRoaXMuZAppZih0PT1udWxsKXJldHVybiExCnJldHVybiB0aGlzLkZoKHRoaXMuQnQo
+dCxKLmhmKGEpJjB4M2ZmZmZmZiksYSk+PTB9LApxOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEscD10
+aGlzLG89bnVsbAppZih0eXBlb2YgYj09InN0cmluZyIpe3Q9cC5iCmlmKHQ9PW51bGwpcmV0dXJuIG8K
+cz1wLmoyKHQsYikKcj1zPT1udWxsP286cy5iCnJldHVybiByfWVsc2UgaWYodHlwZW9mIGI9PSJudW1i
+ZXIiJiYoYiYweDNmZmZmZmYpPT09Yil7cT1wLmMKaWYocT09bnVsbClyZXR1cm4gbwpzPXAuajIocSxi
+KQpyPXM9PW51bGw/bzpzLmIKcmV0dXJuIHJ9ZWxzZSByZXR1cm4gcC5hYShiKX0sCmFhOmZ1bmN0aW9u
+KGEpe3ZhciB0LHMscj10aGlzLmQKaWYocj09bnVsbClyZXR1cm4gbnVsbAp0PXRoaXMuQnQocixKLmhm
+KGEpJjB4M2ZmZmZmZikKcz10aGlzLkZoKHQsYSkKaWYoczwwKXJldHVybiBudWxsCnJldHVybiB0W3Nd
+LmJ9LApZOmZ1bmN0aW9uKGEsYixjKXt2YXIgdCxzLHIscSxwLG8sbj10aGlzLG09SC5MaChuKQptLmQu
+YihiKQptLmNoWzFdLmIoYykKaWYodHlwZW9mIGI9PSJzdHJpbmciKXt0PW4uYgpuLkVIKHQ9PW51bGw/
+bi5iPW4ueksoKTp0LGIsYyl9ZWxzZSBpZih0eXBlb2YgYj09Im51bWJlciImJihiJjB4M2ZmZmZmZik9
+PT1iKXtzPW4uYwpuLkVIKHM9PW51bGw/bi5jPW4ueksoKTpzLGIsYyl9ZWxzZXtyPW4uZAppZihyPT1u
+dWxsKXI9bi5kPW4ueksoKQpxPUouaGYoYikmMHgzZmZmZmZmCnA9bi5CdChyLHEpCmlmKHA9PW51bGwp
+bi5FSShyLHEsW24uSG4oYixjKV0pCmVsc2V7bz1uLkZoKHAsYikKaWYobz49MClwW29dLmI9YwplbHNl
+IHAucHVzaChuLkhuKGIsYykpfX19LApLOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyPXRoaXMKSC5MaChy
+KS5DKCJ+KDEsMikiKS5iKGIpCnQ9ci5lCnM9ci5yCmZvcig7dCE9bnVsbDspe2IuJDIodC5hLHQuYikK
+aWYocyE9PXIucil0aHJvdyBILmIoUC5hNChyKSkKdD10LmN9fSwKRUg6ZnVuY3Rpb24oYSxiLGMpe3Zh
+ciB0LHM9dGhpcyxyPUguTGgocykKci5kLmIoYikKci5jaFsxXS5iKGMpCnQ9cy5qMihhLGIpCmlmKHQ9
+PW51bGwpcy5FSShhLGIscy5IbihiLGMpKQplbHNlIHQuYj1jfSwKa3M6ZnVuY3Rpb24oKXt0aGlzLnI9
+dGhpcy5yKzEmNjcxMDg4NjN9LApIbjpmdW5jdGlvbihhLGIpe3ZhciB0LHM9dGhpcyxyPUguTGgocyks
+cT1uZXcgSC5kYihyLmQuYihhKSxyLmNoWzFdLmIoYikpCmlmKHMuZT09bnVsbClzLmU9cy5mPXEKZWxz
+ZXt0PXMuZgpxLmQ9dApzLmY9dC5jPXF9KytzLmEKcy5rcygpCnJldHVybiBxfSwKRmg6ZnVuY3Rpb24o
+YSxiKXt2YXIgdCxzCmlmKGE9PW51bGwpcmV0dXJuLTEKdD1hLmxlbmd0aApmb3Iocz0wO3M8dDsrK3Mp
+aWYoSi5STShhW3NdLmEsYikpcmV0dXJuIHMKcmV0dXJuLTF9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQ
+Lm5PKHRoaXMpfSwKajI6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gYVtiXX0sCkJ0OmZ1bmN0aW9uKGEsYil7
+cmV0dXJuIGFbYl19LApFSTpmdW5jdGlvbihhLGIsYyl7YVtiXT1jfSwKcm46ZnVuY3Rpb24oYSxiKXtk
+ZWxldGUgYVtiXX0sClh1OmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuajIoYSxiKSE9bnVsbH0sCnpL
+OmZ1bmN0aW9uKCl7dmFyIHQ9Ijxub24taWRlbnRpZmllci1rZXk+IixzPU9iamVjdC5jcmVhdGUobnVs
+bCkKdGhpcy5FSShzLHQscykKdGhpcy5ybihzLHQpCnJldHVybiBzfSwKJGlGbzoxfQpILmRiLnByb3Rv
+dHlwZT17fQpILmk1LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEuYX0sCmds
+MDpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hLmE9PT0wfSwKZ2t6OmZ1bmN0aW9uKGEpe3ZhciB0PXRo
+aXMuYSxzPW5ldyBILk42KHQsdC5yLHRoaXMuJHRpLkMoIk42PDE+IikpCnMuYz10LmUKcmV0dXJuIHN9
+LAp0ZzpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLmEueDQoYil9fQpILk42LnByb3RvdHlwZT17Cmds
+OmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuZH0sCkY6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLHM9dC5hCmlm
+KHQuYiE9PXMucil0aHJvdyBILmIoUC5hNChzKSkKZWxzZXtzPXQuYwppZihzPT1udWxsKXt0LnNxWShu
+dWxsKQpyZXR1cm4hMX1lbHNle3Quc3FZKHMuYSkKdC5jPXQuYy5jCnJldHVybiEwfX19LApzcVk6ZnVu
+Y3Rpb24oYSl7dGhpcy5kPXRoaXMuJHRpLmQuYihhKX0sCiRpQW46MX0KSC5kQy5wcm90b3R5cGU9ewok
+MTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hKGEpfSwKJFM6MX0KSC53Ti5wcm90b3R5cGU9ewokMjpm
+dW5jdGlvbihhLGIpe3JldHVybiB0aGlzLmEoYSxiKX0sCiRTOjQ0fQpILlZYLnByb3RvdHlwZT17CiQx
+OmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEoSC55KGEpKX0sCiRTOjQwfQpILlZSLnByb3RvdHlwZT17
+Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIlJlZ0V4cC8iK3RoaXMuYSsiLyIrdGhpcy5iLmZsYWdzfSwKZ0hj
+OmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcyxzPXQuYwppZihzIT1udWxsKXJldHVybiBzCnM9dC5iCnJldHVy
+biB0LmM9SC52NCh0LmEscy5tdWx0aWxpbmUsIXMuaWdub3JlQ2FzZSxzLnVuaWNvZGUscy5kb3RBbGws
+ITApfSwKZGQ6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gbmV3IEguS1codGhpcyxiLDApfSwKVVo6ZnVuY3Rp
+b24oYSxiKXt2YXIgdCxzPXRoaXMuZ0hjKCkKcy5sYXN0SW5kZXg9Ygp0PXMuZXhlYyhhKQppZih0PT1u
+dWxsKXJldHVybiBudWxsCnJldHVybiBuZXcgSC5FSyh0KX0sCiRpdlg6MSwKJGl3TDoxfQpILkVLLnBy
+b3RvdHlwZT17CnE6ZnVuY3Rpb24oYSxiKXt2YXIgdApILlNjKGIpCnQ9dGhpcy5iCmlmKGI+PXQubGVu
+Z3RoKXJldHVybiBILk9IKHQsYikKcmV0dXJuIHRbYl19LAokaU9kOjEsCiRpaWI6MX0KSC5LVy5wcm90
+b3R5cGU9ewpna3o6ZnVuY3Rpb24oYSl7cmV0dXJuIG5ldyBILlBiKHRoaXMuYSx0aGlzLmIsdGhpcy5j
+KX19CkguUGIucHJvdG90eXBlPXsKZ2w6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5kfSwKRjpmdW5jdGlv
+bigpe3ZhciB0LHMscixxLHA9dGhpcyxvPXAuYgppZihvPT1udWxsKXJldHVybiExCnQ9cC5jCmlmKHQ8
+PW8ubGVuZ3RoKXtzPXAuYQpyPXMuVVoobyx0KQppZihyIT1udWxsKXtwLmQ9cgpvPXIuYgp0PW8uaW5k
+ZXgKcT10K29bMF0ubGVuZ3RoCmlmKHQ9PT1xKXtpZihzLmIudW5pY29kZSl7bz1wLmMKdD1vKzEKcz1w
+LmIKaWYodDxzLmxlbmd0aCl7bz1KLnJZKHMpLm0ocyxvKQppZihvPj01NTI5NiYmbzw9NTYzMTkpe289
+Qy54Qi5tKHMsdCkKbz1vPj01NjMyMCYmbzw9NTczNDN9ZWxzZSBvPSExfWVsc2Ugbz0hMX1lbHNlIG89
+ITEKcT0obz9xKzE6cSkrMX1wLmM9cQpyZXR1cm4hMH19cC5iPXAuZD1udWxsCnJldHVybiExfSwKJGlB
+bjoxfQpILnRRLnByb3RvdHlwZT17CnE6ZnVuY3Rpb24oYSxiKXtILlNjKGIpCmlmKGIhPT0wKUgudmgo
+UC54KGIsbnVsbCkpCnJldHVybiB0aGlzLmN9LAokaU9kOjF9CkgudW4ucHJvdG90eXBlPXsKZ2t6OmZ1
+bmN0aW9uKGEpe3JldHVybiBuZXcgSC5TZCh0aGlzLmEsdGhpcy5iLHRoaXMuYyl9fQpILlNkLnByb3Rv
+dHlwZT17CkY6ZnVuY3Rpb24oKXt2YXIgdCxzLHI9dGhpcyxxPXIuYyxwPXIuYixvPXAubGVuZ3RoLG49
+ci5hLG09bi5sZW5ndGgKaWYocStvPm0pe3IuZD1udWxsCnJldHVybiExfXQ9bi5pbmRleE9mKHAscSkK
+aWYodDwwKXtyLmM9bSsxCnIuZD1udWxsCnJldHVybiExfXM9dCtvCnIuZD1uZXcgSC50USh0LHApCnIu
+Yz1zPT09ci5jP3MrMTpzCnJldHVybiEwfSwKZ2w6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5kfSwKJGlB
+bjoxfQpILkVULnByb3RvdHlwZT17JGlFVDoxLCRpZXE6MX0KSC5MWi5wcm90b3R5cGU9ewpnQTpmdW5j
+dGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9LAokaVhqOjF9CkguRGcucHJvdG90eXBlPXsKcTpmdW5jdGlv
+bihhLGIpe0guU2MoYikKSC5vZChiLGEsYS5sZW5ndGgpCnJldHVybiBhW2JdfSwKWTpmdW5jdGlvbihh
+LGIsYyl7SC5JZyhjKQpILm9kKGIsYSxhLmxlbmd0aCkKYVtiXT1jfSwKJGliUToxLAokaWNYOjEsCiRp
+ek06MX0KSC5QZy5wcm90b3R5cGU9ewpZOmZ1bmN0aW9uKGEsYixjKXtILlNjKGMpCkgub2QoYixhLGEu
+bGVuZ3RoKQphW2JdPWN9LAokaWJROjEsCiRpY1g6MSwKJGl6TToxfQpILnhqLnByb3RvdHlwZT17CnE6
+ZnVuY3Rpb24oYSxiKXtILlNjKGIpCkgub2QoYixhLGEubGVuZ3RoKQpyZXR1cm4gYVtiXX19CkguZEUu
+cHJvdG90eXBlPXsKcTpmdW5jdGlvbihhLGIpe0guU2MoYikKSC5vZChiLGEsYS5sZW5ndGgpCnJldHVy
+biBhW2JdfX0KSC5aQS5wcm90b3R5cGU9ewpxOmZ1bmN0aW9uKGEsYil7SC5TYyhiKQpILm9kKGIsYSxh
+Lmxlbmd0aCkKcmV0dXJuIGFbYl19fQpILndmLnByb3RvdHlwZT17CnE6ZnVuY3Rpb24oYSxiKXtILlNj
+KGIpCkgub2QoYixhLGEubGVuZ3RoKQpyZXR1cm4gYVtiXX19CkguUHEucHJvdG90eXBlPXsKcTpmdW5j
+dGlvbihhLGIpe0guU2MoYikKSC5vZChiLGEsYS5sZW5ndGgpCnJldHVybiBhW2JdfX0KSC5lRS5wcm90
+b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9LApxOmZ1bmN0aW9uKGEsYil7SC5T
+YyhiKQpILm9kKGIsYSxhLmxlbmd0aCkKcmV0dXJuIGFbYl19fQpILlY2LnByb3RvdHlwZT17CmdBOmZ1
+bmN0aW9uKGEpe3JldHVybiBhLmxlbmd0aH0sCnE6ZnVuY3Rpb24oYSxiKXtILlNjKGIpCkgub2QoYixh
+LGEubGVuZ3RoKQpyZXR1cm4gYVtiXX0sCiRpVjY6MSwKJGluNjoxfQpILlJHLnByb3RvdHlwZT17fQpI
+LlZQLnByb3RvdHlwZT17fQpILldCLnByb3RvdHlwZT17fQpILlpHLnByb3RvdHlwZT17fQpILkpjLnBy
+b3RvdHlwZT17CkM6ZnVuY3Rpb24oYSl7cmV0dXJuIEguY0Uodi50eXBlVW5pdmVyc2UsdGhpcyxhKX0s
+CktxOmZ1bmN0aW9uKGEpe3JldHVybiBILnY1KHYudHlwZVVuaXZlcnNlLHRoaXMsYSl9fQpILkcucHJv
+dG90eXBlPXt9CkgudTkucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hfX0KSC5o
+ei5wcm90b3R5cGU9e30KSC5pTS5wcm90b3R5cGU9e30KUC50aC5wcm90b3R5cGU9ewokMTpmdW5jdGlv
+bihhKXt2YXIgdD10aGlzLmEscz10LmEKdC5hPW51bGwKcy4kMCgpfSwKJFM6MTB9ClAuaGEucHJvdG90
+eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQscwp0aGlzLmEuYT11Lk0uYihhKQp0PXRoaXMuYgpzPXRo
+aXMuYwp0LmZpcnN0Q2hpbGQ/dC5yZW1vdmVDaGlsZChzKTp0LmFwcGVuZENoaWxkKHMpfSwKJFM6MjB9
+ClAuVnMucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXt0aGlzLmEuJDAoKX0sCiRDOiIkMCIsCiRSOjAs
+CiRTOjB9ClAuRnQucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXt0aGlzLmEuJDAoKX0sCiRDOiIkMCIs
+CiRSOjAsCiRTOjB9ClAuVzMucHJvdG90eXBlPXsKQ1k6ZnVuY3Rpb24oYSxiKXtpZihzZWxmLnNldFRp
+bWVvdXQhPW51bGwpc2VsZi5zZXRUaW1lb3V0KEgudFIobmV3IFAueUgodGhpcyxiKSwwKSxhKQplbHNl
+IHRocm93IEguYihQLkw0KCJgc2V0VGltZW91dCgpYCBub3QgZm91bmQuIikpfX0KUC55SC5wcm90b3R5
+cGU9ewokMDpmdW5jdGlvbigpe3RoaXMuYi4kMCgpfSwKJEM6IiQwIiwKJFI6MCwKJFM6Mn0KUC5paC5w
+cm90b3R5cGU9ewphTTpmdW5jdGlvbihhLGIpe3ZhciB0LHMscj10aGlzLiR0aQpyLkMoIjEvIikuYihi
+KQp0PSF0aGlzLmJ8fHIuQygiYjg8MT4iKS5jKGIpCnM9dGhpcy5hCmlmKHQpcy5YZihiKQplbHNlIHMu
+WDIoci5kLmIoYikpfSwKdzA6ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEKaWYodGhpcy5iKXQuWkwo
+YSxiKQplbHNlIHQuTmsoYSxiKX19ClAuV00ucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJu
+IHRoaXMuYS4kMigwLGEpfSwKJFM6NDl9ClAuU1gucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt0
+aGlzLmEuJDIoMSxuZXcgSC5icShhLHUubC5iKGIpKSl9LAokQzoiJDIiLAokUjoyLAokUzoyMX0KUC5H
+cy5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3RoaXMuYShILlNjKGEpLGIpfSwKJFM6MjZ9ClAu
+RnkucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4iSXRlcmF0aW9uTWFya2VyKCIrdGhpcy5i
+KyIsICIrSC5kKHRoaXMuYSkrIikifX0KUC5HVi5wcm90b3R5cGU9ewpnbDpmdW5jdGlvbigpe3ZhciB0
+PXRoaXMuYwppZih0PT1udWxsKXJldHVybiB0aGlzLmIKcmV0dXJuIHRoaXMuJHRpLmQuYih0LmdsKCkp
+fSwKRjpmdW5jdGlvbigpe3ZhciB0LHMscixxLHA9dGhpcwpmb3IoOyEwOyl7dD1wLmMKaWYodCE9bnVs
+bClpZih0LkYoKSlyZXR1cm4hMAplbHNlIHAuYz1udWxsCnM9ZnVuY3Rpb24oYSxiLGMpe3ZhciBvLG49
+Ygp3aGlsZSh0cnVlKXRyeXtyZXR1cm4gYShuLG8pfWNhdGNoKG0pe289bQpuPWN9fShwLmEsMCwxKQpp
+ZihzIGluc3RhbmNlb2YgUC5GeSl7cj1zLmIKaWYocj09PTIpe3Q9cC5kCmlmKHQ9PW51bGx8fHQubGVu
+Z3RoPT09MCl7cC5zRUMobnVsbCkKcmV0dXJuITF9aWYoMD49dC5sZW5ndGgpcmV0dXJuIEguT0godCwt
+MSkKcC5hPXQucG9wKCkKY29udGludWV9ZWxzZXt0PXMuYQppZihyPT09Myl0aHJvdyB0CmVsc2V7cT1K
+LklUKHQpCmlmKHEgaW5zdGFuY2VvZiBQLkdWKXt0PXAuZAppZih0PT1udWxsKXQ9cC5kPVtdCkMuTm0u
+aSh0LHAuYSkKcC5hPXEuYQpjb250aW51ZX1lbHNle3AuYz1xCmNvbnRpbnVlfX19fWVsc2V7cC5zRUMo
+cykKcmV0dXJuITB9fXJldHVybiExfSwKc0VDOmZ1bmN0aW9uKGEpe3RoaXMuYj10aGlzLiR0aS5kLmIo
+YSl9LAokaUFuOjF9ClAucTQucHJvdG90eXBlPXsKZ2t6OmZ1bmN0aW9uKGEpe3JldHVybiBuZXcgUC5H
+Vih0aGlzLmEoKSx0aGlzLiR0aS5DKCJHVjwxPiIpKX19ClAuYjgucHJvdG90eXBlPXt9ClAuUGYucHJv
+dG90eXBlPXsKdzA6ZnVuY3Rpb24oYSxiKXt2YXIgdAppZihhPT1udWxsKWE9bmV3IFAubigpCnQ9dGhp
+cy5hCmlmKHQuYSE9PTApdGhyb3cgSC5iKFAuUFYoIkZ1dHVyZSBhbHJlYWR5IGNvbXBsZXRlZCIpKQp0
+Lk5rKGEsYil9LApwbTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy53MChhLG51bGwpfX0KUC5aZi5wcm90
+b3R5cGU9ewphTTpmdW5jdGlvbihhLGIpe3ZhciB0CnRoaXMuJHRpLkMoIjEvIikuYihiKQp0PXRoaXMu
+YQppZih0LmEhPT0wKXRocm93IEguYihQLlBWKCJGdXR1cmUgYWxyZWFkeSBjb21wbGV0ZWQiKSkKdC5Y
+ZihiKX19ClAuRmUucHJvdG90eXBlPXsKSFI6ZnVuY3Rpb24oYSl7aWYoKHRoaXMuYyYxNSkhPT02KXJl
+dHVybiEwCnJldHVybiB0aGlzLmIuYi5idih1LmFsLmIodGhpcy5kKSxhLmEsdS5jSix1LkspfSwKS3c6
+ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5lLHM9dS56LHI9dS5LLHE9dGhpcy4kdGkuQygiMi8iKSxwPXRo
+aXMuYi5iCmlmKHUuRS5jKHQpKXJldHVybiBxLmIocC5ycCh0LGEuYSxhLmIscyxyLHUubCkpCmVsc2Ug
+cmV0dXJuIHEuYihwLmJ2KHUudy5iKHQpLGEuYSxzLHIpKX19ClAudnMucHJvdG90eXBlPXsKU3E6ZnVu
+Y3Rpb24oYSxiLGMpe3ZhciB0LHMscixxPXRoaXMuJHRpCnEuS3EoYykuQygiMS8oMikiKS5iKGEpCnQ9
+JC5YMwppZih0IT09Qy5OVSl7Yy5DKCJAPDAvPiIpLktxKHEuZCkuQygiMSgyKSIpLmIoYSkKaWYoYiE9
+bnVsbCliPVAuVkgoYix0KX1zPW5ldyBQLnZzKCQuWDMsYy5DKCJ2czwwPiIpKQpyPWI9PW51bGw/MToz
+CnRoaXMueGYobmV3IFAuRmUocyxyLGEsYixxLkMoIkA8MT4iKS5LcShjKS5DKCJGZTwxLDI+IikpKQpy
+ZXR1cm4gc30sClc3OmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXMuU3EoYSxudWxsLGIpfSwKUWQ6ZnVu
+Y3Rpb24oYSxiLGMpe3ZhciB0LHM9dGhpcy4kdGkKcy5LcShjKS5DKCIxLygyKSIpLmIoYSkKdD1uZXcg
+UC52cygkLlgzLGMuQygidnM8MD4iKSkKdGhpcy54ZihuZXcgUC5GZSh0LChiPT1udWxsPzE6Myl8MTYs
+YSxiLHMuQygiQDwxPiIpLktxKGMpLkMoIkZlPDEsMj4iKSkpCnJldHVybiB0fSwKeGY6ZnVuY3Rpb24o
+YSl7dmFyIHQscz10aGlzLHI9cy5hCmlmKHI8PTEpe2EuYT11LnguYihzLmMpCnMuYz1hfWVsc2V7aWYo
+cj09PTIpe3Q9dS5fLmIocy5jKQpyPXQuYQppZihyPDQpe3QueGYoYSkKcmV0dXJufXMuYT1yCnMuYz10
+LmN9UC5UayhudWxsLG51bGwscy5iLHUuTS5iKG5ldyBQLmRhKHMsYSkpKX19LApqUTpmdW5jdGlvbihh
+KXt2YXIgdCxzLHIscSxwLG89dGhpcyxuPXt9Cm4uYT1hCmlmKGE9PW51bGwpcmV0dXJuCnQ9by5hCmlm
+KHQ8PTEpe3M9dS54LmIoby5jKQpyPW8uYz1hCmlmKHMhPW51bGwpe2Zvcig7cT1yLmEscSE9bnVsbDty
+PXEpO3IuYT1zfX1lbHNle2lmKHQ9PT0yKXtwPXUuXy5iKG8uYykKdD1wLmEKaWYodDw0KXtwLmpRKGEp
+CnJldHVybn1vLmE9dApvLmM9cC5jfW4uYT1vLk44KGEpClAuVGsobnVsbCxudWxsLG8uYix1Lk0uYihu
+ZXcgUC5vUShuLG8pKSl9fSwKYWg6ZnVuY3Rpb24oKXt2YXIgdD11LnguYih0aGlzLmMpCnRoaXMuYz1u
+dWxsCnJldHVybiB0aGlzLk44KHQpfSwKTjg6ZnVuY3Rpb24oYSl7dmFyIHQscyxyCmZvcih0PWEscz1u
+dWxsO3QhPW51bGw7cz10LHQ9cil7cj10LmEKdC5hPXN9cmV0dXJuIHN9LApISDpmdW5jdGlvbihhKXt2
+YXIgdCxzPXRoaXMscj1zLiR0aQpyLkMoIjEvIikuYihhKQppZihyLkMoImI4PDE+IikuYyhhKSlpZihy
+LmMoYSkpUC5BOShhLHMpCmVsc2UgUC5rMyhhLHMpCmVsc2V7dD1zLmFoKCkKci5kLmIoYSkKcy5hPTQK
+cy5jPWEKUC5IWihzLHQpfX0sClgyOmZ1bmN0aW9uKGEpe3ZhciB0LHM9dGhpcwpzLiR0aS5kLmIoYSkK
+dD1zLmFoKCkKcy5hPTQKcy5jPWEKUC5IWihzLHQpfSwKWkw6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzPXRo
+aXMKdS5sLmIoYikKdD1zLmFoKCkKcy5hPTgKcy5jPW5ldyBQLkN3KGEsYikKUC5IWihzLHQpfSwKWGY6
+ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcyxzPXQuJHRpCnMuQygiMS8iKS5iKGEpCmlmKHMuQygiYjg8MT4i
+KS5jKGEpKXt0LmNVKGEpCnJldHVybn10LmE9MQpQLlRrKG51bGwsbnVsbCx0LmIsdS5NLmIobmV3IFAu
+ckgodCxhKSkpfSwKY1U6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcyxzPXQuJHRpCnMuQygiYjg8MT4iKS5i
+KGEpCmlmKHMuYyhhKSl7aWYoYS5hPT09OCl7dC5hPTEKUC5UayhudWxsLG51bGwsdC5iLHUuTS5iKG5l
+dyBQLktGKHQsYSkpKX1lbHNlIFAuQTkoYSx0KQpyZXR1cm59UC5rMyhhLHQpfSwKTms6ZnVuY3Rpb24o
+YSxiKXt0aGlzLmE9MQpQLlRrKG51bGwsbnVsbCx0aGlzLmIsdS5NLmIobmV3IFAuWkwodGhpcyxhLGIp
+KSl9LAokaWI4OjF9ClAuZGEucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXtQLkhaKHRoaXMuYSx0aGlz
+LmIpfSwKJFM6MH0KUC5vUS5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe1AuSFoodGhpcy5iLHRoaXMu
+YS5hKX0sCiRTOjB9ClAucFYucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnQu
+YT0wCnQuSEgoYSl9LAokUzoxMH0KUC5VNy5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3UubC5i
+KGIpCnRoaXMuYS5aTChhLGIpfSwKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuJDIoYSxudWxsKX0s
+CiRDOiIkMiIsCiREOmZ1bmN0aW9uKCl7cmV0dXJuW251bGxdfSwKJFM6Mjl9ClAudnIucHJvdG90eXBl
+PXsKJDA6ZnVuY3Rpb24oKXt0aGlzLmEuWkwodGhpcy5iLHRoaXMuYyl9LAokUzowfQpQLnJILnByb3Rv
+dHlwZT17CiQwOmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcy5hCnQuWDIodC4kdGkuZC5iKHRoaXMuYikpfSwK
+JFM6MH0KUC5LRi5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe1AuQTkodGhpcy5iLHRoaXMuYSl9LAok
+UzowfQpQLlpMLnByb3RvdHlwZT17CiQwOmZ1bmN0aW9uKCl7dGhpcy5hLlpMKHRoaXMuYix0aGlzLmMp
+fSwKJFM6MH0KUC5SVC5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe3ZhciB0LHMscixxLHAsbyxuPXRo
+aXMsbT1udWxsCnRyeXtyPW4uYwptPXIuYi5iLnp6KHUuZk8uYihyLmQpLHUueil9Y2F0Y2gocSl7dD1I
+LlJ1KHEpCnM9SC50cyhxKQppZihuLmQpe3I9dS5uLmIobi5hLmEuYykuYQpwPXQKcD1yPT1udWxsP3A9
+PW51bGw6cj09PXAKcj1wfWVsc2Ugcj0hMQpwPW4uYgppZihyKXAuYj11Lm4uYihuLmEuYS5jKQplbHNl
+IHAuYj1uZXcgUC5Ddyh0LHMpCnAuYT0hMApyZXR1cm59aWYodS5jLmMobSkpe2lmKG0gaW5zdGFuY2Vv
+ZiBQLnZzJiZtLmE+PTQpe2lmKG0uYT09PTgpe3I9bi5iCnIuYj11Lm4uYihtLmMpCnIuYT0hMH1yZXR1
+cm59bz1uLmEuYQpyPW4uYgpyLmI9bS5XNyhuZXcgUC5qWihvKSx1LnopCnIuYT0hMX19LAokUzoyfQpQ
+LmpaLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmF9LAokUzozOX0KUC5ycS5w
+cm90b3R5cGU9ewokMDpmdW5jdGlvbigpe3ZhciB0LHMscixxLHAsbyxuLG09dGhpcwp0cnl7cj1tLmIK
+cT1yLiR0aQpwPXEuZApvPXAuYihtLmMpCm0uYS5iPXIuYi5iLmJ2KHEuQygiMi8oMSkiKS5iKHIuZCks
+byxxLkMoIjIvIikscCl9Y2F0Y2gobil7dD1ILlJ1KG4pCnM9SC50cyhuKQpyPW0uYQpyLmI9bmV3IFAu
+Q3codCxzKQpyLmE9ITB9fSwKJFM6Mn0KUC5SVy5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe3ZhciB0
+LHMscixxLHAsbyxuLG0sbD10aGlzCnRyeXt0PXUubi5iKGwuYS5hLmMpCnE9bC5jCmlmKEgub1QocS5I
+Uih0KSkmJnEuZSE9bnVsbCl7cD1sLmIKcC5iPXEuS3codCkKcC5hPSExfX1jYXRjaChvKXtzPUguUnUo
+bykKcj1ILnRzKG8pCnE9dS5uLmIobC5hLmEuYykKcD1xLmEKbj1zCm09bC5iCmlmKHA9PW51bGw/bj09
+bnVsbDpwPT09biltLmI9cQplbHNlIG0uYj1uZXcgUC5DdyhzLHIpCm0uYT0hMH19LAokUzoyfQpQLk9N
+LnByb3RvdHlwZT17fQpQLnFoLnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3ZhciB0LHMscj10aGlz
+LHE9e30scD1uZXcgUC52cygkLlgzLHUuZkopCnEuYT0wCnQ9SC5MaChyKQpzPXQuQygifigxKSIpLmIo
+bmV3IFAuQjUocSxyKSkKdS5NLmIobmV3IFAudU8ocSxwKSkKVy5KRShyLmEsci5iLHMsITEsdC5kKQpy
+ZXR1cm4gcH19ClAuQjUucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7SC5MaCh0aGlzLmIpLmQuYihh
+KTsrK3RoaXMuYS5hfSwKJFM6ZnVuY3Rpb24oKXtyZXR1cm4gSC5MaCh0aGlzLmIpLkMoImM4KDEpIil9
+fQpQLnVPLnByb3RvdHlwZT17CiQwOmZ1bmN0aW9uKCl7dGhpcy5iLkhIKHRoaXMuYS5hKX0sCiRTOjB9
+ClAuTU8ucHJvdG90eXBlPXt9ClAua1QucHJvdG90eXBlPXt9ClAueEkucHJvdG90eXBlPXt9ClAuQ3cu
+cHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4gSC5kKHRoaXMuYSl9LAokaVhTOjF9ClAubTAu
+cHJvdG90eXBlPXskaUpCOjF9ClAucEsucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXt2YXIgdCxzPXRo
+aXMuYSxyPXMuYQpzPXI9PW51bGw/cy5hPW5ldyBQLm4oKTpyCnI9dGhpcy5iCmlmKHI9PW51bGwpdGhy
+b3cgSC5iKHMpCnQ9SC5iKHMpCnQuc3RhY2s9ci53KDApCnRocm93IHR9LAokUzowfQpQLkppLnByb3Rv
+dHlwZT17CmJIOmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxPW51bGwKdS5NLmIoYSkKdHJ5e2lmKEMuTlU9
+PT0kLlgzKXthLiQwKCkKcmV0dXJufVAuVDgocSxxLHRoaXMsYSx1LkgpfWNhdGNoKHIpe3Q9SC5SdShy
+KQpzPUgudHMocikKUC5MMihxLHEsdGhpcyx0LHUubC5iKHMpKX19LApEbDpmdW5jdGlvbihhLGIsYyl7
+dmFyIHQscyxyLHE9bnVsbApjLkMoIn4oMCkiKS5iKGEpCmMuYihiKQp0cnl7aWYoQy5OVT09PSQuWDMp
+e2EuJDEoYikKcmV0dXJufVAueXYocSxxLHRoaXMsYSxiLHUuSCxjKX1jYXRjaChyKXt0PUguUnUocikK
+cz1ILnRzKHIpClAuTDIocSxxLHRoaXMsdCx1LmwuYihzKSl9fSwKUlQ6ZnVuY3Rpb24oYSxiKXtyZXR1
+cm4gbmV3IFAuaGoodGhpcyxiLkMoIjAoKSIpLmIoYSksYil9LApHWTpmdW5jdGlvbihhKXtyZXR1cm4g
+bmV3IFAuVnAodGhpcyx1Lk0uYihhKSl9LApQeTpmdW5jdGlvbihhLGIpe3JldHVybiBuZXcgUC5PUih0
+aGlzLGIuQygifigwKSIpLmIoYSksYil9LApxOmZ1bmN0aW9uKGEsYil7cmV0dXJuIG51bGx9LAp6ejpm
+dW5jdGlvbihhLGIpe2IuQygiMCgpIikuYihhKQppZigkLlgzPT09Qy5OVSlyZXR1cm4gYS4kMCgpCnJl
+dHVybiBQLlQ4KG51bGwsbnVsbCx0aGlzLGEsYil9LApidjpmdW5jdGlvbihhLGIsYyxkKXtjLkMoIkA8
+MD4iKS5LcShkKS5DKCIxKDIpIikuYihhKQpkLmIoYikKaWYoJC5YMz09PUMuTlUpcmV0dXJuIGEuJDEo
+YikKcmV0dXJuIFAueXYobnVsbCxudWxsLHRoaXMsYSxiLGMsZCl9LApycDpmdW5jdGlvbihhLGIsYyxk
+LGUsZil7ZC5DKCJAPDA+IikuS3EoZSkuS3EoZikuQygiMSgyLDMpIikuYihhKQplLmIoYikKZi5iKGMp
+CmlmKCQuWDM9PT1DLk5VKXJldHVybiBhLiQyKGIsYykKcmV0dXJuIFAuUXgobnVsbCxudWxsLHRoaXMs
+YSxiLGMsZCxlLGYpfSwKTGo6ZnVuY3Rpb24oYSxiLGMsZCl7cmV0dXJuIGIuQygiQDwwPiIpLktxKGMp
+LktxKGQpLkMoIjEoMiwzKSIpLmIoYSl9fQpQLmhqLnByb3RvdHlwZT17CiQwOmZ1bmN0aW9uKCl7cmV0
+dXJuIHRoaXMuYS56eih0aGlzLmIsdGhpcy5jKX0sCiRTOmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuYy5D
+KCIwKCkiKX19ClAuVnAucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5hLmJIKHRo
+aXMuYil9LAokUzoyfQpQLk9SLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYwpy
+ZXR1cm4gdGhpcy5hLkRsKHRoaXMuYix0LmIoYSksdCl9LAokUzpmdW5jdGlvbigpe3JldHVybiB0aGlz
+LmMuQygifigwKSIpfX0KUC5iNi5wcm90b3R5cGU9ewpna3o6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcyxz
+PW5ldyBQLmxtKHQsdC5yLEguTGgodCkuQygibG08MT4iKSkKcy5jPXQuZQpyZXR1cm4gc30sCmdBOmZ1
+bmN0aW9uKGEpe3JldHVybiB0aGlzLmF9LAp0ZzpmdW5jdGlvbihhLGIpe3ZhciB0LHMKaWYodHlwZW9m
+IGI9PSJzdHJpbmciJiZiIT09Il9fcHJvdG9fXyIpe3Q9dGhpcy5iCmlmKHQ9PW51bGwpcmV0dXJuITEK
+cmV0dXJuIHUueS5iKHRbYl0pIT1udWxsfWVsc2V7cz10aGlzLlBSKGIpCnJldHVybiBzfX0sClBSOmZ1
+bmN0aW9uKGEpe3ZhciB0PXRoaXMuZAppZih0PT1udWxsKXJldHVybiExCnJldHVybiB0aGlzLkRGKHRb
+dGhpcy5OKGEpXSxhKT49MH0sCmk6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHI9dGhpcwpILkxoKHIpLmQu
+YihiKQppZih0eXBlb2YgYj09InN0cmluZyImJmIhPT0iX19wcm90b19fIil7dD1yLmIKcmV0dXJuIHIu
+YlEodD09bnVsbD9yLmI9UC5UMigpOnQsYil9ZWxzZSBpZih0eXBlb2YgYj09Im51bWJlciImJihiJjEw
+NzM3NDE4MjMpPT09Yil7cz1yLmMKcmV0dXJuIHIuYlEocz09bnVsbD9yLmM9UC5UMigpOnMsYil9ZWxz
+ZSByZXR1cm4gci5CNyhiKX0sCkI3OmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxPXRoaXMKSC5MaChxKS5k
+LmIoYSkKdD1xLmQKaWYodD09bnVsbCl0PXEuZD1QLlQyKCkKcz1xLk4oYSkKcj10W3NdCmlmKHI9PW51
+bGwpdFtzXT1bcS55byhhKV0KZWxzZXtpZihxLkRGKHIsYSk+PTApcmV0dXJuITEKci5wdXNoKHEueW8o
+YSkpfXJldHVybiEwfSwKUjpmdW5jdGlvbihhLGIpe3ZhciB0PXRoaXMKaWYodHlwZW9mIGI9PSJzdHJp
+bmciJiZiIT09Il9fcHJvdG9fXyIpcmV0dXJuIHQuTCh0LmIsYikKZWxzZSBpZih0eXBlb2YgYj09Im51
+bWJlciImJihiJjEwNzM3NDE4MjMpPT09YilyZXR1cm4gdC5MKHQuYyxiKQplbHNlIHJldHVybiB0LnFn
+KGIpfSwKcWc6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscD10aGlzLG89cC5kCmlmKG89PW51bGwpcmV0
+dXJuITEKdD1wLk4oYSkKcz1vW3RdCnI9cC5ERihzLGEpCmlmKHI8MClyZXR1cm4hMQpxPXMuc3BsaWNl
+KHIsMSlbMF0KaWYoMD09PXMubGVuZ3RoKWRlbGV0ZSBvW3RdCnAuR1MocSkKcmV0dXJuITB9LApiUTpm
+dW5jdGlvbihhLGIpe0guTGgodGhpcykuZC5iKGIpCmlmKHUueS5iKGFbYl0pIT1udWxsKXJldHVybiEx
+CmFbYl09dGhpcy55byhiKQpyZXR1cm4hMH0sCkw6ZnVuY3Rpb24oYSxiKXt2YXIgdAppZihhPT1udWxs
+KXJldHVybiExCnQ9dS55LmIoYVtiXSkKaWYodD09bnVsbClyZXR1cm4hMQp0aGlzLkdTKHQpCmRlbGV0
+ZSBhW2JdCnJldHVybiEwfSwKUzpmdW5jdGlvbigpe3RoaXMucj0xMDczNzQxODIzJnRoaXMucisxfSwK
+eW86ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlzLHI9bmV3IFAuYm4oSC5MaChzKS5kLmIoYSkpCmlmKHMu
+ZT09bnVsbClzLmU9cy5mPXIKZWxzZXt0PXMuZgpyLmM9dApzLmY9dC5iPXJ9KytzLmEKcy5TKCkKcmV0
+dXJuIHJ9LApHUzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLHM9YS5jLHI9YS5iCmlmKHM9PW51bGwpdC5l
+PXIKZWxzZSBzLmI9cgppZihyPT1udWxsKXQuZj1zCmVsc2Ugci5jPXM7LS10LmEKdC5TKCl9LApOOmZ1
+bmN0aW9uKGEpe3JldHVybiBKLmhmKGEpJjEwNzM3NDE4MjN9LApERjpmdW5jdGlvbihhLGIpe3ZhciB0
+LHMKaWYoYT09bnVsbClyZXR1cm4tMQp0PWEubGVuZ3RoCmZvcihzPTA7czx0OysrcylpZihKLlJNKGFb
+c10uYSxiKSlyZXR1cm4gcwpyZXR1cm4tMX19ClAuYm4ucHJvdG90eXBlPXt9ClAubG0ucHJvdG90eXBl
+PXsKZ2w6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5kfSwKRjpmdW5jdGlvbigpe3ZhciB0PXRoaXMscz10
+LmEKaWYodC5iIT09cy5yKXRocm93IEguYihQLmE0KHMpKQplbHNle3M9dC5jCmlmKHM9PW51bGwpe3Qu
+c2oobnVsbCkKcmV0dXJuITF9ZWxzZXt0LnNqKHQuJHRpLmQuYihzLmEpKQp0LmM9dC5jLmIKcmV0dXJu
+ITB9fX0sCnNqOmZ1bmN0aW9uKGEpe3RoaXMuZD10aGlzLiR0aS5kLmIoYSl9LAokaUFuOjF9ClAubVcu
+cHJvdG90eXBlPXt9ClAudXkucHJvdG90eXBlPXskaWJROjEsJGljWDoxLCRpek06MX0KUC5sRC5wcm90
+b3R5cGU9ewpna3o6ZnVuY3Rpb24oYSl7cmV0dXJuIG5ldyBILmE3KGEsdGhpcy5nQShhKSxILnpLKGEp
+LkMoImE3PGxELkU+IikpfSwKRTpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLnEoYSxiKX0sCks6ZnVu
+Y3Rpb24oYSxiKXt2YXIgdCxzCkgueksoYSkuQygifihsRC5FKSIpLmIoYikKdD10aGlzLmdBKGEpCmZv
+cihzPTA7czx0Oysrcyl7Yi4kMSh0aGlzLnEoYSxzKSkKaWYodCE9PXRoaXMuZ0EoYSkpdGhyb3cgSC5i
+KFAuYTQoYSkpfX0sCmdvcjpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5nQShhKSE9PTB9LApFMjpmdW5j
+dGlvbihhLGIsYyl7dmFyIHQ9SC56SyhhKQpyZXR1cm4gbmV3IEguQTgoYSx0LktxKGMpLkMoIjEobEQu
+RSkiKS5iKGIpLHQuQygiQDxsRC5FPiIpLktxKGMpLkMoIkE4PDEsMj4iKSl9LApkdTpmdW5jdGlvbihh
+LGIsYyxkKXt2YXIgdApILnpLKGEpLkMoImxELkUiKS5iKGQpClAuakIoYixjLHRoaXMuZ0EoYSkpCmZv
+cih0PWI7dDxjOysrdCl0aGlzLlkoYSx0LGQpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gUC5XRShhLCJb
+IiwiXSIpfX0KUC5pbC5wcm90b3R5cGU9e30KUC5yYS5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIp
+e3ZhciB0LHM9dGhpcy5hCmlmKCFzLmEpdGhpcy5iLmErPSIsICIKcy5hPSExCnM9dGhpcy5iCnQ9cy5h
+Kz1ILmQoYSkKcy5hPXQrIjogIgpzLmErPUguZChiKX0sCiRTOjR9ClAuWWsucHJvdG90eXBlPXsKSzpm
+dW5jdGlvbihhLGIpe3ZhciB0LHMKSC5MaCh0aGlzKS5DKCJ+KFlrLkssWWsuVikiKS5iKGIpCmZvcih0
+PUouSVQodGhpcy5nVigpKTt0LkYoKTspe3M9dC5nbCgpCmIuJDIocyx0aGlzLnEoMCxzKSl9fSwKZ1B1
+OmZ1bmN0aW9uKGEpe3JldHVybiBKLk0xKHRoaXMuZ1YoKSxuZXcgUC55USh0aGlzKSxILkxoKHRoaXMp
+LkMoIk4zPFlrLkssWWsuVj4iKSl9LAp4NDpmdW5jdGlvbihhKXtyZXR1cm4gSi56bCh0aGlzLmdWKCks
+YSl9LApnQTpmdW5jdGlvbihhKXtyZXR1cm4gSi5IbSh0aGlzLmdWKCkpfSwKZ2wwOmZ1bmN0aW9uKGEp
+e3JldHVybiBKLnVVKHRoaXMuZ1YoKSl9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLm5PKHRoaXMpfSwK
+JGlaMDoxfQpQLnlRLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYSxzPUguTGgo
+dCkKcy5DKCJZay5LIikuYihhKQpyZXR1cm4gbmV3IFAuTjMoYSx0LnEoMCxhKSxzLkMoIkA8WWsuSz4i
+KS5LcShzLkMoIllrLlYiKSkuQygiTjM8MSwyPiIpKX0sCiRTOmZ1bmN0aW9uKCl7cmV0dXJuIEguTGgo
+dGhpcy5hKS5DKCJOMzxZay5LLFlrLlY+KFlrLkspIil9fQpQLktQLnByb3RvdHlwZT17Clk6ZnVuY3Rp
+b24oYSxiLGMpe3ZhciB0PUguTGgodGhpcykKdC5kLmIoYikKdC5jaFsxXS5iKGMpCnRocm93IEguYihQ
+Lkw0KCJDYW5ub3QgbW9kaWZ5IHVubW9kaWZpYWJsZSBtYXAiKSl9fQpQLlBuLnByb3RvdHlwZT17CnE6
+ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhpcy5hLnEoMCxiKX0sClk6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0
+PUguTGgodGhpcykKdGhpcy5hLlkoMCx0LmQuYihiKSx0LmNoWzFdLmIoYykpfSwKeDQ6ZnVuY3Rpb24o
+YSl7cmV0dXJuIHRoaXMuYS54NChhKX0sCks6ZnVuY3Rpb24oYSxiKXt0aGlzLmEuSygwLEguTGgodGhp
+cykuQygifigxLDIpIikuYihiKSl9LApnbDA6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0
+LmdsMCh0KX0sCmdBOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYQpyZXR1cm4gdC5nQSh0KX0sCnc6ZnVu
+Y3Rpb24oYSl7cmV0dXJuIEouaih0aGlzLmEpfSwKZ1B1OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYQpy
+ZXR1cm4gdC5nUHUodCl9LAokaVowOjF9ClAuR2oucHJvdG90eXBlPXt9ClAubGYucHJvdG90eXBlPXsK
+dzpmdW5jdGlvbihhKXtyZXR1cm4gUC5XRSh0aGlzLCJ7IiwifSIpfX0KUC5Wai5wcm90b3R5cGU9eyRp
+YlE6MSwkaWNYOjEsJGl4dToxfQpQLlh2LnByb3RvdHlwZT17CkZWOmZ1bmN0aW9uKGEsYil7dmFyIHQK
+Zm9yKHQ9Si5JVChILkxoKHRoaXMpLkMoImNYPDE+IikuYihiKSk7dC5GKCk7KXRoaXMuaSgwLHQuZ2wo
+KSl9LAp3OmZ1bmN0aW9uKGEpe3JldHVybiBQLldFKHRoaXMsInsiLCJ9Iil9LApIOmZ1bmN0aW9uKGEs
+Yil7dmFyIHQscz1QLnJqKHRoaXMsdGhpcy5yLEguTGgodGhpcykuZCkKaWYoIXMuRigpKXJldHVybiIi
+CmlmKGI9PT0iIil7dD0iIgpkbyB0Kz1ILmQocy5kKQp3aGlsZShzLkYoKSl9ZWxzZXt0PUguZChzLmQp
+CmZvcig7cy5GKCk7KXQ9dCtiK0guZChzLmQpfXJldHVybiB0LmNoYXJDb2RlQXQoMCk9PTA/dDp0fSwK
+JGliUToxLAokaWNYOjEsCiRpeHU6MX0KUC5uWS5wcm90b3R5cGU9e30KUC5UQy5wcm90b3R5cGU9e30K
+UC5SVS5wcm90b3R5cGU9e30KUC51dy5wcm90b3R5cGU9ewpxOmZ1bmN0aW9uKGEsYil7dmFyIHQscz10
+aGlzLmIKaWYocz09bnVsbClyZXR1cm4gdGhpcy5jLnEoMCxiKQplbHNlIGlmKHR5cGVvZiBiIT0ic3Ry
+aW5nIilyZXR1cm4gbnVsbAplbHNle3Q9c1tiXQpyZXR1cm4gdHlwZW9mIHQ9PSJ1bmRlZmluZWQiP3Ro
+aXMuZmIoYik6dH19LApnQTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5iPT1udWxsP3RoaXMuYy5hOnRo
+aXMuQ2YoKS5sZW5ndGh9LApnbDA6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuZ0EodGhpcyk9PT0wfSwK
+Z1Y6ZnVuY3Rpb24oKXtpZih0aGlzLmI9PW51bGwpe3ZhciB0PXRoaXMuYwpyZXR1cm4gbmV3IEguaTUo
+dCxILkxoKHQpLkMoImk1PDE+IikpfXJldHVybiBuZXcgUC5pOCh0aGlzKX0sClk6ZnVuY3Rpb24oYSxi
+LGMpe3ZhciB0LHMscj10aGlzCmlmKHIuYj09bnVsbClyLmMuWSgwLGIsYykKZWxzZSBpZihyLng0KGIp
+KXt0PXIuYgp0W2JdPWMKcz1yLmEKaWYocz09bnVsbD90IT1udWxsOnMhPT10KXNbYl09bnVsbH1lbHNl
+IHIuWEsoKS5ZKDAsYixjKX0sCng0OmZ1bmN0aW9uKGEpe2lmKHRoaXMuYj09bnVsbClyZXR1cm4gdGhp
+cy5jLng0KGEpCnJldHVybiBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGhpcy5h
+LGEpfSwKSzpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHA9dGhpcwp1LmNBLmIoYikKaWYocC5iPT1u
+dWxsKXJldHVybiBwLmMuSygwLGIpCnQ9cC5DZigpCmZvcihzPTA7czx0Lmxlbmd0aDsrK3Mpe3I9dFtz
+XQpxPXAuYltyXQppZih0eXBlb2YgcT09InVuZGVmaW5lZCIpe3E9UC5RZShwLmFbcl0pCnAuYltyXT1x
+fWIuJDIocixxKQppZih0IT09cC5jKXRocm93IEguYihQLmE0KHApKX19LApDZjpmdW5jdGlvbigpe3Zh
+ciB0PXUuai5iKHRoaXMuYykKaWYodD09bnVsbCl0PXRoaXMuYz1ILlZNKE9iamVjdC5rZXlzKHRoaXMu
+YSksdS5zKQpyZXR1cm4gdH0sClhLOmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscCxvPXRoaXMKaWYoby5i
+PT1udWxsKXJldHVybiBvLmMKdD1QLkZsKHUuTix1LnopCnM9by5DZigpCmZvcihyPTA7cT1zLmxlbmd0
+aCxyPHE7KytyKXtwPXNbcl0KdC5ZKDAscCxvLnEoMCxwKSl9aWYocT09PTApQy5ObS5pKHMsbnVsbCkK
+ZWxzZSBDLk5tLnNBKHMsMCkKby5hPW8uYj1udWxsCnJldHVybiBvLmM9dH0sCmZiOmZ1bmN0aW9uKGEp
+e3ZhciB0CmlmKCFPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGhpcy5hLGEpKXJl
+dHVybiBudWxsCnQ9UC5RZSh0aGlzLmFbYV0pCnJldHVybiB0aGlzLmJbYV09dH19ClAuaTgucHJvdG90
+eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0LmdBKHQpfSwKRTpmdW5jdGlv
+bihhLGIpe3ZhciB0PXRoaXMuYQppZih0LmI9PW51bGwpdD10LmdWKCkuRSgwLGIpCmVsc2V7dD10LkNm
+KCkKaWYoYjwwfHxiPj10Lmxlbmd0aClyZXR1cm4gSC5PSCh0LGIpCnQ9dFtiXX1yZXR1cm4gdH0sCmdr
+ejpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEKaWYodC5iPT1udWxsKXt0PXQuZ1YoKQp0PXQuZ2t6KHQp
+fWVsc2V7dD10LkNmKCkKdD1uZXcgSi5tMSh0LHQubGVuZ3RoLEgudDYodCkuQygibTE8MT4iKSl9cmV0
+dXJuIHR9LAp0ZzpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLmEueDQoYil9fQpQLkNWLnByb3RvdHlw
+ZT17CnlyOmZ1bmN0aW9uKGEsYTAsYTEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrLGosaSxoLGcsZixl
+LGQsYyxiPSJJbnZhbGlkIGJhc2U2NCBlbmNvZGluZyBsZW5ndGggIgphMT1QLmpCKGEwLGExLGEubGVu
+Z3RoKQp0PSQuVjcoKQpmb3Iocz1hMCxyPXMscT1udWxsLHA9LTEsbz0tMSxuPTA7czxhMTtzPW0pe209
+cysxCmw9Qy54Qi5XKGEscykKaWYobD09PTM3KXtrPW0rMgppZihrPD1hMSl7aj1ILm9vKEMueEIuVyhh
+LG0pKQppPUgub28oQy54Qi5XKGEsbSsxKSkKaD1qKjE2K2ktKGkmMjU2KQppZihoPT09MzcpaD0tMQpt
+PWt9ZWxzZSBoPS0xfWVsc2UgaD1sCmlmKDA8PWgmJmg8PTEyNyl7aWYoaDwwfHxoPj10Lmxlbmd0aCly
+ZXR1cm4gSC5PSCh0LGgpCmc9dFtoXQppZihnPj0wKXtoPUMueEIubSgiQUJDREVGR0hJSktMTU5PUFFS
+U1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsZykKaWYoaD09PWwp
+Y29udGludWUKbD1ofWVsc2V7aWYoZz09PS0xKXtpZihwPDApe2Y9cT09bnVsbD9udWxsOnEuYS5sZW5n
+dGgKaWYoZj09bnVsbClmPTAKcD1mKyhzLXIpCm89c30rK24KaWYobD09PTYxKWNvbnRpbnVlfWw9aH1p
+ZihnIT09LTIpe2lmKHE9PW51bGwpcT1uZXcgUC5SbigiIikKcS5hKz1DLnhCLk5qKGEscixzKQpxLmEr
+PUguTHcobCkKcj1tCmNvbnRpbnVlfX10aHJvdyBILmIoUC5ycigiSW52YWxpZCBiYXNlNjQgZGF0YSIs
+YSxzKSl9aWYocSE9bnVsbCl7Zj1xLmErPUMueEIuTmooYSxyLGExKQplPWYubGVuZ3RoCmlmKHA+PTAp
+UC54TShhLG8sYTEscCxuLGUpCmVsc2V7ZD1DLmpuLnpZKGUtMSw0KSsxCmlmKGQ9PT0xKXRocm93IEgu
+YihQLnJyKGIsYSxhMSkpCmZvcig7ZDw0Oyl7Zis9Ij0iCnEuYT1mOysrZH19Zj1xLmEKcmV0dXJuIEMu
+eEIuaTcoYSxhMCxhMSxmLmNoYXJDb2RlQXQoMCk9PTA/ZjpmKX1jPWExLWEwCmlmKHA+PTApUC54TShh
+LG8sYTEscCxuLGMpCmVsc2V7ZD1DLmpuLnpZKGMsNCkKaWYoZD09PTEpdGhyb3cgSC5iKFAucnIoYixh
+LGExKSkKaWYoZD4xKWE9Qy54Qi5pNyhhLGExLGExLGQ9PT0yPyI9PSI6Ij0iKX1yZXR1cm4gYX19ClAu
+VTgucHJvdG90eXBlPXt9ClAuVWsucHJvdG90eXBlPXt9ClAud0kucHJvdG90eXBlPXt9ClAuWmkucHJv
+dG90eXBlPXt9ClAuVWQucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdD1QLnAodGhpcy5hKQpy
+ZXR1cm4odGhpcy5iIT1udWxsPyJDb252ZXJ0aW5nIG9iamVjdCB0byBhbiBlbmNvZGFibGUgb2JqZWN0
+IGZhaWxlZDoiOiJDb252ZXJ0aW5nIG9iamVjdCBkaWQgbm90IHJldHVybiBhbiBlbmNvZGFibGUgb2Jq
+ZWN0OiIpKyIgIit0fX0KUC5LOC5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiJDeWNsaWMg
+ZXJyb3IgaW4gSlNPTiBzdHJpbmdpZnkifX0KUC5ieS5wcm90b3R5cGU9ewpwVzpmdW5jdGlvbihhLGIs
+Yyl7dmFyIHQKdS5lcC5iKGMpCnQ9UC5CUyhiLHRoaXMuZ0hlKCkuYSkKcmV0dXJuIHR9LApPQjpmdW5j
+dGlvbihhLGIpe3ZhciB0CnUuYmMuYihiKQp0PVAudVgoYSx0aGlzLmdaRSgpLmIsbnVsbCkKcmV0dXJu
+IHR9LApnWkU6ZnVuY3Rpb24oKXtyZXR1cm4gQy5uWH0sCmdIZTpmdW5jdGlvbigpe3JldHVybiBDLkEz
+fX0KUC5vai5wcm90b3R5cGU9e30KUC5NeC5wcm90b3R5cGU9e30KUC5TaC5wcm90b3R5cGU9ewp2cDpm
+dW5jdGlvbihhKXt2YXIgdCxzLHIscSxwLG8sbj1hLmxlbmd0aApmb3IodD1KLnJZKGEpLHM9dGhpcy5j
+LHI9MCxxPTA7cTxuOysrcSl7cD10LlcoYSxxKQppZihwPjkyKWNvbnRpbnVlCmlmKHA8MzIpe2lmKHE+
+cilzLmErPUMueEIuTmooYSxyLHEpCnI9cSsxCnMuYSs9SC5Mdyg5MikKc3dpdGNoKHApe2Nhc2UgODpz
+LmErPUguTHcoOTgpCmJyZWFrCmNhc2UgOTpzLmErPUguTHcoMTE2KQpicmVhawpjYXNlIDEwOnMuYSs9
+SC5MdygxMTApCmJyZWFrCmNhc2UgMTI6cy5hKz1ILkx3KDEwMikKYnJlYWsKY2FzZSAxMzpzLmErPUgu
+THcoMTE0KQpicmVhawpkZWZhdWx0OnMuYSs9SC5MdygxMTcpCnMuYSs9SC5Mdyg0OCkKcy5hKz1ILkx3
+KDQ4KQpvPXA+Pj40JjE1CnMuYSs9SC5MdyhvPDEwPzQ4K286ODcrbykKbz1wJjE1CnMuYSs9SC5Mdyhv
+PDEwPzQ4K286ODcrbykKYnJlYWt9fWVsc2UgaWYocD09PTM0fHxwPT09OTIpe2lmKHE+cilzLmErPUMu
+eEIuTmooYSxyLHEpCnI9cSsxCnMuYSs9SC5Mdyg5MikKcy5hKz1ILkx3KHApfX1pZihyPT09MClzLmEr
+PUguZChhKQplbHNlIGlmKHI8bilzLmErPXQuTmooYSxyLG4pfSwKSm46ZnVuY3Rpb24oYSl7dmFyIHQs
+cyxyLHEKZm9yKHQ9dGhpcy5hLHM9dC5sZW5ndGgscj0wO3I8czsrK3Ipe3E9dFtyXQppZihhPT1udWxs
+P3E9PW51bGw6YT09PXEpdGhyb3cgSC5iKG5ldyBQLks4KGEsbnVsbCkpfUMuTm0uaSh0LGEpfSwKaVU6
+ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscD10aGlzCmlmKHAudE0oYSkpcmV0dXJuCnAuSm4oYSkKdHJ5
+e3Q9cC5iLiQxKGEpCmlmKCFwLnRNKHQpKXtyPVAuR3koYSxudWxsLHAuZ1ZLKCkpCnRocm93IEguYihy
+KX1yPXAuYQppZigwPj1yLmxlbmd0aClyZXR1cm4gSC5PSChyLC0xKQpyLnBvcCgpfWNhdGNoKHEpe3M9
+SC5SdShxKQpyPVAuR3koYSxzLHAuZ1ZLKCkpCnRocm93IEguYihyKX19LAp0TTpmdW5jdGlvbihhKXt2
+YXIgdCxzLHI9dGhpcwppZih0eXBlb2YgYT09Im51bWJlciIpe2lmKCFpc0Zpbml0ZShhKSlyZXR1cm4h
+MQpyLmMuYSs9Qy5DRC53KGEpCnJldHVybiEwfWVsc2UgaWYoYT09PSEwKXtyLmMuYSs9InRydWUiCnJl
+dHVybiEwfWVsc2UgaWYoYT09PSExKXtyLmMuYSs9ImZhbHNlIgpyZXR1cm4hMH1lbHNlIGlmKGE9PW51
+bGwpe3IuYy5hKz0ibnVsbCIKcmV0dXJuITB9ZWxzZSBpZih0eXBlb2YgYT09InN0cmluZyIpe3Q9ci5j
+CnQuYSs9JyInCnIudnAoYSkKdC5hKz0nIicKcmV0dXJuITB9ZWxzZSBpZih1LmouYyhhKSl7ci5Kbihh
+KQpyLmxLKGEpCnQ9ci5hCmlmKDA+PXQubGVuZ3RoKXJldHVybiBILk9IKHQsLTEpCnQucG9wKCkKcmV0
+dXJuITB9ZWxzZSBpZih1LkcuYyhhKSl7ci5KbihhKQpzPXIuancoYSkKdD1yLmEKaWYoMD49dC5sZW5n
+dGgpcmV0dXJuIEguT0godCwtMSkKdC5wb3AoKQpyZXR1cm4gc31lbHNlIHJldHVybiExfSwKbEs6ZnVu
+Y3Rpb24oYSl7dmFyIHQscyxyPXRoaXMuYwpyLmErPSJbIgp0PUouVTYoYSkKaWYodC5nb3IoYSkpe3Ro
+aXMuaVUodC5xKGEsMCkpCmZvcihzPTE7czx0LmdBKGEpOysrcyl7ci5hKz0iLCIKdGhpcy5pVSh0LnEo
+YSxzKSl9fXIuYSs9Il0ifSwKanc6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHEscCxvLG49dGhpcyxtPXt9
+CmlmKGEuZ2wwKGEpKXtuLmMuYSs9Int9IgpyZXR1cm4hMH10PWEuZ0EoYSkqMgpzPW5ldyBBcnJheSh0
+KQpzLmZpeGVkJGxlbmd0aD1BcnJheQpyPW0uYT0wCm0uYj0hMAphLksoMCxuZXcgUC50aShtLHMpKQpp
+ZighbS5iKXJldHVybiExCnE9bi5jCnEuYSs9InsiCmZvcihwPSciJztyPHQ7cis9MixwPScsIicpe3Eu
+YSs9cApuLnZwKEgueShzW3JdKSkKcS5hKz0nIjonCm89cisxCmlmKG8+PXQpcmV0dXJuIEguT0gocyxv
+KQpuLmlVKHNbb10pfXEuYSs9In0iCnJldHVybiEwfX0KUC50aS5wcm90b3R5cGU9ewokMjpmdW5jdGlv
+bihhLGIpe3ZhciB0LHMKaWYodHlwZW9mIGEhPSJzdHJpbmciKXRoaXMuYS5iPSExCnQ9dGhpcy5iCnM9
+dGhpcy5hCkMuTm0uWSh0LHMuYSsrLGEpCkMuTm0uWSh0LHMuYSsrLGIpfSwKJFM6NH0KUC50dS5wcm90
+b3R5cGU9ewpnVks6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLmMuYQpyZXR1cm4gdC5jaGFyQ29kZUF0KDAp
+PT0wP3Q6dH19ClAudTUucHJvdG90eXBlPXsKZ1pFOmZ1bmN0aW9uKCl7cmV0dXJuIEMuUWt9fQpQLkUz
+LnByb3RvdHlwZT17CldKOmZ1bmN0aW9uKGEpe3ZhciB0LHMscj1QLmpCKDAsbnVsbCxhLmxlbmd0aCks
+cT1yLTAKaWYocT09PTApcmV0dXJuIG5ldyBVaW50OEFycmF5KDApCnQ9bmV3IFVpbnQ4QXJyYXkocSoz
+KQpzPW5ldyBQLlJ3KHQpCmlmKHMuR3goYSwwLHIpIT09cilzLk82KEouYTYoYSxyLTEpLDApCnJldHVy
+biBuZXcgVWludDhBcnJheSh0LnN1YmFycmF5KDAsSC5yTSgwLHMuYix0Lmxlbmd0aCkpKX19ClAuUncu
+cHJvdG90eXBlPXsKTzY6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzPXRoaXMscj1zLmMscT1zLmIscD1xKzEs
+bz1yLmxlbmd0aAppZigoYiY2NDUxMik9PT01NjMyMCl7dD02NTUzNisoKGEmMTAyMyk8PDEwKXxiJjEw
+MjMKcy5iPXAKaWYocT49bylyZXR1cm4gSC5PSChyLHEpCnJbcV09MjQwfHQ+Pj4xOApxPXMuYj1wKzEK
+aWYocD49bylyZXR1cm4gSC5PSChyLHApCnJbcF09MTI4fHQ+Pj4xMiY2MwpwPXMuYj1xKzEKaWYocT49
+bylyZXR1cm4gSC5PSChyLHEpCnJbcV09MTI4fHQ+Pj42JjYzCnMuYj1wKzEKaWYocD49bylyZXR1cm4g
+SC5PSChyLHApCnJbcF09MTI4fHQmNjMKcmV0dXJuITB9ZWxzZXtzLmI9cAppZihxPj1vKXJldHVybiBI
+Lk9IKHIscSkKcltxXT0yMjR8YT4+PjEyCnE9cy5iPXArMQppZihwPj1vKXJldHVybiBILk9IKHIscCkK
+cltwXT0xMjh8YT4+PjYmNjMKcy5iPXErMQppZihxPj1vKXJldHVybiBILk9IKHIscSkKcltxXT0xMjh8
+YSY2MwpyZXR1cm4hMX19LApHeDpmdW5jdGlvbihhLGIsYyl7dmFyIHQscyxyLHEscCxvLG4sbT10aGlz
+CmlmKGIhPT1jJiYoQy54Qi5tKGEsYy0xKSY2NDUxMik9PT01NTI5NiktLWMKZm9yKHQ9bS5jLHM9dC5s
+ZW5ndGgscj1iO3I8YzsrK3Ipe3E9Qy54Qi5XKGEscikKaWYocTw9MTI3KXtwPW0uYgppZihwPj1zKWJy
+ZWFrCm0uYj1wKzEKdFtwXT1xfWVsc2UgaWYoKHEmNjQ1MTIpPT09NTUyOTYpe2lmKG0uYiszPj1zKWJy
+ZWFrCm89cisxCmlmKG0uTzYocSxDLnhCLlcoYSxvKSkpcj1vfWVsc2UgaWYocTw9MjA0Nyl7cD1tLmIK
+bj1wKzEKaWYobj49cylicmVhawptLmI9bgppZihwPj1zKXJldHVybiBILk9IKHQscCkKdFtwXT0xOTJ8
+cT4+PjYKbS5iPW4rMQp0W25dPTEyOHxxJjYzfWVsc2V7cD1tLmIKaWYocCsyPj1zKWJyZWFrCm49bS5i
+PXArMQppZihwPj1zKXJldHVybiBILk9IKHQscCkKdFtwXT0yMjR8cT4+PjEyCnA9bS5iPW4rMQppZihu
+Pj1zKXJldHVybiBILk9IKHQsbikKdFtuXT0xMjh8cT4+PjYmNjMKbS5iPXArMQppZihwPj1zKXJldHVy
+biBILk9IKHQscCkKdFtwXT0xMjh8cSY2M319cmV0dXJuIHJ9fQpQLkdZLnByb3RvdHlwZT17CldKOmZ1
+bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbAp1LkwuYihhKQp0PVAua3koITEsYSwwLG51bGwp
+CmlmKHQhPW51bGwpcmV0dXJuIHQKcz1QLmpCKDAsbnVsbCxKLkhtKGEpKQpyPVAuY1AoYSwwLHMpCmlm
+KHI+MCl7cT1QLkhNKGEsMCxyKQppZihyPT09cylyZXR1cm4gcQpwPW5ldyBQLlJuKHEpCm89cgpuPSEx
+fWVsc2V7bz0wCnA9bnVsbApuPSEwfWlmKHA9PW51bGwpcD1uZXcgUC5SbigiIikKbT1uZXcgUC5ieigh
+MSxwKQptLmM9bgptLk1FKGEsbyxzKQppZihtLmU+MCl7SC52aChQLnJyKCJVbmZpbmlzaGVkIFVURi04
+IG9jdGV0IHNlcXVlbmNlIixhLHMpKQpwLmErPUguTHcoNjU1MzMpCm0uZj1tLmU9bS5kPTB9bD1wLmEK
+cmV0dXJuIGwuY2hhckNvZGVBdCgwKT09MD9sOmx9fQpQLmJ6LnByb3RvdHlwZT17Ck1FOmZ1bmN0aW9u
+KGEsYixjKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxqLGksaD10aGlzLGc9IkJhZCBVVEYtOCBlbmNv
+ZGluZyAweCIKdS5MLmIoYSkKdD1oLmQKcz1oLmUKcj1oLmYKaC5mPWguZT1oLmQ9MAokbGFiZWwwJDA6
+Zm9yKHE9Si5VNihhKSxwPWguYixvPWI7ITA7bz1qKXskbGFiZWwxJDE6aWYocz4wKXtkb3tpZihvPT09
+YylicmVhayAkbGFiZWwwJDAKbj1xLnEoYSxvKQppZih0eXBlb2YgbiE9PSJudW1iZXIiKXJldHVybiBu
+LnpNKCkKaWYoKG4mMTkyKSE9PTEyOCl7bT1QLnJyKGcrQy5qbi5XWihuLDE2KSxhLG8pCnRocm93IEgu
+YihtKX1lbHNle3Q9KHQ8PDZ8biY2Myk+Pj4wOy0tczsrK299fXdoaWxlKHM+MCkKbT1yLTEKaWYobTww
+fHxtPj00KXJldHVybiBILk9IKEMuR2IsbSkKaWYodDw9Qy5HYlttXSl7bT1QLnJyKCJPdmVybG9uZyBl
+bmNvZGluZyBvZiAweCIrQy5qbi5XWih0LDE2KSxhLG8tci0xKQp0aHJvdyBILmIobSl9aWYodD4xMTE0
+MTExKXttPVAucnIoIkNoYXJhY3RlciBvdXRzaWRlIHZhbGlkIFVuaWNvZGUgcmFuZ2U6IDB4IitDLmpu
+LldaKHQsMTYpLGEsby1yLTEpCnRocm93IEguYihtKX1pZighaC5jfHx0IT09NjUyNzkpcC5hKz1ILkx3
+KHQpCmguYz0hMX1mb3IobT1vPGM7bTspe2w9UC5jUChhLG8sYykKaWYobD4wKXtoLmM9ITEKaz1vK2wK
+cC5hKz1QLkhNKGEsbyxrKQppZihrPT09YylicmVha31lbHNlIGs9bwpqPWsrMQpuPXEucShhLGspCmlm
+KHR5cGVvZiBuIT09Im51bWJlciIpcmV0dXJuIG4uSigpCmlmKG48MCl7aT1QLnJyKCJOZWdhdGl2ZSBV
+VEYtOCBjb2RlIHVuaXQ6IC0weCIrQy5qbi5XWigtbiwxNiksYSxqLTEpCnRocm93IEguYihpKX1lbHNl
+e2lmKChuJjIyNCk9PT0xOTIpe3Q9biYzMQpzPTEKcj0xCmNvbnRpbnVlICRsYWJlbDAkMH1pZigobiYy
+NDApPT09MjI0KXt0PW4mMTUKcz0yCnI9Mgpjb250aW51ZSAkbGFiZWwwJDB9aWYoKG4mMjQ4KT09PTI0
+MCYmbjwyNDUpe3Q9biY3CnM9MwpyPTMKY29udGludWUgJGxhYmVsMCQwfWk9UC5ycihnK0Muam4uV1oo
+biwxNiksYSxqLTEpCnRocm93IEguYihpKX19YnJlYWsgJGxhYmVsMCQwfWlmKHM+MCl7aC5kPXQKaC5l
+PXMKaC5mPXJ9fX0KUC5XRi5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3ZhciB0LHMscgp1LmZv
+LmIoYSkKdD10aGlzLmIKcz10aGlzLmEKdC5hKz1zLmEKcj10LmErPUguZChhLmEpCnQuYT1yKyI6ICIK
+dC5hKz1QLnAoYikKcy5hPSIsICJ9LAokUzo0Mn0KUC5hMi5wcm90b3R5cGU9e30KUC5pUC5wcm90b3R5
+cGU9ewpETjpmdW5jdGlvbihhLGIpe2lmKGI9PW51bGwpcmV0dXJuITEKcmV0dXJuIGIgaW5zdGFuY2Vv
+ZiBQLmlQJiZ0aGlzLmE9PT1iLmEmJiEwfSwKZ2lPOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuYQpyZXR1
+cm4odF5DLmpuLndHKHQsMzApKSYxMDczNzQxODIzfSwKdzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLHM9
+UC5HcShILnRKKHQpKSxyPVAuaDAoSC5OUyh0KSkscT1QLmgwKEguakEodCkpLHA9UC5oMChILklYKHQp
+KSxvPVAuaDAoSC5jaCh0KSksbj1QLmgwKEguSmQodCkpLG09UC5WeChILm8xKHQpKSxsPXMrIi0iK3Ir
+Ii0iK3ErIiAiK3ArIjoiK28rIjoiK24rIi4iK20KcmV0dXJuIGx9fQpQLkNQLnByb3RvdHlwZT17fQpQ
+LlhTLnByb3RvdHlwZT17fQpQLkM2LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5h
+CmlmKHQhPW51bGwpcmV0dXJuIkFzc2VydGlvbiBmYWlsZWQ6ICIrUC5wKHQpCnJldHVybiJBc3NlcnRp
+b24gZmFpbGVkIn19ClAubi5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiJUaHJvdyBvZiBu
+dWxsLiJ9fQpQLnUucHJvdG90eXBlPXsKZ1o6ZnVuY3Rpb24oKXtyZXR1cm4iSW52YWxpZCBhcmd1bWVu
+dCIrKCF0aGlzLmE/IihzKSI6IiIpfSwKZ3U6ZnVuY3Rpb24oKXtyZXR1cm4iIn0sCnc6ZnVuY3Rpb24o
+YSl7dmFyIHQscyxyLHEscD10aGlzLG89cC5jLG49byE9bnVsbD8iICgiK28rIikiOiIiCm89cC5kCnQ9
+bz09bnVsbD8iIjoiOiAiK0guZChvKQpzPXAuZ1ooKStuK3QKaWYoIXAuYSlyZXR1cm4gcwpyPXAuZ3Uo
+KQpxPVAucChwLmIpCnJldHVybiBzK3IrIjogIitxfX0KUC5iSi5wcm90b3R5cGU9ewpnWjpmdW5jdGlv
+bigpe3JldHVybiJSYW5nZUVycm9yIn0sCmd1OmZ1bmN0aW9uKCl7dmFyIHQscyxyPXRoaXMuZQppZihy
+PT1udWxsKXtyPXRoaXMuZgp0PXIhPW51bGw/IjogTm90IGxlc3MgdGhhbiBvciBlcXVhbCB0byAiK0gu
+ZChyKToiIn1lbHNle3M9dGhpcy5mCmlmKHM9PW51bGwpdD0iOiBOb3QgZ3JlYXRlciB0aGFuIG9yIGVx
+dWFsIHRvICIrSC5kKHIpCmVsc2UgaWYocz5yKXQ9IjogTm90IGluIHJhbmdlICIrSC5kKHIpKyIuLiIr
+SC5kKHMpKyIsIGluY2x1c2l2ZSIKZWxzZSB0PXM8cj8iOiBWYWxpZCB2YWx1ZSByYW5nZSBpcyBlbXB0
+eSI6IjogT25seSB2YWxpZCB2YWx1ZSBpcyAiK0guZChyKX1yZXR1cm4gdH19ClAuZVkucHJvdG90eXBl
+PXsKZ1o6ZnVuY3Rpb24oKXtyZXR1cm4iUmFuZ2VFcnJvciJ9LApndTpmdW5jdGlvbigpe3ZhciB0LHM9
+SC5TYyh0aGlzLmIpCmlmKHR5cGVvZiBzIT09Im51bWJlciIpcmV0dXJuIHMuSigpCmlmKHM8MClyZXR1
+cm4iOiBpbmRleCBtdXN0IG5vdCBiZSBuZWdhdGl2ZSIKdD10aGlzLmYKaWYodD09PTApcmV0dXJuIjog
+bm8gaW5kaWNlcyBhcmUgdmFsaWQiCnJldHVybiI6IGluZGV4IHNob3VsZCBiZSBsZXNzIHRoYW4gIitI
+LmQodCl9LApnQTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5mfX0KUC5tcC5wcm90b3R5cGU9ewp3OmZ1
+bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbD10aGlzLGs9e30saj1uZXcgUC5SbigiIikKay5h
+PSIiCmZvcih0PWwuYyxzPXQubGVuZ3RoLHI9MCxxPSIiLHA9IiI7cjxzOysrcixwPSIsICIpe289dFty
+XQpqLmE9cStwCnE9ai5hKz1QLnAobykKay5hPSIsICJ9bC5kLksoMCxuZXcgUC5XRihrLGopKQpuPVAu
+cChsLmEpCm09ai53KDApCnQ9Ik5vU3VjaE1ldGhvZEVycm9yOiBtZXRob2Qgbm90IGZvdW5kOiAnIitI
+LmQobC5iLmEpKyInXG5SZWNlaXZlcjogIituKyJcbkFyZ3VtZW50czogWyIrbSsiXSIKcmV0dXJuIHR9
+fQpQLnViLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIlVuc3VwcG9ydGVkIG9wZXJhdGlv
+bjogIit0aGlzLmF9fQpQLmRzLnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJl
+dHVybiB0IT1udWxsPyJVbmltcGxlbWVudGVkRXJyb3I6ICIrdDoiVW5pbXBsZW1lbnRlZEVycm9yIn19
+ClAubGoucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4iQmFkIHN0YXRlOiAiK3RoaXMuYX19
+ClAuVVYucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEKaWYodD09bnVsbClyZXR1
+cm4iQ29uY3VycmVudCBtb2RpZmljYXRpb24gZHVyaW5nIGl0ZXJhdGlvbi4iCnJldHVybiJDb25jdXJy
+ZW50IG1vZGlmaWNhdGlvbiBkdXJpbmcgaXRlcmF0aW9uOiAiK1AucCh0KSsiLiJ9fQpQLms1LnByb3Rv
+dHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIk91dCBvZiBNZW1vcnkifSwKJGlYUzoxfQpQLktZLnBy
+b3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIlN0YWNrIE92ZXJmbG93In0sCiRpWFM6MX0KUC5j
+LnByb3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hCnJldHVybiB0PT1udWxsPyJSZWFk
+aW5nIHN0YXRpYyB2YXJpYWJsZSBkdXJpbmcgaXRzIGluaXRpYWxpemF0aW9uIjoiUmVhZGluZyBzdGF0
+aWMgdmFyaWFibGUgJyIrdCsiJyBkdXJpbmcgaXRzIGluaXRpYWxpemF0aW9uIn19ClAuQ0QucHJvdG90
+eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4iRXhjZXB0aW9uOiAiK3RoaXMuYX0sCiRpUno6MX0KUC5h
+RS5wcm90b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrLGosaSxoPXRo
+aXMuYSxnPWghPW51bGwmJiIiIT09aD8iRm9ybWF0RXhjZXB0aW9uOiAiK0guZChoKToiRm9ybWF0RXhj
+ZXB0aW9uIixmPXRoaXMuYyxlPXRoaXMuYgppZih0eXBlb2YgZT09InN0cmluZyIpe2lmKGYhPW51bGwp
+aD1mPDB8fGY+ZS5sZW5ndGgKZWxzZSBoPSExCmlmKGgpZj1udWxsCmlmKGY9PW51bGwpe3Q9ZS5sZW5n
+dGg+Nzg/Qy54Qi5OaihlLDAsNzUpKyIuLi4iOmUKcmV0dXJuIGcrIlxuIit0fWZvcihzPTEscj0wLHE9
+ITEscD0wO3A8ZjsrK3Ape289Qy54Qi5XKGUscCkKaWYobz09PTEwKXtpZihyIT09cHx8IXEpKytzCnI9
+cCsxCnE9ITF9ZWxzZSBpZihvPT09MTMpeysrcwpyPXArMQpxPSEwfX1nPXM+MT9nKygiIChhdCBsaW5l
+ICIrcysiLCBjaGFyYWN0ZXIgIisoZi1yKzEpKyIpXG4iKTpnKygiIChhdCBjaGFyYWN0ZXIgIisoZisx
+KSsiKVxuIikKbj1lLmxlbmd0aApmb3IocD1mO3A8bjsrK3Ape289Qy54Qi5tKGUscCkKaWYobz09PTEw
+fHxvPT09MTMpe249cApicmVha319aWYobi1yPjc4KWlmKGYtcjw3NSl7bT1yKzc1Cmw9cgprPSIiCmo9
+Ii4uLiJ9ZWxzZXtpZihuLWY8NzUpe2w9bi03NQptPW4Kaj0iIn1lbHNle2w9Zi0zNgptPWYrMzYKaj0i
+Li4uIn1rPSIuLi4ifWVsc2V7bT1uCmw9cgprPSIiCmo9IiJ9aT1DLnhCLk5qKGUsbCxtKQpyZXR1cm4g
+ZytrK2kraisiXG4iK0MueEIuSXgoIiAiLGYtbCtrLmxlbmd0aCkrIl5cbiJ9ZWxzZSByZXR1cm4gZiE9
+bnVsbD9nKygiIChhdCBvZmZzZXQgIitILmQoZikrIikiKTpnfSwKJGlSejoxfQpQLkVILnByb3RvdHlw
+ZT17fQpQLktOLnByb3RvdHlwZT17fQpQLmNYLnByb3RvdHlwZT17CkUyOmZ1bmN0aW9uKGEsYixjKXt2
+YXIgdD1ILkxoKHRoaXMpCnJldHVybiBILksxKHRoaXMsdC5LcShjKS5DKCIxKGNYLkUpIikuYihiKSx0
+LkMoImNYLkUiKSxjKX0sCmV2OmZ1bmN0aW9uKGEsYil7dmFyIHQ9SC5MaCh0aGlzKQpyZXR1cm4gbmV3
+IEguVTUodGhpcyx0LkMoImEyKGNYLkUpIikuYihiKSx0LkMoIlU1PGNYLkU+IikpfSwKZ0E6ZnVuY3Rp
+b24oYSl7dmFyIHQscz10aGlzLmdreih0aGlzKQpmb3IodD0wO3MuRigpOykrK3QKcmV0dXJuIHR9LApn
+bDA6ZnVuY3Rpb24oYSl7cmV0dXJuIXRoaXMuZ2t6KHRoaXMpLkYoKX0sCmdyODpmdW5jdGlvbihhKXt2
+YXIgdCxzPXRoaXMuZ2t6KHRoaXMpCmlmKCFzLkYoKSl0aHJvdyBILmIoSC5XcCgpKQp0PXMuZ2woKQpp
+ZihzLkYoKSl0aHJvdyBILmIoSC5kVSgpKQpyZXR1cm4gdH0sCkU6ZnVuY3Rpb24oYSxiKXt2YXIgdCxz
+LHIKUC5rMShiLCJpbmRleCIpCmZvcih0PXRoaXMuZ2t6KHRoaXMpLHM9MDt0LkYoKTspe3I9dC5nbCgp
+CmlmKGI9PT1zKXJldHVybiByOysrc310aHJvdyBILmIoUC5DZihiLHRoaXMsImluZGV4IixudWxsLHMp
+KX0sCnc6ZnVuY3Rpb24oYSl7cmV0dXJuIFAuRVAodGhpcywiKCIsIikiKX19ClAuQW4ucHJvdG90eXBl
+PXt9ClAuek0ucHJvdG90eXBlPXskaWJROjEsJGljWDoxfQpQLlowLnByb3RvdHlwZT17fQpQLk4zLnBy
+b3RvdHlwZT17Cnc6ZnVuY3Rpb24oYSl7cmV0dXJuIk1hcEVudHJ5KCIrSC5kKHRoaXMuYSkrIjogIitI
+LmQodGhpcy5iKSsiKSJ9fQpQLmM4LnByb3RvdHlwZT17CmdpTzpmdW5jdGlvbihhKXtyZXR1cm4gUC5r
+LnByb3RvdHlwZS5naU8uY2FsbCh0aGlzLHRoaXMpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4ibnVsbCJ9
+fQpQLkZLLnByb3RvdHlwZT17fQpQLmsucHJvdG90eXBlPXtjb25zdHJ1Y3RvcjpQLmssJGlrOjEsCkRO
+OmZ1bmN0aW9uKGEsYil7cmV0dXJuIHRoaXM9PT1ifSwKZ2lPOmZ1bmN0aW9uKGEpe3JldHVybiBILmVR
+KHRoaXMpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4iSW5zdGFuY2Ugb2YgJyIrSC5kKEguTSh0aGlzKSkr
+IicifSwKZTc6ZnVuY3Rpb24oYSxiKXt1Lm8uYihiKQp0aHJvdyBILmIoUC5scih0aGlzLGIuZ1dhKCks
+Yi5nbmQoKSxiLmdWbSgpKSl9LAp0b1N0cmluZzpmdW5jdGlvbigpe3JldHVybiB0aGlzLncodGhpcyl9
+fQpQLk9kLnByb3RvdHlwZT17fQpQLmliLnByb3RvdHlwZT17JGlPZDoxfQpQLnh1LnByb3RvdHlwZT17
+fQpQLkd6LnByb3RvdHlwZT17fQpQLnFVLnByb3RvdHlwZT17JGl2WDoxfQpQLlJuLnByb3RvdHlwZT17
+CmdBOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEubGVuZ3RofSwKdzpmdW5jdGlvbihhKXt2YXIgdD10
+aGlzLmEKcmV0dXJuIHQuY2hhckNvZGVBdCgwKT09MD90OnR9LAokaUJMOjF9ClAuR0QucHJvdG90eXBl
+PXt9ClAubjEucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscQp1LmYuYihhKQpI
+LnkoYikKdD1KLnJZKGIpLk9ZKGIsIj0iKQppZih0PT09LTEpe2lmKGIhPT0iIilhLlkoMCxQLmt1KGIs
+MCxiLmxlbmd0aCx0aGlzLmEsITApLCIiKX1lbHNlIGlmKHQhPT0wKXtzPUMueEIuTmooYiwwLHQpCnI9
+Qy54Qi5HKGIsdCsxKQpxPXRoaXMuYQphLlkoMCxQLmt1KHMsMCxzLmxlbmd0aCxxLCEwKSxQLmt1KHIs
+MCxyLmxlbmd0aCxxLCEwKSl9cmV0dXJuIGF9LAokUzoxOX0KUC5jUy5wcm90b3R5cGU9ewokMjpmdW5j
+dGlvbihhLGIpe3Rocm93IEguYihQLnJyKCJJbGxlZ2FsIElQdjQgYWRkcmVzcywgIithLHRoaXMuYSxi
+KSl9LAokUzo0Nn0KUC5WQy5wcm90b3R5cGU9ewokMjpmdW5jdGlvbihhLGIpe3Rocm93IEguYihQLnJy
+KCJJbGxlZ2FsIElQdjYgYWRkcmVzcywgIithLHRoaXMuYSxiKSl9LAokMTpmdW5jdGlvbihhKXtyZXR1
+cm4gdGhpcy4kMihhLG51bGwpfSwKJFM6NDd9ClAuSlQucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxi
+KXt2YXIgdAppZihiLWE+NCl0aGlzLmEuJDIoImFuIElQdjYgcGFydCBjYW4gb25seSBjb250YWluIGEg
+bWF4aW11bSBvZiA0IGhleCBkaWdpdHMiLGEpCnQ9UC5RQShDLnhCLk5qKHRoaXMuYixhLGIpLG51bGws
+MTYpCmlmKHR5cGVvZiB0IT09Im51bWJlciIpcmV0dXJuIHQuSigpCmlmKHQ8MHx8dD42NTUzNSl0aGlz
+LmEuJDIoImVhY2ggcGFydCBtdXN0IGJlIGluIHRoZSByYW5nZSBvZiBgMHgwLi4weEZGRkZgIixhKQpy
+ZXR1cm4gdH0sCiRTOjQ4fQpQLkRuLnByb3RvdHlwZT17CmdrdTpmdW5jdGlvbigpe3JldHVybiB0aGlz
+LmJ9LApnSmY6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5jCmlmKHQ9PW51bGwpcmV0dXJuIiIKaWYoQy54
+Qi5uKHQsIlsiKSlyZXR1cm4gQy54Qi5Oaih0LDEsdC5sZW5ndGgtMSkKcmV0dXJuIHR9LApndHA6ZnVu
+Y3Rpb24oYSl7dmFyIHQ9dGhpcy5kCmlmKHQ9PW51bGwpcmV0dXJuIFAud0sodGhpcy5hKQpyZXR1cm4g
+dH0sCmd0UDpmdW5jdGlvbigpe3ZhciB0PXRoaXMuZgpyZXR1cm4gdD09bnVsbD8iIjp0fSwKZ0thOmZ1
+bmN0aW9uKCl7dmFyIHQ9dGhpcy5yCnJldHVybiB0PT1udWxsPyIiOnR9LApubTpmdW5jdGlvbihhLGIp
+e3ZhciB0LHMscixxLHAsbyxuLG0sbD10aGlzCnUuWC5iKG51bGwpCnUuay5iKGIpCnQ9bC5hCnM9dD09
+PSJmaWxlIgpyPWwuYgpxPWwuZApwPWwuYwppZighKHAhPW51bGwpKXA9ci5sZW5ndGghPT0wfHxxIT1u
+dWxsfHxzPyIiOm51bGwKbz1sLmUKaWYoIXMpbj1wIT1udWxsJiZvLmxlbmd0aCE9PTAKZWxzZSBuPSEw
+CmlmKG4mJiFDLnhCLm4obywiLyIpKW89Ii8iK28KbT1QLmxlKG51bGwsMCwwLGIpCnJldHVybiBuZXcg
+UC5Ebih0LHIscCxxLG8sbSxsLnIpfSwKZ0ZqOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLngKaWYocyE9
+bnVsbClyZXR1cm4gcwp0PXRoaXMuZQppZih0Lmxlbmd0aCE9PTAmJkMueEIuVyh0LDApPT09NDcpdD1D
+LnhCLkcodCwxKQpzPXQ9PT0iIj9DLnhEOlAuQUYobmV3IEguQTgoSC5WTSh0LnNwbGl0KCIvIiksdS5z
+KSx1LmRPLmIoUC5QSCgpKSx1LmRvKSx1Lk4pCnRoaXMuc282KHMpCnJldHVybiBzfSwKZ2hZOmZ1bmN0
+aW9uKCl7dmFyIHQscz10aGlzCmlmKHMuUT09bnVsbCl7dD1zLmYKcy5zUkgobmV3IFAuR2ooUC5XWCh0
+PT1udWxsPyIiOnQpLHUuVykpfXJldHVybiBzLlF9LApKaDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixx
+LHAsbwpmb3IodD0wLHM9MDtDLnhCLlFpKGIsIi4uLyIscyk7KXtzKz0zOysrdH1yPUMueEIuY24oYSwi
+LyIpCndoaWxlKCEwKXtpZighKHI+MCYmdD4wKSlicmVhawpxPUMueEIuUGsoYSwiLyIsci0xKQppZihx
+PDApYnJlYWsKcD1yLXEKbz1wIT09MgppZighb3x8cD09PTMpaWYoQy54Qi5tKGEscSsxKT09PTQ2KW89
+IW98fEMueEIubShhLHErMik9PT00NgplbHNlIG89ITEKZWxzZSBvPSExCmlmKG8pYnJlYWs7LS10CnI9
+cX1yZXR1cm4gQy54Qi5pNyhhLHIrMSxudWxsLEMueEIuRyhiLHMtMyp0KSl9LApaSTpmdW5jdGlvbihh
+KXtyZXR1cm4gdGhpcy5tUyhQLmhLKGEpKX0sCm1TOmZ1bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxu
+LG0sbCxrPXRoaXMsaj1udWxsCmlmKGEuZ0ZpKCkubGVuZ3RoIT09MCl7dD1hLmdGaSgpCmlmKGEuZ2Nq
+KCkpe3M9YS5na3UoKQpyPWEuZ0pmKGEpCnE9YS5neEEoKT9hLmd0cChhKTpqfWVsc2V7cT1qCnI9cQpz
+PSIifXA9UC54ZShhLmdJaShhKSkKbz1hLmdRRCgpP2EuZ3RQKCk6an1lbHNle3Q9ay5hCmlmKGEuZ2Nq
+KCkpe3M9YS5na3UoKQpyPWEuZ0pmKGEpCnE9UC53QihhLmd4QSgpP2EuZ3RwKGEpOmosdCkKcD1QLnhl
+KGEuZ0lpKGEpKQpvPWEuZ1FEKCk/YS5ndFAoKTpqfWVsc2V7cz1rLmIKcj1rLmMKcT1rLmQKaWYoYS5n
+SWkoYSk9PT0iIil7cD1rLmUKbz1hLmdRRCgpP2EuZ3RQKCk6ay5mfWVsc2V7aWYoYS5ndFQoKSlwPVAu
+eGUoYS5nSWkoYSkpCmVsc2V7bj1rLmUKaWYobi5sZW5ndGg9PT0wKWlmKHI9PW51bGwpcD10Lmxlbmd0
+aD09PTA/YS5nSWkoYSk6UC54ZShhLmdJaShhKSkKZWxzZSBwPVAueGUoIi8iK2EuZ0lpKGEpKQplbHNl
+e209ay5KaChuLGEuZ0lpKGEpKQpsPXQubGVuZ3RoPT09MAppZighbHx8ciE9bnVsbHx8Qy54Qi5uKG4s
+Ii8iKSlwPVAueGUobSkKZWxzZSBwPVAud0YobSwhbHx8ciE9bnVsbCl9fW89YS5nUUQoKT9hLmd0UCgp
+Omp9fX1yZXR1cm4gbmV3IFAuRG4odCxzLHIscSxwLG8sYS5nWjgoKT9hLmdLYSgpOmopfSwKZ2NqOmZ1
+bmN0aW9uKCl7cmV0dXJuIHRoaXMuYyE9bnVsbH0sCmd4QTpmdW5jdGlvbigpe3JldHVybiB0aGlzLmQh
+PW51bGx9LApnUUQ6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5mIT1udWxsfSwKZ1o4OmZ1bmN0aW9uKCl7
+cmV0dXJuIHRoaXMuciE9bnVsbH0sCmd0VDpmdW5jdGlvbigpe3JldHVybiBDLnhCLm4odGhpcy5lLCIv
+Iil9LAp0NDpmdW5jdGlvbigpe3ZhciB0LHMscj10aGlzLHE9ci5hCmlmKHEhPT0iIiYmcSE9PSJmaWxl
+Iil0aHJvdyBILmIoUC5MNCgiQ2Fubm90IGV4dHJhY3QgYSBmaWxlIHBhdGggZnJvbSBhICIrSC5kKHEp
+KyIgVVJJIikpCnE9ci5mCmlmKChxPT1udWxsPyIiOnEpIT09IiIpdGhyb3cgSC5iKFAuTDQoIkNhbm5v
+dCBleHRyYWN0IGEgZmlsZSBwYXRoIGZyb20gYSBVUkkgd2l0aCBhIHF1ZXJ5IGNvbXBvbmVudCIpKQpx
+PXIucgppZigocT09bnVsbD8iIjpxKSE9PSIiKXRocm93IEguYihQLkw0KCJDYW5ub3QgZXh0cmFjdCBh
+IGZpbGUgcGF0aCBmcm9tIGEgVVJJIHdpdGggYSBmcmFnbWVudCBjb21wb25lbnQiKSkKdD0kLndRKCkK
+aWYoSC5vVCh0KSlxPVAubW4ocikKZWxzZXtpZihyLmMhPW51bGwmJnIuZ0pmKHIpIT09IiIpSC52aChQ
+Lkw0KCJDYW5ub3QgZXh0cmFjdCBhIG5vbi1XaW5kb3dzIGZpbGUgcGF0aCBmcm9tIGEgZmlsZSBVUkkg
+d2l0aCBhbiBhdXRob3JpdHkiKSkKcz1yLmdGaigpClAua0UocywhMSkKcT1QLnZnKEMueEIubihyLmUs
+Ii8iKT8iLyI6IiIscywiLyIpCnE9cS5jaGFyQ29kZUF0KDApPT0wP3E6cX1yZXR1cm4gcX0sCnc6ZnVu
+Y3Rpb24oYSl7dmFyIHQscyxyLHE9dGhpcyxwPXEueQppZihwPT1udWxsKXtwPXEuYQp0PXAubGVuZ3Ro
+IT09MD9wKyI6IjoiIgpzPXEuYwpyPXM9PW51bGwKaWYoIXJ8fHA9PT0iZmlsZSIpe3A9dCsiLy8iCnQ9
+cS5iCmlmKHQubGVuZ3RoIT09MClwPXArdCsiQCIKaWYoIXIpcCs9cwp0PXEuZAppZih0IT1udWxsKXA9
+cCsiOiIrSC5kKHQpfWVsc2UgcD10CnArPXEuZQp0PXEuZgppZih0IT1udWxsKXA9cCsiPyIrdAp0PXEu
+cgppZih0IT1udWxsKXA9cCsiIyIrdApwPXEueT1wLmNoYXJDb2RlQXQoMCk9PTA/cDpwfXJldHVybiBw
+fSwKRE46ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHI9dGhpcwppZihiPT1udWxsKXJldHVybiExCmlmKHI9
+PT1iKXJldHVybiEwCmlmKHUudi5jKGIpKWlmKHIuYT09Yi5nRmkoKSlpZihyLmMhPW51bGw9PT1iLmdj
+aigpKWlmKHIuYj09Yi5na3UoKSlpZihyLmdKZihyKT09Yi5nSmYoYikpaWYoci5ndHAocik9PWIuZ3Rw
+KGIpKWlmKHIuZT09PWIuZ0lpKGIpKXt0PXIuZgpzPXQ9PW51bGwKaWYoIXM9PT1iLmdRRCgpKXtpZihz
+KXQ9IiIKaWYodD09PWIuZ3RQKCkpe3Q9ci5yCnM9dD09bnVsbAppZighcz09PWIuZ1o4KCkpe2lmKHMp
+dD0iIgp0PXQ9PT1iLmdLYSgpfWVsc2UgdD0hMX1lbHNlIHQ9ITF9ZWxzZSB0PSExfWVsc2UgdD0hMQpl
+bHNlIHQ9ITEKZWxzZSB0PSExCmVsc2UgdD0hMQplbHNlIHQ9ITEKZWxzZSB0PSExCmVsc2UgdD0hMQpy
+ZXR1cm4gdH0sCmdpTzpmdW5jdGlvbihhKXt2YXIgdD10aGlzLnoKcmV0dXJuIHQ9PW51bGw/dGhpcy56
+PUMueEIuZ2lPKHRoaXMudygwKSk6dH0sCnNvNjpmdW5jdGlvbihhKXt0aGlzLng9dS5hLmIoYSl9LApz
+Ukg6ZnVuY3Rpb24oYSl7dGhpcy5RPXUuZi5iKGEpfSwKJGlpRDoxLApnRmk6ZnVuY3Rpb24oKXtyZXR1
+cm4gdGhpcy5hfSwKZ0lpOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmV9fQpQLmUxLnByb3RvdHlwZT17
+CiQxOmZ1bmN0aW9uKGEpe3Rocm93IEguYihQLnJyKCJJbnZhbGlkIHBvcnQiLHRoaXMuYSx0aGlzLmIr
+MSkpfSwKJFM6MTN9ClAuTlkucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQ9IklsbGVnYWwg
+cGF0aCBjaGFyYWN0ZXIgIgpILnkoYSkKaWYoSi56bChhLCIvIikpaWYodGhpcy5hKXRocm93IEguYihQ
+LnhZKHQrYSkpCmVsc2UgdGhyb3cgSC5iKFAuTDQodCthKSl9LAokUzoxM30KUC5SWi5wcm90b3R5cGU9
+ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gUC5lUChDLlpKLEgueShhKSxDLnhNLCExKX0sCiRTOjV9ClAu
+TUUucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmIscz10aGlzLmEKdC5hKz1z
+LmEKcy5hPSImIgpzPXQuYSs9SC5kKFAuZVAoQy5GMyxhLEMueE0sITApKQppZihiIT1udWxsJiZiLmxl
+bmd0aCE9PTApe3QuYT1zKyI9Igp0LmErPUguZChQLmVQKEMuRjMsYixDLnhNLCEwKSl9fSwKJFM6MjJ9
+ClAueTUucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzCkgueShhKQppZihiPT1udWxs
+fHx0eXBlb2YgYj09InN0cmluZyIpdGhpcy5hLiQyKGEsSC55KGIpKQplbHNlIGZvcih0PUouSVQodS5S
+LmIoYikpLHM9dGhpcy5hO3QuRigpOylzLiQyKGEsSC55KHQuZ2woKSkpfSwKJFM6MTJ9ClAuUEUucHJv
+dG90eXBlPXsKZ2xSOmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscD10aGlzLG89bnVsbCxuPXAuYwppZihu
+IT1udWxsKXJldHVybiBuCm49cC5iCmlmKDA+PW4ubGVuZ3RoKXJldHVybiBILk9IKG4sMCkKdD1wLmEK
+bj1uWzBdKzEKcz1DLnhCLlhVKHQsIj8iLG4pCnI9dC5sZW5ndGgKaWYocz49MCl7cT1QLlBJKHQscysx
+LHIsQy5WQywhMSkKcj1zfWVsc2UgcT1vCnJldHVybiBwLmM9bmV3IFAucWUoImRhdGEiLG8sbyxvLFAu
+UEkodCxuLHIsQy5XZCwhMSkscSxvKX0sCnc6ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlzLmIKaWYoMD49
+cy5sZW5ndGgpcmV0dXJuIEguT0gocywwKQp0PXRoaXMuYQpyZXR1cm4gc1swXT09PS0xPyJkYXRhOiIr
+dDp0fX0KUC5xMy5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFVpbnQ4QXJyYXko
+OTYpfSwKJFM6MjN9ClAueUkucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEK
+aWYoYT49dC5sZW5ndGgpcmV0dXJuIEguT0godCxhKQp0PXRbYV0KSi5DTSh0LDAsOTYsYikKcmV0dXJu
+IHR9LAokUzoyNH0KUC5jNi5wcm90b3R5cGU9ewokMzpmdW5jdGlvbihhLGIsYyl7dmFyIHQscyxyLHEK
+Zm9yKHQ9Yi5sZW5ndGgscz1hLmxlbmd0aCxyPTA7cjx0Oysrcil7cT1DLnhCLlcoYixyKV45NgppZihx
+Pj1zKXJldHVybiBILk9IKGEscSkKYVtxXT1jfX19ClAucWQucHJvdG90eXBlPXsKJDM6ZnVuY3Rpb24o
+YSxiLGMpe3ZhciB0LHMscixxCmZvcih0PUMueEIuVyhiLDApLHM9Qy54Qi5XKGIsMSkscj1hLmxlbmd0
+aDt0PD1zOysrdCl7cT0odF45Nik+Pj4wCmlmKHE+PXIpcmV0dXJuIEguT0goYSxxKQphW3FdPWN9fX0K
+UC5VZi5wcm90b3R5cGU9ewpnY2o6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5jPjB9LApneEE6ZnVuY3Rp
+b24oKXt2YXIgdCxzCmlmKHRoaXMuYz4wKXt0PXRoaXMuZAppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJl
+dHVybiB0LmgoKQpzPXRoaXMuZQppZih0eXBlb2YgcyE9PSJudW1iZXIiKXJldHVybiBILnBZKHMpCnM9
+dCsxPHMKdD1zfWVsc2UgdD0hMQpyZXR1cm4gdH0sCmdRRDpmdW5jdGlvbigpe3ZhciB0PXRoaXMuZgpp
+Zih0eXBlb2YgdCE9PSJudW1iZXIiKXJldHVybiB0LkooKQpyZXR1cm4gdDx0aGlzLnJ9LApnWjg6ZnVu
+Y3Rpb24oKXtyZXR1cm4gdGhpcy5yPHRoaXMuYS5sZW5ndGh9LApnTnc6ZnVuY3Rpb24oKXtyZXR1cm4g
+dGhpcy5iPT09NCYmQy54Qi5uKHRoaXMuYSwiZmlsZSIpfSwKZ3ZoOmZ1bmN0aW9uKCl7cmV0dXJuIHRo
+aXMuYj09PTQmJkMueEIubih0aGlzLmEsImh0dHAiKX0sCmdSZTpmdW5jdGlvbigpe3JldHVybiB0aGlz
+LmI9PT01JiZDLnhCLm4odGhpcy5hLCJodHRwcyIpfSwKZ3RUOmZ1bmN0aW9uKCl7cmV0dXJuIEMueEIu
+UWkodGhpcy5hLCIvIix0aGlzLmUpfSwKZ0ZpOmZ1bmN0aW9uKCl7dmFyIHQscz10aGlzLHI9InBhY2th
+Z2UiLHE9cy5iCmlmKHE8PTApcmV0dXJuIiIKdD1zLngKaWYodCE9bnVsbClyZXR1cm4gdAppZihzLmd2
+aCgpKXE9cy54PSJodHRwIgplbHNlIGlmKHMuZ1JlKCkpe3MueD0iaHR0cHMiCnE9Imh0dHBzIn1lbHNl
+IGlmKHMuZ053KCkpe3MueD0iZmlsZSIKcT0iZmlsZSJ9ZWxzZSBpZihxPT09NyYmQy54Qi5uKHMuYSxy
+KSl7cy54PXIKcT1yfWVsc2V7cT1DLnhCLk5qKHMuYSwwLHEpCnMueD1xfXJldHVybiBxfSwKZ2t1OmZ1
+bmN0aW9uKCl7dmFyIHQ9dGhpcy5jLHM9dGhpcy5iKzMKcmV0dXJuIHQ+cz9DLnhCLk5qKHRoaXMuYSxz
+LHQtMSk6IiJ9LApnSmY6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5jCnJldHVybiB0PjA/Qy54Qi5Oaih0
+aGlzLmEsdCx0aGlzLmQpOiIifSwKZ3RwOmZ1bmN0aW9uKGEpe3ZhciB0LHM9dGhpcwppZihzLmd4QSgp
+KXt0PXMuZAppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJldHVybiB0LmgoKQpyZXR1cm4gUC5RQShDLnhC
+Lk5qKHMuYSx0KzEscy5lKSxudWxsLG51bGwpfWlmKHMuZ3ZoKCkpcmV0dXJuIDgwCmlmKHMuZ1JlKCkp
+cmV0dXJuIDQ0MwpyZXR1cm4gMH0sCmdJaTpmdW5jdGlvbihhKXtyZXR1cm4gQy54Qi5Oaih0aGlzLmEs
+dGhpcy5lLHRoaXMuZil9LApndFA6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLmYscz10aGlzLnIKaWYodHlw
+ZW9mIHQhPT0ibnVtYmVyIilyZXR1cm4gdC5KKCkKcmV0dXJuIHQ8cz9DLnhCLk5qKHRoaXMuYSx0KzEs
+cyk6IiJ9LApnS2E6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLnIscz10aGlzLmEKcmV0dXJuIHQ8cy5sZW5n
+dGg/Qy54Qi5HKHMsdCsxKToiIn0sCmdGajpmdW5jdGlvbigpe3ZhciB0LHMscj10aGlzLmUscT10aGlz
+LmYscD10aGlzLmEKaWYoQy54Qi5RaShwLCIvIixyKSl7aWYodHlwZW9mIHIhPT0ibnVtYmVyIilyZXR1
+cm4gci5oKCk7KytyfWlmKHI9PXEpcmV0dXJuIEMueEQKdD1ILlZNKFtdLHUucykKcz1yCndoaWxlKCEw
+KXtpZih0eXBlb2YgcyE9PSJudW1iZXIiKXJldHVybiBzLkooKQppZih0eXBlb2YgcSE9PSJudW1iZXIi
+KXJldHVybiBILnBZKHEpCmlmKCEoczxxKSlicmVhawppZihDLnhCLm0ocCxzKT09PTQ3KXtDLk5tLmko
+dCxDLnhCLk5qKHAscixzKSkKcj1zKzF9KytzfUMuTm0uaSh0LEMueEIuTmoocCxyLHEpKQpyZXR1cm4g
+UC5BRih0LHUuTil9LApnaFk6ZnVuY3Rpb24oKXt2YXIgdD10aGlzLmYKaWYodHlwZW9mIHQhPT0ibnVt
+YmVyIilyZXR1cm4gdC5KKCkKaWYodD49dGhpcy5yKXJldHVybiBDLldPCnJldHVybiBuZXcgUC5HaihQ
+LldYKHRoaXMuZ3RQKCkpLHUuVyl9LAprWDpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMuZAppZih0eXBl
+b2YgcyE9PSJudW1iZXIiKXJldHVybiBzLmgoKQp0PXMrMQpyZXR1cm4gdCthLmxlbmd0aD09PXRoaXMu
+ZSYmQy54Qi5RaSh0aGlzLmEsYSx0KX0sCk45OmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcyxzPXQucixyPXQu
+YQppZihzPj1yLmxlbmd0aClyZXR1cm4gdApyZXR1cm4gbmV3IFAuVWYoQy54Qi5OaihyLDAscyksdC5i
+LHQuYyx0LmQsdC5lLHQuZixzLHQueCl9LApubTpmdW5jdGlvbihhLGIpe3ZhciB0LHMscixxLHAsbyxu
+LG0sbCxrLGo9dGhpcyxpPW51bGwKdS5YLmIobnVsbCkKdS5rLmIoYikKdD1qLmdGaSgpCnM9dD09PSJm
+aWxlIgpyPWouYwpxPXI+MD9DLnhCLk5qKGouYSxqLmIrMyxyKToiIgpwPWouZ3hBKCk/ai5ndHAoaik6
+aQpyPWouYwppZihyPjApbz1DLnhCLk5qKGouYSxyLGouZCkKZWxzZSBvPXEubGVuZ3RoIT09MHx8cCE9
+bnVsbHx8cz8iIjppCnI9ai5hCm49Qy54Qi5OaihyLGouZSxqLmYpCmlmKCFzKW09byE9bnVsbCYmbi5s
+ZW5ndGghPT0wCmVsc2UgbT0hMAppZihtJiYhQy54Qi5uKG4sIi8iKSluPSIvIituCmw9UC5sZShpLDAs
+MCxiKQptPWoucgprPW08ci5sZW5ndGg/Qy54Qi5HKHIsbSsxKTppCnJldHVybiBuZXcgUC5Ebih0LHEs
+byxwLG4sbCxrKX0sClpJOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLm1TKFAuaEsoYSkpfSwKbVM6ZnVu
+Y3Rpb24oYSl7aWYoYSBpbnN0YW5jZW9mIFAuVWYpcmV0dXJuIHRoaXMudTEodGhpcyxhKQpyZXR1cm4g
+dGhpcy52cygpLm1TKGEpfSwKdTE6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG8sbixtLGwsayxq
+LGksaCxnLGYsZT1iLmIKaWYoZT4wKXJldHVybiBiCnQ9Yi5jCmlmKHQ+MCl7cz1hLmIKaWYoczw9MCly
+ZXR1cm4gYgppZihhLmdOdygpKXI9Yi5lIT1iLmYKZWxzZSBpZihhLmd2aCgpKXI9IWIua1goIjgwIikK
+ZWxzZSByPSFhLmdSZSgpfHwhYi5rWCgiNDQzIikKaWYocil7cT1zKzEKcD1DLnhCLk5qKGEuYSwwLHEp
+K0MueEIuRyhiLmEsZSsxKQplPWIuZAppZih0eXBlb2YgZSE9PSJudW1iZXIiKXJldHVybiBlLmgoKQpv
+PWIuZQppZih0eXBlb2YgbyE9PSJudW1iZXIiKXJldHVybiBvLmgoKQpuPWIuZgppZih0eXBlb2YgbiE9
+PSJudW1iZXIiKXJldHVybiBuLmgoKQpyZXR1cm4gbmV3IFAuVWYocCxzLHQrcSxlK3EsbytxLG4rcSxi
+LnIrcSxhLngpfWVsc2UgcmV0dXJuIHRoaXMudnMoKS5tUyhiKX1tPWIuZQplPWIuZgppZihtPT1lKXt0
+PWIucgppZih0eXBlb2YgZSE9PSJudW1iZXIiKXJldHVybiBlLkooKQppZihlPHQpe3M9YS5mCmlmKHR5
+cGVvZiBzIT09Im51bWJlciIpcmV0dXJuIHMuSE4oKQpxPXMtZQpyZXR1cm4gbmV3IFAuVWYoQy54Qi5O
+aihhLmEsMCxzKStDLnhCLkcoYi5hLGUpLGEuYixhLmMsYS5kLGEuZSxlK3EsdCtxLGEueCl9ZT1iLmEK
+aWYodDxlLmxlbmd0aCl7cz1hLnIKcmV0dXJuIG5ldyBQLlVmKEMueEIuTmooYS5hLDAscykrQy54Qi5H
+KGUsdCksYS5iLGEuYyxhLmQsYS5lLGEuZix0KyhzLXQpLGEueCl9cmV0dXJuIGEuTjkoKX10PWIuYQpp
+ZihDLnhCLlFpKHQsIi8iLG0pKXtzPWEuZQppZih0eXBlb2YgcyE9PSJudW1iZXIiKXJldHVybiBzLkhO
+KCkKaWYodHlwZW9mIG0hPT0ibnVtYmVyIilyZXR1cm4gSC5wWShtKQpxPXMtbQpwPUMueEIuTmooYS5h
+LDAscykrQy54Qi5HKHQsbSkKaWYodHlwZW9mIGUhPT0ibnVtYmVyIilyZXR1cm4gZS5oKCkKcmV0dXJu
+IG5ldyBQLlVmKHAsYS5iLGEuYyxhLmQscyxlK3EsYi5yK3EsYS54KX1sPWEuZQprPWEuZgppZihsPT1r
+JiZhLmM+MCl7Zm9yKDtDLnhCLlFpKHQsIi4uLyIsbSk7KXtpZih0eXBlb2YgbSE9PSJudW1iZXIiKXJl
+dHVybiBtLmgoKQptKz0zfWlmKHR5cGVvZiBsIT09Im51bWJlciIpcmV0dXJuIGwuSE4oKQppZih0eXBl
+b2YgbSE9PSJudW1iZXIiKXJldHVybiBILnBZKG0pCnE9bC1tKzEKcD1DLnhCLk5qKGEuYSwwLGwpKyIv
+IitDLnhCLkcodCxtKQppZih0eXBlb2YgZSE9PSJudW1iZXIiKXJldHVybiBlLmgoKQpyZXR1cm4gbmV3
+IFAuVWYocCxhLmIsYS5jLGEuZCxsLGUrcSxiLnIrcSxhLngpfWo9YS5hCmZvcihpPWw7Qy54Qi5RaShq
+LCIuLi8iLGkpOyl7aWYodHlwZW9mIGkhPT0ibnVtYmVyIilyZXR1cm4gaS5oKCkKaSs9M31oPTAKd2hp
+bGUoITApe2lmKHR5cGVvZiBtIT09Im51bWJlciIpcmV0dXJuIG0uaCgpCmc9bSszCmlmKHR5cGVvZiBl
+IT09Im51bWJlciIpcmV0dXJuIEgucFkoZSkKaWYoIShnPD1lJiZDLnhCLlFpKHQsIi4uLyIsbSkpKWJy
+ZWFrOysraAptPWd9Zj0iIgp3aGlsZSghMCl7aWYodHlwZW9mIGshPT0ibnVtYmVyIilyZXR1cm4gay5v
+cygpCmlmKHR5cGVvZiBpIT09Im51bWJlciIpcmV0dXJuIEgucFkoaSkKaWYoIShrPmkpKWJyZWFrOy0t
+awppZihDLnhCLm0oaixrKT09PTQ3KXtpZihoPT09MCl7Zj0iLyIKYnJlYWt9LS1oCmY9Ii8ifX1pZihr
+PT09aSYmYS5iPD0wJiYhQy54Qi5RaShqLCIvIixsKSl7bS09aCozCmY9IiJ9cT1rLW0rZi5sZW5ndGgK
+cmV0dXJuIG5ldyBQLlVmKEMueEIuTmooaiwwLGspK2YrQy54Qi5HKHQsbSksYS5iLGEuYyxhLmQsbCxl
+K3EsYi5yK3EsYS54KX0sCnQ0OmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscD10aGlzCmlmKHAuYj49MCYm
+IXAuZ053KCkpdGhyb3cgSC5iKFAuTDQoIkNhbm5vdCBleHRyYWN0IGEgZmlsZSBwYXRoIGZyb20gYSAi
+K0guZChwLmdGaSgpKSsiIFVSSSIpKQp0PXAuZgpzPXAuYQppZih0eXBlb2YgdCE9PSJudW1iZXIiKXJl
+dHVybiB0LkooKQppZih0PHMubGVuZ3RoKXtpZih0PHAucil0aHJvdyBILmIoUC5MNCgiQ2Fubm90IGV4
+dHJhY3QgYSBmaWxlIHBhdGggZnJvbSBhIFVSSSB3aXRoIGEgcXVlcnkgY29tcG9uZW50IikpCnRocm93
+IEguYihQLkw0KCJDYW5ub3QgZXh0cmFjdCBhIGZpbGUgcGF0aCBmcm9tIGEgVVJJIHdpdGggYSBmcmFn
+bWVudCBjb21wb25lbnQiKSl9cj0kLndRKCkKaWYoSC5vVChyKSl0PVAubW4ocCkKZWxzZXtxPXAuZApp
+Zih0eXBlb2YgcSE9PSJudW1iZXIiKXJldHVybiBILnBZKHEpCmlmKHAuYzxxKUgudmgoUC5MNCgiQ2Fu
+bm90IGV4dHJhY3QgYSBub24tV2luZG93cyBmaWxlIHBhdGggZnJvbSBhIGZpbGUgVVJJIHdpdGggYW4g
+YXV0aG9yaXR5IikpCnQ9Qy54Qi5OaihzLHAuZSx0KX1yZXR1cm4gdH0sCmdpTzpmdW5jdGlvbihhKXt2
+YXIgdD10aGlzLnkKcmV0dXJuIHQ9PW51bGw/dGhpcy55PUMueEIuZ2lPKHRoaXMuYSk6dH0sCkROOmZ1
+bmN0aW9uKGEsYil7aWYoYj09bnVsbClyZXR1cm4hMQppZih0aGlzPT09YilyZXR1cm4hMApyZXR1cm4g
+dS52LmMoYikmJnRoaXMuYT09PWIudygwKX0sCnZzOmZ1bmN0aW9uKCl7dmFyIHQ9dGhpcyxzPW51bGws
+cj10LmdGaSgpLHE9dC5na3UoKSxwPXQuYz4wP3QuZ0pmKHQpOnMsbz10Lmd4QSgpP3QuZ3RwKHQpOnMs
+bj10LmEsbT10LmYsbD1DLnhCLk5qKG4sdC5lLG0pLGs9dC5yCmlmKHR5cGVvZiBtIT09Im51bWJlciIp
+cmV0dXJuIG0uSigpCm09bTxrP3QuZ3RQKCk6cwpyZXR1cm4gbmV3IFAuRG4ocixxLHAsbyxsLG0sazxu
+Lmxlbmd0aD90LmdLYSgpOnMpfSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hfSwKJGlpRDoxfQpQ
+LnFlLnByb3RvdHlwZT17fQpXLnFFLnByb3RvdHlwZT17fQpXLkdoLnByb3RvdHlwZT17Cnc6ZnVuY3Rp
+b24oYSl7cmV0dXJuIFN0cmluZyhhKX0sCiRpR2g6MX0KVy5mWS5wcm90b3R5cGU9ewp3OmZ1bmN0aW9u
+KGEpe3JldHVybiBTdHJpbmcoYSl9fQpXLm5CLnByb3RvdHlwZT17JGluQjoxfQpXLkF6LnByb3RvdHlw
+ZT17JGlBejoxfQpXLlFQLnByb3RvdHlwZT17JGlRUDoxfQpXLm54LnByb3RvdHlwZT17CmdBOmZ1bmN0
+aW9uKGEpe3JldHVybiBhLmxlbmd0aH19Clcub0oucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0
+dXJuIGEubGVuZ3RofX0KVy5pZC5wcm90b3R5cGU9e30KVy5RRi5wcm90b3R5cGU9e30KVy5OaC5wcm90
+b3R5cGU9ewp3OmZ1bmN0aW9uKGEpe3JldHVybiBTdHJpbmcoYSl9fQpXLklCLnByb3RvdHlwZT17Cnc6
+ZnVuY3Rpb24oYSl7cmV0dXJuIlJlY3RhbmdsZSAoIitILmQoYS5sZWZ0KSsiLCAiK0guZChhLnRvcCkr
+IikgIitILmQoYS53aWR0aCkrIiB4ICIrSC5kKGEuaGVpZ2h0KX0sCkROOmZ1bmN0aW9uKGEsYil7aWYo
+Yj09bnVsbClyZXR1cm4hMQpyZXR1cm4gdS5xLmMoYikmJmEubGVmdD09PWIubGVmdCYmYS50b3A9PT1i
+LnRvcCYmYS53aWR0aD09PWIud2lkdGgmJmEuaGVpZ2h0PT09Yi5oZWlnaHR9LApnaU86ZnVuY3Rpb24o
+YSl7cmV0dXJuIFcuckUoQy5DRC5naU8oYS5sZWZ0KSxDLkNELmdpTyhhLnRvcCksQy5DRC5naU8oYS53
+aWR0aCksQy5DRC5naU8oYS5oZWlnaHQpKX0sCiRpdG46MX0KVy5uNy5wcm90b3R5cGU9ewpnQTpmdW5j
+dGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9fQpXLnd6LnByb3RvdHlwZT17CmdBOmZ1bmN0aW9uKGEpe3Jl
+dHVybiB0aGlzLmEubGVuZ3RofSwKcTpmdW5jdGlvbihhLGIpe3ZhciB0CkguU2MoYikKdD10aGlzLmEK
+aWYoYjwwfHxiPj10Lmxlbmd0aClyZXR1cm4gSC5PSCh0LGIpCnJldHVybiB0aGlzLiR0aS5kLmIodFti
+XSl9LApZOmZ1bmN0aW9uKGEsYixjKXt0aGlzLiR0aS5kLmIoYykKdGhyb3cgSC5iKFAuTDQoIkNhbm5v
+dCBtb2RpZnkgbGlzdCIpKX19ClcuY3YucHJvdG90eXBlPXsKZ1FnOmZ1bmN0aW9uKGEpe3JldHVybiBu
+ZXcgVy5pNyhhKX0sCmdQOmZ1bmN0aW9uKGEpe3JldHVybiBuZXcgVy5JNChhKX0sCnNQOmZ1bmN0aW9u
+KGEsYil7dmFyIHQKdS5YLmIoYikKdD10aGlzLmdQKGEpCnQuVjEoMCkKdC5GVigwLGIpfSwKdzpmdW5j
+dGlvbihhKXtyZXR1cm4gYS5sb2NhbE5hbWV9LApGRjpmdW5jdGlvbihhKXt2YXIgdD0hIWEuc2Nyb2xs
+SW50b1ZpZXdJZk5lZWRlZAppZih0KWEuc2Nyb2xsSW50b1ZpZXdJZk5lZWRlZCgpCmVsc2UgYS5zY3Jv
+bGxJbnRvVmlldygpfSwKbno6ZnVuY3Rpb24oYSxiLGMsZCxlKXt2YXIgdCxzPXRoaXMucjYoYSxjLGQs
+ZSkKc3dpdGNoKGIudG9Mb3dlckNhc2UoKSl7Y2FzZSJiZWZvcmViZWdpbiI6YS5wYXJlbnROb2RlLmlu
+c2VydEJlZm9yZShzLGEpCmJyZWFrCmNhc2UiYWZ0ZXJiZWdpbiI6dD1hLmNoaWxkTm9kZXMKYS5pbnNl
+cnRCZWZvcmUocyx0Lmxlbmd0aD4wP3RbMF06bnVsbCkKYnJlYWsKY2FzZSJiZWZvcmVlbmQiOmEuYXBw
+ZW5kQ2hpbGQocykKYnJlYWsKY2FzZSJhZnRlcmVuZCI6YS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShz
+LGEubmV4dFNpYmxpbmcpCmJyZWFrCmRlZmF1bHQ6SC52aChQLnhZKCJJbnZhbGlkIHBvc2l0aW9uICIr
+YikpfX0sCnI2OmZ1bmN0aW9uKGEsYixjLGQpe3ZhciB0LHMscixxCmlmKGM9PW51bGwpe2lmKGQ9PW51
+bGwpe3Q9JC5sdAppZih0PT1udWxsKXt0PUguVk0oW10sdS5pKQpzPW5ldyBXLnZEKHQpCkMuTm0uaSh0
+LFcuVHcobnVsbCkpCkMuTm0uaSh0LFcuQmwoKSkKJC5sdD1zCmQ9c31lbHNlIGQ9dH10PSQuRVUKaWYo
+dD09bnVsbCl7dD1uZXcgVy5LbyhkKQokLkVVPXQKYz10fWVsc2V7dC5hPWQKYz10fX1lbHNlIGlmKGQh
+PW51bGwpdGhyb3cgSC5iKFAueFkoInZhbGlkYXRvciBjYW4gb25seSBiZSBwYXNzZWQgaWYgdHJlZVNh
+bml0aXplciBpcyBudWxsIikpCmlmKCQueG89PW51bGwpe3Q9ZG9jdW1lbnQKcz10LmltcGxlbWVudGF0
+aW9uLmNyZWF0ZUhUTUxEb2N1bWVudCgiIikKJC54bz1zCiQuQk89cy5jcmVhdGVSYW5nZSgpCnM9JC54
+by5jcmVhdGVFbGVtZW50KCJiYXNlIikKdS5jUi5iKHMpCnMuaHJlZj10LmJhc2VVUkkKJC54by5oZWFk
+LmFwcGVuZENoaWxkKHMpfXQ9JC54bwppZih0LmJvZHk9PW51bGwpe3M9dC5jcmVhdGVFbGVtZW50KCJi
+b2R5IikKdC5ib2R5PXUuWS5iKHMpfXQ9JC54bwppZih1LlkuYyhhKSlyPXQuYm9keQplbHNle3I9dC5j
+cmVhdGVFbGVtZW50KGEudGFnTmFtZSkKJC54by5ib2R5LmFwcGVuZENoaWxkKHIpfWlmKCJjcmVhdGVD
+b250ZXh0dWFsRnJhZ21lbnQiIGluIHdpbmRvdy5SYW5nZS5wcm90b3R5cGUmJiFDLk5tLnRnKEMuU3Es
+YS50YWdOYW1lKSl7JC5CTy5zZWxlY3ROb2RlQ29udGVudHMocikKcT0kLkJPLmNyZWF0ZUNvbnRleHR1
+YWxGcmFnbWVudChiKX1lbHNle3IuaW5uZXJIVE1MPWIKcT0kLnhvLmNyZWF0ZURvY3VtZW50RnJhZ21l
+bnQoKQpmb3IoO3Q9ci5maXJzdENoaWxkLHQhPW51bGw7KXEuYXBwZW5kQ2hpbGQodCl9dD0kLnhvLmJv
+ZHkKaWYocj09bnVsbD90IT1udWxsOnIhPT10KUouTHQocikKYy5QbihxKQpkb2N1bWVudC5hZG9wdE5v
+ZGUocSkKcmV0dXJuIHF9LApBSDpmdW5jdGlvbihhLGIsYyl7cmV0dXJuIHRoaXMucjYoYSxiLGMsbnVs
+bCl9LApzaGY6ZnVuY3Rpb24oYSxiKXt0aGlzLllDKGEsYil9LApwazpmdW5jdGlvbihhLGIsYyl7YS50
+ZXh0Q29udGVudD1udWxsCmEuYXBwZW5kQ2hpbGQodGhpcy5yNihhLGIsbnVsbCxjKSl9LApZQzpmdW5j
+dGlvbihhLGIpe3JldHVybiB0aGlzLnBrKGEsYixudWxsKX0sCmdWbDpmdW5jdGlvbihhKXtyZXR1cm4g
+bmV3IFcuZXUoYSwiY2xpY2siLCExLHUuUSl9LAokaWN2OjEsCmduczpmdW5jdGlvbihhKXtyZXR1cm4g
+YS50YWdOYW1lfX0KVy5Ddi5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gdS5oLmModS5B
+LmIoYSkpfSwKJFM6MjV9ClcuZWEucHJvdG90eXBlPXskaWVhOjF9ClcuRDAucHJvdG90eXBlPXsKT246
+ZnVuY3Rpb24oYSxiLGMsZCl7dS5VLmIoYykKaWYoYyE9bnVsbCl0aGlzLnYoYSxiLGMsZCl9LApCOmZ1
+bmN0aW9uKGEsYixjKXtyZXR1cm4gdGhpcy5PbihhLGIsYyxudWxsKX0sCnY6ZnVuY3Rpb24oYSxiLGMs
+ZCl7cmV0dXJuIGEuYWRkRXZlbnRMaXN0ZW5lcihiLEgudFIodS5VLmIoYyksMSksZCl9LAokaUQwOjF9
+ClcuaEgucHJvdG90eXBlPXskaWhIOjF9ClcuaDQucHJvdG90eXBlPXsKZ0E6ZnVuY3Rpb24oYSl7cmV0
+dXJuIGEubGVuZ3RofX0KVy5ici5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5n
+dGh9fQpXLlZiLnByb3RvdHlwZT17fQpXLk83LnByb3RvdHlwZT17CmVvOmZ1bmN0aW9uKGEsYixjLGQp
+e3JldHVybiBhLm9wZW4oYixjLCEwKX0sCiRpTzc6MX0KVy53YS5wcm90b3R5cGU9e30KVy5TZy5wcm90
+b3R5cGU9eyRpU2c6MX0KVy51OC5wcm90b3R5cGU9ewpnRHI6ZnVuY3Rpb24oYSl7aWYoIm9yaWdpbiIg
+aW4gYSlyZXR1cm4gYS5vcmlnaW4KcmV0dXJuIEguZChhLnByb3RvY29sKSsiLy8iK0guZChhLmhvc3Qp
+fSwKdzpmdW5jdGlvbihhKXtyZXR1cm4gU3RyaW5nKGEpfSwKJGl1ODoxfQpXLkFqLnByb3RvdHlwZT17
+JGlBajoxfQpXLmU3LnByb3RvdHlwZT17CmdyODpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEscz10LmNo
+aWxkTm9kZXMubGVuZ3RoCmlmKHM9PT0wKXRocm93IEguYihQLlBWKCJObyBlbGVtZW50cyIpKQppZihz
+PjEpdGhyb3cgSC5iKFAuUFYoIk1vcmUgdGhhbiBvbmUgZWxlbWVudCIpKQpyZXR1cm4gdC5maXJzdENo
+aWxkfSwKRlY6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscQp1LmVoLmIoYikKdD1iLmEKcz10aGlzLmEK
+aWYodCE9PXMpZm9yKHI9dC5jaGlsZE5vZGVzLmxlbmd0aCxxPTA7cTxyOysrcSlzLmFwcGVuZENoaWxk
+KHQuZmlyc3RDaGlsZCkKcmV0dXJufSwKWTpmdW5jdGlvbihhLGIsYyl7dmFyIHQscwp1LkEuYihjKQp0
+PXRoaXMuYQpzPXQuY2hpbGROb2RlcwppZihiPDB8fGI+PXMubGVuZ3RoKXJldHVybiBILk9IKHMsYikK
+dC5yZXBsYWNlQ2hpbGQoYyxzW2JdKX0sCmdrejpmdW5jdGlvbihhKXt2YXIgdD10aGlzLmEuY2hpbGRO
+b2RlcwpyZXR1cm4gbmV3IFcuVzkodCx0Lmxlbmd0aCxILnpLKHQpLkMoIlc5PEdtLkU+IikpfSwKZ0E6
+ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS5jaGlsZE5vZGVzLmxlbmd0aH0sCnE6ZnVuY3Rpb24oYSxi
+KXt2YXIgdApILlNjKGIpCnQ9dGhpcy5hLmNoaWxkTm9kZXMKaWYoYjwwfHxiPj10Lmxlbmd0aClyZXR1
+cm4gSC5PSCh0LGIpCnJldHVybiB0W2JdfX0KVy51SC5wcm90b3R5cGU9ewp3ZzpmdW5jdGlvbihhKXt2
+YXIgdD1hLnBhcmVudE5vZGUKaWYodCE9bnVsbCl0LnJlbW92ZUNoaWxkKGEpfSwKRDQ6ZnVuY3Rpb24o
+YSl7dmFyIHQKZm9yKDt0PWEuZmlyc3RDaGlsZCx0IT1udWxsOylhLnJlbW92ZUNoaWxkKHQpfSwKdzpm
+dW5jdGlvbihhKXt2YXIgdD1hLm5vZGVWYWx1ZQpyZXR1cm4gdD09bnVsbD90aGlzLlUoYSk6dH0sCiRp
+dUg6MX0KVy5CSC5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9LApxOmZ1
+bmN0aW9uKGEsYil7SC5TYyhiKQppZihiPj4+MCE9PWJ8fGI+PWEubGVuZ3RoKXRocm93IEguYihQLkNm
+KGIsYSxudWxsLG51bGwsbnVsbCkpCnJldHVybiBhW2JdfSwKWTpmdW5jdGlvbihhLGIsYyl7dS5BLmIo
+YykKdGhyb3cgSC5iKFAuTDQoIkNhbm5vdCBhc3NpZ24gZWxlbWVudCBvZiBpbW11dGFibGUgTGlzdC4i
+KSl9LApndEg6ZnVuY3Rpb24oYSl7aWYoYS5sZW5ndGg+MClyZXR1cm4gYVswXQp0aHJvdyBILmIoUC5Q
+VigiTm8gZWxlbWVudHMiKSl9LApFOmZ1bmN0aW9uKGEsYil7aWYoYjwwfHxiPj1hLmxlbmd0aClyZXR1
+cm4gSC5PSChhLGIpCnJldHVybiBhW2JdfSwKJGliUToxLAokaVhqOjEsCiRpY1g6MSwKJGl6TToxfQpX
+LlNOLnByb3RvdHlwZT17fQpXLmV3LnByb3RvdHlwZT17JGlldzoxfQpXLmxwLnByb3RvdHlwZT17CmdB
+OmZ1bmN0aW9uKGEpe3JldHVybiBhLmxlbmd0aH19ClcuVGIucHJvdG90eXBlPXsKcjY6ZnVuY3Rpb24o
+YSxiLGMsZCl7dmFyIHQscwppZigiY3JlYXRlQ29udGV4dHVhbEZyYWdtZW50IiBpbiB3aW5kb3cuUmFu
+Z2UucHJvdG90eXBlKXJldHVybiB0aGlzLkRXKGEsYixjLGQpCnQ9Vy5VOSgiPHRhYmxlPiIrSC5kKGIp
+KyI8L3RhYmxlPiIsYyxkKQpzPWRvY3VtZW50LmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKQpzLnRvU3Ry
+aW5nCnQudG9TdHJpbmcKbmV3IFcuZTcocykuRlYoMCxuZXcgVy5lNyh0KSkKcmV0dXJuIHN9fQpXLkl2
+LnByb3RvdHlwZT17CnI2OmZ1bmN0aW9uKGEsYixjLGQpe3ZhciB0LHMscixxCmlmKCJjcmVhdGVDb250
+ZXh0dWFsRnJhZ21lbnQiIGluIHdpbmRvdy5SYW5nZS5wcm90b3R5cGUpcmV0dXJuIHRoaXMuRFcoYSxi
+LGMsZCkKdD1kb2N1bWVudApzPXQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpCnQ9Qy5JZS5yNih0LmNy
+ZWF0ZUVsZW1lbnQoInRhYmxlIiksYixjLGQpCnQudG9TdHJpbmcKdD1uZXcgVy5lNyh0KQpyPXQuZ3I4
+KHQpCnIudG9TdHJpbmcKdD1uZXcgVy5lNyhyKQpxPXQuZ3I4KHQpCnMudG9TdHJpbmcKcS50b1N0cmlu
+ZwpuZXcgVy5lNyhzKS5GVigwLG5ldyBXLmU3KHEpKQpyZXR1cm4gc319ClcuV1AucHJvdG90eXBlPXsK
+cjY6ZnVuY3Rpb24oYSxiLGMsZCl7dmFyIHQscyxyCmlmKCJjcmVhdGVDb250ZXh0dWFsRnJhZ21lbnQi
+IGluIHdpbmRvdy5SYW5nZS5wcm90b3R5cGUpcmV0dXJuIHRoaXMuRFcoYSxiLGMsZCkKdD1kb2N1bWVu
+dApzPXQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpCnQ9Qy5JZS5yNih0LmNyZWF0ZUVsZW1lbnQoInRh
+YmxlIiksYixjLGQpCnQudG9TdHJpbmcKdD1uZXcgVy5lNyh0KQpyPXQuZ3I4KHQpCnMudG9TdHJpbmcK
+ci50b1N0cmluZwpuZXcgVy5lNyhzKS5GVigwLG5ldyBXLmU3KHIpKQpyZXR1cm4gc319ClcueVkucHJv
+dG90eXBlPXsKcGs6ZnVuY3Rpb24oYSxiLGMpe3ZhciB0LHMKYS50ZXh0Q29udGVudD1udWxsCnQ9YS5j
+b250ZW50CnQudG9TdHJpbmcKSi5iVCh0KQpzPXRoaXMucjYoYSxiLG51bGwsYykKYS5jb250ZW50LmFw
+cGVuZENoaWxkKHMpfSwKWUM6ZnVuY3Rpb24oYSxiKXtyZXR1cm4gdGhpcy5wayhhLGIsbnVsbCl9LAok
+aXlZOjF9ClcudzYucHJvdG90eXBlPXt9ClcuSzUucHJvdG90eXBlPXsKUG86ZnVuY3Rpb24oYSxiLGMp
+e3ZhciB0PVcuUDEoYS5vcGVuKGIsYykpCnJldHVybiB0fSwKZ21XOmZ1bmN0aW9uKGEpe3JldHVybiBh
+LmxvY2F0aW9ufSwKJGlLNToxLAokaXY2OjF9ClcuQ20ucHJvdG90eXBlPXskaUNtOjF9ClcuQ1EucHJv
+dG90eXBlPXskaUNROjF9ClcudzQucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4iUmVjdGFu
+Z2xlICgiK0guZChhLmxlZnQpKyIsICIrSC5kKGEudG9wKSsiKSAiK0guZChhLndpZHRoKSsiIHggIitI
+LmQoYS5oZWlnaHQpfSwKRE46ZnVuY3Rpb24oYSxiKXtpZihiPT1udWxsKXJldHVybiExCnJldHVybiB1
+LnEuYyhiKSYmYS5sZWZ0PT09Yi5sZWZ0JiZhLnRvcD09PWIudG9wJiZhLndpZHRoPT09Yi53aWR0aCYm
+YS5oZWlnaHQ9PT1iLmhlaWdodH0sCmdpTzpmdW5jdGlvbihhKXtyZXR1cm4gVy5yRShDLkNELmdpTyhh
+LmxlZnQpLEMuQ0QuZ2lPKGEudG9wKSxDLkNELmdpTyhhLndpZHRoKSxDLkNELmdpTyhhLmhlaWdodCkp
+fX0KVy5yaC5wcm90b3R5cGU9ewpnQTpmdW5jdGlvbihhKXtyZXR1cm4gYS5sZW5ndGh9LApxOmZ1bmN0
+aW9uKGEsYil7SC5TYyhiKQppZihiPj4+MCE9PWJ8fGI+PWEubGVuZ3RoKXRocm93IEguYihQLkNmKGIs
+YSxudWxsLG51bGwsbnVsbCkpCnJldHVybiBhW2JdfSwKWTpmdW5jdGlvbihhLGIsYyl7dS5BLmIoYykK
+dGhyb3cgSC5iKFAuTDQoIkNhbm5vdCBhc3NpZ24gZWxlbWVudCBvZiBpbW11dGFibGUgTGlzdC4iKSl9
+LApFOmZ1bmN0aW9uKGEsYil7aWYoYjwwfHxiPj1hLmxlbmd0aClyZXR1cm4gSC5PSChhLGIpCnJldHVy
+biBhW2JdfSwKJGliUToxLAokaVhqOjEsCiRpY1g6MSwKJGl6TToxfQpXLmNmLnByb3RvdHlwZT17Cks6
+ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwCnUuRi5iKGIpCmZvcih0PXRoaXMuZ1YoKSxzPXQubGVu
+Z3RoLHI9dGhpcy5hLHE9MDtxPHQubGVuZ3RoO3QubGVuZ3RoPT09c3x8KDAsSC5saykodCksKytxKXtw
+PXRbcV0KYi4kMihwLHIuZ2V0QXR0cmlidXRlKHApKX19LApnVjpmdW5jdGlvbigpe3ZhciB0LHMscixx
+LHA9dGhpcy5hLmF0dHJpYnV0ZXMsbz1ILlZNKFtdLHUucykKZm9yKHQ9cC5sZW5ndGgscz11Lmg5LHI9
+MDtyPHQ7KytyKXtpZihyPj1wLmxlbmd0aClyZXR1cm4gSC5PSChwLHIpCnE9cy5iKHBbcl0pCmlmKHEu
+bmFtZXNwYWNlVVJJPT1udWxsKUMuTm0uaShvLHEubmFtZSl9cmV0dXJuIG99LApnbDA6ZnVuY3Rpb24o
+YSl7cmV0dXJuIHRoaXMuZ1YoKS5sZW5ndGg9PT0wfX0KVy5pNy5wcm90b3R5cGU9ewp4NDpmdW5jdGlv
+bihhKXtyZXR1cm4gdGhpcy5hLmhhc0F0dHJpYnV0ZShhKX0sCnE6ZnVuY3Rpb24oYSxiKXtyZXR1cm4g
+dGhpcy5hLmdldEF0dHJpYnV0ZShILnkoYikpfSwKWTpmdW5jdGlvbihhLGIsYyl7dGhpcy5hLnNldEF0
+dHJpYnV0ZShiLGMpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuZ1YoKS5sZW5ndGh9fQpXLlN5
+LnByb3RvdHlwZT17Cng0OmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEuYS5oYXNBdHRyaWJ1dGUoImRh
+dGEtIit0aGlzLk8oYSkpfSwKcTpmdW5jdGlvbihhLGIpe3JldHVybiB0aGlzLmEuYS5nZXRBdHRyaWJ1
+dGUoImRhdGEtIit0aGlzLk8oSC55KGIpKSl9LApZOmZ1bmN0aW9uKGEsYixjKXt0aGlzLmEuYS5zZXRB
+dHRyaWJ1dGUoImRhdGEtIit0aGlzLk8oYiksYyl9LApLOmZ1bmN0aW9uKGEsYil7dGhpcy5hLksoMCxu
+ZXcgVy5LUyh0aGlzLHUuRi5iKGIpKSl9LApnVjpmdW5jdGlvbigpe3ZhciB0PUguVk0oW10sdS5zKQp0
+aGlzLmEuSygwLG5ldyBXLkEzKHRoaXMsdCkpCnJldHVybiB0fSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJu
+IHRoaXMuZ1YoKS5sZW5ndGh9LApnbDA6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuZ1YoKS5sZW5ndGg9
+PT0wfSwKazpmdW5jdGlvbihhKXt2YXIgdCxzLHI9SC5WTShhLnNwbGl0KCItIiksdS5zKQpmb3IodD0x
+O3Q8ci5sZW5ndGg7Kyt0KXtzPXJbdF0KaWYocy5sZW5ndGg+MClDLk5tLlkocix0LHNbMF0udG9VcHBl
+ckNhc2UoKStKLktWKHMsMSkpfXJldHVybiBDLk5tLkgociwiIil9LApPOmZ1bmN0aW9uKGEpe3ZhciB0
+LHMscixxLHAKZm9yKHQ9YS5sZW5ndGgscz0wLHI9IiI7czx0Oysrcyl7cT1hW3NdCnA9cS50b0xvd2Vy
+Q2FzZSgpCnI9KHEhPT1wJiZzPjA/cisiLSI6cikrcH1yZXR1cm4gci5jaGFyQ29kZUF0KDApPT0wP3I6
+cn19ClcuS1MucHJvdG90eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXtpZihKLnJZKGEpLm4oYSwiZGF0YS0i
+KSl0aGlzLmIuJDIodGhpcy5hLmsoQy54Qi5HKGEsNSkpLGIpfSwKJFM6MTR9ClcuQTMucHJvdG90eXBl
+PXsKJDI6ZnVuY3Rpb24oYSxiKXtpZihKLnJZKGEpLm4oYSwiZGF0YS0iKSlDLk5tLmkodGhpcy5iLHRo
+aXMuYS5rKEMueEIuRyhhLDUpKSl9LAokUzoxNH0KVy5JNC5wcm90b3R5cGU9ewpERzpmdW5jdGlvbigp
+e3ZhciB0LHMscixxLHA9UC5Mcyh1Lk4pCmZvcih0PXRoaXMuYS5jbGFzc05hbWUuc3BsaXQoIiAiKSxz
+PXQubGVuZ3RoLHI9MDtyPHM7KytyKXtxPUouVDAodFtyXSkKaWYocS5sZW5ndGghPT0wKXAuaSgwLHEp
+fXJldHVybiBwfSwKWDpmdW5jdGlvbihhKXt0aGlzLmEuY2xhc3NOYW1lPXUuQy5iKGEpLkgoMCwiICIp
+fSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuYS5jbGFzc0xpc3QubGVuZ3RofSwKVjE6ZnVuY3Rp
+b24oYSl7dGhpcy5hLmNsYXNzTmFtZT0iIn0sCnRnOmZ1bmN0aW9uKGEsYil7dmFyIHQ9dGhpcy5hLmNs
+YXNzTGlzdC5jb250YWlucyhiKQpyZXR1cm4gdH0sCmk6ZnVuY3Rpb24oYSxiKXt2YXIgdD10aGlzLmEu
+Y2xhc3NMaXN0LHM9dC5jb250YWlucyhiKQp0LmFkZChiKQpyZXR1cm4hc30sClI6ZnVuY3Rpb24oYSxi
+KXt2YXIgdD10aGlzLmEuY2xhc3NMaXN0LHM9dC5jb250YWlucyhiKQp0LnJlbW92ZShiKQpyZXR1cm4g
+c30sCkZWOmZ1bmN0aW9uKGEsYil7Vy5UTih0aGlzLmEsdS5YLmIoYikpfX0KVy5Gay5wcm90b3R5cGU9
+e30KVy5STy5wcm90b3R5cGU9e30KVy5ldS5wcm90b3R5cGU9e30KVy54Qy5wcm90b3R5cGU9e30KVy52
+Ti5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5hLiQxKHUuQi5iKGEpKX0sCiRT
+OjI3fQpXLkpRLnByb3RvdHlwZT17CkNZOmZ1bmN0aW9uKGEpe3ZhciB0CmlmKCQub3IuYT09PTApe2Zv
+cih0PTA7dDwyNjI7Kyt0KSQub3IuWSgwLEMuY21bdF0sVy5wUygpKQpmb3IodD0wO3Q8MTI7Kyt0KSQu
+b3IuWSgwLEMuQklbdF0sVy5WNCgpKX19LAppMDpmdW5jdGlvbihhKXtyZXR1cm4gJC5BTigpLnRnKDAs
+Vy5yUyhhKSl9LApFYjpmdW5jdGlvbihhLGIsYyl7dmFyIHQ9JC5vci5xKDAsSC5kKFcuclMoYSkpKyI6
+OiIrYikKaWYodD09bnVsbCl0PSQub3IucSgwLCIqOjoiK2IpCmlmKHQ9PW51bGwpcmV0dXJuITEKcmV0
+dXJuIEgueGQodC4kNChhLGIsYyx0aGlzKSl9LAokaWtGOjF9ClcuR20ucHJvdG90eXBlPXsKZ2t6OmZ1
+bmN0aW9uKGEpe3JldHVybiBuZXcgVy5XOShhLHRoaXMuZ0EoYSksSC56SyhhKS5DKCJXOTxHbS5FPiIp
+KX19ClcudkQucHJvdG90eXBlPXsKaTA6ZnVuY3Rpb24oYSl7cmV0dXJuIEMuTm0uVnIodGhpcy5hLG5l
+dyBXLlV2KGEpKX0sCkViOmZ1bmN0aW9uKGEsYixjKXtyZXR1cm4gQy5ObS5Wcih0aGlzLmEsbmV3IFcu
+RWcoYSxiLGMpKX0sCiRpa0Y6MX0KVy5Vdi5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4g
+dS5lLmIoYSkuaTAodGhpcy5hKX0sCiRTOjE1fQpXLkVnLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEp
+e3JldHVybiB1LmUuYihhKS5FYih0aGlzLmEsdGhpcy5iLHRoaXMuYyl9LAokUzoxNX0KVy5tNi5wcm90
+b3R5cGU9ewpDWTpmdW5jdGlvbihhLGIsYyxkKXt2YXIgdCxzLHIKdGhpcy5hLkZWKDAsYykKdD1iLmV2
+KDAsbmV3IFcuRW8oKSkKcz1iLmV2KDAsbmV3IFcuV2soKSkKdGhpcy5iLkZWKDAsdCkKcj10aGlzLmMK
+ci5GVigwLEMueEQpCnIuRlYoMCxzKX0sCmkwOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLmEudGcoMCxX
+LnJTKGEpKX0sCkViOmZ1bmN0aW9uKGEsYixjKXt2YXIgdD10aGlzLHM9Vy5yUyhhKSxyPXQuYwppZihy
+LnRnKDAsSC5kKHMpKyI6OiIrYikpcmV0dXJuIHQuZC5EdChjKQplbHNlIGlmKHIudGcoMCwiKjo6Iiti
+KSlyZXR1cm4gdC5kLkR0KGMpCmVsc2V7cj10LmIKaWYoci50ZygwLEguZChzKSsiOjoiK2IpKXJldHVy
+biEwCmVsc2UgaWYoci50ZygwLCIqOjoiK2IpKXJldHVybiEwCmVsc2UgaWYoci50ZygwLEguZChzKSsi
+OjoqIikpcmV0dXJuITAKZWxzZSBpZihyLnRnKDAsIio6OioiKSlyZXR1cm4hMH1yZXR1cm4hMX0sCiRp
+a0Y6MX0KVy5Fby5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4hQy5ObS50ZyhDLkJJLEgu
+eShhKSl9LAokUzo3fQpXLldrLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVybiBDLk5tLnRn
+KEMuQkksSC55KGEpKX0sCiRTOjd9ClcuY3QucHJvdG90eXBlPXsKRWI6ZnVuY3Rpb24oYSxiLGMpe2lm
+KHRoaXMuakYoYSxiLGMpKXJldHVybiEwCmlmKGI9PT0idGVtcGxhdGUiJiZjPT09IiIpcmV0dXJuITAK
+aWYoYS5nZXRBdHRyaWJ1dGUoInRlbXBsYXRlIik9PT0iIilyZXR1cm4gdGhpcy5lLnRnKDAsYikKcmV0
+dXJuITF9fQpXLklBLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVybiJURU1QTEFURTo6IitI
+LmQoSC55KGEpKX0sCiRTOjV9ClcuT3cucHJvdG90eXBlPXsKaTA6ZnVuY3Rpb24oYSl7dmFyIHQKaWYo
+dS5hTy5jKGEpKXJldHVybiExCnQ9dS5nNy5jKGEpCmlmKHQmJlcuclMoYSk9PT0iZm9yZWlnbk9iamVj
+dCIpcmV0dXJuITEKaWYodClyZXR1cm4hMApyZXR1cm4hMX0sCkViOmZ1bmN0aW9uKGEsYixjKXtpZihi
+PT09ImlzInx8Qy54Qi5uKGIsIm9uIikpcmV0dXJuITEKcmV0dXJuIHRoaXMuaTAoYSl9LAokaWtGOjF9
+ClcuVzkucHJvdG90eXBlPXsKRjpmdW5jdGlvbigpe3ZhciB0PXRoaXMscz10LmMrMSxyPXQuYgppZihz
+PHIpe3Quc3AoSi53Mih0LmEscykpCnQuYz1zCnJldHVybiEwfXQuc3AobnVsbCkKdC5jPXIKcmV0dXJu
+ITF9LApnbDpmdW5jdGlvbigpe3JldHVybiB0aGlzLmR9LApzcDpmdW5jdGlvbihhKXt0aGlzLmQ9dGhp
+cy4kdGkuZC5iKGEpfSwKJGlBbjoxfQpXLmRXLnByb3RvdHlwZT17CmdtVzpmdW5jdGlvbihhKXtyZXR1
+cm4gVy5ISCh0aGlzLmEubG9jYXRpb24pfSwKJGlEMDoxLAokaXY2OjF9ClcuRmIucHJvdG90eXBlPXt9
+Clcua0YucHJvdG90eXBlPXt9ClcubWsucHJvdG90eXBlPXskaXkwOjF9ClcuS28ucHJvdG90eXBlPXsK
+UG46ZnVuY3Rpb24oYSl7bmV3IFcuZm0odGhpcykuJDIoYSxudWxsKX0sCkVQOmZ1bmN0aW9uKGEsYil7
+aWYoYj09bnVsbClKLkx0KGEpCmVsc2UgYi5yZW1vdmVDaGlsZChhKX0sCkk0OmZ1bmN0aW9uKGEsYil7
+dmFyIHQscyxyLHEscCxvPSEwLG49bnVsbCxtPW51bGwKdHJ5e249Si5pZyhhKQptPW4uYS5nZXRBdHRy
+aWJ1dGUoImlzIikKdS5oLmIoYSkKdD1mdW5jdGlvbihjKXtpZighKGMuYXR0cmlidXRlcyBpbnN0YW5j
+ZW9mIE5hbWVkTm9kZU1hcCkpcmV0dXJuIHRydWUKdmFyIGw9Yy5jaGlsZE5vZGVzCmlmKGMubGFzdENo
+aWxkJiZjLmxhc3RDaGlsZCE9PWxbbC5sZW5ndGgtMV0pcmV0dXJuIHRydWUKaWYoYy5jaGlsZHJlbilp
+ZighKGMuY2hpbGRyZW4gaW5zdGFuY2VvZiBIVE1MQ29sbGVjdGlvbnx8Yy5jaGlsZHJlbiBpbnN0YW5j
+ZW9mIE5vZGVMaXN0KSlyZXR1cm4gdHJ1ZQp2YXIgaz0wCmlmKGMuY2hpbGRyZW4paz1jLmNoaWxkcmVu
+Lmxlbmd0aApmb3IodmFyIGo9MDtqPGs7aisrKXt2YXIgaT1jLmNoaWxkcmVuW2pdCmlmKGkuaWQ9PSdh
+dHRyaWJ1dGVzJ3x8aS5uYW1lPT0nYXR0cmlidXRlcyd8fGkuaWQ9PSdsYXN0Q2hpbGQnfHxpLm5hbWU9
+PSdsYXN0Q2hpbGQnfHxpLmlkPT0nY2hpbGRyZW4nfHxpLm5hbWU9PSdjaGlsZHJlbicpcmV0dXJuIHRy
+dWV9cmV0dXJuIGZhbHNlfShhKQpvPUgub1QodCk/ITA6IShhLmF0dHJpYnV0ZXMgaW5zdGFuY2VvZiBO
+YW1lZE5vZGVNYXApfWNhdGNoKHEpe0guUnUocSl9cz0iZWxlbWVudCB1bnByaW50YWJsZSIKdHJ5e3M9
+Si5qKGEpfWNhdGNoKHEpe0guUnUocSl9dHJ5e3I9Vy5yUyhhKQp0aGlzLmtSKHUuaC5iKGEpLGIsbyxz
+LHIsdS5HLmIobiksSC55KG0pKX1jYXRjaChxKXtpZihILlJ1KHEpIGluc3RhbmNlb2YgUC51KXRocm93
+IHEKZWxzZXt0aGlzLkVQKGEsYikKd2luZG93CnA9IlJlbW92aW5nIGNvcnJ1cHRlZCBlbGVtZW50ICIr
+SC5kKHMpCmlmKHR5cGVvZiBjb25zb2xlIT0idW5kZWZpbmVkIil3aW5kb3cuY29uc29sZS53YXJuKHAp
+fX19LAprUjpmdW5jdGlvbihhLGIsYyxkLGUsZixnKXt2YXIgdCxzLHIscSxwLG8sbj10aGlzCmlmKGMp
+e24uRVAoYSxiKQp3aW5kb3cKdD0iUmVtb3ZpbmcgZWxlbWVudCBkdWUgdG8gY29ycnVwdGVkIGF0dHJp
+YnV0ZXMgb24gPCIrZCsiPiIKaWYodHlwZW9mIGNvbnNvbGUhPSJ1bmRlZmluZWQiKXdpbmRvdy5jb25z
+b2xlLndhcm4odCkKcmV0dXJufWlmKCFuLmEuaTAoYSkpe24uRVAoYSxiKQp3aW5kb3cKdD0iUmVtb3Zp
+bmcgZGlzYWxsb3dlZCBlbGVtZW50IDwiK0guZChlKSsiPiBmcm9tICIrSC5kKGIpCmlmKHR5cGVvZiBj
+b25zb2xlIT0idW5kZWZpbmVkIil3aW5kb3cuY29uc29sZS53YXJuKHQpCnJldHVybn1pZihnIT1udWxs
+KWlmKCFuLmEuRWIoYSwiaXMiLGcpKXtuLkVQKGEsYikKd2luZG93CnQ9IlJlbW92aW5nIGRpc2FsbG93
+ZWQgdHlwZSBleHRlbnNpb24gPCIrSC5kKGUpKycgaXM9IicrZysnIj4nCmlmKHR5cGVvZiBjb25zb2xl
+IT0idW5kZWZpbmVkIil3aW5kb3cuY29uc29sZS53YXJuKHQpCnJldHVybn10PWYuZ1YoKQpzPUguVk0o
+dC5zbGljZSgwKSxILnQ2KHQpLkMoImpkPDE+IikpCmZvcihyPWYuZ1YoKS5sZW5ndGgtMSx0PWYuYTty
+Pj0wOy0tcil7aWYocj49cy5sZW5ndGgpcmV0dXJuIEguT0gocyxyKQpxPXNbcl0KcD1uLmEKbz1KLmNI
+KHEpCkgueShxKQppZighcC5FYihhLG8sdC5nZXRBdHRyaWJ1dGUocSkpKXt3aW5kb3cKcD0iUmVtb3Zp
+bmcgZGlzYWxsb3dlZCBhdHRyaWJ1dGUgPCIrSC5kKGUpKyIgIitxKyc9IicrSC5kKHQuZ2V0QXR0cmli
+dXRlKHEpKSsnIj4nCmlmKHR5cGVvZiBjb25zb2xlIT0idW5kZWZpbmVkIil3aW5kb3cuY29uc29sZS53
+YXJuKHApCnQucmVtb3ZlQXR0cmlidXRlKHEpfX1pZih1LmFXLmMoYSkpbi5QbihhLmNvbnRlbnQpfSwK
+JGlvbjoxfQpXLmZtLnByb3RvdHlwZT17CiQyOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEscD10aGlz
+LmEKc3dpdGNoKGEubm9kZVR5cGUpe2Nhc2UgMTpwLkk0KGEsYikKYnJlYWsKY2FzZSA4OmNhc2UgMTE6
+Y2FzZSAzOmNhc2UgNDpicmVhawpkZWZhdWx0OnAuRVAoYSxiKX10PWEubGFzdENoaWxkCmZvcihwPXUu
+QTtudWxsIT10Oyl7cz1udWxsCnRyeXtzPXQucHJldmlvdXNTaWJsaW5nfWNhdGNoKHIpe0guUnUocikK
+cT1wLmIodCkKYS5yZW1vdmVDaGlsZChxKQp0PW51bGwKcz1hLmxhc3RDaGlsZH1pZih0IT1udWxsKXRo
+aXMuJDIodCxhKQp0PXAuYihzKX19LAokUzozMH0KVy5MZS5wcm90b3R5cGU9e30KVy5LNy5wcm90b3R5
+cGU9e30KVy5yQi5wcm90b3R5cGU9e30KVy5YVy5wcm90b3R5cGU9e30KVy5vYS5wcm90b3R5cGU9e30K
+UC5pSi5wcm90b3R5cGU9ewpWSDpmdW5jdGlvbihhKXt2YXIgdCxzPXRoaXMuYSxyPXMubGVuZ3RoCmZv
+cih0PTA7dDxyOysrdClpZihzW3RdPT09YSlyZXR1cm4gdApDLk5tLmkocyxhKQpDLk5tLmkodGhpcy5i
+LG51bGwpCnJldHVybiByfSwKUHY6ZnVuY3Rpb24oYSl7dmFyIHQscyxyLHE9dGhpcyxwPXt9CmlmKGE9
+PW51bGwpcmV0dXJuIGEKaWYoSC5sKGEpKXJldHVybiBhCmlmKHR5cGVvZiBhPT0ibnVtYmVyIilyZXR1
+cm4gYQppZih0eXBlb2YgYT09InN0cmluZyIpcmV0dXJuIGEKaWYoYSBpbnN0YW5jZW9mIFAuaVApcmV0
+dXJuIG5ldyBEYXRlKGEuYSkKaWYodS5mdi5jKGEpKXRocm93IEguYihQLlNZKCJzdHJ1Y3R1cmVkIGNs
+b25lIG9mIFJlZ0V4cCIpKQppZih1LmM4LmMoYSkpcmV0dXJuIGEKaWYodS5kLmMoYSkpcmV0dXJuIGEK
+aWYodS5JLmMoYSkpcmV0dXJuIGEKdD11LmRELmMoYSl8fCExCmlmKHQpcmV0dXJuIGEKaWYodS5HLmMo
+YSkpe3M9cS5WSChhKQp0PXEuYgppZihzPj10Lmxlbmd0aClyZXR1cm4gSC5PSCh0LHMpCnI9cC5hPXRb
+c10KaWYociE9bnVsbClyZXR1cm4gcgpyPXt9CnAuYT1yCkMuTm0uWSh0LHMscikKYS5LKDAsbmV3IFAu
+bFIocCxxKSkKcmV0dXJuIHAuYX1pZih1LmouYyhhKSl7cz1xLlZIKGEpCnA9cS5iCmlmKHM+PXAubGVu
+Z3RoKXJldHVybiBILk9IKHAscykKcj1wW3NdCmlmKHIhPW51bGwpcmV0dXJuIHIKcmV0dXJuIHEuZWso
+YSxzKX1pZih1LmVILmMoYSkpe3M9cS5WSChhKQp0PXEuYgppZihzPj10Lmxlbmd0aClyZXR1cm4gSC5P
+SCh0LHMpCnI9cC5iPXRbc10KaWYociE9bnVsbClyZXR1cm4gcgpyPXt9CnAuYj1yCkMuTm0uWSh0LHMs
+cikKcS5pbShhLG5ldyBQLmpnKHAscSkpCnJldHVybiBwLmJ9dGhyb3cgSC5iKFAuU1koInN0cnVjdHVy
+ZWQgY2xvbmUgb2Ygb3RoZXIgdHlwZSIpKX0sCmVrOmZ1bmN0aW9uKGEsYil7dmFyIHQscz1KLlU2KGEp
+LHI9cy5nQShhKSxxPW5ldyBBcnJheShyKQpDLk5tLlkodGhpcy5iLGIscSkKZm9yKHQ9MDt0PHI7Kyt0
+KUMuTm0uWShxLHQsdGhpcy5QdihzLnEoYSx0KSkpCnJldHVybiBxfX0KUC5sUi5wcm90b3R5cGU9ewok
+MjpmdW5jdGlvbihhLGIpe3RoaXMuYS5hW2FdPXRoaXMuYi5QdihiKX0sCiRTOjR9ClAuamcucHJvdG90
+eXBlPXsKJDI6ZnVuY3Rpb24oYSxiKXt0aGlzLmEuYlthXT10aGlzLmIuUHYoYil9LAokUzo0fQpQLkJm
+LnByb3RvdHlwZT17CmltOmZ1bmN0aW9uKGEsYil7dmFyIHQscyxyLHEKdS5iOC5iKGIpCmZvcih0PU9i
+amVjdC5rZXlzKGEpLHM9dC5sZW5ndGgscj0wO3I8czsrK3Ipe3E9dFtyXQpiLiQyKHEsYVtxXSl9fX0K
+UC5Bcy5wcm90b3R5cGU9ewpUOmZ1bmN0aW9uKGEpe3ZhciB0CkgueShhKQp0PSQuaEcoKS5iCmlmKHR5
+cGVvZiBhIT0ic3RyaW5nIilILnZoKEgudEwoYSkpCmlmKHQudGVzdChhKSlyZXR1cm4gYQp0aHJvdyBI
+LmIoUC5MMyhhLCJ2YWx1ZSIsIk5vdCBhIHZhbGlkIGNsYXNzIHRva2VuIikpfSwKdzpmdW5jdGlvbihh
+KXtyZXR1cm4gdGhpcy5ERygpLkgoMCwiICIpfSwKZ2t6OmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMuREco
+KQpyZXR1cm4gUC5yaih0LHQucixILkxoKHQpLmQpfSwKZ0E6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMu
+REcoKS5hfSwKdGc6ZnVuY3Rpb24oYSxiKXt0aGlzLlQoYikKcmV0dXJuIHRoaXMuREcoKS50ZygwLGIp
+fSwKaTpmdW5jdGlvbihhLGIpe3RoaXMuVChiKQpyZXR1cm4gSC54ZCh0aGlzLk9TKG5ldyBQLkdFKGIp
+KSl9LApSOmZ1bmN0aW9uKGEsYil7dmFyIHQscwp0aGlzLlQoYikKdD10aGlzLkRHKCkKcz10LlIoMCxi
+KQp0aGlzLlgodCkKcmV0dXJuIHN9LApGVjpmdW5jdGlvbihhLGIpe3RoaXMuT1MobmV3IFAuTjcodGhp
+cyx1LlguYihiKSkpfSwKVjE6ZnVuY3Rpb24oYSl7dGhpcy5PUyhuZXcgUC51USgpKX0sCk9TOmZ1bmN0
+aW9uKGEpe3ZhciB0LHMKdS5jaC5iKGEpCnQ9dGhpcy5ERygpCnM9YS4kMSh0KQp0aGlzLlgodCkKcmV0
+dXJuIHN9fQpQLkdFLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVybiB1LkMuYihhKS5pKDAs
+dGhpcy5hKX0sCiRTOjMxfQpQLk43LnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMu
+YixzPUgudDYodCkKcmV0dXJuIHUuQy5iKGEpLkZWKDAsbmV3IEguQTgodCxzLkMoInFVKDEpIikuYih0
+aGlzLmEuZ3VNKCkpLHMuQygiQTg8MSxxVT4iKSkpfSwKJFM6MTF9ClAudVEucHJvdG90eXBlPXsKJDE6
+ZnVuY3Rpb24oYSl7dS5DLmIoYSkKaWYoYS5hPjApe2EuYj1hLmM9YS5kPWEuZT1hLmY9bnVsbAphLmE9
+MAphLlMoKX1yZXR1cm4gbnVsbH0sCiRTOjExfQpQLmhGLnByb3RvdHlwZT17JGloRjoxfQpQLlBDLnBy
+b3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0CnUuWi5iKGEpCnQ9ZnVuY3Rpb24oYixjLGQpe3Jl
+dHVybiBmdW5jdGlvbigpe3JldHVybiBiKGMsZCx0aGlzLEFycmF5LnByb3RvdHlwZS5zbGljZS5hcHBs
+eShhcmd1bWVudHMpKX19KFAuUjQsYSwhMSkKUC5EbSh0LCQudygpLGEpCnJldHVybiB0fSwKJFM6MX0K
+UC5tdC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IHRoaXMuYShhKX0sCiRTOjF9
+ClAuTnoucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIG5ldyBQLnI3KGEpfSwKJFM6MzN9
+ClAuUVMucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIG5ldyBQLlR6KGEsdS5hbSl9LAok
+UzozNH0KUC5ucC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFAuRTQoYSl9LAok
+UzozNX0KUC5FNC5wcm90b3R5cGU9ewpxOmZ1bmN0aW9uKGEsYil7aWYodHlwZW9mIGIhPSJzdHJpbmci
+JiZ0eXBlb2YgYiE9Im51bWJlciIpdGhyb3cgSC5iKFAueFkoInByb3BlcnR5IGlzIG5vdCBhIFN0cmlu
+ZyBvciBudW0iKSkKcmV0dXJuIFAuTDcodGhpcy5hW2JdKX0sClk6ZnVuY3Rpb24oYSxiLGMpe2lmKHR5
+cGVvZiBiIT0ic3RyaW5nIiYmdHlwZW9mIGIhPSJudW1iZXIiKXRocm93IEguYihQLnhZKCJwcm9wZXJ0
+eSBpcyBub3QgYSBTdHJpbmcgb3IgbnVtIikpCnRoaXMuYVtiXT1QLndZKGMpfSwKRE46ZnVuY3Rpb24o
+YSxiKXtpZihiPT1udWxsKXJldHVybiExCnJldHVybiBiIGluc3RhbmNlb2YgUC5FNCYmdGhpcy5hPT09
+Yi5hfSwKdzpmdW5jdGlvbihhKXt2YXIgdCxzCnRyeXt0PVN0cmluZyh0aGlzLmEpCnJldHVybiB0fWNh
+dGNoKHMpe0guUnUocykKdD10aGlzLnhiKDApCnJldHVybiB0fX0sClY3OmZ1bmN0aW9uKGEsYil7dmFy
+IHQscz10aGlzLmEKaWYoYj09bnVsbCl0PW51bGwKZWxzZXt0PUgudDYoYikKdD1QLkNIKG5ldyBILkE4
+KGIsdC5DKCJAKDEpIikuYihQLmlHKCkpLHQuQygiQTg8MSxAPiIpKSwhMCx1LnopfXJldHVybiBQLkw3
+KHNbYV0uYXBwbHkocyx0KSl9LApnaU86ZnVuY3Rpb24oYSl7cmV0dXJuIDB9fQpQLnI3LnByb3RvdHlw
+ZT17fQpQLlR6LnByb3RvdHlwZT17CmNQOmZ1bmN0aW9uKGEpe3ZhciB0PXRoaXMscz1hPDB8fGE+PXQu
+Z0EodCkKaWYocyl0aHJvdyBILmIoUC5URShhLDAsdC5nQSh0KSxudWxsLG51bGwpKX0sCnE6ZnVuY3Rp
+b24oYSxiKXtpZih0eXBlb2YgYj09Im51bWJlciImJmI9PT1DLmpuLnl1KGIpKXRoaXMuY1AoSC5TYyhi
+KSkKcmV0dXJuIHRoaXMuJHRpLmQuYih0aGlzLlVyKDAsYikpfSwKWTpmdW5jdGlvbihhLGIsYyl7dmFy
+IHQKdGhpcy4kdGkuZC5iKGMpCnQ9Qy5qbi55dShiKQppZihiPT09dCl0aGlzLmNQKGIpCnRoaXMuZTQo
+MCxiLGMpfSwKZ0E6ZnVuY3Rpb24oYSl7dmFyIHQ9dGhpcy5hLmxlbmd0aAppZih0eXBlb2YgdD09PSJu
+dW1iZXIiJiZ0Pj4+MD09PXQpcmV0dXJuIHQKdGhyb3cgSC5iKFAuUFYoIkJhZCBKc0FycmF5IGxlbmd0
+aCIpKX0sCiRpYlE6MSwKJGljWDoxLAokaXpNOjF9ClAuY28ucHJvdG90eXBlPXt9ClAubmQucHJvdG90
+eXBlPXskaW5kOjF9ClAuS2UucHJvdG90eXBlPXsKREc6ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwPXRo
+aXMuYS5nZXRBdHRyaWJ1dGUoImNsYXNzIiksbz1QLkxzKHUuTikKaWYocD09bnVsbClyZXR1cm4gbwpm
+b3IodD1wLnNwbGl0KCIgIikscz10Lmxlbmd0aCxyPTA7cjxzOysrcil7cT1KLlQwKHRbcl0pCmlmKHEu
+bGVuZ3RoIT09MClvLmkoMCxxKX1yZXR1cm4gb30sClg6ZnVuY3Rpb24oYSl7dGhpcy5hLnNldEF0dHJp
+YnV0ZSgiY2xhc3MiLGEuSCgwLCIgIikpfX0KUC5kNS5wcm90b3R5cGU9ewpnUDpmdW5jdGlvbihhKXty
+ZXR1cm4gbmV3IFAuS2UoYSl9LApzaGY6ZnVuY3Rpb24oYSxiKXt0aGlzLllDKGEsYil9LApyNjpmdW5j
+dGlvbihhLGIsYyxkKXt2YXIgdCxzLHIscSxwLG8KaWYoZD09bnVsbCl7dD1ILlZNKFtdLHUuaSkKZD1u
+ZXcgVy52RCh0KQpDLk5tLmkodCxXLlR3KG51bGwpKQpDLk5tLmkodCxXLkJsKCkpCkMuTm0uaSh0LG5l
+dyBXLk93KCkpfWM9bmV3IFcuS28oZCkKcz0nPHN2ZyB2ZXJzaW9uPSIxLjEiPicrSC5kKGIpKyI8L3N2
+Zz4iCnQ9ZG9jdW1lbnQKcj10LmJvZHkKcT0ociYmQy5SWSkuQUgocixzLGMpCnA9dC5jcmVhdGVEb2N1
+bWVudEZyYWdtZW50KCkKcS50b1N0cmluZwp0PW5ldyBXLmU3KHEpCm89dC5ncjgodCkKZm9yKDt0PW8u
+Zmlyc3RDaGlsZCx0IT1udWxsOylwLmFwcGVuZENoaWxkKHQpCnJldHVybiBwfSwKbno6ZnVuY3Rpb24o
+YSxiLGMsZCxlKXt0aHJvdyBILmIoUC5MNCgiQ2Fubm90IGludm9rZSBpbnNlcnRBZGphY2VudEh0bWwg
+b24gU1ZHLiIpKX0sCmdWbDpmdW5jdGlvbihhKXtyZXR1cm4gbmV3IFcuZXUoYSwiY2xpY2siLCExLHUu
+USl9LAokaWQ1OjF9ClAubjYucHJvdG90eXBlPXskaWJROjEsJGljWDoxLCRpek06MSwkaWVxOjF9Ck0u
+SDcucHJvdG90eXBlPXsKdzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5ifX0KVS5MTC5wcm90b3R5cGU9
+ewpMdDpmdW5jdGlvbigpe3JldHVybiBQLkVGKFsibm9kZUlkIix0aGlzLmIsImtpbmQiLHRoaXMuYS5h
+XSx1Lk4sdS5LKX19ClUuTUQucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0dXJuIHUuZ3AuYihh
+KS5hPT09dGhpcy5hLnEoMCwia2luZCIpfSwKJFM6MzZ9ClUuZDIucHJvdG90eXBlPXsKTHQ6ZnVuY3Rp
+b24oKXt2YXIgdCxzLHIscSxwPXRoaXMsbz11Lk4sbj11LkssbT1QLkZsKG8sbiksbD1wLmEKaWYobCE9
+bnVsbCl7dD1ILlZNKFtdLHUuSikKZm9yKHM9bC5sZW5ndGgscj0wO3I8bC5sZW5ndGg7bC5sZW5ndGg9
+PT1zfHwoMCxILmxrKShsKSwrK3Ipe3E9bFtyXQpDLk5tLmkodCxQLkVGKFsiZGVzY3JpcHRpb24iLHEu
+YSwiaHJlZiIscS5iXSxvLG4pKX1tLlkoMCwiZWRpdHMiLHQpfW0uWSgwLCJleHBsYW5hdGlvbiIscC5i
+KQptLlkoMCwibGluZSIscC5jKQptLlkoMCwiZGlzcGxheVBhdGgiLHAuZCkKbS5ZKDAsInVyaVBhdGgi
+LHAuZSkKbz1wLmYKaWYobyE9bnVsbCl7bj1ILlZNKFtdLHUuSikKZm9yKGw9by5sZW5ndGgscj0wO3I8
+by5sZW5ndGg7by5sZW5ndGg9PT1sfHwoMCxILmxrKShvKSwrK3IpQy5ObS5pKG4sb1tyXS5MdCgpKQpt
+LlkoMCwidHJhY2VzIixuKX1yZXR1cm4gbX19ClUuU2UucHJvdG90eXBlPXsKTHQ6ZnVuY3Rpb24oKXty
+ZXR1cm4gUC5FRihbImRlc2NyaXB0aW9uIix0aGlzLmEsImhyZWYiLHRoaXMuYl0sdS5OLHUuSyl9fQpV
+Lk1sLnByb3RvdHlwZT17Ckx0OmZ1bmN0aW9uKCl7cmV0dXJuIFAuRUYoWyJocmVmIix0aGlzLmEsImxp
+bmUiLHRoaXMuYiwicGF0aCIsdGhpcy5jXSx1Lk4sdS5LKX19ClUueUQucHJvdG90eXBlPXsKTHQ6ZnVu
+Y3Rpb24oKXt2YXIgdCxzLHIscT1ILlZNKFtdLHUuSikKZm9yKHQ9dGhpcy5iLHM9dC5sZW5ndGgscj0w
+O3I8dC5sZW5ndGg7dC5sZW5ndGg9PT1zfHwoMCxILmxrKSh0KSwrK3IpQy5ObS5pKHEsdFtyXS5MdCgp
+KQpyZXR1cm4gUC5FRihbImRlc2NyaXB0aW9uIix0aGlzLmEsImVudHJpZXMiLHFdLHUuTix1LkspfX0K
+VS53Yi5wcm90b3R5cGU9ewpMdDpmdW5jdGlvbigpe3ZhciB0LHMscj10aGlzLHE9UC5GbCh1Lk4sdS5L
+KQpxLlkoMCwiZGVzY3JpcHRpb24iLHIuYSkKdD1yLmIKaWYodCE9bnVsbClxLlkoMCwiZnVuY3Rpb24i
+LHQpCnQ9ci5jCmlmKHQhPW51bGwpcS5ZKDAsImxpbmsiLHQuTHQoKSkKdD1yLmQKaWYodC5sZW5ndGgh
+PT0wKXtzPUgudDYodCkKcS5ZKDAsImhpbnRBY3Rpb25zIixuZXcgSC5BOCh0LHMuQygiWjA8cVUsaz4o
+MSkiKS5iKG5ldyBVLmIwKCkpLHMuQygiQTg8MSxaMDxxVSxrPj4iKSkuYnIoMCkpfXJldHVybiBxfX0K
+VS5hTi5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gVS5ueih1LlMuYShhKSl9LAokUzoz
+N30KVS5iMC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXtyZXR1cm4gdS5ELmIoYSkuTHQoKX0sCiRT
+OjM4fQpCLmo4LnByb3RvdHlwZT17Ckx0OmZ1bmN0aW9uKCl7cmV0dXJuIFAuRUYoWyJsaW5lIix0aGlz
+LmEsImV4cGxhbmF0aW9uIix0aGlzLmIsIm9mZnNldCIsdGhpcy5jXSx1Lk4sdS5LKX19CkIucXAucHJv
+dG90eXBlPXsKTHQ6ZnVuY3Rpb24oKXt2YXIgdCxzLHIscSxwLG8sbixtPXRoaXMsbD11Lk4saz1QLkZs
+KGwsdS5kMykKZm9yKHQ9bS5kLHQ9dC5nUHUodCksdD10Lmdreih0KSxzPXUuSyxyPXUuSjt0LkYoKTsp
+e3E9dC5nbCgpCnA9cS5hCm89SC5WTShbXSxyKQpmb3IocT1KLklUKHEuYik7cS5GKCk7KXtuPXEuZ2wo
+KQpDLk5tLmkobyxQLkVGKFsibGluZSIsbi5hLCJleHBsYW5hdGlvbiIsbi5iLCJvZmZzZXQiLG4uY10s
+bCxzKSl9ay5ZKDAscCxvKX1yZXR1cm4gUC5FRihbInJlZ2lvbnMiLG0uYSwibmF2aWdhdGlvbkNvbnRl
+bnQiLG0uYiwic291cmNlQ29kZSIsbS5jLCJlZGl0cyIsa10sbCxzKX19ClQubVEucHJvdG90eXBlPXt9
+CkwuZS5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzLHIscSxwLG8sbgp1LkIuYihhKQp0
+PXdpbmRvdy5sb2NhdGlvbi5wYXRobmFtZQpzPUwuRzYod2luZG93LmxvY2F0aW9uLmhyZWYpCnI9TC5h
+Syh3aW5kb3cubG9jYXRpb24uaHJlZikKTC5HZSgpCmlmKHQhPT0iLyImJnQhPT1KLlQwKGRvY3VtZW50
+LnF1ZXJ5U2VsZWN0b3IoIi5yb290IikudGV4dENvbnRlbnQpKUwuRzcodCxzLHIsITAsbmV3IEwuVlco
+dCxzLHIpKQpxPWRvY3VtZW50CnA9Si5xRihxLnF1ZXJ5U2VsZWN0b3IoIi5hcHBseS1taWdyYXRpb24i
+KSkKbz1wLiR0aQpuPW8uQygifigxKSIpLmIobmV3IEwub1ooKSkKdS5NLmIobnVsbCkKVy5KRShwLmEs
+cC5iLG4sITEsby5kKQpvPUoucUYocS5xdWVyeVNlbGVjdG9yKCIucmVydW4tbWlncmF0aW9uIikpCm49
+by4kdGkKVy5KRShvLmEsby5iLG4uQygifigxKSIpLmIobmV3IEwueTgoKSksITEsbi5kKQpuPUoucUYo
+cS5xdWVyeVNlbGVjdG9yKCIucmVwb3J0LXByb2JsZW0iKSkKbz1uLiR0aQpXLkpFKG4uYSxuLmIsby5D
+KCJ+KDEpIikuYihuZXcgTC5IaSgpKSwhMSxvLmQpCnE9Si5xRihxLnF1ZXJ5U2VsZWN0b3IoIi5wb3B1
+cC1wYW5lIC5jbG9zZSIpKQpvPXEuJHRpClcuSkUocS5hLHEuYixvLkMoIn4oMSkiKS5iKG5ldyBMLkJU
+KCkpLCExLG8uZCl9LAokUzoxNn0KTC5WVy5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe0wuRnIodGhp
+cy5hLHRoaXMuYix0aGlzLmMpfSwKJFM6MH0KTC5vWi5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2
+YXIgdCxzLHIscQp1LlYuYihhKQppZihILm9UKHdpbmRvdy5jb25maXJtKCJUaGlzIHdpbGwgYXBwbHkg
+dGhlIGNoYW5nZXMgeW91J3ZlIHByZXZpZXdlZCB0byB5b3VyIHdvcmtpbmcgZGlyZWN0b3J5LiBJdCBp
+cyByZWNvbW1lbmRlZCB5b3UgY29tbWl0IGFueSBjaGFuZ2VzIHlvdSBtYWRlIGJlZm9yZSBkb2luZyB0
+aGlzLiIpKSl7dD1MLnR5KCIvYXBwbHktbWlncmF0aW9uIixudWxsKS5XNyhuZXcgTC5qcigpLHUuUCkK
+cz1uZXcgTC5xbCgpCnUuYmYuYihudWxsKQpyPXQuJHRpCnE9JC5YMwppZihxIT09Qy5OVSlzPVAuVkgo
+cyxxKQp0LnhmKG5ldyBQLkZlKG5ldyBQLnZzKHEsciksMixudWxsLHMsci5DKCJAPDE+IikuS3Eoci5k
+KS5DKCJGZTwxLDI+IikpKX19LAokUzozfQpMLmpyLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3Zh
+ciB0CnUuUy5iKGEpCnQ9ZG9jdW1lbnQuYm9keQp0LmNsYXNzTGlzdC5yZW1vdmUoInByb3Bvc2VkIikK
+dC5jbGFzc0xpc3QuYWRkKCJhcHBsaWVkIil9LAokUzo0MX0KTC5xbC5wcm90b3R5cGU9ewokMjpmdW5j
+dGlvbihhLGIpe0wuQzIoIkNvdWxkIG5vdCBhcHBseSBtaWdyYXRpb24iLGEsYil9LAokQzoiJDIiLAok
+UjoyLAokUzo0fQpMLnk4LnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlzLnhuKHUu
+Vi5iKGEpKX0sCnhuOmZ1bmN0aW9uKGEpe3ZhciB0PTAscz1QLkZYKHUuUCkscj0xLHEscD1bXSxvLG4s
+bSxsCnZhciAkYXN5bmMkJDE9UC5seihmdW5jdGlvbihiLGMpe2lmKGI9PT0xKXtxPWMKdD1yfXdoaWxl
+KHRydWUpc3dpdGNoKHQpe2Nhc2UgMDpyPTMKZG9jdW1lbnQuYm9keS5jbGFzc0xpc3QuYWRkKCJyZXJ1
+bm5pbmciKQp0PTYKcmV0dXJuIFAualEoTC50eSgiL3JlcnVuLW1pZ3JhdGlvbiIsbnVsbCksJGFzeW5j
+JCQxKQpjYXNlIDY6d2luZG93LmxvY2F0aW9uLnJlbG9hZCgpCnAucHVzaCg1KQp0PTQKYnJlYWsKY2Fz
+ZSAzOnI9MgpsPXEKbz1ILlJ1KGwpCm49SC50cyhsKQpMLkMyKCJGYWlsZWQgdG8gcmVydW4gbWlncmF0
+aW9uIixvLG4pCnAucHVzaCg1KQp0PTQKYnJlYWsKY2FzZSAyOnA9WzFdCmNhc2UgNDpyPTEKZG9jdW1l
+bnQuYm9keS5jbGFzc0xpc3QucmVtb3ZlKCJyZXJ1bm5pbmciKQp0PXAucG9wKCkKYnJlYWsKY2FzZSA1
+OnJldHVybiBQLnlDKG51bGwscykKY2FzZSAxOnJldHVybiBQLmYzKHEscyl9fSkKcmV0dXJuIFAuREko
+JGFzeW5jJCQxLHMpfSwKJFM6MTd9CkwuSGkucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQK
+dS5WLmIoYSkKdD11Lk4KQy5vbC5Qbyh3aW5kb3csUC5YZCgiaHR0cHMiLCJnaXRodWIuY29tIiwiZGFy
+dC1sYW5nL3Nkay9pc3N1ZXMvbmV3IixQLkVGKFsidGl0bGUiLCJDdXN0b21lci1yZXBvcnRlZCBpc3N1
+ZSB3aXRoIE5OQkQgbWlncmF0aW9uIHRvb2wiLCJsYWJlbHMiLCJhcmVhLWFuYWx5emVyLGFuYWx5emVy
+LW5uYmQtbWlncmF0aW9uLHR5cGUtYnVnIiwiYm9keSIsIiMjIyMgU3RlcHMgdG8gcmVwcm9kdWNlXG5c
+biMjIyMgV2hhdCBkaWQgeW91IGV4cGVjdCB0byBoYXBwZW4/XG5cbiMjIyMgV2hhdCBhY3R1YWxseSBo
+YXBwZW5lZD9cblxuX1NjcmVlbnNob3RzIGFyZSBhcHByZWNpYXRlZF9cblxuKipEYXJ0IFNESyB2ZXJz
+aW9uKio6ICIrSC5kKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJzZGstdmVyc2lvbiIpLnRleHRDb250
+ZW50KSsiXG5cblRoYW5rcyBmb3IgZmlsaW5nIVxuIl0sdCx0KSkudygwKSwicmVwb3J0LXByb2JsZW0i
+KX0sCiRTOjN9CkwuQlQucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQKdS5WLmIoYSkKdD1k
+b2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucG9wdXAtcGFuZSIpLnN0eWxlCnJldHVybiB0LmRpc3BsYXk9
+Im5vbmUifSwKJFM6NDN9CkwuTC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzLHIKdS5C
+LmIoYSkKdD13aW5kb3cubG9jYXRpb24ucGF0aG5hbWUKcz1MLkc2KHdpbmRvdy5sb2NhdGlvbi5ocmVm
+KQpyPUwuYUsod2luZG93LmxvY2F0aW9uLmhyZWYpCmlmKHQubGVuZ3RoPjEpTC5HNyh0LHMsciwhMSxu
+dWxsKQplbHNle0wuQkUodCxuZXcgQi5xcCgiIiwiIiwiIixDLkNNKSwhMCkKTC5CWCgiJm5ic3A7Iixu
+dWxsKX19LAokUzoxNn0KTC5XeC5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzLHIscT0i
+Y29sbGFwc2VkIgp1LlYuYihhKQp0PXRoaXMuYQpzPUouUkUodCkKcj10aGlzLmIKaWYoIXMuZ1AodCku
+dGcoMCxxKSl7cy5nUCh0KS5pKDAscSkKSi5kUihyKS5pKDAscSl9ZWxzZXtzLmdQKHQpLlIoMCxxKQpK
+LmRSKHIpLlIoMCxxKX19LAokUzozfQpMLkFPLnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0
+PUoucUYodS5oLmIoYSkpLHM9dC4kdGkscj1zLkMoIn4oMSkiKS5iKG5ldyBMLmROKHRoaXMuYSkpCnUu
+TS5iKG51bGwpClcuSkUodC5hLHQuYixyLCExLHMuZCl9LAokUzo2fQpMLmROLnByb3RvdHlwZT17CiQx
+OmZ1bmN0aW9uKGEpe3ZhciB0CnUuVi5iKGEpCnQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcigidGFibGVb
+ZGF0YS1wYXRoXSIpCnQudG9TdHJpbmcKTC50MihhLHRoaXMuYSx0LmdldEF0dHJpYnV0ZSgiZGF0YS0i
+K25ldyBXLlN5KG5ldyBXLmk3KHQpKS5PKCJwYXRoIikpKX0sCiRTOjN9CkwuSG8ucHJvdG90eXBlPXsK
+JDE6ZnVuY3Rpb24oYSl7dmFyIHQscyxyCnUuaC5iKGEpCnQ9Si5xRihhKQpzPXQuJHRpCnI9cy5DKCJ+
+KDEpIikuYihuZXcgTC54eihhLHRoaXMuYSkpCnUuTS5iKG51bGwpClcuSkUodC5hLHQuYixyLCExLHMu
+ZCl9LAokUzo2fQpMLnh6LnByb3RvdHlwZT17CiQxOmZ1bmN0aW9uKGEpe3ZhciB0LHM9bnVsbAp1LlYu
+YihhKQp0PXRoaXMuYQpMLmhYKHRoaXMuYixQLlFBKHQuZ2V0QXR0cmlidXRlKCJkYXRhLSIrbmV3IFcu
+U3kobmV3IFcuaTcodCkpLk8oIm9mZnNldCIpKSxzLHMpLFAuUUEodC5nZXRBdHRyaWJ1dGUoImRhdGEt
+IituZXcgVy5TeShuZXcgVy5pNyh0KSkuTygibGluZSIpKSxzLHMpKX0sCiRTOjN9CkwuSUMucHJvdG90
+eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dmFyIHQ9Si5xRih1LmguYihhKSkscz10LiR0aQpzLkMoIn4oMSki
+KS5iKEwuaVMoKSkKdS5NLmIobnVsbCkKVy5KRSh0LmEsdC5iLEwuaVMoKSwhMSxzLmQpfSwKJFM6Nn0K
+TC5mQy5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt1LnAuYihhKQp0aGlzLmEuYU0oMCx0aGlzLmIp
+fSwKJFM6NDV9CkwublQucHJvdG90eXBlPXsKJDA6ZnVuY3Rpb24oKXtMLkZyKHRoaXMuYS5hLHRoaXMu
+Yix0aGlzLmMpfSwKJFM6MH0KTC5CWi5wcm90b3R5cGU9ewokMDpmdW5jdGlvbigpe0wuRnIodGhpcy5h
+LmEsbnVsbCxudWxsKX0sCiRTOjB9CkwuR0gucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7dS5oLmIo
+YSkKJC56QigpLnRvU3RyaW5nCnUubS5hKCQub3coKS5xKDAsImhsanMiKSkuVjcoImhpZ2hsaWdodEJs
+b2NrIixbYV0pfSwKJFM6Nn0KTC5FRS5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzCnUu
+Vi5iKGEpCnQ9dGhpcy5hCnM9dGhpcy5iCkwuYWYod2luZG93LmxvY2F0aW9uLnBhdGhuYW1lLHQscywh
+MCxuZXcgTC5RTCh0LHMpKQpMLmhYKHRoaXMuYyx0LHMpfSwKJFM6M30KTC5RTC5wcm90b3R5cGU9ewok
+MDpmdW5jdGlvbigpe0wuRnIod2luZG93LmxvY2F0aW9uLnBhdGhuYW1lLHRoaXMuYSx0aGlzLmIpfSwK
+JFM6MH0KTC5WUy5wcm90b3R5cGU9ewokMTpmdW5jdGlvbihhKXt2YXIgdCxzPSJzZWxlY3RlZC1maWxl
+Igp1LmguYihhKQphLnRvU3RyaW5nCnQ9Si5SRShhKQppZihhLmdldEF0dHJpYnV0ZSgiZGF0YS0iK25l
+dyBXLlN5KG5ldyBXLmk3KGEpKS5PKCJuYW1lIikpPT09dGhpcy5hLmEpdC5nUChhKS5pKDAscykKZWxz
+ZSB0LmdQKGEpLlIoMCxzKX0sCiRTOjZ9CkwuVEQucHJvdG90eXBlPXsKJDE6ZnVuY3Rpb24oYSl7cmV0
+dXJuIEwudDIodS5WLmIoYSksITAsbnVsbCl9LAokUzoxOH0KTC5BUy5wcm90b3R5cGU9ewokMTpmdW5j
+dGlvbihhKXtyZXR1cm4gdGhpcy5QTCh1LlYuYihhKSl9LApQTDpmdW5jdGlvbihhKXt2YXIgdD0wLHM9
+UC5GWCh1LlApLHI9MSxxLHA9W10sbz10aGlzLG4sbSxsLGssagp2YXIgJGFzeW5jJCQxPVAubHooZnVu
+Y3Rpb24oYixjKXtpZihiPT09MSl7cT1jCnQ9cn13aGlsZSh0cnVlKXN3aXRjaCh0KXtjYXNlIDA6cj0z
+Cmw9dS5OCnQ9NgpyZXR1cm4gUC5qUShMLnR5KEwuUTQoIi9hcHBseS1oaW50IixQLkZsKGwsbCkpLG8u
+YS5MdCgpKSwkYXN5bmMkJDEpCmNhc2UgNjpsPW8uYgpMLkc3KGwuYyxudWxsLGwuYiwhMSxudWxsKQpk
+b2N1bWVudC5ib2R5LmNsYXNzTGlzdC5hZGQoIm5lZWRzLXJlcnVuIikKcj0xCnQ9NQpicmVhawpjYXNl
+IDM6cj0yCmo9cQpuPUguUnUoaikKbT1ILnRzKGopCkwuQzIoIkNvdWxkIG5vdCBhcHBseSBoaW50Iixu
+LG0pCnQ9NQpicmVhawpjYXNlIDI6dD0xCmJyZWFrCmNhc2UgNTpyZXR1cm4gUC55QyhudWxsLHMpCmNh
+c2UgMTpyZXR1cm4gUC5mMyhxLHMpfX0pCnJldHVybiBQLkRJKCRhc3luYyQkMSxzKX0sCiRTOjE3fQpM
+LlhBLnByb3RvdHlwZT17CkViOmZ1bmN0aW9uKGEsYixjKXtyZXR1cm4hMH0sCmkwOmZ1bmN0aW9uKGEp
+e3JldHVybiEwfSwKJGlrRjoxfQpMLlpaLnByb3RvdHlwZT17Ckx0OmZ1bmN0aW9uKCl7dmFyIHQscz10
+aGlzLHI9UC5GbCh1Lk4sdS5LKQpyLlkoMCwidHlwZSIsTC52eShzLmEpKQpyLlkoMCwibmFtZSIscy5i
+KQp0PXMuYwppZih0IT1udWxsKXIuWSgwLCJzdWJ0cmVlIixMLlZEKHQpKQp0PXMuZAppZih0IT1udWxs
+KXIuWSgwLCJwYXRoIix0KQp0PXMuZQppZih0IT1udWxsKXIuWSgwLCJocmVmIix0KQp0PXMuZgppZih0
+IT1udWxsKXIuWSgwLCJlZGl0Q291bnQiLHQpCnJldHVybiByfX0KTC5POS5wcm90b3R5cGU9ewp3OmZ1
+bmN0aW9uKGEpe3JldHVybiB0aGlzLmJ9fQpNLmxJLnByb3RvdHlwZT17CldPOmZ1bmN0aW9uKGEsYil7
+dmFyIHQscz1udWxsCk0uWUYoImFic29sdXRlIixILlZNKFtiLG51bGwsbnVsbCxudWxsLG51bGwsbnVs
+bCxudWxsXSx1LnMpKQp0PXRoaXMuYQp0PXQuWXIoYik+MCYmIXQuaEsoYikKaWYodClyZXR1cm4gYgp0
+PUQuUlgoKQpyZXR1cm4gdGhpcy5xNygwLHQsYixzLHMscyxzLHMscyl9LAp6ZjpmdW5jdGlvbihhKXt2
+YXIgdCxzLHI9WC5DTChhLHRoaXMuYSkKci5JVigpCnQ9ci5kCnM9dC5sZW5ndGgKaWYocz09PTApe3Q9
+ci5iCnJldHVybiB0PT1udWxsPyIuIjp0fWlmKHM9PT0xKXt0PXIuYgpyZXR1cm4gdD09bnVsbD8iLiI6
+dH1pZigwPj1zKXJldHVybiBILk9IKHQsLTEpCnQucG9wKCkKQy5ObS5tdihyLmUpCnIuSVYoKQpyZXR1
+cm4gci53KDApfSwKcTc6ZnVuY3Rpb24oYSxiLGMsZCxlLGYsZyxoLGkpe3ZhciB0PUguVk0oW2IsYyxk
+LGUsZixnLGgsaV0sdS5zKQpNLllGKCJqb2luIix0KQpyZXR1cm4gdGhpcy5JUChuZXcgSC5VNSh0LHUu
+YkIuYihuZXcgTS5NaSgpKSx1LmNjKSl9LApJUDpmdW5jdGlvbihhKXt2YXIgdCxzLHIscSxwLG8sbixt
+LGwsawp1LlguYihhKQpmb3IodD1hLiR0aSxzPXQuQygiYTIoY1guRSkiKS5iKG5ldyBNLnE3KCkpLHI9
+YS5na3ooYSksdD1uZXcgSC5TTyhyLHMsdC5DKCJTTzxjWC5FPiIpKSxzPXRoaXMuYSxxPSExLHA9ITEs
+bz0iIjt0LkYoKTspe249ci5nbCgpCmlmKHMuaEsobikmJnApe209WC5DTChuLHMpCmw9by5jaGFyQ29k
+ZUF0KDApPT0wP286bwpvPUMueEIuTmoobCwwLHMuU3AobCwhMCkpCm0uYj1vCmlmKHMuZHMobykpQy5O
+bS5ZKG0uZSwwLHMuZ21JKCkpCm89bS53KDApfWVsc2UgaWYocy5ZcihuKT4wKXtwPSFzLmhLKG4pCm89
+SC5kKG4pfWVsc2V7az1uLmxlbmd0aAppZihrIT09MCl7aWYoMD49aylyZXR1cm4gSC5PSChuLDApCms9
+cy5VZChuWzBdKX1lbHNlIGs9ITEKaWYoIWspaWYocSlvKz1zLmdtSSgpCm8rPW59cT1zLmRzKG4pfXJl
+dHVybiBvLmNoYXJDb2RlQXQoMCk9PTA/bzpvfSwKbzU6ZnVuY3Rpb24oYSl7dmFyIHQKaWYoIXRoaXMu
+eTMoYSkpcmV0dXJuIGEKdD1YLkNMKGEsdGhpcy5hKQp0LnJSKCkKcmV0dXJuIHQudygwKX0sCnkzOmZ1
+bmN0aW9uKGEpe3ZhciB0LHMscixxLHAsbyxuLG0sbCxrCmEudG9TdHJpbmcKdD10aGlzLmEKcz10Llly
+KGEpCmlmKHMhPT0wKXtpZih0PT09JC5LaygpKWZvcihyPTA7cjxzOysrcilpZihDLnhCLlcoYSxyKT09
+PTQ3KXJldHVybiEwCnE9cwpwPTQ3fWVsc2V7cT0wCnA9bnVsbH1mb3Iobz1uZXcgSC5xaihhKS5hLG49
+by5sZW5ndGgscj1xLG09bnVsbDtyPG47KytyLG09cCxwPWwpe2w9Qy54Qi5tKG8scikKaWYodC5yNChs
+KSl7aWYodD09PSQuS2soKSYmbD09PTQ3KXJldHVybiEwCmlmKHAhPW51bGwmJnQucjQocCkpcmV0dXJu
+ITAKaWYocD09PTQ2KWs9bT09bnVsbHx8bT09PTQ2fHx0LnI0KG0pCmVsc2Ugaz0hMQppZihrKXJldHVy
+biEwfX1pZihwPT1udWxsKXJldHVybiEwCmlmKHQucjQocCkpcmV0dXJuITAKaWYocD09PTQ2KXQ9bT09
+bnVsbHx8dC5yNChtKXx8bT09PTQ2CmVsc2UgdD0hMQppZih0KXJldHVybiEwCnJldHVybiExfSwKSFA6
+ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIscSxwLG8sbixtPXRoaXMsbD0nVW5hYmxlIHRvIGZpbmQgYSBw
+YXRoIHRvICInCmI9bS5XTygwLGIpCnQ9bS5hCmlmKHQuWXIoYik8PTAmJnQuWXIoYSk+MClyZXR1cm4g
+bS5vNShhKQppZih0LllyKGEpPD0wfHx0LmhLKGEpKWE9bS5XTygwLGEpCmlmKHQuWXIoYSk8PTAmJnQu
+WXIoYik+MCl0aHJvdyBILmIoWC5JNyhsK0guZChhKSsnIiBmcm9tICInK0guZChiKSsnIi4nKSkKcz1Y
+LkNMKGIsdCkKcy5yUigpCnI9WC5DTChhLHQpCnIuclIoKQpxPXMuZApwPXEubGVuZ3RoCmlmKHAhPT0w
+KXtpZigwPj1wKXJldHVybiBILk9IKHEsMCkKcT1KLlJNKHFbMF0sIi4iKX1lbHNlIHE9ITEKaWYocSly
+ZXR1cm4gci53KDApCnE9cy5iCnA9ci5iCmlmKHEhPXApcT1xPT1udWxsfHxwPT1udWxsfHwhdC5OYyhx
+LHApCmVsc2UgcT0hMQppZihxKXJldHVybiByLncoMCkKd2hpbGUoITApe3E9cy5kCnA9cS5sZW5ndGgK
+aWYocCE9PTApe289ci5kCm49by5sZW5ndGgKaWYobiE9PTApe2lmKDA+PXApcmV0dXJuIEguT0gocSww
+KQpxPXFbMF0KaWYoMD49bilyZXR1cm4gSC5PSChvLDApCm89dC5OYyhxLG9bMF0pCnE9b31lbHNlIHE9
+ITF9ZWxzZSBxPSExCmlmKCFxKWJyZWFrCkMuTm0uVzQocy5kLDApCkMuTm0uVzQocy5lLDEpCkMuTm0u
+VzQoci5kLDApCkMuTm0uVzQoci5lLDEpfXE9cy5kCnA9cS5sZW5ndGgKaWYocCE9PTApe2lmKDA+PXAp
+cmV0dXJuIEguT0gocSwwKQpxPUouUk0ocVswXSwiLi4iKX1lbHNlIHE9ITEKaWYocSl0aHJvdyBILmIo
+WC5JNyhsK0guZChhKSsnIiBmcm9tICInK0guZChiKSsnIi4nKSkKcT11Lk4KQy5ObS5VRyhyLmQsMCxQ
+Lk84KHMuZC5sZW5ndGgsIi4uIiwhMSxxKSkKQy5ObS5ZKHIuZSwwLCIiKQpDLk5tLlVHKHIuZSwxLFAu
+Tzgocy5kLmxlbmd0aCx0LmdtSSgpLCExLHEpKQp0PXIuZApxPXQubGVuZ3RoCmlmKHE9PT0wKXJldHVy
+biIuIgppZihxPjEmJkouUk0oQy5ObS5ncloodCksIi4iKSl7dD1yLmQKaWYoMD49dC5sZW5ndGgpcmV0
+dXJuIEguT0godCwtMSkKdC5wb3AoKQp0PXIuZQpDLk5tLm12KHQpCkMuTm0ubXYodCkKQy5ObS5pKHQs
+IiIpfXIuYj0iIgpyLklWKCkKcmV0dXJuIHIudygwKX19Ck0uTWkucHJvdG90eXBlPXsKJDE6ZnVuY3Rp
+b24oYSl7cmV0dXJuIEgueShhKSE9bnVsbH0sCiRTOjd9Ck0ucTcucHJvdG90eXBlPXsKJDE6ZnVuY3Rp
+b24oYSl7cmV0dXJuIEgueShhKSE9PSIifSwKJFM6N30KTS5Oby5wcm90b3R5cGU9ewokMTpmdW5jdGlv
+bihhKXtILnkoYSkKcmV0dXJuIGE9PW51bGw/Im51bGwiOiciJythKyciJ30sCiRTOjV9CkIuZnYucHJv
+dG90eXBlPXsKeFo6ZnVuY3Rpb24oYSl7dmFyIHQscz10aGlzLllyKGEpCmlmKHM+MClyZXR1cm4gSi5s
+ZChhLDAscykKaWYodGhpcy5oSyhhKSl7aWYoMD49YS5sZW5ndGgpcmV0dXJuIEguT0goYSwwKQp0PWFb
+MF19ZWxzZSB0PW51bGwKcmV0dXJuIHR9LApOYzpmdW5jdGlvbihhLGIpe3JldHVybiBhPT1ifX0KWC5X
+RC5wcm90b3R5cGU9ewpJVjpmdW5jdGlvbigpe3ZhciB0LHMscj10aGlzCndoaWxlKCEwKXt0PXIuZApp
+ZighKHQubGVuZ3RoIT09MCYmSi5STShDLk5tLmdyWih0KSwiIikpKWJyZWFrCnQ9ci5kCmlmKDA+PXQu
+bGVuZ3RoKXJldHVybiBILk9IKHQsLTEpCnQucG9wKCkKQy5ObS5tdihyLmUpfXQ9ci5lCnM9dC5sZW5n
+dGgKaWYocyE9PTApQy5ObS5ZKHQscy0xLCIiKX0sCnJSOmZ1bmN0aW9uKCl7dmFyIHQscyxyLHEscCxv
+LG49dGhpcyxtPUguVk0oW10sdS5zKQpmb3IodD1uLmQscz10Lmxlbmd0aCxyPTAscT0wO3E8dC5sZW5n
+dGg7dC5sZW5ndGg9PT1zfHwoMCxILmxrKSh0KSwrK3Epe3A9dFtxXQpvPUouaWEocCkKaWYoIShvLkRO
+KHAsIi4iKXx8by5ETihwLCIiKSkpaWYoby5ETihwLCIuLiIpKXtvPW0ubGVuZ3RoCmlmKG8hPT0wKXtp
+ZigwPj1vKXJldHVybiBILk9IKG0sLTEpCm0ucG9wKCl9ZWxzZSArK3J9ZWxzZSBDLk5tLmkobSxwKX1p
+ZihuLmI9PW51bGwpQy5ObS5VRyhtLDAsUC5POChyLCIuLiIsITEsdS5OKSkKaWYobS5sZW5ndGg9PT0w
+JiZuLmI9PW51bGwpQy5ObS5pKG0sIi4iKQpuLnNuSihtKQp0PW4uYQpuLnNQaChQLk84KG0ubGVuZ3Ro
+KzEsdC5nbUkoKSwhMCx1Lk4pKQpzPW4uYgppZihzPT1udWxsfHxtLmxlbmd0aD09PTB8fCF0LmRzKHMp
+KUMuTm0uWShuLmUsMCwiIikKcz1uLmIKaWYocyE9bnVsbCYmdD09PSQuS2soKSl7cy50b1N0cmluZwpu
+LmI9SC55cyhzLCIvIiwiXFwiKX1uLklWKCl9LAp3OmZ1bmN0aW9uKGEpe3ZhciB0LHMscj10aGlzLHE9
+ci5iCnE9cSE9bnVsbD9xOiIiCmZvcih0PTA7dDxyLmQubGVuZ3RoOysrdCl7cz1yLmUKaWYodD49cy5s
+ZW5ndGgpcmV0dXJuIEguT0gocyx0KQpzPXErSC5kKHNbdF0pCnE9ci5kCmlmKHQ+PXEubGVuZ3RoKXJl
+dHVybiBILk9IKHEsdCkKcT1zK0guZChxW3RdKX1xKz1ILmQoQy5ObS5nclooci5lKSkKcmV0dXJuIHEu
+Y2hhckNvZGVBdCgwKT09MD9xOnF9LApzbko6ZnVuY3Rpb24oYSl7dGhpcy5kPXUuYS5iKGEpfSwKc1Bo
+OmZ1bmN0aW9uKGEpe3RoaXMuZT11LmEuYihhKX19ClguZHYucHJvdG90eXBlPXsKdzpmdW5jdGlvbihh
+KXtyZXR1cm4iUGF0aEV4Y2VwdGlvbjogIit0aGlzLmF9LAokaVJ6OjF9Ck8uekwucHJvdG90eXBlPXsK
+dzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5nb2ModGhpcyl9fQpFLk9GLnByb3RvdHlwZT17ClVkOmZ1
+bmN0aW9uKGEpe3JldHVybiBDLnhCLnRnKGEsIi8iKX0sCnI0OmZ1bmN0aW9uKGEpe3JldHVybiBhPT09
+NDd9LApkczpmdW5jdGlvbihhKXt2YXIgdD1hLmxlbmd0aApyZXR1cm4gdCE9PTAmJkMueEIubShhLHQt
+MSkhPT00N30sClNwOmZ1bmN0aW9uKGEsYil7aWYoYS5sZW5ndGghPT0wJiZDLnhCLlcoYSwwKT09PTQ3
+KXJldHVybiAxCnJldHVybiAwfSwKWXI6ZnVuY3Rpb24oYSl7cmV0dXJuIHRoaXMuU3AoYSwhMSl9LApo
+SzpmdW5jdGlvbihhKXtyZXR1cm4hMX0sCmdvYzpmdW5jdGlvbigpe3JldHVybiJwb3NpeCJ9LApnbUk6
+ZnVuY3Rpb24oKXtyZXR1cm4iLyJ9fQpGLnJ1LnByb3RvdHlwZT17ClVkOmZ1bmN0aW9uKGEpe3JldHVy
+biBDLnhCLnRnKGEsIi8iKX0sCnI0OmZ1bmN0aW9uKGEpe3JldHVybiBhPT09NDd9LApkczpmdW5jdGlv
+bihhKXt2YXIgdD1hLmxlbmd0aAppZih0PT09MClyZXR1cm4hMQppZihDLnhCLm0oYSx0LTEpIT09NDcp
+cmV0dXJuITAKcmV0dXJuIEMueEIuVGMoYSwiOi8vIikmJnRoaXMuWXIoYSk9PT10fSwKU3A6ZnVuY3Rp
+b24oYSxiKXt2YXIgdCxzLHIscSxwPWEubGVuZ3RoCmlmKHA9PT0wKXJldHVybiAwCmlmKEMueEIuVyhh
+LDApPT09NDcpcmV0dXJuIDEKZm9yKHQ9MDt0PHA7Kyt0KXtzPUMueEIuVyhhLHQpCmlmKHM9PT00Nyly
+ZXR1cm4gMAppZihzPT09NTgpe2lmKHQ9PT0wKXJldHVybiAwCnI9Qy54Qi5YVShhLCIvIixDLnhCLlFp
+KGEsIi8vIix0KzEpP3QrMzp0KQppZihyPD0wKXJldHVybiBwCmlmKCFifHxwPHIrMylyZXR1cm4gcgpp
+ZighQy54Qi5uKGEsImZpbGU6Ly8iKSlyZXR1cm4gcgppZighQi5ZdShhLHIrMSkpcmV0dXJuIHIKcT1y
+KzMKcmV0dXJuIHA9PT1xP3E6cis0fX1yZXR1cm4gMH0sCllyOmZ1bmN0aW9uKGEpe3JldHVybiB0aGlz
+LlNwKGEsITEpfSwKaEs6ZnVuY3Rpb24oYSl7cmV0dXJuIGEubGVuZ3RoIT09MCYmQy54Qi5XKGEsMCk9
+PT00N30sCmdvYzpmdW5jdGlvbigpe3JldHVybiJ1cmwifSwKZ21JOmZ1bmN0aW9uKCl7cmV0dXJuIi8i
+fX0KTC5JVi5wcm90b3R5cGU9ewpVZDpmdW5jdGlvbihhKXtyZXR1cm4gQy54Qi50ZyhhLCIvIil9LApy
+NDpmdW5jdGlvbihhKXtyZXR1cm4gYT09PTQ3fHxhPT09OTJ9LApkczpmdW5jdGlvbihhKXt2YXIgdD1h
+Lmxlbmd0aAppZih0PT09MClyZXR1cm4hMQp0PUMueEIubShhLHQtMSkKcmV0dXJuISh0PT09NDd8fHQ9
+PT05Mil9LApTcDpmdW5jdGlvbihhLGIpe3ZhciB0LHMscj1hLmxlbmd0aAppZihyPT09MClyZXR1cm4g
+MAp0PUMueEIuVyhhLDApCmlmKHQ9PT00NylyZXR1cm4gMQppZih0PT09OTIpe2lmKHI8Mnx8Qy54Qi5X
+KGEsMSkhPT05MilyZXR1cm4gMQpzPUMueEIuWFUoYSwiXFwiLDIpCmlmKHM+MCl7cz1DLnhCLlhVKGEs
+IlxcIixzKzEpCmlmKHM+MClyZXR1cm4gc31yZXR1cm4gcn1pZihyPDMpcmV0dXJuIDAKaWYoIUIuT1Mo
+dCkpcmV0dXJuIDAKaWYoQy54Qi5XKGEsMSkhPT01OClyZXR1cm4gMApyPUMueEIuVyhhLDIpCmlmKCEo
+cj09PTQ3fHxyPT09OTIpKXJldHVybiAwCnJldHVybiAzfSwKWXI6ZnVuY3Rpb24oYSl7cmV0dXJuIHRo
+aXMuU3AoYSwhMSl9LApoSzpmdW5jdGlvbihhKXtyZXR1cm4gdGhpcy5ZcihhKT09PTF9LApPdDpmdW5j
+dGlvbihhLGIpe3ZhciB0CmlmKGE9PT1iKXJldHVybiEwCmlmKGE9PT00NylyZXR1cm4gYj09PTkyCmlm
+KGE9PT05MilyZXR1cm4gYj09PTQ3CmlmKChhXmIpIT09MzIpcmV0dXJuITEKdD1hfDMyCnJldHVybiB0
+Pj05NyYmdDw9MTIyfSwKTmM6ZnVuY3Rpb24oYSxiKXt2YXIgdCxzLHIKaWYoYT09YilyZXR1cm4hMAp0
+PWEubGVuZ3RoCmlmKHQhPT1iLmxlbmd0aClyZXR1cm4hMQpmb3Iocz1KLnJZKGIpLHI9MDtyPHQ7Kyty
+KWlmKCF0aGlzLk90KEMueEIuVyhhLHIpLHMuVyhiLHIpKSlyZXR1cm4hMQpyZXR1cm4hMH0sCmdvYzpm
+dW5jdGlvbigpe3JldHVybiJ3aW5kb3dzIn0sCmdtSTpmdW5jdGlvbigpe3JldHVybiJcXCJ9fTsoZnVu
+Y3Rpb24gYWxpYXNlcygpe3ZhciB0PUoudkIucHJvdG90eXBlCnQuVT10LncKdC5Taj10LmU3CnQ9Si5N
+Ri5wcm90b3R5cGUKdC50PXQudwp0PVAuY1gucHJvdG90eXBlCnQuR0c9dC5ldgp0PVAuay5wcm90b3R5
+cGUKdC54Yj10LncKdD1XLmN2LnByb3RvdHlwZQp0LkRXPXQucjYKdD1XLm02LnByb3RvdHlwZQp0LmpG
+PXQuRWIKdD1QLkU0LnByb3RvdHlwZQp0LlVyPXQucQp0LmU0PXQuWX0pKCk7KGZ1bmN0aW9uIGluc3Rh
+bGxUZWFyT2Zmcygpe3ZhciB0PWh1bmtIZWxwZXJzLl9zdGF0aWNfMSxzPWh1bmtIZWxwZXJzLl9zdGF0
+aWNfMCxyPWh1bmtIZWxwZXJzLmluc3RhbGxJbnN0YW5jZVRlYXJPZmYscT1odW5rSGVscGVycy5pbnN0
+YWxsU3RhdGljVGVhck9mZixwPWh1bmtIZWxwZXJzLl9pbnN0YW5jZV8xdQp0KFAsIkVYIiwiWlYiLDgp
+CnQoUCwieXQiLCJvQSIsOCkKdChQLCJxVyIsIkJ6Iiw4KQpzKFAsIlVJIiwiZU4iLDIpCnIoUC5QZi5w
+cm90b3R5cGUsImdZSiIsMCwxLG51bGwsWyIkMiIsIiQxIl0sWyJ3MCIsInBtIl0sMjgsMCkKdChQLCJD
+eSIsIk5DIiwxKQp0KFAsIlBIIiwiTXQiLDUpCnEoVywicFMiLDQsbnVsbCxbIiQ0Il0sWyJxRCJdLDks
+MCkKcShXLCJWNCIsNCxudWxsLFsiJDQiXSxbIlFXIl0sOSwwKQpwKFAuQXMucHJvdG90eXBlLCJndU0i
+LCJUIiw1KQp0KFAsImlHIiwid1kiLDEpCnQoUCwidzAiLCJMNyIsMzIpCnQoTCwiaVMiLCJpNiIsMTgp
+fSkoKTsoZnVuY3Rpb24gaW5oZXJpdGFuY2UoKXt2YXIgdD1odW5rSGVscGVycy5taXhpbixzPWh1bmtI
+ZWxwZXJzLmluaGVyaXQscj1odW5rSGVscGVycy5pbmhlcml0TWFueQpzKFAuayxudWxsKQpyKFAuayxb
+SC5lbyxKLnZCLEoubTEsUC5uWSxQLmNYLEguYTcsUC5BbixILlNVLEguUmUsSC53dixQLlBuLEguV1Us
+SC5MSSxILlRwLEguZjksUC5YUyxILmJxLEguWE8sUC5ZayxILmRiLEguTjYsSC5WUixILkVLLEguUGIs
+SC50USxILlNkLEguSmMsSC5HLFAuVzMsUC5paCxQLkZ5LFAuR1YsUC5iOCxQLlBmLFAuRmUsUC52cyxQ
+Lk9NLFAucWgsUC5NTyxQLmtULFAueEksUC5DdyxQLm0wLFAuWHYsUC5ibixQLmxtLFAubEQsUC5LUCxQ
+LmxmLFAuVEMsUC5VayxQLlNoLFAuUncsUC5ieixQLmEyLFAuaVAsUC5GSyxQLms1LFAuS1ksUC5DRCxQ
+LmFFLFAuRUgsUC56TSxQLlowLFAuTjMsUC5jOCxQLk9kLFAuaWIsUC5HeixQLnFVLFAuUm4sUC5HRCxQ
+LkRuLFAuUEUsUC5VZixXLmlkLFcuRmssVy5KUSxXLkdtLFcudkQsVy5tNixXLk93LFcuVzksVy5kVyxX
+LkZiLFcua0YsVy5tayxXLktvLFAuaUosUC5FNCxQLm42LE0uSDcsVS5MTCxVLmQyLFUuU2UsVS5NbCxV
+LnlELFUud2IsQi5qOCxCLnFwLFQubVEsTC5YQSxMLlpaLEwuTzksTS5sSSxPLnpMLFguV0QsWC5kdl0p
+CnIoSi52QixbSi55RSxKLllFLEouTUYsSi5qZCxKLnFJLEouRHIsSC5FVCxXLkQwLFcuQXosVy5MZSxX
+Lk5oLFcuSUIsVy5uNyxXLmVhLFcuYnIsVy5TZyxXLnU4LFcuSzcsVy5YVyxQLmhGXSkKcihKLk1GLFtK
+LmlDLEoua2QsSi5jNV0pCnMoSi5QbyxKLmpkKQpyKEoucUksW0ouYlUsSi5WQV0pCnMoUC51eSxQLm5Z
+KQpyKFAudXksW0guWEMsVy53eixXLmU3XSkKcyhILnFqLEguWEMpCnIoUC5jWCxbSC5iUSxILmkxLEgu
+VTUsSC5YUixQLm1XLEgudW5dKQpyKEguYlEsW0guYUwsSC5pNSxQLnh1XSkKcihILmFMLFtILm5ILEgu
+QTgsUC5pOF0pCnMoSC54eSxILmkxKQpyKFAuQW4sW0guTUgsSC5TT10pCnMoUC5SVSxQLlBuKQpzKFAu
+R2osUC5SVSkKcyhILlBELFAuR2opCnMoSC5MUCxILldVKQpyKEguVHAsW0guQ2osSC5BbSxILmxjLEgu
+ZEMsSC53TixILlZYLFAudGgsUC5oYSxQLlZzLFAuRnQsUC55SCxQLldNLFAuU1gsUC5HcyxQLmRhLFAu
+b1EsUC5wVixQLlU3LFAudnIsUC5ySCxQLktGLFAuWkwsUC5SVCxQLmpaLFAucnEsUC5SVyxQLkI1LFAu
+dU8sUC5wSyxQLmhqLFAuVnAsUC5PUixQLnJhLFAueVEsUC50aSxQLldGLFAubjEsUC5jUyxQLlZDLFAu
+SlQsUC5lMSxQLk5ZLFAuUlosUC5NRSxQLnk1LFAucTMsUC55SSxQLmM2LFAucWQsVy5DdixXLktTLFcu
+QTMsVy52TixXLlV2LFcuRWcsVy5FbyxXLldrLFcuSUEsVy5mbSxQLmxSLFAuamcsUC5HRSxQLk43LFAu
+dVEsUC5QQyxQLm10LFAuTnosUC5RUyxQLm5wLFUuTUQsVS5hTixVLmIwLEwuZSxMLlZXLEwub1osTC5q
+cixMLnFsLEwueTgsTC5IaSxMLkJULEwuTCxMLld4LEwuQU8sTC5kTixMLkhvLEwueHosTC5JQyxMLmZD
+LEwublQsTC5CWixMLkdILEwuRUUsTC5RTCxMLlZTLEwuVEQsTC5BUyxNLk1pLE0ucTcsTS5Ob10pCnIo
+UC5YUyxbSC5XMCxILmF6LEgudlYsSC5FcSxQLkM2LEgudTksUC5VZCxQLm4sUC51LFAubXAsUC51YixQ
+LmRzLFAubGosUC5VVixQLmNdKQpyKEgubGMsW0guengsSC5yVF0pCnMoSC5rWSxQLkM2KQpzKFAuaWws
+UC5ZaykKcihQLmlsLFtILk41LFAudXcsVy5jZixXLlN5XSkKcihQLm1XLFtILktXLFAucTRdKQpzKEgu
+TFosSC5FVCkKcihILkxaLFtILlJHLEguV0JdKQpzKEguVlAsSC5SRykKcyhILkRnLEguVlApCnMoSC5a
+RyxILldCKQpzKEguUGcsSC5aRykKcihILlBnLFtILnhqLEguZEUsSC5aQSxILndmLEguUHEsSC5lRSxI
+LlY2XSkKcihILnU5LFtILmh6LEguaU1dKQpzKFAuWmYsUC5QZikKcyhQLkppLFAubTApCnMoUC5iNixQ
+Llh2KQpzKFAuVmosUC5UQykKcihQLlVrLFtQLkNWLFAuWmksUC5ieV0pCnMoUC53SSxQLmtUKQpyKFAu
+d0ksW1AuVTgsUC5vaixQLk14LFAuRTMsUC5HWV0pCnMoUC5LOCxQLlVkKQpzKFAudHUsUC5TaCkKcyhQ
+LnU1LFAuWmkpCnIoUC5GSyxbUC5DUCxQLktOXSkKcihQLnUsW1AuYkosUC5lWV0pCnMoUC5xZSxQLkRu
+KQpyKFcuRDAsW1cudUgsVy53YSxXLks1LFcuQ21dKQpyKFcudUgsW1cuY3YsVy5ueCxXLlFGLFcuQ1Fd
+KQpyKFcuY3YsW1cucUUsUC5kNV0pCnIoVy5xRSxbVy5HaCxXLmZZLFcubkIsVy5RUCxXLmg0LFcuU04s
+Vy5scCxXLlRiLFcuSXYsVy5XUCxXLnlZXSkKcyhXLm9KLFcuTGUpCnMoVy5oSCxXLkF6KQpzKFcuVmIs
+Vy5RRikKcyhXLk83LFcud2EpCnIoVy5lYSxbVy53NixXLmV3XSkKcyhXLkFqLFcudzYpCnMoVy5yQixX
+Lks3KQpzKFcuQkgsVy5yQikKcyhXLnc0LFcuSUIpCnMoVy5vYSxXLlhXKQpzKFcucmgsVy5vYSkKcyhX
+Lmk3LFcuY2YpCnMoUC5BcyxQLlZqKQpyKFAuQXMsW1cuSTQsUC5LZV0pCnMoVy5STyxQLnFoKQpzKFcu
+ZXUsVy5STykKcyhXLnhDLFAuTU8pCnMoVy5jdCxXLm02KQpzKFAuQmYsUC5pSikKcihQLkU0LFtQLnI3
+LFAuY29dKQpzKFAuVHosUC5jbykKcyhQLm5kLFAuZDUpCnMoQi5mdixPLnpMKQpyKEIuZnYsW0UuT0Ys
+Ri5ydSxMLklWXSkKdChILlhDLEguUmUpCnQoSC5SRyxQLmxEKQp0KEguVlAsSC5TVSkKdChILldCLFAu
+bEQpCnQoSC5aRyxILlNVKQp0KFAublksUC5sRCkKdChQLlRDLFAubGYpCnQoUC5SVSxQLktQKQp0KFcu
+TGUsVy5pZCkKdChXLks3LFAubEQpCnQoVy5yQixXLkdtKQp0KFcuWFcsUC5sRCkKdChXLm9hLFcuR20p
+CnQoUC5jbyxQLmxEKX0pKCkKdmFyIHY9e3R5cGVVbml2ZXJzZTp7ZUM6bmV3IE1hcCgpLHRSOnt9LGVU
+Ont9LHRQVjp7fSxzRUE6W119LG1hbmdsZWRHbG9iYWxOYW1lczp7S046ImludCIsQ1A6ImRvdWJsZSIs
+Rks6Im51bSIscVU6IlN0cmluZyIsYTI6ImJvb2wiLGM4OiJOdWxsIix6TToiTGlzdCJ9LG1hbmdsZWRO
+YW1lczp7fSxnZXRUeXBlRnJvbU5hbWU6Z2V0R2xvYmFsRnJvbU5hbWUsbWV0YWRhdGE6W10sdHlwZXM6
+WyJjOCgpIiwiQChAKSIsIn4oKSIsImM4KEFqKSIsImM4KEAsQCkiLCJxVShxVSkiLCJjOChjdikiLCJh
+MihxVSkiLCJ+KH4oKSkiLCJhMihjdixxVSxxVSxKUSkiLCJjOChAKSIsIn4oeHU8cVU+KSIsImM4KHFV
+LEApIiwiYzgocVUpIiwiYzgocVUscVUpIiwiYTIoa0YpIiwiYzgoZWEpIiwiYjg8Yzg+KEFqKSIsIn4o
+QWopIiwiWjA8cVUscVU+KFowPHFVLHFVPixxVSkiLCJjOCh+KCkpIiwiYzgoQCxHeikiLCJ+KHFVLHFV
+KSIsIm42KEtOKSIsIm42KEAsQCkiLCJhMih1SCkiLCJjOChLTixAKSIsIkAoZWEpIiwifihrW0d6XSki
+LCJjOChAW0d6XSkiLCJ+KHVILHVIKSIsImEyKHh1PHFVPikiLCJrKEApIiwicjcoQCkiLCJUejxAPihA
+KSIsIkU0KEApIiwiYTIoSDcpIiwiTEwoQCkiLCJaMDxxVSxrPihMTCkiLCJ2czxAPihAKSIsIkAocVUp
+IiwiYzgoWjA8cVUsaz4pIiwiYzgoR0QsQCkiLCJxVShBaikiLCJAKEAscVUpIiwiYzgoZXcpIiwifihx
+VSxLTikiLCJ+KHFVW0BdKSIsIktOKEtOLEtOKSIsIn4oQCkiXSxpbnRlcmNlcHRvcnNCeVRhZzpudWxs
+LGxlYWZUYWdzOm51bGx9CkgueGIodi50eXBlVW5pdmVyc2UsSlNPTi5wYXJzZSgneyJjNSI6Ik1GIiwi
+aUMiOiJNRiIsImtkIjoiTUYiLCJyeCI6ImVhIiwiZTUiOiJlYSIsIlkwIjoiZDUiLCJ0cCI6ImQ1Iiwi
+djAiOiJldyIsIk1yIjoicUUiLCJlTCI6InFFIiwiSTAiOiJ1SCIsImhzIjoidUgiLCJYZyI6IlFGIiwi
+bnIiOiJBaiIsInk0IjoidzYiLCJhUCI6IkNtIiwieGMiOiJueCIsImtKIjoibngiLCJ6VSI6IkRnIiwi
+ZGYiOiJFVCIsInlFIjp7ImEyIjpbXX0sIllFIjp7ImM4IjpbXX0sIk1GIjp7InZtIjpbXSwiRUgiOltd
+fSwiamQiOnsiek0iOlsiMSJdLCJiUSI6WyIxIl0sImNYIjpbIjEiXX0sIlBvIjp7ImpkIjpbIjEiXSwi
+ek0iOlsiMSJdLCJiUSI6WyIxIl0sImNYIjpbIjEiXX0sIm0xIjp7IkFuIjpbIjEiXX0sInFJIjp7IkNQ
+IjpbXSwiRksiOltdfSwiYlUiOnsiS04iOltdLCJDUCI6W10sIkZLIjpbXX0sIlZBIjp7IkNQIjpbXSwi
+RksiOltdfSwiRHIiOnsicVUiOltdLCJ2WCI6W119LCJxaiI6eyJSZSI6WyJLTiJdLCJsRCI6WyJLTiJd
+LCJ6TSI6WyJLTiJdLCJiUSI6WyJLTiJdLCJjWCI6WyJLTiJdLCJsRC5FIjoiS04iLCJSZS5FIjoiS04i
+fSwiYlEiOnsiY1giOlsiMSJdfSwiYUwiOnsiYlEiOlsiMSJdLCJjWCI6WyIxIl19LCJuSCI6eyJhTCI6
+WyIxIl0sImJRIjpbIjEiXSwiY1giOlsiMSJdLCJhTC5FIjoiMSIsImNYLkUiOiIxIn0sImE3Ijp7IkFu
+IjpbIjEiXX0sImkxIjp7ImNYIjpbIjIiXSwiY1guRSI6IjIifSwieHkiOnsiaTEiOlsiMSIsIjIiXSwi
+YlEiOlsiMiJdLCJjWCI6WyIyIl0sImNYLkUiOiIyIn0sIk1IIjp7IkFuIjpbIjIiXX0sIkE4Ijp7ImFM
+IjpbIjIiXSwiYlEiOlsiMiJdLCJjWCI6WyIyIl0sImFMLkUiOiIyIiwiY1guRSI6IjIifSwiVTUiOnsi
+Y1giOlsiMSJdLCJjWC5FIjoiMSJ9LCJTTyI6eyJBbiI6WyIxIl19LCJYQyI6eyJSZSI6WyIxIl0sImxE
+IjpbIjEiXSwiek0iOlsiMSJdLCJiUSI6WyIxIl0sImNYIjpbIjEiXX0sInd2Ijp7IkdEIjpbXX0sIlBE
+Ijp7IkdqIjpbIjEiLCIyIl0sIlJVIjpbIjEiLCIyIl0sIlBuIjpbIjEiLCIyIl0sIktQIjpbIjEiLCIy
+Il0sIlowIjpbIjEiLCIyIl19LCJXVSI6eyJaMCI6WyIxIiwiMiJdfSwiTFAiOnsiV1UiOlsiMSIsIjIi
+XSwiWjAiOlsiMSIsIjIiXX0sIlhSIjp7ImNYIjpbIjEiXSwiY1guRSI6IjEifSwiTEkiOnsidlEiOltd
+fSwiVzAiOnsiWFMiOltdfSwiYXoiOnsiWFMiOltdfSwidlYiOnsiWFMiOltdfSwiWE8iOnsiR3oiOltd
+fSwiVHAiOnsiRUgiOltdfSwibGMiOnsiRUgiOltdfSwiengiOnsiRUgiOltdfSwiclQiOnsiRUgiOltd
+fSwiRXEiOnsiWFMiOltdfSwia1kiOnsiWFMiOltdfSwiTjUiOnsiRm8iOlsiMSIsIjIiXSwiWWsiOlsi
+MSIsIjIiXSwiWjAiOlsiMSIsIjIiXSwiWWsuSyI6IjEiLCJZay5WIjoiMiJ9LCJpNSI6eyJiUSI6WyIx
+Il0sImNYIjpbIjEiXSwiY1guRSI6IjEifSwiTjYiOnsiQW4iOlsiMSJdfSwiVlIiOnsid0wiOltdLCJ2
+WCI6W119LCJFSyI6eyJpYiI6W10sIk9kIjpbXX0sIktXIjp7ImNYIjpbImliIl0sImNYLkUiOiJpYiJ9
+LCJQYiI6eyJBbiI6WyJpYiJdfSwidFEiOnsiT2QiOltdfSwidW4iOnsiY1giOlsiT2QiXSwiY1guRSI6
+Ik9kIn0sIlNkIjp7IkFuIjpbIk9kIl19LCJFVCI6eyJlcSI6W119LCJMWiI6eyJYaiI6WyJAIl0sIkVU
+IjpbXSwiZXEiOltdfSwiRGciOnsibEQiOlsiQ1AiXSwiWGoiOlsiQCJdLCJ6TSI6WyJDUCJdLCJFVCI6
+W10sImJRIjpbIkNQIl0sIlNVIjpbIkNQIl0sImVxIjpbXSwiY1giOlsiQ1AiXSwibEQuRSI6IkNQIn0s
+IlBnIjp7ImxEIjpbIktOIl0sInpNIjpbIktOIl0sIlhqIjpbIkAiXSwiRVQiOltdLCJiUSI6WyJLTiJd
+LCJTVSI6WyJLTiJdLCJlcSI6W10sImNYIjpbIktOIl19LCJ4aiI6eyJsRCI6WyJLTiJdLCJ6TSI6WyJL
+TiJdLCJYaiI6WyJAIl0sIkVUIjpbXSwiYlEiOlsiS04iXSwiU1UiOlsiS04iXSwiZXEiOltdLCJjWCI6
+WyJLTiJdLCJsRC5FIjoiS04ifSwiZEUiOnsibEQiOlsiS04iXSwiek0iOlsiS04iXSwiWGoiOlsiQCJd
+LCJFVCI6W10sImJRIjpbIktOIl0sIlNVIjpbIktOIl0sImVxIjpbXSwiY1giOlsiS04iXSwibEQuRSI6
+IktOIn0sIlpBIjp7ImxEIjpbIktOIl0sInpNIjpbIktOIl0sIlhqIjpbIkAiXSwiRVQiOltdLCJiUSI6
+WyJLTiJdLCJTVSI6WyJLTiJdLCJlcSI6W10sImNYIjpbIktOIl0sImxELkUiOiJLTiJ9LCJ3ZiI6eyJs
+RCI6WyJLTiJdLCJ6TSI6WyJLTiJdLCJYaiI6WyJAIl0sIkVUIjpbXSwiYlEiOlsiS04iXSwiU1UiOlsi
+S04iXSwiZXEiOltdLCJjWCI6WyJLTiJdLCJsRC5FIjoiS04ifSwiUHEiOnsibEQiOlsiS04iXSwiek0i
+OlsiS04iXSwiWGoiOlsiQCJdLCJFVCI6W10sImJRIjpbIktOIl0sIlNVIjpbIktOIl0sImVxIjpbXSwi
+Y1giOlsiS04iXSwibEQuRSI6IktOIn0sImVFIjp7ImxEIjpbIktOIl0sInpNIjpbIktOIl0sIlhqIjpb
+IkAiXSwiRVQiOltdLCJiUSI6WyJLTiJdLCJTVSI6WyJLTiJdLCJlcSI6W10sImNYIjpbIktOIl0sImxE
+LkUiOiJLTiJ9LCJWNiI6eyJuNiI6W10sImxEIjpbIktOIl0sInpNIjpbIktOIl0sIlhqIjpbIkAiXSwi
+RVQiOltdLCJiUSI6WyJLTiJdLCJTVSI6WyJLTiJdLCJlcSI6W10sImNYIjpbIktOIl0sImxELkUiOiJL
+TiJ9LCJ1OSI6eyJYUyI6W119LCJoeiI6eyJYUyI6W119LCJpTSI6eyJYUyI6W119LCJHViI6eyJBbiI6
+WyIxIl19LCJxNCI6eyJjWCI6WyIxIl0sImNYLkUiOiIxIn0sIlpmIjp7IlBmIjpbIjEiXX0sInZzIjp7
+ImI4IjpbIjEiXX0sIkN3Ijp7IlhTIjpbXX0sIm0wIjp7IkpCIjpbXX0sIkppIjp7IkpCIjpbXX0sImI2
+Ijp7Ilh2IjpbIjEiXSwieHUiOlsiMSJdLCJiUSI6WyIxIl0sImNYIjpbIjEiXX0sImxtIjp7IkFuIjpb
+IjEiXX0sIm1XIjp7ImNYIjpbIjEiXX0sInV5Ijp7ImxEIjpbIjEiXSwiek0iOlsiMSJdLCJiUSI6WyIx
+Il0sImNYIjpbIjEiXX0sImlsIjp7IllrIjpbIjEiLCIyIl0sIlowIjpbIjEiLCIyIl19LCJZayI6eyJa
+MCI6WyIxIiwiMiJdfSwiUG4iOnsiWjAiOlsiMSIsIjIiXX0sIkdqIjp7IlJVIjpbIjEiLCIyIl0sIlBu
+IjpbIjEiLCIyIl0sIktQIjpbIjEiLCIyIl0sIlowIjpbIjEiLCIyIl19LCJWaiI6eyJsZiI6WyIxIl0s
+Inh1IjpbIjEiXSwiYlEiOlsiMSJdLCJjWCI6WyIxIl19LCJYdiI6eyJ4dSI6WyIxIl0sImJRIjpbIjEi
+XSwiY1giOlsiMSJdfSwidXciOnsiWWsiOlsicVUiLCJAIl0sIlowIjpbInFVIiwiQCJdLCJZay5LIjoi
+cVUiLCJZay5WIjoiQCJ9LCJpOCI6eyJhTCI6WyJxVSJdLCJiUSI6WyJxVSJdLCJjWCI6WyJxVSJdLCJh
+TC5FIjoicVUiLCJjWC5FIjoicVUifSwiQ1YiOnsiVWsiOlsiek08S04+IiwicVUiXSwiVWsuUyI6InpN
+PEtOPiJ9LCJVOCI6eyJ3SSI6WyJ6TTxLTj4iLCJxVSJdfSwiWmkiOnsiVWsiOlsicVUiLCJ6TTxLTj4i
+XX0sIlVkIjp7IlhTIjpbXX0sIks4Ijp7IlhTIjpbXX0sImJ5Ijp7IlVrIjpbImsiLCJxVSJdLCJVay5T
+IjoiayJ9LCJvaiI6eyJ3SSI6WyJrIiwicVUiXX0sIk14Ijp7IndJIjpbInFVIiwiayJdfSwidTUiOnsi
+VWsiOlsicVUiLCJ6TTxLTj4iXSwiVWsuUyI6InFVIn0sIkUzIjp7IndJIjpbInFVIiwiek08S04+Il19
+LCJHWSI6eyJ3SSI6WyJ6TTxLTj4iLCJxVSJdfSwiQ1AiOnsiRksiOltdfSwiQzYiOnsiWFMiOltdfSwi
+biI6eyJYUyI6W119LCJ1Ijp7IlhTIjpbXX0sImJKIjp7IlhTIjpbXX0sImVZIjp7IlhTIjpbXX0sIm1w
+Ijp7IlhTIjpbXX0sInViIjp7IlhTIjpbXX0sImRzIjp7IlhTIjpbXX0sImxqIjp7IlhTIjpbXX0sIlVW
+Ijp7IlhTIjpbXX0sIms1Ijp7IlhTIjpbXX0sIktZIjp7IlhTIjpbXX0sImMiOnsiWFMiOltdfSwiQ0Qi
+OnsiUnoiOltdfSwiYUUiOnsiUnoiOltdfSwiS04iOnsiRksiOltdfSwiek0iOnsiYlEiOlsiMSJdLCJj
+WCI6WyIxIl19LCJpYiI6eyJPZCI6W119LCJ4dSI6eyJiUSI6WyIxIl0sImNYIjpbIjEiXX0sInFVIjp7
+InZYIjpbXX0sIlJuIjp7IkJMIjpbXX0sIkRuIjp7ImlEIjpbXX0sIlVmIjp7ImlEIjpbXX0sInFlIjp7
+ImlEIjpbXX0sInFFIjp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119LCJHaCI6eyJjdiI6W10sInVIIjpb
+XSwiRDAiOltdfSwiZlkiOnsiY3YiOltdLCJ1SCI6W10sIkQwIjpbXX0sIm5CIjp7ImN2IjpbXSwidUgi
+OltdLCJEMCI6W119LCJRUCI6eyJjdiI6W10sInVIIjpbXSwiRDAiOltdfSwibngiOnsidUgiOltdLCJE
+MCI6W119LCJRRiI6eyJ1SCI6W10sIkQwIjpbXX0sIklCIjp7InRuIjpbIkZLIl19LCJ3eiI6eyJsRCI6
+WyIxIl0sInpNIjpbIjEiXSwiYlEiOlsiMSJdLCJjWCI6WyIxIl0sImxELkUiOiIxIn0sImN2Ijp7InVI
+IjpbXSwiRDAiOltdfSwiaEgiOnsiQXoiOltdfSwiaDQiOnsiY3YiOltdLCJ1SCI6W10sIkQwIjpbXX0s
+IlZiIjp7InVIIjpbXSwiRDAiOltdfSwiTzciOnsiRDAiOltdfSwid2EiOnsiRDAiOltdfSwiQWoiOnsi
+ZWEiOltdfSwiZTciOnsibEQiOlsidUgiXSwiek0iOlsidUgiXSwiYlEiOlsidUgiXSwiY1giOlsidUgi
+XSwibEQuRSI6InVIIn0sInVIIjp7IkQwIjpbXX0sIkJIIjp7IkdtIjpbInVIIl0sImxEIjpbInVIIl0s
+InpNIjpbInVIIl0sIlhqIjpbInVIIl0sImJRIjpbInVIIl0sImNYIjpbInVIIl0sImxELkUiOiJ1SCIs
+IkdtLkUiOiJ1SCJ9LCJTTiI6eyJjdiI6W10sInVIIjpbXSwiRDAiOltdfSwiZXciOnsiZWEiOltdfSwi
+bHAiOnsiY3YiOltdLCJ1SCI6W10sIkQwIjpbXX0sIlRiIjp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119
+LCJJdiI6eyJjdiI6W10sInVIIjpbXSwiRDAiOltdfSwiV1AiOnsiY3YiOltdLCJ1SCI6W10sIkQwIjpb
+XX0sInlZIjp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119LCJ3NiI6eyJlYSI6W119LCJLNSI6eyJ2NiI6
+W10sIkQwIjpbXX0sIkNtIjp7IkQwIjpbXX0sIkNRIjp7InVIIjpbXSwiRDAiOltdfSwidzQiOnsidG4i
+OlsiRksiXX0sInJoIjp7IkdtIjpbInVIIl0sImxEIjpbInVIIl0sInpNIjpbInVIIl0sIlhqIjpbInVI
+Il0sImJRIjpbInVIIl0sImNYIjpbInVIIl0sImxELkUiOiJ1SCIsIkdtLkUiOiJ1SCJ9LCJjZiI6eyJZ
+ayI6WyJxVSIsInFVIl0sIlowIjpbInFVIiwicVUiXX0sImk3Ijp7IllrIjpbInFVIiwicVUiXSwiWjAi
+OlsicVUiLCJxVSJdLCJZay5LIjoicVUiLCJZay5WIjoicVUifSwiU3kiOnsiWWsiOlsicVUiLCJxVSJd
+LCJaMCI6WyJxVSIsInFVIl0sIllrLksiOiJxVSIsIllrLlYiOiJxVSJ9LCJJNCI6eyJsZiI6WyJxVSJd
+LCJ4dSI6WyJxVSJdLCJiUSI6WyJxVSJdLCJjWCI6WyJxVSJdfSwiUk8iOnsicWgiOlsiMSJdfSwiZXUi
+OnsiUk8iOlsiMSJdLCJxaCI6WyIxIl19LCJ4QyI6eyJNTyI6WyIxIl19LCJKUSI6eyJrRiI6W119LCJ2
+RCI6eyJrRiI6W119LCJtNiI6eyJrRiI6W119LCJjdCI6eyJrRiI6W119LCJPdyI6eyJrRiI6W119LCJX
+OSI6eyJBbiI6WyIxIl19LCJkVyI6eyJ2NiI6W10sIkQwIjpbXX0sIm1rIjp7InkwIjpbXX0sIktvIjp7
+Im9uIjpbXX0sIkFzIjp7ImxmIjpbInFVIl0sInh1IjpbInFVIl0sImJRIjpbInFVIl0sImNYIjpbInFV
+Il19LCJyNyI6eyJFNCI6W119LCJUeiI6eyJsRCI6WyIxIl0sInpNIjpbIjEiXSwiYlEiOlsiMSJdLCJF
+NCI6W10sImNYIjpbIjEiXSwibEQuRSI6IjEifSwibmQiOnsiZDUiOltdLCJjdiI6W10sInVIIjpbXSwi
+RDAiOltdfSwiS2UiOnsibGYiOlsicVUiXSwieHUiOlsicVUiXSwiYlEiOlsicVUiXSwiY1giOlsicVUi
+XX0sImQ1Ijp7ImN2IjpbXSwidUgiOltdLCJEMCI6W119LCJuNiI6eyJ6TSI6WyJLTiJdLCJiUSI6WyJL
+TiJdLCJlcSI6W10sImNYIjpbIktOIl19LCJYQSI6eyJrRiI6W119LCJkdiI6eyJSeiI6W119LCJPRiI6
+eyJmdiI6W119LCJydSI6eyJmdiI6W119LCJJViI6eyJmdiI6W119fScpKQpILkZGKHYudHlwZVVuaXZl
+cnNlLEpTT04ucGFyc2UoJ3siYlEiOjEsIlhDIjoxLCJNTyI6MSwia1QiOjIsIm1XIjoxLCJ1eSI6MSwi
+aWwiOjIsIlZqIjoxLCJuWSI6MSwiVEMiOjEsImNvIjoxfScpKQp2YXIgdT0oZnVuY3Rpb24gcnRpaSgp
+e3ZhciB0PUguTjAKcmV0dXJue2JxOnQoIkdoIiksbjp0KCJDdyIpLGNSOnQoIm5CIiksZDp0KCJBeiIp
+LFk6dCgiUVAiKSxnRjp0KCJQRDxHRCxAPiIpLGd3OnQoImJRPEA+IiksaDp0KCJjdiIpLGJVOnQoIlhT
+IiksQjp0KCJlYSIpLHI6dCgiRDAiKSxnODp0KCJSeiIpLGM4OnQoImhIIiksWjp0KCJFSCIpLGM6dCgi
+Yjg8QD4iKSxEOnQoIkxMIiksZ3A6dCgiSDciKSxJOnQoIlNnIiksbzp0KCJ2USIpLGVoOnQoImNYPHVI
+PiIpLFg6dCgiY1g8cVU+IiksUjp0KCJjWDxAPiIpLGZBOnQoImpkPFNlPiIpLGdpOnQoImpkPGo4PiIp
+LEo6dCgiamQ8WjA8cVUsaz4+IiksZmg6dCgiamQ8Wlo+IiksaTp0KCJqZDxrRj4iKSxzOnQoImpkPHFV
+PiIpLGhoOnQoImpkPHlEPiIpLGFKOnQoImpkPHdiPiIpLGI6dCgiamQ8QD4iKSx0OnQoImpkPEtOPiIp
+LGVIOnQoInZtIiksZzp0KCJjNSIpLGFVOnQoIlhqPEA+IiksYW06dCgiVHo8QD4iKSxlbzp0KCJONTxH
+RCxAPiIpLG06dCgiRTQiKSxkejp0KCJoRiIpLGY0OnQoInpNPGo4PiIpLGQzOnQoInpNPFowPHFVLGs+
+PiIpLGV3OnQoInpNPGs+IiksYTp0KCJ6TTxxVT4iKSxqOnQoInpNPEA+IiksTDp0KCJ6TTxLTj4iKSxh
+Xzp0KCJ1OCIpLFM6dCgiWjA8cVUsaz4iKSxmOnQoIlowPHFVLHFVPiIpLGs6dCgiWjA8cVUsQD4iKSxH
+OnQoIlowPEAsQD4iKSxkdjp0KCJBODxxVSxxVT4iKSxkbzp0KCJBODxxVSxAPiIpLFY6dCgiQWoiKSxk
+RDp0KCJFVCIpLGJtOnQoIlY2IiksQTp0KCJ1SCIpLGU6dCgia0YiKSxQOnQoImM4IiksSzp0KCJrIiks
+cDp0KCJldyIpLHE6dCgidG48Rks+IiksZnY6dCgid0wiKSxhdjp0KCJKYyIpLGFPOnQoIm5kIiksQzp0
+KCJ4dTxxVT4iKSxsOnQoIkd6IiksTjp0KCJxVSIpLGRHOnQoInFVKHFVKSIpLGc3OnQoImQ1IiksZm86
+dCgiR0QiKSxhVzp0KCJ5WSIpLHU6dCgiZXEiKSxnYzp0KCJuNiIpLGFrOnQoImtkIiksVzp0KCJHajxx
+VSxxVT4iKSx2OnQoImlEIiksY2M6dCgiVTU8cVU+IiksZzQ6dCgiSzUiKSxjaTp0KCJ2NiIpLGcyOnQo
+IkNtIiksYmo6dCgiWmY8Tzc+IiksaDk6dCgiQ1EiKSxhYzp0KCJlNyIpLFE6dCgiZXU8QWo+IiksVDp0
+KCJ3ejxjdj4iKSx4OnQoIkZlPEAsQD4iKSxhbzp0KCJ2czxPNz4iKSxfOnQoInZzPEA+IiksZko6dCgi
+dnM8S04+IiksTzp0KCJKUSIpLHk6dCgiYm4iKSxjSjp0KCJhMiIpLGFsOnQoImEyKGspIiksYkI6dCgi
+YTIocVUpIiksYmY6dCgiYTIoQCkiKSx6OnQoIkAiKSxmTzp0KCJAKCkiKSxVOnQoIkAoZWEpIiksdzp0
+KCJAKGspIiksZXA6dCgiQChrLGspIiksRTp0KCJAKGssR3opIiksY2g6dCgiQCh4dTxxVT4pIiksZE86
+dCgiQChxVSkiKSxiYzp0KCJAKEApIiksYjg6dCgiQChALEApIiksZWc6dCgiS04iKSxIOnQoIn4iKSxN
+OnQoIn4oKSIpLGFuOnQoIn4oZXcpIiksRjp0KCJ+KHFVLHFVKSIpLGNBOnQoIn4ocVUsQCkiKX19KSgp
+OyhmdW5jdGlvbiBjb25zdGFudHMoKXt2YXIgdD1odW5rSGVscGVycy5tYWtlQ29uc3RMaXN0CkMuUlk9
+Vy5RUC5wcm90b3R5cGUKQy5CWj1XLlZiLnByb3RvdHlwZQpDLkR0PVcuTzcucHJvdG90eXBlCkMuT2s9
+Si52Qi5wcm90b3R5cGUKQy5ObT1KLmpkLnByb3RvdHlwZQpDLmpuPUouYlUucHJvdG90eXBlCkMuQ0Q9
+Si5xSS5wcm90b3R5cGUKQy54Qj1KLkRyLnByb3RvdHlwZQpDLkRHPUouYzUucHJvdG90eXBlCkMuRXg9
+Vy51OC5wcm90b3R5cGUKQy50NT1XLkJILnByb3RvdHlwZQpDLkx0PVcuU04ucHJvdG90eXBlCkMuWlE9
+Si5pQy5wcm90b3R5cGUKQy5JZT1XLlRiLnByb3RvdHlwZQpDLnZCPUoua2QucHJvdG90eXBlCkMub2w9
+Vy5LNS5wcm90b3R5cGUKQy55OD1uZXcgUC5VOCgpCkMuaDk9bmV3IFAuQ1YoKQpDLk80PWZ1bmN0aW9u
+IGdldFRhZ0ZhbGxiYWNrKG8pIHsKICB2YXIgcyA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2Fs
+bChvKTsKICByZXR1cm4gcy5zdWJzdHJpbmcoOCwgcy5sZW5ndGggLSAxKTsKfQpDLllxPWZ1bmN0aW9u
+KCkgewogIHZhciB0b1N0cmluZ0Z1bmN0aW9uID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZzsKICBm
+dW5jdGlvbiBnZXRUYWcobykgewogICAgdmFyIHMgPSB0b1N0cmluZ0Z1bmN0aW9uLmNhbGwobyk7CiAg
+ICByZXR1cm4gcy5zdWJzdHJpbmcoOCwgcy5sZW5ndGggLSAxKTsKICB9CiAgZnVuY3Rpb24gZ2V0VW5r
+bm93blRhZyhvYmplY3QsIHRhZykgewogICAgaWYgKC9eSFRNTFtBLVpdLipFbGVtZW50JC8udGVzdCh0
+YWcpKSB7CiAgICAgIHZhciBuYW1lID0gdG9TdHJpbmdGdW5jdGlvbi5jYWxsKG9iamVjdCk7CiAgICAg
+IGlmIChuYW1lID09ICJbb2JqZWN0IE9iamVjdF0iKSByZXR1cm4gbnVsbDsKICAgICAgcmV0dXJuICJI
+VE1MRWxlbWVudCI7CiAgICB9CiAgfQogIGZ1bmN0aW9uIGdldFVua25vd25UYWdHZW5lcmljQnJvd3Nl
+cihvYmplY3QsIHRhZykgewogICAgaWYgKHNlbGYuSFRNTEVsZW1lbnQgJiYgb2JqZWN0IGluc3RhbmNl
+b2YgSFRNTEVsZW1lbnQpIHJldHVybiAiSFRNTEVsZW1lbnQiOwogICAgcmV0dXJuIGdldFVua25vd25U
+YWcob2JqZWN0LCB0YWcpOwogIH0KICBmdW5jdGlvbiBwcm90b3R5cGVGb3JUYWcodGFnKSB7CiAgICBp
+ZiAodHlwZW9mIHdpbmRvdyA9PSAidW5kZWZpbmVkIikgcmV0dXJuIG51bGw7CiAgICBpZiAodHlwZW9m
+IHdpbmRvd1t0YWddID09ICJ1bmRlZmluZWQiKSByZXR1cm4gbnVsbDsKICAgIHZhciBjb25zdHJ1Y3Rv
+ciA9IHdpbmRvd1t0YWddOwogICAgaWYgKHR5cGVvZiBjb25zdHJ1Y3RvciAhPSAiZnVuY3Rpb24iKSBy
+ZXR1cm4gbnVsbDsKICAgIHJldHVybiBjb25zdHJ1Y3Rvci5wcm90b3R5cGU7CiAgfQogIGZ1bmN0aW9u
+IGRpc2NyaW1pbmF0b3IodGFnKSB7IHJldHVybiBudWxsOyB9CiAgdmFyIGlzQnJvd3NlciA9IHR5cGVv
+ZiBuYXZpZ2F0b3IgPT0gIm9iamVjdCI7CiAgcmV0dXJuIHsKICAgIGdldFRhZzogZ2V0VGFnLAogICAg
+Z2V0VW5rbm93blRhZzogaXNCcm93c2VyID8gZ2V0VW5rbm93blRhZ0dlbmVyaWNCcm93c2VyIDogZ2V0
+VW5rbm93blRhZywKICAgIHByb3RvdHlwZUZvclRhZzogcHJvdG90eXBlRm9yVGFnLAogICAgZGlzY3Jp
+bWluYXRvcjogZGlzY3JpbWluYXRvciB9Owp9CkMud2I9ZnVuY3Rpb24oZ2V0VGFnRmFsbGJhY2spIHsK
+ICByZXR1cm4gZnVuY3Rpb24oaG9va3MpIHsKICAgIGlmICh0eXBlb2YgbmF2aWdhdG9yICE9ICJvYmpl
+Y3QiKSByZXR1cm4gaG9va3M7CiAgICB2YXIgdWEgPSBuYXZpZ2F0b3IudXNlckFnZW50OwogICAgaWYg
+KHVhLmluZGV4T2YoIkR1bXBSZW5kZXJUcmVlIikgPj0gMCkgcmV0dXJuIGhvb2tzOwogICAgaWYgKHVh
+LmluZGV4T2YoIkNocm9tZSIpID49IDApIHsKICAgICAgZnVuY3Rpb24gY29uZmlybShwKSB7CiAgICAg
+ICAgcmV0dXJuIHR5cGVvZiB3aW5kb3cgPT0gIm9iamVjdCIgJiYgd2luZG93W3BdICYmIHdpbmRvd1tw
+XS5uYW1lID09IHA7CiAgICAgIH0KICAgICAgaWYgKGNvbmZpcm0oIldpbmRvdyIpICYmIGNvbmZpcm0o
+IkhUTUxFbGVtZW50IikpIHJldHVybiBob29rczsKICAgIH0KICAgIGhvb2tzLmdldFRhZyA9IGdldFRh
+Z0ZhbGxiYWNrOwogIH07Cn0KQy5LVT1mdW5jdGlvbihob29rcykgewogIGlmICh0eXBlb2YgZGFydEV4
+cGVyaW1lbnRhbEZpeHVwR2V0VGFnICE9ICJmdW5jdGlvbiIpIHJldHVybiBob29rczsKICBob29rcy5n
+ZXRUYWcgPSBkYXJ0RXhwZXJpbWVudGFsRml4dXBHZXRUYWcoaG9va3MuZ2V0VGFnKTsKfQpDLmZRPWZ1
+bmN0aW9uKGhvb2tzKSB7CiAgdmFyIGdldFRhZyA9IGhvb2tzLmdldFRhZzsKICB2YXIgcHJvdG90eXBl
+Rm9yVGFnID0gaG9va3MucHJvdG90eXBlRm9yVGFnOwogIGZ1bmN0aW9uIGdldFRhZ0ZpeGVkKG8pIHsK
+ICAgIHZhciB0YWcgPSBnZXRUYWcobyk7CiAgICBpZiAodGFnID09ICJEb2N1bWVudCIpIHsKICAgICAg
+aWYgKCEhby54bWxWZXJzaW9uKSByZXR1cm4gIiFEb2N1bWVudCI7CiAgICAgIHJldHVybiAiIUhUTUxE
+b2N1bWVudCI7CiAgICB9CiAgICByZXR1cm4gdGFnOwogIH0KICBmdW5jdGlvbiBwcm90b3R5cGVGb3JU
+YWdGaXhlZCh0YWcpIHsKICAgIGlmICh0YWcgPT0gIkRvY3VtZW50IikgcmV0dXJuIG51bGw7CiAgICBy
+ZXR1cm4gcHJvdG90eXBlRm9yVGFnKHRhZyk7CiAgfQogIGhvb2tzLmdldFRhZyA9IGdldFRhZ0ZpeGVk
+OwogIGhvb2tzLnByb3RvdHlwZUZvclRhZyA9IHByb3RvdHlwZUZvclRhZ0ZpeGVkOwp9CkMuZGs9ZnVu
+Y3Rpb24oaG9va3MpIHsKICB2YXIgdXNlckFnZW50ID0gdHlwZW9mIG5hdmlnYXRvciA9PSAib2JqZWN0
+IiA/IG5hdmlnYXRvci51c2VyQWdlbnQgOiAiIjsKICBpZiAodXNlckFnZW50LmluZGV4T2YoIkZpcmVm
+b3giKSA9PSAtMSkgcmV0dXJuIGhvb2tzOwogIHZhciBnZXRUYWcgPSBob29rcy5nZXRUYWc7CiAgdmFy
+IHF1aWNrTWFwID0gewogICAgIkJlZm9yZVVubG9hZEV2ZW50IjogIkV2ZW50IiwKICAgICJEYXRhVHJh
+bnNmZXIiOiAiQ2xpcGJvYXJkIiwKICAgICJHZW9HZW9sb2NhdGlvbiI6ICJHZW9sb2NhdGlvbiIsCiAg
+ICAiTG9jYXRpb24iOiAiIUxvY2F0aW9uIiwKICAgICJXb3JrZXJNZXNzYWdlRXZlbnQiOiAiTWVzc2Fn
+ZUV2ZW50IiwKICAgICJYTUxEb2N1bWVudCI6ICIhRG9jdW1lbnQifTsKICBmdW5jdGlvbiBnZXRUYWdG
+aXJlZm94KG8pIHsKICAgIHZhciB0YWcgPSBnZXRUYWcobyk7CiAgICByZXR1cm4gcXVpY2tNYXBbdGFn
+XSB8fCB0YWc7CiAgfQogIGhvb2tzLmdldFRhZyA9IGdldFRhZ0ZpcmVmb3g7Cn0KQy54aT1mdW5jdGlv
+bihob29rcykgewogIHZhciB1c2VyQWdlbnQgPSB0eXBlb2YgbmF2aWdhdG9yID09ICJvYmplY3QiID8g
+bmF2aWdhdG9yLnVzZXJBZ2VudCA6ICIiOwogIGlmICh1c2VyQWdlbnQuaW5kZXhPZigiVHJpZGVudC8i
+KSA9PSAtMSkgcmV0dXJuIGhvb2tzOwogIHZhciBnZXRUYWcgPSBob29rcy5nZXRUYWc7CiAgdmFyIHF1
+aWNrTWFwID0gewogICAgIkJlZm9yZVVubG9hZEV2ZW50IjogIkV2ZW50IiwKICAgICJEYXRhVHJhbnNm
+ZXIiOiAiQ2xpcGJvYXJkIiwKICAgICJIVE1MRERFbGVtZW50IjogIkhUTUxFbGVtZW50IiwKICAgICJI
+VE1MRFRFbGVtZW50IjogIkhUTUxFbGVtZW50IiwKICAgICJIVE1MUGhyYXNlRWxlbWVudCI6ICJIVE1M
+RWxlbWVudCIsCiAgICAiUG9zaXRpb24iOiAiR2VvcG9zaXRpb24iCiAgfTsKICBmdW5jdGlvbiBnZXRU
+YWdJRShvKSB7CiAgICB2YXIgdGFnID0gZ2V0VGFnKG8pOwogICAgdmFyIG5ld1RhZyA9IHF1aWNrTWFw
+W3RhZ107CiAgICBpZiAobmV3VGFnKSByZXR1cm4gbmV3VGFnOwogICAgaWYgKHRhZyA9PSAiT2JqZWN0
+IikgewogICAgICBpZiAod2luZG93LkRhdGFWaWV3ICYmIChvIGluc3RhbmNlb2Ygd2luZG93LkRhdGFW
+aWV3KSkgcmV0dXJuICJEYXRhVmlldyI7CiAgICB9CiAgICByZXR1cm4gdGFnOwogIH0KICBmdW5jdGlv
+biBwcm90b3R5cGVGb3JUYWdJRSh0YWcpIHsKICAgIHZhciBjb25zdHJ1Y3RvciA9IHdpbmRvd1t0YWdd
+OwogICAgaWYgKGNvbnN0cnVjdG9yID09IG51bGwpIHJldHVybiBudWxsOwogICAgcmV0dXJuIGNvbnN0
+cnVjdG9yLnByb3RvdHlwZTsKICB9CiAgaG9va3MuZ2V0VGFnID0gZ2V0VGFnSUU7CiAgaG9va3MucHJv
+dG90eXBlRm9yVGFnID0gcHJvdG90eXBlRm9yVGFnSUU7Cn0KQy5pNz1mdW5jdGlvbihob29rcykgeyBy
+ZXR1cm4gaG9va3M7IH0KCkMuQ3Q9bmV3IFAuYnkoKQpDLkVxPW5ldyBQLms1KCkKQy54TT1uZXcgUC51
+NSgpCkMuUWs9bmV3IFAuRTMoKQpDLk5VPW5ldyBQLkppKCkKQy5BZD1uZXcgTS5INygwLCJIaW50QWN0
+aW9uS2luZC5hZGROdWxsYWJsZUhpbnQiKQpDLm5lPW5ldyBNLkg3KDEsIkhpbnRBY3Rpb25LaW5kLmFk
+ZE5vbk51bGxhYmxlSGludCIpCkMubXk9bmV3IE0uSDcoMiwiSGludEFjdGlvbktpbmQuY2hhbmdlVG9O
+dWxsYWJsZUhpbnQiKQpDLnJ4PW5ldyBNLkg3KDMsIkhpbnRBY3Rpb25LaW5kLmNoYW5nZVRvTm9uTnVs
+bGFibGVIaW50IikKQy53Vj1uZXcgTS5INyg0LCJIaW50QWN0aW9uS2luZC5yZW1vdmVOdWxsYWJsZUhp
+bnQiKQpDLmZSPW5ldyBNLkg3KDUsIkhpbnRBY3Rpb25LaW5kLnJlbW92ZU5vbk51bGxhYmxlSGludCIp
+CkMuQTM9bmV3IFAuTXgobnVsbCkKQy5uWD1uZXcgUC5vaihudWxsKQpDLkdiPUguVk0odChbMTI3LDIw
+NDcsNjU1MzUsMTExNDExMV0pLHUudCkKQy5haz1ILlZNKHQoWzAsMCwzMjc3NiwzMzc5MiwxLDEwMjQw
+LDAsMF0pLHUudCkKQy5jbT1ILlZNKHQoWyIqOjpjbGFzcyIsIio6OmRpciIsIio6OmRyYWdnYWJsZSIs
+Iio6OmhpZGRlbiIsIio6OmlkIiwiKjo6aW5lcnQiLCIqOjppdGVtcHJvcCIsIio6Oml0ZW1yZWYiLCIq
+OjppdGVtc2NvcGUiLCIqOjpsYW5nIiwiKjo6c3BlbGxjaGVjayIsIio6OnRpdGxlIiwiKjo6dHJhbnNs
+YXRlIiwiQTo6YWNjZXNza2V5IiwiQTo6Y29vcmRzIiwiQTo6aHJlZmxhbmciLCJBOjpuYW1lIiwiQTo6
+c2hhcGUiLCJBOjp0YWJpbmRleCIsIkE6OnRhcmdldCIsIkE6OnR5cGUiLCJBUkVBOjphY2Nlc3NrZXki
+LCJBUkVBOjphbHQiLCJBUkVBOjpjb29yZHMiLCJBUkVBOjpub2hyZWYiLCJBUkVBOjpzaGFwZSIsIkFS
+RUE6OnRhYmluZGV4IiwiQVJFQTo6dGFyZ2V0IiwiQVVESU86OmNvbnRyb2xzIiwiQVVESU86Omxvb3Ai
+LCJBVURJTzo6bWVkaWFncm91cCIsIkFVRElPOjptdXRlZCIsIkFVRElPOjpwcmVsb2FkIiwiQkRPOjpk
+aXIiLCJCT0RZOjphbGluayIsIkJPRFk6OmJnY29sb3IiLCJCT0RZOjpsaW5rIiwiQk9EWTo6dGV4dCIs
+IkJPRFk6OnZsaW5rIiwiQlI6OmNsZWFyIiwiQlVUVE9OOjphY2Nlc3NrZXkiLCJCVVRUT046OmRpc2Fi
+bGVkIiwiQlVUVE9OOjpuYW1lIiwiQlVUVE9OOjp0YWJpbmRleCIsIkJVVFRPTjo6dHlwZSIsIkJVVFRP
+Tjo6dmFsdWUiLCJDQU5WQVM6OmhlaWdodCIsIkNBTlZBUzo6d2lkdGgiLCJDQVBUSU9OOjphbGlnbiIs
+IkNPTDo6YWxpZ24iLCJDT0w6OmNoYXIiLCJDT0w6OmNoYXJvZmYiLCJDT0w6OnNwYW4iLCJDT0w6OnZh
+bGlnbiIsIkNPTDo6d2lkdGgiLCJDT0xHUk9VUDo6YWxpZ24iLCJDT0xHUk9VUDo6Y2hhciIsIkNPTEdS
+T1VQOjpjaGFyb2ZmIiwiQ09MR1JPVVA6OnNwYW4iLCJDT0xHUk9VUDo6dmFsaWduIiwiQ09MR1JPVVA6
+OndpZHRoIiwiQ09NTUFORDo6Y2hlY2tlZCIsIkNPTU1BTkQ6OmNvbW1hbmQiLCJDT01NQU5EOjpkaXNh
+YmxlZCIsIkNPTU1BTkQ6OmxhYmVsIiwiQ09NTUFORDo6cmFkaW9ncm91cCIsIkNPTU1BTkQ6OnR5cGUi
+LCJEQVRBOjp2YWx1ZSIsIkRFTDo6ZGF0ZXRpbWUiLCJERVRBSUxTOjpvcGVuIiwiRElSOjpjb21wYWN0
+IiwiRElWOjphbGlnbiIsIkRMOjpjb21wYWN0IiwiRklFTERTRVQ6OmRpc2FibGVkIiwiRk9OVDo6Y29s
+b3IiLCJGT05UOjpmYWNlIiwiRk9OVDo6c2l6ZSIsIkZPUk06OmFjY2VwdCIsIkZPUk06OmF1dG9jb21w
+bGV0ZSIsIkZPUk06OmVuY3R5cGUiLCJGT1JNOjptZXRob2QiLCJGT1JNOjpuYW1lIiwiRk9STTo6bm92
+YWxpZGF0ZSIsIkZPUk06OnRhcmdldCIsIkZSQU1FOjpuYW1lIiwiSDE6OmFsaWduIiwiSDI6OmFsaWdu
+IiwiSDM6OmFsaWduIiwiSDQ6OmFsaWduIiwiSDU6OmFsaWduIiwiSDY6OmFsaWduIiwiSFI6OmFsaWdu
+IiwiSFI6Om5vc2hhZGUiLCJIUjo6c2l6ZSIsIkhSOjp3aWR0aCIsIkhUTUw6OnZlcnNpb24iLCJJRlJB
+TUU6OmFsaWduIiwiSUZSQU1FOjpmcmFtZWJvcmRlciIsIklGUkFNRTo6aGVpZ2h0IiwiSUZSQU1FOjpt
+YXJnaW5oZWlnaHQiLCJJRlJBTUU6Om1hcmdpbndpZHRoIiwiSUZSQU1FOjp3aWR0aCIsIklNRzo6YWxp
+Z24iLCJJTUc6OmFsdCIsIklNRzo6Ym9yZGVyIiwiSU1HOjpoZWlnaHQiLCJJTUc6OmhzcGFjZSIsIklN
+Rzo6aXNtYXAiLCJJTUc6Om5hbWUiLCJJTUc6OnVzZW1hcCIsIklNRzo6dnNwYWNlIiwiSU1HOjp3aWR0
+aCIsIklOUFVUOjphY2NlcHQiLCJJTlBVVDo6YWNjZXNza2V5IiwiSU5QVVQ6OmFsaWduIiwiSU5QVVQ6
+OmFsdCIsIklOUFVUOjphdXRvY29tcGxldGUiLCJJTlBVVDo6YXV0b2ZvY3VzIiwiSU5QVVQ6OmNoZWNr
+ZWQiLCJJTlBVVDo6ZGlzYWJsZWQiLCJJTlBVVDo6aW5wdXRtb2RlIiwiSU5QVVQ6OmlzbWFwIiwiSU5Q
+VVQ6Omxpc3QiLCJJTlBVVDo6bWF4IiwiSU5QVVQ6Om1heGxlbmd0aCIsIklOUFVUOjptaW4iLCJJTlBV
+VDo6bXVsdGlwbGUiLCJJTlBVVDo6bmFtZSIsIklOUFVUOjpwbGFjZWhvbGRlciIsIklOUFVUOjpyZWFk
+b25seSIsIklOUFVUOjpyZXF1aXJlZCIsIklOUFVUOjpzaXplIiwiSU5QVVQ6OnN0ZXAiLCJJTlBVVDo6
+dGFiaW5kZXgiLCJJTlBVVDo6dHlwZSIsIklOUFVUOjp1c2VtYXAiLCJJTlBVVDo6dmFsdWUiLCJJTlM6
+OmRhdGV0aW1lIiwiS0VZR0VOOjpkaXNhYmxlZCIsIktFWUdFTjo6a2V5dHlwZSIsIktFWUdFTjo6bmFt
+ZSIsIkxBQkVMOjphY2Nlc3NrZXkiLCJMQUJFTDo6Zm9yIiwiTEVHRU5EOjphY2Nlc3NrZXkiLCJMRUdF
+TkQ6OmFsaWduIiwiTEk6OnR5cGUiLCJMSTo6dmFsdWUiLCJMSU5LOjpzaXplcyIsIk1BUDo6bmFtZSIs
+Ik1FTlU6OmNvbXBhY3QiLCJNRU5VOjpsYWJlbCIsIk1FTlU6OnR5cGUiLCJNRVRFUjo6aGlnaCIsIk1F
+VEVSOjpsb3ciLCJNRVRFUjo6bWF4IiwiTUVURVI6Om1pbiIsIk1FVEVSOjp2YWx1ZSIsIk9CSkVDVDo6
+dHlwZW11c3RtYXRjaCIsIk9MOjpjb21wYWN0IiwiT0w6OnJldmVyc2VkIiwiT0w6OnN0YXJ0IiwiT0w6
+OnR5cGUiLCJPUFRHUk9VUDo6ZGlzYWJsZWQiLCJPUFRHUk9VUDo6bGFiZWwiLCJPUFRJT046OmRpc2Fi
+bGVkIiwiT1BUSU9OOjpsYWJlbCIsIk9QVElPTjo6c2VsZWN0ZWQiLCJPUFRJT046OnZhbHVlIiwiT1VU
+UFVUOjpmb3IiLCJPVVRQVVQ6Om5hbWUiLCJQOjphbGlnbiIsIlBSRTo6d2lkdGgiLCJQUk9HUkVTUzo6
+bWF4IiwiUFJPR1JFU1M6Om1pbiIsIlBST0dSRVNTOjp2YWx1ZSIsIlNFTEVDVDo6YXV0b2NvbXBsZXRl
+IiwiU0VMRUNUOjpkaXNhYmxlZCIsIlNFTEVDVDo6bXVsdGlwbGUiLCJTRUxFQ1Q6Om5hbWUiLCJTRUxF
+Q1Q6OnJlcXVpcmVkIiwiU0VMRUNUOjpzaXplIiwiU0VMRUNUOjp0YWJpbmRleCIsIlNPVVJDRTo6dHlw
+ZSIsIlRBQkxFOjphbGlnbiIsIlRBQkxFOjpiZ2NvbG9yIiwiVEFCTEU6OmJvcmRlciIsIlRBQkxFOjpj
+ZWxscGFkZGluZyIsIlRBQkxFOjpjZWxsc3BhY2luZyIsIlRBQkxFOjpmcmFtZSIsIlRBQkxFOjpydWxl
+cyIsIlRBQkxFOjpzdW1tYXJ5IiwiVEFCTEU6OndpZHRoIiwiVEJPRFk6OmFsaWduIiwiVEJPRFk6OmNo
+YXIiLCJUQk9EWTo6Y2hhcm9mZiIsIlRCT0RZOjp2YWxpZ24iLCJURDo6YWJiciIsIlREOjphbGlnbiIs
+IlREOjpheGlzIiwiVEQ6OmJnY29sb3IiLCJURDo6Y2hhciIsIlREOjpjaGFyb2ZmIiwiVEQ6OmNvbHNw
+YW4iLCJURDo6aGVhZGVycyIsIlREOjpoZWlnaHQiLCJURDo6bm93cmFwIiwiVEQ6OnJvd3NwYW4iLCJU
+RDo6c2NvcGUiLCJURDo6dmFsaWduIiwiVEQ6OndpZHRoIiwiVEVYVEFSRUE6OmFjY2Vzc2tleSIsIlRF
+WFRBUkVBOjphdXRvY29tcGxldGUiLCJURVhUQVJFQTo6Y29scyIsIlRFWFRBUkVBOjpkaXNhYmxlZCIs
+IlRFWFRBUkVBOjppbnB1dG1vZGUiLCJURVhUQVJFQTo6bmFtZSIsIlRFWFRBUkVBOjpwbGFjZWhvbGRl
+ciIsIlRFWFRBUkVBOjpyZWFkb25seSIsIlRFWFRBUkVBOjpyZXF1aXJlZCIsIlRFWFRBUkVBOjpyb3dz
+IiwiVEVYVEFSRUE6OnRhYmluZGV4IiwiVEVYVEFSRUE6OndyYXAiLCJURk9PVDo6YWxpZ24iLCJURk9P
+VDo6Y2hhciIsIlRGT09UOjpjaGFyb2ZmIiwiVEZPT1Q6OnZhbGlnbiIsIlRIOjphYmJyIiwiVEg6OmFs
+aWduIiwiVEg6OmF4aXMiLCJUSDo6Ymdjb2xvciIsIlRIOjpjaGFyIiwiVEg6OmNoYXJvZmYiLCJUSDo6
+Y29sc3BhbiIsIlRIOjpoZWFkZXJzIiwiVEg6OmhlaWdodCIsIlRIOjpub3dyYXAiLCJUSDo6cm93c3Bh
+biIsIlRIOjpzY29wZSIsIlRIOjp2YWxpZ24iLCJUSDo6d2lkdGgiLCJUSEVBRDo6YWxpZ24iLCJUSEVB
+RDo6Y2hhciIsIlRIRUFEOjpjaGFyb2ZmIiwiVEhFQUQ6OnZhbGlnbiIsIlRSOjphbGlnbiIsIlRSOjpi
+Z2NvbG9yIiwiVFI6OmNoYXIiLCJUUjo6Y2hhcm9mZiIsIlRSOjp2YWxpZ24iLCJUUkFDSzo6ZGVmYXVs
+dCIsIlRSQUNLOjpraW5kIiwiVFJBQ0s6OmxhYmVsIiwiVFJBQ0s6OnNyY2xhbmciLCJVTDo6Y29tcGFj
+dCIsIlVMOjp0eXBlIiwiVklERU86OmNvbnRyb2xzIiwiVklERU86OmhlaWdodCIsIlZJREVPOjpsb29w
+IiwiVklERU86Om1lZGlhZ3JvdXAiLCJWSURFTzo6bXV0ZWQiLCJWSURFTzo6cHJlbG9hZCIsIlZJREVP
+Ojp3aWR0aCJdKSx1LnMpCkMuVkM9SC5WTSh0KFswLDAsNjU0OTAsNDUwNTUsNjU1MzUsMzQ4MTUsNjU1
+MzQsMTg0MzFdKSx1LnQpCkMubUs9SC5WTSh0KFswLDAsMjY2MjQsMTAyMyw2NTUzNCwyMDQ3LDY1NTM0
+LDIwNDddKSx1LnQpCkMuU3E9SC5WTSh0KFsiSEVBRCIsIkFSRUEiLCJCQVNFIiwiQkFTRUZPTlQiLCJC
+UiIsIkNPTCIsIkNPTEdST1VQIiwiRU1CRUQiLCJGUkFNRSIsIkZSQU1FU0VUIiwiSFIiLCJJTUFHRSIs
+IklNRyIsIklOUFVUIiwiSVNJTkRFWCIsIkxJTksiLCJNRVRBIiwiUEFSQU0iLCJTT1VSQ0UiLCJTVFlM
+RSIsIlRJVExFIiwiV0JSIl0pLHUucykKQy5kbj1ILlZNKHQoW10pLEguTjAoImpkPExMPiIpKQpDLnhE
+PUguVk0odChbXSksdS5zKQpDLmhVPUguVk0odChbXSksdS5iKQpDLnRvPUguVk0odChbMCwwLDMyNzIy
+LDEyMjg3LDY1NTM0LDM0ODE1LDY1NTM0LDE4NDMxXSksdS50KQpDLnJrPUguVk0odChbQy5BZCxDLm5l
+LEMubXksQy5yeCxDLndWLEMuZlJdKSxILk4wKCJqZDxINz4iKSkKQy5GMz1ILlZNKHQoWzAsMCwyNDU3
+NiwxMDIzLDY1NTM0LDM0ODE1LDY1NTM0LDE4NDMxXSksdS50KQpDLmVhPUguVk0odChbMCwwLDMyNzU0
+LDExMjYzLDY1NTM0LDM0ODE1LDY1NTM0LDE4NDMxXSksdS50KQpDLlpKPUguVk0odChbMCwwLDMyNzIy
+LDEyMjg3LDY1NTM1LDM0ODE1LDY1NTM0LDE4NDMxXSksdS50KQpDLldkPUguVk0odChbMCwwLDY1NDkw
+LDEyMjg3LDY1NTM1LDM0ODE1LDY1NTM0LDE4NDMxXSksdS50KQpDLlF4PUguVk0odChbImJpbmQiLCJp
+ZiIsInJlZiIsInJlcGVhdCIsInN5bnRheCJdKSx1LnMpCkMuQkk9SC5WTSh0KFsiQTo6aHJlZiIsIkFS
+RUE6OmhyZWYiLCJCTE9DS1FVT1RFOjpjaXRlIiwiQk9EWTo6YmFja2dyb3VuZCIsIkNPTU1BTkQ6Omlj
+b24iLCJERUw6OmNpdGUiLCJGT1JNOjphY3Rpb24iLCJJTUc6OnNyYyIsIklOUFVUOjpzcmMiLCJJTlM6
+OmNpdGUiLCJROjpjaXRlIiwiVklERU86OnBvc3RlciJdKSx1LnMpCkMuQ009bmV3IEguTFAoMCx7fSxD
+LnhELEguTjAoIkxQPHFVLHpNPGo4Pj4iKSkKQy5XTz1uZXcgSC5MUCgwLHt9LEMueEQsSC5OMCgiTFA8
+cVUscVU+IikpCkMuaUg9SC5WTSh0KFtdKSxILk4wKCJqZDxHRD4iKSkKQy5EeD1uZXcgSC5MUCgwLHt9
+LEMuaUgsSC5OMCgiTFA8R0QsQD4iKSkKQy5ZMj1uZXcgTC5POSgiTmF2aWdhdGlvblRyZWVOb2RlVHlw
+ZS5kaXJlY3RvcnkiKQpDLnJmPW5ldyBMLk85KCJOYXZpZ2F0aW9uVHJlZU5vZGVUeXBlLmZpbGUiKQpD
+LlRlPW5ldyBILnd2KCJjYWxsIikKQy53UT1uZXcgUC5GeShudWxsLDIpfSkoKTsoZnVuY3Rpb24gc3Rh
+dGljRmllbGRzKCl7JC55aj0wCiQubUo9bnVsbAokLlA0PW51bGwKJC5ORj1udWxsCiQuVFg9bnVsbAok
+Lng3PW51bGwKJC5udz1udWxsCiQudnY9bnVsbAokLkJ2PW51bGwKJC5TNj1udWxsCiQuazg9bnVsbAok
+Lm1nPW51bGwKJC5VRD0hMQokLlgzPUMuTlUKJC54Zz1bXQokLnhvPW51bGwKJC5CTz1udWxsCiQubHQ9
+bnVsbAokLkVVPW51bGwKJC5vcj1QLkZsKHUuTix1LlopCiQuSTY9bnVsbAokLkZmPW51bGx9KSgpOyhm
+dW5jdGlvbiBsYXp5SW5pdGlhbGl6ZXJzKCl7dmFyIHQ9aHVua0hlbHBlcnMubGF6eQp0KCQsImZhIiwi
+dyIsZnVuY3Rpb24oKXtyZXR1cm4gSC5ZZygiXyRkYXJ0X2RhcnRDbG9zdXJlIil9KQp0KCQsIlkyIiwi
+VU4iLGZ1bmN0aW9uKCl7cmV0dXJuIEguWWcoIl8kZGFydF9qcyIpfSkKdCgkLCJVMiIsIlNuIixmdW5j
+dGlvbigpe3JldHVybiBILmNNKEguUzcoewp0b1N0cmluZzpmdW5jdGlvbigpe3JldHVybiIkcmVjZWl2
+ZXIkIn19KSl9KQp0KCQsInhxIiwibHEiLGZ1bmN0aW9uKCl7cmV0dXJuIEguY00oSC5TNyh7JG1ldGhv
+ZCQ6bnVsbCwKdG9TdHJpbmc6ZnVuY3Rpb24oKXtyZXR1cm4iJHJlY2VpdmVyJCJ9fSkpfSkKdCgkLCJS
+MSIsIk45IixmdW5jdGlvbigpe3JldHVybiBILmNNKEguUzcobnVsbCkpfSkKdCgkLCJmTiIsImlJIixm
+dW5jdGlvbigpe3JldHVybiBILmNNKGZ1bmN0aW9uKCl7dmFyICRhcmd1bWVudHNFeHByJD0nJGFyZ3Vt
+ZW50cyQnCnRyeXtudWxsLiRtZXRob2QkKCRhcmd1bWVudHNFeHByJCl9Y2F0Y2gocyl7cmV0dXJuIHMu
+bWVzc2FnZX19KCkpfSkKdCgkLCJxaSIsIktmIixmdW5jdGlvbigpe3JldHVybiBILmNNKEguUzcodm9p
+ZCAwKSl9KQp0KCQsInJaIiwiWmgiLGZ1bmN0aW9uKCl7cmV0dXJuIEguY00oZnVuY3Rpb24oKXt2YXIg
+JGFyZ3VtZW50c0V4cHIkPSckYXJndW1lbnRzJCcKdHJ5eyh2b2lkIDApLiRtZXRob2QkKCRhcmd1bWVu
+dHNFeHByJCl9Y2F0Y2gocyl7cmV0dXJuIHMubWVzc2FnZX19KCkpfSkKdCgkLCJrcSIsInJOIixmdW5j
+dGlvbigpe3JldHVybiBILmNNKEguTWoobnVsbCkpfSkKdCgkLCJ0dCIsImMzIixmdW5jdGlvbigpe3Jl
+dHVybiBILmNNKGZ1bmN0aW9uKCl7dHJ5e251bGwuJG1ldGhvZCR9Y2F0Y2gocyl7cmV0dXJuIHMubWVz
+c2FnZX19KCkpfSkKdCgkLCJkdCIsIkhLIixmdW5jdGlvbigpe3JldHVybiBILmNNKEguTWoodm9pZCAw
+KSl9KQp0KCQsIkE3IiwicjEiLGZ1bmN0aW9uKCl7cmV0dXJuIEguY00oZnVuY3Rpb24oKXt0cnl7KHZv
+aWQgMCkuJG1ldGhvZCR9Y2F0Y2gocyl7cmV0dXJuIHMubWVzc2FnZX19KCkpfSkKdCgkLCJXYyIsInV0
+IixmdW5jdGlvbigpe3JldHVybiBQLk9qKCl9KQp0KCQsImtoIiwicmYiLGZ1bmN0aW9uKCl7cmV0dXJu
+IFAuV0koKX0pCnQoJCwiYnQiLCJWNyIsZnVuY3Rpb24oKXtyZXR1cm4gSC5EUShILlhGKEguVk0oWy0y
+LC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0y
+LC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0yLC0xLC0yLC0yLC0y
+LC0yLC0yLDYyLC0yLDYyLC0yLDYzLDUyLDUzLDU0LDU1LDU2LDU3LDU4LDU5LDYwLDYxLC0yLC0yLC0y
+LC0xLC0yLC0yLC0yLDAsMSwyLDMsNCw1LDYsNyw4LDksMTAsMTEsMTIsMTMsMTQsMTUsMTYsMTcsMTgs
+MTksMjAsMjEsMjIsMjMsMjQsMjUsLTIsLTIsLTIsLTIsNjMsLTIsMjYsMjcsMjgsMjksMzAsMzEsMzIs
+MzMsMzQsMzUsMzYsMzcsMzgsMzksNDAsNDEsNDIsNDMsNDQsNDUsNDYsNDcsNDgsNDksNTAsNTEsLTIs
+LTIsLTIsLTIsLTJdLHUudCkpKX0pCnQoJCwiTTUiLCJ3USIsZnVuY3Rpb24oKXtyZXR1cm4gdHlwZW9m
+IHByb2Nlc3MhPSJ1bmRlZmluZWQiJiZPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwocHJvY2Vz
+cyk9PSJbb2JqZWN0IHByb2Nlc3NdIiYmcHJvY2Vzcy5wbGF0Zm9ybT09IndpbjMyIn0pCnQoJCwibWYi
+LCJ6NCIsZnVuY3Rpb24oKXtyZXR1cm4gUC5udSgiXltcXC1cXC4wLTlBLVpfYS16fl0qJCIpfSkKdCgk
+LCJKRyIsInZaIixmdW5jdGlvbigpe3JldHVybiBQLnV4KCl9KQp0KCQsIlNDIiwiQU4iLGZ1bmN0aW9u
+KCl7cmV0dXJuIFAudE0oWyJBIiwiQUJCUiIsIkFDUk9OWU0iLCJBRERSRVNTIiwiQVJFQSIsIkFSVElD
+TEUiLCJBU0lERSIsIkFVRElPIiwiQiIsIkJESSIsIkJETyIsIkJJRyIsIkJMT0NLUVVPVEUiLCJCUiIs
+IkJVVFRPTiIsIkNBTlZBUyIsIkNBUFRJT04iLCJDRU5URVIiLCJDSVRFIiwiQ09ERSIsIkNPTCIsIkNP
+TEdST1VQIiwiQ09NTUFORCIsIkRBVEEiLCJEQVRBTElTVCIsIkREIiwiREVMIiwiREVUQUlMUyIsIkRG
+TiIsIkRJUiIsIkRJViIsIkRMIiwiRFQiLCJFTSIsIkZJRUxEU0VUIiwiRklHQ0FQVElPTiIsIkZJR1VS
+RSIsIkZPTlQiLCJGT09URVIiLCJGT1JNIiwiSDEiLCJIMiIsIkgzIiwiSDQiLCJINSIsIkg2IiwiSEVB
+REVSIiwiSEdST1VQIiwiSFIiLCJJIiwiSUZSQU1FIiwiSU1HIiwiSU5QVVQiLCJJTlMiLCJLQkQiLCJM
+QUJFTCIsIkxFR0VORCIsIkxJIiwiTUFQIiwiTUFSSyIsIk1FTlUiLCJNRVRFUiIsIk5BViIsIk5PQlIi
+LCJPTCIsIk9QVEdST1VQIiwiT1BUSU9OIiwiT1VUUFVUIiwiUCIsIlBSRSIsIlBST0dSRVNTIiwiUSIs
+IlMiLCJTQU1QIiwiU0VDVElPTiIsIlNFTEVDVCIsIlNNQUxMIiwiU09VUkNFIiwiU1BBTiIsIlNUUklL
+RSIsIlNUUk9ORyIsIlNVQiIsIlNVTU1BUlkiLCJTVVAiLCJUQUJMRSIsIlRCT0RZIiwiVEQiLCJURVhU
+QVJFQSIsIlRGT09UIiwiVEgiLCJUSEVBRCIsIlRJTUUiLCJUUiIsIlRSQUNLIiwiVFQiLCJVIiwiVUwi
+LCJWQVIiLCJWSURFTyIsIldCUiJdLHUuTil9KQp0KCQsIlg0IiwiaEciLGZ1bmN0aW9uKCl7cmV0dXJu
+IFAubnUoIl5cXFMrJCIpfSkKdCgkLCJ3TyIsIm93IixmdW5jdGlvbigpe3JldHVybiB1Lm0uYihQLk5E
+KHNlbGYpKX0pCnQoJCwia3QiLCJSOCIsZnVuY3Rpb24oKXtyZXR1cm4gSC5ZZygiXyRkYXJ0X2RhcnRP
+YmplY3QiKX0pCnQoJCwiZksiLCJrSSIsZnVuY3Rpb24oKXtyZXR1cm4gZnVuY3Rpb24gRGFydE9iamVj
+dChhKXt0aGlzLm89YX19KQp0KCQsInF0IiwiekIiLGZ1bmN0aW9uKCl7cmV0dXJuIG5ldyBULm1RKCl9
+KQp0KCQsIk9sIiwiVUUiLGZ1bmN0aW9uKCl7cmV0dXJuIFAuaEsoQy5vbC5nbVcoVy54MygpKS5ocmVm
+KS5naFkoKS5xKDAsImF1dGhUb2tlbiIpfSkKdCgkLCJoVCIsInlQIixmdW5jdGlvbigpe3JldHVybiBX
+LlpyKCkucXVlcnlTZWxlY3RvcigiLmVkaXQtbGlzdCAucGFuZWwtY29udGVudCIpfSkKdCgkLCJXNiIs
+ImhMIixmdW5jdGlvbigpe3JldHVybiBXLlpyKCkucXVlcnlTZWxlY3RvcigiLmVkaXQtcGFuZWwgLnBh
+bmVsLWNvbnRlbnQiKX0pCnQoJCwiVFIiLCJEVyIsZnVuY3Rpb24oKXtyZXR1cm4gVy5acigpLnF1ZXJ5
+U2VsZWN0b3IoImZvb3RlciIpfSkKdCgkLCJFWSIsImZpIixmdW5jdGlvbigpe3JldHVybiBXLlpyKCku
+cXVlcnlTZWxlY3RvcigiaGVhZGVyIil9KQp0KCQsImF2IiwiRDkiLGZ1bmN0aW9uKCl7cmV0dXJuIFcu
+WnIoKS5xdWVyeVNlbGVjdG9yKCIjdW5pdC1uYW1lIil9KQp0KCQsImZlIiwiS0ciLGZ1bmN0aW9uKCl7
+cmV0dXJuIG5ldyBMLlhBKCl9KQp0KCQsIm1NIiwiblUiLGZ1bmN0aW9uKCl7cmV0dXJuIG5ldyBNLmxJ
+KCQuSGsoKSl9KQp0KCQsInlyIiwiYkQiLGZ1bmN0aW9uKCl7cmV0dXJuIG5ldyBFLk9GKFAubnUoIi8i
+KSxQLm51KCJbXi9dJCIpLFAubnUoIl4vIikpfSkKdCgkLCJNayIsIktrIixmdW5jdGlvbigpe3JldHVy
+biBuZXcgTC5JVihQLm51KCJbL1xcXFxdIiksUC5udSgiW14vXFxcXF0kIiksUC5udSgiXihcXFxcXFxc
+XFteXFxcXF0rXFxcXFteXFxcXC9dK3xbYS16QS1aXTpbL1xcXFxdKSIpLFAubnUoIl5bL1xcXFxdKD8h
+Wy9cXFxcXSkiKSl9KQp0KCQsImFrIiwiRWIiLGZ1bmN0aW9uKCl7cmV0dXJuIG5ldyBGLnJ1KFAubnUo
+Ii8iKSxQLm51KCIoXlthLXpBLVpdWy0rLmEtekEtWlxcZF0qOi8vfFteL10pJCIpLFAubnUoIlthLXpB
+LVpdWy0rLmEtekEtWlxcZF0qOi8vW14vXSoiKSxQLm51KCJeLyIpKX0pCnQoJCwibHMiLCJIayIsZnVu
+Y3Rpb24oKXtyZXR1cm4gTy5SaCgpfSl9KSgpOyhmdW5jdGlvbiBuYXRpdmVTdXBwb3J0KCl7IWZ1bmN0
+aW9uKCl7dmFyIHQ9ZnVuY3Rpb24oYSl7dmFyIG49e30KblthXT0xCnJldHVybiBPYmplY3Qua2V5cyho
+dW5rSGVscGVycy5jb252ZXJ0VG9GYXN0T2JqZWN0KG4pKVswXX0Kdi5nZXRJc29sYXRlVGFnPWZ1bmN0
+aW9uKGEpe3JldHVybiB0KCJfX19kYXJ0XyIrYSt2Lmlzb2xhdGVUYWcpfQp2YXIgcz0iX19fZGFydF9p
+c29sYXRlX3RhZ3NfIgp2YXIgcj1PYmplY3Rbc118fChPYmplY3Rbc109T2JqZWN0LmNyZWF0ZShudWxs
+KSkKdmFyIHE9Il9aeFl4WCIKZm9yKHZhciBwPTA7O3ArKyl7dmFyIG89dChxKyJfIitwKyJfIikKaWYo
+IShvIGluIHIpKXtyW29dPTEKdi5pc29sYXRlVGFnPW8KYnJlYWt9fXYuZGlzcGF0Y2hQcm9wZXJ0eU5h
+bWU9di5nZXRJc29sYXRlVGFnKCJkaXNwYXRjaF9yZWNvcmQiKX0oKQpodW5rSGVscGVycy5zZXRPclVw
+ZGF0ZUludGVyY2VwdG9yc0J5VGFnKHtET01FcnJvcjpKLnZCLERPTUltcGxlbWVudGF0aW9uOkoudkIs
+TWVkaWFFcnJvcjpKLnZCLE5hdmlnYXRvcjpKLnZCLE5hdmlnYXRvckNvbmN1cnJlbnRIYXJkd2FyZTpK
+LnZCLE5hdmlnYXRvclVzZXJNZWRpYUVycm9yOkoudkIsT3ZlcmNvbnN0cmFpbmVkRXJyb3I6Si52QixQ
+b3NpdGlvbkVycm9yOkoudkIsUmFuZ2U6Si52QixTUUxFcnJvcjpKLnZCLERhdGFWaWV3OkguRVQsQXJy
+YXlCdWZmZXJWaWV3OkguRVQsRmxvYXQzMkFycmF5OkguRGcsRmxvYXQ2NEFycmF5OkguRGcsSW50MTZB
+cnJheTpILnhqLEludDMyQXJyYXk6SC5kRSxJbnQ4QXJyYXk6SC5aQSxVaW50MTZBcnJheTpILndmLFVp
+bnQzMkFycmF5OkguUHEsVWludDhDbGFtcGVkQXJyYXk6SC5lRSxDYW52YXNQaXhlbEFycmF5OkguZUUs
+VWludDhBcnJheTpILlY2LEhUTUxBdWRpb0VsZW1lbnQ6Vy5xRSxIVE1MQlJFbGVtZW50OlcucUUsSFRN
+TEJ1dHRvbkVsZW1lbnQ6Vy5xRSxIVE1MQ2FudmFzRWxlbWVudDpXLnFFLEhUTUxDb250ZW50RWxlbWVu
+dDpXLnFFLEhUTUxETGlzdEVsZW1lbnQ6Vy5xRSxIVE1MRGF0YUVsZW1lbnQ6Vy5xRSxIVE1MRGF0YUxp
+c3RFbGVtZW50OlcucUUsSFRNTERldGFpbHNFbGVtZW50OlcucUUsSFRNTERpYWxvZ0VsZW1lbnQ6Vy5x
+RSxIVE1MRGl2RWxlbWVudDpXLnFFLEhUTUxFbWJlZEVsZW1lbnQ6Vy5xRSxIVE1MRmllbGRTZXRFbGVt
+ZW50OlcucUUsSFRNTEhSRWxlbWVudDpXLnFFLEhUTUxIZWFkRWxlbWVudDpXLnFFLEhUTUxIZWFkaW5n
+RWxlbWVudDpXLnFFLEhUTUxIdG1sRWxlbWVudDpXLnFFLEhUTUxJRnJhbWVFbGVtZW50OlcucUUsSFRN
+TEltYWdlRWxlbWVudDpXLnFFLEhUTUxJbnB1dEVsZW1lbnQ6Vy5xRSxIVE1MTElFbGVtZW50OlcucUUs
+SFRNTExhYmVsRWxlbWVudDpXLnFFLEhUTUxMZWdlbmRFbGVtZW50OlcucUUsSFRNTExpbmtFbGVtZW50
+OlcucUUsSFRNTE1hcEVsZW1lbnQ6Vy5xRSxIVE1MTWVkaWFFbGVtZW50OlcucUUsSFRNTE1lbnVFbGVt
+ZW50OlcucUUsSFRNTE1ldGFFbGVtZW50OlcucUUsSFRNTE1ldGVyRWxlbWVudDpXLnFFLEhUTUxNb2RF
+bGVtZW50OlcucUUsSFRNTE9MaXN0RWxlbWVudDpXLnFFLEhUTUxPYmplY3RFbGVtZW50OlcucUUsSFRN
+TE9wdEdyb3VwRWxlbWVudDpXLnFFLEhUTUxPcHRpb25FbGVtZW50OlcucUUsSFRNTE91dHB1dEVsZW1l
+bnQ6Vy5xRSxIVE1MUGFyYW1FbGVtZW50OlcucUUsSFRNTFBpY3R1cmVFbGVtZW50OlcucUUsSFRNTFBy
+ZUVsZW1lbnQ6Vy5xRSxIVE1MUHJvZ3Jlc3NFbGVtZW50OlcucUUsSFRNTFF1b3RlRWxlbWVudDpXLnFF
+LEhUTUxTY3JpcHRFbGVtZW50OlcucUUsSFRNTFNoYWRvd0VsZW1lbnQ6Vy5xRSxIVE1MU2xvdEVsZW1l
+bnQ6Vy5xRSxIVE1MU291cmNlRWxlbWVudDpXLnFFLEhUTUxTcGFuRWxlbWVudDpXLnFFLEhUTUxTdHls
+ZUVsZW1lbnQ6Vy5xRSxIVE1MVGFibGVDYXB0aW9uRWxlbWVudDpXLnFFLEhUTUxUYWJsZUNlbGxFbGVt
+ZW50OlcucUUsSFRNTFRhYmxlRGF0YUNlbGxFbGVtZW50OlcucUUsSFRNTFRhYmxlSGVhZGVyQ2VsbEVs
+ZW1lbnQ6Vy5xRSxIVE1MVGFibGVDb2xFbGVtZW50OlcucUUsSFRNTFRleHRBcmVhRWxlbWVudDpXLnFF
+LEhUTUxUaW1lRWxlbWVudDpXLnFFLEhUTUxUaXRsZUVsZW1lbnQ6Vy5xRSxIVE1MVHJhY2tFbGVtZW50
+OlcucUUsSFRNTFVMaXN0RWxlbWVudDpXLnFFLEhUTUxVbmtub3duRWxlbWVudDpXLnFFLEhUTUxWaWRl
+b0VsZW1lbnQ6Vy5xRSxIVE1MRGlyZWN0b3J5RWxlbWVudDpXLnFFLEhUTUxGb250RWxlbWVudDpXLnFF
+LEhUTUxGcmFtZUVsZW1lbnQ6Vy5xRSxIVE1MRnJhbWVTZXRFbGVtZW50OlcucUUsSFRNTE1hcnF1ZWVF
+bGVtZW50OlcucUUsSFRNTEVsZW1lbnQ6Vy5xRSxIVE1MQW5jaG9yRWxlbWVudDpXLkdoLEhUTUxBcmVh
+RWxlbWVudDpXLmZZLEhUTUxCYXNlRWxlbWVudDpXLm5CLEJsb2I6Vy5BeixIVE1MQm9keUVsZW1lbnQ6
+Vy5RUCxDREFUQVNlY3Rpb246Vy5ueCxDaGFyYWN0ZXJEYXRhOlcubngsQ29tbWVudDpXLm54LFByb2Nl
+c3NpbmdJbnN0cnVjdGlvbjpXLm54LFRleHQ6Vy5ueCxDU1NTdHlsZURlY2xhcmF0aW9uOlcub0osTVNT
+dHlsZUNTU1Byb3BlcnRpZXM6Vy5vSixDU1MyUHJvcGVydGllczpXLm9KLFhNTERvY3VtZW50OlcuUUYs
+RG9jdW1lbnQ6Vy5RRixET01FeGNlcHRpb246Vy5OaCxET01SZWN0UmVhZE9ubHk6Vy5JQixET01Ub2tl
+bkxpc3Q6Vy5uNyxFbGVtZW50OlcuY3YsQWJvcnRQYXltZW50RXZlbnQ6Vy5lYSxBbmltYXRpb25FdmVu
+dDpXLmVhLEFuaW1hdGlvblBsYXliYWNrRXZlbnQ6Vy5lYSxBcHBsaWNhdGlvbkNhY2hlRXJyb3JFdmVu
+dDpXLmVhLEJhY2tncm91bmRGZXRjaENsaWNrRXZlbnQ6Vy5lYSxCYWNrZ3JvdW5kRmV0Y2hFdmVudDpX
+LmVhLEJhY2tncm91bmRGZXRjaEZhaWxFdmVudDpXLmVhLEJhY2tncm91bmRGZXRjaGVkRXZlbnQ6Vy5l
+YSxCZWZvcmVJbnN0YWxsUHJvbXB0RXZlbnQ6Vy5lYSxCZWZvcmVVbmxvYWRFdmVudDpXLmVhLEJsb2JF
+dmVudDpXLmVhLENhbk1ha2VQYXltZW50RXZlbnQ6Vy5lYSxDbGlwYm9hcmRFdmVudDpXLmVhLENsb3Nl
+RXZlbnQ6Vy5lYSxDdXN0b21FdmVudDpXLmVhLERldmljZU1vdGlvbkV2ZW50OlcuZWEsRGV2aWNlT3Jp
+ZW50YXRpb25FdmVudDpXLmVhLEVycm9yRXZlbnQ6Vy5lYSxFeHRlbmRhYmxlRXZlbnQ6Vy5lYSxFeHRl
+bmRhYmxlTWVzc2FnZUV2ZW50OlcuZWEsRmV0Y2hFdmVudDpXLmVhLEZvbnRGYWNlU2V0TG9hZEV2ZW50
+OlcuZWEsRm9yZWlnbkZldGNoRXZlbnQ6Vy5lYSxHYW1lcGFkRXZlbnQ6Vy5lYSxIYXNoQ2hhbmdlRXZl
+bnQ6Vy5lYSxJbnN0YWxsRXZlbnQ6Vy5lYSxNZWRpYUVuY3J5cHRlZEV2ZW50OlcuZWEsTWVkaWFLZXlN
+ZXNzYWdlRXZlbnQ6Vy5lYSxNZWRpYVF1ZXJ5TGlzdEV2ZW50OlcuZWEsTWVkaWFTdHJlYW1FdmVudDpX
+LmVhLE1lZGlhU3RyZWFtVHJhY2tFdmVudDpXLmVhLE1lc3NhZ2VFdmVudDpXLmVhLE1JRElDb25uZWN0
+aW9uRXZlbnQ6Vy5lYSxNSURJTWVzc2FnZUV2ZW50OlcuZWEsTXV0YXRpb25FdmVudDpXLmVhLE5vdGlm
+aWNhdGlvbkV2ZW50OlcuZWEsUGFnZVRyYW5zaXRpb25FdmVudDpXLmVhLFBheW1lbnRSZXF1ZXN0RXZl
+bnQ6Vy5lYSxQYXltZW50UmVxdWVzdFVwZGF0ZUV2ZW50OlcuZWEsUG9wU3RhdGVFdmVudDpXLmVhLFBy
+ZXNlbnRhdGlvbkNvbm5lY3Rpb25BdmFpbGFibGVFdmVudDpXLmVhLFByZXNlbnRhdGlvbkNvbm5lY3Rp
+b25DbG9zZUV2ZW50OlcuZWEsUHJvbWlzZVJlamVjdGlvbkV2ZW50OlcuZWEsUHVzaEV2ZW50OlcuZWEs
+UlRDRGF0YUNoYW5uZWxFdmVudDpXLmVhLFJUQ0RUTUZUb25lQ2hhbmdlRXZlbnQ6Vy5lYSxSVENQZWVy
+Q29ubmVjdGlvbkljZUV2ZW50OlcuZWEsUlRDVHJhY2tFdmVudDpXLmVhLFNlY3VyaXR5UG9saWN5Vmlv
+bGF0aW9uRXZlbnQ6Vy5lYSxTZW5zb3JFcnJvckV2ZW50OlcuZWEsU3BlZWNoUmVjb2duaXRpb25FcnJv
+cjpXLmVhLFNwZWVjaFJlY29nbml0aW9uRXZlbnQ6Vy5lYSxTcGVlY2hTeW50aGVzaXNFdmVudDpXLmVh
+LFN0b3JhZ2VFdmVudDpXLmVhLFN5bmNFdmVudDpXLmVhLFRyYWNrRXZlbnQ6Vy5lYSxUcmFuc2l0aW9u
+RXZlbnQ6Vy5lYSxXZWJLaXRUcmFuc2l0aW9uRXZlbnQ6Vy5lYSxWUkRldmljZUV2ZW50OlcuZWEsVlJE
+aXNwbGF5RXZlbnQ6Vy5lYSxWUlNlc3Npb25FdmVudDpXLmVhLE1vam9JbnRlcmZhY2VSZXF1ZXN0RXZl
+bnQ6Vy5lYSxVU0JDb25uZWN0aW9uRXZlbnQ6Vy5lYSxJREJWZXJzaW9uQ2hhbmdlRXZlbnQ6Vy5lYSxB
+dWRpb1Byb2Nlc3NpbmdFdmVudDpXLmVhLE9mZmxpbmVBdWRpb0NvbXBsZXRpb25FdmVudDpXLmVhLFdl
+YkdMQ29udGV4dEV2ZW50OlcuZWEsRXZlbnQ6Vy5lYSxJbnB1dEV2ZW50OlcuZWEsRXZlbnRUYXJnZXQ6
+Vy5EMCxGaWxlOlcuaEgsSFRNTEZvcm1FbGVtZW50OlcuaDQsSGlzdG9yeTpXLmJyLEhUTUxEb2N1bWVu
+dDpXLlZiLFhNTEh0dHBSZXF1ZXN0OlcuTzcsWE1MSHR0cFJlcXVlc3RFdmVudFRhcmdldDpXLndhLElt
+YWdlRGF0YTpXLlNnLExvY2F0aW9uOlcudTgsTW91c2VFdmVudDpXLkFqLERyYWdFdmVudDpXLkFqLFBv
+aW50ZXJFdmVudDpXLkFqLFdoZWVsRXZlbnQ6Vy5BaixEb2N1bWVudEZyYWdtZW50OlcudUgsU2hhZG93
+Um9vdDpXLnVILERvY3VtZW50VHlwZTpXLnVILE5vZGU6Vy51SCxOb2RlTGlzdDpXLkJILFJhZGlvTm9k
+ZUxpc3Q6Vy5CSCxIVE1MUGFyYWdyYXBoRWxlbWVudDpXLlNOLFByb2dyZXNzRXZlbnQ6Vy5ldyxSZXNv
+dXJjZVByb2dyZXNzRXZlbnQ6Vy5ldyxIVE1MU2VsZWN0RWxlbWVudDpXLmxwLEhUTUxUYWJsZUVsZW1l
+bnQ6Vy5UYixIVE1MVGFibGVSb3dFbGVtZW50OlcuSXYsSFRNTFRhYmxlU2VjdGlvbkVsZW1lbnQ6Vy5X
+UCxIVE1MVGVtcGxhdGVFbGVtZW50OlcueVksQ29tcG9zaXRpb25FdmVudDpXLnc2LEZvY3VzRXZlbnQ6
+Vy53NixLZXlib2FyZEV2ZW50OlcudzYsVGV4dEV2ZW50OlcudzYsVG91Y2hFdmVudDpXLnc2LFVJRXZl
+bnQ6Vy53NixXaW5kb3c6Vy5LNSxET01XaW5kb3c6Vy5LNSxEZWRpY2F0ZWRXb3JrZXJHbG9iYWxTY29w
+ZTpXLkNtLFNlcnZpY2VXb3JrZXJHbG9iYWxTY29wZTpXLkNtLFNoYXJlZFdvcmtlckdsb2JhbFNjb3Bl
+OlcuQ20sV29ya2VyR2xvYmFsU2NvcGU6Vy5DbSxBdHRyOlcuQ1EsQ2xpZW50UmVjdDpXLnc0LERPTVJl
+Y3Q6Vy53NCxOYW1lZE5vZGVNYXA6Vy5yaCxNb3pOYW1lZEF0dHJNYXA6Vy5yaCxJREJLZXlSYW5nZTpQ
+LmhGLFNWR1NjcmlwdEVsZW1lbnQ6UC5uZCxTVkdBRWxlbWVudDpQLmQ1LFNWR0FuaW1hdGVFbGVtZW50
+OlAuZDUsU1ZHQW5pbWF0ZU1vdGlvbkVsZW1lbnQ6UC5kNSxTVkdBbmltYXRlVHJhbnNmb3JtRWxlbWVu
+dDpQLmQ1LFNWR0FuaW1hdGlvbkVsZW1lbnQ6UC5kNSxTVkdDaXJjbGVFbGVtZW50OlAuZDUsU1ZHQ2xp
+cFBhdGhFbGVtZW50OlAuZDUsU1ZHRGVmc0VsZW1lbnQ6UC5kNSxTVkdEZXNjRWxlbWVudDpQLmQ1LFNW
+R0Rpc2NhcmRFbGVtZW50OlAuZDUsU1ZHRWxsaXBzZUVsZW1lbnQ6UC5kNSxTVkdGRUJsZW5kRWxlbWVu
+dDpQLmQ1LFNWR0ZFQ29sb3JNYXRyaXhFbGVtZW50OlAuZDUsU1ZHRkVDb21wb25lbnRUcmFuc2ZlckVs
+ZW1lbnQ6UC5kNSxTVkdGRUNvbXBvc2l0ZUVsZW1lbnQ6UC5kNSxTVkdGRUNvbnZvbHZlTWF0cml4RWxl
+bWVudDpQLmQ1LFNWR0ZFRGlmZnVzZUxpZ2h0aW5nRWxlbWVudDpQLmQ1LFNWR0ZFRGlzcGxhY2VtZW50
+TWFwRWxlbWVudDpQLmQ1LFNWR0ZFRGlzdGFudExpZ2h0RWxlbWVudDpQLmQ1LFNWR0ZFRmxvb2RFbGVt
+ZW50OlAuZDUsU1ZHRkVGdW5jQUVsZW1lbnQ6UC5kNSxTVkdGRUZ1bmNCRWxlbWVudDpQLmQ1LFNWR0ZF
+RnVuY0dFbGVtZW50OlAuZDUsU1ZHRkVGdW5jUkVsZW1lbnQ6UC5kNSxTVkdGRUdhdXNzaWFuQmx1ckVs
+ZW1lbnQ6UC5kNSxTVkdGRUltYWdlRWxlbWVudDpQLmQ1LFNWR0ZFTWVyZ2VFbGVtZW50OlAuZDUsU1ZH
+RkVNZXJnZU5vZGVFbGVtZW50OlAuZDUsU1ZHRkVNb3JwaG9sb2d5RWxlbWVudDpQLmQ1LFNWR0ZFT2Zm
+c2V0RWxlbWVudDpQLmQ1LFNWR0ZFUG9pbnRMaWdodEVsZW1lbnQ6UC5kNSxTVkdGRVNwZWN1bGFyTGln
+aHRpbmdFbGVtZW50OlAuZDUsU1ZHRkVTcG90TGlnaHRFbGVtZW50OlAuZDUsU1ZHRkVUaWxlRWxlbWVu
+dDpQLmQ1LFNWR0ZFVHVyYnVsZW5jZUVsZW1lbnQ6UC5kNSxTVkdGaWx0ZXJFbGVtZW50OlAuZDUsU1ZH
+Rm9yZWlnbk9iamVjdEVsZW1lbnQ6UC5kNSxTVkdHRWxlbWVudDpQLmQ1LFNWR0dlb21ldHJ5RWxlbWVu
+dDpQLmQ1LFNWR0dyYXBoaWNzRWxlbWVudDpQLmQ1LFNWR0ltYWdlRWxlbWVudDpQLmQ1LFNWR0xpbmVF
+bGVtZW50OlAuZDUsU1ZHTGluZWFyR3JhZGllbnRFbGVtZW50OlAuZDUsU1ZHTWFya2VyRWxlbWVudDpQ
+LmQ1LFNWR01hc2tFbGVtZW50OlAuZDUsU1ZHTWV0YWRhdGFFbGVtZW50OlAuZDUsU1ZHUGF0aEVsZW1l
+bnQ6UC5kNSxTVkdQYXR0ZXJuRWxlbWVudDpQLmQ1LFNWR1BvbHlnb25FbGVtZW50OlAuZDUsU1ZHUG9s
+eWxpbmVFbGVtZW50OlAuZDUsU1ZHUmFkaWFsR3JhZGllbnRFbGVtZW50OlAuZDUsU1ZHUmVjdEVsZW1l
+bnQ6UC5kNSxTVkdTZXRFbGVtZW50OlAuZDUsU1ZHU3RvcEVsZW1lbnQ6UC5kNSxTVkdTdHlsZUVsZW1l
+bnQ6UC5kNSxTVkdTVkdFbGVtZW50OlAuZDUsU1ZHU3dpdGNoRWxlbWVudDpQLmQ1LFNWR1N5bWJvbEVs
+ZW1lbnQ6UC5kNSxTVkdUU3BhbkVsZW1lbnQ6UC5kNSxTVkdUZXh0Q29udGVudEVsZW1lbnQ6UC5kNSxT
+VkdUZXh0RWxlbWVudDpQLmQ1LFNWR1RleHRQYXRoRWxlbWVudDpQLmQ1LFNWR1RleHRQb3NpdGlvbmlu
+Z0VsZW1lbnQ6UC5kNSxTVkdUaXRsZUVsZW1lbnQ6UC5kNSxTVkdVc2VFbGVtZW50OlAuZDUsU1ZHVmll
+d0VsZW1lbnQ6UC5kNSxTVkdHcmFkaWVudEVsZW1lbnQ6UC5kNSxTVkdDb21wb25lbnRUcmFuc2ZlckZ1
+bmN0aW9uRWxlbWVudDpQLmQ1LFNWR0ZFRHJvcFNoYWRvd0VsZW1lbnQ6UC5kNSxTVkdNUGF0aEVsZW1l
+bnQ6UC5kNSxTVkdFbGVtZW50OlAuZDV9KQpodW5rSGVscGVycy5zZXRPclVwZGF0ZUxlYWZUYWdzKHtE
+T01FcnJvcjp0cnVlLERPTUltcGxlbWVudGF0aW9uOnRydWUsTWVkaWFFcnJvcjp0cnVlLE5hdmlnYXRv
+cjp0cnVlLE5hdmlnYXRvckNvbmN1cnJlbnRIYXJkd2FyZTp0cnVlLE5hdmlnYXRvclVzZXJNZWRpYUVy
+cm9yOnRydWUsT3ZlcmNvbnN0cmFpbmVkRXJyb3I6dHJ1ZSxQb3NpdGlvbkVycm9yOnRydWUsUmFuZ2U6
+dHJ1ZSxTUUxFcnJvcjp0cnVlLERhdGFWaWV3OnRydWUsQXJyYXlCdWZmZXJWaWV3OmZhbHNlLEZsb2F0
+MzJBcnJheTp0cnVlLEZsb2F0NjRBcnJheTp0cnVlLEludDE2QXJyYXk6dHJ1ZSxJbnQzMkFycmF5OnRy
+dWUsSW50OEFycmF5OnRydWUsVWludDE2QXJyYXk6dHJ1ZSxVaW50MzJBcnJheTp0cnVlLFVpbnQ4Q2xh
+bXBlZEFycmF5OnRydWUsQ2FudmFzUGl4ZWxBcnJheTp0cnVlLFVpbnQ4QXJyYXk6ZmFsc2UsSFRNTEF1
+ZGlvRWxlbWVudDp0cnVlLEhUTUxCUkVsZW1lbnQ6dHJ1ZSxIVE1MQnV0dG9uRWxlbWVudDp0cnVlLEhU
+TUxDYW52YXNFbGVtZW50OnRydWUsSFRNTENvbnRlbnRFbGVtZW50OnRydWUsSFRNTERMaXN0RWxlbWVu
+dDp0cnVlLEhUTUxEYXRhRWxlbWVudDp0cnVlLEhUTUxEYXRhTGlzdEVsZW1lbnQ6dHJ1ZSxIVE1MRGV0
+YWlsc0VsZW1lbnQ6dHJ1ZSxIVE1MRGlhbG9nRWxlbWVudDp0cnVlLEhUTUxEaXZFbGVtZW50OnRydWUs
+SFRNTEVtYmVkRWxlbWVudDp0cnVlLEhUTUxGaWVsZFNldEVsZW1lbnQ6dHJ1ZSxIVE1MSFJFbGVtZW50
+OnRydWUsSFRNTEhlYWRFbGVtZW50OnRydWUsSFRNTEhlYWRpbmdFbGVtZW50OnRydWUsSFRNTEh0bWxF
+bGVtZW50OnRydWUsSFRNTElGcmFtZUVsZW1lbnQ6dHJ1ZSxIVE1MSW1hZ2VFbGVtZW50OnRydWUsSFRN
+TElucHV0RWxlbWVudDp0cnVlLEhUTUxMSUVsZW1lbnQ6dHJ1ZSxIVE1MTGFiZWxFbGVtZW50OnRydWUs
+SFRNTExlZ2VuZEVsZW1lbnQ6dHJ1ZSxIVE1MTGlua0VsZW1lbnQ6dHJ1ZSxIVE1MTWFwRWxlbWVudDp0
+cnVlLEhUTUxNZWRpYUVsZW1lbnQ6dHJ1ZSxIVE1MTWVudUVsZW1lbnQ6dHJ1ZSxIVE1MTWV0YUVsZW1l
+bnQ6dHJ1ZSxIVE1MTWV0ZXJFbGVtZW50OnRydWUsSFRNTE1vZEVsZW1lbnQ6dHJ1ZSxIVE1MT0xpc3RF
+bGVtZW50OnRydWUsSFRNTE9iamVjdEVsZW1lbnQ6dHJ1ZSxIVE1MT3B0R3JvdXBFbGVtZW50OnRydWUs
+SFRNTE9wdGlvbkVsZW1lbnQ6dHJ1ZSxIVE1MT3V0cHV0RWxlbWVudDp0cnVlLEhUTUxQYXJhbUVsZW1l
+bnQ6dHJ1ZSxIVE1MUGljdHVyZUVsZW1lbnQ6dHJ1ZSxIVE1MUHJlRWxlbWVudDp0cnVlLEhUTUxQcm9n
+cmVzc0VsZW1lbnQ6dHJ1ZSxIVE1MUXVvdGVFbGVtZW50OnRydWUsSFRNTFNjcmlwdEVsZW1lbnQ6dHJ1
+ZSxIVE1MU2hhZG93RWxlbWVudDp0cnVlLEhUTUxTbG90RWxlbWVudDp0cnVlLEhUTUxTb3VyY2VFbGVt
+ZW50OnRydWUsSFRNTFNwYW5FbGVtZW50OnRydWUsSFRNTFN0eWxlRWxlbWVudDp0cnVlLEhUTUxUYWJs
+ZUNhcHRpb25FbGVtZW50OnRydWUsSFRNTFRhYmxlQ2VsbEVsZW1lbnQ6dHJ1ZSxIVE1MVGFibGVEYXRh
+Q2VsbEVsZW1lbnQ6dHJ1ZSxIVE1MVGFibGVIZWFkZXJDZWxsRWxlbWVudDp0cnVlLEhUTUxUYWJsZUNv
+bEVsZW1lbnQ6dHJ1ZSxIVE1MVGV4dEFyZWFFbGVtZW50OnRydWUsSFRNTFRpbWVFbGVtZW50OnRydWUs
+SFRNTFRpdGxlRWxlbWVudDp0cnVlLEhUTUxUcmFja0VsZW1lbnQ6dHJ1ZSxIVE1MVUxpc3RFbGVtZW50
+OnRydWUsSFRNTFVua25vd25FbGVtZW50OnRydWUsSFRNTFZpZGVvRWxlbWVudDp0cnVlLEhUTUxEaXJl
+Y3RvcnlFbGVtZW50OnRydWUsSFRNTEZvbnRFbGVtZW50OnRydWUsSFRNTEZyYW1lRWxlbWVudDp0cnVl
+LEhUTUxGcmFtZVNldEVsZW1lbnQ6dHJ1ZSxIVE1MTWFycXVlZUVsZW1lbnQ6dHJ1ZSxIVE1MRWxlbWVu
+dDpmYWxzZSxIVE1MQW5jaG9yRWxlbWVudDp0cnVlLEhUTUxBcmVhRWxlbWVudDp0cnVlLEhUTUxCYXNl
+RWxlbWVudDp0cnVlLEJsb2I6ZmFsc2UsSFRNTEJvZHlFbGVtZW50OnRydWUsQ0RBVEFTZWN0aW9uOnRy
+dWUsQ2hhcmFjdGVyRGF0YTp0cnVlLENvbW1lbnQ6dHJ1ZSxQcm9jZXNzaW5nSW5zdHJ1Y3Rpb246dHJ1
+ZSxUZXh0OnRydWUsQ1NTU3R5bGVEZWNsYXJhdGlvbjp0cnVlLE1TU3R5bGVDU1NQcm9wZXJ0aWVzOnRy
+dWUsQ1NTMlByb3BlcnRpZXM6dHJ1ZSxYTUxEb2N1bWVudDp0cnVlLERvY3VtZW50OmZhbHNlLERPTUV4
+Y2VwdGlvbjp0cnVlLERPTVJlY3RSZWFkT25seTpmYWxzZSxET01Ub2tlbkxpc3Q6dHJ1ZSxFbGVtZW50
+OmZhbHNlLEFib3J0UGF5bWVudEV2ZW50OnRydWUsQW5pbWF0aW9uRXZlbnQ6dHJ1ZSxBbmltYXRpb25Q
+bGF5YmFja0V2ZW50OnRydWUsQXBwbGljYXRpb25DYWNoZUVycm9yRXZlbnQ6dHJ1ZSxCYWNrZ3JvdW5k
+RmV0Y2hDbGlja0V2ZW50OnRydWUsQmFja2dyb3VuZEZldGNoRXZlbnQ6dHJ1ZSxCYWNrZ3JvdW5kRmV0
+Y2hGYWlsRXZlbnQ6dHJ1ZSxCYWNrZ3JvdW5kRmV0Y2hlZEV2ZW50OnRydWUsQmVmb3JlSW5zdGFsbFBy
+b21wdEV2ZW50OnRydWUsQmVmb3JlVW5sb2FkRXZlbnQ6dHJ1ZSxCbG9iRXZlbnQ6dHJ1ZSxDYW5NYWtl
+UGF5bWVudEV2ZW50OnRydWUsQ2xpcGJvYXJkRXZlbnQ6dHJ1ZSxDbG9zZUV2ZW50OnRydWUsQ3VzdG9t
+RXZlbnQ6dHJ1ZSxEZXZpY2VNb3Rpb25FdmVudDp0cnVlLERldmljZU9yaWVudGF0aW9uRXZlbnQ6dHJ1
+ZSxFcnJvckV2ZW50OnRydWUsRXh0ZW5kYWJsZUV2ZW50OnRydWUsRXh0ZW5kYWJsZU1lc3NhZ2VFdmVu
+dDp0cnVlLEZldGNoRXZlbnQ6dHJ1ZSxGb250RmFjZVNldExvYWRFdmVudDp0cnVlLEZvcmVpZ25GZXRj
+aEV2ZW50OnRydWUsR2FtZXBhZEV2ZW50OnRydWUsSGFzaENoYW5nZUV2ZW50OnRydWUsSW5zdGFsbEV2
+ZW50OnRydWUsTWVkaWFFbmNyeXB0ZWRFdmVudDp0cnVlLE1lZGlhS2V5TWVzc2FnZUV2ZW50OnRydWUs
+TWVkaWFRdWVyeUxpc3RFdmVudDp0cnVlLE1lZGlhU3RyZWFtRXZlbnQ6dHJ1ZSxNZWRpYVN0cmVhbVRy
+YWNrRXZlbnQ6dHJ1ZSxNZXNzYWdlRXZlbnQ6dHJ1ZSxNSURJQ29ubmVjdGlvbkV2ZW50OnRydWUsTUlE
+SU1lc3NhZ2VFdmVudDp0cnVlLE11dGF0aW9uRXZlbnQ6dHJ1ZSxOb3RpZmljYXRpb25FdmVudDp0cnVl
+LFBhZ2VUcmFuc2l0aW9uRXZlbnQ6dHJ1ZSxQYXltZW50UmVxdWVzdEV2ZW50OnRydWUsUGF5bWVudFJl
+cXVlc3RVcGRhdGVFdmVudDp0cnVlLFBvcFN0YXRlRXZlbnQ6dHJ1ZSxQcmVzZW50YXRpb25Db25uZWN0
+aW9uQXZhaWxhYmxlRXZlbnQ6dHJ1ZSxQcmVzZW50YXRpb25Db25uZWN0aW9uQ2xvc2VFdmVudDp0cnVl
+LFByb21pc2VSZWplY3Rpb25FdmVudDp0cnVlLFB1c2hFdmVudDp0cnVlLFJUQ0RhdGFDaGFubmVsRXZl
+bnQ6dHJ1ZSxSVENEVE1GVG9uZUNoYW5nZUV2ZW50OnRydWUsUlRDUGVlckNvbm5lY3Rpb25JY2VFdmVu
+dDp0cnVlLFJUQ1RyYWNrRXZlbnQ6dHJ1ZSxTZWN1cml0eVBvbGljeVZpb2xhdGlvbkV2ZW50OnRydWUs
+U2Vuc29yRXJyb3JFdmVudDp0cnVlLFNwZWVjaFJlY29nbml0aW9uRXJyb3I6dHJ1ZSxTcGVlY2hSZWNv
+Z25pdGlvbkV2ZW50OnRydWUsU3BlZWNoU3ludGhlc2lzRXZlbnQ6dHJ1ZSxTdG9yYWdlRXZlbnQ6dHJ1
+ZSxTeW5jRXZlbnQ6dHJ1ZSxUcmFja0V2ZW50OnRydWUsVHJhbnNpdGlvbkV2ZW50OnRydWUsV2ViS2l0
+VHJhbnNpdGlvbkV2ZW50OnRydWUsVlJEZXZpY2VFdmVudDp0cnVlLFZSRGlzcGxheUV2ZW50OnRydWUs
+VlJTZXNzaW9uRXZlbnQ6dHJ1ZSxNb2pvSW50ZXJmYWNlUmVxdWVzdEV2ZW50OnRydWUsVVNCQ29ubmVj
+dGlvbkV2ZW50OnRydWUsSURCVmVyc2lvbkNoYW5nZUV2ZW50OnRydWUsQXVkaW9Qcm9jZXNzaW5nRXZl
+bnQ6dHJ1ZSxPZmZsaW5lQXVkaW9Db21wbGV0aW9uRXZlbnQ6dHJ1ZSxXZWJHTENvbnRleHRFdmVudDp0
+cnVlLEV2ZW50OmZhbHNlLElucHV0RXZlbnQ6ZmFsc2UsRXZlbnRUYXJnZXQ6ZmFsc2UsRmlsZTp0cnVl
+LEhUTUxGb3JtRWxlbWVudDp0cnVlLEhpc3Rvcnk6dHJ1ZSxIVE1MRG9jdW1lbnQ6dHJ1ZSxYTUxIdHRw
+UmVxdWVzdDp0cnVlLFhNTEh0dHBSZXF1ZXN0RXZlbnRUYXJnZXQ6ZmFsc2UsSW1hZ2VEYXRhOnRydWUs
+TG9jYXRpb246dHJ1ZSxNb3VzZUV2ZW50OnRydWUsRHJhZ0V2ZW50OnRydWUsUG9pbnRlckV2ZW50OnRy
+dWUsV2hlZWxFdmVudDp0cnVlLERvY3VtZW50RnJhZ21lbnQ6dHJ1ZSxTaGFkb3dSb290OnRydWUsRG9j
+dW1lbnRUeXBlOnRydWUsTm9kZTpmYWxzZSxOb2RlTGlzdDp0cnVlLFJhZGlvTm9kZUxpc3Q6dHJ1ZSxI
+VE1MUGFyYWdyYXBoRWxlbWVudDp0cnVlLFByb2dyZXNzRXZlbnQ6dHJ1ZSxSZXNvdXJjZVByb2dyZXNz
+RXZlbnQ6dHJ1ZSxIVE1MU2VsZWN0RWxlbWVudDp0cnVlLEhUTUxUYWJsZUVsZW1lbnQ6dHJ1ZSxIVE1M
+VGFibGVSb3dFbGVtZW50OnRydWUsSFRNTFRhYmxlU2VjdGlvbkVsZW1lbnQ6dHJ1ZSxIVE1MVGVtcGxh
+dGVFbGVtZW50OnRydWUsQ29tcG9zaXRpb25FdmVudDp0cnVlLEZvY3VzRXZlbnQ6dHJ1ZSxLZXlib2Fy
+ZEV2ZW50OnRydWUsVGV4dEV2ZW50OnRydWUsVG91Y2hFdmVudDp0cnVlLFVJRXZlbnQ6ZmFsc2UsV2lu
+ZG93OnRydWUsRE9NV2luZG93OnRydWUsRGVkaWNhdGVkV29ya2VyR2xvYmFsU2NvcGU6dHJ1ZSxTZXJ2
+aWNlV29ya2VyR2xvYmFsU2NvcGU6dHJ1ZSxTaGFyZWRXb3JrZXJHbG9iYWxTY29wZTp0cnVlLFdvcmtl
+ckdsb2JhbFNjb3BlOnRydWUsQXR0cjp0cnVlLENsaWVudFJlY3Q6dHJ1ZSxET01SZWN0OnRydWUsTmFt
+ZWROb2RlTWFwOnRydWUsTW96TmFtZWRBdHRyTWFwOnRydWUsSURCS2V5UmFuZ2U6dHJ1ZSxTVkdTY3Jp
+cHRFbGVtZW50OnRydWUsU1ZHQUVsZW1lbnQ6dHJ1ZSxTVkdBbmltYXRlRWxlbWVudDp0cnVlLFNWR0Fu
+aW1hdGVNb3Rpb25FbGVtZW50OnRydWUsU1ZHQW5pbWF0ZVRyYW5zZm9ybUVsZW1lbnQ6dHJ1ZSxTVkdB
+bmltYXRpb25FbGVtZW50OnRydWUsU1ZHQ2lyY2xlRWxlbWVudDp0cnVlLFNWR0NsaXBQYXRoRWxlbWVu
+dDp0cnVlLFNWR0RlZnNFbGVtZW50OnRydWUsU1ZHRGVzY0VsZW1lbnQ6dHJ1ZSxTVkdEaXNjYXJkRWxl
+bWVudDp0cnVlLFNWR0VsbGlwc2VFbGVtZW50OnRydWUsU1ZHRkVCbGVuZEVsZW1lbnQ6dHJ1ZSxTVkdG
+RUNvbG9yTWF0cml4RWxlbWVudDp0cnVlLFNWR0ZFQ29tcG9uZW50VHJhbnNmZXJFbGVtZW50OnRydWUs
+U1ZHRkVDb21wb3NpdGVFbGVtZW50OnRydWUsU1ZHRkVDb252b2x2ZU1hdHJpeEVsZW1lbnQ6dHJ1ZSxT
+VkdGRURpZmZ1c2VMaWdodGluZ0VsZW1lbnQ6dHJ1ZSxTVkdGRURpc3BsYWNlbWVudE1hcEVsZW1lbnQ6
+dHJ1ZSxTVkdGRURpc3RhbnRMaWdodEVsZW1lbnQ6dHJ1ZSxTVkdGRUZsb29kRWxlbWVudDp0cnVlLFNW
+R0ZFRnVuY0FFbGVtZW50OnRydWUsU1ZHRkVGdW5jQkVsZW1lbnQ6dHJ1ZSxTVkdGRUZ1bmNHRWxlbWVu
+dDp0cnVlLFNWR0ZFRnVuY1JFbGVtZW50OnRydWUsU1ZHRkVHYXVzc2lhbkJsdXJFbGVtZW50OnRydWUs
+U1ZHRkVJbWFnZUVsZW1lbnQ6dHJ1ZSxTVkdGRU1lcmdlRWxlbWVudDp0cnVlLFNWR0ZFTWVyZ2VOb2Rl
+RWxlbWVudDp0cnVlLFNWR0ZFTW9ycGhvbG9neUVsZW1lbnQ6dHJ1ZSxTVkdGRU9mZnNldEVsZW1lbnQ6
+dHJ1ZSxTVkdGRVBvaW50TGlnaHRFbGVtZW50OnRydWUsU1ZHRkVTcGVjdWxhckxpZ2h0aW5nRWxlbWVu
+dDp0cnVlLFNWR0ZFU3BvdExpZ2h0RWxlbWVudDp0cnVlLFNWR0ZFVGlsZUVsZW1lbnQ6dHJ1ZSxTVkdG
+RVR1cmJ1bGVuY2VFbGVtZW50OnRydWUsU1ZHRmlsdGVyRWxlbWVudDp0cnVlLFNWR0ZvcmVpZ25PYmpl
+Y3RFbGVtZW50OnRydWUsU1ZHR0VsZW1lbnQ6dHJ1ZSxTVkdHZW9tZXRyeUVsZW1lbnQ6dHJ1ZSxTVkdH
+cmFwaGljc0VsZW1lbnQ6dHJ1ZSxTVkdJbWFnZUVsZW1lbnQ6dHJ1ZSxTVkdMaW5lRWxlbWVudDp0cnVl
+LFNWR0xpbmVhckdyYWRpZW50RWxlbWVudDp0cnVlLFNWR01hcmtlckVsZW1lbnQ6dHJ1ZSxTVkdNYXNr
+RWxlbWVudDp0cnVlLFNWR01ldGFkYXRhRWxlbWVudDp0cnVlLFNWR1BhdGhFbGVtZW50OnRydWUsU1ZH
+UGF0dGVybkVsZW1lbnQ6dHJ1ZSxTVkdQb2x5Z29uRWxlbWVudDp0cnVlLFNWR1BvbHlsaW5lRWxlbWVu
+dDp0cnVlLFNWR1JhZGlhbEdyYWRpZW50RWxlbWVudDp0cnVlLFNWR1JlY3RFbGVtZW50OnRydWUsU1ZH
+U2V0RWxlbWVudDp0cnVlLFNWR1N0b3BFbGVtZW50OnRydWUsU1ZHU3R5bGVFbGVtZW50OnRydWUsU1ZH
+U1ZHRWxlbWVudDp0cnVlLFNWR1N3aXRjaEVsZW1lbnQ6dHJ1ZSxTVkdTeW1ib2xFbGVtZW50OnRydWUs
+U1ZHVFNwYW5FbGVtZW50OnRydWUsU1ZHVGV4dENvbnRlbnRFbGVtZW50OnRydWUsU1ZHVGV4dEVsZW1l
+bnQ6dHJ1ZSxTVkdUZXh0UGF0aEVsZW1lbnQ6dHJ1ZSxTVkdUZXh0UG9zaXRpb25pbmdFbGVtZW50OnRy
+dWUsU1ZHVGl0bGVFbGVtZW50OnRydWUsU1ZHVXNlRWxlbWVudDp0cnVlLFNWR1ZpZXdFbGVtZW50OnRy
+dWUsU1ZHR3JhZGllbnRFbGVtZW50OnRydWUsU1ZHQ29tcG9uZW50VHJhbnNmZXJGdW5jdGlvbkVsZW1l
+bnQ6dHJ1ZSxTVkdGRURyb3BTaGFkb3dFbGVtZW50OnRydWUsU1ZHTVBhdGhFbGVtZW50OnRydWUsU1ZH
+RWxlbWVudDpmYWxzZX0pCkguTFouJG5hdGl2ZVN1cGVyY2xhc3NUYWc9IkFycmF5QnVmZmVyVmlldyIK
+SC5SRy4kbmF0aXZlU3VwZXJjbGFzc1RhZz0iQXJyYXlCdWZmZXJWaWV3IgpILlZQLiRuYXRpdmVTdXBl
+cmNsYXNzVGFnPSJBcnJheUJ1ZmZlclZpZXciCkguRGcuJG5hdGl2ZVN1cGVyY2xhc3NUYWc9IkFycmF5
+QnVmZmVyVmlldyIKSC5XQi4kbmF0aXZlU3VwZXJjbGFzc1RhZz0iQXJyYXlCdWZmZXJWaWV3IgpILlpH
+LiRuYXRpdmVTdXBlcmNsYXNzVGFnPSJBcnJheUJ1ZmZlclZpZXciCkguUGcuJG5hdGl2ZVN1cGVyY2xh
+c3NUYWc9IkFycmF5QnVmZmVyVmlldyJ9KSgpCmNvbnZlcnRBbGxUb0Zhc3RPYmplY3QodykKY29udmVy
+dFRvRmFzdE9iamVjdCgkKTsoZnVuY3Rpb24oYSl7aWYodHlwZW9mIGRvY3VtZW50PT09InVuZGVmaW5l
+ZCIpe2EobnVsbCkKcmV0dXJufWlmKHR5cGVvZiBkb2N1bWVudC5jdXJyZW50U2NyaXB0IT0ndW5kZWZp
+bmVkJyl7YShkb2N1bWVudC5jdXJyZW50U2NyaXB0KQpyZXR1cm59dmFyIHQ9ZG9jdW1lbnQuc2NyaXB0
+cwpmdW5jdGlvbiBvbkxvYWQoYil7Zm9yKHZhciByPTA7cjx0Lmxlbmd0aDsrK3IpdFtyXS5yZW1vdmVF
+dmVudExpc3RlbmVyKCJsb2FkIixvbkxvYWQsZmFsc2UpCmEoYi50YXJnZXQpfWZvcih2YXIgcz0wO3M8
+dC5sZW5ndGg7KytzKXRbc10uYWRkRXZlbnRMaXN0ZW5lcigibG9hZCIsb25Mb2FkLGZhbHNlKX0pKGZ1
+bmN0aW9uKGEpe3YuY3VycmVudFNjcmlwdD1hCmlmKHR5cGVvZiBkYXJ0TWFpblJ1bm5lcj09PSJmdW5j
+dGlvbiIpZGFydE1haW5SdW5uZXIoTC5JcSxbXSkKZWxzZSBMLklxKFtdKX0pfSkoKQovLyMgc291cmNl
+TWFwcGluZ1VSTD1taWdyYXRpb24uanMubWFwCg==
 ''';
diff --git a/pkg/nnbd_migration/lib/src/front_end/web/migration.dart b/pkg/nnbd_migration/lib/src/front_end/web/migration.dart
index 1710839..776dab7 100644
--- a/pkg/nnbd_migration/lib/src/front_end/web/migration.dart
+++ b/pkg/nnbd_migration/lib/src/front_end/web/migration.dart
@@ -459,7 +459,12 @@
   } else {
     // If no offset is given, this is likely a navigation link, and we need to
     // scroll back to the top of the page.
-    maybeScrollIntoView(unitName);
+    var lines = document.querySelectorAll('.line-no');
+    if (lines.isEmpty) {
+      // I don't see how this could happen, but return anyhow.
+      return;
+    }
+    maybeScrollIntoView(lines.first);
   }
 }
 
diff --git a/pkg/nnbd_migration/test/api_test.dart b/pkg/nnbd_migration/test/api_test.dart
index 7fed545..63a665d 100644
--- a/pkg/nnbd_migration/test/api_test.dart
+++ b/pkg/nnbd_migration/test/api_test.dart
@@ -207,22 +207,6 @@
     await _checkSingleFileChanges(content, expected);
   }
 
-  @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/42327')
-  // When fixing this issue, probably convert this to an edge builder test.
-  Future<void> test_migratedMethod_namedParameter() async {
-    var content = '''
-void f(Iterable<int> a) {
-  a.toList(growable: false);
-}
-''';
-    var expected = '''
-void f(Iterable<int> a) {
-  a.toList(growable: false);
-}
-''';
-    await _checkSingleFileChanges(content, expected);
-  }
-
   Future<void> test_add_required() async {
     var content = '''
 int f({String s}) => s.length;
@@ -4138,6 +4122,22 @@
     await _checkSingleFileChanges(content, expected);
   }
 
+  @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/42327')
+  // When fixing this issue, probably convert this to an edge builder test.
+  Future<void> test_migratedMethod_namedParameter() async {
+    var content = '''
+void f(Iterable<int> a) {
+  a.toList(growable: false);
+}
+''';
+    var expected = '''
+void f(Iterable<int> a) {
+  a.toList(growable: false);
+}
+''';
+    await _checkSingleFileChanges(content, expected);
+  }
+
   Future<void> test_multiDeclaration_innerUsage() async {
     var content = '''
 void test() {
diff --git a/pkg/nnbd_migration/test/edge_builder_test.dart b/pkg/nnbd_migration/test/edge_builder_test.dart
index 0d6105f..2c39e2c 100644
--- a/pkg/nnbd_migration/test/edge_builder_test.dart
+++ b/pkg/nnbd_migration/test/edge_builder_test.dart
@@ -6836,6 +6836,26 @@
     expect(edge.sourceNode.displayName, 'implicit null return (test.dart:2:3)');
   }
 
+  Future<void> test_return_in_asyncStar() async {
+    await analyze('''
+Stream<int> f() async* {
+  yield 1;
+  return;
+}
+''');
+    assertNoUpstreamNullability(decoratedTypeAnnotation('Stream<int>').node);
+  }
+
+  Future<void> test_return_in_syncStar() async {
+    await analyze('''
+Iterable<int> f() sync* {
+  yield 1;
+  return;
+}
+''');
+    assertNoUpstreamNullability(decoratedTypeAnnotation('Iterable<int>').node);
+  }
+
   Future<void> test_return_null() async {
     await analyze('''
 int f() {
diff --git a/pkg/nnbd_migration/test/fix_builder_test.dart b/pkg/nnbd_migration/test/fix_builder_test.dart
index b4e888d..9ce7d5f 100644
--- a/pkg/nnbd_migration/test/fix_builder_test.dart
+++ b/pkg/nnbd_migration/test/fix_builder_test.dart
@@ -1905,7 +1905,6 @@
     visitSubexpression(findNode.methodInvocation('_g();'), 'int');
   }
 
-  @FailingTest(reason: 'TODO(paulberry)')
   Future<void> test_methodInvocation_toString() async {
     await analyze('''
 abstract class _C {}
@@ -2379,7 +2378,6 @@
     visitSubexpression(findNode.prefixed('c.x'), 'int?');
   }
 
-  @FailingTest(reason: 'TODO(paulberry)')
   Future<void> test_prefixedIdentifier_object_getter() async {
     await analyze('''
 class _C {}
@@ -2388,7 +2386,6 @@
     visitSubexpression(findNode.prefixed('c.hashCode'), 'int');
   }
 
-  @FailingTest(reason: 'TODO(paulberry)')
   Future<void> test_prefixedIdentifier_object_tearoff() async {
     await analyze('''
 class _C {}
@@ -2784,7 +2781,6 @@
     visitSubexpression(findNode.propertyAccess('c?.x'), 'List<int>?');
   }
 
-  @FailingTest(reason: 'TODO(paulberry)')
   Future<void> test_propertyAccess_object_getter() async {
     await analyze('''
 class _C {}
@@ -2793,7 +2789,6 @@
     visitSubexpression(findNode.propertyAccess('(c).hashCode'), 'int');
   }
 
-  @FailingTest(reason: 'TODO(paulberry)')
   Future<void> test_propertyAccess_object_tearoff() async {
     await analyze('''
 class _C {}
diff --git a/pkg/nnbd_migration/test/migration_cli_test.dart b/pkg/nnbd_migration/test/migration_cli_test.dart
index c282fc0..daf4b38 100644
--- a/pkg/nnbd_migration/test/migration_cli_test.dart
+++ b/pkg/nnbd_migration/test/migration_cli_test.dart
@@ -11,6 +11,7 @@
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/source/line_info.dart';
+import 'package:analyzer/src/dart/analysis/driver_based_analysis_context.dart';
 import 'package:analyzer/src/test_utilities/mock_sdk.dart' as mock_sdk;
 import 'package:args/args.dart';
 import 'package:cli_util/cli_logging.dart';
@@ -75,23 +76,33 @@
 }
 
 class _MigrationCli extends MigrationCli {
-  /// If `true`, then an artifical exception should be generated when migration
-  /// encounters a reference to the `print` function.
-  final bool injectArtificialException;
+  final _MigrationCliTestBase _test;
 
-  Future<void> Function() _runWhilePreviewServerActive;
-
-  _MigrationCli(_MigrationCliTestBase test,
-      {this.injectArtificialException = false,
-      Map<String, String> environmentVariables})
+  _MigrationCli(this._test)
       : super(
             binaryName: 'nnbd_migration',
-            loggerFactory: (isVerbose) => test.logger = _TestLogger(isVerbose),
+            loggerFactory: (isVerbose) => _test.logger = _TestLogger(isVerbose),
             defaultSdkPathOverride:
-                test.resourceProvider.convertPath(mock_sdk.sdkRoot),
-            resourceProvider: test.resourceProvider,
-            processManager: test.processManager,
-            environmentVariables: environmentVariables);
+                _test.resourceProvider.convertPath(mock_sdk.sdkRoot),
+            resourceProvider: _test.resourceProvider,
+            processManager: _test.processManager,
+            environmentVariables: _test.environmentVariables);
+
+  _MigrationCliRunner decodeCommandLineArgs(ArgResults argResults,
+      {bool isVerbose}) {
+    var runner = super.decodeCommandLineArgs(argResults, isVerbose: isVerbose);
+    if (runner == null) return null;
+    return _MigrationCliRunner(this, runner.options);
+  }
+}
+
+class _MigrationCliRunner extends MigrationCliRunner {
+  Future<void> Function() _runWhilePreviewServerActive;
+
+  _MigrationCliRunner(_MigrationCli cli, CommandLineOptions options)
+      : super(cli, options);
+
+  _MigrationCli get cli => super.cli as _MigrationCli;
 
   @override
   Future<void> blockUntilSignalInterrupt() async {
@@ -103,12 +114,16 @@
   }
 
   @override
+  Set<String> computePathsToProcess(DriverBasedAnalysisContext context) =>
+      cli._test.overridePathsToProcess ?? super.computePathsToProcess(context);
+
+  @override
   NonNullableFix createNonNullableFix(DartFixListener listener,
       ResourceProvider resourceProvider, LineInfo getLineInfo(String path),
       {List<String> included = const <String>[],
       int preferredPort,
       String summaryPath}) {
-    if (injectArtificialException) {
+    if (cli._test.injectArtificialException) {
       return _ExceptionGeneratingNonNullableFix(
           listener, resourceProvider, getLineInfo,
           included: included,
@@ -122,17 +137,33 @@
     }
   }
 
-  Future<void> runWithPreviewServer(
-      ArgResults argResults, Future<void> callback()) async {
+  Future<void> runWithPreviewServer(Future<void> callback()) async {
     _runWhilePreviewServerActive = callback;
-    await run(argResults);
+    await run();
     if (_runWhilePreviewServerActive != null) {
       fail('Preview server never started');
     }
   }
+
+  @override
+  bool shouldBeMigrated(DriverBasedAnalysisContext context, String path) =>
+      cli._test.overrideShouldBeMigrated?.call(path) ??
+      super.shouldBeMigrated(context, path);
 }
 
 abstract class _MigrationCliTestBase {
+  Map<String, String> environmentVariables = {};
+
+  /// If `true`, then an artificial exception should be generated when migration
+  /// encounters a reference to the `print` function.
+  bool injectArtificialException = false;
+
+  /// If non-null, this is injected as the return value for
+  /// [_MigrationCliRunner.computePathsToProcess].
+  Set<String> overridePathsToProcess;
+
+  bool Function(String) overrideShouldBeMigrated;
+
   void set logger(_TestLogger logger);
 
   _MockProcessManager get processManager;
@@ -144,29 +175,38 @@
   @override
   /*late*/ _TestLogger logger;
 
-  Map<String, String> environmentVariables = {};
-
   final hasVerboseHelpMessage = contains('for verbose help output');
 
   final hasUsageText = contains('Usage: nnbd_migration');
 
-  Future<String> assertDecodeArgsFailure(List<String> args) async {
+  String assertDecodeArgsFailure(List<String> args) {
     var cli = _createCli();
-    await cli.run(MigrationCli.createParser().parse(args));
-    var stderrText = assertErrorExit(cli);
-    expect(stderrText, isNot(contains('Exception')));
+    try {
+      cli.decodeCommandLineArgs(MigrationCli.createParser().parse(args));
+      fail('Migration succeeded; expected it to abort with an error');
+    } on MigrationExit catch (migrationExit) {
+      expect(migrationExit.exitCode, isNotNull);
+      expect(migrationExit.exitCode, isNot(0));
+    }
+    var stderrText = logger.stderrBuffer.toString();
+    expect(stderrText, hasUsageText);
+    expect(stderrText, hasVerboseHelpMessage);
     return stderrText;
   }
 
-  String assertErrorExit(MigrationCli cli, {bool withUsage = true}) {
-    expect(cli.isPreviewServerRunning, isFalse);
-    expect(cli.exitCode, isNotNull);
-    expect(cli.exitCode, isNot(0));
-    var stderrText = logger.stderrBuffer.toString();
-    expect(stderrText, withUsage ? hasUsageText : isNot(hasUsageText));
-    expect(stderrText,
-        withUsage ? hasVerboseHelpMessage : isNot(hasVerboseHelpMessage));
-    return stderrText;
+  Future<String> assertErrorExit(
+      MigrationCliRunner cliRunner, FutureOr<void> Function() callback,
+      {@required bool withUsage, dynamic expectedExitCode = anything}) async {
+    try {
+      await callback();
+      fail('Migration succeeded; expected it to abort with an error');
+    } on MigrationExit catch (migrationExit) {
+      expect(migrationExit.exitCode, isNotNull);
+      expect(migrationExit.exitCode, isNot(0));
+      expect(migrationExit.exitCode, expectedExitCode);
+    }
+    expect(cliRunner.isPreviewServerRunning, isFalse);
+    return assertStderr(withUsage: withUsage);
   }
 
   void assertHttpSuccess(http.Response response) {
@@ -184,9 +224,8 @@
     expect(response.statusCode, 200);
   }
 
-  void assertNormalExit(MigrationCli cli) {
-    expect(cli.isPreviewServerRunning, isFalse);
-    expect(cli.exitCode, 0);
+  void assertNormalExit(MigrationCliRunner cliRunner) {
+    expect(cliRunner.isPreviewServerRunning, isFalse);
   }
 
   Future<String> assertParseArgsFailure(List<String> args) async {
@@ -200,10 +239,11 @@
   }
 
   CommandLineOptions assertParseArgsSuccess(List<String> args) {
-    var cli = _createCli();
-    cli.decodeCommandLineArgs(MigrationCli.createParser().parse(args));
-    expect(cli.exitCode, isNull);
-    var options = cli.options;
+    var cliRunner = _createCli()
+        .decodeCommandLineArgs(MigrationCli.createParser().parse(args));
+    assertNormalExit(cliRunner);
+    var options = cliRunner.options;
+    expect(options, isNotNull);
     return options;
   }
 
@@ -253,6 +293,33 @@
     expect(success, isTrue);
   }
 
+  Future<String> assertRunFailure(List<String> args,
+      {MigrationCli cli,
+      bool withUsage = false,
+      dynamic expectedExitCode = anything}) async {
+    cli ??= _createCli();
+    MigrationCliRunner cliRunner;
+    try {
+      cliRunner =
+          cli.decodeCommandLineArgs(MigrationCli.createParser().parse(args));
+    } on MigrationExit catch (e) {
+      expect(e.exitCode, isNotNull);
+      expect(e.exitCode, isNot(0));
+      expect(e.exitCode, expectedExitCode);
+      return assertStderr(withUsage: withUsage);
+    }
+    return await assertErrorExit(cliRunner, () => cliRunner.run(),
+        withUsage: withUsage, expectedExitCode: expectedExitCode);
+  }
+
+  String assertStderr({@required bool withUsage}) {
+    var stderrText = logger.stderrBuffer.toString();
+    expect(stderrText, withUsage ? hasUsageText : isNot(hasUsageText));
+    expect(stderrText,
+        withUsage ? hasVerboseHelpMessage : isNot(hasVerboseHelpMessage));
+    return stderrText;
+  }
+
   String createProjectDir(Map<String, String> contents,
       {String posixPath = '/test_project'}) {
     for (var entry in contents.entries) {
@@ -274,14 +341,18 @@
   Future<void> runWithPreviewServer(_MigrationCli cli, List<String> args,
       Future<void> Function(String) callback) async {
     String url;
-    await cli.runWithPreviewServer(_parseArgs(args), () async {
-      // Server should be running now
-      url = RegExp('http://.*', multiLine: true)
-          .stringMatch(logger.stdoutBuffer.toString());
-      await callback(url);
-    });
-    // Server should be stopped now
-    expect(http.get(url), throwsA(anything));
+    var cliRunner = cli.decodeCommandLineArgs(_parseArgs(args));
+    if (cliRunner != null) {
+      await cliRunner.runWithPreviewServer(() async {
+        // Server should be running now
+        url = RegExp('http://.*', multiLine: true)
+            .stringMatch(logger.stdoutBuffer.toString());
+        await callback(url);
+      });
+      // Server should be stopped now
+      expect(http.get(url), throwsA(anything));
+      assertNormalExit(cliRunner);
+    }
   }
 
   void setUp() {
@@ -346,15 +417,14 @@
     expect(newCoreLibText, isNot(oldCoreLibText));
     coreLib.writeAsStringSync(newCoreLibText);
     var projectDir = await createProjectDir(simpleProject());
-    await cli.run(MigrationCli.createParser().parse([projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    await assertRunFailure([projectDir], cli: cli);
     var output = logger.stdoutBuffer.toString();
     expect(output, contains(messages.sdkNnbdOff));
   }
 
   test_detect_old_sdk_environment_variable() async {
     environmentVariables['SDK_PATH'] = '/fake-old-sdk-path';
-    var cli = _createCli();
+    var cli = _createCli(); // Creates the mock SDK as a side effect
     // Alter the mock SDK, changing the signature of Object.operator== to match
     // the signature that was present prior to NNBD.  (This is what the
     // migration tool uses to detect an old SDK).
@@ -367,8 +437,7 @@
     expect(newCoreLibText, isNot(oldCoreLibText));
     coreLib.writeAsStringSync(newCoreLibText);
     var projectDir = await createProjectDir(simpleProject());
-    await cli.run(MigrationCli.createParser().parse([projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    await assertRunFailure([projectDir], cli: cli);
     var output = logger.stdoutBuffer.toString();
     expect(output, contains(messages.sdkNnbdOff));
     expect(output, contains(messages.sdkPathEnvironmentVariableSet));
@@ -391,19 +460,19 @@
         isTrue);
   }
 
-  test_flag_apply_changes_incompatible_with_web_preview() async {
-    expect(await assertDecodeArgsFailure(['--web-preview', '--apply-changes']),
+  test_flag_apply_changes_incompatible_with_web_preview() {
+    expect(assertDecodeArgsFailure(['--web-preview', '--apply-changes']),
         contains('--apply-changes requires --no-web-preview'));
   }
 
-  test_flag_help() async {
-    var helpText = await _getHelpText(verbose: false);
+  test_flag_help() {
+    var helpText = _getHelpText(verbose: false);
     expect(helpText, hasUsageText);
     expect(helpText, hasVerboseHelpMessage);
   }
 
-  test_flag_help_verbose() async {
-    var helpText = await _getHelpText(verbose: true);
+  test_flag_help_verbose() {
+    var helpText = _getHelpText(verbose: true);
     expect(helpText, hasUsageText);
     expect(helpText, isNot(hasVerboseHelpMessage));
   }
@@ -433,10 +502,10 @@
         isTrue);
   }
 
-  test_flag_ignore_exceptions_hidden() async {
+  test_flag_ignore_exceptions_hidden() {
     var flagName = '--ignore-exceptions';
-    expect(await _getHelpText(verbose: false), isNot(contains(flagName)));
-    expect(await _getHelpText(verbose: true), contains(flagName));
+    expect(_getHelpText(verbose: false), isNot(contains(flagName)));
+    expect(_getHelpText(verbose: true), contains(flagName));
   }
 
   test_flag_skip_pub_outdated_default() {
@@ -468,10 +537,10 @@
   test_lifecycle_apply_changes() async {
     var projectContents = simpleProject();
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
-    assertNormalExit(cli);
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
+    assertNormalExit(cliRunner);
     // Check that a summary was printed
     expect(logger.stdoutBuffer.toString(), contains('Applying changes'));
     // And that it refers to test.dart and pubspec.yaml
@@ -499,11 +568,12 @@
 ''';
 
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli.run(_parseArgs(['--no-web-preview', projectDir]));
-    assertNormalExit(cli);
-    expect(cli.hasMultipleAnalysisContext, true);
-    expect(cli.analysisContext, isNotNull);
+    var cliRunner = _createCli()
+        .decodeCommandLineArgs(_parseArgs(['--no-web-preview', projectDir]));
+    await cliRunner.run();
+    assertNormalExit(cliRunner);
+    expect(cliRunner.hasMultipleAnalysisContext, true);
+    expect(cliRunner.analysisContext, isNotNull);
     var output = logger.stdoutBuffer.toString();
     expect(output, contains('more than one project found'));
   }
@@ -511,19 +581,19 @@
   test_lifecycle_contextdiscovery_handles_single() async {
     var projectContents = simpleProject();
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli.run(_parseArgs(['--no-web-preview', projectDir]));
-    assertNormalExit(cli);
-    expect(cli.hasMultipleAnalysisContext, false);
-    expect(cli.analysisContext, isNotNull);
+    var cliRunner = _createCli()
+        .decodeCommandLineArgs(_parseArgs(['--no-web-preview', projectDir]));
+    await cliRunner.run();
+    assertNormalExit(cliRunner);
+    expect(cliRunner.hasMultipleAnalysisContext, false);
+    expect(cliRunner.analysisContext, isNotNull);
   }
 
   test_lifecycle_exception_handling() async {
     var projectContents = simpleProject(sourceText: 'main() { print(0); }');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli(injectArtificialException: true);
-    await cli.run(_parseArgs([projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    injectArtificialException = true;
+    await assertRunFailure([projectDir]);
     var errorOutput = logger.stderrBuffer.toString();
     expect(errorOutput, contains('Artificial exception triggered'));
     expect(
@@ -534,7 +604,8 @@
   test_lifecycle_exception_handling_ignore() async {
     var projectContents = simpleProject(sourceText: 'main() { print(0); }');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli(injectArtificialException: true);
+    injectArtificialException = true;
+    var cli = _createCli();
     await runWithPreviewServer(cli, ['--ignore-exceptions', projectDir],
         (url) async {
       var output = logger.stdoutBuffer.toString();
@@ -547,7 +618,6 @@
       expect(output, contains('re-run without --ignore-exceptions'));
       await assertPreviewServerResponsive(url);
     });
-    assertNormalExit(cli);
     expect(logger.stderrBuffer.toString(), isEmpty);
   }
 
@@ -555,9 +625,8 @@
     var projectContents =
         simpleProject(sourceText: 'main() { print(0); print(1); }');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli(injectArtificialException: true);
-    await cli.run(_parseArgs([projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    injectArtificialException = true;
+    await assertRunFailure([projectDir]);
     var errorOutput = logger.stderrBuffer.toString();
     expect(
         'Artificial exception triggered'.allMatches(errorOutput), hasLength(1));
@@ -570,9 +639,8 @@
     var projectContents =
         simpleProject(sourceText: 'main() { print(0); unresolved; }');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli(injectArtificialException: true);
-    await cli.run(_parseArgs(['--ignore-errors', projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    injectArtificialException = true;
+    await assertRunFailure(['--ignore-errors', projectDir]);
     var errorOutput = logger.stderrBuffer.toString();
     expect(errorOutput, contains('Artificial exception triggered'));
     expect(errorOutput, contains('try to fix errors in the source code'));
@@ -584,9 +652,7 @@
 int f() => null
 ''');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli.run(_parseArgs([projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    await assertRunFailure([projectDir]);
     var output = logger.stdoutBuffer.toString();
     expect(output, contains('1 analysis issue found'));
     var sep = resourceProvider.pathContext.separator;
@@ -617,15 +683,15 @@
               '--ignore-errors.'));
       await assertPreviewServerResponsive(url);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_no_preview() async {
     var projectContents = simpleProject();
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli.run(_parseArgs(['--no-web-preview', projectDir]));
-    assertNormalExit(cli);
+    var cliRunner = _createCli()
+        .decodeCommandLineArgs(_parseArgs(['--no-web-preview', projectDir]));
+    await cliRunner.run();
+    assertNormalExit(cliRunner);
     // Check that a summary was printed
     var output = logger.stdoutBuffer.toString();
     expect(output, contains('Summary'));
@@ -640,6 +706,52 @@
     assertProjectContents(projectDir, projectContents);
   }
 
+  test_lifecycle_override_paths() async {
+    Map<String, String> makeProject({bool migrated = false}) {
+      var projectContents = simpleProject(migrated: migrated);
+      projectContents['lib/test.dart'] = '''
+import 'skip.dart';
+import 'analyze_but_do_not_migrate.dart';
+void f(int x) {}
+void g(int${migrated ? '?' : ''} x) {}
+void h(int${migrated ? '?' : ''} x) {}
+void call_h() => h(null);
+''';
+      projectContents['lib/skip.dart'] = '''
+import 'test.dart';
+void call_f() => f(null);
+''';
+      projectContents['lib/analyze_but_do_not_migrate.dart'] = '''
+import 'test.dart';
+void call_g() => g(null);
+''';
+      return projectContents;
+    }
+
+    var projectContents = makeProject();
+    var projectDir = await createProjectDir(projectContents);
+    var testPath =
+        resourceProvider.pathContext.join(projectDir, 'lib', 'test.dart');
+    var analyzeButDoNotMigratePath = resourceProvider.pathContext
+        .join(projectDir, 'lib', 'analyze_but_do_not_migrate.dart');
+    overridePathsToProcess = {testPath, analyzeButDoNotMigratePath};
+    overrideShouldBeMigrated = (path) => path == testPath;
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
+    assertNormalExit(cliRunner);
+    // Check that a summary was printed
+    expect(logger.stdoutBuffer.toString(), contains('Applying changes'));
+    // And that it refers to test.dart and pubspec.yaml
+    expect(logger.stdoutBuffer.toString(), contains('test.dart'));
+    expect(logger.stdoutBuffer.toString(), contains('pubspec.yaml'));
+    // And that it does not tell the user they can rerun with `--apply-changes`
+    expect(logger.stdoutBuffer.toString(), isNot(contains('--apply-changes')));
+    // Changes should have been made only to test.dart, and only accounting for
+    // the calls coming from analyze_but_do_not_migrate.dart and test.dart
+    assertProjectContents(projectDir, makeProject(migrated: true));
+  }
+
   test_lifecycle_preview() async {
     var projectContents = simpleProject();
     var projectDir = await createProjectDir(projectContents);
@@ -649,7 +761,6 @@
           logger.stdoutBuffer.toString(), contains('No analysis issues found'));
       await assertPreviewServerResponsive(url);
     });
-    assertNormalExit(cli);
     // No changes should have been made.
     assertProjectContents(projectDir, projectContents);
   }
@@ -681,7 +792,6 @@
       assertProjectContents(
           projectDir, simpleProject(sourceText: 'int/*!*/ x;'));
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_extra_forward_slash() async {
@@ -692,7 +802,6 @@
       await assertPreviewServerResponsive(
           uri.replace(path: uri.path + '/').toString());
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_navigation_links() async {
@@ -728,7 +837,6 @@
         assertHttpSuccess(contentsResponse);
       }
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_navigation_tree() async {
@@ -762,7 +870,6 @@
         }
       }
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_region_link() async {
@@ -804,7 +911,6 @@
           .getChildAssumingFile(displayPath);
       expect(file.exists, isTrue);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_region_table_path() async {
@@ -837,7 +943,6 @@
           headers: {'Content-Type': 'application/json; charset=UTF-8'});
       assertHttpSuccess(contentsResponse);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_rerun() async {
@@ -861,7 +966,6 @@
       // Now that we've rerun, the server should yield the new source text
       expect(await getSourceFromServer(uri, testPath), newSourceText);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_rerun_added_file() async {
@@ -885,7 +989,6 @@
       // Now that we've rerun, the server should yield the new source text
       expect(await getSourceFromServer(uri, test2Path), newSourceText);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_rerun_deleted_file() async {
@@ -922,7 +1025,6 @@
       expect(summaryData['changes']['byPath'],
           isNot(contains('lib${separator}test.dart')));
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_serves_only_from_project_dir() async {
@@ -956,7 +1058,6 @@
       // And check that we didn't leak any info through the 404 response.
       expect(response.body, isNot(contains(crazyFunctionName)));
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_stack_hint_action() async {
@@ -992,7 +1093,6 @@
       assertProjectContents(
           projectDir, simpleProject(sourceText: 'int/*?*/ x;'));
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_preview_stacktrace_link() async {
@@ -1028,7 +1128,6 @@
           headers: {'Content-Type': 'application/json; charset=UTF-8'});
       assertHttpSuccess(contentsResponse);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_skip_pub_outdated_disable() async {
@@ -1047,11 +1146,8 @@
 }
 ''' /* stdout */,
         '' /* stderr */);
-    var cli = _createCli();
-    await cli.run(_parseArgs([projectDir]));
-    var output = assertErrorExit(cli, withUsage: false);
+    var output = await assertRunFailure([projectDir], expectedExitCode: 1);
     expect(output, contains('Warning: dependencies are outdated.'));
-    expect(cli.exitCode, 1);
   }
 
   test_lifecycle_skip_pub_outdated_enable() async {
@@ -1075,31 +1171,30 @@
         (url) async {
       await assertPreviewServerResponsive(url);
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_summary() async {
     var projectContents = simpleProject();
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
     var summaryPath = resourceProvider.convertPath('/summary.json');
-    await cli.run(
+    var cliRunner = _createCli().decodeCommandLineArgs(
         _parseArgs(['--no-web-preview', '--summary', summaryPath, projectDir]));
+    await cliRunner.run();
     var summaryData =
         jsonDecode(resourceProvider.getFile(summaryPath).readAsStringSync());
     expect(summaryData, TypeMatcher<Map>());
     expect(summaryData, contains('changes'));
-    assertNormalExit(cli);
+    assertNormalExit(cliRunner);
   }
 
   test_lifecycle_summary_does_not_double_count_hint_removals() async {
     var projectContents = simpleProject(sourceText: 'int/*?*/ x;');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
     var summaryPath = resourceProvider.convertPath('/summary.json');
-    await cli.run(
+    var cliRunner = _createCli().decodeCommandLineArgs(
         _parseArgs(['--no-web-preview', '--summary', summaryPath, projectDir]));
-    assertNormalExit(cli);
+    await cliRunner.run();
+    assertNormalExit(cliRunner);
     var summaryData =
         jsonDecode(resourceProvider.getFile(summaryPath).readAsStringSync());
     var separator = resourceProvider.pathContext.separator;
@@ -1137,7 +1232,6 @@
         'checkExpression': 1
       });
     });
-    assertNormalExit(cli);
   }
 
   test_lifecycle_uri_error() async {
@@ -1146,9 +1240,7 @@
 int f() => null;
 ''');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli.run(_parseArgs([projectDir]));
-    assertErrorExit(cli, withUsage: false);
+    await assertRunFailure([projectDir]);
     var output = logger.stdoutBuffer.toString();
     expect(output, contains('1 analysis issue found'));
     expect(output, contains('uri_does_not_exist'));
@@ -1170,14 +1262,13 @@
         isTrue);
   }
 
-  test_migrate_path_file() async {
+  test_migrate_path_file() {
     resourceProvider.newFile(resourceProvider.pathContext.absolute('foo'), '');
-    expect(await assertDecodeArgsFailure(['foo']), contains('foo is a file'));
+    expect(assertDecodeArgsFailure(['foo']), contains('foo is a file'));
   }
 
-  test_migrate_path_non_existent() async {
-    expect(
-        await assertDecodeArgsFailure(['foo']), contains('foo does not exist'));
+  test_migrate_path_non_existent() {
+    expect(assertDecodeArgsFailure(['foo']), contains('foo does not exist'));
   }
 
   test_migrate_path_none() {
@@ -1199,9 +1290,7 @@
   }
 
   test_migrate_path_two() async {
-    var cli = _createCli();
-    await cli.run(_parseArgs(['foo', 'bar']));
-    var stderrText = assertErrorExit(cli);
+    var stderrText = await assertRunFailure(['foo', 'bar'], withUsage: true);
     expect(stderrText, contains('No more than one path may be specified'));
   }
 
@@ -1214,8 +1303,8 @@
     expect(assertParseArgsSuccess([]).previewPort, isNull);
   }
 
-  test_option_preview_port_format_error() async {
-    expect(await assertDecodeArgsFailure(['--preview-port', 'abc']),
+  test_option_preview_port_format_error() {
+    expect(assertDecodeArgsFailure(['--preview-port', 'abc']),
         contains('Invalid value for --preview-port'));
   }
 
@@ -1226,15 +1315,15 @@
 
   test_option_sdk_default() {
     var cli = MigrationCli(binaryName: 'nnbd_migration');
-    cli.decodeCommandLineArgs(_parseArgs([]));
-    expect(
-        Directory(path.join(cli.options.sdkPath, 'bin')).existsSync(), isTrue);
+    var cliRunner = cli.decodeCommandLineArgs(_parseArgs([]));
+    expect(Directory(path.join(cliRunner.options.sdkPath, 'bin')).existsSync(),
+        isTrue);
   }
 
-  test_option_sdk_hidden() async {
+  test_option_sdk_hidden() {
     var optionName = '--sdk-path';
-    expect(await _getHelpText(verbose: false), isNot(contains(optionName)));
-    expect(await _getHelpText(verbose: true), contains(optionName));
+    expect(_getHelpText(verbose: false), isNot(contains(optionName)));
+    expect(_getHelpText(verbose: true), contains(optionName));
   }
 
   test_option_summary() {
@@ -1254,9 +1343,9 @@
     var projectContents = simpleProject()
       ..remove('.dart_tool/package_config.json');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(
         projectDir,
@@ -1279,9 +1368,9 @@
 ''';
     var projectContents = simpleProject(packageConfigText: packageConfigText);
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(projectDir,
         simpleProject(migrated: true, packageConfigText: packageConfigText));
@@ -1297,9 +1386,9 @@
 ''';
     var projectContents = simpleProject(packageConfigText: packageConfigText);
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(projectDir,
         simpleProject(migrated: true, packageConfigText: packageConfigText));
@@ -1321,9 +1410,9 @@
 ''';
     var projectContents = simpleProject(packageConfigText: packageConfigText);
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(projectDir,
         simpleProject(migrated: true, packageConfigText: packageConfigText));
@@ -1462,9 +1551,9 @@
       ..remove('pubspec.yaml')
       ..remove('.dart_tool/package_config.json');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(
         projectDir,
@@ -1480,9 +1569,9 @@
   foo: 1
 ''');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(
         projectDir, simpleProject(migrated: true, pubspecText: '''
@@ -1500,9 +1589,9 @@
 ''';
     var projectContents = simpleProject(pubspecText: pubspecText);
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(
         projectDir, simpleProject(migrated: true, pubspecText: pubspecText));
@@ -1517,9 +1606,9 @@
     var projectContents = simpleProject(pubspecText: pubspecText)
       ..remove('.dart_tool/package_config.json');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(
         projectDir,
@@ -1532,9 +1621,9 @@
 name: test
 ''');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    await cli
-        .run(_parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    await cliRunner.run();
     // The Dart source code should still be migrated.
     assertProjectContents(projectDir, simpleProject(migrated: true, pubspecText:
         // This is strange-looking, but valid.
@@ -1549,11 +1638,9 @@
   test_pubspec_is_not_a_map() async {
     var projectContents = simpleProject(pubspecText: 'not-a-map');
     var projectDir = await createProjectDir(projectContents);
-    var cli = _createCli();
-    expect(
-        () async => await cli.run(
-            _parseArgs(['--no-web-preview', '--apply-changes', projectDir])),
-        throwsUnsupportedError);
+    var cliRunner = _createCli().decodeCommandLineArgs(
+        _parseArgs(['--no-web-preview', '--apply-changes', projectDir]));
+    expect(() async => await cliRunner.run(), throwsUnsupportedError);
   }
 
   test_uses_physical_resource_provider_by_default() {
@@ -1570,18 +1657,15 @@
         headers: {'Content-Type': 'application/json; charset=UTF-8'});
   }
 
-  _MigrationCli _createCli({bool injectArtificialException = false}) {
+  _MigrationCli _createCli() {
     mock_sdk.MockSdk(resourceProvider: resourceProvider);
-    return _MigrationCli(this,
-        injectArtificialException: injectArtificialException,
-        environmentVariables: environmentVariables);
+    return _MigrationCli(this);
   }
 
-  Future<String> _getHelpText({@required bool verbose}) async {
-    var cli = _createCli();
-    await cli.run(_parseArgs(
+  String _getHelpText({@required bool verbose}) {
+    var cliRunner = _createCli().decodeCommandLineArgs(_parseArgs(
         ['--${CommandLineOptions.helpFlag}', if (verbose) '--verbose']));
-    expect(cli.exitCode, 0);
+    expect(cliRunner, isNull);
     var helpText = logger.stderrBuffer.toString();
     return helpText;
   }
diff --git a/pkg/nnbd_migration/tool/src/package.dart b/pkg/nnbd_migration/tool/src/package.dart
index 152b61f..6b67e50 100644
--- a/pkg/nnbd_migration/tool/src/package.dart
+++ b/pkg/nnbd_migration/tool/src/package.dart
@@ -217,15 +217,4 @@
   Sdk(String sdkPath) {
     this.sdkPath = path.canonicalize(sdkPath);
   }
-
-  /// Returns true if the SDK was built with --nnbd.
-  ///
-  /// May throw if [sdkPath] is invalid, or there is an error parsing
-  /// the libraries.json file.
-  bool get isNnbdSdk {
-    // TODO(jcollins-g): contact eng-prod for a more foolproof detection method
-    String libraries = path.join(sdkPath, 'lib', 'libraries.json');
-    var decodedJson = JsonDecoder().convert(File(libraries).readAsStringSync());
-    return ((decodedJson['comment:1'] as String).contains('sdk_nnbd'));
-  }
 }
diff --git a/pkg/nnbd_migration/tool/trial_migration.dart b/pkg/nnbd_migration/tool/trial_migration.dart
index 3203d1d..e7bc2b6 100644
--- a/pkg/nnbd_migration/tool/trial_migration.dart
+++ b/pkg/nnbd_migration/tool/trial_migration.dart
@@ -27,7 +27,6 @@
   Sdk sdk = Sdk(parsedArgs['sdk'] as String);
 
   warnOnNoAssertions();
-  warnOnNoSdkNnbd(sdk);
 
   Playground playground =
       Playground(defaultPlaygroundPath, parsedArgs['clean'] as bool);
@@ -218,17 +217,6 @@
   printWarning("You didn't --enable-asserts!");
 }
 
-void warnOnNoSdkNnbd(Sdk sdk) {
-  try {
-    if (sdk.isNnbdSdk) return;
-  } catch (e) {
-    printWarning('Unable to determine whether this SDK supports NNBD');
-    return;
-  }
-  printWarning(
-      'SDK at ${sdk.sdkPath} not compiled with --nnbd, use --sdk option');
-}
-
 class ExceptionCategory {
   final String topOfStack;
   final List<MapEntry<String, int>> exceptionCountPerPackage;
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 627b42b..344a1c1 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -47,9 +47,14 @@
 compiler/test/modular/*: Slow, Pass
 compiler/test/nalyses/analyze_test: Slow, Pass
 compiler/test/packages/*: SkipByDesign
-compiler/test/rti/rti_emission_test: Slow, Pass
+compiler/test/rti/rti_emission0_test: Slow, Pass
+compiler/test/rti/rti_emission1_test: Slow, Pass
+compiler/test/rti/rti_emission2_test: Slow, Pass
+compiler/test/rti/rti_emission3_test: Slow, Pass
 compiler/test/rti/rti_need0_test: Slow, Pass
 compiler/test/rti/rti_need1_test: Slow, Pass
+compiler/test/rti/rti_need2_test: Slow, Pass
+compiler/test/rti/rti_need3_test: Slow, Pass
 compiler/test/serialization/serialization_test: Slow, Pass
 compiler/test/sourcemaps/source_mapping_invokes_test: Slow, Pass
 compiler/test/sourcemaps/source_mapping_operators_test: Slow, Pass
diff --git a/pkg/test_runner/lib/src/compiler_configuration.dart b/pkg/test_runner/lib/src/compiler_configuration.dart
index 97be6bd..03ff446 100644
--- a/pkg/test_runner/lib/src/compiler_configuration.dart
+++ b/pkg/test_runner/lib/src/compiler_configuration.dart
@@ -367,9 +367,7 @@
       : super._subclass(configuration);
 
   String computeCompilerPath() {
-    var prefix =
-        // TODO(38701): Cleanup after merging the forked SDK into mainline.
-        _configuration.nnbdMode == NnbdMode.legacy ? 'sdk/bin' : 'sdk_nnbd/bin';
+    var prefix = 'sdk/bin';
     var suffix = shellScriptExtension;
 
     if (_isHostChecked) {
@@ -461,9 +459,7 @@
       CommandArtifact artifact) {
     var sdk = _useSdk
         ? Uri.directory(_configuration.buildDirectory).resolve('dart-sdk/')
-        : Uri.directory(Repository.dir.toNativePath()).resolve(
-            // TODO(38701): Cleanup after merging the forked SDK into mainline.
-            _configuration.nnbdMode == NnbdMode.legacy ? 'sdk/' : 'sdk_nnbd/');
+        : Uri.directory(Repository.dir.toNativePath()).resolve('sdk/');
     var preambleDir = sdk.resolve('lib/_internal/js_runtime/lib/preambles/');
     return runtimeConfiguration.dart2jsPreambles(preambleDir)
       ..add(artifact.filename);
@@ -494,10 +490,7 @@
   bool get useKernel => _configuration.compiler == Compiler.dartdevk;
 
   String computeCompilerPath() {
-    var dir = _useSdk
-        ? "${_configuration.buildDirectory}/dart-sdk"
-        // TODO(38701): Cleanup after merging the forked SDK into mainline.
-        : _configuration.nnbdMode == NnbdMode.legacy ? "sdk" : "sdk_nnbd";
+    var dir = _useSdk ? "${_configuration.buildDirectory}/dart-sdk" : "sdk";
     return "$dir/bin/dartdevc$shellScriptExtension";
   }
 
@@ -508,8 +501,7 @@
       ..._configuration.sharedOptions,
       ..._experimentsArgument(_configuration, testFile),
       ...testFile.ddcOptions,
-      if (_configuration.nnbdMode == NnbdMode.strong)
-        '--sound-null-safety',
+      if (_configuration.nnbdMode == NnbdMode.strong) '--sound-null-safety',
       // The file being compiled is the last argument.
       args.last
     ];
@@ -712,14 +704,11 @@
         "--snapshot-kind=app-aot-assembly",
         "--assembly=$tempDir/out.S"
       ],
-      if (_isAndroid && _isArm)
-        '--no-sim-use-hardfp',
-      if (_configuration.isMinified)
-        '--obfuscate',
+      if (_isAndroid && _isArm) '--no-sim-use-hardfp',
+      if (_configuration.isMinified) '--obfuscate',
       // The SIMARM precompiler assumes support for integer division, but the
       // Qemu arm cpus do not support integer division.
-      if (_configuration.useQemu)
-        '--no-use-integer-division',
+      if (_configuration.useQemu) '--no-use-integer-division',
       ..._replaceDartFiles(arguments, tempKernelFile(tempDir)),
     ];
 
@@ -936,9 +925,7 @@
   int get timeoutMultiplier => 4;
 
   String computeCompilerPath() {
-    var prefix =
-        // TODO(38701): Cleanup after merging the forked SDK into mainline.
-        _configuration.nnbdMode == NnbdMode.legacy ? 'sdk/bin' : 'sdk_nnbd/bin';
+    var prefix = 'sdk/bin';
     if (_isHostChecked) {
       if (_useSdk) {
         throw "--host-checked and --use-sdk cannot be used together";
diff --git a/pkg/test_runner/lib/src/configuration.dart b/pkg/test_runner/lib/src/configuration.dart
index 26a9f91..dfc966e 100644
--- a/pkg/test_runner/lib/src/configuration.dart
+++ b/pkg/test_runner/lib/src/configuration.dart
@@ -69,8 +69,7 @@
       this.reproducingArguments,
       this.fastTestsOnly,
       this.printPassingStdout})
-      : _packages = packages,
-        isPreNNBD = configuration.name.split('-').contains('prennbd');
+      : _packages = packages;
 
   final Map<String, RegExp> selectors;
   final Progress progress;
@@ -99,7 +98,6 @@
   final bool writeResults;
   final bool writeLogs;
   final bool printPassingStdout;
-  final bool isPreNNBD;
 
   Architecture get architecture => configuration.architecture;
   Compiler get compiler => configuration.compiler;
@@ -470,13 +468,6 @@
     var normal = '$result$arch';
     var cross = '${result}X$arch';
 
-    // TODO(sigmund): remove once all prennbd coverage is dropped. Currently
-    // only dart2js supports opting-out of using the nnbd sdk.
-    if (isPreNNBD) {
-      normal += 'Legacy';
-      cross += 'Legacy';
-    }
-
     var outDir = system.outputDirectory;
     var normalDir = Directory(Path('$outDir$normal').toNativePath());
     var crossDir = Directory(Path('$outDir$cross').toNativePath());
diff --git a/pkg/vm/lib/bytecode/generics.dart b/pkg/vm/lib/bytecode/generics.dart
index e316f86..6399d99 100644
--- a/pkg/vm/lib/bytecode/generics.dart
+++ b/pkg/vm/lib/bytecode/generics.dart
@@ -172,6 +172,9 @@
       node.typeArguments.any((t) => t.accept(this));
 
   @override
+  bool visitFutureOrType(FutureOrType node) => node.typeArgument.accept(this);
+
+  @override
   bool visitTypedefType(TypedefType node) =>
       node.typeArguments.any((t) => t.accept(this));
 
diff --git a/pkg/vm/lib/bytecode/object_table.dart b/pkg/vm/lib/bytecode/object_table.dart
index b307ef2..338bb5f 100644
--- a/pkg/vm/lib/bytecode/object_table.dart
+++ b/pkg/vm/lib/bytecode/object_table.dart
@@ -2195,6 +2195,19 @@
   }
 
   @override
+  ObjectHandle visitFutureOrType(FutureOrType node) {
+    final classNode = coreTypes.deprecatedFutureOrClass;
+    final classHandle = objectTable.getHandle(classNode);
+    List<DartType> instantiatorArgs =
+        getInstantiatorTypeArguments(classNode, [node.typeArgument]);
+    ObjectHandle typeArgsHandle =
+        objectTable.getTypeArgumentsHandle(instantiatorArgs);
+    final result = objectTable.getOrAddObject(
+        new _GenericTypeHandle(classHandle, typeArgsHandle, node.nullability));
+    return result;
+  }
+
+  @override
   ObjectHandle visitTypeParameterType(TypeParameterType node) {
     final param = node.parameter;
     final handle = _typeParameters[param];
diff --git a/pkg/vm/lib/bytecode/recursive_types_validator.dart b/pkg/vm/lib/bytecode/recursive_types_validator.dart
index d88d291..66512be 100644
--- a/pkg/vm/lib/bytecode/recursive_types_validator.dart
+++ b/pkg/vm/lib/bytecode/recursive_types_validator.dart
@@ -131,6 +131,11 @@
   }
 
   @override
+  void visitFutureOrType(FutureOrType node) {
+    visit(node.typeArgument);
+  }
+
+  @override
   void visitTypedefType(TypedefType node) => visit(node.unalias);
 
   @override
diff --git a/pkg/vm/lib/metadata/call_site_attributes.dart b/pkg/vm/lib/metadata/call_site_attributes.dart
index 2a9fc03..10acd75 100644
--- a/pkg/vm/lib/metadata/call_site_attributes.dart
+++ b/pkg/vm/lib/metadata/call_site_attributes.dart
@@ -5,6 +5,7 @@
 library vm.metadata.call_site_attributes;
 
 import 'package:kernel/ast.dart';
+import 'package:kernel/src/printer.dart';
 
 /// Metadata for annotating call sites with various attributes.
 class CallSiteAttributesMetadata {
@@ -13,7 +14,8 @@
   const CallSiteAttributesMetadata({this.receiverType});
 
   @override
-  String toString() => "receiverType:$receiverType";
+  String toString() =>
+      "receiverType:${receiverType.toText(astTextStrategyForTesting)}";
 }
 
 /// Repository for [CallSiteAttributesMetadata].
diff --git a/pkg/vm/lib/metadata/direct_call.dart b/pkg/vm/lib/metadata/direct_call.dart
index fcb9f32..17eb4e8 100644
--- a/pkg/vm/lib/metadata/direct_call.dart
+++ b/pkg/vm/lib/metadata/direct_call.dart
@@ -5,6 +5,7 @@
 library vm.metadata.direct_call;
 
 import 'package:kernel/ast.dart';
+import 'package:kernel/src/printer.dart';
 
 /// Metadata for annotating method invocations converted to direct calls.
 class DirectCallMetadata {
@@ -20,7 +21,8 @@
   Member get target => _targetReference.asMember;
 
   @override
-  String toString() => "${target}${checkReceiverForNull ? '??' : ''}";
+  String toString() => "${target.toText(astTextStrategyForTesting)}"
+      "${checkReceiverForNull ? '??' : ''}";
 }
 
 /// Repository for [DirectCallMetadata].
diff --git a/pkg/vm/lib/metadata/inferred_type.dart b/pkg/vm/lib/metadata/inferred_type.dart
index 1cdc4bd..d6441df 100644
--- a/pkg/vm/lib/metadata/inferred_type.dart
+++ b/pkg/vm/lib/metadata/inferred_type.dart
@@ -5,6 +5,7 @@
 library vm.metadata.inferred_type;
 
 import 'package:kernel/ast.dart';
+import 'package:kernel/src/printer.dart';
 
 /// Metadata for annotating nodes with an inferred type information.
 class InferredType {
@@ -68,7 +69,7 @@
   String toString() {
     final StringBuffer buf = new StringBuffer();
     if (concreteClass != null) {
-      buf.write(concreteClass);
+      buf.write(concreteClass.toText(astTextStrategyForTesting));
     } else if (isInt) {
       buf.write('int');
     } else {
@@ -79,15 +80,18 @@
     }
     if (exactTypeArguments != null) {
       buf.write('<');
-      buf.write(
-          exactTypeArguments.map((t) => t != null ? "$t" : "?").join(", "));
+      buf.write(exactTypeArguments
+          .map(
+              (t) => t != null ? "${t.toText(astTextStrategyForTesting)}" : "?")
+          .join(", "));
       buf.write('>');
     }
     if (skipCheck) {
       buf.write(' (skip check)');
     }
     if (_constantValue != null) {
-      buf.write(' (value: $_constantValue)');
+      buf.write(
+          ' (value: ${_constantValue.toText(astTextStrategyForTesting)})');
     }
     if (receiverNotInt) {
       buf.write(' (receiver not int)');
diff --git a/pkg/vm/lib/transformations/mixin_deduplication.dart b/pkg/vm/lib/transformations/mixin_deduplication.dart
index f9bf6b9..61d0a9d 100644
--- a/pkg/vm/lib/transformations/mixin_deduplication.dart
+++ b/pkg/vm/lib/transformations/mixin_deduplication.dart
@@ -113,7 +113,9 @@
     assert(canonical != null);
 
     if (canonical != c) {
-      c.canonicalName?.unbind();
+      // Ensure that kernel file writer will not be able to
+      // write a dangling reference to the deleted class.
+      c.reference.canonicalName = null;
       _duplicatedMixins[c] = canonical;
       return null; // Remove class.
     }
diff --git a/pkg/vm/lib/transformations/type_flow/analysis.dart b/pkg/vm/lib/transformations/type_flow/analysis.dart
index ebabe3f..974b04c 100644
--- a/pkg/vm/lib/transformations/type_flow/analysis.dart
+++ b/pkg/vm/lib/transformations/type_flow/analysis.dart
@@ -1060,7 +1060,6 @@
 
   ConcreteType addAllocatedClass(Class cl) {
     assertx(!cl.isAbstract);
-    assertx(cl != coreTypes.futureOrClass);
     assertx(!_sealed);
 
     final _TFClassImpl classImpl = getTFClass(cl);
@@ -1097,11 +1096,6 @@
       return true;
     }
 
-    // TODO(alexmarkov): handle FutureOr more precisely.
-    if (sup == coreTypes.futureOrClass) {
-      return true;
-    }
-
     _TFClassImpl subClassData = getTFClass(sub);
     _TFClassImpl superClassData = getTFClass(sup);
 
@@ -1118,10 +1112,7 @@
     // TODO(alexmarkov): consider approximating type if number of allocated
     // subtypes is too large
 
-    // TODO(alexmarkov): handle FutureOr more precisely.
-
-    if (baseClass.classNode == coreTypes.objectClass ||
-        baseClass.classNode == coreTypes.futureOrClass) {
+    if (baseClass.classNode == coreTypes.objectClass) {
       return const AnyType();
     }
 
diff --git a/pkg/vm/lib/transformations/type_flow/calls.dart b/pkg/vm/lib/transformations/type_flow/calls.dart
index c0235ed..8f46fd7 100644
--- a/pkg/vm/lib/transformations/type_flow/calls.dart
+++ b/pkg/vm/lib/transformations/type_flow/calls.dart
@@ -8,7 +8,6 @@
 import 'dart:core' hide Type;
 
 import 'package:kernel/ast.dart';
-import 'package:kernel/src/text_util.dart';
 
 import 'types.dart';
 import 'utils.dart';
@@ -118,7 +117,7 @@
 
   @override
   String toString() => 'direct ${_callKindPrefix}'
-      '[${qualifiedMemberNameToString(member, includeLibraryName: true)}]';
+      '[${nodeToText(member)}]';
 }
 
 /// Interface call via known interface target [member].
@@ -138,7 +137,7 @@
 
   @override
   String toString() => '${_callKindPrefix}'
-      '[${qualifiedMemberNameToString(member, includeLibraryName: true)}]';
+      '[${nodeToText(member)}]';
 }
 
 /// Virtual call (using 'this' as a receiver).
@@ -155,7 +154,7 @@
 
   @override
   String toString() => 'virtual ${_callKindPrefix}'
-      '[${qualifiedMemberNameToString(member, includeLibraryName: true)}]';
+      '[${nodeToText(member)}]';
 }
 
 /// Dynamic call.
@@ -179,7 +178,7 @@
       other is DynamicSelector && super == (other) && other.name == name;
 
   @override
-  String toString() => 'dynamic ${_callKindPrefix}[$name]';
+  String toString() => 'dynamic ${_callKindPrefix}[${nodeToText(name)}]';
 }
 
 /// Arguments passed to a call, including implicit receiver argument.
diff --git a/pkg/vm/lib/transformations/type_flow/summary.dart b/pkg/vm/lib/transformations/type_flow/summary.dart
index 28df481..c1bc768 100644
--- a/pkg/vm/lib/transformations/type_flow/summary.dart
+++ b/pkg/vm/lib/transformations/type_flow/summary.dart
@@ -192,7 +192,7 @@
   void accept(StatementVisitor visitor) => visitor.visitJoin(this);
 
   @override
-  String dump() => "$label = _Join [${staticType.toTypeText(verbose: true)}]"
+  String dump() => "$label = _Join [${nodeToText(staticType)}]"
       " (${values.join(", ")})";
 
   @override
@@ -372,8 +372,8 @@
   void accept(StatementVisitor visitor) => visitor.visitExtract(this);
 
   @override
-  String dump() =>
-      "$label = _Extract ($arg[$referenceClass/$paramIndex]${nullability.suffix})";
+  String dump() => "$label = _Extract ($arg[${nodeToText(referenceClass)}"
+      "/$paramIndex]${nullability.suffix})";
 
   @override
   Type apply(List<Type> computedTypes, TypeHierarchy typeHierarchy,
@@ -480,7 +480,7 @@
   void accept(StatementVisitor visitor) => visitor.visitCreateRuntimeType(this);
 
   @override
-  String dump() => "$label = _CreateRuntimeType ($klass @ "
+  String dump() => "$label = _CreateRuntimeType (${nodeToText(klass)} @ "
       "${flattenedTypeArgs.take(klass.typeParameters.length)}"
       "${nullability.suffix})";
 
@@ -494,7 +494,13 @@
       if (computed is UnknownType) return const UnknownType();
       types[i] = computed;
     }
-    return new RuntimeType(new InterfaceType(klass, nullability), types);
+    DartType dartType;
+    if (klass == typeHierarchy.coreTypes.deprecatedFutureOrClass) {
+      dartType = new FutureOrType(const DynamicType(), nullability);
+    } else {
+      dartType = new InterfaceType(klass, nullability);
+    }
+    return new RuntimeType(dartType, types);
   }
 }
 
@@ -535,7 +541,7 @@
   @override
   String dump() {
     String result = "$label = _TypeCheck ($arg against $type)";
-    result += " (for ${node})";
+    result += " (for ${nodeToText(node)})";
     return result;
   }
 
diff --git a/pkg/vm/lib/transformations/type_flow/summary_collector.dart b/pkg/vm/lib/transformations/type_flow/summary_collector.dart
index bbd77a6..8b6f850 100644
--- a/pkg/vm/lib/transformations/type_flow/summary_collector.dart
+++ b/pkg/vm/lib/transformations/type_flow/summary_collector.dart
@@ -625,7 +625,7 @@
       }
 
       _translator = new RuntimeTypeTranslatorImpl(
-          _summary, _receiver, null, _genericInterfacesInfo);
+          this, _summary, _receiver, null, _genericInterfacesInfo);
 
       if (fieldSummaryType == FieldSummaryType.kInitializer) {
         assertx(member.initializer != null);
@@ -666,7 +666,7 @@
       }
 
       _translator = new RuntimeTypeTranslatorImpl(
-          _summary, _receiver, _fnTypeVariables, _genericInterfacesInfo);
+          this, _summary, _receiver, _fnTypeVariables, _genericInterfacesInfo);
 
       // Handle forwarding stubs. We need to check types against the types of
       // the forwarding stub's target, [member.forwardingStubSuperTarget].
@@ -2218,14 +2218,16 @@
   final Map<DartType, TypeExpr> typesCache = <DartType, TypeExpr>{};
   final TypeExpr receiver;
   final GenericInterfacesInfo genericInterfacesInfo;
+  final SummaryCollector summaryCollector;
 
-  RuntimeTypeTranslatorImpl(this.summary, this.receiver,
+  RuntimeTypeTranslatorImpl(this.summaryCollector, this.summary, this.receiver,
       this.functionTypeVariables, this.genericInterfacesInfo) {}
 
   // Create a type translator which can be used only for types with no free type
   // variables.
   RuntimeTypeTranslatorImpl.forClosedTypes(this.genericInterfacesInfo)
-      : summary = null,
+      : summaryCollector = null,
+        summary = null,
         functionTypeVariables = null,
         receiver = null {}
 
@@ -2333,6 +2335,24 @@
   }
 
   @override
+  visitFutureOrType(FutureOrType type) {
+    final typeArg = translate(type.typeArgument);
+    if (typeArg == const UnknownType()) return const UnknownType();
+    if (typeArg is RuntimeType) {
+      return new RuntimeType(
+          new FutureOrType(const DynamicType(), type.nullability),
+          <RuntimeType>[typeArg]);
+    } else {
+      final instantiate = new CreateRuntimeType(
+          summaryCollector._environment.coreTypes.deprecatedFutureOrClass,
+          type.nullability,
+          <TypeExpr>[typeArg]);
+      summary.add(instantiate);
+      return instantiate;
+    }
+  }
+
+  @override
   visitTypeParameterType(TypeParameterType type) {
     if (functionTypeVariables != null) {
       final result = functionTypeVariables[type.parameter];
diff --git a/pkg/vm/lib/transformations/type_flow/transformer.dart b/pkg/vm/lib/transformations/type_flow/transformer.dart
index 1578f0b..f592d17 100644
--- a/pkg/vm/lib/transformations/type_flow/transformer.dart
+++ b/pkg/vm/lib/transformations/type_flow/transformer.dart
@@ -1464,7 +1464,9 @@
   Class visitClass(Class node) {
     if (!shaker.isClassUsed(node)) {
       debugPrint('Dropped class ${node.name}');
-      node.canonicalName?.unbind();
+      // Ensure that kernel file writer will not be able to
+      // write a dangling reference to the deleted class.
+      node.reference.canonicalName = null;
       Statistics.classesDropped++;
       return null; // Remove the class.
     }
@@ -1532,7 +1534,9 @@
   @override
   Member defaultMember(Member node) {
     if (!shaker.isMemberUsed(node) && !_preserveSpecialMember(node)) {
-      node.canonicalName?.unbind();
+      // Ensure that kernel file writer will not be able to
+      // write a dangling reference to the deleted member.
+      node.reference.canonicalName = null;
       Statistics.membersDropped++;
       return null;
     }
diff --git a/pkg/vm/lib/transformations/type_flow/types.dart b/pkg/vm/lib/transformations/type_flow/types.dart
index a3739d8..4a07a98 100644
--- a/pkg/vm/lib/transformations/type_flow/types.dart
+++ b/pkg/vm/lib/transformations/type_flow/types.dart
@@ -11,8 +11,6 @@
 
 import 'package:kernel/core_types.dart';
 
-import 'package:kernel/src/text_util.dart';
-
 import 'utils.dart';
 
 /// Dart class representation used in type flow analysis.
@@ -34,8 +32,7 @@
   bool operator ==(other) => identical(this, other);
 
   @override
-  String toString() =>
-      qualifiedClassNameToString(classNode, includeLibraryName: true);
+  String toString() => nodeToText(classNode);
 }
 
 abstract class GenericInterfacesInfo {
@@ -88,6 +85,9 @@
     } else if (type is FunctionType) {
       // TODO(alexmarkov): support function types
       result = const AnyType();
+    } else if (type is FutureOrType) {
+      // TODO(alexmarkov): support FutureOr types
+      result = const AnyType();
     } else if (type is TypeParameterType) {
       final bound = type.bound;
       // Protect against infinite recursion in case of cyclic type parameters
@@ -545,7 +545,7 @@
       (other is ConeType) && identical(this.cls, other.cls);
 
   @override
-  String toString() => "_T ($cls)+";
+  String toString() => "_T (${cls})+";
 
   @override
   int get order => TypeOrder.Cone.index;
@@ -666,18 +666,6 @@
       }
 
       if (rhs.typeArguments.isEmpty) return true;
-      if (rhs.classNode == typeHierarchy.coreTypes.futureOrClass) {
-        assertx(cls.classNode != typeHierarchy.coreTypes.futureOrClass);
-        if (typeHierarchy.isSubtype(
-            cls.classNode, typeHierarchy.coreTypes.futureClass)) {
-          final RuntimeType lhs =
-              typeArgs == null ? RuntimeType(DynamicType(), null) : typeArgs[0];
-          return lhs.isSubtypeOfRuntimeType(
-              typeHierarchy, runtimeType.typeArgs[0]);
-        } else {
-          return isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
-        }
-      }
 
       List<Type> usableTypeArgs = typeArgs;
       if (usableTypeArgs == null) {
@@ -708,6 +696,17 @@
       }
       return true;
     }
+    if (rhs is FutureOrType) {
+      if (typeHierarchy.isSubtype(
+          cls.classNode, typeHierarchy.coreTypes.futureClass)) {
+        final RuntimeType lhs =
+            typeArgs == null ? RuntimeType(DynamicType(), null) : typeArgs[0];
+        return lhs.isSubtypeOfRuntimeType(
+            typeHierarchy, runtimeType.typeArgs[0]);
+      } else {
+        return isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
+      }
+    }
     return false;
   }
 
@@ -765,7 +764,7 @@
       buf.write("<${typeArgs.take(numImmediateTypeArgs).join(', ')}>");
     }
     if (constant != null) {
-      buf.write(", $constant");
+      buf.write(", ${nodeToText(constant)}");
     }
     buf.write(")");
     return buf.toString();
@@ -886,14 +885,20 @@
 
   RuntimeType(DartType type, this.typeArgs)
       : _type = type,
-        numImmediateTypeArgs =
-            type is InterfaceType ? type.classNode.typeParameters.length : 0 {
+        numImmediateTypeArgs = type is InterfaceType
+            ? type.classNode.typeParameters.length
+            : (type is FutureOrType ? 1 : 0) {
     if (_type is InterfaceType && numImmediateTypeArgs > 0) {
       assertx(typeArgs != null);
       assertx(typeArgs.length >= numImmediateTypeArgs);
       assertx((_type as InterfaceType)
           .typeArguments
           .every((t) => t == const DynamicType()));
+    } else if (_type is FutureOrType) {
+      assertx(typeArgs != null);
+      assertx(typeArgs.length >= numImmediateTypeArgs);
+      DartType typeArgument = (_type as FutureOrType).typeArgument;
+      assertx(typeArgument == const DynamicType());
     } else {
       assertx(typeArgs == null);
     }
@@ -901,7 +906,7 @@
 
   int get order => TypeOrder.RuntimeType.index;
 
-  Nullability get nullability => _type.nullability;
+  Nullability get nullability => _type.declaredNullability;
 
   RuntimeType withNullability(Nullability n) =>
       RuntimeType(_type.withDeclaredNullability(n), typeArgs);
@@ -917,6 +922,8 @@
           .map((pt) => pt.representedType)
           .toList();
       return new InterfaceType(klass, type.nullability, typeArguments);
+    } else if (type is FutureOrType) {
+      return new FutureOrType(typeArgs[0].representedType, type.nullability);
     } else {
       return type;
     }
@@ -947,8 +954,8 @@
   @override
   String toString() {
     final head = _type is InterfaceType
-        ? "${(_type as InterfaceType).classNode}"
-        : "$_type";
+        ? "${nodeToText((_type as InterfaceType).classNode)}"
+        : "${nodeToText(_type)}";
     final typeArgsStrs = (numImmediateTypeArgs == 0)
         ? ""
         : "<${typeArgs.take(numImmediateTypeArgs).map((t) => "$t").join(", ")}>";
@@ -1008,6 +1015,34 @@
           rhs.classNode == typeHierarchy.coreTypes.objectClass);
     }
 
+    if (rhs is FutureOrType) {
+      if (_type is InterfaceType) {
+        Class thisClass = (_type as InterfaceType).classNode;
+        if (thisClass == typeHierarchy.coreTypes.futureClass) {
+          return typeArgs[0]
+              .isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
+        } else {
+          return isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
+        }
+      } else if (_type is FutureOrType) {
+        return typeArgs[0]
+            .isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
+      }
+    }
+
+    if (_type is FutureOrType) {
+      // There are more possibilities for _type to be a subtype of rhs, such as
+      // the following:
+      //   1. _type=FutureOr<Future<...>>, rhs=Future<dynamic>
+      //   2. _type=FutureOr<X>, rhs=Future<Y>, where X and Y are type
+      //      parameters declared as `X extends Y`, `Y extends Future<Y>`.
+      // Since it's ok to return false when _type <: rhs in rare cases, only the
+      // most common case of rhs being Object is handled here for now.
+      // TODO(alexmarkov): Handle other possibilities.
+      return rhs is InterfaceType &&
+          rhs.classNode == typeHierarchy.coreTypes.objectClass;
+    }
+
     final thisClass = (_type as InterfaceType).classNode;
     final otherClass = (rhs as InterfaceType).classNode;
 
@@ -1019,16 +1054,6 @@
       return true;
     }
 
-    if (otherClass == typeHierarchy.coreTypes.futureOrClass) {
-      if (thisClass == typeHierarchy.coreTypes.futureClass ||
-          thisClass == typeHierarchy.coreTypes.futureOrClass) {
-        return typeArgs[0]
-            .isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
-      } else {
-        return isSubtypeOfRuntimeType(typeHierarchy, runtimeType.typeArgs[0]);
-      }
-    }
-
     List<Type> usableTypeArgs = typeArgs;
     if (usableTypeArgs == null) {
       assertx(thisClass.typeParameters.isEmpty);
diff --git a/pkg/vm/lib/transformations/type_flow/utils.dart b/pkg/vm/lib/transformations/type_flow/utils.dart
index 07f6454..30ff278 100644
--- a/pkg/vm/lib/transformations/type_flow/utils.dart
+++ b/pkg/vm/lib/transformations/type_flow/utils.dart
@@ -7,6 +7,9 @@
 library vm.transformations.type_flow.utils;
 
 import 'package:kernel/ast.dart';
+import 'package:kernel/src/printer.dart';
+
+String nodeToText(Node node) => node.toText(astTextStrategyForTesting);
 
 const bool kPrintTrace =
     const bool.fromEnvironment('global.type.flow.print.trace');
diff --git a/pkg/vm/test/transformations/protobuf_aware_treeshaker/treeshaker_test.dart b/pkg/vm/test/transformations/protobuf_aware_treeshaker/treeshaker_test.dart
index 58b77d7..707b1fd 100644
--- a/pkg/vm/test/transformations/protobuf_aware_treeshaker/treeshaker_test.dart
+++ b/pkg/vm/test/transformations/protobuf_aware_treeshaker/treeshaker_test.dart
@@ -8,6 +8,7 @@
 import 'package:kernel/ast.dart';
 import 'package:kernel/kernel.dart';
 import 'package:kernel/binary/ast_to_binary.dart';
+import 'package:kernel/src/printer.dart';
 import 'package:path/path.dart' as path;
 import 'package:test/test.dart';
 
@@ -37,7 +38,7 @@
   for (Class messageClass in messageClasses) {
     expect(messageClass.enclosingLibrary.classes.contains(messageClass),
         messageClass.name.endsWith('Keep'),
-        reason: '$messageClass');
+        reason: '${messageClass.toText(astTextStrategyForTesting)}');
   }
 
   final systemTempDir = Directory.systemTemp;
diff --git a/pkg/vm/testcases/bytecode/asserts.dart.expect b/pkg/vm/testcases/bytecode/asserts.dart.expect
index e8170f0..5da6d08 100644
--- a/pkg/vm/testcases/bytecode/asserts.dart.expect
+++ b/pkg/vm/testcases/bytecode/asserts.dart.expect
@@ -90,7 +90,7 @@
     assert(condition);
   }
   static method test2(() →* dart.core::bool* condition, () →* dart.core::String* message) → void {
-    assert([@vm.call-site-attributes.metadata=receiverType:FunctionType(bool* Function()*)] condition.call(), [@vm.call-site-attributes.metadata=receiverType:FunctionType(String* Function()*)] message.call());
+    assert([@vm.call-site-attributes.metadata=receiverType:dart.core::bool* Function()*] condition.call(), [@vm.call-site-attributes.metadata=receiverType:dart.core::String* Function()*] message.call());
   }
   static method main() → dynamic {}
 }
diff --git a/pkg/vm/testcases/bytecode/async.dart.expect b/pkg/vm/testcases/bytecode/async.dart.expect
index b55bb25..b758e31 100644
--- a/pkg/vm/testcases/bytecode/async.dart.expect
+++ b/pkg/vm/testcases/bytecode/async.dart.expect
@@ -1998,7 +1998,7 @@
 
   static field (dart.async::Future<dart.core::int*>*) →* dart.async::Future<dart.core::Null?>* asyncInFieldInitializer = (dart.async::Future<dart.core::int*>* x) → dart.async::Future<dart.core::Null?>* /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dart.core::Null?>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::Null?>();
-    dart.async::FutureOr<dart.core::Null?>* :return_value;
+    FutureOr<dart.core::Null?>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -2026,7 +2026,7 @@
   };
   static method foo() → dart.async::Future<dart.core::int*>* /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dart.core::int*>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::int*>();
-    dart.async::FutureOr<dart.core::int*>* :return_value;
+    FutureOr<dart.core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -2053,7 +2053,7 @@
   }
   static method simpleAsyncAwait(dart.async::Future<dart.core::int*>* a, dart.async::Future<dart.core::int*>* b) → dart.async::Future<dart.core::int*>* /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dart.core::int*>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::int*>();
-    dart.async::FutureOr<dart.core::int*>* :return_value;
+    FutureOr<dart.core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -2085,7 +2085,7 @@
   }
   static method loops(dart.core::List<dart.core::int*>* list) → dart.async::Future<dart.core::int*>* /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dart.core::int*>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::int*>();
-    dart.async::FutureOr<dart.core::int*>* :return_value;
+    FutureOr<dart.core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -2133,7 +2133,7 @@
   }
   static method tryCatchRethrow(dart.async::Future<dart.core::int*>* a, dart.async::Future<dart.core::int*>* b, dart.async::Future<dart.core::int*>* c) → dart.async::Future<dart.core::int*>* /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dart.core::int*>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::int*>();
-    dart.async::FutureOr<dart.core::int*>* :return_value;
+    FutureOr<dart.core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -2193,7 +2193,7 @@
     dart.core::int* x = 3;
     function nested() → dart.async::Future<dart.core::int*>* /* originally async */ {
       final dart.async::_AsyncAwaitCompleter<dart.core::int*>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::int*>();
-      dart.async::FutureOr<dart.core::int*>* :return_value;
+      FutureOr<dart.core::int*>* :return_value;
       dynamic :async_stack_trace;
       (dynamic) →* dynamic :async_op_then;
       (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
@@ -2233,7 +2233,7 @@
   }
   static method testAssert(dart.async::Future<dart.core::int*>* a) → dart.async::Future<dart.core::int*>* /* originally async */ {
     final dart.async::_AsyncAwaitCompleter<dart.core::int*>* :async_completer = new dart.async::_AsyncAwaitCompleter::•<dart.core::int*>();
-    dart.async::FutureOr<dart.core::int*>* :return_value;
+    FutureOr<dart.core::int*>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (dart.core::Object*, dart.core::StackTrace*) →* dynamic :async_op_error;
diff --git a/pkg/vm/testcases/bytecode/bootstrapping.dart.expect b/pkg/vm/testcases/bytecode/bootstrapping.dart.expect
index 8fbd06a..6551407 100644
--- a/pkg/vm/testcases/bytecode/bootstrapping.dart.expect
+++ b/pkg/vm/testcases/bytecode/bootstrapping.dart.expect
@@ -980,7 +980,7 @@
     }
     static get platformScript() → dynamic {
       if(#lib::VMLibraryHooks::_cachedScript.{dart.core::Object::==}(null) && !#lib::VMLibraryHooks::_computeScriptUri.{dart.core::Object::==}(null)) {
-        #lib::VMLibraryHooks::_cachedScript = [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] #lib::VMLibraryHooks::_computeScriptUri.call();
+        #lib::VMLibraryHooks::_cachedScript = [@vm.call-site-attributes.metadata=receiverType:dynamic] #lib::VMLibraryHooks::_computeScriptUri.call();
       }
       return #lib::VMLibraryHooks::_cachedScript;
     }
diff --git a/pkg/vm/testcases/bytecode/closures.dart.expect b/pkg/vm/testcases/bytecode/closures.dart.expect
index 2b004ef..97d6e4e 100644
--- a/pkg/vm/testcases/bytecode/closures.dart.expect
+++ b/pkg/vm/testcases/bytecode/closures.dart.expect
@@ -2370,13 +2370,13 @@
             dart.core::print(<dart.core::Type*>[#lib::A::T1*, #lib::A::T2*, #lib::A::foo::T3*, #lib::A::foo::T4*, T5*, T6*, T7*, T8*]);
             #lib::callWithArgs<#lib::A::T1*, #lib::A::T2*, #lib::A::foo::T3*, #lib::A::foo::T4*, T5*, T6*, T7*, T8*>();
           };
-          [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function()*)] nested3.call();
+          [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function()*] nested3.call();
         }
-        [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function<T7, T8>()*)] nested2.call<#lib::C7*, #lib::C8*>();
-        [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function<T7, T8>()*)] nested2.call<dart.core::List<#lib::C7*>*, dart.core::List<#lib::C8*>*>();
+        [@vm.call-site-attributes.metadata=receiverType:void Function<T7, T8>()*] nested2.call<#lib::C7*, #lib::C8*>();
+        [@vm.call-site-attributes.metadata=receiverType:void Function<T7, T8>()*] nested2.call<dart.core::List<#lib::C7*>*, dart.core::List<#lib::C8*>*>();
       }
-      [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function<T5, T6>()*)] nested1.call<#lib::C5*, #lib::C6*>();
-      [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function<T5, T6>()*)] nested1.call<dart.core::List<#lib::C5*>*, dart.core::List<#lib::C6*>*>();
+      [@vm.call-site-attributes.metadata=receiverType:void Function<T5, T6>()*] nested1.call<#lib::C5*, #lib::C6*>();
+      [@vm.call-site-attributes.metadata=receiverType:void Function<T5, T6>()*] nested1.call<dart.core::List<#lib::C5*>*, dart.core::List<#lib::C6*>*>();
     }
     abstract member-signature get _identityHashCode() → dart.core::int*;
     abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*;
@@ -2408,12 +2408,12 @@
                 z = x.{dart.core::num::+}(2);
                 w = this.{#lib::B::foo}.{dart.core::num::+}(y);
               }
-              [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function()*)] closure2.call();
+              [@vm.call-site-attributes.metadata=receiverType:void Function()*] closure2.call();
               dart.core::print(w);
             }
           };
-          [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function(int*)*)] closure1.call(10);
-          [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function(int*)*)] closure1.call(11);
+          [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function(dart.core::int*)*] closure1.call(10);
+          [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function(dart.core::int*)*] closure1.call(11);
           dart.core::print(y);
           dart.core::print(z);
         }
@@ -2424,7 +2424,7 @@
         () →* dart.core::Null? closure3 = () → dart.core::Null? {
           this.{#lib::B::foo} = x;
         };
-        [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function()*)] closure3.call();
+        [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function()*] closure3.call();
       }
     }
     abstract member-signature get _identityHashCode() → dart.core::int*;
@@ -2447,8 +2447,8 @@
       dart.core::List<dart.core::Function*>* getI = <dart.core::Function*>[];
       dart.core::List<dart.core::Function*>* setI = <dart.core::Function*>[];
       for (dart.core::int* i = 0; i.{dart.core::num::<}(10); i = i.{dart.core::num::+}(1)) {
-        [@vm.call-site-attributes.metadata=receiverType:InterfaceType(List<Function*>*)] getI.{dart.core::List::add}(() → dart.core::int* => i.{dart.core::num::+}(delta));
-        [@vm.call-site-attributes.metadata=receiverType:InterfaceType(List<Function*>*)] setI.{dart.core::List::add}((dart.core::int* ii) → dart.core::Null? {
+        [@vm.call-site-attributes.metadata=receiverType:dart.core::List<dart.core::Function*>*] getI.{dart.core::List::add}(() → dart.core::int* => i.{dart.core::num::+}(delta));
+        [@vm.call-site-attributes.metadata=receiverType:dart.core::List<dart.core::Function*>*] setI.{dart.core::List::add}((dart.core::int* ii) → dart.core::Null? {
           i = ii.{dart.core::num::+}(delta);
         });
       }
@@ -2462,7 +2462,7 @@
             () →* dart.core::Null? inc = () → dart.core::Null? {
               i = i.{dart.core::num::+}(1);
             };
-            [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function()*)] inc.call();
+            [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function()*] inc.call();
             dart.core::print(i);
           }
         }
@@ -2489,7 +2489,7 @@
     method bar() → dynamic {
       return () → dart.core::Null? {
         function inner() → dart.core::Null? {}
-        [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function()*)] inner.call();
+        [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function()*] inner.call();
       };
     }
     abstract member-signature get _identityHashCode() → dart.core::int*;
@@ -2513,11 +2513,11 @@
     abstract method evalArg2() → dart.core::int*;
     abstract method getE() → #lib::E*;
     method testCallThroughGetter1() → dart.core::int*
-      return let final dart.core::int* #t1 = this.{#lib::E::evalArg1}() in let final dart.core::int* #t2 = this.{#lib::E::evalArg2}() in [@vm.call-site-attributes.metadata=receiverType:FunctionType(int* Function(int*, int*)*)] this.{#lib::E::foo1}.call(#t1, #t2);
+      return let final dart.core::int* #t1 = this.{#lib::E::evalArg1}() in let final dart.core::int* #t2 = this.{#lib::E::evalArg2}() in [@vm.call-site-attributes.metadata=receiverType:dart.core::int* Function(dart.core::int*, dart.core::int*)*] this.{#lib::E::foo1}.call(#t1, #t2);
     method testCallThroughGetter2() → dart.core::int*
-      return let final dart.core::int* #t3 = this.{#lib::E::evalArg1}() in let final dart.core::int* #t4 = this.{#lib::E::evalArg2}() in [@vm.call-site-attributes.metadata=receiverType:FunctionType(int* Function<T>(T*, T*)*)] this.{#lib::E::foo2}.call<dart.core::int*>(#t3, #t4);
+      return let final dart.core::int* #t3 = this.{#lib::E::evalArg1}() in let final dart.core::int* #t4 = this.{#lib::E::evalArg2}() in [@vm.call-site-attributes.metadata=receiverType:dart.core::int* Function<T>(T*, T*)*] this.{#lib::E::foo2}.call<dart.core::int*>(#t3, #t4);
     method testCallThroughGetter3() → dart.core::int*
-      return let final #lib::E* #t5 = this.{#lib::E::getE}() in let final dart.core::int* #t6 = this.{#lib::E::evalArg1}() in let final dart.core::int* #t7 = this.{#lib::E::evalArg2}() in [@vm.call-site-attributes.metadata=receiverType:FunctionType(int* Function<T>(T*, T*)*)] #t5.{#lib::E::foo2}.call<dart.core::int*>(#t6, #t7);
+      return let final #lib::E* #t5 = this.{#lib::E::getE}() in let final dart.core::int* #t6 = this.{#lib::E::evalArg1}() in let final dart.core::int* #t7 = this.{#lib::E::evalArg2}() in [@vm.call-site-attributes.metadata=receiverType:dart.core::int* Function<T>(T*, T*)*] #t5.{#lib::E::foo2}.call<dart.core::int*>(#t6, #t7);
     abstract member-signature get _identityHashCode() → dart.core::int*;
     abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*;
     abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*;
@@ -2534,7 +2534,7 @@
     (dart.core::int*) →* dart.core::Null? inc = (dart.core::int* y) → dart.core::Null? {
       x = x.{dart.core::num::+}(y);
     };
-    [@vm.call-site-attributes.metadata=receiverType:FunctionType(Null? Function(int*)*)] inc.call(3);
+    [@vm.call-site-attributes.metadata=receiverType:dart.core::Null? Function(dart.core::int*)*] inc.call(3);
     return x;
   }
   static method callWithArgs<T1 extends dart.core::Object* = dynamic, T2 extends dart.core::Object* = dynamic, T3 extends dart.core::Object* = dynamic, T4 extends dart.core::Object* = dynamic, T5 extends dart.core::Object* = dynamic, T6 extends dart.core::Object* = dynamic, T7 extends dart.core::Object* = dynamic, T8 extends dart.core::Object* = dynamic>() → void {
diff --git a/pkg/vm/testcases/bytecode/super_calls.dart.expect b/pkg/vm/testcases/bytecode/super_calls.dart.expect
index 181a7cb..0d2d233 100644
--- a/pkg/vm/testcases/bytecode/super_calls.dart.expect
+++ b/pkg/vm/testcases/bytecode/super_calls.dart.expect
@@ -584,7 +584,7 @@
     method testSuperGet() → dynamic
       return super.{#lib::Base1::bar};
     method testSuperCallViaGetter() → dynamic
-      return [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] super.{#lib::Base1::bar}.call<dart.core::int*>("param");
+      return [@vm.call-site-attributes.metadata=receiverType:dynamic] super.{#lib::Base1::bar}.call<dart.core::int*>("param");
     method testSuperSet() → dynamic {
       super.{#lib::Base1::bazz} = 3;
     }
@@ -618,7 +618,7 @@
     method testSuperGet() → dynamic
       return super.{#lib::Base2::bar};
     method testSuperCallViaGetter() → dynamic
-      return [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] super.{#lib::Base2::bar}.call<dart.core::int*>("param");
+      return [@vm.call-site-attributes.metadata=receiverType:dynamic] super.{#lib::Base2::bar}.call<dart.core::int*>("param");
     method testSuperSet() → dynamic {
       super.{#lib::Base2::bazz} = 3;
     }
diff --git a/pkg/vm/testcases/bytecode/try_blocks.dart.expect b/pkg/vm/testcases/bytecode/try_blocks.dart.expect
index b7543da..20f7426 100644
--- a/pkg/vm/testcases/bytecode/try_blocks.dart.expect
+++ b/pkg/vm/testcases/bytecode/try_blocks.dart.expect
@@ -1033,7 +1033,7 @@
           y = 3;
         }
       }
-      [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function()*)] foo.call();
+      [@vm.call-site-attributes.metadata=receiverType:void Function()*] foo.call();
       dart.core::print(y);
     }
     on dynamic catch(final dynamic e, final dart.core::StackTrace* st) {
@@ -1099,7 +1099,7 @@
                 dart.core::print(x);
                 dart.core::print(y);
               }
-              [@vm.call-site-attributes.metadata=receiverType:FunctionType(void Function()*)] foo.call();
+              [@vm.call-site-attributes.metadata=receiverType:void Function()*] foo.call();
               continue #L4;
             }
             finally {
@@ -1143,7 +1143,7 @@
     }
     finally {
       dart.core::print(x);
-      [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] y.call();
+      [@vm.call-site-attributes.metadata=receiverType:dynamic] y.call();
     }
   }
   static method testTryCatchFinally() → dynamic {
diff --git a/pkg/vm/testcases/bytecode/type_ops.dart.expect b/pkg/vm/testcases/bytecode/type_ops.dart.expect
index 37f2ebb..0036353 100644
--- a/pkg/vm/testcases/bytecode/type_ops.dart.expect
+++ b/pkg/vm/testcases/bytecode/type_ops.dart.expect
@@ -883,7 +883,7 @@
       if(y is #lib::C<dynamic, #lib::D::Q*, dart.core::List<#lib::D::P*>*>*) {
         dart.core::print("22");
       }
-      [@vm.call-site-attributes.metadata=receiverType:InterfaceType(D<D.P*, D.Q*>*)] this.{#lib::D::foo} = y as{TypeError,ForDynamic} dart.core::Map<#lib::D::P*, #lib::D::Q*>*;
+      [@vm.call-site-attributes.metadata=receiverType:#lib::D<#lib::D.P*, #lib::D.Q*>*] this.{#lib::D::foo} = y as{TypeError,ForDynamic} dart.core::Map<#lib::D::P*, #lib::D::Q*>*;
     }
     method foo3<T1 extends dart.core::Object* = dynamic, T2 extends dart.core::Object* = dynamic>(dynamic z) → dynamic {
       if(z is #lib::A<#lib::D::foo3::T1*>*) {
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/bool_expressions.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/bool_expressions.dart.expect
index ed00cf1..96eea1d 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/bool_expressions.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/bool_expressions.dart.expect
@@ -6,7 +6,7 @@
 RESULT: _T {}?
 ------------ bool_expressions ------------
 t0* = _Call direct [#lib::foo] ()
-t1 = _TypeCheck (t0 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t1 = _TypeCheck (t0 against dart.core::bool*) (for #lib::foo() as dart.core::bool*)
 t2* = _Call direct [#lib::bar] ()
 t3* = _Call [dart.core::num.+] (_T (dart.core::int)+, _T (dart.core::_Smi, 1))
 i_0 = _Join [dart.core::int*] (_T (dart.core::_Smi, 0), t3)
@@ -14,13 +14,13 @@
 t6* = _Call direct [#lib::bar] ()
 t7* = _Call direct [#lib::foo] ()
 t8 = _Join [dynamic] (_T (dart.core::bool, true), t7)
-t9 = _TypeCheck (t8 against dart.core::bool*) (for AsExpression( ? true : foo,  as bool*))
+t9 = _TypeCheck (t8 against dart.core::bool*) (for (x{dart.core::bool*} ?{dynamic} true : #lib::foo()) as dart.core::bool*)
 t10* = _Call direct [#lib::bar] ()
 t11* = _Call direct [#lib::bar] ()
 t12* = _Call direct [#lib::foo] ()
-t13 = _TypeCheck (t12 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t13 = _TypeCheck (t12 against dart.core::bool*) (for #lib::foo() as dart.core::bool*)
 t14* = _Call direct [#lib::foo] ()
-t15 = _TypeCheck (t14 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t15 = _TypeCheck (t14 against dart.core::bool*) (for #lib::foo() as dart.core::bool*)
 y_0 = _Join [dart.core::bool*] (_T (dart.core::bool), _T (dart.core::bool, true))
 RESULT: _T {}?
 ------------ main ------------
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect
index 5ed0d02..bbd410a 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect
@@ -38,7 +38,7 @@
 t6 = _Call [#lib::A.foo1] (%aa, _T (#lib::B))
 t7 = _Narrow (%aa to _T ANY)
 t8* = _Call get [#lib::A.foo2] (t7)
-t9 = _TypeCheck (t8 against dart.core::int*) (for AsExpression(.foo2 as int*))
+t9 = _TypeCheck (t8 against dart.core::int*) (for aa.{#lib::A.foo2} as dart.core::int*)
 t10 = _Call set [#lib::A.foo3] (t7, t9)
 t11* = _Call get [#lib::A.foo1] (t7)
 t12* = _Call get [#lib::A.foo2] (t7)
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart.expect
index 9448ea4..6f36339 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_basic.dart.expect
@@ -12,13 +12,13 @@
 %this = _Parameter #0 [_T (#lib::C)+]
 %x = _Parameter #1
 t2 = _Extract (%this[#lib::C/0]*)
-t3 = _TypeCheck (%x against t2) (for VariableDeclaration(x))
+t3 = _TypeCheck (%x against t2) (for #lib::C.T* x;)
 RESULT: t3
 ------------ C.id2 ------------
 %this = _Parameter #0 [_T (#lib::C)+]
 %x = _Parameter #1
 t2 = _Extract (%this[#lib::C/0]*)
-t3 = _TypeCheck (%x against t2) (for VariableDeclaration(x))
+t3 = _TypeCheck (%x against t2) (for #lib::C.T* x;)
 RESULT: t3
 ------------ D. ------------
 %this = _Parameter #0 [_T (#lib::D)+]
@@ -77,7 +77,7 @@
 %x = _Parameter #1
 t2 = _Extract (%this[#lib::C2/0]*)
 t3 = _CreateRuntimeType (dart.core::Comparable @ (t2)*)
-t4 = _TypeCheck (%x against t3) (for VariableDeclaration(x))
+t4 = _TypeCheck (%x against t3) (for dart.core::Comparable<#lib::C2.T*>* x;)
 RESULT: t4
 ------------ C2.id4 ------------
 %this = _Parameter #0 [_T (#lib::C2)+]
@@ -85,7 +85,7 @@
 t2 = _Extract (%this[#lib::C2/0]*)
 t3 = _CreateRuntimeType (#lib::I @ (t2)*)
 t4 = _CreateRuntimeType (#lib::K @ (t3)*)
-t5 = _TypeCheck (%x against t4) (for VariableDeclaration(x))
+t5 = _TypeCheck (%x against t4) (for #lib::K<#lib::I<#lib::C2.T*>*>* x;)
 RESULT: t5
 ------------ main ------------
 t0 = _Call direct [#lib::C.] (_T (#lib::C<dart.core::int*>))
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_case1.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_case1.dart.expect
index 18b1677..0eea29d 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_case1.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/class_generics_case1.dart.expect
@@ -17,9 +17,9 @@
 %key = _Parameter #1
 %value = _Parameter #2
 t3 = _Extract (%this[#lib::_NotRealHashMap/0]*)
-t4 = _TypeCheck (%key against t3) (for VariableDeclaration(key))
+t4 = _TypeCheck (%key against t3) (for #lib::_NotRealHashMap.K* key;)
 t5 = _Extract (%this[#lib::_NotRealHashMap/1]*)
-t6 = _TypeCheck (%value against t5) (for VariableDeclaration(value))
+t6 = _TypeCheck (%value against t5) (for #lib::_NotRealHashMap.V* value;)
 RESULT: _T {}?
 ------------ InheritedElement. ------------
 %this = _Parameter #0 [_T (#lib::InheritedElement)+]
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/constants.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/constants.dart.expect
index f1be001..6ee10df 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/constants.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/constants.dart.expect
@@ -20,7 +20,7 @@
 RESULT: _T {}?
 ------------ _constList1 ------------
 
-RESULT: _T (dart.core::_ImmutableList, ListConstant<int*>([1, 2, 3]))
+RESULT: _T (dart.core::_ImmutableList, const <dart.core::int*>[1, 2, 3])
 ------------ _constList2 ------------
 
-RESULT: _T (dart.core::_ImmutableList, ListConstant<Object*>([hi, 33, null, -5]))
+RESULT: _T (dart.core::_ImmutableList, const <dart.core::Object*>[hi, 33, null, -5])
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/control_flow.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/control_flow.dart.expect
index 740ae32..e723799 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/control_flow.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/control_flow.dart.expect
@@ -28,13 +28,13 @@
 RESULT: t1
 ------------ TestEnum.values ------------
 
-RESULT: _T (dart.core::_ImmutableList, ListConstant<TestEnum*>([#lib::TestEnum {index: 0, #lib::_name: TestEnum.v1, }, #lib::TestEnum {index: 1, #lib::_name: TestEnum.v2, }]))
+RESULT: _T (dart.core::_ImmutableList, const <#lib::TestEnum*>[const #lib::TestEnum{#lib::TestEnum.index: 0, #lib::TestEnum._name: TestEnum.v1}, const #lib::TestEnum{#lib::TestEnum.index: 1, #lib::TestEnum._name: TestEnum.v2}])
 ------------ TestEnum.v1 ------------
 
-RESULT: _T (#lib::TestEnum, #lib::TestEnum {index: 0, #lib::_name: TestEnum.v1, })
+RESULT: _T (#lib::TestEnum, const #lib::TestEnum{#lib::TestEnum.index: 0, #lib::TestEnum._name: TestEnum.v1})
 ------------ TestEnum.v2 ------------
 
-RESULT: _T (#lib::TestEnum, #lib::TestEnum {index: 1, #lib::_name: TestEnum.v2, })
+RESULT: _T (#lib::TestEnum, const #lib::TestEnum{#lib::TestEnum.index: 1, #lib::TestEnum._name: TestEnum.v2})
 ------------ foo ------------
 %x = _Parameter #0 [_T ANY?]
 RESULT: _T {}?
@@ -71,10 +71,10 @@
 t2 = _Call direct [#lib::C1.] (_T (#lib::C1))
 t3 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t4* = _Call direct [#lib::foo] (_T (#lib::C2))
-t5 = _TypeCheck (t4 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t5 = _TypeCheck (t4 against dart.core::bool*) (for #lib::foo(x = new #lib::C2()) as dart.core::bool*)
 t6 = _Call direct [#lib::C3.] (_T (#lib::C3))
 t7* = _Call direct [#lib::foo] (_T (#lib::C3))
-t8 = _TypeCheck (t7 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t8 = _TypeCheck (t7 against dart.core::bool*) (for #lib::foo(x = new #lib::C3()) as dart.core::bool*)
 x_0 = _Join [dynamic] (_T (#lib::C2), _T (#lib::C3))
 t10 = _Call direct [#lib::bar] (x_0)
 RESULT: x_0
@@ -82,10 +82,10 @@
 t0 = _Call direct [#lib::C1.] (_T (#lib::C1))
 t1 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t2* = _Call direct [#lib::foo] (_T (#lib::C2))
-t3 = _TypeCheck (t2 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t3 = _TypeCheck (t2 against dart.core::bool*) (for #lib::foo(x = new #lib::C2()) as dart.core::bool*)
 t4 = _Call direct [#lib::C3.] (_T (#lib::C3))
 t5* = _Call direct [#lib::foo] (_T (#lib::C3))
-t6 = _TypeCheck (t5 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t6 = _TypeCheck (t5 against dart.core::bool*) (for #lib::foo(x = new #lib::C3()) as dart.core::bool*)
 t7 = _Call direct [#lib::bar] (_T (#lib::C3))
 x_0 = _Join [dynamic] (_T (#lib::C2), _T (#lib::C3))
 RESULT: x_0
@@ -104,7 +104,7 @@
 RESULT: _T {}?
 ------------ if6b ------------
 %x = _Parameter #0 [_T ANY?]
-t1 = _TypeCheck (%x against dart.core::bool*) (for AsExpression( as bool*))
+t1 = _TypeCheck (%x against dart.core::bool*) (for x as dart.core::bool*)
 t2 = _Call direct [#lib::foo] (_T (dart.core::bool, true))
 t3 = _Call direct [#lib::bar] (_T (dart.core::bool, false))
 x_0 = _Join [dynamic] (_T (dart.core::bool, true), _T (dart.core::bool, false))
@@ -129,8 +129,8 @@
 RESULT: _T {}?
 ------------ if9 ------------
 %x = _Parameter #0 [_T (#lib::TestEnum)+?]
-t1* = _Call [#lib::TestEnum.==] (%x, _T (#lib::TestEnum, #lib::TestEnum {index: 0, #lib::_name: TestEnum.v1, }))
-t2 = _Call direct [#lib::foo] (_T (#lib::TestEnum, #lib::TestEnum {index: 0, #lib::_name: TestEnum.v1, }))
+t1* = _Call [#lib::TestEnum.==] (%x, _T (#lib::TestEnum, const #lib::TestEnum{#lib::TestEnum.index: 0, #lib::TestEnum._name: TestEnum.v1}))
+t2 = _Call direct [#lib::foo] (_T (#lib::TestEnum, const #lib::TestEnum{#lib::TestEnum.index: 0, #lib::TestEnum._name: TestEnum.v1}))
 RESULT: _T {}?
 ------------ conditional1 ------------
 %cond1 = _Parameter #0 [_T (dart.core::bool)+?]
@@ -138,7 +138,7 @@
 t2 = _Call direct [#lib::C1.] (_T (#lib::C1))
 t3 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t4* = _Call direct [#lib::foo] (_T (#lib::C2))
-t5 = _TypeCheck (t4 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t5 = _TypeCheck (t4 against dart.core::bool*) (for #lib::foo(x = new #lib::C2()) as dart.core::bool*)
 t6 = _Call direct [#lib::C3.] (_T (#lib::C3))
 t7 = _Call direct [#lib::C4.] (_T (#lib::C4))
 x_0 = _Join [dynamic] (_T (#lib::C3), _T (#lib::C4))
@@ -153,7 +153,7 @@
 t2 = _Call direct [#lib::C1.] (_T (#lib::C1))
 t3 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t4* = _Call direct [#lib::foo] (_T (#lib::C2))
-t5 = _TypeCheck (t4 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t5 = _TypeCheck (t4 against dart.core::bool*) (for #lib::foo(x = new #lib::C2()) as dart.core::bool*)
 t6 = _Call direct [#lib::C3.] (_T (#lib::C3))
 t7 = _Call direct [#lib::C4.] (_T (#lib::C4))
 t8* = _Call direct [#lib::foo] (_T (dart.core::_GrowableList<#lib::C4*>))
@@ -165,7 +165,7 @@
 t0 = _Call direct [#lib::C1.] (_T (#lib::C1))
 x_0 = _Join [dynamic] (_T (#lib::C1), _T (#lib::C2))
 t2* = _Call direct [#lib::foo] (x_0)
-t3 = _TypeCheck (t2 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t3 = _TypeCheck (t2 against dart.core::bool*) (for #lib::foo(x) as dart.core::bool*)
 t4 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t5 = _Call direct [#lib::bar] (x_0)
 RESULT: x_0
@@ -177,13 +177,13 @@
 t4 = _Call direct [#lib::bar] (_T (#lib::C2))
 t5 = _Call direct [#lib::C3.] (_T (#lib::C3))
 t6* = _Call direct [#lib::bar] (_T (#lib::C3))
-t7 = _TypeCheck (t6 against dart.core::bool*) (for AsExpression(bar,  as bool*))
+t7 = _TypeCheck (t6 against dart.core::bool*) (for #lib::bar(x = new #lib::C3()) as dart.core::bool*)
 RESULT: _T (#lib::C3)
 ------------ loop3 ------------
 t0 = _Call direct [#lib::C1.] (_T (#lib::C1))
 t1 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t2* = _Call direct [#lib::foo] (_T (#lib::C2))
-t3 = _TypeCheck (t2 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t3 = _TypeCheck (t2 against dart.core::bool*) (for #lib::foo(x = new #lib::C2()) as dart.core::bool*)
 t4 = _Call direct [#lib::C3.] (_T (#lib::C3))
 t5 = _Call direct [#lib::bar] (_T (#lib::C2))
 RESULT: _T (#lib::C2)
@@ -191,7 +191,7 @@
 t0 = _Call direct [#lib::C1.] (_T (#lib::C1))
 t1 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t2 = _Call direct [#lib::foo] (_T (#lib::C2))
-t3* = _Call get [dart.core::Iterable.iterator] (_T (dart.core::_GrowableList<DynamicType(dynamic)?>))
+t3* = _Call get [dart.core::Iterable.iterator] (_T (dart.core::_GrowableList<dynamic?>))
 t4* = _Call [dart.core::Iterator.moveNext] (t3)
 t5 = _Narrow (t3 to _T ANY)
 t6 = _Call get [dart.core::Iterator.current] (t5)
@@ -203,10 +203,10 @@
 t0 = _Call direct [#lib::C1.] (_T (#lib::C1))
 x_0 = _Join [dynamic] (_T (#lib::C1), _T (#lib::C3))
 t2* = _Call direct [#lib::foo] (x_0)
-t3 = _TypeCheck (t2 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t3 = _TypeCheck (t2 against dart.core::bool*) (for #lib::foo(x) as dart.core::bool*)
 t4 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t5* = _Call direct [#lib::bar] (_T (#lib::C2))
-t6 = _TypeCheck (t5 against dart.core::bool*) (for AsExpression(bar,  as bool*))
+t6 = _TypeCheck (t5 against dart.core::bool*) (for #lib::bar(x) as dart.core::bool*)
 t7 = _Call direct [#lib::C3.] (_T (#lib::C3))
 x_1 = _Join [dynamic] (x_0, _T (#lib::C2))
 RESULT: x_1
@@ -215,10 +215,10 @@
 x_1 = _Join [dynamic] (_T (#lib::C3), _T (#lib::C2))
 x_0 = _Join [dynamic] (_T (#lib::C1), x_1)
 t3* = _Call direct [#lib::foo] (x_0)
-t4 = _TypeCheck (t3 against dart.core::bool*) (for AsExpression(foo,  as bool*))
+t4 = _TypeCheck (t3 against dart.core::bool*) (for #lib::foo(x) as dart.core::bool*)
 t5 = _Call direct [#lib::C2.] (_T (#lib::C2))
 t6* = _Call direct [#lib::bar] (_T (#lib::C2))
-t7 = _TypeCheck (t6 against dart.core::bool*) (for AsExpression(bar,  as bool*))
+t7 = _TypeCheck (t6 against dart.core::bool*) (for #lib::bar(x) as dart.core::bool*)
 t8 = _Call direct [#lib::C3.] (_T (#lib::C3))
 RESULT: x_0
 ------------ try1 ------------
@@ -271,7 +271,7 @@
 RESULT: x_2
 ------------ cast1 ------------
 %x = _Parameter #0 [_T ANY?]
-t1 = _TypeCheck (%x against #lib::C1*) (for AsExpression( as C1*))
+t1 = _TypeCheck (%x against #lib::C1*) (for x as #lib::C1*)
 t2 = _Call direct [#lib::foo] (t1)
 t3 = _Call direct [#lib::bar] (t1)
 RESULT: _T {}?
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/annotation.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/annotation.dart.expect
index 8d458eb..2d7c07d 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/annotation.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/annotation.dart.expect
@@ -30,11 +30,11 @@
 }
 [@vm.unboxing-info.metadata=(b)->i]static method foo([@vm.inferred-type.metadata=dart.core::Null? (value: null)] (core::List<core::int*>*) →* void a) → core::int* {
   @#C9 core::int* x = 2;
-  return [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] x.{core::num::+}(2);
+  return [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] x.{core::num::+}(2);
 }
 @#C11
 static method main(core::List<core::String*>* args) → dynamic {
   self::A::staticMethod();
-  [@vm.direct-call.metadata=B.instanceMethod] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•().{self::B::instanceMethod}();
+  [@vm.direct-call.metadata=#lib::B.instanceMethod] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•().{self::B::instanceMethod}();
   self::foo(null);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect
index f0189f9..92436bf 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/async_await.dart.expect
@@ -10,7 +10,7 @@
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method bar(dynamic x) → asy::Future<dynamic>* /* originally async */ {
     final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-    asy::FutureOr<dynamic>* :return_value;
+    FutureOr<dynamic>* :return_value;
     dynamic :async_stack_trace;
     (dynamic) →* dynamic :async_op_then;
     (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -27,13 +27,13 @@
         return;
       }
       on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
-        [@vm.direct-call.metadata=_AsyncAwaitCompleter.completeError] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+        [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.completeError] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::Completer::completeError}(exception, stack_trace);
       }
     :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
     :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
     :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
-    [@vm.direct-call.metadata=_AsyncAwaitCompleter.start] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
-    return [@vm.direct-call.metadata=_AsyncAwaitCompleter.future] [@vm.inferred-type.metadata=dart.async::_Future] :async_completer.{asy::Completer::future};
+    [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.start] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+    return [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.future] [@vm.inferred-type.metadata=dart.async::_Future] :async_completer.{asy::Completer::future};
   }
 }
 class B extends core::Object {
@@ -45,7 +45,7 @@
   return new self::A::•();
 static method baz() → asy::Future<dynamic>* /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -62,17 +62,17 @@
       return;
     }
     on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
-      [@vm.direct-call.metadata=_AsyncAwaitCompleter.completeError] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+      [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.completeError] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::Completer::completeError}(exception, stack_trace);
     }
   :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
   :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
   :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
-  [@vm.direct-call.metadata=_AsyncAwaitCompleter.start] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
-  return [@vm.direct-call.metadata=_AsyncAwaitCompleter.future] [@vm.inferred-type.metadata=dart.async::_Future] :async_completer.{asy::Completer::future};
+  [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.start] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+  return [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.future] [@vm.inferred-type.metadata=dart.async::_Future] :async_completer.{asy::Completer::future};
 }
 static method main() → dynamic /* originally async */ {
   final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
-  asy::FutureOr<dynamic>* :return_value;
+  FutureOr<dynamic>* :return_value;
   dynamic :async_stack_trace;
   (dynamic) →* dynamic :async_op_then;
   (core::Object*, core::StackTrace*) →* dynamic :async_op_error;
@@ -86,18 +86,18 @@
       {
         :async_temporary_0 = [@vm.inferred-type.metadata=#lib::A] self::foo();
         [yield] let dynamic #t1 = asy::_awaitHelper([@vm.inferred-type.metadata=dart.async::_Future] self::baz(), :async_op_then, :async_op_error, :async_op) in null;
-        [yield] let dynamic #t2 = asy::_awaitHelper([@vm.direct-call.metadata=A.bar??] [@vm.inferred-type.metadata=dart.async::_Future (receiver not int)] _in::unsafeCast<dynamic>(:async_temporary_0).bar(:result), :async_op_then, :async_op_error, :async_op) in null;
+        [yield] let dynamic #t2 = asy::_awaitHelper([@vm.direct-call.metadata=#lib::A.bar??] [@vm.inferred-type.metadata=dart.async::_Future (receiver not int)] _in::unsafeCast<dynamic>(:async_temporary_0).bar(:result), :async_op_then, :async_op_error, :async_op) in null;
         :result;
       }
       asy::_completeOnAsyncReturn(:async_completer, :return_value);
       return;
     }
     on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
-      [@vm.direct-call.metadata=_AsyncAwaitCompleter.completeError] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::Completer::completeError}(exception, stack_trace);
+      [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.completeError] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::Completer::completeError}(exception, stack_trace);
     }
   :async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
   :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
   :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
-  [@vm.direct-call.metadata=_AsyncAwaitCompleter.start] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
-  return [@vm.direct-call.metadata=_AsyncAwaitCompleter.future] [@vm.inferred-type.metadata=dart.async::_Future] :async_completer.{asy::Completer::future};
+  [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.start] [@vm.inferred-type.metadata=!? (skip check)] :async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
+  return [@vm.direct-call.metadata=dart.async::_AsyncAwaitCompleter.future] [@vm.inferred-type.metadata=dart.async::_Future] :async_completer.{asy::Completer::future};
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/bench_is_prime.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/bench_is_prime.dart.expect
index 223a0ed..186ea40 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/bench_is_prime.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/bench_is_prime.dart.expect
@@ -4,19 +4,19 @@
 import "dart:_internal" as _in;
 
 [@vm.unboxing-info.metadata=(i)->b]static method isPrime([@vm.inferred-type.metadata=int] dynamic n) → core::bool* {
-  if(_in::unsafeCast<core::bool*>([@vm.direct-call.metadata=_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool] n.<(2)))
+  if(_in::unsafeCast<core::bool*>([@vm.direct-call.metadata=dart.core::_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool] n.<(2)))
     return false;
-  for (core::int* i = 2; [@vm.direct-call.metadata=_IntegerImplementation.<=] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.direct-call.metadata=_IntegerImplementation.*] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::*}(i).{core::num::<=}(_in::unsafeCast<core::num>(n)); i = [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
-    if([@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.direct-call.metadata=_IntegerImplementation.%] [@vm.inferred-type.metadata=int] n.%(i).{core::Object::==}(0))
+  for (core::int* i = 2; [@vm.direct-call.metadata=dart.core::_IntegerImplementation.<=] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.direct-call.metadata=dart.core::_IntegerImplementation.*] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::*}(i).{core::num::<=}(_in::unsafeCast<core::num>(n)); i = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
+    if([@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.direct-call.metadata=dart.core::_IntegerImplementation.%] [@vm.inferred-type.metadata=int] n.%(i).{core::Object::==}(0))
       return false;
   }
   return true;
 }
 [@vm.unboxing-info.metadata=(i)->b]static method nThPrimeNumber([@vm.inferred-type.metadata=dart.core::_Smi (value: 50000)] core::int* n) → core::int* {
   core::int* counter = 0;
-  for (core::int* i = 1; ; i = [@vm.direct-call.metadata=_IntegerImplementation.+??] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
+  for (core::int* i = 1; ; i = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+??] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
     if([@vm.inferred-type.metadata=dart.core::bool] self::isPrime(i))
-      counter = [@vm.direct-call.metadata=_IntegerImplementation.+??] [@vm.inferred-type.metadata=int (skip check)] counter.{core::num::+}(1);
+      counter = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+??] [@vm.inferred-type.metadata=int (skip check)] counter.{core::num::+}(1);
     if([@vm.inferred-type.metadata=dart.core::bool] counter.{core::num::==}(n)) {
       return i;
     }
@@ -31,11 +31,11 @@
 }
 static method main(core::List<core::String*>* args) → dynamic {
   core::Stopwatch* timer = let final core::Stopwatch #t1 = new core::Stopwatch::•() in block {
-    [@vm.direct-call.metadata=Stopwatch.start] [@vm.inferred-type.metadata=!? (skip check)] #t1.{core::Stopwatch::start}();
+    [@vm.direct-call.metadata=dart.core::Stopwatch.start] [@vm.inferred-type.metadata=!? (skip check)] #t1.{core::Stopwatch::start}();
   } =>#t1;
-  for (core::int* i = 0; [@vm.direct-call.metadata=_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i.{core::num::<}(100); i = [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
+  for (core::int* i = 0; [@vm.direct-call.metadata=dart.core::_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i.{core::num::<}(100); i = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
     self::run();
   }
-  [@vm.direct-call.metadata=Stopwatch.stop] [@vm.inferred-type.metadata=!? (skip check)] timer.{core::Stopwatch::stop}();
-  core::print("Elapsed ${[@vm.direct-call.metadata=Stopwatch.elapsedMilliseconds] timer.{core::Stopwatch::elapsedMilliseconds}}ms");
+  [@vm.direct-call.metadata=dart.core::Stopwatch.stop] [@vm.inferred-type.metadata=!? (skip check)] timer.{core::Stopwatch::stop}();
+  core::print("Elapsed ${[@vm.direct-call.metadata=dart.core::Stopwatch.elapsedMilliseconds] timer.{core::Stopwatch::elapsedMilliseconds}}ms");
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/bench_vector.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/bench_vector.dart.expect
index d941915..5fa2ddf 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/bench_vector.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/bench_vector.dart.expect
@@ -13,14 +13,14 @@
     : self::_Vector::_offset = 0, self::_Vector::_length = size, self::_Vector::_elements = [@vm.inferred-type.metadata=dart.typed_data::_Float64List] typ::Float64List::•(size), super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasTearOffUses:false,methodOrSetterSelectorId:1] [@vm.unboxing-info.metadata=(b)->d]  operator []([@vm.inferred-type.metadata=!] core::int* i) → core::double*
-    return [@vm.direct-call.metadata=_Float64List.[]] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.direct-call.metadata=_Vector._elements] [@vm.inferred-type.metadata=dart.typed_data::_Float64List] this.{self::_Vector::_elements}.{core::List::[]}([@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}([@vm.direct-call.metadata=_Vector._offset] [@vm.inferred-type.metadata=dart.core::_Smi (value: 0)] this.{self::_Vector::_offset}));
+    return [@vm.direct-call.metadata=dart.typed_data::_Float64List.[]] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.direct-call.metadata=#lib::_Vector._elements] [@vm.inferred-type.metadata=dart.typed_data::_Float64List] this.{self::_Vector::_elements}.{core::List::[]}([@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}([@vm.direct-call.metadata=#lib::_Vector._offset] [@vm.inferred-type.metadata=dart.core::_Smi (value: 0)] this.{self::_Vector::_offset}));
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:2]  operator []=([@vm.inferred-type.metadata=dart.core::_OneByteString] core::int* i, core::double* value) → void {
-    let dynamic #t1 = [@vm.direct-call.metadata=_Vector._elements] [@vm.inferred-type.metadata=dart.typed_data::_Float64List] this.{self::_Vector::_elements} in let dynamic #t2 = [@vm.direct-call.metadata=_Vector._offset] [@vm.inferred-type.metadata=dart.core::_Smi (value: 0)] this.{self::_Vector::_offset} in throw "Attempt to execute code removed by Dart AOT compiler (TFA)";
+    let dynamic #t1 = [@vm.direct-call.metadata=#lib::_Vector._elements] [@vm.inferred-type.metadata=dart.typed_data::_Float64List] this.{self::_Vector::_elements} in let dynamic #t2 = [@vm.direct-call.metadata=#lib::_Vector._offset] [@vm.inferred-type.metadata=dart.core::_Smi (value: 0)] this.{self::_Vector::_offset} in throw "Attempt to execute code removed by Dart AOT compiler (TFA)";
   }
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3] [@vm.unboxing-info.metadata=(b)->d]  operator *([@vm.inferred-type.metadata=#lib::_Vector?] self::_Vector* a) → core::double* {
     core::double* result = 0.0;
-    for (core::int* i = 0; [@vm.direct-call.metadata=_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i.{core::num::<}([@vm.direct-call.metadata=_Vector._length] [@vm.inferred-type.metadata=dart.core::_Smi (value: 10)] this.{self::_Vector::_length}); i = [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1))
-      result = [@vm.direct-call.metadata=_Double.+??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] result.{core::double::+}([@vm.direct-call.metadata=_Double.*] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.direct-call.metadata=_Vector.[]] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] this.{self::_Vector::[]}(i).{core::double::*}([@vm.direct-call.metadata=_Vector.[]??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] a.{self::_Vector::[]}(i)));
+    for (core::int* i = 0; [@vm.direct-call.metadata=dart.core::_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i.{core::num::<}([@vm.direct-call.metadata=#lib::_Vector._length] [@vm.inferred-type.metadata=dart.core::_Smi (value: 10)] this.{self::_Vector::_length}); i = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1))
+      result = [@vm.direct-call.metadata=dart.core::_Double.+??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] result.{core::double::+}([@vm.direct-call.metadata=dart.core::_Double.*] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.direct-call.metadata=#lib::_Vector.[]] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] this.{self::_Vector::[]}(i).{core::double::*}([@vm.direct-call.metadata=#lib::_Vector.[]??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] a.{self::_Vector::[]}(i)));
     return result;
   }
 }
@@ -28,11 +28,11 @@
 [@vm.inferred-type.metadata=dart.core::_Double?]static field core::double* x = 0.0;
 static method main(core::List<core::String*>* args) → dynamic {
   core::Stopwatch* timer = let final core::Stopwatch #t3 = new core::Stopwatch::•() in block {
-    [@vm.direct-call.metadata=Stopwatch.start] [@vm.inferred-type.metadata=!? (skip check)] #t3.{core::Stopwatch::start}();
+    [@vm.direct-call.metadata=dart.core::Stopwatch.start] [@vm.inferred-type.metadata=!? (skip check)] #t3.{core::Stopwatch::start}();
   } =>#t3;
-  for (core::int* i = 0; [@vm.direct-call.metadata=_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i.{core::num::<}(100000000); i = [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
-    self::x = [@vm.direct-call.metadata=_Double.+??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.inferred-type.metadata=dart.core::_Double?] self::x.{core::double::+}([@vm.direct-call.metadata=_Vector.*??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.inferred-type.metadata=#lib::_Vector?] self::v.{self::_Vector::*}([@vm.inferred-type.metadata=#lib::_Vector?] self::v));
+  for (core::int* i = 0; [@vm.direct-call.metadata=dart.core::_IntegerImplementation.<] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i.{core::num::<}(100000000); i = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] i.{core::num::+}(1)) {
+    self::x = [@vm.direct-call.metadata=dart.core::_Double.+??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.inferred-type.metadata=dart.core::_Double?] self::x.{core::double::+}([@vm.direct-call.metadata=#lib::_Vector.*??] [@vm.inferred-type.metadata=dart.core::_Double (skip check)] [@vm.inferred-type.metadata=#lib::_Vector?] self::v.{self::_Vector::*}([@vm.inferred-type.metadata=#lib::_Vector?] self::v));
   }
-  [@vm.direct-call.metadata=Stopwatch.stop] [@vm.inferred-type.metadata=!? (skip check)] timer.{core::Stopwatch::stop}();
-  core::print("Elapsed ${[@vm.direct-call.metadata=Stopwatch.elapsedMilliseconds] timer.{core::Stopwatch::elapsedMilliseconds}}ms, result ${self::x}");
+  [@vm.direct-call.metadata=dart.core::Stopwatch.stop] [@vm.inferred-type.metadata=!? (skip check)] timer.{core::Stopwatch::stop}();
+  core::print("Elapsed ${[@vm.direct-call.metadata=dart.core::Stopwatch.elapsedMilliseconds] timer.{core::Stopwatch::elapsedMilliseconds}}ms, result ${self::x}");
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_basic.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_basic.dart.expect
index bb31725..933de35 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_basic.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_basic.dart.expect
@@ -23,7 +23,7 @@
     : super self::C::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method foo() → dynamic
-    return [@vm.inferred-type.metadata=#lib::D<InterfaceType(String*)>] super.{self::C::foo}();
+    return [@vm.inferred-type.metadata=#lib::D<dart.core::String*>] super.{self::C::foo}();
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method bar() → dynamic
     return new self::D::•<self::E::S*>();
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method baz() → dynamic
@@ -59,18 +59,18 @@
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:11,getterSelectorId:12]  method id3([@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.0)] generic-covariant-impl core::Comparable<self::C2::T*>* x) → dynamic
     return x;
-[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:13,getterSelectorId:14]  method id4([@vm.inferred-type.metadata=#lib::K<InterfaceType(J*)> (skip check)] generic-covariant-impl self::K<self::I<self::C2::T*>*>* x) → dynamic
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:13,getterSelectorId:14]  method id4([@vm.inferred-type.metadata=#lib::K<#lib::J*> (skip check)] generic-covariant-impl self::K<self::I<self::C2::T*>*>* x) → dynamic
     return x;
 }
 static method main() → dynamic {
-  core::print([@vm.direct-call.metadata=C.foo] [@vm.inferred-type.metadata=#lib::D<InterfaceType(int*)> (skip check)] new self::C::•<core::int*>().{self::C::foo}());
-  core::print([@vm.direct-call.metadata=E.foo] [@vm.inferred-type.metadata=#lib::D<InterfaceType(String*)> (skip check)] new self::E::•<core::int*, core::String*>().{self::E::foo}());
-  core::print([@vm.direct-call.metadata=E.bar] [@vm.inferred-type.metadata=#lib::D<InterfaceType(int*)> (skip check)] new self::E::•<core::int*, core::String*>().{self::E::bar}());
-  core::print([@vm.direct-call.metadata=E.baz] [@vm.inferred-type.metadata=#lib::D<InterfaceType(String*)> (skip check)] new self::E::•<core::int*, core::String*>().{self::E::baz}());
+  core::print([@vm.direct-call.metadata=#lib::C.foo] [@vm.inferred-type.metadata=#lib::D<dart.core::int*> (skip check)] new self::C::•<core::int*>().{self::C::foo}());
+  core::print([@vm.direct-call.metadata=#lib::E.foo] [@vm.inferred-type.metadata=#lib::D<dart.core::String*> (skip check)] new self::E::•<core::int*, core::String*>().{self::E::foo}());
+  core::print([@vm.direct-call.metadata=#lib::E.bar] [@vm.inferred-type.metadata=#lib::D<dart.core::int*> (skip check)] new self::E::•<core::int*, core::String*>().{self::E::bar}());
+  core::print([@vm.direct-call.metadata=#lib::E.baz] [@vm.inferred-type.metadata=#lib::D<dart.core::String*> (skip check)] new self::E::•<core::int*, core::String*>().{self::E::baz}());
   self::C<self::X*>* c = new self::C::•<self::Y*>();
-  [@vm.call-site-attributes.metadata=receiverType:InterfaceType(C<X*>*)] [@vm.direct-call.metadata=C.id1] [@vm.inferred-type.metadata=!? (skip check)] c.{self::C::id1}(new self::Y::•());
-  [@vm.call-site-attributes.metadata=receiverType:InterfaceType(C<X*>*)] [@vm.direct-call.metadata=C.id2] c.{self::C::id2}(new self::Z::•());
+  [@vm.call-site-attributes.metadata=receiverType:#lib::C<#lib::X*>*] [@vm.direct-call.metadata=#lib::C.id1] [@vm.inferred-type.metadata=!? (skip check)] c.{self::C::id1}(new self::Y::•());
+  [@vm.call-site-attributes.metadata=receiverType:#lib::C<#lib::X*>*] [@vm.direct-call.metadata=#lib::C.id2] c.{self::C::id2}(new self::Z::•());
   self::C2<core::num*>* c2 = new self::C2::•<core::num*>();
-  [@vm.call-site-attributes.metadata=receiverType:InterfaceType(C2<num*>*)] [@vm.direct-call.metadata=C2.id3] [@vm.inferred-type.metadata=!? (skip check)] c2.{self::C2::id3}(3.0);
-  [@vm.call-site-attributes.metadata=receiverType:InterfaceType(C2<num*>*)] [@vm.direct-call.metadata=C2.id4] [@vm.inferred-type.metadata=!? (skip check)] c2.{self::C2::id4}(new self::K::•<self::J*>());
+  [@vm.call-site-attributes.metadata=receiverType:#lib::C2<dart.core::num*>*] [@vm.direct-call.metadata=#lib::C2.id3] [@vm.inferred-type.metadata=!? (skip check)] c2.{self::C2::id3}(3.0);
+  [@vm.call-site-attributes.metadata=receiverType:#lib::C2<dart.core::num*>*] [@vm.direct-call.metadata=#lib::C2.id4] [@vm.inferred-type.metadata=!? (skip check)] c2.{self::C2::id4}(new self::K::•<self::J*>());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_case1.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_case1.dart.expect
index 31c6266..4794d79 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_case1.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/class_generics_case1.dart.expect
@@ -10,16 +10,16 @@
     ;
 }
 class InheritedElement extends self::Element {
-[@vm.inferred-type.metadata=dart.collection::_InternalLinkedHashMap<InterfaceType(Element*), InterfaceType(Object*)>] [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  final field core::Map<self::Element*, core::Object*>* _dependents = <self::Element*, core::Object*>{};
+[@vm.inferred-type.metadata=dart.collection::_InternalLinkedHashMap<#lib::Element*, dart.core::Object*>] [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  final field core::Map<self::Element*, core::Object*>* _dependents = <self::Element*, core::Object*>{};
   synthetic constructor •() → self::InheritedElement*
     : super self::Element::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method setDependencies([@vm.inferred-type.metadata=!] self::Element* dependent, [@vm.inferred-type.metadata=dart.core::_Smi?] core::Object* value) → void {
-    [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Map<Element*, Object*>*)] [@vm.direct-call.metadata=__InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.[]=] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=InheritedElement._dependents] [@vm.inferred-type.metadata=dart.collection::_InternalLinkedHashMap<InterfaceType(Element*), InterfaceType(Object*)>] this.{self::InheritedElement::_dependents}.{core::Map::[]=}(dependent, value);
+    [@vm.call-site-attributes.metadata=receiverType:dart.core::Map<#lib::Element*, dart.core::Object*>*] [@vm.direct-call.metadata=dart.collection::__InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.[]=] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=#lib::InheritedElement._dependents] [@vm.inferred-type.metadata=dart.collection::_InternalLinkedHashMap<#lib::Element*, dart.core::Object*>] this.{self::InheritedElement::_dependents}.{core::Map::[]=}(dependent, value);
   }
 }
 static method main() → dynamic {
   self::InheritedElement* ie = new self::InheritedElement::•();
-  [@vm.direct-call.metadata=InheritedElement.setDependencies] [@vm.inferred-type.metadata=!? (skip check)] ie.{self::InheritedElement::setDependencies}(ie, 0);
-  [@vm.direct-call.metadata=InheritedElement.setDependencies] [@vm.inferred-type.metadata=!? (skip check)] ie.{self::InheritedElement::setDependencies}(new self::Element::•(), null);
+  [@vm.direct-call.metadata=#lib::InheritedElement.setDependencies] [@vm.inferred-type.metadata=!? (skip check)] ie.{self::InheritedElement::setDependencies}(ie, 0);
+  [@vm.direct-call.metadata=#lib::InheritedElement.setDependencies] [@vm.inferred-type.metadata=!? (skip check)] ie.{self::InheritedElement::setDependencies}(new self::Element::•(), null);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/const_prop.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/const_prop.dart.expect
index 4df916d..870e2ea 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/const_prop.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/const_prop.dart.expect
@@ -33,19 +33,19 @@
   core::print([@vm.inferred-type.metadata=dart.core::_Double (value: 100.0)] self::getD);
 }
 static method testStrings([@vm.inferred-type.metadata=#lib::A] self::A* a0, [@vm.inferred-type.metadata=dart.core::_OneByteString (value: bazz)] core::String* a1) → void {
-  core::print([@vm.direct-call.metadata=A.foo] [@vm.inferred-type.metadata=dart.core::_OneByteString (value: foo)] a0.{self::A::foo});
-  core::print([@vm.direct-call.metadata=A.getBar] [@vm.inferred-type.metadata=dart.core::_OneByteString (skip check) (value: bar)] a0.{self::A::getBar}());
+  core::print([@vm.direct-call.metadata=#lib::A.foo] [@vm.inferred-type.metadata=dart.core::_OneByteString (value: foo)] a0.{self::A::foo});
+  core::print([@vm.direct-call.metadata=#lib::A.getBar] [@vm.inferred-type.metadata=dart.core::_OneByteString (skip check) (value: bar)] a0.{self::A::getBar}());
   core::print(a1);
 }
-static method testPassEnum([@vm.inferred-type.metadata=#lib::B (value: #lib::B {index: 1, #lib::_name: B.b2, })] self::B* arg) → void {
+static method testPassEnum([@vm.inferred-type.metadata=#lib::B (value: const #lib::B{#lib::B.index: 1, #lib::B._name: B.b2})] self::B* arg) → void {
   self::testPassEnum2(arg);
 }
-static method testPassEnum2([@vm.inferred-type.metadata=#lib::B (value: #lib::B {index: 1, #lib::_name: B.b2, })] self::B* arg) → void {
+static method testPassEnum2([@vm.inferred-type.metadata=#lib::B (value: const #lib::B{#lib::B.index: 1, #lib::B._name: B.b2})] self::B* arg) → void {
   core::print(arg);
 }
 static method getList() → dynamic
   return #C6;
-static method testList([@vm.inferred-type.metadata=dart.core::_ImmutableList (value: ListConstant<int*>([1, 2, 3]))] dynamic arg1, [[@vm.inferred-type.metadata=dart.core::_ImmutableList (value: ListConstant<int*>([4, 5]))] dynamic arg2 = #C9]) → void {
+static method testList([@vm.inferred-type.metadata=dart.core::_ImmutableList (value: const <dart.core::int*>[1, 2, 3])] dynamic arg1, [[@vm.inferred-type.metadata=dart.core::_ImmutableList (value: const <dart.core::int*>[4, 5])] dynamic arg2 = #C9]) → void {
   core::print(arg1);
   core::print(arg2);
 }
@@ -56,5 +56,5 @@
   self::testDouble(3.14);
   self::testStrings(new self::A::•(), "bazz");
   self::testPassEnum(#C11);
-  self::testList([@vm.inferred-type.metadata=dart.core::_ImmutableList (value: ListConstant<int*>([1, 2, 3]))] self::getList());
+  self::testList([@vm.inferred-type.metadata=dart.core::_ImmutableList (value: const <dart.core::int*>[1, 2, 3])] self::getList());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/devirt.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/devirt.dart.expect
index 0c61a33..b8df814 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/devirt.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/devirt.dart.expect
@@ -40,16 +40,16 @@
   [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
 }
 static method callerA2([@vm.inferred-type.metadata=#lib::B] self::A* aa) → void {
-  [@vm.direct-call.metadata=B.foo] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
+  [@vm.direct-call.metadata=#lib::B.foo] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
 }
 static method callerA3([@vm.inferred-type.metadata=#lib::C] self::A* aa) → void {
-  [@vm.direct-call.metadata=C.foo] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
+  [@vm.direct-call.metadata=#lib::C.foo] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
 }
 static method callerA4([@vm.inferred-type.metadata=#lib::D?] self::A* aa) → void {
-  [@vm.direct-call.metadata=C.foo??] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
+  [@vm.direct-call.metadata=#lib::C.foo??] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::foo}();
 }
 static method callerE1([@vm.inferred-type.metadata=dart.core::_OneByteString (value: abc)] dynamic x) → void {
-  [@vm.direct-call.metadata=_StringBase.toString] [@vm.inferred-type.metadata=!? (skip check) (receiver not int)] x.{core::Object::toString}();
+  [@vm.direct-call.metadata=dart.core::_StringBase.toString] [@vm.inferred-type.metadata=!? (skip check) (receiver not int)] x.{core::Object::toString}();
 }
 static method callerE2([@vm.inferred-type.metadata=#lib::E?] dynamic x) → void {
   [@vm.inferred-type.metadata=!? (receiver not int)] x.{core::Object::toString}();
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/dynamic_list_access.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/dynamic_list_access.dart.expect
index edfeb7b..350004d 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/dynamic_list_access.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/dynamic_list_access.dart.expect
@@ -3,6 +3,6 @@
 import "dart:core" as core;
 
 static method main() → dynamic {
-  dynamic x = [@vm.inferred-type.metadata=dart.core::_List<InterfaceType(int*)>] core::_List::•<core::int*>(10);
-  [@vm.direct-call.metadata=_IntegerImplementation.+??] [@vm.direct-call.metadata=_List.[]] [@vm.inferred-type.metadata=int? (receiver not int)] x.[](0).+(10);
+  dynamic x = [@vm.inferred-type.metadata=dart.core::_List<dart.core::int*>] core::_List::•<core::int*>(10);
+  [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+??] [@vm.direct-call.metadata=dart.core::_List.[]] [@vm.inferred-type.metadata=int? (receiver not int)] x.[](0).+(10);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/future.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/future.dart.expect
index a75a010..56fcd59 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/future.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/future.dart.expect
@@ -9,27 +9,27 @@
   synthetic constructor •() → self::C<self::C::T*>*
     : super core::Object::•()
     ;
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method test2c([@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 3)] generic-covariant-impl asy::FutureOr<self::C::T*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method test3c([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(int*)> (skip check)] generic-covariant-impl asy::Future<self::C::T*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method test4c([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(int*)> (skip check)] generic-covariant-impl asy::FutureOr<self::C::T*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method test2r([@vm.inferred-type.metadata=#lib::C<InterfaceType(int*)> (skip check)] generic-covariant-impl self::C<asy::FutureOr<self::C::T*>*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method test3r([@vm.inferred-type.metadata=#lib::C<InterfaceType(Future<int*>*)> (skip check)] generic-covariant-impl self::C<asy::Future<self::C::T*>*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:11,getterSelectorId:12]  method test4r([@vm.inferred-type.metadata=#lib::C<InterfaceType(Future<int*>*)> (skip check)] generic-covariant-impl self::C<asy::FutureOr<self::C::T*>*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:13,getterSelectorId:14]  method test5r([@vm.inferred-type.metadata=#lib::C<InterfaceType(FutureOr<int*>*)>] generic-covariant-impl self::C<asy::Future<self::C::T*>*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:15,getterSelectorId:16]  method test6r([@vm.inferred-type.metadata=#lib::C<InterfaceType(FutureOr<int*>*)> (skip check)] generic-covariant-impl self::C<asy::FutureOr<self::C::T*>*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:17,getterSelectorId:18]  method test7r([@vm.inferred-type.metadata=#lib::C<InterfaceType(FutureOr<int*>*)>] generic-covariant-impl self::C<self::C::T*>* x) → void {}
-[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:19,getterSelectorId:20]  method test8r([@vm.inferred-type.metadata=#lib::C<InterfaceType(Future<int*>*)>] generic-covariant-impl self::C<self::C::T*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method test2c([@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 3)] generic-covariant-impl FutureOr<self::C::T*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method test3c([@vm.inferred-type.metadata=dart.async::_Future<dart.core::int*> (skip check)] generic-covariant-impl asy::Future<self::C::T*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method test4c([@vm.inferred-type.metadata=dart.async::_Future<dart.core::int*> (skip check)] generic-covariant-impl FutureOr<self::C::T*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method test2r([@vm.inferred-type.metadata=#lib::C<dart.core::int*> (skip check)] generic-covariant-impl self::C<FutureOr<self::C::T*>*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method test3r([@vm.inferred-type.metadata=#lib::C<dart.async::Future<dart.core::int*>*> (skip check)] generic-covariant-impl self::C<asy::Future<self::C::T*>*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:11,getterSelectorId:12]  method test4r([@vm.inferred-type.metadata=#lib::C<dart.async::Future<dart.core::int*>*> (skip check)] generic-covariant-impl self::C<FutureOr<self::C::T*>*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:13,getterSelectorId:14]  method test5r([@vm.inferred-type.metadata=#lib::C<FutureOr<dart.core::int*>?>] generic-covariant-impl self::C<asy::Future<self::C::T*>*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:15,getterSelectorId:16]  method test6r([@vm.inferred-type.metadata=#lib::C<FutureOr<dart.core::int*>?> (skip check)] generic-covariant-impl self::C<FutureOr<self::C::T*>*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:17,getterSelectorId:18]  method test7r([@vm.inferred-type.metadata=#lib::C<FutureOr<dart.core::int*>?>] generic-covariant-impl self::C<self::C::T*>* x) → void {}
+[@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:19,getterSelectorId:20]  method test8r([@vm.inferred-type.metadata=#lib::C<dart.async::Future<dart.core::int*>*>] generic-covariant-impl self::C<self::C::T*>* x) → void {}
 }
 static method main() → dynamic {
   dynamic c = new self::C::•<core::int*>();
-  [@vm.direct-call.metadata=C.test2c] [@vm.inferred-type.metadata=!? (receiver not int)] c.test2c(3);
-  [@vm.direct-call.metadata=C.test3c] [@vm.inferred-type.metadata=!? (receiver not int)] c.test3c([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(int*)>] asy::Future::value<core::int*>(3));
-  [@vm.direct-call.metadata=C.test4c] [@vm.inferred-type.metadata=!? (receiver not int)] c.test4c([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(int*)>] asy::Future::value<core::int*>(3));
-  [@vm.direct-call.metadata=C.test2r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test2r(new self::C::•<core::int*>());
-  [@vm.direct-call.metadata=C.test3r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test3r(new self::C::•<asy::Future<core::int*>*>());
-  [@vm.direct-call.metadata=C.test4r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test4r(new self::C::•<asy::Future<core::int*>*>());
-  [@vm.direct-call.metadata=C.test5r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test5r(new self::C::•<asy::FutureOr<core::int*>*>());
-  [@vm.direct-call.metadata=C.test6r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test6r(new self::C::•<asy::FutureOr<core::int*>*>());
-  [@vm.direct-call.metadata=C.test7r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test7r(new self::C::•<asy::FutureOr<core::int*>*>());
-  [@vm.direct-call.metadata=C.test8r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test8r(new self::C::•<asy::Future<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::C.test2c] [@vm.inferred-type.metadata=!? (receiver not int)] c.test2c(3);
+  [@vm.direct-call.metadata=#lib::C.test3c] [@vm.inferred-type.metadata=!? (receiver not int)] c.test3c([@vm.inferred-type.metadata=dart.async::_Future<dart.core::int*>] asy::Future::value<core::int*>(3));
+  [@vm.direct-call.metadata=#lib::C.test4c] [@vm.inferred-type.metadata=!? (receiver not int)] c.test4c([@vm.inferred-type.metadata=dart.async::_Future<dart.core::int*>] asy::Future::value<core::int*>(3));
+  [@vm.direct-call.metadata=#lib::C.test2r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test2r(new self::C::•<core::int*>());
+  [@vm.direct-call.metadata=#lib::C.test3r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test3r(new self::C::•<asy::Future<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::C.test4r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test4r(new self::C::•<asy::Future<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::C.test5r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test5r(new self::C::•<FutureOr<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::C.test6r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test6r(new self::C::•<FutureOr<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::C.test7r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test7r(new self::C::•<FutureOr<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::C.test8r] [@vm.inferred-type.metadata=!? (receiver not int)] c.test8r(new self::C::•<asy::Future<core::int*>*>());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/future_or.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/future_or.dart.expect
index c052dce..be9cfcc 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/future_or.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/future_or.dart.expect
@@ -16,11 +16,11 @@
     ;
 }
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
-static method foo1_a1([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(B*)>] dynamic x) → void {}
+static method foo1_a1([@vm.inferred-type.metadata=dart.async::_Future<#lib::B*>] dynamic x) → void {}
 static method foo1_a2([@vm.inferred-type.metadata=#lib::B] dynamic x) → void {}
-static method foo1_a3([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(B*)>] dynamic x) → void {}
+static method foo1_a3([@vm.inferred-type.metadata=dart.async::_Future<#lib::B*>] dynamic x) → void {}
 static method foo1_a4([@vm.inferred-type.metadata=#lib::B] dynamic x) → void {}
-static method foo1([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(B*)>] asy::Future<self::A*>* a1, [@vm.inferred-type.metadata=#lib::B] self::A* a2, [@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(B*)>] asy::FutureOr<self::A*>* a3, [@vm.inferred-type.metadata=#lib::B] asy::FutureOr<self::A*>* a4) → void {
+static method foo1([@vm.inferred-type.metadata=dart.async::_Future<#lib::B*>] asy::Future<self::A*>* a1, [@vm.inferred-type.metadata=#lib::B] self::A* a2, [@vm.inferred-type.metadata=dart.async::_Future<#lib::B*>] FutureOr<self::A*>* a3, [@vm.inferred-type.metadata=#lib::B] FutureOr<self::A*>* a4) → void {
   self::foo1_a1(a1);
   self::foo1_a2(a2);
   self::foo1_a3(a3);
@@ -30,15 +30,15 @@
 static method foo2_a2([@vm.inferred-type.metadata=#lib::B?] dynamic x) → void {}
 static method foo2_a3(dynamic x) → void {}
 static method foo2_a4(dynamic x) → void {}
-static method foo2([@vm.inferred-type.metadata=dart.async::_Future?] asy::Future<self::A*>* a1, [@vm.inferred-type.metadata=#lib::B?] self::A* a2, asy::FutureOr<self::A*>* a3, asy::FutureOr<self::A*>* a4) → void {
+static method foo2([@vm.inferred-type.metadata=dart.async::_Future?] asy::Future<self::A*>* a1, [@vm.inferred-type.metadata=#lib::B?] self::A* a2, FutureOr<self::A*>* a3, FutureOr<self::A*>* a4) → void {
   self::foo2_a1(a1);
   self::foo2_a2(a2);
   self::foo2_a3(a3);
   self::foo2_a4(a4);
 }
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method main(core::List<core::String*>* args) → dynamic {
-  self::foo1([@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(B*)>] asy::Future::value<self::B*>(new self::B::•()), new self::B::•(), [@vm.inferred-type.metadata=dart.async::_Future<InterfaceType(B*)>] asy::Future::value<self::B*>(new self::B::•()), new self::B::•());
-  self::foo2(self::getDynamic() as{TypeError,ForDynamic} asy::Future<self::A*>*, self::getDynamic() as{TypeError,ForDynamic} self::A*, self::getDynamic() as{TypeError,ForDynamic} asy::FutureOr<self::A*>*, self::getDynamic() as{TypeError,ForDynamic} asy::FutureOr<self::A*>*);
+  self::foo1([@vm.inferred-type.metadata=dart.async::_Future<#lib::B*>] asy::Future::value<self::B*>(new self::B::•()), new self::B::•(), [@vm.inferred-type.metadata=dart.async::_Future<#lib::B*>] asy::Future::value<self::B*>(new self::B::•()), new self::B::•());
+  self::foo2(self::getDynamic() as{TypeError,ForDynamic} asy::Future<self::A*>*, self::getDynamic() as{TypeError,ForDynamic} self::A*, self::getDynamic() as{TypeError,ForDynamic} FutureOr<self::A*>*, self::getDynamic() as{TypeError,ForDynamic} FutureOr<self::A*>*);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect
index 49806f3..10a2f26 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect
@@ -54,7 +54,7 @@
     : self::StreamView::_stream = stream, super self::Stream::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method foobar([@vm.inferred-type.metadata=dart.core::Null? (value: null)] (dynamic) →* void onData, {[@vm.inferred-type.metadata=dart.core::Null? (value: null)] core::Function* onError = #C1}) → self::StreamSubscription* {
-    return [@vm.direct-call.metadata=StreamView._stream] [@vm.inferred-type.metadata=!] this.{self::StreamView::_stream}.{self::Stream::foobar}(onData, onError: onError);
+    return [@vm.direct-call.metadata=#lib::StreamView._stream] [@vm.inferred-type.metadata=!] this.{self::StreamView::_stream}.{self::Stream::foobar}(onData, onError: onError);
   }
 }
 class ByteStream extends self::StreamView {
@@ -83,32 +83,32 @@
 }
 static method round1({[@vm.inferred-type.metadata=dart.core::Null? (value: null)] (dynamic) →* void onData = #C1}) → void {
   self::ByteStream* x = new self::ByteStream::•(new self::ByteStream::•(new self::_GeneratedStreamImpl::•()));
-  [@vm.direct-call.metadata=ByteStream.super_foobar1] [@vm.inferred-type.metadata=!? (skip check)] x.{self::ByteStream::super_foobar1}(onData);
+  [@vm.direct-call.metadata=#lib::ByteStream.super_foobar1] [@vm.inferred-type.metadata=!? (skip check)] x.{self::ByteStream::super_foobar1}(onData);
 }
 static method round2({[@vm.inferred-type.metadata=dart.core::Null? (value: null)] (dynamic) →* void onData = #C1, [@vm.inferred-type.metadata=dart.core::Null? (value: null)] core::Function* onError = #C1}) → void {
   new self::_ControllerStream::•();
   self::Stream* x = new self::_GeneratedStreamImpl::•();
   x = new self::ByteStream::•(x);
-  [@vm.direct-call.metadata=StreamView.foobar] [@vm.inferred-type.metadata=!? (skip check)] x.{self::Stream::foobar}(onData, onError: onError);
+  [@vm.direct-call.metadata=#lib::StreamView.foobar] [@vm.inferred-type.metadata=!? (skip check)] x.{self::Stream::foobar}(onData, onError: onError);
 }
 static method round3({[@vm.inferred-type.metadata=dart.core::Null? (value: null)] (dynamic) →* void onData = #C1, [@vm.inferred-type.metadata=dart.core::Null? (value: null)] core::Function* onError = #C1}) → void {
   self::Stream* x = new self::_GeneratedStreamImpl::•();
   x = new self::ByteStream::•(x);
   x = new self::_ControllerStream::•();
-  [@vm.direct-call.metadata=_StreamImpl.foobar] [@vm.inferred-type.metadata=!? (skip check)] x.{self::Stream::foobar}(onData, onError: onError);
+  [@vm.direct-call.metadata=#lib::_StreamImpl.foobar] [@vm.inferred-type.metadata=!? (skip check)] x.{self::Stream::foobar}(onData, onError: onError);
 }
 static method round4({[@vm.inferred-type.metadata=dart.core::Null? (value: null)] (dynamic) →* void onData = #C1}) → void {
   self::ByteStream* x = new self::ByteStream::•(new self::_ControllerStream::•());
-  self::Stream* y = [@vm.direct-call.metadata=ByteStream.super_stream] [@vm.inferred-type.metadata=!] x.{self::ByteStream::super_stream};
-  self::Stream* z = [@vm.direct-call.metadata=StreamView._stream] [@vm.inferred-type.metadata=!] x.{self::StreamView::_stream};
-  if([@vm.direct-call.metadata=Object.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] y.{self::Stream::==}(z)) {
-    [@vm.direct-call.metadata=ByteStream.super_foobar2] [@vm.inferred-type.metadata=!? (skip check)] x.{self::ByteStream::super_foobar2}(onData);
+  self::Stream* y = [@vm.direct-call.metadata=#lib::ByteStream.super_stream] [@vm.inferred-type.metadata=!] x.{self::ByteStream::super_stream};
+  self::Stream* z = [@vm.direct-call.metadata=#lib::StreamView._stream] [@vm.inferred-type.metadata=!] x.{self::StreamView::_stream};
+  if([@vm.direct-call.metadata=dart.core::Object.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] y.{self::Stream::==}(z)) {
+    [@vm.direct-call.metadata=#lib::ByteStream.super_foobar2] [@vm.inferred-type.metadata=!? (skip check)] x.{self::ByteStream::super_foobar2}(onData);
   }
 }
 static method round5() → void {
   self::ByteStream* x = new self::ByteStream::•(new self::_GeneratedStreamImpl::•());
   new self::_HandleErrorStream::•();
-  [@vm.direct-call.metadata=ByteStream.super_foobar3] [@vm.inferred-type.metadata=!? (skip check)] x.{self::ByteStream::super_foobar3}();
+  [@vm.direct-call.metadata=#lib::ByteStream.super_foobar3] [@vm.inferred-type.metadata=!? (skip check)] x.{self::ByteStream::super_foobar3}();
 }
 static method main(core::List<core::String*>* args) → dynamic {
   new self::_GeneratedStreamImpl::•();
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_field_initializer.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_field_initializer.dart.expect
index 1d52abd..d11688a 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_field_initializer.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_field_initializer.dart.expect
@@ -34,11 +34,11 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method barL1() → dynamic
-    return [@vm.direct-call.metadata=DeepCaller1.barL2] [@vm.inferred-type.metadata=!? (skip check)] this.{self::DeepCaller1::barL2}();
+    return [@vm.direct-call.metadata=#lib::DeepCaller1.barL2] [@vm.inferred-type.metadata=!? (skip check)] this.{self::DeepCaller1::barL2}();
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method barL2() → dynamic
-    return [@vm.direct-call.metadata=DeepCaller1.barL3] [@vm.inferred-type.metadata=!? (skip check)] this.{self::DeepCaller1::barL3}();
+    return [@vm.direct-call.metadata=#lib::DeepCaller1.barL3] [@vm.inferred-type.metadata=!? (skip check)] this.{self::DeepCaller1::barL3}();
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method barL3() → dynamic
-    return [@vm.direct-call.metadata=DeepCaller1.barL4] [@vm.inferred-type.metadata=!? (skip check)] this.{self::DeepCaller1::barL4}();
+    return [@vm.direct-call.metadata=#lib::DeepCaller1.barL4] [@vm.inferred-type.metadata=!? (skip check)] this.{self::DeepCaller1::barL4}();
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method barL4() → dynamic
     return self::field1;
 }
@@ -53,26 +53,26 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method barL1([@vm.inferred-type.metadata=#lib::D] self::D* dd) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller2.barL2] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL2}(dd);
+    return [@vm.direct-call.metadata=#lib::DeepCaller2.barL2] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL2}(dd);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method barL2([@vm.inferred-type.metadata=#lib::D] self::D* dd) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller2.barL3] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL3}(dd);
+    return [@vm.direct-call.metadata=#lib::DeepCaller2.barL3] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL3}(dd);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method barL3([@vm.inferred-type.metadata=#lib::D] self::D* dd) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller2.barL4] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL4}(dd);
+    return [@vm.direct-call.metadata=#lib::DeepCaller2.barL4] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL4}(dd);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method barL4([@vm.inferred-type.metadata=#lib::D] self::D* dd) → dynamic
-    return [@vm.direct-call.metadata=D.field2] [@vm.inferred-type.metadata=!] dd.{self::D::field2};
+    return [@vm.direct-call.metadata=#lib::D.field2] [@vm.inferred-type.metadata=!] dd.{self::D::field2};
 }
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
 static field core::Object* field1 = [@vm.inferred-type.metadata=!] self::getValue();
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method getValue() → core::Object* {
   self::A* aa = self::getDynamic() as{TypeError,ForDynamic} self::A*;
   return [@vm.inferred-type.metadata=!] aa.{self::A::foo}();
 }
 static method use1([@vm.inferred-type.metadata=#lib::DeepCaller1] self::DeepCaller1* x) → dynamic
-  return [@vm.direct-call.metadata=DeepCaller1.barL1] [@vm.inferred-type.metadata=!? (skip check)] x.{self::DeepCaller1::barL1}();
+  return [@vm.direct-call.metadata=#lib::DeepCaller1.barL1] [@vm.inferred-type.metadata=!? (skip check)] x.{self::DeepCaller1::barL1}();
 static method use2([@vm.inferred-type.metadata=#lib::DeepCaller2] self::DeepCaller2* x) → dynamic
-  return [@vm.direct-call.metadata=DeepCaller2.barL1] [@vm.inferred-type.metadata=! (skip check)] x.{self::DeepCaller2::barL1}(new self::D::•());
+  return [@vm.direct-call.metadata=#lib::DeepCaller2.barL1] [@vm.inferred-type.metadata=! (skip check)] x.{self::DeepCaller2::barL1}(new self::D::•());
 static method createC() → dynamic {
   new self::C::•();
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class1.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class1.dart.expect
index 116da4d..8432b7e 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class1.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class1.dart.expect
@@ -25,15 +25,15 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method bar([@vm.inferred-type.metadata=#lib::B?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=B.foo??] [@vm.inferred-type.metadata=#lib::T1 (skip check)] aa.{self::A::foo}();
+    return [@vm.direct-call.metadata=#lib::B.foo??] [@vm.inferred-type.metadata=#lib::T1 (skip check)] aa.{self::A::foo}();
 }
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
 static method use1([@vm.inferred-type.metadata=#lib::Intermediate] self::Intermediate* i, [@vm.inferred-type.metadata=#lib::B?] self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=Intermediate.bar] [@vm.inferred-type.metadata=#lib::T1 (skip check)] i.{self::Intermediate::bar}(aa);
+  return [@vm.direct-call.metadata=#lib::Intermediate.bar] [@vm.inferred-type.metadata=#lib::T1 (skip check)] i.{self::Intermediate::bar}(aa);
 static method use2([@vm.inferred-type.metadata=#lib::Intermediate] self::Intermediate* i, [@vm.inferred-type.metadata=#lib::B?] self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=Intermediate.bar] [@vm.inferred-type.metadata=#lib::T1 (skip check)] i.{self::Intermediate::bar}(aa);
+  return [@vm.direct-call.metadata=#lib::Intermediate.bar] [@vm.inferred-type.metadata=#lib::T1 (skip check)] i.{self::Intermediate::bar}(aa);
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method allocateB() → dynamic {
   new self::B::•();
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class2.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class2.dart.expect
index 370c5fa..78761af 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class2.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_class2.dart.expect
@@ -53,13 +53,13 @@
 }
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
 static method use1([@vm.inferred-type.metadata=#lib::Intermediate] self::Intermediate* i, self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=Intermediate.bar] [@vm.inferred-type.metadata=! (skip check)] i.{self::Intermediate::bar}(aa);
+  return [@vm.direct-call.metadata=#lib::Intermediate.bar] [@vm.inferred-type.metadata=! (skip check)] i.{self::Intermediate::bar}(aa);
 static method use2([@vm.inferred-type.metadata=#lib::Intermediate] self::Intermediate* i, self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=Intermediate.bar] [@vm.inferred-type.metadata=! (skip check)] i.{self::Intermediate::bar}(aa);
+  return [@vm.direct-call.metadata=#lib::Intermediate.bar] [@vm.inferred-type.metadata=! (skip check)] i.{self::Intermediate::bar}(aa);
 static method use3([@vm.inferred-type.metadata=#lib::Intermediate] self::Intermediate* i, self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=Intermediate.bar] [@vm.inferred-type.metadata=! (skip check)] i.{self::Intermediate::bar}(aa);
+  return [@vm.direct-call.metadata=#lib::Intermediate.bar] [@vm.inferred-type.metadata=! (skip check)] i.{self::Intermediate::bar}(aa);
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method allocateB() → dynamic {
   new self::B::•();
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_dynamic_target.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_dynamic_target.dart.expect
index 5af2ba3..c86de6e 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_dynamic_target.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_new_dynamic_target.dart.expect
@@ -49,7 +49,7 @@
 static method use_bazz(dynamic x) → dynamic
   return [@vm.inferred-type.metadata=#lib::T3] x.bazz();
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method allocateA() → dynamic {
   new self::A::•();
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field.dart.expect
index 4a4b80c..033e822 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field.dart.expect
@@ -24,36 +24,36 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method barL1([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller1.barL2] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::DeepCaller1::barL2}(aa);
+    return [@vm.direct-call.metadata=#lib::DeepCaller1.barL2] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::DeepCaller1::barL2}(aa);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method barL2([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller1.barL3] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::DeepCaller1::barL3}(aa);
+    return [@vm.direct-call.metadata=#lib::DeepCaller1.barL3] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::DeepCaller1::barL3}(aa);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method barL3([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller1.barL4] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::DeepCaller1::barL4}(aa);
+    return [@vm.direct-call.metadata=#lib::DeepCaller1.barL4] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::DeepCaller1::barL4}(aa);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:11,getterSelectorId:12]  method barL4([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=A.field1??] [@vm.inferred-type.metadata=#lib::T1] aa.{self::A::field1};
+    return [@vm.direct-call.metadata=#lib::A.field1??] [@vm.inferred-type.metadata=#lib::T1] aa.{self::A::field1};
 }
 class DeepCaller2 extends core::Object {
   synthetic constructor •() → self::DeepCaller2*
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method barL1([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller2.barL2] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL2}(aa);
+    return [@vm.direct-call.metadata=#lib::DeepCaller2.barL2] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL2}(aa);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method barL2([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller2.barL3] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL3}(aa);
+    return [@vm.direct-call.metadata=#lib::DeepCaller2.barL3] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL3}(aa);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:9,getterSelectorId:10]  method barL3([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=DeepCaller2.barL4] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL4}(aa);
+    return [@vm.direct-call.metadata=#lib::DeepCaller2.barL4] [@vm.inferred-type.metadata=! (skip check)] this.{self::DeepCaller2::barL4}(aa);
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:11,getterSelectorId:12]  method barL4([@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-    return [@vm.direct-call.metadata=A.field2??] [@vm.inferred-type.metadata=!] aa.{self::A::field2};
+    return [@vm.direct-call.metadata=#lib::A.field2??] [@vm.inferred-type.metadata=!] aa.{self::A::field2};
 }
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
 static method use1([@vm.inferred-type.metadata=#lib::DeepCaller1] self::DeepCaller1* x, [@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=DeepCaller1.barL1] [@vm.inferred-type.metadata=#lib::T1 (skip check)] x.{self::DeepCaller1::barL1}(aa);
+  return [@vm.direct-call.metadata=#lib::DeepCaller1.barL1] [@vm.inferred-type.metadata=#lib::T1 (skip check)] x.{self::DeepCaller1::barL1}(aa);
 static method use2([@vm.inferred-type.metadata=#lib::DeepCaller2] self::DeepCaller2* x, [@vm.inferred-type.metadata=#lib::A?] self::A* aa) → dynamic
-  return [@vm.direct-call.metadata=DeepCaller2.barL1] [@vm.inferred-type.metadata=! (skip check)] x.{self::DeepCaller2::barL1}(aa);
+  return [@vm.direct-call.metadata=#lib::DeepCaller2.barL1] [@vm.inferred-type.metadata=! (skip check)] x.{self::DeepCaller2::barL1}(aa);
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method setField2([@vm.inferred-type.metadata=#lib::A] self::A* aa, [@vm.inferred-type.metadata=#lib::T2] dynamic value) → void {
-  [@vm.direct-call.metadata=A.field2] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::field2} = value;
+  [@vm.direct-call.metadata=#lib::A.field2] [@vm.inferred-type.metadata=!? (skip check)] aa.{self::A::field2} = value;
 }
 static method main(core::List<core::String*>* args) → dynamic {
   new self::A::•();
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field2.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field2.dart.expect
index 744a7c2..eb99c79 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field2.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_set_field2.dart.expect
@@ -28,8 +28,8 @@
     : self::Q::result = result, super core::Object::•()
     ;
 }
-static method foo1([@vm.inferred-type.metadata=dart.core::_GrowableList<InterfaceType(T1*)>] core::List<self::T1*>* list) → dynamic {
-  [@vm.direct-call.metadata=T3.run] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=T1.go??] [@vm.inferred-type.metadata=#lib::T3 (skip check)] [@vm.direct-call.metadata=Q.result??] [@vm.direct-call.metadata=ListIterable.first] [@vm.inferred-type.metadata=#lib::Q?] [@vm.direct-call.metadata=_ListBase&Object&ListMixin.map] [@vm.inferred-type.metadata=dart._internal::MappedListIterable<InterfaceType(T1*), ?> (skip check)] list.{core::Iterable::map}<self::Q<self::T1*>*>((self::T1* t1) → self::Q<self::T1*>* => new self::Q::•<self::T1*>(t1)).{core::Iterable::first}.{self::Q::result}.{self::T1::go}().{self::T3::run}();
+static method foo1([@vm.inferred-type.metadata=dart.core::_GrowableList<#lib::T1*>] core::List<self::T1*>* list) → dynamic {
+  [@vm.direct-call.metadata=#lib::T3.run] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=#lib::T1.go??] [@vm.inferred-type.metadata=#lib::T3 (skip check)] [@vm.direct-call.metadata=#lib::Q.result??] [@vm.direct-call.metadata=dart._internal::ListIterable.first] [@vm.inferred-type.metadata=#lib::Q?] [@vm.direct-call.metadata=dart.collection::_ListBase&Object&ListMixin.map] [@vm.inferred-type.metadata=dart._internal::MappedListIterable<#lib::T1*, ?> (skip check)] list.{core::Iterable::map}<self::Q<self::T1*>*>((self::T1* t1) → self::Q<self::T1*>* => new self::Q::•<self::T1*>(t1)).{core::Iterable::first}.{self::Q::result}.{self::T1::go}().{self::T3::run}();
 }
 static method foo2NewValue() → self::Q<dynamic>*
   return new self::Q::•<self::T2*>(new self::T2::•());
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_while_processing.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_while_processing.dart.expect
index da42b86..cb85a94 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_while_processing.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_while_processing.dart.expect
@@ -23,18 +23,18 @@
     : self::Point::x = x, super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method newPoint1() → self::Point*
-    return new self::Point::•([@vm.direct-call.metadata=Point.x] [@vm.inferred-type.metadata=!] this.{self::Point::x});
+    return new self::Point::•([@vm.direct-call.metadata=#lib::Point.x] [@vm.inferred-type.metadata=!] this.{self::Point::x});
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method newPoint2() → self::Point*
-    return new self::Point::•([@vm.direct-call.metadata=Point.x] [@vm.inferred-type.metadata=!] this.{self::Point::x});
+    return new self::Point::•([@vm.direct-call.metadata=#lib::Point.x] [@vm.inferred-type.metadata=!] this.{self::Point::x});
 }
 static method getX([@vm.inferred-type.metadata=#lib::Point] dynamic point) → dynamic {
-  [@vm.direct-call.metadata=Point.x] [@vm.inferred-type.metadata=!? (receiver not int)] point.x;
+  [@vm.direct-call.metadata=#lib::Point.x] [@vm.inferred-type.metadata=!? (receiver not int)] point.x;
 }
 static method main() → dynamic {
   self::Point* a = new self::Point::•(new self::T1::•());
-  core::print([@vm.direct-call.metadata=Point.x] [@vm.inferred-type.metadata=!] a.{self::Point::x});
+  core::print([@vm.direct-call.metadata=#lib::Point.x] [@vm.inferred-type.metadata=!] a.{self::Point::x});
   self::Point* c = new self::Point::•(new self::T2::•());
-  [@vm.direct-call.metadata=Point.x] [@vm.inferred-type.metadata=!] c.{self::Point::x}.{self::I::foo}();
-  self::getX([@vm.direct-call.metadata=Point.newPoint1] [@vm.inferred-type.metadata=#lib::Point (skip check)] a.{self::Point::newPoint1}());
-  self::getX([@vm.direct-call.metadata=Point.newPoint2] [@vm.inferred-type.metadata=#lib::Point (skip check)] a.{self::Point::newPoint2}());
+  [@vm.direct-call.metadata=#lib::Point.x] [@vm.inferred-type.metadata=!] c.{self::Point::x}.{self::I::foo}();
+  self::getX([@vm.direct-call.metadata=#lib::Point.newPoint1] [@vm.inferred-type.metadata=#lib::Point (skip check)] a.{self::Point::newPoint1}());
+  self::getX([@vm.direct-call.metadata=#lib::Point.newPoint2] [@vm.inferred-type.metadata=#lib::Point (skip check)] a.{self::Point::newPoint2}());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/named_params_shaking_test.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/named_params_shaking_test.dart.expect
index 4adf524..8db9738 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/named_params_shaking_test.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/named_params_shaking_test.dart.expect
@@ -18,14 +18,14 @@
 [@vm.inferred-type.metadata=int] [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  field core::int* x;
   constructor •() → self::TestNamedOrderSub*
     : self::TestNamedOrderSub::x = [@vm.inferred-type.metadata=int] self::dec(), dynamic #t5 = [@vm.inferred-type.metadata=int] self::inc(), dynamic #t6 = [@vm.inferred-type.metadata=int] self::inc(), dynamic #t7 = [@vm.inferred-type.metadata=int] self::inc(), dynamic #t8 = [@vm.inferred-type.metadata=int] self::dec(), super self::TestNamedOrderBase::•(#t5, #t8, #t7, #t6) {
-    exp::Expect::equals([@vm.direct-call.metadata=TestNamedOrderSub.x] [@vm.inferred-type.metadata=int] this.{self::TestNamedOrderSub::x}, 0);
+    exp::Expect::equals([@vm.direct-call.metadata=#lib::TestNamedOrderSub.x] [@vm.inferred-type.metadata=int] this.{self::TestNamedOrderSub::x}, 0);
   }
 }
 [@vm.inferred-type.metadata=int?]static field core::int* global = 0;
 [@vm.unboxing-info.metadata=()->i]static method inc() → core::int*
-  return self::global = [@vm.direct-call.metadata=_IntegerImplementation.+??] [@vm.inferred-type.metadata=int (skip check)] [@vm.inferred-type.metadata=int?] self::global.{core::num::+}(1);
+  return self::global = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+??] [@vm.inferred-type.metadata=int (skip check)] [@vm.inferred-type.metadata=int?] self::global.{core::num::+}(1);
 [@vm.unboxing-info.metadata=()->i]static method dec() → core::int*
-  return self::global = [@vm.inferred-type.metadata=int] math::max<core::int*>(0, self::global = [@vm.direct-call.metadata=_IntegerImplementation.-??] [@vm.inferred-type.metadata=int (skip check)] [@vm.inferred-type.metadata=int?] self::global.{core::num::-}(1));
+  return self::global = [@vm.inferred-type.metadata=int] math::max<core::int*>(0, self::global = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.-??] [@vm.inferred-type.metadata=int (skip check)] [@vm.inferred-type.metadata=int?] self::global.{core::num::-}(1));
 [@vm.unboxing-info.metadata=(i)->b]static method testNamedOrder([@vm.inferred-type.metadata=int] core::int* w, [@vm.inferred-type.metadata=int] core::int* x, [@vm.inferred-type.metadata=int] core::int* y, [@vm.inferred-type.metadata=int] core::int* z) → void {
   exp::Expect::equals(w, 1);
   exp::Expect::equals(z, 2);
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect
index aabf974..2b57885 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect
@@ -49,11 +49,11 @@
     return new self::T1::•();
   }
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:3]  no-such-method-forwarder get bar() → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=B.noSuchMethod] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::B.noSuchMethod] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  no-such-method-forwarder method foo() → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=B.noSuchMethod] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::B.noSuchMethod] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:4,getterSelectorId:5]  no-such-method-forwarder method bazz([@vm.inferred-type.metadata=dart.core::_Smi (value: 1)] dynamic a1, [@vm.inferred-type.metadata=dart.core::_Smi (value: 2)] dynamic a2, [@vm.inferred-type.metadata=dart.core::_Smi (value: 3)] dynamic a3, [[@vm.inferred-type.metadata=dart.core::_Smi (value: 4)] dynamic a4 = #C1, [@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic a5 = #C1]) → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=B.noSuchMethod] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[a1, a2, a3, a4, a5]), [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::B.noSuchMethod] [@vm.inferred-type.metadata=#lib::T1 (skip check)] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[a1, a2, a3, a4, a5]), [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 }
 abstract class C extends core::Object {
   synthetic constructor •() → self::C*
@@ -68,11 +68,11 @@
     : super self::C::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:3]  no-such-method-forwarder get bar() → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=C.noSuchMethod] [@vm.inferred-type.metadata=#lib::T2 (skip check)] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::C.noSuchMethod] [@vm.inferred-type.metadata=#lib::T2 (skip check)] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  no-such-method-forwarder method foo() → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=C.noSuchMethod] [@vm.inferred-type.metadata=#lib::T2 (skip check)] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::C.noSuchMethod] [@vm.inferred-type.metadata=#lib::T2 (skip check)] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 0, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:4,getterSelectorId:5]  no-such-method-forwarder method bazz([@vm.inferred-type.metadata=dart.core::_Smi (value: 1)] dynamic a1, [@vm.inferred-type.metadata=dart.core::_Smi (value: 2)] dynamic a2, [@vm.inferred-type.metadata=dart.core::_Smi (value: 3)] dynamic a3, [[@vm.inferred-type.metadata=dart.core::_Smi (value: 4)] dynamic a4 = #C1, [@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic a5 = #C1]) → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=C.noSuchMethod] [@vm.inferred-type.metadata=#lib::T2 (skip check)] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[a1, a2, a3, a4, a5]), [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::C.noSuchMethod] [@vm.inferred-type.metadata=#lib::T2 (skip check)] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 0, #C3, core::List::unmodifiable<dynamic>(<dynamic>[a1, a2, a3, a4, a5]), [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 }
 class E extends core::Object implements self::A {
   synthetic constructor •() → self::E*
@@ -82,7 +82,7 @@
     return new self::T4::•();
   }
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:3]  no-such-method-forwarder get bar() → dynamic
-    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=E.noSuchMethod] [@vm.inferred-type.metadata=#lib::T4 (skip check)] this.{self::E::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<InterfaceType(Symbol*), DynamicType(dynamic)>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
+    return _in::unsafeCast<dynamic>([@vm.direct-call.metadata=#lib::E.noSuchMethod] [@vm.inferred-type.metadata=#lib::T4 (skip check)] this.{self::E::noSuchMethod}(new core::_InvocationMirror::_withType(#C2, 1, #C3, #C4, [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView<dart.core::Symbol*, dynamic>] core::Map::unmodifiable<core::Symbol*, dynamic>(#C5))));
 }
 class F extends core::Object {
   synthetic constructor •() → self::F*
@@ -114,14 +114,14 @@
 [@vm.inferred-type.metadata=#lib::D?]static field self::A* dd = new self::D::•();
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method main(core::List<core::String*>* args) → dynamic {
-  core::print([@vm.direct-call.metadata=B.foo??] [@vm.inferred-type.metadata=#lib::T1 (skip check)] [@vm.inferred-type.metadata=#lib::B?] self::bb.{self::A::foo}());
-  core::print([@vm.direct-call.metadata=B.bar??] [@vm.inferred-type.metadata=#lib::T1] [@vm.inferred-type.metadata=#lib::B?] self::bb.{self::A::bar});
-  core::print([@vm.direct-call.metadata=B.bazz??] [@vm.inferred-type.metadata=#lib::T1 (skip check)] [@vm.inferred-type.metadata=#lib::B?] self::bb.{self::A::bazz}(1, 2, 3, 4));
-  core::print([@vm.direct-call.metadata=D.foo??] [@vm.inferred-type.metadata=#lib::T2 (skip check)] [@vm.inferred-type.metadata=#lib::D?] self::dd.{self::A::foo}());
-  core::print([@vm.direct-call.metadata=D.bar??] [@vm.inferred-type.metadata=#lib::T2] [@vm.inferred-type.metadata=#lib::D?] self::dd.{self::A::bar});
-  core::print([@vm.direct-call.metadata=D.bazz??] [@vm.inferred-type.metadata=#lib::T2 (skip check)] [@vm.inferred-type.metadata=#lib::D?] self::dd.{self::A::bazz}(1, 2, 3, 4));
+  core::print([@vm.direct-call.metadata=#lib::B.foo??] [@vm.inferred-type.metadata=#lib::T1 (skip check)] [@vm.inferred-type.metadata=#lib::B?] self::bb.{self::A::foo}());
+  core::print([@vm.direct-call.metadata=#lib::B.bar??] [@vm.inferred-type.metadata=#lib::T1] [@vm.inferred-type.metadata=#lib::B?] self::bb.{self::A::bar});
+  core::print([@vm.direct-call.metadata=#lib::B.bazz??] [@vm.inferred-type.metadata=#lib::T1 (skip check)] [@vm.inferred-type.metadata=#lib::B?] self::bb.{self::A::bazz}(1, 2, 3, 4));
+  core::print([@vm.direct-call.metadata=#lib::D.foo??] [@vm.inferred-type.metadata=#lib::T2 (skip check)] [@vm.inferred-type.metadata=#lib::D?] self::dd.{self::A::foo}());
+  core::print([@vm.direct-call.metadata=#lib::D.bar??] [@vm.inferred-type.metadata=#lib::T2] [@vm.inferred-type.metadata=#lib::D?] self::dd.{self::A::bar});
+  core::print([@vm.direct-call.metadata=#lib::D.bazz??] [@vm.inferred-type.metadata=#lib::T2 (skip check)] [@vm.inferred-type.metadata=#lib::D?] self::dd.{self::A::bazz}(1, 2, 3, 4));
   new self::E::•();
   self::A* xx = self::getDynamic() as{TypeError,ForDynamic} self::A*;
   core::print([@vm.inferred-type.metadata=!] xx.{self::A::bar});
@@ -131,6 +131,6 @@
   dynamic gg = new self::G::•();
   core::print([@vm.inferred-type.metadata=#lib::T5 (receiver not int)] gg.noSuchMethod(null, null));
   dynamic hh = new self::H::•();
-  core::print([@vm.direct-call.metadata=H.foo] [@vm.inferred-type.metadata=#lib::T6 (receiver not int)] hh.foo(right: 2, left: 1));
+  core::print([@vm.direct-call.metadata=#lib::H.foo] [@vm.inferred-type.metadata=#lib::T6 (receiver not int)] hh.foo(right: 2, left: 1));
   core::print([@vm.inferred-type.metadata=#lib::T7 (receiver not int)] hh.foo(left: 1, top: 2));
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/null_check_elimination_nnbd.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/null_check_elimination_nnbd.dart.expect
index 424703b..9d38510 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/null_check_elimination_nnbd.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/null_check_elimination_nnbd.dart.expect
@@ -13,17 +13,17 @@
 }
 [@vm.inferred-type.metadata=#lib::A?]static field self::A staticField = let core::String #t1 = "hi" in let core::String #t2 = "bye" in new self::A::•(#t1, #t2);
 static method testNonNullable([@vm.inferred-type.metadata=#lib::A?] self::A a) → dynamic
-  return _in::unsafeCast<core::String>([@vm.direct-call.metadata=A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable});
+  return _in::unsafeCast<core::String>([@vm.direct-call.metadata=#lib::A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable});
 static method testNullable([@vm.inferred-type.metadata=#lib::A?] self::A a) → dynamic
-  return [@vm.direct-call.metadata=A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}!;
+  return [@vm.direct-call.metadata=#lib::A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}!;
 static method testAlwaysNull([@vm.inferred-type.metadata=#lib::A?] self::A a) → dynamic
-  return [@vm.direct-call.metadata=A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull}!;
+  return [@vm.direct-call.metadata=#lib::A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull}!;
 static method main() → void {
   final core::List<self::A> list = <self::A>[let core::String #t3 = "foo" in let core::Null? #t4 = null in let core::Null? #t5 = null in new self::A::•(#t3, #t4, alwaysNull: #t5), self::staticField];
   {
-    core::Iterator<self::A> :sync-for-iterator = [@vm.direct-call.metadata=_GrowableList.iterator] [@vm.inferred-type.metadata=dart._internal::ListIterator<InterfaceType(A)>] list.{core::Iterable::iterator};
-    for (; [@vm.direct-call.metadata=ListIterator.moveNext] [@vm.inferred-type.metadata=dart.core::bool (skip check)] :sync-for-iterator.{core::Iterator::moveNext}(); ) {
-      self::A a = [@vm.direct-call.metadata=ListIterator.current] [@vm.inferred-type.metadata=#lib::A?] :sync-for-iterator.{core::Iterator::current};
+    core::Iterator<self::A> :sync-for-iterator = [@vm.direct-call.metadata=dart.core::_GrowableList.iterator] [@vm.inferred-type.metadata=dart._internal::ListIterator<#lib::A>] list.{core::Iterable::iterator};
+    for (; [@vm.direct-call.metadata=dart._internal::ListIterator.moveNext] [@vm.inferred-type.metadata=dart.core::bool (skip check)] :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+      self::A a = [@vm.direct-call.metadata=dart._internal::ListIterator.current] [@vm.inferred-type.metadata=#lib::A?] :sync-for-iterator.{core::Iterator::current};
       {
         self::testNonNullable(a);
         self::testNullable(a);
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/null_test_elimination.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/null_test_elimination.dart.expect
index efdb843..1e8033d2 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/null_test_elimination.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/null_test_elimination.dart.expect
@@ -13,49 +13,49 @@
 }
 [@vm.inferred-type.metadata=#lib::A?]static field self::A* staticField = let core::String* #t1 = "hi" in let core::String* #t2 = "bye" in new self::A::•(#t1, #t2);
 static method testNonNullableIf1([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic {
-  if(let dynamic #t3 = [@vm.direct-call.metadata=A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable} in false) {
+  if(let dynamic #t3 = [@vm.direct-call.metadata=#lib::A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable} in false) {
     core::print("null");
   }
 }
 static method testNullableIf1([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic {
-  if([@vm.direct-call.metadata=A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}.{core::String::==}(null)) {
+  if([@vm.direct-call.metadata=#lib::A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}.{core::String::==}(null)) {
     core::print("null");
   }
 }
 static method testAlwaysNullIf1([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic {
-  if(let dynamic #t4 = [@vm.direct-call.metadata=A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull} in true) {
+  if(let dynamic #t4 = [@vm.direct-call.metadata=#lib::A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull} in true) {
     core::print("null");
   }
 }
 static method testNonNullableIf2([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic {
-  if(!(let dynamic #t5 = [@vm.direct-call.metadata=A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable} in false) && _in::unsafeCast<core::bool*>([@vm.inferred-type.metadata=dart.core::bool] self::someCondition())) {
+  if(!(let dynamic #t5 = [@vm.direct-call.metadata=#lib::A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable} in false) && _in::unsafeCast<core::bool*>([@vm.inferred-type.metadata=dart.core::bool] self::someCondition())) {
     core::print("not null");
   }
 }
 static method testNullableIf2([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic {
-  if(![@vm.direct-call.metadata=A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}.{core::String::==}(null) && _in::unsafeCast<core::bool*>([@vm.inferred-type.metadata=dart.core::bool] self::someCondition())) {
+  if(![@vm.direct-call.metadata=#lib::A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}.{core::String::==}(null) && _in::unsafeCast<core::bool*>([@vm.inferred-type.metadata=dart.core::bool] self::someCondition())) {
     core::print("not null");
   }
 }
 static method testAlwaysNullIf2([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic {
-  if(!(let dynamic #t6 = [@vm.direct-call.metadata=A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull} in true) && _in::unsafeCast<core::bool*>([@vm.inferred-type.metadata=dart.core::bool] self::someCondition())) {
+  if(!(let dynamic #t6 = [@vm.direct-call.metadata=#lib::A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull} in true) && _in::unsafeCast<core::bool*>([@vm.inferred-type.metadata=dart.core::bool] self::someCondition())) {
     core::print("not null");
   }
 }
 static method testNonNullableCondExpr([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic
-  return !(let dynamic #t7 = [@vm.direct-call.metadata=A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable} in false) ?{core::String*} "not null" : "null";
+  return !(let dynamic #t7 = [@vm.direct-call.metadata=#lib::A.nonNullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString] a.{self::A::nonNullable} in false) ?{core::String*} "not null" : "null";
 static method testNullableCondExpr([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic
-  return ![@vm.direct-call.metadata=A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}.{core::String::==}(null) ?{core::String*} "not null" : "null";
+  return ![@vm.direct-call.metadata=#lib::A.nullable??] [@vm.inferred-type.metadata=dart.core::_OneByteString?] a.{self::A::nullable}.{core::String::==}(null) ?{core::String*} "not null" : "null";
 static method testAlwaysNullCondExpr([@vm.inferred-type.metadata=#lib::A?] self::A* a) → dynamic
-  return !(let dynamic #t8 = [@vm.direct-call.metadata=A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull} in true) ?{core::String*} "not null" : "null";
+  return !(let dynamic #t8 = [@vm.direct-call.metadata=#lib::A.alwaysNull??] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] a.{self::A::alwaysNull} in true) ?{core::String*} "not null" : "null";
 static method someCondition() → dynamic
-  return [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1);
+  return [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1);
 static method main() → void {
   final core::List<self::A*>* list = <self::A*>[let core::String* #t9 = "foo" in let core::Null? #t10 = null in let core::Null? #t11 = null in new self::A::•(#t9, #t10, alwaysNull: #t11), self::staticField];
   {
-    core::Iterator<self::A*>* :sync-for-iterator = [@vm.direct-call.metadata=_GrowableList.iterator] [@vm.inferred-type.metadata=dart._internal::ListIterator<InterfaceType(A*)>] list.{core::Iterable::iterator};
-    for (; [@vm.direct-call.metadata=ListIterator.moveNext] [@vm.inferred-type.metadata=dart.core::bool (skip check)] :sync-for-iterator.{core::Iterator::moveNext}(); ) {
-      self::A* a = [@vm.direct-call.metadata=ListIterator.current] [@vm.inferred-type.metadata=#lib::A?] :sync-for-iterator.{core::Iterator::current};
+    core::Iterator<self::A*>* :sync-for-iterator = [@vm.direct-call.metadata=dart.core::_GrowableList.iterator] [@vm.inferred-type.metadata=dart._internal::ListIterator<#lib::A*>] list.{core::Iterable::iterator};
+    for (; [@vm.direct-call.metadata=dart._internal::ListIterator.moveNext] [@vm.inferred-type.metadata=dart.core::bool (skip check)] :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+      self::A* a = [@vm.direct-call.metadata=dart._internal::ListIterator.current] [@vm.inferred-type.metadata=#lib::A?] :sync-for-iterator.{core::Iterator::current};
       {
         self::testNonNullableIf1(a);
         self::testNullableIf1(a);
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/param_types_before_strong_mode_checks.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/param_types_before_strong_mode_checks.dart.expect
index 34c4097..6e22591 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/param_types_before_strong_mode_checks.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/param_types_before_strong_mode_checks.dart.expect
@@ -19,7 +19,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method method1(self::T0* t0) → void {
-    [@vm.direct-call.metadata=T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
+    [@vm.direct-call.metadata=#lib::T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
   }
 }
 abstract class B extends core::Object {
@@ -30,7 +30,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method method2(covariant self::T0* t0) → void {
-    [@vm.direct-call.metadata=T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
+    [@vm.direct-call.metadata=#lib::T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
   }
 }
 class D extends core::Object {
@@ -38,26 +38,26 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method method3(self::T0* t0) → void {
-    [@vm.direct-call.metadata=T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
+    [@vm.direct-call.metadata=#lib::T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
   }
 }
 [@vm.inferred-type.metadata=dart.core::Null? (value: null)]static field core::Function* unknown;
 static method func1([@vm.inferred-type.metadata=#lib::T2?] self::T0* t0) → void {
-  [@vm.direct-call.metadata=T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
+  [@vm.direct-call.metadata=#lib::T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
 }
 static method func2(self::T0* t0) → void {
-  [@vm.direct-call.metadata=T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
+  [@vm.direct-call.metadata=#lib::T2.foo??] [@vm.inferred-type.metadata=!? (skip check)] t0.{self::T0::foo}();
 }
 static method getDynamic() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call();
 static method use(dynamic x) → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown.call(x);
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown.call(x);
 static method main(core::List<core::String*>* args) → dynamic {
   self::func1(self::getDynamic() as{TypeError,ForDynamic} self::T0*);
   self::use(#C1);
   self::use(new self::A::•().{self::A::method1});
   self::B* bb = self::getDynamic() as{TypeError,ForDynamic} self::B*;
-  [@vm.direct-call.metadata=C.method2??] [@vm.inferred-type.metadata=!? (skip check)] bb.{self::B::method2}(self::getDynamic());
+  [@vm.direct-call.metadata=#lib::C.method2??] [@vm.inferred-type.metadata=!? (skip check)] bb.{self::B::method2}(self::getDynamic());
   self::getDynamic().method3(self::getDynamic());
   new self::T2::•();
   new self::A::•();
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_37455.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_37455.dart.expect
index f9547a9..90edd27 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/regress_37455.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_37455.dart.expect
@@ -3,29 +3,29 @@
 import "dart:core" as core;
 
 class A extends core::Object {
-[@vm.inferred-type.metadata=dart.core::_GrowableList<DynamicType(dynamic)>] [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  final field core::List<dynamic>* afield;
-  constructor •([@vm.inferred-type.metadata=dart.core::_GrowableList<DynamicType(dynamic)>] core::List<dynamic>* afield) → self::A*
+[@vm.inferred-type.metadata=dart.core::_GrowableList<dynamic>] [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  final field core::List<dynamic>* afield;
+  constructor •([@vm.inferred-type.metadata=dart.core::_GrowableList<dynamic>] core::List<dynamic>* afield) → self::A*
     : self::A::afield = afield, super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method toString() → core::String*
-    return [@vm.direct-call.metadata=_GrowableList.toString] [@vm.inferred-type.metadata=!? (skip check) (receiver not int)] [@vm.direct-call.metadata=A.afield] [@vm.inferred-type.metadata=dart.core::_GrowableList<DynamicType(dynamic)>] this.{self::A::afield}.{core::Object::toString}();
+    return [@vm.direct-call.metadata=dart.core::_GrowableList.toString] [@vm.inferred-type.metadata=!? (skip check) (receiver not int)] [@vm.direct-call.metadata=#lib::A.afield] [@vm.inferred-type.metadata=dart.core::_GrowableList<dynamic>] this.{self::A::afield}.{core::Object::toString}();
 }
 class B extends core::Object {
   synthetic constructor •() → self::B*
     : super core::Object::•()
     ;
-[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method _foo([@vm.inferred-type.metadata=dart._internal::ListIterator<InterfaceType(int*)>] core::Iterator<core::int*>* iter) → core::List<dynamic>* {
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method _foo([@vm.inferred-type.metadata=dart._internal::ListIterator<dart.core::int*>] core::Iterator<core::int*>* iter) → core::List<dynamic>* {
     core::List<dynamic>* result = <dynamic>[];
-    while ([@vm.direct-call.metadata=ListIterator.moveNext] [@vm.inferred-type.metadata=dart.core::bool (skip check)] iter.{core::Iterator::moveNext}()) {
-      if([@vm.direct-call.metadata=_IntegerImplementation.<??] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.direct-call.metadata=ListIterator.current] [@vm.inferred-type.metadata=int?] iter.{core::Iterator::current}.{core::num::<}(0)) {
+    while ([@vm.direct-call.metadata=dart._internal::ListIterator.moveNext] [@vm.inferred-type.metadata=dart.core::bool (skip check)] iter.{core::Iterator::moveNext}()) {
+      if([@vm.direct-call.metadata=dart.core::_IntegerImplementation.<??] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.direct-call.metadata=dart._internal::ListIterator.current] [@vm.inferred-type.metadata=int?] iter.{core::Iterator::current}.{core::num::<}(0)) {
         return result;
       }
-      [@vm.call-site-attributes.metadata=receiverType:InterfaceType(List<dynamic>*)] [@vm.direct-call.metadata=_GrowableList.add] [@vm.inferred-type.metadata=!? (skip check)] result.{core::List::add}(new self::A::•([@vm.direct-call.metadata=B._foo] [@vm.inferred-type.metadata=dart.core::_GrowableList<DynamicType(dynamic)> (skip check)] this.{self::B::_foo}(iter)));
+      [@vm.call-site-attributes.metadata=receiverType:dart.core::List<dynamic>*] [@vm.direct-call.metadata=dart.core::_GrowableList.add] [@vm.inferred-type.metadata=!? (skip check)] result.{core::List::add}(new self::A::•([@vm.direct-call.metadata=#lib::B._foo] [@vm.inferred-type.metadata=dart.core::_GrowableList<dynamic> (skip check)] this.{self::B::_foo}(iter)));
     }
     return result;
   }
 }
 static method main() → void {
-  core::List<dynamic>* list = [@vm.direct-call.metadata=B._foo] [@vm.inferred-type.metadata=dart.core::_GrowableList<DynamicType(dynamic)> (skip check)] new self::B::•().{self::B::_foo}([@vm.direct-call.metadata=_GrowableList.iterator] [@vm.inferred-type.metadata=dart._internal::ListIterator<InterfaceType(int*)>]<core::int*>[1, 2, 3].{core::Iterable::iterator});
+  core::List<dynamic>* list = [@vm.direct-call.metadata=#lib::B._foo] [@vm.inferred-type.metadata=dart.core::_GrowableList<dynamic> (skip check)] new self::B::•().{self::B::_foo}([@vm.direct-call.metadata=dart.core::_GrowableList.iterator] [@vm.inferred-type.metadata=dart._internal::ListIterator<dart.core::int*>]<core::int*>[1, 2, 3].{core::Iterable::iterator});
   core::print(list);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_37719.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_37719.dart.expect
index b0e917f..662b365 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/regress_37719.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_37719.dart.expect
@@ -2,7 +2,7 @@
 import self as self;
 import "dart:core" as core;
 
-[@vm.unboxing-info.metadata=(b)->i]static method foo([@vm.inferred-type.metadata=dart.core::_GrowableList<InterfaceType(int*)>] core::List<core::int*>* x) → dynamic
-  return [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 1.{core::num::+}([@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=int? (skip check)] x.{core::List::[]}(0));
+[@vm.unboxing-info.metadata=(b)->i]static method foo([@vm.inferred-type.metadata=dart.core::_GrowableList<dart.core::int*>] core::List<core::int*>* x) → dynamic
+  return [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 1.{core::num::+}([@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=int? (skip check)] x.{core::List::[]}(0));
 static method main() → dynamic
   return [@vm.inferred-type.metadata=dart.core::Null? (value: null)] core::print([@vm.inferred-type.metadata=int] self::foo(<core::int*>[1]));
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_41452_nnbd_strong.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_41452_nnbd_strong.dart.expect
index e32f219..7f5cdd6 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/regress_41452_nnbd_strong.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_41452_nnbd_strong.dart.expect
@@ -18,10 +18,10 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method add(generic-covariant-impl self::_SplayTree::Node n) → dynamic {
-    self::_SplayTree::Node? root = [@vm.direct-call.metadata=SplayTreeMap._root] [@vm.inferred-type.metadata=#lib::_SplayTreeMapNode] this.{self::_SplayTree::_root};
+    self::_SplayTree::Node? root = [@vm.direct-call.metadata=#lib::SplayTreeMap._root] [@vm.inferred-type.metadata=#lib::_SplayTreeMapNode] this.{self::_SplayTree::_root};
     if(false)
       return;
-    core::print([@vm.direct-call.metadata=_SplayTreeNode.left] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] root{self::_SplayTree::Node}.{self::_SplayTreeNode::left});
+    core::print([@vm.direct-call.metadata=#lib::_SplayTreeNode.left] [@vm.inferred-type.metadata=dart.core::Null? (value: null)] root{self::_SplayTree::Node}.{self::_SplayTreeNode::left});
   }
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:5]  abstract get /*isNullableByDefault*/ _root() → self::_SplayTree::Node?;
 }
@@ -32,5 +32,5 @@
     ;
 }
 static method main() → void {
-  [@vm.call-site-attributes.metadata=receiverType:InterfaceType(SplayTreeMap<dynamic>)] [@vm.direct-call.metadata=_SplayTree.add] new self::SplayTreeMap::•<dynamic>().{self::_SplayTree::add}(new self::_SplayTreeMapNode::•<dynamic>());
+  [@vm.call-site-attributes.metadata=receiverType:#lib::SplayTreeMap<dynamic>] [@vm.direct-call.metadata=#lib::_SplayTree.add] new self::SplayTreeMap::•<dynamic>().{self::_SplayTree::add}(new self::_SplayTreeMapNode::•<dynamic>());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect
index 9dfc5b4..ff072cb 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect
@@ -20,7 +20,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method call([dynamic a1 = #C1, dynamic a2 = #C1, dynamic a3 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a4 = #C1, [@vm.inferred-type.metadata=#lib::T1?] dynamic a5 = #C1]) → void {
-    [@vm.direct-call.metadata=A1.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A1::foo} = _in::unsafeCast<self::T1*>(a5);
+    [@vm.direct-call.metadata=#lib::A1.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A1::foo} = _in::unsafeCast<self::T1*>(a5);
   }
 }
 class B1 extends core::Object {
@@ -43,7 +43,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method call([dynamic a1 = #C1, dynamic a2 = #C1, dynamic a3 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a4 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a5 = #C1, [@vm.inferred-type.metadata=#lib::T2?] dynamic a6 = #C1]) → void {
-    [@vm.direct-call.metadata=A2.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A2::foo} = a6;
+    [@vm.direct-call.metadata=#lib::A2.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A2::foo} = a6;
   }
 }
 abstract class B2Base extends core::Object {
@@ -52,14 +52,14 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:11]  get aa2() → dynamic
-    return [@vm.direct-call.metadata=B2Base._aa] [@vm.inferred-type.metadata=#lib::A2] this.{self::B2Base::_aa};
+    return [@vm.direct-call.metadata=#lib::B2Base._aa] [@vm.inferred-type.metadata=#lib::A2] this.{self::B2Base::_aa};
 }
 class B2 extends self::B2Base {
   synthetic constructor •() → self::B2*
     : super self::B2Base::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:14,getterSelectorId:15]  method doSuperCall() → void {
-    [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] [@vm.direct-call.metadata=A2.call] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.inferred-type.metadata=#lib::A2] super.{self::B2Base::aa2}.call(1, 2, 3, 4, 5, new self::T2::•());
+    [@vm.call-site-attributes.metadata=receiverType:dynamic] [@vm.direct-call.metadata=#lib::A2.call] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.inferred-type.metadata=#lib::A2] super.{self::B2Base::aa2}.call(1, 2, 3, 4, 5, new self::T2::•());
   }
 }
 class T3 extends core::Object {
@@ -76,7 +76,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method call([dynamic a1 = #C1, dynamic a2 = #C1, dynamic a3 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a4 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a5 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a6 = #C1, [@vm.inferred-type.metadata=#lib::T3?] dynamic a7 = #C1]) → void {
-    [@vm.direct-call.metadata=A3.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A3::foo} = a7;
+    [@vm.direct-call.metadata=#lib::A3.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A3::foo} = a7;
   }
 }
 class B3 extends core::Object {
@@ -99,7 +99,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method call([dynamic a1 = #C1, dynamic a2 = #C1, dynamic a3 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a4 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a5 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a6 = #C1, [@vm.inferred-type.metadata=dart.core::_Smi?] dynamic a7 = #C1, [@vm.inferred-type.metadata=#lib::T4?] dynamic a8 = #C1]) → void {
-    [@vm.direct-call.metadata=A4.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A4::foo} = a8;
+    [@vm.direct-call.metadata=#lib::A4.foo] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A4::foo} = a8;
   }
 }
 class B4 extends core::Object {
@@ -108,7 +108,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=hasThisUses:false,hasTearOffUses:false,getterSelectorId:22]  get aa4() → dynamic
-    return [@vm.direct-call.metadata=B4._aa] [@vm.inferred-type.metadata=#lib::A4] this.{self::B4::_aa};
+    return [@vm.direct-call.metadata=#lib::B4._aa] [@vm.inferred-type.metadata=#lib::A4] this.{self::B4::_aa};
 }
 [@vm.inferred-type.metadata=dart.core::bool?]static field core::bool* ok;
 [@vm.inferred-type.metadata=#lib::B3?]static field dynamic bb3 = new self::B3::•();
@@ -117,32 +117,32 @@
 [@vm.inferred-type.metadata=dart.core::_Closure?]static field core::Function* unknown4 = () → dynamic => self::bb4;
 static method test1() → void {
   self::B1* bb = new self::B1::•();
-  let final self::B1* #t1 = bb in let final core::int* #t2 = 1 in let final core::int* #t3 = 2 in let final core::int* #t4 = 3 in let final core::int* #t5 = 4 in let final self::T1* #t6 = new self::T1::•() in [@vm.call-site-attributes.metadata=receiverType:InterfaceType(A1*)] [@vm.direct-call.metadata=A1.call] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=B1.aa1] [@vm.inferred-type.metadata=#lib::A1] #t1.{self::B1::aa1}.{self::A1::call}(#t2, #t3, #t4, #t5, #t6);
+  let final self::B1* #t1 = bb in let final core::int* #t2 = 1 in let final core::int* #t3 = 2 in let final core::int* #t4 = 3 in let final core::int* #t5 = 4 in let final self::T1* #t6 = new self::T1::•() in [@vm.call-site-attributes.metadata=receiverType:#lib::A1*] [@vm.direct-call.metadata=#lib::A1.call] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=#lib::B1.aa1] [@vm.inferred-type.metadata=#lib::A1] #t1.{self::B1::aa1}.{self::A1::call}(#t2, #t3, #t4, #t5, #t6);
   self::ok = false;
-  [@vm.direct-call.metadata=T1.doTest1??] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=A1.foo] [@vm.inferred-type.metadata=#lib::T1?] [@vm.direct-call.metadata=B1.aa1] [@vm.inferred-type.metadata=#lib::A1] bb.{self::B1::aa1}.{self::A1::foo}.{self::T1::doTest1}();
+  [@vm.direct-call.metadata=#lib::T1.doTest1??] [@vm.inferred-type.metadata=!? (skip check)] [@vm.direct-call.metadata=#lib::A1.foo] [@vm.inferred-type.metadata=#lib::T1?] [@vm.direct-call.metadata=#lib::B1.aa1] [@vm.inferred-type.metadata=#lib::A1] bb.{self::B1::aa1}.{self::A1::foo}.{self::T1::doTest1}();
   exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
 }
 static method test2() → void {
   self::B2* bb = new self::B2::•();
-  [@vm.direct-call.metadata=B2.doSuperCall] [@vm.inferred-type.metadata=!? (skip check)] bb.{self::B2::doSuperCall}();
+  [@vm.direct-call.metadata=#lib::B2.doSuperCall] [@vm.inferred-type.metadata=!? (skip check)] bb.{self::B2::doSuperCall}();
   self::ok = false;
-  [@vm.direct-call.metadata=T2.doTest2??] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.direct-call.metadata=A2.foo] [@vm.inferred-type.metadata=#lib::T2? (receiver not int)] [@vm.direct-call.metadata=B2Base.aa2] [@vm.inferred-type.metadata=#lib::A2] bb.{self::B2Base::aa2}.foo.doTest2();
+  [@vm.direct-call.metadata=#lib::T2.doTest2??] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.direct-call.metadata=#lib::A2.foo] [@vm.inferred-type.metadata=#lib::T2? (receiver not int)] [@vm.direct-call.metadata=#lib::B2Base.aa2] [@vm.inferred-type.metadata=#lib::A2] bb.{self::B2Base::aa2}.foo.doTest2();
   exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
 }
 static method getDynamic3() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown3.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown3.call();
 static method test3() → void {
   self::getDynamic3().aa3(1, 2, 3, 4, 5, 6, new self::T3::•());
   self::ok = false;
-  [@vm.direct-call.metadata=T3.doTest3??] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.direct-call.metadata=A3.foo] [@vm.inferred-type.metadata=#lib::T3? (receiver not int)] [@vm.direct-call.metadata=B3.aa3??] [@vm.inferred-type.metadata=#lib::A3 (receiver not int)] [@vm.inferred-type.metadata=#lib::B3?] self::bb3.aa3.foo.doTest3();
+  [@vm.direct-call.metadata=#lib::T3.doTest3??] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.direct-call.metadata=#lib::A3.foo] [@vm.inferred-type.metadata=#lib::T3? (receiver not int)] [@vm.direct-call.metadata=#lib::B3.aa3??] [@vm.inferred-type.metadata=#lib::A3 (receiver not int)] [@vm.inferred-type.metadata=#lib::B3?] self::bb3.aa3.foo.doTest3();
   exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
 }
 static method getDynamic4() → dynamic
-  return [@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] self::unknown4.call();
+  return [@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] self::unknown4.call();
 static method test4() → void {
   self::getDynamic4().aa4(1, 2, 3, 4, 5, 6, 7, new self::T4::•());
   self::ok = false;
-  [@vm.direct-call.metadata=T4.doTest4??] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.direct-call.metadata=A4.foo] [@vm.inferred-type.metadata=#lib::T4? (receiver not int)] [@vm.inferred-type.metadata=#lib::A4] self::getDynamic4().aa4.foo.doTest4();
+  [@vm.direct-call.metadata=#lib::T4.doTest4??] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.direct-call.metadata=#lib::A4.foo] [@vm.inferred-type.metadata=#lib::T4? (receiver not int)] [@vm.inferred-type.metadata=#lib::A4] self::getDynamic4().aa4.foo.doTest4();
   exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
 }
 static method main() → void {
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_dynamic_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_dynamic_method.dart.expect
index 59dd25e..873936d 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_dynamic_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_dynamic_method.dart.expect
@@ -12,18 +12,18 @@
     : super self::A::•()
     ;
 [@vm.procedure-attributes.metadata=hasThisUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method foo() → core::int*
-    return [@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=! (skip check)] 1.{core::num::+}([@vm.direct-call.metadata=B.foo] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().foo() as{TypeError,ForDynamic} core::num) as{TypeError} core::int*;
+    return [@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=! (skip check)] 1.{core::num::+}([@vm.direct-call.metadata=#lib::B.foo] [@vm.inferred-type.metadata=!? (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().foo() as{TypeError,ForDynamic} core::num) as{TypeError} core::int*;
 }
 class TearOffDynamicMethod extends core::Object {
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  field dynamic bazz;
   constructor •(dynamic arg) → self::TearOffDynamicMethod*
     : self::TearOffDynamicMethod::bazz = arg.foo, super core::Object::•() {
-    [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] [@vm.direct-call.metadata=TearOffDynamicMethod.bazz] this.{self::TearOffDynamicMethod::bazz}.call();
+    [@vm.call-site-attributes.metadata=receiverType:dynamic] [@vm.direct-call.metadata=#lib::TearOffDynamicMethod.bazz] this.{self::TearOffDynamicMethod::bazz}.call();
   }
 }
 static method knownResult() → dynamic
   return new self::B::•();
 static method main(core::List<core::String*>* args) → dynamic {
   core::Function* closure = () → self::B* => new self::B::•();
-  new self::TearOffDynamicMethod::•([@vm.call-site-attributes.metadata=receiverType:InterfaceType(Function*)] closure.call());
+  new self::TearOffDynamicMethod::•([@vm.call-site-attributes.metadata=receiverType:dart.core::Function*] closure.call());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_interface_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_interface_method.dart.expect
index 3f099e3..acbb8df 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_interface_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_interface_method.dart.expect
@@ -14,7 +14,7 @@
     : super self::A::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method foo() → core::int*
-    return _in::unsafeCast<core::int*>([@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 1.{core::num::+}(_in::unsafeCast<core::num>([@vm.direct-call.metadata=B.bar] [@vm.inferred-type.metadata=dart.core::_Smi (value: 3) (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().bar())));
+    return _in::unsafeCast<core::int*>([@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 1.{core::num::+}(_in::unsafeCast<core::num>([@vm.direct-call.metadata=#lib::B.bar] [@vm.inferred-type.metadata=dart.core::_Smi (value: 3) (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().bar())));
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method bar() → core::int*
     return 3;
 }
@@ -27,5 +27,5 @@
 static method knownResult() → dynamic
   return new self::B::•();
 static method main(core::List<core::String*>* args) → dynamic {
-  [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] [@vm.direct-call.metadata=TearOffInterfaceMethod.bazz] new self::TearOffInterfaceMethod::•(new self::B::•()).{self::TearOffInterfaceMethod::bazz}.call();
+  [@vm.call-site-attributes.metadata=receiverType:dynamic] [@vm.direct-call.metadata=#lib::TearOffInterfaceMethod.bazz] new self::TearOffInterfaceMethod::•(new self::B::•()).{self::TearOffInterfaceMethod::bazz}.call();
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_super_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_super_method.dart.expect
index 56f16ba..b7fdab8 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_super_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/tear_off_super_method.dart.expect
@@ -14,28 +14,28 @@
     : super self::A::•()
     ;
 [@vm.procedure-attributes.metadata=getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method foo() → core::int*
-    return _in::unsafeCast<core::int*>([@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 1.{core::num::+}(_in::unsafeCast<core::num>([@vm.direct-call.metadata=B.foo] [@vm.inferred-type.metadata=int? (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().foo())));
+    return _in::unsafeCast<core::int*>([@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 1.{core::num::+}(_in::unsafeCast<core::num>([@vm.direct-call.metadata=#lib::B.foo] [@vm.inferred-type.metadata=int? (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().foo())));
 }
 abstract class Base extends core::Object {
   synthetic constructor •() → self::Base*
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method foo() → core::int*
-    return _in::unsafeCast<core::int*>([@vm.direct-call.metadata=_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 3.{core::num::+}(_in::unsafeCast<core::num>([@vm.direct-call.metadata=B.foo] [@vm.inferred-type.metadata=int? (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().foo())));
+    return _in::unsafeCast<core::int*>([@vm.direct-call.metadata=dart.core::_IntegerImplementation.+] [@vm.inferred-type.metadata=int (skip check)] 3.{core::num::+}(_in::unsafeCast<core::num>([@vm.direct-call.metadata=#lib::B.foo] [@vm.inferred-type.metadata=int? (receiver not int)] [@vm.inferred-type.metadata=#lib::B] self::knownResult().foo())));
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method doCall(dynamic x) → core::int*
-    return [@vm.call-site-attributes.metadata=receiverType:DynamicType(dynamic)] x.call() as{TypeError,ForDynamic} core::int*;
+    return [@vm.call-site-attributes.metadata=receiverType:dynamic] x.call() as{TypeError,ForDynamic} core::int*;
 }
 class TearOffSuperMethod extends self::Base {
   synthetic constructor •() → self::TearOffSuperMethod*
     : super self::Base::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method bar() → core::int*
-    return [@vm.direct-call.metadata=Base.doCall] [@vm.inferred-type.metadata=int? (skip check)] this.{self::Base::doCall}(super.{self::Base::foo});
+    return [@vm.direct-call.metadata=#lib::Base.doCall] [@vm.inferred-type.metadata=int? (skip check)] this.{self::Base::doCall}(super.{self::Base::foo});
 }
 [@vm.inferred-type.metadata=#lib::B?]static field self::A* aa = new self::B::•();
 static method knownResult() → dynamic
   return new self::B::•();
 static method main(core::List<core::String*>* args) → dynamic {
-  [@vm.direct-call.metadata=TearOffSuperMethod.bar] [@vm.inferred-type.metadata=!? (skip check)] new self::TearOffSuperMethod::•().{self::TearOffSuperMethod::bar}();
-  [@vm.direct-call.metadata=B.foo??] [@vm.inferred-type.metadata=!? (skip check)] [@vm.inferred-type.metadata=#lib::B?] self::aa.{self::A::foo}();
+  [@vm.direct-call.metadata=#lib::TearOffSuperMethod.bar] [@vm.inferred-type.metadata=!? (skip check)] new self::TearOffSuperMethod::•().{self::TearOffSuperMethod::bar}();
+  [@vm.direct-call.metadata=#lib::B.foo??] [@vm.inferred-type.metadata=!? (skip check)] [@vm.inferred-type.metadata=#lib::B?] self::aa.{self::A::foo}();
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination.dart.expect
index 98de328..333cde8 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination.dart.expect
@@ -14,11 +14,11 @@
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method testT1([@vm.inferred-type.metadata=dart.core::_Smi (value: 42)] dynamic x) → dynamic
     return _in::unsafeCast<self::B::T*>(x);
-[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method testT2negative([@vm.inferred-type.metadata=#lib::A<InterfaceType(String*)>] dynamic x) → dynamic
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3,getterSelectorId:4]  method testT2negative([@vm.inferred-type.metadata=#lib::A<dart.core::String*>] dynamic x) → dynamic
     return x as self::B::T*;
-[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method testAOfT1([@vm.inferred-type.metadata=#lib::A<InterfaceType(A<int*>*)>] dynamic x) → dynamic
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5,getterSelectorId:6]  method testAOfT1([@vm.inferred-type.metadata=#lib::A<#lib::A<dart.core::int*>*>] dynamic x) → dynamic
     return _in::unsafeCast<self::A<self::B::T*>*>(x);
-[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method testAOfT2negative([@vm.inferred-type.metadata=#lib::A<InterfaceType(A<num*>*)>] dynamic x) → dynamic
+[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:7,getterSelectorId:8]  method testAOfT2negative([@vm.inferred-type.metadata=#lib::A<#lib::A<dart.core::num*>*>] dynamic x) → dynamic
     return x as self::A<self::B::T*>*;
 }
 [@vm.unboxing-info.metadata=(i)->i]static method testInt1([@vm.inferred-type.metadata=dart.core::_Smi (value: 42)] dynamic x) → dynamic
@@ -29,15 +29,15 @@
   return _in::unsafeCast<dynamic>(x);
 static method testObject([@vm.inferred-type.metadata=dart.core::_OneByteString (value: bye)] dynamic x) → dynamic
   return x;
-static method testBOfInt([@vm.inferred-type.metadata=#lib::B<InterfaceType(int*)>] dynamic x) → dynamic
+static method testBOfInt([@vm.inferred-type.metadata=#lib::B<dart.core::int*>] dynamic x) → dynamic
   return _in::unsafeCast<self::B<core::int*>*>(x);
-static method testAOfInt([@vm.inferred-type.metadata=#lib::B<InterfaceType(int*)>] dynamic x) → dynamic
+static method testAOfInt([@vm.inferred-type.metadata=#lib::B<dart.core::int*>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::int*>*>(x);
-static method testAOfNum([@vm.inferred-type.metadata=#lib::B<InterfaceType(int*)>] dynamic x) → dynamic
+static method testAOfNum([@vm.inferred-type.metadata=#lib::B<dart.core::int*>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num*>*>(x);
-static method testAOfAOfB1([@vm.inferred-type.metadata=#lib::A<InterfaceType(A<B<dynamic>*>*)>] dynamic x) → dynamic
+static method testAOfAOfB1([@vm.inferred-type.metadata=#lib::A<#lib::A<#lib::B<dynamic>*>*>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<self::A<self::B<dynamic>*>*>*>(x);
-static method testAOfAOfB2negative([@vm.inferred-type.metadata=#lib::A<InterfaceType(A<A<dynamic>*>*)>] dynamic x) → dynamic
+static method testAOfAOfB2negative([@vm.inferred-type.metadata=#lib::A<#lib::A<#lib::A<dynamic>*>*>] dynamic x) → dynamic
   return x as self::A<self::A<self::B<dynamic>*>*>*;
 static method main() → void {
   self::testInt1(42);
@@ -49,8 +49,8 @@
   self::testAOfNum(new self::B::•<core::int*>());
   self::testAOfAOfB1(new self::A::•<self::A<self::B<dynamic>*>*>());
   self::testAOfAOfB2negative(new self::A::•<self::A<self::A<dynamic>*>*>());
-  [@vm.direct-call.metadata=B.testT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int*>().{self::B::testT1}(42);
-  [@vm.direct-call.metadata=B.testT2negative] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<self::A<core::int*>*>().{self::B::testT2negative}(new self::A::•<core::String*>());
-  [@vm.direct-call.metadata=B.testAOfT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<self::A<core::int*>*>().{self::B::testAOfT1}(new self::A::•<self::A<core::int*>*>());
-  [@vm.direct-call.metadata=B.testAOfT2negative] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<self::A<core::int*>*>().{self::B::testAOfT2negative}(new self::A::•<self::A<core::num*>*>());
+  [@vm.direct-call.metadata=#lib::B.testT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int*>().{self::B::testT1}(42);
+  [@vm.direct-call.metadata=#lib::B.testT2negative] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<self::A<core::int*>*>().{self::B::testT2negative}(new self::A::•<core::String*>());
+  [@vm.direct-call.metadata=#lib::B.testAOfT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<self::A<core::int*>*>().{self::B::testAOfT1}(new self::A::•<self::A<core::int*>*>());
+  [@vm.direct-call.metadata=#lib::B.testAOfT2negative] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<self::A<core::int*>*>().{self::B::testAOfT2negative}(new self::A::•<self::A<core::num*>*>());
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd.dart.expect
index 638caae..dc2fe51 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd.dart.expect
@@ -37,17 +37,17 @@
   return x;
 static method testNullableObject([@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic x) → dynamic
   return x;
-static method testAOfNum1([@vm.inferred-type.metadata=#lib::B<InterfaceType(int)>] dynamic x) → dynamic
+static method testAOfNum1([@vm.inferred-type.metadata=#lib::B<dart.core::int>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num>>(x);
-static method testAOfNum2([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testAOfNum2([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num>>(x);
 static method testAOfNum3([@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num>>(x);
-static method testAOfNullableNum([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testAOfNullableNum([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num?>>(x);
 static method testNullableAOfNum([@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num>?>(x);
-static method testNullableAOfNullableNum([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testNullableAOfNullableNum([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num?>?>(x);
 static method main() → void {
   self::testInt1(42);
@@ -63,9 +63,9 @@
   self::testAOfNullableNum(new self::B::•<core::int?>());
   self::testNullableAOfNum(null);
   self::testNullableAOfNullableNum(new self::B::•<core::int?>());
-  [@vm.direct-call.metadata=B.testT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT1}(42);
-  [@vm.direct-call.metadata=B.testT2] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT2}(null);
-  [@vm.direct-call.metadata=B.testT3] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int?>().{self::B::testT3}(null);
-  [@vm.direct-call.metadata=B.testNullableT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT1}(42);
-  [@vm.direct-call.metadata=B.testNullableT2] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT2}(null);
+  [@vm.direct-call.metadata=#lib::B.testT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT1}(42);
+  [@vm.direct-call.metadata=#lib::B.testT2] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT2}(null);
+  [@vm.direct-call.metadata=#lib::B.testT3] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int?>().{self::B::testT3}(null);
+  [@vm.direct-call.metadata=#lib::B.testNullableT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT1}(42);
+  [@vm.direct-call.metadata=#lib::B.testNullableT2] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT2}(null);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd_strong.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd_strong.dart.expect
index 0cfc7fb..a7d832c 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd_strong.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/type_cast_elimination_nnbd_strong.dart.expect
@@ -37,19 +37,19 @@
   return let dynamic #t1 = x in true ?{core::Object} #t1 as{ForNonNullableByDefault} core::Object : #t1{core::Object};
 static method testNullableObject([@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic x) → dynamic
   return x;
-static method testAOfNum1([@vm.inferred-type.metadata=#lib::B<InterfaceType(int)>] dynamic x) → dynamic
+static method testAOfNum1([@vm.inferred-type.metadata=#lib::B<dart.core::int>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num>>(x);
-static method testAOfNum2negative([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testAOfNum2negative([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return x as{ForNonNullableByDefault} self::A<core::num>;
 static method testAOfNum3negative([@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic x) → dynamic
   return x as{ForNonNullableByDefault} self::A<core::num>;
-static method testAOfNullableNum([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testAOfNullableNum([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num?>>(x);
 static method testNullableAOfNum([@vm.inferred-type.metadata=dart.core::Null? (value: null)] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num>?>(x);
-static method testNullableAOfNumNegative([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testNullableAOfNumNegative([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return x as{ForNonNullableByDefault} self::A<core::num>?;
-static method testNullableAOfNullableNum([@vm.inferred-type.metadata=#lib::B<InterfaceType(int?)>] dynamic x) → dynamic
+static method testNullableAOfNullableNum([@vm.inferred-type.metadata=#lib::B<dart.core::int?>] dynamic x) → dynamic
   return _in::unsafeCast<self::A<core::num?>?>(x);
 static method main() → void {
   self::testInt1(42);
@@ -66,9 +66,9 @@
   self::testNullableAOfNum(null);
   self::testNullableAOfNumNegative(new self::B::•<core::int?>());
   self::testNullableAOfNullableNum(new self::B::•<core::int?>());
-  [@vm.direct-call.metadata=B.testT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT1}(42);
-  [@vm.direct-call.metadata=B.testT2negative] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT2negative}(null);
-  [@vm.direct-call.metadata=B.testT3] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int?>().{self::B::testT3}(null);
-  [@vm.direct-call.metadata=B.testNullableT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT1}(42);
-  [@vm.direct-call.metadata=B.testNullableT2] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT2}(null);
+  [@vm.direct-call.metadata=#lib::B.testT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT1}(42);
+  [@vm.direct-call.metadata=#lib::B.testT2negative] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testT2negative}(null);
+  [@vm.direct-call.metadata=#lib::B.testT3] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int?>().{self::B::testT3}(null);
+  [@vm.direct-call.metadata=#lib::B.testNullableT1] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT1}(42);
+  [@vm.direct-call.metadata=#lib::B.testNullableT2] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•<core::int>().{self::B::testNullableT2}(null);
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_fields.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_fields.dart.expect
index 1d98d02..438e696 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_fields.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_fields.dart.expect
@@ -21,31 +21,31 @@
     : self::A::unboxedSmi = unboxedSmi, self::A::unboxedInt = unboxedInt, self::A::unboxedDouble = unboxedDouble, self::A::boxedNullableInt = boxedNullableInt, self::A::boxedNullableDouble = boxedNullableDouble, self::A::boxedNonNullableIntOrDouble = boxedNonNullableIntOrDouble, self::A::boxedNullableIntOrDouble = boxedNullableIntOrDouble, self::A::boxedNullableX = boxedNullableX, self::A::boxedX = boxedX, super core::Object::•()
     ;
 }
-[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kTrue = [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1) ?{core::bool*} true : false;
-[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kFalse = [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(2) ?{core::bool*} true : false;
+[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kTrue = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1) ?{core::bool*} true : false;
+[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kFalse = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(2) ?{core::bool*} true : false;
 static get mint() → core::int*
   return -6144092014192636707;
 static get smiOrMint() → core::int*
   return [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} 1 : [@vm.inferred-type.metadata=int] self::mint;
 static method main() → dynamic {
   final self::A* a = new self::A::•([@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} 1 : 2, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} [@vm.inferred-type.metadata=int] self::smiOrMint : 2, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::double*} 1.1 : 2.2, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} [@vm.inferred-type.metadata=int] self::smiOrMint : null, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::double*} 1.1 : null, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::num*} [@vm.inferred-type.metadata=int] self::smiOrMint : 1.1, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::num*} [@vm.inferred-type.metadata=dart.core::bool?] self::kFalse ?{core::num*} [@vm.inferred-type.metadata=int] self::smiOrMint : 1.1 : null, [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{self::X*} new self::X::•() : null, new self::X::•());
-  [@vm.direct-call.metadata=A.unboxedSmi] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::unboxedSmi} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} 1 : 2;
-  [@vm.direct-call.metadata=A.unboxedInt] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::unboxedInt} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} [@vm.inferred-type.metadata=int] self::smiOrMint : 2;
-  [@vm.direct-call.metadata=A.unboxedDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::unboxedDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::double*} 1.1 : 2.2;
-  [@vm.direct-call.metadata=A.boxedNullableInt] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableInt} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} [@vm.inferred-type.metadata=int] self::smiOrMint : null;
-  [@vm.direct-call.metadata=A.boxedNullableDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::double*} 1.1 : null;
-  [@vm.direct-call.metadata=A.boxedNonNullableIntOrDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNonNullableIntOrDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::num*} [@vm.inferred-type.metadata=int] self::smiOrMint : 1.1;
-  [@vm.direct-call.metadata=A.boxedNullableIntOrDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableIntOrDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::num*} [@vm.inferred-type.metadata=dart.core::bool?] self::kFalse ?{core::num*} [@vm.inferred-type.metadata=int] self::smiOrMint : 1.1 : null;
-  [@vm.direct-call.metadata=A.boxedNullableX] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableX} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{self::X*} new self::X::•() : null;
-  [@vm.direct-call.metadata=A.boxedX] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedX} = new self::X::•();
-  self::use([@vm.direct-call.metadata=A.unboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi] a.{self::A::unboxedSmi});
-  self::use([@vm.direct-call.metadata=A.unboxedInt] [@vm.inferred-type.metadata=int] a.{self::A::unboxedInt});
-  self::use([@vm.direct-call.metadata=A.unboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double] a.{self::A::unboxedDouble});
-  self::use([@vm.direct-call.metadata=A.boxedNullableInt] [@vm.inferred-type.metadata=int?] a.{self::A::boxedNullableInt});
-  self::use([@vm.direct-call.metadata=A.boxedNullableDouble] [@vm.inferred-type.metadata=dart.core::_Double?] a.{self::A::boxedNullableDouble});
-  self::use([@vm.direct-call.metadata=A.boxedNonNullableIntOrDouble] [@vm.inferred-type.metadata=!] a.{self::A::boxedNonNullableIntOrDouble});
-  self::use([@vm.direct-call.metadata=A.boxedNullableIntOrDouble] a.{self::A::boxedNullableIntOrDouble});
-  self::use([@vm.direct-call.metadata=A.boxedNullableX] [@vm.inferred-type.metadata=#lib::X?] a.{self::A::boxedNullableX});
-  self::use([@vm.direct-call.metadata=A.boxedX] [@vm.inferred-type.metadata=#lib::X] a.{self::A::boxedX});
+  [@vm.direct-call.metadata=#lib::A.unboxedSmi] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::unboxedSmi} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} 1 : 2;
+  [@vm.direct-call.metadata=#lib::A.unboxedInt] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::unboxedInt} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} [@vm.inferred-type.metadata=int] self::smiOrMint : 2;
+  [@vm.direct-call.metadata=#lib::A.unboxedDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::unboxedDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::double*} 1.1 : 2.2;
+  [@vm.direct-call.metadata=#lib::A.boxedNullableInt] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableInt} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::int*} [@vm.inferred-type.metadata=int] self::smiOrMint : null;
+  [@vm.direct-call.metadata=#lib::A.boxedNullableDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::double*} 1.1 : null;
+  [@vm.direct-call.metadata=#lib::A.boxedNonNullableIntOrDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNonNullableIntOrDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::num*} [@vm.inferred-type.metadata=int] self::smiOrMint : 1.1;
+  [@vm.direct-call.metadata=#lib::A.boxedNullableIntOrDouble] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableIntOrDouble} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{core::num*} [@vm.inferred-type.metadata=dart.core::bool?] self::kFalse ?{core::num*} [@vm.inferred-type.metadata=int] self::smiOrMint : 1.1 : null;
+  [@vm.direct-call.metadata=#lib::A.boxedNullableX] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedNullableX} = [@vm.inferred-type.metadata=dart.core::bool?] self::kTrue ?{self::X*} new self::X::•() : null;
+  [@vm.direct-call.metadata=#lib::A.boxedX] [@vm.inferred-type.metadata=!? (skip check)] a.{self::A::boxedX} = new self::X::•();
+  self::use([@vm.direct-call.metadata=#lib::A.unboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi] a.{self::A::unboxedSmi});
+  self::use([@vm.direct-call.metadata=#lib::A.unboxedInt] [@vm.inferred-type.metadata=int] a.{self::A::unboxedInt});
+  self::use([@vm.direct-call.metadata=#lib::A.unboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double] a.{self::A::unboxedDouble});
+  self::use([@vm.direct-call.metadata=#lib::A.boxedNullableInt] [@vm.inferred-type.metadata=int?] a.{self::A::boxedNullableInt});
+  self::use([@vm.direct-call.metadata=#lib::A.boxedNullableDouble] [@vm.inferred-type.metadata=dart.core::_Double?] a.{self::A::boxedNullableDouble});
+  self::use([@vm.direct-call.metadata=#lib::A.boxedNonNullableIntOrDouble] [@vm.inferred-type.metadata=!] a.{self::A::boxedNonNullableIntOrDouble});
+  self::use([@vm.direct-call.metadata=#lib::A.boxedNullableIntOrDouble] a.{self::A::boxedNullableIntOrDouble});
+  self::use([@vm.direct-call.metadata=#lib::A.boxedNullableX] [@vm.inferred-type.metadata=#lib::X?] a.{self::A::boxedNullableX});
+  self::use([@vm.direct-call.metadata=#lib::A.boxedX] [@vm.inferred-type.metadata=#lib::X] a.{self::A::boxedX});
 }
 static method use(dynamic object) → void {}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart.expect
index c268813..87a7918 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method.dart.expect
@@ -95,23 +95,23 @@
   return -6144092014192636707;
 static method main() → dynamic {
   final core::List<core::Object*>* values = <core::Object*>[new self::Impl1::•(), new self::BaseImpl2::•(), new self::SubImpl3::•()];
-  final self::Impl1* a = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("0")) as self::Impl1*;
-  final self::BaseImpl2* b = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("1")) as self::BaseImpl2*;
-  final self::SubImpl3* c = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::SubImpl3*;
-  final self::Interface* d = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::Interface*;
-  [@vm.direct-call.metadata=Impl1.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] a.{self::Impl1::takePositional}(1, 1, 1.1, null, null, 1, null, null, new self::X::•());
+  final self::Impl1* a = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("0")) as self::Impl1*;
+  final self::BaseImpl2* b = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("1")) as self::BaseImpl2*;
+  final self::SubImpl3* c = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::SubImpl3*;
+  final self::Interface* d = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::Interface*;
+  [@vm.direct-call.metadata=#lib::Impl1.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] a.{self::Impl1::takePositional}(1, 1, 1.1, null, null, 1, null, null, new self::X::•());
   b.{self::BaseImpl2::takePositional}(2, 2, 2.2, 2, 2.2, 2.2, 2, new self::X::•(), new self::X::•());
-  [@vm.direct-call.metadata=SubImpl3.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] c.{self::SubImpl3::takePositional}(3, [@vm.inferred-type.metadata=int] self::mint, 3.3, [@vm.inferred-type.metadata=int] self::mint, 3.3, 3.3, 3.3, new self::X::•(), new self::X::•());
+  [@vm.direct-call.metadata=#lib::SubImpl3.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] c.{self::SubImpl3::takePositional}(3, [@vm.inferred-type.metadata=int] self::mint, 3.3, [@vm.inferred-type.metadata=int] self::mint, 3.3, 3.3, 3.3, new self::X::•(), new self::X::•());
   d.{self::Interface::takePositional}(3, [@vm.inferred-type.metadata=int] self::mint, 3.3, [@vm.inferred-type.metadata=int] self::mint, 3.3, 3.3, 3.3, new self::X::•(), new self::X::•());
-  self::use([@vm.direct-call.metadata=Impl1.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedSmi}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnUnboxedInt] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedInt}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 1.1)] a.{self::Impl1::returnUnboxedDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableInt] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableInt}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnBoxedIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableX] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableX}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] a.{self::Impl1::returnBoxedX}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedSmi}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnUnboxedInt] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 1.1)] a.{self::Impl1::returnUnboxedDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableInt] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnBoxedIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableX] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableX}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] a.{self::Impl1::returnBoxedX}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Smi] b.{self::BaseImpl2::returnUnboxedSmi}(null));
   self::use([@vm.inferred-type.metadata=int] b.{self::BaseImpl2::returnUnboxedInt}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Double] b.{self::BaseImpl2::returnUnboxedDouble}(null));
@@ -121,15 +121,15 @@
   self::use([@vm.inferred-type.metadata=!] b.{self::BaseImpl2::returnBoxedNullableIntOrDouble}(null));
   self::use([@vm.inferred-type.metadata=#lib::X] b.{self::BaseImpl2::returnBoxedNullableX}(null));
   self::use([@vm.inferred-type.metadata=#lib::X] b.{self::BaseImpl2::returnBoxedX}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 3)] c.{self::SubImpl3::returnUnboxedSmi}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnUnboxedInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnUnboxedInt}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnUnboxedDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnBoxedNullableInt}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedNullableX}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedX}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 3)] c.{self::SubImpl3::returnUnboxedSmi}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnUnboxedInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnUnboxedInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnUnboxedDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnBoxedNullableInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedNullableX}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedX}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Smi] d.{self::Interface::returnUnboxedSmi}(null));
   self::use([@vm.inferred-type.metadata=int] d.{self::Interface::returnUnboxedInt}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Double] d.{self::Interface::returnUnboxedDouble}(null));
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart.expect
index aa41317..a28e015 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_instance_method_tearoff.dart.expect
@@ -95,23 +95,23 @@
   return -6144092014192636707;
 static method main() → dynamic {
   final core::List<core::Object*>* values = <core::Object*>[new self::Impl1::•(), new self::BaseImpl2::•(), new self::SubImpl3::•()];
-  final self::Impl1* a = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("0")) as self::Impl1*;
-  final self::BaseImpl2* b = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("1")) as self::BaseImpl2*;
-  final self::SubImpl3* c = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::SubImpl3*;
-  final self::Interface* d = [@vm.direct-call.metadata=_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::Interface*;
-  [@vm.direct-call.metadata=Impl1.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] a.{self::Impl1::takePositional}(1, 1, 1.1, null, null, 1, null, null, new self::X::•());
+  final self::Impl1* a = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("0")) as self::Impl1*;
+  final self::BaseImpl2* b = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("1")) as self::BaseImpl2*;
+  final self::SubImpl3* c = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::SubImpl3*;
+  final self::Interface* d = [@vm.direct-call.metadata=dart.core::_GrowableList.[]] [@vm.inferred-type.metadata=!? (skip check)] values.{core::List::[]}([@vm.inferred-type.metadata=int] core::int::parse("2")) as self::Interface*;
+  [@vm.direct-call.metadata=#lib::Impl1.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] a.{self::Impl1::takePositional}(1, 1, 1.1, null, null, 1, null, null, new self::X::•());
   b.{self::BaseImpl2::takePositional}(2, 2, 2.2, 2, 2.2, 2.2, 2, new self::X::•(), new self::X::•());
-  [@vm.direct-call.metadata=SubImpl3.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] c.{self::SubImpl3::takePositional}(3, [@vm.inferred-type.metadata=int] self::mint, 3.3, [@vm.inferred-type.metadata=int] self::mint, 3.3, 3.3, 3.3, new self::X::•(), new self::X::•());
+  [@vm.direct-call.metadata=#lib::SubImpl3.takePositional??] [@vm.inferred-type.metadata=!? (skip check)] c.{self::SubImpl3::takePositional}(3, [@vm.inferred-type.metadata=int] self::mint, 3.3, [@vm.inferred-type.metadata=int] self::mint, 3.3, 3.3, 3.3, new self::X::•(), new self::X::•());
   d.{self::Interface::takePositional}(3, [@vm.inferred-type.metadata=int] self::mint, 3.3, [@vm.inferred-type.metadata=int] self::mint, 3.3, 3.3, 3.3, new self::X::•(), new self::X::•());
-  self::use([@vm.direct-call.metadata=Impl1.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedSmi}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnUnboxedInt] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedInt}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 1.1)] a.{self::Impl1::returnUnboxedDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableInt] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableInt}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnBoxedIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedNullableX] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableX}(null));
-  self::use([@vm.direct-call.metadata=Impl1.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] a.{self::Impl1::returnBoxedX}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedSmi}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnUnboxedInt] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnUnboxedInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 1.1)] a.{self::Impl1::returnUnboxedDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableInt] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 1)] a.{self::Impl1::returnBoxedIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedNullableX] [@vm.inferred-type.metadata=dart.core::Null? (skip check) (value: null)] a.{self::Impl1::returnBoxedNullableX}(null));
+  self::use([@vm.direct-call.metadata=#lib::Impl1.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] a.{self::Impl1::returnBoxedX}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Smi] b.{self::BaseImpl2::returnUnboxedSmi}(null));
   self::use([@vm.inferred-type.metadata=int] b.{self::BaseImpl2::returnUnboxedInt}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Double] b.{self::BaseImpl2::returnUnboxedDouble}(null));
@@ -121,15 +121,15 @@
   self::use([@vm.inferred-type.metadata=!] b.{self::BaseImpl2::returnBoxedNullableIntOrDouble}(null));
   self::use([@vm.inferred-type.metadata=#lib::X] b.{self::BaseImpl2::returnBoxedNullableX}(null));
   self::use([@vm.inferred-type.metadata=#lib::X] b.{self::BaseImpl2::returnBoxedX}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 3)] c.{self::SubImpl3::returnUnboxedSmi}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnUnboxedInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnUnboxedInt}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnUnboxedDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnBoxedNullableInt}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableIntOrDouble}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedNullableX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedNullableX}(null));
-  self::use([@vm.direct-call.metadata=SubImpl3.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedX}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnUnboxedSmi] [@vm.inferred-type.metadata=dart.core::_Smi (skip check) (value: 3)] c.{self::SubImpl3::returnUnboxedSmi}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnUnboxedInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnUnboxedInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnUnboxedDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnUnboxedDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableInt] [@vm.inferred-type.metadata=int (skip check)] c.{self::SubImpl3::returnBoxedNullableInt}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableIntOrDouble] [@vm.inferred-type.metadata=dart.core::_Double (skip check) (value: 3.3)] c.{self::SubImpl3::returnBoxedNullableIntOrDouble}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedNullableX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedNullableX}(null));
+  self::use([@vm.direct-call.metadata=#lib::SubImpl3.returnBoxedX] [@vm.inferred-type.metadata=#lib::X (skip check)] c.{self::SubImpl3::returnBoxedX}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Smi] d.{self::Interface::returnUnboxedSmi}(null));
   self::use([@vm.inferred-type.metadata=int] d.{self::Interface::returnUnboxedInt}(null));
   self::use([@vm.inferred-type.metadata=dart.core::_Double] d.{self::Interface::returnUnboxedDouble}(null));
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method.dart.expect
index a5bf511..7994267 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method.dart.expect
@@ -7,8 +7,8 @@
     : super core::Object::•()
     ;
 }
-[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kTrue = [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1) ?{core::bool*} true : false;
-[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kFalse = [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(2) ?{core::bool*} true : false;
+[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kTrue = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1) ?{core::bool*} true : false;
+[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kFalse = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(2) ?{core::bool*} true : false;
 static get mint() → core::int*
   return -6144092014192636707;
 static get smiOrMint() → core::int*
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method_tearoff.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method_tearoff.dart.expect
index 965f2d6..97e7e41 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method_tearoff.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/unboxed_static_method_tearoff.dart.expect
@@ -7,8 +7,8 @@
     : super core::Object::•()
     ;
 }
-[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kTrue = [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1) ?{core::bool*} true : false;
-[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kFalse = [@vm.direct-call.metadata=_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(2) ?{core::bool*} true : false;
+[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kTrue = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(1) ?{core::bool*} true : false;
+[@vm.inferred-type.metadata=dart.core::bool?]static final field core::bool* kFalse = [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1").{core::num::==}(2) ?{core::bool*} true : false;
 static get mint() → core::int*
   return -6144092014192636707;
 static get smiOrMint() → core::int*
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field.dart.expect
index 3da3b64..0fdf157 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field.dart.expect
@@ -16,5 +16,5 @@
 }
 static method main() → void {
   null;
-  [@vm.direct-call.metadata=C.instanceField] [@vm.inferred-type.metadata=!? (skip check)] new self::C::•().{self::C::instanceField} = null;
+  [@vm.direct-call.metadata=#lib::C.instanceField] [@vm.inferred-type.metadata=!? (skip check)] new self::C::•().{self::C::instanceField} = null;
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field2.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field2.dart.expect
index a5fe581..2035697 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field2.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field2.dart.expect
@@ -58,11 +58,11 @@
   new self::B::•("hi");
   self::C<core::num*>* c = new self::D::•();
   exp::Expect::throws<dynamic>(() → core::Null? {
-    [@vm.call-site-attributes.metadata=receiverType:InterfaceType(C<num*>*)] [@vm.direct-call.metadata=D.bar] c.{self::C::bar} = 3.14;
+    [@vm.call-site-attributes.metadata=receiverType:#lib::C<dart.core::num*>*] [@vm.direct-call.metadata=#lib::D.bar] c.{self::C::bar} = 3.14;
   });
   self::E* e = new self::F::•();
-  exp::Expect::equals(42, [@vm.direct-call.metadata=F.bar] [@vm.inferred-type.metadata=dart.core::_Smi (value: 42)] e.{self::E::bar});
+  exp::Expect::equals(42, [@vm.direct-call.metadata=#lib::F.bar] [@vm.inferred-type.metadata=dart.core::_Smi (value: 42)] e.{self::E::bar});
   exp::Expect::isTrue(![@vm.inferred-type.metadata=dart.core::bool] core::identical(#C2, #C4));
-  [@vm.direct-call.metadata=I.foo] [@vm.inferred-type.metadata=!? (skip check)] new self::I::•().{self::I::foo}();
+  [@vm.direct-call.metadata=#lib::I.foo] [@vm.inferred-type.metadata=!? (skip check)] new self::I::•().{self::I::foo}();
   5;
 }
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field3_nnbd.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field3_nnbd.dart.expect
index 18bfd33..b951307 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field3_nnbd.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/write_only_field3_nnbd.dart.expect
@@ -7,7 +7,7 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method use() → dynamic {
-    [@vm.direct-call.metadata=A.x] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A::x} = 3;
+    [@vm.direct-call.metadata=#lib::A.x] [@vm.inferred-type.metadata=!? (skip check)] this.{self::A::x} = 3;
   }
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasNonThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:3]  set /*isNullableByDefault*/ x(core::int value) → void;
 }
@@ -17,13 +17,13 @@
     : super core::Object::•()
     ;
 [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:1,getterSelectorId:2]  method use() → dynamic {
-    [@vm.direct-call.metadata=B.x] [@vm.inferred-type.metadata=!? (skip check)] this.{self::B::x} = 3;
+    [@vm.direct-call.metadata=#lib::B.x] [@vm.inferred-type.metadata=!? (skip check)] this.{self::B::x} = 3;
   }
 }
 [@vm.inferred-type.metadata=dart.core::_Smi?]late static final field core::int staticLateB;
 static method main() → void {
-  [@vm.direct-call.metadata=A.use] [@vm.inferred-type.metadata=!? (skip check)] new self::A::•().{self::A::use}();
-  [@vm.direct-call.metadata=B.use] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•().{self::B::use}();
+  [@vm.direct-call.metadata=#lib::A.use] [@vm.inferred-type.metadata=!? (skip check)] new self::A::•().{self::A::use}();
+  [@vm.direct-call.metadata=#lib::B.use] [@vm.inferred-type.metadata=!? (skip check)] new self::B::•().{self::B::use}();
   4;
   self::staticLateB = 4;
 }
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index 3ec3471..50a155d 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -528,14 +528,9 @@
     isolate_snapshot_data,
     isolate_snapshot_instructions,
   ]
-  args = []
-  if (!dont_use_nnbd) {
-    args += [
-      "--enable-experiment=non-nullable",
-      "--null-safety",
-    ]
-  }
-  args += [
+  args = [
+    "--enable-experiment=non-nullable",
+    "--null-safety",
     "--deterministic",
     "--snapshot_kind=" + dart_core_snapshot_kind,
     "--vm_snapshot_data=" + rebase_path(vm_snapshot_data, root_build_dir),
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 0e43ad9..56120e7 100644
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -3524,17 +3524,20 @@
 // Use the '...CSymbol' definitions for resolving through 'dlsym'. The actual
 // symbol names in the objects are given by the '...AsmSymbol' definitions.
 #if defined(__APPLE__)
+#define kSnapshotBuildIdCSymbol "kDartSnapshotBuildId"
 #define kVmSnapshotDataCSymbol "kDartVmSnapshotData"
 #define kVmSnapshotInstructionsCSymbol "kDartVmSnapshotInstructions"
 #define kIsolateSnapshotDataCSymbol "kDartIsolateSnapshotData"
 #define kIsolateSnapshotInstructionsCSymbol "kDartIsolateSnapshotInstructions"
 #else
+#define kSnapshotBuildIdCSymbol "_kDartSnapshotBuildId"
 #define kVmSnapshotDataCSymbol "_kDartVmSnapshotData"
 #define kVmSnapshotInstructionsCSymbol "_kDartVmSnapshotInstructions"
 #define kIsolateSnapshotDataCSymbol "_kDartIsolateSnapshotData"
 #define kIsolateSnapshotInstructionsCSymbol "_kDartIsolateSnapshotInstructions"
 #endif
 
+#define kSnapshotBuildIdAsmSymbol "_kDartSnapshotBuildId"
 #define kVmSnapshotDataAsmSymbol "_kDartVmSnapshotData"
 #define kVmSnapshotInstructionsAsmSymbol "_kDartVmSnapshotInstructions"
 #define kIsolateSnapshotDataAsmSymbol "_kDartIsolateSnapshotData"
diff --git a/runtime/platform/elf.h b/runtime/platform/elf.h
index 39b8e81..42c2f87 100644
--- a/runtime/platform/elf.h
+++ b/runtime/platform/elf.h
@@ -36,8 +36,10 @@
 };
 
 enum class ProgramHeaderType : uint32_t {
+  PT_NULL = 0,
   PT_LOAD = 1,
   PT_DYNAMIC = 2,
+  PT_NOTE = 4,
   PT_PHDR = 6,
 };
 
@@ -63,10 +65,22 @@
 #endif
 };
 
+enum class SectionHeaderType : uint32_t {
+  SHT_NULL = 0,
+  SHT_PROGBITS = 1,
+  SHT_SYMTAB = 2,
+  SHT_STRTAB = 3,
+  SHT_HASH = 5,
+  SHT_NOTE = 7,
+  SHT_NOBITS = 8,
+  SHT_DYNAMIC = 6,
+  SHT_DYNSYM = 11,
+};
+
 struct SectionHeader {
 #if defined(TARGET_ARCH_IS_32_BIT)
   uint32_t name;
-  uint32_t type;
+  SectionHeaderType type;
   uint32_t flags;
   uint32_t memory_offset;
   uint32_t file_offset;
@@ -77,7 +91,7 @@
   uint32_t entry_size;
 #else
   uint32_t name;
-  uint32_t type;
+  SectionHeaderType type;
   uint64_t flags;
   uint64_t memory_offset;
   uint64_t file_offset;
@@ -107,6 +121,36 @@
 #endif
 };
 
+enum class DynamicEntryType : uint32_t {
+  DT_NULL = 0,
+  DT_HASH = 4,
+  DT_STRTAB = 5,
+  DT_SYMTAB = 6,
+  DT_STRSZ = 10,
+  DT_SYMENT = 11,
+};
+
+struct DynamicEntry {
+#if defined(TARGET_ARCH_IS_32_BIT)
+  uint32_t tag;
+  uint32_t value;
+#else
+  uint64_t tag;
+  uint64_t value;
+#endif
+};
+
+enum class NoteType : uint32_t {
+  NT_GNU_BUILD_ID = 3,
+};
+
+struct Note {
+  uint32_t name_size;
+  uint32_t description_size;
+  NoteType type;
+  uint8_t data[];
+};
+
 #pragma pack(pop)
 
 static constexpr intptr_t ELFCLASS32 = 1;
@@ -134,15 +178,6 @@
 static const intptr_t PF_W = 2;
 static const intptr_t PF_R = 4;
 
-static const intptr_t SHT_NULL = 0;
-static const intptr_t SHT_PROGBITS = 1;
-static const intptr_t SHT_SYMTAB = 2;
-static const intptr_t SHT_STRTAB = 3;
-static const intptr_t SHT_HASH = 5;
-static const intptr_t SHT_NOBITS = 8;
-static const intptr_t SHT_DYNAMIC = 6;
-static const intptr_t SHT_DYNSYM = 11;
-
 static const intptr_t SHF_WRITE = 0x1;
 static const intptr_t SHF_ALLOC = 0x2;
 static const intptr_t SHF_EXECINSTR = 0x4;
@@ -151,11 +186,6 @@
 
 static const intptr_t STN_UNDEF = 0;
 
-static const intptr_t PT_NULL = 0;
-static const intptr_t PT_LOAD = 1;
-static const intptr_t PT_DYNAMIC = 2;
-static const intptr_t PT_PHDR = 6;
-
 static const intptr_t STB_LOCAL = 0;
 static const intptr_t STB_GLOBAL = 1;
 
@@ -163,12 +193,7 @@
 static const intptr_t STT_FUNC = 2;
 static const intptr_t STT_SECTION = 3;
 
-static const intptr_t DT_NULL = 0;
-static const intptr_t DT_HASH = 4;
-static const intptr_t DT_STRTAB = 5;
-static const intptr_t DT_SYMTAB = 6;
-static const intptr_t DT_STRSZ = 10;
-static const intptr_t DT_SYMENT = 11;
+static constexpr const char* ELF_NOTE_GNU = "GNU";
 
 }  // namespace elf
 }  // namespace dart
diff --git a/runtime/tests/vm/dart/random_walk_fuzzer.dart b/runtime/tests/vm/dart/random_walk_fuzzer.dart
index 633533b..60a5765 100644
--- a/runtime/tests/vm/dart/random_walk_fuzzer.dart
+++ b/runtime/tests/vm/dart/random_walk_fuzzer.dart
@@ -18,7 +18,7 @@
 import 'dart:mirrors';
 import 'dart:typed_data';
 
-var blacklist = [
+var excludeList = [
   'dart.io.exit',
   'dart.io.exitCode',
   'dart.io.sleep',
@@ -270,7 +270,7 @@
   ObjectMirror receiver = c.mirror;
   MethodMirror method = randomMethodOf(receiver);
   if (method == null) return;
-  if (blacklist.contains(MirrorSystem.getName(method.qualifiedName))) return;
+  if (excludeList.contains(MirrorSystem.getName(method.qualifiedName))) return;
 
   List positional = randomPositionalArgumentsFor(method);
   Map named = randomNamedArgumentsFor(method);
diff --git a/runtime/tests/vm/dart/split_aot_compilation_test.dart b/runtime/tests/vm/dart/split_aot_compilation_test.dart
deleted file mode 100644
index 7cba27e..0000000
--- a/runtime/tests/vm/dart/split_aot_compilation_test.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// OtherResources=splay_test.dart
-
-// Tests AOT compilation split into 2 steps using '--from-dill' option.
-
-import 'dart:io' show Platform;
-
-import 'package:path/path.dart' as path;
-import 'snapshot_test_helper.dart';
-
-main() async {
-  final testScriptUri = Platform.script.resolve('splay_test.dart');
-
-  await withTempDir((String temp) async {
-    final intermediateDillPath = path.join(temp, 'intermediate.dill');
-    final outputDillPath = path.join(temp, 'output.dill');
-    final snapshotPath = path.join(temp, 'aot.snapshot');
-
-    final extraGenKernelOptions = Platform.executableArguments
-        .where((arg) =>
-            arg.startsWith('--enable-experiment=') ||
-            arg == '--null-safety' ||
-            arg == '--no-null-safety')
-        .toList();
-
-    await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
-      ...extraGenKernelOptions,
-      '--no-aot',
-      '--link-platform',
-      '--output=$intermediateDillPath',
-      testScriptUri.toFilePath(),
-    ]);
-
-    await runGenKernel('BUILD FINAL DILL FILE', [
-      ...extraGenKernelOptions,
-      '--aot',
-      '--from-dill=$intermediateDillPath',
-      '--link-platform',
-      '--output=$outputDillPath',
-      testScriptUri.toFilePath(),
-    ]);
-
-    await runGenSnapshot('GENERATE SNAPSHOT', [
-      '--snapshot-kind=app-aot-elf',
-      '--elf=$snapshotPath',
-      outputDillPath,
-    ]);
-
-    await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
-  });
-}
diff --git a/runtime/tests/vm/dart/split_aot_kernel_generation2_test.dart b/runtime/tests/vm/dart/split_aot_kernel_generation2_test.dart
new file mode 100644
index 0000000..32b4f00
--- /dev/null
+++ b/runtime/tests/vm/dart/split_aot_kernel_generation2_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// OtherResources=../../../../tests/language/vm/regress_flutter_55345_test.dart
+
+// Runs regress_flutter_55345_test.dart using AOT kernel generation split into
+// 2 steps using '--from-dill' option.
+
+import 'dart:io' show Platform;
+
+import 'split_aot_kernel_generation_test.dart'
+    show runSplitAOTKernelGenerationTest;
+
+main() async {
+  await runSplitAOTKernelGenerationTest(Platform.script.resolve(
+      '../../../../tests/language/vm/regress_flutter_55345_test.dart'));
+}
diff --git a/runtime/tests/vm/dart/split_aot_kernel_generation_test.dart b/runtime/tests/vm/dart/split_aot_kernel_generation_test.dart
new file mode 100644
index 0000000..19865cd
--- /dev/null
+++ b/runtime/tests/vm/dart/split_aot_kernel_generation_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// OtherResources=splay_test.dart
+
+// Tests AOT kernel generation split into 2 steps using '--from-dill' option.
+
+import 'dart:io' show Platform;
+
+import 'package:path/path.dart' as path;
+import 'snapshot_test_helper.dart';
+
+Future<void> runSplitAOTKernelGenerationTest(Uri testScriptUri) async {
+  await withTempDir((String temp) async {
+    final intermediateDillPath = path.join(temp, 'intermediate.dill');
+    final outputDillPath = path.join(temp, 'output.dill');
+    final snapshotPath = path.join(temp, 'aot.snapshot');
+
+    final extraGenKernelOptions = Platform.executableArguments
+        .where((arg) =>
+            arg.startsWith('--enable-experiment=') ||
+            arg == '--null-safety' ||
+            arg == '--no-null-safety')
+        .toList();
+
+    await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
+      ...extraGenKernelOptions,
+      '--no-aot',
+      '--link-platform',
+      '--output=$intermediateDillPath',
+      testScriptUri.toFilePath(),
+    ]);
+
+    await runGenKernel('BUILD FINAL DILL FILE', [
+      ...extraGenKernelOptions,
+      '--aot',
+      '--from-dill=$intermediateDillPath',
+      '--link-platform',
+      '--output=$outputDillPath',
+      testScriptUri.toFilePath(),
+    ]);
+
+    await runGenSnapshot('GENERATE SNAPSHOT', [
+      '--snapshot-kind=app-aot-elf',
+      '--elf=$snapshotPath',
+      outputDillPath,
+    ]);
+
+    await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
+  });
+}
+
+main() async {
+  await runSplitAOTKernelGenerationTest(
+      Platform.script.resolve('splay_test.dart'));
+}
diff --git a/runtime/tests/vm/dart_2/random_walk_fuzzer.dart b/runtime/tests/vm/dart_2/random_walk_fuzzer.dart
index 633533b..60a5765 100644
--- a/runtime/tests/vm/dart_2/random_walk_fuzzer.dart
+++ b/runtime/tests/vm/dart_2/random_walk_fuzzer.dart
@@ -18,7 +18,7 @@
 import 'dart:mirrors';
 import 'dart:typed_data';
 
-var blacklist = [
+var excludeList = [
   'dart.io.exit',
   'dart.io.exitCode',
   'dart.io.sleep',
@@ -270,7 +270,7 @@
   ObjectMirror receiver = c.mirror;
   MethodMirror method = randomMethodOf(receiver);
   if (method == null) return;
-  if (blacklist.contains(MirrorSystem.getName(method.qualifiedName))) return;
+  if (excludeList.contains(MirrorSystem.getName(method.qualifiedName))) return;
 
   List positional = randomPositionalArgumentsFor(method);
   Map named = randomNamedArgumentsFor(method);
diff --git a/runtime/tests/vm/dart_2/split_aot_compilation_test.dart b/runtime/tests/vm/dart_2/split_aot_compilation_test.dart
deleted file mode 100644
index 7cba27e..0000000
--- a/runtime/tests/vm/dart_2/split_aot_compilation_test.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// OtherResources=splay_test.dart
-
-// Tests AOT compilation split into 2 steps using '--from-dill' option.
-
-import 'dart:io' show Platform;
-
-import 'package:path/path.dart' as path;
-import 'snapshot_test_helper.dart';
-
-main() async {
-  final testScriptUri = Platform.script.resolve('splay_test.dart');
-
-  await withTempDir((String temp) async {
-    final intermediateDillPath = path.join(temp, 'intermediate.dill');
-    final outputDillPath = path.join(temp, 'output.dill');
-    final snapshotPath = path.join(temp, 'aot.snapshot');
-
-    final extraGenKernelOptions = Platform.executableArguments
-        .where((arg) =>
-            arg.startsWith('--enable-experiment=') ||
-            arg == '--null-safety' ||
-            arg == '--no-null-safety')
-        .toList();
-
-    await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
-      ...extraGenKernelOptions,
-      '--no-aot',
-      '--link-platform',
-      '--output=$intermediateDillPath',
-      testScriptUri.toFilePath(),
-    ]);
-
-    await runGenKernel('BUILD FINAL DILL FILE', [
-      ...extraGenKernelOptions,
-      '--aot',
-      '--from-dill=$intermediateDillPath',
-      '--link-platform',
-      '--output=$outputDillPath',
-      testScriptUri.toFilePath(),
-    ]);
-
-    await runGenSnapshot('GENERATE SNAPSHOT', [
-      '--snapshot-kind=app-aot-elf',
-      '--elf=$snapshotPath',
-      outputDillPath,
-    ]);
-
-    await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
-  });
-}
diff --git a/runtime/tests/vm/dart_2/split_aot_kernel_generation2_test.dart b/runtime/tests/vm/dart_2/split_aot_kernel_generation2_test.dart
new file mode 100644
index 0000000..da7925a
--- /dev/null
+++ b/runtime/tests/vm/dart_2/split_aot_kernel_generation2_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// OtherResources=../../../../tests/language_2/vm/regress_flutter_55345_test.dart
+
+// Runs regress_flutter_55345_test.dart using AOT kernel generation split into
+// 2 steps using '--from-dill' option.
+
+import 'dart:io' show Platform;
+
+import 'split_aot_kernel_generation_test.dart'
+    show runSplitAOTKernelGenerationTest;
+
+main() async {
+  await runSplitAOTKernelGenerationTest(Platform.script.resolve(
+      '../../../../tests/language_2/vm/regress_flutter_55345_test.dart'));
+}
diff --git a/runtime/tests/vm/dart_2/split_aot_kernel_generation_test.dart b/runtime/tests/vm/dart_2/split_aot_kernel_generation_test.dart
new file mode 100644
index 0000000..19865cd
--- /dev/null
+++ b/runtime/tests/vm/dart_2/split_aot_kernel_generation_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// OtherResources=splay_test.dart
+
+// Tests AOT kernel generation split into 2 steps using '--from-dill' option.
+
+import 'dart:io' show Platform;
+
+import 'package:path/path.dart' as path;
+import 'snapshot_test_helper.dart';
+
+Future<void> runSplitAOTKernelGenerationTest(Uri testScriptUri) async {
+  await withTempDir((String temp) async {
+    final intermediateDillPath = path.join(temp, 'intermediate.dill');
+    final outputDillPath = path.join(temp, 'output.dill');
+    final snapshotPath = path.join(temp, 'aot.snapshot');
+
+    final extraGenKernelOptions = Platform.executableArguments
+        .where((arg) =>
+            arg.startsWith('--enable-experiment=') ||
+            arg == '--null-safety' ||
+            arg == '--no-null-safety')
+        .toList();
+
+    await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
+      ...extraGenKernelOptions,
+      '--no-aot',
+      '--link-platform',
+      '--output=$intermediateDillPath',
+      testScriptUri.toFilePath(),
+    ]);
+
+    await runGenKernel('BUILD FINAL DILL FILE', [
+      ...extraGenKernelOptions,
+      '--aot',
+      '--from-dill=$intermediateDillPath',
+      '--link-platform',
+      '--output=$outputDillPath',
+      testScriptUri.toFilePath(),
+    ]);
+
+    await runGenSnapshot('GENERATE SNAPSHOT', [
+      '--snapshot-kind=app-aot-elf',
+      '--elf=$snapshotPath',
+      outputDillPath,
+    ]);
+
+    await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
+  });
+}
+
+main() async {
+  await runSplitAOTKernelGenerationTest(
+      Platform.script.resolve('splay_test.dart'));
+}
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 0f68bb2..c8912f5 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -88,10 +88,12 @@
 [ $builder_tag == crossword || $builder_tag == crossword_ast ]
 dart/emit_aot_size_info_flag_test: SkipByDesign # The test itself cannot determine the location of gen_snapshot (only tools/test.py knows where it is).
 dart/bytecode_with_ast_in_aot_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
-dart/split_aot_compilation_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
+dart/split_aot_kernel_generation_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
+dart/split_aot_kernel_generation2_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
 dart_2/emit_aot_size_info_flag_test: SkipByDesign # The test itself cannot determine the location of gen_snapshot (only tools/test.py knows where it is).
 dart_2/bytecode_with_ast_in_aot_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
-dart_2/split_aot_compilation_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
+dart_2/split_aot_kernel_generation_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
+dart_2/split_aot_kernel_generation2_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
 
 [ $builder_tag == obfuscated ]
 dart/causal_stacks/async_throws_stack_lazy_test: SkipByDesign # Asserts exact stacktrace output.
@@ -410,11 +412,13 @@
 dart/emit_aot_size_info_flag_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
 dart/use_bare_instructions_flag_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
 dart/bytecode_with_ast_in_aot_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
-dart/split_aot_compilation_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
+dart/split_aot_kernel_generation_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
+dart/split_aot_kernel_generation2_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
 dart_2/emit_aot_size_info_flag_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
 dart_2/use_bare_instructions_flag_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
 dart_2/bytecode_with_ast_in_aot_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
-dart_2/split_aot_compilation_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
+dart_2/split_aot_kernel_generation_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
+dart_2/split_aot_kernel_generation2_test: SkipByDesign # This test is for VM AOT only and is quite slow (so we don't run it in debug mode).
 
 # It makes no sense to run any test that uses spawnURI under the simulator
 # as that would involve running CFE (the front end) in simulator mode
diff --git a/runtime/tools/dartfuzz/gen_api_table.dart b/runtime/tools/dartfuzz/gen_api_table.dart
index 9969291..d3799b6 100644
--- a/runtime/tools/dartfuzz/gen_api_table.dart
+++ b/runtime/tools/dartfuzz/gen_api_table.dart
@@ -609,7 +609,7 @@
   }
   // Avoid the exit function and other functions that give false divergences.
   // Note: to prevent certain constructors from being emitted, update the
-  // blacklist in `shouldFilterConstructor` in gen_type_table.dart and
+  // exclude list in `shouldFilterConstructor` in gen_type_table.dart and
   // regenerate the type table.
   if (name == 'exit' ||
       name == 'pid' ||
diff --git a/runtime/tools/dartfuzz/gen_type_table.dart b/runtime/tools/dartfuzz/gen_type_table.dart
index f6d0249..033e4ab 100644
--- a/runtime/tools/dartfuzz/gen_type_table.dart
+++ b/runtime/tools/dartfuzz/gen_type_table.dart
@@ -866,11 +866,11 @@
   }
 }
 
-// Filters methods based on a manually maintained blacklist.
+// Filters methods based on a manually maintained exclude list.
 //
-// Blacklisted methods should be associated with an issue number so they can be
+// Excluded methods should be associated with an issue number so they can be
 // re-enabled after the issue is resolved.
-bool isBlacklistedMethod(InterfaceType tp, MethodElement method) {
+bool isExcludedMethod(InterfaceType tp, MethodElement method) {
   // TODO(bkonyi): Enable operator / for these types after we resolve
   // https://github.com/dart-lang/sdk/issues/39890
   if (((tp.displayName == 'Float32x4') && (method.name == '/')) ||
@@ -888,8 +888,8 @@
 // Does not recurse into interfaces and superclasses of tp.
 void getOperatorsForTyp(String typName, InterfaceType tp, fromLiteral) {
   for (MethodElement method in tp.methods) {
-    // If the method is manually blacklisted, skip it.
-    if (isBlacklistedMethod(tp, method)) continue;
+    // If the method is manually excluded, skip it.
+    if (isExcludedMethod(tp, method)) continue;
 
     // Detect whether tp can be parsed from a literal (dartfuzz.dart can
     // already handle that).
@@ -1035,7 +1035,7 @@
   if (cons.name.startsWith('_')) {
     return true;
   }
-  // Constructor blacklist
+  // Constructor exclude list
   // TODO(bkonyi): Enable Float32x4.fromInt32x4Bits after we resolve
   // https://github.com/dart-lang/sdk/issues/39890
   if ((tp.displayName == 'Float32x4') && (cons.name == 'fromInt32x4Bits')) {
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
index 395b15f..3888a2b 100644
--- a/runtime/vm/BUILD.gn
+++ b/runtime/vm/BUILD.gn
@@ -155,12 +155,7 @@
     }
     single_root_scheme = "org-dartlang-sdk"
     single_root_base = rebase_path("../../")
-    if (!dont_use_nnbd) {
-      libraries_specification_uri =
-          "org-dartlang-sdk:///sdk_nnbd/lib/libraries.json"
-    } else {
-      libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
-    }
+    libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
     outputs = [
       "$root_out_dir/vm_platform" + output_postfix + ".dill",
       "$root_out_dir/vm_outline" + output_postfix + ".dill",
@@ -172,11 +167,9 @@
       "-Ddart.vm.product=$is_product_flag",
       "-Ddart.developer.causal_async_stacks=$allow_causal_async_stacks",
       "-Ddart.isVM=true",
+      "--enable-experiment=non-nullable",
+      "--nnbd-agnostic",
     ]
-    if (!dont_use_nnbd) {
-      args += [ "--enable-experiment=non-nullable" ]
-      args += [ "--nnbd-agnostic" ]
-    }
     if (defined(invoker.exclude_source) && invoker.exclude_source) {
       args += [ "--exclude-source" ]
     }
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index f76f58b..31f6896 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -180,7 +180,7 @@
                                /* benchmark_read_bytecode */ true));
 }
 
-BENCHMARK(GenKernelKernelMaxRSS) {
+BENCHMARK_MEMORY(GenKernelKernelMaxRSS) {
   GenKernelKernelBenchmark("GenKernelKernelMaxRSS benchmark",
                            /* benchmark_load */ false,
                            /* benchmark_read_bytecode */ true);
diff --git a/runtime/vm/compiler/backend/flow_graph.cc b/runtime/vm/compiler/backend/flow_graph.cc
index fd395e0..c285c51 100644
--- a/runtime/vm/compiler/backend/flow_graph.cc
+++ b/runtime/vm/compiler/backend/flow_graph.cc
@@ -1669,21 +1669,12 @@
         instr_it.RemoveCurrentFromGraph();
       } else if (keep_checks) {
         continue;
-      } else if (auto check = instruction->AsCheckArrayBound()) {
-        check->ReplaceUsesWith(check->index()->definition());
-        check->ClearSSATempIndex();
-      } else if (auto check = instruction->AsGenericCheckBound()) {
-        check->ReplaceUsesWith(check->index()->definition());
-        check->ClearSSATempIndex();
-      } else if (auto check = instruction->AsCheckNull()) {
-        check->ReplaceUsesWith(check->value()->definition());
-        check->ClearSSATempIndex();
-      } else if (auto check = instruction->AsAssertAssignable()) {
-        check->ReplaceUsesWith(check->value()->definition());
-        check->ClearSSATempIndex();
-      } else if (auto check = instruction->AsAssertBoolean()) {
-        check->ReplaceUsesWith(check->value()->definition());
-        check->ClearSSATempIndex();
+      } else if (auto def = instruction->AsDefinition()) {
+        Value* value = def->RedefinedValue();
+        if (value != nullptr) {
+          def->ReplaceUsesWith(value->definition());
+          def->ClearSSATempIndex();
+        }
       }
     }
   }
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 103df3f..b3800b5 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -6443,9 +6443,10 @@
   StreamingWriteStream debug_stream(generate_debug ? kInitialDebugSize : 0,
                                     callback, debug_callback_data);
 
-  auto const elf = generate_debug ? new (Z)
-                                        Elf(Z, &debug_stream, new (Z) Dwarf(Z))
-                                  : nullptr;
+  auto const elf = generate_debug
+                       ? new (Z) Elf(Z, &debug_stream, Elf::Type::DebugInfo,
+                                     new (Z) Dwarf(Z))
+                       : nullptr;
 
   AssemblyImageWriter image_writer(T, callback, callback_data, strip, elf);
   uint8_t* vm_snapshot_data_buffer = NULL;
@@ -6517,49 +6518,23 @@
                                     callback, debug_callback_data);
 
   auto const dwarf = strip ? nullptr : new (Z) Dwarf(Z);
-  auto const elf = new (Z) Elf(Z, &elf_stream, dwarf);
-  // Re-use the same DWARF object if unstripped.
+  auto const elf = new (Z) Elf(Z, &elf_stream, Elf::Type::Snapshot, dwarf);
+  // Re-use the same DWARF object if the snapshot is unstripped.
   auto const debug_elf =
-      generate_debug
-          ? new (Z) Elf(Z, &debug_stream, strip ? new (Z) Dwarf(Z) : dwarf)
-          : nullptr;
-
-  // Here, both VM and isolate will be compiled into a single snapshot.
-  // In assembly generation, each serialized text section gets a separate
-  // pointer into the BSS segment and BSS slots are created for each, since
-  // we may not serialize both VM and isolate. Here, we always serialize both,
-  // so make a BSS segment large enough for both, with the VM entries coming
-  // first.
-  auto const isolate_offset = BSS::kVmEntryCount * compiler::target::kWordSize;
-  auto const bss_size =
-      isolate_offset + BSS::kIsolateEntryCount * compiler::target::kWordSize;
-  // Note that the BSS section must come first because it cannot be placed in
-  // between any two non-writable segments, due to a bug in Jelly Bean's ELF
-  // loader. See also Elf::WriteProgramTable().
-  const intptr_t vm_bss_base = elf->AddBSSData("_kDartBSSData", bss_size);
-  const intptr_t isolate_bss_base = vm_bss_base + isolate_offset;
-  // Add the BSS section to the separately saved debugging information, even
-  // though there will be no code in it to relocate, since it precedes the
-  // .text sections and thus affects their virtual addresses.
-  if (debug_elf != nullptr) {
-    debug_elf->AddBSSData("_kDartBSSData", bss_size);
-  }
+      generate_debug ? new (Z) Elf(Z, &debug_stream, Elf::Type::DebugInfo,
+                                   strip ? new (Z) Dwarf(Z) : dwarf)
+                     : nullptr;
 
   BlobImageWriter vm_image_writer(T, &vm_snapshot_instructions_buffer,
-                                  ApiReallocate, kInitialSize, debug_elf,
-                                  vm_bss_base, elf);
+                                  ApiReallocate, kInitialSize, debug_elf, elf);
   BlobImageWriter isolate_image_writer(T, &isolate_snapshot_instructions_buffer,
                                        ApiReallocate, kInitialSize, debug_elf,
-                                       isolate_bss_base, elf);
+                                       elf);
   FullSnapshotWriter writer(Snapshot::kFullAOT, &vm_snapshot_data_buffer,
                             &isolate_snapshot_data_buffer, ApiReallocate,
                             &vm_image_writer, &isolate_image_writer);
 
   writer.WriteFullSnapshot();
-  elf->AddROData(kVmSnapshotDataAsmSymbol, vm_snapshot_data_buffer,
-                 writer.VmIsolateSnapshotSize());
-  elf->AddROData(kIsolateSnapshotDataAsmSymbol, isolate_snapshot_data_buffer,
-                 writer.IsolateSnapshotSize());
 
   elf->Finalize();
   if (debug_elf != nullptr) {
diff --git a/runtime/vm/elf.cc b/runtime/vm/elf.cc
index ee170f2..2ce45e3 100644
--- a/runtime/vm/elf.cc
+++ b/runtime/vm/elf.cc
@@ -14,24 +14,6 @@
 
 namespace dart {
 
-#if defined(TARGET_ARCH_IS_32_BIT)
-static const intptr_t kElfHeaderSize = 52;
-static const intptr_t kElfSectionTableAlignment = 4;
-static const intptr_t kElfSectionTableEntrySize = 40;
-static const intptr_t kElfProgramTableEntrySize = 32;
-static const intptr_t kElfSymbolTableEntrySize = 16;
-static const intptr_t kElfDynamicTableEntrySize = 8;
-static const intptr_t kElfSymbolHashTableEntrySize = 4;
-#else
-static const intptr_t kElfHeaderSize = 64;
-static const intptr_t kElfSectionTableAlignment = 8;
-static const intptr_t kElfSectionTableEntrySize = 64;
-static const intptr_t kElfProgramTableEntrySize = 56;
-static const intptr_t kElfSymbolTableEntrySize = 24;
-static const intptr_t kElfDynamicTableEntrySize = 16;
-static const intptr_t kElfSymbolHashTableEntrySize = 4;
-#endif
-
 // A wrapper around StreamingWriteStream that provides methods useful for
 // writing ELF files (e.g., using ELF definitions of data sizes).
 class ElfWriteStream : public ValueObject {
@@ -72,164 +54,139 @@
   StreamingWriteStream* const stream_;
 };
 
-#define DEFINE_LINEAR_FIELD_METHODS(name, type, init)                          \
-  type name() const {                                                          \
-    ASSERT(name##_ != init);                                                   \
+static constexpr intptr_t kLinearInitValue = -1;
+
+#define DEFINE_LINEAR_FIELD_METHODS(name)                                      \
+  intptr_t name() const {                                                      \
+    ASSERT(name##_ != kLinearInitValue);                                       \
     return name##_;                                                            \
   }                                                                            \
-  void set_##name(type value) {                                                \
-    ASSERT_EQUAL(name##_, init);                                               \
+  bool name##_is_set() const { return name##_ != kLinearInitValue; }           \
+  void set_##name(intptr_t value) {                                            \
+    ASSERT(value != kLinearInitValue);                                         \
+    ASSERT_EQUAL(name##_, kLinearInitValue);                                   \
     name##_ = value;                                                           \
   }
 
-#define DEFINE_LINEAR_FIELD(name, type, init) type name##_ = init;
+#define DEFINE_LINEAR_FIELD(name) intptr_t name##_ = kLinearInitValue;
 
-// Used for segments that should not be used as sections.
-static constexpr intptr_t kInvalidSection = -1;
+class BitsContainer;
+class Segment;
+
+static constexpr intptr_t kDefaultAlignment = -1;
+// Align note sections and segments to 4 byte boundries.
+static constexpr intptr_t kNoteAlignment = 4;
 
 class Section : public ZoneAllocated {
  public:
-  Section(intptr_t type,
-          intptr_t segment_type,
+  Section(elf::SectionHeaderType t,
           bool allocate,
           bool executable,
           bool writable,
-          intptr_t alignment = 1)
-      : section_type(type),
-        section_flags(EncodeSectionFlags(allocate, executable, writable)),
-        alignment(allocate ? SegmentAlignment(alignment) : alignment),
-        segment_type(segment_type),
-        segment_flags(EncodeSegmentFlags(allocate, executable, writable)),
+          intptr_t align = kDefaultAlignment)
+      : type(t),
+        flags(EncodeFlags(allocate, executable, writable)),
+        alignment(align == kDefaultAlignment ? DefaultAlignment(t) : align),
         // Non-segments will never have a memory offset, here represented by 0.
-        memory_offset_(allocate ? -1 : 0) {
-    // Only the reserved section (type 0) has (and must have) an alignment of 0.
-    ASSERT(type == elf::SHT_NULL || alignment > 0);
-    ASSERT(alignment == 0 || type != elf::SHT_NULL);
-    // Segment-only entries should have a set segment_type.
-    ASSERT(type != kInvalidSection || segment_type != elf::PT_NULL);
+        memory_offset_(allocate ? kLinearInitValue : 0) {
+    // Only sections with type SHT_NULL are allowed to have an alignment of 0.
+    ASSERT(type == elf::SectionHeaderType::SHT_NULL || alignment > 0);
+    // Non-zero alignments must be a power of 2.
+    ASSERT(alignment == 0 || Utils::IsPowerOfTwo(alignment));
   }
 
-  // The constructor that most subclasses will use.
-  Section(intptr_t type,
-          bool allocate,
-          bool executable,
-          bool writable,
-          intptr_t alignment = 1)
-      : Section(type,
-                /*segment_type=*/allocate ? elf::PT_LOAD : elf::PT_NULL,
-                allocate,
-                executable,
-                writable,
-                alignment) {}
-
   virtual ~Section() {}
 
   // Linker view.
-  const intptr_t section_type;
-  const intptr_t section_flags;
+  const elf::SectionHeaderType type;
+  const intptr_t flags;
   const intptr_t alignment;
 
   // These are fields that only are not set for most kinds of sections and so we
   // set them to a reasonable default.
-  intptr_t section_link = elf::SHN_UNDEF;
-  intptr_t section_info = 0;
-  intptr_t section_entry_size = 0;
+  intptr_t link = elf::SHN_UNDEF;
+  intptr_t info = 0;
+  intptr_t entry_size = 0;
 
-  static constexpr intptr_t kInitValue = -1;
+  // Stores the name for the symbol that should be created in the dynamic (and
+  // static, if unstripped) tables for this section.
+  const char* symbol_name = nullptr;
 
 #define FOR_EACH_SECTION_LINEAR_FIELD(M)                                       \
-  M(section_name, intptr_t, kInitValue)                                        \
-  M(section_index, intptr_t, kInitValue)                                       \
-  M(file_offset, intptr_t, kInitValue)
+  M(name)                                                                      \
+  M(index)                                                                     \
+  M(file_offset)
 
   FOR_EACH_SECTION_LINEAR_FIELD(DEFINE_LINEAR_FIELD_METHODS);
 
   virtual intptr_t FileSize() const = 0;
 
   // Loader view.
-  const intptr_t segment_type;
-  const intptr_t segment_flags;
-
-#define FOR_EACH_SEGMENT_LINEAR_FIELD(M) M(memory_offset, intptr_t, kInitValue)
+#define FOR_EACH_SEGMENT_LINEAR_FIELD(M) M(memory_offset)
 
   FOR_EACH_SEGMENT_LINEAR_FIELD(DEFINE_LINEAR_FIELD_METHODS);
 
+  // Each section belongs to at most one PT_LOAD segment.
+  const Segment* load_segment = nullptr;
+
   virtual intptr_t MemorySize() const = 0;
 
   // Other methods.
 
+  bool IsAllocated() const {
+    return (flags & elf::SHF_ALLOC) == elf::SHF_ALLOC;
+  }
+  bool IsExecutable() const {
+    return (flags & elf::SHF_EXECINSTR) == elf::SHF_EXECINSTR;
+  }
+  bool IsWritable() const { return (flags & elf::SHF_WRITE) == elf::SHF_WRITE; }
+
   // Returns whether new content can be added to a section.
   bool HasBeenFinalized() const {
-    if (segment_type != elf::PT_NULL) {
-      // The contents of a segment must not change after the segment is added
-      // (when its memory offset is calculated).
-      return memory_offset_ != kInitValue;
+    if (IsAllocated()) {
+      // The contents of a section that is allocated (part of a segment) must
+      // not change after the section is added.
+      return memory_offset_is_set();
     } else {
-      // Sections with an in-memory segment can have new content added until
-      // we calculate file offsets.
-      return file_offset_ != kInitValue;
+      // Unallocated sections can have new content added until we calculate
+      // file offsets.
+      return file_offset_is_set();
     }
   }
 
+  virtual const BitsContainer* AsBitsContainer() const { return nullptr; }
+
+  // Writes the file contents of the section.
   virtual void Write(ElfWriteStream* stream) = 0;
 
-  void WriteSegmentEntry(ElfWriteStream* stream) {
-    // This should never be used on sections without a segment.
-    ASSERT(segment_type != elf::PT_NULL);
-    ASSERT(MemorySize() > 0);
+  virtual void WriteSectionHeader(ElfWriteStream* stream) {
 #if defined(TARGET_ARCH_IS_32_BIT)
-    stream->WriteWord(segment_type);
-    stream->WriteOff(file_offset());
-    stream->WriteAddr(memory_offset());  // Virtual address.
-    stream->WriteAddr(memory_offset());  // Physical address, not used.
-    stream->WriteWord(FileSize());
-    stream->WriteWord(MemorySize());
-    stream->WriteWord(segment_flags);
-    stream->WriteWord(alignment);
-#else
-    stream->WriteWord(segment_type);
-    stream->WriteWord(segment_flags);
-    stream->WriteOff(file_offset());
-    stream->WriteAddr(memory_offset());  // Virtual address.
-    stream->WriteAddr(memory_offset());  // Physical address, not used.
-    stream->WriteXWord(FileSize());
-    stream->WriteXWord(MemorySize());
-    stream->WriteXWord(alignment);
-#endif
-  }
-
-  void WriteSectionEntry(ElfWriteStream* stream) {
-    // Segment-only entries should not be in sections_.
-    ASSERT(section_type != kInvalidSection);
-#if defined(TARGET_ARCH_IS_32_BIT)
-    stream->WriteWord(section_name());
-    stream->WriteWord(section_type);
-    stream->WriteWord(section_flags);
+    stream->WriteWord(name());
+    stream->WriteWord(static_cast<uint32_t>(type));
+    stream->WriteWord(flags);
     stream->WriteAddr(memory_offset());
     stream->WriteOff(file_offset());
     stream->WriteWord(FileSize());  // Has different meaning for BSS.
-    stream->WriteWord(section_link);
-    stream->WriteWord(section_info);
+    stream->WriteWord(link);
+    stream->WriteWord(info);
     stream->WriteWord(alignment);
-    stream->WriteWord(section_entry_size);
+    stream->WriteWord(entry_size);
 #else
-    stream->WriteWord(section_name());
-    stream->WriteWord(section_type);
-    stream->WriteXWord(section_flags);
+    stream->WriteWord(name());
+    stream->WriteWord(static_cast<uint32_t>(type));
+    stream->WriteXWord(flags);
     stream->WriteAddr(memory_offset());
     stream->WriteOff(file_offset());
     stream->WriteXWord(FileSize());  // Has different meaning for BSS.
-    stream->WriteWord(section_link);
-    stream->WriteWord(section_info);
+    stream->WriteWord(link);
+    stream->WriteWord(info);
     stream->WriteXWord(alignment);
-    stream->WriteXWord(section_entry_size);
+    stream->WriteXWord(entry_size);
 #endif
   }
 
  private:
-  static intptr_t EncodeSectionFlags(bool allocate,
-                                     bool executable,
-                                     bool writable) {
+  static intptr_t EncodeFlags(bool allocate, bool executable, bool writable) {
     if (!allocate) return 0;
     intptr_t flags = elf::SHF_ALLOC;
     if (executable) flags |= elf::SHF_EXECINSTR;
@@ -237,18 +194,16 @@
     return flags;
   }
 
-  static intptr_t EncodeSegmentFlags(bool allocate,
-                                     bool executable,
-                                     bool writable) {
-    if (!allocate) return 0;
-    intptr_t flags = elf::PF_R;
-    if (executable) flags |= elf::PF_X;
-    if (writable) flags |= elf::PF_W;
-    return flags;
-  }
-
-  static intptr_t SegmentAlignment(intptr_t alignment) {
-    return alignment < Elf::kPageSize ? Elf::kPageSize : alignment;
+  static intptr_t DefaultAlignment(elf::SectionHeaderType type) {
+    switch (type) {
+      case elf::SectionHeaderType::SHT_SYMTAB:
+      case elf::SectionHeaderType::SHT_DYNSYM:
+      case elf::SectionHeaderType::SHT_HASH:
+      case elf::SectionHeaderType::SHT_DYNAMIC:
+        return compiler::target::kWordSize;
+      default:
+        return 1;
+    }
   }
 
   FOR_EACH_SECTION_LINEAR_FIELD(DEFINE_LINEAR_FIELD);
@@ -261,18 +216,158 @@
 #undef DEFINE_LINEAR_FIELD
 #undef DEFINE_LINEAR_FIELD_METHODS
 
+class Segment : public ZoneAllocated {
+ public:
+  Segment(Zone* zone,
+          Section* initial_section,
+          elf::ProgramHeaderType segment_type)
+      : type(segment_type),
+        // Flags for the segment are the same as the initial section.
+        flags(EncodeFlags(ASSERT_NOTNULL(initial_section)->IsExecutable(),
+                          ASSERT_NOTNULL(initial_section)->IsWritable())),
+        sections_(zone, 0) {
+    // Unlike sections, we don't have a reserved segment with the null type,
+    // so we never should pass this value.
+    ASSERT(segment_type != elf::ProgramHeaderType::PT_NULL);
+    // All segments should have at least one section. The first one is added
+    // during initialization. Unlike others added later, it should already have
+    // a memory offset since we use it to determine the segment memory offset.
+    ASSERT(initial_section->IsAllocated());
+    ASSERT(initial_section->memory_offset_is_set());
+    sections_.Add(initial_section);
+    if (type == elf::ProgramHeaderType::PT_LOAD) {
+      ASSERT(initial_section->load_segment == nullptr);
+      initial_section->load_segment = this;
+    }
+  }
+
+  virtual ~Segment() {}
+
+  static intptr_t Alignment(elf::ProgramHeaderType segment_type) {
+    switch (segment_type) {
+      case elf::ProgramHeaderType::PT_DYNAMIC:
+        return compiler::target::kWordSize;
+      case elf::ProgramHeaderType::PT_NOTE:
+        return kNoteAlignment;
+      default:
+        return Elf::kPageSize;
+    }
+  }
+
+  bool IsExecutable() const { return (flags & elf::PF_X) == elf::PF_X; }
+  bool IsWritable() const { return (flags & elf::PF_W) == elf::PF_W; }
+
+  void WriteProgramHeader(ElfWriteStream* stream) {
+#if defined(TARGET_ARCH_IS_32_BIT)
+    stream->WriteWord(static_cast<uint32_t>(type));
+    stream->WriteOff(FileOffset());
+    stream->WriteAddr(MemoryOffset());  // Virtual address.
+    stream->WriteAddr(MemoryOffset());  // Physical address, not used.
+    stream->WriteWord(FileSize());
+    stream->WriteWord(MemorySize());
+    stream->WriteWord(flags);
+    stream->WriteWord(Alignment(type));
+#else
+    stream->WriteWord(static_cast<uint32_t>(type));
+    stream->WriteWord(flags);
+    stream->WriteOff(FileOffset());
+    stream->WriteAddr(MemoryOffset());  // Virtual address.
+    stream->WriteAddr(MemoryOffset());  // Physical address, not used.
+    stream->WriteXWord(FileSize());
+    stream->WriteXWord(MemorySize());
+    stream->WriteXWord(Alignment(type));
+#endif
+  }
+
+  // Adds the given section to this segment.
+  //
+  // Returns whether the Section could be added to the segment. If not, a
+  // new segment will need to be created for this section.
+  //
+  // Sets the memory offset of the section if added.
+  bool Add(Section* section) {
+    // We only add additional sections to load segments.
+    ASSERT(type == elf::ProgramHeaderType::PT_LOAD);
+    ASSERT(section != nullptr);
+    // Only sections with the allocate flag set should be added to segments,
+    // and sections with already-set memory offsets cannot be added.
+    ASSERT(section->IsAllocated());
+    ASSERT(!section->memory_offset_is_set());
+    ASSERT(section->load_segment == nullptr);
+    switch (sections_.Last()->type) {
+      // We only use SHT_NULL sections as pseudo sections that will not appear
+      // in the final ELF file. Don't pack sections into these segments, as we
+      // may remove/replace the segments during finalization.
+      case elf::SectionHeaderType::SHT_NULL:
+      // If the last section in the segments is NOBITS, then we don't add it,
+      // as otherwise we'll be guaranteed the file offset and memory offset
+      // won't be page aligned without padding.
+      case elf::SectionHeaderType::SHT_NOBITS:
+        return false;
+      default:
+        break;
+    }
+    // We don't add if the W or X bits don't match.
+    if (IsExecutable() != section->IsExecutable() ||
+        IsWritable() != section->IsWritable()) {
+      return false;
+    }
+    auto const start_address = Utils::RoundUp(MemoryEnd(), section->alignment);
+    section->set_memory_offset(start_address);
+    sections_.Add(section);
+    section->load_segment = this;
+    return true;
+  }
+
+  intptr_t FileOffset() const { return sections_[0]->file_offset(); }
+
+  intptr_t FileSize() const {
+    auto const last = sections_.Last();
+    const intptr_t end = last->file_offset() + last->FileSize();
+    return end - FileOffset();
+  }
+
+  intptr_t MemoryOffset() const { return sections_[0]->memory_offset(); }
+
+  intptr_t MemorySize() const {
+    auto const last = sections_.Last();
+    const intptr_t end = last->memory_offset() + last->MemorySize();
+    return end - MemoryOffset();
+  }
+
+  intptr_t MemoryEnd() const { return MemoryOffset() + MemorySize(); }
+
+ private:
+  static constexpr intptr_t kInitValue = -1;
+  static_assert(kInitValue < 0, "init value must be negative");
+
+  static intptr_t EncodeFlags(bool executable, bool writable) {
+    intptr_t flags = elf::PF_R;
+    if (executable) flags |= elf::PF_X;
+    if (writable) flags |= elf::PF_W;
+    return flags;
+  }
+
+ public:
+  const elf::ProgramHeaderType type;
+  const intptr_t flags;
+
+ private:
+  GrowableArray<const Section*> sections_;
+};
+
 // Represents the first entry in the section table, which should only contain
 // zero values and does not correspond to a memory segment.
 class ReservedSection : public Section {
  public:
   ReservedSection()
-      : Section(/*type=*/elf::SHT_NULL,
+      : Section(elf::SectionHeaderType::SHT_NULL,
                 /*allocate=*/false,
                 /*executable=*/false,
                 /*writable=*/false,
                 /*alignment=*/0) {
-    set_section_name(0);
-    set_section_index(0);
+    set_name(0);
+    set_index(0);
     set_file_offset(0);
   }
 
@@ -281,40 +376,31 @@
   void Write(ElfWriteStream* stream) {}
 };
 
-class BlobSection : public Section {
+// Represents portions of the file/memory space which do not correspond to
+// actual sections. Should never be added to sections_.
+class PseudoSection : public Section {
  public:
-  BlobSection(intptr_t type,
-              intptr_t segment_type,
-              bool allocate,
-              bool executable,
-              bool writable,
-              intptr_t filesz,
-              intptr_t memsz,
-              int alignment = 1)
-      : Section(type, segment_type, allocate, executable, writable, alignment),
-        file_size_(filesz),
-        memory_size_(allocate ? memsz : 0) {}
-
-  BlobSection(intptr_t type,
-              bool allocate,
-              bool executable,
-              bool writable,
-              intptr_t filesz,
-              intptr_t memsz,
-              int alignment = 1)
-      : BlobSection(type,
-                    /*segment_type=*/allocate ? elf::PT_LOAD : 0,
-                    allocate,
-                    executable,
-                    writable,
-                    filesz,
-                    memsz,
-                    alignment) {}
+  PseudoSection(bool executable,
+                bool writable,
+                intptr_t file_offset,
+                intptr_t file_size,
+                intptr_t memory_offset,
+                intptr_t memory_size)
+      : Section(elf::SectionHeaderType::SHT_NULL,
+                /*allocate=*/true,
+                executable,
+                writable,
+                /*alignment=*/0),
+        file_size_(file_size),
+        memory_size_(memory_size) {
+    set_file_offset(file_offset);
+    set_memory_offset(memory_offset);
+  }
 
   intptr_t FileSize() const { return file_size_; }
   intptr_t MemorySize() const { return memory_size_; }
-
-  virtual void Write(ElfWriteStream* stream) = 0;
+  void WriteSectionHeader(ElfWriteStream* stream) { UNREACHABLE(); }
+  void Write(ElfWriteStream* stream) { UNREACHABLE(); }
 
  private:
   const intptr_t file_size_;
@@ -322,27 +408,23 @@
 };
 
 // A segment for representing the program header table self-reference in the
-// program header table. There is no corresponding section for this segment.
-class ProgramTableSelfSegment : public BlobSection {
+// program header table.
+class ProgramTableSelfSegment : public Segment {
  public:
-  ProgramTableSelfSegment(intptr_t offset, intptr_t size)
-      : BlobSection(/*type=*/kInvalidSection,
-                    /*segment_type=*/elf::PT_PHDR,
-                    /*allocate=*/true,
-                    /*executable=*/false,
-                    /*writable=*/false,
-                    /*filesz=*/size,
-                    /*memsz=*/size) {
-    set_file_offset(offset);
-    set_memory_offset(offset);
-  }
-
-  void Write(ElfWriteStream* stream) { UNREACHABLE(); }
+  ProgramTableSelfSegment(Zone* zone, intptr_t offset, intptr_t size)
+      : Segment(zone,
+                new (zone) PseudoSection(/*executable=*/false,
+                                         /*writable=*/false,
+                                         offset,
+                                         size,
+                                         offset,
+                                         size),
+                elf::ProgramHeaderType::PT_PHDR) {}
 };
 
 // A segment for representing the program header table load segment in the
-// program header table. There is no corresponding section for this segment.
-class ProgramTableLoadSegment : public BlobSection {
+// program header table.
+class ProgramTableLoadSegment : public Segment {
  public:
   // The Android dynamic linker in Jelly Bean incorrectly assumes that all
   // non-writable segments are continguous. Since the BSS segment comes directly
@@ -352,64 +434,95 @@
   //
   // The bug is here:
   //   https://github.com/aosp-mirror/platform_bionic/blob/94963af28e445384e19775a838a29e6a71708179/linker/linker.c#L1991-L2001
-  explicit ProgramTableLoadSegment(intptr_t size)
-      : BlobSection(/*type=*/kInvalidSection,
-                    /*allocate=*/true,
-                    /*executable=*/false,
-                    /*writable=*/true,
-                    /*filesz=*/size,
-                    /*memsz=*/size) {
-    set_file_offset(0);
-    set_memory_offset(0);
+  explicit ProgramTableLoadSegment(Zone* zone, intptr_t size)
+      : Segment(zone,
+                // This segment should always start at address 0.
+                new (zone) PseudoSection(/*executable=*/false,
+                                         /*writable=*/true,
+                                         0,
+                                         size,
+                                         0,
+                                         size),
+                elf::ProgramHeaderType::PT_LOAD) {}
+};
+
+class BitsContainer : public Section {
+ public:
+  // Fully specified BitsContainer information.
+  BitsContainer(elf::SectionHeaderType type,
+                bool allocate,
+                bool executable,
+                bool writable,
+                intptr_t size,
+                const uint8_t* bytes,
+                int alignment = kDefaultAlignment)
+      : Section(type, allocate, executable, writable, alignment),
+        file_size_(type == elf::SectionHeaderType::SHT_NOBITS ? 0 : size),
+        memory_size_(allocate ? size : 0),
+        bytes_(bytes) {
+    ASSERT(type == elf::SectionHeaderType::SHT_NOBITS || bytes != nullptr);
   }
 
-  void Write(ElfWriteStream* stream) { UNREACHABLE(); }
-};
+  // For BitsContainers used only as sections.
+  BitsContainer(elf::SectionHeaderType type,
+                intptr_t size,
+                const uint8_t* bytes,
+                intptr_t alignment = kDefaultAlignment)
+      : BitsContainer(type,
+                      /*allocate=*/false,
+                      /*executable=*/false,
+                      /*writable=*/false,
+                      size,
+                      bytes,
+                      alignment) {}
 
-class ProgramBits : public BlobSection {
- public:
-  ProgramBits(bool allocate,
-              bool executable,
-              bool writable,
-              const uint8_t* bytes,
-              intptr_t filesz,
-              intptr_t memsz = -1)
-      : BlobSection(elf::SHT_PROGBITS,
-                    allocate,
-                    executable,
-                    writable,
-                    filesz,
-                    memsz != -1 ? memsz : filesz),
-        bytes_(ASSERT_NOTNULL(bytes)) {}
+  // For BitsContainers used as segments whose type differ on the type of the
+  // ELF file. Creates an elf::SHT_NOBITS section if type is DebugInfo,
+  // otherwise creates an elf::SHT_PROGBITS section.
+  BitsContainer(Elf::Type t,
+                bool executable,
+                bool writable,
+                intptr_t size,
+                const uint8_t* bytes,
+                intptr_t alignment = kDefaultAlignment)
+      : BitsContainer(t == Elf::Type::DebugInfo
+                          ? elf::SectionHeaderType::SHT_NOBITS
+                          : elf::SectionHeaderType::SHT_PROGBITS,
+                      /*allocate=*/true,
+                      executable,
+                      writable,
+                      size,
+                      bytes,
+                      alignment) {}
 
-  void Write(ElfWriteStream* stream) { stream->WriteBytes(bytes_, FileSize()); }
+  const BitsContainer* AsBitsContainer() const { return this; }
 
-  const uint8_t* bytes_;
-};
+  void Write(ElfWriteStream* stream) {
+    if (type != elf::SectionHeaderType::SHT_NOBITS) {
+      stream->WriteBytes(bytes_, FileSize());
+    }
+  }
 
-class NoBits : public BlobSection {
- public:
-  NoBits(bool allocate, bool executable, bool writable, intptr_t memsz)
-      : BlobSection(elf::SHT_NOBITS,
-                    allocate,
-                    executable,
-                    writable,
-                    /*filesz=*/0,
-                    memsz) {}
+  intptr_t FileSize() const { return file_size_; }
+  intptr_t MemorySize() const { return memory_size_; }
+  const uint8_t* bytes() const { return bytes_; }
 
-  void Write(ElfWriteStream* stream) {}
+ private:
+  const intptr_t file_size_;
+  const intptr_t memory_size_;
+  const uint8_t* const bytes_;
 };
 
 class StringTable : public Section {
  public:
-  explicit StringTable(bool allocate)
-      : Section(elf::SHT_STRTAB,
+  explicit StringTable(Zone* zone, bool allocate)
+      : Section(elf::SectionHeaderType::SHT_STRTAB,
                 allocate,
                 /*executable=*/false,
                 /*writable=*/false),
         dynamic_(allocate),
-        text_(Thread::Current()->zone(), 128),
-        text_indices_() {
+        text_(zone, 128),
+        text_indices_(zone) {
     text_.AddChar('\0');
     text_indices_.Insert({"", 1});
   }
@@ -461,6 +574,7 @@
         cstr_(cstr) {}
 
   void Write(ElfWriteStream* stream) const {
+    const intptr_t start = stream->position();
     stream->WriteWord(name_index);
 #if defined(TARGET_ARCH_IS_32_BIT)
     stream->WriteAddr(offset);
@@ -475,6 +589,7 @@
     stream->WriteAddr(offset);
     stream->WriteXWord(size);
 #endif
+    ASSERT_EQUAL(stream->position() - start, sizeof(elf::Symbol));
   }
 
   const intptr_t name_index;
@@ -491,21 +606,22 @@
 
 class SymbolTable : public Section {
  public:
-  explicit SymbolTable(bool dynamic)
-      : Section(dynamic ? elf::SHT_DYNSYM : elf::SHT_SYMTAB,
+  SymbolTable(Zone* zone, bool dynamic)
+      : Section(dynamic ? elf::SectionHeaderType::SHT_DYNSYM
+                        : elf::SectionHeaderType::SHT_SYMTAB,
                 dynamic,
                 /*executable=*/false,
-                /*writable=*/false,
-                compiler::target::kWordSize),
+                /*writable=*/false),
         dynamic_(dynamic),
-        reserved_("", 0, 0, 0, 0, 0) {
-    section_entry_size = kElfSymbolTableEntrySize;
+        reserved_("", 0, 0, 0, 0, 0),
+        symbols_(zone, 1) {
+    entry_size = sizeof(elf::Symbol);
     // The first symbol table entry is reserved and must be all zeros.
     symbols_.Add(&reserved_);
-    section_info = 1;  // One "local" symbol, the reserved first entry.
+    info = 1;  // One "local" symbol, the reserved first entry.
   }
 
-  intptr_t FileSize() const { return Length() * kElfSymbolTableEntrySize; }
+  intptr_t FileSize() const { return Length() * entry_size; }
   intptr_t MemorySize() const { return dynamic_ ? FileSize() : 0; }
 
   void Write(ElfWriteStream* stream) {
@@ -513,8 +629,7 @@
       auto const symbol = At(i);
       const intptr_t start = stream->position();
       symbol->Write(stream);
-      const intptr_t end = stream->position();
-      ASSERT_EQUAL(end - start, kElfSymbolTableEntrySize);
+      ASSERT_EQUAL(stream->position() - start, entry_size);
     }
   }
 
@@ -549,19 +664,17 @@
 
 class SymbolHashTable : public Section {
  public:
-  SymbolHashTable(StringTable* strtab, SymbolTable* symtab)
-      : Section(elf::SHT_HASH,
+  SymbolHashTable(Zone* zone, StringTable* strtab, SymbolTable* symtab)
+      : Section(elf::SectionHeaderType::SHT_HASH,
                 /*allocate=*/true,
                 /*executable=*/false,
-                /*writable=*/false,
-                compiler::target::kWordSize) {
-    section_link = symtab->section_index();
-    section_entry_size = kElfSymbolHashTableEntrySize;
+                /*writable=*/false) {
+    link = symtab->index();
+    entry_size = sizeof(int32_t);
 
     nchain_ = symtab->Length();
     nbucket_ = symtab->Length();
 
-    auto zone = Thread::Current()->zone();
     bucket_ = zone->Alloc<int32_t>(nbucket_);
     for (intptr_t i = 0; i < nbucket_; i++) {
       bucket_[i] = elf::STN_UNDEF;
@@ -581,7 +694,7 @@
     }
   }
 
-  intptr_t FileSize() const { return 4 * (nbucket_ + nchain_ + 2); }
+  intptr_t FileSize() const { return entry_size * (nbucket_ + nchain_ + 2); }
   intptr_t MemorySize() const { return FileSize(); }
 
   void Write(ElfWriteStream* stream) {
@@ -604,53 +717,55 @@
 
 class DynamicTable : public Section {
  public:
-  DynamicTable(StringTable* strtab, SymbolTable* symtab, SymbolHashTable* hash)
-      : Section(elf::SHT_DYNAMIC,
+  DynamicTable(Zone* zone,
+               StringTable* strtab,
+               SymbolTable* symtab,
+               SymbolHashTable* hash)
+      : Section(elf::SectionHeaderType::SHT_DYNAMIC,
                 /*allocate=*/true,
                 /*executable=*/false,
-                /*writable=*/true,
-                compiler::target::kWordSize) {
-    section_link = strtab->section_index();
-    section_entry_size = kElfDynamicTableEntrySize;
+                /*writable=*/true) {
+    link = strtab->index();
+    entry_size = sizeof(elf::DynamicEntry);
 
-    AddEntry(elf::DT_HASH, hash->memory_offset());
-    AddEntry(elf::DT_STRTAB, strtab->memory_offset());
-    AddEntry(elf::DT_STRSZ, strtab->MemorySize());
-    AddEntry(elf::DT_SYMTAB, symtab->memory_offset());
-    AddEntry(elf::DT_SYMENT, kElfSymbolTableEntrySize);
-    AddEntry(elf::DT_NULL, 0);
+    AddEntry(zone, elf::DynamicEntryType::DT_HASH, hash->memory_offset());
+    AddEntry(zone, elf::DynamicEntryType::DT_STRTAB, strtab->memory_offset());
+    AddEntry(zone, elf::DynamicEntryType::DT_STRSZ, strtab->MemorySize());
+    AddEntry(zone, elf::DynamicEntryType::DT_SYMTAB, symtab->memory_offset());
+    AddEntry(zone, elf::DynamicEntryType::DT_SYMENT, sizeof(elf::Symbol));
+    AddEntry(zone, elf::DynamicEntryType::DT_NULL, 0);
   }
 
-  intptr_t FileSize() const {
-    return entries_.length() * kElfDynamicTableEntrySize;
-  }
+  intptr_t FileSize() const { return entries_.length() * entry_size; }
   intptr_t MemorySize() const { return FileSize(); }
 
   void Write(ElfWriteStream* stream) {
     for (intptr_t i = 0; i < entries_.length(); i++) {
-      const intptr_t start = stream->position();
-#if defined(TARGET_ARCH_IS_32_BIT)
-      stream->WriteWord(entries_[i]->tag);
-      stream->WriteAddr(entries_[i]->value);
-#else
-      stream->WriteXWord(entries_[i]->tag);
-      stream->WriteAddr(entries_[i]->value);
-#endif
-      const intptr_t end = stream->position();
-      ASSERT_EQUAL(end - start, kElfDynamicTableEntrySize);
+      entries_[i]->Write(stream);
     }
   }
 
-  class Entry : public ZoneAllocated {
-   public:
-    intptr_t tag;
+  struct Entry : public ZoneAllocated {
+    Entry(elf::DynamicEntryType tag, intptr_t value) : tag(tag), value(value) {}
+
+    void Write(ElfWriteStream* stream) {
+      const intptr_t start = stream->position();
+#if defined(TARGET_ARCH_IS_32_BIT)
+      stream->WriteWord(static_cast<uint32_t>(tag));
+      stream->WriteAddr(value);
+#else
+      stream->WriteXWord(static_cast<uint64_t>(tag));
+      stream->WriteAddr(value);
+#endif
+      ASSERT_EQUAL(stream->position() - start, sizeof(elf::DynamicEntry));
+    }
+
+    elf::DynamicEntryType tag;
     intptr_t value;
   };
 
-  void AddEntry(intptr_t tag, intptr_t value) {
-    Entry* entry = new Entry();
-    entry->tag = tag;
-    entry->value = value;
+  void AddEntry(Zone* zone, elf::DynamicEntryType tag, intptr_t value) {
+    auto const entry = new (zone) Entry(tag, value);
     entries_.Add(entry);
   }
 
@@ -660,154 +775,151 @@
 
 // A segment for representing the dynamic table segment in the program header
 // table. There is no corresponding section for this segment.
-class DynamicSegment : public BlobSection {
+class DynamicSegment : public Segment {
  public:
-  explicit DynamicSegment(DynamicTable* dynamic)
-      : BlobSection(/*type=*/kInvalidSection,
-                    /*segment_type=*/elf::PT_DYNAMIC,
-                    /*allocate=*/true,
-                    /*executable=*/false,
-                    /*writable=*/true,
-                    /*filesz=*/dynamic->FileSize(),
-                    /*memsz=*/dynamic->MemorySize()) {
-    set_memory_offset(dynamic->memory_offset());
-  }
+  explicit DynamicSegment(Zone* zone, DynamicTable* dynamic)
+      : Segment(zone, dynamic, elf::ProgramHeaderType::PT_DYNAMIC) {}
+};
 
-  void Write(ElfWriteStream* stream) { UNREACHABLE(); }
+// A segment for representing the dynamic table segment in the program header
+// table. There is no corresponding section for this segment.
+class NoteSegment : public Segment {
+ public:
+  NoteSegment(Zone* zone, Section* note)
+      : Segment(zone, note, elf::ProgramHeaderType::PT_NOTE) {
+    ASSERT_EQUAL(static_cast<uint32_t>(note->type),
+                 static_cast<uint32_t>(elf::SectionHeaderType::SHT_NOTE));
+  }
 };
 
 static const intptr_t kProgramTableSegmentSize = Elf::kPageSize;
 
-Elf::Elf(Zone* zone, StreamingWriteStream* stream, Dwarf* dwarf)
+// Here, both VM and isolate will be compiled into a single snapshot.
+// In assembly generation, each serialized text section gets a separate
+// pointer into the BSS segment and BSS slots are created for each, since
+// we may not serialize both VM and isolate. Here, we always serialize both,
+// so make a BSS segment large enough for both, with the VM entries coming
+// first.
+static constexpr const char* kSnapshotBssAsmSymbol = "_kDartBSSData";
+static const intptr_t kBssIsolateOffset =
+    BSS::kVmEntryCount * compiler::target::kWordSize;
+static const intptr_t kBssSize =
+    kBssIsolateOffset + BSS::kIsolateEntryCount * compiler::target::kWordSize;
+
+Elf::Elf(Zone* zone, StreamingWriteStream* stream, Type type, Dwarf* dwarf)
     : zone_(zone),
       unwrapped_stream_(stream),
+      type_(type),
       dwarf_(dwarf),
-      shstrtab_(new (zone) StringTable(/*allocate=*/false)),
-      dynstrtab_(new (zone) StringTable(/*allocate=*/true)),
-      dynsym_(new (zone) SymbolTable(/*dynamic=*/true)),
-      memory_offset_(kProgramTableSegmentSize) {
+      bss_(CreateBSS(zone, type, kBssSize)),
+      shstrtab_(new (zone) StringTable(zone, /*allocate=*/false)),
+      dynstrtab_(new (zone) StringTable(zone, /*allocate=*/true)),
+      dynsym_(new (zone) SymbolTable(zone, /*dynamic=*/true)) {
+  // Separate debugging information should always have a Dwarf object.
+  ASSERT(type_ == Type::Snapshot || dwarf_ != nullptr);
   // Assumed by various offset logic in this file.
   ASSERT_EQUAL(unwrapped_stream_->position(), 0);
   // The first section in the section header table is always a reserved
   // entry containing only 0 values.
   sections_.Add(new (zone_) ReservedSection());
-  // Go ahead and add the section header string table, since it doesn't have
-  // an in-memory segment and so can be added to until we compute file offsets.
-  AddSection(shstrtab_, ".shstrtab");
-  if (dwarf_ != nullptr) {
+  if (!IsStripped()) {
     // Not a stripped ELF file, so allocate static string and symbol tables.
-    strtab_ = new (zone_) StringTable(/* allocate= */ false);
-    AddSection(strtab_, ".strtab");
-    symtab_ = new (zone_) SymbolTable(/*dynamic=*/false);
-    AddSection(symtab_, ".symtab");
-    symtab_->section_link = strtab_->section_index();
+    strtab_ = new (zone_) StringTable(zone_, /* allocate= */ false);
+    symtab_ = new (zone_) SymbolTable(zone, /*dynamic=*/false);
   }
+  // We add an initial segment to represent reserved space for the program
+  // header, and so we can always assume there's at least one segment in the
+  // segments_ array. We later remove this and replace it with appropriately
+  // calculated segments in Elf::FinalizeProgramTable().
+  auto const start_segment =
+      new (zone_) ProgramTableLoadSegment(zone_, kProgramTableSegmentSize);
+  segments_.Add(start_segment);
+  // Note that the BSS segment must be the first user-defined segment because
+  // it cannot be placed in between any two non-writable segments, due to a bug
+  // in Jelly Bean's ELF loader. See also Elf::WriteProgramTable().
+  //
+  // We add it in all cases, even to the separate debugging information ELF,
+  // to ensure that relocated addresses are consistent between ELF snapshots
+  // and ELF separate debugging information.
+  AddSection(bss_, ".bss", kSnapshotBssAsmSymbol);
 }
 
-void Elf::AddSection(Section* section, const char* name) {
+intptr_t Elf::NextMemoryOffset() const {
+  return Utils::RoundUp(LastLoadSegment()->MemoryEnd(), Elf::kPageSize);
+}
+
+uword Elf::BssStart(bool vm) const {
+  return bss_->memory_offset() + (vm ? 0 : kBssIsolateOffset);
+}
+
+intptr_t Elf::AddSection(Section* section,
+                         const char* name,
+                         const char* symbol_name) {
   ASSERT(section_table_file_size_ < 0);
   ASSERT(!shstrtab_->HasBeenFinalized());
-  section->set_section_name(shstrtab_->AddString(name));
-  section->set_section_index(sections_.length());
+  section->set_name(shstrtab_->AddString(name));
+  section->set_index(sections_.length());
   sections_.Add(section);
-  if (section->MemorySize() > 0) {
-    ASSERT(program_table_file_size_ < 0);
-    memory_offset_ = Utils::RoundUp(memory_offset_, section->alignment);
-    section->set_memory_offset(memory_offset_);
-    segments_.Add(section);
-    memory_offset_ += section->MemorySize();
-    memory_offset_ = Utils::RoundUp(memory_offset_, kPageSize);
-  }
-}
 
-intptr_t Elf::AddSegmentSymbol(const Section* section, const char* name) {
-  // While elf::STT_SECTION might seem more appropriate, those symbols are
-  // usually local and dlsym won't return them.
-  auto const info = (elf::STB_GLOBAL << 4) | elf::STT_FUNC;
-  auto const section_index = section->section_index();
-  // For shared libraries, this is the offset from the DSO base. For static
-  // libraries, this is section relative.
-  auto const address = section->memory_offset();
-  auto const size = section->MemorySize();
-  AddDynamicSymbol(name, info, section_index, address, size);
-  return address;
+  // No memory offset, so just return -1.
+  if (!section->IsAllocated()) return -1;
+
+  ASSERT(program_table_file_size_ < 0);
+  auto const last_load = LastLoadSegment();
+  if (!last_load->Add(section)) {
+    // We can't add this section to the last load segment, so create a new one.
+    // The new segment starts at the next aligned address.
+    auto const type = elf::ProgramHeaderType::PT_LOAD;
+    auto const start_address =
+        Utils::RoundUp(last_load->MemoryEnd(), Segment::Alignment(type));
+    section->set_memory_offset(start_address);
+    auto const segment = new (zone_) Segment(zone_, section, type);
+    segments_.Add(segment);
+  }
+  if (symbol_name != nullptr) {
+    section->symbol_name = symbol_name;
+  }
+  return section->memory_offset();
 }
 
 intptr_t Elf::AddText(const char* name, const uint8_t* bytes, intptr_t size) {
-  Section* image = nullptr;
-  if (bytes != nullptr) {
-    image = new (zone_) ProgramBits(true, true, false, bytes, size);
-  } else {
-    image = new (zone_) NoBits(true, true, false, size);
+  // When making a separate debugging info file for assembly, we don't have
+  // the binary text segment contents.
+  ASSERT(type_ == Type::DebugInfo || bytes != nullptr);
+  auto const image = new (zone_)
+      BitsContainer(type_, /*executable=*/true,
+                    /*writable=*/false, size, bytes, Elf::kPageSize);
+  return AddSection(image, ".text", name);
+}
+
+Section* Elf::CreateBSS(Zone* zone, Type type, intptr_t size) {
+  uint8_t* bytes = nullptr;
+  if (type != Type::DebugInfo) {
+    // Ideally the BSS segment would take no space in the object, but Android's
+    // "strip" utility truncates the memory-size of our segments to their
+    // file-size.
+    //
+    // Therefore we must insert zero-filled pages for the BSS.
+    bytes = zone->Alloc<uint8_t>(size);
+    memset(bytes, 0, size);
   }
-  AddSection(image, ".text");
-
-  return AddSegmentSymbol(image, name);
-}
-
-static bool FindSymbol(StringTable* strings,
-                       SymbolTable* symbols,
-                       const char* name,
-                       intptr_t* offset,
-                       intptr_t* size) {
-  auto const name_index = strings->Lookup(name);
-  if (name_index < 0) return false;
-  auto const symbol = symbols->FindSymbolWithNameIndex(name_index);
-  if (symbol == nullptr) return false;
-  if (offset != nullptr) {
-    *offset = symbol->offset;
-  }
-  if (size != nullptr) {
-    *size = symbol->size;
-  }
-  return true;
-}
-
-bool Elf::FindDynamicSymbol(const char* name,
-                            intptr_t* offset,
-                            intptr_t* size) const {
-  return FindSymbol(dynstrtab_, dynsym_, name, offset, size);
-}
-
-bool Elf::FindStaticSymbol(const char* name,
-                           intptr_t* offset,
-                           intptr_t* size) const {
-  if (strtab_ == nullptr || symtab_ == nullptr) return false;
-  return FindSymbol(strtab_, symtab_, name, offset, size);
-}
-
-intptr_t Elf::AddBSSData(const char* name, intptr_t size) {
-  // Ideally the BSS segment would take no space in the object, but Android's
-  // "strip" utility truncates the memory-size of our segments to their
-  // file-size.
-  //
-  // Therefore we must insert zero-filled pages for the BSS.
-  uint8_t* const bytes = zone_->Alloc<uint8_t>(size);
-  memset(bytes, 0, size);
-
-  ProgramBits* const image =
-      new (zone_) ProgramBits(true, false, true, bytes, size);
-  static_assert(Image::kBssAlignment <= kPageSize,
-                "ELF .bss section is not aligned as expected by Image class");
-  ASSERT_EQUAL(image->alignment, kPageSize);
-  AddSection(image, ".bss");
-
-  return AddSegmentSymbol(image, name);
+  return new (zone) BitsContainer(type, /*executable=*/false, /*writable=*/true,
+                                  kBssSize, bytes, Image::kBssAlignment);
 }
 
 intptr_t Elf::AddROData(const char* name, const uint8_t* bytes, intptr_t size) {
   ASSERT(bytes != nullptr);
-  ProgramBits* image = new (zone_) ProgramBits(true, false, false, bytes, size);
-  AddSection(image, ".rodata");
-
-  return AddSegmentSymbol(image, name);
+  auto const image = new (zone_)
+      BitsContainer(type_, /*executable=*/false,
+                    /*writable=*/false, size, bytes, kMaxObjectAlignment);
+  return AddSection(image, ".rodata", name);
 }
 
 void Elf::AddDebug(const char* name, const uint8_t* bytes, intptr_t size) {
-  ASSERT(dwarf_ != nullptr);
+  ASSERT(!IsStripped());
   ASSERT(bytes != nullptr);
-  ProgramBits* image =
-      new (zone_) ProgramBits(false, false, false, bytes, size);
+  auto const image = new (zone_)
+      BitsContainer(elf::SectionHeaderType::SHT_PROGBITS, size, bytes);
   AddSection(image, name);
 }
 
@@ -832,8 +944,7 @@
                           intptr_t section_index,
                           intptr_t address,
                           intptr_t size) {
-  if (dwarf_ == nullptr) return;  // No static info kept in stripped ELF files.
-
+  if (IsStripped()) return;  // No static info kept in stripped ELF files.
   ASSERT(!symtab_->HasBeenFinalized() && !strtab_->HasBeenFinalized());
   auto const name_index = strtab_->AddString(name);
   auto const symbol =
@@ -951,24 +1062,47 @@
 };
 
 static constexpr intptr_t kInitialDwarfBufferSize = 64 * KB;
+#endif
 
 static uint8_t* ZoneReallocate(uint8_t* ptr, intptr_t len, intptr_t new_len) {
   return Thread::Current()->zone()->Realloc<uint8_t>(ptr, len, new_len);
 }
-#endif
 
-const Section* Elf::FindSegmentForAddress(intptr_t address) const {
-  for (intptr_t i = 0; i < segments_.length(); i++) {
-    auto const segment = segments_[i];
-    auto const start = segment->memory_offset();
-    auto const end = start + segment->MemorySize();
-    if (address >= start && address < end) {
+Segment* Elf::LastLoadSegment() const {
+  for (intptr_t i = segments_.length() - 1; i >= 0; i--) {
+    auto const segment = segments_.At(i);
+    if (segment->type == elf::ProgramHeaderType::PT_LOAD) {
       return segment;
     }
   }
+  // There should always be a load segment, since one is added in construction.
+  UNREACHABLE();
+}
+
+const Section* Elf::FindSectionForAddress(intptr_t address) const {
+  for (auto const section : sections_) {
+    if (!section->IsAllocated()) continue;
+    auto const start = section->memory_offset();
+    auto const end = start + section->MemorySize();
+    if (address >= start && address < end) {
+      return section;
+    }
+  }
   return nullptr;
 }
 
+void Elf::AddSectionSymbols() {
+  for (auto const section : sections_) {
+    if (section->symbol_name == nullptr) continue;
+    ASSERT(section->memory_offset_is_set());
+    // While elf::STT_SECTION might seem more appropriate, those symbols are
+    // usually local and dlsym won't return them.
+    auto const info = (elf::STB_GLOBAL << 4) | elf::STT_FUNC;
+    AddDynamicSymbol(section->symbol_name, info, section->index(),
+                     section->memory_offset(), section->MemorySize());
+  }
+}
+
 void Elf::FinalizeDwarfSections() {
   if (dwarf_ == nullptr) return;
 #if defined(DART_PRECOMPILER)
@@ -995,9 +1129,9 @@
   auto const isolate_start =
       symbol_to_address_map.LookupValue(kIsolateSnapshotInstructionsAsmSymbol);
   ASSERT(isolate_start > 0);
-  auto const vm_text = FindSegmentForAddress(vm_start);
+  auto const vm_text = FindSectionForAddress(vm_start);
   ASSERT(vm_text != nullptr);
-  auto const isolate_text = FindSegmentForAddress(isolate_start);
+  auto const isolate_text = FindSectionForAddress(isolate_start);
   ASSERT(isolate_text != nullptr);
 
   SnapshotTextObjectNamer namer(zone_);
@@ -1007,10 +1141,10 @@
     auto const name = namer.SnapshotNameFor(i, code);
     const auto& pair = dwarf_->CodeAddress(code);
     ASSERT(pair.offset > 0);
-    auto const segment = pair.vm ? vm_text : isolate_text;
-    const intptr_t address = segment->memory_offset() + pair.offset;
+    auto const section = pair.vm ? vm_text : isolate_text;
+    const intptr_t address = section->memory_offset() + pair.offset;
     auto const info = (elf::STB_GLOBAL << 4) | elf::STT_FUNC;
-    AddStaticSymbol(name, info, segment->section_index(), address, code.Size());
+    AddStaticSymbol(name, info, section->index(), address, code.Size());
     symbol_to_address_map.Insert({name, address});
   }
 
@@ -1044,27 +1178,57 @@
 }
 
 void Elf::Finalize() {
-  FinalizeDwarfSections();
+  AddSectionSymbols();
 
-  // Unlike the static tables, we must wait until finalization to add the
-  // dynamic tables, as adding them marks them as finalized.
+  // The Build ID depends on the symbols being in place, so must be run after
+  // AddSectionSymbols(). Unfortunately, it currently depends on the contents
+  // of the .text and .rodata sections, so it can't come earlier in the file
+  // without changing how we add the .text and .rodata sections (since we
+  // determine memory offsets for those sections when we add them, and the
+  // text sections must have the memory offsets to do BSS relocations).
+  if (auto const build_id = GenerateBuildId()) {
+    AddSection(build_id, ".note.gnu.build-id", kSnapshotBuildIdAsmSymbol);
+
+    // Add a PT_NOTE segment for the build ID.
+    segments_.Add(new (zone_) NoteSegment(zone_, build_id));
+  }
+
+  // Adding the dynamic symbol table and associated sections.
   AddSection(dynstrtab_, ".dynstr");
   AddSection(dynsym_, ".dynsym");
-  dynsym_->section_link = dynstrtab_->section_index();
+  dynsym_->link = dynstrtab_->index();
 
-  auto const hash = new (zone_) SymbolHashTable(dynstrtab_, dynsym_);
+  auto const hash = new (zone_) SymbolHashTable(zone_, dynstrtab_, dynsym_);
   AddSection(hash, ".hash");
 
-  dynamic_ = new (zone_) DynamicTable(dynstrtab_, dynsym_, hash);
-  AddSection(dynamic_, ".dynamic");
+  auto const dynamic =
+      new (zone_) DynamicTable(zone_, dynstrtab_, dynsym_, hash);
+  AddSection(dynamic, ".dynamic");
 
-  // Also add a PT_DYNAMIC segment for the dynamic symbol table.
-  dynamic_segment_ = new (zone_) DynamicSegment(dynamic_);
-  segments_.Add(dynamic_segment_);
+  // Add a PT_DYNAMIC segment for the dynamic symbol table.
+  segments_.Add(new (zone_) DynamicSegment(zone_, dynamic));
 
-  // At this point, all sections and user-defined segments have been added. Add
-  // any program table-specific segments and then calculate file offsets for all
-  // sections and segments.
+  // Currently, we add all (non-reserved) unallocated sections after all
+  // allocated sections. If we put unallocated sections between allocated
+  // sections, they would affect the file offset but not the memory offset
+  // of the later allocated sections.
+  //
+  // However, memory offsets must be page-aligned to the file offset for the
+  // ELF file to be successfully loaded. This means we'd either have to add
+  // extra padding _or_ determine file offsets before memory offsets. The
+  // latter would require us to handle BSS relocations during ELF finalization,
+  // instead of while writing the .text section content.
+  FinalizeDwarfSections();
+  if (!IsStripped()) {
+    AddSection(strtab_, ".strtab");
+    AddSection(symtab_, ".symtab");
+    symtab_->link = strtab_->index();
+  }
+  AddSection(shstrtab_, ".shstrtab");
+
+  // At this point, all non-programmatically calculated sections and segments
+  // have been added. Add any programatically calculated sections and segments
+  // and then calculate file offsets.
   FinalizeProgramTable();
   ComputeFileOffsets();
 
@@ -1076,15 +1240,95 @@
   WriteSectionTable(&wrapped);
 }
 
+// Need to include the final \0 terminator in both byte count and byte output.
+static const uint32_t kBuildIdNameLength = strlen(elf::ELF_NOTE_GNU) + 1;
+// We generate a 128-bit hash, where each 32 bits is a hash of the contents of
+// the following segments in order:
+//
+// .text(VM) | .text(Isolate) | .rodata(VM) | .rodata(Isolate)
+static constexpr intptr_t kBuildIdSegmentNamesLength = 4;
+static constexpr const char* kBuildIdSegmentNames[kBuildIdSegmentNamesLength]{
+    kVmSnapshotInstructionsAsmSymbol,
+    kIsolateSnapshotInstructionsAsmSymbol,
+    kVmSnapshotDataAsmSymbol,
+    kIsolateSnapshotDataAsmSymbol,
+};
+static constexpr uint32_t kBuildIdDescriptionLength =
+    kBuildIdSegmentNamesLength * sizeof(uint32_t);
+static const intptr_t kBuildIdDescriptionOffset =
+    sizeof(elf::Note) + kBuildIdNameLength;
+static const intptr_t kBuildIdSize =
+    kBuildIdDescriptionOffset + kBuildIdDescriptionLength;
+
+static const Symbol* LookupSymbol(StringTable* strings,
+                                  SymbolTable* symbols,
+                                  const char* name) {
+  ASSERT(strings != nullptr);
+  ASSERT(symbols != nullptr);
+  auto const name_index = strings->Lookup(name);
+  if (name_index < 0) return nullptr;
+  return symbols->FindSymbolWithNameIndex(name_index);
+}
+
+static uint32_t HashBitsContainer(const BitsContainer* bits) {
+  uint32_t hash = 0;
+  auto const size = bits->MemorySize();
+  auto const end = bits->bytes() + size;
+  auto const non_word_size = size % kWordSize;
+  auto const end_of_words =
+      reinterpret_cast<const uword*>(bits->bytes() + (size - non_word_size));
+  for (auto cursor = reinterpret_cast<const uword*>(bits->bytes());
+       cursor < end_of_words; cursor++) {
+    hash = CombineHashes(hash, *cursor);
+  }
+  for (auto cursor = reinterpret_cast<const uint8_t*>(end_of_words);
+       cursor < end; cursor++) {
+    hash = CombineHashes(hash, *cursor);
+  }
+  return FinalizeHash(hash, 32);
+}
+
+Section* Elf::GenerateBuildId() {
+  uint8_t* notes_buffer = nullptr;
+  WriteStream stream(&notes_buffer, ZoneReallocate, kBuildIdSize);
+  stream.WriteFixed(kBuildIdNameLength);
+  stream.WriteFixed(kBuildIdDescriptionLength);
+  stream.WriteFixed(static_cast<uint32_t>(elf::NoteType::NT_GNU_BUILD_ID));
+  stream.WriteBytes(elf::ELF_NOTE_GNU, kBuildIdNameLength);
+  const intptr_t description_start = stream.bytes_written();
+  for (intptr_t i = 0; i < kBuildIdSegmentNamesLength; i++) {
+    auto const name = kBuildIdSegmentNames[i];
+    auto const symbol = LookupSymbol(dynstrtab_, dynsym_, name);
+    if (symbol == nullptr) {
+      FATAL1("No symbol %s found for expected segment\n", name);
+    }
+    auto const bits = sections_[symbol->section_index]->AsBitsContainer();
+    if (bits == nullptr) {
+      FATAL1("Section for symbol %s is not a BitsContainer", name);
+    }
+    ASSERT_EQUAL(bits->MemorySize(), symbol->size);
+    // We don't actually have the bytes (i.e., this is a separate debugging
+    // info file for an assembly snapshot), so we can't calculate the build ID.
+    if (bits->bytes() == nullptr) return nullptr;
+
+    stream.WriteFixed(HashBitsContainer(bits));
+  }
+  ASSERT_EQUAL(stream.bytes_written() - description_start,
+               kBuildIdDescriptionLength);
+  return new (zone_) BitsContainer(
+      elf::SectionHeaderType::SHT_NOTE, /*allocate=*/true, /*executable=*/false,
+      /*writable=*/false, stream.bytes_written(), notes_buffer, kNoteAlignment);
+}
+
 void Elf::FinalizeProgramTable() {
   ASSERT(program_table_file_size_ < 0);
 
-  program_table_file_offset_ = kElfHeaderSize;
+  program_table_file_offset_ = sizeof(elf::ElfHeader);
 
   // There are two segments we need the size of the program table to create, so
   // calculate it as if those two segments were already in place.
   program_table_file_size_ =
-      (2 + segments_.length()) * kElfProgramTableEntrySize;
+      (2 + segments_.length()) * sizeof(elf::ProgramHeader);
 
   // We pre-allocated the virtual memory space for the program table itself.
   // Check that we didn't generate too many segments. Currently we generate a
@@ -1095,42 +1339,59 @@
       program_table_file_offset_ + program_table_file_size_;
   RELEASE_ASSERT(program_table_segment_size < kProgramTableSegmentSize);
 
+  // Remove the original stand-in segment we added in the constructor.
+  segments_.EraseAt(0);
+
   // Self-reference to program header table. Required by Android but not by
   // Linux. Must appear before any PT_LOAD entries.
   segments_.InsertAt(
-      0, new (zone_) ProgramTableSelfSegment(program_table_file_offset_,
+      0, new (zone_) ProgramTableSelfSegment(zone_, program_table_file_offset_,
                                              program_table_file_size_));
 
   // Segment for loading the initial part of the ELF file, including the
   // program header table. Required by Android but not by Linux.
-  segments_.InsertAt(
-      1, new (zone_) ProgramTableLoadSegment(program_table_segment_size));
+  segments_.InsertAt(1, new (zone_) ProgramTableLoadSegment(
+                            zone_, program_table_segment_size));
 }
 
+static const intptr_t kElfSectionTableAlignment = compiler::target::kWordSize;
+
 void Elf::ComputeFileOffsets() {
   // We calculate the size and offset of the program header table during
   // finalization.
   ASSERT(program_table_file_offset_ > 0 && program_table_file_size_ > 0);
   intptr_t file_offset = program_table_file_offset_ + program_table_file_size_;
+  // When calculating file offsets for sections, we'll need to know if we've
+  // changed segments. Start with the one for the program table.
+  const auto* current_segment = segments_[1];
 
-  // The first (reserved) section's file offset is set to 0 during construction,
-  // so skip it.
-  ASSERT(sections_.length() >= 1 && sections_[0]->section_type == 0);
-  // The others are output to the file in order after the program header table.
+  // The non-reserved sections are output to the file in order after the program
+  // header table. If we're entering a new segment, then we need to align
+  // according to the PT_LOAD segment alignment as well to keep the file offsets
+  // aligned with the memory addresses.
+  auto const load_align = Segment::Alignment(elf::ProgramHeaderType::PT_LOAD);
   for (intptr_t i = 1; i < sections_.length(); i++) {
-    Section* section = sections_[i];
+    auto const section = sections_[i];
     file_offset = Utils::RoundUp(file_offset, section->alignment);
+    if (section->IsAllocated() && section->load_segment != current_segment) {
+      file_offset = Utils::RoundUp(file_offset, load_align);
+      current_segment = section->load_segment;
+    }
     section->set_file_offset(file_offset);
+#if defined(DEBUG)
+    if (section->IsAllocated()) {
+      // For files that will be dynamically loaded, make sure the file offsets
+      // of allocated sections are page aligned to the memory offsets.
+      ASSERT_EQUAL(section->file_offset() % load_align,
+                   section->memory_offset() % load_align);
+    }
+#endif
     file_offset += section->FileSize();
   }
 
-  // Make the dynamic segment's file offset the same as the dynamic table now
-  // that it's been calculated for the latter.
-  dynamic_segment_->set_file_offset(dynamic_->file_offset());
-
   file_offset = Utils::RoundUp(file_offset, kElfSectionTableAlignment);
   section_table_file_offset_ = file_offset;
-  section_table_file_size_ = sections_.length() * kElfSectionTableEntrySize;
+  section_table_file_size_ = sections_.length() * sizeof(elf::SectionHeader);
   file_offset += section_table_file_size_;
 }
 
@@ -1186,27 +1447,46 @@
 #endif
   stream->WriteWord(flags);
 
-  stream->WriteHalf(kElfHeaderSize);
-  stream->WriteHalf(kElfProgramTableEntrySize);
+  stream->WriteHalf(sizeof(elf::ElfHeader));
+  stream->WriteHalf(sizeof(elf::ProgramHeader));
   stream->WriteHalf(segments_.length());
-  stream->WriteHalf(kElfSectionTableEntrySize);
+  stream->WriteHalf(sizeof(elf::SectionHeader));
   stream->WriteHalf(sections_.length());
-  stream->WriteHalf(shstrtab_->section_index());
+  stream->WriteHalf(shstrtab_->index());
 
-  ASSERT_EQUAL(stream->position(), kElfHeaderSize);
+  ASSERT_EQUAL(stream->position(), sizeof(elf::ElfHeader));
 }
 
 void Elf::WriteProgramTable(ElfWriteStream* stream) {
   ASSERT(program_table_file_size_ >= 0);  // Check for finalization.
   ASSERT(stream->position() == program_table_file_offset_);
-
-  for (intptr_t i = 0; i < segments_.length(); i++) {
-    Section* section = segments_[i];
+#if defined(DEBUG)
+  // Here, we count the number of times that a PT_LOAD writable segment is
+  // followed by a non-writable segment. We initialize last_writable to true so
+  // that we catch the case where the first segment is non-writable.
+  bool last_writable = true;
+  int non_writable_groups = 0;
+#endif
+  for (auto const segment : segments_) {
+#if defined(DEBUG)
+    if (segment->type == elf::ProgramHeaderType::PT_LOAD) {
+      if (last_writable && !segment->IsWritable()) {
+        non_writable_groups++;
+      }
+      last_writable = segment->IsWritable();
+    }
+#endif
     const intptr_t start = stream->position();
-    section->WriteSegmentEntry(stream);
+    segment->WriteProgramHeader(stream);
     const intptr_t end = stream->position();
-    ASSERT_EQUAL(end - start, kElfProgramTableEntrySize);
+    ASSERT_EQUAL(end - start, sizeof(elf::ProgramHeader));
   }
+#if defined(DEBUG)
+  // All PT_LOAD non-writable segments must be contiguous. If not, some older
+  // Android dynamic linkers fail to handle writable segments between
+  // non-writable ones. See https://github.com/flutter/flutter/issues/43259.
+  ASSERT(non_writable_groups <= 1);
+#endif
 }
 
 void Elf::WriteSectionTable(ElfWriteStream* stream) {
@@ -1214,26 +1494,36 @@
   stream->Align(kElfSectionTableAlignment);
   ASSERT_EQUAL(stream->position(), section_table_file_offset_);
 
-  for (intptr_t i = 0; i < sections_.length(); i++) {
-    Section* section = sections_[i];
+  for (auto const section : sections_) {
     const intptr_t start = stream->position();
-    section->WriteSectionEntry(stream);
+    section->WriteSectionHeader(stream);
     const intptr_t end = stream->position();
-    ASSERT_EQUAL(end - start, kElfSectionTableEntrySize);
+    ASSERT_EQUAL(end - start, sizeof(elf::SectionHeader));
   }
 }
 
 void Elf::WriteSections(ElfWriteStream* stream) {
+  ASSERT(section_table_file_size_ >= 0);  // Check for finalization.
+
   // Skip the reserved first section, as its alignment is 0 (which will cause
   // stream->Align() to fail) and it never contains file contents anyway.
-  ASSERT_EQUAL(sections_[0]->section_type, elf::SHT_NULL);
+  ASSERT_EQUAL(static_cast<uint32_t>(sections_[0]->type),
+               static_cast<uint32_t>(elf::SectionHeaderType::SHT_NULL));
   ASSERT_EQUAL(sections_[0]->alignment, 0);
+  auto const load_align = Segment::Alignment(elf::ProgramHeaderType::PT_LOAD);
+  const Segment* current_segment = segments_[1];
   for (intptr_t i = 1; i < sections_.length(); i++) {
     Section* section = sections_[i];
     stream->Align(section->alignment);
-    ASSERT(stream->position() == section->file_offset());
+    if (section->IsAllocated() && section->load_segment != current_segment) {
+      // Changing segments, so align accordingly.
+      stream->Align(load_align);
+      current_segment = section->load_segment;
+    }
+    ASSERT_EQUAL(stream->position(), section->file_offset());
     section->Write(stream);
-    ASSERT(stream->position() == section->file_offset() + section->FileSize());
+    ASSERT_EQUAL(stream->position(),
+                 section->file_offset() + section->FileSize());
   }
 }
 
diff --git a/runtime/vm/elf.h b/runtime/vm/elf.h
index a269192..da0af3c 100644
--- a/runtime/vm/elf.h
+++ b/runtime/vm/elf.h
@@ -14,47 +14,63 @@
 namespace dart {
 
 class Dwarf;
-class DynamicSegment;
-class DynamicTable;
 class ElfWriteStream;
 class Section;
+class Segment;
 class StringTable;
-class Symbol;
 class SymbolTable;
 
 class Elf : public ZoneAllocated {
  public:
-  Elf(Zone* zone, StreamingWriteStream* stream, Dwarf* dwarf = nullptr);
+  enum class Type {
+    // A snapshot that should include segment contents.
+    Snapshot,
+    // Separately compiled debugging information that should not include
+    // most segment contents.
+    DebugInfo,
+  };
+
+  Elf(Zone* zone,
+      StreamingWriteStream* stream,
+      Type type,
+      Dwarf* dwarf = nullptr);
 
   static const intptr_t kPageSize = 4096;
 
+  bool IsStripped() const { return dwarf_ == nullptr; }
+
   Zone* zone() { return zone_; }
   const Dwarf* dwarf() const { return dwarf_; }
   Dwarf* dwarf() { return dwarf_; }
 
-  intptr_t NextMemoryOffset() const { return memory_offset_; }
-  intptr_t NextSectionIndex() const { return sections_.length(); }
+  uword BssStart(bool vm) const;
+
+  // What the next memory offset for a kPageSize-aligned section would be.
+  //
+  // Only used by BlobImageWriter::WriteText() to determine the memory offset
+  // for the text section before it is added.
+  intptr_t NextMemoryOffset() const;
+  intptr_t AddNoBits(const char* name, const uint8_t* bytes, intptr_t size);
   intptr_t AddText(const char* name, const uint8_t* bytes, intptr_t size);
   intptr_t AddROData(const char* name, const uint8_t* bytes, intptr_t size);
-  intptr_t AddBSSData(const char* name, intptr_t size);
   void AddDebug(const char* name, const uint8_t* bytes, intptr_t size);
 
-  // Returns whether the symbol was found. If found, sets the contents of
-  // offset and size appropriately if either or both are not nullptr.
-  bool FindDynamicSymbol(const char* name,
-                         intptr_t* offset,
-                         intptr_t* size) const;
-  // Returns whether the symbol was found. If found, sets the contents of
-  // offset and size appropriately if either or both are not nullptr.
-  bool FindStaticSymbol(const char* name,
-                        intptr_t* offset,
-                        intptr_t* size) const;
-
   void Finalize();
 
  private:
-  void AddSection(Section* section, const char* name);
-  intptr_t AddSegmentSymbol(const Section* section, const char* name);
+  static Section* CreateBSS(Zone* zone, Type type, intptr_t size);
+
+  // Adds the section and also creates a PT_LOAD segment for the section if it
+  // is an allocated section.
+  //
+  // For allocated sections, if symbol_name is provided, a symbol for the
+  // section will be added to the dynamic table (if allocated) and static
+  // table (if not stripped) during finalization.
+  //
+  // Returns the memory offset if the section is allocated.
+  intptr_t AddSection(Section* section,
+                      const char* name,
+                      const char* symbol_name = nullptr);
   void AddStaticSymbol(const char* name,
                        intptr_t info,
                        intptr_t section_index,
@@ -66,8 +82,11 @@
                         intptr_t address,
                         intptr_t size);
 
-  const Section* FindSegmentForAddress(intptr_t address) const;
+  Segment* LastLoadSegment() const;
+  const Section* FindSectionForAddress(intptr_t address) const;
+  Section* GenerateBuildId();
 
+  void AddSectionSymbols();
   void FinalizeDwarfSections();
   void FinalizeProgramTable();
   void ComputeFileOffsets();
@@ -79,26 +98,28 @@
 
   Zone* const zone_;
   StreamingWriteStream* const unwrapped_stream_;
+  const Type type_;
+
   // If nullptr, then the ELF file should be stripped of static information like
   // the static symbol table (and its corresponding string table).
   Dwarf* const dwarf_;
 
+  // We always create a BSS section for all Elf files, though it may be NOBITS
+  // if this is separate debugging information.
+  Section* const bss_;
+
   // All our strings would fit in a single page. However, we use separate
   // .shstrtab and .dynstr to work around a bug in Android's strip utility.
   StringTable* const shstrtab_;
   StringTable* const dynstrtab_;
   SymbolTable* const dynsym_;
 
-  // Can only be created once the dynamic symbol table is complete.
-  DynamicTable* dynamic_ = nullptr;
-  DynamicSegment* dynamic_segment_ = nullptr;
-
   // The static tables are lazily created when static symbols are added.
   StringTable* strtab_ = nullptr;
   SymbolTable* symtab_ = nullptr;
 
   GrowableArray<Section*> sections_;
-  GrowableArray<Section*> segments_;
+  GrowableArray<Segment*> segments_;
   intptr_t memory_offset_;
   intptr_t section_table_file_offset_ = -1;
   intptr_t section_table_file_size_ = -1;
diff --git a/runtime/vm/image_snapshot.cc b/runtime/vm/image_snapshot.cc
index fef47d6..cb2ef41 100644
--- a/runtime/vm/image_snapshot.cc
+++ b/runtime/vm/image_snapshot.cc
@@ -412,12 +412,16 @@
   }
 
   // Append the direct-mapped RO data objects after the clustered snapshot.
+  // We need to do this before WriteText because WriteText currently adds the
+  // finalized contents of the clustered_stream as data sections.
   offset_space_ = vm ? V8SnapshotProfileWriter::kVmData
                      : V8SnapshotProfileWriter::kIsolateData;
   WriteROData(clustered_stream);
 
   offset_space_ = vm ? V8SnapshotProfileWriter::kVmText
                      : V8SnapshotProfileWriter::kIsolateText;
+  // Needs to happen after WriteROData, because all image writers currently
+  // add the clustered data information to their output in WriteText().
   WriteText(clustered_stream, vm);
 }
 
@@ -1074,9 +1078,15 @@
   assembly_stream_.Print(".globl %s\n", data_symbol);
   Align(kMaxObjectAlignment);
   assembly_stream_.Print("%s:\n", data_symbol);
-  uword buffer = reinterpret_cast<uword>(clustered_stream->buffer());
-  intptr_t length = clustered_stream->bytes_written();
+  const uword buffer = reinterpret_cast<uword>(clustered_stream->buffer());
+  const intptr_t length = clustered_stream->bytes_written();
   WriteByteSequence(buffer, buffer + length);
+#if defined(DART_PRECOMPILER)
+  if (debug_elf_ != nullptr) {
+    // Add a NoBits section for the ROData as well.
+    debug_elf_->AddROData(data_symbol, clustered_stream->buffer(), length);
+  }
+#endif  // defined(DART_PRECOMPILER)
 #endif  // !defined(DART_PRECOMPILED_RUNTIME)
 }
 
@@ -1190,12 +1200,10 @@
                                  ReAlloc alloc,
                                  intptr_t initial_size,
                                  Elf* debug_elf,
-                                 intptr_t bss_base,
                                  Elf* elf)
     : ImageWriter(thread),
       instructions_blob_stream_(instructions_blob_buffer, alloc, initial_size),
       elf_(elf),
-      bss_base_(bss_base),
       debug_elf_(debug_elf) {
 #if defined(DART_PRECOMPILER)
   ASSERT(debug_elf_ == nullptr || debug_elf_->dwarf() != nullptr);
@@ -1248,7 +1256,8 @@
 #if defined(DART_PRECOMPILER)
   // Store the offset of the BSS section from the instructions section here.
   // If not compiling to ELF (and thus no BSS segment), write 0.
-  const word bss_offset = elf_ != nullptr ? bss_base_ - segment_base : 0;
+  const word bss_offset =
+      elf_ != nullptr ? elf_->BssStart(vm) - segment_base : 0;
   ASSERT_EQUAL(Utils::RoundDown(bss_offset, Image::kBssAlignment), bss_offset);
   // Set the lowest bit if we are compiling to ELF.
   const word compiled_to_elf = elf_ != nullptr ? 0x1 : 0x0;
@@ -1479,17 +1488,28 @@
   ASSERT_EQUAL(text_offset, image_size);
 
 #ifdef DART_PRECOMPILER
+  auto const data_symbol =
+      vm ? kVmSnapshotDataAsmSymbol : kIsolateSnapshotDataAsmSymbol;
   if (elf_ != nullptr) {
     auto const segment_base2 =
         elf_->AddText(instructions_symbol, instructions_blob_stream_.buffer(),
                       instructions_blob_stream_.bytes_written());
-    ASSERT(segment_base == segment_base2);
+    ASSERT_EQUAL(segment_base2, segment_base);
+    // Write the .rodata section here like the AssemblyImageWriter.
+    elf_->AddROData(data_symbol, clustered_stream->buffer(),
+                    clustered_stream->bytes_written());
   }
   if (debug_elf_ != nullptr) {
-    auto const debug_segment_base2 =
-        debug_elf_->AddText(instructions_symbol, nullptr,
-                            instructions_blob_stream_.bytes_written());
-    ASSERT(debug_segment_base == debug_segment_base2);
+    // To keep memory addresses consistent, we create elf::SHT_NOBITS sections
+    // in the debugging information. We still pass along the buffers because
+    // we'll need the buffer bytes at generation time to calculate the build ID
+    // so it'll match the one in the snapshot.
+    auto const debug_segment_base2 = debug_elf_->AddText(
+        instructions_symbol, instructions_blob_stream_.buffer(),
+        instructions_blob_stream_.bytes_written());
+    ASSERT_EQUAL(debug_segment_base2, debug_segment_base);
+    debug_elf_->AddROData(data_symbol, clustered_stream->buffer(),
+                          clustered_stream->bytes_written());
   }
 #endif
 }
diff --git a/runtime/vm/image_snapshot.h b/runtime/vm/image_snapshot.h
index 7304ea7..6727ca0 100644
--- a/runtime/vm/image_snapshot.h
+++ b/runtime/vm/image_snapshot.h
@@ -429,7 +429,6 @@
                   ReAlloc alloc,
                   intptr_t initial_size,
                   Elf* debug_elf = nullptr,
-                  intptr_t bss_base = 0,
                   Elf* elf = nullptr);
 
   virtual void WriteText(WriteStream* clustered_stream, bool vm);
@@ -443,7 +442,6 @@
 
   WriteStream instructions_blob_stream_;
   Elf* const elf_;
-  const intptr_t bss_base_;
   Elf* const debug_elf_;
 
   DISALLOW_COPY_AND_ASSIGN(BlobImageWriter);
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 812565a..5354079 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -618,11 +618,15 @@
   visibility = [ ":create_full_sdk" ]
   deps = [
     ":copy_libraries",
+    "../utils/compiler:compile_dart2js_nnbd_strong_platform",
     "../utils/compiler:compile_dart2js_platform",
+    "../utils/compiler:compile_dart2js_server_nnbd_strong_platform",
     "../utils/compiler:compile_dart2js_server_platform",
   ]
   sources = [
+    "$root_out_dir/dart2js_nnbd_strong_platform.dill",
     "$root_out_dir/dart2js_platform.dill",
+    "$root_out_dir/dart2js_server_nnbd_strong_platform.dill",
     "$root_out_dir/dart2js_server_platform.dill",
   ]
   outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
@@ -636,9 +640,22 @@
     "../utils/dartdevc:dartdevc_platform",
   ]
   sources = [ "$root_out_dir/ddc_outline.dill" ]
+
+  # TODO(nshahan) Fix the name here to be consistent and merge with below.
   outputs = [ "$root_out_dir/dart-sdk/lib/_internal/ddc_sdk.dill" ]
 }
 
+# Copies DDC's SDK outline .dill with sound null safety to lib/_internal
+copy("copy_dev_compiler_outline_sound") {
+  visibility = [ "../utils/dartdevc:dartdevc_test" ]
+  deps = [
+    ":copy_libraries",
+    "../utils/dartdevc:dartdevc_platform_sound",
+  ]
+  sources = [ "$root_out_dir/ddc_outline_sound.dill" ]
+  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
+}
+
 # This rule copies DDK's JS SDK and require.js to lib/dev_compiler/kernel/amd.
 copy("copy_dev_compiler_js_amd_kernel") {
   visibility = [ ":copy_dev_compiler_js" ]
diff --git a/sdk/bin/dart2js b/sdk/bin/dart2js
index cfc91b1..9c562ec 100755
--- a/sdk/bin/dart2js
+++ b/sdk/bin/dart2js
@@ -52,4 +52,4 @@
 
 DART2JS="package:compiler/src/dart2js.dart"
 
-exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
+exec "$DART" "--packages=$DART_ROOT/.packages" --enable-experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
diff --git a/sdk/bin/dart2js_sdk b/sdk/bin/dart2js_sdk
index e7999b4..03999f9 100755
--- a/sdk/bin/dart2js_sdk
+++ b/sdk/bin/dart2js_sdk
@@ -55,4 +55,4 @@
   EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
 fi
 
-exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
+exec "$DART" --enable-experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
diff --git a/sdk/bin/dartanalyzer b/sdk/bin/dartanalyzer
index 7ea062c..0574603 100755
--- a/sdk/bin/dartanalyzer
+++ b/sdk/bin/dartanalyzer
@@ -28,6 +28,7 @@
 
 unset EXTRA_VM_OPTIONS
 declare -a EXTRA_VM_OPTIONS
+EXTRA_VM_OPTIONS+=("--enable_experiment=non-nullable")
 
 case $0 in
   *_developer)
diff --git a/sdk/bin/dartanalyzer_sdk b/sdk/bin/dartanalyzer_sdk
index 28f37ab..88f4deb 100755
--- a/sdk/bin/dartanalyzer_sdk
+++ b/sdk/bin/dartanalyzer_sdk
@@ -28,4 +28,4 @@
 
 # We are running the snapshot in the built SDK.
 DART="$BIN_DIR/dart"
-exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"
+exec "$DART" --enable_experiment=non-nullable "$SNAPSHOT" "$SDK_ARG" "$@"
diff --git a/sdk/bin/dartdevc b/sdk/bin/dartdevc
index 5b75ad2..c2c25d9 100755
--- a/sdk/bin/dartdevc
+++ b/sdk/bin/dartdevc
@@ -45,4 +45,4 @@
 
 DEV_COMPILER="$DART_ROOT/pkg/dev_compiler/bin/dartdevc.dart"
 
-exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$SDK_ARG" "$@"
+exec "$DART" "--packages=$DART_ROOT/.packages" --enable_experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$SDK_ARG" "$@"
diff --git a/sdk/bin/dartdevc_sdk b/sdk/bin/dartdevc_sdk
index 6cba7d8..c687bdd 100755
--- a/sdk/bin/dartdevc_sdk
+++ b/sdk/bin/dartdevc_sdk
@@ -35,4 +35,4 @@
   EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
 fi
 
-exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
+exec "$DART" --enable_experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
diff --git a/sdk/lib/_http/crypto.dart b/sdk/lib/_http/crypto.dart
index 73f3745..f29a15b 100644
--- a/sdk/lib/_http/crypto.dart
+++ b/sdk/lib/_http/crypto.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.6
-
 part of dart._http;
 
 class _CryptoUtils {
@@ -68,7 +66,7 @@
     }
     final String lookup = urlSafe ? _encodeTableUrlSafe : _encodeTable;
     // Size of 24 bit chunks.
-    final int remainderLength = len.remainder(3);
+    final int remainderLength = len.remainder(3) as int;
     final int chunkLength = len - remainderLength;
     // Size of base output.
     int outputLen = ((len ~/ 3) * 4) + ((remainderLength > 0) ? 4 : 0);
@@ -76,7 +74,7 @@
     if (addLineSeparator) {
       outputLen += ((outputLen - 1) ~/ LINE_LENGTH) << 1;
     }
-    List<int> out = new List<int>(outputLen);
+    List<int> out = new List<int>.filled(outputLen, 0);
 
     // Encode 24 bit chunks.
     int j = 0, i = 0, c = 0;
@@ -120,7 +118,7 @@
       [bool ignoreInvalidCharacters = true]) {
     int len = input.length;
     if (len == 0) {
-      return new List<int>(0);
+      return new List<int>.empty();
     }
 
     // Count '\r', '\n' and illegal characters, For illegal characters,
@@ -149,7 +147,7 @@
       if (currentCodeUnit == PAD) padLength++;
     }
     int outputLen = (((len - extrasLen) * 6) >> 3) - padLength;
-    List<int> out = new List<int>(outputLen);
+    List<int> out = new List<int>.filled(outputLen, 0);
 
     for (int i = 0, o = 0; o < outputLen;) {
       // Accumulate 4 valid 6 bit Base 64 characters into an int.
@@ -182,7 +180,6 @@
 abstract class _HashBase {
   // Hasher state.
   final int _chunkSizeInWords;
-  final int _digestSizeInWords;
   final bool _bigEndianWords;
   int _lengthInBytes = 0;
   List<int> _pendingData;
@@ -190,12 +187,10 @@
   List<int> _h;
   bool _digestCalled = false;
 
-  _HashBase(
-      this._chunkSizeInWords, this._digestSizeInWords, this._bigEndianWords)
-      : _pendingData = [] {
-    _currentChunk = new List(_chunkSizeInWords);
-    _h = new List(_digestSizeInWords);
-  }
+  _HashBase(this._chunkSizeInWords, int digestSizeInWords, this._bigEndianWords)
+      : _pendingData = [],
+        _currentChunk = new List.filled(_chunkSizeInWords, 0),
+        _h = new List.filled(digestSizeInWords, 0);
 
   // Update the hasher with more data.
   add(List<int> data) {
@@ -271,7 +266,7 @@
 
   // Convert a 32-bit word to four bytes.
   List<int> _wordToBytes(int word) {
-    List<int> bytes = new List(_BYTES_PER_WORD);
+    List<int> bytes = new List.filled(_BYTES_PER_WORD, 0);
     bytes[0] = (word >> (_bigEndianWords ? 24 : 0)) & _MASK_8;
     bytes[1] = (word >> (_bigEndianWords ? 16 : 8)) & _MASK_8;
     bytes[2] = (word >> (_bigEndianWords ? 8 : 16)) & _MASK_8;
@@ -397,9 +392,11 @@
 
 // The SHA1 hasher is used to compute an SHA1 message digest.
 class _SHA1 extends _HashBase {
+  List<int> _w;
+
   // Construct a SHA1 hasher object.
   _SHA1()
-      : _w = new List(80),
+      : _w = List<int>.filled(80, 0),
         super(16, 5, true) {
     _h[0] = 0x67452301;
     _h[1] = 0xEFCDAB89;
@@ -455,6 +452,4 @@
     _h[3] = _add32(d, _h[3]);
     _h[4] = _add32(e, _h[4]);
   }
-
-  List<int> _w;
 }
diff --git a/sdk/lib/_http/embedder_config.dart b/sdk/lib/_http/embedder_config.dart
index fb13bea..730bc2dd 100644
--- a/sdk/lib/_http/embedder_config.dart
+++ b/sdk/lib/_http/embedder_config.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.6
-
 part of dart._http;
 
 /// Embedder-specific `dart:_http` configuration.
diff --git a/sdk/lib/_http/http.dart b/sdk/lib/_http/http.dart
index e80369c..6db8524 100644
--- a/sdk/lib/_http/http.dart
+++ b/sdk/lib/_http/http.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.6
-
 library dart._http;
 
 import 'dart:async';
@@ -18,7 +16,8 @@
         UnmodifiableMapView;
 import 'dart:convert';
 import 'dart:developer' hide log;
-import 'dart:_internal' show Since, HttpStatus;
+import 'dart:_internal'
+    show Since, valueOfNonNullableParamWithDefault, HttpStatus;
 import 'dart:math';
 import 'dart:io';
 import 'dart:typed_data';
@@ -144,7 +143,7 @@
    *
    * The default value is `null`.
    */
-  String serverHeader;
+  String? serverHeader;
 
   /**
    * Default set of headers added to all response objects.
@@ -171,7 +170,7 @@
    * The default value is `false` (compression disabled).
    * To enable, set `autoCompress` to `true`.
    */
-  bool autoCompress;
+  bool autoCompress = false;
 
   /**
    * Gets or sets the timeout used for idle keep-alive connections. If no
@@ -185,7 +184,7 @@
    *
    * To disable, set [idleTimeout] to `null`.
    */
-  Duration idleTimeout;
+  Duration? idleTimeout = const Duration(seconds: 120);
 
   /**
    * Starts listening for HTTP requests on the specified [address] and
@@ -209,13 +208,13 @@
    * [InternetAddress.loopbackIPv6], only IP version 6 (IPv6) connections
    * will be accepted.
    *
-   * If [port] has the value [:0:] an ephemeral port will be chosen by
+   * If [port] has the value 0 an ephemeral port will be chosen by
    * the system. The actual port used can be retrieved using the
    * [port] getter.
    *
    * The optional argument [backlog] can be used to specify the listen
    * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of [:0:] (the default) a reasonable value will be chosen by
+   * value of 0 (the default) a reasonable value will be chosen by
    * the system.
    *
    * The optional argument [shared] specifies whether additional HttpServer
@@ -226,7 +225,7 @@
    * distributed over multiple isolates this way.
    */
   static Future<HttpServer> bind(address, int port,
-          {int backlog: 0, bool v6Only: false, bool shared: false}) =>
+          {int backlog = 0, bool v6Only = false, bool shared = false}) =>
       _HttpServer.bind(address, port, backlog, v6Only, shared);
 
   /**
@@ -246,13 +245,13 @@
    * restrict this to version 6 (IPv6) only, use [v6Only] to set
    * version 6 only.
    *
-   * If [port] has the value [:0:] an ephemeral port will be chosen by
+   * If [port] has the value 0 an ephemeral port will be chosen by
    * the system. The actual port used can be retrieved using the
    * [port] getter.
    *
    * The optional argument [backlog] can be used to specify the listen
    * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of [:0:] (the default) a reasonable value will be chosen by
+   * value of 0 (the default) a reasonable value will be chosen by
    * the system.
    *
    * If [requestClientCertificate] is true, the server will
@@ -271,10 +270,10 @@
 
   static Future<HttpServer> bindSecure(
           address, int port, SecurityContext context,
-          {int backlog: 0,
-          bool v6Only: false,
-          bool requestClientCertificate: false,
-          bool shared: false}) =>
+          {int backlog = 0,
+          bool v6Only = false,
+          bool requestClientCertificate = false,
+          bool shared = false}) =>
       _HttpServer.bindSecure(address, port, context, backlog, v6Only,
           requestClientCertificate, shared);
 
@@ -295,30 +294,33 @@
    *
    * If [force] is `true`, active connections will be closed immediately.
    */
-  Future close({bool force: false});
+  Future close({bool force = false});
 
   /**
-   * Returns the port that the server is listening on. This can be
-   * used to get the actual port used when a value of 0 for [:port:] is
+   * The port that the server is listening on.
+   *
+   * This is the actual port used when a port of zero is
    * specified in the [bind] or [bindSecure] call.
    */
   int get port;
 
   /**
-   * Returns the address that the server is listening on. This can be
-   * used to get the actual address used, when the address is fetched by
-   * a lookup from a hostname.
+   * The address that the server is listening on.
+   *
+   * This is the actual address used when the original address
+   * was specified as a hostname.
    */
   InternetAddress get address;
 
   /**
    * Sets the timeout, in seconds, for sessions of this [HttpServer].
+   *
    * The default timeout is 20 minutes.
    */
   set sessionTimeout(int timeout);
 
   /**
-   * Returns an [HttpConnectionsInfo] object summarizing the number of
+   * A [HttpConnectionsInfo] object summarizing the number of
    * current connections handled by the server.
    */
   HttpConnectionsInfo connectionsInfo();
@@ -345,8 +347,9 @@
   int idle = 0;
 
   /**
-   * Number of connections which are preparing to close. Note: These
-   * connections are also part of the [:active:] count as they might
+   * Number of connections which are preparing to close.
+   *
+   * Note: These connections are also part of the [active] count as they might
    * still be sending data to the client before finally closing.
    */
   int closing = 0;
@@ -357,9 +360,9 @@
  *
  * In some situations, headers are immutable:
  *
- * * HttpRequest and HttpClientResponse always have immutable headers.
+ * * [HttpRequest] and [HttpClientResponse] always have immutable headers.
  *
- * * HttpResponse and HttpClientRequest have immutable headers
+ * * [HttpResponse] and [HttpClientRequest] have immutable headers
  *   from the moment the body is written to.
  *
  * In these situations, the mutating methods throw exceptions.
@@ -376,7 +379,7 @@
  *
  *     print(request.headers.value(HttpHeaders.userAgentHeader));
  *
- * An HttpHeaders object holds a list of values for each name
+ * An `HttpHeaders` object holds a list of values for each name
  * as the standard allows. In most cases a name holds only a single value,
  * The most common mode of operation is to use `set()` for setting a value,
  * and `value()` for retrieving a value.
@@ -534,6 +537,7 @@
   @Deprecated("Use setCookieHeader instead")
   static const SET_COOKIE = setCookieHeader;
 
+  // TODO(39783): Document this.
   static const generalHeaders = const [
     cacheControlHeader,
     connectionHeader,
@@ -606,71 +610,71 @@
   static const REQUEST_HEADERS = requestHeaders;
 
   /**
-   * Gets and sets the date. The value of this property will
-   * reflect the 'date' header.
+   * The date specified by the [dateHeader] header, if any.
    */
-  DateTime date;
+  DateTime? date;
 
   /**
-   * Gets and sets the expiry date. The value of this property will
-   * reflect the 'expires' header.
+   * The date and time specified by the [expiresHeader] header, if any.
    */
-  DateTime expires;
+  DateTime? expires;
 
   /**
-   * Gets and sets the "if-modified-since" date. The value of this property will
-   * reflect the "if-modified-since" header.
+   * The date and time specified by the [ifModifiedSinceHeader] header, if any.
    */
-  DateTime ifModifiedSince;
+  DateTime? ifModifiedSince;
 
   /**
-   * Gets and sets the host part of the 'host' header for the
-   * connection.
+   * The value of the [hostHeader] header, if any.
    */
-  String host;
+  String? host;
 
   /**
-   * Gets and sets the port part of the 'host' header for the
-   * connection.
+   * The value of the port part of the [hostHeader] header, if any.
    */
-  int port;
+  int? port;
 
   /**
-   * Gets and sets the content type. Note that the content type in the
-   * header will only be updated if this field is set
-   * directly. Mutating the returned current value will have no
-   * effect.
+   * The [ContentType] of the [contentTypeHeader] header, if any.
    */
-  ContentType contentType;
+  ContentType? contentType;
 
   /**
-   * Gets and sets the content length header value.
+   * The value of the [contentLengthHeader] header, if any.
+   *
+   * The value is negative if there is no content length set.
    */
-  int contentLength;
+  int contentLength = -1;
 
   /**
-   * Gets and sets the persistent connection header value.
+   * Whether the connection is persistent (keep-alive).
    */
-  bool persistentConnection;
+  late bool persistentConnection;
 
   /**
-   * Gets and sets the chunked transfer encoding header value.
+   * Whether the connection uses chunked transfer encoding.
+   *
+   * Reflects and modifies the value of the [transferEncodingHeader] header.
    */
-  bool chunkedTransferEncoding;
+  late bool chunkedTransferEncoding;
 
   /**
-   * Returns the list of values for the header named [name]. If there
-   * is no header with the provided name, [:null:] will be returned.
+   * The values for the header named [name].
+   *
+   * Returns null if there is no header with the provided name,
+   * otherwise returns a new list containing the current values.
+   * Not that modifying the list does not change the header.
    */
-  List<String> operator [](String name);
+  List<String>? operator [](String name);
 
   /**
-   * Convenience method for the value for a single valued header. If
-   * there is no header with the provided name, [:null:] will be
-   * returned. If the header has more than one value an exception is
-   * thrown.
+   * Convenience method for the value for a single valued header.
+   *
+   * The value must not have more than one value.
+   *
+   * Returns `null` if there is no header with the provided name.
    */
-  String value(String name);
+  String? value(String name);
 
   /**
    * Adds a header value.
@@ -705,17 +709,24 @@
       {@Since("2.8") bool preserveHeaderCase = false});
 
   /**
-   * Removes a specific value for a header name. Some headers have
-   * system supplied values and for these the system supplied values
-   * will still be added to the collection of values for the header.
+   * Removes a specific value for a header name.
+   *
+   * Some headers have system supplied values which cannot be removed.
+   * For all other headers and values, the [value] is converted to a string
+   * in the same way as for [add], then that string value is removed from the
+   * current values of [name].
+   * If there are no remaining values for [name], the header is no longer
+   * considered present.
    */
   void remove(String name, Object value);
 
   /**
-   * Removes all values for the specified header name. Some headers
-   * have system supplied values and for these the system supplied
-   * values will still be added to the collection of values for the
-   * header.
+   * Removes all values for the specified header name.
+   *
+   * Some headers have system supplied values which cannot be removed.
+   * All other values for [name] are removed.
+   * If there are no remaining values for [name], the header is no longer
+   * considered present.
    */
   void removeAll(String name);
 
@@ -731,25 +742,30 @@
   void forEach(void action(String name, List<String> values));
 
   /**
-   * Disables folding for the header named [name] when sending the HTTP
-   * header. By default, multiple header values are folded into a
-   * single header line by separating the values with commas. The
-   * 'set-cookie' header has folding disabled by default.
+   * Disables folding for the header named [name] when sending the HTTP header.
+   *
+   * By default, multiple header values are folded into a
+   * single header line by separating the values with commas.
+   *
+   * The 'set-cookie' header has folding disabled by default.
    */
   void noFolding(String name);
 
   /**
-   * Remove all headers. Some headers have system supplied values and
-   * for these the system supplied values will still be added to the
-   * collection of values for the header.
+   * Removes all headers.
+   *
+   * Some headers have system supplied values which cannot be removed.
+   * All other header values are removed, and header names with not
+   * remaining values are no longer considered present.
    */
   void clear();
 }
 
 /**
  * Representation of a header value in the form:
- *
- *   [:value; parameter1=value1; parameter2=value2:]
+ * ```dart
+ * value; parameter1=value1; parameter2=value2
+ * ```
  *
  * [HeaderValue] can be used to conveniently build and parse header
  * values on this form.
@@ -759,7 +775,7 @@
  * token characters and backslash sequences can be used to represent the double
  * quote and backslash characters themselves.
  *
- * To build an [:accepts:] header with the value
+ * To build an "accepts" header with the value
  *
  *     text/plain; q=0.3, text/html
  *
@@ -770,7 +786,7 @@
  *     request.headers.add(HttpHeaders.acceptHeader, v);
  *     request.headers.add(HttpHeaders.acceptHeader, "text/html");
  *
- * To parse the header values use the [:parse:] static method.
+ * To parse the header values use the [parse] static method.
  *
  *     HttpRequest request = ...;
  *     List<String> values = request.headers[HttpHeaders.acceptHeader];
@@ -786,7 +802,7 @@
    * Creates a new header value object setting the value and parameters.
    */
   factory HeaderValue(
-      [String value = "", Map<String, String> parameters = const {}]) {
+      [String value = "", Map<String, String?> parameters = const {}]) {
     return new _HeaderValue(value, parameters);
   }
 
@@ -795,9 +811,9 @@
    * string with both value and optional parameters.
    */
   static HeaderValue parse(String value,
-      {String parameterSeparator: ";",
-      String valueSeparator: null,
-      bool preserveBackslash: false}) {
+      {String parameterSeparator = ";",
+      String? valueSeparator,
+      bool preserveBackslash = false}) {
     return _HeaderValue.parse(value,
         parameterSeparator: parameterSeparator,
         valueSeparator: valueSeparator,
@@ -805,52 +821,57 @@
   }
 
   /**
-   * Gets the header value.
+   * The value of the header.
    */
   String get value;
 
   /**
-   * Gets the map of parameters.
+   * A map of parameters.
    *
-   * This map cannot be modified. Invoking any operation which would
-   * modify the map will throw [UnsupportedError].
+   * This map cannot be modified.
    */
-  Map<String, String> get parameters;
+  Map<String, String?> get parameters;
 
   /**
    * Returns the formatted string representation in the form:
-   *
-   *     value; parameter1=value1; parameter2=value2
+   * ```
+   * value; parameter1=value1; parameter2=value2
+   * ```
    */
   String toString();
 }
 
 abstract class HttpSession implements Map {
   /**
-   * Gets the id for the current session.
+   * The id of the current session.
    */
   String get id;
 
   /**
-   * Destroys the session. This will terminate the session and any further
+   * Destroys the session.
+   *
+   * This terminates the session and any further
    * connections with this id will be given a new id and session.
    */
   void destroy();
 
   /**
    * Sets a callback that will be called when the session is timed out.
+   *
+   * Calling this again will overwrite the previous value.
    */
   void set onTimeout(void callback());
 
   /**
-   * Is true if the session has not been sent to the client yet.
+   * Whether the session has not yet been sent to the client.
    */
   bool get isNew;
 }
 
 /**
- * Representation of a content type. An instance of [ContentType] is
- * immutable.
+ * A MIME/IANA media type used as the value of the [contentTypeHeader] header.
+ *
+ * A [ContentType] is immutable.
  */
 abstract class ContentType implements HeaderValue {
   /**
@@ -899,7 +920,7 @@
    * or in `parameters`, will have its value converted to lower-case.
    */
   factory ContentType(String primaryType, String subType,
-      {String charset, Map<String, String> parameters = const {}}) {
+      {String? charset, Map<String, String?> parameters = const {}}) {
     return new _ContentType(primaryType, subType, charset, parameters);
   }
 
@@ -911,32 +932,47 @@
    *
    *     text/html; charset=utf-8
    *
-   * will create a content type object with primary type [:text:], sub
-   * type [:html:] and parameter [:charset:] with value [:utf-8:].
+   * will create a content type object with primary type "text",
+   * subtype "html" and parameter "charset" with value "utf-8".
+   * There may be more parameters supplied, but they are not recognized
+   * by this class.
    */
   static ContentType parse(String value) {
     return _ContentType.parse(value);
   }
 
   /**
-   * Gets the mime-type, without any parameters.
+   * Gets the MIME type and subtype, without any parameters.
+   *
+   * For the full content type `text/html;charset=utf-8`,
+   * the [mimeType] value is the string `text/html`.
    */
   String get mimeType;
 
   /**
    * Gets the primary type.
+   *
+   * For the full content type `text/html;charset=utf-8`,
+   * the [primaryType] value is the string `text`.
    */
   String get primaryType;
 
   /**
-   * Gets the sub type.
+   * Gets the subtype.
+   *
+   * For the full content type `text/html;charset=utf-8`,
+   * the [subType] value is the string `html`.
+   * May be the empty string.
    */
   String get subType;
 
   /**
-   * Gets the character set.
+   * Gets the character set, if any.
+   *
+   * For the full content type `text/html;charset=utf-8`,
+   * the [charset] value is the string `utf-8`.
    */
-  String get charset;
+  String? get charset;
 }
 
 /**
@@ -956,7 +992,7 @@
    * `(`, `)`, `<`, `>`, `@`, `,`, `;`, `:`, `\`, `"`, `/`, `[`, `]`, `?`, `=`,
    * `{`, and `}`.
    */
-  String name;
+  late String name;
 
   /**
    * The value of the cookie.
@@ -969,39 +1005,39 @@
    * Cookie values may be wrapped in a single pair of double quotes
    * (U+0022, `"`).
    */
-  String value;
+  late String value;
 
   /**
    * The time at which the cookie expires.
    */
-  DateTime expires;
+  DateTime? expires;
 
   /**
    * The number of seconds until the cookie expires. A zero or negative value
    * means the cookie has expired.
    */
-  int maxAge;
+  int? maxAge;
 
   /**
-   * The domain the cookie applies to.
+   * The domain that the cookie applies to.
    */
-  String domain;
+  String? domain;
 
   /**
-   * The path within the [domain] the cookie applies to.
+   * The path within the [domain] that the cookie applies to.
    */
-  String path;
+  String? path;
 
   /**
    * Whether to only send this cookie on secure connections.
    */
-  bool secure;
+  bool secure = false;
 
   /**
    * Whether the cookie is only sent in the HTTP request and is not made
    * available to client side scripts.
    */
-  bool httpOnly;
+  bool httpOnly = false;
 
   /**
    * Creates a new cookie setting the name and value.
@@ -1123,7 +1159,7 @@
   HttpHeaders get headers;
 
   /**
-   * The cookies in the request, from the Cookie headers.
+   * The cookies in the request, from the "Cookie" headers.
    */
   List<Cookie> get cookies;
 
@@ -1139,14 +1175,13 @@
    * or if the server does not request a client certificate, or if the client
    * does not provide one.
    */
-  X509Certificate get certificate;
+  X509Certificate? get certificate;
 
   /**
    * The session for the given request.
    *
-   * If the session is
-   * being initialized by this call, [:isNew:] is true for the returned
-   * session.
+   * If the session is being initialized by this call,
+   * [HttpSession.isNew] is true for the returned session.
    * See [HttpServer.sessionTimeout] on how to change default timeout.
    */
   HttpSession get session;
@@ -1160,9 +1195,9 @@
   /**
    * Information about the client connection.
    *
-   * Returns [:null:] if the socket is not available.
+   * Returns `null` if the socket is not available.
    */
-  HttpConnectionInfo get connectionInfo;
+  HttpConnectionInfo? get connectionInfo;
 
   /**
    * The [HttpResponse] object, used for sending back the response to the
@@ -1231,10 +1266,12 @@
    * the response is not known in advance set the content length to
    * -1, which is also the default if not set.
    */
-  int contentLength;
+  int contentLength = -1;
 
   /**
-   * Gets and sets the status code. Any integer value is accepted. For
+   * The status code of the response.
+   *
+   * Any integer value is accepted. For
    * the official HTTP status codes use the fields from
    * [HttpStatus]. If no status code is explicitly set the default
    * value [HttpStatus.ok] is used.
@@ -1243,24 +1280,25 @@
    * to. Setting the status code after writing to the response body or
    * closing the response will throw a `StateError`.
    */
-  int statusCode;
+  int statusCode = HttpStatus.ok;
 
   /**
-   * Gets and sets the reason phrase. If no reason phrase is explicitly
-   * set a default reason phrase is provided.
+   * The reason phrase for the response.
+   *
+   * If no reason phrase is explicitly set, a default reason phrase is provided.
    *
    * The reason phrase must be set before the body is written
    * to. Setting the reason phrase after writing to the response body
-   * or closing the response will throw a `StateError`.
+   * or closing the response will throw a [StateError].
    */
-  String reasonPhrase;
+  late String reasonPhrase;
 
   /**
    * Gets and sets the persistent connection state. The initial value
    * of this property is the persistent connection state from the
    * request.
    */
-  bool persistentConnection;
+  late bool persistentConnection;
 
   /**
    * Set and get the [deadline] for the response. The deadline is timed from the
@@ -1272,7 +1310,7 @@
    *
    * The [deadline] is `null` by default.
    */
-  Duration deadline;
+  Duration? deadline;
 
   /**
    * Gets or sets if the [HttpResponse] should buffer output.
@@ -1282,7 +1320,7 @@
    * __Note__: Disabling buffering of the output can result in very poor
    * performance, when writing many small chunks.
    */
-  bool bufferOutput;
+  bool bufferOutput = true;
 
   /**
    * Returns the response headers.
@@ -1310,7 +1348,7 @@
    * This method will also call `close`, and the returned future is
    * the future returned by `close`.
    */
-  Future redirect(Uri location, {int status: HttpStatus.movedTemporarily});
+  Future redirect(Uri location, {int status = HttpStatus.movedTemporarily});
 
   /**
    * Detaches the underlying socket from the HTTP server. When the
@@ -1324,13 +1362,13 @@
    * to the socket before it's detached. If `false`, the socket is detached
    * immediately, without any data written to the socket. Default is `true`.
    */
-  Future<Socket> detachSocket({bool writeHeaders: true});
+  Future<Socket> detachSocket({bool writeHeaders = true});
 
   /**
-   * Gets information about the client connection. Returns [:null:] if the
+   * Gets information about the client connection. Returns `null` if the
    * socket is not available.
    */
-  HttpConnectionInfo get connectionInfo;
+  HttpConnectionInfo? get connectionInfo;
 }
 
 /**
@@ -1416,7 +1454,7 @@
  * By default the HttpClient uses the proxy configuration available
  * from the environment, see [findProxyFromEnvironment]. To turn off
  * the use of proxies set the [findProxy] property to
- * [:null:].
+ * `null`.
  *
  *     HttpClient client = new HttpClient();
  *     client.findProxy = null;
@@ -1435,7 +1473,8 @@
   ///
   /// Default is `false`.
   static set enableTimelineLogging(bool value) {
-    _enableTimelineLogging = value ?? false;
+    _enableTimelineLogging =
+        valueOfNonNullableParamWithDefault<bool>(value, false);
   }
 
   /// Current state of HTTP request logging from all [HttpClient]s to the
@@ -1450,7 +1489,7 @@
   /// connections.
   ///
   /// The default value is 15 seconds.
-  Duration idleTimeout;
+  Duration idleTimeout = const Duration(seconds: 15);
 
   /// Gets and sets the connection timeout.
   ///
@@ -1460,7 +1499,7 @@
   ///
   /// When this is `null`, the OS default timeout is used. The default is
   /// `null`.
-  Duration connectionTimeout;
+  Duration? connectionTimeout;
 
   /**
    * Gets and sets the maximum number of live connections, to a single host.
@@ -1472,7 +1511,7 @@
    *
    * Default is `null`.
    */
-  int maxConnectionsPerHost;
+  int? maxConnectionsPerHost;
 
   /**
    * Gets and sets whether the body of a response will be automatically
@@ -1500,7 +1539,7 @@
    *
    * Default is `true`.
    */
-  bool autoUncompress;
+  bool autoUncompress = true;
 
   /// Gets and sets the default value of the `User-Agent` header for all requests
   /// generated by this [HttpClient].
@@ -1509,10 +1548,10 @@
   ///
   /// If the userAgent is set to `null`, no default `User-Agent` header will be
   /// added to each request.
-  String userAgent;
+  String? userAgent;
 
-  factory HttpClient({SecurityContext context}) {
-    HttpOverrides overrides = HttpOverrides.current;
+  factory HttpClient({SecurityContext? context}) {
+    HttpOverrides? overrides = HttpOverrides.current;
     if (overrides == null) {
       return new _HttpClient(context);
     }
@@ -1679,12 +1718,12 @@
    *
    * The function returns a [Future] which should complete when the
    * authentication has been resolved. If credentials cannot be
-   * provided the [Future] should complete with [:false:]. If
+   * provided the [Future] should complete with `false`. If
    * credentials are available the function should add these using
    * [addCredentials] before completing the [Future] with the value
-   * [:true:].
+   * `true`.
    *
-   * If the [Future] completes with [:true:] the request will be retried
+   * If the [Future] completes with `true` the request will be retried
    * using the updated credentials, however, the retried request will not
    * carry the original request payload. Otherwise response processing will
    * continue normally.
@@ -1695,7 +1734,7 @@
    * of a failed request, or issues due to missing request payload on retried
    * request.
    */
-  set authenticate(Future<bool> f(Uri url, String scheme, String realm));
+  void set authenticate(Future<bool> f(Uri url, String scheme, String realm)?);
 
   /**
    * Add credentials to be used for authorizing HTTP requests.
@@ -1716,7 +1755,7 @@
    *
    *     "PROXY host:port"
    *
-   * for using the proxy server [:host:] on port [:port:].
+   * for using the proxy server `host` on port `port`.
    *
    * A configuration can contain several configuration elements
    * separated by semicolons, e.g.
@@ -1727,7 +1766,7 @@
    * be used to implement proxy server resolving based on environment
    * variables.
    */
-  set findProxy(String f(Uri url));
+  void set findProxy(String f(Uri url)?);
 
   /**
    * Function for resolving the proxy server to be used for a HTTP
@@ -1781,8 +1820,8 @@
    * to set credentials for proxies which require authentication.
    */
   static String findProxyFromEnvironment(Uri url,
-      {Map<String, String> environment}) {
-    HttpOverrides overrides = HttpOverrides.current;
+      {Map<String, String>? environment}) {
+    HttpOverrides? overrides = HttpOverrides.current;
     if (overrides == null) {
       return _HttpClient._findProxyFromEnvironment(url, environment);
     }
@@ -1797,17 +1836,17 @@
    *
    * The function returns a [Future] which should complete when the
    * authentication has been resolved. If credentials cannot be
-   * provided the [Future] should complete with [:false:]. If
+   * provided the [Future] should complete with `false`. If
    * credentials are available the function should add these using
    * [addProxyCredentials] before completing the [Future] with the value
-   * [:true:].
+   * `true`.
    *
-   * If the [Future] completes with [:true:] the request will be retried
+   * If the [Future] completes with `true` the request will be retried
    * using the updated credentials. Otherwise response processing will
    * continue normally.
    */
-  set authenticateProxy(
-      Future<bool> f(String host, int port, String scheme, String realm));
+  void set authenticateProxy(
+      Future<bool> f(String host, int port, String scheme, String realm)?);
 
   /**
    * Add credentials to be used for authorizing HTTP proxies.
@@ -1824,8 +1863,8 @@
    * server returns a server certificate that cannot be authenticated, the
    * callback is called asynchronously with the [X509Certificate] object and
    * the server's hostname and port.  If the value of [badCertificateCallback]
-   * is [:null:], the bad certificate is rejected, as if the callback
-   * returned [:false:]
+   * is `null`, the bad certificate is rejected, as if the callback
+   * returned `false`
    *
    * If the callback returns true, the secure connection is accepted and the
    * [:Future<HttpClientRequest>:] that was returned from the call making the
@@ -1837,8 +1876,8 @@
    * the request is made, even if the value of badCertificateCallback
    * has changed since then.
    */
-  set badCertificateCallback(
-      bool callback(X509Certificate cert, String host, int port));
+  void set badCertificateCallback(
+      bool callback(X509Certificate cert, String host, int port)?);
 
   /// Shuts down the HTTP client.
   ///
@@ -1848,7 +1887,7 @@
   /// closed connections will receive an error event to indicate that the client
   /// was shut down. In both cases trying to establish a new connection after
   /// calling [close] will throw an exception.
-  void close({bool force: false});
+  void close({bool force = false});
 }
 
 /**
@@ -1883,23 +1922,25 @@
  */
 abstract class HttpClientRequest implements IOSink {
   /**
-   * Gets and sets the requested persistent connection state.
+   * The requested persistent connection state.
    *
-   * The default value is [:true:].
+   * The default value is `true`.
    */
-  bool persistentConnection;
+  bool persistentConnection = true;
 
   /**
-   * Set this property to [:true:] if this request should
-   * automatically follow redirects. The default is [:true:].
+   * Whether to follow redirects automatically.
+   *
+   * Set this property to `false` if this request should not
+   * automatically follow redirects. The default is `true`.
    *
    * Automatic redirect will only happen for "GET" and "HEAD" requests
-   * and only for the status codes [:HttpStatus.movedPermanently:]
-   * (301), [:HttpStatus.found:] (302),
-   * [:HttpStatus.movedTemporarily:] (302, alias for
-   * [:HttpStatus.found:]), [:HttpStatus.seeOther:] (303) and
-   * [:HttpStatus.temporaryRedirect:] (307). For
-   * [:HttpStatus.seeOther:] (303) automatic redirect will also happen
+   * and only for the status codes [HttpStatus.movedPermanently]
+   * (301), [HttpStatus.found] (302),
+   * [HttpStatus.movedTemporarily] (302, alias for
+   * [HttpStatus.found]), [HttpStatus.seeOther] (303) and
+   * [HttpStatus.temporaryRedirect] (307). For
+   * [HttpStatus.seeOther] (303) automatic redirect will also happen
    * for "POST" requests with the method changed to "GET" when
    * following the redirect.
    *
@@ -1907,7 +1948,7 @@
    * request(s). However, any body send with the request will not be
    * part of the redirection request(s).
    */
-  bool followRedirects;
+  bool followRedirects = true;
 
   /**
    * Set this property to the maximum number of redirects to follow
@@ -1916,7 +1957,7 @@
    *
    * The default value is 5.
    */
-  int maxRedirects;
+  int maxRedirects = 5;
 
   /**
    * The method of the request.
@@ -1932,7 +1973,7 @@
   ///
   /// If the size of the request is not known in advance set content length to
   /// -1, which is also the default.
-  int contentLength;
+  int contentLength = -1;
 
   /**
    * Gets or sets if the [HttpClientRequest] should buffer output.
@@ -1942,7 +1983,7 @@
    * __Note__: Disabling buffering of the output can result in very poor
    * performance, when writing many small chunks.
    */
-  bool bufferOutput;
+  bool bufferOutput = true;
 
   /**
    * Returns the client request headers.
@@ -1972,8 +2013,8 @@
 
   /// Gets information about the client connection.
   ///
-  /// Returns [:null:] if the socket is not available.
-  HttpConnectionInfo get connectionInfo;
+  /// Returns `null` if the socket is not available.
+  HttpConnectionInfo? get connectionInfo;
 }
 
 /**
@@ -2063,14 +2104,14 @@
    * request. However, any body sent with the request will not be
    * part of the redirection request.
    *
-   * If [followLoops] is set to [:true:], redirect will follow the redirect,
-   * even if the URL was already visited. The default value is [:false:].
+   * If [followLoops] is set to `true`, redirect will follow the redirect,
+   * even if the URL was already visited. The default value is `false`.
    *
    * The method will ignore [HttpClientRequest.maxRedirects]
    * and will always perform the redirect.
    */
   Future<HttpClientResponse> redirect(
-      [String method, Uri url, bool followLoops]);
+      [String? method, Uri? url, bool? followLoops]);
 
   /**
    * Returns the client response headers.
@@ -2098,13 +2139,13 @@
    * Returns the certificate of the HTTPS server providing the response.
    * Returns null if the connection is not a secure TLS or SSL connection.
    */
-  X509Certificate get certificate;
+  X509Certificate? get certificate;
 
   /**
-   * Gets information about the client connection. Returns [:null:] if the socket
+   * Gets information about the client connection. Returns `null` if the socket
    * is not available.
    */
-  HttpConnectionInfo get connectionInfo;
+  HttpConnectionInfo? get connectionInfo;
 }
 
 /// Enum that specifies the compression state of the byte stream of an
@@ -2215,12 +2256,13 @@
 
 class HttpException implements IOException {
   final String message;
-  final Uri uri;
+  final Uri? uri;
 
   const HttpException(this.message, {this.uri});
 
   String toString() {
     var b = new StringBuffer()..write('HttpException: ')..write(message);
+    var uri = this.uri;
     if (uri != null) {
       b.write(', uri = $uri');
     }
diff --git a/sdk/lib/_http/http_date.dart b/sdk/lib/_http/http_date.dart
index ab24b87..5fd2f34 100644
--- a/sdk/lib/_http/http_date.dart
+++ b/sdk/lib/_http/http_date.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.6
-
 part of dart._http;
 
 /**
@@ -123,7 +121,6 @@
 
     int index = 0;
     String tmp;
-    int format;
 
     void expect(String s) {
       if (date.length - index < s.length) {
@@ -147,21 +144,18 @@
         index = pos + 1;
         weekday = wkdays.indexOf(tmp);
         if (weekday != -1) {
-          format = formatAsctime;
-          return weekday;
+          return formatAsctime;
         }
       } else {
         tmp = date.substring(index, pos);
         index = pos + 1;
         weekday = wkdays.indexOf(tmp);
         if (weekday != -1) {
-          format = formatRfc1123;
-          return weekday;
+          return formatRfc1123;
         }
         weekday = weekdays.indexOf(tmp);
         if (weekday != -1) {
-          format = formatRfc850;
-          return weekday;
+          return formatRfc850;
         }
       }
       throw new HttpException("Invalid HTTP date $date");
@@ -200,10 +194,10 @@
       }
     }
 
-    int weekday = expectWeekday();
-    int day;
-    int month;
+    int format = expectWeekday();
     int year;
+    int month;
+    int day;
     int hours;
     int minutes;
     int seconds;
@@ -248,7 +242,7 @@
 
     int position = 0;
 
-    void error() {
+    Never error() {
       throw new HttpException("Invalid cookie date $date");
     }
 
@@ -302,10 +296,10 @@
       while (!isEnd() && isDelimiter(date[position])) position++;
     }
 
-    String timeStr;
-    String dayOfMonthStr;
-    String monthStr;
-    String yearStr;
+    String? timeStr;
+    String? dayOfMonthStr;
+    String? monthStr;
+    String? yearStr;
 
     for (var token in tokens) {
       if (token.length < 1) continue;
diff --git a/sdk/lib/_http/http_headers.dart b/sdk/lib/_http/http_headers.dart
index ad887b9..ae8b482 100644
--- a/sdk/lib/_http/http_headers.dart
+++ b/sdk/lib/_http/http_headers.dart
@@ -2,30 +2,28 @@
 // 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.6
-
 part of dart._http;
 
 class _HttpHeaders implements HttpHeaders {
   final Map<String, List<String>> _headers;
   // The original header names keyed by the lowercase header names.
-  Map<String, String> _originalHeaderNames;
+  Map<String, String>? _originalHeaderNames;
   final String protocolVersion;
 
   bool _mutable = true; // Are the headers currently mutable?
-  List<String> _noFoldingHeaders;
+  List<String>? _noFoldingHeaders;
 
   int _contentLength = -1;
   bool _persistentConnection = true;
   bool _chunkedTransferEncoding = false;
-  String _host;
-  int _port;
+  String? _host;
+  int? _port;
 
   final int _defaultPortForScheme;
 
   _HttpHeaders(this.protocolVersion,
-      {int defaultPortForScheme: HttpClient.defaultHttpPort,
-      _HttpHeaders initialHeaders})
+      {int defaultPortForScheme = HttpClient.defaultHttpPort,
+      _HttpHeaders? initialHeaders})
       : _headers = new HashMap<String, List<String>>(),
         _defaultPortForScheme = defaultPortForScheme {
     if (initialHeaders != null) {
@@ -42,12 +40,13 @@
     }
   }
 
-  List<String> operator [](String name) => _headers[_validateField(name)];
+  List<String>? operator [](String name) => _headers[_validateField(name)];
 
-  String value(String name) {
+  String? value(String name) {
     name = _validateField(name);
-    List<String> values = _headers[name];
+    List<String>? values = _headers[name];
     if (values == null) return null;
+    assert(values.isNotEmpty);
     if (values.length > 1) {
       throw new HttpException("More than one value for header $name");
     }
@@ -86,8 +85,6 @@
     }
     if (preserveHeaderCase && name != lowercaseName) {
       (_originalHeaderNames ??= {})[lowercaseName] = name;
-    } else {
-      _originalHeaderNames?.remove(lowercaseName);
     }
     _addAll(lowercaseName, value);
   }
@@ -96,12 +93,9 @@
     _checkMutable();
     name = _validateField(name);
     value = _validateValue(value);
-    List<String> values = _headers[name];
+    List<String>? values = _headers[name];
     if (values != null) {
-      int index = values.indexOf(value);
-      if (index != -1) {
-        values.removeRange(index, index + 1);
-      }
+      values.remove(_valueToString(value));
       if (values.length == 0) {
         _headers.remove(name);
         _originalHeaderNames?.remove(name);
@@ -128,8 +122,7 @@
 
   void noFolding(String name) {
     name = _validateField(name);
-    if (_noFoldingHeaders == null) _noFoldingHeaders = new List<String>();
-    _noFoldingHeaders.add(name);
+    (_noFoldingHeaders ??= <String>[]).add(name);
   }
 
   bool get persistentConnection => _persistentConnection;
@@ -142,7 +135,7 @@
       if (protocolVersion == "1.1") {
         remove(HttpHeaders.connectionHeader, "close");
       } else {
-        if (_contentLength == -1) {
+        if (_contentLength < 0) {
           throw new HttpException(
               "Trying to set 'Connection: Keep-Alive' on HTTP 1.0 headers with "
               "no ContentLength");
@@ -176,7 +169,7 @@
       if (chunkedTransferEncoding) chunkedTransferEncoding = false;
       _set(HttpHeaders.contentLengthHeader, contentLength.toString());
     } else {
-      removeAll(HttpHeaders.contentLengthHeader);
+      _headers.remove(HttpHeaders.contentLengthHeader);
       if (protocolVersion == "1.1") {
         chunkedTransferEncoding = true;
       }
@@ -193,8 +186,8 @@
     }
     if (chunkedTransferEncoding == _chunkedTransferEncoding) return;
     if (chunkedTransferEncoding) {
-      List<String> values = _headers[HttpHeaders.transferEncodingHeader];
-      if ((values == null || !values.contains("chunked"))) {
+      List<String>? values = _headers[HttpHeaders.transferEncodingHeader];
+      if (values == null || !values.contains("chunked")) {
         // Headers does not specify chunked encoding - add it if set.
         _addValue(HttpHeaders.transferEncodingHeader, "chunked");
       }
@@ -206,25 +199,26 @@
     _chunkedTransferEncoding = chunkedTransferEncoding;
   }
 
-  String get host => _host;
+  String? get host => _host;
 
-  void set host(String host) {
+  void set host(String? host) {
     _checkMutable();
     _host = host;
     _updateHostHeader();
   }
 
-  int get port => _port;
+  int? get port => _port;
 
-  void set port(int port) {
+  void set port(int? port) {
     _checkMutable();
     _port = port;
     _updateHostHeader();
   }
 
-  DateTime get ifModifiedSince {
-    List<String> values = _headers[HttpHeaders.ifModifiedSinceHeader];
+  DateTime? get ifModifiedSince {
+    List<String>? values = _headers[HttpHeaders.ifModifiedSinceHeader];
     if (values != null) {
+      assert(values.isNotEmpty);
       try {
         return HttpDate.parse(values[0]);
       } on Exception {
@@ -234,16 +228,21 @@
     return null;
   }
 
-  void set ifModifiedSince(DateTime ifModifiedSince) {
+  void set ifModifiedSince(DateTime? ifModifiedSince) {
     _checkMutable();
-    // Format "ifModifiedSince" header with date in Greenwich Mean Time (GMT).
-    String formatted = HttpDate.format(ifModifiedSince.toUtc());
-    _set(HttpHeaders.ifModifiedSinceHeader, formatted);
+    if (ifModifiedSince == null) {
+      _headers.remove(HttpHeaders.ifModifiedSinceHeader);
+    } else {
+      // Format "ifModifiedSince" header with date in Greenwich Mean Time (GMT).
+      String formatted = HttpDate.format(ifModifiedSince.toUtc());
+      _set(HttpHeaders.ifModifiedSinceHeader, formatted);
+    }
   }
 
-  DateTime get date {
-    List<String> values = _headers[HttpHeaders.dateHeader];
+  DateTime? get date {
+    List<String>? values = _headers[HttpHeaders.dateHeader];
     if (values != null) {
+      assert(values.isNotEmpty);
       try {
         return HttpDate.parse(values[0]);
       } on Exception {
@@ -253,16 +252,21 @@
     return null;
   }
 
-  void set date(DateTime date) {
+  void set date(DateTime? date) {
     _checkMutable();
-    // Format "DateTime" header with date in Greenwich Mean Time (GMT).
-    String formatted = HttpDate.format(date.toUtc());
-    _set("date", formatted);
+    if (date == null) {
+      _headers.remove(HttpHeaders.dateHeader);
+    } else {
+      // Format "DateTime" header with date in Greenwich Mean Time (GMT).
+      String formatted = HttpDate.format(date.toUtc());
+      _set(HttpHeaders.dateHeader, formatted);
+    }
   }
 
-  DateTime get expires {
-    List<String> values = _headers[HttpHeaders.expiresHeader];
+  DateTime? get expires {
+    List<String>? values = _headers[HttpHeaders.expiresHeader];
     if (values != null) {
+      assert(values.isNotEmpty);
       try {
         return HttpDate.parse(values[0]);
       } on Exception {
@@ -272,14 +276,18 @@
     return null;
   }
 
-  void set expires(DateTime expires) {
+  void set expires(DateTime? expires) {
     _checkMutable();
-    // Format "Expires" header with date in Greenwich Mean Time (GMT).
-    String formatted = HttpDate.format(expires.toUtc());
-    _set(HttpHeaders.expiresHeader, formatted);
+    if (expires == null) {
+      _headers.remove(HttpHeaders.expiresHeader);
+    } else {
+      // Format "Expires" header with date in Greenwich Mean Time (GMT).
+      String formatted = HttpDate.format(expires.toUtc());
+      _set(HttpHeaders.expiresHeader, formatted);
+    }
   }
 
-  ContentType get contentType {
+  ContentType? get contentType {
     var values = _headers[HttpHeaders.contentTypeHeader];
     if (values != null) {
       return ContentType.parse(values[0]);
@@ -288,9 +296,13 @@
     }
   }
 
-  void set contentType(ContentType contentType) {
+  void set contentType(ContentType? contentType) {
     _checkMutable();
-    _set(HttpHeaders.contentTypeHeader, contentType.toString());
+    if (contentType == null) {
+      _headers.remove(HttpHeaders.contentTypeHeader);
+    } else {
+      _set(HttpHeaders.contentTypeHeader, contentType.toString());
+    }
   }
 
   void clear() {
@@ -447,42 +459,41 @@
   }
 
   void _addValue(String name, Object value) {
-    List<String> values = _headers[name];
-    if (values == null) {
-      values = new List<String>();
-      _headers[name] = values;
-    }
+    List<String> values = (_headers[name] ??= <String>[]);
+    values.add(_valueToString(value));
+  }
+
+  String _valueToString(Object value) {
     if (value is DateTime) {
-      values.add(HttpDate.format(value));
+      return HttpDate.format(value);
     } else if (value is String) {
-      values.add(value);
+      return value; // TODO(39784): no _validateValue?
     } else {
-      values.add(_validateValue(value.toString()));
+      return _validateValue(value.toString()) as String;
     }
   }
 
   void _set(String name, String value) {
     assert(name == _validateField(name));
-    List<String> values = new List<String>();
-    _headers[name] = values;
-    values.add(value);
+    _headers[name] = <String>[value];
   }
 
-  _checkMutable() {
+  void _checkMutable() {
     if (!_mutable) throw new HttpException("HTTP headers are not mutable");
   }
 
-  _updateHostHeader() {
-    bool defaultPort = _port == null || _port == _defaultPortForScheme;
-    _set("host", defaultPort ? host : "$host:$_port");
+  void _updateHostHeader() {
+    var host = _host;
+    if (host != null) {
+      bool defaultPort = _port == null || _port == _defaultPortForScheme;
+      _set("host", defaultPort ? host : "$host:$_port");
+    }
   }
 
-  _foldHeader(String name) {
-    if (name == HttpHeaders.setCookieHeader ||
-        (_noFoldingHeaders != null && _noFoldingHeaders.indexOf(name) != -1)) {
-      return false;
-    }
-    return true;
+  bool _foldHeader(String name) {
+    if (name == HttpHeaders.setCookieHeader) return false;
+    var noFoldingHeaders = _noFoldingHeaders;
+    return noFoldingHeaders == null || !noFoldingHeaders.contains(name);
   }
 
   void _finalize() {
@@ -540,7 +551,7 @@
 
   List<Cookie> _parseCookies() {
     // Parse a Cookie header value according to the rules in RFC 6265.
-    var cookies = new List<Cookie>();
+    var cookies = <Cookie>[];
     void parseCookieString(String s) {
       int index = 0;
 
@@ -603,7 +614,7 @@
       }
     }
 
-    List<String> values = _headers[HttpHeaders.cookieHeader];
+    List<String>? values = _headers[HttpHeaders.cookieHeader];
     if (values != null) {
       values.forEach((headerValue) => parseCookieString(headerValue));
     }
@@ -632,26 +643,28 @@
   }
 
   String _originalHeaderName(String name) {
-    return (_originalHeaderNames == null ? null : _originalHeaderNames[name]) ??
-        name;
+    // TODO: Update syntax to_originalHeaderNames?[name].
+    return _originalHeaderNames?.[name] ?? name;
   }
 }
 
 class _HeaderValue implements HeaderValue {
   String _value;
-  Map<String, String> _parameters;
-  Map<String, String> _unmodifiableParameters;
+  Map<String, String?>? _parameters;
+  Map<String, String?>? _unmodifiableParameters;
 
-  _HeaderValue([this._value = "", Map<String, String> parameters = const {}]) {
-    if (parameters != null && parameters.isNotEmpty) {
-      _parameters = new HashMap<String, String>.from(parameters);
+  _HeaderValue([this._value = "", Map<String, String?> parameters = const {}]) {
+    // TODO(40614): Remove once non-nullability is sound.
+    Map<String, String?>? nullableParameters = parameters;
+    if (nullableParameters != null && nullableParameters.isNotEmpty) {
+      _parameters = new HashMap<String, String?>.from(nullableParameters);
     }
   }
 
   static _HeaderValue parse(String value,
-      {parameterSeparator: ";",
-      valueSeparator: null,
-      preserveBackslash: false}) {
+      {String parameterSeparator = ";",
+      String? valueSeparator,
+      bool preserveBackslash = false}) {
     // Parse the string.
     var result = new _HeaderValue();
     result._parse(value, parameterSeparator, valueSeparator, preserveBackslash);
@@ -660,9 +673,10 @@
 
   String get value => _value;
 
-  Map<String, String> _ensureParameters() => _parameters ??= <String, String>{};
+  Map<String, String?> _ensureParameters() =>
+      _parameters ??= <String, String?>{};
 
-  Map<String, String> get parameters =>
+  Map<String, String?> get parameters =>
       _unmodifiableParameters ??= UnmodifiableMapView(_ensureParameters());
 
   static bool _isToken(String token) {
@@ -684,8 +698,9 @@
   String toString() {
     StringBuffer sb = new StringBuffer();
     sb.write(_value);
+    var parameters = this._parameters;
     if (parameters != null && parameters.length > 0) {
-      _parameters.forEach((String name, String value) {
+      parameters.forEach((String name, String? value) {
         sb..write("; ")..write(name);
         if (value != null) {
           sb.write("=");
@@ -712,7 +727,7 @@
     return sb.toString();
   }
 
-  void _parse(String s, String parameterSeparator, String valueSeparator,
+  void _parse(String s, String parameterSeparator, String? valueSeparator,
       bool preserveBackslash) {
     int index = 0;
 
@@ -728,10 +743,11 @@
     String parseValue() {
       int start = index;
       while (!done()) {
-        if (s[index] == " " ||
-            s[index] == "\t" ||
-            s[index] == valueSeparator ||
-            s[index] == parameterSeparator) break;
+        var char = s[index];
+        if (char == " " ||
+            char == "\t" ||
+            char == valueSeparator ||
+            char == parameterSeparator) break;
         index++;
       }
       return s.substring(start, index);
@@ -753,17 +769,17 @@
     }
 
     void parseParameters() {
-      var parameters = new HashMap<String, String>();
-      _parameters = new UnmodifiableMapView(parameters);
+      var parameters = _ensureParameters();
 
       String parseParameterName() {
         int start = index;
         while (!done()) {
-          if (s[index] == " " ||
-              s[index] == "\t" ||
-              s[index] == "=" ||
-              s[index] == parameterSeparator ||
-              s[index] == valueSeparator) break;
+          var char = s[index];
+          if (char == " " ||
+              char == "\t" ||
+              char == "=" ||
+              char == parameterSeparator ||
+              char == valueSeparator) break;
           index++;
         }
         return s.substring(start, index).toLowerCase();
@@ -775,19 +791,21 @@
           StringBuffer sb = new StringBuffer();
           index++;
           while (!done()) {
-            if (s[index] == "\\") {
+            var char = s[index];
+            if (char == "\\") {
               if (index + 1 == s.length) {
                 throw new HttpException("Failed to parse header value");
               }
               if (preserveBackslash && s[index + 1] != "\"") {
-                sb.write(s[index]);
+                sb.write(char);
               }
               index++;
-            } else if (s[index] == "\"") {
+            } else if (char == "\"") {
               index++;
               return sb.toString();
             }
-            sb.write(s[index]);
+            char = s[index];
+            sb.write(char);
             index++;
           }
           throw new HttpException("Failed to parse header value");
@@ -835,27 +853,30 @@
   String _primaryType = "";
   String _subType = "";
 
-  _ContentType(String primaryType, String subType, String charset,
-      Map<String, String> parameters)
+  _ContentType(String primaryType, String subType, String? charset,
+      Map<String, String?> parameters)
       : _primaryType = primaryType,
         _subType = subType,
         super("") {
-    if (_primaryType == null) _primaryType = "";
-    if (_subType == null) _subType = "";
+    // TODO(40614): Remove once non-nullability is sound.
+    String emptyIfNull(String? string) => string ?? "";
+    _primaryType = emptyIfNull(_primaryType);
+    _subType = emptyIfNull(_subType);
     _value = "$_primaryType/$_subType";
-    if (parameters != null) {
-      _ensureParameters();
-      parameters.forEach((String key, String value) {
+    // TODO(40614): Remove once non-nullability is sound.
+    Map<String, String?>? nullableParameters = parameters;
+    if (nullableParameters != null) {
+      var parameterMap = _ensureParameters();
+      nullableParameters.forEach((String key, String? value) {
         String lowerCaseKey = key.toLowerCase();
         if (lowerCaseKey == "charset") {
           value = value?.toLowerCase();
         }
-        this._parameters[lowerCaseKey] = value;
+        parameterMap[lowerCaseKey] = value;
       });
     }
     if (charset != null) {
-      _ensureParameters();
-      this._parameters["charset"] = charset.toLowerCase();
+      _ensureParameters()["charset"] = charset.toLowerCase();
     }
   }
 
@@ -867,7 +888,6 @@
     int index = result._value.indexOf("/");
     if (index == -1 || index == (result._value.length - 1)) {
       result._primaryType = result._value.trim().toLowerCase();
-      result._subType = "";
     } else {
       result._primaryType =
           result._value.substring(0, index).trim().toLowerCase();
@@ -882,16 +902,16 @@
 
   String get subType => _subType;
 
-  String get charset => parameters["charset"];
+  String? get charset => parameters["charset"];
 }
 
 class _Cookie implements Cookie {
   String _name;
   String _value;
-  DateTime expires;
-  int maxAge;
-  String domain;
-  String path;
+  DateTime? expires;
+  int? maxAge;
+  String? domain;
+  String? path;
   bool httpOnly = false;
   bool secure = false;
 
@@ -913,7 +933,9 @@
     _value = newValue;
   }
 
-  _Cookie.fromSetCookieValue(String value) {
+  _Cookie.fromSetCookieValue(String value)
+      : _name = "",
+        _value = "" {
     // Parse the 'set-cookie' header value.
     _parseSetCookieValue(value);
   }
@@ -999,6 +1021,7 @@
   String toString() {
     StringBuffer sb = new StringBuffer();
     sb..write(_name)..write("=")..write(_value);
+    var expires = this.expires;
     if (expires != null) {
       sb..write("; Expires=")..write(HttpDate.format(expires));
     }
@@ -1038,7 +1061,7 @@
     ];
     if (newName == null) throw new ArgumentError.notNull("name");
     for (int i = 0; i < newName.length; i++) {
-      int codeUnit = newName.codeUnits[i];
+      int codeUnit = newName.codeUnitAt(i);
       if (codeUnit <= 32 ||
           codeUnit >= 127 ||
           separators.indexOf(newName[i]) >= 0) {
diff --git a/sdk/lib/_http/http_impl.dart b/sdk/lib/_http/http_impl.dart
index c07240b..766b567 100644
--- a/sdk/lib/_http/http_impl.dart
+++ b/sdk/lib/_http/http_impl.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.6
-
 part of dart._http;
 
 int _nextServiceId = 1;
@@ -140,12 +138,12 @@
   bool upgraded = false;
 
   // ClientResponse properties.
-  int statusCode;
-  String reasonPhrase;
+  int? statusCode;
+  String? reasonPhrase;
 
   // Request properties.
-  String method;
-  Uri uri;
+  String? method;
+  Uri? uri;
 
   bool hasSubscriber = false;
 
@@ -157,8 +155,8 @@
 
   _HttpIncoming(this.headers, this._transferLength, this._stream);
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     hasSubscriber = true;
     return _stream.handleError((error) {
       throw new HttpException(error.message, uri: uri);
@@ -178,14 +176,11 @@
 
 abstract class _HttpInboundMessageListInt extends Stream<List<int>> {
   final _HttpIncoming _incoming;
-  List<Cookie> _cookies;
+  List<Cookie>? _cookies;
 
   _HttpInboundMessageListInt(this._incoming);
 
-  List<Cookie> get cookies {
-    if (_cookies != null) return _cookies;
-    return _cookies = headers._parseCookies();
-  }
+  List<Cookie> get cookies => _cookies ??= headers._parseCookies();
 
   _HttpHeaders get headers => _incoming.headers;
   String get protocolVersion => headers.protocolVersion;
@@ -195,14 +190,11 @@
 
 abstract class _HttpInboundMessage extends Stream<Uint8List> {
   final _HttpIncoming _incoming;
-  List<Cookie> _cookies;
+  List<Cookie>? _cookies;
 
   _HttpInboundMessage(this._incoming);
 
-  List<Cookie> get cookies {
-    if (_cookies != null) return _cookies;
-    return _cookies = headers._parseCookies();
-  }
+  List<Cookie> get cookies => _cookies ??= headers._parseCookies();
 
   _HttpHeaders get headers => _incoming.headers;
   String get protocolVersion => headers.protocolVersion;
@@ -217,9 +209,9 @@
 
   final _HttpConnection _httpConnection;
 
-  _HttpSession _session;
+  _HttpSession? _session;
 
-  Uri _requestedUri;
+  Uri? _requestedUri;
 
   _HttpRequest(this.response, _HttpIncoming _incoming, this._httpServer,
       this._httpConnection)
@@ -234,68 +226,62 @@
       // Map to session if exists.
       var sessionIds = cookies
           .where((cookie) => cookie.name.toUpperCase() == _DART_SESSION_ID)
-          .map((cookie) => cookie.value);
+          .map<String>((cookie) => cookie.value);
       for (var sessionId in sessionIds) {
-        _session = _httpServer._sessionManager.getSession(sessionId);
-        if (_session != null) {
-          _session._markSeen();
+        var session = _httpServer._sessionManager.getSession(sessionId);
+        _session = session;
+        if (session != null) {
+          session._markSeen();
           break;
         }
       }
     }
   }
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _incoming.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
-  Uri get uri => _incoming.uri;
+  Uri get uri => _incoming.uri!;
 
   Uri get requestedUri {
-    if (_requestedUri == null) {
-      var proto = headers['x-forwarded-proto'];
-      var scheme = proto != null
-          ? proto.first
-          : _httpConnection._socket is SecureSocket ? "https" : "http";
-      var hostList = headers['x-forwarded-host'];
-      String host;
+    var requestedUri = _requestedUri;
+    if (requestedUri != null) return requestedUri;
+    var proto = headers['x-forwarded-proto'];
+    var scheme = proto != null
+        ? proto.first
+        : _httpConnection._socket is SecureSocket ? "https" : "http";
+    var hostList = headers['x-forwarded-host'];
+    String host;
+    if (hostList != null) {
+      host = hostList.first;
+    } else {
+      hostList = headers[HttpHeaders.hostHeader];
       if (hostList != null) {
         host = hostList.first;
       } else {
-        hostList = headers[HttpHeaders.hostHeader];
-        if (hostList != null) {
-          host = hostList.first;
-        } else {
-          host = "${_httpServer.address.host}:${_httpServer.port}";
-        }
+        host = "${_httpServer.address.host}:${_httpServer.port}";
       }
-      _requestedUri = Uri.parse("$scheme://$host$uri");
     }
-    return _requestedUri;
+    return _requestedUri = Uri.parse("$scheme://$host$uri");
   }
 
-  String get method => _incoming.method;
+  String get method => _incoming.method!;
 
   HttpSession get session {
-    if (_session != null) {
-      if (_session._destroyed) {
-        // It's destroyed, clear it.
-        _session = null;
-        // Create new session object by calling recursive.
-        return session;
-      }
-      // It's already mapped, use it.
-      return _session;
+    var session = _session;
+    if (session != null && !session._destroyed) {
+      return session;
     }
     // Create session, store it in connection, and return.
     return _session = _httpServer._sessionManager.createSession();
   }
 
-  HttpConnectionInfo get connectionInfo => _httpConnection.connectionInfo;
+  HttpConnectionInfo? get connectionInfo => _httpConnection.connectionInfo;
 
-  X509Certificate get certificate {
+  X509Certificate? get certificate {
     var socket = _httpConnection._socket;
     if (socket is SecureSocket) return socket.peerCertificate;
     return null;
@@ -334,25 +320,27 @@
     }
   }
 
-  int get statusCode => _incoming.statusCode;
-  String get reasonPhrase => _incoming.reasonPhrase;
+  int get statusCode => _incoming.statusCode!;
+  String get reasonPhrase => _incoming.reasonPhrase!;
 
-  X509Certificate get certificate {
+  X509Certificate? get certificate {
     var socket = _httpRequest._httpClientConnection._socket;
     if (socket is SecureSocket) return socket.peerCertificate;
     return null;
   }
 
   List<Cookie> get cookies {
-    if (_cookies != null) return _cookies;
-    _cookies = new List<Cookie>();
-    List<String> values = headers[HttpHeaders.setCookieHeader];
+    var cookies = _cookies;
+    if (cookies != null) return cookies;
+    cookies = <Cookie>[];
+    List<String>? values = headers[HttpHeaders.setCookieHeader];
     if (values != null) {
-      values.forEach((value) {
-        _cookies.add(new Cookie.fromSetCookieValue(value));
-      });
+      for (var value in values) {
+        cookies.add(new Cookie.fromSetCookieValue(value));
+      }
     }
-    return _cookies;
+    _cookies = cookies;
+    return cookies;
   }
 
   bool get isRedirect {
@@ -368,7 +356,7 @@
   }
 
   Future<HttpClientResponse> redirect(
-      [String method, Uri url, bool followLoops]) {
+      [String? method, Uri? url, bool? followLoops]) {
     if (method == null) {
       // Set method as defined by RFC 2616 section 10.3.4.
       if (statusCode == HttpStatus.seeOther && _httpRequest.method == "POST") {
@@ -378,7 +366,7 @@
       }
     }
     if (url == null) {
-      String location = headers.value(HttpHeaders.locationHeader);
+      String? location = headers.value(HttpHeaders.locationHeader);
       if (location == null) {
         throw new StateError("Response has no Location header for redirect");
       }
@@ -397,13 +385,13 @@
         .then((request) {
       request._responseRedirects
         ..addAll(this.redirects)
-        ..add(new _RedirectInfo(statusCode, method, url));
+        ..add(new _RedirectInfo(statusCode, method!, url!));
       return request.close();
     });
   }
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     if (_incoming.upgraded) {
       // If upgraded, the connection is already 'removed' form the client.
       // Since listening to upgraded data is 'bogus', simply close and
@@ -427,11 +415,11 @@
     return _httpRequest._httpClientConnection.detachSocket();
   }
 
-  HttpConnectionInfo get connectionInfo => _httpRequest.connectionInfo;
+  HttpConnectionInfo? get connectionInfo => _httpRequest.connectionInfo;
 
   bool get _shouldAuthenticateProxy {
     // Only try to authenticate if there is a challenge in the response.
-    List<String> challenge = headers[HttpHeaders.proxyAuthenticateHeader];
+    List<String>? challenge = headers[HttpHeaders.proxyAuthenticateHeader];
     return statusCode == HttpStatus.proxyAuthenticationRequired &&
         challenge != null &&
         challenge.length == 1;
@@ -439,7 +427,7 @@
 
   bool get _shouldAuthenticate {
     // Only try to authenticate if there is a challenge in the response.
-    List<String> challenge = headers[HttpHeaders.wwwAuthenticateHeader];
+    List<String>? challenge = headers[HttpHeaders.wwwAuthenticateHeader];
     return statusCode == HttpStatus.unauthorized &&
         challenge != null &&
         challenge.length == 1;
@@ -458,13 +446,13 @@
       });
     }
 
-    List<String> authChallenge() {
+    List<String>? authChallenge() {
       return proxyAuth
           ? headers[HttpHeaders.proxyAuthenticateHeader]
           : headers[HttpHeaders.wwwAuthenticateHeader];
     }
 
-    _Credentials findCredentials(_AuthenticationScheme scheme) {
+    _Credentials? findCredentials(_AuthenticationScheme scheme) {
       return proxyAuth
           ? _httpClient._findProxyCredentials(_httpRequest._proxy, scheme)
           : _httpClient._findCredentials(_httpRequest.uri, scheme);
@@ -478,64 +466,70 @@
       }
     }
 
-    Future requestAuthentication(_AuthenticationScheme scheme, String realm) {
+    Future<bool> requestAuthentication(
+        _AuthenticationScheme scheme, String? realm) {
       if (proxyAuth) {
-        if (_httpClient._authenticateProxy == null) {
+        var authenticateProxy = _httpClient._authenticateProxy;
+        if (authenticateProxy == null) {
           return new Future.value(false);
         }
         var proxy = _httpRequest._proxy;
-        return _httpClient._authenticateProxy(
+        return authenticateProxy(
             proxy.host, proxy.port, scheme.toString(), realm);
       } else {
-        if (_httpClient._authenticate == null) {
+        var authenticate = _httpClient._authenticate;
+        if (authenticate == null) {
           return new Future.value(false);
         }
-        return _httpClient._authenticate(
-            _httpRequest.uri, scheme.toString(), realm);
+        return authenticate(_httpRequest.uri, scheme.toString(), realm);
       }
     }
 
-    List<String> challenge = authChallenge();
-    assert(challenge != null || challenge.length == 1);
+    List<String> challenge = authChallenge()!;
+    assert(challenge.length == 1);
     _HeaderValue header =
         _HeaderValue.parse(challenge[0], parameterSeparator: ",");
     _AuthenticationScheme scheme =
         new _AuthenticationScheme.fromString(header.value);
-    String realm = header.parameters["realm"];
+    String? realm = header.parameters["realm"];
 
     // See if any matching credentials are available.
-    _Credentials cr = findCredentials(scheme);
+    var cr = findCredentials(scheme);
     if (cr != null) {
       // For basic authentication don't retry already used credentials
       // as they must have already been added to the request causing
       // this authenticate response.
       if (cr.scheme == _AuthenticationScheme.BASIC && !cr.used) {
-        // Credentials where found, prepare for retrying the request.
+        // Credentials were found, prepare for retrying the request.
         return retry();
       }
 
       // Digest authentication only supports the MD5 algorithm.
-      if (cr.scheme == _AuthenticationScheme.DIGEST &&
-          (header.parameters["algorithm"] == null ||
-              header.parameters["algorithm"].toLowerCase() == "md5")) {
-        if (cr.nonce == null || cr.nonce == header.parameters["nonce"]) {
-          // If the nonce is not set then this is the first authenticate
-          // response for these credentials. Set up authentication state.
-          if (cr.nonce == null) {
-            cr
-              ..nonce = header.parameters["nonce"]
-              ..algorithm = "MD5"
-              ..qop = header.parameters["qop"]
-              ..nonceCount = 0;
+      if (cr.scheme == _AuthenticationScheme.DIGEST) {
+        var algorithm = header.parameters["algorithm"];
+        if (algorithm == null || algorithm.toLowerCase() == "md5") {
+          var nonce = cr.nonce;
+          if (nonce == null || nonce == header.parameters["nonce"]) {
+            // If the nonce is not set then this is the first authenticate
+            // response for these credentials. Set up authentication state.
+            if (nonce == null) {
+              cr
+                ..nonce = header.parameters["nonce"]
+                ..algorithm = "MD5"
+                ..qop = header.parameters["qop"]
+                ..nonceCount = 0;
+            }
+            // Credentials were found, prepare for retrying the request.
+            return retry();
+          } else {
+            var staleHeader = header.parameters["stale"];
+            if (staleHeader != null && staleHeader.toLowerCase() == "true") {
+              // If stale is true retry with new nonce.
+              cr.nonce = header.parameters["nonce"];
+              // Credentials were found, prepare for retrying the request.
+              return retry();
+            }
           }
-          // Credentials where found, prepare for retrying the request.
-          return retry();
-        } else if (header.parameters["stale"] != null &&
-            header.parameters["stale"].toLowerCase() == "true") {
-          // If stale is true retry with new nonce.
-          cr.nonce = header.parameters["nonce"];
-          // Credentials where found, prepare for retrying the request.
-          return retry();
         }
       }
     }
@@ -585,9 +579,9 @@
 
 class _StreamSinkImpl<T> implements StreamSink<T> {
   final StreamConsumer<T> _target;
-  final Completer _doneCompleter = new Completer();
-  StreamController<T> _controllerInstance;
-  Completer _controllerCompleter;
+  final _doneCompleter = new Completer<void>();
+  StreamController<T>? _controllerInstance;
+  Completer? _controllerCompleter;
   bool _isClosed = false;
   bool _isBound = false;
   bool _hasError = false;
@@ -601,7 +595,7 @@
     _controller.add(data);
   }
 
-  void addError(error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
     if (_isClosed) {
       throw StateError("StreamSink is closed");
     }
@@ -621,9 +615,10 @@
       });
     }
 
-    if (_controllerInstance == null) return targetAddStream();
-    var future = _controllerCompleter.future;
-    _controllerInstance.close();
+    var controller = _controllerInstance;
+    if (controller == null) return targetAddStream();
+    var future = _controllerCompleter!.future;
+    controller.close();
     return future.then((_) => targetAddStream());
   }
 
@@ -631,12 +626,13 @@
     if (_isBound) {
       throw new StateError("StreamSink is bound to a stream");
     }
-    if (_controllerInstance == null) return new Future.value(this);
+    var controller = _controllerInstance;
+    if (controller == null) return new Future.value(this);
     // Adding an empty stream-controller will return a future that will complete
     // when all data is done.
     _isBound = true;
-    var future = _controllerCompleter.future;
-    _controllerInstance.close();
+    var future = _controllerCompleter!.future;
+    controller.close();
     return future.whenComplete(() {
       _isBound = false;
     });
@@ -648,8 +644,9 @@
     }
     if (!_isClosed) {
       _isClosed = true;
-      if (_controllerInstance != null) {
-        _controllerInstance.close();
+      var controller = _controllerInstance;
+      if (controller != null) {
+        controller.close();
       } else {
         _closeTarget();
       }
@@ -669,7 +666,7 @@
     }
   }
 
-  void _completeDoneError(error, StackTrace stackTrace) {
+  void _completeDoneError(Object error, StackTrace stackTrace) {
     if (!_doneCompleter.isCompleted) {
       _hasError = true;
       _doneCompleter.completeError(error, stackTrace);
@@ -689,17 +686,17 @@
       _target.addStream(_controller.stream).then((_) {
         if (_isBound) {
           // A new stream takes over - forward values to that stream.
-          _controllerCompleter.complete(this);
+          _controllerCompleter!.complete(this);
           _controllerCompleter = null;
           _controllerInstance = null;
         } else {
           // No new stream, .close was called. Close _target.
           _closeTarget();
         }
-      }, onError: (error, stackTrace) {
+      }, onError: (Object error, StackTrace stackTrace) {
         if (_isBound) {
           // A new stream takes over - forward errors to that stream.
-          _controllerCompleter.completeError(error, stackTrace);
+          _controllerCompleter!.completeError(error, stackTrace);
           _controllerCompleter = null;
           _controllerInstance = null;
         } else {
@@ -709,7 +706,7 @@
         }
       });
     }
-    return _controllerInstance;
+    return _controllerInstance!;
   }
 }
 
@@ -728,7 +725,7 @@
     _encoding = value;
   }
 
-  void write(Object obj) {
+  void write(Object? obj) {
     String string = '$obj';
     if (string.isEmpty) return;
     add(_encoding.encode(string));
@@ -750,7 +747,7 @@
     }
   }
 
-  void writeln([Object object = ""]) {
+  void writeln([Object? object = ""]) {
     write(object);
     write("\n");
   }
@@ -773,7 +770,7 @@
   final _HttpHeaders headers;
 
   _HttpOutboundMessage(Uri uri, String protocolVersion, _HttpOutgoing outgoing,
-      {_HttpHeaders initialHeaders})
+      {_HttpHeaders? initialHeaders})
       : _uri = uri,
         headers = new _HttpHeaders(protocolVersion,
             defaultPortForScheme: uri.scheme == 'https'
@@ -781,7 +778,7 @@
                 : HttpClient.defaultHttpPort,
             initialHeaders: initialHeaders),
         _outgoing = outgoing,
-        super(outgoing, null) {
+        super(outgoing, latin1) {
     _outgoing.outbound = this;
     _encodingMutable = false;
   }
@@ -806,13 +803,14 @@
     if (_encodingSet && _outgoing.headersWritten) {
       return _encoding;
     }
-    var charset;
-    if (headers.contentType != null && headers.contentType.charset != null) {
-      charset = headers.contentType.charset;
+    String charset;
+    var contentType = headers.contentType;
+    if (contentType != null && contentType.charset != null) {
+      charset = contentType.charset!;
     } else {
       charset = "iso-8859-1";
     }
-    return Encoding.getByName(charset);
+    return Encoding.getByName(charset) ?? latin1;
   }
 
   void add(List<int> data) {
@@ -820,7 +818,7 @@
     super.add(data);
   }
 
-  void write(Object obj) {
+  void write(Object? obj) {
     if (!_encodingSet) {
       _encoding = encoding;
       _encodingSet = true;
@@ -836,26 +834,24 @@
 class _HttpResponse extends _HttpOutboundMessage<HttpResponse>
     implements HttpResponse {
   int _statusCode = 200;
-  String _reasonPhrase;
-  List<Cookie> _cookies;
-  _HttpRequest _httpRequest;
-  Duration _deadline;
-  Timer _deadlineTimer;
+  String? _reasonPhrase;
+  List<Cookie>? _cookies;
+  _HttpRequest? _httpRequest;
+  Duration? _deadline;
+  Timer? _deadlineTimer;
 
   _HttpResponse(Uri uri, String protocolVersion, _HttpOutgoing outgoing,
-      HttpHeaders defaultHeaders, String serverHeader)
-      : super(uri, protocolVersion, outgoing, initialHeaders: defaultHeaders) {
+      HttpHeaders defaultHeaders, String? serverHeader)
+      : super(uri, protocolVersion, outgoing,
+            initialHeaders: defaultHeaders as _HttpHeaders) {
     if (serverHeader != null) {
       headers.set(HttpHeaders.serverHeader, serverHeader);
     }
   }
 
-  bool get _isConnectionClosed => _httpRequest._httpConnection._isClosing;
+  bool get _isConnectionClosed => _httpRequest!._httpConnection._isClosing;
 
-  List<Cookie> get cookies {
-    if (_cookies == null) _cookies = new List<Cookie>();
-    return _cookies;
-  }
+  List<Cookie> get cookies => _cookies ??= <Cookie>[];
 
   int get statusCode => _statusCode;
   void set statusCode(int statusCode) {
@@ -869,17 +865,17 @@
     _reasonPhrase = reasonPhrase;
   }
 
-  Future redirect(Uri location, {int status: HttpStatus.movedTemporarily}) {
+  Future redirect(Uri location, {int status = HttpStatus.movedTemporarily}) {
     if (_outgoing.headersWritten) throw new StateError("Header already sent");
     statusCode = status;
     headers.set(HttpHeaders.locationHeader, location.toString());
     return close();
   }
 
-  Future<Socket> detachSocket({bool writeHeaders: true}) {
+  Future<Socket> detachSocket({bool writeHeaders = true}) {
     if (_outgoing.headersWritten) throw new StateError("Headers already sent");
     deadline = null; // Be sure to stop any deadline.
-    var future = _httpRequest._httpConnection.detachSocket();
+    var future = _httpRequest!._httpConnection.detachSocket();
     if (writeHeaders) {
       var headersFuture =
           _outgoing.writeHeaders(drainRequest: false, setOutgoing: false);
@@ -897,17 +893,17 @@
     return future;
   }
 
-  HttpConnectionInfo get connectionInfo => _httpRequest.connectionInfo;
+  HttpConnectionInfo? get connectionInfo => _httpRequest!.connectionInfo;
 
-  Duration get deadline => _deadline;
+  Duration? get deadline => _deadline;
 
-  void set deadline(Duration d) {
-    if (_deadlineTimer != null) _deadlineTimer.cancel();
+  void set deadline(Duration? d) {
+    _deadlineTimer?.cancel();
     _deadline = d;
 
-    if (_deadline == null) return;
-    _deadlineTimer = new Timer(_deadline, () {
-      _httpRequest._httpConnection.destroy();
+    if (d == null) return;
+    _deadlineTimer = new Timer(d, () {
+      _httpRequest!._httpConnection.destroy();
     });
   }
 
@@ -927,7 +923,7 @@
     buffer.addByte(_CharCode.CR);
     buffer.addByte(_CharCode.LF);
 
-    var session = _httpRequest._session;
+    var session = _httpRequest!._session;
     if (session != null && !session._destroyed) {
       // Mark as not new.
       session._isNew = false;
@@ -950,11 +946,9 @@
       }
     }
     // Add all the cookies set to the headers.
-    if (_cookies != null) {
-      _cookies.forEach((cookie) {
-        headers.add(HttpHeaders.setCookieHeader, cookie);
-      });
-    }
+    _cookies?.forEach((cookie) {
+      headers.add(HttpHeaders.setCookieHeader, cookie);
+    });
 
     headers._finalize();
 
@@ -967,8 +961,9 @@
   }
 
   String _findReasonPhrase(int statusCode) {
-    if (_reasonPhrase != null) {
-      return _reasonPhrase;
+    var reasonPhrase = _reasonPhrase;
+    if (reasonPhrase != null) {
+      return reasonPhrase;
     }
 
     switch (statusCode) {
@@ -1062,19 +1057,19 @@
     implements HttpClientRequest {
   final String method;
   final Uri uri;
-  final List<Cookie> cookies = new List<Cookie>();
+  final List<Cookie> cookies = [];
 
   // The HttpClient this request belongs to.
   final _HttpClient _httpClient;
   final _HttpClientConnection _httpClientConnection;
-  final TimelineTask _timeline;
+  final TimelineTask? _timeline;
 
   final Completer<HttpClientResponse> _responseCompleter =
       new Completer<HttpClientResponse>();
 
   final _Proxy _proxy;
 
-  Future<HttpClientResponse> _response;
+  Future<HttpClientResponse>? _response;
 
   // TODO(ajohnsen): Get default value from client?
   bool _followRedirects = true;
@@ -1099,7 +1094,7 @@
       _timeline?.instant('Response receieved');
       Map formatConnectionInfo() => {
             'localPort': response.connectionInfo?.localPort,
-            'remoteAddress': response.connectionInfo?.remoteAddress?.address,
+            'remoteAddress': response.connectionInfo?.remoteAddress.address,
             'remotePort': response.connectionInfo?.remotePort,
           };
 
@@ -1126,7 +1121,7 @@
       _timeline?.finish(arguments: {
         // TODO(bkonyi): consider exposing certificate information?
         // 'certificate': response.certificate,
-        'requestHeaders': outgoing.outbound.headers._headers,
+        'requestHeaders': outgoing.outbound!.headers._headers,
         'compressionState': response.compressionState.toString(),
         'connectionInfo': formatConnectionInfo(),
         'contentLength': response.contentLength,
@@ -1141,14 +1136,9 @@
     }, onError: (e) {});
   }
 
-  Future<HttpClientResponse> get done {
-    if (_response == null) {
-      _response =
-          Future.wait([_responseCompleter.future, super.done], eagerError: true)
-              .then((list) => list[0]);
-    }
-    return _response;
-  }
+  Future<HttpClientResponse> get done => _response ??=
+      Future.wait([_responseCompleter.future, super.done], eagerError: true)
+          .then((list) => list[0]);
 
   Future<HttpClientResponse> close() {
     super.close();
@@ -1167,7 +1157,8 @@
     _followRedirects = followRedirects;
   }
 
-  HttpConnectionInfo get connectionInfo => _httpClientConnection.connectionInfo;
+  HttpConnectionInfo? get connectionInfo =>
+      _httpClientConnection.connectionInfo;
 
   void _onIncoming(_HttpIncoming incoming) {
     var response = new _HttpClientResponse(incoming, this, _httpClient);
@@ -1320,67 +1311,68 @@
   bool ignoreBody = false;
   bool headersWritten = false;
 
-  Uint8List _buffer;
+  Uint8List? _buffer;
   int _length = 0;
 
-  Future _closeFuture;
+  Future? _closeFuture;
 
   bool chunked = false;
   int _pendingChunkedFooter = 0;
 
-  int contentLength;
+  int? contentLength;
   int _bytesWritten = 0;
 
   bool _gzip = false;
-  ByteConversionSink _gzipSink;
+  ByteConversionSink? _gzipSink;
   // _gzipAdd is set iff the sink is being added to. It's used to specify where
   // gzipped data should be taken (sometimes a controller, sometimes a socket).
-  _BytesConsumer _gzipAdd;
-  Uint8List _gzipBuffer;
+  _BytesConsumer? _gzipAdd;
+  Uint8List? _gzipBuffer;
   int _gzipBufferLength = 0;
 
   bool _socketError = false;
 
-  _HttpOutboundMessage outbound;
+  _HttpOutboundMessage? outbound;
 
   _HttpOutgoing(this.socket);
 
   // Returns either a future or 'null', if it was able to write headers
   // immediately.
-  Future writeHeaders({bool drainRequest: true, bool setOutgoing: true}) {
+  Future<void>? writeHeaders(
+      {bool drainRequest = true, bool setOutgoing = true}) {
     if (headersWritten) return null;
     headersWritten = true;
-    Future drainFuture;
+    Future<void>? drainFuture;
     bool gzip = false;
-    if (outbound is _HttpResponse) {
+    var response = outbound!;
+    if (response is _HttpResponse) {
       // Server side.
-      _HttpResponse response = outbound;
-      if (response._httpRequest._httpServer.autoCompress &&
-          outbound.bufferOutput &&
-          outbound.headers.chunkedTransferEncoding) {
-        List acceptEncodings =
-            response._httpRequest.headers[HttpHeaders.acceptEncodingHeader];
-        List contentEncoding =
-            outbound.headers[HttpHeaders.contentEncodingHeader];
+      if (response._httpRequest!._httpServer.autoCompress &&
+          response.bufferOutput &&
+          response.headers.chunkedTransferEncoding) {
+        List<String>? acceptEncodings =
+            response._httpRequest!.headers[HttpHeaders.acceptEncodingHeader];
+        List<String>? contentEncoding =
+            response.headers[HttpHeaders.contentEncodingHeader];
         if (acceptEncodings != null &&
+            contentEncoding == null &&
             acceptEncodings
                 .expand((list) => list.split(","))
-                .any((encoding) => encoding.trim().toLowerCase() == "gzip") &&
-            contentEncoding == null) {
-          outbound.headers.set(HttpHeaders.contentEncodingHeader, "gzip");
+                .any((encoding) => encoding.trim().toLowerCase() == "gzip")) {
+          response.headers.set(HttpHeaders.contentEncodingHeader, "gzip");
           gzip = true;
         }
       }
-      if (drainRequest && !response._httpRequest._incoming.hasSubscriber) {
-        drainFuture = response._httpRequest.drain().catchError((_) {});
+      if (drainRequest && !response._httpRequest!._incoming.hasSubscriber) {
+        drainFuture = response._httpRequest!.drain<void>().catchError((_) {});
       }
     } else {
       drainRequest = false;
     }
     if (!ignoreBody) {
       if (setOutgoing) {
-        int contentLength = outbound.headers.contentLength;
-        if (outbound.headers.chunkedTransferEncoding) {
+        int contentLength = response.headers.contentLength;
+        if (response.headers.chunkedTransferEncoding) {
           chunked = true;
           if (gzip) this.gzip = true;
         } else if (contentLength >= 0) {
@@ -1388,10 +1380,10 @@
         }
       }
       if (drainFuture != null) {
-        return drainFuture.then((_) => outbound._writeHeader());
+        return drainFuture.then((_) => response._writeHeader());
       }
     }
-    outbound._writeHeader();
+    response._writeHeader();
     return null;
   }
 
@@ -1408,12 +1400,10 @@
       }
       return close();
     }
-    StreamSubscription<List<int>> sub;
     // Use new stream so we are able to pause (see below listen). The
     // alternative is to use stream.extand, but that won't give us a way of
     // pausing.
-    var controller = new StreamController<List<int>>(
-        onPause: () => sub.pause(), onResume: () => sub.resume(), sync: true);
+    var controller = new StreamController<List<int>>(sync: true);
 
     void onData(List<int> data) {
       if (_socketError) return;
@@ -1421,13 +1411,14 @@
       if (chunked) {
         if (_gzip) {
           _gzipAdd = controller.add;
-          _addGZipChunk(data, _gzipSink.add);
+          _addGZipChunk(data, _gzipSink!.add);
           _gzipAdd = null;
           return;
         }
         _addChunk(_chunkHeader(data.length), controller.add);
         _pendingChunkedFooter = 2;
       } else {
+        var contentLength = this.contentLength;
         if (contentLength != null) {
           _bytesWritten += data.length;
           if (_bytesWritten > contentLength) {
@@ -1443,10 +1434,12 @@
       _addChunk(data, controller.add);
     }
 
-    sub = stream.listen(onData,
+    var sub = stream.listen(onData,
         onError: controller.addError,
         onDone: controller.close,
         cancelOnError: true);
+    controller.onPause = sub.pause;
+    controller.onResume = sub.resume;
     // Write headers now that we are listening to the stream.
     if (!headersWritten) {
       var future = writeHeaders();
@@ -1460,7 +1453,7 @@
       return outbound;
     }, onError: (error, stackTrace) {
       // Be sure to close it in case of an error.
-      if (_gzip) _gzipSink.close();
+      if (_gzip) _gzipSink!.close();
       _socketError = true;
       _doneCompleter.completeError(error, stackTrace);
       if (_ignoreError(error)) {
@@ -1473,7 +1466,10 @@
 
   Future close() {
     // If we are already closed, return that future.
-    if (_closeFuture != null) return _closeFuture;
+    var closeFuture = _closeFuture;
+    if (closeFuture != null) return closeFuture;
+
+    var outbound = this.outbound!;
     // If we earlier saw an error, return immediate. The notification to
     // _Http*Connection is already done.
     if (_socketError) return new Future.value(outbound);
@@ -1495,6 +1491,7 @@
       }
     }
     // If contentLength was specified, validate it.
+    var contentLength = this.contentLength;
     if (contentLength != null) {
       if (_bytesWritten < contentLength) {
         var error = new HttpException(
@@ -1514,19 +1511,19 @@
         if (_gzip) {
           _gzipAdd = socket.add;
           if (_gzipBufferLength > 0) {
-            _gzipSink.add(new Uint8List.view(_gzipBuffer.buffer,
-                _gzipBuffer.offsetInBytes, _gzipBufferLength));
+            _gzipSink!.add(new Uint8List.view(_gzipBuffer!.buffer,
+                _gzipBuffer!.offsetInBytes, _gzipBufferLength));
           }
           _gzipBuffer = null;
-          _gzipSink.close();
+          _gzipSink!.close();
           _gzipAdd = null;
         }
         _addChunk(_chunkHeader(0), socket.add);
       }
       // Add any remaining data in the buffer.
       if (_length > 0) {
-        socket.add(
-            new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length));
+        socket.add(new Uint8List.view(
+            _buffer!.buffer, _buffer!.offsetInBytes, _length));
       }
       // Clear references, for better GC.
       _buffer = null;
@@ -1557,22 +1554,22 @@
 
   void setHeader(List<int> data, int length) {
     assert(_length == 0);
-    _buffer = data;
+    _buffer = data as Uint8List;
     _length = length;
   }
 
   void set gzip(bool value) {
     _gzip = value;
-    if (_gzip) {
+    if (value) {
       _gzipBuffer = new Uint8List(_OUTGOING_BUFFER_SIZE);
       assert(_gzipSink == null);
       _gzipSink = new ZLibEncoder(gzip: true)
           .startChunkedConversion(new _HttpGZipSink((data) {
         // We are closing down prematurely, due to an error. Discard.
         if (_gzipAdd == null) return;
-        _addChunk(_chunkHeader(data.length), _gzipAdd);
+        _addChunk(_chunkHeader(data.length), _gzipAdd!);
         _pendingChunkedFooter = 2;
-        _addChunk(data, _gzipAdd);
+        _addChunk(data, _gzipAdd!);
       }));
     }
   }
@@ -1582,46 +1579,51 @@
       outbound is HttpResponse;
 
   void _addGZipChunk(List<int> chunk, void add(List<int> data)) {
-    if (!outbound.bufferOutput) {
+    var bufferOutput = outbound!.bufferOutput;
+    if (!bufferOutput) {
       add(chunk);
       return;
     }
-    if (chunk.length > _gzipBuffer.length - _gzipBufferLength) {
+    var gzipBuffer = _gzipBuffer!;
+    if (chunk.length > gzipBuffer.length - _gzipBufferLength) {
       add(new Uint8List.view(
-          _gzipBuffer.buffer, _gzipBuffer.offsetInBytes, _gzipBufferLength));
+          gzipBuffer.buffer, gzipBuffer.offsetInBytes, _gzipBufferLength));
       _gzipBuffer = new Uint8List(_OUTGOING_BUFFER_SIZE);
       _gzipBufferLength = 0;
     }
     if (chunk.length > _OUTGOING_BUFFER_SIZE) {
       add(chunk);
     } else {
-      _gzipBuffer.setRange(
-          _gzipBufferLength, _gzipBufferLength + chunk.length, chunk);
-      _gzipBufferLength += chunk.length;
+      var currentLength = _gzipBufferLength;
+      var newLength = currentLength + chunk.length;
+      _gzipBuffer!.setRange(currentLength, newLength, chunk);
+      _gzipBufferLength = newLength;
     }
   }
 
   void _addChunk(List<int> chunk, void add(List<int> data)) {
-    if (!outbound.bufferOutput) {
+    var bufferOutput = outbound!.bufferOutput;
+    if (!bufferOutput) {
       if (_buffer != null) {
         // If _buffer is not null, we have not written the header yet. Write
         // it now.
-        add(new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length));
+        add(new Uint8List.view(
+            _buffer!.buffer, _buffer!.offsetInBytes, _length));
         _buffer = null;
         _length = 0;
       }
       add(chunk);
       return;
     }
-    if (chunk.length > _buffer.length - _length) {
-      add(new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length));
+    if (chunk.length > _buffer!.length - _length) {
+      add(new Uint8List.view(_buffer!.buffer, _buffer!.offsetInBytes, _length));
       _buffer = new Uint8List(_OUTGOING_BUFFER_SIZE);
       _length = 0;
     }
     if (chunk.length > _OUTGOING_BUFFER_SIZE) {
       add(chunk);
     } else {
-      _buffer.setRange(_length, _length + chunk.length, chunk);
+      _buffer!.setRange(_length, _length + chunk.length, chunk);
       _length += chunk.length;
     }
   }
@@ -1676,17 +1678,17 @@
   final String key;
   final Socket _socket;
   final bool _proxyTunnel;
-  final SecurityContext _context;
+  final SecurityContext? _context;
   final _HttpParser _httpParser;
-  StreamSubscription _subscription;
+  StreamSubscription? _subscription;
   final _HttpClient _httpClient;
   bool _dispose = false;
-  Timer _idleTimer;
+  Timer? _idleTimer;
   bool closed = false;
-  Uri _currentUri;
+  Uri? _currentUri;
 
-  Completer<_HttpIncoming> _nextResponseCompleter;
-  Future<Socket> _streamFuture;
+  Completer<_HttpIncoming>? _nextResponseCompleter;
+  Future<Socket>? _streamFuture;
 
   _HttpClientConnection(this.key, this._socket, this._httpClient,
       [this._proxyTunnel = false, this._context])
@@ -1698,7 +1700,7 @@
     _subscription = _httpParser.listen((incoming) {
       // Only handle one incoming response at the time. Keep the
       // stream paused until the response have been processed.
-      _subscription.pause();
+      _subscription!.pause();
       // We assume the response is not here, until we have send the request.
       if (_nextResponseCompleter == null) {
         throw new HttpException(
@@ -1712,48 +1714,44 @@
       // the '100 Continue' response.
       if (incoming.statusCode == 100) {
         incoming.drain().then((_) {
-          _subscription.resume();
-        }).catchError((error, [StackTrace stackTrace]) {
-          _nextResponseCompleter.completeError(
+          _subscription!.resume();
+        }).catchError((dynamic error, StackTrace stackTrace) {
+          _nextResponseCompleter!.completeError(
               new HttpException(error.message, uri: _currentUri), stackTrace);
           _nextResponseCompleter = null;
         });
       } else {
-        _nextResponseCompleter.complete(incoming);
+        _nextResponseCompleter!.complete(incoming);
         _nextResponseCompleter = null;
       }
-    }, onError: (error, [StackTrace stackTrace]) {
-      if (_nextResponseCompleter != null) {
-        _nextResponseCompleter.completeError(
-            new HttpException(error.message, uri: _currentUri), stackTrace);
-        _nextResponseCompleter = null;
-      }
+    }, onError: (dynamic error, StackTrace stackTrace) {
+      _nextResponseCompleter?.completeError(
+          new HttpException(error.message, uri: _currentUri), stackTrace);
+      _nextResponseCompleter = null;
     }, onDone: () {
-      if (_nextResponseCompleter != null) {
-        _nextResponseCompleter.completeError(new HttpException(
-            "Connection closed before response was received",
-            uri: _currentUri));
-        _nextResponseCompleter = null;
-      }
+      _nextResponseCompleter?.completeError(new HttpException(
+          "Connection closed before response was received",
+          uri: _currentUri));
+      _nextResponseCompleter = null;
       close();
     });
   }
 
   _HttpClientRequest send(
-      Uri uri, int port, String method, _Proxy proxy, TimelineTask timeline) {
+      Uri uri, int port, String method, _Proxy proxy, TimelineTask? timeline) {
     if (closed) {
       throw new HttpException("Socket closed before request was sent",
           uri: uri);
     }
     _currentUri = uri;
     // Start with pausing the parser.
-    _subscription.pause();
+    _subscription!.pause();
     if (method == "CONNECT") {
       // Parser will ignore Content-Length or Transfer-Encoding header
       _httpParser.connectMethod = true;
     }
-    _ProxyCredentials proxyCreds; // Credentials used to authorize proxy.
-    _SiteCredentials creds; // Credentials used to authorize this request.
+    _ProxyCredentials? proxyCreds; // Credentials used to authorize proxy.
+    _SiteCredentials? creds; // Credentials used to authorize this request.
     var outgoing = new _HttpOutgoing(_socket);
     // Create new request object, wrapping the outgoing connection.
     var request = new _HttpClientRequest(
@@ -1766,7 +1764,7 @@
       ..port = port
       ..add(HttpHeaders.acceptEncodingHeader, "gzip");
     if (_httpClient.userAgent != null) {
-      request.headers.add(HttpHeaders.userAgentHeader, _httpClient.userAgent);
+      request.headers.add(HttpHeaders.userAgentHeader, _httpClient.userAgent!);
     }
     if (proxy.isAuthenticated) {
       // If the proxy configuration contains user information use that
@@ -1798,10 +1796,11 @@
     _httpParser.isHead = method == "HEAD";
     _streamFuture = outgoing.done.then<Socket>((Socket s) {
       // Request sent, set up response completer.
-      _nextResponseCompleter = new Completer<_HttpIncoming>();
+      var nextResponseCompleter = new Completer<_HttpIncoming>();
+      _nextResponseCompleter = nextResponseCompleter;
 
       // Listen for response.
-      _nextResponseCompleter.future.then((incoming) {
+      nextResponseCompleter.future.then((incoming) {
         _currentUri = null;
         incoming.dataDone.then((closing) {
           if (incoming.upgraded) {
@@ -1816,7 +1815,7 @@
               request.persistentConnection) {
             // Return connection, now we are done.
             _httpClient._returnConnection(this);
-            _subscription.resume();
+            _subscription!.resume();
           } else {
             destroy();
           }
@@ -1859,16 +1858,17 @@
       });
 
       // Resume the parser now we have a handler.
-      _subscription.resume();
+      _subscription!.resume();
       return s;
-    }, onError: (e) {
+    });
+    Future<Socket?>.value(_streamFuture).catchError((e) {
       destroy();
     });
     return request;
   }
 
   Future<Socket> detachSocket() {
-    return _streamFuture.then(
+    return _streamFuture!.then(
         (_) => new _DetachedSocket(_socket, _httpParser.detachIncoming()));
   }
 
@@ -1881,7 +1881,7 @@
   void close() {
     closed = true;
     _httpClient._connectionClosed(this);
-    _streamFuture
+    _streamFuture!
         .timeout(_httpClient.idleTimeout)
         .then((_) => _socket.destroy());
   }
@@ -1891,7 +1891,7 @@
       int port,
       _Proxy proxy,
       bool callback(X509Certificate certificate),
-      TimelineTask timeline) {
+      TimelineTask? timeline) {
     timeline?.instant('Establishing proxy tunnel', arguments: {
       'proxyInfo': {
         if (proxy.host != null) 'host': proxy.host,
@@ -1939,17 +1939,15 @@
     });
   }
 
-  HttpConnectionInfo get connectionInfo => _HttpConnectionInfo.create(_socket);
+  HttpConnectionInfo? get connectionInfo => _HttpConnectionInfo.create(_socket);
 
   static makeKey(bool isSecure, String host, int port) {
     return isSecure ? "ssh:$host:$port" : "$host:$port";
   }
 
   void stopTimer() {
-    if (_idleTimer != null) {
-      _idleTimer.cancel();
-      _idleTimer = null;
-    }
+    _idleTimer?.cancel();
+    _idleTimer = null;
   }
 
   void startTimer() {
@@ -1974,7 +1972,7 @@
   final String host;
   final int port;
   final bool isSecure;
-  final SecurityContext context;
+  final SecurityContext? context;
   final Set<_HttpClientConnection> _idle = new HashSet();
   final Set<_HttpClientConnection> _active = new HashSet();
   final Set<ConnectionTask> _socketTasks = new HashSet();
@@ -2048,14 +2046,15 @@
   }
 
   Future<_ConnectionInfo> connect(String uriHost, int uriPort, _Proxy proxy,
-      _HttpClient client, TimelineTask timeline) {
+      _HttpClient client, TimelineTask? timeline) {
     if (hasIdle) {
       var connection = takeIdle();
       client._connectionsChanged();
       return new Future.value(new _ConnectionInfo(connection, proxy));
     }
-    if (client.maxConnectionsPerHost != null &&
-        _active.length + _connecting >= client.maxConnectionsPerHost) {
+    var maxConnectionsPerHost = client.maxConnectionsPerHost;
+    if (maxConnectionsPerHost != null &&
+        _active.length + _connecting >= maxConnectionsPerHost) {
       var completer = new Completer<_ConnectionInfo>();
       _pending.add(() {
         completer.complete(connect(uriHost, uriPort, proxy, client, timeline));
@@ -2077,11 +2076,10 @@
     return connectionTask.then((ConnectionTask task) {
       _socketTasks.add(task);
       Future socketFuture = task.socket;
-      final Duration connectionTimeout = client.connectionTimeout;
+      final Duration? connectionTimeout = client.connectionTimeout;
       if (connectionTimeout != null) {
         socketFuture = socketFuture.timeout(connectionTimeout, onTimeout: () {
           _socketTasks.remove(task);
-          _connecting--;
           task.cancel();
           return null;
         });
@@ -2092,13 +2090,13 @@
         // is completed with 'null' by the onTimeout callback above. In this
         // case, propagate a SocketException as specified by the
         // HttpClient.connectionTimeout docs.
+        _connecting--;
         if (socket == null) {
           assert(connectionTimeout != null);
           throw new SocketException(
               "HTTP connection timed out after ${connectionTimeout}, "
               "host: ${host}, port: ${port}");
         }
-        _connecting--;
         socket.setOption(SocketOption.tcpNoDelay, true);
         var connection =
             new _HttpClientConnection(key, socket, client, false, context);
@@ -2119,7 +2117,6 @@
           return new _ConnectionInfo(connection, proxy);
         }
       }, onError: (error) {
-        _connecting--;
         _socketTasks.remove(task);
         _checkPending();
         throw error;
@@ -2140,22 +2137,22 @@
       new HashMap<String, _ConnectionTarget>();
   final List<_Credentials> _credentials = [];
   final List<_ProxyCredentials> _proxyCredentials = [];
-  final SecurityContext _context;
-  Function _authenticate;
-  Function _authenticateProxy;
-  Function _findProxy = HttpClient.findProxyFromEnvironment;
+  final SecurityContext? _context;
+  Function? _authenticate;
+  Function? _authenticateProxy;
+  Function? _findProxy = HttpClient.findProxyFromEnvironment;
   Duration _idleTimeout = const Duration(seconds: 15);
-  BadCertificateCallback _badCertificateCallback;
+  BadCertificateCallback? _badCertificateCallback;
 
   Duration get idleTimeout => _idleTimeout;
 
-  Duration connectionTimeout;
+  Duration? connectionTimeout;
 
-  int maxConnectionsPerHost;
+  int? maxConnectionsPerHost;
 
   bool autoUncompress = true;
 
-  String userAgent = _getHttpVersion();
+  String? userAgent = _getHttpVersion();
 
   _HttpClient(this._context);
 
@@ -2171,7 +2168,7 @@
   }
 
   set badCertificateCallback(
-      bool callback(X509Certificate cert, String host, int port)) {
+      bool callback(X509Certificate cert, String host, int port)?) {
     _badCertificateCallback = callback;
   }
 
@@ -2190,7 +2187,7 @@
         queryStart = i;
       }
     }
-    String query = null;
+    String? query;
     if (queryStart < fragmentStart) {
       query = path.substring(queryStart + 1, fragmentStart);
       path = path.substring(0, queryStart);
@@ -2233,7 +2230,7 @@
 
   Future<HttpClientRequest> patchUrl(Uri url) => _openUrl("patch", url);
 
-  void close({bool force: false}) {
+  void close({bool force = false}) {
     _closing = true;
     _closingForcefully = force;
     _closeConnections(_closingForcefully);
@@ -2242,28 +2239,30 @@
         !force || !_connectionTargets.values.any((s) => s._active.isNotEmpty));
   }
 
-  set authenticate(Future<bool> f(Uri url, String scheme, String realm)) {
+  set authenticate(Future<bool> f(Uri url, String scheme, String realm)?) {
     _authenticate = f;
   }
 
   void addCredentials(Uri url, String realm, HttpClientCredentials cr) {
-    _credentials.add(new _SiteCredentials(url, realm, cr));
+    _credentials
+        .add(new _SiteCredentials(url, realm, cr as _HttpClientCredentials));
   }
 
   set authenticateProxy(
-      Future<bool> f(String host, int port, String scheme, String realm)) {
+      Future<bool> f(String host, int port, String scheme, String realm)?) {
     _authenticateProxy = f;
   }
 
   void addProxyCredentials(
       String host, int port, String realm, HttpClientCredentials cr) {
-    _proxyCredentials.add(new _ProxyCredentials(host, port, realm, cr));
+    _proxyCredentials.add(
+        new _ProxyCredentials(host, port, realm, cr as _HttpClientCredentials));
   }
 
-  set findProxy(String f(Uri uri)) => _findProxy = f;
+  set findProxy(String f(Uri uri)?) => _findProxy = f;
 
   static void _startRequestTimelineEvent(
-      TimelineTask timeline, String method, Uri uri) {
+      TimelineTask? timeline, String method, Uri uri) {
     timeline?.start('HTTP CLIENT ${method.toUpperCase()}', arguments: {
       'method': method.toUpperCase(),
       'uri': uri.toString(),
@@ -2277,7 +2276,7 @@
   /// is set to any other non-null value, HTTP is not allowed.
   /// Otherwise, if the `dart.library.io.allow_http` environment flag
   /// is set to `false`, HTTP is not allowed.
-  /// Otherwise, [_embedderAllowsHTTP] determines the result.
+  /// Otherwise, [_embedderAllowsHttp] determines the result.
   bool get _isHttpAllowed {
     final zoneOverride = Zone.current[#dart.library.io.allow_http];
     if (zoneOverride != null) return true == zoneOverride;
@@ -2329,16 +2328,17 @@
     }
     // Check to see if a proxy server should be used for this connection.
     var proxyConf = const _ProxyConfiguration.direct();
-    if (_findProxy != null) {
+    var findProxy = _findProxy;
+    if (findProxy != null) {
       // TODO(sgjesse): Keep a map of these as normally only a few
       // configuration strings will be used.
       try {
-        proxyConf = new _ProxyConfiguration(_findProxy(uri));
+        proxyConf = new _ProxyConfiguration(findProxy(uri));
       } catch (error, stackTrace) {
         return new Future.error(error, stackTrace);
       }
     }
-    TimelineTask timeline;
+    TimelineTask? timeline;
     // TODO(bkonyi): do we want this to be opt-in?
     if (HttpClient.enableTimelineLogging) {
       timeline = TimelineTask(filterKey: 'HTTP/client');
@@ -2381,7 +2381,7 @@
       // Copy headers.
       for (var header in previous.headers._headers.keys) {
         if (request.headers[header] == null) {
-          request.headers.set(header, previous.headers[header]);
+          request.headers.set(header, previous.headers[header]!);
         }
       }
       return request
@@ -2392,7 +2392,7 @@
 
   // Return a live connection to the idle pool.
   void _returnConnection(_HttpClientConnection connection) {
-    _connectionTargets[connection.key].returnConnection(connection);
+    _connectionTargets[connection.key]!.returnConnection(connection);
     _connectionsChanged();
   }
 
@@ -2430,14 +2430,14 @@
 
   // Get a new _HttpClientConnection, from the matching _ConnectionTarget.
   Future<_ConnectionInfo> _getConnection(String uriHost, int uriPort,
-      _ProxyConfiguration proxyConf, bool isSecure, TimelineTask timeline) {
+      _ProxyConfiguration proxyConf, bool isSecure, TimelineTask? timeline) {
     Iterator<_Proxy> proxies = proxyConf.proxies.iterator;
 
     Future<_ConnectionInfo> connect(error) {
       if (!proxies.moveNext()) return new Future.error(error);
       _Proxy proxy = proxies.current;
-      String host = proxy.isDirect ? uriHost : proxy.host;
-      int port = proxy.isDirect ? uriPort : proxy.port;
+      String host = proxy.isDirect ? uriHost : proxy.host!;
+      int port = proxy.isDirect ? uriPort : proxy.port!;
       return _getConnectionTarget(host, port, isSecure)
           .connect(uriHost, uriPort, proxy, this, timeline)
           // On error, continue with next proxy.
@@ -2447,10 +2447,10 @@
     return connect(new HttpException("No proxies given"));
   }
 
-  _SiteCredentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) {
+  _SiteCredentials? _findCredentials(Uri url, [_AuthenticationScheme? scheme]) {
     // Look for credentials.
-    _SiteCredentials cr =
-        _credentials.fold(null, (_SiteCredentials prev, value) {
+    _SiteCredentials? cr =
+        _credentials.fold(null, (_SiteCredentials? prev, value) {
       var siteCredentials = value as _SiteCredentials;
       if (siteCredentials.applies(url, scheme)) {
         if (prev == null) return value;
@@ -2464,13 +2464,12 @@
     return cr;
   }
 
-  _ProxyCredentials _findProxyCredentials(_Proxy proxy,
-      [_AuthenticationScheme scheme]) {
+  _ProxyCredentials? _findProxyCredentials(_Proxy proxy,
+      [_AuthenticationScheme? scheme]) {
     // Look for credentials.
-    var it = _proxyCredentials.iterator;
-    while (it.moveNext()) {
-      if (it.current.applies(proxy, scheme)) {
-        return it.current;
+    for (var current in _proxyCredentials) {
+      if (current.applies(proxy, scheme)) {
+        return current;
       }
     }
     return null;
@@ -2484,15 +2483,12 @@
   }
 
   void _removeProxyCredentials(_Credentials cr) {
-    int index = _proxyCredentials.indexOf(cr);
-    if (index != -1) {
-      _proxyCredentials.removeAt(index);
-    }
+    _proxyCredentials.remove(cr);
   }
 
   static String _findProxyFromEnvironment(
-      Uri url, Map<String, String> environment) {
-    checkNoProxy(String option) {
+      Uri url, Map<String, String>? environment) {
+    String? checkNoProxy(String? option) {
       if (option == null) return null;
       Iterator<String> names = option.split(",").map((s) => s.trim()).iterator;
       while (names.moveNext()) {
@@ -2507,7 +2503,7 @@
       return null;
     }
 
-    checkProxy(String option) {
+    String? checkProxy(String? option) {
       if (option == null) return null;
       option = option.trim();
       if (option.isEmpty) return null;
@@ -2532,24 +2528,24 @@
     // Default to using the process current environment.
     if (environment == null) environment = _platformEnvironmentCache;
 
-    String proxyCfg;
+    String? proxyCfg;
 
-    String noProxy = environment["no_proxy"];
-    if (noProxy == null) noProxy = environment["NO_PROXY"];
-    if ((proxyCfg = checkNoProxy(noProxy)) != null) {
+    String? noProxy = environment["no_proxy"] ?? environment["NO_PROXY"];
+    proxyCfg = checkNoProxy(noProxy);
+    if (proxyCfg != null) {
       return proxyCfg;
     }
 
     if (url.scheme == "http") {
-      String proxy = environment["http_proxy"];
-      if (proxy == null) proxy = environment["HTTP_PROXY"];
-      if ((proxyCfg = checkProxy(proxy)) != null) {
+      String? proxy = environment["http_proxy"] ?? environment["HTTP_PROXY"];
+      proxyCfg = checkProxy(proxy);
+      if (proxyCfg != null) {
         return proxyCfg;
       }
     } else if (url.scheme == "https") {
-      String proxy = environment["https_proxy"];
-      if (proxy == null) proxy = environment["HTTPS_PROXY"];
-      if ((proxyCfg = checkProxy(proxy)) != null) {
+      String? proxy = environment["https_proxy"] ?? environment["HTTPS_PROXY"];
+      proxyCfg = checkProxy(proxy);
+      if (proxyCfg != null) {
         return proxyCfg;
       }
     }
@@ -2574,9 +2570,9 @@
   final _HttpServer _httpServer;
   final _HttpParser _httpParser;
   int _state = _IDLE;
-  StreamSubscription _subscription;
+  StreamSubscription? _subscription;
   bool _idleMark = false;
-  Future _streamFuture;
+  Future? _streamFuture;
 
   _HttpConnection(this._socket, this._httpServer)
       : _httpParser = new _HttpParser.requestParser() {
@@ -2590,11 +2586,11 @@
       });
       // Only handle one incoming request at the time. Keep the
       // stream paused until the request has been send.
-      _subscription.pause();
+      _subscription!.pause();
       _state = _ACTIVE;
       var outgoing = new _HttpOutgoing(_socket);
       var response = new _HttpResponse(
-          incoming.uri,
+          incoming.uri!,
           incoming.headers.protocolVersion,
           outgoing,
           _httpServer.defaultResponseHeaders,
@@ -2617,7 +2613,7 @@
           _httpServer._markIdle(this);
           // Resume the subscription for incoming requests as the
           // request is now processed.
-          _subscription.resume();
+          _subscription!.resume();
         } else {
           // Close socket, keep-alive not used or body sent before
           // received data was handled.
@@ -2658,17 +2654,18 @@
 
     _HttpDetachedIncoming detachedIncoming = _httpParser.detachIncoming();
 
-    return _streamFuture.then((_) {
+    return _streamFuture!.then((_) {
       _connections.remove(_serviceId);
       return new _DetachedSocket(_socket, detachedIncoming);
     });
   }
 
-  HttpConnectionInfo get connectionInfo => _HttpConnectionInfo.create(_socket);
+  HttpConnectionInfo? get connectionInfo => _HttpConnectionInfo.create(_socket);
 
   bool get _isActive => _state == _ACTIVE;
   bool get _isIdle => _state == _IDLE;
   bool get _isClosing => _state == _CLOSING;
+  bool get _isDetached => _state == _DETACHED;
 
   String get _serviceTypePath => 'io/http/serverconnections';
   String get _serviceTypeName => 'HttpServerConnection';
@@ -2724,12 +2721,12 @@
   // Use default Map so we keep order.
   static Map<int, _HttpServer> _servers = new Map<int, _HttpServer>();
 
-  String serverHeader;
+  String? serverHeader;
   final HttpHeaders defaultResponseHeaders = _initDefaultResponseHeaders();
   bool autoCompress = false;
 
-  Duration _idleTimeout;
-  Timer _idleTimer;
+  Duration? _idleTimeout;
+  Timer? _idleTimer;
 
   static Future<HttpServer> bind(
       address, int port, int backlog, bool v6Only, bool shared) {
@@ -2743,7 +2740,7 @@
   static Future<HttpServer> bindSecure(
       address,
       int port,
-      SecurityContext context,
+      SecurityContext? context,
       int backlog,
       bool v6Only,
       bool requestClientCertificate,
@@ -2758,16 +2755,17 @@
     });
   }
 
-  _HttpServer._(this._serverSocket, this._closeServer) {
-    _controller =
-        new StreamController<HttpRequest>(sync: true, onCancel: close);
+  _HttpServer._(this._serverSocket, this._closeServer)
+      : _controller = new StreamController<HttpRequest>(sync: true) {
+    _controller.onCancel = close;
     idleTimeout = const Duration(seconds: 120);
     _servers[_serviceId] = this;
   }
 
-  _HttpServer.listenOn(this._serverSocket) : _closeServer = false {
-    _controller =
-        new StreamController<HttpRequest>(sync: true, onCancel: close);
+  _HttpServer.listenOn(this._serverSocket)
+      : _closeServer = false,
+        _controller = new StreamController<HttpRequest>(sync: true) {
+    _controller.onCancel = close;
     idleTimeout = const Duration(seconds: 120);
     _servers[_serviceId] = this;
   }
@@ -2781,16 +2779,17 @@
     return defaultResponseHeaders;
   }
 
-  Duration get idleTimeout => _idleTimeout;
+  Duration? get idleTimeout => _idleTimeout;
 
-  void set idleTimeout(Duration duration) {
-    if (_idleTimer != null) {
-      _idleTimer.cancel();
+  void set idleTimeout(Duration? duration) {
+    var idleTimer = _idleTimer;
+    if (idleTimer != null) {
+      idleTimer.cancel();
       _idleTimer = null;
     }
     _idleTimeout = duration;
-    if (_idleTimeout != null) {
-      _idleTimer = new Timer.periodic(_idleTimeout, (_) {
+    if (duration != null) {
+      _idleTimer = new Timer.periodic(duration, (_) {
         for (var idle in _idleConnections.toList()) {
           if (idle.isMarkedIdle) {
             idle.destroy();
@@ -2802,8 +2801,8 @@
     }
   }
 
-  StreamSubscription<HttpRequest> listen(void onData(HttpRequest event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<HttpRequest> listen(void onData(HttpRequest event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     _serverSocket.listen((Socket socket) {
       socket.setOption(SocketOption.tcpNoDelay, true);
       // Accept the client connection.
@@ -2820,7 +2819,7 @@
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
-  Future close({bool force: false}) {
+  Future close({bool force = false}) {
     closed = true;
     Future result;
     if (_serverSocket != null && _closeServer) {
@@ -2843,11 +2842,12 @@
   }
 
   void _maybePerformCleanup() {
+    var sessionManager = _sessionManagerInstance;
     if (closed &&
         _idleConnections.isEmpty &&
         _activeConnections.isEmpty &&
-        _sessionManagerInstance != null) {
-      _sessionManagerInstance.close();
+        sessionManager != null) {
+      sessionManager.close();
       _sessionManagerInstance = null;
       _servers.remove(_serviceId);
     }
@@ -2891,13 +2891,9 @@
     _activeConnections.add(connection);
   }
 
-  _HttpSessionManager get _sessionManager {
-    // Lazy init.
-    if (_sessionManagerInstance == null) {
-      _sessionManagerInstance = new _HttpSessionManager();
-    }
-    return _sessionManagerInstance;
-  }
+  // Lazy init.
+  _HttpSessionManager get _sessionManager =>
+      _sessionManagerInstance ??= _HttpSessionManager();
 
   HttpConnectionsInfo connectionsInfo() {
     HttpConnectionsInfo result = new HttpConnectionsInfo();
@@ -2948,7 +2944,7 @@
     return r;
   }
 
-  _HttpSessionManager _sessionManagerInstance;
+  _HttpSessionManager? _sessionManagerInstance;
 
   // Indicated if the http server has been closed.
   bool closed = false;
@@ -2970,7 +2966,7 @@
   static const String PROXY_PREFIX = "PROXY ";
   static const String DIRECT_PREFIX = "DIRECT";
 
-  _ProxyConfiguration(String configuration) : proxies = new List<_Proxy>() {
+  _ProxyConfiguration(String configuration) : proxies = <_Proxy>[] {
     if (configuration == null) {
       throw new HttpException("Invalid proxy configuration $configuration");
     }
@@ -2979,8 +2975,8 @@
       proxy = proxy.trim();
       if (!proxy.isEmpty) {
         if (proxy.startsWith(PROXY_PREFIX)) {
-          String username;
-          String password;
+          String? username;
+          String? password;
           // Skip the "PROXY " prefix.
           proxy = proxy.substring(PROXY_PREFIX.length).trim();
           // Look for proxy authentication.
@@ -3010,7 +3006,7 @@
           int port;
           try {
             port = int.parse(portString);
-          } on FormatException {
+          } on FormatException catch (e) {
             throw new HttpException(
                 "Invalid proxy configuration $configuration, "
                 "invalid port '$portString'");
@@ -3031,13 +3027,13 @@
 }
 
 class _Proxy {
-  final String host;
-  final int port;
-  final String username;
-  final String password;
+  final String? host;
+  final int? port;
+  final String? username;
+  final String? password;
   final bool isDirect;
 
-  const _Proxy(this.host, this.port, this.username, this.password)
+  const _Proxy(String this.host, int this.port, this.username, this.password)
       : isDirect = false;
   const _Proxy.direct()
       : host = null,
@@ -3054,14 +3050,13 @@
   int remotePort;
   int localPort;
 
-  static _HttpConnectionInfo create(Socket socket) {
+  _HttpConnectionInfo(this.remoteAddress, this.remotePort, this.localPort);
+
+  static _HttpConnectionInfo? create(Socket socket) {
     if (socket == null) return null;
     try {
-      _HttpConnectionInfo info = new _HttpConnectionInfo();
-      return info
-        ..remoteAddress = socket.remoteAddress
-        ..remotePort = socket.remotePort
-        ..localPort = socket.port;
+      return _HttpConnectionInfo(
+          socket.remoteAddress, socket.remotePort, socket.port);
     } catch (e) {}
     return null;
   }
@@ -3073,8 +3068,8 @@
 
   _DetachedSocket(this._socket, this._incoming);
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _incoming.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -3085,11 +3080,11 @@
     _socket.encoding = value;
   }
 
-  void write(Object obj) {
+  void write(Object? obj) {
     _socket.write(obj);
   }
 
-  void writeln([Object obj = ""]) {
+  void writeln([Object? obj = ""]) {
     _socket.writeln(obj);
   }
 
@@ -3105,7 +3100,7 @@
     _socket.add(bytes);
   }
 
-  void addError(error, [StackTrace stackTrace]) =>
+  void addError(Object error, [StackTrace? stackTrace]) =>
       _socket.addError(error, stackTrace);
 
   Future addStream(Stream<List<int>> stream) {
@@ -3175,11 +3170,11 @@
   bool used = false;
 
   // Digest specific fields.
-  String ha1;
-  String nonce;
-  String algorithm;
-  String qop;
-  int nonceCount;
+  String? ha1;
+  String? nonce;
+  String? algorithm;
+  String? qop;
+  int? nonceCount;
 
   _Credentials(this.credentials, this.realm) {
     if (credentials.scheme == _AuthenticationScheme.DIGEST) {
@@ -3189,7 +3184,7 @@
       // the WWW-Authenticate and Proxy-Authenticate headers, see
       // http://tools.ietf.org/html/draft-reschke-basicauth-enc-06. For
       // now always use UTF-8 encoding.
-      _HttpClientDigestCredentials creds = credentials;
+      var creds = credentials as _HttpClientDigestCredentials;
       var hasher = new _MD5()
         ..add(utf8.encode(creds.username))
         ..add([_CharCode.COLON])
@@ -3211,7 +3206,7 @@
   _SiteCredentials(this.uri, realm, _HttpClientCredentials creds)
       : super(creds, realm);
 
-  bool applies(Uri uri, _AuthenticationScheme scheme) {
+  bool applies(Uri uri, _AuthenticationScheme? scheme) {
     if (scheme != null && credentials.scheme != scheme) return false;
     if (uri.host != this.uri.host) return false;
     int thisPort =
@@ -3227,7 +3222,7 @@
     if (credentials.scheme == _AuthenticationScheme.DIGEST && nonce == null) {
       return;
     }
-    credentials.authorize(this, request);
+    credentials.authorize(this, request as _HttpClientRequest);
     used = true;
   }
 }
@@ -3239,7 +3234,7 @@
   _ProxyCredentials(this.host, this.port, realm, _HttpClientCredentials creds)
       : super(creds, realm);
 
-  bool applies(_Proxy proxy, _AuthenticationScheme scheme) {
+  bool applies(_Proxy proxy, _AuthenticationScheme? scheme) {
     if (scheme != null && credentials.scheme != scheme) return false;
     return proxy.host == host && proxy.port == port;
   }
@@ -3250,13 +3245,13 @@
     if (credentials.scheme == _AuthenticationScheme.DIGEST && nonce == null) {
       return;
     }
-    credentials.authorizeProxy(this, request);
+    credentials.authorizeProxy(this, request as _HttpClientRequest);
   }
 }
 
 abstract class _HttpClientCredentials implements HttpClientCredentials {
   _AuthenticationScheme get scheme;
-  void authorize(_Credentials credentials, HttpClientRequest request);
+  void authorize(_Credentials credentials, _HttpClientRequest request);
   void authorizeProxy(_ProxyCredentials credentials, HttpClientRequest request);
 }
 
@@ -3307,29 +3302,31 @@
       ..add(requestUri.codeUnits);
     var ha2 = _CryptoUtils.bytesToHex(hasher.close());
 
-    String qop;
-    String cnonce;
-    String nc;
-    hasher = new _MD5()..add(credentials.ha1.codeUnits)..add([_CharCode.COLON]);
+    bool isAuth = false;
+    String cnonce = "";
+    String nc = "";
+    hasher = new _MD5()
+      ..add(credentials.ha1!.codeUnits)
+      ..add([_CharCode.COLON]);
     if (credentials.qop == "auth") {
-      qop = credentials.qop;
+      isAuth = true;
       cnonce = _CryptoUtils.bytesToHex(_CryptoUtils.getRandomBytes(4));
-      ++credentials.nonceCount;
-      nc = credentials.nonceCount.toRadixString(16);
-      nc = "00000000".substring(0, 8 - nc.length + 1) + nc;
+      var nonceCount = credentials.nonceCount! + 1;
+      credentials.nonceCount = nonceCount;
+      nc = nonceCount.toRadixString(16).padLeft(9, "0");
       hasher
-        ..add(credentials.nonce.codeUnits)
+        ..add(credentials.nonce!.codeUnits)
         ..add([_CharCode.COLON])
         ..add(nc.codeUnits)
         ..add([_CharCode.COLON])
         ..add(cnonce.codeUnits)
         ..add([_CharCode.COLON])
-        ..add(credentials.qop.codeUnits)
+        ..add("auth".codeUnits)
         ..add([_CharCode.COLON])
         ..add(ha2.codeUnits);
     } else {
       hasher
-        ..add(credentials.nonce.codeUnits)
+        ..add(credentials.nonce!.codeUnits)
         ..add([_CharCode.COLON])
         ..add(ha2.codeUnits);
     }
@@ -3342,9 +3339,9 @@
       ..write(', nonce="${credentials.nonce}"')
       ..write(', uri="$requestUri"')
       ..write(', algorithm="${credentials.algorithm}"');
-    if (qop == "auth") {
+    if (isAuth) {
       buffer
-        ..write(', qop="$qop"')
+        ..write(', qop="auth"')
         ..write(', cnonce="$cnonce"')
         ..write(', nc="$nc"');
     }
@@ -3353,14 +3350,14 @@
   }
 
   void authorize(_Credentials credentials, HttpClientRequest request) {
-    request.headers.set(
-        HttpHeaders.authorizationHeader, authorization(credentials, request));
+    request.headers.set(HttpHeaders.authorizationHeader,
+        authorization(credentials, request as _HttpClientRequest));
   }
 
   void authorizeProxy(
       _ProxyCredentials credentials, HttpClientRequest request) {
     request.headers.set(HttpHeaders.proxyAuthorizationHeader,
-        authorization(credentials, request));
+        authorization(credentials, request as _HttpClientRequest));
   }
 }
 
diff --git a/sdk/lib/_http/http_parser.dart b/sdk/lib/_http/http_parser.dart
index a67011e..9459789 100644
--- a/sdk/lib/_http/http_parser.dart
+++ b/sdk/lib/_http/http_parser.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.6
-
 part of dart._http;
 
 // Global constants.
@@ -112,19 +110,19 @@
  */
 class _HttpDetachedStreamSubscription implements StreamSubscription<Uint8List> {
   StreamSubscription<Uint8List> _subscription;
-  Uint8List _injectData;
+  Uint8List? _injectData;
+  Function? _userOnData;
   bool _isCanceled = false;
-  int _pauseCount = 1;
-  Function _userOnData;
   bool _scheduled = false;
+  int _pauseCount = 1;
 
   _HttpDetachedStreamSubscription(
       this._subscription, this._injectData, this._userOnData);
 
   bool get isPaused => _subscription.isPaused;
 
-  Future<T> asFuture<T>([T futureValue]) =>
-      _subscription.asFuture<T>(futureValue);
+  Future<T> asFuture<T>([T? futureValue]) =>
+      _subscription.asFuture<T>(futureValue as T);
 
   Future cancel() {
     _isCanceled = true;
@@ -132,20 +130,20 @@
     return _subscription.cancel();
   }
 
-  void onData(void handleData(Uint8List data)) {
+  void onData(void handleData(Uint8List data)?) {
     _userOnData = handleData;
     _subscription.onData(handleData);
   }
 
-  void onDone(void handleDone()) {
+  void onDone(void handleDone()?) {
     _subscription.onDone(handleDone);
   }
 
-  void onError(Function handleError) {
+  void onError(Function? handleError) {
     _subscription.onError(handleError);
   }
 
-  void pause([Future resumeSignal]) {
+  void pause([Future? resumeSignal]) {
     if (_injectData == null) {
       _subscription.pause(resumeSignal);
     } else {
@@ -177,21 +175,20 @@
       // To ensure that 'subscription.isPaused' is false, we resume the
       // subscription here. This is fine as potential events are delayed.
       _subscription.resume();
-      if (_userOnData != null) {
-        _userOnData(data);
-      }
+      _userOnData?.call(data);
     });
   }
 }
 
 class _HttpDetachedIncoming extends Stream<Uint8List> {
-  final StreamSubscription<Uint8List> subscription;
-  final Uint8List bufferedData;
+  final StreamSubscription<Uint8List>? subscription;
+  final Uint8List? bufferedData;
 
   _HttpDetachedIncoming(this.subscription, this.bufferedData);
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
+    var subscription = this.subscription;
     if (subscription != null) {
       subscription
         ..onData(onData)
@@ -205,7 +202,7 @@
         ..resume();
     } else {
       // TODO(26379): add test for this branch.
-      return new Stream<Uint8List>.fromIterable([bufferedData]).listen(onData,
+      return new Stream<Uint8List>.fromIterable([bufferedData!]).listen(onData,
           onError: onError, onDone: onDone, cancelOnError: cancelOnError);
     }
   }
@@ -236,13 +233,13 @@
   bool _parserCalled = false;
 
   // The data that is currently being parsed.
-  Uint8List _buffer;
-  int _index;
+  Uint8List? _buffer;
+  int _index = -1;
 
   final bool _requestParser;
-  int _state;
-  int _httpVersionIndex;
-  int _messageType;
+  int _state = _State.START;
+  int? _httpVersionIndex;
+  int _messageType = _MessageType.UNDETERMINED;
   int _statusCode = 0;
   int _statusCodeLength = 0;
   final List<int> _method = [];
@@ -252,11 +249,11 @@
   // The limit for method, uriOrReasonPhrase, header field and value
   int _headerSizeLimit = 8 * 1024;
 
-  int _httpVersion;
+  int _httpVersion = _HttpVersion.UNDETERMINED;
   int _transferLength = -1;
-  bool _persistentConnection;
-  bool _connectionUpgrade;
-  bool _chunked;
+  bool _persistentConnection = false;
+  bool _connectionUpgrade = false;
+  bool _chunked = false;
 
   bool _noMessageBody = false;
   int _remainingContent = -1;
@@ -264,18 +261,18 @@
   bool _transferEncoding = false;
   bool connectMethod = false;
 
-  _HttpHeaders _headers;
+  _HttpHeaders? _headers;
 
   // The limit for parsing chunk size
   int _chunkSizeLimit = 0x7FFFFFFF;
 
   // The current incoming connection.
-  _HttpIncoming _incoming;
-  StreamSubscription<Uint8List> _socketSubscription;
+  _HttpIncoming? _incoming;
+  StreamSubscription<Uint8List>? _socketSubscription;
   bool _paused = true;
   bool _bodyPaused = false;
-  StreamController<_HttpIncoming> _controller;
-  StreamController<Uint8List> _bodyController;
+  final StreamController<_HttpIncoming> _controller;
+  StreamController<Uint8List>? _bodyController;
 
   factory _HttpParser.requestParser() {
     return new _HttpParser._(true);
@@ -285,30 +282,28 @@
     return new _HttpParser._(false);
   }
 
-  _HttpParser._(this._requestParser) {
-    _controller = new StreamController<_HttpIncoming>(
-        sync: true,
-        onListen: () {
-          _paused = false;
-        },
-        onPause: () {
-          _paused = true;
-          _pauseStateChanged();
-        },
-        onResume: () {
-          _paused = false;
-          _pauseStateChanged();
-        },
-        onCancel: () {
-          if (_socketSubscription != null) {
-            _socketSubscription.cancel();
-          }
-        });
+  _HttpParser._(this._requestParser)
+      : _controller = new StreamController<_HttpIncoming>(sync: true) {
+    _controller
+      ..onListen = () {
+        _paused = false;
+      }
+      ..onPause = () {
+        _paused = true;
+        _pauseStateChanged();
+      }
+      ..onResume = () {
+        _paused = false;
+        _pauseStateChanged();
+      }
+      ..onCancel = () {
+        _socketSubscription?.cancel();
+      };
     _reset();
   }
 
-  StreamSubscription<_HttpIncoming> listen(void onData(_HttpIncoming event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<_HttpIncoming> listen(void onData(_HttpIncoming event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -341,6 +336,7 @@
   // parsing and return. This will be in case of either an upgrade
   // request or a request or response with an empty body.
   bool _headersEnd() {
+    var headers = _headers!;
     // If method is CONNECT, response parser should ignore any Content-Length or
     // Transfer-Encoding header fields in a successful response.
     // [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.6)
@@ -349,14 +345,14 @@
         _statusCode < 300 &&
         connectMethod) {
       _transferLength = -1;
-      _headers.chunkedTransferEncoding = false;
+      headers.chunkedTransferEncoding = false;
       _chunked = false;
-      _headers.removeAll(HttpHeaders.contentLengthHeader);
-      _headers.removeAll(HttpHeaders.transferEncodingHeader);
+      headers.removeAll(HttpHeaders.contentLengthHeader);
+      headers.removeAll(HttpHeaders.transferEncodingHeader);
     }
-    _headers._mutable = false;
+    headers._mutable = false;
 
-    _transferLength = _headers.contentLength;
+    _transferLength = headers.contentLength;
     // Ignore the Content-Length header if Transfer-Encoding
     // is chunked (RFC 2616 section 4.4)
     if (_chunked) _transferLength = -1;
@@ -373,30 +369,28 @@
       _state = _State.UPGRADED;
       _transferLength = 0;
     }
-    _createIncoming(_transferLength);
+    var incoming = _createIncoming(_transferLength);
     if (_requestParser) {
-      _incoming.method = new String.fromCharCodes(_method);
-      _incoming.uri = Uri.parse(new String.fromCharCodes(_uriOrReasonPhrase));
+      incoming.method = new String.fromCharCodes(_method);
+      incoming.uri = Uri.parse(new String.fromCharCodes(_uriOrReasonPhrase));
     } else {
-      _incoming.statusCode = _statusCode;
-      _incoming.reasonPhrase = new String.fromCharCodes(_uriOrReasonPhrase);
+      incoming.statusCode = _statusCode;
+      incoming.reasonPhrase = new String.fromCharCodes(_uriOrReasonPhrase);
     }
     _method.clear();
     _uriOrReasonPhrase.clear();
     if (_connectionUpgrade) {
-      _incoming.upgraded = true;
+      incoming.upgraded = true;
       _parserCalled = false;
-      var tmp = _incoming;
       _closeIncoming();
-      _controller.add(tmp);
+      _controller.add(incoming);
       return true;
     }
     if (_transferLength == 0 ||
         (_messageType == _MessageType.RESPONSE && _noMessageBody)) {
       _reset();
-      var tmp = _incoming;
       _closeIncoming();
-      _controller.add(tmp);
+      _controller.add(incoming);
       return false;
     } else if (_chunked) {
       _state = _State.CHUNK_SIZE;
@@ -410,7 +404,7 @@
       _state = _State.BODY;
     }
     _parserCalled = false;
-    _controller.add(_incoming);
+    _controller.add(incoming);
     return true;
   }
 
@@ -433,7 +427,7 @@
       throw HttpException("Data on failed connection");
     }
     while (_buffer != null &&
-        _index < _buffer.length &&
+        _index < _buffer!.length &&
         _state != _State.FAILURE &&
         _state != _State.UPGRADED) {
       // Depending on _incoming, we either break on _bodyPaused or _paused.
@@ -442,7 +436,9 @@
         _parserCalled = false;
         return;
       }
-      int byte = _buffer[_index++];
+      int index = _index;
+      int byte = _buffer![index];
+      _index = index + 1;
       switch (_state) {
         case _State.START:
           if (byte == _Const.HTTP[0]) {
@@ -463,22 +459,23 @@
           break;
 
         case _State.METHOD_OR_RESPONSE_HTTP_VERSION:
-          if (_httpVersionIndex < _Const.HTTP.length &&
-              byte == _Const.HTTP[_httpVersionIndex]) {
+          var httpVersionIndex = _httpVersionIndex!;
+          if (httpVersionIndex < _Const.HTTP.length &&
+              byte == _Const.HTTP[httpVersionIndex]) {
             // Continue parsing HTTP version.
-            _httpVersionIndex++;
-          } else if (_httpVersionIndex == _Const.HTTP.length &&
+            _httpVersionIndex = httpVersionIndex + 1;
+          } else if (httpVersionIndex == _Const.HTTP.length &&
               byte == _CharCode.SLASH) {
             // HTTP/ parsed. As method is a token this cannot be a
             // method anymore.
-            _httpVersionIndex++;
+            _httpVersionIndex = httpVersionIndex + 1;
             if (_requestParser) {
               throw HttpException("Invalid request line");
             }
             _state = _State.RESPONSE_HTTP_VERSION;
           } else {
             // Did not parse HTTP version. Expect method instead.
-            for (int i = 0; i < _httpVersionIndex; i++) {
+            for (int i = 0; i < httpVersionIndex; i++) {
               _addWithValidation(_method, _Const.HTTP[i]);
             }
             if (byte == _CharCode.SP) {
@@ -495,23 +492,24 @@
           break;
 
         case _State.RESPONSE_HTTP_VERSION:
-          if (_httpVersionIndex < _Const.HTTP1DOT.length) {
+          var httpVersionIndex = _httpVersionIndex!;
+          if (httpVersionIndex < _Const.HTTP1DOT.length) {
             // Continue parsing HTTP version.
-            _expect(byte, _Const.HTTP1DOT[_httpVersionIndex]);
-            _httpVersionIndex++;
-          } else if (_httpVersionIndex == _Const.HTTP1DOT.length &&
+            _expect(byte, _Const.HTTP1DOT[httpVersionIndex]);
+            _httpVersionIndex = httpVersionIndex + 1;
+          } else if (httpVersionIndex == _Const.HTTP1DOT.length &&
               byte == _CharCode.ONE) {
             // HTTP/1.1 parsed.
             _httpVersion = _HttpVersion.HTTP11;
             _persistentConnection = true;
-            _httpVersionIndex++;
-          } else if (_httpVersionIndex == _Const.HTTP1DOT.length &&
+            _httpVersionIndex = httpVersionIndex + 1;
+          } else if (httpVersionIndex == _Const.HTTP1DOT.length &&
               byte == _CharCode.ZERO) {
             // HTTP/1.0 parsed.
             _httpVersion = _HttpVersion.HTTP10;
             _persistentConnection = false;
-            _httpVersionIndex++;
-          } else if (_httpVersionIndex == _Const.HTTP1DOT.length + 1) {
+            _httpVersionIndex = httpVersionIndex + 1;
+          } else if (httpVersionIndex == _Const.HTTP1DOT.length + 1) {
             _expect(byte, _CharCode.SP);
             // HTTP version parsed.
             _state = _State.RESPONSE_LINE_STATUS_CODE;
@@ -550,20 +548,21 @@
           break;
 
         case _State.REQUEST_LINE_HTTP_VERSION:
-          if (_httpVersionIndex < _Const.HTTP1DOT.length) {
-            _expect(byte, _Const.HTTP11[_httpVersionIndex]);
-            _httpVersionIndex++;
+          var httpVersionIndex = _httpVersionIndex!;
+          if (httpVersionIndex < _Const.HTTP1DOT.length) {
+            _expect(byte, _Const.HTTP11[httpVersionIndex]);
+            _httpVersionIndex = httpVersionIndex + 1;
           } else if (_httpVersionIndex == _Const.HTTP1DOT.length) {
             if (byte == _CharCode.ONE) {
               // HTTP/1.1 parsed.
               _httpVersion = _HttpVersion.HTTP11;
               _persistentConnection = true;
-              _httpVersionIndex++;
+              _httpVersionIndex = httpVersionIndex + 1;
             } else if (byte == _CharCode.ZERO) {
               // HTTP/1.0 parsed.
               _httpVersion = _HttpVersion.HTTP10;
               _persistentConnection = false;
-              _httpVersionIndex++;
+              _httpVersionIndex = httpVersionIndex + 1;
             } else {
               throw HttpException("Invalid response, invalid HTTP version");
             }
@@ -627,12 +626,12 @@
           break;
 
         case _State.HEADER_START:
-          _headers = new _HttpHeaders(version);
+          _headers = new _HttpHeaders(version!);
           if (byte == _CharCode.CR) {
             _state = _State.HEADER_ENDING;
           } else if (byte == _CharCode.LF) {
             _state = _State.HEADER_ENDING;
-            _index--; // Make the new state see the LF again.
+            _index = _index - 1; // Make the new state see the LF again.
           } else {
             // Start of new header field.
             _addWithValidation(_headerField, _toLowerCaseByte(byte));
@@ -700,6 +699,7 @@
                 _statusCode = HttpStatus.badRequest;
               }
             }
+            var headers = _headers!;
             if (headerField == HttpHeaders.connectionHeader) {
               List<String> tokens = _tokenizeFieldValue(headerValue);
               final bool isResponse = _messageType == _MessageType.RESPONSE;
@@ -713,10 +713,10 @@
                     (isUpgrade && isResponse && isUpgradeCode)) {
                   _connectionUpgrade = true;
                 }
-                _headers._add(headerField, tokens[i]);
+                headers._add(headerField, tokens[i]);
               }
             } else {
-              _headers._add(headerField, headerValue);
+              headers._add(headerField, headerValue);
             }
             _headerField.clear();
             _headerValue.clear();
@@ -725,7 +725,7 @@
               _state = _State.HEADER_ENDING;
             } else if (byte == _CharCode.LF) {
               _state = _State.HEADER_ENDING;
-              _index--; // Make the new state see the LF again.
+              _index = _index - 1; // Make the new state see the LF again.
             } else {
               // Start of new header field.
               _state = _State.HEADER_FIELD;
@@ -794,8 +794,9 @@
 
         case _State.BODY:
           // The body is not handled one byte at a time but in blocks.
-          _index--;
-          int dataAvailable = _buffer.length - _index;
+          _index = _index - 1;
+          var buffer = _buffer!;
+          int dataAvailable = buffer.length - _index;
           if (_remainingContent >= 0 && dataAvailable > _remainingContent) {
             dataAvailable = _remainingContent;
           }
@@ -803,12 +804,12 @@
           // cases like this, and the user will not experience different data
           // typed (which could lead to polymorphic user code).
           Uint8List data = new Uint8List.view(
-              _buffer.buffer, _buffer.offsetInBytes + _index, dataAvailable);
-          _bodyController.add(data);
+              buffer.buffer, buffer.offsetInBytes + _index, dataAvailable);
+          _bodyController!.add(data);
           if (_remainingContent != -1) {
             _remainingContent -= data.length;
           }
-          _index += data.length;
+          _index = _index + data.length;
           if (_remainingContent == 0) {
             if (!_chunked) {
               _reset();
@@ -832,18 +833,19 @@
     }
 
     _parserCalled = false;
-    if (_buffer != null && _index == _buffer.length) {
+    var buffer = _buffer;
+    if (buffer != null && _index == buffer.length) {
       // If all data is parsed release the buffer and resume receiving
       // data.
       _releaseBuffer();
       if (_state != _State.UPGRADED && _state != _State.FAILURE) {
-        _socketSubscription.resume();
+        _socketSubscription!.resume();
       }
     }
   }
 
   void _onData(Uint8List buffer) {
-    _socketSubscription.pause();
+    _socketSubscription!.pause();
     assert(_buffer == null);
     _buffer = buffer;
     _index = 0;
@@ -903,7 +905,7 @@
     _controller.close();
   }
 
-  String get version {
+  String? get version {
     switch (_httpVersion) {
       case _HttpVersion.HTTP10:
         return "1.0";
@@ -918,7 +920,9 @@
   bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED;
   bool get persistentConnection => _persistentConnection;
 
-  void set isHead(bool value) => _noMessageBody = value ?? false;
+  void set isHead(bool value) {
+    _noMessageBody = valueOfNonNullableParamWithDefault<bool>(value, false);
+  }
 
   _HttpDetachedIncoming detachIncoming() {
     // Simulate detached by marking as upgraded.
@@ -926,10 +930,12 @@
     return new _HttpDetachedIncoming(_socketSubscription, readUnparsedData());
   }
 
-  Uint8List readUnparsedData() {
-    if (_buffer == null) return null;
-    if (_index == _buffer.length) return null;
-    var result = _buffer.sublist(_index);
+  Uint8List? readUnparsedData() {
+    var buffer = _buffer;
+    if (buffer == null) return null;
+    var index = _index;
+    if (index == buffer.length) return null;
+    var result = buffer.sublist(index);
     _releaseBuffer();
     return result;
   }
@@ -963,7 +969,7 @@
 
   void _releaseBuffer() {
     _buffer = null;
-    _index = null;
+    _index = -1;
   }
 
   static bool _isTokenChar(int byte) {
@@ -977,7 +983,7 @@
   }
 
   static List<String> _tokenizeFieldValue(String headerValue) {
-    List<String> tokens = new List<String>();
+    List<String> tokens = <String>[];
     int start = 0;
     int index = 0;
     while (index < headerValue.length) {
@@ -1072,53 +1078,53 @@
     throw HttpException("$method exceeds the $_headerSizeLimit size limit");
   }
 
-  void _createIncoming(int transferLength) {
+  _HttpIncoming _createIncoming(int transferLength) {
     assert(_incoming == null);
     assert(_bodyController == null);
     assert(!_bodyPaused);
-    var incoming;
-    _bodyController = new StreamController<Uint8List>(
-        sync: true,
-        onListen: () {
-          if (incoming != _incoming) return;
-          assert(_bodyPaused);
-          _bodyPaused = false;
-          _pauseStateChanged();
-        },
-        onPause: () {
-          if (incoming != _incoming) return;
-          assert(!_bodyPaused);
-          _bodyPaused = true;
-          _pauseStateChanged();
-        },
-        onResume: () {
-          if (incoming != _incoming) return;
-          assert(_bodyPaused);
-          _bodyPaused = false;
-          _pauseStateChanged();
-        },
-        onCancel: () {
-          if (incoming != _incoming) return;
-          if (_socketSubscription != null) {
-            _socketSubscription.cancel();
-          }
-          _closeIncoming(true);
-          _controller.close();
-        });
-    incoming = _incoming =
-        new _HttpIncoming(_headers, transferLength, _bodyController.stream);
+    var controller =
+        _bodyController = new StreamController<Uint8List>(sync: true);
+    var incoming = _incoming =
+        new _HttpIncoming(_headers!, transferLength, controller.stream);
+    controller
+      ..onListen = () {
+        if (incoming != _incoming) return;
+        assert(_bodyPaused);
+        _bodyPaused = false;
+        _pauseStateChanged();
+      }
+      ..onPause = () {
+        if (incoming != _incoming) return;
+        assert(!_bodyPaused);
+        _bodyPaused = true;
+        _pauseStateChanged();
+      }
+      ..onResume = () {
+        if (incoming != _incoming) return;
+        assert(_bodyPaused);
+        _bodyPaused = false;
+        _pauseStateChanged();
+      }
+      ..onCancel = () {
+        if (incoming != _incoming) return;
+        _socketSubscription?.cancel();
+        _closeIncoming(true);
+        _controller.close();
+      };
     _bodyPaused = true;
     _pauseStateChanged();
+    return incoming;
   }
 
   void _closeIncoming([bool closing = false]) {
     // Ignore multiple close (can happen in re-entrance).
-    if (_incoming == null) return;
     var tmp = _incoming;
+    if (tmp == null) return;
     tmp.close(closing);
     _incoming = null;
-    if (_bodyController != null) {
-      _bodyController.close();
+    var controller = _bodyController;
+    if (controller != null) {
+      controller.close();
       _bodyController = null;
     }
     _bodyPaused = false;
@@ -1138,19 +1144,17 @@
   }
 
   void _reportHttpError(error, [stackTrace]) {
-    if (_socketSubscription != null) _socketSubscription.cancel();
+    _socketSubscription?.cancel();
     _state = _State.FAILURE;
     _controller.addError(error, stackTrace);
     _controller.close();
   }
 
   void _reportBodyError(error, [stackTrace]) {
-    if (_socketSubscription != null) _socketSubscription.cancel();
+    _socketSubscription?.cancel();
     _state = _State.FAILURE;
-    _bodyController.addError(error, stackTrace);
+    _bodyController?.addError(error, stackTrace);
     // In case of drain(), error event will close the stream.
-    if (_bodyController != null) {
-      _bodyController.close();
-    }
+    _bodyController?.close();
   }
 }
diff --git a/sdk/lib/_http/http_session.dart b/sdk/lib/_http/http_session.dart
index 30b65af..407192a 100644
--- a/sdk/lib/_http/http_session.dart
+++ b/sdk/lib/_http/http_session.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.6
-
 part of dart._http;
 
 const String _DART_SESSION_ID = "DARTSESSID";
@@ -15,11 +13,11 @@
   bool _destroyed = false;
   bool _isNew = true;
   DateTime _lastSeen;
-  Function _timeoutCallback;
+  Function? _timeoutCallback;
   _HttpSessionManager _sessionManager;
   // Pointers in timeout queue.
-  _HttpSession _prev;
-  _HttpSession _next;
+  _HttpSession? _prev;
+  _HttpSession? _next;
   final String id;
 
   final Map _data = new HashMap();
@@ -27,6 +25,7 @@
   _HttpSession(this._sessionManager, this.id) : _lastSeen = new DateTime.now();
 
   void destroy() {
+    assert(!_destroyed);
     _destroyed = true;
     _sessionManager._removeFromTimeoutQueue(this);
     _sessionManager._sessions.remove(id);
@@ -43,7 +42,7 @@
 
   bool get isNew => _isNew;
 
-  void set onTimeout(void callback()) {
+  void set onTimeout(void callback()?) {
     _timeoutCallback = callback;
   }
 
@@ -80,7 +79,7 @@
   }
 
   Map<K, V> cast<K, V>() => _data.cast<K, V>();
-  update(key, update(value), {ifAbsent()}) =>
+  update(key, update(value), {ifAbsent()?}) =>
       _data.update(key, update, ifAbsent: ifAbsent);
 
   void updateAll(update(key, value)) {
@@ -104,9 +103,9 @@
 class _HttpSessionManager {
   Map<String, _HttpSession> _sessions;
   int _sessionTimeout = 20 * 60; // 20 mins.
-  _HttpSession _head;
-  _HttpSession _tail;
-  Timer _timer;
+  _HttpSession? _head;
+  _HttpSession? _tail;
+  Timer? _timer;
 
   _HttpSessionManager() : _sessions = {};
 
@@ -116,7 +115,7 @@
     return _CryptoUtils.bytesToHex(data);
   }
 
-  _HttpSession getSession(String id) => _sessions[id];
+  _HttpSession? getSession(String id) => _sessions[id];
 
   _HttpSession createSession() {
     var id = createSessionId();
@@ -152,55 +151,52 @@
       _startTimer();
     } else {
       assert(_timer != null);
-      assert(_tail != null);
+      var tail = _tail!;
       // Add to end.
-      _tail._next = session;
-      session._prev = _tail;
+      tail._next = session;
+      session._prev = tail;
       _tail = session;
     }
   }
 
   void _removeFromTimeoutQueue(_HttpSession session) {
-    if (session._next != null) {
-      session._next._prev = session._prev;
-    }
-    if (session._prev != null) {
-      session._prev._next = session._next;
+    var next = session._next;
+    var prev = session._prev;
+    session._next = session._prev = null;
+    next?._prev = prev;
+    prev?._next = next;
+    if (_tail == session) {
+      _tail = prev;
     }
     if (_head == session) {
+      _head = next;
       // We removed the head element, start new timer.
-      _head = session._next;
       _stopTimer();
       _startTimer();
     }
-    if (_tail == session) {
-      _tail = session._prev;
-    }
-    session._next = session._prev = null;
   }
 
   void _timerTimeout() {
     _stopTimer(); // Clear timer.
-    assert(_head != null);
-    var session = _head;
+    var session = _head!;
     session.destroy(); // Will remove the session from timeout queue and map.
-    if (session._timeoutCallback != null) {
-      session._timeoutCallback();
-    }
+    session._timeoutCallback?.call();
   }
 
   void _startTimer() {
     assert(_timer == null);
-    if (_head != null) {
-      int seconds = new DateTime.now().difference(_head.lastSeen).inSeconds;
+    var head = _head;
+    if (head != null) {
+      int seconds = new DateTime.now().difference(head.lastSeen).inSeconds;
       _timer = new Timer(
           new Duration(seconds: _sessionTimeout - seconds), _timerTimeout);
     }
   }
 
   void _stopTimer() {
-    if (_timer != null) {
-      _timer.cancel();
+    var timer = _timer;
+    if (timer != null) {
+      timer.cancel();
       _timer = null;
     }
   }
diff --git a/sdk/lib/_http/overrides.dart b/sdk/lib/_http/overrides.dart
index 8b63209..bbd21ee 100644
--- a/sdk/lib/_http/overrides.dart
+++ b/sdk/lib/_http/overrides.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.6
-
 part of dart._http;
 
 final _httpOverridesToken = new Object();
@@ -32,9 +30,9 @@
 /// }
 /// ```
 abstract class HttpOverrides {
-  static HttpOverrides _global;
+  static HttpOverrides? _global;
 
-  static HttpOverrides get current {
+  static HttpOverrides? get current {
     return Zone.current[_httpOverridesToken] ?? _global;
   }
 
@@ -43,14 +41,14 @@
   /// These are the [HttpOverrides] that will be used in the root Zone, and in
   /// Zone's that do not set [HttpOverrides] and whose ancestors up to the root
   /// Zone do not set [HttpOverrides].
-  static set global(HttpOverrides overrides) {
+  static set global(HttpOverrides? overrides) {
     _global = overrides;
   }
 
   /// Runs [body] in a fresh [Zone] using the provided overrides.
   static R runZoned<R>(R body(),
-      {HttpClient Function(SecurityContext) createHttpClient,
-      String Function(Uri uri, Map<String, String> environment)
+      {HttpClient Function(SecurityContext?)? createHttpClient,
+      String Function(Uri uri, Map<String, String>? environment)?
           findProxyFromEnvironment}) {
     HttpOverrides overrides =
         new _HttpOverridesScope(createHttpClient, findProxyFromEnvironment);
@@ -71,7 +69,7 @@
   ///
   /// When this override is installed, this function overrides the behavior of
   /// `new HttpClient`.
-  HttpClient createHttpClient(SecurityContext context) {
+  HttpClient createHttpClient(SecurityContext? context) {
     return new _HttpClient(context);
   }
 
@@ -79,34 +77,37 @@
   ///
   /// When this override is installed, this function overrides the behavior of
   /// `HttpClient.findProxyFromEnvironment`.
-  String findProxyFromEnvironment(Uri url, Map<String, String> environment) {
+  String findProxyFromEnvironment(Uri url, Map<String, String>? environment) {
     return _HttpClient._findProxyFromEnvironment(url, environment);
   }
 }
 
 class _HttpOverridesScope extends HttpOverrides {
-  final HttpOverrides _previous = HttpOverrides.current;
-
-  final HttpClient Function(SecurityContext) _createHttpClient;
-  final String Function(Uri uri, Map<String, String> environment)
+  final HttpOverrides? _previous = HttpOverrides.current;
+  final HttpClient Function(SecurityContext?)? _createHttpClient;
+  final String Function(Uri uri, Map<String, String>? environment)?
       _findProxyFromEnvironment;
 
   _HttpOverridesScope(this._createHttpClient, this._findProxyFromEnvironment);
 
   @override
-  HttpClient createHttpClient(SecurityContext context) {
-    if (_createHttpClient != null) return _createHttpClient(context);
-    if (_previous != null) return _previous.createHttpClient(context);
+  HttpClient createHttpClient(SecurityContext? context) {
+    var createHttpClient = _createHttpClient;
+    if (createHttpClient != null) return createHttpClient(context);
+    var previous = _previous;
+    if (previous != null) return previous.createHttpClient(context);
     return super.createHttpClient(context);
   }
 
   @override
-  String findProxyFromEnvironment(Uri url, Map<String, String> environment) {
-    if (_findProxyFromEnvironment != null) {
-      return _findProxyFromEnvironment(url, environment);
+  String findProxyFromEnvironment(Uri url, Map<String, String>? environment) {
+    var findProxyFromEnvironment = _findProxyFromEnvironment;
+    if (findProxyFromEnvironment != null) {
+      return findProxyFromEnvironment(url, environment);
     }
-    if (_previous != null) {
-      return _previous.findProxyFromEnvironment(url, environment);
+    var previous = _previous;
+    if (previous != null) {
+      return previous.findProxyFromEnvironment(url, environment);
     }
     return super.findProxyFromEnvironment(url, environment);
   }
diff --git a/sdk/lib/_http/websocket.dart b/sdk/lib/_http/websocket.dart
index 45cc5117..c9c6246 100644
--- a/sdk/lib/_http/websocket.dart
+++ b/sdk/lib/_http/websocket.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.6
-
 part of dart._http;
 
 /**
@@ -99,7 +97,7 @@
   /// If set to `null`, the client has no preference, and the compression can
   /// use up to its default maximum window size of 15 bits depending on the
   /// server's preference.
-  final int clientMaxWindowBits;
+  final int? clientMaxWindowBits;
 
   /// The maximal window size bit count requested by the server.
   ///
@@ -109,7 +107,7 @@
   /// If set to `null`, the server has no preference, and the compression can
   /// use up to its default maximum window size of 15 bits depending on the
   /// client's preference.
-  final int serverMaxWindowBits;
+  final int? serverMaxWindowBits;
 
   /// Whether WebSocket compression is enabled.
   ///
@@ -132,21 +130,18 @@
   /// value from headers. Defaults to [WebSocket.DEFAULT_WINDOW_BITS]. Returns a
   /// [_CompressionMaxWindowBits] object which contains the response headers and
   /// negotiated max window bits.
-  _CompressionMaxWindowBits _createServerResponseHeader(HeaderValue requested) {
-    var info = new _CompressionMaxWindowBits();
+  _CompressionMaxWindowBits _createServerResponseHeader(
+      HeaderValue? requested) {
+    var info = new _CompressionMaxWindowBits("", 0);
 
-    int mwb;
-    String part;
-    if (requested?.parameters != null) {
-      part = requested.parameters[_serverMaxWindowBits];
-    }
+    String? part = requested?.parameters[_serverMaxWindowBits];
     if (part != null) {
       if (part.length >= 2 && part.startsWith('0')) {
         throw new ArgumentError("Illegal 0 padding on value.");
       } else {
-        mwb = serverMaxWindowBits == null
-            ? int.tryParse(part) ?? _WebSocketImpl.DEFAULT_WINDOW_BITS
-            : serverMaxWindowBits;
+        int mwb = serverMaxWindowBits ??
+            int.tryParse(part) ??
+            _WebSocketImpl.DEFAULT_WINDOW_BITS;
         info.headerValue = "; server_max_window_bits=${mwb}";
         info.maxWindowBits = mwb;
       }
@@ -158,7 +153,7 @@
   }
 
   /// Returns default values for client compression request headers.
-  String _createClientRequestHeader(HeaderValue requested, int size) {
+  String _createClientRequestHeader(HeaderValue? requested, int size) {
     var info = "";
 
     // If responding to a valid request, specify size
@@ -189,7 +184,7 @@
   /// `server_max_window_bits` value.  This method returns a
   /// [_CompressionMaxWindowBits] object with the response headers and
   /// negotiated `maxWindowBits` value.
-  _CompressionMaxWindowBits _createHeader([HeaderValue requested]) {
+  _CompressionMaxWindowBits _createHeader([HeaderValue? requested]) {
     var info = new _CompressionMaxWindowBits("", 0);
     if (!enabled) {
       return info;
@@ -266,8 +261,8 @@
    * then the [WebSocket] will be created with the default [CompressionOptions].
    */
   factory WebSocketTransformer(
-      {/*String|Future<String>*/ protocolSelector(List<String> protocols),
-      CompressionOptions compression: CompressionOptions.compressionDefault}) {
+      {/*String|Future<String>*/ protocolSelector(List<String> protocols)?,
+      CompressionOptions compression = CompressionOptions.compressionDefault}) {
     return new _WebSocketTransformerImpl(protocolSelector, compression);
   }
 
@@ -289,8 +284,8 @@
    * then the [WebSocket] will be created with the default [CompressionOptions].
    */
   static Future<WebSocket> upgrade(HttpRequest request,
-      {protocolSelector(List<String> protocols),
-      CompressionOptions compression: CompressionOptions.compressionDefault}) {
+      {protocolSelector(List<String> protocols)?,
+      CompressionOptions compression = CompressionOptions.compressionDefault}) {
     return _WebSocketTransformerImpl._upgrade(
         request, protocolSelector, compression);
   }
@@ -347,7 +342,7 @@
    *
    * The default value is `null`.
    */
-  Duration pingInterval;
+  Duration? pingInterval;
 
   /**
    * Create a new WebSocket connection. The URL supplied in [url]
@@ -377,9 +372,9 @@
    * authentication when setting up the connection.
    */
   static Future<WebSocket> connect(String url,
-          {Iterable<String> protocols,
-          Map<String, dynamic> headers,
-          CompressionOptions compression:
+          {Iterable<String>? protocols,
+          Map<String, dynamic>? headers,
+          CompressionOptions compression =
               CompressionOptions.compressionDefault}) =>
       _WebSocketImpl.connect(url, protocols, headers, compression: compression);
 
@@ -407,9 +402,9 @@
    * then the [WebSocket] will be created with the default [CompressionOptions].
    */
   factory WebSocket.fromUpgradedSocket(Socket socket,
-      {String protocol,
-      bool serverSide,
-      CompressionOptions compression: CompressionOptions.compressionDefault}) {
+      {String? protocol,
+      bool? serverSide,
+      CompressionOptions compression = CompressionOptions.compressionDefault}) {
     if (serverSide == null) {
       throw new ArgumentError("The serverSide argument must be passed "
           "explicitly to WebSocket.fromUpgradedSocket.");
@@ -436,19 +431,19 @@
    * selected by the server. If no subprotocol is negotiated the
    * value will remain [:null:].
    */
-  String get protocol;
+  String? get protocol;
 
   /**
    * The close code set when the WebSocket connection is closed. If
    * there is no close code available this property will be [:null:]
    */
-  int get closeCode;
+  int? get closeCode;
 
   /**
    * The close reason set when the WebSocket connection is closed. If
    * there is no close reason available this property will be [:null:]
    */
-  String get closeReason;
+  String? get closeReason;
 
   /**
    * Closes the WebSocket connection. Set the optional [code] and [reason]
@@ -456,7 +451,7 @@
    * omitted, the peer will see [WebSocketStatus.noStatusReceived] code
    * with no reason.
    */
-  Future close([int code, String reason]);
+  Future close([int? code, String? reason]);
 
   /**
    * Sends data on the WebSocket connection. The data in [data] must
@@ -482,12 +477,12 @@
   /**
    * Gets the user agent used for WebSocket connections.
    */
-  static String get userAgent => _WebSocketImpl.userAgent;
+  static String? get userAgent => _WebSocketImpl.userAgent;
 
   /**
    * Sets the user agent to use for WebSocket connections.
    */
-  static set userAgent(String userAgent) {
+  static set userAgent(String? userAgent) {
     _WebSocketImpl.userAgent = userAgent;
   }
 }
diff --git a/sdk/lib/_http/websocket_impl.dart b/sdk/lib/_http/websocket_impl.dart
index 820dd69..68d0f29 100644
--- a/sdk/lib/_http/websocket_impl.dart
+++ b/sdk/lib/_http/websocket_impl.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.6
-
 part of dart._http;
 
 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
@@ -51,7 +49,7 @@
 class _CompressionMaxWindowBits {
   String headerValue;
   int maxWindowBits;
-  _CompressionMaxWindowBits([this.headerValue, this.maxWindowBits]);
+  _CompressionMaxWindowBits(this.headerValue, this.maxWindowBits);
   String toString() => headerValue;
 }
 
@@ -91,16 +89,16 @@
   int _remainingPayloadBytes = -1;
   int _unmaskingIndex = 0;
   int _currentMessageType = _WebSocketMessageType.NONE;
-  int closeCode = WebSocketStatus.noStatusReceived;
+  int closeCode = WebSocketStatus.NO_STATUS_RECEIVED;
   String closeReason = "";
 
-  EventSink<dynamic /*List<int>|_WebSocketPing|_WebSocketPong*/ > _eventSink;
+  EventSink<dynamic /*List<int>|_WebSocketPing|_WebSocketPong*/ >? _eventSink;
 
   final bool _serverSide;
-  final List _maskingBytes = new List(4);
+  final Uint8List _maskingBytes = Uint8List(4);
   final BytesBuilder _payload = new BytesBuilder(copy: false);
 
-  _WebSocketPerMessageDeflate _deflate;
+  _WebSocketPerMessageDeflate? _deflate;
   _WebSocketProtocolTransformer([this._serverSide = false, this._deflate]);
 
   Stream<dynamic /*List<int>|_WebSocketPing|_WebSocketPong*/ > bind(
@@ -114,13 +112,14 @@
     });
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
-    _eventSink.addError(error, stackTrace);
+    _eventSink!.addError(error, stackTrace);
   }
 
   void close() {
-    _eventSink.close();
+    _eventSink!.close();
   }
 
   /**
@@ -308,13 +307,13 @@
         switch (_opcode) {
           case _WebSocketOpcode.CLOSE:
             _state = CLOSED;
-            _eventSink.close();
+            _eventSink!.close();
             break;
           case _WebSocketOpcode.PING:
-            _eventSink.add(new _WebSocketPing());
+            _eventSink!.add(new _WebSocketPing());
             break;
           case _WebSocketOpcode.PONG:
-            _eventSink.add(new _WebSocketPong());
+            _eventSink!.add(new _WebSocketPong());
             break;
         }
         _prepareForNextFrame();
@@ -329,16 +328,17 @@
   void _messageFrameEnd() {
     if (_fin) {
       var bytes = _payload.takeBytes();
-      if (_deflate != null && _compressed) {
-        bytes = _deflate.processIncomingMessage(bytes);
+      var deflate = _deflate;
+      if (deflate != null && _compressed) {
+        bytes = deflate.processIncomingMessage(bytes);
       }
 
       switch (_currentMessageType) {
         case _WebSocketMessageType.TEXT:
-          _eventSink.add(utf8.decode(bytes));
+          _eventSink!.add(utf8.decode(bytes));
           break;
         case _WebSocketMessageType.BINARY:
-          _eventSink.add(bytes);
+          _eventSink!.add(bytes);
           break;
       }
       _currentMessageType = _WebSocketMessageType.NONE;
@@ -364,15 +364,15 @@
           }
         }
         _state = CLOSED;
-        _eventSink.close();
+        _eventSink!.close();
         break;
 
       case _WebSocketOpcode.PING:
-        _eventSink.add(new _WebSocketPing(_payload.takeBytes()));
+        _eventSink!.add(new _WebSocketPing(_payload.takeBytes()));
         break;
 
       case _WebSocketOpcode.PONG:
-        _eventSink.add(new _WebSocketPong(_payload.takeBytes()));
+        _eventSink!.add(new _WebSocketPong(_payload.takeBytes()));
         break;
     }
     _prepareForNextFrame();
@@ -397,12 +397,12 @@
 }
 
 class _WebSocketPing {
-  final List<int> payload;
+  final List<int>? payload;
   _WebSocketPing([this.payload = null]);
 }
 
 class _WebSocketPong {
-  final List<int> payload;
+  final List<int>? payload;
   _WebSocketPong([this.payload = null]);
 }
 
@@ -413,7 +413,7 @@
     implements WebSocketTransformer {
   final StreamController<WebSocket> _controller =
       new StreamController<WebSocket>(sync: true);
-  final _ProtocolSelector _protocolSelector;
+  final _ProtocolSelector? _protocolSelector;
   final CompressionOptions _compression;
 
   _WebSocketTransformerImpl(this._protocolSelector, this._compression);
@@ -431,7 +431,7 @@
   }
 
   static List<String> _tokenizeFieldValue(String headerValue) {
-    List<String> tokens = new List<String>();
+    List<String> tokens = <String>[];
     int start = 0;
     int index = 0;
     while (index < headerValue.length) {
@@ -448,7 +448,7 @@
   }
 
   static Future<WebSocket> _upgrade(HttpRequest request,
-      _ProtocolSelector _protocolSelector, CompressionOptions compression) {
+      _ProtocolSelector? protocolSelector, CompressionOptions compression) {
     var response = request.response;
     if (!_isUpgradeRequest(request)) {
       // Send error response.
@@ -459,13 +459,13 @@
           new WebSocketException("Invalid WebSocket upgrade request"));
     }
 
-    Future<WebSocket> upgrade(String protocol) {
+    Future<WebSocket> upgrade(String? protocol) {
       // Send the upgrade response.
       response
         ..statusCode = HttpStatus.switchingProtocols
         ..headers.add(HttpHeaders.connectionHeader, "Upgrade")
         ..headers.add(HttpHeaders.upgradeHeader, "websocket");
-      String key = request.headers.value("Sec-WebSocket-Key");
+      String key = request.headers.value("Sec-WebSocket-Key")!;
       _SHA1 sha1 = new _SHA1();
       sha1.add("$key$_webSocketGUID".codeUnits);
       String accept = _CryptoUtils.bytesToBase64(sha1.close());
@@ -483,14 +483,14 @@
     }
 
     var protocols = request.headers['Sec-WebSocket-Protocol'];
-    if (protocols != null && _protocolSelector != null) {
+    if (protocols != null && protocolSelector != null) {
       // The suggested protocols can be spread over multiple lines, each
       // consisting of multiple protocols. To unify all of them, first join
       // the lists with ', ' and then tokenize.
-      protocols = _tokenizeFieldValue(protocols.join(', '));
-      return new Future<String>(() => _protocolSelector(protocols))
+      var tokenizedProtocols = _tokenizeFieldValue(protocols.join(', '));
+      return new Future<String>(() => protocolSelector(tokenizedProtocols))
           .then<String>((protocol) {
-        if (protocols.indexOf(protocol) < 0) {
+        if (tokenizedProtocols.indexOf(protocol) < 0) {
           throw new WebSocketException(
               "Selected protocol is not in the list of available protocols");
         }
@@ -506,7 +506,7 @@
     }
   }
 
-  static _WebSocketPerMessageDeflate _negotiateCompression(HttpRequest request,
+  static _WebSocketPerMessageDeflate? _negotiateCompression(HttpRequest request,
       HttpResponse response, CompressionOptions compression) {
     var extensionHeader = request.headers.value("Sec-WebSocket-Extensions");
 
@@ -540,23 +540,27 @@
     if (request.method != "GET") {
       return false;
     }
-    if (request.headers[HttpHeaders.connectionHeader] == null) {
+    var connectionHeader = request.headers[HttpHeaders.connectionHeader];
+    if (connectionHeader == null) {
       return false;
     }
     bool isUpgrade = false;
-    request.headers[HttpHeaders.connectionHeader].forEach((String value) {
-      if (value.toLowerCase() == "upgrade") isUpgrade = true;
-    });
+    for (var value in connectionHeader) {
+      if (value.toLowerCase() == "upgrade") {
+        isUpgrade = true;
+        break;
+      }
+    }
     if (!isUpgrade) return false;
-    String upgrade = request.headers.value(HttpHeaders.upgradeHeader);
+    String? upgrade = request.headers.value(HttpHeaders.upgradeHeader);
     if (upgrade == null || upgrade.toLowerCase() != "websocket") {
       return false;
     }
-    String version = request.headers.value("Sec-WebSocket-Version");
+    String? version = request.headers.value("Sec-WebSocket-Version");
     if (version == null || version != "13") {
       return false;
     }
-    String key = request.headers.value("Sec-WebSocket-Key");
+    String? key = request.headers.value("Sec-WebSocket-Key");
     if (key == null) {
       return false;
     }
@@ -571,34 +575,26 @@
   int serverMaxWindowBits;
   bool serverSide;
 
-  RawZLibFilter decoder;
-  RawZLibFilter encoder;
+  RawZLibFilter? decoder;
+  RawZLibFilter? encoder;
 
   _WebSocketPerMessageDeflate(
-      {this.clientMaxWindowBits: _WebSocketImpl.DEFAULT_WINDOW_BITS,
-      this.serverMaxWindowBits: _WebSocketImpl.DEFAULT_WINDOW_BITS,
-      this.serverNoContextTakeover: false,
-      this.clientNoContextTakeover: false,
-      this.serverSide: false});
+      {this.clientMaxWindowBits = _WebSocketImpl.DEFAULT_WINDOW_BITS,
+      this.serverMaxWindowBits = _WebSocketImpl.DEFAULT_WINDOW_BITS,
+      this.serverNoContextTakeover = false,
+      this.clientNoContextTakeover = false,
+      this.serverSide = false});
 
-  void _ensureDecoder() {
-    if (decoder == null) {
-      decoder = new RawZLibFilter.inflateFilter(
-          windowBits: serverSide ? clientMaxWindowBits : serverMaxWindowBits,
-          raw: true);
-    }
-  }
+  RawZLibFilter _ensureDecoder() => decoder ??= new RawZLibFilter.inflateFilter(
+      windowBits: serverSide ? clientMaxWindowBits : serverMaxWindowBits,
+      raw: true);
 
-  void _ensureEncoder() {
-    if (encoder == null) {
-      encoder = new RawZLibFilter.deflateFilter(
-          windowBits: serverSide ? serverMaxWindowBits : clientMaxWindowBits,
-          raw: true);
-    }
-  }
+  RawZLibFilter _ensureEncoder() => encoder ??= new RawZLibFilter.deflateFilter(
+      windowBits: serverSide ? serverMaxWindowBits : clientMaxWindowBits,
+      raw: true);
 
   Uint8List processIncomingMessage(List<int> msg) {
-    _ensureDecoder();
+    var decoder = _ensureDecoder();
 
     var data = <int>[];
     data.addAll(msg);
@@ -608,20 +604,22 @@
     final result = new BytesBuilder();
     List<int> out;
 
-    while ((out = decoder.processed()) != null) {
+    while (true) {
+      final out = decoder.processed();
+      if (out == null) break;
       result.add(out);
     }
 
     if ((serverSide && clientNoContextTakeover) ||
         (!serverSide && serverNoContextTakeover)) {
-      decoder = null;
+      this.decoder = null;
     }
 
     return result.takeBytes();
   }
 
   List<int> processOutgoingMessage(List<int> msg) {
-    _ensureEncoder();
+    var encoder = _ensureEncoder();
     var result = <int>[];
     Uint8List buffer;
 
@@ -639,14 +637,15 @@
 
     encoder.process(buffer, 0, buffer.length);
 
-    List<int> out;
-    while ((out = encoder.processed()) != null) {
+    while (true) {
+      final out = encoder.processed();
+      if (out == null) break;
       result.addAll(out);
     }
 
     if ((!serverSide && clientNoContextTakeover) ||
         (serverSide && serverNoContextTakeover)) {
-      encoder = null;
+      this.encoder = null;
     }
 
     if (result.length > 4) {
@@ -670,13 +669,12 @@
 class _WebSocketOutgoingTransformer
     extends StreamTransformerBase<dynamic, List<int>> implements EventSink {
   final _WebSocketImpl webSocket;
-  EventSink<List<int>> _eventSink;
+  EventSink<List<int>>? _eventSink;
 
-  _WebSocketPerMessageDeflate _deflateHelper;
+  _WebSocketPerMessageDeflate? _deflateHelper;
 
-  _WebSocketOutgoingTransformer(this.webSocket) {
-    _deflateHelper = webSocket._deflate;
-  }
+  _WebSocketOutgoingTransformer(this.webSocket)
+      : _deflateHelper = webSocket._deflate;
 
   Stream<List<int>> bind(Stream stream) {
     return new Stream<List<int>>.eventTransformed(stream,
@@ -698,53 +696,55 @@
       addFrame(_WebSocketOpcode.PING, message.payload);
       return;
     }
-    List<int> data;
+    List<int>? data;
     int opcode;
     if (message != null) {
+      List<int> messageData;
       if (message is String) {
         opcode = _WebSocketOpcode.TEXT;
-        data = utf8.encode(message);
+        messageData = utf8.encode(message);
       } else if (message is List<int>) {
         opcode = _WebSocketOpcode.BINARY;
-        data = message;
+        messageData = message;
       } else if (message is _EncodedString) {
         opcode = _WebSocketOpcode.TEXT;
-        data = message.bytes;
+        messageData = message.bytes;
       } else {
         throw new ArgumentError(message);
       }
-
-      if (_deflateHelper != null) {
-        data = _deflateHelper.processOutgoingMessage(data);
+      var deflateHelper = _deflateHelper;
+      if (deflateHelper != null) {
+        messageData = deflateHelper.processOutgoingMessage(messageData);
       }
+      data = messageData;
     } else {
       opcode = _WebSocketOpcode.TEXT;
     }
     addFrame(opcode, data);
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
-    _eventSink.addError(error, stackTrace);
+    _eventSink!.addError(error, stackTrace);
   }
 
   void close() {
-    int code = webSocket._outCloseCode;
-    String reason = webSocket._outCloseReason;
-    List<int> data;
+    int? code = webSocket._outCloseCode;
+    String? reason = webSocket._outCloseReason;
+    List<int>? data;
     if (code != null) {
-      data = new List<int>();
-      data.add((code >> 8) & 0xFF);
-      data.add(code & 0xFF);
-      if (reason != null) {
-        data.addAll(utf8.encode(reason));
-      }
+      data = [
+        (code >> 8) & 0xFF,
+        code & 0xFF,
+        if (reason != null) ...utf8.encode(reason)
+      ];
     }
     addFrame(_WebSocketOpcode.CLOSE, data);
-    _eventSink.close();
+    _eventSink!.close();
   }
 
-  void addFrame(int opcode, List<int> data) {
+  void addFrame(int opcode, List<int>? data) {
     createFrame(
             opcode,
             data,
@@ -753,12 +753,12 @@
                 (opcode == _WebSocketOpcode.TEXT ||
                     opcode == _WebSocketOpcode.BINARY))
         .forEach((e) {
-      _eventSink.add(e);
+      _eventSink!.add(e);
     });
   }
 
   static Iterable<List<int>> createFrame(
-      int opcode, List<int> data, bool serverSide, bool compressed) {
+      int opcode, List<int>? data, bool serverSide, bool compressed) {
     bool mask = !serverSide; // Masking not implemented for server.
     int dataLength = data == null ? 0 : data.length;
     // Determine the header size.
@@ -849,58 +849,59 @@
 class _WebSocketConsumer implements StreamConsumer {
   final _WebSocketImpl webSocket;
   final Socket socket;
-  StreamController _controller;
-  StreamSubscription _subscription;
+  StreamController? _controller;
+  StreamSubscription? _subscription;
   bool _issuedPause = false;
   bool _closed = false;
   Completer _closeCompleter = new Completer<WebSocket>();
-  Completer _completer;
+  Completer? _completer;
 
   _WebSocketConsumer(this.webSocket, this.socket);
 
   void _onListen() {
-    if (_subscription != null) {
-      _subscription.cancel();
-    }
+    _subscription?.cancel();
   }
 
   void _onPause() {
-    if (_subscription != null) {
-      _subscription.pause();
+    var subscription = _subscription;
+    if (subscription != null) {
+      subscription.pause();
     } else {
       _issuedPause = true;
     }
   }
 
   void _onResume() {
-    if (_subscription != null) {
-      _subscription.resume();
+    var subscription = _subscription;
+    if (subscription != null) {
+      subscription.resume();
     } else {
       _issuedPause = false;
     }
   }
 
   void _cancel() {
-    if (_subscription != null) {
-      var subscription = _subscription;
+    var subscription = _subscription;
+    if (subscription != null) {
       _subscription = null;
       subscription.cancel();
     }
   }
 
-  _ensureController() {
-    if (_controller != null) return;
-    _controller = new StreamController(
+  StreamController _ensureController() {
+    var controller = _controller;
+    if (controller != null) return controller;
+    controller = _controller = new StreamController(
         sync: true,
         onPause: _onPause,
         onResume: _onResume,
         onCancel: _onListen);
-    var stream = _controller.stream
+    var stream = controller.stream
         .transform(new _WebSocketOutgoingTransformer(webSocket));
     socket.addStream(stream).then((_) {
       _done();
       _closeCompleter.complete(webSocket);
-    }, onError: (error, StackTrace stackTrace) {
+    }, onError: (Object error, StackTrace stackTrace) {
       _closed = true;
       _cancel();
       if (error is ArgumentError) {
@@ -912,53 +913,52 @@
         _closeCompleter.complete(webSocket);
       }
     });
+    return controller;
   }
 
-  bool _done([error, StackTrace stackTrace]) {
-    if (_completer == null) return false;
+  bool _done([Object? error, StackTrace? stackTrace]) {
+    var completer = _completer;
+    if (completer == null) return false;
     if (error != null) {
-      _completer.completeError(error, stackTrace);
+      completer.completeError(error, stackTrace);
     } else {
-      _completer.complete(webSocket);
+      completer.complete(webSocket);
     }
     _completer = null;
     return true;
   }
 
-  Future addStream(var stream) {
+  Future addStream(Stream stream) {
     if (_closed) {
       stream.listen(null).cancel();
       return new Future.value(webSocket);
     }
     _ensureController();
-    _completer = new Completer();
-    _subscription = stream.listen((data) {
-      _controller.add(data);
+    var completer = _completer = new Completer();
+    var subscription = _subscription = stream.listen((data) {
+      _controller!.add(data);
     }, onDone: _done, onError: _done, cancelOnError: true);
     if (_issuedPause) {
-      _subscription.pause();
+      subscription.pause();
       _issuedPause = false;
     }
-    return _completer.future;
+    return completer.future;
   }
 
   Future close() {
-    _ensureController();
-    Future closeSocket() {
-      return socket.close().catchError((_) {}).then((_) => webSocket);
-    }
+    _ensureController().close();
 
-    _controller.close();
-    return _closeCompleter.future.then((_) => closeSocket());
+    return _closeCompleter.future
+        .then((_) => socket.close().catchError((_) {}).then((_) => webSocket));
   }
 
   void add(data) {
     if (_closed) return;
-    _ensureController();
+    var controller = _ensureController();
     // Stop sending message if _controller has been closed.
     // https://github.com/dart-lang/sdk/issues/37441
-    if (_controller.isClosed) return;
-    _controller.add(data);
+    if (controller.isClosed) return;
+    controller.add(data);
   }
 
   void closeSocket() {
@@ -974,32 +974,33 @@
   static const int DEFAULT_WINDOW_BITS = 15;
   static const String PER_MESSAGE_DEFLATE = "permessage-deflate";
 
-  final String protocol;
+  final String? protocol;
 
-  StreamController _controller;
-  StreamSubscription _subscription;
-  StreamSink _sink;
+  final StreamController _controller;
+  StreamSubscription? _subscription;
+  late StreamSink _sink;
 
-  final _socket;
+  final Socket _socket;
   final bool _serverSide;
   int _readyState = WebSocket.connecting;
   bool _writeClosed = false;
-  int _closeCode;
-  String _closeReason;
-  Duration _pingInterval;
-  Timer _pingTimer;
-  _WebSocketConsumer _consumer;
+  int? _closeCode;
+  String? _closeReason;
+  Duration? _pingInterval;
+  Timer? _pingTimer;
+  late _WebSocketConsumer _consumer;
 
-  int _outCloseCode;
-  String _outCloseReason;
-  Timer _closeTimer;
-  _WebSocketPerMessageDeflate _deflate;
+  int? _outCloseCode;
+  String? _outCloseReason;
+  Timer? _closeTimer;
+  _WebSocketPerMessageDeflate? _deflate;
 
   static final HttpClient _httpClient = new HttpClient();
 
   static Future<WebSocket> connect(
-      String url, Iterable<String> protocols, Map<String, dynamic> headers,
-      {CompressionOptions compression: CompressionOptions.compressionDefault}) {
+      String url, Iterable<String>? protocols, Map<String, dynamic>? headers,
+      {CompressionOptions compression =
+          CompressionOptions.compressionDefault}) {
     Uri uri = Uri.parse(url);
     if (uri.scheme != "ws" && uri.scheme != "wss") {
       throw new WebSocketException("Unsupported URL scheme '${uri.scheme}'");
@@ -1049,7 +1050,7 @@
 
       return request.close();
     }).then((response) {
-      void error(String message) {
+      Never error(String message) {
         // Flush data.
         response.detachSocket().then((socket) {
           socket.destroy();
@@ -1057,15 +1058,15 @@
         throw new WebSocketException(message);
       }
 
+      var connectionHeader = response.headers[HttpHeaders.connectionHeader];
       if (response.statusCode != HttpStatus.switchingProtocols ||
-          response.headers[HttpHeaders.connectionHeader] == null ||
-          !response.headers[HttpHeaders.connectionHeader]
-              .any((value) => value.toLowerCase() == "upgrade") ||
-          response.headers.value(HttpHeaders.upgradeHeader).toLowerCase() !=
+          connectionHeader == null ||
+          !connectionHeader.any((value) => value.toLowerCase() == "upgrade") ||
+          response.headers.value(HttpHeaders.upgradeHeader)!.toLowerCase() !=
               "websocket") {
         error("Connection to '$uri' was not upgraded to websocket");
       }
-      String accept = response.headers.value("Sec-WebSocket-Accept");
+      String? accept = response.headers.value("Sec-WebSocket-Accept");
       if (accept == null) {
         error("Response did not contain a 'Sec-WebSocket-Accept' header");
       }
@@ -1083,7 +1084,7 @@
       }
       var protocol = response.headers.value('Sec-WebSocket-Protocol');
 
-      _WebSocketPerMessageDeflate deflate =
+      _WebSocketPerMessageDeflate? deflate =
           negotiateClientCompression(response, compression);
 
       return response.detachSocket().then<WebSocket>((socket) =>
@@ -1092,13 +1093,10 @@
     });
   }
 
-  static _WebSocketPerMessageDeflate negotiateClientCompression(
+  static _WebSocketPerMessageDeflate? negotiateClientCompression(
       HttpClientResponse response, CompressionOptions compression) {
-    String extensionHeader = response.headers.value('Sec-WebSocket-Extensions');
-
-    if (extensionHeader == null) {
-      extensionHeader = "";
-    }
+    String extensionHeader =
+        response.headers.value('Sec-WebSocket-Extensions') ?? "";
 
     var hv = HeaderValue.parse(extensionHeader, valueSeparator: ',');
 
@@ -1129,14 +1127,15 @@
 
   _WebSocketImpl._fromSocket(
       this._socket, this.protocol, CompressionOptions compression,
-      [this._serverSide = false, _WebSocketPerMessageDeflate deflate]) {
+      [this._serverSide = false, _WebSocketPerMessageDeflate? deflate])
+      : _controller = new StreamController(sync: true) {
     _consumer = new _WebSocketConsumer(this, _socket);
     _sink = new _StreamSinkImpl(_consumer);
     _readyState = WebSocket.open;
     _deflate = deflate;
 
-    var transformer = new _WebSocketProtocolTransformer(_serverSide, _deflate);
-    _subscription = transformer.bind(_socket).listen((data) {
+    var transformer = new _WebSocketProtocolTransformer(_serverSide, deflate);
+    var subscription = _subscription = transformer.bind(_socket).listen((data) {
       if (data is _WebSocketPing) {
         if (!_writeClosed) _consumer.add(new _WebSocketPong(data.payload));
       } else if (data is _WebSocketPong) {
@@ -1145,8 +1144,8 @@
       } else {
         _controller.add(data);
       }
-    }, onError: (error, stackTrace) {
-      if (_closeTimer != null) _closeTimer.cancel();
+    }, onError: (Object error, StackTrace stackTrace) {
+      _closeTimer?.cancel();
       if (error is FormatException) {
         _close(WebSocketStatus.invalidFramePayloadData);
       } else {
@@ -1157,7 +1156,7 @@
       _closeReason = _outCloseReason;
       _controller.close();
     }, onDone: () {
-      if (_closeTimer != null) _closeTimer.cancel();
+      _closeTimer?.cancel();
       if (_readyState == WebSocket.open) {
         _readyState = WebSocket.closing;
         if (!_isReservedStatusCode(transformer.closeCode)) {
@@ -1172,39 +1171,38 @@
       _closeReason = transformer.closeReason;
       _controller.close();
     }, cancelOnError: true);
-    _subscription.pause();
-    _controller = new StreamController(
-        sync: true,
-        onListen: _subscription.resume,
-        onCancel: () {
-          _subscription.cancel();
-          _subscription = null;
-        },
-        onPause: _subscription.pause,
-        onResume: _subscription.resume);
+    subscription.pause();
+    _controller
+      ..onListen = subscription.resume
+      ..onCancel = () {
+        _subscription!.cancel();
+        _subscription = null;
+      }
+      ..onPause = subscription.pause
+      ..onResume = subscription.resume;
 
     _webSockets[_serviceId] = this;
   }
 
-  StreamSubscription listen(void onData(message),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription listen(void onData(message)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
-  Duration get pingInterval => _pingInterval;
+  Duration? get pingInterval => _pingInterval;
 
-  void set pingInterval(Duration interval) {
+  void set pingInterval(Duration? interval) {
     if (_writeClosed) return;
-    if (_pingTimer != null) _pingTimer.cancel();
+    _pingTimer?.cancel();
     _pingInterval = interval;
 
-    if (_pingInterval == null) return;
+    if (interval == null) return;
 
-    _pingTimer = new Timer(_pingInterval, () {
+    _pingTimer = new Timer(interval, () {
       if (_writeClosed) return;
       _consumer.add(new _WebSocketPing());
-      _pingTimer = new Timer(_pingInterval, () {
+      _pingTimer = new Timer(interval, () {
         _closeTimer?.cancel();
         // No pong received.
         _close(WebSocketStatus.goingAway);
@@ -1217,27 +1215,28 @@
 
   int get readyState => _readyState;
 
-  String get extensions => null;
-  int get closeCode => _closeCode;
-  String get closeReason => _closeReason;
+  String get extensions => "";
+  int? get closeCode => _closeCode;
+  String? get closeReason => _closeReason;
 
   void add(data) {
     _sink.add(data);
   }
 
   void addUtf8Text(List<int> bytes) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(bytes, "bytes");
     _sink.add(new _EncodedString(bytes));
   }
 
-  void addError(error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
     _sink.addError(error, stackTrace);
   }
 
   Future addStream(Stream stream) => _sink.addStream(stream);
   Future get done => _sink.done;
 
-  Future close([int code, String reason]) {
+  Future close([int? code, String? reason]) {
     if (_isReservedStatusCode(code)) {
       throw new WebSocketException("Reserved status code $code");
     }
@@ -1260,7 +1259,7 @@
           // Reuse code and reason from the local close.
           _closeCode = _outCloseCode;
           _closeReason = _outCloseReason;
-          if (_subscription != null) _subscription.cancel();
+          _subscription?.cancel();
           _controller.close();
           _webSockets.remove(_serviceId);
         });
@@ -1269,13 +1268,13 @@
     return _sink.close();
   }
 
-  static String get userAgent => _httpClient.userAgent;
+  static String? get userAgent => _httpClient.userAgent;
 
-  static set userAgent(String userAgent) {
+  static set userAgent(String? userAgent) {
     _httpClient.userAgent = userAgent;
   }
 
-  void _close([int code, String reason]) {
+  void _close([int? code, String? reason]) {
     if (_writeClosed) return;
     if (_outCloseCode == null) {
       _outCloseCode = code;
@@ -1301,7 +1300,7 @@
       return r;
     }
     try {
-      r['socket'] = _socket._toJSON(true);
+      r['socket'] = (_socket as dynamic)._toJSON(true);
     } catch (_) {
       r['socket'] = {
         'id': _servicePath,
@@ -1313,7 +1312,7 @@
     return r;
   }
 
-  static bool _isReservedStatusCode(int code) {
+  static bool _isReservedStatusCode(int? code) {
     return code != null &&
         (code < WebSocketStatus.normalClosure ||
             code == WebSocketStatus.reserved1004 ||
diff --git a/sdk_nnbd/lib/_internal/allowed_experiments.json b/sdk/lib/_internal/allowed_experiments.json
similarity index 100%
rename from sdk_nnbd/lib/_internal/allowed_experiments.json
rename to sdk/lib/_internal/allowed_experiments.json
diff --git a/sdk/lib/_internal/js_dev_runtime/libraries.dart b/sdk/lib/_internal/js_dev_runtime/libraries.dart
deleted file mode 100644
index 88b2efa..0000000
--- a/sdk/lib/_internal/js_dev_runtime/libraries.dart
+++ /dev/null
@@ -1,313 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// @dart = 2.6
-
-library libraries;
-
-/**
- * A bit flag used by [LibraryInfo] indicating that a library is used by dart2js
- */
-const int DART2JS_PLATFORM = 1;
-
-/**
- * A bit flag used by [LibraryInfo] indicating that a library is used by the VM
- */
-const int VM_PLATFORM = 2;
-
-/// The contexts that a library can be used from.
-enum Category {
-  /// Indicates that a library can be used in a browser context.
-  client,
-
-  /// Indicates that a library can be used in a command line context.
-  server,
-
-  /// Indicates that a library can be used from embedded devices.
-  embedded
-}
-
-Category parseCategory(String name) {
-  switch (name) {
-    case "Client":
-      return Category.client;
-    case "Server":
-      return Category.server;
-    case "Embedded":
-      return Category.embedded;
-  }
-  return null;
-}
-
-/// Mapping of "dart:" library name (e.g. "core") to information about that
-/// library.
-const Map<String, LibraryInfo> libraries = const {
-  "async": const LibraryInfo("async/async.dart",
-      categories: "Client,Server",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/async_patch.dart"),
-  "collection": const LibraryInfo("collection/collection.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/collection_patch.dart"),
-  "convert": const LibraryInfo("convert/convert.dart",
-      categories: "Client,Server",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/convert_patch.dart"),
-  "core": const LibraryInfo("core/core.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/core_patch.dart"),
-  "developer": const LibraryInfo("developer/developer.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.UNSTABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"),
-  "html": const LibraryInfo("html/dart2js/html_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "html_common": const LibraryInfo("html/html_common/html_common.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      dart2jsPath: "html/html_common/html_common_dart2js.dart",
-      documented: false,
-      implementation: true),
-  "indexed_db": const LibraryInfo("indexed_db/dart2js/indexed_db_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "_http":
-      const LibraryInfo("_http/http.dart", categories: "", documented: false),
-  "io": const LibraryInfo("io/io.dart",
-      categories: "Server",
-      dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"),
-  "isolate": const LibraryInfo("isolate/isolate.dart",
-      categories: "Client,Server",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"),
-  "js": const LibraryInfo("js/js.dart",
-      categories: "Client",
-      maturity: Maturity.STABLE,
-      platforms: DART2JS_PLATFORM,
-      dart2jsPatchPath: "_internal/js_runtime/lib/js_patch.dart"),
-  "js_util": const LibraryInfo("js_util/js_util.dart",
-      categories: "Client",
-      maturity: Maturity.STABLE,
-      platforms: DART2JS_PLATFORM),
-  "math": const LibraryInfo("math/math.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/math_patch.dart"),
-  "mirrors": const LibraryInfo("mirrors/mirrors.dart",
-      categories: "Client,Server",
-      maturity: Maturity.UNSTABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/mirrors_patch.dart"),
-  "nativewrappers": const LibraryInfo("html/dartium/nativewrappers.dart",
-      categories: "Client",
-      implementation: true,
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "typed_data": const LibraryInfo("typed_data/typed_data.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/typed_data_patch.dart"),
-  "_native_typed_data": const LibraryInfo(
-      "_internal/js_runtime/lib/native_typed_data.dart",
-      categories: "",
-      implementation: true,
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "cli": const LibraryInfo("cli/cli.dart",
-      categories: "Server",
-      dart2jsPatchPath: "_internal/js_runtime/lib/cli_patch.dart"),
-  "svg": const LibraryInfo("svg/dart2js/svg_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "web_audio": const LibraryInfo("web_audio/dart2js/web_audio_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "web_gl": const LibraryInfo("web_gl/dart2js/web_gl_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "web_sql": const LibraryInfo("web_sql/dart2js/web_sql_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "_internal": const LibraryInfo("internal/internal.dart",
-      categories: "",
-      documented: false,
-      dart2jsPatchPath: "_internal/js_runtime/lib/internal_patch.dart"),
-  "_js_helper": const LibraryInfo("_internal/js_runtime/lib/js_helper.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_interceptors": const LibraryInfo(
-      "_internal/js_runtime/lib/interceptors.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_foreign_helper": const LibraryInfo(
-      "_internal/js_runtime/lib/foreign_helper.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_isolate_helper": const LibraryInfo(
-      "_internal/js_runtime/lib/isolate_helper.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_js_mirrors": const LibraryInfo("_internal/js_runtime/lib/js_mirrors.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_js_primitives": const LibraryInfo(
-      "_internal/js_runtime/lib/js_primitives.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_metadata": const LibraryInfo("html/html_common/metadata.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_debugger": const LibraryInfo("_internal/js_runtime/lib/debugger.dart",
-      category: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_runtime": const LibraryInfo(
-      "_internal/js_runtime/lib/ddc_runtime/runtime.dart",
-      category: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-};
-
-/**
- * Information about a "dart:" library.
- */
-class LibraryInfo {
-  /**
-   * Path to the library's *.dart file relative to this file.
-   */
-  final String path;
-
-  /**
-   * The categories in which the library can be used encoded as a
-   * comma-separated String.
-   */
-  final String _categories;
-
-  /**
-   * Path to the dart2js library's *.dart file relative to this file
-   * or null if dart2js uses the common library path defined above.
-   * Access using the [#getDart2JsPath()] method.
-   */
-  final String dart2jsPath;
-
-  /**
-   * Path to the dart2js library's patch file relative to this file
-   * or null if no dart2js patch file associated with this library.
-   * Access using the [#getDart2JsPatchPath()] method.
-   */
-  final String dart2jsPatchPath;
-
-  /**
-   * True if this library is documented and should be shown to the user.
-   */
-  final bool documented;
-
-  /**
-   * Bit flags indicating which platforms consume this library.
-   * See [DART2JS_LIBRARY] and [VM_LIBRARY].
-   */
-  final int platforms;
-
-  /**
-   * True if the library contains implementation details for another library.
-   * The implication is that these libraries are less commonly used
-   * and that tools like Dart Editor should not show these libraries
-   * in a list of all libraries unless the user specifically asks the tool to
-   * do so.
-   */
-  final bool implementation;
-
-  /**
-   * States the current maturity of this library.
-   */
-  final Maturity maturity;
-
-  const LibraryInfo(this.path,
-      {String categories: "",
-      this.dart2jsPath,
-      this.dart2jsPatchPath,
-      this.implementation: false,
-      this.documented: true,
-      this.maturity: Maturity.UNSPECIFIED,
-      this.platforms: DART2JS_PLATFORM | VM_PLATFORM})
-      : _categories = categories;
-
-  bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0;
-  bool get isVmLibrary => (platforms & VM_PLATFORM) != 0;
-
-  /**
-   * The categories in which the library can be used.
-   *
-   * If no categories are specified, the library is internal and can not be
-   * loaded by user code.
-   */
-  List<Category> get categories {
-    // `"".split(,)` returns [""] not [], so we handle that case separately.
-    if (_categories == "") return const <Category>[];
-    return _categories.split(",").map(parseCategory).toList();
-  }
-
-  bool get isInternal => categories.isEmpty;
-
-  /// The original "categories" String that was passed to the constructor.
-  ///
-  /// Can be used to construct a slightly modified copy of this LibraryInfo.
-  String get categoriesString {
-    return _categories;
-  }
-}
-
-/**
- * Abstraction to capture the maturity of a library.
- */
-class Maturity {
-  final int level;
-  final String name;
-  final String description;
-
-  const Maturity(this.level, this.name, this.description);
-
-  String toString() => "$name: $level\n$description\n";
-
-  static const Maturity DEPRECATED = const Maturity(0, "Deprecated",
-      "This library will be remove before next major release.");
-
-  static const Maturity EXPERIMENTAL = const Maturity(
-      1,
-      "Experimental",
-      "This library is experimental and will likely change or be removed\n"
-          "in future versions.");
-
-  static const Maturity UNSTABLE = const Maturity(
-      2,
-      "Unstable",
-      "This library is in still changing and have not yet endured\n"
-          "sufficient real-world testing.\n"
-          "Backwards-compatibility is NOT guaranteed.");
-
-  static const Maturity WEB_STABLE = const Maturity(
-      3,
-      "Web Stable",
-      "This library is tracking the DOM evolution as defined by WC3.\n"
-          "Backwards-compatibility is NOT guaranteed.");
-
-  static const Maturity STABLE = const Maturity(
-      4,
-      "Stable",
-      "The library is stable. API backwards-compatibility is guaranteed.\n"
-          "However implementation details might change.");
-
-  static const Maturity LOCKED = const Maturity(5, "Locked",
-      "This library will not change except when serious bugs are encountered.");
-
-  static const Maturity UNSPECIFIED = const Maturity(-1, "Unspecified",
-      "The maturity for this library has not been specified.");
-}
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
index ab50223..b80c74e 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/async_patch.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.6
-
 // Patch file for the dart:async library.
 
 import 'dart:_js_helper' show notNull, patch, ReifyFunctionTypes;
@@ -26,11 +24,11 @@
 @ReifyFunctionTypes(false)
 _async<T>(Function() initGenerator) {
   var iter;
-  Object Function(Object) onValue;
-  Object Function(Object, StackTrace) onError;
+  late Object? Function(Object?) onValue;
+  late Object Function(Object, StackTrace?) onError;
 
-  onAwait(Object value) {
-    _Future f;
+  onAwait(Object? value) {
+    _Future<Object?> f;
     if (value is _Future) {
       f = value;
     } else if (value is Future) {
@@ -161,7 +159,7 @@
   }
 
   @ReifyFunctionTypes(false)
-  static Object _scheduleImmediateWithPromise(void Function() callback) {
+  static void _scheduleImmediateWithPromise(void Function() callback) {
     dart.addAsyncCallback();
     JS('', '#.Promise.resolve(null).then(#)', dart.global_, () {
       dart.removeAsyncCallback();
@@ -182,7 +180,7 @@
 @patch
 class Timer {
   @patch
-  static Timer _createTimer(Duration duration, void callback()) {
+  static Timer _createTimer(Duration duration, void Function() callback) {
     int milliseconds = duration.inMilliseconds;
     if (milliseconds < 0) milliseconds = 0;
     return TimerImpl(milliseconds, callback);
@@ -228,7 +226,7 @@
 ///     }
 ///
 class _AsyncStarImpl<T> {
-  StreamController<T> controller;
+  late StreamController<T> controller;
   Object Function(_AsyncStarImpl<T>) initGenerator;
   @notNull
   bool isSuspendedAtYieldStar = false;
@@ -243,11 +241,11 @@
   @notNull
   bool isSuspendedAtAwait = false;
 
-  Completer cancellationCompleter;
-  Object jsIterator;
+  Completer? cancellationCompleter;
+  late Object jsIterator;
 
-  Null Function(Object, StackTrace) _handleErrorCallback;
-  void Function([Object]) _runBodyCallback;
+  Null Function(Object, StackTrace)? _handleErrorCallback;
+  void Function([Object?])? _runBodyCallback;
 
   _AsyncStarImpl(this.initGenerator) {
     controller = StreamController(
@@ -293,10 +291,10 @@
       };
       var zone = Zone.current;
       if (!identical(zone, Zone.root)) {
-        _handleErrorCallback = zone.bindBinaryCallback(_handleErrorCallback);
+        _handleErrorCallback = zone.bindBinaryCallback(_handleErrorCallback!);
       }
     }
-    return _handleErrorCallback;
+    return _handleErrorCallback!;
   }
 
   void scheduleGenerator() {
@@ -315,11 +313,11 @@
     if (_runBodyCallback == null) {
       _runBodyCallback = JS('!', '#.bind(this)', runBody);
       if (!identical(zone, Zone.root)) {
-        var registered = zone.registerUnaryCallback(_runBodyCallback);
+        var registered = zone.registerUnaryCallback(_runBodyCallback!);
         _runBodyCallback = ([arg]) => zone.runUnaryGuarded(registered, arg);
       }
     }
-    zone.scheduleMicrotask(_runBodyCallback);
+    zone.scheduleMicrotask(_runBodyCallback!);
   }
 
   void runBody(awaitValue) {
@@ -332,16 +330,16 @@
       iterResult = JS('', '#.next(#)', jsIterator, awaitValue);
     } catch (e, s) {
       addError(e, s);
-      return null;
+      return;
     }
 
     if (JS('!', '#.done', iterResult)) {
       close();
-      return null;
+      return;
     }
 
     // If we're suspended at a yield/yield*, we're done for now.
-    if (isSuspendedAtYield || isSuspendedAtYieldStar) return null;
+    if (isSuspendedAtYield || isSuspendedAtYieldStar) return;
 
     // Handle `await`: if we get a value passed to `yield` it means we are
     // waiting on this Future. Make sure to prevent scheduling, and pass the
@@ -350,10 +348,10 @@
     // TODO(jmesserly): is the timing here correct? The assumption here is
     // that we should schedule `await` in `async*` the same as in `async`.
     isSuspendedAtAwait = true;
-    FutureOr<Object> value = JS('', '#.value', iterResult);
+    FutureOr<Object?> value = JS('', '#.value', iterResult);
 
     // TODO(jmesserly): this logic was copied from `async` function impl.
-    _Future f;
+    _Future<Object?> f;
     if (value is _Future) {
       f = value;
     } else if (value is Future) {
@@ -362,7 +360,7 @@
     } else {
       f = _Future.value(value);
     }
-    f._thenAwait(_runBodyCallback, handleError);
+    f._thenAwait(_runBodyCallback!, handleError);
   }
 
   /// Adds element to [stream] and returns true if the caller should terminate
@@ -417,10 +415,11 @@
 
   void addError(Object error, StackTrace stackTrace) {
     ArgumentError.checkNotNull(error, "error");
-    if (cancellationCompleter != null && !cancellationCompleter.isCompleted) {
+    var completer = cancellationCompleter;
+    if (completer != null && !completer.isCompleted) {
       // If the stream has been cancelled, complete the cancellation future
       // with the error.
-      cancellationCompleter.completeError(error, stackTrace);
+      completer.completeError(error, stackTrace);
     } else if (controller.hasListener) {
       controller.addError(error, stackTrace);
     }
@@ -432,10 +431,11 @@
   }
 
   void close() {
-    if (cancellationCompleter != null && !cancellationCompleter.isCompleted) {
+    var completer = cancellationCompleter;
+    if (completer != null && !completer.isCompleted) {
       // If the stream has been cancelled, complete the cancellation future
       // with the error.
-      cancellationCompleter.complete();
+      completer.complete();
     }
     controller.close();
   }
@@ -465,7 +465,7 @@
         scheduleGenerator();
       }
     }
-    return cancellationCompleter.future;
+    return cancellationCompleter!.future;
   }
 
   _fatal(String message) => throw StateError(message);
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart
index f0f7c9b..d9709b9 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/collection_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/collection_patch.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.6
-
 // Patch file for dart:collection classes.
 import 'dart:_foreign_helper' show JS, JSExportName;
 import 'dart:_runtime' as dart;
@@ -26,9 +24,9 @@
 class HashMap<K, V> {
   @patch
   factory HashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(Object potentialKey)}) {
+      {bool Function(K, K)? equals,
+      int Function(K)? hashCode,
+      bool Function(dynamic)? isValidKey}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -56,9 +54,9 @@
 class LinkedHashMap<K, V> {
   @patch
   factory LinkedHashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(Object potentialKey)}) {
+      {bool Function(K, K)? equals,
+      int Function(K)? hashCode,
+      bool Function(dynamic)? isValidKey}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -86,9 +84,9 @@
 class HashSet<E> {
   @patch
   factory HashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(Object potentialKey)}) {
+      {bool Function(E, E)? equals,
+      int Function(E)? hashCode,
+      bool Function(dynamic)? isValidKey}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -97,7 +95,6 @@
           }
           return _HashSet<E>();
         }
-        hashCode = dart.hashCode;
       } else if (identical(identityHashCode, hashCode) &&
           identical(identical, equals)) {
         return _IdentityHashSet<E>();
@@ -117,9 +114,9 @@
 class LinkedHashSet<E> {
   @patch
   factory LinkedHashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(Object potentialKey)}) {
+      {bool Function(E, E)? equals,
+      int Function(E)? hashCode,
+      bool Function(dynamic)? isValidKey}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -133,8 +130,7 @@
           identical(identical, equals)) {
         return _IdentityHashSet<E>();
       }
-      return _CustomHashSet<E>(
-          equals ?? dart.equals, hashCode ?? dart.hashCode);
+      return _CustomHashSet<E>(equals ?? dart.equals, hashCode);
     }
     return _CustomKeyHashSet<E>(
         equals ?? dart.equals, hashCode ?? dart.hashCode, isValidKey);
@@ -180,13 +176,14 @@
 
   Set<R> _newSimilarSet<R>() => _HashSet<R>();
 
-  bool contains(Object key) {
+  bool contains(Object? key) {
     if (key == null) {
+      // Convert undefined to null, if needed.
       key = null;
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
       @notNull
-      var k = key;
+      Object? k = key;
       var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
       if (buckets != null) {
         for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
@@ -199,12 +196,12 @@
     return JS<bool>('!', '#.has(#)', _map, key);
   }
 
-  E lookup(Object key) {
+  E? lookup(Object? key) {
     if (key == null) return null;
     if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
       @notNull
-      var k = key;
+      Object? k = key;
       var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
       if (buckets != null) {
         for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
@@ -221,7 +218,8 @@
     var map = _map;
     if (key == null) {
       if (JS('', '#.has(null)', map)) return false;
-      key = null;
+      // Convert undefined to null, if needed.
+      JS('', '# = null', key);
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
       var keyMap = _keyMap;
@@ -251,7 +249,8 @@
     int length = JS('', '#.size', map);
     for (E key in objects) {
       if (key == null) {
-        key = null; // converts undefined to null, if needed.
+        // Convert undefined to null, if needed.
+        JS('', '# = null', key);
       } else if (JS<bool>('!', '#[#] !== #', key,
           dart.extensionSymbol('_equals'), dart.identityEquals)) {
         key = putLinkedMapKey(key, _keyMap);
@@ -263,13 +262,14 @@
     }
   }
 
-  bool remove(Object key) {
+  bool remove(Object? key) {
     if (key == null) {
+      // Convert undefined to null, if needed.
       key = null;
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
       @notNull
-      var k = key;
+      Object? k = key;
       int hash = JS('!', '# & 0x3ffffff', k.hashCode);
       var buckets = JS('', '#.get(#)', _keyMap, hash);
       if (buckets == null) return false; // not found
@@ -311,7 +311,8 @@
     var map = _map;
     for (Object key in entries) {
       if (key == null) {
-        key = null; // converts undefined to null, if needed.
+        // Convert undefined to null, if needed.
+        JS('', '# = null', key);
       } else if (JS<bool>('!', '#[#] !== #', key,
           dart.extensionSymbol('_equals'), dart.identityEquals)) {
         key = putLinkedMapKey(key, _keyMap);
@@ -320,10 +321,10 @@
     }
   }
 
-  bool add(Object other) => throw _unsupported();
-  void addAll(Object other) => throw _unsupported();
+  bool add(E value) => throw _unsupported();
+  void addAll(Iterable<E> elements) => throw _unsupported();
   void clear() => throw _unsupported();
-  bool remove(Object key) => throw _unsupported();
+  bool remove(Object? value) => throw _unsupported();
 
   static Error _unsupported() =>
       UnsupportedError("Cannot modify unmodifiable set");
@@ -344,12 +345,14 @@
 
   Set<R> _newSimilarSet<R>() => _IdentityHashSet<R>();
 
-  bool contains(Object element) {
-    return JS('', '#.has(#)', _map, element);
+  bool contains(Object? element) {
+    return JS<bool>('!', '#.has(#)', _map, element);
   }
 
-  E lookup(Object element) {
-    return JS('', '#.has(#)', _map, element) ? element : null;
+  E? lookup(Object? element) {
+    return element is E && JS<bool>('!', '#.has(#)', _map, element)
+        ? element
+        : null;
   }
 
   bool add(E element) {
@@ -371,7 +374,7 @@
     }
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     if (JS<bool>('!', '#.delete(#)', _map, element)) {
       _modifications = (_modifications + 1) & 0x3ffffff;
       return true;
@@ -389,7 +392,7 @@
 }
 
 class _CustomKeyHashSet<E> extends _CustomHashSet<E> {
-  _Predicate<Object> _validKey;
+  _Predicate<Object?> _validKey;
   _CustomKeyHashSet(_Equality<E> equals, _Hasher<E> hashCode, this._validKey)
       : super(equals, hashCode);
 
@@ -397,7 +400,7 @@
 
   Set<R> _newSimilarSet<R>() => _HashSet<R>();
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     // TODO(jmesserly): there is a subtle difference here compared to Dart 1.
     // See the comment on CustomKeyHashMap.containsKey for more information.
     // Treatment of `null` is different due to strong mode's requirement to
@@ -406,12 +409,12 @@
     return super.contains(element);
   }
 
-  E lookup(Object element) {
+  E? lookup(Object? element) {
     if (!_validKey(element)) return null;
     return super.lookup(element);
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     if (!_validKey(element)) return false;
     return super.remove(element);
   }
@@ -447,7 +450,7 @@
   Set<E> _newSet() => _CustomHashSet<E>(_equals, _hashCode);
   Set<R> _newSimilarSet<R>() => _HashSet<R>();
 
-  bool contains(Object key) {
+  bool contains(Object? key) {
     if (key is E) {
       var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
       if (buckets != null) {
@@ -461,7 +464,7 @@
     return false;
   }
 
-  E lookup(Object key) {
+  E? lookup(Object? key) {
     if (key is E) {
       var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
       if (buckets != null) {
@@ -499,7 +502,7 @@
     for (E element in objects) add(element);
   }
 
-  bool remove(Object key) {
+  bool remove(Object? key) {
     if (key is E) {
       var hash = JS<int>('!', '# & 0x3ffffff', _hashCode(key));
       var keyMap = _keyMap;
@@ -575,30 +578,3 @@
         iterator);
   }
 }
-
-@patch
-abstract class _SplayTree<K, Node extends _SplayTreeNode<K>> {
-  @patch
-  Node _splayMin(Node node) {
-    Node current = node;
-    while (current.left != null) {
-      Node left = current.left;
-      current.left = left.right;
-      left.right = current;
-      current = left;
-    }
-    return current;
-  }
-
-  @patch
-  Node _splayMax(Node node) {
-    Node current = node;
-    while (current.right != null) {
-      Node right = current.right;
-      current.right = right.left;
-      right.left = current;
-      current = right;
-    }
-    return current;
-  }
-}
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart
index ad45663..c86dab0 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart
@@ -2,15 +2,13 @@
 // 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.6
-
 // Patch file for dart:convert library.
 
 import 'dart:_js_helper' show argumentErrorValue, patch;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show JSExtendableArray;
 import 'dart:_internal' show MappedIterable, ListIterable;
-import 'dart:collection' show Maps, LinkedHashMap, MapBase;
+import 'dart:collection' show LinkedHashMap, MapBase;
 import 'dart:_native_typed_data' show NativeUint8List;
 
 /**
@@ -30,7 +28,7 @@
  * Throws [FormatException] if the input is not valid JSON text.
  */
 @patch
-_parseJson(String source, reviver(Object key, Object value)) {
+_parseJson(String source, reviver(key, value)?) {
   if (source is! String) throw argumentErrorValue(source);
 
   var parsed;
@@ -53,8 +51,7 @@
  * Maps. [json] is expected to be freshly allocated so elements can be replaced
  * in-place.
  */
-_convertJsonToDart(json, reviver(Object key, Object value)) {
-  assert(reviver != null);
+_convertJsonToDart(json, reviver(Object? key, Object? value)) {
   walk(e) {
     // JavaScript null, string, number, bool are in the correct representation.
     if (JS<bool>('!', '# == null', e) ||
@@ -214,7 +211,7 @@
     return value;
   }
 
-  remove(Object key) {
+  remove(Object? key) {
     if (!_isUpgraded && !containsKey(key)) return null;
     return _upgrade().remove(key);
   }
@@ -275,7 +272,7 @@
 
   List<String> _computeKeys() {
     assert(!_isUpgraded);
-    List keys = _data;
+    List? keys = _data;
     if (keys == null) {
       keys = _data = _getPropertyNames(_original);
     }
@@ -298,7 +295,7 @@
     // safely force a concurrent modification error in case
     // someone is iterating over the map here.
     if (keys.isEmpty) {
-      keys.add(null);
+      keys.add("");
     } else {
       keys.clear();
     }
@@ -357,13 +354,13 @@
 
   /// Delegate to [parent.containsKey] to ensure the performance expected
   /// from [Map.keys.containsKey].
-  bool contains(Object key) => _parent.containsKey(key);
+  bool contains(Object? key) => _parent.containsKey(key);
 }
 
 @patch
 class JsonDecoder {
   @patch
-  StringConversionSink startChunkedConversion(Sink<Object> sink) {
+  StringConversionSink startChunkedConversion(Sink<Object?> sink) {
     return _JsonDecoderSink(_reviver, sink);
   }
 }
@@ -375,18 +372,17 @@
  * The sink only creates one object, but its input can be chunked.
  */
 // TODO(floitsch): don't accumulate everything before starting to decode.
-class _JsonDecoderSink extends _StringSinkConversionSink {
-  final Function(Object key, Object value) _reviver;
-  final Sink<Object> _sink;
+class _JsonDecoderSink extends _StringSinkConversionSink<StringBuffer> {
+  final Object? Function(Object? key, Object? value)? _reviver;
+  final Sink<Object?> _sink;
 
   _JsonDecoderSink(this._reviver, this._sink) : super(StringBuffer(''));
 
   void close() {
     super.close();
-    StringBuffer buffer = _stringSink;
-    String accumulated = buffer.toString();
-    buffer.clear();
-    Object decoded = _parseJson(accumulated, _reviver);
+    String accumulated = _stringSink.toString();
+    _stringSink.clear();
+    Object? decoded = _parseJson(accumulated, _reviver);
     _sink.add(decoded);
     _sink.close();
   }
@@ -405,8 +401,8 @@
 
   // Currently not intercepting UTF8 decoding.
   @patch
-  static String _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int end) {
+  static String? _convertIntercepted(
+      bool allowMalformed, List<int> codeUnits, int start, int? end) {
     // Test `codeUnits is NativeUint8List`. Dart's NativeUint8List is
     // implemented by JavaScript's Uint8Array.
     if (JS<bool>('!', '# instanceof Uint8Array', codeUnits)) {
@@ -417,7 +413,7 @@
       if (end - start < _shortInputThreshold) {
         return null;
       }
-      String result =
+      String? result =
           _convertInterceptedUint8List(allowMalformed, casted, start, end);
       if (result != null && allowMalformed) {
         // In principle, TextDecoder should have provided the correct result
@@ -433,7 +429,7 @@
     return null; // This call was not intercepted.
   }
 
-  static String _convertInterceptedUint8List(
+  static String? _convertInterceptedUint8List(
       bool allowMalformed, NativeUint8List codeUnits, int start, int end) {
     final decoder = allowMalformed ? _decoderNonfatal : _decoder;
     if (decoder == null) return null;
@@ -448,7 +444,7 @@
         JS<NativeUint8List>('!', '#.subarray(#, #)', codeUnits, start, end));
   }
 
-  static String _useTextDecoder(decoder, NativeUint8List codeUnits) {
+  static String? _useTextDecoder(decoder, NativeUint8List codeUnits) {
     // If the input is malformed, catch the exception and return `null` to fall
     // back on unintercepted decoder. The fallback will either succeed in
     // decoding, or report the problem better than TextDecoder.
@@ -480,12 +476,12 @@
   _Utf8Decoder(this.allowMalformed) : _state = beforeBom;
 
   @patch
-  String convertSingle(List<int> codeUnits, int start, int maybeEnd) {
+  String convertSingle(List<int> codeUnits, int start, int? maybeEnd) {
     return convertGeneral(codeUnits, start, maybeEnd, true);
   }
 
   @patch
-  String convertChunked(List<int> codeUnits, int start, int maybeEnd) {
+  String convertChunked(List<int> codeUnits, int start, int? maybeEnd) {
     return convertGeneral(codeUnits, start, maybeEnd, false);
   }
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart
index 76ff542..2171a9f 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/core_patch.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.6
-
 // Patch file for dart:core classes.
 import "dart:_internal" as _symbol_dev;
 import 'dart:_interceptors';
@@ -30,14 +28,14 @@
 
 String _symbolToString(Symbol symbol) => symbol is PrivateSymbol
     ? PrivateSymbol.getName(symbol)
-    : _symbol_dev.Symbol.getName(symbol);
+    : _symbol_dev.Symbol.getName(symbol as _symbol_dev.Symbol);
 
 @patch
-int identityHashCode(Object object) {
+int identityHashCode(Object? object) {
   if (object == null) return 0;
   // Note: this works for primitives because we define the `identityHashCode`
   // for them to be equivalent to their computed hashCode function.
-  int hash = JS('int|Null', r'#[#]', object, dart.identityHashCode_);
+  int? hash = JS<int?>('int|Null', r'#[#]', object, dart.identityHashCode_);
   if (hash == null) {
     hash = JS<int>('!', '(Math.random() * 0x3fffffff) | 0');
     JS('void', r'#[#] = #', object, dart.identityHashCode_, hash);
@@ -49,7 +47,7 @@
 @patch
 class Object {
   @patch
-  bool operator ==(other) => identical(this, other);
+  bool operator ==(Object other) => identical(this, other);
 
   @patch
   int get hashCode => identityHashCode(this);
@@ -59,7 +57,7 @@
       "Instance of '${dart.typeName(dart.getReifiedType(this))}'";
 
   @patch
-  noSuchMethod(Invocation invocation) {
+  dynamic noSuchMethod(Invocation invocation) {
     return dart.defaultNoSuchMethod(this, invocation);
   }
 
@@ -68,10 +66,11 @@
 
   // Everything is an Object.
   @JSExportName('is')
-  static bool _is_Object(Object o) => true;
+  static bool _is_Object(Object? o) => o != null;
 
   @JSExportName('as')
-  static Object _as_Object(Object o) => o;
+  static Object? _as_Object(Object? o) =>
+      o == null ? dart.cast(o, dart.unwrapType(Object)) : o;
 }
 
 @patch
@@ -80,10 +79,10 @@
   int get hashCode => super.hashCode;
 
   @JSExportName('is')
-  static bool _is_Null(Object o) => o == null;
+  static bool _is_Null(Object? o) => o == null;
 
   @JSExportName('as')
-  static Object _as_Null(Object o) {
+  static Object? _as_Null(Object? o) {
     // Avoid extra function call to core.Null.is() by manually inlining.
     if (o == null) return o;
     return dart.cast(o, dart.unwrapType(Null));
@@ -94,8 +93,8 @@
 @patch
 class Function {
   @patch
-  static apply(Function f, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  static apply(Function function, List<dynamic>? positionalArguments,
+      [Map<Symbol, dynamic>? namedArguments]) {
     positionalArguments ??= [];
     // dcall expects the namedArguments as a JS map in the last slot.
     if (namedArguments != null && namedArguments.isNotEmpty) {
@@ -103,9 +102,9 @@
       namedArguments.forEach((symbol, arg) {
         JS('', '#[#] = #', map, _symbolToString(symbol), arg);
       });
-      return dart.dcall(f, positionalArguments, map);
+      return dart.dcall(function, positionalArguments, map);
     }
-    return dart.dcall(f, positionalArguments);
+    return dart.dcall(function, positionalArguments);
   }
 
   static Map<String, dynamic> _toMangledNames(
@@ -118,13 +117,13 @@
   }
 
   @JSExportName('is')
-  static bool _is_Function(Object o) =>
+  static bool _is_Function(Object? o) =>
       JS<bool>('!', 'typeof $o == "function"');
 
   @JSExportName('as')
-  static Object _as_Function(Object o) {
+  static Object? _as_Function(Object? o) {
     // Avoid extra function call to core.Function.is() by manually inlining.
-    if (JS<Object>('!', 'typeof $o == "function"') || o == null) return o;
+    if (JS<bool>('!', 'typeof $o == "function"')) return o;
     return dart.cast(o, dart.unwrapType(Function));
   }
 }
@@ -132,18 +131,20 @@
 // TODO(jmesserly): switch to WeakMap
 // Patch for Expando implementation.
 @patch
-class Expando<T> {
+class Expando<T extends Object> {
   @patch
-  Expando([String name]) : this.name = name;
+  Expando([String? name]) : this.name = name;
 
   @patch
-  T operator [](Object object) {
+  T? operator [](Object object) {
     var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    return (values == null) ? null : Primitives.getProperty(values, _getKey());
+    return (values == null)
+        ? null
+        : Primitives.getProperty(values, _getKey()) as T?;
   }
 
   @patch
-  void operator []=(Object object, T value) {
+  void operator []=(Object object, T? value) {
     var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
     if (values == null) {
       values = Object();
@@ -153,7 +154,7 @@
   }
 
   String _getKey() {
-    String key = Primitives.getProperty(this, _KEY_PROPERTY_NAME);
+    var key = Primitives.getProperty(this, _KEY_PROPERTY_NAME) as String?;
     if (key == null) {
       key = "expando\$key\$${_keyCount++}";
       Primitives.setProperty(this, _KEY_PROPERTY_NAME, key);
@@ -170,7 +171,7 @@
 class int {
   @patch
   static int parse(String source,
-      {int radix, @deprecated int onError(String source)}) {
+      {int? radix, @deprecated int onError(String source)?}) {
     var value = tryParse(source, radix: radix);
     if (value != null) return value;
     if (onError != null) return onError(source);
@@ -178,7 +179,7 @@
   }
 
   @patch
-  static int tryParse(String source, {int radix}) {
+  static int? tryParse(String source, {int? radix}) {
     return Primitives.parseInt(source, radix);
   }
 
@@ -190,15 +191,14 @@
   }
 
   @JSExportName('is')
-  static bool _is_int(Object o) {
+  static bool _is_int(Object? o) {
     return JS<bool>('!', 'typeof $o == "number" && Math.floor($o) == $o');
   }
 
   @JSExportName('as')
-  static Object _as_int(Object o) {
+  static Object? _as_int(Object? o) {
     // Avoid extra function call to core.int.is() by manually inlining.
-    if (JS<bool>('!', '(typeof $o == "number" && Math.floor($o) == $o)') ||
-        o == null) {
+    if (JS<bool>('!', '(typeof $o == "number" && Math.floor($o) == $o)')) {
       return o;
     }
     return dart.cast(o, dart.unwrapType(int));
@@ -209,7 +209,7 @@
 class double {
   @patch
   static double parse(String source,
-      [@deprecated double onError(String source)]) {
+      [@deprecated double onError(String source)?]) {
     var value = tryParse(source);
     if (value != null) return value;
     if (onError != null) return onError(source);
@@ -217,19 +217,19 @@
   }
 
   @patch
-  static double tryParse(String source) {
+  static double? tryParse(String source) {
     return Primitives.parseDouble(source);
   }
 
   @JSExportName('is')
-  static bool _is_double(o) {
+  static bool _is_double(Object? o) {
     return JS<bool>('!', 'typeof $o == "number"');
   }
 
   @JSExportName('as')
-  static Object _as_double(o) {
+  static Object? _as_double(Object? o) {
     // Avoid extra function call to core.double.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "number"') || o == null) return o;
+    if (JS<bool>('!', 'typeof $o == "number"')) return o;
     return dart.cast(o, dart.unwrapType(double));
   }
 }
@@ -237,14 +237,14 @@
 @patch
 abstract class num implements Comparable<num> {
   @JSExportName('is')
-  static bool _is_num(o) {
+  static bool _is_num(Object? o) {
     return JS<bool>('!', 'typeof $o == "number"');
   }
 
   @JSExportName('as')
-  static Object _as_num(o) {
+  static Object? _as_num(Object? o) {
     // Avoid extra function call to core.num.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "number"') || o == null) return o;
+    if (JS<bool>('!', 'typeof $o == "number"')) return o;
     return dart.cast(o, dart.unwrapType(num));
   }
 }
@@ -259,11 +259,11 @@
   static BigInt get two => _BigIntImpl.two;
 
   @patch
-  static BigInt parse(String source, {int radix}) =>
+  static BigInt parse(String source, {int? radix}) =>
       _BigIntImpl.parse(source, radix: radix);
 
   @patch
-  static BigInt tryParse(String source, {int radix}) =>
+  static BigInt? tryParse(String source, {int? radix}) =>
       _BigIntImpl._tryParse(source, radix: radix);
 
   @patch
@@ -283,7 +283,7 @@
   }
 
   @patch
-  StackTrace get stackTrace => dart.stackTraceForError(this);
+  StackTrace? get stackTrace => dart.stackTraceForError(this);
 }
 
 @patch
@@ -319,10 +319,7 @@
   @patch
   DateTime._internal(int year, int month, int day, int hour, int minute,
       int second, int millisecond, int microsecond, bool isUtc)
-      // checkBool is manually inlined here because dart2js doesn't inline it
-      // and [isUtc] is usually a constant.
-      : this.isUtc =
-            isUtc is bool ? isUtc : throw ArgumentError.value(isUtc, 'isUtc'),
+      : isUtc = isUtc,
         _value = checkInt(Primitives.valueFromDecomposedDate(
             year,
             month,
@@ -346,7 +343,7 @@
   }
 
   @patch
-  static int _brokenDownDateToValue(int year, int month, int day, int hour,
+  static int? _brokenDownDateToValue(int year, int month, int day, int hour,
       int minute, int second, int millisecond, int microsecond, bool isUtc) {
     return Primitives.valueFromDecomposedDate(
         year,
@@ -367,7 +364,7 @@
 
   @patch
   Duration get timeZoneOffset {
-    if (isUtc) return Duration();
+    if (isUtc) return Duration.zero;
     return Duration(minutes: Primitives.getTimeZoneOffsetInMinutes(this));
   }
 
@@ -420,7 +417,7 @@
   int get weekday => Primitives.getWeekday(this);
 
   @patch
-  bool operator ==(dynamic other) =>
+  bool operator ==(Object other) =>
       other is DateTime &&
       _value == other.millisecondsSinceEpoch &&
       isUtc == other.isUtc;
@@ -444,9 +441,9 @@
 @patch
 class Stopwatch {
   @patch
-  static void _initTicker() {
+  static int _initTicker() {
     Primitives.initTicker();
-    _frequency = Primitives.timerFrequency;
+    return Primitives.timerFrequency;
   }
 
   @patch
@@ -473,16 +470,16 @@
 @patch
 class List<E> {
   @patch
-  factory List([@undefined int _length]) {
+  factory List([@undefined int? length]) {
     dynamic list;
-    if (JS<bool>('!', '# === void 0', _length)) {
+    if (JS<bool>('!', '# === void 0', length)) {
       list = JS('', '[]');
     } else {
-      int length = JS('!', '#', _length);
-      if (_length == null || length < 0) {
+      int _length = JS('!', '#', length);
+      if (length == null || _length < 0) {
         throw ArgumentError("Length must be a non-negative integer: $_length");
       }
-      list = JS('', 'new Array(#)', length);
+      list = JS('', 'new Array(#)', _length);
       JS('', '#.fill(null)', list);
       JSArray.markFixedList(list);
     }
@@ -490,6 +487,13 @@
   }
 
   @patch
+  factory List.empty({bool growable = false}) {
+    var list = JSArray<E>.of(JS('', 'new Array()'));
+    if (!growable) JSArray.markFixedList(list);
+    return list;
+  }
+
+  @patch
   factory List.filled(@nullCheck int length, E fill, {bool growable = false}) {
     var list = JSArray<E>.of(JS('', 'new Array(#)', length));
     JS('', '#.fill(#)', list, fill);
@@ -522,6 +526,17 @@
   }
 
   @patch
+  factory List.generate(int length, E generator(int index),
+      {bool growable = true}) {
+    final result = JSArray<E>.of(JS('', 'new Array(#)', length));
+    if (!growable) JSArray.markFixedList(result);
+    for (int i = 0; i < length; i++) {
+      result[i] = generator(i);
+    }
+    return result;
+  }
+
+  @patch
   factory List.unmodifiable(Iterable elements) {
     var list = List<E>.from(elements);
     JSArray.markUnmodifiableList(list);
@@ -532,7 +547,7 @@
 @patch
 class Map<K, V> {
   @patch
-  factory Map.unmodifiable(Map other) {
+  factory Map.unmodifiable(Map<dynamic, dynamic> other) {
     return UnmodifiableMapView<K, V>(Map<K, V>.from(other));
   }
 
@@ -544,7 +559,7 @@
 class String {
   @patch
   factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int end]) {
+      [int start = 0, int? end]) {
     if (charCodes is JSArray) {
       return _stringFromJSArray(charCodes, start, end);
     }
@@ -569,7 +584,7 @@
   static String _stringFromJSArray(
       /*=JSArray<int>*/ list,
       int start,
-      int endOrNull) {
+      int? endOrNull) {
     int len = list.length;
     int end = RangeError.checkValidRange(start, endOrNull, len);
     if (start > 0 || end < len) {
@@ -579,14 +594,14 @@
   }
 
   static String _stringFromUint8List(
-      NativeUint8List charCodes, int start, int endOrNull) {
+      NativeUint8List charCodes, int start, int? endOrNull) {
     int len = charCodes.length;
     int end = RangeError.checkValidRange(start, endOrNull, len);
     return Primitives.stringFromNativeUint8List(charCodes, start, end);
   }
 
   static String _stringFromIterable(
-      Iterable<int> charCodes, int start, int end) {
+      Iterable<int> charCodes, int start, int? end) {
     if (start < 0) throw RangeError.range(start, 0, charCodes.length);
     if (end != null && end < start) {
       throw RangeError.range(end, start, charCodes.length);
@@ -597,7 +612,7 @@
         throw RangeError.range(start, 0, i);
       }
     }
-    var list = <int>[];
+    var list = JSArray<int>.of(JS('', 'new Array()'));
     if (end == null) {
       while (it.moveNext()) list.add(it.current);
     } else {
@@ -612,14 +627,14 @@
   }
 
   @JSExportName('is')
-  static bool _is_String(Object o) {
+  static bool _is_String(Object? o) {
     return JS<bool>('!', 'typeof $o == "string"');
   }
 
   @JSExportName('as')
-  static Object _as_String(Object o) {
+  static Object? _as_String(Object? o) {
     // Avoid extra function call to core.String.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "string"') || o == null) return o;
+    if (JS<bool>('!', 'typeof $o == "string"')) return o;
     return dart.cast(o, dart.unwrapType(String));
   }
 }
@@ -644,13 +659,13 @@
   int get hashCode => super.hashCode;
 
   @JSExportName('is')
-  static bool _is_bool(Object o) =>
+  static bool _is_bool(Object? o) =>
       JS<bool>('!', '$o === true || $o === false');
 
   @JSExportName('as')
-  static Object _as_bool(Object o) {
+  static Object? _as_bool(Object? o) {
     // Avoid extra function call to core.bool.is() by manually inlining.
-    if (JS<bool>("!", '$o === true || $o === false') || o == null) return o;
+    if (JS<bool>("!", '$o === true || $o === false')) return o;
     return dart.cast(o, dart.unwrapType(bool));
   }
 }
@@ -675,7 +690,7 @@
 
 // Patch for 'identical' function.
 @patch
-bool identical(Object a, Object b) {
+bool identical(Object? a, Object? b) {
   return JS<bool>('!', '(# == null ? # == null : # === #)', a, b, a, b);
 }
 
@@ -690,7 +705,7 @@
   int get length => _contents.length;
 
   @patch
-  void write(Object obj) {
+  void write(Object? obj) {
     _writeString('$obj');
   }
 
@@ -700,12 +715,12 @@
   }
 
   @patch
-  void writeAll(Iterable objects, [String separator = ""]) {
+  void writeAll(Iterable<dynamic> objects, [String separator = ""]) {
     _contents = _writeAll(_contents, objects, separator);
   }
 
   @patch
-  void writeln([Object obj = ""]) {
+  void writeln([Object? obj = ""]) {
     _writeString('$obj\n');
   }
 
@@ -717,7 +732,7 @@
   @patch
   String toString() => Primitives.flattenString(_contents);
 
-  void _writeString(str) {
+  void _writeString(String str) {
     _contents = Primitives.stringConcatUnchecked(_contents, str);
   }
 
@@ -738,7 +753,7 @@
     return string;
   }
 
-  static String _writeOne(String string, Object obj) {
+  static String _writeOne(String string, Object? obj) {
     return Primitives.stringConcatUnchecked(string, '$obj');
   }
 }
@@ -752,46 +767,44 @@
 
 @patch
 class NoSuchMethodError {
-  final Object _receiver;
+  final Object? _receiver;
   final Symbol _memberName;
-  final List _arguments;
-  final Map<Symbol, dynamic> _namedArguments;
-  final List _existingArgumentNames;
-  final Invocation _invocation;
+  final List? _arguments;
+  final Map<Symbol, dynamic>? _namedArguments;
+  final Invocation? _invocation;
 
   @patch
-  NoSuchMethodError(Object receiver, Symbol memberName,
-      List positionalArguments, Map<Symbol, dynamic> namedArguments,
-      [List existingArgumentNames = null])
+  NoSuchMethodError(Object? receiver, Symbol memberName,
+      List? positionalArguments, Map<Symbol, dynamic>? namedArguments)
       : _receiver = receiver,
         _memberName = memberName,
         _arguments = positionalArguments,
         _namedArguments = namedArguments,
-        _existingArgumentNames = existingArgumentNames,
         _invocation = null;
 
   @patch
-  NoSuchMethodError.withInvocation(Object receiver, Invocation invocation)
+  NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation)
       : _receiver = receiver,
         _memberName = invocation.memberName,
         _arguments = invocation.positionalArguments,
         _namedArguments = invocation.namedArguments,
-        _existingArgumentNames = null,
         _invocation = invocation;
 
   @patch
   String toString() {
     StringBuffer sb = StringBuffer('');
     String comma = '';
-    if (_arguments != null) {
-      for (var argument in _arguments) {
+    var arguments = _arguments;
+    if (arguments != null) {
+      for (var argument in arguments) {
         sb.write(comma);
         sb.write(Error.safeToString(argument));
         comma = ', ';
       }
     }
-    if (_namedArguments != null) {
-      _namedArguments.forEach((Symbol key, var value) {
+    var namedArguments = _namedArguments;
+    if (namedArguments != null) {
+      namedArguments.forEach((Symbol key, var value) {
         sb.write(comma);
         sb.write(_symbolToString(key));
         sb.write(": ");
@@ -802,22 +815,14 @@
     String memberName = _symbolToString(_memberName);
     String receiverText = Error.safeToString(_receiver);
     String actualParameters = '$sb';
-    var failureMessage = (_invocation is dart.InvocationImpl)
-        ? (_invocation as dart.InvocationImpl).failureMessage
+    var invocation = _invocation;
+    var failureMessage = (invocation is dart.InvocationImpl)
+        ? invocation.failureMessage
         : 'method not found';
-    if (_existingArgumentNames == null) {
-      return "NoSuchMethodError: '$memberName'\n"
-          "$failureMessage\n"
-          "Receiver: ${receiverText}\n"
-          "Arguments: [$actualParameters]";
-    } else {
-      String formalParameters = _existingArgumentNames.join(', ');
-      return "NoSuchMethodError: incorrect number of arguments passed to "
-          "method named '$memberName'\n"
-          "Receiver: ${receiverText}\n"
-          "Tried calling: $memberName($actualParameters)\n"
-          "Found: $memberName($formalParameters)";
-    }
+    return "NoSuchMethodError: '$memberName'\n"
+        "$failureMessage\n"
+        "Receiver: ${receiverText}\n"
+        "Arguments: [$actualParameters]";
   }
 }
 
@@ -973,14 +978,14 @@
 
   // Result cache for last _divRem call.
   // Result cache for last _divRem call.
-  static Uint16List _lastDividendDigits;
-  static int _lastDividendUsed;
-  static Uint16List _lastDivisorDigits;
-  static int _lastDivisorUsed;
-  static Uint16List _lastQuoRemDigits;
-  static int _lastQuoRemUsed;
-  static int _lastRemUsed;
-  static int _lastRem_nsh;
+  static Uint16List? _lastDividendDigits;
+  static int? _lastDividendUsed;
+  static Uint16List? _lastDivisorDigits;
+  static int? _lastDivisorUsed;
+  static Uint16List? _lastQuoRemDigits;
+  static int? _lastQuoRemUsed;
+  static int? _lastRemUsed;
+  static int? _lastRem_nsh;
 
   /// Whether this bigint is negative.
   final bool _isNegative;
@@ -1021,7 +1026,7 @@
    * Throws a [FormatException] if the [source] is not a valid integer literal,
    * optionally prefixed by a sign.
    */
-  static _BigIntImpl parse(String source, {int radix}) {
+  static _BigIntImpl parse(String source, {int? radix}) {
     var result = _tryParse(source, radix: radix);
     if (result == null) {
       throw FormatException("Could not parse BigInt", source);
@@ -1040,7 +1045,7 @@
     // Read in the source 4 digits at a time.
     // The first part may have a few leading virtual '0's to make the remaining
     // parts all have exactly 4 digits.
-    int digitInPartCount = 4 - source.length.remainder(4);
+    var digitInPartCount = 4 - source.length.remainder(4);
     if (digitInPartCount == 4) digitInPartCount = 0;
     for (int i = 0; i < source.length; i++) {
       part = part * 10 + source.codeUnitAt(i) - _0;
@@ -1082,7 +1087,7 @@
   /// If [isNegative] is true, negates the result before returning it.
   ///
   /// The [source] (substring) must be a valid hex literal.
-  static _BigIntImpl _parseHex(String source, int startPos, bool isNegative) {
+  static _BigIntImpl? _parseHex(String source, int startPos, bool isNegative) {
     int hexDigitsPerChunk = _digitBits ~/ 4;
     int sourceLength = source.length - startPos;
     int chunkCount = (sourceLength / hexDigitsPerChunk).ceil();
@@ -1116,7 +1121,7 @@
   ///
   /// The [source] will be checked for invalid characters. If it is invalid,
   /// this function returns `null`.
-  static _BigIntImpl _parseRadix(String source, int radix, bool isNegative) {
+  static _BigIntImpl? _parseRadix(String source, int radix, bool isNegative) {
     var result = zero;
     var base = _BigIntImpl._fromInt(radix);
     for (int i = 0; i < source.length; i++) {
@@ -1133,7 +1138,7 @@
   /// Returns the parsed big integer, or `null` if it failed.
   ///
   /// If the [radix] is `null` accepts decimal literals or `0x` hex literals.
-  static _BigIntImpl _tryParse(String source, {int radix}) {
+  static _BigIntImpl? _tryParse(String source, {int? radix}) {
     if (source == "") return null;
 
     var match = _parseRE.firstMatch(source);
@@ -1145,9 +1150,9 @@
 
     bool isNegative = match[signIndex] == "-";
 
-    String decimalMatch = match[decimalIndex];
-    String hexMatch = match[hexIndex];
-    String nonDecimalMatch = match[nonDecimalHexIndex];
+    String? decimalMatch = match[decimalIndex];
+    String? hexMatch = match[hexIndex];
+    String? nonDecimalMatch = match[nonDecimalHexIndex];
 
     if (radix == null) {
       if (decimalMatch != null) {
@@ -1168,11 +1173,11 @@
       return _parseDecimal(decimalMatch, isNegative);
     }
     if (radix == 16 && (decimalMatch != null || nonDecimalMatch != null)) {
-      return _parseHex(decimalMatch ?? nonDecimalMatch, 0, isNegative);
+      return _parseHex(decimalMatch ?? nonDecimalMatch!, 0, isNegative);
     }
 
     return _parseRadix(
-        decimalMatch ?? nonDecimalMatch ?? hexMatch, radix, isNegative);
+        decimalMatch ?? nonDecimalMatch ?? hexMatch!, radix, isNegative);
   }
 
   static RegExp _parseRE = RegExp(
@@ -1220,7 +1225,7 @@
     // then use the bit-manipulating `_fromDouble` for all other values.
     if (value.abs() < 0x100000000) return _BigIntImpl._fromInt(value.toInt());
     if (value is double) return _BigIntImpl._fromDouble(value);
-    return _BigIntImpl._fromInt(value);
+    return _BigIntImpl._fromInt(value as int);
   }
 
   factory _BigIntImpl._fromInt(int value) {
@@ -1984,9 +1989,9 @@
     _divRem(other);
     // Return quotient, i.e.
     // _lastQuoRem_digits[_lastRem_used.._lastQuoRem_used-1] with proper sign.
-    var lastQuo_used = _lastQuoRemUsed - _lastRemUsed;
+    var lastQuo_used = _lastQuoRemUsed! - _lastRemUsed!;
     var quo_digits = _cloneDigits(
-        _lastQuoRemDigits, _lastRemUsed, _lastQuoRemUsed, lastQuo_used);
+        _lastQuoRemDigits!, _lastRemUsed!, _lastQuoRemUsed!, lastQuo_used);
     var quo = _BigIntImpl._(false, lastQuo_used, quo_digits);
     if ((_isNegative != other._isNegative) && (quo._used > 0)) {
       quo = -quo;
@@ -2004,10 +2009,10 @@
     // Return remainder, i.e.
     // denormalized _lastQuoRem_digits[0.._lastRem_used-1] with proper sign.
     var remDigits =
-        _cloneDigits(_lastQuoRemDigits, 0, _lastRemUsed, _lastRemUsed);
-    var rem = _BigIntImpl._(false, _lastRemUsed, remDigits);
-    if (_lastRem_nsh > 0) {
-      rem = rem >> _lastRem_nsh; // Denormalize remainder.
+        _cloneDigits(_lastQuoRemDigits!, 0, _lastRemUsed!, _lastRemUsed!);
+    var rem = _BigIntImpl._(false, _lastRemUsed!, remDigits);
+    if (_lastRem_nsh! > 0) {
+      rem = rem >> _lastRem_nsh!; // Denormalize remainder.
     }
     if (_isNegative && (rem._used > 0)) {
       rem = -rem;
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart
index c6e8905..d67b6c8 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/developer_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/developer_patch.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.6
-
 // Patch file for dart:developer library.
 
 import 'dart:_js_helper' show patch, ForceInline, ReifyFunctionTypes;
@@ -15,7 +13,7 @@
 
 @patch
 @ForceInline()
-bool debugger({bool when = true, String message}) {
+bool debugger({bool when = true, String? message}) {
   if (when) {
     JS('', 'debugger');
   }
@@ -23,7 +21,7 @@
 }
 
 @patch
-Object inspect(Object object) {
+Object? inspect(Object? object) {
   // Note: this log level does not show up by default in Chrome.
   // This is used for communication with the debugger service.
   JS('', 'console.debug("dart.developer.inspect", #)', object);
@@ -32,13 +30,13 @@
 
 @patch
 void log(String message,
-    {DateTime time,
-    int sequenceNumber,
+    {DateTime? time,
+    int? sequenceNumber,
     int level = 0,
     String name = '',
-    Zone zone,
-    Object error,
-    StackTrace stackTrace}) {
+    Zone? zone,
+    Object? error,
+    StackTrace? stackTrace}) {
   Object items =
       JS('!', '{ message: #, name: #, level: # }', message, name, level);
   if (time != null) JS('', '#.time = #', items, time);
@@ -52,10 +50,10 @@
   JS('', 'console.debug("dart.developer.log", #)', items);
 }
 
-final _extensions = Map<String, ServiceExtensionHandler>();
+final _extensions = <String, ServiceExtensionHandler>{};
 
 @patch
-ServiceExtensionHandler _lookupExtension(String method) {
+ServiceExtensionHandler? _lookupExtension(String method) {
   return _extensions[method];
 }
 
@@ -81,7 +79,7 @@
   return JS('', 'new #.Promise(#)', dart.global_,
       (Function(Object) resolve, Function(Object) reject) async {
     try {
-      var method = _lookupExtension(methodName);
+      var method = _lookupExtension(methodName)!;
       var parameters = (json.decode(encodedJson) as Map).cast<String, String>();
       var result = await method(methodName, parameters);
       resolve(result._toString());
@@ -154,7 +152,7 @@
 }
 
 @patch
-String _getIsolateIDFromSendPort(SendPort sendPort) {
+String? _getIsolateIDFromSendPort(SendPort sendPort) {
   return null;
 }
 
@@ -168,7 +166,7 @@
 }
 
 class _FakeUserTag implements UserTag {
-  static Map _instances = {};
+  static final _instances = <String, _FakeUserTag>{};
 
   _FakeUserTag.real(this.label);
 
@@ -183,10 +181,7 @@
       throw UnsupportedError(
           'UserTag instance limit (${UserTag.MAX_USER_TAGS}) reached.');
     }
-    // Create a new instance and add it to the instance map.
-    var instance = _FakeUserTag.real(label);
-    _instances[label] = instance;
-    return instance;
+    return _instances[label] = _FakeUserTag.real(label);
   }
 
   final String label;
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/internal_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/internal_patch.dart
index 6ab2349..2e605a2 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/internal_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/internal_patch.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.6
-
 import 'dart:core' hide Symbol;
 import 'dart:core' as core show Symbol;
 import 'dart:_js_primitives' show printString;
@@ -13,13 +11,16 @@
 import 'dart:_runtime' as dart;
 
 @patch
+bool typeAcceptsNull<T>() => !dart.strictNullSafety || null is T;
+
+@patch
 class Symbol implements core.Symbol {
   @patch
   const Symbol(String name) : this._name = name;
 
   @patch
   int get hashCode {
-    int hash = JS('int|Null', '#._hashCode', this);
+    int? hash = JS('int|Null', '#._hashCode', this);
     if (hash != null) return hash;
     const arbitraryPrime = 664597;
     hash = 0x1fffffff & (arbitraryPrime * _name.hashCode);
@@ -40,17 +41,17 @@
 }
 
 @patch
-List<E> makeListFixedLength<E>(List<E> growableList) {
+List<T> makeListFixedLength<T>(List<T> growableList) {
   JSArray.markFixedList(growableList);
   return growableList;
 }
 
 @patch
-List<E> makeFixedListUnmodifiable<E>(List<E> fixedLengthList) {
+List<T> makeFixedListUnmodifiable<T>(List<T> fixedLengthList) {
   JSArray.markUnmodifiableList(fixedLengthList);
   return fixedLengthList;
 }
 
 @patch
-Object extractTypeArguments<T>(T instance, Function extract) =>
+Object? extractTypeArguments<T>(T instance, Function extract) =>
     dart.extractTypeArguments<T>(instance, extract);
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart
index 2f68527..041dfd5 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/io_patch.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.6
-
 import 'dart:_js_helper' show patch;
 import 'dart:async';
 import 'dart:convert';
@@ -75,7 +73,7 @@
 @patch
 class _EventHandler {
   @patch
-  static void _sendData(Object sender, SendPort sendPort, int data) {
+  static void _sendData(Object? sender, SendPort sendPort, int data) {
     throw UnsupportedError("EventHandler._sendData");
   }
 }
@@ -305,7 +303,7 @@
 @patch
 class _ProcessUtils {
   @patch
-  static void _exit(int status) {
+  static Never _exit(int status) {
     throw UnsupportedError("ProcessUtils._exit");
   }
 
@@ -325,7 +323,7 @@
   }
 
   @patch
-  static int _pid(Process process) {
+  static int _pid(Process? process) {
     throw UnsupportedError("ProcessUtils._pid");
   }
 
@@ -352,8 +350,8 @@
 class Process {
   @patch
   static Future<Process> start(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment = true,
       bool runInShell = false,
       ProcessStartMode mode = ProcessStartMode.normal}) {
@@ -362,8 +360,8 @@
 
   @patch
   static Future<ProcessResult> run(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment = true,
       bool runInShell = false,
       Encoding stdoutEncoding = systemEncoding,
@@ -373,8 +371,8 @@
 
   @patch
   static ProcessResult runSync(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment = true,
       bool runInShell = false,
       Encoding stdoutEncoding = systemEncoding,
@@ -411,13 +409,13 @@
   }
 
   @patch
-  factory InternetAddress(String address, {InternetAddressType type}) {
+  factory InternetAddress(String address, {InternetAddressType? type}) {
     throw UnsupportedError("InternetAddress");
   }
 
   @patch
   factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType type}) {
+      {InternetAddressType? type}) {
     throw new UnsupportedError("InternetAddress.fromRawAddress");
   }
 
@@ -434,7 +432,7 @@
   }
 
   @patch
-  static InternetAddress tryParse(String address) {
+  static InternetAddress? tryParse(String address) {
     throw UnsupportedError("InternetAddress.tryParse");
   }
 }
@@ -476,14 +474,14 @@
 @patch
 class RawSocket {
   @patch
-  static Future<RawSocket> connect(host, int port,
-      {sourceAddress, Duration timeout}) {
+  static Future<RawSocket> connect(dynamic host, int port,
+      {dynamic sourceAddress, Duration? timeout}) {
     throw UnsupportedError("RawSocket constructor");
   }
 
   @patch
-  static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
-      {sourceAddress}) {
+  static Future<ConnectionTask<RawSocket>> startConnect(dynamic host, int port,
+      {dynamic sourceAddress}) {
     throw UnsupportedError("RawSocket constructor");
   }
 }
@@ -491,14 +489,14 @@
 @patch
 class Socket {
   @patch
-  static Future<Socket> _connect(host, int port,
-      {sourceAddress, Duration timeout}) {
+  static Future<Socket> _connect(dynamic host, int port,
+      {dynamic sourceAddress, Duration? timeout}) {
     throw UnsupportedError("Socket constructor");
   }
 
   @patch
-  static Future<ConnectionTask<Socket>> _startConnect(host, int port,
-      {sourceAddress}) {
+  static Future<ConnectionTask<Socket>> _startConnect(dynamic host, int port,
+      {dynamic sourceAddress}) {
     throw UnsupportedError("Socket constructor");
   }
 }
@@ -514,7 +512,7 @@
 @patch
 class RawSynchronousSocket {
   @patch
-  static RawSynchronousSocket connectSync(host, int port) {
+  static RawSynchronousSocket connectSync(dynamic host, int port) {
     throw UnsupportedError("RawSynchronousSocket.connectSync");
   }
 }
@@ -556,7 +554,7 @@
 @patch
 class RawDatagramSocket {
   @patch
-  static Future<RawDatagramSocket> bind(host, int port,
+  static Future<RawDatagramSocket> bind(dynamic host, int port,
       {bool reuseAddress = true, bool reusePort = false, int ttl = 1}) {
     throw UnsupportedError("RawDatagramSocket.bind");
   }
@@ -618,14 +616,14 @@
       int windowBits,
       int memLevel,
       int strategy,
-      List<int> dictionary,
+      List<int>? dictionary,
       bool raw) {
     throw UnsupportedError("_newZLibDeflateFilter");
   }
 
   @patch
   static RawZLibFilter _makeZLibInflateFilter(
-      int windowBits, List<int> dictionary, bool raw) {
+      int windowBits, List<int>? dictionary, bool raw) {
     throw UnsupportedError("_newZLibInflateFilter");
   }
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart
index 93e4165..9b45b66 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/isolate_patch.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.6
-
 // Patch file for the dart:isolate library.
 
 import 'dart:_js_helper' show patch, NoReifyGeneric;
@@ -18,36 +16,37 @@
   static Isolate get current => _unsupported();
 
   @patch
-  String get debugName => _unsupported();
+  String? get debugName => _unsupported();
 
   @patch
-  static Future<Uri> get packageRoot => _unsupported();
+  static Future<Uri?> get packageRoot => _unsupported();
 
   @patch
-  static Future<Uri> get packageConfig => _unsupported();
+  static Future<Uri?> get packageConfig => _unsupported();
 
   @patch
-  static Future<Uri> resolvePackageUri(Uri packageUri) => _unsupported();
+  static Future<Uri?> resolvePackageUri(Uri packageUri) => _unsupported();
 
   @patch
   static Future<Isolate> spawn<T>(void entryPoint(T message), T message,
           {bool paused = false,
-          bool errorsAreFatal,
-          SendPort onExit,
-          SendPort onError}) =>
+          bool errorsAreFatal = true,
+          SendPort? onExit,
+          SendPort? onError}) =>
       _unsupported();
 
   @patch
   static Future<Isolate> spawnUri(Uri uri, List<String> args, var message,
           {bool paused = false,
-          SendPort onExit,
-          SendPort onError,
-          bool errorsAreFatal,
-          bool checked,
-          Map<String, String> environment,
-          Uri packageRoot,
-          Uri packageConfig,
-          bool automaticPackageResolution = false}) =>
+          SendPort? onExit,
+          SendPort? onError,
+          bool errorsAreFatal = true,
+          bool? checked,
+          Map<String, String>? environment,
+          Uri? packageRoot,
+          Uri? packageConfig,
+          bool automaticPackageResolution = false,
+          String? debugName}) =>
       _unsupported();
 
   @patch
@@ -57,7 +56,7 @@
   void resume(Capability resumeCapability) => _unsupported();
 
   @patch
-  void addOnExitListener(SendPort responsePort, {Object response}) =>
+  void addOnExitListener(SendPort responsePort, {Object? response}) =>
       _unsupported();
 
   @patch
@@ -70,7 +69,7 @@
   void kill({int priority = beforeNextEvent}) => _unsupported();
   @patch
   void ping(SendPort responsePort,
-          {Object response, int priority = immediate}) =>
+          {Object? response, int priority = immediate}) =>
       _unsupported();
 
   @patch
@@ -99,13 +98,17 @@
 
   get sendPort => _unsupported();
 
-  listen(onData, {onError, onDone, cancelOnError}) => _unsupported();
+  StreamSubscription listen(void Function(dynamic)? onData,
+          {Function? onError,
+          void Function()? onDone,
+          bool? cancelOnError = true}) =>
+      _unsupported();
 }
 
 @patch
 class RawReceivePort {
   @patch
-  factory RawReceivePort([void handler(event)]) => _unsupported();
+  factory RawReceivePort([Function? handler]) => _unsupported();
 }
 
 @patch
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart
index ab61378..feb5ef1 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/js_patch.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 // Patch file for dart:js library.
 library dart.js;
 
 import 'dart:collection' show HashMap, ListMixin;
 
-import 'dart:_js_helper' show patch, Primitives;
+import 'dart:_js_helper' show patch, NoReifyGeneric, Primitives;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_runtime' as dart;
 
@@ -21,7 +19,7 @@
 @patch
 class JsObject {
   // The wrapped JS object.
-  final dynamic _jsObject;
+  final Object _jsObject;
 
   // This should only be called from _wrapToDart
   JsObject._fromJs(this._jsObject) {
@@ -29,7 +27,7 @@
   }
 
   @patch
-  factory JsObject(JsFunction constructor, [List arguments]) {
+  factory JsObject(JsFunction constructor, [List? arguments]) {
     var ctor = constructor._jsObject;
     if (arguments == null) {
       return _wrapToDart(JS('', 'new #()', ctor));
@@ -39,25 +37,25 @@
   }
 
   @patch
-  factory JsObject.fromBrowserObject(object) {
+  factory JsObject.fromBrowserObject(Object object) {
     if (object is num || object is String || object is bool || object == null) {
       throw ArgumentError("object cannot be a num, string, bool, or null");
     }
-    return _wrapToDart(_convertToJS(object));
+    return _wrapToDart(_convertToJS(object)!);
   }
 
   @patch
-  factory JsObject.jsify(object) {
+  factory JsObject.jsify(Object object) {
     if ((object is! Map) && (object is! Iterable)) {
       throw ArgumentError("object must be a Map or Iterable");
     }
     return _wrapToDart(_convertDataTree(object));
   }
 
-  static _convertDataTree(data) {
+  static _convertDataTree(Object data) {
     var _convertedObjects = HashMap.identity();
 
-    _convert(o) {
+    _convert(Object? o) {
       if (_convertedObjects.containsKey(o)) {
         return _convertedObjects[o];
       }
@@ -90,7 +88,7 @@
   }
 
   @patch
-  void operator []=(Object property, value) {
+  void operator []=(Object property, Object? value) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -98,11 +96,11 @@
   }
 
   @patch
-  bool operator ==(other) =>
+  bool operator ==(Object other) =>
       other is JsObject && JS<bool>('!', '# === #', _jsObject, other._jsObject);
 
   @patch
-  bool hasProperty(property) {
+  bool hasProperty(Object property) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -110,7 +108,7 @@
   }
 
   @patch
-  void deleteProperty(property) {
+  void deleteProperty(Object property) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -132,14 +130,14 @@
   }
 
   @patch
-  dynamic callMethod(method, [List args]) {
+  dynamic callMethod(Object method, [List? args]) {
     if (method is! String && method is! num) {
       throw ArgumentError("method is not a String or num");
     }
     if (args != null) args = List.from(args.map(_convertToJS));
     var fn = JS('', '#[#]', _jsObject, method);
     if (JS<bool>('!', 'typeof(#) !== "function"', fn)) {
-      throw NoSuchMethodError(_jsObject, Symbol(method), args, {});
+      throw NoSuchMethodError(_jsObject, Symbol('$method'), args, {});
     }
     return _convertToDart(JS('', '#.apply(#, #)', fn, _jsObject, args));
   }
@@ -164,7 +162,7 @@
         f));
   }
 
-  JsFunction._fromJs(jsObject) : super._fromJs(jsObject);
+  JsFunction._fromJs(Object jsObject) : super._fromJs(jsObject);
 
   @patch
   dynamic apply(List args, {thisArg}) => _convertToDart(JS(
@@ -185,16 +183,16 @@
   factory JsArray.from(Iterable<E> other) =>
       JsArray<E>._fromJs([]..addAll(other.map(_convertToJS)));
 
-  JsArray._fromJs(jsObject) : super._fromJs(jsObject);
+  JsArray._fromJs(Object jsObject) : super._fromJs(jsObject);
 
   _checkIndex(int index) {
-    if (index is int && (index < 0 || index >= length)) {
+    if (index < 0 || index >= length) {
       throw RangeError.range(index, 0, length);
     }
   }
 
   _checkInsertIndex(int index) {
-    if (index is int && (index < 0 || index >= length + 1)) {
+    if (index < 0 || index >= length + 1) {
       throw RangeError.range(index, 0, length);
     }
   }
@@ -210,9 +208,7 @@
 
   @patch
   E operator [](Object index) {
-    // TODO(justinfagnani): fix the semantics for non-ints
-    // dartbug.com/14605
-    if (index is num && index == index.toInt()) {
+    if (index is int) {
       _checkIndex(index);
     }
     return super[index] as E;
@@ -220,9 +216,7 @@
 
   @patch
   void operator []=(Object index, value) {
-    // TODO(justinfagnani): fix the semantics for non-ints
-    // dartbug.com/14605
-    if (index is num && index == index.toInt()) {
+    if (index is int) {
       _checkIndex(index);
     }
     super[index] = value;
@@ -253,7 +247,7 @@
   @patch
   void addAll(Iterable<E> iterable) {
     var list = (JS<bool>('!', '# instanceof Array', iterable))
-        ? iterable
+        ? JS<List>('', '#', iterable)
         : List.from(iterable);
     callMethod('push', list);
   }
@@ -288,13 +282,13 @@
     int length = end - start;
     if (length == 0) return;
     if (skipCount < 0) throw ArgumentError(skipCount);
-    var args = <Object>[start, length]
+    var args = <Object?>[start, length]
       ..addAll(iterable.skip(skipCount).take(length));
     callMethod('splice', args);
   }
 
   @patch
-  void sort([int compare(E a, E b)]) {
+  void sort([int compare(E a, E b)?]) {
     // Note: arr.sort(null) is a type error in FF
     callMethod('sort', compare == null ? [] : [compare]);
   }
@@ -304,7 +298,7 @@
 // We include the instanceof Object test to filter out cross frame objects
 // on FireFox. Surprisingly on FireFox the instanceof Window test succeeds for
 // cross frame windows while the instanceof Object test fails.
-bool _isBrowserType(o) => JS(
+bool _isBrowserType(Object o) => JS(
     'bool',
     '# instanceof Object && ('
         '# instanceof Blob || '
@@ -329,11 +323,11 @@
     o);
 
 class _DartObject {
-  final _dartObj;
+  final Object _dartObj;
   _DartObject(this._dartObj);
 }
 
-dynamic _convertToJS(dynamic o) {
+Object? _convertToJS(Object? o) {
   if (o == null || o is String || o is num || o is bool || _isBrowserType(o)) {
     return o;
   } else if (o is DateTime) {
@@ -349,8 +343,8 @@
   }
 }
 
-dynamic _wrapDartFunction(f) {
-  var wrapper = JS(
+Object _wrapDartFunction(Object f) {
+  var wrapper = JS<Object>(
       '',
       'function(/*...arguments*/) {'
           '  let args = Array.prototype.map.call(arguments, #);'
@@ -366,11 +360,11 @@
 
 // converts a Dart object to a reference to a native JS object
 // which might be a DartObject JS->Dart proxy
-Object _convertToDart(o) {
+Object? _convertToDart(Object? o) {
   if (o == null || o is String || o is num || o is bool || _isBrowserType(o)) {
     return o;
   } else if (JS('!', '# instanceof Date', o)) {
-    num ms = JS('!', '#.getTime()', o);
+    int ms = JS('!', '#.getTime()', o);
     return DateTime.fromMillisecondsSinceEpoch(ms);
   } else if (o is _DartObject &&
       !identical(dart.getReifiedType(o), dart.jsobject)) {
@@ -380,9 +374,10 @@
   }
 }
 
-Object _wrapToDart(o) => _putIfAbsent(_dartProxies, o, _wrapToDartHelper);
+JsObject _wrapToDart(Object o) =>
+    _putIfAbsent(_dartProxies, o, _wrapToDartHelper);
 
-Object _wrapToDartHelper(o) {
+JsObject _wrapToDartHelper(Object o) {
   if (JS<bool>('!', 'typeof # == "function"', o)) {
     return JsFunction._fromJs(o);
   }
@@ -392,16 +387,18 @@
   return JsObject._fromJs(o);
 }
 
-final _dartProxies = JS('', 'new WeakMap()');
-final _jsProxies = JS('', 'new WeakMap()');
+final Object _dartProxies = JS('', 'new WeakMap()');
+final Object _jsProxies = JS('', 'new WeakMap()');
 
-Object _putIfAbsent(weakMap, o, getValue(o)) {
-  var value = JS('', '#.get(#)', weakMap, o);
+@NoReifyGeneric()
+T _putIfAbsent<T>(Object weakMap, Object o, T getValue(Object o)) {
+  T? value = JS('', '#.get(#)', weakMap, o);
   if (value == null) {
     value = getValue(o);
     JS('', '#.set(#, #)', weakMap, o, value);
   }
-  return value;
+  // TODO(vsm): Static cast.  Unnecessary?
+  return JS('', '#', value);
 }
 
 Expando<Function> _interopExpando = Expando<Function>();
@@ -409,9 +406,9 @@
 @patch
 F allowInterop<F extends Function>(F f) {
   if (!dart.isDartFunction(f)) return f;
-  var ret = _interopExpando[f];
+  var ret = _interopExpando[f] as F?;
   if (ret == null) {
-    ret = JS(
+    ret = JS<F>(
         '',
         'function (...args) {'
             ' return #(#, args);'
@@ -430,7 +427,7 @@
   if (!dart.isDartFunction(f)) return f;
   var ret = _interopCaptureThisExpando[f];
   if (ret == null) {
-    ret = JS(
+    ret = JS<Function>(
         '',
         'function(...arguments) {'
             '  let args = [this];'
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart
index c2363f7..288f66e 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/math_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/math_patch.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.6
-
 // Patch file for dart:math library.
 import 'dart:_foreign_helper' show JS;
 import 'dart:_js_helper' show patch, nullCheck, notNull;
@@ -12,53 +10,53 @@
 @patch
 @notNull
 T min<T extends num>(@nullCheck T a, @nullCheck T b) =>
-    JS('-dynamic', r'Math.min(#, #)', a, b);
+    JS<T>('-dynamic', r'Math.min(#, #)', a, b);
 
 @patch
 @notNull
 T max<T extends num>(@nullCheck T a, @nullCheck T b) =>
-    JS('-dynamic', r'Math.max(#, #)', a, b);
+    JS<T>('-dynamic', r'Math.max(#, #)', a, b);
 
 @patch
 @notNull
-double sqrt(@nullCheck num x) => JS<num>('!', r'Math.sqrt(#)', x);
+double sqrt(@nullCheck num x) => JS<double>('!', r'Math.sqrt(#)', x);
 
 @patch
 @notNull
-double sin(@nullCheck num radians) => JS<num>('!', r'Math.sin(#)', radians);
+double sin(@nullCheck num radians) => JS<double>('!', r'Math.sin(#)', radians);
 
 @patch
 @notNull
-double cos(@nullCheck num radians) => JS<num>('!', r'Math.cos(#)', radians);
+double cos(@nullCheck num radians) => JS<double>('!', r'Math.cos(#)', radians);
 
 @patch
 @notNull
-double tan(@nullCheck num radians) => JS<num>('!', r'Math.tan(#)', radians);
+double tan(@nullCheck num radians) => JS<double>('!', r'Math.tan(#)', radians);
 
 @patch
 @notNull
-double acos(@nullCheck num x) => JS<num>('!', r'Math.acos(#)', x);
+double acos(@nullCheck num x) => JS<double>('!', r'Math.acos(#)', x);
 
 @patch
 @notNull
-double asin(@nullCheck num x) => JS<num>('!', r'Math.asin(#)', x);
+double asin(@nullCheck num x) => JS<double>('!', r'Math.asin(#)', x);
 
 @patch
 @notNull
-double atan(@nullCheck num x) => JS<num>('!', r'Math.atan(#)', x);
+double atan(@nullCheck num x) => JS<double>('!', r'Math.atan(#)', x);
 
 @patch
 @notNull
 double atan2(@nullCheck num a, @nullCheck num b) =>
-    JS<num>('!', r'Math.atan2(#, #)', a, b);
+    JS<double>('!', r'Math.atan2(#, #)', a, b);
 
 @patch
 @notNull
-double exp(@nullCheck num x) => JS<num>('!', r'Math.exp(#)', x);
+double exp(@nullCheck num x) => JS<double>('!', r'Math.exp(#)', x);
 
 @patch
 @notNull
-double log(@nullCheck num x) => JS<num>('!', r'Math.log(#)', x);
+double log(@nullCheck num x) => JS<double>('!', r'Math.log(#)', x);
 
 @patch
 @notNull
@@ -69,10 +67,10 @@
 
 @patch
 class Random {
-  static Random _secureRandom;
+  static Random? _secureRandom;
 
   @patch
-  factory Random([int seed]) =>
+  factory Random([int? seed]) =>
       (seed == null) ? const _JSRandom() : _Random(seed);
 
   @patch
@@ -88,7 +86,7 @@
     if (max <= 0 || max > _POW2_32) {
       throw RangeError("max must be in range 0 < max ≤ 2^32, was $max");
     }
-    return JS("int", "(Math.random() * #) >>> 0", max);
+    return JS<int>("int", "(Math.random() * #) >>> 0", max);
   }
 
   /**
@@ -96,13 +94,13 @@
    * the range from 0.0, inclusive, to 1.0, exclusive.
    */
   @notNull
-  double nextDouble() => JS("double", "Math.random()");
+  double nextDouble() => JS<double>("double", "Math.random()");
 
   /**
    * Generates a random boolean value.
    */
   @notNull
-  bool nextBool() => JS("bool", "Math.random() < 0.5");
+  bool nextBool() => JS<bool>("bool", "Math.random() < 0.5");
 }
 
 class _Random implements Random {
@@ -240,7 +238,7 @@
     do {
       _nextState();
       rnd32 = _lo;
-      result = rnd32.remainder(max); // % max;
+      result = rnd32.remainder(max).toInt(); // % max;
     } while ((rnd32 - result + max) >= _POW2_32);
     return result;
   }
@@ -327,7 +325,7 @@
     }
     _buffer.setUint32(0, 0);
     int start = 4 - byteCount;
-    int randomLimit = pow(256, byteCount);
+    int randomLimit = pow(256, byteCount).toInt();
     while (true) {
       _getRandomBytes(start, byteCount);
       // The getUint32 method is big-endian as default.
@@ -336,7 +334,7 @@
         // Max is power of 2.
         return random & (max - 1);
       }
-      int result = random.remainder(max);
+      int result = random.remainder(max).toInt();
       // Ensure results have equal probability by rejecting values in the
       // last range of k*max .. 256**byteCount.
       // TODO: Consider picking a higher byte count if the last range is a
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart
index 9cf539b..d1c6a1a 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/typed_data_patch.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.6
-
 import 'dart:_js_helper' show patch;
 import 'dart:_native_typed_data';
 
diff --git a/sdk/lib/_internal/js_dev_runtime/private/annotations.dart b/sdk/lib/_internal/js_dev_runtime/private/annotations.dart
index feac26e..9062f31 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/annotations.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/annotations.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.6
-
 part of dart._js_helper;
 
 /// Tells the optimizing compiler to always inline the annotated method.
@@ -83,7 +81,7 @@
   /// Used for classes where Dart subclasses should be callable from JavaScript
   /// matching the JavaScript calling conventions.
   final String name;
-  const JsPeerInterface({this.name});
+  const JsPeerInterface({required this.name});
 }
 
 /// A Dart interface may only be implemented by a native JavaScript object
diff --git a/sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart b/sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart
index c387062..14444e3 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/custom_hash_map.dart
@@ -2,30 +2,28 @@
 // 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.6
-
 part of dart._js_helper;
 
 class CustomKeyHashMap<K, V> extends CustomHashMap<K, V> {
-  final _Predicate<Object> _validKey;
+  final _Predicate<Object?> _validKey;
   CustomKeyHashMap(_Equality<K> equals, _Hasher<K> hashCode, this._validKey)
       : super(equals, hashCode);
 
   @override
   @notNull
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (!_validKey(key)) return false;
     return super.containsKey(key);
   }
 
   @override
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (!_validKey(key)) return null;
     return super[key];
   }
 
   @override
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (!_validKey(key)) return null;
     return super.remove(key);
   }
@@ -69,7 +67,7 @@
   Iterable<V> get values => _JSMapIterable<V>(this, false);
 
   @notNull
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (key is K) {
       var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
       if (buckets != null) {
@@ -83,7 +81,7 @@
     return false;
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (var v in JS('', '#.values()', _map)) {
       if (value == v) return true;
     }
@@ -96,7 +94,7 @@
     });
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (key is K) {
       var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
       if (buckets != null) {
@@ -152,13 +150,13 @@
       JS('', '#.push(#)', buckets, key);
     }
     V value = ifAbsent();
-    if (value == null) value = null; // coerce undefined to null.
+    if (value == null) JS('', '# = null', value); // coerce undefined to null.
     JS('', '#.set(#, #)', _map, key, value);
     _modifications = (_modifications + 1) & 0x3ffffff;
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (key is K) {
       int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
       var keyMap = _keyMap;
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart
index 1592218..bb58063 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.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.6
-
 /// This library defines the operations that define and manipulate Dart
 /// classes.  Included in this are:
 ///   - Generics
@@ -109,7 +107,7 @@
 @JSExportName('implements')
 final implements_ = JS('', 'Symbol("implements")');
 
-List Function() getImplements(clazz) => JS(
+List? Function() getImplements(clazz) => JS(
     '',
     'Object.hasOwnProperty.call(#, #) ? #[#] : null',
     clazz,
@@ -229,11 +227,11 @@
 
 // TODO(markzipan): Make this non-nullable if we can ensure this returns
 // an empty list or if null and the empty list are semantically the same.
-List getGenericArgs(type) =>
+List? getGenericArgs(type) =>
     JS<List>('', '#', safeGetOwnProperty(type, _typeArguments));
 
-List getGenericArgVariances(type) =>
-    JS<List>('', '#', safeGetOwnProperty(type, _variances));
+List? getGenericArgVariances(type) =>
+    JS<List?>('', '#', safeGetOwnProperty(type, _variances));
 
 void setGenericArgVariances(f, variances) =>
     JS('', '#[#] = #', f, _variances, variances);
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
index 7d69599..ba418a4 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.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.6
-
 part of dart._runtime;
 
 // We need to set these properties while the sdk is only partially initialized
@@ -21,15 +19,15 @@
 
 // TODO(nshahan) Cleanup embeded strings and extract file location at runtime
 // from the stacktrace.
-assertFailed(String message,
-    [String fileUri, int line, int column, String conditionSource]) {
+assertFailed(String? message,
+    [String? fileUri, int? line, int? column, String? conditionSource]) {
   throw AssertionErrorImpl(message, fileUri, line, column, conditionSource);
 }
 
 final _nullFailedSet = JS('!', 'new Set()');
 // Run-time null safety assertion per:
 // https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#automatic-debug-assertion-insertion
-nullFailed(String fileUri, int line, int column, String variable) {
+nullFailed(String? fileUri, int? line, int? column, String? variable) {
   if (strictNullSafety) {
     throw AssertionErrorImpl(
         'A null value was passed into a non-nullable parameter $variable',
@@ -47,7 +45,7 @@
   }
 }
 
-throwCyclicInitializationError([String field]) {
+throwCyclicInitializationError([String? field]) {
   throw CyclicInitializationError(field);
 }
 
@@ -101,7 +99,7 @@
 ///
 /// If the throw originated in JavaScript, then there is not a corresponding
 /// Dart value, so we just return the error object.
-Object getThrown(Object error) {
+Object? getThrown(Object? error) {
   if (error != null) {
     // Get the Dart thrown value, if any.
     var value = JS('', '#[#]', error, _thrownValue);
@@ -123,7 +121,7 @@
 /// the corresponding stack trace the same way we do for Dart throws. If the
 /// throw object was not an Error, then we don't have a JS trace, so we create
 /// one here.
-StackTrace stackTrace(Object error) {
+StackTrace stackTrace(Object? error) {
   if (JS<bool>('!', '!(# instanceof Error)', error)) {
     // We caught something that isn't a JS Error.
     //
@@ -133,7 +131,7 @@
   }
 
   // If we've already created the Dart stack trace object, return it.
-  StackTrace trace = JS('', '#[#]', error, _stackTrace);
+  StackTrace? trace = JS('', '#[#]', error, _stackTrace);
   if (trace != null) return trace;
 
   // Otherwise create the Dart stack trace (by parsing the JS stack), and
@@ -210,7 +208,7 @@
 /// Implements `throw` of [exception], allowing for throw in an expression
 /// context, and capturing the current stack trace.
 @JSExportName('throw')
-void throw_(Object exception) {
+void throw_(Object? exception) {
   /// Wrap the object so we capture a new stack trace, and so it will print
   /// nicely from JS, as if it were a normal JS error.
   JS('', 'throw new #(#)', DartError, exception);
@@ -233,7 +231,7 @@
 /// If the stack trace is null, this will preserve the original stack trace
 /// on the exception, if available, otherwise it will capture the current stack
 /// trace.
-Object createErrorWithStack(Object exception, StackTrace trace) {
+Object? createErrorWithStack(Object exception, StackTrace? trace) {
   if (trace == null) {
     var error = JS('', '#[#]', exception, _jsError);
     return error != null ? error : JS('', 'new #(#)', DartError, exception);
@@ -257,18 +255,18 @@
 }
 
 class _StackTrace implements StackTrace {
-  final Object _jsError;
-  final Object _jsObjectMissingTrace;
-  String _trace;
+  final Object? _jsError;
+  final Object? _jsObjectMissingTrace;
+  String? _trace;
 
   _StackTrace(this._jsError) : _jsObjectMissingTrace = null;
 
-  _StackTrace.missing(Object caughtObj)
+  _StackTrace.missing(Object? caughtObj)
       : _jsObjectMissingTrace = caughtObj != null ? caughtObj : 'null',
         _jsError = JS('', 'Error()');
 
   String toString() {
-    if (_trace != null) return _trace;
+    if (_trace != null) return _trace!;
 
     var e = _jsError;
     String trace = '';
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart
index 313bdc3..fd9a7d4 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.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.6
-
 /// This library defines runtime operations on objects used by the code
 /// generator.
 part of dart._runtime;
@@ -19,7 +17,7 @@
   final bool isSetter;
   final String failureMessage;
 
-  InvocationImpl(memberName, List<Object> positionalArguments,
+  InvocationImpl(memberName, List<Object?> positionalArguments,
       {namedArguments,
       List typeArguments = const [],
       this.isMethod = false,
@@ -146,7 +144,7 @@
 /// [actuals] and [namedActuals].
 ///
 /// Returns `null` if all checks pass.
-String _argumentErrors(FunctionType type, List actuals, namedActuals) {
+String? _argumentErrors(FunctionType type, List actuals, namedActuals) {
   // Check for too few required arguments.
   int actualsCount = JS('!', '#.length', actuals);
   var required = type.args;
@@ -165,7 +163,7 @@
   }
 
   // Check if we have invalid named arguments.
-  Iterable names;
+  Iterable? names;
   var named = type.named;
   var requiredNamed = type.requiredNamed;
   if (namedActuals != null) {
@@ -444,7 +442,7 @@
   return castError(obj, type);
 }
 
-bool test(bool obj) {
+bool test(bool? obj) {
   if (obj == null) throw BooleanConversionAssertionError();
   return obj;
 }
@@ -513,11 +511,11 @@
 // Keeping the paths is probably expensive.  It would probably
 // be more space efficient to just use a direct hash table with
 // an appropriately defined structural equality function.
-Object _lookupNonTerminal(Object map, Object key) {
+Object _lookupNonTerminal(Object map, Object? key) {
   var result = JS('', '#.get(#)', map, key);
   if (result != null) return result;
   JS('', '#.set(#, # = new Map())', map, key, result);
-  return result;
+  return result!;
 }
 
 Map<K, V> constMap<K, V>(JSArray elements) {
@@ -527,7 +525,7 @@
     map = _lookupNonTerminal(map, JS('', '#[#]', elements, i));
   }
   map = _lookupNonTerminal(map, K);
-  Map<K, V> result = JS('', '#.get(#)', map, V);
+  Map<K, V>? result = JS('', '#.get(#)', map, V);
   if (result != null) return result;
   result = ImmutableMap<K, V>.from(elements);
   JS('', '#.set(#, #)', map, V, result);
@@ -550,7 +548,7 @@
   for (var i = 0; i < count; i++) {
     map = _lookupNonTerminal(map, JS('', '#[#]', elements, i));
   }
-  Set<E> result = JS('', '#.get(#)', map, E);
+  Set<E>? result = JS('', '#.get(#)', map, E);
   if (result != null) return result;
   result = _createImmutableSet<E>(elements);
   JS('', '#.set(#, #)', map, E, result);
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart
index 4d731ce..1f362a8 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.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.6
-
 /// This library defines the association between runtime objects and
 /// runtime types.
 part of dart._runtime;
@@ -116,7 +114,7 @@
 }
 
 /// Return the module name for a raw library object.
-String getModuleName(Object module) => JS('', '#[#]', module, _moduleName);
+String? getModuleName(Object module) => JS('', '#[#]', module, _moduleName);
 
 final _loadedModules = JS('', 'new Map()');
 final _loadedPartMaps = JS('', 'new Map()');
@@ -126,7 +124,7 @@
   return JS<List<String>>('', 'Array.from(#.keys())', _loadedModules);
 }
 
-String getSourceMap(String moduleName) {
+String? getSourceMap(String moduleName) {
   return JS('!', '#.get(#)', _loadedSourceMaps, moduleName);
 }
 
@@ -143,7 +141,7 @@
 
 /// Track all libraries
 void trackLibraries(
-    String moduleName, Object libraries, Object parts, String sourceMap) {
+    String moduleName, Object libraries, Object parts, String? sourceMap) {
   if (parts is String) {
     // Added for backwards compatibility.
     // package:build_web_compilers currently invokes this without [parts]
@@ -159,9 +157,9 @@
   _parts = null;
 }
 
-List<String> _libraries;
-Map<String, Object> _libraryObjects;
-Map<String, List<String>> _parts;
+List<String>? _libraries;
+Map<String, Object?>? _libraryObjects;
+Map<String, List<String>?>? _parts;
 
 _computeLibraryMetadata() {
   _libraries = [];
@@ -174,16 +172,16 @@
     // TODO(nshahan) Can we optimize this cast and the one below to use
     // JsArray.of() to be more efficient?
     var libraries = getOwnPropertyNames(module).cast<String>();
-    _libraries.addAll(libraries);
+    _libraries!.addAll(libraries);
     for (var library in libraries) {
-      _libraryObjects[library] = JS('', '#.#', module, library);
+      _libraryObjects![library] = JS('', '#.#', module, library);
     }
 
     // Add parts from each module.
     var partMap = getModulePartMap(name);
     libraries = getOwnPropertyNames(partMap).cast<String>();
     for (var library in libraries) {
-      _parts[library] = List.from(JS('List', '#.#', partMap, library));
+      _parts![library] = List.from(JS('List', '#.#', partMap, library));
     }
   }
 }
@@ -191,11 +189,11 @@
 /// Returns the JS library object for a given library [uri] or
 /// undefined / null if it isn't loaded.  Top-level types and
 /// methods are available on this object.
-Object getLibrary(String uri) {
+Object? getLibrary(String uri) {
   if (_libraryObjects == null) {
     _computeLibraryMetadata();
   }
-  return _libraryObjects[uri];
+  return _libraryObjects![uri];
 }
 
 /// Returns a JSArray of library uris (e.g,
@@ -205,7 +203,7 @@
   if (_libraries == null) {
     _computeLibraryMetadata();
   }
-  return _libraries;
+  return _libraries!;
 }
 
 /// Returns a JSArray of part uris for a given [libraryUri].
@@ -225,5 +223,5 @@
   if (_parts == null) {
     _computeLibraryMetadata();
   }
-  return _parts[libraryUri] ?? [];
+  return _parts![libraryUri] ?? [];
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
index 433393d..4867462 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.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.6
-
 @ReifyFunctionTypes(false)
 library dart._runtime;
 
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
index 48d54ad..f5f25a0 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.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.6
-
 /// This library defines the representation of runtime types.
 part of dart._runtime;
 
@@ -118,7 +116,7 @@
   bool is_T(object) => true;
 
   @JSExportName('as')
-  Object as_T(Object object) => object;
+  Object? as_T(Object? object) => object;
 }
 
 @notNull
@@ -144,7 +142,7 @@
 Expando<Function> _assertInteropExpando = Expando<Function>();
 
 @NoReifyGeneric()
-F tearoffInterop<F extends Function>(F f) {
+F tearoffInterop<F extends Function?>(F f) {
   // Wrap a JS function with a closure that ensures all function arguments are
   // native JS functions.
   if (!_isJsObject(f) || f == null) return f;
@@ -171,10 +169,10 @@
 /// we disable type checks for in these cases, and allow any JS object to work
 /// as if it were an instance of this JS type.
 class LazyJSType extends DartType {
-  Function() _getRawJSTypeFn;
+  Function()? _getRawJSTypeFn;
   @notNull
   final String _dartName;
-  Object _rawJSType;
+  Object? _rawJSType;
 
   LazyJSType(this._getRawJSTypeFn, this._dartName);
 
@@ -183,7 +181,7 @@
     return raw != null ? typeName(raw) : "JSObject<$_dartName>";
   }
 
-  Object _getRawJSType() {
+  Object? _getRawJSType() {
     var raw = _rawJSType;
     if (raw != null) return raw;
 
@@ -193,7 +191,7 @@
     // overhead, especially if exceptions are being thrown. Also it means the
     // behavior of a given type check can change later on.
     try {
-      raw = _getRawJSTypeFn();
+      raw = _getRawJSTypeFn!();
     } catch (e) {}
 
     if (raw == null) {
@@ -434,7 +432,7 @@
   bool is_T(object) => true;
 
   @JSExportName('as')
-  Object as_T(Object object) => object;
+  Object? as_T(Object? object) => object;
 }
 
 @JSExportName('void')
@@ -685,7 +683,7 @@
   // Named arguments native JS Object of the form { namedArgName: namedArgType }
   final named;
   final requiredNamed;
-  String _stringValue;
+  String? _stringValue;
 
   /// Construct a function type.
   ///
@@ -743,7 +741,7 @@
   }
 
   /// Maps argument names to their canonicalized type.
-  Map<String, Object> _createNameMap(List<Object> names) {
+  Map<String, Object> _createNameMap(List<Object?> names) {
     var result = <String, Object>{};
     // TODO: Remove this sort if ordering can be conserved.
     JS('', '#.sort()', names);
@@ -763,7 +761,7 @@
       _createNameMap(getOwnPropertyNames(requiredNamed).toList());
 
   get name {
-    if (_stringValue != null) return _stringValue;
+    if (_stringValue != null) return _stringValue!;
     var buffer = '(';
     for (var i = 0; JS<bool>('!', '# < #.length', i, args); ++i) {
       if (i > 0) {
@@ -858,7 +856,7 @@
   final typeFormals;
   final typeBounds;
   final FunctionType function;
-  String _stringValue;
+  String? _stringValue;
 
   GenericFunctionTypeIdentifier(
       this.typeFormals, this.typeBounds, this.function);
@@ -869,7 +867,7 @@
   /// Type formal names may not correspond to those of the originating type.
   /// We should consider auto-generating these to avoid confusion.
   toString() {
-    if (_stringValue != null) return _stringValue;
+    if (_stringValue != null) return _stringValue!;
     String s = "<";
     var typeFormals = this.typeFormals;
     var typeBounds = this.typeBounds;
@@ -994,7 +992,7 @@
     // formal if known, or it will be the original TypeVariable if we are still
     // solving for it. This array is passed to `instantiateToBounds` as we are
     // progressively solving for type variables.
-    var defaults = List<Object>.filled(typeFormals.length, null);
+    var defaults = List<Object?>.filled(typeFormals.length, null);
     // not ground
     var partials = Map<TypeVariable, Object>.identity();
 
@@ -1037,9 +1035,9 @@
     while (hasProgress) {
       hasProgress = false;
       for (var typeFormal in partials.keys) {
-        var partialBound = partials[typeFormal];
+        var partialBound = partials[typeFormal]!;
         if (!hasFreeFormal(partialBound)) {
-          int index = all[typeFormal];
+          int index = all[typeFormal]!;
           defaults[index] = instantiateTypeBounds(defaults)[index];
           partials.remove(typeFormal);
           hasProgress = true;
@@ -1079,7 +1077,7 @@
   }
 }
 
-List<TypeVariable> _typeFormalsFromFunction(Object typeConstructor) {
+List<TypeVariable> _typeFormalsFromFunction(Object? typeConstructor) {
   // Extract parameter names from the function parameters.
   //
   // This is not robust in general for user-defined JS functions, but it
@@ -1415,10 +1413,10 @@
     let t1TypeArg = ${getGenericArgs(t1)}[0];
     if (${_isFutureOr(t2)}) {
       let t2TypeArg = ${getGenericArgs(t2)}[0];
-      // FutureOr<A> <: FutureOr<B> iff A <: B
-      // TODO(nshahan): Proven to not actually be true and needs cleanup.
-      // https://github.com/dart-lang/sdk/issues/38818
-      return $_isSubtype(t1TypeArg, t2TypeArg, $strictMode);
+      // FutureOr<A> <: FutureOr<B> if A <: B
+      if ($_isSubtype(t1TypeArg, t2TypeArg, $strictMode)) {
+        return true;
+      }
     }
 
     // given t1 is Future<A> | A, then:
@@ -1610,7 +1608,7 @@
   return false;
 })()''');
 
-Object extractTypeArguments<T>(T instance, Function f) {
+Object? extractTypeArguments<T>(T instance, Function f) {
   if (instance == null) {
     throw ArgumentError('Cannot extract type of null instance.');
   }
@@ -1622,7 +1620,7 @@
     throw ArgumentError('Cannot extract from non-class type ($type).');
   }
   var typeArguments = getGenericArgs(type);
-  if (typeArguments.isEmpty) {
+  if (typeArguments!.isEmpty) {
     throw ArgumentError('Cannot extract from non-generic type ($type).');
   }
   var supertype = _getMatchingSupertype(getReifiedType(instance), type);
@@ -1646,14 +1644,14 @@
             typeVariables, typeVariables.map((_) => TypeConstraint()));
 
   /// Returns the inferred types based on the current constraints.
-  List<Object> getInferredTypes() {
+  List<Object>? getInferredTypes() {
     var result = <Object>[];
     for (var constraint in _typeVariables.values) {
       // Prefer the known bound, if any.
       if (constraint.lower != null) {
-        result.add(constraint.lower);
+        result.add(constraint.lower!);
       } else if (constraint.upper != null) {
-        result.add(constraint.upper);
+        result.add(constraint.upper!);
       } else {
         return null;
       }
@@ -1670,11 +1668,11 @@
       _isSubtypeMatch(subtype, supertype);
 
   void _constrainLower(TypeVariable parameter, Object lower) {
-    _typeVariables[parameter]._constrainLower(lower);
+    _typeVariables[parameter]!._constrainLower(lower);
   }
 
   void _constrainUpper(TypeVariable parameter, Object upper) {
-    _typeVariables[parameter]._constrainUpper(upper);
+    _typeVariables[parameter]!._constrainUpper(upper);
   }
 
   bool _isFunctionSubtypeMatch(FunctionType subtype, FunctionType supertype) {
@@ -1740,13 +1738,13 @@
     for (var name in supertypeNamed.keys) {
       var subtypeParamType = subtypeNamed[name];
       if (subtypeParamType == null) return false;
-      if (!_isSubtypeMatch(supertypeNamed[name], subtypeParamType)) {
+      if (!_isSubtypeMatch(supertypeNamed[name]!, subtypeParamType)) {
         return false;
       }
     }
     for (var name in supertypeRequiredNamed.keys) {
-      var subtypeParamType = subtypeRequiredNamed[name] ?? subtypeNamed[name];
-      if (!_isSubtypeMatch(supertypeRequiredNamed[name], subtypeParamType)) {
+      var subtypeParamType = subtypeRequiredNamed[name] ?? subtypeNamed[name]!;
+      if (!_isSubtypeMatch(supertypeRequiredNamed[name]!, subtypeParamType)) {
         return false;
       }
     }
@@ -1777,8 +1775,8 @@
     var matchingSupertype = _getMatchingSupertype(subtype, supertype);
     if (matchingSupertype == null) return false;
 
-    var matchingTypeArgs = getGenericArgs(matchingSupertype);
-    var supertypeTypeArgs = getGenericArgs(supertype);
+    var matchingTypeArgs = getGenericArgs(matchingSupertype)!;
+    var supertypeTypeArgs = getGenericArgs(supertype)!;
     for (int i = 0; i < supertypeTypeArgs.length; i++) {
       if (!_isSubtypeMatch(matchingTypeArgs[i], supertypeTypeArgs[i])) {
         return false;
@@ -1824,13 +1822,13 @@
 
     // Handle FutureOr<T> union type.
     if (_isFutureOr(subtype)) {
-      var subtypeArg = getGenericArgs(subtype)[0];
+      var subtypeArg = getGenericArgs(subtype)![0];
       if (_isFutureOr(supertype)) {
         // `FutureOr<P>` is a subtype match for `FutureOr<Q>` with respect to `L`
         // under constraints `C`:
         // - If `P` is a subtype match for `Q` with respect to `L` under constraints
         //   `C`.
-        var supertypeArg = getGenericArgs(supertype)[0];
+        var supertypeArg = getGenericArgs(supertype)![0];
         return _isSubtypeMatch(subtypeArg, supertypeArg);
       }
 
@@ -1843,7 +1841,7 @@
       var subtypeFuture =
           JS<Object>('!', '#(#)', getGenericClass(Future), subtypeArg);
       return _isSubtypeMatch(subtypeFuture, supertype) &&
-          _isSubtypeMatch(subtypeArg, supertype);
+          _isSubtypeMatch(subtypeArg!, supertype);
     }
 
     if (_isFutureOr(supertype)) {
@@ -1855,7 +1853,7 @@
       //   constraints `C`
       //   - And `P` is a subtype match for `Q` with respect to `L` under
       //     constraints `C`
-      var supertypeArg = getGenericArgs(supertype)[0];
+      var supertypeArg = getGenericArgs(supertype)![0];
       var supertypeFuture =
           JS<Object>('!', '#(#)', getGenericClass(Future), supertypeArg);
       return _isSubtypeMatch(subtype, supertypeFuture) ||
@@ -1950,11 +1948,11 @@
 class TypeConstraint {
   /// The lower bound of the type being constrained.  This bound must be a
   /// subtype of the type being constrained.
-  Object lower;
+  Object? lower;
 
   /// The upper bound of the type being constrained.  The type being constrained
   /// must be a subtype of this bound.
-  Object upper;
+  Object? upper;
 
   void _constrainLower(Object type) {
     var _lower = lower;
@@ -1991,7 +1989,7 @@
 
 /// Finds a supertype of [subtype] that matches the class [supertype], but may
 /// contain different generic type arguments.
-Object _getMatchingSupertype(Object subtype, Object supertype) {
+Object? _getMatchingSupertype(Object? subtype, Object supertype) {
   if (identical(subtype, supertype)) return supertype;
   if (subtype == null || _equalType(subtype, Object)) return null;
 
@@ -2014,7 +2012,7 @@
   // Check interfaces.
   var getInterfaces = getImplements(subtype);
   if (getInterfaces != null) {
-    for (var iface in getInterfaces()) {
+    for (var iface in getInterfaces()!) {
       result = _getMatchingSupertype(iface, supertype);
       if (result != null) return result;
     }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart
index d202ff0..07a2faa 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.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.6
-
 part of dart._runtime;
 
 /// This library defines a set of general javascript utilities for us
@@ -19,11 +17,11 @@
 }
 
 final Function(Object, Object,
-    {Object get,
-    Object set,
-    Object value,
-    bool configurable,
-    bool writable}) defineAccessor = JS('', 'Object.defineProperty');
+    {Object? get,
+    Object? set,
+    Object? value,
+    bool? configurable,
+    bool? writable}) defineAccessor = JS('', 'Object.defineProperty');
 
 final dynamic Function(Object, Object) getOwnPropertyDescriptor =
     JS('', 'Object.getOwnPropertyDescriptor');
diff --git a/sdk/lib/_internal/js_dev_runtime/private/debugger.dart b/sdk/lib/_internal/js_dev_runtime/private/debugger.dart
index db11479..f77d5c3 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/debugger.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/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.6
-
 library dart._debugger;
 
 import 'dart:_foreign_helper' show JS;
@@ -171,7 +169,7 @@
 /// [JsonMLFormatter] consumes [NameValuePair] objects and
 class NameValuePair {
   NameValuePair(
-      {this.name,
+      {this.name = '',
       this.value,
       this.config = JsonMLConfig.none,
       this.hideName = false});
@@ -187,7 +185,7 @@
   int get hashCode => name.hashCode;
 
   final String name;
-  final Object value;
+  final Object? value;
   final JsonMLConfig config;
   final bool hideName;
 
@@ -197,8 +195,8 @@
 class MapEntry {
   MapEntry({this.key, this.value});
 
-  final Object key;
-  final Object value;
+  final Object? key;
+  final Object? value;
 }
 
 class IterableSpan {
@@ -216,7 +214,7 @@
   /// 10000-length subset and 1 1-length subset.
   int get maxPowerOfSubsetSize =>
       (log(length - .5) / log(_maxSpanLength)).truncate();
-  int get subsetSize => pow(_maxSpanLength, maxPowerOfSubsetSize);
+  int get subsetSize => pow(_maxSpanLength, maxPowerOfSubsetSize).toInt();
 
   Map<int, dynamic> asMap() =>
       iterable.skip(start).take(length).toList().asMap();
@@ -284,7 +282,7 @@
 /// Devtools Formatter API.
 class JsonMLElement {
   dynamic _attributes;
-  List _jsonML;
+  late List _jsonML;
 
   JsonMLElement(tagName) {
     _attributes = JS('', '{}');
@@ -408,7 +406,7 @@
       // The value is indented when it is on a different line from the name
       // by setting right padding of the name to -13px and the padding of the
       // value to 13px.
-      JsonMLElement nameSpan;
+      JsonMLElement? nameSpan;
       var valueStyle = '';
       if (!child.hideName) {
         nameSpan = JsonMLElement('span')
@@ -444,38 +442,36 @@
 
 abstract class Formatter {
   bool accept(object, config);
-  String preview(object);
+  String? preview(object);
   bool hasChildren(object);
-  List<NameValuePair> children(object);
+  List<NameValuePair>? children(object);
 }
 
 class DartFormatter {
-  List<Formatter> _formatters;
+  final List<Formatter> _formatters;
 
-  DartFormatter() {
-    // The order of formatters matters as formatters earlier in the list take
-    // precedence.
-    _formatters = [
-      ObjectInternalsFormatter(),
-      ClassFormatter(),
-      TypeFormatter(),
-      NamedConstructorFormatter(),
-      MapFormatter(),
-      MapOverviewFormatter(),
-      IterableFormatter(),
-      IterableSpanFormatter(),
-      MapEntryFormatter(),
-      StackTraceFormatter(),
-      ErrorAndExceptionFormatter(),
-      FunctionFormatter(),
-      HeritageClauseFormatter(),
-      LibraryModuleFormatter(),
-      LibraryFormatter(),
-      ObjectFormatter(),
-    ];
-  }
+  DartFormatter()
+      : _formatters = [
+          // Formatters earlier in the list take precedence.
+          ObjectInternalsFormatter(),
+          ClassFormatter(),
+          TypeFormatter(),
+          NamedConstructorFormatter(),
+          MapFormatter(),
+          MapOverviewFormatter(),
+          IterableFormatter(),
+          IterableSpanFormatter(),
+          MapEntryFormatter(),
+          StackTraceFormatter(),
+          ErrorAndExceptionFormatter(),
+          FunctionFormatter(),
+          HeritageClauseFormatter(),
+          LibraryModuleFormatter(),
+          LibraryFormatter(),
+          ObjectFormatter(),
+        ];
 
-  String preview(object, config) {
+  String? preview(object, config) {
     try {
       if (object == null ||
           object is num ||
@@ -509,7 +505,7 @@
     return false;
   }
 
-  List<NameValuePair> children(object, config) {
+  List<NameValuePair>? children(object, config) {
     try {
       if (object != null) {
         for (var formatter in _formatters) {
@@ -558,7 +554,7 @@
 
   bool hasChildren(object) => true;
 
-  List<NameValuePair> children(object) {
+  children(object) {
     var type = dart.getType(object);
     var ret = LinkedHashSet<NameValuePair>();
     // We use a Set rather than a List to avoid duplicates.
@@ -591,12 +587,12 @@
 
 /// Formatter for module Dart Library objects.
 class LibraryModuleFormatter implements Formatter {
-  accept(object, config) => dart.getModuleName(object) != null;
+  bool accept(object, config) => dart.getModuleName(object) != null;
 
   bool hasChildren(object) => true;
 
   String preview(object) {
-    var libraryNames = dart.getModuleName(object).split('/');
+    var libraryNames = dart.getModuleName(object)!.split('/');
     // Library names are received with a repeat directory name, so strip the
     // last directory entry here to make the path cleaner. For example, the
     // library "third_party/dart/utf/utf" shoud display as
@@ -622,7 +618,7 @@
 class LibraryFormatter implements Formatter {
   var genericParameters = HashMap<String, String>();
 
-  accept(object, config) => object is Library;
+  bool accept(object, config) => object is Library;
 
   bool hasChildren(object) => true;
 
@@ -657,7 +653,7 @@
 /// we can distinguish them based on whether they have been tagged with
 /// runtime type information.
 class FunctionFormatter implements Formatter {
-  accept(object, config) {
+  bool accept(object, config) {
     if (_typeof(object) != 'function') return false;
     return dart.getReifiedType(object) != null;
   }
@@ -690,7 +686,7 @@
 class MapOverviewFormatter implements Formatter {
   // Because this comes after MapFormatter in the list, internal
   // maps will be picked up by that formatter.
-  accept(object, config) => object is Map;
+  bool accept(object, config) => object is Map;
 
   bool hasChildren(object) => true;
 
@@ -718,7 +714,7 @@
 /// This is only used for internal maps, or when shown as [[entries]]
 /// from MapOverViewFormatter.
 class MapFormatter implements Formatter {
-  accept(object, config) =>
+  bool accept(object, config) =>
       object is InternalMap || config == JsonMLConfig.asMap;
 
   bool hasChildren(object) => true;
@@ -779,7 +775,7 @@
 }
 
 class NamedConstructorFormatter implements Formatter {
-  accept(object, config) => object is NamedConstructor;
+  bool accept(object, config) => object is NamedConstructor;
 
   // TODO(bmilligan): Display the signature of the named constructor as the
   // preview.
@@ -798,7 +794,7 @@
 /// Formatter for synthetic MapEntry objects used to display contents of a Map
 /// cleanly.
 class MapEntryFormatter implements Formatter {
-  accept(object, config) => object is MapEntry;
+  bool accept(object, config) => object is MapEntry;
 
   String preview(object) {
     MapEntry entry = object;
@@ -839,7 +835,7 @@
 /// Formatter for synthetic IterableSpan objects used to display contents of
 /// an Iterable cleanly.
 class IterableSpanFormatter implements Formatter {
-  accept(object, config) => object is IterableSpan;
+  bool accept(object, config) => object is IterableSpan;
 
   String preview(object) {
     return '[${object.start}...${object.end - 1}]';
@@ -854,7 +850,7 @@
 class ErrorAndExceptionFormatter extends ObjectFormatter {
   static final RegExp _pattern = RegExp(r'\d+\:\d+');
 
-  accept(object, config) => object is Error || object is Exception;
+  bool accept(object, config) => object is Error || object is Exception;
 
   bool hasChildren(object) => true;
 
@@ -867,8 +863,8 @@
             l.contains(_pattern) &&
             !l.contains('dart:sdk') &&
             !l.contains('dart_sdk'),
-        orElse: () => null);
-    return line != null ? '${object} at ${line}' : '${object}';
+        orElse: () => '');
+    return line != '' ? '${object} at ${line}' : '${object}';
   }
 
   List<NameValuePair> children(object) {
@@ -890,7 +886,7 @@
 }
 
 class StackTraceFormatter implements Formatter {
-  accept(object, config) => object is StackTrace;
+  bool accept(object, config) => object is StackTrace;
 
   String preview(object) => 'StackTrace';
 
@@ -908,13 +904,13 @@
 }
 
 class ClassFormatter implements Formatter {
-  accept(object, config) => config == JsonMLConfig.asClass;
+  bool accept(object, config) => config == JsonMLConfig.asClass;
 
   String preview(type) {
-    var implements = dart.getImplements(type);
+    var implements = dart.getImplements(type)();
     var typeName = getTypeName(type);
     if (implements != null) {
-      var typeNames = implements().map(getTypeName);
+      var typeNames = implements.map(getTypeName);
       return '${typeName} implements ${typeNames.join(", ")}';
     } else {
       return typeName;
@@ -979,7 +975,7 @@
 }
 
 class TypeFormatter implements Formatter {
-  accept(object, config) => object is Type;
+  bool accept(object, config) => object is Type;
 
   String preview(object) => object.toString();
 
@@ -995,7 +991,7 @@
 ///
 /// Raw JS stack traces are used if $dartStackTraceUtility has not been
 /// specified.
-StackTraceMapper get stackTraceMapper {
+StackTraceMapper? get stackTraceMapper {
   var _util = JS('', r'#.$dartStackTraceUtility', dart.global_);
   return _util != null ? JS('!', '#.mapper', _util) : null;
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/foreign_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/foreign_helper.dart
index b46e817..7f11505 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/foreign_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/foreign_helper.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.6
-
 library dart._foreign_helper;
 
 /**
@@ -108,7 +106,7 @@
  */
 // Add additional optional arguments if needed. The method is treated internally
 // as a variable argument method.
-T JS<T extends Object>(String typeDescription, String codeTemplate,
+external T JS<T extends Object?>(String typeDescription, String codeTemplate,
     [arg0,
     arg1,
     arg2,
@@ -128,7 +126,7 @@
     arg16,
     arg17,
     arg18,
-    arg19]) {}
+    arg19]);
 
 /// Annotates the compiled Js name for fields and methods.
 /// Similar behaviour to `JS` from `package:js/js.dart` (but usable from runtime
@@ -161,73 +159,73 @@
 /**
  * Returns the prefix used for generated is checks on classes.
  */
-String JS_OPERATOR_IS_PREFIX() {}
+external String JS_OPERATOR_IS_PREFIX();
 
 /**
  * Returns the prefix used for generated type argument substitutions on classes.
  */
-String JS_OPERATOR_AS_PREFIX() {}
+external String JS_OPERATOR_AS_PREFIX();
 
 /// Returns the name of the class `Object` in the generated code.
-String JS_OBJECT_CLASS_NAME() {}
+external String JS_OBJECT_CLASS_NAME();
 
 /// Returns the name of the class `Null` in the generated code.
-String JS_NULL_CLASS_NAME() {}
+external String JS_NULL_CLASS_NAME();
 
 /// Returns the name of the class `Function` in the generated code.
-String JS_FUNCTION_CLASS_NAME() {}
+external String JS_FUNCTION_CLASS_NAME();
 
 /**
  * Returns the field name used for determining if an object or its
  * interceptor has JavaScript indexing behavior.
  */
-String JS_IS_INDEXABLE_FIELD_NAME() {}
+external String JS_IS_INDEXABLE_FIELD_NAME();
 
 /// Returns the name used for generated function types on classes and methods.
-String JS_SIGNATURE_NAME() {}
+external String JS_SIGNATURE_NAME();
 
 /// Returns the name used to tag typedefs.
-String JS_TYPEDEF_TAG() {}
+external String JS_TYPEDEF_TAG();
 
 /// Returns the name used to tag function type representations in JavaScript.
-String JS_FUNCTION_TYPE_TAG() {}
+external String JS_FUNCTION_TYPE_TAG();
 
 /**
  * Returns the name used to tag void return in function type representations
  * in JavaScript.
  */
-String JS_FUNCTION_TYPE_VOID_RETURN_TAG() {}
+external String JS_FUNCTION_TYPE_VOID_RETURN_TAG();
 
 /**
  * Returns the name used to tag return types in function type representations
  * in JavaScript.
  */
-String JS_FUNCTION_TYPE_RETURN_TYPE_TAG() {}
+external String JS_FUNCTION_TYPE_RETURN_TYPE_TAG();
 
 /**
  * Returns the name used to tag required parameters in function type
  * representations in JavaScript.
  */
-String JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG() {}
+external String JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG();
 
 /**
  * Returns the name used to tag optional parameters in function type
  * representations in JavaScript.
  */
-String JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG() {}
+external String JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG();
 
 /**
  * Returns the name used to tag named parameters in function type
  * representations in JavaScript.
  */
-String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG() {}
+external String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG();
 
 /// Returns the JS name for [name] from the Namer.
-String JS_GET_NAME(String name) {}
+external String JS_GET_NAME(String name);
 
 /// Returns the state of a flag that is determined by the state of the compiler
 /// when the program has been analyzed.
-bool JS_GET_FLAG(String name) {}
+external bool JS_GET_FLAG(String name);
 
 /**
  * Pretend [code] is executed.  Generates no executable code.  This is used to
diff --git a/sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart b/sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart
index fa62a8f..eda6c44 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/identity_hash_map.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.6
-
 part of dart._js_helper;
 
 class IdentityMap<K, V> extends InternalMap<K, V> {
@@ -35,11 +33,11 @@
   Iterable<K> get keys => _JSMapIterable<K>(this, true);
   Iterable<V> get values => _JSMapIterable<V>(this, false);
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     return JS<bool>('!', '#.has(#)', _map, key);
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (var v in JS('', '#.values()', _map)) {
       if (v == value) return true;
     }
@@ -56,7 +54,7 @@
     }
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     V value = JS('', '#.get(#)', _map, key);
     return value == null ? null : value; // coerce undefined to null.
   }
@@ -75,13 +73,13 @@
       return JS('', '#.get(#)', _map, key);
     }
     V value = ifAbsent();
-    if (value == null) value = null; // coerce undefined to null.
+    if (value == null) JS('', '# = null', value);
     JS('', '#.set(#, #)', _map, key, value);
     _modifications = (_modifications + 1) & 0x3ffffff;
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     V value = JS('', '#.get(#)', _map, key);
     if (JS<bool>('!', '#.delete(#)', _map, key)) {
       _modifications = (_modifications + 1) & 0x3ffffff;
@@ -130,10 +128,10 @@
 
   Iterator<E> get iterator => DartIterator<E>(_jsIterator());
 
-  bool contains(Object element) =>
+  bool contains(Object? element) =>
       _isKeys ? _map.containsKey(element) : _map.containsValue(element);
 
-  void forEach(void f(E element)) {
+  void forEach(void Function(E) f) {
     for (var entry in this) f(entry);
   }
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/interceptors.dart b/sdk/lib/_internal/js_dev_runtime/private/interceptors.dart
index db81230..04d492f 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/interceptors.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/interceptors.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.6
-
 library dart._interceptors;
 
 import 'dart:collection';
@@ -122,15 +120,15 @@
   static final _extensionName = RegExp(r"^Symbol\(dartx\.(.+)\)$");
   static final _privateName = RegExp(r"^Symbol\((_.+)\)$");
 
-  String _fieldName(String message) {
-    var match = _nullError.firstMatch(message);
+  String? _fieldName(String message) {
+    RegExpMatch? match = _nullError.firstMatch(message);
     if (match == null) return null;
-    var name = match[1];
+    String name = match[1]!;
     match = _extensionName.firstMatch(name) ?? _privateName.firstMatch(name);
     return match != null ? match[1] : name;
   }
 
-  String _functionCallTarget(String message) {
+  String? _functionCallTarget(String message) {
     var match = _notAFunction.firstMatch(message);
     return match != null ? match[1] : null;
   }
@@ -180,7 +178,7 @@
   // TODO(jmesserly): remove these once we canonicalize tearoffs.
   operator ==(other) {
     if (other == null) return false;
-    var boundObj = JS<Object>('', '#._boundObject', this);
+    var boundObj = JS<Object?>('', '#._boundObject', this);
     if (boundObj == null) return JS<bool>('!', '# === #', this, other);
     return JS(
         'bool',
@@ -192,7 +190,7 @@
   }
 
   get hashCode {
-    var boundObj = JS<Object>('', '#._boundObject', this);
+    var boundObj = JS<Object?>('', '#._boundObject', this);
     if (boundObj == null) return identityHashCode(this);
 
     var boundMethod = JS<Object>('!', '#._boundMethod', this);
@@ -229,7 +227,7 @@
 // Warning: calls to these methods need to be removed before custom elements
 // and cross-frame dom objects behave correctly in ddc.
 // See https://github.com/dart-lang/sdk/issues/28326
-findInterceptorConstructorForType(Type type) {}
-findConstructorForNativeSubclassType(Type type, String name) {}
+findInterceptorConstructorForType(Type? type) {}
+findConstructorForNativeSubclassType(Type? type, String name) {}
 getNativeInterceptor(object) {}
 setDispatchProperty(object, value) {}
diff --git a/sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart
index 78e8e19..6576653 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/isolate_helper.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.6
-
 library dart._isolate_helper;
 
 import 'dart:_runtime' as dart;
@@ -36,7 +34,7 @@
 
 class TimerImpl implements Timer {
   final bool _once;
-  int _handle;
+  int? _handle;
   int _tick = 0;
 
   TimerImpl(int milliseconds, void callback()) : _once = true {
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_array.dart b/sdk/lib/_internal/js_dev_runtime/private/js_array.dart
index 913053b..4538120 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_array.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_array.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.6
-
 part of dart._interceptors;
 
 /**
@@ -120,7 +118,7 @@
     return JS('var', r'#.pop()', this);
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     checkGrowable('remove');
     var length = this.length;
     for (int i = 0; i < length; i++) {
@@ -135,17 +133,17 @@
   /**
    * Removes elements matching [test] from [this] List.
    */
-  void removeWhere(bool test(E element)) {
+  void removeWhere(bool Function(E) test) {
     checkGrowable('removeWhere');
     _removeWhere(test, true);
   }
 
-  void retainWhere(bool test(E element)) {
+  void retainWhere(bool Function(E) test) {
     checkGrowable('retainWhere');
     _removeWhere(test, false);
   }
 
-  void _removeWhere(bool test(E element), bool removeMatching) {
+  void _removeWhere(bool Function(E) test, bool removeMatching) {
     // Performed in two steps, to avoid exposing an inconsistent state
     // to the [test] function. First the elements to retain are found, and then
     // the original list is updated to contain those elements.
@@ -156,8 +154,6 @@
     List retained = [];
     int end = this.length;
     for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       // !test() ensures bool conversion in checked mode.
       if (!test(element) == removeMatching) {
@@ -174,11 +170,11 @@
     }
   }
 
-  Iterable<E> where(bool f(E element)) {
+  Iterable<E> where(bool Function(E) f) {
     return WhereIterable<E>(this, f);
   }
 
-  Iterable<T> expand<T>(Iterable<T> f(E element)) {
+  Iterable<T> expand<T>(Iterable<T> Function(E) f) {
     return ExpandIterable<E, T>(this, f);
   }
 
@@ -196,24 +192,22 @@
     length = 0;
   }
 
-  void forEach(void f(E element)) {
+  void forEach(void Function(E) f) {
     int end = this.length;
     for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       f(element);
       if (this.length != end) throw ConcurrentModificationError(this);
     }
   }
 
-  Iterable<T> map<T>(T f(E element)) {
+  Iterable<T> map<T>(T Function(E) f) {
     return MappedListIterable<E, T>(this, f);
   }
 
   String join([String separator = ""]) {
     var length = this.length;
-    var list = List(length);
+    var list = List<String>.filled(length, "");
     for (int i = 0; i < length; i++) {
       list[i] = "${this[i]}";
     }
@@ -232,7 +226,7 @@
     return SubListIterable<E>(this, n, null);
   }
 
-  Iterable<E> skipWhile(bool test(E value)) {
+  Iterable<E> skipWhile(bool Function(E) test) {
     return SkipWhileIterable<E>(this, test);
   }
 
@@ -241,8 +235,6 @@
     if (length == 0) throw IterableElementError.noElement();
     E value = this[0];
     for (int i = 1; i < length; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       value = combine(value, element);
       if (length != this.length) throw ConcurrentModificationError(this);
@@ -250,12 +242,10 @@
     return value;
   }
 
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
+  T fold<T>(T initialValue, T Function(T previousValue, E element) combine) {
     var value = initialValue;
     int length = this.length;
     for (int i = 0; i < length; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       value = combine(value, element);
       if (this.length != length) throw ConcurrentModificationError(this);
@@ -263,11 +253,9 @@
     return value;
   }
 
-  E firstWhere(bool test(E value), {E orElse()}) {
+  E firstWhere(bool Function(E) test, {E Function()? orElse}) {
     int end = this.length;
     for (int i = 0; i < end; ++i) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       if (test(element)) return element;
       if (this.length != end) throw ConcurrentModificationError(this);
@@ -276,11 +264,9 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E element), {E orElse()}) {
+  E lastWhere(bool Function(E) test, {E Function()? orElse}) {
     int length = this.length;
     for (int i = length - 1; i >= 0; i--) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       if (test(element)) return element;
       if (length != this.length) {
@@ -291,13 +277,11 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E element), {E orElse()}) {
+  E singleWhere(bool Function(E) test, {E Function()? orElse}) {
     int length = this.length;
-    E match = null;
+    E? match = null;
     bool matchFound = false;
     for (int i = 0; i < length; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       if (test(element)) {
         if (matchFound) {
@@ -310,7 +294,7 @@
         throw ConcurrentModificationError(this);
       }
     }
-    if (matchFound) return match;
+    if (matchFound) return match as E;
     if (orElse != null) return orElse();
     throw IterableElementError.noElement();
   }
@@ -319,7 +303,7 @@
     return this[index];
   }
 
-  List<E> sublist(@nullCheck int start, [int end]) {
+  List<E> sublist(@nullCheck int start, [int? end]) {
     if (start < 0 || start > length) {
       throw RangeError.range(start, 0, length, "start");
     }
@@ -373,7 +357,7 @@
     if (length == 0) return;
     RangeError.checkNotNegative(skipCount, "skipCount");
 
-    List<E> otherList;
+    var otherList = <E>[];
     int otherStart = 0;
     // TODO(floitsch): Make this accept more.
     if (iterable is List<E>) {
@@ -405,12 +389,12 @@
     }
   }
 
-  void fillRange(@nullCheck int start, @nullCheck int end, [E fillValue]) {
+  void fillRange(@nullCheck int start, @nullCheck int end, [E? fillValue]) {
     checkMutable('fill range');
     RangeError.checkValidRange(start, end, this.length);
+    E checkedFillValue = fillValue as E;
     for (int i = start; i < end; i++) {
-      // Store is safe since [fillValue] type has been checked as parameter.
-      JS('', '#[#] = #', this, i, fillValue);
+      JS('', '#[#] = #', this, i, checkedFillValue);
     }
   }
 
@@ -443,11 +427,9 @@
     }
   }
 
-  bool any(bool test(E element)) {
+  bool any(bool Function(E) test) {
     int end = this.length;
     for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       if (test(element)) return true;
       if (this.length != end) throw ConcurrentModificationError(this);
@@ -455,11 +437,9 @@
     return false;
   }
 
-  bool every(bool test(E element)) {
+  bool every(bool Function(E) test) {
     int end = this.length;
     for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
       var element = JS<E>('', '#[#]', this, i);
       if (!test(element)) return false;
       if (this.length != end) throw ConcurrentModificationError(this);
@@ -469,16 +449,17 @@
 
   Iterable<E> get reversed => ReversedListIterable<E>(this);
 
-  void sort([int compare(E a, E b)]) {
+  void sort([int Function(E, E)? compare]) {
     checkMutable('sort');
     if (compare == null) {
-      Sort.sort(this, (a, b) => Comparable.compare(a, b));
+      Sort.sort(
+          this, (a, b) => Comparable.compare(a as Comparable, b as Comparable));
     } else {
       Sort.sort(this, compare);
     }
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     checkMutable('shuffle');
     if (random == null) random = Random();
     int length = this.length;
@@ -491,7 +472,7 @@
     }
   }
 
-  int indexOf(Object element, [@nullCheck int start = 0]) {
+  int indexOf(Object? element, [@nullCheck int start = 0]) {
     int length = this.length;
     if (start >= length) {
       return -1;
@@ -507,15 +488,15 @@
     return -1;
   }
 
-  int lastIndexOf(Object element, [int _startIndex]) {
+  int lastIndexOf(Object? element, [int? startIndex]) {
     @notNull
-    int startIndex = _startIndex ?? this.length - 1;
-    if (startIndex >= this.length) {
-      startIndex = this.length - 1;
-    } else if (startIndex < 0) {
+    int start = startIndex ?? this.length - 1;
+    if (start >= this.length) {
+      start = this.length - 1;
+    } else if (start < 0) {
       return -1;
     }
-    for (int i = startIndex; i >= 0; i--) {
+    for (int i = start; i >= 0; i--) {
       if (this[i] == element) {
         return i;
       }
@@ -523,7 +504,7 @@
     return -1;
   }
 
-  bool contains(Object other) {
+  bool contains(Object? other) {
     var length = this.length;
     for (int i = 0; i < length; i++) {
       var element = JS<E>('', '#[#]', this, i);
@@ -601,15 +582,9 @@
 
   Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
 
-  List<E> operator +(List<E> other) {
-    int totalLength = this.length + other.length;
-    return <E>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
+  List<E> operator +(List<E> other) => [...this, ...other];
 
-  int indexWhere(bool test(E element), [int start = 0]) {
+  int indexWhere(bool Function(E) test, [int start = 0]) {
     if (start >= this.length) return -1;
     if (start < 0) start = 0;
     for (int i = start; i < this.length; i++) {
@@ -618,7 +593,7 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(E element), [int start]) {
+  int lastIndexWhere(bool Function(E) test, [int? start]) {
     if (start == null) start = this.length - 1;
     if (start < 0) return -1;
     for (int i = start; i >= 0; i--) {
@@ -665,14 +640,14 @@
   final int _length;
   @notNull
   int _index;
-  E _current;
+  E? _current;
 
   ArrayIterator(JSArray<E> iterable)
       : _iterable = iterable,
         _length = iterable.length,
         _index = 0;
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     @notNull
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/js_helper.dart
index b7d17d0d..11a3a8e 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_helper.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.6
-
 library dart._js_helper;
 
 import 'dart:collection';
@@ -45,11 +43,11 @@
 // https://github.com/dart-lang/sdk/issues/28320
 class DartIterator<E> implements Iterator<E> {
   final _jsIterator;
-  E _current;
+  E? _current;
 
   DartIterator(this._jsIterator);
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     final ret = JS('', '#.next()', _jsIterator);
@@ -70,11 +68,11 @@
 }
 
 class Primitives {
-  static int parseInt(@nullCheck String source, int _radix) {
+  static int? parseInt(@nullCheck String source, int? _radix) {
     var re = JS('', r'/^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i');
     // TODO(jmesserly): this isn't reified List<String>, but it's safe to use as
     // long as we use it locally and don't expose it to user code.
-    List<String> match = JS('', '#.exec(#)', re, source);
+    List<String>? match = JS('', '#.exec(#)', re, source);
     int digitsIndex = 1;
     int hexIndex = 2;
     int decimalIndex = 3;
@@ -84,7 +82,7 @@
       // again.
       return null;
     }
-    String decimalMatch = match[decimalIndex];
+    String? decimalMatch = match[decimalIndex];
     if (_radix == null) {
       if (decimalMatch != null) {
         // Cannot fail because we know that the digits are all decimal.
@@ -140,7 +138,7 @@
     return JS<int>('!', r'parseInt(#, #)', source, radix);
   }
 
-  static double parseDouble(@nullCheck String source) {
+  static double? parseDouble(@nullCheck String source) {
     // Notice that JS parseFloat accepts garbage at the end of the string.
     // Accept only:
     // - [+/-]NaN
@@ -171,10 +169,9 @@
   static int dateNow() => JS<int>('!', r'Date.now()');
 
   static void initTicker() {
-    if (timerFrequency != null) return;
+    if (timerFrequency != 0) return;
     // Start with low-resolution. We overwrite the fields if we find better.
     timerFrequency = 1000;
-    timerTicks = dateNow;
     if (JS<bool>('!', 'typeof window == "undefined"')) return;
     var jsWindow = JS('var', 'window');
     if (jsWindow == null) return;
@@ -185,8 +182,9 @@
     timerTicks = () => (1000 * JS<num>('!', '#.now()', performance)).floor();
   }
 
-  static int timerFrequency;
-  static num Function() timerTicks;
+  /// 0 frequency indicates the default uninitialized state.
+  static int timerFrequency = 0;
+  static int Function() timerTicks = dateNow; // Low-resolution version.
 
   static bool get isD8 {
     return JS(
@@ -310,7 +308,7 @@
     // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)".
     // We extract this name using a regexp.
     var d = lazyAsJsDate(receiver);
-    List match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d);
+    List? match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d);
     if (match != null) return match[1];
 
     // Internet Explorer 10+ emits the zone name without parenthesis:
@@ -345,7 +343,7 @@
     return -JS<int>('!', r'#.getTimezoneOffset()', lazyAsJsDate(receiver));
   }
 
-  static num valueFromDecomposedDate(
+  static int? valueFromDecomposedDate(
       @nullCheck int years,
       @nullCheck int month,
       @nullCheck int day,
@@ -356,12 +354,12 @@
       @nullCheck bool isUtc) {
     final int MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
     var jsMonth = month - 1;
-    num value;
+    int value;
     if (isUtc) {
-      value = JS('!', r'Date.UTC(#, #, #, #, #, #, #)', years, jsMonth, day,
-          hours, minutes, seconds, milliseconds);
+      value = JS<int>('!', r'Date.UTC(#, #, #, #, #, #, #)', years, jsMonth,
+          day, hours, minutes, seconds, milliseconds);
     } else {
-      value = JS('!', r'new Date(#, #, #, #, #, #, #).valueOf()', years,
+      value = JS<int>('!', r'new Date(#, #, #, #, #, #, #).valueOf()', years,
           jsMonth, day, hours, minutes, seconds, milliseconds);
     }
     if (value.isNaN ||
@@ -373,14 +371,14 @@
     return value;
   }
 
-  static num patchUpY2K(value, years, isUtc) {
-    var date = JS('', r'new Date(#)', value);
+  static int patchUpY2K(value, years, isUtc) {
+    var date = JS<int>('!', r'new Date(#)', value);
     if (isUtc) {
-      JS('', r'#.setUTCFullYear(#)', date, years);
+      JS<int>('!', r'#.setUTCFullYear(#)', date, years);
     } else {
-      JS('', r'#.setFullYear(#)', date, years);
+      JS<int>('!', r'#.setFullYear(#)', date, years);
     }
-    return JS('!', r'#.valueOf()', date);
+    return JS<int>('!', r'#.valueOf()', date);
   }
 
   // Lazily keep a JS Date stored in the JS object.
@@ -453,7 +451,7 @@
     return value;
   }
 
-  static getProperty(object, key) {
+  static Object? getProperty(Object? object, Object key) {
     if (object == null || object is bool || object is num || object is String) {
       throw argumentErrorValue(object);
     }
@@ -489,7 +487,7 @@
  * describes the problem.
  */
 @NoInline()
-Error diagnoseRangeError(int start, int end, int length) {
+Error diagnoseRangeError(int? start, int? end, int length) {
   if (start == null) {
     return ArgumentError.value(start, 'start');
   }
@@ -538,9 +536,9 @@
 }
 
 class JsNoSuchMethodError extends Error implements NoSuchMethodError {
-  final String _message;
-  final String _method;
-  final String _receiver;
+  final String? _message;
+  final String? _method;
+  final String? _receiver;
 
   JsNoSuchMethodError(this._message, match)
       : _method = match == null ? null : JS('String|Null', '#.method', match),
@@ -582,11 +580,11 @@
   return result;
 }
 
-bool jsHasOwnProperty(var jsObject, String property) {
+bool jsHasOwnProperty(jsObject, String property) {
   return JS<bool>('!', r'#.hasOwnProperty(#)', jsObject, property);
 }
 
-jsPropertyAccess(var jsObject, String property) {
+jsPropertyAccess(jsObject, String property) {
   return JS('var', r'#[#]', jsObject, property);
 }
 
@@ -720,12 +718,12 @@
 
 /// Error thrown by DDC when an `assert()` fails (with or without a message).
 class AssertionErrorImpl extends AssertionError {
-  final String _fileUri;
-  final int _line;
-  final int _column;
-  final String _conditionSource;
+  final String? _fileUri;
+  final int? _line;
+  final int? _column;
+  final String? _conditionSource;
 
-  AssertionErrorImpl(Object message,
+  AssertionErrorImpl(Object? message,
       [this._fileUri, this._line, this._column, this._conditionSource])
       : super(message);
 
@@ -791,7 +789,7 @@
 
   static String getName(Symbol symbol) => (symbol as PrivateSymbol)._name;
 
-  static Object getNativeSymbol(Symbol symbol) {
+  static Object? getNativeSymbol(Symbol symbol) {
     if (symbol is PrivateSymbol) return symbol._nativeSymbol;
     return null;
   }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_number.dart b/sdk/lib/_internal/js_dev_runtime/private/js_number.dart
index 3d974a7..d2b9661 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_number.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_number.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.6
-
 part of dart._interceptors;
 
 /**
@@ -55,14 +53,14 @@
 
   @notNull
   JSNumber remainder(@nullCheck num b) {
-    return JS<num>('!', r'# % #', this, b);
+    return JS<JSNumber>('!', r'# % #', this, b);
   }
 
   @notNull
-  JSNumber abs() => JS<num>('!', r'Math.abs(#)', this);
+  JSNumber abs() => JS<JSNumber>('!', r'Math.abs(#)', this);
 
   @notNull
-  JSNumber get sign => this > 0 ? 1 : this < 0 ? -1 : this;
+  JSNumber get sign => (this > 0 ? 1 : this < 0 ? -1 : this) as JSNumber;
 
   @notNull
   static const int _MIN_INT32 = -0x80000000;
@@ -112,17 +110,17 @@
   }
 
   @notNull
-  double ceilToDouble() => JS<num>('!', r'Math.ceil(#)', this);
+  double ceilToDouble() => JS<double>('!', r'Math.ceil(#)', this);
 
   @notNull
-  double floorToDouble() => JS<num>('!', r'Math.floor(#)', this);
+  double floorToDouble() => JS<double>('!', r'Math.floor(#)', this);
 
   @notNull
   double roundToDouble() {
     if (this < 0) {
-      return JS<num>('!', r'-Math.round(-#)', this);
+      return JS<double>('!', r'-Math.round(-#)', this);
     } else {
-      return JS<num>('!', r'Math.round(#)', this);
+      return JS<double>('!', r'Math.round(#)', this);
     }
   }
 
@@ -153,7 +151,7 @@
   }
 
   @notNull
-  String toStringAsExponential([int fractionDigits]) {
+  String toStringAsExponential([int? fractionDigits]) {
     String result;
     if (fractionDigits != null) {
       @notNull
@@ -196,7 +194,7 @@
   static String _handleIEtoString(String result) {
     // Result is probably IE's untraditional format for large numbers,
     // e.g., "8.0000000000008(e+15)" for 0x8000000000000800.toString(16).
-    var match = JS<List>(
+    var match = JS<List?>(
         '', r'/^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(#)', result);
     if (match == null) {
       // Then we don't know how to handle it at all.
@@ -258,38 +256,38 @@
   }
 
   @notNull
-  JSNumber operator -() => JS<num>('!', r'-#', this);
+  JSNumber operator -() => JS<JSNumber>('!', r'-#', this);
 
   @notNull
   JSNumber operator +(@nullCheck num other) {
-    return JS<num>('!', '# + #', this, other);
+    return JS<JSNumber>('!', '# + #', this, other);
   }
 
   @notNull
   JSNumber operator -(@nullCheck num other) {
-    return JS<num>('!', '# - #', this, other);
+    return JS<JSNumber>('!', '# - #', this, other);
   }
 
   @notNull
   double operator /(@nullCheck num other) {
-    return JS<num>('!', '# / #', this, other);
+    return JS<double>('!', '# / #', this, other);
   }
 
   @notNull
   JSNumber operator *(@nullCheck num other) {
-    return JS<num>('!', '# * #', this, other);
+    return JS<JSNumber>('!', '# * #', this, other);
   }
 
   @notNull
   JSNumber operator %(@nullCheck num other) {
     // Euclidean Modulo.
-    num result = JS<num>('!', r'# % #', this, other);
+    JSNumber result = JS<JSNumber>('!', r'# % #', this, other);
     if (result == 0) return (0 as JSNumber); // Make sure we don't return -0.0.
     if (result > 0) return result;
-    if (JS<num>('!', '#', other) < 0) {
-      return result - JS<num>('!', '#', other);
+    if (JS<JSNumber>('!', '#', other) < 0) {
+      return result - JS<JSNumber>('!', '#', other);
     } else {
-      return result + JS<num>('!', '#', other);
+      return result + JS<JSNumber>('!', '#', other);
     }
   }
 
@@ -308,7 +306,7 @@
 
   @notNull
   int _tdivSlow(num other) {
-    return (JS<num>('!', r'# / #', this, other)).toInt();
+    return JS<num>('!', r'# / #', this, other).toInt();
   }
 
   // TODO(ngeoffray): Move the bit operations below to [JSInt] and
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_primitives.dart b/sdk/lib/_internal/js_dev_runtime/private/js_primitives.dart
index f6c0c59..1347b62 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_primitives.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_primitives.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.6
-
 /// dart2js "primitives", that is, features that cannot be implemented without
 /// access to JavaScript features.
 library dart2js._js_primitives;
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_rti.dart b/sdk/lib/_internal/js_dev_runtime/private/js_rti.dart
index e058820..483e721 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_rti.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_rti.dart
@@ -2,28 +2,26 @@
 // 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.6
-
 part of dart._js_helper;
 
 // TODO(leafp): Maybe get rid of this?  Currently used by the interceptors
 // library, but that should probably be culled as well.
-Type getRuntimeType(var object) =>
+Type? getRuntimeType(object) =>
     JS('Type|null', 'dart.getReifiedType(#)', object);
 
 /// Returns the property [index] of the JavaScript array [array].
-getIndex(var array, int index) {
+getIndex(array, int index) {
   assert(isJsArray(array));
   return JS('var', r'#[#]', array, index);
 }
 
 /// Returns the length of the JavaScript array [array].
-int getLength(var array) {
+int getLength(array) {
   assert(isJsArray(array));
   return JS<int>('!', r'#.length', array);
 }
 
 /// Returns whether [value] is a JavaScript array.
-bool isJsArray(var value) {
+bool isJsArray(value) {
   return value is JSArray;
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/js_string.dart b/sdk/lib/_internal/js_dev_runtime/private/js_string.dart
index de63d0a..2987812 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/js_string.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/js_string.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.6
-
 part of dart._interceptors;
 
 /**
@@ -37,7 +35,7 @@
     return allMatchesInStringUnchecked(this, string, start);
   }
 
-  Match matchAsPrefix(@nullCheck String string, [@nullCheck int start = 0]) {
+  Match? matchAsPrefix(@nullCheck String string, [@nullCheck int start = 0]) {
     int stringLength = JS('!', '#.length', string);
     if (start < 0 || start > stringLength) {
       throw RangeError.range(start, 0, stringLength);
@@ -71,13 +69,13 @@
   }
 
   @notNull
-  String replaceAllMapped(Pattern from, String convert(Match match)) {
+  String replaceAllMapped(Pattern from, String Function(Match) convert) {
     return this.splitMapJoin(from, onMatch: convert);
   }
 
   @notNull
   String splitMapJoin(Pattern from,
-      {String onMatch(Match match), String onNonMatch(String nonMatch)}) {
+      {String Function(Match)? onMatch, String Function(String)? onNonMatch}) {
     return stringReplaceAllFuncUnchecked(this, from, onMatch, onNonMatch);
   }
 
@@ -110,9 +108,9 @@
 
   @notNull
   String replaceRange(
-      @nullCheck int start, int end, @nullCheck String replacement) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    return stringReplaceRangeUnchecked(this, start, end, replacement);
+      @nullCheck int start, int? end, @nullCheck String replacement) {
+    var e = RangeError.checkValidRange(start, end, this.length);
+    return stringReplaceRangeUnchecked(this, start, e, replacement);
   }
 
   @notNull
@@ -166,7 +164,7 @@
   }
 
   @notNull
-  String substring(@nullCheck int startIndex, [int _endIndex]) {
+  String substring(@nullCheck int startIndex, [int? _endIndex]) {
     var length = this.length;
     final endIndex = _endIndex ?? length;
     if (startIndex < 0) throw RangeError.value(startIndex);
@@ -418,7 +416,7 @@
     }
     if (pattern is JSSyntaxRegExp) {
       JSSyntaxRegExp re = pattern;
-      Match match = firstMatchAfter(re, this, start);
+      Match? match = firstMatchAfter(re, this, start);
       return (match == null) ? -1 : match.start;
     }
     var length = this.length;
@@ -429,7 +427,7 @@
   }
 
   @notNull
-  int lastIndexOf(@nullCheck Pattern pattern, [int _start]) {
+  int lastIndexOf(@nullCheck Pattern pattern, [int? _start]) {
     var length = this.length;
     var start = _start ?? length;
     if (start < 0 || start > length) {
@@ -497,7 +495,7 @@
   Type get runtimeType => String;
 
   @notNull
-  final int length;
+  int get length native;
 
   @notNull
   String operator [](@nullCheck int index) {
diff --git a/sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart b/sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart
index d9051f4..f797ea4 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.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.6
-
 // Efficient JavaScript based implementation of a linked hash map used as a
 // backing map for constant maps and the [LinkedHashMap] patch
 
@@ -74,7 +72,7 @@
       K key = JS('', '#[#]', entries, i);
       V value = JS('', '#[#]', entries, i + 1);
       if (key == null) {
-        key = null;
+        key = JS('', 'null');
       } else if (JS<bool>('!', '#[#] !== #', key,
           dart.extensionSymbol('_equals'), dart.identityEquals)) {
         key = putLinkedMapKey(key, keyMap);
@@ -96,17 +94,15 @@
   Iterable<V> get values => _JSMapIterable<V>(this, false);
 
   @notNull
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (key == null) {
-      key = null;
+      key = JS('', 'null');
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
-      @notNull
-      var k = key;
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
+      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, key.hashCode);
       if (buckets != null) {
         for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          k = JS('', '#[#]', buckets, i);
+          K k = JS('', '#[#]', buckets, i);
           if (k == key) return true;
         }
       }
@@ -115,7 +111,7 @@
     return JS<bool>('!', '#.has(#)', _map, key);
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (var v in JS('', '#.values()', _map)) {
       if (v == value) return true;
     }
@@ -127,7 +123,7 @@
     int length = JS('', '#.size', map);
     other.forEach((K key, V value) {
       if (key == null) {
-        key = null;
+        key = JS('', 'null');
       } else if (JS<bool>('!', '#[#] !== #', key,
           dart.extensionSymbol('_equals'), dart.identityEquals)) {
         key = putLinkedMapKey(key, _keyMap);
@@ -139,17 +135,15 @@
     }
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (key == null) {
-      key = null;
+      key = JS('', 'null');
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
-      @notNull
-      var k = key;
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
+      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, key.hashCode);
       if (buckets != null) {
         for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          k = JS('', '#[#]', buckets, i);
+          K k = JS('', '#[#]', buckets, i);
           if (k == key) return JS('', '#.get(#)', _map, k);
         }
       }
@@ -161,7 +155,7 @@
 
   void operator []=(K key, V value) {
     if (key == null) {
-      key = null;
+      key = JS('', 'null');
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
       key = putLinkedMapKey(key, _keyMap);
@@ -177,7 +171,7 @@
   V putIfAbsent(K key, V ifAbsent()) {
     var map = _map;
     if (key == null) {
-      key = null;
+      key = JS('', 'null');
       if (JS<bool>('!', '#.has(null)', map)) return JS('', '#.get(null)', map);
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
@@ -198,24 +192,25 @@
       return JS('', '#.get(#)', map, key);
     }
     V value = ifAbsent();
-    if (value == null) value = null; // coerce undefined to null.
+    if (value == null) {
+      value = JS('', 'null');
+    }
     JS('', '#.set(#, #)', map, key, value);
     _modifications = (_modifications + 1) & 0x3ffffff;
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (key == null) {
-      key = null;
+      key = JS('', 'null');
     } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
         dart.identityEquals)) {
       @notNull
-      var k = key;
-      var hash = JS<int>('!', '# & 0x3ffffff', k.hashCode);
+      var hash = JS<int>('!', '# & 0x3ffffff', key.hashCode);
       var buckets = JS('', '#.get(#)', _keyMap, hash);
       if (buckets == null) return null; // not found
       for (int i = 0, n = JS('!', '#.length', buckets);;) {
-        k = JS('', '#[#]', buckets, i);
+        K k = JS('', '#[#]', buckets, i);
         if (k == key) {
           key = k;
           if (n == 1) {
@@ -266,14 +261,14 @@
 class ImmutableMap<K, V> extends LinkedMap<K, V> {
   ImmutableMap.from(JSArray entries) : super.from(entries);
 
-  void operator []=(Object key, Object value) {
+  void operator []=(K key, V value) {
     throw _unsupported();
   }
 
   void addAll(Object other) => throw _unsupported();
   void clear() => throw _unsupported();
-  V remove(Object key) => throw _unsupported();
-  V putIfAbsent(Object key, Object ifAbsent()) => throw _unsupported();
+  V? remove(Object? key) => throw _unsupported();
+  V putIfAbsent(K key, V ifAbsent()) => throw _unsupported();
 
   static Error _unsupported() =>
       UnsupportedError("Cannot modify unmodifiable map");
diff --git a/sdk/lib/_internal/js_dev_runtime/private/mirror_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/mirror_helper.dart
index dc635a9..1b78136 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/mirror_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/mirror_helper.dart
@@ -1,7 +1,6 @@
 // Copyright (c) 2013, 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.
-// @dart = 2.6
 
 /**
  * Helps dealing with reflection in the case that the source code has been
diff --git a/sdk/lib/_internal/js_dev_runtime/private/native_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/native_helper.dart
index d7a312c1..cc214e8 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/native_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/native_helper.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.6
-
 part of dart._js_helper;
 
 // Obsolete in dart dev compiler. Added only so that the same version of
diff --git a/sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart b/sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart
index 14f173d..3a7f409 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/native_typed_data.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.6
-
 /// Specialized integers and floating point numbers,
 /// with SIMD support and efficient lists.
 library dart.typed_data.implementation;
@@ -32,69 +30,69 @@
 
   Type get runtimeType => ByteBuffer;
 
-  Uint8List asUint8List([int offsetInBytes = 0, int length]) {
+  Uint8List asUint8List([int offsetInBytes = 0, int? length]) {
     return NativeUint8List.view(this, offsetInBytes, length);
   }
 
-  Int8List asInt8List([int offsetInBytes = 0, int length]) {
+  Int8List asInt8List([int offsetInBytes = 0, int? length]) {
     return NativeInt8List.view(this, offsetInBytes, length);
   }
 
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int length]) {
+  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) {
     return NativeUint8ClampedList.view(this, offsetInBytes, length);
   }
 
-  Uint16List asUint16List([int offsetInBytes = 0, int length]) {
+  Uint16List asUint16List([int offsetInBytes = 0, int? length]) {
     return NativeUint16List.view(this, offsetInBytes, length);
   }
 
-  Int16List asInt16List([int offsetInBytes = 0, int length]) {
+  Int16List asInt16List([int offsetInBytes = 0, int? length]) {
     return NativeInt16List.view(this, offsetInBytes, length);
   }
 
-  Uint32List asUint32List([int offsetInBytes = 0, int length]) {
+  Uint32List asUint32List([int offsetInBytes = 0, int? length]) {
     return NativeUint32List.view(this, offsetInBytes, length);
   }
 
-  Int32List asInt32List([int offsetInBytes = 0, int length]) {
+  Int32List asInt32List([int offsetInBytes = 0, int? length]) {
     return NativeInt32List.view(this, offsetInBytes, length);
   }
 
-  Uint64List asUint64List([int offsetInBytes = 0, int length]) {
+  Uint64List asUint64List([int offsetInBytes = 0, int? length]) {
     throw UnsupportedError("Uint64List not supported by dart2js.");
   }
 
-  Int64List asInt64List([int offsetInBytes = 0, int length]) {
+  Int64List asInt64List([int offsetInBytes = 0, int? length]) {
     throw UnsupportedError("Int64List not supported by dart2js.");
   }
 
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int length]) {
-    NativeInt32List storage =
+  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) {
+    var storage =
         this.asInt32List(offsetInBytes, length != null ? length * 4 : null);
     return NativeInt32x4List._externalStorage(storage);
   }
 
-  Float32List asFloat32List([int offsetInBytes = 0, int length]) {
+  Float32List asFloat32List([int offsetInBytes = 0, int? length]) {
     return NativeFloat32List.view(this, offsetInBytes, length);
   }
 
-  Float64List asFloat64List([int offsetInBytes = 0, int length]) {
+  Float64List asFloat64List([int offsetInBytes = 0, int? length]) {
     return NativeFloat64List.view(this, offsetInBytes, length);
   }
 
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int length]) {
-    NativeFloat32List storage =
+  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) {
+    var storage =
         this.asFloat32List(offsetInBytes, length != null ? length * 4 : null);
     return NativeFloat32x4List._externalStorage(storage);
   }
 
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int length]) {
-    NativeFloat64List storage =
+  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) {
+    var storage =
         this.asFloat64List(offsetInBytes, length != null ? length * 2 : null);
     return NativeFloat64x2List._externalStorage(storage);
   }
 
-  ByteData asByteData([int offsetInBytes = 0, int length]) {
+  ByteData asByteData([int offsetInBytes = 0, int? length]) {
     return NativeByteData.view(this, offsetInBytes, length);
   }
 }
@@ -105,7 +103,7 @@
 class NativeFloat32x4List extends Object
     with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
     implements Float32x4List {
-  final NativeFloat32List _storage;
+  final Float32List _storage;
 
   /// Creates a [Float32x4List] of the specified length (in elements),
   /// all of whose elements are initially zero.
@@ -164,10 +162,10 @@
     _storage[(index * 4) + 3] = value.w;
   }
 
-  Float32x4List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Float32x4List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     return NativeFloat32x4List._externalStorage(
-        _storage.sublist(start * 4, end * 4));
+        _storage.sublist(start * 4, stop * 4));
   }
 }
 
@@ -236,10 +234,10 @@
     _storage[(index * 4) + 3] = value.w;
   }
 
-  Int32x4List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Int32x4List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     return NativeInt32x4List._externalStorage(
-        _storage.sublist(start * 4, end * 4));
+        _storage.sublist(start * 4, stop * 4));
   }
 }
 
@@ -249,7 +247,7 @@
 class NativeFloat64x2List extends Object
     with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
     implements Float64x2List {
-  final NativeFloat64List _storage;
+  final Float64List _storage;
 
   /// Creates a [Float64x2List] of the specified length (in elements),
   /// all of whose elements are initially zero.
@@ -302,10 +300,10 @@
     _storage[(index * 2) + 1] = value.y;
   }
 
-  Float64x2List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Float64x2List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     return NativeFloat64x2List._externalStorage(
-        _storage.sublist(start * 2, end * 2));
+        _storage.sublist(start * 2, stop * 2));
   }
 }
 
@@ -313,8 +311,7 @@
 class NativeTypedData implements TypedData {
   /// Returns the byte buffer associated with this object.
   @Creates('NativeByteBuffer')
-  // May be Null for IE's CanvasPixelArray.
-  @Returns('NativeByteBuffer|Null')
+  @Returns('NativeByteBuffer')
   external ByteBuffer get buffer;
 
   /// Returns the length of this view, in bytes.
@@ -366,7 +363,7 @@
   if (offsetInBytes is! int) {
     throw ArgumentError('Invalid view offsetInBytes $offsetInBytes');
   }
-  if (length != null && length is! int) {
+  if (length is! int?) {
     throw ArgumentError('Invalid view length $length');
   }
 }
@@ -375,7 +372,7 @@
 // returns a copy of the list.
 List _ensureNativeList(List list) {
   if (list is JSIndexable) return list;
-  List result = List(list.length);
+  List result = List.filled(list.length, null);
   for (int i = 0; i < list.length; i++) {
     result[i] = list[i];
   }
@@ -399,7 +396,7 @@
   /// if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
   /// the length of [buffer].
   factory NativeByteData.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -421,7 +418,7 @@
 
   @JSName('getFloat32')
   @Returns('double')
-  double _getFloat32(int byteOffset, [bool littleEndian]) native;
+  double _getFloat32(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the floating point number represented by the eight bytes at
   /// the specified [byteOffset] in this object, in IEEE 754
@@ -434,7 +431,7 @@
 
   @JSName('getFloat64')
   @Returns('double')
-  double _getFloat64(int byteOffset, [bool littleEndian]) native;
+  double _getFloat64(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the (possibly negative) integer represented by the two bytes at
   /// the specified [byteOffset] in this object, in two's complement binary
@@ -449,7 +446,7 @@
 
   @JSName('getInt16')
   @Returns('int')
-  int _getInt16(int byteOffset, [bool littleEndian]) native;
+  int _getInt16(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the (possibly negative) integer represented by the four bytes at
   /// the specified [byteOffset] in this object, in two's complement binary
@@ -464,7 +461,7 @@
 
   @JSName('getInt32')
   @Returns('int')
-  int _getInt32(int byteOffset, [bool littleEndian]) native;
+  int _getInt32(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the (possibly negative) integer represented by the eight bytes at
   /// the specified [byteOffset] in this object, in two's complement binary
@@ -498,7 +495,7 @@
 
   @JSName('getUint16')
   @Returns('int')
-  int _getUint16(int byteOffset, [bool littleEndian]) native;
+  int _getUint16(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the positive integer represented by the four bytes starting
   /// at the specified [byteOffset] in this object, in unsigned binary
@@ -512,7 +509,7 @@
 
   @JSName('getUint32')
   @Returns('int')
-  int _getUint32(int byteOffset, [bool littleEndian]) native;
+  int _getUint32(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the positive integer represented by the eight bytes starting
   /// at the specified [byteOffset] in this object, in unsigned binary
@@ -552,7 +549,7 @@
       _setFloat32(byteOffset, value, Endian.little == endian);
 
   @JSName('setFloat32')
-  void _setFloat32(int byteOffset, num value, [bool littleEndian]) native;
+  void _setFloat32(int byteOffset, num value, [bool? littleEndian]) native;
 
   /// Sets the eight bytes starting at the specified [byteOffset] in this
   /// object to the IEEE 754 double-precision binary floating-point
@@ -564,7 +561,7 @@
       _setFloat64(byteOffset, value, Endian.little == endian);
 
   @JSName('setFloat64')
-  void _setFloat64(int byteOffset, num value, [bool littleEndian]) native;
+  void _setFloat64(int byteOffset, num value, [bool? littleEndian]) native;
 
   /// Sets the two bytes starting at the specified [byteOffset] in this
   /// object to the two's complement binary representation of the specified
@@ -577,7 +574,7 @@
       _setInt16(byteOffset, value, Endian.little == endian);
 
   @JSName('setInt16')
-  void _setInt16(int byteOffset, int value, [bool littleEndian]) native;
+  void _setInt16(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the four bytes starting at the specified [byteOffset] in this
   /// object to the two's complement binary representation of the specified
@@ -590,7 +587,7 @@
       _setInt32(byteOffset, value, Endian.little == endian);
 
   @JSName('setInt32')
-  void _setInt32(int byteOffset, int value, [bool littleEndian]) native;
+  void _setInt32(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the eight bytes starting at the specified [byteOffset] in this
   /// object to the two's complement binary representation of the specified
@@ -623,7 +620,7 @@
       _setUint16(byteOffset, value, Endian.little == endian);
 
   @JSName('setUint16')
-  void _setUint16(int byteOffset, int value, [bool littleEndian]) native;
+  void _setUint16(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the four bytes starting at the specified [byteOffset] in this object
   /// to the unsigned binary representation of the specified [value],
@@ -636,7 +633,7 @@
       _setUint32(byteOffset, value, Endian.little == endian);
 
   @JSName('setUint32')
-  void _setUint32(int byteOffset, int value, [bool littleEndian]) native;
+  void _setUint32(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the eight bytes starting at the specified [byteOffset] in this object
   /// to the unsigned binary representation of the specified [value],
@@ -751,7 +748,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeFloat32List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -760,10 +757,10 @@
 
   Type get runtimeType => Float32List;
 
-  Float32List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Float32List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     var source =
-        JS<NativeFloat32List>('!', '#.subarray(#, #)', this, start, end);
+        JS<NativeFloat32List>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -786,7 +783,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeFloat64List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -795,9 +792,9 @@
 
   Type get runtimeType => Float64List;
 
-  Float64List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, end);
+  Float64List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -819,7 +816,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeInt16List.view(
-      NativeByteBuffer buffer, int offsetInBytes, int length) {
+      NativeByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -833,9 +830,9 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Int16List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, end);
+  Int16List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -857,7 +854,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeInt32List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -871,9 +868,10 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Int32List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS<NativeInt32List>('!', '#.subarray(#, #)', this, start, end);
+  Int32List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source =
+        JS<NativeInt32List>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -895,7 +893,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeInt8List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -909,9 +907,9 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Int8List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS<NativeInt8List>('!', '#.subarray(#, #)', this, start, end);
+  Int8List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS<NativeInt8List>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -921,7 +919,7 @@
   static NativeInt8List _create2(arg1, arg2) =>
       JS<NativeInt8List>('!', 'new Int8Array(#, #)', arg1, arg2);
 
-  static Int8List _create3(arg1, arg2, arg3) =>
+  static NativeInt8List _create3(arg1, arg2, arg3) =>
       JS<NativeInt8List>('!', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
 }
 
@@ -933,7 +931,7 @@
       _create1(_ensureNativeList(list));
 
   factory NativeUint16List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -947,10 +945,10 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Uint16List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Uint16List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     var source =
-        JS<NativeUint16List>('!', '#.subarray(#, #)', this, start, end);
+        JS<NativeUint16List>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -972,7 +970,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeUint32List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -986,10 +984,10 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Uint32List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Uint32List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     var source =
-        JS<NativeUint32List>('!', '#.subarray(#, #)', this, start, end);
+        JS<NativeUint32List>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -1012,7 +1010,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeUint8ClampedList.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -1028,10 +1026,10 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Uint8ClampedList sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Uint8ClampedList sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     var source =
-        JS<NativeUint8ClampedList>('!', '#.subarray(#, #)', this, start, end);
+        JS<NativeUint8ClampedList>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -1062,7 +1060,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeUint8List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -1078,9 +1076,10 @@
     return JS<int>('!', '#[#]', this, index);
   }
 
-  Uint8List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS<NativeUint8List>('!', '#.subarray(#, #)', this, start, end);
+  Uint8List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source =
+        JS<NativeUint8List>('!', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -1466,7 +1465,7 @@
     floatList[1] = f.y;
     floatList[2] = f.z;
     floatList[3] = f.w;
-    NativeInt32List view = floatList.buffer.asInt32List();
+    Int32List view = floatList.buffer.asInt32List();
     return NativeInt32x4._truncated(view[0], view[1], view[2], view[3]);
   }
 
@@ -1684,7 +1683,7 @@
   final double y;
 
   static NativeFloat64List _list = NativeFloat64List(2);
-  static NativeUint32List _uint32View = _list.buffer.asUint32List();
+  static Uint32List _uint32View = _list.buffer.asUint32List();
 
   NativeFloat64x2(this.x, this.y) {
     if (x is! num) throw ArgumentError(x);
@@ -1815,7 +1814,7 @@
 ///
 /// Returns the actual value of `end`, which is `length` if `end` is `null`, and
 /// the original value of `end` otherwise.
-int _checkValidRange(int start, int end, int length) {
+int _checkValidRange(int start, int? end, int length) {
   if (_isInvalidArrayIndex(start) || // Ensures start is non-negative int.
       ((end == null)
           ? start > length
diff --git a/sdk/lib/_internal/js_dev_runtime/private/profile.dart b/sdk/lib/_internal/js_dev_runtime/private/profile.dart
index 0b30862..ede4363 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/profile.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/profile.dart
@@ -2,19 +2,15 @@
 // 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.6
-
 /// This file supports profiling dynamic calls.
 part of dart._debugger;
 
 class _MethodStats {
   final String typeName;
   final String frame;
-  double count;
+  double count = 0.0;
 
-  _MethodStats(this.typeName, this.frame) {
-    count = 0.0;
-  }
+  _MethodStats(this.typeName, this.frame);
 }
 
 class _CallMethodRecord {
@@ -29,7 +25,7 @@
 
 /// If the number of dynamic calls exceeds [_callRecordSampleSize] this list
 /// will represent a random sample of the dynamic calls made.
-List<_CallMethodRecord> _callMethodRecords = List();
+var _callMethodRecords = <_CallMethodRecord>[];
 
 /// If the number of dynamic calls exceeds [_callRecordSampleSize] this value
 /// will be greater than [_callMethodRecords.length].
@@ -45,7 +41,7 @@
 /// speedup lookup of source map frames when running the profiler.
 /// The number of source map entries looked up makes caching more important
 /// in this case than for typical source map use cases.
-Map<String, String> _frameMappingCache = Map();
+var _frameMappingCache = <String, String>{};
 
 List<List<Object>> getDynamicStats() {
   // Process the accumulated method stats. This may be quite slow as processing
@@ -56,7 +52,7 @@
   // raw number of dynamic calls so that the magnitude of the dynamic call
   // performance hit is clear to users.
 
-  Map<String, _MethodStats> callMethodStats = Map();
+  var callMethodStats = <String, _MethodStats>{};
   if (_callMethodRecords.length > 0) {
     // Ratio between total record count and sampled records count.
     var recordRatio = _totalCallRecords / _callMethodRecords.length;
@@ -67,8 +63,8 @@
       // runtime.
       var src = frames
           .skip(2)
-          .map((f) =>
-              _frameMappingCache.putIfAbsent(f, () => stackTraceMapper('\n$f')))
+          .map((f) => _frameMappingCache.putIfAbsent(
+              f, () => stackTraceMapper!('\n$f')))
           .firstWhere((f) => !f.startsWith('dart:'), orElse: () => '');
 
       var actualTypeName = dart.typeName(record.type);
@@ -83,7 +79,7 @@
     // complete profile.
     if (_totalCallRecords != _callMethodRecords.length) {
       for (var k in callMethodStats.keys.toList()) {
-        var stats = callMethodStats[k];
+        var stats = callMethodStats[k]!;
         var threshold = _minCount * recordRatio;
         if (stats.count + 0.001 < threshold) {
           callMethodStats.remove(k);
@@ -94,12 +90,11 @@
   _callMethodRecords.clear();
   _totalCallRecords = 0;
   var keys = callMethodStats.keys.toList();
-
   keys.sort(
-      (a, b) => callMethodStats[b].count.compareTo(callMethodStats[a].count));
-  List<List<Object>> ret = [];
+      (a, b) => callMethodStats[b]!.count.compareTo(callMethodStats[a]!.count));
+  var ret = <List<Object>>[];
   for (var key in keys) {
-    var stats = callMethodStats[key];
+    var stats = callMethodStats[key]!;
     ret.add([stats.typeName, stats.frame, stats.count.round()]);
   }
   return ret;
diff --git a/sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart
index 0a79d98..6ce53ac 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/regexp_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/regexp_helper.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.6
-
 part of dart._js_helper;
 
 // Helper method used by internal libraries.
@@ -117,10 +115,11 @@
     throw FormatException("Illegal RegExp pattern: $source, $errorMessage");
   }
 
-  RegExpMatch firstMatch(@nullCheck String string) {
-    List m = JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp, string);
+  RegExpMatch? firstMatch(@nullCheck String string) {
+    List<String>? m =
+        JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp, string);
     if (m == null) return null;
-    return _MatchImplementation(this, JSArray<String>.of(m));
+    return _MatchImplementation(this, m);
   }
 
   @notNull
@@ -128,7 +127,7 @@
     return JS<bool>('!', r'#.test(#)', _nativeRegExp, string);
   }
 
-  String stringMatch(String string) {
+  String? stringMatch(String string) {
     var match = firstMatch(string);
     if (match != null) return match.group(0);
     return null;
@@ -142,27 +141,29 @@
     return _AllMatchesIterable(this, string, start);
   }
 
-  RegExpMatch _execGlobal(String string, int start) {
+  RegExpMatch? _execGlobal(String string, int start) {
     Object regexp = _nativeGlobalVersion;
     JS("void", "#.lastIndex = #", regexp, start);
-    List match = JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
+    List<String>? match =
+        JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
     if (match == null) return null;
-    return _MatchImplementation(this, JSArray<String>.of(match));
+    return _MatchImplementation(this, match);
   }
 
-  RegExpMatch _execAnchored(String string, int start) {
+  RegExpMatch? _execAnchored(String string, int start) {
     Object regexp = _nativeAnchoredVersion;
     JS("void", "#.lastIndex = #", regexp, start);
-    List match = JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
+    List<String>? match =
+        JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
     if (match == null) return null;
     // If the last capture group participated, the original regexp did not
     // match at the start position.
     if (match[match.length - 1] != null) return null;
     match.length -= 1;
-    return _MatchImplementation(this, JSArray<String>.of(match));
+    return _MatchImplementation(this, match);
   }
 
-  RegExpMatch matchAsPrefix(String string, [int start = 0]) {
+  Match? matchAsPrefix(String string, [int start = 0]) {
     if (start < 0 || start > string.length) {
       throw RangeError.range(start, 0, string.length);
     }
@@ -190,22 +191,22 @@
   int get start => JS("int", "#.index", _match);
   int get end => start + _match[0].length;
 
-  String group(int index) => _match[index];
-  String operator [](int index) => group(index);
+  String? group(int index) => _match[index];
+  String? operator [](int index) => group(index);
   int get groupCount => _match.length - 1;
 
-  List<String> groups(List<int> groups) {
-    List<String> out = [];
+  List<String?> groups(List<int> groups) {
+    List<String?> out = [];
     for (int i in groups) {
       out.add(group(i));
     }
     return out;
   }
 
-  String namedGroup(String name) {
-    var groups = JS('Object|Null', '#.groups', _match);
+  String? namedGroup(String name) {
+    var groups = JS<Object?>('Object|Null', '#.groups', _match);
     if (groups != null) {
-      var result = JS('String|Null', '#[#]', groups, name);
+      var result = JS<String?>('', '#[#]', groups, name);
       if (result != null || JS<bool>('!', '# in #', name, groups)) {
         return result;
       }
@@ -214,7 +215,7 @@
   }
 
   Iterable<String> get groupNames {
-    var groups = JS('Object|Null', '#.groups', _match);
+    var groups = JS<Object?>('Object|Null', '#.groups', _match);
     if (groups != null) {
       var keys = JSArray<String>.of(JS('', 'Object.keys(#)', groups));
       return SubListIterable(keys, 0, null);
@@ -236,13 +237,13 @@
 
 class _AllMatchesIterator implements Iterator<RegExpMatch> {
   final JSSyntaxRegExp _regExp;
-  String _string;
+  String? _string;
   int _nextIndex;
-  RegExpMatch _current;
+  RegExpMatch? _current;
 
   _AllMatchesIterator(this._regExp, this._string, this._nextIndex);
 
-  RegExpMatch get current => _current;
+  RegExpMatch get current => _current as RegExpMatch;
 
   static bool _isLeadSurrogate(int c) {
     return c >= 0xd800 && c <= 0xdbff;
@@ -253,9 +254,10 @@
   }
 
   bool moveNext() {
-    if (_string == null) return false;
-    if (_nextIndex <= _string.length) {
-      var match = _regExp._execGlobal(_string, _nextIndex);
+    var string = _string;
+    if (string == null) return false;
+    if (_nextIndex <= string.length) {
+      var match = _regExp._execGlobal(string, _nextIndex);
       if (match != null) {
         _current = match;
         int nextIndex = match.end;
@@ -264,9 +266,9 @@
           // is in unicode mode and it would put us within a surrogate
           // pair. In that case, advance past the code point as a whole.
           if (_regExp.isUnicode &&
-              _nextIndex + 1 < _string.length &&
-              _isLeadSurrogate(_string.codeUnitAt(_nextIndex)) &&
-              _isTrailSurrogate(_string.codeUnitAt(_nextIndex + 1))) {
+              _nextIndex + 1 < string.length &&
+              _isLeadSurrogate(string.codeUnitAt(_nextIndex)) &&
+              _isTrailSurrogate(string.codeUnitAt(_nextIndex + 1))) {
             nextIndex++;
           }
           nextIndex++;
@@ -282,6 +284,6 @@
 }
 
 /** Find the first match of [regExp] in [string] at or after [start]. */
-RegExpMatch firstMatchAfter(JSSyntaxRegExp regExp, String string, int start) {
+RegExpMatch? firstMatchAfter(JSSyntaxRegExp regExp, String string, int start) {
   return regExp._execGlobal(string, start);
 }
diff --git a/sdk/lib/_internal/js_dev_runtime/private/string_helper.dart b/sdk/lib/_internal/js_dev_runtime/private/string_helper.dart
index 326af11..7a0de57 100644
--- a/sdk/lib/_internal/js_dev_runtime/private/string_helper.dart
+++ b/sdk/lib/_internal/js_dev_runtime/private/string_helper.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.6
-
 part of dart._js_helper;
 
 @notNull
@@ -41,7 +39,7 @@
   }
 
   List<String> groups(List<int> groups_) {
-    List<String> result = List<String>();
+    List<String> result = <String>[];
     for (int g in groups_) {
       result.add(group(g));
     }
@@ -81,7 +79,7 @@
   final String _input;
   final String _pattern;
   int _index;
-  Match _current;
+  Match? _current;
 
   _StringAllMatchesIterator(this._input, this._pattern, this._index);
 
@@ -104,7 +102,7 @@
     return true;
   }
 
-  Match get current => _current;
+  Match get current => _current!;
 }
 
 @notNull
@@ -176,15 +174,15 @@
   }
 }
 
-String _matchString(Match match) => match[0];
+String _matchString(Match match) => match[0]!;
 String _stringIdentity(String string) => string;
 
 @notNull
 String stringReplaceAllFuncUnchecked(
     String receiver,
     @nullCheck Pattern pattern,
-    String onMatch(Match match),
-    String onNonMatch(String nonMatch)) {
+    String Function(Match)? onMatch,
+    String Function(String)? onNonMatch) {
   if (onMatch == null) onMatch = _matchString;
   if (onNonMatch == null) onNonMatch = _stringIdentity;
   if (pattern is String) {
diff --git a/sdk/lib/_internal/js_runtime/lib/annotations.dart b/sdk/lib/_internal/js_runtime/lib/annotations.dart
index 971d2bd..f53c5f3 100644
--- a/sdk/lib/_internal/js_runtime/lib/annotations.dart
+++ b/sdk/lib/_internal/js_runtime/lib/annotations.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.6
-
 part of _js_helper;
 
 /// Marks a class as native and defines its JavaScript name(s).
diff --git a/sdk/lib/_internal/js_runtime/lib/async_patch.dart b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
index 3da215e..45ed0c5 100644
--- a/sdk/lib/_internal/js_runtime/lib/async_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/async_patch.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.6
-
 // Patch file for the dart:async library.
 
 import 'dart:_js_helper'
@@ -122,7 +120,7 @@
 
 class _TimerImpl implements Timer {
   final bool _once;
-  int _handle;
+  int? _handle;
   int _tick = 0;
 
   _TimerImpl(int milliseconds, void callback()) : _once = true {
@@ -197,15 +195,24 @@
 
   _AsyncAwaitCompleter() : isSync = false;
 
-  void complete([FutureOr<T> value]) {
-    if (!isSync || value is Future<T>) {
+  void complete([FutureOr<T>? value]) {
+    // All paths require that if value is null, null as T succeeds.
+    value = (value == null) ? value as T : value;
+    if (!isSync) {
       _future._asyncComplete(value);
+    } else if (value is Future<T>) {
+      assert(!_future._isComplete);
+      _future._chainFuture(value);
     } else {
-      _future._completeWithValue(value);
+      // TODO(40014): Remove cast when type promotion works.
+      // This would normally be `as T` but we use `as dynamic` to make the
+      // unneeded check be implict to match dart2js unsound optimizations in the
+      // user code.
+      _future._completeWithValue(value as dynamic);
     }
   }
 
-  void completeError(Object e, [StackTrace st]) {
+  void completeError(Object e, [StackTrace? st]) {
     st ??= AsyncError.defaultStackTrace(e);
     if (isSync) {
       _future._completeError(e, st);
@@ -280,7 +287,7 @@
 /// The [bodyFunction] argument is the continuation that should be invoked
 /// when the future completes.
 void _awaitOnObject(object, _WrappedAsyncBody bodyFunction) {
-  Function thenCallback =
+  FutureOr<dynamic> Function(dynamic) thenCallback =
       (result) => bodyFunction(async_error_codes.SUCCESS, result);
 
   Function errorCallback = (dynamic error, StackTrace stackTrace) {
@@ -377,7 +384,7 @@
   if (identical(bodyFunctionOrErrorCode, async_error_codes.SUCCESS)) {
     // This happens on return from the async* function.
     if (controller.isCanceled) {
-      controller.cancelationFuture._completeWithValue(null);
+      controller.cancelationFuture!._completeWithValue(null);
     } else {
       controller.close();
     }
@@ -385,7 +392,7 @@
   } else if (identical(bodyFunctionOrErrorCode, async_error_codes.ERROR)) {
     // The error is a js-error.
     if (controller.isCanceled) {
-      controller.cancelationFuture._completeError(
+      controller.cancelationFuture!._completeError(
           unwrapException(object), getTraceFromException(object));
     } else {
       controller.addError(
@@ -451,7 +458,7 @@
 /// If yielding while the subscription is paused it will become suspended. And
 /// only resume after the subscription is resumed or canceled.
 class _AsyncStarStreamController<T> {
-  StreamController<T> controller;
+  late StreamController<T> controller;
   Stream get stream => controller.stream;
 
   /// True when the async* function has yielded while being paused.
@@ -461,7 +468,7 @@
 
   bool get isPaused => controller.isPaused;
 
-  _Future cancelationFuture = null;
+  _Future? cancelationFuture = null;
 
   /// True after the StreamSubscription has been cancelled.
   /// When this is true, errors thrown from the async* body should go to the
@@ -565,22 +572,21 @@
   dynamic _body;
 
   // The current value, unless iterating a non-sync* nested iterator.
-  T _current = null;
+  T? _current = null;
 
   // This is the nested iterator when iterating a yield* of a non-sync iterator.
-  // TODO(32956): In strong-mode, yield* takes an Iterable<T> (possibly checked
-  // with an implicit downcast), so change type to Iterator<T>.
-  Iterator _nestedIterator = null;
+  Iterator<T>? _nestedIterator = null;
 
   // Stack of suspended state machines when iterating a yield* of a sync*
   // iterator.
-  List _suspendedBodies = null;
+  List? _suspendedBodies = null;
 
   _SyncStarIterator(this._body);
 
   T get current {
-    if (_nestedIterator == null) return _current;
-    return _nestedIterator.current;
+    var nested = _nestedIterator;
+    if (nested == null) return _current as dynamic; // implicit: as T;
+    return nested.current;
   }
 
   _runBody() {
@@ -611,7 +617,7 @@
   bool moveNext() {
     while (true) {
       if (_nestedIterator != null) {
-        if (_nestedIterator.moveNext()) {
+        if (_nestedIterator!.moveNext()) {
           return true;
         } else {
           _nestedIterator = null;
@@ -621,13 +627,14 @@
       if (value is _IterationMarker) {
         int state = value.state;
         if (state == _IterationMarker.ITERATION_ENDED) {
-          if (_suspendedBodies == null || _suspendedBodies.isEmpty) {
+          var suspendedBodies = _suspendedBodies;
+          if (suspendedBodies == null || suspendedBodies.isEmpty) {
             _current = null;
             // Rely on [_body] to repeatedly return `ITERATION_ENDED`.
             return false;
           }
           // Resume the innermost suspended iterator.
-          _body = _suspendedBodies.removeLast();
+          _body = suspendedBodies.removeLast();
           continue;
         } else if (state == _IterationMarker.UNCAUGHT_ERROR) {
           // Rely on [_body] to repeatedly return `UNCAUGHT_ERROR`.
@@ -636,8 +643,12 @@
           JS('', 'throw #', value.value);
         } else {
           assert(state == _IterationMarker.YIELD_STAR);
-          Iterator inner = value.value.iterator;
+          Iterator<T> inner = value.value.iterator;
           if (inner is _SyncStarIterator) {
+            // The test needs to be 'is _SyncStarIterator<T>' for promotion to
+            // work. However, that test is much more expensive, so we use an
+            // unsafe cast.
+            _SyncStarIterator<T> innerSyncStarIterator = JS('', '#', inner);
             // Suspend the current state machine and start acting on behalf of
             // the nested state machine.
             //
@@ -645,7 +656,7 @@
             // suspending the current body when all it will do is step without
             // effect to ITERATION_ENDED.
             (_suspendedBodies ??= []).add(_body);
-            _body = inner._body;
+            _body = innerSyncStarIterator._body;
             continue;
           } else {
             _nestedIterator = inner;
diff --git a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
index b465446..a1d76bf 100644
--- a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/collection_patch.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.6
-
 // Patch file for dart:collection classes.
 import 'dart:_foreign_helper' show JS;
 import 'dart:_js_helper'
@@ -30,9 +28,9 @@
 class HashMap<K, V> {
   @patch
   factory HashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(K key1, K key2)?,
+      int hashCode(K key)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -82,7 +80,7 @@
   // list of all the keys. We cache that on the instance and clear the
   // the cache whenever the key set changes. This is also used to
   // guard against concurrent modifications.
-  List _keys;
+  List? _keys;
 
   _HashMap();
 
@@ -95,10 +93,10 @@
   }
 
   Iterable<V> get values {
-    return new MappedIterable<K, V>(keys, (each) => this[each]);
+    return new MappedIterable<K, V>(keys, (each) => this[each] as V);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (_isStringKey(key)) {
       var strings = _strings;
       return (strings == null) ? false : _hasTableEntry(strings, key);
@@ -110,14 +108,14 @@
     }
   }
 
-  bool _containsKey(Object key) {
+  bool _containsKey(Object? key) {
     var rest = _rest;
     if (rest == null) return false;
     var bucket = _getBucket(rest, key);
     return _findBucketIndex(bucket, key) >= 0;
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     return _computeKeys().any((each) => this[each] == value);
   }
 
@@ -127,7 +125,7 @@
     });
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (_isStringKey(key)) {
       var strings = _strings;
       return JS('', '#', strings == null ? null : _getTableEntry(strings, key));
@@ -139,7 +137,7 @@
     }
   }
 
-  V _get(Object key) {
+  V? _get(Object? key) {
     var rest = _rest;
     if (rest == null) return null;
     var bucket = _getBucket(rest, key);
@@ -183,13 +181,13 @@
   }
 
   V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) return this[key];
+    if (containsKey(key)) return this[key] as V;
     V value = ifAbsent();
     this[key] = value;
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (_isStringKey(key)) {
       return _removeHashTableEntry(_strings, key);
     } else if (_isNumericKey(key)) {
@@ -199,7 +197,7 @@
     }
   }
 
-  V _remove(Object key) {
+  V? _remove(Object? key) {
     var rest = _rest;
     if (rest == null) return null;
     var hash = _computeHashCode(key);
@@ -228,7 +226,7 @@
     List keys = _computeKeys();
     for (int i = 0, length = keys.length; i < length; i++) {
       var key = JS('var', '#[#]', keys, i);
-      action(key, this[key]);
+      action(key, this[key] as V);
       if (JS('bool', '# !== #', keys, _keys)) {
         throw new ConcurrentModificationError(this);
       }
@@ -236,8 +234,9 @@
   }
 
   List _computeKeys() {
-    if (_keys != null) return _keys;
-    List result = new List(_length);
+    var result = _keys;
+    if (result != null) return result;
+    result = List.filled(_length, null);
     int index = 0;
 
     // Add all string keys to the list.
@@ -283,7 +282,8 @@
       }
     }
     assert(index == _length);
-    return _keys = result;
+    _keys = result;
+    return result;
   }
 
   void _addHashTableEntry(var table, K key, V value) {
@@ -294,7 +294,7 @@
     _setTableEntry(table, key, value);
   }
 
-  V _removeHashTableEntry(var table, Object key) {
+  V? _removeHashTableEntry(var table, Object? key) {
     if (table != null && _hasTableEntry(table, key)) {
       V value = _getTableEntry(table, key);
       _deleteTableEntry(table, key);
@@ -408,10 +408,10 @@
   final _Hasher<K> _hashCode;
   final _Predicate _validKey;
 
-  _CustomHashMap(this._equals, this._hashCode, bool validKey(potentialKey))
+  _CustomHashMap(this._equals, this._hashCode, bool validKey(potentialKey)?)
       : _validKey = (validKey != null) ? validKey : ((v) => v is K);
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (!_validKey(key)) return null;
     return super._get(key);
   }
@@ -420,12 +420,12 @@
     super._set(key, value);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (!_validKey(key)) return false;
     return super._containsKey(key);
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (!_validKey(key)) return null;
     return super._remove(key);
   }
@@ -458,7 +458,7 @@
     return new _HashMapKeyIterator<E>(_map, _map._computeKeys());
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     return _map.containsKey(element);
   }
 
@@ -477,11 +477,11 @@
   final _map;
   final List _keys;
   int _offset = 0;
-  E _current;
+  E? _current;
 
   _HashMapKeyIterator(this._map, this._keys);
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     var keys = _keys;
@@ -506,9 +506,9 @@
 class LinkedHashMap<K, V> {
   @patch
   factory LinkedHashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(K key1, K key2)?,
+      int hashCode(K key)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -613,11 +613,11 @@
 
   Iterable<V> get values => new _Es6MapIterable<V>(this, false);
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     return JS('bool', '#.has(#)', _map, key);
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     return values.any((each) => each == value);
   }
 
@@ -627,7 +627,7 @@
     });
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     return JS('var', '#.get(#)', _map, key);
   }
 
@@ -637,14 +637,14 @@
   }
 
   V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) return this[key];
+    if (containsKey(key)) return this[key] as V;
     V value = ifAbsent();
     this[key] = value;
     return value;
   }
 
-  V remove(Object key) {
-    V value = this[key];
+  V? remove(Object? key) {
+    V? value = this[key];
     JS('bool', '#.delete(#)', _map, key);
     _modified();
     return value;
@@ -693,7 +693,7 @@
   Iterator<E> get iterator =>
       new _Es6MapIterator<E>(_map, _map._modifications, _isKeys);
 
-  bool contains(Object element) => _map.containsKey(element);
+  bool contains(Object? element) => _map.containsKey(element);
 
   void forEach(void f(E element)) {
     var jsIterator;
@@ -722,8 +722,8 @@
   final bool _isKeys;
   var _jsIterator;
   var _next;
-  E _current;
-  bool _done;
+  E? _current;
+  bool _done = false;
 
   _Es6MapIterator(this._map, this._modifications, this._isKeys) {
     if (_isKeys) {
@@ -731,10 +731,9 @@
     } else {
       _jsIterator = JS('var', '#.values()', _map._map);
     }
-    _done = false;
   }
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     if (_modifications != _map._modifications) {
@@ -761,10 +760,10 @@
   final _Predicate _validKey;
 
   _LinkedCustomHashMap(
-      this._equals, this._hashCode, bool validKey(potentialKey))
+      this._equals, this._hashCode, bool validKey(potentialKey)?)
       : _validKey = (validKey != null) ? validKey : ((v) => v is K);
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (!_validKey(key)) return null;
     return super.internalGet(key);
   }
@@ -773,12 +772,12 @@
     super.internalSet(key, value);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (!_validKey(key)) return false;
     return super.internalContainsKey(key);
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (!_validKey(key)) return null;
     return super.internalRemove(key);
   }
@@ -805,9 +804,9 @@
 class HashSet<E> {
   @patch
   factory HashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(E e1, E e2)?,
+      int hashCode(E e)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -858,7 +857,7 @@
   // list of all the elements. We cache that on the instance and clear
   // the cache whenever the set changes. This is also used to
   // guard against concurrent modifications.
-  List _elements;
+  List? _elements;
 
   _HashSet();
 
@@ -874,7 +873,7 @@
   bool get isEmpty => _length == 0;
   bool get isNotEmpty => !isEmpty;
 
-  bool contains(Object object) {
+  bool contains(Object? object) {
     if (_isStringElement(object)) {
       var strings = _strings;
       return (strings == null) ? false : _hasTableEntry(strings, object);
@@ -886,21 +885,21 @@
     }
   }
 
-  bool _contains(Object object) {
+  bool _contains(Object? object) {
     var rest = _rest;
     if (rest == null) return false;
     var bucket = _getBucket(rest, object);
     return _findBucketIndex(bucket, object) >= 0;
   }
 
-  E lookup(Object object) {
+  E? lookup(Object? object) {
     if (_isStringElement(object) || _isNumericElement(object)) {
-      return this.contains(object) ? object : null;
+      return this.contains(object) ? object as E : null;
     }
     return _lookup(object);
   }
 
-  E _lookup(Object object) {
+  E? _lookup(Object? object) {
     var rest = _rest;
     if (rest == null) return null;
     var bucket = _getBucket(rest, object);
@@ -947,7 +946,7 @@
     }
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (_isStringElement(object)) {
       return _removeHashTableEntry(_strings, object);
     } else if (_isNumericElement(object)) {
@@ -957,7 +956,7 @@
     }
   }
 
-  bool _remove(Object object) {
+  bool _remove(Object? object) {
     var rest = _rest;
     if (rest == null) return false;
     var hash = _computeHashCode(object);
@@ -985,8 +984,9 @@
   }
 
   List _computeElements() {
-    if (_elements != null) return _elements;
-    List result = new List(_length);
+    var result = _elements;
+    if (result != null) return result;
+    result = List.filled(_length, null);
     int index = 0;
 
     // Add all string elements to the list.
@@ -1031,7 +1031,8 @@
       }
     }
     assert(index == _length);
-    return _elements = result;
+    _elements = result;
+    return result;
   }
 
   bool _addHashTableEntry(var table, E element) {
@@ -1042,7 +1043,7 @@
     return true;
   }
 
-  bool _removeHashTableEntry(var table, Object element) {
+  bool _removeHashTableEntry(var table, Object? element) {
     if (table != null && _hasTableEntry(table, element)) {
       _deleteTableEntry(table, element);
       _length--;
@@ -1143,7 +1144,7 @@
   _Equality<E> _equality;
   _Hasher<E> _hasher;
   _Predicate _validKey;
-  _CustomHashSet(this._equality, this._hasher, bool validKey(potentialKey))
+  _CustomHashSet(this._equality, this._hasher, bool validKey(potentialKey)?)
       : _validKey = (validKey != null) ? validKey : ((x) => x is E);
 
   Set<E> _newSet() => new _CustomHashSet<E>(_equality, _hasher, _validKey);
@@ -1168,17 +1169,17 @@
 
   bool add(E object) => super._add(object);
 
-  bool contains(Object object) {
+  bool contains(Object? object) {
     if (!_validKey(object)) return false;
     return super._contains(object);
   }
 
-  E lookup(Object object) {
+  E? lookup(Object? object) {
     if (!_validKey(object)) return null;
     return super._lookup(object);
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (!_validKey(object)) return false;
     return super._remove(object);
   }
@@ -1189,11 +1190,11 @@
   final _set;
   final List _elements;
   int _offset = 0;
-  E _current;
+  E? _current;
 
   _HashSetIterator(this._set, this._elements);
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     var elements = _elements;
@@ -1218,9 +1219,9 @@
 class LinkedHashSet<E> {
   @patch
   factory LinkedHashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(E e1, E e2)?,
+      int hashCode(E e)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -1293,8 +1294,8 @@
 
   // The elements are stored in cells that are linked together
   // to form a double linked list.
-  _LinkedHashSetCell _first;
-  _LinkedHashSetCell _last;
+  _LinkedHashSetCell? _first;
+  _LinkedHashSetCell? _last;
 
   // We track the number of modifications done to the element set to
   // be able to throw when the set is modified while being iterated
@@ -1319,38 +1320,38 @@
   bool get isEmpty => _length == 0;
   bool get isNotEmpty => !isEmpty;
 
-  bool contains(Object object) {
+  bool contains(Object? object) {
     if (_isStringElement(object)) {
       var strings = _strings;
       if (strings == null) return false;
-      _LinkedHashSetCell cell = _getTableEntry(strings, object);
+      _LinkedHashSetCell? cell = _getTableEntry(strings, object);
       return cell != null;
     } else if (_isNumericElement(object)) {
       var nums = _nums;
       if (nums == null) return false;
-      _LinkedHashSetCell cell = _getTableEntry(nums, object);
+      _LinkedHashSetCell? cell = _getTableEntry(nums, object);
       return cell != null;
     } else {
       return _contains(object);
     }
   }
 
-  bool _contains(Object object) {
+  bool _contains(Object? object) {
     var rest = _rest;
     if (rest == null) return false;
     var bucket = _getBucket(rest, object);
     return _findBucketIndex(bucket, object) >= 0;
   }
 
-  E lookup(Object object) {
+  E? lookup(Object? object) {
     if (_isStringElement(object) || _isNumericElement(object)) {
-      return this.contains(object) ? object : null;
+      return this.contains(object) ? object as E : null;
     } else {
       return _lookup(object);
     }
   }
 
-  E _lookup(Object object) {
+  E? _lookup(Object? object) {
     var rest = _rest;
     if (rest == null) return null;
     var bucket = _getBucket(rest, object);
@@ -1360,7 +1361,7 @@
   }
 
   void forEach(void action(E element)) {
-    _LinkedHashSetCell cell = _first;
+    _LinkedHashSetCell? cell = _first;
     int modifications = _modifications;
     while (cell != null) {
       action(cell._element);
@@ -1372,13 +1373,15 @@
   }
 
   E get first {
-    if (_first == null) throw new StateError("No elements");
-    return _first._element;
+    var first = _first;
+    if (first == null) throw new StateError("No elements");
+    return first._element;
   }
 
   E get last {
-    if (_last == null) throw new StateError("No elements");
-    return _last._element;
+    var last = _last;
+    if (last == null) throw new StateError("No elements");
+    return last._element;
   }
 
   // Collection.
@@ -1413,7 +1416,7 @@
     return true;
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (_isStringElement(object)) {
       return _removeHashTableEntry(_strings, object);
     } else if (_isNumericElement(object)) {
@@ -1423,7 +1426,7 @@
     }
   }
 
-  bool _remove(Object object) {
+  bool _remove(Object? object) {
     var rest = _rest;
     if (rest == null) return false;
     var hash = _computeHashCode(object);
@@ -1448,10 +1451,10 @@
   }
 
   void _filterWhere(bool test(E element), bool removeMatching) {
-    _LinkedHashSetCell cell = _first;
+    _LinkedHashSetCell? cell = _first;
     while (cell != null) {
       E element = cell._element;
-      _LinkedHashSetCell next = cell._next;
+      _LinkedHashSetCell? next = cell._next;
       int modifications = _modifications;
       bool shouldRemove = (removeMatching == test(element));
       if (modifications != _modifications) {
@@ -1471,15 +1474,15 @@
   }
 
   bool _addHashTableEntry(var table, E element) {
-    _LinkedHashSetCell cell = _getTableEntry(table, element);
+    _LinkedHashSetCell? cell = _getTableEntry(table, element);
     if (cell != null) return false;
     _setTableEntry(table, element, _newLinkedCell(element));
     return true;
   }
 
-  bool _removeHashTableEntry(var table, Object element) {
+  bool _removeHashTableEntry(var table, Object? element) {
     if (table == null) return false;
-    _LinkedHashSetCell cell = _getTableEntry(table, element);
+    _LinkedHashSetCell? cell = _getTableEntry(table, element);
     if (cell == null) return false;
     _unlinkCell(cell);
     _deleteTableEntry(table, element);
@@ -1499,7 +1502,7 @@
     if (_first == null) {
       _first = _last = cell;
     } else {
-      _LinkedHashSetCell last = _last;
+      _LinkedHashSetCell last = _last!;
       cell._previous = last;
       _last = last._next = cell;
     }
@@ -1510,8 +1513,8 @@
 
   // Unlink the given cell from the linked list of cells.
   void _unlinkCell(_LinkedHashSetCell cell) {
-    _LinkedHashSetCell previous = cell._previous;
-    _LinkedHashSetCell next = cell._next;
+    _LinkedHashSetCell? previous = cell._previous;
+    _LinkedHashSetCell? next = cell._next;
     if (previous == null) {
       assert(cell == _first);
       _first = next;
@@ -1617,7 +1620,7 @@
   _Hasher<E> _hasher;
   _Predicate _validKey;
   _LinkedCustomHashSet(
-      this._equality, this._hasher, bool validKey(potentialKey))
+      this._equality, this._hasher, bool validKey(potentialKey)?)
       : _validKey = (validKey != null) ? validKey : ((x) => x is E);
 
   Set<E> _newSet() =>
@@ -1644,30 +1647,30 @@
 
   bool add(E element) => super._add(element);
 
-  bool contains(Object object) {
+  bool contains(Object? object) {
     if (!_validKey(object)) return false;
     return super._contains(object);
   }
 
-  E lookup(Object object) {
+  E? lookup(Object? object) {
     if (!_validKey(object)) return null;
     return super._lookup(object);
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (!_validKey(object)) return false;
     return super._remove(object);
   }
 
-  bool containsAll(Iterable<Object> elements) {
-    for (Object element in elements) {
+  bool containsAll(Iterable<Object?> elements) {
+    for (Object? element in elements) {
       if (!_validKey(element) || !this.contains(element)) return false;
     }
     return true;
   }
 
-  void removeAll(Iterable<Object> elements) {
-    for (Object element in elements) {
+  void removeAll(Iterable<Object?> elements) {
+    for (Object? element in elements) {
       if (_validKey(element)) {
         super._remove(element);
       }
@@ -1678,8 +1681,8 @@
 class _LinkedHashSetCell {
   final _element;
 
-  _LinkedHashSetCell _next;
-  _LinkedHashSetCell _previous;
+  _LinkedHashSetCell? _next;
+  _LinkedHashSetCell? _previous;
 
   _LinkedHashSetCell(this._element);
 }
@@ -1688,52 +1691,26 @@
 class _LinkedHashSetIterator<E> implements Iterator<E> {
   final _set;
   final int _modifications;
-  _LinkedHashSetCell _cell;
-  E _current;
+  _LinkedHashSetCell? _cell;
+  E? _current;
 
   _LinkedHashSetIterator(this._set, this._modifications) {
     _cell = _set._first;
   }
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
+    var cell = _cell;
     if (_modifications != _set._modifications) {
       throw new ConcurrentModificationError(_set);
-    } else if (_cell == null) {
+    } else if (cell == null) {
       _current = null;
       return false;
     } else {
-      _current = _cell._element;
-      _cell = _cell._next;
+      _current = cell._element;
+      _cell = cell._next;
       return true;
     }
   }
 }
-
-@patch
-abstract class _SplayTree<K, Node extends _SplayTreeNode<K>> {
-  @patch
-  Node _splayMin(Node node) {
-    Node current = node;
-    while (current.left != null) {
-      Node left = current.left;
-      current.left = left.right;
-      left.right = current;
-      current = left;
-    }
-    return current;
-  }
-
-  @patch
-  Node _splayMax(Node node) {
-    Node current = node;
-    while (current.right != null) {
-      Node right = current.right;
-      current.right = right.left;
-      right.left = current;
-      current = right;
-    }
-    return current;
-  }
-}
diff --git a/sdk/lib/_internal/js_runtime/lib/constant_map.dart b/sdk/lib/_internal/js_runtime/lib/constant_map.dart
index fce8922..0f673d8 100644
--- a/sdk/lib/_internal/js_runtime/lib/constant_map.dart
+++ b/sdk/lib/_internal/js_runtime/lib/constant_map.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.6
-
 part of _js_helper;
 
 class ConstantMapView<K, V> extends UnmodifiableMapView<K, V>
@@ -14,7 +12,7 @@
 abstract class ConstantMap<K, V> implements Map<K, V> {
   // Used to create unmodifiable maps from other maps.
   factory ConstantMap.from(Map other) {
-    List keys = new List<K>.from(other.keys);
+    var keys = new List<K>.from(other.keys);
     bool allStrings = true;
     for (var k in keys) {
       if (k is! String) {
@@ -30,7 +28,7 @@
       for (var k in keys) {
         V v = other[k];
         if (k != '__proto__') {
-          if (!jsHasOwnProperty(object, k)) length++;
+          if (!jsHasOwnProperty(object, k as String)) length++;
           JS('void', '#[#] = #', object, k, v);
         } else {
           containsProto = true;
@@ -56,18 +54,27 @@
 
   String toString() => MapBase.mapToString(this);
 
-  static Null _throwUnmodifiable() {
+  static Never _throwUnmodifiable() {
     throw new UnsupportedError('Cannot modify unmodifiable Map');
   }
 
-  void operator []=(K key, V val) => _throwUnmodifiable();
-  V putIfAbsent(K key, V ifAbsent()) => _throwUnmodifiable();
-  V remove(Object key) => _throwUnmodifiable();
+  void operator []=(K key, V val) {
+    _throwUnmodifiable();
+  }
+
+  V putIfAbsent(K key, V ifAbsent()) {
+    _throwUnmodifiable();
+  }
+
+  V? remove(Object? key) {
+    _throwUnmodifiable();
+  }
+
   void clear() => _throwUnmodifiable();
   void addAll(Map<K, V> other) => _throwUnmodifiable();
 
   Iterable<MapEntry<K, V>> get entries sync* {
-    for (var key in keys) yield new MapEntry<K, V>(key, this[key]);
+    for (var key in keys) yield new MapEntry<K, V>(key, this[key]!);
   }
 
   void addEntries(Iterable<MapEntry<K, V>> entries) {
@@ -83,7 +90,7 @@
     return result;
   }
 
-  V update(K key, V update(V value), {V ifAbsent()}) {
+  V update(K key, V update(V value), {V ifAbsent()?}) {
     _throwUnmodifiable();
   }
 
@@ -111,17 +118,17 @@
   int get length => JS('JSUInt31', '#', _length);
   List<K> get _keysArray => JS('JSUnmodifiableArray', '#', _keys);
 
-  bool containsValue(Object needle) {
+  bool containsValue(Object? needle) {
     return values.any((V value) => value == needle);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (key is! String) return false;
     if ('__proto__' == key) return false;
     return jsHasOwnProperty(_jsObject, key);
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (!containsKey(key)) return null;
     return JS('', '#', _fetch(key));
   }
@@ -157,7 +164,7 @@
 
   final V _protoValue;
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (key is! String) return false;
     if ('__proto__' == key) return true;
     return jsHasOwnProperty(_jsObject, key);
@@ -187,7 +194,7 @@
   // We cannot create the backing map on creation since hashCode interceptors
   // have not been defined when constants are created.
   Map<K, V> _getMap() {
-    LinkedHashMap<K, V> backingMap = JS('LinkedHashMap|Null', r'#.$map', this);
+    LinkedHashMap<K, V>? backingMap = JS('LinkedHashMap|Null', r'#.$map', this);
     if (backingMap == null) {
       backingMap = new JsLinkedHashMap<K, V>();
       fillLiteralMap(_jsData, backingMap);
@@ -196,15 +203,15 @@
     return backingMap;
   }
 
-  bool containsValue(Object needle) {
+  bool containsValue(Object? needle) {
     return _getMap().containsValue(needle);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     return _getMap().containsKey(key);
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     return _getMap()[key];
   }
 
diff --git a/sdk/lib/_internal/js_runtime/lib/convert_patch.dart b/sdk/lib/_internal/js_runtime/lib/convert_patch.dart
index bcd9ef6..d7dfb5f 100644
--- a/sdk/lib/_internal/js_runtime/lib/convert_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/convert_patch.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.6
-
 // Patch file for dart:convert library.
 
 import 'dart:_js_helper' show argumentErrorValue, patch;
@@ -28,7 +26,7 @@
 ///
 /// Throws [FormatException] if the input is not valid JSON text.
 @patch
-_parseJson(String source, reviver(key, value)) {
+_parseJson(String source, reviver(key, value)?) {
   if (source is! String) throw argumentErrorValue(source);
 
   var parsed;
@@ -36,7 +34,7 @@
     parsed = JS('=Object|JSExtendableArray|Null|bool|num|String',
         'JSON.parse(#)', source);
   } catch (e) {
-    throw new FormatException(JS('String', 'String(#)', e));
+    throw FormatException(JS<String>('String', 'String(#)', e));
   }
 
   if (reviver == null) {
@@ -49,20 +47,20 @@
 /// Walks the raw JavaScript value [json], replacing JavaScript Objects with
 /// Maps. [json] is expected to be freshly allocated so elements can be replaced
 /// in-place.
-_convertJsonToDart(json, reviver(key, value)) {
-  assert(reviver != null);
+_convertJsonToDart(json, reviver(Object? key, Object? value)) {
   walk(e) {
     // JavaScript null, string, number, bool are in the correct representation.
-    if (JS('bool', '# == null', e) || JS('bool', 'typeof # != "object"', e)) {
+    if (JS<bool>('bool', '# == null', e) ||
+        JS<bool>('bool', 'typeof # != "object"', e)) {
       return e;
     }
 
     // This test is needed to avoid identifying '{"__proto__":[]}' as an Array.
     // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
     // bug 621 below is fixed.
-    if (JS('bool', 'Object.getPrototypeOf(#) === Array.prototype', e)) {
+    if (JS<bool>('bool', 'Object.getPrototypeOf(#) === Array.prototype', e)) {
       // In-place update of the elements since JS Array is a Dart List.
-      for (int i = 0; i < JS('int', '#.length', e); i++) {
+      for (int i = 0; i < JS<int>('int', '#.length', e); i++) {
         // Use JS indexing to avoid range checks.  We know this is the only
         // reference to the list, but the compiler will likely never be able to
         // tell that this instance of the list cannot have its length changed by
@@ -76,7 +74,7 @@
 
     // Otherwise it is a plain object, so copy to a JSON map, so we process
     // and revive all entries recursively.
-    _JsonMap map = new _JsonMap(e);
+    _JsonMap map = _JsonMap(e);
     var processed = map._processed;
     List<String> keys = map._computeKeys();
     for (int i = 0; i < keys.length; i++) {
@@ -98,19 +96,20 @@
   if (object == null) return null;
 
   // JavaScript string, number, bool already has the correct representation.
-  if (JS('bool', 'typeof # != "object"', object)) {
+  if (JS<bool>('bool', 'typeof # != "object"', object)) {
     return object;
   }
 
   // This test is needed to avoid identifying '{"__proto__":[]}' as an array.
   // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
   // bug https://code.google.com/p/v8/issues/detail?id=621 is fixed.
-  if (JS('bool', 'Object.getPrototypeOf(#) !== Array.prototype', object)) {
-    return new _JsonMap(object);
+  if (JS<bool>(
+      'bool', 'Object.getPrototypeOf(#) !== Array.prototype', object)) {
+    return _JsonMap(object);
   }
 
   // Update the elements in place since JS arrays are Dart lists.
-  for (int i = 0; i < JS('int', '#.length', object); i++) {
+  for (int i = 0; i < JS<int>('int', '#.length', object); i++) {
     // Use JS indexing to avoid range checks.  We know this is the only
     // reference to the list, but the compiler will likely never be able to
     // tell that this instance of the list cannot have its length changed by
@@ -157,12 +156,12 @@
 
   Iterable<String> get keys {
     if (_isUpgraded) return _upgradedMap.keys;
-    return new _JsonMapKeyIterable(this);
+    return _JsonMapKeyIterable(this);
   }
 
   Iterable get values {
     if (_isUpgraded) return _upgradedMap.values;
-    return new MappedIterable(_computeKeys(), (each) => this[each]);
+    return MappedIterable(_computeKeys(), (each) => this[each]);
   }
 
   operator []=(key, value) {
@@ -209,7 +208,7 @@
     return value;
   }
 
-  remove(Object key) {
+  remove(Object? key) {
     if (!_isUpgraded && !containsKey(key)) return null;
     return _upgrade().remove(key);
   }
@@ -249,7 +248,7 @@
       // Check if invoking the callback function changed
       // the key set. If so, throw an exception.
       if (!identical(keys, _data)) {
-        throw new ConcurrentModificationError(this);
+        throw ConcurrentModificationError(this);
       }
     }
   }
@@ -270,7 +269,7 @@
 
   List<String> _computeKeys() {
     assert(!_isUpgraded);
-    List keys = _data;
+    List? keys = _data;
     if (keys == null) {
       keys = _data = new JSArray<String>.typed(_getPropertyNames(_original));
     }
@@ -293,7 +292,7 @@
     // safely force a concurrent modification error in case
     // someone is iterating over the map here.
     if (keys.isEmpty) {
-      keys.add(null);
+      keys.add("");
     } else {
       keys.clear();
     }
@@ -316,15 +315,15 @@
   // Private JavaScript helper methods.
   // ------------------------------------------
 
-  static bool _hasProperty(object, String key) =>
-      JS('bool', 'Object.prototype.hasOwnProperty.call(#,#)', object, key);
+  static bool _hasProperty(object, String key) => JS<bool>(
+      'bool', 'Object.prototype.hasOwnProperty.call(#,#)', object, key);
   static _getProperty(object, String key) => JS('', '#[#]', object, key);
   static _setProperty(object, String key, value) =>
       JS('', '#[#]=#', object, key, value);
   static List _getPropertyNames(object) =>
       JS('JSExtendableArray', 'Object.keys(#)', object);
   static bool _isUnprocessed(object) =>
-      JS('bool', 'typeof(#)=="undefined"', object);
+      JS<bool>('bool', 'typeof(#)=="undefined"', object);
   static _newJavaScriptObject() => JS('=Object', 'Object.create(null)');
 }
 
@@ -352,14 +351,14 @@
 
   /// Delegate to [parent.containsKey] to ensure the performance expected
   /// from [Map.keys.containsKey].
-  bool contains(Object key) => _parent.containsKey(key);
+  bool contains(Object? key) => _parent.containsKey(key);
 }
 
 @patch
 class JsonDecoder {
   @patch
-  StringConversionSink startChunkedConversion(Sink<Object> sink) {
-    return new _JsonDecoderSink(_reviver, sink);
+  StringConversionSink startChunkedConversion(Sink<Object?> sink) {
+    return _JsonDecoderSink(_reviver, sink);
   }
 }
 
@@ -368,18 +367,17 @@
 ///
 /// The sink only creates one object, but its input can be chunked.
 // TODO(floitsch): don't accumulate everything before starting to decode.
-class _JsonDecoderSink extends _StringSinkConversionSink {
-  final Function(Object key, Object value) _reviver;
-  final Sink<Object> _sink;
+class _JsonDecoderSink extends _StringSinkConversionSink<StringBuffer> {
+  final Object? Function(Object? key, Object? value)? _reviver;
+  final Sink<Object?> _sink;
 
-  _JsonDecoderSink(this._reviver, this._sink) : super(new StringBuffer(''));
+  _JsonDecoderSink(this._reviver, this._sink) : super(StringBuffer(''));
 
   void close() {
     super.close();
-    StringBuffer buffer = _stringSink;
-    String accumulated = buffer.toString();
-    buffer.clear();
-    Object decoded = _parseJson(accumulated, _reviver);
+    String accumulated = _stringSink.toString();
+    _stringSink.clear();
+    Object? decoded = _parseJson(accumulated, _reviver);
     _sink.add(decoded);
     _sink.close();
   }
@@ -397,19 +395,20 @@
   }
 
   @patch
-  static String _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int end) {
+  static String? _convertIntercepted(
+      bool allowMalformed, List<int> codeUnits, int start, int? end) {
     // Test `codeUnits is NativeUint8List`. Dart's NativeUint8List is
     // implemented by JavaScript's Uint8Array.
-    if (JS('bool', '# instanceof Uint8Array', codeUnits)) {
+    if (JS<bool>('bool', '# instanceof Uint8Array', codeUnits)) {
       // JS 'cast' to avoid a downcast equivalent to the is-check we hand-coded.
-      NativeUint8List casted = JS('NativeUint8List', '#', codeUnits);
+      NativeUint8List casted =
+          JS<NativeUint8List>('NativeUint8List', '#', codeUnits);
       // Always use Dart implementation for short strings.
       end ??= casted.length;
       if (end - start < _shortInputThreshold) {
         return null;
       }
-      String result =
+      String? result =
           _convertInterceptedUint8List(allowMalformed, casted, start, end);
       if (result != null && allowMalformed) {
         // In principle, TextDecoder should have provided the correct result
@@ -425,7 +424,7 @@
     return null; // This call was not intercepted.
   }
 
-  static String _convertInterceptedUint8List(
+  static String? _convertInterceptedUint8List(
       bool allowMalformed, NativeUint8List codeUnits, int start, int end) {
     final decoder = allowMalformed ? _decoderNonfatal : _decoder;
     if (decoder == null) return null;
@@ -436,16 +435,18 @@
     int length = codeUnits.length;
     end = RangeError.checkValidRange(start, end, length);
 
-    return _useTextDecoder(decoder,
-        JS('NativeUint8List', '#.subarray(#, #)', codeUnits, start, end));
+    return _useTextDecoder(
+        decoder,
+        JS<NativeUint8List>(
+            'NativeUint8List', '#.subarray(#, #)', codeUnits, start, end));
   }
 
-  static String _useTextDecoder(decoder, NativeUint8List codeUnits) {
+  static String? _useTextDecoder(decoder, NativeUint8List codeUnits) {
     // If the input is malformed, catch the exception and return `null` to fall
     // back on unintercepted decoder. The fallback will either succeed in
     // decoding, or report the problem better than TextDecoder.
     try {
-      return JS('String', '#.decode(#)', decoder, codeUnits);
+      return JS<String>('String', '#.decode(#)', decoder, codeUnits);
     } catch (e) {}
     return null;
   }
@@ -472,12 +473,12 @@
   _Utf8Decoder(this.allowMalformed) : _state = beforeBom;
 
   @patch
-  String convertSingle(List<int> codeUnits, int start, int maybeEnd) {
+  String convertSingle(List<int> codeUnits, int start, int? maybeEnd) {
     return convertGeneral(codeUnits, start, maybeEnd, true);
   }
 
   @patch
-  String convertChunked(List<int> codeUnits, int start, int maybeEnd) {
+  String convertChunked(List<int> codeUnits, int start, int? maybeEnd) {
     return convertGeneral(codeUnits, start, maybeEnd, false);
   }
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index 4a557d4..6ffa92e 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.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.6
-
 // Patch file for dart:core classes.
 import "dart:_internal" hide Symbol, LinkedList, LinkedListEntry;
 import "dart:_internal" as _symbol_dev;
@@ -34,9 +32,10 @@
 
 import 'dart:typed_data' show Endian, Uint8List, Uint16List;
 
-String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
+String _symbolToString(Symbol symbol) =>
+    _symbol_dev.Symbol.getName(symbol as _symbol_dev.Symbol);
 
-Map<String, dynamic> _symbolMapToStringMap(Map<Symbol, dynamic> map) {
+Map<String, dynamic>? _symbolMapToStringMap(Map<Symbol, dynamic>? map) {
   if (map == null) return null;
   var result = new Map<String, dynamic>();
   map.forEach((Symbol key, value) {
@@ -46,13 +45,13 @@
 }
 
 @patch
-int identityHashCode(Object object) => objectHashCode(object);
+int identityHashCode(Object? object) => objectHashCode(object);
 
 // Patch for Object implementation.
 @patch
 class Object {
   @patch
-  bool operator ==(other) => identical(this, other);
+  bool operator ==(Object other) => identical(this, other);
 
   @patch
   int get hashCode => Primitives.objectHashCode(this);
@@ -80,8 +79,8 @@
 @patch
 class Function {
   @patch
-  static apply(Function function, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  static apply(Function function, List<dynamic>? positionalArguments,
+      [Map<Symbol, dynamic>? namedArguments]) {
     return Primitives.applyFunction(
         function,
         positionalArguments,
@@ -103,27 +102,27 @@
   final Object _jsWeakMapOrKey;
 
   @patch
-  Expando([String name])
+  Expando([String? name])
       : this.name = name,
         _jsWeakMapOrKey = JS('bool', 'typeof WeakMap == "function"')
             ? JS('=Object', 'new WeakMap()')
             : _createKey();
 
   @patch
-  T operator [](Object object) {
+  T? operator [](Object object) {
     if (_jsWeakMapOrKey is! String) {
       _checkType(object); // WeakMap doesn't check on reading, only writing.
       return JS('', '#.get(#)', _jsWeakMapOrKey, object);
     }
-    return _getFromObject(_jsWeakMapOrKey, object);
+    return _getFromObject(_jsWeakMapOrKey as String, object) as T?;
   }
 
   @patch
-  void operator []=(Object object, T value) {
+  void operator []=(Object object, T? value) {
     if (_jsWeakMapOrKey is! String) {
       JS('void', '#.set(#, #)', _jsWeakMapOrKey, object, value);
     } else {
-      _setOnObject(_jsWeakMapOrKey, object, value);
+      _setOnObject(_jsWeakMapOrKey as String, object, value);
     }
   }
 
@@ -132,7 +131,7 @@
     return (values == null) ? null : Primitives.getProperty(values, key);
   }
 
-  static void _setOnObject(String key, Object object, Object value) {
+  static void _setOnObject(String key, Object object, Object? value) {
     var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
     if (values == null) {
       values = new Object();
@@ -155,15 +154,15 @@
 class int {
   @patch
   static int parse(String source,
-      {int radix, @deprecated int onError(String source)}) {
-    int value = tryParse(source, radix: radix);
+      {int? radix, @deprecated int onError(String source)?}) {
+    int? value = tryParse(source, radix: radix);
     if (value != null) return value;
     if (onError != null) return onError(source);
     throw new FormatException(source);
   }
 
   @patch
-  static int tryParse(String source, {int radix}) {
+  static int? tryParse(String source, {int? radix}) {
     return Primitives.parseInt(source, radix);
   }
 }
@@ -172,15 +171,15 @@
 class double {
   @patch
   static double parse(String source,
-      [@deprecated double onError(String source)]) {
-    double value = tryParse(source);
+      [@deprecated double onError(String source)?]) {
+    double? value = tryParse(source);
     if (value != null) return value;
     if (onError != null) return onError(source);
     throw new FormatException('Invalid double', source);
   }
 
   @patch
-  static double tryParse(String source) {
+  static double? tryParse(String source) {
     return Primitives.parseDouble(source);
   }
 }
@@ -195,11 +194,11 @@
   static BigInt get two => _BigIntImpl.two;
 
   @patch
-  static BigInt parse(String source, {int radix}) =>
+  static BigInt parse(String source, {int? radix}) =>
       _BigIntImpl.parse(source, radix: radix);
 
   @patch
-  static BigInt tryParse(String source, {int radix}) =>
+  static BigInt? tryParse(String source, {int? radix}) =>
       _BigIntImpl._tryParse(source, radix: radix);
 
   @patch
@@ -221,7 +220,7 @@
   }
 
   @patch
-  StackTrace get stackTrace => Primitives.extractStackTrace(this);
+  StackTrace? get stackTrace => Primitives.extractStackTrace(this);
 }
 
 @patch
@@ -286,7 +285,7 @@
   }
 
   @patch
-  static int _brokenDownDateToValue(int year, int month, int day, int hour,
+  static int? _brokenDownDateToValue(int year, int month, int day, int hour,
       int minute, int second, int millisecond, int microsecond, bool isUtc) {
     return Primitives.valueFromDecomposedDate(
         year,
@@ -362,7 +361,7 @@
   int get weekday => Primitives.getWeekday(this);
 
   @patch
-  bool operator ==(dynamic other) =>
+  bool operator ==(Object other) =>
       other is DateTime &&
       _value == other.millisecondsSinceEpoch &&
       isUtc == other.isUtc;
@@ -386,9 +385,9 @@
 @patch
 class Stopwatch {
   @patch
-  static void _initTicker() {
+  static int _initTicker() {
     Primitives.initTicker();
-    _frequency = Primitives.timerFrequency;
+    return Primitives.timerFrequency;
   }
 
   @patch
@@ -415,11 +414,11 @@
 @patch
 class List<E> {
   @patch
-  factory List([int length]) = JSArray<E>.list;
+  factory List([int? length]) = JSArray<E>.list;
 
   @patch
   factory List.filled(int length, E fill, {bool growable: false}) {
-    List result = growable
+    var result = growable
         ? new JSArray<E>.growable(length)
         : new JSArray<E>.fixed(length);
     if (length != 0 && fill != null) {
@@ -434,6 +433,11 @@
   }
 
   @patch
+  factory List.empty({bool growable: false}) {
+    return growable ? new JSArray<E>.growable(0) : new JSArray<E>.fixed(0);
+  }
+
+  @patch
   factory List.from(Iterable elements, {bool growable: true}) {
     List<E> list = <E>[];
     for (E e in elements) {
@@ -450,8 +454,20 @@
   }
 
   @patch
+  factory List.generate(int length, E generator(int index),
+      {bool growable = true}) {
+    final result = growable
+        ? new JSArray<E>.growable(length)
+        : new JSArray<E>.fixed(length);
+    for (int i = 0; i < length; i++) {
+      result[i] = generator(i);
+    }
+    return result;
+  }
+
+  @patch
   factory List.unmodifiable(Iterable elements) {
-    List result = new List<E>.from(elements, growable: false);
+    var result = List<E>.from(elements, growable: false);
     return makeFixedListUnmodifiable(result);
   }
 }
@@ -469,9 +485,12 @@
 class String {
   @patch
   factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int end]) {
+      [int start = 0, int? end]) {
     if (charCodes is JSArray) {
-      JSArray<int> array = charCodes;
+      // Type promotion doesn't work unless the check is `is JSArray<int>`,
+      // which is more expensive.
+      // TODO(41383): Optimize `is JSArray<int>` rather than do weird 'casts'.
+      JSArray array = JS('JSArray', '#', charCodes);
       return _stringFromJSArray(array, start, end);
     }
     if (charCodes is NativeUint8List) {
@@ -485,24 +504,24 @@
     return Primitives.stringFromCharCode(charCode);
   }
 
-  static String _stringFromJSArray(List list, int start, int endOrNull) {
+  static String _stringFromJSArray(JSArray list, int start, int? endOrNull) {
     int len = list.length;
     int end = RangeError.checkValidRange(start, endOrNull, len);
     if (start > 0 || end < len) {
-      list = list.sublist(start, end);
+      list = JS('JSArray', '#.slice(#, #)', list, start, end);
     }
     return Primitives.stringFromCharCodes(list);
   }
 
   static String _stringFromUint8List(
-      NativeUint8List charCodes, int start, int endOrNull) {
+      NativeUint8List charCodes, int start, int? endOrNull) {
     int len = charCodes.length;
     int end = RangeError.checkValidRange(start, endOrNull, len);
     return Primitives.stringFromNativeUint8List(charCodes, start, end);
   }
 
   static String _stringFromIterable(
-      Iterable<int> charCodes, int start, int end) {
+      Iterable<int> charCodes, int start, int? end) {
     if (start < 0) throw new RangeError.range(start, 0, charCodes.length);
     if (end != null && end < start) {
       throw new RangeError.range(end, start, charCodes.length);
@@ -557,7 +576,7 @@
 @pragma(
     'dart2js:noInline') // No inlining since we recognize the call in optimizer.
 @patch
-bool identical(Object a, Object b) {
+bool identical(Object? a, Object? b) {
   return JS('bool', '(# == null ? # == null : # === #)', a, b, a, b);
 }
 
@@ -572,7 +591,7 @@
   int get length => _contents.length;
 
   @patch
-  void write(Object obj) {
+  void write(Object? obj) {
     _writeString('$obj');
   }
 
@@ -582,12 +601,12 @@
   }
 
   @patch
-  void writeAll(Iterable objects, [String separator = ""]) {
+  void writeAll(Iterable<dynamic> objects, [String separator = ""]) {
     _contents = _writeAll(_contents, objects, separator);
   }
 
   @patch
-  void writeln([Object obj = ""]) {
+  void writeln([Object? obj = ""]) {
     _writeString('$obj\n');
   }
 
@@ -599,7 +618,7 @@
   @patch
   String toString() => Primitives.flattenString(_contents);
 
-  void _writeString(str) {
+  void _writeString(String str) {
     _contents = Primitives.stringConcatUnchecked(_contents, str);
   }
 
@@ -620,28 +639,28 @@
     return string;
   }
 
-  static String _writeOne(String string, Object obj) {
+  static String _writeOne(String string, Object? obj) {
     return Primitives.stringConcatUnchecked(string, '$obj');
   }
 }
 
 @patch
 class NoSuchMethodError {
-  final Object _receiver;
+  final Object? _receiver;
   final Symbol _memberName;
-  final List _arguments;
-  final Map<Symbol, dynamic> _namedArguments;
-  final List _existingArgumentNames;
+  final List? _arguments;
+  final Map<Symbol, dynamic>? _namedArguments;
+  final List? _existingArgumentNames;
 
   @patch
-  NoSuchMethodError.withInvocation(Object receiver, Invocation invocation)
+  NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation)
       : this(receiver, invocation.memberName, invocation.positionalArguments,
             invocation.namedArguments);
 
   @patch
-  NoSuchMethodError(Object receiver, Symbol memberName,
-      List positionalArguments, Map<Symbol, dynamic> namedArguments,
-      [List existingArgumentNames = null])
+  NoSuchMethodError(Object? receiver, Symbol memberName,
+      List? positionalArguments, Map<Symbol, dynamic>? namedArguments,
+      [List? existingArgumentNames = null])
       : _receiver = receiver,
         _memberName = memberName,
         _arguments = positionalArguments,
@@ -650,17 +669,19 @@
 
   @patch
   String toString() {
-    StringBuffer sb = new StringBuffer('');
+    StringBuffer sb = StringBuffer('');
     String comma = '';
-    if (_arguments != null) {
-      for (var argument in _arguments) {
+    var arguments = _arguments;
+    if (arguments != null) {
+      for (var argument in arguments) {
         sb.write(comma);
         sb.write(Error.safeToString(argument));
         comma = ', ';
       }
     }
-    if (_namedArguments != null) {
-      _namedArguments.forEach((Symbol key, var value) {
+    var namedArguments = _namedArguments;
+    if (namedArguments != null) {
+      namedArguments.forEach((Symbol key, var value) {
         sb.write(comma);
         sb.write(_symbolToString(key));
         sb.write(": ");
@@ -671,12 +692,13 @@
     String memberName = _symbolToString(_memberName);
     String receiverText = Error.safeToString(_receiver);
     String actualParameters = '$sb';
-    if (_existingArgumentNames == null) {
+    var existingArgumentNames = _existingArgumentNames;
+    if (existingArgumentNames == null) {
       return "NoSuchMethodError: method not found: '$memberName'\n"
           "Receiver: ${receiverText}\n"
           "Arguments: [$actualParameters]";
     } else {
-      String formalParameters = _existingArgumentNames.join(', ');
+      String formalParameters = existingArgumentNames.join(', ');
       return "NoSuchMethodError: incorrect number of arguments passed to "
           "method named '$memberName'\n"
           "Receiver: ${receiverText}\n"
@@ -697,7 +719,7 @@
 class Uri {
   @patch
   static Uri get base {
-    String uri = Primitives.currentUri();
+    String? uri = Primitives.currentUri();
     if (uri != null) return Uri.parse(uri);
     throw new UnsupportedError("'Uri.base' is not supported");
   }
@@ -924,14 +946,14 @@
 
   // Result cache for last _divRem call.
   // Result cache for last _divRem call.
-  static Uint16List _lastDividendDigits;
-  static int _lastDividendUsed;
-  static Uint16List _lastDivisorDigits;
-  static int _lastDivisorUsed;
-  static Uint16List _lastQuoRemDigits;
-  static int _lastQuoRemUsed;
-  static int _lastRemUsed;
-  static int _lastRem_nsh;
+  static Uint16List? _lastDividendDigits;
+  static int? _lastDividendUsed;
+  static Uint16List? _lastDivisorDigits;
+  static int? _lastDivisorUsed;
+  static late Uint16List _lastQuoRemDigits;
+  static late int _lastQuoRemUsed;
+  static late int _lastRemUsed;
+  static late int _lastRem_nsh;
 
   /// Whether this bigint is negative.
   final bool _isNegative;
@@ -970,7 +992,7 @@
   ///
   /// Throws a [FormatException] if the [source] is not a valid integer literal,
   /// optionally prefixed by a sign.
-  static _BigIntImpl parse(String source, {int radix}) {
+  static _BigIntImpl parse(String source, {int? radix}) {
     var result = _tryParse(source, radix: radix);
     if (result == null) {
       throw new FormatException("Could not parse BigInt", source);
@@ -989,7 +1011,7 @@
     // Read in the source 4 digits at a time.
     // The first part may have a few leading virtual '0's to make the remaining
     // parts all have exactly 4 digits.
-    int digitInPartCount = 4 - source.length.remainder(4);
+    var digitInPartCount = 4 - source.length.remainder(4);
     if (digitInPartCount == 4) digitInPartCount = 0;
     for (int i = 0; i < source.length; i++) {
       part = part * 10 + source.codeUnitAt(i) - _0;
@@ -1031,7 +1053,7 @@
   /// If [isNegative] is true, negates the result before returning it.
   ///
   /// The [source] (substring) must be a valid hex literal.
-  static _BigIntImpl _parseHex(String source, int startPos, bool isNegative) {
+  static _BigIntImpl? _parseHex(String source, int startPos, bool isNegative) {
     int hexDigitsPerChunk = _digitBits ~/ 4;
     int sourceLength = source.length - startPos;
     int chunkCount = (sourceLength / hexDigitsPerChunk).ceil();
@@ -1065,7 +1087,7 @@
   ///
   /// The [source] will be checked for invalid characters. If it is invalid,
   /// this function returns `null`.
-  static _BigIntImpl _parseRadix(String source, int radix, bool isNegative) {
+  static _BigIntImpl? _parseRadix(String source, int radix, bool isNegative) {
     var result = zero;
     var base = new _BigIntImpl._fromInt(radix);
     for (int i = 0; i < source.length; i++) {
@@ -1082,7 +1104,7 @@
   /// Returns the parsed big integer, or `null` if it failed.
   ///
   /// If the [radix] is `null` accepts decimal literals or `0x` hex literals.
-  static _BigIntImpl _tryParse(String source, {int radix}) {
+  static _BigIntImpl? _tryParse(String source, {int? radix}) {
     if (source == "") return null;
 
     var match = _parseRE.firstMatch(source);
@@ -1094,9 +1116,9 @@
 
     bool isNegative = match[signIndex] == "-";
 
-    String decimalMatch = match[decimalIndex];
-    String hexMatch = match[hexIndex];
-    String nonDecimalMatch = match[nonDecimalHexIndex];
+    String? decimalMatch = match[decimalIndex];
+    String? hexMatch = match[hexIndex];
+    String? nonDecimalMatch = match[nonDecimalHexIndex];
 
     if (radix == null) {
       if (decimalMatch != null) {
@@ -1120,11 +1142,11 @@
       return _parseDecimal(decimalMatch, isNegative);
     }
     if (radix == 16 && (decimalMatch != null || nonDecimalMatch != null)) {
-      return _parseHex(decimalMatch ?? nonDecimalMatch, 0, isNegative);
+      return _parseHex(decimalMatch ?? nonDecimalMatch!, 0, isNegative);
     }
 
     return _parseRadix(
-        decimalMatch ?? nonDecimalMatch ?? hexMatch, radix, isNegative);
+        decimalMatch ?? nonDecimalMatch ?? hexMatch!, radix, isNegative);
   }
 
   static RegExp _parseRE = RegExp(
@@ -1173,7 +1195,7 @@
     if (value.abs() < 0x100000000)
       return new _BigIntImpl._fromInt(value.toInt());
     if (value is double) return new _BigIntImpl._fromDouble(value);
-    return new _BigIntImpl._fromInt(value);
+    return new _BigIntImpl._fromInt(value as int);
   }
 
   factory _BigIntImpl._fromInt(int value) {
diff --git a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
index 77b5c1a..aff3f55 100644
--- a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/developer_patch.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.6
-
 // Patch file for dart:developer library.
 
 import 'dart:_js_helper' show patch, ForceInline;
@@ -13,7 +11,7 @@
 
 @patch
 @pragma('dart2js:tryInline')
-bool debugger({bool when: true, String message}) {
+bool debugger({bool when = true, String? message}) {
   if (when) {
     JS('', 'debugger');
   }
@@ -21,26 +19,26 @@
 }
 
 @patch
-Object inspect(Object object) {
+Object? inspect(Object? object) {
   return object;
 }
 
 @patch
 void log(String message,
-    {DateTime time,
-    int sequenceNumber,
-    int level: 0,
-    String name: '',
-    Zone zone,
-    Object error,
-    StackTrace stackTrace}) {
+    {DateTime? time,
+    int? sequenceNumber,
+    int level = 0,
+    String name = '',
+    Zone? zone,
+    Object? error,
+    StackTrace? stackTrace}) {
   // TODO.
 }
 
-final _extensions = new Map<String, ServiceExtensionHandler>();
+final _extensions = <String, ServiceExtensionHandler>{};
 
 @patch
-ServiceExtensionHandler _lookupExtension(String method) {
+ServiceExtensionHandler? _lookupExtension(String method) {
   return _extensions[method];
 }
 
@@ -110,7 +108,7 @@
 }
 
 @patch
-String _getIsolateIDFromSendPort(SendPort sendPort) {
+String? _getIsolateIDFromSendPort(SendPort sendPort) {
   return null;
 }
 
@@ -124,7 +122,7 @@
 }
 
 class _FakeUserTag implements UserTag {
-  static Map _instances = {};
+  static final _instances = <String, _FakeUserTag>{};
 
   _FakeUserTag.real(this.label);
 
@@ -136,13 +134,10 @@
     }
     // Throw an exception if we've reached the maximum number of user tags.
     if (_instances.length == UserTag.MAX_USER_TAGS) {
-      throw new UnsupportedError(
+      throw UnsupportedError(
           'UserTag instance limit (${UserTag.MAX_USER_TAGS}) reached.');
     }
-    // Create a new instance and add it to the instance map.
-    var instance = new _FakeUserTag.real(label);
-    _instances[label] = instance;
-    return instance;
+    return _instances[label] = _FakeUserTag.real(label);
   }
 
   final String label;
diff --git a/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart b/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart
index 26bcf37..88ca3d2 100644
--- a/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/foreign_helper.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.6
-
 library _foreign_helper;
 
 import 'dart:_js_embedded_names' show JsGetName, JsBuiltin;
diff --git a/sdk/lib/_internal/js_runtime/lib/instantiation.dart b/sdk/lib/_internal/js_runtime/lib/instantiation.dart
index 666cd69..da3fcbd 100644
--- a/sdk/lib/_internal/js_runtime/lib/instantiation.dart
+++ b/sdk/lib/_internal/js_runtime/lib/instantiation.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.6
-
 part of _js_helper;
 
 /// Support class for generic function type instantiation (binding of types).
@@ -20,11 +18,7 @@
     if (JS('bool', 'false')) {
       // [instantiatedGenericFunctionType] is called from injected $signature
       // methods with runtime type representations.
-      if (JS_GET_FLAG('USE_NEW_RTI')) {
-        newRti.instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
-      } else {
-        instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
-      }
+      newRti.instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
     }
   }
 
diff --git a/sdk/lib/_internal/js_runtime/lib/interceptors.dart b/sdk/lib/_internal/js_runtime/lib/interceptors.dart
index e0aa397..fc97282 100644
--- a/sdk/lib/_internal/js_runtime/lib/interceptors.dart
+++ b/sdk/lib/_internal/js_runtime/lib/interceptors.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.6
-
 library _interceptors;
 
 import 'dart:_js_embedded_names'
@@ -63,17 +61,6 @@
 final String DART_CLOSURE_PROPERTY_NAME =
     getIsolateAffinityTag(r'_$dart_dartClosure');
 
-String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
-
-_symbolMapToStringMap(Map<Symbol, dynamic> map) {
-  if (map == null) return null;
-  var result = new Map<String, dynamic>();
-  map.forEach((Symbol key, value) {
-    result[_symbolToString(key)] = value;
-  });
-  return result;
-}
-
 getDispatchProperty(object) {
   return JS(
       '', '#[#]', object, JS_EMBEDDED_GLOBAL('String', DISPATCH_PROPERTY_NAME));
@@ -123,7 +110,7 @@
 dispatchRecordInterceptor(record) => JS('', '#.i', record);
 dispatchRecordProto(record) => JS('', '#.p', record);
 dispatchRecordExtension(record) => JS('', '#.e', record);
-dispatchRecordIndexability(record) => JS('bool|Null', '#.x', record);
+bool? dispatchRecordIndexability(record) => JS('bool|Null', '#.x', record);
 
 /// Returns the interceptor for a native class instance. Used by
 /// [getInterceptor].
@@ -197,7 +184,10 @@
 }
 
 // A JS String or Symbol.
-final JS_INTEROP_INTERCEPTOR_TAG = getIsolateAffinityTag(r'_$dart_js');
+dynamic _JS_INTEROP_INTERCEPTOR_TAG = null;
+get JS_INTEROP_INTERCEPTOR_TAG {
+  return _JS_INTEROP_INTERCEPTOR_TAG ??= getIsolateAffinityTag(r'_$dart_js');
+}
 
 lookupInterceptorByConstructor(constructor) {
   return constructor == null
@@ -236,7 +226,7 @@
   return JS_EMBEDDED_GLOBAL('', TYPE_TO_INTERCEPTOR_MAP);
 }
 
-int findIndexForNativeSubclassType(Type type) {
+int? findIndexForNativeSubclassType(Type? type) {
   if (JS('bool', '# == null', typeToInterceptorMap)) return null;
   List map = JS('JSFixedArray', '#', typeToInterceptorMap);
   for (int i = 0; i + 1 < map.length; i += 3) {
@@ -247,7 +237,7 @@
   return null;
 }
 
-findInterceptorConstructorForType(Type type) {
+findInterceptorConstructorForType(Type? type) {
   var index = findIndexForNativeSubclassType(type);
   if (index == null) return null;
   List map = JS('JSFixedArray', '#', typeToInterceptorMap);
@@ -258,7 +248,7 @@
 /// `null` if there is no such constructor.
 ///
 /// The returned function takes one argument, the web component object.
-findConstructorForNativeSubclassType(Type type, String name) {
+findConstructorForNativeSubclassType(Type? type, String name) {
   var index = findIndexForNativeSubclassType(type);
   if (index == null) return null;
   List map = JS('JSFixedArray', '#', typeToInterceptorMap);
@@ -267,7 +257,7 @@
   return constructorFn;
 }
 
-findInterceptorForType(Type type) {
+findInterceptorForType(Type? type) {
   var constructor = findInterceptorConstructorForType(type);
   if (constructor == null) return null;
   return JS('', '#.prototype', constructor);
diff --git a/sdk/lib/_internal/js_runtime/lib/internal_patch.dart b/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
index 7e3b456..e2922ca 100644
--- a/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
@@ -2,23 +2,28 @@
 // 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.6
-
 import 'dart:core' hide Symbol;
-import 'dart:core' as core;
+import 'dart:core' as core show Symbol;
 import 'dart:_js_primitives' show printString;
-import 'dart:_js_helper' show patch, NoInline;
+import 'dart:_js_helper' show patch;
 import 'dart:_interceptors' show JSArray;
 import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
 
 @patch
+@pragma('dart2js:tryInline')
+bool typeAcceptsNull<T>() {
+  bool isLegacySubtyping = JS_GET_FLAG('LEGACY');
+  return isLegacySubtyping || null is T;
+}
+
+@patch
 class Symbol implements core.Symbol {
   @patch
   const Symbol(String name) : this._name = name;
 
   @patch
   int get hashCode {
-    int hash = JS('int|Null', '#._hashCode', this);
+    int? hash = JS('int|Null', '#._hashCode', this);
     if (hash != null) return hash;
     const arbitraryPrime = 664597;
     hash = 0x1fffffff & (arbitraryPrime * _name.hashCode);
diff --git a/sdk/lib/_internal/js_runtime/lib/io_patch.dart b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
index 1333318..77a2530 100644
--- a/sdk/lib/_internal/js_runtime/lib/io_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/io_patch.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.6
-
 import 'dart:_js_helper' show patch;
 import 'dart:_internal' hide Symbol;
 import 'dart:async';
@@ -75,7 +73,7 @@
 @patch
 class _EventHandler {
   @patch
-  static void _sendData(Object sender, SendPort sendPort, int data) {
+  static void _sendData(Object? sender, SendPort sendPort, int data) {
     throw new UnsupportedError("EventHandler._sendData");
   }
 }
@@ -305,7 +303,7 @@
 @patch
 class _ProcessUtils {
   @patch
-  static void _exit(int status) {
+  static Never _exit(int status) {
     throw new UnsupportedError("ProcessUtils._exit");
   }
 
@@ -325,7 +323,7 @@
   }
 
   @patch
-  static int _pid(Process process) {
+  static int _pid(Process? process) {
     throw new UnsupportedError("ProcessUtils._pid");
   }
 
@@ -352,8 +350,8 @@
 class Process {
   @patch
   static Future<Process> start(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
       ProcessStartMode mode: ProcessStartMode.normal}) {
@@ -362,8 +360,8 @@
 
   @patch
   static Future<ProcessResult> run(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
       Encoding stdoutEncoding: systemEncoding,
@@ -373,8 +371,8 @@
 
   @patch
   static ProcessResult runSync(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
       Encoding stdoutEncoding: systemEncoding,
@@ -411,13 +409,13 @@
   }
 
   @patch
-  factory InternetAddress(String address, {InternetAddressType type}) {
+  factory InternetAddress(String address, {InternetAddressType? type}) {
     throw new UnsupportedError("InternetAddress");
   }
 
   @patch
   factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType type}) {
+      {InternetAddressType? type}) {
     throw new UnsupportedError("InternetAddress.fromRawAddress");
   }
 
@@ -434,8 +432,8 @@
   }
 
   @patch
-  static InternetAddress tryParse(String address) {
-    throw new UnsupportedError("InternetAddress.tryParse");
+  static InternetAddress? tryParse(String address) {
+    throw UnsupportedError("InternetAddress.tryParse");
   }
 }
 
@@ -476,14 +474,14 @@
 @patch
 class RawSocket {
   @patch
-  static Future<RawSocket> connect(host, int port,
-      {sourceAddress, Duration timeout}) {
+  static Future<RawSocket> connect(dynamic host, int port,
+      {dynamic sourceAddress, Duration? timeout}) {
     throw new UnsupportedError("RawSocket constructor");
   }
 
   @patch
-  static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
-      {sourceAddress}) {
+  static Future<ConnectionTask<RawSocket>> startConnect(dynamic host, int port,
+      {dynamic sourceAddress}) {
     throw new UnsupportedError("RawSocket constructor");
   }
 }
@@ -491,14 +489,14 @@
 @patch
 class Socket {
   @patch
-  static Future<Socket> _connect(host, int port,
-      {sourceAddress, Duration timeout}) {
+  static Future<Socket> _connect(dynamic host, int port,
+      {dynamic sourceAddress, Duration? timeout}) {
     throw new UnsupportedError("Socket constructor");
   }
 
   @patch
-  static Future<ConnectionTask<Socket>> _startConnect(host, int port,
-      {sourceAddress}) {
+  static Future<ConnectionTask<Socket>> _startConnect(dynamic host, int port,
+      {dynamic sourceAddress}) {
     throw new UnsupportedError("Socket constructor");
   }
 }
@@ -514,7 +512,7 @@
 @patch
 class RawSynchronousSocket {
   @patch
-  static RawSynchronousSocket connectSync(host, int port) {
+  static RawSynchronousSocket connectSync(dynamic host, int port) {
     throw new UnsupportedError("RawSynchronousSocket.connectSync");
   }
 }
@@ -556,7 +554,7 @@
 @patch
 class RawDatagramSocket {
   @patch
-  static Future<RawDatagramSocket> bind(host, int port,
+  static Future<RawDatagramSocket> bind(dynamic host, int port,
       {bool reuseAddress: true, bool reusePort: false, int ttl: 1}) {
     throw new UnsupportedError("RawDatagramSocket.bind");
   }
@@ -618,14 +616,14 @@
       int windowBits,
       int memLevel,
       int strategy,
-      List<int> dictionary,
+      List<int>? dictionary,
       bool raw) {
     throw new UnsupportedError("_newZLibDeflateFilter");
   }
 
   @patch
   static RawZLibFilter _makeZLibInflateFilter(
-      int windowBits, List<int> dictionary, bool raw) {
+      int windowBits, List<int>? dictionary, bool raw) {
     throw new UnsupportedError("_newZLibInflateFilter");
   }
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
index bb6363f..4c7f5c5 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 // Patch file for the dart:isolate library.
 
 import "dart:async";
 import 'dart:_foreign_helper' show JS;
 import 'dart:_js_helper' show patch;
-import "dart:typed_data" show ByteData, TypedData, Uint8List;
+import "dart:typed_data" show TypedData;
 
 @patch
 class Isolate {
@@ -19,45 +17,46 @@
   }
 
   @patch
-  String get debugName {
+  String? get debugName {
     throw new UnsupportedError("Isolate.debugName");
   }
 
   @patch
-  static Future<Uri> get packageRoot {
+  static Future<Uri?> get packageRoot {
     throw new UnsupportedError("Isolate.packageRoot");
   }
 
   @patch
-  static Future<Uri> get packageConfig {
+  static Future<Uri?> get packageConfig {
     throw new UnsupportedError("Isolate.packageConfig");
   }
 
   @patch
-  static Future<Uri> resolvePackageUri(Uri packageUri) {
+  static Future<Uri?> resolvePackageUri(Uri packageUri) {
     throw new UnsupportedError("Isolate.resolvePackageUri");
   }
 
   @patch
   static Future<Isolate> spawn<T>(void entryPoint(T message), T message,
-      {bool paused: false,
-      bool errorsAreFatal,
-      SendPort onExit,
-      SendPort onError}) {
+      {bool paused = false,
+      bool errorsAreFatal = true,
+      SendPort? onExit,
+      SendPort? onError}) {
     throw new UnsupportedError("Isolate.spawn");
   }
 
   @patch
   static Future<Isolate> spawnUri(Uri uri, List<String> args, var message,
-      {bool paused: false,
-      SendPort onExit,
-      SendPort onError,
-      bool errorsAreFatal,
-      bool checked,
-      Map<String, String> environment,
-      Uri packageRoot,
-      Uri packageConfig,
-      bool automaticPackageResolution: false}) {
+      {bool paused = false,
+      SendPort? onExit,
+      SendPort? onError,
+      bool errorsAreFatal = true,
+      bool? checked,
+      Map<String, String>? environment,
+      Uri? packageRoot,
+      Uri? packageConfig,
+      bool automaticPackageResolution = false,
+      String? debugName}) {
     throw new UnsupportedError("Isolate.spawnUri");
   }
 
@@ -72,7 +71,7 @@
   }
 
   @patch
-  void addOnExitListener(SendPort responsePort, {Object response}) {
+  void addOnExitListener(SendPort responsePort, {Object? response}) {
     throw new UnsupportedError("Isolate.addOnExitListener");
   }
 
@@ -87,12 +86,13 @@
   }
 
   @patch
-  void kill({int priority: beforeNextEvent}) {
+  void kill({int priority = beforeNextEvent}) {
     throw new UnsupportedError("Isolate.kill");
   }
 
   @patch
-  void ping(SendPort responsePort, {Object response, int priority: immediate}) {
+  void ping(SendPort responsePort,
+      {Object? response, int priority = immediate}) {
     throw new UnsupportedError("Isolate.ping");
   }
 
@@ -119,8 +119,10 @@
 }
 
 class _ReceivePortImpl extends Stream implements ReceivePort {
-  StreamSubscription listen(void onData(var event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription listen(void Function(dynamic)? onData,
+      {Function? onError,
+      void Function()? onDone,
+      bool? cancelOnError = true}) {
     throw new UnsupportedError("ReceivePort.listen");
   }
 
@@ -132,7 +134,7 @@
 @patch
 class RawReceivePort {
   @patch
-  factory RawReceivePort([Function handler]) {
+  factory RawReceivePort([Function? handler]) {
     throw new UnsupportedError('new RawReceivePort');
   }
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/js_array.dart b/sdk/lib/_internal/js_runtime/lib/js_array.dart
index 7b92c3d..d131658 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_array.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.6
-
 part of _interceptors;
 
 class _Growable {
@@ -16,7 +14,7 @@
 /// class as an interceptor, and changes references to [:this:] to
 /// actually use the receiver of the method, which is generated as an extra
 /// argument added to each member.
-class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
+class JSArray<E> extends Interceptor implements List<E>, JSIndexable<E> {
   const JSArray();
 
   // This factory constructor is the redirection target of the List() factory
@@ -82,7 +80,7 @@
   factory JSArray.markGrowable(allocation) =>
       JS('JSExtendableArray', '#', new JSArray<E>.typed(allocation));
 
-  static List markFixedList(List list) {
+  static List<T> markFixedList<T>(List<T> list) {
     // Functions are stored in the hidden class and not as properties in
     // the object. We never actually look at the value, but only want
     // to know if the property exists.
@@ -90,7 +88,7 @@
     return JS('JSFixedArray', '#', list);
   }
 
-  static List markUnmodifiableList(List list) {
+  static List<T> markUnmodifiableList<T>(List list) {
     // Functions are stored in the hidden class and not as properties in
     // the object. We never actually look at the value, but only want
     // to know if the property exists.
@@ -178,7 +176,7 @@
     return JS('', r'#.pop()', this);
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     checkGrowable('remove');
     for (int i = 0; i < this.length; i++) {
       if (this[i] == element) {
@@ -266,7 +264,7 @@
   }
 
   String join([String separator = '']) {
-    var list = new List(this.length);
+    var list = List.filled(this.length, "");
     for (int i = 0; i < this.length; i++) {
       list[i] = '${this[i]}';
     }
@@ -316,7 +314,7 @@
     return value;
   }
 
-  E firstWhere(bool test(E value), {E orElse()}) {
+  E firstWhere(bool Function(E) test, {E Function()? orElse}) {
     var end = this.length;
     for (int i = 0; i < end; ++i) {
       // TODO(22407): Improve bounds check elimination to allow this JS code to
@@ -329,7 +327,7 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E element), {E orElse()}) {
+  E lastWhere(bool Function(E) test, {E Function()? orElse}) {
     int length = this.length;
     for (int i = length - 1; i >= 0; i--) {
       // TODO(22407): Improve bounds check elimination to allow this JS code to
@@ -344,9 +342,9 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E element), {E orElse()}) {
+  E singleWhere(bool Function(E) test, {E Function()? orElse}) {
     int length = this.length;
-    E match = null;
+    E? match = null;
     bool matchFound = false;
     for (int i = 0; i < length; i++) {
       // TODO(22407): Improve bounds check elimination to allow this JS code to
@@ -363,7 +361,7 @@
         throw new ConcurrentModificationError(this);
       }
     }
-    if (matchFound) return match;
+    if (matchFound) return match as E;
     if (orElse != null) return orElse();
     throw IterableElementError.noElement();
   }
@@ -372,7 +370,7 @@
     return this[index];
   }
 
-  List<E> sublist(int start, [int end]) {
+  List<E> sublist(int start, [int? end]) {
     checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
     if (start is! int) throw argumentErrorValue(start);
     if (start < 0 || start > length) {
@@ -431,7 +429,7 @@
     int otherStart;
     // TODO(floitsch): Make this accept more.
     if (iterable is List) {
-      otherList = iterable;
+      otherList = JS<List<E>>('', '#', iterable);
       otherStart = skipCount;
     } else {
       otherList = iterable.skip(skipCount).toList(growable: false);
@@ -459,12 +457,14 @@
     }
   }
 
-  void fillRange(int start, int end, [E fillValue]) {
+  void fillRange(int start, int end, [E? fillValue]) {
     checkMutable('fill range');
     RangeError.checkValidRange(start, end, this.length);
+    E checkedFillValue = fillValue as E;
     for (int i = start; i < end; i++) {
-      // Store is safe since [fillValue] type has been checked as parameter.
-      JS('', '#[#] = #', this, i, fillValue);
+      // Store is safe since [checkedFillValue] type has been checked as
+      // parameter and for null.
+      JS('', '#[#] = #', this, i, checkedFillValue);
     }
   }
 
@@ -521,18 +521,16 @@
 
   Iterable<E> get reversed => new ReversedListIterable<E>(this);
 
-  void sort([int compare(E a, E b)]) {
+  void sort([int Function(E, E)? compare]) {
     checkMutable('sort');
     Sort.sort(this, compare ?? _compareAny);
   }
 
   static int _compareAny(a, b) {
-    // In strong mode Comparable.compare requires an implicit cast to ensure
-    // `a` and `b` are Comparable.
     return Comparable.compare(a, b);
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     checkMutable('shuffle');
     if (random == null) random = new Random();
     int length = this.length;
@@ -545,14 +543,15 @@
     }
   }
 
-  int indexOf(Object element, [int start = 0]) {
-    if (start >= this.length) {
+  int indexOf(Object? element, [int start = 0]) {
+    int length = this.length;
+    if (start >= length) {
       return -1;
     }
     if (start < 0) {
       start = 0;
     }
-    for (int i = start; i < this.length; i++) {
+    for (int i = start; i < length; i++) {
       if (this[i] == element) {
         return i;
       }
@@ -560,18 +559,15 @@
     return -1;
   }
 
-  int lastIndexOf(Object element, [int startIndex]) {
-    if (startIndex == null) {
-      startIndex = this.length - 1;
-    } else {
-      if (startIndex < 0) {
-        return -1;
-      }
-      if (startIndex >= this.length) {
-        startIndex = this.length - 1;
-      }
+  int lastIndexOf(Object? element, [int? startIndex]) {
+    int start = startIndex ?? this.length - 1;
+    if (start < 0) {
+      return -1;
     }
-    for (int i = startIndex; i >= 0; i--) {
+    if (start >= this.length) {
+      start = this.length - 1;
+    }
+    for (int i = start; i >= 0; i--) {
       if (this[i] == element) {
         return i;
       }
@@ -579,9 +575,10 @@
     return -1;
   }
 
-  bool contains(Object other) {
+  bool contains(Object? other) {
     for (int i = 0; i < length; i++) {
-      if (this[i] == other) return true;
+      E element = JS('', '#[#]', this, i);
+      if (element == other) return true;
     }
     return false;
   }
@@ -646,13 +643,7 @@
 
   Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
 
-  List<E> operator +(List<E> other) {
-    int totalLength = this.length + other.length;
-    return <E>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
+  List<E> operator +(List<E> other) => [...this, ...other];
 
   int indexWhere(bool test(E element), [int start = 0]) {
     if (start >= this.length) return -1;
@@ -663,7 +654,7 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(E element), [int start]) {
+  int lastIndexWhere(bool test(E element), [int? start]) {
     if (start == null) start = this.length - 1;
     if (start < 0) return -1;
     for (int i = start; i >= 0; i--) {
@@ -692,7 +683,7 @@
 /// 'isGrowable' and 'isMutable' checks into the getInterceptor implementation
 /// so these classes can have specialized implementations. Doing so will
 /// challenge many assumptions in the JS backend.
-class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {}
+class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable<E> {}
 
 class JSFixedArray<E> extends JSMutableArray<E> {}
 
@@ -706,14 +697,14 @@
   final JSArray<E> _iterable;
   final int _length;
   int _index;
-  E _current;
+  E? _current;
 
   ArrayIterator(JSArray<E> iterable)
       : _iterable = iterable,
         _length = iterable.length,
         _index = 0;
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     int length = _iterable.length;
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 7e06347..db4ef1be 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.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.6
-
 library _js_helper;
 
 import 'dart:_js_embedded_names'
@@ -69,7 +67,8 @@
         getRuntimeType,
         getTypeFromTypesTable,
         instanceTypeName,
-        instantiatedGenericFunctionType;
+        instantiatedGenericFunctionType,
+        throwTypeError;
 
 part 'annotations.dart';
 part 'constant_map.dart';
@@ -131,8 +130,8 @@
 /// Given a raw constructor name, return the unminified name, if available,
 /// otherwise tag the name with `minified:`.
 String unminifyOrTag(String rawClassName) {
-  String preserved = unmangleGlobalNameIfPreservedAnyways(rawClassName);
-  if (preserved is String) return preserved;
+  String? preserved = unmangleGlobalNameIfPreservedAnyways(rawClassName);
+  if (preserved != null) return preserved;
   if (JS_GET_FLAG('MINIFIED')) return 'minified:${rawClassName}';
   return rawClassName;
 }
@@ -360,14 +359,8 @@
     if (_typeArgumentCount == 0) return const <Type>[];
     int start = _arguments.length - _typeArgumentCount;
     var list = <Type>[];
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      for (int index = 0; index < _typeArgumentCount; index++) {
-        list.add(newRti.createRuntimeType(_arguments[start + index]));
-      }
-    } else {
-      for (int index = 0; index < _typeArgumentCount; index++) {
-        list.add(createRuntimeType(_arguments[start + index]));
-      }
+    for (int index = 0; index < _typeArgumentCount; index++) {
+      list.add(newRti.createRuntimeType(_arguments[start + index]));
     }
     return JSArray.markUnmodifiableList(list);
   }
@@ -401,7 +394,7 @@
 
 class Primitives {
   static int objectHashCode(object) {
-    int hash = JS('int|Null', r'#.$identityHash', object);
+    int? hash = JS('int|Null', r'#.$identityHash', object);
     if (hash == null) {
       hash = JS('int', '(Math.random() * 0x3fffffff) | 0');
       JS('void', r'#.$identityHash = #', object, hash);
@@ -409,7 +402,7 @@
     return JS('int', '#', hash);
   }
 
-  static int parseInt(String source, int radix) {
+  static int? parseInt(String source, int? radix) {
     checkString(source);
     var re = JS('', r'/^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i');
     var match = JS('JSExtendableArray|Null', '#.exec(#)', re, source);
@@ -422,7 +415,7 @@
       // again.
       return null;
     }
-    String decimalMatch = match[decimalIndex];
+    Object? decimalMatch = match[decimalIndex];
     if (radix == null) {
       if (decimalMatch != null) {
         // Cannot fail because we know that the digits are all decimal.
@@ -480,7 +473,7 @@
     return JS('int', r'parseInt(#, #)', source, radix);
   }
 
-  static double parseDouble(String source) {
+  static double? parseDouble(String source) {
     checkString(source);
     // Notice that JS parseFloat accepts garbage at the end of the string.
     // Accept only:
@@ -509,18 +502,6 @@
   /// [: r"$".codeUnitAt(0) :]
   static const int DOLLAR_CHAR_VALUE = 36;
 
-  /// Creates a string containing the complete type for the class [className]
-  /// with the given type arguments.
-  ///
-  /// In minified mode, uses the unminified names if available.
-  ///
-  /// The given [className] string generally contains the name of the JavaScript
-  /// constructor of the given class.
-  static String formatType(String className, List typeArguments) {
-    return unmangleAllIdentifiersIfPreservedAnyways(
-        '$className${joinArguments(typeArguments, 0)}');
-  }
-
   /// Returns the type of [object] as a string (including type arguments).
   /// Tries to return a sensible name for non-Dart objects.
   ///
@@ -528,12 +509,7 @@
   /// them with 'minified:'.
   @pragma('dart2js:noInline')
   static String objectTypeName(Object object) {
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      return _objectTypeNameNewRti(object);
-    }
-    String className = _objectClassName(object);
-    String arguments = joinArguments(getRuntimeTypeInfo(object), 0);
-    return '${className}${arguments}';
+    return _objectTypeNameNewRti(object);
   }
 
   static String _objectClassName(Object object) {
@@ -544,7 +520,7 @@
     // instance (`const JSString()`, should use `JSString.prototype`).
     //
     // These all should have a `constructor` property with a `name` property.
-    String name;
+    String? name;
     var interceptorConstructor = JS('', '#.constructor', interceptor);
     if (JS('bool', 'typeof # == "function"', interceptorConstructor)) {
       var interceptorConstructorName = JS('', '#.name', interceptorConstructor);
@@ -592,7 +568,7 @@
 
     // Type inference does not understand that [name] is now always a non-null
     // String. (There is some imprecision in the negation of the disjunction.)
-    name = JS('String', '#', name);
+    name = JS<String>('String', '#', name);
 
     // TODO(kasperl): If the namer gave us a fresh global name, we may
     // want to remove the numeric suffix that makes it unique too.
@@ -659,10 +635,9 @@
   static int dateNow() => JS('int', r'Date.now()');
 
   static void initTicker() {
-    if (timerFrequency != null) return;
+    if (timerFrequency != 0) return;
     // Start with low-resolution. We overwrite the fields if we find better.
     timerFrequency = 1000;
-    timerTicks = dateNow;
     if (JS('bool', 'typeof window == "undefined"')) return;
     var window = JS('var', 'window');
     if (window == null) return;
@@ -673,10 +648,10 @@
     timerTicks = () => (1000 * JS('num', '#.now()', performance)).floor();
   }
 
-  static int timerFrequency;
-  static Function timerTicks;
+  static int timerFrequency = 0;
+  static int Function() timerTicks = dateNow; // Low-resolution version.
 
-  static String currentUri() {
+  static String? currentUri() {
     requiresPreamble();
     // In a browser return self.location.href.
     if (JS('bool', '!!self.location')) {
@@ -788,7 +763,7 @@
     // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)".
     // We extract this name using a regexp.
     var d = lazyAsJsDate(receiver);
-    List match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d);
+    List? match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d);
     if (match != null) return match[1];
 
     // Internet Explorer 10+ emits the zone name without parenthesis:
@@ -821,10 +796,11 @@
   static int getTimeZoneOffsetInMinutes(DateTime receiver) {
     // Note that JS and Dart disagree on the sign of the offset.
     // Subtract to avoid -0.0
-    return 0 - JS('int', r'#.getTimezoneOffset()', lazyAsJsDate(receiver));
+    return 0 - JS('int', r'#.getTimezoneOffset()', lazyAsJsDate(receiver))
+        as int;
   }
 
-  static int valueFromDecomposedDate(
+  static int? valueFromDecomposedDate(
       years, month, day, hours, minutes, seconds, milliseconds, isUtc) {
     final int MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
     checkInt(years);
@@ -979,8 +955,8 @@
     JS('void', '#[#] = #', object, key, value);
   }
 
-  static functionNoSuchMethod(
-      function, List positionalArguments, Map<String, dynamic> namedArguments) {
+  static functionNoSuchMethod(function, List? positionalArguments,
+      Map<String, dynamic>? namedArguments) {
     int argumentCount = 0;
     List arguments = [];
     List namedArgumentList = [];
@@ -1043,8 +1019,8 @@
   /// instead. For example, if the catch-all property contains the string
   /// "call$4", then the object's "call$4" property should be used as if it was
   /// the value of the catch-all property.
-  static applyFunction(Function function, List positionalArguments,
-      Map<String, dynamic> namedArguments) {
+  static applyFunction(Function function, List? positionalArguments,
+      Map<String, dynamic>? namedArguments) {
     // Fast shortcut for the common case.
     if (JS('bool', '# instanceof Array', positionalArguments) &&
         (namedArguments == null || namedArguments.isEmpty)) {
@@ -1106,8 +1082,8 @@
         function, positionalArguments, namedArguments);
   }
 
-  static _genericApplyFunction2(Function function, List positionalArguments,
-      Map<String, dynamic> namedArguments) {
+  static _genericApplyFunction2(Function function, List? positionalArguments,
+      Map<String, dynamic>? namedArguments) {
     List arguments;
     if (positionalArguments != null) {
       if (JS('bool', '# instanceof Array', positionalArguments)) {
@@ -1191,7 +1167,11 @@
       List keys = JS('JSArray', r'Object.keys(#)', defaultValues);
       if (namedArguments == null) {
         for (String key in keys) {
-          arguments.add(JS('var', '#[#]', defaultValues, key));
+          var defaultValue = JS('var', '#[#]', defaultValues, key);
+          if (isRequired(defaultValue)) {
+            return functionNoSuchMethod(function, arguments, namedArguments);
+          }
+          arguments.add(defaultValue);
         }
       } else {
         int used = 0;
@@ -1200,7 +1180,11 @@
             used++;
             arguments.add(namedArguments[key]);
           } else {
-            arguments.add(JS('var', r'#[#]', defaultValues, key));
+            var defaultValue = JS('var', '#[#]', defaultValues, key);
+            if (isRequired(defaultValue)) {
+              return functionNoSuchMethod(function, arguments, namedArguments);
+            }
+            arguments.add(defaultValue);
           }
         }
         if (used != namedArguments.length) {
@@ -1576,7 +1560,7 @@
     // Look for the special pattern \$camelCase\$ (all the $ symbols
     // have been escaped already), as we will soon be inserting
     // regular expression syntax that we want interpreted by RegExp.
-    List<String> match =
+    List<String>? match =
         JS('JSExtendableArray|Null', r'#.match(/\\\$[a-zA-Z]+\\\$/g)', message);
     if (match == null) match = [];
 
@@ -1741,7 +1725,7 @@
 
 class NullError extends Error implements NoSuchMethodError {
   final String _message;
-  final String _method;
+  final String? _method;
 
   NullError(this._message, match)
       : _method = match == null ? null : JS('', '#.method', match);
@@ -1754,8 +1738,8 @@
 
 class JsNoSuchMethodError extends Error implements NoSuchMethodError {
   final String _message;
-  final String _method;
-  final String _receiver;
+  final String? _method;
+  final String? _receiver;
 
   JsNoSuchMethodError(this._message, match)
       : _method = match == null ? null : JS('String|Null', '#.method', match),
@@ -1780,6 +1764,18 @@
   String toString() => _message.isEmpty ? 'Error' : 'Error: $_message';
 }
 
+class NullThrownFromJavaScriptException implements Exception {
+  final dynamic _irritant;
+  NullThrownFromJavaScriptException(this._irritant);
+
+  @override
+  String toString() {
+    String description =
+        JS('bool', '# === null', _irritant) ? 'null' : 'undefined';
+    return "Throw of null ('$description' from JavaScript)";
+  }
+}
+
 /// A wrapper around an exception, much like the one created by [wrapException]
 /// but with a pre-given stack-trace.
 class ExceptionAndStackTrace {
@@ -1789,40 +1785,49 @@
   ExceptionAndStackTrace(this.dartException, this.stackTrace);
 }
 
-/// Called from catch blocks in generated code to extract the Dart
-/// exception from the thrown value. The thrown value may have been
-/// created by [wrapException] or it may be a 'native' JS exception.
+/// Called from catch blocks in generated code to extract the Dart exception
+/// from the thrown value. The thrown value may have been created by
+/// [wrapException] or it may be a 'native' JavaScript exception.
 ///
 /// Some native exceptions are mapped to new Dart instances, others are
 /// returned unmodified.
-unwrapException(ex) {
-  /// If error implements Error, save [ex] in [error.$thrownJsError].
-  /// Otherwise, do nothing. Later, the stack trace can then be extracted from
-  /// [ex].
-  saveStackTrace(error) {
-    if (error is Error) {
-      var thrownStackTrace = JS('', r'#.$thrownJsError', error);
-      if (thrownStackTrace == null) {
-        JS('void', r'#.$thrownJsError = #', error, ex);
-      }
-    }
-    return error;
+Object unwrapException(Object? ex) {
+  // Dart converts `null` to `NullThrownError()`. JavaScript can still throw a
+  // nullish value.
+  if (ex == null) {
+    return NullThrownFromJavaScriptException(ex);
   }
 
-  // Note that we are checking if the object has the property. If it
-  // has, it could be set to null if the thrown value is null.
-  if (ex == null) return null;
   if (ex is ExceptionAndStackTrace) {
-    return saveStackTrace(ex.dartException);
+    return saveStackTrace(ex, ex.dartException);
   }
+
+  // e.g. a primitive value thrown by JavaScript.
   if (JS('bool', 'typeof # !== "object"', ex)) return ex;
 
   if (JS('bool', r'"dartException" in #', ex)) {
-    return saveStackTrace(JS('', r'#.dartException', ex));
-  } else if (!JS('bool', r'"message" in #', ex)) {
+    return saveStackTrace(ex, JS('', r'#.dartException', ex));
+  }
+  return _unwrapNonDartException(ex);
+}
+
+/// If error implements Dart [Error], save [ex] in [error.$thrownJsError].
+/// Otherwise, do nothing. Later, the stack trace can then be extracted from
+/// [ex].
+Object saveStackTrace(Object ex, Object error) {
+  if (error is Error) {
+    var thrownStackTrace = JS('', r'#.$thrownJsError', error);
+    if (thrownStackTrace == null) {
+      JS('void', r'#.$thrownJsError = #', error, ex);
+    }
+  }
+  return error;
+}
+
+Object _unwrapNonDartException(Object ex) {
+  if (!JS('bool', r'"message" in #', ex)) {
     return ex;
   }
-
   // Grab hold of the exception message. This field is available on
   // all supported browsers.
   var message = JS('var', r'#.message', ex);
@@ -1845,19 +1850,17 @@
       switch (ieErrorCode) {
         case 438:
           return saveStackTrace(
-              new JsNoSuchMethodError('$message (Error $ieErrorCode)', null));
+              ex, JsNoSuchMethodError('$message (Error $ieErrorCode)', null));
         case 445:
         case 5007:
           return saveStackTrace(
-              new NullError('$message (Error $ieErrorCode)', null));
+              ex, NullError('$message (Error $ieErrorCode)', null));
       }
     }
   }
 
   if (JS('bool', r'# instanceof TypeError', ex)) {
     var match;
-    // Using JS to give type hints to the compiler to help tree-shaking.
-    // TODO(ahe): That should be unnecessary due to type inference.
     var nsme = TypeErrorDecoder.noSuchMethodPattern;
     var notClosure = TypeErrorDecoder.notClosurePattern;
     var nullCall = TypeErrorDecoder.nullCallPattern;
@@ -1869,14 +1872,14 @@
     var undefProperty = TypeErrorDecoder.undefinedPropertyPattern;
     var undefLiteralProperty = TypeErrorDecoder.undefinedLiteralPropertyPattern;
     if ((match = nsme.matchTypeError(message)) != null) {
-      return saveStackTrace(new JsNoSuchMethodError(message, match));
+      return saveStackTrace(ex, JsNoSuchMethodError(message, match));
     } else if ((match = notClosure.matchTypeError(message)) != null) {
       // notClosure may match "({c:null}).c()" or "({c:1}).c()", so we
       // cannot tell if this an attempt to invoke call on null or a
       // non-function object.
       // But we do know the method name is "call".
       JS('', '#.method = "call"', match);
-      return saveStackTrace(new JsNoSuchMethodError(message, match));
+      return saveStackTrace(ex, JsNoSuchMethodError(message, match));
     } else if ((match = nullCall.matchTypeError(message)) != null ||
         (match = nullLiteralCall.matchTypeError(message)) != null ||
         (match = undefCall.matchTypeError(message)) != null ||
@@ -1885,19 +1888,19 @@
         (match = nullLiteralCall.matchTypeError(message)) != null ||
         (match = undefProperty.matchTypeError(message)) != null ||
         (match = undefLiteralProperty.matchTypeError(message)) != null) {
-      return saveStackTrace(new NullError(message, match));
+      return saveStackTrace(ex, NullError(message, match));
     }
 
     // If we cannot determine what kind of error this is, we fall back
     // to reporting this as a generic error. It's probably better than
     // nothing.
     return saveStackTrace(
-        new UnknownJsTypeError(message is String ? message : ''));
+        ex, UnknownJsTypeError(message is String ? message : ''));
   }
 
   if (JS('bool', r'# instanceof RangeError', ex)) {
     if (message is String && contains(message, 'call stack')) {
-      return new StackOverflowError();
+      return StackOverflowError();
     }
 
     // In general, a RangeError is thrown when trying to pass a number as an
@@ -1908,7 +1911,7 @@
     if (message is String) {
       message = JS('String', r'#.replace(/^RangeError:\s*/, "")', message);
     }
-    return saveStackTrace(new ArgumentError(message));
+    return saveStackTrace(ex, ArgumentError(message));
   }
 
   // Check for the Firefox specific stack overflow signal.
@@ -1917,17 +1920,17 @@
       r'typeof InternalError == "function" && # instanceof InternalError',
       ex)) {
     if (message is String && message == 'too much recursion') {
-      return new StackOverflowError();
+      return StackOverflowError();
     }
   }
 
-  // Just return the exception. We should not wrap it because in case
-  // the exception comes from the DOM, it is a JavaScript
-  // object backed by a native Dart class.
+  // Just return the exception. We should not wrap it because in case the
+  // exception comes from the DOM, it is a JavaScript object that has a Dart
+  // interceptor.
   return ex;
 }
 
-String tryStringifyException(ex) {
+String? tryStringifyException(ex) {
   // Since this function is called from [unwrapException] which is called from
   // code injected into a catch-clause, use JavaScript try-catch to avoid a
   // potential loop if stringifying crashes.
@@ -1951,7 +1954,7 @@
     return exception.stackTrace;
   }
   if (exception == null) return new _StackTrace(exception);
-  _StackTrace trace = JS('_StackTrace|Null', r'#.$cachedTrace', exception);
+  _StackTrace? trace = JS('_StackTrace|Null', r'#.$cachedTrace', exception);
   if (trace != null) return trace;
   trace = new _StackTrace(exception);
   return JS('_StackTrace', r'#.$cachedTrace = #', exception, trace);
@@ -1959,13 +1962,13 @@
 
 class _StackTrace implements StackTrace {
   var _exception;
-  String _trace;
+  String? _trace;
   _StackTrace(this._exception);
 
   String toString() {
     if (_trace != null) return JS('String', '#', _trace);
 
-    String trace;
+    String? trace;
     if (JS('bool', '# !== null', _exception) &&
         JS('bool', 'typeof # === "object"', _exception)) {
       trace = JS('String|Null', r'#.stack', _exception);
@@ -2096,7 +2099,7 @@
   static fromTearOff(
     receiver,
     List functions,
-    int applyTrampolineIndex,
+    int? applyTrampolineIndex,
     var reflectionInfo,
     bool isStatic,
     bool isIntercepted,
@@ -2117,8 +2120,8 @@
     // TODO(ahe): All the place below using \$ should be rewritten to go
     // through the namer.
     var function = JS('', '#[#]', functions, 0);
-    String name = JS('String|Null', '#.\$stubName', function);
-    String callName = JS('String|Null', '#[#]', function,
+    String? name = JS('String|Null', '#.\$stubName', function);
+    String? callName = JS('String|Null', '#[#]', function,
         JS_GET_NAME(JsGetName.CALL_NAME_PROPERTY));
 
     // This variable holds either an index into the types-table, or a function
@@ -2156,7 +2159,7 @@
         ? JS('StaticClosure', 'Object.create(#.constructor.prototype)',
             new StaticClosure())
         : JS('BoundClosure', 'Object.create(#.constructor.prototype)',
-            new BoundClosure(null, null, null, null));
+            new BoundClosure(null, null, null, ''));
 
     JS('', '#.\$initialize = #', prototype, JS('', '#.constructor', prototype));
 
@@ -2190,10 +2193,8 @@
           propertyName);
     }
 
-    var signatureFunction = JS_GET_FLAG('USE_NEW_RTI')
-        ? _computeSignatureFunctionNewRti(functionType, isStatic, isIntercepted)
-        : _computeSignatureFunctionLegacy(
-            functionType, isStatic, isIntercepted);
+    var signatureFunction =
+        _computeSignatureFunctionNewRti(functionType, isStatic, isIntercepted);
 
     JS('', '#[#] = #', prototype, JS_GET_NAME(JsGetName.SIGNATURE_NAME),
         signatureFunction);
@@ -2302,7 +2303,7 @@
   }
 
   static cspForwardCall(
-      int arity, bool isSuperCall, String stubName, function) {
+      int arity, bool isSuperCall, String? stubName, function) {
     var getSelf = RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
     // Handle intercepted stub-names with the default slow case.
     if (isSuperCall) arity = -1;
@@ -2384,7 +2385,7 @@
 
   static forwardCallTo(receiver, function, bool isIntercepted) {
     if (isIntercepted) return forwardInterceptedCallTo(receiver, function);
-    String stubName = JS('String|Null', '#.\$stubName', function);
+    String? stubName = JS('String|Null', '#.\$stubName', function);
     int arity = JS('int', '#.length', function);
     var lookedUpFunction = JS('', '#[#]', receiver, stubName);
     // The receiver[stubName] may not be equal to the function if we try to
@@ -2421,7 +2422,7 @@
   }
 
   static cspForwardInterceptedCall(
-      int arity, bool isSuperCall, String name, function) {
+      int arity, bool isSuperCall, String? name, function) {
     var getSelf = RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
     var getReceiver = RAW_DART_FUNCTION_REF(BoundClosure.receiverOf);
     // Handle intercepted stub-names with the default slow case.
@@ -2516,7 +2517,7 @@
   static forwardInterceptedCallTo(receiver, function) {
     String selfField = BoundClosure.selfFieldName();
     String receiverField = BoundClosure.receiverFieldName();
-    String stubName = JS('String|Null', '#.\$stubName', function);
+    String? stubName = JS('String|Null', '#.\$stubName', function);
     int arity = JS('int', '#.length', function);
     bool isCsp = JS_GET_FLAG('USE_CONTENT_SECURITY_POLICY');
     var lookedUpFunction = JS('', '#[#]', receiver, stubName);
@@ -2561,7 +2562,7 @@
   // to be visible to resolution and the generation of extra stubs.
 
   String toString() {
-    String name;
+    String? name;
     var constructor = JS('', '#.constructor', this);
     name =
         constructor == null ? null : JS('String|Null', '#.name', constructor);
@@ -2588,7 +2589,7 @@
 
 class StaticClosure extends TearOffClosure {
   String toString() {
-    String name =
+    String? name =
         JS('String|Null', '#[#]', this, STATIC_FUNCTION_NAME_PROPERTY_NAME);
     if (name == null) return 'Closure of unknown static method';
     return "Closure '${unminifyOrTag(name)}'";
@@ -2666,22 +2667,22 @@
 
   static nameOf(BoundClosure closure) => closure._name;
 
-  static String selfFieldNameCache;
+  static String? selfFieldNameCache;
 
   static String selfFieldName() {
     if (selfFieldNameCache == null) {
       selfFieldNameCache = computeFieldNamed('self');
     }
-    return selfFieldNameCache;
+    return selfFieldNameCache!;
   }
 
-  static String receiverFieldNameCache;
+  static String? receiverFieldNameCache;
 
   static String receiverFieldName() {
     if (receiverFieldNameCache == null) {
       receiverFieldNameCache = computeFieldNamed('receiver');
     }
-    return receiverFieldNameCache;
+    return receiverFieldNameCache!;
   }
 
   @pragma('dart2js:noInline')
@@ -2696,6 +2697,7 @@
         return JS('String', '#', name);
       }
     }
+    throw new ArgumentError("Field name $fieldName not found.");
   }
 }
 
@@ -2792,28 +2794,10 @@
 /// The following methods are called by the runtime to implement checked mode
 /// and casts. We specialize each primitive type (eg int, bool), and use the
 /// compiler's convention to do is-checks on regular objects.
-boolConversionCheck(value) {
+bool boolConversionCheck(value) {
   // The value from kernel should always be true, false, or null.
   if (value == null) assertThrow('boolean expression must not be null');
-  return value;
-}
-
-extractFunctionTypeObjectFrom(o) {
-  var interceptor = getInterceptor(o);
-  return extractFunctionTypeObjectFromInternal(interceptor);
-}
-
-extractFunctionTypeObjectFromInternal(o) {
-  var signatureName = JS_GET_NAME(JsGetName.SIGNATURE_NAME);
-  if (JS('bool', '# in #', signatureName, o)) {
-    var signature = JS('', '#[#]', o, signatureName);
-    if (JS('bool', 'typeof # == "number"', signature)) {
-      return getType(signature);
-    } else {
-      return JS('', '#[#]()', o, signatureName);
-    }
-  }
-  return null;
+  return JS('bool', '#', value);
 }
 
 @pragma('dart2js:noInline')
@@ -2828,43 +2812,6 @@
 /// visible to anyone, and is only injected into special libraries.
 abstract class JavaScriptIndexingBehavior<E> extends JSMutableIndexable<E> {}
 
-/// Thrown by type assertions that fail.
-class TypeErrorImplementation extends Error implements TypeError, CastError {
-  final String _message;
-
-  /// Normal type error caused by a failed subtype test.
-  TypeErrorImplementation(Object value, String type)
-      : _message = "TypeError: ${Error.safeToString(value)}: type "
-            "'${_typeDescription(value)}' is not a subtype of type '$type'";
-
-  TypeErrorImplementation.fromMessage(String this._message);
-
-  String toString() => _message;
-}
-
-/// Thrown by the 'as' operator if the cast isn't valid.
-class CastErrorImplementation extends Error implements CastError, TypeError {
-  final String _message;
-
-  /// Normal cast error caused by a failed type cast.
-  CastErrorImplementation(Object value, Object type)
-      : _message = "TypeError: ${Error.safeToString(value)}: type "
-            "'${_typeDescription(value)}' is not a subtype of type '$type'";
-
-  String toString() => _message;
-}
-
-String _typeDescription(value) {
-  if (value is Closure) {
-    var functionTypeObject = extractFunctionTypeObjectFrom(value);
-    if (functionTypeObject != null) {
-      return runtimeTypeToString(functionTypeObject);
-    }
-    return 'Closure';
-  }
-  return Primitives.objectTypeName(value);
-}
-
 class FallThroughErrorImplementation extends FallThroughError {
   FallThroughErrorImplementation();
   String toString() => 'Switch case fall-through.';
@@ -2876,31 +2823,34 @@
 /// Returns the negation of the condition. That is: `true` if the assert should
 /// fail.
 bool assertTest(condition) {
-  // Do bool success check first, it is common and faster than 'is Function'.
   if (true == condition) return false;
-  if (condition is bool) return !condition;
-  throw new TypeErrorImplementation(condition, 'bool');
+  if (false == condition) return true;
+  bool checked = condition as bool;
+  if (null == condition) {
+    newRti.throwTypeError('assert condition must not be null');
+  }
+  return !checked;
 }
 
 /// Helper function for implementing asserts with messages.
 /// The compiler treats this specially.
 void assertThrow(Object message) {
-  throw new _AssertionError(message);
+  throw _AssertionError(message);
 }
 
 /// Helper function for implementing asserts without messages.
 /// The compiler treats this specially.
 @pragma('dart2js:noInline')
 void assertHelper(condition) {
-  if (assertTest(condition)) throw new AssertionError();
+  if (assertTest(condition)) throw AssertionError();
 }
 
 /// Called by generated code when a method that must be statically
 /// resolved cannot be found.
 void throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {
   Symbol memberName = new _symbol_dev.Symbol.unvalidated(name);
-  throw new NoSuchMethodError(obj, memberName, arguments,
-      new Map<Symbol, dynamic>(), expectedArgumentNames);
+  throw new NoSuchMethodError(
+      obj, memberName, arguments, new Map<Symbol, dynamic>());
 }
 
 /// Called by generated code when a static field's initializer references the
@@ -2967,7 +2917,7 @@
   return () => loadDeferredLibrary(loadId);
 }
 
-final Map<String, Future<Null>> _loadingLibraries = <String, Future<Null>>{};
+final Map<String, Future<Null>?> _loadingLibraries = <String, Future<Null>?>{};
 final Set<String> _loadedLibraries = new Set<String>();
 
 /// Events used to diagnose failures from deferred loading requests.
@@ -2976,14 +2926,14 @@
 typedef void DeferredLoadCallback();
 
 // Function that will be called every time a new deferred import is loaded.
-DeferredLoadCallback deferredLoadHook;
+DeferredLoadCallback? deferredLoadHook;
 
 Future<Null> loadDeferredLibrary(String loadId) {
   // For each loadId there is a list of parts to load. The parts are represented
   // by an index. There are two arrays, one that maps the index into a Uri and
   // another that maps the index to a hash.
   var partsMap = JS_EMBEDDED_GLOBAL('', DEFERRED_LIBRARY_PARTS);
-  List indexes = JS('JSExtendableArray|Null', '#[#]', partsMap, loadId);
+  List? indexes = JS('JSExtendableArray|Null', '#[#]', partsMap, loadId);
   if (indexes == null) return new Future.value(null);
   List<String> uris = <String>[];
   List<String> hashes = <String>[];
@@ -3041,7 +2991,7 @@
       waitingForLoad[i] = false;
       return new Future.value();
     }
-    return _loadHunk(uris[i]).then((_) {
+    return _loadHunk(uris[i]).then((Null _) {
       waitingForLoad[i] = false;
       initializeSomeLoadedHunks();
     });
@@ -3054,27 +3004,27 @@
     assert(nextHunkToInitialize == total);
     bool updated = _loadedLibraries.add(loadId);
     if (updated && deferredLoadHook != null) {
-      deferredLoadHook();
+      deferredLoadHook!();
     }
   });
 }
 
 /// The `nonce` value on the current script used for strict-CSP, if any.
-String _cspNonce = _computeCspNonce();
+String? _cspNonce = _computeCspNonce();
 
-String _computeCspNonce() {
+String? _computeCspNonce() {
   var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
   if (currentScript == null) return null;
-  String nonce = JS('String|Null', '#.nonce', currentScript);
+  String? nonce = JS('String|Null', '#.nonce', currentScript);
   return (nonce != null && nonce != '')
       ? nonce
       : JS('String|Null', '#.getAttribute("nonce")', currentScript);
 }
 
 /// The 'crossOrigin' value on the current script used for CORS, if any.
-String _crossOrigin = _computeCrossOrigin();
+String? _crossOrigin = _computeCrossOrigin();
 
-String _computeCrossOrigin() {
+String? _computeCrossOrigin() {
   var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
   if (currentScript == null) return null;
   return JS('String|Null', '#.crossOrigin', currentScript);
@@ -3087,12 +3037,12 @@
 }
 
 /// The src url for the script tag that loaded this code.
-String thisScript = _computeThisScript();
+String? thisScript = _computeThisScript();
 
 /// The src url for the script tag that loaded this function.
 ///
 /// Used to create JavaScript workers and load deferred libraries.
-String _computeThisScript() {
+String? _computeThisScript() {
   var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
   if (currentScript != null) {
     return JS('String', 'String(#.src)', currentScript);
@@ -3139,14 +3089,14 @@
 }
 
 Future<Null> _loadHunk(String hunkName) {
-  Future<Null> future = _loadingLibraries[hunkName];
+  var future = _loadingLibraries[hunkName];
   _eventLog.add(' - _loadHunk: $hunkName');
   if (future != null) {
     _eventLog.add('reuse: $hunkName');
-    return future.then((_) => null);
+    return future.then((Null _) => null);
   }
 
-  String uri = thisScript;
+  String uri = thisScript!;
 
   int index = uri.lastIndexOf('/');
   uri = '${uri.substring(0, index + 1)}$hunkName';
@@ -3160,7 +3110,7 @@
     completer.complete(null);
   }
 
-  void failure(error, String context, StackTrace stackTrace) {
+  void failure(error, String context, StackTrace? stackTrace) {
     _eventLog.add(' - download failed: $hunkName (context: $context)');
     _loadingLibraries[hunkName] = null;
     stackTrace ??= StackTrace.current;
@@ -3298,3 +3248,6 @@
 class _Required {
   const _Required();
 }
+
+const kRequiredSentinel = const _Required();
+bool isRequired(Object? value) => identical(kRequiredSentinel, value);
diff --git a/sdk/lib/_internal/js_runtime/lib/js_names.dart b/sdk/lib/_internal/js_runtime/lib/js_names.dart
index 767eced..10efacf 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_names.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_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.6
-
 library dart._js_names;
 
 import 'dart:_js_embedded_names'
@@ -50,7 +48,7 @@
 
   _LazyMangledNamesMap(this._jsMangledNames);
 
-  String operator [](String key) {
+  String? operator [](String key) {
     var result = JS('var', '#[#]', _jsMangledNames, key);
     // Filter out all non-string values to protect against polution from
     // ancillary fields in [_jsMangledNames].
@@ -67,8 +65,8 @@
 class _LazyMangledInstanceNamesMap extends _LazyMangledNamesMap {
   _LazyMangledInstanceNamesMap(_jsMangledNames) : super(_jsMangledNames);
 
-  String operator [](String key) {
-    String result = super[key];
+  String? operator [](String key) {
+    String? result = super[key];
     String setterPrefix = JS_GET_NAME(JsGetName.SETTER_PREFIX);
     if (result == null && key.startsWith(setterPrefix)) {
       String getterPrefix = JS_GET_NAME(JsGetName.GETTER_PREFIX);
@@ -96,7 +94,7 @@
   final _jsMangledNames;
   final bool _isInstance;
   int _cacheLength = 0;
-  Map<String, String> _cache;
+  Map<String, String>? _cache;
 
   _LazyReflectiveNamesMap(this._jsMangledNames, this._isInstance);
 
@@ -126,12 +124,12 @@
   int get _jsMangledNamesLength =>
       JS('int', 'Object.keys(#).length', _jsMangledNames);
 
-  String operator [](String key) {
+  String? operator [](String key) {
     if (_cache == null || _jsMangledNamesLength != _cacheLength) {
       _cache = _updateReflectiveNames();
       _cacheLength = _jsMangledNamesLength;
     }
-    return _cache[key];
+    return _cache![key];
   }
 }
 
@@ -150,7 +148,7 @@
 /// This is used, for example, to return unmangled names from TypeImpl.toString
 /// *if* names are being preserved for other reasons (use of dart:mirrors, for
 /// example).
-String unmangleGlobalNameIfPreservedAnyways(String name) {
+String? unmangleGlobalNameIfPreservedAnyways(String name) {
   var names = JS_EMBEDDED_GLOBAL('', MANGLED_GLOBAL_NAMES);
   return JS('String|Null', '#', JsCache.fetch(names, name));
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/js_number.dart b/sdk/lib/_internal/js_runtime/lib/js_number.dart
index 610312b..489da64 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_number.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_number.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.6
-
 part of _interceptors;
 
 /// The super interceptor class for [JSInt] and [JSDouble]. The compiler
@@ -68,7 +66,7 @@
       r'Math.abs(#)',
       this);
 
-  JSNumber get sign => this > 0 ? 1 : this < 0 ? -1 : this;
+  JSNumber get sign => (this > 0 ? 1 : this < 0 ? -1 : this) as JSNumber;
 
   static const int _MIN_INT32 = -0x80000000;
   static const int _MAX_INT32 = 0x7FFFFFFF;
@@ -183,7 +181,7 @@
     return result;
   }
 
-  String toStringAsExponential([int fractionDigits]) {
+  String toStringAsExponential([int? fractionDigits]) {
     String result;
     if (fractionDigits != null) {
       checkInt(fractionDigits);
@@ -234,7 +232,7 @@
     int exponent = JS('int', '+#', match[3]);
     if (match[2] != null) {
       result = JS('String', '# + #', result, match[2]);
-      exponent -= JS('int', '#.length', match[2]);
+      exponent -= JS<int>('int', '#.length', match[2]);
     }
     return result + '0' * exponent;
   }
@@ -308,13 +306,13 @@
   JSNumber operator %(num other) {
     if (other is! num) throw argumentErrorValue(other);
     // Euclidean Modulo.
-    num result = JS('num', r'# % #', this, other);
+    JSNumber result = JS<JSNumber>('JSNumber', r'# % #', this, other);
     if (result == 0) return JS('num', '0'); // Make sure we don't return -0.0.
     if (result > 0) return result;
     if (JS('num', '#', other) < 0) {
-      return result - JS('num', '#', other);
+      return result - JS<JSNumber>('JSNumber', '#', other);
     } else {
-      return result + JS('num', '#', other);
+      return result + JS<JSNumber>('JSNumber', '#', other);
     }
   }
 
@@ -469,7 +467,7 @@
       this);
 
   @override
-  JSInt get sign => this > 0 ? 1 : this < 0 ? -1 : this;
+  JSInt get sign => (this > 0 ? 1 : this < 0 ? -1 : this) as JSInt;
 
   @override
   JSInt operator -() => JS('int', r'-#', this);
@@ -488,7 +486,7 @@
   }
 
   int get bitLength {
-    JSInt nonneg = this < 0 ? -this - 1 : this;
+    int nonneg = (this < 0 ? -this - 1 : this) as int;
     int wordBits = 32;
     while (nonneg >= 0x100000000) {
       nonneg = nonneg ~/ 0x100000000;
diff --git a/sdk/lib/_internal/js_runtime/lib/js_patch.dart b/sdk/lib/_internal/js_runtime/lib/js_patch.dart
index ab4a332..1ff2e55 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_patch.dart
@@ -2,21 +2,19 @@
 // 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.6
-
 // Patch file for dart:js library.
 import 'dart:collection' show HashMap, ListMixin;
 import 'dart:typed_data' show TypedData;
 
 import 'dart:_foreign_helper' show JS, DART_CLOSURE_TO_JS;
-import 'dart:_interceptors' show JavaScriptFunction, DART_CLOSURE_PROPERTY_NAME;
+import 'dart:_interceptors' show DART_CLOSURE_PROPERTY_NAME;
 import 'dart:_js_helper' show patch, Primitives, getIsolateAffinityTag;
 import 'dart:_js' show isBrowserObject, convertFromBrowserObject;
 
 @patch
 JsObject get context => _context;
 
-final JsObject _context = _wrapToDart(JS('', 'self'));
+final JsObject _context = _castToJsObject(_wrapToDart(JS('', 'self')));
 
 _convertDartFunction(Function f, {bool captureThis: false}) {
   return JS(
@@ -45,7 +43,7 @@
 @patch
 class JsObject {
   // The wrapped JS object.
-  final dynamic _jsObject;
+  final Object _jsObject;
 
   // This should only be called from _wrapToDart
   JsObject._fromJs(this._jsObject) {
@@ -53,40 +51,42 @@
   }
 
   @patch
-  factory JsObject(JsFunction constructor, [List arguments]) {
+  factory JsObject(JsFunction constructor, [List? arguments]) {
     var ctor = _convertToJS(constructor);
     if (arguments == null) {
-      return _wrapToDart(JS('', 'new #()', ctor));
+      return _castToJsObject(_wrapToDart(JS('', 'new #()', ctor)));
     }
 
     if (JS('bool', '# instanceof Array', arguments)) {
       int argumentCount = JS('int', '#.length', arguments);
       switch (argumentCount) {
         case 0:
-          return _wrapToDart(JS('', 'new #()', ctor));
+          return _castToJsObject(_wrapToDart(JS('', 'new #()', ctor)));
 
         case 1:
           var arg0 = _convertToJS(JS('', '#[0]', arguments));
-          return _wrapToDart(JS('', 'new #(#)', ctor, arg0));
+          return _castToJsObject(_wrapToDart(JS('', 'new #(#)', ctor, arg0)));
 
         case 2:
           var arg0 = _convertToJS(JS('', '#[0]', arguments));
           var arg1 = _convertToJS(JS('', '#[1]', arguments));
-          return _wrapToDart(JS('', 'new #(#, #)', ctor, arg0, arg1));
+          return _castToJsObject(
+              _wrapToDart(JS('', 'new #(#, #)', ctor, arg0, arg1)));
 
         case 3:
           var arg0 = _convertToJS(JS('', '#[0]', arguments));
           var arg1 = _convertToJS(JS('', '#[1]', arguments));
           var arg2 = _convertToJS(JS('', '#[2]', arguments));
-          return _wrapToDart(JS('', 'new #(#, #, #)', ctor, arg0, arg1, arg2));
+          return _castToJsObject(
+              _wrapToDart(JS('', 'new #(#, #, #)', ctor, arg0, arg1, arg2)));
 
         case 4:
           var arg0 = _convertToJS(JS('', '#[0]', arguments));
           var arg1 = _convertToJS(JS('', '#[1]', arguments));
           var arg2 = _convertToJS(JS('', '#[2]', arguments));
           var arg3 = _convertToJS(JS('', '#[3]', arguments));
-          return _wrapToDart(
-              JS('', 'new #(#, #, #, #)', ctor, arg0, arg1, arg2, arg3));
+          return _castToJsObject(_wrapToDart(
+              JS('', 'new #(#, #, #, #)', ctor, arg0, arg1, arg2, arg3)));
       }
     }
 
@@ -97,7 +97,7 @@
     // the arguments list passed to apply().
     // After that, use the JavaScript 'new' operator which overrides any binding
     // of 'this' with the new instance.
-    var args = <dynamic>[null]..addAll(arguments.map(_convertToJS));
+    var args = <Object?>[null]..addAll(arguments.map(_convertToJS));
     var factoryFunction = JS('', '#.bind.apply(#, #)', ctor, ctor, args);
     // Without this line, calling factoryFunction as a constructor throws
     JS('String', 'String(#)', factoryFunction);
@@ -105,7 +105,7 @@
     // object for which there is an interceptor
     var jsObj = JS('', 'new #()', factoryFunction);
 
-    return _wrapToDart(jsObj);
+    return _castToJsObject(_wrapToDart(jsObj));
 
     // TODO(sra): Investigate:
     //
@@ -116,25 +116,25 @@
   }
 
   @patch
-  factory JsObject.fromBrowserObject(object) {
+  factory JsObject.fromBrowserObject(Object object) {
     if (object is num || object is String || object is bool || object == null) {
       throw ArgumentError("object cannot be a num, string, bool, or null");
     }
-    return _wrapToDart(_convertToJS(object));
+    return _castToJsObject(_wrapToDart(_convertToJS(object)));
   }
 
   @patch
-  factory JsObject.jsify(object) {
+  factory JsObject.jsify(Object object) {
     if ((object is! Map) && (object is! Iterable)) {
       throw ArgumentError("object must be a Map or Iterable");
     }
-    return _wrapToDart(_convertDataTree(object));
+    return _castToJsObject(_wrapToDart(_convertDataTree(object)));
   }
 
-  static _convertDataTree(data) {
+  static _convertDataTree(Object data) {
     var _convertedObjects = HashMap.identity();
 
-    _convert(o) {
+    _convert(Object? o) {
       if (_convertedObjects.containsKey(o)) {
         return _convertedObjects[o];
       }
@@ -159,7 +159,7 @@
   }
 
   @patch
-  dynamic operator [](property) {
+  dynamic operator [](Object property) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -167,7 +167,7 @@
   }
 
   @patch
-  void operator []=(property, value) {
+  void operator []=(Object property, Object? value) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -175,11 +175,11 @@
   }
 
   @patch
-  bool operator ==(other) =>
+  bool operator ==(Object other) =>
       other is JsObject && JS('bool', '# === #', _jsObject, other._jsObject);
 
   @patch
-  bool hasProperty(property) {
+  bool hasProperty(Object property) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -187,7 +187,7 @@
   }
 
   @patch
-  void deleteProperty(property) {
+  void deleteProperty(Object property) {
     if (property is! String && property is! num) {
       throw ArgumentError("property is not a String or num");
     }
@@ -209,7 +209,7 @@
   }
 
   @patch
-  dynamic callMethod(method, [List args]) {
+  dynamic callMethod(Object method, [List? args]) {
     if (method is! String && method is! num) {
       throw ArgumentError("method is not a String or num");
     }
@@ -226,7 +226,7 @@
     return JsFunction._fromJs(jsFunc);
   }
 
-  JsFunction._fromJs(jsObject) : super._fromJs(jsObject);
+  JsFunction._fromJs(Object jsObject) : super._fromJs(jsObject);
 
   @patch
   dynamic apply(List args, {thisArg}) => _convertToDart(JS(
@@ -246,7 +246,7 @@
   factory JsArray.from(Iterable<E> other) =>
       JsArray<E>._fromJs([]..addAll(other.map(_convertToJS)));
 
-  JsArray._fromJs(jsObject) : super._fromJs(jsObject);
+  JsArray._fromJs(Object jsObject) : super._fromJs(jsObject);
 
   _checkIndex(int index) {
     if (index is int && (index < 0 || index >= length)) {
@@ -272,20 +272,16 @@
   // Methods required by ListMixin
 
   @patch
-  E operator [](dynamic index) {
-    // TODO(justinfagnani): fix the semantics for non-ints
-    // dartbug.com/14605
-    if (index is num && index == index.toInt()) {
+  E operator [](Object index) {
+    if (index is int) {
       _checkIndex(index);
     }
     return super[index];
   }
 
   @patch
-  void operator []=(dynamic index, E value) {
-    // TODO(justinfagnani): fix the semantics for non-ints
-    // dartbug.com/14605
-    if (index is num && index == index.toInt()) {
+  void operator []=(Object index, Object? value) {
+    if (index is int) {
       _checkIndex(index);
     }
     super[index] = value;
@@ -317,7 +313,7 @@
   @patch
   void addAll(Iterable<E> iterable) {
     var list = (JS('bool', '# instanceof Array', iterable))
-        ? iterable
+        ? JS<List>('JSArray', '#', iterable)
         : List.from(iterable);
     callMethod('push', list);
   }
@@ -352,13 +348,13 @@
     int length = end - start;
     if (length == 0) return;
     if (skipCount < 0) throw ArgumentError(skipCount);
-    var args = <dynamic>[start, length]
+    var args = <Object?>[start, length]
       ..addAll(iterable.skip(skipCount).take(length));
     callMethod('splice', args);
   }
 
   @patch
-  void sort([int compare(E a, E b)]) {
+  void sort([int compare(E a, E b)?]) {
     // Note: arr.sort(null) is a type error in FF
     callMethod('sort', compare == null ? [] : [compare]);
   }
@@ -373,6 +369,9 @@
 const _JS_FUNCTION_PROPERTY_NAME = r'$dart_jsFunction';
 const _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS = r'_$dart_jsFunctionCaptureThis';
 
+@pragma('dart2js:tryInline')
+JsObject _castToJsObject(o) => JS<JsObject>('', '#', o);
+
 bool _defineProperty(o, String name, value) {
   try {
     if (_isExtensible(o) &&
@@ -396,7 +395,7 @@
 
 bool _isExtensible(o) => JS('bool', 'Object.isExtensible(#)', o);
 
-Object _getOwnProperty(o, String name) {
+Object? _getOwnProperty(o, String name) {
   if (_hasOwnProperty(o, name)) {
     return JS('', '#[#]', o, name);
   }
@@ -408,7 +407,7 @@
 // The shared constructor function for proxies to Dart objects in JavaScript.
 final _dartProxyCtor = JS('', 'function DartObject(o) { this.o = o; }');
 
-dynamic _convertToJS(dynamic o) {
+Object? _convertToJS(Object? o) {
   // Note: we don't write `if (o == null) return null;` to make sure dart2js
   // doesn't convert `return null;` into `return;` (which would make `null` be
   // `undefined` in Javascprit). See dartbug.com/20305 for details.
@@ -440,7 +439,7 @@
       o, _JS_OBJECT_PROPERTY_NAME, (o) => JS('', 'new #(#)', ctor, o));
 }
 
-Object _getJsProxy(o, String propertyName, createProxy(o)) {
+Object? _getJsProxy(o, String propertyName, createProxy(o)) {
   var jsProxy = _getOwnProperty(o, propertyName);
   if (jsProxy == null) {
     jsProxy = createProxy(o);
@@ -451,7 +450,7 @@
 
 // converts a Dart object to a reference to a native JS object
 // which might be a DartObject JS->Dart proxy
-Object _convertToDart(o) {
+Object? _convertToDart(o) {
   if (JS('bool', '# == null', o) ||
       JS('bool', 'typeof # == "string"', o) ||
       JS('bool', 'typeof # == "number"', o) ||
@@ -484,7 +483,7 @@
       o, _DART_OBJECT_PROPERTY_NAME, (o) => JsObject._fromJs(o));
 }
 
-Object _getDartProxy(o, String propertyName, createProxy(o)) {
+Object _getDartProxy(o, String propertyName, JsObject createProxy(o)) {
   var dartProxy = _getOwnProperty(o, propertyName);
   // Temporary fix for dartbug.com/15193
   // In some cases it's possible to see a JavaScript object that
diff --git a/sdk/lib/_internal/js_runtime/lib/js_primitives.dart b/sdk/lib/_internal/js_runtime/lib/js_primitives.dart
index 5422333..97577a0 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_primitives.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_primitives.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.6
-
 /// dart2js "primitives", that is, features that cannot be implemented without
 /// access to JavaScript features.
 library dart2js._js_primitives;
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index 6ef5038..9b850c9 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.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.6
-
 /// This part contains helpers for supporting runtime type information.
 ///
 /// The helper use a mixture of Dart and JavaScript objects. To indicate which
@@ -42,32 +40,6 @@
 
 part of _js_helper;
 
-/// Called from generated code.
-Type createRuntimeType(rti) {
-  return new TypeImpl(rti);
-}
-
-class TypeImpl implements Type {
-  final dynamic _rti;
-  String __typeName;
-  String _unmangledName;
-  int _hashCode;
-
-  TypeImpl(this._rti);
-
-  String get _typeName => __typeName ??= runtimeTypeToString(_rti);
-
-  String toString() => _typeName;
-
-  // TODO(ahe): This is a poor hashCode as it collides with its name.
-  int get hashCode => _hashCode ??= _typeName.hashCode;
-
-  @pragma('dart2js:noInline')
-  bool operator ==(other) {
-    return (other is TypeImpl) && _typeName == other._typeName;
-  }
-}
-
 /// Represents a type variable.
 ///
 /// This class holds the information needed when reflecting on generic classes
@@ -91,17 +63,10 @@
 // more compact that the inlined expansion.
 @pragma('dart2js:noInline')
 Object setRuntimeTypeInfo(Object target, var rti) {
-  if (JS_GET_FLAG('USE_NEW_RTI')) {
-    assert(rti != null);
-    var rtiProperty = JS_EMBEDDED_GLOBAL('', ARRAY_RTI_PROPERTY);
-    JS('var', r'#[#] = #', target, rtiProperty, rti);
-    return target;
-  } else {
-    assert(rti == null || isJsArray(rti));
-    String rtiName = JS_GET_NAME(JsGetName.RTI_NAME);
-    JS('var', r'#[#] = #', target, rtiName, rti);
-    return target;
-  }
+  assert(rti != null);
+  var rtiProperty = JS_EMBEDDED_GLOBAL('', ARRAY_RTI_PROPERTY);
+  JS('var', r'#[#] = #', target, rtiProperty, rti);
+  return target;
 }
 
 /// Returns the runtime type information of [target]. The returned value is a
@@ -121,236 +86,12 @@
   return substitute(substitution, getRuntimeTypeInfo(object));
 }
 
-/// Returns the [index]th type argument of [target] as an instance of
-/// [substitutionName].
-///
-/// Called from generated code.
-@pragma('dart2js:noThrows')
-@pragma('dart2js:noSideEffects')
-@pragma('dart2js:noInline')
-getRuntimeTypeArgumentIntercepted(
-    interceptor, Object target, String substitutionName, int index) {
-  var arguments =
-      getRuntimeTypeArguments(interceptor, target, substitutionName);
-  return arguments == null ? null : getIndex(arguments, index);
-}
-
-/// Returns the [index]th type argument of [target] as an instance of
-/// [substitutionName].
-///
-/// Called from generated code.
-@pragma('dart2js:noThrows')
-@pragma('dart2js:noSideEffects')
-@pragma('dart2js:noInline')
-getRuntimeTypeArgument(Object target, String substitutionName, int index) {
-  var arguments = getRuntimeTypeArguments(target, target, substitutionName);
-  return arguments == null ? null : getIndex(arguments, index);
-}
-
-/// Returns the [index]th type argument of [target].
-///
-/// Called from generated code.
-@pragma('dart2js:noThrows')
-@pragma('dart2js:noSideEffects')
-@pragma('dart2js:noInline')
-getTypeArgumentByIndex(Object target, int index) {
-  var rti = getRuntimeTypeInfo(target);
-  return rti == null ? null : getIndex(rti, index);
-}
-
 /// Retrieves the class name from type information stored on the constructor
 /// of [object].
 String getClassName(var object) {
   return rawRtiToJsConstructorName(getRawRuntimeType(getInterceptor(object)));
 }
 
-String _getRuntimeTypeAsString(var rti, List<String> genericContext) {
-  assert(isJsArray(rti));
-  String className = unminifyOrTag(rawRtiToJsConstructorName(getIndex(rti, 0)));
-  return '$className${_joinArguments(rti, 1, genericContext)}';
-}
-
-/// Returns a human-readable representation of the type representation [rti].
-///
-/// Called from generated code.
-@pragma('dart2js:noInline')
-String runtimeTypeToString(var rti) {
-  return _runtimeTypeToString(rti, null);
-}
-
-String _runtimeTypeToString(var rti, List<String> genericContext) {
-  if (isDartDynamicTypeRti(rti)) {
-    return 'dynamic';
-  }
-  if (isDartVoidTypeRti(rti)) {
-    return 'void';
-  }
-  if (isJsArray(rti)) {
-    // A list representing a type with arguments.
-    return _getRuntimeTypeAsString(rti, genericContext);
-  }
-  if (isJsFunction(rti)) {
-    // A reference to the constructor.
-    return unminifyOrTag(rawRtiToJsConstructorName(rti));
-  }
-  if (isDartJsInteropTypeArgumentRti(rti)) {
-    return 'dynamic';
-  }
-  if (isGenericFunctionTypeParameter(rti)) {
-    int index = rti;
-    if (genericContext == null || index < 0 || index >= genericContext.length) {
-      return 'unexpected-generic-index:${index}';
-    }
-    return '${genericContext[genericContext.length - index - 1]}';
-  }
-  if (isDartFunctionType(rti)) {
-    // TODO(sra): If there is a typedef tag, use the typedef name.
-    return _functionRtiToString(rti, genericContext);
-  }
-  if (isDartFutureOrType(rti)) {
-    var typeArgument = getFutureOrArgument(rti);
-    return 'FutureOr<${_runtimeTypeToString(typeArgument, genericContext)}>';
-  }
-  // We should not get here.
-  return 'unknown-reified-type';
-}
-
-// Returns a formatted String version of a function type.
-//
-// [genericContext] is list of the names of generic type parameters for generic
-// function types. The de Bruijn indexing scheme references the type variables
-// from the inner scope out. The parameters for each scope are pushed in
-// reverse, e.g.  `<P,Q>(<R,S,T>(R))` creates the list `[Q,P,T,S,R]`. This
-// allows the de Bruijn index to simply index backwards from the end of
-// [genericContext], e.g. in the outer scope index `0` is P and `1` is Q, and in
-// the inner scope index `0` is R, `3` is P, and `4` is Q.
-//
-// [genericContext] is initially `null`.
-String _functionRtiToString(var rti, List<String> genericContext) {
-  String typeParameters = '';
-  int outerContextLength;
-
-  String boundsTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_GENERIC_BOUNDS_TAG);
-  if (hasField(rti, boundsTag)) {
-    List boundsRti = JS('JSFixedArray', '#[#]', rti, boundsTag);
-    if (genericContext == null) {
-      genericContext = <String>[];
-    } else {
-      outerContextLength = genericContext.length;
-    }
-    int offset = genericContext.length;
-    for (int i = boundsRti.length; i > 0; i--) {
-      genericContext.add('T${offset + i}');
-    }
-    // All variables are in scope in the bounds.
-    String typeSep = '';
-    typeParameters = '<';
-    for (int i = 0; i < boundsRti.length; i++) {
-      typeParameters += typeSep;
-      typeParameters += genericContext[genericContext.length - i - 1];
-      typeSep = ', ';
-      var boundRti = boundsRti[i];
-      if (isInterestingBound(boundRti)) {
-        typeParameters +=
-            ' extends ' + _runtimeTypeToString(boundRti, genericContext);
-      }
-    }
-    typeParameters += '>';
-  }
-
-  String returnTypeText;
-  String voidTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG);
-  if (JS('bool', '!!#[#]', rti, voidTag)) {
-    returnTypeText = 'void';
-  } else {
-    String returnTypeTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG);
-    var returnRti = JS('', '#[#]', rti, returnTypeTag);
-    returnTypeText = _runtimeTypeToString(returnRti, genericContext);
-  }
-
-  String argumentsText = '';
-  String sep = '';
-
-  String requiredParamsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG);
-  if (hasField(rti, requiredParamsTag)) {
-    List arguments = JS('JSFixedArray', '#[#]', rti, requiredParamsTag);
-    for (var argument in arguments) {
-      argumentsText += sep;
-      argumentsText += _runtimeTypeToString(argument, genericContext);
-      sep = ', ';
-    }
-  }
-
-  String optionalParamsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG);
-  bool hasOptionalArguments = JS('bool', '# in #', optionalParamsTag, rti);
-  if (hasOptionalArguments) {
-    List optionalArguments = JS('JSFixedArray', '#[#]', rti, optionalParamsTag);
-    argumentsText += '$sep[';
-    sep = '';
-    for (var argument in optionalArguments) {
-      argumentsText += sep;
-      argumentsText += _runtimeTypeToString(argument, genericContext);
-      sep = ', ';
-    }
-    argumentsText += ']';
-  }
-
-  String namedParamsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG);
-  bool hasNamedArguments = JS('bool', '# in #', namedParamsTag, rti);
-  if (hasNamedArguments) {
-    var namedArguments = JS('', '#[#]', rti, namedParamsTag);
-    argumentsText += '$sep{';
-    sep = '';
-    for (String name in extractKeys(namedArguments)) {
-      argumentsText += sep;
-      argumentsText += _runtimeTypeToString(
-          JS('', '#[#]', namedArguments, name), genericContext);
-      argumentsText += ' $name';
-      sep = ', ';
-    }
-    argumentsText += '}';
-  }
-
-  if (outerContextLength != null) {
-    // Pop all of the generic type parameters.
-    JS('', '#.length = #', genericContext, outerContextLength);
-  }
-
-  // TODO(sra): Below is the same format as the VM. Change to:
-  //
-  //     return '${returnTypeText} Function${typeParameters}(${argumentsText})';
-  //
-  return '${typeParameters}(${argumentsText}) => ${returnTypeText}';
-}
-
-/// Creates a comma-separated string of human-readable representations of the
-/// type representations in the JavaScript array [types] starting at index
-/// [startIndex].
-String joinArguments(var types, int startIndex) {
-  return _joinArguments(types, startIndex, null);
-}
-
-String _joinArguments(var types, int startIndex, List<String> genericContext) {
-  if (types == null) return '';
-  assert(isJsArray(types));
-  var separator = '';
-  bool allDynamic = true;
-  StringBuffer buffer = new StringBuffer('');
-  for (int index = startIndex; index < getLength(types); index++) {
-    buffer.write(separator);
-    separator = ', ';
-    var argument = getIndex(types, index);
-    if (argument != null) {
-      allDynamic = false;
-    }
-    buffer.write(_runtimeTypeToString(argument, genericContext));
-  }
-  return '<$buffer>';
-}
-
 Type getRuntimeType(var object) {
   return newRti.getRuntimeType(object);
 }
@@ -379,20 +120,6 @@
   return arguments;
 }
 
-/// Returns the field's type name.
-///
-/// In minified mode, uses the unminified names if available.
-String computeTypeName(String isField, List arguments) {
-  // Extract the class name from the is field and append the textual
-  // representation of the type arguments.
-  return Primitives.formatType(
-      unminifyOrTag(isCheckPropertyToJsConstructorName(isField)), arguments);
-}
-
-throwTypeError(message) {
-  throw new TypeErrorImplementation.fromMessage(message);
-}
-
 bool checkArguments(
     var substitution, var arguments, var sEnv, var checks, var tEnv) {
   return areSubtypes(substitute(substitution, arguments), sEnv, checks, tEnv);
@@ -466,12 +193,6 @@
       : null;
 }
 
-/// Extracts the type arguments from a type representation. The result is a
-/// JavaScript array or `null`.
-getArguments(var type) {
-  return isJsArray(type) ? JS('var', r'#.slice(1)', type) : null;
-}
-
 /// Checks whether the type represented by the type representation [s] is a
 /// subtype of the type represented by the type representation [t].
 ///
@@ -485,103 +206,7 @@
 }
 
 bool _isSubtype(var s, var sEnv, var t, var tEnv) {
-  // Subtyping is reflexive.
-  if (isIdentical(s, t)) return true;
-
-  // [t] is a top type?
-  if (isTopType(t)) return true;
-
-  if (isDartJsInteropTypeArgumentRti(s)) return true;
-
-  // [s] is a top type?
-  if (isTopType(s)) {
-    if (isGenericFunctionTypeParameter(t)) {
-      // We need to check for function type variables because
-      // `isDartFutureOrType` doesn't work on numbers.
-      return false;
-    }
-    if (isDartFutureOrType(t)) {
-      // [t] is FutureOr<T>. Check [s] <: T.
-      var tTypeArgument = getFutureOrArgument(t);
-      return _isSubtype(s, sEnv, tTypeArgument, tEnv);
-    }
-    return false;
-  }
-
-  if (isGenericFunctionTypeParameter(s)) {
-    return _isSubtype(getIndex(sEnv, s), sEnv, t, tEnv);
-  }
-
-  if (isGenericFunctionTypeParameter(t)) return false;
-
-  if (isNullType(s)) return true;
-
-  // Get the object describing the class and check for the subtyping flag
-  // constructed from the type of [s].
-  var typeOfS = isJsArray(s) ? getIndex(s, 0) : s;
-
-  if (isDartFutureOrType(t)) {
-    // [t] is FutureOr<T>
-    var tTypeArgument = getFutureOrArgument(t);
-    if (isDartFutureOrType(s)) {
-      // [S] is FutureOr<S>. Check S <: T
-      var sTypeArgument = getFutureOrArgument(s);
-      return _isSubtype(sTypeArgument, sEnv, tTypeArgument, tEnv);
-    } else if (_isSubtype(s, sEnv, tTypeArgument, tEnv)) {
-      // `true` because [s] <: T.
-      return true;
-    } else {
-      // Check [s] <: Future<T>.
-      String futureClass = JS_GET_NAME(JsGetName.FUTURE_CLASS_TYPE_NAME);
-      if (!builtinIsSubtype(typeOfS, futureClass)) {
-        // [s] doesn't implement Future.
-        return false;
-      }
-      var typeOfSPrototype = JS('', '#.prototype', typeOfS);
-      var field = '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}${futureClass}';
-      var futureSubstitution = getField(typeOfSPrototype, field);
-      var futureArguments = substitute(futureSubstitution, getArguments(s));
-      var futureArgument =
-          isJsArray(futureArguments) ? getIndex(futureArguments, 0) : null;
-      // [s] implements Future<S>. Check S <: T.
-      return _isSubtype(futureArgument, sEnv, tTypeArgument, tEnv);
-    }
-  }
-
-  if (isDartFunctionType(t)) {
-    return _isFunctionSubtype(s, sEnv, t, tEnv);
-  }
-
-  if (isDartFunctionType(s)) {
-    // Check function types against the `Function` class (`Object` is also a
-    // supertype, but is tested above with other 'top' types.).
-    return isDartFunctionTypeRti(t);
-  }
-
-  // Get the object describing the class and check for the subtyping flag
-  // constructed from the type of [t].
-  var typeOfT = isJsArray(t) ? getIndex(t, 0) : t;
-
-  // Check for a subtyping flag.
-  // Get the necessary substitution of the type arguments, if there is one.
-  var substitution;
-  if (isNotIdentical(typeOfT, typeOfS)) {
-    String typeOfTString = rawRtiToJsConstructorName(typeOfT);
-    if (!builtinIsSubtype(typeOfS, typeOfTString)) {
-      return false;
-    }
-    var typeOfSPrototype = JS('', '#.prototype', typeOfS);
-    var field = '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}${typeOfTString}';
-    substitution = getField(typeOfSPrototype, field);
-  }
-  // The class of [s] is a subclass of the class of [t]. If [t] has no
-  // type arguments, it used as a raw type and [s] is a subtype of [t].
-  if (!isJsArray(t)) {
-    return true;
-  }
-  // Recursively check the type arguments.
-  return checkArguments(
-      substitution, getArguments(s), sEnv, getArguments(t), tEnv);
+  return false;
 }
 
 /// Top-level function subtype check when [t] is known to be a function type
diff --git a/sdk/lib/_internal/js_runtime/lib/js_string.dart b/sdk/lib/_internal/js_runtime/lib/js_string.dart
index d6af957..8ba4c37 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_string.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_string.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.6
-
 part of _interceptors;
 
 /// The interceptor class for [String]. The compiler recognizes this
@@ -34,7 +32,7 @@
     return allMatchesInStringUnchecked(this, string, start);
   }
 
-  Match matchAsPrefix(String string, [int start = 0]) {
+  Match? matchAsPrefix(String string, [int start = 0]) {
     if (start < 0 || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
     }
@@ -64,12 +62,12 @@
     return stringReplaceAllUnchecked(this, from, checkString(to));
   }
 
-  String replaceAllMapped(Pattern from, String convert(Match match)) {
+  String replaceAllMapped(Pattern from, String Function(Match) convert) {
     return this.splitMapJoin(from, onMatch: convert);
   }
 
   String splitMapJoin(Pattern from,
-      {String onMatch(Match match), String onNonMatch(String nonMatch)}) {
+      {String Function(Match)? onMatch, String Function(String)? onNonMatch}) {
     return stringReplaceAllFuncUnchecked(this, from, onMatch, onNonMatch);
   }
 
@@ -100,12 +98,12 @@
     }
   }
 
-  String replaceRange(int start, int end, String replacement) {
+  String replaceRange(int start, int? end, String replacement) {
     checkString(replacement);
     checkInt(start);
-    end = RangeError.checkValidRange(start, end, this.length);
-    checkInt(end);
-    return stringReplaceRangeUnchecked(this, start, end, replacement);
+    var e = RangeError.checkValidRange(start, end, this.length);
+    checkInt(e);
+    return stringReplaceRangeUnchecked(this, start, e, replacement);
   }
 
   List<String> _defaultSplit(Pattern pattern) {
@@ -151,7 +149,7 @@
     return pattern.matchAsPrefix(this, index) != null;
   }
 
-  String substring(int startIndex, [int endIndex]) {
+  String substring(int startIndex, [int? endIndex]) {
     checkInt(startIndex);
     if (endIndex == null) endIndex = length;
     checkInt(endIndex);
@@ -354,7 +352,7 @@
       throw const OutOfMemoryError();
     }
     var result = '';
-    var s = this;
+    String s = this;
     while (true) {
       if (times & 1 == 1) result = s + result;
       times = JS('JSUInt31', '# >>> 1', times);
@@ -391,7 +389,7 @@
     }
     if (pattern is JSSyntaxRegExp) {
       JSSyntaxRegExp re = pattern;
-      Match match = firstMatchAfter(re, this, start);
+      Match? match = firstMatchAfter(re, this, start);
       return (match == null) ? -1 : match.start;
     }
     for (int i = start; i <= this.length; i++) {
@@ -400,7 +398,7 @@
     return -1;
   }
 
-  int lastIndexOf(Pattern pattern, [int start]) {
+  int lastIndexOf(Pattern pattern, [int? start]) {
     checkNull(pattern);
     if (start == null) {
       start = length;
@@ -451,12 +449,12 @@
     // optimizations are smarter.
     int hash = 0;
     for (int i = 0; i < length; i++) {
-      hash = 0x1fffffff & (hash + JS('int', r'#.charCodeAt(#)', this, i));
+      hash = 0x1fffffff & (hash + JS<int>('int', r'#.charCodeAt(#)', this, i));
       hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
       hash = JS('int', '# ^ (# >> 6)', hash, hash);
     }
     hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-    hash = JS('int', '# ^ (# >> 11)', hash, hash);
+    hash = JS<int>('int', '# ^ (# >> 11)', hash, hash);
     return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
   }
 
diff --git a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
index dab8542..70882d8 100644
--- a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
+++ b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.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.6
-
 // Efficient JavaScript based implementation of a linked hash map used as a
 // backing map for constant maps and the [LinkedHashMap] patch
 
@@ -29,8 +27,8 @@
 
   // The keys and values are stored in cells that are linked together
   // to form a double linked list.
-  LinkedHashMapCell _first;
-  LinkedHashMapCell _last;
+  LinkedHashMapCell? _first;
+  LinkedHashMapCell? _last;
 
   // We track the number of modifications done to the key set of the
   // hash map to be able to throw when the map is modified while being
@@ -61,10 +59,10 @@
   }
 
   Iterable<V> get values {
-    return new MappedIterable<K, V>(keys, (each) => this[each]);
+    return new MappedIterable<K, V>(keys, (each) => this[each] as V);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (_isStringKey(key)) {
       var strings = _strings;
       if (strings == null) return false;
@@ -78,14 +76,14 @@
     }
   }
 
-  bool internalContainsKey(Object key) {
+  bool internalContainsKey(Object? key) {
     var rest = _rest;
     if (rest == null) return false;
     var bucket = _getBucket(rest, key);
     return internalFindBucketIndex(bucket, key) >= 0;
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     return keys.any((each) => this[each] == value);
   }
 
@@ -95,23 +93,23 @@
     });
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (_isStringKey(key)) {
       var strings = _strings;
       if (strings == null) return null;
-      LinkedHashMapCell cell = _getTableCell(strings, key);
+      LinkedHashMapCell? cell = _getTableCell(strings, key);
       return JS('', '#', cell == null ? null : cell.hashMapCellValue);
     } else if (_isNumericKey(key)) {
       var nums = _nums;
       if (nums == null) return null;
-      LinkedHashMapCell cell = _getTableCell(nums, key);
+      LinkedHashMapCell? cell = _getTableCell(nums, key);
       return JS('', '#', cell == null ? null : cell.hashMapCellValue);
     } else {
       return internalGet(key);
     }
   }
 
-  V internalGet(Object key) {
+  V? internalGet(Object? key) {
     var rest = _rest;
     if (rest == null) return null;
     var bucket = _getBucket(rest, key);
@@ -156,13 +154,13 @@
   }
 
   V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) return this[key];
+    if (containsKey(key)) return this[key] as V;
     V value = ifAbsent();
     this[key] = value;
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (_isStringKey(key)) {
       return _removeHashTableEntry(_strings, key);
     } else if (_isNumericKey(key)) {
@@ -172,7 +170,7 @@
     }
   }
 
-  V internalRemove(Object key) {
+  V? internalRemove(Object? key) {
     var rest = _rest;
     if (rest == null) return null;
     var hash = internalComputeHashCode(key);
@@ -199,7 +197,7 @@
   }
 
   void forEach(void action(K key, V value)) {
-    LinkedHashMapCell cell = _first;
+    LinkedHashMapCell? cell = _first;
     int modifications = _modifications;
     while (cell != null) {
       K key = JS('', '#', cell.hashMapCellKey);
@@ -213,7 +211,7 @@
   }
 
   void _addHashTableEntry(var table, K key, V value) {
-    LinkedHashMapCell cell = _getTableCell(table, key);
+    LinkedHashMapCell? cell = _getTableCell(table, key);
     if (cell == null) {
       _setTableEntry(table, key, _newLinkedCell(key, value));
     } else {
@@ -221,9 +219,9 @@
     }
   }
 
-  V _removeHashTableEntry(var table, Object key) {
+  V? _removeHashTableEntry(var table, Object? key) {
     if (table == null) return null;
-    LinkedHashMapCell cell = _getTableCell(table, key);
+    LinkedHashMapCell? cell = _getTableCell(table, key);
     if (cell == null) return null;
     _unlinkCell(cell);
     _deleteTableEntry(table, key);
@@ -244,7 +242,7 @@
     if (_first == null) {
       _first = _last = cell;
     } else {
-      LinkedHashMapCell last = _last;
+      LinkedHashMapCell last = _last!;
       cell._previous = last;
       _last = last._next = cell;
     }
@@ -255,8 +253,8 @@
 
   // Unlink the given cell from the linked list of cells.
   void _unlinkCell(LinkedHashMapCell cell) {
-    LinkedHashMapCell previous = cell._previous;
-    LinkedHashMapCell next = cell._next;
+    LinkedHashMapCell? previous = cell._previous;
+    LinkedHashMapCell? next = cell._next;
     if (previous == null) {
       assert(cell == _first);
       _first = next;
@@ -291,7 +289,7 @@
     return JS('int', '# & 0x3ffffff', key.hashCode);
   }
 
-  List<LinkedHashMapCell> _getBucket(var table, var key) {
+  List<LinkedHashMapCell>? _getBucket(var table, var key) {
     var hash = internalComputeHashCode(key);
     return _getTableBucket(table, hash);
   }
@@ -308,11 +306,11 @@
 
   String toString() => MapBase.mapToString(this);
 
-  LinkedHashMapCell _getTableCell(var table, var key) {
+  LinkedHashMapCell? _getTableCell(var table, var key) {
     return JS('var', '#[#]', table, key);
   }
 
-  List<LinkedHashMapCell> _getTableBucket(var table, var key) {
+  List<LinkedHashMapCell>? _getTableBucket(var table, var key) {
     return JS('var', '#[#]', table, key);
   }
 
@@ -326,7 +324,7 @@
   }
 
   bool _containsTableEntry(var table, var key) {
-    LinkedHashMapCell cell = _getTableCell(table, key);
+    LinkedHashMapCell? cell = _getTableCell(table, key);
     return cell != null;
   }
 
@@ -346,12 +344,12 @@
 
 class Es6LinkedHashMap<K, V> extends JsLinkedHashMap<K, V> {
   @override
-  LinkedHashMapCell _getTableCell(var table, var key) {
+  LinkedHashMapCell? _getTableCell(var table, var key) {
     return JS('var', '#.get(#)', table, key);
   }
 
   @override
-  List<LinkedHashMapCell> _getTableBucket(var table, var key) {
+  List<LinkedHashMapCell>? _getTableBucket(var table, var key) {
     return JS('var', '#.get(#)', table, key);
   }
 
@@ -380,8 +378,8 @@
   final dynamic hashMapCellKey;
   dynamic hashMapCellValue;
 
-  LinkedHashMapCell _next;
-  LinkedHashMapCell _previous;
+  LinkedHashMapCell? _next;
+  LinkedHashMapCell? _previous;
 
   LinkedHashMapCell(this.hashMapCellKey, this.hashMapCellValue);
 }
@@ -397,12 +395,12 @@
     return new LinkedHashMapKeyIterator<E>(_map, _map._modifications);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     return _map.containsKey(element);
   }
 
   void forEach(void f(E element)) {
-    LinkedHashMapCell cell = _map._first;
+    LinkedHashMapCell? cell = _map._first;
     int modifications = _map._modifications;
     while (cell != null) {
       f(JS('', '#', cell.hashMapCellKey));
@@ -417,24 +415,26 @@
 class LinkedHashMapKeyIterator<E> implements Iterator<E> {
   final dynamic _map;
   final int _modifications;
-  LinkedHashMapCell _cell;
-  E _current;
+  LinkedHashMapCell? _cell;
+  E? _current;
 
   LinkedHashMapKeyIterator(this._map, this._modifications) {
     _cell = _map._first;
   }
 
-  E get current => _current;
+  E get current => _current as E;
 
   bool moveNext() {
     if (_modifications != _map._modifications) {
       throw new ConcurrentModificationError(_map);
-    } else if (_cell == null) {
+    }
+    var cell = _cell;
+    if (cell == null) {
       _current = null;
       return false;
     } else {
-      _current = JS('', '#', _cell.hashMapCellKey);
-      _cell = _cell._next;
+      _current = JS('', '#', cell.hashMapCellKey);
+      _cell = cell._next;
       return true;
     }
   }
diff --git a/sdk/lib/_internal/js_runtime/lib/math_patch.dart b/sdk/lib/_internal/js_runtime/lib/math_patch.dart
index fc33945..585f4c5 100644
--- a/sdk/lib/_internal/js_runtime/lib/math_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/math_patch.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.6
-
 // Patch file for dart:math library.
 import 'dart:_foreign_helper' show JS;
 import 'dart:_js_helper' show patch, checkNum;
@@ -65,10 +63,10 @@
 
 @patch
 class Random {
-  static Random _secureRandom;
+  static Random? _secureRandom;
 
   @patch
-  factory Random([int seed]) =>
+  factory Random([int? seed]) =>
       (seed == null) ? const _JSRandom() : new _Random(seed);
 
   @patch
@@ -226,7 +224,7 @@
     do {
       _nextState();
       rnd32 = _lo;
-      result = rnd32.remainder(max); // % max;
+      result = rnd32.remainder(max) as int; // % max;
     } while ((rnd32 - result + max) >= _POW2_32);
     return result;
   }
@@ -308,7 +306,7 @@
     }
     _buffer.setUint32(0, 0);
     int start = 4 - byteCount;
-    int randomLimit = pow(256, byteCount);
+    int randomLimit = pow(256, byteCount) as int;
     while (true) {
       _getRandomBytes(start, byteCount);
       // The getUint32 method is big-endian as default.
@@ -317,7 +315,7 @@
         // Max is power of 2.
         return random & (max - 1);
       }
-      int result = random.remainder(max);
+      int result = random.remainder(max) as int;
       // Ensure results have equal probability by rejecting values in the
       // last range of k*max .. 256**byteCount.
       // TODO: Consider picking a higher byte count if the last range is a
diff --git a/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart b/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart
index 4265799..cd961a0 100644
--- a/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart
+++ b/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.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.6
-
 // Patch library for dart:mirrors.
 
 import 'dart:_js_helper' show patch;
diff --git a/sdk/lib/_internal/js_runtime/lib/native_helper.dart b/sdk/lib/_internal/js_runtime/lib/native_helper.dart
index d8d4e1d..f5f40b7 100644
--- a/sdk/lib/_internal/js_runtime/lib/native_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/native_helper.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.6
-
 part of _js_helper;
 
 // TODO(ngeoffray): stop using this method once our optimizers can
@@ -43,19 +41,19 @@
 /// Returns a String tag identifying the type of the native object, or `null`.
 /// The tag is not the name of the type, but usually the name of the JavaScript
 /// constructor function.  Initialized by [initHooks].
-Function getTagFunction;
+Function? getTagFunction;
 
 /// If a lookup via [getTagFunction] on an object [object] that has [tag] fails,
 /// this function is called to provide an alternate tag.  This allows us to fail
 /// gracefully if we can make a good guess, for example, when browsers add novel
 /// kinds of HTMLElement that we have never heard of.  Initialized by
 /// [initHooks].
-Function alternateTagFunction;
+Function? alternateTagFunction;
 
 /// Returns the prototype for the JavaScript constructor named by an input tag.
 /// Returns `null` if there is no such constructor, or if pre-patching of the
 /// constructor is to be avoided.  Initialized by [initHooks].
-Function prototypeForTagFunction;
+Function? prototypeForTagFunction;
 
 String toStringForNativeObject(var obj) {
   // TODO(sra): Is this code dead?
@@ -63,7 +61,7 @@
   // been called via an interceptor and initialized it.
   String name = getTagFunction == null
       ? '<Unknown>'
-      : JS('String', '#', getTagFunction(obj));
+      : JS('String', '#', getTagFunction!(obj));
   return 'Instance of $name';
 }
 
@@ -148,7 +146,7 @@
 @pragma('dart2js:noInline')
 lookupAndCacheInterceptor(obj) {
   assert(!isDartObject(obj));
-  String tag = getTagFunction(obj);
+  String tag = getTagFunction!(obj);
 
   // Fast path for instance (and uncached) tags because the lookup is repeated
   // for each instance (or getInterceptor call).
@@ -161,8 +159,9 @@
   // [initNativeDispatch].
   var interceptorClass = lookupInterceptor(tag);
   if (interceptorClass == null) {
-    tag = alternateTagFunction(obj, tag);
-    if (tag != null) {
+    String? altTag = alternateTagFunction!(obj, tag);
+    if (altTag != null) {
+      tag = altTag;
       // Fast path for instance and uncached tags again.
       record = propertyGet(dispatchRecordsForInstanceTags, tag);
       if (record != null) return patchInstance(obj, record);
@@ -291,7 +290,7 @@
     var fun = JS('=Object', 'function () {}');
     for (int i = 0; i < tags.length; i++) {
       var tag = tags[i];
-      var proto = prototypeForTagFunction(tag);
+      var proto = prototypeForTagFunction!(tag);
       if (proto != null) {
         var interceptorClass = JS('', '#[#]', map, tag);
         var record = makeDefaultDispatchRecord(tag, interceptorClass, proto);
diff --git a/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart b/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
index c9a52ea..39d527b 100644
--- a/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
+++ b/sdk/lib/_internal/js_runtime/lib/native_typed_data.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.6
-
 /// Specialized integers and floating point numbers,
 /// with SIMD support and efficient lists.
 library dart.typed_data.implementation;
@@ -28,73 +26,73 @@
 @Native('ArrayBuffer')
 class NativeByteBuffer implements ByteBuffer {
   @JSName('byteLength')
-  final int lengthInBytes;
+  int get lengthInBytes native;
 
   Type get runtimeType => ByteBuffer;
 
-  Uint8List asUint8List([int offsetInBytes = 0, int length]) {
+  Uint8List asUint8List([int offsetInBytes = 0, int? length]) {
     return NativeUint8List.view(this, offsetInBytes, length);
   }
 
-  Int8List asInt8List([int offsetInBytes = 0, int length]) {
+  Int8List asInt8List([int offsetInBytes = 0, int? length]) {
     return NativeInt8List.view(this, offsetInBytes, length);
   }
 
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int length]) {
+  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) {
     return NativeUint8ClampedList.view(this, offsetInBytes, length);
   }
 
-  Uint16List asUint16List([int offsetInBytes = 0, int length]) {
+  Uint16List asUint16List([int offsetInBytes = 0, int? length]) {
     return NativeUint16List.view(this, offsetInBytes, length);
   }
 
-  Int16List asInt16List([int offsetInBytes = 0, int length]) {
+  Int16List asInt16List([int offsetInBytes = 0, int? length]) {
     return NativeInt16List.view(this, offsetInBytes, length);
   }
 
-  Uint32List asUint32List([int offsetInBytes = 0, int length]) {
+  Uint32List asUint32List([int offsetInBytes = 0, int? length]) {
     return NativeUint32List.view(this, offsetInBytes, length);
   }
 
-  Int32List asInt32List([int offsetInBytes = 0, int length]) {
+  Int32List asInt32List([int offsetInBytes = 0, int? length]) {
     return NativeInt32List.view(this, offsetInBytes, length);
   }
 
-  Uint64List asUint64List([int offsetInBytes = 0, int length]) {
+  Uint64List asUint64List([int offsetInBytes = 0, int? length]) {
     throw UnsupportedError('Uint64List not supported by dart2js.');
   }
 
-  Int64List asInt64List([int offsetInBytes = 0, int length]) {
+  Int64List asInt64List([int offsetInBytes = 0, int? length]) {
     throw UnsupportedError('Int64List not supported by dart2js.');
   }
 
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int length]) {
-    NativeInt32List storage =
+  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) {
+    var storage =
         this.asInt32List(offsetInBytes, length != null ? length * 4 : null);
     return NativeInt32x4List._externalStorage(storage);
   }
 
-  Float32List asFloat32List([int offsetInBytes = 0, int length]) {
+  Float32List asFloat32List([int offsetInBytes = 0, int? length]) {
     return NativeFloat32List.view(this, offsetInBytes, length);
   }
 
-  Float64List asFloat64List([int offsetInBytes = 0, int length]) {
+  Float64List asFloat64List([int offsetInBytes = 0, int? length]) {
     return NativeFloat64List.view(this, offsetInBytes, length);
   }
 
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int length]) {
-    NativeFloat32List storage =
+  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) {
+    var storage =
         this.asFloat32List(offsetInBytes, length != null ? length * 4 : null);
     return NativeFloat32x4List._externalStorage(storage);
   }
 
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int length]) {
-    NativeFloat64List storage =
+  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) {
+    var storage =
         this.asFloat64List(offsetInBytes, length != null ? length * 2 : null);
     return NativeFloat64x2List._externalStorage(storage);
   }
 
-  ByteData asByteData([int offsetInBytes = 0, int length]) {
+  ByteData asByteData([int offsetInBytes = 0, int? length]) {
     return NativeByteData.view(this, offsetInBytes, length);
   }
 }
@@ -105,7 +103,7 @@
 class NativeFloat32x4List extends Object
     with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
     implements Float32x4List {
-  final NativeFloat32List _storage;
+  final Float32List _storage;
 
   /// Creates a [Float32x4List] of the specified length (in elements),
   /// all of whose elements are initially zero.
@@ -164,10 +162,10 @@
     _storage[(index * 4) + 3] = value.w;
   }
 
-  Float32x4List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Float32x4List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     return NativeFloat32x4List._externalStorage(
-        _storage.sublist(start * 4, end * 4));
+        _storage.sublist(start * 4, stop * 4));
   }
 }
 
@@ -236,10 +234,10 @@
     _storage[(index * 4) + 3] = value.w;
   }
 
-  Int32x4List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Int32x4List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     return NativeInt32x4List._externalStorage(
-        _storage.sublist(start * 4, end * 4));
+        _storage.sublist(start * 4, stop * 4));
   }
 }
 
@@ -249,7 +247,7 @@
 class NativeFloat64x2List extends Object
     with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
     implements Float64x2List {
-  final NativeFloat64List _storage;
+  final Float64List _storage;
 
   /// Creates a [Float64x2List] of the specified length (in elements),
   /// all of whose elements are initially zero.
@@ -302,10 +300,10 @@
     _storage[(index * 2) + 1] = value.y;
   }
 
-  Float64x2List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Float64x2List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     return NativeFloat64x2List._externalStorage(
-        _storage.sublist(start * 2, end * 2));
+        _storage.sublist(start * 2, stop * 2));
   }
 }
 
@@ -314,20 +312,20 @@
   /// Returns the byte buffer associated with this object.
   @Creates('NativeByteBuffer')
   @Returns('NativeByteBuffer')
-  final ByteBuffer buffer;
+  ByteBuffer get buffer native;
 
   /// Returns the length of this view, in bytes.
   @JSName('byteLength')
-  final int lengthInBytes;
+  int get lengthInBytes native;
 
   /// Returns the offset in bytes into the underlying byte buffer of this view.
   @JSName('byteOffset')
-  final int offsetInBytes;
+  int get offsetInBytes native;
 
   /// Returns the number of bytes in the representation of each element in this
   /// list.
   @JSName('BYTES_PER_ELEMENT')
-  final int elementSizeInBytes;
+  int get elementSizeInBytes native;
 
   void _invalidPosition(int position, int length, String name) {
     if (position is! int) {
@@ -350,7 +348,8 @@
 // because passing unvalidated values to the native constructors can cause
 // conversions or create views.
 int _checkLength(length) {
-  return length is int ? length : throw ArgumentError('Invalid length $length');
+  if (length is! int) throw ArgumentError('Invalid length $length');
+  return length;
 }
 
 // Validates `.view` constructor arguments.  Checking is necessary because
@@ -364,7 +363,7 @@
   if (offsetInBytes is! int) {
     throw ArgumentError('Invalid view offsetInBytes $offsetInBytes');
   }
-  if (length != null && length is! int) {
+  if (length is! int?) {
     throw ArgumentError('Invalid view length $length');
   }
 }
@@ -373,7 +372,7 @@
 // returns a copy of the list.
 List _ensureNativeList(List list) {
   if (list is JSIndexable) return list;
-  List result = List(list.length);
+  List result = List.filled(list.length, null);
   for (int i = 0; i < list.length; i++) {
     result[i] = list[i];
   }
@@ -397,7 +396,7 @@
   /// if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
   /// the length of [buffer].
   factory NativeByteData.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -418,8 +417,8 @@
       _getFloat32(byteOffset, Endian.little == endian);
 
   @JSName('getFloat32')
-  @Returns('num')
-  num _getFloat32(int byteOffset, [bool littleEndian]) native;
+  @Returns('double')
+  double _getFloat32(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the floating point number represented by the eight bytes at
   /// the specified [byteOffset] in this object, in IEEE 754
@@ -431,8 +430,8 @@
       _getFloat64(byteOffset, Endian.little == endian);
 
   @JSName('getFloat64')
-  @Returns('num')
-  num _getFloat64(int byteOffset, [bool littleEndian]) native;
+  @Returns('double')
+  double _getFloat64(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the (possibly negative) integer represented by the two bytes at
   /// the specified [byteOffset] in this object, in two's complement binary
@@ -447,7 +446,7 @@
 
   @JSName('getInt16')
   @Returns('int')
-  int _getInt16(int byteOffset, [bool littleEndian]) native;
+  int _getInt16(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the (possibly negative) integer represented by the four bytes at
   /// the specified [byteOffset] in this object, in two's complement binary
@@ -462,7 +461,7 @@
 
   @JSName('getInt32')
   @Returns('int')
-  int _getInt32(int byteOffset, [bool littleEndian]) native;
+  int _getInt32(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the (possibly negative) integer represented by the eight bytes at
   /// the specified [byteOffset] in this object, in two's complement binary
@@ -496,7 +495,7 @@
 
   @JSName('getUint16')
   @Returns('JSUInt31')
-  int _getUint16(int byteOffset, [bool littleEndian]) native;
+  int _getUint16(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the positive integer represented by the four bytes starting
   /// at the specified [byteOffset] in this object, in unsigned binary
@@ -510,7 +509,7 @@
 
   @JSName('getUint32')
   @Returns('JSUInt32')
-  int _getUint32(int byteOffset, [bool littleEndian]) native;
+  int _getUint32(int byteOffset, [bool? littleEndian]) native;
 
   /// Returns the positive integer represented by the eight bytes starting
   /// at the specified [byteOffset] in this object, in unsigned binary
@@ -550,7 +549,7 @@
       _setFloat32(byteOffset, value, Endian.little == endian);
 
   @JSName('setFloat32')
-  void _setFloat32(int byteOffset, num value, [bool littleEndian]) native;
+  void _setFloat32(int byteOffset, num value, [bool? littleEndian]) native;
 
   /// Sets the eight bytes starting at the specified [byteOffset] in this
   /// object to the IEEE 754 double-precision binary floating-point
@@ -562,7 +561,7 @@
       _setFloat64(byteOffset, value, Endian.little == endian);
 
   @JSName('setFloat64')
-  void _setFloat64(int byteOffset, num value, [bool littleEndian]) native;
+  void _setFloat64(int byteOffset, num value, [bool? littleEndian]) native;
 
   /// Sets the two bytes starting at the specified [byteOffset] in this
   /// object to the two's complement binary representation of the specified
@@ -575,7 +574,7 @@
       _setInt16(byteOffset, value, Endian.little == endian);
 
   @JSName('setInt16')
-  void _setInt16(int byteOffset, int value, [bool littleEndian]) native;
+  void _setInt16(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the four bytes starting at the specified [byteOffset] in this
   /// object to the two's complement binary representation of the specified
@@ -588,7 +587,7 @@
       _setInt32(byteOffset, value, Endian.little == endian);
 
   @JSName('setInt32')
-  void _setInt32(int byteOffset, int value, [bool littleEndian]) native;
+  void _setInt32(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the eight bytes starting at the specified [byteOffset] in this
   /// object to the two's complement binary representation of the specified
@@ -621,7 +620,7 @@
       _setUint16(byteOffset, value, Endian.little == endian);
 
   @JSName('setUint16')
-  void _setUint16(int byteOffset, int value, [bool littleEndian]) native;
+  void _setUint16(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the four bytes starting at the specified [byteOffset] in this object
   /// to the unsigned binary representation of the specified [value],
@@ -634,7 +633,7 @@
       _setUint32(byteOffset, value, Endian.little == endian);
 
   @JSName('setUint32')
-  void _setUint32(int byteOffset, int value, [bool littleEndian]) native;
+  void _setUint32(int byteOffset, int value, [bool? littleEndian]) native;
 
   /// Sets the eight bytes starting at the specified [byteOffset] in this object
   /// to the unsigned binary representation of the specified [value],
@@ -666,8 +665,8 @@
       JS('NativeByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
 }
 
-abstract class NativeTypedArray extends NativeTypedData
-    implements JavaScriptIndexingBehavior {
+abstract class NativeTypedArray<E> extends NativeTypedData
+    implements JavaScriptIndexingBehavior<E> {
   int get length => JS('JSUInt32', '#.length', this);
 
   void _setRangeFast(
@@ -693,7 +692,7 @@
   }
 }
 
-abstract class NativeTypedArrayOfDouble extends NativeTypedArray
+abstract class NativeTypedArrayOfDouble extends NativeTypedArray<double>
     with ListMixin<double>, FixedLengthListMixin<double> {
   double operator [](int index) {
     _checkValidIndex(index, this, this.length);
@@ -715,7 +714,7 @@
   }
 }
 
-abstract class NativeTypedArrayOfInt extends NativeTypedArray
+abstract class NativeTypedArrayOfInt extends NativeTypedArray<int>
     with ListMixin<int>, FixedLengthListMixin<int>
     implements List<int> {
   // operator[]() is not here since different versions have different return
@@ -745,7 +744,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeFloat32List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -754,9 +753,9 @@
 
   Type get runtimeType => Float32List;
 
-  Float32List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeFloat32List', '#.subarray(#, #)', this, start, end);
+  Float32List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeFloat32List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -779,7 +778,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeFloat64List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -788,9 +787,9 @@
 
   Type get runtimeType => Float64List;
 
-  Float64List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, end);
+  Float64List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -812,7 +811,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeInt16List.view(
-      NativeByteBuffer buffer, int offsetInBytes, int length) {
+      NativeByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -826,9 +825,9 @@
     return JS('int', '#[#]', this, index);
   }
 
-  Int16List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, end);
+  Int16List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -850,7 +849,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeInt32List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -864,9 +863,9 @@
     return JS('int', '#[#]', this, index);
   }
 
-  Int32List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt32List', '#.subarray(#, #)', this, start, end);
+  Int32List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeInt32List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -888,7 +887,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeInt8List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -902,9 +901,9 @@
     return JS('int', '#[#]', this, index);
   }
 
-  Int8List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt8List', '#.subarray(#, #)', this, start, end);
+  Int8List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeInt8List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -914,7 +913,7 @@
   static NativeInt8List _create2(arg1, arg2) =>
       JS('NativeInt8List', 'new Int8Array(#, #)', arg1, arg2);
 
-  static Int8List _create3(arg1, arg2, arg3) =>
+  static NativeInt8List _create3(arg1, arg2, arg3) =>
       JS('NativeInt8List', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
 }
 
@@ -926,7 +925,7 @@
       _create1(_ensureNativeList(list));
 
   factory NativeUint16List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -940,9 +939,9 @@
     return JS('JSUInt31', '#[#]', this, index);
   }
 
-  Uint16List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeUint16List', '#.subarray(#, #)', this, start, end);
+  Uint16List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeUint16List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -964,7 +963,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeUint32List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -978,9 +977,9 @@
     return JS('JSUInt32', '#[#]', this, index);
   }
 
-  Uint32List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeUint32List', '#.subarray(#, #)', this, start, end);
+  Uint32List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeUint32List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -1003,7 +1002,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeUint8ClampedList.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -1019,10 +1018,10 @@
     return JS('JSUInt31', '#[#]', this, index);
   }
 
-  Uint8ClampedList sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
+  Uint8ClampedList sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
     var source =
-        JS('NativeUint8ClampedList', '#.subarray(#, #)', this, start, end);
+        JS('NativeUint8ClampedList', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -1052,7 +1051,7 @@
       _create1(_ensureNativeList(elements));
 
   factory NativeUint8List.view(
-      ByteBuffer buffer, int offsetInBytes, int length) {
+      ByteBuffer buffer, int offsetInBytes, int? length) {
     _checkViewArguments(buffer, offsetInBytes, length);
     return length == null
         ? _create2(buffer, offsetInBytes)
@@ -1068,9 +1067,9 @@
     return JS('JSUInt31', '#[#]', this, index);
   }
 
-  Uint8List sublist(int start, [int end]) {
-    end = _checkValidRange(start, end, this.length);
-    var source = JS('NativeUint8List', '#.subarray(#, #)', this, start, end);
+  Uint8List sublist(int start, [int? end]) {
+    var stop = _checkValidRange(start, end, this.length);
+    var source = JS('NativeUint8List', '#.subarray(#, #)', this, start, stop);
     return _create1(source);
   }
 
@@ -1456,7 +1455,7 @@
     floatList[1] = f.y;
     floatList[2] = f.z;
     floatList[3] = f.w;
-    NativeInt32List view = floatList.buffer.asInt32List();
+    var view = floatList.buffer.asInt32List();
     return NativeInt32x4._truncated(view[0], view[1], view[2], view[3]);
   }
 
@@ -1674,7 +1673,7 @@
   final double y;
 
   static NativeFloat64List _list = NativeFloat64List(2);
-  static NativeUint32List _uint32View = _list.buffer.asUint32List();
+  static Uint32List _uint32View = _list.buffer.asUint32List();
 
   NativeFloat64x2(this.x, this.y) {
     if (x is! num) throw ArgumentError(x);
@@ -1805,7 +1804,7 @@
 ///
 /// Returns the actual value of `end`, which is `length` if `end` is `null`, and
 /// the original value of `end` otherwise.
-int _checkValidRange(int start, int end, int length) {
+int _checkValidRange(int start, int? end, int length) {
   if (_isInvalidArrayIndex(start) || // Ensures start is non-negative int.
       ((end == null)
           ? start > length
diff --git a/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart b/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart
index dc59c10..8eaad60 100644
--- a/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/regexp_helper.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.6
-
 part of _js_helper;
 
 // Helper method used by internal libraries.
@@ -111,8 +109,8 @@
     throw new FormatException('Illegal RegExp pattern ($errorMessage)', source);
   }
 
-  RegExpMatch firstMatch(String string) {
-    List m = JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp,
+  RegExpMatch? firstMatch(String string) {
+    JSArray? m = JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp,
         checkString(string));
     if (m == null) return null;
     return new _MatchImplementation(this, m);
@@ -122,7 +120,7 @@
     return JS('bool', r'#.test(#)', _nativeRegExp, checkString(string));
   }
 
-  String stringMatch(String string) {
+  String? stringMatch(String string) {
     var match = firstMatch(string);
     if (match != null) return match.group(0);
     return null;
@@ -137,18 +135,18 @@
     return new _AllMatchesIterable(this, string, start);
   }
 
-  RegExpMatch _execGlobal(String string, int start) {
+  RegExpMatch? _execGlobal(String string, int start) {
     Object regexp = _nativeGlobalVersion;
     JS('void', '#.lastIndex = #', regexp, start);
-    List match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
+    JSArray? match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
     if (match == null) return null;
     return new _MatchImplementation(this, match);
   }
 
-  RegExpMatch _execAnchored(String string, int start) {
+  RegExpMatch? _execAnchored(String string, int start) {
     Object regexp = _nativeAnchoredVersion;
     JS('void', '#.lastIndex = #', regexp, start);
-    List match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
+    JSArray? match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
     if (match == null) return null;
     // If the last capture group participated, the original regexp did not
     // match at the start position.
@@ -156,7 +154,7 @@
     return new _MatchImplementation(this, match);
   }
 
-  RegExpMatch matchAsPrefix(String string, [int start = 0]) {
+  RegExpMatch? matchAsPrefix(String string, [int start = 0]) {
     if (start < 0 || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
     }
@@ -190,21 +188,20 @@
   int get start =>
       JS('returns:int;depends:none;effects:none;gvn:true', '#.index', _match);
 
-  int get end =>
-      start +
+  int get end => (start +
       JS('returns:int;depends:none;effects:none;gvn:true', '#[0].length',
-          _match);
+          _match)) as int;
 
   // The JS below changes the static type to avoid an implicit cast.
   // TODO(sra): Find a nicer way to do this, e.g. unsafeCast.
-  String group(int index) => JS('String|Null', '#', _match[index]);
+  String? group(int index) => JS('String|Null', '#', _match[index]);
 
-  String operator [](int index) => group(index);
+  String? operator [](int index) => group(index);
 
   int get groupCount => _match.length - 1;
 
-  List<String> groups(List<int> groups) {
-    List<String> out = [];
+  List<String?> groups(List<int> groups) {
+    List<String?> out = [];
     for (int i in groups) {
       out.add(group(i));
     }
@@ -246,13 +243,13 @@
 
 class _AllMatchesIterator implements Iterator<RegExpMatch> {
   final JSSyntaxRegExp _regExp;
-  String _string;
+  String? _string;
   int _nextIndex;
-  RegExpMatch _current;
+  RegExpMatch? _current;
 
   _AllMatchesIterator(this._regExp, this._string, this._nextIndex);
 
-  RegExpMatch get current => _current;
+  RegExpMatch get current => _current!;
 
   static bool _isLeadSurrogate(int c) {
     return c >= 0xd800 && c <= 0xdbff;
@@ -263,9 +260,10 @@
   }
 
   bool moveNext() {
-    if (_string == null) return false;
-    if (_nextIndex <= _string.length) {
-      var match = _regExp._execGlobal(_string, _nextIndex);
+    var string = _string;
+    if (string == null) return false;
+    if (_nextIndex <= string.length) {
+      RegExpMatch? match = _regExp._execGlobal(string, _nextIndex);
       if (match != null) {
         _current = match;
         int nextIndex = match.end;
@@ -274,9 +272,9 @@
           // is in unicode mode and it would put us within a surrogate
           // pair. In that case, advance past the code point as a whole.
           if (_regExp.isUnicode &&
-              _nextIndex + 1 < _string.length &&
-              _isLeadSurrogate(_string.codeUnitAt(_nextIndex)) &&
-              _isTrailSurrogate(_string.codeUnitAt(_nextIndex + 1))) {
+              _nextIndex + 1 < string.length &&
+              _isLeadSurrogate(string.codeUnitAt(_nextIndex)) &&
+              _isTrailSurrogate(string.codeUnitAt(_nextIndex + 1))) {
             nextIndex++;
           }
           nextIndex++;
@@ -292,6 +290,6 @@
 }
 
 /// Find the first match of [regExp] in [string] at or after [start].
-RegExpMatch firstMatchAfter(JSSyntaxRegExp regExp, String string, int start) {
+RegExpMatch? firstMatchAfter(JSSyntaxRegExp regExp, String string, int start) {
   return regExp._execGlobal(string, start);
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/rti.dart b/sdk/lib/_internal/js_runtime/lib/rti.dart
index 1a13a7a..39ec922 100644
--- a/sdk/lib/_internal/js_runtime/lib/rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/rti.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.6
-
 /// This library contains support for runtime type information.
 library rti;
 
@@ -16,6 +14,7 @@
         JS_EMBEDDED_GLOBAL,
         JS_GET_FLAG,
         JS_GET_NAME,
+        JS_STRING_CONCAT,
         RAW_DART_FUNCTION_REF,
         TYPE_REF,
         LEGACY_TYPE_REF;
@@ -37,6 +36,13 @@
 
 import 'dart:_recipe_syntax';
 
+// The top type `Object?` is used throughout this library even when values are
+// not nullable or have narrower types in order to avoid incurring type checks
+// before the type checking infrastructure has been set up.
+// We could use `dynamic`, but this would allow inadvertent implicit downcasts.
+// TODO(fishythefish, dart-lang/language#115): Replace `Object?` with a typedef
+// when possible.
+
 /// An Rti object represents both a type (e.g `Map<int, String>`) and a type
 /// environment (`Map<int, String>` binds `Map.K=int` and `Map.V=String`).
 ///
@@ -53,30 +59,36 @@
   /// JavaScript method for 'as' check. The method is called from generated code,
   /// e.g. `o as T` generates something like `rtiForT._as(o)`.
   @pragma('dart2js:noElision')
-  dynamic _as;
+  Object? _as;
 
   /// JavaScript method for 'is' test.  The method is called from generated
   /// code, e.g. `o is T` generates something like `rtiForT._is(o)`.
   @pragma('dart2js:noElision')
-  dynamic _is;
+  Object? _is;
 
-  static void _setAsCheckFunction(Rti rti, fn) {
+  static void _setAsCheckFunction(Rti rti, Object? fn) {
     rti._as = fn;
   }
 
-  static void _setIsTestFunction(Rti rti, fn) {
+  static void _setIsTestFunction(Rti rti, Object? fn) {
     rti._is = fn;
   }
 
   @pragma('dart2js:tryInline')
-  static bool _isCheck(Rti rti, object) {
+  static bool _asCheck(Rti rti, Object? object) {
+    return JS(
+        'bool', '#.#(#)', rti, JS_GET_NAME(JsGetName.RTI_FIELD_AS), object);
+  }
+
+  @pragma('dart2js:tryInline')
+  static bool _isCheck(Rti rti, Object? object) {
     return JS(
         'bool', '#.#(#)', rti, JS_GET_NAME(JsGetName.RTI_FIELD_IS), object);
   }
 
   /// Method called from generated code to evaluate a type environment recipe in
   /// `this` type environment.
-  Rti _eval(recipe) {
+  Rti _eval(Object? recipe) {
     // TODO(sra): Clone the fast-path of _Universe.evalInEnvironment to here.
     return _rtiEval(this, _Utils.asString(recipe));
   }
@@ -84,12 +96,12 @@
   /// Method called from generated code to extend `this` type environment (an
   /// interface or binding Rti) with function type arguments (a singleton
   /// argument or tuple of arguments).
-  Rti _bind(typeOrTuple) => _rtiBind(this, _castToRti(typeOrTuple));
+  Rti _bind(Object? typeOrTuple) => _rtiBind(this, _Utils.asRti(typeOrTuple));
 
   /// Method called from generated code to extend `this` type (as a singleton
   /// type environment) with function type arguments (a singleton argument or
   /// tuple of arguments).
-  Rti _bind1(Rti typeOrTuple) => _rtiBind1(this, typeOrTuple);
+  Rti _bind1(Object? typeOrTuple) => _rtiBind1(this, _Utils.asRti(typeOrTuple));
 
   // Precomputed derived types. These fields are used to hold derived types that
   // are computed eagerly.
@@ -101,17 +113,17 @@
   /// If kind == kindStar, holds T? where T is the base type.
   /// - This case is lazily initialized during subtype checks.
   @pragma('dart2js:noElision')
-  dynamic _precomputed1;
+  Object? _precomputed1;
 
-  static Object _getPrecomputed1(Rti rti) => rti._precomputed1;
+  static Object? _getPrecomputed1(Rti rti) => rti._precomputed1;
 
-  static void _setPrecomputed1(Rti rti, precomputed) {
+  static void _setPrecomputed1(Rti rti, Object? precomputed) {
     rti._precomputed1 = precomputed;
   }
 
-  static Rti _getQuestionFromStar(universe, Rti rti) {
+  static Rti _getQuestionFromStar(Object? universe, Rti rti) {
     assert(_getKind(rti) == kindStar);
-    Rti question = _castToRtiOrNull(_getPrecomputed1(rti));
+    Rti? question = _Utils.asRtiOrNull(_getPrecomputed1(rti));
     if (question == null) {
       question =
           _Universe._lookupQuestionRti(universe, _getStarArgument(rti), true);
@@ -120,9 +132,9 @@
     return question;
   }
 
-  static Rti _getFutureFromFutureOr(universe, Rti rti) {
+  static Rti _getFutureFromFutureOr(Object? universe, Rti rti) {
     assert(_getKind(rti) == kindFutureOr);
-    Rti future = _castToRtiOrNull(_getPrecomputed1(rti));
+    Rti? future = _Utils.asRtiOrNull(_getPrecomputed1(rti));
     if (future == null) {
       future = _Universe._lookupFutureRti(universe, _getFutureOrArgument(rti));
       Rti._setPrecomputed1(rti, future);
@@ -130,25 +142,25 @@
     return future;
   }
 
-  dynamic _precomputed2;
-  dynamic _precomputed3;
-  dynamic _precomputed4;
+  Object? _precomputed2;
+  Object? _precomputed3;
+  Object? _precomputed4;
 
   // Data value used by some tests.
   @pragma('dart2js:noElision')
-  Object _specializedTestResource;
+  Object? _specializedTestResource;
 
-  static Object _getSpecializedTestResource(Rti rti) {
+  static Object? _getSpecializedTestResource(Rti rti) {
     return rti._specializedTestResource;
   }
 
-  static void _setSpecializedTestResource(Rti rti, Object value) {
+  static void _setSpecializedTestResource(Rti rti, Object? value) {
     rti._specializedTestResource = value;
   }
 
   // The Type object corresponding to this Rti.
-  Object _cachedRuntimeType;
-  static _Type _getCachedRuntimeType(Rti rti) =>
+  Object? _cachedRuntimeType;
+  static _Type? _getCachedRuntimeType(Rti rti) =>
       JS('_Type|Null', '#', rti._cachedRuntimeType);
   static void _setCachedRuntimeType(Rti rti, _Type type) {
     rti._cachedRuntimeType = type;
@@ -160,7 +172,7 @@
   ///
   /// The zero initializer ensures dart2js type analysis considers [_kind] is
   /// non-nullable.
-  Object /*int*/ _kind = 0;
+  Object? /*int*/ _kind = 0;
 
   static int _getKind(Rti rti) => _Utils.asInt(rti._kind);
   static void _setKind(Rti rti, int kind) {
@@ -168,27 +180,27 @@
   }
 
   // Terminal terms.
-  static const kindNever = 1;
-  static const kindDynamic = 2;
-  static const kindVoid = 3; // TODO(sra): Use `dynamic` instead?
-  static const kindAny = 4; // Dart1-style 'dynamic' for JS-interop.
-  static const kindErased = 5;
+  static const int kindNever = 1;
+  static const int kindDynamic = 2;
+  static const int kindVoid = 3; // TODO(sra): Use `dynamic` instead?
+  static const int kindAny = 4; // Dart1-style 'dynamic' for JS-interop.
+  static const int kindErased = 5;
   // Unary terms.
-  static const kindStar = 6;
-  static const kindQuestion = 7;
-  static const kindFutureOr = 8;
+  static const int kindStar = 6;
+  static const int kindQuestion = 7;
+  static const int kindFutureOr = 8;
   // More complex terms.
-  static const kindInterface = 9;
+  static const int kindInterface = 9;
   // A vector of type parameters from enclosing functions and closures.
-  static const kindBinding = 10;
-  static const kindFunction = 11;
-  static const kindGenericFunction = 12;
-  static const kindGenericFunctionParameter = 13;
+  static const int kindBinding = 10;
+  static const int kindFunction = 11;
+  static const int kindGenericFunction = 12;
+  static const int kindGenericFunctionParameter = 13;
 
   static bool _isUnionOfFunctionType(Rti rti) {
     int kind = Rti._getKind(rti);
     if (kind == kindStar || kind == kindQuestion || kind == kindFutureOr) {
-      return _isUnionOfFunctionType(_castToRti(_getPrimary(rti)));
+      return _isUnionOfFunctionType(_Utils.asRti(_getPrimary(rti)));
     }
     return kind == kindFunction || kind == kindGenericFunction;
   }
@@ -202,10 +214,10 @@
   /// - Return type of a function type.
   /// - Underlying function type for a generic function.
   /// - de Bruijn index for a generic function parameter.
-  dynamic _primary;
+  Object? _primary;
 
-  static Object _getPrimary(Rti rti) => rti._primary;
-  static void _setPrimary(Rti rti, value) {
+  static Object? _getPrimary(Rti rti) => rti._primary;
+  static void _setPrimary(Rti rti, Object? value) {
     rti._primary = value;
   }
 
@@ -216,10 +228,10 @@
   ///   kindBinding.
   /// - The [_FunctionParameters] of a function type.
   /// - The type parameter bounds of a generic function.
-  dynamic _rest;
+  Object? _rest;
 
-  static Object _getRest(Rti rti) => rti._rest;
-  static void _setRest(Rti rti, value) {
+  static Object? _getRest(Rti rti) => rti._rest;
+  static void _setRest(Rti rti, Object? value) {
     rti._rest = value;
   }
 
@@ -237,7 +249,7 @@
 
   static Rti _getBindingBase(Rti rti) {
     assert(_getKind(rti) == kindBinding);
-    return _castToRti(_getPrimary(rti));
+    return _Utils.asRti(_getPrimary(rti));
   }
 
   static JSArray _getBindingArguments(Rti rti) {
@@ -247,22 +259,22 @@
 
   static Rti _getStarArgument(Rti rti) {
     assert(_getKind(rti) == kindStar);
-    return _castToRti(_getPrimary(rti));
+    return _Utils.asRti(_getPrimary(rti));
   }
 
   static Rti _getQuestionArgument(Rti rti) {
     assert(_getKind(rti) == kindQuestion);
-    return _castToRti(_getPrimary(rti));
+    return _Utils.asRti(_getPrimary(rti));
   }
 
   static Rti _getFutureOrArgument(Rti rti) {
     assert(_getKind(rti) == kindFutureOr);
-    return _castToRti(_getPrimary(rti));
+    return _Utils.asRti(_getPrimary(rti));
   }
 
   static Rti _getReturnType(Rti rti) {
     assert(_getKind(rti) == kindFunction);
-    return _castToRti(_getPrimary(rti));
+    return _Utils.asRti(_getPrimary(rti));
   }
 
   static _FunctionParameters _getFunctionParameters(Rti rti) {
@@ -272,7 +284,7 @@
 
   static Rti _getGenericFunctionBase(Rti rti) {
     assert(_getKind(rti) == kindGenericFunction);
-    return _castToRti(_getPrimary(rti));
+    return _Utils.asRti(_getPrimary(rti));
   }
 
   static JSArray _getGenericFunctionBounds(Rti rti) {
@@ -294,10 +306,10 @@
   /// type environment. The ambiguity between 'generic class is the environment'
   /// and 'generic class is a singleton type argument' is resolved by using
   /// different indexing in the recipe.
-  Object _evalCache;
+  Object? _evalCache;
 
-  static Object _getEvalCache(Rti rti) => rti._evalCache;
-  static void _setEvalCache(Rti rti, value) {
+  static Object? _getEvalCache(Rti rti) => rti._evalCache;
+  static void _setEvalCache(Rti rti, Object? value) {
     rti._evalCache = value;
   }
 
@@ -314,10 +326,10 @@
   /// On [Rti]s that are generic function types, results of instantiation are
   /// cached on the generic function type to ensure fast repeated
   /// instantiations.
-  Object _bindCache;
+  Object? _bindCache;
 
-  static Object _getBindCache(Rti rti) => rti._bindCache;
-  static void _setBindCache(Rti rti, value) {
+  static Object? _getBindCache(Rti rti) => rti._bindCache;
+  static void _setBindCache(Rti rti, Object? value) {
     rti._bindCache = value;
   }
 
@@ -325,10 +337,10 @@
     return new Rti();
   }
 
-  Object _canonicalRecipe;
+  Object? _canonicalRecipe;
 
   static String _getCanonicalRecipe(Rti rti) {
-    Object s = rti._canonicalRecipe;
+    var s = rti._canonicalRecipe;
     assert(_Utils.isString(s), 'Missing canonical recipe');
     return _Utils.asString(s);
   }
@@ -339,45 +351,43 @@
 }
 
 class _FunctionParameters {
-  // TODO(fishythefish): Support required named parameters.
-
   static _FunctionParameters allocate() => _FunctionParameters();
 
-  Object _requiredPositional;
+  Object? _requiredPositional;
   static JSArray _getRequiredPositional(_FunctionParameters parameters) =>
       JS('JSUnmodifiableArray', '#', parameters._requiredPositional);
   static void _setRequiredPositional(
-      _FunctionParameters parameters, Object requiredPositional) {
+      _FunctionParameters parameters, Object? requiredPositional) {
     parameters._requiredPositional = requiredPositional;
   }
 
-  Object _optionalPositional;
+  Object? _optionalPositional;
   static JSArray _getOptionalPositional(_FunctionParameters parameters) =>
       JS('JSUnmodifiableArray', '#', parameters._optionalPositional);
   static void _setOptionalPositional(
-      _FunctionParameters parameters, Object optionalPositional) {
+      _FunctionParameters parameters, Object? optionalPositional) {
     parameters._optionalPositional = optionalPositional;
   }
 
-  /// These are alternating name/type pairs; that is, the optional named
-  /// parameters of the function
+  /// These are a sequence of name/bool/type triplets that correspond to named
+  /// parameters.
   ///
-  ///   void foo({int bar, double baz})
+  ///   void foo({int bar, required double baz})
   ///
-  /// would be encoded as ["bar", int, "baz", double], where the even indices are
-  /// the name [String]s and the odd indices are the type [Rti]s.
+  /// would be encoded as ["bar", false, int, "baz", true, double], where each
+  /// triplet consists of the name [String], a bool indicating whether or not
+  /// the parameter is required, and the [Rti].
   ///
-  /// Invariant: These pairs are sorted by name in lexicographically ascending order.
-  Object _optionalNamed;
-  static JSArray _getOptionalNamed(_FunctionParameters parameters) =>
-      JS('JSUnmodifiableArray', '#', parameters._optionalNamed);
-  static void _setOptionalNamed(
-      _FunctionParameters parameters, Object optionalNamed) {
-    parameters._optionalNamed = optionalNamed;
+  /// Invariant: These groups are sorted by name in lexicographically ascending order.
+  Object? _named;
+  static JSArray _getNamed(_FunctionParameters parameters) =>
+      JS('JSUnmodifiableArray', '#', parameters._named);
+  static void _setNamed(_FunctionParameters parameters, Object? named) {
+    parameters._named = named;
   }
 }
 
-Object _theUniverse() => JS_EMBEDDED_GLOBAL('', RTI_UNIVERSE);
+Object? _theUniverse() => JS_EMBEDDED_GLOBAL('', RTI_UNIVERSE);
 
 Rti _rtiEval(Rti environment, String recipe) {
   return _Universe.evalInEnvironment(_theUniverse(), environment, recipe);
@@ -406,7 +416,7 @@
 }
 
 /// Evaluate a type recipe in the environment of an instance.
-Rti evalInInstance(instance, String recipe) {
+Rti evalInInstance(Object? instance, String recipe) {
   return _rtiEval(instanceType(instance), recipe);
 }
 
@@ -418,8 +428,8 @@
 ///
 /// Called from generated code.
 @pragma('dart2js:noInline')
-Rti instantiatedGenericFunctionType(
-    Rti genericFunctionRti, Rti instantiationRti) {
+Rti? instantiatedGenericFunctionType(
+    Rti? genericFunctionRti, Rti instantiationRti) {
   // If --lax-runtime-type-to-string is enabled and we never check the function
   // type, then the function won't have a signature, so its RTI will be null. In
   // this case, there is nothing to instantiate, so we return `null` and the
@@ -436,7 +446,7 @@
   }
   String key = Rti._getCanonicalRecipe(instantiationRti);
   var probe = _Utils.mapGet(cache, key);
-  if (probe != null) return _castToRti(probe);
+  if (probe != null) return _Utils.asRti(probe);
   Rti rti = _substitute(_theUniverse(),
       Rti._getGenericFunctionBase(genericFunctionRti), typeArguments, 0);
   _Utils.mapSet(cache, key, rti);
@@ -455,7 +465,7 @@
 /// In order to do a partial substitution - that is, substituting only some
 /// type parameters rather than all of them - we encode the unsubstituted
 /// positions of the argument list as `undefined` or `null`.
-Rti _substitute(universe, Rti rti, Object typeArguments, int depth) {
+Rti _substitute(Object? universe, Rti rti, Object? typeArguments, int depth) {
   int kind = Rti._getKind(rti);
   switch (kind) {
     case Rti.kindErased:
@@ -465,26 +475,26 @@
     case Rti.kindAny:
       return rti;
     case Rti.kindStar:
-      Rti baseType = _castToRti(Rti._getPrimary(rti));
+      Rti baseType = _Utils.asRti(Rti._getPrimary(rti));
       Rti substitutedBaseType =
           _substitute(universe, baseType, typeArguments, depth);
       if (_Utils.isIdentical(substitutedBaseType, baseType)) return rti;
       return _Universe._lookupStarRti(universe, substitutedBaseType, true);
     case Rti.kindQuestion:
-      Rti baseType = _castToRti(Rti._getPrimary(rti));
+      Rti baseType = _Utils.asRti(Rti._getPrimary(rti));
       Rti substitutedBaseType =
           _substitute(universe, baseType, typeArguments, depth);
       if (_Utils.isIdentical(substitutedBaseType, baseType)) return rti;
       return _Universe._lookupQuestionRti(universe, substitutedBaseType, true);
     case Rti.kindFutureOr:
-      Rti baseType = _castToRti(Rti._getPrimary(rti));
+      Rti baseType = _Utils.asRti(Rti._getPrimary(rti));
       Rti substitutedBaseType =
           _substitute(universe, baseType, typeArguments, depth);
       if (_Utils.isIdentical(substitutedBaseType, baseType)) return rti;
       return _Universe._lookupFutureOrRti(universe, substitutedBaseType, true);
     case Rti.kindInterface:
-      Object interfaceTypeArguments = Rti._getInterfaceTypeArguments(rti);
-      Object substitutedInterfaceTypeArguments = _substituteArray(
+      var interfaceTypeArguments = Rti._getInterfaceTypeArguments(rti);
+      var substitutedInterfaceTypeArguments = _substituteArray(
           universe, interfaceTypeArguments, typeArguments, depth);
       if (_Utils.isIdentical(
           substitutedInterfaceTypeArguments, interfaceTypeArguments))
@@ -494,8 +504,8 @@
     case Rti.kindBinding:
       Rti base = Rti._getBindingBase(rti);
       Rti substitutedBase = _substitute(universe, base, typeArguments, depth);
-      Object arguments = Rti._getBindingArguments(rti);
-      Object substitutedArguments =
+      var arguments = Rti._getBindingArguments(rti);
+      var substitutedArguments =
           _substituteArray(universe, arguments, typeArguments, depth);
       if (_Utils.isIdentical(substitutedBase, base) &&
           _Utils.isIdentical(substitutedArguments, arguments)) return rti;
@@ -515,9 +525,9 @@
       return _Universe._lookupFunctionRti(
           universe, substitutedReturnType, substitutedFunctionParameters);
     case Rti.kindGenericFunction:
-      Object bounds = Rti._getGenericFunctionBounds(rti);
+      var bounds = Rti._getGenericFunctionBounds(rti);
       depth += _Utils.arrayLength(bounds);
-      Object substitutedBounds =
+      var substitutedBounds =
           _substituteArray(universe, bounds, typeArguments, depth);
       Rti base = Rti._getGenericFunctionBase(rti);
       Rti substitutedBase = _substitute(universe, base, typeArguments, depth);
@@ -536,19 +546,19 @@
       // positions of the argument list as `undefined` (which will compare equal
       // to `null`).
       if (argument == null) return rti;
-      return _castToRti(argument);
+      return _Utils.asRti(argument);
     default:
       throw AssertionError('Attempted to substitute unexpected RTI kind $kind');
   }
 }
 
-Object _substituteArray(
-    universe, Object rtiArray, Object typeArguments, int depth) {
+Object? _substituteArray(
+    Object? universe, Object? rtiArray, Object? typeArguments, int depth) {
   bool changed = false;
   int length = _Utils.arrayLength(rtiArray);
-  Object result = JS('', '[]');
+  Object? result = JS('', '[]');
   for (int i = 0; i < length; i++) {
-    Rti rti = _castToRti(_Utils.arrayAt(rtiArray, i));
+    Rti rti = _Utils.asRti(_Utils.arrayAt(rtiArray, i));
     Rti substitutedRti = _substitute(universe, rti, typeArguments, depth);
     if (_Utils.isNotIdentical(substitutedRti, rti)) {
       changed = true;
@@ -558,70 +568,69 @@
   return changed ? result : rtiArray;
 }
 
-Object _substituteNamed(
-    universe, Object namedArray, Object typeArguments, int depth) {
+Object? _substituteNamed(
+    Object? universe, Object? namedArray, Object? typeArguments, int depth) {
   bool changed = false;
   int length = _Utils.arrayLength(namedArray);
-  assert(length.isEven);
-  Object result = JS('', '[]');
-  for (int i = 0; i < length; i += 2) {
+  assert(_Utils.isMultipleOf(length, 3));
+  Object? result = JS('', '[]');
+  for (int i = 0; i < length; i += 3) {
     String name = _Utils.asString(_Utils.arrayAt(namedArray, i));
-    Rti rti = _castToRti(_Utils.arrayAt(namedArray, i + 1));
+    bool isRequired = _Utils.asBool(_Utils.arrayAt(namedArray, i + 1));
+    Rti rti = _Utils.asRti(_Utils.arrayAt(namedArray, i + 2));
     Rti substitutedRti = _substitute(universe, rti, typeArguments, depth);
     if (_Utils.isNotIdentical(substitutedRti, rti)) {
       changed = true;
     }
     _Utils.arrayPush(result, name);
+    _Utils.arrayPush(result, isRequired);
     _Utils.arrayPush(result, substitutedRti);
   }
   return changed ? result : namedArray;
 }
 
-// TODO(fishythefish): Support required named parameters.
-_FunctionParameters _substituteFunctionParameters(universe,
-    _FunctionParameters functionParameters, Object typeArguments, int depth) {
-  Object requiredPositional =
+_FunctionParameters _substituteFunctionParameters(Object? universe,
+    _FunctionParameters functionParameters, Object? typeArguments, int depth) {
+  var requiredPositional =
       _FunctionParameters._getRequiredPositional(functionParameters);
-  Object substitutedRequiredPositional =
+  var substitutedRequiredPositional =
       _substituteArray(universe, requiredPositional, typeArguments, depth);
-  Object optionalPositional =
+  var optionalPositional =
       _FunctionParameters._getOptionalPositional(functionParameters);
-  Object substitutedOptionalPositional =
+  var substitutedOptionalPositional =
       _substituteArray(universe, optionalPositional, typeArguments, depth);
-  Object optionalNamed =
-      _FunctionParameters._getOptionalNamed(functionParameters);
-  Object substitutedOptionalNamed =
-      _substituteNamed(universe, optionalNamed, typeArguments, depth);
+  var named = _FunctionParameters._getNamed(functionParameters);
+  var substitutedNamed =
+      _substituteNamed(universe, named, typeArguments, depth);
   if (_Utils.isIdentical(substitutedRequiredPositional, requiredPositional) &&
       _Utils.isIdentical(substitutedOptionalPositional, optionalPositional) &&
-      _Utils.isIdentical(substitutedOptionalNamed, optionalNamed))
-    return functionParameters;
+      _Utils.isIdentical(substitutedNamed, named)) return functionParameters;
   _FunctionParameters result = _FunctionParameters.allocate();
   _FunctionParameters._setRequiredPositional(
       result, substitutedRequiredPositional);
   _FunctionParameters._setOptionalPositional(
       result, substitutedOptionalPositional);
-  _FunctionParameters._setOptionalNamed(result, substitutedOptionalNamed);
+  _FunctionParameters._setNamed(result, substitutedNamed);
   return result;
 }
 
-bool _isDartObject(object) => _Utils.instanceOf(object,
+bool _isDartObject(Object? object) => _Utils.instanceOf(object,
     JS_BUILTIN('depends:none;effects:none;', JsBuiltin.dartObjectConstructor));
 
-bool _isClosure(object) => _Utils.instanceOf(object,
+bool _isClosure(Object? object) => _Utils.instanceOf(object,
     JS_BUILTIN('depends:none;effects:none;', JsBuiltin.dartClosureConstructor));
 
 /// Returns the structural function [Rti] of [closure], or `null`.
 /// [closure] must be a subclass of [Closure].
 /// Called from generated code.
-Rti closureFunctionType(closure) {
+Rti? closureFunctionType(Object? closure) {
   var signatureName = JS_GET_NAME(JsGetName.SIGNATURE_NAME);
   var signature = JS('', '#[#]', closure, signatureName);
   if (signature != null) {
     if (JS('bool', 'typeof # == "number"', signature)) {
       return getTypeFromTypesTable(_Utils.asInt(signature));
     }
-    return _castToRti(JS('', '#[#]()', closure, signatureName));
+    return _Utils.asRti(JS('', '#[#]()', closure, signatureName));
   }
   return null;
 }
@@ -631,13 +640,13 @@
 /// [testRti] to choose the appropriate type.
 ///
 /// Called from generated code.
-Rti instanceOrFunctionType(object, Rti testRti) {
+Rti instanceOrFunctionType(Object? object, Rti testRti) {
   if (Rti._isUnionOfFunctionType(testRti)) {
     if (_isClosure(object)) {
       // If [testRti] is e.g. `FutureOr<Action>` (where `Action` is some
       // function type), we don't need to worry about the `Future<Action>`
       // branch because closures can't be `Future`s.
-      Rti rti = closureFunctionType(object);
+      Rti? rti = closureFunctionType(object);
       if (rti != null) return rti;
     }
   }
@@ -647,7 +656,7 @@
 /// Returns the Rti type of [object].
 /// This is the general entry for obtaining the interface type of any value.
 /// Called from generated code.
-Rti instanceType(object) {
+Rti instanceType(Object? object) {
   // TODO(sra): Add interceptor-based specializations of this method. Inject a
   // _getRti method into (Dart)Object, JSArray, and Interceptor. Then calls to
   // this method can be generated as `getInterceptor(o)._getRti(o)`, allowing
@@ -670,7 +679,7 @@
 
 /// Returns the Rti type of JavaScript Array [object].
 /// Called from generated code.
-Rti _arrayInstanceType(object) {
+Rti _arrayInstanceType(Object? object) {
   // A JavaScript Array can come from three places:
   //   1. This Dart program.
   //   2. Another Dart program loaded in the JavaScript environment.
@@ -691,40 +700,40 @@
   var defaultRti = getJSArrayInteropRti();
 
   // Case 3.
-  if (rti == null) return _castToRti(defaultRti);
+  if (rti == null) return _Utils.asRti(defaultRti);
 
   // Case 2 and perhaps case 3. Check constructor of extracted type against a
   // known instance of Rti - this is an easy way to get the constructor.
   if (JS('bool', '#.constructor !== #.constructor', rti, defaultRti)) {
-    return _castToRti(defaultRti);
+    return _Utils.asRti(defaultRti);
   }
 
   // Case 1.
-  return _castToRti(rti);
+  return _Utils.asRti(rti);
 }
 
 /// Returns the Rti type of user-defined class [object].
 /// [object] must not be an intercepted class or a closure.
 /// Called from generated code.
-Rti _instanceType(object) {
+Rti _instanceType(Object? object) {
   var rti = JS('', r'#[#]', object, JS_GET_NAME(JsGetName.RTI_NAME));
-  return rti != null ? _castToRti(rti) : _instanceTypeFromConstructor(object);
+  return rti != null ? _Utils.asRti(rti) : _instanceTypeFromConstructor(object);
 }
 
-String instanceTypeName(object) {
+String instanceTypeName(Object? object) {
   Rti rti = instanceType(object);
   return _rtiToString(rti, null);
 }
 
-Rti _instanceTypeFromConstructor(instance) {
+Rti _instanceTypeFromConstructor(Object? instance) {
   var constructor = JS('', '#.constructor', instance);
   var probe = JS('', r'#[#]', constructor, CONSTRUCTOR_RTI_CACHE_PROPERTY_NAME);
-  if (probe != null) return _castToRti(probe);
+  if (probe != null) return _Utils.asRti(probe);
   return _instanceTypeFromConstructorMiss(instance, constructor);
 }
 
 @pragma('dart2js:noInline')
-Rti _instanceTypeFromConstructorMiss(instance, constructor) {
+Rti _instanceTypeFromConstructorMiss(Object? instance, Object? constructor) {
   // Subclasses of Closure are synthetic classes. The synthetic classes all
   // extend a 'normal' class (Closure, BoundClosure, StaticClosure), so make
   // them appear to be the superclass. Instantiations have a `$ti` field so
@@ -746,13 +755,12 @@
 
 /// Returns the structural function type of [object], or `null` if the object is
 /// not a closure.
-Rti _instanceFunctionType(object) =>
+Rti? _instanceFunctionType(Object? object) =>
     _isClosure(object) ? closureFunctionType(object) : null;
 
 /// Returns Rti from types table. The types table is initialized with recipe
 /// strings.
-Rti getTypeFromTypesTable(/*int*/ _index) {
-  int index = _Utils.asInt(_index);
+Rti getTypeFromTypesTable(int index) {
   var table = JS_EMBEDDED_GLOBAL('', TYPES);
   var type = _Utils.arrayAt(table, index);
   if (_Utils.isString(type)) {
@@ -760,17 +768,17 @@
     _Utils.arraySetAt(table, index, rti);
     return rti;
   }
-  return _castToRti(type);
+  return _Utils.asRti(type);
 }
 
-Type getRuntimeType(object) {
+Type getRuntimeType(Object? object) {
   Rti rti = _instanceFunctionType(object) ?? instanceType(object);
   return createRuntimeType(rti);
 }
 
 /// Called from generated code.
 Type createRuntimeType(Rti rti) {
-  _Type type = Rti._getCachedRuntimeType(rti);
+  _Type? type = Rti._getCachedRuntimeType(rti);
   if (type != null) return type;
   if (JS_GET_FLAG('PRINT_LEGACY_STARS')) {
     return _Type(rti);
@@ -817,69 +825,139 @@
 // (e.g. we lower a check to a direct helper), and (2) `bool` does not flow to a
 // tested type parameter. The trick will be to ensure that `H._isBool` is
 // generated.
-bool _installSpecializedIsTest(object) {
+bool _installSpecializedIsTest(Object? object) {
   // This static method is installed on an Rti object as a JavaScript instance
   // method. The Rti object is 'this'.
-  Rti testRti = _castToRti(JS('', 'this'));
-
-  var isFn = RAW_DART_FUNCTION_REF(_generalIsTestImplementation);
+  Rti testRti = _Utils.asRti(JS('', 'this'));
 
   if (isObjectType(testRti)) {
-    isFn = RAW_DART_FUNCTION_REF(_isObject);
-    Rti._setAsCheckFunction(testRti, RAW_DART_FUNCTION_REF(_asObject));
-  } else if (isTopType(testRti)) {
-    isFn = RAW_DART_FUNCTION_REF(_isTop);
-    var asFn = RAW_DART_FUNCTION_REF(_asTop);
-    Rti._setAsCheckFunction(testRti, asFn);
-  } else if (_Utils.isIdentical(testRti, TYPE_REF<int>())) {
+    return _finishIsFn(testRti, object, RAW_DART_FUNCTION_REF(_isObject));
+  }
+  if (isTopType(testRti)) {
+    return _finishIsFn(testRti, object, RAW_DART_FUNCTION_REF(_isTop));
+  }
+
+  // `o is T*` generally behaves like `o is T`.
+  // The exeptions are `Object*` (handled above) and `Never*`
+  //
+  //   `null is Never`  --> `false`
+  //   `null is Never*` --> `true`
+  Rti unstarred = Rti._getKind(testRti) == Rti.kindStar
+      ? Rti._getStarArgument(testRti)
+      : testRti;
+
+  var isFn = _simpleSpecializedIsTest(unstarred);
+  if (isFn != null) {
+    return _finishIsFn(testRti, object, isFn);
+  }
+
+  if (Rti._getKind(unstarred) == Rti.kindInterface) {
+    String name = Rti._getInterfaceName(unstarred);
+    var arguments = Rti._getInterfaceTypeArguments(unstarred);
+    // This recognizes interface types instantiated with Top, which includes the
+    // common case of interfaces that have no type parameters.
+    // TODO(sra): Can we easily recognize other interface types instantiated to
+    // bounds?
+    if (JS('bool', '#.every(#)', arguments, RAW_DART_FUNCTION_REF(isTopType))) {
+      String propertyName =
+          '${JS_GET_NAME(JsGetName.OPERATOR_IS_PREFIX)}${name}';
+      Rti._setSpecializedTestResource(testRti, propertyName);
+      return _finishIsFn(
+          testRti, object, RAW_DART_FUNCTION_REF(_isTestViaProperty));
+    }
+    // fall through to general implementation.
+  } else if (Rti._getKind(testRti) == Rti.kindQuestion) {
+    return _finishIsFn(testRti, object,
+        RAW_DART_FUNCTION_REF(_generalNullableIsTestImplementation));
+  }
+  return _finishIsFn(
+      testRti, object, RAW_DART_FUNCTION_REF(_generalIsTestImplementation));
+}
+
+@pragma('dart2js:noInline') // Slightly smaller code.
+bool _finishIsFn(Rti testRti, Object? object, Object? isFn) {
+  Rti._setIsTestFunction(testRti, isFn);
+  return Rti._isCheck(testRti, object);
+}
+
+Object? _simpleSpecializedIsTest(Rti testRti) {
+  // Note: We must not match `Never` below.
+  var isFn = null;
+  if (_Utils.isIdentical(testRti, TYPE_REF<int>())) {
     isFn = RAW_DART_FUNCTION_REF(_isInt);
-  } else if (_Utils.isIdentical(testRti, TYPE_REF<double>())) {
-    isFn = RAW_DART_FUNCTION_REF(_isNum);
-  } else if (_Utils.isIdentical(testRti, TYPE_REF<num>())) {
+  } else if (_Utils.isIdentical(testRti, TYPE_REF<double>()) ||
+      _Utils.isIdentical(testRti, TYPE_REF<num>())) {
     isFn = RAW_DART_FUNCTION_REF(_isNum);
   } else if (_Utils.isIdentical(testRti, TYPE_REF<String>())) {
     isFn = RAW_DART_FUNCTION_REF(_isString);
   } else if (_Utils.isIdentical(testRti, TYPE_REF<bool>())) {
     isFn = RAW_DART_FUNCTION_REF(_isBool);
-  } else if (Rti._getKind(testRti) == Rti.kindInterface) {
-    String name = Rti._getInterfaceName(testRti);
-    var arguments = Rti._getInterfaceTypeArguments(testRti);
-    if (JS('bool', '#.every(#)', arguments, RAW_DART_FUNCTION_REF(isTopType))) {
-      String propertyName =
-          '${JS_GET_NAME(JsGetName.OPERATOR_IS_PREFIX)}${name}';
-      Rti._setSpecializedTestResource(testRti, propertyName);
-      isFn = RAW_DART_FUNCTION_REF(_isTestViaProperty);
+  }
+  return isFn;
+}
+
+/// Called from generated code.
+///
+/// The first time this default `_as` method is called, it replaces itself with
+/// a specialized version.
+bool _installSpecializedAsCheck(Object? object) {
+  // This static method is installed on an Rti object as a JavaScript instance
+  // method. The Rti object is 'this'.
+  Rti testRti = _Utils.asRti(JS('', 'this'));
+
+  var asFn = RAW_DART_FUNCTION_REF(_generalAsCheckImplementation);
+  if (isTopType(testRti)) {
+    asFn = RAW_DART_FUNCTION_REF(_asTop);
+  } else if (isObjectType(testRti)) {
+    asFn = RAW_DART_FUNCTION_REF(_asObject);
+  } else {
+    if (JS_GET_FLAG('LEGACY') || isNullable(testRti)) {
+      asFn = RAW_DART_FUNCTION_REF(_generalNullableAsCheckImplementation);
     }
   }
 
-  Rti._setIsTestFunction(testRti, isFn);
-  return Rti._isCheck(testRti, object);
+  Rti._setAsCheckFunction(testRti, asFn);
+  return Rti._asCheck(testRti, object);
 }
 
 bool _nullIs(Rti testRti) {
   int kind = Rti._getKind(testRti);
   return isTopType(testRti) ||
-      kind == Rti.kindStar &&
-          Rti._getKind(Rti._getStarArgument(testRti)) == Rti.kindNever ||
+      _Utils.isIdentical(testRti, LEGACY_TYPE_REF<Never>()) ||
       kind == Rti.kindQuestion ||
       isNullType(testRti);
 }
 
 /// Called from generated code.
-bool _generalIsTestImplementation(object) {
+bool _generalIsTestImplementation(Object? object) {
   // This static method is installed on an Rti object as a JavaScript instance
   // method. The Rti object is 'this'.
-  Rti testRti = _castToRti(JS('', 'this'));
+  Rti testRti = _Utils.asRti(JS('', 'this'));
   if (object == null) return _nullIs(testRti);
   Rti objectRti = instanceOrFunctionType(object, testRti);
   return isSubtype(_theUniverse(), objectRti, testRti);
 }
 
+/// Specialized test for `x is T1` where `T1` has the form `T2?`.  Test is
+/// compositional, calling `T2._is(object)`, so if `T2` has a specialized
+/// version, the composed test will be fast (but not quite as fast as a
+/// single-step specialization).
+///
 /// Called from generated code.
-bool _isTestViaProperty(object) {
+bool _generalNullableIsTestImplementation(Object? object) {
+  if (object == null) return true;
   // This static method is installed on an Rti object as a JavaScript instance
   // method. The Rti object is 'this'.
-  Rti testRti = _castToRti(JS('', 'this'));
+  Rti testRti = _Utils.asRti(JS('', 'this'));
+  Rti baseRti = Rti._getQuestionArgument(testRti);
+  return Rti._isCheck(baseRti, object);
+}
+
+/// Called from generated code.
+bool _isTestViaProperty(Object? object) {
+  // This static method is installed on an Rti object as a JavaScript instance
+  // method. The Rti object is 'this'.
+  Rti testRti = _Utils.asRti(JS('', 'this'));
   if (object == null) return _nullIs(testRti);
   var tag = Rti._getSpecializedTestResource(testRti);
 
@@ -894,15 +972,31 @@
   return JS('bool', '!!#[#]', interceptor, tag);
 }
 
+/// General unspecialized 'as' check that works for any type.
 /// Called from generated code.
-_generalAsCheckImplementation(object) {
+Object? _generalAsCheckImplementation(Object? object) {
   // This static method is installed on an Rti object as a JavaScript instance
   // method. The Rti object is 'this'.
-  Rti testRti = _castToRti(JS('', 'this'));
+  Rti testRti = _Utils.asRti(JS('', 'this'));
   if (object == null) {
     if (JS_GET_FLAG('LEGACY') || isNullable(testRti)) return object;
   } else if (Rti._isCheck(testRti, object)) return object;
+  _failedAsCheck(object, testRti);
+}
 
+/// General 'as' check for types that accept `null`.
+/// Called from generated code.
+Object? _generalNullableAsCheckImplementation(Object? object) {
+  // This static method is installed on an Rti object as a JavaScript instance
+  // method. The Rti object is 'this'.
+  Rti testRti = _Utils.asRti(JS('', 'this'));
+  if (object == null) {
+    return object;
+  } else if (Rti._isCheck(testRti, object)) return object;
+  _failedAsCheck(object, testRti);
+}
+
+void _failedAsCheck(Object? object, Rti testRti) {
   Rti objectRti = instanceOrFunctionType(object, testRti);
   String message =
       _Error.compose(object, objectRti, _rtiToString(testRti, null));
@@ -910,11 +1004,16 @@
 }
 
 /// Called from generated code.
-checkTypeBound(Rti type, Rti bound, variable, methodName) {
+Rti checkTypeBound(Rti type, Rti bound, String variable, String methodName) {
   if (isSubtype(_theUniverse(), type, bound)) return type;
   String message = "The type argument '${_rtiToString(type, null)}' is not"
       " a subtype of the type variable bound '${_rtiToString(bound, null)}'"
-      " of type variable '${_Utils.asString(variable)}' in '$methodName'.";
+      " of type variable '$variable' in '$methodName'.";
+  throw _TypeError.fromMessage(message);
+}
+
+/// Called from generated code.
+throwTypeError(String message) {
   throw _TypeError.fromMessage(message);
 }
 
@@ -923,7 +1022,8 @@
   final String _message;
   _Error(this._message);
 
-  static String compose(object, objectRti, checkedTypeDescription) {
+  static String compose(
+      Object? object, Rti? objectRti, String checkedTypeDescription) {
     String objectDescription = Error.safeToString(object);
     objectRti ??= instanceType(object);
     String objectTypeDescription = _rtiToString(objectRti, null);
@@ -954,68 +1054,73 @@
 
 /// Specialization for 'is Object'.
 /// Called from generated code via Rti `_is` method.
-bool _isObject(object) {
+bool _isObject(Object? object) {
   return !JS_GET_FLAG('NNBD') || object != null;
 }
 
 /// Specialization for 'as Object'.
 /// Called from generated code via Rti `_as` method.
-dynamic _asObject(object) {
+Object? _asObject(Object? object) {
   if (JS_GET_FLAG('LEGACY') || object != null) return object;
   throw _TypeError.forType(object, 'Object');
 }
 
 /// Specialization for 'is dynamic' and other top types.
 /// Called from generated code via Rti `_is` method.
-bool _isTop(object) {
+bool _isTop(Object? object) {
   return true;
 }
 
 /// Specialization for 'as dynamic' and other top types.
 /// Called from generated code via Rti `_as` methods.
-dynamic _asTop(object) {
+Object? _asTop(Object? object) {
   return object;
 }
 
 /// Specialization for 'is bool'.
 /// Called from generated code.
-bool _isBool(object) {
+bool _isBool(Object? object) {
   return true == object || false == object;
 }
 
-/// Specialization for 'as bool?'.
+// TODO(fishythefish): Change `dynamic` to `Object?` below once promotion works.
+
+/// Specialization for 'as bool'.
 /// Called from generated code.
-bool _asBool(object) {
-  if (_isBool(object)) return _Utils.asBool(object);
+bool _asBool(Object? object) {
+  if (true == object) return true;
+  if (false == object) return false;
   throw _TypeError.forType(object, 'bool');
 }
 
 /// Specialization for 'as bool*'.
 /// Called from generated code.
-bool /*?*/ _asBoolS(object) {
-  if (_isBool(object)) return _Utils.asBool(object);
+bool? _asBoolS(dynamic object) {
+  if (true == object) return true;
+  if (false == object) return false;
   if (object == null) return object;
   throw _TypeError.forType(object, 'bool');
 }
 
 /// Specialization for 'as bool?'.
 /// Called from generated code.
-bool /*?*/ _asBoolQ(object) {
-  if (_isBool(object)) return _Utils.asBool(object);
+bool? _asBoolQ(dynamic object) {
+  if (true == object) return true;
+  if (false == object) return false;
   if (object == null) return object;
   throw _TypeError.forType(object, 'bool?');
 }
 
 /// Specialization for 'as double'.
 /// Called from generated code.
-double /*?*/ _asDouble(object) {
+double _asDouble(Object? object) {
   if (_isNum(object)) return _Utils.asDouble(object);
   throw _TypeError.forType(object, 'double');
 }
 
 /// Specialization for 'as double*'.
 /// Called from generated code.
-double /*?*/ _asDoubleS(object) {
+double? _asDoubleS(dynamic object) {
   if (_isNum(object)) return _Utils.asDouble(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'double');
@@ -1023,7 +1128,7 @@
 
 /// Specialization for 'as double?'.
 /// Called from generated code.
-double /*?*/ _asDoubleQ(object) {
+double? _asDoubleQ(dynamic object) {
   if (_isNum(object)) return _Utils.asDouble(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'double?');
@@ -1031,21 +1136,21 @@
 
 /// Specialization for 'is int'.
 /// Called from generated code.
-bool _isInt(object) {
+bool _isInt(Object? object) {
   return JS('bool', 'typeof # == "number"', object) &&
       JS('bool', 'Math.floor(#) === #', object, object);
 }
 
 /// Specialization for 'as int'.
 /// Called from generated code.
-int _asInt(object) {
+int _asInt(Object? object) {
   if (_isInt(object)) return _Utils.asInt(object);
   throw _TypeError.forType(object, 'int');
 }
 
 /// Specialization for 'as int*'.
 /// Called from generated code.
-int /*?*/ _asIntS(object) {
+int? _asIntS(dynamic object) {
   if (_isInt(object)) return _Utils.asInt(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'int');
@@ -1053,7 +1158,7 @@
 
 /// Specialization for 'as int?'.
 /// Called from generated code.
-int /*?*/ _asIntQ(object) {
+int? _asIntQ(dynamic object) {
   if (_isInt(object)) return _Utils.asInt(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'int?');
@@ -1061,20 +1166,20 @@
 
 /// Specialization for 'is num' and 'is double'.
 /// Called from generated code.
-bool _isNum(object) {
+bool _isNum(Object? object) {
   return JS('bool', 'typeof # == "number"', object);
 }
 
-/// Specialization for 'as num?'.
+/// Specialization for 'as num'.
 /// Called from generated code.
-num _asNum(object) {
+num _asNum(Object? object) {
   if (_isNum(object)) return _Utils.asNum(object);
   throw _TypeError.forType(object, 'num');
 }
 
 /// Specialization for 'as num*'.
 /// Called from generated code.
-num /*?*/ _asNumS(object) {
+num? _asNumS(dynamic object) {
   if (_isNum(object)) return _Utils.asNum(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'num');
@@ -1082,7 +1187,7 @@
 
 /// Specialization for 'as num?'.
 /// Called from generated code.
-num /*?*/ _asNumQ(object) {
+num? _asNumQ(dynamic object) {
   if (_isNum(object)) return _Utils.asNum(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'num?');
@@ -1090,20 +1195,20 @@
 
 /// Specialization for 'is String'.
 /// Called from generated code.
-bool _isString(object) {
+bool _isString(Object? object) {
   return JS('bool', 'typeof # == "string"', object);
 }
 
 /// Specialization for 'as String'.
 /// Called from generated code.
-String _asString(object) {
+String _asString(Object? object) {
   if (_isString(object)) return _Utils.asString(object);
   throw _TypeError.forType(object, 'String');
 }
 
 /// Specialization for 'as String*'.
 /// Called from generated code.
-String /*?*/ _asStringS(object) {
+String? _asStringS(dynamic object) {
   if (_isString(object)) return _Utils.asString(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'String');
@@ -1111,26 +1216,26 @@
 
 /// Specialization for 'as String?'.
 /// Called from generated code.
-String /*?*/ _asStringQ(object) {
+String? _asStringQ(dynamic object) {
   if (_isString(object)) return _Utils.asString(object);
   if (object == null) return object;
   throw _TypeError.forType(object, 'String?');
 }
 
-String _rtiArrayToString(Object array, List<String> genericContext) {
+String _rtiArrayToString(Object? array, List<String>? genericContext) {
   String s = '', sep = '';
   for (int i = 0; i < _Utils.arrayLength(array); i++) {
     s += sep +
-        _rtiToString(_castToRti(_Utils.arrayAt(array, i)), genericContext);
+        _rtiToString(_Utils.asRti(_Utils.arrayAt(array, i)), genericContext);
     sep = ', ';
   }
   return s;
 }
 
-String _functionRtiToString(Rti functionType, List<String> genericContext,
-    {Object bounds = null}) {
+String _functionRtiToString(Rti functionType, List<String>? genericContext,
+    {Object? bounds = null}) {
   String typeParametersText = '';
-  int outerContextLength;
+  int? outerContextLength;
 
   if (bounds != null) {
     int boundsLength = _Utils.arrayLength(bounds);
@@ -1149,7 +1254,7 @@
     for (int i = 0; i < boundsLength; i++) {
       typeParametersText += typeSep;
       typeParametersText += genericContext[genericContext.length - 1 - i];
-      Rti boundRti = _castToRti(_Utils.arrayAt(bounds, i));
+      Rti boundRti = _Utils.asRti(_Utils.arrayAt(bounds, i));
       if (!isTopType(boundRti)) {
         typeParametersText +=
             ' extends ' + _rtiToString(boundRti, genericContext);
@@ -1159,7 +1264,6 @@
     typeParametersText += '>';
   }
 
-  // TODO(fishythefish): Support required named parameters.
   Rti returnType = Rti._getReturnType(functionType);
   _FunctionParameters parameters = Rti._getFunctionParameters(functionType);
   var requiredPositional =
@@ -1168,9 +1272,9 @@
   var optionalPositional =
       _FunctionParameters._getOptionalPositional(parameters);
   int optionalPositionalLength = _Utils.arrayLength(optionalPositional);
-  var optionalNamed = _FunctionParameters._getOptionalNamed(parameters);
-  int optionalNamedLength = _Utils.arrayLength(optionalNamed);
-  assert(optionalPositionalLength == 0 || optionalNamedLength == 0);
+  var named = _FunctionParameters._getNamed(parameters);
+  int namedLength = _Utils.arrayLength(named);
+  assert(optionalPositionalLength == 0 || namedLength == 0);
 
   String returnTypeText = _rtiToString(returnType, genericContext);
 
@@ -1178,8 +1282,8 @@
   String sep = '';
   for (int i = 0; i < requiredPositionalLength; i++) {
     argumentsText += sep +
-        _rtiToString(
-            _castToRti(_Utils.arrayAt(requiredPositional, i)), genericContext);
+        _rtiToString(_Utils.asRti(_Utils.arrayAt(requiredPositional, i)),
+            genericContext);
     sep = ', ';
   }
 
@@ -1188,22 +1292,25 @@
     sep = '';
     for (int i = 0; i < optionalPositionalLength; i++) {
       argumentsText += sep +
-          _rtiToString(_castToRti(_Utils.arrayAt(optionalPositional, i)),
+          _rtiToString(_Utils.asRti(_Utils.arrayAt(optionalPositional, i)),
               genericContext);
       sep = ', ';
     }
     argumentsText += ']';
   }
 
-  if (optionalNamedLength > 0) {
+  if (namedLength > 0) {
     argumentsText += sep + '{';
     sep = '';
-    for (int i = 0; i < optionalNamedLength; i += 2) {
-      argumentsText += sep +
-          _rtiToString(_castToRti(_Utils.arrayAt(optionalNamed, i + 1)),
-              genericContext) +
+    for (int i = 0; i < namedLength; i += 3) {
+      argumentsText += sep;
+      if (_Utils.asBool(_Utils.arrayAt(named, i + 1))) {
+        argumentsText += 'required ';
+      }
+      argumentsText += _rtiToString(
+              _Utils.asRti(_Utils.arrayAt(named, i + 2)), genericContext) +
           ' ' +
-          _Utils.asString(_Utils.arrayAt(optionalNamed, i));
+          _Utils.asString(_Utils.arrayAt(named, i));
       sep = ', ';
     }
     argumentsText += '}';
@@ -1211,7 +1318,7 @@
 
   if (outerContextLength != null) {
     // Pop all of the generic type parameters.
-    JS('', '#.length = #', genericContext, outerContextLength);
+    JS('', '#.length = #', genericContext!, outerContextLength);
   }
 
   // TODO(fishythefish): Below is the same format as the VM. Change to:
@@ -1221,7 +1328,7 @@
   return '${typeParametersText}(${argumentsText}) => ${returnTypeText}';
 }
 
-String _rtiToString(Rti rti, List<String> genericContext) {
+String _rtiToString(Rti rti, List<String>? genericContext) {
   int kind = Rti._getKind(rti);
 
   if (kind == Rti.kindErased) return 'erased';
@@ -1277,36 +1384,36 @@
 
   if (kind == Rti.kindGenericFunction) {
     Rti baseFunctionType = Rti._getGenericFunctionBase(rti);
-    Object bounds = Rti._getGenericFunctionBounds(rti);
+    var bounds = Rti._getGenericFunctionBounds(rti);
     return _functionRtiToString(baseFunctionType, genericContext,
         bounds: bounds);
   }
 
   if (kind == Rti.kindGenericFunctionParameter) {
+    var context = genericContext!;
     int index = Rti._getGenericFunctionParameterIndex(rti);
-    return genericContext[genericContext.length - 1 - index];
+    return context[context.length - 1 - index];
   }
 
   return '?';
 }
 
 String _unminifyOrTag(String rawClassName) {
-  String preserved = unmangleGlobalNameIfPreservedAnyways(rawClassName);
+  String? preserved = unmangleGlobalNameIfPreservedAnyways(rawClassName);
   if (preserved != null) return preserved;
   return JS_GET_FLAG('MINIFIED') ? 'minified:$rawClassName' : rawClassName;
 }
 
-String _rtiArrayToDebugString(Object array) {
+String _rtiArrayToDebugString(Object? array) {
   String s = '[', sep = '';
   for (int i = 0; i < _Utils.arrayLength(array); i++) {
-    s += sep + _rtiToDebugString(_castToRti(_Utils.arrayAt(array, i)));
+    s += sep + _rtiToDebugString(_Utils.asRti(_Utils.arrayAt(array, i)));
     sep = ', ';
   }
   return s + ']';
 }
 
 String functionParametersToString(_FunctionParameters parameters) {
-  // TODO(fishythefish): Support required named parameters.
   String s = '(', sep = '';
   var requiredPositional =
       _FunctionParameters._getRequiredPositional(parameters);
@@ -1314,13 +1421,13 @@
   var optionalPositional =
       _FunctionParameters._getOptionalPositional(parameters);
   int optionalPositionalLength = _Utils.arrayLength(optionalPositional);
-  var optionalNamed = _FunctionParameters._getOptionalNamed(parameters);
-  int optionalNamedLength = _Utils.arrayLength(optionalNamed);
-  assert(optionalPositionalLength == 0 || optionalNamedLength == 0);
+  var named = _FunctionParameters._getNamed(parameters);
+  int namedLength = _Utils.arrayLength(named);
+  assert(optionalPositionalLength == 0 || namedLength == 0);
 
   for (int i = 0; i < requiredPositionalLength; i++) {
     s += sep +
-        _rtiToDebugString(_castToRti(_Utils.arrayAt(requiredPositional, i)));
+        _rtiToDebugString(_Utils.asRti(_Utils.arrayAt(requiredPositional, i)));
     sep = ', ';
   }
 
@@ -1329,20 +1436,24 @@
     sep = '';
     for (int i = 0; i < optionalPositionalLength; i++) {
       s += sep +
-          _rtiToDebugString(_castToRti(_Utils.arrayAt(optionalPositional, i)));
+          _rtiToDebugString(
+              _Utils.asRti(_Utils.arrayAt(optionalPositional, i)));
       sep = ', ';
     }
     s += ']';
   }
 
-  if (optionalNamedLength > 0) {
+  if (namedLength > 0) {
     s += sep + '{';
     sep = '';
-    for (int i = 0; i < optionalNamedLength; i += 2) {
-      s += sep +
-          _rtiToDebugString(_castToRti(_Utils.arrayAt(optionalNamed, i + 1))) +
+    for (int i = 0; i < namedLength; i += 3) {
+      s += sep;
+      if (_Utils.asBool(_Utils.arrayAt(named, i + 1))) {
+        s += 'required ';
+      }
+      s += _rtiToDebugString(_Utils.asRti(_Utils.arrayAt(named, i + 2))) +
           ' ' +
-          _Utils.asString(_Utils.arrayAt(optionalNamed, i));
+          _Utils.asString(_Utils.arrayAt(named, i));
       sep = ', ';
     }
     s += '}';
@@ -1399,7 +1510,7 @@
 
   if (kind == Rti.kindGenericFunction) {
     Rti baseFunctionType = Rti._getGenericFunctionBase(rti);
-    Object bounds = Rti._getGenericFunctionBounds(rti);
+    var bounds = Rti._getGenericFunctionBounds(rti);
     return 'genericFunction(${_rtiToDebugString(baseFunctionType)}, ${_rtiArrayToDebugString(bounds)})';
   }
 
@@ -1444,38 +1555,38 @@
 
   // Field accessors.
 
-  static evalCache(universe) =>
+  static Object evalCache(Object? universe) =>
       JS('', '#.#', universe, RtiUniverseFieldNames.evalCache);
 
-  static Object typeRules(universe) =>
+  static Object typeRules(Object? universe) =>
       JS('', '#.#', universe, RtiUniverseFieldNames.typeRules);
 
-  static Object erasedTypes(universe) =>
+  static Object erasedTypes(Object? universe) =>
       JS('', '#.#', universe, RtiUniverseFieldNames.erasedTypes);
 
-  static Object typeParameterVariances(universe) =>
+  static Object typeParameterVariances(Object? universe) =>
       JS('', '#.#', universe, RtiUniverseFieldNames.typeParameterVariances);
 
-  static Object _findRule(universe, String targetType) =>
+  static Object? _findRule(Object? universe, String targetType) =>
       JS('', '#.#', typeRules(universe), targetType);
 
-  static Object findRule(universe, String targetType) {
-    Object rule = _findRule(universe, targetType);
+  static Object? findRule(Object? universe, String targetType) {
+    var rule = _findRule(universe, targetType);
     while (_Utils.isString(rule)) {
       rule = _findRule(universe, _Utils.asString(rule));
     }
     return rule;
   }
 
-  static Rti findErasedType(universe, String cls) {
-    Object metadata = erasedTypes(universe);
+  static Rti findErasedType(Object? universe, String cls) {
+    var metadata = erasedTypes(universe);
     var probe = JS('', '#.#', metadata, cls);
     if (probe == null) {
       return eval(universe, cls, false);
     } else if (_Utils.isNum(probe)) {
       int length = _Utils.asInt(probe);
       Rti erased = _lookupErasedRti(universe);
-      Object arguments = JS('', '[]');
+      Object? arguments = JS('', '[]');
       for (int i = 0; i < length; i++) {
         _Utils.arrayPush(arguments, erased);
       }
@@ -1483,58 +1594,58 @@
       JS('', '#.# = #', metadata, cls, interface);
       return interface;
     } else {
-      return _castToRti(probe);
+      return _Utils.asRti(probe);
     }
   }
 
-  static Object findTypeParameterVariances(universe, String cls) =>
+  static Object? findTypeParameterVariances(Object? universe, String cls) =>
       JS('', '#.#', typeParameterVariances(universe), cls);
 
-  static void addRules(universe, rules) =>
+  static void addRules(Object? universe, Object? rules) =>
       _Utils.objectAssign(typeRules(universe), rules);
 
-  static void addErasedTypes(universe, types) =>
+  static void addErasedTypes(Object? universe, Object? types) =>
       _Utils.objectAssign(erasedTypes(universe), types);
 
-  static void addTypeParameterVariances(universe, variances) =>
+  static void addTypeParameterVariances(Object? universe, Object? variances) =>
       _Utils.objectAssign(typeParameterVariances(universe), variances);
 
-  static Object sharedEmptyArray(universe) =>
+  static JSArray sharedEmptyArray(Object? universe) =>
       JS('JSArray', '#.#', universe, RtiUniverseFieldNames.sharedEmptyArray);
 
   /// Evaluates [recipe] in the global environment.
-  static Rti eval(Object universe, String recipe, bool normalize) {
+  static Rti eval(Object? universe, String recipe, bool normalize) {
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, recipe);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, recipe);
+    if (probe != null) return _Utils.asRti(probe);
     Rti rti = _parseRecipe(universe, null, recipe, normalize);
-    _cacheSet(cache, recipe, rti);
+    _Utils.mapSet(cache, recipe, rti);
     return rti;
   }
 
   static Rti evalInEnvironment(
-      Object universe, Rti environment, String recipe) {
+      Object? universe, Rti environment, String recipe) {
     var cache = Rti._getEvalCache(environment);
     if (cache == null) {
       cache = JS('', 'new Map()');
       Rti._setEvalCache(environment, cache);
     }
-    var probe = _cacheGet(cache, recipe);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, recipe);
+    if (probe != null) return _Utils.asRti(probe);
     Rti rti = _parseRecipe(universe, environment, recipe, true);
-    _cacheSet(cache, recipe, rti);
+    _Utils.mapSet(cache, recipe, rti);
     return rti;
   }
 
-  static Rti bind(Object universe, Rti environment, Rti argumentsRti) {
+  static Rti bind(Object? universe, Rti environment, Rti argumentsRti) {
     var cache = Rti._getBindCache(environment);
     if (cache == null) {
       cache = JS('', 'new Map()');
       Rti._setBindCache(environment, cache);
     }
     String argumentsRecipe = Rti._getCanonicalRecipe(argumentsRti);
-    var probe = _cacheGet(cache, argumentsRecipe);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, argumentsRecipe);
+    if (probe != null) return _Utils.asRti(probe);
     var argumentsArray;
     if (Rti._getKind(argumentsRti) == Rti.kindBinding) {
       argumentsArray = Rti._getBindingArguments(argumentsRti);
@@ -1542,59 +1653,74 @@
       argumentsArray = JS('', '[#]', argumentsRti);
     }
     Rti rti = _lookupBindingRti(universe, environment, argumentsArray);
-    _cacheSet(cache, argumentsRecipe, rti);
+    _Utils.mapSet(cache, argumentsRecipe, rti);
     return rti;
   }
 
-  static Rti bind1(Object universe, Rti environment, Rti argumentsRti) {
+  static Rti bind1(Object? universe, Rti environment, Rti argumentsRti) {
     throw UnimplementedError('_Universe.bind1');
   }
 
-  static Rti evalTypeVariable(Object universe, Rti environment, String name) {
+  static Rti evalTypeVariable(Object? universe, Rti environment, String name) {
     int kind = Rti._getKind(environment);
     if (kind == Rti.kindBinding) {
       environment = Rti._getBindingBase(environment);
     }
 
     String interfaceName = Rti._getInterfaceName(environment);
-    Object rule = _Universe.findRule(universe, interfaceName);
+    var rule = _Universe.findRule(universe, interfaceName);
     assert(rule != null);
-    String recipe = TypeRule.lookupTypeVariable(rule, name);
+    String? recipe = TypeRule.lookupTypeVariable(rule, name);
     if (recipe == null) {
       throw 'No "$name" in "${Rti._getCanonicalRecipe(environment)}"';
     }
     return _Universe.evalInEnvironment(universe, environment, recipe);
   }
 
-  static _cacheGet(cache, key) => JS('', '#.get(#)', cache, key);
-  static void _cacheSet(cache, key, value) {
-    JS('', '#.set(#, #)', cache, key, value);
-  }
-
   static Rti _parseRecipe(
-      Object universe, Object environment, String recipe, bool normalize) {
-    Object parser = _Parser.create(universe, environment, recipe, normalize);
+      Object? universe, Object? environment, String recipe, bool normalize) {
+    var parser = _Parser.create(universe, environment, recipe, normalize);
     Rti rti = _Parser.parse(parser);
-    if (rti != null) return rti;
-    throw UnimplementedError('_Universe._parseRecipe("$recipe")');
+    return rti;
   }
 
-  static Rti _installTypeTests(Object universe, Rti rti) {
+  static Rti _installTypeTests(Object? universe, Rti rti) {
     // Set up methods to perform type tests. The general as-check methods use
     // the is-test method. The is-test method on first use overwrites itself,
-    // and possibly the as-check method, with a specialized version.
-    var asFn = RAW_DART_FUNCTION_REF(_generalAsCheckImplementation);
+    // and possibly the as-check methods, with a specialized version.
+    var asFn = RAW_DART_FUNCTION_REF(_installSpecializedAsCheck);
     var isFn = RAW_DART_FUNCTION_REF(_installSpecializedIsTest);
     Rti._setAsCheckFunction(rti, asFn);
     Rti._setIsTestFunction(rti, isFn);
     return rti;
   }
 
-  static Rti _installRti(Object universe, String key, Rti rti) {
-    _cacheSet(evalCache(universe), key, rti);
+  static Rti _installRti(Object? universe, String key, Rti rti) {
+    _Utils.mapSet(evalCache(universe), key, rti);
     return rti;
   }
 
+  // These helpers are used for creating canonical recipes. The key feature of
+  // the generated code is that it makes no reference to the constant pool,
+  // which does not exist when the type$ pool is created.
+  //
+  // The strange association is so that usage like
+  //
+  //     s = _recipeJoin3(s, a, b);
+  //
+  // associates as `s+=(a+b)` rather than `s=s+a+b`. As recipe fragments are
+  // small, this tends to create smaller cons-string trees.
+
+  static String _recipeJoin(String s1, String s2) => JS_STRING_CONCAT(s1, s2);
+  static String _recipeJoin3(String s1, String s2, String s3) =>
+      JS_STRING_CONCAT(s1, JS_STRING_CONCAT(s2, s3));
+  static String _recipeJoin4(String s1, String s2, String s3, String s4) =>
+      JS_STRING_CONCAT(s1, JS_STRING_CONCAT(JS_STRING_CONCAT(s2, s3), s4));
+  static String _recipeJoin5(
+          String s1, String s2, String s3, String s4, String s5) =>
+      JS_STRING_CONCAT(s1,
+          JS_STRING_CONCAT(JS_STRING_CONCAT(JS_STRING_CONCAT(s2, s3), s4), s5));
+
   // For each kind of Rti there are three methods:
   //
   // * `lookupXXX` which takes the component parts and returns an existing Rti
@@ -1613,68 +1739,68 @@
   static String _canonicalRecipeOfDynamic() => Recipe.pushDynamicString;
   static String _canonicalRecipeOfVoid() => Recipe.pushVoidString;
   static String _canonicalRecipeOfNever() =>
-      Recipe.pushNeverExtensionString + Recipe.extensionOpString;
+      _recipeJoin(Recipe.pushNeverExtensionString, Recipe.extensionOpString);
   static String _canonicalRecipeOfAny() =>
-      Recipe.pushAnyExtensionString + Recipe.extensionOpString;
+      _recipeJoin(Recipe.pushAnyExtensionString, Recipe.extensionOpString);
 
   static String _canonicalRecipeOfStar(Rti baseType) =>
-      Rti._getCanonicalRecipe(baseType) + Recipe.wrapStarString;
+      _recipeJoin(Rti._getCanonicalRecipe(baseType), Recipe.wrapStarString);
   static String _canonicalRecipeOfQuestion(Rti baseType) =>
-      Rti._getCanonicalRecipe(baseType) + Recipe.wrapQuestionString;
+      _recipeJoin(Rti._getCanonicalRecipe(baseType), Recipe.wrapQuestionString);
   static String _canonicalRecipeOfFutureOr(Rti baseType) =>
-      Rti._getCanonicalRecipe(baseType) + Recipe.wrapFutureOrString;
+      _recipeJoin(Rti._getCanonicalRecipe(baseType), Recipe.wrapFutureOrString);
 
   static String _canonicalRecipeOfGenericFunctionParameter(int index) =>
-      '$index' + Recipe.genericFunctionTypeParameterIndexString;
+      _recipeJoin('$index', Recipe.genericFunctionTypeParameterIndexString);
 
-  static Rti _lookupErasedRti(universe) {
+  static Rti _lookupErasedRti(Object? universe) {
     return _lookupTerminalRti(
         universe, Rti.kindErased, _canonicalRecipeOfErased());
   }
 
-  static Rti _lookupDynamicRti(universe) {
+  static Rti _lookupDynamicRti(Object? universe) {
     return _lookupTerminalRti(
         universe, Rti.kindDynamic, _canonicalRecipeOfDynamic());
   }
 
-  static Rti _lookupVoidRti(universe) {
+  static Rti _lookupVoidRti(Object? universe) {
     return _lookupTerminalRti(universe, Rti.kindVoid, _canonicalRecipeOfVoid());
   }
 
-  static Rti _lookupNeverRti(universe) {
+  static Rti _lookupNeverRti(Object? universe) {
     return _lookupTerminalRti(
         universe, Rti.kindNever, _canonicalRecipeOfNever());
   }
 
-  static Rti _lookupAnyRti(universe) {
+  static Rti _lookupAnyRti(Object? universe) {
     return _lookupTerminalRti(universe, Rti.kindAny, _canonicalRecipeOfAny());
   }
 
-  static Rti _lookupTerminalRti(universe, int kind, String key) {
+  static Rti _lookupTerminalRti(Object? universe, int kind, String key) {
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(universe, key, _createTerminalRti(universe, kind, key));
   }
 
-  static Rti _createTerminalRti(universe, int kind, String key) {
+  static Rti _createTerminalRti(Object? universe, int kind, String key) {
     Rti rti = Rti.allocate();
     Rti._setKind(rti, kind);
     Rti._setCanonicalRecipe(rti, key);
     return _installTypeTests(universe, rti);
   }
 
-  static Rti _lookupStarRti(universe, Rti baseType, bool normalize) {
+  static Rti _lookupStarRti(Object? universe, Rti baseType, bool normalize) {
     String key = _canonicalRecipeOfStar(baseType);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(
         universe, key, _createStarRti(universe, baseType, key, normalize));
   }
 
   static Rti _createStarRti(
-      universe, Rti baseType, String key, bool normalize) {
+      Object? universe, Rti baseType, String key, bool normalize) {
     if (normalize) {
       int baseKind = Rti._getKind(baseType);
       if (isStrongTopType(baseType) ||
@@ -1691,17 +1817,18 @@
     return _installTypeTests(universe, rti);
   }
 
-  static Rti _lookupQuestionRti(universe, Rti baseType, bool normalize) {
+  static Rti _lookupQuestionRti(
+      Object? universe, Rti baseType, bool normalize) {
     String key = _canonicalRecipeOfQuestion(baseType);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(
         universe, key, _createQuestionRti(universe, baseType, key, normalize));
   }
 
   static Rti _createQuestionRti(
-      universe, Rti baseType, String key, bool normalize) {
+      Object? universe, Rti baseType, String key, bool normalize) {
     if (normalize) {
       int baseKind = Rti._getKind(baseType);
       if (isStrongTopType(baseType) ||
@@ -1710,14 +1837,13 @@
           baseKind == Rti.kindFutureOr &&
               isNullable(Rti._getFutureOrArgument(baseType))) {
         return baseType;
-      } else if (baseKind == Rti.kindNever) {
+      } else if (baseKind == Rti.kindNever ||
+          _Utils.isIdentical(baseType, LEGACY_TYPE_REF<Never>())) {
         return TYPE_REF<Null>();
       } else if (baseKind == Rti.kindStar) {
         Rti starArgument = Rti._getStarArgument(baseType);
         int starArgumentKind = Rti._getKind(starArgument);
-        if (starArgumentKind == Rti.kindNever) {
-          return TYPE_REF<Null>();
-        } else if (starArgumentKind == Rti.kindFutureOr &&
+        if (starArgumentKind == Rti.kindFutureOr &&
             isNullable(Rti._getFutureOrArgument(starArgument))) {
           return starArgument;
         } else {
@@ -1732,17 +1858,18 @@
     return _installTypeTests(universe, rti);
   }
 
-  static Rti _lookupFutureOrRti(universe, Rti baseType, bool normalize) {
+  static Rti _lookupFutureOrRti(
+      Object? universe, Rti baseType, bool normalize) {
     String key = _canonicalRecipeOfFutureOr(baseType);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(
         universe, key, _createFutureOrRti(universe, baseType, key, normalize));
   }
 
   static Rti _createFutureOrRti(
-      universe, Rti baseType, String key, bool normalize) {
+      Object? universe, Rti baseType, String key, bool normalize) {
     if (normalize) {
       int baseKind = Rti._getKind(baseType);
       if (isTopType(baseType) || isObjectType(baseType)) {
@@ -1751,7 +1878,7 @@
         return _lookupFutureRti(universe, baseType);
       } else if (isNullType(baseType)) {
         return JS_GET_FLAG('NNBD')
-            ? _lookupQuestionRti(universe, TYPE_REF<Future<Null>>(), false)
+            ? TYPE_REF<Future<Null>?>()
             : TYPE_REF<Future<Null>>();
       }
     }
@@ -1762,17 +1889,17 @@
     return _installTypeTests(universe, rti);
   }
 
-  static Rti _lookupGenericFunctionParameterRti(universe, int index) {
+  static Rti _lookupGenericFunctionParameterRti(Object? universe, int index) {
     String key = _canonicalRecipeOfGenericFunctionParameter(index);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(universe, key,
         _createGenericFunctionParameterRti(universe, index, key));
   }
 
   static Rti _createGenericFunctionParameterRti(
-      universe, int index, String key) {
+      Object? universe, int index, String key) {
     Rti rti = Rti.allocate();
     Rti._setKind(rti, Rti.kindGenericFunctionParameter);
     Rti._setPrimary(rti, index);
@@ -1780,56 +1907,59 @@
     return _installTypeTests(universe, rti);
   }
 
-  static String _canonicalRecipeJoin(Object arguments) {
+  static String _canonicalRecipeJoin(Object? arguments) {
     String s = '', sep = '';
     int length = _Utils.arrayLength(arguments);
     for (int i = 0; i < length; i++) {
-      Rti argument = _castToRti(_Utils.arrayAt(arguments, i));
+      Rti argument = _Utils.asRti(_Utils.arrayAt(arguments, i));
       String subrecipe = Rti._getCanonicalRecipe(argument);
-      s += sep + subrecipe;
+      s = _recipeJoin3(s, sep, subrecipe);
       sep = Recipe.separatorString;
     }
     return s;
   }
 
-  static String _canonicalRecipeJoinNamed(Object arguments) {
+  static String _canonicalRecipeJoinNamed(Object? arguments) {
     String s = '', sep = '';
     int length = _Utils.arrayLength(arguments);
-    assert(length.isEven);
-    for (int i = 0; i < length; i += 2) {
+    assert(_Utils.isMultipleOf(length, 3));
+    for (int i = 0; i < length; i += 3) {
       String name = _Utils.asString(_Utils.arrayAt(arguments, i));
-      Rti type = _castToRti(_Utils.arrayAt(arguments, i + 1));
+      bool isRequired = _Utils.asBool(_Utils.arrayAt(arguments, i + 1));
+      String nameSep = isRequired
+          ? Recipe.requiredNameSeparatorString
+          : Recipe.nameSeparatorString;
+      Rti type = _Utils.asRti(_Utils.arrayAt(arguments, i + 2));
       String subrecipe = Rti._getCanonicalRecipe(type);
-      s += sep + name + Recipe.nameSeparatorString + subrecipe;
+      s = _recipeJoin5(s, sep, name, nameSep, subrecipe);
       sep = Recipe.separatorString;
     }
     return s;
   }
 
-  static String _canonicalRecipeOfInterface(String name, Object arguments) {
+  static String _canonicalRecipeOfInterface(String name, Object? arguments) {
     assert(_Utils.isString(name));
     String s = _Utils.asString(name);
     int length = _Utils.arrayLength(arguments);
     if (length != 0) {
-      s += Recipe.startTypeArgumentsString +
-          _canonicalRecipeJoin(arguments) +
-          Recipe.endTypeArgumentsString;
+      s = _recipeJoin4(s, Recipe.startTypeArgumentsString,
+          _canonicalRecipeJoin(arguments), Recipe.endTypeArgumentsString);
     }
     return s;
   }
 
   static Rti _lookupInterfaceRti(
-      Object universe, String name, Object arguments) {
+      Object? universe, String name, Object? arguments) {
     String key = _canonicalRecipeOfInterface(name, arguments);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(
         universe, key, _createInterfaceRti(universe, name, arguments, key));
   }
 
   static Rti _createInterfaceRti(
-      Object universe, String name, Object typeArguments, String key) {
+      Object? universe, String name, Object? typeArguments, String key) {
     Rti rti = Rti.allocate();
     Rti._setKind(rti, Rti.kindInterface);
     Rti._setPrimary(rti, name);
@@ -1842,25 +1972,24 @@
     return _installTypeTests(universe, rti);
   }
 
-  static Rti _lookupFutureRti(Object universe, Rti base) => _lookupInterfaceRti(
-      universe,
-      JS_GET_NAME(JsGetName.FUTURE_CLASS_TYPE_NAME),
-      JS('', '[#]', base));
+  static Rti _lookupFutureRti(Object? universe, Rti base) =>
+      _lookupInterfaceRti(universe,
+          JS_GET_NAME(JsGetName.FUTURE_CLASS_TYPE_NAME), JS('', '[#]', base));
 
-  static String _canonicalRecipeOfBinding(Rti base, Object arguments) {
-    String s = Rti._getCanonicalRecipe(base);
-    s += Recipe
-        .toTypeString; // TODO(sra): Omit when base encoding is Rti without ToType.
-    s += Recipe.startTypeArgumentsString +
-        _canonicalRecipeJoin(arguments) +
-        Recipe.endTypeArgumentsString;
-    return s;
+  static String _canonicalRecipeOfBinding(Rti base, Object? arguments) {
+    return _recipeJoin5(
+        Rti._getCanonicalRecipe(base),
+        // TODO(sra): Omit when base encoding is Rti without ToType:
+        Recipe.toTypeString,
+        Recipe.startTypeArgumentsString,
+        _canonicalRecipeJoin(arguments),
+        Recipe.endTypeArgumentsString);
   }
 
   /// [arguments] becomes owned by the created Rti.
-  static Rti _lookupBindingRti(Object universe, Rti base, Object arguments) {
+  static Rti _lookupBindingRti(Object? universe, Rti base, Object? arguments) {
     Rti newBase = base;
-    Object newArguments = arguments;
+    var newArguments = arguments;
     if (Rti._getKind(base) == Rti.kindBinding) {
       newBase = Rti._getBindingBase(base);
       newArguments =
@@ -1868,14 +1997,14 @@
     }
     String key = _canonicalRecipeOfBinding(newBase, newArguments);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(
         universe, key, _createBindingRti(universe, newBase, newArguments, key));
   }
 
   static Rti _createBindingRti(
-      Object universe, Rti base, Object arguments, String key) {
+      Object? universe, Rti base, Object? arguments, String key) {
     Rti rti = Rti.allocate();
     Rti._setKind(rti, Rti.kindBinding);
     Rti._setPrimary(rti, base);
@@ -1886,10 +2015,9 @@
 
   static String _canonicalRecipeOfFunction(
           Rti returnType, _FunctionParameters parameters) =>
-      Rti._getCanonicalRecipe(returnType) +
-      _canonicalRecipeOfFunctionParameters(parameters);
+      _recipeJoin(Rti._getCanonicalRecipe(returnType),
+          _canonicalRecipeOfFunctionParameters(parameters));
 
-  // TODO(fishythefish): Support required named parameters.
   static String _canonicalRecipeOfFunctionParameters(
       _FunctionParameters parameters) {
     var requiredPositional =
@@ -1898,43 +2026,43 @@
     var optionalPositional =
         _FunctionParameters._getOptionalPositional(parameters);
     int optionalPositionalLength = _Utils.arrayLength(optionalPositional);
-    var optionalNamed = _FunctionParameters._getOptionalNamed(parameters);
-    int optionalNamedLength = _Utils.arrayLength(optionalNamed);
-    assert(optionalPositionalLength == 0 || optionalNamedLength == 0);
+    var named = _FunctionParameters._getNamed(parameters);
+    int namedLength = _Utils.arrayLength(named);
+    assert(optionalPositionalLength == 0 || namedLength == 0);
 
-    String recipe = Recipe.startFunctionArgumentsString +
-        _canonicalRecipeJoin(requiredPositional);
+    String recipe = _recipeJoin(Recipe.startFunctionArgumentsString,
+        _canonicalRecipeJoin(requiredPositional));
 
     if (optionalPositionalLength > 0) {
       String sep = requiredPositionalLength > 0 ? Recipe.separatorString : '';
-      recipe += sep +
-          Recipe.startOptionalGroupString +
-          _canonicalRecipeJoin(optionalPositional) +
-          Recipe.endOptionalGroupString;
+      recipe = _recipeJoin5(
+          recipe,
+          sep,
+          Recipe.startOptionalGroupString,
+          _canonicalRecipeJoin(optionalPositional),
+          Recipe.endOptionalGroupString);
     }
 
-    if (optionalNamedLength > 0) {
+    if (namedLength > 0) {
       String sep = requiredPositionalLength > 0 ? Recipe.separatorString : '';
-      recipe += sep +
-          Recipe.startNamedGroupString +
-          _canonicalRecipeJoinNamed(optionalNamed) +
-          Recipe.endNamedGroupString;
+      recipe = _recipeJoin5(recipe, sep, Recipe.startNamedGroupString,
+          _canonicalRecipeJoinNamed(named), Recipe.endNamedGroupString);
     }
 
-    return recipe + Recipe.endFunctionArgumentsString;
+    return _recipeJoin(recipe, Recipe.endFunctionArgumentsString);
   }
 
   static Rti _lookupFunctionRti(
-      Object universe, Rti returnType, _FunctionParameters parameters) {
+      Object? universe, Rti returnType, _FunctionParameters parameters) {
     String key = _canonicalRecipeOfFunction(returnType, parameters);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(universe, key,
         _createFunctionRti(universe, returnType, parameters, key));
   }
 
-  static Rti _createFunctionRti(Object universe, Rti returnType,
+  static Rti _createFunctionRti(Object? universe, Rti returnType,
       _FunctionParameters parameters, String key) {
     Rti rti = Rti.allocate();
     Rti._setKind(rti, Rti.kindFunction);
@@ -1945,18 +2073,19 @@
   }
 
   static String _canonicalRecipeOfGenericFunction(
-          Rti baseFunctionType, Object bounds) =>
-      Rti._getCanonicalRecipe(baseFunctionType) +
-      Recipe.startTypeArgumentsString +
-      _canonicalRecipeJoin(bounds) +
-      Recipe.endTypeArgumentsString;
+          Rti baseFunctionType, Object? bounds) =>
+      _recipeJoin4(
+          Rti._getCanonicalRecipe(baseFunctionType),
+          Recipe.startTypeArgumentsString,
+          _canonicalRecipeJoin(bounds),
+          Recipe.endTypeArgumentsString);
 
   static Rti _lookupGenericFunctionRti(
-      Object universe, Rti baseFunctionType, Object bounds, bool normalize) {
+      Object? universe, Rti baseFunctionType, Object? bounds, bool normalize) {
     String key = _canonicalRecipeOfGenericFunction(baseFunctionType, bounds);
     var cache = evalCache(universe);
-    var probe = _cacheGet(cache, key);
-    if (probe != null) return _castToRti(probe);
+    var probe = _Utils.mapGet(cache, key);
+    if (probe != null) return _Utils.asRti(probe);
     return _installRti(
         universe,
         key,
@@ -1964,14 +2093,14 @@
             universe, baseFunctionType, bounds, key, normalize));
   }
 
-  static Rti _createGenericFunctionRti(Object universe, Rti baseFunctionType,
-      Object bounds, String key, bool normalize) {
+  static Rti _createGenericFunctionRti(Object? universe, Rti baseFunctionType,
+      Object? bounds, String key, bool normalize) {
     if (normalize) {
       int length = _Utils.arrayLength(bounds);
       int count = 0;
-      Object typeArguments = JS('', 'new Array(#)', length);
+      Object? typeArguments = JS('', 'new Array(#)', length);
       for (int i = 0; i < length; i++) {
-        Rti bound = _castToRti(_Utils.arrayAt(bounds, i));
+        Rti bound = _Utils.asRti(_Utils.arrayAt(bounds, i));
         if (Rti._getKind(bound) == Rti.kindNever) {
           _Utils.arraySetAt(typeArguments, i, bound);
           count++;
@@ -2121,7 +2250,7 @@
   /// Marked as no-inline so the object literal is not cloned by inlining.
   @pragma('dart2js:noInline')
   static Object create(
-      Object universe, Object environment, String recipe, bool normalize) {
+      Object? universe, Object? environment, String recipe, bool normalize) {
     return JS(
         '',
         '{'
@@ -2139,27 +2268,27 @@
   }
 
   // Field accessors for the parser.
-  static Object universe(Object parser) => JS('', '#.u', parser);
-  static Rti environment(Object parser) => JS('Rti', '#.e', parser);
-  static String recipe(Object parser) => JS('String', '#.r', parser);
-  static Object stack(Object parser) => JS('', '#.s', parser);
-  static int position(Object parser) => JS('int', '#.p', parser);
-  static void setPosition(Object parser, int p) {
+  static Object universe(Object? parser) => JS('', '#.u', parser);
+  static Rti environment(Object? parser) => JS('Rti', '#.e', parser);
+  static String recipe(Object? parser) => JS('String', '#.r', parser);
+  static Object stack(Object? parser) => JS('', '#.s', parser);
+  static int position(Object? parser) => JS('int', '#.p', parser);
+  static void setPosition(Object? parser, int p) {
     JS('', '#.p = #', parser, p);
   }
 
-  static bool normalize(Object parser) => JS('bool', '#.n', parser);
+  static bool normalize(Object? parser) => JS('bool', '#.n', parser);
 
   static int charCodeAt(String s, int i) => JS('int', '#.charCodeAt(#)', s, i);
-  static void push(Object stack, Object value) {
+  static void push(Object? stack, Object? value) {
     JS('', '#.push(#)', stack, value);
   }
 
-  static Object pop(Object stack) => JS('', '#.pop()', stack);
+  static Object? pop(Object? stack) => JS('', '#.pop()', stack);
 
-  static Rti parse(Object parser) {
+  static Rti parse(Object? parser) {
     String source = _Parser.recipe(parser);
-    Object stack = _Parser.stack(parser);
+    var stack = _Parser.stack(parser);
     int i = 0;
     while (i < source.length) {
       int ch = charCodeAt(source, i);
@@ -2176,6 +2305,11 @@
             break;
 
           case Recipe.nameSeparator:
+            push(stack, false);
+            break;
+
+          case Recipe.requiredNameSeparator:
+            push(stack, true);
             break;
 
           case Recipe.toType:
@@ -2213,7 +2347,7 @@
             break;
 
           case Recipe.wrapStar:
-            Object u = universe(parser);
+            var u = universe(parser);
             push(
                 stack,
                 _Universe._lookupStarRti(
@@ -2223,7 +2357,7 @@
             break;
 
           case Recipe.wrapQuestion:
-            Object u = universe(parser);
+            var u = universe(parser);
             push(
                 stack,
                 _Universe._lookupQuestionRti(
@@ -2233,7 +2367,7 @@
             break;
 
           case Recipe.wrapFutureOr:
-            Object u = universe(parser);
+            var u = universe(parser);
             push(
                 stack,
                 _Universe._lookupFutureOrRti(
@@ -2271,16 +2405,16 @@
         }
       }
     }
-    Object item = pop(stack);
+    var item = pop(stack);
     return toType(universe(parser), environment(parser), item);
   }
 
-  static void pushStackFrame(Object parser, Object stack) {
+  static void pushStackFrame(Object? parser, Object? stack) {
     push(stack, position(parser));
     setPosition(parser, _Utils.arrayLength(stack));
   }
 
-  static int handleDigit(int i, int digit, String source, Object stack) {
+  static int handleDigit(int i, int digit, String source, Object? stack) {
     int value = Recipe.digitValue(digit);
     for (; i < source.length; i++) {
       int ch = charCodeAt(source, i);
@@ -2292,7 +2426,7 @@
   }
 
   static int handleIdentifier(
-      Object parser, int start, String source, Object stack, bool hasPeriod) {
+      Object? parser, int start, String source, Object? stack, bool hasPeriod) {
     int i = start + 1;
     for (; i < source.length; i++) {
       int ch = charCodeAt(source, i);
@@ -2317,10 +2451,10 @@
     return i;
   }
 
-  static void handleTypeArguments(Object parser, Object stack) {
-    Object universe = _Parser.universe(parser);
-    Object arguments = collectArray(parser, stack);
-    Object head = pop(stack);
+  static void handleTypeArguments(Object? parser, Object? stack) {
+    var universe = _Parser.universe(parser);
+    var arguments = collectArray(parser, stack);
+    var head = pop(stack);
     if (_Utils.isString(head)) {
       String name = _Utils.asString(head);
       push(stack, _Universe._lookupInterfaceRti(universe, name, arguments));
@@ -2342,15 +2476,15 @@
   }
 
   static const int optionalPositionalSentinel = -1;
-  static const int optionalNamedSentinel = -2;
+  static const int namedSentinel = -2;
 
-  static void handleFunctionArguments(Object parser, Object stack) {
-    Object universe = _Parser.universe(parser);
+  static void handleFunctionArguments(Object? parser, Object? stack) {
+    var universe = _Parser.universe(parser);
     _FunctionParameters parameters = _FunctionParameters.allocate();
-    var optionalPositional = _Universe.sharedEmptyArray(universe);
-    var optionalNamed = _Universe.sharedEmptyArray(universe);
+    Object? optionalPositional = _Universe.sharedEmptyArray(universe);
+    Object? named = _Universe.sharedEmptyArray(universe);
 
-    Object head = pop(stack);
+    var head = pop(stack);
     if (_Utils.isNum(head)) {
       int sentinel = _Utils.asInt(head);
       switch (sentinel) {
@@ -2358,8 +2492,8 @@
           optionalPositional = pop(stack);
           break;
 
-        case optionalNamedSentinel:
-          optionalNamed = pop(stack);
+        case namedSentinel:
+          named = pop(stack);
           break;
 
         default:
@@ -2373,25 +2507,25 @@
     _FunctionParameters._setRequiredPositional(
         parameters, collectArray(parser, stack));
     _FunctionParameters._setOptionalPositional(parameters, optionalPositional);
-    _FunctionParameters._setOptionalNamed(parameters, optionalNamed);
+    _FunctionParameters._setNamed(parameters, named);
     Rti returnType = toType(universe, environment(parser), pop(stack));
     push(stack, _Universe._lookupFunctionRti(universe, returnType, parameters));
   }
 
-  static void handleOptionalGroup(Object parser, Object stack) {
-    Object parameters = collectArray(parser, stack);
+  static void handleOptionalGroup(Object? parser, Object? stack) {
+    var parameters = collectArray(parser, stack);
     push(stack, parameters);
     push(stack, optionalPositionalSentinel);
   }
 
-  static void handleNamedGroup(Object parser, Object stack) {
-    Object parameters = collectNamed(parser, stack);
+  static void handleNamedGroup(Object? parser, Object? stack) {
+    var parameters = collectNamed(parser, stack);
     push(stack, parameters);
-    push(stack, optionalNamedSentinel);
+    push(stack, namedSentinel);
   }
 
-  static void handleExtendedOperations(Object parser, Object stack) {
-    Object top = pop(stack);
+  static void handleExtendedOperations(Object? parser, Object? stack) {
+    var top = pop(stack);
     if (0 == top) {
       push(stack, _Universe._lookupNeverRti(universe(parser)));
       return;
@@ -2403,14 +2537,14 @@
     throw AssertionError('Unexpected extended operation $top');
   }
 
-  static Object collectArray(Object parser, Object stack) {
+  static JSArray collectArray(Object? parser, Object? stack) {
     var array = _Utils.arraySplice(stack, position(parser));
     toTypes(_Parser.universe(parser), environment(parser), array);
     setPosition(parser, _Utils.asInt(pop(stack)));
     return array;
   }
 
-  static Object collectNamed(Object parser, Object stack) {
+  static JSArray collectNamed(Object? parser, Object? stack) {
     var array = _Utils.arraySplice(stack, position(parser));
     toTypesNamed(_Parser.universe(parser), environment(parser), array);
     setPosition(parser, _Utils.asInt(pop(stack)));
@@ -2419,7 +2553,7 @@
 
   /// Coerce a stack item into an Rti object. Strings are converted to interface
   /// types, integers are looked up in the type environment.
-  static Rti toType(Object universe, Rti environment, Object item) {
+  static Rti toType(Object? universe, Rti environment, Object? item) {
     if (_Utils.isString(item)) {
       String name = _Utils.asString(item);
       return _Universe._lookupInterfaceRti(
@@ -2427,11 +2561,11 @@
     } else if (_Utils.isNum(item)) {
       return _Parser.indexToType(universe, environment, _Utils.asInt(item));
     } else {
-      return _castToRti(item);
+      return _Utils.asRti(item);
     }
   }
 
-  static void toTypes(Object universe, Rti environment, Object items) {
+  static void toTypes(Object? universe, Rti environment, Object? items) {
     int length = _Utils.arrayLength(items);
     for (int i = 0; i < length; i++) {
       var item = _Utils.arrayAt(items, i);
@@ -2440,24 +2574,24 @@
     }
   }
 
-  static void toTypesNamed(Object universe, Rti environment, Object items) {
+  static void toTypesNamed(Object? universe, Rti environment, Object? items) {
     int length = _Utils.arrayLength(items);
-    assert(length.isEven);
-    for (int i = 1; i < length; i += 2) {
+    assert(_Utils.isMultipleOf(length, 3));
+    for (int i = 2; i < length; i += 3) {
       var item = _Utils.arrayAt(items, i);
       Rti type = toType(universe, environment, item);
       _Utils.arraySetAt(items, i, type);
     }
   }
 
-  static Rti indexToType(Object universe, Rti environment, int index) {
+  static Rti indexToType(Object? universe, Rti environment, int index) {
     int kind = Rti._getKind(environment);
     if (kind == Rti.kindBinding) {
       if (index == 0) return Rti._getBindingBase(environment);
       var typeArguments = Rti._getBindingArguments(environment);
       int len = _Utils.arrayLength(typeArguments);
       if (index <= len) {
-        return _castToRti(_Utils.arrayAt(typeArguments, index - 1));
+        return _Utils.asRti(_Utils.arrayAt(typeArguments, index - 1));
       }
       // Is index into interface Rti in base.
       index -= len;
@@ -2472,12 +2606,12 @@
     var typeArguments = Rti._getInterfaceTypeArguments(environment);
     int len = _Utils.arrayLength(typeArguments);
     if (index <= len) {
-      return _castToRti(_Utils.arrayAt(typeArguments, index - 1));
+      return _Utils.asRti(_Utils.arrayAt(typeArguments, index - 1));
     }
     throw AssertionError('Bad index $index for $environment');
   }
 
-  static Rti toGenericFunctionParameter(Object universe, Object item) {
+  static Rti toGenericFunctionParameter(Object? universe, Object? item) {
     assert(_Utils.isNum(item));
     return _Universe._lookupGenericFunctionParameterRti(
         universe, _Utils.asInt(item));
@@ -2491,26 +2625,26 @@
     throw UnimplementedError("TypeRule is static methods only.");
   }
 
-  static String lookupTypeVariable(rule, String typeVariable) =>
+  static String? lookupTypeVariable(Object? rule, String typeVariable) =>
       JS('', '#.#', rule, typeVariable);
 
-  static JSArray lookupSupertype(rule, String supertype) =>
+  static JSArray? lookupSupertype(Object? rule, String supertype) =>
       JS('', '#.#', rule, supertype);
 }
 
 // This needs to be kept in sync with `Variance` in `entities.dart`.
 class Variance {
   // TODO(fishythefish): Try bitmask representation.
-  static const legacyCovariant = 0;
-  static const covariant = 1;
-  static const contravariant = 2;
-  static const invariant = 3;
+  static const int legacyCovariant = 0;
+  static const int covariant = 1;
+  static const int contravariant = 2;
+  static const int invariant = 3;
 }
 
 // -------- Subtype tests ------------------------------------------------------
 
 // Future entry point from compiled code.
-bool isSubtype(universe, Rti s, Rti t) {
+bool isSubtype(Object? universe, Rti s, Rti t) {
   return _isSubtype(universe, s, null, t, null);
 }
 
@@ -2537,7 +2671,7 @@
 /// the bottom of the type hierarchy, `Object` is treated as nullable, and
 /// `required` is ignored on named parameters. This should provide the same
 /// subtyping results as pre-NNBD Dart.
-bool _isSubtype(universe, Rti s, sEnv, Rti t, tEnv) {
+bool _isSubtype(Object? universe, Rti s, Object? sEnv, Rti t, Object? tEnv) {
   bool isLegacy = JS_GET_FLAG('LEGACY');
 
   // Reflexivity:
@@ -2559,7 +2693,7 @@
   bool leftTypeVariable = sKind == Rti.kindGenericFunctionParameter;
   if (leftTypeVariable) {
     int index = Rti._getGenericFunctionParameterIndex(s);
-    Rti bound = _castToRti(_Utils.arrayAt(sEnv, index));
+    Rti bound = _Utils.asRti(_Utils.arrayAt(sEnv, index));
     if (_isSubtype(universe, bound, sEnv, t, tEnv)) return true;
   }
 
@@ -2668,8 +2802,8 @@
     tEnv = tEnv == null ? tBounds : _Utils.arrayConcat(tBounds, tEnv);
 
     for (int i = 0; i < sLength; i++) {
-      var sBound = _Utils.arrayAt(sBounds, i);
-      var tBound = _Utils.arrayAt(tBounds, i);
+      var sBound = _Utils.asRti(_Utils.arrayAt(sBounds, i));
+      var tBound = _Utils.asRti(_Utils.arrayAt(tBounds, i));
       if (!_isSubtype(universe, sBound, sEnv, tBound, tEnv) ||
           !_isSubtype(universe, tBound, tEnv, sBound, sEnv)) {
         return false;
@@ -2694,8 +2828,8 @@
   return false;
 }
 
-// TODO(fishythefish): Support required named parameters.
-bool _isFunctionSubtype(universe, Rti s, sEnv, Rti t, tEnv) {
+bool _isFunctionSubtype(
+    Object? universe, Rti s, Object? sEnv, Rti t, Object? tEnv) {
   assert(Rti._getKind(s) == Rti.kindFunction);
   assert(Rti._getKind(t) == Rti.kindFunction);
 
@@ -2728,16 +2862,16 @@
       tRequiredPositionalLength + tOptionalPositionalLength) return false;
 
   for (int i = 0; i < sRequiredPositionalLength; i++) {
-    Rti sParameter = _castToRti(_Utils.arrayAt(sRequiredPositional, i));
-    Rti tParameter = _castToRti(_Utils.arrayAt(tRequiredPositional, i));
+    Rti sParameter = _Utils.asRti(_Utils.arrayAt(sRequiredPositional, i));
+    Rti tParameter = _Utils.asRti(_Utils.arrayAt(tRequiredPositional, i));
     if (!_isSubtype(universe, tParameter, tEnv, sParameter, sEnv)) {
       return false;
     }
   }
 
   for (int i = 0; i < requiredPositionalDelta; i++) {
-    Rti sParameter = _castToRti(_Utils.arrayAt(sOptionalPositional, i));
-    Rti tParameter = _castToRti(
+    Rti sParameter = _Utils.asRti(_Utils.arrayAt(sOptionalPositional, i));
+    Rti tParameter = _Utils.asRti(
         _Utils.arrayAt(tRequiredPositional, sRequiredPositionalLength + i));
     if (!_isSubtype(universe, tParameter, tEnv, sParameter, sEnv)) {
       return false;
@@ -2745,37 +2879,49 @@
   }
 
   for (int i = 0; i < tOptionalPositionalLength; i++) {
-    Rti sParameter = _castToRti(
+    Rti sParameter = _Utils.asRti(
         _Utils.arrayAt(sOptionalPositional, requiredPositionalDelta + i));
-    Rti tParameter = _castToRti(_Utils.arrayAt(tOptionalPositional, i));
+    Rti tParameter = _Utils.asRti(_Utils.arrayAt(tOptionalPositional, i));
     if (!_isSubtype(universe, tParameter, tEnv, sParameter, sEnv)) {
       return false;
     }
   }
 
-  var sOptionalNamed = _FunctionParameters._getOptionalNamed(sParameters);
-  var tOptionalNamed = _FunctionParameters._getOptionalNamed(tParameters);
-  int sOptionalNamedLength = _Utils.arrayLength(sOptionalNamed);
-  int tOptionalNamedLength = _Utils.arrayLength(tOptionalNamed);
+  var sNamed = _FunctionParameters._getNamed(sParameters);
+  var tNamed = _FunctionParameters._getNamed(tParameters);
+  int sNamedLength = _Utils.arrayLength(sNamed);
+  int tNamedLength = _Utils.arrayLength(tNamed);
 
-  for (int i = 0, j = 0; j < tOptionalNamedLength; j += 2) {
-    String sName;
-    String tName = _Utils.asString(_Utils.arrayAt(tOptionalNamed, j));
-    do {
-      if (i >= sOptionalNamedLength) return false;
-      sName = _Utils.asString(_Utils.arrayAt(sOptionalNamed, i));
-      i += 2;
-    } while (_Utils.stringLessThan(sName, tName));
-    if (_Utils.stringLessThan(tName, sName)) return false;
-    Rti sType = _castToRti(_Utils.arrayAt(sOptionalNamed, i - 1));
-    Rti tType = _castToRti(_Utils.arrayAt(tOptionalNamed, j + 1));
-    if (!_isSubtype(universe, tType, tEnv, sType, sEnv)) return false;
+  int sIndex = 0;
+  for (int tIndex = 0; tIndex < tNamedLength; tIndex += 3) {
+    String tName = _Utils.asString(_Utils.arrayAt(tNamed, tIndex));
+    while (true) {
+      if (sIndex >= sNamedLength) return false;
+      String sName = _Utils.asString(_Utils.arrayAt(sNamed, sIndex));
+      sIndex += 3;
+      if (_Utils.stringLessThan(tName, sName)) return false;
+      bool sIsRequired = _Utils.asBool(_Utils.arrayAt(sNamed, sIndex - 2));
+      if (_Utils.stringLessThan(sName, tName)) {
+        if (sIsRequired) return false;
+        continue;
+      }
+      bool tIsRequired = _Utils.asBool(_Utils.arrayAt(tNamed, tIndex + 1));
+      if (sIsRequired && !tIsRequired) return false;
+      Rti sType = _Utils.asRti(_Utils.arrayAt(sNamed, sIndex - 1));
+      Rti tType = _Utils.asRti(_Utils.arrayAt(tNamed, tIndex + 2));
+      if (!_isSubtype(universe, tType, tEnv, sType, sEnv)) return false;
+      break;
+    }
   }
-
+  while (sIndex < sNamedLength) {
+    if (_Utils.asBool(_Utils.arrayAt(sNamed, sIndex + 1))) return false;
+    sIndex += 3;
+  }
   return true;
 }
 
-bool _isInterfaceSubtype(universe, Rti s, sEnv, Rti t, tEnv) {
+bool _isInterfaceSubtype(
+    Object? universe, Rti s, Object? sEnv, Rti t, Object? tEnv) {
   String sName = Rti._getInterfaceName(s);
   String tName = Rti._getInterfaceName(t);
 
@@ -2787,7 +2933,7 @@
     assert(length == _Utils.arrayLength(tArgs));
 
     var sVariances;
-    bool hasVariances;
+    bool? hasVariances;
     if (JS_GET_FLAG("VARIANCE")) {
       sVariances = _Universe.findTypeParameterVariances(universe, sName);
       hasVariances = sVariances != null;
@@ -2795,10 +2941,10 @@
     }
 
     for (int i = 0; i < length; i++) {
-      Rti sArg = _castToRti(_Utils.arrayAt(sArgs, i));
-      Rti tArg = _castToRti(_Utils.arrayAt(tArgs, i));
+      Rti sArg = _Utils.asRti(_Utils.arrayAt(sArgs, i));
+      Rti tArg = _Utils.asRti(_Utils.arrayAt(tArgs, i));
       if (JS_GET_FLAG("VARIANCE")) {
-        int sVariance = hasVariances
+        int sVariance = hasVariances != null
             ? _Utils.asInt(_Utils.arrayAt(sVariances, i))
             : Variance.legacyCovariant;
         switch (sVariance) {
@@ -2846,7 +2992,7 @@
   // We don't list Object explicitly as a supertype of each interface, so check
   // this trivial case first.
   if (isObjectType(t)) return true;
-  Object rule = _Universe.findRule(universe, sName);
+  var rule = _Universe.findRule(universe, sName);
   if (rule == null) return false;
   var supertypeArgs = TypeRule.lookupSupertype(rule, tName);
   if (supertypeArgs == null) return false;
@@ -2856,7 +3002,7 @@
   for (int i = 0; i < length; i++) {
     String recipe = _Utils.asString(_Utils.arrayAt(supertypeArgs, i));
     Rti supertypeArg = _Universe.evalInEnvironment(universe, s, recipe);
-    Rti tArg = _castToRti(_Utils.arrayAt(tArgs, i));
+    Rti tArg = _Utils.asRti(_Utils.arrayAt(tArgs, i));
     if (!_isSubtype(universe, supertypeArg, sEnv, tArg, tEnv)) {
       return false;
     }
@@ -2873,6 +3019,7 @@
       kind == Rti.kindFutureOr && isNullable(Rti._getFutureOrArgument(t));
 }
 
+@pragma('dart2js:parameter:trust')
 bool isTopType(Rti t) =>
     isStrongTopType(t) ||
     isLegacyObjectType(t) ||
@@ -2893,9 +3040,7 @@
 bool isObjectType(Rti t) => _Utils.isIdentical(t, TYPE_REF<Object>());
 bool isLegacyObjectType(Rti t) =>
     _Utils.isIdentical(t, LEGACY_TYPE_REF<Object>());
-bool isNullableObjectType(Rti t) =>
-    Rti._getKind(t) == Rti.kindQuestion &&
-    isObjectType(Rti._getQuestionArgument(t));
+bool isNullableObjectType(Rti t) => _Utils.isIdentical(t, TYPE_REF<Object?>());
 bool isNullType(Rti t) =>
     _Utils.isIdentical(t, TYPE_REF<Null>()) ||
     _Utils.isIdentical(t, TYPE_REF<JSNull>());
@@ -2903,30 +3048,31 @@
 bool isJsFunctionType(Rti t) =>
     _Utils.isIdentical(t, TYPE_REF<JavaScriptFunction>());
 
-/// Unchecked cast to Rti.
-Rti _castToRti(s) => JS('Rti', '#', s);
-Rti /*?*/ _castToRtiOrNull(s) => JS('Rti|Null', '#', s);
-
 class _Utils {
-  static bool asBool(Object o) => JS('bool', '#', o);
-  static double asDouble(Object o) => JS('double', '#', o);
-  static int asInt(Object o) => JS('int', '#', o);
-  static num asNum(Object o) => JS('num', '#', o);
-  static String asString(Object o) => JS('String', '#', o);
+  static bool asBool(Object? o) => JS('bool', '#', o);
+  static double asDouble(Object? o) => JS('double', '#', o);
+  static int asInt(Object? o) => JS('int', '#', o);
+  static num asNum(Object? o) => JS('num', '#', o);
+  static String asString(Object? o) => JS('String', '#', o);
+  static Rti asRti(Object? s) => JS('Rti', '#', s);
+  static Rti? asRtiOrNull(Object? s) => JS('Rti|Null', '#', s);
 
-  static bool isString(Object o) => JS('bool', 'typeof # == "string"', o);
-  static bool isNum(Object o) => JS('bool', 'typeof # == "number"', o);
+  static bool isString(Object? o) => JS('bool', 'typeof # == "string"', o);
+  static bool isNum(Object? o) => JS('bool', 'typeof # == "number"', o);
 
-  static bool instanceOf(Object o, Object constructor) =>
+  static bool instanceOf(Object? o, Object? constructor) =>
       JS('bool', '# instanceof #', o, constructor);
 
-  static bool isIdentical(s, t) => JS('bool', '# === #', s, t);
-  static bool isNotIdentical(s, t) => JS('bool', '# !== #', s, t);
+  static bool isIdentical(Object? s, Object? t) => JS('bool', '# === #', s, t);
+  static bool isNotIdentical(Object? s, Object? t) =>
+      JS('bool', '# !== #', s, t);
 
-  static JSArray objectKeys(Object o) =>
+  static bool isMultipleOf(int n, int d) => JS('bool', '# % # === 0', n, d);
+
+  static JSArray objectKeys(Object? o) =>
       JS('returns:JSArray;new:true;', 'Object.keys(#)', o);
 
-  static void objectAssign(Object o, Object other) {
+  static void objectAssign(Object? o, Object? other) {
     // TODO(fishythefish): Use `Object.assign()` when IE11 is deprecated.
     var keys = objectKeys(other);
     int length = arrayLength(keys);
@@ -2936,26 +3082,26 @@
     }
   }
 
-  static bool isArray(Object o) => JS('bool', 'Array.isArray(#)', o);
+  static bool isArray(Object? o) => JS('bool', 'Array.isArray(#)', o);
 
-  static int arrayLength(Object array) => JS('int', '#.length', array);
+  static int arrayLength(Object? array) => JS('int', '#.length', array);
 
-  static Object arrayAt(Object array, int i) => JS('', '#[#]', array, i);
+  static Object? arrayAt(Object? array, int i) => JS('', '#[#]', array, i);
 
-  static void arraySetAt(Object array, int i, Object value) {
+  static void arraySetAt(Object? array, int i, Object? value) {
     JS('', '#[#] = #', array, i, value);
   }
 
-  static JSArray arrayShallowCopy(Object array) =>
+  static JSArray arrayShallowCopy(Object? array) =>
       JS('JSArray', '#.slice()', array);
 
-  static JSArray arraySplice(Object array, int position) =>
+  static JSArray arraySplice(Object? array, int position) =>
       JS('JSArray', '#.splice(#)', array, position);
 
-  static JSArray arrayConcat(Object a1, Object a2) =>
+  static JSArray arrayConcat(Object? a1, Object? a2) =>
       JS('JSArray', '#.concat(#)', a1, a2);
 
-  static void arrayPush(Object array, Object value) {
+  static void arrayPush(Object? array, Object? value) {
     JS('', '#.push(#)', array, value);
   }
 
@@ -2965,56 +3111,57 @@
   static bool stringLessThan(String s1, String s2) =>
       JS('bool', '# < #', s1, s2);
 
-  static mapGet(cache, key) => JS('', '#.get(#)', cache, key);
+  static Object? mapGet(Object? cache, Object? key) =>
+      JS('', '#.get(#)', cache, key);
 
-  static void mapSet(cache, key, value) {
+  static void mapSet(Object? cache, Object? key, Object? value) {
     JS('', '#.set(#, #)', cache, key, value);
   }
 }
+
 // -------- Entry points for testing -------------------------------------------
 
-String testingCanonicalRecipe(rti) {
+String testingCanonicalRecipe(Rti rti) {
   return Rti._getCanonicalRecipe(rti);
 }
 
-String testingRtiToString(rti) {
-  return _rtiToString(_castToRti(rti), null);
+String testingRtiToString(Rti rti) {
+  return _rtiToString(rti, null);
 }
 
-String testingRtiToDebugString(rti) {
-  return _rtiToDebugString(_castToRti(rti));
+String testingRtiToDebugString(Rti rti) {
+  return _rtiToDebugString(rti);
 }
 
 Object testingCreateUniverse() {
   return _Universe.create();
 }
 
-void testingAddRules(universe, rules) {
+void testingAddRules(Object? universe, Object? rules) {
   _Universe.addRules(universe, rules);
 }
 
-void testingAddTypeParameterVariances(universe, variances) {
+void testingAddTypeParameterVariances(Object? universe, Object? variances) {
   _Universe.addTypeParameterVariances(universe, variances);
 }
 
-bool testingIsSubtype(universe, rti1, rti2) {
-  return isSubtype(universe, _castToRti(rti1), _castToRti(rti2));
+bool testingIsSubtype(Object? universe, Rti rti1, Rti rti2) {
+  return isSubtype(universe, rti1, rti2);
 }
 
-Object testingUniverseEval(universe, String recipe) {
+Rti testingUniverseEval(Object? universe, String recipe) {
   return _Universe.eval(universe, recipe, true);
 }
 
-void testingUniverseEvalOverride(universe, String recipe, Rti rti) {
+void testingUniverseEvalOverride(Object? universe, String recipe, Rti rti) {
   var cache = _Universe.evalCache(universe);
-  _Universe._cacheSet(cache, recipe, rti);
+  _Utils.mapSet(cache, recipe, rti);
 }
 
-Object testingEnvironmentEval(universe, environment, String recipe) {
-  return _Universe.evalInEnvironment(universe, _castToRti(environment), recipe);
+Rti testingEnvironmentEval(Object? universe, Rti environment, String recipe) {
+  return _Universe.evalInEnvironment(universe, environment, recipe);
 }
 
-Object testingEnvironmentBind(universe, environment, arguments) {
-  return _Universe.bind(
-      universe, _castToRti(environment), _castToRti(arguments));
+Rti testingEnvironmentBind(Object? universe, Rti environment, Rti arguments) {
+  return _Universe.bind(universe, environment, arguments);
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart b/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart
index 5bcc512..f87406b 100644
--- a/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart
+++ b/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.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.6
-
 /// Contains error codes that transformed async/async* functions use to
 /// communicate with js_helper functions.
 
diff --git a/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart b/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart
index c927bea..31b46c5f 100644
--- a/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart
+++ b/sdk/lib/_internal/js_runtime/lib/shared/embedded_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.6
-
 /// Contains the names of globals that are embedded into the output by the
 /// compiler.
 ///
diff --git a/sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart b/sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart
index 62372e7..c183861 100644
--- a/sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart
+++ b/sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.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.6
-
 /// Constants and predicates used for encoding and decoding type recipes.
 ///
 /// This library is shared between the compiler and the runtime system.
diff --git a/sdk/lib/_internal/js_runtime/lib/string_helper.dart b/sdk/lib/_internal/js_runtime/lib/string_helper.dart
index eff8783..3e07cdd 100644
--- a/sdk/lib/_internal/js_runtime/lib/string_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/string_helper.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.6
-
 part of _js_helper;
 
 stringIndexOfStringUnchecked(receiver, other, startIndex) {
@@ -42,7 +40,7 @@
   }
 
   List<String> groups(List<int> groups_) {
-    List<String> result = new List<String>();
+    List<String> result = <String>[];
     for (int g in groups_) {
       result.add(group(g));
     }
@@ -82,7 +80,7 @@
   final String _input;
   final String _pattern;
   int _index;
-  Match _current;
+  Match? _current;
 
   _StringAllMatchesIterator(this._input, this._pattern, this._index);
 
@@ -105,7 +103,7 @@
     return true;
   }
 
-  Match get current => _current;
+  Match get current => _current!;
 }
 
 stringContainsUnchecked(receiver, other, startIndex) {
@@ -218,7 +216,7 @@
   return JS('String', '#.split(#).join(#)', receiver, pattern, replacement);
 }
 
-String _matchString(Match match) => match[0];
+String? _matchString(Match match) => match[0];
 String _stringIdentity(String string) => string;
 
 stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) {
diff --git a/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart b/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart
index 9cf539b..d1c6a1a 100644
--- a/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/typed_data_patch.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.6
-
 import 'dart:_js_helper' show patch;
 import 'dart:_native_typed_data';
 
diff --git a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
index eacc877..ab7da7e 100644
--- a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
+++ b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
@@ -2,7 +2,7 @@
 // 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.6
+// @dart = 2.5
 
 library libraries;
 
diff --git a/sdk/lib/_internal/vm/bin/builtin.dart b/sdk/lib/_internal/vm/bin/builtin.dart
index e54b92b..5abcbfb 100644
--- a/sdk/lib/_internal/vm/bin/builtin.dart
+++ b/sdk/lib/_internal/vm/bin/builtin.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.6
-
 library builtin;
 
 // NOTE: Do not import 'dart:io' in builtin.
@@ -36,15 +34,15 @@
 _getPrintClosure() => _print;
 
 // The current working directory when the embedder was launched.
-Uri _workingDirectory;
+late Uri _workingDirectory;
 
 // The URI that the root script was loaded from. Remembered so that
 // package imports can be resolved relative to it. The root script is the basis
 // for the root library in the VM.
-Uri _rootScript;
+Uri? _rootScript;
 
 // packagesConfig specified for the isolate.
-Uri _packagesConfigUri;
+Uri? _packagesConfigUri;
 
 // Packages are either resolved looking up in a map or resolved from within a
 // package root.
@@ -53,11 +51,11 @@
 // Error string set if there was an error resolving package configuration.
 // For example not finding a .packages file or packages/ directory, malformed
 // .packages file or any other related error.
-String _packageError = null;
+String? _packageError = null;
 
 // The map describing how certain package names are mapped to Uris.
-Uri _packageConfig = null;
-Map<String, Uri> _packageMap = null;
+Uri? _packageConfig = null;
+Map<String, Uri>? _packageMap = null;
 
 // Special handling for Windows paths so that they are compatible with URI
 // handling.
@@ -145,7 +143,7 @@
           "'package:${uri.path}/', not 'package:${uri.path}'";
     }
     var packageName = uri.path.substring(0, packageNameEnd);
-    final mapping = _packageMap[packageName];
+    final mapping = _packageMap![packageName];
     if (_traceLoading) {
       _log("Mapped '$packageName' package to '$mapping'");
     }
@@ -166,14 +164,14 @@
   return resolvedUri;
 }
 
-void _requestPackagesMap(Uri packageConfig) {
+void _requestPackagesMap(Uri? packageConfig) {
   dynamic msg = null;
   if (packageConfig != null) {
     // Explicitly specified .packages path.
     msg = _handlePackagesRequest(_traceLoading, -2, packageConfig);
   } else {
     // Search for .packages starting at the root script.
-    msg = _handlePackagesRequest(_traceLoading, -1, _rootScript);
+    msg = _handlePackagesRequest(_traceLoading, -1, _rootScript!);
   }
   if (_traceLoading) {
     _log("Requested packages map for '$_rootScript'.");
@@ -190,10 +188,11 @@
     assert(msg.length >= 2);
     assert(msg[1] == null);
     _packageConfig = Uri.parse(msg[0]);
-    _packageMap = new Map<String, Uri>();
+    final pmap = new Map<String, Uri>();
+    _packageMap = pmap;
     for (var i = 2; i < msg.length; i += 2) {
       // TODO(iposva): Complain about duplicate entries.
-      _packageMap[msg[i]] = Uri.parse(msg[i + 1]);
+      pmap[msg[i]] = Uri.parse(msg[i + 1]);
     }
     if (_traceLoading) {
       _log("Setup package map: $_packageMap");
@@ -306,7 +305,7 @@
     String rootUri = package['rootUri'];
     if (!rootUri.endsWith('/')) rootUri += '/';
     final String packageName = package['name'];
-    final String packageUri = package['packageUri'];
+    final String? packageUri = package['packageUri'];
     final Uri resolvedRootUri = packageConfig.resolve(rootUri);
     final Uri resolvedPackageUri = packageUri != null
         ? resolvedRootUri.resolve(packageUri)
@@ -454,7 +453,7 @@
       if (traceLoading) {
         _log("Handling load of packages map: '$resource'.");
       }
-      Uint8List bytes;
+      late Uint8List bytes;
       if (resource.scheme == '' || resource.scheme == 'file') {
         final file = File.fromUri(resource);
         if (!file.existsSync()) {
@@ -462,7 +461,7 @@
         }
         bytes = file.readAsBytesSync();
       } else if (resource.scheme == 'data') {
-        final uriData = resource.data;
+        final uriData = resource.data!;
         if (!_isValidUtf8DataUrl(uriData)) {
           return "The data resource '$resource' must have a 'text/plain' mime "
               "type and a 'utf-8' or 'US-ASCII' charset.";
@@ -593,7 +592,7 @@
   VMLibraryHooks.resolvePackageUriFuture = _resolvePackageUriFuture;
 }
 
-Future<Uri> _getPackageConfigFuture() {
+Future<Uri?> _getPackageConfigFuture() {
   if (_traceLoading) {
     _log("Request for package config from user code.");
   }
@@ -604,7 +603,7 @@
   return Future.value(_packageConfig);
 }
 
-Future<Uri> _resolvePackageUriFuture(Uri packageUri) {
+Future<Uri?> _resolvePackageUriFuture(Uri packageUri) {
   if (_traceLoading) {
     _log("Request for package Uri resolution from user code: $packageUri");
   }
@@ -618,7 +617,7 @@
   if (!_packagesReady) {
     _requestPackagesMap(_packagesConfigUri);
   }
-  Uri resolvedUri;
+  Uri? resolvedUri;
   try {
     resolvedUri = _resolvePackageUri(packageUri);
   } catch (e, s) {
diff --git a/sdk/lib/_internal/vm/bin/cli_patch.dart b/sdk/lib/_internal/vm/bin/cli_patch.dart
index 0ccae81..504a0db 100644
--- a/sdk/lib/_internal/vm/bin/cli_patch.dart
+++ b/sdk/lib/_internal/vm/bin/cli_patch.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.6
-
 import "dart:_internal" show patch;
 
 @patch
diff --git a/sdk/lib/_internal/vm/bin/common_patch.dart b/sdk/lib/_internal/vm/bin/common_patch.dart
index ee3f1c9..9899f2e 100644
--- a/sdk/lib/_internal/vm/bin/common_patch.dart
+++ b/sdk/lib/_internal/vm/bin/common_patch.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:io" which contains all the imports used by
 /// patches of that library. We plan to change this when we have a shared front
 /// end and simply use parts.
 
-import "dart:_internal" show VMLibraryHooks, patch, ClassID;
+import "dart:_internal" show VMLibraryHooks, patch, checkNotNullable, ClassID;
 
 import "dart:async"
     show
diff --git a/sdk/lib/_internal/vm/bin/directory_patch.dart b/sdk/lib/_internal/vm/bin/directory_patch.dart
index c6b7806..7549f72 100644
--- a/sdk/lib/_internal/vm/bin/directory_patch.dart
+++ b/sdk/lib/_internal/vm/bin/directory_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/bin/eventhandler_patch.dart b/sdk/lib/_internal/vm/bin/eventhandler_patch.dart
index 1b5c5c8..072d995 100644
--- a/sdk/lib/_internal/vm/bin/eventhandler_patch.dart
+++ b/sdk/lib/_internal/vm/bin/eventhandler_patch.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 // part of "common_patch.dart";
 
 @patch
 class _EventHandler {
   @patch
-  static void _sendData(Object sender, SendPort sendPort, int data)
+  static void _sendData(Object? sender, SendPort sendPort, int data)
       native "EventHandler_SendData";
 
   static int _timerMillisecondClock()
diff --git a/sdk/lib/_internal/vm/bin/file_patch.dart b/sdk/lib/_internal/vm/bin/file_patch.dart
index 73fe2dc..033abea 100644
--- a/sdk/lib/_internal/vm/bin/file_patch.dart
+++ b/sdk/lib/_internal/vm/bin/file_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -76,9 +74,9 @@
   int close() native "File_Close";
   readByte() native "File_ReadByte";
   read(int bytes) native "File_Read";
-  readInto(List<int> buffer, int start, int end) native "File_ReadInto";
+  readInto(List<int> buffer, int start, int? end) native "File_ReadInto";
   writeByte(int value) native "File_WriteByte";
-  writeFrom(List<int> buffer, int start, int end) native "File_WriteFrom";
+  writeFrom(List<int> buffer, int start, int? end) native "File_WriteFrom";
   position() native "File_Position";
   setPosition(int position) native "File_SetPosition";
   truncate(int length) native "File_Truncate";
@@ -96,19 +94,20 @@
 }
 
 @patch
-class _FileSystemWatcher {
+abstract class _FileSystemWatcher {
   void _pathWatchedEnd();
 
-  static int _id;
+  static int? _id;
   static final Map<int, _WatcherPath> _idMap = {};
 
   final String _path;
   final int _events;
   final bool _recursive;
 
-  _WatcherPath _watcherPath;
+  _WatcherPath? _watcherPath;
 
-  StreamController<FileSystemEvent> _broadcastController;
+  final StreamController<FileSystemEvent> _broadcastController =
+      new StreamController<FileSystemEvent>.broadcast();
 
   @patch
   static Stream<FileSystemEvent> _watch(
@@ -132,8 +131,9 @@
       throw new FileSystemException(
           "File system watching is not supported on this platform", _path);
     }
-    _broadcastController = new StreamController<FileSystemEvent>.broadcast(
-        onListen: _listen, onCancel: _cancel);
+    _broadcastController
+      ..onListen = _listen
+      ..onCancel = _cancel;
   }
 
   Stream<FileSystemEvent> get _stream => _broadcastController.stream;
@@ -143,7 +143,7 @@
       try {
         _id = _initWatcher();
         _newWatcher();
-      } catch (e) {
+      } on dynamic catch (e) {
         _broadcastController.addError(new FileSystemException(
             "Failed to initialize file system entity watcher", null, e));
         _broadcastController.close();
@@ -153,8 +153,8 @@
     var pathId;
     try {
       pathId =
-          _watchPath(_id, _Namespace._namespace, _path, _events, _recursive);
-    } catch (e) {
+          _watchPath(_id!, _Namespace._namespace, _path, _events, _recursive);
+    } on dynamic catch (e) {
       _broadcastController
           .addError(new FileSystemException("Failed to watch path", _path, e));
       _broadcastController.close();
@@ -164,25 +164,25 @@
       _idMap[pathId] = new _WatcherPath(pathId, _path, _events);
     }
     _watcherPath = _idMap[pathId];
-    _watcherPath.count++;
+    _watcherPath!.count++;
     _pathWatched().pipe(_broadcastController);
   }
 
   void _cancel() {
-    if (_watcherPath != null) {
-      assert(_watcherPath.count > 0);
-      _watcherPath.count--;
-      if (_watcherPath.count == 0) {
-        if (_idMap.containsKey(_watcherPath.pathId)) {
-          _unwatchPath(_id, _watcherPath.pathId);
-          _pathWatchedEnd();
-          _idMap.remove(_watcherPath.pathId);
-        }
+    final watcherPath = _watcherPath;
+    if (watcherPath != null) {
+      assert(watcherPath.count > 0);
+      watcherPath.count--;
+      if (watcherPath.count == 0) {
+        _unwatchPath(_id!, watcherPath.pathId);
+        _pathWatchedEnd();
+        _idMap.remove(watcherPath.pathId);
       }
       _watcherPath = null;
     }
-    if (_idMap.isEmpty && _id != null) {
-      _closeWatcher(_id);
+    final id = _id;
+    if (_idMap.isEmpty && id != null) {
+      _closeWatcher(id);
       _doneWatcher();
       _id = null;
     }
@@ -193,12 +193,12 @@
   // Called when a watcher is no longer needed.
   void _doneWatcher() {}
   // Called when a new path is being watched.
-  Stream _pathWatched() {}
+  Stream _pathWatched();
   // Called when a path is no longer being watched.
   void _donePathWatched() {}
 
   static _WatcherPath _pathFromPathId(int pathId) {
-    return _idMap[pathId];
+    return _idMap[pathId]!;
   }
 
   static Stream _listenOnSocket(int socketId, int id, int pathId) {
@@ -299,15 +299,6 @@
           }
         }
       } else if (event == RawSocketEvent.closed) {
-        // After this point we should not try to do anything with pathId as
-        // the handle it represented is closed and gone now.
-        if (_idMap.containsKey(pathId)) {
-          _idMap.remove(pathId);
-          if (_idMap.isEmpty && _id != null) {
-            _closeWatcher(_id);
-            _id = null;
-          }
-        }
       } else if (event == RawSocketEvent.readClosed) {
         // If Directory watcher buffer overflows, it will send an readClosed event.
         // Normal closing will cancel stream subscription so that path is
@@ -316,7 +307,7 @@
           var path = _pathFromPathId(pathId).path;
           _idMap.remove(pathId);
           if (_idMap.isEmpty && _id != null) {
-            _closeWatcher(_id);
+            _closeWatcher(_id!);
             _id = null;
           }
           throw FileSystemException(
@@ -348,20 +339,20 @@
 
 class _InotifyFileSystemWatcher extends _FileSystemWatcher {
   static final Map<int, StreamController> _idMap = {};
-  static StreamSubscription _subscription;
+  static late StreamSubscription _subscription;
 
   _InotifyFileSystemWatcher(path, events, recursive)
       : super._(path, events, recursive);
 
   void _newWatcher() {
-    int id = _FileSystemWatcher._id;
+    int id = _FileSystemWatcher._id!;
     _subscription =
         _FileSystemWatcher._listenOnSocket(id, id, 0).listen((event) {
       if (_idMap.containsKey(event[0])) {
         if (event[1] != null) {
-          _idMap[event[0]].add(event[1]);
+          _idMap[event[0]]!.add(event[1]);
         } else {
-          _idMap[event[0]].close();
+          _idMap[event[0]]!.close();
         }
       }
     });
@@ -372,30 +363,30 @@
   }
 
   Stream _pathWatched() {
-    var pathId = _watcherPath.pathId;
+    var pathId = _watcherPath!.pathId;
     if (!_idMap.containsKey(pathId)) {
       _idMap[pathId] = new StreamController<FileSystemEvent>.broadcast();
     }
-    return _idMap[pathId].stream;
+    return _idMap[pathId]!.stream;
   }
 
   void _pathWatchedEnd() {
-    var pathId = _watcherPath.pathId;
+    var pathId = _watcherPath!.pathId;
     if (!_idMap.containsKey(pathId)) return;
-    _idMap[pathId].close();
+    _idMap[pathId]!.close();
     _idMap.remove(pathId);
   }
 }
 
 class _Win32FileSystemWatcher extends _FileSystemWatcher {
-  StreamSubscription _subscription;
-  StreamController _controller;
+  late StreamSubscription _subscription;
+  late StreamController _controller;
 
   _Win32FileSystemWatcher(path, events, recursive)
       : super._(path, events, recursive);
 
   Stream _pathWatched() {
-    var pathId = _watcherPath.pathId;
+    var pathId = _watcherPath!.pathId;
     _controller = new StreamController<FileSystemEvent>();
     _subscription =
         _FileSystemWatcher._listenOnSocket(pathId, 0, pathId).listen((event) {
@@ -416,14 +407,14 @@
 }
 
 class _FSEventStreamFileSystemWatcher extends _FileSystemWatcher {
-  StreamSubscription _subscription;
-  StreamController _controller;
+  late StreamSubscription _subscription;
+  late StreamController _controller;
 
   _FSEventStreamFileSystemWatcher(path, events, recursive)
       : super._(path, events, recursive);
 
   Stream _pathWatched() {
-    var pathId = _watcherPath.pathId;
+    var pathId = _watcherPath!.pathId;
     var socketId = _FileSystemWatcher._getSocketId(0, pathId);
     _controller = new StreamController<FileSystemEvent>();
     _subscription =
diff --git a/sdk/lib/_internal/vm/bin/file_system_entity_patch.dart b/sdk/lib/_internal/vm/bin/file_system_entity_patch.dart
index 1f081c7..973e6b6 100644
--- a/sdk/lib/_internal/vm/bin/file_system_entity_patch.dart
+++ b/sdk/lib/_internal/vm/bin/file_system_entity_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/bin/filter_patch.dart b/sdk/lib/_internal/vm/bin/filter_patch.dart
index 0594b6b..06898f4 100644
--- a/sdk/lib/_internal/vm/bin/filter_patch.dart
+++ b/sdk/lib/_internal/vm/bin/filter_patch.dart
@@ -2,32 +2,30 @@
 // 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.6
-
 // part of "common_patch.dart";
 
 class _FilterImpl extends NativeFieldWrapperClass1 implements RawZLibFilter {
   void process(List<int> data, int start, int end) native "Filter_Process";
 
-  List<int> processed({bool flush: true, bool end: false})
+  List<int>? processed({bool flush: true, bool end: false})
       native "Filter_Processed";
 }
 
 class _ZLibInflateFilter extends _FilterImpl {
-  _ZLibInflateFilter(int windowBits, List<int> dictionary, bool raw) {
+  _ZLibInflateFilter(int windowBits, List<int>? dictionary, bool raw) {
     _init(windowBits, dictionary, raw);
   }
-  void _init(int windowBits, List<int> dictionary, bool raw)
+  void _init(int windowBits, List<int>? dictionary, bool raw)
       native "Filter_CreateZLibInflate";
 }
 
 class _ZLibDeflateFilter extends _FilterImpl {
   _ZLibDeflateFilter(bool gzip, int level, int windowBits, int memLevel,
-      int strategy, List<int> dictionary, bool raw) {
+      int strategy, List<int>? dictionary, bool raw) {
     _init(gzip, level, windowBits, memLevel, strategy, dictionary, raw);
   }
   void _init(bool gzip, int level, int windowBits, int memLevel, int strategy,
-      List<int> dictionary, bool raw) native "Filter_CreateZLibDeflate";
+      List<int>? dictionary, bool raw) native "Filter_CreateZLibDeflate";
 }
 
 @patch
@@ -39,12 +37,12 @@
           int windowBits,
           int memLevel,
           int strategy,
-          List<int> dictionary,
+          List<int>? dictionary,
           bool raw) =>
       new _ZLibDeflateFilter(
           gzip, level, windowBits, memLevel, strategy, dictionary, raw);
   @patch
   static RawZLibFilter _makeZLibInflateFilter(
-          int windowBits, List<int> dictionary, bool raw) =>
+          int windowBits, List<int>? dictionary, bool raw) =>
       new _ZLibInflateFilter(windowBits, dictionary, raw);
 }
diff --git a/sdk/lib/_internal/vm/bin/io_service_patch.dart b/sdk/lib/_internal/vm/bin/io_service_patch.dart
index d98df90e..d54bbf2 100644
--- a/sdk/lib/_internal/vm/bin/io_service_patch.dart
+++ b/sdk/lib/_internal/vm/bin/io_service_patch.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.6
-
 // part of "common_patch.dart";
 
 class _IOServicePorts {
@@ -36,7 +34,7 @@
   }
 
   void _returnPort(int forRequestId) {
-    final SendPort port = _usedPorts.remove(forRequestId);
+    final SendPort port = _usedPorts.remove(forRequestId)!;
     if (!_usedPorts.values.contains(port)) {
       _freePorts.add(port);
     }
@@ -48,8 +46,8 @@
 @patch
 class _IOService {
   static _IOServicePorts _servicePorts = new _IOServicePorts();
-  static RawReceivePort _receivePort;
-  static SendPort _replyToPort;
+  static RawReceivePort? _receivePort;
+  static late SendPort _replyToPort;
   static HashMap<int, Completer> _messageMap = new HashMap<int, Completer>();
   static int _id = 0;
 
@@ -66,7 +64,7 @@
     try {
       servicePort.send(<dynamic>[id, _replyToPort, request, data]);
     } catch (error) {
-      _messageMap.remove(id).complete(error);
+      _messageMap.remove(id)!.complete(error);
       if (_messageMap.length == 0) {
         _finalize();
       }
@@ -77,10 +75,10 @@
   static void _ensureInitialize() {
     if (_receivePort == null) {
       _receivePort = new RawReceivePort();
-      _replyToPort = _receivePort.sendPort;
-      _receivePort.handler = (data) {
+      _replyToPort = _receivePort!.sendPort;
+      _receivePort!.handler = (data) {
         assert(data is List && data.length == 2);
-        _messageMap.remove(data[0]).complete(data[1]);
+        _messageMap.remove(data[0])!.complete(data[1]);
         _servicePorts._returnPort(data[0]);
         if (_messageMap.length == 0) {
           _finalize();
@@ -91,7 +89,7 @@
 
   static void _finalize() {
     _id = 0;
-    _receivePort.close();
+    _receivePort!.close();
     _receivePort = null;
   }
 
diff --git a/sdk/lib/_internal/vm/bin/namespace_patch.dart b/sdk/lib/_internal/vm/bin/namespace_patch.dart
index 60bbb5e..2cf329f 100644
--- a/sdk/lib/_internal/vm/bin/namespace_patch.dart
+++ b/sdk/lib/_internal/vm/bin/namespace_patch.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.6
-
 @pragma("vm:entry-point")
 class _NamespaceImpl extends NativeFieldWrapperClass1 implements _Namespace {
   _NamespaceImpl._();
@@ -16,7 +14,7 @@
 
   // If the platform supports "namespaces", this method is called by the
   // embedder with the platform-specific namespace information.
-  static _NamespaceImpl _cachedNamespace = null;
+  static _NamespaceImpl? _cachedNamespace = null;
   static void _setupNamespace(var namespace) {
     _cachedNamespace = _create(new _NamespaceImpl._(), namespace);
   }
@@ -27,7 +25,7 @@
       // instead use a safe-ish default value.
       _cachedNamespace = _create(new _NamespaceImpl._(), _getDefault());
     }
-    return _cachedNamespace;
+    return _cachedNamespace!;
   }
 
   static int get _namespacePointer => _getPointer(_namespace);
diff --git a/sdk/lib/_internal/vm/bin/platform_patch.dart b/sdk/lib/_internal/vm/bin/platform_patch.dart
index a9c1040..d187101 100644
--- a/sdk/lib/_internal/vm/bin/platform_patch.dart
+++ b/sdk/lib/_internal/vm/bin/platform_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -35,9 +33,9 @@
   static String _localeName() native "Platform_LocaleName";
 
   @patch
-  static String _packageRoot() => VMLibraryHooks.packageRootString;
+  static String? _packageRoot() => VMLibraryHooks.packageRootString;
   @patch
-  static String _packageConfig() => VMLibraryHooks.packageConfigString;
+  static String? _packageConfig() => VMLibraryHooks.packageConfigString;
 
   @patch
   static Uri _script() => VMLibraryHooks.platformScript;
diff --git a/sdk/lib/_internal/vm/bin/process_patch.dart b/sdk/lib/_internal/vm/bin/process_patch.dart
index 89e7c14..bb86a0d 100644
--- a/sdk/lib/_internal/vm/bin/process_patch.dart
+++ b/sdk/lib/_internal/vm/bin/process_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -22,8 +20,8 @@
 class Process {
   @patch
   static Future<Process> start(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
       ProcessStartMode mode: ProcessStartMode.normal}) {
@@ -40,12 +38,12 @@
 
   @patch
   static Future<ProcessResult> run(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
-      Encoding stdoutEncoding: systemEncoding,
-      Encoding stderrEncoding: systemEncoding}) {
+      Encoding? stdoutEncoding: systemEncoding,
+      Encoding? stderrEncoding: systemEncoding}) {
     return _runNonInteractiveProcess(
         executable,
         arguments,
@@ -59,12 +57,12 @@
 
   @patch
   static ProcessResult runSync(String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
-      Encoding stdoutEncoding: systemEncoding,
-      Encoding stderrEncoding: systemEncoding}) {
+      Encoding? stdoutEncoding: systemEncoding,
+      Encoding? stderrEncoding: systemEncoding}) {
     return _runNonInteractiveProcessSync(
         executable,
         arguments,
@@ -78,24 +76,24 @@
 
   @patch
   static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
-    if (signal is! ProcessSignal) {
-      throw new ArgumentError("Argument 'signal' must be a ProcessSignal");
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(signal, "signal");
     return _ProcessUtils._killPid(pid, signal._signalNumber);
   }
 }
 
-List<_SignalController> _signalControllers = new List(32);
+List<_SignalController?> _signalControllers = new List.filled(32, null);
 
 class _SignalController {
   final ProcessSignal signal;
 
-  StreamController<ProcessSignal> _controller;
+  final _controller = new StreamController<ProcessSignal>.broadcast();
   var _id;
 
   _SignalController(this.signal) {
-    _controller = new StreamController<ProcessSignal>.broadcast(
-        onListen: _listen, onCancel: _cancel);
+    _controller
+      ..onListen = _listen
+      ..onCancel = _cancel;
   }
 
   Stream<ProcessSignal> get stream => _controller.stream;
@@ -111,7 +109,7 @@
     var socket = new _RawSocket(new _NativeSocket.watchSignal(id));
     socket.listen((event) {
       if (event == RawSocketEvent.read) {
-        var bytes = socket.read();
+        var bytes = socket.read()!;
         for (int i = 0; i < bytes.length; i++) {
           _controller.add(signal);
         }
@@ -137,7 +135,7 @@
 @patch
 class _ProcessUtils {
   @patch
-  static void _exit(int status) native "Process_Exit";
+  static Never _exit(int status) native "Process_Exit";
   @patch
   static void _setExitCode(int status) native "Process_SetExitCode";
   @patch
@@ -145,7 +143,7 @@
   @patch
   static void _sleep(int millis) native "Process_Sleep";
   @patch
-  static int _pid(Process process) native "Process_Pid";
+  static int _pid(Process? process) native "Process_Pid";
   static bool _killPid(int pid, int signal) native "Process_KillPid";
   @patch
   static Stream<ProcessSignal> _watchSignal(ProcessSignal signal) {
@@ -166,7 +164,7 @@
     if (_signalControllers[signal._signalNumber] == null) {
       _signalControllers[signal._signalNumber] = new _SignalController(signal);
     }
-    return _signalControllers[signal._signalNumber].stream;
+    return _signalControllers[signal._signalNumber]!.stream;
   }
 }
 
@@ -197,9 +195,9 @@
 @pragma("vm:entry-point")
 class _ProcessStartStatus {
   @pragma("vm:entry-point", "set")
-  int _errorCode; // Set to OS error code if process start failed.
+  int? _errorCode; // Set to OS error code if process start failed.
   @pragma("vm:entry-point", "set")
-  String _errorMessage; // Set to OS error message if process start failed.
+  String? _errorMessage; // Set to OS error message if process start failed.
 }
 
 // The NativeFieldWrapperClass1 can not be used with a mixin, due to missing
@@ -207,18 +205,25 @@
 class _ProcessImplNativeWrapper extends NativeFieldWrapperClass1 {}
 
 class _ProcessImpl extends _ProcessImplNativeWrapper implements Process {
-  _ProcessResourceInfo _resourceInfo;
   static bool connectedResourceHandler = false;
 
   _ProcessImpl(
       String path,
       List<String> arguments,
       this._workingDirectory,
-      Map<String, String> environment,
+      Map<String, String>? environment,
       bool includeParentEnvironment,
       bool runInShell,
-      ProcessStartMode mode)
+      this._mode)
       : super() {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(path, "path");
+    ArgumentError.checkNotNull(arguments, "arguments");
+    for (int i = 0; i < arguments.length; i++) {
+      ArgumentError.checkNotNull(arguments[i], "arguments[]");
+    }
+    ArgumentError.checkNotNull(_mode, "mode");
+
     if (!connectedResourceHandler) {
       registerExtension(
           'ext.dart.io.getProcesses', _ProcessResourceInfo.getStartedProcesses);
@@ -232,10 +237,6 @@
       path = _getShellCommand();
     }
 
-    if (path is! String) {
-      throw new ArgumentError("Path is not a String: $path");
-    }
-
     if (Platform.isWindows && path.contains(' ') && !path.contains('"')) {
       // Escape paths that may contain spaces
       // Bug: https://github.com/dart-lang/sdk/issues/37751
@@ -244,57 +245,29 @@
       _path = path;
     }
 
-    if (arguments is! List) {
-      throw new ArgumentError("Arguments is not a List: $arguments");
-    }
-    int len = arguments.length;
-    _arguments = new List<String>(len);
-    for (int i = 0; i < len; i++) {
-      var arg = arguments[i];
-      if (arg is! String) {
-        throw new ArgumentError("Non-string argument: $arg");
-      }
-      _arguments[i] = arguments[i];
-      if (Platform.isWindows) {
-        _arguments[i] = _windowsArgumentEscape(_arguments[i]);
-      }
-    }
-
-    if (_workingDirectory != null && _workingDirectory is! String) {
-      throw new ArgumentError(
-          "WorkingDirectory is not a String: $_workingDirectory");
-    }
+    _arguments = [
+      for (int i = 0; i < arguments.length; i++)
+        Platform.isWindows
+            ? _windowsArgumentEscape(arguments[i])
+            : arguments[i],
+    ];
 
     _environment = [];
     // Ensure that we have a non-null environment.
-    environment = (environment == null) ? (const {}) : environment;
-    if (environment is! Map) {
-      throw new ArgumentError("Environment is not a map: $environment");
-    }
+    environment ??= const {};
     environment.forEach((key, value) {
-      if (key is! String || value is! String) {
-        throw new ArgumentError(
-            "Environment key or value is not a string: ($key, $value)");
-      }
       _environment.add('$key=$value');
     });
     if (includeParentEnvironment) {
       Platform.environment.forEach((key, value) {
-        assert(key is String);
-        assert(value is String);
         // Do not override keys already set as part of environment.
-        if (!environment.containsKey(key)) {
+        if (!environment!.containsKey(key)) {
           _environment.add('$key=$value');
         }
       });
     }
 
-    if (mode is! ProcessStartMode) {
-      throw new ArgumentError("Mode is not a ProcessStartMode: $mode");
-    }
-    _mode = mode;
-
-    if (_modeHasStdio(mode)) {
+    if (_modeHasStdio(_mode)) {
       // stdin going to process.
       _stdin = new _StdSink(new _Socket._writePipe().._owner = this);
       // stdout coming from process.
@@ -302,19 +275,17 @@
       // stderr coming from process.
       _stderr = new _StdStream(new _Socket._readPipe().._owner = this);
     }
-    if (_modeIsAttached(mode)) {
+    if (_modeIsAttached(_mode)) {
       _exitHandler = new _Socket._readPipe();
     }
-    _ended = false;
-    _started = false;
   }
 
   _NativeSocket get _stdinNativeSocket =>
-      (_stdin._sink as _Socket)._nativeSocket;
+      (_stdin!._sink as _Socket)._nativeSocket;
   _NativeSocket get _stdoutNativeSocket =>
-      (_stdout._stream as _Socket)._nativeSocket;
+      (_stdout!._stream as _Socket)._nativeSocket;
   _NativeSocket get _stderrNativeSocket =>
-      (_stderr._stream as _Socket)._nativeSocket;
+      (_stderr!._stream as _Socket)._nativeSocket;
 
   static bool _modeIsAttached(ProcessStartMode mode) {
     return (mode == ProcessStartMode.normal) ||
@@ -437,19 +408,19 @@
           status);
       if (!success) {
         completer.completeError(new ProcessException(
-            _path, _arguments, status._errorMessage, status._errorCode));
+            _path, _arguments, status._errorMessage!, status._errorCode!));
         return;
       }
 
       _started = true;
-      _resourceInfo = new _ProcessResourceInfo(this);
+      final resourceInfo = new _ProcessResourceInfo(this);
 
       // Setup an exit handler to handle internal cleanup and possible
       // callback when a process terminates.
       if (_modeIsAttached(_mode)) {
         int exitDataRead = 0;
         final int EXIT_DATA_SIZE = 8;
-        List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE);
+        List<int> exitDataBuffer = new List<int>.filled(EXIT_DATA_SIZE, 0);
         _exitHandler.listen((data) {
           int exitCode(List<int> ints) {
             var code = _intFromBytes(ints, 0);
@@ -460,12 +431,12 @@
 
           void handleExit() {
             _ended = true;
-            _exitCode.complete(exitCode(exitDataBuffer));
+            _exitCode!.complete(exitCode(exitDataBuffer));
             // Kill stdin, helping hand if the user forgot to do it.
             if (_modeHasStdio(_mode)) {
-              (_stdin._sink as _Socket).destroy();
+              (_stdin!._sink as _Socket).destroy();
             }
-            _resourceInfo.stopped();
+            resourceInfo.stopped();
           }
 
           exitDataBuffer.setRange(
@@ -482,7 +453,8 @@
     return completer.future;
   }
 
-  ProcessResult _runAndWait(Encoding stdoutEncoding, Encoding stderrEncoding) {
+  ProcessResult _runAndWait(
+      Encoding? stdoutEncoding, Encoding? stderrEncoding) {
     var status = new _ProcessStartStatus();
     _exitCode = new Completer<int>();
     bool success = _startNative(
@@ -499,10 +471,10 @@
         status);
     if (!success) {
       throw new ProcessException(
-          _path, _arguments, status._errorMessage, status._errorCode);
+          _path, _arguments, status._errorMessage!, status._errorCode!);
     }
 
-    _resourceInfo = new _ProcessResourceInfo(this);
+    final resourceInfo = new _ProcessResourceInfo(this);
 
     var result = _wait(_stdinNativeSocket, _stdoutNativeSocket,
         _stderrNativeSocket, _exitHandler._nativeSocket);
@@ -512,7 +484,7 @@
       return encoding.decode(output);
     }
 
-    _resourceInfo.stopped();
+    resourceInfo.stopped();
 
     return new ProcessResult(
         result[0],
@@ -525,16 +497,16 @@
       _Namespace namespace,
       String path,
       List<String> arguments,
-      String workingDirectory,
+      String? workingDirectory,
       List<String> environment,
       int mode,
-      _NativeSocket stdin,
-      _NativeSocket stdout,
-      _NativeSocket stderr,
-      _NativeSocket exitHandler,
+      _NativeSocket? stdin,
+      _NativeSocket? stdout,
+      _NativeSocket? stderr,
+      _NativeSocket? exitHandler,
       _ProcessStartStatus status) native "Process_Start";
 
-  _wait(_NativeSocket stdin, _NativeSocket stdout, _NativeSocket stderr,
+  _wait(_NativeSocket? stdin, _NativeSocket? stdout, _NativeSocket? stderr,
       _NativeSocket exitHandler) native "Process_Wait";
 
   Stream<List<int>> get stdout =>
@@ -549,9 +521,8 @@
       _exitCode?.future ?? (throw StateError("Process is detached"));
 
   bool kill([ProcessSignal signal = ProcessSignal.sigterm]) {
-    if (signal is! ProcessSignal) {
-      throw new ArgumentError("Argument 'signal' must be a ProcessSignal");
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(kill, "kill");
     assert(_started);
     if (_ended) return false;
     return _ProcessUtils._killPid(pid, signal._signalNumber);
@@ -559,19 +530,19 @@
 
   int get pid => _ProcessUtils._pid(this);
 
-  String _path;
-  List<String> _arguments;
-  String _workingDirectory;
-  List<String> _environment;
-  ProcessStartMode _mode;
+  late String _path;
+  late List<String> _arguments;
+  String? _workingDirectory;
+  late List<String> _environment;
+  final ProcessStartMode _mode;
   // Private methods of Socket are used by _in, _out, and _err.
-  _StdSink _stdin;
-  _StdStream _stdout;
-  _StdStream _stderr;
-  _Socket _exitHandler;
-  bool _ended;
-  bool _started;
-  Completer<int> _exitCode;
+  _StdSink? _stdin;
+  _StdStream? _stdout;
+  _StdStream? _stderr;
+  late _Socket _exitHandler;
+  bool _ended = false;
+  bool _started = false;
+  Completer<int>? _exitCode;
 }
 
 // _NonInteractiveProcess is a wrapper around an interactive process
@@ -581,12 +552,12 @@
 Future<ProcessResult> _runNonInteractiveProcess(
     String path,
     List<String> arguments,
-    String workingDirectory,
-    Map<String, String> environment,
+    String? workingDirectory,
+    Map<String, String>? environment,
     bool includeParentEnvironment,
     bool runInShell,
-    Encoding stdoutEncoding,
-    Encoding stderrEncoding) {
+    Encoding? stdoutEncoding,
+    Encoding? stderrEncoding) {
   // Start the underlying process.
   return Process.start(path, arguments,
           workingDirectory: workingDirectory,
@@ -600,14 +571,16 @@
     p.stdin.close();
 
     // Setup stdout and stderr handling.
-    Future foldStream(Stream<List<int>> stream, Encoding encoding) {
+    Future foldStream(Stream<List<int>> stream, Encoding? encoding) {
       if (encoding == null) {
         return stream
-            .fold(new BytesBuilder(), (builder, data) => builder..add(data))
+            .fold<BytesBuilder>(
+                new BytesBuilder(), (builder, data) => builder..add(data))
             .then((builder) => builder.takeBytes());
       } else {
-        return stream.transform(encoding.decoder).fold(new StringBuffer(),
-            (buf, data) {
+        return stream
+            .transform(encoding.decoder)
+            .fold<StringBuffer>(new StringBuffer(), (buf, data) {
           buf.write(data);
           return buf;
         }).then((sb) => sb.toString());
@@ -626,12 +599,12 @@
 ProcessResult _runNonInteractiveProcessSync(
     String executable,
     List<String> arguments,
-    String workingDirectory,
-    Map<String, String> environment,
+    String? workingDirectory,
+    Map<String, String>? environment,
     bool includeParentEnvironment,
     bool runInShell,
-    Encoding stdoutEncoding,
-    Encoding stderrEncoding) {
+    Encoding? stdoutEncoding,
+    Encoding? stderrEncoding) {
   var process = new _ProcessImpl(
       executable,
       arguments,
diff --git a/sdk/lib/_internal/vm/bin/secure_socket_patch.dart b/sdk/lib/_internal/vm/bin/secure_socket_patch.dart
index 117f90f..9a0586d 100644
--- a/sdk/lib/_internal/vm/bin/secure_socket_patch.dart
+++ b/sdk/lib/_internal/vm/bin/secure_socket_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -28,7 +26,7 @@
 }
 
 class _SecureSocket extends _Socket implements SecureSocket {
-  _RawSecureSocket get _raw => super._raw as _RawSecureSocket;
+  _RawSecureSocket? get _raw => super._raw as _RawSecureSocket?;
 
   _SecureSocket(RawSecureSocket raw) : super(raw);
 
@@ -36,24 +34,24 @@
       {bool useSessionCache: true,
       bool requestClientCertificate: false,
       bool requireClientCertificate: false}) {
-    _raw.renegotiate(
+    _raw!.renegotiate(
         useSessionCache: useSessionCache,
         requestClientCertificate: requestClientCertificate,
         requireClientCertificate: requireClientCertificate);
   }
 
-  X509Certificate get peerCertificate {
+  X509Certificate? get peerCertificate {
     if (_raw == null) {
       throw new StateError("peerCertificate called on destroyed SecureSocket");
     }
-    return _raw.peerCertificate;
+    return _raw!.peerCertificate;
   }
 
-  String get selectedProtocol {
+  String? get selectedProtocol {
     if (_raw == null) {
       throw new StateError("selectedProtocol called on destroyed SecureSocket");
     }
-    return _raw.selectedProtocol;
+    return _raw!.selectedProtocol;
   }
 }
 
@@ -78,17 +76,17 @@
   static final int ENCRYPTED_SIZE = 10 * 1024;
 
   _SecureFilterImpl._() {
-    buffers = new List<_ExternalBuffer>(_RawSecureSocket.bufferCount);
-    for (int i = 0; i < _RawSecureSocket.bufferCount; ++i) {
-      buffers[i] = new _ExternalBuffer(
-          _RawSecureSocket._isBufferEncrypted(i) ? ENCRYPTED_SIZE : SIZE);
-    }
+    buffers = <_ExternalBuffer>[
+      for (int i = 0; i < _RawSecureSocket.bufferCount; ++i)
+        new _ExternalBuffer(
+            _RawSecureSocket._isBufferEncrypted(i) ? ENCRYPTED_SIZE : SIZE),
+    ];
   }
 
   void connect(
       String hostName,
       SecurityContext context,
-      bool is_server,
+      bool isServer,
       bool requestClientCertificate,
       bool requireClientCertificate,
       Uint8List protocols) native "SecureSocket_Connect";
@@ -106,14 +104,14 @@
 
   int processBuffer(int bufferIndex) => throw new UnimplementedError();
 
-  String selectedProtocol() native "SecureSocket_GetSelectedProtocol";
+  String? selectedProtocol() native "SecureSocket_GetSelectedProtocol";
 
   void renegotiate(bool useSessionCache, bool requestClientCertificate,
       bool requireClientCertificate) native "SecureSocket_Renegotiate";
 
   void init() native "SecureSocket_Init";
 
-  X509Certificate get peerCertificate native "SecureSocket_PeerCertificate";
+  X509Certificate? get peerCertificate native "SecureSocket_PeerCertificate";
 
   void registerBadCertificateCallback(Function callback)
       native "SecureSocket_RegisterBadCertificateCallback";
@@ -125,7 +123,7 @@
   int _pointer() native "SecureSocket_FilterPointer";
 
   @pragma("vm:entry-point", "get")
-  List<_ExternalBuffer> buffers;
+  List<_ExternalBuffer>? buffers;
 }
 
 @patch
@@ -157,36 +155,36 @@
 
   static final SecurityContext defaultContext = new _SecurityContext(true);
 
-  void usePrivateKey(String file, {String password}) {
+  void usePrivateKey(String file, {String? password}) {
     List<int> bytes = (new File(file)).readAsBytesSync();
     usePrivateKeyBytes(bytes, password: password);
   }
 
-  void usePrivateKeyBytes(List<int> keyBytes, {String password})
+  void usePrivateKeyBytes(List<int> keyBytes, {String? password})
       native "SecurityContext_UsePrivateKeyBytes";
 
-  void setTrustedCertificates(String file, {String password}) {
+  void setTrustedCertificates(String file, {String? password}) {
     List<int> bytes = (new File(file)).readAsBytesSync();
     setTrustedCertificatesBytes(bytes, password: password);
   }
 
-  void setTrustedCertificatesBytes(List<int> certBytes, {String password})
+  void setTrustedCertificatesBytes(List<int> certBytes, {String? password})
       native "SecurityContext_SetTrustedCertificatesBytes";
 
-  void useCertificateChain(String file, {String password}) {
+  void useCertificateChain(String file, {String? password}) {
     List<int> bytes = (new File(file)).readAsBytesSync();
     useCertificateChainBytes(bytes, password: password);
   }
 
-  void useCertificateChainBytes(List<int> chainBytes, {String password})
+  void useCertificateChainBytes(List<int> chainBytes, {String? password})
       native "SecurityContext_UseCertificateChainBytes";
 
-  void setClientAuthorities(String file, {String password}) {
+  void setClientAuthorities(String file, {String? password}) {
     List<int> bytes = (new File(file)).readAsBytesSync();
     setClientAuthoritiesBytes(bytes, password: password);
   }
 
-  void setClientAuthoritiesBytes(List<int> authCertBytes, {String password})
+  void setClientAuthoritiesBytes(List<int> authCertBytes, {String? password})
       native "SecurityContext_SetClientAuthoritiesBytes";
 
   void setAlpnProtocols(List<String> protocols, bool isServer) {
@@ -210,32 +208,14 @@
   // This is done by WrappedX509 in secure_socket.cc.
   _X509CertificateImpl._();
 
-  Uint8List _cachedDer;
   Uint8List get _der native "X509_Der";
-  Uint8List get der {
-    if (_cachedDer == null) {
-      _cachedDer = _der;
-    }
-    return _cachedDer;
-  }
+  late final Uint8List der = _der;
 
-  String _cachedPem;
   String get _pem native "X509_Pem";
-  String get pem {
-    if (_cachedPem == null) {
-      _cachedPem = _pem;
-    }
-    return _cachedPem;
-  }
+  late final String pem = _pem;
 
-  Uint8List _cachedSha1;
   Uint8List get _sha1 native "X509_Sha1";
-  Uint8List get sha1 {
-    if (_cachedSha1 == null) {
-      _cachedSha1 = _sha1;
-    }
-    return _cachedSha1;
-  }
+  late final Uint8List sha1 = _sha1;
 
   String get subject native "X509_Subject";
   String get issuer native "X509_Issuer";
diff --git a/sdk/lib/_internal/vm/bin/socket_patch.dart b/sdk/lib/_internal/vm/bin/socket_patch.dart
index 8d2e06c..e2bff2f 100644
--- a/sdk/lib/_internal/vm/bin/socket_patch.dart
+++ b/sdk/lib/_internal/vm/bin/socket_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -18,30 +16,29 @@
 @patch
 class RawSocket {
   @patch
-  static Future<RawSocket> connect(host, int port,
-      {sourceAddress, Duration timeout}) {
+  static Future<RawSocket> connect(dynamic host, int port,
+      {dynamic sourceAddress, Duration? timeout}) {
     return _RawSocket.connect(host, port, sourceAddress, timeout);
   }
 
   @patch
-  static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
-      {sourceAddress}) {
+  static Future<ConnectionTask<RawSocket>> startConnect(dynamic host, int port,
+      {dynamic sourceAddress}) {
     return _RawSocket.startConnect(host, port, sourceAddress);
   }
 }
 
 @patch
 class RawSocketOption {
-  static final List<int> _optionsCache =
-      List<int>(_RawSocketOptions.values.length);
+  static final List<int?> _optionsCache =
+      List<int?>.filled(_RawSocketOptions.values.length, null);
 
   @patch
   static int _getOptionValue(int key) {
     if (key > _RawSocketOptions.values.length) {
       throw ArgumentError.value(key, 'key');
     }
-    _optionsCache[key] ??= _getNativeOptionValue(key);
-    return _optionsCache[key];
+    return _optionsCache[key] ??= _getNativeOptionValue(key);
   }
 
   static int _getNativeOptionValue(int key)
@@ -71,13 +68,13 @@
   }
 
   @patch
-  factory InternetAddress(String address, {InternetAddressType type}) {
+  factory InternetAddress(String address, {InternetAddressType? type}) {
     return _InternetAddress.fromString(address, type: type);
   }
 
   @patch
   factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType type}) {
+      {InternetAddressType? type}) {
     return _InternetAddress.fromRawAddress(rawAddress, type: type);
   }
 
@@ -94,7 +91,7 @@
   }
 
   @patch
-  static InternetAddress tryParse(String address) {
+  static InternetAddress? tryParse(String address) {
     return _InternetAddress.tryParse(address);
   }
 }
@@ -121,13 +118,17 @@
 }
 
 void _throwOnBadPort(int port) {
-  if ((port == null) || (port < 0) || (port > 0xFFFF)) {
+  // TODO(40614): Remove once non-nullability is sound.
+  ArgumentError.checkNotNull(port, "port");
+  if ((port < 0) || (port > 0xFFFF)) {
     throw new ArgumentError("Invalid port $port");
   }
 }
 
 void _throwOnBadTtl(int ttl) {
-  if (ttl == null || ttl < 1 || ttl > 255) {
+  // TODO(40614): Remove once non-nullability is sound.
+  ArgumentError.checkNotNull(ttl, "ttl");
+  if (ttl < 1 || ttl > 255) {
     throw new ArgumentError('Invalid ttl $ttl');
   }
 }
@@ -148,12 +149,12 @@
   static _InternetAddress anyIPv6 = _InternetAddress.fixed(_addressAnyIPv6);
 
   final String address;
-  final String _host;
+  final String? _host;
   final Uint8List _in_addr;
   final int _scope_id;
   final InternetAddressType type;
 
-  String get host => _host != null ? _host : address;
+  String get host => _host ?? address;
 
   Uint8List get rawAddress => new Uint8List.fromList(_in_addr);
 
@@ -171,6 +172,7 @@
       case InternetAddressType.unix:
         return false;
     }
+    throw new UnsupportedError("Unexpected address type $type");
   }
 
   bool get isLinkLocal {
@@ -186,6 +188,7 @@
       case InternetAddressType.unix:
         return false;
     }
+    throw new UnsupportedError("Unexpected address type $type");
   }
 
   bool get isMulticast {
@@ -201,6 +204,7 @@
       case InternetAddressType.unix:
         return false;
     }
+    throw new UnsupportedError("Unexpected address type $type");
   }
 
   Future<InternetAddress> reverse() {
@@ -214,16 +218,14 @@
       [this._scope_id = 0]);
 
   factory _InternetAddress.fromString(String address,
-      {InternetAddressType type}) {
+      {InternetAddressType? type}) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(address, 'address');
     if (type == InternetAddressType.unix) {
-      ArgumentError.checkNotNull(address, 'address');
       var rawAddress = FileSystemEntity._toUtf8Array(address);
       return _InternetAddress(
           InternetAddressType.unix, address, null, rawAddress);
     } else {
-      if (address is! String) {
-        throw ArgumentError("Invalid internet address $address");
-      }
       var in_addr = _parse(address);
       if (in_addr == null) {
         throw ArgumentError("Invalid internet address $address");
@@ -236,7 +238,7 @@
   }
 
   factory _InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType type}) {
+      {InternetAddressType? type}) {
     if (type == InternetAddressType.unix) {
       ArgumentError.checkNotNull(rawAddress, 'rawAddress');
       var rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawAddress);
@@ -258,10 +260,8 @@
     }
   }
 
-  static _InternetAddress tryParse(String address) {
-    if (address == null) {
-      throw ArgumentError("Invalid internet address $address");
-    }
+  static _InternetAddress? tryParse(String address) {
+    checkNotNullable(address, "address");
     var addressBytes = _parse(address);
     if (addressBytes == null) return null;
     var type = addressBytes.length == _IPv4AddrLength
@@ -331,7 +331,7 @@
   static String _rawAddrToString(Uint8List address)
       native "InternetAddress_RawAddrToString";
 
-  static Uint8List _parse(String address) native "InternetAddress_Parse";
+  static Uint8List? _parse(String address) native "InternetAddress_Parse";
 }
 
 class _NetworkInterface implements NetworkInterface {
@@ -429,8 +429,8 @@
   Completer closeCompleter = new Completer.sync();
 
   // Handlers and receive port for socket events from the event handler.
-  final List eventHandlers = new List(eventCount + 1);
-  RawReceivePort eventPort;
+  final List eventHandlers = new List.filled(eventCount + 1, null);
+  RawReceivePort? eventPort;
   bool flagsSent = false;
 
   // The type flags for this socket.
@@ -440,7 +440,7 @@
   int localPort = 0;
 
   // Holds the address used to connect or bind the socket.
-  InternetAddress localAddress;
+  late InternetAddress localAddress;
 
   // The size of data that is ready to be read, for TCP sockets.
   // This might be out-of-date when Read is called.
@@ -464,11 +464,11 @@
   bool writeAvailable = false;
 
   static bool connectedResourceHandler = false;
-  _ReadWriteResourceInfo resourceInfo;
+  _SocketResourceInfo? resourceInfo;
 
   // The owner object is the object that the Socket is being used by, e.g.
   // a HttpServer, a WebSocket connection, a process pipe, etc.
-  Object owner;
+  Object? owner;
 
   static Future<List<InternetAddress>> lookup(String host,
       {InternetAddressType type: InternetAddressType.any}) {
@@ -552,7 +552,7 @@
   }
 
   static Future<ConnectionTask<_NativeSocket>> startConnect(
-      host, int port, sourceAddress) {
+      dynamic host, int port, dynamic sourceAddress) {
     if (host is String) {
       host = escapeLinkLocalAddress(host);
     }
@@ -584,9 +584,8 @@
           }
           return;
         }
-        final _InternetAddress address = it.current;
-        var socket = new _NativeSocket.normal();
-        socket.localAddress = address;
+        final _InternetAddress address = it.current as _InternetAddress;
+        var socket = new _NativeSocket.normal(address);
         var result;
         if (sourceAddress == null) {
           if (address.type == InternetAddressType.unix) {
@@ -694,13 +693,12 @@
       }
 
       connectNext();
-      return new ConnectionTask<_NativeSocket>._(
-          socket: completer.future, onCancel: onCancel);
+      return new ConnectionTask<_NativeSocket>._(completer.future, onCancel);
     });
   }
 
   static Future<_NativeSocket> connect(
-      host, int port, sourceAddress, Duration timeout) {
+      dynamic host, int port, dynamic sourceAddress, Duration? timeout) {
     return startConnect(host, port, sourceAddress)
         .then((ConnectionTask<_NativeSocket> task) {
       Future<_NativeSocket> socketFuture = task.socket;
@@ -715,7 +713,7 @@
     });
   }
 
-  static Future<_InternetAddress> _resolveHost(host) async {
+  static Future<_InternetAddress> _resolveHost(dynamic host) async {
     if (host is _InternetAddress) {
       return host;
     } else {
@@ -735,8 +733,7 @@
     }
     final address = await _resolveHost(host);
 
-    var socket = new _NativeSocket.listen();
-    socket.localAddress = address;
+    var socket = new _NativeSocket.listen(address);
     var result;
     if (address.type == InternetAddressType.unix) {
       var path = address.address;
@@ -785,9 +782,11 @@
   _NativeSocket.datagram(this.localAddress)
       : typeFlags = typeNormalSocket | typeUdpSocket;
 
-  _NativeSocket.normal() : typeFlags = typeNormalSocket | typeTcpSocket;
+  _NativeSocket.normal(this.localAddress)
+      : typeFlags = typeNormalSocket | typeTcpSocket;
 
-  _NativeSocket.listen() : typeFlags = typeListeningSocket | typeTcpSocket {
+  _NativeSocket.listen(this.localAddress)
+      : typeFlags = typeListeningSocket | typeTcpSocket {
     isClosedWrite = true;
   }
 
@@ -815,13 +814,13 @@
   String get _serviceTypePath => throw new UnimplementedError();
   String get _serviceTypeName => throw new UnimplementedError();
 
-  Uint8List read(int count) {
+  Uint8List? read(int? count) {
     if (count != null && count <= 0) {
       throw ArgumentError("Illegal length $count");
     }
     if (isClosing || isClosed) return null;
     try {
-      var list;
+      Uint8List? list;
       if (count != null) {
         list = nativeRead(count);
         available = nativeAvailable();
@@ -845,13 +844,18 @@
           list = builder.toBytes();
         }
       }
+      final resourceInformation = resourceInfo;
+      assert(resourceInformation != null ||
+          isPipe ||
+          isInternal ||
+          isInternalSignal);
       if (list != null) {
-        if (resourceInfo != null) {
-          resourceInfo.totalRead += list.length;
+        if (resourceInformation != null) {
+          resourceInformation.totalRead += list.length;
         }
       }
-      if (resourceInfo != null) {
-        resourceInfo.didRead();
+      if (resourceInformation != null) {
+        resourceInformation.didRead();
       }
       if (!const bool.fromEnvironment("dart.vm.product")) {
         _SocketProfile.collectStatistic(
@@ -860,24 +864,27 @@
       return list;
     } catch (e) {
       reportError(e, StackTrace.current, "Read failed");
+      return null;
     }
   }
 
-  Datagram receive() {
+  Datagram? receive() {
     if (isClosing || isClosed) return null;
     try {
-      Datagram result = nativeRecvFrom();
+      Datagram? result = nativeRecvFrom();
       if (result != null) {
-        if (resourceInfo != null) {
-          resourceInfo.totalRead += result.data.length;
+        final resourceInformation = resourceInfo;
+        if (resourceInformation != null) {
+          resourceInformation.totalRead += result.data.length;
         }
       }
-      if (resourceInfo != null) {
-        resourceInfo.didRead();
+      final resourceInformation = resourceInfo;
+      if (resourceInformation != null) {
+        resourceInformation.didRead();
       }
       if (!const bool.fromEnvironment("dart.vm.product")) {
         _SocketProfile.collectStatistic(nativeGetSocketId(),
-            _SocketProfileType.readBytes, result?.data?.length);
+            _SocketProfileType.readBytes, result?.data.length);
       }
       _availableDatagram = nativeAvailableDatagram();
       return result;
@@ -887,9 +894,11 @@
     }
   }
 
-  int write(List<int> buffer, int offset, int bytes) {
-    if (buffer is! List) throw new ArgumentError();
-    if (offset == null) offset = 0;
+  static int _fixOffset(int? offset) => offset ?? 0;
+
+  int write(List<int> buffer, int offset, int? bytes) {
+    // TODO(40614): Remove once non-nullability is sound.
+    offset = _fixOffset(offset);
     if (bytes == null) {
       if (offset > buffer.length) {
         throw new RangeError.value(offset);
@@ -901,9 +910,6 @@
     if ((offset + bytes) > buffer.length) {
       throw new RangeError.value(offset + bytes);
     }
-    if (offset is! int || bytes is! int) {
-      throw new ArgumentError("Invalid arguments to write on Socket");
-    }
     if (isClosing || isClosed) return 0;
     if (bytes == 0) return 0;
     try {
@@ -925,10 +931,13 @@
       }
       // Negate the result, as stated above.
       if (result < 0) result = -result;
-      // TODO(ricow): Remove when we track internal and pipe uses.
-      assert(resourceInfo != null || isPipe || isInternal || isInternalSignal);
-      if (resourceInfo != null) {
-        resourceInfo.addWrite(result);
+      final resourceInformation = resourceInfo;
+      assert(resourceInformation != null ||
+          isPipe ||
+          isInternal ||
+          isInternalSignal);
+      if (resourceInformation != null) {
+        resourceInformation.addWrite(result);
       }
       return result;
     } catch (e) {
@@ -953,8 +962,13 @@
       }
       int result = nativeSendTo(bufferAndStart.buffer, bufferAndStart.start,
           bytes, (address as _InternetAddress)._in_addr, port);
-      if (resourceInfo != null) {
-        resourceInfo.addWrite(result);
+      final resourceInformation = resourceInfo;
+      assert(resourceInformation != null ||
+          isPipe ||
+          isInternal ||
+          isInternalSignal);
+      if (resourceInformation != null) {
+        resourceInformation.addWrite(result);
       }
       return result;
     } catch (e) {
@@ -964,23 +978,25 @@
     }
   }
 
-  _NativeSocket accept() {
+  _NativeSocket? accept() {
     // Don't issue accept if we're closing.
     if (isClosing || isClosed) return null;
     assert(connections > 0);
     connections--;
     tokens++;
     returnTokens(listeningTokenBatchSize);
-    var socket = new _NativeSocket.normal();
+    var socket = new _NativeSocket.normal(address);
     if (nativeAccept(socket) != true) return null;
     socket.localPort = localPort;
-    socket.localAddress = address;
     setupResourceInfo(socket);
-    // TODO(ricow): Remove when we track internal and pipe uses.
-    assert(resourceInfo != null || isPipe || isInternal || isInternalSignal);
-    if (resourceInfo != null) {
+    final resourceInformation = resourceInfo;
+    assert(resourceInformation != null ||
+        isPipe ||
+        isInternal ||
+        isInternalSignal);
+    if (resourceInformation != null) {
       // We track this as read one byte.
-      resourceInfo.addRead(1);
+      resourceInformation.addRead(1);
     }
     return socket;
   }
@@ -1074,7 +1090,7 @@
   void multiplex(Object eventsObj) {
     // TODO(paulberry): when issue #31305 is fixed, we should be able to simply
     // declare `events` as a `covariant int` parameter.
-    int events = eventsObj;
+    int events = eventsObj as int;
     for (int i = firstEvent; i <= lastEvent; i++) {
       if (((events & (1 << i)) != 0)) {
         if ((i == closedEvent || i == readEvent) && isClosedRead) continue;
@@ -1109,11 +1125,13 @@
         if (i == destroyedEvent) {
           assert(isClosing);
           assert(!isClosed);
-          // TODO(ricow): Remove/update when we track internal and pipe uses.
-          assert(
-              resourceInfo != null || isPipe || isInternal || isInternalSignal);
-          if (resourceInfo != null) {
-            _SocketResourceInfo.SocketClosed(resourceInfo);
+          final resourceInformation = resourceInfo;
+          assert(resourceInformation != null ||
+              isPipe ||
+              isInternal ||
+              isInternalSignal);
+          if (resourceInformation != null) {
+            _SocketResourceInfo.SocketClosed(resourceInformation);
           }
           isClosed = true;
           closeCompleter.complete();
@@ -1159,7 +1177,7 @@
     eventHandlers[destroyedEvent] = destroyed;
   }
 
-  void setListening({read: true, write: true}) {
+  void setListening({bool read: true, bool write: true}) {
     sendReadEvents = read;
     sendWriteEvents = write;
     if (read) issueReadEvent();
@@ -1225,7 +1243,7 @@
     int fullData = (typeFlags & typeTypeMask) | data;
     assert(!isClosing);
     connectToEventHandler();
-    _EventHandler._sendData(this, eventPort.sendPort, fullData);
+    _EventHandler._sendData(this, eventPort!.sendPort, fullData);
   }
 
   void connectToEventHandler() {
@@ -1244,8 +1262,7 @@
   }
 
   void disconnectFromEventHandler() {
-    assert(eventPort != null);
-    eventPort.close();
+    eventPort!.close();
     eventPort = null;
     // Now that we don't track this Socket anymore, we can clear the owner
     // field.
@@ -1260,7 +1277,7 @@
   // Create the appropriate error/exception from different returned
   // error objects.
   static createError(error, String message,
-      [InternetAddress address, int port]) {
+      [InternetAddress? address, int? port]) {
     if (error is OSError) {
       return new SocketException(message,
           osError: error, address: address, port: port);
@@ -1282,8 +1299,9 @@
     }
   }
 
-  void reportError(error, StackTrace st, String message) {
-    var e = createError(error, message, address, localPort);
+  void reportError(error, StackTrace? st, String message) {
+    var e =
+        createError(error, message, isUdp || isTcp ? address : null, localPort);
     // Invoke the error handler if any.
     if (eventHandlers[errorEvent] != null) {
       eventHandlers[errorEvent](e, st);
@@ -1292,34 +1310,38 @@
     close();
   }
 
-  getOption(SocketOption option) {
-    if (option == null) throw new ArgumentError.notNull("option");
-    return nativeGetOption(option._value, address.type._value);
+  dynamic getOption(SocketOption option) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(option, "option");
+    var result = nativeGetOption(option._value, address.type._value);
+    if (result is OSError) throw result;
+    return result;
   }
 
   bool setOption(SocketOption option, value) {
-    if (option == null) throw new ArgumentError.notNull("option");
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(option, "option");
     nativeSetOption(option._value, address.type._value, value);
     return true;
   }
 
   Uint8List getRawOption(RawSocketOption option) {
-    if (option == null) throw new ArgumentError.notNull("option");
-    if (option.value == null) throw new ArgumentError.notNull("option.value");
-
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(option, "option");
+    ArgumentError.checkNotNull(option.value, "option.value");
     nativeGetRawOption(option.level, option.option, option.value);
     return option.value;
   }
 
   void setRawOption(RawSocketOption option) {
-    if (option == null) throw new ArgumentError.notNull("option");
-    if (option.value == null) throw new ArgumentError.notNull("option.value");
-
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(option, "option");
+    ArgumentError.checkNotNull(option.value, "option.value");
     nativeSetRawOption(option.level, option.option, option.value);
   }
 
-  InternetAddress multicastAddress(
-      InternetAddress addr, NetworkInterface interface) {
+  InternetAddress? multicastAddress(
+      InternetAddress addr, NetworkInterface? interface) {
     // On Mac OS using the interface index for joining IPv4 multicast groups
     // is not supported. Here the IP address of the interface is needed.
     if (Platform.isMacOS && addr.type == InternetAddressType.IPv4) {
@@ -1342,15 +1364,17 @@
     }
   }
 
-  void joinMulticast(InternetAddress addr, NetworkInterface interface) {
-    _InternetAddress interfaceAddr = multicastAddress(addr, interface);
+  void joinMulticast(InternetAddress addr, NetworkInterface? interface) {
+    final interfaceAddr =
+        multicastAddress(addr, interface) as _InternetAddress?;
     var interfaceIndex = interface == null ? 0 : interface.index;
     nativeJoinMulticast((addr as _InternetAddress)._in_addr,
         interfaceAddr?._in_addr, interfaceIndex);
   }
 
-  void leaveMulticast(InternetAddress addr, NetworkInterface interface) {
-    _InternetAddress interfaceAddr = multicastAddress(addr, interface);
+  void leaveMulticast(InternetAddress addr, NetworkInterface? interface) {
+    final interfaceAddr =
+        multicastAddress(addr, interface) as _InternetAddress?;
     var interfaceIndex = interface == null ? 0 : interface.index;
     nativeLeaveMulticast((addr as _InternetAddress)._in_addr,
         interfaceAddr?._in_addr, interfaceIndex);
@@ -1359,8 +1383,8 @@
   void nativeSetSocketId(int id, int typeFlags) native "Socket_SetSocketId";
   int nativeAvailable() native "Socket_Available";
   bool nativeAvailableDatagram() native "Socket_AvailableDatagram";
-  Uint8List nativeRead(int len) native "Socket_Read";
-  Datagram nativeRecvFrom() native "Socket_RecvFrom";
+  Uint8List? nativeRead(int len) native "Socket_Read";
+  Datagram? nativeRecvFrom() native "Socket_RecvFrom";
   int nativeWrite(List<int> buffer, int offset, int bytes)
       native "Socket_WriteList";
   int nativeSendTo(List<int> buffer, int offset, int bytes, Uint8List address,
@@ -1392,15 +1416,15 @@
       native "Socket_SetOption";
   void nativeSetRawOption(int level, int option, Uint8List data)
       native "Socket_SetRawOption";
-  void nativeJoinMulticast(Uint8List addr, Uint8List interfaceAddr,
+  void nativeJoinMulticast(Uint8List addr, Uint8List? interfaceAddr,
       int interfaceIndex) native "Socket_JoinMulticast";
-  void nativeLeaveMulticast(Uint8List addr, Uint8List interfaceAddr,
+  void nativeLeaveMulticast(Uint8List addr, Uint8List? interfaceAddr,
       int interfaceIndex) native "Socket_LeaveMulticast";
 }
 
 class _RawServerSocket extends Stream<RawSocket> implements RawServerSocket {
   final _NativeSocket _socket;
-  StreamController<RawSocket> _controller;
+  StreamController<RawSocket>? _controller;
   bool _v6Only;
 
   static Future<_RawServerSocket> bind(
@@ -1413,13 +1437,13 @@
 
   _RawServerSocket(this._socket, this._v6Only);
 
-  StreamSubscription<RawSocket> listen(void onData(RawSocket event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<RawSocket> listen(void onData(RawSocket event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     if (_controller != null) {
       throw new StateError("Stream was already listened to");
     }
     var zone = Zone.current;
-    _controller = new StreamController(
+    final controller = _controller = new StreamController(
         sync: true,
         onListen: _onSubscriptionStateChange,
         onCancel: _onSubscriptionStateChange,
@@ -1434,16 +1458,16 @@
               _SocketProfile.collectNewSocket(socket.nativeGetSocketId(),
                   _tcpSocket, socket.address, socket.port);
             }
-            _controller.add(_RawSocket(socket));
-            if (_controller.isPaused) return;
+            controller.add(_RawSocket(socket));
+            if (controller.isPaused) return;
           }
         }),
-        error: zone.bindBinaryCallbackGuarded((e, st) {
-          _controller.addError(e, st);
-          _controller.close();
+        error: zone.bindBinaryCallbackGuarded((Object e, StackTrace? st) {
+          controller.addError(e, st);
+          controller.close();
         }),
-        destroyed: () => _controller.close());
-    return _controller.stream.listen(onData,
+        destroyed: () => controller.close());
+    return controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
@@ -1464,7 +1488,7 @@
   }
 
   void _onSubscriptionStateChange() {
-    if (_controller.hasListener) {
+    if (_controller!.hasListener) {
       _resume();
     } else {
       _socket.close();
@@ -1472,7 +1496,7 @@
   }
 
   void _onPauseStateChange() {
-    if (_controller.isPaused) {
+    if (_controller!.isPaused) {
       _pause();
     } else {
       _resume();
@@ -1486,7 +1510,7 @@
 
 class _RawSocket extends Stream<RawSocketEvent> implements RawSocket {
   final _NativeSocket _socket;
-  StreamController<RawSocketEvent> _controller;
+  final _controller = new StreamController<RawSocketEvent>(sync: true);
   bool _readEventsEnabled = true;
   bool _writeEventsEnabled = true;
 
@@ -1494,7 +1518,7 @@
   bool _isMacOSTerminalInput = false;
 
   static Future<RawSocket> connect(
-      host, int port, sourceAddress, Duration timeout) {
+      dynamic host, int port, dynamic sourceAddress, Duration? timeout) {
     return _NativeSocket.connect(host, port, sourceAddress, timeout)
         .then((socket) {
       if (!const bool.fromEnvironment("dart.vm.product")) {
@@ -1506,7 +1530,7 @@
   }
 
   static Future<ConnectionTask<_RawSocket>> startConnect(
-      host, int port, sourceAddress) {
+      dynamic host, int port, dynamic sourceAddress) {
     return _NativeSocket.startConnect(host, port, sourceAddress)
         .then((ConnectionTask<_NativeSocket> nativeTask) {
       final Future<_RawSocket> raw =
@@ -1517,19 +1541,17 @@
         }
         return _RawSocket(nativeSocket);
       });
-      return ConnectionTask<_RawSocket>._(
-          socket: raw, onCancel: nativeTask._onCancel);
+      return ConnectionTask<_RawSocket>._(raw, nativeTask._onCancel);
     });
   }
 
   _RawSocket(this._socket) {
     var zone = Zone.current;
-    _controller = new StreamController(
-        sync: true,
-        onListen: _onSubscriptionStateChange,
-        onCancel: _onSubscriptionStateChange,
-        onPause: _onPauseStateChange,
-        onResume: _onPauseStateChange);
+    _controller
+      ..onListen = _onSubscriptionStateChange
+      ..onCancel = _onSubscriptionStateChange
+      ..onPause = _onPauseStateChange
+      ..onResume = _onPauseStateChange;
     _socket.setHandlers(
         read: () => _controller.add(RawSocketEvent.read),
         write: () {
@@ -1543,7 +1565,7 @@
           _controller.add(RawSocketEvent.closed);
           _controller.close();
         },
-        error: zone.bindBinaryCallbackGuarded((e, st) {
+        error: zone.bindBinaryCallbackGuarded((Object e, StackTrace? st) {
           _controller.addError(e, st);
           _socket.close();
         }));
@@ -1556,7 +1578,7 @@
     return new _RawSocket(native);
   }
 
-  factory _RawSocket._readPipe(int fd) {
+  factory _RawSocket._readPipe(int? fd) {
     var native = new _NativeSocket.pipe();
     native.isClosedWrite = true;
     if (fd != null) _getStdioHandle(native, fd);
@@ -1569,15 +1591,15 @@
     return result;
   }
 
-  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
   int available() => _socket.available;
 
-  Uint8List read([int len]) {
+  Uint8List? read([int? len]) {
     if (_isMacOSTerminalInput) {
       var available = this.available();
       if (available == 0) return null;
@@ -1593,7 +1615,7 @@
     }
   }
 
-  int write(List<int> buffer, [int offset, int count]) =>
+  int write(List<int> buffer, [int offset = 0, int? count]) =>
       _socket.write(buffer, offset, count);
 
   Future<RawSocket> close() => _socket.close().then<RawSocket>((_) {
@@ -1686,8 +1708,8 @@
 
   _ServerSocket(this._socket);
 
-  StreamSubscription<Socket> listen(void onData(Socket event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Socket> listen(void onData(Socket event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _socket.map<Socket>((rawSocket) => new _Socket(rawSocket)).listen(
         onData,
         onError: onError,
@@ -1710,39 +1732,38 @@
 @patch
 class Socket {
   @patch
-  static Future<Socket> _connect(host, int port,
-      {sourceAddress, Duration timeout}) {
+  static Future<Socket> _connect(dynamic host, int port,
+      {dynamic sourceAddress, Duration? timeout}) {
     return RawSocket.connect(host, port,
             sourceAddress: sourceAddress, timeout: timeout)
         .then((socket) => new _Socket(socket));
   }
 
   @patch
-  static Future<ConnectionTask<Socket>> _startConnect(host, int port,
-      {sourceAddress}) {
+  static Future<ConnectionTask<Socket>> _startConnect(dynamic host, int port,
+      {dynamic sourceAddress}) {
     return RawSocket.startConnect(host, port, sourceAddress: sourceAddress)
         .then((rawTask) {
       Future<Socket> socket =
           rawTask.socket.then((rawSocket) => new _Socket(rawSocket));
-      return new ConnectionTask<Socket>._(
-          socket: socket, onCancel: rawTask._onCancel);
+      return new ConnectionTask<Socket>._(socket, rawTask._onCancel);
     });
   }
 }
 
 class _SocketStreamConsumer extends StreamConsumer<List<int>> {
-  StreamSubscription subscription;
+  StreamSubscription? subscription;
   final _Socket socket;
-  int offset;
-  List<int> buffer;
+  int? offset;
+  List<int>? buffer;
   bool paused = false;
-  Completer streamCompleter;
+  Completer<Socket>? streamCompleter;
 
   _SocketStreamConsumer(this.socket);
 
   Future<Socket> addStream(Stream<List<int>> stream) {
     socket._ensureRawSocketSubscription();
-    streamCompleter = new Completer<Socket>();
+    final completer = streamCompleter = new Completer<Socket>();
     if (socket._raw != null) {
       subscription = stream.listen((data) {
         assert(!paused);
@@ -1763,7 +1784,7 @@
         done();
       }, cancelOnError: true);
     }
-    return streamCompleter.future;
+    return completer.future;
   }
 
   Future<Socket> close() {
@@ -1772,39 +1793,42 @@
   }
 
   void write() {
-    if (subscription == null) return;
-    assert(buffer != null);
+    final sub = subscription;
+    if (sub == null) return;
     // Write as much as possible.
-    offset += socket._write(buffer, offset, buffer.length - offset);
-    if (offset < buffer.length) {
+    offset =
+        offset! + socket._write(buffer!, offset!, buffer!.length - offset!);
+    if (offset! < buffer!.length) {
       if (!paused) {
         paused = true;
-        subscription.pause();
+        sub.pause();
       }
       socket._enableWriteEvent();
     } else {
       buffer = null;
       if (paused) {
         paused = false;
-        subscription.resume();
+        sub.resume();
       }
     }
   }
 
   void done([error, stackTrace]) {
-    if (streamCompleter != null) {
+    final completer = streamCompleter;
+    if (completer != null) {
       if (error != null) {
-        streamCompleter.completeError(error, stackTrace);
+        completer.completeError(error, stackTrace);
       } else {
-        streamCompleter.complete(socket);
+        completer.complete(socket);
       }
       streamCompleter = null;
     }
   }
 
   void stop() {
-    if (subscription == null) return;
-    subscription.cancel();
+    final sub = subscription;
+    if (sub == null) return;
+    sub.cancel();
     subscription = null;
     paused = false;
     socket._disableWriteEvent();
@@ -1812,37 +1836,36 @@
 }
 
 class _Socket extends Stream<Uint8List> implements Socket {
-  RawSocket _raw; // Set to null when the raw socket is closed.
+  RawSocket? _raw; // Set to null when the raw socket is closed.
   bool _closed = false; // Set to true when the raw socket is closed.
-  StreamController<Uint8List> _controller;
+  final _controller = new StreamController<Uint8List>(sync: true);
   bool _controllerClosed = false;
-  _SocketStreamConsumer _consumer;
-  IOSink _sink;
-  var _subscription;
+  late _SocketStreamConsumer _consumer;
+  late IOSink _sink;
+  StreamSubscription? _subscription;
   var _detachReady;
 
-  _Socket(this._raw) {
-    _controller = new StreamController<Uint8List>(
-        sync: true,
-        onListen: _onSubscriptionStateChange,
-        onCancel: _onSubscriptionStateChange,
-        onPause: _onPauseStateChange,
-        onResume: _onPauseStateChange);
+  _Socket(RawSocket raw) : _raw = raw {
+    _controller
+      ..onListen = _onSubscriptionStateChange
+      ..onCancel = _onSubscriptionStateChange
+      ..onPause = _onPauseStateChange
+      ..onResume = _onPauseStateChange;
     _consumer = new _SocketStreamConsumer(this);
     _sink = new IOSink(_consumer);
 
     // Disable read events until there is a subscription.
-    _raw.readEventsEnabled = false;
+    raw.readEventsEnabled = false;
 
     // Disable write events until the consumer needs it for pending writes.
-    _raw.writeEventsEnabled = false;
+    raw.writeEventsEnabled = false;
   }
 
   factory _Socket._writePipe() {
     return new _Socket(new _RawSocket._writePipe());
   }
 
-  factory _Socket._readPipe([int fd]) {
+  factory _Socket._readPipe([int? fd]) {
     return new _Socket(new _RawSocket._readPipe(fd));
   }
 
@@ -1852,8 +1875,8 @@
   // is Socket and not _NativeSocket.
   _NativeSocket get _nativeSocket => (_raw as _RawSocket)._socket;
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -1864,17 +1887,18 @@
     _sink.encoding = value;
   }
 
-  void write(Object obj) => _sink.write(obj);
+  void write(Object? obj) => _sink.write(obj);
 
-  void writeln([Object obj = ""]) => _sink.writeln(obj);
+  void writeln([Object? obj = ""]) => _sink.writeln(obj);
 
   void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
 
-  void writeAll(Iterable objects, [sep = ""]) => _sink.writeAll(objects, sep);
+  void writeAll(Iterable objects, [String sep = ""]) =>
+      _sink.writeAll(objects, sep);
 
   void add(List<int> bytes) => _sink.add(bytes);
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
     throw new UnsupportedError("Cannot send errors on sockets");
   }
 
@@ -1898,38 +1922,45 @@
   }
 
   bool setOption(SocketOption option, bool enabled) {
-    if (_raw == null) throw const SocketException.closed();
-    return _raw.setOption(option, enabled);
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    return raw.setOption(option, enabled);
   }
 
   Uint8List getRawOption(RawSocketOption option) {
-    if (_raw == null) throw const SocketException.closed();
-    return _raw.getRawOption(option);
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    return raw.getRawOption(option);
   }
 
   void setRawOption(RawSocketOption option) {
-    if (_raw == null) throw const SocketException.closed();
-    _raw.setRawOption(option);
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    raw.setRawOption(option);
   }
 
   int get port {
-    if (_raw == null) throw const SocketException.closed();
-    return _raw.port;
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    return raw.port;
   }
 
   InternetAddress get address {
-    if (_raw == null) throw const SocketException.closed();
-    return _raw.address;
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    return raw.address;
   }
 
   int get remotePort {
-    if (_raw == null) throw const SocketException.closed();
-    return _raw.remotePort;
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    return raw.remotePort;
   }
 
   InternetAddress get remoteAddress {
-    if (_raw == null) throw const SocketException.closed();
-    return _raw.remoteAddress;
+    final raw = _raw;
+    if (raw == null) throw const SocketException.closed();
+    return raw.remoteAddress;
   }
 
   Future _detachRaw() {
@@ -1947,45 +1978,45 @@
   // consumer needs a subscription as they share the error and done
   // events from the raw socket.
   void _ensureRawSocketSubscription() {
-    if (_subscription == null && _raw != null) {
-      _subscription = _raw.listen(_onData,
+    final raw = _raw;
+    if (_subscription == null && raw != null) {
+      _subscription = raw.listen(_onData,
           onError: _onError, onDone: _onDone, cancelOnError: true);
     }
   }
 
   _closeRawSocket() {
-    var tmp = _raw;
+    var raw = _raw!;
     _raw = null;
     _closed = true;
-    tmp.close();
+    raw.close();
   }
 
   void _onSubscriptionStateChange() {
+    final raw = _raw;
     if (_controller.hasListener) {
       _ensureRawSocketSubscription();
       // Enable read events for providing data to subscription.
-      if (_raw != null) {
-        _raw.readEventsEnabled = true;
+      if (raw != null) {
+        raw.readEventsEnabled = true;
       }
     } else {
       _controllerClosed = true;
-      if (_raw != null) {
-        _raw.shutdown(SocketDirection.receive);
+      if (raw != null) {
+        raw.shutdown(SocketDirection.receive);
       }
     }
   }
 
   void _onPauseStateChange() {
-    if (_raw != null) {
-      _raw.readEventsEnabled = !_controller.isPaused;
-    }
+    _raw?.readEventsEnabled = !_controller.isPaused;
   }
 
   void _onData(event) {
     switch (event) {
       case RawSocketEvent.read:
         if (_raw == null) break;
-        var buffer = _raw.read();
+        var buffer = _raw!.read();
         if (buffer != null) _controller.add(buffer);
         break;
       case RawSocketEvent.write:
@@ -2016,30 +2047,28 @@
   }
 
   int _write(List<int> data, int offset, int length) {
-    if (_raw != null) {
-      return _raw.write(data, offset, length);
+    final raw = _raw;
+    if (raw != null) {
+      return raw.write(data, offset, length);
     }
     return 0;
   }
 
   void _enableWriteEvent() {
-    if (_raw != null) {
-      _raw.writeEventsEnabled = true;
-    }
+    _raw?.writeEventsEnabled = true;
   }
 
   void _disableWriteEvent() {
-    if (_raw != null) {
-      _raw.writeEventsEnabled = false;
-    }
+    _raw?.writeEventsEnabled = false;
   }
 
   void _consumerDone() {
     if (_detachReady != null) {
       _detachReady.complete(null);
     } else {
-      if (_raw != null) {
-        _raw.shutdown(SocketDirection.send);
+      final raw = _raw;
+      if (raw != null) {
+        raw.shutdown(SocketDirection.send);
         _disableWriteEvent();
       }
     }
@@ -2064,7 +2093,7 @@
 class _RawDatagramSocket extends Stream<RawSocketEvent>
     implements RawDatagramSocket {
   _NativeSocket _socket;
-  StreamController<RawSocketEvent> _controller;
+  late StreamController<RawSocketEvent> _controller;
   bool _readEventsEnabled = true;
   bool _writeEventsEnabled = true;
 
@@ -2089,7 +2118,7 @@
           _controller.add(RawSocketEvent.closed);
           _controller.close();
         },
-        error: zone.bindBinaryCallbackGuarded((e, st) {
+        error: zone.bindBinaryCallbackGuarded((Object e, StackTrace? st) {
           _controller.addError(e, st);
           _socket.close();
         }));
@@ -2109,8 +2138,8 @@
     });
   }
 
-  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -2126,15 +2155,15 @@
   int send(List<int> buffer, InternetAddress address, int port) =>
       _socket.send(buffer, 0, buffer.length, address, port);
 
-  Datagram receive() {
+  Datagram? receive() {
     return _socket.receive();
   }
 
-  void joinMulticast(InternetAddress group, [NetworkInterface interface]) {
+  void joinMulticast(InternetAddress group, [NetworkInterface? interface]) {
     _socket.joinMulticast(group, interface);
   }
 
-  void leaveMulticast(InternetAddress group, [NetworkInterface interface]) {
+  void leaveMulticast(InternetAddress group, [NetworkInterface? interface]) {
     _socket.leaveMulticast(group, interface);
   }
 
@@ -2164,7 +2193,7 @@
       _socket.setOption(SocketOption._ipMulticastHops, value);
 
   NetworkInterface get multicastInterface => throw UnimplementedError();
-  void set multicastInterface(NetworkInterface value) =>
+  void set multicastInterface(NetworkInterface? value) =>
       throw UnimplementedError();
 
   bool get broadcastEnabled => _socket.getOption(SocketOption._ipBroadcast);
diff --git a/sdk/lib/_internal/vm/bin/stdio_patch.dart b/sdk/lib/_internal/vm/bin/stdio_patch.dart
index 217f3a3..bc32221 100644
--- a/sdk/lib/_internal/vm/bin/stdio_patch.dart
+++ b/sdk/lib/_internal/vm/bin/stdio_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -24,6 +22,7 @@
       case _stdioHandleTypeFile:
         return new Stdin._(new _FileStream.forStdin(), fd);
     }
+    throw new UnsupportedError("Unexpected handle type $type");
   }
 
   @patch
@@ -37,7 +36,7 @@
   }
 
   @patch
-  static int _socketType(Socket socket) {
+  static int? _socketType(Socket socket) {
     if (socket is _Socket) return _nativeSocketType(socket._nativeSocket);
     return null;
   }
diff --git a/sdk/lib/_internal/vm/bin/sync_socket_patch.dart b/sdk/lib/_internal/vm/bin/sync_socket_patch.dart
index bccdd4f..f602449 100644
--- a/sdk/lib/_internal/vm/bin/sync_socket_patch.dart
+++ b/sdk/lib/_internal/vm/bin/sync_socket_patch.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.6
-
 // part of "common_patch.dart";
 
 @patch
@@ -34,14 +32,14 @@
 
   void closeSync() => _socket.closeSync();
 
-  int readIntoSync(List<int> buffer, [int start = 0, int end]) =>
+  int readIntoSync(List<int> buffer, [int start = 0, int? end]) =>
       _socket.readIntoSync(buffer, start, end);
 
-  List<int> readSync(int bytes) => _socket.readSync(bytes);
+  List<int>? readSync(int bytes) => _socket.readSync(bytes);
 
   void shutdown(SocketDirection direction) => _socket.shutdown(direction);
 
-  void writeFromSync(List<int> buffer, [int start = 0, int end]) =>
+  void writeFromSync(List<int> buffer, [int start = 0, int? end]) =>
       _socket.writeFromSync(buffer, start, end);
 }
 
@@ -57,18 +55,19 @@
   bool isClosedWrite = false;
 
   // Holds the address used to connect the socket.
-  InternetAddress localAddress;
+  late InternetAddress localAddress;
 
   // Holds the port of the socket, 0 if not known.
   int localPort = 0;
 
-  _ReadWriteResourceInfo resourceInfo;
+  // Always set by setupResourceInfo called by connectSync.
+  late _SocketResourceInfo resourceInfo;
 
   static _NativeSynchronousSocket connectSync(host, int port) {
     if (host == null) {
       throw new ArgumentError("Parameter host cannot be null");
     }
-    List<_InternetAddress> addresses = null;
+    late List<_InternetAddress> addresses;
     var error = null;
     if (host is _InternetAddress) {
       addresses = [host];
@@ -82,7 +81,6 @@
         throw createError(error, "Failed host lookup: '$host'");
       }
     }
-    assert(addresses is List);
     var it = addresses.iterator;
     _NativeSynchronousSocket connectNext() {
       if (!it.moveNext()) {
@@ -174,7 +172,7 @@
   // Create the appropriate error/exception from different returned
   // error objects.
   static createError(error, String message,
-      [InternetAddress address, int port]) {
+      [InternetAddress? address, int? port]) {
     if (error is OSError) {
       return new SocketException(message,
           osError: error, address: address, port: port);
@@ -189,35 +187,26 @@
     if (response is OSError) {
       throw response;
     }
-    List<_InternetAddress> addresses =
-        new List<_InternetAddress>(response.length);
-    for (int i = 0; i < response.length; ++i) {
-      var result = response[i];
-      var type = InternetAddressType._from(result[0]);
-      addresses[i] = _InternetAddress(type, result[1], host, result[2]);
-    }
-    return addresses;
+    return <_InternetAddress>[
+      for (int i = 0; i < response.length; ++i)
+        new _InternetAddress(InternetAddressType._from(response[i][0]),
+            response[i][1], host, response[i][2]),
+    ];
   }
 
-  int readIntoSync(List<int> buffer, int start, int end) {
+  int readIntoSync(List<int> buffer, int start, int? end) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(buffer, "buffer");
+    ArgumentError.checkNotNull(start, "start");
     _checkAvailable();
     if (isClosedRead) {
       throw new SocketException("Socket is closed for reading");
     }
-
-    if ((buffer is! List) ||
-        ((start != null) && (start is! int)) ||
-        ((end != null) && (end is! int))) {
-      throw new ArgumentError("Invalid arguments to readIntoSync");
-    }
-    if (start == null) {
-      throw new ArgumentError("start cannot be null");
-    }
     end = RangeError.checkValidRange(start, end, buffer.length);
     if (end == start) {
       return 0;
     }
-    var result = _nativeReadInto(buffer, start, (end - start));
+    var result = _nativeReadInto(buffer, start, end - start);
     if (result is OSError) {
       throw new SocketException("readIntoSync failed", osError: result);
     }
@@ -225,7 +214,7 @@
     return result;
   }
 
-  List<int> readSync(int len) {
+  List<int>? readSync(int len) {
     _checkAvailable();
     if (isClosedRead) {
       throw new SocketException("Socket is closed for reading");
@@ -241,15 +230,10 @@
     if (result is OSError) {
       throw result;
     }
-    assert(resourceInfo != null);
-    if (result != null) {
-      if (resourceInfo != null) {
-        resourceInfo.totalRead += result.length;
-      }
+    if (result is List<int>) {
+      resourceInfo.totalRead += result.length;
     }
-    if (resourceInfo != null) {
-      resourceInfo.didRead();
-    }
+    resourceInfo.didRead();
     return result;
   }
 
@@ -300,25 +284,18 @@
     isClosedWrite = true;
   }
 
-  void writeFromSync(List<int> buffer, int start, int end) {
+  void writeFromSync(List<int> buffer, int start, int? end) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(buffer, "buffer");
+    ArgumentError.checkNotNull(start, "start");
     _checkAvailable();
     if (isClosedWrite) {
       throw new SocketException("Socket is closed for writing");
     }
-    if ((buffer is! List) ||
-        ((start != null) && (start is! int)) ||
-        ((end != null) && (end is! int))) {
-      throw new ArgumentError("Invalid arguments to writeFromSync");
-    }
-    if (start == null) {
-      throw new ArgumentError("start cannot be equal to null");
-    }
-
     end = RangeError.checkValidRange(start, end, buffer.length);
     if (end == start) {
       return;
     }
-
     _BufferAndStart bufferAndStart =
         _ensureFastAndSerializableByteData(buffer, start, end);
     var result = _nativeWrite(bufferAndStart.buffer, bufferAndStart.start,
@@ -326,10 +303,7 @@
     if (result is OSError) {
       throw new SocketException("writeFromSync failed", osError: result);
     }
-    assert(resourceInfo != null);
-    if (resourceInfo != null) {
-      resourceInfo.addWrite(result);
-    }
+    resourceInfo.addWrite(result);
   }
 
   void _checkAvailable() {
diff --git a/sdk/lib/_internal/vm/bin/vmservice_io.dart b/sdk/lib/_internal/vm/bin/vmservice_io.dart
index 06564f5..aea026b 100644
--- a/sdk/lib/_internal/vm/bin/vmservice_io.dart
+++ b/sdk/lib/_internal/vm/bin/vmservice_io.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.6
-
 library vmservice_io;
 
 import 'dart:async';
@@ -14,45 +12,48 @@
 part 'vmservice_server.dart';
 
 // The TCP ip/port that the HTTP server listens on.
-@pragma("vm:entry-point")
-int _port;
-@pragma("vm:entry-point")
-String _ip;
+@pragma('vm:entry-point')
+int _port = 0;
+@pragma('vm:entry-point')
+String _ip = '';
 // Should the HTTP server auto start?
-@pragma("vm:entry-point")
-bool _autoStart;
+@pragma('vm:entry-point')
+bool _autoStart = false;
 // Should the HTTP server require an auth code?
-@pragma("vm:entry-point")
-bool _authCodesDisabled;
+@pragma('vm:entry-point')
+bool _authCodesDisabled = false;
 // Should the HTTP server run in devmode?
-@pragma("vm:entry-point")
-bool _originCheckDisabled;
+@pragma('vm:entry-point')
+bool _originCheckDisabled = false;
 // Location of file to output VM service connection info.
-@pragma("vm:entry-point")
-String _serviceInfoFilename;
-@pragma("vm:entry-point")
+@pragma('vm:entry-point')
+String? _serviceInfoFilename;
+@pragma('vm:entry-point')
 bool _isWindows = false;
-@pragma("vm:entry-point")
+@pragma('vm:entry-point')
 bool _isFuchsia = false;
-@pragma("vm:entry-point")
-var _signalWatch;
+@pragma('vm:entry-point')
+var _signalWatch = null;
 var _signalSubscription;
 @pragma("vm:entry-point")
 bool _enableServicePortFallback = false;
 
 // HTTP server.
-Server server;
-Future<Server> serverFuture;
+Server? server;
+Future<Server>? serverFuture;
 
-_lazyServerBoot() {
-  if (server != null) {
-    return;
+Server _lazyServerBoot() {
+  var localServer = server;
+  if (localServer != null) {
+    return localServer;
   }
   // Lazily create service.
-  var service = new VMService();
+  final service = VMService();
   // Lazily create server.
-  server = new Server(service, _ip, _port, _originCheckDisabled,
+  localServer = Server(service, _ip, _port, _originCheckDisabled,
       _authCodesDisabled, _serviceInfoFilename, _enableServicePortFallback);
+  server = localServer;
+  return localServer;
 }
 
 Future cleanupCallback() async {
@@ -61,15 +62,16 @@
     await _signalSubscription.cancel();
     _signalSubscription = null;
   }
-  if (server != null) {
+  final localServer = server;
+  if (localServer != null) {
     try {
-      await server.cleanup(true);
+      await localServer.cleanup(true);
     } catch (e, st) {
-      print("Error in vm-service shutdown: $e\n$st\n");
+      print('Error in vm-service shutdown: $e\n$st\n');
     }
   }
   if (_registerSignalHandlerTimer != null) {
-    _registerSignalHandlerTimer.cancel();
+    _registerSignalHandlerTimer!.cancel();
     _registerSignalHandlerTimer = null;
   }
   // Call out to embedder's shutdown callback.
@@ -77,40 +79,38 @@
 }
 
 Future<Uri> createTempDirCallback(String base) async {
-  Directory temp = await Directory.systemTemp.createTemp(base);
+  final temp = await Directory.systemTemp.createTemp(base);
   // Underneath the temporary directory, create a directory with the
   // same name as the DevFS name [base].
-  var fsUri = temp.uri.resolveUri(new Uri.directory(base));
-  await new Directory.fromUri(fsUri).create();
+  final fsUri = temp.uri.resolveUri(Uri.directory(base));
+  await Directory.fromUri(fsUri).create();
   return fsUri;
 }
 
-Future deleteDirCallback(Uri path) async {
-  Directory dir = new Directory.fromUri(path);
-  await dir.delete(recursive: true);
-}
+Future deleteDirCallback(Uri path) async =>
+    await Directory.fromUri(path).delete(recursive: true);
 
 class PendingWrite {
   PendingWrite(this.uri, this.bytes);
-  final Completer completer = new Completer();
+  final completer = Completer<void>();
   final Uri uri;
   final List<int> bytes;
 
   Future write() async {
-    var file = new File.fromUri(uri);
-    var parent_directory = file.parent;
+    final file = File.fromUri(uri);
+    final parent_directory = file.parent;
     await parent_directory.create(recursive: true);
     if (await file.exists()) {
       await file.delete();
     }
-    var result = await file.writeAsBytes(bytes);
-    completer.complete(null);
+    await file.writeAsBytes(bytes);
+    completer.complete();
     WriteLimiter._writeCompleted();
   }
 }
 
 class WriteLimiter {
-  static final List<PendingWrite> pendingWrites = new List<PendingWrite>();
+  static final pendingWrites = <PendingWrite>[];
 
   // non-rooted Android devices have a very low limit for the number of
   // open files. Artificially cap ourselves to 16.
@@ -119,7 +119,7 @@
 
   static Future scheduleWrite(Uri path, List<int> bytes) async {
     // Create a new pending write.
-    PendingWrite pw = new PendingWrite(path, bytes);
+    final pw = PendingWrite(path, bytes);
     pendingWrites.add(pw);
     _maybeWriteFiles();
     return pw.completer.future;
@@ -128,7 +128,7 @@
   static _maybeWriteFiles() {
     while (openWrites < kMaxOpenWrites) {
       if (pendingWrites.length > 0) {
-        PendingWrite pw = pendingWrites.removeLast();
+        final pw = pendingWrites.removeLast();
         pw.write();
         openWrites++;
       } else {
@@ -144,38 +144,35 @@
   }
 }
 
-Future writeFileCallback(Uri path, List<int> bytes) async {
-  return WriteLimiter.scheduleWrite(path, bytes);
-}
+Future writeFileCallback(Uri path, List<int> bytes) async =>
+    WriteLimiter.scheduleWrite(path, bytes);
 
-Future writeStreamFileCallback(Uri path, Stream<List<int>> bytes) async {
-  var file = new File.fromUri(path);
-  var parent_directory = file.parent;
+Future<void> writeStreamFileCallback(Uri path, Stream<List<int>> bytes) async {
+  final file = File.fromUri(path);
+  final parent_directory = file.parent;
   await parent_directory.create(recursive: true);
   if (await file.exists()) {
     await file.delete();
   }
-  IOSink sink = await file.openWrite();
+  final sink = await file.openWrite();
   await sink.addStream(bytes);
   await sink.close();
 }
 
-Future<List<int>> readFileCallback(Uri path) async {
-  var file = new File.fromUri(path);
-  return await file.readAsBytes();
-}
+Future<List<int>> readFileCallback(Uri path) async =>
+    await File.fromUri(path).readAsBytes();
 
 Future<List<Map<String, dynamic>>> listFilesCallback(Uri dirPath) async {
-  var dir = new Directory.fromUri(dirPath);
-  var dirPathStr = dirPath.path;
-  var stream = dir.list(recursive: true);
-  var result = <Map<String, dynamic>>[];
+  final dir = Directory.fromUri(dirPath);
+  final dirPathStr = dirPath.path;
+  final stream = dir.list(recursive: true);
+  final result = <Map<String, dynamic>>[];
   await for (var fileEntity in stream) {
-    var filePath = new Uri.file(fileEntity.path).path;
-    var stat = await fileEntity.stat();
-    if (stat.type == FileSystemEntityType.FILE &&
+    final filePath = Uri.file(fileEntity.path).path;
+    final stat = await fileEntity.stat();
+    if (stat.type == FileSystemEntityType.file &&
         filePath.startsWith(dirPathStr)) {
-      var map = <String, dynamic>{};
+      final map = <String, dynamic>{};
       map['name'] = '/' + filePath.substring(dirPathStr.length);
       map['size'] = stat.size;
       map['modified'] = stat.modified.millisecondsSinceEpoch;
@@ -185,33 +182,26 @@
   return result;
 }
 
-Future<Uri> serverInformationCallback() async {
-  _lazyServerBoot();
-  return server.serverAddress;
-}
+Uri? serverInformationCallback() => _lazyServerBoot().serverAddress;
 
-Future<Uri> webServerControlCallback(bool enable) async {
-  _lazyServerBoot();
-  if (server.running == enable) {
-    // No change.
-    return server.serverAddress;
+Future<Uri?> webServerControlCallback(bool enable) async {
+  final _server = _lazyServerBoot();
+  if (_server.running != enable) {
+    if (enable) {
+      await _server.startup();
+    } else {
+      await _server.shutdown(true);
+    }
   }
-
-  if (enable) {
-    await server.startup();
-    return server.serverAddress;
-  } else {
-    await server.shutdown(true);
-    return server.serverAddress;
-  }
+  return _server.serverAddress;
 }
 
 void webServerAcceptNewWebSocketConnections(bool enable) {
-  _lazyServerBoot();
-  server.acceptNewWebSocketConnections = enable;
+  final _server = _lazyServerBoot();
+  _server.acceptNewWebSocketConnections = enable;
 }
 
-Null _clearFuture(_) {
+void _clearFuture(_) {
   serverFuture = null;
 }
 
@@ -220,16 +210,16 @@
     // Still waiting.
     return;
   }
-  _lazyServerBoot();
+  final _server = _lazyServerBoot();
   // Toggle HTTP server.
-  if (server.running) {
-    serverFuture = server.shutdown(true).then(_clearFuture);
+  if (_server.running) {
+    _server.shutdown(true).then(_clearFuture);
   } else {
-    serverFuture = server.startup().then(_clearFuture);
+    _server.startup().then(_clearFuture);
   }
 }
 
-Timer _registerSignalHandlerTimer;
+Timer? _registerSignalHandlerTimer;
 
 _registerSignalHandler() {
   _registerSignalHandlerTimer = null;
@@ -241,10 +231,10 @@
     // Cannot register for signals on Windows or Fuchsia.
     return;
   }
-  _signalSubscription = _signalWatch(ProcessSignal.SIGQUIT).listen(_onSignal);
+  _signalSubscription = _signalWatch(ProcessSignal.sigquit).listen(_onSignal);
 }
 
-@pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
+@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
 main() {
   // Set embedder hooks.
   VMServiceEmbedderHooks.cleanup = cleanupCallback;
@@ -260,17 +250,17 @@
       webServerAcceptNewWebSocketConnections;
   // Always instantiate the vmservice object so that the exit message
   // can be delivered and waiting loaders can be cancelled.
-  new VMService();
+  VMService();
   if (_autoStart) {
-    _lazyServerBoot();
-    server.startup();
+    final _server = _lazyServerBoot();
+    _server.startup();
     // It's just here to push an event on the event loop so that we invoke the
     // scheduled microtasks.
     Timer.run(() {});
   }
   // Register signal handler after a small delay to avoid stalling main
   // isolate startup.
-  _registerSignalHandlerTimer = new Timer(shortDelay, _registerSignalHandler);
+  _registerSignalHandlerTimer = Timer(shortDelay, _registerSignalHandler);
 }
 
-_shutdown() native "VMServiceIO_Shutdown";
+_shutdown() native 'VMServiceIO_Shutdown';
diff --git a/sdk/lib/_internal/vm/bin/vmservice_server.dart b/sdk/lib/_internal/vm/bin/vmservice_server.dart
index efc87eb..26f1bfa 100644
--- a/sdk/lib/_internal/vm/bin/vmservice_server.dart
+++ b/sdk/lib/_internal/vm/bin/vmservice_server.dart
@@ -2,11 +2,9 @@
 // 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.6
-
 part of vmservice_io;
 
-final bool silentObservatory = new bool.fromEnvironment('SILENT_OBSERVATORY');
+final bool silentObservatory = bool.fromEnvironment('SILENT_OBSERVATORY');
 
 void serverPrint(String s) {
   if (silentObservatory) {
@@ -17,10 +15,10 @@
 }
 
 class WebSocketClient extends Client {
-  static const int PARSE_ERROR_CODE = 4000;
-  static const int BINARY_MESSAGE_ERROR_CODE = 4001;
-  static const int NOT_MAP_ERROR_CODE = 4002;
-  static const int ID_ERROR_CODE = 4003;
+  static const int parseErrorCode = 4000;
+  static const int binaryMessageErrorCode = 4001;
+  static const int notMapErrorCode = 4002;
+  static const int idErrorCode = 4003;
   final WebSocket socket;
 
   WebSocketClient(this.socket, VMService service) : super(service) {
@@ -36,19 +34,19 @@
 
   void onWebSocketMessage(message) {
     if (message is String) {
-      var map;
+      Map map;
       try {
         map = json.decode(message);
       } catch (e) {
-        socket.close(PARSE_ERROR_CODE, 'Message parse error: $e');
+        socket.close(parseErrorCode, 'Message parse error: $e');
         return;
       }
       if (map is! Map) {
-        socket.close(NOT_MAP_ERROR_CODE, 'Message must be a JSON map.');
+        socket.close(notMapErrorCode, 'Message must be a JSON map.');
         return;
       }
       try {
-        final rpc = new Message.fromJsonRpc(this, map);
+        final rpc = Message.fromJsonRpc(this, map);
         switch (rpc.type) {
           case MessageType.Request:
             onRequest(rpc);
@@ -60,17 +58,17 @@
             onResponse(rpc);
             break;
         }
-      } catch (e) {
-        socket.close(ID_ERROR_CODE, e.message);
+      } on dynamic catch (e) {
+        socket.close(idErrorCode, e.message);
       }
     } else {
-      socket.close(BINARY_MESSAGE_ERROR_CODE, 'Message must be a string.');
+      socket.close(binaryMessageErrorCode, 'Message must be a string.');
     }
   }
 
-  void post(Response result) {
+  void post(Response? result) {
     if (result == null) {
-      // Do nothing.
+      // The result of a notification event. Do nothing.
       return;
     }
     try {
@@ -89,17 +87,16 @@
     }
   }
 
-  dynamic toJson() {
-    Map map = super.toJson();
-    map['type'] = 'WebSocketClient';
-    map['socket'] = '$socket';
-    return map;
-  }
+  Map<String, dynamic> toJson() => {
+        ...super.toJson(),
+        'type': 'WebSocketClient',
+        'socket': '$socket',
+      };
 }
 
 class HttpRequestClient extends Client {
-  static ContentType jsonContentType =
-      new ContentType("application", "json", charset: "utf-8");
+  static final jsonContentType =
+      ContentType('application', 'json', charset: 'utf-8');
   final HttpRequest request;
 
   HttpRequestClient(this.request, VMService service)
@@ -110,11 +107,14 @@
     close();
   }
 
-  void post(Response result) {
+  void post(Response? result) {
     if (result == null) {
+      // The result of a notification event. Nothing to do other than close the
+      // connection.
       close();
       return;
     }
+
     HttpResponse response = request.response;
     // We closed the connection for bad origins earlier.
     response.headers.add('Access-Control-Allow-Origin', '*');
@@ -133,8 +133,8 @@
     close();
   }
 
-  dynamic toJson() {
-    Map map = super.toJson();
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
     map['type'] = 'HttpRequestClient';
     map['request'] = '$request';
     return map;
@@ -150,21 +150,22 @@
   final bool _originCheckDisabled;
   final bool _authCodesDisabled;
   final bool _enableServicePortFallback;
-  final String _serviceInfoFilename;
-  HttpServer _server;
+  final String? _serviceInfoFilename;
+  HttpServer? _server;
   bool get running => _server != null;
   bool acceptNewWebSocketConnections = true;
   int _port = -1;
 
   /// Returns the server address including the auth token.
-  Uri get serverAddress {
+  Uri? get serverAddress {
     if (!running) {
       return null;
     }
-    var ip = _server.address.address;
-    var port = _server.port;
-    var path = !_authCodesDisabled ? "$serviceAuthToken/" : "/";
-    return new Uri(scheme: 'http', host: ip, port: port, path: path);
+    final server = _server!;
+    final ip = server.address.address;
+    final port = server.port;
+    final path = !_authCodesDisabled ? '$serviceAuthToken/' : '/';
+    return Uri(scheme: 'http', host: ip, port: port, path: path);
   }
 
   // On Fuchsia, authentication codes are disabled by default. To enable, the authentication token
@@ -195,9 +196,10 @@
       return true;
     }
 
-    if ((uri.port == _server.port) &&
-        ((uri.host == _server.address.address) ||
-            (uri.host == _server.address.host))) {
+    final server = _server!;
+    if ((uri.port == server.port) &&
+        ((uri.host == server.address.address) ||
+            (uri.host == server.address.host))) {
       return true;
     }
 
@@ -210,16 +212,16 @@
       return true;
     }
     // First check the web-socket specific origin.
-    List<String> origins = request.headers["Sec-WebSocket-Origin"];
+    List<String>? origins = request.headers['Sec-WebSocket-Origin'];
     if (origins == null) {
       // Fall back to the general Origin field.
-      origins = request.headers["Origin"];
+      origins = request.headers['Origin'];
     }
     if (origins == null) {
       // No origin sent. This is a non-browser client or a same-origin request.
       return true;
     }
-    for (String origin in origins) {
+    for (final origin in origins) {
       if (_isAllowedOrigin(origin)) {
         return true;
       }
@@ -240,7 +242,7 @@
       return null;
     }
     // Check that we were given the auth token.
-    final String authToken = requestPathSegments[0];
+    final authToken = requestPathSegments[0];
     if (authToken != serviceAuthToken) {
       // Malformed.
       return null;
@@ -249,7 +251,7 @@
     // ROOT_REDIRECT_PATH correctly, otherwise the response is misinterpreted.
     if (requestPathSegments.length == 1) {
       // requestPathSegments is unmodifiable. Copy it.
-      final List<String> pathSegments = <String>[]..addAll(requestPathSegments);
+      final pathSegments = List<String>.from(requestPathSegments);
 
       // Adding an empty string to the path segments results in the path having
       // a trailing '/'.
@@ -267,7 +269,7 @@
     if (!_originCheck(request)) {
       // This is a cross origin attempt to connect
       request.response.statusCode = HttpStatus.forbidden;
-      request.response.write("forbidden origin");
+      request.response.write('forbidden origin');
       request.response.close();
       return;
     }
@@ -275,22 +277,22 @@
       // PUT requests are forwarded to DevFS for processing.
 
       List fsNameList;
-      List fsPathList;
-      List fsPathBase64List;
-      List fsUriBase64List;
-      Object fsName;
-      Object fsPath;
-      Object fsUri;
+      List? fsPathList;
+      List? fsPathBase64List;
+      List? fsUriBase64List;
+      Object? fsName;
+      Object? fsPath;
+      Uri? fsUri;
 
       try {
         // Extract the fs name and fs path from the request headers.
-        fsNameList = request.headers['dev_fs_name'];
+        fsNameList = request.headers['dev_fs_name']!;
         fsName = fsNameList[0];
 
         // Prefer Uri encoding first.
         fsUriBase64List = request.headers['dev_fs_uri_b64'];
         if ((fsUriBase64List != null) && (fsUriBase64List.length > 0)) {
-          String decodedFsUri = utf8.decode(base64.decode(fsUriBase64List[0]));
+          final decodedFsUri = utf8.decode(base64.decode(fsUriBase64List[0]));
           fsUri = Uri.parse(decodedFsUri);
         }
 
@@ -299,9 +301,9 @@
           fsPathList = request.headers['dev_fs_path'];
           fsPathBase64List = request.headers['dev_fs_path_b64'];
           // If the 'dev_fs_path_b64' header field was sent, use that instead.
-          if ((fsPathBase64List != null) && (fsPathBase64List.length > 0)) {
+          if ((fsPathBase64List != null) && fsPathBase64List.isNotEmpty) {
             fsPath = utf8.decode(base64.decode(fsPathBase64List[0]));
-          } else {
+          } else if (fsPathList != null && fsPathList.isNotEmpty) {
             fsPath = fsPathList[0];
           }
         }
@@ -310,7 +312,7 @@
       String result;
       try {
         result = await _service.devfs.handlePutStream(fsName, fsPath, fsUri,
-            request.cast<List<int>>().transform(GZIP.decoder));
+            request.cast<List<int>>().transform(gzip.decoder));
       } catch (e) {
         request.response.statusCode = HttpStatus.internalServerError;
         request.response.write(e);
@@ -329,24 +331,24 @@
     if (request.method != 'GET') {
       // Not a GET request. Do nothing.
       request.response.statusCode = HttpStatus.methodNotAllowed;
-      request.response.write("method not allowed");
+      request.response.write('method not allowed');
       request.response.close();
       return;
     }
 
-    final dynamic result = _checkAuthTokenAndGetPath(request.uri);
+    final result = _checkAuthTokenAndGetPath(request.uri);
     if (result == null) {
       // Either no authentication code was provided when one was expected or an
       // incorrect authentication code was provided.
       request.response.statusCode = HttpStatus.forbidden;
-      request.response.write("missing or invalid authentication code");
+      request.response.write('missing or invalid authentication code');
       request.response.close();
       return;
     } else if (result is Uri) {
       // The URI contains the valid auth token but is missing a trailing '/'.
       // Redirect to the same URI with the trailing '/' to correctly serve
       // index.html.
-      request.response.redirect(result as Uri);
+      request.response.redirect(result);
       return;
     }
 
@@ -356,22 +358,22 @@
         WebSocketTransformer.upgrade(request,
                 compression: CompressionOptions.compressionOff)
             .then((WebSocket webSocket) {
-          new WebSocketClient(webSocket, _service);
+          WebSocketClient(webSocket, _service);
         });
       } else {
         // Forward the websocket connection request to DDS.
-        request.response.redirect(_service.ddsUri);
+        request.response.redirect(_service.ddsUri!);
       }
       return;
     }
 
     if (assets == null) {
-      request.response.headers.contentType = ContentType.TEXT;
-      request.response.write("This VM was built without the Observatory UI.");
+      request.response.headers.contentType = ContentType.text;
+      request.response.write('This VM was built without the Observatory UI.');
       request.response.close();
       return;
     }
-    Asset asset = assets[path];
+    final asset = assets[path];
     if (asset != null) {
       // Serving up a static asset (e.g. .css, .html, .png).
       request.response.headers.contentType = ContentType.parse(asset.mimeType);
@@ -380,21 +382,21 @@
       return;
     }
     // HTTP based service request.
-    final client = new HttpRequestClient(request, _service);
-    final message = new Message.fromUri(
+    final client = HttpRequestClient(request, _service);
+    final message = Message.fromUri(
         client, Uri(path: path, queryParameters: request.uri.queryParameters));
     client.onRequest(message); // exception free, no need to try catch
   }
 
-  Future<void> _dumpServiceInfoToFile() async {
+  Future<void> _dumpServiceInfoToFile(String serviceInfoFilenameLocal) async {
     final serviceInfo = <String, dynamic>{
       'uri': serverAddress.toString(),
     };
-    final file = File.fromUri(Uri.parse(_serviceInfoFilename));
+    final file = File.fromUri(Uri.parse(serviceInfoFilenameLocal));
     return file.writeAsString(json.encode(serviceInfo));
   }
 
-  Future startup() async {
+  Future<Server> startup() async {
     if (_server != null) {
       // Already running.
       return this;
@@ -408,9 +410,9 @@
         var address;
         var addresses = await InternetAddress.lookup(_ip);
         // Prefer IPv4 addresses.
-        for (var i = 0; i < addresses.length; i++) {
+        for (int i = 0; i < addresses.length; i++) {
           address = addresses[i];
-          if (address.type == InternetAddressType.IP_V4) break;
+          if (address.type == InternetAddressType.IPv4) break;
         }
         _server = await HttpServer.bind(address, _port);
         return true;
@@ -423,14 +425,14 @@
 
     // poll for the network for ~10 seconds.
     int attempts = 0;
-    final int maxAttempts = 10;
+    final maxAttempts = 10;
     while (!await poll()) {
       attempts++;
-      serverPrint("Observatory server failed to start after $attempts tries");
+      serverPrint('Observatory server failed to start after $attempts tries');
       if (attempts > maxAttempts) {
         serverPrint('Could not start Observatory HTTP server:\n'
             '$pollError\n$pollStack\n');
-        _notifyServerState("");
+        _notifyServerState('');
         onServerAddressChange(null);
         return this;
       }
@@ -438,7 +440,7 @@
         _port = 0;
         serverPrint('Falling back to automatic port selection');
       }
-      await new Future<Null>.delayed(const Duration(seconds: 1));
+      await Future<void>.delayed(const Duration(seconds: 1));
     }
     if (_service.isExiting) {
       serverPrint('Observatory HTTP server exiting before listening as '
@@ -446,17 +448,20 @@
       await shutdown(true);
       return this;
     }
-    _server.listen(_requestHandler, cancelOnError: true);
+    final server = _server!;
+    server.listen(_requestHandler, cancelOnError: true);
     serverPrint('Observatory listening on $serverAddress');
     if (Platform.isFuchsia) {
       // Create a file with the port number.
-      String tmp = Directory.systemTemp.path;
-      String path = "$tmp/dart.services/${_server.port}";
-      serverPrint("Creating $path");
-      new File(path)..createSync(recursive: true);
+      final tmp = Directory.systemTemp.path;
+      final path = '$tmp/dart.services/${server.port}';
+      serverPrint('Creating $path');
+      File(path)..createSync(recursive: true);
     }
-    if (_serviceInfoFilename != null && _serviceInfoFilename.isNotEmpty) {
-      await _dumpServiceInfoToFile();
+    final serviceInfoFilenameLocal = _serviceInfoFilename;
+    if (serviceInfoFilenameLocal != null &&
+        serviceInfoFilenameLocal.isNotEmpty) {
+      await _dumpServiceInfoToFile(serviceInfoFilenameLocal);
     }
     // Server is up and running.
     _notifyServerState(serverAddress.toString());
@@ -464,42 +469,43 @@
     return this;
   }
 
-  Future cleanup(bool force) {
-    if (_server == null) {
-      return new Future.value(null);
+  Future<void> cleanup(bool force) {
+    final serverLocal = _server;
+    if (serverLocal == null) {
+      return Future.value();
     }
     if (Platform.isFuchsia) {
       // Remove the file with the port number.
-      String tmp = Directory.systemTemp.path;
-      String path = "$tmp/dart.services/${_server.port}";
-      serverPrint("Deleting $path");
-      new File(path)..deleteSync();
+      final tmp = Directory.systemTemp.path;
+      final path = '$tmp/dart.services/${serverLocal.port}';
+      serverPrint('Deleting $path');
+      File(path)..deleteSync();
     }
-    return _server.close(force: force);
+    return serverLocal.close(force: force);
   }
 
-  Future shutdown(bool forced) {
+  Future<Server> shutdown(bool forced) {
     if (_server == null) {
       // Not started.
-      return new Future.value(this);
+      return Future.value(this);
     }
 
     // Shutdown HTTP server and subscription.
-    Uri oldServerAddress = serverAddress;
+    Uri oldServerAddress = serverAddress!;
     return cleanup(forced).then((_) {
       serverPrint('Observatory no longer listening on $oldServerAddress');
       _server = null;
-      _notifyServerState("");
+      _notifyServerState('');
       onServerAddressChange(null);
       return this;
     }).catchError((e, st) {
       _server = null;
       serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
-      _notifyServerState("");
+      _notifyServerState('');
       onServerAddressChange(null);
       return this;
     });
   }
 }
 
-void _notifyServerState(String uri) native "VMServiceIO_NotifyServerState";
+void _notifyServerState(String uri) native 'VMServiceIO_NotifyServerState';
diff --git a/sdk/lib/_internal/vm/lib/array.dart b/sdk/lib/_internal/vm/lib/array.dart
index 5fb1517..5304841 100644
--- a/sdk/lib/_internal/vm/lib/array.dart
+++ b/sdk/lib/_internal/vm/lib/array.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 // part of "core_patch.dart";
 
 @pragma("vm:entry-point")
 class _List<E> extends FixedLengthListBase<E> {
-  @pragma(
-      "vm:exact-result-type", [_List, "result-type-uses-passed-type-arguments"])
+  @pragma("vm:exact-result-type",
+      <dynamic>[_List, "result-type-uses-passed-type-arguments"])
   @pragma("vm:prefer-inline")
   factory _List(length) native "List_allocate";
 
@@ -26,7 +24,7 @@
   int get length native "List_getLength";
 
   @pragma("vm:prefer-inline")
-  List _slice(int start, int count, bool needsTypeArgument) {
+  _List _slice(int start, int count, bool needsTypeArgument) {
     if (count <= 64) {
       final result = needsTypeArgument ? new _List<E>(count) : new _List(count);
       for (int i = 0; i < result.length; i++) {
@@ -38,7 +36,7 @@
     }
   }
 
-  List _sliceInternal(int start, int count, bool needsTypeArgument)
+  _List _sliceInternal(int start, int count, bool needsTypeArgument)
       native "List_slice";
 
   // List interface.
@@ -54,12 +52,12 @@
     if (identical(this, iterable)) {
       Lists.copy(this, skipCount, this, start, length);
     } else if (ClassID.getID(iterable) == ClassID.cidArray) {
-      final _List<E> iterableAsList = iterable;
+      final _List<E> iterableAsList = unsafeCast<_List<E>>(iterable);
       Lists.copy(iterableAsList, skipCount, this, start, length);
     } else if (iterable is List<E>) {
       Lists.copy(iterable, skipCount, this, start, length);
     } else {
-      Iterator it = iterable.iterator;
+      Iterator<E> it = iterable.iterator;
       while (skipCount > 0) {
         if (!it.moveNext()) return;
         skipCount--;
@@ -79,7 +77,7 @@
     if (identical(this, iterable)) {
       iterableAsList = this;
     } else if (ClassID.getID(iterable) == ClassID.cidArray) {
-      iterableAsList = iterable;
+      iterableAsList = unsafeCast<_List<E>>(iterable);
     } else if (iterable is List<E>) {
       iterableAsList = iterable;
     } else {
@@ -95,9 +93,10 @@
     Lists.copy(iterableAsList, 0, this, index, length);
   }
 
-  List<E> sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    int length = end - start;
+  List<E> sublist(int start, [int? end]) {
+    final int listLength = this.length;
+    final int actualEnd = RangeError.checkValidRange(start, end, listLength);
+    int length = actualEnd - start;
     if (length == 0) return <E>[];
     var result = new _GrowableList<E>._withData(_slice(start, length, false));
     result._setLength(length);
@@ -138,11 +137,11 @@
   List<E> toList({bool growable: true}) {
     var length = this.length;
     if (length > 0) {
-      var result = _slice(0, length, !growable);
+      _List result = _slice(0, length, !growable);
       if (growable) {
-        result = new _GrowableList<E>._withData(result).._setLength(length);
+        return new _GrowableList<E>._withData(result).._setLength(length);
       }
-      return result;
+      return unsafeCast<_List<E>>(result);
     }
     // _GrowableList._withData must not be called with empty list.
     return growable ? <E>[] : new _List<E>(0);
@@ -172,15 +171,15 @@
   @pragma("vm:prefer-inline")
   int get length native "List_getLength";
 
-  List<E> sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    int length = end - start;
+  List<E> sublist(int start, [int? end]) {
+    final int actualEnd = RangeError.checkValidRange(start, end, this.length);
+    int length = actualEnd - start;
     if (length == 0) return <E>[];
-    List list = new _List(length);
+    final list = new _List(length);
     for (int i = 0; i < length; i++) {
       list[i] = this[start + i];
     }
-    var result = new _GrowableList<E>._withData(list);
+    final result = new _GrowableList<E>._withData(list);
     result._setLength(length);
     return result;
   }
@@ -217,16 +216,21 @@
   }
 
   List<E> toList({bool growable: true}) {
-    var length = this.length;
+    final int length = this.length;
     if (length > 0) {
-      List list = growable ? new _List(length) : new _List<E>(length);
-      for (int i = 0; i < length; i++) {
-        list[i] = this[i];
+      if (growable) {
+        final list = new _List(length);
+        for (int i = 0; i < length; i++) {
+          list[i] = this[i];
+        }
+        return _GrowableList<E>._withData(list).._setLength(length);
+      } else {
+        final list = new _List<E>(length);
+        for (int i = 0; i < length; i++) {
+          list[i] = this[i];
+        }
+        return list;
       }
-      if (!growable) return list;
-      var result = new _GrowableList<E>._withData(list);
-      result._setLength(length);
-      return result;
     }
     return growable ? <E>[] : new _List<E>(0);
   }
@@ -237,7 +241,7 @@
   final List<E> _array;
   final int _length; // Cache array length for faster access.
   int _index;
-  E _current;
+  E? _current;
 
   _FixedSizeArrayIterator(List<E> array)
       : _array = array,
@@ -246,7 +250,10 @@
     assert(array is _List<E> || array is _ImmutableList<E>);
   }
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 
   @pragma("vm:prefer-inline")
   bool moveNext() {
diff --git a/sdk/lib/_internal/vm/lib/array_patch.dart b/sdk/lib/_internal/vm/lib/array_patch.dart
index fff0490..ef181be 100644
--- a/sdk/lib/_internal/vm/lib/array_patch.dart
+++ b/sdk/lib/_internal/vm/lib/array_patch.dart
@@ -2,14 +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.6
-
 // part of "core_patch.dart";
 
 @patch
 class List<E> {
   @patch
-  factory List([int length]) native "List_new";
+  factory List.empty({bool growable = false}) {
+    return growable ? <E>[] : _List<E>(0);
+  }
+
+  @patch
+  factory List([int? length]) native "List_new";
 
   @patch
   factory List.filled(int length, E fill, {bool growable: false}) {
@@ -66,6 +69,18 @@
   }
 
   @patch
+  @pragma("vm:prefer-inline")
+  factory List.generate(int length, E generator(int index),
+      {bool growable = true}) {
+    final List<E> result =
+        growable ? new _GrowableList<E>(length) : new _List<E>(length);
+    for (int i = 0; i < result.length; ++i) {
+      result[i] = generator(i);
+    }
+    return result;
+  }
+
+  @patch
   factory List.unmodifiable(Iterable elements) {
     final result = new List<E>.from(elements, growable: false);
     return makeFixedListUnmodifiable(result);
@@ -78,7 +93,7 @@
     if (elements.isEmpty) {
       return new _GrowableList<E>(0);
     }
-    var result = new _GrowableList<E>._withData(elements);
+    final result = new _GrowableList<E>._withData(unsafeCast<_List>(elements));
     result._setLength(elements.length);
     return result;
   }
diff --git a/sdk/lib/_internal/vm/lib/async_patch.dart b/sdk/lib/_internal/vm/lib/async_patch.dart
index 3c111f4..c3201d3 100644
--- a/sdk/lib/_internal/vm/lib/async_patch.dart
+++ b/sdk/lib/_internal/vm/lib/async_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:async" which contains all the imports used
 /// by patches of that library. We plan to change this when we have a shared
@@ -29,15 +27,21 @@
   _AsyncAwaitCompleter() : isSync = false;
 
   @pragma("vm:entry-point")
-  void complete([FutureOr<T> value]) {
-    if (!isSync || value is Future<T>) {
+  void complete([FutureOr<T>? value]) {
+    // All paths require that if value is null, null as T succeeds.
+    value = (value == null) ? value as T : value;
+    if (!isSync) {
       _future._asyncComplete(value);
+    } else if (value is Future<T>) {
+      assert(!_future._isComplete);
+      _future._chainFuture(value);
     } else {
-      _future._completeWithValue(value);
+      // TODO(40014): Remove cast when type promotion works.
+      _future._completeWithValue(value as T);
     }
   }
 
-  void completeError(Object e, [StackTrace st]) {
+  void completeError(Object e, [StackTrace? st]) {
     st ??= AsyncError.defaultStackTrace(e);
     if (isSync) {
       _future._completeError(e, st);
@@ -97,7 +101,7 @@
 /// Returns the result of registering with `.then`.
 Future _awaitHelper(var object, dynamic Function(dynamic) thenCallback,
     dynamic Function(dynamic, StackTrace) errorCallback, Function awaiter) {
-  _Future future;
+  late _Future future;
   if (object is! Future) {
     future = new _Future().._setValue(object);
   } else if (object is _Future) {
@@ -133,11 +137,12 @@
     return;
   }
   // stream is a _StreamImpl.
-  if (stream._generator == null) {
+  final generator = stream._generator;
+  if (generator == null) {
     // No generator registered, this isn't an async* Stream.
     return;
   }
-  _moveNextDebuggerStepCheck(stream._generator);
+  _moveNextDebuggerStepCheck(generator);
 }
 
 // _AsyncStarStreamController is used by the compiler to implement
@@ -151,7 +156,7 @@
   bool onListenReceived = false;
   bool isScheduled = false;
   bool isSuspendedAtYield = false;
-  _Future cancellationFuture = null;
+  _Future? cancellationFuture = null;
 
   Stream<T> get stream {
     final Stream<T> local = controller.stream;
@@ -218,11 +223,13 @@
   }
 
   void addError(Object error, StackTrace stackTrace) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
-    if ((cancellationFuture != null) && cancellationFuture._mayComplete) {
+    final future = cancellationFuture;
+    if ((future != null) && future._mayComplete) {
       // If the stream has been cancelled, complete the cancellation future
       // with the error.
-      cancellationFuture._completeError(error, stackTrace);
+      future._completeError(error, stackTrace);
       return;
     }
     // If stream is cancelled, tell caller to exit the async generator.
@@ -235,19 +242,20 @@
   }
 
   close() {
-    if ((cancellationFuture != null) && cancellationFuture._mayComplete) {
+    final future = cancellationFuture;
+    if ((future != null) && future._mayComplete) {
       // If the stream has been cancelled, complete the cancellation future
       // with the error.
-      cancellationFuture._completeWithValue(null);
+      future._completeWithValue(null);
     }
     controller.close();
   }
 
-  _AsyncStarStreamController(this.asyncStarBody) {
-    controller = new StreamController(
-        onListen: this.onListen,
-        onResume: this.onResume,
-        onCancel: this.onCancel);
+  _AsyncStarStreamController(this.asyncStarBody)
+      : controller = new StreamController() {
+    controller.onListen = this.onListen;
+    controller.onResume = this.onResume;
+    controller.onCancel = this.onCancel;
   }
 
   onListen() {
@@ -285,17 +293,17 @@
 @patch
 class _Future<T> {
   /// The closure implementing the async[*]-body that is `await`ing this future.
-  Function _awaiter;
+  Function? _awaiter;
 }
 
 @patch
 class _StreamImpl<T> {
   /// The closure implementing the async[*]-body that is `await`ing this future.
-  Function _awaiter;
+  Function? _awaiter;
 
   /// The closure implementing the async-generator body that is creating events
   /// for this stream.
-  Function _generator;
+  Function? _generator;
 }
 
 @pragma("vm:entry-point", "call")
diff --git a/sdk/lib/_internal/vm/lib/bigint_patch.dart b/sdk/lib/_internal/vm/lib/bigint_patch.dart
index 0712115..5cc0bef 100644
--- a/sdk/lib/_internal/vm/lib/bigint_patch.dart
+++ b/sdk/lib/_internal/vm/lib/bigint_patch.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.6
-
 // part of dart.core;
 
 // Copyright 2009 The Go Authors. All rights reserved.
@@ -52,11 +50,11 @@
   static BigInt get two => _BigIntImpl.two;
 
   @patch
-  static BigInt parse(String source, {int radix}) =>
+  static BigInt parse(String source, {int? radix}) =>
       _BigIntImpl.parse(source, radix: radix);
 
   @patch
-  static BigInt tryParse(String source, {int radix}) =>
+  static BigInt? tryParse(String source, {int? radix}) =>
       _BigIntImpl._tryParse(source, radix: radix);
 
   @patch
@@ -109,15 +107,14 @@
       new bool.fromEnvironment('dart.vm.not.a.compile.time.constant');
 
   // Result cache for last _divRem call.
-  // Result cache for last _divRem call.
-  static Uint32List _lastDividendDigits;
-  static int _lastDividendUsed;
-  static Uint32List _lastDivisorDigits;
-  static int _lastDivisorUsed;
-  static Uint32List _lastQuoRemDigits;
-  static int _lastQuoRemUsed;
-  static int _lastRemUsed;
-  static int _lastRem_nsh;
+  static Uint32List? _lastDividendDigits;
+  static int? _lastDividendUsed;
+  static Uint32List? _lastDivisorDigits;
+  static int? _lastDivisorUsed;
+  static late Uint32List _lastQuoRemDigits;
+  static late int _lastQuoRemUsed;
+  static late int _lastRemUsed;
+  static late int _lastRem_nsh;
 
   /// Whether this bigint is negative.
   final bool _isNegative;
@@ -168,7 +165,7 @@
    * Throws a [FormatException] if the [source] is not a valid integer literal,
    * optionally prefixed by a sign.
    */
-  static _BigIntImpl parse(String source, {int radix}) {
+  static _BigIntImpl parse(String source, {int? radix}) {
     var result = _tryParse(source, radix: radix);
     if (result == null) {
       throw new FormatException("Could not parse BigInt", source);
@@ -187,7 +184,7 @@
     // Read in the source 9 digits at a time.
     // The first part may have a few leading virtual '0's to make the remaining
     // parts all have exactly 9 digits.
-    int digitInPartCount = 9 - source.length.remainder(9);
+    int digitInPartCount = 9 - unsafeCast<int>(source.length.remainder(9));
     if (digitInPartCount == 9) digitInPartCount = 0;
     for (int i = 0; i < source.length; i++) {
       part = part * 10 + source.codeUnitAt(i) - _0;
@@ -229,7 +226,7 @@
   /// If [isNegative] is true, negates the result before returning it.
   ///
   /// The [source] (substring) must be a valid hex literal.
-  static _BigIntImpl _parseHex(String source, int startPos, bool isNegative) {
+  static _BigIntImpl? _parseHex(String source, int startPos, bool isNegative) {
     int hexCharsPerDigit = _digitBits ~/ 4;
     int sourceLength = source.length - startPos;
     int used = (sourceLength + hexCharsPerDigit - 1) ~/ hexCharsPerDigit;
@@ -263,7 +260,7 @@
   ///
   /// The [source] will be checked for invalid characters. If it is invalid,
   /// this function returns `null`.
-  static _BigIntImpl _parseRadix(String source, int radix, bool isNegative) {
+  static _BigIntImpl? _parseRadix(String source, int radix, bool isNegative) {
     var result = zero;
     var base = new _BigIntImpl._fromInt(radix);
     for (int i = 0; i < source.length; i++) {
@@ -280,21 +277,21 @@
   /// Returns the parsed big integer, or `null` if it failed.
   ///
   /// If the [radix] is `null` accepts decimal literals or `0x` hex literals.
-  static _BigIntImpl _tryParse(String source, {int radix}) {
+  static _BigIntImpl? _tryParse(String source, {int? radix}) {
     if (source == "") return null;
 
-    var match = _parseRE.firstMatch(source);
+    final match = _parseRE.firstMatch(source);
     int signIndex = 1;
     int hexIndex = 3;
     int decimalIndex = 4;
     int nonDecimalHexIndex = 5;
     if (match == null) return null;
 
-    bool isNegative = match[signIndex] == "-";
+    final bool isNegative = match[signIndex] == "-";
 
-    String decimalMatch = match[decimalIndex];
-    String hexMatch = match[hexIndex];
-    String nonDecimalMatch = match[nonDecimalHexIndex];
+    final String? decimalMatch = match[decimalIndex];
+    final String? hexMatch = match[hexIndex];
+    final String? nonDecimalMatch = match[nonDecimalHexIndex];
 
     if (radix == null) {
       if (decimalMatch != null) {
@@ -314,12 +311,16 @@
     if (radix == 10 && decimalMatch != null) {
       return _parseDecimal(decimalMatch, isNegative);
     }
-    if (radix == 16 && (decimalMatch != null || nonDecimalMatch != null)) {
-      return _parseHex(decimalMatch ?? nonDecimalMatch, 0, isNegative);
+    if (radix == 16) {
+      final match = decimalMatch ?? nonDecimalMatch;
+      if (match != null) {
+        return _parseHex(match, 0, isNegative);
+      }
     }
 
-    return _parseRadix(
-        decimalMatch ?? nonDecimalMatch ?? hexMatch, radix, isNegative);
+    // The RegExp guarantees that one of the 3 matches is non-null.
+    final nonNullMatch = (decimalMatch ?? nonDecimalMatch ?? hexMatch)!;
+    return _parseRadix(nonNullMatch, radix, isNegative);
   }
 
   static RegExp _parseRE = RegExp(
@@ -366,10 +367,13 @@
     if (value == 1) return one;
     if (value == 2) return two;
 
-    if (value.abs() < 0x100000000)
+    if (value.abs() < 0x100000000) {
       return new _BigIntImpl._fromInt(value.toInt());
-    if (value is double) return new _BigIntImpl._fromDouble(value);
-    return new _BigIntImpl._fromInt(value);
+    }
+    if (value is double) {
+      return new _BigIntImpl._fromDouble(value);
+    }
+    return new _BigIntImpl._fromInt(value as int);
   }
 
   factory _BigIntImpl._fromInt(int value) {
@@ -719,7 +723,7 @@
   /// Returns 0 if abs(this) == abs(other); a positive number if
   /// abs(this) > abs(other); and a negative number if abs(this) < abs(other).
   int _absCompare(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     return _compareDigits(_digits, _used, other._digits, other._used);
   }
 
@@ -730,7 +734,7 @@
    * equal, and a positive number if `this` is greater than `other`.
    */
   int compareTo(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isNegative == other._isNegative) {
       var result = _absCompare(other);
       // Use 0 - result to avoid negative zero in JavaScript.
@@ -928,7 +932,7 @@
    * the result is non-negative.
    */
   _BigIntImpl operator &(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isZero || other._isZero) return zero;
     if (_isNegative == other._isNegative) {
       if (_isNegative) {
@@ -968,7 +972,7 @@
    * otherwise the result us negative.
    */
   _BigIntImpl operator |(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isZero) return other;
     if (other._isZero) return this;
     if (_isNegative == other._isNegative) {
@@ -1010,7 +1014,7 @@
    * otherwise the result is negative.
    */
   _BigIntImpl operator ^(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isZero) return other;
     if (other._isZero) return this;
     if (_isNegative == other._isNegative) {
@@ -1059,7 +1063,7 @@
 
   /// Addition operator.
   _BigIntImpl operator +(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isZero) return other;
     if (other._isZero) return this;
     var isNegative = _isNegative;
@@ -1078,7 +1082,7 @@
 
   /// Subtraction operator.
   _BigIntImpl operator -(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isZero) return -other;
     if (other._isZero) return this;
     var isNegative = _isNegative;
@@ -1207,7 +1211,7 @@
 
   /// Multiplication operator.
   _BigIntImpl operator *(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     var used = _used;
     var otherUsed = other._used;
     if (used == 0 || otherUsed == 0) {
@@ -1307,7 +1311,7 @@
 
   /// Returns `trunc(this / other)`, with `other != 0`.
   _BigIntImpl _div(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     assert(other._used > 0);
     if (_used < other._used) {
       return zero;
@@ -1327,7 +1331,7 @@
 
   /// Returns `this - other * trunc(this / other)`, with `other != 0`.
   _BigIntImpl _rem(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     assert(other._used > 0);
     if (_used < other._used) {
       return this;
@@ -1670,7 +1674,7 @@
    * ```
    */
   _BigIntImpl operator ~/(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (other._used == 0) {
       throw const IntegerDivisionByZeroException();
     }
@@ -1685,7 +1689,7 @@
    * As a consequence the remainder `r` has the same sign as the divider `this`.
    */
   _BigIntImpl remainder(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (other._used == 0) {
       throw const IntegerDivisionByZeroException();
     }
@@ -1719,7 +1723,7 @@
    * See [remainder] for the remainder of the truncating division.
    */
   _BigIntImpl operator %(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (other._used == 0) {
       throw const IntegerDivisionByZeroException();
     }
@@ -1783,8 +1787,8 @@
    * positive.
    */
   _BigIntImpl modPow(BigInt bigExponent, BigInt bigModulus) {
-    _BigIntImpl exponent = bigExponent;
-    _BigIntImpl modulus = bigModulus;
+    final exponent = _ensureSystemBigInt(bigExponent, 'bigExponent');
+    final modulus = _ensureSystemBigInt(bigModulus, 'bigModulus');
     if (exponent._isNegative) {
       throw new ArgumentError("exponent must be positive: $exponent");
     }
@@ -1828,7 +1832,7 @@
       }
       return z._revert(resultDigits, resultUsed);
     }
-    var k;
+    late int k;
     if (exponentBitlen < 18)
       k = 1;
     else if (exponentBitlen < 48)
@@ -1841,10 +1845,10 @@
       k = 6;
     _BigIntReduction z = new _BigIntMontgomeryReduction(modulus);
     var n = 3;
-    final k1 = k - 1;
+    final int k1 = k - 1;
     final km = (1 << k) - 1;
-    List gDigits = new List(km + 1);
-    List gUsed = new List(km + 1);
+    List gDigits = new List.filled(km + 1, null);
+    List gUsed = new List.filled(km + 1, null);
     gDigits[1] = _newDigits(z._normModulusUsed);
     gUsed[1] = z._convert(this, gDigits[1]);
     if (k > 1) {
@@ -1865,7 +1869,7 @@
     var result2Used;
     var exponentDigits = exponent._digits;
     var j = exponent._used - 1;
-    var i = exponentDigits[j].bitLength - 1;
+    int i = exponentDigits[j].bitLength - 1;
     while (j >= 0) {
       if (i >= k1) {
         w = (exponentDigits[j] >> (i - k1)) & km;
@@ -1986,19 +1990,19 @@
     // Variables a, b, c, and d require one more digit.
     final abcdUsed = maxUsed + 1;
     final abcdLen = abcdUsed + (abcdUsed & 1) + 2; // +2 to satisfy _absAdd.
-    var aDigits, bDigits, cDigits, dDigits;
-    bool aIsNegative, bIsNegative, cIsNegative, dIsNegative;
+
+    bool aIsNegative = false;
+    bool cIsNegative = false;
+    late final Uint32List aDigits, cDigits;
     if (ac) {
       aDigits = _newDigits(abcdLen);
-      aIsNegative = false;
       aDigits[0] = 1;
       cDigits = _newDigits(abcdLen);
-      cIsNegative = false;
     }
-    bDigits = _newDigits(abcdLen);
-    bIsNegative = false;
-    dDigits = _newDigits(abcdLen);
-    dIsNegative = false;
+    final Uint32List bDigits = _newDigits(abcdLen);
+    final Uint32List dDigits = _newDigits(abcdLen);
+    bool bIsNegative = false;
+    bool dIsNegative = false;
     dDigits[0] = 1;
 
     while (true) {
@@ -2192,7 +2196,7 @@
    */
   // Returns 1/this % modulus, with modulus > 0.
   _BigIntImpl modInverse(BigInt bigInt) {
-    _BigIntImpl modulus = bigInt;
+    final modulus = _ensureSystemBigInt(bigInt, 'bigInt');
     if (modulus <= zero) {
       throw new ArgumentError("Modulus must be strictly positive: $modulus");
     }
@@ -2218,7 +2222,7 @@
    * If both `this` and `other` is zero, the result is also zero.
    */
   _BigIntImpl gcd(BigInt bigInt) {
-    _BigIntImpl other = bigInt;
+    final other = _ensureSystemBigInt(bigInt, 'bigInt');
     if (_isZero) return other.abs();
     if (other._isZero) return this.abs();
     return _binaryGcd(this, other, false);
@@ -2526,6 +2530,12 @@
     }
     return new String.fromCharCodes(chars.reversed);
   }
+
+  static _BigIntImpl _ensureSystemBigInt(BigInt bigInt, String parameterName) {
+    if (bigInt is _BigIntImpl) return bigInt;
+    throw ArgumentError.value(
+        bigInt, parameterName, "Must be a platform BigInt");
+  }
 }
 
 // Interface for modular reduction.
@@ -2544,10 +2554,10 @@
 // Montgomery reduction on _BigIntImpl.
 class _BigIntMontgomeryReduction implements _BigIntReduction {
   final _BigIntImpl _modulus;
-  int _normModulusUsed; // Even if processing 64-bit (digit pairs).
-  Uint32List _modulusDigits;
-  Uint32List _args;
-  int _digitsPerStep; // Number of digits processed in one step. 1 or 2.
+  final int _normModulusUsed; // Even if processing 64-bit (digit pairs).
+  final Uint32List _modulusDigits;
+  final Uint32List _args;
+  final int _digitsPerStep; // Number of digits processed in one step. 1 or 2.
   static const int _xDigit = 0; // Index of digit of x.
   static const int _xHighDigit = 1; // Index of high digit of x (64-bit only).
   static const int _rhoDigit = 2; // Index of digit of rho.
@@ -2555,23 +2565,30 @@
   static const int _muDigit = 4; // Index of mu.
   static const int _muHighDigit = 5; // Index of high 32-bits of mu (64-bit).
 
-  _BigIntMontgomeryReduction(this._modulus) {
-    _modulusDigits = _modulus._digits;
-    _args = _newDigits(6);
+  factory _BigIntMontgomeryReduction(_BigIntImpl modulus) {
+    final Uint32List modulusDigits = modulus._digits;
+    final Uint32List args = _newDigits(6);
+
     // Determine if we can process digit pairs by calling an intrinsic.
-    _digitsPerStep = _mulMod(_args, _args, 0);
-    _args[_xDigit] = _modulusDigits[0];
-    if (_digitsPerStep == 1) {
-      _normModulusUsed = _modulus._used;
-      _invDigit(_args);
+    final int digitsPerStep = _mulMod(args, args, 0);
+    args[_xDigit] = modulusDigits[0];
+
+    int normModulusUsed = modulus._used;
+    if (digitsPerStep == 1) {
+      _invDigit(args);
     } else {
-      assert(_digitsPerStep == 2);
-      _normModulusUsed = _modulus._used + (_modulus._used & 1);
-      _args[_xHighDigit] = _modulusDigits[1];
-      _invDigitPair(_args);
+      assert(digitsPerStep == 2);
+      normModulusUsed += modulus._used & 1;
+      args[_xHighDigit] = modulusDigits[1];
+      _invDigitPair(args);
     }
+    return _BigIntMontgomeryReduction._(
+        modulus, normModulusUsed, modulusDigits, args, digitsPerStep);
   }
 
+  _BigIntMontgomeryReduction._(this._modulus, this._normModulusUsed,
+      this._modulusDigits, this._args, this._digitsPerStep);
+
   // Calculates -1/x % _digitBase, x is 32-bit digit.
   //         xy == 1 (mod m)
   //         xy =  1+km
@@ -2728,41 +2745,54 @@
   // quotient digit(s).
   Uint32List _tmpDigits; // Temporary digits used during reduction.
 
-  _BigIntClassicReduction(this._modulus) {
+  factory _BigIntClassicReduction(_BigIntImpl modulus) {
     // Preprocess arguments to _remDigits.
-    var nsh =
-        _BigIntImpl._digitBits - _modulus._digits[_modulus._used - 1].bitLength;
+    int nsh =
+        _BigIntImpl._digitBits - modulus._digits[modulus._used - 1].bitLength;
     // For 64-bit processing, make sure _negNormModulusDigits has an even number
     // of digits.
-    if (_modulus._used.isOdd) {
+    if (modulus._used.isOdd) {
       nsh += _BigIntImpl._digitBits;
     }
-    _modulusNsh = nsh;
-    _normModulus = _modulus << nsh;
-    _normModulusUsed = _normModulus._used;
-    _normModulusDigits = _normModulus._digits;
-    assert(_normModulusUsed.isEven);
-    _args = _newDigits(4);
-    _args[_BigIntImpl._divisorLowTopDigit] =
-        _normModulusDigits[_normModulusUsed - 2];
-    _args[_BigIntImpl._divisorTopDigit] =
-        _normModulusDigits[_normModulusUsed - 1];
-    // Negate _normModulus so we can use _mulAdd instead of
+    final _BigIntImpl normModulus = modulus << nsh;
+    final int normModulusUsed = normModulus._used;
+    final Uint32List normModulusDigits = normModulus._digits;
+    assert(normModulusUsed.isEven);
+
+    final Uint32List args = _newDigits(4);
+    args[_BigIntImpl._divisorLowTopDigit] =
+        normModulusDigits[normModulusUsed - 2];
+    args[_BigIntImpl._divisorTopDigit] = normModulusDigits[normModulusUsed - 1];
+    // Negate normModulus so we can use _mulAdd instead of
     // unimplemented  _mulSub.
-    var negNormModulus =
-        _BigIntImpl.one._dlShift(_normModulusUsed) - _normModulus;
-    if (negNormModulus._used < _normModulusUsed) {
-      _negNormModulusDigits = _BigIntImpl._cloneDigits(
-          negNormModulus._digits, 0, _normModulusUsed, _normModulusUsed);
+    final _BigIntImpl negNormModulus =
+        _BigIntImpl.one._dlShift(normModulusUsed) - normModulus;
+    late Uint32List negNormModulusDigits;
+    if (negNormModulus._used < normModulusUsed) {
+      negNormModulusDigits = _BigIntImpl._cloneDigits(
+          negNormModulus._digits, 0, normModulusUsed, normModulusUsed);
     } else {
-      _negNormModulusDigits = negNormModulus._digits;
+      negNormModulusDigits = negNormModulus._digits;
     }
-    // _negNormModulusDigits is read-only and has _normModulusUsed digits (possibly
+    // negNormModulusDigits is read-only and has normModulusUsed digits (possibly
     // including several leading zeros) plus a leading zero for 64-bit
     // processing.
-    _tmpDigits = _newDigits(2 * _normModulusUsed);
+    final Uint32List tmpDigits = _newDigits(2 * normModulusUsed);
+
+    return _BigIntClassicReduction._(modulus, normModulusUsed, normModulus,
+        normModulusDigits, negNormModulusDigits, nsh, args, tmpDigits);
   }
 
+  _BigIntClassicReduction._(
+      this._modulus,
+      this._normModulusUsed,
+      this._normModulus,
+      this._normModulusDigits,
+      this._negNormModulusDigits,
+      this._modulusNsh,
+      this._args,
+      this._tmpDigits);
+
   int _convert(_BigIntImpl x, Uint32List resultDigits) {
     var digits;
     var used;
diff --git a/sdk/lib/_internal/vm/lib/bool_patch.dart b/sdk/lib/_internal/vm/lib/bool_patch.dart
index 56098da..d627d46 100644
--- a/sdk/lib/_internal/vm/lib/bool_patch.dart
+++ b/sdk/lib/_internal/vm/lib/bool_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/class_id.dart b/sdk/lib/_internal/vm/lib/class_id.dart
index c1e8621..ff9d0b6 100644
--- a/sdk/lib/_internal/vm/lib/class_id.dart
+++ b/sdk/lib/_internal/vm/lib/class_id.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.6
-
 // part of "internal_patch.dart";
 
 @pragma("vm:entry-point")
diff --git a/sdk/lib/_internal/vm/lib/class_id_fasta.dart b/sdk/lib/_internal/vm/lib/class_id_fasta.dart
index 8b7064e..c81bd60 100644
--- a/sdk/lib/_internal/vm/lib/class_id_fasta.dart
+++ b/sdk/lib/_internal/vm/lib/class_id_fasta.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.6
-
 // part of "internal_patch.dart";
 
 @pragma("vm:entry-point")
diff --git a/sdk/lib/_internal/vm/lib/collection_patch.dart b/sdk/lib/_internal/vm/lib/collection_patch.dart
index 0960adc..1307fb7 100644
--- a/sdk/lib/_internal/vm/lib/collection_patch.dart
+++ b/sdk/lib/_internal/vm/lib/collection_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:collection" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -15,6 +13,10 @@
 
 import "dart:typed_data" show Uint32List;
 
+class _TypeTest<T> {
+  bool test(v) => v is T;
+}
+
 /// These are the additional parts of this patch library:
 // part "compact_hash.dart";
 
@@ -22,9 +24,9 @@
 class HashMap<K, V> {
   @patch
   factory HashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(K key1, K key2)?,
+      int hashCode(K key)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -57,8 +59,7 @@
   static const int _INITIAL_CAPACITY = 8;
 
   int _elementCount = 0;
-  List<_HashMapEntry<K, V>> _buckets =
-      new List<_HashMapEntry<K, V>>(_INITIAL_CAPACITY);
+  var _buckets = List<_HashMapEntry<K, V>?>.filled(_INITIAL_CAPACITY, null);
   int _modificationCount = 0;
 
   int get length => _elementCount;
@@ -68,7 +69,7 @@
   Iterable<K> get keys => new _HashMapKeyIterable<K, V>(this);
   Iterable<V> get values => new _HashMapValueIterable<K, V>(this);
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     final hashCode = key.hashCode;
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
@@ -80,7 +81,7 @@
     return false;
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     final buckets = _buckets;
     final length = buckets.length;
     for (int i = 0; i < length; i++) {
@@ -93,7 +94,7 @@
     return false;
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     final hashCode = key.hashCode;
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
@@ -167,12 +168,12 @@
     }
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     final hashCode = key.hashCode;
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
     var entry = buckets[index];
-    _HashMapEntry<K, V> previous = null;
+    _HashMapEntry<K, V>? previous = null;
     while (entry != null) {
       final next = entry.next;
       if (hashCode == entry.hashCode && entry.key == key) {
@@ -189,7 +190,7 @@
   }
 
   void clear() {
-    _buckets = new List(_INITIAL_CAPACITY);
+    _buckets = new List.filled(_INITIAL_CAPACITY, null);
     if (_elementCount > 0) {
       _elementCount = 0;
       _modificationCount = (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
@@ -197,7 +198,7 @@
   }
 
   void _removeEntry(_HashMapEntry<K, V> entry,
-      _HashMapEntry<K, V> previousInBucket, int bucketIndex) {
+      _HashMapEntry<K, V>? previousInBucket, int bucketIndex) {
     if (previousInBucket == null) {
       _buckets[bucketIndex] = entry.next;
     } else {
@@ -205,7 +206,7 @@
     }
   }
 
-  void _addEntry(List<_HashMapEntry<K, V>> buckets, int index, int length,
+  void _addEntry(List<_HashMapEntry<K, V>?> buckets, int index, int length,
       K key, V value, int hashCode) {
     final entry = new _HashMapEntry<K, V>(key, value, hashCode, buckets[index]);
     buckets[index] = entry;
@@ -221,7 +222,7 @@
     final oldBuckets = _buckets;
     final oldLength = oldBuckets.length;
     final newLength = oldLength << 1;
-    final newBuckets = new List<_HashMapEntry<K, V>>(newLength);
+    final newBuckets = new List<_HashMapEntry<K, V>?>.filled(newLength, null);
     for (int i = 0; i < oldLength; i++) {
       var entry = oldBuckets[i];
       while (entry != null) {
@@ -243,30 +244,32 @@
   final _Equality<K> _equals;
   final _Hasher<K> _hashCode;
   final _Predicate _validKey;
-  _CustomHashMap(this._equals, this._hashCode, validKey)
+  _CustomHashMap(this._equals, this._hashCode, _Predicate? validKey)
       : _validKey = (validKey != null) ? validKey : new _TypeTest<K>().test;
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     if (!_validKey(key)) return false;
-    final hashCode = _hashCode(key);
+    K lkey = key as K;
+    final hashCode = _hashCode(lkey);
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
     var entry = buckets[index];
     while (entry != null) {
-      if (hashCode == entry.hashCode && _equals(entry.key, key)) return true;
+      if (hashCode == entry.hashCode && _equals(entry.key, lkey)) return true;
       entry = entry.next;
     }
     return false;
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (!_validKey(key)) return null;
-    final hashCode = _hashCode(key);
+    K lkey = key as K;
+    final hashCode = _hashCode(lkey);
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
     var entry = buckets[index];
     while (entry != null) {
-      if (hashCode == entry.hashCode && _equals(entry.key, key)) {
+      if (hashCode == entry.hashCode && _equals(entry.key, lkey)) {
         return entry.value;
       }
       entry = entry.next;
@@ -312,16 +315,17 @@
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (!_validKey(key)) return null;
-    final hashCode = _hashCode(key);
+    K lkey = key as K;
+    final hashCode = _hashCode(lkey);
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
     var entry = buckets[index];
-    _HashMapEntry<K, V> previous = null;
+    _HashMapEntry<K, V>? previous = null;
     while (entry != null) {
       final next = entry.next;
-      if (hashCode == entry.hashCode && _equals(entry.key, key)) {
+      if (hashCode == entry.hashCode && _equals(entry.key, lkey)) {
         _removeEntry(entry, previous, index);
         _elementCount--;
         _modificationCount =
@@ -338,7 +342,7 @@
 }
 
 class _IdentityHashMap<K, V> extends _HashMap<K, V> {
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     final hashCode = identityHashCode(key);
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
@@ -350,7 +354,7 @@
     return false;
   }
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     final hashCode = identityHashCode(key);
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
@@ -402,12 +406,12 @@
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     final hashCode = identityHashCode(key);
     final buckets = _buckets;
     final index = hashCode & (buckets.length - 1);
     var entry = buckets[index];
-    _HashMapEntry<K, V> previous = null;
+    _HashMapEntry<K, V>? previous = null;
     while (entry != null) {
       final next = entry.next;
       if (hashCode == entry.hashCode && identical(entry.key, key)) {
@@ -430,7 +434,7 @@
   final K key;
   V value;
   final int hashCode;
-  _HashMapEntry<K, V> next;
+  _HashMapEntry<K, V>? next;
   _HashMapEntry(this.key, this.value, this.hashCode, this.next);
 }
 
@@ -446,7 +450,7 @@
 class _HashMapKeyIterable<K, V> extends _HashMapIterable<K, V, K> {
   _HashMapKeyIterable(_HashMap<K, V> map) : super(map);
   Iterator<K> get iterator => new _HashMapKeyIterator<K, V>(_map);
-  bool contains(Object key) => _map.containsKey(key);
+  bool contains(Object? key) => _map.containsKey(key);
   void forEach(void action(K key)) {
     _map.forEach((K key, _) {
       action(key);
@@ -459,7 +463,7 @@
 class _HashMapValueIterable<K, V> extends _HashMapIterable<K, V, V> {
   _HashMapValueIterable(_HashMap<K, V> map) : super(map);
   Iterator<V> get iterator => new _HashMapValueIterator<K, V>(_map);
-  bool contains(Object value) => _map.containsValue(value);
+  bool contains(Object? value) => _map.containsValue(value);
   void forEach(void action(V value)) {
     _map.forEach((_, V value) {
       action(value);
@@ -472,7 +476,7 @@
   final int _stamp;
 
   int _index = 0;
-  _HashMapEntry<K, V> _entry;
+  _HashMapEntry<K, V>? _entry;
 
   _HashMapIterator(this._map) : _stamp = _map._modificationCount;
 
@@ -506,21 +510,21 @@
 
 class _HashMapKeyIterator<K, V> extends _HashMapIterator<K, V, K> {
   _HashMapKeyIterator(_HashMap<K, V> map) : super(map);
-  K get current => _entry?.key;
+  K get current => _entry!.key;
 }
 
 class _HashMapValueIterator<K, V> extends _HashMapIterator<K, V, V> {
   _HashMapValueIterator(_HashMap<K, V> map) : super(map);
-  V get current => _entry?.value;
+  V get current => _entry!.value;
 }
 
 @patch
 class HashSet<E> {
   @patch
   factory HashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(E e1, E e2)?,
+      int hashCode(E e)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -548,13 +552,12 @@
 class _HashSet<E> extends _SetBase<E> implements HashSet<E> {
   static const int _INITIAL_CAPACITY = 8;
 
-  List<_HashSetEntry<E>> _buckets =
-      new List<_HashSetEntry<E>>(_INITIAL_CAPACITY);
+  var _buckets = List<_HashSetEntry<E>?>.filled(_INITIAL_CAPACITY, null);
   int _elementCount = 0;
   int _modificationCount = 0;
 
-  bool _equals(e1, e2) => e1 == e2;
-  int _hashCode(e) => e.hashCode;
+  bool _equals(Object? e1, Object? e2) => e1 == e2;
+  int _hashCode(Object? e) => e.hashCode;
 
   static Set<R> _newEmpty<R>() => new _HashSet<R>();
 
@@ -568,9 +571,9 @@
 
   bool get isNotEmpty => _elementCount != 0;
 
-  bool contains(Object object) {
+  bool contains(Object? object) {
     int index = _hashCode(object) & (_buckets.length - 1);
-    _HashSetEntry<E> entry = _buckets[index];
+    var entry = _buckets[index];
     while (entry != null) {
       if (_equals(entry.key, object)) return true;
       entry = entry.next;
@@ -578,9 +581,9 @@
     return false;
   }
 
-  E lookup(Object object) {
+  E? lookup(Object? object) {
     int index = _hashCode(object) & (_buckets.length - 1);
-    _HashSetEntry<E> entry = _buckets[index];
+    var entry = _buckets[index];
     while (entry != null) {
       var key = entry.key;
       if (_equals(key, object)) return key;
@@ -608,7 +611,7 @@
           entry = nextEntry;
           nextEntry = nextEntry.next;
         }
-        return entry.key;
+        return entry!.key;
       }
     }
     throw IterableElementError.noElement();
@@ -619,7 +622,7 @@
   bool add(E element) {
     final hashCode = _hashCode(element);
     final index = hashCode & (_buckets.length - 1);
-    _HashSetEntry<E> entry = _buckets[index];
+    var entry = _buckets[index];
     while (entry != null) {
       if (_equals(entry.key, element)) return false;
       entry = entry.next;
@@ -634,13 +637,13 @@
     }
   }
 
-  bool _remove(Object object, int hashCode) {
+  bool _remove(Object? object, int hashCode) {
     final index = hashCode & (_buckets.length - 1);
-    _HashSetEntry<E> entry = _buckets[index];
-    _HashSetEntry<E> previous = null;
+    var entry = _buckets[index];
+    _HashSetEntry<E>? previous = null;
     while (entry != null) {
       if (_equals(entry.key, object)) {
-        _HashSetEntry<E> next = entry.remove();
+        final next = entry.remove();
         if (previous == null) {
           _buckets[index] = next;
         } else {
@@ -657,10 +660,10 @@
     return false;
   }
 
-  bool remove(Object object) => _remove(object, _hashCode(object));
+  bool remove(Object? object) => _remove(object, _hashCode(object));
 
-  void removeAll(Iterable<Object> objectsToRemove) {
-    for (Object object in objectsToRemove) {
+  void removeAll(Iterable<Object?> objectsToRemove) {
+    for (Object? object in objectsToRemove) {
       _remove(object, _hashCode(object));
     }
   }
@@ -668,8 +671,8 @@
   void _filterWhere(bool test(E element), bool removeMatching) {
     int length = _buckets.length;
     for (int index = 0; index < length; index++) {
-      _HashSetEntry<E> entry = _buckets[index];
-      _HashSetEntry<E> previous = null;
+      var entry = _buckets[index];
+      _HashSetEntry<E>? previous = null;
       while (entry != null) {
         int modificationCount = _modificationCount;
         bool testResult = test(entry.key);
@@ -677,7 +680,7 @@
           throw new ConcurrentModificationError(this);
         }
         if (testResult == removeMatching) {
-          _HashSetEntry<E> next = entry.remove();
+          final next = entry.remove();
           if (previous == null) {
             _buckets[index] = next;
           } else {
@@ -704,7 +707,7 @@
   }
 
   void clear() {
-    _buckets = new List(_INITIAL_CAPACITY);
+    _buckets = List<_HashSetEntry<E>?>.filled(_INITIAL_CAPACITY, null);
     if (_elementCount > 0) {
       _elementCount = 0;
       _modificationCount = (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
@@ -723,14 +726,14 @@
   }
 
   void _resize() {
-    int oldLength = _buckets.length;
-    int newLength = oldLength << 1;
-    List oldBuckets = _buckets;
-    List newBuckets = new List<_HashSetEntry<E>>(newLength);
+    final oldLength = _buckets.length;
+    final newLength = oldLength << 1;
+    final oldBuckets = _buckets;
+    final newBuckets = List<_HashSetEntry<E>?>.filled(newLength, null);
     for (int i = 0; i < oldLength; i++) {
-      _HashSetEntry<E> entry = oldBuckets[i];
+      var entry = oldBuckets[i];
       while (entry != null) {
-        _HashSetEntry<E> next = entry.next;
+        final next = entry.next;
         int newIndex = entry.hashCode & (newLength - 1);
         entry.next = newBuckets[newIndex];
         newBuckets[newIndex] = entry;
@@ -745,8 +748,8 @@
 }
 
 class _IdentityHashSet<E> extends _HashSet<E> {
-  int _hashCode(e) => identityHashCode(e);
-  bool _equals(e1, e2) => identical(e1, e2);
+  int _hashCode(Object? e) => identityHashCode(e);
+  bool _equals(Object? e1, Object? e2) => identical(e1, e2);
 
   HashSet<E> _newSet() => new _IdentityHashSet<E>();
   HashSet<R> _newSimilarSet<R>() => new _IdentityHashSet<R>();
@@ -756,41 +759,41 @@
   final _Equality<E> _equality;
   final _Hasher<E> _hasher;
   final _Predicate _validKey;
-  _CustomHashSet(this._equality, this._hasher, bool validKey(Object o))
+  _CustomHashSet(this._equality, this._hasher, _Predicate? validKey)
       : _validKey = (validKey != null) ? validKey : new _TypeTest<E>().test;
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     if (!_validKey(element)) return false;
     return super.remove(element);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     if (!_validKey(element)) return false;
     return super.contains(element);
   }
 
-  E lookup(Object element) {
+  E? lookup(Object? element) {
     if (!_validKey(element)) return null;
     return super.lookup(element);
   }
 
-  bool containsAll(Iterable<Object> elements) {
-    for (Object element in elements) {
+  bool containsAll(Iterable<Object?> elements) {
+    for (Object? element in elements) {
       if (!_validKey(element) || !this.contains(element)) return false;
     }
     return true;
   }
 
-  void removeAll(Iterable<Object> elements) {
-    for (Object element in elements) {
+  void removeAll(Iterable<Object?> elements) {
+    for (Object? element in elements) {
       if (_validKey(element)) {
-        super._remove(element, _hasher(element));
+        super._remove(element, _hashCode(element));
       }
     }
   }
 
-  bool _equals(e1, e2) => _equality(e1, e2);
-  int _hashCode(e) => _hasher(e);
+  bool _equals(Object? e1, Object? e2) => _equality(e1 as E, e2 as E);
+  int _hashCode(Object? e) => _hasher(e as E);
 
   HashSet<E> _newSet() => new _CustomHashSet<E>(_equality, _hasher, _validKey);
   HashSet<R> _newSimilarSet<R>() => new _HashSet<R>();
@@ -799,10 +802,10 @@
 class _HashSetEntry<E> {
   final E key;
   final int hashCode;
-  _HashSetEntry<E> next;
+  _HashSetEntry<E>? next;
   _HashSetEntry(this.key, this.hashCode, this.next);
 
-  _HashSetEntry<E> remove() {
+  _HashSetEntry<E>? remove() {
     final result = next;
     next = null;
     return result;
@@ -813,8 +816,8 @@
   final _HashSet<E> _set;
   final int _modificationCount;
   int _index = 0;
-  _HashSetEntry<E> _next;
-  E _current;
+  _HashSetEntry<E>? _next;
+  E? _current;
 
   _HashSetIterator(this._set) : _modificationCount = _set._modificationCount;
 
@@ -822,18 +825,19 @@
     if (_modificationCount != _set._modificationCount) {
       throw new ConcurrentModificationError(_set);
     }
-    if (_next != null) {
-      _current = _next.key;
-      _next = _next.next;
+    var localNext = _next;
+    if (localNext != null) {
+      _current = localNext.key;
+      _next = localNext.next;
       return true;
     }
-    List<_HashSetEntry<E>> buckets = _set._buckets;
+    final buckets = _set._buckets;
     while (_index < buckets.length) {
-      _next = buckets[_index];
+      localNext = buckets[_index];
       _index = _index + 1;
-      if (_next != null) {
-        _current = _next.key;
-        _next = _next.next;
+      if (localNext != null) {
+        _current = localNext.key;
+        _next = localNext.next;
         return true;
       }
     }
@@ -841,7 +845,10 @@
     return false;
   }
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 }
 
 /**
@@ -855,9 +862,9 @@
 class LinkedHashMap<K, V> {
   @patch
   factory LinkedHashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(K key1, K key2)?,
+      int hashCode(K key)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -886,9 +893,9 @@
 class LinkedHashSet<E> {
   @patch
   factory LinkedHashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(potentialKey)}) {
+      {bool equals(E e1, E e2)?,
+      int hashCode(E e)?,
+      bool isValidKey(potentialKey)?}) {
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
@@ -912,31 +919,3 @@
   @patch
   factory LinkedHashSet.identity() => new _CompactLinkedIdentityHashSet<E>();
 }
-
-@patch
-abstract class _SplayTree<K, Node extends _SplayTreeNode<K>> {
-  // We override _splayMin and _splayMax to optimize type-checks.
-  @patch
-  Node _splayMin(Node node) {
-    Node current = node;
-    while (current.left != null) {
-      Node left = internal.unsafeCast<Node>(current.left);
-      current.left = left.right;
-      left.right = current;
-      current = left;
-    }
-    return current;
-  }
-
-  @patch
-  Node _splayMax(Node node) {
-    Node current = node;
-    while (current.right != null) {
-      Node right = internal.unsafeCast<Node>(current.right);
-      current.right = right.left;
-      right.left = current;
-      current = right;
-    }
-    return current;
-  }
-}
diff --git a/sdk/lib/_internal/vm/lib/compact_hash.dart b/sdk/lib/_internal/vm/lib/compact_hash.dart
index da431134..67ba9b2 100644
--- a/sdk/lib/_internal/vm/lib/compact_hash.dart
+++ b/sdk/lib/_internal/vm/lib/compact_hash.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.6
-
 // part of "collection_patch.dart";
 
 // Hash table with open addressing that separates the index from keys/values.
@@ -43,7 +41,7 @@
   // Note: All fields are initialized in a single constructor so that the VM
   // recognizes they cannot hold null values. This makes a big (20%) performance
   // difference on some operations.
-  _HashFieldBase(int dataSize) : this._data = new List(dataSize);
+  _HashFieldBase(int dataSize) : this._data = new List.filled(dataSize, null);
 }
 
 // Base class for VM-internal classes; keep in sync with _HashFieldBase.
@@ -122,7 +120,7 @@
   static int _nextProbe(int i, int sizeMask) => (i + 1) & sizeMask;
 
   // A self-loop is used to mark a deleted key or value.
-  static bool _isDeleted(List data, Object keyOrValue) =>
+  static bool _isDeleted(List data, Object? keyOrValue) =>
       identical(keyOrValue, data);
   static void _setDeletedAt(List data, int d) {
     data[d] = data;
@@ -159,7 +157,7 @@
   _InternalLinkedHashMap() {
     _index = new Uint32List(_HashBase._INITIAL_INDEX_SIZE);
     _hashMask = _HashBase._indexSizeToHashMask(_HashBase._INITIAL_INDEX_SIZE);
-    _data = new List(_HashBase._INITIAL_INDEX_SIZE);
+    _data = new List.filled(_HashBase._INITIAL_INDEX_SIZE, null);
     _usedData = 0;
     _deletedKeys = 0;
   }
@@ -193,12 +191,12 @@
   }
 
   // Allocate new _index and _data, and optionally copy existing contents.
-  void _init(int size, int hashMask, List oldData, int oldUsed) {
+  void _init(int size, int hashMask, List? oldData, int oldUsed) {
     assert(size & (size - 1) == 0);
     assert(_HashBase._UNUSED_PAIR == 0);
     _index = new Uint32List(size);
     _hashMask = hashMask;
-    _data = new List(size);
+    _data = new List.filled(size, null);
     _usedData = 0;
     _deletedKeys = 0;
     if (oldData != null) {
@@ -300,7 +298,7 @@
     return value;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     final int size = _index.length;
     final int sizeMask = size - 1;
     final int maxEntries = size >> 1;
@@ -330,7 +328,7 @@
   }
 
   // If key is absent, return _data (which is never a value).
-  Object _getValueOrData(Object key) {
+  Object? _getValueOrData(Object? key) {
     final int size = _index.length;
     final int sizeMask = size - 1;
     final int maxEntries = size >> 1;
@@ -354,14 +352,14 @@
     return _data;
   }
 
-  bool containsKey(Object key) => !identical(_data, _getValueOrData(key));
+  bool containsKey(Object? key) => !identical(_data, _getValueOrData(key));
 
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     var v = _getValueOrData(key);
     return identical(_data, v) ? null : internal.unsafeCast<V>(v);
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (var v in values) {
       // Spec. says this should always use "==", also for identity maps, etc.
       if (v == value) {
@@ -407,9 +405,9 @@
   int _hashCode(e) => _hasher(e);
   bool _equals(e1, e2) => _equality(e1, e2);
 
-  bool containsKey(Object o) => _validKey(o) ? super.containsKey(o) : false;
-  V operator [](Object o) => _validKey(o) ? super[o] : null;
-  V remove(Object o) => _validKey(o) ? super.remove(o) : null;
+  bool containsKey(Object? o) => _validKey(o) ? super.containsKey(o) : false;
+  V? operator [](Object? o) => _validKey(o) ? super[o] : null;
+  V? remove(Object? o) => _validKey(o) ? super.remove(o) : null;
 
   _CompactLinkedCustomHashMap(this._equality, this._hasher, validKey)
       : _validKey = (validKey != null) ? validKey : new _TypeTest<K>().test,
@@ -443,7 +441,7 @@
   int _offset;
   final int _step;
   final int _checkSum;
-  E current;
+  E? _current;
 
   _CompactIterator(
       _HashBase table, this._data, this._len, this._offset, this._step)
@@ -458,13 +456,18 @@
       _offset += _step;
     } while (_offset < _len && _HashBase._isDeleted(_data, _data[_offset]));
     if (_offset < _len) {
-      current = internal.unsafeCast<E>(_data[_offset]);
+      _current = internal.unsafeCast<E>(_data[_offset]);
       return true;
     } else {
-      current = null;
+      _current = null;
       return false;
     }
   }
+
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 }
 
 // Set implementation, analogous to _CompactLinkedHashMap.
@@ -483,9 +486,9 @@
 
   E get first {
     for (int offset = 0; offset < _usedData; offset++) {
-      Object current = _data[offset];
+      Object? current = _data[offset];
       if (!_HashBase._isDeleted(_data, current)) {
-        return current;
+        return current as E;
       }
     }
     throw IterableElementError.noElement();
@@ -493,9 +496,9 @@
 
   E get last {
     for (int offset = _usedData - 1; offset >= 0; offset--) {
-      Object current = _data[offset];
+      Object? current = _data[offset];
       if (!_HashBase._isDeleted(_data, current)) {
-        return current;
+        return current as E;
       }
     }
     throw IterableElementError.noElement();
@@ -515,10 +518,10 @@
     }
   }
 
-  void _init(int size, int hashMask, List oldData, int oldUsed) {
+  void _init(int size, int hashMask, List? oldData, int oldUsed) {
     _index = new Uint32List(size);
     _hashMask = hashMask;
-    _data = new List(size >> 1);
+    _data = new List.filled(size >> 1, null);
     _usedData = 0;
     _deletedKeys = 0;
     if (oldData != null) {
@@ -568,7 +571,7 @@
   }
 
   // If key is absent, return _data (which is never a value).
-  Object _getKeyOrData(Object key) {
+  Object? _getKeyOrData(Object? key) {
     final int size = _index.length;
     final int sizeMask = size - 1;
     final int maxEntries = size >> 1;
@@ -589,14 +592,14 @@
     return _data;
   }
 
-  E lookup(Object key) {
+  E? lookup(Object? key) {
     var k = _getKeyOrData(key);
-    return identical(_data, k) ? null : k;
+    return identical(_data, k) ? null : internal.unsafeCast<E>(k);
   }
 
-  bool contains(Object key) => !identical(_data, _getKeyOrData(key));
+  bool contains(Object? key) => !identical(_data, _getKeyOrData(key));
 
-  bool remove(Object key) {
+  bool remove(Object? key) {
     final int size = _index.length;
     final int sizeMask = size - 1;
     final int maxEntries = size >> 1;
@@ -651,9 +654,9 @@
   int _hashCode(e) => _hasher(e);
   bool _equals(e1, e2) => _equality(e1, e2);
 
-  bool contains(Object o) => _validKey(o) ? super.contains(o) : false;
-  E lookup(Object o) => _validKey(o) ? super.lookup(o) : null;
-  bool remove(Object o) => _validKey(o) ? super.remove(o) : false;
+  bool contains(Object? o) => _validKey(o) ? super.contains(o) : false;
+  E? lookup(Object? o) => _validKey(o) ? super.lookup(o) : null;
+  bool remove(Object? o) => _validKey(o) ? super.remove(o) : false;
 
   _CompactLinkedCustomHashSet(this._equality, this._hasher, validKey)
       : _validKey = (validKey != null) ? validKey : new _TypeTest<E>().test;
diff --git a/sdk/lib/_internal/vm/lib/convert_patch.dart b/sdk/lib/_internal/vm/lib/convert_patch.dart
index da1da2c..6f82337 100644
--- a/sdk/lib/_internal/vm/lib/convert_patch.dart
+++ b/sdk/lib/_internal/vm/lib/convert_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:convert" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -28,7 +26,8 @@
 // JSON conversion.
 
 @patch
-dynamic _parseJson(String source, reviver(key, value)) {
+dynamic _parseJson(
+    String source, Object? Function(Object? key, Object? value)? reviver) {
   _BuildJsonListener listener;
   if (reviver == null) {
     listener = new _BuildJsonListener();
@@ -58,14 +57,14 @@
 
   // Allow intercepting of UTF-8 decoding when built-in lists are passed.
   @patch
-  static String _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int end) {
+  static String? _convertIntercepted(
+      bool allowMalformed, List<int> codeUnits, int start, int? end) {
     return null; // This call was not intercepted.
   }
 }
 
 class _JsonUtf8Decoder extends Converter<List<int>, Object> {
-  final Function(Object key, Object value) _reviver;
+  final Object? Function(Object? key, Object? value)? _reviver;
   final bool _allowMalformed;
 
   _JsonUtf8Decoder(this._reviver, this._allowMalformed);
@@ -79,7 +78,7 @@
     return parser.result;
   }
 
-  ByteConversionSink startChunkedConversion(Sink<Object> sink) {
+  ByteConversionSink startChunkedConversion(Sink<Object?> sink) {
     return new _JsonUtf8DecoderSink(_reviver, sink, _allowMalformed);
   }
 }
@@ -126,11 +125,11 @@
    * started. If the container is a [Map], there is also a current [key]
    * which is also stored on the stack.
    */
-  List stack = [];
+  final List<Object?> stack = [];
   /** The current [Map] or [List] being built. */
   dynamic currentContainer;
   /** The most recently read property key. */
-  String key;
+  String key = '';
   /** The most recently read value. */
   dynamic value;
 
@@ -144,7 +143,7 @@
   void popContainer() {
     value = currentContainer;
     currentContainer = stack.removeLast();
-    if (currentContainer is Map) key = stack.removeLast();
+    if (currentContainer is Map) key = stack.removeLast() as String;
   }
 
   void handleString(String value) {
@@ -176,7 +175,8 @@
   void propertyValue() {
     Map map = currentContainer;
     map[key] = value;
-    key = value = null;
+    key = '';
+    value = null;
   }
 
   void endObject() {
@@ -205,7 +205,7 @@
 }
 
 class _ReviverJsonListener extends _BuildJsonListener {
-  final Function(Object key, Object value) reviver;
+  final Object? Function(Object? key, Object? value) reviver;
   _ReviverJsonListener(this.reviver);
 
   void arrayElement() {
@@ -688,12 +688,12 @@
           char = getChar(position);
           digit = char ^ CHAR_0;
         } else {
-          return fail(position);
+          fail(position);
         }
       }
       if (state == NUM_ZERO) {
         // JSON does not allow insignificant leading zeros (e.g., "09").
-        if (digit <= 9) return fail(position);
+        if (digit <= 9) fail(position);
         state = NUM_DIGIT;
       }
       while (state == NUM_DIGIT) {
@@ -713,7 +713,7 @@
         digit = char ^ CHAR_0;
       }
       if (state == NUM_DOT) {
-        if (digit > 9) return fail(position);
+        if (digit > 9) fail(position);
         state = NUM_DOT_DIGIT;
       }
       while (state == NUM_DOT_DIGIT) {
@@ -808,7 +808,7 @@
           assert(keywordType == KWD_BOM);
           return position;
         }
-        return fail(position);
+        fail(position);
       }
       position++;
       count++;
@@ -854,41 +854,41 @@
           position++;
           break;
         case QUOTE:
-          if ((state & ALLOW_STRING_MASK) != 0) return fail(position);
+          if ((state & ALLOW_STRING_MASK) != 0) fail(position);
           state |= VALUE_READ_BITS;
           position = parseString(position + 1);
           break;
         case LBRACKET:
-          if ((state & ALLOW_VALUE_MASK) != 0) return fail(position);
+          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
           listener.beginArray();
           saveState(state);
           state = STATE_ARRAY_EMPTY;
           position++;
           break;
         case LBRACE:
-          if ((state & ALLOW_VALUE_MASK) != 0) return fail(position);
+          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
           listener.beginObject();
           saveState(state);
           state = STATE_OBJECT_EMPTY;
           position++;
           break;
         case CHAR_n:
-          if ((state & ALLOW_VALUE_MASK) != 0) return fail(position);
+          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
           state |= VALUE_READ_BITS;
           position = parseNull(position);
           break;
         case CHAR_f:
-          if ((state & ALLOW_VALUE_MASK) != 0) return fail(position);
+          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
           state |= VALUE_READ_BITS;
           position = parseFalse(position);
           break;
         case CHAR_t:
-          if ((state & ALLOW_VALUE_MASK) != 0) return fail(position);
+          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
           state |= VALUE_READ_BITS;
           position = parseTrue(position);
           break;
         case COLON:
-          if (state != STATE_OBJECT_KEY) return fail(position);
+          if (state != STATE_OBJECT_KEY) fail(position);
           listener.propertyName();
           state = STATE_OBJECT_COLON;
           position++;
@@ -903,7 +903,7 @@
             state = STATE_ARRAY_COMMA;
             position++;
           } else {
-            return fail(position);
+            fail(position);
           }
           break;
         case RBRACKET:
@@ -913,7 +913,7 @@
             listener.arrayElement();
             listener.endArray();
           } else {
-            return fail(position);
+            fail(position);
           }
           state = restoreState() | VALUE_READ_BITS;
           position++;
@@ -925,7 +925,7 @@
             listener.propertyValue();
             listener.endObject();
           } else {
-            return fail(position);
+            fail(position);
           }
           state = restoreState() | VALUE_READ_BITS;
           position++;
@@ -953,7 +953,7 @@
     if (getChar(position + 1) != CHAR_r ||
         getChar(position + 2) != CHAR_u ||
         getChar(position + 3) != CHAR_e) {
-      return fail(position);
+      fail(position);
     }
     listener.handleBool(true);
     return position + 4;
@@ -973,7 +973,7 @@
         getChar(position + 2) != CHAR_l ||
         getChar(position + 3) != CHAR_s ||
         getChar(position + 4) != CHAR_e) {
-      return fail(position);
+      fail(position);
     }
     listener.handleBool(false);
     return position + 5;
@@ -992,7 +992,7 @@
     if (getChar(position + 1) != CHAR_u ||
         getChar(position + 2) != CHAR_l ||
         getChar(position + 3) != CHAR_l) {
-      return fail(position);
+      fail(position);
     }
     listener.handleNull();
     return position + 4;
@@ -1005,7 +1005,7 @@
     int count = 1;
     while (++position < length) {
       int char = getChar(position);
-      if (char != chars.codeUnitAt(count)) return fail(start);
+      if (char != chars.codeUnitAt(count)) fail(start);
       count++;
     }
     this.partialState = PARTIAL_KEYWORD | type | (count << KWD_COUNT_SHIFT);
@@ -1042,7 +1042,7 @@
         return position;
       }
       if (char < SPACE) {
-        return fail(position - 1, "Control character in string");
+        fail(position - 1, "Control character in string");
       }
     }
     beginString();
@@ -1102,7 +1102,7 @@
       int char = getChar(position++);
       if (char > BACKSLASH) continue;
       if (char < SPACE) {
-        return fail(position - 1); // Control character in string.
+        fail(position - 1); // Control character in string.
       }
       if (char == QUOTE) {
         int quotePosition = position - 1;
@@ -1172,7 +1172,7 @@
           } else {
             digit = (char | 0x20) - CHAR_a;
             if (digit < 0 || digit > 5) {
-              return fail(hexStart, "Invalid unicode escape");
+              fail(hexStart, "Invalid unicode escape");
             }
             value += digit + 10;
           }
@@ -1180,8 +1180,8 @@
         char = value;
         break;
       default:
-        if (char < SPACE) return fail(position, "Control character in string");
-        return fail(position, "Unrecognized string escape");
+        if (char < SPACE) fail(position, "Control character in string");
+        fail(position, "Unrecognized string escape");
     }
     addCharToString(char);
     if (position == length) return chunkString(STR_PLAIN);
@@ -1396,7 +1396,7 @@
     return position;
   }
 
-  fail(int position, [String message]) {
+  Never fail(int position, [String? message]) {
     if (message == null) {
       message = "Unexpected character";
       if (position == chunkEnd) message = "Unexpected end of input";
@@ -1409,8 +1409,8 @@
  * Chunked JSON parser that parses [String] chunks.
  */
 class _JsonStringParser extends _ChunkedJsonParser<String> {
-  String chunk;
-  int chunkEnd;
+  String chunk = '';
+  int chunkEnd = 0;
 
   _JsonStringParser(_JsonListener listener) : super(listener);
 
@@ -1455,7 +1455,7 @@
 @patch
 class JsonDecoder {
   @patch
-  StringConversionSink startChunkedConversion(Sink<Object> sink) {
+  StringConversionSink startChunkedConversion(Sink<Object?> sink) {
     return new _JsonStringDecoderSink(this._reviver, sink);
   }
 }
@@ -1468,13 +1468,14 @@
  */
 class _JsonStringDecoderSink extends StringConversionSinkBase {
   _JsonStringParser _parser;
-  final Function(Object key, Object value) _reviver;
-  final Sink<Object> _sink;
+  final Object? Function(Object? key, Object? value)? _reviver;
+  final Sink<Object?> _sink;
 
   _JsonStringDecoderSink(this._reviver, this._sink)
       : _parser = _createParser(_reviver);
 
-  static _JsonStringParser _createParser(reviver) {
+  static _JsonStringParser _createParser(
+      Object? Function(Object? key, Object? value)? reviver) {
     _BuildJsonListener listener;
     if (reviver == null) {
       listener = new _BuildJsonListener();
@@ -1503,7 +1504,6 @@
   }
 
   ByteConversionSink asUtf8Sink(bool allowMalformed) {
-    _parser = null;
     return new _JsonUtf8DecoderSink(_reviver, _sink, allowMalformed);
   }
 }
@@ -1512,9 +1512,11 @@
  * Chunked JSON parser that parses UTF-8 chunks.
  */
 class _JsonUtf8Parser extends _ChunkedJsonParser<List<int>> {
+  static final Uint8List emptyChunk = Uint8List(0);
+
   final _Utf8Decoder decoder;
-  List<int> chunk;
-  int chunkEnd;
+  List<int> chunk = emptyChunk;
+  int chunkEnd = 0;
 
   _JsonUtf8Parser(_JsonListener listener, bool allowMalformed)
       : decoder = new _Utf8Decoder(allowMalformed),
@@ -1579,12 +1581,14 @@
  */
 class _JsonUtf8DecoderSink extends ByteConversionSinkBase {
   final _JsonUtf8Parser _parser;
-  final Sink<Object> _sink;
+  final Sink<Object?> _sink;
 
   _JsonUtf8DecoderSink(reviver, this._sink, bool allowMalformed)
       : _parser = _createParser(reviver, allowMalformed);
 
-  static _JsonUtf8Parser _createParser(reviver, bool allowMalformed) {
+  static _JsonUtf8Parser _createParser(
+      Object? Function(Object? key, Object? value)? reviver,
+      bool allowMalformed) {
     _BuildJsonListener listener;
     if (reviver == null) {
       listener = new _BuildJsonListener();
@@ -1711,8 +1715,8 @@
   }
 
   @pragma("vm:prefer-inline")
-  static bool _isNativeUint8List(List<int> codeUnits) {
-    final int cid = ClassID.getID(codeUnits);
+  static bool _isNativeUint8List(List<int> array) {
+    final int cid = ClassID.getID(array);
     return cid == ClassID.cidUint8ArrayView ||
         cid == ClassID.cidUint8Array ||
         cid == ClassID.cidExternalUint8Array;
@@ -1723,7 +1727,7 @@
   _Utf8Decoder(this.allowMalformed) : _state = initial;
 
   @patch
-  String convertSingle(List<int> codeUnits, int start, int maybeEnd) {
+  String convertSingle(List<int> codeUnits, int start, int? maybeEnd) {
     int end = RangeError.checkValidRange(start, maybeEnd, codeUnits.length);
 
     // Have bytes as Uint8List.
@@ -1787,7 +1791,7 @@
   }
 
   @patch
-  String convertChunked(List<int> codeUnits, int start, int maybeEnd) {
+  String convertChunked(List<int> codeUnits, int start, int? maybeEnd) {
     int end = RangeError.checkValidRange(start, maybeEnd, codeUnits.length);
 
     // Have bytes as Uint8List.
@@ -1931,7 +1935,7 @@
 
   String decode8(Uint8List bytes, int start, int end, int size) {
     assert(start < end);
-    final String result = allocateOneByteString(size);
+    String result = allocateOneByteString(size);
     int i = start;
     int j = 0;
     if (_state == X1) {
@@ -1983,7 +1987,7 @@
     assert(start < end);
     final String typeTable = _Utf8Decoder.typeTable;
     final String transitionTable = _Utf8Decoder.transitionTable;
-    final String result = allocateTwoByteString(size);
+    String result = allocateTwoByteString(size);
     int i = start;
     int j = 0;
     int state = _state;
diff --git a/sdk/lib/_internal/vm/lib/core_patch.dart b/sdk/lib/_internal/vm/lib/core_patch.dart
index 0994881..2133763 100644
--- a/sdk/lib/_internal/vm/lib/core_patch.dart
+++ b/sdk/lib/_internal/vm/lib/core_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:core" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -122,20 +120,27 @@
 }
 
 class _SyncIterator<T> implements Iterator<T> {
-  _SyncGeneratorCallback<T> _moveNextFn;
-  Iterator<T> _yieldEachIterator;
+  _SyncGeneratorCallback<T>? _moveNextFn;
+  Iterator<T>? _yieldEachIterator;
 
-  // Stack of suspended _moveNextFn, if any.
-  List<_SyncGeneratorCallback<T>> _stack;
+  // Stack of suspended _moveNextFn.
+  List<_SyncGeneratorCallback<T>>? _stack;
 
   // These two fields are set by generated code for the yield and yield*
   // statement.
-  T _current;
-  Iterable<T> _yieldEachIterable;
+  T? _current;
+  Iterable<T>? _yieldEachIterable;
 
   @override
-  T get current =>
-      _yieldEachIterator != null ? _yieldEachIterator.current : _current;
+  T get current {
+    final iterator = _yieldEachIterator;
+    if (iterator != null) {
+      return iterator.current;
+    } else {
+      final cur = _current;
+      return (cur != null) ? cur : cur as T;
+    }
+  }
 
   _SyncIterator(this._moveNextFn);
 
@@ -157,7 +162,7 @@
       }
 
       final stack = _stack;
-      if (!_moveNextFn(this)) {
+      if (!_moveNextFn!.call(this)) {
         _moveNextFn = null;
         _current = null;
         // If we have any suspended parent generators, continue next one up:
@@ -177,7 +182,7 @@
           if (stack == null) {
             _stack = [];
           }
-          _stack.add(_moveNextFn);
+          _stack!.add(_moveNextFn!);
           final typedIterable = unsafeCast<_SyncIterable<T>>(iterable);
           _moveNextFn = typedIterable._moveNextFnMaker();
         } else {
diff --git a/sdk/lib/_internal/vm/lib/date_patch.dart b/sdk/lib/_internal/vm/lib/date_patch.dart
index 25d22df..ee3b5a3 100644
--- a/sdk/lib/_internal/vm/lib/date_patch.dart
+++ b/sdk/lib/_internal/vm/lib/date_patch.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.6
-
 // part of "core_patch.dart";
 
 // VM implementation of DateTime.
@@ -32,7 +30,7 @@
   static const _MONTH_INDEX = 7;
   static const _YEAR_INDEX = 8;
 
-  List __parts;
+  List? __parts;
 
   @patch
   DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
@@ -51,8 +49,9 @@
       int second, int millisecond, int microsecond, bool isUtc)
       : this.isUtc = isUtc,
         this._value = _brokenDownDateToValue(year, month, day, hour, minute,
-            second, millisecond, microsecond, isUtc) {
-    if (_value == null) throw new ArgumentError();
+                second, millisecond, microsecond, isUtc) ??
+            -1 {
+    if (_value == -1) throw new ArgumentError();
     if (isUtc == null) throw new ArgumentError();
   }
 
@@ -101,7 +100,7 @@
     const [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]
   ];
 
-  static List _computeUpperPart(int localMicros) {
+  static List<int> _computeUpperPart(int localMicros) {
     const int DAYS_IN_4_YEARS = 4 * 365 + 1;
     const int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
     const int DAYS_IN_400_YEARS = 4 * DAYS_IN_100_YEARS + 1;
@@ -120,18 +119,18 @@
     int days = daysSince1970;
     days += DAYS_OFFSET;
     resultYear = 400 * (days ~/ DAYS_IN_400_YEARS) - YEARS_OFFSET;
-    days = days.remainder(DAYS_IN_400_YEARS);
+    days = unsafeCast<int>(days.remainder(DAYS_IN_400_YEARS));
     days--;
     int yd1 = days ~/ DAYS_IN_100_YEARS;
-    days = days.remainder(DAYS_IN_100_YEARS);
+    days = unsafeCast<int>(days.remainder(DAYS_IN_100_YEARS));
     resultYear += 100 * yd1;
     days++;
     int yd2 = days ~/ DAYS_IN_4_YEARS;
-    days = days.remainder(DAYS_IN_4_YEARS);
+    days = unsafeCast<int>(days.remainder(DAYS_IN_4_YEARS));
     resultYear += 4 * yd2;
     days--;
     int yd3 = days ~/ 365;
-    days = days.remainder(365);
+    days = unsafeCast<int>(days.remainder(365));
     resultYear += yd3;
 
     bool isLeap = (yd1 == 0 || yd2 != 0) && yd3 == 0;
@@ -168,7 +167,7 @@
             DateTime.daysPerWeek) +
         DateTime.monday;
 
-    List list = new List(_YEAR_INDEX + 1);
+    List<int> list = new List<int>.filled(_YEAR_INDEX + 1, 0);
     list[_MICROSECOND_INDEX] = resultMicrosecond;
     list[_MILLISECOND_INDEX] = resultMillisecond;
     list[_SECOND_INDEX] = resultSecond;
@@ -182,8 +181,7 @@
   }
 
   get _parts {
-    __parts ??= _computeUpperPart(_localDateInUtcMicros);
-    return __parts;
+    return __parts ??= _computeUpperPart(_localDateInUtcMicros);
   }
 
   @patch
@@ -280,7 +278,7 @@
 
   /// Converts the given broken down date to microseconds.
   @patch
-  static int _brokenDownDateToValue(int year, int month, int day, int hour,
+  static int? _brokenDownDateToValue(int year, int month, int day, int hour,
       int minute, int second, int millisecond, int microsecond, bool isUtc) {
     // Simplify calculations by working with zero-based month.
     --month;
diff --git a/sdk/lib/_internal/vm/lib/deferred_load_patch.dart b/sdk/lib/_internal/vm/lib/deferred_load_patch.dart
index 0ab5e98..3f3cf12 100644
--- a/sdk/lib/_internal/vm/lib/deferred_load_patch.dart
+++ b/sdk/lib/_internal/vm/lib/deferred_load_patch.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.6
-
 // part of "async_patch.dart";
 
 final Set<String> _loadedLibraries = new Set<String>();
@@ -14,7 +12,7 @@
   Future<Null> load() {
     // Dummy implementation that should eventually be replaced by real
     // implementation.
-    Future future = new Future<Null>.value(null);
+    Future<Null> future = new Future<Null>.value(null);
     _loadedLibraries.add(libraryName);
     return future;
   }
diff --git a/sdk/lib/_internal/vm/lib/developer.dart b/sdk/lib/_internal/vm/lib/developer.dart
index d6ab6af..d9c87a8 100644
--- a/sdk/lib/_internal/vm/lib/developer.dart
+++ b/sdk/lib/_internal/vm/lib/developer.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:developer" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -20,20 +18,20 @@
 // part "timeline.dart"
 
 @patch
-bool debugger({bool when: true, String message}) native "Developer_debugger";
+bool debugger({bool when: true, String? message}) native "Developer_debugger";
 
 @patch
 Object inspect(Object object) native "Developer_inspect";
 
 @patch
 void log(String message,
-    {DateTime time,
-    int sequenceNumber,
+    {DateTime? time,
+    int? sequenceNumber,
     int level: 0,
     String name: '',
-    Zone zone,
-    Object error,
-    StackTrace stackTrace}) {
+    Zone? zone,
+    Object? error,
+    StackTrace? stackTrace}) {
   if (message is! String) {
     throw new ArgumentError.value(message, "message", "Must be a String");
   }
@@ -53,14 +51,14 @@
 int _nextSequenceNumber = 0;
 
 _log(String message, int timestamp, int sequenceNumber, int level, String name,
-    Zone zone, Object error, StackTrace stackTrace) native "Developer_log";
+    Zone? zone, Object? error, StackTrace? stackTrace) native "Developer_log";
 
 @patch
 void _postEvent(String eventKind, String eventData)
     native "Developer_postEvent";
 
 @patch
-ServiceExtensionHandler _lookupExtension(String method)
+ServiceExtensionHandler? _lookupExtension(String method)
     native "Developer_lookupExtension";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/double.dart b/sdk/lib/_internal/vm/lib/double.dart
index cd09dac..83b3262 100644
--- a/sdk/lib/_internal/vm/lib/double.dart
+++ b/sdk/lib/_internal/vm/lib/double.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.6
-
 // part of "core_patch.dart";
 
 @pragma("vm:entry-point")
@@ -174,6 +172,7 @@
   double truncateToDouble() native "Double_truncate";
 
   num clamp(num lowerLimit, num upperLimit) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (lowerLimit == null) {
       throw new ArgumentError.notNull("lowerLimit");
     }
@@ -200,7 +199,7 @@
   static const int CACHE_LENGTH = 1 << (CACHE_SIZE_LOG2 + 1);
   static const int CACHE_MASK = CACHE_LENGTH - 1;
   // Each key (double) followed by its toString result.
-  static final List _cache = new List(CACHE_LENGTH);
+  static final List _cache = new List.filled(CACHE_LENGTH, null);
   static int _cacheEvictIndex = 0;
 
   String _toString() native "Double_toString";
@@ -228,6 +227,7 @@
   String toStringAsFixed(int fractionDigits) {
     // See ECMAScript-262, 15.7.4.5 for details.
 
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (fractionDigits == null) {
       throw new ArgumentError.notNull("fractionDigits");
     }
@@ -255,7 +255,7 @@
 
   String _toStringAsFixed(int fractionDigits) native "Double_toStringAsFixed";
 
-  String toStringAsExponential([int fractionDigits]) {
+  String toStringAsExponential([int? fractionDigits]) {
     // See ECMAScript-262, 15.7.4.6 for details.
 
     // The EcmaScript specification checks for NaN and Infinity before looking
diff --git a/sdk/lib/_internal/vm/lib/double_patch.dart b/sdk/lib/_internal/vm/lib/double_patch.dart
index c70ab77..e6ccf5c 100644
--- a/sdk/lib/_internal/vm/lib/double_patch.dart
+++ b/sdk/lib/_internal/vm/lib/double_patch.dart
@@ -2,18 +2,16 @@
 // 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.6
-
 // part of "core_patch.dart";
 
 // VM implementation of double.
 
 @patch
 class double {
-  static double _nativeParse(String str, int start, int end)
+  static double? _nativeParse(String str, int start, int end)
       native "Double_parse";
 
-  static double _tryParseDouble(var str, var start, var end) {
+  static double? _tryParseDouble(String str, int start, int end) {
     assert(start < end);
     const int _DOT = 0x2e; // '.'
     const int _ZERO = 0x30; // '0'
@@ -73,7 +71,7 @@
         i++;
         if (i == end) return null;
         // int._tryParseSmi treats its end argument as inclusive.
-        int expPart = int._tryParseSmi(str, i, end - 1);
+        final int? expPart = int._tryParseSmi(str, i, end - 1);
         if (expPart == null) return null;
         exponent += expPart;
         break;
@@ -93,11 +91,12 @@
     return sign * (doubleValue * P10[exponent]);
   }
 
-  static double _parse(var str) {
+  static double? _parse(String str) {
     int len = str.length;
-    int start = str._firstNonWhitespace();
+    final strbase = str as _StringBase;
+    int start = strbase._firstNonWhitespace();
     if (start == len) return null; // All whitespace.
-    int end = str._lastNonWhitespace() + 1;
+    int end = strbase._lastNonWhitespace() + 1;
     assert(start < end);
     var result = _tryParseDouble(str, start, end);
     if (result != null) return result;
@@ -106,7 +105,7 @@
 
   @patch
   static double parse(String source,
-      [@deprecated double onError(String source)]) {
+      [@deprecated double onError(String source)?]) {
     var result = _parse(source);
     if (result == null) {
       if (onError == null) throw new FormatException("Invalid double", source);
@@ -116,5 +115,5 @@
   }
 
   @patch
-  static double tryParse(String source) => _parse(source);
+  static double? tryParse(String source) => _parse(source);
 }
diff --git a/sdk/lib/_internal/vm/lib/empty_source.dart b/sdk/lib/_internal/vm/lib/empty_source.dart
index e5dbe09..95e028f 100644
--- a/sdk/lib/_internal/vm/lib/empty_source.dart
+++ b/sdk/lib/_internal/vm/lib/empty_source.dart
@@ -2,6 +2,4 @@
 // 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.6
-
 // THIS FILE INTENTIONALLY LEFT BLANK.
diff --git a/sdk/lib/_internal/vm/lib/errors_patch.dart b/sdk/lib/_internal/vm/lib/errors_patch.dart
index add6b29..c4b91f2 100644
--- a/sdk/lib/_internal/vm/lib/errors_patch.dart
+++ b/sdk/lib/_internal/vm/lib/errors_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
@@ -19,10 +17,10 @@
   }
 
   @patch
-  StackTrace get stackTrace => _stackTrace;
+  StackTrace? get stackTrace => _stackTrace;
 
   @pragma("vm:entry-point")
-  StackTrace _stackTrace;
+  StackTrace? _stackTrace;
 }
 
 class _AssertionError extends Error implements AssertionError {
@@ -34,11 +32,11 @@
   // out of the script. It expects a Dart stack frame from class
   // _AssertionError. Thus we need a Dart stub that calls the native code.
   @pragma("vm:entry-point", "call")
-  static _throwNew(int assertionStart, int assertionEnd, Object message) {
+  static _throwNew(int assertionStart, int assertionEnd, Object? message) {
     _doThrowNew(assertionStart, assertionEnd, message);
   }
 
-  static _doThrowNew(int assertionStart, int assertionEnd, Object message)
+  static _doThrowNew(int assertionStart, int assertionEnd, Object? message)
       native "AssertionError_throwNew";
 
   @pragma("vm:entry-point", "call")
@@ -56,15 +54,16 @@
   }
 
   String get _messageString {
-    if (message == null) return "is not true.";
-    if (message is String) return message;
-    return Error.safeToString(message);
+    final msg = message;
+    if (msg == null) return "is not true.";
+    if (msg is String) return msg;
+    return Error.safeToString(msg);
   }
 
   String toString() {
     if (_url == null) {
-      if (message == null) return _failedAssertion?.trim();
-      return "'${_failedAssertion?.trim()}': $_messageString";
+      if (message == null) return _failedAssertion.trim();
+      return "'${_failedAssertion.trim()}': $_messageString";
     }
     var columnInfo = "";
     if (_column > 0) {
@@ -79,7 +78,7 @@
   final String _url;
   final int _line;
   final int _column;
-  final Object message;
+  final Object? message;
 }
 
 class _TypeError extends Error implements TypeError, CastError {
@@ -87,22 +86,22 @@
   _TypeError._create(this._url, this._line, this._column, this._message);
 
   @pragma("vm:entry-point", "call")
-  static _throwNew(int location, Object src_value, _Type dst_type,
-      String dst_name) native "TypeError_throwNew";
+  static _throwNew(int location, Object srcValue, _Type dstType, String dstName)
+      native "TypeError_throwNew";
 
   String toString() => _message;
 
   final String _url;
   final int _line;
   final int _column;
-  final Object _message;
+  final String _message;
 }
 
 class _CastError extends Error implements CastError, TypeError {
   @pragma("vm:entry-point")
   _CastError._create(this._url, this._line, this._column, this._errorMsg);
 
-  // A CastError is allocated by TypeError._throwNew() when dst_name equals
+  // A CastError is allocated by TypeError._throwNew() when dstName equals
   // Symbols::InTypeCast().
 
   String toString() => _errorMsg;
@@ -118,11 +117,9 @@
 class FallThroughError {
   @patch
   @pragma("vm:entry-point")
-  FallThroughError._create(String url, int line)
-      : _url = url,
-        _line = line;
+  FallThroughError._create(this._url, this._line);
 
-  static _throwNew(int case_clause_pos) native "FallThroughError_throwNew";
+  static _throwNew(int caseClausePos) native "FallThroughError_throwNew";
 
   @patch
   String toString() {
@@ -131,8 +128,8 @@
 
   // These new fields cannot be declared final, because a constructor exists
   // in the original version of this patched class.
-  String _url;
-  int _line;
+  String? _url;
+  int _line = 0;
 }
 
 class _InternalError {
@@ -163,7 +160,7 @@
   AbstractClassInstantiationError._create(
       this._className, this._url, this._line);
 
-  static _throwNew(int case_clause_pos, String className)
+  static _throwNew(int caseClausePos, String className)
       native "AbstractClassInstantiationError_throwNew";
 
   @patch
@@ -174,21 +171,21 @@
 
   // These new fields cannot be declared final, because a constructor exists
   // in the original version of this patched class.
-  String _url;
-  int _line;
+  String? _url;
+  int _line = 0;
 }
 
 @patch
 class NoSuchMethodError {
-  final Object _receiver;
+  final Object? _receiver;
   final Invocation _invocation;
 
   @patch
-  NoSuchMethodError.withInvocation(Object receiver, Invocation invocation)
+  NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation)
       : _receiver = receiver,
         _invocation = invocation;
 
-  static void _throwNewInvocation(Object receiver, Invocation invocation) {
+  static void _throwNewInvocation(Object? receiver, Invocation invocation) {
     throw new NoSuchMethodError.withInvocation(receiver, invocation);
   }
 
@@ -201,18 +198,18 @@
       String memberName,
       int invocationType,
       int typeArgumentsLength,
-      Object typeArguments,
-      List arguments,
-      List argumentNames) {
+      Object? typeArguments,
+      List? arguments,
+      List? argumentNames) {
     throw new NoSuchMethodError._withType(receiver, memberName, invocationType,
         typeArgumentsLength, typeArguments, arguments, argumentNames);
   }
 
   // Deprecated constructor.
   @patch
-  NoSuchMethodError(this._receiver, Symbol memberName, List positionalArguments,
-      Map<Symbol, dynamic> namedArguments,
-      [List existingArgumentNames = null]) // existingArgumentNames ignored.
+  NoSuchMethodError(this._receiver, Symbol memberName,
+      List? positionalArguments, Map<Symbol, dynamic>? namedArguments,
+      [List? existingArgumentNames = null]) // existingArgumentNames ignored.
       : this._invocation = new _InvocationMirror._withType(
             memberName,
             _InvocationMirror._UNINITIALIZED,
@@ -242,52 +239,54 @@
       String memberName,
       int invocationType,
       int typeArgumentsLength, // Needed with all-dynamic (null) typeArguments.
-      Object typeArguments,
-      List arguments,
-      List argumentNames)
+      Object? typeArguments,
+      List? arguments,
+      List? argumentNames)
       : this._invocation = new _InvocationMirror._withType(
             new Symbol(memberName),
             invocationType,
             _InvocationMirror._unpackTypeArguments(
                 typeArguments, typeArgumentsLength),
             argumentNames != null
-                ? arguments.sublist(0, arguments.length - argumentNames.length)
+                ? arguments!.sublist(0, arguments.length - argumentNames.length)
                 : arguments,
             argumentNames != null
-                ? _NamedArgumentsMap(arguments, argumentNames)
+                ? _NamedArgumentsMap(arguments!, argumentNames)
                 : null);
 
-  static String _existingMethodSignature(Object receiver, String methodName,
+  static String? _existingMethodSignature(Object? receiver, String methodName,
       int invocationType) native "NoSuchMethodError_existingMethodSignature";
 
   @patch
   String toString() {
-    var invocation = _invocation;
-    if (invocation is _InvocationMirror) {
-      String memberName =
-          internal.Symbol.computeUnmangledName(invocation.memberName);
-      var level = (invocation._type >> _InvocationMirror._LEVEL_SHIFT) &
+    final localInvocation = _invocation;
+    if (localInvocation is _InvocationMirror) {
+      var internalName = localInvocation.memberName as internal.Symbol;
+      String memberName = internal.Symbol.computeUnmangledName(internalName);
+
+      var level = (localInvocation._type >> _InvocationMirror._LEVEL_SHIFT) &
           _InvocationMirror._LEVEL_MASK;
-      var kind = invocation._type & _InvocationMirror._KIND_MASK;
+      var kind = localInvocation._type & _InvocationMirror._KIND_MASK;
       if (kind == _InvocationMirror._LOCAL_VAR) {
         return "NoSuchMethodError: Cannot assign to final variable '$memberName'";
       }
 
-      StringBuffer typeArgumentsBuf = null;
-      var typeArguments = invocation.typeArguments;
+      StringBuffer? typeArgumentsBuf = null;
+      final typeArguments = localInvocation.typeArguments;
       if ((typeArguments != null) && (typeArguments.length > 0)) {
-        typeArgumentsBuf = new StringBuffer();
-        typeArgumentsBuf.write("<");
+        final argsBuf = new StringBuffer();
+        argsBuf.write("<");
         for (int i = 0; i < typeArguments.length; i++) {
           if (i > 0) {
-            typeArgumentsBuf.write(", ");
+            argsBuf.write(", ");
           }
-          typeArgumentsBuf.write(Error.safeToString(typeArguments[i]));
+          argsBuf.write(Error.safeToString(typeArguments[i]));
         }
-        typeArgumentsBuf.write(">");
+        argsBuf.write(">");
+        typeArgumentsBuf = argsBuf;
       }
       StringBuffer argumentsBuf = new StringBuffer();
-      var positionalArguments = invocation.positionalArguments;
+      var positionalArguments = localInvocation.positionalArguments;
       int argumentCount = 0;
       if (positionalArguments != null) {
         for (; argumentCount < positionalArguments.length; argumentCount++) {
@@ -298,20 +297,22 @@
               .write(Error.safeToString(positionalArguments[argumentCount]));
         }
       }
-      var namedArguments = invocation.namedArguments;
+      var namedArguments = localInvocation.namedArguments;
       if (namedArguments != null) {
         namedArguments.forEach((Symbol key, var value) {
           if (argumentCount > 0) {
             argumentsBuf.write(", ");
           }
-          argumentsBuf.write(internal.Symbol.computeUnmangledName(key));
+          var internalName = key as internal.Symbol;
+          argumentsBuf
+              .write(internal.Symbol.computeUnmangledName(internalName));
           argumentsBuf.write(": ");
           argumentsBuf.write(Error.safeToString(value));
           argumentCount++;
         });
       }
-      String existingSig =
-          _existingMethodSignature(_receiver, memberName, invocation._type);
+      String? existingSig = _existingMethodSignature(
+          _receiver, memberName, localInvocation._type);
       String argsMsg = existingSig != null ? " with matching arguments" : "";
 
       String kindBuf = "function";
@@ -326,7 +327,7 @@
       }
 
       StringBuffer msgBuf = new StringBuffer("NoSuchMethodError: ");
-      bool is_type_call = false;
+      bool isTypeCall = false;
       switch (level) {
         case _InvocationMirror._DYNAMIC:
           {
@@ -343,7 +344,7 @@
                 msgBuf.writeln("Closure call with mismatched arguments: "
                     "function '$memberName'");
               } else if (_receiver is _Type && memberName == "call") {
-                is_type_call = true;
+                isTypeCall = true;
                 String name = _receiver.toString();
                 msgBuf.writeln("Attempted to use type '$name' as a function. "
                     "Since types do not define a method 'call', this is not "
@@ -393,7 +394,7 @@
       }
 
       if (kind == _InvocationMirror._METHOD) {
-        String m = is_type_call ? "$_receiver" : "$memberName";
+        String m = isTypeCall ? "$_receiver" : "$memberName";
         msgBuf.write("Tried calling: $m");
         if (typeArgumentsBuf != null) {
           msgBuf.write(typeArgumentsBuf);
@@ -413,7 +414,7 @@
 
       return msgBuf.toString();
     }
-    return _toStringPlain(_receiver, invocation);
+    return _toStringPlain(_receiver, localInvocation);
   }
 
   /// Creates a string representation of an invocation.
@@ -421,7 +422,7 @@
   /// Used for situations where there is no extra information available
   /// about the failed invocation than the [Invocation] object and receiver,
   /// which includes errors created using [NoSuchMethodError.withInvocation].
-  static String _toStringPlain(Object receiver, Invocation invocation) {
+  static String _toStringPlain(Object? receiver, Invocation invocation) {
     var name = _symbolToString(invocation.memberName);
     var receiverType = "${receiver.runtimeType}";
     if (invocation.isAccessor) {
diff --git a/sdk/lib/_internal/vm/lib/expando_patch.dart b/sdk/lib/_internal/vm/lib/expando_patch.dart
index 7653c26..1d99cab 100644
--- a/sdk/lib/_internal/vm/lib/expando_patch.dart
+++ b/sdk/lib/_internal/vm/lib/expando_patch.dart
@@ -2,23 +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.6
-
 // part of "core_patch.dart";
 
 @patch
 class Expando<T> {
   @patch
-  Expando([String name])
+  Expando([String? name])
       : name = name,
-        _data = new List(_minSize),
+        _data = new List.filled(_minSize, null),
         _used = 0;
 
   static const _minSize = 8;
   static final _deletedEntry = new _WeakProperty(null, null);
 
   @patch
-  T operator [](Object object) {
+  T? operator [](Object object) {
     _checkType(object);
 
     var mask = _size - 1;
@@ -40,7 +38,7 @@
   }
 
   @patch
-  void operator []=(Object object, T value) {
+  void operator []=(Object object, T? value) {
     _checkType(object);
 
     var mask = _size - 1;
@@ -118,7 +116,7 @@
 
     // Reset the mappings to empty so that we can just add the existing
     // valid entries.
-    _data = new List(new_size);
+    _data = new List.filled(new_size, null);
     _used = 0;
 
     for (var i = 0; i < old_data.length; i++) {
diff --git a/sdk/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart b/sdk/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart
index 0d47898..303c5a4 100644
--- a/sdk/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart
+++ b/sdk/lib/_internal/vm/lib/ffi_dynamic_library_patch.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.6
-
 // All imports must be in all FFI patch files to not depend on the order
 // the patches are applied.
 import "dart:_internal" show patch;
@@ -37,9 +35,10 @@
   int getHandle() native "Ffi_dl_getHandle";
 
   @patch
-  bool operator ==(other) {
-    if (other == null) return false;
-    return getHandle() == other.getHandle();
+  bool operator ==(Object other) {
+    if (other is! DynamicLibrary) return false;
+    DynamicLibrary otherLib = other;
+    return getHandle() == otherLib.getHandle();
   }
 
   @patch
diff --git a/sdk/lib/_internal/vm/lib/ffi_native_type_patch.dart b/sdk/lib/_internal/vm/lib/ffi_native_type_patch.dart
index 316dc7a..cc7831b 100644
--- a/sdk/lib/_internal/vm/lib/ffi_native_type_patch.dart
+++ b/sdk/lib/_internal/vm/lib/ffi_native_type_patch.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.6
-
 // All imports must be in all FFI patch files to not depend on the order
 // the patches are applied.
 import "dart:_internal" show patch;
diff --git a/sdk/lib/_internal/vm/lib/ffi_patch.dart b/sdk/lib/_internal/vm/lib/ffi_patch.dart
index 726f619..d42689c 100644
--- a/sdk/lib/_internal/vm/lib/ffi_patch.dart
+++ b/sdk/lib/_internal/vm/lib/ffi_patch.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.6
-
 // All imports must be in all FFI patch files to not depend on the order
 // the patches are applied.
 import "dart:_internal" show patch;
@@ -31,7 +29,7 @@
   // This is not super fast, but it is faster than a runtime entry.
   // Hot loops with elementAt().load() do not use this sizeOf, elementAt is
   // optimized per NativeType statically to prevent use of sizeOf at runtime.
-  final int knownSize = _knownSizes[T];
+  final int? knownSize = _knownSizes[T];
   if (knownSize != null) return knownSize;
   if (T == IntPtr) return _intPtrSize;
   if (T == Pointer) return _intPtrSize;
@@ -66,10 +64,13 @@
 // implementation, since that would pull the callback trampoline into JIT
 // snapshots. The callback trampolines can only be serialized into AOT snapshots
 // because they embed the addresses of runtime routines in JIT mode.
-Object _nativeCallbackFunction<NS extends Function>(Function target,
+//
+// Function objects returned by this native method are not Dart instances,
+// so we need to use top type as a return type to avoid type check.
+dynamic _nativeCallbackFunction<NS extends Function>(Function target,
     Object exceptionalReturn) native "Ffi_nativeCallbackFunction";
 
-Pointer<NS> _pointerFromFunction<NS extends NativeFunction>(Object function)
+Pointer<NS> _pointerFromFunction<NS extends NativeFunction>(dynamic function)
     native "Ffi_pointerFromFunction";
 
 @patch
@@ -86,7 +87,7 @@
   @patch
   static Pointer<NativeFunction<T>> fromFunction<T extends Function>(
       @DartRepresentationOf("T") Function f,
-      [Object exceptionalReturn]) {
+      [Object? exceptionalReturn]) {
     throw UnsupportedError(
         "Pointer.fromFunction cannot be called dynamically.");
   }
diff --git a/sdk/lib/_internal/vm/lib/ffi_struct_patch.dart b/sdk/lib/_internal/vm/lib/ffi_struct_patch.dart
index d3545f0..8fad967 100644
--- a/sdk/lib/_internal/vm/lib/ffi_struct_patch.dart
+++ b/sdk/lib/_internal/vm/lib/ffi_struct_patch.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.6
-
 // All imports must be in all FFI patch files to not depend on the order
 // the patches are applied.
 import "dart:_internal" show patch;
diff --git a/sdk/lib/_internal/vm/lib/function.dart b/sdk/lib/_internal/vm/lib/function.dart
index 128a7dd..1c99ca2 100644
--- a/sdk/lib/_internal/vm/lib/function.dart
+++ b/sdk/lib/_internal/vm/lib/function.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.6
-
 // part of "core_patch.dart";
 
 @pragma("vm:entry-point")
diff --git a/sdk/lib/_internal/vm/lib/function_patch.dart b/sdk/lib/_internal/vm/lib/function_patch.dart
index 9d33e30..b4d3daa 100644
--- a/sdk/lib/_internal/vm/lib/function_patch.dart
+++ b/sdk/lib/_internal/vm/lib/function_patch.dart
@@ -2,32 +2,33 @@
 // 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.6
-
 // part of "core_patch.dart";
 
 @patch
 class Function {
   // TODO(regis): Pass type arguments to generic functions. Wait for API spec.
-  static _apply(List arguments, List names) native "Function_apply";
+  static _apply(List<dynamic>? arguments, List<dynamic>? names)
+      native "Function_apply";
 
   @patch
-  static apply(Function function, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  static apply(Function function, List<dynamic>? positionalArguments,
+      [Map<Symbol, dynamic>? namedArguments]) {
     int numPositionalArguments = 1 + // Function is first implicit argument.
         (positionalArguments != null ? positionalArguments.length : 0);
     int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
     int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List(numArguments);
+    List arguments = new List<dynamic>.filled(numArguments, null);
     arguments[0] = function;
-    arguments.setRange(1, numPositionalArguments, positionalArguments);
-    List names = new List(numNamedArguments);
+    if (positionalArguments != null) {
+      arguments.setRange(1, numPositionalArguments, positionalArguments);
+    }
+    List names = new List<dynamic>.filled(numNamedArguments, null);
     int argumentIndex = numPositionalArguments;
     int nameIndex = 0;
     if (numNamedArguments > 0) {
-      namedArguments.forEach((name, value) {
+      namedArguments?.forEach((name, value) {
         arguments[argumentIndex++] = value;
-        names[nameIndex++] = internal.Symbol.getName(name);
+        names[nameIndex++] = internal.Symbol.getName(name as internal.Symbol);
       });
     }
     return _apply(arguments, names);
diff --git a/sdk/lib/_internal/vm/lib/growable_array.dart b/sdk/lib/_internal/vm/lib/growable_array.dart
index 6c0e327..bca95ab 100644
--- a/sdk/lib/_internal/vm/lib/growable_array.dart
+++ b/sdk/lib/_internal/vm/lib/growable_array.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.6
-
 // part of "core_patch.dart";
 
 @pragma("vm:entry-point")
@@ -12,12 +10,11 @@
     if ((index < 0) || (index > length)) {
       throw new RangeError.range(index, 0, length);
     }
-    if (index == this.length) {
-      add(element);
+    int oldLength = this.length;
+    add(element);
+    if (index == oldLength) {
       return;
     }
-    int oldLength = this.length;
-    this.length++;
     Lists.copy(this, index, this, index + 1, oldLength - index);
     this[index] = element;
   }
@@ -32,7 +29,7 @@
     return result;
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     for (int i = 0; i < this.length; i++) {
       if (this[i] == element) {
         removeAt(i);
@@ -54,7 +51,15 @@
     // There might be errors after the length change, in which case the list
     // will end up being modified but the operation not complete. Unless we
     // always go through a "toList" we can't really avoid that.
-    this.length += insertionLength;
+    int capacity = _capacity;
+    int newLength = length + insertionLength;
+    if (newLength > capacity) {
+      do {
+        capacity = _nextCapacity(capacity);
+      } while (newLength > capacity);
+      _grow(capacity);
+    }
+    _setLength(newLength);
     setRange(index + insertionLength, this.length, this, index);
     setAll(index, iterable);
   }
@@ -75,15 +80,15 @@
     this.length = this.length - (end - start);
   }
 
-  List<T> sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    int length = end - start;
+  List<T> sublist(int start, [int? end]) {
+    final int actualEnd = RangeError.checkValidRange(start, end, this.length);
+    int length = actualEnd - start;
     if (length == 0) return <T>[];
-    List list = new _List(length);
+    final list = new _List(length);
     for (int i = 0; i < length; i++) {
       list[i] = this[start + i];
     }
-    var result = new _GrowableList<T>._withData(list);
+    final result = new _GrowableList<T>._withData(list);
     result._setLength(length);
     return result;
   }
@@ -103,7 +108,7 @@
   }
 
   @pragma("vm:exact-result-type",
-      [_GrowableList, "result-type-uses-passed-type-arguments"])
+      <dynamic>[_GrowableList, "result-type-uses-passed-type-arguments"])
   factory _GrowableList._withData(_List data) native "GrowableList_allocate";
 
   @pragma("vm:exact-result-type", "dart:core#_Smi")
@@ -118,6 +123,8 @@
     int old_capacity = _capacity;
     int new_capacity = new_length;
     if (new_capacity > old_capacity) {
+      // Verify that element type is nullable.
+      null as T;
       _grow(new_capacity);
       _setLength(new_length);
       return;
@@ -133,7 +140,7 @@
       _shrink(new_capacity, new_length);
     } else {
       for (int i = new_length; i < length; i++) {
-        this[i] = null;
+        _setIndexed(i, null);
       }
     }
     _setLength(new_length);
@@ -149,7 +156,7 @@
     _setIndexed(index, value);
   }
 
-  void _setIndexed(int index, T value) native "GrowableList_setIndexed";
+  void _setIndexed(int index, T? value) native "GrowableList_setIndexed";
 
   @pragma("vm:entry-point", "call")
   @pragma("vm:prefer-inline")
@@ -184,7 +191,7 @@
           throw new ConcurrentModificationError(this);
         }
         this._setLength(newLen);
-        final ListBase<T> iterableAsList = iterable;
+        final ListBase<T> iterableAsList = iterable as ListBase<T>;
         for (int i = 0; i < iterLen; i++) {
           this[len++] = iterableAsList[i];
         }
@@ -393,11 +400,11 @@
         }
         return list;
       }
-      return new List<T>(0);
+      return List<T>.empty(growable: false);
     }
   }
 
   Set<T> toSet() {
-    return new Set<T>.from(this);
+    return new Set<T>.of(this);
   }
 }
diff --git a/sdk/lib/_internal/vm/lib/identical_patch.dart b/sdk/lib/_internal/vm/lib/identical_patch.dart
index 3e4dc1e..4b57430 100644
--- a/sdk/lib/_internal/vm/lib/identical_patch.dart
+++ b/sdk/lib/_internal/vm/lib/identical_patch.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 // part of "core_patch.dart";
 
 @patch
 @pragma("vm:exact-result-type", bool)
-bool identical(Object a, Object b) native "Identical_comparison";
+bool identical(Object? a, Object? b) native "Identical_comparison";
 
 @patch
 @pragma("vm:entry-point", "call")
-int identityHashCode(Object object) => object._identityHashCode;
+int identityHashCode(Object? object) => object._identityHashCode;
diff --git a/sdk/lib/_internal/vm/lib/immutable_map.dart b/sdk/lib/_internal/vm/lib/immutable_map.dart
index 86e5d8d..7be9890 100644
--- a/sdk/lib/_internal/vm/lib/immutable_map.dart
+++ b/sdk/lib/_internal/vm/lib/immutable_map.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.6
-
 // part of "core_patch.dart";
 
 /// Immutable map class for compiler generated map literals.
@@ -18,7 +16,7 @@
       : _kvPairs = keyValuePairs;
 
   Map<K2, V2> cast<K2, V2>() => Map.castFrom<K, V, K2, V2>(this);
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     // To preserve the key-value order of the map literal, the keys are
     // not sorted. Need to do linear search or implement an additional
     // lookup table.
@@ -54,7 +52,7 @@
     return new _ImmutableMapValueIterable<V>(this);
   }
 
-  bool containsKey(Object key) {
+  bool containsKey(Object? key) {
     for (int i = 0; i < _kvPairs.length; i += 2) {
       if (key == _kvPairs[i]) {
         return true;
@@ -63,7 +61,7 @@
     return false;
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (int i = 1; i < _kvPairs.length; i += 2) {
       if (value == _kvPairs[i]) {
         return true;
@@ -88,7 +86,7 @@
     throw new UnsupportedError("Cannot clear unmodifiable Map");
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     throw new UnsupportedError("Cannot remove from unmodifiable Map");
   }
 
@@ -108,7 +106,7 @@
     throw new UnsupportedError("Cannot modify an unmodifiable Map");
   }
 
-  V update(K key, V update(V value), {V ifAbsent()}) {
+  V update(K key, V update(V value), {V ifAbsent()?}) {
     throw new UnsupportedError("Cannot modify an unmodifiable Map");
   }
 
@@ -160,7 +158,7 @@
 class _ImmutableMapKeyIterator<E> implements Iterator<E> {
   _ImmutableMap _map;
   int _nextIndex = 0;
-  E _current;
+  E? _current;
 
   _ImmutableMapKeyIterator(this._map);
 
@@ -175,13 +173,16 @@
     return false;
   }
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 }
 
 class _ImmutableMapValueIterator<E> implements Iterator<E> {
   _ImmutableMap _map;
   int _nextIndex = 0;
-  E _current;
+  E? _current;
 
   _ImmutableMapValueIterator(this._map);
 
@@ -196,13 +197,16 @@
     return false;
   }
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 }
 
 class _ImmutableMapEntryIterator<K, V> implements Iterator<MapEntry<K, V>> {
   _ImmutableMap _map;
   int _nextIndex = 0;
-  MapEntry<K, V> _current;
+  MapEntry<K, V>? _current;
 
   _ImmutableMapEntryIterator(this._map);
 
@@ -218,5 +222,8 @@
     return false;
   }
 
-  MapEntry<K, V> get current => _current;
+  MapEntry<K, V> get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as MapEntry<K, V>;
+  }
 }
diff --git a/sdk/lib/_internal/vm/lib/integers.dart b/sdk/lib/_internal/vm/lib/integers.dart
index 73a5fff..9fd3a76 100644
--- a/sdk/lib/_internal/vm/lib/integers.dart
+++ b/sdk/lib/_internal/vm/lib/integers.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.6
-
 // part of "core_patch.dart";
 
 abstract class _IntegerImplementation implements int {
@@ -41,7 +39,9 @@
   @pragma("vm:non-nullable-result-type")
   @pragma("vm:never-inline")
   int operator -() {
-    return 0 - this;
+    // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
+    // result type as `num`.
+    return unsafeCast<int>(0 - this);
   }
 
   @pragma("vm:non-nullable-result-type")
@@ -81,7 +81,9 @@
   @pragma("vm:non-nullable-result-type")
   int _moduloFromInteger(int other) native "Integer_moduloFromInteger";
   int _remainderFromInteger(int other) {
-    return other - (other ~/ this) * this;
+    // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
+    // result type as `num`.
+    return unsafeCast<int>(other - (other ~/ this) * this);
   }
 
   @pragma("vm:non-nullable-result-type")
@@ -238,6 +240,7 @@
   }
 
   num clamp(num lowerLimit, num upperLimit) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (lowerLimit == null) {
       throw new ArgumentError.notNull("lowerLimit");
     }
@@ -274,7 +277,7 @@
     return this.toDouble().toStringAsFixed(fractionDigits);
   }
 
-  String toStringAsExponential([int fractionDigits]) {
+  String toStringAsExponential([int? fractionDigits]) {
     return this.toDouble().toStringAsExponential(fractionDigits);
   }
 
@@ -300,7 +303,7 @@
       // -MIN_INT64 == MIN_INT64, so it requires special handling.
       return _minInt64ToRadixString(radix);
     }
-    var temp = new List<int>();
+    var temp = <int>[];
     do {
       int digit = value % radix;
       value ~/= radix;
@@ -348,11 +351,11 @@
   /// This method is only used to handle corner case of
   /// MIN_INT64 = -0x8000000000000000.
   String _minInt64ToRadixString(int radix) {
-    var temp = new List<int>();
+    var temp = <int>[];
     int value = this;
     assert(value < 0);
     do {
-      int digit = -value.remainder(radix);
+      int digit = -unsafeCast<int>(value.remainder(radix));
       value ~/= radix;
       temp.add(_digits.codeUnitAt(digit));
     } while (value != 0);
@@ -367,6 +370,7 @@
 
   // Returns pow(this, e) % m.
   int modPow(int e, int m) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (e == null) {
       throw new ArgumentError.notNull("exponent");
     }
@@ -473,6 +477,7 @@
 
   // Returns 1/this % m, with m > 0.
   int modInverse(int m) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (m == null) {
       throw new ArgumentError.notNull("modulus");
     }
@@ -489,6 +494,7 @@
 
   // Returns gcd of abs(this) and abs(other).
   int gcd(int other) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (other == null) {
       throw new ArgumentError.notNull("other");
     }
@@ -606,7 +612,11 @@
   }
 
   String toString() {
-    if (this < 100 && this > -100) return _smallLookupTable[this + 99];
+    if (this < 100 && this > -100) {
+      // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
+      // result type as `num`.
+      return _smallLookupTable[unsafeCast<int>(this + 99)];
+    }
     if (this < 0) return _negativeToString(this);
     // Inspired by Andrei Alexandrescu: "Three Optimization Tips for C++"
     // Avoid expensive remainder operation by doing it on more than
@@ -615,11 +625,11 @@
     int length = _positiveBase10Length(this);
     _OneByteString result = _OneByteString._allocate(length);
     int index = length - 1;
-    var smi = this;
+    _Smi smi = this;
     do {
       // Two digits at a time.
-      var twoDigits = smi.remainder(100);
-      smi = smi ~/ 100;
+      final int twoDigits = unsafeCast<int>(smi.remainder(100));
+      smi = unsafeCast<_Smi>(smi ~/ 100);
       int digitIndex = twoDigits * 2;
       result._setAt(index, _digitTable[digitIndex + 1]);
       result._setAt(index - 1, _digitTable[digitIndex]);
@@ -627,10 +637,14 @@
     } while (smi >= 100);
     if (smi < 10) {
       // Character code for '0'.
-      result._setAt(index, DIGIT_ZERO + smi);
+      // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
+      // result type as `num`.
+      result._setAt(index, unsafeCast<int>(DIGIT_ZERO + smi));
     } else {
       // No remainder for this case.
-      int digitIndex = smi * 2;
+      // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
+      // result type as `num`.
+      int digitIndex = unsafeCast<int>(smi * 2);
       result._setAt(index, _digitTable[digitIndex + 1]);
       result._setAt(index - 1, _digitTable[digitIndex]);
     }
@@ -684,7 +698,7 @@
     result._setAt(0, MINUS_SIGN); // '-'.
     int index = digitCount;
     do {
-      var twoDigits = negSmi.remainder(100);
+      int twoDigits = unsafeCast<int>(negSmi.remainder(100));
       negSmi = negSmi ~/ 100;
       int digitIndex = -twoDigits * 2;
       result._setAt(index, _digitTable[digitIndex + 1]);
diff --git a/sdk/lib/_internal/vm/lib/integers_patch.dart b/sdk/lib/_internal/vm/lib/integers_patch.dart
index 5582dfc..4831353 100644
--- a/sdk/lib/_internal/vm/lib/integers_patch.dart
+++ b/sdk/lib/_internal/vm/lib/integers_patch.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.6
-
 // part of "core_patch.dart";
 
 /// VM implementation of int.
@@ -20,7 +18,7 @@
   int _shrFromInteger(int other);
   int _shlFromInteger(int other);
 
-  static int _tryParseSmi(String str, int first, int last) {
+  static int? _tryParseSmi(String str, int first, int last) {
     assert(first <= last);
     var ix = first;
     var sign = 1;
@@ -49,23 +47,23 @@
   }
 
   @patch
-  static int parse(String source, {int radix, int onError(String source)}) {
+  static int parse(String source, {int? radix, int onError(String source)?}) {
     if (source == null) throw new ArgumentError("The source must not be null");
     if (source.isEmpty) {
       return _throwFormatException(onError, source, 0, radix, null);
     }
     if (radix == null || radix == 10) {
       // Try parsing immediately, without trimming whitespace.
-      int result = _tryParseSmi(source, 0, source.length - 1);
+      int? result = _tryParseSmi(source, 0, source.length - 1);
       if (result != null) return result;
     } else if (radix < 2 || radix > 36) {
       throw new RangeError("Radix $radix not in range 2..36");
     }
     // Split here so improve odds of parse being inlined and the checks omitted.
-    return _parse(source, radix, onError);
+    return _parse(unsafeCast<_StringBase>(source), radix, onError);
   }
 
-  static int _parse(_StringBase source, int radix, onError) {
+  static int _parse(_StringBase source, int? radix, onError) {
     int end = source._lastNonWhitespace() + 1;
     if (end == 0) {
       return _throwFormatException(onError, source, source.length, radix, null);
@@ -103,18 +101,18 @@
   }
 
   @patch
-  static int tryParse(String source, {int radix}) {
+  static int? tryParse(String source, {int? radix}) {
     if (source == null) throw new ArgumentError("The source must not be null");
     if (source.isEmpty) return null;
     if (radix == null || radix == 10) {
       // Try parsing immediately, without trimming whitespace.
-      int result = _tryParseSmi(source, 0, source.length - 1);
+      int? result = _tryParseSmi(source, 0, source.length - 1);
       if (result != null) return result;
     } else if (radix < 2 || radix > 36) {
       throw new RangeError("Radix $radix not in range 2..36");
     }
     try {
-      return _parse(source, radix, _kNull);
+      return _parse(unsafeCast<_StringBase>(source), radix, _kNull);
     } catch (e) {
       return null;
     }
@@ -139,7 +137,7 @@
     int blockSize = _PARSE_LIMITS[tableIndex];
     int length = end - start;
     if (length <= blockSize) {
-      _Smi smi = _parseBlock(source, radix, start, end);
+      int? smi = _parseBlock(source, radix, start, end);
       if (smi == null) {
         return _throwFormatException(onError, source, start, radix, null);
       }
@@ -154,7 +152,7 @@
     int result = 0;
     if (smallBlockSize > 0) {
       int blockEnd = start + smallBlockSize;
-      _Smi smi = _parseBlock(source, radix, start, blockEnd);
+      int? smi = _parseBlock(source, radix, start, blockEnd);
       if (smi == null) {
         return _throwFormatException(onError, source, start, radix, null);
       }
@@ -172,7 +170,7 @@
     negativeOverflowLimit = _int64OverflowLimits[tableIndex + 1];
     int blockEnd = start + blockSize;
     do {
-      _Smi smi = _parseBlock(source, radix, start, blockEnd);
+      int? smi = _parseBlock(source, radix, start, blockEnd);
       if (smi == null) {
         return _throwFormatException(onError, source, start, radix, null);
       }
@@ -208,13 +206,13 @@
   }
 
   // Parse block of digits into a Smi.
-  static _Smi _parseBlock(String source, int radix, int start, int end) {
-    _Smi result = 0;
+  static _Smi? _parseBlock(String source, int radix, int start, int end) {
+    _Smi result = unsafeCast<_Smi>(0);
     if (radix <= 10) {
       for (int i = start; i < end; i++) {
         int digit = source.codeUnitAt(i) ^ 0x30;
         if (digit >= radix) return null;
-        result = radix * result + digit;
+        result = (radix * result + digit) as _Smi;
       }
     } else {
       for (int i = start; i < end; i++) {
@@ -224,7 +222,7 @@
           digit = (char | 0x20) - (0x61 - 10);
           if (digit < 10 || digit >= radix) return null;
         }
-        result = radix * result + digit;
+        result = (radix * result + digit) as _Smi;
       }
     }
     return result;
@@ -301,8 +299,10 @@
   static int _initInt64OverflowLimits(int tableIndex, int multiplier) {
     _int64OverflowLimits[tableIndex] = _maxInt64 ~/ multiplier;
     _int64OverflowLimits[tableIndex + 1] = _minInt64 ~/ multiplier;
-    _int64OverflowLimits[tableIndex + 2] = _maxInt64.remainder(multiplier);
-    _int64OverflowLimits[tableIndex + 3] = -(_minInt64.remainder(multiplier));
+    _int64OverflowLimits[tableIndex + 2] =
+        unsafeCast<int>(_maxInt64.remainder(multiplier));
+    _int64OverflowLimits[tableIndex + 3] =
+        -unsafeCast<int>(_minInt64.remainder(multiplier));
     return _int64OverflowLimits[tableIndex];
   }
 }
diff --git a/sdk/lib/_internal/vm/lib/internal_patch.dart b/sdk/lib/_internal/vm/lib/internal_patch.dart
index 2a05d99..b904f9e 100644
--- a/sdk/lib/_internal/vm/lib/internal_patch.dart
+++ b/sdk/lib/_internal/vm/lib/internal_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:_internal" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -19,6 +17,12 @@
 // part "print_patch.dart";
 // part "symbol_patch.dart";
 
+// On the VM, we don't make the entire legacy weak mode check
+// const to avoid having a constant in the platform libraries
+// which evaluates differently in weak vs strong mode.
+@patch
+bool typeAcceptsNull<T>() => (const <Null>[]) is List<int> || null is T;
+
 @patch
 List<T> makeListFixedLength<T>(List<T> growableList)
     native "Internal_makeListFixedLength";
@@ -155,7 +159,7 @@
 // type of a value.
 //
 // Important: this is unsafe and must be used with care.
-T unsafeCast<T>(Object v) native "Internal_unsafeCast";
+T unsafeCast<T>(Object? v) native "Internal_unsafeCast";
 
 // This function can be used to keep an object alive til that point.
 //
@@ -173,11 +177,11 @@
     var message,
     bool paused,
     bool errorsAreFatal,
-    SendPort onExit,
-    SendPort onError,
-    String packageConfig,
+    SendPort? onExit,
+    SendPort? onError,
+    String? packageConfig,
     bool newIsolateGroup,
-    String debugName) native "Isolate_spawnFunction";
+    String? debugName) native "Isolate_spawnFunction";
 
 // Collection of functions which should only be used for testing purposes.
 abstract class VMInternalsForTesting {
diff --git a/sdk/lib/_internal/vm/lib/invocation_mirror_patch.dart b/sdk/lib/_internal/vm/lib/invocation_mirror_patch.dart
index 1f43d54..075e001 100644
--- a/sdk/lib/_internal/vm/lib/invocation_mirror_patch.dart
+++ b/sdk/lib/_internal/vm/lib/invocation_mirror_patch.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.6
-
 // part of "core_patch.dart";
 
 // NOTE: When making changes to this class, please also update
@@ -41,41 +39,43 @@
   static const int _FIRST_NAMED_ENTRY = 4;
 
   // Internal representation of the invocation mirror.
-  String _functionName;
-  List _argumentsDescriptor;
-  List _arguments;
-  bool _isSuperInvocation;
-  int _delayedTypeArgumentsLen;
+  String? _functionName;
+  List? _argumentsDescriptor;
+  List? _arguments;
+  bool _isSuperInvocation = false;
+  int _delayedTypeArgumentsLen = 0;
 
   // External representation of the invocation mirror; populated on demand.
-  Symbol _memberName;
+  Symbol? _memberName;
   int _type = _UNINITIALIZED;
-  List<Type> _typeArguments;
-  List _positionalArguments;
-  Map<Symbol, dynamic> _namedArguments;
+  List<Type>? _typeArguments;
+  List? _positionalArguments;
+  Map<Symbol, dynamic>? _namedArguments;
 
-  _InvocationMirror._withType(this._memberName, this._type, this._typeArguments,
-      this._positionalArguments, this._namedArguments) {
+  _InvocationMirror._withType(this._memberName, int? type, this._typeArguments,
+      this._positionalArguments, this._namedArguments)
+      : _type = type ?? _UNINITIALIZED {
     _typeArguments ??= const <Type>[];
     _positionalArguments ??= const [];
     _namedArguments ??= const {};
   }
 
   void _setMemberNameAndType() {
+    final funcName = _functionName!;
     if (_type == _UNINITIALIZED) {
       _type = 0;
     }
-    if (_functionName.startsWith("get:")) {
+    if (funcName.startsWith("get:")) {
       _type |= _GETTER;
-      _memberName = new internal.Symbol.unvalidated(_functionName.substring(4));
-    } else if (_functionName.startsWith("set:")) {
+      _memberName = new internal.Symbol.unvalidated(funcName.substring(4));
+    } else if (funcName.startsWith("set:")) {
       _type |= _SETTER;
       _memberName =
-          new internal.Symbol.unvalidated(_functionName.substring(4) + "=");
+          new internal.Symbol.unvalidated(funcName.substring(4) + "=");
     } else {
       _type |=
           _isSuperInvocation ? (_SUPER << _LEVEL_SHIFT) | _METHOD : _METHOD;
-      _memberName = new internal.Symbol.unvalidated(_functionName);
+      _memberName = new internal.Symbol.unvalidated(funcName);
     }
   }
 
@@ -83,11 +83,11 @@
     if (_memberName == null) {
       _setMemberNameAndType();
     }
-    return _memberName;
+    return _memberName!;
   }
 
   int get _typeArgsLen {
-    int typeArgsLen = _argumentsDescriptor[_TYPE_ARGS_LEN];
+    int typeArgsLen = _argumentsDescriptor![_TYPE_ARGS_LEN];
     return typeArgsLen == 0 ? _delayedTypeArgumentsLen : typeArgsLen;
   }
 
@@ -99,9 +99,9 @@
       // A TypeArguments object does not have a corresponding Dart class and
       // cannot be accessed as an array in Dart. Therefore, we need a native
       // call to unpack the individual types into a list.
-      _typeArguments = _unpackTypeArguments(_arguments[0], _typeArgsLen);
+      _typeArguments = _unpackTypeArguments(_arguments![0], _typeArgsLen);
     }
-    return _typeArguments;
+    return _typeArguments!;
   }
 
   // Unpack the given TypeArguments object into a new list of individual types.
@@ -112,38 +112,40 @@
     if (_positionalArguments == null) {
       // The argument descriptor counts the receiver, but not the type arguments
       // as positional arguments.
-      int numPositionalArguments = _argumentsDescriptor[_POSITIONAL_COUNT] - 1;
+      int numPositionalArguments = _argumentsDescriptor![_POSITIONAL_COUNT] - 1;
       if (numPositionalArguments == 0) {
         return _positionalArguments = const [];
       }
       // Exclude receiver and type args in the returned list.
       int receiverIndex = _typeArgsLen > 0 ? 1 : 0;
+      var args = _arguments!;
       _positionalArguments = new _ImmutableList._from(
-          _arguments, receiverIndex + 1, numPositionalArguments);
+          args, receiverIndex + 1, numPositionalArguments);
     }
-    return _positionalArguments;
+    return _positionalArguments!;
   }
 
   Map<Symbol, dynamic> get namedArguments {
     if (_namedArguments == null) {
-      int numArguments = _argumentsDescriptor[_COUNT] - 1; // Exclude receiver.
-      int numPositionalArguments = _argumentsDescriptor[_POSITIONAL_COUNT] - 1;
+      final argsDescriptor = _argumentsDescriptor!;
+      int numArguments = argsDescriptor[_COUNT] - 1; // Exclude receiver.
+      int numPositionalArguments = argsDescriptor[_POSITIONAL_COUNT] - 1;
       int numNamedArguments = numArguments - numPositionalArguments;
       if (numNamedArguments == 0) {
         return _namedArguments = const {};
       }
       int receiverIndex = _typeArgsLen > 0 ? 1 : 0;
-      _namedArguments = new Map<Symbol, dynamic>();
+      final namedArguments = new Map<Symbol, dynamic>();
       for (int i = 0; i < numNamedArguments; i++) {
         int namedEntryIndex = _FIRST_NAMED_ENTRY + 2 * i;
-        String arg_name = _argumentsDescriptor[namedEntryIndex];
-        var arg_value = _arguments[
-            receiverIndex + _argumentsDescriptor[namedEntryIndex + 1]];
-        _namedArguments[new internal.Symbol.unvalidated(arg_name)] = arg_value;
+        int pos = argsDescriptor[namedEntryIndex + 1];
+        String arg_name = argsDescriptor[namedEntryIndex];
+        var arg_value = _arguments![receiverIndex + pos];
+        namedArguments[new internal.Symbol.unvalidated(arg_name)] = arg_value;
       }
-      _namedArguments = new Map.unmodifiable(_namedArguments);
+      _namedArguments = new Map.unmodifiable(namedArguments);
     }
-    return _namedArguments;
+    return _namedArguments!;
   }
 
   bool get isMethod {
@@ -200,7 +202,7 @@
       String functionName,
       List argumentsDescriptor,
       List arguments,
-      int type,
+      int? type,
       int delayedTypeArgumentsLen) {
     return new _InvocationMirror(functionName, argumentsDescriptor, arguments,
         false, type ?? _UNINITIALIZED, delayedTypeArgumentsLen);
diff --git a/sdk/lib/_internal/vm/lib/isolate_patch.dart b/sdk/lib/_internal/vm/lib/isolate_patch.dart
index c06dc3f..da2ed68 100644
--- a/sdk/lib/_internal/vm/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/vm/lib/isolate_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:isolate" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -64,7 +62,7 @@
    * event is received.
    */
   @patch
-  factory RawReceivePort([Function handler]) {
+  factory RawReceivePort([Function? handler]) {
     _RawReceivePortImpl result = new _RawReceivePortImpl();
     result.handler = handler;
     return result;
@@ -74,8 +72,9 @@
 class _ReceivePortImpl extends Stream implements ReceivePort {
   _ReceivePortImpl() : this.fromRawReceivePort(new RawReceivePort());
 
-  _ReceivePortImpl.fromRawReceivePort(this._rawPort) {
-    _controller = new StreamController(onCancel: close, sync: true);
+  _ReceivePortImpl.fromRawReceivePort(this._rawPort)
+      : _controller = new StreamController(sync: true) {
+    _controller.onCancel = close;
     _rawPort.handler = _controller.add;
   }
 
@@ -83,8 +82,8 @@
     return _rawPort.sendPort;
   }
 
-  StreamSubscription listen(void onData(var message),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription listen(void onData(var message)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -95,13 +94,13 @@
   }
 
   final RawReceivePort _rawPort;
-  StreamController _controller;
+  final StreamController _controller;
 }
 
 typedef void _ImmediateCallback();
 
 /// The callback that has been registered through `scheduleImmediate`.
-_ImmediateCallback _pendingImmediateCallback;
+_ImmediateCallback? _pendingImmediateCallback;
 
 /// The closure that should be used as scheduleImmediateClosure, when the VM
 /// is responsible for the event loop.
@@ -173,7 +172,7 @@
   // Call into the VM to close the VM maintained mappings.
   _closeInternal() native "RawReceivePortImpl_closeInternal";
 
-  void set handler(Function value) {
+  void set handler(Function? value) {
     _handlerMap[this._get_id()] = value;
   }
 
@@ -221,8 +220,8 @@
 }
 
 typedef _NullaryFunction();
-typedef _UnaryFunction(Null args);
-typedef _BinaryFunction(Null args, Null message);
+typedef _UnaryFunction(Never args);
+typedef _BinaryFunction(Never args, Never message);
 
 /**
  * Takes the real entry point as argument and invokes it with the
@@ -258,13 +257,13 @@
  */
 @pragma("vm:entry-point", "call")
 void _startIsolate(
-    SendPort parentPort,
+    SendPort? parentPort,
     Function entryPoint,
-    List<String> args,
-    var message,
+    List<String>? args,
+    Object? message,
     bool isSpawnUri,
-    RawReceivePort controlPort,
-    List capabilities) {
+    RawReceivePort? controlPort,
+    List? capabilities) {
   // The control port (aka the main isolate port) does not handle any messages.
   if (controlPort != null) {
     controlPort.handler = (_) {}; // Nobody home on the control port.
@@ -274,7 +273,7 @@
       // current isolate's control port and capabilities.
       //
       // TODO(floitsch): Send an error message if we can't find the entry point.
-      final readyMessage = List(2);
+      final readyMessage = List<Object?>.filled(2, null);
       readyMessage[0] = controlPort.sendPort;
       readyMessage[1] = capabilities;
 
@@ -321,12 +320,12 @@
   String get debugName => _getDebugName(controlPort);
 
   @patch
-  static Future<Uri> get packageRoot {
+  static Future<Uri?> get packageRoot {
     return Future.value(null);
   }
 
   @patch
-  static Future<Uri> get packageConfig {
+  static Future<Uri?> get packageConfig {
     var hook = VMLibraryHooks.packageConfigUriFuture;
     if (hook == null) {
       throw new UnsupportedError("Isolate.packageConfig");
@@ -335,7 +334,7 @@
   }
 
   @patch
-  static Future<Uri> resolvePackageUri(Uri packageUri) {
+  static Future<Uri?> resolvePackageUri(Uri packageUri) {
     var hook = VMLibraryHooks.resolvePackageUriFuture;
     if (hook == null) {
       throw new UnsupportedError("Isolate.resolvePackageUri");
@@ -349,11 +348,11 @@
 
   @patch
   static Future<Isolate> spawn<T>(void entryPoint(T message), T message,
-      {bool paused: false,
-      bool errorsAreFatal,
-      SendPort onExit,
-      SendPort onError,
-      String debugName}) async {
+      {bool paused = false,
+      bool errorsAreFatal = true,
+      SendPort? onExit,
+      SendPort? onError,
+      String? debugName}) async {
     // `paused` isn't handled yet.
     // Check for the type of `entryPoint` on the spawning isolate to make
     // error-handling easier.
@@ -399,16 +398,16 @@
 
   @patch
   static Future<Isolate> spawnUri(Uri uri, List<String> args, var message,
-      {bool paused: false,
-      SendPort onExit,
-      SendPort onError,
-      bool errorsAreFatal,
-      bool checked,
-      Map<String, String> environment,
-      Uri packageRoot,
-      Uri packageConfig,
-      bool automaticPackageResolution: false,
-      String debugName}) async {
+      {bool paused = false,
+      SendPort? onExit,
+      SendPort? onError,
+      bool errorsAreFatal = true,
+      bool? checked,
+      Map<String, String>? environment,
+      Uri? packageRoot,
+      Uri? packageConfig,
+      bool automaticPackageResolution = false,
+      String? debugName}) async {
     if (environment != null) {
       throw new UnimplementedError("environment");
     }
@@ -432,7 +431,7 @@
       }
     }
     // Resolve the uri against the current isolate's root Uri first.
-    final Uri spawnedUri = _rootUri.resolveUri(uri);
+    final Uri spawnedUri = _rootUri!.resolveUri(uri);
 
     // Inherit this isolate's package resolution setup if not overridden.
     if (!automaticPackageResolution && packageConfig == null) {
@@ -521,13 +520,13 @@
       List<String> args,
       var message,
       bool paused,
-      SendPort onExit,
-      SendPort onError,
+      SendPort? onExit,
+      SendPort? onError,
       bool errorsAreFatal,
-      bool checked,
-      List environment,
-      String packageConfig,
-      String debugName) native "Isolate_spawnUri";
+      bool? checked,
+      List? environment,
+      String? packageConfig,
+      String? debugName) native "Isolate_spawnUri";
 
   static void _sendOOB(port, msg) native "Isolate_sendOOB";
 
@@ -536,7 +535,9 @@
 
   @patch
   void _pause(Capability resumeCapability) {
-    var msg = new List(4)
+    // _sendOOB expects a fixed length array and hence we create a fixed
+    // length array and assign values to it instead of using [ ... ].
+    var msg = new List<Object?>.filled(4, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _PAUSE
       ..[2] = pauseCapability
@@ -546,7 +547,7 @@
 
   @patch
   void resume(Capability resumeCapability) {
-    var msg = new List(4)
+    var msg = new List<Object?>.filled(4, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _RESUME
       ..[2] = pauseCapability
@@ -555,8 +556,8 @@
   }
 
   @patch
-  void addOnExitListener(SendPort responsePort, {Object response}) {
-    var msg = new List(4)
+  void addOnExitListener(SendPort responsePort, {Object? response}) {
+    var msg = new List<Object?>.filled(4, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _ADD_EXIT
       ..[2] = responsePort
@@ -566,7 +567,7 @@
 
   @patch
   void removeOnExitListener(SendPort responsePort) {
-    var msg = new List(3)
+    var msg = new List<Object?>.filled(3, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _DEL_EXIT
       ..[2] = responsePort;
@@ -575,7 +576,7 @@
 
   @patch
   void setErrorsFatal(bool errorsAreFatal) {
-    var msg = new List(4)
+    var msg = new List<Object?>.filled(4, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _ERROR_FATAL
       ..[2] = terminateCapability
@@ -585,7 +586,7 @@
 
   @patch
   void kill({int priority: beforeNextEvent}) {
-    var msg = new List(4)
+    var msg = new List<Object?>.filled(4, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _KILL
       ..[2] = terminateCapability
@@ -594,8 +595,9 @@
   }
 
   @patch
-  void ping(SendPort responsePort, {Object response, int priority: immediate}) {
-    var msg = new List(5)
+  void ping(SendPort responsePort,
+      {Object? response, int priority: immediate}) {
+    var msg = new List<Object?>.filled(5, null)
       ..[0] = 0 // Make room for OOM message type.
       ..[1] = _PING
       ..[2] = responsePort
@@ -606,7 +608,7 @@
 
   @patch
   void addErrorListener(SendPort port) {
-    var msg = new List(3)
+    var msg = new List<Object?>.filled(3, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _ADD_ERROR
       ..[2] = port;
@@ -615,7 +617,7 @@
 
   @patch
   void removeErrorListener(SendPort port) {
-    var msg = new List(3)
+    var msg = new List<Object?>.filled(3, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = _DEL_ERROR
       ..[2] = port;
@@ -632,7 +634,7 @@
   static List _getPortAndCapabilitiesOfCurrentIsolate()
       native "Isolate_getPortAndCapabilitiesOfCurrentIsolate";
 
-  static Uri _getCurrentRootUri() {
+  static Uri? _getCurrentRootUri() {
     try {
       return Uri.parse(_getCurrentRootUriStr());
     } catch (e) {
diff --git a/sdk/lib/_internal/vm/lib/lib_prefix.dart b/sdk/lib/_internal/vm/lib/lib_prefix.dart
index 5135a26..d8e52fd 100644
--- a/sdk/lib/_internal/vm/lib/lib_prefix.dart
+++ b/sdk/lib/_internal/vm/lib/lib_prefix.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.6
-
 // part of "core_patch.dart";
 
 // This type corresponds to the VM-internal class LibraryPrefix.
diff --git a/sdk/lib/_internal/vm/lib/map_patch.dart b/sdk/lib/_internal/vm/lib/map_patch.dart
index cda2946..07dbc69 100644
--- a/sdk/lib/_internal/vm/lib/map_patch.dart
+++ b/sdk/lib/_internal/vm/lib/map_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/math_patch.dart b/sdk/lib/_internal/vm/lib/math_patch.dart
index 03aa4e0..b41daad 100644
--- a/sdk/lib/_internal/vm/lib/math_patch.dart
+++ b/sdk/lib/_internal/vm/lib/math_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:math" which contains all the imports used
 /// by patches of that library. We plan to change this when we have a shared
@@ -29,7 +27,7 @@
         // The following returns -0.0 if either a or b is -0.0, and it
         // returns NaN if b is NaN.
         num n = (a + b) * a * b;
-        return n;
+        return n as T;
       }
     }
     // Check for NaN and b == -0.0.
@@ -53,7 +51,7 @@
         // The following returns 0.0 if either a or b is 0.0, and it
         // returns NaN if b is NaN.
         num n = a + b;
-        return n;
+        return n as T;
       }
     }
     // Check for NaN.
@@ -172,7 +170,7 @@
 @patch
 class Random {
   @patch
-  factory Random([int seed]) {
+  factory Random([int? seed]) {
     var state = _Random._setupSeed((seed == null) ? _Random._nextSeed() : seed);
     // Crank a couple of times to distribute the seed bits a bit further.
     return new _Random._withState(state)
diff --git a/sdk/lib/_internal/vm/lib/mirror_reference.dart b/sdk/lib/_internal/vm/lib/mirror_reference.dart
index 4fe5ffe..0cb1e37 100644
--- a/sdk/lib/_internal/vm/lib/mirror_reference.dart
+++ b/sdk/lib/_internal/vm/lib/mirror_reference.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.6
-
 // part of "mirrors_patch.dart";
 
 @pragma("vm:entry-point")
@@ -12,5 +10,5 @@
     throw "Unreachable";
   }
 
-  bool operator ==(other) native "MirrorReference_equals";
+  bool operator ==(Object other) native "MirrorReference_equals";
 }
diff --git a/sdk/lib/_internal/vm/lib/mirrors_impl.dart b/sdk/lib/_internal/vm/lib/mirrors_impl.dart
index 8f36206..a7f1f13 100644
--- a/sdk/lib/_internal/vm/lib/mirrors_impl.dart
+++ b/sdk/lib/_internal/vm/lib/mirrors_impl.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.6
-
 // part of "mirrors_patch.dart";
 
 var _dirty = false; // Set to true by the VM when more libraries are loaded.
@@ -20,12 +18,12 @@
   return new internal.Symbol.unvalidated(name);
 }
 
-Symbol _sOpt(String name) {
+Symbol? _sOpt(String? name) {
   if (name == null) return null;
   return new internal.Symbol.unvalidated(name);
 }
 
-Symbol _computeQualifiedName(DeclarationMirror owner, Symbol simpleName) {
+Symbol _computeQualifiedName(DeclarationMirror? owner, Symbol simpleName) {
   if (owner == null) return simpleName;
   return _s('${_n(owner.qualifiedName)}.${_n(simpleName)}');
 }
@@ -67,12 +65,12 @@
   return buf.toString();
 }
 
-SourceLocation _location(reflectee) native "DeclarationMirror_location";
+SourceLocation? _location(reflectee) native "DeclarationMirror_location";
 
 List<dynamic> _metadata(reflectee) native 'DeclarationMirror_metadata';
 
 List<InstanceMirror> _wrapMetadata(List reflectees) {
-  var mirrors = new List<InstanceMirror>();
+  var mirrors = <InstanceMirror>[];
   for (var reflectee in reflectees) {
     mirrors.add(reflect(reflectee));
   }
@@ -101,7 +99,7 @@
 
   static List<dynamic> _computeLibraries() native "MirrorSystem_libraries";
 
-  IsolateMirror _isolate;
+  IsolateMirror? _isolate;
   IsolateMirror get isolate {
     var i = _isolate;
     if (i != null) return i;
@@ -147,7 +145,7 @@
     return result;
   }
 
-  static LibraryMirror _loadUri(String uri) native "IsolateMirror_loadUri";
+  static LibraryMirror? _loadUri(String uri) native "IsolateMirror_loadUri";
 }
 
 class _SyntheticAccessor implements MethodMirror {
@@ -186,9 +184,9 @@
         <ParameterMirror>[new _SyntheticSetterParameter(this, this._target)]);
   }
 
-  SourceLocation get location => null;
+  SourceLocation? get location => null;
   List<InstanceMirror> get metadata => const <InstanceMirror>[];
-  String get source => null;
+  String? get source => null;
 }
 
 class _SyntheticSetterParameter implements ParameterMirror {
@@ -210,8 +208,8 @@
   bool get isPrivate => false;
   bool get isExtensionMember => false;
   bool get hasDefaultValue => false;
-  InstanceMirror get defaultValue => null;
-  SourceLocation get location => null;
+  InstanceMirror? get defaultValue => null;
+  SourceLocation? get location => null;
   List<InstanceMirror> get metadata => const <InstanceMirror>[];
 }
 
@@ -224,14 +222,14 @@
 
   _ObjectMirror._(this._reflectee);
 
-  InstanceMirror invoke(Symbol memberName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  InstanceMirror invoke(Symbol memberName, List positionalArguments,
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
     int numPositionalArguments = positionalArguments.length;
-    int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
+    int numNamedArguments = namedArguments.length;
     int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List(numArguments);
+    List arguments = new List<dynamic>.filled(numArguments, null);
     arguments.setRange(0, numPositionalArguments, positionalArguments);
-    List names = new List(numNamedArguments);
+    List names = new List<dynamic>.filled(numNamedArguments, null);
     int argumentIndex = numPositionalArguments;
     int nameIndex = 0;
     if (numNamedArguments > 0) {
@@ -277,7 +275,7 @@
 class _InstanceMirror extends _ObjectMirror implements InstanceMirror {
   _InstanceMirror._(reflectee) : super._(reflectee);
 
-  ClassMirror _type;
+  ClassMirror? _type;
   ClassMirror get type {
     var t = _type;
     if (t != null) return t;
@@ -294,7 +292,7 @@
 
   String toString() => 'InstanceMirror on ${Error.safeToString(_reflectee)}';
 
-  bool operator ==(other) {
+  bool operator ==(Object other) {
     return other is _InstanceMirror && identical(_reflectee, other._reflectee);
   }
 
@@ -314,15 +312,15 @@
   }
 
   // Override to include the receiver in the arguments.
-  InstanceMirror invoke(Symbol memberName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  InstanceMirror invoke(Symbol memberName, List positionalArguments,
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
     int numPositionalArguments = positionalArguments.length + 1; // Receiver.
-    int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
+    int numNamedArguments = namedArguments.length;
     int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List(numArguments);
+    List arguments = new List<dynamic>.filled(numArguments, null);
     arguments[0] = _reflectee; // Receiver.
     arguments.setRange(1, numPositionalArguments, positionalArguments);
-    List names = new List(numNamedArguments);
+    List names = new List<dynamic>.filled(numNamedArguments, null);
     int argumentIndex = numPositionalArguments;
     int nameIndex = 0;
     if (numNamedArguments > 0) {
@@ -349,15 +347,15 @@
 class _ClosureMirror extends _InstanceMirror implements ClosureMirror {
   _ClosureMirror._(reflectee) : super._(reflectee);
 
-  MethodMirror _function;
+  MethodMirror? _function;
   MethodMirror get function {
     var f = _function;
     if (f != null) return f;
     return _function = _computeFunction(reflectee);
   }
 
-  InstanceMirror apply(List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  InstanceMirror apply(List positionalArguments,
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
     return this.invoke(#call, positionalArguments, namedArguments);
   }
 
@@ -372,8 +370,8 @@
 
 class _ClassMirror extends _ObjectMirror implements ClassMirror, _TypeMirror {
   final Type _reflectedType;
-  Symbol _simpleName;
-  DeclarationMirror _owner;
+  Symbol? _simpleName;
+  DeclarationMirror? _owner;
   final bool isAbstract;
   final bool _isGeneric;
 
@@ -389,7 +387,7 @@
   _ClassMirror._(
       reflectee,
       reflectedType,
-      String simpleName,
+      String? simpleName,
       this._owner,
       this.isAbstract,
       this._isGeneric,
@@ -418,7 +416,7 @@
     return _simpleName = this._mixinApplicationName;
   }
 
-  Symbol _qualifiedName;
+  Symbol? _qualifiedName;
   Symbol get qualifiedName {
     var n = _qualifiedName;
     if (n != null) return n;
@@ -426,7 +424,7 @@
     return _qualifiedName = _computeQualifiedName(owner, simpleName);
   }
 
-  DeclarationMirror get owner {
+  DeclarationMirror? get owner {
     var o = _owner;
     if (o != null) return o;
 
@@ -438,14 +436,14 @@
 
   bool get isTopLevel => true;
 
-  SourceLocation get location {
+  SourceLocation? get location {
     return _location(_reflectee);
   }
 
-  _ClassMirror _trueSuperclassField;
-  _ClassMirror get _trueSuperclass {
+  _ClassMirror? _trueSuperclassField;
+  _ClassMirror? get _trueSuperclass {
     if (_trueSuperclassField == null) {
-      Type supertype = isOriginalDeclaration
+      Type? supertype = isOriginalDeclaration
           ? _supertype(_reflectedType)
           : _supertypeInstantiated(_reflectedType);
       if (supertype == null) {
@@ -459,7 +457,7 @@
     return _trueSuperclassField;
   }
 
-  ClassMirror get superclass {
+  ClassMirror? get superclass {
     return _trueSuperclass;
   }
 
@@ -474,7 +472,7 @@
     if (_isTransformedMixinApplication) {
       interfaceTypes = interfaceTypes.sublist(0, interfaceTypes.length - 1);
     }
-    var interfaceMirrors = new List<ClassMirror>();
+    var interfaceMirrors = <ClassMirror>[];
     for (var interfaceType in interfaceTypes) {
       interfaceMirrors.add(reflectType(interfaceType) as ClassMirror);
     }
@@ -483,7 +481,7 @@
   }
 
   Symbol get _mixinApplicationName {
-    var mixins = new List<ClassMirror>();
+    var mixins = <ClassMirror>[];
     var klass = this;
     while (_nativeMixin(klass._reflectedType) != null) {
       mixins.add(klass.mixin);
@@ -494,12 +492,12 @@
         mixins.reversed.map((ClassMirror m) => _n(m.qualifiedName)).join(', '));
   }
 
-  ClassMirror _mixin;
+  ClassMirror? _mixin;
   ClassMirror get mixin {
     var m = _mixin;
     if (m != null) return m;
 
-    Type mixinType = _nativeMixinInstantiated(_reflectedType, _instantiator);
+    Type? mixinType = _nativeMixinInstantiated(_reflectedType, _instantiator);
     if (mixinType == null) {
       // The reflectee is not a mixin application.
       return _mixin = this;
@@ -567,7 +565,7 @@
         new UnmodifiableMapView<Symbol, MethodMirror>(result);
   }
 
-  Map<Symbol, DeclarationMirror> _declarations;
+  Map<Symbol, DeclarationMirror>? _declarations;
   Map<Symbol, DeclarationMirror> get declarations {
     var d = _declarations;
     if (d != null) return d;
@@ -600,7 +598,7 @@
     return true;
   }
 
-  List<TypeVariableMirror> _typeVariables;
+  List<TypeVariableMirror>? _typeVariables;
   List<TypeVariableMirror> get typeVariables {
     var v = _typeVariables;
     if (v != null) return v;
@@ -608,7 +606,7 @@
     if (!_isTransformedMixinApplication && _isAnonymousMixinApplication) {
       return _typeVariables = const <TypeVariableMirror>[];
     }
-    var result = new List<TypeVariableMirror>();
+    var result = <TypeVariableMirror>[];
 
     List params = _ClassMirror_type_variables(_reflectee);
     ClassMirror owner = originalDeclaration;
@@ -621,7 +619,7 @@
         new UnmodifiableListView<TypeVariableMirror>(result);
   }
 
-  List<TypeMirror> _typeArguments;
+  List<TypeMirror>? _typeArguments;
   List<TypeMirror> get typeArguments {
     var a = _typeArguments;
     if (a != null) return a;
@@ -647,17 +645,16 @@
 
   String toString() => "ClassMirror on '${MirrorSystem.getName(simpleName)}'";
 
-  InstanceMirror newInstance(
-      Symbol constructorName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]) {
+  InstanceMirror newInstance(Symbol constructorName, List positionalArguments,
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
     // Native code will add the 1 or 2 implicit arguments depending on whether
     // we end up invoking a factory or constructor respectively.
     int numPositionalArguments = positionalArguments.length;
-    int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
+    int numNamedArguments = namedArguments.length;
     int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List(numArguments);
+    List arguments = new List<dynamic>.filled(numArguments, null);
     arguments.setRange(0, numPositionalArguments, positionalArguments);
-    List names = new List(numNamedArguments);
+    List names = new List<dynamic>.filled(numNamedArguments, null);
     int argumentIndex = numPositionalArguments;
     int nameIndex = 0;
     if (numNamedArguments > 0) {
@@ -675,8 +672,8 @@
     return _wrapMetadata(_metadata(_reflectee));
   }
 
-  bool operator ==(other) {
-    return this.runtimeType == other.runtimeType &&
+  bool operator ==(Object other) {
+    return other is _ClassMirror &&
         this._reflectee == other._reflectee &&
         this._reflectedType == other._reflectedType &&
         this._isGenericDeclaration == other._isGenericDeclaration;
@@ -701,6 +698,7 @@
   }
 
   bool isSubclassOf(ClassMirror other) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (other == null) {
       throw new ArgumentError.notNull('other');
     }
@@ -716,9 +714,9 @@
 
   static String _libraryUri(reflectee) native "ClassMirror_libraryUri";
 
-  static Type _supertype(reflectedType) native "ClassMirror_supertype";
+  static Type? _supertype(reflectedType) native "ClassMirror_supertype";
 
-  static Type _supertypeInstantiated(reflectedType)
+  static Type? _supertypeInstantiated(reflectedType)
       native "ClassMirror_supertype_instantiated";
 
   static List<dynamic> _nativeInterfaces(reflectedType)
@@ -727,9 +725,9 @@
   static List<dynamic> _nativeInterfacesInstantiated(reflectedType)
       native "ClassMirror_interfaces_instantiated";
 
-  static Type _nativeMixin(reflectedType) native "ClassMirror_mixin";
+  static Type? _nativeMixin(reflectedType) native "ClassMirror_mixin";
 
-  static Type _nativeMixinInstantiated(reflectedType, instantiator)
+  static Type? _nativeMixinInstantiated(reflectedType, instantiator)
       native "ClassMirror_mixin_instantiated";
 
   static List<dynamic> _computeMembers(owner, reflectee, instantiator)
@@ -764,21 +762,21 @@
   bool get _isAnonymousMixinApplication => false;
 
   // FunctionTypeMirrors have a simpleName generated from their signature.
-  Symbol _simpleName;
+  Symbol? _simpleName;
   Symbol get simpleName {
     var n = _simpleName;
     if (n != null) return n;
     return _simpleName = _s(_makeSignatureString(returnType, parameters));
   }
 
-  MethodMirror _callMethod;
+  MethodMirror? _callMethod;
   MethodMirror get callMethod {
     var m = _callMethod;
     if (m != null) return m;
     return _callMethod = _FunctionTypeMirror_call_method(_functionReflectee);
   }
 
-  TypeMirror _returnType;
+  TypeMirror? _returnType;
   TypeMirror get returnType {
     var t = _returnType;
     if (t != null) return t;
@@ -786,7 +784,7 @@
         reflectType(_FunctionTypeMirror_return_type(_functionReflectee));
   }
 
-  List<ParameterMirror> _parameters;
+  List<ParameterMirror>? _parameters;
   List<ParameterMirror> get parameters {
     var p = _parameters;
     if (p != null) return p;
@@ -800,7 +798,7 @@
   List<TypeVariableMirror> get typeVariables => const <TypeVariableMirror>[];
   List<TypeMirror> get typeArguments => const <TypeMirror>[];
   List<InstanceMirror> get metadata => const <InstanceMirror>[];
-  SourceLocation get location => null;
+  SourceLocation? get location => null;
 
   String toString() => "FunctionTypeMirror on '${_n(simpleName)}'";
 
@@ -822,7 +820,7 @@
 
   Symbol get simpleName => _simpleName;
 
-  Symbol _qualifiedName;
+  Symbol? _qualifiedName;
   Symbol get qualifiedName {
     var n = _qualifiedName;
     if (n != null) return n;
@@ -831,7 +829,7 @@
 
   bool get isPrivate => _n(simpleName).startsWith('_');
 
-  SourceLocation get location {
+  SourceLocation? get location {
     return _location(_reflectee);
   }
 
@@ -839,9 +837,8 @@
     return _wrapMetadata(_metadata(_reflectee));
   }
 
-  bool operator ==(other) {
-    return this.runtimeType == other.runtimeType &&
-        this._reflectee == other._reflectee;
+  bool operator ==(Object other) {
+    return other is _DeclarationMirror && this._reflectee == other._reflectee;
   }
 
   int get hashCode => simpleName.hashCode;
@@ -852,7 +849,7 @@
   _TypeVariableMirror._(reflectee, String simpleName, this._owner)
       : super._(reflectee, _s(simpleName));
 
-  DeclarationMirror _owner;
+  DeclarationMirror? _owner;
   DeclarationMirror get owner {
     var o = _owner;
     if (o != null) return o;
@@ -863,7 +860,7 @@
   bool get isStatic => false;
   bool get isTopLevel => false;
 
-  TypeMirror _upperBound;
+  TypeMirror? _upperBound;
   TypeMirror get upperBound {
     var b = _upperBound;
     if (b != null) return b;
@@ -886,7 +883,7 @@
 
   String toString() => "TypeVariableMirror on '${_n(simpleName)}'";
 
-  bool operator ==(other) {
+  bool operator ==(Object other) {
     return other is TypeVariableMirror &&
         simpleName == other.simpleName &&
         owner == other.owner;
@@ -929,15 +926,15 @@
 
   bool get isTopLevel => true;
 
-  DeclarationMirror _owner;
-  DeclarationMirror get owner {
+  DeclarationMirror? _owner;
+  DeclarationMirror? get owner {
     var o = _owner;
     if (o != null) return o;
     var uri = _ClassMirror._libraryUri(_reflectee);
     return _owner = currentMirrorSystem().libraries[Uri.parse(uri)];
   }
 
-  _FunctionTypeMirror _referent;
+  _FunctionTypeMirror? _referent;
   FunctionTypeMirror get referent {
     var r = _referent;
     if (r != null) return r;
@@ -965,12 +962,12 @@
     }
   }
 
-  List<TypeVariableMirror> _typeVariables;
+  List<TypeVariableMirror>? _typeVariables;
   List<TypeVariableMirror> get typeVariables {
     var v = _typeVariables;
     if (v != null) return v;
 
-    var result = new List<TypeVariableMirror>();
+    var result = <TypeVariableMirror>[];
     List params = _ClassMirror._ClassMirror_type_variables(_reflectee);
     TypedefMirror owner = originalDeclaration;
     var mirror;
@@ -982,7 +979,7 @@
         new UnmodifiableListView<TypeVariableMirror>(result);
   }
 
-  List<TypeMirror> _typeArguments;
+  List<TypeMirror>? _typeArguments;
   List<TypeMirror> get typeArguments {
     var a = _typeArguments;
     if (a != null) return a;
@@ -1038,14 +1035,14 @@
   // The simple name and the qualified name are the same for a library.
   Symbol get qualifiedName => simpleName;
 
-  DeclarationMirror get owner => null;
+  DeclarationMirror? get owner => null;
 
   bool get isPrivate => false;
   bool get isTopLevel => false;
 
-  Type get _instantiator => null;
+  Type? get _instantiator => null;
 
-  Map<Symbol, DeclarationMirror> _declarations;
+  Map<Symbol, DeclarationMirror>? _declarations;
   Map<Symbol, DeclarationMirror> get declarations {
     var d = _declarations;
     if (d != null) return d;
@@ -1060,7 +1057,7 @@
         new UnmodifiableMapView<Symbol, DeclarationMirror>(decls);
   }
 
-  SourceLocation get location {
+  SourceLocation? get location {
     return _location(_reflectee);
   }
 
@@ -1068,9 +1065,8 @@
     return _wrapMetadata(_metadata(_reflectee));
   }
 
-  bool operator ==(other) {
-    return this.runtimeType == other.runtimeType &&
-        this._reflectee == other._reflectee;
+  bool operator ==(Object other) {
+    return other is _LibraryMirror && this._reflectee == other._reflectee;
   }
 
   int get hashCode => simpleName.hashCode;
@@ -1105,7 +1101,7 @@
   final LibraryMirror sourceLibrary;
   var _targetMirrorOrPrefix;
   final List<CombinatorMirror> combinators;
-  final Symbol prefix;
+  final Symbol? prefix;
   final bool isImport;
   final bool isDeferred;
   final List<InstanceMirror> metadata;
@@ -1125,7 +1121,7 @@
 
   bool get isExport => !isImport;
 
-  LibraryMirror get targetLibrary {
+  LibraryMirror? get targetLibrary {
     if (_targetMirrorOrPrefix is _LibraryMirror) {
       return _targetMirrorOrPrefix;
     }
@@ -1149,7 +1145,7 @@
   static LibraryMirror _tryUpgradePrefix(libraryPrefix)
       native "LibraryMirror_fromPrefix";
 
-  SourceLocation get location => null;
+  SourceLocation? get location => null;
 }
 
 class _CombinatorMirror extends Mirror implements CombinatorMirror {
@@ -1206,7 +1202,7 @@
   ];
   bool get isOperator => _operators.contains(_n(simpleName));
 
-  DeclarationMirror _owner;
+  DeclarationMirror? _owner;
   DeclarationMirror get owner {
     // For nested closures it is possible, that the mirror for the owner has not
     // been created yet.
@@ -1220,7 +1216,7 @@
 
   bool get isTopLevel => owner is LibraryMirror;
 
-  TypeMirror _returnType;
+  TypeMirror? _returnType;
   TypeMirror get returnType {
     var t = _returnType;
     if (t != null) return t;
@@ -1232,7 +1228,7 @@
     }
   }
 
-  List<ParameterMirror> _parameters;
+  List<ParameterMirror>? _parameters;
   List<ParameterMirror> get parameters {
     var p = _parameters;
     if (p != null) return p;
@@ -1242,7 +1238,7 @@
 
   bool get isRegularMethod => !isGetter && !isSetter && !isConstructor;
 
-  Symbol _constructorName;
+  Symbol? _constructorName;
   Symbol get constructorName {
     var n = _constructorName;
     if (n != null) return n;
@@ -1265,7 +1261,7 @@
     }
   }
 
-  String get source => _MethodMirror_source(_reflectee);
+  String? get source => _MethodMirror_source(_reflectee);
 
   void _patchConstructorName(ownerName) {
     var cn = _n(constructorName);
@@ -1287,7 +1283,7 @@
   List<dynamic> _MethodMirror_parameters(reflectee)
       native "MethodMirror_parameters";
 
-  static String _MethodMirror_source(reflectee) native "MethodMirror_source";
+  static String? _MethodMirror_source(reflectee) native "MethodMirror_source";
 }
 
 class _VariableMirror extends _DeclarationMirror implements VariableMirror {
@@ -1303,7 +1299,7 @@
 
   bool get isTopLevel => owner is LibraryMirror;
 
-  Type get _instantiator {
+  Type? get _instantiator {
     final o = owner; // Note: need local variable for promotion to happen.
     if (o is _ClassMirror) {
       return o._instantiator;
@@ -1316,7 +1312,7 @@
     }
   }
 
-  TypeMirror _type;
+  TypeMirror? _type;
   TypeMirror get type {
     var t = _type;
     if (t != null) return t;
@@ -1334,7 +1330,7 @@
   final int _position;
   final bool isOptional;
   final bool isNamed;
-  final List _unmirroredMetadata;
+  final List? _unmirroredMetadata;
 
   _ParameterMirror._(
       reflectee,
@@ -1358,8 +1354,8 @@
             );
 
   Object _defaultValueReflectee;
-  InstanceMirror _defaultValue;
-  InstanceMirror get defaultValue {
+  InstanceMirror? _defaultValue;
+  InstanceMirror? get defaultValue {
     if (!isOptional) {
       return null;
     }
@@ -1371,7 +1367,7 @@
 
   bool get hasDefaultValue => _defaultValueReflectee != null;
 
-  SourceLocation get location {
+  SourceLocation? get location {
     throw new UnsupportedError("ParameterMirror.location unimplemented");
   }
 
@@ -1381,7 +1377,7 @@
     return _wrapMetadata(m);
   }
 
-  TypeMirror _type;
+  TypeMirror? _type;
   TypeMirror get type {
     var t = _type;
     if (t != null) return t;
@@ -1404,9 +1400,9 @@
   bool get isPrivate => false;
   bool get isTopLevel => true;
 
-  DeclarationMirror get owner => null;
+  DeclarationMirror? get owner => null;
 
-  SourceLocation get location => null;
+  SourceLocation? get location => null;
   List<InstanceMirror> get metadata => const <InstanceMirror>[];
 
   bool get hasReflectedType => simpleName == #dynamic;
@@ -1423,7 +1419,7 @@
 
   Symbol get qualifiedName => simpleName;
 
-  bool operator ==(other) {
+  bool operator ==(Object other) {
     if (other is! _SpecialTypeMirror) {
       return false;
     }
@@ -1478,7 +1474,7 @@
     return classMirror;
   }
 
-  static TypeMirror reflectType(Type key, [List<Type> typeArguments]) {
+  static TypeMirror reflectType(Type key, [List<Type>? typeArguments]) {
     if (typeArguments != null) {
       key = _instantiateType(key, typeArguments);
     }
diff --git a/sdk/lib/_internal/vm/lib/mirrors_patch.dart b/sdk/lib/_internal/vm/lib/mirrors_patch.dart
index 6b8edd6..a06d546 100644
--- a/sdk/lib/_internal/vm/lib/mirrors_patch.dart
+++ b/sdk/lib/_internal/vm/lib/mirrors_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:_internal" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -52,7 +50,7 @@
 }
 
 @patch
-TypeMirror reflectType(Type key, [List<Type> typeArguments]) {
+TypeMirror reflectType(Type key, [List<Type>? typeArguments]) {
   return _Mirrors.reflectType(key, typeArguments);
 }
 
@@ -79,7 +77,7 @@
   }
 
   @patch
-  static Symbol getSymbol(String name, [LibraryMirror library]) {
+  static Symbol getSymbol(String name, [LibraryMirror? library]) {
     if ((library != null && library is! _LibraryMirror) ||
         ((name.length > 0) && (name[0] == '_') && (library == null))) {
       throw new ArgumentError(library);
diff --git a/sdk/lib/_internal/vm/lib/null_patch.dart b/sdk/lib/_internal/vm/lib/null_patch.dart
index 3e724f7..01bb5aa 100644
--- a/sdk/lib/_internal/vm/lib/null_patch.dart
+++ b/sdk/lib/_internal/vm/lib/null_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/object_patch.dart b/sdk/lib/_internal/vm/lib/object_patch.dart
index fe75579..e862e5c 100644
--- a/sdk/lib/_internal/vm/lib/object_patch.dart
+++ b/sdk/lib/_internal/vm/lib/object_patch.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.6
-
 // part of "core_patch.dart";
 
 @pragma("vm:exact-result-type", "dart:core#_Smi")
@@ -17,7 +15,7 @@
   @patch
   @pragma("vm:exact-result-type", bool)
   @pragma("vm:prefer-inline")
-  bool operator ==(other) native "Object_equals";
+  bool operator ==(Object other) native "Object_equals";
 
   // Helpers used to implement hashCode. If a hashCode is used, we remember it
   // in a weak table in the VM (32 bit) or in the header of the object (64
diff --git a/sdk/lib/_internal/vm/lib/print_patch.dart b/sdk/lib/_internal/vm/lib/print_patch.dart
index 96ee6b4..f0e7d91 100644
--- a/sdk/lib/_internal/vm/lib/print_patch.dart
+++ b/sdk/lib/_internal/vm/lib/print_patch.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.6
-
 // part of "internal_patch.dart";
 
 // A print-closure gets a String that should be printed. In general the
diff --git a/sdk/lib/_internal/vm/lib/profiler.dart b/sdk/lib/_internal/vm/lib/profiler.dart
index 4a7140f..745eaa5 100644
--- a/sdk/lib/_internal/vm/lib/profiler.dart
+++ b/sdk/lib/_internal/vm/lib/profiler.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.6
-
 // part of "developer.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/regexp_patch.dart b/sdk/lib/_internal/vm/lib/regexp_patch.dart
index d4c875e..7a57583 100644
--- a/sdk/lib/_internal/vm/lib/regexp_patch.dart
+++ b/sdk/lib/_internal/vm/lib/regexp_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
@@ -16,7 +14,7 @@
       bool dotAll: false}) {
     _RegExpHashKey key =
         new _RegExpHashKey(source, multiLine, caseSensitive, unicode, dotAll);
-    _RegExpHashValue value = _cache[key];
+    _RegExpHashValue? value = _cache[key];
 
     if (value == null) {
       if (_cache.length > _MAX_CACHE_SIZE) {
@@ -163,7 +161,7 @@
     return _match[(groupIdx * _MATCH_PAIR) + 1];
   }
 
-  String group(int groupIdx) {
+  String? group(int groupIdx) {
     if (groupIdx < 0 || groupIdx > _regexp._groupCount) {
       throw new RangeError.value(groupIdx);
     }
@@ -176,12 +174,12 @@
     return input._substringUnchecked(startIndex, endIndex);
   }
 
-  String operator [](int groupIdx) {
+  String? operator [](int groupIdx) {
     return this.group(groupIdx);
   }
 
-  List<String> groups(List<int> groupsSpec) {
-    var groupsList = new List<String>(groupsSpec.length);
+  List<String?> groups(List<int> groupsSpec) {
+    var groupsList = new List<String?>.filled(groupsSpec.length, null);
     for (int i = 0; i < groupsSpec.length; i++) {
       groupsList[i] = group(groupsSpec[i]);
     }
@@ -192,7 +190,7 @@
 
   Pattern get pattern => _regexp;
 
-  String namedGroup(String name) {
+  String? namedGroup(String name) {
     var idx = _regexp._groupNameIndex(name);
     if (idx < 0) {
       throw ArgumentError("Not a capture group name: ${name}");
@@ -218,9 +216,10 @@
       bool unicode: false,
       bool dotAll: false}) native "RegExp_factory";
 
-  RegExpMatch firstMatch(String input) {
+  RegExpMatch? firstMatch(String input) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (input == null) throw new ArgumentError.notNull('input');
-    List match = _ExecuteMatch(input, 0);
+    final match = _ExecuteMatch(input, 0);
     if (match == null) {
       return null;
     }
@@ -228,7 +227,8 @@
   }
 
   Iterable<RegExpMatch> allMatches(String string, [int start = 0]) {
-    if (string == null) throw new ArgumentError.notNull('input');
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
+    if (string == null) throw new ArgumentError.notNull('string');
     if (start == null) throw new ArgumentError.notNull('start');
     if (0 > start || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
@@ -236,26 +236,29 @@
     return new _AllMatchesIterable(this, string, start);
   }
 
-  RegExpMatch matchAsPrefix(String string, [int start = 0]) {
+  RegExpMatch? matchAsPrefix(String string, [int start = 0]) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (string == null) throw new ArgumentError.notNull('string');
     if (start == null) throw new ArgumentError.notNull('start');
     if (start < 0 || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
     }
-    List list = _ExecuteMatchSticky(string, start);
+    final list = _ExecuteMatchSticky(string, start);
     if (list == null) return null;
     return new _RegExpMatch._(this, string, list);
   }
 
   bool hasMatch(String input) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (input == null) throw new ArgumentError.notNull('input');
-    List match = _ExecuteMatch(input, 0);
+    List? match = _ExecuteMatch(input, 0);
     return (match == null) ? false : true;
   }
 
-  String stringMatch(String input) {
+  String? stringMatch(String input) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (input == null) throw new ArgumentError.notNull('input');
-    List match = _ExecuteMatch(input, 0);
+    List? match = _ExecuteMatch(input, 0);
     if (match == null) {
       return null;
     }
@@ -281,7 +284,7 @@
   /// [String] is the name of a capture group and the following
   /// [int] is that capture group's index.
   /// Returns `null` if there are no group names.
-  List get _groupNameList native "RegExp_getGroupNameMap";
+  List? get _groupNameList native "RegExp_getGroupNameMap";
 
   Iterable<String> get _groupNames sync* {
     final nameList = _groupNameList;
@@ -347,9 +350,10 @@
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   ];
 
-  List _ExecuteMatch(String str, int start_index) native "RegExp_ExecuteMatch";
+  List<int>? _ExecuteMatch(String str, int start_index)
+      native "RegExp_ExecuteMatch";
 
-  List _ExecuteMatchSticky(String str, int start_index)
+  List<int>? _ExecuteMatchSticky(String str, int start_index)
       native "RegExp_ExecuteMatchSticky";
 }
 
@@ -367,12 +371,12 @@
 class _AllMatchesIterator implements Iterator<RegExpMatch> {
   final String _str;
   int _nextIndex;
-  _RegExp _re;
-  RegExpMatch _current;
+  _RegExp? _re;
+  RegExpMatch? _current;
 
   _AllMatchesIterator(this._re, this._str, this._nextIndex);
 
-  RegExpMatch get current => _current;
+  RegExpMatch get current => _current!;
 
   static bool _isLeadSurrogate(int c) {
     return c >= 0xd800 && c <= 0xdbff;
@@ -383,17 +387,19 @@
   }
 
   bool moveNext() {
-    if (_re == null) return false; // Cleared after a failed match.
+    final re = _re;
+    if (re == null) return false; // Cleared after a failed match.
     if (_nextIndex <= _str.length) {
-      var match = _re._ExecuteMatch(_str, _nextIndex);
+      final match = re._ExecuteMatch(_str, _nextIndex);
       if (match != null) {
-        _current = new _RegExpMatch._(_re, _str, match);
-        _nextIndex = _current.end;
-        if (_nextIndex == _current.start) {
+        var current = new _RegExpMatch._(re, _str, match);
+        _current = current;
+        _nextIndex = current.end;
+        if (_nextIndex == current.start) {
           // Zero-width match. Advance by one more, unless the regexp
           // is in unicode mode and it would put us within a surrogate
           // pair. In that case, advance past the code point as a whole.
-          if (_re.isUnicode &&
+          if (re.isUnicode &&
               _nextIndex + 1 < _str.length &&
               _isLeadSurrogate(_str.codeUnitAt(_nextIndex)) &&
               _isTrailSurrogate(_str.codeUnitAt(_nextIndex + 1))) {
diff --git a/sdk/lib/_internal/vm/lib/schedule_microtask_patch.dart b/sdk/lib/_internal/vm/lib/schedule_microtask_patch.dart
index b1cfc52..3abbcb5 100644
--- a/sdk/lib/_internal/vm/lib/schedule_microtask_patch.dart
+++ b/sdk/lib/_internal/vm/lib/schedule_microtask_patch.dart
@@ -2,25 +2,24 @@
 // 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.6
-
 // part of "async_patch.dart";
 
 @patch
 class _AsyncRun {
   @patch
   static void _scheduleImmediate(void callback()) {
-    if (_ScheduleImmediate._closure == null) {
+    final closure = _ScheduleImmediate._closure;
+    if (closure == null) {
       throw new UnsupportedError("Microtasks are not supported");
     }
-    _ScheduleImmediate._closure(callback);
+    closure(callback);
   }
 }
 
 typedef void _ScheduleImmediateClosure(void callback());
 
 class _ScheduleImmediate {
-  static _ScheduleImmediateClosure _closure;
+  static _ScheduleImmediateClosure? _closure;
 }
 
 @pragma("vm:entry-point", "call")
diff --git a/sdk/lib/_internal/vm/lib/stacktrace.dart b/sdk/lib/_internal/vm/lib/stacktrace.dart
index 94464a5..719d55a 100644
--- a/sdk/lib/_internal/vm/lib/stacktrace.dart
+++ b/sdk/lib/_internal/vm/lib/stacktrace.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.6
-
 // part of "core_patch.dart";
 
 /// VM internal StackTrace implementation.
diff --git a/sdk/lib/_internal/vm/lib/stopwatch_patch.dart b/sdk/lib/_internal/vm/lib/stopwatch_patch.dart
index baf57aa..df29eca 100644
--- a/sdk/lib/_internal/vm/lib/stopwatch_patch.dart
+++ b/sdk/lib/_internal/vm/lib/stopwatch_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
@@ -11,11 +9,7 @@
   static const _maxInt = 0x7FFFFFFFFFFFFFFF;
 
   @patch
-  static void _initTicker() {
-    if (_frequency == null) {
-      _frequency = _computeFrequency();
-    }
-  }
+  static int _initTicker() => _computeFrequency();
 
   // Returns the current clock tick.
   @patch
@@ -37,7 +31,7 @@
     }
     // Multiplication would have overflowed.
     int ticksPerSecond = ticks ~/ _frequency;
-    int remainingTicks = ticks.remainder(_frequency);
+    int remainingTicks = unsafeCast<int>(ticks.remainder(_frequency));
     return ticksPerSecond * 1000000 + (remainingTicks * 1000000) ~/ _frequency;
   }
 
@@ -52,7 +46,7 @@
     }
     // Multiplication would have overflowed.
     int ticksPerSecond = ticks ~/ _frequency;
-    int remainingTicks = ticks.remainder(_frequency);
+    int remainingTicks = unsafeCast<int>(ticks.remainder(_frequency));
     return ticksPerSecond * 1000 + (remainingTicks * 1000) ~/ _frequency;
   }
 }
diff --git a/sdk/lib/_internal/vm/lib/string_buffer_patch.dart b/sdk/lib/_internal/vm/lib/string_buffer_patch.dart
index d2ecf80..0a1b06d 100644
--- a/sdk/lib/_internal/vm/lib/string_buffer_patch.dart
+++ b/sdk/lib/_internal/vm/lib/string_buffer_patch.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.6
-
 // part of "core_patch.dart";
 
 @patch
@@ -16,7 +14,7 @@
    * When strings are written to the string buffer, we add them to a
    * list of string parts.
    */
-  List<String> _parts;
+  List<String>? _parts;
 
   /**
     * Total number of code units in the string parts. Does not include
@@ -39,7 +37,7 @@
    * used when writing short strings or individual char codes to the
    * buffer. The buffer is allocated on demand.
    */
-  Uint16List _buffer;
+  Uint16List? _buffer;
   int _bufferPosition = 0;
 
   /**
@@ -62,8 +60,8 @@
   int get length => _partsCodeUnits + _bufferPosition;
 
   @patch
-  void write(Object obj) {
-    String str = '$obj';
+  void write(Object? obj) {
+    String str = obj.toString();
     if (str.isEmpty) return;
     _consumeBuffer();
     _addPart(str);
@@ -76,7 +74,8 @@
         throw new RangeError.range(charCode, 0, 0x10FFFF);
       }
       _ensureCapacity(1);
-      _buffer[_bufferPosition++] = charCode;
+      final localBuffer = _buffer!;
+      localBuffer[_bufferPosition++] = charCode;
       _bufferCodeUnitMagnitude |= charCode;
     } else {
       if (charCode > 0x10FFFF) {
@@ -84,8 +83,9 @@
       }
       _ensureCapacity(2);
       int bits = charCode - 0x10000;
-      _buffer[_bufferPosition++] = 0xD800 | (bits >> 10);
-      _buffer[_bufferPosition++] = 0xDC00 | (bits & 0x3FF);
+      final localBuffer = _buffer!;
+      localBuffer[_bufferPosition++] = 0xD800 | (bits >> 10);
+      localBuffer[_bufferPosition++] = 0xDC00 | (bits & 0x3FF);
       _bufferCodeUnitMagnitude |= 0xFFFF;
     }
   }
@@ -108,7 +108,7 @@
   }
 
   @patch
-  void writeln([Object obj = ""]) {
+  void writeln([Object? obj = ""]) {
     write(obj);
     write("\n");
   }
@@ -124,16 +124,18 @@
   @patch
   String toString() {
     _consumeBuffer();
-    return (_partsCodeUnits == 0)
+    final localParts = _parts;
+    return (_partsCodeUnits == 0 || localParts == null)
         ? ""
-        : _StringBase._concatRange(_parts, 0, _parts.length);
+        : _StringBase._concatRange(localParts, 0, localParts.length);
   }
 
   /** Ensures that the buffer has enough capacity to add n code units. */
   void _ensureCapacity(int n) {
-    if (_buffer == null) {
+    final localBuffer = _buffer;
+    if (localBuffer == null) {
       _buffer = new Uint16List(_BUFFER_SIZE);
-    } else if (_bufferPosition + n > _buffer.length) {
+    } else if (_bufferPosition + n > localBuffer.length) {
       _consumeBuffer();
     }
   }
@@ -146,7 +148,7 @@
   void _consumeBuffer() {
     if (_bufferPosition == 0) return;
     bool isLatin1 = _bufferCodeUnitMagnitude <= 0xFF;
-    String str = _create(_buffer, _bufferPosition, isLatin1);
+    String str = _create(_buffer!, _bufferPosition, isLatin1);
     _bufferPosition = _bufferCodeUnitMagnitude = 0;
     _addPart(str);
   }
@@ -156,16 +158,17 @@
    * many code units are contained in the parts.
    */
   void _addPart(String str) {
+    final localParts = _parts;
     int length = str.length;
     _partsCodeUnits += length;
     _partsCodeUnitsSinceCompaction += length;
 
-    if (_parts == null) {
+    if (localParts == null) {
       // Empirically this is a good capacity to minimize total bytes allocated.
       _parts = new _GrowableList.withCapacity(10)..add(str);
     } else {
-      _parts.add(str);
-      int partsSinceCompaction = _parts.length - _partsCompactionIndex;
+      localParts.add(str);
+      int partsSinceCompaction = localParts.length - _partsCompactionIndex;
       if (partsSinceCompaction == _PARTS_TO_COMPACT) {
         _compact();
       }
@@ -177,17 +180,18 @@
    * lot of memory by turning them all into a single part.
    */
   void _compact() {
+    final localParts = _parts!;
     if (_partsCodeUnitsSinceCompaction < _PARTS_TO_COMPACT_SIZE_LIMIT) {
       String compacted = _StringBase._concatRange(
-          _parts,
+          localParts,
           _partsCompactionIndex, // Start
           _partsCompactionIndex + _PARTS_TO_COMPACT // End
           );
-      _parts.length = _parts.length - _PARTS_TO_COMPACT;
-      _parts.add(compacted);
+      localParts.length = localParts.length - _PARTS_TO_COMPACT;
+      localParts.add(compacted);
     }
     _partsCodeUnitsSinceCompaction = 0;
-    _partsCompactionIndex = _parts.length;
+    _partsCompactionIndex = localParts.length;
   }
 
   /**
diff --git a/sdk/lib/_internal/vm/lib/string_patch.dart b/sdk/lib/_internal/vm/lib/string_patch.dart
index 028bb6b..55fc053 100644
--- a/sdk/lib/_internal/vm/lib/string_patch.dart
+++ b/sdk/lib/_internal/vm/lib/string_patch.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.6
-
 // part of "core_patch.dart";
 
 const int _maxAscii = 0x7f;
@@ -15,7 +13,8 @@
 class String {
   @patch
   factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int end]) {
+      [int start = 0, int? end]) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (charCodes == null) throw new ArgumentError.notNull("charCodes");
     if (start == null) throw new ArgumentError.notNull("start");
     return _StringBase.createFromCharCodes(charCodes, start, end, null);
@@ -119,39 +118,43 @@
    * It's `null` if unknown.
    */
   static String createFromCharCodes(
-      Iterable<int> charCodes, int start, int end, int limit) {
-    if (start == null) throw new ArgumentError.notNull("start");
-    if (charCodes == null) throw new ArgumentError(charCodes);
+      Iterable<int> charCodes, int start, int? end, int? limit) {
     // TODO(srdjan): Also skip copying of wide typed arrays.
     final ccid = ClassID.getID(charCodes);
     if ((ccid != ClassID.cidArray) &&
         (ccid != ClassID.cidGrowableObjectArray) &&
         (ccid != ClassID.cidImmutableArray)) {
       if (charCodes is Uint8List) {
-        end = RangeError.checkValidRange(start, end, charCodes.length);
-        return _createOneByteString(charCodes, start, end - start);
+        final actualEnd =
+            RangeError.checkValidRange(start, end, charCodes.length);
+        return _createOneByteString(charCodes, start, actualEnd - start);
       } else if (charCodes is! Uint16List) {
         return _createStringFromIterable(charCodes, start, end);
       }
     }
-    int codeCount = charCodes.length;
-    end = RangeError.checkValidRange(start, end, codeCount);
-    final len = end - start;
+    final int codeCount = charCodes.length;
+    final actualEnd = RangeError.checkValidRange(start, end, codeCount);
+    final len = actualEnd - start;
     if (len == 0) return "";
-    limit ??= _scanCodeUnits(charCodes, start, end);
-    if (limit < 0) {
-      throw new ArgumentError(charCodes);
+
+    final typedCharCodes = unsafeCast<List<int>>(charCodes);
+
+    final int actualLimit =
+        limit ?? _scanCodeUnits(typedCharCodes, start, actualEnd);
+    if (actualLimit < 0) {
+      throw new ArgumentError(typedCharCodes);
     }
-    if (limit <= _maxLatin1) {
-      return _createOneByteString(charCodes, start, len);
+    if (actualLimit <= _maxLatin1) {
+      return _createOneByteString(typedCharCodes, start, len);
     }
-    if (limit <= _maxUtf16) {
-      return _TwoByteString._allocateFromTwoByteList(charCodes, start, end);
+    if (actualLimit <= _maxUtf16) {
+      return _TwoByteString._allocateFromTwoByteList(
+          typedCharCodes, start, actualEnd);
     }
     // TODO(lrn): Consider passing limit to _createFromCodePoints, because
     // the function is currently fully generic and doesn't know that its
     // charCodes are not all Latin-1 or Utf-16.
-    return _createFromCodePoints(charCodes, start, end);
+    return _createFromCodePoints(typedCharCodes, start, actualEnd);
   }
 
   static int _scanCodeUnits(List<int> charCodes, int start, int end) {
@@ -165,13 +168,14 @@
   }
 
   static String _createStringFromIterable(
-      Iterable<int> charCodes, int start, int end) {
+      Iterable<int> charCodes, int start, int? end) {
     // Treat charCodes as Iterable.
     if (charCodes is EfficientLengthIterable) {
       int length = charCodes.length;
-      end = RangeError.checkValidRange(start, end, length);
-      final charCodeList =
-          new List<int>.from(charCodes.take(end).skip(start), growable: false);
+      final endVal = RangeError.checkValidRange(start, end, length);
+      final charCodeList = new List<int>.from(
+          charCodes.take(endVal).skip(start),
+          growable: false);
       return createFromCharCodes(charCodeList, 0, charCodeList.length, null);
     }
     // Don't know length of iterable, so iterate and see if all the values
@@ -185,7 +189,8 @@
     }
     List<int> charCodeList;
     int bits = 0; // Bitwise-or of all char codes in list.
-    if (end == null) {
+    final endVal = end;
+    if (endVal == null) {
       var list = <int>[];
       while (it.moveNext()) {
         int code = it.current;
@@ -194,13 +199,13 @@
       }
       charCodeList = makeListFixedLength<int>(list);
     } else {
-      if (end < start) {
-        throw new RangeError.range(end, start, charCodes.length);
+      if (endVal < start) {
+        throw new RangeError.range(endVal, start, charCodes.length);
       }
-      int len = end - start;
+      int len = endVal - start;
       charCodeList = new List<int>.generate(len, (int i) {
         if (!it.moveNext()) {
-          throw new RangeError.range(end, start, start + i);
+          throw new RangeError.range(endVal, start, start + i);
         }
         int code = it.current;
         bits |= code;
@@ -353,7 +358,7 @@
     return -1;
   }
 
-  int lastIndexOf(Pattern pattern, [int start = null]) {
+  int lastIndexOf(Pattern pattern, [int? start]) {
     if (start == null) {
       start = this.length;
     } else if (start < 0 || start > this.length) {
@@ -378,7 +383,7 @@
     return -1;
   }
 
-  String substring(int startIndex, [int endIndex]) {
+  String substring(int startIndex, [int? endIndex]) {
     endIndex ??= this.length;
 
     if ((startIndex < 0) || (startIndex > this.length)) {
@@ -572,6 +577,7 @@
 
   String replaceFirst(Pattern pattern, String replacement,
       [int startIndex = 0]) {
+    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
     if (pattern == null) {
       throw new ArgumentError.notNull("pattern");
     }
@@ -590,25 +596,25 @@
     return replaceRange(match.start, match.end, replacement);
   }
 
-  String replaceRange(int start, int end, String replacement) {
-    int length = this.length;
-    end = RangeError.checkValidRange(start, end, length);
+  String replaceRange(int start, int? end, String replacement) {
+    final length = this.length;
+    final localEnd = RangeError.checkValidRange(start, end, length);
     bool replacementIsOneByte = replacement._isOneByte;
-    if (start == 0 && end == length) return replacement;
+    if (start == 0 && localEnd == length) return replacement;
     int replacementLength = replacement.length;
-    int totalLength = start + (length - end) + replacementLength;
+    int totalLength = start + (length - localEnd) + replacementLength;
     if (replacementIsOneByte && this._isOneByte) {
       var result = _OneByteString._allocate(totalLength);
       int index = 0;
       index = result._setRange(index, this, 0, start);
       index = result._setRange(start, replacement, 0, replacementLength);
-      result._setRange(index, this, end, length);
+      result._setRange(index, this, localEnd, length);
       return result;
     }
     List slices = [];
     _addReplaceSlice(slices, 0, start);
     if (replacement.length > 0) slices.add(replacement);
-    _addReplaceSlice(slices, end, length);
+    _addReplaceSlice(slices, localEnd, length);
     return _joinReplaceAllResult(
         this, slices, totalLength, replacementIsOneByte);
   }
@@ -760,7 +766,7 @@
     return replaceRange(match.start, match.end, replacement);
   }
 
-  static String _matchString(Match match) => match[0];
+  static String _matchString(Match match) => match[0]!;
   static String _stringIdentity(String string) => string;
 
   String _splitMapJoinEmptyString(
@@ -793,7 +799,7 @@
   }
 
   String splitMapJoin(Pattern pattern,
-      {String onMatch(Match match), String onNonMatch(String nonMatch)}) {
+      {String onMatch(Match match)?, String onNonMatch(String nonMatch)?}) {
     if (pattern == null) {
       throw new ArgumentError.notNull("pattern");
     }
@@ -870,7 +876,7 @@
     return new _StringAllMatchesIterable(string, this, start);
   }
 
-  Match matchAsPrefix(String string, [int start = 0]) {
+  Match? matchAsPrefix(String string, [int start = 0]) {
     if (start < 0 || start > string.length) {
       throw new RangeError.range(start, 0, string.length);
     }
@@ -895,7 +901,7 @@
       // A matched empty string input returns the empty list.
       return <String>[];
     }
-    List<String> result = new List<String>();
+    List<String> result = <String>[];
     int startIndex = 0;
     int previousIndex = 0;
     // 'pattern' may not be implemented correctly and therefore we cannot
@@ -976,7 +982,7 @@
     // check without performance penalty. Front-end would then promote
     // pattern variable to _OneByteString.
     if (ClassID.getID(pattern) == ClassID.cidOneByteString) {
-      final String patternAsString = pattern;
+      final String patternAsString = unsafeCast<String>(pattern);
       if (patternAsString.length == 1) {
         return _splitWithCharCode(patternAsString.codeUnitAt(0));
       }
@@ -1009,7 +1015,7 @@
     if ((pCid == ClassID.cidOneByteString) ||
         (pCid == ClassID.cidTwoByteString) ||
         (pCid == ClassID.cidExternalOneByteString)) {
-      final String patternAsString = pattern;
+      final String patternAsString = unsafeCast<String>(pattern);
       final len = this.length;
       if ((patternAsString.length == 1) && (start >= 0) && (start < len)) {
         final patternCu0 = patternAsString.codeUnitAt(0);
@@ -1032,7 +1038,7 @@
     if ((pCid == ClassID.cidOneByteString) ||
         (pCid == ClassID.cidTwoByteString) ||
         (pCid == ClassID.cidExternalOneByteString)) {
-      final String patternAsString = pattern;
+      final String patternAsString = unsafeCast<String>(pattern);
       final len = this.length;
       if ((patternAsString.length == 1) && (start >= 0) && (start < len)) {
         final patternCu0 = patternAsString.codeUnitAt(0);
@@ -1345,7 +1351,7 @@
   }
 
   List<String> groups(List<int> groups) {
-    List<String> result = new List<String>();
+    List<String> result = <String>[];
     for (int g in groups) {
       result.add(group(g));
     }
@@ -1380,7 +1386,7 @@
   final String _input;
   final String _pattern;
   int _index;
-  Match _current;
+  Match? _current;
 
   _StringAllMatchesIterator(this._input, this._pattern, this._index);
 
@@ -1403,5 +1409,8 @@
     return true;
   }
 
-  Match get current => _current;
+  Match get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as Match;
+  }
 }
diff --git a/sdk/lib/_internal/vm/lib/symbol_patch.dart b/sdk/lib/_internal/vm/lib/symbol_patch.dart
index 338b339..06eb588 100644
--- a/sdk/lib/_internal/vm/lib/symbol_patch.dart
+++ b/sdk/lib/_internal/vm/lib/symbol_patch.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.6
-
 // part of "internal_patch.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/timeline.dart b/sdk/lib/_internal/vm/lib/timeline.dart
index 1fb51b8..5e8066b 100644
--- a/sdk/lib/_internal/vm/lib/timeline.dart
+++ b/sdk/lib/_internal/vm/lib/timeline.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.6
-
 // part of "developer.dart";
 
 @patch
diff --git a/sdk/lib/_internal/vm/lib/timer_impl.dart b/sdk/lib/_internal/vm/lib/timer_impl.dart
index bc515f3..db626c2 100644
--- a/sdk/lib/_internal/vm/lib/timer_impl.dart
+++ b/sdk/lib/_internal/vm/lib/timer_impl.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.6
-
 // part of "isolate_patch.dart";
 
 // Timer heap implemented as a array-based binary heap[0].
@@ -45,7 +43,7 @@
   void remove(_Timer timer) {
     _used--;
     if (isEmpty) {
-      _list[0] = null;
+      _list[0] = _Timer._sentinelTimer;
       timer._indexOrNext = null;
       return;
     }
@@ -59,7 +57,7 @@
         _bubbleDown(last);
       }
     }
-    _list[_used] = null;
+    _list[_used] = _Timer._sentinelTimer;
     timer._indexOrNext = null;
   }
 
@@ -119,8 +117,9 @@
   // Cancels the timer in the event handler.
   static const _NO_TIMER = -1;
 
-  // A sentinel timer.
-  static _Timer _sentinelTimer = _Timer._sentinel();
+  // A generic null timer object that is used to populate unused slots
+  // in TimerHeap.
+  static final _sentinelTimer = _Timer._sentinel();
 
   // We distinguish what kind of message arrived based on the value being sent.
   static const _ZERO_EVENT = 1;
@@ -129,7 +128,7 @@
   // Timers are ordered by wakeup time. Timers with a timeout value of > 0 do
   // end up on the TimerHeap. Timers with a timeout of 0 are queued in a list.
   static final _heap = new _TimerHeap();
-  static _Timer _firstZeroTimer;
+  static _Timer? _firstZeroTimer;
   static _Timer _lastZeroTimer = _sentinelTimer;
 
   // We use an id to be able to sort timers with the same expiration time.
@@ -137,13 +136,13 @@
   static const _ID_MASK = 0x1fffffff;
   static int _idCount = 0;
 
-  static RawReceivePort _receivePort;
-  static SendPort _sendPort;
+  static RawReceivePort? _receivePort;
+  static SendPort? _sendPort;
   static int _scheduledWakeupTime = 0;
 
   static bool _handlingCallbacks = false;
 
-  Function _callback; // Closure to call when timer fires. null if canceled.
+  Function? _callback; // Closure to call when timer fires. null if canceled.
   int _wakeupTime; // Expiration time.
   final int _milliSeconds; // Duration specified at creation.
   final bool _repeating; // Indicates periodic timers.
@@ -274,13 +273,13 @@
   // Handle the notification of a zero timer. Make sure to also execute non-zero
   // timers with a lower expiration time.
   static List _queueFromZeroEvent() {
-    var pendingTimers = new List();
-    _Timer ftimer = _firstZeroTimer;
-    if (ftimer != null) {
+    var pendingTimers = <dynamic>[];
+    final firstTimer = _firstZeroTimer;
+    if (firstTimer != null) {
       // Collect pending timers from the timer heap that have an expiration prior
       // to the currently notified zero timer.
       var timer;
-      while (!_heap.isEmpty && (_heap.first._compareTo(ftimer) < 0)) {
+      while (!_heap.isEmpty && (_heap.first._compareTo(firstTimer) < 0)) {
         timer = _heap.removeFirst();
         pendingTimers.add(timer);
       }
@@ -325,9 +324,9 @@
   }
 
   static List _queueFromTimeoutEvent() {
-    var pendingTimers = new List();
-    _Timer ftimer = _firstZeroTimer;
-    if (ftimer != null) {
+    var pendingTimers = [];
+    final firstTimer = _firstZeroTimer;
+    if (firstTimer != null) {
       // Collect pending timers from the timer heap that have an expiration
       // prior to the next zero timer.
       // By definition the first zero timer has been scheduled before the
@@ -335,7 +334,7 @@
       // timer are expired. The first zero timer will be dispatched when its
       // corresponding message is delivered.
       var timer;
-      while (!_heap.isEmpty && (_heap.first._compareTo(ftimer) < 0)) {
+      while (!_heap.isEmpty && (_heap.first._compareTo(firstTimer) < 0)) {
         timer = _heap.removeFirst();
         pendingTimers.add(timer);
       }
@@ -456,21 +455,19 @@
   static SendPort _createTimerHandler() {
     assert(_receivePort == null);
     assert(_sendPort == null);
-    RawReceivePort port = new RawReceivePort(_handleMessage);
+    final port = new RawReceivePort(_handleMessage);
+    final sendPort = port.sendPort;
     _receivePort = port;
-    _sendPort = port.sendPort;
+    _sendPort = sendPort;
     _scheduledWakeupTime = 0;
-    return port.sendPort;
+    return sendPort;
   }
 
   static void _shutdownTimerHandler() {
-    var port = _receivePort;
-    if (port != null) {
-      port.close();
-      _receivePort = null;
-    }
     _sendPort = null;
     _scheduledWakeupTime = 0;
+    _receivePort!.close();
+    _receivePort = null;
   }
 
   // The Timer factory registered with the dart:async library by the embedder.
diff --git a/sdk/lib/_internal/vm/lib/timer_patch.dart b/sdk/lib/_internal/vm/lib/timer_patch.dart
index db181ab..5e8b987 100644
--- a/sdk/lib/_internal/vm/lib/timer_patch.dart
+++ b/sdk/lib/_internal/vm/lib/timer_patch.dart
@@ -2,24 +2,19 @@
 // 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.6
-
 // part of "async_patch.dart";
 
 @patch
 class Timer {
   @patch
   static Timer _createTimer(Duration duration, void callback()) {
-    // TODO(iposva): Remove _TimerFactory and use VMLibraryHooks exclusively.
-    if (_TimerFactory._factory == null) {
-      _TimerFactory._factory = VMLibraryHooks.timerFactory;
-    }
-    if (_TimerFactory._factory == null) {
+    final factory = VMLibraryHooks.timerFactory;
+    if (factory == null) {
       throw new UnsupportedError("Timer interface not supported.");
     }
     int milliseconds = duration.inMilliseconds;
     if (milliseconds < 0) milliseconds = 0;
-    return _TimerFactory._factory(milliseconds, (_) {
+    return factory(milliseconds, (_) {
       callback();
     }, false);
   }
@@ -27,20 +22,12 @@
   @patch
   static Timer _createPeriodicTimer(
       Duration duration, void callback(Timer timer)) {
-    // TODO(iposva): Remove _TimerFactory and use VMLibraryHooks exclusively.
-    _TimerFactory._factory ??= VMLibraryHooks.timerFactory;
-    if (_TimerFactory._factory == null) {
+    final factory = VMLibraryHooks.timerFactory;
+    if (factory == null) {
       throw new UnsupportedError("Timer interface not supported.");
     }
     int milliseconds = duration.inMilliseconds;
     if (milliseconds < 0) milliseconds = 0;
-    return _TimerFactory._factory(milliseconds, callback, true);
+    return factory(milliseconds, callback, true);
   }
 }
-
-typedef Timer _TimerFactoryClosure(
-    int milliseconds, void callback(Timer timer), bool repeating);
-
-class _TimerFactory {
-  static _TimerFactoryClosure _factory;
-}
diff --git a/sdk/lib/_internal/vm/lib/type_patch.dart b/sdk/lib/_internal/vm/lib/type_patch.dart
index 5a7623a..1b8f3c1 100644
--- a/sdk/lib/_internal/vm/lib/type_patch.dart
+++ b/sdk/lib/_internal/vm/lib/type_patch.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.6
-
 // part of "core_patch.dart";
 
 // These Dart classes correspond to the VM internal implementation classes.
diff --git a/sdk/lib/_internal/vm/lib/typed_data_patch.dart b/sdk/lib/_internal/vm/lib/typed_data_patch.dart
index 21ca2de..6d0cc5a 100644
--- a/sdk/lib/_internal/vm/lib/typed_data_patch.dart
+++ b/sdk/lib/_internal/vm/lib/typed_data_patch.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.6
-
 /// Note: the VM concatenates all patch files into a single patch file. This
 /// file is the first patch in "dart:typed_data" which contains all the imports
 /// used by patches of that library. We plan to change this when we have a
@@ -87,7 +85,7 @@
     throw new UnsupportedError("Cannot remove from a fixed-length list");
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     throw new UnsupportedError("Cannot remove from a fixed-length list");
   }
 
@@ -142,9 +140,10 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(int element), [int start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-    for (int i = start; i >= 0; i--) {
+  int lastIndexWhere(bool test(int element), [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (test(this[i])) return i;
     }
     return -1;
@@ -158,7 +157,7 @@
       ..setRange(this.length, totalLength, other);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       if (this[i] == element) return true;
@@ -166,7 +165,7 @@
     return false;
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     random ??= new Random();
     var i = this.length;
     while (i > 1) {
@@ -194,9 +193,9 @@
 
   Map<int, int> asMap() => new ListMapView<int>(this);
 
-  Iterable<int> getRange(int start, [int end]) {
-    RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<int>(this, start, end);
+  Iterable<int> getRange(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    return new SubListIterable<int>(this, start, endIndex);
   }
 
   Iterator<int> get iterator => new _TypedListIterator<int>(this);
@@ -255,7 +254,7 @@
     return false;
   }
 
-  int firstWhere(bool test(int element), {int orElse()}) {
+  int firstWhere(bool test(int element), {int orElse()?}) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       var element = this[i];
@@ -265,7 +264,7 @@
     throw IterableElementError.noElement();
   }
 
-  int lastWhere(bool test(int element), {int orElse()}) {
+  int lastWhere(bool test(int element), {int orElse()?}) {
     var len = this.length;
     for (var i = len - 1; i >= 0; --i) {
       var element = this[i];
@@ -277,7 +276,7 @@
     throw IterableElementError.noElement();
   }
 
-  int singleWhere(bool test(int element), {int orElse()}) {
+  int singleWhere(bool test(int element), {int orElse()?}) {
     var result = null;
     bool foundMatching = false;
     var len = this.length;
@@ -316,7 +315,7 @@
     throw new UnsupportedError("Cannot insert into a fixed-length list");
   }
 
-  void sort([int compare(int a, int b)]) {
+  void sort([int compare(int a, int b)?]) {
     Sort.sort(this, compare ?? Comparable.compare);
   }
 
@@ -332,13 +331,10 @@
     return -1;
   }
 
-  int lastIndexOf(int element, [int start = null]) {
-    if (start == null || start >= this.length) {
-      start = this.length - 1;
-    } else if (start < 0) {
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
+  int lastIndexOf(int element, [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (this[i] == element) return i;
     }
     return -1;
@@ -381,8 +377,12 @@
     setRange(index, end, iterable);
   }
 
-  void fillRange(int start, int end, [int fillValue]) {
+  void fillRange(int start, int end, [int? fillValue]) {
     RangeError.checkValidRange(start, end, this.length);
+    if (start == end) return;
+    if (fillValue == null) {
+      throw ArgumentError.notNull("fillValue");
+    }
     for (var i = start; i < end; ++i) {
       this[i] = fillValue;
     }
@@ -458,9 +458,9 @@
     Lists.copy(otherList, otherStart, this, start, count);
   }
 
-  SpawnedType sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    var length = end - start;
+  SpawnedType sublist(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    var length = endIndex - start;
     SpawnedType result = _createList(length);
     result.setRange(0, length, this, start);
     return result;
@@ -496,9 +496,10 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(double element), [int start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-    for (int i = start; i >= 0; i--) {
+  int lastIndexWhere(bool test(double element), [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (test(this[i])) return i;
     }
     return -1;
@@ -512,7 +513,7 @@
       ..setRange(this.length, totalLength, other);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       if (this[i] == element) return true;
@@ -520,7 +521,7 @@
     return false;
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     random ??= new Random();
     var i = this.length;
     while (i > 1) {
@@ -549,9 +550,9 @@
 
   Map<int, double> asMap() => new ListMapView<double>(this);
 
-  Iterable<double> getRange(int start, [int end]) {
-    RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<double>(this, start, end);
+  Iterable<double> getRange(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    return new SubListIterable<double>(this, start, endIndex);
   }
 
   Iterator<double> get iterator => new _TypedListIterator<double>(this);
@@ -611,7 +612,7 @@
     return false;
   }
 
-  double firstWhere(bool test(double element), {double orElse()}) {
+  double firstWhere(bool test(double element), {double orElse()?}) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       var element = this[i];
@@ -621,7 +622,7 @@
     throw IterableElementError.noElement();
   }
 
-  double lastWhere(bool test(double element), {double orElse()}) {
+  double lastWhere(bool test(double element), {double orElse()?}) {
     var len = this.length;
     for (var i = len - 1; i >= 0; --i) {
       var element = this[i];
@@ -633,7 +634,7 @@
     throw IterableElementError.noElement();
   }
 
-  double singleWhere(bool test(double element), {double orElse()}) {
+  double singleWhere(bool test(double element), {double orElse()?}) {
     var result = null;
     bool foundMatching = false;
     var len = this.length;
@@ -672,7 +673,7 @@
     throw new UnsupportedError("Cannot insert into a fixed-length list");
   }
 
-  void sort([int compare(double a, double b)]) {
+  void sort([int compare(double a, double b)?]) {
     Sort.sort(this, compare ?? Comparable.compare);
   }
 
@@ -688,13 +689,10 @@
     return -1;
   }
 
-  int lastIndexOf(double element, [int start = null]) {
-    if (start == null || start >= this.length) {
-      start = this.length - 1;
-    } else if (start < 0) {
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
+  int lastIndexOf(double element, [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (this[i] == element) return i;
     }
     return -1;
@@ -737,8 +735,13 @@
     setRange(index, end, iterable);
   }
 
-  void fillRange(int start, int end, [double fillValue]) {
+  void fillRange(int start, int end, [double? fillValue]) {
+    // TODO(eernst): Could use zero as default and not throw; issue .
     RangeError.checkValidRange(start, end, this.length);
+    if (start == end) return;
+    if (fillValue == null) {
+      throw ArgumentError.notNull("fillValue");
+    }
     for (var i = start; i < end; ++i) {
       this[i] = fillValue;
     }
@@ -815,9 +818,9 @@
     Lists.copy(otherList, otherStart, this, start, count);
   }
 
-  SpawnedType sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    var length = end - start;
+  SpawnedType sublist(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    var length = endIndex - start;
     SpawnedType result = _createList(length);
     result.setRange(0, length, this, start);
     return result;
@@ -855,9 +858,10 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(Float32x4 element), [int start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-    for (int i = start; i >= 0; i--) {
+  int lastIndexWhere(bool test(Float32x4 element), [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (test(this[i])) return i;
     }
     return -1;
@@ -871,7 +875,7 @@
       ..setRange(this.length, totalLength, other);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       if (this[i] == element) return true;
@@ -879,7 +883,7 @@
     return false;
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     random ??= new Random();
     var i = this.length;
     while (i > 1) {
@@ -975,9 +979,9 @@
 
   Map<int, Float32x4> asMap() => new ListMapView<Float32x4>(this);
 
-  Iterable<Float32x4> getRange(int start, [int end]) {
-    RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<Float32x4>(this, start, end);
+  Iterable<Float32x4> getRange(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    return new SubListIterable<Float32x4>(this, start, endIndex);
   }
 
   Iterator<Float32x4> get iterator => new _TypedListIterator<Float32x4>(this);
@@ -1037,7 +1041,7 @@
     return false;
   }
 
-  Float32x4 firstWhere(bool test(Float32x4 element), {Float32x4 orElse()}) {
+  Float32x4 firstWhere(bool test(Float32x4 element), {Float32x4 orElse()?}) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       var element = this[i];
@@ -1047,7 +1051,7 @@
     throw IterableElementError.noElement();
   }
 
-  Float32x4 lastWhere(bool test(Float32x4 element), {Float32x4 orElse()}) {
+  Float32x4 lastWhere(bool test(Float32x4 element), {Float32x4 orElse()?}) {
     var len = this.length;
     for (var i = len - 1; i >= 0; --i) {
       var element = this[i];
@@ -1059,7 +1063,7 @@
     throw IterableElementError.noElement();
   }
 
-  Float32x4 singleWhere(bool test(Float32x4 element), {Float32x4 orElse()}) {
+  Float32x4 singleWhere(bool test(Float32x4 element), {Float32x4 orElse()?}) {
     var result = null;
     bool foundMatching = false;
     var len = this.length;
@@ -1098,7 +1102,7 @@
     throw new UnsupportedError("Cannot insert into a fixed-length list");
   }
 
-  void sort([int compare(Float32x4 a, Float32x4 b)]) {
+  void sort([int compare(Float32x4 a, Float32x4 b)?]) {
     if (compare == null) {
       throw "SIMD don't have default compare.";
     }
@@ -1117,13 +1121,10 @@
     return -1;
   }
 
-  int lastIndexOf(Float32x4 element, [int start = null]) {
-    if (start == null || start >= this.length) {
-      start = this.length - 1;
-    } else if (start < 0) {
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
+  int lastIndexOf(Float32x4 element, [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (this[i] == element) return i;
     }
     return -1;
@@ -1161,9 +1162,9 @@
     throw IterableElementError.tooMany();
   }
 
-  Float32x4List sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    var length = end - start;
+  Float32x4List sublist(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    var length = endIndex - start;
     Float32x4List result = _createList(length);
     result.setRange(0, length, this, start);
     return result;
@@ -1174,8 +1175,12 @@
     setRange(index, end, iterable);
   }
 
-  void fillRange(int start, int end, [Float32x4 fillValue]) {
+  void fillRange(int start, int end, [Float32x4? fillValue]) {
     RangeError.checkValidRange(start, end, this.length);
+    if (start == end) return;
+    if (fillValue == null) {
+      throw ArgumentError.notNull("fillValue");
+    }
     for (var i = start; i < end; ++i) {
       this[i] = fillValue;
     }
@@ -1213,9 +1218,10 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(Int32x4 element), [int start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-    for (int i = start; i >= 0; i--) {
+  int lastIndexWhere(bool test(Int32x4 element), [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (test(this[i])) return i;
     }
     return -1;
@@ -1229,7 +1235,7 @@
       ..setRange(this.length, totalLength, other);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       if (this[i] == element) return true;
@@ -1237,7 +1243,7 @@
     return false;
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     random ??= new Random();
     var i = this.length;
     while (i > 1) {
@@ -1332,9 +1338,9 @@
 
   Map<int, Int32x4> asMap() => new ListMapView<Int32x4>(this);
 
-  Iterable<Int32x4> getRange(int start, [int end]) {
-    RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<Int32x4>(this, start, end);
+  Iterable<Int32x4> getRange(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    return new SubListIterable<Int32x4>(this, start, endIndex);
   }
 
   Iterator<Int32x4> get iterator => new _TypedListIterator<Int32x4>(this);
@@ -1394,7 +1400,7 @@
     return false;
   }
 
-  Int32x4 firstWhere(bool test(Int32x4 element), {Int32x4 orElse()}) {
+  Int32x4 firstWhere(bool test(Int32x4 element), {Int32x4 orElse()?}) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       var element = this[i];
@@ -1404,7 +1410,7 @@
     throw IterableElementError.noElement();
   }
 
-  Int32x4 lastWhere(bool test(Int32x4 element), {Int32x4 orElse()}) {
+  Int32x4 lastWhere(bool test(Int32x4 element), {Int32x4 orElse()?}) {
     var len = this.length;
     for (var i = len - 1; i >= 0; --i) {
       var element = this[i];
@@ -1416,7 +1422,7 @@
     throw IterableElementError.noElement();
   }
 
-  Int32x4 singleWhere(bool test(Int32x4 element), {Int32x4 orElse()}) {
+  Int32x4 singleWhere(bool test(Int32x4 element), {Int32x4 orElse()?}) {
     var result = null;
     bool foundMatching = false;
     var len = this.length;
@@ -1455,7 +1461,7 @@
     throw new UnsupportedError("Cannot insert into a fixed-length list");
   }
 
-  void sort([int compare(Int32x4 a, Int32x4 b)]) {
+  void sort([int compare(Int32x4 a, Int32x4 b)?]) {
     if (compare == null) {
       throw "SIMD don't have default compare.";
     }
@@ -1474,13 +1480,10 @@
     return -1;
   }
 
-  int lastIndexOf(Int32x4 element, [int start = null]) {
-    if (start == null || start >= this.length) {
-      start = this.length - 1;
-    } else if (start < 0) {
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
+  int lastIndexOf(Int32x4 element, [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (this[i] == element) return i;
     }
     return -1;
@@ -1518,9 +1521,9 @@
     throw IterableElementError.tooMany();
   }
 
-  Int32x4List sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    var length = end - start;
+  Int32x4List sublist(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    var length = endIndex - start;
     Int32x4List result = _createList(length);
     result.setRange(0, length, this, start);
     return result;
@@ -1531,8 +1534,12 @@
     setRange(index, end, iterable);
   }
 
-  void fillRange(int start, int end, [Int32x4 fillValue]) {
+  void fillRange(int start, int end, [Int32x4? fillValue]) {
     RangeError.checkValidRange(start, end, this.length);
+    if (start == end) return;
+    if (fillValue == null) {
+      throw ArgumentError.notNull("fillValue");
+    }
     for (var i = start; i < end; ++i) {
       this[i] = fillValue;
     }
@@ -1570,9 +1577,10 @@
     return -1;
   }
 
-  int lastIndexWhere(bool test(Float64x2 element), [int start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-    for (int i = start; i >= 0; i--) {
+  int lastIndexWhere(bool test(Float64x2 element), [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (test(this[i])) return i;
     }
     return -1;
@@ -1586,7 +1594,7 @@
       ..setRange(this.length, totalLength, other);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       if (this[i] == element) return true;
@@ -1594,7 +1602,7 @@
     return false;
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     random ??= new Random();
     var i = this.length;
     while (i > 1) {
@@ -1690,9 +1698,9 @@
 
   Map<int, Float64x2> asMap() => new ListMapView<Float64x2>(this);
 
-  Iterable<Float64x2> getRange(int start, [int end]) {
-    RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<Float64x2>(this, start, end);
+  Iterable<Float64x2> getRange(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    return new SubListIterable<Float64x2>(this, start, endIndex);
   }
 
   Iterator<Float64x2> get iterator => new _TypedListIterator<Float64x2>(this);
@@ -1752,7 +1760,7 @@
     return false;
   }
 
-  Float64x2 firstWhere(bool test(Float64x2 element), {Float64x2 orElse()}) {
+  Float64x2 firstWhere(bool test(Float64x2 element), {Float64x2 orElse()?}) {
     var len = this.length;
     for (var i = 0; i < len; ++i) {
       var element = this[i];
@@ -1762,7 +1770,7 @@
     throw IterableElementError.noElement();
   }
 
-  Float64x2 lastWhere(bool test(Float64x2 element), {Float64x2 orElse()}) {
+  Float64x2 lastWhere(bool test(Float64x2 element), {Float64x2 orElse()?}) {
     var len = this.length;
     for (var i = len - 1; i >= 0; --i) {
       var element = this[i];
@@ -1774,7 +1782,7 @@
     throw IterableElementError.noElement();
   }
 
-  Float64x2 singleWhere(bool test(Float64x2 element), {Float64x2 orElse()}) {
+  Float64x2 singleWhere(bool test(Float64x2 element), {Float64x2 orElse()?}) {
     var result = null;
     bool foundMatching = false;
     var len = this.length;
@@ -1813,7 +1821,7 @@
     throw new UnsupportedError("Cannot insert into a fixed-length list");
   }
 
-  void sort([int compare(Float64x2 a, Float64x2 b)]) {
+  void sort([int compare(Float64x2 a, Float64x2 b)?]) {
     if (compare == null) {
       throw "SIMD don't have default compare.";
     }
@@ -1832,13 +1840,10 @@
     return -1;
   }
 
-  int lastIndexOf(Float64x2 element, [int start = null]) {
-    if (start == null || start >= this.length) {
-      start = this.length - 1;
-    } else if (start < 0) {
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
+  int lastIndexOf(Float64x2 element, [int? start]) {
+    int startIndex =
+        (start == null || start >= this.length) ? this.length - 1 : start;
+    for (int i = startIndex; i >= 0; i--) {
       if (this[i] == element) return i;
     }
     return -1;
@@ -1876,9 +1881,9 @@
     throw IterableElementError.tooMany();
   }
 
-  Float64x2List sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, this.length);
-    var length = end - start;
+  Float64x2List sublist(int start, [int? end]) {
+    int endIndex = RangeError.checkValidRange(start, end, this.length);
+    var length = endIndex - start;
     Float64x2List result = _createList(length);
     result.setRange(0, length, this, start);
     return result;
@@ -1889,8 +1894,12 @@
     setRange(index, end, iterable);
   }
 
-  void fillRange(int start, int end, [Float64x2 fillValue]) {
+  void fillRange(int start, int end, [Float64x2? fillValue]) {
     RangeError.checkValidRange(start, end, this.length);
+    if (start == end) return;
+    if (fillValue == null) {
+      throw ArgumentError.notNull("fillValue");
+    }
     for (var i = start; i < end; ++i) {
       this[i] = fillValue;
     }
@@ -1912,20 +1921,20 @@
   bool operator ==(Object other) =>
       (other is _ByteBuffer) && identical(_data, other._data);
 
-  ByteData asByteData([int offsetInBytes = 0, int length]) {
+  ByteData asByteData([int offsetInBytes = 0, int? length]) {
     length ??= this.lengthInBytes - offsetInBytes;
     _rangeCheck(this._data.lengthInBytes, offsetInBytes, length);
     return new _ByteDataView._(this._data, offsetInBytes, length);
   }
 
-  Int8List asInt8List([int offsetInBytes = 0, int length]) {
+  Int8List asInt8List([int offsetInBytes = 0, int? length]) {
     length ??= (this.lengthInBytes - offsetInBytes) ~/ Int8List.bytesPerElement;
     _rangeCheck(
         this.lengthInBytes, offsetInBytes, length * Int8List.bytesPerElement);
     return new _Int8ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Uint8List asUint8List([int offsetInBytes = 0, int length]) {
+  Uint8List asUint8List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Uint8List.bytesPerElement;
     _rangeCheck(
@@ -1933,7 +1942,7 @@
     return new _Uint8ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int length]) {
+  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) {
     length ??= (this.lengthInBytes - offsetInBytes) ~/
         Uint8ClampedList.bytesPerElement;
     _rangeCheck(this.lengthInBytes, offsetInBytes,
@@ -1941,7 +1950,7 @@
     return new _Uint8ClampedArrayView._(this._data, offsetInBytes, length);
   }
 
-  Int16List asInt16List([int offsetInBytes = 0, int length]) {
+  Int16List asInt16List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Int16List.bytesPerElement;
     _rangeCheck(
@@ -1950,7 +1959,7 @@
     return new _Int16ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Uint16List asUint16List([int offsetInBytes = 0, int length]) {
+  Uint16List asUint16List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Uint16List.bytesPerElement;
     _rangeCheck(
@@ -1959,7 +1968,7 @@
     return new _Uint16ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Int32List asInt32List([int offsetInBytes = 0, int length]) {
+  Int32List asInt32List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Int32List.bytesPerElement;
     _rangeCheck(
@@ -1968,7 +1977,7 @@
     return new _Int32ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Uint32List asUint32List([int offsetInBytes = 0, int length]) {
+  Uint32List asUint32List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Uint32List.bytesPerElement;
     _rangeCheck(
@@ -1977,7 +1986,7 @@
     return new _Uint32ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Int64List asInt64List([int offsetInBytes = 0, int length]) {
+  Int64List asInt64List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Int64List.bytesPerElement;
     _rangeCheck(
@@ -1986,7 +1995,7 @@
     return new _Int64ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Uint64List asUint64List([int offsetInBytes = 0, int length]) {
+  Uint64List asUint64List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Uint64List.bytesPerElement;
     _rangeCheck(
@@ -1995,7 +2004,7 @@
     return new _Uint64ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Float32List asFloat32List([int offsetInBytes = 0, int length]) {
+  Float32List asFloat32List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Float32List.bytesPerElement;
     _rangeCheck(this.lengthInBytes, offsetInBytes,
@@ -2004,7 +2013,7 @@
     return new _Float32ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Float64List asFloat64List([int offsetInBytes = 0, int length]) {
+  Float64List asFloat64List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Float64List.bytesPerElement;
     _rangeCheck(this.lengthInBytes, offsetInBytes,
@@ -2013,7 +2022,7 @@
     return new _Float64ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int length]) {
+  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Float32x4List.bytesPerElement;
     _rangeCheck(this.lengthInBytes, offsetInBytes,
@@ -2022,7 +2031,7 @@
     return new _Float32x4ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int length]) {
+  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Int32x4List.bytesPerElement;
     _rangeCheck(this.lengthInBytes, offsetInBytes,
@@ -2031,7 +2040,7 @@
     return new _Int32x4ArrayView._(this._data, offsetInBytes, length);
   }
 
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int length]) {
+  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) {
     length ??=
         (this.lengthInBytes - offsetInBytes) ~/ Float64x2List.bytesPerElement;
     _rangeCheck(this.lengthInBytes, offsetInBytes,
@@ -2314,7 +2323,8 @@
     _setIndexedInt16(index, _toInt16(value));
   }
 
-  void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) {
+  void setRange(int start, int end, Iterable<int> iterable,
+      [int skipCount = 0]) {
     if (iterable is CodeUnits) {
       end = RangeError.checkValidRange(start, end, this.length);
       int length = end - start;
@@ -2381,7 +2391,8 @@
     _setIndexedUint16(index, _toUint16(value));
   }
 
-  void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) {
+  void setRange(int start, int end, Iterable<int> iterable,
+      [int skipCount = 0]) {
     if (iterable is CodeUnits) {
       end = RangeError.checkValidRange(start, end, this.length);
       int length = end - start;
@@ -3829,9 +3840,9 @@
   final List<E> _array;
   final int _length;
   int _position;
-  E _current;
+  E? _current;
 
-  _TypedListIterator(List array)
+  _TypedListIterator(List<E> array)
       : _array = array,
         _length = array.length,
         _position = -1 {
@@ -3850,7 +3861,10 @@
     return false;
   }
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 }
 
 abstract class _TypedListView extends _TypedListBase implements TypedData {
@@ -4022,7 +4036,8 @@
         offsetInBytes + (index * Int16List.bytesPerElement), _toInt16(value));
   }
 
-  void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) {
+  void setRange(int start, int end, Iterable<int> iterable,
+      [int skipCount = 0]) {
     if (iterable is CodeUnits) {
       end = RangeError.checkValidRange(start, end, this.length);
       int length = end - start;
@@ -4073,7 +4088,8 @@
         offsetInBytes + (index * Uint16List.bytesPerElement), _toUint16(value));
   }
 
-  void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) {
+  void setRange(int start, int end, Iterable<int> iterable,
+      [int skipCount = 0]) {
     if (iterable is CodeUnits) {
       end = RangeError.checkValidRange(start, end, this.length);
       int length = end - start;
diff --git a/sdk/lib/_internal/vm/lib/uri_patch.dart b/sdk/lib/_internal/vm/lib/uri_patch.dart
index 741f2d0..de10c9e 100644
--- a/sdk/lib/_internal/vm/lib/uri_patch.dart
+++ b/sdk/lib/_internal/vm/lib/uri_patch.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.6
-
 // part of "core_patch.dart";
 
 typedef Uri _UriBaseClosure();
diff --git a/sdk/lib/_internal/vm/lib/wasm_patch.dart b/sdk/lib/_internal/vm/lib/wasm_patch.dart
index c24a396..f3a996d 100644
--- a/sdk/lib/_internal/vm/lib/wasm_patch.dart
+++ b/sdk/lib/_internal/vm/lib/wasm_patch.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.6
-
 import 'dart:_internal' show patch;
 import "dart:nativewrappers" show NativeFieldWrapperClass1;
 import 'dart:typed_data';
@@ -39,7 +37,7 @@
 @patch
 class WasmMemory {
   @patch
-  factory WasmMemory(int initialPages, [int maxPages]) {
+  factory WasmMemory(int initialPages, [int? maxPages]) {
     return _NativeWasmMemory(initialPages, maxPages);
   }
 }
@@ -107,11 +105,12 @@
 }
 
 class _NativeWasmMemory extends NativeFieldWrapperClass1 implements WasmMemory {
-  int _pages;
-  Uint8List _buffer;
+  late int _pages;
+  late Uint8List _buffer;
 
-  _NativeWasmMemory(int initialPages, int maxPages) : _pages = initialPages {
+  _NativeWasmMemory(int initialPages, int? maxPages) {
     _buffer = _init(initialPages, maxPages);
+    _pages = initialPages;
   }
 
   _NativeWasmMemory.fromInstance(_NativeWasmInstance inst) {
@@ -133,7 +132,7 @@
     return oldPages;
   }
 
-  Uint8List _init(int initialPages, int maxPages) native 'Wasm_initMemory';
+  Uint8List _init(int initialPages, int? maxPages) native 'Wasm_initMemory';
   Uint8List _grow(int deltaPages) native 'Wasm_growMemory';
   Uint8List _initFromInstance(_NativeWasmInstance inst)
       native 'Wasm_initMemoryFromInstance';
diff --git a/sdk/lib/_internal/vm/lib/weak_property.dart b/sdk/lib/_internal/vm/lib/weak_property.dart
index ed8e570..bc903e9 100644
--- a/sdk/lib/_internal/vm/lib/weak_property.dart
+++ b/sdk/lib/_internal/vm/lib/weak_property.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.6
-
 // part of "core_patch.dart";
 
 @pragma("vm:entry-point")
diff --git a/sdk/lib/async/async.dart b/sdk/lib/async/async.dart
index c58801f..8cce959 100644
--- a/sdk/lib/async/async.dart
+++ b/sdk/lib/async/async.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.6
-
 /**
  * Support for asynchronous programming,
  * with classes such as Future and Stream.
@@ -95,7 +93,7 @@
  */
 library dart.async;
 
-import "dart:collection" show HashMap, IterableBase;
+import "dart:collection" show HashMap;
 import "dart:_internal"
     show
         CastStream,
@@ -104,7 +102,8 @@
         IterableElementError,
         printToZone,
         printToConsole,
-        Since;
+        Since,
+        typeAcceptsNull;
 
 part 'async_error.dart';
 part 'broadcast_stream_controller.dart';
diff --git a/sdk/lib/async/async_error.dart b/sdk/lib/async/async_error.dart
index f0e8119..a7172bd 100644
--- a/sdk/lib/async/async_error.dart
+++ b/sdk/lib/async/async_error.dart
@@ -2,20 +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.6
-
 part of dart.async;
 
 _invokeErrorHandler(
     Function errorHandler, Object error, StackTrace stackTrace) {
-  if (errorHandler is ZoneBinaryCallback<dynamic, Null, Null>) {
+  var handler = errorHandler; // Rename to avoid promotion.
+  if (handler is ZoneBinaryCallback<dynamic, Never, Never>) {
     // Dynamic invocation because we don't know the actual type of the
     // first argument or the error object, but we should successfully call
     // the handler if they match up.
-    // TODO(lrn): Should we? Why not the same below for the unary case?
-    return (errorHandler as dynamic)(error, stackTrace);
+    return errorHandler(error, stackTrace);
   } else {
-    ZoneUnaryCallback unaryErrorHandler = errorHandler;
-    return unaryErrorHandler(error);
+    return errorHandler(error);
   }
 }
diff --git a/sdk/lib/async/broadcast_stream_controller.dart b/sdk/lib/async/broadcast_stream_controller.dart
index 6a62e0b..c362eea 100644
--- a/sdk/lib/async/broadcast_stream_controller.dart
+++ b/sdk/lib/async/broadcast_stream_controller.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.6
-
 part of dart.async;
 
 class _BroadcastStream<T> extends _ControllerStream<T> {
@@ -22,11 +20,15 @@
   // does not assume that it's use of the state integer is the only use.
   int _eventState = 0; // Initialized to help dart2js type inference.
 
-  _BroadcastSubscription<T> _next;
-  _BroadcastSubscription<T> _previous;
+  _BroadcastSubscription<T>? _next;
+  _BroadcastSubscription<T>? _previous;
 
-  _BroadcastSubscription(_StreamControllerLifecycle<T> controller,
-      void onData(T data), Function onError, void onDone(), bool cancelOnError)
+  _BroadcastSubscription(
+      _StreamControllerLifecycle<T> controller,
+      void onData(T data)?,
+      Function? onError,
+      void onDone()?,
+      bool cancelOnError)
       : super(controller, onData, onError, onDone, cancelOnError) {
     _next = _previous = this;
   }
@@ -66,18 +68,18 @@
   static const int _STATE_CLOSED = 4;
   static const int _STATE_ADDSTREAM = 8;
 
-  ControllerCallback onListen;
-  ControllerCancelCallback onCancel;
+  void Function()? onListen;
+  FutureOr<void> Function()? onCancel;
 
   // State of the controller.
   int _state;
 
   // Double-linked list of active listeners.
-  _BroadcastSubscription<T> _firstSubscription;
-  _BroadcastSubscription<T> _lastSubscription;
+  _BroadcastSubscription<T>? _firstSubscription;
+  _BroadcastSubscription<T>? _lastSubscription;
 
   // Extra state used during an [addStream] call.
-  _AddStreamState<T> _addStreamState;
+  _AddStreamState<T>? _addStreamState;
 
   /**
    * Future returned by [close] and [done].
@@ -92,27 +94,27 @@
    * Any attempt to listen after calling [close] will throw, so there won't
    * be any further listeners.
    */
-  _Future _doneFuture;
+  _Future<void>? _doneFuture;
 
   _BroadcastStreamController(this.onListen, this.onCancel)
       : _state = _STATE_INITIAL;
 
-  ControllerCallback get onPause {
+  void Function() get onPause {
     throw new UnsupportedError(
         "Broadcast stream controllers do not support pause callbacks");
   }
 
-  void set onPause(void onPauseHandler()) {
+  void set onPause(void onPauseHandler()?) {
     throw new UnsupportedError(
         "Broadcast stream controllers do not support pause callbacks");
   }
 
-  ControllerCallback get onResume {
+  void Function() get onResume {
     throw new UnsupportedError(
         "Broadcast stream controllers do not support pause callbacks");
   }
 
-  void set onResume(void onResumeHandler()) {
+  void set onResume(void onResumeHandler()?) {
     throw new UnsupportedError(
         "Broadcast stream controllers do not support pause callbacks");
   }
@@ -153,10 +155,7 @@
 
   bool get _mayAddEvent => (_state < _STATE_CLOSED);
 
-  _Future _ensureDoneFuture() {
-    if (_doneFuture != null) return _doneFuture;
-    return _doneFuture = new _Future();
-  }
+  _Future<void> _ensureDoneFuture() => _doneFuture ??= _Future<void>();
 
   // Linked list helpers
 
@@ -167,7 +166,7 @@
     assert(identical(subscription._next, subscription));
     subscription._eventState = (_state & _STATE_EVENT_ID);
     // Insert in linked list as last subscription.
-    _BroadcastSubscription<T> oldLast = _lastSubscription;
+    _BroadcastSubscription<T>? oldLast = _lastSubscription;
     _lastSubscription = subscription;
     subscription._next = null;
     subscription._previous = oldLast;
@@ -181,8 +180,8 @@
   void _removeListener(_BroadcastSubscription<T> subscription) {
     assert(identical(subscription._controller, this));
     assert(!identical(subscription._next, subscription));
-    _BroadcastSubscription<T> previous = subscription._previous;
-    _BroadcastSubscription<T> next = subscription._next;
+    _BroadcastSubscription<T>? previous = subscription._previous;
+    _BroadcastSubscription<T>? next = subscription._next;
     if (previous == null) {
       // This was the first subscription.
       _firstSubscription = next;
@@ -201,13 +200,12 @@
 
   // _StreamControllerLifecycle interface.
 
-  StreamSubscription<T> _subscribe(void onData(T data), Function onError,
-      void onDone(), bool cancelOnError) {
+  StreamSubscription<T> _subscribe(void onData(T data)?, Function? onError,
+      void onDone()?, bool cancelOnError) {
     if (isClosed) {
-      onDone ??= _nullDoneHandler;
       return new _DoneStreamSubscription<T>(onDone);
     }
-    StreamSubscription<T> subscription = new _BroadcastSubscription<T>(
+    var subscription = new _BroadcastSubscription<T>(
         this, onData, onError, onDone, cancelOnError);
     _addListener(subscription);
     if (identical(_firstSubscription, _lastSubscription)) {
@@ -217,8 +215,8 @@
     return subscription;
   }
 
-  Future _recordCancel(StreamSubscription<T> sub) {
-    _BroadcastSubscription<T> subscription = sub;
+  Future<void>? _recordCancel(StreamSubscription<T> sub) {
+    _BroadcastSubscription<T> subscription = sub as _BroadcastSubscription<T>;
     // If already removed by the stream, don't remove it again.
     if (identical(subscription._next, subscription)) return null;
     if (subscription._isFiring) {
@@ -252,22 +250,25 @@
     _sendData(data);
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     if (!_mayAddEvent) throw _addEventError();
-    AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+    AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
     if (replacement != null) {
-      error = _nonNullError(replacement.error);
+      error = replacement.error;
       stackTrace = replacement.stackTrace;
+    } else {
+      stackTrace ??= AsyncError.defaultStackTrace(error);
     }
-    stackTrace ??= AsyncError.defaultStackTrace(error);
+    if (stackTrace == null) throw "unreachable"; // TODO(40088)
     _sendError(error, stackTrace);
   }
 
   Future close() {
     if (isClosed) {
       assert(_doneFuture != null);
-      return _doneFuture;
+      return _doneFuture!;
     }
     if (!_mayAddEvent) throw _addEventError();
     _state |= _STATE_CLOSED;
@@ -276,13 +277,15 @@
     return doneFuture;
   }
 
-  Future get done => _ensureDoneFuture();
+  Future<void> get done => _ensureDoneFuture();
 
-  Future addStream(Stream<T> stream, {bool cancelOnError}) {
+  Future addStream(Stream<T> stream, {bool? cancelOnError}) {
     if (!_mayAddEvent) throw _addEventError();
     _state |= _STATE_ADDSTREAM;
-    _addStreamState = new _AddStreamState(this, stream, cancelOnError ?? false);
-    return _addStreamState.addStreamFuture;
+    var addStreamState =
+        new _AddStreamState(this, stream, cancelOnError ?? false);
+    _addStreamState = addStreamState;
+    return addStreamState.addStreamFuture;
   }
 
   // _EventSink interface, called from AddStreamState.
@@ -296,7 +299,7 @@
 
   void _close() {
     assert(_isAddingStream);
-    _AddStreamState addState = _addStreamState;
+    _AddStreamState addState = _addStreamState!;
     _addStreamState = null;
     _state &= ~_STATE_ADDSTREAM;
     addState.complete();
@@ -320,13 +323,13 @@
     // Any listeners added while firing this event will expect the next event,
     // not this one, and won't get notified.
     _state ^= _STATE_EVENT_ID | _STATE_FIRING;
-    _BroadcastSubscription<T> subscription = _firstSubscription;
+    _BroadcastSubscription<T>? subscription = _firstSubscription;
     while (subscription != null) {
       if (subscription._expectsEvent(id)) {
         subscription._eventState |= _BroadcastSubscription._STATE_FIRING;
         action(subscription);
         subscription._toggleEventId();
-        _BroadcastSubscription<T> next = subscription._next;
+        _BroadcastSubscription<T>? next = subscription._next;
         if (subscription._removeAfterFiring) {
           _removeListener(subscription);
         }
@@ -345,9 +348,12 @@
 
   void _callOnCancel() {
     assert(_isEmpty);
-    if (isClosed && _doneFuture._mayComplete) {
+    if (isClosed) {
       // When closed, _doneFuture is not null.
-      _doneFuture._asyncComplete(null);
+      var doneFuture = _doneFuture!;
+      if (doneFuture._mayComplete) {
+        doneFuture._asyncComplete(null);
+      }
     }
     _runGuarded(onCancel);
   }
@@ -355,7 +361,7 @@
 
 class _SyncBroadcastStreamController<T> extends _BroadcastStreamController<T>
     implements SynchronousStreamController<T> {
-  _SyncBroadcastStreamController(void onListen(), void onCancel())
+  _SyncBroadcastStreamController(void onListen()?, void onCancel()?)
       : super(onListen, onCancel);
 
   // EventDispatch interface.
@@ -374,8 +380,9 @@
     if (_isEmpty) return;
     if (_hasOneListener) {
       _state |= _BroadcastStreamController._STATE_FIRING;
-      _BroadcastSubscription<T> subscription = _firstSubscription;
-      subscription._add(data);
+      _BroadcastSubscription<T> firstSubscription =
+          _firstSubscription as dynamic;
+      firstSubscription._add(data);
       _state &= ~_BroadcastStreamController._STATE_FIRING;
       if (_isEmpty) {
         _callOnCancel();
@@ -400,21 +407,20 @@
         subscription._close();
       });
     } else {
-      assert(_doneFuture != null);
-      assert(_doneFuture._mayComplete);
-      _doneFuture._asyncComplete(null);
+      assert(_doneFuture != null && _doneFuture!._mayComplete);
+      _doneFuture!._asyncComplete(null);
     }
   }
 }
 
 class _AsyncBroadcastStreamController<T> extends _BroadcastStreamController<T> {
-  _AsyncBroadcastStreamController(void onListen(), void onCancel())
+  _AsyncBroadcastStreamController(void onListen()?, void onCancel()?)
       : super(onListen, onCancel);
 
   // EventDispatch interface.
 
   void _sendData(T data) {
-    for (_BroadcastSubscription<T> subscription = _firstSubscription;
+    for (var subscription = _firstSubscription;
         subscription != null;
         subscription = subscription._next) {
       subscription._addPending(new _DelayedData<T>(data));
@@ -422,7 +428,7 @@
   }
 
   void _sendError(Object error, StackTrace stackTrace) {
-    for (_BroadcastSubscription<T> subscription = _firstSubscription;
+    for (var subscription = _firstSubscription;
         subscription != null;
         subscription = subscription._next) {
       subscription._addPending(new _DelayedError(error, stackTrace));
@@ -431,15 +437,14 @@
 
   void _sendDone() {
     if (!_isEmpty) {
-      for (_BroadcastSubscription<T> subscription = _firstSubscription;
+      for (var subscription = _firstSubscription;
           subscription != null;
           subscription = subscription._next) {
         subscription._addPending(const _DelayedDone());
       }
     } else {
-      assert(_doneFuture != null);
-      assert(_doneFuture._mayComplete);
-      _doneFuture._asyncComplete(null);
+      assert(_doneFuture != null && _doneFuture!._mayComplete);
+      _doneFuture!._asyncComplete(null);
     }
   }
 }
@@ -457,16 +462,18 @@
  */
 class _AsBroadcastStreamController<T> extends _SyncBroadcastStreamController<T>
     implements _EventDispatch<T> {
-  _StreamImplEvents<T> _pending;
+  _StreamImplEvents<T>? _pending;
 
-  _AsBroadcastStreamController(void onListen(), void onCancel())
+  _AsBroadcastStreamController(void onListen()?, void onCancel()?)
       : super(onListen, onCancel);
 
-  bool get _hasPending => _pending != null && !_pending.isEmpty;
+  bool get _hasPending {
+    var pending = _pending;
+    return pending != null && !pending.isEmpty;
+  }
 
   void _addPendingEvent(_DelayedEvent event) {
-    _pending ??= new _StreamImplEvents<T>();
-    _pending.add(event);
+    (_pending ??= new _StreamImplEvents<T>()).add(event);
   }
 
   void add(T data) {
@@ -475,12 +482,11 @@
       return;
     }
     super.add(data);
-    while (_hasPending) {
-      _pending.handleNext(this);
-    }
+    _flushPending();
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     stackTrace ??= AsyncError.defaultStackTrace(error);
     if (!isClosed && _isFiring) {
@@ -489,8 +495,14 @@
     }
     if (!_mayAddEvent) throw _addEventError();
     _sendError(error, stackTrace);
-    while (_hasPending) {
-      _pending.handleNext(this);
+    _flushPending();
+  }
+
+  void _flushPending() {
+    var pending = _pending;
+    while (pending != null && !pending.isEmpty) {
+      pending.handleNext(this);
+      pending = _pending;
     }
   }
 
@@ -506,8 +518,9 @@
   }
 
   void _callOnCancel() {
-    if (_hasPending) {
-      _pending.clear();
+    var pending = _pending;
+    if (pending != null) {
+      pending.clear();
       _pending = null;
     }
     super._callOnCancel();
diff --git a/sdk/lib/async/deferred_load.dart b/sdk/lib/async/deferred_load.dart
index 0019f68..419db58 100644
--- a/sdk/lib/async/deferred_load.dart
+++ b/sdk/lib/async/deferred_load.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.6
-
 part of dart.async;
 
 /**
@@ -15,7 +13,7 @@
 @Deprecated("Dart sdk v. 1.8")
 class DeferredLibrary {
   final String libraryName;
-  final String uri;
+  final String? uri;
 
   const DeferredLibrary(this.libraryName, {this.uri});
 
@@ -32,7 +30,7 @@
  * Thrown when a deferred library fails to load.
  */
 class DeferredLoadException implements Exception {
-  DeferredLoadException(this._s);
+  DeferredLoadException(String message) : _s = message;
   String toString() => "DeferredLoadException: '$_s'";
   final String _s;
 }
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 19bb7c4..6449304 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.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.6
-
 part of dart.async;
 
 /// A type representing values that are either `Future<T>` or `T`.
@@ -36,6 +34,7 @@
 /// As a corollary, `FutureOr<Object>` is equivalent to
 /// `FutureOr<FutureOr<Object>>`, `FutureOr<Future<Object>>` is equivalent to
 /// `Future<Object>`.
+@pragma("vm:entry-point")
 abstract class FutureOr<T> {
   // Private generative constructor, so that it is not subclassable, mixable, or
   // instantiable.
@@ -149,11 +148,11 @@
 abstract class Future<T> {
   /// A `Future<Null>` completed with `null`.
   static final _Future<Null> _nullFuture =
-      new _Future<Null>.zoneValue(null, Zone.root);
+      new _Future<Null>.zoneValue(null, _rootZone);
 
   /// A `Future<bool>` completed with `false`.
   static final _Future<bool> _falseFuture =
-      new _Future<bool>.zoneValue(false, Zone.root);
+      new _Future<bool>.zoneValue(false, _rootZone);
 
   /**
    * Creates a future containing the result of calling [computation]
@@ -225,14 +224,14 @@
       if (result is Future<T>) {
         return result;
       } else {
-        return new _Future<T>.value(result);
+        // TODO(40014): Remove cast when type promotion works.
+        return new _Future<T>.value(result as dynamic);
       }
     } catch (error, stackTrace) {
       var future = new _Future<T>();
-      AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+      AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
       if (replacement != null) {
-        future._asyncCompleteError(
-            _nonNullError(replacement.error), replacement.stackTrace);
+        future._asyncCompleteError(replacement.error, replacement.stackTrace);
       } else {
         future._asyncCompleteError(error, stackTrace);
       }
@@ -252,11 +251,15 @@
    * with the [value] value,
    * equivalently to `new Future<T>.sync(() => value)`.
    *
+   * If [value] is omitted or `null`, it is converted to `FutureOr<T>` by
+   * `value as FutureOr<T>`. If `T` is not nullable, then the [value] is
+   * required, otherwise the construction throws.
+   *
    * Use [Completer] to create a future and complete it later.
    */
   @pragma("vm:entry-point")
-  factory Future.value([FutureOr<T> value]) {
-    return new _Future<T>.immediate(value);
+  factory Future.value([FutureOr<T>? value]) {
+    return new _Future<T>.immediate(value == null ? value as dynamic : value);
   }
 
   /**
@@ -267,16 +270,15 @@
    * If an error handler isn't added before the future completes, the error
    * will be considered unhandled.
    *
-   * The [error] must not be `null`.
-   *
    * Use [Completer] to create a future and complete it later.
    */
-  factory Future.error(Object error, [StackTrace stackTrace]) {
+  factory Future.error(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     if (!identical(Zone.current, _rootZone)) {
-      AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+      AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
       if (replacement != null) {
-        error = _nonNullError(replacement.error);
+        error = replacement.error;
         stackTrace = replacement.stackTrace;
       }
     }
@@ -301,6 +303,7 @@
    * If [computation] is omitted,
    * it will be treated as if [computation] was `() => null`,
    * and the future will eventually complete with the `null` value.
+   * In that case, [T] must be nullable.
    *
    * If calling [computation] throws, the created future will complete with the
    * error.
@@ -308,11 +311,15 @@
    * See also [Completer] for a way to create and complete a future at a
    * later time that isn't necessarily after a known fixed duration.
    */
-  factory Future.delayed(Duration duration, [FutureOr<T> computation()]) {
+  factory Future.delayed(Duration duration, [FutureOr<T> computation()?]) {
+    if (computation == null && !typeAcceptsNull<T>()) {
+      throw ArgumentError.value(
+          null, "computation", "The type parameter is not nullable");
+    }
     _Future<T> result = new _Future<T>();
     new Timer(duration, () {
       if (computation == null) {
-        result._complete(null);
+        result._complete(null as T);
       } else {
         try {
           result._complete(computation());
@@ -354,25 +361,25 @@
    * uncaught asynchronous error.
    */
   static Future<List<T>> wait<T>(Iterable<Future<T>> futures,
-      {bool eagerError: false, void cleanUp(T successValue)}) {
+      {bool eagerError = false, void cleanUp(T successValue)?}) {
     final _Future<List<T>> result = new _Future<List<T>>();
-    List<T> values; // Collects the values. Set to null on error.
+    List<T?>? values; // Collects the values. Set to null on error.
     int remaining = 0; // How many futures are we waiting for.
-    var error; // The first error from a future.
-    StackTrace stackTrace; // The stackTrace that came with the error.
+    late Object error; // The first error from a future.
+    late StackTrace stackTrace; // The stackTrace that came with the error.
 
     // Handle an error from any of the futures.
-    // TODO(jmesserly): use `void` return type once it can be inferred for the
-    // `then` call below.
-    handleError(Object theError, StackTrace theStackTrace) {
+    void handleError(Object theError, StackTrace theStackTrace) {
       remaining--;
-      if (values != null) {
+      List<T?>? valueList = values;
+      if (valueList != null) {
         if (cleanUp != null) {
-          for (var value in values) {
+          for (var value in valueList) {
             if (value != null) {
               // Ensure errors from cleanUp are uncaught.
+              T cleanUpValue = value;
               new Future.sync(() {
-                cleanUp(value);
+                cleanUp(cleanUpValue);
               });
             }
           }
@@ -396,10 +403,11 @@
         int pos = remaining;
         future.then((T value) {
           remaining--;
-          if (values != null) {
-            values[pos] = value;
+          List<T?>? valueList = values;
+          if (valueList != null) {
+            valueList[pos] = value;
             if (remaining == 0) {
-              result._completeWithValue(values);
+              result._completeWithValue(List<T>.from(valueList));
             }
           } else {
             if (cleanUp != null && value != null) {
@@ -409,6 +417,8 @@
               });
             }
             if (remaining == 0 && !eagerError) {
+              // If eagerError is false, and valueList is null, then
+              // error and stackTrace have been set in handleError above.
               result._completeError(error, stackTrace);
             }
           }
@@ -419,12 +429,14 @@
         remaining++;
       }
       if (remaining == 0) {
-        return new Future.value(const []);
+        return new Future<List<T>>.value(const <Never>[]);
       }
-      values = new List<T>(remaining);
+      values = new List<T?>.filled(remaining, null);
     } catch (e, st) {
       // The error must have been thrown while iterating over the futures
       // list, or while installing a callback handler on the future.
+      // This is a breach of the `Future` protocol, but we try to handle it
+      // gracefully.
       if (remaining == 0 || eagerError) {
         // Throw a new Future.error.
         // Don't just call `result._completeError` since that would propagate
@@ -457,12 +469,14 @@
    */
   static Future<T> any<T>(Iterable<Future<T>> futures) {
     var completer = new Completer<T>.sync();
-    var onValue = (T value) {
+    void onValue(T value) {
       if (!completer.isCompleted) completer.complete(value);
-    };
-    var onError = (error, StackTrace stack) {
+    }
+
+    void onError(Object error, StackTrace stack) {
       if (!completer.isCompleted) completer.completeError(error, stack);
-    };
+    }
+
     for (var future in futures) {
       future.then(onValue, onError: onError);
     }
@@ -498,7 +512,7 @@
   }
 
   // Constant `true` function, used as callback by [forEach].
-  static bool _kTrue(_) => true;
+  static bool _kTrue(Object? _) => true;
 
   /**
    * Performs an operation repeatedly until it returns `false`.
@@ -523,8 +537,8 @@
    * until that future has completed.
    */
   static Future doWhile(FutureOr<bool> action()) {
-    _Future doneSignal = new _Future();
-    void Function(bool) nextIteration;
+    _Future<void> doneSignal = new _Future<void>();
+    late void Function(bool) nextIteration;
     // Bind this callback explicitly so that each iteration isn't bound in the
     // context of all the previous iterations' callbacks.
     // This avoids, e.g., deeply nested stack traces from the stack trace
@@ -544,7 +558,8 @@
           result.then(nextIteration, onError: doneSignal._completeError);
           return;
         }
-        keepGoing = result;
+        // TODO(40014): Remove cast when type promotion works.
+        keepGoing = result as bool;
       }
       doneSignal._complete(null);
     });
@@ -600,7 +615,7 @@
    * has completed with an error then the error is reported as unhandled error.
    * See the description on [Future].
    */
-  Future<R> then<R>(FutureOr<R> onValue(T value), {Function onError});
+  Future<R> then<R>(FutureOr<R> onValue(T value), {Function? onError});
 
   /**
    * Handles errors emitted by this [Future].
@@ -639,7 +654,7 @@
   // - (dynamic, StackTrace) -> FutureOr<T>
   // Given that there is a `test` function that is usually used to do an
   // `isCheck` we should also expect functions that take a specific argument.
-  Future<T> catchError(Function onError, {bool test(Object error)});
+  Future<T> catchError(Function onError, {bool test(Object error)?});
 
   /**
    * Registers a function to be called when this future completes.
@@ -676,7 +691,7 @@
    *       });
    *     }
    */
-  Future<T> whenComplete(FutureOr action());
+  Future<T> whenComplete(FutureOr<void> action());
 
   /**
    * Creates a [Stream] containing the result of this future.
@@ -703,7 +718,7 @@
    * If `onTimeout` is omitted, a timeout will cause the returned future to
    * complete with a [TimeoutException].
    */
-  Future<T> timeout(Duration timeLimit, {FutureOr<T> onTimeout()});
+  Future<T> timeout(Duration timeLimit, {FutureOr<T> onTimeout()?});
 }
 
 /**
@@ -711,9 +726,9 @@
  */
 class TimeoutException implements Exception {
   /** Description of the cause of the timeout. */
-  final String message;
+  final String? message;
   /** The duration that was exceeded. */
-  final Duration duration;
+  final Duration? duration;
 
   TimeoutException(this.message, [this.duration]);
 
@@ -857,6 +872,8 @@
    *
    * The value must be either a value of type [T]
    * or a future of type `Future<T>`.
+   * If the value is omitted or null, and `T` is not nullable, the call
+   * to `complete` throws.
    *
    * If the value is itself a future, the completer will wait for that future
    * to complete, and complete with the same result, whether it is a success
@@ -866,7 +883,7 @@
    *
    * All listeners on the future are informed about the value.
    */
-  void complete([FutureOr<T> value]);
+  void complete([FutureOr<T>? value]);
 
   /**
    * Complete [future] with an error.
@@ -876,8 +893,6 @@
    * Completing a future with an error indicates that an exception was thrown
    * while trying to produce a value.
    *
-   * The [error] must not be `null`.
-   *
    * If `error` is a `Future`, the future itself is used as the error value.
    * If you want to complete with the result of the future, you can use:
    * ```
@@ -888,7 +903,7 @@
    * theFuture.catchError(thisCompleter.completeError);
    * ```
    */
-  void completeError(Object error, [StackTrace stackTrace]);
+  void completeError(Object error, [StackTrace? stackTrace]);
 
   /**
    * Whether the [future] has been completed.
@@ -906,28 +921,32 @@
 }
 
 // Helper function completing a _Future with error, but checking the zone
-// for error replacement first and missing stack trace.
-void _completeWithErrorCallback(_Future result, error, StackTrace stackTrace) {
-  AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+// for error replacement and missing stack trace first.
+void _completeWithErrorCallback(
+    _Future result, Object error, StackTrace? stackTrace) {
+  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
   if (replacement != null) {
-    error = _nonNullError(replacement.error);
+    error = replacement.error;
     stackTrace = replacement.stackTrace;
+  } else {
+    stackTrace ??= AsyncError.defaultStackTrace(error);
   }
-  stackTrace ??= AsyncError.defaultStackTrace(error);
+  if (stackTrace == null) throw "unreachable"; // TODO(40088).
   result._completeError(error, stackTrace);
 }
 
 // Like [_completeWithErrorCallback] but completes asynchronously.
 void _asyncCompleteWithErrorCallback(
-    _Future result, error, StackTrace stackTrace) {
-  AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+    _Future result, Object error, StackTrace? stackTrace) {
+  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
   if (replacement != null) {
-    error = _nonNullError(replacement.error);
+    error = replacement.error;
     stackTrace = replacement.stackTrace;
+  } else {
+    stackTrace ??= AsyncError.defaultStackTrace(error);
   }
-  stackTrace ??= AsyncError.defaultStackTrace(error);
+  if (stackTrace == null) {
+    throw "unreachable"; // TODO(lrn): Remove when type promotion works.
+  }
   result._asyncCompleteError(error, stackTrace);
 }
-
-/** Helper function that converts `null` to a [NullThrownError]. */
-Object _nonNullError(Object error) => error ?? new NullThrownError();
diff --git a/sdk/lib/async/future_impl.dart b/sdk/lib/async/future_impl.dart
index df685d5..3f33737 100644
--- a/sdk/lib/async/future_impl.dart
+++ b/sdk/lib/async/future_impl.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.6
-
 part of dart.async;
 
 /** The onValue and onError handlers return either a value or a future */
@@ -16,17 +14,20 @@
 abstract class _Completer<T> implements Completer<T> {
   final _Future<T> future = new _Future<T>();
 
-  void complete([FutureOr<T> value]);
+  void complete([FutureOr<T>? value]);
 
-  void completeError(Object error, [StackTrace stackTrace]) {
+  void completeError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     if (!future._mayComplete) throw new StateError("Future already completed");
-    AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+    AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
     if (replacement != null) {
-      error = _nonNullError(replacement.error);
+      error = replacement.error;
       stackTrace = replacement.stackTrace;
+    } else {
+      stackTrace ??= AsyncError.defaultStackTrace(error);
     }
-    stackTrace ??= AsyncError.defaultStackTrace(error);
+    if (stackTrace == null) throw "unreachable"; // TODO(40088)
     _completeError(error, stackTrace);
   }
 
@@ -38,9 +39,9 @@
 }
 
 class _AsyncCompleter<T> extends _Completer<T> {
-  void complete([FutureOr<T> value]) {
+  void complete([FutureOr<T>? value]) {
     if (!future._mayComplete) throw new StateError("Future already completed");
-    future._asyncComplete(value);
+    future._asyncComplete(value == null ? value as dynamic : value);
   }
 
   void _completeError(Object error, StackTrace stackTrace) {
@@ -49,9 +50,9 @@
 }
 
 class _SyncCompleter<T> extends _Completer<T> {
-  void complete([FutureOr<T> value]) {
+  void complete([FutureOr<T>? value]) {
     if (!future._mayComplete) throw new StateError("Future already completed");
-    future._complete(value);
+    future._complete(value == null ? value as dynamic : value);
   }
 
   void _completeError(Object error, StackTrace stackTrace) {
@@ -74,19 +75,19 @@
       maskValue | maskError | maskTestError | maskWhencomplete;
   static const int stateIsAwait = 16;
   // Listeners on the same future are linked through this link.
-  _FutureListener _nextListener;
+  _FutureListener? _nextListener;
   // The future to complete when this listener is activated.
   final _Future<T> result;
   // Which fields means what.
   final int state;
   // Used for then/whenDone callback and error test
   @pragma("vm:entry-point")
-  final Function callback;
+  final Function? callback;
   // Used for error callbacks.
-  final Function errorCallback;
+  final Function? errorCallback;
 
   _FutureListener.then(
-      this.result, _FutureOnValue<S, T> onValue, Function errorCallback)
+      this.result, FutureOr<T> Function(S) onValue, Function? errorCallback)
       : callback = onValue,
         errorCallback = errorCallback,
         state = (errorCallback == null) ? stateThen : stateThenOnerror;
@@ -105,7 +106,7 @@
       : errorCallback = null,
         state = stateWhencomplete;
 
-  Zone get _zone => result._zone;
+  _Zone get _zone => result._zone;
 
   bool get handlesValue => (state & maskValue != 0);
   bool get handlesError => (state & maskError != 0);
@@ -113,20 +114,21 @@
   bool get handlesComplete => (state & maskType == stateWhencomplete);
   bool get isAwait => (state & stateIsAwait != 0);
 
-  _FutureOnValue<S, T> get _onValue {
+  FutureOr<T> Function(S) get _onValue {
     assert(handlesValue);
-    return callback;
+    return callback as dynamic;
   }
 
-  Function get _onError => errorCallback;
+  Function? get _onError => errorCallback;
+
   _FutureErrorTest get _errorTest {
     assert(hasErrorTest);
-    return callback;
+    return callback as dynamic;
   }
 
   _FutureAction get _whenCompleteAction {
     assert(handlesComplete);
-    return callback;
+    return callback as dynamic;
   }
 
   /// Whether this listener has an error callback.
@@ -155,8 +157,8 @@
       return _zone.runBinary<dynamic, Object, StackTrace>(
           errorCallback, asyncError.error, asyncError.stackTrace);
     } else {
-      assert(errorCallback is dynamic Function(Object));
-      return _zone.runUnary<dynamic, Object>(errorCallback, asyncError.error);
+      return _zone.runUnary<dynamic, Object>(
+          errorCallback as dynamic, asyncError.error);
     }
   }
 
@@ -198,7 +200,7 @@
    * Until the future is completed, the field may hold the zone that
    * listener callbacks used to create this future should be run in.
    */
-  final Zone _zone;
+  final _Zone _zone;
 
   /**
    * Either the result, a list of listeners or another future.
@@ -219,9 +221,9 @@
   var _resultOrListeners;
 
   // This constructor is used by async/await.
-  _Future() : _zone = Zone.current;
+  _Future() : _zone = Zone._current;
 
-  _Future.immediate(FutureOr<T> result) : _zone = Zone.current {
+  _Future.immediate(FutureOr<T> result) : _zone = Zone._current {
     _asyncComplete(result);
   }
 
@@ -231,12 +233,12 @@
   }
 
   _Future.immediateError(var error, StackTrace stackTrace)
-      : _zone = Zone.current {
+      : _zone = Zone._current {
     _asyncCompleteError(error, stackTrace);
   }
 
   /** Creates a future that is already completed with the value. */
-  _Future.value(T value) : this.zoneValue(value, Zone.current);
+  _Future.value(T value) : this.zoneValue(value, Zone._current);
 
   bool get _mayComplete => _state == _stateIncomplete;
   bool get _isPendingComplete => _state == _statePendingComplete;
@@ -245,14 +247,14 @@
   bool get _isComplete => _state >= _stateValue;
   bool get _hasError => _state == _stateError;
 
-  static List<Function> _continuationFunctions(_Future<Object> future) {
-    List<Function> result = null;
+  static List<Function>? _continuationFunctions(_Future<Object> future) {
+    List<Function>? result = null;
     while (true) {
       if (future._mayAddListener) return result;
       assert(!future._isComplete);
       assert(!future._isChained);
       // So _resultOrListeners contains listeners.
-      _FutureListener<Object, Object> listener = future._resultOrListeners;
+      _FutureListener<Object, Object>? listener = future._resultOrListeners;
       if (listener != null &&
           listener._nextListener == null &&
           listener.isAwait) {
@@ -272,7 +274,7 @@
     _resultOrListeners = source;
   }
 
-  Future<R> then<R>(FutureOr<R> f(T value), {Function onError}) {
+  Future<R> then<R>(FutureOr<R> f(T value), {Function? onError}) {
     Zone currentZone = Zone.current;
     if (!identical(currentZone, _rootZone)) {
       f = currentZone.registerUnaryCallback<FutureOr<R>, T>(f);
@@ -300,7 +302,7 @@
     return result;
   }
 
-  Future<T> catchError(Function onError, {bool test(error)}) {
+  Future<T> catchError(Function onError, {bool test(Object error)?}) {
     _Future<T> result = new _Future<T>();
     if (!identical(result._zone, _rootZone)) {
       onError = _registerErrorHandler(onError, result._zone);
@@ -393,15 +395,17 @@
     }
   }
 
-  void _prependListeners(_FutureListener listeners) {
+  void _prependListeners(_FutureListener? listeners) {
     if (listeners == null) return;
     if (_mayAddListener) {
-      _FutureListener existingListeners = _resultOrListeners;
+      _FutureListener? existingListeners = _resultOrListeners;
       _resultOrListeners = listeners;
       if (existingListeners != null) {
         _FutureListener cursor = listeners;
-        while (cursor._nextListener != null) {
-          cursor = cursor._nextListener;
+        _FutureListener? next = cursor._nextListener;
+        while (next != null) {
+          cursor = next;
+          next = cursor._nextListener;
         }
         cursor._nextListener = existingListeners;
       }
@@ -425,20 +429,20 @@
     }
   }
 
-  _FutureListener _removeListeners() {
+  _FutureListener? _removeListeners() {
     // Reverse listeners before returning them, so the resulting list is in
     // subscription order.
     assert(!_isComplete);
-    _FutureListener current = _resultOrListeners;
+    _FutureListener? current = _resultOrListeners;
     _resultOrListeners = null;
     return _reverseListeners(current);
   }
 
-  _FutureListener _reverseListeners(_FutureListener listeners) {
-    _FutureListener prev;
-    _FutureListener current = listeners;
+  _FutureListener? _reverseListeners(_FutureListener? listeners) {
+    _FutureListener? prev = null;
+    _FutureListener? current = listeners;
     while (current != null) {
-      _FutureListener next = current._nextListener;
+      _FutureListener? next = current._nextListener;
       current._nextListener = prev;
       prev = current;
       current = next;
@@ -464,12 +468,7 @@
         // so use _complete instead of _completeWithValue.
         target._clearPendingComplete(); // Clear this first, it's set again.
         target._complete(value);
-      },
-          // TODO(floitsch): eventually we would like to make this non-optional
-          // and dependent on the listeners of the target future. If none of
-          // the target future's listeners want to have the stack trace we don't
-          // need a trace.
-          onError: (error, [StackTrace stackTrace]) {
+      }, onError: (Object error, StackTrace stackTrace) {
         assert(target._isPendingComplete);
         target._completeError(error, stackTrace);
       });
@@ -492,11 +491,11 @@
       source = source._chainSource;
     }
     if (source._isComplete) {
-      _FutureListener listeners = target._removeListeners();
+      _FutureListener? listeners = target._removeListeners();
       target._cloneResult(source);
       _propagateToListeners(target, listeners);
     } else {
-      _FutureListener listeners = target._resultOrListeners;
+      _FutureListener? listeners = target._resultOrListeners;
       target._setChained(source);
       source._prependListeners(listeners);
     }
@@ -511,8 +510,12 @@
         _chainForeignFuture(value, this);
       }
     } else {
-      _FutureListener listeners = _removeListeners();
-      _setValue(value);
+      _FutureListener? listeners = _removeListeners();
+      // TODO(40014): Remove cast when type promotion works.
+      // This would normally be `as T` but we use `as dynamic` to make the
+      // unneeded check be implict to match dart2js unsound optimizations in the
+      // user code.
+      _setValue(value as dynamic); // Value promoted to T.
       _propagateToListeners(this, listeners);
     }
   }
@@ -521,15 +524,15 @@
     assert(!_isComplete);
     assert(value is! Future<T>);
 
-    _FutureListener listeners = _removeListeners();
+    _FutureListener? listeners = _removeListeners();
     _setValue(value);
     _propagateToListeners(this, listeners);
   }
 
-  void _completeError(Object error, [StackTrace stackTrace]) {
+  void _completeError(Object error, StackTrace stackTrace) {
     assert(!_isComplete);
 
-    _FutureListener listeners = _removeListeners();
+    _FutureListener? listeners = _removeListeners();
     _setError(error, stackTrace);
     _propagateToListeners(this, listeners);
   }
@@ -551,7 +554,11 @@
       _chainFuture(value);
       return;
     }
-    _asyncCompleteWithValue(value);
+    // TODO(40014): Remove cast when type promotion works.
+    // This would normally be `as T` but we use `as dynamic` to make the
+    // unneeded check be implict to match dart2js unsound optimizations in the
+    // user code.
+    _asyncCompleteWithValue(value as dynamic); // Value promoted to T.
   }
 
   void _asyncCompleteWithValue(T value) {
@@ -578,7 +585,7 @@
     _chainForeignFuture(value, this);
   }
 
-  void _asyncCompleteError(error, StackTrace stackTrace) {
+  void _asyncCompleteError(Object error, StackTrace stackTrace) {
     assert(!_isComplete);
 
     _setPendingComplete();
@@ -591,7 +598,8 @@
    * Propagates the value/error of [source] to its [listeners], executing the
    * listeners' callbacks.
    */
-  static void _propagateToListeners(_Future source, _FutureListener listeners) {
+  static void _propagateToListeners(
+      _Future source, _FutureListener? listeners) {
     while (true) {
       assert(source._isComplete);
       bool hasError = source._hasError;
@@ -606,13 +614,15 @@
       // Usually futures only have one listener. If they have several, we
       // call handle them separately in recursive calls, continuing
       // here only when there is only one listener left.
-      while (listeners._nextListener != null) {
-        _FutureListener listener = listeners;
-        listeners = listener._nextListener;
+      _FutureListener listener = listeners;
+      _FutureListener? nextListener = listener._nextListener;
+      while (nextListener != null) {
         listener._nextListener = null;
         _propagateToListeners(source, listener);
+        listener = nextListener;
+        nextListener = listener._nextListener;
       }
-      _FutureListener listener = listeners;
+
       final sourceResult = source._resultOrListeners;
       // Do the actual propagation.
       // Set initial state of listenerHasError and listenerValueOrError. These
@@ -628,7 +638,7 @@
       // expensive, branch. Here we'll enter/leave the zone. Many futures
       // don't have callbacks, so this is a significant optimization.
       if (hasError || listener.handlesValue || listener.handlesComplete) {
-        Zone zone = listener._zone;
+        _Zone zone = listener._zone;
         if (hasError && !source._zone.inSameErrorZone(zone)) {
           // Don't cross zone boundaries with errors.
           AsyncError asyncError = source._error;
@@ -637,8 +647,8 @@
           return;
         }
 
-        Zone oldZone;
-        if (!identical(Zone.current, zone)) {
+        _Zone? oldZone;
+        if (!identical(Zone._current, zone)) {
           // Change zone if it's not current.
           oldZone = Zone._enter(zone);
         }
@@ -663,15 +673,15 @@
             listenerHasError = true;
             return;
           }
-          if (completeResult is Future) {
-            if (completeResult is _Future && completeResult._isComplete) {
-              if (completeResult._hasError) {
-                listenerValueOrError = completeResult._error;
-                listenerHasError = true;
-              }
-              // Otherwise use the existing result of source.
-              return;
+          if (completeResult is _Future && completeResult._isComplete) {
+            if (completeResult._hasError) {
+              listenerValueOrError = completeResult._error;
+              listenerHasError = true;
             }
+            // Otherwise use the existing result of source.
+            return;
+          }
+          if (completeResult is Future) {
             // We have to wait for the completeResult future to complete
             // before knowing if it's an error or we should use the result
             // of source.
@@ -758,21 +768,24 @@
     }
   }
 
-  Future<T> timeout(Duration timeLimit, {FutureOr<T> onTimeout()}) {
+  Future<T> timeout(Duration timeLimit, {FutureOr<T> onTimeout()?}) {
     if (_isComplete) return new _Future.immediate(this);
     _Future<T> result = new _Future<T>();
     Timer timer;
     if (onTimeout == null) {
       timer = new Timer(timeLimit, () {
         result._completeError(
-            new TimeoutException("Future not completed", timeLimit));
+            new TimeoutException("Future not completed", timeLimit),
+            StackTrace.empty);
       });
     } else {
       Zone zone = Zone.current;
-      onTimeout = zone.registerCallback(onTimeout);
+      FutureOr<T> Function() onTimeoutHandler =
+          zone.registerCallback(onTimeout);
+
       timer = new Timer(timeLimit, () {
         try {
-          result._complete(zone.run(onTimeout));
+          result._complete(zone.run(onTimeoutHandler));
         } catch (e, s) {
           result._completeError(e, s);
         }
@@ -783,7 +796,7 @@
         timer.cancel();
         result._completeWithValue(v);
       }
-    }, onError: (e, StackTrace s) {
+    }, onError: (Object e, StackTrace s) {
       if (timer.isActive) {
         timer.cancel();
         result._completeError(e, s);
diff --git a/sdk/lib/async/schedule_microtask.dart b/sdk/lib/async/schedule_microtask.dart
index 40f6523..940989c 100644
--- a/sdk/lib/async/schedule_microtask.dart
+++ b/sdk/lib/async/schedule_microtask.dart
@@ -2,22 +2,20 @@
 // 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.6
-
 part of dart.async;
 
 typedef void _AsyncCallback();
 
 class _AsyncCallbackEntry {
   final _AsyncCallback callback;
-  _AsyncCallbackEntry next;
+  _AsyncCallbackEntry? next;
   _AsyncCallbackEntry(this.callback);
 }
 
 /** Head of single linked list of pending callbacks. */
-_AsyncCallbackEntry _nextCallback;
+_AsyncCallbackEntry? _nextCallback;
 /** Tail of single linked list of pending callbacks. */
-_AsyncCallbackEntry _lastCallback;
+_AsyncCallbackEntry? _lastCallback;
 /**
  * Tail of priority callbacks added by the currently executing callback.
  *
@@ -25,7 +23,7 @@
  * callback queue, so that if one callback schedules more than one
  * priority callback, they are still enqueued in scheduling order.
  */
-_AsyncCallbackEntry _lastPriorityCallback;
+_AsyncCallbackEntry? _lastPriorityCallback;
 /**
  * Whether we are currently inside the callback loop.
  *
@@ -35,11 +33,11 @@
 bool _isInCallbackLoop = false;
 
 void _microtaskLoop() {
-  while (_nextCallback != null) {
+  for (var entry = _nextCallback; entry != null; entry = _nextCallback) {
     _lastPriorityCallback = null;
-    _AsyncCallbackEntry entry = _nextCallback;
-    _nextCallback = entry.next;
-    if (_nextCallback == null) _lastCallback = null;
+    var next = entry.next;
+    _nextCallback = next;
+    if (next == null) _lastCallback = null;
     (entry.callback)();
   }
 }
@@ -67,13 +65,14 @@
  */
 void _scheduleAsyncCallback(_AsyncCallback callback) {
   _AsyncCallbackEntry newEntry = new _AsyncCallbackEntry(callback);
-  if (_nextCallback == null) {
+  _AsyncCallbackEntry? lastCallback = _lastCallback;
+  if (lastCallback == null) {
     _nextCallback = _lastCallback = newEntry;
     if (!_isInCallbackLoop) {
       _AsyncRun._scheduleImmediate(_startMicrotaskLoop);
     }
   } else {
-    _lastCallback.next = newEntry;
+    lastCallback.next = newEntry;
     _lastCallback = newEntry;
   }
 }
@@ -93,14 +92,16 @@
     return;
   }
   _AsyncCallbackEntry entry = new _AsyncCallbackEntry(callback);
-  if (_lastPriorityCallback == null) {
+  _AsyncCallbackEntry? lastPriorityCallback = _lastPriorityCallback;
+  if (lastPriorityCallback == null) {
     entry.next = _nextCallback;
     _nextCallback = _lastPriorityCallback = entry;
   } else {
-    entry.next = _lastPriorityCallback.next;
-    _lastPriorityCallback.next = entry;
+    var next = lastPriorityCallback.next;
+    entry.next = next;
+    lastPriorityCallback.next = entry;
     _lastPriorityCallback = entry;
-    if (entry.next == null) {
+    if (next == null) {
       _lastCallback = entry;
     }
   }
@@ -131,8 +132,8 @@
  * Learn how Dart handles the event queue and microtask queue, so you can write
  * better asynchronous code with fewer surprises.
  */
-void scheduleMicrotask(void callback()) {
-  _Zone currentZone = Zone.current;
+void scheduleMicrotask(void Function() callback) {
+  _Zone currentZone = Zone._current;
   if (identical(_rootZone, currentZone)) {
     // No need to bind the callback. We know that the root's scheduleMicrotask
     // will be invoked in the root zone.
@@ -151,5 +152,5 @@
 
 class _AsyncRun {
   /** Schedule the given callback before any other event in the event-loop. */
-  external static void _scheduleImmediate(void callback());
+  external static void _scheduleImmediate(void Function() callback);
 }
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 4aae043..46ec161 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/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.6
-
 part of dart.async;
 
 // -------------------------------------------------------------------
@@ -65,7 +63,7 @@
  * call occurs.
  * For example, the [first] getter listens to the stream, then returns the first
  * event that listener receives.
- * This is not necessarily the first event emitted by the stream, but the first
+ * This is not necessarily the first even emitted by the stream, but the first
  * of the *remaining* events of the broadcast stream.
  *
  * When the "done" event is fired, subscribers are unsubscribed before
@@ -132,7 +130,6 @@
    *
    * This stream emits a single error event of [error] and [stackTrace]
    * and then completes with a done event.
-   * The [error] must not be `null`.
    *
    * Example:
    * ```dart
@@ -153,7 +150,8 @@
    * stack trace as well.
    */
   @Since("2.5")
-  factory Stream.error(Object error, [StackTrace stackTrace]) {
+  factory Stream.error(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     return (_AsyncStreamController<T>(null, null, null, null)
           .._addError(error, stackTrace ?? AsyncError.defaultStackTrace(error))
@@ -205,18 +203,20 @@
     // Declare these as variables holding closures instead of as
     // function declarations.
     // This avoids creating a new closure from the functions for each future.
-    var onValue = (T value) {
+    void onValue(T value) {
       if (!controller.isClosed) {
         controller._add(value);
         if (--count == 0) controller._closeUnchecked();
       }
-    };
-    var onError = (error, StackTrace stack) {
+    }
+
+    void onError(Object error, StackTrace stack) {
       if (!controller.isClosed) {
         controller._addError(error, stack);
         if (--count == 0) controller._closeUnchecked();
       }
-    };
+    }
+
     // The futures are already running, so start listening to them immediately
     // (instead of waiting for the stream to be listened on).
     // If we wait, we might not catch errors in the futures in time.
@@ -254,65 +254,59 @@
    * this callback is an integer that starts with 0 and is incremented for
    * every event.
    *
+   * The [period] must a non-negative [Duration].
+   *
    * If [computation] is omitted the event values will all be `null`.
    *
-   * [period] must a non-negative [Duration].
+   * The [computation] must not be omitted if the event type [T] does not
+   * allow `null` as a value.
    */
   factory Stream.periodic(Duration period,
-      [T computation(int computationCount)]) {
-    Timer timer;
-    int computationCount = 0;
-    StreamController<T> controller;
+      [T computation(int computationCount)?]) {
+    if (computation == null && !typeAcceptsNull<T>()) {
+      throw ArgumentError.value(null, "computation",
+          "Must not be omitted when the event type is non-nullable");
+    }
+    var controller = _SyncStreamController<T>(null, null, null, null);
     // Counts the time that the Stream was running (and not paused).
     Stopwatch watch = new Stopwatch();
-
-    void sendEvent() {
-      watch.reset();
-      T data;
-      if (computation != null) {
-        try {
-          data = computation(computationCount++);
-        } catch (e, s) {
-          controller.addError(e, s);
-          return;
+    controller.onListen = () {
+      int computationCount = 0;
+      void sendEvent(_) {
+        watch.reset();
+        if (computation != null) {
+          T event;
+          try {
+            event = computation(computationCount++);
+          } catch (e, s) {
+            controller.addError(e, s);
+            return;
+          }
+          controller.add(event);
+        } else {
+          controller.add(null as T); // We have checked that null is T.
         }
       }
-      controller.add(data);
-    }
 
-    void startPeriodicTimer() {
-      assert(timer == null);
-      timer = new Timer.periodic(period, (Timer timer) {
-        sendEvent();
-      });
-    }
-
-    controller = new StreamController<T>(
-        sync: true,
-        onListen: () {
-          watch.start();
-          startPeriodicTimer();
-        },
-        onPause: () {
+      Timer timer = Timer.periodic(period, sendEvent);
+      controller
+        ..onCancel = () {
           timer.cancel();
-          timer = null;
+          return Future._nullFuture;
+        }
+        ..onPause = () {
           watch.stop();
-        },
-        onResume: () {
-          assert(timer == null);
+          timer.cancel();
+        }
+        ..onResume = () {
           Duration elapsed = watch.elapsed;
           watch.start();
           timer = new Timer(period - elapsed, () {
-            timer = null;
-            startPeriodicTimer();
-            sendEvent();
+            timer = Timer.periodic(period, sendEvent);
+            sendEvent(null);
           });
-        },
-        onCancel: () {
-          if (timer != null) timer.cancel();
-          timer = null;
-          return Future._nullFuture;
-        });
+        };
+    };
     return controller.stream;
   }
 
@@ -357,7 +351,7 @@
    * The resulting stream is a broadcast stream if [source] is.
    */
   factory Stream.eventTransformed(
-      Stream source, EventSink mapSink(EventSink<T> sink)) {
+      Stream<dynamic> source, EventSink<dynamic> mapSink(EventSink<T> sink)) {
     return new _BoundSinkStream(source, mapSink);
   }
 
@@ -399,8 +393,8 @@
    * subscription when there are no listeners.
    */
   Stream<T> asBroadcastStream(
-      {void onListen(StreamSubscription<T> subscription),
-      void onCancel(StreamSubscription<T> subscription)}) {
+      {void onListen(StreamSubscription<T> subscription)?,
+      void onCancel(StreamSubscription<T> subscription)?}) {
     return new _AsBroadcastStream<T>(this, onListen, onCancel);
   }
 
@@ -418,8 +412,8 @@
    * On errors from this stream, the [onError] handler is called with the
    * error object and possibly a stack trace.
    *
-   * The [onError] callback must be of type `void onError(error)` or
-   * `void onError(error, StackTrace stackTrace)`. If [onError] accepts
+   * The [onError] callback must be of type `void onError(Object error)` or
+   * `void onError(Object error, StackTrace stackTrace)`. If [onError] accepts
    * two arguments it is called with the error object and the stack trace
    * (which could be `null` if this stream itself received an error without
    * stack trace).
@@ -439,8 +433,8 @@
    * the subscription doesn't receive events and none of the
    * event handler functions are called.
    */
-  StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError});
+  StreamSubscription<T> listen(void onData(T event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError});
 
   /**
    * Creates a new stream from this stream that discards some elements.
@@ -501,14 +495,23 @@
    */
   Stream<E> asyncMap<E>(FutureOr<E> convert(T event)) {
     _StreamControllerBase<E> controller;
-    StreamSubscription<T> subscription;
+    if (isBroadcast) {
+      controller = _SyncBroadcastStreamController<E>(null, null);
+    } else {
+      controller = _SyncStreamController<E>(null, null, null, null);
+    }
 
-    void onListen() {
-      final add = controller.add;
-      assert(controller is _StreamController<E> ||
-          controller is _BroadcastStreamController);
+    controller.onListen = () {
+      StreamSubscription<T> subscription = this.listen(null,
+          onError: controller._addError, // Avoid Zone error replacement.
+          onDone: controller.close);
+      FutureOr<Null> add(E value) {
+        controller.add(value);
+      }
+
       final addError = controller._addError;
-      subscription = this.listen((T event) {
+      final resume = subscription.resume;
+      subscription.onData((T event) {
         FutureOr<E> newValue;
         try {
           newValue = convert(event);
@@ -518,34 +521,19 @@
         }
         if (newValue is Future<E>) {
           subscription.pause();
-          newValue
-              .then(add, onError: addError)
-              .whenComplete(subscription.resume);
+          newValue.then(add, onError: addError).whenComplete(resume);
         } else {
-          controller.add(newValue);
+          // TODO(40014): Remove cast when type promotion works.
+          controller.add(newValue as dynamic);
         }
-      }, onError: addError, onDone: controller.close);
-    }
-
-    if (this.isBroadcast) {
-      controller = new StreamController<E>.broadcast(
-          onListen: onListen,
-          onCancel: () {
-            subscription.cancel();
-          },
-          sync: true);
-    } else {
-      controller = new StreamController<E>(
-          onListen: onListen,
-          onPause: () {
-            subscription.pause();
-          },
-          onResume: () {
-            subscription.resume();
-          },
-          onCancel: () => subscription.cancel(),
-          sync: true);
-    }
+      });
+      controller.onCancel = subscription.cancel;
+      if (!isBroadcast) {
+        controller
+          ..onPause = subscription.pause
+          ..onResume = resume;
+      }
+    };
     return controller.stream;
   }
 
@@ -567,14 +555,20 @@
    *
    * The returned stream is a broadcast stream if this stream is.
    */
-  Stream<E> asyncExpand<E>(Stream<E> convert(T event)) {
+  Stream<E> asyncExpand<E>(Stream<E>? convert(T event)) {
     _StreamControllerBase<E> controller;
-    StreamSubscription<T> subscription;
-    void onListen() {
-      assert(controller is _StreamController ||
-          controller is _BroadcastStreamController);
-      subscription = this.listen((T event) {
-        Stream<E> newStream;
+    if (isBroadcast) {
+      controller = _SyncBroadcastStreamController<E>(null, null);
+    } else {
+      controller = _SyncStreamController<E>(null, null, null, null);
+    }
+
+    controller.onListen = () {
+      StreamSubscription<T> subscription = this.listen(null,
+          onError: controller._addError, // Avoid Zone error replacement.
+          onDone: controller.close);
+      subscription.onData((T event) {
+        Stream<E>? newStream;
         try {
           newStream = convert(event);
         } catch (e, s) {
@@ -585,30 +579,14 @@
           subscription.pause();
           controller.addStream(newStream).whenComplete(subscription.resume);
         }
-      },
-          onError: controller._addError, // Avoid Zone error replacement.
-          onDone: controller.close);
-    }
-
-    if (this.isBroadcast) {
-      controller = new StreamController<E>.broadcast(
-          onListen: onListen,
-          onCancel: () {
-            subscription.cancel();
-          },
-          sync: true);
-    } else {
-      controller = new StreamController<E>(
-          onListen: onListen,
-          onPause: () {
-            subscription.pause();
-          },
-          onResume: () {
-            subscription.resume();
-          },
-          onCancel: () => subscription.cancel(),
-          sync: true);
-    }
+      });
+      controller.onCancel = subscription.cancel;
+      if (!isBroadcast) {
+        controller
+          ..onPause = subscription.pause
+          ..onResume = subscription.resume;
+      }
+    };
     return controller.stream;
   }
 
@@ -618,8 +596,8 @@
    * If this stream sends an error that matches [test], then it is intercepted
    * by the [onError] function.
    *
-   * The [onError] callback must be of type `void onError(error)` or
-   * `void onError(error, StackTrace stackTrace)`.
+   * The [onError] callback must be of type `void onError(Object error)` or
+   * `void onError(Object error, StackTrace stackTrace)`.
    * The function type determines whether [onError] is invoked with a stack
    * trace argument.
    * The stack trace argument may be `null` if this stream received an error
@@ -644,7 +622,7 @@
    * If a broadcast stream is listened to more than once, each subscription
    * will individually perform the `test` and handle the error.
    */
-  Stream<T> handleError(Function onError, {bool test(error)}) {
+  Stream<T> handleError(Function onError, {bool test(error)?}) {
     return new _HandleErrorStream<T>(this, onError, test);
   }
 
@@ -744,35 +722,32 @@
   Future<T> reduce(T combine(T previous, T element)) {
     _Future<T> result = new _Future<T>();
     bool seenFirst = false;
-    T value;
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T element) {
-          if (seenFirst) {
-            _runUserCode(() => combine(value, element), (T newValue) {
-              value = newValue;
-            }, _cancelAndErrorClosure(subscription, result));
-          } else {
-            value = element;
-            seenFirst = true;
-          }
-        },
-        onError: result._completeError,
-        onDone: () {
-          if (!seenFirst) {
-            try {
-              // Throw and recatch, instead of just doing
-              //  _completeWithErrorCallback, e, theError, StackTrace.current),
-              // to ensure that the stackTrace is set on the error.
-              throw IterableElementError.noElement();
-            } catch (e, s) {
-              _completeWithErrorCallback(result, e, s);
-            }
-          } else {
-            result._complete(value);
-          }
-        },
-        cancelOnError: true);
+    late T value;
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: result._completeError, onDone: () {
+      if (!seenFirst) {
+        try {
+          // Throw and recatch, instead of just doing
+          //  _completeWithErrorCallback, e, theError, StackTrace.current),
+          // to ensure that the stackTrace is set on the error.
+          throw IterableElementError.noElement();
+        } catch (e, s) {
+          _completeWithErrorCallback(result, e, s);
+        }
+      } else {
+        result._complete(value);
+      }
+    }, cancelOnError: true);
+    subscription.onData((T element) {
+      if (seenFirst) {
+        _runUserCode(() => combine(value, element), (T newValue) {
+          value = newValue;
+        }, _cancelAndErrorClosure(subscription, result));
+      } else {
+        value = element;
+        seenFirst = true;
+      }
+    });
     return result;
   }
 
@@ -796,18 +771,15 @@
   Future<S> fold<S>(S initialValue, S combine(S previous, T element)) {
     _Future<S> result = new _Future<S>();
     S value = initialValue;
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T element) {
-          _runUserCode(() => combine(value, element), (S newValue) {
-            value = newValue;
-          }, _cancelAndErrorClosure(subscription, result));
-        },
-        onError: result._completeError,
-        onDone: () {
-          result._complete(value);
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: result._completeError, onDone: () {
+      result._complete(value);
+    }, cancelOnError: true);
+    subscription.onData((T element) {
+      _runUserCode(() => combine(value, element), (S newValue) {
+        value = newValue;
+      }, _cancelAndErrorClosure(subscription, result));
+    });
     return result;
   }
 
@@ -828,25 +800,30 @@
   Future<String> join([String separator = ""]) {
     _Future<String> result = new _Future<String>();
     StringBuffer buffer = new StringBuffer();
-    StreamSubscription subscription;
     bool first = true;
-    subscription = this.listen(
-        (T element) {
-          if (!first) {
-            buffer.write(separator);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: result._completeError, onDone: () {
+      result._complete(buffer.toString());
+    }, cancelOnError: true);
+    subscription.onData(separator.isEmpty
+        ? (T element) {
+            try {
+              buffer.write(element);
+            } catch (e, s) {
+              _cancelAndErrorWithReplacement(subscription, result, e, s);
+            }
           }
-          first = false;
-          try {
-            buffer.write(element);
-          } catch (e, s) {
-            _cancelAndErrorWithReplacement(subscription, result, e, s);
-          }
-        },
-        onError: result._completeError,
-        onDone: () {
-          result._complete(buffer.toString());
-        },
-        cancelOnError: true);
+        : (T element) {
+            if (!first) {
+              buffer.write(separator);
+            }
+            first = false;
+            try {
+              buffer.write(element);
+            } catch (e, s) {
+              _cancelAndErrorWithReplacement(subscription, result, e, s);
+            }
+          });
     return result;
   }
 
@@ -862,22 +839,19 @@
    * the returned future is completed with that error,
    * and processing stops.
    */
-  Future<bool> contains(Object needle) {
+  Future<bool> contains(Object? needle) {
     _Future<bool> future = new _Future<bool>();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T element) {
-          _runUserCode(() => (element == needle), (bool isMatch) {
-            if (isMatch) {
-              _cancelAndValue(subscription, future, true);
-            }
-          }, _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(false);
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      future._complete(false);
+    }, cancelOnError: true);
+    subscription.onData((T element) {
+      _runUserCode(() => (element == needle), (bool isMatch) {
+        if (isMatch) {
+          _cancelAndValue(subscription, future, true);
+        }
+      }, _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -893,18 +867,14 @@
    */
   Future forEach(void action(T element)) {
     _Future future = new _Future();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T element) {
-          // TODO(floitsch): the type should be 'void' and inferred.
-          _runUserCode<dynamic>(() => action(element), (_) {},
-              _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(null);
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      future._complete(null);
+    }, cancelOnError: true);
+    subscription.onData((T element) {
+      _runUserCode<void>(() => action(element), (_) {},
+          _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -924,20 +894,17 @@
    */
   Future<bool> every(bool test(T element)) {
     _Future<bool> future = new _Future<bool>();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T element) {
-          _runUserCode(() => test(element), (bool isMatch) {
-            if (!isMatch) {
-              _cancelAndValue(subscription, future, false);
-            }
-          }, _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(true);
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      future._complete(true);
+    }, cancelOnError: true);
+    subscription.onData((T element) {
+      _runUserCode(() => test(element), (bool isMatch) {
+        if (!isMatch) {
+          _cancelAndValue(subscription, future, false);
+        }
+      }, _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -957,20 +924,17 @@
    */
   Future<bool> any(bool test(T element)) {
     _Future<bool> future = new _Future<bool>();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T element) {
-          _runUserCode(() => test(element), (bool isMatch) {
-            if (isMatch) {
-              _cancelAndValue(subscription, future, true);
-            }
-          }, _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(false);
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      future._complete(false);
+    }, cancelOnError: true);
+    subscription.onData((T element) {
+      _runUserCode(() => test(element), (bool isMatch) {
+        if (isMatch) {
+          _cancelAndValue(subscription, future, true);
+        }
+      }, _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -1018,16 +982,13 @@
    */
   Future<bool> get isEmpty {
     _Future<bool> future = new _Future<bool>();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (_) {
-          _cancelAndValue(subscription, future, false);
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(true);
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      future._complete(true);
+    }, cancelOnError: true);
+    subscription.onData((_) {
+      _cancelAndValue(subscription, future, false);
+    });
     return future;
   }
 
@@ -1109,9 +1070,15 @@
    *
    * In case of a `done` event the future completes with the given
    * [futureValue].
+   *
+   * The [futureValue] must not be omitted if `null` is not assignable to [E].
    */
-  Future<E> drain<E>([E futureValue]) =>
-      listen(null, cancelOnError: true).asFuture<E>(futureValue);
+  Future<E> drain<E>([E? futureValue]) {
+    if (futureValue == null) {
+      futureValue = futureValue as E;
+    }
+    return listen(null, cancelOnError: true).asFuture<E>(futureValue);
+  }
 
   /**
    * Provides at most the first [count] data events of this stream.
@@ -1226,7 +1193,7 @@
    * If a broadcast stream is listened to more than once, each subscription
    * will individually perform the `equals` test.
    */
-  Stream<T> distinct([bool equals(T previous, T next)]) {
+  Stream<T> distinct([bool equals(T previous, T next)?]) {
     return new _DistinctStream<T>(this, equals);
   }
 
@@ -1250,20 +1217,17 @@
    */
   Future<T> get first {
     _Future<T> future = new _Future<T>();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T value) {
-          _cancelAndValue(subscription, future, value);
-        },
-        onError: future._completeError,
-        onDone: () {
-          try {
-            throw IterableElementError.noElement();
-          } catch (e, s) {
-            _completeWithErrorCallback(future, e, s);
-          }
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      try {
+        throw IterableElementError.noElement();
+      } catch (e, s) {
+        _completeWithErrorCallback(future, e, s);
+      }
+    }, cancelOnError: true);
+    subscription.onData((T value) {
+      _cancelAndValue(subscription, future, value);
+    });
     return future;
   }
 
@@ -1279,7 +1243,7 @@
    */
   Future<T> get last {
     _Future<T> future = new _Future<T>();
-    T result;
+    late T result;
     bool foundResult = false;
     listen(
         (T value) {
@@ -1314,36 +1278,33 @@
    */
   Future<T> get single {
     _Future<T> future = new _Future<T>();
-    T result;
+    late T result;
     bool foundResult = false;
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T value) {
-          if (foundResult) {
-            // This is the second element we get.
-            try {
-              throw IterableElementError.tooMany();
-            } catch (e, s) {
-              _cancelAndErrorWithReplacement(subscription, future, e, s);
-            }
-            return;
-          }
-          foundResult = true;
-          result = value;
-        },
-        onError: future._completeError,
-        onDone: () {
-          if (foundResult) {
-            future._complete(result);
-            return;
-          }
-          try {
-            throw IterableElementError.noElement();
-          } catch (e, s) {
-            _completeWithErrorCallback(future, e, s);
-          }
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      if (foundResult) {
+        future._complete(result);
+        return;
+      }
+      try {
+        throw IterableElementError.noElement();
+      } catch (e, s) {
+        _completeWithErrorCallback(future, e, s);
+      }
+    }, cancelOnError: true);
+    subscription.onData((T value) {
+      if (foundResult) {
+        // This is the second element we get.
+        try {
+          throw IterableElementError.tooMany();
+        } catch (e, s) {
+          _cancelAndErrorWithReplacement(subscription, future, e, s);
+        }
+        return;
+      }
+      foundResult = true;
+      result = value;
+    });
     return future;
   }
 
@@ -1372,30 +1333,29 @@
    * with no [orElse] function provided,
    * the returned future is completed with an error.
    */
-  Future<T> firstWhere(bool test(T element), {T orElse()}) {
+  Future<T> firstWhere(bool test(T element), {T orElse()?}) {
     _Future<T> future = new _Future();
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T value) {
-          _runUserCode(() => test(value), (bool isMatch) {
-            if (isMatch) {
-              _cancelAndValue(subscription, future, value);
-            }
-          }, _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
-          if (orElse != null) {
-            _runUserCode(orElse, future._complete, future._completeError);
-            return;
-          }
-          try {
-            throw IterableElementError.noElement();
-          } catch (e, s) {
-            _completeWithErrorCallback(future, e, s);
-          }
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      if (orElse != null) {
+        _runUserCode(orElse, future._complete, future._completeError);
+        return;
+      }
+      try {
+        // Sets stackTrace on error.
+        throw IterableElementError.noElement();
+      } catch (e, s) {
+        _completeWithErrorCallback(future, e, s);
+      }
+    }, cancelOnError: true);
+
+    subscription.onData((T value) {
+      _runUserCode(() => test(value), (bool isMatch) {
+        if (isMatch) {
+          _cancelAndValue(subscription, future, value);
+        }
+      }, _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -1410,37 +1370,35 @@
    * That means that a non-error result cannot be provided before this stream
    * is done.
    */
-  Future<T> lastWhere(bool test(T element), {T orElse()}) {
+  Future<T> lastWhere(bool test(T element), {T orElse()?}) {
     _Future<T> future = new _Future();
-    T result;
+    late T result;
     bool foundResult = false;
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T value) {
-          _runUserCode(() => true == test(value), (bool isMatch) {
-            if (isMatch) {
-              foundResult = true;
-              result = value;
-            }
-          }, _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
-          if (foundResult) {
-            future._complete(result);
-            return;
-          }
-          if (orElse != null) {
-            _runUserCode(orElse, future._complete, future._completeError);
-            return;
-          }
-          try {
-            throw IterableElementError.noElement();
-          } catch (e, s) {
-            _completeWithErrorCallback(future, e, s);
-          }
-        },
-        cancelOnError: true);
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      if (foundResult) {
+        future._complete(result);
+        return;
+      }
+      if (orElse != null) {
+        _runUserCode(orElse, future._complete, future._completeError);
+        return;
+      }
+      try {
+        throw IterableElementError.noElement();
+      } catch (e, s) {
+        _completeWithErrorCallback(future, e, s);
+      }
+    }, cancelOnError: true);
+
+    subscription.onData((T value) {
+      _runUserCode(() => test(value), (bool isMatch) {
+        if (isMatch) {
+          foundResult = true;
+          result = value;
+        }
+      }, _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -1450,45 +1408,43 @@
    * Like [lastWhere], except that it is an error if more than one
    * matching element occurs in this stream.
    */
-  Future<T> singleWhere(bool test(T element), {T orElse()}) {
+  Future<T> singleWhere(bool test(T element), {T orElse()?}) {
     _Future<T> future = new _Future<T>();
-    T result;
+    late T result;
     bool foundResult = false;
-    StreamSubscription subscription;
-    subscription = this.listen(
-        (T value) {
-          _runUserCode(() => true == test(value), (bool isMatch) {
-            if (isMatch) {
-              if (foundResult) {
-                try {
-                  throw IterableElementError.tooMany();
-                } catch (e, s) {
-                  _cancelAndErrorWithReplacement(subscription, future, e, s);
-                }
-                return;
-              }
-              foundResult = true;
-              result = value;
-            }
-          }, _cancelAndErrorClosure(subscription, future));
-        },
-        onError: future._completeError,
-        onDone: () {
+    StreamSubscription<T> subscription =
+        this.listen(null, onError: future._completeError, onDone: () {
+      if (foundResult) {
+        future._complete(result);
+        return;
+      }
+      if (orElse != null) {
+        _runUserCode(orElse, future._complete, future._completeError);
+        return;
+      }
+      try {
+        throw IterableElementError.noElement();
+      } catch (e, s) {
+        _completeWithErrorCallback(future, e, s);
+      }
+    }, cancelOnError: true);
+
+    subscription.onData((T value) {
+      _runUserCode(() => test(value), (bool isMatch) {
+        if (isMatch) {
           if (foundResult) {
-            future._complete(result);
+            try {
+              throw IterableElementError.tooMany();
+            } catch (e, s) {
+              _cancelAndErrorWithReplacement(subscription, future, e, s);
+            }
             return;
           }
-          try {
-            if (orElse != null) {
-              _runUserCode(orElse, future._complete, future._completeError);
-              return;
-            }
-            throw IterableElementError.noElement();
-          } catch (e, s) {
-            _completeWithErrorCallback(future, e, s);
-          }
-        },
-        cancelOnError: true);
+          foundResult = true;
+          result = value;
+        }
+      }, _cancelAndErrorClosure(subscription, future));
+    });
     return future;
   }
 
@@ -1509,26 +1465,25 @@
    * with a [RangeError].
    */
   Future<T> elementAt(int index) {
-    ArgumentError.checkNotNull(index, "index");
     RangeError.checkNotNegative(index, "index");
-    _Future<T> future = new _Future<T>();
-    StreamSubscription subscription;
+    _Future<T> result = new _Future<T>();
     int elementIndex = 0;
-    subscription = this.listen(
-        (T value) {
-          if (index == elementIndex) {
-            _cancelAndValue(subscription, future, value);
-            return;
-          }
-          elementIndex += 1;
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._completeError(
-              new RangeError.index(index, this, "index", null, elementIndex));
-        },
-        cancelOnError: true);
-    return future;
+    StreamSubscription<T> subscription;
+    subscription =
+        this.listen(null, onError: result._completeError, onDone: () {
+      result._completeError(
+          new RangeError.index(index, this, "index", null, elementIndex),
+          StackTrace.empty);
+    }, cancelOnError: true);
+    subscription.onData((T value) {
+      if (index == elementIndex) {
+        _cancelAndValue(subscription, result, value);
+        return;
+      }
+      elementIndex += 1;
+    });
+
+    return result;
   }
 
   /**
@@ -1558,81 +1513,78 @@
    * will have its individually timer that starts counting on listen,
    * and the subscriptions' timers can be paused individually.
    */
-  Stream<T> timeout(Duration timeLimit, {void onTimeout(EventSink<T> sink)}) {
+  Stream<T> timeout(Duration timeLimit, {void onTimeout(EventSink<T> sink)?}) {
     _StreamControllerBase<T> controller;
-    // The following variables are set on listen.
-    StreamSubscription<T> subscription;
-    Timer timer;
-    Zone zone;
-    _TimerCallback timeout;
-
-    void onData(T event) {
-      timer.cancel();
-      timer = zone.createTimer(timeLimit, timeout);
-      // It might close the stream and cancel timer, so create recuring Timer
-      // before calling into add();
-      // issue: https://github.com/dart-lang/sdk/issues/37565
-      controller.add(event);
+    if (isBroadcast) {
+      controller = new _SyncBroadcastStreamController<T>(null, null);
+    } else {
+      controller = new _SyncStreamController<T>(null, null, null, null);
     }
 
-    void onError(error, StackTrace stackTrace) {
-      timer.cancel();
-      assert(controller is _StreamController ||
-          controller is _BroadcastStreamController);
-      controller._addError(error, stackTrace); // Avoid Zone error replacement.
-      timer = zone.createTimer(timeLimit, timeout);
+    Zone zone = Zone.current;
+    // Register callback immediately.
+    _TimerCallback timeoutCallback;
+    if (onTimeout == null) {
+      timeoutCallback = () {
+        controller.addError(
+            new TimeoutException("No stream event", timeLimit), null);
+      };
+    } else {
+      // TODO(floitsch): the return type should be 'void', and the type
+      // should be inferred.
+      var registeredOnTimeout =
+          zone.registerUnaryCallback<void, EventSink<T>>(onTimeout);
+      var wrapper = new _ControllerEventSinkWrapper<T>(null);
+      timeoutCallback = () {
+        wrapper._sink = controller; // Only valid during call.
+        zone.runUnaryGuarded(registeredOnTimeout, wrapper);
+        wrapper._sink = null;
+      };
     }
 
-    void onDone() {
-      timer.cancel();
-      controller.close();
-    }
-
-    void onListen() {
-      // This is the onListen callback for of controller.
-      // It runs in the same zone that the subscription was created in.
-      // Use that zone for creating timers and running the onTimeout
-      // callback.
-      zone = Zone.current;
-      if (onTimeout == null) {
-        timeout = () {
-          controller.addError(
-              new TimeoutException("No stream event", timeLimit), null);
-        };
-      } else {
-        // TODO(floitsch): the return type should be 'void', and the type
-        // should be inferred.
-        var registeredOnTimeout =
-            zone.registerUnaryCallback<dynamic, EventSink<T>>(onTimeout);
-        var wrapper = new _ControllerEventSinkWrapper<T>(null);
-        timeout = () {
-          wrapper._sink = controller; // Only valid during call.
-          zone.runUnaryGuarded(registeredOnTimeout, wrapper);
-          wrapper._sink = null;
-        };
-      }
-
-      subscription = this.listen(onData, onError: onError, onDone: onDone);
-      timer = zone.createTimer(timeLimit, timeout);
-    }
-
-    Future onCancel() {
-      timer.cancel();
-      Future result = subscription.cancel();
-      subscription = null;
-      return result;
-    }
-
-    controller = isBroadcast
-        ? new _SyncBroadcastStreamController<T>(onListen, onCancel)
-        : new _SyncStreamController<T>(onListen, () {
-            // Don't null the timer, onCancel may call cancel again.
+    // All further setup happens inside `onListen`.
+    controller.onListen = () {
+      Timer timer = zone.createTimer(timeLimit, timeoutCallback);
+      var subscription = this.listen(null);
+      // Set up event forwarding. Each data or error event resets the timer
+      subscription
+        ..onData((T event) {
+          timer.cancel();
+          timer = zone.createTimer(timeLimit, timeoutCallback);
+          // Controller is synchronous, and the call might close the stream
+          // and cancel the timer,
+          // so create the Timer before calling into add();
+          // issue: https://github.com/dart-lang/sdk/issues/37565
+          controller.add(event);
+        })
+        ..onError((Object error, StackTrace stackTrace) {
+          timer.cancel();
+          timer = zone.createTimer(timeLimit, timeoutCallback);
+          controller._addError(
+              error, stackTrace); // Avoid Zone error replacement.
+        })
+        ..onDone(() {
+          timer.cancel();
+          controller.close();
+        });
+      // Set up further controller callbacks.
+      controller.onCancel = () {
+        timer.cancel();
+        return subscription.cancel();
+      };
+      if (!isBroadcast) {
+        controller
+          ..onPause = () {
             timer.cancel();
             subscription.pause();
-          }, () {
+          }
+          ..onResume = () {
             subscription.resume();
-            timer = zone.createTimer(timeLimit, timeout);
-          }, onCancel);
+            timer = zone.createTimer(timeLimit, timeoutCallback);
+          };
+      }
+    };
+
     return controller.stream;
   }
 }
@@ -1660,10 +1612,7 @@
    * Returns a future that is completed once the stream has finished
    * its cleanup.
    *
-   * Historically returned `null` if no cleanup was necessary.
-   * Returning `null` is deprecated and should be avoided.
-   *
-   * Typically, futures are returned when the stream needs to release resources.
+   * Typically, cleanup happens when the stream needs to release resources.
    * For example, a stream might need to close an open file (as an asynchronous
    * operation). If the listener wants to delete the file after having
    * canceled the subscription, it must wait for the cleanup future to complete.
@@ -1683,7 +1632,7 @@
    * This method replaces the current handler set by the invocation of
    * [Stream.listen] or by a previous call to [onData].
    */
-  void onData(void handleData(T data));
+  void onData(void handleData(T data)?);
 
   /**
    * Replaces the error event handler of this subscription.
@@ -1702,7 +1651,7 @@
    * This method replaces the current handler set by the invocation of
    * [Stream.listen], by calling [asFuture], or by a previous call to [onError].
    */
-  void onError(Function handleError);
+  void onError(Function? handleError);
 
   /**
    * Replaces the done event handler of this subscription.
@@ -1713,7 +1662,7 @@
    * This method replaces the current handler set by the invocation of
    * [Stream.listen], by calling [asFuture], or by a previous call to [onDone].
    */
-  void onDone(void handleDone());
+  void onDone(void handleDone()?);
 
   /**
    * Request that the stream pauses events until further notice.
@@ -1750,7 +1699,7 @@
    * Currently DOM streams silently drop events when the stream is paused. This
    * is a bug and will be fixed.
    */
-  void pause([Future resumeSignal]);
+  void pause([Future<void>? resumeSignal]);
 
   /**
    * Resume after a pause.
@@ -1788,8 +1737,12 @@
    *
    * In case of a `done` event the future completes with the given
    * [futureValue].
+   *
+   * If [futureValue] is omitted, the value `null as E` is used as a default.
+   * If `E` is not nullable, this will throw immediately when [asFuture]
+   * is called.
    */
-  Future<E> asFuture<E>([E futureValue]);
+  Future<E> asFuture<E>([E? futureValue]);
 }
 
 /**
@@ -1813,11 +1766,9 @@
   /**
    * Adds an [error] to the sink.
    *
-   * The [error] must not be `null`.
-   *
    * Must not be called on a closed sink.
    */
-  void addError(Object error, [StackTrace stackTrace]);
+  void addError(Object error, [StackTrace? stackTrace]);
 
   /**
    * Closes the sink.
@@ -1840,12 +1791,12 @@
   bool get isBroadcast => _stream.isBroadcast;
 
   Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription),
-          void onCancel(StreamSubscription<T> subscription)}) =>
+          {void onListen(StreamSubscription<T> subscription)?,
+          void onCancel(StreamSubscription<T> subscription)?}) =>
       _stream.asBroadcastStream(onListen: onListen, onCancel: onCancel);
 
-  StreamSubscription<T> listen(void onData(T value),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<T> listen(void onData(T value)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -2098,9 +2049,9 @@
    * ```
    */
   factory StreamTransformer.fromHandlers(
-      {void handleData(S data, EventSink<T> sink),
-      void handleError(Object error, StackTrace stackTrace, EventSink<T> sink),
-      void handleDone(EventSink<T> sink)}) = _StreamHandlerTransformer<S, T>;
+      {void handleData(S data, EventSink<T> sink)?,
+      void handleError(Object error, StackTrace stackTrace, EventSink<T> sink)?,
+      void handleDone(EventSink<T> sink)?}) = _StreamHandlerTransformer<S, T>;
 
   /**
    * Creates a [StreamTransformer] based on a [bind] callback.
@@ -2258,18 +2209,24 @@
  * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
  */
 class _ControllerEventSinkWrapper<T> implements EventSink<T> {
-  EventSink _sink;
+  EventSink? _sink;
   _ControllerEventSinkWrapper(this._sink);
 
-  void add(T data) {
-    _sink.add(data);
+  EventSink _ensureSink() {
+    var sink = _sink;
+    if (sink == null) throw StateError("Sink not available");
+    return sink;
   }
 
-  void addError(error, [StackTrace stackTrace]) {
-    _sink.addError(error, stackTrace);
+  void add(T data) {
+    _ensureSink().add(data);
+  }
+
+  void addError(error, [StackTrace? stackTrace]) {
+    _ensureSink().addError(error, stackTrace);
   }
 
   void close() {
-    _sink.close();
+    _ensureSink().close();
   }
 }
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index 396c53d..9688dd1 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.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.6
-
 part of dart.async;
 
 // -------------------------------------------------------------------
@@ -17,10 +15,8 @@
 
 /**
  * Type of stream controller `onCancel` callbacks.
- *
- * The callback may return either `void` or a future.
  */
-typedef ControllerCancelCallback();
+typedef FutureOr<void> ControllerCancelCallback();
 
 /**
  * A controller with the stream it controls.
@@ -74,18 +70,18 @@
    * [onCancel] should return a future that completes when the cancel operation
    * is done.
    *
-   * If the stream is canceled before the controller needs new data the
+   * If the stream is canceled before the controller needs data the
    * [onResume] call might not be executed.
    */
   factory StreamController(
-      {void onListen(),
-      void onPause(),
-      void onResume(),
-      onCancel(),
-      bool sync: false}) {
+      {void onListen()?,
+      void onPause()?,
+      void onResume()?,
+      FutureOr<void> onCancel()?,
+      bool sync = false}) {
     return sync
-        ? new _SyncStreamController<T>(onListen, onPause, onResume, onCancel)
-        : new _AsyncStreamController<T>(onListen, onPause, onResume, onCancel);
+        ? _SyncStreamController<T>(onListen, onPause, onResume, onCancel)
+        : _AsyncStreamController<T>(onListen, onPause, onResume, onCancel);
   }
 
   /**
@@ -140,10 +136,10 @@
    * the [onListen] will be called again.
    */
   factory StreamController.broadcast(
-      {void onListen(), void onCancel(), bool sync: false}) {
+      {void onListen()?, void onCancel()?, bool sync = false}) {
     return sync
-        ? new _SyncBroadcastStreamController<T>(onListen, onCancel)
-        : new _AsyncBroadcastStreamController<T>(onListen, onCancel);
+        ? _SyncBroadcastStreamController<T>(onListen, onCancel)
+        : _AsyncBroadcastStreamController<T>(onListen, onCancel);
   }
 
   /**
@@ -151,9 +147,9 @@
    *
    * May be set to `null`, in which case no callback will happen.
    */
-  ControllerCallback get onListen;
+  void Function()? get onListen;
 
-  void set onListen(void onListenHandler());
+  void set onListen(void onListenHandler()?);
 
   /**
    * The callback which is called when the stream is paused.
@@ -162,9 +158,9 @@
    *
    * Pause related callbacks are not supported on broadcast stream controllers.
    */
-  ControllerCallback get onPause;
+  void Function()? get onPause;
 
-  void set onPause(void onPauseHandler());
+  void set onPause(void onPauseHandler()?);
 
   /**
    * The callback which is called when the stream is resumed.
@@ -173,18 +169,18 @@
    *
    * Pause related callbacks are not supported on broadcast stream controllers.
    */
-  ControllerCallback get onResume;
+  void Function()? get onResume;
 
-  void set onResume(void onResumeHandler());
+  void set onResume(void onResumeHandler()?);
 
   /**
    * The callback which is called when the stream is canceled.
    *
    * May be set to `null`, in which case no callback will happen.
    */
-  ControllerCancelCallback get onCancel;
+  FutureOr<void> Function()? get onCancel;
 
-  void set onCancel(onCancelHandler());
+  void set onCancel(FutureOr<void> onCancelHandler()?);
 
   /**
    * Returns a view of this object that only exposes the [StreamSink] interface.
@@ -237,14 +233,14 @@
   /**
    * Sends or enqueues an error event.
    *
-   * The [error] must not be `null`.
+   * If [error] is `null`, it is replaced by a [NullThrownError].
    *
    * Listeners receive this event at a later microtask. This behavior can be
    * overridden by using `sync` controllers. Note, however, that sync
    * controllers have to satisfy the preconditions mentioned in the
    * documentation of the constructors.
    */
-  void addError(Object error, [StackTrace stackTrace]);
+  void addError(Object error, [StackTrace? stackTrace]);
 
   /**
    * Closes the stream.
@@ -300,9 +296,9 @@
    * forwarded to the controller's stream, and the `addStream` ends
    * after this. If [cancelOnError] is false, all errors are forwarded
    * and only a done event will end the `addStream`.
-   * If [cancelOnError] is omitted, it defaults to false.
+   * If [cancelOnError] is omitted or `null`, it defaults to false.
    */
-  Future addStream(Stream<T> source, {bool cancelOnError});
+  Future addStream(Stream<T> source, {bool? cancelOnError});
 }
 
 /**
@@ -388,12 +384,10 @@
   /**
    * Adds error to the controller's stream.
    *
-   * The [error] must not be `null`.
-   *
    * As [StreamController.addError], but must not be called while an event is
    * being added by [add], [addError] or [close].
    */
-  void addError(Object error, [StackTrace stackTrace]);
+  void addError(Object error, [StackTrace? stackTrace]);
 
   /**
    * Closes the controller's stream.
@@ -405,11 +399,11 @@
 }
 
 abstract class _StreamControllerLifecycle<T> {
-  StreamSubscription<T> _subscribe(
-      void onData(T data), Function onError, void onDone(), bool cancelOnError);
+  StreamSubscription<T> _subscribe(void onData(T data)?, Function? onError,
+      void onDone()?, bool cancelOnError);
   void _recordPause(StreamSubscription<T> subscription) {}
   void _recordResume(StreamSubscription<T> subscription) {}
-  Future _recordCancel(StreamSubscription<T> subscription) => null;
+  Future<void>? _recordCancel(StreamSubscription<T> subscription) => null;
 }
 
 // Base type for implementations of stream controllers.
@@ -479,10 +473,11 @@
    *
    * While [_state] is [_STATE_SUBSCRIBED], the field contains the subscription.
    *
-   * When [_state] is [_STATE_CANCELED] the field is currently not used.
+   * When [_state] is [_STATE_CANCELED] the field is currently not used,
+   * and will contain `null`.
    */
   @pragma("vm:entry-point")
-  var _varData;
+  Object? _varData;
 
   /** Current state of the controller. */
   @pragma("vm:entry-point")
@@ -496,22 +491,22 @@
   // TODO(lrn): Could this be stored in the varData field too, if it's not
   // accessed until the call to "close"? Then we need to special case if it's
   // accessed earlier, or if close is called before subscribing.
-  _Future _doneFuture;
+  _Future<void>? _doneFuture;
 
-  ControllerCallback onListen;
-  ControllerCallback onPause;
-  ControllerCallback onResume;
-  ControllerCancelCallback onCancel;
+  void Function()? onListen;
+  void Function()? onPause;
+  void Function()? onResume;
+  FutureOr<void> Function()? onCancel;
 
   _StreamController(this.onListen, this.onPause, this.onResume, this.onCancel);
 
   // Return a new stream every time. The streams are equal, but not identical.
-  Stream<T> get stream => new _ControllerStream<T>(this);
+  Stream<T> get stream => _ControllerStream<T>(this);
 
   /**
    * Returns a view of this object that only exposes the [StreamSink] interface.
    */
-  StreamSink<T> get sink => new _StreamSinkWrapper<T>(this);
+  StreamSink<T> get sink => _StreamSinkWrapper<T>(this);
 
   /**
    * Whether a listener has existed and been canceled.
@@ -544,12 +539,12 @@
   // stream is listened to.
   // While adding a stream, pending events are moved into the
   // state object to allow the state object to use the _varData field.
-  _PendingEvents<T> get _pendingEvents {
+  _PendingEvents<T>? get _pendingEvents {
     assert(_isInitialState);
     if (!_isAddingStream) {
-      return _varData;
+      return _varData as dynamic;
     }
-    _StreamControllerAddStreamState<T> state = _varData;
+    _StreamControllerAddStreamState<T> state = _varData as dynamic;
     return state.varData;
   }
 
@@ -557,12 +552,18 @@
   _StreamImplEvents<T> _ensurePendingEvents() {
     assert(_isInitialState);
     if (!_isAddingStream) {
-      _varData ??= new _StreamImplEvents<T>();
-      return _varData;
+      Object? events = _varData;
+      if (events == null) {
+        _varData = events = _StreamImplEvents<T>();
+      }
+      return events as dynamic;
     }
-    _StreamControllerAddStreamState<T> state = _varData;
-    if (state.varData == null) state.varData = new _StreamImplEvents<T>();
-    return state.varData;
+    _StreamControllerAddStreamState<T> state = _varData as dynamic;
+    Object? events = state.varData;
+    if (events == null) {
+      state.varData = events = _StreamImplEvents<T>();
+    }
+    return events as dynamic;
   }
 
   // Get the current subscription.
@@ -570,11 +571,12 @@
   // object to allow the state object to use the _varData field.
   _ControllerSubscription<T> get _subscription {
     assert(hasListener);
+    Object? varData = _varData;
     if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData;
-      return addState.varData;
+      _StreamControllerAddStreamState<Object?> streamState = varData as dynamic;
+      varData = streamState.varData;
     }
-    return _varData;
+    return varData as dynamic;
   }
 
   /**
@@ -584,30 +586,35 @@
    */
   Error _badEventState() {
     if (isClosed) {
-      return new StateError("Cannot add event after closing");
+      return StateError("Cannot add event after closing");
     }
     assert(_isAddingStream);
-    return new StateError("Cannot add event while adding a stream");
+    return StateError("Cannot add event while adding a stream");
   }
 
   // StreamSink interface.
-  Future addStream(Stream<T> source, {bool cancelOnError}) {
+  Future addStream(Stream<T> source, {bool? cancelOnError}) {
     if (!_mayAddEvent) throw _badEventState();
-    if (_isCanceled) return new _Future.immediate(null);
+    if (_isCanceled) return _Future.immediate(null);
     _StreamControllerAddStreamState<T> addState =
-        new _StreamControllerAddStreamState<T>(
+        _StreamControllerAddStreamState<T>(
             this, _varData, source, cancelOnError ?? false);
     _varData = addState;
     _state |= _STATE_ADDSTREAM;
     return addState.addStreamFuture;
   }
 
-  Future get done => _ensureDoneFuture();
+  /**
+   * Returns a future that is completed when the stream is done
+   * processing events.
+   *
+   * This happens either when the done event has been sent, or if the
+   * subscriber of a single-subscription stream is cancelled.
+   */
+  Future<void> get done => _ensureDoneFuture();
 
-  Future _ensureDoneFuture() {
-    _doneFuture ??= _isCanceled ? Future._nullFuture : new _Future();
-    return _doneFuture;
-  }
+  Future<void> _ensureDoneFuture() =>
+      _doneFuture ??= _isCanceled ? Future._nullFuture : _Future<void>();
 
   /**
    * Send or enqueue a data event.
@@ -619,19 +626,19 @@
 
   /**
    * Send or enqueue an error event.
-   *
-   * The [error] must not be `null`.
    */
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     if (!_mayAddEvent) throw _badEventState();
-    error = _nonNullError(error);
-    AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+    AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
     if (replacement != null) {
-      error = _nonNullError(replacement.error);
+      error = replacement.error;
       stackTrace = replacement.stackTrace;
+    } else {
+      stackTrace ??= AsyncError.defaultStackTrace(error);
     }
-    stackTrace ??= AsyncError.defaultStackTrace(error);
+    if (stackTrace == null) throw "unreachable"; // TODO(40088)
     _addError(error, stackTrace);
   }
 
@@ -674,7 +681,7 @@
     if (hasListener) {
       _sendData(value);
     } else if (_isInitialState) {
-      _ensurePendingEvents().add(new _DelayedData<T>(value));
+      _ensurePendingEvents().add(_DelayedData<T>(value));
     }
   }
 
@@ -682,14 +689,14 @@
     if (hasListener) {
       _sendError(error, stackTrace);
     } else if (_isInitialState) {
-      _ensurePendingEvents().add(new _DelayedError(error, stackTrace));
+      _ensurePendingEvents().add(_DelayedError(error, stackTrace));
     }
   }
 
   void _close() {
     // End of addStream stream.
     assert(_isAddingStream);
-    _StreamControllerAddStreamState<T> addState = _varData;
+    _StreamControllerAddStreamState<T> addState = _varData as dynamic;
     _varData = addState.varData;
     _state &= ~_STATE_ADDSTREAM;
     addState.complete();
@@ -697,18 +704,18 @@
 
   // _StreamControllerLifeCycle interface
 
-  StreamSubscription<T> _subscribe(void onData(T data), Function onError,
-      void onDone(), bool cancelOnError) {
+  StreamSubscription<T> _subscribe(void onData(T data)?, Function? onError,
+      void onDone()?, bool cancelOnError) {
     if (!_isInitialState) {
-      throw new StateError("Stream has already been listened to.");
+      throw StateError("Stream has already been listened to.");
     }
-    _ControllerSubscription<T> subscription = new _ControllerSubscription<T>(
+    _ControllerSubscription<T> subscription = _ControllerSubscription<T>(
         this, onData, onError, onDone, cancelOnError);
 
-    _PendingEvents<T> pendingEvents = _pendingEvents;
+    _PendingEvents<T>? pendingEvents = _pendingEvents;
     _state |= _STATE_SUBSCRIBED;
     if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData;
+      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
       addState.varData = subscription;
       addState.resume();
     } else {
@@ -722,7 +729,7 @@
     return subscription;
   }
 
-  Future _recordCancel(StreamSubscription<T> subscription) {
+  Future<void>? _recordCancel(StreamSubscription<T> subscription) {
     // When we cancel, we first cancel any stream being added,
     // Then we call `onCancel`, and finally the _doneFuture is completed.
     // If either of addStream's cancel or `onCancel` returns a future,
@@ -731,26 +738,30 @@
     // If more errors happen, we act as if it happens inside nested try/finallys
     // or whenComplete calls, and only the last error ends up in the
     // returned future.
-    Future result;
+    Future<void>? result;
     if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData;
+      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
       result = addState.cancel();
     }
     _varData = null;
     _state =
         (_state & ~(_STATE_SUBSCRIBED | _STATE_ADDSTREAM)) | _STATE_CANCELED;
 
+    var onCancel = this.onCancel;
     if (onCancel != null) {
       if (result == null) {
         // Only introduce a future if one is needed.
         // If _onCancel returns null, no future is needed.
         try {
-          result = onCancel();
+          var cancelResult = onCancel();
+          if (cancelResult is Future<void>) {
+            result = cancelResult;
+          }
         } catch (e, s) {
           // Return the error in the returned future.
           // Complete it asynchronously, so there is time for a listener
           // to handle the error.
-          result = new _Future().._asyncCompleteError(e, s);
+          result = _Future().._asyncCompleteError(e, s);
         }
       } else {
         // Simpler case when we already know that we will return a future.
@@ -759,8 +770,9 @@
     }
 
     void complete() {
-      if (_doneFuture != null && _doneFuture._mayComplete) {
-        _doneFuture._asyncComplete(null);
+      var doneFuture = _doneFuture;
+      if (doneFuture != null && doneFuture._mayComplete) {
+        doneFuture._asyncComplete(null);
       }
     }
 
@@ -775,7 +787,7 @@
 
   void _recordPause(StreamSubscription<T> subscription) {
     if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData;
+      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
       addState.pause();
     }
     _runGuarded(onPause);
@@ -783,7 +795,7 @@
 
   void _recordResume(StreamSubscription<T> subscription) {
     if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData;
+      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
       addState.resume();
     }
     _runGuarded(onResume);
@@ -811,11 +823,11 @@
 abstract class _AsyncStreamControllerDispatch<T>
     implements _StreamController<T> {
   void _sendData(T data) {
-    _subscription._addPending(new _DelayedData<T>(data));
+    _subscription._addPending(_DelayedData<T>(data));
   }
 
   void _sendError(Object error, StackTrace stackTrace) {
-    _subscription._addPending(new _DelayedError(error, stackTrace));
+    _subscription._addPending(_DelayedError(error, stackTrace));
   }
 
   void _sendDone() {
@@ -832,9 +844,7 @@
 class _SyncStreamController<T> = _StreamController<T>
     with _SyncStreamControllerDispatch<T>;
 
-typedef _NotificationHandler();
-
-void _runGuarded(_NotificationHandler notificationHandler) {
+void _runGuarded(void Function()? notificationHandler) {
   if (notificationHandler == null) return;
   try {
     notificationHandler();
@@ -848,8 +858,8 @@
 
   _ControllerStream(this._controller);
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-          Function onError, void onDone(), bool cancelOnError) =>
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+          Function? onError, void onDone()?, bool cancelOnError) =>
       _controller._subscribe(onData, onError, onDone, cancelOnError);
 
   // Override == and hashCode so that new streams returned by the same
@@ -868,11 +878,11 @@
 class _ControllerSubscription<T> extends _BufferingStreamSubscription<T> {
   final _StreamControllerLifecycle<T> _controller;
 
-  _ControllerSubscription(this._controller, void onData(T data),
-      Function onError, void onDone(), bool cancelOnError)
+  _ControllerSubscription(this._controller, void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError)
       : super(onData, onError, onDone, cancelOnError);
 
-  Future _onCancel() {
+  Future<void>? _onCancel() {
     return _controller._recordCancel(this);
   }
 
@@ -893,7 +903,7 @@
     _target.add(data);
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
     _target.addError(error, stackTrace);
   }
 
@@ -916,7 +926,7 @@
 
   _AddStreamState(
       _EventSink<T> controller, Stream<T> source, bool cancelOnError)
-      : addStreamFuture = new _Future(),
+      : addStreamFuture = _Future(),
         addSubscription = source.listen(controller._add,
             onError: cancelOnError
                 ? makeErrorHandler(controller)
@@ -924,7 +934,7 @@
             onDone: controller._close,
             cancelOnError: cancelOnError);
 
-  static makeErrorHandler(_EventSink controller) => (e, StackTrace s) {
+  static makeErrorHandler(_EventSink controller) => (Object e, StackTrace s) {
         controller._addError(e, s);
         controller._close();
       };
@@ -945,11 +955,11 @@
    *
    * Return a future if the cancel takes time, otherwise return `null`.
    */
-  Future cancel() {
+  Future<void> cancel() {
     var cancel = addSubscription.cancel();
     if (cancel == null) {
       addStreamFuture._asyncComplete(null);
-      return null;
+      return Future._nullFuture;
     }
     return cancel.whenComplete(() {
       addStreamFuture._asyncComplete(null);
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index b62ad88..1c6fa50 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.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.6
-
 part of dart.async;
 
 /** Abstract and private interface for a place to put events. */
@@ -93,29 +91,33 @@
   _DataHandler<T> _onData;
   Function _onError;
   _DoneHandler _onDone;
-  final Zone _zone = Zone.current;
+
+  final Zone _zone;
 
   /** Bit vector based on state-constants above. */
   int _state;
 
   // TODO(floitsch): reuse another field
   /** The future [_onCancel] may return. */
-  Future _cancelFuture;
+  Future? _cancelFuture;
 
   /**
    * Queue of pending events.
    *
    * Is created when necessary, or set in constructor for preconfigured events.
    */
-  _PendingEvents<T> _pending;
+  _PendingEvents<T>? _pending;
 
-  _BufferingStreamSubscription(
-      void onData(T data), Function onError, void onDone(), bool cancelOnError)
-      : _state = (cancelOnError ? _STATE_CANCEL_ON_ERROR : 0) {
-    this.onData(onData);
-    this.onError(onError);
-    this.onDone(onDone);
-  }
+  _BufferingStreamSubscription(void onData(T data)?, Function? onError,
+      void onDone()?, bool cancelOnError)
+      : this.zoned(Zone.current, onData, onError, onDone, cancelOnError);
+
+  _BufferingStreamSubscription.zoned(this._zone, void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError)
+      : _state = (cancelOnError ? _STATE_CANCEL_ON_ERROR : 0),
+        _onData = _registerDataHandler<T>(_zone, onData),
+        _onError = _registerErrorHandler(_zone, onError),
+        _onDone = _registerDoneHandler(_zone, onDone);
 
   /**
    * Sets the subscription's pending events object.
@@ -123,51 +125,62 @@
    * This can only be done once. The pending events object is used for the
    * rest of the subscription's life cycle.
    */
-  void _setPendingEvents(_PendingEvents<T> pendingEvents) {
+  void _setPendingEvents(_PendingEvents<T>? pendingEvents) {
     assert(_pending == null);
     if (pendingEvents == null) return;
     _pending = pendingEvents;
     if (!pendingEvents.isEmpty) {
       _state |= _STATE_HAS_PENDING;
-      _pending.schedule(this);
+      pendingEvents.schedule(this);
     }
   }
 
   // StreamSubscription interface.
 
-  void onData(void handleData(T event)) {
-    handleData ??= _nullDataHandler;
-    // TODO(floitsch): the return type should be 'void', and the type
-    // should be inferred.
-    _onData = _zone.registerUnaryCallback<dynamic, T>(handleData);
+  void onData(void handleData(T event)?) {
+    _onData = _registerDataHandler<T>(_zone, handleData);
   }
 
-  void onError(Function handleError) {
+  static void Function(T) _registerDataHandler<T>(
+      Zone zone, void Function(T)? handleData) {
+    return zone.registerUnaryCallback<void, T>(handleData ?? _nullDataHandler);
+  }
+
+  void onError(Function? handleError) {
+    _onError = _registerErrorHandler(_zone, handleError);
+  }
+
+  static Function _registerErrorHandler(Zone zone, Function? handleError) {
+    // TODO(lrn): Consider whether we need to register the null handler.
     handleError ??= _nullErrorHandler;
     if (handleError is void Function(Object, StackTrace)) {
-      _onError = _zone
+      return zone
           .registerBinaryCallback<dynamic, Object, StackTrace>(handleError);
-    } else if (handleError is void Function(Object)) {
-      _onError = _zone.registerUnaryCallback<dynamic, Object>(handleError);
-    } else {
-      throw new ArgumentError("handleError callback must take either an Object "
-          "(the error), or both an Object (the error) and a StackTrace.");
     }
+    if (handleError is void Function(Object)) {
+      return zone.registerUnaryCallback<dynamic, Object>(handleError);
+    }
+    throw new ArgumentError("handleError callback must take either an Object "
+        "(the error), or both an Object (the error) and a StackTrace.");
   }
 
-  void onDone(void handleDone()) {
-    handleDone ??= _nullDoneHandler;
-    _onDone = _zone.registerCallback(handleDone);
+  void onDone(void handleDone()?) {
+    _onDone = _registerDoneHandler(_zone, handleDone);
   }
 
-  void pause([Future resumeSignal]) {
+  static void Function() _registerDoneHandler(
+      Zone zone, void Function()? handleDone) {
+    return zone.registerCallback(handleDone ?? _nullDoneHandler);
+  }
+
+  void pause([Future<void>? resumeSignal]) {
     if (_isCanceled) return;
     bool wasPaused = _isPaused;
     bool wasInputPaused = _isInputPaused;
     // Increment pause count and mark input paused (if it isn't already).
     _state = (_state + _STATE_PAUSE_COUNT) | _STATE_INPUT_PAUSED;
-    if (resumeSignal != null) resumeSignal.whenComplete(resume);
-    if (!wasPaused && _pending != null) _pending.cancelSchedule();
+    resumeSignal?.whenComplete(resume);
+    if (!wasPaused) _pending?.cancelSchedule();
     if (!wasInputPaused && !_inCallback) _guardCallback(_onPause);
   }
 
@@ -176,9 +189,9 @@
     if (_isPaused) {
       _decrementPauseCount();
       if (!_isPaused) {
-        if (_hasPending && !_pending.isEmpty) {
+        if (_hasPending && !_pending!.isEmpty) {
           // Input is still paused.
-          _pending.schedule(this);
+          _pending!.schedule(this);
         } else {
           assert(_mayResumeInput);
           _state &= ~_STATE_INPUT_PAUSED;
@@ -199,14 +212,22 @@
     return _cancelFuture ?? Future._nullFuture;
   }
 
-  Future<E> asFuture<E>([E futureValue]) {
-    _Future<E> result = new _Future<E>();
-
+  Future<E> asFuture<E>([E? futureValue]) {
+    E resultValue;
+    if (futureValue == null) {
+      if (!typeAcceptsNull<E>()) {
+        throw ArgumentError.notNull("futureValue");
+      }
+      resultValue = futureValue as dynamic;
+    } else {
+      resultValue = futureValue;
+    }
     // Overwrite the onDone and onError handlers.
+    _Future<E> result = new _Future<E>();
     _onDone = () {
-      result._complete(futureValue);
+      result._complete(resultValue);
     };
-    _onError = (error, StackTrace stackTrace) {
+    _onError = (Object error, StackTrace stackTrace) {
       Future cancelFuture = cancel();
       if (!identical(cancelFuture, Future._nullFuture)) {
         cancelFuture.whenComplete(() {
@@ -216,7 +237,6 @@
         result._completeError(error, stackTrace);
       }
     };
-
     return result;
   }
 
@@ -230,8 +250,7 @@
   bool get _hasPending => (_state & _STATE_HAS_PENDING) != 0;
   bool get _isPaused => _state >= _STATE_PAUSE_COUNT;
   bool get _canFire => _state < _STATE_IN_CALLBACK;
-  bool get _mayResumeInput =>
-      !_isPaused && (_pending == null || _pending.isEmpty);
+  bool get _mayResumeInput => !_isPaused && (_pending?.isEmpty ?? true);
   bool get _cancelOnError => (_state & _STATE_CANCEL_ON_ERROR) != 0;
 
   bool get isPaused => _isPaused;
@@ -239,7 +258,7 @@
   void _cancel() {
     _state |= _STATE_CANCELED;
     if (_hasPending) {
-      _pending.cancelSchedule();
+      _pending!.cancelSchedule();
     }
     if (!_inCallback) _pending = null;
     _cancelFuture = _onCancel();
@@ -301,7 +320,7 @@
     assert(!_isInputPaused);
   }
 
-  Future _onCancel() {
+  Future<void>? _onCancel() {
     assert(_isCanceled);
     return null;
   }
@@ -315,15 +334,14 @@
    * of pending events later (if necessary).
    */
   void _addPending(_DelayedEvent event) {
-    _StreamImplEvents<T> pending = _pending;
-    if (_pending == null) {
-      pending = _pending = new _StreamImplEvents<T>();
-    }
+    _StreamImplEvents<T>? pending = _pending as dynamic;
+    pending ??= _StreamImplEvents<T>();
+    _pending = pending;
     pending.add(event);
     if (!_hasPending) {
       _state |= _STATE_HAS_PENDING;
       if (!_isPaused) {
-        _pending.schedule(this);
+        pending.schedule(this);
       }
     }
   }
@@ -357,8 +375,7 @@
       if (onError is void Function(Object, StackTrace)) {
         _zone.runBinaryGuarded<Object, StackTrace>(onError, error, stackTrace);
       } else {
-        assert(_onError is void Function(Object));
-        _zone.runUnaryGuarded<Object>(_onError, error);
+        _zone.runUnaryGuarded<Object>(_onError as dynamic, error);
       }
       _state &= ~_STATE_IN_CALLBACK;
     }
@@ -366,9 +383,10 @@
     if (_cancelOnError) {
       _state |= _STATE_WAIT_FOR_CANCEL;
       _cancel();
-      if (_cancelFuture != null &&
-          !identical(_cancelFuture, Future._nullFuture)) {
-        _cancelFuture.whenComplete(sendError);
+      var cancelFuture = _cancelFuture;
+      if (cancelFuture != null &&
+          !identical(cancelFuture, Future._nullFuture)) {
+        cancelFuture.whenComplete(sendError);
       } else {
         sendError();
       }
@@ -395,9 +413,9 @@
 
     _cancel();
     _state |= _STATE_WAIT_FOR_CANCEL;
-    if (_cancelFuture != null &&
-        !identical(_cancelFuture, Future._nullFuture)) {
-      _cancelFuture.whenComplete(sendDone);
+    var cancelFuture = _cancelFuture;
+    if (cancelFuture != null && !identical(cancelFuture, Future._nullFuture)) {
+      cancelFuture.whenComplete(sendDone);
     } else {
       sendDone();
     }
@@ -410,7 +428,7 @@
    * during the call, and it checks for state changes after the call
    * that should cause further callbacks.
    */
-  void _guardCallback(void callback()) {
+  void _guardCallback(void Function() callback) {
     assert(!_inCallback);
     bool wasInputPaused = _isInputPaused;
     _state |= _STATE_IN_CALLBACK;
@@ -431,7 +449,7 @@
    */
   void _checkState(bool wasInputPaused) {
     assert(!_inCallback);
-    if (_hasPending && _pending.isEmpty) {
+    if (_hasPending && _pending!.isEmpty) {
       _state &= ~_STATE_HAS_PENDING;
       if (_isInputPaused && _mayResumeInput) {
         _state &= ~_STATE_INPUT_PAUSED;
@@ -456,7 +474,7 @@
       wasInputPaused = isInputPaused;
     }
     if (_hasPending && !_isPaused) {
-      _pending.schedule(this);
+      _pending!.schedule(this);
     }
   }
 }
@@ -468,9 +486,9 @@
   // ------------------------------------------------------------------
   // Stream interface.
 
-  StreamSubscription<T> listen(void onData(T data),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    cancelOnError = identical(true, cancelOnError);
+  StreamSubscription<T> listen(void onData(T data)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
+    cancelOnError ??= false;
     StreamSubscription<T> subscription =
         _createSubscription(onData, onError, onDone, cancelOnError);
     _onListen(subscription);
@@ -479,8 +497,8 @@
 
   // -------------------------------------------------------------------
   /** Create a subscription object. Called by [subcribe]. */
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
     return new _BufferingStreamSubscription<T>(
         onData, onError, onDone, cancelOnError);
   }
@@ -503,8 +521,8 @@
    */
   _GeneratedStreamImpl(this._pending);
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
     if (_isUsed) throw new StateError("Stream has already been listened to.");
     _isUsed = true;
     return new _BufferingStreamSubscription<T>(
@@ -517,14 +535,15 @@
 class _IterablePendingEvents<T> extends _PendingEvents<T> {
   // The iterator providing data for data events.
   // Set to null when iteration has completed.
-  Iterator<T> _iterator;
+  Iterator<T>? _iterator;
 
   _IterablePendingEvents(Iterable<T> data) : _iterator = data.iterator;
 
   bool get isEmpty => _iterator == null;
 
   void handleNext(_EventDispatch<T> dispatch) {
-    if (_iterator == null) {
+    var iterator = _iterator;
+    if (iterator == null) {
       throw new StateError("No events pending.");
     }
     // Send one event per call to moveNext.
@@ -533,25 +552,23 @@
     // If moveNext returns false, send a done event and clear the _iterator.
     // If moveNext throws an error, send an error and prepare to send a done
     // event afterwards.
-    bool hasMore;
+    bool movedNext = false;
     try {
-      hasMore = _iterator.moveNext();
-      if (hasMore) {
-        dispatch._sendData(_iterator.current);
+      if (iterator.moveNext()) {
+        movedNext = true;
+        dispatch._sendData(iterator.current);
       } else {
         _iterator = null;
         dispatch._sendDone();
       }
     } catch (e, s) {
-      if (hasMore == null) {
+      if (!movedNext) {
         // Threw in .moveNext().
         // Ensure that we send a done afterwards.
-        _iterator = const EmptyIterator<Null>();
-        dispatch._sendError(e, s);
-      } else {
-        // Threw in .current.
-        dispatch._sendError(e, s);
+        _iterator = const EmptyIterator<Never>();
       }
+      // Else threw in .current.
+      dispatch._sendError(e, s);
     }
   }
 
@@ -568,10 +585,10 @@
 typedef void _DoneHandler();
 
 /** Default data handler, does nothing. */
-void _nullDataHandler(Object value) {}
+void _nullDataHandler(dynamic value) {}
 
 /** Default error handler, reports the error to the current zone's handler. */
-void _nullErrorHandler(Object error, [StackTrace stackTrace]) {
+void _nullErrorHandler(Object error, StackTrace stackTrace) {
   Zone.current.handleUncaughtError(error, stackTrace);
 }
 
@@ -581,7 +598,7 @@
 /** A delayed event on a buffering stream subscription. */
 abstract class _DelayedEvent<T> {
   /** Added as a linked list on the [StreamController]. */
-  _DelayedEvent next;
+  _DelayedEvent? next;
   /** Execute the delayed event on the [StreamController]. */
   void perform(_EventDispatch<T> dispatch);
 }
@@ -597,7 +614,7 @@
 
 /** A delayed error event. */
 class _DelayedError extends _DelayedEvent {
-  final error;
+  final Object error;
   final StackTrace stackTrace;
 
   _DelayedError(this.error, this.stackTrace);
@@ -613,9 +630,9 @@
     dispatch._sendDone();
   }
 
-  _DelayedEvent get next => null;
+  _DelayedEvent? get next => null;
 
-  void set next(_DelayedEvent _) {
+  void set next(_DelayedEvent? _) {
     throw new StateError("No events after a done.");
   }
 }
@@ -685,26 +702,29 @@
 /** Class holding pending events for a [_StreamImpl]. */
 class _StreamImplEvents<T> extends _PendingEvents<T> {
   /// Single linked list of [_DelayedEvent] objects.
-  _DelayedEvent firstPendingEvent;
+  _DelayedEvent? firstPendingEvent;
 
   /// Last element in the list of pending events. New events are added after it.
-  _DelayedEvent lastPendingEvent;
+  _DelayedEvent? lastPendingEvent;
 
   bool get isEmpty => lastPendingEvent == null;
 
   void add(_DelayedEvent event) {
-    if (lastPendingEvent == null) {
+    var lastEvent = lastPendingEvent;
+    if (lastEvent == null) {
       firstPendingEvent = lastPendingEvent = event;
     } else {
-      lastPendingEvent = lastPendingEvent.next = event;
+      lastPendingEvent = lastEvent.next = event;
     }
   }
 
   void handleNext(_EventDispatch<T> dispatch) {
     assert(!isScheduled);
-    _DelayedEvent event = firstPendingEvent;
-    firstPendingEvent = event.next;
-    if (firstPendingEvent == null) {
+    assert(!isEmpty);
+    _DelayedEvent event = firstPendingEvent!;
+    _DelayedEvent? nextEvent = event.next;
+    firstPendingEvent = nextEvent;
+    if (nextEvent == null) {
       lastPendingEvent = null;
     }
     event.perform(dispatch);
@@ -728,7 +748,7 @@
 
   final Zone _zone;
   int _state = 0;
-  _DoneHandler _onDone;
+  _DoneHandler? _onDone;
 
   _DoneStreamSubscription(this._onDone) : _zone = Zone.current {
     _schedule();
@@ -744,13 +764,13 @@
     _state |= _SCHEDULED;
   }
 
-  void onData(void handleData(T data)) {}
-  void onError(Function handleError) {}
-  void onDone(void handleDone()) {
+  void onData(void handleData(T data)?) {}
+  void onError(Function? handleError) {}
+  void onDone(void handleDone()?) {
     _onDone = handleDone;
   }
 
-  void pause([Future resumeSignal]) {
+  void pause([Future<void>? resumeSignal]) {
     _state += _PAUSED;
     if (resumeSignal != null) resumeSignal.whenComplete(resume);
   }
@@ -766,10 +786,19 @@
 
   Future cancel() => Future._nullFuture;
 
-  Future<E> asFuture<E>([E futureValue]) {
+  Future<E> asFuture<E>([E? futureValue]) {
+    E resultValue;
+    if (futureValue == null) {
+      if (!typeAcceptsNull<E>()) {
+        throw ArgumentError.notNull("futureValue");
+      }
+      resultValue = futureValue as dynamic;
+    } else {
+      resultValue = futureValue;
+    }
     _Future<E> result = new _Future<E>();
     _onDone = () {
-      result._completeWithValue(futureValue);
+      result._completeWithValue(resultValue);
     };
     return result;
   }
@@ -778,30 +807,31 @@
     _state &= ~_SCHEDULED;
     if (isPaused) return;
     _state |= _DONE_SENT;
-    if (_onDone != null) _zone.runGuarded(_onDone);
+    var doneHandler = _onDone;
+    if (doneHandler != null) _zone.runGuarded(doneHandler);
   }
 }
 
 class _AsBroadcastStream<T> extends Stream<T> {
   final Stream<T> _source;
-  final _BroadcastCallback<T> _onListenHandler;
-  final _BroadcastCallback<T> _onCancelHandler;
+  final _BroadcastCallback<T>? _onListenHandler;
+  final _BroadcastCallback<T>? _onCancelHandler;
   final Zone _zone;
 
-  _AsBroadcastStreamController<T> _controller;
-  StreamSubscription<T> _subscription;
+  _AsBroadcastStreamController<T>? _controller;
+  StreamSubscription<T>? _subscription;
 
   _AsBroadcastStream(
       this._source,
-      void onListenHandler(StreamSubscription<T> subscription),
-      void onCancelHandler(StreamSubscription<T> subscription))
-      // TODO(floitsch): the return type should be void and should be
-      // inferred.
-      : _onListenHandler = Zone.current
-            .registerUnaryCallback<dynamic, StreamSubscription<T>>(
+      void onListenHandler(StreamSubscription<T> subscription)?,
+      void onCancelHandler(StreamSubscription<T> subscription)?)
+      : _onListenHandler = onListenHandler == null
+            ? null
+            : Zone.current.registerUnaryCallback<void, StreamSubscription<T>>(
                 onListenHandler),
-        _onCancelHandler = Zone.current
-            .registerUnaryCallback<dynamic, StreamSubscription<T>>(
+        _onCancelHandler = onCancelHandler == null
+            ? null
+            : Zone.current.registerUnaryCallback<void, StreamSubscription<T>>(
                 onCancelHandler),
         _zone = Zone.current {
     _controller = new _AsBroadcastStreamController<T>(_onListen, _onCancel);
@@ -809,63 +839,64 @@
 
   bool get isBroadcast => true;
 
-  StreamSubscription<T> listen(void onData(T data),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    if (_controller == null || _controller.isClosed) {
+  StreamSubscription<T> listen(void onData(T data)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
+    var controller = _controller;
+    if (controller == null || controller.isClosed) {
       // Return a dummy subscription backed by nothing, since
       // it will only ever send one done event.
       return new _DoneStreamSubscription<T>(onDone);
     }
-    _subscription ??= _source.listen(_controller.add,
-        onError: _controller.addError, onDone: _controller.close);
-    cancelOnError = identical(true, cancelOnError);
-    return _controller._subscribe(onData, onError, onDone, cancelOnError);
+    _subscription ??= _source.listen(controller.add,
+        onError: controller.addError, onDone: controller.close);
+    return controller._subscribe(
+        onData, onError, onDone, cancelOnError ?? false);
   }
 
   void _onCancel() {
-    bool shutdown = (_controller == null) || _controller.isClosed;
-    if (_onCancelHandler != null) {
-      _zone.runUnary(
-          _onCancelHandler, new _BroadcastSubscriptionWrapper<T>(this));
+    var controller = _controller;
+    bool shutdown = (controller == null) || controller.isClosed;
+    var cancelHandler = _onCancelHandler;
+    if (cancelHandler != null) {
+      _zone.runUnary(cancelHandler, new _BroadcastSubscriptionWrapper<T>(this));
     }
     if (shutdown) {
-      if (_subscription != null) {
-        _subscription.cancel();
+      var subscription = _subscription;
+      if (subscription != null) {
+        subscription.cancel();
         _subscription = null;
       }
     }
   }
 
   void _onListen() {
-    if (_onListenHandler != null) {
-      _zone.runUnary(
-          _onListenHandler, new _BroadcastSubscriptionWrapper<T>(this));
+    var listenHandler = _onListenHandler;
+    if (listenHandler != null) {
+      _zone.runUnary(listenHandler, new _BroadcastSubscriptionWrapper<T>(this));
     }
   }
 
   // Methods called from _BroadcastSubscriptionWrapper.
   void _cancelSubscription() {
-    if (_subscription == null) return;
     // Called by [_controller] when it has no subscribers left.
-    StreamSubscription subscription = _subscription;
-    _subscription = null;
-    _controller = null; // Marks the stream as no longer listenable.
-    subscription.cancel();
+    var subscription = _subscription;
+    if (subscription != null) {
+      _subscription = null;
+      _controller = null; // Marks the stream as no longer listenable.
+      subscription.cancel();
+    }
   }
 
-  void _pauseSubscription(Future resumeSignal) {
-    if (_subscription == null) return;
-    _subscription.pause(resumeSignal);
+  void _pauseSubscription(Future<void>? resumeSignal) {
+    _subscription?.pause(resumeSignal);
   }
 
   void _resumeSubscription() {
-    if (_subscription == null) return;
-    _subscription.resume();
+    _subscription?.resume();
   }
 
   bool get _isSubscriptionPaused {
-    if (_subscription == null) return false;
-    return _subscription.isPaused;
+    return _subscription?.isPaused ?? false;
   }
 }
 
@@ -877,22 +908,22 @@
 
   _BroadcastSubscriptionWrapper(this._stream);
 
-  void onData(void handleData(T data)) {
+  void onData(void handleData(T data)?) {
     throw new UnsupportedError(
         "Cannot change handlers of asBroadcastStream source subscription.");
   }
 
-  void onError(Function handleError) {
+  void onError(Function? handleError) {
     throw new UnsupportedError(
         "Cannot change handlers of asBroadcastStream source subscription.");
   }
 
-  void onDone(void handleDone()) {
+  void onDone(void handleDone()?) {
     throw new UnsupportedError(
         "Cannot change handlers of asBroadcastStream source subscription.");
   }
 
-  void pause([Future resumeSignal]) {
+  void pause([Future<void>? resumeSignal]) {
     _stream._pauseSubscription(resumeSignal);
   }
 
@@ -909,7 +940,7 @@
     return _stream._isSubscriptionPaused;
   }
 
-  Future<E> asFuture<E>([E futureValue]) {
+  Future<E> asFuture<E>([E? futureValue]) {
     throw new UnsupportedError(
         "Cannot change handlers of asBroadcastStream source subscription.");
   }
@@ -948,7 +979,7 @@
   /// Subscription being listened to.
   ///
   /// Set to `null` when the stream subscription is done or canceled.
-  StreamSubscription _subscription;
+  StreamSubscription<T>? _subscription;
 
   /// Data value depending on the current state.
   ///
@@ -963,7 +994,7 @@
   /// After calling [moveNext] and the returned future has completed
   /// with `false`, or after calling [cancel]: `null`.
   @pragma("vm:entry-point")
-  Object _stateData;
+  Object? _stateData;
 
   /// Whether the iterator is between calls to `moveNext`.
   /// This will usually cause the [_subscription] to be paused, but as an
@@ -971,23 +1002,25 @@
   /// completed.
   bool _isPaused = false;
 
-  _StreamIterator(final Stream<T> stream)
-      : _stateData = stream ?? (throw ArgumentError.notNull("stream"));
+  _StreamIterator(final Stream<T> stream) : _stateData = stream {
+    ArgumentError.checkNotNull(stream, "stream");
+  }
 
   T get current {
     if (_subscription != null && _isPaused) {
-      return _stateData;
+      return _stateData as dynamic;
     }
-    return null;
+    return null as dynamic;
   }
 
   Future<bool> moveNext() {
-    if (_subscription != null) {
+    var subscription = _subscription;
+    if (subscription != null) {
       if (_isPaused) {
         var future = new _Future<bool>();
         _stateData = future;
         _isPaused = false;
-        _subscription.resume();
+        subscription.resume();
         return future;
       }
       throw new StateError("Already waiting for next.");
@@ -1004,7 +1037,7 @@
     assert(_subscription == null);
     var stateData = _stateData;
     if (stateData != null) {
-      Stream<T> stream = stateData;
+      Stream<T> stream = stateData as dynamic;
       _subscription = stream.listen(_onData,
           onError: _onError, onDone: _onDone, cancelOnError: true);
       var future = new _Future<bool>();
@@ -1015,13 +1048,13 @@
   }
 
   Future cancel() {
-    StreamSubscription<T> subscription = _subscription;
-    Object stateData = _stateData;
+    StreamSubscription<T>? subscription = _subscription;
+    Object? stateData = _stateData;
     _stateData = null;
     if (subscription != null) {
       _subscription = null;
       if (!_isPaused) {
-        _Future<bool> future = stateData;
+        _Future<bool> future = stateData as dynamic;
         future._asyncComplete(false);
       }
       return subscription.cancel();
@@ -1031,16 +1064,16 @@
 
   void _onData(T data) {
     assert(_subscription != null && !_isPaused);
-    _Future<bool> moveNextFuture = _stateData;
+    _Future<bool> moveNextFuture = _stateData as dynamic;
     _stateData = data;
     _isPaused = true;
     moveNextFuture._complete(true);
-    if (_subscription != null && _isPaused) _subscription.pause();
+    if (_isPaused) _subscription?.pause();
   }
 
-  void _onError(Object error, [StackTrace stackTrace]) {
+  void _onError(Object error, StackTrace stackTrace) {
     assert(_subscription != null && !_isPaused);
-    _Future<bool> moveNextFuture = _stateData;
+    _Future<bool> moveNextFuture = _stateData as dynamic;
     _subscription = null;
     _stateData = null;
     moveNextFuture._completeError(error, stackTrace);
@@ -1048,7 +1081,7 @@
 
   void _onDone() {
     assert(_subscription != null && !_isPaused);
-    _Future<bool> moveNextFuture = _stateData;
+    _Future<bool> moveNextFuture = _stateData as dynamic;
     _subscription = null;
     _stateData = null;
     moveNextFuture._complete(false);
@@ -1059,8 +1092,8 @@
 class _EmptyStream<T> extends Stream<T> {
   const _EmptyStream() : super._internal();
   bool get isBroadcast => true;
-  StreamSubscription<T> listen(void onData(T data),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<T> listen(void onData(T data)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return new _DoneStreamSubscription<T>(onDone);
   }
 }
diff --git a/sdk/lib/async/stream_pipe.dart b/sdk/lib/async/stream_pipe.dart
index 5771db4..fd20228 100644
--- a/sdk/lib/async/stream_pipe.dart
+++ b/sdk/lib/async/stream_pipe.dart
@@ -2,21 +2,19 @@
 // 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.6
-
 part of dart.async;
 
 /** Runs user code and takes actions depending on success or failure. */
-_runUserCode<T>(
-    T userCode(), onSuccess(T value), onError(error, StackTrace stackTrace)) {
+_runUserCode<T>(T userCode(), onSuccess(T value),
+    onError(Object error, StackTrace stackTrace)) {
   try {
     onSuccess(userCode());
   } catch (e, s) {
-    AsyncError replacement = Zone.current.errorCallback(e, s);
+    AsyncError? replacement = Zone.current.errorCallback(e, s);
     if (replacement == null) {
       onError(e, s);
     } else {
-      var error = _nonNullError(replacement.error);
+      var error = replacement.error;
       var stackTrace = replacement.stackTrace;
       onError(error, stackTrace);
     }
@@ -25,8 +23,8 @@
 
 /** Helper function to cancel a subscription and wait for the potential future,
   before completing with an error. */
-void _cancelAndError(StreamSubscription subscription, _Future future, error,
-    StackTrace stackTrace) {
+void _cancelAndError(StreamSubscription subscription, _Future future,
+    Object error, StackTrace stackTrace) {
   var cancelFuture = subscription.cancel();
   if (cancelFuture != null && !identical(cancelFuture, Future._nullFuture)) {
     cancelFuture.whenComplete(() => future._completeError(error, stackTrace));
@@ -36,21 +34,19 @@
 }
 
 void _cancelAndErrorWithReplacement(StreamSubscription subscription,
-    _Future future, error, StackTrace stackTrace) {
-  AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+    _Future future, Object error, StackTrace stackTrace) {
+  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
   if (replacement != null) {
-    error = _nonNullError(replacement.error);
+    error = replacement.error;
     stackTrace = replacement.stackTrace;
   }
   _cancelAndError(subscription, future, error, stackTrace);
 }
 
-typedef void _ErrorCallback(error, StackTrace stackTrace);
-
 /** Helper function to make an onError argument to [_runUserCode]. */
-_ErrorCallback _cancelAndErrorClosure(
+void Function(Object error, StackTrace stackTrace) _cancelAndErrorClosure(
     StreamSubscription subscription, _Future future) {
-  return (error, StackTrace stackTrace) {
+  return (Object error, StackTrace stackTrace) {
     _cancelAndError(subscription, future, error, stackTrace);
   };
 }
@@ -82,25 +78,22 @@
 
   bool get isBroadcast => _source.isBroadcast;
 
-  StreamSubscription<T> listen(void onData(T value),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    cancelOnError = identical(true, cancelOnError);
-    return _createSubscription(onData, onError, onDone, cancelOnError);
+  StreamSubscription<T> listen(void onData(T value)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
+    return _createSubscription(onData, onError, onDone, cancelOnError ?? false);
   }
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
     return new _ForwardingStreamSubscription<S, T>(
         this, onData, onError, onDone, cancelOnError);
   }
 
   // Override the following methods in subclasses to change the behavior.
 
-  void _handleData(S data, _EventSink<T> sink) {
-    sink._add(data as Object);
-  }
+  void _handleData(S data, _EventSink<T> sink);
 
-  void _handleError(error, StackTrace stackTrace, _EventSink<T> sink) {
+  void _handleError(Object error, StackTrace stackTrace, _EventSink<T> sink) {
     sink._addError(error, stackTrace);
   }
 
@@ -116,10 +109,10 @@
     extends _BufferingStreamSubscription<T> {
   final _ForwardingStream<S, T> _stream;
 
-  StreamSubscription<S> _subscription;
+  StreamSubscription<S>? _subscription;
 
-  _ForwardingStreamSubscription(this._stream, void onData(T data),
-      Function onError, void onDone(), bool cancelOnError)
+  _ForwardingStreamSubscription(this._stream, void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError)
       : super(onData, onError, onDone, cancelOnError) {
     _subscription = _stream._source
         .listen(_handleData, onError: _handleError, onDone: _handleDone);
@@ -142,18 +135,16 @@
   // StreamSubscription callbacks.
 
   void _onPause() {
-    if (_subscription == null) return;
-    _subscription.pause();
+    _subscription?.pause();
   }
 
   void _onResume() {
-    if (_subscription == null) return;
-    _subscription.resume();
+    _subscription?.resume();
   }
 
-  Future _onCancel() {
-    if (_subscription != null) {
-      StreamSubscription subscription = _subscription;
+  Future<void>? _onCancel() {
+    var subscription = _subscription;
+    if (subscription != null) {
       _subscription = null;
       return subscription.cancel();
     }
@@ -179,19 +170,18 @@
 // Stream transformers used by the default Stream implementation.
 // -------------------------------------------------------------------
 
-typedef bool _Predicate<T>(T value);
-
-void _addErrorWithReplacement(_EventSink sink, error, StackTrace stackTrace) {
-  AsyncError replacement = Zone.current.errorCallback(error, stackTrace);
+void _addErrorWithReplacement(
+    _EventSink sink, Object error, StackTrace stackTrace) {
+  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
   if (replacement != null) {
-    error = _nonNullError(replacement.error);
+    error = replacement.error;
     stackTrace = replacement.stackTrace;
   }
   sink._addError(error, stackTrace);
 }
 
 class _WhereStream<T> extends _ForwardingStream<T, T> {
-  final _Predicate<T> _test;
+  final bool Function(T) _test;
 
   _WhereStream(Stream<T> source, bool test(T value))
       : _test = test,
@@ -258,26 +248,30 @@
   }
 }
 
-typedef bool _ErrorTest(error);
-
 /**
  * A stream pipe that converts or disposes error events
  * before passing them on.
  */
 class _HandleErrorStream<T> extends _ForwardingStream<T, T> {
   final Function _transform;
-  final _ErrorTest _test;
+  final bool Function(Object)? _test;
 
-  _HandleErrorStream(Stream<T> source, Function onError, bool test(error))
+  _HandleErrorStream(
+      Stream<T> source, Function onError, bool test(Object error)?)
       : this._transform = onError,
         this._test = test,
         super(source);
 
+  void _handleData(T data, _EventSink<T> sink) {
+    sink._add(data);
+  }
+
   void _handleError(Object error, StackTrace stackTrace, _EventSink<T> sink) {
     bool matches = true;
-    if (_test != null) {
+    var test = _test;
+    if (test != null) {
       try {
-        matches = _test(error);
+        matches = test(error);
       } catch (e, s) {
         _addErrorWithReplacement(sink, e, s);
         return;
@@ -305,29 +299,25 @@
 
   _TakeStream(Stream<T> source, int count)
       : this._count = count,
-        super(source) {
-    // This test is done early to avoid handling an async error
-    // in the _handleData method.
-    ArgumentError.checkNotNull(count, "count");
-  }
+        super(source);
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
     if (_count == 0) {
       _source.listen(null).cancel();
       return new _DoneStreamSubscription<T>(onDone);
     }
-    return new _StateStreamSubscription<T>(
+    return new _StateStreamSubscription<int, T>(
         this, onData, onError, onDone, cancelOnError, _count);
   }
 
   void _handleData(T inputEvent, _EventSink<T> sink) {
-    _StateStreamSubscription<T> subscription = sink;
-    int count = subscription._count;
+    var subscription = sink as _StateStreamSubscription<int, T>;
+    int count = subscription._subState;
     if (count > 0) {
       sink._add(inputEvent);
       count -= 1;
-      subscription._count = count;
+      subscription._subState = count;
       if (count == 0) {
         // Closing also unsubscribes all subscribers, which unsubscribes
         // this from source.
@@ -342,32 +332,17 @@
  *
  * Use by several different classes, storing an integer, bool or general.
  */
-class _StateStreamSubscription<T> extends _ForwardingStreamSubscription<T, T> {
-  // Raw state field. Typed access provided by getters and setters below.
-  var _sharedState;
+class _StateStreamSubscription<S, T>
+    extends _ForwardingStreamSubscription<T, T> {
+  S _subState;
 
-  _StateStreamSubscription(_ForwardingStream<T, T> stream, void onData(T data),
-      Function onError, void onDone(), bool cancelOnError, this._sharedState)
+  _StateStreamSubscription(_ForwardingStream<T, T> stream, void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError, this._subState)
       : super(stream, onData, onError, onDone, cancelOnError);
-
-  bool get _flag => _sharedState;
-  void set _flag(bool flag) {
-    _sharedState = flag;
-  }
-
-  int get _count => _sharedState;
-  void set _count(int count) {
-    _sharedState = count;
-  }
-
-  Object get _value => _sharedState;
-  void set _value(Object value) {
-    _sharedState = value;
-  }
 }
 
 class _TakeWhileStream<T> extends _ForwardingStream<T, T> {
-  final _Predicate<T> _test;
+  final bool Function(T) _test;
 
   _TakeWhileStream(Stream<T> source, bool test(T value))
       : this._test = test,
@@ -399,21 +374,20 @@
         super(source) {
     // This test is done early to avoid handling an async error
     // in the _handleData method.
-    ArgumentError.checkNotNull(count, "count");
     RangeError.checkNotNegative(count, "count");
   }
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
-    return new _StateStreamSubscription<T>(
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
+    return new _StateStreamSubscription<int, T>(
         this, onData, onError, onDone, cancelOnError, _count);
   }
 
   void _handleData(T inputEvent, _EventSink<T> sink) {
-    _StateStreamSubscription<T> subscription = sink;
-    int count = subscription._count;
+    var subscription = sink as _StateStreamSubscription<int, T>;
+    int count = subscription._subState;
     if (count > 0) {
-      subscription._count = count - 1;
+      subscription._subState = count - 1;
       return;
     }
     sink._add(inputEvent);
@@ -421,21 +395,21 @@
 }
 
 class _SkipWhileStream<T> extends _ForwardingStream<T, T> {
-  final _Predicate<T> _test;
+  final bool Function(T) _test;
 
   _SkipWhileStream(Stream<T> source, bool test(T value))
       : this._test = test,
         super(source);
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
-    return new _StateStreamSubscription<T>(
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
+    return new _StateStreamSubscription<bool, T>(
         this, onData, onError, onDone, cancelOnError, false);
   }
 
   void _handleData(T inputEvent, _EventSink<T> sink) {
-    _StateStreamSubscription<T> subscription = sink;
-    bool hasFailed = subscription._flag;
+    var subscription = sink as _StateStreamSubscription<bool, T>;
+    bool hasFailed = subscription._subState;
     if (hasFailed) {
       sink._add(inputEvent);
       return;
@@ -446,48 +420,47 @@
     } catch (e, s) {
       _addErrorWithReplacement(sink, e, s);
       // A failure to return a boolean is considered "not matching".
-      subscription._flag = true;
+      subscription._subState = true;
       return;
     }
     if (!satisfies) {
-      subscription._flag = true;
+      subscription._subState = true;
       sink._add(inputEvent);
     }
   }
 }
 
-typedef bool _Equality<T>(T a, T b);
-
 class _DistinctStream<T> extends _ForwardingStream<T, T> {
   static final _SENTINEL = new Object();
 
-  final _Equality<T> _equals;
+  final bool Function(T, T)? _equals;
 
-  _DistinctStream(Stream<T> source, bool equals(T a, T b))
+  _DistinctStream(Stream<T> source, bool equals(T a, T b)?)
       : _equals = equals,
         super(source);
 
-  StreamSubscription<T> _createSubscription(void onData(T data),
-      Function onError, void onDone(), bool cancelOnError) {
-    return new _StateStreamSubscription<T>(
+  StreamSubscription<T> _createSubscription(void onData(T data)?,
+      Function? onError, void onDone()?, bool cancelOnError) {
+    return new _StateStreamSubscription<Object?, T>(
         this, onData, onError, onDone, cancelOnError, _SENTINEL);
   }
 
   void _handleData(T inputEvent, _EventSink<T> sink) {
-    _StateStreamSubscription<T> subscription = sink;
-    var previous = subscription._value;
+    var subscription = sink as _StateStreamSubscription<Object?, T>;
+    var previous = subscription._subState;
     if (identical(previous, _SENTINEL)) {
-      // First event.
-      subscription._value = inputEvent;
+      // First event. Cannot use [_equals].
+      subscription._subState = inputEvent;
       sink._add(inputEvent);
     } else {
-      T previousEvent = previous;
+      T previousEvent = previous as T;
+      var equals = _equals;
       bool isEqual;
       try {
-        if (_equals == null) {
+        if (equals == null) {
           isEqual = (previousEvent == inputEvent);
         } else {
-          isEqual = _equals(previousEvent, inputEvent);
+          isEqual = equals(previousEvent, inputEvent);
         }
       } catch (e, s) {
         _addErrorWithReplacement(sink, e, s);
@@ -495,7 +468,7 @@
       }
       if (!isEqual) {
         sink._add(inputEvent);
-        subscription._value = inputEvent;
+        subscription._subState = inputEvent;
       }
     }
   }
diff --git a/sdk/lib/async/stream_transformers.dart b/sdk/lib/async/stream_transformers.dart
index 243e934..ca7934c 100644
--- a/sdk/lib/async/stream_transformers.dart
+++ b/sdk/lib/async/stream_transformers.dart
@@ -2,22 +2,20 @@
 // 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.6
-
 part of dart.async;
 
 /**
  * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
  */
 class _EventSinkWrapper<T> implements EventSink<T> {
-  _EventSink _sink;
+  _EventSink<T> _sink;
   _EventSinkWrapper(this._sink);
 
   void add(T data) {
     _sink._add(data);
   }
 
-  void addError(error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
     _sink._addError(error, stackTrace ?? AsyncError.defaultStackTrace(error));
   }
 
@@ -36,24 +34,25 @@
 class _SinkTransformerStreamSubscription<S, T>
     extends _BufferingStreamSubscription<T> {
   /// The transformer's input sink.
-  EventSink<S> _transformerSink;
+  late EventSink<S> _transformerSink;
 
   /// The subscription to the input stream.
-  StreamSubscription<S> _subscription;
+  StreamSubscription<S>? _subscription;
 
-  _SinkTransformerStreamSubscription(Stream<S> source, _SinkMapper<S, T> mapper,
-      void onData(T data), Function onError, void onDone(), bool cancelOnError)
+  _SinkTransformerStreamSubscription(
+      Stream<S> source,
+      _SinkMapper<S, T> mapper,
+      void onData(T data)?,
+      Function? onError,
+      void onDone()?,
+      bool cancelOnError)
       // We set the adapter's target only when the user is allowed to send data.
       : super(onData, onError, onDone, cancelOnError) {
-    _EventSinkWrapper<T> eventSink = new _EventSinkWrapper<T>(this);
-    _transformerSink = mapper(eventSink);
+    _transformerSink = mapper(_EventSinkWrapper<T>(this));
     _subscription =
         source.listen(_handleData, onError: _handleError, onDone: _handleDone);
   }
 
-  /** Whether this subscription is still subscribed to its source. */
-  bool get _isSubscribed => _subscription != null;
-
   // _EventSink interface.
 
   /**
@@ -65,7 +64,7 @@
    */
   void _add(T data) {
     if (_isClosed) {
-      throw new StateError("Stream is already closed");
+      throw StateError("Stream is already closed");
     }
     super._add(data);
   }
@@ -101,16 +100,16 @@
   // _BufferingStreamSubscription hooks.
 
   void _onPause() {
-    if (_isSubscribed) _subscription.pause();
+    _subscription?.pause();
   }
 
   void _onResume() {
-    if (_isSubscribed) _subscription.resume();
+    _subscription?.resume();
   }
 
-  Future _onCancel() {
-    if (_isSubscribed) {
-      StreamSubscription subscription = _subscription;
+  Future<void>? _onCancel() {
+    var subscription = _subscription;
+    if (subscription != null) {
       _subscription = null;
       return subscription.cancel();
     }
@@ -125,7 +124,7 @@
     }
   }
 
-  void _handleError(error, [StackTrace stackTrace]) {
+  void _handleError(Object error, StackTrace stackTrace) {
     try {
       _transformerSink.addError(error, stackTrace);
     } catch (e, s) {
@@ -180,12 +179,11 @@
 
   _BoundSinkStream(this._stream, this._sinkMapper);
 
-  StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    cancelOnError = identical(true, cancelOnError);
+  StreamSubscription<T> listen(void onData(T event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     StreamSubscription<T> subscription =
-        new _SinkTransformerStreamSubscription<S, T>(
-            _stream, _sinkMapper, onData, onError, onDone, cancelOnError);
+        _SinkTransformerStreamSubscription<S, T>(_stream, _sinkMapper, onData,
+            onError, onDone, cancelOnError ?? false);
     return subscription;
   }
 }
@@ -206,52 +204,53 @@
  * This way we can reuse the code from [_StreamSinkTransformer].
  */
 class _HandlerEventSink<S, T> implements EventSink<S> {
-  final _TransformDataHandler<S, T> _handleData;
-  final _TransformErrorHandler<T> _handleError;
-  final _TransformDoneHandler<T> _handleDone;
+  final _TransformDataHandler<S, T>? _handleData;
+  final _TransformErrorHandler<T>? _handleError;
+  final _TransformDoneHandler<T>? _handleDone;
 
   /// The output sink where the handlers should send their data into.
-  EventSink<T> _sink;
+  /// Set to `null` when closed.
+  EventSink<T>? _sink;
 
-  _HandlerEventSink(
-      this._handleData, this._handleError, this._handleDone, this._sink) {
-    if (_sink == null) {
-      throw new ArgumentError("The provided sink must not be null.");
-    }
-  }
-
-  bool get _isClosed => _sink == null;
+  _HandlerEventSink(this._handleData, this._handleError, this._handleDone,
+      EventSink<T> this._sink);
 
   void add(S data) {
-    if (_isClosed) {
+    var sink = _sink;
+    if (sink == null) {
       throw StateError("Sink is closed");
     }
-    if (_handleData != null) {
-      _handleData(data, _sink);
+    var handleData = _handleData;
+    if (handleData != null) {
+      handleData(data, sink);
     } else {
-      _sink.add(data as T);
+      sink.add(data as T);
     }
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
-    if (_isClosed) {
+    var sink = _sink;
+    if (sink == null) {
       throw StateError("Sink is closed");
     }
-    if (_handleError != null) {
-      stackTrace ??= AsyncError.defaultStackTrace(error);
-      _handleError(error, stackTrace, _sink);
+    var handleError = _handleError;
+    stackTrace ??= AsyncError.defaultStackTrace(error);
+    if (handleError != null) {
+      handleError(error, stackTrace, sink);
     } else {
-      _sink.addError(error, stackTrace);
+      sink.addError(error, stackTrace);
     }
   }
 
   void close() {
-    if (_isClosed) return;
     var sink = _sink;
+    if (sink == null) return;
     _sink = null;
-    if (_handleDone != null) {
-      _handleDone(sink);
+    var handleDone = _handleDone;
+    if (handleDone != null) {
+      handleDone(sink);
     } else {
       sink.close();
     }
@@ -265,9 +264,9 @@
  */
 class _StreamHandlerTransformer<S, T> extends _StreamSinkTransformer<S, T> {
   _StreamHandlerTransformer(
-      {void handleData(S data, EventSink<T> sink),
-      void handleError(Object error, StackTrace stackTrace, EventSink<T> sink),
-      void handleDone(EventSink<T> sink)})
+      {void handleData(S data, EventSink<T> sink)?,
+      void handleError(Object error, StackTrace stackTrace, EventSink<T> sink)?,
+      void handleDone(EventSink<T> sink)?})
       : super((EventSink<T> outputSink) {
           return new _HandlerEventSink<S, T>(
               handleData, handleError, handleDone, outputSink);
@@ -328,10 +327,9 @@
 
   _BoundSubscriptionStream(this._stream, this._onListen);
 
-  StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    cancelOnError = identical(true, cancelOnError);
-    StreamSubscription<T> result = _onListen(_stream, cancelOnError);
+  StreamSubscription<T> listen(void onData(T event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
+    StreamSubscription<T> result = _onListen(_stream, cancelOnError ?? false);
     result.onData(onData);
     result.onError(onError);
     result.onDone(onDone);
diff --git a/sdk/lib/async/timer.dart b/sdk/lib/async/timer.dart
index 6c42767..e0ef447 100644
--- a/sdk/lib/async/timer.dart
+++ b/sdk/lib/async/timer.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.6
-
 part of dart.async;
 
 /**
@@ -44,7 +42,7 @@
    * The [callback] function is invoked after the given [duration].
    *
    */
-  factory Timer(Duration duration, void callback()) {
+  factory Timer(Duration duration, void Function() callback) {
     if (Zone.current == Zone.root) {
       // No need to bind the callback. We know that the root's timer will
       // be invoked in the root zone.
@@ -87,7 +85,7 @@
    *
    * This function is equivalent to `new Timer(Duration.zero, callback)`.
    */
-  static void run(void callback()) {
+  static void run(void Function() callback) {
     new Timer(Duration.zero, callback);
   }
 
@@ -125,7 +123,8 @@
    */
   bool get isActive;
 
-  external static Timer _createTimer(Duration duration, void callback());
+  external static Timer _createTimer(
+      Duration duration, void Function() callback);
   external static Timer _createPeriodicTimer(
       Duration duration, void callback(Timer timer));
 }
diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
index e200ad0..b4e3994 100644
--- a/sdk/lib/async/zone.dart
+++ b/sdk/lib/async/zone.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.6
-
 part of dart.async;
 
 typedef R ZoneCallback<R>();
@@ -25,8 +23,8 @@
 typedef RegisterBinaryCallbackHandler
     = ZoneBinaryCallback<R, T1, T2> Function<R, T1, T2>(Zone self,
         ZoneDelegate parent, Zone zone, R Function(T1 arg1, T2 arg2) f);
-typedef AsyncError ErrorCallbackHandler(Zone self, ZoneDelegate parent,
-    Zone zone, Object error, StackTrace stackTrace);
+typedef AsyncError? ErrorCallbackHandler(Zone self, ZoneDelegate parent,
+    Zone zone, Object error, StackTrace? stackTrace);
 typedef void ScheduleMicrotaskHandler(
     Zone self, ZoneDelegate parent, Zone zone, void f());
 typedef Timer CreateTimerHandler(
@@ -36,15 +34,16 @@
 typedef void PrintHandler(
     Zone self, ZoneDelegate parent, Zone zone, String line);
 typedef Zone ForkHandler(Zone self, ZoneDelegate parent, Zone zone,
-    ZoneSpecification specification, Map zoneValues);
+    ZoneSpecification? specification, Map<Object?, Object?>? zoneValues);
 
 /** Pair of error and stack trace. Returned by [Zone.errorCallback]. */
 class AsyncError implements Error {
   final Object error;
   final StackTrace stackTrace;
 
-  AsyncError(this.error, StackTrace stackTrace)
+  AsyncError(this.error, StackTrace? stackTrace)
       : stackTrace = stackTrace ?? defaultStackTrace(error) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
   }
 
@@ -130,38 +129,38 @@
    * Creates a specification with the provided handlers.
    */
   const factory ZoneSpecification(
-      {HandleUncaughtErrorHandler handleUncaughtError,
-      RunHandler run,
-      RunUnaryHandler runUnary,
-      RunBinaryHandler runBinary,
-      RegisterCallbackHandler registerCallback,
-      RegisterUnaryCallbackHandler registerUnaryCallback,
-      RegisterBinaryCallbackHandler registerBinaryCallback,
-      ErrorCallbackHandler errorCallback,
-      ScheduleMicrotaskHandler scheduleMicrotask,
-      CreateTimerHandler createTimer,
-      CreatePeriodicTimerHandler createPeriodicTimer,
-      PrintHandler print,
-      ForkHandler fork}) = _ZoneSpecification;
+      {HandleUncaughtErrorHandler? handleUncaughtError,
+      RunHandler? run,
+      RunUnaryHandler? runUnary,
+      RunBinaryHandler? runBinary,
+      RegisterCallbackHandler? registerCallback,
+      RegisterUnaryCallbackHandler? registerUnaryCallback,
+      RegisterBinaryCallbackHandler? registerBinaryCallback,
+      ErrorCallbackHandler? errorCallback,
+      ScheduleMicrotaskHandler? scheduleMicrotask,
+      CreateTimerHandler? createTimer,
+      CreatePeriodicTimerHandler? createPeriodicTimer,
+      PrintHandler? print,
+      ForkHandler? fork}) = _ZoneSpecification;
 
   /**
    * Creates a specification from [other] with the provided handlers overriding
    * the ones in [other].
    */
   factory ZoneSpecification.from(ZoneSpecification other,
-      {HandleUncaughtErrorHandler handleUncaughtError,
-      RunHandler run,
-      RunUnaryHandler runUnary,
-      RunBinaryHandler runBinary,
-      RegisterCallbackHandler registerCallback,
-      RegisterUnaryCallbackHandler registerUnaryCallback,
-      RegisterBinaryCallbackHandler registerBinaryCallback,
-      ErrorCallbackHandler errorCallback,
-      ScheduleMicrotaskHandler scheduleMicrotask,
-      CreateTimerHandler createTimer,
-      CreatePeriodicTimerHandler createPeriodicTimer,
-      PrintHandler print,
-      ForkHandler fork}) {
+      {HandleUncaughtErrorHandler? handleUncaughtError,
+      RunHandler? run,
+      RunUnaryHandler? runUnary,
+      RunBinaryHandler? runBinary,
+      RegisterCallbackHandler? registerCallback,
+      RegisterUnaryCallbackHandler? registerUnaryCallback,
+      RegisterBinaryCallbackHandler? registerBinaryCallback,
+      ErrorCallbackHandler? errorCallback,
+      ScheduleMicrotaskHandler? scheduleMicrotask,
+      CreateTimerHandler? createTimer,
+      CreatePeriodicTimerHandler? createPeriodicTimer,
+      PrintHandler? print,
+      ForkHandler? fork}) {
     return new ZoneSpecification(
         handleUncaughtError: handleUncaughtError ?? other.handleUncaughtError,
         run: run ?? other.run,
@@ -180,19 +179,19 @@
         fork: fork ?? other.fork);
   }
 
-  HandleUncaughtErrorHandler get handleUncaughtError;
-  RunHandler get run;
-  RunUnaryHandler get runUnary;
-  RunBinaryHandler get runBinary;
-  RegisterCallbackHandler get registerCallback;
-  RegisterUnaryCallbackHandler get registerUnaryCallback;
-  RegisterBinaryCallbackHandler get registerBinaryCallback;
-  ErrorCallbackHandler get errorCallback;
-  ScheduleMicrotaskHandler get scheduleMicrotask;
-  CreateTimerHandler get createTimer;
-  CreatePeriodicTimerHandler get createPeriodicTimer;
-  PrintHandler get print;
-  ForkHandler get fork;
+  HandleUncaughtErrorHandler? get handleUncaughtError;
+  RunHandler? get run;
+  RunUnaryHandler? get runUnary;
+  RunBinaryHandler? get runBinary;
+  RegisterCallbackHandler? get registerCallback;
+  RegisterUnaryCallbackHandler? get registerUnaryCallback;
+  RegisterBinaryCallbackHandler? get registerBinaryCallback;
+  ErrorCallbackHandler? get errorCallback;
+  ScheduleMicrotaskHandler? get scheduleMicrotask;
+  CreateTimerHandler? get createTimer;
+  CreatePeriodicTimerHandler? get createPeriodicTimer;
+  PrintHandler? get print;
+  ForkHandler? get fork;
 }
 
 /**
@@ -218,19 +217,19 @@
       this.print,
       this.fork});
 
-  final HandleUncaughtErrorHandler handleUncaughtError;
-  final RunHandler run;
-  final RunUnaryHandler runUnary;
-  final RunBinaryHandler runBinary;
-  final RegisterCallbackHandler registerCallback;
-  final RegisterUnaryCallbackHandler registerUnaryCallback;
-  final RegisterBinaryCallbackHandler registerBinaryCallback;
-  final ErrorCallbackHandler errorCallback;
-  final ScheduleMicrotaskHandler scheduleMicrotask;
-  final CreateTimerHandler createTimer;
-  final CreatePeriodicTimerHandler createPeriodicTimer;
-  final PrintHandler print;
-  final ForkHandler fork;
+  final HandleUncaughtErrorHandler? handleUncaughtError;
+  final RunHandler? run;
+  final RunUnaryHandler? runUnary;
+  final RunBinaryHandler? runBinary;
+  final RegisterCallbackHandler? registerCallback;
+  final RegisterUnaryCallbackHandler? registerUnaryCallback;
+  final RegisterBinaryCallbackHandler? registerBinaryCallback;
+  final ErrorCallbackHandler? errorCallback;
+  final ScheduleMicrotaskHandler? scheduleMicrotask;
+  final CreateTimerHandler? createTimer;
+  final CreatePeriodicTimerHandler? createPeriodicTimer;
+  final PrintHandler? print;
+  final ForkHandler? fork;
 }
 
 /**
@@ -256,7 +255,7 @@
  *   to skip zones that would just delegate to their parents.
  */
 abstract class ZoneDelegate {
-  void handleUncaughtError(Zone zone, error, StackTrace stackTrace);
+  void handleUncaughtError(Zone zone, Object error, StackTrace stackTrace);
   R run<R>(Zone zone, R f());
   R runUnary<R, T>(Zone zone, R f(T arg), T arg);
   R runBinary<R, T1, T2>(Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2);
@@ -264,12 +263,12 @@
   ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(Zone zone, R f(T arg));
   ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
       Zone zone, R f(T1 arg1, T2 arg2));
-  AsyncError errorCallback(Zone zone, Object error, StackTrace stackTrace);
+  AsyncError? errorCallback(Zone zone, Object error, StackTrace? stackTrace);
   void scheduleMicrotask(Zone zone, void f());
   Timer createTimer(Zone zone, Duration duration, void f());
   Timer createPeriodicTimer(Zone zone, Duration period, void f(Timer timer));
   void print(Zone zone, String line);
-  Zone fork(Zone zone, ZoneSpecification specification, Map zoneValues);
+  Zone fork(Zone zone, ZoneSpecification? specification, Map? zoneValues);
 }
 
 /**
@@ -283,7 +282,7 @@
  * an existing zone likely created using [Zone.fork].
  *
  * Developers can create a new zone that overrides some of the functionality of
- * an existing zone. For example, custom zones can replace or modify the
+ * an existing zone. For example, custom zones can replace of modify the
  * behavior of `print`, timers, microtasks or how uncaught errors are handled.
  *
  * The [Zone] class is not subclassable, but users can provide custom zones by
@@ -340,7 +339,7 @@
   static const Zone root = _rootZone;
 
   /** The currently running zone. */
-  static Zone _current = _rootZone;
+  static _Zone _current = _rootZone;
 
   /** The zone that is currently active. */
   static Zone get current => _current;
@@ -363,7 +362,7 @@
    * By default, when handled by the root zone, uncaught asynchronous errors are
    * treated like uncaught synchronous exceptions.
    */
-  void handleUncaughtError(error, StackTrace stackTrace);
+  void handleUncaughtError(Object error, StackTrace stackTrace);
 
   /**
    * The parent zone of the this zone.
@@ -374,7 +373,7 @@
    * forks the [current] zone. The new zone's parent zone is the zone it was
    * forked from.
    */
-  Zone get parent;
+  Zone? get parent;
 
   /**
    * The error zone is the one that is responsible for dealing with uncaught
@@ -395,7 +394,7 @@
    *   runZoned(() {
    *     // The asynchronous error is caught by the custom zone which prints
    *     // 'asynchronous error'.
-   *     future = new Future.error("asynchronous error");
+   *     future = Future.error("asynchronous error");
    *   }, onError: (e) { print(e); });  // Creates a zone with an error handler.
    *   // The following `catchError` handler is never invoked, because the
    *   // custom zone created by the call to `runZoned` provides an
@@ -416,7 +415,7 @@
    *     // with different error handlers.
    *     // Instead the error is handled by the current error handler,
    *     // printing "Caught by outer zone: asynchronous error".
-   *     var future = new Future.error("asynchronous error");
+   *     var future = Future.error("asynchronous error");
    *     runZoned(() {
    *       future.catchError((e) { throw "is never reached"; });
    *     }, onError: (e) { throw "is never reached"; });
@@ -448,7 +447,8 @@
    * the zone specification (or zone values), giving the forking zone full
    * control over the child zone.
    */
-  Zone fork({ZoneSpecification specification, Map zoneValues});
+  Zone fork(
+      {ZoneSpecification? specification, Map<Object?, Object?>? zoneValues});
 
   /**
    * Executes [action] in this zone.
@@ -599,7 +599,7 @@
    *     return () => this.runGuarded(registered);
    *
    */
-  void Function() bindCallbackGuarded(void callback());
+  void Function() bindCallbackGuarded(void Function() callback);
 
   /**
    * Registers the provided [callback] and returns a function that will
@@ -656,7 +656,7 @@
    * errors are usually reported through future completers or stream
    * controllers.
    */
-  AsyncError errorCallback(Object error, StackTrace stackTrace);
+  AsyncError? errorCallback(Object error, StackTrace? stackTrace);
 
   /**
    * Runs [callback] asynchronously in this zone.
@@ -668,12 +668,12 @@
    * Custom zones may intercept this operation (for example to wrap the given
    * [callback]).
    */
-  void scheduleMicrotask(void callback());
+  void scheduleMicrotask(void Function() callback);
 
   /**
    * Creates a Timer where the callback is executed in this zone.
    */
-  Timer createTimer(Duration duration, void callback());
+  Timer createTimer(Duration duration, void Function() callback);
 
   /**
    * Creates a periodic Timer where the callback is executed in this zone.
@@ -708,10 +708,9 @@
    *
    * The previous current zone is returned.
    */
-  static Zone _enter(Zone zone) {
-    assert(zone != null);
+  static _Zone _enter(_Zone zone) {
     assert(!identical(zone, _current));
-    Zone previous = _current;
+    _Zone previous = _current;
     _current = zone;
     return previous;
   }
@@ -721,7 +720,7 @@
    *
    * The previous Zone must be provided as `previous`.
    */
-  static void _leave(Zone previous) {
+  static void _leave(_Zone previous) {
     assert(previous != null);
     Zone._current = previous;
   }
@@ -737,12 +736,7 @@
    * By controlling access to the key, a zone can grant or deny access to the
    * zone value.
    */
-  operator [](Object key);
-}
-
-ZoneDelegate _parentDelegate(_Zone zone) {
-  if (zone.parent == null) return null;
-  return zone.parent._delegate;
+  dynamic operator [](Object? key);
 }
 
 class _ZoneDelegate implements ZoneDelegate {
@@ -750,101 +744,101 @@
 
   _ZoneDelegate(this._delegationTarget);
 
-  void handleUncaughtError(Zone zone, error, StackTrace stackTrace) {
+  void handleUncaughtError(Zone zone, Object error, StackTrace stackTrace) {
     var implementation = _delegationTarget._handleUncaughtError;
     _Zone implZone = implementation.zone;
     HandleUncaughtErrorHandler handler = implementation.function;
-    return handler(
-        implZone, _parentDelegate(implZone), zone, error, stackTrace);
+    return handler(implZone, implZone._parentDelegate, zone, error, stackTrace);
   }
 
   R run<R>(Zone zone, R f()) {
     var implementation = _delegationTarget._run;
     _Zone implZone = implementation.zone;
-    RunHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, f);
+    var handler = implementation.function as RunHandler;
+    return handler(implZone, implZone._parentDelegate, zone, f);
   }
 
   R runUnary<R, T>(Zone zone, R f(T arg), T arg) {
     var implementation = _delegationTarget._runUnary;
     _Zone implZone = implementation.zone;
-    RunUnaryHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, f, arg);
+    var handler = implementation.function as RunUnaryHandler;
+    return handler(implZone, implZone._parentDelegate, zone, f, arg);
   }
 
   R runBinary<R, T1, T2>(Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
     var implementation = _delegationTarget._runBinary;
     _Zone implZone = implementation.zone;
-    RunBinaryHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, f, arg1, arg2);
+    var handler = implementation.function as RunBinaryHandler;
+    return handler(implZone, implZone._parentDelegate, zone, f, arg1, arg2);
   }
 
   ZoneCallback<R> registerCallback<R>(Zone zone, R f()) {
     var implementation = _delegationTarget._registerCallback;
     _Zone implZone = implementation.zone;
-    RegisterCallbackHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, f);
+    var handler = implementation.function as RegisterCallbackHandler;
+    return handler(implZone, implZone._parentDelegate, zone, f);
   }
 
   ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(Zone zone, R f(T arg)) {
     var implementation = _delegationTarget._registerUnaryCallback;
     _Zone implZone = implementation.zone;
-    RegisterUnaryCallbackHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, f);
+    var handler = implementation.function as RegisterUnaryCallbackHandler;
+    return handler(implZone, implZone._parentDelegate, zone, f);
   }
 
   ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
       Zone zone, R f(T1 arg1, T2 arg2)) {
     var implementation = _delegationTarget._registerBinaryCallback;
     _Zone implZone = implementation.zone;
-    RegisterBinaryCallbackHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, f);
+    var handler = implementation.function as RegisterBinaryCallbackHandler;
+    return handler(implZone, implZone._parentDelegate, zone, f);
   }
 
-  AsyncError errorCallback(Zone zone, Object error, StackTrace stackTrace) {
+  AsyncError? errorCallback(Zone zone, Object error, StackTrace? stackTrace) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     var implementation = _delegationTarget._errorCallback;
     _Zone implZone = implementation.zone;
     if (identical(implZone, _rootZone)) return null;
     ErrorCallbackHandler handler = implementation.function;
-    return handler(
-        implZone, _parentDelegate(implZone), zone, error, stackTrace);
+    return handler(implZone, implZone._parentDelegate, zone, error, stackTrace);
   }
 
   void scheduleMicrotask(Zone zone, f()) {
     var implementation = _delegationTarget._scheduleMicrotask;
     _Zone implZone = implementation.zone;
     ScheduleMicrotaskHandler handler = implementation.function;
-    handler(implZone, _parentDelegate(implZone), zone, f);
+    handler(implZone, implZone._parentDelegate, zone, f);
   }
 
   Timer createTimer(Zone zone, Duration duration, void f()) {
     var implementation = _delegationTarget._createTimer;
     _Zone implZone = implementation.zone;
     CreateTimerHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, duration, f);
+    return handler(implZone, implZone._parentDelegate, zone, duration, f);
   }
 
   Timer createPeriodicTimer(Zone zone, Duration period, void f(Timer timer)) {
     var implementation = _delegationTarget._createPeriodicTimer;
     _Zone implZone = implementation.zone;
     CreatePeriodicTimerHandler handler = implementation.function;
-    return handler(implZone, _parentDelegate(implZone), zone, period, f);
+    return handler(implZone, implZone._parentDelegate, zone, period, f);
   }
 
   void print(Zone zone, String line) {
     var implementation = _delegationTarget._print;
     _Zone implZone = implementation.zone;
     PrintHandler handler = implementation.function;
-    handler(implZone, _parentDelegate(implZone), zone, line);
+    handler(implZone, implZone._parentDelegate, zone, line);
   }
 
-  Zone fork(Zone zone, ZoneSpecification specification, Map zoneValues) {
+  Zone fork(Zone zone, ZoneSpecification? specification,
+      Map<Object?, Object?>? zoneValues) {
     var implementation = _delegationTarget._fork;
     _Zone implZone = implementation.zone;
     ForkHandler handler = implementation.function;
     return handler(
-        implZone, _parentDelegate(implZone), zone, specification, zoneValues);
+        implZone, implZone._parentDelegate, zone, specification, zoneValues);
   }
 }
 
@@ -869,9 +863,11 @@
   _ZoneFunction<PrintHandler> get _print;
   _ZoneFunction<ForkHandler> get _fork;
   _ZoneFunction<HandleUncaughtErrorHandler> get _handleUncaughtError;
-  _Zone get parent;
+  // Parent zone. Only `null` for the root zone.
+  _Zone? get parent;
   ZoneDelegate get _delegate;
-  Map get _map;
+  ZoneDelegate get _parentDelegate;
+  Map<Object?, Object?> get _map;
 
   bool inSameErrorZone(Zone otherZone) {
     return identical(this, otherZone) ||
@@ -883,7 +879,7 @@
   // The actual zone and implementation of each of these
   // inheritable zone functions.
   // TODO(floitsch): the types of the `_ZoneFunction`s should have a type for
-  // all fields.
+  // all fields, but we can't use generic function types as type arguments.
   _RunNullaryZoneFunction _run;
   _RunUnaryZoneFunction _runUnary;
   _RunBinaryZoneFunction _runBinary;
@@ -899,7 +895,7 @@
   _ZoneFunction<HandleUncaughtErrorHandler> _handleUncaughtError;
 
   // A cached delegate to this zone.
-  ZoneDelegate _delegateCache;
+  ZoneDelegate? _delegateCache;
 
   /// The parent zone.
   final _Zone parent;
@@ -907,63 +903,85 @@
   /// The zone's scoped value declaration map.
   ///
   /// This is always a [HashMap].
-  final Map _map;
+  final Map<Object?, Object?> _map;
 
-  ZoneDelegate get _delegate {
-    if (_delegateCache != null) return _delegateCache;
-    _delegateCache = new _ZoneDelegate(this);
-    return _delegateCache;
-  }
+  ZoneDelegate get _delegate => _delegateCache ??= _ZoneDelegate(this);
+  ZoneDelegate get _parentDelegate => parent._delegate;
 
-  _CustomZone(this.parent, ZoneSpecification specification, this._map) {
+  _CustomZone(this.parent, ZoneSpecification specification, this._map)
+      : _run = parent._run,
+        _runUnary = parent._runUnary,
+        _runBinary = parent._runBinary,
+        _registerCallback = parent._registerCallback,
+        _registerUnaryCallback = parent._registerUnaryCallback,
+        _registerBinaryCallback = parent._registerBinaryCallback,
+        _errorCallback = parent._errorCallback,
+        _scheduleMicrotask = parent._scheduleMicrotask,
+        _createTimer = parent._createTimer,
+        _createPeriodicTimer = parent._createPeriodicTimer,
+        _print = parent._print,
+        _fork = parent._fork,
+        _handleUncaughtError = parent._handleUncaughtError {
     // The root zone will have implementations of all parts of the
     // specification, so it will never try to access the (null) parent.
     // All other zones have a non-null parent.
-    _run = (specification.run != null)
-        ? new _RunNullaryZoneFunction(this, specification.run)
-        : parent._run;
-    _runUnary = (specification.runUnary != null)
-        ? new _RunUnaryZoneFunction(this, specification.runUnary)
-        : parent._runUnary;
-    _runBinary = (specification.runBinary != null)
-        ? new _RunBinaryZoneFunction(this, specification.runBinary)
-        : parent._runBinary;
-    _registerCallback = (specification.registerCallback != null)
-        ? new _RegisterNullaryZoneFunction(this, specification.registerCallback)
-        : parent._registerCallback;
-    _registerUnaryCallback = (specification.registerUnaryCallback != null)
-        ? new _RegisterUnaryZoneFunction(
-            this, specification.registerUnaryCallback)
-        : parent._registerUnaryCallback;
-    _registerBinaryCallback = (specification.registerBinaryCallback != null)
-        ? new _RegisterBinaryZoneFunction(
-            this, specification.registerBinaryCallback)
-        : parent._registerBinaryCallback;
-    _errorCallback = (specification.errorCallback != null)
-        ? new _ZoneFunction<ErrorCallbackHandler>(
-            this, specification.errorCallback)
-        : parent._errorCallback;
-    _scheduleMicrotask = (specification.scheduleMicrotask != null)
-        ? new _ZoneFunction<ScheduleMicrotaskHandler>(
-            this, specification.scheduleMicrotask)
-        : parent._scheduleMicrotask;
-    _createTimer = (specification.createTimer != null)
-        ? new _ZoneFunction<CreateTimerHandler>(this, specification.createTimer)
-        : parent._createTimer;
-    _createPeriodicTimer = (specification.createPeriodicTimer != null)
-        ? new _ZoneFunction<CreatePeriodicTimerHandler>(
-            this, specification.createPeriodicTimer)
-        : parent._createPeriodicTimer;
-    _print = (specification.print != null)
-        ? new _ZoneFunction<PrintHandler>(this, specification.print)
-        : parent._print;
-    _fork = (specification.fork != null)
-        ? new _ZoneFunction<ForkHandler>(this, specification.fork)
-        : parent._fork;
-    _handleUncaughtError = (specification.handleUncaughtError != null)
-        ? new _ZoneFunction<HandleUncaughtErrorHandler>(
-            this, specification.handleUncaughtError)
-        : parent._handleUncaughtError;
+    var run = specification.run;
+    if (run != null) {
+      _run = _RunNullaryZoneFunction(this, run);
+    }
+    var runUnary = specification.runUnary;
+    if (runUnary != null) {
+      _runUnary = _RunUnaryZoneFunction(this, runUnary);
+    }
+    var runBinary = specification.runBinary;
+    if (runBinary != null) {
+      _runBinary = _RunBinaryZoneFunction(this, runBinary);
+    }
+    var registerCallback = specification.registerCallback;
+    if (registerCallback != null) {
+      _registerCallback = _RegisterNullaryZoneFunction(this, registerCallback);
+    }
+    var registerUnaryCallback = specification.registerUnaryCallback;
+    if (registerUnaryCallback != null) {
+      _registerUnaryCallback =
+          _RegisterUnaryZoneFunction(this, registerUnaryCallback);
+    }
+    var registerBinaryCallback = specification.registerBinaryCallback;
+    if (registerBinaryCallback != null) {
+      _registerBinaryCallback =
+          _RegisterBinaryZoneFunction(this, registerBinaryCallback);
+    }
+    var errorCallback = specification.errorCallback;
+    if (errorCallback != null) {
+      _errorCallback = _ZoneFunction<ErrorCallbackHandler>(this, errorCallback);
+    }
+    var scheduleMicrotask = specification.scheduleMicrotask;
+    if (scheduleMicrotask != null) {
+      _scheduleMicrotask =
+          _ZoneFunction<ScheduleMicrotaskHandler>(this, scheduleMicrotask);
+    }
+    var createTimer = specification.createTimer;
+    if (createTimer != null) {
+      _createTimer = _ZoneFunction<CreateTimerHandler>(this, createTimer);
+    }
+    var createPeriodicTimer = specification.createPeriodicTimer;
+    if (createPeriodicTimer != null) {
+      _createPeriodicTimer =
+          _ZoneFunction<CreatePeriodicTimerHandler>(this, createPeriodicTimer);
+    }
+    var print = specification.print;
+    if (print != null) {
+      _print = _ZoneFunction<PrintHandler>(this, print);
+    }
+    var fork = specification.fork;
+    if (fork != null) {
+      _fork = _ZoneFunction<ForkHandler>(this, fork);
+    }
+    var handleUncaughtError = specification.handleUncaughtError;
+    if (handleUncaughtError != null) {
+      _handleUncaughtError =
+          _ZoneFunction<HandleUncaughtErrorHandler>(this, handleUncaughtError);
+    }
   }
 
   /**
@@ -1030,7 +1048,7 @@
     return (arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2);
   }
 
-  operator [](Object key) {
+  dynamic operator [](Object? key) {
     var result = _map[key];
     if (result != null || _map.containsKey(key)) return result;
     // If we are not the root zone, look up in the parent zone.
@@ -1051,19 +1069,18 @@
 
   // Methods that can be customized by the zone specification.
 
-  void handleUncaughtError(error, StackTrace stackTrace) {
+  void handleUncaughtError(Object error, StackTrace stackTrace) {
     var implementation = this._handleUncaughtError;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
     HandleUncaughtErrorHandler handler = implementation.function;
     return handler(
         implementation.zone, parentDelegate, this, error, stackTrace);
   }
 
-  Zone fork({ZoneSpecification specification, Map zoneValues}) {
+  Zone fork(
+      {ZoneSpecification? specification, Map<Object?, Object?>? zoneValues}) {
     var implementation = this._fork;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
     ForkHandler handler = implementation.function;
     return handler(
         implementation.zone, parentDelegate, this, specification, zoneValues);
@@ -1071,115 +1088,104 @@
 
   R run<R>(R f()) {
     var implementation = this._run;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
-    RunHandler handler = implementation.function;
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
+    var handler = implementation.function as RunHandler;
     return handler(implementation.zone, parentDelegate, this, f);
   }
 
   R runUnary<R, T>(R f(T arg), T arg) {
     var implementation = this._runUnary;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
-    RunUnaryHandler handler = implementation.function;
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
+    var handler = implementation.function as RunUnaryHandler;
     return handler(implementation.zone, parentDelegate, this, f, arg);
   }
 
   R runBinary<R, T1, T2>(R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
     var implementation = this._runBinary;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
-    RunBinaryHandler handler = implementation.function;
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
+    var handler = implementation.function as RunBinaryHandler;
     return handler(implementation.zone, parentDelegate, this, f, arg1, arg2);
   }
 
   ZoneCallback<R> registerCallback<R>(R callback()) {
     var implementation = this._registerCallback;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
-    RegisterCallbackHandler handler = implementation.function;
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
+    var handler = implementation.function as RegisterCallbackHandler;
     return handler(implementation.zone, parentDelegate, this, callback);
   }
 
   ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(R callback(T arg)) {
     var implementation = this._registerUnaryCallback;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
-    RegisterUnaryCallbackHandler handler = implementation.function;
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
+    var handler = implementation.function as RegisterUnaryCallbackHandler;
     return handler(implementation.zone, parentDelegate, this, callback);
   }
 
   ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
       R callback(T1 arg1, T2 arg2)) {
     var implementation = this._registerBinaryCallback;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
-    RegisterBinaryCallbackHandler handler = implementation.function;
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
+    var handler = implementation.function as RegisterBinaryCallbackHandler;
     return handler(implementation.zone, parentDelegate, this, callback);
   }
 
-  AsyncError errorCallback(Object error, StackTrace stackTrace) {
+  AsyncError? errorCallback(Object error, StackTrace? stackTrace) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     var implementation = this._errorCallback;
-    assert(implementation != null);
-    final Zone implementationZone = implementation.zone;
+    final _Zone implementationZone = implementation.zone;
     if (identical(implementationZone, _rootZone)) return null;
-    final ZoneDelegate parentDelegate = _parentDelegate(implementationZone);
+    final ZoneDelegate parentDelegate = implementationZone._parentDelegate;
     ErrorCallbackHandler handler = implementation.function;
     return handler(implementationZone, parentDelegate, this, error, stackTrace);
   }
 
   void scheduleMicrotask(void f()) {
     var implementation = this._scheduleMicrotask;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
     ScheduleMicrotaskHandler handler = implementation.function;
     return handler(implementation.zone, parentDelegate, this, f);
   }
 
   Timer createTimer(Duration duration, void f()) {
     var implementation = this._createTimer;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
     CreateTimerHandler handler = implementation.function;
     return handler(implementation.zone, parentDelegate, this, duration, f);
   }
 
   Timer createPeriodicTimer(Duration duration, void f(Timer timer)) {
     var implementation = this._createPeriodicTimer;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
     CreatePeriodicTimerHandler handler = implementation.function;
     return handler(implementation.zone, parentDelegate, this, duration, f);
   }
 
   void print(String line) {
     var implementation = this._print;
-    assert(implementation != null);
-    ZoneDelegate parentDelegate = _parentDelegate(implementation.zone);
+    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
     PrintHandler handler = implementation.function;
     return handler(implementation.zone, parentDelegate, this, line);
   }
 }
 
-void _rootHandleUncaughtError(
-    Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace) {
-  if (error == null) {
-    error = ArgumentError.notNull("error");
-    stackTrace = StackTrace.current;
-  }
+void _rootHandleUncaughtError(Zone? self, ZoneDelegate? parent, Zone zone,
+    Object error, StackTrace stackTrace) {
   _schedulePriorityAsyncCallback(() {
-    if (stackTrace == null) throw error;
     _rethrow(error, stackTrace);
   });
 }
 
 external void _rethrow(Object error, StackTrace stackTrace);
 
-R _rootRun<R>(Zone self, ZoneDelegate parent, Zone zone, R f()) {
-  if (Zone._current == zone) return f();
+R _rootRun<R>(Zone? self, ZoneDelegate? parent, Zone zone, R f()) {
+  if (identical(Zone._current, zone)) return f();
 
-  Zone old = Zone._enter(zone);
+  if (zone is! _Zone) {
+    throw ArgumentError.value(zone, "zone", "Can only run in platform zones");
+  }
+
+  _Zone old = Zone._enter(zone);
   try {
     return f();
   } finally {
@@ -1188,10 +1194,14 @@
 }
 
 R _rootRunUnary<R, T>(
-    Zone self, ZoneDelegate parent, Zone zone, R f(T arg), T arg) {
-  if (Zone._current == zone) return f(arg);
+    Zone? self, ZoneDelegate? parent, Zone zone, R f(T arg), T arg) {
+  if (identical(Zone._current, zone)) return f(arg);
 
-  Zone old = Zone._enter(zone);
+  if (zone is! _Zone) {
+    throw ArgumentError.value(zone, "zone", "Can only run in platform zones");
+  }
+
+  _Zone old = Zone._enter(zone);
   try {
     return f(arg);
   } finally {
@@ -1199,11 +1209,15 @@
   }
 }
 
-R _rootRunBinary<R, T1, T2>(Zone self, ZoneDelegate parent, Zone zone,
+R _rootRunBinary<R, T1, T2>(Zone? self, ZoneDelegate? parent, Zone zone,
     R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-  if (Zone._current == zone) return f(arg1, arg2);
+  if (identical(Zone._current, zone)) return f(arg1, arg2);
 
-  Zone old = Zone._enter(zone);
+  if (zone is! _Zone) {
+    throw ArgumentError.value(zone, "zone", "Can only run in platform zones");
+  }
+
+  _Zone old = Zone._enter(zone);
   try {
     return f(arg1, arg2);
   } finally {
@@ -1226,12 +1240,12 @@
   return f;
 }
 
-AsyncError _rootErrorCallback(Zone self, ZoneDelegate parent, Zone zone,
-        Object error, StackTrace stackTrace) =>
+AsyncError? _rootErrorCallback(Zone self, ZoneDelegate parent, Zone zone,
+        Object error, StackTrace? stackTrace) =>
     null;
 
 void _rootScheduleMicrotask(
-    Zone self, ZoneDelegate parent, Zone zone, void f()) {
+    Zone? self, ZoneDelegate? parent, Zone zone, void f()) {
   if (!identical(_rootZone, zone)) {
     bool hasErrorHandler = !_rootZone.inSameErrorZone(zone);
     if (hasErrorHandler) {
@@ -1239,14 +1253,12 @@
     } else {
       f = zone.bindCallback(f);
     }
-    // Use root zone as event zone if the function is already bound.
-    zone = _rootZone;
   }
   _scheduleAsyncCallback(f);
 }
 
 Timer _rootCreateTimer(Zone self, ZoneDelegate parent, Zone zone,
-    Duration duration, void callback()) {
+    Duration duration, void Function() callback) {
   if (!identical(_rootZone, zone)) {
     callback = zone.bindCallback(callback);
   }
@@ -1256,8 +1268,7 @@
 Timer _rootCreatePeriodicTimer(Zone self, ZoneDelegate parent, Zone zone,
     Duration duration, void callback(Timer timer)) {
   if (!identical(_rootZone, zone)) {
-    // TODO(floitsch): the return type should be 'void'.
-    callback = zone.bindUnaryCallback<dynamic, Timer>(callback);
+    callback = zone.bindUnaryCallback<void, Timer>(callback);
   }
   return Timer._createPeriodicTimer(duration, callback);
 }
@@ -1270,8 +1281,11 @@
   Zone.current.print(line);
 }
 
-Zone _rootFork(Zone self, ZoneDelegate parent, Zone zone,
-    ZoneSpecification specification, Map zoneValues) {
+Zone _rootFork(Zone? self, ZoneDelegate? parent, Zone zone,
+    ZoneSpecification? specification, Map<Object?, Object?>? zoneValues) {
+  if (zone is! _Zone) {
+    throw ArgumentError.value(zone, "zone", "Can only fork a platform zone");
+  }
   // TODO(floitsch): it would be nice if we could get rid of this hack.
   // Change the static zoneOrDirectPrint function to go through zones
   // from now on.
@@ -1280,20 +1294,17 @@
   if (specification == null) {
     specification = const ZoneSpecification();
   } else if (specification is! _ZoneSpecification) {
-    throw new ArgumentError("ZoneSpecifications must be instantiated"
-        " with the provided constructor.");
+    specification = ZoneSpecification.from(specification);
   }
-  Map valueMap;
+  Map<Object?, Object?> valueMap;
   if (zoneValues == null) {
-    if (zone is _Zone) {
-      valueMap = zone._map;
-    } else {
-      valueMap = new HashMap();
-    }
+    valueMap = zone._map;
   } else {
-    valueMap = new HashMap.from(zoneValues);
+    valueMap = HashMap<Object?, Object?>.from(zoneValues);
   }
-  return new _CustomZone(zone, specification, valueMap);
+  if (specification == null)
+    throw "unreachable"; // TODO(lrn): Remove when type promotion works.
+  return _CustomZone(zone, specification, valueMap);
 }
 
 class _RootZone extends _Zone {
@@ -1330,21 +1341,20 @@
           _rootZone, _rootHandleUncaughtError);
 
   // The parent zone.
-  _Zone get parent => null;
+  _Zone? get parent => null;
 
   /// The zone's scoped value declaration map.
   ///
   /// This is always a [HashMap].
-  Map get _map => _rootMap;
+  Map<Object?, Object?> get _map => _rootMap;
 
-  static final _rootMap = new HashMap();
+  static final _rootMap = HashMap();
 
-  static ZoneDelegate _rootDelegate;
+  static ZoneDelegate? _rootDelegate;
 
-  ZoneDelegate get _delegate {
-    if (_rootDelegate != null) return _rootDelegate;
-    return _rootDelegate = new _ZoneDelegate(this);
-  }
+  ZoneDelegate get _delegate => _rootDelegate ??= new _ZoneDelegate(this);
+  // It's a lie, but the root zone never uses the parent delegate.
+  ZoneDelegate get _parentDelegate => _delegate;
 
   /**
    * The closest error-handling zone.
@@ -1418,15 +1428,16 @@
     return (arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2);
   }
 
-  operator [](Object key) => null;
+  dynamic operator [](Object? key) => null;
 
   // Methods that can be customized by the zone specification.
 
-  void handleUncaughtError(error, StackTrace stackTrace) {
+  void handleUncaughtError(Object error, StackTrace stackTrace) {
     _rootHandleUncaughtError(null, null, this, error, stackTrace);
   }
 
-  Zone fork({ZoneSpecification specification, Map zoneValues}) {
+  Zone fork(
+      {ZoneSpecification? specification, Map<Object?, Object?>? zoneValues}) {
     return _rootFork(null, null, this, specification, zoneValues);
   }
 
@@ -1453,7 +1464,7 @@
           R f(T1 arg1, T2 arg2)) =>
       f;
 
-  AsyncError errorCallback(Object error, StackTrace stackTrace) => null;
+  AsyncError? errorCallback(Object error, StackTrace? stackTrace) => null;
 
   void scheduleMicrotask(void f()) {
     _rootScheduleMicrotask(null, null, this, f);
@@ -1472,7 +1483,7 @@
   }
 }
 
-const _rootZone = const _RootZone();
+const _Zone _rootZone = const _RootZone();
 
 /**
  * Runs [body] in its own zone.
@@ -1490,7 +1501,7 @@
  * If an error occurs synchronously in [body],
  * then throwing in the [onError] handler
  * makes the call to `runZone` throw that error,
- * and otherwise the call to `runZoned` returns `null`.
+ * and otherwise the call to `runZoned` attempt to return `null`.
  *
  * If the zone specification has a `handleUncaughtError` value or the [onError]
  * parameter is provided, the zone becomes an error-zone.
@@ -1518,23 +1529,23 @@
  * occur in the original zone where [runZoned] was called.
  */
 R runZoned<R>(R body(),
-    {Map zoneValues,
-    ZoneSpecification zoneSpecification,
-    @Deprecated("Use runZonedGuarded instead") Function onError}) {
+    {Map<Object?, Object?>? zoneValues,
+    ZoneSpecification? zoneSpecification,
+    @Deprecated("Use runZonedGuarded instead") Function? onError}) {
   ArgumentError.checkNotNull(body, "body");
-
   if (onError != null) {
-    void Function(Object, StackTrace) typedOnError;
-    if (onError is void Function(Object, StackTrace)) {
-      typedOnError = onError;
-    } else if (onError is void Function(Object)) {
-      typedOnError = (Object e, StackTrace _) => onError(e);
-    } else {
-      throw ArgumentError.value(onError, "onError",
-          "Should accept one error, or one error and a stack trace");
+    // TODO: Remove this when code have been migrated off using [onError].
+    if (onError is! void Function(Object, StackTrace)) {
+      if (onError is void Function(Object)) {
+        var originalOnError = onError;
+        onError = (Object error, StackTrace stack) => originalOnError(error);
+      } else {
+        throw ArgumentError.value(onError, "onError",
+            "Must be Function(Object) or Function(Object, StackTrace)");
+      }
     }
-    return runZonedGuarded(body, typedOnError,
-        zoneValues: zoneValues, zoneSpecification: zoneSpecification);
+    return runZonedGuarded(body, onError,
+        zoneSpecification: zoneSpecification, zoneValues: zoneValues) as R;
   }
   return _runZoned<R>(body, zoneValues, zoneSpecification);
 }
@@ -1554,41 +1565,40 @@
  * makes the call to `runZonedGuarded` throw that error,
  * and otherwise the call to `runZonedGuarded` returns `null`.
  *
- * If the zone specification has a `handleUncaughtError` value or the [onError]
- * parameter is provided, the zone becomes an error-zone.
+ * The zone will always be an error-zone.
  *
  * Errors will never cross error-zone boundaries by themselves.
  * Errors that try to cross error-zone boundaries are considered uncaught in
  * their originating error zone.
- *
- *     var future = new Future.value(499);
- *     runZoned(() {
- *       var future2 = future.then((_) { throw "error in first error-zone"; });
- *       runZoned(() {
- *         var future3 = future2.catchError((e) { print("Never reached!"); });
- *       }, onError: (e, s) { print("unused error handler"); });
- *     }, onError: (e, s) { print("catches error of first error-zone."); });
- *
+ * ```dart
+ * var future = Future.value(499);
+ * runZonedGuarded(() {
+ *   var future2 = future.then((_) { throw "error in first error-zone"; });
+ *   runZonedGuarded(() {
+ *     var future3 = future2.catchError((e) { print("Never reached!"); });
+ *   }, (e, s) { print("unused error handler"); });
+ * }, (e, s) { print("catches error of first error-zone."); });
+ * ```
  * Example:
- *
- *     runZoned(() {
- *       new Future(() { throw "asynchronous error"; });
- *     }, onError: (e, s) => print(e));  // Will print "asynchronous error".
- *
+ * ```dart
+ * runZonedGuarded(() {
+ *   new Future(() { throw "asynchronous error"; });
+ * }, (e, s) => print(e));  // Will print "asynchronous error".
+ * ```
  * It is possible to manually pass an error from one error zone to another
  * by re-throwing it in the new zone. If [onError] throws, that error will
  * occur in the original zone where [runZoned] was called.
  */
 @Since("2.8")
-R runZonedGuarded<R>(R body(), void onError(Object error, StackTrace stack),
-    {Map zoneValues, ZoneSpecification zoneSpecification}) {
+R? runZonedGuarded<R>(R body(), void onError(Object error, StackTrace stack),
+    {Map<Object?, Object?>? zoneValues, ZoneSpecification? zoneSpecification}) {
   ArgumentError.checkNotNull(body, "body");
   ArgumentError.checkNotNull(onError, "onError");
-
+  _Zone parentZone = Zone._current;
   HandleUncaughtErrorHandler errorHandler = (Zone self, ZoneDelegate parent,
-      Zone zone, error, StackTrace stackTrace) {
+      Zone zone, Object error, StackTrace stackTrace) {
     try {
-      self.parent.runBinary(onError, error, stackTrace);
+      parentZone.runBinary(onError, error, stackTrace);
     } catch (e, s) {
       if (identical(e, error)) {
         parent.handleUncaughtError(zone, error, stackTrace);
@@ -1601,7 +1611,7 @@
     zoneSpecification =
         new ZoneSpecification(handleUncaughtError: errorHandler);
   } else {
-    zoneSpecification = new ZoneSpecification.from(zoneSpecification,
+    zoneSpecification = ZoneSpecification.from(zoneSpecification,
         handleUncaughtError: errorHandler);
   }
   try {
@@ -1613,7 +1623,8 @@
 }
 
 /// Runs [body] in a new zone based on [zoneValues] and [specification].
-R _runZoned<R>(R body(), Map zoneValues, ZoneSpecification specification) =>
+R _runZoned<R>(R body(), Map<Object?, Object?>? zoneValues,
+        ZoneSpecification? specification) =>
     Zone.current
         .fork(specification: specification, zoneValues: zoneValues)
         .run<R>(body);
diff --git a/sdk/lib/cli/cli.dart b/sdk/lib/cli/cli.dart
index cabc17e..9c19c3a 100644
--- a/sdk/lib/cli/cli.dart
+++ b/sdk/lib/cli/cli.dart
@@ -2,10 +2,7 @@
 // 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.6
-
 /// {@category VM}
-/// {@nodoc}
 library dart.cli;
 
 import 'dart:async';
diff --git a/sdk/lib/cli/wait_for.dart b/sdk/lib/cli/wait_for.dart
index 57202bc..35cb307 100644
--- a/sdk/lib/cli/wait_for.dart
+++ b/sdk/lib/cli/wait_for.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.6
-
 part of dart.cli;
 
 /**
@@ -55,14 +53,15 @@
 // native implementation. In the standalone VM this is set to _waitForEvent()
 // above. If it is null, calling waitFor() will throw an UnsupportedError.
 @pragma("vm:entry-point")
-void Function(int) _waitForEventClosure;
+void Function(int)? _waitForEventClosure;
 
 class _WaitForUtils {
-  static void waitForEvent({Duration timeout}) {
-    if (_waitForEventClosure == null) {
+  static void waitForEvent({Duration? timeout}) {
+    final closure = _waitForEventClosure;
+    if (closure == null) {
       throw new UnsupportedError("waitFor is not supported by this embedder");
     }
-    _waitForEventClosure(timeout == null ? 0 : max(1, timeout.inMilliseconds));
+    closure(timeout == null ? 0 : max(1, timeout.inMilliseconds));
   }
 }
 
@@ -113,12 +112,12 @@
  * subsequent calls block waiting for a condition that is only satisfied when
  * an earlier call returns.
  */
-T waitFor<T>(Future<T> future, {Duration timeout}) {
-  T result;
+T waitFor<T>(Future<T> future, {Duration? timeout}) {
+  late T result;
   bool futureCompleted = false;
-  Object error;
-  StackTrace stacktrace;
-  future.then((r) {
+  Object? error;
+  StackTrace? stacktrace;
+  future.then((T r) {
     futureCompleted = true;
     result = r;
   }, onError: (e, st) {
@@ -126,13 +125,13 @@
     stacktrace = st;
   });
 
-  Stopwatch s;
+  late Stopwatch s;
   if (timeout != null) {
     s = new Stopwatch()..start();
   }
   Timer.run(() {}); // Enusre there is at least one message.
   while (!futureCompleted && (error == null)) {
-    Duration remaining;
+    Duration? remaining;
     if (timeout != null) {
       if (s.elapsed >= timeout) {
         throw new TimeoutException("waitFor() timed out", timeout);
@@ -147,7 +146,7 @@
   Timer.run(() {}); // Ensure that previous calls to waitFor are woken up.
 
   if (error != null) {
-    throw new AsyncError(error, stacktrace);
+    throw new AsyncError(error!, stacktrace);
   }
 
   return result;
diff --git a/sdk/lib/collection/collection.dart b/sdk/lib/collection/collection.dart
index 80f6d93..b050a48 100644
--- a/sdk/lib/collection/collection.dart
+++ b/sdk/lib/collection/collection.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.6
-
 /// Classes and utilities that supplement the collection support in dart:core.
 ///
 /// To use this library in your code:
diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart
index 600dead..9b43996 100644
--- a/sdk/lib/collection/collections.dart
+++ b/sdk/lib/collection/collections.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.6
-
 part of dart.collection;
 
 /// An unmodifiable [List] view of another List.
diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart
index e3da5a2..3990cd2 100644
--- a/sdk/lib/collection/hash_map.dart
+++ b/sdk/lib/collection/hash_map.dart
@@ -2,17 +2,15 @@
 // 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.6
-
 part of dart.collection;
 
-/// Default function for equality comparison in customized HashMaps
-bool _defaultEquals(a, b) => a == b;
+/// Default function for equality comparison in customized HashMaps.
+bool _defaultEquals(Object? a, Object? b) => a == b;
 
-/// Default function for hash-code computation in customized HashMaps
-int _defaultHashCode(a) => a.hashCode;
+/// Default function for hash-code computation in customized HashMaps.
+int _defaultHashCode(Object? a) => a.hashCode;
 
-/// Type of custom equality function
+/// Type of custom equality function.
 typedef _Equality<K> = bool Function(K a, K b);
 
 /// Type of custom hash code function.
@@ -85,9 +83,9 @@
   /// If you supply one of [equals] and [hashCode],
   /// you should generally also to supply the other.
   external factory HashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(potentialKey)});
+      {bool Function(K, K)? equals,
+      int Function(K)? hashCode,
+      bool Function(dynamic)? isValidKey});
 
   /// Creates an unordered identity-based map.
   ///
@@ -101,10 +99,10 @@
   ///
   /// The keys must all be instances of [K] and the values of [V].
   /// The [other] map itself can have any type.
-  factory HashMap.from(Map other) {
-    Map<K, V> result = HashMap<K, V>();
-    other.forEach((k, v) {
-      result[k] = v;
+  factory HashMap.from(Map<dynamic, dynamic> other) {
+    HashMap<K, V> result = HashMap<K, V>();
+    other.forEach((dynamic k, dynamic v) {
+      result[k as K] = v as V;
     });
     return result;
   }
@@ -124,8 +122,8 @@
   /// If no values are specified for [key] and [value] the default is the
   /// identity function.
   factory HashMap.fromIterable(Iterable iterable,
-      {K key(element), V value(element)}) {
-    Map<K, V> map = HashMap<K, V>();
+      {K Function(dynamic element)? key, V Function(dynamic element)? value}) {
+    HashMap<K, V> map = HashMap<K, V>();
     MapBase._fillMapWithMappedIterable(map, iterable, key, value);
     return map;
   }
@@ -140,7 +138,7 @@
   ///
   /// It is an error if the two [Iterable]s don't have the same length.
   factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
-    Map<K, V> map = HashMap<K, V>();
+    HashMap<K, V> map = HashMap<K, V>();
     MapBase._fillMapWithIterables(map, keys, values);
     return map;
   }
diff --git a/sdk/lib/collection/hash_set.dart b/sdk/lib/collection/hash_set.dart
index 97492e9..6ebb04e 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.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.6
-
 part of dart.collection;
 
 /// An unordered hash-table based [Set] implementation.
@@ -66,9 +64,9 @@
   /// and the `isValidKey` defaults to accepting all keys.
   /// Such a map can be created directly using [HashSet.identity].
   external factory HashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(potentialKey)});
+      {bool Function(E, E)? equals,
+      int Function(E)? hashCode,
+      bool Function(dynamic)? isValidKey});
 
   /// Creates an unordered identity-based set.
   ///
@@ -80,7 +78,7 @@
 
   /// Create a hash set containing all [elements].
   ///
-  /// Creates a hash set as by `new HashSet<E>()` and adds all given [elements]
+  /// Creates a hash set as by `HashSet<E>()` and adds all given [elements]
   /// to the set. The elements are added in order. If [elements] contains
   /// two entries that are equal, but not identical, then the first one is
   /// the one in the resulting set.
@@ -91,12 +89,12 @@
   /// ```dart
   /// Set<SuperType> superSet = ...;
   /// Set<SubType> subSet =
-  ///     new HashSet<SubType>.from(superSet.whereType<SubType>());
+  ///     HashSet<SubType>.from(superSet.whereType<SubType>());
   /// ```
-  factory HashSet.from(Iterable elements) {
+  factory HashSet.from(Iterable<dynamic> elements) {
     HashSet<E> result = HashSet<E>();
     for (final e in elements) {
-      result.add(e);
+      result.add(e as E);
     }
     return result;
   }
diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart
index 944466d..17f84a2 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.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.6
-
 part of dart.collection;
 
 /// This [Iterable] mixin implements all [Iterable] members except `iterator`.
@@ -35,7 +33,7 @@
     return FollowedByIterable<E>(this, other);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     for (E e in this) {
       if (e == element) return true;
     }
@@ -159,7 +157,7 @@
     return result;
   }
 
-  E firstWhere(bool test(E value), {E orElse()}) {
+  E firstWhere(bool test(E value), {E Function()? orElse}) {
     for (E element in this) {
       if (test(element)) return element;
     }
@@ -167,8 +165,8 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E value), {E orElse()}) {
-    E result;
+  E lastWhere(bool test(E value), {E Function()? orElse}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -181,8 +179,8 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E element), {E orElse()}) {
-    E result;
+  E singleWhere(bool test(E element), {E Function()? orElse}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -277,7 +275,7 @@
 }
 
 /// A collection used to identify cyclic lists during toString() calls.
-final List _toStringVisiting = [];
+final List<Object> _toStringVisiting = [];
 
 /// Check if we are currently visiting `o` in a toString call.
 bool _isToStringVisiting(Object o) {
@@ -288,7 +286,7 @@
 }
 
 /// Convert elements of [iterable] to strings and store them in [parts].
-void _iterablePartsToStrings(Iterable iterable, List<String> parts) {
+void _iterablePartsToStrings(Iterable<Object?> iterable, List<String> parts) {
   /*
    * This is the complicated part of [iterableToShortString].
    * It is extracted as a separate function to avoid having too much code
@@ -313,7 +311,7 @@
 
   int length = 0;
   int count = 0;
-  Iterator it = iterable.iterator;
+  Iterator<Object?> it = iterable.iterator;
   // Initial run of elements, at least headCount, and then continue until
   // passing at most lengthLimit characters.
   while (length < lengthLimit || count < headCount) {
@@ -329,14 +327,12 @@
 
   // Find last two elements. One or more of them may already be in the
   // parts array. Include their length in `length`.
-  Object penultimate;
-  Object ultimate;
   if (!it.moveNext()) {
     if (count <= headCount + tailCount) return;
     ultimateString = parts.removeLast();
     penultimateString = parts.removeLast();
   } else {
-    penultimate = it.current;
+    Object? penultimate = it.current;
     count++;
     if (!it.moveNext()) {
       if (count <= headCount + 1) {
@@ -347,7 +343,7 @@
       penultimateString = parts.removeLast();
       length += ultimateString.length + overhead;
     } else {
-      ultimate = it.current;
+      Object? ultimate = it.current;
       count++;
       // Then keep looping, keeping the last two elements in variables.
       assert(count < maxCount);
@@ -380,7 +376,7 @@
 
   // If there is a gap between the initial run and the last two,
   // prepare to add an ellipsis.
-  String elision;
+  String? elision;
   if (count > parts.length + tailCount) {
     elision = "...";
     length += ellipsisSize + overhead;
diff --git a/sdk/lib/collection/iterator.dart b/sdk/lib/collection/iterator.dart
index 05bcfae..671f0ee 100644
--- a/sdk/lib/collection/iterator.dart
+++ b/sdk/lib/collection/iterator.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.6
-
 part of dart.collection;
 
 /// The [HasNextIterator] class wraps an [Iterator] and provides methods to
diff --git a/sdk/lib/collection/linked_hash_map.dart b/sdk/lib/collection/linked_hash_map.dart
index 548bc49..9dfdb99 100644
--- a/sdk/lib/collection/linked_hash_map.dart
+++ b/sdk/lib/collection/linked_hash_map.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.6
-
 part of dart.collection;
 
 /// A hash-table based implementation of [Map].
@@ -69,9 +67,9 @@
   /// If you supply one of [equals] and [hashCode],
   /// you should generally also to supply the other.
   external factory LinkedHashMap(
-      {bool equals(K key1, K key2),
-      int hashCode(K key),
-      bool isValidKey(potentialKey)});
+      {bool Function(K, K)? equals,
+      int Function(K)? hashCode,
+      bool Function(dynamic)? isValidKey});
 
   /// Creates an insertion-ordered identity-based map.
   ///
@@ -85,10 +83,10 @@
   ///
   /// The keys must all be instances of [K] and the values to [V].
   /// The [other] map itself can have any type.
-  factory LinkedHashMap.from(Map other) {
+  factory LinkedHashMap.from(Map<dynamic, dynamic> other) {
     LinkedHashMap<K, V> result = LinkedHashMap<K, V>();
-    other.forEach((k, v) {
-      result[k] = v;
+    other.forEach((dynamic k, dynamic v) {
+      result[k as K] = v as V;
     });
     return result;
   }
@@ -109,7 +107,7 @@
   /// If no values are specified for [key] and [value] the default is the
   /// identity function.
   factory LinkedHashMap.fromIterable(Iterable iterable,
-      {K key(element), V value(element)}) {
+      {K Function(dynamic element)? key, V Function(dynamic element)? value}) {
     LinkedHashMap<K, V> map = LinkedHashMap<K, V>();
     MapBase._fillMapWithMappedIterable(map, iterable, key, value);
     return map;
@@ -139,5 +137,5 @@
   /// later occurrences overwrite the earlier ones.
   @Since("2.1")
   factory LinkedHashMap.fromEntries(Iterable<MapEntry<K, V>> entries) =>
-      <K, V>{}..addEntries(entries);
+      LinkedHashMap<K, V>()..addEntries(entries);
 }
diff --git a/sdk/lib/collection/linked_hash_set.dart b/sdk/lib/collection/linked_hash_set.dart
index 4fb199b..c4f6818 100644
--- a/sdk/lib/collection/linked_hash_set.dart
+++ b/sdk/lib/collection/linked_hash_set.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.6
-
 part of dart.collection;
 
 /// A [LinkedHashSet] is a hash-table based [Set] implementation.
@@ -73,9 +71,9 @@
   /// and the `isValidKey` defaults to accepting all keys.
   /// Such a map can be created directly using [LinkedHashSet.identity].
   external factory LinkedHashSet(
-      {bool equals(E e1, E e2),
-      int hashCode(E e),
-      bool isValidKey(potentialKey)});
+      {bool Function(E, E)? equals,
+      int Function(E)? hashCode,
+      bool Function(dynamic)? isValidKey});
 
   /// Creates an insertion-ordered identity-based set.
   ///
@@ -97,10 +95,10 @@
   ///     Set<SuperType> superSet = ...;
   ///     Iterable<SuperType> tmp = superSet.where((e) => e is SubType);
   ///     Set<SubType> subSet = new LinkedHashSet<SubType>.from(tmp);
-  factory LinkedHashSet.from(Iterable elements) {
+  factory LinkedHashSet.from(Iterable<dynamic> elements) {
     LinkedHashSet<E> result = LinkedHashSet<E>();
     for (final element in elements) {
-      result.add(element);
+      result.add(element as E);
     }
     return result;
   }
diff --git a/sdk/lib/collection/linked_list.dart b/sdk/lib/collection/linked_list.dart
index 94f30cf..843eedd 100644
--- a/sdk/lib/collection/linked_list.dart
+++ b/sdk/lib/collection/linked_list.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.6
-
 part of dart.collection;
 
 /// A specialized double-linked list of elements that extends [LinkedListEntry].
@@ -30,7 +28,7 @@
 class LinkedList<E extends LinkedListEntry<E>> extends Iterable<E> {
   int _modificationCount = 0;
   int _length = 0;
-  E _first;
+  E? _first;
 
   /// Construct a new empty linked list.
   LinkedList();
@@ -72,10 +70,10 @@
     _modificationCount++;
     if (isEmpty) return;
 
-    E next = _first;
+    E next = _first!;
     do {
       E entry = next;
-      next = entry._next;
+      next = entry._next!;
       entry._next = entry._previous = entry._list = null;
     } while (!identical(next, _first));
 
@@ -87,14 +85,14 @@
     if (isEmpty) {
       throw StateError('No such element');
     }
-    return _first;
+    return _first!;
   }
 
   E get last {
     if (isEmpty) {
       throw StateError('No such element');
     }
-    return _first._previous;
+    return _first!._previous!;
   }
 
   E get single {
@@ -104,23 +102,23 @@
     if (_length > 1) {
       throw StateError('Too many elements');
     }
-    return _first;
+    return _first!;
   }
 
   /// Call [action] with each entry in this linked list.
   ///
-  /// It's an error if [action] modify the linked list.
+  /// It's an error if [action] modifies the linked list.
   void forEach(void action(E entry)) {
     int modificationCount = _modificationCount;
     if (isEmpty) return;
 
-    E current = _first;
+    E current = _first!;
     do {
       action(current);
       if (modificationCount != _modificationCount) {
         throw ConcurrentModificationError(this);
       }
-      current = current._next;
+      current = current._next!;
     } while (!identical(current, _first));
   }
 
@@ -130,7 +128,7 @@
   ///
   /// If [updateFirst] is true and [entry] is the first entry in the list,
   /// updates the [_first] field to point to the [newEntry] as first entry.
-  void _insertBefore(E entry, E newEntry, {bool updateFirst}) {
+  void _insertBefore(E? entry, E newEntry, {required bool updateFirst}) {
     if (newEntry.list != null) {
       throw StateError('LinkedListEntry is already in a LinkedList');
     }
@@ -144,7 +142,7 @@
       _length++;
       return;
     }
-    E predecessor = entry._previous;
+    E predecessor = entry!._previous!;
     E successor = entry;
     newEntry._previous = predecessor;
     newEntry._next = successor;
@@ -158,8 +156,8 @@
 
   void _unlink(E entry) {
     _modificationCount++;
-    entry._next._previous = entry._previous;
-    E next = entry._previous._next = entry._next;
+    entry._next!._previous = entry._previous;
+    E? next = entry._previous!._next = entry._next;
     _length--;
     entry._list = entry._next = entry._previous = null;
     if (isEmpty) {
@@ -173,8 +171,8 @@
 class _LinkedListIterator<E extends LinkedListEntry<E>> implements Iterator<E> {
   final LinkedList<E> _list;
   final int _modificationCount;
-  E _current;
-  LinkedListEntry<E> _next;
+  E? _current;
+  E? _next;
   bool _visitedFirst;
 
   _LinkedListIterator(LinkedList<E> list)
@@ -183,7 +181,10 @@
         _next = list._first,
         _visitedFirst = false;
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 
   bool moveNext() {
     if (_modificationCount != _list._modificationCount) {
@@ -195,7 +196,7 @@
     }
     _visitedFirst = true;
     _current = _next;
-    _next = _next._next;
+    _next = _next!._next;
     return true;
   }
 }
@@ -213,28 +214,28 @@
 ///
 /// When created, an entry is not in any linked list.
 abstract class LinkedListEntry<E extends LinkedListEntry<E>> {
-  LinkedList<E> _list;
-  E _next;
-  E _previous;
+  LinkedList<E>? _list;
+  E? _next;
+  E? _previous;
 
   /// Get the linked list containing this element.
   ///
   /// Returns `null` if this entry is not currently in any list.
-  LinkedList<E> get list => _list;
+  LinkedList<E>? get list => _list;
 
   /// Unlink the element from its linked list.
   ///
   /// The entry must currently be in a linked list when this method is called.
   void unlink() {
-    _list._unlink(this);
+    _list!._unlink(this as E);
   }
 
   /// Return the successor of this element in its linked list.
   ///
   /// Returns `null` if there is no successor in the linked list, or if this
   /// entry is not currently in any list.
-  E get next {
-    if (_list == null || identical(_list.first, _next)) return null;
+  E? get next {
+    if (_list == null || identical(_list!.first, _next)) return null;
     return _next;
   }
 
@@ -242,8 +243,8 @@
   ///
   /// Returns `null` if there is no predecessor in the linked list, or if this
   /// entry is not currently in any list.
-  E get previous {
-    if (_list == null || identical(this, _list.first)) return null;
+  E? get previous {
+    if (_list == null || identical(this, _list!.first)) return null;
     return _previous;
   }
 
@@ -252,7 +253,7 @@
   /// This entry must be in a linked list when this method is called.
   /// The [entry] must not be in a linked list.
   void insertAfter(E entry) {
-    _list._insertBefore(_next, entry, updateFirst: false);
+    _list!._insertBefore(_next, entry, updateFirst: false);
   }
 
   /// Insert an element before this element in this element's linked list.
@@ -260,6 +261,6 @@
   /// This entry must be in a linked list when this method is called.
   /// The [entry] must not be in a linked list.
   void insertBefore(E entry) {
-    _list._insertBefore(this, entry, updateFirst: true);
+    _list!._insertBefore(this as E, entry, updateFirst: true);
   }
 }
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 3009b37..fdf2f8a 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.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.6
-
 part of dart.collection;
 
 /// Abstract implementation of a list.
@@ -15,13 +13,13 @@
 /// `operator[]=` and `length=`, which need to be implemented.
 ///
 /// *NOTICE*: Forwarding just these four operations to a normal growable [List]
-/// (as created by `new List()`) will give very bad performance for `add` and
+/// (as created by `[]`) will give very bad performance for `add` and
 /// `addAll` operations of `ListBase`. These operations are implemented by
 /// increasing the length of the list by one for each `add` operation, and
 /// repeatedly increasing the length of a growable list is not efficient.
 /// To avoid this, either override 'add' and 'addAll' to also forward directly
 /// to the growable list, or, preferably, use `DelegatingList` from
-/// "package:collection/wrappers.dart" instead.
+/// "package:collection/collection.dart" instead.
 abstract class ListBase<E> extends Object with ListMixin<E> {
   /// Converts a [List] to a [String].
   ///
@@ -45,13 +43,13 @@
 /// `length=` and `operator[]=`
 ///
 /// *NOTICE*: Forwarding just these four operations to a normal growable [List]
-/// (as created by `new List()`) will give very bad performance for `add` and
+/// (as created by `[]`) will give very bad performance for `add` and
 /// `addAll` operations of `ListBase`. These operations are implemented by
 /// increasing the length of the list by one for each `add` operation, and
 /// repeatedly increasing the length of a growable list is not efficient.
 /// To avoid this, either override 'add' and 'addAll' to also forward directly
 /// to the growable list, or, if possible, use `DelegatingList` from
-/// "package:collection/wrappers.dart" instead.
+/// "package:collection/collection.dart" instead.
 abstract class ListMixin<E> implements List<E> {
   // Iterable interface.
   // TODO(lrn): When we get composable mixins, reuse IterableMixin instead
@@ -104,7 +102,7 @@
     return this[0];
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     int length = this.length;
     for (int i = 0; i < length; i++) {
       if (this[i] == element) return true;
@@ -137,7 +135,7 @@
     return false;
   }
 
-  E firstWhere(bool test(E element), {E orElse()}) {
+  E firstWhere(bool test(E element), {E Function()? orElse}) {
     int length = this.length;
     for (int i = 0; i < length; i++) {
       E element = this[i];
@@ -150,7 +148,7 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E element), {E orElse()}) {
+  E lastWhere(bool test(E element), {E Function()? orElse}) {
     int length = this.length;
     for (int i = length - 1; i >= 0; i--) {
       E element = this[i];
@@ -163,9 +161,9 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E element), {E orElse()}) {
+  E singleWhere(bool test(E element), {E Function()? orElse}) {
     int length = this.length;
-    E match;
+    late E match;
     bool matchFound = false;
     for (int i = 0; i < length; i++) {
       E element = this[i];
@@ -238,13 +236,10 @@
   }
 
   List<E> toList({bool growable = true}) {
-    List<E> result;
-    if (growable) {
-      result = <E>[]..length = length;
-    } else {
-      result = List<E>(length);
-    }
-    for (int i = 0; i < length; i++) {
+    if (this.isEmpty) return List<E>.empty(growable: growable);
+    var first = this[0];
+    var result = List<E>.filled(this.length, first, growable: growable);
+    for (int i = 1; i < this.length; i++) {
       result[i] = this[i];
     }
     return result;
@@ -267,13 +262,12 @@
     int i = this.length;
     for (E element in iterable) {
       assert(this.length == i || (throw ConcurrentModificationError(this)));
-      this.length = i + 1;
-      this[i] = element;
+      add(element);
       i++;
     }
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     for (int i = 0; i < this.length; i++) {
       if (this[i] == element) {
         this._closeGap(i, i + 1);
@@ -337,18 +331,18 @@
     return result;
   }
 
-  void sort([int compare(E a, E b)]) {
+  void sort([int Function(E a, E b)? compare]) {
     Sort.sort(this, compare ?? _compareAny);
   }
 
-  static int _compareAny(a, b) {
-    // In strong mode Comparable.compare requires an implicit cast to ensure
-    // `a` and `b` are Comparable.
-    return Comparable.compare(a, b);
+  static int _compareAny(dynamic a, dynamic b) {
+    return Comparable.compare(a as Comparable, b as Comparable);
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     random ??= Random();
+    if (random == null) throw "!"; // TODO(38493): The `??=` should promote.
+
     int length = this.length;
     while (length > 1) {
       int pos = random.nextInt(length);
@@ -363,23 +357,15 @@
     return ListMapView<E>(this);
   }
 
-  List<E> operator +(List<E> other) {
-    var result = <E>[]..length = (this.length + other.length);
-    result.setRange(0, this.length, this);
-    result.setRange(this.length, result.length, other);
-    return result;
-  }
+  List<E> operator +(List<E> other) => [...this, ...other];
 
-  List<E> sublist(int start, [int end]) {
+  List<E> sublist(int start, [int? end]) {
     int listLength = this.length;
     end ??= listLength;
+    if (end == null) throw "!"; // TODO(38493): The `??=` should promote.
+
     RangeError.checkValidRange(start, end, listLength);
-    int length = end - start;
-    List<E> result = <E>[]..length = length;
-    for (int i = 0; i < length; i++) {
-      result[i] = this[start + i];
-    }
-    return result;
+    return List.from(getRange(start, end));
   }
 
   Iterable<E> getRange(int start, int end) {
@@ -394,10 +380,13 @@
     }
   }
 
-  void fillRange(int start, int end, [E fill]) {
+  void fillRange(int start, int end, [E? fill]) {
+    // Hoist the case to fail eagerly if the user provides an invalid `null`
+    // value (or omits it) when E is a non-nullable type.
+    E value = fill as E;
     RangeError.checkValidRange(start, end, this.length);
     for (int i = start; i < end; i++) {
-      this[i] = fill;
+      this[i] = value;
     }
   }
 
@@ -434,6 +423,10 @@
 
   void replaceRange(int start, int end, Iterable<E> newContents) {
     RangeError.checkValidRange(start, end, this.length);
+    if (start == this.length) {
+      addAll(newContents);
+      return;
+    }
     if (newContents is! EfficientLengthIterable) {
       newContents = newContents.toList();
     }
@@ -445,17 +438,31 @@
       if (removeLength > insertLength) {
         _closeGap(insertEnd, end);
       }
+    } else if (end == this.length) {
+      int i = start;
+      for (E element in newContents) {
+        if (i < end) {
+          this[i] = element;
+        } else {
+          add(element);
+        }
+        i++;
+      }
     } else {
       int delta = insertLength - removeLength;
-      int newLength = this.length + delta;
+      int oldLength = this.length;
       int insertEnd = start + insertLength; // aka. end + delta.
-      this.length = newLength;
-      this.setRange(insertEnd, newLength, this, end);
+      for (int i = oldLength - delta; i < oldLength; ++i) {
+        add(this[i > 0 ? i : 0]);
+      }
+      if (insertEnd < oldLength) {
+        this.setRange(insertEnd, oldLength, this, end);
+      }
       this.setRange(start, insertEnd, newContents);
     }
   }
 
-  int indexOf(Object element, [int start = 0]) {
+  int indexOf(Object? element, [int start = 0]) {
     if (start < 0) start = 0;
     for (int i = start; i < this.length; i++) {
       if (this[i] == element) return i;
@@ -471,16 +478,24 @@
     return -1;
   }
 
-  int lastIndexOf(Object element, [int start]) {
+  int lastIndexOf(Object? element, [int? start]) {
     if (start == null || start >= this.length) start = this.length - 1;
+
+    // TODO(38493): The previous line should promote.
+    if (start == null) throw "!";
+
     for (int i = start; i >= 0; i--) {
       if (this[i] == element) return i;
     }
     return -1;
   }
 
-  int lastIndexWhere(bool test(E element), [int start]) {
+  int lastIndexWhere(bool test(E element), [int? start]) {
     if (start == null || start >= this.length) start = this.length - 1;
+
+    // TODO(38493): The previous line should promote.
+    if (start == null) throw "!";
+
     for (int i = start; i >= 0; i--) {
       if (test(this[i])) return i;
     }
@@ -507,21 +522,34 @@
 
   void insertAll(int index, Iterable<E> iterable) {
     RangeError.checkValueInInterval(index, 0, length, "index");
+    if (index == length) {
+      addAll(iterable);
+      return;
+    }
     if (iterable is! EfficientLengthIterable || identical(iterable, this)) {
       iterable = iterable.toList();
     }
     int insertionLength = iterable.length;
+    if (insertionLength == 0) {
+      return;
+    }
     // There might be errors after the length change, in which case the list
     // will end up being modified but the operation not complete. Unless we
     // always go through a "toList" we can't really avoid that.
-    this.length += insertionLength;
+    int oldLength = length;
+    for (int i = oldLength - insertionLength; i < oldLength; ++i) {
+      add(this[i > 0 ? i : 0]);
+    }
     if (iterable.length != insertionLength) {
       // If the iterable's length is linked to this list's length somehow,
       // we can't insert one in the other.
       this.length -= insertionLength;
       throw ConcurrentModificationError(iterable);
     }
-    setRange(index + insertionLength, this.length, this, index);
+    int oldCopyStart = index + insertionLength;
+    if (oldCopyStart < oldLength) {
+      setRange(oldCopyStart, oldLength, this, index);
+    }
     setAll(index, iterable);
   }
 
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index 3204db0..85a3155 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.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.6
-
 part of dart.collection;
 
 /// Base class for implementing a [Map].
@@ -21,7 +19,7 @@
 /// A more efficient implementation is usually possible by overriding
 /// some of the other members as well.
 abstract class MapBase<K, V> extends MapMixin<K, V> {
-  static String mapToString(Map m) {
+  static String mapToString(Map<Object?, Object?> m) {
     // Reuses the list in IterableBase for detecting toString cycles.
     if (_isToStringVisiting(m)) {
       return '{...}';
@@ -32,7 +30,7 @@
       _toStringVisiting.add(m);
       result.write('{');
       bool first = true;
-      m.forEach((k, v) {
+      m.forEach((Object? k, Object? v) {
         if (!first) {
           result.write(', ');
         }
@@ -50,17 +48,23 @@
     return result.toString();
   }
 
-  static _id(x) => x;
+  static Object? _id(Object? x) => x;
 
   /// Fills a [Map] with key/value pairs computed from [iterable].
   ///
   /// This method is used by [Map] classes in the named constructor
   /// `fromIterable`.
   static void _fillMapWithMappedIterable(
-      Map map, Iterable iterable, key(element), value(element)) {
+      Map<Object?, Object?> map,
+      Iterable<Object?> iterable,
+      Object? Function(Object? element)? key,
+      Object? Function(Object? element)? value) {
     key ??= _id;
     value ??= _id;
 
+    if (key == null) throw "!"; // TODO(38493): The `??=` should promote.
+    if (value == null) throw "!"; // TODO(38493): The `??=` should promote.
+
     for (var element in iterable) {
       map[key(element)] = value(element);
     }
@@ -70,9 +74,10 @@
   ///
   /// This method is used by [Map] classes in the named constructor
   /// `fromIterables`.
-  static void _fillMapWithIterables(Map map, Iterable keys, Iterable values) {
-    Iterator keyIterator = keys.iterator;
-    Iterator valueIterator = values.iterator;
+  static void _fillMapWithIterables(Map<Object?, Object?> map,
+      Iterable<Object?> keys, Iterable<Object?> values) {
+    Iterator<Object?> keyIterator = keys.iterator;
+    Iterator<Object?> valueIterator = values.iterator;
 
     bool hasNextKey = keyIterator.moveNext();
     bool hasNextValue = valueIterator.moveNext();
@@ -105,9 +110,9 @@
 /// some of the other members as well.
 abstract class MapMixin<K, V> implements Map<K, V> {
   Iterable<K> get keys;
-  V operator [](Object key);
+  V? operator [](Object? key);
   operator []=(K key, V value);
-  V remove(Object key);
+  V? remove(Object? key);
   // The `clear` operation should not be based on `remove`.
   // It should clear the map even if some keys are not equal to themselves.
   void clear();
@@ -115,17 +120,17 @@
   Map<RK, RV> cast<RK, RV>() => Map.castFrom<K, V, RK, RV>(this);
   void forEach(void action(K key, V value)) {
     for (K key in keys) {
-      action(key, this[key]);
+      action(key, this[key] as V);
     }
   }
 
   void addAll(Map<K, V> other) {
     for (K key in other.keys) {
-      this[key] = other[key];
+      this[key] = other[key] as V;
     }
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (K key in keys) {
       if (this[key] == value) return true;
     }
@@ -134,14 +139,14 @@
 
   V putIfAbsent(K key, V ifAbsent()) {
     if (containsKey(key)) {
-      return this[key];
+      return this[key] as V;
     }
     return this[key] = ifAbsent();
   }
 
-  V update(K key, V update(V value), {V ifAbsent()}) {
+  V update(K key, V update(V value), {V Function()? ifAbsent}) {
     if (this.containsKey(key)) {
-      return this[key] = update(this[key]);
+      return this[key] = update(this[key] as V);
     }
     if (ifAbsent != null) {
       return this[key] = ifAbsent();
@@ -151,18 +156,18 @@
 
   void updateAll(V update(K key, V value)) {
     for (var key in this.keys) {
-      this[key] = update(key, this[key]);
+      this[key] = update(key, this[key] as V);
     }
   }
 
   Iterable<MapEntry<K, V>> get entries {
-    return keys.map((K key) => MapEntry<K, V>(key, this[key]));
+    return keys.map((K key) => MapEntry<K, V>(key, this[key] as V));
   }
 
   Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(K key, V value)) {
     var result = <K2, V2>{};
     for (var key in this.keys) {
-      var entry = transform(key, this[key]);
+      var entry = transform(key, this[key] as V);
       result[entry.key] = entry.value;
     }
     return result;
@@ -177,14 +182,14 @@
   void removeWhere(bool test(K key, V value)) {
     var keysToRemove = <K>[];
     for (var key in keys) {
-      if (test(key, this[key])) keysToRemove.add(key);
+      if (test(key, this[key] as V)) keysToRemove.add(key);
     }
     for (var key in keysToRemove) {
       this.remove(key);
     }
   }
 
-  bool containsKey(Object key) => keys.contains(key);
+  bool containsKey(Object? key) => keys.contains(key);
   int get length => keys.length;
   bool get isEmpty => keys.isEmpty;
   bool get isNotEmpty => keys.isNotEmpty;
@@ -224,9 +229,9 @@
   int get length => _map.length;
   bool get isEmpty => _map.isEmpty;
   bool get isNotEmpty => _map.isNotEmpty;
-  V get first => _map[_map.keys.first];
-  V get single => _map[_map.keys.single];
-  V get last => _map[_map.keys.last];
+  V get first => _map[_map.keys.first] as V;
+  V get single => _map[_map.keys.single] as V;
+  V get last => _map[_map.keys.last] as V;
 
   Iterator<V> get iterator => _MapBaseValueIterator<K, V>(_map);
 }
@@ -238,7 +243,7 @@
 class _MapBaseValueIterator<K, V> implements Iterator<V> {
   final Iterator<K> _keys;
   final Map<K, V> _map;
-  V _current;
+  V? _current;
 
   _MapBaseValueIterator(Map<K, V> map)
       : _map = map,
@@ -253,7 +258,10 @@
     return false;
   }
 
-  V get current => _current;
+  V get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as V;
+  }
 }
 
 /// Mixin that overrides mutating map operations with implementations that
@@ -280,7 +288,7 @@
   }
 
   /// This operation is not supported by an unmodifiable map.
-  V remove(Object key) {
+  V remove(Object? key) {
     throw UnsupportedError("Cannot modify unmodifiable map");
   }
 
@@ -295,7 +303,7 @@
   }
 
   /// This operation is not supported by an unmodifiable map.
-  V update(K key, V update(V value), {V ifAbsent()}) {
+  V update(K key, V update(V value), {V Function()? ifAbsent}) {
     throw UnsupportedError("Cannot modify unmodifiable map");
   }
 
@@ -317,7 +325,7 @@
   const MapView(Map<K, V> map) : _map = map;
 
   Map<RK, RV> cast<RK, RV>() => _map.cast<RK, RV>();
-  V operator [](Object key) => _map[key];
+  V? operator [](Object? key) => _map[key];
   void operator []=(K key, V value) {
     _map[key] = value;
   }
@@ -331,8 +339,8 @@
   }
 
   V putIfAbsent(K key, V ifAbsent()) => _map.putIfAbsent(key, ifAbsent);
-  bool containsKey(Object key) => _map.containsKey(key);
-  bool containsValue(Object value) => _map.containsValue(value);
+  bool containsKey(Object? key) => _map.containsKey(key);
+  bool containsValue(Object? value) => _map.containsValue(value);
   void forEach(void action(K key, V value)) {
     _map.forEach(action);
   }
@@ -341,7 +349,7 @@
   bool get isNotEmpty => _map.isNotEmpty;
   int get length => _map.length;
   Iterable<K> get keys => _map.keys;
-  V remove(Object key) => _map.remove(key);
+  V? remove(Object? key) => _map.remove(key);
   String toString() => _map.toString();
   Iterable<V> get values => _map.values;
 
@@ -354,7 +362,7 @@
   Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(K key, V value)) =>
       _map.map<K2, V2>(transform);
 
-  V update(K key, V update(V value), {V ifAbsent()}) =>
+  V update(K key, V update(V value), {V Function()? ifAbsent}) =>
       _map.update(key, update, ifAbsent: ifAbsent);
 
   void updateAll(V update(K key, V value)) {
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index f51cdb5..26abbfe 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.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.6
-
 part of dart.collection;
 
 /// A [Queue] is a collection that can be manipulated at both ends. One
@@ -91,7 +89,7 @@
   ///
   /// Returns `true` if a value was removed, or `false` if the queue
   /// contained no element equal to [value].
-  bool remove(Object value);
+  bool remove(Object? value);
 
   /// Adds all elements of [iterable] at the end of the queue. The
   /// length of the queue is extended by the length of [iterable].
@@ -112,19 +110,19 @@
 }
 
 class _DoubleLink<Link extends _DoubleLink<Link>> {
-  Link _previousLink;
-  Link _nextLink;
+  Link? _previousLink;
+  Link? _nextLink;
 
-  void _link(Link previous, Link next) {
+  void _link(Link? previous, Link? next) {
     _nextLink = next;
     _previousLink = previous;
-    if (previous != null) previous._nextLink = this;
-    if (next != null) next._previousLink = this;
+    if (previous != null) previous._nextLink = this as Link;
+    if (next != null) next._previousLink = this as Link;
   }
 
   void _unlink() {
-    if (_previousLink != null) _previousLink._nextLink = _nextLink;
-    if (_nextLink != null) _nextLink._previousLink = _previousLink;
+    if (_previousLink != null) _previousLink!._nextLink = _nextLink;
+    if (_nextLink != null) _nextLink!._previousLink = _previousLink;
     _nextLink = null;
     _previousLink = null;
   }
@@ -133,10 +131,19 @@
 /// An entry in a doubly linked list. It contains a pointer to the next
 /// entry, the previous entry, and the boxed element.
 class DoubleLinkedQueueEntry<E> extends _DoubleLink<DoubleLinkedQueueEntry<E>> {
-  /// The element in the queue.
-  E element;
+  // TODO(rnystrom): This needs to be nullable because the subclass
+  // _DoubleLinkedQueueSentinel does not have an element. A cleaner solution is
+  // probably to refactor the class hierarchy so that _DoubleLinkedQueueSentinel
+  // does not inherit an element field.
+  E? _element;
 
-  DoubleLinkedQueueEntry(this.element);
+  /// The element in the queue.
+  E get element => _element as E;
+  set element(E element) {
+    _element = element;
+  }
+
+  DoubleLinkedQueueEntry(this._element);
 
   /// Appends the given [e] as entry just after this entry.
   void append(E e) {
@@ -154,10 +161,10 @@
   }
 
   /// Returns the previous entry or `null` if there is none.
-  DoubleLinkedQueueEntry<E> previousEntry() => _previousLink;
+  DoubleLinkedQueueEntry<E>? previousEntry() => _previousLink;
 
   /// Returns the next entry or `null` if there is none.
-  DoubleLinkedQueueEntry<E> nextEntry() => _nextLink;
+  DoubleLinkedQueueEntry<E>? nextEntry() => _nextLink;
 }
 
 /// Interface for the link classes used by [DoubleLinkedQueue].
@@ -167,10 +174,10 @@
 /// The entry contains a link back to the queue, so calling `append`
 /// or `prepend` can correctly update the element count.
 abstract class _DoubleLinkedQueueEntry<E> extends DoubleLinkedQueueEntry<E> {
-  DoubleLinkedQueue<E> _queue;
-  _DoubleLinkedQueueEntry(E element, this._queue) : super(element);
+  DoubleLinkedQueue<E>? _queue;
+  _DoubleLinkedQueueEntry(E? element, this._queue) : super(element);
 
-  DoubleLinkedQueueEntry<E> _asNonSentinelEntry();
+  DoubleLinkedQueueEntry<E>? _asNonSentinelEntry();
 
   void _append(E e) {
     _DoubleLinkedQueueElement<E>(e, _queue)._link(this, _nextLink);
@@ -182,15 +189,16 @@
 
   E _remove();
 
-  E get _element => element;
+  E get _element => super._element as E;
 
-  DoubleLinkedQueueEntry<E> nextEntry() {
-    _DoubleLinkedQueueEntry<E> entry = _nextLink;
+  DoubleLinkedQueueEntry<E>? nextEntry() {
+    _DoubleLinkedQueueEntry<E> entry = _nextLink as _DoubleLinkedQueueEntry<E>;
     return entry._asNonSentinelEntry();
   }
 
-  DoubleLinkedQueueEntry<E> previousEntry() {
-    _DoubleLinkedQueueEntry<E> entry = _previousLink;
+  DoubleLinkedQueueEntry<E>? previousEntry() {
+    _DoubleLinkedQueueEntry<E> entry =
+        _previousLink as _DoubleLinkedQueueEntry<E>;
     return entry._asNonSentinelEntry();
   }
 }
@@ -200,17 +208,17 @@
 /// The entry contains a reference to the queue, allowing
 /// [append]/[prepend] to update the list length.
 class _DoubleLinkedQueueElement<E> extends _DoubleLinkedQueueEntry<E> {
-  _DoubleLinkedQueueElement(E element, DoubleLinkedQueue<E> queue)
+  _DoubleLinkedQueueElement(E element, DoubleLinkedQueue<E>? queue)
       : super(element, queue);
 
   void append(E e) {
     _append(e);
-    if (_queue != null) _queue._elementCount++;
+    if (_queue != null) _queue!._elementCount++;
   }
 
   void prepend(E e) {
     _prepend(e);
-    if (_queue != null) _queue._elementCount++;
+    if (_queue != null) _queue!._elementCount++;
   }
 
   E _remove() {
@@ -220,11 +228,11 @@
   }
 
   E remove() {
-    if (_queue != null) _queue._elementCount--;
+    if (_queue != null) _queue!._elementCount--;
     return _remove();
   }
 
-  _DoubleLinkedQueueElement<E> _asNonSentinelEntry() {
+  _DoubleLinkedQueueElement<E>? _asNonSentinelEntry() {
     return this;
   }
 }
@@ -241,7 +249,7 @@
     _nextLink = this;
   }
 
-  DoubleLinkedQueueEntry<E> _asNonSentinelEntry() {
+  DoubleLinkedQueueEntry<E>? _asNonSentinelEntry() {
     return null;
   }
 
@@ -260,12 +268,12 @@
 ///
 /// Allows constant time add, remove-at-ends and peek operations.
 class DoubleLinkedQueue<E> extends Iterable<E> implements Queue<E> {
-  _DoubleLinkedQueueSentinel<E> _sentinel;
+  late _DoubleLinkedQueueSentinel<E> _sentinel =
+      _DoubleLinkedQueueSentinel<E>(this);
+
   int _elementCount = 0;
 
-  DoubleLinkedQueue() {
-    _sentinel = _DoubleLinkedQueueSentinel<E>(this);
-  }
+  DoubleLinkedQueue();
 
   /// Creates a double-linked queue containing all [elements].
   ///
@@ -280,10 +288,10 @@
   /// Queue<SubType> subQueue =
   ///     new DoubleLinkedQueue<SubType>.from(superQueue.whereType<SubType>());
   /// ```
-  factory DoubleLinkedQueue.from(Iterable elements) {
-    Queue<E> list = DoubleLinkedQueue<E>();
+  factory DoubleLinkedQueue.from(Iterable<dynamic> elements) {
+    DoubleLinkedQueue<E> list = DoubleLinkedQueue<E>();
     for (final e in elements) {
-      list.addLast(e);
+      list.addLast(e as E);
     }
     return list;
   }
@@ -321,21 +329,24 @@
   }
 
   E removeLast() {
-    _DoubleLinkedQueueEntry<E> lastEntry = _sentinel._previousLink;
+    _DoubleLinkedQueueEntry<E> lastEntry =
+        _sentinel._previousLink as _DoubleLinkedQueueEntry<E>;
     E result = lastEntry._remove();
     _elementCount--;
     return result;
   }
 
   E removeFirst() {
-    _DoubleLinkedQueueEntry<E> firstEntry = _sentinel._nextLink;
+    _DoubleLinkedQueueEntry<E> firstEntry =
+        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
     E result = firstEntry._remove();
     _elementCount--;
     return result;
   }
 
-  bool remove(Object o) {
-    _DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink;
+  bool remove(Object? o) {
+    _DoubleLinkedQueueEntry<E> entry =
+        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
     while (!identical(entry, _sentinel)) {
       bool equals = (entry._element == o);
       if (!identical(this, entry._queue)) {
@@ -347,25 +358,26 @@
         _elementCount--;
         return true;
       }
-      entry = entry._nextLink;
+      entry = entry._nextLink as _DoubleLinkedQueueEntry<E>;
     }
     return false;
   }
 
   void _filter(bool test(E element), bool removeMatching) {
-    _DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink;
+    _DoubleLinkedQueueEntry<E> entry =
+        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
     while (!identical(entry, _sentinel)) {
       bool matches = test(entry._element);
       if (!identical(this, entry._queue)) {
         // Entry must still be in the queue.
         throw ConcurrentModificationError(this);
       }
-      _DoubleLinkedQueueEntry<E> next = entry._nextLink; // Cannot be null.
+      DoubleLinkedQueueEntry<E> next = entry._nextLink!; // Cannot be null.
       if (identical(removeMatching, matches)) {
         entry._remove();
         _elementCount--;
       }
-      entry = next;
+      entry = next as _DoubleLinkedQueueEntry<E>;
     }
   }
 
@@ -378,21 +390,21 @@
   }
 
   E get first {
-    _DoubleLinkedQueueEntry<E> firstEntry = _sentinel._nextLink;
-    return firstEntry._element;
+    DoubleLinkedQueueEntry<E> firstEntry = _sentinel._nextLink!;
+    return firstEntry._element as E;
   }
 
   E get last {
-    _DoubleLinkedQueueEntry<E> lastEntry = _sentinel._previousLink;
-    return lastEntry._element;
+    DoubleLinkedQueueEntry<E> lastEntry = _sentinel._previousLink!;
+    return lastEntry._element as E;
   }
 
   E get single {
     // Note that this throws correctly if the queue is empty
     // because reading the element of the sentinel throws.
     if (identical(_sentinel._nextLink, _sentinel._previousLink)) {
-      _DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink;
-      return entry._element;
+      DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink!;
+      return entry._element as E;
     }
     throw IterableElementError.tooMany();
   }
@@ -407,7 +419,7 @@
   /// The entry objects can also be accessed using [lastEntry],
   /// and they can be iterated using [DoubleLinkedQueueEntry.nextEntry] and
   /// [DoubleLinkedQueueEntry.previousEntry].
-  DoubleLinkedQueueEntry<E> firstEntry() {
+  DoubleLinkedQueueEntry<E>? firstEntry() {
     return _sentinel.nextEntry();
   }
 
@@ -421,7 +433,7 @@
   /// The entry objects can also be accessed using [firstEntry],
   /// and they can be iterated using [DoubleLinkedQueueEntry.nextEntry] and
   /// [DoubleLinkedQueueEntry.previousEntry].
-  DoubleLinkedQueueEntry<E> lastEntry() {
+  DoubleLinkedQueueEntry<E>? lastEntry() {
     return _sentinel.previousEntry();
   }
 
@@ -452,17 +464,20 @@
   /// inserted after the current element before it is removed will not be
   /// visited by the iteration.
   void forEachEntry(void action(DoubleLinkedQueueEntry<E> element)) {
-    _DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink;
+    _DoubleLinkedQueueEntry<E> entry =
+        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
     while (!identical(entry, _sentinel)) {
-      _DoubleLinkedQueueElement<E> element = entry;
-      _DoubleLinkedQueueEntry<E> next = element._nextLink;
+      _DoubleLinkedQueueElement<E> element =
+          entry as _DoubleLinkedQueueElement<E>;
+      _DoubleLinkedQueueEntry<E> next =
+          element._nextLink as _DoubleLinkedQueueEntry<E>;
       // Remember both entry and entry._nextLink.
       // If someone calls `element.remove()` we continue from `next`.
       // Otherwise we use the value of entry._nextLink which may have been
       // updated.
       action(element);
       if (identical(this, entry._queue)) {
-        next = entry._nextLink;
+        next = entry._nextLink as _DoubleLinkedQueueEntry<E>;
       } else if (!identical(this, next._queue)) {
         throw ConcurrentModificationError(this);
       }
@@ -478,9 +493,9 @@
 }
 
 class _DoubleLinkedQueueIterator<E> implements Iterator<E> {
-  _DoubleLinkedQueueSentinel<E> _sentinel;
-  _DoubleLinkedQueueEntry<E> _nextEntry;
-  E _current;
+  _DoubleLinkedQueueSentinel<E>? _sentinel;
+  DoubleLinkedQueueEntry<E>? _nextEntry;
+  E? _current;
 
   _DoubleLinkedQueueIterator(_DoubleLinkedQueueSentinel<E> sentinel)
       : _sentinel = sentinel,
@@ -493,16 +508,20 @@
       _sentinel = null;
       return false;
     }
-    _DoubleLinkedQueueElement<E> elementEntry = _nextEntry;
-    if (!identical(_sentinel._queue, elementEntry._queue)) {
-      throw ConcurrentModificationError(_sentinel._queue);
+    _DoubleLinkedQueueEntry<E> elementEntry =
+        _nextEntry as _DoubleLinkedQueueEntry<E>;
+    if (!identical(_sentinel!._queue, elementEntry._queue)) {
+      throw ConcurrentModificationError(_sentinel!._queue);
     }
     _current = elementEntry._element;
     _nextEntry = elementEntry._nextLink;
     return true;
   }
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 }
 
 /// List based [Queue].
@@ -514,7 +533,7 @@
 /// The structure is efficient for any queue or stack usage.
 class ListQueue<E> extends ListIterable<E> implements Queue<E> {
   static const int _INITIAL_CAPACITY = 8;
-  List<E> _table;
+  List<E?> _table;
   int _head;
   int _tail;
   int _modificationCount = 0;
@@ -523,16 +542,19 @@
   ///
   /// If [initialCapacity] is given, prepare the queue for at least that many
   /// elements.
-  ListQueue([int initialCapacity])
+  ListQueue([int? initialCapacity])
       : _head = 0,
-        _tail = 0 {
+        _tail = 0,
+        _table = List<E?>.filled(_calculateCapacity(initialCapacity), null);
+
+  static int _calculateCapacity(int? initialCapacity) {
     if (initialCapacity == null || initialCapacity < _INITIAL_CAPACITY) {
-      initialCapacity = _INITIAL_CAPACITY;
+      return _INITIAL_CAPACITY;
     } else if (!_isPowerOf2(initialCapacity)) {
-      initialCapacity = _nextPowerOf2(initialCapacity);
+      return _nextPowerOf2(initialCapacity);
     }
     assert(_isPowerOf2(initialCapacity));
-    _table = List<E>(initialCapacity);
+    return initialCapacity;
   }
 
   /// Create a `ListQueue` containing all [elements].
@@ -548,13 +570,13 @@
   /// Queue<SubType> subQueue =
   ///     new ListQueue<SubType>.from(superQueue.whereType<SubType>());
   /// ```
-  factory ListQueue.from(Iterable elements) {
-    if (elements is List) {
+  factory ListQueue.from(Iterable<dynamic> elements) {
+    if (elements is List<dynamic>) {
       int length = elements.length;
       ListQueue<E> queue = ListQueue<E>(length + 1);
       assert(queue._table.length > length);
       for (int i = 0; i < length; i++) {
-        queue._table[i] = elements[i];
+        queue._table[i] = elements[i] as E;
       }
       queue._tail = length;
       return queue;
@@ -565,7 +587,7 @@
       }
       ListQueue<E> result = ListQueue<E>(capacity);
       for (final element in elements) {
-        result.addLast(element);
+        result.addLast(element as E);
       }
       return result;
     }
@@ -586,7 +608,7 @@
   void forEach(void f(E element)) {
     int modificationCount = _modificationCount;
     for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
-      f(_table[i]);
+      f(_table[i] as E);
       _checkModification(modificationCount);
     }
   }
@@ -597,33 +619,34 @@
 
   E get first {
     if (_head == _tail) throw IterableElementError.noElement();
-    return _table[_head];
+    return _table[_head] as E;
   }
 
   E get last {
     if (_head == _tail) throw IterableElementError.noElement();
-    return _table[(_tail - 1) & (_table.length - 1)];
+    return _table[(_tail - 1) & (_table.length - 1)] as E;
   }
 
   E get single {
     if (_head == _tail) throw IterableElementError.noElement();
     if (length > 1) throw IterableElementError.tooMany();
-    return _table[_head];
+    return _table[_head] as E;
   }
 
   E elementAt(int index) {
     RangeError.checkValidIndex(index, this);
-    return _table[(_head + index) & (_table.length - 1)];
+    return _table[(_head + index) & (_table.length - 1)] as E;
   }
 
   List<E> toList({bool growable = true}) {
-    List<E> list;
-    if (growable) {
-      list = <E>[]..length = length;
-    } else {
-      list = List<E>(length);
+    int mask = _table.length - 1;
+    int length = (_tail - _head) & mask;
+    if (length == 0) return List<E>.empty(growable: growable);
+
+    var list = List<E>.filled(length, first, growable: growable);
+    for (int i = 0; i < length; i++) {
+      list[i] = _table[(_head + i) & mask] as E;
     }
-    _writeToList(list);
     return list;
   }
 
@@ -662,9 +685,9 @@
     }
   }
 
-  bool remove(Object value) {
+  bool remove(Object? value) {
     for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
-      E element = _table[i];
+      E? element = _table[i];
       if (element == value) {
         _remove(i);
         _modificationCount++;
@@ -678,7 +701,7 @@
     int modificationCount = _modificationCount;
     int i = _head;
     while (i != _tail) {
-      E element = _table[i];
+      E element = _table[i] as E;
       bool remove = identical(removeMatching, test(element));
       _checkModification(modificationCount);
       if (remove) {
@@ -734,7 +757,7 @@
   E removeFirst() {
     if (_head == _tail) throw IterableElementError.noElement();
     _modificationCount++;
-    E result = _table[_head];
+    E result = _table[_head] as E;
     _table[_head] = null;
     _head = (_head + 1) & (_table.length - 1);
     return result;
@@ -744,7 +767,7 @@
     if (_head == _tail) throw IterableElementError.noElement();
     _modificationCount++;
     _tail = (_tail - 1) & (_table.length - 1);
-    E result = _table[_tail];
+    E result = _table[_tail] as E;
     _table[_tail] = null;
     return result;
   }
@@ -824,7 +847,7 @@
 
   /// Grow the table when full.
   void _grow() {
-    List<E> newTable = List<E>(_table.length * 2);
+    List<E?> newTable = List<E?>.filled(_table.length * 2, null);
     int split = _table.length - _head;
     newTable.setRange(0, split, _table, _head);
     newTable.setRange(split, split + _head, _table, 0);
@@ -833,7 +856,7 @@
     _table = newTable;
   }
 
-  int _writeToList(List<E> target) {
+  int _writeToList(List<E?> target) {
     assert(target.length >= length);
     if (_head <= _tail) {
       int length = _tail - _head;
@@ -855,7 +878,7 @@
     // expansion.
     newElementCount += newElementCount >> 1;
     int newCapacity = _nextPowerOf2(newElementCount);
-    List<E> newTable = List<E>(newCapacity);
+    List<E?> newTable = List<E?>.filled(newCapacity, null);
     _tail = _writeToList(newTable);
     _table = newTable;
     _head = 0;
@@ -870,7 +893,7 @@
   final int _end;
   final int _modificationCount;
   int _position;
-  E _current;
+  E? _current;
 
   _ListQueueIterator(ListQueue<E> queue)
       : _queue = queue,
@@ -878,7 +901,10 @@
         _modificationCount = queue._modificationCount,
         _position = queue._head;
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 
   bool moveNext() {
     _queue._checkModification(_modificationCount);
diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart
index 8efe4eb..1eb7491 100644
--- a/sdk/lib/collection/set.dart
+++ b/sdk/lib/collection/set.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.6
-
 /// Base implementations of [Set].
 part of dart.collection;
 
@@ -29,11 +27,11 @@
 
   bool add(E value);
 
-  bool contains(Object element);
+  bool contains(Object? element);
 
-  E lookup(Object element);
+  E? lookup(Object? element);
 
-  bool remove(Object value);
+  bool remove(Object? value);
 
   Iterator<E> get iterator;
 
@@ -59,22 +57,22 @@
     for (E element in elements) add(element);
   }
 
-  void removeAll(Iterable<Object> elements) {
-    for (Object element in elements) remove(element);
+  void removeAll(Iterable<Object?> elements) {
+    for (Object? element in elements) remove(element);
   }
 
-  void retainAll(Iterable<Object> elements) {
+  void retainAll(Iterable<Object?> elements) {
     // Create a copy of the set, remove all of elements from the copy,
     // then remove all remaining elements in copy from this.
     Set<E> toRemove = toSet();
-    for (Object o in elements) {
+    for (Object? o in elements) {
       toRemove.remove(o);
     }
     removeAll(toRemove);
   }
 
   void removeWhere(bool test(E element)) {
-    List toRemove = [];
+    List<Object?> toRemove = [];
     for (E element in this) {
       if (test(element)) toRemove.add(element);
     }
@@ -82,15 +80,15 @@
   }
 
   void retainWhere(bool test(E element)) {
-    List toRemove = [];
+    List<Object?> toRemove = [];
     for (E element in this) {
       if (!test(element)) toRemove.add(element);
     }
     removeAll(toRemove);
   }
 
-  bool containsAll(Iterable<Object> other) {
-    for (Object o in other) {
+  bool containsAll(Iterable<Object?> other) {
+    for (var o in other) {
       if (!contains(o)) return false;
     }
     return true;
@@ -100,7 +98,7 @@
     return toSet()..addAll(other);
   }
 
-  Set<E> intersection(Set<Object> other) {
+  Set<E> intersection(Set<Object?> other) {
     Set<E> result = toSet();
     for (E element in this) {
       if (!other.contains(element)) result.remove(element);
@@ -108,7 +106,7 @@
     return result;
   }
 
-  Set<E> difference(Set<Object> other) {
+  Set<E> difference(Set<Object?> other) {
     Set<E> result = toSet();
     for (E element in this) {
       if (other.contains(element)) result.remove(element);
@@ -116,12 +114,8 @@
     return result;
   }
 
-  List<E> toList({bool growable = true}) {
-    List<E> result = growable ? (<E>[]..length = length) : List<E>(length);
-    int i = 0;
-    for (E element in this) result[i++] = element;
-    return result;
-  }
+  List<E> toList({bool growable = true}) =>
+      List<E>.of(this, growable: growable);
 
   Iterable<T> map<T>(T f(E element)) =>
       EfficientLengthMappedIterable<E, T>(this, f);
@@ -234,7 +228,7 @@
     return result;
   }
 
-  E firstWhere(bool test(E value), {E orElse()}) {
+  E firstWhere(bool test(E value), {E Function()? orElse}) {
     for (E element in this) {
       if (test(element)) return element;
     }
@@ -242,8 +236,8 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E value), {E orElse()}) {
-    E result;
+  E lastWhere(bool test(E value), {E Function()? orElse}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -256,8 +250,8 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E value), {E orElse()}) {
-    E result;
+  E singleWhere(bool test(E value), {E Function()? orElse}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -329,7 +323,7 @@
 
   Set<R> cast<R>() => Set.castFrom<E, R>(this, newSet: _newSimilarSet);
 
-  Set<E> difference(Set<Object> other) {
+  Set<E> difference(Set<Object?> other) {
     Set<E> result = _newSet();
     for (var element in this) {
       if (!other.contains(element)) result.add(element);
@@ -337,7 +331,7 @@
     return result;
   }
 
-  Set<E> intersection(Set<Object> other) {
+  Set<E> intersection(Set<Object?> other) {
     Set<E> result = _newSet();
     for (var element in this) {
       if (other.contains(element)) result.add(element);
@@ -368,22 +362,22 @@
     for (E element in elements) add(element);
   }
 
-  void removeAll(Iterable<Object> elements) {
-    for (Object element in elements) remove(element);
+  void removeAll(Iterable<Object?> elements) {
+    for (Object? element in elements) remove(element);
   }
 
-  void retainAll(Iterable<Object> elements) {
+  void retainAll(Iterable<Object?> elements) {
     // Create a copy of the set, remove all of elements from the copy,
     // then remove all remaining elements in copy from this.
     Set<E> toRemove = toSet();
-    for (Object o in elements) {
+    for (Object? o in elements) {
       toRemove.remove(o);
     }
     removeAll(toRemove);
   }
 
   void removeWhere(bool test(E element)) {
-    List toRemove = [];
+    List<Object?> toRemove = [];
     for (E element in this) {
       if (test(element)) toRemove.add(element);
     }
@@ -391,15 +385,15 @@
   }
 
   void retainWhere(bool test(E element)) {
-    List toRemove = [];
+    List<Object?> toRemove = [];
     for (E element in this) {
       if (!test(element)) toRemove.add(element);
     }
     removeAll(toRemove);
   }
 
-  bool containsAll(Iterable<Object> other) {
-    for (Object o in other) {
+  bool containsAll(Iterable<Object?> other) {
+    for (Object? o in other) {
       if (!contains(o)) return false;
     }
     return true;
@@ -409,12 +403,8 @@
     return toSet()..addAll(other);
   }
 
-  List<E> toList({bool growable = true}) {
-    List<E> result = growable ? (<E>[]..length = length) : List<E>(length);
-    int i = 0;
-    for (E element in this) result[i++] = element;
-    return result;
-  }
+  List<E> toList({bool growable = true}) =>
+      List<E>.of(this, growable: growable);
 
   Iterable<T> map<T>(T f(E element)) =>
       EfficientLengthMappedIterable<E, T>(this, f);
@@ -524,7 +514,7 @@
     return result;
   }
 
-  E firstWhere(bool test(E value), {E orElse()}) {
+  E firstWhere(bool test(E value), {E Function()? orElse}) {
     for (E element in this) {
       if (test(element)) return element;
     }
@@ -532,8 +522,8 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E value), {E orElse()}) {
-    E result;
+  E lastWhere(bool test(E value), {E Function()? orElse}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -546,8 +536,8 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E value), {E orElse()}) {
-    E result;
+  E singleWhere(bool test(E value), {E Function()? orElse}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -587,13 +577,13 @@
 
   // Lookups use map methods.
 
-  bool contains(Object element) => _map.containsKey(element);
+  bool contains(Object? element) => _map.containsKey(element);
 
   Iterator<E> get iterator => _map.keys.iterator;
 
   int get length => _map.length;
 
-  E lookup(Object element) {
+  E? lookup(Object? element) {
     for (var key in _map.keys) {
       if (key == element) return key;
     }
@@ -614,11 +604,11 @@
     throw UnsupportedError("Cannot change unmodifiable set");
   }
 
-  void removeAll(Iterable<Object> elements) {
+  void removeAll(Iterable<Object?> elements) {
     throw UnsupportedError("Cannot change unmodifiable set");
   }
 
-  void retainAll(Iterable<Object> elements) {
+  void retainAll(Iterable<Object?> elements) {
     throw UnsupportedError("Cannot change unmodifiable set");
   }
 
@@ -630,7 +620,7 @@
     throw UnsupportedError("Cannot change unmodifiable set");
   }
 
-  bool remove(Object value) {
+  bool remove(Object? value) {
     throw UnsupportedError("Cannot change unmodifiable set");
   }
 }
diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart
index a877e18..a019b64 100644
--- a/sdk/lib/collection/splay_tree.dart
+++ b/sdk/lib/collection/splay_tree.dart
@@ -2,26 +2,31 @@
 // 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.6
-
 part of dart.collection;
 
 typedef _Predicate<T> = bool Function(T value);
 
 /// A node in a splay tree. It holds the sorting key and the left
 /// and right children in the tree.
-class _SplayTreeNode<K> {
+class _SplayTreeNode<K, Node extends _SplayTreeNode<K, Node>> {
   final K key;
-  _SplayTreeNode<K> left;
-  _SplayTreeNode<K> right;
+
+  Node? left;
+  Node? right;
 
   _SplayTreeNode(this.key);
 }
 
+/// A node in a splay tree based set.
+class _SplayTreeSetNode<K> extends _SplayTreeNode<K, _SplayTreeSetNode<K>> {
+  _SplayTreeSetNode(K key) : super(key);
+}
+
 /// A node in a splay tree based map.
 ///
 /// A [_SplayTreeNode] that also contains a value
-class _SplayTreeMapNode<K, V> extends _SplayTreeNode<K> {
+class _SplayTreeMapNode<K, V>
+    extends _SplayTreeNode<K, _SplayTreeMapNode<K, V>> {
   V value;
   _SplayTreeMapNode(K key, this.value) : super(key);
 }
@@ -32,15 +37,11 @@
 /// are quick to access again.
 /// It performs basic operations such as insertion, look-up and
 /// removal, in O(log(n)) amortized time.
-abstract class _SplayTree<K, Node extends _SplayTreeNode<K>> {
+abstract class _SplayTree<K, Node extends _SplayTreeNode<K, Node>> {
   // The root node of the splay tree. It will contain either the last
   // element inserted or the last element looked up.
-  Node get _root;
-  set _root(Node newValue);
-
-  // The dummy node used when performing a splay on the tree. Reusing it
-  // avoids allocating a node each time a splay is performed.
-  Node get _dummy;
+  Node? get _root;
+  set _root(Node? newValue);
 
   // Number of elements in the splay tree.
   int _count = 0;
@@ -57,14 +58,11 @@
   int _splayCount = 0;
 
   /// The comparator that is used for this splay tree.
-  Comparator<K> get _comparator;
+  Comparator<K> get _compare;
 
   /// The predicate to determine that a given object is a valid key.
   _Predicate get _validKey;
 
-  /// Comparison used to compare keys.
-  int _compare(K key1, K key2);
-
   /// Perform the splay operation for the given key. Moves the node with
   /// the given key to the top of the tree.  If no node has the given
   /// key, the last node on the search path is moved to the top of the
@@ -76,59 +74,80 @@
   int _splay(K key) {
     if (_root == null) return -1;
 
-    // The right child of the dummy node will hold
-    // the L tree of the algorithm.  The left child of the dummy node
-    // will hold the R tree of the algorithm.  Using a dummy node, left
-    // and right will always be nodes and we avoid special cases.
-    Node left = _dummy;
-    Node right = _dummy;
-    Node current = _root;
+    // The right and newTreeRight variables start out null, and are set
+    // after the first move left.  The right node is the destination
+    // for subsequent left rebalances, and newTreeRight holds the left
+    // child of the final tree.  The newTreeRight variable is set at most
+    // once, after the first move left, and is null iff right is null.
+    // The left and newTreeLeft variables play the corresponding role for
+    // right rebalances.
+    Node? right;
+    Node? newTreeRight;
+    Node? left;
+    Node? newTreeLeft;
+    var current = _root!;
+    // Hoist the field read out of the loop.
+    var compare = _compare;
     int comp;
     while (true) {
-      comp = _compare(current.key, key);
+      comp = compare(current.key, key);
       if (comp > 0) {
-        if (current.left == null) break;
-        comp = _compare(current.left.key, key);
+        var currentLeft = current.left;
+        if (currentLeft == null) break;
+        comp = compare(currentLeft.key, key);
         if (comp > 0) {
           // Rotate right.
-          _SplayTreeNode<K> tmp = current.left;
-          current.left = tmp.right;
-          tmp.right = current;
-          current = tmp;
-          if (current.left == null) break;
+          current.left = currentLeft.right;
+          currentLeft.right = current;
+          current = currentLeft;
+          currentLeft = current.left;
+          if (currentLeft == null) break;
         }
         // Link right.
-        right.left = current;
+        if (right == null) {
+          // First left rebalance, store the eventual right child
+          newTreeRight = current;
+        } else {
+          right.left = current;
+        }
         right = current;
-        current = current.left;
+        current = currentLeft;
       } else if (comp < 0) {
-        if (current.right == null) break;
-        comp = _compare(current.right.key, key);
+        var currentRight = current.right;
+        if (currentRight == null) break;
+        comp = compare(currentRight.key, key);
         if (comp < 0) {
           // Rotate left.
-          Node tmp = current.right;
-          current.right = tmp.left;
-          tmp.left = current;
-          current = tmp;
-          if (current.right == null) break;
+          current.right = currentRight.left;
+          currentRight.left = current;
+          current = currentRight;
+          currentRight = current.right;
+          if (currentRight == null) break;
         }
         // Link left.
-        left.right = current;
+        if (left == null) {
+          // First right rebalance, store the eventual left child
+          newTreeLeft = current;
+        } else {
+          left.right = current;
+        }
         left = current;
-        current = current.right;
+        current = currentRight;
       } else {
         break;
       }
     }
     // Assemble.
-    left.right = current.left;
-    right.left = current.right;
-    current.left = _dummy.right;
-    current.right = _dummy.left;
+    if (left != null) {
+      left.right = current.left;
+      current.left = newTreeLeft;
+    }
+    if (right != null) {
+      right.left = current.right;
+      current.right = newTreeRight;
+    }
     _root = current;
 
-    _dummy.right = null;
-    _dummy.left = null;
     _splayCount++;
     return comp;
   }
@@ -137,31 +156,57 @@
   // anchored at [node].
   // and that node is returned. It should replace the reference to [node]
   // in any parent tree or root pointer.
-  external Node _splayMin(Node node);
+  Node _splayMin(Node node) {
+    var current = node;
+    var nextLeft = current.left;
+    while (nextLeft != null) {
+      var left = nextLeft;
+      current.left = left.right;
+      left.right = current;
+      current = left;
+      nextLeft = current.left;
+    }
+    return current;
+  }
 
   // Emulates splaying with a key that is greater than any in the subtree
   // anchored at [node].
   // After this, the largest element in the tree is the root of the subtree,
   // and that node is returned. It should replace the reference to [node]
   // in any parent tree or root pointer.
-  external Node _splayMax(Node node);
+  Node _splayMax(Node node) {
+    var current = node;
+    var nextRight = current.right;
+    while (nextRight != null) {
+      var right = nextRight;
+      current.right = right.left;
+      right.left = current;
+      current = right;
+      nextRight = current.right;
+    }
+    return current;
+  }
 
-  Node _remove(K key) {
+  Node? _remove(K key) {
     if (_root == null) return null;
     int comp = _splay(key);
     if (comp != 0) return null;
-    Node result = _root;
+    var root = _root!;
+    var result = root;
+    var left = root.left;
     _count--;
     // assert(_count >= 0);
-    if (_root.left == null) {
-      _root = _root.right;
+    if (left == null) {
+      _root = root.right;
     } else {
-      Node right = _root.right;
+      var right = root.right;
       // Splay to make sure that the new root has an empty right child.
-      _root = _splayMax(_root.left);
+      root = _splayMax(left);
+
       // Insert the original right child as the right child of the new
       // root.
-      _root.right = right;
+      root.right = right;
+      _root = root;
     }
     _modificationCount++;
     return result;
@@ -174,32 +219,35 @@
   void _addNewRoot(Node node, int comp) {
     _count++;
     _modificationCount++;
-    if (_root == null) {
+    var root = _root;
+    if (root == null) {
       _root = node;
       return;
     }
     // assert(_count >= 0);
     if (comp < 0) {
-      node.left = _root;
-      node.right = _root.right;
-      _root.right = null;
+      node.left = root;
+      node.right = root.right;
+      root.right = null;
     } else {
-      node.right = _root;
-      node.left = _root.left;
-      _root.left = null;
+      node.right = root;
+      node.left = root.left;
+      root.left = null;
     }
     _root = node;
   }
 
-  Node get _first {
-    if (_root == null) return null;
-    _root = _splayMin(_root);
+  Node? get _first {
+    var root = _root;
+    if (root == null) return null;
+    _root = _splayMin(root);
     return _root;
   }
 
-  Node get _last {
-    if (_root == null) return null;
-    _root = _splayMax(_root);
+  Node? get _last {
+    var root = _root;
+    if (root == null) return null;
+    _root = _splayMax(root);
     return _root;
   }
 
@@ -210,10 +258,6 @@
   }
 }
 
-class _TypeTest<T> {
-  bool test(v) => v is T;
-}
-
 int _dynamicCompare(dynamic a, dynamic b) => Comparable.compare(a, b);
 
 Comparator<K> _defaultCompare<K>() {
@@ -250,24 +294,29 @@
 /// value is a [K].
 class SplayTreeMap<K, V> extends _SplayTree<K, _SplayTreeMapNode<K, V>>
     with MapMixin<K, V> {
-  _SplayTreeMapNode<K, V> _root;
-  final _SplayTreeMapNode<K, V> _dummy = _SplayTreeMapNode<K, V>(null, null);
+  _SplayTreeMapNode<K, V>? _root;
 
-  Comparator<K> _comparator;
+  Comparator<K> _compare;
   _Predicate _validKey;
 
-  SplayTreeMap([int compare(K key1, K key2), bool isValidKey(potentialKey)])
-      : _comparator = compare ?? _defaultCompare<K>(),
-        _validKey = isValidKey ?? ((v) => v is K);
+  SplayTreeMap(
+      [int Function(K key1, K key2)? compare,
+      bool Function(dynamic potentialKey)? isValidKey])
+      : _compare = compare ?? _defaultCompare<K>(),
+        _validKey = isValidKey ?? ((dynamic v) => v is K);
 
   /// Creates a [SplayTreeMap] that contains all key/value pairs of [other].
   ///
   /// The keys must all be instances of [K] and the values of [V].
   /// The [other] map itself can have any type.
-  factory SplayTreeMap.from(Map other,
-      [int compare(K key1, K key2), bool isValidKey(potentialKey)]) {
+  factory SplayTreeMap.from(Map<dynamic, dynamic> other,
+      [int Function(K key1, K key2)? compare,
+      bool Function(dynamic potentialKey)? isValidKey]) {
+    if (other is Map<K, V>) {
+      return SplayTreeMap<K, V>.of(other, compare, isValidKey);
+    }
     SplayTreeMap<K, V> result = SplayTreeMap<K, V>(compare, isValidKey);
-    other.forEach((k, v) {
+    other.forEach((dynamic k, dynamic v) {
       result[k] = v;
     });
     return result;
@@ -275,7 +324,8 @@
 
   /// Creates a [SplayTreeMap] that contains all key/value pairs of [other].
   factory SplayTreeMap.of(Map<K, V> other,
-          [int compare(K key1, K key2), bool isValidKey(potentialKey)]) =>
+          [int Function(K key1, K key2)? compare,
+          bool Function(dynamic potentialKey)? isValidKey]) =>
       SplayTreeMap<K, V>(compare, isValidKey)..addAll(other);
 
   /// Creates a [SplayTreeMap] where the keys and values are computed from the
@@ -290,10 +340,10 @@
   /// If no functions are specified for [key] and [value] the default is to
   /// use the iterable value itself.
   factory SplayTreeMap.fromIterable(Iterable iterable,
-      {K key(element),
-      V value(element),
-      int compare(K key1, K key2),
-      bool isValidKey(potentialKey)}) {
+      {K Function(dynamic element)? key,
+      V Function(dynamic element)? value,
+      int Function(K key1, K key2)? compare,
+      bool Function(dynamic potentialKey)? isValidKey}) {
     SplayTreeMap<K, V> map = SplayTreeMap<K, V>(compare, isValidKey);
     MapBase._fillMapWithMappedIterable(map, iterable, key, value);
     return map;
@@ -309,30 +359,27 @@
   ///
   /// It is an error if the two [Iterable]s don't have the same length.
   factory SplayTreeMap.fromIterables(Iterable<K> keys, Iterable<V> values,
-      [int compare(K key1, K key2), bool isValidKey(potentialKey)]) {
+      [int Function(K key1, K key2)? compare,
+      bool Function(dynamic potentialKey)? isValidKey]) {
     SplayTreeMap<K, V> map = SplayTreeMap<K, V>(compare, isValidKey);
     MapBase._fillMapWithIterables(map, keys, values);
     return map;
   }
 
-  int _compare(K key1, K key2) => _comparator(key1, key2);
-
-  SplayTreeMap._internal();
-
-  V operator [](Object key) {
+  V? operator [](Object? key) {
     if (!_validKey(key)) return null;
     if (_root != null) {
-      int comp = _splay(key);
+      int comp = _splay(key as dynamic);
       if (comp == 0) {
-        return _root.value;
+        return _root!.value;
       }
     }
     return null;
   }
 
-  V remove(Object key) {
+  V? remove(Object? key) {
     if (!_validKey(key)) return null;
-    _SplayTreeMapNode<K, V> mapRoot = _remove(key);
+    _SplayTreeMapNode<K, V>? mapRoot = _remove(key as dynamic);
     if (mapRoot != null) return mapRoot.value;
     return null;
   }
@@ -343,7 +390,7 @@
     // the key to the root of the tree.
     int comp = _splay(key);
     if (comp == 0) {
-      _root.value = value;
+      _root!.value = value;
       return;
     }
     _addNewRoot(_SplayTreeMapNode(key, value), comp);
@@ -353,7 +400,7 @@
     if (key == null) throw ArgumentError(key);
     int comp = _splay(key);
     if (comp == 0) {
-      return _root.value;
+      return _root!.value;
     }
     int modificationCount = _modificationCount;
     int splayCount = _splayCount;
@@ -383,7 +430,8 @@
   bool get isNotEmpty => !isEmpty;
 
   void forEach(void f(K key, V value)) {
-    Iterator<_SplayTreeNode<K>> nodes = _SplayTreeNodeIterator<K>(this);
+    Iterator<_SplayTreeMapNode<K, V>> nodes =
+        _SplayTreeNodeIterator<K, _SplayTreeMapNode<K, V>>(this);
     while (nodes.moveNext()) {
       _SplayTreeMapNode<K, V> node = nodes.current;
       f(node.key, node.value);
@@ -398,19 +446,21 @@
     _clear();
   }
 
-  bool containsKey(Object key) {
-    return _validKey(key) && _splay(key) == 0;
+  bool containsKey(Object? key) {
+    return _validKey(key) && _splay(key as dynamic) == 0;
   }
 
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     int initialSplayCount = _splayCount;
-    bool visit(_SplayTreeMapNode node) {
+    bool visit(_SplayTreeMapNode<K, V>? node) {
       while (node != null) {
         if (node.value == value) return true;
         if (initialSplayCount != _splayCount) {
           throw ConcurrentModificationError(this);
         }
-        if (node.right != null && visit(node.right)) return true;
+        if (node.right != null && visit(node.right)) {
+          return true;
+        }
         node = node.left;
       }
       return false;
@@ -419,55 +469,61 @@
     return visit(_root);
   }
 
-  Iterable<K> get keys => _SplayTreeKeyIterable<K>(this);
+  Iterable<K> get keys =>
+      _SplayTreeKeyIterable<K, _SplayTreeMapNode<K, V>>(this);
 
   Iterable<V> get values => _SplayTreeValueIterable<K, V>(this);
 
-  /// Get the first key in the map. Returns [:null:] if the map is empty.
-  K firstKey() {
+  /// Get the first key in the map. Returns `null` if the map is empty.
+  K? firstKey() {
     if (_root == null) return null;
-    return _first.key;
+    return _first!.key;
   }
 
-  /// Get the last key in the map. Returns [:null:] if the map is empty.
-  K lastKey() {
+  /// Get the last key in the map. Returns `null` if the map is empty.
+  K? lastKey() {
     if (_root == null) return null;
-    return _last.key;
+    return _last!.key;
   }
 
   /// Get the last key in the map that is strictly smaller than [key]. Returns
-  /// [:null:] if no key was not found.
-  K lastKeyBefore(K key) {
+  /// `null` if no key was not found.
+  K? lastKeyBefore(K key) {
     if (key == null) throw ArgumentError(key);
     if (_root == null) return null;
     int comp = _splay(key);
-    if (comp < 0) return _root.key;
-    _SplayTreeNode<K> node = _root.left;
+    if (comp < 0) return _root!.key;
+    _SplayTreeMapNode<K, V>? node = _root!.left;
     if (node == null) return null;
-    while (node.right != null) {
-      node = node.right;
+    var nodeRight = node.right;
+    while (nodeRight != null) {
+      node = nodeRight;
+      nodeRight = node.right;
     }
-    return node.key;
+    return node!.key;
   }
 
   /// Get the first key in the map that is strictly larger than [key]. Returns
-  /// [:null:] if no key was not found.
-  K firstKeyAfter(K key) {
+  /// `null` if no key was not found.
+  K? firstKeyAfter(K key) {
     if (key == null) throw ArgumentError(key);
     if (_root == null) return null;
     int comp = _splay(key);
-    if (comp > 0) return _root.key;
-    _SplayTreeNode<K> node = _root.right;
+    if (comp > 0) return _root!.key;
+    _SplayTreeMapNode<K, V>? node = _root!.right;
     if (node == null) return null;
-    while (node.left != null) {
-      node = node.left;
+    var nodeLeft = node.left;
+    while (nodeLeft != null) {
+      node = nodeLeft;
+      nodeLeft = node.left;
     }
-    return node.key;
+    return node!.key;
   }
 }
 
-abstract class _SplayTreeIterator<K, T> implements Iterator<T> {
-  final _SplayTree<K, _SplayTreeNode<K>> _tree;
+abstract class _SplayTreeIterator<K, Node extends _SplayTreeNode<K, Node>, T>
+    implements Iterator<T> {
+  final _SplayTree<K, Node> _tree;
 
   /// Worklist of nodes to visit.
   ///
@@ -477,7 +533,7 @@
   /// the nodes of a full traversal.
   ///
   /// Only valid as long as the original tree isn't reordered.
-  final List<_SplayTreeNode<K>> _workList = <_SplayTreeNode<K>>[];
+  final List<Node> _workList = [];
 
   /// Original modification counter of [_tree].
   ///
@@ -494,35 +550,37 @@
   int _splayCount;
 
   /// Current node.
-  _SplayTreeNode<K> _currentNode;
+  Node? _currentNode;
 
-  _SplayTreeIterator(_SplayTree<K, _SplayTreeNode<K>> tree)
+  _SplayTreeIterator(_SplayTree<K, Node> tree)
       : _tree = tree,
         _modificationCount = tree._modificationCount,
         _splayCount = tree._splayCount {
     _findLeftMostDescendent(tree._root);
   }
 
-  _SplayTreeIterator.startAt(_SplayTree<K, _SplayTreeNode<K>> tree, K startKey)
+  _SplayTreeIterator.startAt(_SplayTree<K, Node> tree, K startKey)
       : _tree = tree,
-        _modificationCount = tree._modificationCount {
+        _modificationCount = tree._modificationCount,
+        _splayCount = -1 {
     if (tree._root == null) return;
     int compare = tree._splay(startKey);
     _splayCount = tree._splayCount;
     if (compare < 0) {
       // Don't include the root, start at the next element after the root.
-      _findLeftMostDescendent(tree._root.right);
+      _findLeftMostDescendent(tree._root!.right);
     } else {
-      _workList.add(tree._root);
+      _workList.add(tree._root!);
     }
   }
 
   T get current {
-    if (_currentNode == null) return null;
-    return _getValue(_currentNode);
+    var node = _currentNode;
+    if (node == null) return null as T;
+    return _getValue(node);
   }
 
-  void _findLeftMostDescendent(_SplayTreeNode<K> node) {
+  void _findLeftMostDescendent(Node? node) {
     while (node != null) {
       _workList.add(node);
       node = node.left;
@@ -535,16 +593,12 @@
   /// If the key-set changes, iteration is aborted before getting
   /// here, so we know that the keys are the same as before, it's
   /// only the tree that has been reordered.
-  void _rebuildWorkList(_SplayTreeNode<K> currentNode) {
+  void _rebuildWorkList(Node currentNode) {
     assert(_workList.isNotEmpty);
     _workList.clear();
-    if (currentNode == null) {
-      _findLeftMostDescendent(_tree._root);
-    } else {
-      _tree._splay(currentNode.key);
-      _findLeftMostDescendent(_tree._root.right);
-      assert(_workList.isNotEmpty);
-    }
+    _tree._splay(currentNode.key);
+    _findLeftMostDescendent(_tree._root!.right);
+    assert(_workList.isNotEmpty);
   }
 
   bool moveNext() {
@@ -561,27 +615,28 @@
       return false;
     }
     if (_tree._splayCount != _splayCount && _currentNode != null) {
-      _rebuildWorkList(_currentNode);
+      _rebuildWorkList(_currentNode!);
     }
     _currentNode = _workList.removeLast();
-    _findLeftMostDescendent(_currentNode.right);
+    _findLeftMostDescendent(_currentNode!.right);
     return true;
   }
 
-  T _getValue(_SplayTreeNode<K> node);
+  T _getValue(Node node);
 }
 
-class _SplayTreeKeyIterable<K> extends EfficientLengthIterable<K> {
-  _SplayTree<K, _SplayTreeNode<K>> _tree;
+class _SplayTreeKeyIterable<K, Node extends _SplayTreeNode<K, Node>>
+    extends EfficientLengthIterable<K> {
+  _SplayTree<K, Node> _tree;
   _SplayTreeKeyIterable(this._tree);
   int get length => _tree._count;
   bool get isEmpty => _tree._count == 0;
-  Iterator<K> get iterator => _SplayTreeKeyIterator<K>(_tree);
+  Iterator<K> get iterator => _SplayTreeKeyIterator<K, Node>(_tree);
 
   Set<K> toSet() {
-    SplayTreeSet<K> set = SplayTreeSet<K>(_tree._comparator, _tree._validKey);
+    SplayTreeSet<K> set = SplayTreeSet<K>(_tree._compare, _tree._validKey);
     set._count = _tree._count;
-    set._root = set._copyNode(_tree._root);
+    set._root = set._copyNode<Node>(_tree._root);
     return set;
   }
 }
@@ -594,26 +649,24 @@
   Iterator<V> get iterator => _SplayTreeValueIterator<K, V>(_map);
 }
 
-class _SplayTreeKeyIterator<K> extends _SplayTreeIterator<K, K> {
-  _SplayTreeKeyIterator(_SplayTree<K, _SplayTreeNode<K>> map) : super(map);
-  K _getValue(_SplayTreeNode<K> node) => node.key;
+class _SplayTreeKeyIterator<K, Node extends _SplayTreeNode<K, Node>>
+    extends _SplayTreeIterator<K, Node, K> {
+  _SplayTreeKeyIterator(_SplayTree<K, Node> map) : super(map);
+  K _getValue(Node node) => node.key;
 }
 
-class _SplayTreeValueIterator<K, V> extends _SplayTreeIterator<K, V> {
+class _SplayTreeValueIterator<K, V>
+    extends _SplayTreeIterator<K, _SplayTreeMapNode<K, V>, V> {
   _SplayTreeValueIterator(SplayTreeMap<K, V> map) : super(map);
-  V _getValue(_SplayTreeNode<K> node) {
-    _SplayTreeMapNode<K, V> mapNode = node;
-    return mapNode.value;
-  }
+  V _getValue(_SplayTreeMapNode<K, V> node) => node.value;
 }
 
-class _SplayTreeNodeIterator<K>
-    extends _SplayTreeIterator<K, _SplayTreeNode<K>> {
-  _SplayTreeNodeIterator(_SplayTree<K, _SplayTreeNode<K>> tree) : super(tree);
-  _SplayTreeNodeIterator.startAt(
-      _SplayTree<K, _SplayTreeNode<K>> tree, K startKey)
+class _SplayTreeNodeIterator<K, Node extends _SplayTreeNode<K, Node>>
+    extends _SplayTreeIterator<K, Node, Node> {
+  _SplayTreeNodeIterator(_SplayTree<K, Node> tree) : super(tree);
+  _SplayTreeNodeIterator.startAt(_SplayTree<K, Node> tree, K startKey)
       : super.startAt(tree, startKey);
-  _SplayTreeNode<K> _getValue(_SplayTreeNode<K> node) => node;
+  Node _getValue(Node node) => node;
 }
 
 /// A [Set] of objects that can be ordered relative to each other.
@@ -630,12 +683,11 @@
 /// [Comparable], and are compared using their [Comparable.compareTo] method.
 /// Non-comparable objects (including `null`) will not work as an element
 /// in that case.
-class SplayTreeSet<E> extends _SplayTree<E, _SplayTreeNode<E>>
+class SplayTreeSet<E> extends _SplayTree<E, _SplayTreeSetNode<E>>
     with IterableMixin<E>, SetMixin<E> {
-  _SplayTreeNode<E> _root;
-  final _SplayTreeNode<E> _dummy = _SplayTreeNode<E>(null);
+  _SplayTreeSetNode<E>? _root;
 
-  Comparator<E> _comparator;
+  Comparator<E> _compare;
   _Predicate _validKey;
 
   /// Create a new [SplayTreeSet] with the given compare function.
@@ -660,9 +712,11 @@
   ///
   /// If omitted, the `isValidKey` function defaults to checking against the
   /// type parameter: `other is E`.
-  SplayTreeSet([int compare(E key1, E key2), bool isValidKey(potentialKey)])
-      : _comparator = compare ?? _defaultCompare<E>(),
-        _validKey = isValidKey ?? ((v) => v is E);
+  SplayTreeSet(
+      [int Function(E key1, E key2)? compare,
+      bool Function(dynamic potentialKey)? isValidKey])
+      : _compare = compare ?? _defaultCompare<E>(),
+        _validKey = isValidKey ?? ((dynamic v) => v is E);
 
   /// Creates a [SplayTreeSet] that contains all [elements].
   ///
@@ -678,11 +732,14 @@
   ///     new SplayTreeSet<SubType>.from(superSet.whereType<SubType>());
   /// ```
   factory SplayTreeSet.from(Iterable elements,
-      [int compare(E key1, E key2), bool isValidKey(potentialKey)]) {
+      [int Function(E key1, E key2)? compare,
+      bool Function(dynamic potentialKey)? isValidKey]) {
+    if (elements is Iterable<E>) {
+      return SplayTreeSet<E>.of(elements, compare, isValidKey);
+    }
     SplayTreeSet<E> result = SplayTreeSet<E>(compare, isValidKey);
-    for (final element in elements) {
-      E e = element;
-      result.add(e);
+    for (var element in elements) {
+      result.add(element as dynamic);
     }
     return result;
   }
@@ -693,18 +750,19 @@
   ///
   /// All the [elements] should be valid as arguments to the [compare] function.
   factory SplayTreeSet.of(Iterable<E> elements,
-          [int compare(E key1, E key2), bool isValidKey(potentialKey)]) =>
+          [int Function(E key1, E key2)? compare,
+          bool Function(dynamic potentialKey)? isValidKey]) =>
       SplayTreeSet(compare, isValidKey)..addAll(elements);
 
   Set<T> _newSet<T>() =>
-      SplayTreeSet<T>((T a, T b) => _comparator(a as E, b as E), _validKey);
+      SplayTreeSet<T>((T a, T b) => _compare(a as E, b as E), _validKey);
 
   Set<R> cast<R>() => Set.castFrom<E, R>(this, newSet: _newSet);
-  int _compare(E e1, E e2) => _comparator(e1, e2);
 
   // From Iterable.
 
-  Iterator<E> get iterator => _SplayTreeKeyIterator<E>(this);
+  Iterator<E> get iterator =>
+      _SplayTreeKeyIterator<E, _SplayTreeSetNode<E>>(this);
 
   int get length => _count;
   bool get isEmpty => _root == null;
@@ -712,64 +770,64 @@
 
   E get first {
     if (_count == 0) throw IterableElementError.noElement();
-    return _first.key;
+    return _first!.key;
   }
 
   E get last {
     if (_count == 0) throw IterableElementError.noElement();
-    return _last.key;
+    return _last!.key;
   }
 
   E get single {
     if (_count == 0) throw IterableElementError.noElement();
     if (_count > 1) throw IterableElementError.tooMany();
-    return _root.key;
+    return _root!.key;
   }
 
   // From Set.
-  bool contains(Object element) {
-    return _validKey(element) && _splay(element) == 0;
+  bool contains(Object? element) {
+    return _validKey(element) && _splay(element as E) == 0;
   }
 
   bool add(E element) {
     int compare = _splay(element);
     if (compare == 0) return false;
-    _addNewRoot(_SplayTreeNode(element), compare);
+    _addNewRoot(_SplayTreeSetNode(element), compare);
     return true;
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (!_validKey(object)) return false;
-    return _remove(object) != null;
+    return _remove(object as E) != null;
   }
 
   void addAll(Iterable<E> elements) {
     for (E element in elements) {
       int compare = _splay(element);
       if (compare != 0) {
-        _addNewRoot(_SplayTreeNode(element), compare);
+        _addNewRoot(_SplayTreeSetNode(element), compare);
       }
     }
   }
 
-  void removeAll(Iterable<Object> elements) {
-    for (Object element in elements) {
-      if (_validKey(element)) _remove(element);
+  void removeAll(Iterable<Object?> elements) {
+    for (Object? element in elements) {
+      if (_validKey(element)) _remove(element as E);
     }
   }
 
-  void retainAll(Iterable<Object> elements) {
+  void retainAll(Iterable<Object?> elements) {
     // Build a set with the same sense of equality as this set.
-    SplayTreeSet<E> retainSet = SplayTreeSet<E>(_comparator, _validKey);
+    SplayTreeSet<E> retainSet = SplayTreeSet<E>(_compare, _validKey);
     int modificationCount = _modificationCount;
-    for (Object object in elements) {
+    for (Object? object in elements) {
       if (modificationCount != _modificationCount) {
         // The iterator should not have side effects.
         throw ConcurrentModificationError(this);
       }
       // Equivalent to this.contains(object).
-      if (_validKey(object) && _splay(object) == 0) {
-        retainSet.add(_root.key);
+      if (_validKey(object) && _splay(object as E) == 0) {
+        retainSet.add(_root!.key);
       }
     }
     // Take over the elements from the retained set, if it differs.
@@ -780,23 +838,23 @@
     }
   }
 
-  E lookup(Object object) {
+  E? lookup(Object? object) {
     if (!_validKey(object)) return null;
-    int comp = _splay(object);
+    int comp = _splay(object as E);
     if (comp != 0) return null;
-    return _root.key;
+    return _root!.key;
   }
 
-  Set<E> intersection(Set<Object> other) {
-    Set<E> result = SplayTreeSet<E>(_comparator, _validKey);
+  Set<E> intersection(Set<Object?> other) {
+    Set<E> result = SplayTreeSet<E>(_compare, _validKey);
     for (E element in this) {
       if (other.contains(element)) result.add(element);
     }
     return result;
   }
 
-  Set<E> difference(Set<Object> other) {
-    Set<E> result = SplayTreeSet<E>(_comparator, _validKey);
+  Set<E> difference(Set<Object?> other) {
+    Set<E> result = SplayTreeSet<E>(_compare, _validKey);
     for (E element in this) {
       if (!other.contains(element)) result.add(element);
     }
@@ -808,19 +866,46 @@
   }
 
   SplayTreeSet<E> _clone() {
-    var set = SplayTreeSet<E>(_comparator, _validKey);
+    var set = SplayTreeSet<E>(_compare, _validKey);
     set._count = _count;
-    set._root = _copyNode(_root);
+    set._root = _copyNode<_SplayTreeSetNode<E>>(_root);
     return set;
   }
 
   // Copies the structure of a SplayTree into a new similar structure.
   // Works on _SplayTreeMapNode as well, but only copies the keys,
-  _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) {
+  _SplayTreeSetNode<E>? _copyNode<Node extends _SplayTreeNode<E, Node>>(
+      Node? node) {
     if (node == null) return null;
-    return _SplayTreeNode<E>(node.key)
-      ..left = _copyNode(node.left)
-      ..right = _copyNode(node.right);
+    // Given a source node and a destination node, copy the left
+    // and right subtrees of the source node into the destination node.
+    // The left subtree is copied recursively, but the right spine
+    // of every subtree is copied iteratively.
+    void copyChildren(Node node, _SplayTreeSetNode<E> dest) {
+      Node? left;
+      Node? right;
+      do {
+        left = node.left;
+        right = node.right;
+        if (left != null) {
+          var newLeft = _SplayTreeSetNode<E>(left.key);
+          dest.left = newLeft;
+          // Recursively copy the left tree.
+          copyChildren(left, newLeft);
+        }
+        if (right != null) {
+          var newRight = _SplayTreeSetNode<E>(right.key);
+          dest.right = newRight;
+          // Set node and dest to copy the right tree iteratively.
+          node = right;
+          dest = newRight;
+        }
+      } while (right != null);
+    }
+
+    var result = _SplayTreeSetNode<E>(node.key);
+    copyChildren(node, result);
+    return result;
   }
 
   void clear() {
diff --git a/sdk/lib/convert/ascii.dart b/sdk/lib/convert/ascii.dart
index 82f2276..9d98016 100644
--- a/sdk/lib/convert/ascii.dart
+++ b/sdk/lib/convert/ascii.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.6
-
 part of dart.convert;
 
 /// An instance of the default implementation of the [AsciiCodec].
@@ -50,9 +48,8 @@
   ///
   /// If [allowInvalid] is not provided, it defaults to the value used to create
   /// this [AsciiCodec].
-  String decode(List<int> bytes, {bool allowInvalid}) {
-    allowInvalid ??= _allowInvalid;
-    if (allowInvalid) {
+  String decode(List<int> bytes, {bool? allowInvalid}) {
+    if (allowInvalid ?? _allowInvalid) {
       return const AsciiDecoder(allowInvalid: true).convert(bytes);
     } else {
       return const AsciiDecoder(allowInvalid: false).convert(bytes);
@@ -77,9 +74,13 @@
   ///
   /// If [start] and [end] are provided, only the substring
   /// `string.substring(start, end)` is used as input to the conversion.
-  Uint8List convert(String string, [int start = 0, int end]) {
+  Uint8List convert(String string, [int start = 0, int? end]) {
     var stringLength = string.length;
     end = RangeError.checkValidRange(start, end, stringLength);
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (end == null) {
+      throw RangeError("Invalid range");
+    }
     var length = end - start;
     var result = Uint8List(length);
     for (var i = 0; i < length; i++) {
@@ -164,11 +165,12 @@
   ///
   /// If [start] and [end] are provided, only the sub-list of bytes from
   /// `start` to `end` (`end` not inclusive) is used as input to the conversion.
-  String convert(List<int> bytes, [int start = 0, int end]) {
-    var byteCount = bytes.length;
-    RangeError.checkValidRange(start, end, byteCount);
-    end ??= byteCount;
-
+  String convert(List<int> bytes, [int start = 0, int? end]) {
+    end = RangeError.checkValidRange(start, end, bytes.length);
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (end == null) {
+      throw RangeError("Invalid range");
+    }
     for (var i = start; i < end; i++) {
       var byte = bytes[i];
       if ((byte & ~_subsetMask) != 0) {
diff --git a/sdk/lib/convert/base64.dart b/sdk/lib/convert/base64.dart
index 2a8d462..0955ca1 100644
--- a/sdk/lib/convert/base64.dart
+++ b/sdk/lib/convert/base64.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.6
-
 part of dart.convert;
 
 /// A [base64](https://tools.ietf.org/html/rfc4648) encoder and decoder.
@@ -37,18 +35,18 @@
 
 /// Encodes [bytes] using [base64](https://tools.ietf.org/html/rfc4648) encoding.
 ///
-/// Shorthand for `base64.encode`. Useful if a local variable shadows the global
+/// Shorthand for `base64.encode(bytes)`. Useful if a local variable shadows the global
 /// [base64] constant.
 String base64Encode(List<int> bytes) => base64.encode(bytes);
 
 /// Encodes [bytes] using [base64url](https://tools.ietf.org/html/rfc4648) encoding.
 ///
-/// Shorthand for `base64url.encode`.
+/// Shorthand for `base64url.encode(bytes)`.
 String base64UrlEncode(List<int> bytes) => base64Url.encode(bytes);
 
 /// Decodes [base64](https://tools.ietf.org/html/rfc4648) or [base64url](https://tools.ietf.org/html/rfc4648) encoded bytes.
 ///
-/// Shorthand for `base64.decode`. Useful if a local variable shadows the
+/// Shorthand for `base64.decode(bytes)`. Useful if a local variable shadows the
 /// global [base64] constant.
 Uint8List base64Decode(String source) => base64.decode(source);
 
@@ -95,11 +93,15 @@
   /// * Validate that existing padding (trailing `=` characters) is correct.
   /// * If no padding exists, add correct padding if necessary and possible.
   /// * Validate that the length is correct (a multiple of four).
-  String normalize(String source, [int start = 0, int end]) {
+  String normalize(String source, [int start = 0, int? end]) {
     end = RangeError.checkValidRange(start, end, source.length);
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (end == null) {
+      throw RangeError("Invalid range");
+    }
     const percent = 0x25;
     const equals = 0x3d;
-    StringBuffer buffer;
+    StringBuffer? buffer;
     var sliceStart = start;
     var alphabet = _Base64Encoder._base64Alphabet;
     var inverseAlphabet = _Base64Decoder._inverseAlphabet;
@@ -142,9 +144,9 @@
           if (originalChar == equals) continue;
         }
         if (value != _Base64Decoder._invalid) {
-          buffer ??= StringBuffer();
-          buffer.write(source.substring(sliceStart, sliceEnd));
-          buffer.writeCharCode(char);
+          (buffer ??= StringBuffer())
+            ..write(source.substring(sliceStart, sliceEnd))
+            ..writeCharCode(char);
           sliceStart = i;
           continue;
         }
@@ -233,7 +235,7 @@
   String convert(List<int> input) {
     if (input.isEmpty) return "";
     var encoder = _Base64Encoder(_urlSafe);
-    var buffer = encoder.encode(input, 0, input.length, true);
+    var buffer = encoder.encode(input, 0, input.length, true)!;
     return String.fromCharCodes(buffer);
   }
 
@@ -302,10 +304,10 @@
   /// with the necessary padding.
   ///
   /// Returns `null` if there is no output.
-  Uint8List encode(List<int> bytes, int start, int end, bool isLast) {
+  Uint8List? encode(List<int> bytes, int start, int end, bool isLast) {
     assert(0 <= start);
     assert(start <= end);
-    assert(bytes == null || end <= bytes.length);
+    assert(end <= bytes.length);
     var length = end - start;
 
     var count = _stateCount(_state);
@@ -395,17 +397,21 @@
   ///
   /// When the buffer isn't released to the sink, only used to create another
   /// value (a string), the buffer can be reused between chunks.
-  Uint8List bufferCache;
+  Uint8List? bufferCache;
 
   _BufferCachingBase64Encoder(bool urlSafe) : super(urlSafe);
 
   Uint8List createBuffer(int bufferLength) {
-    if (bufferCache == null || bufferCache.length < bufferLength) {
-      bufferCache = Uint8List(bufferLength);
+    Uint8List? buffer = bufferCache;
+    if (buffer == null || buffer.length < bufferLength) {
+      bufferCache = buffer = Uint8List(bufferLength);
+    }
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (buffer == null) {
+      throw "unreachable";
     }
     // Return a view of the buffer, so it has the requested length.
-    return Uint8List.view(
-        bufferCache.buffer, bufferCache.offsetInBytes, bufferLength);
+    return Uint8List.view(buffer.buffer, buffer.offsetInBytes, bufferLength);
   }
 }
 
@@ -415,7 +421,7 @@
   }
 
   void close() {
-    _add(null, 0, 0, true);
+    _add(const [], 0, 0, true);
   }
 
   void addSlice(List<int> source, int start, int end, bool isLast) {
@@ -481,11 +487,15 @@
   /// The returned [Uint8List] contains exactly the decoded bytes,
   /// so the [Uint8List.length] is precisely the number of decoded bytes.
   /// The [Uint8List.buffer] may be larger than the decoded bytes.
-  Uint8List convert(String input, [int start = 0, int end]) {
+  Uint8List convert(String input, [int start = 0, int? end]) {
     end = RangeError.checkValidRange(start, end, input.length);
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (end == null) {
+      throw RangeError("Invalid range");
+    }
     if (start == end) return Uint8List(0);
     var decoder = _Base64Decoder();
-    var buffer = decoder.decode(input, start, end);
+    var buffer = decoder.decode(input, start, end)!;
     decoder.close(input, end);
     return buffer;
   }
@@ -595,7 +605,7 @@
   /// Returns a [Uint8List] with the decoded bytes.
   /// If a previous call had an incomplete four-character block, the bits from
   /// those are included in decoding
-  Uint8List decode(String input, int start, int end) {
+  Uint8List? decode(String input, int start, int end) {
     assert(0 <= start);
     assert(start <= end);
     assert(end <= input.length);
@@ -610,7 +620,7 @@
   }
 
   /// Checks that [_state] represents a valid decoding.
-  void close(String input, int end) {
+  void close(String? input, int? end) {
     if (_state < _encodePaddingState(0)) {
       throw FormatException("Missing padding character", input, end);
     }
@@ -695,6 +705,8 @@
     throw FormatException("Invalid character", input, i);
   }
 
+  static Uint8List _emptyBuffer = Uint8List(0);
+
   /// Allocates a buffer with room for the decoding of a substring of [input].
   ///
   /// Includes room for the characters in [state], and handles padding correctly.
@@ -714,7 +726,7 @@
     if (bufferLength > 0) return Uint8List(bufferLength);
     // If the input plus state is less than four characters, and it's not
     // at the end of input, no buffer is needed.
-    return null;
+    return _emptyBuffer;
   }
 
   /// Returns the position of the start of padding at the end of the input.
@@ -846,7 +858,7 @@
   }
 
   void addSlice(String string, int start, int end, bool isLast) {
-    end = RangeError.checkValidRange(start, end, string.length);
+    RangeError.checkValidRange(start, end, string.length);
     if (start == end) return;
     var buffer = _decoder.decode(string, start, end);
     if (buffer != null) _sink.add(buffer);
diff --git a/sdk/lib/convert/byte_conversion.dart b/sdk/lib/convert/byte_conversion.dart
index ffde7d9..3d52d78 100644
--- a/sdk/lib/convert/byte_conversion.dart
+++ b/sdk/lib/convert/byte_conversion.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.6
-
 part of dart.convert;
 
 /// The [ByteConversionSink] provides an interface for converters to
diff --git a/sdk/lib/convert/chunked_conversion.dart b/sdk/lib/convert/chunked_conversion.dart
index 3b67c3a..d2c24f0 100644
--- a/sdk/lib/convert/chunked_conversion.dart
+++ b/sdk/lib/convert/chunked_conversion.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.6
-
 part of dart.convert;
 
 /// A [ChunkedConversionSink] is used to transmit data more efficiently between
@@ -74,7 +72,8 @@
     _chunkedSink.add(o);
   }
 
-  void addError(Object error, [StackTrace stackTrace]) {
+  void addError(Object error, [StackTrace? stackTrace]) {
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(error, "error");
     _eventSink.addError(error, stackTrace);
   }
diff --git a/sdk/lib/convert/codec.dart b/sdk/lib/convert/codec.dart
index 1d8daf3..38e4a3c 100644
--- a/sdk/lib/convert/codec.dart
+++ b/sdk/lib/convert/codec.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.6
-
 part of dart.convert;
 
 /// A [Codec] encodes and (if supported) decodes data.
diff --git a/sdk/lib/convert/convert.dart b/sdk/lib/convert/convert.dart
index ec6ba50..6173782 100644
--- a/sdk/lib/convert/convert.dart
+++ b/sdk/lib/convert/convert.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.6
-
 ///
 /// Encoders and decoders for converting between different data representations,
 /// including JSON and UTF-8.
diff --git a/sdk/lib/convert/converter.dart b/sdk/lib/convert/converter.dart
index 047859f..2167933 100644
--- a/sdk/lib/convert/converter.dart
+++ b/sdk/lib/convert/converter.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.6
-
 part of dart.convert;
 
 /// A [Converter] converts data from one representation into another.
diff --git a/sdk/lib/convert/encoding.dart b/sdk/lib/convert/encoding.dart
index 663ae64..b9238a8 100644
--- a/sdk/lib/convert/encoding.dart
+++ b/sdk/lib/convert/encoding.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.6
-
 part of dart.convert;
 
 /// Open-ended Encoding enum.
@@ -74,10 +72,9 @@
   ///
   /// The [name] passed is case insensitive.
   ///
-  /// If character set is not supported [:null:] is returned.
-  static Encoding getByName(String name) {
+  /// If character set is not supported `null` is returned.
+  static Encoding? getByName(String? name) {
     if (name == null) return null;
-    name = name.toLowerCase();
-    return _nameToEncoding[name];
+    return _nameToEncoding[name.toLowerCase()];
   }
 }
diff --git a/sdk/lib/convert/html_escape.dart b/sdk/lib/convert/html_escape.dart
index 5f10544..317e6c1 100644
--- a/sdk/lib/convert/html_escape.dart
+++ b/sdk/lib/convert/html_escape.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.6
-
 part of dart.convert;
 
 /// A `String` converter that converts characters to HTML entities.
@@ -160,11 +158,11 @@
   ///
   /// Returns `null` if no changes were necessary, otherwise returns
   /// the converted string.
-  String _convert(String text, int start, int end) {
-    StringBuffer result;
+  String? _convert(String text, int start, int end) {
+    StringBuffer? result;
     for (var i = start; i < end; i++) {
       var ch = text[i];
-      String replacement;
+      String? replacement;
       switch (ch) {
         case '&':
           replacement = '&amp;';
@@ -187,6 +185,11 @@
       }
       if (replacement != null) {
         result ??= StringBuffer();
+        // TODO(38725): Remove workaround when assignment promotion is
+        // implemented
+        if (result == null) {
+          throw "unreachable";
+        }
         if (i > start) result.write(text.substring(start, i));
         result.write(replacement);
         start = i + 1;
diff --git a/sdk/lib/convert/json.dart b/sdk/lib/convert/json.dart
index fc55abc..6d897a0 100644
--- a/sdk/lib/convert/json.dart
+++ b/sdk/lib/convert/json.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.6
-
 part of dart.convert;
 
 /// Error thrown by JSON serialization if an object cannot be serialized.
@@ -16,15 +14,15 @@
 /// serializable, the [cause] is null.
 class JsonUnsupportedObjectError extends Error {
   /// The object that could not be serialized.
-  final Object unsupportedObject;
+  final Object? unsupportedObject;
 
   /// The exception thrown when trying to convert the object.
-  final Object cause;
+  final Object? cause;
 
   /// The partial result of the conversion, up until the error happened.
   ///
   /// May be null.
-  final String partialResult;
+  final String? partialResult;
 
   JsonUnsupportedObjectError(this.unsupportedObject,
       {this.cause, this.partialResult});
@@ -48,7 +46,7 @@
 /// When the cycle is detected, a [JsonCyclicError] is thrown.
 class JsonCyclicError extends JsonUnsupportedObjectError {
   /// The first object that was detected as part of a cycle.
-  JsonCyclicError(Object object) : super(object);
+  JsonCyclicError(Object? object) : super(object);
   String toString() => "Cyclic error in JSON stringify";
 }
 
@@ -78,8 +76,9 @@
 ///
 /// Shorthand for `json.encode`. Useful if a local variable shadows the global
 /// [json] constant.
-String jsonEncode(Object value, {Object toEncodable(Object nonEncodable)}) =>
-    json.encode(value, toEncodable: toEncodable);
+String jsonEncode(Object? object,
+        {Object? toEncodable(Object? nonEncodable)?}) =>
+    json.encode(object, toEncodable: toEncodable);
 
 /// Parses the string and returns the resulting Json object.
 ///
@@ -92,7 +91,8 @@
 ///
 /// Shorthand for `json.decode`. Useful if a local variable shadows the global
 /// [json] constant.
-dynamic jsonDecode(String source, {Object reviver(Object key, Object value)}) =>
+dynamic jsonDecode(String source,
+        {Object? reviver(Object? key, Object? value)?}) =>
     json.decode(source, reviver: reviver);
 
 /// A [JsonCodec] encodes JSON objects to strings and decodes strings to
@@ -102,9 +102,9 @@
 ///
 ///     var encoded = json.encode([1, 2, { "a": null }]);
 ///     var decoded = json.decode('["foo", { "bar": 499 }]');
-class JsonCodec extends Codec<Object, String> {
-  final Function(Object key, Object value) _reviver;
-  final Function(dynamic) _toEncodable;
+class JsonCodec extends Codec<Object?, String> {
+  final Object? Function(Object? key, Object? value)? _reviver;
+  final Object? Function(dynamic)? _toEncodable;
 
   /// Creates a `JsonCodec` with the given reviver and encoding function.
   ///
@@ -127,7 +127,9 @@
   ///
   /// If [toEncodable] is omitted, it defaults to a function that returns the
   /// result of calling `.toJson()` on the unencodable object.
-  const JsonCodec({reviver(Object key, Object value), toEncodable(var object)})
+  const JsonCodec(
+      {Object? reviver(Object? key, Object? value)?,
+      Object? toEncodable(dynamic object)?})
       : _reviver = reviver,
         _toEncodable = toEncodable;
 
@@ -137,7 +139,7 @@
   /// that has been parsed during decoding. The `key` argument is either the
   /// integer list index for a list property, the string map key for object
   /// properties, or `null` for the final result.
-  JsonCodec.withReviver(reviver(Object key, Object value))
+  JsonCodec.withReviver(dynamic reviver(Object? key, Object? value))
       : this(reviver: reviver);
 
   /// Parses the string and returns the resulting Json object.
@@ -148,7 +150,8 @@
   /// properties, or `null` for the final result.
   ///
   /// The default [reviver] (when not provided) is the identity function.
-  dynamic decode(String source, {reviver(Object key, Object value)}) {
+  dynamic decode(String source,
+      {Object? reviver(Object? key, Object? value)?}) {
     reviver ??= _reviver;
     if (reviver == null) return decoder.convert(source);
     return JsonDecoder(reviver).convert(source);
@@ -163,7 +166,7 @@
   ///
   /// If [toEncodable] is omitted, it defaults to a function that returns the
   /// result of calling `.toJson()` on the unencodable object.
-  String encode(Object value, {toEncodable(object)}) {
+  String encode(Object? value, {Object? toEncodable(dynamic object)?}) {
     toEncodable ??= _toEncodable;
     if (toEncodable == null) return encoder.convert(value);
     return JsonEncoder(toEncodable).convert(value);
@@ -181,21 +184,18 @@
 }
 
 /// This class converts JSON objects to strings.
-///
-/// When used as a [StreamTransformer], this converter does not promise
-/// that the input object is emitted as a single string event.
-class JsonEncoder extends Converter<Object, String> {
+class JsonEncoder extends Converter<Object?, String> {
   /// The string used for indention.
   ///
   /// When generating multi-line output, this string is inserted once at the
   /// beginning of each indented line for each level of indentation.
   ///
   /// If `null`, the output is encoded as a single line.
-  final String indent;
+  final String? indent;
 
   /// Function called on non-encodable objects to return a replacement
   /// encodable object that will be encoded in the orignal's place.
-  final Function(dynamic) _toEncodable;
+  final Object? Function(dynamic)? _toEncodable;
 
   /// Creates a JSON encoder.
   ///
@@ -207,7 +207,7 @@
   ///
   /// If [toEncodable] is omitted, it defaults to calling `.toJson()` on
   /// the object.
-  const JsonEncoder([toEncodable(object)])
+  const JsonEncoder([Object? toEncodable(dynamic object)?])
       : indent = null,
         _toEncodable = toEncodable;
 
@@ -227,7 +227,8 @@
   ///
   /// If [toEncodable] is omitted, it defaults to calling `.toJson()` on
   /// the object.
-  const JsonEncoder.withIndent(this.indent, [toEncodable(object)])
+  const JsonEncoder.withIndent(this.indent,
+      [Object? toEncodable(dynamic object)?])
       : _toEncodable = toEncodable;
 
   /// Converts [object] to a JSON [String].
@@ -256,7 +257,7 @@
   /// If an object is serialized more than once, [convert] may cache the text
   /// for it. In other words, if the content of an object changes after it is
   /// first serialized, the new values may not be reflected in the result.
-  String convert(Object object) =>
+  String convert(Object? object) =>
       _JsonStringStringifier.stringify(object, _toEncodable, indent);
 
   /// Starts a chunked conversion.
@@ -266,7 +267,7 @@
   ///
   /// Returns a chunked-conversion sink that accepts at most one object. It is
   /// an error to invoke `add` more than once on the returned sink.
-  ChunkedConversionSink<Object> startChunkedConversion(Sink<String> sink) {
+  ChunkedConversionSink<Object?> startChunkedConversion(Sink<String> sink) {
     if (sink is _Utf8EncoderSink) {
       return _JsonUtf8EncoderSink(
           sink._sink,
@@ -281,15 +282,13 @@
   }
 
   // Override the base class's bind, to provide a better type.
-  Stream<String> bind(Stream<Object> stream) => super.bind(stream);
+  Stream<String> bind(Stream<Object?> stream) => super.bind(stream);
 
-  Converter<Object, T> fuse<T>(Converter<String, T> other) {
+  Converter<Object?, T> fuse<T>(Converter<String, T> other) {
     if (other is Utf8Encoder) {
       // The instance check guarantees that `T` is (a subtype of) List<int>,
       // but the static type system doesn't know that, and so we cast.
-      // Cast through dynamic to keep the cast implicit for builds using
-      // unchecked implicit casts.
-      return JsonUtf8Encoder(indent, _toEncodable) as dynamic;
+      return JsonUtf8Encoder(indent, _toEncodable) as Converter<Object?, T>;
     }
     return super.fuse<T>(other);
   }
@@ -300,17 +299,17 @@
 /// This encoder works equivalently to first converting the object to
 /// a JSON string, and then UTF-8 encoding the string, but without
 /// creating an intermediate string.
-class JsonUtf8Encoder extends Converter<Object, List<int>> {
+class JsonUtf8Encoder extends Converter<Object?, List<int>> {
   /// Default buffer size used by the JSON-to-UTF-8 encoder.
   static const int _defaultBufferSize = 256;
   @deprecated
   static const int DEFAULT_BUFFER_SIZE = _defaultBufferSize;
 
   /// Indentation used in pretty-print mode, `null` if not pretty.
-  final List<int> _indent;
+  final List<int>? _indent;
 
   /// Function called with each un-encodable object encountered.
-  final Function(dynamic) _toEncodable;
+  final Object? Function(dynamic)? _toEncodable;
 
   /// UTF-8 buffer size.
   final int _bufferSize;
@@ -339,12 +338,12 @@
   /// If [toEncodable] is omitted, it defaults to calling `.toJson()` on the
   /// object.
   JsonUtf8Encoder(
-      [String indent, toEncodable(object), int bufferSize = _defaultBufferSize])
+      [String? indent, dynamic toEncodable(dynamic object)?, int? bufferSize])
       : _indent = _utf8Encode(indent),
         _toEncodable = toEncodable,
-        _bufferSize = bufferSize;
+        _bufferSize = bufferSize ?? _defaultBufferSize;
 
-  static List<int> _utf8Encode(String string) {
+  static List<int>? _utf8Encode(String? string) {
     if (string == null) return null;
     if (string.isEmpty) return Uint8List(0);
     checkAscii:
@@ -358,7 +357,7 @@
   }
 
   /// Convert [object] into UTF-8 encoded JSON.
-  List<int> convert(Object object) {
+  List<int> convert(Object? object) {
     var bytes = <List<int>>[];
     // The `stringify` function always converts into chunks.
     // Collect the chunks into the `bytes` list, then combine them afterwards.
@@ -394,7 +393,7 @@
   ///
   /// The argument [sink] will receive byte lists in sizes depending on the
   /// `bufferSize` passed to the constructor when creating this encoder.
-  ChunkedConversionSink<Object> startChunkedConversion(Sink<List<int>> sink) {
+  ChunkedConversionSink<Object?> startChunkedConversion(Sink<List<int>> sink) {
     ByteConversionSink byteSink;
     if (sink is ByteConversionSink) {
       byteSink = sink;
@@ -405,7 +404,7 @@
   }
 
   // Override the base class's bind, to provide a better type.
-  Stream<List<int>> bind(Stream<Object> stream) {
+  Stream<List<int>> bind(Stream<Object?> stream) {
     return super.bind(stream);
   }
 }
@@ -413,9 +412,9 @@
 /// Implements the chunked conversion from object to its JSON representation.
 ///
 /// The sink only accepts one value, but will produce output in a chunked way.
-class _JsonEncoderSink extends ChunkedConversionSink<Object> {
-  final String _indent;
-  final Function(dynamic) _toEncodable;
+class _JsonEncoderSink extends ChunkedConversionSink<Object?> {
+  final String? _indent;
+  final Object? Function(dynamic)? _toEncodable;
   final StringConversionSink _sink;
   bool _isDone = false;
 
@@ -426,7 +425,7 @@
   /// It is an error to invoke this method more than once on any instance. While
   /// this makes the input effectively non-chunked the output will be generated
   /// in a chunked way.
-  void add(Object o) {
+  void add(Object? o) {
     if (_isDone) {
       throw StateError("Only one call to add allowed");
     }
@@ -440,11 +439,11 @@
 }
 
 /// Sink returned when starting a chunked conversion from object to bytes.
-class _JsonUtf8EncoderSink extends ChunkedConversionSink<Object> {
+class _JsonUtf8EncoderSink extends ChunkedConversionSink<Object?> {
   /// The byte sink receiveing the encoded chunks.
   final ByteConversionSink _sink;
-  final List<int> _indent;
-  final Function(dynamic) _toEncodable;
+  final List<int>? _indent;
+  final Object? Function(dynamic)? _toEncodable;
   final int _bufferSize;
   bool _isDone = false;
   _JsonUtf8EncoderSink(
@@ -455,7 +454,7 @@
     _sink.addSlice(chunk, start, end, false);
   }
 
-  void add(Object object) {
+  void add(Object? object) {
     if (_isDone) {
       throw StateError("Only one call to add allowed");
     }
@@ -473,7 +472,7 @@
   }
 }
 
-/// This class parses JSON strings and builds the corresponding value.
+/// This class parses JSON strings and builds the corresponding objects.
 ///
 /// A JSON input must be the JSON encoding of a single JSON value,
 /// which can be a list or map containing other values.
@@ -481,13 +480,14 @@
 /// When used as a [StreamTransformer], the input stream may emit
 /// multiple strings. The concatenation of all of these strings must
 /// be a valid JSON encoding of a single JSON value.
-class JsonDecoder extends Converter<String, Object> {
-  final Function(Object key, Object value) _reviver;
+class JsonDecoder extends Converter<String, Object?> {
+  final Object? Function(Object? key, Object? value)? _reviver;
 
   /// Constructs a new JsonDecoder.
   ///
   /// The [reviver] may be `null`.
-  const JsonDecoder([reviver(Object key, Object value)]) : _reviver = reviver;
+  const JsonDecoder([Object? reviver(Object? key, Object? value)?])
+      : _reviver = reviver;
 
   /// Converts the given JSON-string [input] to its corresponding object.
   ///
@@ -507,14 +507,14 @@
   /// Starts a conversion from a chunked JSON string to its corresponding object.
   ///
   /// The output [sink] receives exactly one decoded element through `add`.
-  external StringConversionSink startChunkedConversion(Sink<Object> sink);
+  external StringConversionSink startChunkedConversion(Sink<Object?> sink);
 
   // Override the base class's bind, to provide a better type.
-  Stream<Object> bind(Stream<String> stream) => super.bind(stream);
+  Stream<Object?> bind(Stream<String> stream) => super.bind(stream);
 }
 
 // Internal optimized JSON parsing implementation.
-external dynamic _parseJson(String source, reviver(key, value));
+external dynamic _parseJson(String source, reviver(key, value)?);
 
 // Implementation of encoder/stringifier.
 
@@ -552,10 +552,10 @@
   /// Function called for each un-encodable object encountered.
   final Function(dynamic) _toEncodable;
 
-  _JsonStringifier(toEncodable(o))
+  _JsonStringifier(dynamic toEncodable(dynamic o)?)
       : _toEncodable = toEncodable ?? _defaultToEncodable;
 
-  String get _partialResult;
+  String? get _partialResult;
 
   /// Append a string to the JSON output.
   void writeString(String characters);
@@ -648,7 +648,7 @@
   ///
   /// Records the object if it isn't already seen. Should have a matching call to
   /// [_removeSeen] when the object is no longer being traversed.
-  void _checkCycle(object) {
+  void _checkCycle(Object? object) {
     for (var i = 0; i < _seen.length; i++) {
       if (identical(object, _seen[i])) {
         throw JsonCyclicError(object);
@@ -661,7 +661,7 @@
   ///
   /// Should be called in the opposite order of the matching [_checkCycle]
   /// calls.
-  void _removeSeen(object) {
+  void _removeSeen(Object? object) {
     assert(_seen.isNotEmpty);
     assert(identical(_seen.last, object));
     _seen.removeLast();
@@ -671,7 +671,7 @@
   ///
   /// If [object] isn't directly encodable, the [_toEncodable] function gets one
   /// chance to return a replacement which is encodable.
-  void writeObject(object) {
+  void writeObject(Object? object) {
     // Tries stringifying object directly. If it's not a simple value, List or
     // Map, call toJson() to get a custom representation and try serializing
     // that.
@@ -693,7 +693,7 @@
   ///
   /// Returns true if the value is one of these types, and false if not.
   /// If a value is both a [List] and a [Map], it's serialized as a [List].
-  bool writeJsonValue(object) {
+  bool writeJsonValue(Object? object) {
     if (object is num) {
       if (!object.isFinite) return false;
       writeNumber(object);
@@ -729,7 +729,7 @@
   }
 
   /// Serialize a [List].
-  void writeList(List list) {
+  void writeList(List<Object?> list) {
     writeString('[');
     if (list.isNotEmpty) {
       writeObject(list[0]);
@@ -742,12 +742,12 @@
   }
 
   /// Serialize a [Map].
-  bool writeMap(Map map) {
+  bool writeMap(Map<Object?, Object?> map) {
     if (map.isEmpty) {
       writeString("{}");
       return true;
     }
-    var keyValueList = List(map.length * 2);
+    var keyValueList = List<Object?>.filled(map.length * 2, null);
     var i = 0;
     var allStringKeys = true;
     map.forEach((key, value) {
@@ -763,7 +763,7 @@
     for (var i = 0; i < keyValueList.length; i += 2) {
       writeString(separator);
       separator = ',"';
-      writeStringContent(keyValueList[i]);
+      writeStringContent(keyValueList[i] as String);
       writeString('":');
       writeObject(keyValueList[i + 1]);
     }
@@ -782,7 +782,7 @@
   /// Add [indentLevel] indentations to the JSON output.
   void writeIndentation(int indentLevel);
 
-  void writeList(List list) {
+  void writeList(List<Object?> list) {
     if (list.isEmpty) {
       writeString('[]');
     } else {
@@ -802,12 +802,12 @@
     }
   }
 
-  bool writeMap(Map map) {
+  bool writeMap(Map<Object?, Object?> map) {
     if (map.isEmpty) {
       writeString("{}");
       return true;
     }
-    var keyValueList = List(map.length * 2);
+    var keyValueList = List<Object?>.filled(map.length * 2, null);
     var i = 0;
     var allStringKeys = true;
     map.forEach((key, value) {
@@ -826,7 +826,7 @@
       separator = ",\n";
       writeIndentation(_indentLevel);
       writeString('"');
-      writeStringContent(keyValueList[i]);
+      writeStringContent(keyValueList[i] as String);
       writeString('": ');
       writeObject(keyValueList[i + 1]);
     }
@@ -842,7 +842,8 @@
 class _JsonStringStringifier extends _JsonStringifier {
   final StringSink _sink;
 
-  _JsonStringStringifier(this._sink, dynamic Function(dynamic) _toEncodable)
+  _JsonStringStringifier(
+      this._sink, dynamic Function(dynamic object)? _toEncodable)
       : super(_toEncodable);
 
   /// Convert object to a string.
@@ -854,7 +855,8 @@
   /// with newlines and indentation. The `indent` string is added as indentation
   /// for each indentation level. It should only contain valid JSON whitespace
   /// characters (space, tab, carriage return or line feed).
-  static String stringify(object, toEncodable(o), String indent) {
+  static String stringify(
+      Object? object, dynamic toEncodable(dynamic object)?, String? indent) {
     var output = StringBuffer();
     printOn(object, output, toEncodable, indent);
     return output.toString();
@@ -863,8 +865,8 @@
   /// Convert object to a string, and write the result to the [output] sink.
   ///
   /// The result is written piecemally to the sink.
-  static void printOn(
-      object, StringSink output, toEncodable(o), String indent) {
+  static void printOn(Object? object, StringSink output,
+      dynamic toEncodable(dynamic o)?, String? indent) {
     _JsonStringifier stringifier;
     if (indent == null) {
       stringifier = _JsonStringStringifier(output, toEncodable);
@@ -874,7 +876,7 @@
     stringifier.writeObject(object);
   }
 
-  String get _partialResult => _sink is StringBuffer ? _sink.toString() : null;
+  String? get _partialResult => _sink is StringBuffer ? _sink.toString() : null;
 
   void writeNumber(num number) {
     _sink.write(number.toString());
@@ -897,7 +899,8 @@
     with _JsonPrettyPrintMixin {
   final String _indent;
 
-  _JsonStringStringifierPretty(StringSink sink, toEncodable(o), this._indent)
+  _JsonStringStringifierPretty(
+      StringSink sink, dynamic toEncodable(dynamic o)?, this._indent)
       : super(sink, toEncodable);
 
   void writeIndentation(int count) {
@@ -915,7 +918,8 @@
   Uint8List buffer;
   int index = 0;
 
-  _JsonUtf8Stringifier(toEncodable(o), this.bufferSize, this.addChunk)
+  _JsonUtf8Stringifier(
+      dynamic toEncodable(dynamic o)?, this.bufferSize, this.addChunk)
       : buffer = Uint8List(bufferSize),
         super(toEncodable);
 
@@ -928,8 +932,12 @@
   ///
   /// If [indent] is non-`null`, the result will be "pretty-printed" with extra
   /// newlines and indentation, using [indent] as the indentation.
-  static void stringify(Object object, List<int> indent, toEncodable(o),
-      int bufferSize, void addChunk(Uint8List chunk, int start, int end)) {
+  static void stringify(
+      Object? object,
+      List<int>? indent,
+      dynamic toEncodable(dynamic o)?,
+      int bufferSize,
+      void addChunk(Uint8List chunk, int start, int end)) {
     _JsonUtf8Stringifier stringifier;
     if (indent != null) {
       stringifier =
@@ -947,11 +955,11 @@
     if (index > 0) {
       addChunk(buffer, 0, index);
     }
-    buffer = null;
+    buffer = Uint8List(0);
     index = 0;
   }
 
-  String get _partialResult => null;
+  String? get _partialResult => null;
 
   void writeNumber(num number) {
     writeAsciiString(number.toString());
@@ -975,7 +983,7 @@
   void writeStringSlice(String string, int start, int end) {
     // TODO(lrn): Optimize by copying directly into buffer instead of going
     // through writeCharCode/writeByte. Assumption is the most characters
-    // in starings are plain ASCII.
+    // in strings are plain ASCII.
     for (var i = start; i < end; i++) {
       var char = string.codeUnitAt(i);
       if (char <= 0x7f) {
@@ -1049,8 +1057,8 @@
 class _JsonUtf8StringifierPretty extends _JsonUtf8Stringifier
     with _JsonPrettyPrintMixin {
   final List<int> indent;
-  _JsonUtf8StringifierPretty(toEncodable(o), this.indent, int bufferSize,
-      void addChunk(Uint8List buffer, int start, int end))
+  _JsonUtf8StringifierPretty(dynamic toEncodable(dynamic o)?, this.indent,
+      int bufferSize, void addChunk(Uint8List buffer, int start, int end))
       : super(toEncodable, bufferSize, addChunk);
 
   void writeIndentation(int count) {
diff --git a/sdk/lib/convert/latin1.dart b/sdk/lib/convert/latin1.dart
index 06fa681..f396682 100644
--- a/sdk/lib/convert/latin1.dart
+++ b/sdk/lib/convert/latin1.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.6
-
 part of dart.convert;
 
 /// An instance of the default implementation of the [Latin1Codec].
@@ -49,9 +47,8 @@
   ///
   /// If [allowInvalid] is not provided, it defaults to the value used to create
   /// this [Latin1Codec].
-  String decode(List<int> bytes, {bool allowInvalid}) {
-    allowInvalid ??= _allowInvalid;
-    if (allowInvalid) {
+  String decode(List<int> bytes, {bool? allowInvalid}) {
+    if (allowInvalid ?? _allowInvalid) {
       return const Latin1Decoder(allowInvalid: true).convert(bytes);
     } else {
       return const Latin1Decoder(allowInvalid: false).convert(bytes);
@@ -102,11 +99,11 @@
 }
 
 class _Latin1DecoderSink extends ByteConversionSinkBase {
-  StringConversionSink _sink;
+  StringConversionSink? _sink;
   _Latin1DecoderSink(this._sink);
 
   void close() {
-    _sink.close();
+    _sink!.close();
     _sink = null;
   }
 
@@ -119,12 +116,12 @@
     // _sink.addSlice(source, start, end, isLast).
     // The code below is an moderately stupid workaround until a real
     // solution can be made.
-    _sink.add(String.fromCharCodes(source, start, end));
+    _sink!.add(String.fromCharCodes(source, start, end));
     if (isLast) close();
   }
 
   void addSlice(List<int> source, int start, int end, bool isLast) {
-    end = RangeError.checkValidRange(start, end, source.length);
+    RangeError.checkValidRange(start, end, source.length);
     if (start == end) return;
     if (source is! Uint8List) {
       // List may contain value outside of the 0..255 range. If so, throw.
diff --git a/sdk/lib/convert/line_splitter.dart b/sdk/lib/convert/line_splitter.dart
index f51e53c..fa0be3f 100644
--- a/sdk/lib/convert/line_splitter.dart
+++ b/sdk/lib/convert/line_splitter.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.6
-
 part of dart.convert;
 
 // Character constants.
@@ -27,8 +25,12 @@
   /// `lines.substring(start, end)`. The [start] and [end] values must
   /// specify a valid sub-range of [lines]
   /// (`0 <= start <= end <= lines.length`).
-  static Iterable<String> split(String lines, [int start = 0, int end]) sync* {
+  static Iterable<String> split(String lines, [int start = 0, int? end]) sync* {
     end = RangeError.checkValidRange(start, end, lines.length);
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (end == null) {
+      throw RangeError("Invalid range");
+    }
     var sliceStart = start;
     var char = 0;
     for (var i = start; i < end; i++) {
@@ -92,7 +94,7 @@
   ///
   /// If the previous slice ended in a line without a line terminator,
   /// then the next slice may continue the line.
-  String _carry;
+  String? _carry;
 
   /// Whether to skip a leading LF character from the next slice.
   ///
@@ -112,9 +114,10 @@
       if (isLast) close();
       return;
     }
-    if (_carry != null) {
+    String? carry = _carry;
+    if (carry != null) {
       assert(!_skipLeadingLF);
-      chunk = _carry + chunk.substring(start, end);
+      chunk = carry + chunk.substring(start, end);
       start = 0;
       end = chunk.length;
       _carry = null;
@@ -130,7 +133,7 @@
 
   void close() {
     if (_carry != null) {
-      _sink.add(_carry);
+      _sink.add(_carry!);
       _carry = null;
     }
     _sink.close();
@@ -168,7 +171,7 @@
       : _eventSink = eventSink,
         super(StringConversionSink.from(eventSink));
 
-  void addError(Object o, [StackTrace stackTrace]) {
+  void addError(Object o, [StackTrace? stackTrace]) {
     _eventSink.addError(o, stackTrace);
   }
 }
diff --git a/sdk/lib/convert/string_conversion.dart b/sdk/lib/convert/string_conversion.dart
index 6c7d965..2315330 100644
--- a/sdk/lib/convert/string_conversion.dart
+++ b/sdk/lib/convert/string_conversion.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.6
-
 part of dart.convert;
 
 /// This class provides an interface for converters to
@@ -81,11 +79,11 @@
     _sink.writeCharCode(charCode);
   }
 
-  void write(Object o) {
+  void write(Object? o) {
     _sink.write(o);
   }
 
-  void writeln([Object o = ""]) {
+  void writeln([Object? o = ""]) {
     _sink.writeln(o);
   }
 
@@ -101,8 +99,8 @@
 class _StringConversionSinkAsStringSinkAdapter implements ClosableStringSink {
   static const _MIN_STRING_SIZE = 16;
 
-  StringBuffer _buffer;
-  StringConversionSink _chunkedSink;
+  final StringBuffer _buffer;
+  final StringConversionSink _chunkedSink;
 
   _StringConversionSinkAsStringSinkAdapter(this._chunkedSink)
       : _buffer = StringBuffer();
@@ -117,12 +115,12 @@
     if (_buffer.length > _MIN_STRING_SIZE) _flush();
   }
 
-  void write(Object o) {
+  void write(Object? o) {
     if (_buffer.isNotEmpty) _flush();
     _chunkedSink.add(o.toString());
   }
 
-  void writeln([Object o = ""]) {
+  void writeln([Object? o = ""]) {
     _buffer.writeln(o);
     if (_buffer.length > _MIN_STRING_SIZE) _flush();
   }
@@ -177,10 +175,11 @@
 /// This class is a [StringConversionSink] that wraps a [StringSink].
 class _StringSinkConversionSink<TStringSink extends StringSink>
     extends StringConversionSinkBase {
-  TStringSink _stringSink;
+  final TStringSink _stringSink;
   _StringSinkConversionSink(this._stringSink);
 
   void close() {}
+
   void addSlice(String str, int start, int end, bool isLast) {
     if (start != 0 || end != str.length) {
       for (var i = start; i < end; i++) {
@@ -211,6 +210,7 @@
 /// This class can be used to terminate a chunked conversion.
 class _StringCallbackSink extends _StringSinkConversionSink<StringBuffer> {
   final void Function(String) _callback;
+
   _StringCallbackSink(this._callback) : super(StringBuffer());
 
   void close() {
@@ -253,9 +253,11 @@
 }
 
 /// Decodes UTF-8 code units and stores them in a [StringSink].
+///
+/// The `Sink` provided is closed when this sink is closed.
 class _Utf8StringSinkAdapter extends ByteConversionSink {
   final _Utf8Decoder _decoder;
-  final Sink _sink;
+  final Sink<Object?> _sink;
   final StringSink _stringSink;
 
   _Utf8StringSinkAdapter(this._sink, this._stringSink, bool allowMalformed)
@@ -263,7 +265,7 @@
 
   void close() {
     _decoder.flush(_stringSink);
-    if (_sink != null) _sink.close();
+    _sink.close();
   }
 
   void add(List<int> chunk) {
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index c19bb37..c74f918 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.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.6
-
 part of dart.convert;
 
 /// The Unicode Replacement character `U+FFFD` (�).
@@ -56,10 +54,9 @@
   ///
   /// If [allowMalformed] is not given, it defaults to the `allowMalformed` that
   /// was used to instantiate `this`.
-  String decode(List<int> codeUnits, {bool allowMalformed}) {
-    allowMalformed ??= _allowMalformed;
+  String decode(List<int> codeUnits, {bool? allowMalformed}) {
     // Switch between const objects to avoid allocation.
-    Utf8Decoder decoder = allowMalformed
+    Utf8Decoder decoder = allowMalformed ?? _allowMalformed
         ? const Utf8Decoder(allowMalformed: true)
         : const Utf8Decoder(allowMalformed: false);
     return decoder.convert(codeUnits);
@@ -87,9 +84,13 @@
   ///
   /// Any unpaired surrogate character (`U+D800`-`U+DFFF`) in the input string
   /// is encoded as a Unicode Replacement character `U+FFFD` (�).
-  Uint8List convert(String string, [int start = 0, int end]) {
+  Uint8List convert(String string, [int start = 0, int? end]) {
     var stringLength = string.length;
     end = RangeError.checkValidRange(start, end, stringLength);
+    // TODO(38725): Remove workaround when assignment promotion is implemented
+    if (end == null) {
+      throw RangeError("Invalid range");
+    }
     var length = end - start;
     if (length == 0) return Uint8List(0);
     // Create a new encoder with a length that is guaranteed to be big enough.
@@ -309,7 +310,7 @@
   ///
   /// If the [codeUnits] start with the encoding of a
   /// [unicodeBomCharacterRune], that character is discarded.
-  String convert(List<int> codeUnits, [int start = 0, int end]) {
+  String convert(List<int> codeUnits, [int start = 0, int? end]) {
     // Allow the implementation to intercept and specialize based on the type
     // of codeUnits.
     var result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
@@ -339,8 +340,8 @@
 
   external Converter<List<int>, T> fuse<T>(Converter<String, T> next);
 
-  external static String _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int end);
+  external static String? _convertIntercepted(
+      bool allowMalformed, List<int> codeUnits, int start, int? end);
 }
 
 // UTF-8 constants.
@@ -519,12 +520,12 @@
 
   external _Utf8Decoder(bool allowMalformed);
 
-  external String convertSingle(List<int> codeUnits, int start, int maybeEnd);
+  external String convertSingle(List<int> codeUnits, int start, int? maybeEnd);
 
-  external String convertChunked(List<int> codeUnits, int start, int maybeEnd);
+  external String convertChunked(List<int> codeUnits, int start, int? maybeEnd);
 
   String convertGeneral(
-      List<int> codeUnits, int start, int maybeEnd, bool single) {
+      List<int> codeUnits, int start, int? maybeEnd, bool single) {
     int end = RangeError.checkValidRange(start, maybeEnd, codeUnits.length);
 
     if (start == end) return "";
diff --git a/sdk/lib/core/annotations.dart b/sdk/lib/core/annotations.dart
index 6c39fcf..f407683 100644
--- a/sdk/lib/core/annotations.dart
+++ b/sdk/lib/core/annotations.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.6
-
 part of dart.core;
 
 /**
@@ -122,8 +120,8 @@
  */
 @deprecated
 class Provisional {
-  String get message => null;
-  const Provisional({String message});
+  String? get message => null;
+  const Provisional({String? message});
 }
 
 /**
@@ -233,10 +231,10 @@
   final String name;
 
   /** Optional extra data parameterizing the hint. */
-  final Object options;
+  final Object? options;
 
   /** Creates a hint named [name] with optional [options]. */
-  const factory pragma(String name, [Object options]) = pragma._;
+  const factory pragma(String name, [Object? options]) = pragma._;
 
   const pragma._(this.name, [this.options]);
 }
diff --git a/sdk/lib/core/bigint.dart b/sdk/lib/core/bigint.dart
index c3f261b..94a9445 100644
--- a/sdk/lib/core/bigint.dart
+++ b/sdk/lib/core/bigint.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.6
-
 part of dart.core;
 
 /**
@@ -37,7 +35,7 @@
    * Throws a [FormatException] if the [source] is not a valid integer literal,
    * optionally prefixed by a sign.
    */
-  external static BigInt parse(String source, {int radix});
+  external static BigInt parse(String source, {int? radix});
 
   /**
    * Parses [source] as a, possibly signed, integer literal and returns its
@@ -46,7 +44,7 @@
    * As [parse] except that this method returns `null` if the input is not
    * valid
    */
-  external static BigInt tryParse(String source, {int radix});
+  external static BigInt? tryParse(String source, {int? radix});
 
   /// Allocates a big integer from the provided [value] number.
   external factory BigInt.from(num value);
diff --git a/sdk/lib/core/bool.dart b/sdk/lib/core/bool.dart
index ae8341b..3d35d80 100644
--- a/sdk/lib/core/bool.dart
+++ b/sdk/lib/core/bool.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.6
-
 part of dart.core;
 
 /**
@@ -85,21 +83,20 @@
   /// The logical conjunction ("and") of this and [other].
   ///
   /// Returns `true` if both this and [other] are `true`, and `false` otherwise.
-  //TODO(lrn): Remove "as bool" in Dart 2.
   @Since("2.1")
-  bool operator &(bool other) => (other as bool) && this;
+  bool operator &(bool other) => other && this;
 
   /// The logical disjunction ("inclusive or") of this and [other].
   ///
   /// Returns `true` if either this or [other] is `true`, and `false` otherwise.
   @Since("2.1")
-  bool operator |(bool other) => (other as bool) || this;
+  bool operator |(bool other) => other || this;
 
   /// The logical exclusive disjunction ("exclusive or") of this and [other].
   ///
   /// Returns whether this and [other] are neither both `true` nor both `false`.
   @Since("2.1")
-  bool operator ^(bool other) => !(other as bool) == this;
+  bool operator ^(bool other) => !other == this;
 
   /**
    * Returns either `"true"` for `true` and `"false"` for `false`.
diff --git a/sdk/lib/core/comparable.dart b/sdk/lib/core/comparable.dart
index 08bb965..835aa34 100644
--- a/sdk/lib/core/comparable.dart
+++ b/sdk/lib/core/comparable.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.6
-
 part of dart.core;
 
 /**
diff --git a/sdk/lib/core/core.dart b/sdk/lib/core/core.dart
index 7d67132..dc037a3 100644
--- a/sdk/lib/core/core.dart
+++ b/sdk/lib/core/core.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.6
-
 /**
  *
  * Built-in types, collections,
@@ -169,7 +167,7 @@
         StringConversionSink,
         utf8;
 import "dart:math" show Random; // Used by List.shuffle.
-import "dart:typed_data" show Uint8List, Uint16List, Endian;
+import "dart:typed_data" show Uint8List;
 
 @Since("2.1")
 export "dart:async" show Future, Stream;
diff --git a/sdk/lib/core/date_time.dart b/sdk/lib/core/date_time.dart
index b36aa3f..ae13922 100644
--- a/sdk/lib/core/date_time.dart
+++ b/sdk/lib/core/date_time.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.6
-
 part of dart.core;
 
 /**
@@ -279,9 +277,9 @@
   // Or not, that may be a breaking change.
   static DateTime parse(String formattedString) {
     var re = _parseFormat;
-    Match match = re.firstMatch(formattedString);
+    Match? match = re.firstMatch(formattedString);
     if (match != null) {
-      int parseIntOrZero(String matched) {
+      int parseIntOrZero(String? matched) {
         if (matched == null) return 0;
         return int.parse(matched);
       }
@@ -289,7 +287,7 @@
       // Parses fractional second digits of '.(\d+)' into the combined
       // microseconds. We only use the first 6 digits because of DateTime
       // precision of 999 milliseconds and 999 microseconds.
-      int parseMilliAndMicroseconds(String matched) {
+      int parseMilliAndMicroseconds(String? matched) {
         if (matched == null) return 0;
         int length = matched.length;
         assert(length >= 1);
@@ -303,31 +301,32 @@
         return result;
       }
 
-      int years = int.parse(match[1]);
-      int month = int.parse(match[2]);
-      int day = int.parse(match[3]);
+      int years = int.parse(match[1]!);
+      int month = int.parse(match[2]!);
+      int day = int.parse(match[3]!);
       int hour = parseIntOrZero(match[4]);
       int minute = parseIntOrZero(match[5]);
       int second = parseIntOrZero(match[6]);
       int milliAndMicroseconds = parseMilliAndMicroseconds(match[7]);
       int millisecond =
           milliAndMicroseconds ~/ Duration.microsecondsPerMillisecond;
-      int microsecond =
-          milliAndMicroseconds.remainder(Duration.microsecondsPerMillisecond);
+      int microsecond = milliAndMicroseconds
+          .remainder(Duration.microsecondsPerMillisecond) as int;
       bool isUtc = false;
       if (match[8] != null) {
         // timezone part
         isUtc = true;
-        if (match[9] != null) {
+        String? tzSign = match[9];
+        if (tzSign != null) {
           // timezone other than 'Z' and 'z'.
-          int sign = (match[9] == '-') ? -1 : 1;
-          int hourDifference = int.parse(match[10]);
+          int sign = (tzSign == '-') ? -1 : 1;
+          int hourDifference = int.parse(match[10]!);
           int minuteDifference = parseIntOrZero(match[11]);
           minuteDifference += 60 * hourDifference;
           minute -= sign * minuteDifference;
         }
       }
-      int value = _brokenDownDateToValue(years, month, day, hour, minute,
+      int? value = _brokenDownDateToValue(years, month, day, hour, minute,
           second, millisecond, microsecond, isUtc);
       if (value == null) {
         throw FormatException("Time out of range", formattedString);
@@ -344,7 +343,7 @@
    * Works like [parse] except that this function returns `null`
    * where [parse] would throw a [FormatException].
    */
-  static DateTime tryParse(String formattedString) {
+  static DateTime? tryParse(String formattedString) {
     // TODO: Optimize to avoid throwing.
     try {
       return parse(formattedString);
@@ -386,13 +385,14 @@
    *
    * If [isUtc] is false then the date is in the local time zone.
    */
-  DateTime._withValue(this._value, {this.isUtc}) {
+  DateTime._withValue(this._value, {required this.isUtc}) {
     if (millisecondsSinceEpoch.abs() > _maxMillisecondsSinceEpoch ||
         (millisecondsSinceEpoch.abs() == _maxMillisecondsSinceEpoch &&
             microsecond != 0)) {
       throw ArgumentError(
           "DateTime is outside valid range: $millisecondsSinceEpoch");
     }
+    // For backwards compatibility with legacy mode.
     ArgumentError.checkNotNull(isUtc, "isUtc");
   }
 
@@ -411,7 +411,7 @@
    * See [isAtSameMomentAs] for a comparison that compares moments in time
    * independently of their zones.
    */
-  external bool operator ==(dynamic other);
+  external bool operator ==(Object other);
 
   /**
    * Returns true if [this] occurs before [other].
@@ -693,7 +693,7 @@
 
   /// Returns the time as value (millisecond or microsecond since epoch), or
   /// null if the values are out of range.
-  external static int _brokenDownDateToValue(
+  external static int? _brokenDownDateToValue(
       int year,
       int month,
       int day,
diff --git a/sdk/lib/core/double.dart b/sdk/lib/core/double.dart
index 18f782f..42ff566 100644
--- a/sdk/lib/core/double.dart
+++ b/sdk/lib/core/double.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.6
-
 part of dart.core;
 
 // TODO: Convert this abstract class into a concrete class double
@@ -208,7 +206,7 @@
    * you should use `double.tryParse(string) ?? (...)`.
    */
   external static double parse(String source,
-      [@deprecated double onError(String source)]);
+      [@deprecated double onError(String source)?]);
 
   /**
    * Parse [source] as an double literal and return its value.
@@ -216,5 +214,5 @@
    * Like [parse] except that this function returns `null` for invalid inputs
    * instead of throwing, and the [source] must still not be `null`.
    */
-  external static double tryParse(String source);
+  external static double? tryParse(String source);
 }
diff --git a/sdk/lib/core/duration.dart b/sdk/lib/core/duration.dart
index eeb0337..2a1f406 100644
--- a/sdk/lib/core/duration.dart
+++ b/sdk/lib/core/duration.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.6
-
 part of dart.core;
 
 /**
@@ -215,7 +213,7 @@
   /**
    * Returns `true` if this [Duration] has the same value as [other].
    */
-  bool operator ==(dynamic other) =>
+  bool operator ==(Object other) =>
       other is Duration && _duration == other.inMicroseconds;
 
   int get hashCode => _duration.hashCode;
@@ -260,10 +258,12 @@
     if (inMicroseconds < 0) {
       return "-${-this}";
     }
-    String twoDigitMinutes = twoDigits(inMinutes.remainder(minutesPerHour));
-    String twoDigitSeconds = twoDigits(inSeconds.remainder(secondsPerMinute));
+    String twoDigitMinutes =
+        twoDigits(inMinutes.remainder(minutesPerHour) as int);
+    String twoDigitSeconds =
+        twoDigits(inSeconds.remainder(secondsPerMinute) as int);
     String sixDigitUs =
-        sixDigits(inMicroseconds.remainder(microsecondsPerSecond));
+        sixDigits(inMicroseconds.remainder(microsecondsPerSecond) as int);
     return "$inHours:$twoDigitMinutes:$twoDigitSeconds.$sixDigitUs";
   }
 
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index ac585de..a84c6ee 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.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.6
-
 part of dart.core;
 
 /**
@@ -76,7 +74,7 @@
    * The conversion is guaranteed to not throw, so it won't use the object's
    * toString method.
    */
-  static String safeToString(Object object) {
+  static String safeToString(Object? object) {
     if (object is num || object is bool || null == object) {
       return object.toString();
     }
@@ -91,7 +89,7 @@
 
   external static String _objectToString(Object object);
 
-  external StackTrace get stackTrace;
+  external StackTrace? get stackTrace;
 }
 
 /**
@@ -99,7 +97,7 @@
  */
 class AssertionError extends Error {
   /** Message describing the assertion error. */
-  final Object message;
+  final Object? message;
 
   AssertionError([this.message]);
 
@@ -123,7 +121,7 @@
 class CastError extends Error {}
 
 /**
- * Error thrown when attempting to throw [:null:].
+ * Error thrown when attempting to throw `null`.
  */
 class NullThrownError extends Error {
   @pragma("vm:entry-point")
@@ -138,11 +136,11 @@
   /** Whether value was provided. */
   final bool _hasValue;
   /** The invalid value. */
-  final invalidValue;
+  final dynamic invalidValue;
   /** Name of the invalid argument, if available. */
-  final String name;
+  final String? name;
   /** Message describing the problem. */
-  final message;
+  final dynamic message;
 
   /**
    * The [message] describes the erroneous argument.
@@ -192,7 +190,7 @@
    * Returns the [argument] if it is not null.
    */
   @Since("2.1")
-  static T checkNotNull<@Since("2.8") T>(T argument, [String name]) {
+  static T checkNotNull<@Since("2.8") T>(T? argument, [String? name]) {
     if (argument == null) throw ArgumentError.notNull(name);
     return argument;
   }
@@ -202,12 +200,11 @@
   String get _errorExplanation => "";
 
   String toString() {
-    String nameString = "";
-    if (name != null) {
-      nameString = " ($name)";
-    }
-    var message = (this.message == null) ? "" : ": ${this.message}";
-    String prefix = "$_errorName$nameString$message";
+    String? name = this.name;
+    String nameString = (name == null) ? "" : " ($name)";
+    Object? message = this.message;
+    var messageString = (message == null) ? "" : ": ${message}";
+    String prefix = "$_errorName$nameString$messageString";
     if (!_hasValue) return prefix;
     // If we know the invalid value, we can try to describe the problem.
     String explanation = _errorExplanation;
@@ -221,9 +218,9 @@
  */
 class RangeError extends ArgumentError {
   /** The minimum value that [value] is allowed to assume. */
-  final num start;
+  final num? start;
   /** The maximum value that [value] is allowed to assume. */
-  final num end;
+  final num? end;
 
   // TODO(lrn): This constructor should be called only with string values.
   // It currently isn't in all cases.
@@ -243,11 +240,10 @@
    * invalid value, and the [message] can override the default error
    * description.
    */
-  RangeError.value(num value, [String name, String message])
+  RangeError.value(num value, [String? name, String? message])
       : start = null,
         end = null,
-        super.value(
-            value, name, (message != null) ? message : "Value not in range");
+        super.value(value, name, message ?? "Value not in range");
 
   /**
    * Create a new [RangeError] for a value being outside the valid range.
@@ -264,12 +260,11 @@
    * description.
    */
   @pragma("vm:entry-point")
-  RangeError.range(num invalidValue, int minValue, int maxValue,
-      [String name, String message])
+  RangeError.range(num invalidValue, int? minValue, int? maxValue,
+      [String? name, String? message])
       : start = minValue,
         end = maxValue,
-        super.value(
-            invalidValue, name, (message != null) ? message : "Invalid value");
+        super.value(invalidValue, name, message ?? "Invalid value");
 
   /**
    * Creates a new [RangeError] stating that [index] is not a valid index
@@ -283,7 +278,7 @@
    * If `length` is omitted, it defaults to `indexable.length`.
    */
   factory RangeError.index(int index, dynamic indexable,
-      [String name, String message, int length]) = IndexError;
+      [String? name, String? message, int? length]) = IndexError;
 
   /**
    * Check that an integer [value] lies in a specific interval.
@@ -297,7 +292,7 @@
    * Returns [value] if it is in the interval.
    */
   static int checkValueInInterval(int value, int minValue, int maxValue,
-      [String name, String message]) {
+      [String? name, String? message]) {
     if (value < minValue || value > maxValue) {
       throw RangeError.range(value, minValue, maxValue, name, message);
     }
@@ -322,8 +317,8 @@
    * Returns [index] if it is a valid index.
    */
   static int checkValidIndex(int index, dynamic indexable,
-      [String name, int length, String message]) {
-    length ??= indexable.length;
+      [String? name, int? length, String? message]) {
+    length ??= (indexable.length as int);
     // Comparing with `0` as receiver produces better dart2js type inference.
     if (0 > index || index >= length) {
       name ??= "index";
@@ -348,8 +343,8 @@
    * Returns the actual `end` value, which is `length` if `end` is `null`,
    * and `end` otherwise.
    */
-  static int checkValidRange(int start, int end, int length,
-      [String startName, String endName, String message]) {
+  static int checkValidRange(int start, int? end, int length,
+      [String? startName, String? endName, String? message]) {
     // Comparing with `0` as receiver produces better dart2js type inference.
     // Ditto `start > end` below.
     if (0 > start || start > length) {
@@ -377,7 +372,7 @@
    *
    * Returns [value] if it is not negative.
    */
-  static int checkNotNegative(int value, [String name, String message]) {
+  static int checkNotNegative(int value, [String? name, String? message]) {
     if (value < 0) throw RangeError.range(value, 0, null, name, message);
     return value;
   }
@@ -386,6 +381,8 @@
   String get _errorExplanation {
     assert(_hasValue);
     String explanation = "";
+    num? start = this.start;
+    num? end = this.end;
     if (start == null) {
       if (end != null) {
         explanation = ": Not less than or equal to $end";
@@ -428,11 +425,10 @@
    * The message is used as part of the string representation of the error.
    */
   IndexError(int invalidValue, dynamic indexable,
-      [String name, String message, int length])
+      [String? name, String? message, int? length])
       : this.indexable = indexable,
         this.length = length ?? indexable.length,
-        super.value(invalidValue, name,
-            (message != null) ? message : "Index out of range");
+        super.value(invalidValue, name, message ?? "Index out of range");
 
   // Getters inherited from RangeError.
   int get start => 0;
@@ -492,7 +488,7 @@
    * should not be `null`.
    */
   external NoSuchMethodError.withInvocation(
-      Object receiver, Invocation invocation);
+      Object? receiver, Invocation invocation);
 
   // Deprecated constructor to be removed after dart2js updates to the above.
   /**
@@ -511,16 +507,16 @@
    * empty list.
    *
    * The [namedArguments] is a map from [Symbol]s to the values of named
-   * arguments that the method was called with.
+   * arguments that the method was called with. If null, it is considered
+   * equivalent to the empty map.
    *
    * This constructor does not handle type arguments.
    * To include type variables, create an [Invocation] and use
    * [NoSuchMethodError.withInvocation].
    */
   @Deprecated("Use NoSuchMethod.withInvocation instead")
-  external NoSuchMethodError(Object receiver, Symbol memberName,
-      List positionalArguments, Map<Symbol, dynamic> namedArguments,
-      [@deprecated List existingArgumentNames]);
+  external NoSuchMethodError(Object? receiver, Symbol memberName,
+      List? positionalArguments, Map<Symbol, dynamic>? namedArguments);
 
   external String toString();
 }
@@ -533,9 +529,9 @@
  */
 @pragma("vm:entry-point")
 class UnsupportedError extends Error {
-  final String message;
+  final String? message;
   @pragma("vm:entry-point")
-  UnsupportedError(this.message);
+  UnsupportedError(String this.message);
   String toString() => "Unsupported operation: $message";
 }
 
@@ -550,11 +546,14 @@
  * use during development.
  */
 class UnimplementedError extends Error implements UnsupportedError {
-  final String message;
+  final String? message;
   UnimplementedError([this.message]);
-  String toString() => (this.message != null
-      ? "UnimplementedError: $message"
-      : "UnimplementedError");
+  String toString() {
+    var message = this.message;
+    return (message != null)
+        ? "UnimplementedError: $message"
+        : "UnimplementedError";
+  }
 }
 
 /**
@@ -578,7 +577,7 @@
  */
 class ConcurrentModificationError extends Error {
   /** The object that was modified in an incompatible way. */
-  final Object modifiedObject;
+  final Object? modifiedObject;
 
   ConcurrentModificationError([this.modifiedObject]);
 
@@ -596,7 +595,7 @@
   const OutOfMemoryError();
   String toString() => "Out of Memory";
 
-  StackTrace get stackTrace => null;
+  StackTrace? get stackTrace => null;
 }
 
 class StackOverflowError implements Error {
@@ -604,7 +603,7 @@
   const StackOverflowError();
   String toString() => "Stack Overflow";
 
-  StackTrace get stackTrace => null;
+  StackTrace? get stackTrace => null;
 }
 
 /**
@@ -615,12 +614,15 @@
  * another read of the variable, this error is thrown.
  */
 class CyclicInitializationError extends Error {
-  final String variableName;
+  final String? variableName;
   @pragma("vm:entry-point")
   CyclicInitializationError([this.variableName]);
-  String toString() => variableName == null
-      ? "Reading static variable during its initialization"
-      : "Reading static variable '$variableName' during its initialization";
+  String toString() {
+    var variableName = this.variableName;
+    return variableName == null
+        ? "Reading static variable during its initialization"
+        : "Reading static variable '$variableName' during its initialization";
+  }
 }
 
 /**
diff --git a/sdk/lib/core/exceptions.dart b/sdk/lib/core/exceptions.dart
index ef66d15..7d76a66 100644
--- a/sdk/lib/core/exceptions.dart
+++ b/sdk/lib/core/exceptions.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.6
-
 part of dart.core;
 
 // Exceptions are thrown either by the VM or from Dart code.
@@ -26,11 +24,12 @@
 
 /** Default implementation of [Exception] which carries a message. */
 class _Exception implements Exception {
-  final message;
+  final dynamic message;
 
   _Exception([this.message]);
 
   String toString() {
+    Object? message = this.message;
     if (message == null) return "Exception";
     return "Exception: $message";
   }
@@ -54,7 +53,7 @@
    *
    * The source is `null` if omitted or unknown.
    */
-  final source;
+  final dynamic source;
 
   /**
    * The offset in [source] where the error was detected.
@@ -69,7 +68,7 @@
    *
    * May be omitted. If present, [source] should also be present if possible.
    */
-  final int offset;
+  final int? offset;
 
   /**
    * Creates a new FormatException with an optional error [message].
@@ -97,13 +96,13 @@
    */
   String toString() {
     String report = "FormatException";
+    Object? message = this.message;
     if (message != null && "" != message) {
       report = "$report: $message";
     }
-    int offset = this.offset;
-    Object objectSource = this.source;
-    if (objectSource is String) {
-      String source = objectSource;
+    int? offset = this.offset;
+    Object? source = this.source;
+    if (source is String) {
       if (offset != null && (offset < 0 || offset > source.length)) {
         offset = null;
       }
diff --git a/sdk/lib/core/expando.dart b/sdk/lib/core/expando.dart
index 2ccb07d..ac36b9b 100644
--- a/sdk/lib/core/expando.dart
+++ b/sdk/lib/core/expando.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 part of dart.core;
 
 /**
  * An [Expando] allows adding new properties to objects.
  *
- * Does not work on numbers, strings, booleans or null.
+ * Does not work on numbers, strings, booleans or `null`.
  *
  * An `Expando` does not hold on to the added property value after an object
  * becomes inaccessible.
@@ -17,19 +15,19 @@
  * Since you can always create a new number that is identical to an existing
  * number, it means that an expando property on a number could never be
  * released. To avoid this, expando properties cannot be added to numbers.
- * The same argument applies to strings, booleans and null, which also have
+ * The same argument applies to strings, booleans and `null`, which also have
  * literals that evaluate to identical values when they occur more than once.
  *
  * There is no restriction on other classes, even for compile time constant
  * objects. Be careful if adding expando properties to compile time constants,
  * since they will stay alive forever.
  */
-class Expando<T> {
+class Expando<T extends Object> {
   /**
    * The name of the this [Expando] as passed to the constructor. If
-   * no name was passed to the constructor, the name is [:null:].
+   * no name was passed to the constructor, the name is `null`.
    */
-  final String name;
+  final String? name;
 
   /**
    * Creates a new [Expando]. The optional name is only used for
@@ -37,21 +35,21 @@
    * same name yields two [Expando]s that work on different properties
    * of the objects they are used on.
    */
-  external Expando([String name]);
+  external Expando([String? name]);
 
   /**
    * Expando toString method override.
    */
-  String toString() => "Expando:$name";
+  String toString() => "Expando:${name.toString()}";
 
   /**
    * Gets the value of this [Expando]'s property on the given
    * object. If the object hasn't been expanded, the method returns
-   * [:null:].
+   * `null`.
    *
    * The object must not be a number, a string, a boolean or null.
    */
-  external T operator [](Object object);
+  external T? operator [](Object object);
 
   /**
    * Sets the value of this [Expando]'s property on the given
@@ -60,5 +58,5 @@
    *
    * The object must not be a number, a string, a boolean or null.
    */
-  external void operator []=(Object object, T value);
+  external void operator []=(Object object, T? value);
 }
diff --git a/sdk/lib/core/function.dart b/sdk/lib/core/function.dart
index 4e026f8..b21f6759 100644
--- a/sdk/lib/core/function.dart
+++ b/sdk/lib/core/function.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.6
-
 part of dart.core;
 
 /**
@@ -36,8 +34,8 @@
    * If [positionalArguments] is null, it's considered an empty list.
    * If [namedArguments] is omitted or null, it is considered an empty map.
    */
-  external static apply(Function function, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]);
+  external static apply(Function function, List<dynamic>? positionalArguments,
+      [Map<Symbol, dynamic>? namedArguments]);
 
   /**
    * Returns a hash code value that is compatible with `operator==`.
@@ -47,23 +45,26 @@
   /**
    * Test whether another object is equal to this function.
    *
-   * System-created function objects are only equal to other functions.
+   * Function objects are only equal to other function objects
+   * (an object satisfying `object is Function`),
+   * and never to non-function objects.
    *
-   * Two function objects are known to represent the same function if
+   * Some function objects are considered equal by `==`
+   * because they are recognized as representing the "same function":
    *
    * - It is the same object. Static and top-level functions are compile time
    *   constants when used as values, so referring to the same function twice
-   *   always give the same object,
-   * - or if they refer to the same member method extracted from the same object.
-   *   Extracting a member method as a function value twice gives equal, but
-   *   not necessarily identical, function values.
+   *   always give the same object, as does referring to a local function
+   *   declaration twice in the same scope where it was declared.
+   * - if they refer to the same member method extracted from the same object.
+   *   Repeatedly extracting an instance method of an object as a function value
+   *   gives equal, but not necessarily identical, function values.
    *
-   * Function expressions never give rise to equal function objects. Each time
-   * a function expression is evaluated, it creates a new closure value that
-   * is not known to be equal to other closures created by the same expression.
-   *
-   * Classes implementing `Function` by having a `call` method should have their
-   * own `operator==` and `hashCode` depending on the object.
+   * Different evaluations of function literals
+   * never give rise to equal function objects.
+   * Each time a function literal is evaluated,
+   * it creates a new function value that is not equal to any other function
+   * value, not even ones created by the same expression.
    */
   bool operator ==(Object other);
 }
diff --git a/sdk/lib/core/identical.dart b/sdk/lib/core/identical.dart
index ec24609..20d331e 100644
--- a/sdk/lib/core/identical.dart
+++ b/sdk/lib/core/identical.dart
@@ -2,14 +2,12 @@
 // 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.6
-
 part of dart.core;
 
 /**
  * Check whether two references are to the same object.
  */
-external bool identical(Object a, Object b);
+external bool identical(Object? a, Object? b);
 
 /**
  * Returns the identity hash code of `object`.
@@ -21,4 +19,4 @@
  * This hash code is compatible with [identical].
  */
 @pragma("vm:entry-point")
-external int identityHashCode(Object object);
+external int identityHashCode(Object? object);
diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart
index 5416d03..b1203ed 100644
--- a/sdk/lib/core/int.dart
+++ b/sdk/lib/core/int.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.6
-
 part of dart.core;
 
 /**
@@ -345,7 +343,7 @@
    * and the result of that call is returned by [parse].
    */
   external static int parse(String source,
-      {int radix, @deprecated int onError(String source)});
+      {int? radix, @deprecated int onError(String source)?});
 
   /**
    * Parse [source] as a, possibly signed, integer literal and return its value.
@@ -354,5 +352,5 @@
    * similar call to [parse] would throw a [FormatException],
    * and the [source] must still not be `null`.
    */
-  external static int tryParse(String source, {int radix});
+  external static int? tryParse(String source, {int? radix});
 }
diff --git a/sdk/lib/core/invocation.dart b/sdk/lib/core/invocation.dart
index 8b7df36..7d28cea 100644
--- a/sdk/lib/core/invocation.dart
+++ b/sdk/lib/core/invocation.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.6
-
 part of dart.core;
 
 /**
@@ -23,8 +21,8 @@
    * If the named arguments are omitted, they default to no named arguments.
    */
   factory Invocation.method(
-          Symbol memberName, Iterable<Object> positionalArguments,
-          [Map<Symbol, Object> namedArguments]) =>
+          Symbol memberName, Iterable<Object?>? positionalArguments,
+          [Map<Symbol, Object?>? namedArguments]) =>
       _Invocation.method(memberName, null, positionalArguments, namedArguments);
 
   /**
@@ -37,8 +35,8 @@
    * If the named arguments are omitted, they default to no named arguments.
    */
   factory Invocation.genericMethod(Symbol memberName,
-          Iterable<Type> typeArguments, Iterable<Object> positionalArguments,
-          [Map<Symbol, Object> namedArguments]) =>
+          Iterable<Type>? typeArguments, Iterable<Object?>? positionalArguments,
+          [Map<Symbol, Object?>? namedArguments]) =>
       _Invocation.method(
           memberName, typeArguments, positionalArguments, namedArguments);
 
@@ -57,7 +55,7 @@
    * Invocation.setter(const Symbol("member="), value)
    * ```
    */
-  factory Invocation.setter(Symbol memberName, Object argument) =
+  factory Invocation.setter(Symbol memberName, Object? argument) =
       _Invocation.setter;
 
   /** The name of the invoked member. */
@@ -114,26 +112,28 @@
   final Symbol memberName;
   final List<Type> typeArguments;
   // Positional arguments is `null` for getters only.
-  final List<Object> _positional;
+  final List<Object?>? _positional;
   // Named arguments is `null` for accessors only.
-  final Map<Symbol, Object> _named;
+  final Map<Symbol, Object?>? _named;
 
-  _Invocation.method(this.memberName, Iterable<Type> types,
-      Iterable<Object> positional, Map<Symbol, Object> named)
-      : typeArguments = _ensureNonNullTypes(_makeUnmodifiable<Type>(types)),
-        _positional = _makeUnmodifiable<Object>(positional) ?? const <Object>[],
+  _Invocation.method(this.memberName, Iterable<Type>? types,
+      Iterable<Object?>? positional, Map<Symbol, Object?>? named)
+      : typeArguments = _ensureNonNullTypes(types),
+        _positional = positional == null
+            ? const <Object?>[]
+            : List<Object?>.unmodifiable(positional),
         _named = (named == null || named.isEmpty)
-            ? const <Symbol, Object>{}
-            : Map<Symbol, Object>.unmodifiable(named);
+            ? const <Symbol, Object?>{}
+            : Map<Symbol, Object?>.unmodifiable(named);
 
   _Invocation.getter(this.memberName)
       : typeArguments = const <Type>[],
         _positional = null,
         _named = null;
 
-  _Invocation.setter(this.memberName, Object argument)
+  _Invocation.setter(this.memberName, Object? argument)
       : typeArguments = const <Type>[],
-        _positional = List<Object>.unmodifiable([argument]),
+        _positional = List<Object?>.unmodifiable([argument]),
         _named = null;
 
   List<dynamic> get positionalArguments => _positional ?? const <Object>[];
@@ -146,19 +146,15 @@
   bool get isAccessor => _named == null;
 
   /// Checks that the elements of [types] are not null.
-  static List<Type> _ensureNonNullTypes(List<Type> types) {
+  static List<Type> _ensureNonNullTypes(Iterable<Type>? types) {
     if (types == null) return const <Type>[];
-    for (int i = 0; i < types.length; i++) {
-      if (types[i] == null) {
-        throw ArgumentError(
+    List<Type> typeArguments = List<Type>.unmodifiable(types);
+    for (int i = 0; i < typeArguments.length; i++) {
+      if (typeArguments[i] == null) {
+        throw ArgumentError.value(types, "types",
             "Type arguments must be non-null, was null at index $i.");
       }
     }
-    return types;
-  }
-
-  static List<T> _makeUnmodifiable<T>(Iterable<T> elements) {
-    if (elements == null) return null;
-    return List<T>.unmodifiable(elements);
+    return typeArguments;
   }
 }
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index 382b6d3..839792e 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.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.6
-
 part of dart.core;
 
 /**
@@ -15,8 +13,12 @@
  * and if the call returns `true`,
  * the iterator has now moved to the next element,
  * which is then available as [Iterator.current].
- * If the call returns `false`, there are no more elements,
- * and `iterator.current` returns `null`.
+ * If the call returns `false`, there are no more elements.
+ * The [Iterator.current] value must only be used when the most
+ * recent call to [Iterator.moveNext] has returned `true`.
+ * If it is used before calling [Iterator.moveNext] the first time
+ * on an iterator, or after a call has returned false or has thrown an error,
+ * reading [Iterator.current] may throw or may return an arbitrary value.
  *
  * You can create more than one iterator from the same `Iterable`.
  * Each time `iterator` is read, it returns a new iterator,
@@ -101,7 +103,7 @@
    * As an `Iterable`, `new Iterable.generate(n, generator))` is equivalent to
    * `const [0, ..., n - 1].map(generator)`.
    */
-  factory Iterable.generate(int count, [E generator(int index)]) {
+  factory Iterable.generate(int count, [E generator(int index)?]) {
     if (count <= 0) return EmptyIterable<E>();
     return _GeneratorIterable<E>(count, generator);
   }
@@ -166,6 +168,7 @@
    * the type [R], e.g., from [toList], it will have exactly the type [R].
    */
   Iterable<R> cast<R>() => Iterable.castFrom<E, R>(this);
+
   /**
    * Returns the lazy concatentation of this iterable and [other].
    *
@@ -174,8 +177,9 @@
    * original iterables.
    */
   Iterable<E> followedBy(Iterable<E> other) {
-    if (this is EfficientLengthIterable<E>) {
-      return FollowedByIterable<E>.firstEfficient(this, other);
+    var self = this; // TODO(lrn): Remove when we can promote `this`.
+    if (self is EfficientLengthIterable<E>) {
+      return FollowedByIterable<E>.firstEfficient(self, other);
     }
     return FollowedByIterable<E>(this, other);
   }
@@ -264,7 +268,7 @@
    * Likewise the `Iterable` returned by a [Map.keys] call
    * should use the same equality that the `Map` uses for keys.
    */
-  bool contains(Object element) {
+  bool contains(Object? element) {
     for (E e in this) {
       if (e == element) return true;
     }
@@ -365,13 +369,13 @@
     StringBuffer buffer = StringBuffer();
     if (separator == null || separator == "") {
       do {
-        buffer.write("${iterator.current}");
+        buffer.write(iterator.current.toString());
       } while (iterator.moveNext());
     } else {
-      buffer.write("${iterator.current}");
+      buffer.write(iterator.current.toString());
       while (iterator.moveNext()) {
         buffer.write(separator);
-        buffer.write("${iterator.current}");
+        buffer.write(iterator.current.toString());
       }
     }
     return buffer.toString();
@@ -397,7 +401,7 @@
    * The list is fixed-length if [growable] is false.
    */
   List<E> toList({bool growable = true}) {
-    return List<E>.from(this, growable: growable);
+    return List<E>.of(this, growable: growable);
   }
 
   /**
@@ -409,7 +413,7 @@
    * The order of the elements in the set is not guaranteed to be the same
    * as for the iterable.
    */
-  Set<E> toSet() => Set<E>.from(this);
+  Set<E> toSet() => Set<E>.of(this);
 
   /**
    * Returns the number of elements in [this].
@@ -566,7 +570,7 @@
    * function is returned.
    * If [orElse] is omitted, it defaults to throwing a [StateError].
    */
-  E firstWhere(bool test(E element), {E orElse()}) {
+  E firstWhere(bool test(E element), {E orElse()?}) {
     for (E element in this) {
       if (test(element)) return element;
     }
@@ -588,8 +592,8 @@
    * function is returned.
    * If [orElse] is omitted, it defaults to throwing a [StateError].
    */
-  E lastWhere(bool test(E element), {E orElse()}) {
-    E result;
+  E lastWhere(bool test(E element), {E orElse()?}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -611,8 +615,8 @@
    * If no matching element is found, returns the result of [orElse].
    * If [orElse] is omitted, it defaults to throwing a [StateError].
    */
-  E singleWhere(bool test(E element), {E orElse()}) {
-    E result;
+  E singleWhere(bool test(E element), {E orElse()?}) {
+    late E result;
     bool foundMatching = false;
     for (E element in this) {
       if (test(element)) {
@@ -640,7 +644,6 @@
    * Some iterables may have a more efficient way to find the element.
    */
   E elementAt(int index) {
-    ArgumentError.checkNotNull(index, "index");
     RangeError.checkNotNegative(index, "index");
     int elementIndex = 0;
     for (E element in this) {
@@ -669,22 +672,20 @@
   String toString() => IterableBase.iterableToShortString(this, '(', ')');
 }
 
-typedef _Generator<E> = E Function(int index);
-
 class _GeneratorIterable<E> extends ListIterable<E> {
   /// The length of the generated iterable.
   final int length;
 
   /// The function mapping indices to values.
-  final _Generator<E> _generator;
+  final E Function(int) _generator;
 
   /// Creates the generated iterable.
   ///
   /// If [generator] is `null`, it is checked that `int` is assignable to [E].
-  _GeneratorIterable(this.length, E generator(int index))
+  _GeneratorIterable(this.length, E generator(int index)?)
       : // The `as` below is used as check to make sure that `int` is assignable
         // to [E].
-        _generator = (generator != null) ? generator : _id as _Generator<E>;
+        _generator = generator ?? (_id as E Function(int));
 
   E elementAt(int index) {
     RangeError.checkValidIndex(index, this);
@@ -696,14 +697,15 @@
 }
 
 /**
- * An Iterator that allows moving backwards as well as forwards.
+ * An [Iterator] that allows moving backwards as well as forwards.
  */
 abstract class BidirectionalIterator<E> implements Iterator<E> {
   /**
    * Move back to the previous element.
    *
    * Returns true and updates [current] if successful. Returns false
-   * and sets [current] to null if there is no previous element.
+   * and updates [current] to an implementation defined state if there is no
+   * previous element
    */
   bool movePrevious();
 }
diff --git a/sdk/lib/core/iterator.dart b/sdk/lib/core/iterator.dart
index 1860497..f116c1b 100644
--- a/sdk/lib/core/iterator.dart
+++ b/sdk/lib/core/iterator.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.6
-
 part of dart.core;
 
 /**
@@ -18,8 +16,11 @@
  * The `Iterator` is initially positioned before the first element.
  * Before accessing the first element the iterator must thus be advanced using
  * [moveNext] to point to the first element.
- * If no element is left, then [moveNext] returns false, [current]
- * returns `null`, and all further calls to [moveNext] will also return false.
+ * If no element is left, then [moveNext] returns false,
+ * and all further calls to [moveNext] will also return false.
+ *
+ * The [current] value must not be accessed before calling [moveNext]
+ * or after a call to [moveNext] has returned false.
  *
  * A typical usage of an Iterator looks as follows:
  *
@@ -57,9 +58,13 @@
   /**
    * Returns the current element.
    *
-   * Returns `null` if the iterator has not yet been moved to the first
-   * element, or if the iterator has been moved past the last element of the
-   * [Iterable].
+   * If the iterator has not yet been moved to the first element
+   * ([moveNext] has not been called yet),
+   * or if the iterator has been moved past the last element of the [Iterable]
+   * ([moveNext] has returned false),
+   * then [current] is unspecified.
+   * An [Iterator] may either throw or return an iterator specific default value
+   * in that case.
    *
    * The `current` getter should keep its value until the next call to
    * [moveNext], even if an underlying collection changes.
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 647f277..afd7f11 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.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.6
-
 part of dart.core;
 
 /**
@@ -18,7 +16,7 @@
  *
  * * Growable list. Full implementation of the API defined in this class.
  *
- * The default growable list, as returned by `new List()` or `[]`, keeps
+ * The default growable list, as created by `[]`, keeps
  * an internal buffer, and grows that buffer when necessary. This guarantees
  * that a sequence of [add] operations will each execute in amortized constant
  * time. Setting the length directly may take time proportional to the new
@@ -57,6 +55,10 @@
   /**
    * Creates a list of the given length.
    *
+   * This constructor will throw an exception if [E] is not a nullable type.
+   * In this case, another constructor such as [List.filled] must be used
+   * instead.
+   *
    * The created list is fixed-length if [length] is provided.
    *
    *     List fixedLengthList = new List(3);
@@ -65,18 +67,32 @@
    *
    * The list has length 0 and is growable if [length] is omitted.
    *
-   *     List growableList = new List();
+   *     List growableList = [];
    *     growableList.length; // 0;
    *     growableList.length = 3;
    *
-   * To create a growable list with a given length, just assign the length
-   * right after creation:
+   * To create a growable list with a given length, for a nullable element type,
+   * just assign the length right after creation:
    *
-   *     List growableList = new List()..length = 500;
+   *     List growableList = []..length = 500;
+   *
+   * For a non-nullable element type, an alternative is the following:
+   *
+   *     List<int> growableList = List<int>.filled(500, 0, growable: true);
    *
    * The [length] must not be negative or null, if it is provided.
+   *
+   * If the element type is not nullable, [length] must not be greater than
+   * zero.
+   *
+   * This constructor cannot be used in null-safe code.
+   * Use [List.filled] to create a non-empty list.
+   * This requires a fill value to initialize the list elements with.
+   * To create an empty list, use `[]` for a growable list or
+   * `List.empty` for a fixed length list (or where growability is determined
+   * at run-time).
    */
-  external factory List([int length]);
+  external factory List([int? length]);
 
   /**
    * Creates a list of the given length with [fill] at each position.
@@ -113,6 +129,16 @@
   external factory List.filled(int length, E fill, {bool growable = false});
 
   /**
+   * Creates a new empty list.
+   *
+   * If [growable] is `false`, which is the default,
+   * the list is a fixed-length list of length zero.
+   * If [growable] is `true`, the list is growable and equivalent to `<E>[]`.
+   */
+  @Since("2.8")
+  external factory List.empty({bool growable = false});
+
+  /**
    * Creates a list containing all [elements].
    *
    * The [Iterator] of [elements] provides the order of the elements.
@@ -147,24 +173,15 @@
    * Creates a list with [length] positions and fills it with values created by
    * calling [generator] for each index in the range `0` .. `length - 1`
    * in increasing order.
+   * ```dart
+   * List<int>.generate(3, (int index) => index * index); // [0, 1, 4]
+   * ```
+   * The created list is fixed-length if [growable] is set to false.
    *
-   *     new List<int>.generate(3, (int index) => index * index); // [0, 1, 4]
-   *
-   * The created list is fixed-length unless [growable] is true.
+   * The [length] must be non-negative.
    */
-  factory List.generate(int length, E generator(int index),
-      {bool growable = true}) {
-    List<E> result;
-    if (growable) {
-      result = <E>[]..length = length;
-    } else {
-      result = List<E>(length);
-    }
-    for (int i = 0; i < length; i++) {
-      result[i] = generator(i);
-    }
-    return result;
-  }
+  external factory List.generate(int length, E generator(int index),
+      {bool growable = true});
 
   /**
    * Creates an unmodifiable list containing all [elements].
@@ -210,9 +227,13 @@
    * Otherwise the order of element copying is not guaranteed.
    */
   static void copyRange<T>(List<T> target, int at, List<T> source,
-      [int start, int end]) {
+      [int? start, int? end]) {
     start ??= 0;
     end = RangeError.checkValidRange(start, end, source.length);
+    if (end == null) {
+      // TODO(dart-lang/language#440): Remove when promotion works.
+      throw "unreachable";
+    }
     int length = end - start;
     if (target.length < at + length) {
       throw ArgumentError.value(target, "target",
@@ -270,6 +291,7 @@
    * Typically implemented as `List.castFrom<E, R>(this)`.
    */
   List<R> cast<R>();
+
   /**
    * Returns the object at the given [index] in the list
    * or throws a [RangeError] if [index] is out of bounds.
@@ -301,7 +323,7 @@
   void set last(E value);
 
   /**
-   * Returns the number of objects in this list.
+   * The number of objects in this list.
    *
    * The valid indices for a list are `0` through `length - 1`.
    */
@@ -311,9 +333,11 @@
    * Changes the length of this list.
    *
    * If [newLength] is greater than
-   * the current length, entries are initialized to [:null:].
+   * the current length, entries are initialized to `null`.
+   * Increasing the length fails if the element type does not allow `null`.
    *
-   * Throws an [UnsupportedError] if the list is fixed-length.
+   * Throws an [UnsupportedError] if the list is fixed-length or
+   * if attempting tp enlarge the list when `null` is not a valid element.
    */
   set length(int newLength);
 
@@ -364,12 +388,12 @@
    *     numbers.sort((a, b) => a.length.compareTo(b.length));
    *     print(numbers);  // [one, two, four, three] OR [two, one, four, three]
    */
-  void sort([int compare(E a, E b)]);
+  void sort([int compare(E a, E b)?]);
 
   /**
    * Shuffles the elements of this list randomly.
    */
-  void shuffle([Random random]);
+  void shuffle([Random? random]);
 
   /**
    * Returns the first index of [element] in this list.
@@ -414,6 +438,7 @@
    * Searches the list from index [start] to 0.
    * The first time an object `o` is encountered so that `test(o)` is true,
    * the index of `o` is returned.
+   * If [start] is omitted, it defaults to the [length] of the list.
    *
    * ```
    * List<String> notes = ['do', 're', 'mi', 're'];
@@ -426,7 +451,7 @@
    * notes.lastIndexWhere((note) => note.startsWith('k'));    // -1
    * ```
    */
-  int lastIndexWhere(bool test(E element), [int start]);
+  int lastIndexWhere(bool test(E element), [int? start]);
 
   /**
    * Returns the last index of [element] in this list.
@@ -440,7 +465,7 @@
    *     notes.lastIndexOf('re', 2); // 1
    *
    * If [start] is not provided, this method searches from the end of the
-   * list./Returns
+   * list.
    *
    *     notes.lastIndexOf('re');  // 3
    *
@@ -448,7 +473,7 @@
    *
    *     notes.lastIndexOf('fa');  // -1
    */
-  int lastIndexOf(E element, [int start]);
+  int lastIndexOf(E element, [int? start]);
 
   /**
    * Removes all objects from this list;
@@ -518,7 +543,7 @@
    *
    * An [UnsupportedError] occurs if the list is fixed-length.
    */
-  bool remove(Object value);
+  bool remove(Object? value);
 
   /**
    * Removes the object at position [index] from this list.
@@ -604,7 +629,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  List<E> sublist(int start, [int end]);
+  List<E> sublist(int start, [int? end]);
 
   /**
    * Returns an [Iterable] that iterates over the objects in the range
@@ -685,8 +710,10 @@
    *     print(list); //  [1, 1, null]
    * ```
    *
+   * If the element type is not nullable, omitting [fillValue] or passing `null`
+   * as [fillValue] will make the `fillRange` fail.
    */
-  void fillRange(int start, int end, [E fillValue]);
+  void fillRange(int start, int end, [E? fillValue]);
 
   /**
    * Removes the objects in the range [start] inclusive to [end] exclusive
diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart
index 8f76dfd..a92d08d 100644
--- a/sdk/lib/core/map.dart
+++ b/sdk/lib/core/map.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.6
-
 part of dart.core;
 
 /**
@@ -79,13 +77,13 @@
    * The resulting map behaves like the result of [Map.from],
    * except that the map returned by this constructor is not modifiable.
    */
-  external factory Map.unmodifiable(Map other);
+  external factory Map.unmodifiable(Map<dynamic, dynamic> other);
 
   /**
    * Creates an identity map with the default implementation, [LinkedHashMap].
    *
    * An identity map uses [identical] for equality and [identityHashCode]
-   * for hash codes of keys instead of the intrinsic [Object.==] and
+   * for hash codes of keys instead of the intrinsic [Object.operator==] and
    * [Object.hashCode] of the keys.
    *
    * The returned map allows `null` as a key.
@@ -131,7 +129,7 @@
    * last occurrence of a key will simply overwrite any previous value.
    */
   factory Map.fromIterable(Iterable iterable,
-      {K key(element), V value(element)}) = LinkedHashMap<K, V>.fromIterable;
+      {K key(element)?, V value(element)?}) = LinkedHashMap<K, V>.fromIterable;
 
   /**
    * Creates a Map instance associating the given [keys] to [values].
@@ -201,13 +199,14 @@
    * `Map<RK, RV>`.
    */
   Map<RK, RV> cast<RK, RV>();
+
   /**
    * Returns true if this map contains the given [value].
    *
    * Returns true if any of the values in the map are equal to `value`
    * according to the `==` operator.
    */
-  bool containsValue(Object value);
+  bool containsValue(Object? value);
 
   /**
    * Returns true if this map contains the given [key].
@@ -215,7 +214,7 @@
    * Returns true if any of the keys in the map are equal to `key`
    * according to the equality used by the map.
    */
-  bool containsKey(Object key);
+  bool containsKey(Object? key);
 
   /**
    * Returns the value for the given [key] or null if [key] is not in the map.
@@ -226,7 +225,7 @@
    * Methods like [containsKey] or [putIfAbsent] can be used if the distinction
    * is important.
    */
-  V operator [](Object key);
+  V? operator [](Object? key);
 
   /**
    * Associates the [key] with the given [value].
@@ -271,7 +270,7 @@
    *
    * It's an error if the key is not present and [ifAbsent] is not provided.
    */
-  V update(K key, V update(V value), {V ifAbsent()});
+  V update(K key, V update(V value), {V ifAbsent()?});
 
   /**
    * Updates all values.
@@ -325,7 +324,7 @@
    * Note that values can be `null` and a returned `null` value doesn't
    * always mean that the key was absent.
    */
-  V remove(Object key);
+  V? remove(Object? key);
 
   /**
    * Removes all pairs from the map.
@@ -402,5 +401,5 @@
 
   const MapEntry._(this.key, this.value);
 
-  String toString() => "MapEntry($key: $value)";
+  String toString() => "MapEntry(${key.toString()}: ${value.toString()})";
 }
diff --git a/sdk/lib/core/null.dart b/sdk/lib/core/null.dart
index 40140e8..f8588a1 100644
--- a/sdk/lib/core/null.dart
+++ b/sdk/lib/core/null.dart
@@ -2,16 +2,14 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.6
-
 part of dart.core;
 
 /**
- * The reserved word [:null:] denotes an object that is the sole instance of 
+ * The reserved word `null` denotes an object that is the sole instance of
  * this class.
- * 
+ *
  * It is a compile-time error for a class to attempt to extend or implement
- * Null.
+ * [Null].
  */
 @pragma("vm:entry-point")
 class Null {
diff --git a/sdk/lib/core/num.dart b/sdk/lib/core/num.dart
index 89f5fb5..55bb910 100644
--- a/sdk/lib/core/num.dart
+++ b/sdk/lib/core/num.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.6
-
 part of dart.core;
 
 /**
@@ -387,7 +385,7 @@
    *     123456.toStringAsExponential(3); // 1.235e+5
    *     123.toStringAsExponential(0);    // 1e+2
    */
-  String toStringAsExponential([int fractionDigits]);
+  String toStringAsExponential([int? fractionDigits]);
 
   /**
    * Converts `this` to a double and returns a string representation with
@@ -470,8 +468,8 @@
    * Instead of `num.parse(string, (string) { ... })`,
    * you should use `num.tryParse(string) ?? (...)`.
    */
-  static num parse(String input, [@deprecated num onError(String input)]) {
-    num result = tryParse(input);
+  static num parse(String input, [@deprecated num onError(String input)?]) {
+    num? result = tryParse(input);
     if (result != null) return result;
     if (onError == null) throw FormatException(input);
     return onError(input);
@@ -483,13 +481,9 @@
    * Like [parse] except that this function returns `null` for invalid inputs
    * instead of throwing.
    */
-  static num tryParse(String input) {
+  static num? tryParse(String input) {
     String source = input.trim();
     // TODO(lrn): Optimize to detect format and result type in one check.
     return int.tryParse(source) ?? double.tryParse(source);
   }
-
-  /** Helper functions for [parse]. */
-  static int _returnIntNull(String _) => null;
-  static double _returnDoubleNull(String _) => null;
 }
diff --git a/sdk/lib/core/object.dart b/sdk/lib/core/object.dart
index 08bf687..31602df 100644
--- a/sdk/lib/core/object.dart
+++ b/sdk/lib/core/object.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.6
-
 part of dart.core;
 
 /**
@@ -59,7 +57,7 @@
    * If a subclass overrides the equality operator it should override
    * the [hashCode] method as well to maintain consistency.
    */
-  external bool operator ==(other);
+  external bool operator ==(Object other);
 
   /**
    * The hash code for this object.
diff --git a/sdk/lib/core/pattern.dart b/sdk/lib/core/pattern.dart
index 8eb0371..7a3d933 100644
--- a/sdk/lib/core/pattern.dart
+++ b/sdk/lib/core/pattern.dart
@@ -2,18 +2,12 @@
 // 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.6
-
 part of dart.core;
 
 /**
  * An interface for basic searches within strings.
  */
 abstract class Pattern {
-  // NOTE: When using "start" index from the language library, call
-  // without an argument if start is zero. This allows backwards compatibility
-  // with implementations of the older interface that didn't have the start
-  // index argument.
   /**
    * Match this pattern against the string repeatedly.
    *
@@ -42,7 +36,7 @@
    * pattern can match a part of the string starting from position [start].
    * Returns `null` if the pattern doesn't match.
    */
-  Match matchAsPrefix(String string, [int start = 0]);
+  Match? matchAsPrefix(String string, [int start = 0]);
 }
 
 /**
@@ -93,7 +87,7 @@
    * The result may be `null` if the pattern didn't assign a value to it
    * as part of this match.
    */
-  String group(int group);
+  String? group(int group);
 
   /**
    * Returns the string matched by the given [group].
@@ -102,7 +96,7 @@
    *
    * Short alias for [Match.group].
    */
-  String operator [](int group);
+  String? operator [](int group);
 
   /**
    * Returns a list of the groups with the given indices.
@@ -110,7 +104,7 @@
    * The list contains the strings returned by [group] for each index in
    * [groupIndices].
    */
-  List<String> groups(List<int> groupIndices);
+  List<String?> groups(List<int> groupIndices);
 
   /**
    * Returns the number of captured groups in the match.
diff --git a/sdk/lib/core/print.dart b/sdk/lib/core/print.dart
index cc2f0ac..d88ea7f 100644
--- a/sdk/lib/core/print.dart
+++ b/sdk/lib/core/print.dart
@@ -2,16 +2,15 @@
 // 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.6
-
 part of dart.core;
 
 /// Prints a string representation of the object to the console.
-void print(Object object) {
-  String line = "$object";
-  if (printToZone == null) {
+void print(Object? object) {
+  String line = object.toString();
+  var toZone = printToZone;
+  if (toZone == null) {
     printToConsole(line);
   } else {
-    printToZone(line);
+    toZone(line);
   }
 }
diff --git a/sdk/lib/core/regexp.dart b/sdk/lib/core/regexp.dart
index 095e733..b75882d 100644
--- a/sdk/lib/core/regexp.dart
+++ b/sdk/lib/core/regexp.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.6
-
 part of dart.core;
 
 /**
@@ -90,7 +88,7 @@
    * Searches for the first match of the regular expression
    * in the string [input]. Returns `null` if there is no match.
    */
-  RegExpMatch firstMatch(String input);
+  RegExpMatch? firstMatch(String input);
 
   /**
    * Returns an iterable of the matches of the regular expression on [input].
@@ -107,7 +105,7 @@
   /**
    * Returns the first substring match of this regular expression in [input].
    */
-  String stringMatch(String input);
+  String? stringMatch(String input);
 
   /**
    * The source regular expression string used to create this `RegExp`.
@@ -154,7 +152,7 @@
    * character is a line terminator. When true, then the "." character will
    * match any single character including line terminators.
    *
-   * This feature is distinct from [isMultiLine], as they affect the behavior
+   * This feature is distinct from [isMultiline], as they affect the behavior
    * of different pattern characters, and so they can be used together or
    * separately.
    */
@@ -182,7 +180,7 @@
    * expression creating this match (that is, the name must be in
    * [groupNames]).
    */
-  String namedGroup(String name);
+  String? namedGroup(String name);
 
   /**
    * The names of the captured groups in the match.
diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart
index 9e1a6de..ae1e381 100644
--- a/sdk/lib/core/set.dart
+++ b/sdk/lib/core/set.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.6
-
 part of dart.core;
 
 /**
@@ -112,7 +110,7 @@
    * of [S],
    * then the returned set can be used as a `Set<T>`.
    */
-  static Set<T> castFrom<S, T>(Set<S> source, {Set<R> Function<R>() newSet}) =>
+  static Set<T> castFrom<S, T>(Set<S> source, {Set<R> Function<R>()? newSet}) =>
       CastSet<S, T>(source, newSet);
 
   /**
@@ -128,6 +126,7 @@
    * this set as well.
    */
   Set<R> cast<R>();
+
   /**
    * Provides an iterator that iterates over the elements of this set.
    *
@@ -139,7 +138,7 @@
   /**
    * Returns true if [value] is in the set.
    */
-  bool contains(Object value);
+  bool contains(Object? value);
 
   /**
    * Adds [value] to the set.
@@ -177,7 +176,7 @@
    * in the set. Returns false otherwise. The method has no effect
    * if [value] value was not in the set.
    */
-  bool remove(Object value);
+  bool remove(Object? value);
 
   /**
    * If an object equal to [object] is in the set, return it.
@@ -193,12 +192,12 @@
    * then there may not be a specific object instance representing the
    * set element.
    */
-  E lookup(Object object);
+  E? lookup(Object? object);
 
   /**
    * Removes each element of [elements] from this set.
    */
-  void removeAll(Iterable<Object> elements);
+  void removeAll(Iterable<Object?> elements);
 
   /**
    * Removes all elements of this set that are not elements in [elements].
@@ -208,7 +207,7 @@
    * equal element in this set is retained, and elements that are not equal
    * to any element in `elements` are removed.
    */
-  void retainAll(Iterable<Object> elements);
+  void retainAll(Iterable<Object?> elements);
 
   /**
    * Removes all elements of this set that satisfy [test].
@@ -223,7 +222,7 @@
   /**
    * Returns whether this Set contains all the elements of [other].
    */
-  bool containsAll(Iterable<Object> other);
+  bool containsAll(Iterable<Object?> other);
 
   /**
    * Returns a new set which is the intersection between this set and [other].
@@ -231,7 +230,7 @@
    * That is, the returned set contains all the elements of this [Set] that
    * are also elements of [other] according to `other.contains`.
    */
-  Set<E> intersection(Set<Object> other);
+  Set<E> intersection(Set<Object?> other);
 
   /**
    * Returns a new set which contains all the elements of this set and [other].
@@ -247,7 +246,7 @@
    * That is, the returned set contains all the elements of this [Set] that
    * are not elements of [other] according to `other.contains`.
    */
-  Set<E> difference(Set<Object> other);
+  Set<E> difference(Set<Object?> other);
 
   /**
    * Removes all elements in the set.
diff --git a/sdk/lib/core/sink.dart b/sdk/lib/core/sink.dart
index 80f9468d..c79214b 100644
--- a/sdk/lib/core/sink.dart
+++ b/sdk/lib/core/sink.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.6
-
 part of dart.core;
 
 /**
diff --git a/sdk/lib/core/stacktrace.dart b/sdk/lib/core/stacktrace.dart
index 3715730..ef08f71 100644
--- a/sdk/lib/core/stacktrace.dart
+++ b/sdk/lib/core/stacktrace.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.6
-
 part of dart.core;
 
 /**
diff --git a/sdk/lib/core/stopwatch.dart b/sdk/lib/core/stopwatch.dart
index 20316eb..311db3d 100644
--- a/sdk/lib/core/stopwatch.dart
+++ b/sdk/lib/core/stopwatch.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.6
-
 part of dart.core;
 
 /**
@@ -13,15 +11,15 @@
   /**
    * Cached frequency of the system in Hz (ticks per second).
    *
-   * Must be initialized in [_initTicker];
+   * Value must be returned by [_initTicker], which is called only once.
    */
-  static int _frequency;
+  static final int _frequency = _initTicker();
 
   // The _start and _stop fields capture the time when [start] and [stop]
   // are called respectively.
   // If _stop is null, the stopwatch is running.
   int _start = 0;
-  int _stop = 0;
+  int? _stop = 0;
 
   /**
    * Creates a [Stopwatch] in stopped state with a zero elapsed count.
@@ -33,7 +31,7 @@
    * ```
    */
   Stopwatch() {
-    if (_frequency == null) _initTicker();
+    _frequency; // Ensures initialization before using any method.
   }
 
   /**
@@ -51,10 +49,11 @@
    * If the [Stopwatch] is currently running, then calling start does nothing.
    */
   void start() {
-    if (_stop != null) {
+    int? stop = _stop;
+    if (stop != null) {
       // (Re)start this stopwatch.
       // Don't count the time while the stopwatch has been stopped.
-      _start += _now() - _stop;
+      _start += _now() - stop;
       _stop = null;
     }
   }
@@ -117,9 +116,9 @@
   bool get isRunning => _stop == null;
 
   /**
-   * Initializes the time-measuring system. *Must* initialize the [_frequency]
-   * variable.
+   * Initializes the time-measuring system. *Must* return the [_frequency]
+   * variable. May do other necessary initialization.
    */
-  external static void _initTicker();
+  external static int _initTicker();
   external static int _now();
 }
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index fbbd7d0..4a353b2 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.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.6
-
 part of dart.core;
 
 /**
@@ -122,7 +120,7 @@
    * `0 <= start <= end <= charCodes.length`.
    */
   external factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int end]);
+      [int start = 0, int? end]);
 
   /**
    * Allocates a new String for the specified [charCode].
@@ -132,7 +130,7 @@
    * the code units form a surrogate pair. See documentation for
    * [fromCharCodes].
    *
-   * Creating a String with half of a surrogate pair is allowed.
+   * Creating a [String] with one half of a surrogate pair is allowed.
    */
   external factory String.fromCharCode(int charCode);
 
@@ -292,7 +290,7 @@
    *
    * [start] must be non-negative and not greater than [length].
    */
-  int indexOf(Pattern pattern, [int start]);
+  int indexOf(Pattern pattern, [int start = 0]);
 
   /**
    * Returns the starting position of the last match [pattern] in this string,
@@ -306,9 +304,10 @@
    *
    *     string.lastIndexOf(RegExp(r'DART'));        // -1
    *
-   * The [start] must be non-negative and not greater than [length].
+   * If [start] is omitted, search starts from the end of the string.
+   * If supplied, [start] must be non-negative and not greater than [length].
    */
-  int lastIndexOf(Pattern pattern, [int start]);
+  int lastIndexOf(Pattern pattern, [int? start]);
 
   /**
    * Returns true if this string is empty.
@@ -335,7 +334,7 @@
    *     string.substring(1);    // 'artlang'
    *     string.substring(1, 4); // 'art'
    */
-  String substring(int startIndex, [int endIndex]);
+  String substring(int startIndex, [int? endIndex]);
 
   /**
    * Returns the string without any leading and trailing whitespace.
@@ -514,7 +513,7 @@
    *
    *     pigLatin('I have a secret now!'); // 'Iway avehay away ecretsay ownay!'
    */
-  String replaceAllMapped(Pattern from, String replace(Match match));
+  String replaceAllMapped(Pattern from, String Function(Match match) replace);
 
   /**
    * Replaces the substring from [start] to [end] with [replacement].
@@ -527,7 +526,7 @@
    * That is `0 <= start <= end <= this.length`.
    * If [end] is `null`, it defaults to [length].
    */
-  String replaceRange(int start, int end, String replacement);
+  String replaceRange(int start, int? end, String replacement);
 
   /**
    * Splits the string at matches of [pattern] and returns a list of substrings.
@@ -596,7 +595,7 @@
    *         onNonMatch: (n) => '*'); // *shoots*
    */
   String splitMapJoin(Pattern pattern,
-      {String onMatch(Match match), String onNonMatch(String nonMatch)});
+      {String Function(Match)? onMatch, String Function(String)? onNonMatch});
 
   /**
    * Returns an unmodifiable list of the UTF-16 code units of this string.
@@ -614,7 +613,7 @@
 
   /**
    * Converts all characters in this string to lower case.
-   * If the string is already in all lower case, this method returns [:this:].
+   * If the string is already in all lower case, this method returns `this`.
    *
    *     'ALPHABET'.toLowerCase(); // 'alphabet'
    *     'abc'.toLowerCase();      // 'abc'
@@ -627,7 +626,7 @@
 
   /**
    * Converts all characters in this string to upper case.
-   * If the string is already in all upper case, this method returns [:this:].
+   * If the string is already in all upper case, this method returns `this`.
    *
    *     'alphabet'.toUpperCase(); // 'ALPHABET'
    *     'ABC'.toUpperCase();      // 'ABC'
@@ -676,8 +675,7 @@
 }
 
 /**
- * [Iterator] for reading runes (integer Unicode code points) out of a Dart
- * string.
+ * [Iterator] for reading runes (integer Unicode code points) of a Dart string.
  */
 class RuneIterator implements BidirectionalIterator<int> {
   /** String being iterated. */
@@ -690,7 +688,7 @@
    * Current code point.
    *
    * If the iterator has hit either end, the [_currentCodePoint] is -1
-   * and [: _position == _nextPosition :].
+   * and `_position == _nextPosition`.
    */
   int _currentCodePoint = -1;
 
@@ -729,7 +727,7 @@
   }
 
   /**
-   * Returns the starting position of the current rune in the string.
+   * The starting position of the current rune in the string.
    *
    * Returns -1 if there is no current rune ([current] is -1).
    */
@@ -739,10 +737,11 @@
    * Resets the iterator to the rune at the specified index of the string.
    *
    * Setting a negative [rawIndex], or one greater than or equal to
-   * [:string.length:],
-   * is an error. So is setting it in the middle of a surrogate pair.
+   * `string.length`, is an error. So is setting it in the middle of a surrogate
+   *  pair.
    *
-   * Setting the position to the end of then string will set [current] to null.
+   * Setting the position to the end of then string means that there is no
+   * current rune.
    */
   void set rawIndex(int rawIndex) {
     RangeError.checkValidIndex(rawIndex, string, "rawIndex");
@@ -757,8 +756,9 @@
    * You must call [moveNext] make the rune at the position current,
    * or [movePrevious] for the last rune before the position.
    *
-   * Setting a negative [rawIndex], or one greater than [:string.length:],
-   * is an error. So is setting it in the middle of a surrogate pair.
+   * The [rawIndex] must be non-negative and no greater than `string.length`.
+   * It must also not be the index of the trailing surrogate of a surrogate
+   * pair.
    */
   void reset([int rawIndex = 0]) {
     RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex");
@@ -771,7 +771,7 @@
    * The rune (integer Unicode code point) starting at the current position in
    * the string.
    *
-   * If there is no current rune, the value -1 is used instead.
+   * The value is -1 if there is no current code point.
    */
   int get current => _currentCodePoint;
 
@@ -786,9 +786,9 @@
    * A string containing the current rune.
    *
    * For runes outside the basic multilingual plane, this will be
-   * a [String] of length 2, containing two code units.
+   * a String of length 2, containing two code units.
    *
-   * Returns an empty string if there is no current rune ([current] is -1).
+   * Returns an empty string if there is no [current] value.
    */
   String get currentAsString {
     if (_position == _nextPosition) return "";
diff --git a/sdk/lib/core/string_buffer.dart b/sdk/lib/core/string_buffer.dart
index d2a25ab..d664101 100644
--- a/sdk/lib/core/string_buffer.dart
+++ b/sdk/lib/core/string_buffer.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.6
-
 part of dart.core;
 
 /**
@@ -33,14 +31,14 @@
   bool get isNotEmpty => !isEmpty;
 
   /// Adds the contents of [obj], converted to a string, to the buffer.
-  external void write(Object obj);
+  external void write(Object? obj);
 
   /// Adds the string representation of [charCode] to the buffer.
   external void writeCharCode(int charCode);
 
-  external void writeAll(Iterable objects, [String separator = ""]);
+  external void writeAll(Iterable<dynamic> objects, [String separator = ""]);
 
-  external void writeln([Object obj = ""]);
+  external void writeln([Object? obj = ""]);
 
   /**
    * Clears the string buffer.
diff --git a/sdk/lib/core/string_sink.dart b/sdk/lib/core/string_sink.dart
index b0511ad..c507424 100644
--- a/sdk/lib/core/string_sink.dart
+++ b/sdk/lib/core/string_sink.dart
@@ -2,27 +2,25 @@
 // 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.6
-
 part of dart.core;
 
 abstract class StringSink {
   /**
-   * Converts [obj] to a String by invoking [Object.toString] and 
+   * Converts [obj] to a String by invoking [Object.toString] and
    * adds the result to `this`.
    */
-  void write(Object obj);
+  void write(Object? obj);
 
   /**
    * Iterates over the given [objects] and [write]s them in sequence.
    */
-  void writeAll(Iterable objects, [String separator = ""]);
+  void writeAll(Iterable<dynamic> objects, [String separator = ""]);
 
   /**
-   * Converts [obj] to a String by invoking [Object.toString] and 
+   * Converts [obj] to a String by invoking [Object.toString] and
    * adds the result to `this`, followed by a newline.
    */
-  void writeln([Object obj = ""]);
+  void writeln([Object? obj = ""]);
 
   /**
    * Writes the [charCode] to `this`.
diff --git a/sdk/lib/core/symbol.dart b/sdk/lib/core/symbol.dart
index 748d465..65e83ff 100644
--- a/sdk/lib/core/symbol.dart
+++ b/sdk/lib/core/symbol.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.6
-
 part of dart.core;
 
 /// Opaque name used by mirrors, invocations and [Function.apply].
@@ -62,7 +60,7 @@
    * assert(new Symbol("[]=") == #[]=]);
    * assert(new Symbol("foo.bar") == #foo.bar);
    * assert(identical(const Symbol("foo"), #foo));
-   * assert(identical(const Symbol("[]="), #[]=));
+   * assert(identical(const Symbol("[]="), #[]=]));
    * assert(identical(const Symbol("foo.bar"), #foo.bar));
    * ```
    *
@@ -95,5 +93,5 @@
    * Qualified member names, like `#foo.bar` are equal only if they have the
    * same identifiers before the same final member name.
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 }
diff --git a/sdk/lib/core/type.dart b/sdk/lib/core/type.dart
index 48ac0e9..d2e107b 100644
--- a/sdk/lib/core/type.dart
+++ b/sdk/lib/core/type.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.6
-
 part of dart.core;
 
 /**
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index a85eb67..234241c 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.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.6
-
 part of dart.core;
 
 // Frequently used character codes.
@@ -121,15 +119,15 @@
    * If `fragment` is omitted or `null`, the URI has no fragment part.
    */
   factory Uri(
-      {String scheme,
-      String userInfo,
-      String host,
-      int port,
-      String path,
-      Iterable<String> pathSegments,
-      String query,
-      Map<String, dynamic /*String|Iterable<String>*/ > queryParameters,
-      String fragment}) = _Uri;
+      {String? scheme,
+      String? userInfo,
+      String? host,
+      int? port,
+      String? path,
+      Iterable<String>? pathSegments,
+      String? query,
+      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
+      String? fragment}) = _Uri;
 
   /**
    * Creates a new `http` URI from authority, path and query.
@@ -165,7 +163,7 @@
    * argument.
    */
   factory Uri.http(String authority, String unencodedPath,
-      [Map<String, String> queryParameters]) = _Uri.http;
+      [Map<String, String>? queryParameters]) = _Uri.http;
 
   /**
    * Creates a new `https` URI from authority, path and query.
@@ -174,7 +172,7 @@
    * which is set to `https`.
    */
   factory Uri.https(String authority, String unencodedPath,
-      [Map<String, String> queryParameters]) = _Uri.https;
+      [Map<String, String>? queryParameters]) = _Uri.https;
 
   /**
    * Creates a new file URI from an absolute or relative file path.
@@ -259,7 +257,7 @@
    *
    * If the path passed is not a valid file path, an error is thrown.
    */
-  factory Uri.file(String path, {bool windows}) = _Uri.file;
+  factory Uri.file(String path, {bool? windows}) = _Uri.file;
 
   /**
    * Like [Uri.file] except that a non-empty URI path ends in a slash.
@@ -268,7 +266,7 @@
    * then a slash is added to the returned URI's path.
    * In all other cases, the result is the same as returned by `Uri.file`.
    */
-  factory Uri.directory(String path, {bool windows}) = _Uri.directory;
+  factory Uri.directory(String path, {bool? windows}) = _Uri.directory;
 
   /**
    * Creates a `data:` URI containing the [content] string.
@@ -299,9 +297,9 @@
    * To read the content back, use [UriData.contentAsString].
    */
   factory Uri.dataFromString(String content,
-      {String mimeType,
-      Encoding encoding,
-      Map<String, String> parameters,
+      {String? mimeType,
+      Encoding? encoding,
+      Map<String, String>? parameters,
       bool base64 = false}) {
     UriData data = UriData.fromString(content,
         mimeType: mimeType,
@@ -328,9 +326,9 @@
    * encoded.
    */
   factory Uri.dataFromBytes(List<int> bytes,
-      {mimeType = "application/octet-stream",
-      Map<String, String> parameters,
-      percentEncoded = false}) {
+      {String mimeType = "application/octet-stream",
+      Map<String, String>? parameters,
+      bool percentEncoded = false}) {
     UriData data = UriData.fromBytes(bytes,
         mimeType: mimeType,
         parameters: parameters,
@@ -597,7 +595,7 @@
    */
   // TODO(lrn): Deprecate and move functionality to File class or similar.
   // The core libraries should not worry about the platform.
-  String toFilePath({bool windows});
+  String toFilePath({bool? windows});
 
   /**
    * Access the structure of a `data:` URI.
@@ -607,7 +605,7 @@
    * The [UriData] object can be used to access the media type and data
    * of a `data:` URI.
    */
-  UriData get data;
+  UriData? get data;
 
   /// Returns a hash code computed as `toString().hashCode`.
   ///
@@ -661,15 +659,15 @@
    * from this `Uri` need not be checked for validity again.
    */
   Uri replace(
-      {String scheme,
-      String userInfo,
-      String host,
-      int port,
-      String path,
-      Iterable<String> pathSegments,
-      String query,
-      Map<String, dynamic /*String|Iterable<String>*/ > queryParameters,
-      String fragment});
+      {String? scheme,
+      String? userInfo,
+      String? host,
+      int? port,
+      String? path,
+      Iterable<String>? pathSegments,
+      String? query,
+      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
+      String? fragment});
 
   /**
    * Returns a `Uri` that differs from this only in not having a fragment.
@@ -734,7 +732,7 @@
    * If the [uri] string is not valid as a URI or URI reference,
    * a [FormatException] is thrown.
    */
-  static Uri parse(String uri, [int start = 0, int end]) {
+  static Uri parse(String uri, [int start = 0, int? end]) {
     // This parsing will not validate percent-encoding, IPv6, etc.
     // When done splitting into parts, it will call, e.g., [_makeFragment]
     // to do the final parsing.
@@ -809,7 +807,7 @@
     // The following index-normalization belongs with the scanning, but is
     // easier to do here because we already have extracted variables from the
     // indices list.
-    var indices = List<int>(8);
+    var indices = List<int>.filled(8, 0, growable: false);
 
     // Set default values for each position.
     // The value will either be correct in some cases where it isn't set
@@ -851,8 +849,8 @@
     int queryStart = indices[_queryStartIndex];
     int fragmentStart = indices[_fragmentStartIndex];
 
-    // We may discover scheme while handling special cases.
-    String scheme;
+    // We may discover the scheme while handling special cases.
+    String? scheme;
 
     // Derive some positions that weren't set to normalize the indices.
     if (fragmentStart < queryStart) queryStart = fragmentStart;
@@ -1034,7 +1032,7 @@
    *
    * Returns `null` if the [uri] string is not valid as a URI or URI reference.
    */
-  static Uri tryParse(String uri, [int start = 0, int end]) {
+  static Uri? tryParse(String uri, [int start = 0, int? end]) {
     // TODO: Optimize to avoid throwing-and-recatching.
     try {
       return parse(uri, start, end);
@@ -1262,7 +1260,7 @@
    *  * `::FFFF:129.144.52.38`
    *  * `2010:836B:4179::836B:4179`
    */
-  static List<int> parseIPv6Address(String host, [int start = 0, int end]) {
+  static List<int> parseIPv6Address(String host, [int start = 0, int? end]) {
     end ??= host.length;
     // An IPv6 address consists of exactly 8 parts of 1-4 hex digits, separated
     // by `:`'s, with the following exceptions:
@@ -1385,7 +1383,7 @@
    * The host name is the only mandatory part of an authority, so we use
    * it to mark whether an authority part was present or not.
    */
-  final String _host;
+  final String? _host;
 
   /**
    * The port number part of the authority.
@@ -1393,7 +1391,7 @@
    * The port. Set to null if there is no port. Normalized to null if
    * the port is the default port for the scheme.
    */
-  int _port;
+  int? _port;
 
   /**
    * The path of the URI.
@@ -1402,44 +1400,38 @@
    */
   final String path;
 
-  // The query content, or null if there is no query.
-  final String _query;
+  /// The query content, or null if there is no query.
+  final String? _query;
 
   // The fragment content, or null if there is no fragment.
-  final String _fragment;
+  final String? _fragment;
 
-  /**
-   * Cache the computed return value of [pathSegments].
-   */
-  List<String> _pathSegments;
+  /// Cache of the full normalized text representation of the URI.
+  late final String _text = this._initializeText();
 
-  /**
-   * Cache of the full normalized text representation of the URI.
-   */
-  String _text;
+  /// Cache of the list of path segments.
+  late final List<String> pathSegments = _computePathSegments(this.path);
 
-  /**
-   * Cache of the hashCode of [_text].
-   *
-   * Is null until computed.
-   */
-  int _hashCodeCache;
+  /// Lazily computed and cached hashCode of [_text].
+  late final int hashCode = this._text.hashCode;
 
-  /**
-   * Cache the computed return value of [queryParameters].
-   */
-  Map<String, String> _queryParameters;
-  Map<String, List<String>> _queryParameterLists;
+  /// Cache the computed return value of [queryParameters].
+  late final Map<String, String> queryParameters =
+      UnmodifiableMapView<String, String>(Uri.splitQueryString(this.query));
+
+  /// Cache the computed return value of [queryParametersAll].
+  late final Map<String, List<String>> queryParametersAll =
+      _computeQueryParametersAll(this.query);
 
   /// Internal non-verifying constructor. Only call with validated arguments.
   ///
   /// The components must be properly normalized.
   ///
   /// Use `null` for [_host] if there is no authority. In that case, always
-  /// pass `null` for [_port] and [_userInfo] as well.
+  /// pass `null` for [_port] and an empty string for [_userInfo] as well.
   ///
-  /// Use `null` for [_port], [_userInfo], [_query] and [_fragment] if there is
-  /// component of that type.
+  /// Use `null` for [_port], [_query] and [_fragment] if there is
+  /// component of that type, and empty string for [_userInfo].
   ///
   /// The [path] and [scheme] are never empty.
   _Uri._internal(this.scheme, this._userInfo, this._host, this._port, this.path,
@@ -1460,7 +1452,7 @@
       int pathStart,
       int queryStart,
       int fragmentStart,
-      String scheme) {
+      String? scheme) {
     if (scheme == null) {
       scheme = "";
       if (schemeEnd > start) {
@@ -1470,8 +1462,8 @@
       }
     }
     String userInfo = "";
-    String host;
-    int port;
+    String? host;
+    int? port;
     if (hostStart > start) {
       int userInfoStart = schemeEnd + 3;
       if (userInfoStart < hostStart) {
@@ -1479,20 +1471,19 @@
       }
       host = _makeHost(uri, hostStart, portStart, false);
       if (portStart + 1 < pathStart) {
-        // Should throw because invalid.
-        port = int.parse(uri.substring(portStart + 1, pathStart), onError: (_) {
-          throw FormatException("Invalid port", uri, portStart + 1);
-        });
-        port = _makePort(port, scheme);
+        int portNumber =
+            int.tryParse(uri.substring(portStart + 1, pathStart)) ??
+                (throw FormatException("Invalid port", uri, portStart + 1));
+        port = _makePort(portNumber, scheme);
       }
     }
     String path =
         _makePath(uri, pathStart, queryStart, null, scheme, host != null);
-    String query;
+    String? query;
     if (queryStart < fragmentStart) {
       query = _makeQuery(uri, queryStart + 1, fragmentStart, null);
     }
-    String fragment;
+    String? fragment;
     if (fragmentStart < end) {
       fragment = _makeFragment(uri, fragmentStart + 1, end);
     }
@@ -1501,17 +1492,25 @@
 
   /// Implementation of [Uri.Uri].
   factory _Uri(
-      {String scheme,
-      String userInfo,
-      String host,
-      int port,
-      String path,
-      Iterable<String> pathSegments,
-      String query,
-      Map<String, dynamic /*String|Iterable<String>*/ > queryParameters,
-      String fragment}) {
-    scheme = _makeScheme(scheme, 0, _stringOrNullLength(scheme));
+      {String? scheme,
+      String? userInfo,
+      String? host,
+      int? port,
+      String? path,
+      Iterable<String>? pathSegments,
+      String? query,
+      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
+      String? fragment}) {
+    if (scheme == null) {
+      scheme = "";
+    } else {
+      scheme = _makeScheme(scheme, 0, scheme.length);
+    }
     userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo));
+    if (userInfo == null) {
+      // TODO(dart-lang/language#440): Remove when promotion works.
+      throw "unreachable";
+    }
     host = _makeHost(host, 0, _stringOrNullLength(host), false);
     // Special case this constructor for backwards compatibility.
     if (query == "") query = null;
@@ -1525,6 +1524,10 @@
     bool hasAuthority = (host != null);
     path = _makePath(
         path, 0, _stringOrNullLength(path), pathSegments, scheme, hasAuthority);
+    if (path == null) {
+      // TODO(dart-lang/language#440): Remove when promotion works.
+      throw "unreachable";
+    }
     if (scheme.isEmpty && host == null && !path.startsWith('/')) {
       bool allowScheme = scheme.isNotEmpty || host != null;
       path = _normalizeRelativePath(path, allowScheme);
@@ -1539,13 +1542,13 @@
 
   /// Implementation of [Uri.http].
   factory _Uri.http(String authority, String unencodedPath,
-      [Map<String, String> queryParameters]) {
+      [Map<String, String>? queryParameters]) {
     return _makeHttpUri("http", authority, unencodedPath, queryParameters);
   }
 
   /// Implementation of [Uri.https].
   factory _Uri.https(String authority, String unencodedPath,
-      [Map<String, String> queryParameters]) {
+      [Map<String, String>? queryParameters]) {
     return _makeHttpUri("https", authority, unencodedPath, queryParameters);
   }
 
@@ -1559,19 +1562,19 @@
   String get userInfo => _userInfo;
 
   String get host {
-    if (_host == null) return "";
-    if (_host.startsWith('[')) {
-      return _host.substring(1, _host.length - 1);
+    String? host = _host;
+    if (host == null) return "";
+    if (host.startsWith('[')) {
+      return host.substring(1, host.length - 1);
     }
-    return _host;
+    return host;
   }
 
   int get port {
-    if (_port == null) return _defaultPort(scheme);
-    return _port;
+    return _port ?? _defaultPort(scheme);
   }
 
-  // The default port for the scheme of this Uri.
+  /// The default port for the scheme of this Uri.
   static int _defaultPort(String scheme) {
     if (scheme == "http") return 80;
     if (scheme == "https") return 443;
@@ -1620,25 +1623,23 @@
     return true;
   }
 
-  // Report a parse failure.
-  static void _fail(String uri, int index, String message) {
+  /// Report a parse failure.
+  static Never _fail(String uri, int index, String message) {
     throw FormatException(message, uri, index);
   }
 
-  static Uri _makeHttpUri(String scheme, String authority, String unencodedPath,
-      Map<String, String> queryParameters) {
+  static _Uri _makeHttpUri(String scheme, String? authority,
+      String unencodedPath, Map<String, String>? queryParameters) {
     var userInfo = "";
-    String host;
-    int port;
+    String? host;
+    int? port;
 
     if (authority != null && authority.isNotEmpty) {
       var hostStart = 0;
       // Split off the user info.
-      bool hasUserInfo = false;
       for (int i = 0; i < authority.length; i++) {
         const int atSign = 0x40;
         if (authority.codeUnitAt(i) == atSign) {
-          hasUserInfo = true;
           userInfo = authority.substring(0, i);
           hostStart = i + 1;
           break;
@@ -1673,7 +1674,6 @@
         }
       }
       // Split host and port.
-      bool hasPort = false;
       for (; hostEnd < authority.length; hostEnd++) {
         if (authority.codeUnitAt(hostEnd) == _COLON) {
           var portString = authority.substring(hostEnd + 1);
@@ -1684,7 +1684,7 @@
       }
       host = authority.substring(hostStart, hostEnd);
     }
-    return Uri(
+    return _Uri(
         scheme: scheme,
         userInfo: userInfo,
         host: host,
@@ -1694,25 +1694,25 @@
   }
 
   /// Implementation of [Uri.file].
-  factory _Uri.file(String path, {bool windows}) {
-    windows = (windows == null) ? _Uri._isWindows : windows;
-    return windows
+  factory _Uri.file(String path, {bool? windows}) {
+    return (windows ?? _Uri._isWindows)
         ? _makeWindowsFileUrl(path, false)
         : _makeFileUri(path, false);
   }
 
   /// Implementation of [Uri.directory].
-  factory _Uri.directory(String path, {bool windows}) {
-    windows = (windows == null) ? _Uri._isWindows : windows;
-    return windows ? _makeWindowsFileUrl(path, true) : _makeFileUri(path, true);
+  factory _Uri.directory(String path, {bool? windows}) {
+    return (windows ?? _Uri._isWindows)
+        ? _makeWindowsFileUrl(path, true)
+        : _makeFileUri(path, true);
   }
 
   /// Used internally in path-related constructors.
   external static bool get _isWindows;
 
-  static _checkNonWindowsPathReservedCharacters(
+  static void _checkNonWindowsPathReservedCharacters(
       List<String> segments, bool argumentError) {
-    segments.forEach((segment) {
+    for (var segment in segments) {
       if (segment.contains("/")) {
         if (argumentError) {
           throw ArgumentError("Illegal path character $segment");
@@ -1720,10 +1720,10 @@
           throw UnsupportedError("Illegal path character $segment");
         }
       }
-    });
+    }
   }
 
-  static _checkWindowsPathReservedCharacters(
+  static void _checkWindowsPathReservedCharacters(
       List<String> segments, bool argumentError,
       [int firstSegment = 0]) {
     for (var segment in segments.skip(firstSegment)) {
@@ -1737,7 +1737,7 @@
     }
   }
 
-  static _checkWindowsDriveLetter(int charCode, bool argumentError) {
+  static void _checkWindowsDriveLetter(int charCode, bool argumentError) {
     if ((_UPPER_CASE_A <= charCode && charCode <= _UPPER_CASE_Z) ||
         (_LOWER_CASE_A <= charCode && charCode <= _LOWER_CASE_Z)) {
       return;
@@ -1751,7 +1751,7 @@
     }
   }
 
-  static _makeFileUri(String path, bool slashTerminated) {
+  static Uri _makeFileUri(String path, bool slashTerminated) {
     const String sep = "/";
     var segments = path.split(sep);
     if (slashTerminated && segments.isNotEmpty && segments.last.isNotEmpty) {
@@ -1833,15 +1833,15 @@
   }
 
   Uri replace(
-      {String scheme,
-      String userInfo,
-      String host,
-      int port,
-      String path,
-      Iterable<String> pathSegments,
-      String query,
-      Map<String, dynamic /*String|Iterable<String>*/ > queryParameters,
-      String fragment}) {
+      {String? scheme,
+      String? userInfo,
+      String? host,
+      int? port,
+      String? path,
+      Iterable<String>? pathSegments,
+      String? query,
+      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
+      String? fragment}) {
     // Set to true if the scheme has (potentially) changed.
     // In that case, the default port may also have changed and we need
     // to check even the existing port.
@@ -1852,12 +1852,14 @@
     } else {
       scheme = this.scheme;
     }
+
     bool isFile = (scheme == "file");
     if (userInfo != null) {
       userInfo = _makeUserInfo(userInfo, 0, userInfo.length);
     } else {
       userInfo = this._userInfo;
     }
+
     if (port != null) {
       port = _makePort(port, scheme);
     } else {
@@ -1880,11 +1882,12 @@
       path = _makePath(path, 0, _stringOrNullLength(path), pathSegments, scheme,
           hasAuthority);
     } else {
-      path = this.path;
-      if ((isFile || (hasAuthority && !path.isEmpty)) &&
-          !path.startsWith('/')) {
-        path = "/" + path;
+      var currentPath = this.path;
+      if ((isFile || (hasAuthority && !currentPath.isEmpty)) &&
+          !currentPath.startsWith('/')) {
+        currentPath = "/" + currentPath;
       }
+      path = currentPath;
     }
 
     if (query != null || queryParameters != null) {
@@ -1907,39 +1910,21 @@
     return _Uri._internal(scheme, _userInfo, _host, _port, path, _query, null);
   }
 
-  List<String> get pathSegments {
-    var result = _pathSegments;
-    if (result != null) return result;
-
-    var pathToSplit = path;
+  static List<String> _computePathSegments(String pathToSplit) {
     if (pathToSplit.isNotEmpty && pathToSplit.codeUnitAt(0) == _SLASH) {
       pathToSplit = pathToSplit.substring(1);
     }
-    result = (pathToSplit == "")
+    return (pathToSplit.isEmpty)
         ? const <String>[]
         : List<String>.unmodifiable(
             pathToSplit.split("/").map(Uri.decodeComponent));
-    _pathSegments = result;
-    return result;
   }
 
-  Map<String, String> get queryParameters {
-    _queryParameters ??=
-        UnmodifiableMapView<String, String>(Uri.splitQueryString(query));
-    return _queryParameters;
-  }
-
-  Map<String, List<String>> get queryParametersAll {
-    if (_queryParameterLists == null) {
-      Map queryParameterLists = _splitQueryStringAll(query);
-      for (var key in queryParameterLists.keys) {
-        queryParameterLists[key] =
-            List<String>.unmodifiable(queryParameterLists[key]);
-      }
-      _queryParameterLists =
-          Map<String, List<String>>.unmodifiable(queryParameterLists);
-    }
-    return _queryParameterLists;
+  static Map<String, List<String>> _computeQueryParametersAll(String? query) {
+    if (query == null || query.isEmpty) return const <String, List<String>>{};
+    Map<String, List<String>> queryParameterLists = _splitQueryStringAll(query);
+    queryParameterLists.updateAll(_toUnmodifiableStringList);
+    return Map<String, List<String>>.unmodifiable(queryParameterLists);
   }
 
   Uri normalizePath() {
@@ -1948,7 +1933,7 @@
     return this.replace(path: path);
   }
 
-  static int _makePort(int port, String scheme) {
+  static int? _makePort(int? port, String scheme) {
     // Perform scheme specific normalization.
     if (port != null && port == _defaultPort(scheme)) return null;
     return port;
@@ -1965,7 +1950,7 @@
    * This escapes all characters not valid in a reg-name,
    * and converts all non-escape upper-case letters to lower-case.
    */
-  static String _makeHost(String host, int start, int end, bool strictIPv6) {
+  static String? _makeHost(String? host, int start, int end, bool strictIPv6) {
     // TODO(lrn): Should we normalize IPv6 addresses according to RFC 5952?
     if (host == null) return null;
     if (start == end) return "";
@@ -2004,8 +1989,8 @@
     return _normalizeRegName(host, start, end);
   }
 
-  // RFC 6874 check for ZoneID
-  // Return the index of first appeared `%`.
+  /// RFC 6874 check for ZoneID
+  /// Return the index of first appeared `%`.
   static int _checkZoneID(String host, int start, int end) {
     int index = host.indexOf('%', start);
     index = (index >= start && index < end) ? index : end;
@@ -2026,7 +2011,7 @@
    */
   static String _normalizeZoneID(String host, int start, int end,
       [String prefix = '']) {
-    StringBuffer buffer;
+    StringBuffer? buffer;
     if (prefix != '') {
       buffer = StringBuffer(prefix);
     }
@@ -2038,7 +2023,7 @@
     while (index < end) {
       int char = host.codeUnitAt(index);
       if (char == _PERCENT) {
-        String replacement = _normalizeEscape(host, index, true);
+        String? replacement = _normalizeEscape(host, index, true);
         if (replacement == null && isNormalized) {
           index += 3;
           continue;
@@ -2076,10 +2061,8 @@
             sourceLength = 2;
           }
         }
-        buffer ??= StringBuffer();
         String slice = host.substring(sectionStart, index);
-        buffer.write(slice);
-        buffer.write(_escapeChar(char));
+        (buffer ??= StringBuffer())..write(slice)..write(_escapeChar(char));
         index += sourceLength;
         sectionStart = index;
       }
@@ -2104,7 +2087,7 @@
    * lower case unreserved characters or upper case escapes.
    */
   static String _normalizeRegName(String host, int start, int end) {
-    StringBuffer buffer;
+    StringBuffer? buffer;
     int sectionStart = start;
     int index = start;
     // Whether all characters between sectionStart and index are normalized,
@@ -2114,7 +2097,7 @@
       int char = host.codeUnitAt(index);
       if (char == _PERCENT) {
         // The _regNameTable contains "%", so we check that first.
-        String replacement = _normalizeEscape(host, index, true);
+        String? replacement = _normalizeEscape(host, index, true);
         if (replacement == null && isNormalized) {
           index += 3;
           continue;
@@ -2156,11 +2139,9 @@
             sourceLength = 2;
           }
         }
-        buffer ??= StringBuffer();
         String slice = host.substring(sectionStart, index);
         if (!isNormalized) slice = slice.toLowerCase();
-        buffer.write(slice);
-        buffer.write(_escapeChar(char));
+        (buffer ??= StringBuffer())..write(slice)..write(_escapeChar(char));
         index += sourceLength;
         sectionStart = index;
       }
@@ -2200,9 +2181,9 @@
     return _canonicalizeScheme(scheme);
   }
 
-  // Canonicalize a few often-used scheme strings.
-  //
-  // This improves memory usage and makes comparison faster.
+  /// Canonicalize a few often-used scheme strings.
+  ///
+  /// This improves memory usage and makes comparison faster.
   static String _canonicalizeScheme(String scheme) {
     if (scheme == "http") return "http";
     if (scheme == "file") return "file";
@@ -2211,27 +2192,26 @@
     return scheme;
   }
 
-  static String _makeUserInfo(String userInfo, int start, int end) {
+  static String _makeUserInfo(String? userInfo, int start, int end) {
     if (userInfo == null) return "";
     return _normalizeOrSubstring(userInfo, start, end, _userinfoTable);
   }
 
-  static String _makePath(String path, int start, int end,
-      Iterable<String> pathSegments, String scheme, bool hasAuthority) {
+  static String _makePath(String? path, int start, int end,
+      Iterable<String>? pathSegments, String scheme, bool hasAuthority) {
     bool isFile = (scheme == "file");
     bool ensureLeadingSlash = isFile || hasAuthority;
-    if (path == null && pathSegments == null) return isFile ? "/" : "";
-    if (path != null && pathSegments != null) {
-      throw ArgumentError('Both path and pathSegments specified');
-    }
     String result;
-    if (path != null) {
-      result = _normalizeOrSubstring(path, start, end, _pathCharOrSlashTable,
-          escapeDelimiters: true);
-    } else {
+    if (path == null) {
+      if (pathSegments == null) return isFile ? "/" : "";
       result = pathSegments
           .map((s) => _uriEncode(_pathCharTable, s, utf8, false))
           .join("/");
+    } else if (pathSegments != null) {
+      throw ArgumentError('Both path and pathSegments specified');
+    } else {
+      result = _normalizeOrSubstring(path, start, end, _pathCharOrSlashTable,
+          escapeDelimiters: true);
     }
     if (result.isEmpty) {
       if (isFile) return "/";
@@ -2254,8 +2234,8 @@
     return _removeDotSegments(path);
   }
 
-  static String _makeQuery(String query, int start, int end,
-      Map<String, dynamic /*String|Iterable<String>*/ > queryParameters) {
+  static String? _makeQuery(String? query, int start, int end,
+      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters) {
     if (query != null) {
       if (queryParameters != null) {
         throw ArgumentError('Both query and queryParameters specified');
@@ -2268,7 +2248,7 @@
     var result = StringBuffer();
     var separator = "";
 
-    void writeParameter(String key, String value) {
+    void writeParameter(String key, String? value) {
       result.write(separator);
       separator = "&";
       result.write(Uri.encodeQueryComponent(key));
@@ -2291,7 +2271,7 @@
     return result.toString();
   }
 
-  static String _makeFragment(String fragment, int start, int end) {
+  static String? _makeFragment(String? fragment, int start, int end) {
     if (fragment == null) return null;
     return _normalizeOrSubstring(fragment, start, end, _queryCharTable,
         escapeDelimiters: true);
@@ -2310,7 +2290,7 @@
    *
    * If [lowerCase] is true, a single character returned is always lower case,
    */
-  static String _normalizeEscape(String source, int index, bool lowerCase) {
+  static String? _normalizeEscape(String source, int index, bool lowerCase) {
     assert(source.codeUnitAt(index) == _PERCENT);
     if (index + 2 >= source.length) {
       return "%"; // Marks the escape as invalid.
@@ -2343,7 +2323,7 @@
     List<int> codeUnits;
     if (char < 0x80) {
       // ASCII, a single percent encoded sequence.
-      codeUnits = List(3);
+      codeUnits = Uint8List(3);
       codeUnits[0] = _PERCENT;
       codeUnits[1] = _hexDigits.codeUnitAt(char >> 4);
       codeUnits[2] = _hexDigits.codeUnitAt(char & 0xf);
@@ -2359,7 +2339,7 @@
           flag = 0xf0;
         }
       }
-      codeUnits = List(3 * encodedBytes);
+      codeUnits = Uint8List(3 * encodedBytes);
       int index = 0;
       while (--encodedBytes >= 0) {
         int byte = ((char >> (6 * encodedBytes)) & 0x3f) | flag;
@@ -2398,10 +2378,10 @@
    *
    * Returns `null` if the original content was already normalized.
    */
-  static String _normalize(
+  static String? _normalize(
       String component, int start, int end, List<int> charTable,
       {bool escapeDelimiters = false}) {
-    StringBuffer buffer;
+    StringBuffer? buffer;
     int sectionStart = start;
     int index = start;
     // Loop while characters are valid and escapes correct and upper-case.
@@ -2410,7 +2390,7 @@
       if (char < 127 && (charTable[char >> 4] & (1 << (char & 0x0f))) != 0) {
         index++;
       } else {
-        String replacement;
+        String? replacement;
         int sourceLength;
         if (char == _PERCENT) {
           replacement = _normalizeEscape(component, index, false);
@@ -2428,6 +2408,7 @@
           }
         } else if (!escapeDelimiters && _isGeneralDelimiter(char)) {
           _fail(component, index, "Invalid character");
+          throw "unreachable"; // TODO(lrn): Remove when Never-returning functions are recognized as throwing.
         } else {
           sourceLength = 1;
           if ((char & 0xFC00) == 0xD800) {
@@ -2443,9 +2424,9 @@
           }
           replacement = _escapeChar(char);
         }
-        buffer ??= StringBuffer();
-        buffer.write(component.substring(sectionStart, index));
-        buffer.write(replacement);
+        (buffer ??= StringBuffer())
+          ..write(component.substring(sectionStart, index))
+          ..write(replacement);
         index += sourceLength;
         sectionStart = index;
       }
@@ -2615,10 +2596,10 @@
     // From RFC 3986.
     String targetScheme;
     String targetUserInfo = "";
-    String targetHost;
-    int targetPort;
+    String? targetHost;
+    int? targetPort;
     String targetPath;
-    String targetQuery;
+    String? targetQuery;
     if (reference.scheme.isNotEmpty) {
       targetScheme = reference.scheme;
       if (reference.hasAuthority) {
@@ -2687,7 +2668,7 @@
         }
       }
     }
-    String fragment = reference.hasFragment ? reference.fragment : null;
+    String? fragment = reference.hasFragment ? reference.fragment : null;
     return _Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort,
         targetPath, targetQuery, fragment);
   }
@@ -2714,15 +2695,17 @@
       throw StateError(
           "Origin is only applicable schemes http and https: $this");
     }
-    if (_host == null || _host == "") {
+    String? host = _host;
+    if (host == null || host == "") {
       throw StateError(
           "A $scheme: URI should have a non-empty host name: $this");
     }
-    if (_port == null) return "$scheme://$_host";
-    return "$scheme://$_host:$_port";
+    int? port = _port;
+    if (port == null) return "$scheme://$host";
+    return "$scheme://$host:$port";
   }
 
-  String toFilePath({bool windows}) {
+  String toFilePath({bool? windows}) {
     if (scheme != "" && scheme != "file") {
       throw UnsupportedError("Cannot extract a file path from a $scheme URI");
     }
@@ -2734,8 +2717,7 @@
       throw UnsupportedError(
           "Cannot extract a file path from a URI with a fragment component");
     }
-    windows ??= _isWindows;
-    return windows ? _toWindowsFilePath(this) : _toFilePath();
+    return (windows ?? _isWindows) ? _toWindowsFilePath(this) : _toFilePath();
   }
 
   String _toFilePath() {
@@ -2780,10 +2762,6 @@
     return result.toString();
   }
 
-  bool get _isPathAbsolute {
-    return path != null && path.startsWith('/');
-  }
-
   void _writeAuthority(StringSink ss) {
     if (_userInfo.isNotEmpty) {
       ss.write(_userInfo);
@@ -2804,14 +2782,11 @@
    * The [UriData] object can be used to access the media type and data
    * of a `data:` URI.
    */
-  UriData get data => (scheme == "data") ? UriData.fromUri(this) : null;
+  UriData? get data => (scheme == "data") ? UriData.fromUri(this) : null;
 
-  String toString() {
-    return _text ??= _initializeText();
-  }
+  String toString() => _text;
 
   String _initializeText() {
-    assert(_text == null);
     StringBuffer sb = StringBuffer();
     if (scheme.isNotEmpty) sb..write(scheme)..write(":");
     if (hasAuthority || (scheme == "file")) {
@@ -2841,10 +2816,6 @@
         fragment == other.fragment;
   }
 
-  int get hashCode {
-    return _hashCodeCache ??= toString().hashCode;
-  }
-
   static List<String> _createList() => <String>[];
 
   static Map<String, List<String>> _splitQueryStringAll(String query,
@@ -2926,7 +2897,6 @@
     assert(0 <= start);
     assert(start <= end);
     assert(end <= text.length);
-    assert(encoding != null);
     // First check whether there is any characters which need special handling.
     bool simple = true;
     for (int i = start; i < end; i++) {
@@ -2946,7 +2916,7 @@
         bytes = text.substring(start, end).codeUnits;
       }
     } else {
-      bytes = List();
+      bytes = <int>[];
       for (int i = start; i < end; i++) {
         var codeUnit = text.codeUnitAt(i);
         if (codeUnit > 127) {
@@ -3062,50 +3032,6 @@
     0x07ff, // 0x70 - 0x7f  1111111111100010
   ];
 
-  // Characters allowed in scheme except for upper case letters.
-  static const _schemeLowerTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                                 + -.
-    0x6800, // 0x20 - 0x2f  0000000000010110
-    //                      0123456789
-    0x03ff, // 0x30 - 0x3f  1111111111000000
-    //
-    0x0000, // 0x40 - 0x4f  0111111111111111
-    //
-    0x0000, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz
-    0x07ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Sub delimiter characters combined with unreserved as of 3986.
-  // sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
-  //         / "*" / "+" / "," / ";" / "="
-  // RFC 3986 section 2.3.
-  // unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
-  static const _subDelimitersTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $ &'()*+,-.
-    0x7fd2, // 0x20 - 0x2f  0100101111111110
-    //                      0123456789 ; =
-    0x2bff, // 0x30 - 0x3f  1111111111010100
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
   // General delimiter characters, RFC 3986 section 2.2.
   // gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"
   //
@@ -3310,7 +3236,7 @@
   /**
    * Cache of the result returned by [uri].
    */
-  Uri _uriCache;
+  Uri? _uriCache;
 
   UriData._(this._text, this._separatorIndices, this._uriCache);
 
@@ -3324,15 +3250,14 @@
    * be more efficient if the [uri] itself isn't used.
    */
   factory UriData.fromString(String content,
-      {String mimeType,
-      Encoding encoding,
-      Map<String, String> parameters,
+      {String? mimeType,
+      Encoding? encoding,
+      Map<String, String>? parameters,
       bool base64 = false}) {
     StringBuffer buffer = StringBuffer();
     List<int> indices = [_noScheme];
-    String charsetName;
-    String encodingName;
-    if (parameters != null) charsetName = parameters["charset"];
+    String? charsetName = parameters?.["charset"];
+    String? encodingName;
     if (encoding == null) {
       if (charsetName != null) {
         encoding = Encoding.getByName(charsetName);
@@ -3362,9 +3287,9 @@
    * be more efficient if the [uri] itself isn't used.
    */
   factory UriData.fromBytes(List<int> bytes,
-      {mimeType = "application/octet-stream",
-      Map<String, String> parameters,
-      percentEncoded = false}) {
+      {String mimeType = "application/octet-stream",
+      Map<String, String>? parameters,
+      bool percentEncoded = false}) {
     StringBuffer buffer = StringBuffer();
     List<int> indices = [_noScheme];
     _writeUri(mimeType, null, parameters, buffer, indices);
@@ -3405,7 +3330,7 @@
       return _parse(uri.path, 0, uri);
     }
     // Includes path and query (and leading "data:").
-    return _parse("$uri", 5, uri);
+    return _parse(uri.toString(), 5, uri);
   }
 
   /**
@@ -3416,11 +3341,16 @@
    * Of an [indices] list is passed, separator indices are stored in that
    * list.
    */
-  static void _writeUri(String mimeType, String charsetName,
-      Map<String, String> parameters, StringBuffer buffer, List indices) {
+  static void _writeUri(
+      String? mimeType,
+      String? charsetName,
+      Map<String, String>? parameters,
+      StringBuffer buffer,
+      List<int>? indices) {
     if (mimeType == null || mimeType == "text/plain") {
       mimeType = "";
     }
+
     if (mimeType.isEmpty || identical(mimeType, "application/octet-stream")) {
       buffer.write(mimeType); // Common cases need no escaping.
     } else {
@@ -3435,9 +3365,8 @@
           _tokenCharTable, mimeType.substring(slashIndex + 1), utf8, false));
     }
     if (charsetName != null) {
-      if (indices != null) {
-        indices..add(buffer.length)..add(buffer.length + 8);
-      }
+      // TODO(39209): Use ?.. when sequences are properly supported.
+      if (indices != null) indices..add(buffer.length)..add(buffer.length + 8);
       buffer.write(";charset=");
       buffer.write(_Uri._uriEncode(_tokenCharTable, charsetName, utf8, false));
     }
@@ -3449,11 +3378,11 @@
         throw ArgumentError.value(
             "", "Parameter values must not be empty", 'parameters["$key"]');
       }
-      if (indices != null) indices.add(buffer.length);
+      indices?.add(buffer.length);
       buffer.write(';');
       // Encode any non-RFC2045-token character and both '%' and '#'.
       buffer.write(_Uri._uriEncode(_tokenCharTable, key, utf8, false));
-      if (indices != null) indices.add(buffer.length);
+      indices?.add(buffer.length);
       buffer.write('=');
       buffer.write(_Uri._uriEncode(_tokenCharTable, value, utf8, false));
     });
@@ -3533,9 +3462,12 @@
    * as path.
    */
   Uri get uri {
-    if (_uriCache != null) return _uriCache;
+    return _uriCache ??= _computeUri();
+  }
+
+  Uri _computeUri() {
     String path = _text;
-    String query;
+    String? query;
     int colonIndex = _separatorIndices[0];
     int queryIndex = _text.indexOf('?', colonIndex + 1);
     int end = _text.length;
@@ -3546,8 +3478,7 @@
     }
     path = _Uri._normalizeOrSubstring(
         _text, colonIndex + 1, end, _Uri._pathCharOrSlashTable);
-    _uriCache = _DataUri(this, path, query);
-    return _uriCache;
+    return _DataUri(this, path, query);
   }
 
   /**
@@ -3686,7 +3617,7 @@
    * converted to bytes and then the character codes and byte values are
    * decoded using [encoding].
    */
-  String contentAsString({Encoding encoding}) {
+  String contentAsString({Encoding? encoding}) {
     if (encoding == null) {
       var charset = this.charset; // Returns "US-ASCII" if not present.
       encoding = Encoding.getByName(charset);
@@ -3730,7 +3661,7 @@
     return result;
   }
 
-  static UriData _parse(String text, int start, Uri sourceUri) {
+  static UriData _parse(String text, int start, Uri? sourceUri) {
     assert(start == 0 || start == 5);
     assert((start == 5) == text.startsWith("data:"));
 
@@ -3872,26 +3803,6 @@
   //
   // This is the same characters as in a URI query (which is URI pchar plus '?')
   static const _uricTable = _Uri._queryCharTable;
-
-  // Characters allowed in base-64 encoding (alphanumeric, '/', '+' and '=').
-  static const _base64Table = [
-    //                     LSB             MSB
-    //                      |               |
-    0x0000, // 0x00 - 0x0f  00000000 00000000
-    0x0000, // 0x10 - 0x1f  00000000 00000000
-    //                                  +   /
-    0x8800, // 0x20 - 0x2f  00000000 00010001
-    //                      01234567 89
-    0x03ff, // 0x30 - 0x3f  11111111 11000000
-    //                       ABCDEFG HIJKLMNO
-    0xfffe, // 0x40 - 0x4f  01111111 11111111
-    //                      PQRSTUVW XYZ
-    0x07ff, // 0x50 - 0x5f  11111111 11100000
-    //                       abcdefg hijklmno
-    0xfffe, // 0x60 - 0x6f  01111111 11111111
-    //                      pqrstuvw xyz
-    0x07ff, // 0x70 - 0x7f  11111111 11100000
-  ];
 }
 
 // --------------------------------------------------------------------
@@ -4295,8 +4206,8 @@
   /// The scheme is often used to distinguish URIs.
   /// To make comparisons more efficient, we cache the value, and
   /// canonicalize a few known types.
-  String _schemeCache;
-  int _hashCodeCache;
+  String? _schemeCache;
+  int? _hashCodeCache;
 
   _SimpleUri(
       this._uri,
@@ -4336,20 +4247,16 @@
   }
 
   String get scheme {
+    return _schemeCache ??= _computeScheme();
+  }
+
+  String _computeScheme() {
     if (_schemeEnd <= 0) return "";
-    if (_schemeCache != null) return _schemeCache;
-    if (_isHttp) {
-      _schemeCache = "http";
-    } else if (_isHttps) {
-      _schemeCache = "https";
-    } else if (_isFile) {
-      _schemeCache = "file";
-    } else if (_isPackage) {
-      _schemeCache = "package";
-    } else {
-      _schemeCache = _uri.substring(0, _schemeEnd);
-    }
-    return _schemeCache;
+    if (_isHttp) return "http";
+    if (_isHttps) return "https";
+    if (_isFile) return "file";
+    if (_isPackage) return "package";
+    return _uri.substring(0, _schemeEnd);
   }
 
   String get authority =>
@@ -4419,11 +4326,9 @@
 
   Map<String, List<String>> get queryParametersAll {
     if (!hasQuery) return const <String, List<String>>{};
-    Map queryParameterLists = _Uri._splitQueryStringAll(query);
-    for (var key in queryParameterLists.keys) {
-      queryParameterLists[key] =
-          List<String>.unmodifiable(queryParameterLists[key]);
-    }
+    Map<String, List<String>> queryParameterLists =
+        _Uri._splitQueryStringAll(query);
+    queryParameterLists.updateAll(_toUnmodifiableStringList);
     return Map<String, List<String>>.unmodifiable(queryParameterLists);
   }
 
@@ -4442,15 +4347,15 @@
   }
 
   Uri replace(
-      {String scheme,
-      String userInfo,
-      String host,
-      int port,
-      String path,
-      Iterable<String> pathSegments,
-      String query,
-      Map<String, dynamic /*String|Iterable<String>*/ > queryParameters,
-      String fragment}) {
+      {String? scheme,
+      String? userInfo,
+      String? host,
+      int? port,
+      String? path,
+      Iterable<String>? pathSegments,
+      String? query,
+      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
+      String? fragment}) {
     bool schemeChanged = false;
     if (scheme != null) {
       scheme = _Uri._makeScheme(scheme, 0, scheme.length);
@@ -4702,7 +4607,7 @@
         base._schemeCache);
   }
 
-  String toFilePath({bool windows}) {
+  String toFilePath({bool? windows}) {
     if (_schemeEnd >= 0 && !_isFile) {
       throw UnsupportedError("Cannot extract a file path from a $scheme URI");
     }
@@ -4714,8 +4619,9 @@
       throw UnsupportedError(
           "Cannot extract a file path from a URI with a fragment component");
     }
-    windows ??= _Uri._isWindows;
-    return windows ? _Uri._toWindowsFilePath(this) : _toFilePath();
+    return (windows ?? _Uri._isWindows)
+        ? _Uri._toWindowsFilePath(this)
+        : _toFilePath();
   }
 
   String _toFilePath() {
@@ -4728,7 +4634,7 @@
     return this.path;
   }
 
-  UriData get data {
+  UriData? get data {
     assert(scheme != "data");
     return null;
   }
@@ -4758,10 +4664,10 @@
 class _DataUri extends _Uri {
   final UriData _data;
 
-  _DataUri(this._data, String path, String query)
-      : super._internal("data", null, null, null, path, query, null);
+  _DataUri(this._data, String path, String? query)
+      : super._internal("data", "", null, null, path, query, null);
 
-  UriData get data => _data;
+  UriData? get data => _data;
 }
 
 /// Checks whether [text] starts with "data:" at position [start].
@@ -4783,4 +4689,7 @@
 }
 
 /// Helper function returning the length of a string, or `0` for `null`.
-int _stringOrNullLength(String s) => (s == null) ? 0 : s.length;
+int _stringOrNullLength(String? s) => (s == null) ? 0 : s.length;
+
+List<String> _toUnmodifiableStringList(String key, List<String> list) =>
+    List<String>.unmodifiable(list);
diff --git a/sdk/lib/developer/developer.dart b/sdk/lib/developer/developer.dart
index 4490499..e9df841 100644
--- a/sdk/lib/developer/developer.dart
+++ b/sdk/lib/developer/developer.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.6
-
 /// Interact with developer tools such as the debugger and inspector.
 ///
 /// This library is platform dependent and has separate implementations for
@@ -36,12 +34,12 @@
 /// regardless of whether or not a debugger is connected. When compiled to
 /// JavaScript, this uses the "debugger" statement, and behaves exactly as
 /// that does.
-external bool debugger({bool when: true, String message});
+external bool debugger({bool when = true, String? message});
 
 /// Send a reference to [object] to any attached debuggers.
 ///
 /// Debuggers may open an inspector on the object. Returns the argument.
-external Object inspect(Object object);
+external Object? inspect(Object? object);
 
 /// Emit a log event.
 ///
@@ -59,11 +57,11 @@
 /// - [stackTrace] (optional) a stack trace associated with this log event
 external void log(
   String message, {
-  DateTime time,
-  int sequenceNumber,
-  int level: 0,
-  String name: '',
-  Zone zone,
-  Object error,
-  StackTrace stackTrace,
+  DateTime? time,
+  int? sequenceNumber,
+  int level = 0,
+  String name = '',
+  Zone? zone,
+  Object? error,
+  StackTrace? stackTrace,
 });
diff --git a/sdk/lib/developer/extension.dart b/sdk/lib/developer/extension.dart
index 5d0da2a..184a00f 100644
--- a/sdk/lib/developer/extension.dart
+++ b/sdk/lib/developer/extension.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.6
-
 part of dart.developer;
 
 /// A response to a service protocol extension RPC.
@@ -12,13 +10,13 @@
 /// use [ServiceExtensionResponse.error].
 class ServiceExtensionResponse {
   /// The result of a successful service protocol extension RPC.
-  final String result;
+  final String? result;
 
   /// The error code associated with a failed service protocol extension RPC.
-  final int errorCode;
+  final int? errorCode;
 
   /// The details of a failed service protocol extension RPC.
-  final String errorDetail;
+  final String? errorDetail;
 
   /// Creates a successful response to a service protocol extension RPC.
   ///
@@ -28,6 +26,7 @@
       : result = result,
         errorCode = null,
         errorDetail = null {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(result, "result");
   }
 
@@ -42,6 +41,7 @@
         errorCode = errorCode,
         errorDetail = errorDetail {
     _validateErrorCode(errorCode);
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(errorDetail, "errorDetail");
   }
 
@@ -82,6 +82,7 @@
   }
 
   static _validateErrorCode(int errorCode) {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(errorCode, "errorCode");
     if (errorCode == invalidParams) return;
     if ((errorCode >= extensionErrorMin) && (errorCode <= extensionErrorMax)) {
@@ -95,17 +96,12 @@
 
   // ignore: unused_element, called from runtime/lib/developer.dart
   String _toString() {
-    if (result != null) {
-      return result;
-    } else {
-      assert(errorCode != null);
-      assert(errorDetail != null);
-      return json.encode({
-        'code': errorCode,
-        'message': _errorCodeMessage(errorCode),
-        'data': {'details': errorDetail}
-      });
-    }
+    return result ??
+        json.encode({
+          'code': errorCode!,
+          'message': _errorCodeMessage(errorCode!),
+          'data': {'details': errorDetail!}
+        });
   }
 }
 
@@ -132,6 +128,7 @@
 /// Because service extensions are isolate specific, clients using extensions
 /// must always include an 'isolateId' parameter with each RPC.
 void registerExtension(String method, ServiceExtensionHandler handler) {
+  // TODO: When NNBD is complete, delete the following line.
   ArgumentError.checkNotNull(method, 'method');
   if (!method.startsWith('ext.')) {
     throw new ArgumentError.value(method, 'method', 'Must begin with ext.');
@@ -139,6 +136,7 @@
   if (_lookupExtension(method) != null) {
     throw new ArgumentError('Extension already registered: $method');
   }
+  // TODO: When NNBD is complete, delete the following line.
   ArgumentError.checkNotNull(handler, 'handler');
   _registerExtension(method, handler);
 }
@@ -146,6 +144,7 @@
 /// Post an event of [eventKind] with payload of [eventData] to the `Extension`
 /// event stream.
 void postEvent(String eventKind, Map eventData) {
+  // TODO: When NNBD is complete, delete the following two lines.
   ArgumentError.checkNotNull(eventKind, 'eventKind');
   ArgumentError.checkNotNull(eventData, 'eventData');
   String eventDataAsString = json.encode(eventData);
@@ -159,5 +158,5 @@
 // these into Dart code unless you can ensure that the operations will can be
 // done atomically. Native code lives in vm/isolate.cc-
 // LookupServiceExtensionHandler and RegisterServiceExtensionHandler.
-external ServiceExtensionHandler _lookupExtension(String method);
+external ServiceExtensionHandler? _lookupExtension(String method);
 external _registerExtension(String method, ServiceExtensionHandler handler);
diff --git a/sdk/lib/developer/profiler.dart b/sdk/lib/developer/profiler.dart
index 8104bbb..07fb625 100644
--- a/sdk/lib/developer/profiler.dart
+++ b/sdk/lib/developer/profiler.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.6
-
 part of dart.developer;
 
 /// A UserTag can be used to group samples in the Observatory profiler.
@@ -65,11 +63,12 @@
   }
 
   Gauge(String name, String description, this.min, this.max)
-      : super(name, description) {
+      : _value = min,
+        super(name, description) {
+    // TODO: When NNBD is complete, delete the following two lines.
     ArgumentError.checkNotNull(min, 'min');
     ArgumentError.checkNotNull(max, 'max');
     if (!(min < max)) throw new ArgumentError('min must be less than max');
-    _value = min;
   }
 
   Map _toJSON() {
@@ -113,6 +112,7 @@
 
   /// Register [Metric]s to make them visible to Observatory.
   static void register(Metric metric) {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(metric, 'metric');
     if (_metrics[metric.name] != null) {
       throw new ArgumentError('Registered metrics have unique names');
@@ -122,13 +122,14 @@
 
   /// Deregister [Metric]s to make them not visible to Observatory.
   static void deregister(Metric metric) {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(metric, 'metric');
     _metrics.remove(metric.name);
   }
 
   // ignore: unused_element, called from native code
   @pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
-  static String _printMetric(String id) {
+  static String? _printMetric(String id) {
     var metric = _metrics[id];
     if (metric == null) {
       return null;
diff --git a/sdk/lib/developer/service.dart b/sdk/lib/developer/service.dart
index 81d0540..6d90667 100644
--- a/sdk/lib/developer/service.dart
+++ b/sdk/lib/developer/service.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.6
-
 part of dart.developer;
 
 /// Service protocol is the protocol that a client like the Observatory
@@ -21,7 +19,7 @@
 
   /// The Uri to access the service. If the web server is not running, this
   /// will be null.
-  final Uri serverUri;
+  final Uri? serverUri;
 
   ServiceProtocolInfo(this.serverUri);
 
@@ -44,12 +42,12 @@
   static Future<ServiceProtocolInfo> getInfo() async {
     // Port to receive response from service isolate.
     final RawReceivePort receivePort = new RawReceivePort();
-    final Completer<Uri> uriCompleter = new Completer<Uri>();
-    receivePort.handler = (Uri uri) => uriCompleter.complete(uri);
+    final Completer<Uri?> uriCompleter = new Completer<Uri?>();
+    receivePort.handler = (Uri? uri) => uriCompleter.complete(uri);
     // Request the information from the service isolate.
     _getServerInfo(receivePort.sendPort);
     // Await the response from the service isolate.
-    Uri uri = await uriCompleter.future;
+    Uri? uri = await uriCompleter.future;
     // Close the port.
     receivePort.close();
     return new ServiceProtocolInfo(uri);
@@ -60,6 +58,7 @@
   /// enable (true) or disable (false) the web server servicing requests.
   static Future<ServiceProtocolInfo> controlWebServer(
       {bool enable: false}) async {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(enable, 'enable');
     // Port to receive response from service isolate.
     final RawReceivePort receivePort = new RawReceivePort();
@@ -78,7 +77,8 @@
   ///
   /// Returns null if the running Dart environment does not support the service
   /// protocol.
-  static String getIsolateID(Isolate isolate) {
+  static String? getIsolateID(Isolate isolate) {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(isolate, 'isolate');
     return _getIsolateIDFromSendPort(isolate.controlPort);
   }
@@ -97,4 +97,4 @@
 external int _getServiceMinorVersion();
 
 /// Returns the service id for the isolate that owns [sendPort].
-external String _getIsolateIDFromSendPort(SendPort sendPort);
+external String? _getIsolateIDFromSendPort(SendPort sendPort);
diff --git a/sdk/lib/developer/timeline.dart b/sdk/lib/developer/timeline.dart
index cd1b43d..cc9cf40 100644
--- a/sdk/lib/developer/timeline.dart
+++ b/sdk/lib/developer/timeline.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.6
-
 part of dart.developer;
 
 const bool _hasTimeline =
@@ -58,7 +56,7 @@
   /// When passed to a [Timeline] method, generates a "begin" Flow event.
   /// If [id] is not provided, an id that conflicts with no other Dart-generated
   /// flow id's will be generated.
-  static Flow begin({int id}) {
+  static Flow begin({int? id}) {
     return new Flow._(_begin, id ?? _getNextAsyncId());
   }
 
@@ -102,8 +100,9 @@
   /// a [Map] of [arguments]. This slice may also optionally be associated with
   /// a [Flow] event. This operation must be finished before
   /// returning to the event queue.
-  static void startSync(String name, {Map arguments, Flow flow}) {
+  static void startSync(String name, {Map? arguments, Flow? flow}) {
     if (!_hasTimeline) return;
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(name, 'name');
     if (!_isDartStreamEnabled()) {
       // Push a null onto the stack and return.
@@ -140,14 +139,15 @@
   }
 
   /// Emit an instant event.
-  static void instantSync(String name, {Map arguments}) {
+  static void instantSync(String name, {Map? arguments}) {
     if (!_hasTimeline) return;
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(name, 'name');
     if (!_isDartStreamEnabled()) {
       // Stream is disabled.
       return;
     }
-    Map instantArguments;
+    Map? instantArguments;
     if (arguments != null) {
       instantArguments = new Map.from(arguments);
     }
@@ -157,7 +157,7 @@
   /// A utility method to time a synchronous [function]. Internally calls
   /// [function] bracketed by calls to [startSync] and [finishSync].
   static T timeSync<T>(String name, TimelineSyncFunction<T> function,
-      {Map arguments, Flow flow}) {
+      {Map? arguments, Flow? flow}) {
     startSync(name, arguments: arguments, flow: flow);
     try {
       return function();
@@ -172,7 +172,7 @@
   /// When run on the Dart VM, uses the same monotonic clock as the embedding
   /// API's `Dart_TimelineGetMicros`.
   static int get now => _getTraceClock();
-  static final List<_SyncBlock> _stack = new List<_SyncBlock>();
+  static final List<_SyncBlock?> _stack = [];
 }
 
 /// An asynchronous task on the timeline. An asynchronous task can have many
@@ -190,7 +190,7 @@
   /// If [filterKey] is provided, a property named `filterKey` will be inserted
   /// into the arguments of each event associated with this task. The
   /// `filterKey` will be set to the value of [filterKey].
-  TimelineTask({TimelineTask parent, String filterKey})
+  TimelineTask({TimelineTask? parent, String? filterKey})
       : _parent = parent,
         _filterKey = filterKey,
         _taskId = _getNextAsyncId() {}
@@ -205,33 +205,44 @@
   /// If [filterKey] is provided, a property named `filterKey` will be inserted
   /// into the arguments of each event associated with this task. The
   /// `filterKey` will be set to the value of [filterKey].
-  TimelineTask.withTaskId(int taskId, {String filterKey})
+  TimelineTask.withTaskId(int taskId, {String? filterKey})
       : _parent = null,
         _filterKey = filterKey,
         _taskId = taskId {
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(taskId, 'taskId');
   }
 
   /// Start a synchronous operation within this task named [name].
   /// Optionally takes a [Map] of [arguments].
-  void start(String name, {Map arguments}) {
+  void start(String name, {Map? arguments}) {
     if (!_hasTimeline) return;
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(name, 'name');
     var block = new _AsyncBlock._(name, _taskId);
     _stack.add(block);
-    block._start({
-      if (arguments != null) ...arguments,
-      if (_parent != null) 'parentId': _parent._taskId.toRadixString(16),
-      if (_filterKey != null) _kFilterKey: _filterKey,
-    });
+    // TODO(39115): Spurious error about collection literal ambiguity.
+    // TODO(39117): Spurious error about typing of `...?arguments`.
+    // TODO(39120): Spurious error even about `...arguments`.
+    // When these TODOs are done, we can use spread and if elements.
+    var map = <Object?, Object?>{};
+    if (arguments != null) {
+      for (var key in arguments.keys) {
+        map[key] = arguments[key];
+      }
+    }
+    if (_parent != null) map['parentId'] = _parent!._taskId.toRadixString(16);
+    if (_filterKey != null) map[_kFilterKey] = _filterKey;
+    block._start(map);
   }
 
   /// Emit an instant event for this task.
   /// Optionally takes a [Map] of [arguments].
-  void instant(String name, {Map arguments}) {
+  void instant(String name, {Map? arguments}) {
     if (!_hasTimeline) return;
+    // TODO: When NNBD is complete, delete the following line.
     ArgumentError.checkNotNull(name, 'name');
-    Map instantArguments;
+    Map? instantArguments;
     if (arguments != null) {
       instantArguments = new Map.from(arguments);
     }
@@ -245,7 +256,7 @@
 
   /// Finish the last synchronous operation that was started.
   /// Optionally takes a [Map] of [arguments].
-  void finish({Map arguments}) {
+  void finish({Map? arguments}) {
     if (!_hasTimeline) {
       return;
     }
@@ -274,8 +285,8 @@
   }
 
   static const String _kFilterKey = 'filterKey';
-  final TimelineTask _parent;
-  final String _filterKey;
+  final TimelineTask? _parent;
+  final String? _filterKey;
   final int _taskId;
   final List<_AsyncBlock> _stack = [];
 }
@@ -300,7 +311,7 @@
   }
 
   // Emit the finish event.
-  void _finish(Map arguments) {
+  void _finish(Map? arguments) {
     _reportTaskEvent(_taskId, 'e', category, name, _argumentsAsJson(arguments));
   }
 }
@@ -316,10 +327,10 @@
 
   /// An (optional) set of arguments which will be serialized to JSON and
   /// associated with this block.
-  Map _arguments;
+  Map? _arguments;
 
   /// An (optional) flow event associated with this block.
-  Flow _flow;
+  Flow? _flow;
 
   _SyncBlock._(this.name);
 
@@ -334,7 +345,7 @@
     // Report event to runtime.
     _reportTaskEvent(0, 'E', category, name, _argumentsAsJson(_arguments));
     if (_flow != null) {
-      _reportFlowEvent(category, "${_flow.id}", _flow._type, _flow.id,
+      _reportFlowEvent(category, "${_flow!.id}", _flow!._type, _flow!.id,
           _argumentsAsJson(null));
     }
   }
@@ -344,7 +355,7 @@
   }
 }
 
-String _argumentsAsJson(Map arguments) {
+String _argumentsAsJson(Map? arguments) {
   if ((arguments == null) || (arguments.length == 0)) {
     // Fast path no arguments. Avoid calling jsonEncode.
     return '{}';
diff --git a/sdk/lib/ffi/annotations.dart b/sdk/lib/ffi/annotations.dart
index 1466c35..f68e525 100644
--- a/sdk/lib/ffi/annotations.dart
+++ b/sdk/lib/ffi/annotations.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.6
-
 part of dart.ffi;
 
 class DartRepresentationOf {
diff --git a/sdk/lib/ffi/dynamic_library.dart b/sdk/lib/ffi/dynamic_library.dart
index 8cc5789..d11c945 100644
--- a/sdk/lib/ffi/dynamic_library.dart
+++ b/sdk/lib/ffi/dynamic_library.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.6
-
 part of dart.ffi;
 
 /// Represents a dynamically loaded C library.
@@ -31,7 +29,7 @@
   external Pointer<T> lookup<T extends NativeType>(String symbolName);
 
   /// Dynamic libraries are equal if they load the same library.
-  external bool operator ==(other);
+  external bool operator ==(Object other);
 
   /// The hash code for a DynamicLibrary only depends on the loaded library
   external int get hashCode;
diff --git a/sdk/lib/ffi/ffi.dart b/sdk/lib/ffi/ffi.dart
index 770d1bf..3b6e236 100644
--- a/sdk/lib/ffi/ffi.dart
+++ b/sdk/lib/ffi/ffi.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.6
-
 /**
  * Foreign Function Interface for interoperability with the C programming language.
  *
@@ -15,8 +13,8 @@
  */
 library dart.ffi;
 
-import 'dart:typed_data';
 import 'dart:isolate';
+import 'dart:typed_data';
 
 part "native_type.dart";
 part "annotations.dart";
@@ -30,7 +28,7 @@
 
 /// Represents a pointer into the native C memory corresponding to "NULL", e.g.
 /// a pointer with address 0.
-final Pointer<Null> nullptr = Pointer.fromAddress(0);
+final Pointer<Never> nullptr = Pointer.fromAddress(0);
 
 /// Represents a pointer into the native C memory. Cannot be extended.
 @pragma("vm:entry-point")
@@ -56,7 +54,7 @@
   /// [dynamic].
   external static Pointer<NativeFunction<T>> fromFunction<T extends Function>(
       @DartRepresentationOf("T") Function f,
-      [Object exceptionalReturn]);
+      [Object? exceptionalReturn]);
 
   /// Access to the raw pointer value.
   /// On 32-bit systems, the upper 32-bits of the result are 0.
@@ -69,9 +67,10 @@
   external Pointer<U> cast<U extends NativeType>();
 
   /// Equality for Pointers only depends on their address.
-  bool operator ==(other) {
-    if (other == null) return false;
-    return address == other.address;
+  bool operator ==(Object other) {
+    if (other is! Pointer) return false;
+    Pointer otherPointer = other;
+    return address == otherPointer.address;
   }
 
   /// The hash code for a Pointer only depends on its address.
diff --git a/sdk/lib/ffi/native_type.dart b/sdk/lib/ffi/native_type.dart
index 8496145..e319342 100644
--- a/sdk/lib/ffi/native_type.dart
+++ b/sdk/lib/ffi/native_type.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.6
-
 part of dart.ffi;
 
 /// [NativeType]'s subtypes represent a native type in C.
diff --git a/sdk/lib/ffi/struct.dart b/sdk/lib/ffi/struct.dart
index 5d807b0..c6605d8 100644
--- a/sdk/lib/ffi/struct.dart
+++ b/sdk/lib/ffi/struct.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.6
-
 part of dart.ffi;
 
 /// This class is extended to define structs.
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 77a36ed..04dcc3d 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -1,5 +1,3 @@
-// @dart = 2.6
-
 /**
  * HTML elements and other resources for web-based applications that need to
  * interact with the browser and the DOM (Document Object Model).
@@ -98,7 +96,7 @@
 /// On a successful result the native JS result will be converted to a Dart Map.
 /// See [convertNativeToDart_Dictionary]. On a rejected promise the error is
 /// forwarded without change.
-Future<Map<String, dynamic>> promiseToFutureAsMap(jsPromise) =>
+Future<Map<String, dynamic>?> promiseToFutureAsMap(jsPromise) =>
     promiseToFuture(jsPromise).then(convertNativeToDart_Dictionary);
 
 // Workaround for tags like <cite> that lack their own Element subclass --
@@ -117,8 +115,8 @@
   HtmlElement.created() : super.created();
 
   // From NoncedElement
-  String get nonce native;
-  set nonce(String value) native;
+  String? get nonce native;
+  set nonce(String? value) native;
 }
 
 /**
@@ -160,7 +158,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AbsoluteOrientationSensor([Map sensorOptions]) {
+  factory AbsoluteOrientationSensor([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return AbsoluteOrientationSensor._create_1(sensorOptions_1);
@@ -207,7 +205,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory Accelerometer([Map sensorOptions]) {
+  factory Accelerometer([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return Accelerometer._create_1(sensorOptions_1);
@@ -219,11 +217,11 @@
   static Accelerometer _create_2() =>
       JS('Accelerometer', 'new Accelerometer()');
 
-  num get x native;
+  num? get x native;
 
-  num get y native;
+  num? get y native;
 
-  num get z native;
+  num? get z native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -260,193 +258,193 @@
   static AccessibleNode _create_1() =>
       JS('AccessibleNode', 'new AccessibleNode()');
 
-  AccessibleNode get activeDescendant native;
+  AccessibleNode? get activeDescendant native;
 
-  set activeDescendant(AccessibleNode value) native;
+  set activeDescendant(AccessibleNode? value) native;
 
-  bool get atomic native;
+  bool? get atomic native;
 
-  set atomic(bool value) native;
+  set atomic(bool? value) native;
 
-  String get autocomplete native;
+  String? get autocomplete native;
 
-  set autocomplete(String value) native;
+  set autocomplete(String? value) native;
 
-  bool get busy native;
+  bool? get busy native;
 
-  set busy(bool value) native;
+  set busy(bool? value) native;
 
-  String get checked native;
+  String? get checked native;
 
-  set checked(String value) native;
+  set checked(String? value) native;
 
-  int get colCount native;
+  int? get colCount native;
 
-  set colCount(int value) native;
+  set colCount(int? value) native;
 
-  int get colIndex native;
+  int? get colIndex native;
 
-  set colIndex(int value) native;
+  set colIndex(int? value) native;
 
-  int get colSpan native;
+  int? get colSpan native;
 
-  set colSpan(int value) native;
+  set colSpan(int? value) native;
 
-  AccessibleNodeList get controls native;
+  AccessibleNodeList? get controls native;
 
-  set controls(AccessibleNodeList value) native;
+  set controls(AccessibleNodeList? value) native;
 
-  String get current native;
+  String? get current native;
 
-  set current(String value) native;
+  set current(String? value) native;
 
-  AccessibleNodeList get describedBy native;
+  AccessibleNodeList? get describedBy native;
 
-  set describedBy(AccessibleNodeList value) native;
+  set describedBy(AccessibleNodeList? value) native;
 
-  AccessibleNode get details native;
+  AccessibleNode? get details native;
 
-  set details(AccessibleNode value) native;
+  set details(AccessibleNode? value) native;
 
-  bool get disabled native;
+  bool? get disabled native;
 
-  set disabled(bool value) native;
+  set disabled(bool? value) native;
 
-  AccessibleNode get errorMessage native;
+  AccessibleNode? get errorMessage native;
 
-  set errorMessage(AccessibleNode value) native;
+  set errorMessage(AccessibleNode? value) native;
 
-  bool get expanded native;
+  bool? get expanded native;
 
-  set expanded(bool value) native;
+  set expanded(bool? value) native;
 
-  AccessibleNodeList get flowTo native;
+  AccessibleNodeList? get flowTo native;
 
-  set flowTo(AccessibleNodeList value) native;
+  set flowTo(AccessibleNodeList? value) native;
 
-  String get hasPopUp native;
+  String? get hasPopUp native;
 
-  set hasPopUp(String value) native;
+  set hasPopUp(String? value) native;
 
-  bool get hidden native;
+  bool? get hidden native;
 
-  set hidden(bool value) native;
+  set hidden(bool? value) native;
 
-  String get invalid native;
+  String? get invalid native;
 
-  set invalid(String value) native;
+  set invalid(String? value) native;
 
-  String get keyShortcuts native;
+  String? get keyShortcuts native;
 
-  set keyShortcuts(String value) native;
+  set keyShortcuts(String? value) native;
 
-  String get label native;
+  String? get label native;
 
-  set label(String value) native;
+  set label(String? value) native;
 
-  AccessibleNodeList get labeledBy native;
+  AccessibleNodeList? get labeledBy native;
 
-  set labeledBy(AccessibleNodeList value) native;
+  set labeledBy(AccessibleNodeList? value) native;
 
-  int get level native;
+  int? get level native;
 
-  set level(int value) native;
+  set level(int? value) native;
 
-  String get live native;
+  String? get live native;
 
-  set live(String value) native;
+  set live(String? value) native;
 
-  bool get modal native;
+  bool? get modal native;
 
-  set modal(bool value) native;
+  set modal(bool? value) native;
 
-  bool get multiline native;
+  bool? get multiline native;
 
-  set multiline(bool value) native;
+  set multiline(bool? value) native;
 
-  bool get multiselectable native;
+  bool? get multiselectable native;
 
-  set multiselectable(bool value) native;
+  set multiselectable(bool? value) native;
 
-  String get orientation native;
+  String? get orientation native;
 
-  set orientation(String value) native;
+  set orientation(String? value) native;
 
-  AccessibleNodeList get owns native;
+  AccessibleNodeList? get owns native;
 
-  set owns(AccessibleNodeList value) native;
+  set owns(AccessibleNodeList? value) native;
 
-  String get placeholder native;
+  String? get placeholder native;
 
-  set placeholder(String value) native;
+  set placeholder(String? value) native;
 
-  int get posInSet native;
+  int? get posInSet native;
 
-  set posInSet(int value) native;
+  set posInSet(int? value) native;
 
-  String get pressed native;
+  String? get pressed native;
 
-  set pressed(String value) native;
+  set pressed(String? value) native;
 
-  bool get readOnly native;
+  bool? get readOnly native;
 
-  set readOnly(bool value) native;
+  set readOnly(bool? value) native;
 
-  String get relevant native;
+  String? get relevant native;
 
-  set relevant(String value) native;
+  set relevant(String? value) native;
 
-  bool get required native;
+  bool? get required native;
 
-  set required(bool value) native;
+  set required(bool? value) native;
 
-  String get role native;
+  String? get role native;
 
-  set role(String value) native;
+  set role(String? value) native;
 
-  String get roleDescription native;
+  String? get roleDescription native;
 
-  set roleDescription(String value) native;
+  set roleDescription(String? value) native;
 
-  int get rowCount native;
+  int? get rowCount native;
 
-  set rowCount(int value) native;
+  set rowCount(int? value) native;
 
-  int get rowIndex native;
+  int? get rowIndex native;
 
-  set rowIndex(int value) native;
+  set rowIndex(int? value) native;
 
-  int get rowSpan native;
+  int? get rowSpan native;
 
-  set rowSpan(int value) native;
+  set rowSpan(int? value) native;
 
-  bool get selected native;
+  bool? get selected native;
 
-  set selected(bool value) native;
+  set selected(bool? value) native;
 
-  int get setSize native;
+  int? get setSize native;
 
-  set setSize(int value) native;
+  set setSize(int? value) native;
 
-  String get sort native;
+  String? get sort native;
 
-  set sort(String value) native;
+  set sort(String? value) native;
 
-  num get valueMax native;
+  num? get valueMax native;
 
-  set valueMax(num value) native;
+  set valueMax(num? value) native;
 
-  num get valueMin native;
+  num? get valueMin native;
 
-  set valueMin(num value) native;
+  set valueMin(num? value) native;
 
-  num get valueNow native;
+  num? get valueNow native;
 
-  set valueNow(num value) native;
+  set valueNow(num? value) native;
 
-  String get valueText native;
+  String? get valueText native;
 
-  set valueText(String value) native;
+  set valueText(String? value) native;
 
   void appendChild(AccessibleNode child) native;
 
@@ -477,7 +475,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AccessibleNodeList([List<AccessibleNode> nodes]) {
+  factory AccessibleNodeList([List<AccessibleNode>? nodes]) {
     if (nodes != null) {
       return AccessibleNodeList._create_1(nodes);
     }
@@ -494,9 +492,9 @@
 
   void __setter__(int index, AccessibleNode node) native;
 
-  void add(AccessibleNode node, AccessibleNode before) native;
+  void add(AccessibleNode node, AccessibleNode? before) native;
 
-  AccessibleNode item(int index) native;
+  AccessibleNode? item(int index) native;
 
   void remove(int index) native;
 }
@@ -511,7 +509,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AmbientLightSensor([Map sensorOptions]) {
+  factory AmbientLightSensor([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return AmbientLightSensor._create_1(sensorOptions_1);
@@ -523,7 +521,7 @@
   static AmbientLightSensor _create_2() =>
       JS('AmbientLightSensor', 'new AmbientLightSensor()');
 
-  num get illuminance native;
+  num? get illuminance native;
 }
 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -536,9 +534,12 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AnchorElement({String href}) {
-    AnchorElement e = JS('returns:AnchorElement;creates:AnchorElement;new:true',
-        '#.createElement(#)', document, "a");
+  factory AnchorElement({String? href}) {
+    AnchorElement e = JS<AnchorElement>(
+        'returns:AnchorElement;creates:AnchorElement;new:true',
+        '#.createElement(#)',
+        document,
+        "a");
     if (href != null) e.href = href;
     return e;
   }
@@ -637,7 +638,7 @@
       const EventStreamProvider<Event>('finish');
 
   factory Animation(
-      [AnimationEffectReadOnly effect, AnimationTimeline timeline]) {
+      [AnimationEffectReadOnly? effect, AnimationTimeline? timeline]) {
     if (timeline != null) {
       return Animation._create_1(effect, timeline);
     }
@@ -655,13 +656,13 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(document.body.animate)');
 
-  num get currentTime native;
+  num? get currentTime native;
 
-  set currentTime(num value) native;
+  set currentTime(num? value) native;
 
-  AnimationEffectReadOnly get effect native;
+  AnimationEffectReadOnly? get effect native;
 
-  set effect(AnimationEffectReadOnly value) native;
+  set effect(AnimationEffectReadOnly? value) native;
 
   Future<Animation> get finished =>
       promiseToFuture<Animation>(JS("", "#.finished", this));
@@ -679,11 +680,11 @@
   Future<Animation> get ready =>
       promiseToFuture<Animation>(JS("", "#.ready", this));
 
-  num get startTime native;
+  num? get startTime native;
 
-  set startTime(num value) native;
+  set startTime(num? value) native;
 
-  AnimationTimeline get timeline native;
+  AnimationTimeline? get timeline native;
 
   void cancel() native;
 
@@ -713,7 +714,7 @@
   AnimationEffectTimingReadOnly get timing native;
 
   Map getComputedTiming() {
-    return convertNativeToDart_Dictionary(_getComputedTiming_1());
+    return convertNativeToDart_Dictionary(_getComputedTiming_1())!;
   }
 
   @JSName('getComputedTiming')
@@ -745,9 +746,9 @@
   // Shadowing definition.
 
   @Returns('num|String|Null')
-  Object get duration native;
+  Object? get duration native;
 
-  set duration(Object value) native;
+  set duration(Object? value) native;
 
   // Shadowing definition.
 
@@ -794,7 +795,7 @@
 
   String get direction native;
 
-  Object get duration native;
+  Object? get duration native;
 
   String get easing native;
 
@@ -817,7 +818,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AnimationEvent(String type, [Map eventInitDict]) {
+  factory AnimationEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return AnimationEvent._create_1(type, eventInitDict_1);
@@ -844,7 +845,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AnimationPlaybackEvent(String type, [Map eventInitDict]) {
+  factory AnimationPlaybackEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return AnimationPlaybackEvent._create_1(type, eventInitDict_1);
@@ -859,9 +860,9 @@
   static AnimationPlaybackEvent _create_2(type) =>
       JS('AnimationPlaybackEvent', 'new AnimationPlaybackEvent(#)', type);
 
-  num get currentTime native;
+  num? get currentTime native;
 
-  num get timelineTime native;
+  num? get timelineTime native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -874,7 +875,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  num get currentTime native;
+  num? get currentTime native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1039,7 +1040,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ApplicationCacheErrorEvent(String type, [Map eventInitDict]) {
+  factory ApplicationCacheErrorEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return ApplicationCacheErrorEvent._create_1(type, eventInitDict_1);
@@ -1083,7 +1084,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AreaElement() => JS(
+  factory AreaElement() => JS<AreaElement>(
       'returns:AreaElement;creates:AreaElement;new:true',
       '#.createElement(#)',
       document,
@@ -1175,7 +1176,7 @@
 
 @Native("HTMLAudioElement")
 class AudioElement extends MediaElement {
-  factory AudioElement._([String src]) {
+  factory AudioElement._([String? src]) {
     if (src != null) {
       return AudioElement._create_1(src);
     }
@@ -1190,7 +1191,7 @@
    */
   AudioElement.created() : super.created();
 
-  factory AudioElement([String src]) => new AudioElement._(src);
+  factory AudioElement([String? src]) => new AudioElement._(src);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1245,8 +1246,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory BRElement() => JS('returns:BRElement;creates:BRElement;new:true',
-      '#.createElement(#)', document, "br");
+  factory BRElement() => JS<BRElement>(
+      'returns:BRElement;creates:BRElement;new:true',
+      '#.createElement(#)',
+      document,
+      "br");
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1345,7 +1349,7 @@
   }
 
   Future<BackgroundFetchRegistration> fetch(String id, Object requests,
-      [Map options]) {
+      [Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -1408,7 +1412,7 @@
       request,
       response);
 
-  _Response get response native;
+  _Response? get response native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1479,7 +1483,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory BaseElement() => JS(
+  factory BaseElement() => JS<BaseElement>(
       'returns:BaseElement;creates:BaseElement;new:true',
       '#.createElement(#)',
       document,
@@ -1529,7 +1533,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory BeforeInstallPromptEvent(String type, [Map eventInitDict]) {
+  factory BeforeInstallPromptEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return BeforeInstallPromptEvent._create_1(type, eventInitDict_1);
@@ -1546,7 +1550,7 @@
 
   List<String> get platforms native;
 
-  Future<Map<String, dynamic>> get userChoice =>
+  Future<Map<String, dynamic>?> get userChoice =>
       promiseToFutureAsMap(JS("", "#.userChoice", this));
 
   Future prompt() => promiseToFuture(JS("", "#.prompt()", this));
@@ -1583,9 +1587,9 @@
 
   String get type native;
 
-  Blob slice([int start, int end, String contentType]) native;
+  Blob slice([int? start, int? end, String? contentType]) native;
 
-  factory Blob(List blobParts, [String type, String endings]) {
+  factory Blob(List blobParts, [String? type, String? endings]) {
     // TODO: validate that blobParts is a JS Array and convert if not.
     // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
     // array to ArrayBuffer if it is a total view.
@@ -1612,7 +1616,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef void BlobCallback(Blob blob);
+typedef void BlobCallback(Blob? blob);
 // Copyright (c) 2012, 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.
@@ -1650,7 +1654,7 @@
 
   String get uuid native;
 
-  ByteData get value native;
+  ByteData? get value native;
 
   Future readValue() => promiseToFuture(JS("", "#.readValue()", this));
 
@@ -1803,7 +1807,7 @@
   static const EventStreamProvider<Event> unloadEvent =
       const EventStreamProvider<Event>('unload');
 
-  factory BodyElement() => JS(
+  factory BodyElement() => JS<BodyElement>(
       'returns:BodyElement;creates:BodyElement;new:true',
       '#.createElement(#)',
       document,
@@ -1907,7 +1911,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ButtonElement() => JS(
+  factory ButtonElement() => JS<ButtonElement>(
       'returns:ButtonElement;creates:ButtonElement;new:true',
       '#.createElement(#)',
       document,
@@ -1927,7 +1931,7 @@
 
   set disabled(bool value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   String get formAction native;
 
@@ -1950,7 +1954,7 @@
   set formTarget(String value) native;
 
   @Unstable()
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
@@ -2010,7 +2014,7 @@
 
   Future keys() => promiseToFuture(JS("", "#.keys()", this));
 
-  Future match(/*RequestInfo*/ request, [Map options]) {
+  Future match(/*RequestInfo*/ request, [Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -2097,9 +2101,12 @@
   static const EventStreamProvider<gl.ContextEvent> webGlContextRestoredEvent =
       const EventStreamProvider<gl.ContextEvent>('webglcontextrestored');
 
-  factory CanvasElement({int width, int height}) {
-    CanvasElement e = JS('returns:CanvasElement;creates:CanvasElement;new:true',
-        '#.createElement(#)', document, "canvas");
+  factory CanvasElement({int? width, int? height}) {
+    CanvasElement e = JS<CanvasElement>(
+        'returns:CanvasElement;creates:CanvasElement;new:true',
+        '#.createElement(#)',
+        document,
+        "canvas");
     if (width != null) e.width = width;
     if (height != null) e.height = height;
     return e;
@@ -2123,11 +2130,11 @@
 
   set width(int value) native;
 
-  MediaStream captureStream([num frameRate]) native;
+  MediaStream captureStream([num? frameRate]) native;
 
   @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
   @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
-  Object getContext(String contextId, [Map attributes]) {
+  Object? getContext(String contextId, [Map? attributes]) {
     if (attributes != null) {
       var attributes_1 = convertDartToNative_Dictionary(attributes);
       return _getContext_1(contextId, attributes_1);
@@ -2138,14 +2145,14 @@
   @JSName('getContext')
   @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
   @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
-  Object _getContext_1(contextId, attributes) native;
+  Object? _getContext_1(contextId, attributes) native;
   @JSName('getContext')
   @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
   @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
-  Object _getContext_2(contextId) native;
+  Object? _getContext_2(contextId) native;
 
   @JSName('toDataURL')
-  String _toDataUrl(String type, [arguments_OR_quality]) native;
+  String _toDataUrl(String? type, [arguments_OR_quality]) native;
 
   OffscreenCanvas transferControlToOffscreen() native;
 
@@ -2191,7 +2198,7 @@
     if (context == null) {
       context = getContext('experimental-webgl', options);
     }
-    return context;
+    return context as gl.RenderingContext;
   }
 
   /**
@@ -2235,13 +2242,13 @@
    *
    * * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canvas-todataurl) from W3C.
    */
-  String toDataUrl([String type = 'image/png', num quality]) =>
+  String toDataUrl([String type = 'image/png', num? quality]) =>
       _toDataUrl(type, quality);
 
   @JSName('toBlob')
-  void _toBlob(BlobCallback callback, [String type, Object arguments]) native;
+  void _toBlob(BlobCallback callback, [String? type, Object? arguments]) native;
 
-  Future<Blob> toBlob([String type, Object arguments]) {
+  Future<Blob> toBlob([String? type, Object? arguments]) {
     var completer = new Completer<Blob>();
     _toBlob((value) {
       completer.complete(value);
@@ -2370,9 +2377,9 @@
 
   @Creates('String|CanvasGradient|CanvasPattern')
   @Returns('String|CanvasGradient|CanvasPattern')
-  Object get fillStyle native;
+  Object? get fillStyle native;
 
-  set fillStyle(Object value) native;
+  set fillStyle(Object? value) native;
 
   String get filter native;
 
@@ -2443,9 +2450,9 @@
 
   @Creates('String|CanvasGradient|CanvasPattern')
   @Returns('String|CanvasGradient|CanvasPattern')
-  Object get strokeStyle native;
+  Object? get strokeStyle native;
 
-  set strokeStyle(Object value) native;
+  set strokeStyle(Object? value) native;
 
   String get textAlign native;
 
@@ -2455,7 +2462,7 @@
 
   set textBaseline(String value) native;
 
-  void addHitRegion([Map options]) {
+  void addHitRegion([Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       _addHitRegion_1(options_1);
@@ -2476,13 +2483,13 @@
 
   void clearRect(num x, num y, num width, num height) native;
 
-  void clip([path_OR_winding, String winding]) native;
+  void clip([path_OR_winding, String? winding]) native;
 
   @Creates('ImageData|=Object')
   ImageData createImageData(data_OR_imagedata_OR_sw,
-      [int sh_OR_sw,
+      [int? sh_OR_sw,
       imageDataColorSettings_OR_sh,
-      Map imageDataColorSettings]) {
+      Map? imageDataColorSettings]) {
     if ((data_OR_imagedata_OR_sw is ImageData) &&
         sh_OR_sw == null &&
         imageDataColorSettings_OR_sh == null &&
@@ -2539,26 +2546,26 @@
   _createImageData_3(int sw, sh, imageDataColorSettings) native;
   @JSName('createImageData')
   @Creates('ImageData|=Object')
-  _createImageData_4(data, sw, int sh) native;
+  _createImageData_4(data, sw, int? sh) native;
   @JSName('createImageData')
   @Creates('ImageData|=Object')
-  _createImageData_5(data, sw, int sh, imageDataColorSettings) native;
+  _createImageData_5(data, sw, int? sh, imageDataColorSettings) native;
 
   CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
 
-  CanvasPattern createPattern(Object image, String repetitionType) native;
+  CanvasPattern? createPattern(Object image, String repetitionType) native;
 
   CanvasGradient createRadialGradient(
       num x0, num y0, num r0, num x1, num y1, num r1) native;
 
-  void drawFocusIfNeeded(element_OR_path, [Element element]) native;
+  void drawFocusIfNeeded(element_OR_path, [Element? element]) native;
 
-  void fill([path_OR_winding, String winding]) native;
+  void fill([path_OR_winding, String? winding]) native;
 
   void fillRect(num x, num y, num width, num height) native;
 
   Map getContextAttributes() {
-    return convertNativeToDart_Dictionary(_getContextAttributes_1());
+    return convertNativeToDart_Dictionary(_getContextAttributes_1())!;
   }
 
   @JSName('getContextAttributes')
@@ -2578,15 +2585,15 @@
 
   bool isContextLost() native;
 
-  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String winding])
+  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String? winding])
       native;
 
-  bool isPointInStroke(path_OR_x, num x_OR_y, [num y]) native;
+  bool isPointInStroke(path_OR_x, num x_OR_y, [num? y]) native;
 
   TextMetrics measureText(String text) native;
 
   void putImageData(ImageData imagedata, int dx, int dy,
-      [int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight]) {
+      [int? dirtyX, int? dirtyY, int? dirtyWidth, int? dirtyHeight]) {
     if (dirtyX == null &&
         dirtyY == null &&
         dirtyWidth == null &&
@@ -2625,15 +2632,15 @@
 
   void scale(num x, num y) native;
 
-  void scrollPathIntoView([Path2D path]) native;
+  void scrollPathIntoView([Path2D? path]) native;
 
   void setTransform(num a, num b, num c, num d, num e, num f) native;
 
-  void stroke([Path2D path]) native;
+  void stroke([Path2D? path]) native;
 
   void strokeRect(num x, num y, num width, num height) native;
 
-  void strokeText(String text, num x, num y, [num maxWidth]) native;
+  void strokeText(String text, num x, num y, [num? maxWidth]) native;
 
   void transform(num a, num b, num c, num d, num e, num f) native;
 
@@ -2643,7 +2650,7 @@
 
   @JSName('arc')
   void _arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool anticlockwise) native;
+      bool? anticlockwise) native;
 
   void arcTo(num x1, num y1, num x2, num y2, num radius) native;
 
@@ -2653,7 +2660,7 @@
   void closePath() native;
 
   void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool anticlockwise) native;
+      num startAngle, num endAngle, bool? anticlockwise) native;
 
   void lineTo(num x, num y) native;
 
@@ -2754,7 +2761,7 @@
    * from the WHATWG.
    */
   void drawImageToRect(CanvasImageSource source, Rectangle destRect,
-      {Rectangle sourceRect}) {
+      {Rectangle? sourceRect}) {
     if (sourceRect == null) {
       drawImageScaled(
           source, destRect.left, destRect.top, destRect.width, destRect.height);
@@ -2945,7 +2952,7 @@
    * [CanvasRenderingContext2D.textBaseLine] properties are also applied to the
    * drawn text.
    */
-  void fillText(String text, num x, num y, [num maxWidth]) {
+  void fillText(String text, num x, num y, [num? maxWidth]) {
     if (maxWidth != null) {
       JS('void', '#.fillText(#, #, #, #)', this, text, x, y, maxWidth);
     } else {
@@ -2993,9 +3000,9 @@
 
   // From NonDocumentTypeChildNode
 
-  Element get nextElementSibling native;
+  Element? get nextElementSibling native;
 
-  Element get previousElementSibling native;
+  Element? get previousElementSibling native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3032,7 +3039,7 @@
 
   String get url native;
 
-  void postMessage(Object message, [List<Object> transfer]) native;
+  void postMessage(Object message, [List<Object>? transfer]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3049,7 +3056,7 @@
 
   Future get(String id) => promiseToFuture(JS("", "#.get(#)", this, id));
 
-  Future<List<dynamic>> matchAll([Map options]) {
+  Future<List<dynamic>> matchAll([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -3072,7 +3079,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ClipboardEvent(String type, [Map eventInitDict]) {
+  factory ClipboardEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return ClipboardEvent._create_1(type, eventInitDict_1);
@@ -3084,7 +3091,7 @@
   static ClipboardEvent _create_2(type) =>
       JS('ClipboardEvent', 'new ClipboardEvent(#)', type);
 
-  DataTransfer get clipboardData native;
+  DataTransfer? get clipboardData native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3097,7 +3104,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory CloseEvent(String type, [Map eventInitDict]) {
+  factory CloseEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return CloseEvent._create_1(type, eventInitDict_1);
@@ -3121,7 +3128,7 @@
 
 @Native("Comment")
 class Comment extends CharacterData {
-  factory Comment([String data]) {
+  factory Comment([String? data]) {
     return JS('returns:Comment;depends:none;effects:none;new:true',
         '#.createComment(#)', document, data == null ? "" : data);
   }
@@ -3141,13 +3148,14 @@
   factory CompositionEvent(String type,
       {bool canBubble: false,
       bool cancelable: false,
-      Window view,
-      String data,
-      String locale}) {
+      Window? view,
+      String? data,
+      String? locale}) {
     if (view == null) {
       view = window;
     }
-    CompositionEvent e = document._createEvent("CompositionEvent");
+    CompositionEvent e =
+        document._createEvent("CompositionEvent") as CompositionEvent;
 
     if (Device.isFirefox) {
       // Firefox requires the locale parameter that isn't supported elsewhere.
@@ -3160,7 +3168,7 @@
     return e;
   }
 
-  factory CompositionEvent._(String type, [Map eventInitDict]) {
+  factory CompositionEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return CompositionEvent._create_1(type, eventInitDict_1);
@@ -3175,8 +3183,8 @@
   String get data native;
 
   @JSName('initCompositionEvent')
-  void _initCompositionEvent(String type, bool bubbles, bool cancelable,
-      Window view, String data) native;
+  void _initCompositionEvent(String? type, bool? bubbles, bool? cancelable,
+      Window? view, String? data) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3190,7 +3198,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ContentElement() => document.createElement("content");
+  factory ContentElement() =>
+      document.createElement("content") as ContentElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3205,7 +3214,7 @@
 
   set select(String value) native;
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> getDistributedNodes() native;
 }
@@ -3220,7 +3229,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Future getAll([Map options]) {
+  Future getAll([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -3228,7 +3237,7 @@
     return promiseToFuture(JS("", "#.getAll(#)", this, options_dict));
   }
 
-  Future set(String name, String value, [Map options]) {
+  Future set(String name, String value, [Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -3250,17 +3259,17 @@
 
   num get accuracy native;
 
-  num get altitude native;
+  num? get altitude native;
 
-  num get altitudeAccuracy native;
+  num? get altitudeAccuracy native;
 
-  num get heading native;
+  num? get heading native;
 
   num get latitude native;
 
   num get longitude native;
 
-  num get speed native;
+  num? get speed native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3304,7 +3313,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Future create([Map options]) {
+  Future create([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -3312,7 +3321,7 @@
     return promiseToFuture(JS("", "#.create(#)", this, options_dict));
   }
 
-  Future get([Map options]) {
+  Future get([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -3515,7 +3524,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  @Returns('_CssRuleList|Null')
+  @Returns('_CssRuleList')
   @Creates('_CssRuleList')
   List<CssRule> get cssRules native;
 
@@ -3534,11 +3543,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  num get intrinsicHeight native;
+  num? get intrinsicHeight native;
 
-  num get intrinsicRatio native;
+  num? get intrinsicRatio native;
 
-  num get intrinsicWidth native;
+  num? get intrinsicWidth native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3585,7 +3594,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  @Returns('_CssRuleList|Null')
+  @Returns('_CssRuleList')
   @Creates('_CssRuleList')
   List<CssRule> get cssRules native;
 
@@ -3599,7 +3608,7 @@
 
   void deleteRule(String select) native;
 
-  CssKeyframeRule findRule(String select) native;
+  CssKeyframeRule? findRule(String select) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3633,7 +3642,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory CssMatrixComponent(DomMatrixReadOnly matrix, [Map options]) {
+  factory CssMatrixComponent(DomMatrixReadOnly matrix, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return CssMatrixComponent._create_1(matrix, options_1);
@@ -3788,7 +3797,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory CssRotation(angleValue_OR_x, [num y, num z, CssNumericValue angle]) {
+  factory CssRotation(angleValue_OR_x,
+      [num? y, num? z, CssNumericValue? angle]) {
     if ((angleValue_OR_x is CssNumericValue) &&
         y == null &&
         z == null &&
@@ -3861,9 +3871,9 @@
 
   set cssText(String value) native;
 
-  CssRule get parentRule native;
+  CssRule? get parentRule native;
 
-  CssStyleSheet get parentStyleSheet native;
+  CssStyleSheet? get parentStyleSheet native;
 
   int get type native;
 }
@@ -3878,7 +3888,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory CssScale(num x, num y, [num z]) {
+  factory CssScale(num x, num y, [num? z]) {
     if ((y is num) && (x is num) && z == null) {
       return CssScale._create_1(x, y);
     }
@@ -3978,13 +3988,13 @@
     return JS('bool', '# in #', propertyName, this);
   }
 
-  void setProperty(String propertyName, String value, [String priority]) {
+  void setProperty(String propertyName, String? value, [String? priority]) {
     return _setPropertyHelper(
         _browserPropertyName(propertyName), value, priority);
   }
 
   String _browserPropertyName(String propertyName) {
-    String name = _readCache(propertyName);
+    String? name = _readCache(propertyName);
     if (name is String) return name;
     name = _supportedBrowserPropertyName(propertyName);
     _writeCache(propertyName, name);
@@ -4004,7 +4014,7 @@
   }
 
   static final _propertyCache = JS('', '{}');
-  static String _readCache(String key) =>
+  static String? _readCache(String key) =>
       JS('String|Null', '#[#]', _propertyCache, key);
   static void _writeCache(String key, String value) {
     JS('void', '#[#] = #', _propertyCache, key, value);
@@ -4019,8 +4029,8 @@
         replacedMs);
   }
 
-  void _setPropertyHelper(String propertyName, String value,
-      [String priority]) {
+  void _setPropertyHelper(String propertyName, String? value,
+      [String? priority]) {
     if (value == null) value = '';
     if (priority == null) priority = '';
     JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
@@ -4030,7 +4040,7 @@
    * Checks to see if CSS Transitions are supported.
    */
   static bool get supportsTransitions {
-    return document.body.style.supportsProperty('transition');
+    return document.body!.style.supportsProperty('transition');
   }
 
   // To suppress missing implicit constructor warnings.
@@ -4040,7 +4050,7 @@
 
   String get cssFloat native;
 
-  set cssFloat(String value) native;
+  set cssFloat(String? value) native;
 
   String get cssText native;
 
@@ -4048,7 +4058,7 @@
 
   int get length native;
 
-  CssRule get parentRule native;
+  CssRule? get parentRule native;
 
   String getPropertyPriority(String property) native;
 
@@ -4063,7 +4073,7 @@
   String get background => this._background;
 
   /** Sets the value of "background" */
-  set background(String value) {
+  set background(String? value) {
     _background = value == null ? '' : value;
   }
 
@@ -4078,7 +4088,7 @@
   String get backgroundAttachment => this._backgroundAttachment;
 
   /** Sets the value of "background-attachment" */
-  set backgroundAttachment(String value) {
+  set backgroundAttachment(String? value) {
     _backgroundAttachment = value == null ? '' : value;
   }
 
@@ -4093,7 +4103,7 @@
   String get backgroundColor => this._backgroundColor;
 
   /** Sets the value of "background-color" */
-  set backgroundColor(String value) {
+  set backgroundColor(String? value) {
     _backgroundColor = value == null ? '' : value;
   }
 
@@ -4108,7 +4118,7 @@
   String get backgroundImage => this._backgroundImage;
 
   /** Sets the value of "background-image" */
-  set backgroundImage(String value) {
+  set backgroundImage(String? value) {
     _backgroundImage = value == null ? '' : value;
   }
 
@@ -4123,7 +4133,7 @@
   String get backgroundPosition => this._backgroundPosition;
 
   /** Sets the value of "background-position" */
-  set backgroundPosition(String value) {
+  set backgroundPosition(String? value) {
     _backgroundPosition = value == null ? '' : value;
   }
 
@@ -4138,7 +4148,7 @@
   String get backgroundRepeat => this._backgroundRepeat;
 
   /** Sets the value of "background-repeat" */
-  set backgroundRepeat(String value) {
+  set backgroundRepeat(String? value) {
     _backgroundRepeat = value == null ? '' : value;
   }
 
@@ -4153,7 +4163,7 @@
   String get border => this._border;
 
   /** Sets the value of "border" */
-  set border(String value) {
+  set border(String? value) {
     _border = value == null ? '' : value;
   }
 
@@ -4168,7 +4178,7 @@
   String get borderBottom => this._borderBottom;
 
   /** Sets the value of "border-bottom" */
-  set borderBottom(String value) {
+  set borderBottom(String? value) {
     _borderBottom = value == null ? '' : value;
   }
 
@@ -4183,7 +4193,7 @@
   String get borderBottomColor => this._borderBottomColor;
 
   /** Sets the value of "border-bottom-color" */
-  set borderBottomColor(String value) {
+  set borderBottomColor(String? value) {
     _borderBottomColor = value == null ? '' : value;
   }
 
@@ -4198,7 +4208,7 @@
   String get borderBottomStyle => this._borderBottomStyle;
 
   /** Sets the value of "border-bottom-style" */
-  set borderBottomStyle(String value) {
+  set borderBottomStyle(String? value) {
     _borderBottomStyle = value == null ? '' : value;
   }
 
@@ -4213,7 +4223,7 @@
   String get borderBottomWidth => this._borderBottomWidth;
 
   /** Sets the value of "border-bottom-width" */
-  set borderBottomWidth(String value) {
+  set borderBottomWidth(String? value) {
     _borderBottomWidth = value == null ? '' : value;
   }
 
@@ -4228,7 +4238,7 @@
   String get borderCollapse => this._borderCollapse;
 
   /** Sets the value of "border-collapse" */
-  set borderCollapse(String value) {
+  set borderCollapse(String? value) {
     _borderCollapse = value == null ? '' : value;
   }
 
@@ -4243,7 +4253,7 @@
   String get borderColor => this._borderColor;
 
   /** Sets the value of "border-color" */
-  set borderColor(String value) {
+  set borderColor(String? value) {
     _borderColor = value == null ? '' : value;
   }
 
@@ -4258,7 +4268,7 @@
   String get borderLeft => this._borderLeft;
 
   /** Sets the value of "border-left" */
-  set borderLeft(String value) {
+  set borderLeft(String? value) {
     _borderLeft = value == null ? '' : value;
   }
 
@@ -4273,7 +4283,7 @@
   String get borderLeftColor => this._borderLeftColor;
 
   /** Sets the value of "border-left-color" */
-  set borderLeftColor(String value) {
+  set borderLeftColor(String? value) {
     _borderLeftColor = value == null ? '' : value;
   }
 
@@ -4288,7 +4298,7 @@
   String get borderLeftStyle => this._borderLeftStyle;
 
   /** Sets the value of "border-left-style" */
-  set borderLeftStyle(String value) {
+  set borderLeftStyle(String? value) {
     _borderLeftStyle = value == null ? '' : value;
   }
 
@@ -4303,7 +4313,7 @@
   String get borderLeftWidth => this._borderLeftWidth;
 
   /** Sets the value of "border-left-width" */
-  set borderLeftWidth(String value) {
+  set borderLeftWidth(String? value) {
     _borderLeftWidth = value == null ? '' : value;
   }
 
@@ -4318,7 +4328,7 @@
   String get borderRight => this._borderRight;
 
   /** Sets the value of "border-right" */
-  set borderRight(String value) {
+  set borderRight(String? value) {
     _borderRight = value == null ? '' : value;
   }
 
@@ -4333,7 +4343,7 @@
   String get borderRightColor => this._borderRightColor;
 
   /** Sets the value of "border-right-color" */
-  set borderRightColor(String value) {
+  set borderRightColor(String? value) {
     _borderRightColor = value == null ? '' : value;
   }
 
@@ -4348,7 +4358,7 @@
   String get borderRightStyle => this._borderRightStyle;
 
   /** Sets the value of "border-right-style" */
-  set borderRightStyle(String value) {
+  set borderRightStyle(String? value) {
     _borderRightStyle = value == null ? '' : value;
   }
 
@@ -4363,7 +4373,7 @@
   String get borderRightWidth => this._borderRightWidth;
 
   /** Sets the value of "border-right-width" */
-  set borderRightWidth(String value) {
+  set borderRightWidth(String? value) {
     _borderRightWidth = value == null ? '' : value;
   }
 
@@ -4378,7 +4388,7 @@
   String get borderSpacing => this._borderSpacing;
 
   /** Sets the value of "border-spacing" */
-  set borderSpacing(String value) {
+  set borderSpacing(String? value) {
     _borderSpacing = value == null ? '' : value;
   }
 
@@ -4393,7 +4403,7 @@
   String get borderStyle => this._borderStyle;
 
   /** Sets the value of "border-style" */
-  set borderStyle(String value) {
+  set borderStyle(String? value) {
     _borderStyle = value == null ? '' : value;
   }
 
@@ -4408,7 +4418,7 @@
   String get borderTop => this._borderTop;
 
   /** Sets the value of "border-top" */
-  set borderTop(String value) {
+  set borderTop(String? value) {
     _borderTop = value == null ? '' : value;
   }
 
@@ -4423,7 +4433,7 @@
   String get borderTopColor => this._borderTopColor;
 
   /** Sets the value of "border-top-color" */
-  set borderTopColor(String value) {
+  set borderTopColor(String? value) {
     _borderTopColor = value == null ? '' : value;
   }
 
@@ -4438,7 +4448,7 @@
   String get borderTopStyle => this._borderTopStyle;
 
   /** Sets the value of "border-top-style" */
-  set borderTopStyle(String value) {
+  set borderTopStyle(String? value) {
     _borderTopStyle = value == null ? '' : value;
   }
 
@@ -4453,7 +4463,7 @@
   String get borderTopWidth => this._borderTopWidth;
 
   /** Sets the value of "border-top-width" */
-  set borderTopWidth(String value) {
+  set borderTopWidth(String? value) {
     _borderTopWidth = value == null ? '' : value;
   }
 
@@ -4468,7 +4478,7 @@
   String get borderWidth => this._borderWidth;
 
   /** Sets the value of "border-width" */
-  set borderWidth(String value) {
+  set borderWidth(String? value) {
     _borderWidth = value == null ? '' : value;
   }
 
@@ -4483,7 +4493,7 @@
   String get bottom => this._bottom;
 
   /** Sets the value of "bottom" */
-  set bottom(String value) {
+  set bottom(String? value) {
     _bottom = value == null ? '' : value;
   }
 
@@ -4498,7 +4508,7 @@
   String get captionSide => this._captionSide;
 
   /** Sets the value of "caption-side" */
-  set captionSide(String value) {
+  set captionSide(String? value) {
     _captionSide = value == null ? '' : value;
   }
 
@@ -4513,7 +4523,7 @@
   String get clear => this._clear;
 
   /** Sets the value of "clear" */
-  set clear(String value) {
+  set clear(String? value) {
     _clear = value == null ? '' : value;
   }
 
@@ -4528,7 +4538,7 @@
   String get clip => this._clip;
 
   /** Sets the value of "clip" */
-  set clip(String value) {
+  set clip(String? value) {
     _clip = value == null ? '' : value;
   }
 
@@ -4543,7 +4553,7 @@
   String get color => this._color;
 
   /** Sets the value of "color" */
-  set color(String value) {
+  set color(String? value) {
     _color = value == null ? '' : value;
   }
 
@@ -4558,7 +4568,7 @@
   String get content => this._content;
 
   /** Sets the value of "content" */
-  set content(String value) {
+  set content(String? value) {
     _content = value == null ? '' : value;
   }
 
@@ -4573,7 +4583,7 @@
   String get cursor => this._cursor;
 
   /** Sets the value of "cursor" */
-  set cursor(String value) {
+  set cursor(String? value) {
     _cursor = value == null ? '' : value;
   }
 
@@ -4588,7 +4598,7 @@
   String get direction => this._direction;
 
   /** Sets the value of "direction" */
-  set direction(String value) {
+  set direction(String? value) {
     _direction = value == null ? '' : value;
   }
 
@@ -4603,7 +4613,7 @@
   String get display => this._display;
 
   /** Sets the value of "display" */
-  set display(String value) {
+  set display(String? value) {
     _display = value == null ? '' : value;
   }
 
@@ -4618,7 +4628,7 @@
   String get emptyCells => this._emptyCells;
 
   /** Sets the value of "empty-cells" */
-  set emptyCells(String value) {
+  set emptyCells(String? value) {
     _emptyCells = value == null ? '' : value;
   }
 
@@ -4633,7 +4643,7 @@
   String get font => this._font;
 
   /** Sets the value of "font" */
-  set font(String value) {
+  set font(String? value) {
     _font = value == null ? '' : value;
   }
 
@@ -4648,7 +4658,7 @@
   String get fontFamily => this._fontFamily;
 
   /** Sets the value of "font-family" */
-  set fontFamily(String value) {
+  set fontFamily(String? value) {
     _fontFamily = value == null ? '' : value;
   }
 
@@ -4663,7 +4673,7 @@
   String get fontSize => this._fontSize;
 
   /** Sets the value of "font-size" */
-  set fontSize(String value) {
+  set fontSize(String? value) {
     _fontSize = value == null ? '' : value;
   }
 
@@ -4678,7 +4688,7 @@
   String get fontStyle => this._fontStyle;
 
   /** Sets the value of "font-style" */
-  set fontStyle(String value) {
+  set fontStyle(String? value) {
     _fontStyle = value == null ? '' : value;
   }
 
@@ -4693,7 +4703,7 @@
   String get fontVariant => this._fontVariant;
 
   /** Sets the value of "font-variant" */
-  set fontVariant(String value) {
+  set fontVariant(String? value) {
     _fontVariant = value == null ? '' : value;
   }
 
@@ -4708,7 +4718,7 @@
   String get fontWeight => this._fontWeight;
 
   /** Sets the value of "font-weight" */
-  set fontWeight(String value) {
+  set fontWeight(String? value) {
     _fontWeight = value == null ? '' : value;
   }
 
@@ -4723,7 +4733,7 @@
   String get height => this._height;
 
   /** Sets the value of "height" */
-  set height(String value) {
+  set height(String? value) {
     _height = value == null ? '' : value;
   }
 
@@ -4738,7 +4748,7 @@
   String get left => this._left;
 
   /** Sets the value of "left" */
-  set left(String value) {
+  set left(String? value) {
     _left = value == null ? '' : value;
   }
 
@@ -4753,7 +4763,7 @@
   String get letterSpacing => this._letterSpacing;
 
   /** Sets the value of "letter-spacing" */
-  set letterSpacing(String value) {
+  set letterSpacing(String? value) {
     _letterSpacing = value == null ? '' : value;
   }
 
@@ -4768,7 +4778,7 @@
   String get lineHeight => this._lineHeight;
 
   /** Sets the value of "line-height" */
-  set lineHeight(String value) {
+  set lineHeight(String? value) {
     _lineHeight = value == null ? '' : value;
   }
 
@@ -4783,7 +4793,7 @@
   String get listStyle => this._listStyle;
 
   /** Sets the value of "list-style" */
-  set listStyle(String value) {
+  set listStyle(String? value) {
     _listStyle = value == null ? '' : value;
   }
 
@@ -4798,7 +4808,7 @@
   String get listStyleImage => this._listStyleImage;
 
   /** Sets the value of "list-style-image" */
-  set listStyleImage(String value) {
+  set listStyleImage(String? value) {
     _listStyleImage = value == null ? '' : value;
   }
 
@@ -4813,7 +4823,7 @@
   String get listStylePosition => this._listStylePosition;
 
   /** Sets the value of "list-style-position" */
-  set listStylePosition(String value) {
+  set listStylePosition(String? value) {
     _listStylePosition = value == null ? '' : value;
   }
 
@@ -4828,7 +4838,7 @@
   String get listStyleType => this._listStyleType;
 
   /** Sets the value of "list-style-type" */
-  set listStyleType(String value) {
+  set listStyleType(String? value) {
     _listStyleType = value == null ? '' : value;
   }
 
@@ -4843,7 +4853,7 @@
   String get margin => this._margin;
 
   /** Sets the value of "margin" */
-  set margin(String value) {
+  set margin(String? value) {
     _margin = value == null ? '' : value;
   }
 
@@ -4858,7 +4868,7 @@
   String get marginBottom => this._marginBottom;
 
   /** Sets the value of "margin-bottom" */
-  set marginBottom(String value) {
+  set marginBottom(String? value) {
     _marginBottom = value == null ? '' : value;
   }
 
@@ -4873,7 +4883,7 @@
   String get marginLeft => this._marginLeft;
 
   /** Sets the value of "margin-left" */
-  set marginLeft(String value) {
+  set marginLeft(String? value) {
     _marginLeft = value == null ? '' : value;
   }
 
@@ -4888,7 +4898,7 @@
   String get marginRight => this._marginRight;
 
   /** Sets the value of "margin-right" */
-  set marginRight(String value) {
+  set marginRight(String? value) {
     _marginRight = value == null ? '' : value;
   }
 
@@ -4903,7 +4913,7 @@
   String get marginTop => this._marginTop;
 
   /** Sets the value of "margin-top" */
-  set marginTop(String value) {
+  set marginTop(String? value) {
     _marginTop = value == null ? '' : value;
   }
 
@@ -4918,7 +4928,7 @@
   String get maxHeight => this._maxHeight;
 
   /** Sets the value of "max-height" */
-  set maxHeight(String value) {
+  set maxHeight(String? value) {
     _maxHeight = value == null ? '' : value;
   }
 
@@ -4933,7 +4943,7 @@
   String get maxWidth => this._maxWidth;
 
   /** Sets the value of "max-width" */
-  set maxWidth(String value) {
+  set maxWidth(String? value) {
     _maxWidth = value == null ? '' : value;
   }
 
@@ -4948,7 +4958,7 @@
   String get minHeight => this._minHeight;
 
   /** Sets the value of "min-height" */
-  set minHeight(String value) {
+  set minHeight(String? value) {
     _minHeight = value == null ? '' : value;
   }
 
@@ -4963,7 +4973,7 @@
   String get minWidth => this._minWidth;
 
   /** Sets the value of "min-width" */
-  set minWidth(String value) {
+  set minWidth(String? value) {
     _minWidth = value == null ? '' : value;
   }
 
@@ -4978,7 +4988,7 @@
   String get outline => this._outline;
 
   /** Sets the value of "outline" */
-  set outline(String value) {
+  set outline(String? value) {
     _outline = value == null ? '' : value;
   }
 
@@ -4993,7 +5003,7 @@
   String get outlineColor => this._outlineColor;
 
   /** Sets the value of "outline-color" */
-  set outlineColor(String value) {
+  set outlineColor(String? value) {
     _outlineColor = value == null ? '' : value;
   }
 
@@ -5008,7 +5018,7 @@
   String get outlineStyle => this._outlineStyle;
 
   /** Sets the value of "outline-style" */
-  set outlineStyle(String value) {
+  set outlineStyle(String? value) {
     _outlineStyle = value == null ? '' : value;
   }
 
@@ -5023,7 +5033,7 @@
   String get outlineWidth => this._outlineWidth;
 
   /** Sets the value of "outline-width" */
-  set outlineWidth(String value) {
+  set outlineWidth(String? value) {
     _outlineWidth = value == null ? '' : value;
   }
 
@@ -5038,7 +5048,7 @@
   String get overflow => this._overflow;
 
   /** Sets the value of "overflow" */
-  set overflow(String value) {
+  set overflow(String? value) {
     _overflow = value == null ? '' : value;
   }
 
@@ -5053,7 +5063,7 @@
   String get padding => this._padding;
 
   /** Sets the value of "padding" */
-  set padding(String value) {
+  set padding(String? value) {
     _padding = value == null ? '' : value;
   }
 
@@ -5068,7 +5078,7 @@
   String get paddingBottom => this._paddingBottom;
 
   /** Sets the value of "padding-bottom" */
-  set paddingBottom(String value) {
+  set paddingBottom(String? value) {
     _paddingBottom = value == null ? '' : value;
   }
 
@@ -5083,7 +5093,7 @@
   String get paddingLeft => this._paddingLeft;
 
   /** Sets the value of "padding-left" */
-  set paddingLeft(String value) {
+  set paddingLeft(String? value) {
     _paddingLeft = value == null ? '' : value;
   }
 
@@ -5098,7 +5108,7 @@
   String get paddingRight => this._paddingRight;
 
   /** Sets the value of "padding-right" */
-  set paddingRight(String value) {
+  set paddingRight(String? value) {
     _paddingRight = value == null ? '' : value;
   }
 
@@ -5113,7 +5123,7 @@
   String get paddingTop => this._paddingTop;
 
   /** Sets the value of "padding-top" */
-  set paddingTop(String value) {
+  set paddingTop(String? value) {
     _paddingTop = value == null ? '' : value;
   }
 
@@ -5128,7 +5138,7 @@
   String get pageBreakAfter => this._pageBreakAfter;
 
   /** Sets the value of "page-break-after" */
-  set pageBreakAfter(String value) {
+  set pageBreakAfter(String? value) {
     _pageBreakAfter = value == null ? '' : value;
   }
 
@@ -5143,7 +5153,7 @@
   String get pageBreakBefore => this._pageBreakBefore;
 
   /** Sets the value of "page-break-before" */
-  set pageBreakBefore(String value) {
+  set pageBreakBefore(String? value) {
     _pageBreakBefore = value == null ? '' : value;
   }
 
@@ -5158,7 +5168,7 @@
   String get pageBreakInside => this._pageBreakInside;
 
   /** Sets the value of "page-break-inside" */
-  set pageBreakInside(String value) {
+  set pageBreakInside(String? value) {
     _pageBreakInside = value == null ? '' : value;
   }
 
@@ -5173,7 +5183,7 @@
   String get position => this._position;
 
   /** Sets the value of "position" */
-  set position(String value) {
+  set position(String? value) {
     _position = value == null ? '' : value;
   }
 
@@ -5188,7 +5198,7 @@
   String get quotes => this._quotes;
 
   /** Sets the value of "quotes" */
-  set quotes(String value) {
+  set quotes(String? value) {
     _quotes = value == null ? '' : value;
   }
 
@@ -5203,7 +5213,7 @@
   String get right => this._right;
 
   /** Sets the value of "right" */
-  set right(String value) {
+  set right(String? value) {
     _right = value == null ? '' : value;
   }
 
@@ -5218,7 +5228,7 @@
   String get tableLayout => this._tableLayout;
 
   /** Sets the value of "table-layout" */
-  set tableLayout(String value) {
+  set tableLayout(String? value) {
     _tableLayout = value == null ? '' : value;
   }
 
@@ -5233,7 +5243,7 @@
   String get textAlign => this._textAlign;
 
   /** Sets the value of "text-align" */
-  set textAlign(String value) {
+  set textAlign(String? value) {
     _textAlign = value == null ? '' : value;
   }
 
@@ -5248,7 +5258,7 @@
   String get textDecoration => this._textDecoration;
 
   /** Sets the value of "text-decoration" */
-  set textDecoration(String value) {
+  set textDecoration(String? value) {
     _textDecoration = value == null ? '' : value;
   }
 
@@ -5263,7 +5273,7 @@
   String get textIndent => this._textIndent;
 
   /** Sets the value of "text-indent" */
-  set textIndent(String value) {
+  set textIndent(String? value) {
     _textIndent = value == null ? '' : value;
   }
 
@@ -5278,7 +5288,7 @@
   String get textTransform => this._textTransform;
 
   /** Sets the value of "text-transform" */
-  set textTransform(String value) {
+  set textTransform(String? value) {
     _textTransform = value == null ? '' : value;
   }
 
@@ -5293,7 +5303,7 @@
   String get top => this._top;
 
   /** Sets the value of "top" */
-  set top(String value) {
+  set top(String? value) {
     _top = value == null ? '' : value;
   }
 
@@ -5308,7 +5318,7 @@
   String get unicodeBidi => this._unicodeBidi;
 
   /** Sets the value of "unicode-bidi" */
-  set unicodeBidi(String value) {
+  set unicodeBidi(String? value) {
     _unicodeBidi = value == null ? '' : value;
   }
 
@@ -5323,7 +5333,7 @@
   String get verticalAlign => this._verticalAlign;
 
   /** Sets the value of "vertical-align" */
-  set verticalAlign(String value) {
+  set verticalAlign(String? value) {
     _verticalAlign = value == null ? '' : value;
   }
 
@@ -5338,7 +5348,7 @@
   String get visibility => this._visibility;
 
   /** Sets the value of "visibility" */
-  set visibility(String value) {
+  set visibility(String? value) {
     _visibility = value == null ? '' : value;
   }
 
@@ -5353,7 +5363,7 @@
   String get whiteSpace => this._whiteSpace;
 
   /** Sets the value of "white-space" */
-  set whiteSpace(String value) {
+  set whiteSpace(String? value) {
     _whiteSpace = value == null ? '' : value;
   }
 
@@ -5368,7 +5378,7 @@
   String get width => this._width;
 
   /** Sets the value of "width" */
-  set width(String value) {
+  set width(String? value) {
     _width = value == null ? '' : value;
   }
 
@@ -5383,7 +5393,7 @@
   String get wordSpacing => this._wordSpacing;
 
   /** Sets the value of "word-spacing" */
-  set wordSpacing(String value) {
+  set wordSpacing(String? value) {
     _wordSpacing = value == null ? '' : value;
   }
 
@@ -5398,7 +5408,7 @@
   String get zIndex => this._zIndex;
 
   /** Sets the value of "z-index" */
-  set zIndex(String value) {
+  set zIndex(String? value) {
     _zIndex = value == null ? '' : value;
   }
 
@@ -5412,7 +5422,7 @@
 
 class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
   final Iterable<Element> _elementIterable;
-  Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
+  Iterable<CssStyleDeclaration>? _elementCssStyleDeclarationSetIterable;
 
   _CssStyleDeclarationSet(this._elementIterable) {
     _elementCssStyleDeclarationSetIterable =
@@ -5420,15 +5430,15 @@
   }
 
   String getPropertyValue(String propertyName) =>
-      _elementCssStyleDeclarationSetIterable.first
+      _elementCssStyleDeclarationSetIterable!.first
           .getPropertyValue(propertyName);
 
-  void setProperty(String propertyName, String value, [String priority]) {
-    _elementCssStyleDeclarationSetIterable
+  void setProperty(String propertyName, String? value, [String? priority]) {
+    _elementCssStyleDeclarationSetIterable!
         .forEach((e) => e.setProperty(propertyName, value, priority));
   }
 
-  void _setAll(String propertyName, String value) {
+  void _setAll(String propertyName, String? value) {
     value = value == null ? '' : value;
     for (Element element in _elementIterable) {
       JS('void', '#.style[#] = #', element, propertyName, value);
@@ -5894,7 +5904,7 @@
 
 abstract class CssStyleDeclarationBase {
   String getPropertyValue(String propertyName);
-  void setProperty(String propertyName, String value, [String priority]);
+  void setProperty(String propertyName, String? value, [String? priority]);
 
   /** Gets the value of "align-content" */
   String get alignContent => getPropertyValue('align-content');
@@ -8681,23 +8691,23 @@
     throw new UnsupportedError("Not supported");
   }
 
-  @Returns('_CssRuleList|Null')
+  @Returns('_CssRuleList')
   @Creates('_CssRuleList')
   List<CssRule> get cssRules native;
 
-  CssRule get ownerRule native;
+  CssRule? get ownerRule native;
 
-  @Returns('_CssRuleList|Null')
+  @Returns('_CssRuleList')
   @Creates('_CssRuleList')
   List<CssRule> get rules native;
 
-  int addRule(String selector, String style, [int index]) native;
+  int addRule(String? selector, String? style, [int? index]) native;
 
   void deleteRule(int index) native;
 
-  int insertRule(String rule, [int index]) native;
+  int insertRule(String rule, [int? index]) native;
 
-  void removeRule(int index) native;
+  void removeRule(int? index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -8710,7 +8720,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  static Object parse(String property, String cssText) native;
+  static Object? parse(String property, String cssText) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -8749,7 +8759,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory CssTransformValue([List<CssTransformComponent> transformComponents]) {
+  factory CssTransformValue(
+      [List<CssTransformComponent>? transformComponents]) {
     if (transformComponents == null) {
       return CssTransformValue._create_1();
     }
@@ -8783,7 +8794,7 @@
   }
 
   factory CssTranslation(CssNumericValue x, CssNumericValue y,
-      [CssNumericValue z]) {
+      [CssNumericValue? z]) {
     if ((y is CssNumericValue) && (x is CssNumericValue) && z == null) {
       return CssTranslation._create_1(x, y);
     }
@@ -8851,7 +8862,7 @@
 
   int get length native;
 
-  Object fragmentAtIndex(int index) native;
+  Object? fragmentAtIndex(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -8920,7 +8931,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  void define(String name, Object constructor, [Map options]) {
+  void define(String name, Object constructor, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       _define_1(name, constructor, options_1);
@@ -8935,7 +8946,7 @@
   @JSName('define')
   void _define_2(name, constructor) native;
 
-  Object get(String name) native;
+  Object? get(String name) native;
 
   Future whenDefined(String name) =>
       promiseToFuture(JS("", "#.whenDefined(#)", this, name));
@@ -8952,8 +8963,8 @@
   var _dartDetail;
 
   factory CustomEvent(String type,
-      {bool canBubble: true, bool cancelable: true, Object detail}) {
-    final CustomEvent e = document._createEvent('CustomEvent');
+      {bool canBubble: true, bool cancelable: true, Object? detail}) {
+    final CustomEvent e = document._createEvent('CustomEvent') as CustomEvent;
 
     e._dartDetail = detail;
 
@@ -8980,7 +8991,7 @@
     return _detail;
   }
 
-  factory CustomEvent._(String type, [Map eventInitDict]) {
+  factory CustomEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return CustomEvent._create_1(type, eventInitDict_1);
@@ -9000,7 +9011,7 @@
 
   @JSName('initCustomEvent')
   void _initCustomEvent(String type,
-      [bool bubbles, bool cancelable, Object detail]) native;
+      [bool? bubbles, bool? cancelable, Object? detail]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9013,7 +9024,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DListElement() => JS(
+  factory DListElement() => JS<DListElement>(
       'returns:DListElement;creates:DListElement;new:true',
       '#.createElement(#)',
       document,
@@ -9061,7 +9072,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DataListElement() => document.createElement("datalist");
+  factory DataListElement() =>
+      document.createElement("datalist") as DataListElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -9072,7 +9084,7 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => Element.isTagSupported('datalist');
 
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get options native;
 }
@@ -9100,7 +9112,7 @@
 
   set effectAllowed(String value) native;
 
-  @Returns('FileList|Null')
+  @Returns('FileList')
   @Creates('FileList')
   List<File> get files native;
 
@@ -9108,7 +9120,7 @@
 
   List<String> get types native;
 
-  void clearData([String format]) native;
+  void clearData([String? format]) native;
 
   String getData(String format) native;
 
@@ -9123,7 +9135,7 @@
 @Native("DataTransferItem")
 class DataTransferItem extends Interceptor {
   Entry getAsEntry() {
-    Entry entry = _webkitGetAsEntry();
+    Entry entry = _webkitGetAsEntry() as Entry;
 
     if (entry.isFile)
       applyExtension('FileEntry', entry);
@@ -9144,12 +9156,12 @@
 
   String get type native;
 
-  File getAsFile() native;
+  File? getAsFile() native;
 
   @JSName('webkitGetAsEntry')
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  Entry _webkitGetAsEntry() native;
+  Entry? _webkitGetAsEntry() native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9164,13 +9176,13 @@
 
   int get length native;
 
-  DataTransferItem add(data_OR_file, [String type]) native;
+  DataTransferItem? add(data_OR_file, [String? type]) native;
 
   @JSName('add')
-  DataTransferItem addData(String data, String type) native;
+  DataTransferItem? addData(String data, String type) native;
 
   @JSName('add')
-  DataTransferItem addFile(File file) native;
+  DataTransferItem? addFile(File file) native;
 
   void clear() native;
 
@@ -9229,7 +9241,7 @@
 
   void close() native;
 
-  void postMessage(/*any*/ message, [List<Object> transfer]) {
+  void postMessage(/*any*/ message, [List<Object>? transfer]) {
     if (transfer != null) {
       var message_1 = convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, transfer);
@@ -9249,8 +9261,8 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   void _webkitRequestFileSystem(int type, int size,
-      [_FileSystemCallback successCallback,
-      _ErrorCallback errorCallback]) native;
+      [_FileSystemCallback? successCallback,
+      _ErrorCallback? errorCallback]) native;
 
   @JSName('webkitRequestFileSystemSync')
   @SupportedBrowser(SupportedBrowser.CHROME)
@@ -9267,7 +9279,7 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   void _webkitResolveLocalFileSystemUrl(
       String url, _EntryCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   /// Stream of `message` events handled by this [DedicatedWorkerGlobalScope].
   Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
@@ -9293,12 +9305,12 @@
   static const int TEMPORARY = 0;
 
   void queryUsageAndQuota(int storageType,
-      [StorageUsageCallback usageCallback,
-      StorageErrorCallback errorCallback]) native;
+      [StorageUsageCallback? usageCallback,
+      StorageErrorCallback? errorCallback]) native;
 
   void requestQuota(int storageType, int newQuotaInBytes,
-      [StorageQuotaCallback quotaCallback,
-      StorageErrorCallback errorCallback]) native;
+      [StorageQuotaCallback? quotaCallback,
+      StorageErrorCallback? errorCallback]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9312,11 +9324,11 @@
   }
 
   void queryUsageAndQuota(StorageUsageCallback usageCallback,
-      [StorageErrorCallback errorCallback]) native;
+      [StorageErrorCallback? errorCallback]) native;
 
   void requestQuota(int newQuotaInBytes,
-      [StorageQuotaCallback quotaCallback,
-      StorageErrorCallback errorCallback]) native;
+      [StorageQuotaCallback? quotaCallback,
+      StorageErrorCallback? errorCallback]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9348,7 +9360,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DetailsElement() => document.createElement("details");
+  factory DetailsElement() =>
+      document.createElement("details") as DetailsElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -9439,11 +9452,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  num get x native;
+  num? get x native;
 
-  num get y native;
+  num? get y native;
 
-  num get z native;
+  num? get z native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9456,7 +9469,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DeviceMotionEvent(String type, [Map eventInitDict]) {
+  factory DeviceMotionEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return DeviceMotionEvent._create_1(type, eventInitDict_1);
@@ -9468,13 +9481,13 @@
   static DeviceMotionEvent _create_2(type) =>
       JS('DeviceMotionEvent', 'new DeviceMotionEvent(#)', type);
 
-  DeviceAcceleration get acceleration native;
+  DeviceAcceleration? get acceleration native;
 
-  DeviceAcceleration get accelerationIncludingGravity native;
+  DeviceAcceleration? get accelerationIncludingGravity native;
 
   num get interval native;
 
-  DeviceRotationRate get rotationRate native;
+  DeviceRotationRate? get rotationRate native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9487,7 +9500,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DeviceOrientationEvent(String type, [Map eventInitDict]) {
+  factory DeviceOrientationEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return DeviceOrientationEvent._create_1(type, eventInitDict_1);
@@ -9504,11 +9517,11 @@
 
   bool get absolute native;
 
-  num get alpha native;
+  num? get alpha native;
 
-  num get beta native;
+  num? get beta native;
 
-  num get gamma native;
+  num? get gamma native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9521,11 +9534,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  num get alpha native;
+  num? get alpha native;
 
-  num get beta native;
+  num? get beta native;
 
-  num get gamma native;
+  num? get gamma native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9553,7 +9566,7 @@
 
   set returnValue(String value) native;
 
-  void close([String returnValue]) native;
+  void close([String? returnValue]) native;
 
   void show() native;
 
@@ -9616,10 +9629,10 @@
   @JSName('createReader')
   DirectoryReader _createReader() native;
 
-  void __getDirectory(String path,
-      [Map options,
-      _EntryCallback successCallback,
-      _ErrorCallback errorCallback]) {
+  void __getDirectory(String? path,
+      [Map? options,
+      _EntryCallback? successCallback,
+      _ErrorCallback? errorCallback]) {
     if (errorCallback != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       __getDirectory_1(path, options_1, successCallback, errorCallback);
@@ -9640,17 +9653,17 @@
   }
 
   @JSName('getDirectory')
-  void __getDirectory_1(path, options, _EntryCallback successCallback,
-      _ErrorCallback errorCallback) native;
+  void __getDirectory_1(path, options, _EntryCallback? successCallback,
+      _ErrorCallback? errorCallback) native;
   @JSName('getDirectory')
-  void __getDirectory_2(path, options, _EntryCallback successCallback) native;
+  void __getDirectory_2(path, options, _EntryCallback? successCallback) native;
   @JSName('getDirectory')
   void __getDirectory_3(path, options) native;
   @JSName('getDirectory')
   void __getDirectory_4(path) native;
 
   @JSName('getDirectory')
-  Future<Entry> _getDirectory(String path, {Map options}) {
+  Future<Entry> _getDirectory(String? path, {Map? options}) {
     var completer = new Completer<Entry>();
     __getDirectory(path, options, (value) {
       completer.complete(value);
@@ -9660,10 +9673,10 @@
     return completer.future;
   }
 
-  void __getFile(String path,
-      [Map options,
-      _EntryCallback successCallback,
-      _ErrorCallback errorCallback]) {
+  void __getFile(String? path,
+      [Map? options,
+      _EntryCallback? successCallback,
+      _ErrorCallback? errorCallback]) {
     if (errorCallback != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       __getFile_1(path, options_1, successCallback, errorCallback);
@@ -9684,17 +9697,17 @@
   }
 
   @JSName('getFile')
-  void __getFile_1(path, options, _EntryCallback successCallback,
-      _ErrorCallback errorCallback) native;
+  void __getFile_1(path, options, _EntryCallback? successCallback,
+      _ErrorCallback? errorCallback) native;
   @JSName('getFile')
-  void __getFile_2(path, options, _EntryCallback successCallback) native;
+  void __getFile_2(path, options, _EntryCallback? successCallback) native;
   @JSName('getFile')
   void __getFile_3(path, options) native;
   @JSName('getFile')
   void __getFile_4(path) native;
 
   @JSName('getFile')
-  Future<Entry> _getFile(String path, {Map options}) {
+  Future<Entry> _getFile(String? path, {Map? options}) {
     var completer = new Completer<Entry>();
     __getFile(path, options, (value) {
       applyExtension('FileEntry', value);
@@ -9707,7 +9720,7 @@
 
   @JSName('removeRecursively')
   void _removeRecursively(VoidCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   @JSName('removeRecursively')
   Future removeRecursively() {
@@ -9733,7 +9746,7 @@
 
   @JSName('readEntries')
   void _readEntries(_EntriesCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   Future<List<Entry>> readEntries() {
     var completer = new Completer<List<Entry>>();
@@ -9786,8 +9799,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DivElement() => JS('returns:DivElement;creates:DivElement;new:true',
-      '#.createElement(#)', document, "div");
+  factory DivElement() => JS<DivElement>(
+      'returns:DivElement;creates:DivElement;new:true',
+      '#.createElement(#)',
+      document,
+      "div");
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -9858,10 +9874,10 @@
   String get addressSpace native;
 
   @JSName('body')
-  HtmlElement get _body native;
+  HtmlElement? get _body native;
 
   @JSName('body')
-  set _body(HtmlElement value) native;
+  set _body(HtmlElement? value) native;
 
   String get contentType native;
 
@@ -9869,9 +9885,9 @@
 
   set cookie(String value) native;
 
-  ScriptElement get currentScript native;
+  ScriptElement? get currentScript native;
 
-  WindowBase get window => _convertNativeToDart_Window(this._get_window);
+  WindowBase? get window => _convertNativeToDart_Window(this._get_window);
   @JSName('defaultView')
   @Creates('Window|=Object')
   @Returns('Window|=Object')
@@ -9879,14 +9895,14 @@
   @Returns('Window|=Object|Null')
   dynamic get _get_window native;
 
-  Element get documentElement native;
+  Element? get documentElement native;
 
   String get domain native;
 
   bool get fullscreenEnabled native;
 
   @JSName('head')
-  HeadElement get _head native;
+  HeadElement? get _head native;
 
   bool get hidden native;
 
@@ -9898,7 +9914,7 @@
   String get origin native;
 
   @JSName('preferredStylesheetSet')
-  String get _preferredStylesheetSet native;
+  String? get _preferredStylesheetSet native;
 
   String get readyState native;
 
@@ -9907,17 +9923,17 @@
 
   SvgSvgElement get rootElement native;
 
-  Element get rootScroller native;
+  Element? get rootScroller native;
 
-  set rootScroller(Element value) native;
+  set rootScroller(Element? value) native;
 
-  Element get scrollingElement native;
+  Element? get scrollingElement native;
 
   @JSName('selectedStylesheetSet')
-  String get _selectedStylesheetSet native;
+  String? get _selectedStylesheetSet native;
 
   @JSName('selectedStylesheetSet')
-  set _selectedStylesheetSet(String value) native;
+  set _selectedStylesheetSet(String? value) native;
 
   String get suborigin native;
 
@@ -9955,7 +9971,7 @@
   Node adoptNode(Node node) native;
 
   @JSName('caretRangeFromPoint')
-  Range _caretRangeFromPoint(int x, int y) native;
+  Range _caretRangeFromPoint(int? x, int? y) native;
 
   DocumentFragment createDocumentFragment() native;
 
@@ -9964,7 +9980,7 @@
       [options_OR_typeExtension]) native;
 
   @JSName('createElementNS')
-  Element _createElementNS(String namespaceURI, String qualifiedName,
+  Element _createElementNS(String? namespaceURI, String qualifiedName,
       [options_OR_typeExtension]) native;
 
   @JSName('createEvent')
@@ -9977,7 +9993,7 @@
 
   Touch _createTouch(Window view, EventTarget target, int identifier, num pageX,
       num pageY, num screenX, num screenY,
-      [num radiusX, num radiusY, num rotationAngle, num force]) {
+      [num? radiusX, num? radiusY, num? rotationAngle, num? force]) {
     if (force != null) {
       var target_1 = _convertDartToNative_EventTarget(target);
       return _createTouch_1(view, target_1, identifier, pageX, pageY, screenX,
@@ -10022,7 +10038,7 @@
   @JSName('createTouchList')
   TouchList _createTouchList(Touch touches) native;
 
-  bool execCommand(String commandId, [bool showUI, String value]) native;
+  bool execCommand(String commandId, [bool? showUI, String? value]) native;
 
   void exitFullscreen() native;
 
@@ -10042,7 +10058,7 @@
   @Returns('NodeList|HtmlCollection')
   List<Node> getElementsByTagName(String localName) native;
 
-  Node importNode(Node node, [bool deep]) native;
+  Node importNode(Node node, [bool? deep]) native;
 
   bool queryCommandEnabled(String commandId) native;
 
@@ -10054,7 +10070,7 @@
 
   String queryCommandValue(String commandId) native;
 
-  Function registerElement2(String type, [Map options]) {
+  Function registerElement2(String type, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return _registerElement2_1(type, options_1);
@@ -10074,23 +10090,23 @@
 
   // From NonElementParentNode
 
-  Element getElementById(String elementId) native;
+  Element? getElementById(String elementId) native;
 
   // From DocumentOrShadowRoot
 
-  Element get activeElement native;
+  Element? get activeElement native;
 
-  Element get fullscreenElement native;
+  Element? get fullscreenElement native;
 
-  Element get pointerLockElement native;
+  Element? get pointerLockElement native;
 
   @JSName('styleSheets')
-  @Returns('_StyleSheetList|Null')
+  @Returns('_StyleSheetList')
   @Creates('_StyleSheetList')
   List<StyleSheet> get _styleSheets native;
 
   @JSName('elementFromPoint')
-  Element _elementFromPoint(int x, int y) native;
+  Element? _elementFromPoint(int x, int y) native;
 
   List<Element> elementsFromPoint(int x, int y) native;
 
@@ -10104,15 +10120,15 @@
   int get _childElementCount native;
 
   @JSName('children')
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get _children native;
 
   @JSName('firstElementChild')
-  Element get _firstElementChild native;
+  Element? get _firstElementChild native;
 
   @JSName('lastElementChild')
-  Element get _lastElementChild native;
+  Element? get _lastElementChild native;
 
   /**
    * Finds the first descendant element of this document that matches the
@@ -10131,7 +10147,7 @@
    * For details about CSS selector syntax, see the
    * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
    */
-  Element querySelector(String selectors) native;
+  Element? querySelector(String selectors) native;
 
   @JSName('querySelectorAll')
   @Creates('NodeList')
@@ -10373,13 +10389,13 @@
   bool get supportsRegister => supportsRegisterElement;
 
   void registerElement(String tag, Type customElementClass,
-      {String extendsTag}) {
+      {String? extendsTag}) {
     registerElement2(
         tag, {'prototype': customElementClass, 'extends': extendsTag});
   }
 
   @pragma('dart2js:tryInline') // Almost all call sites have one argument.
-  Element createElement(String tagName, [String typeExtension]) {
+  Element createElement(String tagName, [String? typeExtension]) {
     return (typeExtension == null)
         ? _createElement_2(tagName)
         : _createElement(tagName, typeExtension);
@@ -10396,19 +10412,19 @@
       'Element', '#.createElementNS(#, #)', this, namespaceURI, qualifiedName);
 
   Element createElementNS(String namespaceURI, String qualifiedName,
-      [String typeExtension]) {
+      [String? typeExtension]) {
     return (typeExtension == null)
         ? _createElementNS_2(namespaceURI, qualifiedName)
         : _createElementNS(namespaceURI, qualifiedName, typeExtension);
   }
 
   NodeIterator _createNodeIterator(Node root,
-          [int whatToShow, NodeFilter filter]) =>
+          [int? whatToShow, NodeFilter? filter]) =>
       JS('NodeIterator', '#.createNodeIterator(#, #, #, false)', this, root,
           whatToShow, filter);
 
   TreeWalker _createTreeWalker(Node root,
-          [int whatToShow, NodeFilter filter]) =>
+          [int? whatToShow, NodeFilter? filter]) =>
       JS('TreeWalker', '#.createTreeWalker(#, #, #, false)', this, root,
           whatToShow, filter);
 
@@ -10433,14 +10449,14 @@
     implements NonElementParentNode, ParentNode {
   factory DocumentFragment() => document.createDocumentFragment();
 
-  factory DocumentFragment.html(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
-    return document.body.createFragment(html,
+  factory DocumentFragment.html(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
+    return document.body!.createFragment(html,
         validator: validator, treeSanitizer: treeSanitizer);
   }
 
-  factory DocumentFragment.svg(String svgContent,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  factory DocumentFragment.svg(String? svgContent,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     return new svg.SvgSvgElement().createFragment(svgContent,
         validator: validator, treeSanitizer: treeSanitizer);
   }
@@ -10451,13 +10467,13 @@
   // Native field is used only by Dart code so does not lead to instantiation
   // of native classes
   @Creates('Null')
-  List<Element> _docChildren;
+  List<Element>? _docChildren;
 
   List<Element> get children {
     if (_docChildren == null) {
       _docChildren = new FilteredElementList(this);
     }
-    return _docChildren;
+    return _docChildren!;
   }
 
   set children(List<Element> value) {
@@ -10488,14 +10504,14 @@
     return e.innerHtml;
   }
 
-  set innerHtml(String value) {
+  set innerHtml(String? value) {
     this.setInnerHtml(value);
   }
 
-  void setInnerHtml(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  void setInnerHtml(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     this.nodes.clear();
-    append(document.body.createFragment(html,
+    append(document.body!.createFragment(html,
         validator: validator, treeSanitizer: treeSanitizer));
   }
 
@@ -10512,7 +10528,7 @@
    * last child of this document fragment.
    */
   void appendHtml(String text,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     this.append(new DocumentFragment.html(text,
         validator: validator, treeSanitizer: treeSanitizer));
   }
@@ -10524,7 +10540,7 @@
 
   // From NonElementParentNode
 
-  Element getElementById(String elementId) native;
+  Element? getElementById(String elementId) native;
 
   // From ParentNode
 
@@ -10532,10 +10548,10 @@
   int get _childElementCount native;
 
   @JSName('firstElementChild')
-  Element get _firstElementChild native;
+  Element? get _firstElementChild native;
 
   @JSName('lastElementChild')
-  Element get _lastElementChild native;
+  Element? get _lastElementChild native;
 
   /**
    * Finds the first descendant element of this document fragment that matches
@@ -10549,7 +10565,7 @@
    * For details about CSS selector syntax, see the
    * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
    */
-  Element querySelector(String selectors) native;
+  Element? querySelector(String selectors) native;
 
   @JSName('querySelectorAll')
   @Creates('NodeList')
@@ -10567,21 +10583,21 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Element get activeElement native;
+  Element? get activeElement native;
 
-  Element get fullscreenElement native;
+  Element? get fullscreenElement native;
 
-  Element get pointerLockElement native;
+  Element? get pointerLockElement native;
 
-  @Returns('_StyleSheetList|Null')
+  @Returns('_StyleSheetList')
   @Creates('_StyleSheetList')
   List<StyleSheet> get styleSheets native;
 
-  Element elementFromPoint(int x, int y) native;
+  Element? elementFromPoint(int x, int y) native;
 
   List<Element> elementsFromPoint(int x, int y) native;
 
-  Selection getSelection() native;
+  Selection? getSelection() native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -10594,7 +10610,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DocumentTimeline([Map options]) {
+  factory DocumentTimeline([Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return DocumentTimeline._create_1(options_1);
@@ -10617,7 +10633,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomError(String name, [String message]) {
+  factory DomError(String name, [String? message]) {
     if (message != null) {
       return DomError._create_1(name, message);
     }
@@ -10679,7 +10695,7 @@
     // Chrome release still uses old string, remove this line when Chrome stable
     // also prints out SyntaxError.
     if (Device.isWebKit && errorName == 'SYNTAX_ERR') return 'SyntaxError';
-    return errorName;
+    return errorName as String;
   }
 
   // To suppress missing implicit constructor warnings.
@@ -10702,14 +10718,14 @@
     throw new UnsupportedError("Not supported");
   }
 
-  XmlDocument createDocument(
-      String namespaceURI, String qualifiedName, _DocumentType doctype) native;
+  XmlDocument createDocument(String? namespaceURI, String qualifiedName,
+      _DocumentType? doctype) native;
 
   _DocumentType createDocumentType(
       String qualifiedName, String publicId, String systemId) native;
 
   @JSName('createHTMLDocument')
-  HtmlDocument createHtmlDocument([String title]) native;
+  HtmlDocument createHtmlDocument([String? title]) native;
 
   bool hasFeature() native;
 }
@@ -10724,7 +10740,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Object next([Object value]) native;
+  Object? next([Object? value]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -10737,7 +10753,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomMatrix([Object init]) {
+  factory DomMatrix([Object? init]) {
     if (init != null) {
       return DomMatrix._create_1(init);
     }
@@ -10882,7 +10898,7 @@
 
   static DomMatrix fromFloat64Array(Float64List array64) native;
 
-  static DomMatrix fromMatrix([Map other]) {
+  static DomMatrix fromMatrix([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromMatrix_1(other_1);
@@ -10897,7 +10913,7 @@
 
   DomMatrix invertSelf() native;
 
-  DomMatrix multiplySelf([Map other]) {
+  DomMatrix multiplySelf([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _multiplySelf_1(other_1);
@@ -10910,7 +10926,7 @@
   @JSName('multiplySelf')
   DomMatrix _multiplySelf_2() native;
 
-  DomMatrix preMultiplySelf([Map other]) {
+  DomMatrix preMultiplySelf([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _preMultiplySelf_1(other_1);
@@ -10923,30 +10939,30 @@
   @JSName('preMultiplySelf')
   DomMatrix _preMultiplySelf_2() native;
 
-  DomMatrix rotateAxisAngleSelf([num x, num y, num z, num angle]) native;
+  DomMatrix rotateAxisAngleSelf([num? x, num? y, num? z, num? angle]) native;
 
-  DomMatrix rotateFromVectorSelf([num x, num y]) native;
+  DomMatrix rotateFromVectorSelf([num? x, num? y]) native;
 
-  DomMatrix rotateSelf([num rotX, num rotY, num rotZ]) native;
+  DomMatrix rotateSelf([num? rotX, num? rotY, num? rotZ]) native;
 
-  DomMatrix scale3dSelf([num scale, num originX, num originY, num originZ])
+  DomMatrix scale3dSelf([num? scale, num? originX, num? originY, num? originZ])
       native;
 
   DomMatrix scaleSelf(
-      [num scaleX,
-      num scaleY,
-      num scaleZ,
-      num originX,
-      num originY,
-      num originZ]) native;
+      [num? scaleX,
+      num? scaleY,
+      num? scaleZ,
+      num? originX,
+      num? originY,
+      num? originZ]) native;
 
   DomMatrix setMatrixValue(String transformList) native;
 
-  DomMatrix skewXSelf([num sx]) native;
+  DomMatrix skewXSelf([num? sx]) native;
 
-  DomMatrix skewYSelf([num sy]) native;
+  DomMatrix skewYSelf([num? sy]) native;
 
-  DomMatrix translateSelf([num tx, num ty, num tz]) native;
+  DomMatrix translateSelf([num? tx, num? ty, num? tz]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -10959,7 +10975,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomMatrixReadOnly([Object init]) {
+  factory DomMatrixReadOnly([Object? init]) {
     if (init != null) {
       return DomMatrixReadOnly._create_1(init);
     }
@@ -11026,7 +11042,7 @@
 
   static DomMatrixReadOnly fromFloat64Array(Float64List array64) native;
 
-  static DomMatrixReadOnly fromMatrix([Map other]) {
+  static DomMatrixReadOnly fromMatrix([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromMatrix_1(other_1);
@@ -11041,7 +11057,7 @@
 
   DomMatrix inverse() native;
 
-  DomMatrix multiply([Map other]) {
+  DomMatrix multiply([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _multiply_1(other_1);
@@ -11054,31 +11070,32 @@
   @JSName('multiply')
   DomMatrix _multiply_2() native;
 
-  DomMatrix rotate([num rotX, num rotY, num rotZ]) native;
+  DomMatrix rotate([num? rotX, num? rotY, num? rotZ]) native;
 
-  DomMatrix rotateAxisAngle([num x, num y, num z, num angle]) native;
+  DomMatrix rotateAxisAngle([num? x, num? y, num? z, num? angle]) native;
 
-  DomMatrix rotateFromVector([num x, num y]) native;
+  DomMatrix rotateFromVector([num? x, num? y]) native;
 
   DomMatrix scale(
-      [num scaleX,
-      num scaleY,
-      num scaleZ,
-      num originX,
-      num originY,
-      num originZ]) native;
+      [num? scaleX,
+      num? scaleY,
+      num? scaleZ,
+      num? originX,
+      num? originY,
+      num? originZ]) native;
 
-  DomMatrix scale3d([num scale, num originX, num originY, num originZ]) native;
+  DomMatrix scale3d([num? scale, num? originX, num? originY, num? originZ])
+      native;
 
-  DomMatrix skewX([num sx]) native;
+  DomMatrix skewX([num? sx]) native;
 
-  DomMatrix skewY([num sy]) native;
+  DomMatrix skewY([num? sy]) native;
 
   Float32List toFloat32Array() native;
 
   Float64List toFloat64Array() native;
 
-  DomPoint transformPoint([Map point]) {
+  DomPoint transformPoint([Map? point]) {
     if (point != null) {
       var point_1 = convertDartToNative_Dictionary(point);
       return _transformPoint_1(point_1);
@@ -11091,7 +11108,7 @@
   @JSName('transformPoint')
   DomPoint _transformPoint_2() native;
 
-  DomMatrix translate([num tx, num ty, num tz]) native;
+  DomMatrix translate([num? tx, num? ty, num? tz]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -11122,7 +11139,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomPoint([num x, num y, num z, num w]) {
+  factory DomPoint([num? x, num? y, num? z, num? w]) {
     if (w != null) {
       return DomPoint._create_1(x, y, z, w);
     }
@@ -11173,7 +11190,7 @@
 
   set z(num value) native;
 
-  static DomPoint fromPoint([Map other]) {
+  static DomPoint fromPoint([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromPoint_1(other_1);
@@ -11197,7 +11214,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomPointReadOnly([num x, num y, num z, num w]) {
+  factory DomPointReadOnly([num? x, num? y, num? z, num? w]) {
     if (w != null) {
       return DomPointReadOnly._create_1(x, y, z, w);
     }
@@ -11231,7 +11248,7 @@
 
   num get z native;
 
-  static DomPointReadOnly fromPoint([Map other]) {
+  static DomPointReadOnly fromPoint([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromPoint_1(other_1);
@@ -11244,7 +11261,7 @@
   @JSName('fromPoint')
   static DomPointReadOnly _fromPoint_2() native;
 
-  DomPoint matrixTransform([Map matrix]) {
+  DomPoint matrixTransform([Map? matrix]) {
     if (matrix != null) {
       var matrix_1 = convertDartToNative_Dictionary(matrix);
       return _matrixTransform_1(matrix_1);
@@ -11268,7 +11285,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomQuad([Map p1, Map p2, Map p3, Map p4]) {
+  factory DomQuad([Map? p1, Map? p2, Map? p3, Map? p4]) {
     if (p4 != null) {
       var p1_1 = convertDartToNative_Dictionary(p1);
       var p2_2 = convertDartToNative_Dictionary(p2);
@@ -11309,7 +11326,7 @@
 
   DomPoint get p4 native;
 
-  static DomQuad fromQuad([Map other]) {
+  static DomQuad fromQuad([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromQuad_1(other_1);
@@ -11322,7 +11339,7 @@
   @JSName('fromQuad')
   static DomQuad _fromQuad_2() native;
 
-  static DomQuad fromRect([Map other]) {
+  static DomQuad fromRect([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromRect_1(other_1);
@@ -11395,7 +11412,7 @@
   Rectangle elementAt(int index) => this[index];
   // -- end List<Rectangle> mixins.
 
-  Rectangle item(int index) native;
+  Rectangle? item(int index) native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -11427,7 +11444,7 @@
    * Returns the intersection of this and `other`, or null if they don't
    * intersect.
    */
-  Rectangle intersection(Rectangle other) {
+  Rectangle? intersection(Rectangle other) {
     var x0 = max(left, other.left);
     var x1 = min(left + width, other.left + other.width);
 
@@ -11496,7 +11513,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DomRectReadOnly([num x, num y, num width, num height]) {
+  factory DomRectReadOnly([num? x, num? y, num? width, num? height]) {
     if (height != null) {
       return DomRectReadOnly._create_1(x, y, width, height);
     }
@@ -11538,7 +11555,7 @@
 
   num get y native;
 
-  static DomRectReadOnly fromRect([Map other]) {
+  static DomRectReadOnly fromRect([Map? other]) {
     if (other != null) {
       var other_1 = convertDartToNative_Dictionary(other);
       return _fromRect_1(other_1);
@@ -11610,7 +11627,7 @@
   String elementAt(int index) => this[index];
   // -- end List<String> mixins.
 
-  String item(int index) native;
+  String? item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -11650,7 +11667,7 @@
 
   bool contains(String token) native;
 
-  String item(int index) native;
+  String? item(int index) native;
 
   void remove(String tokens) native;
 
@@ -11658,7 +11675,7 @@
 
   bool supports(String token) native;
 
-  bool toggle(String token, [bool force]) native;
+  bool toggle(String token, [bool? force]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -11671,10 +11688,10 @@
   final HtmlCollection _childElements;
 
   _ChildrenElementList._wrap(Element element)
-      : _childElements = element._children,
+      : _childElements = element._children as HtmlCollection,
         _element = element;
 
-  bool contains(Object element) => _childElements.contains(element);
+  bool contains(Object? element) => _childElements.contains(element);
 
   bool get isEmpty {
     return _element._firstElementChild == null;
@@ -11685,7 +11702,7 @@
   }
 
   Element operator [](int index) {
-    return _childElements[index];
+    return _childElements[index] as Element;
   }
 
   void operator []=(int index, Element value) {
@@ -11714,11 +11731,11 @@
     }
   }
 
-  void sort([int compare(Element a, Element b)]) {
+  void sort([int compare(Element a, Element b)?]) {
     throw new UnsupportedError('Cannot sort element lists');
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     throw new UnsupportedError('Cannot shuffle element lists');
   }
 
@@ -11740,7 +11757,7 @@
     for (var e in removed) e.remove();
   }
 
-  void fillRange(int start, int end, [Element fillValue]) {
+  void fillRange(int start, int end, [Element? fillValue]) {
     throw new UnimplementedError();
   }
 
@@ -11757,7 +11774,7 @@
     throw new UnimplementedError();
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (object is Element) {
       Element element = object;
       if (identical(element.parentNode, _element)) {
@@ -11793,6 +11810,7 @@
 
   Element removeAt(int index) {
     final result = this[index];
+    // TODO(41258): Remove null check after unfork/strong mode.
     if (result != null) {
       _element._removeChild(result);
     }
@@ -11806,13 +11824,13 @@
   }
 
   Element get first {
-    Element result = _element._firstElementChild;
+    Element? result = _element._firstElementChild;
     if (result == null) throw new StateError("No elements");
     return result;
   }
 
   Element get last {
-    Element result = _element._lastElementChild;
+    Element? result = _element._lastElementChild;
     if (result == null) throw new StateError("No elements");
     return result;
   }
@@ -12218,7 +12236,7 @@
 
   int get length => _nodeList.length;
 
-  E operator [](int index) => _nodeList[index];
+  E operator [](int index) => _nodeList[index] as E;
 
   void operator []=(int index, E value) {
     throw new UnsupportedError('Cannot modify list');
@@ -12228,19 +12246,19 @@
     throw new UnsupportedError('Cannot modify list');
   }
 
-  void sort([Comparator<E> compare]) {
+  void sort([Comparator<E>? compare]) {
     throw new UnsupportedError('Cannot sort list');
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     throw new UnsupportedError('Cannot shuffle list');
   }
 
-  E get first => _nodeList.first;
+  E get first => _nodeList.first as E;
 
-  E get last => _nodeList.last;
+  E get last => _nodeList.last as E;
 
-  E get single => _nodeList.single;
+  E get single => _nodeList.single as E;
 
   CssClassSet get classes => new _MultiElementCssClassSet(this);
 
@@ -12647,12 +12665,12 @@
    * * [NodeValidator]
    *
    */
-  factory Element.html(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
-    var fragment = document.body.createFragment(html,
+  factory Element.html(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
+    var fragment = document.body!.createFragment(html,
         validator: validator, treeSanitizer: treeSanitizer);
 
-    return fragment.nodes.where((e) => e is Element).single;
+    return fragment.nodes.where((e) => e is Element).single as Element;
   }
 
   /**
@@ -12697,7 +12715,7 @@
    *
    * * [isTagSupported]
    */
-  factory Element.tag(String tag, [String typeExtension]) =>
+  factory Element.tag(String tag, [String? typeExtension]) =>
       _ElementFactoryProvider.createElement_tag(tag, typeExtension);
 
   /// Creates a new `<a>` element.
@@ -12861,19 +12879,21 @@
     Map<String, String> attributes = this.attributes;
     attributes.clear();
     for (String key in value.keys) {
-      attributes[key] = value[key];
+      attributes[key] = value[key]!;
     }
   }
 
   @pragma('dart2js:tryInline')
-  String getAttribute(String name) {
+  String? getAttribute(String name) {
+    // TODO(41258): Delete this assertion after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     assert(name != null, 'Attribute name cannot be null');
     return _getAttribute(name);
   }
 
   @pragma('dart2js:tryInline')
-  String getAttributeNS(String namespaceURI, String name) {
+  String? getAttributeNS(String? namespaceURI, String name) {
+    // TODO(41258): Delete this assertion after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     // [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
     assert(name != null, 'Attribute name cannot be null');
@@ -12882,13 +12902,15 @@
 
   @pragma('dart2js:tryInline')
   bool hasAttribute(String name) {
+    // TODO(41258): Delete this assertion after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     assert(name != null, 'Attribute name cannot be null');
     return _hasAttribute(name);
   }
 
   @pragma('dart2js:tryInline')
-  bool hasAttributeNS(String namespaceURI, String name) {
+  bool hasAttributeNS(String? namespaceURI, String name) {
+    // TODO(41258): Delete this assertion after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     // [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
     assert(name != null, 'Attribute name cannot be null');
@@ -12897,13 +12919,15 @@
 
   @pragma('dart2js:tryInline')
   void removeAttribute(String name) {
+    // TODO(41258): Delete this assertion after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     assert(name != null, 'Attribute name cannot be null');
     _removeAttribute(name);
   }
 
   @pragma('dart2js:tryInline')
-  void removeAttributeNS(String namespaceURI, String name) {
+  void removeAttributeNS(String? namespaceURI, String name) {
+    // TODO(41258): Delete this assertion after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     assert(name != null, 'Attribute name cannot be null');
     _removeAttributeNS(namespaceURI, name);
@@ -12911,6 +12935,7 @@
 
   @pragma('dart2js:tryInline')
   void setAttribute(String name, String value) {
+    // TODO(41258): Delete these assertions after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     assert(name != null, 'Attribute name cannot be null');
     // TODO(sra): assert(value != null, 'Attribute value cannot be null.');
@@ -12918,7 +12943,8 @@
   }
 
   @pragma('dart2js:tryInline')
-  void setAttributeNS(String namespaceURI, String name, String value) {
+  void setAttributeNS(String? namespaceURI, String name, String value) {
+    // TODO(41258): Delete these assertions after forcing strong mode.
     // Protect [name] against string conversion to "null" or "undefined".
     assert(name != null, 'Attribute name cannot be null');
     // TODO(sra): assert(value != null, 'Attribute value cannot be null.');
@@ -13035,7 +13061,7 @@
     final data = this.dataset;
     data.clear();
     for (String key in value.keys) {
-      data[key] = value[key];
+      data[key] = value[key]!;
     }
   }
 
@@ -13067,7 +13093,7 @@
    * * [Pseudo-elements](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)
    *   from MDN.
    */
-  CssStyleDeclaration getComputedStyle([String pseudoElement]) {
+  CssStyleDeclaration getComputedStyle([String? pseudoElement]) {
     if (pseudoElement == null) {
       pseudoElement = '';
     }
@@ -13099,7 +13125,7 @@
    * last child of this element.
    */
   void appendHtml(String text,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     this.insertAdjacentHtml('beforeend', text,
         validator: validator, treeSanitizer: treeSanitizer);
   }
@@ -13224,7 +13250,7 @@
    * * [Node.namespaceURI](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSname)
    *   from W3C.
    */
-  String get namespaceUri => _namespaceUri;
+  String? get namespaceUri => _namespaceUri;
 
   /**
    * The string representation of this element.
@@ -13252,7 +13278,7 @@
    * * [scrollIntoViewIfNeeded](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded)
    *   from MDN.
    */
-  void scrollIntoView([ScrollAlignment alignment]) {
+  void scrollIntoView([ScrollAlignment? alignment]) {
     var hasScrollIntoViewIfNeeded = true;
     hasScrollIntoViewIfNeeded =
         JS('bool', '!!(#.scrollIntoViewIfNeeded)', this);
@@ -13347,7 +13373,7 @@
    * * [insertAdjacentElement]
    */
   void insertAdjacentHtml(String where, String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
       _insertAdjacentHtml(where, html);
     } else {
@@ -13386,7 +13412,7 @@
   void _insertAdjacentNode(String where, Node node) {
     switch (where.toLowerCase()) {
       case 'beforebegin':
-        this.parentNode.insertBefore(node, this);
+        this.parentNode!.insertBefore(node, this);
         break;
       case 'afterbegin':
         var first = this.nodes.length > 0 ? this.nodes[0] : null;
@@ -13396,7 +13422,7 @@
         this.append(node);
         break;
       case 'afterend':
-        this.parentNode.insertBefore(node, this.nextNode);
+        this.parentNode!.insertBefore(node, this.nextNode);
         break;
       default:
         throw new ArgumentError("Invalid position ${where}");
@@ -13424,9 +13450,9 @@
 
   /** Checks if this element or any of its parents match the CSS selectors. */
   bool matchesWithAncestors(String selectors) {
-    var elem = this;
+    var elem = this as Element?;
     do {
-      if (elem.matches(selectors)) return true;
+      if (elem!.matches(selectors)) return true;
       elem = elem.parent;
     } while (elem != null);
     return false;
@@ -13462,7 +13488,7 @@
    *   from W3C.
    */
   @SupportedBrowser(SupportedBrowser.CHROME, '25')
-  ShadowRoot get shadowRoot =>
+  ShadowRoot? get shadowRoot =>
       JS('ShadowRoot|Null', '#.shadowRoot || #.webkitShadowRoot', this, this);
 
   /**
@@ -13542,7 +13568,7 @@
    * This method is the Dart equivalent to jQuery's
    * [offset](http://api.jquery.com/offset/) method.
    */
-  Point get documentOffset => offsetTo(document.documentElement);
+  Point get documentOffset => offsetTo(document.documentElement!);
 
   /**
    * Provides the offset of this element's [borderEdge] relative to the
@@ -13559,7 +13585,7 @@
     return Element._offsetToHelper(this, parent);
   }
 
-  static Point _offsetToHelper(Element current, Element parent) {
+  static Point _offsetToHelper(Element? current, Element parent) {
     // We're hopping from _offsetParent_ to offsetParent (not just parent), so
     // offsetParent, "tops out" at BODY. But people could conceivably pass in
     // the document.documentElement and I want it to return an absolute offset,
@@ -13571,15 +13597,15 @@
       throw new ArgumentError("Specified element is not a transitive offset "
           "parent of this element.");
     }
-    Element parentOffset = current.offsetParent;
+    Element? parentOffset = current.offsetParent;
     Point p = Element._offsetToHelper(parentOffset, parent);
     return new Point(p.x + current.offsetLeft, p.y + current.offsetTop);
   }
 
-  static HtmlDocument _parseDocument;
-  static Range _parseRange;
-  static NodeValidatorBuilder _defaultValidator;
-  static _ValidatingTreeSanitizer _defaultSanitizer;
+  static HtmlDocument? _parseDocument;
+  static Range? _parseRange;
+  static NodeValidatorBuilder? _defaultValidator;
+  static _ValidatingTreeSanitizer? _defaultSanitizer;
 
   /**
    * Create a DocumentFragment from the HTML fragment and ensure that it follows
@@ -13601,8 +13627,8 @@
    * * [NodeValidator]
    * * [NodeTreeSanitizer]
    */
-  DocumentFragment createFragment(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  DocumentFragment createFragment(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (treeSanitizer == null) {
       if (validator == null) {
         if (_defaultValidator == null) {
@@ -13611,9 +13637,9 @@
         validator = _defaultValidator;
       }
       if (_defaultSanitizer == null) {
-        _defaultSanitizer = new _ValidatingTreeSanitizer(validator);
+        _defaultSanitizer = new _ValidatingTreeSanitizer(validator!);
       } else {
-        _defaultSanitizer.validator = validator;
+        _defaultSanitizer!.validator = validator!;
       }
       treeSanitizer = _defaultSanitizer;
     } else if (validator != null) {
@@ -13623,47 +13649,48 @@
 
     if (_parseDocument == null) {
       _parseDocument = document.implementation.createHtmlDocument('');
-      _parseRange = _parseDocument.createRange();
+      _parseRange = _parseDocument!.createRange();
 
       // Workaround for Safari bug. Was also previously Chrome bug 229142
       // - URIs are not resolved in new doc.
-      BaseElement base = _parseDocument.createElement('base');
+      BaseElement base = _parseDocument!.createElement('base') as BaseElement;
       base.href = document.baseUri;
-      _parseDocument.head.append(base);
+      _parseDocument!.head!.append(base);
     }
 
     // TODO(terry): Fixes Chromium 50 change no body after createHtmlDocument()
-    if (_parseDocument.body == null) {
-      _parseDocument.body = _parseDocument.createElement("body");
+    if (_parseDocument!.body == null) {
+      _parseDocument!.body =
+          _parseDocument!.createElement("body") as BodyElement;
     }
 
     var contextElement;
     if (this is BodyElement) {
-      contextElement = _parseDocument.body;
+      contextElement = _parseDocument!.body!;
     } else {
-      contextElement = _parseDocument.createElement(tagName);
-      _parseDocument.body.append(contextElement);
+      contextElement = _parseDocument!.createElement(tagName);
+      _parseDocument!.body!.append(contextElement);
     }
     var fragment;
     if (Range.supportsCreateContextualFragment &&
         _canBeUsedToCreateContextualFragment) {
-      _parseRange.selectNodeContents(contextElement);
+      _parseRange!.selectNodeContents(contextElement);
       // createContextualFragment expects a non-nullable html string.
       // If null is passed, it gets converted to 'null' instead.
-      fragment = _parseRange.createContextualFragment(html ?? 'null');
+      fragment = _parseRange!.createContextualFragment(html ?? 'null');
     } else {
       contextElement._innerHtml = html;
 
-      fragment = _parseDocument.createDocumentFragment();
+      fragment = _parseDocument!.createDocumentFragment();
       while (contextElement.firstChild != null) {
         fragment.append(contextElement.firstChild);
       }
     }
-    if (contextElement != _parseDocument.body) {
+    if (contextElement != _parseDocument!.body) {
       contextElement.remove();
     }
 
-    treeSanitizer.sanitizeTree(fragment);
+    treeSanitizer!.sanitizeTree(fragment);
     // Copy the fragment over to the main document (fix for 14184)
     document.adoptNode(fragment);
 
@@ -13713,7 +13740,7 @@
    * This uses the default sanitization behavior to sanitize the HTML fragment,
    * use [setInnerHtml] to override the default behavior.
    */
-  set innerHtml(String html) {
+  set innerHtml(String? html) {
     this.setInnerHtml(html);
   }
 
@@ -13738,8 +13765,8 @@
    * * [NodeValidator]
    * * [NodeTreeSanitizer]
    */
-  void setInnerHtml(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  void setInnerHtml(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     text = null;
     if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
       _innerHtml = html;
@@ -13833,7 +13860,7 @@
     return result;
   }
 
-  Element get offsetParent native;
+  Element? get offsetParent native;
 
   int get offsetHeight => JS<num>('num', '#.offsetHeight', this).round();
 
@@ -14507,9 +14534,9 @@
 
   void focus() native;
 
-  AccessibleNode get accessibleNode native;
+  AccessibleNode? get accessibleNode native;
 
-  SlotElement get assignedSlot native;
+  SlotElement? get assignedSlot native;
 
   @JSName('attributes')
   _NamedNodeMap get _attributes native;
@@ -14526,9 +14553,9 @@
 
   int get clientWidth native;
 
-  String get computedName native;
+  String? get computedName native;
 
-  String get computedRole native;
+  String? get computedRole native;
 
   String get id native;
 
@@ -14538,13 +14565,13 @@
   String get _innerHtml native;
 
   @JSName('innerHTML')
-  set _innerHtml(String value) native;
+  set _innerHtml(String? value) native;
 
   @JSName('localName')
   String get _localName native;
 
   @JSName('namespaceURI')
-  String get _namespaceUri native;
+  String? get _namespaceUri native;
 
   @JSName('outerHTML')
   String get outerHtml native;
@@ -14584,15 +14611,15 @@
   @JSName('attachShadow')
   ShadowRoot _attachShadow_1(shadowRootInitDict) native;
 
-  Element closest(String selectors) native;
+  Element? closest(String selectors) native;
 
   List<Animation> getAnimations() native;
 
   @JSName('getAttribute')
-  String _getAttribute(String name) native;
+  String? _getAttribute(String name) native;
 
   @JSName('getAttributeNS')
-  String _getAttributeNS(String namespaceURI, String localName) native;
+  String? _getAttributeNS(String? namespaceURI, String localName) native;
 
   List<String> getAttributeNames() native;
 
@@ -14639,7 +14666,7 @@
    *   specification](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html)
    *   from W3C.
    */
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> getDestinationInsertionPoints() native;
 
@@ -14665,7 +14692,7 @@
   bool _hasAttribute(String name) native;
 
   @JSName('hasAttributeNS')
-  bool _hasAttributeNS(String namespaceURI, String localName) native;
+  bool _hasAttributeNS(String? namespaceURI, String localName) native;
 
   bool hasPointerCapture(int pointerId) native;
 
@@ -14675,11 +14702,11 @@
   void _removeAttribute(String name) native;
 
   @JSName('removeAttributeNS')
-  void _removeAttributeNS(String namespaceURI, String localName) native;
+  void _removeAttributeNS(String? namespaceURI, String localName) native;
 
   void requestPointerLock() native;
 
-  void scroll([options_OR_x, num y]) {
+  void scroll([options_OR_x, num? y]) {
     if (options_OR_x == null && y == null) {
       _scroll_1();
       return;
@@ -14701,9 +14728,9 @@
   @JSName('scroll')
   void _scroll_2(options) native;
   @JSName('scroll')
-  void _scroll_3(num x, y) native;
+  void _scroll_3(num? x, y) native;
 
-  void scrollBy([options_OR_x, num y]) {
+  void scrollBy([options_OR_x, num? y]) {
     if (options_OR_x == null && y == null) {
       _scrollBy_1();
       return;
@@ -14725,15 +14752,15 @@
   @JSName('scrollBy')
   void _scrollBy_2(options) native;
   @JSName('scrollBy')
-  void _scrollBy_3(num x, y) native;
+  void _scrollBy_3(num? x, y) native;
 
   @JSName('scrollIntoView')
-  void _scrollIntoView([Object arg]) native;
+  void _scrollIntoView([Object? arg]) native;
 
   @JSName('scrollIntoViewIfNeeded')
-  void _scrollIntoViewIfNeeded([bool centerIfNeeded]) native;
+  void _scrollIntoViewIfNeeded([bool? centerIfNeeded]) native;
 
-  void scrollTo([options_OR_x, num y]) {
+  void scrollTo([options_OR_x, num? y]) {
     if (options_OR_x == null && y == null) {
       _scrollTo_1();
       return;
@@ -14755,13 +14782,13 @@
   @JSName('scrollTo')
   void _scrollTo_2(options) native;
   @JSName('scrollTo')
-  void _scrollTo_3(num x, y) native;
+  void _scrollTo_3(num? x, y) native;
 
   @JSName('setAttribute')
   void _setAttribute(String name, String value) native;
 
   @JSName('setAttributeNS')
-  void _setAttributeNS(String namespaceURI, String name, String value) native;
+  void _setAttributeNS(String? namespaceURI, String name, String value) native;
 
   void setPointerCapture(int pointerId) native;
 
@@ -14788,9 +14815,9 @@
 
   // From NonDocumentTypeChildNode
 
-  Element get nextElementSibling native;
+  Element? get nextElementSibling native;
 
-  Element get previousElementSibling native;
+  Element? get previousElementSibling native;
 
   // From ParentNode
 
@@ -14798,15 +14825,15 @@
   int get _childElementCount native;
 
   @JSName('children')
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get _children native;
 
   @JSName('firstElementChild')
-  Element get _firstElementChild native;
+  Element? get _firstElementChild native;
 
   @JSName('lastElementChild')
-  Element get _lastElementChild native;
+  Element? get _lastElementChild native;
 
   /**
    * Finds the first descendant element of this element that matches the
@@ -14824,7 +14851,7 @@
    * For details about CSS selector syntax, see the
    * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
    */
-  Element querySelector(String selectors) native;
+  Element? querySelector(String selectors) native;
 
   @JSName('querySelectorAll')
   @Creates('NodeList')
@@ -15138,7 +15165,7 @@
 class _ElementFactoryProvider {
   // Optimization to improve performance until the dart2js compiler inlines this
   // method.
-  static dynamic createElement_tag(String tag, String typeExtension) {
+  static dynamic createElement_tag(String tag, String? typeExtension) {
     // Firefox may return a JS function for some types (Embed, Object).
     if (typeExtension != null) {
       return JS('Element|=Object', 'document.createElement(#, #)', tag,
@@ -15184,7 +15211,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory EmbedElement() => document.createElement("embed");
+  factory EmbedElement() => document.createElement("embed") as EmbedElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -15249,12 +15276,12 @@
 
   @JSName('copyTo')
   void _copyTo(DirectoryEntry parent,
-      [String name,
-      _EntryCallback successCallback,
-      _ErrorCallback errorCallback]) native;
+      [String? name,
+      _EntryCallback? successCallback,
+      _ErrorCallback? errorCallback]) native;
 
   @JSName('copyTo')
-  Future<Entry> copyTo(DirectoryEntry parent, {String name}) {
+  Future<Entry> copyTo(DirectoryEntry parent, {String? name}) {
     var completer = new Completer<Entry>();
     _copyTo(parent, name, (value) {
       completer.complete(value);
@@ -15266,7 +15293,7 @@
 
   @JSName('getMetadata')
   void _getMetadata(MetadataCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   @JSName('getMetadata')
   Future<Metadata> getMetadata() {
@@ -15282,7 +15309,7 @@
 
   @JSName('getParent')
   void _getParent(
-      [_EntryCallback successCallback, _ErrorCallback errorCallback]) native;
+      [_EntryCallback? successCallback, _ErrorCallback? errorCallback]) native;
 
   @JSName('getParent')
   Future<Entry> getParent() {
@@ -15298,12 +15325,12 @@
 
   @JSName('moveTo')
   void _moveTo(DirectoryEntry parent,
-      [String name,
-      _EntryCallback successCallback,
-      _ErrorCallback errorCallback]) native;
+      [String? name,
+      _EntryCallback? successCallback,
+      _ErrorCallback? errorCallback]) native;
 
   @JSName('moveTo')
-  Future<Entry> moveTo(DirectoryEntry parent, {String name}) {
+  Future<Entry> moveTo(DirectoryEntry parent, {String? name}) {
     var completer = new Completer<Entry>();
     _moveTo(parent, name, (value) {
       completer.complete(value);
@@ -15314,7 +15341,7 @@
   }
 
   @JSName('remove')
-  void _remove(VoidCallback successCallback, [_ErrorCallback errorCallback])
+  void _remove(VoidCallback successCallback, [_ErrorCallback? errorCallback])
       native;
 
   @JSName('remove')
@@ -15357,7 +15384,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ErrorEvent(String type, [Map eventInitDict]) {
+  factory ErrorEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return ErrorEvent._create_1(type, eventInitDict_1);
@@ -15372,7 +15399,7 @@
   int get colno native;
 
   @Creates('Null')
-  Object get error native;
+  Object? get error native;
 
   String get filename native;
 
@@ -15415,8 +15442,8 @@
   }
 
   /** The CSS selector involved with event delegation. */
-  String get _selector native;
-  set _selector(String value) native;
+  String? get _selector native;
+  set _selector(String? value) native;
 
   /**
    * A pointer to the element whose CSS selector matched within which an event
@@ -15428,20 +15455,20 @@
       throw new UnsupportedError('Cannot call matchingTarget if this Event did'
           ' not arise as a result of event delegation.');
     }
-    Element currentTarget = this.currentTarget;
-    Element target = this.target;
+    Element? currentTarget = this.currentTarget as Element?;
+    Element? target = this.target as Element?;
     var matchedTarget;
     do {
-      if (target.matches(_selector)) return target;
+      if (target!.matches(_selector!)) return target;
       target = target.parent;
-    } while (target != null && target != currentTarget.parent);
+    } while (target != null && target != currentTarget!.parent);
     throw new StateError('No selector matched for populating matchedTarget.');
   }
 
   List<EventTarget> get path =>
       JS<bool>('bool', '!!#.composedPath', this) ? composedPath() : [];
 
-  factory Event._(String type, [Map eventInitDict]) {
+  factory Event._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return Event._create_1(type, eventInitDict_1);
@@ -15489,7 +15516,7 @@
 
   bool get composed native;
 
-  EventTarget get currentTarget =>
+  EventTarget? get currentTarget =>
       _convertNativeToDart_EventTarget(this._get_currentTarget);
   @JSName('currentTarget')
   @Creates('Null')
@@ -15502,7 +15529,7 @@
 
   bool get isTrusted native;
 
-  EventTarget get target => _convertNativeToDart_EventTarget(this._get_target);
+  EventTarget? get target => _convertNativeToDart_EventTarget(this._get_target);
   @JSName('target')
   @Creates('Node')
   @Returns('EventTarget|=Object')
@@ -15515,7 +15542,7 @@
   List<EventTarget> composedPath() native;
 
   @JSName('initEvent')
-  void _initEvent(String type, [bool bubbles, bool cancelable]) native;
+  void _initEvent(String type, [bool? bubbles, bool? cancelable]) native;
 
   void preventDefault() native;
 
@@ -15568,7 +15595,7 @@
       const EventStreamProvider<Event>('open');
 
   static EventSource _factoryEventSource(String url,
-      [Map eventSourceInitDict]) {
+      [Map? eventSourceInitDict]) {
     if (eventSourceInitDict != null) {
       var eventSourceInitDict_1 =
           convertDartToNative_Dictionary(eventSourceInitDict);
@@ -15704,8 +15731,8 @@
    */
   Events get on => new Events(this);
 
-  void addEventListener(String type, EventListener listener,
-      [bool useCapture]) {
+  void addEventListener(String type, EventListener? listener,
+      [bool? useCapture]) {
     // TODO(leafp): This check is avoid a bug in our dispatch code when
     // listener is null.  The browser treats this call as a no-op in this
     // case, so it's fine to short-circuit it, but we should not have to.
@@ -15714,8 +15741,8 @@
     }
   }
 
-  void removeEventListener(String type, EventListener listener,
-      [bool useCapture]) {
+  void removeEventListener(String type, EventListener? listener,
+      [bool? useCapture]) {
     // TODO(leafp): This check is avoid a bug in our dispatch code when
     // listener is null.  The browser treats this call as a no-op in this
     // case, so it's fine to short-circuit it, but we should not have to.
@@ -15730,14 +15757,14 @@
   }
 
   @JSName('addEventListener')
-  void _addEventListener(String type, EventListener listener, [bool options])
+  void _addEventListener(String type, EventListener? listener, [bool? options])
       native;
 
   bool dispatchEvent(Event event) native;
 
   @JSName('removeEventListener')
-  void _removeEventListener(String type, EventListener listener, [bool options])
-      native;
+  void _removeEventListener(String type, EventListener? listener,
+      [bool? options]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -15750,7 +15777,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ExtendableEvent(String type, [Map eventInitDict]) {
+  factory ExtendableEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return ExtendableEvent._create_1(type, eventInitDict_1);
@@ -15777,7 +15804,7 @@
 
   @annotation_Creates_SerializedScriptValue
   @annotation_Returns_SerializedScriptValue
-  Object get data native;
+  Object? get data native;
 
   String get lastEventId native;
 
@@ -15787,7 +15814,7 @@
 
   @Creates('Client|ServiceWorker|MessagePort')
   @Returns('Client|ServiceWorker|MessagePort|Null')
-  Object get source native;
+  Object? get source native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -15815,7 +15842,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FaceDetector([Map faceDetectorOptions]) {
+  factory FaceDetector([Map? faceDetectorOptions]) {
     if (faceDetectorOptions != null) {
       var faceDetectorOptions_1 =
           convertDartToNative_Dictionary(faceDetectorOptions);
@@ -15848,7 +15875,7 @@
   static FederatedCredential _create_1(data) =>
       JS('FederatedCredential', 'new FederatedCredential(#)', data);
 
-  String get protocol native;
+  String? get protocol native;
 
   String get provider native;
 
@@ -15877,7 +15904,7 @@
   static FetchEvent _create_1(type, eventInitDict) =>
       JS('FetchEvent', 'new FetchEvent(#,#)', type, eventInitDict);
 
-  String get clientId native;
+  String? get clientId native;
 
   bool get isReload native;
 
@@ -15900,7 +15927,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FieldSetElement() => JS(
+  factory FieldSetElement() => JS<FieldSetElement>(
       'returns:FieldSetElement;creates:FieldSetElement;new:true',
       '#.createElement(#)',
       document,
@@ -15916,11 +15943,11 @@
 
   set disabled(bool value) native;
 
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get elements native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   String get name native;
 
@@ -15951,7 +15978,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory File(List<Object> fileBits, String fileName, [Map options]) {
+  factory File(List<Object> fileBits, String fileName, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return File._create_1(fileBits, fileName, options_1);
@@ -15984,7 +16011,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef void _FileCallback(File file);
+typedef void _FileCallback(File? file);
 // Copyright (c) 2012, 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.
@@ -15998,7 +16025,7 @@
 
   @JSName('createWriter')
   void _createWriter(_FileWriterCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   @JSName('createWriter')
   Future<FileWriter> createWriter() {
@@ -16013,7 +16040,7 @@
   }
 
   @JSName('file')
-  void _file(_FileCallback successCallback, [_ErrorCallback errorCallback])
+  void _file(_FileCallback successCallback, [_ErrorCallback? errorCallback])
       native;
 
   @JSName('file')
@@ -16086,7 +16113,7 @@
   File elementAt(int index) => this[index];
   // -- end List<File> mixins.
 
-  File item(int index) native;
+  File? item(int index) native;
 }
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -16094,7 +16121,7 @@
 
 @Native("FileReader")
 class FileReader extends EventTarget {
-  Object get result {
+  Object? get result {
     var res = JS('Null|String|NativeByteBuffer', '#.result', this);
     if (res is ByteBuffer) {
       return new Uint8List.view(res);
@@ -16172,7 +16199,7 @@
 
   static const int LOADING = 1;
 
-  DomException get error native;
+  DomException? get error native;
 
   int get readyState native;
 
@@ -16183,7 +16210,7 @@
   @JSName('readAsDataURL')
   void readAsDataUrl(Blob blob) native;
 
-  void readAsText(Blob blob, [String label]) native;
+  void readAsText(Blob blob, [String? label]) native;
 
   /// Stream of `abort` events handled by this [FileReader].
   Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
@@ -16300,7 +16327,7 @@
 
   static const int WRITING = 1;
 
-  DomException get error native;
+  DomException? get error native;
 
   int get length native;
 
@@ -16352,7 +16379,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FocusEvent(String type, [Map eventInitDict]) {
+  factory FocusEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return FocusEvent._create_1(type, eventInitDict_1);
@@ -16364,7 +16391,7 @@
   static FocusEvent _create_2(type) =>
       JS('FocusEvent', 'new FocusEvent(#)', type);
 
-  EventTarget get relatedTarget =>
+  EventTarget? get relatedTarget =>
       _convertNativeToDart_EventTarget(this._get_relatedTarget);
   @JSName('relatedTarget')
   @Creates('Null')
@@ -16381,7 +16408,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FontFace(String family, Object source, [Map descriptors]) {
+  factory FontFace(String family, Object source, [Map? descriptors]) {
     if (descriptors != null) {
       var descriptors_1 = convertDartToNative_Dictionary(descriptors);
       return FontFace._create_1(family, source, descriptors_1);
@@ -16457,13 +16484,13 @@
 
   FontFaceSet add(FontFace arg) native;
 
-  bool check(String font, [String text]) native;
+  bool check(String font, [String? text]) native;
 
   void clear() native;
 
   bool delete(FontFace arg) native;
 
-  void forEach(FontFaceSetForEachCallback callback, [Object thisArg]) native;
+  void forEach(FontFaceSetForEachCallback callback, [Object? thisArg]) native;
 
   bool has(FontFace arg) native;
 
@@ -16486,7 +16513,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FontFaceSetLoadEvent(String type, [Map eventInitDict]) {
+  factory FontFaceSetLoadEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return FontFaceSetLoadEvent._create_1(type, eventInitDict_1);
@@ -16555,7 +16582,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FormData([FormElement form]) {
+  factory FormData([FormElement? form]) {
     if (form != null) {
       return FormData._create_1(form);
     }
@@ -16570,17 +16597,17 @@
   void append(String name, String value) native;
 
   @JSName('append')
-  void appendBlob(String name, Blob value, [String filename]) native;
+  void appendBlob(String name, Blob value, [String? filename]) native;
 
   void delete(String name) native;
 
-  Object get(String name) native;
+  Object? get(String name) native;
 
   List<Object> getAll(String name) native;
 
   bool has(String name) native;
 
-  void set(String name, value, [String filename]) native;
+  void set(String name, value, [String? filename]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -16593,7 +16620,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory FormElement() => JS(
+  factory FormElement() => JS<FormElement>(
       'returns:FormElement;creates:FormElement;new:true',
       '#.createElement(#)',
       document,
@@ -16643,7 +16670,7 @@
 
   set target(String value) native;
 
-  Object __getter__(String name) native;
+  Object? __getter__(String name) native;
 
   bool checkValidity() native;
 
@@ -16651,7 +16678,7 @@
 
   bool reportValidity() native;
 
-  void requestAutocomplete(Map details) {
+  void requestAutocomplete(Map? details) {
     var details_1 = convertDartToNative_Dictionary(details);
     _requestAutocomplete_1(details_1);
     return;
@@ -16707,7 +16734,7 @@
 
   String get mapping native;
 
-  GamepadPose get pose native;
+  GamepadPose? get pose native;
 
   int get timestamp native;
 }
@@ -16739,7 +16766,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory GamepadEvent(String type, [Map eventInitDict]) {
+  factory GamepadEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return GamepadEvent._create_1(type, eventInitDict_1);
@@ -16764,21 +16791,21 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Float32List get angularAcceleration native;
+  Float32List? get angularAcceleration native;
 
-  Float32List get angularVelocity native;
+  Float32List? get angularVelocity native;
 
   bool get hasOrientation native;
 
   bool get hasPosition native;
 
-  Float32List get linearAcceleration native;
+  Float32List? get linearAcceleration native;
 
-  Float32List get linearVelocity native;
+  Float32List? get linearVelocity native;
 
-  Float32List get orientation native;
+  Float32List? get orientation native;
 
-  Float32List get position native;
+  Float32List? get position native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -16788,7 +16815,7 @@
 @Native("Geolocation")
 class Geolocation extends Interceptor {
   Future<Geoposition> getCurrentPosition(
-      {bool enableHighAccuracy, Duration timeout, Duration maximumAge}) {
+      {bool? enableHighAccuracy, Duration? timeout, Duration? maximumAge}) {
     var options = {};
     if (enableHighAccuracy != null) {
       options['enableHighAccuracy'] = enableHighAccuracy;
@@ -16813,7 +16840,7 @@
   }
 
   Stream<Geoposition> watchPosition(
-      {bool enableHighAccuracy, Duration timeout, Duration maximumAge}) {
+      {bool? enableHighAccuracy, Duration? timeout, Duration? maximumAge}) {
     var options = {};
     if (enableHighAccuracy != null) {
       options['enableHighAccuracy'] = enableHighAccuracy;
@@ -16825,13 +16852,13 @@
       options['maximumAge'] = maximumAge.inMilliseconds;
     }
 
-    int watchId;
+    int? watchId;
     StreamController<Geoposition> controller =
         new StreamController<Geoposition>(
             sync: true,
             onCancel: () {
               assert(watchId != null);
-              _clearWatch(watchId);
+              _clearWatch(watchId!);
             });
     controller.onListen = () {
       assert(watchId == null);
@@ -16864,7 +16891,7 @@
   void _clearWatch(int watchID) native;
 
   void _getCurrentPosition(_PositionCallback successCallback,
-      [_PositionErrorCallback errorCallback, Map options]) {
+      [_PositionErrorCallback? errorCallback, Map? options]) {
     if (options != null) {
       var successCallback_1 = convertDartClosureToJS(successCallback, 1);
       var options_2 = convertDartToNative_Dictionary(options);
@@ -16883,15 +16910,15 @@
 
   @JSName('getCurrentPosition')
   void _getCurrentPosition_1(
-      successCallback, _PositionErrorCallback errorCallback, options) native;
+      successCallback, _PositionErrorCallback? errorCallback, options) native;
   @JSName('getCurrentPosition')
   void _getCurrentPosition_2(
-      successCallback, _PositionErrorCallback errorCallback) native;
+      successCallback, _PositionErrorCallback? errorCallback) native;
   @JSName('getCurrentPosition')
   void _getCurrentPosition_3(successCallback) native;
 
   int _watchPosition(_PositionCallback successCallback,
-      [_PositionErrorCallback errorCallback, Map options]) {
+      [_PositionErrorCallback? errorCallback, Map? options]) {
     if (options != null) {
       var successCallback_1 = convertDartClosureToJS(successCallback, 1);
       var options_2 = convertDartToNative_Dictionary(options);
@@ -16907,9 +16934,9 @@
 
   @JSName('watchPosition')
   int _watchPosition_1(
-      successCallback, _PositionErrorCallback errorCallback, options) native;
+      successCallback, _PositionErrorCallback? errorCallback, options) native;
   @JSName('watchPosition')
-  int _watchPosition_2(successCallback, _PositionErrorCallback errorCallback)
+  int _watchPosition_2(successCallback, _PositionErrorCallback? errorCallback)
       native;
   @JSName('watchPosition')
   int _watchPosition_3(successCallback) native;
@@ -16950,11 +16977,11 @@
 // convince the scripts to make our instance methods abstract, and the bodies that
 // get generated require `this` to be an EventTarget.
 abstract class GlobalEventHandlers implements EventTarget {
-  void addEventListener(String type, dynamic listener(Event event),
-      [bool useCapture]);
+  void addEventListener(String type, dynamic listener(Event event)?,
+      [bool? useCapture]);
   bool dispatchEvent(Event event);
-  void removeEventListener(String type, dynamic listener(Event event),
-      [bool useCapture]);
+  void removeEventListener(String type, dynamic listener(Event event)?,
+      [bool? useCapture]);
   Events get on;
 
   // To suppress missing implicit constructor warnings.
@@ -17260,7 +17287,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory Gyroscope([Map sensorOptions]) {
+  factory Gyroscope([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return Gyroscope._create_1(sensorOptions_1);
@@ -17271,11 +17298,11 @@
       JS('Gyroscope', 'new Gyroscope(#)', sensorOptions);
   static Gyroscope _create_2() => JS('Gyroscope', 'new Gyroscope()');
 
-  num get x native;
+  num? get x native;
 
-  num get y native;
+  num? get y native;
 
-  num get z native;
+  num? get z native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -17291,8 +17318,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory HRElement() => JS('returns:HRElement;creates:HRElement;new:true',
-      '#.createElement(#)', document, "hr");
+  factory HRElement() => JS<HRElement>(
+      'returns:HRElement;creates:HRElement;new:true',
+      '#.createElement(#)',
+      document,
+      "hr");
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -17319,8 +17349,8 @@
   factory HashChangeEvent(String type,
       {bool canBubble: true,
       bool cancelable: true,
-      String oldUrl,
-      String newUrl}) {
+      String? oldUrl,
+      String? newUrl}) {
     var options = {
       'canBubble': canBubble,
       'cancelable': cancelable,
@@ -17331,7 +17361,7 @@
         convertDartToNative_Dictionary(options));
   }
 
-  factory HashChangeEvent._(String type, [Map eventInitDict]) {
+  factory HashChangeEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return HashChangeEvent._create_1(type, eventInitDict_1);
@@ -17363,7 +17393,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory HeadElement() => JS(
+  factory HeadElement() => JS<HeadElement>(
       'returns:HeadElement;creates:HeadElement;new:true',
       '#.createElement(#)',
       document,
@@ -17386,7 +17416,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory Headers([Object init]) {
+  factory Headers([Object? init]) {
     if (init != null) {
       return Headers._create_1(init);
     }
@@ -17406,37 +17436,37 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory HeadingElement.h1() => JS(
+  factory HeadingElement.h1() => JS<HeadingElement>(
       'returns:HeadingElement;creates:HeadingElement;new:true',
       '#.createElement(#)',
       document,
       "h1");
 
-  factory HeadingElement.h2() => JS(
+  factory HeadingElement.h2() => JS<HeadingElement>(
       'returns:HeadingElement;creates:HeadingElement;new:true',
       '#.createElement(#)',
       document,
       "h2");
 
-  factory HeadingElement.h3() => JS(
+  factory HeadingElement.h3() => JS<HeadingElement>(
       'returns:HeadingElement;creates:HeadingElement;new:true',
       '#.createElement(#)',
       document,
       "h3");
 
-  factory HeadingElement.h4() => JS(
+  factory HeadingElement.h4() => JS<HeadingElement>(
       'returns:HeadingElement;creates:HeadingElement;new:true',
       '#.createElement(#)',
       document,
       "h4");
 
-  factory HeadingElement.h5() => JS(
+  factory HeadingElement.h5() => JS<HeadingElement>(
       'returns:HeadingElement;creates:HeadingElement;new:true',
       '#.createElement(#)',
       document,
       "h5");
 
-  factory HeadingElement.h6() => JS(
+  factory HeadingElement.h6() => JS<HeadingElement>(
       'returns:HeadingElement;creates:HeadingElement;new:true',
       '#.createElement(#)',
       document,
@@ -17486,13 +17516,13 @@
 
   void forward() native;
 
-  void go([int delta]) native;
+  void go([int? delta]) native;
 
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  void pushState(/*SerializedScriptValue*/ data, String title, String url) {
+  void pushState(/*SerializedScriptValue*/ data, String title, String? url) {
     var data_1 = convertDartToNative_SerializedScriptValue(data);
     _pushState_1(data_1, title, url);
     return;
@@ -17509,7 +17539,7 @@
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  void replaceState(/*SerializedScriptValue*/ data, String title, String url) {
+  void replaceState(/*SerializedScriptValue*/ data, String title, String? url) {
     var data_1 = convertDartToNative_SerializedScriptValue(data);
     _replaceState_1(data_1, title, url);
     return;
@@ -17580,9 +17610,9 @@
   Node elementAt(int index) => this[index];
   // -- end List<Node> mixins.
 
-  Node item(int index) native;
+  Node? item(int? index) native;
 
-  Object namedItem(String name) native;
+  Object? namedItem(String name) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -17597,29 +17627,29 @@
     throw new UnsupportedError("Not supported");
   }
 
-  BodyElement get body native;
-  set body(BodyElement value) native;
+  BodyElement? get body native;
+  set body(BodyElement? value) native;
 
   /// UNSTABLE: Chrome-only - create a Range from the given point.
   @Unstable()
-  Range caretRangeFromPoint(int x, int y) {
+  Range caretRangeFromPoint(int? x, int? y) {
     return _caretRangeFromPoint(x, y);
   }
 
-  Element elementFromPoint(int x, int y) {
+  Element? elementFromPoint(int x, int y) {
     return _elementFromPoint(x, y);
   }
 
-  HeadElement get head => _head;
+  HeadElement? get head => _head;
 
   String get lastModified => _lastModified;
 
-  String get preferredStylesheetSet => _preferredStylesheetSet;
+  String? get preferredStylesheetSet => _preferredStylesheetSet;
 
   String get referrer => _referrer;
 
-  String get selectedStylesheetSet => _selectedStylesheetSet;
-  set selectedStylesheetSet(String value) {
+  String? get selectedStylesheetSet => _selectedStylesheetSet;
+  set selectedStylesheetSet(String? value) {
     _selectedStylesheetSet = value;
   }
 
@@ -17690,13 +17720,13 @@
    * `<input is="x-bar"></input>`
    *
    */
-  Function registerElement2(String tag, [Map options]) {
+  Function registerElement2(String tag, [Map? options]) {
     return _registerCustomElement(JS('', 'window'), this, tag, options);
   }
 
   /** *Deprecated*: use [registerElement] instead. */
   @deprecated
-  void register(String tag, Type customElementClass, {String extendsTag}) {
+  void register(String tag, Type customElementClass, {String? extendsTag}) {
     return registerElement(tag, customElementClass, extendsTag: extendsTag);
   }
 
@@ -17740,7 +17770,7 @@
   ///
   /// If the type is not a direct subclass of HtmlElement then the extendsTag
   /// parameter must be provided.
-  ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) {
+  ElementUpgrader createElementUpgrader(Type type, {String? extendsTag}) {
     return new _JSElementUpgrader(this, type, extendsTag);
   }
 }
@@ -17755,7 +17785,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Object namedItem(String name) native;
+  Object? namedItem(String name) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -17768,7 +17798,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory HtmlHtmlElement() => JS(
+  factory HtmlHtmlElement() => JS<HtmlHtmlElement>(
       'returns:HtmlHtmlElement;creates:HtmlHtmlElement;new:true',
       '#.createElement(#)',
       document,
@@ -17845,7 +17875,7 @@
   }
 
   @JSName('item')
-  Element _item(int index) native;
+  Element? _item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -17920,7 +17950,7 @@
    * * [request]
    */
   static Future<String> getString(String url,
-      {bool withCredentials, void onProgress(ProgressEvent e)}) {
+      {bool? withCredentials, void onProgress(ProgressEvent e)?}) {
     return request(url,
             withCredentials: withCredentials, onProgress: onProgress)
         .then((HttpRequest xhr) => xhr.responseText);
@@ -17952,10 +17982,10 @@
    * * [request]
    */
   static Future<HttpRequest> postFormData(String url, Map<String, String> data,
-      {bool withCredentials,
-      String responseType,
-      Map<String, String> requestHeaders,
-      void onProgress(ProgressEvent e)}) {
+      {bool? withCredentials,
+      String? responseType,
+      Map<String, String>? requestHeaders,
+      void onProgress(ProgressEvent e)?}) {
     var parts = [];
     data.forEach((key, value) {
       parts.add('${Uri.encodeQueryComponent(key)}='
@@ -18033,13 +18063,13 @@
    * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
    */
   static Future<HttpRequest> request(String url,
-      {String method,
-      bool withCredentials,
-      String responseType,
-      String mimeType,
-      Map<String, String> requestHeaders,
+      {String? method,
+      bool? withCredentials,
+      String? responseType,
+      String? mimeType,
+      Map<String, String>? requestHeaders,
       sendData,
-      void onProgress(ProgressEvent e)}) {
+      void onProgress(ProgressEvent e)?}) {
     var completer = new Completer<HttpRequest>();
 
     var xhr = new HttpRequest();
@@ -18143,7 +18173,7 @@
    * cross-origin support is not required then [request] should be used instead.
    */
   static Future<String> requestCrossOrigin(String url,
-      {String method, String sendData}) {
+      {String? method, String? sendData}) {
     if (supportsCrossOrigin) {
       return request(url, method: method, sendData: sendData).then((xhr) {
         return xhr.responseText;
@@ -18161,7 +18191,7 @@
         xhr,
         convertDartClosureToJS((e) {
           var response = JS('String', '#.responseText', xhr);
-          completer.complete(response);
+          completer.complete(response as FutureOr<String>?);
         }, 1));
     JS(
         '',
@@ -18239,7 +18269,7 @@
    * finer-grained control is needed.
    */
   void open(String method, String url,
-      {bool async, String user, String password}) native;
+      {bool? async, String? user, String? password}) native;
 
   // To suppress missing implicit constructor warnings.
   factory HttpRequest._() {
@@ -18384,7 +18414,7 @@
    * synchronous.
    */
 
-  Document get responseXml native;
+  Document? get responseXml native;
 
   /**
    * The HTTP result code from the request (200, 404, etc).
@@ -18469,7 +18499,7 @@
    * for a list of common response headers.
    */
   @Unstable()
-  String getResponseHeader(String name) native;
+  String? getResponseHeader(String name) native;
 
   /**
    * Specify a particular MIME type (such as `text/xml`) desired for the
@@ -18649,7 +18679,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory IFrameElement() => JS(
+  factory IFrameElement() => JS<IFrameElement>(
       'returns:IFrameElement;creates:IFrameElement;new:true',
       '#.createElement(#)',
       document,
@@ -18673,7 +18703,7 @@
 
   set allowPaymentRequest(bool value) native;
 
-  WindowBase get contentWindow =>
+  WindowBase? get contentWindow =>
       _convertNativeToDart_Window(this._get_contentWindow);
   @JSName('contentWindow')
   @Creates('Window|=Object')
@@ -18762,7 +18792,7 @@
 
   CanvasElement get canvas native;
 
-  void transferFromImageBitmap(ImageBitmap bitmap) native;
+  void transferFromImageBitmap(ImageBitmap? bitmap) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -18787,7 +18817,7 @@
       promiseToFuture<PhotoCapabilities>(
           JS("", "#.getPhotoCapabilities()", this));
 
-  Future<Map<String, dynamic>> getPhotoSettings() =>
+  Future<Map<String, dynamic>?> getPhotoSettings() =>
       promiseToFutureAsMap(JS("", "#.getPhotoSettings()", this));
 
   Future<ImageBitmap> grabFrame() =>
@@ -18798,7 +18828,7 @@
     return promiseToFuture(JS("", "#.setOptions(#)", this, photoSettings_dict));
   }
 
-  Future<Blob> takePhoto([Map photoSettings]) {
+  Future<Blob> takePhoto([Map? photoSettings]) {
     var photoSettings_dict = null;
     if (photoSettings != null) {
       photoSettings_dict = convertDartToNative_Dictionary(photoSettings);
@@ -18818,7 +18848,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ImageData(data_OR_sw, int sh_OR_sw, [int sh]) {
+  factory ImageData(data_OR_sw, int sh_OR_sw, [int? sh]) {
     if ((sh_OR_sw is int) && (data_OR_sw is int) && sh == null) {
       return ImageData._create_1(data_OR_sw, sh_OR_sw);
     }
@@ -18856,9 +18886,12 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ImageElement({String src, int width, int height}) {
-    ImageElement e = JS('returns:ImageElement;creates:ImageElement;new:true',
-        '#.createElement(#)', document, "img");
+  factory ImageElement({String? src, int? width, int? height}) {
+    ImageElement e = JS<ImageElement>(
+        'returns:ImageElement;creates:ImageElement;new:true',
+        '#.createElement(#)',
+        document,
+        "img");
     if (src != null) e.src = src;
     if (width != null) e.width = width;
     if (height != null) e.height = height;
@@ -18881,9 +18914,9 @@
 
   bool get complete native;
 
-  String get crossOrigin native;
+  String? get crossOrigin native;
 
-  set crossOrigin(String value) native;
+  set crossOrigin(String? value) native;
 
   String get currentSrc native;
 
@@ -18936,7 +18969,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory InputDeviceCapabilities([Map deviceInitDict]) {
+  factory InputDeviceCapabilities([Map? deviceInitDict]) {
     if (deviceInitDict != null) {
       var deviceInitDict_1 = convertDartToNative_Dictionary(deviceInitDict);
       return InputDeviceCapabilities._create_1(deviceInitDict_1);
@@ -18980,8 +19013,8 @@
         ImageButtonInputElement,
         ResetButtonInputElement,
         ButtonInputElement {
-  factory InputElement({String type}) {
-    InputElement e = document.createElement("input");
+  factory InputElement({String? type}) {
+    InputElement e = document.createElement("input") as InputElement;
     if (type != null) {
       try {
         // IE throws an exception for unknown types.
@@ -19048,11 +19081,11 @@
 
   @Returns('FileList|Null')
   @Creates('FileList')
-  List<File> get files native;
+  List<File>? get files native;
 
-  set files(List<File> value) native;
+  set files(List<File>? value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   String get formAction native;
 
@@ -19086,11 +19119,11 @@
 
   set indeterminate(bool value) native;
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
-  HtmlElement get list native;
+  HtmlElement? get list native;
 
   String get max native;
 
@@ -19132,17 +19165,17 @@
 
   set required(bool value) native;
 
-  String get selectionDirection native;
+  String? get selectionDirection native;
 
-  set selectionDirection(String value) native;
+  set selectionDirection(String? value) native;
 
-  int get selectionEnd native;
+  int? get selectionEnd native;
 
-  set selectionEnd(int value) native;
+  set selectionEnd(int? value) native;
 
-  int get selectionStart native;
+  int? get selectionStart native;
 
-  set selectionStart(int value) native;
+  set selectionStart(int? value) native;
 
   int get size native;
 
@@ -19166,7 +19199,7 @@
 
   String get value native;
 
-  set value(String value) native;
+  set value(String? value) native;
 
   DateTime get valueAsDate =>
       convertNativeToDart_DateTime(this._get_valueAsDate);
@@ -19174,8 +19207,8 @@
   @Creates('Null')
   dynamic get _get_valueAsDate native;
 
-  set valueAsDate(DateTime value) {
-    this._set_valueAsDate = convertDartToNative_DateTime(value);
+  set valueAsDate(DateTime? value) {
+    this._set_valueAsDate = convertDartToNative_DateTime(value!);
   }
 
   set _set_valueAsDate(/*dynamic*/ value) {
@@ -19214,13 +19247,13 @@
   void setCustomValidity(String error) native;
 
   void setRangeText(String replacement,
-      {int start, int end, String selectionMode}) native;
+      {int? start, int? end, String? selectionMode}) native;
 
-  void setSelectionRange(int start, int end, [String direction]) native;
+  void setSelectionRange(int start, int end, [String? direction]) native;
 
-  void stepDown([int n]) native;
+  void stepDown([int? n]) native;
 
-  void stepUp([int n]) native;
+  void stepUp([int? n]) native;
 }
 
 // Interfaces representing the InputElement APIs which are supported
@@ -19247,7 +19280,7 @@
   set name(String value);
 
   String get value;
-  set value(String value);
+  set value(String? value);
 
   List<Node> get labels;
 
@@ -19296,16 +19329,16 @@
 
   void select();
 
-  String get selectionDirection;
-  set selectionDirection(String value);
+  String? get selectionDirection;
+  set selectionDirection(String? value);
 
-  int get selectionEnd;
-  set selectionEnd(int value);
+  int? get selectionEnd;
+  set selectionEnd(int? value);
 
-  int get selectionStart;
-  set selectionStart(int value);
+  int? get selectionStart;
+  set selectionStart(int? value);
 
-  void setSelectionRange(int start, int end, [String direction]);
+  void setSelectionRange(int start, int end, [String? direction]);
 }
 
 /**
@@ -19324,7 +19357,7 @@
   String get dirName;
   set dirName(String value);
 
-  Element get list;
+  Element? get list;
 
   /// Returns true if this input type is supported on the current platform.
   static bool get supported {
@@ -19341,7 +19374,7 @@
   String get dirName;
   set dirName(String value);
 
-  Element get list;
+  Element? get list;
 }
 
 /**
@@ -19356,7 +19389,7 @@
 abstract class UrlInputElement implements TextInputElementBase {
   factory UrlInputElement() => new InputElement(type: 'url');
 
-  Element get list;
+  Element? get list;
 
   /// Returns true if this input type is supported on the current platform.
   static bool get supported {
@@ -19379,7 +19412,7 @@
 abstract class TelephoneInputElement implements TextInputElementBase {
   factory TelephoneInputElement() => new InputElement(type: 'tel');
 
-  Element get list;
+  Element? get list;
 
   /// Returns true if this input type is supported on the current platform.
   static bool get supported {
@@ -19405,7 +19438,7 @@
   bool get autofocus;
   set autofocus(bool value);
 
-  Element get list;
+  Element? get list;
 
   int get maxLength;
   set maxLength(int value);
@@ -19445,7 +19478,7 @@
  * Base interface for all input element types which involve ranges.
  */
 abstract class RangeInputElementBase implements InputElementBase {
-  Element get list;
+  Element? get list;
 
   String get max;
   set max(String value);
@@ -19459,9 +19492,9 @@
   num get valueAsNumber;
   set valueAsNumber(num value);
 
-  void stepDown([int n]);
+  void stepDown([int? n]);
 
-  void stepUp([int n]);
+  void stepUp([int? n]);
 }
 
 /**
@@ -19676,7 +19709,7 @@
   bool get required;
   set required(bool value);
 
-  List<File> files;
+  List<File>? files;
 }
 
 /**
@@ -19760,7 +19793,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory InstallEvent(String type, [Map eventInitDict]) {
+  factory InstallEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return InstallEvent._create_1(type, eventInitDict_1);
@@ -19793,7 +19826,7 @@
   }
 
   factory IntersectionObserver(IntersectionObserverCallback callback,
-      [Map options]) {
+      [Map? options]) {
     if (options != null) {
       var callback_1 = convertDartClosureToJS(callback, 2);
       var options_2 = convertDartToNative_Dictionary(options);
@@ -19810,7 +19843,7 @@
   static IntersectionObserver _create_2(callback) =>
       JS('IntersectionObserver', 'new IntersectionObserver(#)', callback);
 
-  Element get root native;
+  Element? get root native;
 
   String get rootMargin native;
 
@@ -19851,7 +19884,7 @@
 
   bool get isIntersecting native;
 
-  DomRectReadOnly get rootBounds native;
+  DomRectReadOnly? get rootBounds native;
 
   Element get target native;
 
@@ -19900,11 +19933,11 @@
    * Event [KeyEvent].
    */
   factory KeyboardEvent(String type,
-      {Window view,
+      {Window? view,
       bool canBubble: true,
       bool cancelable: true,
-      int location,
-      int keyLocation, // Legacy alias for location
+      int? location,
+      int? keyLocation, // Legacy alias for location
       bool ctrlKey: false,
       bool altKey: false,
       bool shiftKey: false,
@@ -19913,7 +19946,7 @@
       view = window;
     }
     location ??= keyLocation ?? 1;
-    KeyboardEvent e = document._createEvent("KeyboardEvent");
+    KeyboardEvent e = document._createEvent("KeyboardEvent") as KeyboardEvent;
     e._initKeyboardEvent(type, canBubble, cancelable, view, "", location,
         ctrlKey, altKey, shiftKey, metaKey);
     return e;
@@ -19923,9 +19956,9 @@
       String type,
       bool canBubble,
       bool cancelable,
-      Window view,
+      Window? view,
       String keyIdentifier,
-      int location,
+      int? location,
       bool ctrlKey,
       bool altKey,
       bool shiftKey,
@@ -19962,7 +19995,7 @@
 
   int get which => _which;
 
-  factory KeyboardEvent._(String type, [Map eventInitDict]) {
+  factory KeyboardEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return KeyboardEvent._create_1(type, eventInitDict_1);
@@ -20019,7 +20052,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory KeyframeEffect(Element target, Object effect, [Object options]) {
+  factory KeyframeEffect(Element? target, Object? effect, [Object? options]) {
     if (options != null) {
       return KeyframeEffect._create_1(target, effect, options);
     }
@@ -20041,8 +20074,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory KeyframeEffectReadOnly(Element target, Object effect,
-      [Object options]) {
+  factory KeyframeEffectReadOnly(Element? target, Object? effect,
+      [Object? options]) {
     if (options != null) {
       return KeyframeEffectReadOnly._create_1(target, effect, options);
     }
@@ -20071,8 +20104,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory LIElement() => JS('returns:LIElement;creates:LIElement;new:true',
-      '#.createElement(#)', document, "li");
+  factory LIElement() => JS<LIElement>(
+      'returns:LIElement;creates:LIElement;new:true',
+      '#.createElement(#)',
+      document,
+      "li");
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20095,7 +20131,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory LabelElement() => JS(
+  factory LabelElement() => JS<LabelElement>(
       'returns:LabelElement;creates:LabelElement;new:true',
       '#.createElement(#)',
       document,
@@ -20107,9 +20143,9 @@
    */
   LabelElement.created() : super.created();
 
-  HtmlElement get control native;
+  HtmlElement? get control native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   String get htmlFor native;
 
@@ -20126,7 +20162,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory LegendElement() => JS(
+  factory LegendElement() => JS<LegendElement>(
       'returns:LegendElement;creates:LegendElement;new:true',
       '#.createElement(#)',
       document,
@@ -20138,7 +20174,7 @@
    */
   LegendElement.created() : super.created();
 
-  FormElement get form native;
+  FormElement? get form native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -20151,7 +20187,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory LinearAccelerationSensor([Map sensorOptions]) {
+  factory LinearAccelerationSensor([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return LinearAccelerationSensor._create_1(sensorOptions_1);
@@ -20176,7 +20212,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory LinkElement() => JS(
+  factory LinkElement() => JS<LinkElement>(
       'returns:LinkElement;creates:LinkElement;new:true',
       '#.createElement(#)',
       document,
@@ -20192,9 +20228,9 @@
 
   set as(String value) native;
 
-  String get crossOrigin native;
+  String? get crossOrigin native;
 
-  set crossOrigin(String value) native;
+  set crossOrigin(String? value) native;
 
   bool get disabled native;
 
@@ -20208,7 +20244,7 @@
 
   set hreflang(String value) native;
 
-  Document get import native;
+  Document? get import native;
 
   String get integrity native;
 
@@ -20232,7 +20268,7 @@
 
   set scope(String value) native;
 
-  StyleSheet get sheet native;
+  StyleSheet? get sheet native;
 
   DomTokenList get sizes native;
 
@@ -20256,7 +20292,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  @Returns('DomStringList|Null')
+  @Returns('DomStringList')
   @Creates('DomStringList')
   List<String> get ancestorOrigins native;
 
@@ -20296,11 +20332,11 @@
 
   set trustedHref(TrustedUrl value) native;
 
-  void assign([String url]) native;
+  void assign([String? url]) native;
 
   void reload() native;
 
-  void replace(String url) native;
+  void replace(String? url) native;
 
   String get origin {
     if (JS('bool', '("origin" in #)', this)) {
@@ -20322,7 +20358,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory Magnetometer([Map sensorOptions]) {
+  factory Magnetometer([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return Magnetometer._create_1(sensorOptions_1);
@@ -20333,11 +20369,11 @@
       JS('Magnetometer', 'new Magnetometer(#)', sensorOptions);
   static Magnetometer _create_2() => JS('Magnetometer', 'new Magnetometer()');
 
-  num get x native;
+  num? get x native;
 
-  num get y native;
+  num? get y native;
 
-  num get z native;
+  num? get z native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -20350,8 +20386,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MapElement() => JS('returns:MapElement;creates:MapElement;new:true',
-      '#.createElement(#)', document, "map");
+  factory MapElement() => JS<MapElement>(
+      'returns:MapElement;creates:MapElement;new:true',
+      '#.createElement(#)',
+      document,
+      "map");
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20359,7 +20398,7 @@
    */
   MapElement.created() : super.created();
 
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get areas native;
 
@@ -20441,13 +20480,13 @@
       promiseToFuture<List<dynamic>>(JS("", "#.enumerateDevices()", this));
 
   Map getSupportedConstraints() {
-    return convertNativeToDart_Dictionary(_getSupportedConstraints_1());
+    return convertNativeToDart_Dictionary(_getSupportedConstraints_1())!;
   }
 
   @JSName('getSupportedConstraints')
   _getSupportedConstraints_1() native;
 
-  Future<MediaStream> getUserMedia([Map constraints]) {
+  Future<MediaStream> getUserMedia([Map? constraints]) {
     var constraints_dict = null;
     if (constraints != null) {
       constraints_dict = convertDartToNative_Dictionary(constraints);
@@ -20506,9 +20545,9 @@
 
   DomTokenList get controlsList native;
 
-  String get crossOrigin native;
+  String? get crossOrigin native;
 
-  set crossOrigin(String value) native;
+  set crossOrigin(String? value) native;
 
   String get currentSrc native;
 
@@ -20532,7 +20571,7 @@
 
   bool get ended native;
 
-  MediaError get error native;
+  MediaError? get error native;
 
   bool get loop native;
 
@@ -20594,10 +20633,10 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   int get videoDecodedByteCount native;
 
-  TextTrack addTextTrack(String kind, [String label, String language]) native;
+  TextTrack addTextTrack(String kind, [String? label, String? language]) native;
 
   @Unstable()
-  String canPlayType(String type, [String keySystem]) native;
+  String canPlayType(String? type, [String? keySystem]) native;
 
   MediaStream captureStream() native;
 
@@ -20607,7 +20646,7 @@
 
   Future play() => promiseToFuture(JS("", "#.play()", this));
 
-  Future setMediaKeys(MediaKeys mediaKeys) =>
+  Future setMediaKeys(MediaKeys? mediaKeys) =>
       promiseToFuture(JS("", "#.setMediaKeys(#)", this, mediaKeys));
 
   Future setSinkId(String sinkId) =>
@@ -20624,7 +20663,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MediaEncryptedEvent(String type, [Map eventInitDict]) {
+  factory MediaEncryptedEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MediaEncryptedEvent._create_1(type, eventInitDict_1);
@@ -20639,7 +20678,7 @@
   static MediaEncryptedEvent _create_2(type) =>
       JS('MediaEncryptedEvent', 'new MediaEncryptedEvent(#)', type);
 
-  ByteBuffer get initData native;
+  ByteBuffer? get initData native;
 
   String get initDataType native;
 }
@@ -20743,7 +20782,7 @@
 
   int get size native;
 
-  Object get(/*BufferSource*/ keyId) native;
+  Object? get(/*BufferSource*/ keyId) native;
 
   bool has(/*BufferSource*/ keyId) native;
 }
@@ -20764,7 +20803,7 @@
       promiseToFuture(JS("", "#.createMediaKeys()", this));
 
   Map getConfiguration() {
-    return convertNativeToDart_Dictionary(_getConfiguration_1());
+    return convertNativeToDart_Dictionary(_getConfiguration_1())!;
   }
 
   @JSName('getConfiguration')
@@ -20782,7 +20821,7 @@
   }
 
   @JSName('createSession')
-  MediaKeySession _createSession([String sessionType]) native;
+  MediaKeySession _createSession([String? sessionType]) native;
 
   Future getStatusForPolicy(MediaKeysPolicy policy) =>
       promiseToFuture(JS("", "#.getStatusForPolicy(#)", this, policy));
@@ -20825,15 +20864,15 @@
 
   int get length native;
 
-  String get mediaText native;
+  String? get mediaText native;
 
-  set mediaText(String value) native;
+  set mediaText(String? value) native;
 
   void appendMedium(String medium) native;
 
   void deleteMedium(String medium) native;
 
-  String item(int index) native;
+  String? item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -20846,7 +20885,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MediaMetadata([Map metadata]) {
+  factory MediaMetadata([Map? metadata]) {
     if (metadata != null) {
       var metadata_1 = convertDartToNative_Dictionary(metadata);
       return MediaMetadata._create_1(metadata_1);
@@ -20893,9 +20932,9 @@
 
   String get media native;
 
-  void addListener(EventListener listener) native;
+  void addListener(EventListener? listener) native;
 
-  void removeListener(EventListener listener) native;
+  void removeListener(EventListener? listener) native;
 
   Stream<Event> get onChange => changeEvent.forTarget(this);
 }
@@ -20910,7 +20949,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MediaQueryListEvent(String type, [Map eventInitDict]) {
+  factory MediaQueryListEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MediaQueryListEvent._create_1(type, eventInitDict_1);
@@ -20946,7 +20985,7 @@
   static const EventStreamProvider<Event> pauseEvent =
       const EventStreamProvider<Event>('pause');
 
-  factory MediaRecorder(MediaStream stream, [Map options]) {
+  factory MediaRecorder(MediaStream stream, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return MediaRecorder._create_1(stream, options_1);
@@ -20976,7 +21015,7 @@
 
   void resume() native;
 
-  void start([int timeslice]) native;
+  void start([int? timeslice]) native;
 
   void stop() native;
 
@@ -20995,15 +21034,15 @@
     throw new UnsupportedError("Not supported");
   }
 
-  MediaMetadata get metadata native;
+  MediaMetadata? get metadata native;
 
-  set metadata(MediaMetadata value) native;
+  set metadata(MediaMetadata? value) native;
 
   String get playbackState native;
 
   set playbackState(String value) native;
 
-  void setActionHandler(String action, MediaSessionActionHandler handler)
+  void setActionHandler(String action, MediaSessionActionHandler? handler)
       native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -21065,7 +21104,7 @@
 
   void clearLiveSeekableRange() native;
 
-  void endOfStream([String error]) native;
+  void endOfStream([String? error]) native;
 
   static bool isTypeSupported(String type) native;
 
@@ -21133,7 +21172,7 @@
   @Returns('JSExtendableArray')
   List<MediaStreamTrack> getAudioTracks() native;
 
-  MediaStreamTrack getTrackById(String trackId) native;
+  MediaStreamTrack? getTrackById(String trackId) native;
 
   List<MediaStreamTrack> getTracks() native;
 
@@ -21177,7 +21216,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MediaStreamEvent(String type, [Map eventInitDict]) {
+  factory MediaStreamEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MediaStreamEvent._create_1(type, eventInitDict_1);
@@ -21192,7 +21231,7 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => Device.isEventTypeSupported('MediaStreamEvent');
 
-  MediaStream get stream native;
+  MediaStream? get stream native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -21251,7 +21290,7 @@
 
   String get readyState native;
 
-  Future applyConstraints([Map constraints]) {
+  Future applyConstraints([Map? constraints]) {
     var constraints_dict = null;
     if (constraints != null) {
       constraints_dict = convertDartToNative_Dictionary(constraints);
@@ -21263,21 +21302,21 @@
   MediaStreamTrack clone() native;
 
   Map getCapabilities() {
-    return convertNativeToDart_Dictionary(_getCapabilities_1());
+    return convertNativeToDart_Dictionary(_getCapabilities_1())!;
   }
 
   @JSName('getCapabilities')
   _getCapabilities_1() native;
 
   Map getConstraints() {
-    return convertNativeToDart_Dictionary(_getConstraints_1());
+    return convertNativeToDart_Dictionary(_getConstraints_1())!;
   }
 
   @JSName('getConstraints')
   _getConstraints_1() native;
 
   Map getSettings() {
-    return convertNativeToDart_Dictionary(_getSettings_1());
+    return convertNativeToDart_Dictionary(_getSettings_1())!;
   }
 
   @JSName('getSettings')
@@ -21360,7 +21399,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MenuElement() => JS(
+  factory MenuElement() => JS<MenuElement>(
       'returns:MenuElement;creates:MenuElement;new:true',
       '#.createElement(#)',
       document,
@@ -21412,10 +21451,10 @@
   factory MessageEvent(String type,
       {bool canBubble: false,
       bool cancelable: false,
-      Object data,
-      String origin,
-      String lastEventId,
-      Window source,
+      Object? data,
+      String? origin,
+      String? lastEventId,
+      Window? source,
       List<MessagePort> messagePorts: const []}) {
     if (source == null) {
       source = window;
@@ -21435,7 +21474,7 @@
           source,
           messagePorts);
     }
-    MessageEvent event = document._createEvent("MessageEvent");
+    MessageEvent event = document._createEvent("MessageEvent") as MessageEvent;
     event._initMessageEvent(type, canBubble, cancelable, data, origin,
         lastEventId, source, messagePorts);
     return event;
@@ -21451,7 +21490,7 @@
   @annotation_Returns_SerializedScriptValue
   dynamic get _get_data native;
 
-  factory MessageEvent._(String type, [Map eventInitDict]) {
+  factory MessageEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MessageEvent._create_1(type, eventInitDict_1);
@@ -21472,7 +21511,7 @@
   @Creates('JSExtendableArray')
   List<MessagePort> get ports native;
 
-  EventTarget get source => _convertNativeToDart_EventTarget(this._get_source);
+  EventTarget? get source => _convertNativeToDart_EventTarget(this._get_source);
   @JSName('source')
   @Creates('Null')
   @Returns('EventTarget|=Object')
@@ -21481,14 +21520,14 @@
   String get suborigin native;
 
   void _initMessageEvent(
-      String typeArg,
-      bool canBubbleArg,
-      bool cancelableArg,
-      Object dataArg,
-      String originArg,
-      String lastEventIdArg,
-      EventTarget sourceArg,
-      List<MessagePort> portsArg) {
+      String? typeArg,
+      bool? canBubbleArg,
+      bool? cancelableArg,
+      Object? dataArg,
+      String? originArg,
+      String? lastEventIdArg,
+      EventTarget? sourceArg,
+      List<MessagePort>? portsArg) {
     var sourceArg_1 = _convertDartToNative_EventTarget(sourceArg);
     _initMessageEvent_1(typeArg, canBubbleArg, cancelableArg, dataArg,
         originArg, lastEventIdArg, sourceArg_1, portsArg);
@@ -21497,7 +21536,7 @@
 
   @JSName('initMessageEvent')
   void _initMessageEvent_1(typeArg, canBubbleArg, cancelableArg, dataArg,
-      originArg, lastEventIdArg, sourceArg, List<MessagePort> portsArg) native;
+      originArg, lastEventIdArg, sourceArg, List<MessagePort>? portsArg) native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -21508,8 +21547,8 @@
 @Unstable()
 @Native("MessagePort")
 class MessagePort extends EventTarget {
-  void addEventListener(String type, EventListener listener,
-      [bool useCapture]) {
+  void addEventListener(String type, EventListener? listener,
+      [bool? useCapture]) {
     // Messages posted to ports are initially paused, allowing listeners to be
     // setup, start() needs to be explicitly invoked to begin handling messages.
     if (type == 'message') {
@@ -21535,7 +21574,7 @@
 
   void close() native;
 
-  void postMessage(/*any*/ message, [List<Object> transfer]) {
+  void postMessage(/*any*/ message, [List<Object>? transfer]) {
     if (transfer != null) {
       var message_1 = convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, transfer);
@@ -21569,7 +21608,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MetaElement() => JS(
+  factory MetaElement() => JS<MetaElement>(
       'returns:MetaElement;creates:MetaElement;new:true',
       '#.createElement(#)',
       document,
@@ -21634,7 +21673,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MeterElement() => document.createElement("meter");
+  factory MeterElement() => document.createElement("meter") as MeterElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -21650,7 +21689,7 @@
   set high(num value) native;
 
   @Unstable()
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
@@ -21702,7 +21741,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MidiConnectionEvent(String type, [Map eventInitDict]) {
+  factory MidiConnectionEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MidiConnectionEvent._create_1(type, eventInitDict_1);
@@ -21754,7 +21793,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Map _getItem(String key) =>
+  Map? _getItem(String key) =>
       convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
 
   void addAll(Map<String, dynamic> other) {
@@ -21765,7 +21804,7 @@
 
   bool containsKey(dynamic key) => _getItem(key) != null;
 
-  Map operator [](dynamic key) => _getItem(key);
+  Map? operator [](dynamic key) => _getItem(key);
 
   void forEach(void f(String key, dynamic value)) {
     var entries = JS('', '#.entries()', this);
@@ -21822,7 +21861,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory MidiMessageEvent(String type, [Map eventInitDict]) {
+  factory MidiMessageEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MidiMessageEvent._create_1(type, eventInitDict_1);
@@ -21847,7 +21886,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  void send(Uint8List data, [num timestamp]) native;
+  void send(Uint8List data, [num? timestamp]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -21860,7 +21899,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Map _getItem(String key) =>
+  Map? _getItem(String key) =>
       convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
 
   void addAll(Map<String, dynamic> other) {
@@ -21871,7 +21910,7 @@
 
   bool containsKey(dynamic key) => _getItem(key) != null;
 
-  Map operator [](dynamic key) => _getItem(key);
+  Map? operator [](dynamic key) => _getItem(key);
 
   void forEach(void f(String key, dynamic value)) {
     var entries = JS('', '#.entries()', this);
@@ -22023,9 +22062,9 @@
   MimeType elementAt(int index) => this[index];
   // -- end List<MimeType> mixins.
 
-  MimeType item(int index) native;
+  MimeType? item(int index) native;
 
-  MimeType namedItem(String name) native;
+  MimeType? namedItem(String name) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -22067,7 +22106,7 @@
 @Native("MouseEvent,DragEvent")
 class MouseEvent extends UIEvent {
   factory MouseEvent(String type,
-      {Window view,
+      {Window? view,
       int detail: 0,
       int screenX: 0,
       int screenY: 0,
@@ -22080,11 +22119,11 @@
       bool altKey: false,
       bool shiftKey: false,
       bool metaKey: false,
-      EventTarget relatedTarget}) {
+      EventTarget? relatedTarget}) {
     if (view == null) {
       view = window;
     }
-    MouseEvent event = document._createEvent('MouseEvent');
+    MouseEvent event = document._createEvent('MouseEvent') as MouseEvent;
     event._initMouseEvent(
         type,
         canBubble,
@@ -22104,7 +22143,7 @@
     return event;
   }
 
-  factory MouseEvent._(String type, [Map eventInitDict]) {
+  factory MouseEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return MouseEvent._create_1(type, eventInitDict_1);
@@ -22160,9 +22199,9 @@
   @JSName('pageY')
   num get _pageY native;
 
-  String get region native;
+  String? get region native;
 
-  EventTarget get relatedTarget =>
+  EventTarget? get relatedTarget =>
       _convertNativeToDart_EventTarget(this._get_relatedTarget);
   @JSName('relatedTarget')
   @Creates('Node')
@@ -22190,21 +22229,21 @@
   bool getModifierState(String keyArg) native;
 
   void _initMouseEvent(
-      String type,
-      bool bubbles,
-      bool cancelable,
-      Window view,
-      int detail,
-      int screenX,
-      int screenY,
-      int clientX,
-      int clientY,
-      bool ctrlKey,
-      bool altKey,
-      bool shiftKey,
-      bool metaKey,
-      int button,
-      EventTarget relatedTarget) {
+      String? type,
+      bool? bubbles,
+      bool? cancelable,
+      Window? view,
+      int? detail,
+      int? screenX,
+      int? screenY,
+      int? clientX,
+      int? clientY,
+      bool? ctrlKey,
+      bool? altKey,
+      bool? shiftKey,
+      bool? metaKey,
+      int? button,
+      EventTarget? relatedTarget) {
     var relatedTarget_1 = _convertDartToNative_EventTarget(relatedTarget);
     _initMouseEvent_1(
         type,
@@ -22230,7 +22269,7 @@
       type,
       bubbles,
       cancelable,
-      Window view,
+      Window? view,
       detail,
       screenX,
       screenY,
@@ -22260,13 +22299,13 @@
     if (JS('bool', '!!#.offsetX', this)) {
       var x = JS('int', '#.offsetX', this);
       var y = JS('int', '#.offsetY', this);
-      return new Point(x, y);
+      return new Point(x as num, y as num);
     } else {
       // Firefox does not support offsetX.
       if (!(this.target is Element)) {
         throw new UnsupportedError('offsetX is only supported on elements');
       }
-      Element target = this.target;
+      Element target = this.target as Element;
       var point = (this.client - target.getBoundingClientRect().topLeft);
       return new Point(point.x.toInt(), point.y.toInt());
     }
@@ -22315,17 +22354,17 @@
 
   String get prevValue native;
 
-  Node get relatedNode native;
+  Node? get relatedNode native;
 
   void initMutationEvent(
-      String type,
-      bool bubbles,
-      bool cancelable,
-      Node relatedNode,
-      String prevValue,
-      String newValue,
-      String attrName,
-      int attrChange) native;
+      String? type,
+      bool? bubbles,
+      bool? cancelable,
+      Node? relatedNode,
+      String? prevValue,
+      String? newValue,
+      String? attrName,
+      int? attrChange) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -22338,7 +22377,7 @@
 class MutationObserver extends Interceptor {
   void disconnect() native;
 
-  void _observe(Node target, [Map options]) {
+  void _observe(Node target, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       _observe_1(target, options_1);
@@ -22375,13 +22414,13 @@
    * * If characterDataOldValue is true then characterData must be true.
    */
   void observe(Node target,
-      {bool childList,
-      bool attributes,
-      bool characterData,
-      bool subtree,
-      bool attributeOldValue,
-      bool characterDataOldValue,
-      List<String> attributeFilter}) {
+      {bool? childList,
+      bool? attributes,
+      bool? characterData,
+      bool? subtree,
+      bool? attributeOldValue,
+      bool? characterDataOldValue,
+      List<String>? attributeFilter}) {
     // Parse options into map of known type.
     var parsedOptions = _createDict();
 
@@ -22446,21 +22485,21 @@
     throw new UnsupportedError("Not supported");
   }
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get addedNodes native;
 
-  String get attributeName native;
+  String? get attributeName native;
 
-  String get attributeNamespace native;
+  String? get attributeNamespace native;
 
-  Node get nextSibling native;
+  Node? get nextSibling native;
 
-  String get oldValue native;
+  String? get oldValue native;
 
-  Node get previousSibling native;
+  Node? get previousSibling native;
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get removedNodes native;
 
@@ -22483,7 +22522,7 @@
 
   Future enable() => promiseToFuture(JS("", "#.enable()", this));
 
-  Future<Map<String, dynamic>> getState() =>
+  Future<Map<String, dynamic>?> getState() =>
       promiseToFutureAsMap(JS("", "#.getState()", this));
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -22498,7 +22537,7 @@
         NavigatorOnLine,
         NavigatorAutomationInformation,
         NavigatorID {
-  List<Gamepad> getGamepads() {
+  List<Gamepad?> getGamepads() {
     var gamepadList = _getGamepads();
 
     // If no prototype we need one for the world to hookup to the proper Dart class.
@@ -22591,13 +22630,13 @@
 
   _Clipboard get clipboard native;
 
-  NetworkInformation get connection native;
+  NetworkInformation? get connection native;
 
   CredentialsContainer get credentials native;
 
-  num get deviceMemory native;
+  num? get deviceMemory native;
 
-  String get doNotTrack native;
+  String? get doNotTrack native;
 
   @Unstable()
   Geolocation get geolocation native;
@@ -22648,9 +22687,9 @@
   Future getBattery() => promiseToFuture(JS("", "#.getBattery()", this));
 
   @JSName('getGamepads')
-  @Returns('_GamepadList|Null')
+  @Returns('_GamepadList')
   @Creates('_GamepadList')
-  List<Gamepad> _getGamepads() native;
+  List<Gamepad?> _getGamepads() native;
 
   Future<RelatedApplication> getInstalledRelatedApps() =>
       promiseToFuture<RelatedApplication>(
@@ -22661,7 +22700,7 @@
   @Unstable()
   void registerProtocolHandler(String scheme, String url, String title) native;
 
-  Future requestKeyboardLock([List<String> keyCodes]) {
+  Future requestKeyboardLock([List<String>? keyCodes]) {
     if (keyCodes != null) {
       List keyCodes_1 = convertDartToNative_StringArray(keyCodes);
       return _requestKeyboardLock_1(keyCodes_1);
@@ -22677,7 +22716,7 @@
       promiseToFuture(JS("", "#.requestKeyboardLock()", this));
 
   @JSName('requestMIDIAccess')
-  Future requestMidiAccess([Map options]) {
+  Future requestMidiAccess([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -22691,9 +22730,9 @@
       promiseToFuture(JS("", "#.requestMediaKeySystemAccess(#, #)", this,
           keySystem, supportedConfigurations));
 
-  bool sendBeacon(String url, Object data) native;
+  bool sendBeacon(String url, Object? data) native;
 
-  Future share([Map data]) {
+  Future share([Map? data]) {
     var data_dict = null;
     if (data != null) {
       data_dict = convertDartToNative_Dictionary(data);
@@ -22870,7 +22909,7 @@
   static const EventStreamProvider<Event> changeEvent =
       const EventStreamProvider<Event>('change');
 
-  num get downlink native;
+  num? get downlink native;
 
   num get downlinkMax native;
 
@@ -22897,13 +22936,13 @@
   _ChildNodeListLazy(this._this);
 
   Node get first {
-    Node result = JS('Node|Null', '#.firstChild', _this);
+    Node? result = JS('Node|Null', '#.firstChild', _this);
     if (result == null) throw new StateError("No elements");
     return result;
   }
 
   Node get last {
-    Node result = JS('Node|Null', '#.lastChild', _this);
+    Node? result = JS('Node|Null', '#.lastChild', _this);
     if (result == null) throw new StateError("No elements");
     return result;
   }
@@ -22912,7 +22951,7 @@
     int l = this.length;
     if (l == 0) throw new StateError("No elements");
     if (l > 1) throw new StateError("More than one element");
-    return JS('Node|Null', '#.firstChild', _this);
+    return JS('Node|Null', '#.firstChild', _this)!;
   }
 
   void add(Node value) {
@@ -22925,7 +22964,7 @@
       if (!identical(otherList._this, _this)) {
         // Optimized route for copying between nodes.
         for (var i = 0, len = otherList.length; i < len; ++i) {
-          _this.append(otherList._this.firstChild);
+          _this.append(otherList._this.firstChild!);
         }
       }
       return;
@@ -22975,7 +23014,7 @@
     return result;
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     if (object is! Node) return false;
     Node node = object;
     if (!identical(_this, node.parentNode)) return false;
@@ -22987,9 +23026,9 @@
     // This implementation of removeWhere/retainWhere is more efficient
     // than the default in ListBase. Child nodes can be removed in constant
     // time.
-    Node child = _this.firstChild;
+    Node? child = _this.firstChild;
     while (child != null) {
-      Node nextChild = child.nextNode;
+      Node? nextChild = child.nextNode;
       if (test(child) == removeMatching) {
         _this._removeChild(child);
       }
@@ -23019,11 +23058,11 @@
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort([Comparator<Node> compare]) {
+  void sort([Comparator<Node>? compare]) {
     throw new UnsupportedError("Cannot sort Node list");
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     throw new UnsupportedError("Cannot shuffle Node list");
   }
 
@@ -23033,7 +23072,7 @@
     throw new UnsupportedError("Cannot setRange on Node list");
   }
 
-  void fillRange(int start, int end, [Node fill]) {
+  void fillRange(int start, int end, [Node? fill]) {
     throw new UnsupportedError("Cannot fillRange on Node list");
   }
 
@@ -23084,7 +23123,7 @@
     // TODO(jacobr): should we throw an exception if parent is already null?
     // TODO(vsm): Use the native remove when available.
     if (this.parentNode != null) {
-      final Node parent = this.parentNode;
+      final Node parent = this.parentNode!;
       parent._removeChild(this);
     }
   }
@@ -23094,7 +23133,7 @@
    */
   Node replaceWith(Node otherNode) {
     try {
-      final Node parent = this.parentNode;
+      final Node parent = this.parentNode!;
       parent._replaceChild(otherNode, this);
     } catch (e) {}
     return this;
@@ -23116,7 +23155,7 @@
 
       // Optimized route for copying between nodes.
       for (var i = 0, len = otherList.length; i < len; ++i) {
-        this.insertBefore(otherList._this.firstChild, refChild);
+        this.insertBefore(otherList._this.firstChild!, refChild);
       }
     } else {
       for (var node in newNodes) {
@@ -23127,7 +23166,7 @@
 
   void _clearChildren() {
     while (firstChild != null) {
-      _removeChild(firstChild);
+      _removeChild(firstChild!);
     }
   }
 
@@ -23135,7 +23174,7 @@
    * Print out a String representation of this Node.
    */
   String toString() {
-    String value = nodeValue; // Fetch DOM Node property once.
+    String? value = nodeValue; // Fetch DOM Node property once.
     return value == null ? super.toString() : value;
   }
 
@@ -23192,7 +23231,7 @@
    *   from MDN.
    */
 
-  Node get firstChild native;
+  Node? get firstChild native;
 
   bool get isConnected native;
 
@@ -23205,7 +23244,7 @@
    *   from MDN.
    */
 
-  Node get lastChild native;
+  Node? get lastChild native;
 
   @JSName('nextSibling')
 
@@ -23218,7 +23257,7 @@
    *   from MDN.
    */
 
-  Node get nextNode native;
+  Node? get nextNode native;
 
   /**
    * The name of this node.
@@ -23272,7 +23311,7 @@
    *   [nodeType].
    */
 
-  String get nodeValue native;
+  String? get nodeValue native;
 
   /**
    * The document this node belongs to.
@@ -23285,7 +23324,7 @@
    *   from MDN.
    */
 
-  Document get ownerDocument native;
+  Document? get ownerDocument native;
 
   @JSName('parentElement')
 
@@ -23301,7 +23340,7 @@
    *   from W3C.
    */
 
-  Element get parent native;
+  Element? get parent native;
 
   /**
    * The parent node of this node.
@@ -23312,7 +23351,7 @@
    *   from MDN.
    */
 
-  Node get parentNode native;
+  Node? get parentNode native;
 
   @JSName('previousSibling')
 
@@ -23325,7 +23364,7 @@
    *   from MDN.
    */
 
-  Node get previousNode native;
+  Node? get previousNode native;
 
   @JSName('textContent')
 
@@ -23338,10 +23377,10 @@
    *   from MDN.
    */
 
-  String get text native;
+  String? get text native;
 
   @JSName('textContent')
-  set text(String value) native;
+  set text(String? value) native;
 
   @JSName('appendChild')
   /**
@@ -23367,7 +23406,7 @@
    * * [Node.cloneNode](https://developer.mozilla.org/en-US/docs/Web/API/Node.cloneNode)
    *   from MDN.
    */
-  Node clone(bool deep) native;
+  Node clone(bool? deep) native;
 
   /**
    * Returns true if this node contains the specified node.
@@ -23377,9 +23416,9 @@
    * * [Node.contains](https://developer.mozilla.org/en-US/docs/Web/API/Node.contains)
    *   from MDN.
    */
-  bool contains(Node other) native;
+  bool contains(Node? other) native;
 
-  Node getRootNode([Map options]) {
+  Node getRootNode([Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return _getRootNode_1(options_1);
@@ -23410,7 +23449,7 @@
    * * [Node.insertBefore](https://developer.mozilla.org/en-US/docs/Web/API/Node.insertBefore)
    *   from MDN.
    */
-  Node insertBefore(Node node, Node child) native;
+  Node insertBefore(Node node, Node? child) native;
 
   @JSName('removeChild')
   Node _removeChild(Node child) native;
@@ -23477,9 +23516,9 @@
 
   void detach() native;
 
-  Node nextNode() native;
+  Node? nextNode() native;
 
-  Node previousNode() native;
+  Node? previousNode() native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -23540,7 +23579,7 @@
   // -- end List<Node> mixins.
 
   @JSName('item')
-  Node _item(int index) native;
+  Node? _item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -23553,9 +23592,9 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Element get nextElementSibling native;
+  Element? get nextElementSibling native;
 
-  Element get previousElementSibling native;
+  Element? get previousElementSibling native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -23568,7 +23607,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Element getElementById(String elementId) native;
+  Element? getElementById(String elementId) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -23581,9 +23620,9 @@
     throw new UnsupportedError("Not supported");
   }
 
-  String get nonce native;
+  String? get nonce native;
 
-  set nonce(String value) native;
+  set nonce(String? value) native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -23592,7 +23631,7 @@
 @Native("Notification")
 class Notification extends EventTarget {
   factory Notification(String title,
-      {String dir, String body, String lang, String tag, String icon}) {
+      {String? dir, String? body, String? lang, String? tag, String? icon}) {
     var parsedOptions = {};
     if (dir != null) parsedOptions['dir'] = dir;
     if (body != null) parsedOptions['body'] = body;
@@ -23642,7 +23681,7 @@
   static const EventStreamProvider<Event> showEvent =
       const EventStreamProvider<Event>('show');
 
-  static Notification _factoryNotification(String title, [Map options]) {
+  static Notification _factoryNotification(String title, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return Notification._create_1(title, options_1);
@@ -23666,7 +23705,7 @@
 
   @annotation_Creates_SerializedScriptValue
   @annotation_Returns_SerializedScriptValue
-  Object get data native;
+  Object? get data native;
 
   String get dir native;
 
@@ -23698,7 +23737,7 @@
 
   @JSName('requestPermission')
   static Future _requestPermission(
-      [_NotificationPermissionCallback deprecatedCallback]) native;
+      [_NotificationPermissionCallback? deprecatedCallback]) native;
 
   @JSName('requestPermission')
   static Future<String> requestPermission() {
@@ -23743,7 +23782,7 @@
 
   Notification get notification native;
 
-  String get reply native;
+  String? get reply native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -23763,7 +23802,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory OListElement() => JS(
+  factory OListElement() => JS<OListElement>(
       'returns:OListElement;creates:OListElement;new:true',
       '#.createElement(#)',
       document,
@@ -23802,7 +23841,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ObjectElement() => document.createElement("object");
+  factory ObjectElement() => document.createElement("object") as ObjectElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -23813,7 +23852,7 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => Element.isTagSupported('object');
 
-  WindowBase get contentWindow =>
+  WindowBase? get contentWindow =>
       _convertNativeToDart_Window(this._get_contentWindow);
   @JSName('contentWindow')
   @Creates('Window|=Object')
@@ -23824,7 +23863,7 @@
 
   set data(String value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   String get height native;
 
@@ -23887,7 +23926,7 @@
 
   set width(int value) native;
 
-  Future<Blob> convertToBlob([Map options]) {
+  Future<Blob> convertToBlob([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -23896,7 +23935,7 @@
         JS("", "#.convertToBlob(#)", this, options_dict));
   }
 
-  Object getContext(String contextType, [Map attributes]) {
+  Object? getContext(String contextType, [Map? attributes]) {
     if (attributes != null) {
       var attributes_1 = convertDartToNative_Dictionary(attributes);
       return _getContext_1(contextType, attributes_1);
@@ -23905,9 +23944,9 @@
   }
 
   @JSName('getContext')
-  Object _getContext_1(contextType, attributes) native;
+  Object? _getContext_1(contextType, attributes) native;
   @JSName('getContext')
-  Object _getContext_2(contextType) native;
+  Object? _getContext_2(contextType) native;
 
   ImageBitmap transferToImageBitmap() native;
 }
@@ -23929,9 +23968,9 @@
 
   set direction(String value) native;
 
-  Object get fillStyle native;
+  Object? get fillStyle native;
 
-  set fillStyle(Object value) native;
+  set fillStyle(Object? value) native;
 
   String get filter native;
 
@@ -23993,9 +24032,9 @@
 
   set shadowOffsetY(num value) native;
 
-  Object get strokeStyle native;
+  Object? get strokeStyle native;
 
-  set strokeStyle(Object value) native;
+  set strokeStyle(Object? value) native;
 
   String get textAlign native;
 
@@ -24009,14 +24048,14 @@
 
   void clearRect(num x, num y, num width, num height) native;
 
-  void clip([Path2D path]) native;
+  void clip([Path2D? path]) native;
 
   Future commit() => promiseToFuture(JS("", "#.commit()", this));
 
   ImageData createImageData(data_OR_imagedata_OR_sw,
-      [int sh_OR_sw,
+      [int? sh_OR_sw,
       imageDataColorSettings_OR_sh,
-      Map imageDataColorSettings]) {
+      Map? imageDataColorSettings]) {
     if ((data_OR_imagedata_OR_sw is ImageData) &&
         sh_OR_sw == null &&
         imageDataColorSettings_OR_sh == null &&
@@ -24062,29 +24101,29 @@
   @JSName('createImageData')
   _createImageData_3(int sw, sh, imageDataColorSettings) native;
   @JSName('createImageData')
-  _createImageData_4(data, sw, int sh, imageDataColorSettings) native;
+  _createImageData_4(data, sw, int? sh, imageDataColorSettings) native;
 
   CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
 
-  CanvasPattern createPattern(
+  CanvasPattern? createPattern(
       /*CanvasImageSource*/ image, String repetitionType) native;
 
   CanvasGradient createRadialGradient(
       num x0, num y0, num r0, num x1, num y1, num r1) native;
 
   void drawImage(/*CanvasImageSource*/ image, num sx_OR_x, num sy_OR_y,
-      [num sw_OR_width,
-      num height_OR_sh,
-      num dx,
-      num dy,
-      num dw,
-      num dh]) native;
+      [num? sw_OR_width,
+      num? height_OR_sh,
+      num? dx,
+      num? dy,
+      num? dw,
+      num? dh]) native;
 
-  void fill([path_OR_winding, String winding]) native;
+  void fill([path_OR_winding, String? winding]) native;
 
   void fillRect(num x, num y, num width, num height) native;
 
-  void fillText(String text, num x, num y, [num maxWidth]) native;
+  void fillText(String text, num x, num y, [num? maxWidth]) native;
 
   ImageData getImageData(int sx, int sy, int sw, int sh) {
     return convertNativeToDart_ImageData(_getImageData_1(sx, sy, sw, sh));
@@ -24095,15 +24134,15 @@
 
   List<num> getLineDash() native;
 
-  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String winding])
+  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String? winding])
       native;
 
-  bool isPointInStroke(path_OR_x, num x_OR_y, [num y]) native;
+  bool isPointInStroke(path_OR_x, num x_OR_y, [num? y]) native;
 
   TextMetrics measureText(String text) native;
 
   void putImageData(ImageData imagedata, int dx, int dy,
-      [int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight]) {
+      [int? dirtyX, int? dirtyY, int? dirtyWidth, int? dirtyHeight]) {
     if (dirtyX == null &&
         dirtyY == null &&
         dirtyWidth == null &&
@@ -24144,11 +24183,11 @@
 
   void setTransform(num a, num b, num c, num d, num e, num f) native;
 
-  void stroke([Path2D path]) native;
+  void stroke([Path2D? path]) native;
 
   void strokeRect(num x, num y, num width, num height) native;
 
-  void strokeText(String text, num x, num y, [num maxWidth]) native;
+  void strokeText(String text, num x, num y, [num? maxWidth]) native;
 
   void transform(num a, num b, num c, num d, num e, num f) native;
 
@@ -24157,7 +24196,7 @@
   // From CanvasPath
 
   void arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool anticlockwise) native;
+      bool? anticlockwise) native;
 
   void arcTo(num x1, num y1, num x2, num y2, num radius) native;
 
@@ -24167,7 +24206,7 @@
   void closePath() native;
 
   void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool anticlockwise) native;
+      num startAngle, num endAngle, bool? anticlockwise) native;
 
   void lineTo(num x, num y) native;
 
@@ -24188,7 +24227,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory OptGroupElement() => JS(
+  factory OptGroupElement() => JS<OptGroupElement>(
       'returns:OptGroupElement;creates:OptGroupElement;new:true',
       '#.createElement(#)',
       document,
@@ -24220,7 +24259,7 @@
   }
 
   factory OptionElement._(
-      [String data, String value, bool defaultSelected, bool selected]) {
+      [String? data, String? value, bool? defaultSelected, bool? selected]) {
     if (selected != null) {
       return OptionElement._create_1(data, value, defaultSelected, selected);
     }
@@ -24264,7 +24303,7 @@
 
   set disabled(bool value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   int get index native;
 
@@ -24291,7 +24330,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  List<num> get quaternion native;
+  List<num>? get quaternion native;
 
   void populateMatrix(Object targetBuffer) native;
 }
@@ -24309,7 +24348,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory OutputElement() => document.createElement("output");
+  factory OutputElement() => document.createElement("output") as OutputElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -24324,12 +24363,12 @@
 
   set defaultValue(String value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   DomTokenList get htmlFor native;
 
   @Unstable()
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
@@ -24375,9 +24414,9 @@
       constraint,
       message);
 
-  String get constraint native;
+  String? get constraint native;
 
-  String get message native;
+  String? get message native;
 
   String get name native;
 }
@@ -24392,7 +24431,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PageTransitionEvent(String type, [Map eventInitDict]) {
+  factory PageTransitionEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return PageTransitionEvent._create_1(type, eventInitDict_1);
@@ -24424,9 +24463,9 @@
 
   set currentTransform(Matrix value) native;
 
-  Object get fillStyle native;
+  Object? get fillStyle native;
 
-  set fillStyle(Object value) native;
+  set fillStyle(Object? value) native;
 
   String get filter native;
 
@@ -24484,42 +24523,42 @@
 
   set shadowOffsetY(num value) native;
 
-  Object get strokeStyle native;
+  Object? get strokeStyle native;
 
-  set strokeStyle(Object value) native;
+  set strokeStyle(Object? value) native;
 
   void beginPath() native;
 
   void clearRect(num x, num y, num width, num height) native;
 
-  void clip([path_OR_winding, String winding]) native;
+  void clip([path_OR_winding, String? winding]) native;
 
   CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
 
-  CanvasPattern createPattern(
+  CanvasPattern? createPattern(
       /*CanvasImageSource*/ image, String repetitionType) native;
 
   CanvasGradient createRadialGradient(
       num x0, num y0, num r0, num x1, num y1, num r1) native;
 
   void drawImage(/*CanvasImageSource*/ image, num sx_OR_x, num sy_OR_y,
-      [num sw_OR_width,
-      num height_OR_sh,
-      num dx,
-      num dy,
-      num dw,
-      num dh]) native;
+      [num? sw_OR_width,
+      num? height_OR_sh,
+      num? dx,
+      num? dy,
+      num? dw,
+      num? dh]) native;
 
-  void fill([path_OR_winding, String winding]) native;
+  void fill([path_OR_winding, String? winding]) native;
 
   void fillRect(num x, num y, num width, num height) native;
 
   List<num> getLineDash() native;
 
-  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String winding])
+  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String? winding])
       native;
 
-  bool isPointInStroke(path_OR_x, num x_OR_y, [num y]) native;
+  bool isPointInStroke(path_OR_x, num x_OR_y, [num? y]) native;
 
   void resetTransform() native;
 
@@ -24535,7 +24574,7 @@
 
   void setTransform(num a, num b, num c, num d, num e, num f) native;
 
-  void stroke([Path2D path]) native;
+  void stroke([Path2D? path]) native;
 
   void strokeRect(num x, num y, num width, num height) native;
 
@@ -24546,7 +24585,7 @@
   // From CanvasPath
 
   void arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool anticlockwise) native;
+      bool? anticlockwise) native;
 
   void arcTo(num x1, num y1, num x2, num y2, num radius) native;
 
@@ -24556,7 +24595,7 @@
   void closePath() native;
 
   void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool anticlockwise) native;
+      num startAngle, num endAngle, bool? anticlockwise) native;
 
   void lineTo(num x, num y) native;
 
@@ -24607,7 +24646,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ParagraphElement() => JS(
+  factory ParagraphElement() => JS<ParagraphElement>(
       'returns:ParagraphElement;creates:ParagraphElement;new:true',
       '#.createElement(#)',
       document,
@@ -24631,7 +24670,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ParamElement() => JS(
+  factory ParamElement() => JS<ParamElement>(
       'returns:ParamElement;creates:ParamElement;new:true',
       '#.createElement(#)',
       document,
@@ -24665,11 +24704,11 @@
 
   List<Node> get _children native;
 
-  Element get _firstElementChild native;
+  Element? get _firstElementChild native;
 
-  Element get _lastElementChild native;
+  Element? get _lastElementChild native;
 
-  Element querySelector(String selectors);
+  Element? querySelector(String selectors);
 
   List<Node> _querySelectorAll(String selectors);
 }
@@ -24699,9 +24738,9 @@
   static PasswordCredential _create_2(data_OR_form) =>
       JS('PasswordCredential', 'new PasswordCredential(#)', data_OR_form);
 
-  Object get additionalData native;
+  Object? get additionalData native;
 
-  set additionalData(Object value) native;
+  set additionalData(Object? value) native;
 
   String get idName native;
 
@@ -24749,12 +24788,12 @@
   static Path2D _create_3(path_OR_text) =>
       JS('Path2D', 'new Path2D(#)', path_OR_text);
 
-  void addPath(Path2D path, [Matrix transform]) native;
+  void addPath(Path2D path, [Matrix? transform]) native;
 
   // From CanvasPath
 
   void arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool anticlockwise) native;
+      bool? anticlockwise) native;
 
   void arcTo(num x1, num y1, num x2, num y2, num radius) native;
 
@@ -24764,7 +24803,7 @@
   void closePath() native;
 
   void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool anticlockwise) native;
+      num startAngle, num endAngle, bool? anticlockwise) native;
 
   void lineTo(num x, num y) native;
 
@@ -24823,7 +24862,7 @@
   Future<bool> delete(String instrumentKey) =>
       promiseToFuture<bool>(JS("", "#.delete(#)", this, instrumentKey));
 
-  Future<Map<String, dynamic>> get(String instrumentKey) =>
+  Future<Map<String, dynamic>?> get(String instrumentKey) =>
       promiseToFutureAsMap(JS("", "#.get(#)", this, instrumentKey));
 
   Future has(String instrumentKey) =>
@@ -24861,7 +24900,7 @@
 
 @Native("PaymentRequest")
 class PaymentRequest extends EventTarget {
-  factory PaymentRequest(List<Map> methodData, Map details, [Map options]) {
+  factory PaymentRequest(List<Map> methodData, Map details, [Map? options]) {
     var methodData_1 = [];
     for (var i in methodData) {
       methodData_1.add(convertDartToNative_Dictionary(i));
@@ -24891,11 +24930,11 @@
 
   String get id native;
 
-  PaymentAddress get shippingAddress native;
+  PaymentAddress? get shippingAddress native;
 
-  String get shippingOption native;
+  String? get shippingOption native;
 
-  String get shippingType native;
+  String? get shippingType native;
 
   Future abort() => promiseToFuture(JS("", "#.abort()", this));
 
@@ -24957,7 +24996,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PaymentRequestUpdateEvent(String type, [Map eventInitDict]) {
+  factory PaymentRequestUpdateEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return PaymentRequestUpdateEvent._create_1(type, eventInitDict_1);
@@ -24989,19 +25028,19 @@
 
   String get methodName native;
 
-  String get payerEmail native;
+  String? get payerEmail native;
 
-  String get payerName native;
+  String? get payerName native;
 
-  String get payerPhone native;
+  String? get payerPhone native;
 
   String get requestId native;
 
-  PaymentAddress get shippingAddress native;
+  PaymentAddress? get shippingAddress native;
 
-  String get shippingOption native;
+  String? get shippingOption native;
 
-  Future complete([String paymentResult]) =>
+  Future complete([String? paymentResult]) =>
       promiseToFuture(JS("", "#.complete(#)", this, paymentResult));
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -25021,7 +25060,7 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.performance)');
 
-  MemoryInfo get memory native;
+  MemoryInfo? get memory native;
 
   PerformanceNavigation get navigation native;
 
@@ -25029,21 +25068,22 @@
 
   PerformanceTiming get timing native;
 
-  void clearMarks(String markName) native;
+  void clearMarks(String? markName) native;
 
-  void clearMeasures(String measureName) native;
+  void clearMeasures(String? measureName) native;
 
   void clearResourceTimings() native;
 
   List<PerformanceEntry> getEntries() native;
 
-  List<PerformanceEntry> getEntriesByName(String name, String entryType) native;
+  List<PerformanceEntry> getEntriesByName(String name, String? entryType)
+      native;
 
   List<PerformanceEntry> getEntriesByType(String entryType) native;
 
   void mark(String markName) native;
 
-  void measure(String measureName, String startMark, String endMark) native;
+  void measure(String measureName, String? startMark, String? endMark) native;
 
   double now() native;
 
@@ -25208,7 +25248,8 @@
 
   List<PerformanceEntry> getEntries() native;
 
-  List<PerformanceEntry> getEntriesByName(String name, String entryType) native;
+  List<PerformanceEntry> getEntriesByName(String name, String? entryType)
+      native;
 
   List<PerformanceEntry> getEntriesByType(String entryType) native;
 }
@@ -25447,9 +25488,9 @@
 
   String get name native;
 
-  MimeType item(int index) native;
+  MimeType? item(int index) native;
 
-  MimeType namedItem(String name) native;
+  MimeType? namedItem(String name) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -25509,11 +25550,11 @@
   Plugin elementAt(int index) => this[index];
   // -- end List<Plugin> mixins.
 
-  Plugin item(int index) native;
+  Plugin? item(int index) native;
 
-  Plugin namedItem(String name) native;
+  Plugin? namedItem(String name) native;
 
-  void refresh(bool reload) native;
+  void refresh(bool? reload) native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -25528,7 +25569,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PointerEvent(String type, [Map eventInitDict]) {
+  factory PointerEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return PointerEvent._create_1(type, eventInitDict_1);
@@ -25588,7 +25629,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PopStateEvent(String type, [Map eventInitDict]) {
+  factory PopStateEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return PopStateEvent._create_1(type, eventInitDict_1);
@@ -25656,8 +25697,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PreElement() => JS('returns:PreElement;creates:PreElement;new:true',
-      '#.createElement(#)', document, "pre");
+  factory PreElement() => JS<PreElement>(
+      'returns:PreElement;creates:PreElement;new:true',
+      '#.createElement(#)',
+      document,
+      "pre");
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25676,11 +25720,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  PresentationRequest get defaultRequest native;
+  PresentationRequest? get defaultRequest native;
 
-  set defaultRequest(PresentationRequest value) native;
+  set defaultRequest(PresentationRequest? value) native;
 
-  PresentationReceiver get receiver native;
+  PresentationReceiver? get receiver native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -25856,7 +25900,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  StyleSheet get sheet native;
+  StyleSheet? get sheet native;
 
   String get target native;
 }
@@ -25875,7 +25919,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ProgressElement() => document.createElement("progress");
+  factory ProgressElement() =>
+      document.createElement("progress") as ProgressElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25887,7 +25932,7 @@
   static bool get supported => Element.isTagSupported('progress');
 
   @Unstable()
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
@@ -25912,7 +25957,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ProgressEvent(String type, [Map eventInitDict]) {
+  factory ProgressEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return ProgressEvent._create_1(type, eventInitDict_1);
@@ -25953,7 +25998,7 @@
 
   Future get promise => promiseToFuture(JS("", "#.promise", this));
 
-  Object get reason native;
+  Object? get reason native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -25981,7 +26026,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PushEvent(String type, [Map eventInitDict]) {
+  factory PushEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return PushEvent._create_1(type, eventInitDict_1);
@@ -25992,7 +26037,7 @@
       JS('PushEvent', 'new PushEvent(#,#)', type, eventInitDict);
   static PushEvent _create_2(type) => JS('PushEvent', 'new PushEvent(#)', type);
 
-  PushMessageData get data native;
+  PushMessageData? get data native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -26010,7 +26055,7 @@
   Future<PushSubscription> getSubscription() =>
       promiseToFuture<PushSubscription>(JS("", "#.getSubscription()", this));
 
-  Future permissionState([Map options]) {
+  Future permissionState([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -26018,7 +26063,7 @@
     return promiseToFuture(JS("", "#.permissionState(#)", this, options_dict));
   }
 
-  Future<PushSubscription> subscribe([Map options]) {
+  Future<PushSubscription> subscribe([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -26063,7 +26108,7 @@
 
   PushSubscriptionOptions get options native;
 
-  ByteBuffer getKey(String name) native;
+  ByteBuffer? getKey(String name) native;
 
   Future<bool> unsubscribe() =>
       promiseToFuture<bool>(JS("", "#.unsubscribe()", this));
@@ -26079,7 +26124,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  ByteBuffer get applicationServerKey native;
+  ByteBuffer? get applicationServerKey native;
 
   bool get userVisibleOnly native;
 }
@@ -26094,7 +26139,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory QuoteElement() => JS(
+  factory QuoteElement() => JS<QuoteElement>(
       'returns:QuoteElement;creates:QuoteElement;new:true',
       '#.createElement(#)',
       document,
@@ -26173,7 +26218,7 @@
 
   Range cloneRange() native;
 
-  void collapse([bool toStart]) native;
+  void collapse([bool? toStart]) native;
 
   int compareBoundaryPoints(int how, Range sourceRange) native;
 
@@ -26185,14 +26230,14 @@
 
   void detach() native;
 
-  void expand(String unit) native;
+  void expand(String? unit) native;
 
   DocumentFragment extractContents() native;
 
   Rectangle getBoundingClientRect() native;
 
   @JSName('getClientRects')
-  @Returns('DomRectList|Null')
+  @Returns('DomRectList')
   @Creates('DomRectList')
   List<Rectangle> _getClientRects() native;
 
@@ -26270,7 +26315,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory RelativeOrientationSensor([Map sensorOptions]) {
+  factory RelativeOrientationSensor([Map? sensorOptions]) {
     if (sensorOptions != null) {
       var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
       return RelativeOrientationSensor._create_1(sensorOptions_1);
@@ -26297,7 +26342,7 @@
 
   String get state native;
 
-  Future cancelWatchAvailability([int id]) =>
+  Future cancelWatchAvailability([int? id]) =>
       promiseToFuture(JS("", "#.cancelWatchAvailability(#)", this, id));
 
   Future prompt() => promiseToFuture(JS("", "#.prompt()", this));
@@ -26579,7 +26624,7 @@
   MediaStreamTrack get track native;
 
   @JSName('insertDTMF')
-  void insertDtmf(String tones, [int duration, int interToneGap]) native;
+  void insertDtmf(String tones, [int? duration, int? interToneGap]) native;
 
   /// Stream of `tonechange` events handled by this [RtcDtmfSender].
   Stream<RtcDtmfToneChangeEvent> get onToneChange =>
@@ -26667,7 +26712,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Native("RTCPeerConnection,webkitRTCPeerConnection,mozRTCPeerConnection")
 class RtcPeerConnection extends EventTarget {
-  factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
+  factory RtcPeerConnection(Map rtcIceServers, [Map? mediaConstraints]) {
     var constructorName =
         JS('RtcPeerConnection', 'window[#]', 'RTCPeerConnection');
     if (mediaConstraints != null) {
@@ -26709,7 +26754,7 @@
   * Temporarily exposes _getStats and old getStats as getLegacyStats until Chrome fully supports
   * new getStats API.
   */
-  Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack selector]) {
+  Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack? selector]) {
     var completer = new Completer<RtcStatsResponse>();
     _getStats((value) {
       completer.complete(value);
@@ -26719,7 +26764,7 @@
 
   @JSName('getStats')
   Future _getStats(
-      [RtcStatsCallback successCallback, MediaStreamTrack selector]) native;
+      [RtcStatsCallback? successCallback, MediaStreamTrack? selector]) native;
 
   static Future generateCertificate(/*AlgorithmIdentifier*/ keygenAlgorithm) =>
       JS('dynamic', 'generateCertificate(#)', keygenAlgorithm);
@@ -26806,19 +26851,19 @@
 
   String get iceGatheringState native;
 
-  RtcSessionDescription get localDescription native;
+  RtcSessionDescription? get localDescription native;
 
-  RtcSessionDescription get remoteDescription native;
+  RtcSessionDescription? get remoteDescription native;
 
   String get signalingState native;
 
   Future addIceCandidate(Object candidate,
-          [VoidCallback successCallback,
-          RtcPeerConnectionErrorCallback failureCallback]) =>
+          [VoidCallback? successCallback,
+          RtcPeerConnectionErrorCallback? failureCallback]) =>
       promiseToFuture(JS("", "#.addIceCandidate(#, #, #)", this, candidate,
           successCallback, failureCallback));
 
-  void addStream(MediaStream stream, [Map mediaConstraints]) {
+  void addStream(MediaStream? stream, [Map? mediaConstraints]) {
     if (mediaConstraints != null) {
       var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
       _addStream_1(stream, mediaConstraints_1);
@@ -26829,15 +26874,15 @@
   }
 
   @JSName('addStream')
-  void _addStream_1(MediaStream stream, mediaConstraints) native;
+  void _addStream_1(MediaStream? stream, mediaConstraints) native;
   @JSName('addStream')
-  void _addStream_2(MediaStream stream) native;
+  void _addStream_2(MediaStream? stream) native;
 
   RtcRtpSender addTrack(MediaStreamTrack track, MediaStream streams) native;
 
   void close() native;
 
-  Future<RtcSessionDescription> createAnswer([Map options]) {
+  Future<RtcSessionDescription> createAnswer([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -26849,7 +26894,7 @@
   @JSName('createDTMFSender')
   RtcDtmfSender createDtmfSender(MediaStreamTrack track) native;
 
-  RtcDataChannel createDataChannel(String label, [Map dataChannelDict]) {
+  RtcDataChannel createDataChannel(String label, [Map? dataChannelDict]) {
     if (dataChannelDict != null) {
       var dataChannelDict_1 = convertDartToNative_Dictionary(dataChannelDict);
       return _createDataChannel_1(label, dataChannelDict_1);
@@ -26862,7 +26907,7 @@
   @JSName('createDataChannel')
   RtcDataChannel _createDataChannel_2(label) native;
 
-  Future<RtcSessionDescription> createOffer([Map options]) {
+  Future<RtcSessionDescription> createOffer([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -26882,7 +26927,7 @@
   Future<RtcStatsReport> getStats() =>
       promiseToFuture<RtcStatsReport>(JS("", "#.getStats()", this));
 
-  void removeStream(MediaStream stream) native;
+  void removeStream(MediaStream? stream) native;
 
   void removeTrack(RtcRtpSender sender) native;
 
@@ -26948,7 +26993,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory RtcPeerConnectionIceEvent(String type, [Map eventInitDict]) {
+  factory RtcPeerConnectionIceEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return RtcPeerConnectionIceEvent._create_1(type, eventInitDict_1);
@@ -26963,7 +27008,7 @@
   static RtcPeerConnectionIceEvent _create_2(type) =>
       JS('RtcPeerConnectionIceEvent', 'new RTCPeerConnectionIceEvent(#)', type);
 
-  RtcIceCandidate get candidate native;
+  RtcIceCandidate? get candidate native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -27006,7 +27051,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  MediaStreamTrack get track native;
+  MediaStreamTrack? get track native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -27025,13 +27070,13 @@
     throw new UnsupportedError("Not supported");
   }
 
-  String get sdp native;
+  String? get sdp native;
 
-  set sdp(String value) native;
+  set sdp(String? value) native;
 
-  String get type native;
+  String? get type native;
 
-  set type(String value) native;
+  set type(String? value) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -27044,7 +27089,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Map _getItem(String key) =>
+  Map? _getItem(String key) =>
       convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
 
   void addAll(Map<String, dynamic> other) {
@@ -27055,7 +27100,7 @@
 
   bool containsKey(dynamic key) => _getItem(key) != null;
 
-  Map operator [](dynamic key) => _getItem(key);
+  Map? operator [](dynamic key) => _getItem(key);
 
   void forEach(void f(String key, dynamic value)) {
     var entries = JS('', '#.entries()', this);
@@ -27112,7 +27157,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  RtcLegacyStatsReport namedItem(String name) native;
+  RtcLegacyStatsReport namedItem(String? name) native;
 
   List<RtcLegacyStatsReport> result() native;
 }
@@ -27215,7 +27260,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ScriptElement() => JS(
+  factory ScriptElement() => JS<ScriptElement>(
       'returns:ScriptElement;creates:ScriptElement;new:true',
       '#.createElement(#)',
       document,
@@ -27235,9 +27280,9 @@
 
   set charset(String value) native;
 
-  String get crossOrigin native;
+  String? get crossOrigin native;
 
-  set crossOrigin(String value) native;
+  set crossOrigin(String? value) native;
 
   bool get defer native;
 
@@ -27270,7 +27315,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ScrollState([Map scrollStateInit]) {
+  factory ScrollState([Map? scrollStateInit]) {
     if (scrollStateInit != null) {
       var scrollStateInit_1 = convertDartToNative_Dictionary(scrollStateInit);
       return ScrollState._create_1(scrollStateInit_1);
@@ -27327,7 +27372,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ScrollTimeline([Map options]) {
+  factory ScrollTimeline([Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return ScrollTimeline._create_1(options_1);
@@ -27341,9 +27386,9 @@
 
   String get orientation native;
 
-  Element get scrollSource native;
+  Element? get scrollSource native;
 
-  Object get timeRange native;
+  Object? get timeRange native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -27356,7 +27401,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory SecurityPolicyViolationEvent(String type, [Map eventInitDict]) {
+  factory SecurityPolicyViolationEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return SecurityPolicyViolationEvent._create_1(type, eventInitDict_1);
@@ -27410,7 +27455,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory SelectElement() => JS(
+  factory SelectElement() => JS<SelectElement>(
       'returns:SelectElement;creates:SelectElement;new:true',
       '#.createElement(#)',
       document,
@@ -27430,10 +27475,10 @@
 
   set disabled(bool value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   @Unstable()
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
@@ -27473,15 +27518,15 @@
 
   bool get willValidate native;
 
-  void __setter__(int index, OptionElement option) native;
+  void __setter__(int index, OptionElement? option) native;
 
-  void add(Object element, Object before) native;
+  void add(Object element, Object? before) native;
 
   bool checkValidity() native;
 
-  Element item(int index) native;
+  Element? item(int index) native;
 
-  OptionElement namedItem(String name) native;
+  OptionElement? namedItem(String name) native;
 
   bool reportValidity() native;
 
@@ -27515,19 +27560,19 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Node get anchorNode native;
+  Node? get anchorNode native;
 
   int get anchorOffset native;
 
-  Node get baseNode native;
+  Node? get baseNode native;
 
   int get baseOffset native;
 
-  Node get extentNode native;
+  Node? get extentNode native;
 
   int get extentOffset native;
 
-  Node get focusNode native;
+  Node? get focusNode native;
 
   int get focusOffset native;
 
@@ -27539,23 +27584,23 @@
 
   void addRange(Range range) native;
 
-  void collapse(Node node, [int offset]) native;
+  void collapse(Node? node, [int? offset]) native;
 
   void collapseToEnd() native;
 
   void collapseToStart() native;
 
-  bool containsNode(Node node, [bool allowPartialContainment]) native;
+  bool containsNode(Node node, [bool? allowPartialContainment]) native;
 
   void deleteFromDocument() native;
 
   void empty() native;
 
-  void extend(Node node, [int offset]) native;
+  void extend(Node node, [int? offset]) native;
 
   Range getRangeAt(int index) native;
 
-  void modify(String alter, String direction, String granularity) native;
+  void modify(String? alter, String? direction, String? granularity) native;
 
   void removeAllRanges() native;
 
@@ -27563,10 +27608,10 @@
 
   void selectAllChildren(Node node) native;
 
-  void setBaseAndExtent(
-      Node baseNode, int baseOffset, Node extentNode, int extentOffset) native;
+  void setBaseAndExtent(Node? baseNode, int baseOffset, Node? extentNode,
+      int extentOffset) native;
 
-  void setPosition(Node node, [int offset]) native;
+  void setPosition(Node? node, [int? offset]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -27633,7 +27678,7 @@
 
   String get state native;
 
-  void postMessage(/*any*/ message, [List<Object> transfer]) {
+  void postMessage(/*any*/ message, [List<Object>? transfer]) {
     if (transfer != null) {
       var message_1 = convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, transfer);
@@ -27645,7 +27690,7 @@
   }
 
   @JSName('postMessage')
-  void _postMessage_1(message, List<Object> transfer) native;
+  void _postMessage_1(message, List<Object>? transfer) native;
   @JSName('postMessage')
   void _postMessage_2(message) native;
 
@@ -27665,19 +27710,19 @@
   static const EventStreamProvider<MessageEvent> messageEvent =
       const EventStreamProvider<MessageEvent>('message');
 
-  ServiceWorker get controller native;
+  ServiceWorker? get controller native;
 
   Future<ServiceWorkerRegistration> get ready =>
       promiseToFuture<ServiceWorkerRegistration>(JS("", "#.ready", this));
 
-  Future<ServiceWorkerRegistration> getRegistration([String documentURL]) =>
+  Future<ServiceWorkerRegistration> getRegistration([String? documentURL]) =>
       promiseToFuture<ServiceWorkerRegistration>(
           JS("", "#.getRegistration(#)", this, documentURL));
 
   Future<List<dynamic>> getRegistrations() =>
       promiseToFuture<List<dynamic>>(JS("", "#.getRegistrations()", this));
 
-  Future<ServiceWorkerRegistration> register(String url, [Map options]) {
+  Future<ServiceWorkerRegistration> register(String url, [Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -27747,11 +27792,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  ServiceWorker get active native;
+  ServiceWorker? get active native;
 
   BackgroundFetchManager get backgroundFetch native;
 
-  ServiceWorker get installing native;
+  ServiceWorker? get installing native;
 
   NavigationPreloadManager get navigationPreload native;
 
@@ -27763,9 +27808,9 @@
 
   SyncManager get sync native;
 
-  ServiceWorker get waiting native;
+  ServiceWorker? get waiting native;
 
-  Future<List<dynamic>> getNotifications([Map filter]) {
+  Future<List<dynamic>> getNotifications([Map? filter]) {
     var filter_dict = null;
     if (filter != null) {
       filter_dict = convertDartToNative_Dictionary(filter);
@@ -27774,7 +27819,7 @@
         JS("", "#.getNotifications(#)", this, filter_dict));
   }
 
-  Future showNotification(String title, [Map options]) {
+  Future showNotification(String title, [Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -27800,7 +27845,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ShadowElement() => document.createElement("shadow");
+  factory ShadowElement() => document.createElement("shadow") as ShadowElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -27811,7 +27856,7 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => Element.isTagSupported('shadow');
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> getDistributedNodes() native;
 }
@@ -27837,29 +27882,29 @@
   String get innerHtml native;
 
   @JSName('innerHTML')
-  set innerHtml(String value) native;
+  set innerHtml(String? value) native;
 
   String get mode native;
 
-  ShadowRoot get olderShadowRoot native;
+  ShadowRoot? get olderShadowRoot native;
 
   // From DocumentOrShadowRoot
 
-  Element get activeElement native;
+  Element? get activeElement native;
 
-  Element get fullscreenElement native;
+  Element? get fullscreenElement native;
 
-  Element get pointerLockElement native;
+  Element? get pointerLockElement native;
 
-  @Returns('_StyleSheetList|Null')
+  @Returns('_StyleSheetList')
   @Creates('_StyleSheetList')
   List<StyleSheet> get styleSheets native;
 
-  Element elementFromPoint(int x, int y) native;
+  Element? elementFromPoint(int x, int y) native;
 
   List<Element> elementsFromPoint(int x, int y) native;
 
-  Selection getSelection() native;
+  Selection? getSelection() native;
 
   static bool get supported => JS(
       'bool',
@@ -27928,7 +27973,7 @@
   static const EventStreamProvider<Event> errorEvent =
       const EventStreamProvider<Event>('error');
 
-  factory SharedWorker(String scriptURL, [String name]) {
+  factory SharedWorker(String scriptURL, [String? name]) {
     if (name != null) {
       return SharedWorker._create_1(scriptURL, name);
     }
@@ -27975,8 +28020,8 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   void _webkitRequestFileSystem(int type, int size,
-      [_FileSystemCallback successCallback,
-      _ErrorCallback errorCallback]) native;
+      [_FileSystemCallback? successCallback,
+      _ErrorCallback? errorCallback]) native;
 
   @JSName('webkitRequestFileSystemSync')
   @SupportedBrowser(SupportedBrowser.CHROME)
@@ -27993,7 +28038,7 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   void _webkitResolveLocalFileSystemUrl(
       String url, _EntryCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   /// Stream of `connect` events handled by this [SharedWorkerGlobalScope].
   Stream<Event> get onConnect => connectEvent.forTarget(this);
@@ -28024,7 +28069,7 @@
 
   set name(String value) native;
 
-  List<Node> assignedNodes([Map options]) {
+  List<Node> assignedNodes([Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return _assignedNodes_1(options_1);
@@ -28166,7 +28211,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory SourceElement() => JS(
+  factory SourceElement() => JS<SourceElement>(
       'returns:SourceElement;creates:SourceElement;new:true',
       '#.createElement(#)',
       document,
@@ -28209,7 +28254,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory SpanElement() => JS(
+  factory SpanElement() => JS<SpanElement>(
       'returns:SpanElement;creates:SpanElement;new:true',
       '#.createElement(#)',
       document,
@@ -28310,9 +28355,9 @@
   SpeechGrammar elementAt(int index) => this[index];
   // -- end List<SpeechGrammar> mixins.
 
-  void addFromString(String string, [num weight]) native;
+  void addFromString(String string, [num? weight]) native;
 
-  void addFromUri(String src, [num weight]) native;
+  void addFromUri(String src, [num? weight]) native;
 
   SpeechGrammar item(int index) native;
 }
@@ -28431,9 +28476,9 @@
   static bool get supported => JS(
       'bool', '!!(window.SpeechRecognition || window.webkitSpeechRecognition)');
 
-  MediaStreamTrack get audioTrack native;
+  MediaStreamTrack? get audioTrack native;
 
-  set audioTrack(MediaStreamTrack value) native;
+  set audioTrack(MediaStreamTrack? value) native;
 
   bool get continuous native;
 
@@ -28527,7 +28572,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory SpeechRecognitionError(String type, [Map initDict]) {
+  factory SpeechRecognitionError(String type, [Map? initDict]) {
     if (initDict != null) {
       var initDict_1 = convertDartToNative_Dictionary(initDict);
       return SpeechRecognitionError._create_1(type, initDict_1);
@@ -28558,7 +28603,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory SpeechRecognitionEvent(String type, [Map initDict]) {
+  factory SpeechRecognitionEvent(String type, [Map? initDict]) {
     if (initDict != null) {
       var initDict_1 = convertDartToNative_Dictionary(initDict);
       return SpeechRecognitionEvent._create_1(type, initDict_1);
@@ -28573,15 +28618,15 @@
   static SpeechRecognitionEvent _create_2(type) =>
       JS('SpeechRecognitionEvent', 'new SpeechRecognitionEvent(#)', type);
 
-  Document get emma native;
+  Document? get emma native;
 
-  Document get interpretation native;
+  Document? get interpretation native;
 
   int get resultIndex native;
 
   @Returns('_SpeechRecognitionResultList|Null')
   @Creates('_SpeechRecognitionResultList')
-  List<SpeechRecognitionResult> get results native;
+  List<SpeechRecognitionResult>? get results native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -28728,7 +28773,7 @@
   static const EventStreamProvider<SpeechSynthesisEvent> startEvent =
       const EventStreamProvider<SpeechSynthesisEvent>('start');
 
-  factory SpeechSynthesisUtterance([String text]) {
+  factory SpeechSynthesisUtterance([String? text]) {
     if (text != null) {
       return SpeechSynthesisUtterance._create_1(text);
     }
@@ -28755,9 +28800,9 @@
 
   set text(String value) native;
 
-  SpeechSynthesisVoice get voice native;
+  SpeechSynthesisVoice? get voice native;
 
-  set voice(SpeechSynthesisVoice value) native;
+  set voice(SpeechSynthesisVoice? value) native;
 
   num get volume native;
 
@@ -28867,11 +28912,11 @@
   }
 
   // TODO(nweiz): update this when maps support lazy iteration
-  bool containsValue(Object value) => values.any((e) => e == value);
+  bool containsValue(Object? value) => values.any((e) => e == value);
 
-  bool containsKey(Object key) => _getItem(key) != null;
+  bool containsKey(Object? key) => _getItem(key as String) != null;
 
-  String operator [](Object key) => _getItem(key);
+  String? operator [](Object? key) => _getItem(key as String);
 
   void operator []=(String key, String value) {
     _setItem(key, value);
@@ -28879,12 +28924,12 @@
 
   String putIfAbsent(String key, String ifAbsent()) {
     if (!containsKey(key)) this[key] = ifAbsent();
-    return this[key];
+    return this[key] as String;
   }
 
-  String remove(Object key) {
+  String? remove(Object? key) {
     final value = this[key];
-    _removeItem(key);
+    _removeItem(key as String);
     return value;
   }
 
@@ -28895,7 +28940,7 @@
       final key = _key(i);
       if (key == null) return;
 
-      f(key, this[key]);
+      f(key, this[key]!);
     }
   }
 
@@ -28928,10 +28973,10 @@
   void _clear() native;
 
   @JSName('getItem')
-  String _getItem(String key) native;
+  String? _getItem(String key) native;
 
   @JSName('key')
-  String _key(int index) native;
+  String? _key(int index) native;
 
   @JSName('removeItem')
   void _removeItem(String key) native;
@@ -28958,18 +29003,18 @@
   factory StorageEvent(String type,
       {bool canBubble: false,
       bool cancelable: false,
-      String key,
-      String oldValue,
-      String newValue,
-      String url,
-      Storage storageArea}) {
-    StorageEvent e = document._createEvent("StorageEvent");
+      String? key,
+      String? oldValue,
+      String? newValue,
+      String? url,
+      Storage? storageArea}) {
+    StorageEvent e = document._createEvent("StorageEvent") as StorageEvent;
     e._initStorageEvent(
         type, canBubble, cancelable, key, oldValue, newValue, url, storageArea);
     return e;
   }
 
-  factory StorageEvent._(String type, [Map eventInitDict]) {
+  factory StorageEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return StorageEvent._create_1(type, eventInitDict_1);
@@ -28981,26 +29026,26 @@
   static StorageEvent _create_2(type) =>
       JS('StorageEvent', 'new StorageEvent(#)', type);
 
-  String get key native;
+  String? get key native;
 
-  String get newValue native;
+  String? get newValue native;
 
-  String get oldValue native;
+  String? get oldValue native;
 
-  Storage get storageArea native;
+  Storage? get storageArea native;
 
   String get url native;
 
   @JSName('initStorageEvent')
   void _initStorageEvent(
-      String typeArg,
-      bool canBubbleArg,
-      bool cancelableArg,
-      String keyArg,
-      String oldValueArg,
-      String newValueArg,
-      String urlArg,
-      Storage storageAreaArg) native;
+      String? typeArg,
+      bool? canBubbleArg,
+      bool? cancelableArg,
+      String? keyArg,
+      String? oldValueArg,
+      String? newValueArg,
+      String? urlArg,
+      Storage? storageAreaArg) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29013,7 +29058,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Future<Map<String, dynamic>> estimate() =>
+  Future<Map<String, dynamic>?> estimate() =>
       promiseToFutureAsMap(JS("", "#.estimate()", this));
 
   Future<bool> persist() => promiseToFuture<bool>(JS("", "#.persist()", this));
@@ -29047,7 +29092,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory StyleElement() => JS(
+  factory StyleElement() => JS<StyleElement>(
       'returns:StyleElement;creates:StyleElement;new:true',
       '#.createElement(#)',
       document,
@@ -29067,7 +29112,7 @@
 
   set media(String value) native;
 
-  StyleSheet get sheet native;
+  StyleSheet? get sheet native;
 
   String get type native;
 
@@ -29086,7 +29131,7 @@
 
   String get type native;
 
-  bool matchMedium(String mediaquery) native;
+  bool matchMedium(String? mediaquery) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29116,7 +29161,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  CssStyleValue get(String property) native;
+  CssStyleValue? get(String property) native;
 
   List<CssStyleValue> getAll(String property) native;
 
@@ -29139,15 +29184,15 @@
 
   set disabled(bool value) native;
 
-  String get href native;
+  String? get href native;
 
   MediaList get media native;
 
-  Node get ownerNode native;
+  Node? get ownerNode native;
 
-  StyleSheet get parentStyleSheet native;
+  StyleSheet? get parentStyleSheet native;
 
-  String get title native;
+  String? get title native;
 
   String get type native;
 }
@@ -29201,7 +29246,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TableCaptionElement() => JS(
+  factory TableCaptionElement() => JS<TableCaptionElement>(
       'returns:TableCaptionElement;creates:TableCaptionElement;new:true',
       '#.createElement(#)',
       document,
@@ -29225,7 +29270,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TableCellElement() => JS(
+  factory TableCellElement() => JS<TableCellElement>(
       'returns:TableCellElement;creates:TableCellElement;new:true',
       '#.createElement(#)',
       document,
@@ -29245,7 +29290,7 @@
 
   String get headers native;
 
-  set headers(String value) native;
+  set headers(String? value) native;
 
   int get rowSpan native;
 
@@ -29262,7 +29307,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TableColElement() => JS(
+  factory TableColElement() => JS<TableColElement>(
       'returns:TableColElement;creates:TableColElement;new:true',
       '#.createElement(#)',
       document,
@@ -29305,14 +29350,14 @@
     }
     var tbody = new Element.tag('tbody');
     this.children.add(tbody);
-    return tbody;
+    return tbody as TableSectionElement;
   }
 
   @JSName('createTBody')
   TableSectionElement _nativeCreateTBody() native;
 
-  DocumentFragment createFragment(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  DocumentFragment createFragment(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (Range.supportsCreateContextualFragment) {
       return super.createFragment(html,
           validator: validator, treeSanitizer: treeSanitizer);
@@ -29332,7 +29377,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TableElement() => JS(
+  factory TableElement() => JS<TableElement>(
       'returns:TableElement;creates:TableElement;new:true',
       '#.createElement(#)',
       document,
@@ -29344,27 +29389,27 @@
    */
   TableElement.created() : super.created();
 
-  TableCaptionElement get caption native;
+  TableCaptionElement? get caption native;
 
-  set caption(TableCaptionElement value) native;
+  set caption(TableCaptionElement? value) native;
 
   @JSName('rows')
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get _rows native;
 
   @JSName('tBodies')
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get _tBodies native;
 
-  TableSectionElement get tFoot native;
+  TableSectionElement? get tFoot native;
 
-  set tFoot(TableSectionElement value) native;
+  set tFoot(TableSectionElement? value) native;
 
-  TableSectionElement get tHead native;
+  TableSectionElement? get tHead native;
 
-  set tHead(TableSectionElement value) native;
+  set tHead(TableSectionElement? value) native;
 
   @JSName('createCaption')
   TableCaptionElement _createCaption() native;
@@ -29384,7 +29429,7 @@
   void deleteTHead() native;
 
   @JSName('insertRow')
-  TableRowElement _insertRow([int index]) native;
+  TableRowElement _insertRow([int? index]) native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29399,10 +29444,11 @@
     return insertCell(-1);
   }
 
-  TableCellElement insertCell(int index) => _insertCell(index);
+  TableCellElement insertCell(int index) =>
+      _insertCell(index) as TableCellElement;
 
-  DocumentFragment createFragment(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  DocumentFragment createFragment(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (Range.supportsCreateContextualFragment) {
       return super.createFragment(html,
           validator: validator, treeSanitizer: treeSanitizer);
@@ -29424,7 +29470,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TableRowElement() => JS(
+  factory TableRowElement() => JS<TableRowElement>(
       'returns:TableRowElement;creates:TableRowElement;new:true',
       '#.createElement(#)',
       document,
@@ -29437,7 +29483,7 @@
   TableRowElement.created() : super.created();
 
   @JSName('cells')
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get _cells native;
 
@@ -29448,7 +29494,7 @@
   void deleteCell(int index) native;
 
   @JSName('insertCell')
-  HtmlElement _insertCell([int index]) native;
+  HtmlElement _insertCell([int? index]) native;
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29462,10 +29508,10 @@
     return insertRow(-1);
   }
 
-  TableRowElement insertRow(int index) => _insertRow(index);
+  TableRowElement insertRow(int index) => _insertRow(index) as TableRowElement;
 
-  DocumentFragment createFragment(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  DocumentFragment createFragment(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (Range.supportsCreateContextualFragment) {
       return super.createFragment(html,
           validator: validator, treeSanitizer: treeSanitizer);
@@ -29493,14 +29539,14 @@
   TableSectionElement.created() : super.created();
 
   @JSName('rows')
-  @Returns('HtmlCollection|Null')
+  @Returns('HtmlCollection')
   @Creates('HtmlCollection')
   List<Node> get _rows native;
 
   void deleteRow(int index) native;
 
   @JSName('insertRow')
-  HtmlElement _insertRow([int index]) native;
+  HtmlElement _insertRow([int? index]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29538,7 +29584,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TemplateElement() => document.createElement("template");
+  factory TemplateElement() =>
+      document.createElement("template") as TemplateElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -29558,8 +29605,8 @@
    *
    * * <https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin>
    */
-  void setInnerHtml(String html,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  void setInnerHtml(String? html,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     text = null;
     content.nodes.clear();
     var fragment = createFragment(html,
@@ -29586,11 +29633,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  SlotElement get assignedSlot native;
+  SlotElement? get assignedSlot native;
 
   String get wholeText native;
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> getDestinationInsertionPoints() native;
 
@@ -29607,7 +29654,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TextAreaElement() => JS(
+  factory TextAreaElement() => JS<TextAreaElement>(
       'returns:TextAreaElement;creates:TextAreaElement;new:true',
       '#.createElement(#)',
       document,
@@ -29643,10 +29690,10 @@
 
   set disabled(bool value) native;
 
-  FormElement get form native;
+  FormElement? get form native;
 
   @Unstable()
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
   List<Node> get labels native;
 
@@ -29700,7 +29747,7 @@
 
   String get value native;
 
-  set value(String value) native;
+  set value(String? value) native;
 
   bool get willValidate native;
 
@@ -29717,9 +29764,9 @@
   void setCustomValidity(String error) native;
 
   void setRangeText(String replacement,
-      {int start, int end, String selectionMode}) native;
+      {int? start, int? end, String? selectionMode}) native;
 
-  void setSelectionRange(int start, int end, [String direction]) native;
+  void setSelectionRange(int start, int end, [String? direction]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29752,12 +29799,12 @@
   factory TextEvent(String type,
       {bool canBubble: false,
       bool cancelable: false,
-      Window view,
-      String data}) {
+      Window? view,
+      String? data}) {
     if (view == null) {
       view = window;
     }
-    TextEvent e = document._createEvent("TextEvent");
+    TextEvent e = document._createEvent("TextEvent") as TextEvent;
     e._initTextEvent(type, canBubble, cancelable, view, data);
     return e;
   }
@@ -29769,8 +29816,8 @@
   String get data native;
 
   @JSName('initTextEvent')
-  void _initTextEvent(String type, bool bubbles, bool cancelable, Window view,
-      String data) native;
+  void _initTextEvent(String? type, bool? bubbles, bool? cancelable,
+      Window? view, String? data) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -29827,9 +29874,9 @@
   static const EventStreamProvider<Event> cueChangeEvent =
       const EventStreamProvider<Event>('cuechange');
 
-  TextTrackCueList get activeCues native;
+  TextTrackCueList? get activeCues native;
 
-  TextTrackCueList get cues native;
+  TextTrackCueList? get cues native;
 
   String get id native;
 
@@ -29895,7 +29942,7 @@
 
   set startTime(num value) native;
 
-  TextTrack get track native;
+  TextTrack? get track native;
 
   /// Stream of `enter` events handled by this [TextTrackCue].
   Stream<Event> get onEnter => enterEvent.forTarget(this);
@@ -29963,7 +30010,7 @@
 
   TextTrackCue __getter__(int index) native;
 
-  TextTrackCue getCueById(String id) native;
+  TextTrackCue? getCueById(String id) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -30037,7 +30084,7 @@
 
   TextTrack __getter__(int index) native;
 
-  TextTrack getTrackById(String id) native;
+  TextTrack? getTrackById(String id) native;
 
   /// Stream of `addtrack` events handled by this [TextTrackList].
   Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
@@ -30101,7 +30148,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TitleElement() => JS(
+  factory TitleElement() => JS<TitleElement>(
       'returns:TitleElement;creates:TitleElement;new:true',
       '#.createElement(#)',
       document,
@@ -30152,7 +30199,7 @@
   @JSName('radiusY')
   num get _radiusY native;
 
-  String get region native;
+  String? get region native;
 
   num get rotationAngle native;
 
@@ -30162,7 +30209,7 @@
   @JSName('screenY')
   num get _screenY native;
 
-  EventTarget get target => _convertNativeToDart_EventTarget(this._get_target);
+  EventTarget? get target => _convertNativeToDart_EventTarget(this._get_target);
   @JSName('target')
   @Creates('Element|Document')
   @Returns('Element|Document')
@@ -30206,7 +30253,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TouchEvent(String type, [Map eventInitDict]) {
+  factory TouchEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return TouchEvent._create_1(type, eventInitDict_1);
@@ -30304,7 +30351,7 @@
   Touch elementAt(int index) => this[index];
   // -- end List<Touch> mixins.
 
-  Touch item(int index) native;
+  Touch? item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -30319,7 +30366,7 @@
 
   factory TrackDefault(
       String type, String language, String label, List<String> kinds,
-      [String byteStreamTrackID]) {
+      [String? byteStreamTrackID]) {
     if (byteStreamTrackID != null) {
       List kinds_1 = convertDartToNative_StringArray(kinds);
       return TrackDefault._create_1(
@@ -30361,7 +30408,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TrackDefaultList([List<TrackDefault> trackDefaults]) {
+  factory TrackDefaultList([List<TrackDefault>? trackDefaults]) {
     if (trackDefaults != null) {
       return TrackDefaultList._create_1(trackDefaults);
     }
@@ -30390,7 +30437,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TrackElement() => document.createElement("track");
+  factory TrackElement() => document.createElement("track") as TrackElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30447,7 +30494,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TrackEvent(String type, [Map eventInitDict]) {
+  factory TrackEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return TrackEvent._create_1(type, eventInitDict_1);
@@ -30460,7 +30507,7 @@
       JS('TrackEvent', 'new TrackEvent(#)', type);
 
   @Creates('Null')
-  Object get track native;
+  Object? get track native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -30473,7 +30520,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory TransitionEvent(String type, [Map eventInitDict]) {
+  factory TransitionEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return TransitionEvent._create_1(type, eventInitDict_1);
@@ -30510,25 +30557,25 @@
 
   set currentNode(Node value) native;
 
-  NodeFilter get filter native;
+  NodeFilter? get filter native;
 
   Node get root native;
 
   int get whatToShow native;
 
-  Node firstChild() native;
+  Node? firstChild() native;
 
-  Node lastChild() native;
+  Node? lastChild() native;
 
-  Node nextNode() native;
+  Node? nextNode() native;
 
-  Node nextSibling() native;
+  Node? nextSibling() native;
 
-  Node parentNode() native;
+  Node? parentNode() native;
 
-  Node previousNode() native;
+  Node? previousNode() native;
 
-  Node previousSibling() native;
+  Node? previousSibling() native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -30588,19 +30635,19 @@
   // Contrary to JS, we default canBubble and cancelable to true, since that's
   // what people want most of the time anyway.
   factory UIEvent(String type,
-      {Window view,
+      {Window? view,
       int detail: 0,
       bool canBubble: true,
       bool cancelable: true}) {
     if (view == null) {
       view = window;
     }
-    UIEvent e = document._createEvent("UIEvent");
+    UIEvent e = document._createEvent("UIEvent") as UIEvent;
     e._initUIEvent(type, canBubble, cancelable, view, detail);
     return e;
   }
 
-  factory UIEvent._(String type, [Map eventInitDict]) {
+  factory UIEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return UIEvent._create_1(type, eventInitDict_1);
@@ -30613,9 +30660,9 @@
 
   int get detail native;
 
-  InputDeviceCapabilities get sourceCapabilities native;
+  InputDeviceCapabilities? get sourceCapabilities native;
 
-  WindowBase get view => _convertNativeToDart_Window(this._get_view);
+  WindowBase? get view => _convertNativeToDart_Window(this._get_view);
   @JSName('view')
   @Creates('Window|=Object')
   @Returns('Window|=Object')
@@ -30626,7 +30673,7 @@
   int get _which native;
 
   @JSName('initUIEvent')
-  void _initUIEvent(String type, bool bubbles, bool cancelable, Window view,
+  void _initUIEvent(String type, bool bubbles, bool cancelable, Window? view,
       int detail) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -30640,7 +30687,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory UListElement() => JS(
+  factory UListElement() => JS<UListElement>(
       'returns:UListElement;creates:UListElement;new:true',
       '#.createElement(#)',
       document,
@@ -30663,7 +30710,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Future cancel(Object reason) =>
+  Future cancel(Object? reason) =>
       promiseToFuture(JS("", "#.cancel(#)", this, reason));
 
   void notifyLockAcquired() native;
@@ -30777,7 +30824,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory UrlSearchParams([Object init]) {
+  factory UrlSearchParams([Object? init]) {
     if (init != null) {
       return UrlSearchParams._create_1(init);
     }
@@ -30792,7 +30839,7 @@
 
   void delete(String name) native;
 
-  String get(String name) native;
+  String? get(String name) native;
 
   List<String> getAll(String name) native;
 
@@ -30854,7 +30901,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Float32List getTransformTo(VRCoordinateSystem other) native;
+  Float32List? getTransformTo(VRCoordinateSystem other) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -30871,7 +30918,7 @@
 
   bool get isExternal native;
 
-  Future requestSession([Map options]) {
+  Future requestSession([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -30879,7 +30926,7 @@
     return promiseToFuture(JS("", "#.requestSession(#)", this, options_dict));
   }
 
-  Future supportsSession([Map options]) {
+  Future supportsSession([Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -30983,7 +31030,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory VRDisplayEvent(String type, [Map eventInitDict]) {
+  factory VRDisplayEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return VRDisplayEvent._create_1(type, eventInitDict_1);
@@ -31053,7 +31100,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  VRStageBounds get bounds native;
+  VRStageBounds? get bounds native;
 
   num get emulatedHeight native;
 }
@@ -31068,17 +31115,17 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Float32List get angularAcceleration native;
+  Float32List? get angularAcceleration native;
 
-  Float32List get angularVelocity native;
+  Float32List? get angularVelocity native;
 
-  Float32List get linearAcceleration native;
+  Float32List? get linearAcceleration native;
 
-  Float32List get linearVelocity native;
+  Float32List? get linearVelocity native;
 
-  Float32List get orientation native;
+  Float32List? get orientation native;
 
-  Float32List get position native;
+  Float32List? get position native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -31111,7 +31158,7 @@
 
   Future end() => promiseToFuture(JS("", "#.end()", this));
 
-  Future requestFrameOfReference(String type, [Map options]) {
+  Future requestFrameOfReference(String type, [Map? options]) {
     var options_dict = null;
     if (options != null) {
       options_dict = convertDartToNative_Dictionary(options);
@@ -31233,7 +31280,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory VideoElement() => JS(
+  factory VideoElement() => JS<VideoElement>(
       'returns:VideoElement;creates:VideoElement;new:true',
       '#.createElement(#)',
       document,
@@ -31325,7 +31372,7 @@
 
   set selected(bool value) native;
 
-  SourceBuffer get sourceBuffer native;
+  SourceBuffer? get sourceBuffer native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -31347,7 +31394,7 @@
 
   VideoTrack __getter__(int index) native;
 
-  VideoTrack getTrackById(String id) native;
+  VideoTrack? getTrackById(String id) native;
 
   Stream<Event> get onChange => changeEvent.forTarget(this);
 }
@@ -31416,19 +31463,19 @@
 
   @Creates('Null')
   @Returns('num|String')
-  Object get line native;
+  Object? get line native;
 
-  set line(Object value) native;
+  set line(Object? value) native;
 
   @Creates('Null')
   @Returns('num|String')
-  Object get position native;
+  Object? get position native;
 
-  set position(Object value) native;
+  set position(Object? value) native;
 
-  VttRegion get region native;
+  VttRegion? get region native;
 
-  set region(VttRegion value) native;
+  set region(VttRegion? value) native;
 
   num get size native;
 
@@ -31583,7 +31630,7 @@
   static const EventStreamProvider<Event> openEvent =
       const EventStreamProvider<Event>('open');
 
-  factory WebSocket(String url, [Object protocols]) {
+  factory WebSocket(String url, [Object? protocols]) {
     if (protocols != null) {
       return WebSocket._create_1(url, protocols);
     }
@@ -31619,7 +31666,7 @@
 
   String get url native;
 
-  void close([int code, String reason]) native;
+  void close([int? code, String? reason]) native;
 
   /**
    * Transmit data to the server over this connection.
@@ -31689,7 +31736,7 @@
 @Native("WheelEvent")
 class WheelEvent extends MouseEvent {
   factory WheelEvent(String type,
-      {Window view,
+      {Window? view,
       num deltaX: 0,
       num deltaY: 0,
       num deltaZ: 0,
@@ -31706,7 +31753,7 @@
       bool altKey: false,
       bool shiftKey: false,
       bool metaKey: false,
-      EventTarget relatedTarget}) {
+      EventTarget? relatedTarget}) {
     var options = {
       'view': view,
       'deltaMode': deltaMode,
@@ -31736,7 +31783,7 @@
         convertDartToNative_Dictionary(options));
   }
 
-  factory WheelEvent._(String type, [Map eventInitDict]) {
+  factory WheelEvent._(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return WheelEvent._create_1(type, eventInitDict_1);
@@ -31927,10 +31974,10 @@
    */
   Document get document => JS('Document', '#.document', this);
 
-  WindowBase _open2(url, name) =>
+  WindowBase? _open2(url, name) =>
       JS('Window|Null', '#.open(#,#)', this, url, name);
 
-  WindowBase _open3(url, name, options) =>
+  WindowBase? _open3(url, name, options) =>
       JS('Window|Null', '#.open(#,#,#)', this, url, name, options);
 
   /**
@@ -31941,7 +31988,7 @@
    * * [Window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window.open)
    *   from MDN.
    */
-  WindowBase open(String url, String name, [String options]) {
+  WindowBase open(String url, String name, [String? options]) {
     if (options == null) {
       return _DOMWindowCrossFrame._createSafe(_open2(url, name));
     } else {
@@ -31992,7 +32039,7 @@
    */
   int requestAnimationFrame(FrameRequestCallback callback) {
     _ensureRequestAnimationFrame();
-    return _requestAnimationFrame(_wrapZone(callback));
+    return _requestAnimationFrame(_wrapZone(callback)!);
   }
 
   /**
@@ -32052,7 +32099,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME, '23.0')
   @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')
   @SupportedBrowser(SupportedBrowser.IE, '10.0')
-  IdbFactory get indexedDB => JS(
+  IdbFactory? get indexedDB => JS(
       'IdbFactory|Null', // If not supported, returns null.
       '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
       this,
@@ -32433,13 +32480,13 @@
 
   bool get offscreenBuffering native;
 
-  WindowBase get opener => _convertNativeToDart_Window(this._get_opener);
+  WindowBase? get opener => _convertNativeToDart_Window(this._get_opener);
   @JSName('opener')
   @Creates('Window|=Object')
   @Returns('Window|=Object')
   dynamic get _get_opener native;
 
-  set opener(WindowBase value) native;
+  set opener(WindowBase? value) native;
 
   int get orientation native;
 
@@ -32503,7 +32550,7 @@
 
   num get _pageYOffset native;
 
-  WindowBase get parent => _convertNativeToDart_Window(this._get_parent);
+  WindowBase? get parent => _convertNativeToDart_Window(this._get_parent);
   @JSName('parent')
   @Creates('Window|=Object')
   @Returns('Window|=Object')
@@ -32601,7 +32648,7 @@
    * * [Window.self](https://developer.mozilla.org/en-US/docs/Web/API/Window.self)
    *   from MDN.
    */
-  WindowBase get self => _convertNativeToDart_Window(this._get_self);
+  WindowBase? get self => _convertNativeToDart_Window(this._get_self);
   @JSName('self')
   /**
    * The current window.
@@ -32685,13 +32732,13 @@
 
   BarProp get toolbar native;
 
-  WindowBase get top => _convertNativeToDart_Window(this._get_top);
+  WindowBase? get top => _convertNativeToDart_Window(this._get_top);
   @JSName('top')
   @Creates('Window|=Object')
   @Returns('Window|=Object')
   dynamic get _get_top native;
 
-  VisualViewport get visualViewport native;
+  VisualViewport? get visualViewport native;
 
   /**
    * The current window.
@@ -32701,7 +32748,7 @@
    * * [Window.window](https://developer.mozilla.org/en-US/docs/Web/API/Window.window)
    *   from MDN.
    */
-  WindowBase get window => _convertNativeToDart_Window(this._get_window);
+  WindowBase? get window => _convertNativeToDart_Window(this._get_window);
   @JSName('window')
   /**
    * The current window.
@@ -32719,10 +32766,10 @@
   @Returns('Window|=Object')
   WindowBase __getter__(index_OR_name) {
     if ((index_OR_name is int)) {
-      return _convertNativeToDart_Window(__getter___1(index_OR_name));
+      return _convertNativeToDart_Window(__getter___1(index_OR_name))!;
     }
     if ((index_OR_name is String)) {
-      return _convertNativeToDart_Window(__getter___2(index_OR_name));
+      return _convertNativeToDart_Window(__getter___2(index_OR_name))!;
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -32744,7 +32791,7 @@
    * * [User prompts](https://html.spec.whatwg.org/multipage/webappapis.html#user-prompts)
    *   from WHATWG.
    */
-  void alert([String message]) native;
+  void alert([String? message]) native;
 
   void cancelIdleCallback(int handle) native;
 
@@ -32758,9 +32805,9 @@
    * * [User prompts](https://html.spec.whatwg.org/multipage/webappapis.html#user-prompts)
    *   from WHATWG.
    */
-  bool confirm([String message]) native;
+  bool confirm([String? message]) native;
 
-  Future fetch(/*RequestInfo*/ input, [Map init]) {
+  Future fetch(/*RequestInfo*/ input, [Map? init]) {
     var init_dict = null;
     if (init != null) {
       init_dict = convertDartToNative_Dictionary(init);
@@ -32776,22 +32823,23 @@
    * * [Window.find](https://developer.mozilla.org/en-US/docs/Web/API/Window.find)
    *   from MDN.
    */
-  bool find(String string, bool caseSensitive, bool backwards, bool wrap,
-      bool wholeWord, bool searchInFrames, bool showDialog) native;
+  bool find(String? string, bool? caseSensitive, bool? backwards, bool? wrap,
+      bool? wholeWord, bool? searchInFrames, bool? showDialog) native;
 
   @JSName('getComputedStyle')
-  CssStyleDeclaration _getComputedStyle(Element elt, [String pseudoElt]) native;
+  CssStyleDeclaration _getComputedStyle(Element elt, [String? pseudoElt])
+      native;
 
   StylePropertyMapReadonly getComputedStyleMap(
-      Element element, String pseudoElement) native;
+      Element element, String? pseudoElement) native;
 
   @JSName('getMatchedCSSRules')
   /**
    * Returns all CSS rules that apply to the element's pseudo-element.
    */
-  @Returns('_CssRuleList|Null')
+  @Returns('_CssRuleList')
   @Creates('_CssRuleList')
-  List<CssRule> getMatchedCssRules(Element element, String pseudoElement)
+  List<CssRule> getMatchedCssRules(Element? element, String? pseudoElement)
       native;
 
   /**
@@ -32802,7 +32850,7 @@
    * * [Window.getSelection](https://developer.mozilla.org/en-US/docs/Web/API/Window.getSelection)
    *   from MDN.
    */
-  Selection getSelection() native;
+  Selection? getSelection() native;
 
   /**
    * Returns a list of media queries for the given query string.
@@ -32841,10 +32889,10 @@
   @Creates('SqlDatabase')
   SqlDatabase _openDatabase(
       String name, String version, String displayName, int estimatedSize,
-      [DatabaseCallback creationCallback]) native;
+      [DatabaseCallback? creationCallback]) native;
 
   void postMessage(/*any*/ message, String targetOrigin,
-      [List<Object> transfer]) {
+      [List<Object>? transfer]) {
     if (transfer != null) {
       var message_1 = convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, targetOrigin, transfer);
@@ -32870,7 +32918,7 @@
    */
   void print() native;
 
-  int requestIdleCallback(IdleRequestCallback callback, [Map options]) {
+  int requestIdleCallback(IdleRequestCallback callback, [Map? options]) {
     if (options != null) {
       var callback_1 = convertDartClosureToJS(callback, 1);
       var options_2 = convertDartToNative_Dictionary(options);
@@ -32915,7 +32963,7 @@
    * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
    *   from MDN.
    */
-  void scroll([options_OR_x, y, Map scrollOptions]) {
+  void scroll([options_OR_x, y, Map? scrollOptions]) {
     if (options_OR_x == null && y == null && scrollOptions == null) {
       _scroll_1();
       return;
@@ -32976,7 +33024,7 @@
    * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
    *   from MDN.
    */
-  void _scroll_3(num x, num y) native;
+  void _scroll_3(num? x, num? y) native;
   @JSName('scroll')
   /**
    * Scrolls the page horizontally and vertically to a specific point.
@@ -32988,7 +33036,7 @@
    * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
    *   from MDN.
    */
-  void _scroll_4(int x, int y) native;
+  void _scroll_4(int? x, int? y) native;
   @JSName('scroll')
   /**
    * Scrolls the page horizontally and vertically to a specific point.
@@ -33000,7 +33048,7 @@
    * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
    *   from MDN.
    */
-  void _scroll_5(int x, int y, scrollOptions) native;
+  void _scroll_5(int? x, int? y, scrollOptions) native;
 
   /**
    * Scrolls the page horizontally and vertically by an offset.
@@ -33010,7 +33058,7 @@
    * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
    *   from MDN.
    */
-  void scrollBy([options_OR_x, y, Map scrollOptions]) {
+  void scrollBy([options_OR_x, y, Map? scrollOptions]) {
     if (options_OR_x == null && y == null && scrollOptions == null) {
       _scrollBy_1();
       return;
@@ -33065,7 +33113,7 @@
    * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
    *   from MDN.
    */
-  void _scrollBy_3(num x, num y) native;
+  void _scrollBy_3(num? x, num? y) native;
   @JSName('scrollBy')
   /**
    * Scrolls the page horizontally and vertically by an offset.
@@ -33075,7 +33123,7 @@
    * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
    *   from MDN.
    */
-  void _scrollBy_4(int x, int y) native;
+  void _scrollBy_4(int? x, int? y) native;
   @JSName('scrollBy')
   /**
    * Scrolls the page horizontally and vertically by an offset.
@@ -33085,7 +33133,7 @@
    * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
    *   from MDN.
    */
-  void _scrollBy_5(int x, int y, scrollOptions) native;
+  void _scrollBy_5(int? x, int? y, scrollOptions) native;
 
   /**
    * Scrolls the page horizontally and vertically to a specific point.
@@ -33097,7 +33145,7 @@
    * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
    *   from MDN.
    */
-  void scrollTo([options_OR_x, y, Map scrollOptions]) {
+  void scrollTo([options_OR_x, y, Map? scrollOptions]) {
     if (options_OR_x == null && y == null && scrollOptions == null) {
       _scrollTo_1();
       return;
@@ -33158,7 +33206,7 @@
    * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
    *   from MDN.
    */
-  void _scrollTo_3(num x, num y) native;
+  void _scrollTo_3(num? x, num? y) native;
   @JSName('scrollTo')
   /**
    * Scrolls the page horizontally and vertically to a specific point.
@@ -33170,7 +33218,7 @@
    * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
    *   from MDN.
    */
-  void _scrollTo_4(int x, int y) native;
+  void _scrollTo_4(int? x, int? y) native;
   @JSName('scrollTo')
   /**
    * Scrolls the page horizontally and vertically to a specific point.
@@ -33182,7 +33230,7 @@
    * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
    *   from MDN.
    */
-  void _scrollTo_5(int x, int y, scrollOptions) native;
+  void _scrollTo_5(int? x, int? y, scrollOptions) native;
 
   /**
    * Stops the window from loading.
@@ -33199,7 +33247,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   void __requestFileSystem(
       int type, int size, _FileSystemCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   @JSName('webkitRequestFileSystem')
   @SupportedBrowser(SupportedBrowser.CHROME)
@@ -33227,7 +33275,7 @@
    */
   @SupportedBrowser(SupportedBrowser.CHROME)
   void _resolveLocalFileSystemUrl(String url, _EntryCallback successCallback,
-      [_ErrorCallback errorCallback]) native;
+      [_ErrorCallback? errorCallback]) native;
 
   @JSName('webkitResolveLocalFileSystemURL')
   /**
@@ -33259,24 +33307,24 @@
   // From WindowTimers
 
   @JSName('setInterval')
-  int _setInterval_String(String handler, [int timeout, Object arguments])
+  int _setInterval_String(String handler, [int? timeout, Object? arguments])
       native;
 
   @JSName('setTimeout')
-  int _setTimeout_String(String handler, [int timeout, Object arguments])
+  int _setTimeout_String(String handler, [int? timeout, Object? arguments])
       native;
 
   @JSName('clearInterval')
-  void _clearInterval([int handle]) native;
+  void _clearInterval([int? handle]) native;
 
   @JSName('clearTimeout')
-  void _clearTimeout([int handle]) native;
+  void _clearTimeout([int? handle]) native;
 
   @JSName('setInterval')
-  int _setInterval(Object handler, [int timeout]) native;
+  int _setInterval(Object handler, [int? timeout]) native;
 
   @JSName('setTimeout')
-  int _setTimeout(Object handler, [int timeout]) native;
+  int _setTimeout(Object handler, [int? timeout]) native;
 
   /// Stream of `contentloaded` events handled by this [Window].
   Stream<Event> get onContentLoaded => contentLoadedEvent.forTarget(this);
@@ -33536,7 +33584,7 @@
   @Creates('SqlDatabase')
   SqlDatabase openDatabase(
       String name, String version, String displayName, int estimatedSize,
-      [DatabaseCallback creationCallback]) {
+      [DatabaseCallback? creationCallback]) {
     var db;
     if (creationCallback == null)
       db = _openDatabase(name, version, displayName, estimatedSize);
@@ -33565,7 +33613,7 @@
    */
   int get scrollX => JS<bool>('bool', '("scrollX" in #)', this)
       ? JS<num>('num', '#.scrollX', this).round()
-      : document.documentElement.scrollLeft;
+      : document.documentElement!.scrollLeft;
 
   /**
    * The distance this window has been scrolled vertically.
@@ -33579,13 +33627,15 @@
    */
   int get scrollY => JS<bool>('bool', '("scrollY" in #)', this)
       ? JS<num>('num', '#.scrollY', this).round()
-      : document.documentElement.scrollTop;
+      : document.documentElement!.scrollTop;
 }
 
 class _BeforeUnloadEvent extends _WrappedEvent implements BeforeUnloadEvent {
   String _returnValue;
 
-  _BeforeUnloadEvent(Event base) : super(base);
+  _BeforeUnloadEvent(Event base)
+      : _returnValue = '',
+        super(base);
 
   String get returnValue => _returnValue;
 
@@ -33605,7 +33655,8 @@
 
   const _BeforeUnloadEventStreamProvider(this._eventType);
 
-  Stream<BeforeUnloadEvent> forTarget(EventTarget e, {bool useCapture: false}) {
+  Stream<BeforeUnloadEvent> forTarget(EventTarget? e,
+      {bool useCapture: false}) {
     // Specify the generic type for EventStream only in dart2js.
     var stream = new _EventStream<BeforeUnloadEvent>(e, _eventType, useCapture);
     var controller = new StreamController<BeforeUnloadEvent>(sync: true);
@@ -33759,7 +33810,7 @@
   static bool get supported =>
       JS('bool', '(typeof window.Worker != "undefined")');
 
-  void postMessage(/*any*/ message, [List<Object> transfer]) {
+  void postMessage(/*any*/ message, [List<Object>? transfer]) {
     if (transfer != null) {
       var message_1 = convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, transfer);
@@ -33771,7 +33822,7 @@
   }
 
   @JSName('postMessage')
-  void _postMessage_1(message, List<Object> transfer) native;
+  void _postMessage_1(message, List<Object>? transfer) native;
   @JSName('postMessage')
   void _postMessage_2(message) native;
 
@@ -33824,7 +33875,7 @@
 
   WorkerGlobalScope get self native;
 
-  Future fetch(/*RequestInfo*/ input, [Map init]) {
+  Future fetch(/*RequestInfo*/ input, [Map? init]) {
     var init_dict = null;
     if (init != null) {
       init_dict = convertDartToNative_Dictionary(init);
@@ -33843,24 +33894,24 @@
   // From WindowTimers
 
   @JSName('setInterval')
-  int _setInterval_String(String handler, [int timeout, Object arguments])
+  int _setInterval_String(String handler, [int? timeout, Object? arguments])
       native;
 
   @JSName('setTimeout')
-  int _setTimeout_String(String handler, [int timeout, Object arguments])
+  int _setTimeout_String(String handler, [int? timeout, Object? arguments])
       native;
 
   @JSName('clearInterval')
-  void _clearInterval([int handle]) native;
+  void _clearInterval([int? handle]) native;
 
   @JSName('clearTimeout')
-  void _clearTimeout([int handle]) native;
+  void _clearTimeout([int? handle]) native;
 
   @JSName('setInterval')
-  int _setInterval(Object handler, [int timeout]) native;
+  int _setInterval(Object handler, [int? timeout]) native;
 
   @JSName('setTimeout')
-  int _setTimeout(Object handler, [int timeout]) native;
+  int _setTimeout(Object handler, [int? timeout]) native;
 
   /// Stream of `error` events handled by this [WorkerGlobalScope].
   Stream<Event> get onError => errorEvent.forTarget(this);
@@ -33883,21 +33934,22 @@
 
   num get timeOrigin native;
 
-  void clearMarks(String markName) native;
+  void clearMarks(String? markName) native;
 
-  void clearMeasures(String measureName) native;
+  void clearMeasures(String? measureName) native;
 
   void clearResourceTimings() native;
 
   List<PerformanceEntry> getEntries() native;
 
-  List<PerformanceEntry> getEntriesByName(String name, String entryType) native;
+  List<PerformanceEntry> getEntriesByName(String name, String? entryType)
+      native;
 
   List<PerformanceEntry> getEntriesByType(String entryType) native;
 
   void mark(String markName) native;
 
-  void measure(String measureName, String startMark, String endMark) native;
+  void measure(String measureName, String? startMark, String? endMark) native;
 
   double now() native;
 
@@ -33964,14 +34016,14 @@
   static XPathEvaluator _create_1() =>
       JS('XPathEvaluator', 'new XPathEvaluator()');
 
-  XPathExpression createExpression(String expression, XPathNSResolver resolver)
+  XPathExpression createExpression(String expression, XPathNSResolver? resolver)
       native;
 
   XPathNSResolver createNSResolver(Node nodeResolver) native;
 
   XPathResult evaluate(
-      String expression, Node contextNode, XPathNSResolver resolver,
-      [int type, Object inResult]) native;
+      String expression, Node contextNode, XPathNSResolver? resolver,
+      [int? type, Object? inResult]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -33986,7 +34038,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  XPathResult evaluate(Node contextNode, [int type, Object inResult]) native;
+  XPathResult evaluate(Node contextNode, [int? type, Object? inResult]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34002,7 +34054,7 @@
   }
 
   @JSName('lookupNamespaceURI')
-  String lookupNamespaceUri(String prefix) native;
+  String? lookupNamespaceUri(String? prefix) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34051,9 +34103,9 @@
 
   String get stringValue native;
 
-  Node iterateNext() native;
+  Node? iterateNext() native;
 
-  Node snapshotItem(int index) native;
+  Node? snapshotItem(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34113,19 +34165,20 @@
 
   void clearParameters() native;
 
-  String getParameter(String namespaceURI, String localName) native;
+  String? getParameter(String? namespaceURI, String localName) native;
 
   void importStylesheet(Node style) native;
 
-  void removeParameter(String namespaceURI, String localName) native;
+  void removeParameter(String? namespaceURI, String localName) native;
 
   void reset() native;
 
-  void setParameter(String namespaceURI, String localName, String value) native;
+  void setParameter(String? namespaceURI, String localName, String value)
+      native;
 
-  Document transformToDocument(Node source) native;
+  Document? transformToDocument(Node source) native;
 
-  DocumentFragment transformToFragment(Node source, Document output) native;
+  DocumentFragment? transformToFragment(Node source, Document output) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34144,7 +34197,7 @@
   String get name native;
 
   @JSName('namespaceURI')
-  String get _namespaceUri native;
+  String? get _namespaceUri native;
 
   String get value native;
 
@@ -34349,7 +34402,7 @@
   CssRule elementAt(int index) => this[index];
   // -- end List<CssRule> mixins.
 
-  CssRule item(int index) native;
+  CssRule? item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34432,7 +34485,7 @@
    * Returns the intersection of this and `other`, or null if they don't
    * intersect.
    */
-  Rectangle intersection(Rectangle other) {
+  Rectangle? intersection(Rectangle other) {
     var x0 = max(left, other.left);
     var x1 = min(left + width, other.left + other.width);
 
@@ -34501,7 +34554,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _DomRect([num x, num y, num width, num height]) {
+  factory _DomRect([num? x, num? y, num? width, num? height]) {
     if (height != null) {
       return _DomRect._create_1(x, y, width, height);
     }
@@ -34641,8 +34694,8 @@
 
 @Native("GamepadList")
 class _GamepadList extends Interceptor
-    with ListMixin<Gamepad>, ImmutableListMixin<Gamepad>
-    implements List<Gamepad>, JavaScriptIndexingBehavior<Gamepad> {
+    with ListMixin<Gamepad?>, ImmutableListMixin<Gamepad?>
+    implements List<Gamepad?>, JavaScriptIndexingBehavior<Gamepad?> {
   // To suppress missing implicit constructor warnings.
   factory _GamepadList._() {
     throw new UnsupportedError("Not supported");
@@ -34650,30 +34703,30 @@
 
   int get length => JS("int", "#.length", this);
 
-  Gamepad operator [](int index) {
+  Gamepad? operator [](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
       throw new RangeError.index(index, this);
     return JS("Gamepad|Null", "#[#]", this, index);
   }
 
-  void operator []=(int index, Gamepad value) {
+  void operator []=(int index, Gamepad? value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
-  // -- start List<Gamepad> mixins.
-  // Gamepad is the element type.
+  // -- start List<Gamepad?> mixins.
+  // Gamepad? is the element type.
 
   set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
-  Gamepad get first {
+  Gamepad? get first {
     if (this.length > 0) {
       return JS('Gamepad|Null', '#[0]', this);
     }
     throw new StateError("No elements");
   }
 
-  Gamepad get last {
+  Gamepad? get last {
     int len = this.length;
     if (len > 0) {
       return JS('Gamepad|Null', '#[#]', this, len - 1);
@@ -34681,7 +34734,7 @@
     throw new StateError("No elements");
   }
 
-  Gamepad get single {
+  Gamepad? get single {
     int len = this.length;
     if (len == 1) {
       return JS('Gamepad|Null', '#[0]', this);
@@ -34690,10 +34743,10 @@
     throw new StateError("More than one element");
   }
 
-  Gamepad elementAt(int index) => this[index];
-  // -- end List<Gamepad> mixins.
+  Gamepad? elementAt(int index) => this[index];
+  // -- end List<Gamepad?> mixins.
 
-  Gamepad item(int index) native;
+  Gamepad item(int? index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34709,7 +34762,7 @@
   }
 
   @JSName('item')
-  Element _item(int index) native;
+  Element _item(int? index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34841,7 +34894,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _MojoInterfaceInterceptor(String interfaceName, [String scope]) {
+  factory _MojoInterfaceInterceptor(String interfaceName, [String? scope]) {
     if (scope != null) {
       return _MojoInterfaceInterceptor._create_1(interfaceName, scope);
     }
@@ -34868,7 +34921,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _MojoInterfaceRequestEvent(String type, [Map eventInitDict]) {
+  factory _MojoInterfaceRequestEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return _MojoInterfaceRequestEvent._create_1(type, eventInitDict_1);
@@ -34965,19 +35018,19 @@
   Node elementAt(int index) => this[index];
   // -- end List<Node> mixins.
 
-  _Attr getNamedItem(String name) native;
+  _Attr? getNamedItem(String name) native;
 
-  _Attr getNamedItemNS(String namespaceURI, String localName) native;
+  _Attr? getNamedItemNS(String? namespaceURI, String localName) native;
 
-  _Attr item(int index) native;
+  _Attr? item(int index) native;
 
   _Attr removeNamedItem(String name) native;
 
-  _Attr removeNamedItemNS(String namespaceURI, String localName) native;
+  _Attr removeNamedItemNS(String? namespaceURI, String localName) native;
 
-  _Attr setNamedItem(_Attr attr) native;
+  _Attr? setNamedItem(_Attr attr) native;
 
-  _Attr setNamedItemNS(_Attr attr) native;
+  _Attr? setNamedItemNS(_Attr attr) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35010,7 +35063,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  ReportBody get body native;
+  ReportBody? get body native;
 
   String get type native;
 
@@ -35027,7 +35080,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _Request(Object input, [Map requestInitDict]) {
+  factory _Request(Object input, [Map? requestInitDict]) {
     if (requestInitDict != null) {
       var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
       return _Request._create_1(input, requestInitDict_1);
@@ -35082,7 +35135,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _Response([Object body, Map init]) {
+  factory _Response([Object? body, Map? init]) {
     if (init != null) {
       var init_1 = convertDartToNative_Dictionary(init);
       return _Response._create_1(body, init_1);
@@ -35221,7 +35274,7 @@
 
   CssStyleSheet __getter__(String name) native;
 
-  StyleSheet item(int index) native;
+  StyleSheet? item(int index) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35349,7 +35402,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _USBInTransferResult(String status, [ByteData data]) {
+  factory _USBInTransferResult(String status, [ByteData? data]) {
     if (data != null) {
       return _USBInTransferResult._create_1(status, data);
     }
@@ -35388,7 +35441,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _USBIsochronousInTransferPacket(String status, [ByteData data]) {
+  factory _USBIsochronousInTransferPacket(String status, [ByteData? data]) {
     if (data != null) {
       return _USBIsochronousInTransferPacket._create_1(status, data);
     }
@@ -35417,7 +35470,7 @@
 
   factory _USBIsochronousInTransferResult(
       List<_USBIsochronousInTransferPacket> packets,
-      [ByteData data]) {
+      [ByteData? data]) {
     if (data != null) {
       return _USBIsochronousInTransferResult._create_1(packets, data);
     }
@@ -35444,7 +35497,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _USBIsochronousOutTransferPacket(String status, [int bytesWritten]) {
+  factory _USBIsochronousOutTransferPacket(String status, [int? bytesWritten]) {
     if (bytesWritten != null) {
       return _USBIsochronousOutTransferPacket._create_1(status, bytesWritten);
     }
@@ -35491,7 +35544,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory _USBOutTransferResult(String status, [int bytesWritten]) {
+  factory _USBOutTransferResult(String status, [int? bytesWritten]) {
     if (bytesWritten != null) {
       return _USBOutTransferResult._create_1(status, bytesWritten);
     }
@@ -35515,17 +35568,17 @@
     throw new UnsupportedError("Not supported");
   }
 
-  int _setInterval_String(String handler, [int timeout, Object arguments]);
+  int _setInterval_String(String handler, [int? timeout, Object? arguments]);
 
-  int _setTimeout_String(String handler, [int timeout, Object arguments]);
+  int _setTimeout_String(String handler, [int? timeout, Object? arguments]);
 
-  void _clearInterval([int handle]);
+  void _clearInterval([int? handle]);
 
-  void _clearTimeout([int handle]);
+  void _clearTimeout([int? handle]);
 
-  int _setInterval(Object handler, [int timeout]);
+  int _setInterval(Object handler, [int? timeout]);
 
-  int _setTimeout(Object handler, [int timeout]);
+  int _setTimeout(Object handler, [int? timeout]);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35587,7 +35640,7 @@
   }
 
   Map<K, V> cast<K, V>() => Map.castFrom<String, String, K, V>(this);
-  bool containsValue(Object value) {
+  bool containsValue(Object? value) {
     for (var v in this.values) {
       if (value == v) {
         return true;
@@ -35600,7 +35653,7 @@
     if (!containsKey(key)) {
       this[key] = ifAbsent();
     }
-    return this[key];
+    return this[key] as String;
   }
 
   void clear() {
@@ -35612,7 +35665,7 @@
   void forEach(void f(String key, String value)) {
     for (var key in keys) {
       var value = this[key];
-      f(key, value);
+      f(key, value as String);
     }
   }
 
@@ -35621,7 +35674,7 @@
     var attributes = _element._attributes;
     var keys = <String>[];
     for (int i = 0, len = attributes.length; i < len; i++) {
-      _Attr attr = attributes[i];
+      _Attr attr = attributes[i] as _Attr;
       if (_matches(attr)) {
         keys.add(attr.name);
       }
@@ -35634,7 +35687,7 @@
     var attributes = _element._attributes;
     var values = <String>[];
     for (int i = 0, len = attributes.length; i < len; i++) {
-      _Attr attr = attributes[i];
+      _Attr attr = attributes[i] as _Attr;
       if (_matches(attr)) {
         values.add(attr.value);
       }
@@ -35666,12 +35719,12 @@
 class _ElementAttributeMap extends _AttributeMap {
   _ElementAttributeMap(Element element) : super(element);
 
-  bool containsKey(Object key) {
-    return _element._hasAttribute(key);
+  bool containsKey(Object? key) {
+    return key is String && _element._hasAttribute(key);
   }
 
-  String operator [](Object key) {
-    return _element.getAttribute(key);
+  String? operator [](Object? key) {
+    return _element.getAttribute(key as String);
   }
 
   void operator []=(String key, String value) {
@@ -35679,7 +35732,7 @@
   }
 
   @pragma('dart2js:tryInline')
-  String remove(Object key) => key is String ? _remove(_element, key) : null;
+  String? remove(Object? key) => key is String ? _remove(_element, key) : null;
 
   /**
    * The number of {key, value} pairs in the map.
@@ -35693,8 +35746,8 @@
   // Inline this because almost all call sites of [remove] do not use [value],
   // and the annotations on the `getAttribute` call allow it to be removed.
   @pragma('dart2js:tryInline')
-  static String _remove(Element element, String key) {
-    String value = JS(
+  static String? _remove(Element element, String key) {
+    String? value = JS(
         // throws:null(1) is not accurate since [key] could be malformed, but
         // [key] is checked again by `removeAttributeNS`.
         'returns:String|Null;depends:all;effects:none;throws:null(1)',
@@ -35710,16 +35763,16 @@
  * Wrapper to expose namespaced attributes as a typed map.
  */
 class _NamespacedAttributeMap extends _AttributeMap {
-  final String _namespace;
+  final String? _namespace;
 
   _NamespacedAttributeMap(Element element, this._namespace) : super(element);
 
-  bool containsKey(Object key) {
-    return _element._hasAttributeNS(_namespace, key);
+  bool containsKey(Object? key) {
+    return key is String && _element._hasAttributeNS(_namespace, key);
   }
 
-  String operator [](Object key) {
-    return _element.getAttributeNS(_namespace, key);
+  String? operator [](Object? key) {
+    return _element.getAttributeNS(_namespace, key as String);
   }
 
   void operator []=(String key, String value) {
@@ -35727,7 +35780,7 @@
   }
 
   @pragma('dart2js:tryInline')
-  String remove(Object key) =>
+  String? remove(Object? key) =>
       key is String ? _remove(_namespace, _element, key) : null;
 
   /**
@@ -35743,8 +35796,8 @@
   // returned [value], and the annotations on the `getAttributeNS` call allow it
   // to be removed.
   @pragma('dart2js:tryInline')
-  static String _remove(String namespace, Element element, String key) {
-    String value = JS(
+  static String? _remove(String? namespace, Element element, String key) {
+    String? value = JS(
         // throws:null(1) is not accurate since [key] could be malformed, but
         // [key] is checked again by `removeAttributeNS`.
         'returns:String|Null;depends:all;effects:none;throws:null(1)',
@@ -35776,11 +35829,12 @@
 
   Map<K, V> cast<K, V>() => Map.castFrom<String, String, K, V>(this);
   // TODO: Use lazy iterator when it is available on Map.
-  bool containsValue(Object value) => values.any((v) => v == value);
+  bool containsValue(Object? value) => values.any((v) => v == value);
 
-  bool containsKey(Object key) => _attributes.containsKey(_attr(key));
+  bool containsKey(Object? key) =>
+      _attributes.containsKey(_attr(key as String));
 
-  String operator [](Object key) => _attributes[_attr(key)];
+  String? operator [](Object? key) => _attributes[_attr(key as String)];
 
   void operator []=(String key, String value) {
     _attributes[_attr(key)] = value;
@@ -35789,7 +35843,7 @@
   String putIfAbsent(String key, String ifAbsent()) =>
       _attributes.putIfAbsent(_attr(key), ifAbsent);
 
-  String remove(Object key) => _attributes.remove(_attr(key));
+  String? remove(Object? key) => _attributes.remove(_attr(key as String));
 
   void clear() {
     // Needs to operate on a snapshot since we are mutating the collection.
@@ -35968,7 +36022,7 @@
    *     WindowBase otherWindow = thisWindow.open('http://www.example.com/', 'foo');
    *     print(otherWindow.opener == thisWindow); // 'true'
    */
-  WindowBase get opener;
+  WindowBase? get opener;
 
   /**
    * A reference to the parent of this window.
@@ -35982,7 +36036,7 @@
    *
    *     print(window.parent == window) // 'true'
    */
-  WindowBase get parent;
+  WindowBase? get parent;
 
   /**
    * A reference to the topmost window in the window hierarchy.
@@ -36003,7 +36057,7 @@
    *
    *     print(window.top == window) // 'true'
    */
-  WindowBase get top;
+  WindowBase? get top;
 
   // Methods.
   /**
@@ -36049,7 +36103,7 @@
    *   from WHATWG.
    */
   void postMessage(var message, String targetOrigin,
-      [List<MessagePort> messagePorts]);
+      [List<MessagePort>? messagePorts]);
 }
 
 abstract class LocationBase {
@@ -36085,7 +36139,7 @@
    * non-empty string containing no whitespace.  To toggle multiple classes, use
    * [toggleAll].
    */
-  bool toggle(String value, [bool shouldAdd]);
+  bool toggle(String value, [bool? shouldAdd]);
 
   /**
    * Returns [:true:] if classes cannot be added or removed from this
@@ -36102,7 +36156,7 @@
    * [value] must be a valid 'token' representing a single class, i.e. a
    * non-empty string containing no whitespace.
    */
-  bool contains(Object value);
+  bool contains(Object? value);
 
   /**
    * Add the class [value] to element.
@@ -36133,7 +36187,7 @@
    * non-empty string containing no whitespace.  To remove multiple classes, use
    * [removeAll].
    */
-  bool remove(Object value);
+  bool remove(Object? value);
 
   /**
    * Add all classes specified in [iterable] to element.
@@ -36155,7 +36209,7 @@
    * Each element of [iterable] must be a valid 'token' representing a single
    * class, i.e. a non-empty string containing no whitespace.
    */
-  void removeAll(Iterable<Object> iterable);
+  void removeAll(Iterable<Object?> iterable);
 
   /**
    * Toggles all classes specified in [iterable] on element.
@@ -36170,7 +36224,7 @@
    * Each element of [iterable] must be a valid 'token' representing a single
    * class, i.e. a non-empty string containing no whitespace.
    */
-  void toggleAll(Iterable<String> iterable, [bool shouldAdd]);
+  void toggleAll(Iterable<String> iterable, [bool? shouldAdd]);
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36247,9 +36301,9 @@
 class _ContentCssListRect extends _ContentCssRect {
   List<Element> _elementList;
 
-  _ContentCssListRect(List<Element> elementList) : super(elementList.first) {
-    _elementList = elementList;
-  }
+  _ContentCssListRect(List<Element> elementList)
+      : _elementList = elementList,
+        super(elementList.first);
 
   /**
    * Set the height to `newHeight`.
@@ -36471,7 +36525,7 @@
    * Returns the intersection of this and `other`, or `null` if they don't
    * intersect.
    */
-  Rectangle<num> intersection(Rectangle<num> other) {
+  Rectangle<num>? intersection(Rectangle<num> other) {
     var x0 = max(left, other.left);
     var x1 = min(left + width, other.left + other.width);
 
@@ -36596,7 +36650,7 @@
    * TODO(sra): It seems wrong to collect a 'changed' flag like this when the
    * underlying toggle returns an 'is set' flag.
    */
-  bool toggle(String value, [bool shouldAdd]) => _sets.fold(
+  bool toggle(String value, [bool? shouldAdd]) => _sets.fold(
       false,
       (bool changed, CssClassSetImpl e) =>
           e.toggle(value, shouldAdd) || changed);
@@ -36608,7 +36662,7 @@
    * This is the Dart equivalent of jQuery's
    * [removeClass](http://api.jquery.com/removeClass/).
    */
-  bool remove(Object value) => _sets.fold(
+  bool remove(Object? value) => _sets.fold(
       false, (bool changed, CssClassSetImpl e) => e.remove(value) || changed);
 }
 
@@ -36642,7 +36696,7 @@
     _element.className = '';
   }
 
-  bool contains(Object value) {
+  bool contains(Object? value) {
     return _contains(_element, value);
   }
 
@@ -36650,11 +36704,11 @@
     return _add(_element, value);
   }
 
-  bool remove(Object value) {
+  bool remove(Object? value) {
     return value is String && _remove(_element, value);
   }
 
-  bool toggle(String value, [bool shouldAdd]) {
+  bool toggle(String value, [bool? shouldAdd]) {
     return _toggle(_element, value, shouldAdd);
   }
 
@@ -36662,11 +36716,11 @@
     _addAll(_element, iterable);
   }
 
-  void removeAll(Iterable<Object> iterable) {
+  void removeAll(Iterable<Object?> iterable) {
     _removeAll(_element, iterable);
   }
 
-  void retainAll(Iterable<Object> iterable) {
+  void retainAll(Iterable<Object?> iterable) {
     _removeWhere(_element, iterable.toSet().contains, false);
   }
 
@@ -36678,7 +36732,7 @@
     _removeWhere(_element, test, false);
   }
 
-  static bool _contains(Element _element, Object value) {
+  static bool _contains(Element _element, Object? value) {
     return value is String && _classListContains(_classListOf(_element), value);
   }
 
@@ -36699,7 +36753,7 @@
     return removed;
   }
 
-  static bool _toggle(Element _element, String value, bool shouldAdd) {
+  static bool _toggle(Element _element, String value, bool? shouldAdd) {
     // There is no value that can be passed as the second argument of
     // DomTokenList.toggle that behaves the same as passing one argument.
     // `null` is seen as false, meaning 'remove'.
@@ -36713,13 +36767,13 @@
     return _classListToggle1(list, value);
   }
 
-  static bool _toggleOnOff(Element _element, String value, bool shouldAdd) {
+  static bool _toggleOnOff(Element _element, String value, bool? shouldAdd) {
     DomTokenList list = _classListOf(_element);
     // IE's toggle does not take a second parameter. We would prefer:
     //
     //    return _classListToggle2(list, value, shouldAdd);
     //
-    if (shouldAdd) {
+    if (shouldAdd ?? false) {
       _classListAdd(list, value);
       return true;
     } else {
@@ -36735,10 +36789,10 @@
     }
   }
 
-  static void _removeAll(Element _element, Iterable<Object> iterable) {
+  static void _removeAll(Element _element, Iterable<Object?> iterable) {
     DomTokenList list = _classListOf(_element);
-    for (String value in iterable) {
-      _classListRemove(list, value);
+    for (Object? value in iterable) {
+      _classListRemove(list, value as String);
     }
   }
 
@@ -36747,7 +36801,7 @@
     DomTokenList list = _classListOf(_element);
     int i = 0;
     while (i < _classListLength(list)) {
-      String item = list.item(i);
+      String item = list.item(i)!;
       if (doRemove == test(item)) {
         _classListRemove(list, item);
       } else {
@@ -36796,7 +36850,7 @@
   }
 
   static bool _classListToggle2(
-      DomTokenList list, String value, bool shouldAdd) {
+      DomTokenList list, String value, bool? shouldAdd) {
     return JS('bool', '#.toggle(#, #)', list, value, shouldAdd);
   }
 }
@@ -36858,7 +36912,9 @@
    * `inherit` or invalid CSS will cause this constructor to throw a
    * FormatError.
    */
-  Dimension.css(String cssValue) {
+  Dimension.css(String cssValue)
+      : _unit = '',
+        _value = 0 {
     if (cssValue == '') cssValue = '0px';
     if (cssValue.endsWith('%')) {
       _unit = '%';
@@ -36920,7 +36976,7 @@
    * * [EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
    *   from MDN.
    */
-  Stream<T> forTarget(EventTarget e, {bool useCapture: false}) =>
+  Stream<T> forTarget(EventTarget? e, {bool useCapture: false}) =>
       new _EventStream<T>(e, _eventType, useCapture);
 
   /**
@@ -37012,7 +37068,7 @@
  * Adapter for exposing DOM events as Dart streams.
  */
 class _EventStream<T extends Event> extends Stream<T> {
-  final EventTarget _target;
+  final EventTarget? _target;
   final String _eventType;
   final bool _useCapture;
 
@@ -37020,16 +37076,16 @@
 
   // DOM events are inherently multi-subscribers.
   Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription),
-          void onCancel(StreamSubscription<T> subscription)}) =>
+          {void onListen(StreamSubscription<T> subscription)?,
+          void onCancel(StreamSubscription<T> subscription)?}) =>
       this;
   bool get isBroadcast => true;
 
   // TODO(9757): Inlining should be smart and inline only when inlining would
   // enable scalar replacement of an immediately allocated receiver.
   @pragma('dart2js:tryInline')
-  StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<T> listen(void onData(T event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return new _EventStreamSubscription<T>(
         this._target, this._eventType, onData, this._useCapture);
   }
@@ -37080,8 +37136,8 @@
       });
 
   // Delegate all regular Stream behavior to a wrapped Stream.
-  StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<T> listen(void onData(T event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     var pool = new _StreamPool<T>.broadcast();
     for (var target in _targetList) {
       pool.add(new _EventStream<T>(target, _eventType, _useCapture));
@@ -37099,8 +37155,8 @@
   }
 
   Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription),
-          void onCancel(StreamSubscription<T> subscription)}) =>
+          {void onListen(StreamSubscription<T> subscription)?,
+          void onCancel(StreamSubscription<T> subscription)?}) =>
       this;
   bool get isBroadcast => true;
 }
@@ -37111,9 +37167,9 @@
 
 class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
   int _pauseCount = 0;
-  EventTarget _target;
+  EventTarget? _target;
   final String _eventType;
-  EventListener _onData;
+  EventListener? _onData;
   final bool _useCapture;
 
   // TODO(leafp): It would be better to write this as
@@ -37126,7 +37182,7 @@
   // which are typed correctly.  But this currently runs afoul of restrictions
   // on is checks for compatibility with the VM.
   _EventStreamSubscription(
-      this._target, this._eventType, void onData(T event), this._useCapture)
+      this._target, this._eventType, void onData(T event)?, this._useCapture)
       : _onData = onData == null
             ? null
             : _wrapZone<Event>((e) => (onData as dynamic)(e)) {
@@ -37134,18 +37190,23 @@
   }
 
   Future cancel() {
-    if (_canceled) return null;
+    // Check for strong mode. This function can no longer return null in strong
+    // mode, so only return null in weak mode to preserve synchronous timing.
+    // See issue 41653 for more details.
+    dynamic emptyFuture =
+        typeAcceptsNull<Event>() ? null : Future<void>.value();
+    if (_canceled) return emptyFuture as Future;
 
     _unlisten();
     // Clear out the target to indicate this is complete.
     _target = null;
     _onData = null;
-    return null;
+    return emptyFuture as Future;
   }
 
   bool get _canceled => _target == null;
 
-  void onData(void handleData(T event)) {
+  void onData(void handleData(T event)?) {
     if (_canceled) {
       throw new StateError("Subscription has been canceled.");
     }
@@ -37158,12 +37219,12 @@
   }
 
   /// Has no effect.
-  void onError(Function handleError) {}
+  void onError(Function? handleError) {}
 
   /// Has no effect.
-  void onDone(void handleDone()) {}
+  void onDone(void handleDone()?) {}
 
-  void pause([Future resumeSignal]) {
+  void pause([Future? resumeSignal]) {
     if (_canceled) return;
     ++_pauseCount;
     _unlisten();
@@ -37183,17 +37244,17 @@
 
   void _tryResume() {
     if (_onData != null && !isPaused) {
-      _target.addEventListener(_eventType, _onData, _useCapture);
+      _target!.addEventListener(_eventType, _onData, _useCapture);
     }
   }
 
   void _unlisten() {
     if (_onData != null) {
-      _target.removeEventListener(_eventType, _onData, _useCapture);
+      _target!.removeEventListener(_eventType, _onData, _useCapture);
     }
   }
 
-  Future<E> asFuture<E>([E futureValue]) {
+  Future<E> asFuture<E>([E? futureValue]) {
     // We just need a future that will never succeed or fail.
     var completer = new Completer<E>();
     return completer.future;
@@ -37218,21 +37279,20 @@
   /** The type of event this stream is providing (e.g. "keydown"). */
   String _type;
 
-  _CustomEventStreamImpl(String type) {
-    _type = type;
-    _streamController = new StreamController.broadcast(sync: true);
-  }
+  _CustomEventStreamImpl(String type)
+      : _type = type,
+        _streamController = new StreamController.broadcast(sync: true);
 
   // Delegate all regular Stream behavior to our wrapped Stream.
-  StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<T> listen(void onData(T event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _streamController.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
   Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription),
-          void onCancel(StreamSubscription<T> subscription)}) =>
+          {void onListen(StreamSubscription<T> subscription)?,
+          void onCancel(StreamSubscription<T> subscription)?}) =>
       _streamController.stream;
 
   bool get isBroadcast => true;
@@ -37248,7 +37308,7 @@
 
   void add(KeyEvent event) {
     if (event.type == _type) {
-      event.currentTarget.dispatchEvent(event._parent);
+      event.currentTarget!.dispatchEvent(event._parent);
       _streamController.add(event);
     }
   }
@@ -37260,7 +37320,7 @@
  */
 // TODO (efortuna): Remove this when Issue 12218 is addressed.
 class _StreamPool<T> {
-  StreamController<T> _controller;
+  StreamController<T>? _controller;
 
   /// Subscriptions to the streams that make up the pool.
   var _subscriptions = new Map<Stream<T>, StreamSubscription<T>>();
@@ -37280,7 +37340,7 @@
   /**
    * The stream through which all events from streams in the pool are emitted.
    */
-  Stream<T> get stream => _controller.stream;
+  Stream<T> get stream => _controller!.stream;
 
   /**
    * Adds [stream] as a member of this pool.
@@ -37291,8 +37351,8 @@
    */
   void add(Stream<T> stream) {
     if (_subscriptions.containsKey(stream)) return;
-    _subscriptions[stream] = stream.listen(_controller.add,
-        onError: _controller.addError, onDone: () => remove(stream));
+    _subscriptions[stream] = stream.listen(_controller!.add,
+        onError: _controller!.addError, onDone: () => remove(stream));
   }
 
   /** Removes [stream] as a member of this pool. */
@@ -37307,7 +37367,7 @@
       subscription.cancel();
     }
     _subscriptions.clear();
-    _controller.close();
+    _controller!.close();
   }
 }
 
@@ -37320,7 +37380,7 @@
   final _eventTypeGetter;
   const _CustomEventStreamProvider(this._eventTypeGetter);
 
-  Stream<T> forTarget(EventTarget e, {bool useCapture: false}) {
+  Stream<T> forTarget(EventTarget? e, {bool useCapture: false}) {
     return new _EventStream<T>(e, _eventTypeGetter(e), useCapture);
   }
 
@@ -37749,8 +37809,8 @@
    * All known URI attributes will be validated against the UriPolicy, if
    * [uriPolicy] is null then a default UriPolicy will be used.
    */
-  _Html5NodeValidator({UriPolicy uriPolicy})
-      : uriPolicy = uriPolicy != null ? uriPolicy : new UriPolicy() {
+  _Html5NodeValidator({UriPolicy? uriPolicy})
+      : uriPolicy = uriPolicy ?? UriPolicy() {
     if (_attributeValidators.isEmpty) {
       for (var attr in _standardAttributes) {
         _attributeValidators[attr] = _standardAttributeValidator;
@@ -37810,11 +37870,11 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void sort([int compare(E a, E b)]) {
+  void sort([int compare(E a, E b)?]) {
     throw new UnsupportedError("Cannot sort immutable List.");
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     throw new UnsupportedError("Cannot shuffle immutable List.");
   }
 
@@ -37838,7 +37898,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  bool remove(Object object) {
+  bool remove(Object? object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -37862,7 +37922,7 @@
     throw new UnsupportedError("Cannot modify an immutable List.");
   }
 
-  void fillRange(int start, int end, [E fillValue]) {
+  void fillRange(int start, int end, [E? fillValue]) {
     throw new UnsupportedError("Cannot modify an immutable List.");
   }
 }
@@ -38753,7 +38813,7 @@
   final String _type;
 
   /** The element we are watching for events to happen on. */
-  final EventTarget _target;
+  final EventTarget? _target;
 
   // The distance to shift from upper case alphabet Roman letters to lower case.
   static final int _ROMAN_ALPHABET_OFFSET = "a".codeUnits[0] - "A".codeUnits[0];
@@ -38796,7 +38856,7 @@
 
   /** Return a stream for KeyEvents for the specified target. */
   // Note: this actually functions like a factory constructor.
-  CustomStream<KeyEvent> forTarget(EventTarget e, {bool useCapture: false}) {
+  CustomStream<KeyEvent> forTarget(EventTarget? e, {bool useCapture: false}) {
     var handler =
         new _KeyboardEventHandler.initializeAllEventListeners(_type, e);
     return handler._stream;
@@ -38816,7 +38876,8 @@
    * and charcodes when they are not provided.
    */
   _KeyboardEventHandler.initializeAllEventListeners(this._type, this._target)
-      : super(_EVENT_TYPE) {
+      : _stream = new _CustomKeyEventStreamImpl(_type),
+        super(_EVENT_TYPE) {
     Element.keyDownEvent
         .forTarget(_target, useCapture: true)
         .listen(processKeyDown);
@@ -38826,7 +38887,6 @@
     Element.keyUpEvent
         .forTarget(_target, useCapture: true)
         .listen(processKeyUp);
-    _stream = new _CustomKeyEventStreamImpl(_type);
   }
 
   /** Determine if caps lock is one of the currently depressed keys. */
@@ -39068,7 +39128,7 @@
         _keyIdentifier.containsKey(e._shadowKeyIdentifier)) {
       // This is needed for Safari Windows because it currently doesn't give a
       // keyCode/which for non printable keys.
-      e._shadowKeyCode = _keyIdentifier[e._shadowKeyIdentifier];
+      e._shadowKeyCode = _keyIdentifier[e._shadowKeyIdentifier]!;
     }
     e._shadowAltKey = _keyDownList.any((var element) => element.altKey);
     _stream.add(e);
@@ -39077,7 +39137,7 @@
   /** Handle keyup events. */
   void processKeyUp(KeyboardEvent event) {
     var e = new KeyEvent.wrap(event);
-    KeyboardEvent toRemove = null;
+    KeyboardEvent? toRemove = null;
     for (var key in _keyDownList) {
       if (key.keyCode == e.keyCode) {
         toRemove = key;
@@ -39181,7 +39241,7 @@
    * The UriPolicy can be used to restrict the locations the navigation elements
    * are allowed to direct to. By default this will use the default [UriPolicy].
    */
-  void allowNavigation([UriPolicy uriPolicy]) {
+  void allowNavigation([UriPolicy? uriPolicy]) {
     if (uriPolicy == null) {
       uriPolicy = new UriPolicy();
     }
@@ -39194,7 +39254,7 @@
    * The UriPolicy can be used to restrict the locations the images may be
    * loaded from. By default this will use the default [UriPolicy].
    */
-  void allowImages([UriPolicy uriPolicy]) {
+  void allowImages([UriPolicy? uriPolicy]) {
     if (uriPolicy == null) {
       uriPolicy = new UriPolicy();
     }
@@ -39235,7 +39295,7 @@
    * If [tagName] is not specified then this allows inline styles on all
    * elements. Otherwise tagName limits the styles to the specified elements.
    */
-  void allowInlineStyles({String tagName}) {
+  void allowInlineStyles({String? tagName}) {
     if (tagName == null) {
       tagName = '*';
     } else {
@@ -39253,7 +39313,7 @@
    * Common things which are not allowed are script elements, style attributes
    * and any script handlers.
    */
-  void allowHtml5({UriPolicy uriPolicy}) {
+  void allowHtml5({UriPolicy? uriPolicy}) {
     add(new _Html5NodeValidator(uriPolicy: uriPolicy));
   }
 
@@ -39272,9 +39332,9 @@
    * tag extensions.
    */
   void allowCustomElement(String tagName,
-      {UriPolicy uriPolicy,
-      Iterable<String> attributes,
-      Iterable<String> uriAttributes}) {
+      {UriPolicy? uriPolicy,
+      Iterable<String>? attributes,
+      Iterable<String>? uriAttributes}) {
     var tagNameUpper = tagName.toUpperCase();
     var attrs = attributes
         ?.map<String>((name) => '$tagNameUpper::${name.toLowerCase()}');
@@ -39297,9 +39357,9 @@
    * custom tags.
    */
   void allowTagExtension(String tagName, String baseName,
-      {UriPolicy uriPolicy,
-      Iterable<String> attributes,
-      Iterable<String> uriAttributes}) {
+      {UriPolicy? uriPolicy,
+      Iterable<String>? attributes,
+      Iterable<String>? uriAttributes}) {
     var baseNameUpper = baseName.toUpperCase();
     var tagNameUpper = tagName.toUpperCase();
     var attrs = attributes
@@ -39315,9 +39375,9 @@
   }
 
   void allowElement(String tagName,
-      {UriPolicy uriPolicy,
-      Iterable<String> attributes,
-      Iterable<String> uriAttributes}) {
+      {UriPolicy? uriPolicy,
+      Iterable<String>? attributes,
+      Iterable<String>? uriAttributes}) {
     allowCustomElement(tagName,
         uriPolicy: uriPolicy,
         attributes: attributes,
@@ -39359,7 +39419,7 @@
   final Set<String> allowedElements = new Set<String>();
   final Set<String> allowedAttributes = new Set<String>();
   final Set<String> allowedUriAttributes = new Set<String>();
-  final UriPolicy uriPolicy;
+  final UriPolicy? uriPolicy;
 
   factory _SimpleNodeValidator.allowNavigation(UriPolicy uriPolicy) {
     return new _SimpleNodeValidator(uriPolicy, allowedElements: const [
@@ -39434,9 +39494,9 @@
    * lowercase attribute name. For example `'IMG:src'`.
    */
   _SimpleNodeValidator(this.uriPolicy,
-      {Iterable<String> allowedElements,
-      Iterable<String> allowedAttributes,
-      Iterable<String> allowedUriAttributes}) {
+      {Iterable<String>? allowedElements,
+      Iterable<String>? allowedAttributes,
+      Iterable<String>? allowedUriAttributes}) {
     this.allowedElements.addAll(allowedElements ?? const []);
     allowedAttributes = allowedAttributes ?? const [];
     allowedUriAttributes = allowedUriAttributes ?? const [];
@@ -39456,9 +39516,9 @@
   bool allowsAttribute(Element element, String attributeName, String value) {
     var tagName = Element._safeTagName(element);
     if (allowedUriAttributes.contains('$tagName::$attributeName')) {
-      return uriPolicy.allowsUri(value);
+      return uriPolicy!.allowsUri(value);
     } else if (allowedUriAttributes.contains('*::$attributeName')) {
-      return uriPolicy.allowsUri(value);
+      return uriPolicy!.allowsUri(value);
     } else if (allowedAttributes.contains('$tagName::$attributeName')) {
       return true;
     } else if (allowedAttributes.contains('*::$attributeName')) {
@@ -39479,8 +39539,8 @@
   _CustomElementNodeValidator(
       UriPolicy uriPolicy,
       Iterable<String> allowedElements,
-      Iterable<String> allowedAttributes,
-      Iterable<String> allowedUriAttributes,
+      Iterable<String>? allowedAttributes,
+      Iterable<String>? allowedUriAttributes,
       bool allowTypeExtension,
       bool allowCustomTag)
       : this.allowTypeExtension = allowTypeExtension == true,
@@ -39625,7 +39685,7 @@
     _list.add(element);
   }
 
-  bool remove(Object element) => _list.remove(element);
+  bool remove(Object? element) => _list.remove(element);
 
   void clear() {
     _list.clear();
@@ -39633,7 +39693,7 @@
 
   // List APIs
 
-  E operator [](int index) => _list[index];
+  E operator [](int index) => _list[index] as E;
 
   void operator []=(int index, E value) {
     _list[index] = value;
@@ -39643,19 +39703,23 @@
     _list.length = newLength;
   }
 
-  void sort([int compare(E a, E b)]) {
-    // Implicit downcast on argument from Node to E-extends-Node.
-    _list.sort((Node a, Node b) => compare(a, b));
+  void sort([int compare(E a, E b)?]) {
+    if (compare == null) {
+      _list.sort();
+    } else {
+      _list.sort((Node a, Node b) => compare(a as E, b as E));
+    }
   }
 
-  int indexOf(Object element, [int start = 0]) => _list.indexOf(element, start);
+  int indexOf(Object? element, [int start = 0]) =>
+      _list.indexOf(element as Node, start);
 
-  int lastIndexOf(Object element, [int start]) =>
-      _list.lastIndexOf(element, start);
+  int lastIndexOf(Object? element, [int? start]) =>
+      _list.lastIndexOf(element as Node, start);
 
   void insert(int index, E element) => _list.insert(index, element);
 
-  E removeAt(int index) => _list.removeAt(index);
+  E removeAt(int index) => _list.removeAt(index) as E;
 
   void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
     _list.setRange(start, end, iterable, skipCount);
@@ -39669,7 +39733,7 @@
     _list.replaceRange(start, end, iterable);
   }
 
-  void fillRange(int start, int end, [E fillValue]) {
+  void fillRange(int start, int end, [E? fillValue]) {
     _list.fillRange(start, end, fillValue);
   }
 
@@ -39688,7 +39752,7 @@
     return _iterator.moveNext();
   }
 
-  E get current => _iterator.current;
+  E get current => _iterator.current as E;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -39723,7 +39787,7 @@
   final List<T> _array;
   final int _length; // Cache array length for faster access.
   int _position;
-  T _current;
+  T? _current;
 
   FixedSizeListIterator(List<T> array)
       : _array = array,
@@ -39742,14 +39806,14 @@
     return false;
   }
 
-  T get current => _current;
+  T get current => _current as T;
 }
 
 // Iterator for arrays with variable size.
 class _VariableSizeListIterator<T> implements Iterator<T> {
   final List<T> _array;
   int _position;
-  T _current;
+  T? _current;
 
   _VariableSizeListIterator(List<T> array)
       : _array = array,
@@ -39767,7 +39831,7 @@
     return false;
   }
 
-  T get current => _current;
+  T get current => _current as T;
 }
 // Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -39779,7 +39843,7 @@
 
   bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"');
 
-  MemoryInfo get memory =>
+  MemoryInfo? get memory =>
       _isConsoleDefined ? JS('MemoryInfo', 'window.console.memory') : null;
 
   void assertCondition(bool condition, Object arg) => _isConsoleDefined
@@ -39859,12 +39923,12 @@
 // We omit an unwrapper for Window as no methods take a non-local
 // window as a parameter.
 
-WindowBase _convertNativeToDart_Window(win) {
+WindowBase? _convertNativeToDart_Window(win) {
   if (win == null) return null;
   return _DOMWindowCrossFrame._createSafe(win);
 }
 
-EventTarget _convertNativeToDart_EventTarget(e) {
+EventTarget? _convertNativeToDart_EventTarget(e) {
   if (e == null) {
     return null;
   }
@@ -39882,7 +39946,7 @@
     return e;
 }
 
-EventTarget _convertDartToNative_EventTarget(e) {
+EventTarget? _convertDartToNative_EventTarget(e) {
   if (e is _DOMWindowCrossFrame) {
     return e._window;
   } else {
@@ -39962,7 +40026,7 @@
   }
 }
 
-Function _registerCustomElement(context, document, String tag, [Map options]) {
+Function _registerCustomElement(context, document, String tag, [Map? options]) {
   // Function follows the same pattern as the following JavaScript code for
   // registering a custom element.
   //
@@ -39978,7 +40042,7 @@
   //    var e = document.createElement('x-foo');
 
   var extendsTagName = '';
-  Type type;
+  Type? type;
   if (options != null) {
     extendsTagName = options['extends'];
     type = options['prototype'];
@@ -40058,7 +40122,7 @@
   var _constructor;
   var _nativeType;
 
-  _JSElementUpgrader(Document document, Type type, String extendsTag) {
+  _JSElementUpgrader(Document document, Type type, String? extendsTag) {
     var interceptorClass = findInterceptorConstructorForType(type);
     if (interceptorClass == null) {
       throw new ArgumentError(type);
@@ -40138,8 +40202,7 @@
   // Methods.
   void close() => JS('void', '#.close()', _window);
 
-  void postMessage(var message, String targetOrigin,
-      [List messagePorts = null]) {
+  void postMessage(var message, String targetOrigin, [List? messagePorts]) {
     if (messagePorts == null) {
       JS('void', '#.postMessage(#,#)', _window,
           convertDartToNative_SerializedScriptValue(message), targetOrigin);
@@ -40171,26 +40234,26 @@
   Events get on => throw new UnsupportedError(
       'You can only attach EventListeners to your own window.');
   // TODO(efortuna): Remove this method. dartbug.com/16814
-  void _addEventListener(String type, EventListener listener,
-          [bool useCapture]) =>
+  void _addEventListener(String? type, EventListener? listener,
+          [bool? useCapture]) =>
       throw new UnsupportedError(
           'You can only attach EventListeners to your own window.');
   // TODO(efortuna): Remove this method. dartbug.com/16814
-  void addEventListener(String type, EventListener listener,
-          [bool useCapture]) =>
+  void addEventListener(String type, EventListener? listener,
+          [bool? useCapture]) =>
       throw new UnsupportedError(
           'You can only attach EventListeners to your own window.');
   // TODO(efortuna): Remove this method. dartbug.com/16814
   bool dispatchEvent(Event event) => throw new UnsupportedError(
       'You can only attach EventListeners to your own window.');
   // TODO(efortuna): Remove this method. dartbug.com/16814
-  void _removeEventListener(String type, EventListener listener,
-          [bool useCapture]) =>
+  void _removeEventListener(String? type, EventListener? listener,
+          [bool? useCapture]) =>
       throw new UnsupportedError(
           'You can only attach EventListeners to your own window.');
   // TODO(efortuna): Remove this method. dartbug.com/16814
-  void removeEventListener(String type, EventListener listener,
-          [bool useCapture]) =>
+  void removeEventListener(String type, EventListener? listener,
+          [bool? useCapture]) =>
       throw new UnsupportedError(
           'You can only attach EventListeners to your own window.');
 }
@@ -40306,9 +40369,10 @@
   bool get _realAltKey => JS('bool', '#.altKey', _parent);
 
   /** Shadows on top of the parent's currentTarget. */
-  EventTarget _currentTarget;
+  EventTarget? _currentTarget;
 
-  final InputDeviceCapabilities sourceCapabilities;
+  InputDeviceCapabilities? get sourceCapabilities =>
+      JS('InputDeviceCapabilities', '#.sourceCapabilities', this);
 
   /**
    * The value we want to use for this object's dispatch. Created here so it is
@@ -40323,7 +40387,12 @@
   }
 
   /** Construct a KeyEvent with [parent] as the event we're emulating. */
-  KeyEvent.wrap(KeyboardEvent parent) : super(parent) {
+  KeyEvent.wrap(KeyboardEvent parent)
+      : _parent = parent,
+        _shadowAltKey = false,
+        _shadowCharCode = 0,
+        _shadowKeyCode = 0,
+        super(parent) {
     _parent = parent;
     _shadowAltKey = _realAltKey;
     _shadowCharCode = _realCharCode;
@@ -40333,7 +40402,7 @@
 
   /** Programmatically create a new KeyEvent (and KeyboardEvent). */
   factory KeyEvent(String type,
-      {Window view,
+      {Window? view,
       bool canBubble: true,
       bool cancelable: true,
       int keyCode: 0,
@@ -40343,12 +40412,12 @@
       bool altKey: false,
       bool shiftKey: false,
       bool metaKey: false,
-      EventTarget currentTarget}) {
+      EventTarget? currentTarget}) {
     if (view == null) {
       view = window;
     }
 
-    var eventObj;
+    dynamic eventObj;
 
     // Currently this works on everything but Safari. Safari throws an
     // "Attempting to change access mechanism for an unconfigurable property"
@@ -40401,7 +40470,7 @@
           '&& document.body.dispatchEvent.length > 0');
 
   /** The currently registered target for this event. */
-  EventTarget get currentTarget => _currentTarget;
+  EventTarget? get currentTarget => _currentTarget;
 
   // This is an experimental method to be sure.
   static String _convertToHexString(int charCode, int keyCode) {
@@ -40444,9 +40513,9 @@
   bool get metaKey => _parent.metaKey;
   /** True if the shift key was pressed during this event. */
   bool get shiftKey => _parent.shiftKey;
-  Window get view => _parent.view;
+  WindowBase? get view => _parent.view;
   void _initUIEvent(
-      String type, bool canBubble, bool cancelable, Window view, int detail) {
+      String type, bool canBubble, bool cancelable, Window? view, int detail) {
     throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent.");
   }
 
@@ -40464,9 +40533,9 @@
       String type,
       bool canBubble,
       bool cancelable,
-      Window view,
+      Window? view,
       String keyIdentifier,
-      int location,
+      int? location,
       bool ctrlKey,
       bool altKey,
       bool shiftKey,
@@ -40491,7 +40560,7 @@
    * browser.  If false, using these types will generate a runtime
    * error.
    */
-  static final supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
+  static final bool supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
 
   /**
    * Returns true if SIMD types in dart:typed_data types are supported
@@ -40511,7 +40580,7 @@
   final Event wrapped;
 
   /** The CSS selector involved with event delegation. */
-  String _selector;
+  String? _selector;
 
   _WrappedEvent(this.wrapped);
 
@@ -40521,7 +40590,7 @@
 
   bool get composed => wrapped.composed;
 
-  EventTarget get currentTarget => wrapped.currentTarget;
+  EventTarget? get currentTarget => wrapped.currentTarget;
 
   bool get defaultPrevented => wrapped.defaultPrevented;
 
@@ -40529,13 +40598,13 @@
 
   bool get isTrusted => wrapped.isTrusted;
 
-  EventTarget get target => wrapped.target;
+  EventTarget? get target => wrapped.target;
 
-  double get timeStamp => wrapped.timeStamp;
+  double get timeStamp => wrapped.timeStamp as double;
 
   String get type => wrapped.type;
 
-  void _initEvent(String type, [bool bubbles, bool cancelable]) {
+  void _initEvent(String type, [bool? bubbles, bool? cancelable]) {
     throw new UnsupportedError('Cannot initialize this Event.');
   }
 
@@ -40563,13 +40632,12 @@
       throw new UnsupportedError('Cannot call matchingTarget if this Event did'
           ' not arise as a result of event delegation.');
     }
-    Element currentTarget = this.currentTarget;
-    Element target = this.target;
-    var matchedTarget;
+    Element? currentTarget = this.currentTarget as Element?;
+    Element? target = this.target as Element?;
     do {
-      if (target.matches(_selector)) return target;
+      if (target!.matches(_selector!)) return target;
       target = target.parent;
-    } while (target != null && target != currentTarget.parent);
+    } while (target != null && target != currentTarget!.parent);
     throw new StateError('No selector matched for populating matchedTarget.');
   }
 
@@ -40583,7 +40651,7 @@
    *   from W3C.
    */
   // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#extensions-to-event
-  List<Node> get path => wrapped.path;
+  List<Node> get path => wrapped.path as List<Node>;
 
   dynamic get _get_currentTarget => wrapped._get_currentTarget;
 
@@ -40593,14 +40661,15 @@
 // 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.
 
-void Function(T) _wrapZone<T>(void Function(T) callback) {
+void Function(T)? _wrapZone<T>(void Function(T)? callback) {
   // For performance reasons avoid wrapping if we are in the root zone.
   if (Zone.current == Zone.root) return callback;
   if (callback == null) return null;
   return Zone.current.bindUnaryCallbackGuarded(callback);
 }
 
-void Function(T1, T2) _wrapBinaryZone<T1, T2>(void Function(T1, T2) callback) {
+void Function(T1, T2)? _wrapBinaryZone<T1, T2>(
+    void Function(T1, T2)? callback) {
   // For performance reasons avoid wrapping if we are in the root zone.
   if (Zone.current == Zone.root) return callback;
   if (callback == null) return null;
@@ -40624,7 +40693,7 @@
  * For details about CSS selector syntax, see the
  * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
  */
-Element querySelector(String selectors) => document.querySelector(selectors);
+Element? querySelector(String selectors) => document.querySelector(selectors);
 
 /**
  * Finds all descendant elements of this document that match the specified
@@ -40672,7 +40741,7 @@
    *
    * If a uriPolicy is not specified then the default uriPolicy will be used.
    */
-  factory NodeValidator({UriPolicy uriPolicy}) =>
+  factory NodeValidator({UriPolicy? uriPolicy}) =>
       new _Html5NodeValidator(uriPolicy: uriPolicy);
 
   factory NodeValidator.throws(NodeValidator base) =>
@@ -40816,12 +40885,12 @@
   _ValidatingTreeSanitizer(this.validator) {}
 
   void sanitizeTree(Node node) {
-    void walk(Node node, Node parent) {
+    void walk(Node node, Node? parent) {
       sanitizeNode(node, parent);
 
       var child = node.lastChild;
       while (null != child) {
-        Node nextChild;
+        Node? nextChild;
         try {
           // Child may be removed during the walk, and we may not even be able
           // to get its previousNode. But it's also possible that previousNode
@@ -40852,7 +40921,7 @@
   }
 
   /// Aggressively try to remove node.
-  void _removeNode(Node node, Node parent) {
+  void _removeNode(Node node, Node? parent) {
     // If we have the parent, it's presumably already passed more sanitization
     // or is the fragment, so ask it to remove the child. And if that fails
     // try to set the outer html.
@@ -40865,7 +40934,7 @@
   }
 
   /// Sanitize the element, assuming we can't trust anything about it.
-  void _sanitizeUntrustedElement(/* Element */ element, Node parent) {
+  void _sanitizeUntrustedElement(/* Element */ element, Node? parent) {
     // If the _hasCorruptedAttributes does not successfully return false,
     // then we consider it corrupted and remove.
     // TODO(alanknight): This is a workaround because on Firefox
@@ -40914,8 +40983,8 @@
   /// Having done basic sanity checking on the element, and computed the
   /// important attributes we want to check, remove it if it's not valid
   /// or not allowed, either as a whole or particular attributes.
-  void _sanitizeElement(Element element, Node parent, bool corrupted,
-      String text, String tag, Map attrs, String isAttr) {
+  void _sanitizeElement(Element element, Node? parent, bool corrupted,
+      String text, String tag, Map attrs, String? isAttr) {
     if (false != corrupted) {
       _removeNode(element, parent);
       window.console
@@ -40957,7 +41026,7 @@
   }
 
   /// Sanitize the node and its children recursively.
-  void sanitizeNode(Node node, Node parent) {
+  void sanitizeNode(Node node, Node? parent) {
     switch (node.nodeType) {
       case Node.ELEMENT_NODE:
         _sanitizeUntrustedElement(node, parent);
diff --git a/sdk/lib/html/dartium/nativewrappers.dart b/sdk/lib/html/dartium/nativewrappers.dart
index db80798..b6d2dc4 100644
--- a/sdk/lib/html/dartium/nativewrappers.dart
+++ b/sdk/lib/html/dartium/nativewrappers.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.6
-
 library nativewrappers;
 
 class NativeFieldWrapperClass1 {}
diff --git a/sdk/lib/html/html_common/conversions.dart b/sdk/lib/html/html_common/conversions.dart
index cbe2cd6..0b5459f 100644
--- a/sdk/lib/html/html_common/conversions.dart
+++ b/sdk/lib/html/html_common/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.6
-
 // Conversions for IDBKey.
 //
 // Per http://www.w3.org/TR/IndexedDB/#key-construct
@@ -257,7 +255,7 @@
     if (isJavaScriptArray(e)) {
       var l = JS<List>('returns:List;creates:;', '#', e);
       var slot = findSlot(l);
-      var copy = JS<List>('returns:List|Null;creates:;', '#', readSlot(slot));
+      var copy = JS<List?>('returns:List|Null;creates:;', '#', readSlot(slot));
       if (copy != null) return copy;
 
       int length = l.length;
diff --git a/sdk/lib/html/html_common/conversions_dart2js.dart b/sdk/lib/html/html_common/conversions_dart2js.dart
index 028707f..c1fb0be 100644
--- a/sdk/lib/html/html_common/conversions_dart2js.dart
+++ b/sdk/lib/html/html_common/conversions_dart2js.dart
@@ -1,13 +1,12 @@
-// @dart = 2.6
-
 part of html_common;
 
 /// Converts a JavaScript object with properties into a Dart Map.
 /// Not suitable for nested objects.
-Map<String, dynamic> convertNativeToDart_Dictionary(object) {
+Map<String, dynamic>? convertNativeToDart_Dictionary(object) {
   if (object == null) return null;
   var dict = <String, dynamic>{};
-  var keys = JS('JSExtendableArray', 'Object.getOwnPropertyNames(#)', object);
+  var keys = JS<JSExtendableArray>(
+      'JSExtendableArray', 'Object.getOwnPropertyNames(#)', object);
   for (final key in keys) {
     dict[key] = JS('var', '#[#]', object, key);
   }
@@ -15,7 +14,7 @@
 }
 
 /// Converts a flat Dart map into a JavaScript object with properties.
-convertDartToNative_Dictionary(Map dict, [void postCreate(Object f)]) {
+convertDartToNative_Dictionary(Map? dict, [void postCreate(Object? f)?]) {
   if (dict == null) return null;
   var object = JS('var', '{}');
   if (postCreate != null) {
@@ -38,7 +37,7 @@
 }
 
 DateTime convertNativeToDart_DateTime(date) {
-  var millisSinceEpoch = JS('int', '#.getTime()', date);
+  int millisSinceEpoch = JS('int', '#.getTime()', date);
   return new DateTime.fromMillisecondsSinceEpoch(millisSinceEpoch, isUtc: true);
 }
 
diff --git a/sdk/lib/html/html_common/css_class_set.dart b/sdk/lib/html/html_common/css_class_set.dart
index 814829b..ff15a4d 100644
--- a/sdk/lib/html/html_common/css_class_set.dart
+++ b/sdk/lib/html/html_common/css_class_set.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.6
-
 part of html_common;
 
 abstract class CssClassSetImpl extends SetBase<String> implements CssClassSet {
@@ -25,7 +23,7 @@
    * If [shouldAdd] is true, then we always add that [value] to the element. If
    * [shouldAdd] is false then we always remove [value] from the element.
    */
-  bool toggle(String value, [bool shouldAdd]) {
+  bool toggle(String value, [bool? shouldAdd]) {
     _validateToken(value);
     Set<String> s = readClasses();
     bool result = false;
@@ -91,14 +89,14 @@
    * This is the Dart equivalent of jQuery's
    * [hasClass](http://api.jquery.com/hasClass/).
    */
-  bool contains(Object value) {
+  bool contains(Object? value) {
     if (value is! String) return false;
     _validateToken(value);
     return readClasses().contains(value);
   }
 
   /** Lookup from the Set interface. Not interesting for a String set. */
-  String lookup(Object value) => contains(value) ? value : null;
+  String? lookup(Object? value) => contains(value) ? value as String : null;
 
   /**
    * Add the class [value] to element.
@@ -120,9 +118,9 @@
    * This is the Dart equivalent of jQuery's
    * [removeClass](http://api.jquery.com/removeClass/).
    */
-  bool remove(Object value) {
-    _validateToken(value);
+  bool remove(Object? value) {
     if (value is! String) return false;
+    _validateToken(value);
     Set<String> s = readClasses();
     bool result = s.remove(value);
     writeClasses(s);
@@ -146,7 +144,7 @@
    * This is the Dart equivalent of jQuery's
    * [removeClass](http://api.jquery.com/removeClass/).
    */
-  void removeAll(Iterable<Object> iterable) {
+  void removeAll(Iterable<Object?> iterable) {
     modify((s) => s.removeAll(iterable));
   }
 
@@ -160,11 +158,11 @@
    * element. If [shouldAdd] is false then we always remove all the classes in
    * [iterable] from the element.
    */
-  void toggleAll(Iterable<String> iterable, [bool shouldAdd]) {
+  void toggleAll(Iterable<String> iterable, [bool? shouldAdd]) {
     iterable.forEach((e) => toggle(e, shouldAdd));
   }
 
-  void retainAll(Iterable<Object> iterable) {
+  void retainAll(Iterable<Object?> iterable) {
     modify((s) => s.retainAll(iterable));
   }
 
@@ -176,15 +174,15 @@
     modify((s) => s.retainWhere(test));
   }
 
-  bool containsAll(Iterable<Object> collection) =>
+  bool containsAll(Iterable<Object?> collection) =>
       readClasses().containsAll(collection);
 
-  Set<String> intersection(Set<Object> other) =>
+  Set<String> intersection(Set<Object?> other) =>
       readClasses().intersection(other);
 
   Set<String> union(Set<String> other) => readClasses().union(other);
 
-  Set<String> difference(Set<Object> other) => readClasses().difference(other);
+  Set<String> difference(Set<Object?> other) => readClasses().difference(other);
 
   String get first => readClasses().first;
   String get last => readClasses().last;
@@ -198,11 +196,11 @@
   Iterable<String> skip(int n) => readClasses().skip(n);
   Iterable<String> skipWhile(bool test(String value)) =>
       readClasses().skipWhile(test);
-  String firstWhere(bool test(String value), {String orElse()}) =>
+  String firstWhere(bool test(String value), {String orElse()?}) =>
       readClasses().firstWhere(test, orElse: orElse);
-  String lastWhere(bool test(String value), {String orElse()}) =>
+  String lastWhere(bool test(String value), {String orElse()?}) =>
       readClasses().lastWhere(test, orElse: orElse);
-  String singleWhere(bool test(String value), {String orElse()}) =>
+  String singleWhere(bool test(String value), {String orElse()?}) =>
       readClasses().singleWhere(test, orElse: orElse);
   String elementAt(int index) => readClasses().elementAt(index);
 
diff --git a/sdk/lib/html/html_common/device.dart b/sdk/lib/html/html_common/device.dart
index d4d9ed5..57c37e6 100644
--- a/sdk/lib/html/html_common/device.dart
+++ b/sdk/lib/html/html_common/device.dart
@@ -2,21 +2,12 @@
 // 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.6
-
 part of html_common;
 
 /**
  * Utils for device detection.
  */
 class Device {
-  static bool _isOpera;
-  static bool _isIE;
-  static bool _isFirefox;
-  static bool _isWebKit;
-  static String _cachedCssPrefix;
-  static String _cachedPropertyPrefix;
-
   /**
    * Gets the browser's user agent. Using this function allows tests to inject
    * the user agent.
@@ -27,78 +18,33 @@
   /**
    * Determines if the current device is running Opera.
    */
-  static bool get isOpera {
-    if (_isOpera == null) {
-      _isOpera = userAgent.contains("Opera", 0);
-    }
-    return _isOpera;
-  }
+  static final bool isOpera = userAgent.contains("Opera", 0);
 
   /**
    * Determines if the current device is running Internet Explorer.
    */
-  static bool get isIE {
-    if (_isIE == null) {
-      _isIE = !isOpera && userAgent.contains("Trident/", 0);
-    }
-    return _isIE;
-  }
+  static final bool isIE = !isOpera && userAgent.contains("Trident/", 0);
 
   /**
    * Determines if the current device is running Firefox.
    */
-  static bool get isFirefox {
-    if (_isFirefox == null) {
-      _isFirefox = userAgent.contains("Firefox", 0);
-    }
-    return _isFirefox;
-  }
+  static final bool isFirefox = userAgent.contains("Firefox", 0);
 
   /**
    * Determines if the current device is running WebKit.
    */
-  static bool get isWebKit {
-    if (_isWebKit == null) {
-      _isWebKit = !isOpera && userAgent.contains("WebKit", 0);
-    }
-    return _isWebKit;
-  }
+  static final bool isWebKit = !isOpera && userAgent.contains("WebKit", 0);
 
   /**
    * Gets the CSS property prefix for the current platform.
    */
-  static String get cssPrefix {
-    String prefix = _cachedCssPrefix;
-    if (prefix != null) return prefix;
-    if (isFirefox) {
-      prefix = '-moz-';
-    } else if (isIE) {
-      prefix = '-ms-';
-    } else if (isOpera) {
-      prefix = '-o-';
-    } else {
-      prefix = '-webkit-';
-    }
-    return _cachedCssPrefix = prefix;
-  }
+  static final String cssPrefix = '-${propertyPrefix}-';
 
   /**
    * Prefix as used for JS property names.
    */
-  static String get propertyPrefix {
-    String prefix = _cachedPropertyPrefix;
-    if (prefix != null) return prefix;
-    if (isFirefox) {
-      prefix = 'moz';
-    } else if (isIE) {
-      prefix = 'ms';
-    } else if (isOpera) {
-      prefix = 'o';
-    } else {
-      prefix = 'webkit';
-    }
-    return _cachedPropertyPrefix = prefix;
-  }
+  static final String propertyPrefix =
+      isFirefox ? 'moz' : (isIE ? 'ms' : (isOpera ? 'o' : 'webkit'));
 
   /**
    * Checks to see if the event class is supported by the current platform.
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 35e01cb..8bedca4 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.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.6
-
 part of html_common;
 
 /**
@@ -64,7 +62,7 @@
     }
   }
 
-  bool contains(Object needle) {
+  bool contains(Object? needle) {
     if (needle is! Element) return false;
     Element element = needle;
     return element.parentNode == _node;
@@ -72,7 +70,7 @@
 
   Iterable<Element> get reversed => _filtered.reversed;
 
-  void sort([int compare(Element a, Element b)]) {
+  void sort([int compare(Element a, Element b)?]) {
     throw new UnsupportedError('Cannot sort filtered list');
   }
 
@@ -81,7 +79,7 @@
     throw new UnsupportedError('Cannot setRange on filtered list');
   }
 
-  void fillRange(int start, int end, [Element fillValue]) {
+  void fillRange(int start, int end, [Element? fillValue]) {
     throw new UnsupportedError('Cannot fillRange on filtered list');
   }
 
@@ -113,7 +111,7 @@
       add(value);
     } else {
       var element = _iterable.elementAt(index);
-      element.parentNode.insertBefore(value, element);
+      element.parentNode!.insertBefore(value, element);
     }
   }
 
@@ -122,7 +120,7 @@
       addAll(iterable);
     } else {
       var element = _iterable.elementAt(index);
-      element.parentNode.insertAllBefore(iterable, element);
+      element.parentNode!.insertAllBefore(iterable, element);
     }
   }
 
@@ -132,7 +130,7 @@
     return result;
   }
 
-  bool remove(Object element) {
+  bool remove(Object? element) {
     if (element is! Element) return false;
     if (contains(element)) {
       (element as Element).remove(); // Placate the type checker
diff --git a/sdk/lib/html/html_common/html_common.dart b/sdk/lib/html/html_common/html_common.dart
index aab2cef..1fb9d52 100644
--- a/sdk/lib/html/html_common/html_common.dart
+++ b/sdk/lib/html/html_common/html_common.dart
@@ -1,8 +1,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.6
-
 library html_common;
 
 import 'dart:async';
diff --git a/sdk/lib/html/html_common/html_common_dart2js.dart b/sdk/lib/html/html_common/html_common_dart2js.dart
index da4e210..3df2ccf 100644
--- a/sdk/lib/html/html_common/html_common_dart2js.dart
+++ b/sdk/lib/html/html_common/html_common_dart2js.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.6
-
 library html_common;
 
 import 'dart:async';
diff --git a/sdk/lib/html/html_common/lists.dart b/sdk/lib/html/html_common/lists.dart
index 83d65b7..c7abc41 100644
--- a/sdk/lib/html/html_common/lists.dart
+++ b/sdk/lib/html/html_common/lists.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.6
-
 part of html_common;
 
 class Lists {
diff --git a/sdk/lib/html/html_common/metadata.dart b/sdk/lib/html/html_common/metadata.dart
index 991d99f..8e2f616 100644
--- a/sdk/lib/html/html_common/metadata.dart
+++ b/sdk/lib/html/html_common/metadata.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.6
-
 library metadata;
 
 /**
@@ -25,7 +23,7 @@
 
   /// The minimum version of the browser that supports the feature, or null
   /// if supported on all versions.
-  final String minimumVersion;
+  final String? minimumVersion;
 
   const SupportedBrowser(this.browserName, [this.minimumVersion]);
 }
diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
index 08bc19b..4cb159b 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -1,5 +1,3 @@
-// @dart = 2.6
-
 /**
  * A client-side key-value store with support for indexes.
  *
@@ -233,7 +231,7 @@
   }
 
   @JSName('continue')
-  void next([Object key]) {
+  void next([Object? key]) {
     if (key == null) {
       JS('void', '#.continue()', this);
     } else {
@@ -250,15 +248,15 @@
 
   @_annotation_Creates_IDBKey
   @_annotation_Returns_IDBKey
-  Object get key native;
+  Object? get key native;
 
   @_annotation_Creates_IDBKey
   @_annotation_Returns_IDBKey
-  Object get primaryKey native;
+  Object? get primaryKey native;
 
   @Creates('Null')
   @Returns('ObjectStore|Index|Null')
-  Object get source native;
+  Object? get source native;
 
   void advance(int count) native;
 
@@ -307,7 +305,7 @@
 @Unstable()
 @Native("IDBDatabase")
 class Database extends EventTarget {
-  ObjectStore createObjectStore(String name, {keyPath, bool autoIncrement}) {
+  ObjectStore createObjectStore(String name, {keyPath, bool? autoIncrement}) {
     var options = {};
     if (keyPath != null) {
       options['keyPath'] = keyPath;
@@ -404,7 +402,7 @@
 
   String get name native;
 
-  @Returns('DomStringList|Null')
+  @Returns('DomStringList')
   @Creates('DomStringList')
   List<String> get objectStoreNames native;
 
@@ -414,7 +412,7 @@
 
   void close() native;
 
-  ObjectStore _createObjectStore(String name, [Map options]) {
+  ObjectStore _createObjectStore(String name, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return _createObjectStore_1(name, options_1);
@@ -471,9 +469,9 @@
   }
 
   Future<Database> open(String name,
-      {int version,
-      void onUpgradeNeeded(VersionChangeEvent event),
-      void onBlocked(Event event)}) {
+      {int? version,
+      void onUpgradeNeeded(VersionChangeEvent event)?,
+      void onBlocked(Event event)?}) {
     if ((version == null) != (onUpgradeNeeded == null)) {
       return new Future.error(new ArgumentError(
           'version and onUpgradeNeeded must be specified together'));
@@ -498,7 +496,7 @@
     }
   }
 
-  Future<IdbFactory> deleteDatabase(String name, {void onBlocked(Event e)}) {
+  Future<IdbFactory> deleteDatabase(String name, {void onBlocked(Event e)?}) {
     try {
       var request = _deleteDatabase(name);
 
@@ -540,7 +538,7 @@
   @Returns('Request')
   @Creates('Request')
   @Creates('Database')
-  OpenDBRequest _open(String name, [int version]) native;
+  OpenDBRequest _open(String name, [int? version]) native;
 }
 
 /**
@@ -602,7 +600,7 @@
    * * [ObjectStore.openCursor]
    */
   Stream<CursorWithValue> openCursor(
-      {key, KeyRange range, String direction, bool autoAdvance}) {
+      {key, KeyRange? range, String? direction, bool? autoAdvance}) {
     var key_OR_range = null;
     if (key != null) {
       if (range != null) {
@@ -630,7 +628,7 @@
    * * [ObjectStore.openCursor]
    */
   Stream<Cursor> openKeyCursor(
-      {key, KeyRange range, String direction, bool autoAdvance}) {
+      {key, KeyRange? range, String? direction, bool? autoAdvance}) {
     var key_OR_range = null;
     if (key != null) {
       if (range != null) {
@@ -656,7 +654,7 @@
   }
 
   @annotation_Creates_SerializedScriptValue
-  Object get keyPath native;
+  Object? get keyPath native;
 
   bool get multiEntry native;
 
@@ -669,7 +667,7 @@
   bool get unique native;
 
   @JSName('count')
-  Request _count(Object key) native;
+  Request _count(Object? key) native;
 
   @JSName('get')
   @Returns('Request')
@@ -677,9 +675,9 @@
   @annotation_Creates_SerializedScriptValue
   Request _get(Object key) native;
 
-  Request getAll(Object query, [int count]) native;
+  Request getAll(Object? query, [int? count]) native;
 
-  Request getAllKeys(Object query, [int count]) native;
+  Request getAllKeys(Object? query, [int? count]) native;
 
   @JSName('getKey')
   @Returns('Request')
@@ -692,13 +690,13 @@
   @Returns('Request')
   @Creates('Request')
   @Creates('Cursor')
-  Request _openCursor(Object range, [String direction]) native;
+  Request _openCursor(Object? range, [String? direction]) native;
 
   @JSName('openKeyCursor')
   @Returns('Request')
   @Creates('Request')
   @Creates('Cursor')
-  Request _openKeyCursor(Object range, [String direction]) native;
+  Request _openKeyCursor(Object? range, [String? direction]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -727,29 +725,29 @@
   }
 
   @annotation_Creates_SerializedScriptValue
-  Object get lower native;
+  Object? get lower native;
 
   bool get lowerOpen native;
 
   @annotation_Creates_SerializedScriptValue
-  Object get upper native;
+  Object? get upper native;
 
   bool get upperOpen native;
 
   @JSName('bound')
   static KeyRange bound_(Object lower, Object upper,
-      [bool lowerOpen, bool upperOpen]) native;
+      [bool? lowerOpen, bool? upperOpen]) native;
 
   bool includes(Object key) native;
 
   @JSName('lowerBound')
-  static KeyRange lowerBound_(Object bound, [bool open]) native;
+  static KeyRange lowerBound_(Object bound, [bool? open]) native;
 
   @JSName('only')
   static KeyRange only_(Object value) native;
 
   @JSName('upperBound')
-  static KeyRange upperBound_(Object bound, [bool open]) native;
+  static KeyRange upperBound_(Object bound, [bool? open]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -843,7 +841,7 @@
    * the current transaction.
    */
   Stream<CursorWithValue> openCursor(
-      {key, KeyRange range, String direction, bool autoAdvance}) {
+      {key, KeyRange? range, String? direction, bool? autoAdvance}) {
     var key_OR_range = null;
     if (key != null) {
       if (range != null) {
@@ -864,7 +862,7 @@
     return _cursorStreamFromResult(request, autoAdvance);
   }
 
-  Index createIndex(String name, keyPath, {bool unique, bool multiEntry}) {
+  Index createIndex(String name, keyPath, {bool? unique, bool? multiEntry}) {
     var options = {};
     if (unique != null) {
       options['unique'] = unique;
@@ -883,12 +881,12 @@
 
   bool get autoIncrement native;
 
-  @Returns('DomStringList|Null')
+  @Returns('DomStringList')
   @Creates('DomStringList')
   List<String> get indexNames native;
 
   @annotation_Creates_SerializedScriptValue
-  Object get keyPath native;
+  Object? get keyPath native;
 
   String get name native;
 
@@ -924,9 +922,9 @@
   Request _clear() native;
 
   @JSName('count')
-  Request _count(Object key) native;
+  Request _count(Object? key) native;
 
-  Index _createIndex(String name, Object keyPath, [Map options]) {
+  Index _createIndex(String name, Object keyPath, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return _createIndex_1(name, keyPath, options_1);
@@ -950,9 +948,9 @@
   @annotation_Creates_SerializedScriptValue
   Request _get(Object key) native;
 
-  Request getAll(Object query, [int count]) native;
+  Request getAll(Object? query, [int? count]) native;
 
-  Request getAllKeys(Object query, [int count]) native;
+  Request getAllKeys(Object? query, [int? count]) native;
 
   Request getKey(Object key) native;
 
@@ -962,9 +960,9 @@
   @Returns('Request')
   @Creates('Request')
   @Creates('Cursor')
-  Request _openCursor(Object range, [String direction]) native;
+  Request _openCursor(Object? range, [String? direction]) native;
 
-  Request openKeyCursor(Object range, [String direction]) native;
+  Request openKeyCursor(Object? range, [String? direction]) native;
 
   @Returns('Request')
   @Creates('Request')
@@ -994,7 +992,7 @@
    * Helper for iterating over cursors in a request.
    */
   static Stream<T> _cursorStreamFromResult<T extends Cursor>(
-      Request request, bool autoAdvance) {
+      Request request, bool? autoAdvance) {
     // TODO: need to guarantee that the controller provides the values
     // immediately as waiting until the next tick will cause the transaction to
     // close.
@@ -1004,7 +1002,7 @@
     request.onError.listen(controller.addError);
 
     request.onSuccess.listen((e) {
-      T cursor = request.result as dynamic;
+      T? cursor = request.result as dynamic;
       if (cursor == null) {
         controller.close();
       } else {
@@ -1028,11 +1026,11 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Object get key native;
+  Object? get key native;
 
   String get type native;
 
-  Object get value native;
+  Object? get value native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1076,7 +1074,7 @@
 
   Database get database native;
 
-  Object get records native;
+  Object? get records native;
 
   Transaction get transaction native;
 }
@@ -1157,7 +1155,7 @@
   dynamic get _get_result native;
 
   @Creates('Null')
-  Object get source native;
+  Object? get source native;
 
   Transaction get transaction native;
 
@@ -1240,7 +1238,7 @@
 
   String get mode native;
 
-  @Returns('DomStringList|Null')
+  @Returns('DomStringList')
   @Creates('DomStringList')
   List<String> get objectStoreNames native;
 
@@ -1269,7 +1267,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory VersionChangeEvent(String type, [Map eventInitDict]) {
+  factory VersionChangeEvent(String type, [Map? eventInitDict]) {
     if (eventInitDict != null) {
       var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
       return VersionChangeEvent._create_1(type, eventInitDict_1);
@@ -1290,7 +1288,7 @@
 
   @Creates('int|String|Null')
   @Returns('int|String|Null')
-  int get newVersion native;
+  int? get newVersion native;
 
   @Creates('int|String|Null')
   @Returns('int|String|Null')
diff --git a/sdk/lib/internal/async_cast.dart b/sdk/lib/internal/async_cast.dart
index aa3e375..306ada8 100644
--- a/sdk/lib/internal/async_cast.dart
+++ b/sdk/lib/internal/async_cast.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.6
-
 part of dart._internal;
 
 // Casting wrappers for asynchronous classes.
@@ -13,8 +11,8 @@
   CastStream(this._source);
   bool get isBroadcast => _source.isBroadcast;
 
-  StreamSubscription<T> listen(void onData(T data),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<T> listen(void Function(T data)? onData,
+      {Function? onError, void Function()? onDone, bool? cancelOnError}) {
     return new CastStreamSubscription<S, T>(
         _source.listen(null, onDone: onDone, cancelOnError: cancelOnError))
       ..onData(onData)
@@ -30,12 +28,11 @@
   /// Zone where listen was called.
   final Zone _zone = Zone.current;
 
-  /// User's data handler. May be null.
-  void Function(T) _handleData;
+  /// User's data handler.
+  void Function(T)? _handleData;
 
   /// Copy of _source's handleError so we can report errors in onData.
-  /// May be null.
-  Function _handleError;
+  Function? _handleError;
 
   CastStreamSubscription(this._source) {
     _source.onData(_onData);
@@ -43,25 +40,28 @@
 
   Future cancel() => _source.cancel();
 
-  void onData(void handleData(T data)) {
+  void onData(void Function(T data)? handleData) {
     _handleData = handleData == null
         ? null
         : _zone.registerUnaryCallback<dynamic, T>(handleData);
   }
 
-  void onError(Function handleError) {
+  void onError(Function? handleError) {
     _source.onError(handleError);
     if (handleError == null) {
       _handleError = null;
-    } else if (handleError is Function(Null, Null)) {
+    } else if (handleError is void Function(Object, StackTrace)) {
       _handleError = _zone
           .registerBinaryCallback<dynamic, Object, StackTrace>(handleError);
-    } else {
+    } else if (handleError is void Function(Object)) {
       _handleError = _zone.registerUnaryCallback<dynamic, Object>(handleError);
+    } else {
+      throw ArgumentError("handleError callback must take either an Object "
+          "(the error), or both an Object (the error) and a StackTrace.");
     }
   }
 
-  void onDone(void handleDone()) {
+  void onDone(void handleDone()?) {
     _source.onDone(handleDone);
   }
 
@@ -71,19 +71,21 @@
     try {
       targetData = data as T;
     } catch (error, stack) {
-      if (_handleError == null) {
+      var handleError = _handleError;
+      if (handleError == null) {
         _zone.handleUncaughtError(error, stack);
-      } else if (_handleError is Function(Null, Null)) {
-        _zone.runBinaryGuarded(_handleError, error, stack);
+      } else if (handleError is void Function(Object, StackTrace)) {
+        _zone.runBinaryGuarded<Object, StackTrace>(handleError, error, stack);
       } else {
-        _zone.runUnaryGuarded(_handleError, error);
+        _zone.runUnaryGuarded<Object>(
+            handleError as void Function(Object), error);
       }
       return;
     }
-    _zone.runUnaryGuarded(_handleData, targetData);
+    _zone.runUnaryGuarded(_handleData!, targetData);
   }
 
-  void pause([Future resumeSignal]) {
+  void pause([Future? resumeSignal]) {
     _source.pause(resumeSignal);
   }
 
@@ -93,7 +95,7 @@
 
   bool get isPaused => _source.isPaused;
 
-  Future<E> asFuture<E>([E futureValue]) => _source.asFuture<E>(futureValue);
+  Future<E> asFuture<E>([E? futureValue]) => _source.asFuture<E>(futureValue);
 }
 
 class CastStreamTransformer<SS, ST, TS, TT>
diff --git a/sdk/lib/internal/cast.dart b/sdk/lib/internal/cast.dart
index f019c95..d99b687 100644
--- a/sdk/lib/internal/cast.dart
+++ b/sdk/lib/internal/cast.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.6
-
 part of dart._internal;
 
 // Casting wrappers for collection classes.
@@ -46,11 +44,11 @@
   T get last => _source.last as T;
   T get single => _source.single as T;
 
-  bool contains(Object other) => _source.contains(other);
+  bool contains(Object? other) => _source.contains(other);
 
   // Might be implemented by testing backwards from the end,
   // so use the _source's implementation.
-  T lastWhere(bool test(T element), {T orElse()}) =>
+  T lastWhere(bool test(T element), {T Function()? orElse}) =>
       _source.lastWhere((S element) => test(element as T),
           orElse: (orElse == null) ? null : () => orElse() as S) as T;
 
@@ -116,12 +114,12 @@
     _source.addAll(new CastIterable<T, S>(values));
   }
 
-  void sort([int compare(T v1, T v2)]) {
+  void sort([int Function(T v1, T v2)? compare]) {
     _source.sort(
         compare == null ? null : (S v1, S v2) => compare(v1 as T, v2 as T));
   }
 
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     _source.shuffle(random);
   }
 
@@ -137,7 +135,7 @@
     _source.setAll(index, new CastIterable<T, S>(elements));
   }
 
-  bool remove(Object value) => _source.remove(value);
+  bool remove(Object? value) => _source.remove(value);
 
   T removeAt(int index) => _source.removeAt(index) as T;
 
@@ -162,7 +160,7 @@
     _source.removeRange(start, end);
   }
 
-  void fillRange(int start, int end, [T fillValue]) {
+  void fillRange(int start, int end, [T? fillValue]) {
     _source.fillRange(start, end, fillValue as S);
   }
 
@@ -184,7 +182,7 @@
   /// Creates a new empty set of the same *kind* as [_source],
   /// but with `<R>` as type argument.
   /// Used by [toSet] and [union].
-  final Set<R> Function<R>() _emptySet;
+  final Set<R> Function<R>()? _emptySet;
 
   CastSet(this._source, this._emptySet);
 
@@ -197,13 +195,13 @@
     _source.addAll(new CastIterable<T, S>(elements));
   }
 
-  bool remove(Object object) => _source.remove(object);
+  bool remove(Object? object) => _source.remove(object);
 
-  void removeAll(Iterable<Object> objects) {
+  void removeAll(Iterable<Object?> objects) {
     _source.removeAll(objects);
   }
 
-  void retainAll(Iterable<Object> objects) {
+  void retainAll(Iterable<Object?> objects) {
     _source.retainAll(objects);
   }
 
@@ -215,20 +213,21 @@
     _source.retainWhere((S element) => test(element as T));
   }
 
-  bool containsAll(Iterable<Object> objects) => _source.containsAll(objects);
+  bool containsAll(Iterable<Object?> objects) => _source.containsAll(objects);
 
-  Set<T> intersection(Set<Object> other) {
+  Set<T> intersection(Set<Object?> other) {
     if (_emptySet != null) return _conditionalAdd(other, true);
     return new CastSet<S, T>(_source.intersection(other), null);
   }
 
-  Set<T> difference(Set<Object> other) {
+  Set<T> difference(Set<Object?> other) {
     if (_emptySet != null) return _conditionalAdd(other, false);
     return new CastSet<S, T>(_source.difference(other), null);
   }
 
-  Set<T> _conditionalAdd(Set<Object> other, bool otherContains) {
-    Set<T> result = (_emptySet == null) ? new Set<T>() : _emptySet<T>();
+  Set<T> _conditionalAdd(Set<Object?> other, bool otherContains) {
+    var emptySet = _emptySet;
+    Set<T> result = (emptySet == null) ? new Set<T>() : emptySet<T>();
     for (var element in _source) {
       T castElement = element as T;
       if (otherContains == other.contains(castElement)) result.add(castElement);
@@ -243,14 +242,15 @@
   }
 
   Set<T> _clone() {
-    Set<T> result = (_emptySet == null) ? new Set<T>() : _emptySet<T>();
+    var emptySet = _emptySet;
+    Set<T> result = (emptySet == null) ? new Set<T>() : emptySet<T>();
     result.addAll(this);
     return result;
   }
 
   Set<T> toSet() => _clone();
 
-  T lookup(Object key) => _source.lookup(key) as T;
+  T lookup(Object? key) => _source.lookup(key) as T;
 }
 
 class CastMap<SK, SV, K, V> extends MapBase<K, V> {
@@ -260,24 +260,24 @@
 
   Map<RK, RV> cast<RK, RV>() => new CastMap<SK, SV, RK, RV>(_source);
 
-  bool containsValue(Object value) => _source.containsValue(value);
+  bool containsValue(Object? value) => _source.containsValue(value);
 
-  bool containsKey(Object key) => _source.containsKey(key);
+  bool containsKey(Object? key) => _source.containsKey(key);
 
-  V operator [](Object key) => _source[key] as V;
+  V? operator [](Object? key) => _source[key] as V?;
 
   void operator []=(K key, V value) {
     _source[key as SK] = value as SV;
   }
 
-  V putIfAbsent(K key, V ifAbsent()) => _source.putIfAbsent(
-      key as SK, (ifAbsent == null) ? null : () => ifAbsent() as SV) as V;
+  V putIfAbsent(K key, V Function() ifAbsent) =>
+      _source.putIfAbsent(key as SK, () => ifAbsent() as SV) as V;
 
   void addAll(Map<K, V> other) {
     _source.addAll(new CastMap<K, V, SK, SV>(other));
   }
 
-  V remove(Object key) => _source.remove(key) as V;
+  V remove(Object? key) => _source.remove(key) as V;
 
   void clear() {
     _source.clear();
@@ -299,7 +299,7 @@
 
   bool get isNotEmpty => _source.isNotEmpty;
 
-  V update(K key, V update(V value), {V ifAbsent()}) {
+  V update(K key, V update(V value), {V Function()? ifAbsent}) {
     return _source.update(key as SK, (SV value) => update(value as V) as SV,
         ifAbsent: (ifAbsent == null) ? null : () => ifAbsent() as SV) as V;
   }
@@ -344,7 +344,7 @@
     _source.addLast(value as S);
   }
 
-  bool remove(Object other) => _source.remove(other);
+  bool remove(Object? other) => _source.remove(other);
   void addAll(Iterable<T> elements) {
     _source.addAll(new CastIterable<T, S>(elements));
   }
diff --git a/sdk/lib/internal/errors.dart b/sdk/lib/internal/errors.dart
index f88b413..9010622 100644
--- a/sdk/lib/internal/errors.dart
+++ b/sdk/lib/internal/errors.dart
@@ -2,13 +2,11 @@
 // 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.6
-
 part of dart._internal;
 
 class LateInitializationErrorImpl extends Error
     implements LateInitializationError {
-  final String _message;
+  final String? _message;
 
   LateInitializationErrorImpl([this._message]);
 
diff --git a/sdk/lib/internal/internal.dart b/sdk/lib/internal/internal.dart
index d044b03..dad3b05 100644
--- a/sdk/lib/internal/internal.dart
+++ b/sdk/lib/internal/internal.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.6
-
 library dart._internal;
 
 import 'dart:collection';
@@ -18,7 +16,7 @@
         Zone;
 import 'dart:convert' show Converter;
 import 'dart:core' hide Symbol;
-import 'dart:core' as core;
+import 'dart:core' as core show Symbol;
 import 'dart:math' show Random;
 import 'dart:typed_data' show Uint8List;
 
@@ -32,6 +30,10 @@
 part 'sort.dart';
 part 'symbol.dart';
 
+// Returns true iff `null as T` will succeed based on the
+// execution mode.
+external bool typeAcceptsNull<T>();
+
 // Powers of 10 up to 10^22 are representable as doubles.
 // Powers of 10 above that are only approximate due to lack of precission.
 // Used by double-parsing.
@@ -167,7 +169,7 @@
 ///
 /// See this issue for more context:
 /// https://github.com/dart-lang/sdk/issues/31371
-external Object extractTypeArguments<T>(T instance, Function extract);
+external Object? extractTypeArguments<T>(T instance, Function extract);
 
 /// Annotation class marking the version where SDK API was added.
 ///
@@ -207,6 +209,49 @@
   const Since(this.version);
 }
 
+/// A null-check function for function parameters in Null Safety enabled code.
+///
+/// Because Dart does not have full null safety
+/// until all legacy code has been removed from a program,
+/// a non-nullable parameter can still end up with a `null` value.
+/// This function can be used to guard those functions against null arguments.
+/// It throws a [TypeError] because we are really seeing the failure to
+/// assign `null` to a non-nullable type.
+///
+/// See http://dartbug.com/40614 for context.
+T checkNotNullable<T extends Object>(T value, String name) {
+  if ((value as dynamic) == null) {
+    throw NotNullableError<T>(name);
+  }
+  return value;
+}
+
+/// A [TypeError] thrown by [checkNotNullable].
+class NotNullableError<T> extends Error implements TypeError {
+  final String _name;
+  NotNullableError(this._name);
+  String toString() =>
+      "Null is not a valid value for the parameter '$_name' of type '$T'";
+}
+
+/// A function that returns the value or default value (if invoked with `null`
+/// value) for non-nullable function parameters in Null safety enabled code.
+///
+/// Because Dart does not have full null safety
+/// until all legacy code has been removed from a program,
+/// a non-nullable parameter can still end up with a `null` value.
+/// This function can be used to get a default value for a parameter
+/// when a `null` value is passed in for a non-nullable parameter.
+///
+/// TODO(40810) - Remove uses of this function when Dart has full null safety.
+T valueOfNonNullableParamWithDefault<T extends Object>(T value, T defaultVal) {
+  if ((value as dynamic) == null) {
+    return defaultVal;
+  } else {
+    return value;
+  }
+}
+
 /**
  * HTTP status codes.  Exported in dart:io and dart:html.
  */
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index 8f28b5f..2817132 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.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.6
-
 part of dart._internal;
 
 /**
@@ -63,7 +61,7 @@
     return elementAt(0);
   }
 
-  bool contains(Object element) {
+  bool contains(Object? element) {
     int length = this.length;
     for (int i = 0; i < length; i++) {
       if (elementAt(i) == element) return true;
@@ -96,7 +94,7 @@
     return false;
   }
 
-  E firstWhere(bool test(E element), {E orElse()}) {
+  E firstWhere(bool test(E element), {E Function()? orElse}) {
     int length = this.length;
     for (int i = 0; i < length; i++) {
       E element = elementAt(i);
@@ -109,7 +107,7 @@
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E element), {E orElse()}) {
+  E lastWhere(bool test(E element), {E Function()? orElse}) {
     int length = this.length;
     for (int i = length - 1; i >= 0; i--) {
       E element = elementAt(i);
@@ -122,9 +120,9 @@
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E element), {E orElse()}) {
+  E singleWhere(bool test(E element), {E Function()? orElse}) {
     int length = this.length;
-    E match = null;
+    late E match;
     bool matchFound = false;
     for (int i = 0; i < length; i++) {
       E element = elementAt(i);
@@ -210,18 +208,7 @@
 
   Iterable<E> takeWhile(bool test(E element)) => super.takeWhile(test);
 
-  List<E> toList({bool growable: true}) {
-    List<E> result;
-    if (growable) {
-      result = <E>[]..length = length;
-    } else {
-      result = new List<E>(length);
-    }
-    for (int i = 0; i < length; i++) {
-      result[i] = elementAt(i);
-    }
-    return result;
-  }
+  List<E> toList({bool growable: true}) => List<E>.of(this, growable: growable);
 
   Set<E> toSet() {
     Set<E> result = new Set<E>();
@@ -236,22 +223,24 @@
   final Iterable<E> _iterable; // Has efficient length and elementAt.
   final int _start;
   /** If null, represents the length of the iterable. */
-  final int _endOrLength;
+  final int? _endOrLength;
 
   SubListIterable(this._iterable, this._start, this._endOrLength) {
     RangeError.checkNotNegative(_start, "start");
-    if (_endOrLength != null) {
-      RangeError.checkNotNegative(_endOrLength, "end");
-      if (_start > _endOrLength) {
-        throw new RangeError.range(_start, 0, _endOrLength, "start");
+    int? endOrLength = _endOrLength;
+    if (endOrLength != null) {
+      RangeError.checkNotNegative(endOrLength, "end");
+      if (_start > endOrLength) {
+        throw new RangeError.range(_start, 0, endOrLength, "start");
       }
     }
   }
 
   int get _endIndex {
     int length = _iterable.length;
-    if (_endOrLength == null || _endOrLength > length) return length;
-    return _endOrLength;
+    int? endOrLength = _endOrLength;
+    if (endOrLength == null || endOrLength > length) return length;
+    return endOrLength;
   }
 
   int get _startIndex {
@@ -263,10 +252,11 @@
   int get length {
     int length = _iterable.length;
     if (_start >= length) return 0;
-    if (_endOrLength == null || _endOrLength >= length) {
+    int? endOrLength = _endOrLength;
+    if (endOrLength == null || endOrLength >= length) {
       return length - _start;
     }
-    return _endOrLength - _start;
+    return endOrLength - _start;
   }
 
   E elementAt(int index) {
@@ -280,7 +270,8 @@
   Iterable<E> skip(int count) {
     RangeError.checkNotNegative(count, "count");
     int newStart = _start + count;
-    if (_endOrLength != null && newStart >= _endOrLength) {
+    int? endOrLength = _endOrLength;
+    if (endOrLength != null && newStart >= endOrLength) {
       return new EmptyIterable<E>();
     }
     return new SubListIterable<E>(_iterable, newStart, _endOrLength);
@@ -288,11 +279,12 @@
 
   Iterable<E> take(int count) {
     RangeError.checkNotNegative(count, "count");
-    if (_endOrLength == null) {
+    int? endOrLength = _endOrLength;
+    if (endOrLength == null) {
       return new SubListIterable<E>(_iterable, _start, _start + count);
     } else {
       int newEnd = _start + count;
-      if (_endOrLength < newEnd) return this;
+      if (endOrLength < newEnd) return this;
       return new SubListIterable<E>(_iterable, _start, newEnd);
     }
   }
@@ -300,12 +292,14 @@
   List<E> toList({bool growable: true}) {
     int start = _start;
     int end = _iterable.length;
-    if (_endOrLength != null && _endOrLength < end) end = _endOrLength;
+    int? endOrLength = _endOrLength;
+    if (endOrLength != null && endOrLength < end) end = endOrLength;
     int length = end - start;
-    if (length < 0) length = 0;
+    if (length <= 0) return List<E>.empty(growable: growable);
+
     List<E> result =
-        growable ? (new List<E>()..length = length) : new List<E>(length);
-    for (int i = 0; i < length; i++) {
+        List<E>.filled(length, _iterable.elementAt(start), growable: growable);
+    for (int i = 1; i < length; i++) {
       result[i] = _iterable.elementAt(start + i);
       if (_iterable.length < end) throw new ConcurrentModificationError(this);
     }
@@ -324,14 +318,17 @@
   final Iterable<E> _iterable;
   final int _length;
   int _index;
-  E _current;
+  E? _current;
 
   ListIterator(Iterable<E> iterable)
       : _iterable = iterable,
         _length = iterable.length,
         _index = 0;
 
-  E get current => _current;
+  E get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as E;
+  }
 
   @pragma("vm:prefer-inline")
   bool moveNext() {
@@ -384,7 +381,7 @@
 }
 
 class MappedIterator<S, T> extends Iterator<T> {
-  T _current;
+  T? _current;
   final Iterator<S> _iterator;
   final _Transformation<S, T> _f;
 
@@ -399,7 +396,10 @@
     return false;
   }
 
-  T get current => _current;
+  T get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as T;
+  }
 }
 
 /**
@@ -466,16 +466,19 @@
   // Initialize _currentExpansion to an empty iterable. A null value
   // marks the end of iteration, and we don't want to call _f before
   // the first moveNext call.
-  Iterator<T> _currentExpansion = const EmptyIterator();
-  T _current;
+  Iterator<T>? _currentExpansion = const EmptyIterator<Never>();
+  T? _current;
 
   ExpandIterator(this._iterator, this._f);
 
-  T get current => _current;
+  T get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as T;
+  }
 
   bool moveNext() {
     if (_currentExpansion == null) return false;
-    while (!_currentExpansion.moveNext()) {
+    while (!_currentExpansion!.moveNext()) {
       _current = null;
       if (_iterator.moveNext()) {
         // If _f throws, this ends iteration. Otherwise _currentExpansion and
@@ -486,7 +489,7 @@
         return false;
       }
     }
-    _current = _currentExpansion.current;
+    _current = _currentExpansion!.current;
     return true;
   }
 }
@@ -541,7 +544,11 @@
   }
 
   E get current {
-    if (_remaining < 0) return null;
+    // Before NNBD, this returned null when iteration was complete. In order to
+    // avoid a hard breaking change, we return "null as E" in that case so that
+    // if strong checking is not enabled or E is nullable, the existing
+    // behavior is preserved.
+    if (_remaining < 0) return null as E;
     return _iterator.current;
   }
 }
@@ -574,7 +581,7 @@
   }
 
   E get current {
-    if (_isFinished) return null;
+    if (_isFinished) return null as E;
     return _iterator.current;
   }
 }
@@ -682,7 +689,7 @@
 class EmptyIterable<E> extends EfficientLengthIterable<E> {
   const EmptyIterable();
 
-  Iterator<E> get iterator => const EmptyIterator();
+  Iterator<E> get iterator => const EmptyIterator<Never>();
 
   void forEach(void action(E element)) {}
 
@@ -706,23 +713,23 @@
     throw new RangeError.range(index, 0, 0, "index");
   }
 
-  bool contains(Object element) => false;
+  bool contains(Object? element) => false;
 
   bool every(bool test(E element)) => true;
 
   bool any(bool test(E element)) => false;
 
-  E firstWhere(bool test(E element), {E orElse()}) {
+  E firstWhere(bool test(E element), {E Function()? orElse}) {
     if (orElse != null) return orElse();
     throw IterableElementError.noElement();
   }
 
-  E lastWhere(bool test(E element), {E orElse()}) {
+  E lastWhere(bool test(E element), {E Function()? orElse}) {
     if (orElse != null) return orElse();
     throw IterableElementError.noElement();
   }
 
-  E singleWhere(bool test(E element), {E orElse()}) {
+  E singleWhere(bool test(E element), {E Function()? orElse}) {
     if (orElse != null) return orElse();
     throw IterableElementError.noElement();
   }
@@ -755,7 +762,7 @@
 
   Iterable<E> takeWhile(bool test(E element)) => this;
 
-  List<E> toList({bool growable: true}) => growable ? <E>[] : new List<E>(0);
+  List<E> toList({bool growable: true}) => List<E>.empty(growable: growable);
 
   Set<E> toSet() => new Set<E>();
 }
@@ -764,7 +771,9 @@
 class EmptyIterator<E> implements Iterator<E> {
   const EmptyIterator();
   bool moveNext() => false;
-  E get current => null;
+  E get current {
+    throw IterableElementError.noElement();
+  }
 }
 
 class FollowedByIterable<E> extends Iterable<E> {
@@ -787,7 +796,7 @@
   bool get isNotEmpty => _first.isNotEmpty || _second.isNotEmpty;
 
   // May be more efficient if either iterable is a Set.
-  bool contains(Object value) =>
+  bool contains(Object? value) =>
       _first.contains(value) || _second.contains(value);
 
   E get first {
@@ -816,20 +825,6 @@
       EfficientLengthIterable<E> first, EfficientLengthIterable<E> second)
       : super(first, second);
 
-  Iterable<E> skip(int count) {
-    int firstLength = _first.length;
-    if (count >= firstLength) return _second.skip(count - firstLength);
-    return new EfficientLengthFollowedByIterable<E>(
-        _first.skip(count), _second);
-  }
-
-  Iterable<E> take(int count) {
-    int firstLength = _first.length;
-    if (count <= firstLength) return _first.take(count);
-    return new EfficientLengthFollowedByIterable<E>(
-        _first, _second.take(count - firstLength));
-  }
-
   E elementAt(int index) {
     int firstLength = _first.length;
     if (index < firstLength) return _first.elementAt(index);
@@ -849,7 +844,7 @@
 
 class FollowedByIterator<E> implements Iterator<E> {
   Iterator<E> _currentIterator;
-  Iterable<E> _nextIterable;
+  Iterable<E>? _nextIterable;
 
   FollowedByIterator(Iterable<E> first, this._nextIterable)
       : _currentIterator = first.iterator;
@@ -857,7 +852,7 @@
   bool moveNext() {
     if (_currentIterator.moveNext()) return true;
     if (_nextIterable != null) {
-      _currentIterator = _nextIterable.iterator;
+      _currentIterator = _nextIterable!.iterator;
       _nextIterable = null;
       return _currentIterator.moveNext();
     }
@@ -868,13 +863,13 @@
 }
 
 class WhereTypeIterable<T> extends Iterable<T> {
-  final Iterable<Object> _source;
+  final Iterable<Object?> _source;
   WhereTypeIterable(this._source);
   Iterator<T> get iterator => new WhereTypeIterator<T>(_source.iterator);
 }
 
 class WhereTypeIterator<T> implements Iterator<T> {
-  final Iterator<Object> _source;
+  final Iterator<Object?> _source;
   WhereTypeIterator(this._source);
   bool moveNext() {
     while (_source.moveNext()) {
@@ -883,7 +878,7 @@
     return false;
   }
 
-  T get current => _source.current;
+  T get current => _source.current as T;
 }
 
 /**
diff --git a/sdk/lib/internal/linked_list.dart b/sdk/lib/internal/linked_list.dart
index 1ad5889..b5e5275 100644
--- a/sdk/lib/internal/linked_list.dart
+++ b/sdk/lib/internal/linked_list.dart
@@ -2,14 +2,16 @@
 // 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.6
-
 part of dart._internal;
 
 /// A rudimentary linked list.
 class LinkedList<T extends LinkedListEntry<T>> extends IterableBase<T> {
-  T first;
-  T last;
+  T get first => _first as T;
+  T? _first;
+
+  T get last => _last as T;
+  T? _last;
+
   int length = 0;
 
   bool get isEmpty => length == 0;
@@ -19,15 +21,15 @@
    */
   void add(T newLast) {
     assert(newLast._next == null && newLast._previous == null);
-    if (last != null) {
-      assert(last._next == null);
-      last._next = newLast;
+    if (_last != null) {
+      assert(_last!._next == null);
+      _last!._next = newLast;
     } else {
-      first = newLast;
+      _first = newLast;
     }
-    newLast._previous = last;
-    last = newLast;
-    last._list = this;
+    newLast._previous = _last;
+    _last = newLast;
+    _last!._list = this;
     length++;
   }
 
@@ -35,15 +37,15 @@
    * Adds [newFirst] to the beginning of this linked list.
    */
   void addFirst(T newFirst) {
-    if (first != null) {
-      assert(first._previous == null);
-      first._previous = newFirst;
+    if (_first != null) {
+      assert(_first!._previous == null);
+      _first!._previous = newFirst;
     } else {
-      last = newFirst;
+      _last = newFirst;
     }
-    newFirst._next = first;
-    first = newFirst;
-    first._list = this;
+    newFirst._next = _first;
+    _first = newFirst;
+    _first!._list = this;
     length++;
   }
 
@@ -58,16 +60,16 @@
     if (node._list != this) return;
     length--;
     if (node._previous == null) {
-      assert(identical(node, first));
-      first = node._next;
+      assert(identical(node, _first));
+      _first = node._next;
     } else {
-      node._previous._next = node._next;
+      node._previous!._next = node._next;
     }
     if (node._next == null) {
-      assert(identical(node, last));
-      last = node._previous;
+      assert(identical(node, _last));
+      _last = node._previous;
     } else {
-      node._next._previous = node._previous;
+      node._next!._previous = node._previous;
     }
     node._next = node._previous = null;
     node._list = null;
@@ -77,9 +79,9 @@
 }
 
 class LinkedListEntry<T extends LinkedListEntry<T>> {
-  T _next;
-  T _previous;
-  LinkedList<T> _list;
+  T? _next;
+  T? _previous;
+  LinkedList<T>? _list;
 
   /**
    * Unlinks the element from its linked list.
@@ -89,15 +91,18 @@
    * is currently in.
    */
   void unlink() {
-    if (_list == null) return;
-    _list.remove(this);
+    _list?.remove(this as T);
   }
 }
 
 class _LinkedListIterator<T extends LinkedListEntry<T>> implements Iterator<T> {
   /// The current element of the iterator.
-  // This field is writeable, but should only read by users of this class.
-  T current;
+  T? _current;
+
+  T get current {
+    final cur = _current;
+    return (cur != null) ? cur : cur as T;
+  }
 
   /// The list the iterator iterates over.
   ///
@@ -106,23 +111,24 @@
   ///
   /// Set to [null] as soon as [moveNext] was invoked (indicating that the
   /// iterator has to work with [current] from now on.
-  LinkedList<T> _list;
+  LinkedList<T>? _list;
 
-  _LinkedListIterator(this._list) {
-    if (_list.length == 0) _list = null;
+  _LinkedListIterator(LinkedList<T> list) : _list = list {
+    if (list.length == 0) _list = null;
   }
 
   bool moveNext() {
     // current is null if the iterator hasn't started iterating, or if the
     // iteration is finished. In the first case, the [_list] field is not null.
-    if (current == null) {
-      if (_list == null) return false;
-      assert(_list.length > 0);
-      current = _list.first;
+    if (_current == null) {
+      var list = _list;
+      if (list == null) return false;
+      assert(list.length > 0);
+      _current = list.first;
       _list = null;
       return true;
     }
-    current = current._next;
-    return current != null;
+    _current = _current!._next;
+    return _current != null;
   }
 }
diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
index 3bf14a9..0a8b6a9 100644
--- a/sdk/lib/internal/list.dart
+++ b/sdk/lib/internal/list.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.6
-
 part of dart._internal;
 
 /**
@@ -39,7 +37,7 @@
   }
 
   /** This operation is not supported by a fixed length list. */
-  bool remove(Object element) {
+  bool remove(Object? element) {
     throw new UnsupportedError("Cannot remove from a fixed-length list");
   }
 
@@ -132,7 +130,7 @@
   }
 
   /** This operation is not supported by an unmodifiable list. */
-  bool remove(Object element) {
+  bool remove(Object? element) {
     throw new UnsupportedError("Cannot remove from an unmodifiable list");
   }
 
@@ -147,12 +145,12 @@
   }
 
   /** This operation is not supported by an unmodifiable list. */
-  void sort([Comparator<E> compare]) {
+  void sort([Comparator<E>? compare]) {
     throw new UnsupportedError("Cannot modify an unmodifiable list");
   }
 
   /** This operation is not supported by an unmodifiable list. */
-  void shuffle([Random random]) {
+  void shuffle([Random? random]) {
     throw new UnsupportedError("Cannot modify an unmodifiable list");
   }
 
@@ -187,7 +185,7 @@
   }
 
   /** This operation is not supported by an unmodifiable list. */
-  void fillRange(int start, int end, [E fillValue]) {
+  void fillRange(int start, int end, [E? fillValue]) {
     throw new UnsupportedError("Cannot modify an unmodifiable list");
   }
 }
@@ -227,7 +225,7 @@
 
   ListMapView(this._values);
 
-  E operator [](Object key) => containsKey(key) ? _values[key] : null;
+  E? operator [](Object? key) => containsKey(key) ? _values[key as int] : null;
   int get length => _values.length;
 
   Iterable<E> get values => new SubListIterable<E>(_values, 0, null);
@@ -235,8 +233,8 @@
 
   bool get isEmpty => _values.isEmpty;
   bool get isNotEmpty => _values.isNotEmpty;
-  bool containsValue(Object value) => _values.contains(value);
-  bool containsKey(Object key) => key is int && key >= 0 && key < length;
+  bool containsValue(Object? value) => _values.contains(value);
+  bool containsKey(Object? key) => key is int && key >= 0 && key < length;
 
   void forEach(void f(int key, E value)) {
     int length = _values.length;
@@ -304,7 +302,7 @@
  * Converts a growable list to a fixed length list with the same elements.
  *
  * For internal use only.
- * Only works on growable lists as created by `[]` or `new List()`.
+ * Only works on growable lists like the one created by `[]`.
  * May throw on any other list.
  *
  * The operation is efficient. It doesn't copy the elements, but converts
diff --git a/sdk/lib/internal/patch.dart b/sdk/lib/internal/patch.dart
index b6aeea8..3fc9733 100644
--- a/sdk/lib/internal/patch.dart
+++ b/sdk/lib/internal/patch.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.6
-
 part of "dart:_internal";
 
 class _Patch {
diff --git a/sdk/lib/internal/print.dart b/sdk/lib/internal/print.dart
index 466a414..2028503 100644
--- a/sdk/lib/internal/print.dart
+++ b/sdk/lib/internal/print.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.6
-
 part of dart._internal;
 
 /**
@@ -14,6 +12,6 @@
  *
  * This decouples the core library from the async library.
  */
-void Function(String) printToZone = null;
+void Function(String)? printToZone = null;
 
 external void printToConsole(String line);
diff --git a/sdk/lib/internal/sort.dart b/sdk/lib/internal/sort.dart
index a4489f3..d6cca2e 100644
--- a/sdk/lib/internal/sort.dart
+++ b/sdk/lib/internal/sort.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.6
-
 part of dart._internal;
 
 /**
diff --git a/sdk/lib/internal/symbol.dart b/sdk/lib/internal/symbol.dart
index 7fba4af..bf48493 100644
--- a/sdk/lib/internal/symbol.dart
+++ b/sdk/lib/internal/symbol.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.6
-
 part of dart._internal;
 
 /**
@@ -111,7 +109,7 @@
   // This is called by dart2js.
   Symbol.validated(String name) : this._name = validatePublicSymbol(name);
 
-  bool operator ==(other) => other is Symbol && _name == other._name;
+  bool operator ==(Object other) => other is Symbol && _name == other._name;
 
   external int get hashCode;
 
diff --git a/sdk/lib/io/bytes_builder.dart b/sdk/lib/io/bytes_builder.dart
index b35dfca..6f13693 100644
--- a/sdk/lib/io/bytes_builder.dart
+++ b/sdk/lib/io/bytes_builder.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.6
-
 part of dart.io;
 
 /**
diff --git a/sdk/lib/io/common.dart b/sdk/lib/io/common.dart
index 58f5f70..9688d8d 100644
--- a/sdk/lib/io/common.dart
+++ b/sdk/lib/io/common.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.6
-
 part of dart.io;
 
 // Constants used when working with native ports.
@@ -56,8 +54,8 @@
   /** Constant used to indicate that no OS error code is available. */
   static const int noErrorCode = -1;
 
-  /// Error message supplied by the operating system. This may be `null` or
-  /// empty if no message is associated with the error.
+  /// Error message supplied by the operating system. This will be empty if no
+  /// message is associated with the error.
   final String message;
 
   /// Error code supplied by the operating system.
diff --git a/sdk/lib/io/data_transformer.dart b/sdk/lib/io/data_transformer.dart
index cdcaa19..4346a1a 100644
--- a/sdk/lib/io/data_transformer.dart
+++ b/sdk/lib/io/data_transformer.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.6
-
 part of dart.io;
 
 /**
@@ -155,7 +153,7 @@
    * be predicted with good accuracy; the data can then be compressed better
    * than with the default empty dictionary.
    */
-  final List<int> dictionary;
+  final List<int>? dictionary;
 
   ZLibCodec(
       {this.level: ZLibOption.defaultLevel,
@@ -266,7 +264,7 @@
    * be predicted with good accuracy; the data can then be compressed better
    * than with the default empty dictionary.
    */
-  final List<int> dictionary;
+  final List<int>? dictionary;
 
   /**
    * When true, deflate generates raw data with no zlib header or trailer, and
@@ -373,7 +371,7 @@
    * be predicted with good accuracy; the data can then be compressed better
    * than with the default empty dictionary.
    */
-  final List<int> dictionary;
+  final List<int>? dictionary;
 
   /**
    * When true, deflate generates raw data with no zlib header or trailer, and
@@ -442,7 +440,7 @@
    * be predicted with good accuracy; the data can then be compressed better
    * than with the default empty dictionary.
    */
-  final List<int> dictionary;
+  final List<int>? dictionary;
 
   /**
    * When true, deflate generates raw data with no zlib header or trailer, and
@@ -496,7 +494,7 @@
     int windowBits: ZLibOption.defaultWindowBits,
     int memLevel: ZLibOption.defaultMemLevel,
     int strategy: ZLibOption.strategyDefault,
-    List<int> dictionary,
+    List<int>? dictionary,
     bool raw: false,
   }) {
     return _makeZLibDeflateFilter(
@@ -509,7 +507,7 @@
    */
   factory RawZLibFilter.inflateFilter({
     int windowBits: ZLibOption.defaultWindowBits,
-    List<int> dictionary,
+    List<int>? dictionary,
     bool raw: false,
   }) {
     return _makeZLibInflateFilter(windowBits, dictionary, raw);
@@ -529,7 +527,7 @@
    * The last call to [processed] should have [end] set to [:true:]. This will
    * make sure an 'end' packet is written on the stream.
    */
-  List<int> processed({bool flush: true, bool end: false});
+  List<int>? processed({bool flush: true, bool end: false});
 
   external static RawZLibFilter _makeZLibDeflateFilter(
       bool gzip,
@@ -537,11 +535,11 @@
       int windowBits,
       int memLevel,
       int strategy,
-      List<int> dictionary,
+      List<int>? dictionary,
       bool raw);
 
   external static RawZLibFilter _makeZLibInflateFilter(
-      int windowBits, List<int> dictionary, bool raw);
+      int windowBits, List<int>? dictionary, bool raw);
 }
 
 class _BufferSink extends ByteConversionSink {
@@ -572,7 +570,7 @@
       int windowBits,
       int memLevel,
       int strategy,
-      List<int> dictionary,
+      List<int>? dictionary,
       bool raw)
       : super(
             sink,
@@ -582,7 +580,7 @@
 
 class _ZLibDecoderSink extends _FilterSink {
   _ZLibDecoderSink._(
-      ByteConversionSink sink, int windowBits, List<int> dictionary, bool raw)
+      ByteConversionSink sink, int windowBits, List<int>? dictionary, bool raw)
       : super(sink,
             RawZLibFilter._makeZLibInflateFilter(windowBits, dictionary, raw));
 }
@@ -600,8 +598,9 @@
   }
 
   void addSlice(List<int> data, int start, int end, bool isLast) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(end, "end");
     if (_closed) return;
-    if (end == null) throw new ArgumentError.notNull("end");
     RangeError.checkValidRange(start, end, data.length);
     try {
       _empty = false;
@@ -609,8 +608,10 @@
           _ensureFastAndSerializableByteData(data, start, end);
       _filter.process(bufferAndStart.buffer, bufferAndStart.start,
           end - (start - bufferAndStart.start));
-      List<int> out;
-      while ((out = _filter.processed(flush: false)) != null) {
+      List<int>? out;
+      while (true) {
+        final out = _filter.processed(flush: false);
+        if (out == null) break;
         _sink.add(out);
       }
     } catch (e) {
@@ -627,8 +628,9 @@
     // message would not have a GZip frame (if compressed with GZip).
     if (_empty) _filter.process(const [], 0, 0);
     try {
-      List<int> out;
-      while ((out = _filter.processed(end: true)) != null) {
+      while (true) {
+        final out = _filter.processed(end: true);
+        if (out == null) break;
         _sink.add(out);
       }
     } catch (e) {
diff --git a/sdk/lib/io/directory.dart b/sdk/lib/io/directory.dart
index 44b8399..90e2159 100644
--- a/sdk/lib/io/directory.dart
+++ b/sdk/lib/io/directory.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.6
-
 part of dart.io;
 
 /**
@@ -131,7 +129,7 @@
    */
   @pragma("vm:entry-point")
   factory Directory(String path) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return new _Directory(path);
     }
@@ -156,7 +154,7 @@
    * directory.
    */
   static Directory get current {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _Directory.current;
     }
@@ -191,7 +189,7 @@
    * are working with the file system, can lead to unexpected results.
    */
   static void set current(path) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       _Directory.current = path;
       return;
@@ -232,7 +230,7 @@
    * and may be set by an environment variable.
    */
   static Directory get systemTemp {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _Directory.systemTemp;
     }
@@ -248,7 +246,7 @@
    * Returns a [:Future<Directory>:] that completes with the newly
    * created temporary directory.
    */
-  Future<Directory> createTemp([String prefix]);
+  Future<Directory> createTemp([String? prefix]);
 
   /**
    * Synchronously creates a temporary directory in this directory.
@@ -258,7 +256,7 @@
    *
    * Returns the newly created temporary directory.
    */
-  Directory createTempSync([String prefix]);
+  Directory createTempSync([String? prefix]);
 
   Future<String> resolveSymbolicLinks();
 
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index bcd63b2..9ca5b6c 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -2,27 +2,20 @@
 // 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.6
-
 part of dart.io;
 
 class _Directory extends FileSystemEntity implements Directory {
-  String _path;
-  Uint8List _rawPath;
+  final String _path;
+  final Uint8List _rawPath;
 
-  _Directory(String path) {
-    ArgumentError.checkNotNull(path, 'path');
-    _path = path;
-    _rawPath = FileSystemEntity._toUtf8Array(_path);
-  }
+  _Directory(String path)
+      : _path = _checkNotNull(path, "path"),
+        _rawPath = FileSystemEntity._toUtf8Array(path);
 
-  _Directory.fromRawPath(Uint8List rawPath) {
-    if (rawPath == null) {
-      throw new ArgumentError('rawPath cannot be null');
-    }
-    _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawPath);
-    _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
-  }
+  _Directory.fromRawPath(Uint8List rawPath)
+      : _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(
+            _checkNotNull(rawPath, "rawPath")),
+        _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
 
   String get path => _path;
 
@@ -53,7 +46,7 @@
   }
 
   static void set current(path) {
-    Uint8List _rawPath;
+    late Uint8List _rawPath;
     if (path is _Directory) {
       // For our internal Directory implementation, go ahead and use the raw
       // path.
@@ -144,7 +137,7 @@
   static Directory get systemTemp =>
       new Directory(_systemTemp(_Namespace._namespace));
 
-  Future<Directory> createTemp([String prefix]) {
+  Future<Directory> createTemp([String? prefix]) {
     prefix ??= '';
     if (path == '') {
       throw new ArgumentError("Directory.createTemp called with an empty path. "
@@ -168,7 +161,7 @@
     });
   }
 
-  Directory createTempSync([String prefix]) {
+  Directory createTempSync([String? prefix]) {
     prefix ??= '';
     if (path == '') {
       throw new ArgumentError("Directory.createTemp called with an empty path. "
@@ -220,9 +213,8 @@
   }
 
   Directory renameSync(String newPath) {
-    if (newPath is! String) {
-      throw new ArgumentError();
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(newPath, "newPath");
     var result = _rename(_Namespace._namespace, _rawPath, newPath);
     if (result is OSError) {
       throw new FileSystemException("Rename failed", path, result);
@@ -244,9 +236,9 @@
 
   List<FileSystemEntity> listSync(
       {bool recursive: false, bool followLinks: true}) {
-    if (recursive is! bool || followLinks is! bool) {
-      throw new ArgumentError();
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(recursive, "recursive");
+    ArgumentError.checkNotNull(followLinks, "followLinks");
     var result = <FileSystemEntity>[];
     _fillWithDirectoryListing(
         _Namespace._namespace,
@@ -278,12 +270,18 @@
         return new Exception("Unknown error");
     }
   }
+
+  // TODO(40614): Remove once non-nullability is sound.
+  static T _checkNotNull<T>(T t, String name) {
+    ArgumentError.checkNotNull(t, name);
+    return t;
+  }
 }
 
 abstract class _AsyncDirectoryListerOps {
   external factory _AsyncDirectoryListerOps(int pointer);
 
-  int getPointer();
+  int? getPointer();
 }
 
 class _AsyncDirectoryLister {
@@ -302,16 +300,18 @@
   final bool recursive;
   final bool followLinks;
 
-  StreamController<FileSystemEntity> controller;
+  final controller = new StreamController<FileSystemEntity>(sync: true);
   bool canceled = false;
   bool nextRunning = false;
   bool closed = false;
-  _AsyncDirectoryListerOps _ops;
+  _AsyncDirectoryListerOps? _ops;
   Completer closeCompleter = new Completer();
 
   _AsyncDirectoryLister(this.rawPath, this.recursive, this.followLinks) {
-    controller = new StreamController<FileSystemEntity>(
-        onListen: onListen, onResume: onResume, onCancel: onCancel, sync: true);
+    controller
+      ..onListen = onListen
+      ..onResume = onResume
+      ..onCancel = onCancel;
   }
 
   // WARNING:
@@ -319,8 +319,8 @@
   // object that implements the async directory lister operations. It should
   // only be called to pass the pointer to the IO Service, which will decrement
   // the reference count when it is finished with it.
-  int _pointer() {
-    return (_ops == null) ? null : _ops.getPointer();
+  int? _pointer() {
+    return _ops?.getPointer();
   }
 
   Stream<FileSystemEntity> get stream => controller.stream;
diff --git a/sdk/lib/io/embedder_config.dart b/sdk/lib/io/embedder_config.dart
index 179c06a..cbc94f7 100644
--- a/sdk/lib/io/embedder_config.dart
+++ b/sdk/lib/io/embedder_config.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.6
-
 part of dart.io;
 
 /// Embedder-specific, fine-grained dart:io configuration.
diff --git a/sdk/lib/io/eventhandler.dart b/sdk/lib/io/eventhandler.dart
index 6a3467f..cfad310 100644
--- a/sdk/lib/io/eventhandler.dart
+++ b/sdk/lib/io/eventhandler.dart
@@ -2,10 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.6
-
 part of dart.io;
 
 class _EventHandler {
-  external static void _sendData(Object sender, SendPort sendPort, int data);
+  external static void _sendData(Object? sender, SendPort sendPort, int data);
 }
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index b04315f..234220a 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.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.6
-
 part of dart.io;
 
 /**
@@ -252,7 +250,7 @@
    */
   @pragma("vm:entry-point")
   factory File(String path) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return new _File(path);
     }
@@ -485,7 +483,7 @@
    * must be read to completion or the subscription on the stream must
    * be cancelled.
    */
-  Stream<List<int>> openRead([int start, int end]);
+  Stream<List<int>> openRead([int? start, int? end]);
 
   /**
    * Creates a new independent [IOSink] for the file. The
@@ -703,7 +701,7 @@
    *
    * Returns a `Future<int>` that completes with the number of bytes read.
    */
-  Future<int> readInto(List<int> buffer, [int start = 0, int end]);
+  Future<int> readInto(List<int> buffer, [int start = 0, int? end]);
 
   /**
    * Synchronously reads into an existing [List<int>] from the file and returns
@@ -716,7 +714,7 @@
    *
    * Throws a [FileSystemException] if the operation fails.
    */
-  int readIntoSync(List<int> buffer, [int start = 0, int end]);
+  int readIntoSync(List<int> buffer, [int start = 0, int? end]);
 
   /**
    * Writes a single byte to the file. Returns a
@@ -726,8 +724,7 @@
   Future<RandomAccessFile> writeByte(int value);
 
   /**
-   * Synchronously writes a single byte to the file. Returns the
-   * number of bytes successfully written.
+   * Synchronously writes a single byte to the file. Returns 1 on success.
    *
    * Throws a [FileSystemException] if the operation fails.
    */
@@ -742,7 +739,7 @@
    * [RandomAccessFile] when the write completes.
    */
   Future<RandomAccessFile> writeFrom(List<int> buffer,
-      [int start = 0, int end]);
+      [int start = 0, int? end]);
 
   /**
    * Synchronously writes from a [List<int>] to the file. It will read the
@@ -752,7 +749,7 @@
    *
    * Throws a [FileSystemException] if the operation fails.
    */
-  void writeFromSync(List<int> buffer, [int start = 0, int end]);
+  void writeFromSync(List<int> buffer, [int start = 0, int? end]);
 
   /**
    * Writes a string to the file using the given [Encoding]. Returns a
@@ -974,13 +971,13 @@
    * The file system path on which the error occurred. Can be `null`
    * if the exception does not relate directly to a file system path.
    */
-  final String path;
+  final String? path;
 
   /**
    * The underlying OS error. Can be `null` if the exception is not
    * raised due to an OS error.
    */
-  final OSError osError;
+  final OSError? osError;
 
   /**
    * Creates a new FileSystemException with an optional error message
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index f0a1275..ee34b7d 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.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.6
-
 part of dart.io;
 
 // Read the file in blocks of size 64k.
@@ -11,13 +9,13 @@
 
 class _FileStream extends Stream<List<int>> {
   // Stream controller.
-  StreamController<Uint8List> _controller;
+  late StreamController<Uint8List> _controller;
 
   // Information about the underlying file.
-  String _path;
-  RandomAccessFile _openedFile;
+  String? _path;
+  late RandomAccessFile _openedFile;
   int _position;
-  int _end;
+  int? _end;
   final Completer _closeCompleter = new Completer();
 
   // Has the stream been paused or unsubscribed?
@@ -29,20 +27,12 @@
 
   bool _atEnd = false;
 
-  _FileStream(this._path, this._position, this._end) {
-    _position ??= 0;
-  }
+  _FileStream(this._path, int? position, this._end) : _position = position ?? 0;
 
   _FileStream.forStdin() : _position = 0;
 
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event),
-      {Function onError, void onDone(), bool cancelOnError}) {
-    _setupController();
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  void _setupController() {
+  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     _controller = new StreamController<Uint8List>(
         sync: true,
         onListen: _start,
@@ -51,6 +41,8 @@
           _unsubscribed = true;
           return _closeFile();
         });
+    return _controller.stream.listen(onData,
+        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
   Future _closeFile() {
@@ -77,12 +69,13 @@
     }
     _readInProgress = true;
     int readBytes = _blockSize;
-    if (_end != null) {
-      readBytes = min(readBytes, _end - _position);
+    final end = _end;
+    if (end != null) {
+      readBytes = min(readBytes, end - _position);
       if (readBytes < 0) {
         _readInProgress = false;
         if (!_unsubscribed) {
-          _controller.addError(new RangeError("Bad end position: $_end"));
+          _controller.addError(new RangeError("Bad end position: $end"));
           _closeFile();
           _unsubscribed = true;
         }
@@ -147,8 +140,9 @@
       _closeCompleter.complete();
     }
 
-    if (_path != null) {
-      new File(_path)
+    final path = _path;
+    if (path != null) {
+      new File(path)
           .open(mode: FileMode.read)
           .then(onOpenFile, onError: openFailed);
     } else {
@@ -162,22 +156,21 @@
 }
 
 class _FileStreamConsumer extends StreamConsumer<List<int>> {
-  File _file;
+  File? _file;
   Future<RandomAccessFile> _openFuture;
 
-  _FileStreamConsumer(this._file, FileMode mode) {
-    _openFuture = _file.open(mode: mode);
-  }
+  _FileStreamConsumer(File file, FileMode mode)
+      : _file = file,
+        _openFuture = file.open(mode: mode);
 
-  _FileStreamConsumer.fromStdio(int fd) {
-    _openFuture = new Future.value(_File._openStdioSync(fd));
-  }
+  _FileStreamConsumer.fromStdio(int fd)
+      : _openFuture = new Future.value(_File._openStdioSync(fd));
 
-  Future<File> addStream(Stream<List<int>> stream) {
-    Completer<File> completer = new Completer<File>.sync();
+  Future<File?> addStream(Stream<List<int>> stream) {
+    Completer<File?> completer = new Completer<File?>.sync();
     _openFuture.then((openedFile) {
-      var _subscription;
-      void error(e, [StackTrace stackTrace]) {
+      late StreamSubscription<List<int>> _subscription;
+      void error(e, StackTrace stackTrace) {
         _subscription.cancel();
         openedFile.close();
         completer.completeError(e, stackTrace);
@@ -199,26 +192,23 @@
     return completer.future;
   }
 
-  Future<File> close() =>
+  Future<File?> close() =>
       _openFuture.then((openedFile) => openedFile.close()).then((_) => _file);
 }
 
 // Class for encapsulating the native implementation of files.
 class _File extends FileSystemEntity implements File {
-  String _path;
-  Uint8List _rawPath;
+  final String _path;
+  final Uint8List _rawPath;
 
-  _File(String path) {
-    ArgumentError.checkNotNull(path, 'path');
-    _path = path;
-    _rawPath = FileSystemEntity._toUtf8Array(path);
-  }
+  _File(String path)
+      : _path = _checkNotNull(path, "path"),
+        _rawPath = FileSystemEntity._toUtf8Array(path);
 
-  _File.fromRawPath(Uint8List rawPath) {
-    ArgumentError.checkNotNull(rawPath, 'rawPath');
-    _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawPath);
-    _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
-  }
+  _File.fromRawPath(Uint8List rawPath)
+      : _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(
+            _checkNotNull(rawPath, "rawPath")),
+        _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
 
   String get path => _path;
 
@@ -500,7 +490,7 @@
     return new _RandomAccessFile(id, "");
   }
 
-  Stream<List<int>> openRead([int start, int end]) {
+  Stream<List<int>> openRead([int? start, int? end]) {
     return new _FileStream(path, start, end);
   }
 
@@ -645,6 +635,12 @@
       throw new FileSystemException(msg, path, result);
     }
   }
+
+  // TODO(40614): Remove once non-nullability is sound.
+  static T _checkNotNull<T>(T t, String name) {
+    ArgumentError.checkNotNull(t, name);
+    return t;
+  }
 }
 
 abstract class _RandomAccessFileOps {
@@ -654,9 +650,9 @@
   int close();
   readByte();
   read(int bytes);
-  readInto(List<int> buffer, int start, int end);
+  readInto(List<int> buffer, int start, int? end);
   writeByte(int value);
-  writeFrom(List<int> buffer, int start, int end);
+  writeFrom(List<int> buffer, int start, int? end);
   position();
   setPosition(int position);
   truncate(int length);
@@ -671,13 +667,12 @@
   final String path;
 
   bool _asyncDispatched = false;
-  SendPort _fileService;
 
-  _FileResourceInfo _resourceInfo;
+  late _FileResourceInfo _resourceInfo;
   _RandomAccessFileOps _ops;
 
-  _RandomAccessFile(int pointer, this.path) {
-    _ops = new _RandomAccessFileOps(pointer);
+  _RandomAccessFile(int pointer, this.path)
+      : _ops = new _RandomAccessFileOps(pointer) {
     _resourceInfo = new _FileResourceInfo(this);
     _maybeConnectHandler();
   }
@@ -744,7 +739,8 @@
   }
 
   Future<Uint8List> read(int bytes) {
-    ArgumentError.checkNotNull(bytes, 'bytes');
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(bytes, "bytes");
     return _dispatch(_IOService.fileRead, [null, bytes]).then((response) {
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "read failed", path);
@@ -756,8 +752,9 @@
   }
 
   Uint8List readSync(int bytes) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(bytes, "bytes");
     _checkAvailable();
-    ArgumentError.checkNotNull(bytes, 'bytes');
     var result = _ops.read(bytes);
     if (result is OSError) {
       throw new FileSystemException("readSync failed", path, result);
@@ -766,12 +763,9 @@
     return result;
   }
 
-  Future<int> readInto(List<int> buffer, [int start = 0, int end]) {
-    if ((buffer is! List) ||
-        ((start != null) && (start is! int)) ||
-        ((end != null) && (end is! int))) {
-      throw new ArgumentError();
-    }
+  Future<int> readInto(List<int> buffer, [int start = 0, int? end]) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(buffer, "buffer");
     end = RangeError.checkValidRange(start, end, buffer.length);
     if (end == start) {
       return new Future.value(0);
@@ -789,13 +783,10 @@
     });
   }
 
-  int readIntoSync(List<int> buffer, [int start = 0, int end]) {
+  int readIntoSync(List<int> buffer, [int start = 0, int? end]) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(buffer, "buffer");
     _checkAvailable();
-    if ((buffer is! List) ||
-        ((start != null) && (start is! int)) ||
-        ((end != null) && (end is! int))) {
-      throw new ArgumentError();
-    }
     end = RangeError.checkValidRange(start, end, buffer.length);
     if (end == start) {
       return 0;
@@ -809,7 +800,8 @@
   }
 
   Future<RandomAccessFile> writeByte(int value) {
-    ArgumentError.checkNotNull(value, 'value');
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(value, "value");
     return _dispatch(_IOService.fileWriteByte, [null, value]).then((response) {
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "writeByte failed", path);
@@ -821,7 +813,8 @@
 
   int writeByteSync(int value) {
     _checkAvailable();
-    ArgumentError.checkNotNull(value, 'value');
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(value, "value");
     var result = _ops.writeByte(value);
     if (result is OSError) {
       throw new FileSystemException("writeByte failed", path, result);
@@ -831,12 +824,10 @@
   }
 
   Future<RandomAccessFile> writeFrom(List<int> buffer,
-      [int start = 0, int end]) {
-    if ((buffer is! List) ||
-        ((start != null) && (start is! int)) ||
-        ((end != null) && (end is! int))) {
-      throw new ArgumentError("Invalid arguments to writeFrom");
-    }
+      [int start = 0, int? end]) {
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(buffer, "buffer");
+    ArgumentError.checkNotNull(start, "start");
     end = RangeError.checkValidRange(start, end, buffer.length);
     if (end == start) {
       return new Future.value(this);
@@ -848,7 +839,7 @@
       return new Future.error(e);
     }
 
-    List request = new List(4);
+    List request = new List<dynamic>.filled(4, null);
     request[0] = null;
     request[1] = result.buffer;
     request[2] = result.start;
@@ -857,18 +848,16 @@
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "writeFrom failed", path);
       }
-      _resourceInfo.addWrite(end - (start - result.start));
+      _resourceInfo.addWrite(end! - (start - result.start));
       return this;
     });
   }
 
-  void writeFromSync(List<int> buffer, [int start = 0, int end]) {
+  void writeFromSync(List<int> buffer, [int start = 0, int? end]) {
     _checkAvailable();
-    if ((buffer is! List) ||
-        ((start != null) && (start is! int)) ||
-        ((end != null) && (end is! int))) {
-      throw new ArgumentError("Invalid arguments to writeFromSync");
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(buffer, "buffer");
+    ArgumentError.checkNotNull(start, "start");
     end = RangeError.checkValidRange(start, end, buffer.length);
     if (end == start) {
       return;
@@ -885,13 +874,15 @@
 
   Future<RandomAccessFile> writeString(String string,
       {Encoding encoding: utf8}) {
-    ArgumentError.checkNotNull(encoding, 'encoding');
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(encoding, "encoding");
     var data = encoding.encode(string);
     return writeFrom(data, 0, data.length);
   }
 
   void writeStringSync(String string, {Encoding encoding: utf8}) {
-    ArgumentError.checkNotNull(encoding, 'encoding');
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(encoding, "encoding");
     var data = encoding.encode(string);
     writeFromSync(data, 0, data.length);
   }
@@ -994,9 +985,10 @@
 
   Future<RandomAccessFile> lock(
       [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) {
-    if ((mode is! FileLock) || (start is! int) || (end is! int)) {
-      throw new ArgumentError();
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(mode, "mode");
+    ArgumentError.checkNotNull(start, "start");
+    ArgumentError.checkNotNull(end, "end");
     if ((start < 0) || (end < -1) || ((end != -1) && (start >= end))) {
       throw new ArgumentError();
     }
@@ -1011,9 +1003,9 @@
   }
 
   Future<RandomAccessFile> unlock([int start = 0, int end = -1]) {
-    if ((start is! int) || (end is! int)) {
-      throw new ArgumentError();
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(start, "start");
+    ArgumentError.checkNotNull(end, "end");
     if (start == end) {
       throw new ArgumentError();
     }
@@ -1029,9 +1021,10 @@
   void lockSync(
       [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) {
     _checkAvailable();
-    if ((mode is! FileLock) || (start is! int) || (end is! int)) {
-      throw new ArgumentError();
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(mode, "mode");
+    ArgumentError.checkNotNull(start, "start");
+    ArgumentError.checkNotNull(end, "end");
     if ((start < 0) || (end < -1) || ((end != -1) && (start >= end))) {
       throw new ArgumentError();
     }
@@ -1044,9 +1037,9 @@
 
   void unlockSync([int start = 0, int end = -1]) {
     _checkAvailable();
-    if ((start is! int) || (end is! int)) {
-      throw new ArgumentError();
-    }
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(start, "start");
+    ArgumentError.checkNotNull(end, "end");
     if (start == end) {
       throw new ArgumentError();
     }
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index 3f45ca5..0741583 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.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.6
-
 part of dart.io;
 
 /**
@@ -117,7 +115,7 @@
    * [FileSystemEntityType.notFound] and the other fields invalid.
    */
   static FileStat statSync(String path) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _statSyncInternal(path);
     }
@@ -147,7 +145,7 @@
    * Returns a [Future] which completes with the same results as [statSync].
    */
   static Future<FileStat> stat(String path) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _stat(path);
     }
@@ -249,8 +247,8 @@
  *   files and directories.
  */
 abstract class FileSystemEntity {
-  String _path;
-  Uint8List _rawPath;
+  String get _path;
+  Uint8List get _rawPath;
 
   String get path;
 
@@ -496,7 +494,7 @@
       {int events: FileSystemEvent.all, bool recursive: false}) {
     // FIXME(bkonyi): find a way to do this using the raw path.
     final String trimmedPath = _trimTrailingPathSeparators(path);
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _FileSystemWatcher._watch(trimmedPath, events, recursive);
     }
@@ -532,7 +530,7 @@
    * to an object that does not exist.
    */
   static Future<bool> identical(String path1, String path2) {
-    IOOverrides overrides = IOOverrides.current;
+    IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _identical(path1, path2);
     }
@@ -614,7 +612,7 @@
    * exist.
    */
   static bool identicalSync(String path1, String path2) {
-    IOOverrides overrides = IOOverrides.current;
+    IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _identicalSync(path1, path2);
     }
@@ -627,7 +625,7 @@
    * OS X 10.6 and below is not supported.
    */
   static bool get isWatchSupported {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _FileSystemWatcher.isSupported;
     }
@@ -637,12 +635,9 @@
   // The native methods which determine type of the FileSystemEntity require
   // that the buffer provided is null terminated.
   static Uint8List _toUtf8Array(String s) =>
-      _toNullTerminatedUtf8Array(utf8.encode(s));
+      _toNullTerminatedUtf8Array(utf8.encoder.convert(s));
 
   static Uint8List _toNullTerminatedUtf8Array(Uint8List l) {
-    if (l == null) {
-      return null;
-    }
     if (l.isNotEmpty && l.last != 0) {
       final tmp = new Uint8List(l.length + 1);
       tmp.setRange(0, l.length, l);
@@ -653,9 +648,6 @@
   }
 
   static String _toStringFromUtf8Array(Uint8List l) {
-    if (l == null) {
-      return '';
-    }
     Uint8List nonNullTerminated = l;
     if (l.last == 0) {
       nonNullTerminated =
@@ -793,7 +785,7 @@
 
   static FileSystemEntityType _getTypeSync(
       Uint8List rawPath, bool followLinks) {
-    IOOverrides overrides = IOOverrides.current;
+    IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _getTypeSyncHelper(rawPath, followLinks);
     }
@@ -815,7 +807,7 @@
 
   static Future<FileSystemEntityType> _getType(
       Uint8List rawPath, bool followLinks) {
-    IOOverrides overrides = IOOverrides.current;
+    IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return _getTypeRequest(rawPath, followLinks);
     }
@@ -823,7 +815,7 @@
         utf8.decode(rawPath, allowMalformed: true), followLinks);
   }
 
-  static _throwIfError(Object result, String msg, [String path]) {
+  static _throwIfError(Object result, String msg, [String? path]) {
     if (result is OSError) {
       throw new FileSystemException(msg, path, result);
     } else if (result is ArgumentError) {
@@ -833,8 +825,8 @@
 
   // TODO(bkonyi): find a way to do this with raw paths.
   static String _trimTrailingPathSeparators(String path) {
-    // Don't handle argument errors here.
-    if (path == null) return path;
+    // TODO(40614): Remove once non-nullability is sound.
+    ArgumentError.checkNotNull(path, "path");
     if (Platform.isWindows) {
       while (path.length > 1 &&
           (path.endsWith(Platform.pathSeparator) || path.endsWith('/'))) {
@@ -850,8 +842,6 @@
 
   // TODO(bkonyi): find a way to do this with raw paths.
   static String _ensureTrailingPathSeparators(String path) {
-    // Don't handle argument errors here.
-    if (path == null) return path;
     if (path.isEmpty) path = '.';
     if (Platform.isWindows) {
       while (!path.endsWith(Platform.pathSeparator) && !path.endsWith('/')) {
@@ -980,7 +970,7 @@
    * If the underlying implementation is able to identify the destination of
    * the moved file, [destination] will be set. Otherwise, it will be `null`.
    */
-  final String destination;
+  final String? destination;
 
   FileSystemMoveEvent._(path, isDirectory, this.destination)
       : super._(FileSystemEvent.move, path, isDirectory);
@@ -994,7 +984,7 @@
   }
 }
 
-class _FileSystemWatcher {
+abstract class _FileSystemWatcher {
   external static Stream<FileSystemEvent> _watch(
       String path, int events, bool recursive);
   external static bool get isSupported;
diff --git a/sdk/lib/io/io.dart b/sdk/lib/io/io.dart
index e9fc277..27cd6a3 100644
--- a/sdk/lib/io/io.dart
+++ b/sdk/lib/io/io.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.6
-
 /**
  * File, socket, HTTP, and other I/O support for non-web applications.
  *
diff --git a/sdk/lib/io/io_resource_info.dart b/sdk/lib/io/io_resource_info.dart
index a81da11..b916dd8 100644
--- a/sdk/lib/io/io_resource_info.dart
+++ b/sdk/lib/io/io_resource_info.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.6
-
 part of dart.io;
 
 abstract class _IOResourceInfo {
@@ -125,10 +123,9 @@
   }
 
   static Future<ServiceExtensionResponse> getFileInfoMapByID(function, params) {
-    assert(params.containsKey('id'));
-    var id = int.parse(params['id']);
+    var id = int.parse(params['id']!);
     var result =
-        openFiles.containsKey(id) ? openFiles[id].getFileInfoMap() : {};
+        openFiles.containsKey(id) ? openFiles[id]!.getFileInfoMap() : {};
     var jsonValue = json.encode(result);
     return new Future.value(new ServiceExtensionResponse.result(jsonValue));
   }
@@ -192,9 +189,9 @@
 
   static Future<ServiceExtensionResponse> getProcessInfoMapById(
       String function, Map<String, String> params) {
-    var id = int.parse(params['id']);
+    var id = int.parse(params['id']!);
     var result = startedProcesses.containsKey(id)
-        ? startedProcesses[id].fullValueMap
+        ? startedProcesses[id]!.fullValueMap
         : {};
     var jsonValue = json.encode(result);
     return new Future.value(new ServiceExtensionResponse.result(jsonValue));
@@ -257,10 +254,9 @@
 
   static Future<ServiceExtensionResponse> getSocketInfoMapByID(
       String function, Map<String, String> params) {
-    assert(params.containsKey('id'));
-    var id = int.parse(params['id']);
+    var id = int.parse(params['id']!);
     var result =
-        openSockets.containsKey(id) ? openSockets[id].getSocketInfoMap() : {};
+        openSockets.containsKey(id) ? openSockets[id]!.getSocketInfoMap() : {};
     var jsonValue = json.encode(result);
     return new Future.value(new ServiceExtensionResponse.result(jsonValue));
   }
diff --git a/sdk/lib/io/io_service.dart b/sdk/lib/io/io_service.dart
index 92d3e84..7af382c 100644
--- a/sdk/lib/io/io_service.dart
+++ b/sdk/lib/io/io_service.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.6
-
 part of dart.io;
 
 class _IOService {
diff --git a/sdk/lib/io/io_sink.dart b/sdk/lib/io/io_sink.dart
index 96a68a9..622656a 100644
--- a/sdk/lib/io/io_sink.dart
+++ b/sdk/lib/io/io_sink.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.6
-
 part of dart.io;
 
 /**
@@ -33,7 +31,7 @@
    * The [Encoding] used when writing strings. Depending on the
    * underlying consumer this property might be mutable.
    */
-  Encoding encoding;
+  late Encoding encoding;
 
   /**
    * Adds byte [data] to the target consumer, ignoring [encoding].
@@ -58,13 +56,13 @@
    * This operation is non-blocking. See [flush] or [done] for how to get any
    * errors generated by this call.
    */
-  void write(Object obj);
+  void write(Object? obj);
 
   /**
    * Iterates over the given [objects] and [write]s them in sequence.
    *
    * If [separator] is provided, a `write` with the `separator` is performed
-   * between any two elements of objects`.
+   * between any two elements of objects.
    *
    * This operation is non-blocking. See [flush] or [done] for how to get any
    * errors generated by this call.
@@ -78,7 +76,7 @@
    * This operation is non-blocking. See [flush] or [done] for how to get any
    * errors generated by this call.
    */
-  void writeln([Object obj = ""]);
+  void writeln([Object? obj = ""]);
 
   /**
    * Writes the character of [charCode].
@@ -99,7 +97,7 @@
    * This operation is non-blocking. See [flush] or [done] for how to get any
    * errors generated by this call.
    */
-  void addError(error, [StackTrace stackTrace]);
+  void addError(error, [StackTrace? stackTrace]);
 
   /**
    * Adds all elements of the given [stream] to `this`.
@@ -143,8 +141,8 @@
 class _StreamSinkImpl<T> implements StreamSink<T> {
   final StreamConsumer<T> _target;
   final Completer _doneCompleter = new Completer();
-  StreamController<T> _controllerInstance;
-  Completer _controllerCompleter;
+  StreamController<T>? _controllerInstance;
+  Completer? _controllerCompleter;
   bool _isClosed = false;
   bool _isBound = false;
   bool _hasError = false;
@@ -158,7 +156,7 @@
     _controller.add(data);
   }
 
-  void addError(error, [StackTrace stackTrace]) {
+  void addError(error, [StackTrace? stackTrace]) {
     if (_isClosed) {
       throw StateError("StreamSink is closed");
     }
@@ -174,7 +172,7 @@
     _isBound = true;
     var future = _controllerCompleter == null
         ? _target.addStream(stream)
-        : _controllerCompleter.future.then((_) => _target.addStream(stream));
+        : _controllerCompleter!.future.then((_) => _target.addStream(stream));
     _controllerInstance?.close();
 
     // Wait for any pending events in [_controller] to be dispatched before
@@ -192,8 +190,8 @@
     // Adding an empty stream-controller will return a future that will complete
     // when all data is done.
     _isBound = true;
-    var future = _controllerCompleter.future;
-    _controllerInstance.close();
+    var future = _controllerCompleter!.future;
+    _controllerInstance!.close();
     return future.whenComplete(() {
       _isBound = false;
     });
@@ -206,7 +204,7 @@
     if (!_isClosed) {
       _isClosed = true;
       if (_controllerInstance != null) {
-        _controllerInstance.close();
+        _controllerInstance!.close();
       } else {
         _closeTarget();
       }
@@ -226,7 +224,7 @@
     }
   }
 
-  void _completeDoneError(error, StackTrace stackTrace) {
+  void _completeDoneError(error, StackTrace? stackTrace) {
     if (!_doneCompleter.isCompleted) {
       _hasError = true;
       _doneCompleter.completeError(error, stackTrace);
@@ -246,7 +244,7 @@
       _target.addStream(_controller.stream).then((_) {
         if (_isBound) {
           // A new stream takes over - forward values to that stream.
-          _controllerCompleter.complete(this);
+          _controllerCompleter!.complete(this);
           _controllerCompleter = null;
           _controllerInstance = null;
         } else {
@@ -256,7 +254,7 @@
       }, onError: (error, stackTrace) {
         if (_isBound) {
           // A new stream takes over - forward errors to that stream.
-          _controllerCompleter.completeError(error, stackTrace);
+          _controllerCompleter!.completeError(error, stackTrace);
           _controllerCompleter = null;
           _controllerInstance = null;
         } else {
@@ -266,7 +264,7 @@
         }
       });
     }
-    return _controllerInstance;
+    return _controllerInstance!;
   }
 }
 
@@ -285,7 +283,7 @@
     _encoding = value;
   }
 
-  void write(Object obj) {
+  void write(Object? obj) {
     String string = '$obj';
     if (string.isEmpty) return;
     add(_encoding.encode(string));
@@ -307,7 +305,7 @@
     }
   }
 
-  void writeln([Object object = ""]) {
+  void writeln([Object? object = ""]) {
     write(object);
     write("\n");
   }
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index b210507..3f2896f 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.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.6
-
 part of dart.io;
 
 /**
@@ -17,7 +15,7 @@
    */
   @pragma("vm:entry-point")
   factory Link(String path) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return new _Link(path);
     }
@@ -155,19 +153,16 @@
 }
 
 class _Link extends FileSystemEntity implements Link {
-  String _path;
-  Uint8List _rawPath;
+  final String _path;
+  final Uint8List _rawPath;
 
-  _Link(String path) {
-    ArgumentError.checkNotNull(path, 'path');
-    _path = path;
-    _rawPath = FileSystemEntity._toUtf8Array(path);
-  }
+  _Link(String path)
+      : _path = path,
+        _rawPath = FileSystemEntity._toUtf8Array(path);
 
-  _Link.fromRawPath(Uint8List rawPath) {
-    _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawPath);
-    _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
-  }
+  _Link.fromRawPath(Uint8List rawPath)
+      : _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawPath),
+        _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
 
   String get path => _path;
 
@@ -276,7 +271,7 @@
     return result;
   }
 
-  static throwIfError(Object result, String msg, [String path = ""]) {
+  static throwIfError(Object? result, String msg, [String path = ""]) {
     if (result is OSError) {
       throw new FileSystemException(msg, path, result);
     }
diff --git a/sdk/lib/io/namespace_impl.dart b/sdk/lib/io/namespace_impl.dart
index 763f4aa..88987b6 100644
--- a/sdk/lib/io/namespace_impl.dart
+++ b/sdk/lib/io/namespace_impl.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.6
-
 part of dart.io;
 
 // Each Isolate may run in a different "namespace", which provides the scope in
diff --git a/sdk/lib/io/network_profiling.dart b/sdk/lib/io/network_profiling.dart
index f23ed37..5032d72 100644
--- a/sdk/lib/io/network_profiling.dart
+++ b/sdk/lib/io/network_profiling.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.6
-
 part of dart.io;
 
 const int _versionMajor = 1;
@@ -73,7 +71,7 @@
               'Method $method does not exist'));
       }
       return Future.value(ServiceExtensionResponse.result(responseJson));
-    } catch (errorMessage) {
+    } on dynamic catch (errorMessage) {
       return Future.value(ServiceExtensionResponse.error(
           ServiceExtensionResponse.invalidParams, errorMessage));
     }
@@ -105,7 +103,7 @@
   if (!parameters.containsKey(kEnable)) {
     throw _missingArgument(kEnable);
   }
-  final enable = parameters[kEnable].toLowerCase();
+  final enable = parameters[kEnable]!.toLowerCase();
   if (enable != 'true' && enable != 'false') {
     throw _invalidArgument(kEnable, enable);
   }
@@ -139,8 +137,7 @@
     // Skip socket that started before _enableSocketProfiling turned on.
     if (!_idToSocketStatistic.containsKey(id) &&
         type != _SocketProfileType.startTime) return;
-    _idToSocketStatistic[id] ??= _SocketStatistic(id);
-    _SocketStatistic stats = _idToSocketStatistic[id];
+    _SocketStatistic stats = _idToSocketStatistic[id] ??= _SocketStatistic(id);
     switch (type) {
       case _SocketProfileType.startTime:
         stats.startTime = Timeline.now;
@@ -162,16 +159,12 @@
         break;
       case _SocketProfileType.readBytes:
         if (object == null) return;
-        assert(object is int);
-        stats.readBytes ??= 0;
-        stats.readBytes += object;
+        stats.readBytes += object as int;
         stats.lastReadTime = Timeline.now;
         break;
       case _SocketProfileType.writeBytes:
         if (object == null) return;
-        assert(object is int);
-        stats.writeBytes ??= 0;
-        stats.writeBytes += object;
+        stats.writeBytes += object as int;
         stats.lastWriteTime = Timeline.now;
         break;
       default:
@@ -192,7 +185,7 @@
 
   // clear the storage if _idToSocketStatistic has been initialized.
   static String clear() {
-    _idToSocketStatistic?.clear();
+    _idToSocketStatistic.clear();
     return _success();
   }
 }
@@ -212,15 +205,15 @@
 /// Socket statistic
 class _SocketStatistic {
   final int id;
-  int startTime;
-  int endTime;
-  String address;
-  int port;
-  String socketType;
+  int? startTime;
+  int? endTime;
+  String? address;
+  int? port;
+  String? socketType;
   int readBytes = 0;
   int writeBytes = 0;
-  int lastWriteTime;
-  int lastReadTime;
+  int? lastWriteTime;
+  int? lastReadTime;
 
   _SocketStatistic(this.id);
 
@@ -240,7 +233,7 @@
     return map;
   }
 
-  void _setIfNotNull(Map<String, Object> json, String key, Object value) {
+  void _setIfNotNull(Map<String, dynamic> json, String key, Object? value) {
     if (value == null) return;
     json[key] = value;
   }
diff --git a/sdk/lib/io/overrides.dart b/sdk/lib/io/overrides.dart
index eecda8e..4b7deaa 100644
--- a/sdk/lib/io/overrides.dart
+++ b/sdk/lib/io/overrides.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.6
-
 part of dart.io;
 
 final _ioOverridesToken = new Object();
@@ -34,9 +32,9 @@
 /// }
 /// ```
 abstract class IOOverrides {
-  static IOOverrides _global;
+  static IOOverrides? _global;
 
-  static IOOverrides get current {
+  static IOOverrides? get current {
     return Zone.current[_ioOverridesToken] ?? _global;
   }
 
@@ -45,7 +43,7 @@
   /// These are the [IOOverrides] that will be used in the root Zone, and in
   /// Zone's that do not set [IOOverrides] and whose ancestors up to the root
   /// Zone do not set [IOOverrides].
-  static set global(IOOverrides overrides) {
+  static set global(IOOverrides? overrides) {
     _global = overrides;
   }
 
@@ -56,42 +54,42 @@
   static R runZoned<R>(R body(),
       {
       // Directory
-      Directory Function(String) createDirectory,
-      Directory Function() getCurrentDirectory,
-      void Function(String) setCurrentDirectory,
-      Directory Function() getSystemTempDirectory,
+      Directory Function(String)? createDirectory,
+      Directory Function()? getCurrentDirectory,
+      void Function(String)? setCurrentDirectory,
+      Directory Function()? getSystemTempDirectory,
 
       // File
-      File Function(String) createFile,
+      File Function(String)? createFile,
 
       // FileStat
-      Future<FileStat> Function(String) stat,
-      FileStat Function(String) statSync,
+      Future<FileStat> Function(String)? stat,
+      FileStat Function(String)? statSync,
 
       // FileSystemEntity
-      Future<bool> Function(String, String) fseIdentical,
-      bool Function(String, String) fseIdenticalSync,
-      Future<FileSystemEntityType> Function(String, bool) fseGetType,
-      FileSystemEntityType Function(String, bool) fseGetTypeSync,
+      Future<bool> Function(String, String)? fseIdentical,
+      bool Function(String, String)? fseIdenticalSync,
+      Future<FileSystemEntityType> Function(String, bool)? fseGetType,
+      FileSystemEntityType Function(String, bool)? fseGetTypeSync,
 
       // _FileSystemWatcher
-      Stream<FileSystemEvent> Function(String, int, bool) fsWatch,
-      bool Function() fsWatchIsSupported,
+      Stream<FileSystemEvent> Function(String, int, bool)? fsWatch,
+      bool Function()? fsWatchIsSupported,
 
       // Link
-      Link Function(String) createLink,
+      Link Function(String)? createLink,
 
       // Socket
       Future<Socket> Function(dynamic, int,
-              {dynamic sourceAddress, Duration timeout})
+              {dynamic sourceAddress, Duration? timeout})?
           socketConnect,
       Future<ConnectionTask<Socket>> Function(dynamic, int,
-              {dynamic sourceAddress})
+              {dynamic sourceAddress})?
           socketStartConnect,
 
       // ServerSocket
       Future<ServerSocket> Function(dynamic, int,
-              {int backlog, bool v6Only, bool shared})
+              {int backlog, bool v6Only, bool shared})?
           serverSocketBind}) {
     IOOverrides overrides = new _IOOverridesScope(
       // Directory
@@ -217,7 +215,8 @@
   /// When this override is installed, this function overrides the behavior of
   /// `FileSystemEntity.type`.
   Future<FileSystemEntityType> fseGetType(String path, bool followLinks) {
-    return FileSystemEntity._getTypeRequest(utf8.encode(path), followLinks);
+    return FileSystemEntity._getTypeRequest(
+        utf8.encoder.convert(path), followLinks);
   }
 
   /// Returns the [FileSystemEntityType] for [path].
@@ -225,7 +224,8 @@
   /// When this override is installed, this function overrides the behavior of
   /// `FileSystemEntity.typeSync`.
   FileSystemEntityType fseGetTypeSync(String path, bool followLinks) {
-    return FileSystemEntity._getTypeSyncHelper(utf8.encode(path), followLinks);
+    return FileSystemEntity._getTypeSyncHelper(
+        utf8.encoder.convert(path), followLinks);
   }
 
   // _FileSystemWatcher
@@ -259,7 +259,7 @@
   /// When this override is installed, this functions overrides the behavior of
   /// `Socket.connect(...)`.
   Future<Socket> socketConnect(host, int port,
-      {sourceAddress, Duration timeout}) {
+      {sourceAddress, Duration? timeout}) {
     return Socket._connect(host, port,
         sourceAddress: sourceAddress, timeout: timeout);
   }
@@ -289,43 +289,43 @@
 }
 
 class _IOOverridesScope extends IOOverrides {
-  final IOOverrides _previous = IOOverrides.current;
+  final IOOverrides? _previous = IOOverrides.current;
 
   // Directory
-  Directory Function(String) _createDirectory;
-  Directory Function() _getCurrentDirectory;
-  void Function(String) _setCurrentDirectory;
-  Directory Function() _getSystemTempDirectory;
+  Directory Function(String)? _createDirectory;
+  Directory Function()? _getCurrentDirectory;
+  void Function(String)? _setCurrentDirectory;
+  Directory Function()? _getSystemTempDirectory;
 
   // File
-  File Function(String) _createFile;
+  File Function(String)? _createFile;
 
   // FileStat
-  Future<FileStat> Function(String) _stat;
-  FileStat Function(String) _statSync;
+  Future<FileStat> Function(String)? _stat;
+  FileStat Function(String)? _statSync;
 
   // FileSystemEntity
-  Future<bool> Function(String, String) _fseIdentical;
-  bool Function(String, String) _fseIdenticalSync;
-  Future<FileSystemEntityType> Function(String, bool) _fseGetType;
-  FileSystemEntityType Function(String, bool) _fseGetTypeSync;
+  Future<bool> Function(String, String)? _fseIdentical;
+  bool Function(String, String)? _fseIdenticalSync;
+  Future<FileSystemEntityType> Function(String, bool)? _fseGetType;
+  FileSystemEntityType Function(String, bool)? _fseGetTypeSync;
 
   // _FileSystemWatcher
-  Stream<FileSystemEvent> Function(String, int, bool) _fsWatch;
-  bool Function() _fsWatchIsSupported;
+  Stream<FileSystemEvent> Function(String, int, bool)? _fsWatch;
+  bool Function()? _fsWatchIsSupported;
 
   // Link
-  Link Function(String) _createLink;
+  Link Function(String)? _createLink;
 
   // Socket
   Future<Socket> Function(dynamic, int,
-      {dynamic sourceAddress, Duration timeout}) _socketConnect;
-  Future<ConnectionTask<Socket>> Function(dynamic, int, {dynamic sourceAddress})
-      _socketStartConnect;
+      {dynamic sourceAddress, Duration? timeout})? _socketConnect;
+  Future<ConnectionTask<Socket>> Function(dynamic, int,
+      {dynamic sourceAddress})? _socketStartConnect;
 
   // ServerSocket
   Future<ServerSocket> Function(dynamic, int,
-      {int backlog, bool v6Only, bool shared}) _serverSocketBind;
+      {int backlog, bool v6Only, bool shared})? _serverSocketBind;
 
   _IOOverridesScope(
     // Directory
@@ -365,120 +365,120 @@
   // Directory
   @override
   Directory createDirectory(String path) {
-    if (_createDirectory != null) return _createDirectory(path);
-    if (_previous != null) return _previous.createDirectory(path);
+    if (_createDirectory != null) return _createDirectory!(path);
+    if (_previous != null) return _previous!.createDirectory(path);
     return super.createDirectory(path);
   }
 
   @override
   Directory getCurrentDirectory() {
-    if (_getCurrentDirectory != null) return _getCurrentDirectory();
-    if (_previous != null) return _previous.getCurrentDirectory();
+    if (_getCurrentDirectory != null) return _getCurrentDirectory!();
+    if (_previous != null) return _previous!.getCurrentDirectory();
     return super.getCurrentDirectory();
   }
 
   @override
   void setCurrentDirectory(String path) {
     if (_setCurrentDirectory != null)
-      _setCurrentDirectory(path);
+      _setCurrentDirectory!(path);
     else if (_previous != null)
-      _previous.setCurrentDirectory(path);
+      _previous!.setCurrentDirectory(path);
     else
       super.setCurrentDirectory(path);
   }
 
   @override
   Directory getSystemTempDirectory() {
-    if (_getSystemTempDirectory != null) return _getSystemTempDirectory();
-    if (_previous != null) return _previous.getSystemTempDirectory();
+    if (_getSystemTempDirectory != null) return _getSystemTempDirectory!();
+    if (_previous != null) return _previous!.getSystemTempDirectory();
     return super.getSystemTempDirectory();
   }
 
   // File
   @override
   File createFile(String path) {
-    if (_createFile != null) return _createFile(path);
-    if (_previous != null) return _previous.createFile(path);
+    if (_createFile != null) return _createFile!(path);
+    if (_previous != null) return _previous!.createFile(path);
     return super.createFile(path);
   }
 
   // FileStat
   @override
   Future<FileStat> stat(String path) {
-    if (_stat != null) return _stat(path);
-    if (_previous != null) return _previous.stat(path);
+    if (_stat != null) return _stat!(path);
+    if (_previous != null) return _previous!.stat(path);
     return super.stat(path);
   }
 
   @override
   FileStat statSync(String path) {
-    if (_stat != null) return _statSync(path);
-    if (_previous != null) return _previous.statSync(path);
+    if (_stat != null) return _statSync!(path);
+    if (_previous != null) return _previous!.statSync(path);
     return super.statSync(path);
   }
 
   // FileSystemEntity
   @override
   Future<bool> fseIdentical(String path1, String path2) {
-    if (_fseIdentical != null) return _fseIdentical(path1, path2);
-    if (_previous != null) return _previous.fseIdentical(path1, path2);
+    if (_fseIdentical != null) return _fseIdentical!(path1, path2);
+    if (_previous != null) return _previous!.fseIdentical(path1, path2);
     return super.fseIdentical(path1, path2);
   }
 
   @override
   bool fseIdenticalSync(String path1, String path2) {
-    if (_fseIdenticalSync != null) return _fseIdenticalSync(path1, path2);
-    if (_previous != null) return _previous.fseIdenticalSync(path1, path2);
+    if (_fseIdenticalSync != null) return _fseIdenticalSync!(path1, path2);
+    if (_previous != null) return _previous!.fseIdenticalSync(path1, path2);
     return super.fseIdenticalSync(path1, path2);
   }
 
   @override
   Future<FileSystemEntityType> fseGetType(String path, bool followLinks) {
-    if (_fseGetType != null) return _fseGetType(path, followLinks);
-    if (_previous != null) return _previous.fseGetType(path, followLinks);
+    if (_fseGetType != null) return _fseGetType!(path, followLinks);
+    if (_previous != null) return _previous!.fseGetType(path, followLinks);
     return super.fseGetType(path, followLinks);
   }
 
   @override
   FileSystemEntityType fseGetTypeSync(String path, bool followLinks) {
-    if (_fseGetTypeSync != null) return _fseGetTypeSync(path, followLinks);
-    if (_previous != null) return _previous.fseGetTypeSync(path, followLinks);
+    if (_fseGetTypeSync != null) return _fseGetTypeSync!(path, followLinks);
+    if (_previous != null) return _previous!.fseGetTypeSync(path, followLinks);
     return super.fseGetTypeSync(path, followLinks);
   }
 
   // _FileSystemWatcher
   @override
   Stream<FileSystemEvent> fsWatch(String path, int events, bool recursive) {
-    if (_fsWatch != null) return _fsWatch(path, events, recursive);
-    if (_previous != null) return _previous.fsWatch(path, events, recursive);
+    if (_fsWatch != null) return _fsWatch!(path, events, recursive);
+    if (_previous != null) return _previous!.fsWatch(path, events, recursive);
     return super.fsWatch(path, events, recursive);
   }
 
   @override
   bool fsWatchIsSupported() {
-    if (_fsWatchIsSupported != null) return _fsWatchIsSupported();
-    if (_previous != null) return _previous.fsWatchIsSupported();
+    if (_fsWatchIsSupported != null) return _fsWatchIsSupported!();
+    if (_previous != null) return _previous!.fsWatchIsSupported();
     return super.fsWatchIsSupported();
   }
 
   // Link
   @override
   Link createLink(String path) {
-    if (_createLink != null) return _createLink(path);
-    if (_previous != null) return _previous.createLink(path);
+    if (_createLink != null) return _createLink!(path);
+    if (_previous != null) return _previous!.createLink(path);
     return super.createLink(path);
   }
 
   // Socket
   @override
   Future<Socket> socketConnect(host, int port,
-      {sourceAddress, Duration timeout}) {
+      {sourceAddress, Duration? timeout}) {
     if (_socketConnect != null) {
-      return _socketConnect(host, port,
+      return _socketConnect!(host, port,
           sourceAddress: sourceAddress, timeout: timeout);
     }
     if (_previous != null) {
-      return _previous.socketConnect(host, port,
+      return _previous!.socketConnect(host, port,
           sourceAddress: sourceAddress, timeout: timeout);
     }
     return super.socketConnect(host, port,
@@ -489,11 +489,11 @@
   Future<ConnectionTask<Socket>> socketStartConnect(host, int port,
       {sourceAddress}) {
     if (_socketStartConnect != null) {
-      return _socketStartConnect(host, port, sourceAddress: sourceAddress);
+      return _socketStartConnect!(host, port, sourceAddress: sourceAddress);
     }
     if (_previous != null) {
-      return _previous.socketStartConnect(host, port,
-          sourceAddress: sourceAddress);
+      return _previous!
+          .socketStartConnect(host, port, sourceAddress: sourceAddress);
     }
     return super.socketStartConnect(host, port, sourceAddress: sourceAddress);
   }
@@ -503,11 +503,11 @@
   Future<ServerSocket> serverSocketBind(address, int port,
       {int backlog: 0, bool v6Only: false, bool shared: false}) {
     if (_serverSocketBind != null) {
-      return _serverSocketBind(address, port,
+      return _serverSocketBind!(address, port,
           backlog: backlog, v6Only: v6Only, shared: shared);
     }
     if (_previous != null) {
-      return _previous.serverSocketBind(address, port,
+      return _previous!.serverSocketBind(address, port,
           backlog: backlog, v6Only: v6Only, shared: shared);
     }
     return super.serverSocketBind(address, port,
diff --git a/sdk/lib/io/platform.dart b/sdk/lib/io/platform.dart
index 7fd53c8..412e258 100644
--- a/sdk/lib/io/platform.dart
+++ b/sdk/lib/io/platform.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.6
-
 part of dart.io;
 
 /**
@@ -210,7 +208,7 @@
    *
    */
   @Deprecated('packages/ directory resolution is not supported in Dart 2')
-  static String get packageRoot => null; // TODO(mfairhurst): remove this
+  static String? get packageRoot => null; // TODO(mfairhurst): remove this
 
   /**
    * The `--packages` flag passed to the executable used to run the script
@@ -220,7 +218,7 @@
    *
    * Is `null` if there is no `--packages` flag.
    */
-  static String get packageConfig => _Platform.packageConfig;
+  static String? get packageConfig => _Platform.packageConfig;
 
   /**
    * The version of the current Dart runtime.
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart
index 8705697..0251445 100644
--- a/sdk/lib/io/platform_impl.dart
+++ b/sdk/lib/io/platform_impl.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.6
-
 part of dart.io;
 
 class _Platform {
@@ -32,21 +30,19 @@
    */
   external static _environment();
   external static List<String> _executableArguments();
-  external static String _packageRoot(); // TODO(mfairhurst): remove this
-  external static String _packageConfig();
+  external static String? _packageConfig();
   external static String _version();
   external static String _localeName();
   external static Uri _script();
 
   static String executable = _executable();
   static String resolvedExecutable = _resolvedExecutable();
-  static String packageRoot; // TODO(mfairhurst): remove this
-  static String packageConfig = _packageConfig();
+  static String? packageConfig = _packageConfig();
 
   @pragma("vm:entry-point")
-  static String Function() _localeClosure;
+  static String Function()? _localeClosure;
   static String localeName() {
-    final result = (_localeClosure == null) ? _localeName() : _localeClosure();
+    final result = (_localeClosure == null) ? _localeName() : _localeClosure!();
     if (result is OSError) {
       throw result;
     }
@@ -55,14 +51,14 @@
 
   // Cache the OS environment. This can be an OSError instance if
   // retrieving the environment failed.
-  static var /*OSError|Map<String,String>*/ _environmentCache;
+  static var /*OSError?|Map<String,String>?*/ _environmentCache;
 
   static int get numberOfProcessors => _numberOfProcessors();
   static String get pathSeparator => _pathSeparator();
   static String get operatingSystem => _operatingSystem();
   static Uri get script => _script();
 
-  static String _cachedOSVersion;
+  static String? _cachedOSVersion;
   static String get operatingSystemVersion {
     if (_cachedOSVersion == null) {
       var result = _operatingSystemVersion();
@@ -71,7 +67,7 @@
       }
       _cachedOSVersion = result;
     }
-    return _cachedOSVersion;
+    return _cachedOSVersion!;
   }
 
   static String get localHostname {
@@ -116,7 +112,7 @@
     if (_environmentCache is OSError) {
       throw _environmentCache;
     } else {
-      return _environmentCache;
+      return _environmentCache!;
     }
   }
 
@@ -128,10 +124,10 @@
 class _CaseInsensitiveStringMap<V> extends MapBase<String, V> {
   final Map<String, V> _map = new Map<String, V>();
 
-  bool containsKey(Object key) =>
+  bool containsKey(Object? key) =>
       key is String && _map.containsKey(key.toUpperCase());
-  bool containsValue(Object value) => _map.containsValue(value);
-  V operator [](Object key) => key is String ? _map[key.toUpperCase()] : null;
+  bool containsValue(Object? value) => _map.containsValue(value);
+  V? operator [](Object? key) => key is String ? _map[key.toUpperCase()] : null;
   void operator []=(String key, V value) {
     _map[key.toUpperCase()] = value;
   }
@@ -144,7 +140,8 @@
     other.forEach((key, value) => this[key.toUpperCase()] = value);
   }
 
-  V remove(Object key) => key is String ? _map.remove(key.toUpperCase()) : null;
+  V? remove(Object? key) =>
+      key is String ? _map.remove(key.toUpperCase()) : null;
 
   void clear() {
     _map.clear();
@@ -165,7 +162,7 @@
   Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(String key, V value)) =>
       _map.map(transform);
 
-  V update(String key, V update(V value), {V ifAbsent()}) =>
+  V update(String key, V update(V value), {V ifAbsent()?}) =>
       _map.update(key.toUpperCase(), update, ifAbsent: ifAbsent);
 
   void updateAll(V update(String key, V value)) {
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index d9fad38..e0d0b15 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -2,18 +2,16 @@
 // 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.6
-
 part of dart.io;
 
 // TODO(ager): The only reason for this class is that we
 // cannot patch a top-level at this point.
 class _ProcessUtils {
-  external static void _exit(int status);
+  external static Never _exit(int status);
   external static void _setExitCode(int status);
   external static int _getExitCode();
   external static void _sleep(int millis);
-  external static int _pid(Process process);
+  external static int _pid(Process? process);
   external static Stream<ProcessSignal> _watchSignal(ProcessSignal signal);
 }
 
@@ -51,7 +49,7 @@
  * program to the surrounding environment. This will avoid any
  * cross-platform issues.
  */
-void exit(int code) {
+Never exit(int code) {
   ArgumentError.checkNotNull(code, "code");
   if (!_EmbedderConfig._mayExit) {
     throw new UnsupportedError(
@@ -363,8 +361,8 @@
    */
   external static Future<Process> start(
       String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
       ProcessStartMode mode: ProcessStartMode.normal});
@@ -412,12 +410,12 @@
    */
   external static Future<ProcessResult> run(
       String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
-      Encoding stdoutEncoding: systemEncoding,
-      Encoding stderrEncoding: systemEncoding});
+      Encoding? stdoutEncoding: systemEncoding,
+      Encoding? stderrEncoding: systemEncoding});
 
   /**
    * Starts a process and runs it to completion. This is a synchronous
@@ -430,12 +428,12 @@
    */
   external static ProcessResult runSync(
       String executable, List<String> arguments,
-      {String workingDirectory,
-      Map<String, String> environment,
+      {String? workingDirectory,
+      Map<String, String>? environment,
       bool includeParentEnvironment: true,
       bool runInShell: false,
-      Encoding stdoutEncoding: systemEncoding,
-      Encoding stderrEncoding: systemEncoding});
+      Encoding? stdoutEncoding: systemEncoding,
+      Encoding? stderrEncoding: systemEncoding});
 
   /**
    * Kills the process with id [pid].
@@ -695,8 +693,7 @@
   const ProcessException(this.executable, this.arguments,
       [this.message = "", this.errorCode = 0]);
   String toString() {
-    var msg = (message == null) ? 'OS error code: $errorCode' : message;
     var args = arguments.join(' ');
-    return "ProcessException: $msg\n  Command: $executable $args";
+    return "ProcessException: $message\n  Command: $executable $args";
   }
 }
diff --git a/sdk/lib/io/secure_server_socket.dart b/sdk/lib/io/secure_server_socket.dart
index f21b4a27..dbdcc28 100644
--- a/sdk/lib/io/secure_server_socket.dart
+++ b/sdk/lib/io/secure_server_socket.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.6
-
 part of dart.io;
 
 /**
@@ -69,15 +67,14 @@
    * isolates this way.
    */
   static Future<SecureServerSocket> bind(
-      address, int port, SecurityContext context,
+      address, int port, SecurityContext? context,
       {int backlog: 0,
       bool v6Only: false,
       bool requestClientCertificate: false,
       bool requireClientCertificate: false,
-      List<String> supportedProtocols,
+      List<String>? supportedProtocols,
       bool shared: false}) {
-    return RawSecureServerSocket
-        .bind(address, port, context,
+    return RawSecureServerSocket.bind(address, port, context,
             backlog: backlog,
             v6Only: v6Only,
             requestClientCertificate: requestClientCertificate,
@@ -87,8 +84,8 @@
         .then((serverSocket) => new SecureServerSocket._(serverSocket));
   }
 
-  StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _socket.map((rawSocket) => new SecureSocket._(rawSocket)).listen(
         onData,
         onError: onError,
@@ -125,12 +122,12 @@
  */
 class RawSecureServerSocket extends Stream<RawSecureSocket> {
   final RawServerSocket _socket;
-  StreamController<RawSecureSocket> _controller;
-  StreamSubscription<RawSocket> _subscription;
-  final SecurityContext _context;
+  late StreamController<RawSecureSocket> _controller;
+  StreamSubscription<RawSocket>? _subscription;
+  final SecurityContext? _context;
   final bool requestClientCertificate;
   final bool requireClientCertificate;
-  final List<String> supportedProtocols;
+  final List<String>? supportedProtocols;
   bool _closed = false;
 
   RawSecureServerSocket._(
@@ -198,15 +195,15 @@
    * multiple isolates this way.
    */
   static Future<RawSecureServerSocket> bind(
-      address, int port, SecurityContext context,
+      address, int port, SecurityContext? context,
       {int backlog: 0,
       bool v6Only: false,
       bool requestClientCertificate: false,
       bool requireClientCertificate: false,
-      List<String> supportedProtocols,
+      List<String>? supportedProtocols,
       bool shared: false}) {
-    return RawServerSocket
-        .bind(address, port, backlog: backlog, v6Only: v6Only, shared: shared)
+    return RawServerSocket.bind(address, port,
+            backlog: backlog, v6Only: v6Only, shared: shared)
         .then((serverSocket) => new RawSecureServerSocket._(
             serverSocket,
             context,
@@ -215,8 +212,8 @@
             supportedProtocols));
   }
 
-  StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -249,11 +246,8 @@
       // Do nothing - connection is closed.
       return;
     }
-    _RawSecureSocket
-        .connect(connection.address, remotePort,
+    _RawSecureSocket.connect(connection.address, remotePort, true, connection,
             context: _context,
-            is_server: true,
-            socket: connection,
             requestClientCertificate: requestClientCertificate,
             requireClientCertificate: requireClientCertificate,
             supportedProtocols: supportedProtocols)
@@ -272,9 +266,9 @@
 
   void _onPauseStateChange() {
     if (_controller.isPaused) {
-      _subscription.pause();
+      _subscription!.pause();
     } else {
-      _subscription.resume();
+      _subscription!.resume();
     }
   }
 
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index efec0b3..08e9bf7 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.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.6
-
 part of dart.io;
 
 /**
@@ -44,10 +42,10 @@
 
    */
   static Future<SecureSocket> connect(host, int port,
-      {SecurityContext context,
-      bool onBadCertificate(X509Certificate certificate),
-      List<String> supportedProtocols,
-      Duration timeout}) {
+      {SecurityContext? context,
+      bool onBadCertificate(X509Certificate certificate)?,
+      List<String>? supportedProtocols,
+      Duration? timeout}) {
     return RawSecureSocket.connect(host, port,
             context: context,
             onBadCertificate: onBadCertificate,
@@ -60,9 +58,9 @@
   /// [ConnectionTask] that can be cancelled if the [SecureSocket] is no
   /// longer needed.
   static Future<ConnectionTask<SecureSocket>> startConnect(host, int port,
-      {SecurityContext context,
-      bool onBadCertificate(X509Certificate certificate),
-      List<String> supportedProtocols}) {
+      {SecurityContext? context,
+      bool onBadCertificate(X509Certificate certificate)?,
+      List<String>? supportedProtocols}) {
     return RawSecureSocket.startConnect(host, port,
             context: context,
             onBadCertificate: onBadCertificate,
@@ -70,8 +68,7 @@
         .then((rawState) {
       Future<SecureSocket> socket =
           rawState.socket.then((rawSocket) => new SecureSocket._(rawSocket));
-      return new ConnectionTask<SecureSocket>._(
-          socket: socket, onCancel: rawState._onCancel);
+      return new ConnectionTask<SecureSocket>._(socket, rawState._onCancel);
     });
   }
 
@@ -110,13 +107,13 @@
    */
   static Future<SecureSocket> secure(Socket socket,
       {host,
-      SecurityContext context,
-      bool onBadCertificate(X509Certificate certificate),
-      @Since("2.6") List<String> supportedProtocols}) {
+      SecurityContext? context,
+      bool onBadCertificate(X509Certificate certificate)?,
+      @Since("2.6") List<String>? supportedProtocols}) {
     return ((socket as dynamic /*_Socket*/)._detachRaw() as Future)
         .then<RawSecureSocket>((detachedRaw) {
       return RawSecureSocket.secure(detachedRaw[0] as RawSocket,
-          subscription: detachedRaw[1] as StreamSubscription<RawSocketEvent>,
+          subscription: detachedRaw[1] as StreamSubscription<RawSocketEvent>?,
           host: host,
           context: context,
           onBadCertificate: onBadCertificate,
@@ -146,15 +143,15 @@
    *
    */
   static Future<SecureSocket> secureServer(
-      Socket socket, SecurityContext context,
-      {List<int> bufferedData,
+      Socket socket, SecurityContext? context,
+      {List<int>? bufferedData,
       bool requestClientCertificate: false,
       bool requireClientCertificate: false,
-      List<String> supportedProtocols}) {
+      List<String>? supportedProtocols}) {
     return ((socket as dynamic /*_Socket*/)._detachRaw() as Future)
         .then<RawSecureSocket>((detachedRaw) {
       return RawSecureSocket.secureServer(detachedRaw[0] as RawSocket, context,
-          subscription: detachedRaw[1] as StreamSubscription<RawSocketEvent>,
+          subscription: detachedRaw[1] as StreamSubscription<RawSocketEvent>?,
           bufferedData: bufferedData,
           requestClientCertificate: requestClientCertificate,
           requireClientCertificate: requireClientCertificate,
@@ -169,7 +166,7 @@
    * client certificate was received.  If it is the client end,
    * [peerCertificate] will return the server's certificate.
    */
-  X509Certificate get peerCertificate;
+  X509Certificate? get peerCertificate;
 
   /**
    * The protocol which was selected during ALPN protocol negotiation.
@@ -178,7 +175,7 @@
    * specify a list of supported ALPN protocols or there was no common
    * protocol between client and server.
    */
-  String get selectedProtocol;
+  String? get selectedProtocol;
 
   /**
    * Renegotiate an existing secure connection, renewing the session keys
@@ -228,12 +225,11 @@
    * can be obtained via [RawSecureSocket.selectedProtocol].
    */
   static Future<RawSecureSocket> connect(host, int port,
-      {SecurityContext context,
-      bool onBadCertificate(X509Certificate certificate),
-      List<String> supportedProtocols,
-      Duration timeout}) {
-    _RawSecureSocket._verifyFields(
-        host, port, false, false, false, onBadCertificate);
+      {SecurityContext? context,
+      bool onBadCertificate(X509Certificate certificate)?,
+      List<String>? supportedProtocols,
+      Duration? timeout}) {
+    _RawSecureSocket._verifyFields(host, port, false, false);
     return RawSocket.connect(host, port, timeout: timeout).then((socket) {
       return secure(socket,
           context: context,
@@ -246,9 +242,9 @@
   /// [ConnectionTask] that can be cancelled if the [RawSecureSocket] is no
   /// longer needed.
   static Future<ConnectionTask<RawSecureSocket>> startConnect(host, int port,
-      {SecurityContext context,
-      bool onBadCertificate(X509Certificate certificate),
-      List<String> supportedProtocols}) {
+      {SecurityContext? context,
+      bool onBadCertificate(X509Certificate certificate)?,
+      List<String>? supportedProtocols}) {
     return RawSocket.startConnect(host, port)
         .then((ConnectionTask<RawSocket> rawState) {
       Future<RawSecureSocket> socket = rawState.socket.then((rawSocket) {
@@ -257,8 +253,7 @@
             onBadCertificate: onBadCertificate,
             supportedProtocols: supportedProtocols);
       });
-      return new ConnectionTask<RawSecureSocket>._(
-          socket: socket, onCancel: rawState._onCancel);
+      return new ConnectionTask<RawSecureSocket>._(socket, rawState._onCancel);
     });
   }
 
@@ -296,17 +291,15 @@
    *
    */
   static Future<RawSecureSocket> secure(RawSocket socket,
-      {StreamSubscription<RawSocketEvent> subscription,
+      {StreamSubscription<RawSocketEvent>? subscription,
       host,
-      SecurityContext context,
-      bool onBadCertificate(X509Certificate certificate),
-      List<String> supportedProtocols}) {
+      SecurityContext? context,
+      bool onBadCertificate(X509Certificate certificate)?,
+      List<String>? supportedProtocols}) {
     socket.readEventsEnabled = false;
     socket.writeEventsEnabled = false;
     return _RawSecureSocket.connect(
-        host != null ? host : socket.address.host, socket.port,
-        is_server: false,
-        socket: socket,
+        host != null ? host : socket.address.host, socket.port, false, socket,
         subscription: subscription,
         context: context,
         onBadCertificate: onBadCertificate,
@@ -337,18 +330,17 @@
    *
    */
   static Future<RawSecureSocket> secureServer(
-      RawSocket socket, SecurityContext context,
-      {StreamSubscription<RawSocketEvent> subscription,
-      List<int> bufferedData,
+      RawSocket socket, SecurityContext? context,
+      {StreamSubscription<RawSocketEvent>? subscription,
+      List<int>? bufferedData,
       bool requestClientCertificate: false,
       bool requireClientCertificate: false,
-      List<String> supportedProtocols}) {
+      List<String>? supportedProtocols}) {
     socket.readEventsEnabled = false;
     socket.writeEventsEnabled = false;
-    return _RawSecureSocket.connect(socket.address, socket.remotePort,
+    return _RawSecureSocket.connect(
+        socket.address, socket.remotePort, true, socket,
         context: context,
-        is_server: true,
-        socket: socket,
         subscription: subscription,
         bufferedData: bufferedData,
         requestClientCertificate: requestClientCertificate,
@@ -375,7 +367,7 @@
    * client certificate was received.  If it is the client end,
    * [peerCertificate] will return the server's certificate.
    */
-  X509Certificate get peerCertificate;
+  X509Certificate? get peerCertificate;
 
   /**
    * The protocol which was selected during protocol negotiation.
@@ -384,7 +376,7 @@
    * specify a list of supported ALPN protocols or there was no common
    * protocol between client and server.
    */
-  String get selectedProtocol;
+  String? get selectedProtocol;
 }
 
 /**
@@ -443,20 +435,19 @@
   static bool _isBufferEncrypted(int identifier) =>
       identifier >= readEncryptedId;
 
-  RawSocket _socket;
+  final RawSocket _socket;
   final Completer<_RawSecureSocket> _handshakeComplete =
       new Completer<_RawSecureSocket>();
-  StreamController<RawSocketEvent> _controller;
-  Stream<RawSocketEvent> _stream;
-  StreamSubscription<RawSocketEvent> _socketSubscription;
-  List<int> _bufferedData;
+  final _controller = new StreamController<RawSocketEvent>(sync: true);
+  late final StreamSubscription<RawSocketEvent> _socketSubscription;
+  List<int>? _bufferedData;
   int _bufferedDataIndex = 0;
   final InternetAddress address;
-  final bool is_server;
-  SecurityContext context;
+  final bool isServer;
+  final SecurityContext context;
   final bool requestClientCertificate;
   final bool requireClientCertificate;
-  final Function onBadCertificate;
+  final bool Function(X509Certificate certificate)? onBadCertificate;
 
   var _status = handshakeStatus;
   bool _writeEventsEnabled = true;
@@ -474,22 +465,23 @@
   bool _filterPending = false;
   bool _filterActive = false;
 
-  _SecureFilter _secureFilter = new _SecureFilter._();
-  String _selectedProtocol;
+  _SecureFilter? _secureFilter = new _SecureFilter._();
+  String? _selectedProtocol;
 
   static Future<_RawSecureSocket> connect(
-      dynamic /*String|InternetAddress*/ host, int requestedPort,
-      {bool is_server,
-      SecurityContext context,
+      dynamic /*String|InternetAddress*/ host,
+      int requestedPort,
+      bool isServer,
       RawSocket socket,
-      StreamSubscription<RawSocketEvent> subscription,
-      List<int> bufferedData,
+      {SecurityContext? context,
+      StreamSubscription<RawSocketEvent>? subscription,
+      List<int>? bufferedData,
       bool requestClientCertificate: false,
       bool requireClientCertificate: false,
-      bool onBadCertificate(X509Certificate certificate),
-      List<String> supportedProtocols}) {
-    _verifyFields(host, requestedPort, is_server, requestClientCertificate,
-        requireClientCertificate, onBadCertificate);
+      bool onBadCertificate(X509Certificate certificate)?,
+      List<String>? supportedProtocols}) {
+    _verifyFields(host, requestedPort, requestClientCertificate,
+        requireClientCertificate);
     if (host is InternetAddress) host = host.host;
     InternetAddress address = socket.address;
     if (host != null) {
@@ -498,8 +490,8 @@
     return new _RawSecureSocket(
             address,
             requestedPort,
-            is_server,
-            context,
+            isServer,
+            context ?? SecurityContext.defaultContext,
             socket,
             subscription,
             bufferedData,
@@ -514,39 +506,38 @@
   _RawSecureSocket(
       this.address,
       int requestedPort,
-      this.is_server,
+      this.isServer,
       this.context,
       this._socket,
-      this._socketSubscription,
+      StreamSubscription<RawSocketEvent>? subscription,
       this._bufferedData,
       this.requestClientCertificate,
       this.requireClientCertificate,
       this.onBadCertificate,
-      List<String> supportedProtocols) {
-    context ??= SecurityContext.defaultContext;
-    _controller = new StreamController<RawSocketEvent>(
-        sync: true,
-        onListen: _onSubscriptionStateChange,
-        onPause: _onPauseStateChange,
-        onResume: _onPauseStateChange,
-        onCancel: _onSubscriptionStateChange);
-    _stream = _controller.stream;
+      List<String>? supportedProtocols) {
+    _controller
+      ..onListen = _onSubscriptionStateChange
+      ..onPause = _onPauseStateChange
+      ..onResume = _onPauseStateChange
+      ..onCancel = _onSubscriptionStateChange;
     // Throw an ArgumentError if any field is invalid.  After this, all
     // errors will be reported through the future or the stream.
-    _secureFilter.init();
-    _secureFilter
+    final secureFilter = _secureFilter!;
+    secureFilter.init();
+    secureFilter
         .registerHandshakeCompleteCallback(_secureHandshakeCompleteHandler);
     if (onBadCertificate != null) {
-      _secureFilter.registerBadCertificateCallback(_onBadCertificateWrapper);
+      secureFilter.registerBadCertificateCallback(_onBadCertificateWrapper);
     }
     _socket.readEventsEnabled = true;
     _socket.writeEventsEnabled = false;
-    if (_socketSubscription == null) {
+    if (subscription == null) {
       // If a current subscription is provided use this otherwise
       // create a new one.
       _socketSubscription = _socket.listen(_eventDispatcher,
           onError: _reportError, onDone: _doneHandler);
     } else {
+      _socketSubscription = subscription;
       if (_socketSubscription.isPaused) {
         _socket.close();
         throw new ArgumentError("Subscription passed to TLS upgrade is paused");
@@ -565,10 +556,10 @@
     try {
       var encodedProtocols =
           SecurityContext._protocolsToLengthEncoding(supportedProtocols);
-      _secureFilter.connect(
+      secureFilter.connect(
           address.host,
           context,
-          is_server,
+          isServer,
           requestClientCertificate || requireClientCertificate,
           requireClientCertificate,
           encodedProtocols);
@@ -578,27 +569,24 @@
     }
   }
 
-  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent data),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent data)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     _sendWriteEvent();
-    return _stream.listen(onData,
+    return _controller.stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
 
-  static void _verifyFields(
-      host,
-      int requestedPort,
-      bool is_server,
-      bool requestClientCertificate,
-      bool requireClientCertificate,
-      Function onBadCertificate) {
+  static void _verifyFields(host, int requestedPort,
+      bool requestClientCertificate, bool requireClientCertificate) {
     if (host is! String && host is! InternetAddress) {
       throw new ArgumentError("host is not a String or an InternetAddress");
     }
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(requestedPort, "requestedPort");
     if (requestedPort < 0 || requestedPort > 65535) {
       throw ArgumentError("requestedPort is not in the range 0..65535");
     }
+    // TODO(40614): Remove once non-nullability is sound.
     ArgumentError.checkNotNull(
         requestClientCertificate, "requestClientCertificate");
     ArgumentError.checkNotNull(
@@ -618,7 +606,7 @@
   int available() {
     return _status != connectedStatus
         ? 0
-        : _secureFilter.buffers[readPlaintextId].length;
+        : _secureFilter!.buffers![readPlaintextId].length;
   }
 
   Future<RawSecureSocket> close() {
@@ -626,22 +614,18 @@
     return _closeCompleter.future;
   }
 
-  void _completeCloseCompleter([RawSocket dummy]) {
+  void _completeCloseCompleter([RawSocket? dummy]) {
     if (!_closeCompleter.isCompleted) _closeCompleter.complete(this);
   }
 
   void _close() {
     _closedWrite = true;
     _closedRead = true;
-    if (_socket != null) {
-      _socket.close().then(_completeCloseCompleter);
-    } else {
-      _completeCloseCompleter();
-    }
+    _socket.close().then(_completeCloseCompleter);
     _socketClosedWrite = true;
     _socketClosedRead = true;
     if (!_filterActive && _secureFilter != null) {
-      _secureFilter.destroy();
+      _secureFilter!.destroy();
       _secureFilter = null;
     }
     if (_socketSubscription != null) {
@@ -690,8 +674,8 @@
     _scheduleReadEvent();
   }
 
-  Uint8List read([int length]) {
-    if (length != null && (length is! int || length < 0)) {
+  Uint8List? read([int? length]) {
+    if (length != null && length < 0) {
       throw new ArgumentError(
           "Invalid length parameter in SecureSocket.read (length: $length)");
     }
@@ -701,18 +685,22 @@
     if (_status != connectedStatus) {
       return null;
     }
-    var result = _secureFilter.buffers[readPlaintextId].read(length);
+    var result = _secureFilter!.buffers![readPlaintextId].read(length);
     _scheduleFilter();
     return result;
   }
 
+  static int _fixOffset(int? offset) => offset ?? 0;
+
   // Write the data to the socket, and schedule the filter to encrypt it.
-  int write(List<int> data, [int offset, int bytes]) {
-    if (bytes != null && (bytes is! int || bytes < 0)) {
+  int write(List<int> data, [int offset = 0, int? bytes]) {
+    if (bytes != null && bytes < 0) {
       throw new ArgumentError(
           "Invalid bytes parameter in SecureSocket.read (bytes: $bytes)");
     }
-    if (offset != null && (offset is! int || offset < 0)) {
+    // TODO(40614): Remove once non-nullability is sound.
+    offset = _fixOffset(offset);
+    if (offset < 0) {
       throw new ArgumentError(
           "Invalid offset parameter in SecureSocket.read (offset: $offset)");
     }
@@ -721,11 +709,10 @@
       return 0;
     }
     if (_status != connectedStatus) return 0;
-    offset ??= 0;
     bytes ??= data.length - offset;
 
     int written =
-        _secureFilter.buffers[writePlaintextId].write(data, offset, bytes);
+        _secureFilter!.buffers![writePlaintextId].write(data, offset, bytes);
     if (written > 0) {
       _filterStatus.writeEmpty = false;
     }
@@ -733,29 +720,25 @@
     return written;
   }
 
-  X509Certificate get peerCertificate => _secureFilter.peerCertificate;
+  X509Certificate? get peerCertificate => _secureFilter!.peerCertificate;
 
-  String get selectedProtocol => _selectedProtocol;
+  String? get selectedProtocol => _selectedProtocol;
 
   bool _onBadCertificateWrapper(X509Certificate certificate) {
     if (onBadCertificate == null) return false;
-    var result = onBadCertificate(certificate);
-    if (result is bool) return result;
-    throw new HandshakeException(
-        "onBadCertificate callback returned non-boolean $result");
+    return onBadCertificate!(certificate);
   }
 
   bool setOption(SocketOption option, bool enabled) {
-    if (_socket == null) return false;
     return _socket.setOption(option, enabled);
   }
 
   Uint8List getRawOption(RawSocketOption option) {
-    return _socket?.getRawOption(option);
+    return _socket.getRawOption(option);
   }
 
   void setRawOption(RawSocketOption option) {
-    _socket?.setRawOption(option);
+    _socket.setRawOption(option);
   }
 
   void _eventDispatcher(RawSocketEvent event) {
@@ -788,7 +771,7 @@
     }
   }
 
-  void _reportError(e, [StackTrace stackTrace]) {
+  void _reportError(e, [StackTrace? stackTrace]) {
     if (_status == closedStatus) {
       return;
     } else if (_connectPending) {
@@ -829,7 +812,7 @@
 
   void _secureHandshake() {
     try {
-      _secureFilter.handshake();
+      _secureFilter!.handshake();
       _filterStatus.writeEmpty = false;
       _readSocket();
       _writeSocket();
@@ -847,7 +830,7 @@
       throw new HandshakeException(
           "Called renegotiate on a non-connected socket");
     }
-    _secureFilter.renegotiate(
+    _secureFilter!.renegotiate(
         useSessionCache, requestClientCertificate, requireClientCertificate);
     _status = handshakeStatus;
     _filterStatus.writeEmpty = false;
@@ -859,7 +842,7 @@
     if (_connectPending) {
       _connectPending = false;
       try {
-        _selectedProtocol = _secureFilter.selectedProtocol();
+        _selectedProtocol = _secureFilter!.selectedProtocol();
         // We don't want user code to run synchronously in this callback.
         Timer.run(() => _handshakeComplete.complete(this));
       } catch (error, stack) {
@@ -910,7 +893,7 @@
         _filterStatus = status;
         _filterActive = false;
         if (_status == closedStatus) {
-          _secureFilter.destroy();
+          _secureFilter!.destroy();
           _secureFilter = null;
           return;
         }
@@ -924,7 +907,7 @@
         }
         if (_filterStatus.readEmpty && _socketClosedRead && !_closedRead) {
           if (_status == handshakeStatus) {
-            _secureFilter.handshake();
+            _secureFilter!.handshake();
             if (_status == handshakeStatus) {
               throw new HandshakeException(
                   'Connection terminated during handshake');
@@ -958,15 +941,16 @@
     }
   }
 
-  List<int> _readSocketOrBufferedData(int bytes) {
-    if (_bufferedData != null) {
-      if (bytes > _bufferedData.length - _bufferedDataIndex) {
-        bytes = _bufferedData.length - _bufferedDataIndex;
+  List<int>? _readSocketOrBufferedData(int bytes) {
+    final bufferedData = _bufferedData;
+    if (bufferedData != null) {
+      if (bytes > bufferedData.length - _bufferedDataIndex) {
+        bytes = bufferedData.length - _bufferedDataIndex;
       }
       var result =
-          _bufferedData.sublist(_bufferedDataIndex, _bufferedDataIndex + bytes);
+          bufferedData.sublist(_bufferedDataIndex, _bufferedDataIndex + bytes);
       _bufferedDataIndex += bytes;
-      if (_bufferedData.length == _bufferedDataIndex) {
+      if (bufferedData.length == _bufferedDataIndex) {
         _bufferedData = null;
       }
       return result;
@@ -979,7 +963,7 @@
 
   void _readSocket() {
     if (_status == closedStatus) return;
-    var buffer = _secureFilter.buffers[readEncryptedId];
+    var buffer = _secureFilter!.buffers![readEncryptedId];
     if (buffer.writeFromSource(_readSocketOrBufferedData) > 0) {
       _filterStatus.readEmpty = false;
     } else {
@@ -989,7 +973,7 @@
 
   void _writeSocket() {
     if (_socketClosedWrite) return;
-    var buffer = _secureFilter.buffers[writeEncryptedId];
+    var buffer = _secureFilter!.buffers![writeEncryptedId];
     if (buffer.readToSocket(_socket)) {
       // Returns true if blocked
       _socket.writeEventsEnabled = true;
@@ -1002,7 +986,7 @@
         _readEventsEnabled &&
         _pauseCount == 0 &&
         _secureFilter != null &&
-        !_secureFilter.buffers[readPlaintextId].isEmpty) {
+        !_secureFilter!.buffers![readPlaintextId].isEmpty) {
       _pendingReadEvent = true;
       Timer.run(_sendReadEvent);
     }
@@ -1014,7 +998,7 @@
         _readEventsEnabled &&
         _pauseCount == 0 &&
         _secureFilter != null &&
-        !_secureFilter.buffers[readPlaintextId].isEmpty) {
+        !_secureFilter!.buffers![readPlaintextId].isEmpty) {
       _controller.add(RawSocketEvent.read);
       _scheduleReadEvent();
     }
@@ -1026,7 +1010,7 @@
         _writeEventsEnabled &&
         _pauseCount == 0 &&
         _secureFilter != null &&
-        _secureFilter.buffers[writePlaintextId].free > 0) {
+        _secureFilter!.buffers![writePlaintextId].free > 0) {
       _writeEventsEnabled = false;
       _controller.add(RawSocketEvent.write);
     }
@@ -1034,10 +1018,10 @@
 
   Future<_FilterStatus> _pushAllFilterStages() {
     bool wasInHandshake = _status != connectedStatus;
-    List args = new List(2 + bufferCount * 2);
-    args[0] = _secureFilter._pointer();
+    List args = new List<dynamic>.filled(2 + bufferCount * 2, null);
+    args[0] = _secureFilter!._pointer();
     args[1] = wasInHandshake;
-    var bufs = _secureFilter.buffers;
+    var bufs = _secureFilter!.buffers!;
     for (var i = 0; i < bufferCount; ++i) {
       args[2 * i + 2] = bufs[i].start;
       args[2 * i + 3] = bufs[i].end;
@@ -1123,7 +1107,7 @@
 class _ExternalBuffer {
   // This will be an ExternalByteArray, backed by C allocated data.
   @pragma("vm:entry-point", "set")
-  List<int> data;
+  List<int>? data;
 
   @pragma("vm:entry-point")
   int start;
@@ -1131,11 +1115,12 @@
   @pragma("vm:entry-point")
   int end;
 
-  final size;
+  final int size;
 
-  _ExternalBuffer(this.size) {
-    start = end = size ~/ 2;
-  }
+  _ExternalBuffer(int size)
+      : size = size,
+        start = size ~/ 2,
+        end = size ~/ 2;
 
   void advanceStart(int bytes) {
     assert(start > end || start + bytes <= end);
@@ -1171,7 +1156,7 @@
     return size - end;
   }
 
-  Uint8List read(int bytes) {
+  Uint8List? read(int? bytes) {
     if (bytes == null) {
       bytes = length;
     } else {
@@ -1183,7 +1168,7 @@
     // Loop over zero, one, or two linear data ranges.
     while (bytesRead < bytes) {
       int toRead = min(bytes - bytesRead, linearLength);
-      result.setRange(bytesRead, bytesRead + toRead, data, start);
+      result.setRange(bytesRead, bytesRead + toRead, data!, start);
       advanceStart(toRead);
       bytesRead += toRead;
     }
@@ -1198,7 +1183,7 @@
     int toWrite = min(bytes, linearFree);
     // Loop over zero, one, or two linear data ranges.
     while (toWrite > 0) {
-      data.setRange(end, end + toWrite, inputData, offset);
+      data!.setRange(end, end + toWrite, inputData, offset);
       advanceEnd(toWrite);
       offset += toWrite;
       written += toWrite;
@@ -1207,7 +1192,7 @@
     return written;
   }
 
-  int writeFromSource(List<int> getData(int requested)) {
+  int writeFromSource(List<int>? getData(int requested)) {
     int written = 0;
     int toWrite = linearFree;
     // Loop over zero, one, or two linear data ranges.
@@ -1216,7 +1201,7 @@
       var inputData = getData(toWrite);
       if (inputData == null || inputData.length == 0) break;
       var len = inputData.length;
-      data.setRange(end, end + len, inputData);
+      data!.setRange(end, end + len, inputData);
       advanceEnd(len);
       written += len;
       toWrite = linearFree;
@@ -1229,7 +1214,7 @@
     while (true) {
       var toWrite = linearLength;
       if (toWrite == 0) return false;
-      int bytes = socket.write(data, start, toWrite);
+      int bytes = socket.write(data!, start, toWrite);
       advanceStart(bytes);
       if (bytes < toWrite) {
         // The socket has blocked while we have data to write.
@@ -1245,18 +1230,18 @@
   void connect(
       String hostName,
       SecurityContext context,
-      bool is_server,
+      bool isServer,
       bool requestClientCertificate,
       bool requireClientCertificate,
       Uint8List protocols);
   void destroy();
   void handshake();
-  String selectedProtocol();
+  String? selectedProtocol();
   void rehandshake();
   void renegotiate(bool useSessionCache, bool requestClientCertificate,
       bool requireClientCertificate);
   void init();
-  X509Certificate get peerCertificate;
+  X509Certificate? get peerCertificate;
   int processBuffer(int bufferIndex);
   void registerBadCertificateCallback(Function callback);
   void registerHandshakeCompleteCallback(Function handshakeCompleteHandler);
@@ -1266,7 +1251,7 @@
   // value is passed to the IO service through a call to dispatch().
   int _pointer();
 
-  List<_ExternalBuffer> get buffers;
+  List<_ExternalBuffer>? get buffers;
 }
 
 /** A secure networking exception caused by a failure in the
@@ -1275,10 +1260,10 @@
 class TlsException implements IOException {
   final String type;
   final String message;
-  final OSError osError;
+  final OSError? osError;
 
   @pragma("vm:entry-point")
-  const TlsException([String message = "", OSError osError])
+  const TlsException([String message = "", OSError? osError])
       : this._("TlsException", message, osError);
 
   const TlsException._(this.type, this.message, this.osError);
@@ -1305,7 +1290,7 @@
 @pragma("vm:entry-point")
 class HandshakeException extends TlsException {
   @pragma("vm:entry-point")
-  const HandshakeException([String message = "", OSError osError])
+  const HandshakeException([String message = "", OSError? osError])
       : super._("HandshakeException", message, osError);
 }
 
@@ -1316,6 +1301,6 @@
  */
 class CertificateException extends TlsException {
   @pragma("vm:entry-point")
-  const CertificateException([String message = "", OSError osError])
+  const CertificateException([String message = "", OSError? osError])
       : super._("CertificateException", message, osError);
 }
diff --git a/sdk/lib/io/security_context.dart b/sdk/lib/io/security_context.dart
index e98fd78..e4fd5c6 100644
--- a/sdk/lib/io/security_context.dart
+++ b/sdk/lib/io/security_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.6
-
 part of dart.io;
 
 /**
@@ -69,7 +67,7 @@
    * data is used instead of two calls to [useCertificateChain] and
    * [usePrivateKey].
    */
-  void usePrivateKey(String file, {String password});
+  void usePrivateKey(String file, {String? password});
 
   /**
    * Sets the private key for a server certificate or client certificate.
@@ -77,7 +75,7 @@
    * Like [usePrivateKey], but takes the contents of the file as a list
    * of bytes.
    */
-  void usePrivateKeyBytes(List<int> keyBytes, {String password});
+  void usePrivateKeyBytes(List<int> keyBytes, {String? password});
 
   /**
    * Sets the set of trusted X509 certificates used by [SecureSocket]
@@ -99,7 +97,7 @@
    *
    *   $ openssl x509 -outform der -in cert.pem -out cert.der
    */
-  void setTrustedCertificates(String file, {String password});
+  void setTrustedCertificates(String file, {String? password});
 
   /**
    * Sets the set of trusted X509 certificates used by [SecureSocket]
@@ -107,7 +105,7 @@
    *
    * Like [setTrustedCertificates] but takes the contents of the file.
    */
-  void setTrustedCertificatesBytes(List<int> certBytes, {String password});
+  void setTrustedCertificatesBytes(List<int> certBytes, {String? password});
 
   /**
    * Sets the chain of X509 certificates served by [SecureServerSocket]
@@ -127,7 +125,7 @@
    * iOS note: As noted above, [usePrivateKey] does the job of both
    * that call and this one. On iOS, this call is a no-op.
    */
-  void useCertificateChain(String file, {String password});
+  void useCertificateChain(String file, {String? password});
 
   /**
    * Sets the chain of X509 certificates served by [SecureServerSocket]
@@ -135,7 +133,7 @@
    *
    * Like [useCertificateChain] but takes the contents of the file.
    */
-  void useCertificateChainBytes(List<int> chainBytes, {String password});
+  void useCertificateChainBytes(List<int> chainBytes, {String? password});
 
   /**
    * Sets the list of authority names that a [SecureServerSocket] will advertise
@@ -153,7 +151,7 @@
    *
    * iOS note: This call is not supported.
    */
-  void setClientAuthorities(String file, {String password});
+  void setClientAuthorities(String file, {String? password});
 
   /**
    * Sets the list of authority names that a [SecureServerSocket] will advertise
@@ -162,7 +160,7 @@
    *
    * Like [setClientAuthorities] but takes the contents of the file.
    */
-  void setClientAuthoritiesBytes(List<int> authCertBytes, {String password});
+  void setClientAuthoritiesBytes(List<int> authCertBytes, {String? password});
 
   /**
    * Whether the platform supports ALPN. This always returns true and will be
@@ -205,7 +203,7 @@
   /// `ProtocolNameList` length of 65535, this limit cannot be reached. Testing
   /// showed that more than ~ 2^14  bytes will fail to negotiate a protocol.
   /// We will be conservative and support only messages up to (1<<13)-1 bytes.
-  static Uint8List _protocolsToLengthEncoding(List<String> protocols) {
+  static Uint8List _protocolsToLengthEncoding(List<String>? protocols) {
     if (protocols == null || protocols.length == 0) {
       return new Uint8List(0);
     }
diff --git a/sdk/lib/io/service_object.dart b/sdk/lib/io/service_object.dart
index 6c0f882..e6b1851 100644
--- a/sdk/lib/io/service_object.dart
+++ b/sdk/lib/io/service_object.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.6
-
 part of dart.io;
 
 int _nextServiceId = 1;
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index c030553..b5e814f 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.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.6
-
 part of dart.io;
 
 /**
@@ -165,7 +163,7 @@
    * [InternetAddressType.unix] and [address] should be a string.
    */
   external factory InternetAddress(String address,
-      {@Since("2.8") InternetAddressType type});
+      {@Since("2.8") InternetAddressType? type});
 
   /**
    * Creates a new [InternetAddress] from the provided raw address bytes.
@@ -182,7 +180,7 @@
    * [InternetAddress.IPv6] respectively.
    */
   external factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {@Since("2.8") InternetAddressType type});
+      {@Since("2.8") InternetAddressType? type});
 
   /**
    * Perform a reverse DNS lookup on this [address]
@@ -197,7 +195,7 @@
 
   /**
    * Lookup a host, returning a Future of a list of
-   * [InternetAddress]s. If [type] is [InternetAddressType.any], it
+   * [InternetAddress]s. If [type] is [InternetAddressType.ANY], it
    * will lookup both IP version 4 (IPv4) and IP version 6 (IPv6)
    * addresses. If [type] is either [InternetAddressType.IPv4] or
    * [InternetAddressType.IPv6] it will only lookup addresses of the
@@ -218,9 +216,9 @@
 
   /// Attempts to parse [address] as a numeric address.
   ///
-  /// Returns `null` if [address] is not a numeric IPv4 (dotted-decimal
+  /// Returns `null` If [address] is not a numeric IPv4 (dotted-decimal
   /// notation) or IPv6 (hexadecimal representation) address.
-  external static InternetAddress tryParse(String address);
+  external static InternetAddress? tryParse(String address);
 }
 
 /**
@@ -383,7 +381,7 @@
    */
   static Future<ServerSocket> bind(address, int port,
       {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return ServerSocket._bind(address, port,
           backlog: backlog, v6Only: v6Only, shared: shared);
@@ -394,7 +392,6 @@
 
   external static Future<ServerSocket> _bind(address, int port,
       {int backlog: 0, bool v6Only: false, bool shared: false});
-
   /**
    * Returns the port used by this socket.
    */
@@ -471,18 +468,16 @@
   IPPROTO_UDP, // 6
 }
 
-/// The [RawSocketOption] is used as a parameter to [Socket.setRawOption],
-/// [RawSocket.setRawOption], and [RawDatagramSocket.setRawOption] to customize
-/// the behaviour of the underlying socket.
+/// The [RawSocketOption] is used as a parameter to [Socket.setRawOption] and
+/// [RawSocket.setRawOption] to set customize the behaviour of the underlying
+/// socket.
 ///
-/// It allows for fine grained control of the socket options, and its values
-/// will be passed to the underlying platform's implementation of `setsockopt`
-/// and `getsockopt`.
+/// It allows for fine grained control of the socket options, and its values will
+/// be passed to the underlying platform's implementation of setsockopt and
+/// getsockopt.
 @Since("2.2")
 class RawSocketOption {
-  /// Creates a [RawSocketOption] for `getRawOption` and `setRawOption`.
-  ///
-  /// All arguments are required and must not be null.
+  /// Creates a RawSocketOption for getRawOption andSetRawOption.
   ///
   /// The level and option arguments correspond to level and optname arguments
   /// on the get/setsockopt native calls.
@@ -490,18 +485,15 @@
   /// The value argument and its length correspond to the optval and length
   /// arguments on the native call.
   ///
-  /// For a `getRawOption` call, the value parameter will be updated after a
+  /// For a [getRawOption] call, the value parameter will be updated after a
   /// successful call (although its length will not be changed).
   ///
-  /// For a `setRawOption` call, the value parameter will be used set the
+  /// For a [setRawOption] call, the value parameter will be used set the
   /// option.
   const RawSocketOption(this.level, this.option, this.value);
 
   /// Convenience constructor for creating an int based RawSocketOption.
   factory RawSocketOption.fromInt(int level, int option, int value) {
-    if (value == null) {
-      value = 0;
-    }
     final Uint8List list = Uint8List(4);
     final buffer = ByteData.view(list.buffer, list.offsetInBytes);
     buffer.setInt32(0, value, Endian.host);
@@ -510,7 +502,7 @@
 
   /// Convenience constructor for creating a bool based RawSocketOption.
   factory RawSocketOption.fromBool(int level, int option, bool value) =>
-      RawSocketOption.fromInt(level, option, value == true ? 1 : 0);
+      RawSocketOption.fromInt(level, option, value ? 1 : 0);
 
   /// The level for the option to set or get.
   ///
@@ -606,11 +598,8 @@
   final Future<S> socket;
   final void Function() _onCancel;
 
-  ConnectionTask._({Future<S> socket, void Function() onCancel})
-      : assert(socket != null),
-        assert(onCancel != null),
-        this.socket = socket,
-        this._onCancel = onCancel;
+  ConnectionTask._(Future<S> this.socket, void Function() onCancel)
+      : _onCancel = onCancel;
 
   /// Cancels the connection attempt.
   ///
@@ -635,7 +624,8 @@
    * Set or get, if the [RawSocket] should listen for [RawSocketEvent.read]
    * events. Default is [:true:].
    */
-  bool readEventsEnabled;
+  bool get readEventsEnabled;
+  void set readEventsEnabled(bool value);
 
   /**
    * Set or get, if the [RawSocket] should listen for [RawSocketEvent.write]
@@ -643,7 +633,8 @@
    * This is a one-shot listener, and writeEventsEnabled must be set
    * to true again to receive another write event.
    */
-  bool writeEventsEnabled;
+  bool get writeEventsEnabled;
+  void set writeEventsEnabled(bool value);
 
   /**
    * Creates a new socket connection to the host and port and returns a [Future]
@@ -668,7 +659,7 @@
    * connection attempts to [host] are cancelled.
    */
   external static Future<RawSocket> connect(host, int port,
-      {sourceAddress, Duration timeout});
+      {sourceAddress, Duration? timeout});
 
   /// Like [connect], but returns a [Future] that completes with a
   /// [ConnectionTask] that can be cancelled if the [RawSocket] is no
@@ -689,7 +680,7 @@
    * available for immediate reading. If no data is available [:null:]
    * is returned.
    */
-  Uint8List read([int len]);
+  Uint8List? read([int? len]);
 
   /**
    * Writes up to [count] bytes of the buffer from [offset] buffer offset to
@@ -700,7 +691,7 @@
    * The default value for [offset] is 0, and the default value for [count] is
    * [:buffer.length - offset:].
    */
-  int write(List<int> buffer, [int offset, int count]);
+  int write(List<int> buffer, [int offset = 0, int? count]);
 
   /**
    * Returns the port used by this socket.
@@ -807,8 +798,8 @@
    * connection attempts to [host] are cancelled.
    */
   static Future<Socket> connect(host, int port,
-      {sourceAddress, Duration timeout}) {
-    final IOOverrides overrides = IOOverrides.current;
+      {sourceAddress, Duration? timeout}) {
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return Socket._connect(host, port,
           sourceAddress: sourceAddress, timeout: timeout);
@@ -822,7 +813,7 @@
   /// longer needed.
   static Future<ConnectionTask<Socket>> startConnect(host, int port,
       {sourceAddress}) {
-    final IOOverrides overrides = IOOverrides.current;
+    final IOOverrides? overrides = IOOverrides.current;
     if (overrides == null) {
       return Socket._startConnect(host, port, sourceAddress: sourceAddress);
     }
@@ -831,7 +822,7 @@
   }
 
   external static Future<Socket> _connect(host, int port,
-      {sourceAddress, Duration timeout});
+      {sourceAddress, Duration? timeout});
 
   external static Future<ConnectionTask<Socket>> _startConnect(host, int port,
       {sourceAddress});
@@ -942,7 +933,8 @@
    * Set or get, if the [RawDatagramSocket] should listen for
    * [RawSocketEvent.read] events. Default is [:true:].
    */
-  bool readEventsEnabled;
+  bool get readEventsEnabled;
+  void set readEventsEnabled(bool value);
 
   /**
    * Set or get, if the [RawDatagramSocket] should listen for
@@ -950,14 +942,16 @@
    * one-shot listener, and writeEventsEnabled must be set to true
    * again to receive another write event.
    */
-  bool writeEventsEnabled;
+  bool get writeEventsEnabled;
+  void set writeEventsEnabled(bool value);
 
   /**
    * Set or get, whether multicast traffic is looped back to the host.
    *
    * By default multicast loopback is enabled.
    */
-  bool multicastLoopback;
+  bool get multicastLoopback;
+  void set multicastLoopback(bool value);
 
   /**
    * Set or get, the maximum network hops for multicast packages
@@ -968,7 +962,8 @@
    * By default this value is 1 causing multicast traffic to stay on
    * the local network.
    */
-  int multicastHops;
+  int get multicastHops;
+  void set multicastHops(int value);
 
   /**
    * Set or get, the network interface used for outgoing multicast packages.
@@ -980,7 +975,7 @@
    */
   @Deprecated("This property is not implemented. Use getRawOption and "
       "setRawOption instead.")
-  NetworkInterface multicastInterface;
+  NetworkInterface? multicastInterface;
 
   /**
    * Set or get, whether IPv4 broadcast is enabled.
@@ -991,7 +986,8 @@
    * For IPv6 there is no general broadcast mechanism. Use multicast
    * instead.
    */
-  bool broadcastEnabled;
+  bool get broadcastEnabled;
+  void set broadcastEnabled(bool value);
 
   /**
    * Creates a new raw datagram socket binding it to an address and
@@ -1029,7 +1025,7 @@
    *
    * The maximum length of the datagram that can be received is 65503 bytes.
    */
-  Datagram receive();
+  Datagram? receive();
 
   /**
    * Join a multicast group.
@@ -1037,7 +1033,7 @@
    * If an error occur when trying to join the multicast group an
    * exception is thrown.
    */
-  void joinMulticast(InternetAddress group, [NetworkInterface interface]);
+  void joinMulticast(InternetAddress group, [NetworkInterface? interface]);
 
   /**
    * Leave a multicast group.
@@ -1045,7 +1041,7 @@
    * If an error occur when trying to join the multicase group an
    * exception is thrown.
    */
-  void leaveMulticast(InternetAddress group, [NetworkInterface interface]);
+  void leaveMulticast(InternetAddress group, [NetworkInterface? interface]);
 
   /**
    * Use [getRawOption] to get low level information about the [RawSocket]. See
@@ -1068,9 +1064,9 @@
 
 class SocketException implements IOException {
   final String message;
-  final OSError osError;
-  final InternetAddress address;
-  final int port;
+  final OSError? osError;
+  final InternetAddress? address;
+  final int? port;
 
   const SocketException(this.message, {this.osError, this.address, this.port});
   const SocketException.closed()
@@ -1091,7 +1087,7 @@
       sb.write(": $osError");
     }
     if (address != null) {
-      sb.write(", address = ${address.host}");
+      sb.write(", address = ${address!.host}");
     }
     if (port != null) {
       sb.write(", port = $port");
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index 4dfc0af..a0034c6 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.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.6
-
 part of dart.io;
 
 // These match enum StdioHandleType in file.h
@@ -19,8 +17,8 @@
 
   _StdStream(this._stream);
 
-  StreamSubscription<List<int>> listen(void onData(List<int> event),
-      {Function onError, void onDone(), bool cancelOnError}) {
+  StreamSubscription<List<int>> listen(void onData(List<int> event)?,
+      {Function? onError, void onDone()?, bool? cancelOnError}) {
     return _stream.listen(onData,
         onError: onError, onDone: onDone, cancelOnError: cancelOnError);
   }
@@ -43,7 +41,7 @@
    * Blocks until a full line is available.
    *
    * Lines my be terminated by either `<CR><LF>` or `<LF>`. On Windows in cases
-   * where the [stdioType] of stdin is [StdioType.terminal] the terminator may
+   * where the [stdioType] of stdin is [StdioType.termimal] the terminator may
    * also be a single `<CR>`.
    *
    * Input bytes are converted to a string by [encoding].
@@ -57,7 +55,7 @@
    * that data is returned without a line terminator.
    * Returns `null` if no bytes preceded the end of input.
    */
-  String readLineSync(
+  String? readLineSync(
       {Encoding encoding: systemEncoding, bool retainNewlines: false}) {
     const CR = 13;
     const LF = 10;
@@ -214,7 +212,7 @@
  */
 class Stdout extends _StdSink implements IOSink {
   final int _fd;
-  IOSink _nonBlocking;
+  IOSink? _nonBlocking;
 
   Stdout._(IOSink sink, this._fd) : super(sink);
 
@@ -272,14 +270,13 @@
    * Get a non-blocking `IOSink`.
    */
   IOSink get nonBlocking {
-    _nonBlocking ??= new IOSink(new _FileStreamConsumer.fromStdio(_fd));
-    return _nonBlocking;
+    return _nonBlocking ??= new IOSink(new _FileStreamConsumer.fromStdio(_fd));
   }
 }
 
 class StdoutException implements IOException {
   final String message;
-  final OSError osError;
+  final OSError? osError;
 
   const StdoutException(this.message, [this.osError]);
 
@@ -290,7 +287,7 @@
 
 class StdinException implements IOException {
   final String message;
-  final OSError osError;
+  final OSError? osError;
 
   const StdinException(this.message, [this.osError]);
 
@@ -337,15 +334,15 @@
     _sink.encoding = encoding;
   }
 
-  void write(object) {
+  void write(Object? object) {
     _sink.write(object);
   }
 
-  void writeln([object = ""]) {
+  void writeln([Object? object = ""]) {
     _sink.writeln(object);
   }
 
-  void writeAll(objects, [sep = ""]) {
+  void writeAll(Iterable objects, [String sep = ""]) {
     _sink.writeAll(objects, sep);
   }
 
@@ -353,7 +350,7 @@
     _sink.add(data);
   }
 
-  void addError(error, [StackTrace stackTrace]) {
+  void addError(error, [StackTrace? stackTrace]) {
     _sink.addError(error, stackTrace);
   }
 
@@ -388,9 +385,9 @@
   String toString() => "StdioType: $name";
 }
 
-Stdin _stdin;
-Stdout _stdout;
-Stdout _stderr;
+Stdin? _stdin;
+Stdout? _stdout;
+Stdout? _stderr;
 
 // These may be set to different values by the embedder by calling
 // _setStdioFDs when initializing dart:io.
@@ -407,8 +404,7 @@
 
 /// The standard input stream of data read by this program.
 Stdin get stdin {
-  _stdin ??= _StdIOUtils._getStdioInputStream(_stdinFD);
-  return _stdin;
+  return _stdin ??= _StdIOUtils._getStdioInputStream(_stdinFD);
 }
 
 /// The standard output stream of data written by this program.
@@ -417,8 +413,7 @@
 /// result in an unhandled asynchronous error unless there is an error handler
 /// on `done`.
 Stdout get stdout {
-  _stdout ??= _StdIOUtils._getStdioOutputStream(_stdoutFD);
-  return _stdout;
+  return _stdout ??= _StdIOUtils._getStdioOutputStream(_stdoutFD);
 }
 
 /// The standard output stream of errors written by this program.
@@ -427,8 +422,7 @@
 /// result in an unhandled asynchronous error unless there is an error handler
 /// on `done`.
 Stdout get stderr {
-  _stderr ??= _StdIOUtils._getStdioOutputStream(_stderrFD);
-  return _stderr;
+  return _stderr ??= _StdIOUtils._getStdioOutputStream(_stderrFD);
 }
 
 /// For a stream, returns whether it is attached to a file, pipe, terminal, or
@@ -456,7 +450,7 @@
     return StdioType.file;
   }
   if (object is Socket) {
-    int socketType = _StdIOUtils._socketType(object);
+    int? socketType = _StdIOUtils._socketType(object);
     if (socketType == null) return StdioType.other;
     switch (socketType) {
       case _stdioHandleTypeTerminal:
@@ -484,6 +478,6 @@
   external static Stdin _getStdioInputStream(int fd);
 
   /// Returns the socket type or `null` if [socket] is not a builtin socket.
-  external static int _socketType(Socket socket);
+  external static int? _socketType(Socket socket);
   external static _getStdioHandleType(int fd);
 }
diff --git a/sdk/lib/io/string_transformer.dart b/sdk/lib/io/string_transformer.dart
index c399932..f31c41e 100644
--- a/sdk/lib/io/string_transformer.dart
+++ b/sdk/lib/io/string_transformer.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.6
-
 part of dart.io;
 
 /// The current system encoding.
diff --git a/sdk/lib/io/sync_socket.dart b/sdk/lib/io/sync_socket.dart
index 386dc2e..771edfd 100644
--- a/sdk/lib/io/sync_socket.dart
+++ b/sdk/lib/io/sync_socket.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.6
-
 part of dart.io;
 
 /**
@@ -54,7 +52,7 @@
    * otherwise up to [buffer.length]. If [end] == [start], no bytes are read.
    * Returns the number of bytes read.
    */
-  int readIntoSync(List<int> buffer, [int start = 0, int end]);
+  int readIntoSync(List<int> buffer, [int start = 0, int? end]);
 
   /**
    * Reads up to [bytes] bytes from the socket.
@@ -64,7 +62,7 @@
    * be read. Returns the list of bytes read, which could be less than the
    * value specified by [bytes].
    */
-  List<int> readSync(int bytes);
+  List<int>? readSync(int bytes);
 
   /**
    * Shutdown a socket in the provided direction.
@@ -87,7 +85,7 @@
    * be written to the socket starting from index [start]. If [end] == [start],
    * nothing happens.
    */
-  void writeFromSync(List<int> buffer, [int start = 0, int end]);
+  void writeFromSync(List<int> buffer, [int start = 0, int? end]);
 
   /**
    * The port used by this socket.
diff --git a/sdk/lib/isolate/capability.dart b/sdk/lib/isolate/capability.dart
index 4619192..a51eec2 100644
--- a/sdk/lib/isolate/capability.dart
+++ b/sdk/lib/isolate/capability.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.6
-
 part of dart.isolate;
 
 /**
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 22c40b6..881fd14 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.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.6
-
 /**
  * Concurrent programming using _isolates_:
  * independent workers that are similar to threads
@@ -103,7 +101,7 @@
    * If the isolate is spawned in a paused state, use this capability as
    * argument to the [resume] method in order to resume the paused isolate.
    */
-  final Capability pauseCapability;
+  final Capability? pauseCapability;
 
   /**
    * Capability granting the ability to terminate the isolate.
@@ -113,7 +111,7 @@
    * capability of the isolate identified by [controlPort],
    * then calls to those methods will have no effect.
    */
-  final Capability terminateCapability;
+  final Capability? terminateCapability;
 
   /**
    * The name of the [Isolate] displayed for debug purposes.
@@ -128,7 +126,7 @@
    * [IsolateMirror].
    */
   @Since("2.3")
-  external String get debugName;
+  external String? get debugName;
 
   /**
    * Create a new [Isolate] object with a restricted set of capabilities.
@@ -180,7 +178,7 @@
    * in Dart 2.
    */
   @Deprecated('packages/ directory resolution is not supported in Dart 2.')
-  external static Future<Uri> get packageRoot;
+  external static Future<Uri?> get packageRoot;
 
   /**
    * The package root of the current isolate, if any.
@@ -189,7 +187,7 @@
    * setup for package resolution, this getter returns `null`, otherwise it
    * returns the package config URI.
    */
-  external static Future<Uri> get packageConfig;
+  external static Future<Uri?> get packageConfig;
 
   /**
    * Maps a package: URI to a non-package Uri.
@@ -198,7 +196,7 @@
    * isolate, then this call returns `null`. Non-package: URIs are
    * returned unmodified.
    */
-  external static Future<Uri> resolvePackageUri(Uri packageUri);
+  external static Future<Uri?> resolvePackageUri(Uri packageUri);
 
   /**
    * Creates and spawns an isolate that shares the same code as the current
@@ -250,11 +248,11 @@
    */
   external static Future<Isolate> spawn<T>(
       void entryPoint(T message), T message,
-      {bool paused: false,
-      bool errorsAreFatal,
-      SendPort onExit,
-      SendPort onError,
-      @Since("2.3") String debugName});
+      {bool paused = false,
+      bool errorsAreFatal = true,
+      SendPort? onExit,
+      SendPort? onError,
+      @Since("2.3") String? debugName});
 
   /**
    * Creates and spawns an isolate that runs the code from the library with
@@ -332,18 +330,18 @@
       Uri uri,
       List<String> args,
       var message,
-      {bool paused: false,
-      SendPort onExit,
-      SendPort onError,
-      bool errorsAreFatal,
-      bool checked,
-      Map<String, String> environment,
+      {bool paused = false,
+      SendPort? onExit,
+      SendPort? onError,
+      bool errorsAreFatal = true,
+      bool? checked,
+      Map<String, String>? environment,
       @Deprecated('The packages/ dir is not supported in Dart 2')
-          Uri packageRoot,
-      Uri packageConfig,
-      bool automaticPackageResolution: false,
+          Uri? packageRoot,
+      Uri? packageConfig,
+      bool automaticPackageResolution = false,
       @Since("2.3")
-          String debugName});
+          String? debugName});
 
   /**
    * Requests the isolate to pause.
@@ -378,7 +376,7 @@
    * of the isolate identified by [controlPort],
    * the pause request is ignored by the receiving isolate.
    */
-  Capability pause([Capability resumeCapability]) {
+  Capability pause([Capability? resumeCapability]) {
     resumeCapability ??= new Capability();
     _pause(resumeCapability);
     return resumeCapability;
@@ -431,7 +429,7 @@
   /* TODO(lrn): Can we do better? Can the system recognize this message and
    * send a reply if the receiving isolate is dead?
    */
-  external void addOnExitListener(SendPort responsePort, {Object response});
+  external void addOnExitListener(SendPort responsePort, {Object? response});
 
   /**
    * Stops listening for exit messages from the isolate.
@@ -498,7 +496,7 @@
    * of the isolate identified by [controlPort],
    * the kill request is ignored by the receiving isolate.
    */
-  external void kill({int priority: beforeNextEvent});
+  external void kill({int priority = beforeNextEvent});
 
   /**
    * Requests that the isolate send [response] on the [responsePort].
@@ -524,7 +522,7 @@
    *     are completed.
    */
   external void ping(SendPort responsePort,
-      {Object response, int priority: immediate});
+      {Object? response, int priority = immediate});
 
   /**
    * Requests that uncaught errors of the isolate are sent back to [port].
@@ -579,27 +577,27 @@
    * This stream is based on [addErrorListener] and [removeErrorListener].
    */
   Stream get errors {
-    StreamController controller;
-    RawReceivePort port;
-    void handleError(message) {
-      List listMessage = message;
-      String errorDescription = listMessage[0];
-      String stackDescription = listMessage[1];
+    StreamController controller = StreamController.broadcast(sync: true);
+    RawReceivePort? port;
+    void handleError(Object? message) {
+      var listMessage = message as List<Object?>;
+      var errorDescription = listMessage[0] as String;
+      var stackDescription = listMessage[1] as String;
       var error = new RemoteError(errorDescription, stackDescription);
       controller.addError(error, error.stackTrace);
     }
 
-    controller = new StreamController.broadcast(
-        sync: true,
-        onListen: () {
-          port = new RawReceivePort(handleError);
-          this.addErrorListener(port.sendPort);
-        },
-        onCancel: () {
-          this.removeErrorListener(port.sendPort);
-          port.close();
-          port = null;
-        });
+    controller.onListen = () {
+      RawReceivePort receivePort = new RawReceivePort(handleError);
+      port = receivePort;
+      this.addErrorListener(receivePort.sendPort);
+    };
+    controller.onCancel = () {
+      var listenPort = port!;
+      port = null;
+      this.removeErrorListener(listenPort.sendPort);
+      listenPort.close();
+    };
     return controller.stream;
   }
 }
@@ -632,7 +630,7 @@
    * port can receive the message as soon as its isolate's event loop is ready
    * to deliver it, independently of what the sending isolate is doing.
    */
-  void send(var message);
+  void send(Object? message);
 
   /**
    * Tests whether [other] is a [SendPort] pointing to the same
@@ -662,7 +660,7 @@
  *
  * A [ReceivePort] may have many [SendPort]s.
  */
-abstract class ReceivePort implements Stream {
+abstract class ReceivePort implements Stream<dynamic> {
   /**
    * Opens a long-lived port for receiving messages.
    *
@@ -692,8 +690,8 @@
    * The [onDone] handler will be called when the stream closes.
    * The stream closes when [close] is called.
    */
-  StreamSubscription listen(void onData(var message),
-      {Function onError, void onDone(), bool cancelOnError});
+  StreamSubscription<dynamic> listen(void onData(var message)?,
+      {Function? onError, void onDone()?, bool? cancelOnError});
 
   /**
    * Closes `this`.
@@ -719,14 +717,14 @@
    * can not be paused. The data-handler must be set before the first
    * event is received.
    */
-  external factory RawReceivePort([Function handler]);
+  external factory RawReceivePort([Function? handler]);
 
   /**
    * Sets the handler that is invoked for every incoming message.
    *
    * The handler is invoked in the root-zone ([Zone.root]).
    */
-  void set handler(Function newHandler);
+  void set handler(Function? newHandler);
 
   /**
    * Closes the port.
diff --git a/sdk/lib/js/_js.dart b/sdk/lib/js/_js.dart
index cddb791..aef7ef9 100644
--- a/sdk/lib/js/_js.dart
+++ b/sdk/lib/js/_js.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.6
-
 /// Helper library used by `dart:js`.
 ///
 /// This library hides any logic that is specific to the web, and allows us to
diff --git a/sdk/lib/js/_js_client.dart b/sdk/lib/js/_js_client.dart
index b3070d6..de25540 100644
--- a/sdk/lib/js/_js_client.dart
+++ b/sdk/lib/js/_js_client.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.6
-
 import 'dart:html' show Blob, Event, ImageData, Node, Window, WorkerGlobalScope;
 import 'dart:indexed_db' show KeyRange;
 import 'dart:_js_helper' show patch;
diff --git a/sdk/lib/js/_js_server.dart b/sdk/lib/js/_js_server.dart
index 936c8bf..b941d77 100644
--- a/sdk/lib/js/_js_server.dart
+++ b/sdk/lib/js/_js_server.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.6
-
 import 'dart:_js_helper' show patch;
 
 @patch
diff --git a/sdk/lib/js/js.dart b/sdk/lib/js/js.dart
index 139823d..26a6141 100644
--- a/sdk/lib/js/js.dart
+++ b/sdk/lib/js/js.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.6
-
 /// Low-level support for interoperating with JavaScript.
 ///
 /// You should usually use `package:js` instead of this library. For more
@@ -98,7 +96,7 @@
 class JsObject {
   /// Constructs a JavaScript object from its native [constructor] and returns
   /// a proxy to it.
-  external factory JsObject(JsFunction constructor, [List arguments]);
+  external factory JsObject(JsFunction constructor, [List? arguments]);
 
   /// Constructs a [JsObject] that proxies a native Dart object; _for expert use
   /// only_.
@@ -107,9 +105,9 @@
   /// properties attached to a browser host object, such as a Node or Blob, that
   /// is normally automatically converted into a native Dart object.
   ///
-  /// An exception will be thrown if [object] either is `null` or has the type
+  /// An exception will be thrown if [object] has the type
   /// `bool`, `num`, or `String`.
-  external factory JsObject.fromBrowserObject(object);
+  external factory JsObject.fromBrowserObject(Object object);
 
   /// Recursively converts a JSON-like collection of Dart objects to a
   /// collection of JavaScript objects and returns a [JsObject] proxy to it.
@@ -118,34 +116,34 @@
   /// converted. Maps and Iterables are copied to a new JavaScript object.
   /// Primitives and other transferable values are directly converted to their
   /// JavaScript type, and all other objects are proxied.
-  external factory JsObject.jsify(object);
+  external factory JsObject.jsify(Object object);
 
   /// Returns the value associated with [property] from the proxied JavaScript
   /// object.
   ///
   /// The type of [property] must be either [String] or [num].
-  external dynamic operator [](property);
+  external dynamic operator [](Object property);
 
   // Sets the value associated with [property] on the proxied JavaScript
   // object.
   //
   // The type of [property] must be either [String] or [num].
-  external void operator []=(property, value);
+  external void operator []=(Object property, Object? value);
 
   int get hashCode => 0;
 
-  external bool operator ==(other);
+  external bool operator ==(Object other);
 
   /// Returns `true` if the JavaScript object contains the specified property
   /// either directly or though its prototype chain.
   ///
   /// This is the equivalent of the `in` operator in JavaScript.
-  external bool hasProperty(property);
+  external bool hasProperty(Object property);
 
   /// Removes [property] from the JavaScript object.
   ///
   /// This is the equivalent of the `delete` operator in JavaScript.
-  external void deleteProperty(property);
+  external void deleteProperty(Object property);
 
   /// Returns `true` if the JavaScript object has [type] in its prototype chain.
   ///
@@ -159,7 +157,7 @@
   /// returns the result.
   ///
   /// The type of [method] must be either [String] or [num].
-  external dynamic callMethod(method, [List args]);
+  external dynamic callMethod(Object method, [List? args]);
 }
 
 /// A proxy on a JavaScript Function object.
@@ -184,9 +182,9 @@
 
   // Methods required by ListMixin
 
-  external E operator [](dynamic index);
+  external E operator [](Object index);
 
-  external void operator []=(dynamic index, E value);
+  external void operator []=(Object index, E value);
 
   external int get length;
 
@@ -209,7 +207,7 @@
   external void setRange(int start, int end, Iterable<E> iterable,
       [int skipCount = 0]);
 
-  external void sort([int compare(E a, E b)]);
+  external void sort([int compare(E a, E b)?]);
 }
 
 /// Returns a wrapper around function [f] that can be called from JavaScript
diff --git a/sdk/lib/js_util/js_util.dart b/sdk/lib/js_util/js_util.dart
index a299a30..605f6d6 100644
--- a/sdk/lib/js_util/js_util.dart
+++ b/sdk/lib/js_util/js_util.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.6
-
 /// Utility methods to manipulate `package:js` annotated JavaScript interop
 /// objects in cases where the name to call is not known at runtime.
 ///
@@ -27,21 +25,21 @@
 /// objects for JS interop.
 ///
 /// The argument must be a [Map] or [Iterable], the contents of which are also
-/// deeply converted. Maps are converted into JavaScript Objects. Iterables are
+/// deeply converted. Maps are converted into JavaScript objects. Iterables are
 /// converted into arrays. Strings, numbers, bools, and `@JS()` annotated
 /// objects are passed through unmodified. Dart objects are also passed through
 /// unmodified, but their members aren't usable from JavaScript.
-jsify(object) {
+dynamic jsify(Object object) {
   if ((object is! Map) && (object is! Iterable)) {
     throw ArgumentError("object must be a Map or Iterable");
   }
   return _convertDataTree(object);
 }
 
-_convertDataTree(data) {
+Object _convertDataTree(Object data) {
   var _convertedObjects = HashMap.identity();
 
-  _convert(o) {
+  Object? _convert(Object? o) {
     if (_convertedObjects.containsKey(o)) {
       return _convertedObjects[o];
     }
@@ -62,27 +60,30 @@
     }
   }
 
-  return _convert(data);
+  return _convert(data)!;
 }
 
-newObject() => JS('=Object', '{}');
+dynamic newObject() => JS('=Object', '{}');
 
-bool hasProperty(o, name) => JS('bool', '# in #', name, o);
+bool hasProperty(Object o, Object name) => JS('bool', '# in #', name, o);
 
-getProperty(o, name) => JS('Object|Null', '#[#]', o, name);
+dynamic getProperty(Object o, Object name) =>
+    JS('Object|Null', '#[#]', o, name);
 
-setProperty(o, name, value) => JS('', '#[#]=#', o, name, value);
+dynamic setProperty(Object o, Object name, Object? value) =>
+    JS('', '#[#]=#', o, name, value);
 
-callMethod(o, String method, List args) =>
+dynamic callMethod(Object o, String method, List<Object?> args) =>
     JS('Object|Null', '#[#].apply(#, #)', o, method, o, args);
 
 /// Check whether [o] is an instance of [type].
 ///
 /// The value in [type] is expected to be a JS-interop object that
 /// represents a valid JavaScript constructor function.
-bool instanceof(o, Object type) => JS('bool', '# instanceof #', o, type);
+bool instanceof(Object? o, Object type) =>
+    JS('bool', '# instanceof #', o, type);
 
-callConstructor(Object constr, List arguments) {
+dynamic callConstructor(Object constr, List<Object?> arguments) {
   if (arguments == null) {
     return JS('Object', 'new #()', constr);
   }
@@ -151,7 +152,7 @@
 ///
 /// final three = await threeFuture; // == 3
 /// ```
-Future<T> promiseToFuture<T>(jsPromise) {
+Future<T> promiseToFuture<T>(Object jsPromise) {
   final completer = Completer<T>();
 
   final success = convertDartClosureToJS((r) => completer.complete(r), 1);
diff --git a/sdk/lib/math/jenkins_smi_hash.dart b/sdk/lib/math/jenkins_smi_hash.dart
index 7bab10b..deca56c 100644
--- a/sdk/lib/math/jenkins_smi_hash.dart
+++ b/sdk/lib/math/jenkins_smi_hash.dart
@@ -1,7 +1,6 @@
 // Copyright (c) 2013, 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.
-// @dart = 2.6
 
 part of dart.math;
 
@@ -34,8 +33,8 @@
     return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
   }
 
-  static int hash2(a, b) => finish(combine(combine(0, a), b));
+  static int hash2(int a, int b) => finish(combine(combine(0, a), b));
 
-  static int hash4(a, b, c, d) =>
+  static int hash4(int a, int b, int c, int d) =>
       finish(combine(combine(combine(combine(0, a), b), c), d));
 }
diff --git a/sdk/lib/math/math.dart b/sdk/lib/math/math.dart
index 4e893f0..b335669 100644
--- a/sdk/lib/math/math.dart
+++ b/sdk/lib/math/math.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.6
-
 /// Mathematical constants and functions, plus a random number generator.
 ///
 /// To use this library in your code:
diff --git a/sdk/lib/math/point.dart b/sdk/lib/math/point.dart
index 4bebc0ff..4b0fed5 100644
--- a/sdk/lib/math/point.dart
+++ b/sdk/lib/math/point.dart
@@ -1,7 +1,6 @@
 // Copyright (c) 2013, 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.
-// @dart = 2.6
 
 part of dart.math;
 
@@ -16,14 +15,12 @@
 
   String toString() => 'Point($x, $y)';
 
-  /// A `Point` is only equal to another `Point` with the same coordinates.
+  /// Whether [other] is a point with the same coordinates as this point.
   ///
-  /// This point is equal to `other` if, and only if,
-  /// `other` is a `Point` with
-  /// [x] equal to `other.x` and [y] equal to `other.y`.
-  bool operator ==(dynamic other) =>
-      // Cannot change parameter type to `Object` in case some class
-      // inherits the type and uses their argument dynamically.
+  /// Returns `true` if [other] is a [Point] with [x] and [y]
+  /// coordinates equal to the corresponding coordiantes of this point,
+  /// and `false` otherwise.
+  bool operator ==(Object other) =>
       other is Point && x == other.x && y == other.y;
 
   int get hashCode => _JenkinsSmiHash.hash2(x.hashCode, y.hashCode);
@@ -32,25 +29,25 @@
   ///
   /// Returns the resulting "vector" as a Point.
   Point<T> operator +(Point<T> other) {
-    return Point<T>(x + other.x, y + other.y);
+    return Point<T>((x + other.x) as T, (y + other.y) as T);
   }
 
   /// Subtract [other] from `this`, as if both points were vectors.
   ///
   /// Returns the resulting "vector" as a Point.
   Point<T> operator -(Point<T> other) {
-    return Point<T>(x - other.x, y - other.y);
+    return Point<T>((x - other.x) as T, (y - other.y) as T);
   }
 
   /// Scale this point by [factor] as if it were a vector.
   ///
   /// *Important* *Note*: This function accepts a `num` as its argument only so
-  /// that you can scale Point<double> objects by an `int` factor. Because the
-  /// star operator always returns the same type of Point that originally called
-  /// it, passing in a double [factor] on a `Point<int>` _causes_ _a_
-  /// _runtime_ _error_ in checked mode.
+  /// that you can scale `Point<double>` objects by an `int` factor. Because the
+  /// `*` operator always returns the same type of `Point` as it is called on,
+  /// passing in a double [factor] on a `Point<int>` _causes_ _a_
+  /// _runtime_ _error_.
   Point<T> operator *(num /*T|int*/ factor) {
-    return Point<T>((x * factor), (y * factor));
+    return Point<T>((x * factor) as T, (y * factor) as T);
   }
 
   /// Get the straight line (Euclidean) distance between the origin (0, 0) and
@@ -71,6 +68,6 @@
   T squaredDistanceTo(Point<T> other) {
     var dx = x - other.x;
     var dy = y - other.y;
-    return dx * dx + dy * dy;
+    return (dx * dx + dy * dy) as T;
   }
 }
diff --git a/sdk/lib/math/random.dart b/sdk/lib/math/random.dart
index 65c96be..fd75e12 100644
--- a/sdk/lib/math/random.dart
+++ b/sdk/lib/math/random.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.6
-
 part of dart.math;
 
 /// A generator of random bool, int, or double values.
@@ -11,14 +9,14 @@
 /// The default implementation supplies a stream of pseudo-random bits that are
 /// not suitable for cryptographic purposes.
 ///
-/// Use the [Random.secure] constructor for cryptographic purposes.
+/// Use the [Random.secure]() constructor for cryptographic purposes.
 abstract class Random {
   /// Creates a random number generator.
   ///
   /// The optional parameter [seed] is used to initialize the
   /// internal state of the generator. The implementation of the
   /// random stream can change between releases of the library.
-  external factory Random([int seed]);
+  external factory Random([int? seed]);
 
   /// Creates a cryptographically secure random number generator.
   ///
diff --git a/sdk/lib/math/rectangle.dart b/sdk/lib/math/rectangle.dart
index 51d90ef..2ee86c9 100644
--- a/sdk/lib/math/rectangle.dart
+++ b/sdk/lib/math/rectangle.dart
@@ -1,7 +1,6 @@
 // Copyright (c) 2013, 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.
-// @dart = 2.6
 
 part of dart.math;
 
@@ -33,18 +32,16 @@
   T get height;
 
   /// The x-coordinate of the right edge.
-  T get right => left + width;
+  T get right => (left + width) as T;
 
   /// The y-coordinate of the bottom edge.
-  T get bottom => top + height;
+  T get bottom => (top + height) as T;
 
   String toString() {
     return 'Rectangle ($left, $top) $width x $height';
   }
 
-  bool operator ==(dynamic other) =>
-      // Can't change argument type to `Object` since subclasses inherit it
-      // and uses their argument dynamically.
+  bool operator ==(Object other) =>
       other is Rectangle &&
       left == other.left &&
       top == other.top &&
@@ -61,7 +58,7 @@
   ///
   /// Returns the intersection of this and `other`, or `null` if they don't
   /// intersect.
-  Rectangle<T> intersection(Rectangle<T> other) {
+  Rectangle<T>? intersection(Rectangle<T> other) {
     var x0 = max(left, other.left);
     var x1 = min(left + width, other.left + other.width);
 
@@ -70,7 +67,7 @@
       var y1 = min(top + height, other.top + other.height);
 
       if (y0 <= y1) {
-        return Rectangle<T>(x0, y0, x1 - x0, y1 - y0);
+        return Rectangle<T>(x0, y0, (x1 - x0) as T, (y1 - y0) as T);
       }
     }
     return null;
@@ -92,7 +89,7 @@
     var left = min(this.left, other.left);
     var top = min(this.top, other.top);
 
-    return Rectangle<T>(left, top, right - left, bottom - top);
+    return Rectangle<T>(left, top, (right - left) as T, (bottom - top) as T);
   }
 
   /// Tests whether `this` entirely contains [another].
@@ -112,10 +109,10 @@
   }
 
   Point<T> get topLeft => Point<T>(this.left, this.top);
-  Point<T> get topRight => Point<T>(this.left + this.width, this.top);
+  Point<T> get topRight => Point<T>((this.left + this.width) as T, this.top);
   Point<T> get bottomRight =>
-      Point<T>(this.left + this.width, this.top + this.height);
-  Point<T> get bottomLeft => Point<T>(this.left, this.top + this.height);
+      Point<T>((this.left + this.width) as T, (this.top + this.height) as T);
+  Point<T> get bottomLeft => Point<T>(this.left, (this.top + this.height) as T);
 }
 
 /// A class for representing two-dimensional rectangles whose properties are
@@ -139,8 +136,10 @@
   /// If `width` and `height` are zero, the "rectangle" comprises only the
   /// single point `(left, top)`.
   const Rectangle(this.left, this.top, T width, T height)
-      : this.width = (width < 0) ? -width * 0 : width, // Inline _clampToZero.
-        this.height = (height < 0) ? -height * 0 : height;
+      : width = (width < 0)
+            ? (-width * 0) as dynamic
+            : width, // Inline _clampToZero<num>.
+        height = (height < 0) ? (-height * 0) as dynamic : height;
 
   /// Create a rectangle spanned by the points [a] and [b];
   ///
@@ -154,9 +153,9 @@
   /// Similar for the y-coordinates and the bottom edge.
   factory Rectangle.fromPoints(Point<T> a, Point<T> b) {
     T left = min(a.x, b.x);
-    T width = max(a.x, b.x) - left;
+    T width = (max(a.x, b.x) - left) as T;
     T top = min(a.y, b.y);
-    T height = max(a.y, b.y) - top;
+    T height = (max(a.y, b.y) - top) as T;
     return Rectangle<T>(left, top, width, height);
   }
 }
@@ -205,9 +204,9 @@
   /// Similar for the y-coordinates and the bottom edge.
   factory MutableRectangle.fromPoints(Point<T> a, Point<T> b) {
     T left = min(a.x, b.x);
-    T width = max(a.x, b.x) - left;
+    T width = (max(a.x, b.x) - left) as T;
     T top = min(a.y, b.y);
-    T height = max(a.y, b.y) - top;
+    T height = (max(a.y, b.y) - top) as T;
     return MutableRectangle<T>(left, top, width, height);
   }
 
@@ -245,5 +244,5 @@
 /// Returns `0` if value is int, `0.0` if value is double.
 T _clampToZero<T extends num>(T value) {
   assert(value < 0);
-  return -value * 0;
+  return (-value * 0) as T;
 }
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index 731a0a5..95a8aff 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.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.6
-
 // For the purposes of the mirrors library, we adopt a naming
 // convention with respect to getters and setters.  Specifically, for
 // some variable or field...
@@ -139,7 +137,7 @@
    * Using this method may result in larger output.  If possible, use
    * the const constructor of [Symbol] or symbol literals.
    */
-  external static Symbol getSymbol(String name, [LibraryMirror library]);
+  external static Symbol getSymbol(String name, [LibraryMirror? library]);
 }
 
 /**
@@ -191,7 +189,7 @@
  * function can only be used to obtain type mirrors on types of the current
  * isolate.
  */
-external TypeMirror reflectType(Type key, [List<Type> typeArguments]);
+external TypeMirror reflectType(Type key, [List<Type>? typeArguments]);
 
 /**
  * A [Mirror] reflects some Dart language entity.
@@ -228,7 +226,7 @@
    * 2. the isolate being reflected by this mirror is the same isolate being
    *    reflected by [other].
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 
   /**
    * Loads the library at the given uri into this isolate.
@@ -300,7 +298,7 @@
    * * For a parameter, local variable or local function the owner is the
    *   immediately enclosing function.
    */
-  DeclarationMirror get owner;
+  DeclarationMirror? get owner;
 
   /**
    * Whether this declaration is library private.
@@ -352,7 +350,7 @@
    *
    * This operation is optional and may throw an [UnsupportedError].
    */
-  SourceLocation get location;
+  SourceLocation? get location;
 
   /**
    * A list of the metadata associated with this declaration.
@@ -409,7 +407,7 @@
    * method throws *e*.
    */
   InstanceMirror invoke(Symbol memberName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]);
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]);
 
   /**
    * Invokes a getter and returns a mirror on the result.
@@ -547,7 +545,7 @@
    *    b. the remote objects reflected by this mirror and by [other] are
    *    identical.
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 }
 
 /**
@@ -600,7 +598,7 @@
    * method throws *e*.
    */
   InstanceMirror apply(List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]);
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]);
 }
 
 /**
@@ -632,7 +630,7 @@
    * 2. The library being reflected by this mirror and the library being
    *    reflected by [other] are the same library in the same isolate.
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 
   /**
    * Returns a list of the imports and exports in this library;
@@ -658,17 +656,17 @@
 
   /// Returns the library mirror of the library that is imported or exported,
   /// or null if the library is not loaded.
-  LibraryMirror get targetLibrary;
+  LibraryMirror? get targetLibrary;
 
   /// Returns the prefix if this is a prefixed import and `null` otherwise.
-  Symbol get prefix;
+  Symbol? get prefix;
 
   /// Returns the list of show/hide combinators on the import/export
   /// declaration.
   List<CombinatorMirror> get combinators;
 
   /// Returns the source location for this import/export declaration.
-  SourceLocation get location;
+  SourceLocation? get location;
 
   List<InstanceMirror> get metadata;
 
@@ -783,7 +781,7 @@
    *
    * If this type is [:Object:], the superclass will be null.
    */
-  ClassMirror get superclass;
+  ClassMirror? get superclass;
 
   /**
    * A list of mirrors on the superinterfaces of the reflectee.
@@ -877,7 +875,7 @@
    */
   InstanceMirror newInstance(
       Symbol constructorName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments]);
+      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]);
 
   /**
    * Whether this mirror is equal to [other].
@@ -890,7 +888,7 @@
    * Note that if the reflected class is an invocation of a generic class, 2.
    * implies that the reflected class and [other] have equal type arguments.
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 
   /**
    * Returns whether the class denoted by the receiver is a subclass of the
@@ -950,7 +948,7 @@
    * 1. [other] is a mirror of the same kind, and
    * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 }
 
 /**
@@ -981,7 +979,7 @@
   /**
    * The source code for the reflectee, if available. Otherwise null.
    */
-  String get source;
+  String? get source;
 
   /**
    * A list of mirrors on the parameters for the reflectee.
@@ -1083,7 +1081,7 @@
    * 1. [other] is a mirror of the same kind, and
    * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 }
 
 /**
@@ -1129,7 +1127,7 @@
    * 1. [other] is a mirror of the same kind, and
    * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
    */
-  bool operator ==(other);
+  bool operator ==(Object other);
 }
 
 /**
@@ -1169,7 +1167,7 @@
    *
    * Returns `null` for a required parameter.
    */
-  InstanceMirror get defaultValue;
+  InstanceMirror? get defaultValue;
 }
 
 /**
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index c54ac08..ebb9015 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -1,5 +1,3 @@
-// @dart = 2.6
-
 /**
  * Scalable Vector Graphics:
  * Two-dimensional vector graphics with support for events and animation.
@@ -32,7 +30,7 @@
   static SvgElement createSvgElement_tag(String tag) {
     final Element temp =
         document.createElementNS("http://www.w3.org/2000/svg", tag);
-    return temp;
+    return temp as SvgElement;
   }
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -47,7 +45,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AElement() => _SvgElementFactoryProvider.createSvgElement_tag("a");
+  factory AElement() =>
+      _SvgElementFactoryProvider.createSvgElement_tag("a") as AElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -117,7 +116,8 @@
   }
 
   factory AnimateElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animate");
+      _SvgElementFactoryProvider.createSvgElement_tag("animate")
+          as AnimateElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -146,7 +146,8 @@
   }
 
   factory AnimateMotionElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animateMotion");
+      _SvgElementFactoryProvider.createSvgElement_tag("animateMotion")
+          as AnimateMotionElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -175,7 +176,8 @@
   }
 
   factory AnimateTransformElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animateTransform");
+      _SvgElementFactoryProvider.createSvgElement_tag("animateTransform")
+          as AnimateTransformElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -403,7 +405,8 @@
   }
 
   factory AnimationElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animation");
+      _SvgElementFactoryProvider.createSvgElement_tag("animation")
+          as AnimationElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -446,7 +449,8 @@
   }
 
   factory CircleElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("circle");
+      _SvgElementFactoryProvider.createSvgElement_tag("circle")
+          as CircleElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -473,7 +477,8 @@
   }
 
   factory ClipPathElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("clipPath");
+      _SvgElementFactoryProvider.createSvgElement_tag("clipPath")
+          as ClipPathElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -496,7 +501,7 @@
   }
 
   factory DefsElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("defs");
+      _SvgElementFactoryProvider.createSvgElement_tag("defs") as DefsElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -517,7 +522,7 @@
   }
 
   factory DescElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("desc");
+      _SvgElementFactoryProvider.createSvgElement_tag("desc") as DescElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -555,7 +560,8 @@
   }
 
   factory EllipseElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("ellipse");
+      _SvgElementFactoryProvider.createSvgElement_tag("ellipse")
+          as EllipseElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -589,7 +595,8 @@
   }
 
   factory FEBlendElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feBlend");
+      _SvgElementFactoryProvider.createSvgElement_tag("feBlend")
+          as FEBlendElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -650,7 +657,8 @@
   }
 
   factory FEColorMatrixElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feColorMatrix");
+      _SvgElementFactoryProvider.createSvgElement_tag("feColorMatrix")
+          as FEColorMatrixElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -709,7 +717,8 @@
   }
 
   factory FEComponentTransferElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feComponentTransfer");
+      _SvgElementFactoryProvider.createSvgElement_tag("feComponentTransfer")
+          as FEComponentTransferElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -813,7 +822,8 @@
   }
 
   factory FEConvolveMatrixElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feConvolveMatrix");
+      _SvgElementFactoryProvider.createSvgElement_tag("feConvolveMatrix")
+          as FEConvolveMatrixElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -888,7 +898,8 @@
   }
 
   factory FEDiffuseLightingElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feDiffuseLighting");
+      _SvgElementFactoryProvider.createSvgElement_tag("feDiffuseLighting")
+          as FEDiffuseLightingElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -941,7 +952,8 @@
   }
 
   factory FEDisplacementMapElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feDisplacementMap");
+      _SvgElementFactoryProvider.createSvgElement_tag("feDisplacementMap")
+          as FEDisplacementMapElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1003,7 +1015,8 @@
   }
 
   factory FEDistantLightElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feDistantLight");
+      _SvgElementFactoryProvider.createSvgElement_tag("feDistantLight")
+          as FEDistantLightElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1038,7 +1051,8 @@
   }
 
   factory FEFloodElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFlood");
+      _SvgElementFactoryProvider.createSvgElement_tag("feFlood")
+          as FEFloodElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1080,7 +1094,8 @@
   }
 
   factory FEFuncAElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncA");
+      _SvgElementFactoryProvider.createSvgElement_tag("feFuncA")
+          as FEFuncAElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1110,7 +1125,8 @@
   }
 
   factory FEFuncBElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncB");
+      _SvgElementFactoryProvider.createSvgElement_tag("feFuncB")
+          as FEFuncBElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1140,7 +1156,8 @@
   }
 
   factory FEFuncGElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncG");
+      _SvgElementFactoryProvider.createSvgElement_tag("feFuncG")
+          as FEFuncGElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1170,7 +1187,8 @@
   }
 
   factory FEFuncRElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncR");
+      _SvgElementFactoryProvider.createSvgElement_tag("feFuncR")
+          as FEFuncRElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1201,7 +1219,8 @@
   }
 
   factory FEGaussianBlurElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feGaussianBlur");
+      _SvgElementFactoryProvider.createSvgElement_tag("feGaussianBlur")
+          as FEGaussianBlurElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1252,7 +1271,8 @@
   }
 
   factory FEImageElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feImage");
+      _SvgElementFactoryProvider.createSvgElement_tag("feImage")
+          as FEImageElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1301,7 +1321,8 @@
   }
 
   factory FEMergeElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feMerge");
+      _SvgElementFactoryProvider.createSvgElement_tag("feMerge")
+          as FEMergeElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1343,7 +1364,8 @@
   }
 
   factory FEMergeNodeElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feMergeNode");
+      _SvgElementFactoryProvider.createSvgElement_tag("feMergeNode")
+          as FEMergeNodeElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1425,7 +1447,8 @@
   }
 
   factory FEOffsetElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feOffset");
+      _SvgElementFactoryProvider.createSvgElement_tag("feOffset")
+          as FEOffsetElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1473,7 +1496,8 @@
   }
 
   factory FEPointLightElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("fePointLight");
+      _SvgElementFactoryProvider.createSvgElement_tag("fePointLight")
+          as FEPointLightElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1510,7 +1534,8 @@
   }
 
   factory FESpecularLightingElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feSpecularLighting");
+      _SvgElementFactoryProvider.createSvgElement_tag("feSpecularLighting")
+          as FESpecularLightingElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1564,7 +1589,8 @@
   }
 
   factory FESpotLightElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feSpotLight");
+      _SvgElementFactoryProvider.createSvgElement_tag("feSpotLight")
+          as FESpotLightElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1611,7 +1637,8 @@
   }
 
   factory FETileElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feTile");
+      _SvgElementFactoryProvider.createSvgElement_tag("feTile")
+          as FETileElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1656,7 +1683,8 @@
   }
 
   factory FETurbulenceElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feTurbulence");
+      _SvgElementFactoryProvider.createSvgElement_tag("feTurbulence")
+          as FETurbulenceElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1722,7 +1750,8 @@
   }
 
   factory FilterElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("filter");
+      _SvgElementFactoryProvider.createSvgElement_tag("filter")
+          as FilterElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1803,7 +1832,8 @@
   }
 
   factory ForeignObjectElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("foreignObject");
+      _SvgElementFactoryProvider.createSvgElement_tag("foreignObject")
+          as ForeignObjectElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1836,7 +1866,8 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory GElement() => _SvgElementFactoryProvider.createSvgElement_tag("g");
+  factory GElement() =>
+      _SvgElementFactoryProvider.createSvgElement_tag("g") as GElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1921,7 +1952,7 @@
   }
 
   factory ImageElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("image");
+      _SvgElementFactoryProvider.createSvgElement_tag("image") as ImageElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2091,7 +2122,7 @@
   }
 
   factory LineElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("line");
+      _SvgElementFactoryProvider.createSvgElement_tag("line") as LineElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2120,7 +2151,8 @@
   }
 
   factory LinearGradientElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("linearGradient");
+      _SvgElementFactoryProvider.createSvgElement_tag("linearGradient")
+          as LinearGradientElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2149,7 +2181,8 @@
   }
 
   factory MarkerElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("marker");
+      _SvgElementFactoryProvider.createSvgElement_tag("marker")
+          as MarkerElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2206,7 +2239,7 @@
   }
 
   factory MaskElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("mask");
+      _SvgElementFactoryProvider.createSvgElement_tag("mask") as MaskElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2414,7 +2447,7 @@
   }
 
   factory PathElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("path");
+      _SvgElementFactoryProvider.createSvgElement_tag("path") as PathElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2436,7 +2469,8 @@
   }
 
   factory PatternElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("pattern");
+      _SvgElementFactoryProvider.createSvgElement_tag("pattern")
+          as PatternElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2541,7 +2575,8 @@
   }
 
   factory PolygonElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("polygon");
+      _SvgElementFactoryProvider.createSvgElement_tag("polygon")
+          as PolygonElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2566,7 +2601,8 @@
   }
 
   factory PolylineElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("polyline");
+      _SvgElementFactoryProvider.createSvgElement_tag("polyline")
+          as PolylineElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2639,7 +2675,8 @@
   }
 
   factory RadialGradientElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("radialGradient");
+      _SvgElementFactoryProvider.createSvgElement_tag("radialGradient")
+          as RadialGradientElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2700,7 +2737,7 @@
   }
 
   factory RectElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("rect");
+      _SvgElementFactoryProvider.createSvgElement_tag("rect") as RectElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2733,7 +2770,8 @@
   }
 
   factory ScriptElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("script");
+      _SvgElementFactoryProvider.createSvgElement_tag("script")
+          as ScriptElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2765,7 +2803,7 @@
   }
 
   factory SetElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("set");
+      _SvgElementFactoryProvider.createSvgElement_tag("set") as SetElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2791,7 +2829,7 @@
   }
 
   factory StopElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("stop");
+      _SvgElementFactoryProvider.createSvgElement_tag("stop") as StopElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2891,7 +2929,7 @@
   }
 
   factory StyleElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("style");
+      _SvgElementFactoryProvider.createSvgElement_tag("style") as StyleElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2907,7 +2945,7 @@
 
   set media(String value) native;
 
-  StyleSheet get sheet native;
+  StyleSheet? get sheet native;
 
   // Use implementation from Element.
   // String get title native;
@@ -2956,16 +2994,16 @@
   static final _START_TAG_REGEXP = new RegExp('<(\\w+)');
 
   factory SvgElement.tag(String tag) =>
-      document.createElementNS("http://www.w3.org/2000/svg", tag);
+      document.createElementNS("http://www.w3.org/2000/svg", tag) as SvgElement;
   factory SvgElement.svg(String svg,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (validator == null && treeSanitizer == null) {
       validator = new NodeValidatorBuilder.common()..allowSvg();
     }
 
     final match = _START_TAG_REGEXP.firstMatch(svg);
     var parentElement;
-    if (match != null && match.group(1).toLowerCase() == 'svg') {
+    if (match != null && match.group(1)!.toLowerCase() == 'svg') {
       parentElement = document.body;
     } else {
       parentElement = new SvgSvgElement();
@@ -2987,24 +3025,24 @@
 
   String get outerHtml {
     final container = new DivElement();
-    final SvgElement cloned = this.clone(true);
+    final SvgElement cloned = this.clone(true) as SvgElement;
     container.children.add(cloned);
     return container.innerHtml;
   }
 
   String get innerHtml {
     final container = new DivElement();
-    final SvgElement cloned = this.clone(true);
+    final SvgElement cloned = this.clone(true) as SvgElement;
     container.children.addAll(cloned.children);
     return container.innerHtml;
   }
 
-  set innerHtml(String value) {
+  set innerHtml(String? value) {
     this.setInnerHtml(value);
   }
 
-  DocumentFragment createFragment(String svg,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+  DocumentFragment createFragment(String? svg,
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     if (treeSanitizer == null) {
       if (validator == null) {
         validator = new NodeValidatorBuilder.common()..allowSvg();
@@ -3015,13 +3053,13 @@
     // We create a fragment which will parse in the HTML parser
     var html = '<svg version="1.1">$svg</svg>';
     var fragment =
-        document.body.createFragment(html, treeSanitizer: treeSanitizer);
+        document.body!.createFragment(html, treeSanitizer: treeSanitizer);
 
     var svgFragment = new DocumentFragment();
     // The root is the <svg/> element, need to pull out the contents.
     var root = fragment.nodes.single;
     while (root.firstChild != null) {
-      svgFragment.append(root.firstChild);
+      svgFragment.append(root.firstChild!);
     }
     return svgFragment;
   }
@@ -3033,7 +3071,7 @@
   }
 
   void insertAdjacentHtml(String where, String text,
-      {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
     throw new UnsupportedError("Cannot invoke insertAdjacentHtml on SVG.");
   }
 
@@ -3248,7 +3286,7 @@
   AnimatedString get _svgClassName native;
 
   @JSName('ownerSVGElement')
-  SvgSvgElement get ownerSvgElement native;
+  SvgSvgElement? get ownerSvgElement native;
 
   // Use implementation from Element.
   // CssStyleDeclaration get style native;
@@ -3258,7 +3296,7 @@
   // int get tabIndex native;
   // void set tabIndex(int value) native;
 
-  SvgElement get viewportElement native;
+  SvgElement? get viewportElement native;
 
   void blur() native;
 
@@ -3266,9 +3304,9 @@
 
   // From NoncedElement
 
-  String get nonce native;
+  String? get nonce native;
 
-  set nonce(String value) native;
+  set nonce(String? value) native;
 
   ElementStream<Event> get onAbort => abortEvent.forElement(this);
 
@@ -3406,7 +3444,7 @@
     final el = new SvgElement.tag("svg");
     // The SVG spec requires the version attribute to match the spec version
     el.attributes['version'] = "1.1";
-    return el;
+    return el as SvgSvgElement;
   }
 
   // To suppress missing implicit constructor warnings.
@@ -3472,13 +3510,14 @@
 
   Element getElementById(String elementId) native;
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
-  List<Node> getEnclosureList(Rect rect, SvgElement referenceElement) native;
+  List<Node> getEnclosureList(Rect rect, SvgElement? referenceElement) native;
 
-  @Returns('NodeList|Null')
+  @Returns('NodeList')
   @Creates('NodeList')
-  List<Node> getIntersectionList(Rect rect, SvgElement referenceElement) native;
+  List<Node> getIntersectionList(Rect rect, SvgElement? referenceElement)
+      native;
 
   void pauseAnimations() native;
 
@@ -3517,7 +3556,8 @@
   }
 
   factory SwitchElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("switch");
+      _SvgElementFactoryProvider.createSvgElement_tag("switch")
+          as SwitchElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3538,7 +3578,8 @@
   }
 
   factory SymbolElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("symbol");
+      _SvgElementFactoryProvider.createSvgElement_tag("symbol")
+          as SymbolElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3565,7 +3606,7 @@
   }
 
   factory TSpanElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("tspan");
+      _SvgElementFactoryProvider.createSvgElement_tag("tspan") as TSpanElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3647,7 +3688,7 @@
   }
 
   factory TextElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("text");
+      _SvgElementFactoryProvider.createSvgElement_tag("text") as TextElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3736,7 +3777,7 @@
   }
 
   factory TitleElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("title");
+      _SvgElementFactoryProvider.createSvgElement_tag("title") as TitleElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3855,7 +3896,7 @@
 
   void clear() native;
 
-  Transform consolidate() native;
+  Transform? consolidate() native;
 
   @JSName('createSVGTransformFromMatrix')
   Transform createSvgTransformFromMatrix(Matrix matrix) native;
@@ -3914,7 +3955,7 @@
   }
 
   factory UseElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("use");
+      _SvgElementFactoryProvider.createSvgElement_tag("use") as UseElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3947,7 +3988,7 @@
   }
 
   factory ViewElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("view");
+      _SvgElementFactoryProvider.createSvgElement_tag("view") as ViewElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -4076,7 +4117,8 @@
   }
 
   factory _SVGMPathElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("mpath");
+      _SvgElementFactoryProvider.createSvgElement_tag("mpath")
+          as _SVGMPathElement;
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
diff --git a/sdk/lib/typed_data/typed_data.dart b/sdk/lib/typed_data/typed_data.dart
index e1d8f7e..8852ab8 100644
--- a/sdk/lib/typed_data/typed_data.dart
+++ b/sdk/lib/typed_data/typed_data.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.6
-
 /// Lists that efficiently handle fixed sized data
 /// (for example, unsigned 8 byte integers) and SIMD numeric types.
 ///
@@ -46,7 +44,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length` must not be greater than [lengthInBytes].
    */
-  Uint8List asUint8List([int offsetInBytes = 0, int length]);
+  Uint8List asUint8List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Int8List] _view_ of a region of this byte buffer.
@@ -64,7 +62,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length` must not be greater than [lengthInBytes].
    */
-  Int8List asInt8List([int offsetInBytes = 0, int length]);
+  Int8List asInt8List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Uint8ClampedList] _view_ of a region of this byte buffer.
@@ -82,7 +80,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length` must not be greater than [lengthInBytes].
    */
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int length]);
+  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Uint16List] _view_ of a region of this byte buffer.
@@ -105,7 +103,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 2` must not be greater than [lengthInBytes].
    */
-  Uint16List asUint16List([int offsetInBytes = 0, int length]);
+  Uint16List asUint16List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Int16List] _view_ of a region of this byte buffer.
@@ -128,7 +126,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 2` must not be greater than [lengthInBytes].
    */
-  Int16List asInt16List([int offsetInBytes = 0, int length]);
+  Int16List asInt16List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Uint32List] _view_ of a region of this byte buffer.
@@ -152,7 +150,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
    */
-  Uint32List asUint32List([int offsetInBytes = 0, int length]);
+  Uint32List asUint32List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Int32List] _view_ of a region of this byte buffer.
@@ -176,7 +174,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
    */
-  Int32List asInt32List([int offsetInBytes = 0, int length]);
+  Int32List asInt32List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Uint64List] _view_ of a region of this byte buffer.
@@ -200,7 +198,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
    */
-  Uint64List asUint64List([int offsetInBytes = 0, int length]);
+  Uint64List asUint64List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Int64List] _view_ of a region of this byte buffer.
@@ -224,7 +222,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
    */
-  Int64List asInt64List([int offsetInBytes = 0, int length]);
+  Int64List asInt64List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Int32x4List] _view_ of a region of this byte buffer.
@@ -248,7 +246,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
    */
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int length]);
+  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Float32List] _view_ of a region of this byte buffer.
@@ -272,7 +270,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
    */
-  Float32List asFloat32List([int offsetInBytes = 0, int length]);
+  Float32List asFloat32List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Float64List] _view_ of a region of this byte buffer.
@@ -296,7 +294,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
    */
-  Float64List asFloat64List([int offsetInBytes = 0, int length]);
+  Float64List asFloat64List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Float32x4List] _view_ of a region of this byte buffer.
@@ -320,7 +318,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
    */
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int length]);
+  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [Float64x2List] _view_ of a region of this byte buffer.
@@ -344,7 +342,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
    */
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int length]);
+  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]);
 
   /**
    * Creates a [ByteData] _view_ of a region of this byte buffer.
@@ -362,7 +360,7 @@
    * * `length` must not be negative, and
    * * `offsetInBytes + length` must not be greater than [lengthInBytes].
    */
-  ByteData asByteData([int offsetInBytes = 0, int length]);
+  ByteData asByteData([int offsetInBytes = 0, int? length]);
 }
 
 /**
@@ -442,15 +440,28 @@
  * with ordinary [List] implementations.
  * `ByteData` can save space, by eliminating the need for object headers,
  * and time, by eliminating the need for data copies.
+ *
+ * If data comes in as bytes, they can be converted to `ByteData` by
+ * sharing the same buffer.
+ * ```dart
+ * Uint8List bytes = ...;
+ * var blob = ByteData.sublistView(bytes);
+ * if (blob.getUint32(0, Endian.little) == 0x04034b50) { // Zip file marker
+ *   ...
+ * }
+ *
+ * ```
+ *
  * Finally, `ByteData` may be used to intentionally reinterpret the bytes
  * representing one arithmetic type as another.
  * For example this code fragment determine what 32-bit signed integer
  * is represented by the bytes of a 32-bit floating point number
  * (both stored as big endian):
- *
- *     var bdata = new ByteData(8);
- *     bdata.setFloat32(0, 3.04);
- *     int huh = bdata.getInt32(0); // 0x40428f5c
+ * ```dart
+ * var bdata = new ByteData(8);
+ * bdata.setFloat32(0, 3.04);
+ * int huh = bdata.getInt32(0); // 0x40428f5c
+ * ```
  */
 abstract class ByteData implements TypedData {
   /**
@@ -483,16 +494,16 @@
    * ByteData.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [ByteData.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * ByteData.sublistView(other, 0, count)
+   * ByteData.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory ByteData.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asByteData(offsetInBytes, length);
   }
 
@@ -515,10 +526,12 @@
    * If omitted, [start] defaults to zero and [end] to *elementCount*.
    */
   @Since("2.8")
-  factory ByteData.sublistView(TypedData data, [int start = 0, int end]) {
+  factory ByteData.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null)
+      throw "unreachable"; // TODO(38725): Remove when promotion works.
     return data.buffer.asByteData(
         data.offsetInBytes + start * elementSize, (end - start) * elementSize);
   }
@@ -827,16 +840,16 @@
    * Int8List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Int8List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Int8List.sublistView(other, 0, count)
+   * Int8List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Int8List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asInt8List(offsetInBytes, length);
   }
 
@@ -859,10 +872,11 @@
    * If omitted, [start] defaults to zero and [end] to *elementCount*.
    */
   @Since("2.8")
-  factory Int8List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Int8List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     return data.buffer.asInt8List(
         data.offsetInBytes + start * elementSize, (end - start) * elementSize);
   }
@@ -890,7 +904,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Int8List sublist(int start, [int end]);
+  Int8List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 1;
 }
@@ -949,16 +963,16 @@
    * Uint8List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Uint8List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Uint8List.sublistView(other, 0, count)
+   * Uint8List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Uint8List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asUint8List(offsetInBytes, length);
   }
 
@@ -981,10 +995,11 @@
    * If omitted, [start] defaults to zero and [end] to *elementCount*.
    */
   @Since("2.8")
-  factory Uint8List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Uint8List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     return data.buffer.asUint8List(
         data.offsetInBytes + start * elementSize, (end - start) * elementSize);
   }
@@ -1021,7 +1036,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Uint8List sublist(int start, [int end]);
+  Uint8List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 1;
 }
@@ -1081,16 +1096,16 @@
    * Uint8ClampedList.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Uint8ClampedList.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Uint8ClampedList.sublistView(other, 0, count)
+   * Uint8ClampedList.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Uint8ClampedList.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asUint8ClampedList(offsetInBytes, length);
   }
 
@@ -1114,10 +1129,11 @@
    */
   @Since("2.8")
   factory Uint8ClampedList.sublistView(TypedData data,
-      [int start = 0, int end]) {
+      [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     return data.buffer.asUint8ClampedList(
         data.offsetInBytes + start * elementSize, (end - start) * elementSize);
   }
@@ -1145,7 +1161,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Uint8ClampedList sublist(int start, [int end]);
+  Uint8ClampedList sublist(int start, [int? end]);
 
   static const int bytesPerElement = 1;
 }
@@ -1209,16 +1225,16 @@
    * Int16List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Int16List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Int16List.sublistView(other, 0, count)
+   * Int16List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Int16List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asInt16List(offsetInBytes, length);
   }
 
@@ -1244,10 +1260,11 @@
    * multiples of two.
    */
   @Since("2.8")
-  factory Int16List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Int16List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -1280,7 +1297,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Int16List sublist(int start, [int end]);
+  Int16List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 2;
 }
@@ -1345,16 +1362,16 @@
    * Uint16List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Uint16List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Uint16List.sublistView(other, 0, count)
+   * Uint16List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Uint16List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asUint16List(offsetInBytes, length);
   }
 
@@ -1380,10 +1397,11 @@
    * multiples of two.
    */
   @Since("2.8")
-  factory Uint16List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Uint16List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -1416,7 +1434,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Uint16List sublist(int start, [int end]);
+  Uint16List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 2;
 }
@@ -1480,16 +1498,16 @@
    * Int32List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Int32List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Int32List.sublistView(other, 0, count)
+   * Int32List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Int32List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asInt32List(offsetInBytes, length);
   }
 
@@ -1515,10 +1533,11 @@
    * multiples of four.
    */
   @Since("2.8")
-  factory Int32List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Int32List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -1551,7 +1570,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Int32List sublist(int start, [int end]);
+  Int32List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 4;
 }
@@ -1616,16 +1635,16 @@
    * Uint32List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Uint32List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Uint32List.sublistView(other, 0, count)
+   * Uint32List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Uint32List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asUint32List(offsetInBytes, length);
   }
 
@@ -1651,10 +1670,11 @@
    * multiples of four.
    */
   @Since("2.8")
-  factory Uint32List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Uint32List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -1687,7 +1707,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Uint32List sublist(int start, [int end]);
+  Uint32List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 4;
 }
@@ -1751,16 +1771,16 @@
    * Int64List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Int64List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Int64List.sublistView(other, 0, count)
+   * Int64List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Int64List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asInt64List(offsetInBytes, length);
   }
 
@@ -1786,10 +1806,11 @@
    * multiples of eight.
    */
   @Since("2.8")
-  factory Int64List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Int64List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -1822,7 +1843,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Int64List sublist(int start, [int end]);
+  Int64List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 8;
 }
@@ -1887,16 +1908,16 @@
    * Uint64List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Uint64List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Uint64List.sublistView(other, 0, count)
+   * Uint64List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Uint64List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asUint64List(offsetInBytes, length);
   }
 
@@ -1922,10 +1943,11 @@
    * multiples of eight.
    */
   @Since("2.8")
-  factory Uint64List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Uint64List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -1958,7 +1980,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Uint64List sublist(int start, [int end]);
+  Uint64List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 8;
 }
@@ -2023,16 +2045,16 @@
    * Float32List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Float32List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Float32List.sublistView(other, 0, count)
+   * Float32List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Float32List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asFloat32List(offsetInBytes, length);
   }
 
@@ -2058,10 +2080,11 @@
    * multiples of four.
    */
   @Since("2.8")
-  factory Float32List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Float32List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -2094,7 +2117,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Float32List sublist(int start, [int end]);
+  Float32List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 4;
 }
@@ -2152,16 +2175,16 @@
    * Float64List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Float64List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Float64List.sublistView(other, 0, count)
+   * Float64List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Float64List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asFloat64List(offsetInBytes, length);
   }
 
@@ -2187,10 +2210,11 @@
    * multiples of eight.
    */
   @Since("2.8")
-  factory Float64List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Float64List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -2223,7 +2247,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Float64List sublist(int start, [int end]);
+  Float64List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 8;
 }
@@ -2280,16 +2304,16 @@
    * Float32x4List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Float32x4List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Float32x4List.sublistView(other, 0, count)
+   * Float32x4List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Float32x4List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asFloat32x4List(offsetInBytes, length);
   }
 
@@ -2315,10 +2339,11 @@
    * multiples of sixteen.
    */
   @Since("2.8")
-  factory Float32x4List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Float32x4List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -2359,7 +2384,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Float32x4List sublist(int start, [int end]);
+  Float32x4List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 16;
 }
@@ -2416,16 +2441,16 @@
    * Int32x4List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Int32x4List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Int32x4List.sublistView(other, 0, count)
+   * Int32x4List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Int32x4List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asInt32x4List(offsetInBytes, length);
   }
 
@@ -2451,10 +2476,11 @@
    * multiples of sixteen.
    */
   @Since("2.8")
-  factory Int32x4List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Int32x4List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -2495,7 +2521,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Int32x4List sublist(int start, [int end]);
+  Int32x4List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 16;
 }
@@ -2560,16 +2586,16 @@
    * Float64x2List.view(other.buffer, other.offsetInBytes, count)
    * ```
    * Alternatively, use [Float64x2List.sublistView]
-   * which includes this computation.
+   * which includes this computation:
    * ```dart
-   * Float64x2List.sublistView(other, 0, count)
+   * Float64x2List.sublistView(other, 0, count);
    * ```
    * (The third argument is an end index rather than a length, so if
    * you start from a position greater than zero, you need not
    * reduce the count correspondingly).
    */
   factory Float64x2List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int length]) {
+      [int offsetInBytes = 0, int? length]) {
     return buffer.asFloat64x2List(offsetInBytes, length);
   }
 
@@ -2595,10 +2621,11 @@
    * multiples of sixteen.
    */
   @Since("2.8")
-  factory Float64x2List.sublistView(TypedData data, [int start = 0, int end]) {
+  factory Float64x2List.sublistView(TypedData data, [int start = 0, int? end]) {
     int elementSize = data.elementSizeInBytes;
     end = RangeError.checkValidRange(
         start, end, data.lengthInBytes ~/ elementSize);
+    if (end == null) throw "unreachable"; // TODO(38725)
     int byteLength = (end - start) * elementSize;
     if (byteLength % bytesPerElement != 0) {
       throw ArgumentError("The number of bytes to view must be a multiple of " +
@@ -2631,7 +2658,7 @@
    * 0 ≤ `start` ≤ `end` ≤ `this.length`
    * If `end` is equal to `start`, then the returned list is empty.
    */
-  Float64x2List sublist(int start, [int end]);
+  Float64x2List sublist(int start, [int? end]);
 
   static const int bytesPerElement = 16;
 }
diff --git a/sdk/lib/typed_data/unmodifiable_typed_data.dart b/sdk/lib/typed_data/unmodifiable_typed_data.dart
index 2b0fe5e..30bdf51 100644
--- a/sdk/lib/typed_data/unmodifiable_typed_data.dart
+++ b/sdk/lib/typed_data/unmodifiable_typed_data.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.6
-
 part of dart.typed_data;
 
 /**
@@ -16,55 +14,55 @@
 
   int get lengthInBytes => _data.lengthInBytes;
 
-  Uint8List asUint8List([int offsetInBytes = 0, int length]) =>
+  Uint8List asUint8List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableUint8ListView(_data.asUint8List(offsetInBytes, length));
 
-  Int8List asInt8List([int offsetInBytes = 0, int length]) =>
+  Int8List asInt8List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableInt8ListView(_data.asInt8List(offsetInBytes, length));
 
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int length]) =>
+  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableUint8ClampedListView(
           _data.asUint8ClampedList(offsetInBytes, length));
 
-  Uint16List asUint16List([int offsetInBytes = 0, int length]) =>
+  Uint16List asUint16List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableUint16ListView(_data.asUint16List(offsetInBytes, length));
 
-  Int16List asInt16List([int offsetInBytes = 0, int length]) =>
+  Int16List asInt16List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableInt16ListView(_data.asInt16List(offsetInBytes, length));
 
-  Uint32List asUint32List([int offsetInBytes = 0, int length]) =>
+  Uint32List asUint32List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableUint32ListView(_data.asUint32List(offsetInBytes, length));
 
-  Int32List asInt32List([int offsetInBytes = 0, int length]) =>
+  Int32List asInt32List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableInt32ListView(_data.asInt32List(offsetInBytes, length));
 
-  Uint64List asUint64List([int offsetInBytes = 0, int length]) =>
+  Uint64List asUint64List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableUint64ListView(_data.asUint64List(offsetInBytes, length));
 
-  Int64List asInt64List([int offsetInBytes = 0, int length]) =>
+  Int64List asInt64List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableInt64ListView(_data.asInt64List(offsetInBytes, length));
 
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int length]) =>
+  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableInt32x4ListView(
           _data.asInt32x4List(offsetInBytes, length));
 
-  Float32List asFloat32List([int offsetInBytes = 0, int length]) =>
+  Float32List asFloat32List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableFloat32ListView(
           _data.asFloat32List(offsetInBytes, length));
 
-  Float64List asFloat64List([int offsetInBytes = 0, int length]) =>
+  Float64List asFloat64List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableFloat64ListView(
           _data.asFloat64List(offsetInBytes, length));
 
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int length]) =>
+  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableFloat32x4ListView(
           _data.asFloat32x4List(offsetInBytes, length));
 
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int length]) =>
+  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableFloat64x2ListView(
           _data.asFloat64x2List(offsetInBytes, length));
 
-  ByteData asByteData([int offsetInBytes = 0, int length]) =>
+  ByteData asByteData([int offsetInBytes = 0, int? length]) =>
       new UnmodifiableByteDataView(_data.asByteData(offsetInBytes, length));
 }
 
@@ -165,9 +163,10 @@
 
   L _createList(int length);
 
-  L sublist(int start, [int end]) {
-    end = RangeError.checkValidRange(start, end, length);
-    int sublistLength = end - start;
+  L sublist(int start, [int? end]) {
+    // NNBD: Spurious error at `end`, `checkValidRange` is legacy.
+    int endIndex = RangeError.checkValidRange(start, end!, length);
+    int sublistLength = endIndex - start;
     L result = _createList(sublistLength);
     result.setRange(0, sublistLength, _list, start);
     return result;
diff --git a/sdk/lib/vmservice/asset.dart b/sdk/lib/vmservice/asset.dart
index 512a0c9..a29984e 100644
--- a/sdk/lib/vmservice/asset.dart
+++ b/sdk/lib/vmservice/asset.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.6
-
 part of dart._vmservice;
 
 class Asset {
@@ -13,8 +11,8 @@
   Asset(this.name, this.data);
 
   String get mimeType {
-    var extensionStart = name.lastIndexOf('.');
-    var extension = name.substring(extensionStart + 1);
+    final extensionStart = name.lastIndexOf('.');
+    final extension = name.substring(extensionStart + 1);
     switch (extension) {
       case 'html':
         return 'text/html; charset=UTF-8';
@@ -39,15 +37,15 @@
     }
   }
 
-  static Map<String, Asset> request() {
-    Uint8List tarBytes = _requestAssets();
+  static Map<String, Asset>? request() {
+    Uint8List? tarBytes = _requestAssets();
     if (tarBytes == null) {
       return null;
     }
     List assetList = _decodeAssets(tarBytes);
     Map<String, Asset> assets = new HashMap<String, Asset>();
     for (int i = 0; i < assetList.length; i += 2) {
-      var a = new Asset(assetList[i], assetList[i + 1]);
+      final a = Asset(assetList[i], assetList[i + 1]);
       assets[a.name] = a;
     }
     return assets;
@@ -56,9 +54,9 @@
   String toString() => '$name ($mimeType)';
 }
 
-List _decodeAssets(Uint8List data) native "VMService_DecodeAssets";
+List _decodeAssets(Uint8List data) native 'VMService_DecodeAssets';
 
-Map<String, Asset> _assets;
+Map<String, Asset>? _assets;
 Map<String, Asset> get assets {
   if (_assets == null) {
     try {
@@ -67,5 +65,5 @@
       print('Could not load Observatory assets: $e');
     }
   }
-  return _assets;
+  return _assets!;
 }
diff --git a/sdk/lib/vmservice/client.dart b/sdk/lib/vmservice/client.dart
index 915a3d0..65a72ba 100644
--- a/sdk/lib/vmservice/client.dart
+++ b/sdk/lib/vmservice/client.dart
@@ -2,42 +2,39 @@
 // 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.6
-
 part of dart._vmservice;
 
-typedef void ClientServiceHandle(Message response);
+typedef void ClientServiceHandle(Message? response);
 
 // A service client.
 abstract class Client {
+  final VMService service;
+  final bool sendEvents;
+
   static int _idCounter = 0;
   final int _id = ++_idCounter;
 
   String get defaultClientName => 'client$_id';
 
   String get name => _name;
-  set name(n) => _name = n ?? defaultClientName;
-  String _name;
-
-  final VMService service;
-  final bool sendEvents;
+  set name(String? n) => _name = (n ?? defaultClientName);
+  late String _name;
 
   /// A set streamIds which describes the streams the client is connected to
-  final Set<String> streams = new Set<String>();
+  final streams = <String>{};
 
   /// Services registered and their aliases
   /// key: service
   /// value: alias
-  final Map<String, String> services = new Map<String, String>();
+  final services = <String, String>{};
 
   /// Callbacks registered for service invocations set to the client
   /// key: RPC id used for the request
   /// value: callback that should be invoked
-  final Map<String, ClientServiceHandle> serviceHandles =
-      new Map<String, ClientServiceHandle>();
+  final serviceHandles = <String, ClientServiceHandle>{};
 
-  Client(this.service, {bool sendEvents: true}) : this.sendEvents = sendEvents {
-    name = defaultClientName;
+  Client(this.service, {this.sendEvents = true}) {
+    _name = defaultClientName;
     service._addClient(this);
   }
 
@@ -45,33 +42,28 @@
   disconnect();
 
   /// When implementing, call [close] when the network connection closes.
-  void close() {
-    service._removeClient(this);
-  }
+  void close() => service._removeClient(this);
 
   /// Call to process a request. Response will be posted with 'seq'.
-  void onRequest(Message message) {
-    // In JSON-RPC 2.0 messages with and id are Request and must be answered
-    // http://www.jsonrpc.org/specification#notification
-    service.routeRequest(service, message).then(post);
-  }
+  void onRequest(Message message) =>
+      // In JSON-RPC 2.0 messages with and id are Request and must be answered
+      // http://www.jsonrpc.org/specification#notification
+      service.routeRequest(service, message).then(post);
 
-  void onResponse(Message message) {
-    service.routeResponse(message);
-  }
+  void onResponse(Message message) => service.routeResponse(message);
 
   /// Call to process a notification. Response will not be posted.
-  void onNotification(Message message) {
-    // In JSON-RPC 2.0 messages without an id are Notification
-    // and should not be answered
-    // http://www.jsonrpc.org/specification#notification
-    service.routeRequest(service, message);
-  }
+  void onNotification(Message message) =>
+      // In JSON-RPC 2.0 messages without an id are Notification
+      // and should not be answered
+      // http://www.jsonrpc.org/specification#notification
+      service.routeRequest(service, message);
 
-  // Sends a result to the client.  Implemented in subclasses.
-  void post(Response result);
+  // Sends a result to the client. Implemented in subclasses.
+  //
+  // Null can be passed as response to a JSON-RPC notification to close the
+  // connection.
+  void post(Response? result);
 
-  dynamic toJson() {
-    return {};
-  }
+  Map<String, dynamic> toJson() => {};
 }
diff --git a/sdk/lib/vmservice/constants.dart b/sdk/lib/vmservice/constants.dart
index fa4b719..914576b 100644
--- a/sdk/lib/vmservice/constants.dart
+++ b/sdk/lib/vmservice/constants.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.6
-
 part of dart._vmservice;
 
 // These must be kept in sync with runtime/vm/service.cc.
diff --git a/sdk/lib/vmservice/devfs.dart b/sdk/lib/vmservice/devfs.dart
index 283006c..3463d6c 100644
--- a/sdk/lib/vmservice/devfs.dart
+++ b/sdk/lib/vmservice/devfs.dart
@@ -2,24 +2,19 @@
 // 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.6
-
 part of dart._vmservice;
 
-String _encodeDevFSDisabledError(Message message) {
-  return encodeRpcError(message, kFeatureDisabled,
-      details: "DevFS is not supported by this Dart implementation");
-}
+String _encodeDevFSDisabledError(Message message) =>
+    encodeRpcError(message, kFeatureDisabled,
+        details: 'DevFS is not supported by this Dart implementation');
 
-String _encodeFileSystemAlreadyExistsError(Message message, String fsName) {
-  return encodeRpcError(message, kFileSystemAlreadyExists,
-      details: "${message.method}: file system '${fsName}' already exists");
-}
+String _encodeFileSystemAlreadyExistsError(Message message, String fsName) =>
+    encodeRpcError(message, kFileSystemAlreadyExists,
+        details: "${message.method}: file system '${fsName}' already exists");
 
-String _encodeFileSystemDoesNotExistError(Message message, String fsName) {
-  return encodeRpcError(message, kFileSystemDoesNotExist,
-      details: "${message.method}: file system '${fsName}' does not exist");
-}
+String _encodeFileSystemDoesNotExistError(Message message, String fsName) =>
+    encodeRpcError(message, kFileSystemDoesNotExist,
+        details: "${message.method}: file system '${fsName}' does not exist");
 
 class _FileSystem {
   _FileSystem(this.name, this.uri);
@@ -27,7 +22,7 @@
   final String name;
   final Uri uri;
 
-  Uri resolvePath(String path) {
+  Uri? resolvePath(String path) {
     if (path.startsWith('/')) {
       path = path.substring(1);
     }
@@ -36,23 +31,25 @@
     }
     Uri pathUri;
     try {
-      pathUri = new Uri.file(path);
-    } on FormatException catch (e) {
+      pathUri = Uri.file(path);
+      // ignore: unused_catch_clause
+    } on FormatException catch (_) {
       return null;
     }
 
     return resolve(pathUri);
   }
 
-  Uri resolve(Uri pathUri) {
+  Uri? resolve(Uri pathUri) {
     try {
       // Make sure that this pathUri can be converted to a file path.
       pathUri.toFilePath();
-    } on UnsupportedError catch (e) {
+      // ignore: unused_catch_clause
+    } on UnsupportedError catch (_) {
       return null;
     }
 
-    Uri resolvedUri = uri.resolveUri(pathUri);
+    final resolvedUri = uri.resolveUri(pathUri);
     if (!resolvedUri.toString().startsWith(uri.toString())) {
       // Resolved uri must be within the filesystem's base uri.
       return null;
@@ -60,21 +57,19 @@
     return resolvedUri;
   }
 
-  Map toMap() {
-    return {
-      'type': 'FileSystem',
-      'name': name,
-      'uri': uri.toString(),
-    };
-  }
+  Map<String, String> toMap() => {
+        'type': 'FileSystem',
+        'name': name,
+        'uri': uri.toString(),
+      };
 }
 
 class DevFS {
   DevFS();
 
-  Map<String, _FileSystem> _fsMap = {};
+  final _fsMap = <String, _FileSystem>{};
 
-  final Set _rpcNames = new Set.from([
+  final _rpcNames = <String>{
     '_listDevFS',
     '_createDevFS',
     '_deleteDevFS',
@@ -82,27 +77,25 @@
     '_writeDevFSFile',
     '_writeDevFSFiles',
     '_listDevFSFiles',
-  ]);
+  };
 
   void cleanup() {
-    var deleteDir = VMServiceEmbedderHooks.deleteDir;
+    final deleteDir = VMServiceEmbedderHooks.deleteDir;
     if (deleteDir == null) {
       return;
     }
-    var deletions = <Future>[];
-    for (var fs in _fsMap.values) {
-      deletions.add(deleteDir(fs.uri));
-    }
+    final deletions = <Future>[
+      for (final fs in _fsMap.values) deleteDir(fs.uri),
+    ];
     Future.wait(deletions);
     _fsMap.clear();
   }
 
-  bool shouldHandleMessage(Message message) {
-    return _rpcNames.contains(message.method);
-  }
+  bool shouldHandleMessage(Message message) =>
+      _rpcNames.contains(message.method);
 
   Future<String> handleMessage(Message message) async {
-    switch (message.method) {
+    switch (message.method!) {
       case '_listDevFS':
         return _listDevFS(message);
       case '_createDevFS':
@@ -124,10 +117,10 @@
   }
 
   Future<String> handlePutStream(
-      Object fsName, Object path, Uri fsUri, Stream<List<int>> bytes) async {
+      Object? fsName, Object? path, Uri? fsUri, Stream<List<int>> bytes) async {
     // A dummy Message for error message construction.
-    Message message = new Message.forMethod('_writeDevFSFile');
-    var writeStreamFile = VMServiceEmbedderHooks.writeStreamFile;
+    final message = Message.forMethod('_writeDevFSFile');
+    final writeStreamFile = VMServiceEmbedderHooks.writeStreamFile;
     if (writeStreamFile == null) {
       return _encodeDevFSDisabledError(message);
     }
@@ -141,7 +134,7 @@
     if (fs == null) {
       return _encodeFileSystemDoesNotExistError(message, fsName);
     }
-    Uri uri = fsUri;
+    Uri? uri = fsUri;
     if (uri == null) {
       if (path == null) {
         return encodeMissingParamError(message, 'path');
@@ -164,47 +157,47 @@
   }
 
   Future<String> _listDevFS(Message message) async {
-    var result = {};
+    final result = <String, dynamic>{};
     result['type'] = 'FileSystemList';
     result['fsNames'] = _fsMap.keys.toList();
     return encodeResult(message, result);
   }
 
   Future<String> _createDevFS(Message message) async {
-    var createTempDir = VMServiceEmbedderHooks.createTempDir;
+    final createTempDir = VMServiceEmbedderHooks.createTempDir;
     if (createTempDir == null) {
       return _encodeDevFSDisabledError(message);
     }
-    var fsName = message.params['fsName'];
+    final fsName = message.params['fsName'];
     if (fsName == null) {
       return encodeMissingParamError(message, 'fsName');
     }
     if (fsName is! String) {
       return encodeInvalidParamError(message, 'fsName');
     }
-    var fs = _fsMap[fsName];
+    _FileSystem? fs = _fsMap[fsName];
     if (fs != null) {
       return _encodeFileSystemAlreadyExistsError(message, fsName);
     }
-    var tempDir = await createTempDir(fsName);
-    fs = new _FileSystem(fsName, tempDir);
+    final tempDir = await createTempDir(fsName);
+    fs = _FileSystem(fsName, tempDir);
     _fsMap[fsName] = fs;
     return encodeResult(message, fs.toMap());
   }
 
   Future<String> _deleteDevFS(Message message) async {
-    var deleteDir = VMServiceEmbedderHooks.deleteDir;
+    final deleteDir = VMServiceEmbedderHooks.deleteDir;
     if (deleteDir == null) {
       return _encodeDevFSDisabledError(message);
     }
-    var fsName = message.params['fsName'];
+    final fsName = message.params['fsName'];
     if (fsName == null) {
       return encodeMissingParamError(message, 'fsName');
     }
     if (fsName is! String) {
       return encodeInvalidParamError(message, 'fsName');
     }
-    var fs = _fsMap.remove(fsName);
+    final fs = _fsMap.remove(fsName);
     if (fs == null) {
       return _encodeFileSystemDoesNotExistError(message, fsName);
     }
@@ -213,29 +206,29 @@
   }
 
   Future<String> _readDevFSFile(Message message) async {
-    var readFile = VMServiceEmbedderHooks.readFile;
+    final readFile = VMServiceEmbedderHooks.readFile;
     if (readFile == null) {
       return _encodeDevFSDisabledError(message);
     }
-    var fsName = message.params['fsName'];
+    final fsName = message.params['fsName'];
     if (fsName == null) {
       return encodeMissingParamError(message, 'fsName');
     }
     if (fsName is! String) {
       return encodeInvalidParamError(message, 'fsName');
     }
-    var fs = _fsMap[fsName];
+    final fs = _fsMap[fsName];
     if (fs == null) {
       return _encodeFileSystemDoesNotExistError(message, fsName);
     }
-    Uri uri;
+    Uri? uri;
     if (message.params['uri'] != null) {
       try {
-        var uriParam = message.params['uri'];
+        final uriParam = message.params['uri'];
         if (uriParam is! String) {
           return encodeInvalidParamError(message, 'uri');
         }
-        Uri parsedUri = Uri.parse(uriParam);
+        final parsedUri = Uri.parse(uriParam);
         uri = fs.resolve(parsedUri);
         if (uri == null) {
           return encodeInvalidParamError(message, 'uri');
@@ -244,7 +237,7 @@
         return encodeInvalidParamError(message, 'uri');
       }
     } else {
-      var path = message.params['path'];
+      final path = message.params['path'];
       if (path == null) {
         return encodeMissingParamError(message, 'path');
       }
@@ -257,39 +250,39 @@
       }
     }
     try {
-      List<int> bytes = await readFile(uri);
-      var result = {'type': 'FSFile', 'fileContents': base64.encode(bytes)};
+      final bytes = await readFile(uri);
+      final result = {'type': 'FSFile', 'fileContents': base64.encode(bytes)};
       return encodeResult(message, result);
     } catch (e) {
       return encodeRpcError(message, kFileDoesNotExist,
-          details: "_readDevFSFile: $e");
+          details: '_readDevFSFile: $e');
     }
   }
 
   Future<String> _writeDevFSFile(Message message) async {
-    var writeFile = VMServiceEmbedderHooks.writeFile;
+    final writeFile = VMServiceEmbedderHooks.writeFile;
     if (writeFile == null) {
       return _encodeDevFSDisabledError(message);
     }
-    var fsName = message.params['fsName'];
+    final fsName = message.params['fsName'];
     if (fsName == null) {
       return encodeMissingParamError(message, 'fsName');
     }
     if (fsName is! String) {
       return encodeInvalidParamError(message, 'fsName');
     }
-    var fs = _fsMap[fsName];
+    final fs = _fsMap[fsName];
     if (fs == null) {
       return _encodeFileSystemDoesNotExistError(message, fsName);
     }
-    Uri uri;
+    Uri? uri;
     if (message.params['uri'] != null) {
       try {
-        var uriParam = message.params['uri'];
+        final uriParam = message.params['uri'];
         if (uriParam is! String) {
           return encodeInvalidParamError(message, 'uri');
         }
-        Uri parsedUri = Uri.parse(uriParam);
+        final parsedUri = Uri.parse(uriParam);
         uri = fs.resolve(parsedUri);
         if (uri == null) {
           return encodeInvalidParamError(message, 'uri');
@@ -298,7 +291,7 @@
         return encodeInvalidParamError(message, 'uri');
       }
     } else {
-      var path = message.params['path'];
+      final path = message.params['path'];
       if (path == null) {
         return encodeMissingParamError(message, 'path');
       }
@@ -310,45 +303,45 @@
         return encodeInvalidParamError(message, 'path');
       }
     }
-    var fileContents = message.params['fileContents'];
+    final fileContents = message.params['fileContents'];
     if (fileContents == null) {
       return encodeMissingParamError(message, 'fileContents');
     }
     if (fileContents is! String) {
       return encodeInvalidParamError(message, 'fileContents');
     }
-    List<int> decodedFileContents = base64.decode(fileContents);
+    final decodedFileContents = base64.decode(fileContents);
 
     await writeFile(uri, decodedFileContents);
     return encodeSuccess(message);
   }
 
   Future<String> _writeDevFSFiles(Message message) async {
-    var writeFile = VMServiceEmbedderHooks.writeFile;
+    final writeFile = VMServiceEmbedderHooks.writeFile;
     if (writeFile == null) {
       return _encodeDevFSDisabledError(message);
     }
-    var fsName = message.params['fsName'];
+    final fsName = message.params['fsName'];
     if (fsName == null) {
       return encodeMissingParamError(message, 'fsName');
     }
     if (fsName is! String) {
       return encodeInvalidParamError(message, 'fsName');
     }
-    var fs = _fsMap[fsName];
+    final fs = _fsMap[fsName];
     if (fs == null) {
       return _encodeFileSystemDoesNotExistError(message, fsName);
     }
-    var files = message.params['files'];
+    final files = message.params['files'];
     if (files == null) {
       return encodeMissingParamError(message, 'files');
     }
     if (files is! List) {
       return encodeInvalidParamError(message, 'files');
     }
-    var uris = [];
+    final uris = <Uri>[];
     for (int i = 0; i < files.length; i++) {
-      var fileInfo = files[i];
+      final fileInfo = files[i];
       if (fileInfo is! List ||
           fileInfo.length != 2 ||
           fileInfo[0] is! String ||
@@ -357,7 +350,7 @@
             details: "${message.method}: invalid 'files' parameter "
                 "at index ${i}: ${fileInfo}");
       }
-      var uri = fs.resolvePath(fileInfo[0]);
+      final uri = fs.resolvePath(fileInfo[0]);
       if (uri == null) {
         return encodeRpcError(message, kInvalidParams,
             details: "${message.method}: invalid 'files' parameter "
@@ -365,9 +358,9 @@
       }
       uris.add(uri);
     }
-    var pendingWrites = <Future>[];
+    final pendingWrites = <Future>[];
     for (int i = 0; i < uris.length; i++) {
-      List<int> decodedFileContents = base64.decode(files[i][1]);
+      final decodedFileContents = base64.decode(files[i][1]);
       pendingWrites.add(writeFile(uris[i], decodedFileContents));
     }
     await Future.wait(pendingWrites);
@@ -375,27 +368,27 @@
   }
 
   Future<String> _listDevFSFiles(Message message) async {
-    var listFiles = VMServiceEmbedderHooks.listFiles;
+    final listFiles = VMServiceEmbedderHooks.listFiles;
     if (listFiles == null) {
       return _encodeDevFSDisabledError(message);
     }
-    var fsName = message.params['fsName'];
+    final fsName = message.params['fsName'];
     if (fsName == null) {
       return encodeMissingParamError(message, 'fsName');
     }
     if (fsName is! String) {
       return encodeInvalidParamError(message, 'fsName');
     }
-    var fs = _fsMap[fsName];
+    final fs = _fsMap[fsName];
     if (fs == null) {
       return _encodeFileSystemDoesNotExistError(message, fsName);
     }
-    var fileList = await listFiles(fs.uri);
+    final fileList = await listFiles(fs.uri);
     // Remove any url-encoding in the filenames.
     for (int i = 0; i < fileList.length; i++) {
       fileList[i]['name'] = Uri.decodeFull(fileList[i]['name']);
     }
-    var result = {'type': 'FSFileList', 'files': fileList};
+    final result = <String, dynamic>{'type': 'FSFileList', 'files': fileList};
     return encodeResult(message, result);
   }
 }
diff --git a/sdk/lib/vmservice/message.dart b/sdk/lib/vmservice/message.dart
index 6f2abcb..ee29fe3 100644
--- a/sdk/lib/vmservice/message.dart
+++ b/sdk/lib/vmservice/message.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.6
-
 part of dart._vmservice;
 
 enum MessageType { Request, Notification, Response }
 
 class Message {
-  final Completer<Response> _completer = new Completer<Response>.sync();
+  final _completer = Completer<Response>.sync();
   bool get completed => _completer.isCompleted;
 
   /// Future of response.
   Future<Response> get response => _completer.future;
-  Client client;
+  Client? client;
 
   // Is a notification message (no serial)
   final MessageType type;
@@ -22,35 +20,35 @@
   // Client-side identifier for this message.
   final serial;
 
-  final String method;
+  final String? method;
 
-  final Map params = new Map();
-  final Map result = new Map();
-  final Map error = new Map();
+  final params = <String, dynamic>{};
+  final result = {};
+  final error = {};
 
-  factory Message.fromJsonRpc(Client client, Map map) {
+  factory Message.fromJsonRpc(Client? client, Map map) {
     if (map.containsKey('id')) {
       final id = map['id'];
       if (id != null && id is! num && id is! String) {
-        throw new Exception('"id" must be a number, string, or null.');
+        throw Exception("'id' must be a number, string, or null.");
       }
       if (map.containsKey('method')) {
-        return new Message._fromJsonRpcRequest(client, map);
+        return Message._fromJsonRpcRequest(client, map);
       }
       if (map.containsKey('result')) {
-        return new Message._fromJsonRpcResult(client, map);
+        return Message._fromJsonRpcResult(client, map);
       }
       if (map.containsKey('error')) {
-        return new Message._fromJsonRpcError(client, map);
+        return Message._fromJsonRpcError(client, map);
       }
     } else if (map.containsKey('method')) {
-      return new Message._fromJsonRpcNotification(client, map);
+      return Message._fromJsonRpcNotification(client, map);
     }
-    throw new Exception('Invalid message format');
+    throw Exception('Invalid message format');
   }
 
   // http://www.jsonrpc.org/specification#request_object
-  Message._fromJsonRpcRequest(Client client, Map map)
+  Message._fromJsonRpcRequest(Client? client, Map map)
       : client = client,
         type = MessageType.Request,
         serial = map['id'],
@@ -61,7 +59,7 @@
   }
 
   // http://www.jsonrpc.org/specification#notification
-  Message._fromJsonRpcNotification(Client client, Map map)
+  Message._fromJsonRpcNotification(Client? client, Map map)
       : client = client,
         type = MessageType.Notification,
         method = map['method'],
@@ -72,7 +70,7 @@
   }
 
   // http://www.jsonrpc.org/specification#response_object
-  Message._fromJsonRpcResult(Client client, Map map)
+  Message._fromJsonRpcResult(Client? client, Map map)
       : client = client,
         type = MessageType.Response,
         serial = map['id'],
@@ -81,7 +79,7 @@
   }
 
   // http://www.jsonrpc.org/specification#response_object
-  Message._fromJsonRpcError(Client client, Map map)
+  Message._fromJsonRpcError(Client? client, Map map)
       : client = client,
         type = MessageType.Response,
         serial = map['id'],
@@ -90,10 +88,7 @@
   }
 
   static String _methodNameFromUri(Uri uri) {
-    if (uri == null) {
-      return '';
-    }
-    if (uri.pathSegments.length == 0) {
+    if (uri == null || uri.pathSegments.length == 0) {
       return '';
     }
     return uri.pathSegments[0];
@@ -120,16 +115,12 @@
     params['isolateId'] = isolate.serviceId;
   }
 
-  Uri toUri() {
-    return new Uri(path: method, queryParameters: params);
-  }
+  Uri toUri() => Uri(path: method!, queryParameters: params);
 
-  dynamic toJson() {
-    throw 'unsupported';
-  }
+  dynamic toJson() => throw 'unsupported';
 
-  dynamic forwardToJson([Map overloads]) {
-    Map<dynamic, dynamic> json = {'jsonrpc': '2.0', 'id': serial};
+  Map<String, dynamic> forwardToJson([Map<String, dynamic>? overloads]) {
+    final json = <String, dynamic>{'jsonrpc': '2.0', 'id': serial};
     switch (type) {
       case MessageType.Request:
       case MessageType.Notification:
@@ -157,10 +148,7 @@
   // This has a side effect that boolean literal values like true become 'true'
   // and thus indistinguishable from the string literal 'true'.
   List<String> _makeAllString(List list) {
-    if (list == null) {
-      return null;
-    }
-    var new_list = new List<String>(list.length);
+    var new_list = List<String>.filled(list.length, "");
     for (var i = 0; i < list.length; i++) {
       new_list[i] = list[i].toString();
     }
@@ -168,14 +156,14 @@
   }
 
   Future<Response> sendToIsolate(SendPort sendPort) {
-    final receivePort = new RawReceivePort();
+    final receivePort = RawReceivePort();
     receivePort.handler = (value) {
       receivePort.close();
       _setResponseFromPort(value);
     };
-    var keys = _makeAllString(params.keys.toList(growable: false));
-    var values = _makeAllString(params.values.toList(growable: false));
-    var request = new List(6)
+    final keys = _makeAllString(params.keys.toList(growable: false));
+    final values = _makeAllString(params.values.toList(growable: false));
+    final request = List<dynamic>.filled(6, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = receivePort.sendPort
       ..[2] = serial
@@ -184,7 +172,7 @@
       ..[5] = values;
     if (!sendIsolateServiceMessage(sendPort, request)) {
       receivePort.close();
-      _completer.complete(new Response.internalError(
+      _completer.complete(Response.internalError(
           'could not send message [${serial}] to isolate'));
     }
     return _completer.future;
@@ -212,19 +200,18 @@
   }
 
   Future<Response> sendToVM() {
-    final receivePort = new RawReceivePort();
+    final receivePort = RawReceivePort();
     receivePort.handler = (value) {
       receivePort.close();
       _setResponseFromPort(value);
     };
     var keys = params.keys.toList(growable: false);
     var values = params.values.toList(growable: false);
-    if (!_methodNeedsObjectParameters(method)) {
+    if (!_methodNeedsObjectParameters(method!)) {
       keys = _makeAllString(keys);
       values = _makeAllString(values);
     }
-
-    final request = new List(6)
+    final request = List<dynamic>.filled(6, null)
       ..[0] = 0 // Make room for OOB message type.
       ..[1] = receivePort.sendPort
       ..[2] = serial
@@ -232,7 +219,7 @@
       ..[4] = keys
       ..[5] = values;
 
-    if (_methodNeedsObjectParameters(method)) {
+    if (_methodNeedsObjectParameters(method!)) {
       // We use a different method invocation path here.
       sendObjectRootServiceMessage(request);
     } else {
@@ -251,19 +238,17 @@
     _completer.complete(Response.from(response));
   }
 
-  void setResponse(String response) {
-    _completer.complete(new Response(ResponsePayloadKind.String, response));
-  }
+  void setResponse(String response) =>
+      _completer.complete(Response(ResponsePayloadKind.String, response));
 
-  void setErrorResponse(int code, String details) {
-    setResponse(encodeRpcError(this, code, details: '$method: $details'));
-  }
+  void setErrorResponse(int code, String details) =>
+      setResponse(encodeRpcError(this, code, details: '$method: $details'));
 }
 
 bool sendIsolateServiceMessage(SendPort sp, List m)
-    native "VMService_SendIsolateServiceMessage";
+    native 'VMService_SendIsolateServiceMessage';
 
-void sendRootServiceMessage(List m) native "VMService_SendRootServiceMessage";
+void sendRootServiceMessage(List m) native 'VMService_SendRootServiceMessage';
 
 void sendObjectRootServiceMessage(List m)
-    native "VMService_SendObjectRootServiceMessage";
+    native 'VMService_SendObjectRootServiceMessage';
diff --git a/sdk/lib/vmservice/message_router.dart b/sdk/lib/vmservice/message_router.dart
index 90ed184..2ca8d4f 100644
--- a/sdk/lib/vmservice/message_router.dart
+++ b/sdk/lib/vmservice/message_router.dart
@@ -2,12 +2,10 @@
 // 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.6
-
 part of dart._vmservice;
 
 abstract class MessageRouter {
-  Future<Response> routeRequest(VMService service, Message message);
+  Future<Response?> routeRequest(VMService service, Message message);
   void routeResponse(Message message);
 }
 
@@ -35,6 +33,8 @@
         case ResponsePayloadKind.Binary:
         case ResponsePayloadKind.Utf8String:
           return payload is Uint8List;
+        default:
+          return false;
       }
     }());
   }
@@ -44,14 +44,12 @@
   Response.json(Object value)
       : this(ResponsePayloadKind.String, json.encode(value));
 
-  factory Response.internalError(String message) {
-    return new Response.json({
-      'type': 'ServiceError',
-      'id': '',
-      'kind': 'InternalError',
-      'message': message,
-    });
-  }
+  factory Response.internalError(String message) => Response.json({
+        'type': 'ServiceError',
+        'id': '',
+        'kind': 'InternalError',
+        'message': message,
+      });
 
   /// Construct response from the response [value] which can be either:
   ///     String: a string
@@ -59,13 +57,12 @@
   ///     Utf8String: a single element list containing Uint8List
   factory Response.from(Object value) {
     if (value is String) {
-      return new Response(ResponsePayloadKind.String, value);
+      return Response(ResponsePayloadKind.String, value);
     } else if (value is Uint8List) {
-      return new Response(ResponsePayloadKind.Binary, value);
+      return Response(ResponsePayloadKind.Binary, value);
     } else if (value is List) {
       assert(value.length == 1);
-      return new Response(
-          ResponsePayloadKind.Utf8String, value[0] as Uint8List);
+      return Response(ResponsePayloadKind.Utf8String, value[0] as Uint8List);
     } else if (value is Response) {
       return value;
     } else {
diff --git a/sdk/lib/vmservice/named_lookup.dart b/sdk/lib/vmservice/named_lookup.dart
index 0b5c044..d611c3d 100644
--- a/sdk/lib/vmservice/named_lookup.dart
+++ b/sdk/lib/vmservice/named_lookup.dart
@@ -2,18 +2,16 @@
 // 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.6
-
 part of dart._vmservice;
 
 /// Set like containes which automatically generated String ids for its items
-class NamedLookup<E> extends Object with IterableMixin<E> {
+class NamedLookup<E extends Object> extends Object with IterableMixin<E> {
   final IdGenerator _generator;
-  final Map<String, E> _elements = new Map<String, E>();
-  final Map<E, String> _ids = new Map<E, String>();
+  final _elements = <String, E>{};
+  final _ids = <E, String>{};
 
   NamedLookup({String prologue = ''})
-      : _generator = new IdGenerator(prologue: prologue);
+      : _generator = IdGenerator(prologue: prologue);
 
   void add(E e) {
     final id = _generator.newId();
@@ -22,13 +20,13 @@
   }
 
   void remove(E e) {
-    final id = _ids.remove(e);
+    final id = _ids.remove(e)!;
     _elements.remove(id);
     _generator.release(id);
   }
 
-  E operator [](String id) => _elements[id];
-  String keyOf(E e) => _ids[e];
+  E operator [](String id) => _elements[id]!;
+  String keyOf(E e) => _ids[e]!;
 
   Iterator<E> get iterator => _ids.keys.iterator;
 }
@@ -38,10 +36,10 @@
   /// Fixed initial part of the id
   final String prologue;
   // Ids in use
-  final Set<String> _used = new Set<String>();
+  final _used = <String>{};
 
   /// Ids that has been released (use these before generate new ones)
-  final Set<String> _free = new Set<String>();
+  final _free = <String>{};
 
   /// Next id to generate if no one can be recycled (first use _free);
   int _next = 0;
diff --git a/sdk/lib/vmservice/running_isolate.dart b/sdk/lib/vmservice/running_isolate.dart
index 8f21a66..029c6aa 100644
--- a/sdk/lib/vmservice/running_isolate.dart
+++ b/sdk/lib/vmservice/running_isolate.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.6
-
 part of dart._vmservice;
 
 class RunningIsolate implements MessageRouter {
@@ -52,7 +50,7 @@
     }
   }
 
-  bool _shouldResume(VMService service, Client client, int pauseType) {
+  bool _shouldResume(VMService service, Client? client, int pauseType) {
     if (client != null) {
       // Mark the approval by the client.
       _resumeApprovalsByName.add(client.name);
@@ -107,7 +105,7 @@
     var pauseType;
     try {
       pauseType = await _isolatePauseType(service, message.params['isolateId']);
-    } catch (errorResponse) {
+    } on Response catch (errorResponse) {
       return errorResponse;
     }
     if (pauseType == kInvalidPauseEvent ||
diff --git a/sdk/lib/vmservice/running_isolates.dart b/sdk/lib/vmservice/running_isolates.dart
index 191a8d1..20ab8a2 100644
--- a/sdk/lib/vmservice/running_isolates.dart
+++ b/sdk/lib/vmservice/running_isolates.dart
@@ -2,13 +2,11 @@
 // 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.6
-
 part of dart._vmservice;
 
 class RunningIsolates implements MessageRouter {
-  final Map<int, RunningIsolate> isolates = new Map<int, RunningIsolate>();
-  int _rootPortId;
+  final isolates = <int, RunningIsolate>{};
+  int? _rootPortId;
 
   RunningIsolates();
 
@@ -16,7 +14,7 @@
     if (_rootPortId == null) {
       _rootPortId = portId;
     }
-    var ri = new RunningIsolate(portId, sp, name);
+    var ri = RunningIsolate(portId, sp, name);
     isolates[portId] = ri;
   }
 
@@ -29,7 +27,7 @@
 
   @override
   Future<Response> routeRequest(VMService service, Message message) {
-    String isolateParam = message.params['isolateId'];
+    String isolateParam = message.params['isolateId']!;
     int isolateId;
     if (!isolateParam.startsWith('isolates/')) {
       message.setErrorResponse(
@@ -38,7 +36,7 @@
     }
     isolateParam = isolateParam.substring('isolates/'.length);
     if (isolateParam == 'root') {
-      isolateId = _rootPortId;
+      isolateId = _rootPortId!;
     } else {
       try {
         isolateId = int.parse(isolateParam);
@@ -48,11 +46,11 @@
         return message.response;
       }
     }
-    var isolate = isolates[isolateId];
+    final isolate = isolates[isolateId];
     if (isolate == null) {
       // There is some chance that this isolate may have lived before,
       // so return a sentinel rather than an error.
-      var result = {
+      final result = <String, String>{
         'type': 'Sentinel',
         'kind': 'Collected',
         'valueAsString': '<collected>',
@@ -62,7 +60,7 @@
     }
 
     if (message.method == 'evaluateInFrame' || message.method == 'evaluate') {
-      return new _Evaluator(message, isolate, service).run();
+      return _Evaluator(message, isolate, service).run();
     } else {
       return isolate.routeRequest(service, message);
     }
@@ -77,11 +75,19 @@
   _Evaluator(this._message, this._isolate, this._service);
 
   Future<Response> run() async {
-    Response buildScopeResponse = await _buildScope();
-    Map<String, dynamic> responseJson = buildScopeResponse.decodeJson();
+    if (_service.ddsUri != null) {
+      return Response.from(encodeRpcError(
+        _message,
+        kInternalError,
+        details: 'Fell through to VM Service expression evaluation when a DDS '
+            'instance was connected. Please file an issue on GitHub.',
+      ));
+    }
+    final buildScopeResponse = await _buildScope();
+    final responseJson = buildScopeResponse.decodeJson();
 
     if (responseJson.containsKey('error')) {
-      return new Response.from(encodeCompilationError(
+      return Response.from(encodeCompilationError(
           _message, responseJson['error']['data']['details']));
     }
 
@@ -89,9 +95,9 @@
     try {
       kernelBase64 = await _compileExpression(responseJson['result']);
     } catch (e) {
-      return new Response.from(encodeCompilationError(_message, e.toString()));
+      return Response.from(encodeCompilationError(_message, e.toString()));
     }
-    return _evaluateCompiledExpression(kernelBase64);
+    return await _evaluateCompiledExpression(kernelBase64);
   }
 
   Message _message;
@@ -99,9 +105,9 @@
   VMService _service;
 
   Future<Response> _buildScope() {
-    Map<String, dynamic> params = _setupParams();
+    final params = _setupParams();
     params['isolateId'] = _message.params['isolateId'];
-    Map buildScopeParams = {
+    final buildScopeParams = <String, dynamic>{
       'method': '_buildExpressionEvaluationScope',
       'id': _message.serial,
       'params': params,
@@ -109,8 +115,8 @@
     if (_message.params['scope'] != null) {
       buildScopeParams['params']['scope'] = _message.params['scope'];
     }
-    var buildScope =
-        new Message._fromJsonRpcRequest(_message.client, buildScopeParams);
+    final buildScope =
+        Message._fromJsonRpcRequest(_message.client!, buildScopeParams);
 
     // Decode the JSON and and insert it into the map. The map key
     // is the request Uri.
@@ -119,42 +125,40 @@
 
   Future<String> _compileExpression(
       Map<String, dynamic> buildScopeResponseResult) {
-    Client externalClient =
+    Client? externalClient =
         _service._findFirstClientThatHandlesService('compileExpression');
 
-    Map compileParams = {
-      'isolateId': _message.params['isolateId'],
-      'expression': _message.params['expression'],
-      'definitions': buildScopeResponseResult['param_names'],
-      'typeDefinitions': buildScopeResponseResult['type_params_names'],
-      'libraryUri': buildScopeResponseResult['libraryUri'],
-      'isStatic': buildScopeResponseResult['isStatic'],
+    final compileParams = <String, dynamic>{
+      'isolateId': _message.params['isolateId']!,
+      'expression': _message.params['expression']!,
+      'definitions': buildScopeResponseResult['param_names']!,
+      'typeDefinitions': buildScopeResponseResult['type_params_names']!,
+      'libraryUri': buildScopeResponseResult['libraryUri']!,
+      'isStatic': buildScopeResponseResult['isStatic']!,
     };
-    dynamic klass = buildScopeResponseResult['klass'];
+    final klass = buildScopeResponseResult['klass'];
     if (klass != null) {
       compileParams['klass'] = klass;
     }
     if (externalClient != null) {
-      var compileExpression = new Message.forMethod('compileExpression');
+      final compileExpression = Message.forMethod('compileExpression');
       compileExpression.client = externalClient;
       compileExpression.params.addAll(compileParams);
 
       final id = _service._serviceRequests.newId();
       final oldId = _message.serial;
-      final completer = new Completer<String>();
-      externalClient.serviceHandles[id] = (Message m) {
+      final completer = Completer<String>();
+      externalClient.serviceHandles[id] = (Message? m) {
         if (m != null) {
           completer.complete(json.encode(m.forwardToJson({'id': oldId})));
         } else {
           completer.complete(encodeRpcError(_message, kServiceDisappeared));
         }
       };
-      externalClient.post(new Response.json(compileExpression
+      externalClient.post(Response.json(compileExpression
           .forwardToJson({'id': id, 'method': 'compileExpression'})));
-      return completer.future
-          .then((String s) => jsonDecode(s))
-          .then((dynamic json) {
-        Map<String, dynamic> jsonMap = json;
+      return completer.future.then((s) => jsonDecode(s)).then((json) {
+        final Map<String, dynamic> jsonMap = json;
         if (jsonMap.containsKey('error')) {
           throw jsonMap['error'];
         }
@@ -162,18 +166,18 @@
       });
     } else {
       // fallback to compile using kernel service
-      Map compileExpressionParams = {
+      final compileExpressionParams = <String, dynamic>{
         'method': '_compileExpression',
         'id': _message.serial,
         'params': compileParams,
       };
-      var compileExpression = new Message._fromJsonRpcRequest(
-          _message.client, compileExpressionParams);
+      final compileExpression = Message._fromJsonRpcRequest(
+          _message.client!, compileExpressionParams);
 
       return _isolate
           .routeRequest(_service, compileExpression)
-          .then((Response response) => response.decodeJson())
-          .then((dynamic json) {
+          .then((response) => response.decodeJson())
+          .then((json) {
         if (json['result'] != null) {
           return json['result']['kernelBytes'];
         }
@@ -184,11 +188,11 @@
 
   Future<Response> _evaluateCompiledExpression(String kernelBase64) {
     if (kernelBase64.isNotEmpty) {
-      Map<String, dynamic> params = _setupParams();
+      final params = _setupParams();
       params['isolateId'] = _message.params['isolateId'];
       params['kernelBytes'] = kernelBase64;
       params['disableBreakpoints'] = _message.params['disableBreakpoints'];
-      Map runParams = {
+      final runParams = <String, dynamic>{
         'method': '_evaluateCompiledExpression',
         'id': _message.serial,
         'params': params,
@@ -196,8 +200,8 @@
       if (_message.params['scope'] != null) {
         runParams['params']['scope'] = _message.params['scope'];
       }
-      var runExpression =
-          new Message._fromJsonRpcRequest(_message.client, runParams);
+      final runExpression =
+          Message._fromJsonRpcRequest(_message.client!, runParams);
       return _isolate.routeRequest(_service, runExpression); // _message
     } else {
       // empty kernel indicates dart1 mode
diff --git a/sdk/lib/vmservice/vmservice.dart b/sdk/lib/vmservice/vmservice.dart
index 0cd0eeb..23f555b 100644
--- a/sdk/lib/vmservice/vmservice.dart
+++ b/sdk/lib/vmservice/vmservice.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.6
-
 library dart._vmservice;
 
 import 'dart:async';
@@ -23,8 +21,8 @@
 part 'message_router.dart';
 part 'named_lookup.dart';
 
-final RawReceivePort isolateControlPort = new RawReceivePort();
-final RawReceivePort scriptLoadPort = new RawReceivePort();
+final isolateControlPort = RawReceivePort();
+final scriptLoadPort = RawReceivePort();
 
 abstract class IsolateEmbedderData {
   void cleanup();
@@ -32,8 +30,8 @@
 
 String _makeAuthToken() {
   final kTokenByteSize = 8;
-  Uint8List bytes = new Uint8List(kTokenByteSize);
-  Random random = new Random.secure();
+  Uint8List bytes = Uint8List(kTokenByteSize);
+  Random random = Random.secure();
   for (int i = 0; i < kTokenByteSize; i++) {
     bytes[i] = random.nextInt(256);
   }
@@ -41,16 +39,15 @@
 }
 
 // The randomly generated auth token used to access the VM service.
-final String serviceAuthToken = _makeAuthToken();
+final serviceAuthToken = _makeAuthToken();
 
 // This is for use by the embedder. It is a map from the isolateId to
 // anything implementing IsolateEmbedderData. When an isolate goes away,
 // the cleanup method will be invoked after being removed from the map.
-final Map<int, IsolateEmbedderData> isolateEmbedderData =
-    new Map<int, IsolateEmbedderData>();
+final isolateEmbedderData = <int, IsolateEmbedderData>{};
 
 // These must be kept in sync with the declarations in vm/json_stream.h and
-// pkg/dds/lib/src/stream_manager.dart.
+// pkg/dds/lib/src/rpc_error_codes.dart.
 const kParseError = -32700;
 const kInvalidRequest = -32600;
 const kMethodNotFound = -32601;
@@ -79,7 +76,7 @@
 const kFileSystemDoesNotExist = 1002;
 const kFileDoesNotExist = 1003;
 
-var _errorMessages = {
+final _errorMessages = <int, String>{
   kInvalidParams: 'Invalid params',
   kInternalError: 'Internal error',
   kFeatureDisabled: 'Feature is disabled',
@@ -95,8 +92,8 @@
       'due to the current configuration',
 };
 
-String encodeRpcError(Message message, int code, {String details}) {
-  var response = {
+String encodeRpcError(Message message, int code, {String? details}) {
+  final response = <String, dynamic>{
     'jsonrpc': '2.0',
     'id': message.serial,
     'error': {
@@ -105,43 +102,36 @@
     },
   };
   if (details != null) {
-    response['error']['data'] = {
+    response['error']['data'] = <String, String>{
       'details': details,
     };
   }
   return json.encode(response);
 }
 
-String encodeMissingParamError(Message message, String param) {
-  return encodeRpcError(message, kInvalidParams,
-      details: "${message.method} expects the '${param}' parameter");
-}
+String encodeMissingParamError(Message message, String param) =>
+    encodeRpcError(message, kInvalidParams,
+        details: "${message.method} expects the '${param}' parameter");
 
 String encodeInvalidParamError(Message message, String param) {
-  var value = message.params[param];
+  final value = message.params[param];
   return encodeRpcError(message, kInvalidParams,
       details: "${message.method}: invalid '${param}' parameter: ${value}");
 }
 
-String encodeCompilationError(Message message, String diagnostic) {
-  return encodeRpcError(message, kExpressionCompilationError,
-      details: diagnostic);
-}
+String encodeCompilationError(Message message, String diagnostic) =>
+    encodeRpcError(message, kExpressionCompilationError, details: diagnostic);
 
-String encodeResult(Message message, Map result) {
-  var response = {
-    'jsonrpc': '2.0',
-    'id': message.serial,
-    'result': result,
-  };
-  return json.encode(response);
-}
+String encodeResult(Message message, Map result) => json.encode({
+      'jsonrpc': '2.0',
+      'id': message.serial,
+      'result': result,
+    });
 
-String encodeSuccess(Message message) {
-  return encodeResult(message, {'type': 'Success'});
-}
+String encodeSuccess(Message message) =>
+    encodeResult(message, {'type': 'Success'});
 
-const shortDelay = const Duration(milliseconds: 10);
+const shortDelay = Duration(milliseconds: 10);
 
 /// Called when the server should be started.
 typedef Future ServerStartCallback();
@@ -174,10 +164,10 @@
 typedef Future<Uri> ServerInformamessage_routertionCallback();
 
 /// Called when we need information about the server.
-typedef Future<Uri> ServerInformationCallback();
+typedef Uri? ServerInformationCallback();
 
 /// Called when we want to [enable] or disable the web server.
-typedef Future<Uri> WebServerControlCallback(bool enable);
+typedef Future<Uri?> WebServerControlCallback(bool enable);
 
 /// Called when we want to [enable] or disable new websocket connections to the
 /// server.
@@ -185,18 +175,18 @@
 
 /// Hooks that are setup by the embedder.
 class VMServiceEmbedderHooks {
-  static ServerStartCallback serverStart;
-  static ServerStopCallback serverStop;
-  static CleanupCallback cleanup;
-  static CreateTempDirCallback createTempDir;
-  static DeleteDirCallback deleteDir;
-  static WriteFileCallback writeFile;
-  static WriteStreamFileCallback writeStreamFile;
-  static ReadFileCallback readFile;
-  static ListFilesCallback listFiles;
-  static ServerInformationCallback serverInformation;
-  static WebServerControlCallback webServerControl;
-  static WebServerAcceptNewWebSocketConnectionsCallback
+  static ServerStartCallback? serverStart;
+  static ServerStopCallback? serverStop;
+  static CleanupCallback? cleanup;
+  static CreateTempDirCallback? createTempDir;
+  static DeleteDirCallback? deleteDir;
+  static WriteFileCallback? writeFile;
+  static WriteStreamFileCallback? writeStreamFile;
+  static ReadFileCallback? readFile;
+  static ListFilesCallback? listFiles;
+  static ServerInformationCallback? serverInformation;
+  static WebServerControlCallback? webServerControl;
+  static WebServerAcceptNewWebSocketConnectionsCallback?
       acceptNewWebSocketConnections;
 }
 
@@ -206,21 +196,20 @@
 }
 
 class VMService extends MessageRouter {
-  static VMService _instance;
+  static VMService? _instance;
 
   static const serviceNamespace = 's';
 
   /// Collection of currently connected clients.
-  final NamedLookup<Client> clients =
-      new NamedLookup<Client>(prologue: serviceNamespace);
-  final IdGenerator _serviceRequests = new IdGenerator(prologue: 'sr');
+  final clients = NamedLookup<Client>(prologue: serviceNamespace);
+  final _serviceRequests = IdGenerator(prologue: 'sr');
 
   /// Mapping of client names to all clients of that name and their resume
   /// permissions.
   final Map<String, _ClientResumePermissions> clientResumePermissions = {};
 
   /// Collection of currently running isolates.
-  RunningIsolates runningIsolates = new RunningIsolates();
+  final runningIsolates = RunningIsolates();
 
   /// Flag to indicate VM service is exiting.
   bool isExiting = false;
@@ -228,10 +217,10 @@
   /// A port used to receive events from the VM.
   final RawReceivePort eventPort;
 
-  final devfs = new DevFS();
+  final devfs = DevFS();
 
-  Uri get ddsUri => _ddsUri;
-  Uri _ddsUri;
+  Uri? get ddsUri => _ddsUri;
+  Uri? _ddsUri;
 
   Future<String> _yieldControlToDDS(Message message) async {
     final acceptNewWebSocketConnections =
@@ -294,7 +283,7 @@
   /// If any resume approvals were set for this client previously they will
   /// need to be reset after a name change.
   String _setClientName(Message message) {
-    final client = message.client;
+    final client = message.client!;
     if (!message.params.containsKey('name')) {
       return encodeRpcError(message, kInvalidParams,
           details: "setClientName: missing required parameter 'name'");
@@ -310,15 +299,16 @@
 
   void _setClientNameHelper(Client client, String name) {
     _clearClientName(client);
-    client.name = name.isEmpty ? client.defaultClientName : name;
+    name = name.isEmpty ? client.defaultClientName : name;
+    client.name = name;
     clientResumePermissions.putIfAbsent(
         client.name, () => _ClientResumePermissions());
-    clientResumePermissions[client.name].clients.add(client);
+    clientResumePermissions[name]!.clients.add(client);
   }
 
   String _getClientName(Message message) => encodeResult(message, {
         'type': 'ClientName',
-        'name': message.client.name,
+        'name': message.client!.name,
       });
 
   String _requirePermissionToResume(Message message) {
@@ -334,7 +324,7 @@
       return arg;
     }
 
-    final client = message.client;
+    final client = message.client!;
     int pauseTypeMask = 0;
     try {
       if (parsePermission('onPauseStart')) {
@@ -346,25 +336,24 @@
       if (parsePermission('onPauseExit')) {
         pauseTypeMask |= RunningIsolate.kPauseOnExitMask;
       }
-    } catch (rpcError) {
+    } on dynamic catch (rpcError) {
       return rpcError;
     }
 
-    clientResumePermissions[client.name].permissionsMask = pauseTypeMask;
+    clientResumePermissions[client.name]!.permissionsMask = pauseTypeMask;
     return encodeSuccess(message);
   }
 
   void _addClient(Client client) {
     assert(client.streams.isEmpty);
     assert(client.services.isEmpty);
-    _setClientNameHelper(client, client.defaultClientName);
     clients.add(client);
   }
 
   void _removeClient(Client client) {
     final namespace = clients.keyOf(client);
     clients.remove(client);
-    for (var streamId in client.streams) {
+    for (final streamId in client.streams) {
       if (!_isAnyClientSubscribed(streamId)) {
         _vmCancelStream(streamId);
       }
@@ -373,18 +362,18 @@
     // Clean up client approvals state.
     _clearClientName(client);
 
-    for (var service in client.services.keys) {
+    for (final service in client.services.keys) {
       _eventMessageHandler(
           'Service',
-          new Response.json({
+          Response.json({
             'jsonrpc': '2.0',
             'method': 'streamNotify',
             'params': {
               'streamId': 'Service',
               'event': {
-                "type": "Event",
-                "kind": "ServiceUnregistered",
-                'timestamp': new DateTime.now().millisecondsSinceEpoch,
+                'type': 'Event',
+                'kind': 'ServiceUnregistered',
+                'timestamp': DateTime.now().millisecondsSinceEpoch,
                 'service': service,
                 'method': namespace + '.' + service,
               }
@@ -392,7 +381,7 @@
           }));
     }
     // Complete all requests as failed
-    for (var handle in client.serviceHandles.values) {
+    for (final handle in client.serviceHandles.values) {
       handle(null);
     }
     if (clients.isEmpty) {
@@ -408,7 +397,7 @@
   }
 
   void _eventMessageHandler(String streamId, Response event) {
-    for (var client in clients) {
+    for (final client in clients) {
       if (client.sendEvents && client.streams.contains(streamId)) {
         client.post(event);
       }
@@ -422,57 +411,56 @@
         break;
       case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID:
         runningIsolates.isolateShutdown(portId, sp);
-        IsolateEmbedderData ied = isolateEmbedderData.remove(portId);
-        if (ied != null) {
-          ied.cleanup();
-        }
+        isolateEmbedderData.remove(portId)?.cleanup();
         break;
     }
   }
 
-  Future<Null> _serverMessageHandler(int code, SendPort sp, bool enable) async {
+  Future<void> _serverMessageHandler(int code, SendPort sp, bool enable) async {
     switch (code) {
       case Constants.WEB_SERVER_CONTROL_MESSAGE_ID:
-        if (VMServiceEmbedderHooks.webServerControl == null) {
+        final webServerControl = VMServiceEmbedderHooks.webServerControl;
+        if (webServerControl == null) {
           sp.send(null);
           return;
         }
-        Uri uri = await VMServiceEmbedderHooks.webServerControl(enable);
+        final uri = await webServerControl(enable);
         sp.send(uri);
         break;
       case Constants.SERVER_INFO_MESSAGE_ID:
-        if (VMServiceEmbedderHooks.serverInformation == null) {
+        final serverInformation = VMServiceEmbedderHooks.serverInformation;
+        if (serverInformation == null) {
           sp.send(null);
           return;
         }
-        Uri uri = await VMServiceEmbedderHooks.serverInformation();
+        final uri = await serverInformation();
         sp.send(uri);
         break;
     }
   }
 
-  Future<Null> _handleNativeRpcCall(message, SendPort replyPort) async {
-    // Keep in sync with "runtime/vm/service_isolate.cc:InvokeServiceRpc".
+  Future<void> _handleNativeRpcCall(message, SendPort replyPort) async {
+    // Keep in sync with 'runtime/vm/service_isolate.cc:InvokeServiceRpc'.
     Response response;
 
     try {
-      final Message rpc = new Message.fromJsonRpc(
+      final rpc = Message.fromJsonRpc(
           null, json.decode(utf8.decode(message as List<int>)));
       if (rpc.type != MessageType.Request) {
-        response = new Response.internalError(
+        response = Response.internalError(
             'The client sent a non-request json-rpc message.');
       } else {
-        response = await routeRequest(this, rpc);
+        response = (await routeRequest(this, rpc))!;
       }
     } catch (exception) {
-      response = new Response.internalError(
+      response = Response.internalError(
           'The rpc call resulted in exception: $exception.');
     }
-    List<int> bytes;
+    late List<int> bytes;
     switch (response.kind) {
       case ResponsePayloadKind.String:
         bytes = utf8.encode(response.payload);
-        bytes = bytes is Uint8List ? bytes : new Uint8List.fromList(bytes);
+        bytes = bytes is Uint8List ? bytes : Uint8List.fromList(bytes);
         break;
       case ResponsePayloadKind.Binary:
       case ResponsePayloadKind.Utf8String:
@@ -485,9 +473,10 @@
   Future _exit() async {
     isExiting = true;
 
+    final serverStop = VMServiceEmbedderHooks.serverStop;
     // Stop the server.
-    if (VMServiceEmbedderHooks.serverStop != null) {
-      await VMServiceEmbedderHooks.serverStop();
+    if (serverStop != null) {
+      await serverStop();
     }
 
     // Close receive ports.
@@ -496,13 +485,14 @@
 
     // Create a copy of the set as a list because client.disconnect() will
     // alter the connected clients set.
-    var clientsList = clients.toList();
-    for (var client in clientsList) {
+    final clientsList = clients.toList();
+    for (final client in clientsList) {
       client.disconnect();
     }
     devfs.cleanup();
-    if (VMServiceEmbedderHooks.cleanup != null) {
-      await VMServiceEmbedderHooks.cleanup();
+    final cleanup = VMServiceEmbedderHooks.cleanup;
+    if (cleanup != null) {
+      await cleanup();
     }
 
     // Notify the VM that we have exited.
@@ -513,7 +503,7 @@
     if (message is List) {
       if (message.length == 2) {
         // This is an event.
-        _eventMessageHandler(message[0], new Response.from(message[1]));
+        _eventMessageHandler(message[0], Response.from(message[1]));
         return;
       }
       if (message.length == 1) {
@@ -550,15 +540,17 @@
   }
 
   factory VMService() {
-    if (VMService._instance == null) {
-      VMService._instance = new VMService._internal();
+    VMService? instance = VMService._instance;
+    if (instance == null) {
+      instance = VMService._internal();
+      VMService._instance = instance;
       _onStart();
     }
-    return _instance;
+    return instance;
   }
 
   bool _isAnyClientSubscribed(String streamId) {
-    for (var client in clients) {
+    for (final client in clients) {
       if (client.streams.contains(streamId)) {
         return true;
       }
@@ -566,7 +558,7 @@
     return false;
   }
 
-  Client _findFirstClientThatHandlesService(String service) {
+  Client? _findFirstClientThatHandlesService(String service) {
     if (clients != null) {
       for (Client c in clients) {
         if (c.services.containsKey(service)) {
@@ -578,11 +570,11 @@
   }
 
   static const kServiceStream = 'Service';
-  static const serviceStreams = const [kServiceStream];
+  static const serviceStreams = <String>[kServiceStream];
 
   Future<String> _streamListen(Message message) async {
-    var client = message.client;
-    var streamId = message.params['streamId'];
+    final client = message.client!;
+    final streamId = message.params['streamId']!;
 
     if (client.streams.contains(streamId)) {
       return encodeRpcError(message, kStreamAlreadySubscribed);
@@ -612,8 +604,8 @@
   }
 
   Future<String> _streamCancel(Message message) async {
-    var client = message.client;
-    var streamId = message.params['streamId'];
+    final client = message.client!;
+    final streamId = message.params['streamId']!;
 
     if (!client.streams.contains(streamId)) {
       return encodeRpcError(message, kStreamNotSubscribed);
@@ -634,7 +626,7 @@
   static String _getMethod(String method) => method.split('.').last;
 
   Future<String> _registerService(Message message) async {
-    final client = message.client;
+    final client = message.client!;
     final service = message.params['service'];
     final alias = message.params['alias'];
 
@@ -651,7 +643,7 @@
     }
     client.services[service] = alias;
 
-    bool removed;
+    bool removed = false;
     try {
       // Do not send streaming events to the client which registers the service
       removed = client.streams.remove(kServiceStream);
@@ -663,19 +655,19 @@
     return encodeSuccess(message);
   }
 
-  _sendServiceRegisteredEvent(Client client, String service,
-      {Client target}) async {
+  Future<void> _sendServiceRegisteredEvent(Client client, String service,
+      {Client? target}) async {
     final namespace = clients.keyOf(client);
     final alias = client.services[service];
-    final event = new Response.json({
+    final event = Response.json({
       'jsonrpc': '2.0',
       'method': 'streamNotify',
       'params': {
         'streamId': kServiceStream,
         'event': {
-          "type": "Event",
-          "kind": "ServiceRegistered",
-          'timestamp': new DateTime.now().millisecondsSinceEpoch,
+          'type': 'Event',
+          'kind': 'ServiceRegistered',
+          'timestamp': DateTime.now().millisecondsSinceEpoch,
           'service': service,
           'method': namespace + '.' + service,
           'alias': alias
@@ -690,28 +682,28 @@
   }
 
   Future<String> _handleService(Message message) async {
-    final namespace = _getNamespace(message.method);
-    final method = _getMethod(message.method);
+    final namespace = _getNamespace(message.method!);
+    final method = _getMethod(message.method!);
     final client = clients[namespace];
     if (client != null) {
       if (client.services.containsKey(method)) {
         final id = _serviceRequests.newId();
         final oldId = message.serial;
-        final completer = new Completer<String>();
-        client.serviceHandles[id] = (Message m) {
+        final completer = Completer<String>();
+        client.serviceHandles[id] = (Message? m) {
           if (m != null) {
             completer.complete(json.encode(m.forwardToJson({'id': oldId})));
           } else {
             completer.complete(encodeRpcError(message, kServiceDisappeared));
           }
         };
-        client.post(new Response.json(
-            message.forwardToJson({'id': id, 'method': method})));
+        client.post(
+            Response.json(message.forwardToJson({'id': id, 'method': method})));
         return completer.future;
       }
     }
     return encodeRpcError(message, kMethodNotFound,
-        details: "Unknown service: ${message.method}");
+        details: 'Unknown service: ${message.method}');
   }
 
   Future<String> _getSupportedProtocols(Message message) async {
@@ -733,14 +725,14 @@
     return encodeResult(message, protocols);
   }
 
-  Future<Response> routeRequest(VMService _, Message message) async {
+  Future<Response?> routeRequest(VMService _, Message message) async {
     final response = await _routeRequestImpl(message);
     if (response == null) {
       // We should only have a null response for Notifications.
       assert(message.type == MessageType.Notification);
       return null;
     }
-    return new Response.from(response);
+    return Response.from(response);
   }
 
   Future _routeRequestImpl(Message message) async {
@@ -775,7 +767,7 @@
       if (devfs.shouldHandleMessage(message)) {
         return await devfs.handleMessage(message);
       }
-      if (_hasNamespace(message.method)) {
+      if (_hasNamespace(message.method!)) {
         return await _handleService(message);
       }
       if (message.params['isolateId'] != null) {
@@ -789,42 +781,41 @@
   }
 
   void routeResponse(message) {
-    final client = message.client;
+    final client = message.client!;
     if (client.serviceHandles.containsKey(message.serial)) {
-      client.serviceHandles.remove(message.serial)(message);
+      client.serviceHandles.remove(message.serial)!(message);
       _serviceRequests.release(message.serial);
     }
   }
 }
 
-@pragma("vm:entry-point",
-    const bool.fromEnvironment("dart.vm.product") ? false : "call")
+@pragma('vm:entry-point',
+    const bool.fromEnvironment('dart.vm.product') ? false : 'call')
 RawReceivePort boot() {
   // Return the port we expect isolate control messages on.
   return isolateControlPort;
 }
 
-@pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
-void _registerIsolate(int port_id, SendPort sp, String name) {
-  var service = new VMService();
-  service.runningIsolates.isolateStartup(port_id, sp, name);
-}
+@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
+// ignore: unused_element
+void _registerIsolate(int port_id, SendPort sp, String name) =>
+    VMService().runningIsolates.isolateStartup(port_id, sp, name);
 
 /// Notify the VM that the service is running.
-void _onStart() native "VMService_OnStart";
+void _onStart() native 'VMService_OnStart';
 
 /// Notify the VM that the service is no longer running.
-void _onExit() native "VMService_OnExit";
+void _onExit() native 'VMService_OnExit';
 
 /// Notify the VM that the server's address has changed.
-void onServerAddressChange(String address)
-    native "VMService_OnServerAddressChange";
+void onServerAddressChange(String? address)
+    native 'VMService_OnServerAddressChange';
 
 /// Subscribe to a service stream.
-bool _vmListenStream(String streamId) native "VMService_ListenStream";
+bool _vmListenStream(String streamId) native 'VMService_ListenStream';
 
 /// Cancel a subscription to a service stream.
-void _vmCancelStream(String streamId) native "VMService_CancelStream";
+void _vmCancelStream(String streamId) native 'VMService_CancelStream';
 
 /// Get the bytes to the tar archive.
-Uint8List _requestAssets() native "VMService_RequestAssets";
+Uint8List _requestAssets() native 'VMService_RequestAssets';
diff --git a/sdk/lib/vmservice_libraries.json b/sdk/lib/vmservice_libraries.json
index af43f48..0ef7b8d 100644
--- a/sdk/lib/vmservice_libraries.json
+++ b/sdk/lib/vmservice_libraries.json
@@ -1,12 +1,14 @@
 {
+  "comment:0": "NOTE: THIS FILE IS GENERATED. DO NOT EDIT.",
+  "comment:1": "Instead modify 'sdk/lib/vmservice_libraries.yaml' and follow the instructions therein.",
   "vm": {
     "libraries": {
-      "vmservice_io": {
-        "uri": "_internal/vm/bin/vmservice_io.dart"
-      },
       "_vmservice": {
         "uri": "vmservice/vmservice.dart"
+      },
+      "vmservice_io": {
+        "uri": "_internal/vm/bin/vmservice_io.dart"
       }
     }
   }
-}
+}
\ No newline at end of file
diff --git a/sdk/lib/wasm/wasm.dart b/sdk/lib/wasm/wasm.dart
index 3495b01..768445e 100644
--- a/sdk/lib/wasm/wasm.dart
+++ b/sdk/lib/wasm/wasm.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.6
-
 /// {@category VM}
 /// {@nodoc}
 library dart.wasm;
@@ -57,7 +55,7 @@
 abstract class WasmMemory {
   // Create a new memory with the given number of initial pages, and optional
   // maximum number of pages.
-  external factory WasmMemory(int initialPages, [int maxPages]);
+  external factory WasmMemory(int initialPages, [int? maxPages]);
 
   // The WASM spec defines the page size as 64KiB.
   static const int kPageSizeInBytes = 64 * 1024;
@@ -83,7 +81,7 @@
   // Find an exported function with the given signature.
   WasmFunction<T> lookupFunction<T extends Function>(String name);
 
-  // Returns this instances's memory.
+  // Returns this instance's memory.
   WasmMemory get memory;
 }
 
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index eea4e55..146e158 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -1,5 +1,3 @@
-// @dart = 2.6
-
 /**
  * High-fidelity audio programming in the browser.
  *
@@ -40,7 +38,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AnalyserNode(BaseAudioContext context, [Map options]) {
+  factory AnalyserNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return AnalyserNode._create_1(context, options_1);
@@ -105,10 +103,10 @@
   num get sampleRate native;
 
   void copyFromChannel(Float32List destination, int channelNumber,
-      [int startInChannel]) native;
+      [int? startInChannel]) native;
 
   void copyToChannel(Float32List source, int channelNumber,
-      [int startInChannel]) native;
+      [int? startInChannel]) native;
 
   Float32List getChannelData(int channelIndex) native;
 }
@@ -125,7 +123,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory AudioBufferSourceNode(BaseAudioContext context, [Map options]) {
+  factory AudioBufferSourceNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return AudioBufferSourceNode._create_1(context, options_1);
@@ -140,9 +138,9 @@
   static AudioBufferSourceNode _create_2(context) =>
       JS('AudioBufferSourceNode', 'new AudioBufferSourceNode(#)', context);
 
-  AudioBuffer get buffer native;
+  AudioBuffer? get buffer native;
 
-  set buffer(AudioBuffer value) native;
+  set buffer(AudioBuffer? value) native;
 
   AudioParam get detune native;
 
@@ -160,7 +158,7 @@
 
   AudioParam get playbackRate native;
 
-  void start([num when, num grainOffset, num grainDuration]) native;
+  void start([num? when, num? grainOffset, num? grainDuration]) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -184,7 +182,7 @@
   Future close() => promiseToFuture(JS("", "#.close()", this));
 
   Map getOutputTimestamp() {
-    return convertNativeToDart_Dictionary(_getOutputTimestamp_1());
+    return convertNativeToDart_Dictionary(_getOutputTimestamp_1())!;
   }
 
   @JSName('getOutputTimestamp')
@@ -204,7 +202,9 @@
   }
 
   ScriptProcessorNode createScriptProcessor(
-      [int bufferSize, int numberOfInputChannels, int numberOfOutputChannels]) {
+      [int? bufferSize,
+      int? numberOfInputChannels,
+      int? numberOfOutputChannels]) {
     var function = JS(
         '=Object',
         '#.createScriptProcessor || '
@@ -226,13 +226,13 @@
   }
 
   @JSName('decodeAudioData')
-  Future _decodeAudioData(ByteBuffer audioData,
-      [DecodeSuccessCallback successCallback,
-      DecodeErrorCallback errorCallback]) native;
+  Future<AudioBuffer> _decodeAudioData(ByteBuffer audioData,
+      [DecodeSuccessCallback? successCallback,
+      DecodeErrorCallback? errorCallback]) native;
 
   Future<AudioBuffer> decodeAudioData(ByteBuffer audioData,
-      [DecodeSuccessCallback successCallback,
-      DecodeErrorCallback errorCallback]) {
+      [DecodeSuccessCallback? successCallback,
+      DecodeErrorCallback? errorCallback]) {
     if (successCallback != null && errorCallback != null) {
       return _decodeAudioData(audioData, successCallback, errorCallback);
     }
@@ -326,9 +326,9 @@
   int get numberOfOutputs native;
 
   @JSName('connect')
-  AudioNode _connect(destination, [int output, int input]) native;
+  AudioNode _connect(destination, [int? output, int? input]) native;
 
-  void disconnect([destination_OR_output, int output, int input]) native;
+  void disconnect([destination_OR_output, int? output, int? input]) native;
 
   void connectNode(AudioNode destination, [int output = 0, int input = 0]) {
     _connect(destination, output, input);
@@ -385,7 +385,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  Map _getItem(String key) =>
+  Map? _getItem(String key) =>
       convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
 
   void addAll(Map<String, dynamic> other) {
@@ -396,7 +396,7 @@
 
   bool containsKey(dynamic key) => _getItem(key) != null;
 
-  Map operator [](dynamic key) => _getItem(key);
+  Map? operator [](dynamic key) => _getItem(key);
 
   void forEach(void f(String key, dynamic value)) {
     var entries = JS('', '#.entries()', this);
@@ -484,9 +484,9 @@
       const EventStreamProvider<Event>('ended');
 
   @JSName('start')
-  void start2([num when]) native;
+  void start2([num? when]) native;
 
-  void stop([num when]) native;
+  void stop([num? when]) native;
 
   Stream<Event> get onEnded => endedEvent.forTarget(this);
 }
@@ -513,7 +513,7 @@
 
   String get language native;
 
-  SourceBuffer get sourceBuffer native;
+  SourceBuffer? get sourceBuffer native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -533,7 +533,7 @@
 
   AudioTrack __getter__(int index) native;
 
-  AudioTrack getTrackById(String id) native;
+  AudioTrack? getTrackById(String id) native;
 
   Stream<Event> get onChange => changeEvent.forTarget(this);
 }
@@ -566,7 +566,7 @@
   }
 
   factory AudioWorkletNode(BaseAudioContext context, String name,
-      [Map options]) {
+      [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return AudioWorkletNode._create_1(context, name, options_1);
@@ -625,15 +625,15 @@
 
   AudioBufferSourceNode createBufferSource() native;
 
-  ChannelMergerNode createChannelMerger([int numberOfInputs]) native;
+  ChannelMergerNode createChannelMerger([int? numberOfInputs]) native;
 
-  ChannelSplitterNode createChannelSplitter([int numberOfOutputs]) native;
+  ChannelSplitterNode createChannelSplitter([int? numberOfOutputs]) native;
 
   ConstantSourceNode createConstantSource() native;
 
   ConvolverNode createConvolver() native;
 
-  DelayNode createDelay([num maxDelayTime]) native;
+  DelayNode createDelay([num? maxDelayTime]) native;
 
   DynamicsCompressorNode createDynamicsCompressor() native;
 
@@ -656,7 +656,7 @@
   PannerNode createPanner() native;
 
   PeriodicWave createPeriodicWave(List<num> real, List<num> imag,
-      [Map options]) {
+      [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return _createPeriodicWave_1(real, imag, options_1);
@@ -671,17 +671,17 @@
   PeriodicWave _createPeriodicWave_2(List<num> real, List<num> imag) native;
 
   ScriptProcessorNode createScriptProcessor(
-      [int bufferSize,
-      int numberOfInputChannels,
-      int numberOfOutputChannels]) native;
+      [int? bufferSize,
+      int? numberOfInputChannels,
+      int? numberOfOutputChannels]) native;
 
   StereoPannerNode createStereoPanner() native;
 
   WaveShaperNode createWaveShaper() native;
 
   Future<AudioBuffer> decodeAudioData(ByteBuffer audioData,
-          [DecodeSuccessCallback successCallback,
-          DecodeErrorCallback errorCallback]) =>
+          [DecodeSuccessCallback? successCallback,
+          DecodeErrorCallback? errorCallback]) =>
       promiseToFuture<AudioBuffer>(JS("", "#.decodeAudioData(#, #, #)", this,
           audioData, successCallback, errorCallback));
 
@@ -698,7 +698,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory BiquadFilterNode(BaseAudioContext context, [Map options]) {
+  factory BiquadFilterNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return BiquadFilterNode._create_1(context, options_1);
@@ -736,7 +736,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ChannelMergerNode(BaseAudioContext context, [Map options]) {
+  factory ChannelMergerNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return ChannelMergerNode._create_1(context, options_1);
@@ -759,7 +759,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ChannelSplitterNode(BaseAudioContext context, [Map options]) {
+  factory ChannelSplitterNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return ChannelSplitterNode._create_1(context, options_1);
@@ -782,7 +782,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ConstantSourceNode(BaseAudioContext context, [Map options]) {
+  factory ConstantSourceNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return ConstantSourceNode._create_1(context, options_1);
@@ -807,7 +807,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ConvolverNode(BaseAudioContext context, [Map options]) {
+  factory ConvolverNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return ConvolverNode._create_1(context, options_1);
@@ -819,9 +819,9 @@
   static ConvolverNode _create_2(context) =>
       JS('ConvolverNode', 'new ConvolverNode(#)', context);
 
-  AudioBuffer get buffer native;
+  AudioBuffer? get buffer native;
 
-  set buffer(AudioBuffer value) native;
+  set buffer(AudioBuffer? value) native;
 
   bool get normalize native;
 
@@ -838,7 +838,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DelayNode(BaseAudioContext context, [Map options]) {
+  factory DelayNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return DelayNode._create_1(context, options_1);
@@ -863,7 +863,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory DynamicsCompressorNode(BaseAudioContext context, [Map options]) {
+  factory DynamicsCompressorNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return DynamicsCompressorNode._create_1(context, options_1);
@@ -901,7 +901,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory GainNode(BaseAudioContext context, [Map options]) {
+  factory GainNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return GainNode._create_1(context, options_1);
@@ -971,7 +971,7 @@
   }
 
   factory MediaStreamAudioDestinationNode(BaseAudioContext context,
-      [Map options]) {
+      [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return MediaStreamAudioDestinationNode._create_1(context, options_1);
@@ -1048,7 +1048,7 @@
   }
 
   factory OfflineAudioContext(numberOfChannels_OR_options,
-      [int numberOfFrames, num sampleRate]) {
+      [int? numberOfFrames, num? sampleRate]) {
     if ((sampleRate is num) &&
         (numberOfFrames is int) &&
         (numberOfChannels_OR_options is int)) {
@@ -1093,7 +1093,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory OscillatorNode(BaseAudioContext context, [Map options]) {
+  factory OscillatorNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return OscillatorNode._create_1(context, options_1);
@@ -1126,7 +1126,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PannerNode(BaseAudioContext context, [Map options]) {
+  factory PannerNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return PannerNode._create_1(context, options_1);
@@ -1197,7 +1197,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory PeriodicWave(BaseAudioContext context, [Map options]) {
+  factory PeriodicWave(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return PeriodicWave._create_1(context, options_1);
@@ -1255,7 +1255,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory StereoPannerNode(BaseAudioContext context, [Map options]) {
+  factory StereoPannerNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return StereoPannerNode._create_1(context, options_1);
@@ -1280,7 +1280,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory WaveShaperNode(BaseAudioContext context, [Map options]) {
+  factory WaveShaperNode(BaseAudioContext context, [Map? options]) {
     if (options != null) {
       var options_1 = convertDartToNative_Dictionary(options);
       return WaveShaperNode._create_1(context, options_1);
@@ -1292,9 +1292,9 @@
   static WaveShaperNode _create_2(context) =>
       JS('WaveShaperNode', 'new WaveShaperNode(#)', context);
 
-  Float32List get curve native;
+  Float32List? get curve native;
 
-  set curve(Float32List value) native;
+  set curve(Float32List? value) native;
 
   String get oversample native;
 
diff --git a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
index 22d252c..53671df 100644
--- a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
+++ b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
@@ -1,5 +1,3 @@
-// @dart = 2.6
-
 /**
  * 3D programming in the browser.
  *
@@ -302,7 +300,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  factory ContextEvent(String type, [Map eventInit]) {
+  factory ContextEvent(String type, [Map? eventInit]) {
     if (eventInit != null) {
       var eventInit_1 = convertDartToNative_Dictionary(eventInit);
       return ContextEvent._create_1(type, eventInit_1);
@@ -342,7 +340,7 @@
     throw new UnsupportedError("Not supported");
   }
 
-  String getTranslatedShaderSource(Shader shader) native;
+  String? getTranslatedShaderSource(Shader shader) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -459,19 +457,19 @@
   TimerQueryExt createQueryExt() native;
 
   @JSName('deleteQueryEXT')
-  void deleteQueryExt(TimerQueryExt query) native;
+  void deleteQueryExt(TimerQueryExt? query) native;
 
   @JSName('endQueryEXT')
   void endQueryExt(int target) native;
 
   @JSName('getQueryEXT')
-  Object getQueryExt(int target, int pname) native;
+  Object? getQueryExt(int target, int pname) native;
 
   @JSName('getQueryObjectEXT')
-  Object getQueryObjectExt(TimerQueryExt query, int pname) native;
+  Object? getQueryObjectExt(TimerQueryExt query, int pname) native;
 
   @JSName('isQueryEXT')
-  bool isQueryExt(TimerQueryExt query) native;
+  bool isQueryExt(TimerQueryExt? query) native;
 
   @JSName('queryCounterEXT')
   void queryCounterExt(TimerQueryExt query, int target) native;
@@ -559,7 +557,7 @@
   }
 
   Future getBufferSubDataAsync(int target, int srcByteOffset, TypedData dstData,
-          [int dstOffset, int length]) =>
+          [int? dstOffset, int? length]) =>
       promiseToFuture(JS("", "#.getBufferSubDataAsync(#, #, #, #, #)", this,
           target, srcByteOffset, dstData, dstOffset, length));
 }
@@ -662,16 +660,16 @@
   static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
 
   @JSName('bindVertexArrayOES')
-  void bindVertexArray(VertexArrayObjectOes arrayObject) native;
+  void bindVertexArray(VertexArrayObjectOes? arrayObject) native;
 
   @JSName('createVertexArrayOES')
   VertexArrayObjectOes createVertexArray() native;
 
   @JSName('deleteVertexArrayOES')
-  void deleteVertexArray(VertexArrayObjectOes arrayObject) native;
+  void deleteVertexArray(VertexArrayObjectOes? arrayObject) native;
 
   @JSName('isVertexArrayOES')
-  bool isVertexArray(VertexArrayObjectOes arrayObject) native;
+  bool isVertexArray(VertexArrayObjectOes? arrayObject) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -739,13 +737,13 @@
 
   void bindAttribLocation(Program program, int index, String name) native;
 
-  void bindBuffer(int target, Buffer buffer) native;
+  void bindBuffer(int target, Buffer? buffer) native;
 
-  void bindFramebuffer(int target, Framebuffer framebuffer) native;
+  void bindFramebuffer(int target, Framebuffer? framebuffer) native;
 
-  void bindRenderbuffer(int target, Renderbuffer renderbuffer) native;
+  void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
 
-  void bindTexture(int target, Texture texture) native;
+  void bindTexture(int target, Texture? texture) native;
 
   void blendColor(num red, num green, num blue, num alpha) native;
 
@@ -804,17 +802,17 @@
 
   void cullFace(int mode) native;
 
-  void deleteBuffer(Buffer buffer) native;
+  void deleteBuffer(Buffer? buffer) native;
 
-  void deleteFramebuffer(Framebuffer framebuffer) native;
+  void deleteFramebuffer(Framebuffer? framebuffer) native;
 
-  void deleteProgram(Program program) native;
+  void deleteProgram(Program? program) native;
 
-  void deleteRenderbuffer(Renderbuffer renderbuffer) native;
+  void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
 
-  void deleteShader(Shader shader) native;
+  void deleteShader(Shader? shader) native;
 
-  void deleteTexture(Texture texture) native;
+  void deleteTexture(Texture? texture) native;
 
   void depthFunc(int func) native;
 
@@ -841,10 +839,10 @@
   void flush() native;
 
   void framebufferRenderbuffer(int target, int attachment,
-      int renderbuffertarget, Renderbuffer renderbuffer) native;
+      int renderbuffertarget, Renderbuffer? renderbuffer) native;
 
   void framebufferTexture2D(int target, int attachment, int textarget,
-      Texture texture, int level) native;
+      Texture? texture, int level) native;
 
   void frontFace(int mode) native;
 
@@ -854,16 +852,16 @@
 
   ActiveInfo getActiveUniform(Program program, int index) native;
 
-  List<Shader> getAttachedShaders(Program program) native;
+  List<Shader>? getAttachedShaders(Program program) native;
 
   int getAttribLocation(Program program, String name) native;
 
   @Creates('int|Null')
   @Returns('int|Null')
-  Object getBufferParameter(int target, int pname) native;
+  Object? getBufferParameter(int target, int pname) native;
 
   @Creates('ContextAttributes|Null')
-  Map getContextAttributes() {
+  Map? getContextAttributes() {
     return convertNativeToDart_Dictionary(_getContextAttributes_1());
   }
 
@@ -873,77 +871,77 @@
 
   int getError() native;
 
-  Object getExtension(String name) native;
+  Object? getExtension(String name) native;
 
   @Creates('int|Renderbuffer|Texture|Null')
   @Returns('int|Renderbuffer|Texture|Null')
-  Object getFramebufferAttachmentParameter(
+  Object? getFramebufferAttachmentParameter(
       int target, int attachment, int pname) native;
 
   @Creates(
       'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
   @Returns(
       'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
-  Object getParameter(int pname) native;
+  Object? getParameter(int pname) native;
 
-  String getProgramInfoLog(Program program) native;
+  String? getProgramInfoLog(Program program) native;
 
   @Creates('int|bool|Null')
   @Returns('int|bool|Null')
-  Object getProgramParameter(Program program, int pname) native;
+  Object? getProgramParameter(Program program, int pname) native;
 
   @Creates('int|Null')
   @Returns('int|Null')
-  Object getRenderbufferParameter(int target, int pname) native;
+  Object? getRenderbufferParameter(int target, int pname) native;
 
-  String getShaderInfoLog(Shader shader) native;
+  String? getShaderInfoLog(Shader shader) native;
 
   @Creates('int|bool|Null')
   @Returns('int|bool|Null')
-  Object getShaderParameter(Shader shader, int pname) native;
+  Object? getShaderParameter(Shader shader, int pname) native;
 
   ShaderPrecisionFormat getShaderPrecisionFormat(
       int shadertype, int precisiontype) native;
 
-  String getShaderSource(Shader shader) native;
+  String? getShaderSource(Shader shader) native;
 
-  List<String> getSupportedExtensions() native;
+  List<String>? getSupportedExtensions() native;
 
   @Creates('int|Null')
   @Returns('int|Null')
-  Object getTexParameter(int target, int pname) native;
+  Object? getTexParameter(int target, int pname) native;
 
   @Creates(
       'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
   @Returns(
       'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
-  Object getUniform(Program program, UniformLocation location) native;
+  Object? getUniform(Program program, UniformLocation location) native;
 
   UniformLocation getUniformLocation(Program program, String name) native;
 
   @Creates('Null|num|bool|NativeFloat32List|Buffer')
   @Returns('Null|num|bool|NativeFloat32List|Buffer')
-  Object getVertexAttrib(int index, int pname) native;
+  Object? getVertexAttrib(int index, int pname) native;
 
   int getVertexAttribOffset(int index, int pname) native;
 
   void hint(int target, int mode) native;
 
-  bool isBuffer(Buffer buffer) native;
+  bool isBuffer(Buffer? buffer) native;
 
   bool isContextLost() native;
 
   bool isEnabled(int cap) native;
 
-  bool isFramebuffer(Framebuffer framebuffer) native;
+  bool isFramebuffer(Framebuffer? framebuffer) native;
 
-  bool isProgram(Program program) native;
+  bool isProgram(Program? program) native;
 
-  bool isRenderbuffer(Renderbuffer renderbuffer) native;
+  bool isRenderbuffer(Renderbuffer? renderbuffer) native;
 
-  bool isShader(Shader shader) native;
+  bool isShader(Shader? shader) native;
 
-  bool isTexture(Texture texture) native;
+  bool isTexture(Texture? texture) native;
 
   void lineWidth(num width) native;
 
@@ -955,7 +953,7 @@
 
   @JSName('readPixels')
   void _readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData pixels) native;
+      TypedData? pixels) native;
 
   void renderbufferStorage(
       int target, int internalformat, int width, int height) native;
@@ -985,9 +983,9 @@
       int format_OR_width,
       int height_OR_type,
       bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
-      [int format,
-      int type,
-      TypedData pixels]) {
+      [int? format,
+      int? type,
+      TypedData? pixels]) {
     if (type != null &&
         format != null &&
         (bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
@@ -1074,7 +1072,7 @@
 
   @JSName('texImage2D')
   void _texImage2D_1(target, level, internalformat, width, height, int border,
-      format, type, TypedData pixels) native;
+      format, type, TypedData? pixels) native;
   @JSName('texImage2D')
   void _texImage2D_2(target, level, internalformat, format, type, pixels)
       native;
@@ -1103,8 +1101,8 @@
       int format_OR_width,
       int height_OR_type,
       bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
-      [int type,
-      TypedData pixels]) {
+      [int? type,
+      TypedData? pixels]) {
     if (type != null &&
         (bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is int)) {
       _texSubImage2D_1(
@@ -1189,7 +1187,7 @@
 
   @JSName('texSubImage2D')
   void _texSubImage2D_1(target, level, xoffset, yoffset, width, height,
-      int format, type, TypedData pixels) native;
+      int format, type, TypedData? pixels) native;
   @JSName('texSubImage2D')
   void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels)
       native;
@@ -1206,45 +1204,48 @@
   void _texSubImage2D_6(
       target, level, xoffset, yoffset, format, type, ImageBitmap bitmap) native;
 
-  void uniform1f(UniformLocation location, num x) native;
+  void uniform1f(UniformLocation? location, num x) native;
 
-  void uniform1fv(UniformLocation location, v) native;
+  void uniform1fv(UniformLocation? location, v) native;
 
-  void uniform1i(UniformLocation location, int x) native;
+  void uniform1i(UniformLocation? location, int x) native;
 
-  void uniform1iv(UniformLocation location, v) native;
+  void uniform1iv(UniformLocation? location, v) native;
 
-  void uniform2f(UniformLocation location, num x, num y) native;
+  void uniform2f(UniformLocation? location, num x, num y) native;
 
-  void uniform2fv(UniformLocation location, v) native;
+  void uniform2fv(UniformLocation? location, v) native;
 
-  void uniform2i(UniformLocation location, int x, int y) native;
+  void uniform2i(UniformLocation? location, int x, int y) native;
 
-  void uniform2iv(UniformLocation location, v) native;
+  void uniform2iv(UniformLocation? location, v) native;
 
-  void uniform3f(UniformLocation location, num x, num y, num z) native;
+  void uniform3f(UniformLocation? location, num x, num y, num z) native;
 
-  void uniform3fv(UniformLocation location, v) native;
+  void uniform3fv(UniformLocation? location, v) native;
 
-  void uniform3i(UniformLocation location, int x, int y, int z) native;
+  void uniform3i(UniformLocation? location, int x, int y, int z) native;
 
-  void uniform3iv(UniformLocation location, v) native;
+  void uniform3iv(UniformLocation? location, v) native;
 
-  void uniform4f(UniformLocation location, num x, num y, num z, num w) native;
+  void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
 
-  void uniform4fv(UniformLocation location, v) native;
+  void uniform4fv(UniformLocation? location, v) native;
 
-  void uniform4i(UniformLocation location, int x, int y, int z, int w) native;
+  void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
 
-  void uniform4iv(UniformLocation location, v) native;
+  void uniform4iv(UniformLocation? location, v) native;
 
-  void uniformMatrix2fv(UniformLocation location, bool transpose, array) native;
+  void uniformMatrix2fv(UniformLocation? location, bool transpose, array)
+      native;
 
-  void uniformMatrix3fv(UniformLocation location, bool transpose, array) native;
+  void uniformMatrix3fv(UniformLocation? location, bool transpose, array)
+      native;
 
-  void uniformMatrix4fv(UniformLocation location, bool transpose, array) native;
+  void uniformMatrix4fv(UniformLocation? location, bool transpose, array)
+      native;
 
-  void useProgram(Program program) native;
+  void useProgram(Program? program) native;
 
   void validateProgram(Program program) native;
 
@@ -1270,7 +1271,7 @@
   void viewport(int x, int y, int width, int height) native;
 
   void readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData pixels) {
+      TypedData? pixels) {
     _readPixels(x, y, width, height, format, type, pixels);
   }
 
@@ -1370,36 +1371,38 @@
 
   void beginTransformFeedback(int primitiveMode) native;
 
-  void bindBufferBase(int target, int index, Buffer buffer) native;
+  void bindBufferBase(int target, int index, Buffer? buffer) native;
 
   void bindBufferRange(
-      int target, int index, Buffer buffer, int offset, int size) native;
+      int target, int index, Buffer? buffer, int offset, int size) native;
 
-  void bindSampler(int unit, Sampler sampler) native;
+  void bindSampler(int unit, Sampler? sampler) native;
 
-  void bindTransformFeedback(int target, TransformFeedback feedback) native;
+  void bindTransformFeedback(int target, TransformFeedback? feedback) native;
 
-  void bindVertexArray(VertexArrayObject vertexArray) native;
+  void bindVertexArray(VertexArrayObject? vertexArray) native;
 
   void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0,
       int dstY0, int dstX1, int dstY1, int mask, int filter) native;
 
   @JSName('bufferData')
   void bufferData2(int target, TypedData srcData, int usage, int srcOffset,
-      [int length]) native;
+      [int? length]) native;
 
   @JSName('bufferSubData')
   void bufferSubData2(
       int target, int dstByteOffset, TypedData srcData, int srcOffset,
-      [int length]) native;
+      [int? length]) native;
 
   void clearBufferfi(int buffer, int drawbuffer, num depth, int stencil) native;
 
-  void clearBufferfv(int buffer, int drawbuffer, value, [int srcOffset]) native;
+  void clearBufferfv(int buffer, int drawbuffer, value, [int? srcOffset])
+      native;
 
-  void clearBufferiv(int buffer, int drawbuffer, value, [int srcOffset]) native;
+  void clearBufferiv(int buffer, int drawbuffer, value, [int? srcOffset])
+      native;
 
-  void clearBufferuiv(int buffer, int drawbuffer, value, [int srcOffset])
+  void clearBufferuiv(int buffer, int drawbuffer, value, [int? srcOffset])
       native;
 
   int clientWaitSync(Sync sync, int flags, int timeout) native;
@@ -1407,7 +1410,7 @@
   @JSName('compressedTexImage2D')
   void compressedTexImage2D2(int target, int level, int internalformat,
       int width, int height, int border, TypedData data, int srcOffset,
-      [int srcLengthOverride]) native;
+      [int? srcLengthOverride]) native;
 
   @JSName('compressedTexImage2D')
   void compressedTexImage2D3(int target, int level, int internalformat,
@@ -1415,7 +1418,7 @@
 
   void compressedTexImage3D(int target, int level, int internalformat,
       int width, int height, int depth, int border, TypedData data,
-      [int srcOffset, int srcLengthOverride]) native;
+      [int? srcOffset, int? srcLengthOverride]) native;
 
   @JSName('compressedTexImage3D')
   void compressedTexImage3D2(
@@ -1432,7 +1435,7 @@
   @JSName('compressedTexSubImage2D')
   void compressedTexSubImage2D2(int target, int level, int xoffset, int yoffset,
       int width, int height, int format, TypedData data, int srcOffset,
-      [int srcLengthOverride]) native;
+      [int? srcLengthOverride]) native;
 
   @JSName('compressedTexSubImage2D')
   void compressedTexSubImage2D3(int target, int level, int xoffset, int yoffset,
@@ -1440,7 +1443,7 @@
 
   void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset,
       int zoffset, int width, int height, int depth, int format, TypedData data,
-      [int srcOffset, int srcLengthOverride]) native;
+      [int? srcOffset, int? srcLengthOverride]) native;
 
   @JSName('compressedTexSubImage3D')
   void compressedTexSubImage3D2(
@@ -1462,23 +1465,23 @@
   void copyTexSubImage3D(int target, int level, int xoffset, int yoffset,
       int zoffset, int x, int y, int width, int height) native;
 
-  Query createQuery() native;
+  Query? createQuery() native;
 
-  Sampler createSampler() native;
+  Sampler? createSampler() native;
 
-  TransformFeedback createTransformFeedback() native;
+  TransformFeedback? createTransformFeedback() native;
 
-  VertexArrayObject createVertexArray() native;
+  VertexArrayObject? createVertexArray() native;
 
-  void deleteQuery(Query query) native;
+  void deleteQuery(Query? query) native;
 
-  void deleteSampler(Sampler sampler) native;
+  void deleteSampler(Sampler? sampler) native;
 
-  void deleteSync(Sync sync) native;
+  void deleteSync(Sync? sync) native;
 
-  void deleteTransformFeedback(TransformFeedback feedback) native;
+  void deleteTransformFeedback(TransformFeedback? feedback) native;
 
-  void deleteVertexArray(VertexArrayObject vertexArray) native;
+  void deleteVertexArray(VertexArrayObject? vertexArray) native;
 
   void drawArraysInstanced(int mode, int first, int count, int instanceCount)
       native;
@@ -1495,64 +1498,64 @@
 
   void endTransformFeedback() native;
 
-  Sync fenceSync(int condition, int flags) native;
+  Sync? fenceSync(int condition, int flags) native;
 
-  void framebufferTextureLayer(
-      int target, int attachment, Texture texture, int level, int layer) native;
+  void framebufferTextureLayer(int target, int attachment, Texture? texture,
+      int level, int layer) native;
 
-  String getActiveUniformBlockName(Program program, int uniformBlockIndex)
+  String? getActiveUniformBlockName(Program program, int uniformBlockIndex)
       native;
 
-  Object getActiveUniformBlockParameter(
+  Object? getActiveUniformBlockParameter(
       Program program, int uniformBlockIndex, int pname) native;
 
-  Object getActiveUniforms(Program program, List<int> uniformIndices, int pname)
-      native;
+  Object? getActiveUniforms(
+      Program program, List<int> uniformIndices, int pname) native;
 
   void getBufferSubData(int target, int srcByteOffset, TypedData dstData,
-      [int dstOffset, int length]) native;
+      [int? dstOffset, int? length]) native;
 
   int getFragDataLocation(Program program, String name) native;
 
-  Object getIndexedParameter(int target, int index) native;
+  Object? getIndexedParameter(int target, int index) native;
 
-  Object getInternalformatParameter(int target, int internalformat, int pname)
+  Object? getInternalformatParameter(int target, int internalformat, int pname)
       native;
 
-  Object getQuery(int target, int pname) native;
+  Object? getQuery(int target, int pname) native;
 
-  Object getQueryParameter(Query query, int pname) native;
+  Object? getQueryParameter(Query query, int pname) native;
 
-  Object getSamplerParameter(Sampler sampler, int pname) native;
+  Object? getSamplerParameter(Sampler sampler, int pname) native;
 
-  Object getSyncParameter(Sync sync, int pname) native;
+  Object? getSyncParameter(Sync sync, int pname) native;
 
-  ActiveInfo getTransformFeedbackVarying(Program program, int index) native;
+  ActiveInfo? getTransformFeedbackVarying(Program program, int index) native;
 
   int getUniformBlockIndex(Program program, String uniformBlockName) native;
 
-  List<int> getUniformIndices(Program program, List<String> uniformNames) {
+  List<int>? getUniformIndices(Program program, List<String> uniformNames) {
     List uniformNames_1 = convertDartToNative_StringArray(uniformNames);
     return _getUniformIndices_1(program, uniformNames_1);
   }
 
   @JSName('getUniformIndices')
-  List<int> _getUniformIndices_1(Program program, List uniformNames) native;
+  List<int>? _getUniformIndices_1(Program program, List uniformNames) native;
 
   void invalidateFramebuffer(int target, List<int> attachments) native;
 
   void invalidateSubFramebuffer(int target, List<int> attachments, int x, int y,
       int width, int height) native;
 
-  bool isQuery(Query query) native;
+  bool isQuery(Query? query) native;
 
-  bool isSampler(Sampler sampler) native;
+  bool isSampler(Sampler? sampler) native;
 
-  bool isSync(Sync sync) native;
+  bool isSync(Sync? sync) native;
 
-  bool isTransformFeedback(TransformFeedback feedback) native;
+  bool isTransformFeedback(TransformFeedback? feedback) native;
 
-  bool isVertexArray(VertexArrayObject vertexArray) native;
+  bool isVertexArray(VertexArrayObject? vertexArray) native;
 
   void pauseTransformFeedback() native;
 
@@ -1561,7 +1564,7 @@
   @JSName('readPixels')
   void readPixels2(int x, int y, int width, int height, int format, int type,
       dstData_OR_offset,
-      [int offset]) native;
+      [int? offset]) native;
 
   void renderbufferStorageMultisample(int target, int samples,
       int internalformat, int width, int height) native;
@@ -1582,7 +1585,7 @@
       int format,
       int type,
       bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
-      [int srcOffset]) {
+      [int? srcOffset]) {
     if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
             is int) &&
         srcOffset == null) {
@@ -1719,7 +1722,7 @@
       int format,
       int type,
       bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
-      [int srcOffset]) {
+      [int? srcOffset]) {
     if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
             is int) &&
         srcOffset == null) {
@@ -1867,7 +1870,7 @@
       border, format, type, ImageBitmap bitmap) native;
   @JSName('texImage3D')
   void _texImage3D_7(target, level, internalformat, width, height, depth,
-      border, format, type, TypedData pixels) native;
+      border, format, type, TypedData? pixels) native;
   @JSName('texImage3D')
   void _texImage3D_8(target, level, internalformat, width, height, depth,
       border, format, type, TypedData pixels, srcOffset) native;
@@ -1888,7 +1891,7 @@
       int format,
       int type,
       bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
-      [int srcOffset]) {
+      [int? srcOffset]) {
     if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
             is int) &&
         srcOffset == null) {
@@ -2026,7 +2029,7 @@
       int format,
       int type,
       bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
-      [int srcOffset]) {
+      [int? srcOffset]) {
     if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
             is int) &&
         srcOffset == null) {
@@ -2196,93 +2199,93 @@
       native;
 
   @JSName('uniform1fv')
-  void uniform1fv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform1fv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
   @JSName('uniform1iv')
-  void uniform1iv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform1iv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
-  void uniform1ui(UniformLocation location, int v0) native;
+  void uniform1ui(UniformLocation? location, int v0) native;
 
-  void uniform1uiv(UniformLocation location, v, [int srcOffset, int srcLength])
-      native;
+  void uniform1uiv(UniformLocation? location, v,
+      [int? srcOffset, int? srcLength]) native;
 
   @JSName('uniform2fv')
-  void uniform2fv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform2fv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
   @JSName('uniform2iv')
-  void uniform2iv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform2iv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
-  void uniform2ui(UniformLocation location, int v0, int v1) native;
+  void uniform2ui(UniformLocation? location, int v0, int v1) native;
 
-  void uniform2uiv(UniformLocation location, v, [int srcOffset, int srcLength])
-      native;
+  void uniform2uiv(UniformLocation? location, v,
+      [int? srcOffset, int? srcLength]) native;
 
   @JSName('uniform3fv')
-  void uniform3fv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform3fv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
   @JSName('uniform3iv')
-  void uniform3iv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform3iv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
-  void uniform3ui(UniformLocation location, int v0, int v1, int v2) native;
+  void uniform3ui(UniformLocation? location, int v0, int v1, int v2) native;
 
-  void uniform3uiv(UniformLocation location, v, [int srcOffset, int srcLength])
-      native;
+  void uniform3uiv(UniformLocation? location, v,
+      [int? srcOffset, int? srcLength]) native;
 
   @JSName('uniform4fv')
-  void uniform4fv2(UniformLocation location, v, int srcOffset, [int srcLength])
-      native;
+  void uniform4fv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
 
   @JSName('uniform4iv')
-  void uniform4iv2(UniformLocation location, v, int srcOffset, [int srcLength])
+  void uniform4iv2(UniformLocation? location, v, int srcOffset,
+      [int? srcLength]) native;
+
+  void uniform4ui(UniformLocation? location, int v0, int v1, int v2, int v3)
       native;
 
-  void uniform4ui(UniformLocation location, int v0, int v1, int v2, int v3)
-      native;
-
-  void uniform4uiv(UniformLocation location, v, [int srcOffset, int srcLength])
-      native;
+  void uniform4uiv(UniformLocation? location, v,
+      [int? srcOffset, int? srcLength]) native;
 
   void uniformBlockBinding(
       Program program, int uniformBlockIndex, int uniformBlockBinding) native;
 
   @JSName('uniformMatrix2fv')
   void uniformMatrix2fv2(
-      UniformLocation location, bool transpose, array, int srcOffset,
-      [int srcLength]) native;
+      UniformLocation? location, bool transpose, array, int srcOffset,
+      [int? srcLength]) native;
 
-  void uniformMatrix2x3fv(UniformLocation location, bool transpose, value,
-      [int srcOffset, int srcLength]) native;
+  void uniformMatrix2x3fv(UniformLocation? location, bool transpose, value,
+      [int? srcOffset, int? srcLength]) native;
 
-  void uniformMatrix2x4fv(UniformLocation location, bool transpose, value,
-      [int srcOffset, int srcLength]) native;
+  void uniformMatrix2x4fv(UniformLocation? location, bool transpose, value,
+      [int? srcOffset, int? srcLength]) native;
 
   @JSName('uniformMatrix3fv')
   void uniformMatrix3fv2(
-      UniformLocation location, bool transpose, array, int srcOffset,
-      [int srcLength]) native;
+      UniformLocation? location, bool transpose, array, int srcOffset,
+      [int? srcLength]) native;
 
-  void uniformMatrix3x2fv(UniformLocation location, bool transpose, value,
-      [int srcOffset, int srcLength]) native;
+  void uniformMatrix3x2fv(UniformLocation? location, bool transpose, value,
+      [int? srcOffset, int? srcLength]) native;
 
-  void uniformMatrix3x4fv(UniformLocation location, bool transpose, value,
-      [int srcOffset, int srcLength]) native;
+  void uniformMatrix3x4fv(UniformLocation? location, bool transpose, value,
+      [int? srcOffset, int? srcLength]) native;
 
   @JSName('uniformMatrix4fv')
   void uniformMatrix4fv2(
-      UniformLocation location, bool transpose, array, int srcOffset,
-      [int srcLength]) native;
+      UniformLocation? location, bool transpose, array, int srcOffset,
+      [int? srcLength]) native;
 
-  void uniformMatrix4x2fv(UniformLocation location, bool transpose, value,
-      [int srcOffset, int srcLength]) native;
+  void uniformMatrix4x2fv(UniformLocation? location, bool transpose, value,
+      [int? srcOffset, int? srcLength]) native;
 
-  void uniformMatrix4x3fv(UniformLocation location, bool transpose, value,
-      [int srcOffset, int srcLength]) native;
+  void uniformMatrix4x3fv(UniformLocation? location, bool transpose, value,
+      [int? srcOffset, int? srcLength]) native;
 
   void vertexAttribDivisor(int index, int divisor) native;
 
@@ -2311,13 +2314,13 @@
 
   void bindAttribLocation(Program program, int index, String name) native;
 
-  void bindBuffer(int target, Buffer buffer) native;
+  void bindBuffer(int target, Buffer? buffer) native;
 
-  void bindFramebuffer(int target, Framebuffer framebuffer) native;
+  void bindFramebuffer(int target, Framebuffer? framebuffer) native;
 
-  void bindRenderbuffer(int target, Renderbuffer renderbuffer) native;
+  void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
 
-  void bindTexture(int target, Texture texture) native;
+  void bindTexture(int target, Texture? texture) native;
 
   void blendColor(num red, num green, num blue, num alpha) native;
 
@@ -2376,17 +2379,17 @@
 
   void cullFace(int mode) native;
 
-  void deleteBuffer(Buffer buffer) native;
+  void deleteBuffer(Buffer? buffer) native;
 
-  void deleteFramebuffer(Framebuffer framebuffer) native;
+  void deleteFramebuffer(Framebuffer? framebuffer) native;
 
-  void deleteProgram(Program program) native;
+  void deleteProgram(Program? program) native;
 
-  void deleteRenderbuffer(Renderbuffer renderbuffer) native;
+  void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
 
-  void deleteShader(Shader shader) native;
+  void deleteShader(Shader? shader) native;
 
-  void deleteTexture(Texture texture) native;
+  void deleteTexture(Texture? texture) native;
 
   void depthFunc(int func) native;
 
@@ -2413,10 +2416,10 @@
   void flush() native;
 
   void framebufferRenderbuffer(int target, int attachment,
-      int renderbuffertarget, Renderbuffer renderbuffer) native;
+      int renderbuffertarget, Renderbuffer? renderbuffer) native;
 
   void framebufferTexture2D(int target, int attachment, int textarget,
-      Texture texture, int level) native;
+      Texture? texture, int level) native;
 
   void frontFace(int mode) native;
 
@@ -2426,13 +2429,13 @@
 
   ActiveInfo getActiveUniform(Program program, int index) native;
 
-  List<Shader> getAttachedShaders(Program program) native;
+  List<Shader>? getAttachedShaders(Program program) native;
 
   int getAttribLocation(Program program, String name) native;
 
-  Object getBufferParameter(int target, int pname) native;
+  Object? getBufferParameter(int target, int pname) native;
 
-  Map getContextAttributes() {
+  Map? getContextAttributes() {
     return convertNativeToDart_Dictionary(_getContextAttributes_1());
   }
 
@@ -2441,57 +2444,57 @@
 
   int getError() native;
 
-  Object getExtension(String name) native;
+  Object? getExtension(String name) native;
 
-  Object getFramebufferAttachmentParameter(
+  Object? getFramebufferAttachmentParameter(
       int target, int attachment, int pname) native;
 
-  Object getParameter(int pname) native;
+  Object? getParameter(int pname) native;
 
-  String getProgramInfoLog(Program program) native;
+  String? getProgramInfoLog(Program program) native;
 
-  Object getProgramParameter(Program program, int pname) native;
+  Object? getProgramParameter(Program program, int pname) native;
 
-  Object getRenderbufferParameter(int target, int pname) native;
+  Object? getRenderbufferParameter(int target, int pname) native;
 
-  String getShaderInfoLog(Shader shader) native;
+  String? getShaderInfoLog(Shader shader) native;
 
-  Object getShaderParameter(Shader shader, int pname) native;
+  Object? getShaderParameter(Shader shader, int pname) native;
 
   ShaderPrecisionFormat getShaderPrecisionFormat(
       int shadertype, int precisiontype) native;
 
-  String getShaderSource(Shader shader) native;
+  String? getShaderSource(Shader shader) native;
 
-  List<String> getSupportedExtensions() native;
+  List<String>? getSupportedExtensions() native;
 
-  Object getTexParameter(int target, int pname) native;
+  Object? getTexParameter(int target, int pname) native;
 
-  Object getUniform(Program program, UniformLocation location) native;
+  Object? getUniform(Program program, UniformLocation location) native;
 
   UniformLocation getUniformLocation(Program program, String name) native;
 
-  Object getVertexAttrib(int index, int pname) native;
+  Object? getVertexAttrib(int index, int pname) native;
 
   int getVertexAttribOffset(int index, int pname) native;
 
   void hint(int target, int mode) native;
 
-  bool isBuffer(Buffer buffer) native;
+  bool isBuffer(Buffer? buffer) native;
 
   bool isContextLost() native;
 
   bool isEnabled(int cap) native;
 
-  bool isFramebuffer(Framebuffer framebuffer) native;
+  bool isFramebuffer(Framebuffer? framebuffer) native;
 
-  bool isProgram(Program program) native;
+  bool isProgram(Program? program) native;
 
-  bool isRenderbuffer(Renderbuffer renderbuffer) native;
+  bool isRenderbuffer(Renderbuffer? renderbuffer) native;
 
-  bool isShader(Shader shader) native;
+  bool isShader(Shader? shader) native;
 
-  bool isTexture(Texture texture) native;
+  bool isTexture(Texture? texture) native;
 
   void lineWidth(num width) native;
 
@@ -2503,7 +2506,7 @@
 
   @JSName('readPixels')
   void _readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData pixels) native;
+      TypedData? pixels) native;
 
   void renderbufferStorage(
       int target, int internalformat, int width, int height) native;
@@ -2533,9 +2536,9 @@
       int format_OR_width,
       int height_OR_type,
       bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
-      [int format,
-      int type,
-      TypedData pixels]) {
+      [int? format,
+      int? type,
+      TypedData? pixels]) {
     if (type != null &&
         format != null &&
         (bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
@@ -2622,7 +2625,7 @@
 
   @JSName('texImage2D')
   void _texImage2D_1(target, level, internalformat, width, height, int border,
-      format, type, TypedData pixels) native;
+      format, type, TypedData? pixels) native;
   @JSName('texImage2D')
   void _texImage2D_2(target, level, internalformat, format, type, pixels)
       native;
@@ -2651,8 +2654,8 @@
       int format_OR_width,
       int height_OR_type,
       bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
-      [int type,
-      TypedData pixels]) {
+      [int? type,
+      TypedData? pixels]) {
     if (type != null &&
         (bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is int)) {
       _texSubImage2D_1(
@@ -2737,7 +2740,7 @@
 
   @JSName('texSubImage2D')
   void _texSubImage2D_1(target, level, xoffset, yoffset, width, height,
-      int format, type, TypedData pixels) native;
+      int format, type, TypedData? pixels) native;
   @JSName('texSubImage2D')
   void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels)
       native;
@@ -2754,45 +2757,48 @@
   void _texSubImage2D_6(
       target, level, xoffset, yoffset, format, type, ImageBitmap bitmap) native;
 
-  void uniform1f(UniformLocation location, num x) native;
+  void uniform1f(UniformLocation? location, num x) native;
 
-  void uniform1fv(UniformLocation location, v) native;
+  void uniform1fv(UniformLocation? location, v) native;
 
-  void uniform1i(UniformLocation location, int x) native;
+  void uniform1i(UniformLocation? location, int x) native;
 
-  void uniform1iv(UniformLocation location, v) native;
+  void uniform1iv(UniformLocation? location, v) native;
 
-  void uniform2f(UniformLocation location, num x, num y) native;
+  void uniform2f(UniformLocation? location, num x, num y) native;
 
-  void uniform2fv(UniformLocation location, v) native;
+  void uniform2fv(UniformLocation? location, v) native;
 
-  void uniform2i(UniformLocation location, int x, int y) native;
+  void uniform2i(UniformLocation? location, int x, int y) native;
 
-  void uniform2iv(UniformLocation location, v) native;
+  void uniform2iv(UniformLocation? location, v) native;
 
-  void uniform3f(UniformLocation location, num x, num y, num z) native;
+  void uniform3f(UniformLocation? location, num x, num y, num z) native;
 
-  void uniform3fv(UniformLocation location, v) native;
+  void uniform3fv(UniformLocation? location, v) native;
 
-  void uniform3i(UniformLocation location, int x, int y, int z) native;
+  void uniform3i(UniformLocation? location, int x, int y, int z) native;
 
-  void uniform3iv(UniformLocation location, v) native;
+  void uniform3iv(UniformLocation? location, v) native;
 
-  void uniform4f(UniformLocation location, num x, num y, num z, num w) native;
+  void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
 
-  void uniform4fv(UniformLocation location, v) native;
+  void uniform4fv(UniformLocation? location, v) native;
 
-  void uniform4i(UniformLocation location, int x, int y, int z, int w) native;
+  void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
 
-  void uniform4iv(UniformLocation location, v) native;
+  void uniform4iv(UniformLocation? location, v) native;
 
-  void uniformMatrix2fv(UniformLocation location, bool transpose, array) native;
+  void uniformMatrix2fv(UniformLocation? location, bool transpose, array)
+      native;
 
-  void uniformMatrix3fv(UniformLocation location, bool transpose, array) native;
+  void uniformMatrix3fv(UniformLocation? location, bool transpose, array)
+      native;
 
-  void uniformMatrix4fv(UniformLocation location, bool transpose, array) native;
+  void uniformMatrix4fv(UniformLocation? location, bool transpose, array)
+      native;
 
-  void useProgram(Program program) native;
+  void useProgram(Program? program) native;
 
   void validateProgram(Program program) native;
 
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index 9610771..f97b55e 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -1,5 +1,3 @@
-// @dart = 2.6
-
 /**
  * An API for storing data in the browser that can be queried with SQL.
  *
@@ -99,9 +97,9 @@
    * * [Database.changeVersion](http://www.w3.org/TR/webdatabase/#dom-database-changeversion) from W3C.
    */
   void _changeVersion(String oldVersion, String newVersion,
-      [SqlTransactionCallback callback,
-      SqlTransactionErrorCallback errorCallback,
-      VoidCallback successCallback]) native;
+      [SqlTransactionCallback? callback,
+      SqlTransactionErrorCallback? errorCallback,
+      VoidCallback? successCallback]) native;
 
   @JSName('changeVersion')
   /**
@@ -130,8 +128,8 @@
 
   @JSName('readTransaction')
   void _readTransaction(SqlTransactionCallback callback,
-      [SqlTransactionErrorCallback errorCallback,
-      VoidCallback successCallback]) native;
+      [SqlTransactionErrorCallback? errorCallback,
+      VoidCallback? successCallback]) native;
 
   @JSName('readTransaction')
   Future<SqlTransaction> readTransaction() {
@@ -145,8 +143,8 @@
   }
 
   void transaction(SqlTransactionCallback callback,
-      [SqlTransactionErrorCallback errorCallback,
-      VoidCallback successCallback]) native;
+      [SqlTransactionErrorCallback? errorCallback,
+      VoidCallback? successCallback]) native;
 
   @JSName('transaction')
   Future<SqlTransaction> transaction_future() {
@@ -226,7 +224,7 @@
   Map operator [](int index) {
     if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
       throw new RangeError.index(index, this);
-    return this.item(index);
+    return this.item(index)!;
   }
 
   void operator []=(int index, Map value) {
@@ -266,7 +264,7 @@
   Map elementAt(int index) => this[index];
   // -- end List<Map> mixins.
 
-  Map item(int index) {
+  Map? item(int index) {
     return convertNativeToDart_Dictionary(_item_1(index));
   }
 
@@ -290,12 +288,12 @@
 
   @JSName('executeSql')
   void _executeSql(String sqlStatement,
-      [List arguments,
-      SqlStatementCallback callback,
-      SqlStatementErrorCallback errorCallback]) native;
+      [List? arguments,
+      SqlStatementCallback? callback,
+      SqlStatementErrorCallback? errorCallback]) native;
 
   @JSName('executeSql')
-  Future<SqlResultSet> executeSql(String sqlStatement, [List arguments]) {
+  Future<SqlResultSet> executeSql(String sqlStatement, [List? arguments]) {
     var completer = new Completer<SqlResultSet>();
     _executeSql(sqlStatement, arguments, (transaction, resultSet) {
       applyExtension('SQLResultSet', resultSet);
diff --git a/sdk_args.gni b/sdk_args.gni
index eb4017e..94e6b7a8 100644
--- a/sdk_args.gni
+++ b/sdk_args.gni
@@ -5,12 +5,6 @@
 _dart_root = get_path_info(".", "abspath")
 
 declare_args() {
-  # Whether to build a Legacy SDK using Legacy core libraries.
-  # TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant
-  # and there is no need to build a legacy version of the SDK for comparison
-  # purposes.
-  dont_use_nnbd = false
-
   # Absolute path to the .git folder.
   #
   # This is used in rules that need to refer to `.git/logs/HEAD` to include
diff --git a/sdk_nnbd/BUILD.gn b/sdk_nnbd/BUILD.gn
deleted file mode 100644
index 5354079..0000000
--- a/sdk_nnbd/BUILD.gn
+++ /dev/null
@@ -1,958 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# This GN file contains build rules for assembling the Dart SDK. There are
-# two possible variants: the "Full" SDK, and the "Platform" SDK. If you want
-# to make a new subset of the Full SDK, make it the same way we make
-# the Platform SDK.
-#
-# Warning:
-# If you need to copy something into dart-sdk/lib/foo in addition to the stuff
-# copied there by :copy_libraries, then you must depend on ":copy_libraries",
-# or ":copy_libraries" may delete/overwrite your addition, and the build will
-# fail.
-
-import("../build/dart/copy_tree.gni")
-import("../runtime/runtime_args.gni")
-import("../sdk_args.gni")
-
-declare_args() {
-  # Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
-  dart_platform_sdk = true
-
-  # Whether to include dart2native in the "create_sdk" target.
-  include_dart2native = false
-
-  # Path to stripped dart binaries relative to build output directory.
-  dart_stripped_binary = "dart"
-  dart_precompiled_runtime_stripped_binary = "dart_precompiled_runtime"
-  gen_snapshot_stripped_binary = "gen_snapshot"
-}
-
-# The directory layout of the SDK is as follows:
-#
-# ..dart-sdk/
-# ....bin/
-# ......dart or dart.exe (executable)
-# ......dart.lib (import library for VM native extensions on Windows)
-# ......dartaotruntime or dartaotruntime.exe (executable)
-# ......dartdoc
-# ......dartfmt
-# ......dart2native (if `include_dart2native` and not on ia32)
-# ......dart2js
-# ......dartanalyzer
-# ......dartdevc
-# ......utils/gen_snapshot or utils/gen_snapshot.exe (if `include_dart2native` and not on ia32)
-# ......pub
-# ......snapshots/
-# ........analysis_server.dart.snapshot
-# ........dart2js.dart.snapshot
-# ........dartanalyzer.dart.snapshot
-# ........dartdev.dart.snapshot
-# ........dartdoc.dart.snapshot
-# ........dartfmt.dart.snapshot
-# ........dartdevc.dart.snapshot
-# ........gen_kernel.dart.snapshot (if `include_dart2native` and not on ia32)
-# ........dart2native.dart.snapshot (if `include_dart2native` and not on ia32)
-# ........kernel_worker.dart.snapshot
-# ........pub.dart.snapshot
-# ........frontend_server.dart.snapshot
-# ......resources/
-# ........dartdoc/
-# ...........packages
-# ..........resources/
-# ..........templates/
-# ......model/
-# ........lexeme/
-# ..........idx2word.json
-# ..........model.tflite
-# ..........word2idx.json
-# ....include/
-# ......dart_api.h
-# ......dart_native_api.h
-# ......dart_tools_api.h
-# ....lib/
-# ......libraries.json
-# ......_internal/
-# ........strong.sum
-# ........dart2js_platform.dill
-# ........dart2js_server_platform.dill
-# ........dart2js_platform_strong.dill
-# ........dart2js_server_platform_strong.dill
-# ........vm_platform_strong.dill
-# ........dev_compiler/
-# ......async/
-# ......collection/
-# ......convert/
-# ......core/
-# ......html/
-# ......_http/
-# ......internal/
-# ......io/
-# ......isolate/
-# ......js/
-# ......js_util/
-# ......math/
-# ......mirrors/
-# ......typed_data/
-# ......wasm/
-# ......api_readme.md
-
-# Scripts that go under bin/
-_platform_sdk_scripts = [
-  "dartanalyzer",
-  "dartfmt",
-  "pub",
-]
-
-_full_sdk_scripts = [
-  "dart2js",
-  "dartanalyzer",
-  "dartdevc",
-  "dartfmt",
-  "pub",
-]
-
-# Scripts not ending in _sdk that go under bin/
-_scripts = [ "dartdoc" ]
-
-# Snapshots that go under bin/snapshots
-_platform_sdk_snapshots = [
-  [
-    "dartanalyzer",
-    "../utils/dartanalyzer:generate_dartanalyzer_snapshot",
-  ],
-  [
-    "dartdev",
-    "../utils/dartdev:generate_dartdev_snapshot",
-  ],
-  [
-    "dartdoc",
-    "../utils/dartdoc",
-  ],
-  [
-    "dartfmt",
-    "../utils/dartfmt",
-  ],
-  [
-    "pub",
-    "../utils/pub",
-  ],
-]
-if (include_dart2native && dart_target_arch != "ia32") {
-  _platform_sdk_snapshots += [ [
-        "dart2native",
-        "../utils/dart2native:generate_dart2native_snapshot",
-      ] ]
-}
-if (create_kernel_service_snapshot) {
-  _platform_sdk_snapshots += [ [
-        "kernel-service",
-        "../utils/kernel-service:kernel-service_snapshot",
-      ] ]
-}
-if (dart_target_arch != "arm") {
-  _platform_sdk_snapshots += [ [
-        "analysis_server",
-        "../utils/analysis_server",
-      ] ]
-}
-
-_full_sdk_snapshots = [
-  [
-    "dart2js",
-    "../utils/compiler:dart2js",
-  ],
-  [
-    "dartanalyzer",
-    "../utils/dartanalyzer:generate_dartanalyzer_snapshot",
-  ],
-  [
-    "dartdev",
-    "../utils/dartdev:generate_dartdev_snapshot",
-  ],
-  [
-    "dartdevc",
-    "../utils/dartdevc",
-  ],
-  [
-    "dartdoc",
-    "../utils/dartdoc",
-  ],
-  [
-    "dartfmt",
-    "../utils/dartfmt",
-  ],
-  [
-    "kernel_worker",
-    "../utils/bazel:kernel_worker",
-  ],
-  [
-    "pub",
-    "../utils/pub",
-  ],
-  [
-    "frontend_server",
-    "../utils/kernel-service:frontend_server",
-  ],
-]
-if (include_dart2native && dart_target_arch != "ia32") {
-  _full_sdk_snapshots += [ [
-        "dart2native",
-        "../utils/dart2native:generate_dart2native_snapshot",
-      ] ]
-}
-if (create_kernel_service_snapshot) {
-  _full_sdk_snapshots += [ [
-        "kernel-service",
-        "../utils/kernel-service:kernel-service_snapshot",
-      ] ]
-}
-if (dart_target_arch != "arm") {
-  _full_sdk_snapshots += [ [
-        "analysis_server",
-        "../utils/analysis_server",
-      ] ]
-}
-
-# Libraries that go under lib/
-_full_sdk_libraries = [
-  "_internal",
-  "async",
-  "cli",
-  "collection",
-  "convert",
-  "core",
-  "developer",
-  "ffi",
-  "html",
-  "_http",
-  "indexed_db",
-  "internal",
-  "io",
-  "isolate",
-  "js",
-  "js_util",
-  "math",
-  "mirrors",
-  "svg",
-  "typed_data",
-  "wasm",
-  "web_audio",
-  "web_gl",
-  "web_sql",
-]
-
-# Apps running on the platform SDK shouldn't be using Dart4Web libraries, but
-# the analyzer and dartdoc expect all the library sources to be present.
-#
-# _platform_sdk_libraries = [
-#   "_internal",
-#   "async",
-#   "cli",
-#   "collection",
-#   "convert",
-#   "core",
-#   "developer",
-#   "html",
-#   "_http",
-#   "internal",
-#   "io",
-#   "isolate",
-#   "math",
-#   "mirrors",
-#   "typed_data",
-# ]
-_platform_sdk_libraries = _full_sdk_libraries
-
-# From here down to the copy_trees() invocation, we collect all the information
-# about trees that need to be copied in the list of scopes, copy_tree_specs.
-copy_tree_specs = []
-
-# This rule copies dartdoc templates to
-# bin/resources/dartdoc/templates
-copy_tree_specs += [
-  {
-    target = "copy_dartdoc_templates"
-    visibility = [ ":copy_dartdoc_files" ]
-    source = "../third_party/pkg/dartdoc/lib/templates"
-    dest = "$root_out_dir/dart-sdk/bin/resources/dartdoc/templates"
-    ignore_patterns = "{}"
-  },
-]
-
-# This rule copies dartdoc resources to
-# bin/resources/dartdoc/resources
-copy_tree_specs += [
-  {
-    target = "copy_dartdoc_resources"
-    visibility = [ ":copy_dartdoc_files" ]
-    source = "../third_party/pkg/dartdoc/lib/resources"
-    dest = "$root_out_dir/dart-sdk/bin/resources/dartdoc/resources"
-    ignore_patterns = "{}"
-  },
-]
-
-# This loop generates rules to copy libraries to lib/
-foreach(library, _full_sdk_libraries) {
-  copy_tree_specs += [
-    {
-      target = "copy_${library}_library"
-      visibility = [
-        ":copy_platform_sdk_libraries",
-        ":copy_full_sdk_libraries",
-      ]
-      source = "lib/$library"
-      dest = "$root_out_dir/dart-sdk/lib/$library"
-      ignore_patterns = "*.svn,doc,*.py,*.gypi,*.sh,.gitignore"
-    },
-  ]
-}
-
-if (is_win) {
-  copy_tree_specs += [
-    {
-      target = "copy_7zip"
-      visibility = [ ":create_common_sdk" ]
-      deps = [ ":copy_libraries" ]
-      source = "../third_party/7zip"
-      dest = "$root_out_dir/dart-sdk/lib/_internal/pub/asset/7zip"
-      ignore_patterns = ".svn"
-    },
-  ]
-}
-
-if (target_cpu == "x64") {
-  copy_tree_specs += [
-    {
-      target = "copy_language_model"
-      visibility = [ ":create_common_sdk" ]
-      deps = [ ":copy_libraries" ]
-      source = "../pkg/analysis_server/language_model"
-      dest = "$root_out_dir/dart-sdk/bin/model"
-      ignore_patterns = "{}"
-    },
-  ]
-  if (is_linux || is_android) {
-    copy_tree_specs += [
-      {
-        target = "copy_libtensorflowlite_c"
-        visibility = [ ":create_common_sdk" ]
-        deps = [ ":copy_libraries" ]
-        source = "../third_party/pkg/tflite_native/lib/src/blobs"
-        dest = "$root_out_dir/dart-sdk/bin/snapshots"
-        ignore_patterns = "*.dll,*mac64.so"
-      },
-    ]
-  }
-  if (is_mac) {
-    copy_tree_specs += [
-      {
-        target = "copy_libtensorflowlite_c"
-        visibility = [ ":create_common_sdk" ]
-        deps = [ ":copy_libraries" ]
-        source = "../third_party/pkg/tflite_native/lib/src/blobs"
-        dest = "$root_out_dir/dart-sdk/bin/snapshots"
-        ignore_patterns = "*.dll,*linux64.so"
-      },
-    ]
-  }
-  if (is_win) {
-    copy_tree_specs += [
-      {
-        target = "copy_libtensorflowlite_c"
-        visibility = [ ":create_common_sdk" ]
-        deps = [ ":copy_libraries" ]
-        source = "../third_party/pkg/tflite_native/lib/src/blobs"
-        dest = "$root_out_dir/dart-sdk/bin/snapshots"
-        ignore_patterns = "*.so"
-      },
-    ]
-  }
-}
-
-# This generates targets for everything in copy_tree_specs. The targets have the
-# same name as the "target" fields in the scopes of copy_tree_specs.
-copy_trees("copy_trees") {
-  sources = copy_tree_specs
-}
-
-# Copies the Dart VM binary into bin/
-if (target_os != current_os && target_os == "fuchsia") {
-  # In the Fuchsia build, this has to use a symlink for two reasons.
-  # First, it makes the lookup of shared libraries relative to $ORIGIN
-  # (Linux) or @loader_path (macOS) find the libraries where they are,
-  # since those lookups use the directory of the symlink target rather
-  # than of the link itself (as they would for a copy or hard link).
-  # Second, when the dart binary is built as a "variant" (e.g. with a
-  # sanitizer), then $root_out_dir/dart is itself a symlink to the real
-  # binary in the selected variant toolchain's $root_out_dir and since
-  # the "copy" tool is actually a hard link rather than a copy, it will
-  # make a link to the symlink rather than the symlink's target, and the
-  # relative symlink interpreted from a different containing directory
-  # will not find the actual binary.
-  action("copy_dart") {
-    visibility = [ ":create_common_sdk" ]
-    dart_label = "../runtime/bin:dart"
-    deps = [ dart_label ]
-    dart_out = get_label_info(dart_label, "root_out_dir")
-    sources = [ "$dart_out/$dart_stripped_binary" ]
-    outputs = [ "$root_out_dir/dart-sdk/bin/$dart_stripped_binary" ]
-    script = "/bin/ln"
-    args = [
-      "-snf",
-      rebase_path(sources[0], get_path_info(outputs[0], "dir")),
-      rebase_path(outputs[0]),
-    ]
-  }
-} else {
-  copy("copy_dart") {
-    visibility = [ ":create_common_sdk" ]
-    deps = [ "../runtime/bin:dart" ]
-    dart_out = get_label_info("../runtime/bin:dart", "root_out_dir")
-    if (is_win) {
-      sources = [ "$dart_out/dart.exe" ]
-    } else {
-      sources = [ "$dart_out/$dart_stripped_binary" ]
-    }
-    if (is_win) {
-      sources += [ "$dart_out/dart.lib" ]
-    }
-    outputs = [ "$root_out_dir/dart-sdk/bin/{{source_file_part}}" ]
-  }
-}
-
-copy("copy_dartaotruntime") {
-  deps = [ "../runtime/bin:dart_precompiled_runtime" ]
-  dartaotruntime_out =
-      get_label_info("../runtime/bin:dart_precompiled_runtime", "root_out_dir")
-  if (is_win) {
-    sources = [ "$dartaotruntime_out/dart_precompiled_runtime.exe" ]
-    outputs = [ "$root_out_dir/dart-sdk/bin/dartaotruntime.exe" ]
-  } else {
-    sources =
-        [ "$dartaotruntime_out/$dart_precompiled_runtime_stripped_binary" ]
-    outputs = [ "$root_out_dir/dart-sdk/bin/dartaotruntime" ]
-  }
-}
-
-copy("copy_gen_snapshot") {
-  deps = [ "../runtime/bin:gen_snapshot" ]
-  gen_snapshot_out =
-      get_label_info("../runtime/bin:gen_snapshot", "root_out_dir")
-  if (is_win) {
-    sources = [ "$gen_snapshot_out/gen_snapshot.exe" ]
-  } else {
-    sources = [ "$gen_snapshot_out/$gen_snapshot_stripped_binary" ]
-  }
-  outputs = [ "$root_out_dir/dart-sdk/bin/utils/{{source_file_part}}" ]
-}
-
-copy("copy_dart2native") {
-  deps = [
-    ":copy_dartaotruntime",
-    ":copy_gen_kernel_snapshot",
-    ":copy_gen_snapshot",
-  ]
-  ext = ""
-  if (is_win) {
-    ext = ".bat"
-  }
-  sources = [ "bin/dart2native$ext" ]
-  outputs = [ "$root_out_dir/dart-sdk/bin/{{source_file_part}}" ]
-}
-
-copy("copy_gen_kernel_snapshot") {
-  deps = [ "../utils/gen_kernel" ]
-  sources = [ "$root_gen_dir/gen_kernel.dart.snapshot" ]
-  outputs = [ "$root_out_dir/dart-sdk/bin/snapshots/{{source_file_part}}" ]
-}
-
-# A template for copying the things in _platform_sdk_scripts and
-# _full_sdk_scripts into bin/
-template("copy_sdk_script") {
-  assert(defined(invoker.name), "copy_sdk_script must define 'name'")
-  name = invoker.name
-  ext = ""
-  if (is_win) {
-    ext = ".bat"
-  }
-  copy(target_name) {
-    visibility = [
-      ":copy_platform_sdk_scripts",
-      ":copy_full_sdk_scripts",
-    ]
-    sources = [ "bin/${name}_sdk$ext" ]
-    outputs = [ "$root_out_dir/dart-sdk/bin/$name$ext" ]
-  }
-}
-
-foreach(sdk_script, _full_sdk_scripts) {
-  copy_sdk_script("copy_${sdk_script}_script") {
-    name = sdk_script
-  }
-}
-
-foreach(script, _scripts) {
-  copy("copy_${script}_script") {
-    visibility = [
-      ":copy_platform_sdk_scripts",
-      ":copy_full_sdk_scripts",
-    ]
-    ext = ""
-    if (is_win) {
-      ext = ".bat"
-    }
-    sources = [ "bin/$script$ext" ]
-    outputs = [ "$root_out_dir/dart-sdk/bin/{{source_file_part}}" ]
-  }
-}
-
-# This is the main target for copying scripts in _platform_sdk_scripts to bin/
-group("copy_platform_sdk_scripts") {
-  visibility = [ ":_create_platform_sdk" ]
-  public_deps = []
-  foreach(sdk_script, _platform_sdk_scripts) {
-    public_deps += [ ":copy_${sdk_script}_script" ]
-  }
-  foreach(script, _scripts) {
-    public_deps += [ ":copy_${script}_script" ]
-  }
-}
-
-# This is the main target for copying scripts in _full_sdk_scripts to bin/
-group("copy_full_sdk_scripts") {
-  visibility = [ ":create_full_sdk" ]
-  public_deps = []
-  foreach(sdk_script, _full_sdk_scripts) {
-    public_deps += [ ":copy_${sdk_script}_script" ]
-  }
-  foreach(script, _scripts) {
-    public_deps += [ ":copy_${script}_script" ]
-  }
-}
-
-# This loop generates "copy" targets that put snapshots into bin/snapshots
-foreach(snapshot, _full_sdk_snapshots) {
-  root = root_gen_dir
-
-  # The frontend_server is output to root_out_dir so that it doesn't conflict
-  # with the flutter snapshot by the same name under root_gen_dir.
-  if (snapshot[0] == "frontend_server") {
-    root = root_out_dir
-  }
-  copy("copy_${snapshot[0]}_snapshot") {
-    visibility = [
-      ":copy_platform_sdk_snapshots",
-      ":copy_full_sdk_snapshots",
-    ]
-    deps = [ snapshot[1] ]
-    sources = [ "$root/${snapshot[0]}.dart.snapshot" ]
-    outputs = [ "$root_out_dir/dart-sdk/bin/snapshots/{{source_file_part}}" ]
-  }
-}
-
-# This is the main rule for copying snapshots from _platform_sdk_snapshots to
-# bin/snapshots
-group("copy_platform_sdk_snapshots") {
-  visibility = [ ":_create_platform_sdk" ]
-  public_deps = []
-  foreach(snapshot, _platform_sdk_snapshots) {
-    public_deps += [ ":copy_${snapshot[0]}_snapshot" ]
-  }
-}
-
-# This is the main rule for copying snapshots from _full_sdk_snapshots to
-# bin/snapshots
-group("copy_full_sdk_snapshots") {
-  visibility = [ ":create_full_sdk" ]
-  public_deps = []
-  foreach(snapshot, _full_sdk_snapshots) {
-    public_deps += [ ":copy_${snapshot[0]}_snapshot" ]
-  }
-}
-
-# This rule writes the .packages file for dartdoc resources.
-write_file("$root_out_dir/dart-sdk/bin/resources/dartdoc/.packages",
-           "dartdoc:.")
-
-# This is the main rule for copying the files that dartdoc needs.
-group("copy_dartdoc_files") {
-  visibility = [ ":create_common_sdk" ]
-  public_deps = [
-    ":copy_dartdoc_resources",
-    ":copy_dartdoc_templates",
-  ]
-}
-
-# This rule copies analyzer summaries to lib/_internal
-copy("copy_analysis_summaries") {
-  visibility = [ ":create_common_sdk" ]
-  deps = [
-    ":copy_libraries",
-    "../utils/dartanalyzer:generate_summary_strong",
-  ]
-  sources = [ "$root_gen_dir/strong.sum" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
-}
-
-# This rule copies dill files to lib/_internal.
-copy("copy_vm_dill_files") {
-  visibility = [ ":create_common_sdk" ]
-  deps = [
-    ":copy_libraries",
-    "../runtime/vm:kernel_platform_files",
-  ]
-  sources = [ "$root_out_dir/vm_platform_strong.dill" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
-}
-
-copy("copy_abi_dill_files") {
-  visibility = [ ":create_sdk_with_abi_versions" ]
-  sources = [ "../tools/abiversions" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/abiversions" ]
-}
-
-copy("copy_dart2js_dill_files") {
-  visibility = [ ":create_full_sdk" ]
-  deps = [
-    ":copy_libraries",
-    "../utils/compiler:compile_dart2js_nnbd_strong_platform",
-    "../utils/compiler:compile_dart2js_platform",
-    "../utils/compiler:compile_dart2js_server_nnbd_strong_platform",
-    "../utils/compiler:compile_dart2js_server_platform",
-  ]
-  sources = [
-    "$root_out_dir/dart2js_nnbd_strong_platform.dill",
-    "$root_out_dir/dart2js_platform.dill",
-    "$root_out_dir/dart2js_server_nnbd_strong_platform.dill",
-    "$root_out_dir/dart2js_server_platform.dill",
-  ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
-}
-
-# Copies DDC's SDK outline .dill to lib/_internal
-copy("copy_dev_compiler_outline") {
-  visibility = [ ":copy_dev_compiler_sdk" ]
-  deps = [
-    ":copy_libraries",
-    "../utils/dartdevc:dartdevc_platform",
-  ]
-  sources = [ "$root_out_dir/ddc_outline.dill" ]
-
-  # TODO(nshahan) Fix the name here to be consistent and merge with below.
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/ddc_sdk.dill" ]
-}
-
-# Copies DDC's SDK outline .dill with sound null safety to lib/_internal
-copy("copy_dev_compiler_outline_sound") {
-  visibility = [ "../utils/dartdevc:dartdevc_test" ]
-  deps = [
-    ":copy_libraries",
-    "../utils/dartdevc:dartdevc_platform_sound",
-  ]
-  sources = [ "$root_out_dir/ddc_outline_sound.dill" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
-}
-
-# This rule copies DDK's JS SDK and require.js to lib/dev_compiler/kernel/amd.
-copy("copy_dev_compiler_js_amd_kernel") {
-  visibility = [ ":copy_dev_compiler_js" ]
-  deps = [ "../utils/dartdevc:dartdevc_kernel_sdk" ]
-  gen_dir =
-      get_label_info("../utils/dartdevc:dartdevc_kernel_sdk", "target_gen_dir")
-  sources = [
-    "$gen_dir/kernel/amd/dart_sdk.js",
-    "$gen_dir/kernel/amd/dart_sdk.js.map",
-    "../third_party/requirejs/require.js",
-  ]
-  outputs = [
-    "$root_out_dir/dart-sdk/lib/dev_compiler/kernel/amd/{{source_file_part}}",
-  ]
-}
-
-# This rule copies DDK's JS SDK to lib/dev_compiler/kernel/common.
-copy("copy_dev_compiler_js_common_kernel") {
-  visibility = [ ":copy_dev_compiler_js" ]
-  deps = [ "../utils/dartdevc:dartdevc_kernel_sdk" ]
-  gen_dir =
-      get_label_info("../utils/dartdevc:dartdevc_kernel_sdk", "target_gen_dir")
-  sources = [
-    "$gen_dir/kernel/common/dart_sdk.js",
-    "$gen_dir/kernel/common/dart_sdk.js.map",
-    "../pkg/dev_compiler/lib/js/common/run.js",
-  ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/dev_compiler/kernel/common/{{source_file_part}}" ]
-}
-
-# This rule copies DDK's JS SDK to lib/dev_compiler/kernel/es6.
-copy("copy_dev_compiler_js_es6_kernel") {
-  visibility = [ ":copy_dev_compiler_js" ]
-  deps = [ "../utils/dartdevc:dartdevc_kernel_sdk" ]
-  gen_dir =
-      get_label_info("../utils/dartdevc:dartdevc_kernel_sdk", "target_gen_dir")
-  sources = [
-    "$gen_dir/kernel/es6/dart_sdk.js",
-    "$gen_dir/kernel/es6/dart_sdk.js.map",
-  ]
-  outputs = [
-    "$root_out_dir/dart-sdk/lib/dev_compiler/kernel/es6/{{source_file_part}}",
-  ]
-}
-
-# Copies all of the JS artifacts needed by DDC.
-group("copy_dev_compiler_js") {
-  visibility = [
-    ":copy_dev_compiler_sdk",
-    ":copy_dev_compiler_tools",
-  ]
-  public_deps = [
-    ":copy_dev_compiler_js_amd_kernel",
-    ":copy_dev_compiler_js_common_kernel",
-    ":copy_dev_compiler_js_es6_kernel",
-  ]
-}
-
-# This rule copies tools to go along with ddc.
-copy("copy_dev_compiler_tools") {
-  visibility = [ ":copy_dev_compiler_sdk" ]
-  deps = [
-    ":copy_dev_compiler_js",
-    "../utils/dartdevc:stack_trace_mapper",
-  ]
-  dart_out =
-      get_label_info("../utils/dartdevc:stack_trace_mapper", "root_out_dir")
-  sources = [ "$dart_out/dev_compiler/build/web/dart_stack_trace_mapper.js" ]
-  outputs =
-      [ "$root_out_dir/dart-sdk/lib/dev_compiler/web/{{source_file_part}}" ]
-}
-
-# This is the main rule for copying ddc's dependencies to lib/
-group("copy_dev_compiler_sdk") {
-  visibility = [ ":create_full_sdk" ]
-  public_deps = [
-    ":copy_dev_compiler_js",
-    ":copy_dev_compiler_outline",
-    ":copy_dev_compiler_tools",
-  ]
-}
-
-# This rule copies header files to include/
-copy("copy_headers") {
-  visibility = [ ":create_common_sdk" ]
-  sources = [
-    "../runtime/include/dart_api.h",
-    "../runtime/include/dart_native_api.h",
-    "../runtime/include/dart_tools_api.h",
-  ]
-  outputs = [ "$root_out_dir/dart-sdk/include/{{source_file_part}}" ]
-}
-
-# This rule copies libraries.json files to lib/
-copy("copy_libraries_specification") {
-  visibility = [ ":create_common_sdk" ]
-  sources = [ "lib/libraries.json" ]
-  deps = [ ":copy_libraries" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/{{source_file_part}}" ]
-}
-
-# This is the main rule to copy libraries in _platform_sdk_libraries to lib/
-group("copy_platform_sdk_libraries") {
-  visibility = [
-    ":_create_platform_sdk",
-    ":copy_libraries",
-  ]
-  public_deps = []
-  foreach(library, _platform_sdk_libraries) {
-    public_deps += [ ":copy_${library}_library" ]
-  }
-}
-
-# This is the main rule to copy libraries in _full_sdk_libraries to lib/
-group("copy_full_sdk_libraries") {
-  visibility = [
-    ":create_full_sdk",
-    ":copy_libraries",
-  ]
-  public_deps = []
-  foreach(library, _full_sdk_libraries) {
-    public_deps += [ ":copy_${library}_library" ]
-  }
-}
-
-group("copy_libraries") {
-  if (dart_platform_sdk) {
-    public_deps = [ ":copy_platform_sdk_libraries" ]
-  } else {
-    public_deps = [ ":copy_full_sdk_libraries" ]
-  }
-}
-
-# This rule writes the version file.
-action("write_version_file") {
-  visibility = [ ":create_common_sdk" ]
-  inputs = [
-    "../tools/VERSION",
-    "$default_git_folder/logs/HEAD",
-  ]
-  output = "$root_out_dir/dart-sdk/version"
-  outputs = [ output ]
-  script = "../tools/write_version_file.py"
-  args = [
-    "--output",
-    rebase_path(output),
-  ]
-}
-
-# This rule writes the revision file.
-action("write_revision_file") {
-  visibility = [ ":create_common_sdk" ]
-  inputs = [ "$default_git_folder/logs/HEAD" ]
-  output = "$root_out_dir/dart-sdk/revision"
-  outputs = [ output ]
-  script = "../tools/write_revision_file.py"
-  args = [
-    "--output",
-    rebase_path(output),
-  ]
-}
-
-# Copy libraries.dart to lib/_internal/libraries.dart for backwards
-# compatibility.
-#
-# TODO(sigmund): stop copying libraries.dart. Old versions (<=0.25.1-alpha.4)
-# of the analyzer package do not support the new location of this file. We
-# should be able to remove the old file once we release a newer version of
-# analyzer and popular frameworks have migrated to use it.
-copy("copy_libraries_dart") {
-  visibility = [ ":create_common_sdk" ]
-  deps = [ ":copy_libraries" ]
-  sources = [ "lib/_internal/sdk_library_metadata/lib/libraries.dart" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/_internal/{{source_file_part}}" ]
-}
-
-# This rule copies the README file.
-copy("copy_readme") {
-  visibility = [ ":create_common_sdk" ]
-  sources = [ "../README.dart-sdk" ]
-  outputs = [ "$root_out_dir/dart-sdk/README" ]
-}
-
-# This rule copies the LICENSE file.
-copy("copy_license") {
-  visibility = [ ":create_common_sdk" ]
-  sources = [ "../LICENSE" ]
-  outputs = [ "$root_out_dir/dart-sdk/LICENSE" ]
-}
-
-# This rule generates a custom dartdoc_options.yaml file.
-action("write_dartdoc_options") {
-  visibility = [ ":create_common_sdk" ]
-  inputs = [ "$default_git_folder/logs/HEAD" ]
-  output = "$root_out_dir/dart-sdk/dartdoc_options.yaml"
-  outputs = [ output ]
-  script = "../tools/write_dartdoc_options_file.py"
-  args = [
-    "--output",
-    rebase_path(output),
-  ]
-}
-
-# This rule copies the API readme file to lib/
-copy("copy_api_readme") {
-  visibility = [ ":create_common_sdk" ]
-  sources = [ "api_readme.md" ]
-  outputs = [ "$root_out_dir/dart-sdk/lib/api_readme.md" ]
-}
-
-# Parts common to both platform and full SDKs.
-group("create_common_sdk") {
-  visibility = [
-    ":create_sdk",
-    ":create_platform_sdk",
-  ]
-  public_deps = [
-    ":copy_analysis_summaries",
-    ":copy_api_readme",
-    ":copy_dart",
-    ":copy_dartdoc_files",
-    ":copy_headers",
-    ":copy_libraries_dart",
-    ":copy_libraries_specification",
-    ":copy_license",
-    ":copy_readme",
-    ":copy_vm_dill_files",
-    ":write_dartdoc_options",
-    ":write_revision_file",
-    ":write_version_file",
-  ]
-
-  # We do not support AOT on ia32 and should therefore not add the
-  # dart2native script (since there is no AOT compiler/runtime available)
-  if (include_dart2native && dart_target_arch != "ia32") {
-    public_deps += [ ":copy_dart2native" ]
-  }
-
-  if (is_win) {
-    public_deps += [ ":copy_7zip" ]
-  }
-  if (target_cpu == "x64") {
-    public_deps += [
-      ":copy_language_model",
-      ":copy_libtensorflowlite_c",
-    ]
-  }
-}
-
-# Parts specific to the platform SDK.
-group("_create_platform_sdk") {
-  visibility = [
-    ":create_sdk",
-    ":create_platform_sdk",
-  ]
-  public_deps = [
-    ":copy_platform_sdk_libraries",
-    ":copy_platform_sdk_scripts",
-    ":copy_platform_sdk_snapshots",
-  ]
-}
-
-# Parts specific to the full SDK.
-group("create_full_sdk") {
-  visibility = [ ":create_sdk" ]
-
-  public_deps = [
-    ":copy_dart2js_dill_files",
-    ":copy_dev_compiler_sdk",
-    ":copy_full_sdk_libraries",
-    ":copy_full_sdk_scripts",
-    ":copy_full_sdk_snapshots",
-  ]
-}
-
-# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
-group("create_platform_sdk") {
-  public_deps = [
-    ":_create_platform_sdk",
-    ":create_common_sdk",
-  ]
-}
-
-# The main target to depend on from ../BUILD.gn
-group("create_sdk") {
-  public_deps = [ ":create_common_sdk" ]
-  if (dart_platform_sdk) {
-    public_deps += [ ":_create_platform_sdk" ]
-  } else {
-    public_deps += [ ":create_full_sdk" ]
-  }
-}
-
-# Same as create_sdk, but with abi version files.
-group("create_sdk_with_abi_versions") {
-  public_deps = [
-    ":copy_abi_dill_files",
-    ":create_sdk",
-  ]
-}
diff --git a/sdk_nnbd/api_readme.md b/sdk_nnbd/api_readme.md
deleted file mode 100644
index 60f763b..0000000
--- a/sdk_nnbd/api_readme.md
+++ /dev/null
@@ -1,31 +0,0 @@
-Welcome to the [Dart](https://dart.dev/) API reference documentation, covering
-the [Dart core libraries](https://dart.dev/guides/libraries). These include:
-   
-  * [dart:core](dart-core/dart-core-library.html): Core functionality such as
-    strings, numbers, collections, errors, dates, and URIs.
-  * [dart:html](dart-html/dart-html-library.html): DOM manipulation for web apps
-    (available only to web apps).
-  * [dart:io](dart-io/dart-io-library.html): I/O for non-web apps.
-  
-Except for `dart:core`, you must import a library before you can use it. Here's
-an example of importing `dart:async` and `dart:math`:
-
-```dart
-import 'dart:async';
-import 'dart:math';
-```
-
-You can find more libraries using the [pub.dev site](https://pub.dev).
-
-The main site for learning and using Dart is
-[dart.dev](https://dart.dev). Check out these pages:
-
-  * [Platforms](https://dart.dev/platforms)
-  * [Language tour](https://dart.dev/guides/language/language-tour)
-  * [Library tour](https://dart.dev/guides/libraries/library-tour)
-  * [Sample code](https://dart.dev/samples)
-
-This API reference is automatically generated from source code in the [Dart
-SDK project](https://github.com/dart-lang/sdk).
-If you'd like to give feedback or edit this documentation, see
-[Contributing](https://github.com/dart-lang/sdk/wiki/Contributing).
diff --git a/sdk_nnbd/bin/dart b/sdk_nnbd/bin/dart
deleted file mode 100755
index 34cb80b..0000000
--- a/sdk_nnbd/bin/dart
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2012, 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.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-if [[ `uname` == 'Darwin' ]];
-then
-  OUT_DIR="$CUR_DIR"/../../xcodebuild/
-else
-  OUT_DIR="$CUR_DIR"/../../out/
-fi
-
-if [ -z "$DART_CONFIGURATION" ];
-then
-  DIRS=$( ls "$OUT_DIR" )
-  # list of possible configurations in decreasing desirability
-  CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
-    "ReleaseARM" "ReleaseARM64" "DebugARM" "DebugARM64" )
-  DART_CONFIGURATION="None"
-  for CONFIG in ${CONFIGS[*]}
-  do
-    for DIR in $DIRS;
-    do
-      if [ "$CONFIG" = "$DIR" ];
-      then
-        # choose most desirable configuration that is available and break
-        DART_CONFIGURATION="$DIR"
-        break 2
-      fi
-    done
-  done
-  if [ "$DART_CONFIGURATION" = "None" ]
-  then
-    echo "No valid dart configuration found in $OUT_DIR"
-    exit 1
-  fi
-fi
-
-BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
-
-exec "$BIN_DIR"/dart "$@"
diff --git a/sdk_nnbd/bin/dart.bat b/sdk_nnbd/bin/dart.bat
deleted file mode 100644
index a6a24de..0000000
--- a/sdk_nnbd/bin/dart.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-set SCRIPTPATH=%~dp0
-
-REM Does the path have a trailing slash? If so, remove it.
-if %SCRIPTPATH:~-1%== set SCRIPTPATH=%SCRIPTPATH:~0,-1%
-
-REM DART_CONFIGURATION defaults to ReleaseX64
-if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
-
-set arguments=%*
-
-"%SCRIPTPATH%\..\..\out\%DART_CONFIGURATION%\dart.exe" %arguments%
diff --git a/sdk_nnbd/bin/dart2js b/sdk_nnbd/bin/dart2js
deleted file mode 100755
index 9c562ec..0000000
--- a/sdk_nnbd/bin/dart2js
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2012, 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.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-DART="$BIN_DIR/dart"
-
-unset EXTRA_OPTIONS
-declare -a EXTRA_OPTIONS
-
-if test -t 1; then
-  # Stdout is a terminal.
-  if test 8 -le `tput colors`; then
-    # Stdout has at least 8 colors, so enable colors.
-    EXTRA_OPTIONS+=('--enable-diagnostic-colors')
-  fi
-fi
-
-unset EXTRA_VM_OPTIONS
-declare -a EXTRA_VM_OPTIONS
-
-case $0 in
-  *_developer)
-    EXTRA_VM_OPTIONS+=('--enable-asserts')
-    ;;
-esac
-
-# We allow extra vm options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
-
-DART2JS="package:compiler/src/dart2js.dart"
-
-exec "$DART" "--packages=$DART_ROOT/.packages" --enable-experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
diff --git a/sdk_nnbd/bin/dart2js.bat b/sdk_nnbd/bin/dart2js.bat
deleted file mode 100644
index 9341ad8..0000000
--- a/sdk_nnbd/bin/dart2js.bat
+++ /dev/null
@@ -1,60 +0,0 @@
-@echo off
-REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set DART=%BIN_DIR%\dart
-
-set EXTRA_OPTIONS=
-set EXTRA_VM_OPTIONS=
-
-if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --enable-asserts
-)
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
-)
-
-rem Get absolute full name for DART_ROOT.
-for %%i in ("%SDK_DIR%\..\") do set DART_ROOT=%%~fi
-
-rem Remove trailing backslash if there is one
-if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
-
-set DART2JS=%DART_ROOT%\pkg\compiler\lib\src\dart2js.dart
-
-"%DART%" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
-
-endlocal
-
-exit /b %errorlevel%
-
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dart2js_developer b/sdk_nnbd/bin/dart2js_developer
deleted file mode 100755
index 226d1a9..0000000
--- a/sdk_nnbd/bin/dart2js_developer
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2012, 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.
-
-. ${BASH_SOURCE%_developer}
diff --git a/sdk_nnbd/bin/dart2js_developer.bat b/sdk_nnbd/bin/dart2js_developer.bat
deleted file mode 100644
index c4a2959..0000000
--- a/sdk_nnbd/bin/dart2js_developer.bat
+++ /dev/null
@@ -1,10 +0,0 @@
-@echo off
-REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-set DART2JS_DEVELOPER_MODE=1
-call "%~dp0dart2js.bat" %*
-endlocal
-exit /b %errorlevel%
diff --git a/sdk_nnbd/bin/dart2js_sdk b/sdk_nnbd/bin/dart2js_sdk
deleted file mode 100755
index 03999f9..0000000
--- a/sdk_nnbd/bin/dart2js_sdk
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2012, 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.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-DART="$BIN_DIR/dart"
-
-SNAPSHOT_DIR="$BIN_DIR/snapshots"
-SNAPSHOT="$SNAPSHOT_DIR/dart2js.dart.snapshot"
-
-unset EXTRA_OPTIONS
-declare -a EXTRA_OPTIONS
-
-if test -t 1; then
-  # Stdout is a terminal.
-  if test 8 -le `tput colors`; then
-    # Stdout has at least 8 colors, so enable colors.
-    EXTRA_OPTIONS+=('--enable-diagnostic-colors')
-  fi
-fi
-
-unset EXTRA_VM_OPTIONS
-declare -a EXTRA_VM_OPTIONS
-
-if test -f "$SNAPSHOT"; then
-  EXTRA_OPTIONS+=("--libraries-spec=$SDK_DIR/lib/libraries.json")
-fi
-
-case $0 in
-  *_developer)
-    EXTRA_VM_OPTIONS+=('--enable-asserts')
-    ;;
-esac
-
-# We allow extra vm options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-exec "$DART" --enable-experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@"
diff --git a/sdk_nnbd/bin/dart2js_sdk.bat b/sdk_nnbd/bin/dart2js_sdk.bat
deleted file mode 100755
index 8485cdc..0000000
--- a/sdk_nnbd/bin/dart2js_sdk.bat
+++ /dev/null
@@ -1,57 +0,0 @@
-@echo off
-REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dart2js.dart.snapshot
-
-set EXTRA_OPTIONS=
-set EXTRA_VM_OPTIONS=
-
-if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --enable-asserts
-)
-
-if exist "%SNAPSHOT%" (
-  set EXTRA_OPTIONS=%EXTRA_OPTIONS% "--libraries-spec=%SDK_DIR%\lib\libraries.json"
-)
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
-)
-
-"%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" %EXTRA_OPTIONS% %*
-
-endlocal
-
-exit /b %errorlevel%
-
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dart2native b/sdk_nnbd/bin/dart2native
deleted file mode 100755
index 29f29d7..0000000
--- a/sdk_nnbd/bin/dart2native
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-# Run dart2native.dart.snapshot on the Dart VM
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SNAPSHOTS_DIR="${BIN_DIR}/snapshots"
-DART="$BIN_DIR/dart"
-
-exec "$DART" "${SNAPSHOTS_DIR}/dart2native.dart.snapshot" $*
diff --git a/sdk_nnbd/bin/dart2native.bat b/sdk_nnbd/bin/dart2native.bat
deleted file mode 100644
index 631dce8..0000000
--- a/sdk_nnbd/bin/dart2native.bat
+++ /dev/null
@@ -1,43 +0,0 @@
-@echo off
-REM Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-
-"%DART%" "%BIN_DIR%\snapshots\dart2native.dart.snapshot" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartanalyzer b/sdk_nnbd/bin/dartanalyzer
deleted file mode 100755
index 0574603..0000000
--- a/sdk_nnbd/bin/dartanalyzer
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2013, 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.
-
-# Run dartanalyzer.dart on the Dart VM. This script assumes the Dart repo's
-# directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-SDK_ARG="--dart-sdk=$SDK_DIR"
-
-DART="$BIN_DIR/dart"
-
-unset EXTRA_VM_OPTIONS
-declare -a EXTRA_VM_OPTIONS
-EXTRA_VM_OPTIONS+=("--enable_experiment=non-nullable")
-
-case $0 in
-  *_developer)
-    EXTRA_VM_OPTIONS+=('--enable-asserts')
-    ;;
-esac
-
-# We allow extra vm options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
-
-ANALYZER="$DART_ROOT/pkg/analyzer_cli/bin/analyzer.dart"
-
-DEV_OPTIONS="--use-analysis-driver-memory-byte-store"
-
-exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$ANALYZER" "$DEV_OPTIONS" "$SDK_ARG" "$@"
diff --git a/sdk_nnbd/bin/dartanalyzer.bat b/sdk_nnbd/bin/dartanalyzer.bat
deleted file mode 100644
index efa3a6a..0000000
--- a/sdk_nnbd/bin/dartanalyzer.bat
+++ /dev/null
@@ -1,70 +0,0 @@
-@echo off
-REM Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set SDK_ARG=--dart-sdk=%SDK_DIR%
-
-set EXTRA_VM_OPTIONS=
-
-if _%DARTANALYZER_DEVELOPER_MODE%_ == _1_ (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --enable_asserts
-)
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
-)
-
-rem Get absolute full name for DART_ROOT.
-for %%i in ("%SDK_DIR%\..\") do set DART_ROOT=%%~fi
-
-rem Remove trailing backslash if there is one
-if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
-
-set ANALYZER=%DART_ROOT%\pkg\analyzer_cli\bin\analyzer.dart
-
-"%DART%" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "%ANALYZER%" "%SDK_ARG%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartanalyzer_developer b/sdk_nnbd/bin/dartanalyzer_developer
deleted file mode 100755
index 373dc67..0000000
--- a/sdk_nnbd/bin/dartanalyzer_developer
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2014, 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.
-
-. ${BASH_SOURCE%_developer}
diff --git a/sdk_nnbd/bin/dartanalyzer_developer.bat b/sdk_nnbd/bin/dartanalyzer_developer.bat
deleted file mode 100644
index b560fe8..0000000
--- a/sdk_nnbd/bin/dartanalyzer_developer.bat
+++ /dev/null
@@ -1,10 +0,0 @@
-@echo off
-REM Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-set DARTANALYZER_DEVELOPER_MODE=1
-call "%~dp0dartanalyzer.bat" %*
-endlocal
-exit /b %errorlevel%
diff --git a/sdk_nnbd/bin/dartanalyzer_sdk b/sdk_nnbd/bin/dartanalyzer_sdk
deleted file mode 100755
index 88f4deb..0000000
--- a/sdk_nnbd/bin/dartanalyzer_sdk
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2013, 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.
-
-# Run dartanalyzer.dart on the Dart VM. This script assumes the Dart SDK's
-# directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-SDK_ARG="--dart-sdk=$SDK_DIR"
-
-SNAPSHOT="$BIN_DIR/snapshots/dartanalyzer.dart.snapshot"
-
-# We are running the snapshot in the built SDK.
-DART="$BIN_DIR/dart"
-exec "$DART" --enable_experiment=non-nullable "$SNAPSHOT" "$SDK_ARG" "$@"
diff --git a/sdk_nnbd/bin/dartanalyzer_sdk.bat b/sdk_nnbd/bin/dartanalyzer_sdk.bat
deleted file mode 100644
index ab66885..0000000
--- a/sdk_nnbd/bin/dartanalyzer_sdk.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-@echo off
-REM Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dartanalyzer.dart.snapshot
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set SDK_ARG=--dart-sdk=%SDK_DIR%
-
-"%DART%" "%SNAPSHOT%" "%SDK_ARG%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartdevc b/sdk_nnbd/bin/dartdevc
deleted file mode 100755
index c2c25d9..0000000
--- a/sdk_nnbd/bin/dartdevc
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2013, 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.
-
-# Run dev compiler on the Dart VM. This script assumes the Dart repo's
-# directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-SDK_ARG="--dart-sdk=$SDK_DIR"
-
-DART="$BIN_DIR/dart"
-
-unset EXTRA_VM_OPTIONS
-declare -a EXTRA_VM_OPTIONS
-
-case $0 in
-  *_developer)
-    EXTRA_VM_OPTIONS+=('--checked')
-    ;;
-esac
-
-# We allow extra vm options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
-
-DEV_COMPILER="$DART_ROOT/pkg/dev_compiler/bin/dartdevc.dart"
-
-exec "$DART" "--packages=$DART_ROOT/.packages" --enable_experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$SDK_ARG" "$@"
diff --git a/sdk_nnbd/bin/dartdevc.bat b/sdk_nnbd/bin/dartdevc.bat
deleted file mode 100644
index fec39e4..0000000
--- a/sdk_nnbd/bin/dartdevc.bat
+++ /dev/null
@@ -1,66 +0,0 @@
-@echo off
-REM Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set SDK_ARG=--dart-sdk=%SDK_DIR%
-
-set EXTRA_VM_OPTIONS=
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
-)
-
-rem Get absolute full name for DART_ROOT.
-for %%i in ("%SDK_DIR%\..\") do set DART_ROOT=%%~fi
-
-rem Remove trailing backslash if there is one
-if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
-
-set DEV_COMPILER=%DART_ROOT%\third_party\pkg\dev_compiler\bin\dartdevc.dart
-
-"%DART%" "--packages=%DART_ROOT%\.packages" %EXTRA_VM_OPTIONS% "DEV_COMPILER%" "%SDK_ARG%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartdevc_sdk b/sdk_nnbd/bin/dartdevc_sdk
deleted file mode 100755
index c687bdd..0000000
--- a/sdk_nnbd/bin/dartdevc_sdk
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2013, 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.
-
-# Run dev compiler on the Dart VM. This script assumes the Dart SDK's
-# directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SNAPSHOT="$BIN_DIR/snapshots/dartdevc.dart.snapshot"
-
-# We are running the snapshot in the built SDK.
-DART="$BIN_DIR/dart"
-
-unset EXTRA_VM_OPTIONS
-declare -a EXTRA_VM_OPTIONS
-
-# We allow extra vm options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-exec "$DART" --enable_experiment=non-nullable "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
diff --git a/sdk_nnbd/bin/dartdevc_sdk.bat b/sdk_nnbd/bin/dartdevc_sdk.bat
deleted file mode 100644
index ce027a9..0000000
--- a/sdk_nnbd/bin/dartdevc_sdk.bat
+++ /dev/null
@@ -1,59 +0,0 @@
-@echo off
-REM Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dartdevc.dart.snapshot
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set SDK_ARG=--dart-sdk=%SDK_DIR%
-
-set EXTRA_VM_OPTIONS=
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
-)
-
-"%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" "%SDK_ARG%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 ["`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartdoc b/sdk_nnbd/bin/dartdoc
deleted file mode 100755
index e9584c1..0000000
--- a/sdk_nnbd/bin/dartdoc
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2015, 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.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-SNAPSHOT="$BIN_DIR/snapshots/dartdoc.dart.snapshot"
-
-# We are running the snapshot in the built SDK.
-DART="$BIN_DIR/dart"
-exec "$DART" "--packages=$BIN_DIR/resources/dartdoc/.packages" "$SNAPSHOT" "$@"
diff --git a/sdk_nnbd/bin/dartdoc.bat b/sdk_nnbd/bin/dartdoc.bat
deleted file mode 100644
index 876eb0e..0000000
--- a/sdk_nnbd/bin/dartdoc.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-@echo off
-REM Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dartdoc.dart.snapshot
-
-"%DART%" "--packages=%BIN_DIR%/resources/dartdoc/.packages" "%SNAPSHOT%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartfix b/sdk_nnbd/bin/dartfix
deleted file mode 100755
index bbeb80d..0000000
--- a/sdk_nnbd/bin/dartfix
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2013, 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.
-
-# Run dartfix.dart on the Dart VM. This script assumes the Dart SDK's
-# directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SNAPSHOT="$BIN_DIR/snapshots/dartfix.dart.snapshot"
-
-# We are running the snapshot in the built SDK.
-DART="$BIN_DIR/dart"
-exec "$DART" "$SNAPSHOT" "$@"
diff --git a/sdk_nnbd/bin/dartfix.bat b/sdk_nnbd/bin/dartfix.bat
deleted file mode 100644
index 4241694..0000000
--- a/sdk_nnbd/bin/dartfix.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-@echo off
-REM Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dartfix.dart.snapshot
-
-"%DART%" "%SNAPSHOT%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartfmt b/sdk_nnbd/bin/dartfmt
deleted file mode 100755
index ad54140..0000000
--- a/sdk_nnbd/bin/dartfmt
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2013, 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.
-
-# Run dart_style/bin/format.dart on the Dart VM. This script assumes the Dart
-# repo's directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-DART="$BIN_DIR/dart"
-
-DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
-
-DARTFMT="$DART_ROOT/third_party/pkg_tested/dart_style/bin/format.dart"
-
-exec "$DART" "--packages=$DART_ROOT/.packages" "$DARTFMT" "$@"
diff --git a/sdk_nnbd/bin/dartfmt.bat b/sdk_nnbd/bin/dartfmt.bat
deleted file mode 100644
index 7a7412b..0000000
--- a/sdk_nnbd/bin/dartfmt.bat
+++ /dev/null
@@ -1,57 +0,0 @@
-@echo off
-REM Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-if %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-rem Get absolute full name for DART_ROOT.
-for %%i in ("%SDK_DIR%\..\") do set DART_ROOT=%%~fi
-
-rem Remove trailing backslash if there is one
-if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
-
-set DARTFMT=%DART_ROOT%\third_party\pkg_tested\dart_style\bin\format.dart
-
-"%DART%" "--packages=%DART_ROOT%\.packages" "%DARTFMT%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/dartfmt_sdk b/sdk_nnbd/bin/dartfmt_sdk
deleted file mode 100755
index 273733c..0000000
--- a/sdk_nnbd/bin/dartfmt_sdk
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2015, 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.
-
-# Run dart_style/bin/format.dart on the Dart VM. This script assumes the Dart
-# SDK's directory structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-SNAPSHOT="$BIN_DIR/snapshots/dartfmt.dart.snapshot"
-
-# We are running the snapshot in the built SDK.
-DART="$BIN_DIR/dart"
-exec "$DART" "$SNAPSHOT" "$@"
diff --git a/sdk_nnbd/bin/dartfmt_sdk.bat b/sdk_nnbd/bin/dartfmt_sdk.bat
deleted file mode 100644
index 295b977..0000000
--- a/sdk_nnbd/bin/dartfmt_sdk.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-@echo off
-REM Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\dartfmt.dart.snapshot
-
-"%DART%" "%SNAPSHOT%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-rem Follow the symbolic links (junctions points) using `dir to determine the
-rem canonical path. Output with a link looks something like this
-rem
-rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
-rem [c:\dart_bleeding\dart-repo.9\dart\out\ReleaseIA32\dart-sdk]
-rem
-rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
-rem surrounded by right angle bracket and left square bracket. Once we get
-rem the filename, which is name of the link, we recursively follow that.
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 ["`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/pub b/sdk_nnbd/bin/pub
deleted file mode 100755
index 85ad5d6..0000000
--- a/sdk_nnbd/bin/pub
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2012, 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.
-
-# Run pub.dart on the Dart VM. This script is only used when running pub from
-# within the Dart source repo. The shipped SDK instead uses "pub_sdk", which is
-# renamed to "pub" when the SDK is built.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-SNAPSHOT="$BIN_DIR/snapshots/pub.dart.snapshot"
-
-unset VM_OPTIONS
-declare -a VM_OPTIONS
-
-if [[ `uname` == 'Darwin' ]];
-then
-  OUT_DIR="$BIN_DIR"/../../xcodebuild/
-else
-  OUT_DIR="$BIN_DIR"/../../out/
-fi
-
-# Allow extra VM options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-if [ -z "$DART_CONFIGURATION" ];
-then
-  DIRS=$( ls "$OUT_DIR" )
-  # list of possible configurations in decreasing desirability
-  CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
-    "ReleaseARM" "ReleaseARM64" "DebugARM" "DebugARM64" )
-  DART_CONFIGURATION="None"
-  for CONFIG in ${CONFIGS[*]}
-  do
-    for DIR in $DIRS;
-    do
-      if [ "$CONFIG" = "$DIR" ];
-      then
-        # choose most desirable configuration that is available and break
-        DART_CONFIGURATION="$DIR"
-        break 2
-      fi
-    done
-  done
-  if [ "$DART_CONFIGURATION" = "None" ]
-  then
-    echo "No valid dart configuration found in $OUT_DIR"
-    exit 1
-  fi
-fi
-
-if [[ `uname` == 'Darwin' ]];
-then
-  BUILD_DIR="$SDK_DIR/../xcodebuild/$DART_CONFIGURATION"
-else
-  BUILD_DIR="$SDK_DIR/../out/$DART_CONFIGURATION"
-fi
-
-# Use the Dart binary in the built SDK so pub can find the version file next
-# to it.
-DART="$BUILD_DIR/dart-sdk/bin/dart"
-
-# Run pub.
-PUB="$SDK_DIR/../third_party/pkg/pub/bin/pub.dart"
-exec "$DART" "--packages=$SDK_DIR/../.packages" "${VM_OPTIONS[@]}" "$PUB" "$@"
diff --git a/sdk_nnbd/bin/pub.bat b/sdk_nnbd/bin/pub.bat
deleted file mode 100644
index 7eb8b0d..0000000
--- a/sdk_nnbd/bin/pub.bat
+++ /dev/null
@@ -1,56 +0,0 @@
-@echo off
-REM Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-rem Run pub.dart on the Dart VM. This script is only used when running pub from
-rem within the Dart source repo. The shipped SDK instead uses "pub_sdk.bat",
-rem which is renamed to "pub.bat" when the SDK is built.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set VM_OPTIONS=
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set VM_OPTIONS=%VM_OPTIONS% %DART_VM_OPTIONS%
-)
-
-rem Use the Dart binary in the built SDK so pub can find the version file next
-rem to it.
-set BUILD_DIR=%SDK_DIR%\..\out\ReleaseX64
-set DART=%BUILD_DIR%\dart-sdk\bin\dart
-
-rem Run pub.
-set PUB="%SDK_DIR%\..\third_party\pkg\pub\bin\pub.dart"
-"%DART%" "--packages=%SDK_DIR%\..\.packages" %VM_OPTIONS% "%PUB%" %*
-
-endlocal
-
-exit /b %errorlevel%
-
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| %SystemRoot%\System32\find.exe ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/bin/pub_sdk b/sdk_nnbd/bin/pub_sdk
deleted file mode 100755
index 4d29878..0000000
--- a/sdk_nnbd/bin/pub_sdk
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (c) 2014, 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.
-
-# Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
-# structure.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-function array_contains() {
-  local needle="$1"
-  local element
-  shift
-  for element; do [ "$element" = "$needle" ] && return 0; done
-  return 1
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-
-unset VM_OPTIONS
-declare -a VM_OPTIONS
-
-# Allow extra VM options to be passed in through an environment variable.
-if [[ $DART_VM_OPTIONS ]]; then
-  read -a OPTIONS <<< "$DART_VM_OPTIONS"
-  VM_OPTIONS+=("${OPTIONS[@]}")
-fi
-
-# Run the pub snapshot.
-DART="$BIN_DIR/dart"
-if array_contains "--no-preview-dart-2" "${VM_OPTIONS[@]}"; then
-  echo "Pub no longer supports Dart 1"
-  exit -1
-else
-  SNAPSHOT="$BIN_DIR/snapshots/pub.dart.snapshot"
-  exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
-fi
diff --git a/sdk_nnbd/bin/pub_sdk.bat b/sdk_nnbd/bin/pub_sdk.bat
deleted file mode 100644
index bde0e4a..0000000
--- a/sdk_nnbd/bin/pub_sdk.bat
+++ /dev/null
@@ -1,53 +0,0 @@
-@echo off
-REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set VM_OPTIONS=
-set USING_DART_1=
-
-rem We allow extra vm options to be passed in through an environment variable.
-if not "_%DART_VM_OPTIONS%_" == "__" (
-  set VM_OPTIONS=%VM_OPTIONS% %DART_VM_OPTIONS%
-  for %%o in (%DART_VM_OPTIONS%) do (
-    if "%%o" equ "--no-preview-dart-2" set USING_DART_1=y
-  )
-)
-
-if defined USING_DART_1 (
-  echo "Pub no longer supports Dart 1"
-) else (
-  "%BIN_DIR%\dart" %VM_OPTIONS% "%BIN_DIR%\snapshots\pub.dart.snapshot" %*
-)
-
-endlocal
-
-exit /b %errorlevel%
-
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
-                                             ^| find ">     %~n1 [" 2^>nul`) do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk_nnbd/lib/_http/crypto.dart b/sdk_nnbd/lib/_http/crypto.dart
deleted file mode 100644
index f29a15b..0000000
--- a/sdk_nnbd/lib/_http/crypto.dart
+++ /dev/null
@@ -1,455 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._http;
-
-class _CryptoUtils {
-  static const int PAD = 61; // '='
-  static const int CR = 13; // '\r'
-  static const int LF = 10; // '\n'
-  static const int LINE_LENGTH = 76;
-
-  static const String _encodeTable =
-      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-  static const String _encodeTableUrlSafe =
-      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
-
-  // Lookup table used for finding Base 64 alphabet index of a given byte.
-  // -2 : Outside Base 64 alphabet.
-  // -1 : '\r' or '\n'
-  //  0 : = (Padding character).
-  // >0 : Base 64 alphabet index of given byte.
-  static const List<int> _decodeTable = const [
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -1, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, 62, -2, 63, //
-    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, 00, -2, -2, //
-    -2, 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, //
-    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, 63, //
-    -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, //
-    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, //
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2
-  ];
-
-  static Random _rng = new Random.secure();
-
-  static Uint8List getRandomBytes(int count) {
-    final Uint8List result = new Uint8List(count);
-    for (int i = 0; i < count; i++) {
-      result[i] = _rng.nextInt(0xff);
-    }
-    return result;
-  }
-
-  static String bytesToHex(List<int> bytes) {
-    var result = new StringBuffer();
-    for (var part in bytes) {
-      result.write('${part < 16 ? '0' : ''}${part.toRadixString(16)}');
-    }
-    return result.toString();
-  }
-
-  static String bytesToBase64(List<int> bytes,
-      [bool urlSafe = false, bool addLineSeparator = false]) {
-    int len = bytes.length;
-    if (len == 0) {
-      return "";
-    }
-    final String lookup = urlSafe ? _encodeTableUrlSafe : _encodeTable;
-    // Size of 24 bit chunks.
-    final int remainderLength = len.remainder(3) as int;
-    final int chunkLength = len - remainderLength;
-    // Size of base output.
-    int outputLen = ((len ~/ 3) * 4) + ((remainderLength > 0) ? 4 : 0);
-    // Add extra for line separators.
-    if (addLineSeparator) {
-      outputLen += ((outputLen - 1) ~/ LINE_LENGTH) << 1;
-    }
-    List<int> out = new List<int>.filled(outputLen, 0);
-
-    // Encode 24 bit chunks.
-    int j = 0, i = 0, c = 0;
-    while (i < chunkLength) {
-      int x = ((bytes[i++] << 16) & 0xFFFFFF) |
-          ((bytes[i++] << 8) & 0xFFFFFF) |
-          bytes[i++];
-      out[j++] = lookup.codeUnitAt(x >> 18);
-      out[j++] = lookup.codeUnitAt((x >> 12) & 0x3F);
-      out[j++] = lookup.codeUnitAt((x >> 6) & 0x3F);
-      out[j++] = lookup.codeUnitAt(x & 0x3f);
-      // Add optional line separator for each 76 char output.
-      if (addLineSeparator && ++c == 19 && j < outputLen - 2) {
-        out[j++] = CR;
-        out[j++] = LF;
-        c = 0;
-      }
-    }
-
-    // If input length if not a multiple of 3, encode remaining bytes and
-    // add padding.
-    if (remainderLength == 1) {
-      int x = bytes[i];
-      out[j++] = lookup.codeUnitAt(x >> 2);
-      out[j++] = lookup.codeUnitAt((x << 4) & 0x3F);
-      out[j++] = PAD;
-      out[j++] = PAD;
-    } else if (remainderLength == 2) {
-      int x = bytes[i];
-      int y = bytes[i + 1];
-      out[j++] = lookup.codeUnitAt(x >> 2);
-      out[j++] = lookup.codeUnitAt(((x << 4) | (y >> 4)) & 0x3F);
-      out[j++] = lookup.codeUnitAt((y << 2) & 0x3F);
-      out[j++] = PAD;
-    }
-
-    return new String.fromCharCodes(out);
-  }
-
-  static List<int> base64StringToBytes(String input,
-      [bool ignoreInvalidCharacters = true]) {
-    int len = input.length;
-    if (len == 0) {
-      return new List<int>.empty();
-    }
-
-    // Count '\r', '\n' and illegal characters, For illegal characters,
-    // if [ignoreInvalidCharacters] is false, throw an exception.
-    int extrasLen = 0;
-    for (int i = 0; i < len; i++) {
-      int c = _decodeTable[input.codeUnitAt(i)];
-      if (c < 0) {
-        extrasLen++;
-        if (c == -2 && !ignoreInvalidCharacters) {
-          throw new FormatException('Invalid character: ${input[i]}');
-        }
-      }
-    }
-
-    if ((len - extrasLen) % 4 != 0) {
-      throw new FormatException('''Size of Base 64 characters in Input
-          must be a multiple of 4. Input: $input''');
-    }
-
-    // Count pad characters, ignore illegal characters at the end.
-    int padLength = 0;
-    for (int i = len - 1; i >= 0; i--) {
-      int currentCodeUnit = input.codeUnitAt(i);
-      if (_decodeTable[currentCodeUnit] > 0) break;
-      if (currentCodeUnit == PAD) padLength++;
-    }
-    int outputLen = (((len - extrasLen) * 6) >> 3) - padLength;
-    List<int> out = new List<int>.filled(outputLen, 0);
-
-    for (int i = 0, o = 0; o < outputLen;) {
-      // Accumulate 4 valid 6 bit Base 64 characters into an int.
-      int x = 0;
-      for (int j = 4; j > 0;) {
-        int c = _decodeTable[input.codeUnitAt(i++)];
-        if (c >= 0) {
-          x = ((x << 6) & 0xFFFFFF) | c;
-          j--;
-        }
-      }
-      out[o++] = x >> 16;
-      if (o < outputLen) {
-        out[o++] = (x >> 8) & 0xFF;
-        if (o < outputLen) out[o++] = x & 0xFF;
-      }
-    }
-    return out;
-  }
-}
-
-// Constants.
-const _MASK_8 = 0xff;
-const _MASK_32 = 0xffffffff;
-const _BITS_PER_BYTE = 8;
-const _BYTES_PER_WORD = 4;
-
-// Base class encapsulating common behavior for cryptographic hash
-// functions.
-abstract class _HashBase {
-  // Hasher state.
-  final int _chunkSizeInWords;
-  final bool _bigEndianWords;
-  int _lengthInBytes = 0;
-  List<int> _pendingData;
-  List<int> _currentChunk;
-  List<int> _h;
-  bool _digestCalled = false;
-
-  _HashBase(this._chunkSizeInWords, int digestSizeInWords, this._bigEndianWords)
-      : _pendingData = [],
-        _currentChunk = new List.filled(_chunkSizeInWords, 0),
-        _h = new List.filled(digestSizeInWords, 0);
-
-  // Update the hasher with more data.
-  add(List<int> data) {
-    if (_digestCalled) {
-      throw new StateError(
-          'Hash update method called after digest was retrieved');
-    }
-    _lengthInBytes += data.length;
-    _pendingData.addAll(data);
-    _iterate();
-  }
-
-  // Finish the hash computation and return the digest string.
-  List<int> close() {
-    if (_digestCalled) {
-      return _resultAsBytes();
-    }
-    _digestCalled = true;
-    _finalizeData();
-    _iterate();
-    assert(_pendingData.length == 0);
-    return _resultAsBytes();
-  }
-
-  // Returns the block size of the hash in bytes.
-  int get blockSize {
-    return _chunkSizeInWords * _BYTES_PER_WORD;
-  }
-
-  // Create a fresh instance of this Hash.
-  newInstance();
-
-  // One round of the hash computation.
-  _updateHash(List<int> m);
-
-  // Helper methods.
-  _add32(x, y) => (x + y) & _MASK_32;
-  _roundUp(val, n) => (val + n - 1) & -n;
-
-  // Rotate left limiting to unsigned 32-bit values.
-  int _rotl32(int val, int shift) {
-    var mod_shift = shift & 31;
-    return ((val << mod_shift) & _MASK_32) |
-        ((val & _MASK_32) >> (32 - mod_shift));
-  }
-
-  // Compute the final result as a list of bytes from the hash words.
-  List<int> _resultAsBytes() {
-    var result = <int>[];
-    for (var i = 0; i < _h.length; i++) {
-      result.addAll(_wordToBytes(_h[i]));
-    }
-    return result;
-  }
-
-  // Converts a list of bytes to a chunk of 32-bit words.
-  _bytesToChunk(List<int> data, int dataIndex) {
-    assert((data.length - dataIndex) >= (_chunkSizeInWords * _BYTES_PER_WORD));
-
-    for (var wordIndex = 0; wordIndex < _chunkSizeInWords; wordIndex++) {
-      var w3 = _bigEndianWords ? data[dataIndex] : data[dataIndex + 3];
-      var w2 = _bigEndianWords ? data[dataIndex + 1] : data[dataIndex + 2];
-      var w1 = _bigEndianWords ? data[dataIndex + 2] : data[dataIndex + 1];
-      var w0 = _bigEndianWords ? data[dataIndex + 3] : data[dataIndex];
-      dataIndex += 4;
-      var word = (w3 & 0xff) << 24;
-      word |= (w2 & _MASK_8) << 16;
-      word |= (w1 & _MASK_8) << 8;
-      word |= (w0 & _MASK_8);
-      _currentChunk[wordIndex] = word;
-    }
-  }
-
-  // Convert a 32-bit word to four bytes.
-  List<int> _wordToBytes(int word) {
-    List<int> bytes = new List.filled(_BYTES_PER_WORD, 0);
-    bytes[0] = (word >> (_bigEndianWords ? 24 : 0)) & _MASK_8;
-    bytes[1] = (word >> (_bigEndianWords ? 16 : 8)) & _MASK_8;
-    bytes[2] = (word >> (_bigEndianWords ? 8 : 16)) & _MASK_8;
-    bytes[3] = (word >> (_bigEndianWords ? 0 : 24)) & _MASK_8;
-    return bytes;
-  }
-
-  // Iterate through data updating the hash computation for each
-  // chunk.
-  _iterate() {
-    var len = _pendingData.length;
-    var chunkSizeInBytes = _chunkSizeInWords * _BYTES_PER_WORD;
-    if (len >= chunkSizeInBytes) {
-      var index = 0;
-      for (; (len - index) >= chunkSizeInBytes; index += chunkSizeInBytes) {
-        _bytesToChunk(_pendingData, index);
-        _updateHash(_currentChunk);
-      }
-      _pendingData = _pendingData.sublist(index, len);
-    }
-  }
-
-  // Finalize the data. Add a 1 bit to the end of the message. Expand with
-  // 0 bits and add the length of the message.
-  _finalizeData() {
-    _pendingData.add(0x80);
-    var contentsLength = _lengthInBytes + 9;
-    var chunkSizeInBytes = _chunkSizeInWords * _BYTES_PER_WORD;
-    var finalizedLength = _roundUp(contentsLength, chunkSizeInBytes);
-    var zeroPadding = finalizedLength - contentsLength;
-    for (var i = 0; i < zeroPadding; i++) {
-      _pendingData.add(0);
-    }
-    var lengthInBits = _lengthInBytes * _BITS_PER_BYTE;
-    assert(lengthInBits < pow(2, 32));
-    if (_bigEndianWords) {
-      _pendingData.addAll(_wordToBytes(0));
-      _pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32));
-    } else {
-      _pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32));
-      _pendingData.addAll(_wordToBytes(0));
-    }
-  }
-}
-
-// The MD5 hasher is used to compute an MD5 message digest.
-class _MD5 extends _HashBase {
-  _MD5() : super(16, 4, false) {
-    _h[0] = 0x67452301;
-    _h[1] = 0xefcdab89;
-    _h[2] = 0x98badcfe;
-    _h[3] = 0x10325476;
-  }
-
-  // Returns a new instance of this Hash.
-  _MD5 newInstance() {
-    return new _MD5();
-  }
-
-  static const _k = const [
-    0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, //
-    0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, //
-    0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, //
-    0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, //
-    0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, //
-    0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, //
-    0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, //
-    0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, //
-    0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, //
-    0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, //
-    0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391
-  ];
-
-  static const _r = const [
-    7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, //
-    20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, //
-    16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, //
-    10, 15, 21, 6, 10, 15, 21
-  ];
-
-  // Compute one iteration of the MD5 algorithm with a chunk of
-  // 16 32-bit pieces.
-  void _updateHash(List<int> m) {
-    assert(m.length == 16);
-
-    var a = _h[0];
-    var b = _h[1];
-    var c = _h[2];
-    var d = _h[3];
-
-    var t0;
-    var t1;
-
-    for (var i = 0; i < 64; i++) {
-      if (i < 16) {
-        t0 = (b & c) | ((~b & _MASK_32) & d);
-        t1 = i;
-      } else if (i < 32) {
-        t0 = (d & b) | ((~d & _MASK_32) & c);
-        t1 = ((5 * i) + 1) % 16;
-      } else if (i < 48) {
-        t0 = b ^ c ^ d;
-        t1 = ((3 * i) + 5) % 16;
-      } else {
-        t0 = c ^ (b | (~d & _MASK_32));
-        t1 = (7 * i) % 16;
-      }
-
-      var temp = d;
-      d = c;
-      c = b;
-      b = _add32(
-          b, _rotl32(_add32(_add32(a, t0), _add32(_k[i], m[t1])), _r[i]));
-      a = temp;
-    }
-
-    _h[0] = _add32(a, _h[0]);
-    _h[1] = _add32(b, _h[1]);
-    _h[2] = _add32(c, _h[2]);
-    _h[3] = _add32(d, _h[3]);
-  }
-}
-
-// The SHA1 hasher is used to compute an SHA1 message digest.
-class _SHA1 extends _HashBase {
-  List<int> _w;
-
-  // Construct a SHA1 hasher object.
-  _SHA1()
-      : _w = List<int>.filled(80, 0),
-        super(16, 5, true) {
-    _h[0] = 0x67452301;
-    _h[1] = 0xEFCDAB89;
-    _h[2] = 0x98BADCFE;
-    _h[3] = 0x10325476;
-    _h[4] = 0xC3D2E1F0;
-  }
-
-  // Returns a new instance of this Hash.
-  _SHA1 newInstance() {
-    return new _SHA1();
-  }
-
-  // Compute one iteration of the SHA1 algorithm with a chunk of
-  // 16 32-bit pieces.
-  void _updateHash(List<int> m) {
-    assert(m.length == 16);
-
-    var a = _h[0];
-    var b = _h[1];
-    var c = _h[2];
-    var d = _h[3];
-    var e = _h[4];
-
-    for (var i = 0; i < 80; i++) {
-      if (i < 16) {
-        _w[i] = m[i];
-      } else {
-        var n = _w[i - 3] ^ _w[i - 8] ^ _w[i - 14] ^ _w[i - 16];
-        _w[i] = _rotl32(n, 1);
-      }
-      var t = _add32(_add32(_rotl32(a, 5), e), _w[i]);
-      if (i < 20) {
-        t = _add32(_add32(t, (b & c) | (~b & d)), 0x5A827999);
-      } else if (i < 40) {
-        t = _add32(_add32(t, (b ^ c ^ d)), 0x6ED9EBA1);
-      } else if (i < 60) {
-        t = _add32(_add32(t, (b & c) | (b & d) | (c & d)), 0x8F1BBCDC);
-      } else {
-        t = _add32(_add32(t, b ^ c ^ d), 0xCA62C1D6);
-      }
-
-      e = d;
-      d = c;
-      c = _rotl32(b, 30);
-      b = a;
-      a = t & _MASK_32;
-    }
-
-    _h[0] = _add32(a, _h[0]);
-    _h[1] = _add32(b, _h[1]);
-    _h[2] = _add32(c, _h[2]);
-    _h[3] = _add32(d, _h[3]);
-    _h[4] = _add32(e, _h[4]);
-  }
-}
diff --git a/sdk_nnbd/lib/_http/embedder_config.dart b/sdk_nnbd/lib/_http/embedder_config.dart
deleted file mode 100644
index 730bc2dd..0000000
--- a/sdk_nnbd/lib/_http/embedder_config.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart._http;
-
-/// Embedder-specific `dart:_http` configuration.
-
-/// [HttpClient] will disallow HTTP URLs if this value is set to `false`.
-@pragma("vm:entry-point")
-bool _embedderAllowsHttp = true;
diff --git a/sdk_nnbd/lib/_http/http.dart b/sdk_nnbd/lib/_http/http.dart
deleted file mode 100644
index 6db8524..0000000
--- a/sdk_nnbd/lib/_http/http.dart
+++ /dev/null
@@ -1,2282 +0,0 @@
-// Copyright (c) 2013, 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.
-
-library dart._http;
-
-import 'dart:async';
-import 'dart:collection'
-    show
-        HashMap,
-        HashSet,
-        Queue,
-        ListQueue,
-        LinkedList,
-        LinkedListEntry,
-        UnmodifiableMapView;
-import 'dart:convert';
-import 'dart:developer' hide log;
-import 'dart:_internal'
-    show Since, valueOfNonNullableParamWithDefault, HttpStatus;
-import 'dart:math';
-import 'dart:io';
-import 'dart:typed_data';
-
-part 'crypto.dart';
-part 'embedder_config.dart';
-part 'http_date.dart';
-part 'http_headers.dart';
-part 'http_impl.dart';
-part 'http_parser.dart';
-part 'http_session.dart';
-part 'overrides.dart';
-part 'websocket.dart';
-part 'websocket_impl.dart';
-
-/**
- * A server that delivers content, such as web pages, using the HTTP protocol.
- *
- * The HttpServer is a [Stream] that provides [HttpRequest] objects. Each
- * HttpRequest has an associated [HttpResponse] object.
- * The server responds to a request by writing to that HttpResponse object.
- * The following example shows how to bind an HttpServer to an IPv6
- * [InternetAddress] on port 80 (the standard port for HTTP servers)
- * and how to listen for requests.
- * Port 80 is the default HTTP port. However, on most systems accessing
- * this requires super-user privileges. For local testing consider
- * using a non-reserved port (1024 and above).
- *
- *     import 'dart:io';
- *
- *     main() {
- *       HttpServer
- *           .bind(InternetAddress.anyIPv6, 80)
- *           .then((server) {
- *             server.listen((HttpRequest request) {
- *               request.response.write('Hello, world!');
- *               request.response.close();
- *             });
- *           });
- *     }
- *
- * Incomplete requests, in which all or part of the header is missing, are
- * ignored, and no exceptions or HttpRequest objects are generated for them.
- * Likewise, when writing to an HttpResponse, any [Socket] exceptions are
- * ignored and any future writes are ignored.
- *
- * The HttpRequest exposes the request headers and provides the request body,
- * if it exists, as a Stream of data. If the body is unread, it is drained
- * when the server writes to the HttpResponse or closes it.
- *
- * ## Bind with a secure HTTPS connection
- *
- * Use [bindSecure] to create an HTTPS server.
- *
- * The server presents a certificate to the client. The certificate
- * chain and the private key are set in the [SecurityContext]
- * object that is passed to [bindSecure].
- *
- *     import 'dart:io';
- *     import "dart:isolate";
- *
- *     main() {
- *       SecurityContext context = new SecurityContext();
- *       var chain =
- *           Platform.script.resolve('certificates/server_chain.pem')
- *           .toFilePath();
- *       var key =
- *           Platform.script.resolve('certificates/server_key.pem')
- *           .toFilePath();
- *       context.useCertificateChain(chain);
- *       context.usePrivateKey(key, password: 'dartdart');
- *
- *       HttpServer
- *           .bindSecure(InternetAddress.anyIPv6,
- *                       443,
- *                       context)
- *           .then((server) {
- *             server.listen((HttpRequest request) {
- *               request.response.write('Hello, world!');
- *               request.response.close();
- *             });
- *           });
- *     }
- *
- *  The certificates and keys are PEM files, which can be created and
- *  managed with the tools in OpenSSL.
- *
- * ## Connect to a server socket
- *
- * You can use the [listenOn] constructor to attach an HTTP server to
- * a [ServerSocket].
- *
- *     import 'dart:io';
- *
- *     main() {
- *       ServerSocket.bind(InternetAddress.anyIPv6, 80)
- *         .then((serverSocket) {
- *           HttpServer httpserver = new HttpServer.listenOn(serverSocket);
- *           serverSocket.listen((Socket socket) {
- *             socket.write('Hello, client.');
- *           });
- *         });
- *     }
- *
- * ## Other resources
- *
- * * HttpServer is a Stream. Refer to the [Stream] class for information
- * about the streaming qualities of an HttpServer.
- * Pausing the subscription of the stream, pauses at the OS level.
- *
- * * The [shelf](https://pub.dev/packages/shelf)
- * package on pub.dev contains a set of high-level classes that,
- * together with this class, makes it easy to provide content through HTTP
- * servers.
- */
-abstract class HttpServer implements Stream<HttpRequest> {
-  /**
-   * Gets and sets the default value of the `Server` header for all responses
-   * generated by this [HttpServer].
-   *
-   * If [serverHeader] is `null`, no `Server` header will be added to each
-   * response.
-   *
-   * The default value is `null`.
-   */
-  String? serverHeader;
-
-  /**
-   * Default set of headers added to all response objects.
-   *
-   * By default the following headers are in this set:
-   *
-   *     Content-Type: text/plain; charset=utf-8
-   *     X-Frame-Options: SAMEORIGIN
-   *     X-Content-Type-Options: nosniff
-   *     X-XSS-Protection: 1; mode=block
-   *
-   * If the `Server` header is added here and the `serverHeader` is set as
-   * well then the value of `serverHeader` takes precedence.
-   */
-  HttpHeaders get defaultResponseHeaders;
-
-  /**
-   * Whether the [HttpServer] should compress the content, if possible.
-   *
-   * The content can only be compressed when the response is using
-   * chunked Transfer-Encoding and the incoming request has `gzip`
-   * as an accepted encoding in the Accept-Encoding header.
-   *
-   * The default value is `false` (compression disabled).
-   * To enable, set `autoCompress` to `true`.
-   */
-  bool autoCompress = false;
-
-  /**
-   * Gets or sets the timeout used for idle keep-alive connections. If no
-   * further request is seen within [idleTimeout] after the previous request was
-   * completed, the connection is dropped.
-   *
-   * Default is 120 seconds.
-   *
-   * Note that it may take up to `2 * idleTimeout` before a idle connection is
-   * aborted.
-   *
-   * To disable, set [idleTimeout] to `null`.
-   */
-  Duration? idleTimeout = const Duration(seconds: 120);
-
-  /**
-   * Starts listening for HTTP requests on the specified [address] and
-   * [port].
-   *
-   * The [address] can either be a [String] or an
-   * [InternetAddress]. If [address] is a [String], [bind] will
-   * perform a [InternetAddress.lookup] and use the first value in the
-   * list. To listen on the loopback adapter, which will allow only
-   * incoming connections from the local host, use the value
-   * [InternetAddress.loopbackIPv4] or
-   * [InternetAddress.loopbackIPv6]. To allow for incoming
-   * connection from the network use either one of the values
-   * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
-   * bind to all interfaces or the IP address of a specific interface.
-   *
-   * If an IP version 6 (IPv6) address is used, both IP version 6
-   * (IPv6) and version 4 (IPv4) connections will be accepted. To
-   * restrict this to version 6 (IPv6) only, use [v6Only] to set
-   * version 6 only. However, if the address is
-   * [InternetAddress.loopbackIPv6], only IP version 6 (IPv6) connections
-   * will be accepted.
-   *
-   * If [port] has the value 0 an ephemeral port will be chosen by
-   * the system. The actual port used can be retrieved using the
-   * [port] getter.
-   *
-   * The optional argument [backlog] can be used to specify the listen
-   * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of 0 (the default) a reasonable value will be chosen by
-   * the system.
-   *
-   * The optional argument [shared] specifies whether additional HttpServer
-   * objects can bind to the same combination of `address`, `port` and `v6Only`.
-   * If `shared` is `true` and more `HttpServer`s from this isolate or other
-   * isolates are bound to the port, then the incoming connections will be
-   * distributed among all the bound `HttpServer`s. Connections can be
-   * distributed over multiple isolates this way.
-   */
-  static Future<HttpServer> bind(address, int port,
-          {int backlog = 0, bool v6Only = false, bool shared = false}) =>
-      _HttpServer.bind(address, port, backlog, v6Only, shared);
-
-  /**
-   * The [address] can either be a [String] or an
-   * [InternetAddress]. If [address] is a [String], [bind] will
-   * perform a [InternetAddress.lookup] and use the first value in the
-   * list. To listen on the loopback adapter, which will allow only
-   * incoming connections from the local host, use the value
-   * [InternetAddress.loopbackIPv4] or
-   * [InternetAddress.loopbackIPv6]. To allow for incoming
-   * connection from the network use either one of the values
-   * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
-   * bind to all interfaces or the IP address of a specific interface.
-   *
-   * If an IP version 6 (IPv6) address is used, both IP version 6
-   * (IPv6) and version 4 (IPv4) connections will be accepted. To
-   * restrict this to version 6 (IPv6) only, use [v6Only] to set
-   * version 6 only.
-   *
-   * If [port] has the value 0 an ephemeral port will be chosen by
-   * the system. The actual port used can be retrieved using the
-   * [port] getter.
-   *
-   * The optional argument [backlog] can be used to specify the listen
-   * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of 0 (the default) a reasonable value will be chosen by
-   * the system.
-   *
-   * If [requestClientCertificate] is true, the server will
-   * request clients to authenticate with a client certificate.
-   * The server will advertise the names of trusted issuers of client
-   * certificates, getting them from a [SecurityContext], where they have been
-   * set using [SecurityContext.setClientAuthorities].
-   *
-   * The optional argument [shared] specifies whether additional HttpServer
-   * objects can bind to the same combination of `address`, `port` and `v6Only`.
-   * If `shared` is `true` and more `HttpServer`s from this isolate or other
-   * isolates are bound to the port, then the incoming connections will be
-   * distributed among all the bound `HttpServer`s. Connections can be
-   * distributed over multiple isolates this way.
-   */
-
-  static Future<HttpServer> bindSecure(
-          address, int port, SecurityContext context,
-          {int backlog = 0,
-          bool v6Only = false,
-          bool requestClientCertificate = false,
-          bool shared = false}) =>
-      _HttpServer.bindSecure(address, port, context, backlog, v6Only,
-          requestClientCertificate, shared);
-
-  /**
-   * Attaches the HTTP server to an existing [ServerSocket]. When the
-   * [HttpServer] is closed, the [HttpServer] will just detach itself,
-   * closing current connections but not closing [serverSocket].
-   */
-  factory HttpServer.listenOn(ServerSocket serverSocket) =>
-      new _HttpServer.listenOn(serverSocket);
-
-  /**
-   * Permanently stops this [HttpServer] from listening for new
-   * connections.  This closes the [Stream] of [HttpRequest]s with a
-   * done event. The returned future completes when the server is
-   * stopped. For a server started using [bind] or [bindSecure] this
-   * means that the port listened on no longer in use.
-   *
-   * If [force] is `true`, active connections will be closed immediately.
-   */
-  Future close({bool force = false});
-
-  /**
-   * The port that the server is listening on.
-   *
-   * This is the actual port used when a port of zero is
-   * specified in the [bind] or [bindSecure] call.
-   */
-  int get port;
-
-  /**
-   * The address that the server is listening on.
-   *
-   * This is the actual address used when the original address
-   * was specified as a hostname.
-   */
-  InternetAddress get address;
-
-  /**
-   * Sets the timeout, in seconds, for sessions of this [HttpServer].
-   *
-   * The default timeout is 20 minutes.
-   */
-  set sessionTimeout(int timeout);
-
-  /**
-   * A [HttpConnectionsInfo] object summarizing the number of
-   * current connections handled by the server.
-   */
-  HttpConnectionsInfo connectionsInfo();
-}
-
-/**
- * Summary statistics about an [HttpServer]s current socket connections.
- */
-class HttpConnectionsInfo {
-  /**
-   * Total number of socket connections.
-   */
-  int total = 0;
-
-  /**
-   * Number of active connections where actual request/response
-   * processing is active.
-   */
-  int active = 0;
-
-  /**
-   * Number of idle connections held by clients as persistent connections.
-   */
-  int idle = 0;
-
-  /**
-   * Number of connections which are preparing to close.
-   *
-   * Note: These connections are also part of the [active] count as they might
-   * still be sending data to the client before finally closing.
-   */
-  int closing = 0;
-}
-
-/**
- * Headers for HTTP requests and responses.
- *
- * In some situations, headers are immutable:
- *
- * * [HttpRequest] and [HttpClientResponse] always have immutable headers.
- *
- * * [HttpResponse] and [HttpClientRequest] have immutable headers
- *   from the moment the body is written to.
- *
- * In these situations, the mutating methods throw exceptions.
- *
- * For all operations on HTTP headers the header name is
- * case-insensitive.
- *
- * To set the value of a header use the `set()` method:
- *
- *     request.headers.set(HttpHeaders.cacheControlHeader,
- *                         'max-age=3600, must-revalidate');
- *
- * To retrieve the value of a header use the `value()` method:
- *
- *     print(request.headers.value(HttpHeaders.userAgentHeader));
- *
- * An `HttpHeaders` object holds a list of values for each name
- * as the standard allows. In most cases a name holds only a single value,
- * The most common mode of operation is to use `set()` for setting a value,
- * and `value()` for retrieving a value.
- */
-abstract class HttpHeaders {
-  static const acceptHeader = "accept";
-  static const acceptCharsetHeader = "accept-charset";
-  static const acceptEncodingHeader = "accept-encoding";
-  static const acceptLanguageHeader = "accept-language";
-  static const acceptRangesHeader = "accept-ranges";
-  static const ageHeader = "age";
-  static const allowHeader = "allow";
-  static const authorizationHeader = "authorization";
-  static const cacheControlHeader = "cache-control";
-  static const connectionHeader = "connection";
-  static const contentEncodingHeader = "content-encoding";
-  static const contentLanguageHeader = "content-language";
-  static const contentLengthHeader = "content-length";
-  static const contentLocationHeader = "content-location";
-  static const contentMD5Header = "content-md5";
-  static const contentRangeHeader = "content-range";
-  static const contentTypeHeader = "content-type";
-  static const dateHeader = "date";
-  static const etagHeader = "etag";
-  static const expectHeader = "expect";
-  static const expiresHeader = "expires";
-  static const fromHeader = "from";
-  static const hostHeader = "host";
-  static const ifMatchHeader = "if-match";
-  static const ifModifiedSinceHeader = "if-modified-since";
-  static const ifNoneMatchHeader = "if-none-match";
-  static const ifRangeHeader = "if-range";
-  static const ifUnmodifiedSinceHeader = "if-unmodified-since";
-  static const lastModifiedHeader = "last-modified";
-  static const locationHeader = "location";
-  static const maxForwardsHeader = "max-forwards";
-  static const pragmaHeader = "pragma";
-  static const proxyAuthenticateHeader = "proxy-authenticate";
-  static const proxyAuthorizationHeader = "proxy-authorization";
-  static const rangeHeader = "range";
-  static const refererHeader = "referer";
-  static const retryAfterHeader = "retry-after";
-  static const serverHeader = "server";
-  static const teHeader = "te";
-  static const trailerHeader = "trailer";
-  static const transferEncodingHeader = "transfer-encoding";
-  static const upgradeHeader = "upgrade";
-  static const userAgentHeader = "user-agent";
-  static const varyHeader = "vary";
-  static const viaHeader = "via";
-  static const warningHeader = "warning";
-  static const wwwAuthenticateHeader = "www-authenticate";
-
-  @Deprecated("Use acceptHeader instead")
-  static const ACCEPT = acceptHeader;
-  @Deprecated("Use acceptCharsetHeader instead")
-  static const ACCEPT_CHARSET = acceptCharsetHeader;
-  @Deprecated("Use acceptEncodingHeader instead")
-  static const ACCEPT_ENCODING = acceptEncodingHeader;
-  @Deprecated("Use acceptLanguageHeader instead")
-  static const ACCEPT_LANGUAGE = acceptLanguageHeader;
-  @Deprecated("Use acceptRangesHeader instead")
-  static const ACCEPT_RANGES = acceptRangesHeader;
-  @Deprecated("Use ageHeader instead")
-  static const AGE = ageHeader;
-  @Deprecated("Use allowHeader instead")
-  static const ALLOW = allowHeader;
-  @Deprecated("Use authorizationHeader instead")
-  static const AUTHORIZATION = authorizationHeader;
-  @Deprecated("Use cacheControlHeader instead")
-  static const CACHE_CONTROL = cacheControlHeader;
-  @Deprecated("Use connectionHeader instead")
-  static const CONNECTION = connectionHeader;
-  @Deprecated("Use contentEncodingHeader instead")
-  static const CONTENT_ENCODING = contentEncodingHeader;
-  @Deprecated("Use contentLanguageHeader instead")
-  static const CONTENT_LANGUAGE = contentLanguageHeader;
-  @Deprecated("Use contentLengthHeader instead")
-  static const CONTENT_LENGTH = contentLengthHeader;
-  @Deprecated("Use contentLocationHeader instead")
-  static const CONTENT_LOCATION = contentLocationHeader;
-  @Deprecated("Use contentMD5Header instead")
-  static const CONTENT_MD5 = contentMD5Header;
-  @Deprecated("Use contentRangeHeader instead")
-  static const CONTENT_RANGE = contentRangeHeader;
-  @Deprecated("Use contentTypeHeader instead")
-  static const CONTENT_TYPE = contentTypeHeader;
-  @Deprecated("Use dateHeader instead")
-  static const DATE = dateHeader;
-  @Deprecated("Use etagHeader instead")
-  static const ETAG = etagHeader;
-  @Deprecated("Use expectHeader instead")
-  static const EXPECT = expectHeader;
-  @Deprecated("Use expiresHeader instead")
-  static const EXPIRES = expiresHeader;
-  @Deprecated("Use fromHeader instead")
-  static const FROM = fromHeader;
-  @Deprecated("Use hostHeader instead")
-  static const HOST = hostHeader;
-  @Deprecated("Use ifMatchHeader instead")
-  static const IF_MATCH = ifMatchHeader;
-  @Deprecated("Use ifModifiedSinceHeader instead")
-  static const IF_MODIFIED_SINCE = ifModifiedSinceHeader;
-  @Deprecated("Use ifNoneMatchHeader instead")
-  static const IF_NONE_MATCH = ifNoneMatchHeader;
-  @Deprecated("Use ifRangeHeader instead")
-  static const IF_RANGE = ifRangeHeader;
-  @Deprecated("Use ifUnmodifiedSinceHeader instead")
-  static const IF_UNMODIFIED_SINCE = ifUnmodifiedSinceHeader;
-  @Deprecated("Use lastModifiedHeader instead")
-  static const LAST_MODIFIED = lastModifiedHeader;
-  @Deprecated("Use locationHeader instead")
-  static const LOCATION = locationHeader;
-  @Deprecated("Use maxForwardsHeader instead")
-  static const MAX_FORWARDS = maxForwardsHeader;
-  @Deprecated("Use pragmaHeader instead")
-  static const PRAGMA = pragmaHeader;
-  @Deprecated("Use proxyAuthenticateHeader instead")
-  static const PROXY_AUTHENTICATE = proxyAuthenticateHeader;
-  @Deprecated("Use proxyAuthorizationHeader instead")
-  static const PROXY_AUTHORIZATION = proxyAuthorizationHeader;
-  @Deprecated("Use rangeHeader instead")
-  static const RANGE = rangeHeader;
-  @Deprecated("Use refererHeader instead")
-  static const REFERER = refererHeader;
-  @Deprecated("Use retryAfterHeader instead")
-  static const RETRY_AFTER = retryAfterHeader;
-  @Deprecated("Use serverHeader instead")
-  static const SERVER = serverHeader;
-  @Deprecated("Use teHeader instead")
-  static const TE = teHeader;
-  @Deprecated("Use trailerHeader instead")
-  static const TRAILER = trailerHeader;
-  @Deprecated("Use transferEncodingHeader instead")
-  static const TRANSFER_ENCODING = transferEncodingHeader;
-  @Deprecated("Use upgradeHeader instead")
-  static const UPGRADE = upgradeHeader;
-  @Deprecated("Use userAgentHeader instead")
-  static const USER_AGENT = userAgentHeader;
-  @Deprecated("Use varyHeader instead")
-  static const VARY = varyHeader;
-  @Deprecated("Use viaHeader instead")
-  static const VIA = viaHeader;
-  @Deprecated("Use warningHeader instead")
-  static const WARNING = warningHeader;
-  @Deprecated("Use wwwAuthenticateHeader instead")
-  static const WWW_AUTHENTICATE = wwwAuthenticateHeader;
-
-  // Cookie headers from RFC 6265.
-  static const cookieHeader = "cookie";
-  static const setCookieHeader = "set-cookie";
-
-  @Deprecated("Use cookieHeader instead")
-  static const COOKIE = cookieHeader;
-  @Deprecated("Use setCookieHeader instead")
-  static const SET_COOKIE = setCookieHeader;
-
-  // TODO(39783): Document this.
-  static const generalHeaders = const [
-    cacheControlHeader,
-    connectionHeader,
-    dateHeader,
-    pragmaHeader,
-    trailerHeader,
-    transferEncodingHeader,
-    upgradeHeader,
-    viaHeader,
-    warningHeader
-  ];
-
-  @Deprecated("Use generalHeaders instead")
-  static const GENERAL_HEADERS = generalHeaders;
-
-  static const entityHeaders = const [
-    allowHeader,
-    contentEncodingHeader,
-    contentLanguageHeader,
-    contentLengthHeader,
-    contentLocationHeader,
-    contentMD5Header,
-    contentRangeHeader,
-    contentTypeHeader,
-    expiresHeader,
-    lastModifiedHeader
-  ];
-
-  @Deprecated("Use entityHeaders instead")
-  static const ENTITY_HEADERS = entityHeaders;
-
-  static const responseHeaders = const [
-    acceptRangesHeader,
-    ageHeader,
-    etagHeader,
-    locationHeader,
-    proxyAuthenticateHeader,
-    retryAfterHeader,
-    serverHeader,
-    varyHeader,
-    wwwAuthenticateHeader
-  ];
-
-  @Deprecated("Use responseHeaders instead")
-  static const RESPONSE_HEADERS = responseHeaders;
-
-  static const requestHeaders = const [
-    acceptHeader,
-    acceptCharsetHeader,
-    acceptEncodingHeader,
-    acceptLanguageHeader,
-    authorizationHeader,
-    expectHeader,
-    fromHeader,
-    hostHeader,
-    ifMatchHeader,
-    ifModifiedSinceHeader,
-    ifNoneMatchHeader,
-    ifRangeHeader,
-    ifUnmodifiedSinceHeader,
-    maxForwardsHeader,
-    proxyAuthorizationHeader,
-    rangeHeader,
-    refererHeader,
-    teHeader,
-    userAgentHeader
-  ];
-
-  @Deprecated("Use requestHeaders instead")
-  static const REQUEST_HEADERS = requestHeaders;
-
-  /**
-   * The date specified by the [dateHeader] header, if any.
-   */
-  DateTime? date;
-
-  /**
-   * The date and time specified by the [expiresHeader] header, if any.
-   */
-  DateTime? expires;
-
-  /**
-   * The date and time specified by the [ifModifiedSinceHeader] header, if any.
-   */
-  DateTime? ifModifiedSince;
-
-  /**
-   * The value of the [hostHeader] header, if any.
-   */
-  String? host;
-
-  /**
-   * The value of the port part of the [hostHeader] header, if any.
-   */
-  int? port;
-
-  /**
-   * The [ContentType] of the [contentTypeHeader] header, if any.
-   */
-  ContentType? contentType;
-
-  /**
-   * The value of the [contentLengthHeader] header, if any.
-   *
-   * The value is negative if there is no content length set.
-   */
-  int contentLength = -1;
-
-  /**
-   * Whether the connection is persistent (keep-alive).
-   */
-  late bool persistentConnection;
-
-  /**
-   * Whether the connection uses chunked transfer encoding.
-   *
-   * Reflects and modifies the value of the [transferEncodingHeader] header.
-   */
-  late bool chunkedTransferEncoding;
-
-  /**
-   * The values for the header named [name].
-   *
-   * Returns null if there is no header with the provided name,
-   * otherwise returns a new list containing the current values.
-   * Not that modifying the list does not change the header.
-   */
-  List<String>? operator [](String name);
-
-  /**
-   * Convenience method for the value for a single valued header.
-   *
-   * The value must not have more than one value.
-   *
-   * Returns `null` if there is no header with the provided name.
-   */
-  String? value(String name);
-
-  /**
-   * Adds a header value.
-   *
-   * The header named [name] will have a string value derived from [value]
-   * added to its list of values.
-   *
-   * Some headers are single valued, and for these, adding a value will
-   * replace a previous value. If the [value] is a [DateTime], an
-   * HTTP date format will be applied. If the value is an [Iterable],
-   * each element will be added separately. For all other
-   * types the default [Object.toString] method will be used.
-   *
-   * Header names are converted to lower-case unless
-   * [preserveHeaderCase] is set to true. If two header names are
-   * the same when converted to lower-case, they are considered to be
-   * the same header, with one set of values.
-   *
-   * The current case of the a header name is that of the name used by
-   * the last [set] or [add] call for that header.
-   */
-  void add(String name, Object value,
-      {@Since("2.8") bool preserveHeaderCase = false});
-
-  /**
-   * Sets the header [name] to [value].
-   *
-   * Removes all existing values for the header named [name] and
-   * then [add]s [value] to it.
-   */
-  void set(String name, Object value,
-      {@Since("2.8") bool preserveHeaderCase = false});
-
-  /**
-   * Removes a specific value for a header name.
-   *
-   * Some headers have system supplied values which cannot be removed.
-   * For all other headers and values, the [value] is converted to a string
-   * in the same way as for [add], then that string value is removed from the
-   * current values of [name].
-   * If there are no remaining values for [name], the header is no longer
-   * considered present.
-   */
-  void remove(String name, Object value);
-
-  /**
-   * Removes all values for the specified header name.
-   *
-   * Some headers have system supplied values which cannot be removed.
-   * All other values for [name] are removed.
-   * If there are no remaining values for [name], the header is no longer
-   * considered present.
-   */
-  void removeAll(String name);
-
-  /**
-   * Performs the [action] on each header.
-   *
-   * The [action] function is called with each header's name and a list
-   * of the header's values. The casing of the name string is determined by
-   * the last [add] or [set] operation for that particular header,
-   * which defaults to lower-casing the header name unless explicitly
-   * set to preserve the case.
-   */
-  void forEach(void action(String name, List<String> values));
-
-  /**
-   * Disables folding for the header named [name] when sending the HTTP header.
-   *
-   * By default, multiple header values are folded into a
-   * single header line by separating the values with commas.
-   *
-   * The 'set-cookie' header has folding disabled by default.
-   */
-  void noFolding(String name);
-
-  /**
-   * Removes all headers.
-   *
-   * Some headers have system supplied values which cannot be removed.
-   * All other header values are removed, and header names with not
-   * remaining values are no longer considered present.
-   */
-  void clear();
-}
-
-/**
- * Representation of a header value in the form:
- * ```dart
- * value; parameter1=value1; parameter2=value2
- * ```
- *
- * [HeaderValue] can be used to conveniently build and parse header
- * values on this form.
- *
- * Parameter values can be omitted, in which case the value is parsed as `null`.
- * Values can be doubled quoted to allow characters outside of the RFC 7230
- * token characters and backslash sequences can be used to represent the double
- * quote and backslash characters themselves.
- *
- * To build an "accepts" header with the value
- *
- *     text/plain; q=0.3, text/html
- *
- * use code like this:
- *
- *     HttpClientRequest request = ...;
- *     var v = new HeaderValue("text/plain", {"q": "0.3"});
- *     request.headers.add(HttpHeaders.acceptHeader, v);
- *     request.headers.add(HttpHeaders.acceptHeader, "text/html");
- *
- * To parse the header values use the [parse] static method.
- *
- *     HttpRequest request = ...;
- *     List<String> values = request.headers[HttpHeaders.acceptHeader];
- *     values.forEach((value) {
- *       HeaderValue v = HeaderValue.parse(value);
- *       // Use v.value and v.parameters
- *     });
- *
- * An instance of [HeaderValue] is immutable.
- */
-abstract class HeaderValue {
-  /**
-   * Creates a new header value object setting the value and parameters.
-   */
-  factory HeaderValue(
-      [String value = "", Map<String, String?> parameters = const {}]) {
-    return new _HeaderValue(value, parameters);
-  }
-
-  /**
-   * Creates a new header value object from parsing a header value
-   * string with both value and optional parameters.
-   */
-  static HeaderValue parse(String value,
-      {String parameterSeparator = ";",
-      String? valueSeparator,
-      bool preserveBackslash = false}) {
-    return _HeaderValue.parse(value,
-        parameterSeparator: parameterSeparator,
-        valueSeparator: valueSeparator,
-        preserveBackslash: preserveBackslash);
-  }
-
-  /**
-   * The value of the header.
-   */
-  String get value;
-
-  /**
-   * A map of parameters.
-   *
-   * This map cannot be modified.
-   */
-  Map<String, String?> get parameters;
-
-  /**
-   * Returns the formatted string representation in the form:
-   * ```
-   * value; parameter1=value1; parameter2=value2
-   * ```
-   */
-  String toString();
-}
-
-abstract class HttpSession implements Map {
-  /**
-   * The id of the current session.
-   */
-  String get id;
-
-  /**
-   * Destroys the session.
-   *
-   * This terminates the session and any further
-   * connections with this id will be given a new id and session.
-   */
-  void destroy();
-
-  /**
-   * Sets a callback that will be called when the session is timed out.
-   *
-   * Calling this again will overwrite the previous value.
-   */
-  void set onTimeout(void callback());
-
-  /**
-   * Whether the session has not yet been sent to the client.
-   */
-  bool get isNew;
-}
-
-/**
- * A MIME/IANA media type used as the value of the [contentTypeHeader] header.
- *
- * A [ContentType] is immutable.
- */
-abstract class ContentType implements HeaderValue {
-  /**
-   * Content type for plain text using UTF-8 encoding.
-   *
-   *     text/plain; charset=utf-8
-   */
-  static final text = new ContentType("text", "plain", charset: "utf-8");
-  @Deprecated("Use text instead")
-  static final TEXT = text;
-
-  /**
-   *  Content type for HTML using UTF-8 encoding.
-   *
-   *     text/html; charset=utf-8
-   */
-  static final html = new ContentType("text", "html", charset: "utf-8");
-  @Deprecated("Use html instead")
-  static final HTML = html;
-
-  /**
-   *  Content type for JSON using UTF-8 encoding.
-   *
-   *     application/json; charset=utf-8
-   */
-  static final json = new ContentType("application", "json", charset: "utf-8");
-  @Deprecated("Use json instead")
-  static final JSON = json;
-
-  /**
-   *  Content type for binary data.
-   *
-   *     application/octet-stream
-   */
-  static final binary = new ContentType("application", "octet-stream");
-  @Deprecated("Use binary instead")
-  static final BINARY = binary;
-
-  /**
-   * Creates a new content type object setting the primary type and
-   * sub type. The charset and additional parameters can also be set
-   * using [charset] and [parameters]. If charset is passed and
-   * [parameters] contains charset as well the passed [charset] will
-   * override the value in parameters. Keys passed in parameters will be
-   * converted to lower case. The `charset` entry, whether passed as `charset`
-   * or in `parameters`, will have its value converted to lower-case.
-   */
-  factory ContentType(String primaryType, String subType,
-      {String? charset, Map<String, String?> parameters = const {}}) {
-    return new _ContentType(primaryType, subType, charset, parameters);
-  }
-
-  /**
-   * Creates a new content type object from parsing a Content-Type
-   * header value. As primary type, sub type and parameter names and
-   * values are not case sensitive all these values will be converted
-   * to lower case. Parsing this string
-   *
-   *     text/html; charset=utf-8
-   *
-   * will create a content type object with primary type "text",
-   * subtype "html" and parameter "charset" with value "utf-8".
-   * There may be more parameters supplied, but they are not recognized
-   * by this class.
-   */
-  static ContentType parse(String value) {
-    return _ContentType.parse(value);
-  }
-
-  /**
-   * Gets the MIME type and subtype, without any parameters.
-   *
-   * For the full content type `text/html;charset=utf-8`,
-   * the [mimeType] value is the string `text/html`.
-   */
-  String get mimeType;
-
-  /**
-   * Gets the primary type.
-   *
-   * For the full content type `text/html;charset=utf-8`,
-   * the [primaryType] value is the string `text`.
-   */
-  String get primaryType;
-
-  /**
-   * Gets the subtype.
-   *
-   * For the full content type `text/html;charset=utf-8`,
-   * the [subType] value is the string `html`.
-   * May be the empty string.
-   */
-  String get subType;
-
-  /**
-   * Gets the character set, if any.
-   *
-   * For the full content type `text/html;charset=utf-8`,
-   * the [charset] value is the string `utf-8`.
-   */
-  String? get charset;
-}
-
-/**
- * Representation of a cookie. For cookies received by the server as Cookie
- * header values only [name] and [value] properties will be set. When building a
- * cookie for the 'set-cookie' header in the server and when receiving cookies
- * in the client as 'set-cookie' headers all fields can be used.
- */
-abstract class Cookie {
-  /**
-   * The name of the cookie.
-   *
-   * Must be a `token` as specified in RFC 6265.
-   *
-   * The allowed characters in a `token` are the visible ASCII characters,
-   * U+0021 (`!`) through U+007E (`~`), except the separator characters:
-   * `(`, `)`, `<`, `>`, `@`, `,`, `;`, `:`, `\`, `"`, `/`, `[`, `]`, `?`, `=`,
-   * `{`, and `}`.
-   */
-  late String name;
-
-  /**
-   * The value of the cookie.
-   *
-   * Must be a `cookie-value` as specified in RFC 6265.
-   *
-   * The allowed characters in a cookie value are the visible ASCII characters,
-   * U+0021 (`!`) through U+007E (`~`) except the characters:
-   * `"`, `,`, `;` and `\`.
-   * Cookie values may be wrapped in a single pair of double quotes
-   * (U+0022, `"`).
-   */
-  late String value;
-
-  /**
-   * The time at which the cookie expires.
-   */
-  DateTime? expires;
-
-  /**
-   * The number of seconds until the cookie expires. A zero or negative value
-   * means the cookie has expired.
-   */
-  int? maxAge;
-
-  /**
-   * The domain that the cookie applies to.
-   */
-  String? domain;
-
-  /**
-   * The path within the [domain] that the cookie applies to.
-   */
-  String? path;
-
-  /**
-   * Whether to only send this cookie on secure connections.
-   */
-  bool secure = false;
-
-  /**
-   * Whether the cookie is only sent in the HTTP request and is not made
-   * available to client side scripts.
-   */
-  bool httpOnly = false;
-
-  /**
-   * Creates a new cookie setting the name and value.
-   *
-   * [name] and [value] must be composed of valid characters according to RFC
-   * 6265.
-   *
-   * By default the value of `httpOnly` will be set to `true`.
-   */
-  factory Cookie(String name, String value) => new _Cookie(name, value);
-
-  /**
-   * Creates a new cookie by parsing a header value from a 'set-cookie'
-   * header.
-   */
-  factory Cookie.fromSetCookieValue(String value) {
-    return new _Cookie.fromSetCookieValue(value);
-  }
-
-  /**
-   * Returns the formatted string representation of the cookie. The
-   * string representation can be used for for setting the Cookie or
-   * 'set-cookie' headers
-   */
-  String toString();
-}
-
-/**
- * A server-side object
- * that contains the content of and information about an HTTP request.
- *
- * __Note__: Check out the
- * [http_server](https://pub.dev/packages/http_server)
- * package, which makes working with the low-level
- * dart:io HTTP server subsystem easier.
- *
- * `HttpRequest` objects are generated by an [HttpServer],
- * which listens for HTTP requests on a specific host and port.
- * For each request received, the HttpServer, which is a [Stream],
- * generates an `HttpRequest` object and adds it to the stream.
- *
- * An `HttpRequest` object delivers the body content of the request
- * as a stream of byte lists.
- * The object also contains information about the request,
- * such as the method, URI, and headers.
- *
- * In the following code, an HttpServer listens
- * for HTTP requests. When the server receives a request,
- * it uses the HttpRequest object's `method` property to dispatch requests.
- *
- *     final HOST = InternetAddress.loopbackIPv4;
- *     final PORT = 80;
- *
- *     HttpServer.bind(HOST, PORT).then((_server) {
- *       _server.listen((HttpRequest request) {
- *         switch (request.method) {
- *           case 'GET':
- *             handleGetRequest(request);
- *             break;
- *           case 'POST':
- *             ...
- *         }
- *       },
- *       onError: handleError);    // listen() failed.
- *     }).catchError(handleError);
- *
- * An HttpRequest object provides access to the associated [HttpResponse]
- * object through the response property.
- * The server writes its response to the body of the HttpResponse object.
- * For example, here's a function that responds to a request:
- *
- *     void handleGetRequest(HttpRequest req) {
- *       HttpResponse res = req.response;
- *       res.write('Received request ${req.method}: ${req.uri.path}');
- *       res.close();
- *     }
- */
-abstract class HttpRequest implements Stream<Uint8List> {
-  /**
-   * The content length of the request body.
-   *
-   * If the size of the request body is not known in advance,
-   * this value is -1.
-   */
-  int get contentLength;
-
-  /**
-   * The method, such as 'GET' or 'POST', for the request.
-   */
-  String get method;
-
-  /**
-   * The URI for the request.
-   *
-   * This provides access to the
-   * path and query string for the request.
-   */
-  Uri get uri;
-
-  /**
-   * The requested URI for the request.
-   *
-   * The returned URI is reconstructed by using http-header fields, to access
-   * otherwise lost information, e.g. host and scheme.
-   *
-   * To reconstruct the scheme, first 'X-Forwarded-Proto' is checked, and then
-   * falling back to server type.
-   *
-   * To reconstruct the host, first 'X-Forwarded-Host' is checked, then 'Host'
-   * and finally calling back to server.
-   */
-  Uri get requestedUri;
-
-  /**
-   * The request headers.
-   *
-   * The returned [HttpHeaders] are immutable.
-   */
-  HttpHeaders get headers;
-
-  /**
-   * The cookies in the request, from the "Cookie" headers.
-   */
-  List<Cookie> get cookies;
-
-  /**
-   * The persistent connection state signaled by the client.
-   */
-  bool get persistentConnection;
-
-  /**
-   * The client certificate of the client making the request.
-   *
-   * This value is null if the connection is not a secure TLS or SSL connection,
-   * or if the server does not request a client certificate, or if the client
-   * does not provide one.
-   */
-  X509Certificate? get certificate;
-
-  /**
-   * The session for the given request.
-   *
-   * If the session is being initialized by this call,
-   * [HttpSession.isNew] is true for the returned session.
-   * See [HttpServer.sessionTimeout] on how to change default timeout.
-   */
-  HttpSession get session;
-
-  /**
-   * The HTTP protocol version used in the request,
-   * either "1.0" or "1.1".
-   */
-  String get protocolVersion;
-
-  /**
-   * Information about the client connection.
-   *
-   * Returns `null` if the socket is not available.
-   */
-  HttpConnectionInfo? get connectionInfo;
-
-  /**
-   * The [HttpResponse] object, used for sending back the response to the
-   * client.
-   *
-   * If the [contentLength] of the body isn't 0, and the body isn't being read,
-   * any write calls on the [HttpResponse] automatically drain the request
-   * body.
-   */
-  HttpResponse get response;
-}
-
-/**
- * An HTTP response, which returns the headers and data
- * from the server to the client in response to an HTTP request.
- *
- * Every HttpRequest object provides access to the associated [HttpResponse]
- * object through the `response` property.
- * The server sends its response to the client by writing to the
- * HttpResponse object.
- *
- * ## Writing the response
- *
- * This class implements [IOSink].
- * After the header has been set up, the methods
- * from IOSink, such as `writeln()`, can be used to write
- * the body of the HTTP response.
- * Use the `close()` method to close the response and send it to the client.
- *
- *     server.listen((HttpRequest request) {
- *       request.response.write('Hello, world!');
- *       request.response.close();
- *     });
- *
- * When one of the IOSink methods is used for the
- * first time, the request header is sent. Calling any methods that
- * change the header after it is sent throws an exception.
- *
- * ## Setting the headers
- *
- * The HttpResponse object has a number of properties for setting up
- * the HTTP headers of the response.
- * When writing string data through the IOSink, the encoding used
- * is determined from the "charset" parameter of the
- * "Content-Type" header.
- *
- *     HttpResponse response = ...
- *     response.headers.contentType
- *         = new ContentType("application", "json", charset: "utf-8");
- *     response.write(...);  // Strings written will be UTF-8 encoded.
- *
- * If no charset is provided the default of ISO-8859-1 (Latin 1) will
- * be used.
- *
- *     HttpResponse response = ...
- *     response.headers.add(HttpHeaders.contentTypeHeader, "text/plain");
- *     response.write(...);  // Strings written will be ISO-8859-1 encoded.
- *
- * An exception is thrown if you use the `write()` method
- * while an unsupported content-type is set.
- */
-abstract class HttpResponse implements IOSink {
-  // TODO(ajohnsen): Add documentation of how to pipe a file to the response.
-  /**
-   * Gets and sets the content length of the response. If the size of
-   * the response is not known in advance set the content length to
-   * -1, which is also the default if not set.
-   */
-  int contentLength = -1;
-
-  /**
-   * The status code of the response.
-   *
-   * Any integer value is accepted. For
-   * the official HTTP status codes use the fields from
-   * [HttpStatus]. If no status code is explicitly set the default
-   * value [HttpStatus.ok] is used.
-   *
-   * The status code must be set before the body is written
-   * to. Setting the status code after writing to the response body or
-   * closing the response will throw a `StateError`.
-   */
-  int statusCode = HttpStatus.ok;
-
-  /**
-   * The reason phrase for the response.
-   *
-   * If no reason phrase is explicitly set, a default reason phrase is provided.
-   *
-   * The reason phrase must be set before the body is written
-   * to. Setting the reason phrase after writing to the response body
-   * or closing the response will throw a [StateError].
-   */
-  late String reasonPhrase;
-
-  /**
-   * Gets and sets the persistent connection state. The initial value
-   * of this property is the persistent connection state from the
-   * request.
-   */
-  late bool persistentConnection;
-
-  /**
-   * Set and get the [deadline] for the response. The deadline is timed from the
-   * time it's set. Setting a new deadline will override any previous deadline.
-   * When a deadline is exceeded, the response will be closed and any further
-   * data ignored.
-   *
-   * To disable a deadline, set the [deadline] to `null`.
-   *
-   * The [deadline] is `null` by default.
-   */
-  Duration? deadline;
-
-  /**
-   * Gets or sets if the [HttpResponse] should buffer output.
-   *
-   * Default value is `true`.
-   *
-   * __Note__: Disabling buffering of the output can result in very poor
-   * performance, when writing many small chunks.
-   */
-  bool bufferOutput = true;
-
-  /**
-   * Returns the response headers.
-   *
-   * The response headers can be modified until the response body is
-   * written to or closed. After that they become immutable.
-   */
-  HttpHeaders get headers;
-
-  /**
-   * Cookies to set in the client (in the 'set-cookie' header).
-   */
-  List<Cookie> get cookies;
-
-  /**
-   * Respond with a redirect to [location].
-   *
-   * The URI in [location] should be absolute, but there are no checks
-   * to enforce that.
-   *
-   * By default the HTTP status code `HttpStatus.movedTemporarily`
-   * (`302`) is used for the redirect, but an alternative one can be
-   * specified using the [status] argument.
-   *
-   * This method will also call `close`, and the returned future is
-   * the future returned by `close`.
-   */
-  Future redirect(Uri location, {int status = HttpStatus.movedTemporarily});
-
-  /**
-   * Detaches the underlying socket from the HTTP server. When the
-   * socket is detached the HTTP server will no longer perform any
-   * operations on it.
-   *
-   * This is normally used when a HTTP upgrade request is received
-   * and the communication should continue with a different protocol.
-   *
-   * If [writeHeaders] is `true`, the status line and [headers] will be written
-   * to the socket before it's detached. If `false`, the socket is detached
-   * immediately, without any data written to the socket. Default is `true`.
-   */
-  Future<Socket> detachSocket({bool writeHeaders = true});
-
-  /**
-   * Gets information about the client connection. Returns `null` if the
-   * socket is not available.
-   */
-  HttpConnectionInfo? get connectionInfo;
-}
-
-/**
- * A client that receives content, such as web pages, from
- * a server using the HTTP protocol.
- *
- * HttpClient contains a number of methods to send an [HttpClientRequest]
- * to an Http server and receive an [HttpClientResponse] back.
- * For example, you can use the [get], [getUrl], [post], and [postUrl] methods
- * for GET and POST requests, respectively.
- *
- * ## Making a simple GET request: an example
- *
- * A `getUrl` request is a two-step process, triggered by two [Future]s.
- * When the first future completes with a [HttpClientRequest], the underlying
- * network connection has been established, but no data has been sent.
- * In the callback function for the first future, the HTTP headers and body
- * can be set on the request. Either the first write to the request object
- * or a call to [close] sends the request to the server.
- *
- * When the HTTP response is received from the server,
- * the second future, which is returned by close,
- * completes with an [HttpClientResponse] object.
- * This object provides access to the headers and body of the response.
- * The body is available as a stream implemented by HttpClientResponse.
- * If a body is present, it must be read. Otherwise, it leads to resource
- * leaks. Consider using [HttpClientResponse.drain] if the body is unused.
- *
- *     HttpClient client = new HttpClient();
- *     client.getUrl(Uri.parse("http://www.example.com/"))
- *         .then((HttpClientRequest request) {
- *           // Optionally set up headers...
- *           // Optionally write to the request object...
- *           // Then call close.
- *           ...
- *           return request.close();
- *         })
- *         .then((HttpClientResponse response) {
- *           // Process the response.
- *           ...
- *         });
- *
- * The future for [HttpClientRequest] is created by methods such as
- * [getUrl] and [open].
- *
- * ## HTTPS connections
- *
- * An HttpClient can make HTTPS requests, connecting to a server using
- * the TLS (SSL) secure networking protocol. Calling [getUrl] with an
- * https: scheme will work automatically, if the server's certificate is
- * signed by a root CA (certificate authority) on the default list of
- * well-known trusted CAs, compiled by Mozilla.
- *
- * To add a custom trusted certificate authority, or to send a client
- * certificate to servers that request one, pass a [SecurityContext] object
- * as the optional `context` argument to the `HttpClient` constructor.
- * The desired security options can be set on the [SecurityContext] object.
- *
- * ## Headers
- *
- * All HttpClient requests set the following header by default:
- *
- *     Accept-Encoding: gzip
- *
- * This allows the HTTP server to use gzip compression for the body if
- * possible. If this behavior is not desired set the
- * `Accept-Encoding` header to something else.
- * To turn off gzip compression of the response, clear this header:
- *
- *      request.headers.removeAll(HttpHeaders.acceptEncodingHeader)
- *
- * ## Closing the HttpClient
- *
- * The HttpClient supports persistent connections and caches network
- * connections to reuse them for multiple requests whenever
- * possible. This means that network connections can be kept open for
- * some time after a request has completed. Use HttpClient.close
- * to force the HttpClient object to shut down and to close the idle
- * network connections.
- *
- * ## Turning proxies on and off
- *
- * By default the HttpClient uses the proxy configuration available
- * from the environment, see [findProxyFromEnvironment]. To turn off
- * the use of proxies set the [findProxy] property to
- * `null`.
- *
- *     HttpClient client = new HttpClient();
- *     client.findProxy = null;
- */
-abstract class HttpClient {
-  static const int defaultHttpPort = 80;
-  @Deprecated("Use defaultHttpPort instead")
-  static const int DEFAULT_HTTP_PORT = defaultHttpPort;
-
-  static const int defaultHttpsPort = 443;
-  @Deprecated("Use defaultHttpsPort instead")
-  static const int DEFAULT_HTTPS_PORT = defaultHttpsPort;
-
-  /// Enable logging of HTTP requests from all [HttpClient]s to the developer
-  /// timeline.
-  ///
-  /// Default is `false`.
-  static set enableTimelineLogging(bool value) {
-    _enableTimelineLogging =
-        valueOfNonNullableParamWithDefault<bool>(value, false);
-  }
-
-  /// Current state of HTTP request logging from all [HttpClient]s to the
-  /// developer timeline.
-  ///
-  /// Default is `false`.
-  static bool get enableTimelineLogging => _enableTimelineLogging;
-
-  static bool _enableTimelineLogging = false;
-
-  /// Gets and sets the idle timeout of non-active persistent (keep-alive)
-  /// connections.
-  ///
-  /// The default value is 15 seconds.
-  Duration idleTimeout = const Duration(seconds: 15);
-
-  /// Gets and sets the connection timeout.
-  ///
-  /// When connecting to a new host exceeds this timeout, a [SocketException]
-  /// is thrown. The timeout applies only to connections initiated after the
-  /// timeout is set.
-  ///
-  /// When this is `null`, the OS default timeout is used. The default is
-  /// `null`.
-  Duration? connectionTimeout;
-
-  /**
-   * Gets and sets the maximum number of live connections, to a single host.
-   *
-   * Increasing this number may lower performance and take up unwanted
-   * system resources.
-   *
-   * To disable, set to `null`.
-   *
-   * Default is `null`.
-   */
-  int? maxConnectionsPerHost;
-
-  /**
-   * Gets and sets whether the body of a response will be automatically
-   * uncompressed.
-   *
-   * The body of an HTTP response can be compressed. In most
-   * situations providing the un-compressed body is most
-   * convenient. Therefore the default behavior is to un-compress the
-   * body. However in some situations (e.g. implementing a transparent
-   * proxy) keeping the uncompressed stream is required.
-   *
-   * NOTE: Headers in the response are never modified. This means
-   * that when automatic un-compression is turned on the value of the
-   * header `Content-Length` will reflect the length of the original
-   * compressed body. Likewise the header `Content-Encoding` will also
-   * have the original value indicating compression.
-   *
-   * NOTE: Automatic un-compression is only performed if the
-   * `Content-Encoding` header value is `gzip`.
-   *
-   * This value affects all responses produced by this client after the
-   * value is changed.
-   *
-   * To disable, set to `false`.
-   *
-   * Default is `true`.
-   */
-  bool autoUncompress = true;
-
-  /// Gets and sets the default value of the `User-Agent` header for all requests
-  /// generated by this [HttpClient].
-  ///
-  /// The default value is `Dart/<version> (dart:io)`.
-  ///
-  /// If the userAgent is set to `null`, no default `User-Agent` header will be
-  /// added to each request.
-  String? userAgent;
-
-  factory HttpClient({SecurityContext? context}) {
-    HttpOverrides? overrides = HttpOverrides.current;
-    if (overrides == null) {
-      return new _HttpClient(context);
-    }
-    return overrides.createHttpClient(context);
-  }
-
-  /**
-   * Opens a HTTP connection.
-   *
-   * The HTTP method to use is specified in [method], the server is
-   * specified using [host] and [port], and the path (including
-   * a possible query) is specified using [path].
-   * The path may also contain a URI fragment, which will be ignored.
-   *
-   * The `Host` header for the request will be set to the value [host]:[port]
-   * (if [host] is an IP address, it will still be used in the `Host` header).
-   * This can be overridden through the [HttpClientRequest] interface before
-   * the request is sent.
-   *
-   * For additional information on the sequence of events during an
-   * HTTP transaction, and the objects returned by the futures, see
-   * the overall documentation for the class [HttpClient].
-   */
-  Future<HttpClientRequest> open(
-      String method, String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection.
-   *
-   * The HTTP method is specified in [method] and the URL to use in
-   * [url].
-   *
-   * The `Host` header for the request will be set to the value
-   * [Uri.host]:[Uri.port] from [url] (if [url.host] is an IP address, it will
-   * still be used in the `Host` header). This can be overridden through the
-   * [HttpClientRequest] interface before the request is sent.
-   *
-   * For additional information on the sequence of events during an
-   * HTTP transaction, and the objects returned by the futures, see
-   * the overall documentation for the class [HttpClient].
-   */
-  Future<HttpClientRequest> openUrl(String method, Uri url);
-
-  /**
-   * Opens a HTTP connection using the GET method.
-   *
-   * The server is specified using [host] and [port], and the path
-   * (including a possible query) is specified using
-   * [path].
-   *
-   * See [open] for details.
-   */
-  Future<HttpClientRequest> get(String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection using the GET method.
-   *
-   * The URL to use is specified in [url].
-   *
-   * See [openUrl] for details.
-   */
-  Future<HttpClientRequest> getUrl(Uri url);
-
-  /**
-   * Opens a HTTP connection using the POST method.
-   *
-   * The server is specified using [host] and [port], and the path
-   * (including a possible query) is specified using
-   * [path].
-   *
-   * See [open] for details.
-   */
-  Future<HttpClientRequest> post(String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection using the POST method.
-   *
-   * The URL to use is specified in [url].
-   *
-   * See [openUrl] for details.
-   */
-  Future<HttpClientRequest> postUrl(Uri url);
-
-  /**
-   * Opens a HTTP connection using the PUT method.
-   *
-   * The server is specified using [host] and [port], and the path
-   * (including a possible query) is specified using [path].
-   *
-   * See [open] for details.
-   */
-  Future<HttpClientRequest> put(String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection using the PUT method.
-   *
-   * The URL to use is specified in [url].
-   *
-   * See [openUrl] for details.
-   */
-  Future<HttpClientRequest> putUrl(Uri url);
-
-  /**
-   * Opens a HTTP connection using the DELETE method.
-   *
-   * The server is specified using [host] and [port], and the path
-   * (including a possible query) is specified using [path].
-   *
-   * See [open] for details.
-   */
-  Future<HttpClientRequest> delete(String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection using the DELETE method.
-   *
-   * The URL to use is specified in [url].
-   *
-   * See [openUrl] for details.
-   */
-  Future<HttpClientRequest> deleteUrl(Uri url);
-
-  /**
-   * Opens a HTTP connection using the PATCH method.
-   *
-   * The server is specified using [host] and [port], and the path
-   * (including a possible query) is specified using [path].
-   *
-   * See [open] for details.
-   */
-  Future<HttpClientRequest> patch(String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection using the PATCH method.
-   *
-   * The URL to use is specified in [url].
-   *
-   * See [openUrl] for details.
-   */
-  Future<HttpClientRequest> patchUrl(Uri url);
-
-  /**
-   * Opens a HTTP connection using the HEAD method.
-   *
-   * The server is specified using [host] and [port], and the path
-   * (including a possible query) is specified using [path].
-   *
-   * See [open] for details.
-   */
-  Future<HttpClientRequest> head(String host, int port, String path);
-
-  /**
-   * Opens a HTTP connection using the HEAD method.
-   *
-   * The URL to use is specified in [url].
-   *
-   * See [openUrl] for details.
-   */
-  Future<HttpClientRequest> headUrl(Uri url);
-
-  /**
-   * Sets the function to be called when a site is requesting
-   * authentication. The URL requested and the security realm from the
-   * server are passed in the arguments [url] and [realm].
-   *
-   * The function returns a [Future] which should complete when the
-   * authentication has been resolved. If credentials cannot be
-   * provided the [Future] should complete with `false`. If
-   * credentials are available the function should add these using
-   * [addCredentials] before completing the [Future] with the value
-   * `true`.
-   *
-   * If the [Future] completes with `true` the request will be retried
-   * using the updated credentials, however, the retried request will not
-   * carry the original request payload. Otherwise response processing will
-   * continue normally.
-   *
-   * If it is known that the remote server requires authentication for all
-   * requests, it is advisable to use [addCredentials] directly, or manually
-   * set the `'authorization'` header on the request to avoid the overhead
-   * of a failed request, or issues due to missing request payload on retried
-   * request.
-   */
-  void set authenticate(Future<bool> f(Uri url, String scheme, String realm)?);
-
-  /**
-   * Add credentials to be used for authorizing HTTP requests.
-   */
-  void addCredentials(Uri url, String realm, HttpClientCredentials credentials);
-
-  /**
-   * Sets the function used to resolve the proxy server to be used for
-   * opening a HTTP connection to the specified [url]. If this
-   * function is not set, direct connections will always be used.
-   *
-   * The string returned by [f] must be in the format used by browser
-   * PAC (proxy auto-config) scripts. That is either
-   *
-   *     "DIRECT"
-   *
-   * for using a direct connection or
-   *
-   *     "PROXY host:port"
-   *
-   * for using the proxy server `host` on port `port`.
-   *
-   * A configuration can contain several configuration elements
-   * separated by semicolons, e.g.
-   *
-   *     "PROXY host:port; PROXY host2:port2; DIRECT"
-   *
-   * The static function [findProxyFromEnvironment] on this class can
-   * be used to implement proxy server resolving based on environment
-   * variables.
-   */
-  void set findProxy(String f(Uri url)?);
-
-  /**
-   * Function for resolving the proxy server to be used for a HTTP
-   * connection from the proxy configuration specified through
-   * environment variables.
-   *
-   * The following environment variables are taken into account:
-   *
-   *     http_proxy
-   *     https_proxy
-   *     no_proxy
-   *     HTTP_PROXY
-   *     HTTPS_PROXY
-   *     NO_PROXY
-   *
-   * [:http_proxy:] and [:HTTP_PROXY:] specify the proxy server to use for
-   * http:// urls. Use the format [:hostname:port:]. If no port is used a
-   * default of 1080 will be used. If both are set the lower case one takes
-   * precedence.
-   *
-   * [:https_proxy:] and [:HTTPS_PROXY:] specify the proxy server to use for
-   * https:// urls. Use the format [:hostname:port:]. If no port is used a
-   * default of 1080 will be used. If both are set the lower case one takes
-   * precedence.
-   *
-   * [:no_proxy:] and [:NO_PROXY:] specify a comma separated list of
-   * postfixes of hostnames for which not to use the proxy
-   * server. E.g. the value "localhost,127.0.0.1" will make requests
-   * to both "localhost" and "127.0.0.1" not use a proxy. If both are set
-   * the lower case one takes precedence.
-   *
-   * To activate this way of resolving proxies assign this function to
-   * the [findProxy] property on the [HttpClient].
-   *
-   *     HttpClient client = new HttpClient();
-   *     client.findProxy = HttpClient.findProxyFromEnvironment;
-   *
-   * If you don't want to use the system environment you can use a
-   * different one by wrapping the function.
-   *
-   *     HttpClient client = new HttpClient();
-   *     client.findProxy = (url) {
-   *       return HttpClient.findProxyFromEnvironment(
-   *           url, environment: {"http_proxy": ..., "no_proxy": ...});
-   *     }
-   *
-   * If a proxy requires authentication it is possible to configure
-   * the username and password as well. Use the format
-   * [:username:password@hostname:port:] to include the username and
-   * password. Alternatively the API [addProxyCredentials] can be used
-   * to set credentials for proxies which require authentication.
-   */
-  static String findProxyFromEnvironment(Uri url,
-      {Map<String, String>? environment}) {
-    HttpOverrides? overrides = HttpOverrides.current;
-    if (overrides == null) {
-      return _HttpClient._findProxyFromEnvironment(url, environment);
-    }
-    return overrides.findProxyFromEnvironment(url, environment);
-  }
-
-  /**
-   * Sets the function to be called when a proxy is requesting
-   * authentication. Information on the proxy in use and the security
-   * realm for the authentication are passed in the arguments [host],
-   * [port] and [realm].
-   *
-   * The function returns a [Future] which should complete when the
-   * authentication has been resolved. If credentials cannot be
-   * provided the [Future] should complete with `false`. If
-   * credentials are available the function should add these using
-   * [addProxyCredentials] before completing the [Future] with the value
-   * `true`.
-   *
-   * If the [Future] completes with `true` the request will be retried
-   * using the updated credentials. Otherwise response processing will
-   * continue normally.
-   */
-  void set authenticateProxy(
-      Future<bool> f(String host, int port, String scheme, String realm)?);
-
-  /**
-   * Add credentials to be used for authorizing HTTP proxies.
-   */
-  void addProxyCredentials(
-      String host, int port, String realm, HttpClientCredentials credentials);
-
-  /**
-   * Sets a callback that will decide whether to accept a secure connection
-   * with a server certificate that cannot be authenticated by any of our
-   * trusted root certificates.
-   *
-   * When an secure HTTP request if made, using this HttpClient, and the
-   * server returns a server certificate that cannot be authenticated, the
-   * callback is called asynchronously with the [X509Certificate] object and
-   * the server's hostname and port.  If the value of [badCertificateCallback]
-   * is `null`, the bad certificate is rejected, as if the callback
-   * returned `false`
-   *
-   * If the callback returns true, the secure connection is accepted and the
-   * [:Future<HttpClientRequest>:] that was returned from the call making the
-   * request completes with a valid HttpRequest object. If the callback returns
-   * false, the [:Future<HttpClientRequest>:] completes with an exception.
-   *
-   * If a bad certificate is received on a connection attempt, the library calls
-   * the function that was the value of badCertificateCallback at the time
-   * the request is made, even if the value of badCertificateCallback
-   * has changed since then.
-   */
-  void set badCertificateCallback(
-      bool callback(X509Certificate cert, String host, int port)?);
-
-  /// Shuts down the HTTP client.
-  ///
-  /// If [force] is `false` (the default) the [HttpClient] will be kept alive
-  /// until all active connections are done. If [force] is `true` any active
-  /// connections will be closed to immediately release all resources. These
-  /// closed connections will receive an error event to indicate that the client
-  /// was shut down. In both cases trying to establish a new connection after
-  /// calling [close] will throw an exception.
-  void close({bool force = false});
-}
-
-/**
- * HTTP request for a client connection.
- *
- * To set up a request, set the headers using the headers property
- * provided in this class and write the data to the body of the request.
- * HttpClientRequest is an [IOSink]. Use the methods from IOSink,
- * such as writeCharCode(), to write the body of the HTTP
- * request. When one of the IOSink methods is used for the first
- * time, the request header is sent. Calling any methods that
- * change the header after it is sent throws an exception.
- *
- * When writing string data through the [IOSink] the
- * encoding used is determined from the "charset" parameter of
- * the "Content-Type" header.
- *
- *     HttpClientRequest request = ...
- *     request.headers.contentType
- *         = new ContentType("application", "json", charset: "utf-8");
- *     request.write(...);  // Strings written will be UTF-8 encoded.
- *
- * If no charset is provided the default of ISO-8859-1 (Latin 1) is
- * be used.
- *
- *     HttpClientRequest request = ...
- *     request.headers.add(HttpHeaders.contentTypeHeader, "text/plain");
- *     request.write(...);  // Strings written will be ISO-8859-1 encoded.
- *
- * An exception is thrown if you use an unsupported encoding and the
- * `write()` method being used takes a string parameter.
- */
-abstract class HttpClientRequest implements IOSink {
-  /**
-   * The requested persistent connection state.
-   *
-   * The default value is `true`.
-   */
-  bool persistentConnection = true;
-
-  /**
-   * Whether to follow redirects automatically.
-   *
-   * Set this property to `false` if this request should not
-   * automatically follow redirects. The default is `true`.
-   *
-   * Automatic redirect will only happen for "GET" and "HEAD" requests
-   * and only for the status codes [HttpStatus.movedPermanently]
-   * (301), [HttpStatus.found] (302),
-   * [HttpStatus.movedTemporarily] (302, alias for
-   * [HttpStatus.found]), [HttpStatus.seeOther] (303) and
-   * [HttpStatus.temporaryRedirect] (307). For
-   * [HttpStatus.seeOther] (303) automatic redirect will also happen
-   * for "POST" requests with the method changed to "GET" when
-   * following the redirect.
-   *
-   * All headers added to the request will be added to the redirection
-   * request(s). However, any body send with the request will not be
-   * part of the redirection request(s).
-   */
-  bool followRedirects = true;
-
-  /**
-   * Set this property to the maximum number of redirects to follow
-   * when [followRedirects] is `true`. If this number is exceeded
-   * an error event will be added with a [RedirectException].
-   *
-   * The default value is 5.
-   */
-  int maxRedirects = 5;
-
-  /**
-   * The method of the request.
-   */
-  String get method;
-
-  /**
-   * The uri of the request.
-   */
-  Uri get uri;
-
-  /// Gets and sets the content length of the request.
-  ///
-  /// If the size of the request is not known in advance set content length to
-  /// -1, which is also the default.
-  int contentLength = -1;
-
-  /**
-   * Gets or sets if the [HttpClientRequest] should buffer output.
-   *
-   * Default value is `true`.
-   *
-   * __Note__: Disabling buffering of the output can result in very poor
-   * performance, when writing many small chunks.
-   */
-  bool bufferOutput = true;
-
-  /**
-   * Returns the client request headers.
-   *
-   * The client request headers can be modified until the client
-   * request body is written to or closed. After that they become
-   * immutable.
-   */
-  HttpHeaders get headers;
-
-  /**
-   * Cookies to present to the server (in the 'cookie' header).
-   */
-  List<Cookie> get cookies;
-
-  /// A [HttpClientResponse] future that will complete once the response is
-  /// available.
-  ///
-  /// If an error occurs before the response is available, this future will
-  /// complete with an error.
-  Future<HttpClientResponse> get done;
-
-  /**
-   * Close the request for input. Returns the value of [done].
-   */
-  Future<HttpClientResponse> close();
-
-  /// Gets information about the client connection.
-  ///
-  /// Returns `null` if the socket is not available.
-  HttpConnectionInfo? get connectionInfo;
-}
-
-/**
- * HTTP response for a client connection.
- *
- * The body of a [HttpClientResponse] object is a
- * [Stream] of data from the server. Listen to the body to handle
- * the data and be notified when the entire body is received.
- *
- *     new HttpClient().get('localhost', 80, '/file.txt')
- *          .then((HttpClientRequest request) => request.close())
- *          .then((HttpClientResponse response) {
- *            response.transform(utf8.decoder).listen((contents) {
- *              // handle data
- *            });
- *          });
- */
-abstract class HttpClientResponse implements Stream<List<int>> {
-  /**
-   * Returns the status code.
-   *
-   * The status code must be set before the body is written
-   * to. Setting the status code after writing to the body will throw
-   * a `StateError`.
-   */
-  int get statusCode;
-
-  /**
-   * Returns the reason phrase associated with the status code.
-   *
-   * The reason phrase must be set before the body is written
-   * to. Setting the reason phrase after writing to the body will throw
-   * a `StateError`.
-   */
-  String get reasonPhrase;
-
-  /**
-   * Returns the content length of the response body. Returns -1 if the size of
-   * the response body is not known in advance.
-   *
-   * If the content length needs to be set, it must be set before the
-   * body is written to. Setting the content length after writing to the body
-   * will throw a `StateError`.
-   */
-  int get contentLength;
-
-  /// The compression state of the response.
-  ///
-  /// This specifies whether the response bytes were compressed when they were
-  /// received across the wire and whether callers will receive compressed
-  /// or uncompressed bytes when they listed to this response's byte stream.
-  @Since("2.4")
-  HttpClientResponseCompressionState get compressionState;
-
-  /**
-   * Gets the persistent connection state returned by the server.
-   *
-   * If the persistent connection state needs to be set, it must be
-   * set before the body is written to. Setting the persistent connection state
-   * after writing to the body will throw a `StateError`.
-   */
-  bool get persistentConnection;
-
-  /**
-   * Returns whether the status code is one of the normal redirect
-   * codes [HttpStatus.movedPermanently], [HttpStatus.found],
-   * [HttpStatus.movedTemporarily], [HttpStatus.seeOther] and
-   * [HttpStatus.temporaryRedirect].
-   */
-  bool get isRedirect;
-
-  /**
-   * Returns the series of redirects this connection has been through. The
-   * list will be empty if no redirects were followed. [redirects] will be
-   * updated both in the case of an automatic and a manual redirect.
-   */
-  List<RedirectInfo> get redirects;
-
-  /**
-   * Redirects this connection to a new URL. The default value for
-   * [method] is the method for the current request. The default value
-   * for [url] is the value of the [HttpHeaders.locationHeader] header of
-   * the current response. All body data must have been read from the
-   * current response before calling [redirect].
-   *
-   * All headers added to the request will be added to the redirection
-   * request. However, any body sent with the request will not be
-   * part of the redirection request.
-   *
-   * If [followLoops] is set to `true`, redirect will follow the redirect,
-   * even if the URL was already visited. The default value is `false`.
-   *
-   * The method will ignore [HttpClientRequest.maxRedirects]
-   * and will always perform the redirect.
-   */
-  Future<HttpClientResponse> redirect(
-      [String? method, Uri? url, bool? followLoops]);
-
-  /**
-   * Returns the client response headers.
-   *
-   * The client response headers are immutable.
-   */
-  HttpHeaders get headers;
-
-  /**
-   * Detach the underlying socket from the HTTP client. When the
-   * socket is detached the HTTP client will no longer perform any
-   * operations on it.
-   *
-   * This is normally used when a HTTP upgrade is negotiated and the
-   * communication should continue with a different protocol.
-   */
-  Future<Socket> detachSocket();
-
-  /**
-   * Cookies set by the server (from the 'set-cookie' header).
-   */
-  List<Cookie> get cookies;
-
-  /**
-   * Returns the certificate of the HTTPS server providing the response.
-   * Returns null if the connection is not a secure TLS or SSL connection.
-   */
-  X509Certificate? get certificate;
-
-  /**
-   * Gets information about the client connection. Returns `null` if the socket
-   * is not available.
-   */
-  HttpConnectionInfo? get connectionInfo;
-}
-
-/// Enum that specifies the compression state of the byte stream of an
-/// [HttpClientResponse].
-///
-/// The values herein allow callers to answer the following questions as they
-/// pertain to an [HttpClientResponse]:
-///
-///  * Can the value of the response's `Content-Length` HTTP header be trusted?
-///  * Does the caller need to manually decompress the response's byte stream?
-///
-/// This enum is accessed via the [HttpClientResponse.compressionState] value.
-@Since("2.4")
-enum HttpClientResponseCompressionState {
-  /// The body of the HTTP response was received and remains in an uncompressed
-  /// state.
-  ///
-  /// In this state, the value of the `Content-Length` HTTP header, if
-  /// specified (non-negative), should match the number of bytes produced by
-  /// the response's byte stream.
-  notCompressed,
-
-  /// The body of the HTTP response was originally compressed, but by virtue of
-  /// the [HttpClient.autoUncompress] configuration option, it has been
-  /// automatically uncompressed.
-  ///
-  /// HTTP headers are not modified, so when a response has been uncompressed
-  /// in this way, the value of the `Content-Length` HTTP header cannot be
-  /// trusted, as it will contain the compressed content length, whereas the
-  /// stream of bytes produced by the response will contain uncompressed bytes.
-  decompressed,
-
-  /// The body of the HTTP response contains compressed bytes.
-  ///
-  /// In this state, the value of the `Content-Length` HTTP header, if
-  /// specified (non-negative), should match the number of bytes produced by
-  /// the response's byte stream.
-  ///
-  /// If the caller wishes to manually uncompress the body of the response,
-  /// it should consult the value of the `Content-Encoding` HTTP header to see
-  /// what type of compression has been applied. See
-  /// <https://tools.ietf.org/html/rfc2616#section-14.11> for more information.
-  compressed,
-}
-
-abstract class HttpClientCredentials {}
-
-/**
- * Represents credentials for basic authentication.
- */
-abstract class HttpClientBasicCredentials extends HttpClientCredentials {
-  factory HttpClientBasicCredentials(String username, String password) =>
-      new _HttpClientBasicCredentials(username, password);
-}
-
-/**
- * Represents credentials for digest authentication. Digest
- * authentication is only supported for servers using the MD5
- * algorithm and quality of protection (qop) of either "none" or
- * "auth".
- */
-abstract class HttpClientDigestCredentials extends HttpClientCredentials {
-  factory HttpClientDigestCredentials(String username, String password) =>
-      new _HttpClientDigestCredentials(username, password);
-}
-
-/**
- * Information about an [HttpRequest], [HttpResponse], [HttpClientRequest], or
- * [HttpClientResponse] connection.
- */
-abstract class HttpConnectionInfo {
-  InternetAddress get remoteAddress;
-  int get remotePort;
-  int get localPort;
-}
-
-/**
- * Redirect information.
- */
-abstract class RedirectInfo {
-  /**
-   * Returns the status code used for the redirect.
-   */
-  int get statusCode;
-
-  /**
-   * Returns the method used for the redirect.
-   */
-  String get method;
-
-  /**
-   * Returns the location for the redirect.
-   */
-  Uri get location;
-}
-
-/**
- * When detaching a socket from either the [:HttpServer:] or the
- * [:HttpClient:] due to a HTTP connection upgrade there might be
- * unparsed data already read from the socket. This unparsed data
- * together with the detached socket is returned in an instance of
- * this class.
- */
-abstract class DetachedSocket {
-  Socket get socket;
-  List<int> get unparsedData;
-}
-
-class HttpException implements IOException {
-  final String message;
-  final Uri? uri;
-
-  const HttpException(this.message, {this.uri});
-
-  String toString() {
-    var b = new StringBuffer()..write('HttpException: ')..write(message);
-    var uri = this.uri;
-    if (uri != null) {
-      b.write(', uri = $uri');
-    }
-    return b.toString();
-  }
-}
-
-class RedirectException implements HttpException {
-  final String message;
-  final List<RedirectInfo> redirects;
-
-  const RedirectException(this.message, this.redirects);
-
-  String toString() => "RedirectException: $message";
-
-  Uri get uri => redirects.last.location;
-}
diff --git a/sdk_nnbd/lib/_http/http_date.dart b/sdk_nnbd/lib/_http/http_date.dart
deleted file mode 100644
index 5fd2f34..0000000
--- a/sdk_nnbd/lib/_http/http_date.dart
+++ /dev/null
@@ -1,352 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._http;
-
-/**
- * Utility functions for working with dates with HTTP specific date
- * formats.
- */
-class HttpDate {
-  // From RFC-2616 section "3.3.1 Full Date",
-  // http://tools.ietf.org/html/rfc2616#section-3.3.1
-  //
-  // HTTP-date    = rfc1123-date | rfc850-date | asctime-date
-  // rfc1123-date = wkday "," SP date1 SP time SP "GMT"
-  // rfc850-date  = weekday "," SP date2 SP time SP "GMT"
-  // asctime-date = wkday SP date3 SP time SP 4DIGIT
-  // date1        = 2DIGIT SP month SP 4DIGIT
-  //                ; day month year (e.g., 02 Jun 1982)
-  // date2        = 2DIGIT "-" month "-" 2DIGIT
-  //                ; day-month-year (e.g., 02-Jun-82)
-  // date3        = month SP ( 2DIGIT | ( SP 1DIGIT ))
-  //                ; month day (e.g., Jun  2)
-  // time         = 2DIGIT ":" 2DIGIT ":" 2DIGIT
-  //                ; 00:00:00 - 23:59:59
-  // wkday        = "Mon" | "Tue" | "Wed"
-  //              | "Thu" | "Fri" | "Sat" | "Sun"
-  // weekday      = "Monday" | "Tuesday" | "Wednesday"
-  //              | "Thursday" | "Friday" | "Saturday" | "Sunday"
-  // month        = "Jan" | "Feb" | "Mar" | "Apr"
-  //              | "May" | "Jun" | "Jul" | "Aug"
-  //              | "Sep" | "Oct" | "Nov" | "Dec"
-
-  /**
-   * Format a date according to
-   * [RFC-1123](http://tools.ietf.org/html/rfc1123 "RFC-1123"),
-   * e.g. `Thu, 1 Jan 1970 00:00:00 GMT`.
-   */
-  static String format(DateTime date) {
-    const List wkday = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
-    const List month = const [
-      "Jan",
-      "Feb",
-      "Mar",
-      "Apr",
-      "May",
-      "Jun",
-      "Jul",
-      "Aug",
-      "Sep",
-      "Oct",
-      "Nov",
-      "Dec"
-    ];
-
-    DateTime d = date.toUtc();
-    StringBuffer sb = new StringBuffer()
-      ..write(wkday[d.weekday - 1])
-      ..write(", ")
-      ..write(d.day <= 9 ? "0" : "")
-      ..write(d.day.toString())
-      ..write(" ")
-      ..write(month[d.month - 1])
-      ..write(" ")
-      ..write(d.year.toString())
-      ..write(d.hour <= 9 ? " 0" : " ")
-      ..write(d.hour.toString())
-      ..write(d.minute <= 9 ? ":0" : ":")
-      ..write(d.minute.toString())
-      ..write(d.second <= 9 ? ":0" : ":")
-      ..write(d.second.toString())
-      ..write(" GMT");
-    return sb.toString();
-  }
-
-  /**
-   * Parse a date string in either of the formats
-   * [RFC-1123](http://tools.ietf.org/html/rfc1123 "RFC-1123"),
-   * [RFC-850](http://tools.ietf.org/html/rfc850 "RFC-850") or
-   * ANSI C's asctime() format. These formats are listed here.
-   *
-   *     Thu, 1 Jan 1970 00:00:00 GMT
-   *     Thursday, 1-Jan-1970 00:00:00 GMT
-   *     Thu Jan  1 00:00:00 1970
-   *
-   * For more information see [RFC-2616 section
-   * 3.1.1](http://tools.ietf.org/html/rfc2616#section-3.3.1
-   * "RFC-2616 section 3.1.1").
-   */
-  static DateTime parse(String date) {
-    final int SP = 32;
-    const List wkdays = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
-    const List weekdays = const [
-      "Monday",
-      "Tuesday",
-      "Wednesday",
-      "Thursday",
-      "Friday",
-      "Saturday",
-      "Sunday"
-    ];
-    const List months = const [
-      "Jan",
-      "Feb",
-      "Mar",
-      "Apr",
-      "May",
-      "Jun",
-      "Jul",
-      "Aug",
-      "Sep",
-      "Oct",
-      "Nov",
-      "Dec"
-    ];
-
-    final int formatRfc1123 = 0;
-    final int formatRfc850 = 1;
-    final int formatAsctime = 2;
-
-    int index = 0;
-    String tmp;
-
-    void expect(String s) {
-      if (date.length - index < s.length) {
-        throw new HttpException("Invalid HTTP date $date");
-      }
-      String tmp = date.substring(index, index + s.length);
-      if (tmp != s) {
-        throw new HttpException("Invalid HTTP date $date");
-      }
-      index += s.length;
-    }
-
-    int expectWeekday() {
-      int weekday;
-      // The formatting of the weekday signals the format of the date string.
-      int pos = date.indexOf(",", index);
-      if (pos == -1) {
-        int pos = date.indexOf(" ", index);
-        if (pos == -1) throw new HttpException("Invalid HTTP date $date");
-        tmp = date.substring(index, pos);
-        index = pos + 1;
-        weekday = wkdays.indexOf(tmp);
-        if (weekday != -1) {
-          return formatAsctime;
-        }
-      } else {
-        tmp = date.substring(index, pos);
-        index = pos + 1;
-        weekday = wkdays.indexOf(tmp);
-        if (weekday != -1) {
-          return formatRfc1123;
-        }
-        weekday = weekdays.indexOf(tmp);
-        if (weekday != -1) {
-          return formatRfc850;
-        }
-      }
-      throw new HttpException("Invalid HTTP date $date");
-    }
-
-    int expectMonth(String separator) {
-      int pos = date.indexOf(separator, index);
-      if (pos - index != 3) throw new HttpException("Invalid HTTP date $date");
-      tmp = date.substring(index, pos);
-      index = pos + 1;
-      int month = months.indexOf(tmp);
-      if (month != -1) return month;
-      throw new HttpException("Invalid HTTP date $date");
-    }
-
-    int expectNum(String separator) {
-      int pos;
-      if (separator.length > 0) {
-        pos = date.indexOf(separator, index);
-      } else {
-        pos = date.length;
-      }
-      String tmp = date.substring(index, pos);
-      index = pos + separator.length;
-      try {
-        int value = int.parse(tmp);
-        return value;
-      } on FormatException {
-        throw new HttpException("Invalid HTTP date $date");
-      }
-    }
-
-    void expectEnd() {
-      if (index != date.length) {
-        throw new HttpException("Invalid HTTP date $date");
-      }
-    }
-
-    int format = expectWeekday();
-    int year;
-    int month;
-    int day;
-    int hours;
-    int minutes;
-    int seconds;
-    if (format == formatAsctime) {
-      month = expectMonth(" ");
-      if (date.codeUnitAt(index) == SP) index++;
-      day = expectNum(" ");
-      hours = expectNum(":");
-      minutes = expectNum(":");
-      seconds = expectNum(" ");
-      year = expectNum("");
-    } else {
-      expect(" ");
-      day = expectNum(format == formatRfc1123 ? " " : "-");
-      month = expectMonth(format == formatRfc1123 ? " " : "-");
-      year = expectNum(" ");
-      hours = expectNum(":");
-      minutes = expectNum(":");
-      seconds = expectNum(" ");
-      expect("GMT");
-    }
-    expectEnd();
-    return new DateTime.utc(year, month + 1, day, hours, minutes, seconds, 0);
-  }
-
-  // Parse a cookie date string.
-  static DateTime _parseCookieDate(String date) {
-    const List monthsLowerCase = const [
-      "jan",
-      "feb",
-      "mar",
-      "apr",
-      "may",
-      "jun",
-      "jul",
-      "aug",
-      "sep",
-      "oct",
-      "nov",
-      "dec"
-    ];
-
-    int position = 0;
-
-    Never error() {
-      throw new HttpException("Invalid cookie date $date");
-    }
-
-    bool isEnd() => position == date.length;
-
-    bool isDelimiter(String s) {
-      int char = s.codeUnitAt(0);
-      if (char == 0x09) return true;
-      if (char >= 0x20 && char <= 0x2F) return true;
-      if (char >= 0x3B && char <= 0x40) return true;
-      if (char >= 0x5B && char <= 0x60) return true;
-      if (char >= 0x7B && char <= 0x7E) return true;
-      return false;
-    }
-
-    bool isNonDelimiter(String s) {
-      int char = s.codeUnitAt(0);
-      if (char >= 0x00 && char <= 0x08) return true;
-      if (char >= 0x0A && char <= 0x1F) return true;
-      if (char >= 0x30 && char <= 0x39) return true; // Digit
-      if (char == 0x3A) return true; // ':'
-      if (char >= 0x41 && char <= 0x5A) return true; // Alpha
-      if (char >= 0x61 && char <= 0x7A) return true; // Alpha
-      if (char >= 0x7F && char <= 0xFF) return true; // Alpha
-      return false;
-    }
-
-    bool isDigit(String s) {
-      int char = s.codeUnitAt(0);
-      if (char > 0x2F && char < 0x3A) return true;
-      return false;
-    }
-
-    int getMonth(String month) {
-      if (month.length < 3) return -1;
-      return monthsLowerCase.indexOf(month.substring(0, 3));
-    }
-
-    int toInt(String s) {
-      int index = 0;
-      for (; index < s.length && isDigit(s[index]); index++);
-      return int.parse(s.substring(0, index));
-    }
-
-    var tokens = [];
-    while (!isEnd()) {
-      while (!isEnd() && isDelimiter(date[position])) position++;
-      int start = position;
-      while (!isEnd() && isNonDelimiter(date[position])) position++;
-      tokens.add(date.substring(start, position).toLowerCase());
-      while (!isEnd() && isDelimiter(date[position])) position++;
-    }
-
-    String? timeStr;
-    String? dayOfMonthStr;
-    String? monthStr;
-    String? yearStr;
-
-    for (var token in tokens) {
-      if (token.length < 1) continue;
-      if (timeStr == null &&
-          token.length >= 5 &&
-          isDigit(token[0]) &&
-          (token[1] == ":" || (isDigit(token[1]) && token[2] == ":"))) {
-        timeStr = token;
-      } else if (dayOfMonthStr == null && isDigit(token[0])) {
-        dayOfMonthStr = token;
-      } else if (monthStr == null && getMonth(token) >= 0) {
-        monthStr = token;
-      } else if (yearStr == null &&
-          token.length >= 2 &&
-          isDigit(token[0]) &&
-          isDigit(token[1])) {
-        yearStr = token;
-      }
-    }
-
-    if (timeStr == null ||
-        dayOfMonthStr == null ||
-        monthStr == null ||
-        yearStr == null) {
-      error();
-    }
-
-    int year = toInt(yearStr);
-    if (year >= 70 && year <= 99)
-      year += 1900;
-    else if (year >= 0 && year <= 69) year += 2000;
-    if (year < 1601) error();
-
-    int dayOfMonth = toInt(dayOfMonthStr);
-    if (dayOfMonth < 1 || dayOfMonth > 31) error();
-
-    int month = getMonth(monthStr) + 1;
-
-    var timeList = timeStr.split(":");
-    if (timeList.length != 3) error();
-    int hour = toInt(timeList[0]);
-    int minute = toInt(timeList[1]);
-    int second = toInt(timeList[2]);
-    if (hour > 23) error();
-    if (minute > 59) error();
-    if (second > 59) error();
-
-    return new DateTime.utc(year, month, dayOfMonth, hour, minute, second, 0);
-  }
-}
diff --git a/sdk_nnbd/lib/_http/http_headers.dart b/sdk_nnbd/lib/_http/http_headers.dart
deleted file mode 100644
index ae8b482..0000000
--- a/sdk_nnbd/lib/_http/http_headers.dart
+++ /dev/null
@@ -1,1105 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._http;
-
-class _HttpHeaders implements HttpHeaders {
-  final Map<String, List<String>> _headers;
-  // The original header names keyed by the lowercase header names.
-  Map<String, String>? _originalHeaderNames;
-  final String protocolVersion;
-
-  bool _mutable = true; // Are the headers currently mutable?
-  List<String>? _noFoldingHeaders;
-
-  int _contentLength = -1;
-  bool _persistentConnection = true;
-  bool _chunkedTransferEncoding = false;
-  String? _host;
-  int? _port;
-
-  final int _defaultPortForScheme;
-
-  _HttpHeaders(this.protocolVersion,
-      {int defaultPortForScheme = HttpClient.defaultHttpPort,
-      _HttpHeaders? initialHeaders})
-      : _headers = new HashMap<String, List<String>>(),
-        _defaultPortForScheme = defaultPortForScheme {
-    if (initialHeaders != null) {
-      initialHeaders._headers.forEach((name, value) => _headers[name] = value);
-      _contentLength = initialHeaders._contentLength;
-      _persistentConnection = initialHeaders._persistentConnection;
-      _chunkedTransferEncoding = initialHeaders._chunkedTransferEncoding;
-      _host = initialHeaders._host;
-      _port = initialHeaders._port;
-    }
-    if (protocolVersion == "1.0") {
-      _persistentConnection = false;
-      _chunkedTransferEncoding = false;
-    }
-  }
-
-  List<String>? operator [](String name) => _headers[_validateField(name)];
-
-  String? value(String name) {
-    name = _validateField(name);
-    List<String>? values = _headers[name];
-    if (values == null) return null;
-    assert(values.isNotEmpty);
-    if (values.length > 1) {
-      throw new HttpException("More than one value for header $name");
-    }
-    return values[0];
-  }
-
-  void add(String name, value, {bool preserveHeaderCase = false}) {
-    _checkMutable();
-    String lowercaseName = _validateField(name);
-
-    if (preserveHeaderCase && name != lowercaseName) {
-      (_originalHeaderNames ??= {})[lowercaseName] = name;
-    } else {
-      _originalHeaderNames?.remove(lowercaseName);
-    }
-    _addAll(lowercaseName, value);
-  }
-
-  void _addAll(String name, value) {
-    if (value is Iterable) {
-      for (var v in value) {
-        _add(name, _validateValue(v));
-      }
-    } else {
-      _add(name, _validateValue(value));
-    }
-  }
-
-  void set(String name, Object value, {bool preserveHeaderCase = false}) {
-    _checkMutable();
-    String lowercaseName = _validateField(name);
-    _headers.remove(lowercaseName);
-    _originalHeaderNames?.remove(lowercaseName);
-    if (lowercaseName == HttpHeaders.transferEncodingHeader) {
-      _chunkedTransferEncoding = false;
-    }
-    if (preserveHeaderCase && name != lowercaseName) {
-      (_originalHeaderNames ??= {})[lowercaseName] = name;
-    }
-    _addAll(lowercaseName, value);
-  }
-
-  void remove(String name, Object value) {
-    _checkMutable();
-    name = _validateField(name);
-    value = _validateValue(value);
-    List<String>? values = _headers[name];
-    if (values != null) {
-      values.remove(_valueToString(value));
-      if (values.length == 0) {
-        _headers.remove(name);
-        _originalHeaderNames?.remove(name);
-      }
-    }
-    if (name == HttpHeaders.transferEncodingHeader && value == "chunked") {
-      _chunkedTransferEncoding = false;
-    }
-  }
-
-  void removeAll(String name) {
-    _checkMutable();
-    name = _validateField(name);
-    _headers.remove(name);
-    _originalHeaderNames?.remove(name);
-  }
-
-  void forEach(void action(String name, List<String> values)) {
-    _headers.forEach((String name, List<String> values) {
-      String originalName = _originalHeaderName(name);
-      action(originalName, values);
-    });
-  }
-
-  void noFolding(String name) {
-    name = _validateField(name);
-    (_noFoldingHeaders ??= <String>[]).add(name);
-  }
-
-  bool get persistentConnection => _persistentConnection;
-
-  void set persistentConnection(bool persistentConnection) {
-    _checkMutable();
-    if (persistentConnection == _persistentConnection) return;
-    final originalName = _originalHeaderName(HttpHeaders.connectionHeader);
-    if (persistentConnection) {
-      if (protocolVersion == "1.1") {
-        remove(HttpHeaders.connectionHeader, "close");
-      } else {
-        if (_contentLength < 0) {
-          throw new HttpException(
-              "Trying to set 'Connection: Keep-Alive' on HTTP 1.0 headers with "
-              "no ContentLength");
-        }
-        add(originalName, "keep-alive", preserveHeaderCase: true);
-      }
-    } else {
-      if (protocolVersion == "1.1") {
-        add(originalName, "close", preserveHeaderCase: true);
-      } else {
-        remove(HttpHeaders.connectionHeader, "keep-alive");
-      }
-    }
-    _persistentConnection = persistentConnection;
-  }
-
-  int get contentLength => _contentLength;
-
-  void set contentLength(int contentLength) {
-    _checkMutable();
-    if (protocolVersion == "1.0" &&
-        persistentConnection &&
-        contentLength == -1) {
-      throw new HttpException(
-          "Trying to clear ContentLength on HTTP 1.0 headers with "
-          "'Connection: Keep-Alive' set");
-    }
-    if (_contentLength == contentLength) return;
-    _contentLength = contentLength;
-    if (_contentLength >= 0) {
-      if (chunkedTransferEncoding) chunkedTransferEncoding = false;
-      _set(HttpHeaders.contentLengthHeader, contentLength.toString());
-    } else {
-      _headers.remove(HttpHeaders.contentLengthHeader);
-      if (protocolVersion == "1.1") {
-        chunkedTransferEncoding = true;
-      }
-    }
-  }
-
-  bool get chunkedTransferEncoding => _chunkedTransferEncoding;
-
-  void set chunkedTransferEncoding(bool chunkedTransferEncoding) {
-    _checkMutable();
-    if (chunkedTransferEncoding && protocolVersion == "1.0") {
-      throw new HttpException(
-          "Trying to set 'Transfer-Encoding: Chunked' on HTTP 1.0 headers");
-    }
-    if (chunkedTransferEncoding == _chunkedTransferEncoding) return;
-    if (chunkedTransferEncoding) {
-      List<String>? values = _headers[HttpHeaders.transferEncodingHeader];
-      if (values == null || !values.contains("chunked")) {
-        // Headers does not specify chunked encoding - add it if set.
-        _addValue(HttpHeaders.transferEncodingHeader, "chunked");
-      }
-      contentLength = -1;
-    } else {
-      // Headers does specify chunked encoding - remove it if not set.
-      remove(HttpHeaders.transferEncodingHeader, "chunked");
-    }
-    _chunkedTransferEncoding = chunkedTransferEncoding;
-  }
-
-  String? get host => _host;
-
-  void set host(String? host) {
-    _checkMutable();
-    _host = host;
-    _updateHostHeader();
-  }
-
-  int? get port => _port;
-
-  void set port(int? port) {
-    _checkMutable();
-    _port = port;
-    _updateHostHeader();
-  }
-
-  DateTime? get ifModifiedSince {
-    List<String>? values = _headers[HttpHeaders.ifModifiedSinceHeader];
-    if (values != null) {
-      assert(values.isNotEmpty);
-      try {
-        return HttpDate.parse(values[0]);
-      } on Exception {
-        return null;
-      }
-    }
-    return null;
-  }
-
-  void set ifModifiedSince(DateTime? ifModifiedSince) {
-    _checkMutable();
-    if (ifModifiedSince == null) {
-      _headers.remove(HttpHeaders.ifModifiedSinceHeader);
-    } else {
-      // Format "ifModifiedSince" header with date in Greenwich Mean Time (GMT).
-      String formatted = HttpDate.format(ifModifiedSince.toUtc());
-      _set(HttpHeaders.ifModifiedSinceHeader, formatted);
-    }
-  }
-
-  DateTime? get date {
-    List<String>? values = _headers[HttpHeaders.dateHeader];
-    if (values != null) {
-      assert(values.isNotEmpty);
-      try {
-        return HttpDate.parse(values[0]);
-      } on Exception {
-        return null;
-      }
-    }
-    return null;
-  }
-
-  void set date(DateTime? date) {
-    _checkMutable();
-    if (date == null) {
-      _headers.remove(HttpHeaders.dateHeader);
-    } else {
-      // Format "DateTime" header with date in Greenwich Mean Time (GMT).
-      String formatted = HttpDate.format(date.toUtc());
-      _set(HttpHeaders.dateHeader, formatted);
-    }
-  }
-
-  DateTime? get expires {
-    List<String>? values = _headers[HttpHeaders.expiresHeader];
-    if (values != null) {
-      assert(values.isNotEmpty);
-      try {
-        return HttpDate.parse(values[0]);
-      } on Exception {
-        return null;
-      }
-    }
-    return null;
-  }
-
-  void set expires(DateTime? expires) {
-    _checkMutable();
-    if (expires == null) {
-      _headers.remove(HttpHeaders.expiresHeader);
-    } else {
-      // Format "Expires" header with date in Greenwich Mean Time (GMT).
-      String formatted = HttpDate.format(expires.toUtc());
-      _set(HttpHeaders.expiresHeader, formatted);
-    }
-  }
-
-  ContentType? get contentType {
-    var values = _headers[HttpHeaders.contentTypeHeader];
-    if (values != null) {
-      return ContentType.parse(values[0]);
-    } else {
-      return null;
-    }
-  }
-
-  void set contentType(ContentType? contentType) {
-    _checkMutable();
-    if (contentType == null) {
-      _headers.remove(HttpHeaders.contentTypeHeader);
-    } else {
-      _set(HttpHeaders.contentTypeHeader, contentType.toString());
-    }
-  }
-
-  void clear() {
-    _checkMutable();
-    _headers.clear();
-    _contentLength = -1;
-    _persistentConnection = true;
-    _chunkedTransferEncoding = false;
-    _host = null;
-    _port = null;
-  }
-
-  // [name] must be a lower-case version of the name.
-  void _add(String name, value) {
-    assert(name == _validateField(name));
-    // Use the length as index on what method to call. This is notable
-    // faster than computing hash and looking up in a hash-map.
-    switch (name.length) {
-      case 4:
-        if (HttpHeaders.dateHeader == name) {
-          _addDate(name, value);
-          return;
-        }
-        if (HttpHeaders.hostHeader == name) {
-          _addHost(name, value);
-          return;
-        }
-        break;
-      case 7:
-        if (HttpHeaders.expiresHeader == name) {
-          _addExpires(name, value);
-          return;
-        }
-        break;
-      case 10:
-        if (HttpHeaders.connectionHeader == name) {
-          _addConnection(name, value);
-          return;
-        }
-        break;
-      case 12:
-        if (HttpHeaders.contentTypeHeader == name) {
-          _addContentType(name, value);
-          return;
-        }
-        break;
-      case 14:
-        if (HttpHeaders.contentLengthHeader == name) {
-          _addContentLength(name, value);
-          return;
-        }
-        break;
-      case 17:
-        if (HttpHeaders.transferEncodingHeader == name) {
-          _addTransferEncoding(name, value);
-          return;
-        }
-        if (HttpHeaders.ifModifiedSinceHeader == name) {
-          _addIfModifiedSince(name, value);
-          return;
-        }
-    }
-    _addValue(name, value);
-  }
-
-  void _addContentLength(String name, value) {
-    if (value is int) {
-      contentLength = value;
-    } else if (value is String) {
-      contentLength = int.parse(value);
-    } else {
-      throw new HttpException("Unexpected type for header named $name");
-    }
-  }
-
-  void _addTransferEncoding(String name, value) {
-    if (value == "chunked") {
-      chunkedTransferEncoding = true;
-    } else {
-      _addValue(HttpHeaders.transferEncodingHeader, value);
-    }
-  }
-
-  void _addDate(String name, value) {
-    if (value is DateTime) {
-      date = value;
-    } else if (value is String) {
-      _set(HttpHeaders.dateHeader, value);
-    } else {
-      throw new HttpException("Unexpected type for header named $name");
-    }
-  }
-
-  void _addExpires(String name, value) {
-    if (value is DateTime) {
-      expires = value;
-    } else if (value is String) {
-      _set(HttpHeaders.expiresHeader, value);
-    } else {
-      throw new HttpException("Unexpected type for header named $name");
-    }
-  }
-
-  void _addIfModifiedSince(String name, value) {
-    if (value is DateTime) {
-      ifModifiedSince = value;
-    } else if (value is String) {
-      _set(HttpHeaders.ifModifiedSinceHeader, value);
-    } else {
-      throw new HttpException("Unexpected type for header named $name");
-    }
-  }
-
-  void _addHost(String name, value) {
-    if (value is String) {
-      int pos = value.indexOf(":");
-      if (pos == -1) {
-        _host = value;
-        _port = HttpClient.defaultHttpPort;
-      } else {
-        if (pos > 0) {
-          _host = value.substring(0, pos);
-        } else {
-          _host = null;
-        }
-        if (pos + 1 == value.length) {
-          _port = HttpClient.defaultHttpPort;
-        } else {
-          try {
-            _port = int.parse(value.substring(pos + 1));
-          } on FormatException {
-            _port = null;
-          }
-        }
-      }
-      _set(HttpHeaders.hostHeader, value);
-    } else {
-      throw new HttpException("Unexpected type for header named $name");
-    }
-  }
-
-  void _addConnection(String name, value) {
-    var lowerCaseValue = value.toLowerCase();
-    if (lowerCaseValue == 'close') {
-      _persistentConnection = false;
-    } else if (lowerCaseValue == 'keep-alive') {
-      _persistentConnection = true;
-    }
-    _addValue(name, value);
-  }
-
-  void _addContentType(String name, value) {
-    _set(HttpHeaders.contentTypeHeader, value);
-  }
-
-  void _addValue(String name, Object value) {
-    List<String> values = (_headers[name] ??= <String>[]);
-    values.add(_valueToString(value));
-  }
-
-  String _valueToString(Object value) {
-    if (value is DateTime) {
-      return HttpDate.format(value);
-    } else if (value is String) {
-      return value; // TODO(39784): no _validateValue?
-    } else {
-      return _validateValue(value.toString()) as String;
-    }
-  }
-
-  void _set(String name, String value) {
-    assert(name == _validateField(name));
-    _headers[name] = <String>[value];
-  }
-
-  void _checkMutable() {
-    if (!_mutable) throw new HttpException("HTTP headers are not mutable");
-  }
-
-  void _updateHostHeader() {
-    var host = _host;
-    if (host != null) {
-      bool defaultPort = _port == null || _port == _defaultPortForScheme;
-      _set("host", defaultPort ? host : "$host:$_port");
-    }
-  }
-
-  bool _foldHeader(String name) {
-    if (name == HttpHeaders.setCookieHeader) return false;
-    var noFoldingHeaders = _noFoldingHeaders;
-    return noFoldingHeaders == null || !noFoldingHeaders.contains(name);
-  }
-
-  void _finalize() {
-    _mutable = false;
-  }
-
-  void _build(BytesBuilder builder) {
-    _headers.forEach((String name, List<String> values) {
-      String originalName = _originalHeaderName(name);
-      bool fold = _foldHeader(name);
-      var nameData = originalName.codeUnits;
-      builder.add(nameData);
-      builder.addByte(_CharCode.COLON);
-      builder.addByte(_CharCode.SP);
-      for (int i = 0; i < values.length; i++) {
-        if (i > 0) {
-          if (fold) {
-            builder.addByte(_CharCode.COMMA);
-            builder.addByte(_CharCode.SP);
-          } else {
-            builder.addByte(_CharCode.CR);
-            builder.addByte(_CharCode.LF);
-            builder.add(nameData);
-            builder.addByte(_CharCode.COLON);
-            builder.addByte(_CharCode.SP);
-          }
-        }
-        builder.add(values[i].codeUnits);
-      }
-      builder.addByte(_CharCode.CR);
-      builder.addByte(_CharCode.LF);
-    });
-  }
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    _headers.forEach((String name, List<String> values) {
-      String originalName = _originalHeaderName(name);
-      sb..write(originalName)..write(": ");
-      bool fold = _foldHeader(name);
-      for (int i = 0; i < values.length; i++) {
-        if (i > 0) {
-          if (fold) {
-            sb.write(", ");
-          } else {
-            sb..write("\n")..write(originalName)..write(": ");
-          }
-        }
-        sb.write(values[i]);
-      }
-      sb.write("\n");
-    });
-    return sb.toString();
-  }
-
-  List<Cookie> _parseCookies() {
-    // Parse a Cookie header value according to the rules in RFC 6265.
-    var cookies = <Cookie>[];
-    void parseCookieString(String s) {
-      int index = 0;
-
-      bool done() => index == -1 || index == s.length;
-
-      void skipWS() {
-        while (!done()) {
-          if (s[index] != " " && s[index] != "\t") return;
-          index++;
-        }
-      }
-
-      String parseName() {
-        int start = index;
-        while (!done()) {
-          if (s[index] == " " || s[index] == "\t" || s[index] == "=") break;
-          index++;
-        }
-        return s.substring(start, index);
-      }
-
-      String parseValue() {
-        int start = index;
-        while (!done()) {
-          if (s[index] == " " || s[index] == "\t" || s[index] == ";") break;
-          index++;
-        }
-        return s.substring(start, index);
-      }
-
-      bool expect(String expected) {
-        if (done()) return false;
-        if (s[index] != expected) return false;
-        index++;
-        return true;
-      }
-
-      while (!done()) {
-        skipWS();
-        if (done()) return;
-        String name = parseName();
-        skipWS();
-        if (!expect("=")) {
-          index = s.indexOf(';', index);
-          continue;
-        }
-        skipWS();
-        String value = parseValue();
-        try {
-          cookies.add(new _Cookie(name, value));
-        } catch (_) {
-          // Skip it, invalid cookie data.
-        }
-        skipWS();
-        if (done()) return;
-        if (!expect(";")) {
-          index = s.indexOf(';', index);
-          continue;
-        }
-      }
-    }
-
-    List<String>? values = _headers[HttpHeaders.cookieHeader];
-    if (values != null) {
-      values.forEach((headerValue) => parseCookieString(headerValue));
-    }
-    return cookies;
-  }
-
-  static String _validateField(String field) {
-    for (var i = 0; i < field.length; i++) {
-      if (!_HttpParser._isTokenChar(field.codeUnitAt(i))) {
-        throw new FormatException(
-            "Invalid HTTP header field name: ${json.encode(field)}", field, i);
-      }
-    }
-    return field.toLowerCase();
-  }
-
-  static Object _validateValue(Object value) {
-    if (value is! String) return value;
-    for (var i = 0; i < (value as String).length; i++) {
-      if (!_HttpParser._isValueChar((value as String).codeUnitAt(i))) {
-        throw new FormatException(
-            "Invalid HTTP header field value: ${json.encode(value)}", value, i);
-      }
-    }
-    return value;
-  }
-
-  String _originalHeaderName(String name) {
-    // TODO: Update syntax to_originalHeaderNames?[name].
-    return _originalHeaderNames?.[name] ?? name;
-  }
-}
-
-class _HeaderValue implements HeaderValue {
-  String _value;
-  Map<String, String?>? _parameters;
-  Map<String, String?>? _unmodifiableParameters;
-
-  _HeaderValue([this._value = "", Map<String, String?> parameters = const {}]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    Map<String, String?>? nullableParameters = parameters;
-    if (nullableParameters != null && nullableParameters.isNotEmpty) {
-      _parameters = new HashMap<String, String?>.from(nullableParameters);
-    }
-  }
-
-  static _HeaderValue parse(String value,
-      {String parameterSeparator = ";",
-      String? valueSeparator,
-      bool preserveBackslash = false}) {
-    // Parse the string.
-    var result = new _HeaderValue();
-    result._parse(value, parameterSeparator, valueSeparator, preserveBackslash);
-    return result;
-  }
-
-  String get value => _value;
-
-  Map<String, String?> _ensureParameters() =>
-      _parameters ??= <String, String?>{};
-
-  Map<String, String?> get parameters =>
-      _unmodifiableParameters ??= UnmodifiableMapView(_ensureParameters());
-
-  static bool _isToken(String token) {
-    if (token.isEmpty) {
-      return false;
-    }
-    final delimiters = "\"(),/:;<=>?@[\]{}";
-    for (int i = 0; i < token.length; i++) {
-      int codeUnit = token.codeUnitAt(i);
-      if (codeUnit <= 32 ||
-          codeUnit >= 127 ||
-          delimiters.indexOf(token[i]) >= 0) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write(_value);
-    var parameters = this._parameters;
-    if (parameters != null && parameters.length > 0) {
-      parameters.forEach((String name, String? value) {
-        sb..write("; ")..write(name);
-        if (value != null) {
-          sb.write("=");
-          if (_isToken(value)) {
-            sb.write(value);
-          } else {
-            sb.write('"');
-            int start = 0;
-            for (int i = 0; i < value.length; i++) {
-              // Can use codeUnitAt here instead.
-              int codeUnit = value.codeUnitAt(i);
-              if (codeUnit == 92 /* backslash */ ||
-                  codeUnit == 34 /* double quote */) {
-                sb.write(value.substring(start, i));
-                sb.write(r'\');
-                start = i;
-              }
-            }
-            sb..write(value.substring(start))..write('"');
-          }
-        }
-      });
-    }
-    return sb.toString();
-  }
-
-  void _parse(String s, String parameterSeparator, String? valueSeparator,
-      bool preserveBackslash) {
-    int index = 0;
-
-    bool done() => index == s.length;
-
-    void skipWS() {
-      while (!done()) {
-        if (s[index] != " " && s[index] != "\t") return;
-        index++;
-      }
-    }
-
-    String parseValue() {
-      int start = index;
-      while (!done()) {
-        var char = s[index];
-        if (char == " " ||
-            char == "\t" ||
-            char == valueSeparator ||
-            char == parameterSeparator) break;
-        index++;
-      }
-      return s.substring(start, index);
-    }
-
-    void expect(String expected) {
-      if (done() || s[index] != expected) {
-        throw new HttpException("Failed to parse header value");
-      }
-      index++;
-    }
-
-    bool maybeExpect(String expected) {
-      if (done() || !s.startsWith(expected, index)) {
-        return false;
-      }
-      index++;
-      return true;
-    }
-
-    void parseParameters() {
-      var parameters = _ensureParameters();
-
-      String parseParameterName() {
-        int start = index;
-        while (!done()) {
-          var char = s[index];
-          if (char == " " ||
-              char == "\t" ||
-              char == "=" ||
-              char == parameterSeparator ||
-              char == valueSeparator) break;
-          index++;
-        }
-        return s.substring(start, index).toLowerCase();
-      }
-
-      String parseParameterValue() {
-        if (!done() && s[index] == "\"") {
-          // Parse quoted value.
-          StringBuffer sb = new StringBuffer();
-          index++;
-          while (!done()) {
-            var char = s[index];
-            if (char == "\\") {
-              if (index + 1 == s.length) {
-                throw new HttpException("Failed to parse header value");
-              }
-              if (preserveBackslash && s[index + 1] != "\"") {
-                sb.write(char);
-              }
-              index++;
-            } else if (char == "\"") {
-              index++;
-              return sb.toString();
-            }
-            char = s[index];
-            sb.write(char);
-            index++;
-          }
-          throw new HttpException("Failed to parse header value");
-        } else {
-          // Parse non-quoted value.
-          return parseValue();
-        }
-      }
-
-      while (!done()) {
-        skipWS();
-        if (done()) return;
-        String name = parseParameterName();
-        skipWS();
-        if (maybeExpect("=")) {
-          skipWS();
-          String value = parseParameterValue();
-          if (name == 'charset' && this is _ContentType) {
-            // Charset parameter of ContentTypes are always lower-case.
-            value = value.toLowerCase();
-          }
-          parameters[name] = value;
-          skipWS();
-        } else if (name.isNotEmpty) {
-          parameters[name] = null;
-        }
-        if (done()) return;
-        // TODO: Implement support for multi-valued parameters.
-        if (s[index] == valueSeparator) return;
-        expect(parameterSeparator);
-      }
-    }
-
-    skipWS();
-    _value = parseValue();
-    skipWS();
-    if (done()) return;
-    if (s[index] == valueSeparator) return;
-    maybeExpect(parameterSeparator);
-    parseParameters();
-  }
-}
-
-class _ContentType extends _HeaderValue implements ContentType {
-  String _primaryType = "";
-  String _subType = "";
-
-  _ContentType(String primaryType, String subType, String? charset,
-      Map<String, String?> parameters)
-      : _primaryType = primaryType,
-        _subType = subType,
-        super("") {
-    // TODO(40614): Remove once non-nullability is sound.
-    String emptyIfNull(String? string) => string ?? "";
-    _primaryType = emptyIfNull(_primaryType);
-    _subType = emptyIfNull(_subType);
-    _value = "$_primaryType/$_subType";
-    // TODO(40614): Remove once non-nullability is sound.
-    Map<String, String?>? nullableParameters = parameters;
-    if (nullableParameters != null) {
-      var parameterMap = _ensureParameters();
-      nullableParameters.forEach((String key, String? value) {
-        String lowerCaseKey = key.toLowerCase();
-        if (lowerCaseKey == "charset") {
-          value = value?.toLowerCase();
-        }
-        parameterMap[lowerCaseKey] = value;
-      });
-    }
-    if (charset != null) {
-      _ensureParameters()["charset"] = charset.toLowerCase();
-    }
-  }
-
-  _ContentType._();
-
-  static _ContentType parse(String value) {
-    var result = new _ContentType._();
-    result._parse(value, ";", null, false);
-    int index = result._value.indexOf("/");
-    if (index == -1 || index == (result._value.length - 1)) {
-      result._primaryType = result._value.trim().toLowerCase();
-    } else {
-      result._primaryType =
-          result._value.substring(0, index).trim().toLowerCase();
-      result._subType = result._value.substring(index + 1).trim().toLowerCase();
-    }
-    return result;
-  }
-
-  String get mimeType => '$primaryType/$subType';
-
-  String get primaryType => _primaryType;
-
-  String get subType => _subType;
-
-  String? get charset => parameters["charset"];
-}
-
-class _Cookie implements Cookie {
-  String _name;
-  String _value;
-  DateTime? expires;
-  int? maxAge;
-  String? domain;
-  String? path;
-  bool httpOnly = false;
-  bool secure = false;
-
-  _Cookie(String name, String value)
-      : _name = _validateName(name),
-        _value = _validateValue(value),
-        httpOnly = true;
-
-  String get name => _name;
-  String get value => _value;
-
-  set name(String newName) {
-    _validateName(newName);
-    _name = newName;
-  }
-
-  set value(String newValue) {
-    _validateValue(newValue);
-    _value = newValue;
-  }
-
-  _Cookie.fromSetCookieValue(String value)
-      : _name = "",
-        _value = "" {
-    // Parse the 'set-cookie' header value.
-    _parseSetCookieValue(value);
-  }
-
-  // Parse a 'set-cookie' header value according to the rules in RFC 6265.
-  void _parseSetCookieValue(String s) {
-    int index = 0;
-
-    bool done() => index == s.length;
-
-    String parseName() {
-      int start = index;
-      while (!done()) {
-        if (s[index] == "=") break;
-        index++;
-      }
-      return s.substring(start, index).trim();
-    }
-
-    String parseValue() {
-      int start = index;
-      while (!done()) {
-        if (s[index] == ";") break;
-        index++;
-      }
-      return s.substring(start, index).trim();
-    }
-
-    void parseAttributes() {
-      String parseAttributeName() {
-        int start = index;
-        while (!done()) {
-          if (s[index] == "=" || s[index] == ";") break;
-          index++;
-        }
-        return s.substring(start, index).trim().toLowerCase();
-      }
-
-      String parseAttributeValue() {
-        int start = index;
-        while (!done()) {
-          if (s[index] == ";") break;
-          index++;
-        }
-        return s.substring(start, index).trim().toLowerCase();
-      }
-
-      while (!done()) {
-        String name = parseAttributeName();
-        String value = "";
-        if (!done() && s[index] == "=") {
-          index++; // Skip the = character.
-          value = parseAttributeValue();
-        }
-        if (name == "expires") {
-          expires = HttpDate._parseCookieDate(value);
-        } else if (name == "max-age") {
-          maxAge = int.parse(value);
-        } else if (name == "domain") {
-          domain = value;
-        } else if (name == "path") {
-          path = value;
-        } else if (name == "httponly") {
-          httpOnly = true;
-        } else if (name == "secure") {
-          secure = true;
-        }
-        if (!done()) index++; // Skip the ; character
-      }
-    }
-
-    _name = _validateName(parseName());
-    if (done() || _name.length == 0) {
-      throw new HttpException("Failed to parse header value [$s]");
-    }
-    index++; // Skip the = character.
-    _value = _validateValue(parseValue());
-    if (done()) return;
-    index++; // Skip the ; character.
-    parseAttributes();
-  }
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb..write(_name)..write("=")..write(_value);
-    var expires = this.expires;
-    if (expires != null) {
-      sb..write("; Expires=")..write(HttpDate.format(expires));
-    }
-    if (maxAge != null) {
-      sb..write("; Max-Age=")..write(maxAge);
-    }
-    if (domain != null) {
-      sb..write("; Domain=")..write(domain);
-    }
-    if (path != null) {
-      sb..write("; Path=")..write(path);
-    }
-    if (secure) sb.write("; Secure");
-    if (httpOnly) sb.write("; HttpOnly");
-    return sb.toString();
-  }
-
-  static String _validateName(String newName) {
-    const separators = const [
-      "(",
-      ")",
-      "<",
-      ">",
-      "@",
-      ",",
-      ";",
-      ":",
-      "\\",
-      '"',
-      "/",
-      "[",
-      "]",
-      "?",
-      "=",
-      "{",
-      "}"
-    ];
-    if (newName == null) throw new ArgumentError.notNull("name");
-    for (int i = 0; i < newName.length; i++) {
-      int codeUnit = newName.codeUnitAt(i);
-      if (codeUnit <= 32 ||
-          codeUnit >= 127 ||
-          separators.indexOf(newName[i]) >= 0) {
-        throw new FormatException(
-            "Invalid character in cookie name, code unit: '$codeUnit'",
-            newName,
-            i);
-      }
-    }
-    return newName;
-  }
-
-  static String _validateValue(String newValue) {
-    if (newValue == null) throw new ArgumentError.notNull("value");
-    // Per RFC 6265, consider surrounding "" as part of the value, but otherwise
-    // double quotes are not allowed.
-    int start = 0;
-    int end = newValue.length;
-    if (2 <= newValue.length &&
-        newValue.codeUnits[start] == 0x22 &&
-        newValue.codeUnits[end - 1] == 0x22) {
-      start++;
-      end--;
-    }
-
-    for (int i = start; i < end; i++) {
-      int codeUnit = newValue.codeUnits[i];
-      if (!(codeUnit == 0x21 ||
-          (codeUnit >= 0x23 && codeUnit <= 0x2B) ||
-          (codeUnit >= 0x2D && codeUnit <= 0x3A) ||
-          (codeUnit >= 0x3C && codeUnit <= 0x5B) ||
-          (codeUnit >= 0x5D && codeUnit <= 0x7E))) {
-        throw new FormatException(
-            "Invalid character in cookie value, code unit: '$codeUnit'",
-            newValue,
-            i);
-      }
-    }
-    return newValue;
-  }
-}
diff --git a/sdk_nnbd/lib/_http/http_impl.dart b/sdk_nnbd/lib/_http/http_impl.dart
deleted file mode 100644
index f949b53..0000000
--- a/sdk_nnbd/lib/_http/http_impl.dart
+++ /dev/null
@@ -1,3379 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._http;
-
-int _nextServiceId = 1;
-
-// TODO(ajohnsen): Use other way of getting a unique id.
-abstract class _ServiceObject {
-  int __serviceId = 0;
-  int get _serviceId {
-    if (__serviceId == 0) __serviceId = _nextServiceId++;
-    return __serviceId;
-  }
-
-  Map _toJSON(bool ref);
-
-  String get _servicePath => "$_serviceTypePath/$_serviceId";
-
-  String get _serviceTypePath;
-
-  String get _serviceTypeName;
-
-  String _serviceType(bool ref) {
-    if (ref) return "@$_serviceTypeName";
-    return _serviceTypeName;
-  }
-}
-
-class _CopyingBytesBuilder implements BytesBuilder {
-  // Start with 1024 bytes.
-  static const int _INIT_SIZE = 1024;
-
-  static final _emptyList = new Uint8List(0);
-
-  int _length = 0;
-  Uint8List _buffer;
-
-  _CopyingBytesBuilder([int initialCapacity = 0])
-      : _buffer = (initialCapacity <= 0)
-            ? _emptyList
-            : new Uint8List(_pow2roundup(initialCapacity));
-
-  void add(List<int> bytes) {
-    int bytesLength = bytes.length;
-    if (bytesLength == 0) return;
-    int required = _length + bytesLength;
-    if (_buffer.length < required) {
-      _grow(required);
-    }
-    assert(_buffer.length >= required);
-    if (bytes is Uint8List) {
-      _buffer.setRange(_length, required, bytes);
-    } else {
-      for (int i = 0; i < bytesLength; i++) {
-        _buffer[_length + i] = bytes[i];
-      }
-    }
-    _length = required;
-  }
-
-  void addByte(int byte) {
-    if (_buffer.length == _length) {
-      // The grow algorithm always at least doubles.
-      // If we added one to _length it would quadruple unnecessarily.
-      _grow(_length);
-    }
-    assert(_buffer.length > _length);
-    _buffer[_length] = byte;
-    _length++;
-  }
-
-  void _grow(int required) {
-    // We will create a list in the range of 2-4 times larger than
-    // required.
-    int newSize = required * 2;
-    if (newSize < _INIT_SIZE) {
-      newSize = _INIT_SIZE;
-    } else {
-      newSize = _pow2roundup(newSize);
-    }
-    var newBuffer = new Uint8List(newSize);
-    newBuffer.setRange(0, _buffer.length, _buffer);
-    _buffer = newBuffer;
-  }
-
-  Uint8List takeBytes() {
-    if (_length == 0) return _emptyList;
-    var buffer =
-        new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length);
-    clear();
-    return buffer;
-  }
-
-  Uint8List toBytes() {
-    if (_length == 0) return _emptyList;
-    return new Uint8List.fromList(
-        new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length));
-  }
-
-  int get length => _length;
-
-  bool get isEmpty => _length == 0;
-
-  bool get isNotEmpty => _length != 0;
-
-  void clear() {
-    _length = 0;
-    _buffer = _emptyList;
-  }
-
-  static int _pow2roundup(int x) {
-    assert(x > 0);
-    --x;
-    x |= x >> 1;
-    x |= x >> 2;
-    x |= x >> 4;
-    x |= x >> 8;
-    x |= x >> 16;
-    return x + 1;
-  }
-}
-
-const int _OUTGOING_BUFFER_SIZE = 8 * 1024;
-
-typedef void _BytesConsumer(List<int> bytes);
-
-class _HttpIncoming extends Stream<Uint8List> {
-  final int _transferLength;
-  final Completer _dataCompleter = new Completer();
-  Stream<Uint8List> _stream;
-
-  bool fullBodyRead = false;
-
-  // Common properties.
-  final _HttpHeaders headers;
-  bool upgraded = false;
-
-  // ClientResponse properties.
-  int? statusCode;
-  String? reasonPhrase;
-
-  // Request properties.
-  String? method;
-  Uri? uri;
-
-  bool hasSubscriber = false;
-
-  // The transfer length if the length of the message body as it
-  // appears in the message (RFC 2616 section 4.4). This can be -1 if
-  // the length of the massage body is not known due to transfer
-  // codings.
-  int get transferLength => _transferLength;
-
-  _HttpIncoming(this.headers, this._transferLength, this._stream);
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    hasSubscriber = true;
-    return _stream.handleError((error) {
-      throw new HttpException(error.message, uri: uri);
-    }).listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  // Is completed once all data have been received.
-  Future get dataDone => _dataCompleter.future;
-
-  void close(bool closing) {
-    fullBodyRead = true;
-    hasSubscriber = true;
-    _dataCompleter.complete(closing);
-  }
-}
-
-abstract class _HttpInboundMessageListInt extends Stream<List<int>> {
-  final _HttpIncoming _incoming;
-  List<Cookie>? _cookies;
-
-  _HttpInboundMessageListInt(this._incoming);
-
-  List<Cookie> get cookies => _cookies ??= headers._parseCookies();
-
-  _HttpHeaders get headers => _incoming.headers;
-  String get protocolVersion => headers.protocolVersion;
-  int get contentLength => headers.contentLength;
-  bool get persistentConnection => headers.persistentConnection;
-}
-
-abstract class _HttpInboundMessage extends Stream<Uint8List> {
-  final _HttpIncoming _incoming;
-  List<Cookie>? _cookies;
-
-  _HttpInboundMessage(this._incoming);
-
-  List<Cookie> get cookies => _cookies ??= headers._parseCookies();
-
-  _HttpHeaders get headers => _incoming.headers;
-  String get protocolVersion => headers.protocolVersion;
-  int get contentLength => headers.contentLength;
-  bool get persistentConnection => headers.persistentConnection;
-}
-
-class _HttpRequest extends _HttpInboundMessage implements HttpRequest {
-  final HttpResponse response;
-
-  final _HttpServer _httpServer;
-
-  final _HttpConnection _httpConnection;
-
-  _HttpSession? _session;
-
-  Uri? _requestedUri;
-
-  _HttpRequest(this.response, _HttpIncoming _incoming, this._httpServer,
-      this._httpConnection)
-      : super(_incoming) {
-    if (headers.protocolVersion == "1.1") {
-      response.headers
-        ..chunkedTransferEncoding = true
-        ..persistentConnection = headers.persistentConnection;
-    }
-
-    if (_httpServer._sessionManagerInstance != null) {
-      // Map to session if exists.
-      var sessionIds = cookies
-          .where((cookie) => cookie.name.toUpperCase() == _DART_SESSION_ID)
-          .map<String>((cookie) => cookie.value);
-      for (var sessionId in sessionIds) {
-        var session = _httpServer._sessionManager.getSession(sessionId);
-        _session = session;
-        if (session != null) {
-          session._markSeen();
-          break;
-        }
-      }
-    }
-  }
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _incoming.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Uri get uri => _incoming.uri!;
-
-  Uri get requestedUri {
-    var requestedUri = _requestedUri;
-    if (requestedUri != null) return requestedUri;
-    var proto = headers['x-forwarded-proto'];
-    var scheme = proto != null
-        ? proto.first
-        : _httpConnection._socket is SecureSocket ? "https" : "http";
-    var hostList = headers['x-forwarded-host'];
-    String host;
-    if (hostList != null) {
-      host = hostList.first;
-    } else {
-      hostList = headers[HttpHeaders.hostHeader];
-      if (hostList != null) {
-        host = hostList.first;
-      } else {
-        host = "${_httpServer.address.host}:${_httpServer.port}";
-      }
-    }
-    return _requestedUri = Uri.parse("$scheme://$host$uri");
-  }
-
-  String get method => _incoming.method!;
-
-  HttpSession get session {
-    var session = _session;
-    if (session != null && !session._destroyed) {
-      return session;
-    }
-    // Create session, store it in connection, and return.
-    return _session = _httpServer._sessionManager.createSession();
-  }
-
-  HttpConnectionInfo? get connectionInfo => _httpConnection.connectionInfo;
-
-  X509Certificate? get certificate {
-    var socket = _httpConnection._socket;
-    if (socket is SecureSocket) return socket.peerCertificate;
-    return null;
-  }
-}
-
-class _HttpClientResponse extends _HttpInboundMessageListInt
-    implements HttpClientResponse {
-  List<RedirectInfo> get redirects => _httpRequest._responseRedirects;
-
-  // The HttpClient this response belongs to.
-  final _HttpClient _httpClient;
-
-  // The HttpClientRequest of this response.
-  final _HttpClientRequest _httpRequest;
-
-  // The compression state of this response.
-  final HttpClientResponseCompressionState compressionState;
-
-  _HttpClientResponse(
-      _HttpIncoming _incoming, this._httpRequest, this._httpClient)
-      : compressionState = _getCompressionState(_httpClient, _incoming.headers),
-        super(_incoming) {
-    // Set uri for potential exceptions.
-    _incoming.uri = _httpRequest.uri;
-  }
-
-  static HttpClientResponseCompressionState _getCompressionState(
-      _HttpClient httpClient, _HttpHeaders headers) {
-    if (headers.value(HttpHeaders.contentEncodingHeader) == "gzip") {
-      return httpClient.autoUncompress
-          ? HttpClientResponseCompressionState.decompressed
-          : HttpClientResponseCompressionState.compressed;
-    } else {
-      return HttpClientResponseCompressionState.notCompressed;
-    }
-  }
-
-  int get statusCode => _incoming.statusCode!;
-  String get reasonPhrase => _incoming.reasonPhrase!;
-
-  X509Certificate? get certificate {
-    var socket = _httpRequest._httpClientConnection._socket;
-    if (socket is SecureSocket) return socket.peerCertificate;
-    return null;
-  }
-
-  List<Cookie> get cookies {
-    var cookies = _cookies;
-    if (cookies != null) return cookies;
-    cookies = <Cookie>[];
-    List<String>? values = headers[HttpHeaders.setCookieHeader];
-    if (values != null) {
-      for (var value in values) {
-        cookies.add(new Cookie.fromSetCookieValue(value));
-      }
-    }
-    _cookies = cookies;
-    return cookies;
-  }
-
-  bool get isRedirect {
-    if (_httpRequest.method == "GET" || _httpRequest.method == "HEAD") {
-      return statusCode == HttpStatus.movedPermanently ||
-          statusCode == HttpStatus.found ||
-          statusCode == HttpStatus.seeOther ||
-          statusCode == HttpStatus.temporaryRedirect;
-    } else if (_httpRequest.method == "POST") {
-      return statusCode == HttpStatus.seeOther;
-    }
-    return false;
-  }
-
-  Future<HttpClientResponse> redirect(
-      [String? method, Uri? url, bool? followLoops]) {
-    if (method == null) {
-      // Set method as defined by RFC 2616 section 10.3.4.
-      if (statusCode == HttpStatus.seeOther && _httpRequest.method == "POST") {
-        method = "GET";
-      } else {
-        method = _httpRequest.method;
-      }
-    }
-    if (url == null) {
-      String? location = headers.value(HttpHeaders.locationHeader);
-      if (location == null) {
-        throw new StateError("Response has no Location header for redirect");
-      }
-      url = Uri.parse(location);
-    }
-    if (followLoops != true) {
-      for (var redirect in redirects) {
-        if (redirect.location == url) {
-          return new Future.error(
-              new RedirectException("Redirect loop detected", redirects));
-        }
-      }
-    }
-    return _httpClient
-        ._openUrlFromRequest(method, url, _httpRequest)
-        .then((request) {
-      request._responseRedirects
-        ..addAll(this.redirects)
-        ..add(new _RedirectInfo(statusCode, method!, url!));
-      return request.close();
-    });
-  }
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    if (_incoming.upgraded) {
-      // If upgraded, the connection is already 'removed' form the client.
-      // Since listening to upgraded data is 'bogus', simply close and
-      // return empty stream subscription.
-      _httpRequest._httpClientConnection.destroy();
-      return new Stream<Uint8List>.empty().listen(null, onDone: onDone);
-    }
-    Stream<Uint8List> stream = _incoming;
-    if (compressionState == HttpClientResponseCompressionState.decompressed) {
-      stream = stream
-          .cast<List<int>>()
-          .transform(gzip.decoder)
-          .transform(const _ToUint8List());
-    }
-    return stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Future<Socket> detachSocket() {
-    _httpClient._connectionClosed(_httpRequest._httpClientConnection);
-    return _httpRequest._httpClientConnection.detachSocket();
-  }
-
-  HttpConnectionInfo? get connectionInfo => _httpRequest.connectionInfo;
-
-  bool get _shouldAuthenticateProxy {
-    // Only try to authenticate if there is a challenge in the response.
-    List<String>? challenge = headers[HttpHeaders.proxyAuthenticateHeader];
-    return statusCode == HttpStatus.proxyAuthenticationRequired &&
-        challenge != null &&
-        challenge.length == 1;
-  }
-
-  bool get _shouldAuthenticate {
-    // Only try to authenticate if there is a challenge in the response.
-    List<String>? challenge = headers[HttpHeaders.wwwAuthenticateHeader];
-    return statusCode == HttpStatus.unauthorized &&
-        challenge != null &&
-        challenge.length == 1;
-  }
-
-  Future<HttpClientResponse> _authenticate(bool proxyAuth) {
-    _httpRequest._timeline?.instant('Authentication');
-    Future<HttpClientResponse> retry() {
-      _httpRequest._timeline?.instant('Retrying');
-      // Drain body and retry.
-      return drain().then((_) {
-        return _httpClient
-            ._openUrlFromRequest(
-                _httpRequest.method, _httpRequest.uri, _httpRequest)
-            .then((request) => request.close());
-      });
-    }
-
-    List<String>? authChallenge() {
-      return proxyAuth
-          ? headers[HttpHeaders.proxyAuthenticateHeader]
-          : headers[HttpHeaders.wwwAuthenticateHeader];
-    }
-
-    _Credentials? findCredentials(_AuthenticationScheme scheme) {
-      return proxyAuth
-          ? _httpClient._findProxyCredentials(_httpRequest._proxy, scheme)
-          : _httpClient._findCredentials(_httpRequest.uri, scheme);
-    }
-
-    void removeCredentials(_Credentials cr) {
-      if (proxyAuth) {
-        _httpClient._removeProxyCredentials(cr);
-      } else {
-        _httpClient._removeCredentials(cr);
-      }
-    }
-
-    Future<bool> requestAuthentication(
-        _AuthenticationScheme scheme, String? realm) {
-      if (proxyAuth) {
-        var authenticateProxy = _httpClient._authenticateProxy;
-        if (authenticateProxy == null) {
-          return new Future.value(false);
-        }
-        var proxy = _httpRequest._proxy;
-        return authenticateProxy(
-            proxy.host, proxy.port, scheme.toString(), realm);
-      } else {
-        var authenticate = _httpClient._authenticate;
-        if (authenticate == null) {
-          return new Future.value(false);
-        }
-        return authenticate(_httpRequest.uri, scheme.toString(), realm);
-      }
-    }
-
-    List<String> challenge = authChallenge()!;
-    assert(challenge.length == 1);
-    _HeaderValue header =
-        _HeaderValue.parse(challenge[0], parameterSeparator: ",");
-    _AuthenticationScheme scheme =
-        new _AuthenticationScheme.fromString(header.value);
-    String? realm = header.parameters["realm"];
-
-    // See if any matching credentials are available.
-    var cr = findCredentials(scheme);
-    if (cr != null) {
-      // For basic authentication don't retry already used credentials
-      // as they must have already been added to the request causing
-      // this authenticate response.
-      if (cr.scheme == _AuthenticationScheme.BASIC && !cr.used) {
-        // Credentials were found, prepare for retrying the request.
-        return retry();
-      }
-
-      // Digest authentication only supports the MD5 algorithm.
-      if (cr.scheme == _AuthenticationScheme.DIGEST) {
-        var algorithm = header.parameters["algorithm"];
-        if (algorithm == null || algorithm.toLowerCase() == "md5") {
-          var nonce = cr.nonce;
-          if (nonce == null || nonce == header.parameters["nonce"]) {
-            // If the nonce is not set then this is the first authenticate
-            // response for these credentials. Set up authentication state.
-            if (nonce == null) {
-              cr
-                ..nonce = header.parameters["nonce"]
-                ..algorithm = "MD5"
-                ..qop = header.parameters["qop"]
-                ..nonceCount = 0;
-            }
-            // Credentials were found, prepare for retrying the request.
-            return retry();
-          } else {
-            var staleHeader = header.parameters["stale"];
-            if (staleHeader != null && staleHeader.toLowerCase() == "true") {
-              // If stale is true retry with new nonce.
-              cr.nonce = header.parameters["nonce"];
-              // Credentials were found, prepare for retrying the request.
-              return retry();
-            }
-          }
-        }
-      }
-    }
-
-    // Ask for more credentials if none found or the one found has
-    // already been used. If it has already been used it must now be
-    // invalid and is removed.
-    if (cr != null) {
-      removeCredentials(cr);
-      cr = null;
-    }
-    return requestAuthentication(scheme, realm).then((credsAvailable) {
-      if (credsAvailable) {
-        cr = _httpClient._findCredentials(_httpRequest.uri, scheme);
-        return retry();
-      } else {
-        // No credentials available, complete with original response.
-        return this;
-      }
-    });
-  }
-}
-
-class _ToUint8List extends Converter<List<int>, Uint8List> {
-  const _ToUint8List();
-
-  Uint8List convert(List<int> input) => Uint8List.fromList(input);
-
-  Sink<List<int>> startChunkedConversion(Sink<Uint8List> sink) {
-    return _Uint8ListConversionSink(sink);
-  }
-}
-
-class _Uint8ListConversionSink implements Sink<List<int>> {
-  const _Uint8ListConversionSink(this._target);
-
-  final Sink<Uint8List> _target;
-
-  void add(List<int> data) {
-    _target.add(Uint8List.fromList(data));
-  }
-
-  void close() {
-    _target.close();
-  }
-}
-
-class _StreamSinkImpl<T> implements StreamSink<T> {
-  final StreamConsumer<T> _target;
-  final _doneCompleter = new Completer<void>();
-  StreamController<T>? _controllerInstance;
-  Completer? _controllerCompleter;
-  bool _isClosed = false;
-  bool _isBound = false;
-  bool _hasError = false;
-
-  _StreamSinkImpl(this._target);
-
-  void add(T data) {
-    if (_isClosed) {
-      throw StateError("StreamSink is closed");
-    }
-    _controller.add(data);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    if (_isClosed) {
-      throw StateError("StreamSink is closed");
-    }
-    _controller.addError(error, stackTrace);
-  }
-
-  Future addStream(Stream<T> stream) {
-    if (_isBound) {
-      throw new StateError("StreamSink is already bound to a stream");
-    }
-    _isBound = true;
-    if (_hasError) return done;
-    // Wait for any sync operations to complete.
-    Future targetAddStream() {
-      return _target.addStream(stream).whenComplete(() {
-        _isBound = false;
-      });
-    }
-
-    var controller = _controllerInstance;
-    if (controller == null) return targetAddStream();
-    var future = _controllerCompleter!.future;
-    controller.close();
-    return future.then((_) => targetAddStream());
-  }
-
-  Future flush() {
-    if (_isBound) {
-      throw new StateError("StreamSink is bound to a stream");
-    }
-    var controller = _controllerInstance;
-    if (controller == null) return new Future.value(this);
-    // Adding an empty stream-controller will return a future that will complete
-    // when all data is done.
-    _isBound = true;
-    var future = _controllerCompleter!.future;
-    controller.close();
-    return future.whenComplete(() {
-      _isBound = false;
-    });
-  }
-
-  Future close() {
-    if (_isBound) {
-      throw new StateError("StreamSink is bound to a stream");
-    }
-    if (!_isClosed) {
-      _isClosed = true;
-      var controller = _controllerInstance;
-      if (controller != null) {
-        controller.close();
-      } else {
-        _closeTarget();
-      }
-    }
-    return done;
-  }
-
-  void _closeTarget() {
-    _target.close().then(_completeDoneValue, onError: _completeDoneError);
-  }
-
-  Future get done => _doneCompleter.future;
-
-  void _completeDoneValue(value) {
-    if (!_doneCompleter.isCompleted) {
-      _doneCompleter.complete(value);
-    }
-  }
-
-  void _completeDoneError(Object error, StackTrace stackTrace) {
-    if (!_doneCompleter.isCompleted) {
-      _hasError = true;
-      _doneCompleter.completeError(error, stackTrace);
-    }
-  }
-
-  StreamController<T> get _controller {
-    if (_isBound) {
-      throw new StateError("StreamSink is bound to a stream");
-    }
-    if (_isClosed) {
-      throw new StateError("StreamSink is closed");
-    }
-    if (_controllerInstance == null) {
-      _controllerInstance = new StreamController<T>(sync: true);
-      _controllerCompleter = new Completer();
-      _target.addStream(_controller.stream).then((_) {
-        if (_isBound) {
-          // A new stream takes over - forward values to that stream.
-          _controllerCompleter!.complete(this);
-          _controllerCompleter = null;
-          _controllerInstance = null;
-        } else {
-          // No new stream, .close was called. Close _target.
-          _closeTarget();
-        }
-      }, onError: (Object error, StackTrace stackTrace) {
-        if (_isBound) {
-          // A new stream takes over - forward errors to that stream.
-          _controllerCompleter!.completeError(error, stackTrace);
-          _controllerCompleter = null;
-          _controllerInstance = null;
-        } else {
-          // No new stream. No need to close target, as it has already
-          // failed.
-          _completeDoneError(error, stackTrace);
-        }
-      });
-    }
-    return _controllerInstance!;
-  }
-}
-
-class _IOSinkImpl extends _StreamSinkImpl<List<int>> implements IOSink {
-  Encoding _encoding;
-  bool _encodingMutable = true;
-
-  _IOSinkImpl(StreamConsumer<List<int>> target, this._encoding) : super(target);
-
-  Encoding get encoding => _encoding;
-
-  void set encoding(Encoding value) {
-    if (!_encodingMutable) {
-      throw new StateError("IOSink encoding is not mutable");
-    }
-    _encoding = value;
-  }
-
-  void write(Object? obj) {
-    String string = '$obj';
-    if (string.isEmpty) return;
-    add(_encoding.encode(string));
-  }
-
-  void writeAll(Iterable objects, [String separator = ""]) {
-    Iterator iterator = objects.iterator;
-    if (!iterator.moveNext()) return;
-    if (separator.isEmpty) {
-      do {
-        write(iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      write(iterator.current);
-      while (iterator.moveNext()) {
-        write(separator);
-        write(iterator.current);
-      }
-    }
-  }
-
-  void writeln([Object? object = ""]) {
-    write(object);
-    write("\n");
-  }
-
-  void writeCharCode(int charCode) {
-    write(new String.fromCharCode(charCode));
-  }
-}
-
-abstract class _HttpOutboundMessage<T> extends _IOSinkImpl {
-  // Used to mark when the body should be written. This is used for HEAD
-  // requests and in error handling.
-  bool _encodingSet = false;
-
-  bool _bufferOutput = true;
-
-  final Uri _uri;
-  final _HttpOutgoing _outgoing;
-
-  final _HttpHeaders headers;
-
-  _HttpOutboundMessage(Uri uri, String protocolVersion, _HttpOutgoing outgoing,
-      {_HttpHeaders? initialHeaders})
-      : _uri = uri,
-        headers = new _HttpHeaders(protocolVersion,
-            defaultPortForScheme: uri.scheme == 'https'
-                ? HttpClient.defaultHttpsPort
-                : HttpClient.defaultHttpPort,
-            initialHeaders: initialHeaders),
-        _outgoing = outgoing,
-        super(outgoing, latin1) {
-    _outgoing.outbound = this;
-    _encodingMutable = false;
-  }
-
-  int get contentLength => headers.contentLength;
-  void set contentLength(int contentLength) {
-    headers.contentLength = contentLength;
-  }
-
-  bool get persistentConnection => headers.persistentConnection;
-  void set persistentConnection(bool p) {
-    headers.persistentConnection = p;
-  }
-
-  bool get bufferOutput => _bufferOutput;
-  void set bufferOutput(bool bufferOutput) {
-    if (_outgoing.headersWritten) throw new StateError("Header already sent");
-    _bufferOutput = bufferOutput;
-  }
-
-  Encoding get encoding {
-    if (_encodingSet && _outgoing.headersWritten) {
-      return _encoding;
-    }
-    String charset;
-    var contentType = headers.contentType;
-    if (contentType != null && contentType.charset != null) {
-      charset = contentType.charset!;
-    } else {
-      charset = "iso-8859-1";
-    }
-    return Encoding.getByName(charset) ?? latin1;
-  }
-
-  void add(List<int> data) {
-    if (data.length == 0) return;
-    super.add(data);
-  }
-
-  void write(Object? obj) {
-    if (!_encodingSet) {
-      _encoding = encoding;
-      _encodingSet = true;
-    }
-    super.write(obj);
-  }
-
-  void _writeHeader();
-
-  bool get _isConnectionClosed => false;
-}
-
-class _HttpResponse extends _HttpOutboundMessage<HttpResponse>
-    implements HttpResponse {
-  int _statusCode = 200;
-  String? _reasonPhrase;
-  List<Cookie>? _cookies;
-  _HttpRequest? _httpRequest;
-  Duration? _deadline;
-  Timer? _deadlineTimer;
-
-  _HttpResponse(Uri uri, String protocolVersion, _HttpOutgoing outgoing,
-      HttpHeaders defaultHeaders, String? serverHeader)
-      : super(uri, protocolVersion, outgoing,
-            initialHeaders: defaultHeaders as _HttpHeaders) {
-    if (serverHeader != null) {
-      headers.set(HttpHeaders.serverHeader, serverHeader);
-    }
-  }
-
-  bool get _isConnectionClosed => _httpRequest!._httpConnection._isClosing;
-
-  List<Cookie> get cookies => _cookies ??= <Cookie>[];
-
-  int get statusCode => _statusCode;
-  void set statusCode(int statusCode) {
-    if (_outgoing.headersWritten) throw new StateError("Header already sent");
-    _statusCode = statusCode;
-  }
-
-  String get reasonPhrase => _findReasonPhrase(statusCode);
-  void set reasonPhrase(String reasonPhrase) {
-    if (_outgoing.headersWritten) throw new StateError("Header already sent");
-    _reasonPhrase = reasonPhrase;
-  }
-
-  Future redirect(Uri location, {int status = HttpStatus.movedTemporarily}) {
-    if (_outgoing.headersWritten) throw new StateError("Header already sent");
-    statusCode = status;
-    headers.set(HttpHeaders.locationHeader, location.toString());
-    return close();
-  }
-
-  Future<Socket> detachSocket({bool writeHeaders = true}) {
-    if (_outgoing.headersWritten) throw new StateError("Headers already sent");
-    deadline = null; // Be sure to stop any deadline.
-    var future = _httpRequest!._httpConnection.detachSocket();
-    if (writeHeaders) {
-      var headersFuture =
-          _outgoing.writeHeaders(drainRequest: false, setOutgoing: false);
-      assert(headersFuture == null);
-    } else {
-      // Imitate having written the headers.
-      _outgoing.headersWritten = true;
-    }
-    // Close connection so the socket is 'free'.
-    close();
-    done.catchError((_) {
-      // Catch any error on done, as they automatically will be
-      // propagated to the websocket.
-    });
-    return future;
-  }
-
-  HttpConnectionInfo? get connectionInfo => _httpRequest!.connectionInfo;
-
-  Duration? get deadline => _deadline;
-
-  void set deadline(Duration? d) {
-    _deadlineTimer?.cancel();
-    _deadline = d;
-
-    if (d == null) return;
-    _deadlineTimer = new Timer(d, () {
-      _httpRequest!._httpConnection.destroy();
-    });
-  }
-
-  void _writeHeader() {
-    BytesBuilder buffer = new _CopyingBytesBuilder(_OUTGOING_BUFFER_SIZE);
-
-    // Write status line.
-    if (headers.protocolVersion == "1.1") {
-      buffer.add(_Const.HTTP11);
-    } else {
-      buffer.add(_Const.HTTP10);
-    }
-    buffer.addByte(_CharCode.SP);
-    buffer.add(statusCode.toString().codeUnits);
-    buffer.addByte(_CharCode.SP);
-    buffer.add(reasonPhrase.codeUnits);
-    buffer.addByte(_CharCode.CR);
-    buffer.addByte(_CharCode.LF);
-
-    var session = _httpRequest!._session;
-    if (session != null && !session._destroyed) {
-      // Mark as not new.
-      session._isNew = false;
-      // Make sure we only send the current session id.
-      bool found = false;
-      for (int i = 0; i < cookies.length; i++) {
-        if (cookies[i].name.toUpperCase() == _DART_SESSION_ID) {
-          cookies[i]
-            ..value = session.id
-            ..httpOnly = true
-            ..path = "/";
-          found = true;
-        }
-      }
-      if (!found) {
-        var cookie = new Cookie(_DART_SESSION_ID, session.id);
-        cookies.add(cookie
-          ..httpOnly = true
-          ..path = "/");
-      }
-    }
-    // Add all the cookies set to the headers.
-    _cookies?.forEach((cookie) {
-      headers.add(HttpHeaders.setCookieHeader, cookie);
-    });
-
-    headers._finalize();
-
-    // Write headers.
-    headers._build(buffer);
-    buffer.addByte(_CharCode.CR);
-    buffer.addByte(_CharCode.LF);
-    Uint8List headerBytes = buffer.takeBytes();
-    _outgoing.setHeader(headerBytes, headerBytes.length);
-  }
-
-  String _findReasonPhrase(int statusCode) {
-    var reasonPhrase = _reasonPhrase;
-    if (reasonPhrase != null) {
-      return reasonPhrase;
-    }
-
-    switch (statusCode) {
-      case HttpStatus.continue_:
-        return "Continue";
-      case HttpStatus.switchingProtocols:
-        return "Switching Protocols";
-      case HttpStatus.ok:
-        return "OK";
-      case HttpStatus.created:
-        return "Created";
-      case HttpStatus.accepted:
-        return "Accepted";
-      case HttpStatus.nonAuthoritativeInformation:
-        return "Non-Authoritative Information";
-      case HttpStatus.noContent:
-        return "No Content";
-      case HttpStatus.resetContent:
-        return "Reset Content";
-      case HttpStatus.partialContent:
-        return "Partial Content";
-      case HttpStatus.multipleChoices:
-        return "Multiple Choices";
-      case HttpStatus.movedPermanently:
-        return "Moved Permanently";
-      case HttpStatus.found:
-        return "Found";
-      case HttpStatus.seeOther:
-        return "See Other";
-      case HttpStatus.notModified:
-        return "Not Modified";
-      case HttpStatus.useProxy:
-        return "Use Proxy";
-      case HttpStatus.temporaryRedirect:
-        return "Temporary Redirect";
-      case HttpStatus.badRequest:
-        return "Bad Request";
-      case HttpStatus.unauthorized:
-        return "Unauthorized";
-      case HttpStatus.paymentRequired:
-        return "Payment Required";
-      case HttpStatus.forbidden:
-        return "Forbidden";
-      case HttpStatus.notFound:
-        return "Not Found";
-      case HttpStatus.methodNotAllowed:
-        return "Method Not Allowed";
-      case HttpStatus.notAcceptable:
-        return "Not Acceptable";
-      case HttpStatus.proxyAuthenticationRequired:
-        return "Proxy Authentication Required";
-      case HttpStatus.requestTimeout:
-        return "Request Time-out";
-      case HttpStatus.conflict:
-        return "Conflict";
-      case HttpStatus.gone:
-        return "Gone";
-      case HttpStatus.lengthRequired:
-        return "Length Required";
-      case HttpStatus.preconditionFailed:
-        return "Precondition Failed";
-      case HttpStatus.requestEntityTooLarge:
-        return "Request Entity Too Large";
-      case HttpStatus.requestUriTooLong:
-        return "Request-URI Too Long";
-      case HttpStatus.unsupportedMediaType:
-        return "Unsupported Media Type";
-      case HttpStatus.requestedRangeNotSatisfiable:
-        return "Requested range not satisfiable";
-      case HttpStatus.expectationFailed:
-        return "Expectation Failed";
-      case HttpStatus.internalServerError:
-        return "Internal Server Error";
-      case HttpStatus.notImplemented:
-        return "Not Implemented";
-      case HttpStatus.badGateway:
-        return "Bad Gateway";
-      case HttpStatus.serviceUnavailable:
-        return "Service Unavailable";
-      case HttpStatus.gatewayTimeout:
-        return "Gateway Time-out";
-      case HttpStatus.httpVersionNotSupported:
-        return "Http Version not supported";
-      default:
-        return "Status $statusCode";
-    }
-  }
-}
-
-class _HttpClientRequest extends _HttpOutboundMessage<HttpClientResponse>
-    implements HttpClientRequest {
-  final String method;
-  final Uri uri;
-  final List<Cookie> cookies = [];
-
-  // The HttpClient this request belongs to.
-  final _HttpClient _httpClient;
-  final _HttpClientConnection _httpClientConnection;
-  final TimelineTask? _timeline;
-
-  final Completer<HttpClientResponse> _responseCompleter =
-      new Completer<HttpClientResponse>();
-
-  final _Proxy _proxy;
-
-  Future<HttpClientResponse>? _response;
-
-  // TODO(ajohnsen): Get default value from client?
-  bool _followRedirects = true;
-
-  int _maxRedirects = 5;
-
-  List<RedirectInfo> _responseRedirects = [];
-
-  _HttpClientRequest(_HttpOutgoing outgoing, Uri uri, this.method, this._proxy,
-      this._httpClient, this._httpClientConnection, this._timeline)
-      : uri = uri,
-        super(uri, "1.1", outgoing) {
-    _timeline?.instant('Request initiated');
-    // GET and HEAD have 'content-length: 0' by default.
-    if (method == "GET" || method == "HEAD") {
-      contentLength = 0;
-    } else {
-      headers.chunkedTransferEncoding = true;
-    }
-
-    _responseCompleter.future.then((response) {
-      _timeline?.instant('Response receieved');
-      Map formatConnectionInfo() => {
-            'localPort': response.connectionInfo?.localPort,
-            'remoteAddress': response.connectionInfo?.remoteAddress.address,
-            'remotePort': response.connectionInfo?.remotePort,
-          };
-
-      Map formatHeaders() {
-        final headers = <String, List<String>>{};
-        response.headers.forEach((name, values) {
-          headers[name] = values;
-        });
-        return headers;
-      }
-
-      List<Map<String, dynamic>> formatRedirectInfo() {
-        final redirects = <Map<String, dynamic>>[];
-        for (final redirect in response.redirects) {
-          redirects.add({
-            'location': redirect.location.toString(),
-            'method': redirect.method,
-            'statusCode': redirect.statusCode,
-          });
-        }
-        return redirects;
-      }
-
-      _timeline?.finish(arguments: {
-        // TODO(bkonyi): consider exposing certificate information?
-        // 'certificate': response.certificate,
-        'requestHeaders': outgoing.outbound!.headers._headers,
-        'compressionState': response.compressionState.toString(),
-        'connectionInfo': formatConnectionInfo(),
-        'contentLength': response.contentLength,
-        'cookies': [for (final cookie in response.cookies) cookie.toString()],
-        'responseHeaders': formatHeaders(),
-        'isRedirect': response.isRedirect,
-        'persistentConnection': response.persistentConnection,
-        'reasonPhrase': response.reasonPhrase,
-        'redirects': formatRedirectInfo(),
-        'statusCode': response.statusCode,
-      });
-    }, onError: (e) {});
-  }
-
-  Future<HttpClientResponse> get done => _response ??=
-      Future.wait([_responseCompleter.future, super.done], eagerError: true)
-          .then((list) => list[0]);
-
-  Future<HttpClientResponse> close() {
-    super.close();
-    return done;
-  }
-
-  int get maxRedirects => _maxRedirects;
-  void set maxRedirects(int maxRedirects) {
-    if (_outgoing.headersWritten) throw new StateError("Request already sent");
-    _maxRedirects = maxRedirects;
-  }
-
-  bool get followRedirects => _followRedirects;
-  void set followRedirects(bool followRedirects) {
-    if (_outgoing.headersWritten) throw new StateError("Request already sent");
-    _followRedirects = followRedirects;
-  }
-
-  HttpConnectionInfo? get connectionInfo =>
-      _httpClientConnection.connectionInfo;
-
-  void _onIncoming(_HttpIncoming incoming) {
-    var response = new _HttpClientResponse(incoming, this, _httpClient);
-    Future<HttpClientResponse> future;
-    if (followRedirects && response.isRedirect) {
-      if (response.redirects.length < maxRedirects) {
-        // Redirect and drain response.
-        future = response
-            .drain()
-            .then<HttpClientResponse>((_) => response.redirect());
-      } else {
-        // End with exception, too many redirects.
-        future = response.drain().then<HttpClientResponse>((_) {
-          return new Future<HttpClientResponse>.error(new RedirectException(
-              "Redirect limit exceeded", response.redirects));
-        });
-      }
-    } else if (response._shouldAuthenticateProxy) {
-      future = response._authenticate(true);
-    } else if (response._shouldAuthenticate) {
-      future = response._authenticate(false);
-    } else {
-      future = new Future<HttpClientResponse>.value(response);
-    }
-    future.then((v) => _responseCompleter.complete(v),
-        onError: _responseCompleter.completeError);
-  }
-
-  void _onError(error, StackTrace stackTrace) {
-    _responseCompleter.completeError(error, stackTrace);
-  }
-
-  // Generate the request URI based on the method and proxy.
-  String _requestUri() {
-    // Generate the request URI starting from the path component.
-    String uriStartingFromPath() {
-      String result = uri.path;
-      if (result.isEmpty) result = "/";
-      if (uri.hasQuery) {
-        result = "${result}?${uri.query}";
-      }
-      return result;
-    }
-
-    if (_proxy.isDirect) {
-      return uriStartingFromPath();
-    } else {
-      if (method == "CONNECT") {
-        // For the connect method the request URI is the host:port of
-        // the requested destination of the tunnel (see RFC 2817
-        // section 5.2)
-        return "${uri.host}:${uri.port}";
-      } else {
-        if (_httpClientConnection._proxyTunnel) {
-          return uriStartingFromPath();
-        } else {
-          return uri.removeFragment().toString();
-        }
-      }
-    }
-  }
-
-  void _writeHeader() {
-    BytesBuilder buffer = new _CopyingBytesBuilder(_OUTGOING_BUFFER_SIZE);
-
-    // Write the request method.
-    buffer.add(method.codeUnits);
-    buffer.addByte(_CharCode.SP);
-    // Write the request URI.
-    buffer.add(_requestUri().codeUnits);
-    buffer.addByte(_CharCode.SP);
-    // Write HTTP/1.1.
-    buffer.add(_Const.HTTP11);
-    buffer.addByte(_CharCode.CR);
-    buffer.addByte(_CharCode.LF);
-
-    // Add the cookies to the headers.
-    if (!cookies.isEmpty) {
-      StringBuffer sb = new StringBuffer();
-      for (int i = 0; i < cookies.length; i++) {
-        if (i > 0) sb.write("; ");
-        sb..write(cookies[i].name)..write("=")..write(cookies[i].value);
-      }
-      headers.add(HttpHeaders.cookieHeader, sb.toString());
-    }
-
-    headers._finalize();
-
-    // Write headers.
-    headers._build(buffer);
-    buffer.addByte(_CharCode.CR);
-    buffer.addByte(_CharCode.LF);
-    Uint8List headerBytes = buffer.takeBytes();
-    _outgoing.setHeader(headerBytes, headerBytes.length);
-  }
-}
-
-// Used by _HttpOutgoing as a target of a chunked converter for gzip
-// compression.
-class _HttpGZipSink extends ByteConversionSink {
-  final _BytesConsumer _consume;
-  _HttpGZipSink(this._consume);
-
-  void add(List<int> chunk) {
-    _consume(chunk);
-  }
-
-  void addSlice(List<int> chunk, int start, int end, bool isLast) {
-    if (chunk is Uint8List) {
-      _consume(new Uint8List.view(
-          chunk.buffer, chunk.offsetInBytes + start, end - start));
-    } else {
-      _consume(chunk.sublist(start, end - start));
-    }
-  }
-
-  void close() {}
-}
-
-// The _HttpOutgoing handles all of the following:
-//  - Buffering
-//  - GZip compression
-//  - Content-Length validation.
-//  - Errors.
-//
-// Most notable is the GZip compression, that uses a double-buffering system,
-// one before gzip (_gzipBuffer) and one after (_buffer).
-class _HttpOutgoing implements StreamConsumer<List<int>> {
-  static const List<int> _footerAndChunk0Length = const [
-    _CharCode.CR,
-    _CharCode.LF,
-    0x30,
-    _CharCode.CR,
-    _CharCode.LF,
-    _CharCode.CR,
-    _CharCode.LF
-  ];
-
-  static const List<int> _chunk0Length = const [
-    0x30,
-    _CharCode.CR,
-    _CharCode.LF,
-    _CharCode.CR,
-    _CharCode.LF
-  ];
-
-  final Completer<Socket> _doneCompleter = new Completer<Socket>();
-  final Socket socket;
-
-  bool ignoreBody = false;
-  bool headersWritten = false;
-
-  Uint8List? _buffer;
-  int _length = 0;
-
-  Future? _closeFuture;
-
-  bool chunked = false;
-  int _pendingChunkedFooter = 0;
-
-  int? contentLength;
-  int _bytesWritten = 0;
-
-  bool _gzip = false;
-  ByteConversionSink? _gzipSink;
-  // _gzipAdd is set iff the sink is being added to. It's used to specify where
-  // gzipped data should be taken (sometimes a controller, sometimes a socket).
-  _BytesConsumer? _gzipAdd;
-  Uint8List? _gzipBuffer;
-  int _gzipBufferLength = 0;
-
-  bool _socketError = false;
-
-  _HttpOutboundMessage? outbound;
-
-  _HttpOutgoing(this.socket);
-
-  // Returns either a future or 'null', if it was able to write headers
-  // immediately.
-  Future<void>? writeHeaders(
-      {bool drainRequest = true, bool setOutgoing = true}) {
-    if (headersWritten) return null;
-    headersWritten = true;
-    Future<void>? drainFuture;
-    bool gzip = false;
-    var response = outbound!;
-    if (response is _HttpResponse) {
-      // Server side.
-      if (response._httpRequest!._httpServer.autoCompress &&
-          response.bufferOutput &&
-          response.headers.chunkedTransferEncoding) {
-        List<String>? acceptEncodings =
-            response._httpRequest!.headers[HttpHeaders.acceptEncodingHeader];
-        List<String>? contentEncoding =
-            response.headers[HttpHeaders.contentEncodingHeader];
-        if (acceptEncodings != null &&
-            contentEncoding == null &&
-            acceptEncodings
-                .expand((list) => list.split(","))
-                .any((encoding) => encoding.trim().toLowerCase() == "gzip")) {
-          response.headers.set(HttpHeaders.contentEncodingHeader, "gzip");
-          gzip = true;
-        }
-      }
-      if (drainRequest && !response._httpRequest!._incoming.hasSubscriber) {
-        drainFuture = response._httpRequest!.drain<void>().catchError((_) {});
-      }
-    } else {
-      drainRequest = false;
-    }
-    if (!ignoreBody) {
-      if (setOutgoing) {
-        int contentLength = response.headers.contentLength;
-        if (response.headers.chunkedTransferEncoding) {
-          chunked = true;
-          if (gzip) this.gzip = true;
-        } else if (contentLength >= 0) {
-          this.contentLength = contentLength;
-        }
-      }
-      if (drainFuture != null) {
-        return drainFuture.then((_) => response._writeHeader());
-      }
-    }
-    response._writeHeader();
-    return null;
-  }
-
-  Future addStream(Stream<List<int>> stream) {
-    if (_socketError) {
-      stream.listen(null).cancel();
-      return new Future.value(outbound);
-    }
-    if (ignoreBody) {
-      stream.drain().catchError((_) {});
-      var future = writeHeaders();
-      if (future != null) {
-        return future.then((_) => close());
-      }
-      return close();
-    }
-    // Use new stream so we are able to pause (see below listen). The
-    // alternative is to use stream.extand, but that won't give us a way of
-    // pausing.
-    var controller = new StreamController<List<int>>(sync: true);
-
-    void onData(List<int> data) {
-      if (_socketError) return;
-      if (data.length == 0) return;
-      if (chunked) {
-        if (_gzip) {
-          _gzipAdd = controller.add;
-          _addGZipChunk(data, _gzipSink!.add);
-          _gzipAdd = null;
-          return;
-        }
-        _addChunk(_chunkHeader(data.length), controller.add);
-        _pendingChunkedFooter = 2;
-      } else {
-        var contentLength = this.contentLength;
-        if (contentLength != null) {
-          _bytesWritten += data.length;
-          if (_bytesWritten > contentLength) {
-            controller.addError(new HttpException(
-                "Content size exceeds specified contentLength. "
-                "$_bytesWritten bytes written while expected "
-                "$contentLength. "
-                "[${new String.fromCharCodes(data)}]"));
-            return;
-          }
-        }
-      }
-      _addChunk(data, controller.add);
-    }
-
-    var sub = stream.listen(onData,
-        onError: controller.addError,
-        onDone: controller.close,
-        cancelOnError: true);
-    controller.onPause = sub.pause;
-    controller.onResume = sub.resume;
-    // Write headers now that we are listening to the stream.
-    if (!headersWritten) {
-      var future = writeHeaders();
-      if (future != null) {
-        // While incoming is being drained, the pauseFuture is non-null. Pause
-        // output until it's drained.
-        sub.pause(future);
-      }
-    }
-    return socket.addStream(controller.stream).then((_) {
-      return outbound;
-    }, onError: (error, stackTrace) {
-      // Be sure to close it in case of an error.
-      if (_gzip) _gzipSink!.close();
-      _socketError = true;
-      _doneCompleter.completeError(error, stackTrace);
-      if (_ignoreError(error)) {
-        return outbound;
-      } else {
-        throw error;
-      }
-    });
-  }
-
-  Future close() {
-    // If we are already closed, return that future.
-    var closeFuture = _closeFuture;
-    if (closeFuture != null) return closeFuture;
-
-    var outbound = this.outbound!;
-    // If we earlier saw an error, return immediate. The notification to
-    // _Http*Connection is already done.
-    if (_socketError) return new Future.value(outbound);
-    if (outbound._isConnectionClosed) return new Future.value(outbound);
-    if (!headersWritten && !ignoreBody) {
-      if (outbound.headers.contentLength == -1) {
-        // If no body was written, ignoreBody is false (it's not a HEAD
-        // request) and the content-length is unspecified, set contentLength to
-        // 0.
-        outbound.headers.chunkedTransferEncoding = false;
-        outbound.headers.contentLength = 0;
-      } else if (outbound.headers.contentLength > 0) {
-        var error = new HttpException(
-            "No content even though contentLength was specified to be "
-            "greater than 0: ${outbound.headers.contentLength}.",
-            uri: outbound._uri);
-        _doneCompleter.completeError(error);
-        return _closeFuture = new Future.error(error);
-      }
-    }
-    // If contentLength was specified, validate it.
-    var contentLength = this.contentLength;
-    if (contentLength != null) {
-      if (_bytesWritten < contentLength) {
-        var error = new HttpException(
-            "Content size below specified contentLength. "
-            " $_bytesWritten bytes written but expected "
-            "$contentLength.",
-            uri: outbound._uri);
-        _doneCompleter.completeError(error);
-        return _closeFuture = new Future.error(error);
-      }
-    }
-
-    Future finalize() {
-      // In case of chunked encoding (and gzip), handle remaining gzip data and
-      // append the 'footer' for chunked encoding.
-      if (chunked) {
-        if (_gzip) {
-          _gzipAdd = socket.add;
-          if (_gzipBufferLength > 0) {
-            _gzipSink!.add(new Uint8List.view(_gzipBuffer!.buffer,
-                _gzipBuffer!.offsetInBytes, _gzipBufferLength));
-          }
-          _gzipBuffer = null;
-          _gzipSink!.close();
-          _gzipAdd = null;
-        }
-        _addChunk(_chunkHeader(0), socket.add);
-      }
-      // Add any remaining data in the buffer.
-      if (_length > 0) {
-        socket.add(new Uint8List.view(
-            _buffer!.buffer, _buffer!.offsetInBytes, _length));
-      }
-      // Clear references, for better GC.
-      _buffer = null;
-      // And finally flush it. As we support keep-alive, never close it from
-      // here. Once the socket is flushed, we'll be able to reuse it (signaled
-      // by the 'done' future).
-      return socket.flush().then((_) {
-        _doneCompleter.complete(socket);
-        return outbound;
-      }, onError: (error, stackTrace) {
-        _doneCompleter.completeError(error, stackTrace);
-        if (_ignoreError(error)) {
-          return outbound;
-        } else {
-          throw error;
-        }
-      });
-    }
-
-    var future = writeHeaders();
-    if (future != null) {
-      return _closeFuture = future.whenComplete(finalize);
-    }
-    return _closeFuture = finalize();
-  }
-
-  Future<Socket> get done => _doneCompleter.future;
-
-  void setHeader(List<int> data, int length) {
-    assert(_length == 0);
-    _buffer = data as Uint8List;
-    _length = length;
-  }
-
-  void set gzip(bool value) {
-    _gzip = value;
-    if (value) {
-      _gzipBuffer = new Uint8List(_OUTGOING_BUFFER_SIZE);
-      assert(_gzipSink == null);
-      _gzipSink = new ZLibEncoder(gzip: true)
-          .startChunkedConversion(new _HttpGZipSink((data) {
-        // We are closing down prematurely, due to an error. Discard.
-        if (_gzipAdd == null) return;
-        _addChunk(_chunkHeader(data.length), _gzipAdd!);
-        _pendingChunkedFooter = 2;
-        _addChunk(data, _gzipAdd!);
-      }));
-    }
-  }
-
-  bool _ignoreError(error) =>
-      (error is SocketException || error is TlsException) &&
-      outbound is HttpResponse;
-
-  void _addGZipChunk(List<int> chunk, void add(List<int> data)) {
-    var bufferOutput = outbound!.bufferOutput;
-    if (!bufferOutput) {
-      add(chunk);
-      return;
-    }
-    var gzipBuffer = _gzipBuffer!;
-    if (chunk.length > gzipBuffer.length - _gzipBufferLength) {
-      add(new Uint8List.view(
-          gzipBuffer.buffer, gzipBuffer.offsetInBytes, _gzipBufferLength));
-      _gzipBuffer = new Uint8List(_OUTGOING_BUFFER_SIZE);
-      _gzipBufferLength = 0;
-    }
-    if (chunk.length > _OUTGOING_BUFFER_SIZE) {
-      add(chunk);
-    } else {
-      var currentLength = _gzipBufferLength;
-      var newLength = currentLength + chunk.length;
-      _gzipBuffer!.setRange(currentLength, newLength, chunk);
-      _gzipBufferLength = newLength;
-    }
-  }
-
-  void _addChunk(List<int> chunk, void add(List<int> data)) {
-    var bufferOutput = outbound!.bufferOutput;
-    if (!bufferOutput) {
-      if (_buffer != null) {
-        // If _buffer is not null, we have not written the header yet. Write
-        // it now.
-        add(new Uint8List.view(
-            _buffer!.buffer, _buffer!.offsetInBytes, _length));
-        _buffer = null;
-        _length = 0;
-      }
-      add(chunk);
-      return;
-    }
-    if (chunk.length > _buffer!.length - _length) {
-      add(new Uint8List.view(_buffer!.buffer, _buffer!.offsetInBytes, _length));
-      _buffer = new Uint8List(_OUTGOING_BUFFER_SIZE);
-      _length = 0;
-    }
-    if (chunk.length > _OUTGOING_BUFFER_SIZE) {
-      add(chunk);
-    } else {
-      _buffer!.setRange(_length, _length + chunk.length, chunk);
-      _length += chunk.length;
-    }
-  }
-
-  List<int> _chunkHeader(int length) {
-    const hexDigits = const [
-      0x30,
-      0x31,
-      0x32,
-      0x33,
-      0x34,
-      0x35,
-      0x36,
-      0x37,
-      0x38,
-      0x39,
-      0x41,
-      0x42,
-      0x43,
-      0x44,
-      0x45,
-      0x46
-    ];
-    if (length == 0) {
-      if (_pendingChunkedFooter == 2) return _footerAndChunk0Length;
-      return _chunk0Length;
-    }
-    int size = _pendingChunkedFooter;
-    int len = length;
-    // Compute a fast integer version of (log(length + 1) / log(16)).ceil().
-    while (len > 0) {
-      size++;
-      len >>= 4;
-    }
-    var footerAndHeader = new Uint8List(size + 2);
-    if (_pendingChunkedFooter == 2) {
-      footerAndHeader[0] = _CharCode.CR;
-      footerAndHeader[1] = _CharCode.LF;
-    }
-    int index = size;
-    while (index > _pendingChunkedFooter) {
-      footerAndHeader[--index] = hexDigits[length & 15];
-      length = length >> 4;
-    }
-    footerAndHeader[size + 0] = _CharCode.CR;
-    footerAndHeader[size + 1] = _CharCode.LF;
-    return footerAndHeader;
-  }
-}
-
-class _HttpClientConnection {
-  final String key;
-  final Socket _socket;
-  final bool _proxyTunnel;
-  final SecurityContext? _context;
-  final _HttpParser _httpParser;
-  StreamSubscription? _subscription;
-  final _HttpClient _httpClient;
-  bool _dispose = false;
-  Timer? _idleTimer;
-  bool closed = false;
-  Uri? _currentUri;
-
-  Completer<_HttpIncoming>? _nextResponseCompleter;
-  Future<Socket>? _streamFuture;
-
-  _HttpClientConnection(this.key, this._socket, this._httpClient,
-      [this._proxyTunnel = false, this._context])
-      : _httpParser = new _HttpParser.responseParser() {
-    _httpParser.listenToStream(_socket);
-
-    // Set up handlers on the parser here, so we are sure to get 'onDone' from
-    // the parser.
-    _subscription = _httpParser.listen((incoming) {
-      // Only handle one incoming response at the time. Keep the
-      // stream paused until the response have been processed.
-      _subscription!.pause();
-      // We assume the response is not here, until we have send the request.
-      if (_nextResponseCompleter == null) {
-        throw new HttpException(
-            "Unexpected response (unsolicited response without request).",
-            uri: _currentUri);
-      }
-
-      // Check for status code '100 Continue'. In that case just
-      // consume that response as the final response will follow
-      // it. There is currently no API for the client to wait for
-      // the '100 Continue' response.
-      if (incoming.statusCode == 100) {
-        incoming.drain().then((_) {
-          _subscription!.resume();
-        }).catchError((dynamic error, StackTrace stackTrace) {
-          _nextResponseCompleter!.completeError(
-              new HttpException(error.message, uri: _currentUri), stackTrace);
-          _nextResponseCompleter = null;
-        });
-      } else {
-        _nextResponseCompleter!.complete(incoming);
-        _nextResponseCompleter = null;
-      }
-    }, onError: (dynamic error, StackTrace stackTrace) {
-      _nextResponseCompleter?.completeError(
-          new HttpException(error.message, uri: _currentUri), stackTrace);
-      _nextResponseCompleter = null;
-    }, onDone: () {
-      _nextResponseCompleter?.completeError(new HttpException(
-          "Connection closed before response was received",
-          uri: _currentUri));
-      _nextResponseCompleter = null;
-      close();
-    });
-  }
-
-  _HttpClientRequest send(
-      Uri uri, int port, String method, _Proxy proxy, TimelineTask? timeline) {
-    if (closed) {
-      throw new HttpException("Socket closed before request was sent",
-          uri: uri);
-    }
-    _currentUri = uri;
-    // Start with pausing the parser.
-    _subscription!.pause();
-    if (method == "CONNECT") {
-      // Parser will ignore Content-Length or Transfer-Encoding header
-      _httpParser.connectMethod = true;
-    }
-    _ProxyCredentials? proxyCreds; // Credentials used to authorize proxy.
-    _SiteCredentials? creds; // Credentials used to authorize this request.
-    var outgoing = new _HttpOutgoing(_socket);
-    // Create new request object, wrapping the outgoing connection.
-    var request = new _HttpClientRequest(
-        outgoing, uri, method, proxy, _httpClient, this, timeline);
-    // For the Host header an IPv6 address must be enclosed in []'s.
-    var host = uri.host;
-    if (host.contains(':')) host = "[$host]";
-    request.headers
-      ..host = host
-      ..port = port
-      ..add(HttpHeaders.acceptEncodingHeader, "gzip");
-    if (_httpClient.userAgent != null) {
-      request.headers.add(HttpHeaders.userAgentHeader, _httpClient.userAgent!);
-    }
-    if (proxy.isAuthenticated) {
-      // If the proxy configuration contains user information use that
-      // for proxy basic authorization.
-      String auth = _CryptoUtils.bytesToBase64(
-          utf8.encode("${proxy.username}:${proxy.password}"));
-      request.headers.set(HttpHeaders.proxyAuthorizationHeader, "Basic $auth");
-    } else if (!proxy.isDirect && _httpClient._proxyCredentials.length > 0) {
-      proxyCreds = _httpClient._findProxyCredentials(proxy);
-      if (proxyCreds != null) {
-        proxyCreds.authorize(request);
-      }
-    }
-    if (uri.userInfo != null && !uri.userInfo.isEmpty) {
-      // If the URL contains user information use that for basic
-      // authorization.
-      String auth = _CryptoUtils.bytesToBase64(utf8.encode(uri.userInfo));
-      request.headers.set(HttpHeaders.authorizationHeader, "Basic $auth");
-    } else {
-      // Look for credentials.
-      creds = _httpClient._findCredentials(uri);
-      if (creds != null) {
-        creds.authorize(request);
-      }
-    }
-
-    // Start sending the request (lazy, delayed until the user provides
-    // data).
-    _httpParser.isHead = method == "HEAD";
-    _streamFuture = outgoing.done.then<Socket>((Socket s) {
-      // Request sent, set up response completer.
-      var nextResponseCompleter = new Completer<_HttpIncoming>();
-      _nextResponseCompleter = nextResponseCompleter;
-
-      // Listen for response.
-      nextResponseCompleter.future.then((incoming) {
-        _currentUri = null;
-        incoming.dataDone.then((closing) {
-          if (incoming.upgraded) {
-            _httpClient._connectionClosed(this);
-            startTimer();
-            return;
-          }
-          if (closed) return;
-          if (!closing &&
-              !_dispose &&
-              incoming.headers.persistentConnection &&
-              request.persistentConnection) {
-            // Return connection, now we are done.
-            _httpClient._returnConnection(this);
-            _subscription!.resume();
-          } else {
-            destroy();
-          }
-        });
-        // For digest authentication if proxy check if the proxy
-        // requests the client to start using a new nonce for proxy
-        // authentication.
-        if (proxyCreds != null &&
-            proxyCreds.scheme == _AuthenticationScheme.DIGEST) {
-          var authInfo = incoming.headers["proxy-authentication-info"];
-          if (authInfo != null && authInfo.length == 1) {
-            var header =
-                _HeaderValue.parse(authInfo[0], parameterSeparator: ',');
-            var nextnonce = header.parameters["nextnonce"];
-            if (nextnonce != null) proxyCreds.nonce = nextnonce;
-          }
-        }
-        // For digest authentication check if the server requests the
-        // client to start using a new nonce.
-        if (creds != null && creds.scheme == _AuthenticationScheme.DIGEST) {
-          var authInfo = incoming.headers["authentication-info"];
-          if (authInfo != null && authInfo.length == 1) {
-            var header =
-                _HeaderValue.parse(authInfo[0], parameterSeparator: ',');
-            var nextnonce = header.parameters["nextnonce"];
-            if (nextnonce != null) creds.nonce = nextnonce;
-          }
-        }
-        request._onIncoming(incoming);
-      })
-          // If we see a state error, we failed to get the 'first'
-          // element.
-          .catchError((error) {
-        throw new HttpException("Connection closed before data was received",
-            uri: uri);
-      }, test: (error) => error is StateError).catchError((error, stackTrace) {
-        // We are done with the socket.
-        destroy();
-        request._onError(error, stackTrace);
-      });
-
-      // Resume the parser now we have a handler.
-      _subscription!.resume();
-      return s;
-    });
-    Future<Socket?>.value(_streamFuture).catchError((e) {
-      destroy();
-    });
-    return request;
-  }
-
-  Future<Socket> detachSocket() {
-    return _streamFuture!.then(
-        (_) => new _DetachedSocket(_socket, _httpParser.detachIncoming()));
-  }
-
-  void destroy() {
-    closed = true;
-    _httpClient._connectionClosed(this);
-    _socket.destroy();
-  }
-
-  void close() {
-    closed = true;
-    _httpClient._connectionClosed(this);
-    _streamFuture!
-        .timeout(_httpClient.idleTimeout)
-        .then((_) => _socket.destroy());
-  }
-
-  Future<_HttpClientConnection> createProxyTunnel(
-      String host,
-      int port,
-      _Proxy proxy,
-      bool callback(X509Certificate certificate),
-      TimelineTask? timeline) {
-    timeline?.instant('Establishing proxy tunnel', arguments: {
-      'proxyInfo': {
-        if (proxy.host != null) 'host': proxy.host,
-        if (proxy.port != null)
-          'port': proxy.port,
-        if (proxy.username != null)
-          'username': proxy.username,
-        // TODO(bkonyi): is this something we would want to surface? Initial
-        // thought is no.
-        // if (proxy.password != null)
-        //   'password': proxy.password,
-        'isDirect': proxy.isDirect,
-      }
-    });
-    final method = "CONNECT";
-    final uri = Uri(host: host, port: port);
-    _HttpClient._startRequestTimelineEvent(timeline, method, uri);
-    _HttpClientRequest request =
-        send(Uri(host: host, port: port), port, method, proxy, timeline);
-    if (proxy.isAuthenticated) {
-      // If the proxy configuration contains user information use that
-      // for proxy basic authorization.
-      String auth = _CryptoUtils.bytesToBase64(
-          utf8.encode("${proxy.username}:${proxy.password}"));
-      request.headers.set(HttpHeaders.proxyAuthorizationHeader, "Basic $auth");
-    }
-    return request.close().then((response) {
-      if (response.statusCode != HttpStatus.ok) {
-        final error = "Proxy failed to establish tunnel "
-            "(${response.statusCode} ${response.reasonPhrase})";
-        timeline?.instant(error);
-        throw new HttpException(error, uri: request.uri);
-      }
-      var socket = (response as _HttpClientResponse)
-          ._httpRequest
-          ._httpClientConnection
-          ._socket;
-      return SecureSocket.secure(socket,
-          host: host, context: _context, onBadCertificate: callback);
-    }).then((secureSocket) {
-      String key = _HttpClientConnection.makeKey(true, host, port);
-      timeline?.instant('Proxy tunnel established');
-      return new _HttpClientConnection(
-          key, secureSocket, request._httpClient, true);
-    });
-  }
-
-  HttpConnectionInfo? get connectionInfo => _HttpConnectionInfo.create(_socket);
-
-  static makeKey(bool isSecure, String host, int port) {
-    return isSecure ? "ssh:$host:$port" : "$host:$port";
-  }
-
-  void stopTimer() {
-    _idleTimer?.cancel();
-    _idleTimer = null;
-  }
-
-  void startTimer() {
-    assert(_idleTimer == null);
-    _idleTimer = new Timer(_httpClient.idleTimeout, () {
-      _idleTimer = null;
-      close();
-    });
-  }
-}
-
-class _ConnectionInfo {
-  final _HttpClientConnection connection;
-  final _Proxy proxy;
-
-  _ConnectionInfo(this.connection, this.proxy);
-}
-
-class _ConnectionTarget {
-  // Unique key for this connection target.
-  final String key;
-  final String host;
-  final int port;
-  final bool isSecure;
-  final SecurityContext? context;
-  final Set<_HttpClientConnection> _idle = new HashSet();
-  final Set<_HttpClientConnection> _active = new HashSet();
-  final Set<ConnectionTask> _socketTasks = new HashSet();
-  final Queue _pending = new ListQueue();
-  int _connecting = 0;
-
-  _ConnectionTarget(
-      this.key, this.host, this.port, this.isSecure, this.context);
-
-  bool get isEmpty => _idle.isEmpty && _active.isEmpty && _connecting == 0;
-
-  bool get hasIdle => _idle.isNotEmpty;
-
-  bool get hasActive => _active.isNotEmpty || _connecting > 0;
-
-  _HttpClientConnection takeIdle() {
-    assert(hasIdle);
-    _HttpClientConnection connection = _idle.first;
-    _idle.remove(connection);
-    connection.stopTimer();
-    _active.add(connection);
-    return connection;
-  }
-
-  _checkPending() {
-    if (_pending.isNotEmpty) {
-      _pending.removeFirst()();
-    }
-  }
-
-  void addNewActive(_HttpClientConnection connection) {
-    _active.add(connection);
-  }
-
-  void returnConnection(_HttpClientConnection connection) {
-    assert(_active.contains(connection));
-    _active.remove(connection);
-    _idle.add(connection);
-    connection.startTimer();
-    _checkPending();
-  }
-
-  void connectionClosed(_HttpClientConnection connection) {
-    assert(!_active.contains(connection) || !_idle.contains(connection));
-    _active.remove(connection);
-    _idle.remove(connection);
-    _checkPending();
-  }
-
-  void close(bool force) {
-    // Always cancel pending socket connections.
-    for (var t in _socketTasks.toList()) {
-      // Make sure the socket is destroyed if the ConnectionTask is cancelled.
-      t.socket.then((s) {
-        s.destroy();
-      }, onError: (e) {});
-      t.cancel();
-    }
-    if (force) {
-      for (var c in _idle.toList()) {
-        c.destroy();
-      }
-      for (var c in _active.toList()) {
-        c.destroy();
-      }
-    } else {
-      for (var c in _idle.toList()) {
-        c.close();
-      }
-    }
-  }
-
-  Future<_ConnectionInfo> connect(String uriHost, int uriPort, _Proxy proxy,
-      _HttpClient client, TimelineTask? timeline) {
-    if (hasIdle) {
-      var connection = takeIdle();
-      client._connectionsChanged();
-      return new Future.value(new _ConnectionInfo(connection, proxy));
-    }
-    var maxConnectionsPerHost = client.maxConnectionsPerHost;
-    if (maxConnectionsPerHost != null &&
-        _active.length + _connecting >= maxConnectionsPerHost) {
-      var completer = new Completer<_ConnectionInfo>();
-      _pending.add(() {
-        completer.complete(connect(uriHost, uriPort, proxy, client, timeline));
-      });
-      return completer.future;
-    }
-    var currentBadCertificateCallback = client._badCertificateCallback;
-
-    bool callback(X509Certificate certificate) {
-      if (currentBadCertificateCallback == null) return false;
-      return currentBadCertificateCallback(certificate, uriHost, uriPort);
-    }
-
-    Future<ConnectionTask> connectionTask = (isSecure && proxy.isDirect
-        ? SecureSocket.startConnect(host, port,
-            context: context, onBadCertificate: callback)
-        : Socket.startConnect(host, port));
-    _connecting++;
-    return connectionTask.then((ConnectionTask task) {
-      _socketTasks.add(task);
-      Future socketFuture = task.socket;
-      final Duration? connectionTimeout = client.connectionTimeout;
-      if (connectionTimeout != null) {
-        socketFuture = socketFuture.timeout(connectionTimeout, onTimeout: () {
-          _socketTasks.remove(task);
-          _connecting--;
-          task.cancel();
-          return null;
-        });
-      }
-      return socketFuture.then((socket) {
-        // When there is a timeout, there is a race in which the connectionTask
-        // Future won't be completed with an error before the socketFuture here
-        // is completed with 'null' by the onTimeout callback above. In this
-        // case, propagate a SocketException as specified by the
-        // HttpClient.connectionTimeout docs.
-        if (socket == null) {
-          assert(connectionTimeout != null);
-          throw new SocketException(
-              "HTTP connection timed out after ${connectionTimeout}, "
-              "host: ${host}, port: ${port}");
-        }
-        _connecting--;
-        socket.setOption(SocketOption.tcpNoDelay, true);
-        var connection =
-            new _HttpClientConnection(key, socket, client, false, context);
-        if (isSecure && !proxy.isDirect) {
-          connection._dispose = true;
-          return connection
-              .createProxyTunnel(uriHost, uriPort, proxy, callback, timeline)
-              .then((tunnel) {
-            client
-                ._getConnectionTarget(uriHost, uriPort, true)
-                .addNewActive(tunnel);
-            _socketTasks.remove(task);
-            return new _ConnectionInfo(tunnel, proxy);
-          });
-        } else {
-          addNewActive(connection);
-          _socketTasks.remove(task);
-          return new _ConnectionInfo(connection, proxy);
-        }
-      }, onError: (error) {
-        _connecting--;
-        _socketTasks.remove(task);
-        _checkPending();
-        throw error;
-      });
-    }, onError: (error) {
-      _connecting--;
-      throw error;
-    });
-  }
-}
-
-typedef bool BadCertificateCallback(X509Certificate cr, String host, int port);
-
-class _HttpClient implements HttpClient {
-  bool _closing = false;
-  bool _closingForcefully = false;
-  final Map<String, _ConnectionTarget> _connectionTargets =
-      new HashMap<String, _ConnectionTarget>();
-  final List<_Credentials> _credentials = [];
-  final List<_ProxyCredentials> _proxyCredentials = [];
-  final SecurityContext? _context;
-  Function? _authenticate;
-  Function? _authenticateProxy;
-  Function? _findProxy = HttpClient.findProxyFromEnvironment;
-  Duration _idleTimeout = const Duration(seconds: 15);
-  BadCertificateCallback? _badCertificateCallback;
-
-  Duration get idleTimeout => _idleTimeout;
-
-  Duration? connectionTimeout;
-
-  int? maxConnectionsPerHost;
-
-  bool autoUncompress = true;
-
-  String? userAgent = _getHttpVersion();
-
-  _HttpClient(this._context);
-
-  void set idleTimeout(Duration timeout) {
-    _idleTimeout = timeout;
-    for (var c in _connectionTargets.values) {
-      for (var idle in c._idle) {
-        // Reset timer. This is fine, as it's not happening often.
-        idle.stopTimer();
-        idle.startTimer();
-      }
-    }
-  }
-
-  set badCertificateCallback(
-      bool callback(X509Certificate cert, String host, int port)?) {
-    _badCertificateCallback = callback;
-  }
-
-  Future<HttpClientRequest> open(
-      String method, String host, int port, String path) {
-    const int hashMark = 0x23;
-    const int questionMark = 0x3f;
-    int fragmentStart = path.length;
-    int queryStart = path.length;
-    for (int i = path.length - 1; i >= 0; i--) {
-      var char = path.codeUnitAt(i);
-      if (char == hashMark) {
-        fragmentStart = i;
-        queryStart = i;
-      } else if (char == questionMark) {
-        queryStart = i;
-      }
-    }
-    String? query;
-    if (queryStart < fragmentStart) {
-      query = path.substring(queryStart + 1, fragmentStart);
-      path = path.substring(0, queryStart);
-    }
-    Uri uri = new Uri(
-        scheme: "http", host: host, port: port, path: path, query: query);
-    return _openUrl(method, uri);
-  }
-
-  Future<HttpClientRequest> openUrl(String method, Uri url) =>
-      _openUrl(method, url);
-
-  Future<HttpClientRequest> get(String host, int port, String path) =>
-      open("get", host, port, path);
-
-  Future<HttpClientRequest> getUrl(Uri url) => _openUrl("get", url);
-
-  Future<HttpClientRequest> post(String host, int port, String path) =>
-      open("post", host, port, path);
-
-  Future<HttpClientRequest> postUrl(Uri url) => _openUrl("post", url);
-
-  Future<HttpClientRequest> put(String host, int port, String path) =>
-      open("put", host, port, path);
-
-  Future<HttpClientRequest> putUrl(Uri url) => _openUrl("put", url);
-
-  Future<HttpClientRequest> delete(String host, int port, String path) =>
-      open("delete", host, port, path);
-
-  Future<HttpClientRequest> deleteUrl(Uri url) => _openUrl("delete", url);
-
-  Future<HttpClientRequest> head(String host, int port, String path) =>
-      open("head", host, port, path);
-
-  Future<HttpClientRequest> headUrl(Uri url) => _openUrl("head", url);
-
-  Future<HttpClientRequest> patch(String host, int port, String path) =>
-      open("patch", host, port, path);
-
-  Future<HttpClientRequest> patchUrl(Uri url) => _openUrl("patch", url);
-
-  void close({bool force = false}) {
-    _closing = true;
-    _closingForcefully = force;
-    _closeConnections(_closingForcefully);
-    assert(!_connectionTargets.values.any((s) => s.hasIdle));
-    assert(
-        !force || !_connectionTargets.values.any((s) => s._active.isNotEmpty));
-  }
-
-  set authenticate(Future<bool> f(Uri url, String scheme, String realm)?) {
-    _authenticate = f;
-  }
-
-  void addCredentials(Uri url, String realm, HttpClientCredentials cr) {
-    _credentials
-        .add(new _SiteCredentials(url, realm, cr as _HttpClientCredentials));
-  }
-
-  set authenticateProxy(
-      Future<bool> f(String host, int port, String scheme, String realm)?) {
-    _authenticateProxy = f;
-  }
-
-  void addProxyCredentials(
-      String host, int port, String realm, HttpClientCredentials cr) {
-    _proxyCredentials.add(
-        new _ProxyCredentials(host, port, realm, cr as _HttpClientCredentials));
-  }
-
-  set findProxy(String f(Uri uri)?) => _findProxy = f;
-
-  static void _startRequestTimelineEvent(
-      TimelineTask? timeline, String method, Uri uri) {
-    timeline?.start('HTTP CLIENT ${method.toUpperCase()}', arguments: {
-      'method': method.toUpperCase(),
-      'uri': uri.toString(),
-    });
-  }
-
-  /// Whether HTTP requests are currently allowed.
-  ///
-  /// If the [Zone] variable `#dart.library.io.allow_http` is set to a boolean,
-  /// it determines whether the HTTP protocol is allowed. If the zone variable
-  /// is set to any other non-null value, HTTP is not allowed.
-  /// Otherwise, if the `dart.library.io.allow_http` environment flag
-  /// is set to `false`, HTTP is not allowed.
-  /// Otherwise, [_embedderAllowsHttp] determines the result.
-  bool get _isHttpAllowed {
-    final zoneOverride = Zone.current[#dart.library.io.allow_http];
-    if (zoneOverride != null) return true == zoneOverride;
-    bool envOverride =
-        bool.fromEnvironment("dart.library.io.allow_http", defaultValue: true);
-    return envOverride && _embedderAllowsHttp;
-  }
-
-  bool _isLoopback(String host) {
-    if (host.isEmpty) return false;
-    if ("localhost" == host) return true;
-    try {
-      return InternetAddress(host).isLoopback;
-    } on ArgumentError {
-      return false;
-    }
-  }
-
-  Future<_HttpClientRequest> _openUrl(String method, Uri uri) {
-    if (_closing) {
-      throw new StateError("Client is closed");
-    }
-
-    // Ignore any fragments on the request URI.
-    uri = uri.removeFragment();
-
-    if (method == null) {
-      throw new ArgumentError(method);
-    }
-    if (method != "CONNECT") {
-      if (uri.host.isEmpty) {
-        throw new ArgumentError("No host specified in URI $uri");
-      } else if (uri.scheme != "http" && uri.scheme != "https") {
-        throw new ArgumentError(
-            "Unsupported scheme '${uri.scheme}' in URI $uri");
-      }
-    }
-
-    bool isSecure = uri.isScheme("https");
-    if (!_isHttpAllowed && !isSecure && !_isLoopback(uri.host)) {
-      throw new StateError(
-          "Insecure HTTP is not allowed by the current platform: $uri");
-    }
-
-    int port = uri.port;
-    if (port == 0) {
-      port =
-          isSecure ? HttpClient.defaultHttpsPort : HttpClient.defaultHttpPort;
-    }
-    // Check to see if a proxy server should be used for this connection.
-    var proxyConf = const _ProxyConfiguration.direct();
-    var findProxy = _findProxy;
-    if (findProxy != null) {
-      // TODO(sgjesse): Keep a map of these as normally only a few
-      // configuration strings will be used.
-      try {
-        proxyConf = new _ProxyConfiguration(findProxy(uri));
-      } catch (error, stackTrace) {
-        return new Future.error(error, stackTrace);
-      }
-    }
-    TimelineTask? timeline;
-    // TODO(bkonyi): do we want this to be opt-in?
-    if (HttpClient.enableTimelineLogging) {
-      timeline = TimelineTask(filterKey: 'HTTP/client');
-      _startRequestTimelineEvent(timeline, method, uri);
-    }
-    return _getConnection(uri.host, port, proxyConf, isSecure, timeline).then(
-        (_ConnectionInfo info) {
-      _HttpClientRequest send(_ConnectionInfo info) {
-        timeline?.instant('Connection established');
-        return info.connection
-            .send(uri, port, method.toUpperCase(), info.proxy, timeline);
-      }
-
-      // If the connection was closed before the request was sent, create
-      // and use another connection.
-      if (info.connection.closed) {
-        return _getConnection(uri.host, port, proxyConf, isSecure, timeline)
-            .then(send);
-      }
-      return send(info);
-    }, onError: (error) {
-      timeline?.finish(arguments: {
-        'error': error.toString(),
-      });
-      throw error;
-    });
-  }
-
-  Future<_HttpClientRequest> _openUrlFromRequest(
-      String method, Uri uri, _HttpClientRequest previous) {
-    // If the new URI is relative (to either '/' or some sub-path),
-    // construct a full URI from the previous one.
-    Uri resolved = previous.uri.resolveUri(uri);
-    return _openUrl(method, resolved).then((_HttpClientRequest request) {
-      request
-        // Only follow redirects if initial request did.
-        ..followRedirects = previous.followRedirects
-        // Allow same number of redirects.
-        ..maxRedirects = previous.maxRedirects;
-      // Copy headers.
-      for (var header in previous.headers._headers.keys) {
-        if (request.headers[header] == null) {
-          request.headers.set(header, previous.headers[header]!);
-        }
-      }
-      return request
-        ..headers.chunkedTransferEncoding = false
-        ..contentLength = 0;
-    });
-  }
-
-  // Return a live connection to the idle pool.
-  void _returnConnection(_HttpClientConnection connection) {
-    _connectionTargets[connection.key]!.returnConnection(connection);
-    _connectionsChanged();
-  }
-
-  // Remove a closed connection from the active set.
-  void _connectionClosed(_HttpClientConnection connection) {
-    connection.stopTimer();
-    var connectionTarget = _connectionTargets[connection.key];
-    if (connectionTarget != null) {
-      connectionTarget.connectionClosed(connection);
-      if (connectionTarget.isEmpty) {
-        _connectionTargets.remove(connection.key);
-      }
-      _connectionsChanged();
-    }
-  }
-
-  void _connectionsChanged() {
-    if (_closing) {
-      _closeConnections(_closingForcefully);
-    }
-  }
-
-  void _closeConnections(bool force) {
-    for (var connectionTarget in _connectionTargets.values.toList()) {
-      connectionTarget.close(force);
-    }
-  }
-
-  _ConnectionTarget _getConnectionTarget(String host, int port, bool isSecure) {
-    String key = _HttpClientConnection.makeKey(isSecure, host, port);
-    return _connectionTargets.putIfAbsent(key, () {
-      return new _ConnectionTarget(key, host, port, isSecure, _context);
-    });
-  }
-
-  // Get a new _HttpClientConnection, from the matching _ConnectionTarget.
-  Future<_ConnectionInfo> _getConnection(String uriHost, int uriPort,
-      _ProxyConfiguration proxyConf, bool isSecure, TimelineTask? timeline) {
-    Iterator<_Proxy> proxies = proxyConf.proxies.iterator;
-
-    Future<_ConnectionInfo> connect(error) {
-      if (!proxies.moveNext()) return new Future.error(error);
-      _Proxy proxy = proxies.current;
-      String host = proxy.isDirect ? uriHost : proxy.host!;
-      int port = proxy.isDirect ? uriPort : proxy.port!;
-      return _getConnectionTarget(host, port, isSecure)
-          .connect(uriHost, uriPort, proxy, this, timeline)
-          // On error, continue with next proxy.
-          .catchError(connect);
-    }
-
-    return connect(new HttpException("No proxies given"));
-  }
-
-  _SiteCredentials? _findCredentials(Uri url, [_AuthenticationScheme? scheme]) {
-    // Look for credentials.
-    _SiteCredentials? cr =
-        _credentials.fold(null, (_SiteCredentials? prev, value) {
-      var siteCredentials = value as _SiteCredentials;
-      if (siteCredentials.applies(url, scheme)) {
-        if (prev == null) return value;
-        return siteCredentials.uri.path.length > prev.uri.path.length
-            ? siteCredentials
-            : prev;
-      } else {
-        return prev;
-      }
-    });
-    return cr;
-  }
-
-  _ProxyCredentials? _findProxyCredentials(_Proxy proxy,
-      [_AuthenticationScheme? scheme]) {
-    // Look for credentials.
-    for (var current in _proxyCredentials) {
-      if (current.applies(proxy, scheme)) {
-        return current;
-      }
-    }
-    return null;
-  }
-
-  void _removeCredentials(_Credentials cr) {
-    int index = _credentials.indexOf(cr);
-    if (index != -1) {
-      _credentials.removeAt(index);
-    }
-  }
-
-  void _removeProxyCredentials(_Credentials cr) {
-    _proxyCredentials.remove(cr);
-  }
-
-  static String _findProxyFromEnvironment(
-      Uri url, Map<String, String>? environment) {
-    String? checkNoProxy(String? option) {
-      if (option == null) return null;
-      Iterator<String> names = option.split(",").map((s) => s.trim()).iterator;
-      while (names.moveNext()) {
-        var name = names.current;
-        if ((name.startsWith("[") &&
-                name.endsWith("]") &&
-                "[${url.host}]" == name) ||
-            (name.isNotEmpty && url.host.endsWith(name))) {
-          return "DIRECT";
-        }
-      }
-      return null;
-    }
-
-    String? checkProxy(String? option) {
-      if (option == null) return null;
-      option = option.trim();
-      if (option.isEmpty) return null;
-      int pos = option.indexOf("://");
-      if (pos >= 0) {
-        option = option.substring(pos + 3);
-      }
-      pos = option.indexOf("/");
-      if (pos >= 0) {
-        option = option.substring(0, pos);
-      }
-      // Add default port if no port configured.
-      if (option.indexOf("[") == 0) {
-        var pos = option.lastIndexOf(":");
-        if (option.indexOf("]") > pos) option = "$option:1080";
-      } else {
-        if (option.indexOf(":") == -1) option = "$option:1080";
-      }
-      return "PROXY $option";
-    }
-
-    // Default to using the process current environment.
-    if (environment == null) environment = _platformEnvironmentCache;
-
-    String? proxyCfg;
-
-    String? noProxy = environment["no_proxy"] ?? environment["NO_PROXY"];
-    proxyCfg = checkNoProxy(noProxy);
-    if (proxyCfg != null) {
-      return proxyCfg;
-    }
-
-    if (url.scheme == "http") {
-      String? proxy = environment["http_proxy"] ?? environment["HTTP_PROXY"];
-      proxyCfg = checkProxy(proxy);
-      if (proxyCfg != null) {
-        return proxyCfg;
-      }
-    } else if (url.scheme == "https") {
-      String? proxy = environment["https_proxy"] ?? environment["HTTPS_PROXY"];
-      proxyCfg = checkProxy(proxy);
-      if (proxyCfg != null) {
-        return proxyCfg;
-      }
-    }
-    return "DIRECT";
-  }
-
-  static Map<String, String> _platformEnvironmentCache = Platform.environment;
-}
-
-class _HttpConnection extends LinkedListEntry<_HttpConnection>
-    with _ServiceObject {
-  static const _ACTIVE = 0;
-  static const _IDLE = 1;
-  static const _CLOSING = 2;
-  static const _DETACHED = 3;
-
-  // Use HashMap, as we don't need to keep order.
-  static Map<int, _HttpConnection> _connections =
-      new HashMap<int, _HttpConnection>();
-
-  final /*_ServerSocket*/ _socket;
-  final _HttpServer _httpServer;
-  final _HttpParser _httpParser;
-  int _state = _IDLE;
-  StreamSubscription? _subscription;
-  bool _idleMark = false;
-  Future? _streamFuture;
-
-  _HttpConnection(this._socket, this._httpServer)
-      : _httpParser = new _HttpParser.requestParser() {
-    _connections[_serviceId] = this;
-    _httpParser.listenToStream(_socket);
-    _subscription = _httpParser.listen((incoming) {
-      _httpServer._markActive(this);
-      // If the incoming was closed, close the connection.
-      incoming.dataDone.then((closing) {
-        if (closing) destroy();
-      });
-      // Only handle one incoming request at the time. Keep the
-      // stream paused until the request has been send.
-      _subscription!.pause();
-      _state = _ACTIVE;
-      var outgoing = new _HttpOutgoing(_socket);
-      var response = new _HttpResponse(
-          incoming.uri!,
-          incoming.headers.protocolVersion,
-          outgoing,
-          _httpServer.defaultResponseHeaders,
-          _httpServer.serverHeader);
-      // Parser found badRequest and sent out Response.
-      if (incoming.statusCode == HttpStatus.badRequest) {
-        response.statusCode = HttpStatus.badRequest;
-      }
-      var request = new _HttpRequest(response, incoming, _httpServer, this);
-      _streamFuture = outgoing.done.then((_) {
-        response.deadline = null;
-        if (_state == _DETACHED) return;
-        if (response.persistentConnection &&
-            request.persistentConnection &&
-            incoming.fullBodyRead &&
-            !_httpParser.upgrade &&
-            !_httpServer.closed) {
-          _state = _IDLE;
-          _idleMark = false;
-          _httpServer._markIdle(this);
-          // Resume the subscription for incoming requests as the
-          // request is now processed.
-          _subscription!.resume();
-        } else {
-          // Close socket, keep-alive not used or body sent before
-          // received data was handled.
-          destroy();
-        }
-      }, onError: (_) {
-        destroy();
-      });
-      outgoing.ignoreBody = request.method == "HEAD";
-      response._httpRequest = request;
-      _httpServer._handleRequest(request);
-    }, onDone: () {
-      destroy();
-    }, onError: (error) {
-      // Ignore failed requests that was closed before headers was received.
-      destroy();
-    });
-  }
-
-  void markIdle() {
-    _idleMark = true;
-  }
-
-  bool get isMarkedIdle => _idleMark;
-
-  void destroy() {
-    if (_state == _CLOSING || _state == _DETACHED) return;
-    _state = _CLOSING;
-    _socket.destroy();
-    _httpServer._connectionClosed(this);
-    _connections.remove(_serviceId);
-  }
-
-  Future<Socket> detachSocket() {
-    _state = _DETACHED;
-    // Remove connection from server.
-    _httpServer._connectionClosed(this);
-
-    _HttpDetachedIncoming detachedIncoming = _httpParser.detachIncoming();
-
-    return _streamFuture!.then((_) {
-      _connections.remove(_serviceId);
-      return new _DetachedSocket(_socket, detachedIncoming);
-    });
-  }
-
-  HttpConnectionInfo? get connectionInfo => _HttpConnectionInfo.create(_socket);
-
-  bool get _isActive => _state == _ACTIVE;
-  bool get _isIdle => _state == _IDLE;
-  bool get _isClosing => _state == _CLOSING;
-  bool get _isDetached => _state == _DETACHED;
-
-  String get _serviceTypePath => 'io/http/serverconnections';
-  String get _serviceTypeName => 'HttpServerConnection';
-
-  Map _toJSON(bool ref) {
-    var name = "${_socket.address.host}:${_socket.port} <-> "
-        "${_socket.remoteAddress.host}:${_socket.remotePort}";
-    var r = <String, dynamic>{
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': name,
-      'user_name': name,
-    };
-    if (ref) {
-      return r;
-    }
-    r['server'] = _httpServer._toJSON(true);
-    try {
-      r['socket'] = _socket._toJSON(true);
-    } catch (_) {
-      r['socket'] = {
-        'id': _servicePath,
-        'type': '@Socket',
-        'name': 'UserSocket',
-        'user_name': 'UserSocket',
-      };
-    }
-    switch (_state) {
-      case _ACTIVE:
-        r['state'] = "Active";
-        break;
-      case _IDLE:
-        r['state'] = "Idle";
-        break;
-      case _CLOSING:
-        r['state'] = "Closing";
-        break;
-      case _DETACHED:
-        r['state'] = "Detached";
-        break;
-      default:
-        r['state'] = 'Unknown';
-        break;
-    }
-    return r;
-  }
-}
-
-// HTTP server waiting for socket connections.
-class _HttpServer extends Stream<HttpRequest>
-    with _ServiceObject
-    implements HttpServer {
-  // Use default Map so we keep order.
-  static Map<int, _HttpServer> _servers = new Map<int, _HttpServer>();
-
-  String? serverHeader;
-  final HttpHeaders defaultResponseHeaders = _initDefaultResponseHeaders();
-  bool autoCompress = false;
-
-  Duration? _idleTimeout;
-  Timer? _idleTimer;
-
-  static Future<HttpServer> bind(
-      address, int port, int backlog, bool v6Only, bool shared) {
-    return ServerSocket.bind(address, port,
-            backlog: backlog, v6Only: v6Only, shared: shared)
-        .then<HttpServer>((socket) {
-      return new _HttpServer._(socket, true);
-    });
-  }
-
-  static Future<HttpServer> bindSecure(
-      address,
-      int port,
-      SecurityContext? context,
-      int backlog,
-      bool v6Only,
-      bool requestClientCertificate,
-      bool shared) {
-    return SecureServerSocket.bind(address, port, context,
-            backlog: backlog,
-            v6Only: v6Only,
-            requestClientCertificate: requestClientCertificate,
-            shared: shared)
-        .then<HttpServer>((socket) {
-      return new _HttpServer._(socket, true);
-    });
-  }
-
-  _HttpServer._(this._serverSocket, this._closeServer)
-      : _controller = new StreamController<HttpRequest>(sync: true) {
-    _controller.onCancel = close;
-    idleTimeout = const Duration(seconds: 120);
-    _servers[_serviceId] = this;
-  }
-
-  _HttpServer.listenOn(this._serverSocket)
-      : _closeServer = false,
-        _controller = new StreamController<HttpRequest>(sync: true) {
-    _controller.onCancel = close;
-    idleTimeout = const Duration(seconds: 120);
-    _servers[_serviceId] = this;
-  }
-
-  static HttpHeaders _initDefaultResponseHeaders() {
-    var defaultResponseHeaders = new _HttpHeaders('1.1');
-    defaultResponseHeaders.contentType = ContentType.text;
-    defaultResponseHeaders.set('X-Frame-Options', 'SAMEORIGIN');
-    defaultResponseHeaders.set('X-Content-Type-Options', 'nosniff');
-    defaultResponseHeaders.set('X-XSS-Protection', '1; mode=block');
-    return defaultResponseHeaders;
-  }
-
-  Duration? get idleTimeout => _idleTimeout;
-
-  void set idleTimeout(Duration? duration) {
-    var idleTimer = _idleTimer;
-    if (idleTimer != null) {
-      idleTimer.cancel();
-      _idleTimer = null;
-    }
-    _idleTimeout = duration;
-    if (duration != null) {
-      _idleTimer = new Timer.periodic(duration, (_) {
-        for (var idle in _idleConnections.toList()) {
-          if (idle.isMarkedIdle) {
-            idle.destroy();
-          } else {
-            idle.markIdle();
-          }
-        }
-      });
-    }
-  }
-
-  StreamSubscription<HttpRequest> listen(void onData(HttpRequest event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    _serverSocket.listen((Socket socket) {
-      socket.setOption(SocketOption.tcpNoDelay, true);
-      // Accept the client connection.
-      _HttpConnection connection = new _HttpConnection(socket, this);
-      _idleConnections.add(connection);
-    }, onError: (error, stackTrace) {
-      // Ignore HandshakeExceptions as they are bound to a single request,
-      // and are not fatal for the server.
-      if (error is! HandshakeException) {
-        _controller.addError(error, stackTrace);
-      }
-    }, onDone: _controller.close);
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Future close({bool force = false}) {
-    closed = true;
-    Future result;
-    if (_serverSocket != null && _closeServer) {
-      result = _serverSocket.close();
-    } else {
-      result = new Future.value();
-    }
-    idleTimeout = null;
-    if (force) {
-      for (var c in _activeConnections.toList()) {
-        c.destroy();
-      }
-      assert(_activeConnections.isEmpty);
-    }
-    for (var c in _idleConnections.toList()) {
-      c.destroy();
-    }
-    _maybePerformCleanup();
-    return result;
-  }
-
-  void _maybePerformCleanup() {
-    var sessionManager = _sessionManagerInstance;
-    if (closed &&
-        _idleConnections.isEmpty &&
-        _activeConnections.isEmpty &&
-        sessionManager != null) {
-      sessionManager.close();
-      _sessionManagerInstance = null;
-      _servers.remove(_serviceId);
-    }
-  }
-
-  int get port {
-    if (closed) throw new HttpException("HttpServer is not bound to a socket");
-    return _serverSocket.port;
-  }
-
-  InternetAddress get address {
-    if (closed) throw new HttpException("HttpServer is not bound to a socket");
-    return _serverSocket.address;
-  }
-
-  set sessionTimeout(int timeout) {
-    _sessionManager.sessionTimeout = timeout;
-  }
-
-  void _handleRequest(_HttpRequest request) {
-    if (!closed) {
-      _controller.add(request);
-    } else {
-      request._httpConnection.destroy();
-    }
-  }
-
-  void _connectionClosed(_HttpConnection connection) {
-    // Remove itself from either idle or active connections.
-    connection.unlink();
-    _maybePerformCleanup();
-  }
-
-  void _markIdle(_HttpConnection connection) {
-    _activeConnections.remove(connection);
-    _idleConnections.add(connection);
-  }
-
-  void _markActive(_HttpConnection connection) {
-    _idleConnections.remove(connection);
-    _activeConnections.add(connection);
-  }
-
-  // Lazy init.
-  _HttpSessionManager get _sessionManager =>
-      _sessionManagerInstance ??= _HttpSessionManager();
-
-  HttpConnectionsInfo connectionsInfo() {
-    HttpConnectionsInfo result = new HttpConnectionsInfo();
-    result.total = _activeConnections.length + _idleConnections.length;
-    _activeConnections.forEach((_HttpConnection conn) {
-      if (conn._isActive) {
-        result.active++;
-      } else {
-        assert(conn._isClosing);
-        result.closing++;
-      }
-    });
-    _idleConnections.forEach((_HttpConnection conn) {
-      result.idle++;
-      assert(conn._isIdle);
-    });
-    return result;
-  }
-
-  String get _serviceTypePath => 'io/http/servers';
-  String get _serviceTypeName => 'HttpServer';
-
-  Map<String, dynamic> _toJSON(bool ref) {
-    var r = <String, dynamic>{
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': '${address.host}:$port',
-      'user_name': '${address.host}:$port',
-    };
-    if (ref) {
-      return r;
-    }
-    try {
-      r['socket'] = _serverSocket._toJSON(true);
-    } catch (_) {
-      r['socket'] = {
-        'id': _servicePath,
-        'type': '@Socket',
-        'name': 'UserSocket',
-        'user_name': 'UserSocket',
-      };
-    }
-    r['port'] = port;
-    r['address'] = address.host;
-    r['active'] = _activeConnections.map((c) => c._toJSON(true)).toList();
-    r['idle'] = _idleConnections.map((c) => c._toJSON(true)).toList();
-    r['closed'] = closed;
-    return r;
-  }
-
-  _HttpSessionManager? _sessionManagerInstance;
-
-  // Indicated if the http server has been closed.
-  bool closed = false;
-
-  // The server listen socket. Untyped as it can be both ServerSocket and
-  // SecureServerSocket.
-  final dynamic /*ServerSocket|SecureServerSocket*/ _serverSocket;
-  final bool _closeServer;
-
-  // Set of currently connected clients.
-  final LinkedList<_HttpConnection> _activeConnections =
-      new LinkedList<_HttpConnection>();
-  final LinkedList<_HttpConnection> _idleConnections =
-      new LinkedList<_HttpConnection>();
-  StreamController<HttpRequest> _controller;
-}
-
-class _ProxyConfiguration {
-  static const String PROXY_PREFIX = "PROXY ";
-  static const String DIRECT_PREFIX = "DIRECT";
-
-  _ProxyConfiguration(String configuration) : proxies = <_Proxy>[] {
-    if (configuration == null) {
-      throw new HttpException("Invalid proxy configuration $configuration");
-    }
-    List<String> list = configuration.split(";");
-    list.forEach((String proxy) {
-      proxy = proxy.trim();
-      if (!proxy.isEmpty) {
-        if (proxy.startsWith(PROXY_PREFIX)) {
-          String? username;
-          String? password;
-          // Skip the "PROXY " prefix.
-          proxy = proxy.substring(PROXY_PREFIX.length).trim();
-          // Look for proxy authentication.
-          int at = proxy.indexOf("@");
-          if (at != -1) {
-            String userinfo = proxy.substring(0, at).trim();
-            proxy = proxy.substring(at + 1).trim();
-            int colon = userinfo.indexOf(":");
-            if (colon == -1 || colon == 0 || colon == proxy.length - 1) {
-              throw new HttpException(
-                  "Invalid proxy configuration $configuration");
-            }
-            username = userinfo.substring(0, colon).trim();
-            password = userinfo.substring(colon + 1).trim();
-          }
-          // Look for proxy host and port.
-          int colon = proxy.lastIndexOf(":");
-          if (colon == -1 || colon == 0 || colon == proxy.length - 1) {
-            throw new HttpException(
-                "Invalid proxy configuration $configuration");
-          }
-          String host = proxy.substring(0, colon).trim();
-          if (host.startsWith("[") && host.endsWith("]")) {
-            host = host.substring(1, host.length - 1);
-          }
-          String portString = proxy.substring(colon + 1).trim();
-          int port;
-          try {
-            port = int.parse(portString);
-          } on FormatException catch (e) {
-            throw new HttpException(
-                "Invalid proxy configuration $configuration, "
-                "invalid port '$portString'");
-          }
-          proxies.add(new _Proxy(host, port, username, password));
-        } else if (proxy.trim() == DIRECT_PREFIX) {
-          proxies.add(new _Proxy.direct());
-        } else {
-          throw new HttpException("Invalid proxy configuration $configuration");
-        }
-      }
-    });
-  }
-
-  const _ProxyConfiguration.direct() : proxies = const [const _Proxy.direct()];
-
-  final List<_Proxy> proxies;
-}
-
-class _Proxy {
-  final String? host;
-  final int? port;
-  final String? username;
-  final String? password;
-  final bool isDirect;
-
-  const _Proxy(String this.host, int this.port, this.username, this.password)
-      : isDirect = false;
-  const _Proxy.direct()
-      : host = null,
-        port = null,
-        username = null,
-        password = null,
-        isDirect = true;
-
-  bool get isAuthenticated => username != null;
-}
-
-class _HttpConnectionInfo implements HttpConnectionInfo {
-  InternetAddress remoteAddress;
-  int remotePort;
-  int localPort;
-
-  _HttpConnectionInfo(this.remoteAddress, this.remotePort, this.localPort);
-
-  static _HttpConnectionInfo? create(Socket socket) {
-    if (socket == null) return null;
-    try {
-      return _HttpConnectionInfo(
-          socket.remoteAddress, socket.remotePort, socket.port);
-    } catch (e) {}
-    return null;
-  }
-}
-
-class _DetachedSocket extends Stream<Uint8List> implements Socket {
-  final Stream<Uint8List> _incoming;
-  final Socket _socket;
-
-  _DetachedSocket(this._socket, this._incoming);
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _incoming.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Encoding get encoding => _socket.encoding;
-
-  void set encoding(Encoding value) {
-    _socket.encoding = value;
-  }
-
-  void write(Object? obj) {
-    _socket.write(obj);
-  }
-
-  void writeln([Object? obj = ""]) {
-    _socket.writeln(obj);
-  }
-
-  void writeCharCode(int charCode) {
-    _socket.writeCharCode(charCode);
-  }
-
-  void writeAll(Iterable objects, [String separator = ""]) {
-    _socket.writeAll(objects, separator);
-  }
-
-  void add(List<int> bytes) {
-    _socket.add(bytes);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) =>
-      _socket.addError(error, stackTrace);
-
-  Future addStream(Stream<List<int>> stream) {
-    return _socket.addStream(stream);
-  }
-
-  void destroy() {
-    _socket.destroy();
-  }
-
-  Future flush() => _socket.flush();
-
-  Future close() => _socket.close();
-
-  Future get done => _socket.done;
-
-  int get port => _socket.port;
-
-  InternetAddress get address => _socket.address;
-
-  InternetAddress get remoteAddress => _socket.remoteAddress;
-
-  int get remotePort => _socket.remotePort;
-
-  bool setOption(SocketOption option, bool enabled) {
-    return _socket.setOption(option, enabled);
-  }
-
-  Uint8List getRawOption(RawSocketOption option) {
-    return _socket.getRawOption(option);
-  }
-
-  void setRawOption(RawSocketOption option) {
-    _socket.setRawOption(option);
-  }
-
-  Map _toJSON(bool ref) {
-    return (_socket as dynamic)._toJSON(ref);
-  }
-}
-
-class _AuthenticationScheme {
-  final int _scheme;
-
-  static const UNKNOWN = const _AuthenticationScheme(-1);
-  static const BASIC = const _AuthenticationScheme(0);
-  static const DIGEST = const _AuthenticationScheme(1);
-
-  const _AuthenticationScheme(this._scheme);
-
-  factory _AuthenticationScheme.fromString(String scheme) {
-    if (scheme.toLowerCase() == "basic") return BASIC;
-    if (scheme.toLowerCase() == "digest") return DIGEST;
-    return UNKNOWN;
-  }
-
-  String toString() {
-    if (this == BASIC) return "Basic";
-    if (this == DIGEST) return "Digest";
-    return "Unknown";
-  }
-}
-
-abstract class _Credentials {
-  _HttpClientCredentials credentials;
-  String realm;
-  bool used = false;
-
-  // Digest specific fields.
-  String? ha1;
-  String? nonce;
-  String? algorithm;
-  String? qop;
-  int? nonceCount;
-
-  _Credentials(this.credentials, this.realm) {
-    if (credentials.scheme == _AuthenticationScheme.DIGEST) {
-      // Calculate the H(A1) value once. There is no mentioning of
-      // username/password encoding in RFC 2617. However there is an
-      // open draft for adding an additional accept-charset parameter to
-      // the WWW-Authenticate and Proxy-Authenticate headers, see
-      // http://tools.ietf.org/html/draft-reschke-basicauth-enc-06. For
-      // now always use UTF-8 encoding.
-      var creds = credentials as _HttpClientDigestCredentials;
-      var hasher = new _MD5()
-        ..add(utf8.encode(creds.username))
-        ..add([_CharCode.COLON])
-        ..add(realm.codeUnits)
-        ..add([_CharCode.COLON])
-        ..add(utf8.encode(creds.password));
-      ha1 = _CryptoUtils.bytesToHex(hasher.close());
-    }
-  }
-
-  _AuthenticationScheme get scheme => credentials.scheme;
-
-  void authorize(HttpClientRequest request);
-}
-
-class _SiteCredentials extends _Credentials {
-  Uri uri;
-
-  _SiteCredentials(this.uri, realm, _HttpClientCredentials creds)
-      : super(creds, realm);
-
-  bool applies(Uri uri, _AuthenticationScheme? scheme) {
-    if (scheme != null && credentials.scheme != scheme) return false;
-    if (uri.host != this.uri.host) return false;
-    int thisPort =
-        this.uri.port == 0 ? HttpClient.defaultHttpPort : this.uri.port;
-    int otherPort = uri.port == 0 ? HttpClient.defaultHttpPort : uri.port;
-    if (otherPort != thisPort) return false;
-    return uri.path.startsWith(this.uri.path);
-  }
-
-  void authorize(HttpClientRequest request) {
-    // Digest credentials cannot be used without a nonce from the
-    // server.
-    if (credentials.scheme == _AuthenticationScheme.DIGEST && nonce == null) {
-      return;
-    }
-    credentials.authorize(this, request as _HttpClientRequest);
-    used = true;
-  }
-}
-
-class _ProxyCredentials extends _Credentials {
-  String host;
-  int port;
-
-  _ProxyCredentials(this.host, this.port, realm, _HttpClientCredentials creds)
-      : super(creds, realm);
-
-  bool applies(_Proxy proxy, _AuthenticationScheme? scheme) {
-    if (scheme != null && credentials.scheme != scheme) return false;
-    return proxy.host == host && proxy.port == port;
-  }
-
-  void authorize(HttpClientRequest request) {
-    // Digest credentials cannot be used without a nonce from the
-    // server.
-    if (credentials.scheme == _AuthenticationScheme.DIGEST && nonce == null) {
-      return;
-    }
-    credentials.authorizeProxy(this, request as _HttpClientRequest);
-  }
-}
-
-abstract class _HttpClientCredentials implements HttpClientCredentials {
-  _AuthenticationScheme get scheme;
-  void authorize(_Credentials credentials, _HttpClientRequest request);
-  void authorizeProxy(_ProxyCredentials credentials, HttpClientRequest request);
-}
-
-class _HttpClientBasicCredentials extends _HttpClientCredentials
-    implements HttpClientBasicCredentials {
-  String username;
-  String password;
-
-  _HttpClientBasicCredentials(this.username, this.password);
-
-  _AuthenticationScheme get scheme => _AuthenticationScheme.BASIC;
-
-  String authorization() {
-    // There is no mentioning of username/password encoding in RFC
-    // 2617. However there is an open draft for adding an additional
-    // accept-charset parameter to the WWW-Authenticate and
-    // Proxy-Authenticate headers, see
-    // http://tools.ietf.org/html/draft-reschke-basicauth-enc-06. For
-    // now always use UTF-8 encoding.
-    String auth =
-        _CryptoUtils.bytesToBase64(utf8.encode("$username:$password"));
-    return "Basic $auth";
-  }
-
-  void authorize(_Credentials _, HttpClientRequest request) {
-    request.headers.set(HttpHeaders.authorizationHeader, authorization());
-  }
-
-  void authorizeProxy(_ProxyCredentials _, HttpClientRequest request) {
-    request.headers.set(HttpHeaders.proxyAuthorizationHeader, authorization());
-  }
-}
-
-class _HttpClientDigestCredentials extends _HttpClientCredentials
-    implements HttpClientDigestCredentials {
-  String username;
-  String password;
-
-  _HttpClientDigestCredentials(this.username, this.password);
-
-  _AuthenticationScheme get scheme => _AuthenticationScheme.DIGEST;
-
-  String authorization(_Credentials credentials, _HttpClientRequest request) {
-    String requestUri = request._requestUri();
-    _MD5 hasher = new _MD5()
-      ..add(request.method.codeUnits)
-      ..add([_CharCode.COLON])
-      ..add(requestUri.codeUnits);
-    var ha2 = _CryptoUtils.bytesToHex(hasher.close());
-
-    bool isAuth = false;
-    String cnonce = "";
-    String nc = "";
-    hasher = new _MD5()
-      ..add(credentials.ha1!.codeUnits)
-      ..add([_CharCode.COLON]);
-    if (credentials.qop == "auth") {
-      isAuth = true;
-      cnonce = _CryptoUtils.bytesToHex(_CryptoUtils.getRandomBytes(4));
-      var nonceCount = credentials.nonceCount! + 1;
-      credentials.nonceCount = nonceCount;
-      nc = nonceCount.toRadixString(16).padLeft(9, "0");
-      hasher
-        ..add(credentials.nonce!.codeUnits)
-        ..add([_CharCode.COLON])
-        ..add(nc.codeUnits)
-        ..add([_CharCode.COLON])
-        ..add(cnonce.codeUnits)
-        ..add([_CharCode.COLON])
-        ..add("auth".codeUnits)
-        ..add([_CharCode.COLON])
-        ..add(ha2.codeUnits);
-    } else {
-      hasher
-        ..add(credentials.nonce!.codeUnits)
-        ..add([_CharCode.COLON])
-        ..add(ha2.codeUnits);
-    }
-    var response = _CryptoUtils.bytesToHex(hasher.close());
-
-    StringBuffer buffer = new StringBuffer()
-      ..write('Digest ')
-      ..write('username="$username"')
-      ..write(', realm="${credentials.realm}"')
-      ..write(', nonce="${credentials.nonce}"')
-      ..write(', uri="$requestUri"')
-      ..write(', algorithm="${credentials.algorithm}"');
-    if (isAuth) {
-      buffer
-        ..write(', qop="auth"')
-        ..write(', cnonce="$cnonce"')
-        ..write(', nc="$nc"');
-    }
-    buffer.write(', response="$response"');
-    return buffer.toString();
-  }
-
-  void authorize(_Credentials credentials, HttpClientRequest request) {
-    request.headers.set(HttpHeaders.authorizationHeader,
-        authorization(credentials, request as _HttpClientRequest));
-  }
-
-  void authorizeProxy(
-      _ProxyCredentials credentials, HttpClientRequest request) {
-    request.headers.set(HttpHeaders.proxyAuthorizationHeader,
-        authorization(credentials, request as _HttpClientRequest));
-  }
-}
-
-class _RedirectInfo implements RedirectInfo {
-  final int statusCode;
-  final String method;
-  final Uri location;
-  const _RedirectInfo(this.statusCode, this.method, this.location);
-}
-
-String _getHttpVersion() {
-  var version = Platform.version;
-  // Only include major and minor version numbers.
-  int index = version.indexOf('.', version.indexOf('.') + 1);
-  version = version.substring(0, index);
-  return 'Dart/$version (dart:io)';
-}
diff --git a/sdk_nnbd/lib/_http/http_parser.dart b/sdk_nnbd/lib/_http/http_parser.dart
deleted file mode 100644
index 9459789..0000000
--- a/sdk_nnbd/lib/_http/http_parser.dart
+++ /dev/null
@@ -1,1160 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._http;
-
-// Global constants.
-class _Const {
-  // Bytes for "HTTP".
-  static const HTTP = const [72, 84, 84, 80];
-  // Bytes for "HTTP/1.".
-  static const HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46];
-  // Bytes for "HTTP/1.0".
-  static const HTTP10 = const [72, 84, 84, 80, 47, 49, 46, 48];
-  // Bytes for "HTTP/1.1".
-  static const HTTP11 = const [72, 84, 84, 80, 47, 49, 46, 49];
-
-  static const bool T = true;
-  static const bool F = false;
-  // Loopup-map for the following characters: '()<>@,;:\\"/[]?={} \t'.
-  static const SEPARATOR_MAP = const [
-    F, F, F, F, F, F, F, F, F, T, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, T, F, T, F, F, F, F, F, T, T, F, F, T, F, F, T, //
-    F, F, F, F, F, F, F, F, F, F, T, T, T, T, T, T, T, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, T, T, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, T, F, T, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, //
-    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
-  ];
-}
-
-// Frequently used character codes.
-class _CharCode {
-  static const int HT = 9;
-  static const int LF = 10;
-  static const int CR = 13;
-  static const int SP = 32;
-  static const int AMPERSAND = 38;
-  static const int COMMA = 44;
-  static const int DASH = 45;
-  static const int SLASH = 47;
-  static const int ZERO = 48;
-  static const int ONE = 49;
-  static const int COLON = 58;
-  static const int SEMI_COLON = 59;
-  static const int EQUAL = 61;
-}
-
-// States of the HTTP parser state machine.
-class _State {
-  static const int START = 0;
-  static const int METHOD_OR_RESPONSE_HTTP_VERSION = 1;
-  static const int RESPONSE_HTTP_VERSION = 2;
-  static const int REQUEST_LINE_METHOD = 3;
-  static const int REQUEST_LINE_URI = 4;
-  static const int REQUEST_LINE_HTTP_VERSION = 5;
-  static const int REQUEST_LINE_ENDING = 6;
-  static const int RESPONSE_LINE_STATUS_CODE = 7;
-  static const int RESPONSE_LINE_REASON_PHRASE = 8;
-  static const int RESPONSE_LINE_ENDING = 9;
-  static const int HEADER_START = 10;
-  static const int HEADER_FIELD = 11;
-  static const int HEADER_VALUE_START = 12;
-  static const int HEADER_VALUE = 13;
-  static const int HEADER_VALUE_FOLDING_OR_ENDING = 14;
-  static const int HEADER_VALUE_FOLD_OR_END = 15;
-  static const int HEADER_ENDING = 16;
-
-  static const int CHUNK_SIZE_STARTING_CR = 17;
-  static const int CHUNK_SIZE_STARTING_LF = 18;
-  static const int CHUNK_SIZE = 19;
-  static const int CHUNK_SIZE_EXTENSION = 20;
-  static const int CHUNK_SIZE_ENDING = 21;
-  static const int CHUNKED_BODY_DONE_CR = 22;
-  static const int CHUNKED_BODY_DONE_LF = 23;
-  static const int BODY = 24;
-  static const int CLOSED = 25;
-  static const int UPGRADED = 26;
-  static const int FAILURE = 27;
-
-  static const int FIRST_BODY_STATE = CHUNK_SIZE_STARTING_CR;
-}
-
-// HTTP version of the request or response being parsed.
-class _HttpVersion {
-  static const int UNDETERMINED = 0;
-  static const int HTTP10 = 1;
-  static const int HTTP11 = 2;
-}
-
-// States of the HTTP parser state machine.
-class _MessageType {
-  static const int UNDETERMINED = 0;
-  static const int REQUEST = 1;
-  static const int RESPONSE = 0;
-}
-
-/**
- * The _HttpDetachedStreamSubscription takes a subscription and some extra data,
- * and makes it possible to "inject" the data in from of other data events
- * from the subscription.
- *
- * It does so by overriding pause/resume, so that once the
- * _HttpDetachedStreamSubscription is resumed, it'll deliver the data before
- * resuming the underlaying subscription.
- */
-class _HttpDetachedStreamSubscription implements StreamSubscription<Uint8List> {
-  StreamSubscription<Uint8List> _subscription;
-  Uint8List? _injectData;
-  Function? _userOnData;
-  bool _isCanceled = false;
-  bool _scheduled = false;
-  int _pauseCount = 1;
-
-  _HttpDetachedStreamSubscription(
-      this._subscription, this._injectData, this._userOnData);
-
-  bool get isPaused => _subscription.isPaused;
-
-  Future<T> asFuture<T>([T? futureValue]) =>
-      _subscription.asFuture<T>(futureValue as T);
-
-  Future cancel() {
-    _isCanceled = true;
-    _injectData = null;
-    return _subscription.cancel();
-  }
-
-  void onData(void handleData(Uint8List data)?) {
-    _userOnData = handleData;
-    _subscription.onData(handleData);
-  }
-
-  void onDone(void handleDone()?) {
-    _subscription.onDone(handleDone);
-  }
-
-  void onError(Function? handleError) {
-    _subscription.onError(handleError);
-  }
-
-  void pause([Future? resumeSignal]) {
-    if (_injectData == null) {
-      _subscription.pause(resumeSignal);
-    } else {
-      _pauseCount++;
-      if (resumeSignal != null) {
-        resumeSignal.whenComplete(resume);
-      }
-    }
-  }
-
-  void resume() {
-    if (_injectData == null) {
-      _subscription.resume();
-    } else {
-      _pauseCount--;
-      _maybeScheduleData();
-    }
-  }
-
-  void _maybeScheduleData() {
-    if (_scheduled) return;
-    if (_pauseCount != 0) return;
-    _scheduled = true;
-    scheduleMicrotask(() {
-      _scheduled = false;
-      if (_pauseCount > 0 || _isCanceled) return;
-      var data = _injectData;
-      _injectData = null;
-      // To ensure that 'subscription.isPaused' is false, we resume the
-      // subscription here. This is fine as potential events are delayed.
-      _subscription.resume();
-      _userOnData?.call(data);
-    });
-  }
-}
-
-class _HttpDetachedIncoming extends Stream<Uint8List> {
-  final StreamSubscription<Uint8List>? subscription;
-  final Uint8List? bufferedData;
-
-  _HttpDetachedIncoming(this.subscription, this.bufferedData);
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    var subscription = this.subscription;
-    if (subscription != null) {
-      subscription
-        ..onData(onData)
-        ..onError(onError)
-        ..onDone(onDone);
-      if (bufferedData == null) {
-        return subscription..resume();
-      }
-      return new _HttpDetachedStreamSubscription(
-          subscription, bufferedData, onData)
-        ..resume();
-    } else {
-      // TODO(26379): add test for this branch.
-      return new Stream<Uint8List>.fromIterable([bufferedData!]).listen(onData,
-          onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-    }
-  }
-}
-
-/**
- * HTTP parser which parses the data stream given to [consume].
- *
- * If an HTTP parser error occurs, the parser will signal an error to either
- * the current _HttpIncoming or the _parser itself.
- *
- * The connection upgrades (e.g. switching from HTTP/1.1 to the
- * WebSocket protocol) is handled in a special way. If connection
- * upgrade is specified in the headers, then on the callback to
- * [:responseStart:] the [:upgrade:] property on the [:HttpParser:]
- * object will be [:true:] indicating that from now on the protocol is
- * not HTTP anymore and no more callbacks will happen, that is
- * [:dataReceived:] and [:dataEnd:] are not called in this case as
- * there is no more HTTP data. After the upgrade the method
- * [:readUnparsedData:] can be used to read any remaining bytes in the
- * HTTP parser which are part of the protocol the connection is
- * upgrading to. These bytes cannot be processed by the HTTP parser
- * and should be handled according to whatever protocol is being
- * upgraded to.
- */
-class _HttpParser extends Stream<_HttpIncoming> {
-  // State.
-  bool _parserCalled = false;
-
-  // The data that is currently being parsed.
-  Uint8List? _buffer;
-  int _index = -1;
-
-  final bool _requestParser;
-  int _state = _State.START;
-  int? _httpVersionIndex;
-  int _messageType = _MessageType.UNDETERMINED;
-  int _statusCode = 0;
-  int _statusCodeLength = 0;
-  final List<int> _method = [];
-  final List<int> _uriOrReasonPhrase = [];
-  final List<int> _headerField = [];
-  final List<int> _headerValue = [];
-  // The limit for method, uriOrReasonPhrase, header field and value
-  int _headerSizeLimit = 8 * 1024;
-
-  int _httpVersion = _HttpVersion.UNDETERMINED;
-  int _transferLength = -1;
-  bool _persistentConnection = false;
-  bool _connectionUpgrade = false;
-  bool _chunked = false;
-
-  bool _noMessageBody = false;
-  int _remainingContent = -1;
-  bool _contentLength = false;
-  bool _transferEncoding = false;
-  bool connectMethod = false;
-
-  _HttpHeaders? _headers;
-
-  // The limit for parsing chunk size
-  int _chunkSizeLimit = 0x7FFFFFFF;
-
-  // The current incoming connection.
-  _HttpIncoming? _incoming;
-  StreamSubscription<Uint8List>? _socketSubscription;
-  bool _paused = true;
-  bool _bodyPaused = false;
-  final StreamController<_HttpIncoming> _controller;
-  StreamController<Uint8List>? _bodyController;
-
-  factory _HttpParser.requestParser() {
-    return new _HttpParser._(true);
-  }
-
-  factory _HttpParser.responseParser() {
-    return new _HttpParser._(false);
-  }
-
-  _HttpParser._(this._requestParser)
-      : _controller = new StreamController<_HttpIncoming>(sync: true) {
-    _controller
-      ..onListen = () {
-        _paused = false;
-      }
-      ..onPause = () {
-        _paused = true;
-        _pauseStateChanged();
-      }
-      ..onResume = () {
-        _paused = false;
-        _pauseStateChanged();
-      }
-      ..onCancel = () {
-        _socketSubscription?.cancel();
-      };
-    _reset();
-  }
-
-  StreamSubscription<_HttpIncoming> listen(void onData(_HttpIncoming event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  void listenToStream(Stream<Uint8List> stream) {
-    // Listen to the stream and handle data accordingly. When a
-    // _HttpIncoming is created, _dataPause, _dataResume, _dataDone is
-    // given to provide a way of controlling the parser.
-    // TODO(ajohnsen): Remove _dataPause, _dataResume and _dataDone and clean up
-    // how the _HttpIncoming signals the parser.
-    _socketSubscription =
-        stream.listen(_onData, onError: _controller.addError, onDone: _onDone);
-  }
-
-  void _parse() {
-    try {
-      _doParse();
-    } catch (e, s) {
-      if (_state >= _State.CHUNK_SIZE_STARTING_CR && _state <= _State.BODY) {
-        _state = _State.FAILURE;
-        _reportBodyError(e, s);
-      } else {
-        _state = _State.FAILURE;
-        _reportHttpError(e, s);
-      }
-    }
-  }
-
-  // Process end of headers. Returns true if the parser should stop
-  // parsing and return. This will be in case of either an upgrade
-  // request or a request or response with an empty body.
-  bool _headersEnd() {
-    var headers = _headers!;
-    // If method is CONNECT, response parser should ignore any Content-Length or
-    // Transfer-Encoding header fields in a successful response.
-    // [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.6)
-    if (!_requestParser &&
-        _statusCode >= 200 &&
-        _statusCode < 300 &&
-        connectMethod) {
-      _transferLength = -1;
-      headers.chunkedTransferEncoding = false;
-      _chunked = false;
-      headers.removeAll(HttpHeaders.contentLengthHeader);
-      headers.removeAll(HttpHeaders.transferEncodingHeader);
-    }
-    headers._mutable = false;
-
-    _transferLength = headers.contentLength;
-    // Ignore the Content-Length header if Transfer-Encoding
-    // is chunked (RFC 2616 section 4.4)
-    if (_chunked) _transferLength = -1;
-
-    // If a request message has neither Content-Length nor
-    // Transfer-Encoding the message must not have a body (RFC
-    // 2616 section 4.3).
-    if (_messageType == _MessageType.REQUEST &&
-        _transferLength < 0 &&
-        _chunked == false) {
-      _transferLength = 0;
-    }
-    if (_connectionUpgrade) {
-      _state = _State.UPGRADED;
-      _transferLength = 0;
-    }
-    var incoming = _createIncoming(_transferLength);
-    if (_requestParser) {
-      incoming.method = new String.fromCharCodes(_method);
-      incoming.uri = Uri.parse(new String.fromCharCodes(_uriOrReasonPhrase));
-    } else {
-      incoming.statusCode = _statusCode;
-      incoming.reasonPhrase = new String.fromCharCodes(_uriOrReasonPhrase);
-    }
-    _method.clear();
-    _uriOrReasonPhrase.clear();
-    if (_connectionUpgrade) {
-      incoming.upgraded = true;
-      _parserCalled = false;
-      _closeIncoming();
-      _controller.add(incoming);
-      return true;
-    }
-    if (_transferLength == 0 ||
-        (_messageType == _MessageType.RESPONSE && _noMessageBody)) {
-      _reset();
-      _closeIncoming();
-      _controller.add(incoming);
-      return false;
-    } else if (_chunked) {
-      _state = _State.CHUNK_SIZE;
-      _remainingContent = 0;
-    } else if (_transferLength > 0) {
-      _remainingContent = _transferLength;
-      _state = _State.BODY;
-    } else {
-      // Neither chunked nor content length. End of body
-      // indicated by close.
-      _state = _State.BODY;
-    }
-    _parserCalled = false;
-    _controller.add(incoming);
-    return true;
-  }
-
-  // From RFC 2616.
-  // generic-message = start-line
-  //                   *(message-header CRLF)
-  //                   CRLF
-  //                   [ message-body ]
-  // start-line      = Request-Line | Status-Line
-  // Request-Line    = Method SP Request-URI SP HTTP-Version CRLF
-  // Status-Line     = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
-  // message-header  = field-name ":" [ field-value ]
-  void _doParse() {
-    assert(!_parserCalled);
-    _parserCalled = true;
-    if (_state == _State.CLOSED) {
-      throw HttpException("Data on closed connection");
-    }
-    if (_state == _State.FAILURE) {
-      throw HttpException("Data on failed connection");
-    }
-    while (_buffer != null &&
-        _index < _buffer!.length &&
-        _state != _State.FAILURE &&
-        _state != _State.UPGRADED) {
-      // Depending on _incoming, we either break on _bodyPaused or _paused.
-      if ((_incoming != null && _bodyPaused) ||
-          (_incoming == null && _paused)) {
-        _parserCalled = false;
-        return;
-      }
-      int index = _index;
-      int byte = _buffer![index];
-      _index = index + 1;
-      switch (_state) {
-        case _State.START:
-          if (byte == _Const.HTTP[0]) {
-            // Start parsing method or HTTP version.
-            _httpVersionIndex = 1;
-            _state = _State.METHOD_OR_RESPONSE_HTTP_VERSION;
-          } else {
-            // Start parsing method.
-            if (!_isTokenChar(byte)) {
-              throw HttpException("Invalid request method");
-            }
-            _addWithValidation(_method, byte);
-            if (!_requestParser) {
-              throw HttpException("Invalid response line");
-            }
-            _state = _State.REQUEST_LINE_METHOD;
-          }
-          break;
-
-        case _State.METHOD_OR_RESPONSE_HTTP_VERSION:
-          var httpVersionIndex = _httpVersionIndex!;
-          if (httpVersionIndex < _Const.HTTP.length &&
-              byte == _Const.HTTP[httpVersionIndex]) {
-            // Continue parsing HTTP version.
-            _httpVersionIndex = httpVersionIndex + 1;
-          } else if (httpVersionIndex == _Const.HTTP.length &&
-              byte == _CharCode.SLASH) {
-            // HTTP/ parsed. As method is a token this cannot be a
-            // method anymore.
-            _httpVersionIndex = httpVersionIndex + 1;
-            if (_requestParser) {
-              throw HttpException("Invalid request line");
-            }
-            _state = _State.RESPONSE_HTTP_VERSION;
-          } else {
-            // Did not parse HTTP version. Expect method instead.
-            for (int i = 0; i < httpVersionIndex; i++) {
-              _addWithValidation(_method, _Const.HTTP[i]);
-            }
-            if (byte == _CharCode.SP) {
-              _state = _State.REQUEST_LINE_URI;
-            } else {
-              _addWithValidation(_method, byte);
-              _httpVersion = _HttpVersion.UNDETERMINED;
-              if (!_requestParser) {
-                throw HttpException("Invalid response line");
-              }
-              _state = _State.REQUEST_LINE_METHOD;
-            }
-          }
-          break;
-
-        case _State.RESPONSE_HTTP_VERSION:
-          var httpVersionIndex = _httpVersionIndex!;
-          if (httpVersionIndex < _Const.HTTP1DOT.length) {
-            // Continue parsing HTTP version.
-            _expect(byte, _Const.HTTP1DOT[httpVersionIndex]);
-            _httpVersionIndex = httpVersionIndex + 1;
-          } else if (httpVersionIndex == _Const.HTTP1DOT.length &&
-              byte == _CharCode.ONE) {
-            // HTTP/1.1 parsed.
-            _httpVersion = _HttpVersion.HTTP11;
-            _persistentConnection = true;
-            _httpVersionIndex = httpVersionIndex + 1;
-          } else if (httpVersionIndex == _Const.HTTP1DOT.length &&
-              byte == _CharCode.ZERO) {
-            // HTTP/1.0 parsed.
-            _httpVersion = _HttpVersion.HTTP10;
-            _persistentConnection = false;
-            _httpVersionIndex = httpVersionIndex + 1;
-          } else if (httpVersionIndex == _Const.HTTP1DOT.length + 1) {
-            _expect(byte, _CharCode.SP);
-            // HTTP version parsed.
-            _state = _State.RESPONSE_LINE_STATUS_CODE;
-          } else {
-            throw HttpException(
-                "Invalid response line, failed to parse HTTP version");
-          }
-          break;
-
-        case _State.REQUEST_LINE_METHOD:
-          if (byte == _CharCode.SP) {
-            _state = _State.REQUEST_LINE_URI;
-          } else {
-            if (_Const.SEPARATOR_MAP[byte] ||
-                byte == _CharCode.CR ||
-                byte == _CharCode.LF) {
-              throw HttpException("Invalid request method");
-            }
-            _addWithValidation(_method, byte);
-          }
-          break;
-
-        case _State.REQUEST_LINE_URI:
-          if (byte == _CharCode.SP) {
-            if (_uriOrReasonPhrase.length == 0) {
-              throw HttpException("Invalid request, empty URI");
-            }
-            _state = _State.REQUEST_LINE_HTTP_VERSION;
-            _httpVersionIndex = 0;
-          } else {
-            if (byte == _CharCode.CR || byte == _CharCode.LF) {
-              throw HttpException("Invalid request, unexpected $byte in URI");
-            }
-            _addWithValidation(_uriOrReasonPhrase, byte);
-          }
-          break;
-
-        case _State.REQUEST_LINE_HTTP_VERSION:
-          var httpVersionIndex = _httpVersionIndex!;
-          if (httpVersionIndex < _Const.HTTP1DOT.length) {
-            _expect(byte, _Const.HTTP11[httpVersionIndex]);
-            _httpVersionIndex = httpVersionIndex + 1;
-          } else if (_httpVersionIndex == _Const.HTTP1DOT.length) {
-            if (byte == _CharCode.ONE) {
-              // HTTP/1.1 parsed.
-              _httpVersion = _HttpVersion.HTTP11;
-              _persistentConnection = true;
-              _httpVersionIndex = httpVersionIndex + 1;
-            } else if (byte == _CharCode.ZERO) {
-              // HTTP/1.0 parsed.
-              _httpVersion = _HttpVersion.HTTP10;
-              _persistentConnection = false;
-              _httpVersionIndex = httpVersionIndex + 1;
-            } else {
-              throw HttpException("Invalid response, invalid HTTP version");
-            }
-          } else {
-            if (byte == _CharCode.CR) {
-              _state = _State.REQUEST_LINE_ENDING;
-            } else {
-              _expect(byte, _CharCode.LF);
-              _messageType = _MessageType.REQUEST;
-              _state = _State.HEADER_START;
-            }
-          }
-          break;
-
-        case _State.REQUEST_LINE_ENDING:
-          _expect(byte, _CharCode.LF);
-          _messageType = _MessageType.REQUEST;
-          _state = _State.HEADER_START;
-          break;
-
-        case _State.RESPONSE_LINE_STATUS_CODE:
-          if (byte == _CharCode.SP) {
-            _state = _State.RESPONSE_LINE_REASON_PHRASE;
-          } else if (byte == _CharCode.CR) {
-            // Some HTTP servers does not follow the spec. and send
-            // \r\n right after the status code.
-            _state = _State.RESPONSE_LINE_ENDING;
-          } else {
-            _statusCodeLength++;
-            if (byte < 0x30 || byte > 0x39) {
-              throw HttpException("Invalid response status code with $byte");
-            } else if (_statusCodeLength > 3) {
-              throw HttpException(
-                  "Invalid response, status code is over 3 digits");
-            } else {
-              _statusCode = _statusCode * 10 + byte - 0x30;
-            }
-          }
-          break;
-
-        case _State.RESPONSE_LINE_REASON_PHRASE:
-          if (byte == _CharCode.CR) {
-            _state = _State.RESPONSE_LINE_ENDING;
-          } else {
-            if (byte == _CharCode.CR || byte == _CharCode.LF) {
-              throw HttpException(
-                  "Invalid response, unexpected $byte in reason phrase");
-            }
-            _addWithValidation(_uriOrReasonPhrase, byte);
-          }
-          break;
-
-        case _State.RESPONSE_LINE_ENDING:
-          _expect(byte, _CharCode.LF);
-          _messageType == _MessageType.RESPONSE;
-          // Check whether this response will never have a body.
-          if (_statusCode <= 199 || _statusCode == 204 || _statusCode == 304) {
-            _noMessageBody = true;
-          }
-          _state = _State.HEADER_START;
-          break;
-
-        case _State.HEADER_START:
-          _headers = new _HttpHeaders(version!);
-          if (byte == _CharCode.CR) {
-            _state = _State.HEADER_ENDING;
-          } else if (byte == _CharCode.LF) {
-            _state = _State.HEADER_ENDING;
-            _index = _index - 1; // Make the new state see the LF again.
-          } else {
-            // Start of new header field.
-            _addWithValidation(_headerField, _toLowerCaseByte(byte));
-            _state = _State.HEADER_FIELD;
-          }
-          break;
-
-        case _State.HEADER_FIELD:
-          if (byte == _CharCode.COLON) {
-            _state = _State.HEADER_VALUE_START;
-          } else {
-            if (!_isTokenChar(byte)) {
-              throw HttpException("Invalid header field name, with $byte");
-            }
-            _addWithValidation(_headerField, _toLowerCaseByte(byte));
-          }
-          break;
-
-        case _State.HEADER_VALUE_START:
-          if (byte == _CharCode.CR) {
-            _state = _State.HEADER_VALUE_FOLDING_OR_ENDING;
-          } else if (byte == _CharCode.LF) {
-            _state = _State.HEADER_VALUE_FOLD_OR_END;
-          } else if (byte != _CharCode.SP && byte != _CharCode.HT) {
-            // Start of new header value.
-            _addWithValidation(_headerValue, byte);
-            _state = _State.HEADER_VALUE;
-          }
-          break;
-
-        case _State.HEADER_VALUE:
-          if (byte == _CharCode.CR) {
-            _state = _State.HEADER_VALUE_FOLDING_OR_ENDING;
-          } else if (byte == _CharCode.LF) {
-            _state = _State.HEADER_VALUE_FOLD_OR_END;
-          } else {
-            _addWithValidation(_headerValue, byte);
-          }
-          break;
-
-        case _State.HEADER_VALUE_FOLDING_OR_ENDING:
-          _expect(byte, _CharCode.LF);
-          _state = _State.HEADER_VALUE_FOLD_OR_END;
-          break;
-
-        case _State.HEADER_VALUE_FOLD_OR_END:
-          if (byte == _CharCode.SP || byte == _CharCode.HT) {
-            _state = _State.HEADER_VALUE_START;
-          } else {
-            String headerField = new String.fromCharCodes(_headerField);
-            String headerValue = new String.fromCharCodes(_headerValue);
-            if (headerField == HttpHeaders.contentLengthHeader) {
-              // Content Length header should not have more than one occurance
-              // or coexist with Transfer Encoding header.
-              if (_contentLength || _transferEncoding) {
-                _statusCode = HttpStatus.badRequest;
-              }
-              _contentLength = true;
-            } else if (headerField == HttpHeaders.transferEncodingHeader) {
-              _transferEncoding = true;
-              if (_caseInsensitiveCompare("chunked".codeUnits, _headerValue)) {
-                _chunked = true;
-              }
-              if (_contentLength) {
-                _statusCode = HttpStatus.badRequest;
-              }
-            }
-            var headers = _headers!;
-            if (headerField == HttpHeaders.connectionHeader) {
-              List<String> tokens = _tokenizeFieldValue(headerValue);
-              final bool isResponse = _messageType == _MessageType.RESPONSE;
-              final bool isUpgradeCode =
-                  (_statusCode == HttpStatus.upgradeRequired) ||
-                      (_statusCode == HttpStatus.switchingProtocols);
-              for (int i = 0; i < tokens.length; i++) {
-                final bool isUpgrade = _caseInsensitiveCompare(
-                    "upgrade".codeUnits, tokens[i].codeUnits);
-                if ((isUpgrade && !isResponse) ||
-                    (isUpgrade && isResponse && isUpgradeCode)) {
-                  _connectionUpgrade = true;
-                }
-                headers._add(headerField, tokens[i]);
-              }
-            } else {
-              headers._add(headerField, headerValue);
-            }
-            _headerField.clear();
-            _headerValue.clear();
-
-            if (byte == _CharCode.CR) {
-              _state = _State.HEADER_ENDING;
-            } else if (byte == _CharCode.LF) {
-              _state = _State.HEADER_ENDING;
-              _index = _index - 1; // Make the new state see the LF again.
-            } else {
-              // Start of new header field.
-              _state = _State.HEADER_FIELD;
-              _addWithValidation(_headerField, _toLowerCaseByte(byte));
-            }
-          }
-          break;
-
-        case _State.HEADER_ENDING:
-          _expect(byte, _CharCode.LF);
-          if (_headersEnd()) {
-            return;
-          }
-          break;
-
-        case _State.CHUNK_SIZE_STARTING_CR:
-          _expect(byte, _CharCode.CR);
-          _state = _State.CHUNK_SIZE_STARTING_LF;
-          break;
-
-        case _State.CHUNK_SIZE_STARTING_LF:
-          _expect(byte, _CharCode.LF);
-          _state = _State.CHUNK_SIZE;
-          break;
-
-        case _State.CHUNK_SIZE:
-          if (byte == _CharCode.CR) {
-            _state = _State.CHUNK_SIZE_ENDING;
-          } else if (byte == _CharCode.SEMI_COLON) {
-            _state = _State.CHUNK_SIZE_EXTENSION;
-          } else {
-            int value = _expectHexDigit(byte);
-            // Checks whether (_remaingingContent * 16 + value) overflows.
-            if (_remainingContent > _chunkSizeLimit >> 4) {
-              throw HttpException('Chunk size overflows the integer');
-            }
-            _remainingContent = _remainingContent * 16 + value;
-          }
-          break;
-
-        case _State.CHUNK_SIZE_EXTENSION:
-          if (byte == _CharCode.CR) {
-            _state = _State.CHUNK_SIZE_ENDING;
-          }
-          break;
-
-        case _State.CHUNK_SIZE_ENDING:
-          _expect(byte, _CharCode.LF);
-          if (_remainingContent > 0) {
-            _state = _State.BODY;
-          } else {
-            _state = _State.CHUNKED_BODY_DONE_CR;
-          }
-          break;
-
-        case _State.CHUNKED_BODY_DONE_CR:
-          _expect(byte, _CharCode.CR);
-          _state = _State.CHUNKED_BODY_DONE_LF;
-          break;
-
-        case _State.CHUNKED_BODY_DONE_LF:
-          _expect(byte, _CharCode.LF);
-          _reset();
-          _closeIncoming();
-          break;
-
-        case _State.BODY:
-          // The body is not handled one byte at a time but in blocks.
-          _index = _index - 1;
-          var buffer = _buffer!;
-          int dataAvailable = buffer.length - _index;
-          if (_remainingContent >= 0 && dataAvailable > _remainingContent) {
-            dataAvailable = _remainingContent;
-          }
-          // Always present the data as a view. This way we can handle all
-          // cases like this, and the user will not experience different data
-          // typed (which could lead to polymorphic user code).
-          Uint8List data = new Uint8List.view(
-              buffer.buffer, buffer.offsetInBytes + _index, dataAvailable);
-          _bodyController!.add(data);
-          if (_remainingContent != -1) {
-            _remainingContent -= data.length;
-          }
-          _index = _index + data.length;
-          if (_remainingContent == 0) {
-            if (!_chunked) {
-              _reset();
-              _closeIncoming();
-            } else {
-              _state = _State.CHUNK_SIZE_STARTING_CR;
-            }
-          }
-          break;
-
-        case _State.FAILURE:
-          // Should be unreachable.
-          assert(false);
-          break;
-
-        default:
-          // Should be unreachable.
-          assert(false);
-          break;
-      }
-    }
-
-    _parserCalled = false;
-    var buffer = _buffer;
-    if (buffer != null && _index == buffer.length) {
-      // If all data is parsed release the buffer and resume receiving
-      // data.
-      _releaseBuffer();
-      if (_state != _State.UPGRADED && _state != _State.FAILURE) {
-        _socketSubscription!.resume();
-      }
-    }
-  }
-
-  void _onData(Uint8List buffer) {
-    _socketSubscription!.pause();
-    assert(_buffer == null);
-    _buffer = buffer;
-    _index = 0;
-    _parse();
-  }
-
-  void _onDone() {
-    // onDone cancels the subscription.
-    _socketSubscription = null;
-    if (_state == _State.CLOSED || _state == _State.FAILURE) return;
-
-    if (_incoming != null) {
-      if (_state != _State.UPGRADED &&
-          !(_state == _State.START && !_requestParser) &&
-          !(_state == _State.BODY && !_chunked && _transferLength == -1)) {
-        _reportBodyError(
-            HttpException("Connection closed while receiving data"));
-      }
-      _closeIncoming(true);
-      _controller.close();
-      return;
-    }
-    // If the connection is idle the HTTP stream is closed.
-    if (_state == _State.START) {
-      if (!_requestParser) {
-        _reportHttpError(
-            HttpException("Connection closed before full header was received"));
-      }
-      _controller.close();
-      return;
-    }
-
-    if (_state == _State.UPGRADED) {
-      _controller.close();
-      return;
-    }
-
-    if (_state < _State.FIRST_BODY_STATE) {
-      _state = _State.FAILURE;
-      // Report the error through the error callback if any. Otherwise
-      // throw the error.
-      _reportHttpError(
-          HttpException("Connection closed before full header was received"));
-      _controller.close();
-      return;
-    }
-
-    if (!_chunked && _transferLength == -1) {
-      _state = _State.CLOSED;
-    } else {
-      _state = _State.FAILURE;
-      // Report the error through the error callback if any. Otherwise
-      // throw the error.
-      _reportHttpError(
-          HttpException("Connection closed before full body was received"));
-    }
-    _controller.close();
-  }
-
-  String? get version {
-    switch (_httpVersion) {
-      case _HttpVersion.HTTP10:
-        return "1.0";
-      case _HttpVersion.HTTP11:
-        return "1.1";
-    }
-    return null;
-  }
-
-  int get messageType => _messageType;
-  int get transferLength => _transferLength;
-  bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED;
-  bool get persistentConnection => _persistentConnection;
-
-  void set isHead(bool value) {
-    _noMessageBody = valueOfNonNullableParamWithDefault<bool>(value, false);
-  }
-
-  _HttpDetachedIncoming detachIncoming() {
-    // Simulate detached by marking as upgraded.
-    _state = _State.UPGRADED;
-    return new _HttpDetachedIncoming(_socketSubscription, readUnparsedData());
-  }
-
-  Uint8List? readUnparsedData() {
-    var buffer = _buffer;
-    if (buffer == null) return null;
-    var index = _index;
-    if (index == buffer.length) return null;
-    var result = buffer.sublist(index);
-    _releaseBuffer();
-    return result;
-  }
-
-  void _reset() {
-    if (_state == _State.UPGRADED) return;
-    _state = _State.START;
-    _messageType = _MessageType.UNDETERMINED;
-    _headerField.clear();
-    _headerValue.clear();
-    _method.clear();
-    _uriOrReasonPhrase.clear();
-
-    _statusCode = 0;
-    _statusCodeLength = 0;
-
-    _httpVersion = _HttpVersion.UNDETERMINED;
-    _transferLength = -1;
-    _persistentConnection = false;
-    _connectionUpgrade = false;
-    _chunked = false;
-
-    _noMessageBody = false;
-    _remainingContent = -1;
-
-    _contentLength = false;
-    _transferEncoding = false;
-
-    _headers = null;
-  }
-
-  void _releaseBuffer() {
-    _buffer = null;
-    _index = -1;
-  }
-
-  static bool _isTokenChar(int byte) {
-    return byte > 31 && byte < 128 && !_Const.SEPARATOR_MAP[byte];
-  }
-
-  static bool _isValueChar(int byte) {
-    return (byte > 31 && byte < 128) ||
-        (byte == _CharCode.SP) ||
-        (byte == _CharCode.HT);
-  }
-
-  static List<String> _tokenizeFieldValue(String headerValue) {
-    List<String> tokens = <String>[];
-    int start = 0;
-    int index = 0;
-    while (index < headerValue.length) {
-      if (headerValue[index] == ",") {
-        tokens.add(headerValue.substring(start, index));
-        start = index + 1;
-      } else if (headerValue[index] == " " || headerValue[index] == "\t") {
-        start++;
-      }
-      index++;
-    }
-    tokens.add(headerValue.substring(start, index));
-    return tokens;
-  }
-
-  static int _toLowerCaseByte(int x) {
-    // Optimized version:
-    //  -  0x41 is 'A'
-    //  -  0x7f is ASCII mask
-    //  -  26 is the number of alpha characters.
-    //  -  0x20 is the delta between lower and upper chars.
-    return (((x - 0x41) & 0x7f) < 26) ? (x | 0x20) : x;
-  }
-
-  // expected should already be lowercase.
-  static bool _caseInsensitiveCompare(List<int> expected, List<int> value) {
-    if (expected.length != value.length) return false;
-    for (int i = 0; i < expected.length; i++) {
-      if (expected[i] != _toLowerCaseByte(value[i])) return false;
-    }
-    return true;
-  }
-
-  void _expect(int val1, int val2) {
-    if (val1 != val2) {
-      throw HttpException("Failed to parse HTTP, $val1 does not match $val2");
-    }
-  }
-
-  int _expectHexDigit(int byte) {
-    if (0x30 <= byte && byte <= 0x39) {
-      return byte - 0x30; // 0 - 9
-    } else if (0x41 <= byte && byte <= 0x46) {
-      return byte - 0x41 + 10; // A - F
-    } else if (0x61 <= byte && byte <= 0x66) {
-      return byte - 0x61 + 10; // a - f
-    } else {
-      throw HttpException(
-          "Failed to parse HTTP, $byte is expected to be a Hex digit");
-    }
-  }
-
-  void _addWithValidation(List<int> list, int byte) {
-    if (list.length < _headerSizeLimit) {
-      list.add(byte);
-    } else {
-      _reportSizeLimitError();
-    }
-  }
-
-  void _reportSizeLimitError() {
-    String method = "";
-    switch (_state) {
-      case _State.START:
-      case _State.METHOD_OR_RESPONSE_HTTP_VERSION:
-      case _State.REQUEST_LINE_METHOD:
-        method = "Method";
-        break;
-
-      case _State.REQUEST_LINE_URI:
-        method = "URI";
-        break;
-
-      case _State.RESPONSE_LINE_REASON_PHRASE:
-        method = "Reason phrase";
-        break;
-
-      case _State.HEADER_START:
-      case _State.HEADER_FIELD:
-        method = "Header field";
-        break;
-
-      case _State.HEADER_VALUE_START:
-      case _State.HEADER_VALUE:
-        method = "Header value";
-        break;
-
-      default:
-        throw UnsupportedError("Unexpected state: $_state");
-        break;
-    }
-    throw HttpException("$method exceeds the $_headerSizeLimit size limit");
-  }
-
-  _HttpIncoming _createIncoming(int transferLength) {
-    assert(_incoming == null);
-    assert(_bodyController == null);
-    assert(!_bodyPaused);
-    var controller =
-        _bodyController = new StreamController<Uint8List>(sync: true);
-    var incoming = _incoming =
-        new _HttpIncoming(_headers!, transferLength, controller.stream);
-    controller
-      ..onListen = () {
-        if (incoming != _incoming) return;
-        assert(_bodyPaused);
-        _bodyPaused = false;
-        _pauseStateChanged();
-      }
-      ..onPause = () {
-        if (incoming != _incoming) return;
-        assert(!_bodyPaused);
-        _bodyPaused = true;
-        _pauseStateChanged();
-      }
-      ..onResume = () {
-        if (incoming != _incoming) return;
-        assert(_bodyPaused);
-        _bodyPaused = false;
-        _pauseStateChanged();
-      }
-      ..onCancel = () {
-        if (incoming != _incoming) return;
-        _socketSubscription?.cancel();
-        _closeIncoming(true);
-        _controller.close();
-      };
-    _bodyPaused = true;
-    _pauseStateChanged();
-    return incoming;
-  }
-
-  void _closeIncoming([bool closing = false]) {
-    // Ignore multiple close (can happen in re-entrance).
-    var tmp = _incoming;
-    if (tmp == null) return;
-    tmp.close(closing);
-    _incoming = null;
-    var controller = _bodyController;
-    if (controller != null) {
-      controller.close();
-      _bodyController = null;
-    }
-    _bodyPaused = false;
-    _pauseStateChanged();
-  }
-
-  void _pauseStateChanged() {
-    if (_incoming != null) {
-      if (!_bodyPaused && !_parserCalled) {
-        _parse();
-      }
-    } else {
-      if (!_paused && !_parserCalled) {
-        _parse();
-      }
-    }
-  }
-
-  void _reportHttpError(error, [stackTrace]) {
-    _socketSubscription?.cancel();
-    _state = _State.FAILURE;
-    _controller.addError(error, stackTrace);
-    _controller.close();
-  }
-
-  void _reportBodyError(error, [stackTrace]) {
-    _socketSubscription?.cancel();
-    _state = _State.FAILURE;
-    _bodyController?.addError(error, stackTrace);
-    // In case of drain(), error event will close the stream.
-    _bodyController?.close();
-  }
-}
diff --git a/sdk_nnbd/lib/_http/http_session.dart b/sdk_nnbd/lib/_http/http_session.dart
deleted file mode 100644
index 407192a..0000000
--- a/sdk_nnbd/lib/_http/http_session.dart
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._http;
-
-const String _DART_SESSION_ID = "DARTSESSID";
-
-// A _HttpSession is a node in a double-linked list, with _next and _prev being
-// the previous and next pointers.
-class _HttpSession implements HttpSession {
-  // Destroyed marked. Used by the http connection to see if a session is valid.
-  bool _destroyed = false;
-  bool _isNew = true;
-  DateTime _lastSeen;
-  Function? _timeoutCallback;
-  _HttpSessionManager _sessionManager;
-  // Pointers in timeout queue.
-  _HttpSession? _prev;
-  _HttpSession? _next;
-  final String id;
-
-  final Map _data = new HashMap();
-
-  _HttpSession(this._sessionManager, this.id) : _lastSeen = new DateTime.now();
-
-  void destroy() {
-    assert(!_destroyed);
-    _destroyed = true;
-    _sessionManager._removeFromTimeoutQueue(this);
-    _sessionManager._sessions.remove(id);
-  }
-
-  // Mark the session as seen. This will reset the timeout and move the node to
-  // the end of the timeout queue.
-  void _markSeen() {
-    _lastSeen = new DateTime.now();
-    _sessionManager._bumpToEnd(this);
-  }
-
-  DateTime get lastSeen => _lastSeen;
-
-  bool get isNew => _isNew;
-
-  void set onTimeout(void callback()?) {
-    _timeoutCallback = callback;
-  }
-
-  // Map implementation:
-  bool containsValue(value) => _data.containsValue(value);
-  bool containsKey(key) => _data.containsKey(key);
-  operator [](key) => _data[key];
-  void operator []=(key, value) {
-    _data[key] = value;
-  }
-
-  putIfAbsent(key, ifAbsent) => _data.putIfAbsent(key, ifAbsent);
-  addAll(Map other) => _data.addAll(other);
-  remove(key) => _data.remove(key);
-  void clear() {
-    _data.clear();
-  }
-
-  void forEach(void f(key, value)) {
-    _data.forEach(f);
-  }
-
-  Iterable<MapEntry> get entries => _data.entries;
-
-  void addEntries(Iterable<MapEntry> entries) {
-    _data.addEntries(entries);
-  }
-
-  Map<K, V> map<K, V>(MapEntry<K, V> transform(key, value)) =>
-      _data.map(transform);
-
-  void removeWhere(bool test(key, value)) {
-    _data.removeWhere(test);
-  }
-
-  Map<K, V> cast<K, V>() => _data.cast<K, V>();
-  update(key, update(value), {ifAbsent()?}) =>
-      _data.update(key, update, ifAbsent: ifAbsent);
-
-  void updateAll(update(key, value)) {
-    _data.updateAll(update);
-  }
-
-  Iterable get keys => _data.keys;
-  Iterable get values => _data.values;
-  int get length => _data.length;
-  bool get isEmpty => _data.isEmpty;
-  bool get isNotEmpty => _data.isNotEmpty;
-
-  String toString() => 'HttpSession id:$id $_data';
-}
-
-// Private class used to manage all the active sessions. The sessions are stored
-// in two ways:
-//
-//  * In a map, mapping from ID to HttpSession.
-//  * In a linked list, used as a timeout queue.
-class _HttpSessionManager {
-  Map<String, _HttpSession> _sessions;
-  int _sessionTimeout = 20 * 60; // 20 mins.
-  _HttpSession? _head;
-  _HttpSession? _tail;
-  Timer? _timer;
-
-  _HttpSessionManager() : _sessions = {};
-
-  String createSessionId() {
-    const int _KEY_LENGTH = 16; // 128 bits.
-    var data = _CryptoUtils.getRandomBytes(_KEY_LENGTH);
-    return _CryptoUtils.bytesToHex(data);
-  }
-
-  _HttpSession? getSession(String id) => _sessions[id];
-
-  _HttpSession createSession() {
-    var id = createSessionId();
-    // TODO(ajohnsen): Consider adding a limit and throwing an exception.
-    // Should be very unlikely however.
-    while (_sessions.containsKey(id)) {
-      id = createSessionId();
-    }
-    var session = _sessions[id] = new _HttpSession(this, id);
-    _addToTimeoutQueue(session);
-    return session;
-  }
-
-  void set sessionTimeout(int timeout) {
-    _sessionTimeout = timeout;
-    _stopTimer();
-    _startTimer();
-  }
-
-  void close() {
-    _stopTimer();
-  }
-
-  void _bumpToEnd(_HttpSession session) {
-    _removeFromTimeoutQueue(session);
-    _addToTimeoutQueue(session);
-  }
-
-  void _addToTimeoutQueue(_HttpSession session) {
-    if (_head == null) {
-      assert(_tail == null);
-      _tail = _head = session;
-      _startTimer();
-    } else {
-      assert(_timer != null);
-      var tail = _tail!;
-      // Add to end.
-      tail._next = session;
-      session._prev = tail;
-      _tail = session;
-    }
-  }
-
-  void _removeFromTimeoutQueue(_HttpSession session) {
-    var next = session._next;
-    var prev = session._prev;
-    session._next = session._prev = null;
-    next?._prev = prev;
-    prev?._next = next;
-    if (_tail == session) {
-      _tail = prev;
-    }
-    if (_head == session) {
-      _head = next;
-      // We removed the head element, start new timer.
-      _stopTimer();
-      _startTimer();
-    }
-  }
-
-  void _timerTimeout() {
-    _stopTimer(); // Clear timer.
-    var session = _head!;
-    session.destroy(); // Will remove the session from timeout queue and map.
-    session._timeoutCallback?.call();
-  }
-
-  void _startTimer() {
-    assert(_timer == null);
-    var head = _head;
-    if (head != null) {
-      int seconds = new DateTime.now().difference(head.lastSeen).inSeconds;
-      _timer = new Timer(
-          new Duration(seconds: _sessionTimeout - seconds), _timerTimeout);
-    }
-  }
-
-  void _stopTimer() {
-    var timer = _timer;
-    if (timer != null) {
-      timer.cancel();
-      _timer = null;
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/_http/http_sources.gni b/sdk_nnbd/lib/_http/http_sources.gni
deleted file mode 100644
index 1ce36b4..0000000
--- a/sdk_nnbd/lib/_http/http_sources.gni
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2017, 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.
-
-http_sdk_sources = [
-  "http.dart",
-
-  # The above file needs to be first if additional parts are added to the lib.
-  "crypto.dart",
-  "http_date.dart",
-  "http_headers.dart",
-  "http_impl.dart",
-  "http_parser.dart",
-  "http_session.dart",
-  "overrides.dart",
-  "websocket.dart",
-  "websocket_impl.dart",
-]
diff --git a/sdk_nnbd/lib/_http/overrides.dart b/sdk_nnbd/lib/_http/overrides.dart
deleted file mode 100644
index bbd21ee..0000000
--- a/sdk_nnbd/lib/_http/overrides.dart
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart._http;
-
-final _httpOverridesToken = new Object();
-
-const _asyncRunZoned = runZoned;
-
-/// This class facilitates overriding [HttpClient] with a mock implementation.
-/// It should be extended by another class in client code with overrides
-/// that construct a mock implementation. The implementation in this base class
-/// defaults to the actual [HttpClient] implementation. For example:
-///
-/// ```
-/// class MyHttpClient implements HttpClient {
-///   ...
-///   // An implementation of the HttpClient interface
-///   ...
-/// }
-///
-/// main() {
-///   HttpOverrides.runZoned(() {
-///     ...
-///     // Operations will use MyHttpClient instead of the real HttpClient
-///     // implementation whenever HttpClient is used.
-///     ...
-///   }, createHttpClient: (SecurityContext c) => new MyHttpClient(c));
-/// }
-/// ```
-abstract class HttpOverrides {
-  static HttpOverrides? _global;
-
-  static HttpOverrides? get current {
-    return Zone.current[_httpOverridesToken] ?? _global;
-  }
-
-  /// The [HttpOverrides] to use in the root [Zone].
-  ///
-  /// These are the [HttpOverrides] that will be used in the root Zone, and in
-  /// Zone's that do not set [HttpOverrides] and whose ancestors up to the root
-  /// Zone do not set [HttpOverrides].
-  static set global(HttpOverrides? overrides) {
-    _global = overrides;
-  }
-
-  /// Runs [body] in a fresh [Zone] using the provided overrides.
-  static R runZoned<R>(R body(),
-      {HttpClient Function(SecurityContext?)? createHttpClient,
-      String Function(Uri uri, Map<String, String>? environment)?
-          findProxyFromEnvironment}) {
-    HttpOverrides overrides =
-        new _HttpOverridesScope(createHttpClient, findProxyFromEnvironment);
-    return _asyncRunZoned<R>(body,
-        zoneValues: {_httpOverridesToken: overrides});
-  }
-
-  /// Runs [body] in a fresh [Zone] using the overrides found in [overrides].
-  ///
-  /// Note that [overrides] should be an instance of a class that extends
-  /// [HttpOverrides].
-  static R runWithHttpOverrides<R>(R body(), HttpOverrides overrides) {
-    return _asyncRunZoned<R>(body,
-        zoneValues: {_httpOverridesToken: overrides});
-  }
-
-  /// Returns a new [HttpClient] using the given [context].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `new HttpClient`.
-  HttpClient createHttpClient(SecurityContext? context) {
-    return new _HttpClient(context);
-  }
-
-  /// Resolves the proxy server to be used for HTTP connections.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `HttpClient.findProxyFromEnvironment`.
-  String findProxyFromEnvironment(Uri url, Map<String, String>? environment) {
-    return _HttpClient._findProxyFromEnvironment(url, environment);
-  }
-}
-
-class _HttpOverridesScope extends HttpOverrides {
-  final HttpOverrides? _previous = HttpOverrides.current;
-  final HttpClient Function(SecurityContext?)? _createHttpClient;
-  final String Function(Uri uri, Map<String, String>? environment)?
-      _findProxyFromEnvironment;
-
-  _HttpOverridesScope(this._createHttpClient, this._findProxyFromEnvironment);
-
-  @override
-  HttpClient createHttpClient(SecurityContext? context) {
-    var createHttpClient = _createHttpClient;
-    if (createHttpClient != null) return createHttpClient(context);
-    var previous = _previous;
-    if (previous != null) return previous.createHttpClient(context);
-    return super.createHttpClient(context);
-  }
-
-  @override
-  String findProxyFromEnvironment(Uri url, Map<String, String>? environment) {
-    var findProxyFromEnvironment = _findProxyFromEnvironment;
-    if (findProxyFromEnvironment != null) {
-      return findProxyFromEnvironment(url, environment);
-    }
-    var previous = _previous;
-    if (previous != null) {
-      return previous.findProxyFromEnvironment(url, environment);
-    }
-    return super.findProxyFromEnvironment(url, environment);
-  }
-}
diff --git a/sdk_nnbd/lib/_http/websocket.dart b/sdk_nnbd/lib/_http/websocket.dart
deleted file mode 100644
index c9c6246..0000000
--- a/sdk_nnbd/lib/_http/websocket.dart
+++ /dev/null
@@ -1,496 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._http;
-
-/**
- * WebSocket status codes used when closing a WebSocket connection.
- */
-abstract class WebSocketStatus {
-  static const int normalClosure = 1000;
-  static const int goingAway = 1001;
-  static const int protocolError = 1002;
-  static const int unsupportedData = 1003;
-  static const int reserved1004 = 1004;
-  static const int noStatusReceived = 1005;
-  static const int abnormalClosure = 1006;
-  static const int invalidFramePayloadData = 1007;
-  static const int policyViolation = 1008;
-  static const int messageTooBig = 1009;
-  static const int missingMandatoryExtension = 1010;
-  static const int internalServerError = 1011;
-  static const int reserved1015 = 1015;
-
-  @Deprecated("Use normalClosure instead")
-  static const int NORMAL_CLOSURE = normalClosure;
-  @Deprecated("Use goingAway instead")
-  static const int GOING_AWAY = goingAway;
-  @Deprecated("Use protocolError instead")
-  static const int PROTOCOL_ERROR = protocolError;
-  @Deprecated("Use unsupportedData instead")
-  static const int UNSUPPORTED_DATA = unsupportedData;
-  @Deprecated("Use reserved1004 instead")
-  static const int RESERVED_1004 = reserved1004;
-  @Deprecated("Use noStatusReceived instead")
-  static const int NO_STATUS_RECEIVED = noStatusReceived;
-  @Deprecated("Use abnormalClosure instead")
-  static const int ABNORMAL_CLOSURE = abnormalClosure;
-  @Deprecated("Use invalidFramePayloadData instead")
-  static const int INVALID_FRAME_PAYLOAD_DATA = invalidFramePayloadData;
-  @Deprecated("Use policyViolation instead")
-  static const int POLICY_VIOLATION = policyViolation;
-  @Deprecated("Use messageTooBig instead")
-  static const int MESSAGE_TOO_BIG = messageTooBig;
-  @Deprecated("Use missingMandatoryExtension instead")
-  static const int MISSING_MANDATORY_EXTENSION = missingMandatoryExtension;
-  @Deprecated("Use internalServerError instead")
-  static const int INTERNAL_SERVER_ERROR = internalServerError;
-  @Deprecated("Use reserved1015 instead")
-  static const int RESERVED_1015 = reserved1015;
-}
-
-/// Options controlling compression in a [WebSocket].
-///
-/// A [CompressionOptions] instance can be passed to [WebSocket.connect], or
-/// used in other similar places where [WebSocket] compression is configured.
-///
-/// In most cases the default [compressionDefault] is sufficient, but in some
-/// situations, it might be desirable to use different compression parameters,
-/// for example to preserve memory on small devices.
-class CompressionOptions {
-  /// Default [WebSocket] compression configuration.
-  ///
-  /// Enables compression with default window sizes and no reuse. This is the
-  /// default options used by [WebSocket.connect] if no [CompressionOptions] is
-  /// supplied.
-  ///
-  /// * `clientNoContextTakeover`: false
-  /// * `serverNoContextTakeover`: false
-  /// * `clientMaxWindowBits`: null (default maximal window size of 15 bits)
-  /// * `serverMaxWindowBits`: null (default maximal window size of 15 bits)
-  static const CompressionOptions compressionDefault =
-      const CompressionOptions();
-  @Deprecated("Use compressionDefault instead")
-  static const CompressionOptions DEFAULT = compressionDefault;
-
-  /// No-compression configuration.
-  ///
-  /// Disables compression when used as compression configuration for a
-  /// [WebSocket].
-  static const CompressionOptions compressionOff =
-      const CompressionOptions(enabled: false);
-  @Deprecated("Use compressionOff instead")
-  static const CompressionOptions OFF = compressionOff;
-
-  /// Whether the client will reuse its compression instances.
-  final bool clientNoContextTakeover;
-
-  /// Whether the server will reuse its compression instances.
-  final bool serverNoContextTakeover;
-
-  /// The maximal window size bit count requested by the client.
-  ///
-  /// The windows size for the compression is always a power of two, so the
-  /// number of bits precisely determines the window size.
-  ///
-  /// If set to `null`, the client has no preference, and the compression can
-  /// use up to its default maximum window size of 15 bits depending on the
-  /// server's preference.
-  final int? clientMaxWindowBits;
-
-  /// The maximal window size bit count requested by the server.
-  ///
-  /// The windows size for the compression is always a power of two, so the
-  /// number of bits precisely determines the window size.
-  ///
-  /// If set to `null`, the server has no preference, and the compression can
-  /// use up to its default maximum window size of 15 bits depending on the
-  /// client's preference.
-  final int? serverMaxWindowBits;
-
-  /// Whether WebSocket compression is enabled.
-  ///
-  /// If not enabled, the remaining fields have no effect, and the
-  /// [compressionOff] instance can, and should, be reused instead of creating a
-  /// new instance with compression disabled.
-  final bool enabled;
-
-  const CompressionOptions(
-      {this.clientNoContextTakeover = false,
-      this.serverNoContextTakeover = false,
-      this.clientMaxWindowBits,
-      this.serverMaxWindowBits,
-      this.enabled = true});
-
-  /// Parses list of requested server headers to return server compression
-  /// response headers.
-  ///
-  /// Uses [serverMaxWindowBits] value if set, otherwise will attempt to use
-  /// value from headers. Defaults to [WebSocket.DEFAULT_WINDOW_BITS]. Returns a
-  /// [_CompressionMaxWindowBits] object which contains the response headers and
-  /// negotiated max window bits.
-  _CompressionMaxWindowBits _createServerResponseHeader(
-      HeaderValue? requested) {
-    var info = new _CompressionMaxWindowBits("", 0);
-
-    String? part = requested?.parameters[_serverMaxWindowBits];
-    if (part != null) {
-      if (part.length >= 2 && part.startsWith('0')) {
-        throw new ArgumentError("Illegal 0 padding on value.");
-      } else {
-        int mwb = serverMaxWindowBits ??
-            int.tryParse(part) ??
-            _WebSocketImpl.DEFAULT_WINDOW_BITS;
-        info.headerValue = "; server_max_window_bits=${mwb}";
-        info.maxWindowBits = mwb;
-      }
-    } else {
-      info.headerValue = "";
-      info.maxWindowBits = _WebSocketImpl.DEFAULT_WINDOW_BITS;
-    }
-    return info;
-  }
-
-  /// Returns default values for client compression request headers.
-  String _createClientRequestHeader(HeaderValue? requested, int size) {
-    var info = "";
-
-    // If responding to a valid request, specify size
-    if (requested != null) {
-      info = "; client_max_window_bits=$size";
-    } else {
-      // Client request. Specify default
-      if (clientMaxWindowBits == null) {
-        info = "; client_max_window_bits";
-      } else {
-        info = "; client_max_window_bits=$clientMaxWindowBits";
-      }
-      if (serverMaxWindowBits != null) {
-        info += "; server_max_window_bits=$serverMaxWindowBits";
-      }
-    }
-
-    return info;
-  }
-
-  /// Create a Compression Header.
-  ///
-  /// If [requested] is null or contains client request headers, returns Client
-  /// compression request headers with default settings for
-  /// `client_max_window_bits` header value.  If [requested] contains server
-  /// response headers this method returns a Server compression response header
-  /// negotiating the max window bits for both client and server as requested
-  /// `server_max_window_bits` value.  This method returns a
-  /// [_CompressionMaxWindowBits] object with the response headers and
-  /// negotiated `maxWindowBits` value.
-  _CompressionMaxWindowBits _createHeader([HeaderValue? requested]) {
-    var info = new _CompressionMaxWindowBits("", 0);
-    if (!enabled) {
-      return info;
-    }
-
-    info.headerValue = _WebSocketImpl.PER_MESSAGE_DEFLATE;
-
-    if (clientNoContextTakeover &&
-        (requested == null ||
-            (requested != null &&
-                requested.parameters.containsKey(_clientNoContextTakeover)))) {
-      info.headerValue += "; client_no_context_takeover";
-    }
-
-    if (serverNoContextTakeover &&
-        (requested == null ||
-            (requested != null &&
-                requested.parameters.containsKey(_serverNoContextTakeover)))) {
-      info.headerValue += "; server_no_context_takeover";
-    }
-
-    var headerList = _createServerResponseHeader(requested);
-    info.headerValue += headerList.headerValue;
-    info.maxWindowBits = headerList.maxWindowBits;
-
-    info.headerValue +=
-        _createClientRequestHeader(requested, info.maxWindowBits);
-
-    return info;
-  }
-}
-
-/**
- * The [WebSocketTransformer] provides the ability to upgrade a
- * [HttpRequest] to a [WebSocket] connection. It supports both
- * upgrading a single [HttpRequest] and upgrading a stream of
- * [HttpRequest]s.
- *
- * To upgrade a single [HttpRequest] use the static [upgrade] method.
- *
- *     HttpServer server;
- *     server.listen((request) {
- *       if (...) {
- *         WebSocketTransformer.upgrade(request).then((websocket) {
- *           ...
- *         });
- *       } else {
- *         // Do normal HTTP request processing.
- *       }
- *     });
- *
- * To transform a stream of [HttpRequest] events as it implements a
- * stream transformer that transforms a stream of HttpRequest into a
- * stream of WebSockets by upgrading each HttpRequest from the HTTP or
- * HTTPS server, to the WebSocket protocol.
- *
- *     server.transform(new WebSocketTransformer()).listen((webSocket) => ...);
- *
- * This transformer strives to implement WebSockets as specified by RFC6455.
- */
-abstract class WebSocketTransformer
-    implements StreamTransformer<HttpRequest, WebSocket> {
-  /**
-   * Create a new [WebSocketTransformer].
-   *
-   * If [protocolSelector] is provided, [protocolSelector] will be called to
-   * select what protocol to use, if any were provided by the client.
-   * [protocolSelector] is should return either a [String] or a [Future]
-   * completing with a [String]. The [String] must exist in the list of
-   * protocols.
-   *
-   * If [compression] is provided, the [WebSocket] created will be configured
-   * to negotiate with the specified [CompressionOptions]. If none is specified
-   * then the [WebSocket] will be created with the default [CompressionOptions].
-   */
-  factory WebSocketTransformer(
-      {/*String|Future<String>*/ protocolSelector(List<String> protocols)?,
-      CompressionOptions compression = CompressionOptions.compressionDefault}) {
-    return new _WebSocketTransformerImpl(protocolSelector, compression);
-  }
-
-  /**
-   * Upgrades a [HttpRequest] to a [WebSocket] connection. If the
-   * request is not a valid WebSocket upgrade request an HTTP response
-   * with status code 500 will be returned. Otherwise the returned
-   * future will complete with the [WebSocket] when the upgrade process
-   * is complete.
-   *
-   * If [protocolSelector] is provided, [protocolSelector] will be called to
-   * select what protocol to use, if any were provided by the client.
-   * [protocolSelector] is should return either a [String] or a [Future]
-   * completing with a [String]. The [String] must exist in the list of
-   * protocols.
-   *
-   * If [compression] is provided, the [WebSocket] created will be configured
-   * to negotiate with the specified [CompressionOptions]. If none is specified
-   * then the [WebSocket] will be created with the default [CompressionOptions].
-   */
-  static Future<WebSocket> upgrade(HttpRequest request,
-      {protocolSelector(List<String> protocols)?,
-      CompressionOptions compression = CompressionOptions.compressionDefault}) {
-    return _WebSocketTransformerImpl._upgrade(
-        request, protocolSelector, compression);
-  }
-
-  /**
-   * Checks whether the request is a valid WebSocket upgrade request.
-   */
-  static bool isUpgradeRequest(HttpRequest request) {
-    return _WebSocketTransformerImpl._isUpgradeRequest(request);
-  }
-}
-
-/**
- * A two-way HTTP communication object for client or server applications.
- *
- * The stream exposes the messages received. A text message will be of type
- * `String` and a binary message will be of type `List<int>`.
- */
-abstract class WebSocket
-    implements
-        Stream<dynamic /*String|List<int>*/ >,
-        StreamSink<dynamic /*String|List<int>*/ > {
-  /**
-   * Possible states of the connection.
-   */
-  static const int connecting = 0;
-  static const int open = 1;
-  static const int closing = 2;
-  static const int closed = 3;
-
-  @Deprecated("Use connecting instead")
-  static const int CONNECTING = connecting;
-  @Deprecated("Use open instead")
-  static const int OPEN = open;
-  @Deprecated("Use closing instead")
-  static const int CLOSING = closing;
-  @Deprecated("Use closed instead")
-  static const int CLOSED = closed;
-
-  /**
-   * The interval between ping signals.
-   *
-   * A ping message is sent every [pingInterval], starting at the first
-   * [pingInterval] after a new value has been assigned or a pong message has
-   * been received. If a ping message is not answered by a pong message from the
-   * peer, the `WebSocket` is assumed disconnected and the connection is closed
-   * with a [WebSocketStatus.goingAway] close code. When a ping signal is sent,
-   * the pong message must be received within [pingInterval].
-   *
-   * There are never two outstanding pings at any given time, and the next ping
-   * timer starts when the pong is received.
-   *
-   * Set the [pingInterval] to `null` to disable sending ping messages.
-   *
-   * The default value is `null`.
-   */
-  Duration? pingInterval;
-
-  /**
-   * Create a new WebSocket connection. The URL supplied in [url]
-   * must use the scheme `ws` or `wss`.
-   *
-   * The [protocols] argument is specifying the subprotocols the
-   * client is willing to speak.
-   *
-   * The [headers] argument is specifying additional HTTP headers for
-   * setting up the connection. This would typically be the `Origin`
-   * header and potentially cookies. The keys of the map are the header
-   * fields and the values are either String or List<String>.
-   *
-   * If [headers] is provided, there are a number of headers
-   * which are controlled by the WebSocket connection process. These
-   * headers are:
-   *
-   *   - `connection`
-   *   - `sec-websocket-key`
-   *   - `sec-websocket-protocol`
-   *   - `sec-websocket-version`
-   *   - `upgrade`
-   *
-   * If any of these are passed in the `headers` map they will be ignored.
-   *
-   * If the `url` contains user information this will be passed as basic
-   * authentication when setting up the connection.
-   */
-  static Future<WebSocket> connect(String url,
-          {Iterable<String>? protocols,
-          Map<String, dynamic>? headers,
-          CompressionOptions compression =
-              CompressionOptions.compressionDefault}) =>
-      _WebSocketImpl.connect(url, protocols, headers, compression: compression);
-
-  @Deprecated('This constructor will be removed in Dart 2.0. Use `implements`'
-      ' instead of `extends` if implementing this abstract class.')
-  WebSocket();
-
-  /**
-   * Creates a WebSocket from an already-upgraded socket.
-   *
-   * The initial WebSocket handshake must have occurred prior to this call. A
-   * WebSocket client can automatically perform the handshake using
-   * [WebSocket.connect], while a server can do so using
-   * [WebSocketTransformer.upgrade]. To manually upgrade an [HttpRequest],
-   * [HttpResponse.detachSocket] may be called.
-   *
-   * [protocol] should be the protocol negotiated by this handshake, if any.
-   *
-   * [serverSide] must be passed explicitly. If it's `false`, the WebSocket will
-   * act as the client and mask the messages it sends. If it's `true`, it will
-   * act as the server and will not mask its messages.
-   *
-   * If [compression] is provided, the [WebSocket] created will be configured
-   * to negotiate with the specified [CompressionOptions]. If none is specified
-   * then the [WebSocket] will be created with the default [CompressionOptions].
-   */
-  factory WebSocket.fromUpgradedSocket(Socket socket,
-      {String? protocol,
-      bool? serverSide,
-      CompressionOptions compression = CompressionOptions.compressionDefault}) {
-    if (serverSide == null) {
-      throw new ArgumentError("The serverSide argument must be passed "
-          "explicitly to WebSocket.fromUpgradedSocket.");
-    }
-    return new _WebSocketImpl._fromSocket(
-        socket, protocol, compression, serverSide);
-  }
-
-  /**
-   * Returns the current state of the connection.
-   */
-  int get readyState;
-
-  /**
-   * The extensions property is initially the empty string. After the
-   * WebSocket connection is established this string reflects the
-   * extensions used by the server.
-   */
-  String get extensions;
-
-  /**
-   * The protocol property is initially the empty string. After the
-   * WebSocket connection is established the value is the subprotocol
-   * selected by the server. If no subprotocol is negotiated the
-   * value will remain [:null:].
-   */
-  String? get protocol;
-
-  /**
-   * The close code set when the WebSocket connection is closed. If
-   * there is no close code available this property will be [:null:]
-   */
-  int? get closeCode;
-
-  /**
-   * The close reason set when the WebSocket connection is closed. If
-   * there is no close reason available this property will be [:null:]
-   */
-  String? get closeReason;
-
-  /**
-   * Closes the WebSocket connection. Set the optional [code] and [reason]
-   * arguments to send close information to the remote peer. If they are
-   * omitted, the peer will see [WebSocketStatus.noStatusReceived] code
-   * with no reason.
-   */
-  Future close([int? code, String? reason]);
-
-  /**
-   * Sends data on the WebSocket connection. The data in [data] must
-   * be either a `String`, or a `List<int>` holding bytes.
-   */
-  void add(/*String|List<int>*/ data);
-
-  /**
-   * Sends data from a stream on WebSocket connection. Each data event from
-   * [stream] will be send as a single WebSocket frame. The data from [stream]
-   * must be either `String`s, or `List<int>`s holding bytes.
-   */
-  Future addStream(Stream stream);
-
-  /**
-   * Sends a text message with the text represented by [bytes].
-   *
-   * The [bytes] should be valid UTF-8 encoded Unicode characters. If they are
-   * not, the receiving end will close the connection.
-   */
-  void addUtf8Text(List<int> bytes);
-
-  /**
-   * Gets the user agent used for WebSocket connections.
-   */
-  static String? get userAgent => _WebSocketImpl.userAgent;
-
-  /**
-   * Sets the user agent to use for WebSocket connections.
-   */
-  static set userAgent(String? userAgent) {
-    _WebSocketImpl.userAgent = userAgent;
-  }
-}
-
-class WebSocketException implements IOException {
-  final String message;
-
-  const WebSocketException([this.message = ""]);
-
-  String toString() => "WebSocketException: $message";
-}
diff --git a/sdk_nnbd/lib/_http/websocket_impl.dart b/sdk_nnbd/lib/_http/websocket_impl.dart
deleted file mode 100644
index 68d0f29..0000000
--- a/sdk_nnbd/lib/_http/websocket_impl.dart
+++ /dev/null
@@ -1,1325 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._http;
-
-const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
-const String _clientNoContextTakeover = "client_no_context_takeover";
-const String _serverNoContextTakeover = "server_no_context_takeover";
-const String _clientMaxWindowBits = "client_max_window_bits";
-const String _serverMaxWindowBits = "server_max_window_bits";
-
-// Matches _WebSocketOpcode.
-class _WebSocketMessageType {
-  static const int NONE = 0;
-  static const int TEXT = 1;
-  static const int BINARY = 2;
-}
-
-class _WebSocketOpcode {
-  static const int CONTINUATION = 0;
-  static const int TEXT = 1;
-  static const int BINARY = 2;
-  static const int RESERVED_3 = 3;
-  static const int RESERVED_4 = 4;
-  static const int RESERVED_5 = 5;
-  static const int RESERVED_6 = 6;
-  static const int RESERVED_7 = 7;
-  static const int CLOSE = 8;
-  static const int PING = 9;
-  static const int PONG = 10;
-  static const int RESERVED_B = 11;
-  static const int RESERVED_C = 12;
-  static const int RESERVED_D = 13;
-  static const int RESERVED_E = 14;
-  static const int RESERVED_F = 15;
-}
-
-class _EncodedString {
-  final List<int> bytes;
-  _EncodedString(this.bytes);
-}
-
-/**
- *  Stores the header and integer value derived from negotiation of
- *  client_max_window_bits and server_max_window_bits. headerValue will be
- *  set in the Websocket response headers.
- */
-class _CompressionMaxWindowBits {
-  String headerValue;
-  int maxWindowBits;
-  _CompressionMaxWindowBits(this.headerValue, this.maxWindowBits);
-  String toString() => headerValue;
-}
-
-/**
- * The web socket protocol transformer handles the protocol byte stream
- * which is supplied through the `handleData`. As the protocol is processed,
- * it'll output frame data as either a List<int> or String.
- *
- * Important information about usage: Be sure you use cancelOnError, so the
- * socket will be closed when the processor encounter an error. Not using it
- * will lead to undefined behaviour.
- */
-class _WebSocketProtocolTransformer extends StreamTransformerBase<List<int>,
-        dynamic /*List<int>|_WebSocketPing|_WebSocketPong*/ >
-    implements EventSink<List<int>> {
-  static const int START = 0;
-  static const int LEN_FIRST = 1;
-  static const int LEN_REST = 2;
-  static const int MASK = 3;
-  static const int PAYLOAD = 4;
-  static const int CLOSED = 5;
-  static const int FAILURE = 6;
-  static const int FIN = 0x80;
-  static const int RSV1 = 0x40;
-  static const int RSV2 = 0x20;
-  static const int RSV3 = 0x10;
-  static const int OPCODE = 0xF;
-
-  int _state = START;
-  bool _fin = false;
-  bool _compressed = false;
-  int _opcode = -1;
-  int _len = -1;
-  bool _masked = false;
-  int _remainingLenBytes = -1;
-  int _remainingMaskingKeyBytes = 4;
-  int _remainingPayloadBytes = -1;
-  int _unmaskingIndex = 0;
-  int _currentMessageType = _WebSocketMessageType.NONE;
-  int closeCode = WebSocketStatus.NO_STATUS_RECEIVED;
-  String closeReason = "";
-
-  EventSink<dynamic /*List<int>|_WebSocketPing|_WebSocketPong*/ >? _eventSink;
-
-  final bool _serverSide;
-  final Uint8List _maskingBytes = Uint8List(4);
-  final BytesBuilder _payload = new BytesBuilder(copy: false);
-
-  _WebSocketPerMessageDeflate? _deflate;
-  _WebSocketProtocolTransformer([this._serverSide = false, this._deflate]);
-
-  Stream<dynamic /*List<int>|_WebSocketPing|_WebSocketPong*/ > bind(
-      Stream<List<int>> stream) {
-    return new Stream.eventTransformed(stream, (EventSink eventSink) {
-      if (_eventSink != null) {
-        throw new StateError("WebSocket transformer already used.");
-      }
-      _eventSink = eventSink;
-      return this;
-    });
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    _eventSink!.addError(error, stackTrace);
-  }
-
-  void close() {
-    _eventSink!.close();
-  }
-
-  /**
-   * Process data received from the underlying communication channel.
-   */
-  void add(List<int> bytes) {
-    var buffer = bytes is Uint8List ? bytes : new Uint8List.fromList(bytes);
-    int index = 0;
-    int lastIndex = buffer.length;
-    if (_state == CLOSED) {
-      throw new WebSocketException("Data on closed connection");
-    }
-    if (_state == FAILURE) {
-      throw new WebSocketException("Data on failed connection");
-    }
-    while ((index < lastIndex) && _state != CLOSED && _state != FAILURE) {
-      int byte = buffer[index];
-      if (_state <= LEN_REST) {
-        if (_state == START) {
-          _fin = (byte & FIN) != 0;
-
-          if ((byte & (RSV2 | RSV3)) != 0) {
-            // The RSV2, RSV3 bits must both be zero.
-            throw new WebSocketException("Protocol error");
-          }
-
-          _opcode = (byte & OPCODE);
-
-          if (_opcode != _WebSocketOpcode.CONTINUATION) {
-            if ((byte & RSV1) != 0) {
-              _compressed = true;
-            } else {
-              _compressed = false;
-            }
-          }
-
-          if (_opcode <= _WebSocketOpcode.BINARY) {
-            if (_opcode == _WebSocketOpcode.CONTINUATION) {
-              if (_currentMessageType == _WebSocketMessageType.NONE) {
-                throw new WebSocketException("Protocol error");
-              }
-            } else {
-              assert(_opcode == _WebSocketOpcode.TEXT ||
-                  _opcode == _WebSocketOpcode.BINARY);
-              if (_currentMessageType != _WebSocketMessageType.NONE) {
-                throw new WebSocketException("Protocol error");
-              }
-              _currentMessageType = _opcode;
-            }
-          } else if (_opcode >= _WebSocketOpcode.CLOSE &&
-              _opcode <= _WebSocketOpcode.PONG) {
-            // Control frames cannot be fragmented.
-            if (!_fin) throw new WebSocketException("Protocol error");
-          } else {
-            throw new WebSocketException("Protocol error");
-          }
-          _state = LEN_FIRST;
-        } else if (_state == LEN_FIRST) {
-          _masked = (byte & 0x80) != 0;
-          _len = byte & 0x7F;
-          if (_isControlFrame() && _len > 125) {
-            throw new WebSocketException("Protocol error");
-          }
-          if (_len == 126) {
-            _len = 0;
-            _remainingLenBytes = 2;
-            _state = LEN_REST;
-          } else if (_len == 127) {
-            _len = 0;
-            _remainingLenBytes = 8;
-            _state = LEN_REST;
-          } else {
-            assert(_len < 126);
-            _lengthDone();
-          }
-        } else {
-          assert(_state == LEN_REST);
-          _len = _len << 8 | byte;
-          _remainingLenBytes--;
-          if (_remainingLenBytes == 0) {
-            _lengthDone();
-          }
-        }
-      } else {
-        if (_state == MASK) {
-          _maskingBytes[4 - _remainingMaskingKeyBytes--] = byte;
-          if (_remainingMaskingKeyBytes == 0) {
-            _maskDone();
-          }
-        } else {
-          assert(_state == PAYLOAD);
-          // The payload is not handled one byte at a time but in blocks.
-          int payloadLength = min(lastIndex - index, _remainingPayloadBytes);
-          _remainingPayloadBytes -= payloadLength;
-          // Unmask payload if masked.
-          if (_masked) {
-            _unmask(index, payloadLength, buffer);
-          }
-          // Control frame and data frame share _payloads.
-          _payload.add(new Uint8List.view(
-              buffer.buffer, buffer.offsetInBytes + index, payloadLength));
-          index += payloadLength;
-          if (_isControlFrame()) {
-            if (_remainingPayloadBytes == 0) _controlFrameEnd();
-          } else {
-            if (_currentMessageType != _WebSocketMessageType.TEXT &&
-                _currentMessageType != _WebSocketMessageType.BINARY) {
-              throw new WebSocketException("Protocol error");
-            }
-            if (_remainingPayloadBytes == 0) _messageFrameEnd();
-          }
-
-          // Hack - as we always do index++ below.
-          index--;
-        }
-      }
-
-      // Move to the next byte.
-      index++;
-    }
-  }
-
-  void _unmask(int index, int length, Uint8List buffer) {
-    const int BLOCK_SIZE = 16;
-    // Skip Int32x4-version if message is small.
-    if (length >= BLOCK_SIZE) {
-      // Start by aligning to 16 bytes.
-      final int startOffset = BLOCK_SIZE - (index & 15);
-      final int end = index + startOffset;
-      for (int i = index; i < end; i++) {
-        buffer[i] ^= _maskingBytes[_unmaskingIndex++ & 3];
-      }
-      index += startOffset;
-      length -= startOffset;
-      final int blockCount = length ~/ BLOCK_SIZE;
-      if (blockCount > 0) {
-        // Create mask block.
-        int mask = 0;
-        for (int i = 3; i >= 0; i--) {
-          mask = (mask << 8) | _maskingBytes[(_unmaskingIndex + i) & 3];
-        }
-        Int32x4 blockMask = new Int32x4(mask, mask, mask, mask);
-        Int32x4List blockBuffer = new Int32x4List.view(
-            buffer.buffer, buffer.offsetInBytes + index, blockCount);
-        for (int i = 0; i < blockBuffer.length; i++) {
-          blockBuffer[i] ^= blockMask;
-        }
-        final int bytes = blockCount * BLOCK_SIZE;
-        index += bytes;
-        length -= bytes;
-      }
-    }
-    // Handle end.
-    final int end = index + length;
-    for (int i = index; i < end; i++) {
-      buffer[i] ^= _maskingBytes[_unmaskingIndex++ & 3];
-    }
-  }
-
-  void _lengthDone() {
-    if (_masked) {
-      if (!_serverSide) {
-        throw new WebSocketException("Received masked frame from server");
-      }
-      _state = MASK;
-    } else {
-      if (_serverSide) {
-        throw new WebSocketException("Received unmasked frame from client");
-      }
-      _remainingPayloadBytes = _len;
-      _startPayload();
-    }
-  }
-
-  void _maskDone() {
-    _remainingPayloadBytes = _len;
-    _startPayload();
-  }
-
-  void _startPayload() {
-    // If there is no actual payload perform perform callbacks without
-    // going through the PAYLOAD state.
-    if (_remainingPayloadBytes == 0) {
-      if (_isControlFrame()) {
-        switch (_opcode) {
-          case _WebSocketOpcode.CLOSE:
-            _state = CLOSED;
-            _eventSink!.close();
-            break;
-          case _WebSocketOpcode.PING:
-            _eventSink!.add(new _WebSocketPing());
-            break;
-          case _WebSocketOpcode.PONG:
-            _eventSink!.add(new _WebSocketPong());
-            break;
-        }
-        _prepareForNextFrame();
-      } else {
-        _messageFrameEnd();
-      }
-    } else {
-      _state = PAYLOAD;
-    }
-  }
-
-  void _messageFrameEnd() {
-    if (_fin) {
-      var bytes = _payload.takeBytes();
-      var deflate = _deflate;
-      if (deflate != null && _compressed) {
-        bytes = deflate.processIncomingMessage(bytes);
-      }
-
-      switch (_currentMessageType) {
-        case _WebSocketMessageType.TEXT:
-          _eventSink!.add(utf8.decode(bytes));
-          break;
-        case _WebSocketMessageType.BINARY:
-          _eventSink!.add(bytes);
-          break;
-      }
-      _currentMessageType = _WebSocketMessageType.NONE;
-    }
-    _prepareForNextFrame();
-  }
-
-  void _controlFrameEnd() {
-    switch (_opcode) {
-      case _WebSocketOpcode.CLOSE:
-        closeCode = WebSocketStatus.noStatusReceived;
-        var payload = _payload.takeBytes();
-        if (payload.length > 0) {
-          if (payload.length == 1) {
-            throw new WebSocketException("Protocol error");
-          }
-          closeCode = payload[0] << 8 | payload[1];
-          if (closeCode == WebSocketStatus.noStatusReceived) {
-            throw new WebSocketException("Protocol error");
-          }
-          if (payload.length > 2) {
-            closeReason = utf8.decode(payload.sublist(2));
-          }
-        }
-        _state = CLOSED;
-        _eventSink!.close();
-        break;
-
-      case _WebSocketOpcode.PING:
-        _eventSink!.add(new _WebSocketPing(_payload.takeBytes()));
-        break;
-
-      case _WebSocketOpcode.PONG:
-        _eventSink!.add(new _WebSocketPong(_payload.takeBytes()));
-        break;
-    }
-    _prepareForNextFrame();
-  }
-
-  bool _isControlFrame() {
-    return _opcode == _WebSocketOpcode.CLOSE ||
-        _opcode == _WebSocketOpcode.PING ||
-        _opcode == _WebSocketOpcode.PONG;
-  }
-
-  void _prepareForNextFrame() {
-    if (_state != CLOSED && _state != FAILURE) _state = START;
-    _fin = false;
-    _opcode = -1;
-    _len = -1;
-    _remainingLenBytes = -1;
-    _remainingMaskingKeyBytes = 4;
-    _remainingPayloadBytes = -1;
-    _unmaskingIndex = 0;
-  }
-}
-
-class _WebSocketPing {
-  final List<int>? payload;
-  _WebSocketPing([this.payload = null]);
-}
-
-class _WebSocketPong {
-  final List<int>? payload;
-  _WebSocketPong([this.payload = null]);
-}
-
-typedef /*String|Future<String>*/ _ProtocolSelector(List<String> protocols);
-
-class _WebSocketTransformerImpl
-    extends StreamTransformerBase<HttpRequest, WebSocket>
-    implements WebSocketTransformer {
-  final StreamController<WebSocket> _controller =
-      new StreamController<WebSocket>(sync: true);
-  final _ProtocolSelector? _protocolSelector;
-  final CompressionOptions _compression;
-
-  _WebSocketTransformerImpl(this._protocolSelector, this._compression);
-
-  Stream<WebSocket> bind(Stream<HttpRequest> stream) {
-    stream.listen((request) {
-      _upgrade(request, _protocolSelector, _compression)
-          .then((WebSocket webSocket) => _controller.add(webSocket))
-          .catchError(_controller.addError);
-    }, onDone: () {
-      _controller.close();
-    });
-
-    return _controller.stream;
-  }
-
-  static List<String> _tokenizeFieldValue(String headerValue) {
-    List<String> tokens = <String>[];
-    int start = 0;
-    int index = 0;
-    while (index < headerValue.length) {
-      if (headerValue[index] == ",") {
-        tokens.add(headerValue.substring(start, index));
-        start = index + 1;
-      } else if (headerValue[index] == " " || headerValue[index] == "\t") {
-        start++;
-      }
-      index++;
-    }
-    tokens.add(headerValue.substring(start, index));
-    return tokens;
-  }
-
-  static Future<WebSocket> _upgrade(HttpRequest request,
-      _ProtocolSelector? protocolSelector, CompressionOptions compression) {
-    var response = request.response;
-    if (!_isUpgradeRequest(request)) {
-      // Send error response.
-      response
-        ..statusCode = HttpStatus.badRequest
-        ..close();
-      return new Future.error(
-          new WebSocketException("Invalid WebSocket upgrade request"));
-    }
-
-    Future<WebSocket> upgrade(String? protocol) {
-      // Send the upgrade response.
-      response
-        ..statusCode = HttpStatus.switchingProtocols
-        ..headers.add(HttpHeaders.connectionHeader, "Upgrade")
-        ..headers.add(HttpHeaders.upgradeHeader, "websocket");
-      String key = request.headers.value("Sec-WebSocket-Key")!;
-      _SHA1 sha1 = new _SHA1();
-      sha1.add("$key$_webSocketGUID".codeUnits);
-      String accept = _CryptoUtils.bytesToBase64(sha1.close());
-      response.headers.add("Sec-WebSocket-Accept", accept);
-      if (protocol != null) {
-        response.headers.add("Sec-WebSocket-Protocol", protocol);
-      }
-
-      var deflate = _negotiateCompression(request, response, compression);
-
-      response.headers.contentLength = 0;
-      return response.detachSocket().then<WebSocket>((socket) =>
-          new _WebSocketImpl._fromSocket(
-              socket, protocol, compression, true, deflate));
-    }
-
-    var protocols = request.headers['Sec-WebSocket-Protocol'];
-    if (protocols != null && protocolSelector != null) {
-      // The suggested protocols can be spread over multiple lines, each
-      // consisting of multiple protocols. To unify all of them, first join
-      // the lists with ', ' and then tokenize.
-      var tokenizedProtocols = _tokenizeFieldValue(protocols.join(', '));
-      return new Future<String>(() => protocolSelector(tokenizedProtocols))
-          .then<String>((protocol) {
-        if (tokenizedProtocols.indexOf(protocol) < 0) {
-          throw new WebSocketException(
-              "Selected protocol is not in the list of available protocols");
-        }
-        return protocol;
-      }).catchError((error) {
-        response
-          ..statusCode = HttpStatus.internalServerError
-          ..close();
-        throw error;
-      }).then<WebSocket>(upgrade);
-    } else {
-      return upgrade(null);
-    }
-  }
-
-  static _WebSocketPerMessageDeflate? _negotiateCompression(HttpRequest request,
-      HttpResponse response, CompressionOptions compression) {
-    var extensionHeader = request.headers.value("Sec-WebSocket-Extensions");
-
-    extensionHeader ??= "";
-
-    var hv = HeaderValue.parse(extensionHeader, valueSeparator: ',');
-    if (compression.enabled && hv.value == _WebSocketImpl.PER_MESSAGE_DEFLATE) {
-      var info = compression._createHeader(hv);
-
-      response.headers.add("Sec-WebSocket-Extensions", info.headerValue);
-      var serverNoContextTakeover =
-          (hv.parameters.containsKey(_serverNoContextTakeover) &&
-              compression.serverNoContextTakeover);
-      var clientNoContextTakeover =
-          (hv.parameters.containsKey(_clientNoContextTakeover) &&
-              compression.clientNoContextTakeover);
-      var deflate = new _WebSocketPerMessageDeflate(
-          serverNoContextTakeover: serverNoContextTakeover,
-          clientNoContextTakeover: clientNoContextTakeover,
-          serverMaxWindowBits: info.maxWindowBits,
-          clientMaxWindowBits: info.maxWindowBits,
-          serverSide: true);
-
-      return deflate;
-    }
-
-    return null;
-  }
-
-  static bool _isUpgradeRequest(HttpRequest request) {
-    if (request.method != "GET") {
-      return false;
-    }
-    var connectionHeader = request.headers[HttpHeaders.connectionHeader];
-    if (connectionHeader == null) {
-      return false;
-    }
-    bool isUpgrade = false;
-    for (var value in connectionHeader) {
-      if (value.toLowerCase() == "upgrade") {
-        isUpgrade = true;
-        break;
-      }
-    }
-    if (!isUpgrade) return false;
-    String? upgrade = request.headers.value(HttpHeaders.upgradeHeader);
-    if (upgrade == null || upgrade.toLowerCase() != "websocket") {
-      return false;
-    }
-    String? version = request.headers.value("Sec-WebSocket-Version");
-    if (version == null || version != "13") {
-      return false;
-    }
-    String? key = request.headers.value("Sec-WebSocket-Key");
-    if (key == null) {
-      return false;
-    }
-    return true;
-  }
-}
-
-class _WebSocketPerMessageDeflate {
-  bool serverNoContextTakeover;
-  bool clientNoContextTakeover;
-  int clientMaxWindowBits;
-  int serverMaxWindowBits;
-  bool serverSide;
-
-  RawZLibFilter? decoder;
-  RawZLibFilter? encoder;
-
-  _WebSocketPerMessageDeflate(
-      {this.clientMaxWindowBits = _WebSocketImpl.DEFAULT_WINDOW_BITS,
-      this.serverMaxWindowBits = _WebSocketImpl.DEFAULT_WINDOW_BITS,
-      this.serverNoContextTakeover = false,
-      this.clientNoContextTakeover = false,
-      this.serverSide = false});
-
-  RawZLibFilter _ensureDecoder() => decoder ??= new RawZLibFilter.inflateFilter(
-      windowBits: serverSide ? clientMaxWindowBits : serverMaxWindowBits,
-      raw: true);
-
-  RawZLibFilter _ensureEncoder() => encoder ??= new RawZLibFilter.deflateFilter(
-      windowBits: serverSide ? serverMaxWindowBits : clientMaxWindowBits,
-      raw: true);
-
-  Uint8List processIncomingMessage(List<int> msg) {
-    var decoder = _ensureDecoder();
-
-    var data = <int>[];
-    data.addAll(msg);
-    data.addAll(const [0x00, 0x00, 0xff, 0xff]);
-
-    decoder.process(data, 0, data.length);
-    final result = new BytesBuilder();
-    List<int> out;
-
-    while (true) {
-      final out = decoder.processed();
-      if (out == null) break;
-      result.add(out);
-    }
-
-    if ((serverSide && clientNoContextTakeover) ||
-        (!serverSide && serverNoContextTakeover)) {
-      this.decoder = null;
-    }
-
-    return result.takeBytes();
-  }
-
-  List<int> processOutgoingMessage(List<int> msg) {
-    var encoder = _ensureEncoder();
-    var result = <int>[];
-    Uint8List buffer;
-
-    if (msg is! Uint8List) {
-      for (var i = 0; i < msg.length; i++) {
-        if (msg[i] < 0 || 255 < msg[i]) {
-          throw new ArgumentError("List element is not a byte value "
-              "(value ${msg[i]} at index $i)");
-        }
-      }
-      buffer = new Uint8List.fromList(msg);
-    } else {
-      buffer = msg;
-    }
-
-    encoder.process(buffer, 0, buffer.length);
-
-    while (true) {
-      final out = encoder.processed();
-      if (out == null) break;
-      result.addAll(out);
-    }
-
-    if ((!serverSide && clientNoContextTakeover) ||
-        (serverSide && serverNoContextTakeover)) {
-      this.encoder = null;
-    }
-
-    if (result.length > 4) {
-      result = result.sublist(0, result.length - 4);
-    }
-
-    // RFC 7692 7.2.3.6. "Generating an Empty Fragment" says that if the
-    // compression library doesn't generate any data when the bufer is empty,
-    // then an empty uncompressed deflate block is used for this purpose. The
-    // 0x00 block has the BFINAL header bit set to 0 and the BTYPE header set to
-    // 00 along with 5 bits of padding. This block decodes to zero bytes.
-    if (result.length == 0) {
-      return [0x00];
-    }
-
-    return result;
-  }
-}
-
-// TODO(ajohnsen): Make this transformer reusable.
-class _WebSocketOutgoingTransformer
-    extends StreamTransformerBase<dynamic, List<int>> implements EventSink {
-  final _WebSocketImpl webSocket;
-  EventSink<List<int>>? _eventSink;
-
-  _WebSocketPerMessageDeflate? _deflateHelper;
-
-  _WebSocketOutgoingTransformer(this.webSocket)
-      : _deflateHelper = webSocket._deflate;
-
-  Stream<List<int>> bind(Stream stream) {
-    return new Stream<List<int>>.eventTransformed(stream,
-        (EventSink<List<int>> eventSink) {
-      if (_eventSink != null) {
-        throw new StateError("WebSocket transformer already used");
-      }
-      _eventSink = eventSink;
-      return this;
-    });
-  }
-
-  void add(message) {
-    if (message is _WebSocketPong) {
-      addFrame(_WebSocketOpcode.PONG, message.payload);
-      return;
-    }
-    if (message is _WebSocketPing) {
-      addFrame(_WebSocketOpcode.PING, message.payload);
-      return;
-    }
-    List<int>? data;
-    int opcode;
-    if (message != null) {
-      List<int> messageData;
-      if (message is String) {
-        opcode = _WebSocketOpcode.TEXT;
-        messageData = utf8.encode(message);
-      } else if (message is List<int>) {
-        opcode = _WebSocketOpcode.BINARY;
-        messageData = message;
-      } else if (message is _EncodedString) {
-        opcode = _WebSocketOpcode.TEXT;
-        messageData = message.bytes;
-      } else {
-        throw new ArgumentError(message);
-      }
-      var deflateHelper = _deflateHelper;
-      if (deflateHelper != null) {
-        messageData = deflateHelper.processOutgoingMessage(messageData);
-      }
-      data = messageData;
-    } else {
-      opcode = _WebSocketOpcode.TEXT;
-    }
-    addFrame(opcode, data);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    _eventSink!.addError(error, stackTrace);
-  }
-
-  void close() {
-    int? code = webSocket._outCloseCode;
-    String? reason = webSocket._outCloseReason;
-    List<int>? data;
-    if (code != null) {
-      data = [
-        (code >> 8) & 0xFF,
-        code & 0xFF,
-        if (reason != null) ...utf8.encode(reason)
-      ];
-    }
-    addFrame(_WebSocketOpcode.CLOSE, data);
-    _eventSink!.close();
-  }
-
-  void addFrame(int opcode, List<int>? data) {
-    createFrame(
-            opcode,
-            data,
-            webSocket._serverSide,
-            _deflateHelper != null &&
-                (opcode == _WebSocketOpcode.TEXT ||
-                    opcode == _WebSocketOpcode.BINARY))
-        .forEach((e) {
-      _eventSink!.add(e);
-    });
-  }
-
-  static Iterable<List<int>> createFrame(
-      int opcode, List<int>? data, bool serverSide, bool compressed) {
-    bool mask = !serverSide; // Masking not implemented for server.
-    int dataLength = data == null ? 0 : data.length;
-    // Determine the header size.
-    int headerSize = (mask) ? 6 : 2;
-    if (dataLength > 65535) {
-      headerSize += 8;
-    } else if (dataLength > 125) {
-      headerSize += 2;
-    }
-    Uint8List header = new Uint8List(headerSize);
-    int index = 0;
-
-    // Set FIN and opcode.
-    var hoc = _WebSocketProtocolTransformer.FIN |
-        (compressed ? _WebSocketProtocolTransformer.RSV1 : 0) |
-        (opcode & _WebSocketProtocolTransformer.OPCODE);
-
-    header[index++] = hoc;
-    // Determine size and position of length field.
-    int lengthBytes = 1;
-    if (dataLength > 65535) {
-      header[index++] = 127;
-      lengthBytes = 8;
-    } else if (dataLength > 125) {
-      header[index++] = 126;
-      lengthBytes = 2;
-    }
-    // Write the length in network byte order into the header.
-    for (int i = 0; i < lengthBytes; i++) {
-      header[index++] = dataLength >> (((lengthBytes - 1) - i) * 8) & 0xFF;
-    }
-    if (mask) {
-      header[1] |= 1 << 7;
-      var maskBytes = _CryptoUtils.getRandomBytes(4);
-      header.setRange(index, index + 4, maskBytes);
-      index += 4;
-      if (data != null) {
-        Uint8List list;
-        // If this is a text message just do the masking inside the
-        // encoded data.
-        if (opcode == _WebSocketOpcode.TEXT && data is Uint8List) {
-          list = data;
-        } else {
-          if (data is Uint8List) {
-            list = new Uint8List.fromList(data);
-          } else {
-            list = new Uint8List(data.length);
-            for (int i = 0; i < data.length; i++) {
-              if (data[i] < 0 || 255 < data[i]) {
-                throw new ArgumentError("List element is not a byte value "
-                    "(value ${data[i]} at index $i)");
-              }
-              list[i] = data[i];
-            }
-          }
-        }
-        const int BLOCK_SIZE = 16;
-        int blockCount = list.length ~/ BLOCK_SIZE;
-        if (blockCount > 0) {
-          // Create mask block.
-          int mask = 0;
-          for (int i = 3; i >= 0; i--) {
-            mask = (mask << 8) | maskBytes[i];
-          }
-          Int32x4 blockMask = new Int32x4(mask, mask, mask, mask);
-          Int32x4List blockBuffer =
-              new Int32x4List.view(list.buffer, list.offsetInBytes, blockCount);
-          for (int i = 0; i < blockBuffer.length; i++) {
-            blockBuffer[i] ^= blockMask;
-          }
-        }
-        // Handle end.
-        for (int i = blockCount * BLOCK_SIZE; i < list.length; i++) {
-          list[i] ^= maskBytes[i & 3];
-        }
-        data = list;
-      }
-    }
-    assert(index == headerSize);
-    if (data == null) {
-      return [header];
-    } else {
-      return [header, data];
-    }
-  }
-}
-
-class _WebSocketConsumer implements StreamConsumer {
-  final _WebSocketImpl webSocket;
-  final Socket socket;
-  StreamController? _controller;
-  StreamSubscription? _subscription;
-  bool _issuedPause = false;
-  bool _closed = false;
-  Completer _closeCompleter = new Completer<WebSocket>();
-  Completer? _completer;
-
-  _WebSocketConsumer(this.webSocket, this.socket);
-
-  void _onListen() {
-    _subscription?.cancel();
-  }
-
-  void _onPause() {
-    var subscription = _subscription;
-    if (subscription != null) {
-      subscription.pause();
-    } else {
-      _issuedPause = true;
-    }
-  }
-
-  void _onResume() {
-    var subscription = _subscription;
-    if (subscription != null) {
-      subscription.resume();
-    } else {
-      _issuedPause = false;
-    }
-  }
-
-  void _cancel() {
-    var subscription = _subscription;
-    if (subscription != null) {
-      _subscription = null;
-      subscription.cancel();
-    }
-  }
-
-  StreamController _ensureController() {
-    var controller = _controller;
-    if (controller != null) return controller;
-    controller = _controller = new StreamController(
-        sync: true,
-        onPause: _onPause,
-        onResume: _onResume,
-        onCancel: _onListen);
-    var stream = controller.stream
-        .transform(new _WebSocketOutgoingTransformer(webSocket));
-    socket.addStream(stream).then((_) {
-      _done();
-      _closeCompleter.complete(webSocket);
-    }, onError: (Object error, StackTrace stackTrace) {
-      _closed = true;
-      _cancel();
-      if (error is ArgumentError) {
-        if (!_done(error, stackTrace)) {
-          _closeCompleter.completeError(error, stackTrace);
-        }
-      } else {
-        _done();
-        _closeCompleter.complete(webSocket);
-      }
-    });
-    return controller;
-  }
-
-  bool _done([Object? error, StackTrace? stackTrace]) {
-    var completer = _completer;
-    if (completer == null) return false;
-    if (error != null) {
-      completer.completeError(error, stackTrace);
-    } else {
-      completer.complete(webSocket);
-    }
-    _completer = null;
-    return true;
-  }
-
-  Future addStream(Stream stream) {
-    if (_closed) {
-      stream.listen(null).cancel();
-      return new Future.value(webSocket);
-    }
-    _ensureController();
-    var completer = _completer = new Completer();
-    var subscription = _subscription = stream.listen((data) {
-      _controller!.add(data);
-    }, onDone: _done, onError: _done, cancelOnError: true);
-    if (_issuedPause) {
-      subscription.pause();
-      _issuedPause = false;
-    }
-    return completer.future;
-  }
-
-  Future close() {
-    _ensureController().close();
-
-    return _closeCompleter.future
-        .then((_) => socket.close().catchError((_) {}).then((_) => webSocket));
-  }
-
-  void add(data) {
-    if (_closed) return;
-    var controller = _ensureController();
-    // Stop sending message if _controller has been closed.
-    // https://github.com/dart-lang/sdk/issues/37441
-    if (controller.isClosed) return;
-    controller.add(data);
-  }
-
-  void closeSocket() {
-    _closed = true;
-    _cancel();
-    close();
-  }
-}
-
-class _WebSocketImpl extends Stream with _ServiceObject implements WebSocket {
-  // Use default Map so we keep order.
-  static Map<int, _WebSocketImpl> _webSockets = new Map<int, _WebSocketImpl>();
-  static const int DEFAULT_WINDOW_BITS = 15;
-  static const String PER_MESSAGE_DEFLATE = "permessage-deflate";
-
-  final String? protocol;
-
-  final StreamController _controller;
-  StreamSubscription? _subscription;
-  late StreamSink _sink;
-
-  final Socket _socket;
-  final bool _serverSide;
-  int _readyState = WebSocket.connecting;
-  bool _writeClosed = false;
-  int? _closeCode;
-  String? _closeReason;
-  Duration? _pingInterval;
-  Timer? _pingTimer;
-  late _WebSocketConsumer _consumer;
-
-  int? _outCloseCode;
-  String? _outCloseReason;
-  Timer? _closeTimer;
-  _WebSocketPerMessageDeflate? _deflate;
-
-  static final HttpClient _httpClient = new HttpClient();
-
-  static Future<WebSocket> connect(
-      String url, Iterable<String>? protocols, Map<String, dynamic>? headers,
-      {CompressionOptions compression =
-          CompressionOptions.compressionDefault}) {
-    Uri uri = Uri.parse(url);
-    if (uri.scheme != "ws" && uri.scheme != "wss") {
-      throw new WebSocketException("Unsupported URL scheme '${uri.scheme}'");
-    }
-
-    Random random = new Random();
-    // Generate 16 random bytes.
-    Uint8List nonceData = new Uint8List(16);
-    for (int i = 0; i < 16; i++) {
-      nonceData[i] = random.nextInt(256);
-    }
-    String nonce = _CryptoUtils.bytesToBase64(nonceData);
-
-    uri = new Uri(
-        scheme: uri.scheme == "wss" ? "https" : "http",
-        userInfo: uri.userInfo,
-        host: uri.host,
-        port: uri.port,
-        path: uri.path,
-        query: uri.query,
-        fragment: uri.fragment);
-    return _httpClient.openUrl("GET", uri).then((request) {
-      if (uri.userInfo != null && !uri.userInfo.isEmpty) {
-        // If the URL contains user information use that for basic
-        // authorization.
-        String auth = _CryptoUtils.bytesToBase64(utf8.encode(uri.userInfo));
-        request.headers.set(HttpHeaders.authorizationHeader, "Basic $auth");
-      }
-      if (headers != null) {
-        headers.forEach((field, value) => request.headers.add(field, value));
-      }
-      // Setup the initial handshake.
-      request.headers
-        ..set(HttpHeaders.connectionHeader, "Upgrade")
-        ..set(HttpHeaders.upgradeHeader, "websocket")
-        ..set("Sec-WebSocket-Key", nonce)
-        ..set("Cache-Control", "no-cache")
-        ..set("Sec-WebSocket-Version", "13");
-      if (protocols != null) {
-        request.headers.add("Sec-WebSocket-Protocol", protocols.toList());
-      }
-
-      if (compression.enabled) {
-        request.headers
-            .add("Sec-WebSocket-Extensions", compression._createHeader());
-      }
-
-      return request.close();
-    }).then((response) {
-      Never error(String message) {
-        // Flush data.
-        response.detachSocket().then((socket) {
-          socket.destroy();
-        });
-        throw new WebSocketException(message);
-      }
-
-      var connectionHeader = response.headers[HttpHeaders.connectionHeader];
-      if (response.statusCode != HttpStatus.switchingProtocols ||
-          connectionHeader == null ||
-          !connectionHeader.any((value) => value.toLowerCase() == "upgrade") ||
-          response.headers.value(HttpHeaders.upgradeHeader)!.toLowerCase() !=
-              "websocket") {
-        error("Connection to '$uri' was not upgraded to websocket");
-      }
-      String? accept = response.headers.value("Sec-WebSocket-Accept");
-      if (accept == null) {
-        error("Response did not contain a 'Sec-WebSocket-Accept' header");
-      }
-      _SHA1 sha1 = new _SHA1();
-      sha1.add("$nonce$_webSocketGUID".codeUnits);
-      List<int> expectedAccept = sha1.close();
-      List<int> receivedAccept = _CryptoUtils.base64StringToBytes(accept);
-      if (expectedAccept.length != receivedAccept.length) {
-        error("Response header 'Sec-WebSocket-Accept' is the wrong length");
-      }
-      for (int i = 0; i < expectedAccept.length; i++) {
-        if (expectedAccept[i] != receivedAccept[i]) {
-          error("Bad response 'Sec-WebSocket-Accept' header");
-        }
-      }
-      var protocol = response.headers.value('Sec-WebSocket-Protocol');
-
-      _WebSocketPerMessageDeflate? deflate =
-          negotiateClientCompression(response, compression);
-
-      return response.detachSocket().then<WebSocket>((socket) =>
-          new _WebSocketImpl._fromSocket(
-              socket, protocol, compression, false, deflate));
-    });
-  }
-
-  static _WebSocketPerMessageDeflate? negotiateClientCompression(
-      HttpClientResponse response, CompressionOptions compression) {
-    String extensionHeader =
-        response.headers.value('Sec-WebSocket-Extensions') ?? "";
-
-    var hv = HeaderValue.parse(extensionHeader, valueSeparator: ',');
-
-    if (compression.enabled && hv.value == PER_MESSAGE_DEFLATE) {
-      var serverNoContextTakeover =
-          hv.parameters.containsKey(_serverNoContextTakeover);
-      var clientNoContextTakeover =
-          hv.parameters.containsKey(_clientNoContextTakeover);
-
-      int getWindowBits(String type) {
-        var o = hv.parameters[type];
-        if (o == null) {
-          return DEFAULT_WINDOW_BITS;
-        }
-
-        return int.tryParse(o) ?? DEFAULT_WINDOW_BITS;
-      }
-
-      return new _WebSocketPerMessageDeflate(
-          clientMaxWindowBits: getWindowBits(_clientMaxWindowBits),
-          serverMaxWindowBits: getWindowBits(_serverMaxWindowBits),
-          clientNoContextTakeover: clientNoContextTakeover,
-          serverNoContextTakeover: serverNoContextTakeover);
-    }
-
-    return null;
-  }
-
-  _WebSocketImpl._fromSocket(
-      this._socket, this.protocol, CompressionOptions compression,
-      [this._serverSide = false, _WebSocketPerMessageDeflate? deflate])
-      : _controller = new StreamController(sync: true) {
-    _consumer = new _WebSocketConsumer(this, _socket);
-    _sink = new _StreamSinkImpl(_consumer);
-    _readyState = WebSocket.open;
-    _deflate = deflate;
-
-    var transformer = new _WebSocketProtocolTransformer(_serverSide, deflate);
-    var subscription = _subscription = transformer.bind(_socket).listen((data) {
-      if (data is _WebSocketPing) {
-        if (!_writeClosed) _consumer.add(new _WebSocketPong(data.payload));
-      } else if (data is _WebSocketPong) {
-        // Simply set pingInterval, as it'll cancel any timers.
-        pingInterval = _pingInterval;
-      } else {
-        _controller.add(data);
-      }
-    }, onError: (Object error, StackTrace stackTrace) {
-      _closeTimer?.cancel();
-      if (error is FormatException) {
-        _close(WebSocketStatus.invalidFramePayloadData);
-      } else {
-        _close(WebSocketStatus.protocolError);
-      }
-      // An error happened, set the close code set above.
-      _closeCode = _outCloseCode;
-      _closeReason = _outCloseReason;
-      _controller.close();
-    }, onDone: () {
-      _closeTimer?.cancel();
-      if (_readyState == WebSocket.open) {
-        _readyState = WebSocket.closing;
-        if (!_isReservedStatusCode(transformer.closeCode)) {
-          _close(transformer.closeCode, transformer.closeReason);
-        } else {
-          _close();
-        }
-        _readyState = WebSocket.closed;
-      }
-      // Protocol close, use close code from transformer.
-      _closeCode = transformer.closeCode;
-      _closeReason = transformer.closeReason;
-      _controller.close();
-    }, cancelOnError: true);
-    subscription.pause();
-    _controller
-      ..onListen = subscription.resume
-      ..onCancel = () {
-        _subscription!.cancel();
-        _subscription = null;
-      }
-      ..onPause = subscription.pause
-      ..onResume = subscription.resume;
-
-    _webSockets[_serviceId] = this;
-  }
-
-  StreamSubscription listen(void onData(message)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Duration? get pingInterval => _pingInterval;
-
-  void set pingInterval(Duration? interval) {
-    if (_writeClosed) return;
-    _pingTimer?.cancel();
-    _pingInterval = interval;
-
-    if (interval == null) return;
-
-    _pingTimer = new Timer(interval, () {
-      if (_writeClosed) return;
-      _consumer.add(new _WebSocketPing());
-      _pingTimer = new Timer(interval, () {
-        _closeTimer?.cancel();
-        // No pong received.
-        _close(WebSocketStatus.goingAway);
-        _closeCode = _outCloseCode;
-        _closeReason = _outCloseReason;
-        _controller.close();
-      });
-    });
-  }
-
-  int get readyState => _readyState;
-
-  String get extensions => "";
-  int? get closeCode => _closeCode;
-  String? get closeReason => _closeReason;
-
-  void add(data) {
-    _sink.add(data);
-  }
-
-  void addUtf8Text(List<int> bytes) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(bytes, "bytes");
-    _sink.add(new _EncodedString(bytes));
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    _sink.addError(error, stackTrace);
-  }
-
-  Future addStream(Stream stream) => _sink.addStream(stream);
-  Future get done => _sink.done;
-
-  Future close([int? code, String? reason]) {
-    if (_isReservedStatusCode(code)) {
-      throw new WebSocketException("Reserved status code $code");
-    }
-    if (_outCloseCode == null) {
-      _outCloseCode = code;
-      _outCloseReason = reason;
-    }
-    if (!_controller.isClosed) {
-      // If a close has not yet been received from the other end then
-      //   1) make sure to listen on the stream so the close frame will be
-      //      processed if received.
-      //   2) set a timer terminate the connection if a close frame is
-      //      not received.
-      if (!_controller.hasListener && _subscription != null) {
-        _controller.stream.drain().catchError((_) => {});
-      }
-      if (_closeTimer == null) {
-        // When closing the web-socket, we no longer accept data.
-        _closeTimer = new Timer(const Duration(seconds: 5), () {
-          // Reuse code and reason from the local close.
-          _closeCode = _outCloseCode;
-          _closeReason = _outCloseReason;
-          _subscription?.cancel();
-          _controller.close();
-          _webSockets.remove(_serviceId);
-        });
-      }
-    }
-    return _sink.close();
-  }
-
-  static String? get userAgent => _httpClient.userAgent;
-
-  static set userAgent(String? userAgent) {
-    _httpClient.userAgent = userAgent;
-  }
-
-  void _close([int? code, String? reason]) {
-    if (_writeClosed) return;
-    if (_outCloseCode == null) {
-      _outCloseCode = code;
-      _outCloseReason = reason;
-    }
-    _writeClosed = true;
-    _consumer.closeSocket();
-    _webSockets.remove(_serviceId);
-  }
-
-  String get _serviceTypePath => 'io/websockets';
-  String get _serviceTypeName => 'WebSocket';
-
-  Map<String, dynamic> _toJSON(bool ref) {
-    var name = '${_socket.address.host}:${_socket.port}';
-    var r = <String, dynamic>{
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': name,
-      'user_name': name,
-    };
-    if (ref) {
-      return r;
-    }
-    try {
-      r['socket'] = (_socket as dynamic)._toJSON(true);
-    } catch (_) {
-      r['socket'] = {
-        'id': _servicePath,
-        'type': '@Socket',
-        'name': 'UserSocket',
-        'user_name': 'UserSocket',
-      };
-    }
-    return r;
-  }
-
-  static bool _isReservedStatusCode(int? code) {
-    return code != null &&
-        (code < WebSocketStatus.normalClosure ||
-            code == WebSocketStatus.reserved1004 ||
-            code == WebSocketStatus.noStatusReceived ||
-            code == WebSocketStatus.abnormalClosure ||
-            (code > WebSocketStatus.internalServerError &&
-                code < WebSocketStatus.reserved1015) ||
-            (code >= WebSocketStatus.reserved1015 && code < 3000));
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/async_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/async_patch.dart
deleted file mode 100644
index b80c74e..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/async_patch.dart
+++ /dev/null
@@ -1,472 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for the dart:async library.
-
-import 'dart:_js_helper' show notNull, patch, ReifyFunctionTypes;
-import 'dart:_isolate_helper' show TimerImpl;
-import 'dart:_foreign_helper' show JS, JSExportName;
-import 'dart:_runtime' as dart;
-
-/// This function adapts ES6 generators to implement Dart's async/await.
-///
-/// It's designed to interact with Dart's Future and follow Dart async/await
-/// semantics.
-///
-/// See https://github.com/dart-lang/sdk/issues/27315 for ideas on reconciling
-/// Dart's Future and ES6 Promise. At that point we should use native JS
-/// async/await.
-///
-/// Inspired by `co`: https://github.com/tj/co/blob/master/index.js, which is a
-/// stepping stone for ES async/await.
-@JSExportName('async')
-@ReifyFunctionTypes(false)
-_async<T>(Function() initGenerator) {
-  var iter;
-  late Object? Function(Object?) onValue;
-  late Object Function(Object, StackTrace?) onError;
-
-  onAwait(Object? value) {
-    _Future<Object?> f;
-    if (value is _Future) {
-      f = value;
-    } else if (value is Future) {
-      f = _Future();
-      _Future._chainForeignFuture(value, f);
-    } else {
-      f = _Future.value(value);
-    }
-    f = JS('', '#', f._thenAwait(onValue, onError));
-    return f;
-  }
-
-  onValue = (value) {
-    var iteratorResult = JS('', '#.next(#)', iter, value);
-    value = JS('', '#.value', iteratorResult);
-    return JS<bool>('!', '#.done', iteratorResult) ? value : onAwait(value);
-  };
-
-  // If the awaited Future throws, we want to convert this to an exception
-  // thrown from the `yield` point, as if it was thrown there.
-  //
-  // If the exception is not caught inside `gen`, it will emerge here, which
-  // will send it to anyone listening on this async function's Future<T>.
-  //
-  // In essence, we are giving the code inside the generator a chance to
-  // use try-catch-finally.
-  onError = (value, stackTrace) {
-    var iteratorResult = JS(
-        '', '#.throw(#)', iter, dart.createErrorWithStack(value, stackTrace));
-    value = JS('', '#.value', iteratorResult);
-    return JS<bool>('!', '#.done', iteratorResult) ? value : onAwait(value);
-  };
-
-  var zone = Zone.current;
-  if (!identical(zone, _rootZone)) {
-    onValue = zone.registerUnaryCallback(onValue);
-    onError = zone.registerBinaryCallback(onError);
-  }
-
-  var asyncFuture = _Future<T>();
-
-  // This will be set to true once we've yielded to the event loop.
-  //
-  // Before we've done that, we need to complete the future asynchronously to
-  // match dart2js/VM. See https://github.com/dart-lang/sdk/issues/33330
-  //
-  // Once we've yielded to the event loop we can complete synchronously.
-  // Other implementations call this `isSync` to indicate that.
-  bool isRunningAsEvent = false;
-  runBody() {
-    try {
-      iter = JS('', '#[Symbol.iterator]()', initGenerator());
-      var iteratorValue = JS('', '#.next(null)', iter);
-      var value = JS('', '#.value', iteratorValue);
-      if (JS<bool>('!', '#.done', iteratorValue)) {
-        // TODO(jmesserly): this is a workaround for ignored cast failures.
-        // Remove it once we've fixed those. We should be able to call:
-        //
-        //     if (isRunningAsEvent) {
-        //       asyncFuture._complete(value);
-        //     } else {
-        //       asyncFuture._asyncComplete(value);
-        //     }
-        //
-        // But if the user code returns `Future<dynamic>` instead of
-        // `Future<T>`, that function won't recognize it as a future and will
-        // instead treat it as a completed value.
-        if (value is Future) {
-          if (value is _Future) {
-            _Future._chainCoreFuture(value, asyncFuture);
-          } else {
-            _Future._chainForeignFuture(value, asyncFuture);
-          }
-        } else if (isRunningAsEvent) {
-          asyncFuture._completeWithValue(JS('', '#', value));
-        } else {
-          asyncFuture._asyncComplete(JS('', '#', value));
-        }
-      } else {
-        _Future._chainCoreFuture(onAwait(value), asyncFuture);
-      }
-    } catch (e, s) {
-      if (isRunningAsEvent) {
-        _completeWithErrorCallback(asyncFuture, e, s);
-      } else {
-        _asyncCompleteWithErrorCallback(asyncFuture, e, s);
-      }
-    }
-  }
-
-  if (dart.startAsyncSynchronously) {
-    runBody();
-    isRunningAsEvent = true;
-  } else {
-    isRunningAsEvent = true;
-    scheduleMicrotask(runBody);
-  }
-  return asyncFuture;
-}
-
-@patch
-class _AsyncRun {
-  @patch
-  static void _scheduleImmediate(void Function() callback) {
-    _scheduleImmediateClosure(callback);
-  }
-
-  // Lazily initialized.
-  static final _scheduleImmediateClosure = _initializeScheduleImmediate();
-
-  static void Function(void Function()) _initializeScheduleImmediate() {
-    // d8 support, see preambles/d8.js for the definiton of `scheduleImmediate`.
-    //
-    // TODO(jmesserly): do we need this? It's only for our d8 stack trace test.
-    if (JS('', '#.scheduleImmediate', dart.global_) != null) {
-      return _scheduleImmediateJSOverride;
-    }
-    return _scheduleImmediateWithPromise;
-  }
-
-  @ReifyFunctionTypes(false)
-  static void _scheduleImmediateJSOverride(void Function() callback) {
-    dart.addAsyncCallback();
-    JS('void', '#.scheduleImmediate(#)', dart.global_, () {
-      dart.removeAsyncCallback();
-      callback();
-    });
-  }
-
-  @ReifyFunctionTypes(false)
-  static void _scheduleImmediateWithPromise(void Function() callback) {
-    dart.addAsyncCallback();
-    JS('', '#.Promise.resolve(null).then(#)', dart.global_, () {
-      dart.removeAsyncCallback();
-      callback();
-    });
-  }
-}
-
-@patch
-class DeferredLibrary {
-  @patch
-  Future<Null> load() {
-    throw 'DeferredLibrary not supported. '
-        'please use the `import "lib.dart" deferred as lib` syntax.';
-  }
-}
-
-@patch
-class Timer {
-  @patch
-  static Timer _createTimer(Duration duration, void Function() callback) {
-    int milliseconds = duration.inMilliseconds;
-    if (milliseconds < 0) milliseconds = 0;
-    return TimerImpl(milliseconds, callback);
-  }
-
-  @patch
-  static Timer _createPeriodicTimer(
-      Duration duration, void callback(Timer timer)) {
-    int milliseconds = duration.inMilliseconds;
-    if (milliseconds < 0) milliseconds = 0;
-    return TimerImpl.periodic(milliseconds, callback);
-  }
-}
-
-@patch
-void _rethrow(Object error, StackTrace stackTrace) {
-  JS('', 'throw #', dart.createErrorWithStack(error, stackTrace));
-}
-
-/// Used by the compiler to implement `async*` functions.
-///
-/// This is inspired by _AsyncStarStreamController in dart-lang/sdk's
-/// runtime/lib/core_patch.dart
-///
-/// Given input like:
-///
-///     foo() async* {
-///       yield 1;
-///       yield* bar();
-///       print(await baz());
-///     }
-///
-/// This compiles to:
-///
-///     function foo() {
-///       return new (AsyncStarImplOfT()).new(function*(stream) {
-///         if (stream.add(1)) return;
-///         yield;
-///         if (stream.addStream(bar()) return;
-///         yield;
-///         print(yield baz());
-///      });
-///     }
-///
-class _AsyncStarImpl<T> {
-  late StreamController<T> controller;
-  Object Function(_AsyncStarImpl<T>) initGenerator;
-  @notNull
-  bool isSuspendedAtYieldStar = false;
-  @notNull
-  bool onListenReceived = false;
-  @notNull
-  bool isScheduled = false;
-  @notNull
-  bool isSuspendedAtYield = false;
-
-  /// Whether we're suspended at an `await`.
-  @notNull
-  bool isSuspendedAtAwait = false;
-
-  Completer? cancellationCompleter;
-  late Object jsIterator;
-
-  Null Function(Object, StackTrace)? _handleErrorCallback;
-  void Function([Object?])? _runBodyCallback;
-
-  _AsyncStarImpl(this.initGenerator) {
-    controller = StreamController(
-        onListen: JS('!', 'this.onListen.bind(this)'),
-        onResume: JS('!', 'this.onResume.bind(this)'),
-        onCancel: JS('!', 'this.onCancel.bind(this)'));
-    jsIterator = JS('!', '#[Symbol.iterator]()', initGenerator(this));
-  }
-
-  /// The stream produced by this `async*` function.
-  Stream<T> get stream => controller.stream;
-
-  /// Returns the callback used for error handling.
-  ///
-  /// This callback throws the error back into the user code, at the appropriate
-  /// location (e.g. `await` `yield` or `yield*`). This gives user code a chance
-  /// to handle it try-catch. If they do not handle, the error gets routed to
-  /// the [stream] as an error via [addError].
-  ///
-  /// As a performance optimization, this callback is only bound once to the
-  /// current [Zone]. This works because a single subscription stream should
-  /// always be running in its original zone. An `async*` method will always
-  /// save/restore the zone that was active when `listen()` was first called,
-  /// similar to a stream. This follows from section 16.14 of the Dart 4th
-  /// edition spec:
-  ///
-  /// > If `f` is marked `async*` (9), then a fresh instance `s` implementing
-  /// > the built-in class `Stream` is associated with the invocation and
-  /// > immediately returned. When `s` is listened to, execution of the body of
-  /// > `f` will begin.
-  ///
-  Null Function(Object, StackTrace) get handleError {
-    if (_handleErrorCallback == null) {
-      _handleErrorCallback = (error, StackTrace stackTrace) {
-        try {
-          JS('', '#.throw(#)', jsIterator,
-              dart.createErrorWithStack(error, stackTrace));
-        } catch (e, newStack) {
-          // The generator didn't catch the error, or it threw a new one.
-          // Make sure to propagate the new error.
-          addError(e, newStack);
-        }
-      };
-      var zone = Zone.current;
-      if (!identical(zone, Zone.root)) {
-        _handleErrorCallback = zone.bindBinaryCallback(_handleErrorCallback!);
-      }
-    }
-    return _handleErrorCallback!;
-  }
-
-  void scheduleGenerator() {
-    // TODO(jmesserly): is this isPaused check in the right place? Assuming the
-    // async* Stream yields, then is paused (by other code), the body will
-    // already be scheduled. This will cause at least one more iteration to
-    // run (adding another data item to the Stream) before actually pausing.
-    // It could be fixed by moving the `isPaused` check inside `runBody`.
-    if (isScheduled || controller.isPaused || isSuspendedAtYieldStar) {
-      return;
-    }
-    isScheduled = true;
-    // Capture the current zone. See comment on [handleError] for more
-    // information about this optimization.
-    var zone = Zone.current;
-    if (_runBodyCallback == null) {
-      _runBodyCallback = JS('!', '#.bind(this)', runBody);
-      if (!identical(zone, Zone.root)) {
-        var registered = zone.registerUnaryCallback(_runBodyCallback!);
-        _runBodyCallback = ([arg]) => zone.runUnaryGuarded(registered, arg);
-      }
-    }
-    zone.scheduleMicrotask(_runBodyCallback!);
-  }
-
-  void runBody(awaitValue) {
-    isScheduled = false;
-    isSuspendedAtYield = false;
-    isSuspendedAtAwait = false;
-
-    Object iterResult;
-    try {
-      iterResult = JS('', '#.next(#)', jsIterator, awaitValue);
-    } catch (e, s) {
-      addError(e, s);
-      return;
-    }
-
-    if (JS('!', '#.done', iterResult)) {
-      close();
-      return;
-    }
-
-    // If we're suspended at a yield/yield*, we're done for now.
-    if (isSuspendedAtYield || isSuspendedAtYieldStar) return;
-
-    // Handle `await`: if we get a value passed to `yield` it means we are
-    // waiting on this Future. Make sure to prevent scheduling, and pass the
-    // value back as the result of the `yield`.
-    //
-    // TODO(jmesserly): is the timing here correct? The assumption here is
-    // that we should schedule `await` in `async*` the same as in `async`.
-    isSuspendedAtAwait = true;
-    FutureOr<Object?> value = JS('', '#.value', iterResult);
-
-    // TODO(jmesserly): this logic was copied from `async` function impl.
-    _Future<Object?> f;
-    if (value is _Future) {
-      f = value;
-    } else if (value is Future) {
-      f = _Future();
-      _Future._chainForeignFuture(value, f);
-    } else {
-      f = _Future.value(value);
-    }
-    f._thenAwait(_runBodyCallback!, handleError);
-  }
-
-  /// Adds element to [stream] and returns true if the caller should terminate
-  /// execution of the generator.
-  ///
-  /// This is called from generated code like this:
-  ///
-  ///     if (controller.add(1)) return;
-  ///     yield;
-  //
-  // TODO(hausner): Per spec, the generator should be suspended before exiting
-  // when the stream is closed. We could add a getter like this:
-  //
-  //     get isCancelled => controller.hasListener;
-  //
-  // The generator would translate a 'yield e' statement to
-  //
-  //     controller.add(1);
-  //     suspend; // this is `yield` in JS.
-  //     if (controller.isCancelled) return;
-  bool add(T event) {
-    if (!onListenReceived) _fatal("yield before stream is listened to");
-    if (isSuspendedAtYield) _fatal("unexpected yield");
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) {
-      return true;
-    }
-    controller.add(event);
-    scheduleGenerator();
-    isSuspendedAtYield = true;
-    return false;
-  }
-
-  /// Adds the elements of [stream] into this [controller]'s stream, and returns
-  /// true if the caller should terminate execution of the generator.
-  ///
-  /// The generator will be scheduled again when all of the elements of the
-  /// added stream have been consumed.
-  bool addStream(Stream<T> stream) {
-    if (!onListenReceived) _fatal("yield* before stream is listened to");
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) return true;
-    isSuspendedAtYieldStar = true;
-    var whenDoneAdding = controller.addStream(stream, cancelOnError: false);
-    whenDoneAdding.then((_) {
-      isSuspendedAtYieldStar = false;
-      scheduleGenerator();
-      if (!isScheduled) isSuspendedAtYield = true;
-    }, onError: handleError);
-    return false;
-  }
-
-  void addError(Object error, StackTrace stackTrace) {
-    ArgumentError.checkNotNull(error, "error");
-    var completer = cancellationCompleter;
-    if (completer != null && !completer.isCompleted) {
-      // If the stream has been cancelled, complete the cancellation future
-      // with the error.
-      completer.completeError(error, stackTrace);
-    } else if (controller.hasListener) {
-      controller.addError(error, stackTrace);
-    }
-    // No need to schedule the generator body here. This code is only
-    // called from the catch clause of the implicit try-catch-finally
-    // around the generator body. That is, we are on the error path out
-    // of the generator and do not need to run the generator again.
-    close();
-  }
-
-  void close() {
-    var completer = cancellationCompleter;
-    if (completer != null && !completer.isCompleted) {
-      // If the stream has been cancelled, complete the cancellation future
-      // with the error.
-      completer.complete();
-    }
-    controller.close();
-  }
-
-  onListen() {
-    assert(!onListenReceived);
-    onListenReceived = true;
-    scheduleGenerator();
-  }
-
-  onResume() {
-    if (isSuspendedAtYield) {
-      scheduleGenerator();
-    }
-  }
-
-  onCancel() {
-    if (controller.isClosed) {
-      return null;
-    }
-    if (cancellationCompleter == null) {
-      cancellationCompleter = Completer();
-      // Only resume the generator if it is suspended at a yield.
-      // Cancellation does not affect an async generator that is
-      // suspended at an await.
-      if (isSuspendedAtYield) {
-        scheduleGenerator();
-      }
-    }
-    return cancellationCompleter!.future;
-  }
-
-  _fatal(String message) => throw StateError(message);
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/collection_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/collection_patch.dart
deleted file mode 100644
index d9709b9..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/collection_patch.dart
+++ /dev/null
@@ -1,580 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// Patch file for dart:collection classes.
-import 'dart:_foreign_helper' show JS, JSExportName;
-import 'dart:_runtime' as dart;
-import 'dart:_interceptors' show JSArray;
-import 'dart:_js_helper'
-    show
-        NoInline,
-        NoSideEffects,
-        NoThrows,
-        patch,
-        LinkedMap,
-        IdentityMap,
-        CustomHashMap,
-        CustomKeyHashMap,
-        DartIterator,
-        notNull,
-        putLinkedMapKey;
-
-@patch
-class HashMap<K, V> {
-  @patch
-  factory HashMap(
-      {bool Function(K, K)? equals,
-      int Function(K)? hashCode,
-      bool Function(dynamic)? isValidKey}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          if (identical(K, String) || identical(K, int)) {
-            return IdentityMap<K, V>();
-          }
-          return LinkedMap<K, V>();
-        }
-        hashCode = dart.hashCode;
-      } else if (identical(identityHashCode, hashCode) &&
-          identical(identical, equals)) {
-        return IdentityMap<K, V>();
-      }
-      return CustomHashMap<K, V>(equals ?? dart.equals, hashCode);
-    }
-    return CustomKeyHashMap<K, V>(
-        equals ?? dart.equals, hashCode ?? dart.hashCode, isValidKey);
-  }
-
-  @patch
-  factory HashMap.identity() = IdentityMap<K, V>;
-}
-
-@patch
-class LinkedHashMap<K, V> {
-  @patch
-  factory LinkedHashMap(
-      {bool Function(K, K)? equals,
-      int Function(K)? hashCode,
-      bool Function(dynamic)? isValidKey}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          if (identical(K, String) || identical(K, int)) {
-            return IdentityMap<K, V>();
-          }
-          return LinkedMap<K, V>();
-        }
-        hashCode = dart.hashCode;
-      } else if (identical(identityHashCode, hashCode) &&
-          identical(identical, equals)) {
-        return IdentityMap<K, V>();
-      }
-      return CustomHashMap<K, V>(equals ?? dart.equals, hashCode);
-    }
-    return CustomKeyHashMap<K, V>(
-        equals ?? dart.equals, hashCode ?? dart.hashCode, isValidKey);
-  }
-
-  @patch
-  factory LinkedHashMap.identity() = IdentityMap<K, V>;
-}
-
-@patch
-class HashSet<E> {
-  @patch
-  factory HashSet(
-      {bool Function(E, E)? equals,
-      int Function(E)? hashCode,
-      bool Function(dynamic)? isValidKey}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          if (identical(E, String) || identical(E, int)) {
-            return _IdentityHashSet<E>();
-          }
-          return _HashSet<E>();
-        }
-      } else if (identical(identityHashCode, hashCode) &&
-          identical(identical, equals)) {
-        return _IdentityHashSet<E>();
-      }
-      return _CustomHashSet<E>(
-          equals ?? dart.equals, hashCode ?? dart.hashCode);
-    }
-    return _CustomKeyHashSet<E>(
-        equals ?? dart.equals, hashCode ?? dart.hashCode, isValidKey);
-  }
-
-  @patch
-  factory HashSet.identity() = _IdentityHashSet<E>;
-}
-
-@patch
-class LinkedHashSet<E> {
-  @patch
-  factory LinkedHashSet(
-      {bool Function(E, E)? equals,
-      int Function(E)? hashCode,
-      bool Function(dynamic)? isValidKey}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          if (identical(E, String) || identical(E, int)) {
-            return _IdentityHashSet<E>();
-          }
-          return _HashSet<E>();
-        }
-        hashCode = dart.hashCode;
-      } else if (identical(identityHashCode, hashCode) &&
-          identical(identical, equals)) {
-        return _IdentityHashSet<E>();
-      }
-      return _CustomHashSet<E>(equals ?? dart.equals, hashCode);
-    }
-    return _CustomKeyHashSet<E>(
-        equals ?? dart.equals, hashCode ?? dart.hashCode, isValidKey);
-  }
-
-  @patch
-  factory LinkedHashSet.identity() = _IdentityHashSet<E>;
-}
-
-class _HashSet<E> extends _InternalSet<E>
-    implements HashSet<E>, LinkedHashSet<E> {
-  /// The backing store for this set.
-  ///
-  /// Keys that use identity equality are stored directly. For other types of
-  /// keys, we first look them up (by hashCode) in the [_keyMap] map, then
-  /// we lookup the key in this map.
-  @notNull
-  final _map = JS('', 'new Set()');
-
-  /// Items that use custom equality semantics.
-  ///
-  /// This maps from the item's hashCode to the canonical key, which is then
-  /// used to lookup the item in [_map]. Keeping the data in our primary backing
-  /// map gives us the ordering semantics requred by [LinkedHashMap], while
-  /// also providing convenient access to keys/values.
-  @notNull
-  final _keyMap = JS('', 'new Map()');
-
-  // We track the number of modifications done to the key set of the
-  // hash map to be able to throw when the map is modified while being
-  // iterated over.
-  //
-  // Value cycles after 2^30 modifications so that modification counts are
-  // always unboxed (Smi) values. Modification detection will be missed if you
-  // make exactly some multiple of 2^30 modifications between advances of an
-  // iterator.
-  @notNull
-  int _modifications = 0;
-
-  _HashSet();
-
-  Set<E> _newSet() => _HashSet<E>();
-
-  Set<R> _newSimilarSet<R>() => _HashSet<R>();
-
-  bool contains(Object? key) {
-    if (key == null) {
-      // Convert undefined to null, if needed.
-      key = null;
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      @notNull
-      Object? k = key;
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
-      if (buckets != null) {
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          k = JS('', '#[#]', buckets, i);
-          if (k == key) return true;
-        }
-      }
-      return false;
-    }
-    return JS<bool>('!', '#.has(#)', _map, key);
-  }
-
-  E? lookup(Object? key) {
-    if (key == null) return null;
-    if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      @notNull
-      Object? k = key;
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, k.hashCode);
-      if (buckets != null) {
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          k = JS('', '#[#]', buckets, i);
-          if (k == key) return JS('', '#', k);
-        }
-      }
-      return null;
-    }
-    return JS('', '#.has(#) ? # : null', _map, key, key);
-  }
-
-  bool add(E key) {
-    var map = _map;
-    if (key == null) {
-      if (JS('', '#.has(null)', map)) return false;
-      // Convert undefined to null, if needed.
-      JS('', '# = null', key);
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      var keyMap = _keyMap;
-      @notNull
-      var k = key;
-      int hash = JS('!', '# & 0x3ffffff', k.hashCode);
-      var buckets = JS('', '#.get(#)', keyMap, hash);
-      if (buckets == null) {
-        JS('', '#.set(#, [#])', keyMap, hash, key);
-      } else {
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          k = JS('', '#[#]', buckets, i);
-          if (k == key) return false;
-        }
-        JS('', '#.push(#)', buckets, key);
-      }
-    } else if (JS('', '#.has(#)', map, key)) {
-      return false;
-    }
-    JS('', '#.add(#)', map, key);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-    return true;
-  }
-
-  void addAll(Iterable<E> objects) {
-    var map = _map;
-    int length = JS('', '#.size', map);
-    for (E key in objects) {
-      if (key == null) {
-        // Convert undefined to null, if needed.
-        JS('', '# = null', key);
-      } else if (JS<bool>('!', '#[#] !== #', key,
-          dart.extensionSymbol('_equals'), dart.identityEquals)) {
-        key = putLinkedMapKey(key, _keyMap);
-      }
-      JS('', '#.add(#)', map, key);
-    }
-    if (length != JS<int>('!', '#.size', map)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-
-  bool remove(Object? key) {
-    if (key == null) {
-      // Convert undefined to null, if needed.
-      key = null;
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      @notNull
-      Object? k = key;
-      int hash = JS('!', '# & 0x3ffffff', k.hashCode);
-      var buckets = JS('', '#.get(#)', _keyMap, hash);
-      if (buckets == null) return false; // not found
-      for (int i = 0, n = JS('!', '#.length', buckets);;) {
-        k = JS('', '#[#]', buckets, i);
-        if (k == key) {
-          key = k;
-          if (n == 1) {
-            JS('', '#.delete(#)', _keyMap, hash);
-          } else {
-            JS('', '#.splice(#, 1)', buckets, i);
-          }
-          break;
-        }
-        if (++i >= n) return false; // not found
-      }
-    }
-    var map = _map;
-    if (JS<bool>('!', '#.delete(#)', map, key)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-      return true;
-    }
-    return false;
-  }
-
-  void clear() {
-    var map = _map;
-    if (JS<int>('!', '#.size', map) > 0) {
-      JS('', '#.clear()', map);
-      JS('', '#.clear()', _keyMap);
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-}
-
-// Used for DDC const sets.
-class _ImmutableSet<E> extends _HashSet<E> {
-  _ImmutableSet.from(JSArray entries) {
-    var map = _map;
-    for (Object key in entries) {
-      if (key == null) {
-        // Convert undefined to null, if needed.
-        JS('', '# = null', key);
-      } else if (JS<bool>('!', '#[#] !== #', key,
-          dart.extensionSymbol('_equals'), dart.identityEquals)) {
-        key = putLinkedMapKey(key, _keyMap);
-      }
-      JS('', '#.add(#)', map, key);
-    }
-  }
-
-  bool add(E value) => throw _unsupported();
-  void addAll(Iterable<E> elements) => throw _unsupported();
-  void clear() => throw _unsupported();
-  bool remove(Object? value) => throw _unsupported();
-
-  static Error _unsupported() =>
-      UnsupportedError("Cannot modify unmodifiable set");
-}
-
-class _IdentityHashSet<E> extends _InternalSet<E>
-    implements HashSet<E>, LinkedHashSet<E> {
-  /// The backing store for this set.
-  @notNull
-  final _map = JS('', 'new Set()');
-
-  @notNull
-  int _modifications = 0;
-
-  _IdentityHashSet();
-
-  Set<E> _newSet() => _IdentityHashSet<E>();
-
-  Set<R> _newSimilarSet<R>() => _IdentityHashSet<R>();
-
-  bool contains(Object? element) {
-    return JS<bool>('!', '#.has(#)', _map, element);
-  }
-
-  E? lookup(Object? element) {
-    return element is E && JS<bool>('!', '#.has(#)', _map, element)
-        ? element
-        : null;
-  }
-
-  bool add(E element) {
-    var map = _map;
-    if (JS<bool>('!', '#.has(#)', map, element)) return false;
-    JS('', '#.add(#)', map, element);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-    return true;
-  }
-
-  void addAll(Iterable<E> objects) {
-    var map = _map;
-    int length = JS('', '#.size', map);
-    for (E key in objects) {
-      JS('', '#.add(#)', map, key);
-    }
-    if (length != JS<int>('!', '#.size', map)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-
-  bool remove(Object? element) {
-    if (JS<bool>('!', '#.delete(#)', _map, element)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-      return true;
-    }
-    return false;
-  }
-
-  void clear() {
-    var map = _map;
-    if (JS<int>('!', '#.size', map) > 0) {
-      JS('', '#.clear()', map);
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-}
-
-class _CustomKeyHashSet<E> extends _CustomHashSet<E> {
-  _Predicate<Object?> _validKey;
-  _CustomKeyHashSet(_Equality<E> equals, _Hasher<E> hashCode, this._validKey)
-      : super(equals, hashCode);
-
-  Set<E> _newSet() => _CustomKeyHashSet<E>(_equals, _hashCode, _validKey);
-
-  Set<R> _newSimilarSet<R>() => _HashSet<R>();
-
-  bool contains(Object? element) {
-    // TODO(jmesserly): there is a subtle difference here compared to Dart 1.
-    // See the comment on CustomKeyHashMap.containsKey for more information.
-    // Treatment of `null` is different due to strong mode's requirement to
-    // perform an `element is E` check before calling equals/hashCode.
-    if (!_validKey(element)) return false;
-    return super.contains(element);
-  }
-
-  E? lookup(Object? element) {
-    if (!_validKey(element)) return null;
-    return super.lookup(element);
-  }
-
-  bool remove(Object? element) {
-    if (!_validKey(element)) return false;
-    return super.remove(element);
-  }
-}
-
-class _CustomHashSet<E> extends _InternalSet<E>
-    implements HashSet<E>, LinkedHashSet<E> {
-  _Equality<E> _equals;
-  _Hasher<E> _hashCode;
-
-  // We track the number of modifications done to the key set of the
-  // hash map to be able to throw when the map is modified while being
-  // iterated over.
-  //
-  // Value cycles after 2^30 modifications so that modification counts are
-  // always unboxed (Smi) values. Modification detection will be missed if you
-  // make exactly some multiple of 2^30 modifications between advances of an
-  // iterator.
-  @notNull
-  int _modifications = 0;
-
-  /// The backing store for this set, used to handle ordering.
-  // TODO(jmesserly): a non-linked custom hash set could skip this.
-  @notNull
-  final _map = JS('', 'new Set()');
-
-  /// Our map used to map keys onto the canonical key that is stored in [_map].
-  @notNull
-  final _keyMap = JS('', 'new Map()');
-
-  _CustomHashSet(this._equals, this._hashCode);
-
-  Set<E> _newSet() => _CustomHashSet<E>(_equals, _hashCode);
-  Set<R> _newSimilarSet<R>() => _HashSet<R>();
-
-  bool contains(Object? key) {
-    if (key is E) {
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
-      if (buckets != null) {
-        var equals = _equals;
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          E k = JS('', '#[#]', buckets, i);
-          if (equals(k, key)) return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  E? lookup(Object? key) {
-    if (key is E) {
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
-      if (buckets != null) {
-        var equals = _equals;
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          E k = JS('', '#[#]', buckets, i);
-          if (equals(k, key)) return k;
-        }
-      }
-    }
-    return null;
-  }
-
-  bool add(E key) {
-    var keyMap = _keyMap;
-    var hash = JS<int>('!', '# & 0x3ffffff', _hashCode(key));
-    var buckets = JS('', '#.get(#)', keyMap, hash);
-    if (buckets == null) {
-      JS('', '#.set(#, [#])', keyMap, hash, key);
-    } else {
-      var equals = _equals;
-      for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-        E k = JS('', '#[#]', buckets, i);
-        if (equals(k, key)) return false;
-      }
-      JS('', '#.push(#)', buckets, key);
-    }
-    JS('', '#.add(#)', _map, key);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-    return true;
-  }
-
-  void addAll(Iterable<E> objects) {
-    // TODO(jmesserly): it'd be nice to skip the covariance check here.
-    for (E element in objects) add(element);
-  }
-
-  bool remove(Object? key) {
-    if (key is E) {
-      var hash = JS<int>('!', '# & 0x3ffffff', _hashCode(key));
-      var keyMap = _keyMap;
-      var buckets = JS('', '#.get(#)', keyMap, hash);
-      if (buckets == null) return false; // not found
-      var equals = _equals;
-      for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-        E k = JS('', '#[#]', buckets, i);
-        if (equals(k, key)) {
-          if (n == 1) {
-            JS('', '#.delete(#)', keyMap, hash);
-          } else {
-            JS('', '#.splice(#, 1)', buckets, i);
-          }
-          JS('', '#.delete(#)', _map, k);
-          _modifications = (_modifications + 1) & 0x3ffffff;
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  void clear() {
-    var map = _map;
-    if (JS<int>('!', '#.size', map) > 0) {
-      JS('', '#.clear()', map);
-      JS('', '#.clear()', _keyMap);
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-}
-
-/// Base class for our internal [LinkedHashSet]/[HashSet] implementations.
-///
-/// This implements the common functionality.
-abstract class _InternalSet<E> extends _SetBase<E> {
-  @notNull
-  get _map;
-
-  @notNull
-  int get _modifications;
-
-  @notNull
-  int get length => JS<int>('!', '#.size', _map);
-
-  @notNull
-  bool get isEmpty => JS<bool>('!', '#.size == 0', _map);
-
-  @notNull
-  bool get isNotEmpty => JS<bool>('!', '#.size != 0', _map);
-
-  Iterator<E> get iterator => DartIterator<E>(_jsIterator());
-
-  @JSExportName('Symbol.iterator')
-  _jsIterator() {
-    var self = this;
-    var iterator = JS('', '#.values()', self._map);
-    int modifications = self._modifications;
-    return JS(
-        '',
-        '''{
-      next() {
-        if (# != #) {
-          throw #;
-        }
-        return #.next();
-      }
-    }''',
-        modifications,
-        self._modifications,
-        ConcurrentModificationError(self),
-        iterator);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/convert_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/convert_patch.dart
deleted file mode 100644
index c86dab0..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/convert_patch.dart
+++ /dev/null
@@ -1,487 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// Patch file for dart:convert library.
-
-import 'dart:_js_helper' show argumentErrorValue, patch;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show JSExtendableArray;
-import 'dart:_internal' show MappedIterable, ListIterable;
-import 'dart:collection' show LinkedHashMap, MapBase;
-import 'dart:_native_typed_data' show NativeUint8List;
-
-/**
- * Parses [json] and builds the corresponding parsed JSON value.
- *
- * Parsed JSON values Nare of the types [num], [String], [bool], [Null],
- * [List]s of parsed JSON values or [Map]s from [String] to parsed
- * JSON values.
- *
- * The optional [reviver] function, if provided, is called once for each object
- * or list property parsed. The arguments are the property name ([String]) or
- * list index ([int]), and the value is the parsed value.  The return value of
- * the reviver will be used as the value of that property instead of the parsed
- * value.  The top level value is passed to the reviver with the empty string as
- * a key.
- *
- * Throws [FormatException] if the input is not valid JSON text.
- */
-@patch
-_parseJson(String source, reviver(key, value)?) {
-  if (source is! String) throw argumentErrorValue(source);
-
-  var parsed;
-  try {
-    parsed = JS('=Object|JSExtendableArray|Null|bool|num|String',
-        'JSON.parse(#)', source);
-  } catch (e) {
-    throw FormatException(JS<String>('!', 'String(#)', e));
-  }
-
-  if (reviver == null) {
-    return _convertJsonToDartLazy(parsed);
-  } else {
-    return _convertJsonToDart(parsed, reviver);
-  }
-}
-
-/**
- * Walks the raw JavaScript value [json], replacing JavaScript Objects with
- * Maps. [json] is expected to be freshly allocated so elements can be replaced
- * in-place.
- */
-_convertJsonToDart(json, reviver(Object? key, Object? value)) {
-  walk(e) {
-    // JavaScript null, string, number, bool are in the correct representation.
-    if (JS<bool>('!', '# == null', e) ||
-        JS<bool>('!', 'typeof # != "object"', e)) {
-      return e;
-    }
-
-    // This test is needed to avoid identifying '{"__proto__":[]}' as an Array.
-    // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
-    // bug 621 below is fixed.
-    if (JS<bool>('!', 'Object.getPrototypeOf(#) === Array.prototype', e)) {
-      // In-place update of the elements since JS Array is a Dart List.
-      for (int i = 0; i < JS<int>('!', '#.length', e); i++) {
-        // Use JS indexing to avoid range checks.  We know this is the only
-        // reference to the list, but the compiler will likely never be able to
-        // tell that this instance of the list cannot have its length changed by
-        // the reviver even though it later will be passed to the reviver at the
-        // outer level.
-        var item = JS('', '#[#]', e, i);
-        JS('', '#[#]=#', e, i, reviver(i, walk(item)));
-      }
-      return e;
-    }
-
-    // Otherwise it is a plain object, so copy to a JSON map, so we process
-    // and revive all entries recursively.
-    _JsonMap map = _JsonMap(e);
-    var processed = map._processed;
-    List<String> keys = map._computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-      var revived = reviver(key, walk(JS('', '#[#]', e, key)));
-      JS('', '#[#]=#', processed, key, revived);
-    }
-
-    // Update the JSON map structure so future access is cheaper.
-    map._original = processed; // Don't keep two objects around.
-    return map;
-  }
-
-  return reviver(null, walk(json));
-}
-
-_convertJsonToDartLazy(object) {
-  // JavaScript null and undefined are represented as null.
-  if (object == null) return null;
-
-  // JavaScript string, number, bool already has the correct representation.
-  if (JS<bool>('!', 'typeof # != "object"', object)) {
-    return object;
-  }
-
-  // This test is needed to avoid identifying '{"__proto__":[]}' as an array.
-  // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
-  // bug https://code.google.com/p/v8/issues/detail?id=621 is fixed.
-  if (JS<bool>('!', 'Object.getPrototypeOf(#) !== Array.prototype', object)) {
-    return _JsonMap(object);
-  }
-
-  // Update the elements in place since JS arrays are Dart lists.
-  for (int i = 0; i < JS<int>('!', '#.length', object); i++) {
-    // Use JS indexing to avoid range checks.  We know this is the only
-    // reference to the list, but the compiler will likely never be able to
-    // tell that this instance of the list cannot have its length changed by
-    // the reviver even though it later will be passed to the reviver at the
-    // outer level.
-    var item = JS('', '#[#]', object, i);
-    JS('', '#[#]=#', object, i, _convertJsonToDartLazy(item));
-  }
-  return object;
-}
-
-class _JsonMap extends MapBase<String, dynamic> {
-  // The original JavaScript object remains unchanged until
-  // the map is eventually upgraded, in which case we null it
-  // out to reclaim the memory used by it.
-  var _original;
-
-  // We keep track of the map entries that we have already
-  // processed by adding them to a separate JavaScript object.
-  var _processed = _newJavaScriptObject();
-
-  // If the data slot isn't null, it represents either the list
-  // of keys (for non-upgraded JSON maps) or the upgraded map.
-  var _data = null;
-
-  _JsonMap(this._original);
-
-  operator [](key) {
-    if (_isUpgraded) {
-      return _upgradedMap[key];
-    } else if (key is! String) {
-      return null;
-    } else {
-      var result = _getProperty(_processed, key);
-      if (_isUnprocessed(result)) result = _process(key);
-      return result;
-    }
-  }
-
-  int get length => _isUpgraded ? _upgradedMap.length : _computeKeys().length;
-
-  bool get isEmpty => length == 0;
-  bool get isNotEmpty => length > 0;
-
-  Iterable<String> get keys {
-    if (_isUpgraded) return _upgradedMap.keys;
-    return _JsonMapKeyIterable(this);
-  }
-
-  Iterable get values {
-    if (_isUpgraded) return _upgradedMap.values;
-    return MappedIterable(_computeKeys(), (each) => this[each]);
-  }
-
-  operator []=(key, value) {
-    if (_isUpgraded) {
-      _upgradedMap[key] = value;
-    } else if (containsKey(key)) {
-      var processed = _processed;
-      _setProperty(processed, key, value);
-      var original = _original;
-      if (!identical(original, processed)) {
-        _setProperty(original, key, null); // Reclaim memory.
-      }
-    } else {
-      _upgrade()[key] = value;
-    }
-  }
-
-  void addAll(Map<String, dynamic> other) {
-    other.forEach((key, value) {
-      this[key] = value;
-    });
-  }
-
-  bool containsValue(value) {
-    if (_isUpgraded) return _upgradedMap.containsValue(value);
-    List<String> keys = _computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-      if (this[key] == value) return true;
-    }
-    return false;
-  }
-
-  bool containsKey(key) {
-    if (_isUpgraded) return _upgradedMap.containsKey(key);
-    if (key is! String) return false;
-    return _hasProperty(_original, key);
-  }
-
-  putIfAbsent(key, ifAbsent()) {
-    if (containsKey(key)) return this[key];
-    var value = ifAbsent();
-    this[key] = value;
-    return value;
-  }
-
-  remove(Object? key) {
-    if (!_isUpgraded && !containsKey(key)) return null;
-    return _upgrade().remove(key);
-  }
-
-  void clear() {
-    if (_isUpgraded) {
-      _upgradedMap.clear();
-    } else {
-      if (_data != null) {
-        // Clear the list of keys to make sure we force
-        // a concurrent modification error if anyone is
-        // currently iterating over it.
-        _data.clear();
-      }
-      _original = _processed = null;
-      _data = {};
-    }
-  }
-
-  void forEach(void f(String key, value)) {
-    if (_isUpgraded) return _upgradedMap.forEach(f);
-    List<String> keys = _computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-
-      // Compute the value under the assumption that the property
-      // is present but potentially not processed.
-      var value = _getProperty(_processed, key);
-      if (_isUnprocessed(value)) {
-        value = _convertJsonToDartLazy(_getProperty(_original, key));
-        _setProperty(_processed, key, value);
-      }
-
-      // Do the callback.
-      f(key, value);
-
-      // Check if invoking the callback function changed
-      // the key set. If so, throw an exception.
-      if (!identical(keys, _data)) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-  }
-
-  // ------------------------------------------
-  // Private helper methods.
-  // ------------------------------------------
-
-  bool get _isUpgraded => _processed == null;
-
-  Map<String, dynamic> get _upgradedMap {
-    assert(_isUpgraded);
-    // 'cast' the union type to LinkedHashMap.  It would be even better if we
-    // could 'cast' to the implementation type, since LinkedHashMap includes
-    // _JsonMap.
-    return JS('LinkedHashMap', '#', _data);
-  }
-
-  List<String> _computeKeys() {
-    assert(!_isUpgraded);
-    List? keys = _data;
-    if (keys == null) {
-      keys = _data = _getPropertyNames(_original);
-    }
-    return JS('JSExtendableArray', '#', keys);
-  }
-
-  Map<String, dynamic> _upgrade() {
-    if (_isUpgraded) return _upgradedMap;
-
-    // Copy all the (key, value) pairs to a freshly allocated
-    // linked hash map thus preserving the ordering.
-    var result = <String, dynamic>{};
-    List<String> keys = _computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-      result[key] = this[key];
-    }
-
-    // We only upgrade when we need to extend the map, so we can
-    // safely force a concurrent modification error in case
-    // someone is iterating over the map here.
-    if (keys.isEmpty) {
-      keys.add("");
-    } else {
-      keys.clear();
-    }
-
-    // Clear out the associated JavaScript objects and mark the
-    // map as having been upgraded.
-    _original = _processed = null;
-    _data = result;
-    assert(_isUpgraded);
-    return result;
-  }
-
-  _process(String key) {
-    if (!_hasProperty(_original, key)) return null;
-    var result = _convertJsonToDartLazy(_getProperty(_original, key));
-    return _setProperty(_processed, key, result);
-  }
-
-  // ------------------------------------------
-  // Private JavaScript helper methods.
-  // ------------------------------------------
-
-  static bool _hasProperty(object, String key) =>
-      JS<bool>('!', 'Object.prototype.hasOwnProperty.call(#,#)', object, key);
-  static _getProperty(object, String key) => JS('', '#[#]', object, key);
-  static _setProperty(object, String key, value) =>
-      JS('', '#[#]=#', object, key, value);
-  static List _getPropertyNames(object) =>
-      JS('JSExtendableArray', 'Object.keys(#)', object);
-  static bool _isUnprocessed(object) =>
-      JS<bool>('!', 'typeof(#)=="undefined"', object);
-  static _newJavaScriptObject() => JS('=Object', 'Object.create(null)');
-}
-
-class _JsonMapKeyIterable extends ListIterable<String> {
-  final _JsonMap _parent;
-
-  _JsonMapKeyIterable(this._parent);
-
-  int get length => _parent.length;
-
-  String elementAt(int index) {
-    return _parent._isUpgraded
-        ? _parent.keys.elementAt(index)
-        : _parent._computeKeys()[index];
-  }
-
-  /// Although [ListIterable] defines its own iterator, we return the iterator
-  /// of the underlying list [_keys] in order to propagate
-  /// [ConcurrentModificationError]s.
-  Iterator<String> get iterator {
-    return _parent._isUpgraded
-        ? _parent.keys.iterator
-        : _parent._computeKeys().iterator;
-  }
-
-  /// Delegate to [parent.containsKey] to ensure the performance expected
-  /// from [Map.keys.containsKey].
-  bool contains(Object? key) => _parent.containsKey(key);
-}
-
-@patch
-class JsonDecoder {
-  @patch
-  StringConversionSink startChunkedConversion(Sink<Object?> sink) {
-    return _JsonDecoderSink(_reviver, sink);
-  }
-}
-
-/**
- * Implements the chunked conversion from a JSON string to its corresponding
- * object.
- *
- * The sink only creates one object, but its input can be chunked.
- */
-// TODO(floitsch): don't accumulate everything before starting to decode.
-class _JsonDecoderSink extends _StringSinkConversionSink<StringBuffer> {
-  final Object? Function(Object? key, Object? value)? _reviver;
-  final Sink<Object?> _sink;
-
-  _JsonDecoderSink(this._reviver, this._sink) : super(StringBuffer(''));
-
-  void close() {
-    super.close();
-    String accumulated = _stringSink.toString();
-    _stringSink.clear();
-    Object? decoded = _parseJson(accumulated, _reviver);
-    _sink.add(decoded);
-    _sink.close();
-  }
-}
-
-@patch
-class Utf8Decoder {
-  // Always fall back to the Dart implementation for strings shorter than this
-  // threshold, as there is a large, constant overhead for using TextDecoder.
-  static const int _shortInputThreshold = 15;
-
-  @patch
-  Converter<List<int>, T> fuse<T>(Converter<String, T> next) {
-    return super.fuse(next);
-  }
-
-  // Currently not intercepting UTF8 decoding.
-  @patch
-  static String? _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int? end) {
-    // Test `codeUnits is NativeUint8List`. Dart's NativeUint8List is
-    // implemented by JavaScript's Uint8Array.
-    if (JS<bool>('!', '# instanceof Uint8Array', codeUnits)) {
-      // JS 'cast' to avoid a downcast equivalent to the is-check we hand-coded.
-      NativeUint8List casted = JS<NativeUint8List>('!', '#', codeUnits);
-      // Always use Dart implementation for short strings.
-      end ??= casted.length;
-      if (end - start < _shortInputThreshold) {
-        return null;
-      }
-      String? result =
-          _convertInterceptedUint8List(allowMalformed, casted, start, end);
-      if (result != null && allowMalformed) {
-        // In principle, TextDecoder should have provided the correct result
-        // here, but some browsers deviate from the standard as to how many
-        // replacement characters they produce. Thus, we fall back to the Dart
-        // implementation if the result contains any replacement characters.
-        if (JS<int>('int', r'#.indexOf(#)', result, '\uFFFD') >= 0) {
-          return null;
-        }
-      }
-      return result;
-    }
-    return null; // This call was not intercepted.
-  }
-
-  static String? _convertInterceptedUint8List(
-      bool allowMalformed, NativeUint8List codeUnits, int start, int end) {
-    final decoder = allowMalformed ? _decoderNonfatal : _decoder;
-    if (decoder == null) return null;
-    if (0 == start && end == codeUnits.length) {
-      return _useTextDecoder(decoder, codeUnits);
-    }
-
-    int length = codeUnits.length;
-    end = RangeError.checkValidRange(start, end, length);
-
-    return _useTextDecoder(decoder,
-        JS<NativeUint8List>('!', '#.subarray(#, #)', codeUnits, start, end));
-  }
-
-  static String? _useTextDecoder(decoder, NativeUint8List codeUnits) {
-    // If the input is malformed, catch the exception and return `null` to fall
-    // back on unintercepted decoder. The fallback will either succeed in
-    // decoding, or report the problem better than TextDecoder.
-    try {
-      return JS<String>('!', '#.decode(#)', decoder, codeUnits);
-    } catch (e) {}
-    return null;
-  }
-
-  // TextDecoder is not defined on some browsers and on the stand-alone d8 and
-  // jsshell engines. Use a lazy initializer to do feature detection once.
-  static final _decoder = () {
-    try {
-      return JS('', 'new TextDecoder("utf-8", {fatal: true})');
-    } catch (e) {}
-    return null;
-  }();
-  static final _decoderNonfatal = () {
-    try {
-      return JS('', 'new TextDecoder("utf-8", {fatal: false})');
-    } catch (e) {}
-    return null;
-  }();
-}
-
-@patch
-class _Utf8Decoder {
-  @patch
-  _Utf8Decoder(this.allowMalformed) : _state = beforeBom;
-
-  @patch
-  String convertSingle(List<int> codeUnits, int start, int? maybeEnd) {
-    return convertGeneral(codeUnits, start, maybeEnd, true);
-  }
-
-  @patch
-  String convertChunked(List<int> codeUnits, int start, int? maybeEnd) {
-    return convertGeneral(codeUnits, start, maybeEnd, false);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/core_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/core_patch.dart
deleted file mode 100644
index 2171a9f..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/core_patch.dart
+++ /dev/null
@@ -1,3015 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for dart:core classes.
-import "dart:_internal" as _symbol_dev;
-import 'dart:_interceptors';
-import 'dart:_js_helper'
-    show
-        patch,
-        checkInt,
-        getRuntimeType,
-        LinkedMap,
-        JSSyntaxRegExp,
-        NoInline,
-        notNull,
-        nullCheck,
-        Primitives,
-        PrivateSymbol,
-        quoteStringForRegExp,
-        undefined;
-import 'dart:_runtime' as dart;
-import 'dart:_foreign_helper' show JS, JSExportName;
-import 'dart:_native_typed_data' show NativeUint8List;
-import 'dart:collection' show UnmodifiableMapView;
-import 'dart:convert' show Encoding, utf8;
-import 'dart:typed_data' show Endian, Uint8List, Uint16List;
-
-String _symbolToString(Symbol symbol) => symbol is PrivateSymbol
-    ? PrivateSymbol.getName(symbol)
-    : _symbol_dev.Symbol.getName(symbol as _symbol_dev.Symbol);
-
-@patch
-int identityHashCode(Object? object) {
-  if (object == null) return 0;
-  // Note: this works for primitives because we define the `identityHashCode`
-  // for them to be equivalent to their computed hashCode function.
-  int? hash = JS<int?>('int|Null', r'#[#]', object, dart.identityHashCode_);
-  if (hash == null) {
-    hash = JS<int>('!', '(Math.random() * 0x3fffffff) | 0');
-    JS('void', r'#[#] = #', object, dart.identityHashCode_, hash);
-  }
-  return JS<int>('!', '#', hash);
-}
-
-// Patch for Object implementation.
-@patch
-class Object {
-  @patch
-  bool operator ==(Object other) => identical(this, other);
-
-  @patch
-  int get hashCode => identityHashCode(this);
-
-  @patch
-  String toString() =>
-      "Instance of '${dart.typeName(dart.getReifiedType(this))}'";
-
-  @patch
-  dynamic noSuchMethod(Invocation invocation) {
-    return dart.defaultNoSuchMethod(this, invocation);
-  }
-
-  @patch
-  Type get runtimeType => dart.wrapType(dart.getReifiedType(this));
-
-  // Everything is an Object.
-  @JSExportName('is')
-  static bool _is_Object(Object? o) => o != null;
-
-  @JSExportName('as')
-  static Object? _as_Object(Object? o) =>
-      o == null ? dart.cast(o, dart.unwrapType(Object)) : o;
-}
-
-@patch
-class Null {
-  @patch
-  int get hashCode => super.hashCode;
-
-  @JSExportName('is')
-  static bool _is_Null(Object? o) => o == null;
-
-  @JSExportName('as')
-  static Object? _as_Null(Object? o) {
-    // Avoid extra function call to core.Null.is() by manually inlining.
-    if (o == null) return o;
-    return dart.cast(o, dart.unwrapType(Null));
-  }
-}
-
-// Patch for Function implementation.
-@patch
-class Function {
-  @patch
-  static apply(Function function, List<dynamic>? positionalArguments,
-      [Map<Symbol, dynamic>? namedArguments]) {
-    positionalArguments ??= [];
-    // dcall expects the namedArguments as a JS map in the last slot.
-    if (namedArguments != null && namedArguments.isNotEmpty) {
-      var map = JS('', '{}');
-      namedArguments.forEach((symbol, arg) {
-        JS('', '#[#] = #', map, _symbolToString(symbol), arg);
-      });
-      return dart.dcall(function, positionalArguments, map);
-    }
-    return dart.dcall(function, positionalArguments);
-  }
-
-  static Map<String, dynamic> _toMangledNames(
-      Map<Symbol, dynamic> namedArguments) {
-    Map<String, dynamic> result = {};
-    namedArguments.forEach((symbol, value) {
-      result[_symbolToString(symbol)] = value;
-    });
-    return result;
-  }
-
-  @JSExportName('is')
-  static bool _is_Function(Object? o) =>
-      JS<bool>('!', 'typeof $o == "function"');
-
-  @JSExportName('as')
-  static Object? _as_Function(Object? o) {
-    // Avoid extra function call to core.Function.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "function"')) return o;
-    return dart.cast(o, dart.unwrapType(Function));
-  }
-}
-
-// TODO(jmesserly): switch to WeakMap
-// Patch for Expando implementation.
-@patch
-class Expando<T extends Object> {
-  @patch
-  Expando([String? name]) : this.name = name;
-
-  @patch
-  T? operator [](Object object) {
-    var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    return (values == null)
-        ? null
-        : Primitives.getProperty(values, _getKey()) as T?;
-  }
-
-  @patch
-  void operator []=(Object object, T? value) {
-    var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    if (values == null) {
-      values = Object();
-      Primitives.setProperty(object, _EXPANDO_PROPERTY_NAME, values);
-    }
-    Primitives.setProperty(values, _getKey(), value);
-  }
-
-  String _getKey() {
-    var key = Primitives.getProperty(this, _KEY_PROPERTY_NAME) as String?;
-    if (key == null) {
-      key = "expando\$key\$${_keyCount++}";
-      Primitives.setProperty(this, _KEY_PROPERTY_NAME, key);
-    }
-    return key;
-  }
-
-  static const String _KEY_PROPERTY_NAME = 'expando\$key';
-  static const String _EXPANDO_PROPERTY_NAME = 'expando\$values';
-  static int _keyCount = 0;
-}
-
-@patch
-class int {
-  @patch
-  static int parse(String source,
-      {int? radix, @deprecated int onError(String source)?}) {
-    var value = tryParse(source, radix: radix);
-    if (value != null) return value;
-    if (onError != null) return onError(source);
-    throw new FormatException(source);
-  }
-
-  @patch
-  static int? tryParse(String source, {int? radix}) {
-    return Primitives.parseInt(source, radix);
-  }
-
-  @patch
-  factory int.fromEnvironment(String name, {int defaultValue = 0}) {
-    // ignore: const_constructor_throws_exception
-    throw UnsupportedError(
-        'int.fromEnvironment can only be used as a const constructor');
-  }
-
-  @JSExportName('is')
-  static bool _is_int(Object? o) {
-    return JS<bool>('!', 'typeof $o == "number" && Math.floor($o) == $o');
-  }
-
-  @JSExportName('as')
-  static Object? _as_int(Object? o) {
-    // Avoid extra function call to core.int.is() by manually inlining.
-    if (JS<bool>('!', '(typeof $o == "number" && Math.floor($o) == $o)')) {
-      return o;
-    }
-    return dart.cast(o, dart.unwrapType(int));
-  }
-}
-
-@patch
-class double {
-  @patch
-  static double parse(String source,
-      [@deprecated double onError(String source)?]) {
-    var value = tryParse(source);
-    if (value != null) return value;
-    if (onError != null) return onError(source);
-    throw new FormatException('Invalid double', source);
-  }
-
-  @patch
-  static double? tryParse(String source) {
-    return Primitives.parseDouble(source);
-  }
-
-  @JSExportName('is')
-  static bool _is_double(Object? o) {
-    return JS<bool>('!', 'typeof $o == "number"');
-  }
-
-  @JSExportName('as')
-  static Object? _as_double(Object? o) {
-    // Avoid extra function call to core.double.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "number"')) return o;
-    return dart.cast(o, dart.unwrapType(double));
-  }
-}
-
-@patch
-abstract class num implements Comparable<num> {
-  @JSExportName('is')
-  static bool _is_num(Object? o) {
-    return JS<bool>('!', 'typeof $o == "number"');
-  }
-
-  @JSExportName('as')
-  static Object? _as_num(Object? o) {
-    // Avoid extra function call to core.num.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "number"')) return o;
-    return dart.cast(o, dart.unwrapType(num));
-  }
-}
-
-@patch
-class BigInt implements Comparable<BigInt> {
-  @patch
-  static BigInt get zero => _BigIntImpl.zero;
-  @patch
-  static BigInt get one => _BigIntImpl.one;
-  @patch
-  static BigInt get two => _BigIntImpl.two;
-
-  @patch
-  static BigInt parse(String source, {int? radix}) =>
-      _BigIntImpl.parse(source, radix: radix);
-
-  @patch
-  static BigInt? tryParse(String source, {int? radix}) =>
-      _BigIntImpl._tryParse(source, radix: radix);
-
-  @patch
-  factory BigInt.from(num value) = _BigIntImpl.from;
-}
-
-@patch
-class Error {
-  @patch
-  static String _objectToString(Object object) {
-    return "Instance of '${dart.typeName(dart.getReifiedType(object))}'";
-  }
-
-  @patch
-  static String _stringToSafeString(String string) {
-    return JS("String", "JSON.stringify(#)", string);
-  }
-
-  @patch
-  StackTrace? get stackTrace => dart.stackTraceForError(this);
-}
-
-@patch
-class FallThroughError {
-  @patch
-  FallThroughError._create(String url, int line);
-
-  @patch
-  String toString() => super.toString();
-}
-
-@patch
-class AbstractClassInstantiationError {
-  @patch
-  String toString() => "Cannot instantiate abstract class: '$_className'";
-}
-
-// Patch for DateTime implementation.
-@patch
-class DateTime {
-  @patch
-  DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
-      {bool isUtc = false})
-      : this._withValue(millisecondsSinceEpoch, isUtc: isUtc);
-
-  @patch
-  DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch,
-      {bool isUtc = false})
-      : this._withValue(
-            _microsecondInRoundedMilliseconds(microsecondsSinceEpoch),
-            isUtc: isUtc);
-
-  @patch
-  DateTime._internal(int year, int month, int day, int hour, int minute,
-      int second, int millisecond, int microsecond, bool isUtc)
-      : isUtc = isUtc,
-        _value = checkInt(Primitives.valueFromDecomposedDate(
-            year,
-            month,
-            day,
-            hour,
-            minute,
-            second,
-            millisecond + _microsecondInRoundedMilliseconds(microsecond),
-            isUtc));
-
-  @patch
-  DateTime._now()
-      : isUtc = false,
-        _value = Primitives.dateNow();
-
-  /// Rounds the given [microsecond] to the nearest milliseconds value.
-  ///
-  /// For example, invoked with argument `2600` returns `3`.
-  static int _microsecondInRoundedMilliseconds(int microsecond) {
-    return (microsecond / 1000).round();
-  }
-
-  @patch
-  static int? _brokenDownDateToValue(int year, int month, int day, int hour,
-      int minute, int second, int millisecond, int microsecond, bool isUtc) {
-    return Primitives.valueFromDecomposedDate(
-        year,
-        month,
-        day,
-        hour,
-        minute,
-        second,
-        millisecond + _microsecondInRoundedMilliseconds(microsecond),
-        isUtc);
-  }
-
-  @patch
-  String get timeZoneName {
-    if (isUtc) return "UTC";
-    return Primitives.getTimeZoneName(this);
-  }
-
-  @patch
-  Duration get timeZoneOffset {
-    if (isUtc) return Duration.zero;
-    return Duration(minutes: Primitives.getTimeZoneOffsetInMinutes(this));
-  }
-
-  @patch
-  DateTime add(Duration duration) {
-    return DateTime._withValue(_value + duration.inMilliseconds, isUtc: isUtc);
-  }
-
-  @patch
-  DateTime subtract(Duration duration) {
-    return DateTime._withValue(_value - duration.inMilliseconds, isUtc: isUtc);
-  }
-
-  @patch
-  Duration difference(DateTime other) {
-    return Duration(milliseconds: _value - other._value);
-  }
-
-  @patch
-  int get millisecondsSinceEpoch => _value;
-
-  @patch
-  int get microsecondsSinceEpoch => _value * 1000;
-
-  @patch
-  int get year => Primitives.getYear(this);
-
-  @patch
-  int get month => Primitives.getMonth(this);
-
-  @patch
-  int get day => Primitives.getDay(this);
-
-  @patch
-  int get hour => Primitives.getHours(this);
-
-  @patch
-  int get minute => Primitives.getMinutes(this);
-
-  @patch
-  int get second => Primitives.getSeconds(this);
-
-  @patch
-  int get millisecond => Primitives.getMilliseconds(this);
-
-  @patch
-  int get microsecond => 0;
-
-  @patch
-  int get weekday => Primitives.getWeekday(this);
-
-  @patch
-  bool operator ==(Object other) =>
-      other is DateTime &&
-      _value == other.millisecondsSinceEpoch &&
-      isUtc == other.isUtc;
-
-  @patch
-  bool isBefore(DateTime other) => _value < other.millisecondsSinceEpoch;
-
-  @patch
-  bool isAfter(DateTime other) => _value > other.millisecondsSinceEpoch;
-
-  @patch
-  bool isAtSameMomentAs(DateTime other) =>
-      _value == other.millisecondsSinceEpoch;
-
-  @patch
-  int compareTo(DateTime other) =>
-      _value.compareTo(other.millisecondsSinceEpoch);
-}
-
-// Patch for Stopwatch implementation.
-@patch
-class Stopwatch {
-  @patch
-  static int _initTicker() {
-    Primitives.initTicker();
-    return Primitives.timerFrequency;
-  }
-
-  @patch
-  static int _now() => Primitives.timerTicks();
-
-  @patch
-  int get elapsedMicroseconds {
-    int ticks = elapsedTicks;
-    if (_frequency == 1000000) return ticks;
-    assert(_frequency == 1000);
-    return ticks * 1000;
-  }
-
-  @patch
-  int get elapsedMilliseconds {
-    int ticks = elapsedTicks;
-    if (_frequency == 1000) return ticks;
-    assert(_frequency == 1000000);
-    return ticks ~/ 1000;
-  }
-}
-
-// Patch for List implementation.
-@patch
-class List<E> {
-  @patch
-  factory List([@undefined int? length]) {
-    dynamic list;
-    if (JS<bool>('!', '# === void 0', length)) {
-      list = JS('', '[]');
-    } else {
-      int _length = JS('!', '#', length);
-      if (length == null || _length < 0) {
-        throw ArgumentError("Length must be a non-negative integer: $_length");
-      }
-      list = JS('', 'new Array(#)', _length);
-      JS('', '#.fill(null)', list);
-      JSArray.markFixedList(list);
-    }
-    return JSArray<E>.of(list);
-  }
-
-  @patch
-  factory List.empty({bool growable = false}) {
-    var list = JSArray<E>.of(JS('', 'new Array()'));
-    if (!growable) JSArray.markFixedList(list);
-    return list;
-  }
-
-  @patch
-  factory List.filled(@nullCheck int length, E fill, {bool growable = false}) {
-    var list = JSArray<E>.of(JS('', 'new Array(#)', length));
-    JS('', '#.fill(#)', list, fill);
-    if (!growable) JSArray.markFixedList(list);
-    return list;
-  }
-
-  @patch
-  factory List.from(Iterable elements, {bool growable = true}) {
-    var list = JSArray<E>.of(JS('', '[]'));
-    // Specialize the copy loop for the case that doesn't need a
-    // runtime check.
-    if (elements is Iterable<E>) {
-      for (var e in elements) {
-        list.add(e);
-      }
-    } else {
-      for (var e in elements) {
-        list.add(e as E);
-      }
-    }
-    if (!growable) JSArray.markFixedList(list);
-    return list;
-  }
-
-  @patch
-  factory List.of(Iterable<E> elements, {bool growable = true}) {
-    // TODO(32937): Specialize to benefit from known element type.
-    return List.from(elements, growable: growable);
-  }
-
-  @patch
-  factory List.generate(int length, E generator(int index),
-      {bool growable = true}) {
-    final result = JSArray<E>.of(JS('', 'new Array(#)', length));
-    if (!growable) JSArray.markFixedList(result);
-    for (int i = 0; i < length; i++) {
-      result[i] = generator(i);
-    }
-    return result;
-  }
-
-  @patch
-  factory List.unmodifiable(Iterable elements) {
-    var list = List<E>.from(elements);
-    JSArray.markUnmodifiableList(list);
-    return list;
-  }
-}
-
-@patch
-class Map<K, V> {
-  @patch
-  factory Map.unmodifiable(Map<dynamic, dynamic> other) {
-    return UnmodifiableMapView<K, V>(Map<K, V>.from(other));
-  }
-
-  @patch
-  factory Map() = LinkedMap<K, V>;
-}
-
-@patch
-class String {
-  @patch
-  factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int? end]) {
-    if (charCodes is JSArray) {
-      return _stringFromJSArray(charCodes, start, end);
-    }
-    if (charCodes is NativeUint8List) {
-      return _stringFromUint8List(charCodes, start, end);
-    }
-    return _stringFromIterable(charCodes, start, end);
-  }
-
-  @patch
-  factory String.fromCharCode(int charCode) {
-    return Primitives.stringFromCharCode(charCode);
-  }
-
-  @patch
-  factory String.fromEnvironment(String name, {String defaultValue = ""}) {
-    // ignore: const_constructor_throws_exception
-    throw UnsupportedError(
-        'String.fromEnvironment can only be used as a const constructor');
-  }
-
-  static String _stringFromJSArray(
-      /*=JSArray<int>*/ list,
-      int start,
-      int? endOrNull) {
-    int len = list.length;
-    int end = RangeError.checkValidRange(start, endOrNull, len);
-    if (start > 0 || end < len) {
-      list = list.sublist(start, end);
-    }
-    return Primitives.stringFromCharCodes(list);
-  }
-
-  static String _stringFromUint8List(
-      NativeUint8List charCodes, int start, int? endOrNull) {
-    int len = charCodes.length;
-    int end = RangeError.checkValidRange(start, endOrNull, len);
-    return Primitives.stringFromNativeUint8List(charCodes, start, end);
-  }
-
-  static String _stringFromIterable(
-      Iterable<int> charCodes, int start, int? end) {
-    if (start < 0) throw RangeError.range(start, 0, charCodes.length);
-    if (end != null && end < start) {
-      throw RangeError.range(end, start, charCodes.length);
-    }
-    var it = charCodes.iterator;
-    for (int i = 0; i < start; i++) {
-      if (!it.moveNext()) {
-        throw RangeError.range(start, 0, i);
-      }
-    }
-    var list = JSArray<int>.of(JS('', 'new Array()'));
-    if (end == null) {
-      while (it.moveNext()) list.add(it.current);
-    } else {
-      for (int i = start; i < end; i++) {
-        if (!it.moveNext()) {
-          throw RangeError.range(end, start, i);
-        }
-        list.add(it.current);
-      }
-    }
-    return Primitives.stringFromCharCodes(list);
-  }
-
-  @JSExportName('is')
-  static bool _is_String(Object? o) {
-    return JS<bool>('!', 'typeof $o == "string"');
-  }
-
-  @JSExportName('as')
-  static Object? _as_String(Object? o) {
-    // Avoid extra function call to core.String.is() by manually inlining.
-    if (JS<bool>('!', 'typeof $o == "string"')) return o;
-    return dart.cast(o, dart.unwrapType(String));
-  }
-}
-
-@patch
-class bool {
-  @patch
-  factory bool.fromEnvironment(String name, {bool defaultValue = false}) {
-    // ignore: const_constructor_throws_exception
-    throw UnsupportedError(
-        'bool.fromEnvironment can only be used as a const constructor');
-  }
-
-  @patch
-  factory bool.hasEnvironment(String name) {
-    // ignore: const_constructor_throws_exception
-    throw UnsupportedError(
-        'bool.hasEnvironment can only be used as a const constructor');
-  }
-
-  @patch
-  int get hashCode => super.hashCode;
-
-  @JSExportName('is')
-  static bool _is_bool(Object? o) =>
-      JS<bool>('!', '$o === true || $o === false');
-
-  @JSExportName('as')
-  static Object? _as_bool(Object? o) {
-    // Avoid extra function call to core.bool.is() by manually inlining.
-    if (JS<bool>("!", '$o === true || $o === false')) return o;
-    return dart.cast(o, dart.unwrapType(bool));
-  }
-}
-
-@patch
-class RegExp {
-  @patch
-  factory RegExp(String source,
-          {bool multiLine = false,
-          bool caseSensitive = true,
-          bool unicode = false,
-          bool dotAll = false}) =>
-      JSSyntaxRegExp(source,
-          multiLine: multiLine,
-          caseSensitive: caseSensitive,
-          unicode: unicode,
-          dotAll: dotAll);
-
-  @patch
-  static String escape(String text) => quoteStringForRegExp(text);
-}
-
-// Patch for 'identical' function.
-@patch
-bool identical(Object? a, Object? b) {
-  return JS<bool>('!', '(# == null ? # == null : # === #)', a, b, a, b);
-}
-
-@patch
-class StringBuffer {
-  String _contents;
-
-  @patch
-  StringBuffer([Object content = ""]) : _contents = '$content';
-
-  @patch
-  int get length => _contents.length;
-
-  @patch
-  void write(Object? obj) {
-    _writeString('$obj');
-  }
-
-  @patch
-  void writeCharCode(int charCode) {
-    _writeString(String.fromCharCode(charCode));
-  }
-
-  @patch
-  void writeAll(Iterable<dynamic> objects, [String separator = ""]) {
-    _contents = _writeAll(_contents, objects, separator);
-  }
-
-  @patch
-  void writeln([Object? obj = ""]) {
-    _writeString('$obj\n');
-  }
-
-  @patch
-  void clear() {
-    _contents = "";
-  }
-
-  @patch
-  String toString() => Primitives.flattenString(_contents);
-
-  void _writeString(String str) {
-    _contents = Primitives.stringConcatUnchecked(_contents, str);
-  }
-
-  static String _writeAll(String string, Iterable objects, String separator) {
-    Iterator iterator = objects.iterator;
-    if (!iterator.moveNext()) return string;
-    if (separator.isEmpty) {
-      do {
-        string = _writeOne(string, iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      string = _writeOne(string, iterator.current);
-      while (iterator.moveNext()) {
-        string = _writeOne(string, separator);
-        string = _writeOne(string, iterator.current);
-      }
-    }
-    return string;
-  }
-
-  static String _writeOne(String string, Object? obj) {
-    return Primitives.stringConcatUnchecked(string, '$obj');
-  }
-}
-
-// TODO(jmesserly): kernel expects to find this in our SDK.
-class _CompileTimeError extends Error {
-  final String _errorMsg;
-  _CompileTimeError(this._errorMsg);
-  String toString() => _errorMsg;
-}
-
-@patch
-class NoSuchMethodError {
-  final Object? _receiver;
-  final Symbol _memberName;
-  final List? _arguments;
-  final Map<Symbol, dynamic>? _namedArguments;
-  final Invocation? _invocation;
-
-  @patch
-  NoSuchMethodError(Object? receiver, Symbol memberName,
-      List? positionalArguments, Map<Symbol, dynamic>? namedArguments)
-      : _receiver = receiver,
-        _memberName = memberName,
-        _arguments = positionalArguments,
-        _namedArguments = namedArguments,
-        _invocation = null;
-
-  @patch
-  NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation)
-      : _receiver = receiver,
-        _memberName = invocation.memberName,
-        _arguments = invocation.positionalArguments,
-        _namedArguments = invocation.namedArguments,
-        _invocation = invocation;
-
-  @patch
-  String toString() {
-    StringBuffer sb = StringBuffer('');
-    String comma = '';
-    var arguments = _arguments;
-    if (arguments != null) {
-      for (var argument in arguments) {
-        sb.write(comma);
-        sb.write(Error.safeToString(argument));
-        comma = ', ';
-      }
-    }
-    var namedArguments = _namedArguments;
-    if (namedArguments != null) {
-      namedArguments.forEach((Symbol key, var value) {
-        sb.write(comma);
-        sb.write(_symbolToString(key));
-        sb.write(": ");
-        sb.write(Error.safeToString(value));
-        comma = ', ';
-      });
-    }
-    String memberName = _symbolToString(_memberName);
-    String receiverText = Error.safeToString(_receiver);
-    String actualParameters = '$sb';
-    var invocation = _invocation;
-    var failureMessage = (invocation is dart.InvocationImpl)
-        ? invocation.failureMessage
-        : 'method not found';
-    return "NoSuchMethodError: '$memberName'\n"
-        "$failureMessage\n"
-        "Receiver: ${receiverText}\n"
-        "Arguments: [$actualParameters]";
-  }
-}
-
-@patch
-class Uri {
-  @patch
-  static Uri get base {
-    String uri = Primitives.currentUri();
-    if (uri != null) return Uri.parse(uri);
-    throw UnsupportedError("'Uri.base' is not supported");
-  }
-}
-
-@patch
-class _Uri {
-  @patch
-  static bool get _isWindows => _isWindowsCached;
-
-  static final bool _isWindowsCached = JS(
-      'bool',
-      'typeof process != "undefined" && '
-          'Object.prototype.toString.call(process) == "[object process]" && '
-          'process.platform == "win32"');
-
-  // Matches a String that _uriEncodes to itself regardless of the kind of
-  // component.  This corresponds to [_unreservedTable], i.e. characters that
-  // are not encoded by any encoding table.
-  static final RegExp _needsNoEncoding = RegExp(r'^[\-\.0-9A-Z_a-z~]*$');
-
-  /**
-   * This is the internal implementation of JavaScript's encodeURI function.
-   * It encodes all characters in the string [text] except for those
-   * that appear in [canonicalTable], and returns the escaped string.
-   */
-  @patch
-  static String _uriEncode(List<int> canonicalTable, String text,
-      Encoding encoding, bool spaceToPlus) {
-    if (identical(encoding, utf8) && _needsNoEncoding.hasMatch(text)) {
-      return text;
-    }
-
-    // Encode the string into bytes then generate an ASCII only string
-    // by percent encoding selected bytes.
-    StringBuffer result = StringBuffer('');
-    var bytes = encoding.encode(text);
-    for (int i = 0; i < bytes.length; i++) {
-      int byte = bytes[i];
-      if (byte < 128 &&
-          ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
-        result.writeCharCode(byte);
-      } else if (spaceToPlus && byte == _SPACE) {
-        result.write('+');
-      } else {
-        const String hexDigits = '0123456789ABCDEF';
-        result.write('%');
-        result.write(hexDigits[(byte >> 4) & 0x0f]);
-        result.write(hexDigits[byte & 0x0f]);
-      }
-    }
-    return result.toString();
-  }
-}
-
-@patch
-class StackTrace {
-  @patch
-  @NoInline()
-  static StackTrace get current {
-    return dart.stackTrace(JS('', 'Error()'));
-  }
-}
-
-// TODO(jmesserly): this class is supposed to be obsolete in Strong Mode, but
-// the front-end crashes without it
-class _DuplicatedFieldInitializerError {
-  final String _name;
-
-  _DuplicatedFieldInitializerError(this._name);
-
-  toString() => "Error: field '$_name' is already initialized.";
-}
-
-// TODO(jmesserly): The rest of this core_patch.dart source should reside in an
-// included part file instead of being inlined. However, part files are not
-// properly supported here.
-
-// Copyright (c) 2017, 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.
-
-// part of dart.core;
-
-int _max(int a, int b) => a > b ? a : b;
-int _min(int a, int b) => a < b ? a : b;
-
-/// Empty list used as an initializer for local variables in the `_BigIntImpl`.
-final _dummyList = new Uint16List(0);
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
- * Copyright (c) 2003-2005  Tom Wu
- * Copyright (c) 2012 Adam Singer (adam@solvr.io)
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
- * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * In addition, the following condition applies:
- *
- * All redistributions must retain an intact copy of this copyright notice
- * and disclaimer.
- */
-
-/**
- * An implementation for the arbitrarily large integer.
- *
- * The integer number is represented by a sign, an array of 16-bit unsigned
- * integers in little endian format, and a number of used digits in that array.
- */
-class _BigIntImpl implements BigInt {
-  // Bits per digit.
-  static const int _digitBits = 16;
-  static const int _digitBase = 1 << _digitBits;
-  static const int _digitMask = (1 << _digitBits) - 1;
-
-  static final _BigIntImpl zero = _BigIntImpl._fromInt(0);
-  static final _BigIntImpl one = _BigIntImpl._fromInt(1);
-  static final _BigIntImpl two = _BigIntImpl._fromInt(2);
-
-  static final _BigIntImpl _minusOne = -one;
-  static final _BigIntImpl _bigInt10000 = _BigIntImpl._fromInt(10000);
-
-  // Result cache for last _divRem call.
-  // Result cache for last _divRem call.
-  static Uint16List? _lastDividendDigits;
-  static int? _lastDividendUsed;
-  static Uint16List? _lastDivisorDigits;
-  static int? _lastDivisorUsed;
-  static Uint16List? _lastQuoRemDigits;
-  static int? _lastQuoRemUsed;
-  static int? _lastRemUsed;
-  static int? _lastRem_nsh;
-
-  /// Whether this bigint is negative.
-  final bool _isNegative;
-
-  /// The unsigned digits of this bigint.
-  ///
-  /// The least significant digit is in slot 0.
-  /// The list may have more digits than needed. That is, `_digits.length` may
-  /// be strictly greater than `_used`.
-  final Uint16List _digits;
-
-  /// The number of used entries in [_digits].
-  ///
-  /// To avoid reallocating [Uint16List]s, lists that are too big are not
-  /// replaced.
-  final int _used;
-
-  /**
-   * Parses [source] as a, possibly signed, integer literal and returns its
-   * value.
-   *
-   * The [source] must be a non-empty sequence of base-[radix] digits,
-   * optionally prefixed with a minus or plus sign ('-' or '+').
-   *
-   * The [radix] must be in the range 2..36. The digits used are
-   * first the decimal digits 0..9, and then the letters 'a'..'z' with
-   * values 10 through 35. Also accepts upper-case letters with the same
-   * values as the lower-case ones.
-   *
-   * If no [radix] is given then it defaults to 10. In this case, the [source]
-   * digits may also start with `0x`, in which case the number is interpreted
-   * as a hexadecimal literal, which effectively means that the `0x` is ignored
-   * and the radix is instead set to 16.
-   *
-   * For any int `n` and radix `r`, it is guaranteed that
-   * `n == int.parse(n.toRadixString(r), radix: r)`.
-   *
-   * Throws a [FormatException] if the [source] is not a valid integer literal,
-   * optionally prefixed by a sign.
-   */
-  static _BigIntImpl parse(String source, {int? radix}) {
-    var result = _tryParse(source, radix: radix);
-    if (result == null) {
-      throw FormatException("Could not parse BigInt", source);
-    }
-    return result;
-  }
-
-  /// Parses a decimal bigint literal.
-  ///
-  /// The [source] must not contain leading or trailing whitespace.
-  static _BigIntImpl _parseDecimal(String source, bool isNegative) {
-    const _0 = 48;
-
-    int part = 0;
-    _BigIntImpl result = zero;
-    // Read in the source 4 digits at a time.
-    // The first part may have a few leading virtual '0's to make the remaining
-    // parts all have exactly 4 digits.
-    var digitInPartCount = 4 - source.length.remainder(4);
-    if (digitInPartCount == 4) digitInPartCount = 0;
-    for (int i = 0; i < source.length; i++) {
-      part = part * 10 + source.codeUnitAt(i) - _0;
-      if (++digitInPartCount == 4) {
-        result = result * _bigInt10000 + _BigIntImpl._fromInt(part);
-        part = 0;
-        digitInPartCount = 0;
-      }
-    }
-    if (isNegative) return -result;
-    return result;
-  }
-
-  /// Returns the value of a given source digit.
-  ///
-  /// Source digits between "0" and "9" (inclusive) return their decimal value.
-  ///
-  /// Source digits between "a" and "z", or "A" and "Z" (inclusive) return
-  /// 10 + their position in the ASCII alphabet.
-  ///
-  /// The incoming [codeUnit] must be an ASCII code-unit.
-  static int _codeUnitToRadixValue(int codeUnit) {
-    // We know that the characters must be ASCII as otherwise the
-    // regexp wouldn't have matched. Lowercasing by doing `| 0x20` is thus
-    // guaranteed to be a safe operation, since it preserves digits
-    // and lower-cases ASCII letters.
-    const int _0 = 48;
-    const int _9 = 57;
-    const int _a = 97;
-    if (_0 <= codeUnit && codeUnit <= _9) return codeUnit - _0;
-    codeUnit |= 0x20;
-    var result = codeUnit - _a + 10;
-    return result;
-  }
-
-  /// Parses the given [source] string, starting at [startPos], as a hex
-  /// literal.
-  ///
-  /// If [isNegative] is true, negates the result before returning it.
-  ///
-  /// The [source] (substring) must be a valid hex literal.
-  static _BigIntImpl? _parseHex(String source, int startPos, bool isNegative) {
-    int hexDigitsPerChunk = _digitBits ~/ 4;
-    int sourceLength = source.length - startPos;
-    int chunkCount = (sourceLength / hexDigitsPerChunk).ceil();
-    var digits = Uint16List(chunkCount);
-
-    int lastDigitLength = sourceLength - (chunkCount - 1) * hexDigitsPerChunk;
-    int digitIndex = digits.length - 1;
-    int i = startPos;
-    int chunk = 0;
-    for (int j = 0; j < lastDigitLength; j++) {
-      var digitValue = _codeUnitToRadixValue(source.codeUnitAt(i++));
-      if (digitValue >= 16) return null;
-      chunk = chunk * 16 + digitValue;
-    }
-    digits[digitIndex--] = chunk;
-
-    while (i < source.length) {
-      chunk = 0;
-      for (int j = 0; j < hexDigitsPerChunk; j++) {
-        var digitValue = _codeUnitToRadixValue(source.codeUnitAt(i++));
-        if (digitValue >= 16) return null;
-        chunk = chunk * 16 + digitValue;
-      }
-      digits[digitIndex--] = chunk;
-    }
-    if (digits.length == 1 && digits[0] == 0) return zero;
-    return _BigIntImpl._(isNegative, digits.length, digits);
-  }
-
-  /// Parses the given [source] as a [radix] literal.
-  ///
-  /// The [source] will be checked for invalid characters. If it is invalid,
-  /// this function returns `null`.
-  static _BigIntImpl? _parseRadix(String source, int radix, bool isNegative) {
-    var result = zero;
-    var base = _BigIntImpl._fromInt(radix);
-    for (int i = 0; i < source.length; i++) {
-      var digitValue = _codeUnitToRadixValue(source.codeUnitAt(i));
-      if (digitValue >= radix) return null;
-      result = result * base + _BigIntImpl._fromInt(digitValue);
-    }
-    if (isNegative) return -result;
-    return result;
-  }
-
-  /// Tries to parse the given [source] as a [radix] literal.
-  ///
-  /// Returns the parsed big integer, or `null` if it failed.
-  ///
-  /// If the [radix] is `null` accepts decimal literals or `0x` hex literals.
-  static _BigIntImpl? _tryParse(String source, {int? radix}) {
-    if (source == "") return null;
-
-    var match = _parseRE.firstMatch(source);
-    int signIndex = 1;
-    int hexIndex = 3;
-    int decimalIndex = 4;
-    int nonDecimalHexIndex = 5;
-    if (match == null) return null;
-
-    bool isNegative = match[signIndex] == "-";
-
-    String? decimalMatch = match[decimalIndex];
-    String? hexMatch = match[hexIndex];
-    String? nonDecimalMatch = match[nonDecimalHexIndex];
-
-    if (radix == null) {
-      if (decimalMatch != null) {
-        // Cannot fail because we know that the digits are all decimal.
-        return _parseDecimal(decimalMatch, isNegative);
-      }
-      if (hexMatch != null) {
-        // Cannot fail because we know that the digits are all hex.
-        return _parseHex(hexMatch, 2, isNegative);
-      }
-      return null;
-    }
-
-    if (radix < 2 || radix > 36) {
-      throw RangeError.range(radix, 2, 36, 'radix');
-    }
-    if (radix == 10 && decimalMatch != null) {
-      return _parseDecimal(decimalMatch, isNegative);
-    }
-    if (radix == 16 && (decimalMatch != null || nonDecimalMatch != null)) {
-      return _parseHex(decimalMatch ?? nonDecimalMatch!, 0, isNegative);
-    }
-
-    return _parseRadix(
-        decimalMatch ?? nonDecimalMatch ?? hexMatch!, radix, isNegative);
-  }
-
-  static RegExp _parseRE = RegExp(
-      r'^\s*([+-]?)((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$',
-      caseSensitive: false);
-
-  /// Finds the amount significant digits in the provided [digits] array.
-  static int _normalize(int used, Uint16List digits) {
-    while (used > 0 && digits[used - 1] == 0) used--;
-    return used;
-  }
-
-  /// Factory returning an instance initialized with the given field values.
-  /// If the [digits] array contains leading 0s, the [used] value is adjusted
-  /// accordingly. The [digits] array is not modified.
-  _BigIntImpl._(bool isNegative, int used, Uint16List digits)
-      : this._normalized(isNegative, _normalize(used, digits), digits);
-
-  _BigIntImpl._normalized(bool isNegative, this._used, this._digits)
-      : _isNegative = _used == 0 ? false : isNegative;
-
-  /// Whether this big integer is zero.
-  bool get _isZero => _used == 0;
-
-  /// Allocates an array of the given [length] and copies the [digits] in the
-  /// range [from] to [to-1], starting at index 0, followed by leading zero
-  /// digits.
-  static Uint16List _cloneDigits(
-      Uint16List digits, int from, int to, int length) {
-    var resultDigits = Uint16List(length);
-    var n = to - from;
-    for (var i = 0; i < n; i++) {
-      resultDigits[i] = digits[from + i];
-    }
-    return resultDigits;
-  }
-
-  /// Allocates a big integer from the provided [value] number.
-  factory _BigIntImpl.from(num value) {
-    if (value == 0) return zero;
-    if (value == 1) return one;
-    if (value == 2) return two;
-
-    // Given this order dart2js will use the `_fromInt` for smaller value and
-    // then use the bit-manipulating `_fromDouble` for all other values.
-    if (value.abs() < 0x100000000) return _BigIntImpl._fromInt(value.toInt());
-    if (value is double) return _BigIntImpl._fromDouble(value);
-    return _BigIntImpl._fromInt(value as int);
-  }
-
-  factory _BigIntImpl._fromInt(int value) {
-    bool isNegative = value < 0;
-    assert(_digitBits == 16);
-    if (isNegative) {
-      // Handle the min 64-bit value differently, since its negation is not
-      // positive.
-      const int minInt64 = -0x80000000 * 0x100000000;
-      if (value == minInt64) {
-        var digits = Uint16List(4);
-        digits[3] = 0x8000;
-        return _BigIntImpl._(true, 4, digits);
-      }
-      value = -value;
-    }
-    if (value < _digitBase) {
-      var digits = Uint16List(1);
-      digits[0] = value;
-      return _BigIntImpl._(isNegative, 1, digits);
-    }
-    if (value <= 0xFFFFFFFF) {
-      var digits = Uint16List(2);
-      digits[0] = value & _digitMask;
-      digits[1] = value >> _digitBits;
-      return _BigIntImpl._(isNegative, 2, digits);
-    }
-
-    var bits = value.bitLength;
-    var digits = Uint16List((bits - 1) ~/ _digitBits + 1);
-    var i = 0;
-    while (value != 0) {
-      digits[i++] = value & _digitMask;
-      value = value ~/ _digitBase;
-    }
-    return _BigIntImpl._(isNegative, digits.length, digits);
-  }
-
-  /// An 8-byte Uint8List we can reuse for [_fromDouble] to avoid generating
-  /// garbage.
-  static final Uint8List _bitsForFromDouble = Uint8List(8);
-
-  factory _BigIntImpl._fromDouble(double value) {
-    const int exponentBias = 1075;
-
-    if (value.isNaN || value.isInfinite) {
-      throw ArgumentError("Value must be finite: $value");
-    }
-    bool isNegative = value < 0;
-    if (isNegative) value = -value;
-
-    value = value.floorToDouble();
-    if (value == 0) return zero;
-
-    var bits = _bitsForFromDouble;
-    for (int i = 0; i < 8; i++) {
-      bits[i] = 0;
-    }
-    bits.buffer.asByteData().setFloat64(0, value, Endian.little);
-    // The exponent is in bits 53..63.
-    var biasedExponent = (bits[7] << 4) + (bits[6] >> 4);
-    var exponent = biasedExponent - exponentBias;
-
-    assert(_digitBits == 16);
-    // The significant bits are in 0 .. 52.
-    var unshiftedDigits = Uint16List(4);
-    unshiftedDigits[0] = (bits[1] << 8) + bits[0];
-    unshiftedDigits[1] = (bits[3] << 8) + bits[2];
-    unshiftedDigits[2] = (bits[5] << 8) + bits[4];
-    // Don't forget to add the hidden bit.
-    unshiftedDigits[3] = 0x10 | (bits[6] & 0xF);
-
-    var unshiftedBig = _BigIntImpl._normalized(false, 4, unshiftedDigits);
-    _BigIntImpl absResult = unshiftedBig;
-    if (exponent < 0) {
-      absResult = unshiftedBig >> -exponent;
-    } else if (exponent > 0) {
-      absResult = unshiftedBig << exponent;
-    }
-    if (isNegative) return -absResult;
-    return absResult;
-  }
-
-  /**
-   * Return the negative value of this integer.
-   *
-   * The result of negating an integer always has the opposite sign, except
-   * for zero, which is its own negation.
-   */
-  _BigIntImpl operator -() {
-    if (_used == 0) return this;
-    return _BigIntImpl._(!_isNegative, _used, _digits);
-  }
-
-  /**
-   * Returns the absolute value of this integer.
-   *
-   * For any integer `x`, the result is the same as `x < 0 ? -x : x`.
-   */
-  _BigIntImpl abs() => _isNegative ? -this : this;
-
-  /// Returns this << n *_DIGIT_BITS.
-  _BigIntImpl _dlShift(int n) {
-    final used = _used;
-    if (used == 0) {
-      return zero;
-    }
-    final resultUsed = used + n;
-    final digits = _digits;
-    final resultDigits = Uint16List(resultUsed);
-    for (int i = used - 1; i >= 0; i--) {
-      resultDigits[i + n] = digits[i];
-    }
-    return _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-  }
-
-  /// Same as [_dlShift] but works on the decomposed big integers.
-  ///
-  /// Returns `resultUsed`.
-  ///
-  /// `resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] << n*_DIGIT_BITS`.
-  static int _dlShiftDigits(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    if (xUsed == 0) {
-      return 0;
-    }
-    if (n == 0 && identical(resultDigits, xDigits)) {
-      return xUsed;
-    }
-    final resultUsed = xUsed + n;
-    for (int i = xUsed - 1; i >= 0; i--) {
-      resultDigits[i + n] = xDigits[i];
-    }
-    for (int i = n - 1; i >= 0; i--) {
-      resultDigits[i] = 0;
-    }
-    return resultUsed;
-  }
-
-  /// Returns `this >> n*_DIGIT_BITS`.
-  _BigIntImpl _drShift(int n) {
-    final used = _used;
-    if (used == 0) {
-      return zero;
-    }
-    final resultUsed = used - n;
-    if (resultUsed <= 0) {
-      return _isNegative ? _minusOne : zero;
-    }
-    final digits = _digits;
-    final resultDigits = Uint16List(resultUsed);
-    for (var i = n; i < used; i++) {
-      resultDigits[i - n] = digits[i];
-    }
-    final result = _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-    if (_isNegative) {
-      // Round down if any bit was shifted out.
-      for (var i = 0; i < n; i++) {
-        if (digits[i] != 0) {
-          return result - one;
-        }
-      }
-    }
-    return result;
-  }
-
-  /// Shifts the digits of [xDigits] into the right place in [resultDigits].
-  ///
-  /// `resultDigits[ds..xUsed+ds] = xDigits[0..xUsed-1] << (n % _DIGIT_BITS)`
-  ///   where `ds = n ~/ _DIGIT_BITS`
-  ///
-  /// Does *not* clear digits below ds.
-  static void _lsh(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    assert(xUsed > 0);
-    final digitShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    final carryBitShift = _digitBits - bitShift;
-    final bitMask = (1 << carryBitShift) - 1;
-    var carry = 0;
-    for (int i = xUsed - 1; i >= 0; i--) {
-      final digit = xDigits[i];
-      resultDigits[i + digitShift + 1] = (digit >> carryBitShift) | carry;
-      carry = (digit & bitMask) << bitShift;
-    }
-    resultDigits[digitShift] = carry;
-  }
-
-  /**
-   * Shift the bits of this integer to the left by [shiftAmount].
-   *
-   * Shifting to the left makes the number larger, effectively multiplying
-   * the number by `pow(2, shiftIndex)`.
-   *
-   * There is no limit on the size of the result. It may be relevant to
-   * limit intermediate values by using the "and" operator with a suitable
-   * mask.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  _BigIntImpl operator <<(int shiftAmount) {
-    if (shiftAmount < 0) {
-      throw ArgumentError("shift-amount must be posititve $shiftAmount");
-    }
-    if (_isZero) return this;
-    final digitShift = shiftAmount ~/ _digitBits;
-    final bitShift = shiftAmount % _digitBits;
-    if (bitShift == 0) {
-      return _dlShift(digitShift);
-    }
-    var resultUsed = _used + digitShift + 1;
-    var resultDigits = Uint16List(resultUsed);
-    _lsh(_digits, _used, shiftAmount, resultDigits);
-    return _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-  }
-
-  // resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] << n.
-  // Returns resultUsed.
-  static int _lShiftDigits(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    final digitsShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    if (bitShift == 0) {
-      return _dlShiftDigits(xDigits, xUsed, digitsShift, resultDigits);
-    }
-    var resultUsed = xUsed + digitsShift + 1;
-    _lsh(xDigits, xUsed, n, resultDigits);
-    var i = digitsShift;
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    if (resultDigits[resultUsed - 1] == 0) {
-      resultUsed--; // Clamp result.
-    }
-    return resultUsed;
-  }
-
-  // resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] >> n.
-  static void _rsh(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    assert(xUsed > 0);
-    final digitsShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    final carryBitShift = _digitBits - bitShift;
-    final bitMask = (1 << bitShift) - 1;
-    var carry = xDigits[digitsShift] >> bitShift;
-    final last = xUsed - digitsShift - 1;
-    for (var i = 0; i < last; i++) {
-      final digit = xDigits[i + digitsShift + 1];
-      resultDigits[i] = ((digit & bitMask) << carryBitShift) | carry;
-      carry = digit >> bitShift;
-    }
-    resultDigits[last] = carry;
-  }
-
-  /**
-   * Shift the bits of this integer to the right by [shiftAmount].
-   *
-   * Shifting to the right makes the number smaller and drops the least
-   * significant bits, effectively doing an integer division by
-   *`pow(2, shiftIndex)`.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  _BigIntImpl operator >>(int shiftAmount) {
-    if (shiftAmount < 0) {
-      throw ArgumentError("shift-amount must be posititve $shiftAmount");
-    }
-    if (_isZero) return this;
-    final digitShift = shiftAmount ~/ _digitBits;
-    final bitShift = shiftAmount % _digitBits;
-    if (bitShift == 0) {
-      return _drShift(digitShift);
-    }
-    final used = _used;
-    final resultUsed = used - digitShift;
-    if (resultUsed <= 0) {
-      return _isNegative ? _minusOne : zero;
-    }
-    final digits = _digits;
-    final resultDigits = Uint16List(resultUsed);
-    _rsh(digits, used, shiftAmount, resultDigits);
-    final result = _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-    if (_isNegative) {
-      // Round down if any bit was shifted out.
-      if ((digits[digitShift] & ((1 << bitShift) - 1)) != 0) {
-        return result - one;
-      }
-      for (var i = 0; i < digitShift; i++) {
-        if (digits[i] != 0) {
-          return result - one;
-        }
-      }
-    }
-    return result;
-  }
-
-  /// Compares this to [other] taking the absolute value of both operands.
-  ///
-  /// Returns 0 if abs(this) == abs(other); a positive number if
-  /// abs(this) > abs(other); and a negative number if abs(this) < abs(other).
-  int _absCompare(_BigIntImpl other) {
-    return _compareDigits(_digits, _used, other._digits, other._used);
-  }
-
-  /**
-   * Compares this to `other`.
-   *
-   * Returns a negative number if `this` is less than `other`, zero if they are
-   * equal, and a positive number if `this` is greater than `other`.
-   */
-  int compareTo(covariant _BigIntImpl other) {
-    if (_isNegative == other._isNegative) {
-      var result = _absCompare(other);
-      // Use 0 - result to avoid negative zero in JavaScript.
-      return _isNegative ? 0 - result : result;
-    }
-    return _isNegative ? -1 : 1;
-  }
-
-  /// Compares `digits[0..used-1]` with `otherDigits[0..otherUsed-1]`.
-  ///
-  /// Returns 0 if equal; a positive number if larger;
-  /// and a negative number if smaller.
-  static int _compareDigits(
-      Uint16List digits, int used, Uint16List otherDigits, int otherUsed) {
-    var result = used - otherUsed;
-    if (result == 0) {
-      for (int i = used - 1; i >= 0; i--) {
-        result = digits[i] - otherDigits[i];
-        if (result != 0) return result;
-      }
-    }
-    return result;
-  }
-
-  // resultDigits[0..used] = digits[0..used-1] + otherDigits[0..otherUsed-1].
-  // used >= otherUsed > 0.
-  static void _absAdd(Uint16List digits, int used, Uint16List otherDigits,
-      int otherUsed, Uint16List resultDigits) {
-    assert(used >= otherUsed && otherUsed > 0);
-    var carry = 0;
-    for (var i = 0; i < otherUsed; i++) {
-      carry += digits[i] + otherDigits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    for (var i = otherUsed; i < used; i++) {
-      carry += digits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    resultDigits[used] = carry;
-  }
-
-  // resultDigits[0..used-1] = digits[0..used-1] - otherDigits[0..otherUsed-1].
-  // used >= otherUsed > 0.
-  static void _absSub(Uint16List digits, int used, Uint16List otherDigits,
-      int otherUsed, Uint16List resultDigits) {
-    assert(used >= otherUsed && otherUsed > 0);
-
-    var carry = 0;
-    for (var i = 0; i < otherUsed; i++) {
-      carry += digits[i] - otherDigits[i];
-      resultDigits[i] = carry & _digitMask;
-      // Dart2js only supports unsigned shifts.
-      // Since the carry can only be -1 or 0 use this hack.
-      carry = 0 - ((carry >> _digitBits) & 1);
-    }
-    for (var i = otherUsed; i < used; i++) {
-      carry += digits[i];
-      resultDigits[i] = carry & _digitMask;
-      // Dart2js only supports unsigned shifts.
-      // Since the carry can only be -1 or 0 use this hack.
-      carry = 0 - ((carry >> _digitBits) & 1);
-    }
-  }
-
-  /// Returns `abs(this) + abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAddSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    if (used < otherUsed) {
-      return other._absAddSetSign(this, isNegative);
-    }
-    if (used == 0) {
-      assert(!isNegative);
-      return zero;
-    }
-    if (otherUsed == 0) {
-      return _isNegative == isNegative ? this : -this;
-    }
-    var resultUsed = used + 1;
-    var resultDigits = Uint16List(resultUsed);
-    _absAdd(_digits, used, other._digits, otherUsed, resultDigits);
-    return _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) - abs(other)` with sign set according to [isNegative].
-  ///
-  /// Requirement: `abs(this) >= abs(other)`.
-  _BigIntImpl _absSubSetSign(_BigIntImpl other, bool isNegative) {
-    assert(_absCompare(other) >= 0);
-    var used = _used;
-    if (used == 0) {
-      assert(!isNegative);
-      return zero;
-    }
-    var otherUsed = other._used;
-    if (otherUsed == 0) {
-      return _isNegative == isNegative ? this : -this;
-    }
-    var resultDigits = Uint16List(used);
-    _absSub(_digits, used, other._digits, otherUsed, resultDigits);
-    return _BigIntImpl._(isNegative, used, resultDigits);
-  }
-
-  /// Returns `abs(this) & abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAndSetSign(_BigIntImpl other, bool isNegative) {
-    var resultUsed = _min(_used, other._used);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = Uint16List(resultUsed);
-    for (var i = 0; i < resultUsed; i++) {
-      resultDigits[i] = digits[i] & otherDigits[i];
-    }
-    return _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) &~ abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAndNotSetSign(_BigIntImpl other, bool isNegative) {
-    var resultUsed = _used;
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = Uint16List(resultUsed);
-    var m = _min(resultUsed, other._used);
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] & ~otherDigits[i];
-    }
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = digits[i];
-    }
-    return _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) | abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absOrSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    var resultUsed = _max(used, otherUsed);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = Uint16List(resultUsed);
-    _BigIntImpl l;
-    int m;
-    if (used < otherUsed) {
-      l = other;
-      m = used;
-    } else {
-      l = this;
-      m = otherUsed;
-    }
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] | otherDigits[i];
-    }
-    var lDigits = l._digits;
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = lDigits[i];
-    }
-    return _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) ^ abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absXorSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    var resultUsed = _max(used, otherUsed);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = Uint16List(resultUsed);
-    _BigIntImpl l;
-    int m;
-    if (used < otherUsed) {
-      l = other;
-      m = used;
-    } else {
-      l = this;
-      m = otherUsed;
-    }
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] ^ otherDigits[i];
-    }
-    var lDigits = l._digits;
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = lDigits[i];
-    }
-    return _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /**
-   * Bit-wise and operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with only the bits set that are set in
-   * both `this` and [other]
-   *
-   * Of both operands are negative, the result is negative, otherwise
-   * the result is non-negative.
-   */
-  _BigIntImpl operator &(covariant _BigIntImpl other) {
-    if (_isZero || other._isZero) return zero;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) & (-other) == ~(this-1) & ~(other-1)
-        //                    == ~((this-1) | (other-1))
-        //                    == -(((this-1) | (other-1)) + 1)
-        _BigIntImpl this1 = _absSubSetSign(one, true);
-        _BigIntImpl other1 = other._absSubSetSign(one, true);
-        // Result cannot be zero if this and other are negative.
-        return this1._absOrSetSign(other1, true)._absAddSetSign(one, true);
-      }
-      return _absAndSetSign(other, false);
-    }
-    // _isNegative != other._isNegative
-    _BigIntImpl p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // & is symmetric.
-      p = this;
-      n = other;
-    }
-    // p & (-n) == p & ~(n-1) == p &~ (n-1)
-    var n1 = n._absSubSetSign(one, false);
-    return p._absAndNotSetSign(n1, false);
-  }
-
-  /**
-   * Bit-wise or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in either
-   * of `this` and [other]
-   *
-   * If both operands are non-negative, the result is non-negative,
-   * otherwise the result us negative.
-   */
-  _BigIntImpl operator |(covariant _BigIntImpl other) {
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) | (-other) == ~(this-1) | ~(other-1)
-        //                    == ~((this-1) & (other-1))
-        //                    == -(((this-1) & (other-1)) + 1)
-        var this1 = _absSubSetSign(one, true);
-        var other1 = other._absSubSetSign(one, true);
-        // Result cannot be zero if this and a are negative.
-        return this1._absAndSetSign(other1, true)._absAddSetSign(one, true);
-      }
-      return _absOrSetSign(other, false);
-    }
-    // _neg != a._neg
-    _BigIntImpl p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // | is symmetric.
-      p = this;
-      n = other;
-    }
-    // p | (-n) == p | ~(n-1) == ~((n-1) &~ p) == -(~((n-1) &~ p) + 1)
-    var n1 = n._absSubSetSign(one, true);
-    // Result cannot be zero if only one of this or a is negative.
-    return n1._absAndNotSetSign(p, true)._absAddSetSign(one, true);
-  }
-
-  /**
-   * Bit-wise exclusive-or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in one,
-   * but not both, of `this` and [other]
-   *
-   * If the operands have the same sign, the result is non-negative,
-   * otherwise the result is negative.
-   */
-  _BigIntImpl operator ^(covariant _BigIntImpl other) {
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) ^ (-other) == ~(this-1) ^ ~(other-1) == (this-1) ^ (other-1)
-        var this1 = _absSubSetSign(one, true);
-        var other1 = other._absSubSetSign(one, true);
-        return this1._absXorSetSign(other1, false);
-      }
-      return _absXorSetSign(other, false);
-    }
-    // _isNegative != a._isNegative
-    _BigIntImpl p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // ^ is symmetric.
-      p = this;
-      n = other;
-    }
-    // p ^ (-n) == p ^ ~(n-1) == ~(p ^ (n-1)) == -((p ^ (n-1)) + 1)
-    var n1 = n._absSubSetSign(one, true);
-    // Result cannot be zero if only one of this or a is negative.
-    return p._absXorSetSign(n1, true)._absAddSetSign(one, true);
-  }
-
-  /**
-   * The bit-wise negate operator.
-   *
-   * Treating `this` as a sufficiently large two's component integer,
-   * the result is a number with the opposite bits set.
-   *
-   * This maps any integer `x` to `-x - 1`.
-   */
-  _BigIntImpl operator ~() {
-    if (_isZero) return _minusOne;
-    if (_isNegative) {
-      // ~(-this) == ~(~(this-1)) == this-1
-      return _absSubSetSign(one, false);
-    }
-    // ~this == -this-1 == -(this+1)
-    // Result cannot be zero if this is positive.
-    return _absAddSetSign(one, true);
-  }
-
-  /// Addition operator.
-  _BigIntImpl operator +(covariant _BigIntImpl other) {
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    var isNegative = _isNegative;
-    if (isNegative == other._isNegative) {
-      // this + other == this + other
-      // (-this) + (-other) == -(this + other)
-      return _absAddSetSign(other, isNegative);
-    }
-    // this + (-other) == this - other == -(this - other)
-    // (-this) + other == other - this == -(this - other)
-    if (_absCompare(other) >= 0) {
-      return _absSubSetSign(other, isNegative);
-    }
-    return other._absSubSetSign(this, !isNegative);
-  }
-
-  /// Subtraction operator.
-  _BigIntImpl operator -(covariant _BigIntImpl other) {
-    if (_isZero) return -other;
-    if (other._isZero) return this;
-    var isNegative = _isNegative;
-    if (isNegative != other._isNegative) {
-      // this - (-other) == this + other
-      // (-this) - other == -(this + other)
-      return _absAddSetSign(other, isNegative);
-    }
-    // this - other == this - a == -(this - other)
-    // (-this) - (-other) == other - this == -(this - other)
-    if (_absCompare(other) >= 0) {
-      return _absSubSetSign(other, isNegative);
-    }
-    return other._absSubSetSign(this, !isNegative);
-  }
-
-  /// Multiplies [x] with [multiplicandDigits] and adds the result to
-  /// [accumulatorDigits].
-  ///
-  /// The [multiplicandDigits] in the range [i] to [i]+[n]-1 are the
-  /// multiplicand digits.
-  ///
-  /// The [acculumatorDigits] in the range [j] to [j]+[n]-1 are the accumulator
-  /// digits.
-  ///
-  /// Adds the result of the multiplicand-digits * [x] to the accumulator.
-  ///
-  /// Concretely: `accumulatorDigits[j..j+n] += x * m_digits[i..i+n-1]`.
-  static void _mulAdd(int x, Uint16List multiplicandDigits, int i,
-      Uint16List accumulatorDigits, int j, int n) {
-    if (x == 0) {
-      // No-op if x is 0.
-      return;
-    }
-    int c = 0;
-    while (--n >= 0) {
-      int product = x * multiplicandDigits[i++];
-      int combined = product + accumulatorDigits[j] + c;
-      accumulatorDigits[j++] = combined & _digitMask;
-      // Note that this works with 53 bits, as the division will not lose
-      // bits.
-      c = combined ~/ _digitBase;
-    }
-    while (c != 0) {
-      int l = accumulatorDigits[j] + c;
-      accumulatorDigits[j++] = l & _digitMask;
-      c = l ~/ _digitBase;
-    }
-  }
-
-  /// Multiplication operator.
-  _BigIntImpl operator *(covariant _BigIntImpl other) {
-    var used = _used;
-    var otherUsed = other._used;
-    if (used == 0 || otherUsed == 0) {
-      return zero;
-    }
-    var resultUsed = used + otherUsed;
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = Uint16List(resultUsed);
-    var i = 0;
-    while (i < otherUsed) {
-      _mulAdd(otherDigits[i], digits, 0, resultDigits, i, used);
-      i++;
-    }
-    return _BigIntImpl._(
-        _isNegative != other._isNegative, resultUsed, resultDigits);
-  }
-
-  // r_digits[0..rUsed-1] = xDigits[0..xUsed-1]*otherDigits[0..otherUsed-1].
-  // Return resultUsed = xUsed + otherUsed.
-  static int _mulDigits(Uint16List xDigits, int xUsed, Uint16List otherDigits,
-      int otherUsed, Uint16List resultDigits) {
-    var resultUsed = xUsed + otherUsed;
-    var i = resultUsed;
-    assert(resultDigits.length >= i);
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    i = 0;
-    while (i < otherUsed) {
-      _mulAdd(otherDigits[i], xDigits, 0, resultDigits, i, xUsed);
-      i++;
-    }
-    return resultUsed;
-  }
-
-  /// Returns an estimate of `digits[i-1..i] ~/ topDigitDivisor`.
-  static int _estimateQuotientDigit(
-      int topDigitDivisor, Uint16List digits, int i) {
-    if (digits[i] == topDigitDivisor) return _digitMask;
-    var quotientDigit =
-        (digits[i] << _digitBits | digits[i - 1]) ~/ topDigitDivisor;
-    if (quotientDigit > _digitMask) return _digitMask;
-    return quotientDigit;
-  }
-
-  /// Returns `trunc(this / other)`, with `other != 0`.
-  _BigIntImpl _div(_BigIntImpl other) {
-    assert(other._used > 0);
-    if (_used < other._used) {
-      return zero;
-    }
-    _divRem(other);
-    // Return quotient, i.e.
-    // _lastQuoRem_digits[_lastRem_used.._lastQuoRem_used-1] with proper sign.
-    var lastQuo_used = _lastQuoRemUsed! - _lastRemUsed!;
-    var quo_digits = _cloneDigits(
-        _lastQuoRemDigits!, _lastRemUsed!, _lastQuoRemUsed!, lastQuo_used);
-    var quo = _BigIntImpl._(false, lastQuo_used, quo_digits);
-    if ((_isNegative != other._isNegative) && (quo._used > 0)) {
-      quo = -quo;
-    }
-    return quo;
-  }
-
-  /// Returns `this - other * trunc(this / other)`, with `other != 0`.
-  _BigIntImpl _rem(_BigIntImpl other) {
-    assert(other._used > 0);
-    if (_used < other._used) {
-      return this;
-    }
-    _divRem(other);
-    // Return remainder, i.e.
-    // denormalized _lastQuoRem_digits[0.._lastRem_used-1] with proper sign.
-    var remDigits =
-        _cloneDigits(_lastQuoRemDigits!, 0, _lastRemUsed!, _lastRemUsed!);
-    var rem = _BigIntImpl._(false, _lastRemUsed!, remDigits);
-    if (_lastRem_nsh! > 0) {
-      rem = rem >> _lastRem_nsh!; // Denormalize remainder.
-    }
-    if (_isNegative && (rem._used > 0)) {
-      rem = -rem;
-    }
-    return rem;
-  }
-
-  /// Computes this ~/ other and this.remainder(other).
-  ///
-  /// Stores the result in [_lastQuoRemDigits], [_lastQuoRemUsed] and
-  /// [_lastRemUsed]. The [_lastQuoRemDigits] contains the digits of *both*, the
-  /// quotient and the remainder.
-  ///
-  /// Caches the input to avoid doing the work again when users write
-  /// `a ~/ b` followed by a `a % b`.
-  void _divRem(_BigIntImpl other) {
-    // Check if result is already cached.
-    if ((this._used == _lastDividendUsed) &&
-        (other._used == _lastDivisorUsed) &&
-        identical(this._digits, _lastDividendDigits) &&
-        identical(other._digits, _lastDivisorDigits)) {
-      return;
-    }
-    assert(_used >= other._used);
-
-    var nsh = _digitBits - other._digits[other._used - 1].bitLength;
-    // Concatenated positive quotient and normalized positive remainder.
-    // The resultDigits can have at most one more digit than the dividend.
-    Uint16List resultDigits;
-    int resultUsed;
-    // Normalized positive divisor.
-    // The normalized divisor has the most-significant bit of its most
-    // significant digit set.
-    // This makes estimating the quotient easier.
-    Uint16List yDigits;
-    int yUsed;
-    if (nsh > 0) {
-      yDigits = Uint16List(other._used + 5);
-      yUsed = _lShiftDigits(other._digits, other._used, nsh, yDigits);
-      resultDigits = Uint16List(_used + 5);
-      resultUsed = _lShiftDigits(_digits, _used, nsh, resultDigits);
-    } else {
-      yDigits = other._digits;
-      yUsed = other._used;
-      resultDigits = _cloneDigits(_digits, 0, _used, _used + 2);
-      resultUsed = _used;
-    }
-    var topDigitDivisor = yDigits[yUsed - 1];
-    var i = resultUsed;
-    var j = i - yUsed;
-    // tmpDigits is a temporary array of i (resultUsed) digits.
-    var tmpDigits = Uint16List(i);
-    var tmpUsed = _dlShiftDigits(yDigits, yUsed, j, tmpDigits);
-    // Explicit first division step in case normalized dividend is larger or
-    // equal to shifted normalized divisor.
-    if (_compareDigits(resultDigits, resultUsed, tmpDigits, tmpUsed) >= 0) {
-      assert(i == resultUsed);
-      resultDigits[resultUsed++] = 1; // Quotient = 1.
-      // Subtract divisor from remainder.
-      _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-    } else {
-      // Account for possible carry in _mulAdd step.
-      resultDigits[resultUsed++] = 0;
-    }
-
-    // Negate y so we can later use _mulAdd instead of non-existent _mulSub.
-    var nyDigits = Uint16List(yUsed + 2);
-    nyDigits[yUsed] = 1;
-    _absSub(nyDigits, yUsed + 1, yDigits, yUsed, nyDigits);
-    // nyDigits is read-only and has yUsed digits (possibly including several
-    // leading zeros).
-    // resultDigits is modified during iteration.
-    // resultDigits[0..yUsed-1] is the current remainder.
-    // resultDigits[yUsed..resultUsed-1] is the current quotient.
-    --i;
-
-    while (j > 0) {
-      var estimatedQuotientDigit =
-          _estimateQuotientDigit(topDigitDivisor, resultDigits, i);
-      j--;
-      _mulAdd(estimatedQuotientDigit, nyDigits, 0, resultDigits, j, yUsed);
-      if (resultDigits[i] < estimatedQuotientDigit) {
-        // Reusing the already existing tmpDigits array.
-        var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
-        _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-        while (resultDigits[i] < --estimatedQuotientDigit) {
-          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-        }
-      }
-      i--;
-    }
-    // Cache result.
-    _lastDividendDigits = _digits;
-    _lastDividendUsed = _used;
-    _lastDivisorDigits = other._digits;
-    _lastDivisorUsed = other._used;
-    _lastQuoRemDigits = resultDigits;
-    _lastQuoRemUsed = resultUsed;
-    _lastRemUsed = yUsed;
-    _lastRem_nsh = nsh;
-  }
-
-  int get hashCode {
-    // This is the [Jenkins hash function][1] but using masking to keep
-    // values in SMI range.
-    //
-    // [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
-
-    int combine(int hash, int value) {
-      hash = 0x1fffffff & (hash + value);
-      hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-      return hash ^ (hash >> 6);
-    }
-
-    int finish(int hash) {
-      hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-      hash = hash ^ (hash >> 11);
-      return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-    }
-
-    if (_isZero) return 6707; // Just a random number.
-    var hash = _isNegative ? 83585 : 429689; // Also random.
-    for (int i = 0; i < _used; i++) {
-      hash = combine(hash, _digits[i]);
-    }
-    return finish(hash);
-  }
-
-  /**
-   * Test whether this value is numerically equal to `other`.
-   *
-   * If [other] is a [_BigIntImpl] returns whether the two operands have the same
-   * value.
-   *
-   * Returns false if `other` is not a [_BigIntImpl].
-   */
-  bool operator ==(Object other) =>
-      other is _BigIntImpl && compareTo(other) == 0;
-
-  /**
-   * Returns the minimum number of bits required to store this big integer.
-   *
-   * The number of bits excludes the sign bit, which gives the natural length
-   * for non-negative (unsigned) values.  Negative values are complemented to
-   * return the bit position of the first bit that differs from the sign bit.
-   *
-   * To find the number of bits needed to store the value as a signed value,
-   * add one, i.e. use `x.bitLength + 1`.
-   *
-   * ```
-   * x.bitLength == (-x-1).bitLength
-   *
-   * new BigInt.from(3).bitLength == 2;   // 00000011
-   * new BigInt.from(2).bitLength == 2;   // 00000010
-   * new BigInt.from(1).bitLength == 1;   // 00000001
-   * new BigInt.from(0).bitLength == 0;   // 00000000
-   * new BigInt.from(-1).bitLength == 0;  // 11111111
-   * new BigInt.from(-2).bitLength == 1;  // 11111110
-   * new BigInt.from(-3).bitLength == 2;  // 11111101
-   * new BigInt.from(-4).bitLength == 2;  // 11111100
-   * ```
-   */
-  int get bitLength {
-    if (_used == 0) return 0;
-    if (_isNegative) return (~this).bitLength;
-    return _digitBits * (_used - 1) + _digits[_used - 1].bitLength;
-  }
-
-  /**
-   * Truncating division operator.
-   *
-   * Performs a truncating integer division, where the remainder is discarded.
-   *
-   * The remainder can be computed using the [remainder] method.
-   *
-   * Examples:
-   * ```
-   * var seven = new BigInt.from(7);
-   * var three = new BigInt.from(3);
-   * seven ~/ three;    // => 2
-   * (-seven) ~/ three; // => -2
-   * seven ~/ -three;   // => -2
-   * seven.remainder(three);    // => 1
-   * (-seven).remainder(three); // => -1
-   * seven.remainder(-three);   // => 1
-   * ```
-   */
-  _BigIntImpl operator ~/(covariant _BigIntImpl other) {
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return _div(other);
-  }
-
-  /**
-   * Returns the remainder of the truncating division of `this` by [other].
-   *
-   * The result `r` of this operation satisfies:
-   * `this == (this ~/ other) * other + r`.
-   * As a consequence the remainder `r` has the same sign as the divider `this`.
-   */
-  _BigIntImpl remainder(covariant _BigIntImpl other) {
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return _rem(other);
-  }
-
-  /// Division operator.
-  double operator /(BigInt other) => this.toDouble() / other.toDouble();
-
-  /** Relational less than operator. */
-  bool operator <(covariant _BigIntImpl other) => compareTo(other) < 0;
-
-  /** Relational less than or equal operator. */
-  bool operator <=(covariant _BigIntImpl other) => compareTo(other) <= 0;
-
-  /** Relational greater than operator. */
-  bool operator >(covariant _BigIntImpl other) => compareTo(other) > 0;
-
-  /** Relational greater than or equal operator. */
-  bool operator >=(covariant _BigIntImpl other) => compareTo(other) >= 0;
-
-  /**
-   * Euclidean modulo operator.
-   *
-   * Returns the remainder of the Euclidean division. The Euclidean division of
-   * two integers `a` and `b` yields two integers `q` and `r` such that
-   * `a == b * q + r` and `0 <= r < b.abs()`.
-   *
-   * The sign of the returned value `r` is always positive.
-   *
-   * See [remainder] for the remainder of the truncating division.
-   */
-  _BigIntImpl operator %(covariant _BigIntImpl other) {
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    var result = _rem(other);
-    if (result._isNegative) {
-      if (other._isNegative) {
-        result = result - other;
-      } else {
-        result = result + other;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns the sign of this big integer.
-   *
-   * Returns 0 for zero, -1 for values less than zero and
-   * +1 for values greater than zero.
-   */
-  int get sign {
-    if (_used == 0) return 0;
-    return _isNegative ? -1 : 1;
-  }
-
-  /// Whether this big integer is even.
-  bool get isEven => _used == 0 || (_digits[0] & 1) == 0;
-
-  /// Whether this big integer is odd.
-  bool get isOdd => !isEven;
-
-  /// Whether this number is negative.
-  bool get isNegative => _isNegative;
-
-  _BigIntImpl pow(int exponent) {
-    if (exponent < 0) {
-      throw ArgumentError("Exponent must not be negative: $exponent");
-    }
-    if (exponent == 0) return one;
-
-    // Exponentiation by squaring.
-    var result = one;
-    var base = this;
-    while (exponent != 0) {
-      if ((exponent & 1) == 1) {
-        result *= base;
-      }
-      exponent >>= 1;
-      // Skip unnecessary operation.
-      if (exponent != 0) {
-        base *= base;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns this integer to the power of [exponent] modulo [modulus].
-   *
-   * The [exponent] must be non-negative and [modulus] must be
-   * positive.
-   */
-  _BigIntImpl modPow(
-      covariant _BigIntImpl exponent, covariant _BigIntImpl modulus) {
-    if (exponent._isNegative) {
-      throw ArgumentError("exponent must be positive: $exponent");
-    }
-    if (modulus <= zero) {
-      throw ArgumentError("modulus must be strictly positive: $modulus");
-    }
-    if (exponent._isZero) return one;
-
-    final modulusUsed = modulus._used;
-    final modulusUsed2p4 = 2 * modulusUsed + 4;
-    final exponentBitlen = exponent.bitLength;
-    if (exponentBitlen <= 0) return one;
-    _BigIntReduction z = _BigIntClassic(modulus);
-    var resultDigits = Uint16List(modulusUsed2p4);
-    var result2Digits = Uint16List(modulusUsed2p4);
-    var gDigits = Uint16List(modulusUsed);
-    var gUsed = z.convert(this, gDigits);
-    // Initialize result with g.
-    // Copy leading zero if any.
-    for (int j = gUsed - 1; j >= 0; j--) {
-      resultDigits[j] = gDigits[j];
-    }
-    var resultUsed = gUsed;
-    int result2Used;
-    for (int i = exponentBitlen - 2; i >= 0; i--) {
-      result2Used = z.sqr(resultDigits, resultUsed, result2Digits);
-      if (!(exponent & (one << i))._isZero) {
-        resultUsed =
-            z.mul(result2Digits, result2Used, gDigits, gUsed, resultDigits);
-      } else {
-        // Swap result and result2.
-        var tmpDigits = resultDigits;
-        var tmpUsed = resultUsed;
-        resultDigits = result2Digits;
-        resultUsed = result2Used;
-        result2Digits = tmpDigits;
-        result2Used = tmpUsed;
-      }
-    }
-    return z.revert(resultDigits, resultUsed);
-  }
-
-  // If inv is false, returns gcd(x, y).
-  // If inv is true and gcd(x, y) = 1, returns d, so that c*x + d*y = 1.
-  // If inv is true and gcd(x, y) != 1, throws Exception("Not coprime").
-  static _BigIntImpl _binaryGcd(_BigIntImpl x, _BigIntImpl y, bool inv) {
-    var xDigits = x._digits;
-    var yDigits = y._digits;
-    var xUsed = x._used;
-    var yUsed = y._used;
-    var maxUsed = xUsed > yUsed ? xUsed : yUsed;
-    var unshiftedMaxUsed = maxUsed; // Keep
-    xDigits = _cloneDigits(xDigits, 0, xUsed, maxUsed);
-    yDigits = _cloneDigits(yDigits, 0, yUsed, maxUsed);
-    int shiftAmount = 0;
-    if (inv) {
-      if ((yUsed == 1) && (yDigits[0] == 1)) return one;
-      if ((yUsed == 0) || (yDigits[0].isEven && xDigits[0].isEven)) {
-        throw Exception("Not coprime");
-      }
-    } else {
-      if (x._isZero) {
-        throw ArgumentError.value(0, "this", "must not be zero");
-      }
-      if (y._isZero) {
-        throw ArgumentError.value(0, "other", "must not be zero");
-      }
-      if (((xUsed == 1) && (xDigits[0] == 1)) ||
-          ((yUsed == 1) && (yDigits[0] == 1))) return one;
-      while (((xDigits[0] & 1) == 0) && ((yDigits[0] & 1) == 0)) {
-        _rsh(xDigits, xUsed, 1, xDigits);
-        _rsh(yDigits, yUsed, 1, yDigits);
-        shiftAmount++;
-      }
-      if (shiftAmount >= _digitBits) {
-        var digitShiftAmount = shiftAmount ~/ _digitBits;
-        xUsed -= digitShiftAmount;
-        yUsed -= digitShiftAmount;
-        maxUsed -= digitShiftAmount;
-      }
-      if ((yDigits[0] & 1) == 1) {
-        // Swap x and y.
-        var tmpDigits = xDigits;
-        var tmpUsed = xUsed;
-        xDigits = yDigits;
-        xUsed = yUsed;
-        yDigits = tmpDigits;
-        yUsed = tmpUsed;
-      }
-    }
-    var uDigits = _cloneDigits(xDigits, 0, xUsed, unshiftedMaxUsed);
-    var vDigits =
-        _cloneDigits(yDigits, 0, yUsed, unshiftedMaxUsed + 2); // +2 for lsh.
-    final bool ac = (xDigits[0] & 1) == 0;
-
-    // Variables a, b, c, and d require one more digit.
-    final abcdUsed = maxUsed + 1;
-    final abcdLen = abcdUsed + 2; // +2 to satisfy _absAdd.
-    var aDigits = _dummyList;
-    var aIsNegative = false;
-    var cDigits = _dummyList;
-    var cIsNegative = false;
-    if (ac) {
-      aDigits = Uint16List(abcdLen);
-      aDigits[0] = 1;
-      cDigits = Uint16List(abcdLen);
-    }
-    var bDigits = Uint16List(abcdLen);
-    var bIsNegative = false;
-    var dDigits = Uint16List(abcdLen);
-    var dIsNegative = false;
-    dDigits[0] = 1;
-
-    while (true) {
-      while ((uDigits[0] & 1) == 0) {
-        _rsh(uDigits, maxUsed, 1, uDigits);
-        if (ac) {
-          if (((aDigits[0] & 1) == 1) || ((bDigits[0] & 1) == 1)) {
-            // a += y
-            if (aIsNegative) {
-              if ((aDigits[maxUsed] != 0) ||
-                  (_compareDigits(aDigits, maxUsed, yDigits, maxUsed)) > 0) {
-                _absSub(aDigits, abcdUsed, yDigits, maxUsed, aDigits);
-              } else {
-                _absSub(yDigits, maxUsed, aDigits, maxUsed, aDigits);
-                aIsNegative = false;
-              }
-            } else {
-              _absAdd(aDigits, abcdUsed, yDigits, maxUsed, aDigits);
-            }
-            // b -= x
-            if (bIsNegative) {
-              _absAdd(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-            } else if ((bDigits[maxUsed] != 0) ||
-                (_compareDigits(bDigits, maxUsed, xDigits, maxUsed) > 0)) {
-              _absSub(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-            } else {
-              _absSub(xDigits, maxUsed, bDigits, maxUsed, bDigits);
-              bIsNegative = true;
-            }
-          }
-          _rsh(aDigits, abcdUsed, 1, aDigits);
-        } else if ((bDigits[0] & 1) == 1) {
-          // b -= x
-          if (bIsNegative) {
-            _absAdd(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-          } else if ((bDigits[maxUsed] != 0) ||
-              (_compareDigits(bDigits, maxUsed, xDigits, maxUsed) > 0)) {
-            _absSub(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-          } else {
-            _absSub(xDigits, maxUsed, bDigits, maxUsed, bDigits);
-            bIsNegative = true;
-          }
-        }
-        _rsh(bDigits, abcdUsed, 1, bDigits);
-      }
-      while ((vDigits[0] & 1) == 0) {
-        _rsh(vDigits, maxUsed, 1, vDigits);
-        if (ac) {
-          if (((cDigits[0] & 1) == 1) || ((dDigits[0] & 1) == 1)) {
-            // c += y
-            if (cIsNegative) {
-              if ((cDigits[maxUsed] != 0) ||
-                  (_compareDigits(cDigits, maxUsed, yDigits, maxUsed) > 0)) {
-                _absSub(cDigits, abcdUsed, yDigits, maxUsed, cDigits);
-              } else {
-                _absSub(yDigits, maxUsed, cDigits, maxUsed, cDigits);
-                cIsNegative = false;
-              }
-            } else {
-              _absAdd(cDigits, abcdUsed, yDigits, maxUsed, cDigits);
-            }
-            // d -= x
-            if (dIsNegative) {
-              _absAdd(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-            } else if ((dDigits[maxUsed] != 0) ||
-                (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-              _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-            } else {
-              _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-              dIsNegative = true;
-            }
-          }
-          _rsh(cDigits, abcdUsed, 1, cDigits);
-        } else if ((dDigits[0] & 1) == 1) {
-          // d -= x
-          if (dIsNegative) {
-            _absAdd(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-          } else if ((dDigits[maxUsed] != 0) ||
-              (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-            _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-          } else {
-            _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-            dIsNegative = true;
-          }
-        }
-        _rsh(dDigits, abcdUsed, 1, dDigits);
-      }
-      if (_compareDigits(uDigits, maxUsed, vDigits, maxUsed) >= 0) {
-        // u -= v
-        _absSub(uDigits, maxUsed, vDigits, maxUsed, uDigits);
-        if (ac) {
-          // a -= c
-          if (aIsNegative == cIsNegative) {
-            var a_cmp_c = _compareDigits(aDigits, abcdUsed, cDigits, abcdUsed);
-            if (a_cmp_c > 0) {
-              _absSub(aDigits, abcdUsed, cDigits, abcdUsed, aDigits);
-            } else {
-              _absSub(cDigits, abcdUsed, aDigits, abcdUsed, aDigits);
-              aIsNegative = !aIsNegative && (a_cmp_c != 0);
-            }
-          } else {
-            _absAdd(aDigits, abcdUsed, cDigits, abcdUsed, aDigits);
-          }
-        }
-        // b -= d
-        if (bIsNegative == dIsNegative) {
-          var b_cmp_d = _compareDigits(bDigits, abcdUsed, dDigits, abcdUsed);
-          if (b_cmp_d > 0) {
-            _absSub(bDigits, abcdUsed, dDigits, abcdUsed, bDigits);
-          } else {
-            _absSub(dDigits, abcdUsed, bDigits, abcdUsed, bDigits);
-            bIsNegative = !bIsNegative && (b_cmp_d != 0);
-          }
-        } else {
-          _absAdd(bDigits, abcdUsed, dDigits, abcdUsed, bDigits);
-        }
-      } else {
-        // v -= u
-        _absSub(vDigits, maxUsed, uDigits, maxUsed, vDigits);
-        if (ac) {
-          // c -= a
-          if (cIsNegative == aIsNegative) {
-            var c_cmp_a = _compareDigits(cDigits, abcdUsed, aDigits, abcdUsed);
-            if (c_cmp_a > 0) {
-              _absSub(cDigits, abcdUsed, aDigits, abcdUsed, cDigits);
-            } else {
-              _absSub(aDigits, abcdUsed, cDigits, abcdUsed, cDigits);
-              cIsNegative = !cIsNegative && (c_cmp_a != 0);
-            }
-          } else {
-            _absAdd(cDigits, abcdUsed, aDigits, abcdUsed, cDigits);
-          }
-        }
-        // d -= b
-        if (dIsNegative == bIsNegative) {
-          var d_cmp_b = _compareDigits(dDigits, abcdUsed, bDigits, abcdUsed);
-          if (d_cmp_b > 0) {
-            _absSub(dDigits, abcdUsed, bDigits, abcdUsed, dDigits);
-          } else {
-            _absSub(bDigits, abcdUsed, dDigits, abcdUsed, dDigits);
-            dIsNegative = !dIsNegative && (d_cmp_b != 0);
-          }
-        } else {
-          _absAdd(dDigits, abcdUsed, bDigits, abcdUsed, dDigits);
-        }
-      }
-      // Exit loop if u == 0.
-      var i = maxUsed;
-      while ((i > 0) && (uDigits[i - 1] == 0)) --i;
-      if (i == 0) break;
-    }
-    if (!inv) {
-      if (shiftAmount > 0) {
-        maxUsed = _lShiftDigits(vDigits, maxUsed, shiftAmount, vDigits);
-      }
-      return _BigIntImpl._(false, maxUsed, vDigits);
-    }
-    // No inverse if v != 1.
-    var i = maxUsed - 1;
-    while ((i > 0) && (vDigits[i] == 0)) --i;
-    if ((i != 0) || (vDigits[0] != 1)) {
-      throw Exception("Not coprime");
-    }
-
-    if (dIsNegative) {
-      while ((dDigits[maxUsed] != 0) ||
-          (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-        // d += x, d still negative
-        _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-      }
-      // d += x
-      _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-      dIsNegative = false;
-    } else {
-      while ((dDigits[maxUsed] != 0) ||
-          (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) >= 0)) {
-        // d -= x
-        _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-      }
-    }
-    return _BigIntImpl._(false, maxUsed, dDigits);
-  }
-
-  /**
-   * Returns the modular multiplicative inverse of this big integer
-   * modulo [modulus].
-   *
-   * The [modulus] must be positive.
-   *
-   * It is an error if no modular inverse exists.
-   */
-  // Returns 1/this % modulus, with modulus > 0.
-  _BigIntImpl modInverse(covariant _BigIntImpl modulus) {
-    if (modulus <= zero) {
-      throw ArgumentError("Modulus must be strictly positive: $modulus");
-    }
-    if (modulus == one) return zero;
-    var tmp = this;
-    if (tmp._isNegative || (tmp._absCompare(modulus) >= 0)) {
-      tmp %= modulus;
-    }
-    return _binaryGcd(modulus, tmp, true);
-  }
-
-  /**
-   * Returns the greatest common divisor of this big integer and [other].
-   *
-   * If either number is non-zero, the result is the numerically greatest
-   * integer dividing both `this` and `other`.
-   *
-   * The greatest common divisor is independent of the order,
-   * so `x.gcd(y)` is  always the same as `y.gcd(x)`.
-   *
-   * For any integer `x`, `x.gcd(x)` is `x.abs()`.
-   *
-   * If both `this` and `other` is zero, the result is also zero.
-   */
-  _BigIntImpl gcd(covariant _BigIntImpl other) {
-    if (_isZero) return other.abs();
-    if (other._isZero) return this.abs();
-    return _binaryGcd(this, other, false);
-  }
-
-  /**
-   * Returns the least significant [width] bits of this big integer as a
-   * non-negative number (i.e. unsigned representation).  The returned value has
-   * zeros in all bit positions higher than [width].
-   *
-   * ```
-   * new BigInt.from(-1).toUnsigned(5) == 31   // 11111111  ->  00011111
-   * ```
-   *
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit quantity:
-   *
-   * ```
-   * q = (q + 1).toUnsigned(8);
-   * ```
-   *
-   * `q` will count from `0` up to `255` and then wrap around to `0`.
-   *
-   * If the input fits in [width] bits without truncation, the result is the
-   * same as the input.  The minimum width needed to avoid truncation of `x` is
-   * given by `x.bitLength`, i.e.
-   *
-   * ```
-   * x == x.toUnsigned(x.bitLength);
-   * ```
-   */
-  _BigIntImpl toUnsigned(int width) {
-    return this & ((one << width) - one);
-  }
-
-  /**
-   * Returns the least significant [width] bits of this integer, extending the
-   * highest retained bit to the sign.  This is the same as truncating the value
-   * to fit in [width] bits using an signed 2-s complement representation.  The
-   * returned value has the same bit value in all positions higher than [width].
-   *
-   * ```
-   * var big15 = new BigInt.from(15);
-   * var big16 = new BigInt.from(16);
-   * var big239 = new BigInt.from(239);
-   *                                      V--sign bit-V
-   * big16.toSigned(5) == -big16   //  00010000 -> 11110000
-   * big239.toSigned(5) == big15   //  11101111 -> 00001111
-   *                                      ^           ^
-   * ```
-   *
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit signed quantity:
-   *
-   * ```
-   * q = (q + 1).toSigned(8);
-   * ```
-   *
-   * `q` will count from `0` up to `127`, wrap to `-128` and count back up to
-   * `127`.
-   *
-   * If the input value fits in [width] bits without truncation, the result is
-   * the same as the input.  The minimum width needed to avoid truncation of `x`
-   * is `x.bitLength + 1`, i.e.
-   *
-   * ```
-   * x == x.toSigned(x.bitLength + 1);
-   * ```
-   */
-  _BigIntImpl toSigned(int width) {
-    // The value of binary number weights each bit by a power of two.  The
-    // twos-complement value weights the sign bit negatively.  We compute the
-    // value of the negative weighting by isolating the sign bit with the
-    // correct power of two weighting and subtracting it from the value of the
-    // lower bits.
-    var signMask = one << (width - 1);
-    return (this & (signMask - one)) - (this & signMask);
-  }
-
-  // Maximum number of digits that always fit in mantissa.
-  static const _simpleValidIntDigits = 53 ~/ _digitBits;
-
-  bool get isValidInt {
-    if (_used <= _simpleValidIntDigits) return true;
-    var asInt = toInt();
-    if (!asInt.toDouble().isFinite) return false;
-    return this == _BigIntImpl._fromInt(asInt);
-  }
-
-  int toInt() {
-    var result = 0;
-    for (int i = _used - 1; i >= 0; i--) {
-      result = result * _digitBase + _digits[i];
-    }
-    return _isNegative ? -result : result;
-  }
-
-  /**
-   * Returns this [_BigIntImpl] as a [double].
-   *
-   * If the number is not representable as a [double], an
-   * approximation is returned. For numerically large integers, the
-   * approximation may be infinite.
-   */
-  double toDouble() {
-    const int exponentBias = 1075;
-    // There are 11 bits for the exponent.
-    // 2047 (all bits set to 1) is reserved for infinity and NaN.
-    // When storing the exponent in the 11 bits, it is biased by exponentBias
-    // to support negative exponents.
-    const int maxDoubleExponent = 2046 - exponentBias;
-    if (_isZero) return 0.0;
-
-    // We fill the 53 bits little-endian.
-    var resultBits = Uint8List(8);
-
-    var length = _digitBits * (_used - 1) + _digits[_used - 1].bitLength;
-    if (length > maxDoubleExponent + 53) {
-      return _isNegative ? double.negativeInfinity : double.infinity;
-    }
-
-    // The most significant bit is for the sign.
-    if (_isNegative) resultBits[7] = 0x80;
-
-    // Write the exponent into bits 1..12:
-    var biasedExponent = length - 53 + exponentBias;
-    resultBits[6] = (biasedExponent & 0xF) << 4;
-    resultBits[7] |= biasedExponent >> 4;
-
-    int cachedBits = 0;
-    int cachedBitsLength = 0;
-    int digitIndex = _used - 1;
-    int readBits(int n) {
-      // Ensure that we have enough bits in [cachedBits].
-      while (cachedBitsLength < n) {
-        int nextDigit;
-        int nextDigitLength = _digitBits; // May get updated.
-        if (digitIndex < 0) {
-          nextDigit = 0;
-          digitIndex--;
-        } else {
-          nextDigit = _digits[digitIndex];
-          if (digitIndex == _used - 1) nextDigitLength = nextDigit.bitLength;
-          digitIndex--;
-        }
-        cachedBits = (cachedBits << nextDigitLength) + nextDigit;
-        cachedBitsLength += nextDigitLength;
-      }
-      // Read the top [n] bits.
-      var result = cachedBits >> (cachedBitsLength - n);
-      // Remove the bits from the cache.
-      cachedBits -= result << (cachedBitsLength - n);
-      cachedBitsLength -= n;
-      return result;
-    }
-
-    // The first leading 1 bit is implicit in the double-representation and can
-    // be discarded.
-    var leadingBits = readBits(5) & 0xF;
-    resultBits[6] |= leadingBits;
-
-    for (int i = 5; i >= 0; i--) {
-      // Get the remaining 48 bits.
-      resultBits[i] = readBits(8);
-    }
-
-    void roundUp() {
-      // Simply consists of adding 1 to the whole 64 bit "number".
-      // It will update the exponent, if necessary.
-      // It might even round up to infinity (which is what we want).
-      var carry = 1;
-      for (int i = 0; i < 8; i++) {
-        if (carry == 0) break;
-        var sum = resultBits[i] + carry;
-        resultBits[i] = sum & 0xFF;
-        carry = sum >> 8;
-      }
-    }
-
-    if (readBits(1) == 1) {
-      if (resultBits[0].isOdd) {
-        // Rounds to even all the time.
-        roundUp();
-      } else {
-        // Round up, if there is at least one other digit that is not 0.
-        if (cachedBits != 0) {
-          // There is already one in the cachedBits.
-          roundUp();
-        } else {
-          for (int i = digitIndex; i >= 0; i--) {
-            if (_digits[i] != 0) {
-              roundUp();
-              break;
-            }
-          }
-        }
-      }
-    }
-    return resultBits.buffer.asByteData().getFloat64(0, Endian.little);
-  }
-
-  /**
-   * Returns a String-representation of this integer.
-   *
-   * The returned string is parsable by [parse].
-   * For any `_BigIntImpl` `i`, it is guaranteed that
-   * `i == _BigIntImpl.parse(i.toString())`.
-   */
-  String toString() {
-    if (_used == 0) return "0";
-    if (_used == 1) {
-      if (_isNegative) return (-_digits[0]).toString();
-      return _digits[0].toString();
-    }
-
-    // Generate in chunks of 4 digits.
-    // The chunks are in reversed order.
-    var decimalDigitChunks = <String>[];
-    var rest = isNegative ? -this : this;
-    while (rest._used > 1) {
-      var digits4 = rest.remainder(_bigInt10000).toString();
-      decimalDigitChunks.add(digits4);
-      if (digits4.length == 1) decimalDigitChunks.add("000");
-      if (digits4.length == 2) decimalDigitChunks.add("00");
-      if (digits4.length == 3) decimalDigitChunks.add("0");
-      rest = rest ~/ _bigInt10000;
-    }
-    decimalDigitChunks.add(rest._digits[0].toString());
-    if (_isNegative) decimalDigitChunks.add("-");
-    return decimalDigitChunks.reversed.join();
-  }
-
-  int _toRadixCodeUnit(int digit) {
-    const int _0 = 48;
-    const int _a = 97;
-    if (digit < 10) return _0 + digit;
-    return _a + digit - 10;
-  }
-
-  /**
-   * Converts [this] to a string representation in the given [radix].
-   *
-   * In the string representation, lower-case letters are used for digits above
-   * '9', with 'a' being 10 an 'z' being 35.
-   *
-   * The [radix] argument must be an integer in the range 2 to 36.
-   */
-  String toRadixString(int radix) {
-    if (radix > 36) throw RangeError.range(radix, 2, 36);
-
-    if (_used == 0) return "0";
-
-    if (_used == 1) {
-      var digitString = _digits[0].toRadixString(radix);
-      if (_isNegative) return "-" + digitString;
-      return digitString;
-    }
-
-    if (radix == 16) return _toHexString();
-
-    var base = _BigIntImpl._fromInt(radix);
-    var reversedDigitCodeUnits = <int>[];
-    var rest = this.abs();
-    while (!rest._isZero) {
-      var digit = rest.remainder(base).toInt();
-      rest = rest ~/ base;
-      reversedDigitCodeUnits.add(_toRadixCodeUnit(digit));
-    }
-    var digitString = String.fromCharCodes(reversedDigitCodeUnits.reversed);
-    if (_isNegative) return "-" + digitString;
-    return digitString;
-  }
-
-  String _toHexString() {
-    var chars = <int>[];
-    for (int i = 0; i < _used - 1; i++) {
-      int chunk = _digits[i];
-      for (int j = 0; j < (_digitBits ~/ 4); j++) {
-        chars.add(_toRadixCodeUnit(chunk & 0xF));
-        chunk >>= 4;
-      }
-    }
-    var msbChunk = _digits[_used - 1];
-    while (msbChunk != 0) {
-      chars.add(_toRadixCodeUnit(msbChunk & 0xF));
-      msbChunk >>= 4;
-    }
-    if (_isNegative) {
-      const _dash = 45;
-      chars.add(_dash);
-    }
-    return String.fromCharCodes(chars.reversed);
-  }
-}
-
-// Interface for modular reduction.
-abstract class _BigIntReduction {
-  // Return the number of digits used by r_digits.
-  int convert(_BigIntImpl x, Uint16List r_digits);
-  int mul(Uint16List xDigits, int xUsed, Uint16List yDigits, int yUsed,
-      Uint16List resultDigits);
-  int sqr(Uint16List xDigits, int xUsed, Uint16List resultDigits);
-
-  // Return x reverted to _BigIntImpl.
-  _BigIntImpl revert(Uint16List xDigits, int xUsed);
-}
-
-// Modular reduction using "classic" algorithm.
-class _BigIntClassic implements _BigIntReduction {
-  final _BigIntImpl _modulus; // Modulus.
-  final _BigIntImpl _normalizedModulus; // Normalized _modulus.
-
-  _BigIntClassic(this._modulus)
-      : _normalizedModulus = _modulus <<
-            (_BigIntImpl._digitBits -
-                _modulus._digits[_modulus._used - 1].bitLength);
-
-  int convert(_BigIntImpl x, Uint16List resultDigits) {
-    Uint16List digits;
-    int used;
-    if (x._isNegative || x._absCompare(_modulus) >= 0) {
-      var remainder = x._rem(_modulus);
-      if (x._isNegative && remainder._used > 0) {
-        assert(remainder._isNegative);
-        remainder += _modulus;
-      }
-      assert(!remainder._isNegative);
-      used = remainder._used;
-      digits = remainder._digits;
-    } else {
-      used = x._used;
-      digits = x._digits;
-    }
-    var i = used; // Copy leading zero if any.
-    while (--i >= 0) {
-      resultDigits[i] = digits[i];
-    }
-    return used;
-  }
-
-  _BigIntImpl revert(Uint16List xDigits, int xUsed) {
-    return _BigIntImpl._(false, xUsed, xDigits);
-  }
-
-  int _reduce(Uint16List xDigits, int xUsed) {
-    if (xUsed < _modulus._used) {
-      return xUsed;
-    }
-    var reverted = revert(xDigits, xUsed);
-    var rem = reverted._rem(_normalizedModulus);
-    return convert(rem, xDigits);
-  }
-
-  int sqr(Uint16List xDigits, int xUsed, Uint16List resultDigits) {
-    var b = _BigIntImpl._(false, xUsed, xDigits);
-    var b2 = b * b;
-    for (int i = 0; i < b2._used; i++) {
-      resultDigits[i] = b2._digits[i];
-    }
-    for (int i = b2._used; i < 2 * xUsed; i++) {
-      resultDigits[i] = 0;
-    }
-    return _reduce(resultDigits, 2 * xUsed);
-  }
-
-  int mul(Uint16List xDigits, int xUsed, Uint16List yDigits, int yUsed,
-      Uint16List resultDigits) {
-    var resultUsed =
-        _BigIntImpl._mulDigits(xDigits, xUsed, yDigits, yUsed, resultDigits);
-    return _reduce(resultDigits, resultUsed);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/developer_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/developer_patch.dart
deleted file mode 100644
index d67b6c8..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/developer_patch.dart
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// Patch file for dart:developer library.
-
-import 'dart:_js_helper' show patch, ForceInline, ReifyFunctionTypes;
-import 'dart:_foreign_helper' show JS, JSExportName;
-import 'dart:_runtime' as dart;
-import 'dart:async';
-import 'dart:convert' show json;
-import 'dart:isolate';
-
-@patch
-@ForceInline()
-bool debugger({bool when = true, String? message}) {
-  if (when) {
-    JS('', 'debugger');
-  }
-  return when;
-}
-
-@patch
-Object? inspect(Object? object) {
-  // Note: this log level does not show up by default in Chrome.
-  // This is used for communication with the debugger service.
-  JS('', 'console.debug("dart.developer.inspect", #)', object);
-  return object;
-}
-
-@patch
-void log(String message,
-    {DateTime? time,
-    int? sequenceNumber,
-    int level = 0,
-    String name = '',
-    Zone? zone,
-    Object? error,
-    StackTrace? stackTrace}) {
-  Object items =
-      JS('!', '{ message: #, name: #, level: # }', message, name, level);
-  if (time != null) JS('', '#.time = #', items, time);
-  if (sequenceNumber != null) {
-    JS('', '#.sequenceNumber = #', items, sequenceNumber);
-  }
-  if (zone != null) JS('', '#.zone = #', items, zone);
-  if (error != null) JS('', '#.error = #', items, error);
-  if (stackTrace != null) JS('', '#.stackTrace = #', items, stackTrace);
-
-  JS('', 'console.debug("dart.developer.log", #)', items);
-}
-
-final _extensions = <String, ServiceExtensionHandler>{};
-
-@patch
-ServiceExtensionHandler? _lookupExtension(String method) {
-  return _extensions[method];
-}
-
-@patch
-_registerExtension(String method, ServiceExtensionHandler handler) {
-  _extensions[method] = handler;
-  JS('', 'console.debug("dart.developer.registerExtension", #)', method);
-}
-
-/// Returns a JS `Promise` that resolves with the result of invoking
-/// [methodName] with an [encodedJson] map as its parameters.
-///
-/// This is used by the VM Service Prototcol to invoke extensions registered
-/// with [registerExtension]. For example, in JS:
-///
-///     await sdk.developer.invokeExtension(
-/// .         "ext.flutter.inspector.getRootWidget", '{"objectGroup":""}');
-///
-@JSExportName('invokeExtension')
-@ReifyFunctionTypes(false)
-_invokeExtension(String methodName, String encodedJson) {
-  // TODO(vsm): We should factor this out as future<->promise.
-  return JS('', 'new #.Promise(#)', dart.global_,
-      (Function(Object) resolve, Function(Object) reject) async {
-    try {
-      var method = _lookupExtension(methodName)!;
-      var parameters = (json.decode(encodedJson) as Map).cast<String, String>();
-      var result = await method(methodName, parameters);
-      resolve(result._toString());
-    } catch (e) {
-      // TODO(vsm): Reject or encode in result?
-      reject('$e');
-    }
-  });
-}
-
-@patch
-void _postEvent(String eventKind, String eventData) {
-  JS('', 'console.debug("dart.developer.postEvent", #, #)', eventKind,
-      eventData);
-}
-
-@patch
-bool _isDartStreamEnabled() {
-  return false;
-}
-
-@patch
-int _getTraceClock() {
-  // TODO.
-  return _clockValue++;
-}
-
-int _clockValue = 0;
-
-@patch
-void _reportFlowEvent(
-    String category, String name, int type, int id, String argumentsAsJson) {
-  // TODO.
-}
-
-@patch
-void _reportInstantEvent(String category, String name, String argumentsAsJson) {
-  // TODO.
-}
-
-@patch
-int _getNextAsyncId() {
-  return 0;
-}
-
-@patch
-void _reportTaskEvent(int taskId, String phase, String category, String name,
-    String argumentsAsJson) {
-  // TODO.
-}
-
-@patch
-int _getServiceMajorVersion() {
-  return 0;
-}
-
-@patch
-int _getServiceMinorVersion() {
-  return 0;
-}
-
-@patch
-void _getServerInfo(SendPort sendPort) {
-  sendPort.send(null);
-}
-
-@patch
-void _webServerControl(SendPort sendPort, bool enable) {
-  sendPort.send(null);
-}
-
-@patch
-String? _getIsolateIDFromSendPort(SendPort sendPort) {
-  return null;
-}
-
-@patch
-class UserTag {
-  @patch
-  factory UserTag(String label) = _FakeUserTag;
-
-  @patch
-  static UserTag get defaultTag => _FakeUserTag._defaultTag;
-}
-
-class _FakeUserTag implements UserTag {
-  static final _instances = <String, _FakeUserTag>{};
-
-  _FakeUserTag.real(this.label);
-
-  factory _FakeUserTag(String label) {
-    // Canonicalize by name.
-    var existingTag = _instances[label];
-    if (existingTag != null) {
-      return existingTag;
-    }
-    // Throw an exception if we've reached the maximum number of user tags.
-    if (_instances.length == UserTag.MAX_USER_TAGS) {
-      throw UnsupportedError(
-          'UserTag instance limit (${UserTag.MAX_USER_TAGS}) reached.');
-    }
-    return _instances[label] = _FakeUserTag.real(label);
-  }
-
-  final String label;
-
-  UserTag makeCurrent() {
-    var old = _currentTag;
-    _currentTag = this;
-    return old;
-  }
-
-  static final UserTag _defaultTag = _FakeUserTag('Default');
-}
-
-var _currentTag = _FakeUserTag._defaultTag;
-
-@patch
-UserTag getCurrentTag() => _currentTag;
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/internal_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/internal_patch.dart
deleted file mode 100644
index 2e605a2..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/internal_patch.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:core' hide Symbol;
-import 'dart:core' as core show Symbol;
-import 'dart:_js_primitives' show printString;
-import 'dart:_js_helper' show patch;
-import 'dart:_interceptors' show JSArray;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_runtime' as dart;
-
-@patch
-bool typeAcceptsNull<T>() => !dart.strictNullSafety || null is T;
-
-@patch
-class Symbol implements core.Symbol {
-  @patch
-  const Symbol(String name) : this._name = name;
-
-  @patch
-  int get hashCode {
-    int? hash = JS('int|Null', '#._hashCode', this);
-    if (hash != null) return hash;
-    const arbitraryPrime = 664597;
-    hash = 0x1fffffff & (arbitraryPrime * _name.hashCode);
-    JS('', '#._hashCode = #', this, hash);
-    return hash;
-  }
-
-  @patch
-  toString() => 'Symbol("$_name")';
-
-  @patch
-  static String computeUnmangledName(Symbol symbol) => symbol._name;
-}
-
-@patch
-void printToConsole(String line) {
-  printString('$line');
-}
-
-@patch
-List<T> makeListFixedLength<T>(List<T> growableList) {
-  JSArray.markFixedList(growableList);
-  return growableList;
-}
-
-@patch
-List<T> makeFixedListUnmodifiable<T>(List<T> fixedLengthList) {
-  JSArray.markUnmodifiableList(fixedLengthList);
-  return fixedLengthList;
-}
-
-@patch
-Object? extractTypeArguments<T>(T instance, Function extract) =>
-    dart.extractTypeArguments<T>(instance, extract);
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/io_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/io_patch.dart
deleted file mode 100644
index 041dfd5..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/io_patch.dart
+++ /dev/null
@@ -1,707 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:_js_helper' show patch;
-import 'dart:async';
-import 'dart:convert';
-import 'dart:isolate' show SendPort;
-import 'dart:typed_data';
-
-@patch
-class _Directory {
-  @patch
-  static _current(_Namespace namespace) {
-    throw UnsupportedError("Directory._current");
-  }
-
-  @patch
-  static _setCurrent(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("Directory_SetCurrent");
-  }
-
-  @patch
-  static _createTemp(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("Directory._createTemp");
-  }
-
-  @patch
-  static String _systemTemp(_Namespace namespace) {
-    throw UnsupportedError("Directory._systemTemp");
-  }
-
-  @patch
-  static _exists(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("Directory._exists");
-  }
-
-  @patch
-  static _create(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("Directory._create");
-  }
-
-  @patch
-  static _deleteNative(
-      _Namespace namespace, Uint8List rawPath, bool recursive) {
-    throw UnsupportedError("Directory._deleteNative");
-  }
-
-  @patch
-  static _rename(_Namespace namespace, Uint8List rawPath, String newPath) {
-    throw UnsupportedError("Directory._rename");
-  }
-
-  @patch
-  static void _fillWithDirectoryListing(
-      _Namespace namespace,
-      List<FileSystemEntity> list,
-      Uint8List rawPath,
-      bool recursive,
-      bool followLinks) {
-    throw UnsupportedError("Directory._fillWithDirectoryListing");
-  }
-}
-
-@patch
-class _AsyncDirectoryListerOps {
-  @patch
-  factory _AsyncDirectoryListerOps(int pointer) {
-    throw UnsupportedError("Directory._list");
-  }
-}
-
-@patch
-class _EventHandler {
-  @patch
-  static void _sendData(Object? sender, SendPort sendPort, int data) {
-    throw UnsupportedError("EventHandler._sendData");
-  }
-}
-
-@patch
-class FileStat {
-  @patch
-  static _statSync(_Namespace namespace, String path) {
-    throw UnsupportedError("FileStat.stat");
-  }
-}
-
-@patch
-class FileSystemEntity {
-  @patch
-  static _getTypeNative(
-      _Namespace namespace, Uint8List rawPath, bool followLinks) {
-    throw UnsupportedError("FileSystemEntity._getType");
-  }
-
-  @patch
-  static _identicalNative(_Namespace namespace, String path1, String path2) {
-    throw UnsupportedError("FileSystemEntity._identical");
-  }
-
-  @patch
-  static _resolveSymbolicLinks(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("FileSystemEntity._resolveSymbolicLinks");
-  }
-}
-
-@patch
-class _File {
-  @patch
-  static _exists(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._exists");
-  }
-
-  @patch
-  static _create(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._create");
-  }
-
-  @patch
-  static _createLink(_Namespace namespace, Uint8List rawPath, String target) {
-    throw UnsupportedError("File._createLink");
-  }
-
-  @patch
-  static _linkTarget(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._linkTarget");
-  }
-
-  @patch
-  static _deleteNative(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._deleteNative");
-  }
-
-  @patch
-  static _deleteLinkNative(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._deleteLinkNative");
-  }
-
-  @patch
-  static _rename(_Namespace namespace, Uint8List oldPath, String newPath) {
-    throw UnsupportedError("File._rename");
-  }
-
-  @patch
-  static _renameLink(_Namespace namespace, Uint8List oldPath, String newPath) {
-    throw UnsupportedError("File._renameLink");
-  }
-
-  @patch
-  static _copy(_Namespace namespace, Uint8List oldPath, String newPath) {
-    throw UnsupportedError("File._copy");
-  }
-
-  @patch
-  static _lengthFromPath(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._lengthFromPath");
-  }
-
-  @patch
-  static _lastModified(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._lastModified");
-  }
-
-  @patch
-  static _lastAccessed(_Namespace namespace, Uint8List rawPath) {
-    throw UnsupportedError("File._lastAccessed");
-  }
-
-  @patch
-  static _setLastModified(_Namespace namespace, Uint8List rawPath, int millis) {
-    throw UnsupportedError("File._setLastModified");
-  }
-
-  @patch
-  static _setLastAccessed(_Namespace namespace, Uint8List rawPath, int millis) {
-    throw UnsupportedError("File._setLastAccessed");
-  }
-
-  @patch
-  static _open(_Namespace namespace, Uint8List rawPath, int mode) {
-    throw UnsupportedError("File._open");
-  }
-
-  @patch
-  static int _openStdio(int fd) {
-    throw UnsupportedError("File._openStdio");
-  }
-}
-
-@patch
-class _Namespace {
-  @patch
-  static void _setupNamespace(var namespace) {
-    throw UnsupportedError("_Namespace");
-  }
-
-  @patch
-  static _Namespace get _namespace {
-    throw UnsupportedError("_Namespace");
-  }
-
-  @patch
-  static int get _namespacePointer {
-    throw UnsupportedError("_Namespace");
-  }
-}
-
-@patch
-class _RandomAccessFileOps {
-  @patch
-  factory _RandomAccessFileOps(int pointer) {
-    throw UnsupportedError("RandomAccessFile");
-  }
-}
-
-@patch
-bool _isDirectIOCapableTypedList(List<int> buffer) {
-  throw UnsupportedError("_isDirectIOCapableTypedList");
-}
-
-@patch
-class _IOCrypto {
-  @patch
-  static Uint8List getRandomBytes(int count) {
-    throw UnsupportedError("_IOCrypto.getRandomBytes");
-  }
-}
-
-@patch
-class _Platform {
-  @patch
-  static int _numberOfProcessors() {
-    throw UnsupportedError("Platform._numberOfProcessors");
-  }
-
-  @patch
-  static String _pathSeparator() {
-    throw UnsupportedError("Platform._pathSeparator");
-  }
-
-  @patch
-  static String _operatingSystem() {
-    throw UnsupportedError("Platform._operatingSystem");
-  }
-
-  @patch
-  static _operatingSystemVersion() {
-    throw UnsupportedError("Platform._operatingSystemVersion");
-  }
-
-  @patch
-  static _localHostname() {
-    throw UnsupportedError("Platform._localHostname");
-  }
-
-  @patch
-  static _executable() {
-    throw UnsupportedError("Platform._executable");
-  }
-
-  @patch
-  static _resolvedExecutable() {
-    throw UnsupportedError("Platform._resolvedExecutable");
-  }
-
-  @patch
-  static List<String> _executableArguments() {
-    throw UnsupportedError("Platform._executableArguments");
-  }
-
-  @patch
-  static String _packageRoot() {
-    throw UnsupportedError("Platform._packageRoot");
-  }
-
-  @patch
-  static String _packageConfig() {
-    throw UnsupportedError("Platform._packageConfig");
-  }
-
-  @patch
-  static _environment() {
-    throw UnsupportedError("Platform._environment");
-  }
-
-  @patch
-  static String _version() {
-    throw UnsupportedError("Platform._version");
-  }
-
-  @patch
-  static String _localeName() {
-    throw UnsupportedError("Platform._localeName");
-  }
-
-  @patch
-  static Uri _script() {
-    throw UnsupportedError("Platform._script");
-  }
-}
-
-@patch
-class _ProcessUtils {
-  @patch
-  static Never _exit(int status) {
-    throw UnsupportedError("ProcessUtils._exit");
-  }
-
-  @patch
-  static void _setExitCode(int status) {
-    throw UnsupportedError("ProcessUtils._setExitCode");
-  }
-
-  @patch
-  static int _getExitCode() {
-    throw UnsupportedError("ProcessUtils._getExitCode");
-  }
-
-  @patch
-  static void _sleep(int millis) {
-    throw UnsupportedError("ProcessUtils._sleep");
-  }
-
-  @patch
-  static int _pid(Process? process) {
-    throw UnsupportedError("ProcessUtils._pid");
-  }
-
-  @patch
-  static Stream<ProcessSignal> _watchSignal(ProcessSignal signal) {
-    throw UnsupportedError("ProcessUtils._watchSignal");
-  }
-}
-
-@patch
-class ProcessInfo {
-  @patch
-  static int get currentRss {
-    throw UnsupportedError("ProcessInfo.currentRss");
-  }
-
-  @patch
-  static int get maxRss {
-    throw UnsupportedError("ProcessInfo.maxRss");
-  }
-}
-
-@patch
-class Process {
-  @patch
-  static Future<Process> start(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment = true,
-      bool runInShell = false,
-      ProcessStartMode mode = ProcessStartMode.normal}) {
-    throw UnsupportedError("Process.start");
-  }
-
-  @patch
-  static Future<ProcessResult> run(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment = true,
-      bool runInShell = false,
-      Encoding stdoutEncoding = systemEncoding,
-      Encoding stderrEncoding = systemEncoding}) {
-    throw UnsupportedError("Process.run");
-  }
-
-  @patch
-  static ProcessResult runSync(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment = true,
-      bool runInShell = false,
-      Encoding stdoutEncoding = systemEncoding,
-      Encoding stderrEncoding = systemEncoding}) {
-    throw UnsupportedError("Process.runSync");
-  }
-
-  @patch
-  static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
-    throw UnsupportedError("Process.killPid");
-  }
-}
-
-@patch
-class InternetAddress {
-  @patch
-  static InternetAddress get LOOPBACK_IP_V4 {
-    throw UnsupportedError("InternetAddress.LOOPBACK_IP_V4");
-  }
-
-  @patch
-  static InternetAddress get LOOPBACK_IP_V6 {
-    throw UnsupportedError("InternetAddress.LOOPBACK_IP_V6");
-  }
-
-  @patch
-  static InternetAddress get ANY_IP_V4 {
-    throw UnsupportedError("InternetAddress.ANY_IP_V4");
-  }
-
-  @patch
-  static InternetAddress get ANY_IP_V6 {
-    throw UnsupportedError("InternetAddress.ANY_IP_V6");
-  }
-
-  @patch
-  factory InternetAddress(String address, {InternetAddressType? type}) {
-    throw UnsupportedError("InternetAddress");
-  }
-
-  @patch
-  factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType? type}) {
-    throw new UnsupportedError("InternetAddress.fromRawAddress");
-  }
-
-  @patch
-  static Future<List<InternetAddress>> lookup(String host,
-      {InternetAddressType type = InternetAddressType.any}) {
-    throw UnsupportedError("InternetAddress.lookup");
-  }
-
-  @patch
-  static InternetAddress _cloneWithNewHost(
-      InternetAddress address, String host) {
-    throw UnsupportedError("InternetAddress._cloneWithNewHost");
-  }
-
-  @patch
-  static InternetAddress? tryParse(String address) {
-    throw UnsupportedError("InternetAddress.tryParse");
-  }
-}
-
-@patch
-class NetworkInterface {
-  @patch
-  static bool get listSupported {
-    throw UnsupportedError("NetworkInterface.listSupported");
-  }
-
-  @patch
-  static Future<List<NetworkInterface>> list(
-      {bool includeLoopback = false,
-      bool includeLinkLocal = false,
-      InternetAddressType type = InternetAddressType.any}) {
-    throw UnsupportedError("NetworkInterface.list");
-  }
-}
-
-@patch
-class RawServerSocket {
-  @patch
-  static Future<RawServerSocket> bind(address, int port,
-      {int backlog = 0, bool v6Only = false, bool shared = false}) {
-    throw UnsupportedError("RawServerSocket.bind");
-  }
-}
-
-@patch
-class ServerSocket {
-  @patch
-  static Future<ServerSocket> _bind(address, int port,
-      {int backlog = 0, bool v6Only = false, bool shared = false}) {
-    throw UnsupportedError("ServerSocket.bind");
-  }
-}
-
-@patch
-class RawSocket {
-  @patch
-  static Future<RawSocket> connect(dynamic host, int port,
-      {dynamic sourceAddress, Duration? timeout}) {
-    throw UnsupportedError("RawSocket constructor");
-  }
-
-  @patch
-  static Future<ConnectionTask<RawSocket>> startConnect(dynamic host, int port,
-      {dynamic sourceAddress}) {
-    throw UnsupportedError("RawSocket constructor");
-  }
-}
-
-@patch
-class Socket {
-  @patch
-  static Future<Socket> _connect(dynamic host, int port,
-      {dynamic sourceAddress, Duration? timeout}) {
-    throw UnsupportedError("Socket constructor");
-  }
-
-  @patch
-  static Future<ConnectionTask<Socket>> _startConnect(dynamic host, int port,
-      {dynamic sourceAddress}) {
-    throw UnsupportedError("Socket constructor");
-  }
-}
-
-@patch
-class SecureSocket {
-  @patch
-  factory SecureSocket._(RawSecureSocket rawSocket) {
-    throw UnsupportedError("SecureSocket constructor");
-  }
-}
-
-@patch
-class RawSynchronousSocket {
-  @patch
-  static RawSynchronousSocket connectSync(dynamic host, int port) {
-    throw UnsupportedError("RawSynchronousSocket.connectSync");
-  }
-}
-
-@patch
-class RawSocketOption {
-  @patch
-  static int _getOptionValue(int key) {
-    throw UnsupportedError("RawSocketOption._getOptionValue");
-  }
-}
-
-@patch
-class SecurityContext {
-  @patch
-  factory SecurityContext({bool withTrustedRoots = false}) {
-    throw UnsupportedError("SecurityContext constructor");
-  }
-
-  @patch
-  static SecurityContext get defaultContext {
-    throw UnsupportedError("default SecurityContext getter");
-  }
-
-  @patch
-  static bool get alpnSupported {
-    throw UnsupportedError("SecurityContext alpnSupported getter");
-  }
-}
-
-@patch
-class X509Certificate {
-  @patch
-  factory X509Certificate._() {
-    throw UnsupportedError("X509Certificate constructor");
-  }
-}
-
-@patch
-class RawDatagramSocket {
-  @patch
-  static Future<RawDatagramSocket> bind(dynamic host, int port,
-      {bool reuseAddress = true, bool reusePort = false, int ttl = 1}) {
-    throw UnsupportedError("RawDatagramSocket.bind");
-  }
-}
-
-@patch
-class _SecureFilter {
-  @patch
-  factory _SecureFilter._() {
-    throw UnsupportedError("_SecureFilter._SecureFilter");
-  }
-}
-
-@patch
-class _StdIOUtils {
-  @patch
-  static Stdin _getStdioInputStream(int fd) {
-    throw UnsupportedError("StdIOUtils._getStdioInputStream");
-  }
-
-  @patch
-  static _getStdioOutputStream(int fd) {
-    throw UnsupportedError("StdIOUtils._getStdioOutputStream");
-  }
-
-  @patch
-  static int _socketType(Socket socket) {
-    throw UnsupportedError("StdIOUtils._socketType");
-  }
-
-  @patch
-  static _getStdioHandleType(int fd) {
-    throw UnsupportedError("StdIOUtils._getStdioHandleType");
-  }
-}
-
-@patch
-class _WindowsCodePageDecoder {
-  @patch
-  static String _decodeBytes(List<int> bytes) {
-    throw UnsupportedError("_WindowsCodePageDecoder._decodeBytes");
-  }
-}
-
-@patch
-class _WindowsCodePageEncoder {
-  @patch
-  static List<int> _encodeString(String string) {
-    throw UnsupportedError("_WindowsCodePageEncoder._encodeString");
-  }
-}
-
-@patch
-class RawZLibFilter {
-  @patch
-  static RawZLibFilter _makeZLibDeflateFilter(
-      bool gzip,
-      int level,
-      int windowBits,
-      int memLevel,
-      int strategy,
-      List<int>? dictionary,
-      bool raw) {
-    throw UnsupportedError("_newZLibDeflateFilter");
-  }
-
-  @patch
-  static RawZLibFilter _makeZLibInflateFilter(
-      int windowBits, List<int>? dictionary, bool raw) {
-    throw UnsupportedError("_newZLibInflateFilter");
-  }
-}
-
-@patch
-class Stdin {
-  @patch
-  int readByteSync() {
-    throw UnsupportedError("Stdin.readByteSync");
-  }
-
-  @patch
-  bool get echoMode {
-    throw UnsupportedError("Stdin.echoMode");
-  }
-
-  @patch
-  void set echoMode(bool enabled) {
-    throw UnsupportedError("Stdin.echoMode");
-  }
-
-  @patch
-  bool get lineMode {
-    throw UnsupportedError("Stdin.lineMode");
-  }
-
-  @patch
-  void set lineMode(bool enabled) {
-    throw UnsupportedError("Stdin.lineMode");
-  }
-
-  @patch
-  bool get supportsAnsiEscapes {
-    throw UnsupportedError("Stdin.supportsAnsiEscapes");
-  }
-}
-
-@patch
-class Stdout {
-  @patch
-  bool _hasTerminal(int fd) {
-    throw UnsupportedError("Stdout.hasTerminal");
-  }
-
-  @patch
-  int _terminalColumns(int fd) {
-    throw UnsupportedError("Stdout.terminalColumns");
-  }
-
-  @patch
-  int _terminalLines(int fd) {
-    throw UnsupportedError("Stdout.terminalLines");
-  }
-
-  @patch
-  static bool _supportsAnsiEscapes(int fd) {
-    throw UnsupportedError("Stdout.supportsAnsiEscapes");
-  }
-}
-
-@patch
-class _FileSystemWatcher {
-  @patch
-  static Stream<FileSystemEvent> _watch(
-      String path, int events, bool recursive) {
-    throw UnsupportedError("_FileSystemWatcher.watch");
-  }
-
-  @patch
-  static bool get isSupported {
-    throw UnsupportedError("_FileSystemWatcher.isSupported");
-  }
-}
-
-@patch
-class _IOService {
-  @patch
-  static Future _dispatch(int request, List data) {
-    throw UnsupportedError("_IOService._dispatch");
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/isolate_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/isolate_patch.dart
deleted file mode 100644
index 9b45b66..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/isolate_patch.dart
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for the dart:isolate library.
-
-import 'dart:_js_helper' show patch, NoReifyGeneric;
-import 'dart:async';
-import "dart:typed_data" show TypedData;
-
-@patch
-class Isolate {
-  // `current` must be a getter, not just a final field,
-  // to match the external declaration.
-  @patch
-  static Isolate get current => _unsupported();
-
-  @patch
-  String? get debugName => _unsupported();
-
-  @patch
-  static Future<Uri?> get packageRoot => _unsupported();
-
-  @patch
-  static Future<Uri?> get packageConfig => _unsupported();
-
-  @patch
-  static Future<Uri?> resolvePackageUri(Uri packageUri) => _unsupported();
-
-  @patch
-  static Future<Isolate> spawn<T>(void entryPoint(T message), T message,
-          {bool paused = false,
-          bool errorsAreFatal = true,
-          SendPort? onExit,
-          SendPort? onError}) =>
-      _unsupported();
-
-  @patch
-  static Future<Isolate> spawnUri(Uri uri, List<String> args, var message,
-          {bool paused = false,
-          SendPort? onExit,
-          SendPort? onError,
-          bool errorsAreFatal = true,
-          bool? checked,
-          Map<String, String>? environment,
-          Uri? packageRoot,
-          Uri? packageConfig,
-          bool automaticPackageResolution = false,
-          String? debugName}) =>
-      _unsupported();
-
-  @patch
-  void _pause(Capability resumeCapability) => _unsupported();
-
-  @patch
-  void resume(Capability resumeCapability) => _unsupported();
-
-  @patch
-  void addOnExitListener(SendPort responsePort, {Object? response}) =>
-      _unsupported();
-
-  @patch
-  void removeOnExitListener(SendPort responsePort) => _unsupported();
-
-  @patch
-  void setErrorsFatal(bool errorsAreFatal) => _unsupported();
-
-  @patch
-  void kill({int priority = beforeNextEvent}) => _unsupported();
-  @patch
-  void ping(SendPort responsePort,
-          {Object? response, int priority = immediate}) =>
-      _unsupported();
-
-  @patch
-  void addErrorListener(SendPort port) => _unsupported();
-
-  @patch
-  void removeErrorListener(SendPort port) => _unsupported();
-}
-
-/** Default factory for receive ports. */
-@patch
-class ReceivePort {
-  @patch
-  factory ReceivePort() = _ReceivePort;
-
-  @patch
-  factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) =>
-      _unsupported();
-}
-
-/// ReceivePort is supported by dev_compiler because async test packages
-/// (async_helper, unittest) create a dummy receive port to keep the Dart VM
-/// alive.
-class _ReceivePort extends Stream implements ReceivePort {
-  close() {}
-
-  get sendPort => _unsupported();
-
-  StreamSubscription listen(void Function(dynamic)? onData,
-          {Function? onError,
-          void Function()? onDone,
-          bool? cancelOnError = true}) =>
-      _unsupported();
-}
-
-@patch
-class RawReceivePort {
-  @patch
-  factory RawReceivePort([Function? handler]) => _unsupported();
-}
-
-@patch
-class Capability {
-  @patch
-  factory Capability() => _unsupported();
-}
-
-@patch
-abstract class TransferableTypedData {
-  @patch
-  factory TransferableTypedData.fromList(List<TypedData> list) =>
-      _unsupported();
-}
-
-@NoReifyGeneric()
-T _unsupported<T>() {
-  throw UnsupportedError('dart:isolate is not supported on dart4web');
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/js_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/js_patch.dart
deleted file mode 100644
index feb5ef1..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/js_patch.dart
+++ /dev/null
@@ -1,442 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Patch file for dart:js library.
-library dart.js;
-
-import 'dart:collection' show HashMap, ListMixin;
-
-import 'dart:_js_helper' show patch, NoReifyGeneric, Primitives;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_runtime' as dart;
-
-@patch
-JsObject get context => _context;
-
-final JsObject _context = _wrapToDart(dart.global_);
-
-@patch
-class JsObject {
-  // The wrapped JS object.
-  final Object _jsObject;
-
-  // This should only be called from _wrapToDart
-  JsObject._fromJs(this._jsObject) {
-    assert(_jsObject != null);
-  }
-
-  @patch
-  factory JsObject(JsFunction constructor, [List? arguments]) {
-    var ctor = constructor._jsObject;
-    if (arguments == null) {
-      return _wrapToDart(JS('', 'new #()', ctor));
-    }
-    var unwrapped = List.from(arguments.map(_convertToJS));
-    return _wrapToDart(JS('', 'new #(...#)', ctor, unwrapped));
-  }
-
-  @patch
-  factory JsObject.fromBrowserObject(Object object) {
-    if (object is num || object is String || object is bool || object == null) {
-      throw ArgumentError("object cannot be a num, string, bool, or null");
-    }
-    return _wrapToDart(_convertToJS(object)!);
-  }
-
-  @patch
-  factory JsObject.jsify(Object object) {
-    if ((object is! Map) && (object is! Iterable)) {
-      throw ArgumentError("object must be a Map or Iterable");
-    }
-    return _wrapToDart(_convertDataTree(object));
-  }
-
-  static _convertDataTree(Object data) {
-    var _convertedObjects = HashMap.identity();
-
-    _convert(Object? o) {
-      if (_convertedObjects.containsKey(o)) {
-        return _convertedObjects[o];
-      }
-      if (o is Map) {
-        final convertedMap = JS('', '{}');
-        _convertedObjects[o] = convertedMap;
-        for (var key in o.keys) {
-          JS('', '#[#] = #', convertedMap, key, _convert(o[key]));
-        }
-        return convertedMap;
-      } else if (o is Iterable) {
-        var convertedList = [];
-        _convertedObjects[o] = convertedList;
-        convertedList.addAll(o.map(_convert));
-        return convertedList;
-      } else {
-        return _convertToJS(o);
-      }
-    }
-
-    return _convert(data);
-  }
-
-  @patch
-  dynamic operator [](Object property) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    return _convertToDart(JS('', '#[#]', _jsObject, property));
-  }
-
-  @patch
-  void operator []=(Object property, Object? value) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    JS('', '#[#] = #', _jsObject, property, _convertToJS(value));
-  }
-
-  @patch
-  bool operator ==(Object other) =>
-      other is JsObject && JS<bool>('!', '# === #', _jsObject, other._jsObject);
-
-  @patch
-  bool hasProperty(Object property) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    return JS<bool>('!', '# in #', property, _jsObject);
-  }
-
-  @patch
-  void deleteProperty(Object property) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    JS<bool>('!', 'delete #[#]', _jsObject, property);
-  }
-
-  @patch
-  bool instanceof(JsFunction type) {
-    return JS<bool>('!', '# instanceof #', _jsObject, _convertToJS(type));
-  }
-
-  @patch
-  String toString() {
-    try {
-      return JS<String>('!', 'String(#)', _jsObject);
-    } catch (e) {
-      return super.toString();
-    }
-  }
-
-  @patch
-  dynamic callMethod(Object method, [List? args]) {
-    if (method is! String && method is! num) {
-      throw ArgumentError("method is not a String or num");
-    }
-    if (args != null) args = List.from(args.map(_convertToJS));
-    var fn = JS('', '#[#]', _jsObject, method);
-    if (JS<bool>('!', 'typeof(#) !== "function"', fn)) {
-      throw NoSuchMethodError(_jsObject, Symbol('$method'), args, {});
-    }
-    return _convertToDart(JS('', '#.apply(#, #)', fn, _jsObject, args));
-  }
-}
-
-@patch
-class JsFunction extends JsObject {
-  @patch
-  factory JsFunction.withThis(Function f) {
-    return JsFunction._fromJs(JS(
-        '',
-        'function(/*...arguments*/) {'
-            '  let args = [#(this)];'
-            '  for (let arg of arguments) {'
-            '    args.push(#(arg));'
-            '  }'
-            '  return #(#(...args));'
-            '}',
-        _convertToDart,
-        _convertToDart,
-        _convertToJS,
-        f));
-  }
-
-  JsFunction._fromJs(Object jsObject) : super._fromJs(jsObject);
-
-  @patch
-  dynamic apply(List args, {thisArg}) => _convertToDart(JS(
-      '',
-      '#.apply(#, #)',
-      _jsObject,
-      _convertToJS(thisArg),
-      args == null ? null : List.from(args.map(_convertToJS))));
-}
-
-// TODO(jmesserly): this is totally unnecessary in dev_compiler.
-@patch
-class JsArray<E> extends JsObject with ListMixin<E> {
-  @patch
-  factory JsArray() => JsArray<E>._fromJs([]);
-
-  @patch
-  factory JsArray.from(Iterable<E> other) =>
-      JsArray<E>._fromJs([]..addAll(other.map(_convertToJS)));
-
-  JsArray._fromJs(Object jsObject) : super._fromJs(jsObject);
-
-  _checkIndex(int index) {
-    if (index < 0 || index >= length) {
-      throw RangeError.range(index, 0, length);
-    }
-  }
-
-  _checkInsertIndex(int index) {
-    if (index < 0 || index >= length + 1) {
-      throw RangeError.range(index, 0, length);
-    }
-  }
-
-  static _checkRange(int start, int end, int length) {
-    if (start < 0 || start > length) {
-      throw RangeError.range(start, 0, length);
-    }
-    if (end < start || end > length) {
-      throw RangeError.range(end, start, length);
-    }
-  }
-
-  @patch
-  E operator [](Object index) {
-    if (index is int) {
-      _checkIndex(index);
-    }
-    return super[index] as E;
-  }
-
-  @patch
-  void operator []=(Object index, value) {
-    if (index is int) {
-      _checkIndex(index);
-    }
-    super[index] = value;
-  }
-
-  @patch
-  int get length {
-    // Check the length honours the List contract.
-    var len = JS('', '#.length', _jsObject);
-    // JavaScript arrays have lengths which are unsigned 32-bit integers.
-    if (JS<bool>(
-        '!', 'typeof # === "number" && (# >>> 0) === #', len, len, len)) {
-      return JS<int>('!', '#', len);
-    }
-    throw StateError('Bad JsArray length');
-  }
-
-  @patch
-  void set length(int length) {
-    super['length'] = length;
-  }
-
-  @patch
-  void add(E value) {
-    callMethod('push', [value]);
-  }
-
-  @patch
-  void addAll(Iterable<E> iterable) {
-    var list = (JS<bool>('!', '# instanceof Array', iterable))
-        ? JS<List>('', '#', iterable)
-        : List.from(iterable);
-    callMethod('push', list);
-  }
-
-  @patch
-  void insert(int index, E element) {
-    _checkInsertIndex(index);
-    callMethod('splice', [index, 0, element]);
-  }
-
-  @patch
-  E removeAt(int index) {
-    _checkIndex(index);
-    return callMethod('splice', [index, 1])[0] as E;
-  }
-
-  @patch
-  E removeLast() {
-    if (length == 0) throw RangeError(-1);
-    return callMethod('pop') as E;
-  }
-
-  @patch
-  void removeRange(int start, int end) {
-    _checkRange(start, end, length);
-    callMethod('splice', [start, end - start]);
-  }
-
-  @patch
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    _checkRange(start, end, this.length);
-    int length = end - start;
-    if (length == 0) return;
-    if (skipCount < 0) throw ArgumentError(skipCount);
-    var args = <Object?>[start, length]
-      ..addAll(iterable.skip(skipCount).take(length));
-    callMethod('splice', args);
-  }
-
-  @patch
-  void sort([int compare(E a, E b)?]) {
-    // Note: arr.sort(null) is a type error in FF
-    callMethod('sort', compare == null ? [] : [compare]);
-  }
-}
-
-// Cross frame objects should not be considered browser types.
-// We include the instanceof Object test to filter out cross frame objects
-// on FireFox. Surprisingly on FireFox the instanceof Window test succeeds for
-// cross frame windows while the instanceof Object test fails.
-bool _isBrowserType(Object o) => JS(
-    'bool',
-    '# instanceof Object && ('
-        '# instanceof Blob || '
-        '# instanceof Event || '
-        '(window.KeyRange && # instanceof KeyRange) || '
-        '(window.IDBKeyRange && # instanceof IDBKeyRange) || '
-        '# instanceof ImageData || '
-        '# instanceof Node || '
-        '(window.DataView && # instanceof DataView) || '
-        // Int8Array.__proto__ is TypedArray.
-        '(window.Int8Array && # instanceof Int8Array.__proto__) || '
-        '# instanceof Window)',
-    o,
-    o,
-    o,
-    o,
-    o,
-    o,
-    o,
-    o,
-    o,
-    o);
-
-class _DartObject {
-  final Object _dartObj;
-  _DartObject(this._dartObj);
-}
-
-Object? _convertToJS(Object? o) {
-  if (o == null || o is String || o is num || o is bool || _isBrowserType(o)) {
-    return o;
-  } else if (o is DateTime) {
-    return Primitives.lazyAsJsDate(o);
-  } else if (o is JsObject) {
-    return o._jsObject;
-  } else if (o is Function) {
-    return _putIfAbsent(_jsProxies, o, _wrapDartFunction);
-  } else {
-    // TODO(jmesserly): for now, we wrap other objects, to keep compatibility
-    // with the original dart:js behavior.
-    return _putIfAbsent(_jsProxies, o, (o) => _DartObject(o));
-  }
-}
-
-Object _wrapDartFunction(Object f) {
-  var wrapper = JS<Object>(
-      '',
-      'function(/*...arguments*/) {'
-          '  let args = Array.prototype.map.call(arguments, #);'
-          '  return #(#(...args));'
-          '}',
-      _convertToDart,
-      _convertToJS,
-      f);
-  JS('', '#.set(#, #)', _dartProxies, wrapper, f);
-
-  return wrapper;
-}
-
-// converts a Dart object to a reference to a native JS object
-// which might be a DartObject JS->Dart proxy
-Object? _convertToDart(Object? o) {
-  if (o == null || o is String || o is num || o is bool || _isBrowserType(o)) {
-    return o;
-  } else if (JS('!', '# instanceof Date', o)) {
-    int ms = JS('!', '#.getTime()', o);
-    return DateTime.fromMillisecondsSinceEpoch(ms);
-  } else if (o is _DartObject &&
-      !identical(dart.getReifiedType(o), dart.jsobject)) {
-    return o._dartObj;
-  } else {
-    return _wrapToDart(o);
-  }
-}
-
-JsObject _wrapToDart(Object o) =>
-    _putIfAbsent(_dartProxies, o, _wrapToDartHelper);
-
-JsObject _wrapToDartHelper(Object o) {
-  if (JS<bool>('!', 'typeof # == "function"', o)) {
-    return JsFunction._fromJs(o);
-  }
-  if (JS<bool>('!', '# instanceof Array', o)) {
-    return JsArray._fromJs(o);
-  }
-  return JsObject._fromJs(o);
-}
-
-final Object _dartProxies = JS('', 'new WeakMap()');
-final Object _jsProxies = JS('', 'new WeakMap()');
-
-@NoReifyGeneric()
-T _putIfAbsent<T>(Object weakMap, Object o, T getValue(Object o)) {
-  T? value = JS('', '#.get(#)', weakMap, o);
-  if (value == null) {
-    value = getValue(o);
-    JS('', '#.set(#, #)', weakMap, o, value);
-  }
-  // TODO(vsm): Static cast.  Unnecessary?
-  return JS('', '#', value);
-}
-
-Expando<Function> _interopExpando = Expando<Function>();
-
-@patch
-F allowInterop<F extends Function>(F f) {
-  if (!dart.isDartFunction(f)) return f;
-  var ret = _interopExpando[f] as F?;
-  if (ret == null) {
-    ret = JS<F>(
-        '',
-        'function (...args) {'
-            ' return #(#, args);'
-            '}',
-        dart.dcall,
-        f);
-    _interopExpando[f] = ret;
-  }
-  return ret;
-}
-
-Expando<Function> _interopCaptureThisExpando = Expando<Function>();
-
-@patch
-Function allowInteropCaptureThis(Function f) {
-  if (!dart.isDartFunction(f)) return f;
-  var ret = _interopCaptureThisExpando[f];
-  if (ret == null) {
-    ret = JS<Function>(
-        '',
-        'function(...arguments) {'
-            '  let args = [this];'
-            '  args.push.apply(args, arguments);'
-            '  return #(#, args);'
-            '}',
-        dart.dcall,
-        f);
-    _interopCaptureThisExpando[f] = ret;
-  }
-  return ret;
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/math_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/math_patch.dart
deleted file mode 100644
index 288f66e..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/math_patch.dart
+++ /dev/null
@@ -1,348 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for dart:math library.
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show patch, nullCheck, notNull;
-import 'dart:typed_data' show ByteData;
-
-@patch
-@notNull
-T min<T extends num>(@nullCheck T a, @nullCheck T b) =>
-    JS<T>('-dynamic', r'Math.min(#, #)', a, b);
-
-@patch
-@notNull
-T max<T extends num>(@nullCheck T a, @nullCheck T b) =>
-    JS<T>('-dynamic', r'Math.max(#, #)', a, b);
-
-@patch
-@notNull
-double sqrt(@nullCheck num x) => JS<double>('!', r'Math.sqrt(#)', x);
-
-@patch
-@notNull
-double sin(@nullCheck num radians) => JS<double>('!', r'Math.sin(#)', radians);
-
-@patch
-@notNull
-double cos(@nullCheck num radians) => JS<double>('!', r'Math.cos(#)', radians);
-
-@patch
-@notNull
-double tan(@nullCheck num radians) => JS<double>('!', r'Math.tan(#)', radians);
-
-@patch
-@notNull
-double acos(@nullCheck num x) => JS<double>('!', r'Math.acos(#)', x);
-
-@patch
-@notNull
-double asin(@nullCheck num x) => JS<double>('!', r'Math.asin(#)', x);
-
-@patch
-@notNull
-double atan(@nullCheck num x) => JS<double>('!', r'Math.atan(#)', x);
-
-@patch
-@notNull
-double atan2(@nullCheck num a, @nullCheck num b) =>
-    JS<double>('!', r'Math.atan2(#, #)', a, b);
-
-@patch
-@notNull
-double exp(@nullCheck num x) => JS<double>('!', r'Math.exp(#)', x);
-
-@patch
-@notNull
-double log(@nullCheck num x) => JS<double>('!', r'Math.log(#)', x);
-
-@patch
-@notNull
-num pow(@nullCheck num x, @nullCheck num exponent) =>
-    JS<num>('!', r'Math.pow(#, #)', x, exponent);
-
-const int _POW2_32 = 0x100000000;
-
-@patch
-class Random {
-  static Random? _secureRandom;
-
-  @patch
-  factory Random([int? seed]) =>
-      (seed == null) ? const _JSRandom() : _Random(seed);
-
-  @patch
-  factory Random.secure() => _secureRandom ??= _JSSecureRandom();
-}
-
-class _JSRandom implements Random {
-  // The Dart2JS implementation of Random doesn't use a seed.
-  const _JSRandom();
-
-  @notNull
-  int nextInt(int max) {
-    if (max <= 0 || max > _POW2_32) {
-      throw RangeError("max must be in range 0 < max ≤ 2^32, was $max");
-    }
-    return JS<int>("int", "(Math.random() * #) >>> 0", max);
-  }
-
-  /**
-   * Generates a positive random floating point value uniformly distributed on
-   * the range from 0.0, inclusive, to 1.0, exclusive.
-   */
-  @notNull
-  double nextDouble() => JS<double>("double", "Math.random()");
-
-  /**
-   * Generates a random boolean value.
-   */
-  @notNull
-  bool nextBool() => JS<bool>("bool", "Math.random() < 0.5");
-}
-
-class _Random implements Random {
-  // Constants used by the algorithm or masking.
-  static const double _POW2_53_D = 1.0 * (0x20000000000000);
-  static const double _POW2_27_D = 1.0 * (1 << 27);
-  static const int _MASK32 = 0xFFFFFFFF;
-
-  // State comprised of two unsigned 32 bit integers.
-  @notNull
-  int _lo = 0;
-  @notNull
-  int _hi = 0;
-
-  // Implements:
-  //   uint64_t hash = 0;
-  //   do {
-  //      hash = hash * 1037 ^ mix64((uint64_t)seed);
-  //      seed >>= 64;
-  //   } while (seed != 0 && seed != -1);  // Limits for pos/neg seed.
-  //   if (hash == 0) {
-  //     hash = 0x5A17;
-  //   }
-  //   _lo = hash & _MASK_32;
-  //   _hi = hash >> 32;
-  // and then does four _nextState calls to shuffle bits around.
-  _Random(int seed) {
-    int empty_seed = 0;
-    if (seed < 0) {
-      empty_seed = -1;
-    }
-    do {
-      int low = seed & _MASK32;
-      seed = (seed - low) ~/ _POW2_32;
-      int high = seed & _MASK32;
-      seed = (seed - high) ~/ _POW2_32;
-
-      // Thomas Wang's 64-bit mix function.
-      // http://www.concentric.net/~Ttwang/tech/inthash.htm
-      // via. http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
-
-      // key = ~key + (key << 21);
-      int tmplow = low << 21;
-      int tmphigh = (high << 21) | (low >> 11);
-      tmplow = (~low & _MASK32) + tmplow;
-      low = tmplow & _MASK32;
-      high = (~high + tmphigh + ((tmplow - low) ~/ 0x100000000)) & _MASK32;
-      // key = key ^ (key >> 24).
-      tmphigh = high >> 24;
-      tmplow = (low >> 24) | (high << 8);
-      low ^= tmplow;
-      high ^= tmphigh;
-      // key = key * 265
-      tmplow = low * 265;
-      low = tmplow & _MASK32;
-      high = (high * 265 + (tmplow - low) ~/ 0x100000000) & _MASK32;
-      // key = key ^ (key >> 14);
-      tmphigh = high >> 14;
-      tmplow = (low >> 14) | (high << 18);
-      low ^= tmplow;
-      high ^= tmphigh;
-      // key = key * 21
-      tmplow = low * 21;
-      low = tmplow & _MASK32;
-      high = (high * 21 + (tmplow - low) ~/ 0x100000000) & _MASK32;
-      // key = key ^ (key >> 28).
-      tmphigh = high >> 28;
-      tmplow = (low >> 28) | (high << 4);
-      low ^= tmplow;
-      high ^= tmphigh;
-      // key = key + (key << 31);
-      tmplow = low << 31;
-      tmphigh = (high << 31) | (low >> 1);
-      tmplow += low;
-      low = tmplow & _MASK32;
-      high = (high + tmphigh + (tmplow - low) ~/ 0x100000000) & _MASK32;
-      // Mix end.
-
-      // seed = seed * 1037 ^ key;
-      tmplow = _lo * 1037;
-      _lo = tmplow & _MASK32;
-      _hi = (_hi * 1037 + (tmplow - _lo) ~/ 0x100000000) & _MASK32;
-      _lo ^= low;
-      _hi ^= high;
-    } while (seed != empty_seed);
-
-    if (_hi == 0 && _lo == 0) {
-      _lo = 0x5A17;
-    }
-    _nextState();
-    _nextState();
-    _nextState();
-    _nextState();
-  }
-
-  // The algorithm used here is Multiply with Carry (MWC) with a Base b = 2^32.
-  // http://en.wikipedia.org/wiki/Multiply-with-carry
-  // The constant A (0xFFFFDA61) is selected from "Numerical Recipes 3rd
-  // Edition" p.348 B1.
-
-  // Implements:
-  //   var state = (A * _lo + _hi) & _MASK_64;
-  //   _lo = state & _MASK_32;
-  //   _hi = state >> 32;
-  void _nextState() {
-    // Simulate (0xFFFFDA61 * lo + hi) without overflowing 53 bits.
-    int tmpHi = 0xFFFF0000 * _lo; // At most 48 bits of significant result.
-    int tmpHiLo = tmpHi & _MASK32; // Get the lower 32 bits.
-    int tmpHiHi = tmpHi - tmpHiLo; // And just the upper 32 bits.
-    int tmpLo = 0xDA61 * _lo;
-    int tmpLoLo = tmpLo & _MASK32;
-    int tmpLoHi = tmpLo - tmpLoLo;
-
-    int newLo = tmpLoLo + tmpHiLo + _hi;
-    _lo = newLo & _MASK32;
-    int newLoHi = newLo - _lo;
-    _hi = ((tmpLoHi + tmpHiHi + newLoHi) ~/ _POW2_32) & _MASK32;
-    assert(_lo < _POW2_32);
-    assert(_hi < _POW2_32);
-  }
-
-  @notNull
-  int nextInt(@nullCheck int max) {
-    if (max <= 0 || max > _POW2_32) {
-      throw RangeError("max must be in range 0 < max ≤ 2^32, was $max");
-    }
-    if ((max & (max - 1)) == 0) {
-      // Fast case for powers of two.
-      _nextState();
-      return _lo & (max - 1);
-    }
-
-    int rnd32;
-    int result;
-    do {
-      _nextState();
-      rnd32 = _lo;
-      result = rnd32.remainder(max).toInt(); // % max;
-    } while ((rnd32 - result + max) >= _POW2_32);
-    return result;
-  }
-
-  @notNull
-  double nextDouble() {
-    _nextState();
-    int bits26 = _lo & ((1 << 26) - 1);
-    _nextState();
-    int bits27 = _lo & ((1 << 27) - 1);
-    return (bits26 * _POW2_27_D + bits27) / _POW2_53_D;
-  }
-
-  @notNull
-  bool nextBool() {
-    _nextState();
-    return (_lo & 1) == 0;
-  }
-}
-
-class _JSSecureRandom implements Random {
-  // Reused buffer with room enough for a double.
-  final _buffer = ByteData(8);
-
-  _JSSecureRandom() {
-    var crypto = JS("", "self.crypto");
-    if (crypto != null) {
-      var getRandomValues = JS("", "#.getRandomValues", crypto);
-      if (getRandomValues != null) {
-        return;
-      }
-    }
-    throw UnsupportedError(
-        "No source of cryptographically secure random numbers available.");
-  }
-
-  /// Fill _buffer from [start] to `start + length` with random bytes.
-  void _getRandomBytes(int start, int length) {
-    JS("void", "crypto.getRandomValues(#)",
-        _buffer.buffer.asUint8List(start, length));
-  }
-
-  @notNull
-  bool nextBool() {
-    _getRandomBytes(0, 1);
-    return _buffer.getUint8(0).isOdd;
-  }
-
-  @notNull
-  double nextDouble() {
-    _getRandomBytes(1, 7);
-    // Set top bits 12 of double to 0x3FF which is the exponent for numbers
-    // between 1.0 and 2.0.
-    _buffer.setUint8(0, 0x3F);
-    int highByte = _buffer.getUint8(1);
-    _buffer.setUint8(1, highByte | 0xF0);
-
-    // Buffer now contains double in the range [1.0-2.0)
-    // with 52 bits of entropy (not 53).
-    // To get 53 bits, we extract the 53rd bit from higthByte before
-    // overwriting it, and add that as a least significant bit.
-    // The getFloat64 method is big-endian as default.
-    double result = _buffer.getFloat64(0) - 1.0;
-    if (highByte & 0x10 != 0) {
-      result += 1.1102230246251565e-16; // pow(2,-53).
-    }
-    return result;
-  }
-
-  @notNull
-  int nextInt(@nullCheck int max) {
-    if (max <= 0 || max > _POW2_32) {
-      throw RangeError("max must be in range 0 < max ≤ 2^32, was $max");
-    }
-    int byteCount = 1;
-    if (max > 0xFF) {
-      byteCount++;
-      if (max > 0xFFFF) {
-        byteCount++;
-        if (max > 0xFFFFFF) {
-          byteCount++;
-        }
-      }
-    }
-    _buffer.setUint32(0, 0);
-    int start = 4 - byteCount;
-    int randomLimit = pow(256, byteCount).toInt();
-    while (true) {
-      _getRandomBytes(start, byteCount);
-      // The getUint32 method is big-endian as default.
-      int random = _buffer.getUint32(0);
-      if (max & (max - 1) == 0) {
-        // Max is power of 2.
-        return random & (max - 1);
-      }
-      int result = random.remainder(max).toInt();
-      // Ensure results have equal probability by rejecting values in the
-      // last range of k*max .. 256**byteCount.
-      // TODO: Consider picking a higher byte count if the last range is a
-      // significant portion of the entire range - a 50% chance of having
-      // to use two more bytes is no worse than always using one more.
-      if (random - result + max < randomLimit) {
-        return result;
-      }
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart
deleted file mode 100644
index d1c6a1a..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/patch/typed_data_patch.dart
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:_js_helper' show patch;
-import 'dart:_native_typed_data';
-
-@patch
-class ByteData {
-  @patch
-  factory ByteData(int length) = NativeByteData;
-}
-
-@patch
-class Float32List {
-  @patch
-  factory Float32List(int length) = NativeFloat32List;
-
-  @patch
-  factory Float32List.fromList(List<double> elements) =
-      NativeFloat32List.fromList;
-}
-
-@patch
-class Float64List {
-  @patch
-  factory Float64List(int length) = NativeFloat64List;
-
-  @patch
-  factory Float64List.fromList(List<double> elements) =
-      NativeFloat64List.fromList;
-}
-
-@patch
-class Int16List {
-  @patch
-  factory Int16List(int length) = NativeInt16List;
-
-  @patch
-  factory Int16List.fromList(List<int> elements) = NativeInt16List.fromList;
-}
-
-@patch
-class Int32List {
-  @patch
-  factory Int32List(int length) = NativeInt32List;
-
-  @patch
-  factory Int32List.fromList(List<int> elements) = NativeInt32List.fromList;
-}
-
-@patch
-class Int8List {
-  @patch
-  factory Int8List(int length) = NativeInt8List;
-
-  @patch
-  factory Int8List.fromList(List<int> elements) = NativeInt8List.fromList;
-}
-
-@patch
-class Uint32List {
-  @patch
-  factory Uint32List(int length) = NativeUint32List;
-
-  @patch
-  factory Uint32List.fromList(List<int> elements) = NativeUint32List.fromList;
-}
-
-@patch
-class Uint16List {
-  @patch
-  factory Uint16List(int length) = NativeUint16List;
-
-  @patch
-  factory Uint16List.fromList(List<int> elements) = NativeUint16List.fromList;
-}
-
-@patch
-class Uint8ClampedList {
-  @patch
-  factory Uint8ClampedList(int length) = NativeUint8ClampedList;
-
-  @patch
-  factory Uint8ClampedList.fromList(List<int> elements) =
-      NativeUint8ClampedList.fromList;
-}
-
-@patch
-class Uint8List {
-  @patch
-  factory Uint8List(int length) = NativeUint8List;
-
-  @patch
-  factory Uint8List.fromList(List<int> elements) = NativeUint8List.fromList;
-}
-
-@patch
-class Int64List {
-  @patch
-  factory Int64List(int length) {
-    throw UnsupportedError("Int64List not supported on the web.");
-  }
-
-  @patch
-  factory Int64List.fromList(List<int> elements) {
-    throw UnsupportedError("Int64List not supported on the web.");
-  }
-}
-
-@patch
-class Uint64List {
-  @patch
-  factory Uint64List(int length) {
-    throw UnsupportedError("Uint64List not supported on the web.");
-  }
-
-  @patch
-  factory Uint64List.fromList(List<int> elements) {
-    throw UnsupportedError("Uint64List not supported on the web.");
-  }
-}
-
-@patch
-class Int32x4List {
-  @patch
-  factory Int32x4List(int length) = NativeInt32x4List;
-
-  @patch
-  factory Int32x4List.fromList(List<Int32x4> elements) =
-      NativeInt32x4List.fromList;
-}
-
-@patch
-class Float32x4List {
-  @patch
-  factory Float32x4List(int length) = NativeFloat32x4List;
-
-  @patch
-  factory Float32x4List.fromList(List<Float32x4> elements) =
-      NativeFloat32x4List.fromList;
-}
-
-@patch
-class Float64x2List {
-  @patch
-  factory Float64x2List(int length) = NativeFloat64x2List;
-
-  @patch
-  factory Float64x2List.fromList(List<Float64x2> elements) =
-      NativeFloat64x2List.fromList;
-}
-
-@patch
-class Float32x4 {
-  @patch
-  factory Float32x4(double x, double y, double z, double w) = NativeFloat32x4;
-  @patch
-  factory Float32x4.splat(double v) = NativeFloat32x4.splat;
-  @patch
-  factory Float32x4.zero() = NativeFloat32x4.zero;
-  @patch
-  factory Float32x4.fromInt32x4Bits(Int32x4 x) =
-      NativeFloat32x4.fromInt32x4Bits;
-  @patch
-  factory Float32x4.fromFloat64x2(Float64x2 v) = NativeFloat32x4.fromFloat64x2;
-}
-
-@patch
-class Int32x4 {
-  @patch
-  factory Int32x4(int x, int y, int z, int w) = NativeInt32x4;
-  @patch
-  factory Int32x4.bool(bool x, bool y, bool z, bool w) = NativeInt32x4.bool;
-  @patch
-  factory Int32x4.fromFloat32x4Bits(Float32x4 x) =
-      NativeInt32x4.fromFloat32x4Bits;
-}
-
-@patch
-class Float64x2 {
-  @patch
-  factory Float64x2(double x, double y) = NativeFloat64x2;
-  @patch
-  factory Float64x2.splat(double v) = NativeFloat64x2.splat;
-  @patch
-  factory Float64x2.zero() = NativeFloat64x2.zero;
-  @patch
-  factory Float64x2.fromFloat32x4(Float32x4 v) = NativeFloat64x2.fromFloat32x4;
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/annotations.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/annotations.dart
deleted file mode 100644
index 9062f31..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/annotations.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._js_helper;
-
-/// Tells the optimizing compiler to always inline the annotated method.
-class ForceInline {
-  const ForceInline();
-}
-
-class _NotNull {
-  const _NotNull();
-}
-
-/// Marks a variable or API to be non-nullable.
-/// ****CAUTION******
-/// This is currently unchecked, and hence should never be used
-/// on any public interface where user code could subclass, implement,
-/// or otherwise cause the contract to be violated.
-/// TODO(leafp): Consider adding static checking and exposing
-/// this to user code.
-const notNull = _NotNull();
-
-/// Marks a generic function or static method API to be not reified.
-/// ****CAUTION******
-/// This is currently unchecked, and hence should be used very carefully for
-/// internal SDK APIs only.
-class NoReifyGeneric {
-  const NoReifyGeneric();
-}
-
-/// Enables/disables reification of functions within the body of this function.
-/// ****CAUTION******
-/// This is currently unchecked, and hence should be used very carefully for
-/// internal SDK APIs only.
-class ReifyFunctionTypes {
-  final bool value;
-  const ReifyFunctionTypes(this.value);
-}
-
-class _NullCheck {
-  const _NullCheck();
-}
-
-/// Annotation indicating the parameter should default to the JavaScript
-/// undefined constant.
-const undefined = _Undefined();
-
-class _Undefined {
-  const _Undefined();
-}
-
-/// Tells the development compiler to check a variable for null at its
-/// declaration point, and then to assume that the variable is non-null
-/// from that point forward.
-/// ****CAUTION******
-/// This is currently unchecked, and hence will not catch re-assignments
-/// of a variable with null
-const nullCheck = _NullCheck();
-
-/// Tells the optimizing compiler that the annotated method cannot throw.
-/// Requires @NoInline() to function correctly.
-class NoThrows {
-  const NoThrows();
-}
-
-/// Tells the optimizing compiler to not inline the annotated method.
-class NoInline {
-  const NoInline();
-}
-
-/// Marks a class as native and defines its JavaScript name(s).
-class Native {
-  final String name;
-  const Native(this.name);
-}
-
-class JsPeerInterface {
-  /// The JavaScript type that we should match the API of.
-  /// Used for classes where Dart subclasses should be callable from JavaScript
-  /// matching the JavaScript calling conventions.
-  final String name;
-  const JsPeerInterface({required this.name});
-}
-
-/// A Dart interface may only be implemented by a native JavaScript object
-/// if it is marked with this annotation.
-class SupportJsExtensionMethods {
-  const SupportJsExtensionMethods();
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/custom_hash_map.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/custom_hash_map.dart
deleted file mode 100644
index 14444e3..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/custom_hash_map.dart
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart._js_helper;
-
-class CustomKeyHashMap<K, V> extends CustomHashMap<K, V> {
-  final _Predicate<Object?> _validKey;
-  CustomKeyHashMap(_Equality<K> equals, _Hasher<K> hashCode, this._validKey)
-      : super(equals, hashCode);
-
-  @override
-  @notNull
-  bool containsKey(Object? key) {
-    if (!_validKey(key)) return false;
-    return super.containsKey(key);
-  }
-
-  @override
-  V? operator [](Object? key) {
-    if (!_validKey(key)) return null;
-    return super[key];
-  }
-
-  @override
-  V? remove(Object? key) {
-    if (!_validKey(key)) return null;
-    return super.remove(key);
-  }
-}
-
-class CustomHashMap<K, V> extends InternalMap<K, V> {
-  /// The backing store for this map.
-  @notNull
-  final _map = JS('', 'new Map()');
-
-  /// Our map used to map keys onto the canonical key that is stored in [_map].
-  @notNull
-  final _keyMap = JS('', 'new Map()');
-
-  // We track the number of modifications done to the key set of the
-  // hash map to be able to throw when the map is modified while being
-  // iterated over.
-  //
-  // Value cycles after 2^30 modifications so that modification counts are
-  // always unboxed (Smi) values. Modification detection will be missed if you
-  // make exactly some multiple of 2^30 modifications between advances of an
-  // iterator.
-  @notNull
-  int _modifications = 0;
-
-  final _Equality<K> _equals;
-  final _Hasher<K> _hashCode;
-
-  CustomHashMap(this._equals, this._hashCode);
-
-  @notNull
-  int get length => JS<int>('!', '#.size', _map);
-
-  @notNull
-  bool get isEmpty => JS<bool>('!', '#.size == 0', _map);
-
-  @notNull
-  bool get isNotEmpty => JS<bool>('!', '#.size != 0', _map);
-
-  Iterable<K> get keys => _JSMapIterable<K>(this, true);
-  Iterable<V> get values => _JSMapIterable<V>(this, false);
-
-  @notNull
-  bool containsKey(Object? key) {
-    if (key is K) {
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
-      if (buckets != null) {
-        var equals = _equals;
-        for (int i = 0, n = JS<int>('!', '#.length', buckets); i < n; i++) {
-          K k = JS('', '#[#]', buckets, i);
-          if (equals(k, key)) return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  bool containsValue(Object? value) {
-    for (var v in JS('', '#.values()', _map)) {
-      if (value == v) return true;
-    }
-    return false;
-  }
-
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      this[key] = value;
-    });
-  }
-
-  V? operator [](Object? key) {
-    if (key is K) {
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, _hashCode(key));
-      if (buckets != null) {
-        var equals = _equals;
-        for (int i = 0, n = JS<int>('!', '#.length', buckets); i < n; i++) {
-          K k = JS('', '#[#]', buckets, i);
-          if (equals(k, key)) {
-            V value = JS('', '#.get(#)', _map, k);
-            return value == null ? null : value; // coerce undefined to null.
-          }
-        }
-      }
-    }
-    return null;
-  }
-
-  void operator []=(K key, V value) {
-    var keyMap = _keyMap;
-    int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
-    var buckets = JS('', '#.get(#)', keyMap, hash);
-    if (buckets == null) {
-      JS('', '#.set(#, [#])', keyMap, hash, key);
-    } else {
-      var equals = _equals;
-      for (int i = 0, n = JS<int>('!', '#.length', buckets);;) {
-        K k = JS('', '#[#]', buckets, i);
-        if (equals(k, key)) {
-          key = k;
-          break;
-        }
-        if (++i >= n) {
-          JS('', '#.push(#)', buckets, key);
-          break;
-        }
-      }
-    }
-    JS('', '#.set(#, #)', _map, key, value);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    var keyMap = _keyMap;
-    int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
-    var buckets = JS('', '#.get(#)', keyMap, hash);
-    if (buckets == null) {
-      JS('', '#.set(#, [#])', keyMap, hash, key);
-    } else {
-      var equals = _equals;
-      for (int i = 0, n = JS<int>('!', '#.length', buckets); i < n; i++) {
-        K k = JS('', '#[#]', buckets, i);
-        if (equals(k, key)) return JS('', '#.get(#)', _map, k);
-      }
-      JS('', '#.push(#)', buckets, key);
-    }
-    V value = ifAbsent();
-    if (value == null) JS('', '# = null', value); // coerce undefined to null.
-    JS('', '#.set(#, #)', _map, key, value);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-    return value;
-  }
-
-  V? remove(Object? key) {
-    if (key is K) {
-      int hash = JS('!', '# & 0x3ffffff', _hashCode(key));
-      var keyMap = _keyMap;
-      var buckets = JS('', '#.get(#)', keyMap, hash);
-      if (buckets == null) return null; // not found
-      var equals = _equals;
-      for (int i = 0, n = JS<int>('!', '#.length', buckets); i < n; i++) {
-        K k = JS('', '#[#]', buckets, i);
-        if (equals(k, key)) {
-          if (n == 1) {
-            JS('', '#.delete(#)', keyMap, hash);
-          } else {
-            JS('', '#.splice(#, 1)', buckets, i);
-          }
-          var map = _map;
-          V value = JS('', '#.get(#)', map, k);
-          JS('', '#.delete(#)', map, k);
-          _modifications = (_modifications + 1) & 0x3ffffff;
-          return value == null ? null : value; // coerce undefined to null.
-        }
-      }
-    }
-    return null;
-  }
-
-  void clear() {
-    var map = _map;
-    if (JS<int>('!', '#.size', map) > 0) {
-      JS('', '#.clear()', map);
-      JS('', '#.clear()', _keyMap);
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-}
-
-typedef bool _Equality<K>(K a, K b);
-typedef int _Hasher<K>(K object);
-typedef bool _Predicate<T>(T value);
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart
deleted file mode 100644
index bb58063..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart
+++ /dev/null
@@ -1,595 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// This library defines the operations that define and manipulate Dart
-/// classes.  Included in this are:
-///   - Generics
-///   - Class metadata
-///   - Extension methods
-///
-
-// TODO(leafp): Consider splitting some of this out.
-part of dart._runtime;
-
-/// Returns a new type that mixes members from base and the mixin.
-void applyMixin(to, from) {
-  JS('', '#[#] = #', to, _mixin, from);
-  var toProto = JS('', '#.prototype', to);
-  var fromProto = JS('', '#.prototype', from);
-  _copyMembers(toProto, fromProto);
-  _mixinSignature(to, from, _methodSig);
-  _mixinSignature(to, from, _fieldSig);
-  _mixinSignature(to, from, _getterSig);
-  _mixinSignature(to, from, _setterSig);
-  var mixinOnFn = JS('', '#[#]', from, mixinOn);
-  if (mixinOnFn != null) {
-    var proto = JS('', '#(#.__proto__).prototype', mixinOnFn, to);
-    _copyMembers(toProto, proto);
-  }
-}
-
-void _copyMembers(to, from) {
-  var names = getOwnNamesAndSymbols(from);
-  for (int i = 0, n = JS('!', '#.length', names); i < n; ++i) {
-    String name = JS('', '#[#]', names, i);
-    if (name == 'constructor') continue;
-    _copyMember(to, from, name);
-  }
-  return to;
-}
-
-void _copyMember(to, from, name) {
-  var desc = getOwnPropertyDescriptor(from, name);
-  if (JS('!', '# == Symbol.iterator', name)) {
-    // On native types, Symbol.iterator may already be present.
-    // TODO(jmesserly): investigate if we still need this.
-    // If so, we need to find a better solution.
-    // See https://github.com/dart-lang/sdk/issues/28324
-    var existing = getOwnPropertyDescriptor(to, name);
-    if (existing != null) {
-      if (JS('!', '#.writable', existing)) {
-        JS('', '#[#] = #.value', to, name, desc);
-      }
-      return;
-    }
-  }
-  var getter = JS('', '#.get', desc);
-  var setter = JS('', '#.set', desc);
-  if (getter != null) {
-    if (setter == null) {
-      var obj = JS<Object>(
-          '!',
-          '#.set = { __proto__: #.__proto__, '
-              'set [#](x) { return super[#] = x; } }',
-          desc,
-          to,
-          name,
-          name);
-      JS<Object>(
-          '!', '#.set = #.set', desc, getOwnPropertyDescriptor(obj, name));
-    }
-  } else if (setter != null) {
-    if (getter == null) {
-      var obj = JS<Object>(
-          '!',
-          '#.get = { __proto__: #.__proto__, '
-              'get [#]() { return super[#]; } }',
-          desc,
-          to,
-          name,
-          name);
-      JS<Object>(
-          '!', '#.get = #.get', desc, getOwnPropertyDescriptor(obj, name));
-    }
-  }
-  defineProperty(to, name, desc);
-}
-
-void _mixinSignature(to, from, kind) {
-  JS('', '#[#] = #', to, kind, () {
-    var baseMembers = _getMembers(JS('', '#.__proto__', to), kind);
-    var fromMembers = _getMembers(from, kind);
-    if (fromMembers == null) return baseMembers;
-    var toSignature = JS('', '{ __proto__: # }', baseMembers);
-    copyProperties(toSignature, fromMembers);
-    return toSignature;
-  });
-}
-
-final _mixin = JS('', 'Symbol("mixin")');
-
-getMixin(clazz) => JS('', 'Object.hasOwnProperty.call(#, #) ? #[#] : null',
-    clazz, _mixin, clazz, _mixin);
-
-final mixinOn = JS('', 'Symbol("mixinOn")');
-
-@JSExportName('implements')
-final implements_ = JS('', 'Symbol("implements")');
-
-List? Function() getImplements(clazz) => JS(
-    '',
-    'Object.hasOwnProperty.call(#, #) ? #[#] : null',
-    clazz,
-    implements_,
-    clazz,
-    implements_);
-
-/// The Symbol for storing type arguments on a specialized generic type.
-final _typeArguments = JS('', 'Symbol("typeArguments")');
-
-final _variances = JS('', 'Symbol("variances")');
-
-final _originalDeclaration = JS('', 'Symbol("originalDeclaration")');
-
-final mixinNew = JS('', 'Symbol("dart.mixinNew")');
-
-/// Normalizes `FutureOr` types when they are constructed at runtime.
-///
-/// This normalization should mirror the normalization performed at compile time
-/// in the method named `_normalizeFutureOr()`.
-///
-/// **NOTE** Normalization of FutureOr<T?>? --> FutureOr<T?> is handled in
-/// [nullable].
-normalizeFutureOr(typeConstructor, setBaseClass) {
-  // The canonical version of the generic FutureOr type constructor.
-  var genericFutureOrType =
-      JS('!', '#', generic(typeConstructor, setBaseClass));
-
-  normalize(typeArg) {
-    // Normalize raw FutureOr --> dynamic
-    if (JS<bool>('!', '# == void 0', typeArg)) return _dynamic;
-
-    // FutureOr<dynamic|void|Object?|Object*|Object> -->
-    //   dynamic|void|Object?|Object*|Object
-    if (_isTop(typeArg) ||
-        _equalType(typeArg, Object) ||
-        (_jsInstanceOf(typeArg, LegacyType) &&
-            JS<bool>('!', '#.type === #', typeArg, Object))) {
-      return typeArg;
-    }
-
-    // FutureOr<Never> --> Future<Never>
-    if (_equalType(typeArg, Never)) {
-      return JS('!', '#(#)', getGenericClass(Future), typeArg);
-    }
-    // FutureOr<Null> --> Future<Null>?
-    if (_equalType(typeArg, Null)) {
-      return nullable(JS('!', '#(#)', getGenericClass(Future), typeArg));
-    }
-    // Otherwise, create the FutureOr<T> type as a normal generic type.
-    var genericType = JS('!', '#(#)', genericFutureOrType, typeArg);
-    // Overwrite the original declaration so that it correctly points back to
-    // this method. This ensures that the we can test a type value returned here
-    // as a FutureOr because it is equal to 'async.FutureOr` (in the JS).
-    JS('!', '#[#] = #', genericType, _originalDeclaration, normalize);
-    JS('!', '#(#)', addTypeCaches, genericType);
-    return genericType;
-  }
-
-  return normalize;
-}
-
-/// Memoize a generic type constructor function.
-generic(typeConstructor, setBaseClass) => JS('', '''(() => {
-  let length = $typeConstructor.length;
-  if (length < 1) {
-    $throwInternalError('must have at least one generic type argument');
-  }
-  let resultMap = new Map();
-  // TODO(vsm): Rethink how to clear the resultMap on hot restart.
-  // A simple clear via:
-  //   _cacheMaps.push(resultMap);
-  // will break (a) we hoist type expressions in generated code and
-  // (b) we don't clear those type expressions in the presence of a
-  // hot restart.  Not clearing this map (as we're doing now) should
-  // not affect correctness, but can result in a memory leak across
-  // multiple restarts.
-  function makeGenericType(...args) {
-    if (args.length != length && args.length != 0) {
-      $throwInternalError('requires ' + length + ' or 0 type arguments');
-    }
-    while (args.length < length) args.push($dynamic);
-
-    let value = resultMap;
-    for (let i = 0; i < length; i++) {
-      let arg = args[i];
-      if (arg == null) {
-        $throwInternalError('type arguments should not be null: '
-                          + $typeConstructor);
-      }
-      let map = value;
-      value = map.get(arg);
-      if (value === void 0) {
-        if (i + 1 == length) {
-          value = $typeConstructor.apply(null, args);
-          // Save the type constructor and arguments for reflection.
-          if (value) {
-            value[$_typeArguments] = args;
-            value[$_originalDeclaration] = makeGenericType;
-          }
-          map.set(arg, value);
-          if ($setBaseClass != null) $setBaseClass.apply(null, args);
-        } else {
-          value = new Map();
-          map.set(arg, value);
-        }
-      }
-    }
-    return value;
-  }
-  makeGenericType[$_genericTypeCtor] = $typeConstructor;
-  $addTypeCaches(makeGenericType);
-  return makeGenericType;
-})()''');
-
-getGenericClass(type) => safeGetOwnProperty(type, _originalDeclaration);
-
-// TODO(markzipan): Make this non-nullable if we can ensure this returns
-// an empty list or if null and the empty list are semantically the same.
-List? getGenericArgs(type) =>
-    JS<List>('', '#', safeGetOwnProperty(type, _typeArguments));
-
-List? getGenericArgVariances(type) =>
-    JS<List?>('', '#', safeGetOwnProperty(type, _variances));
-
-void setGenericArgVariances(f, variances) =>
-    JS('', '#[#] = #', f, _variances, variances);
-
-List<TypeVariable> getGenericTypeFormals(genericClass) {
-  return _typeFormalsFromFunction(getGenericTypeCtor(genericClass));
-}
-
-Object instantiateClass(Object genericClass, List<Object> typeArgs) {
-  return JS('', '#.apply(null, #)', genericClass, typeArgs);
-}
-
-final _constructorSig = JS('', 'Symbol("sigCtor")');
-final _methodSig = JS('', 'Symbol("sigMethod")');
-final _fieldSig = JS('', 'Symbol("sigField")');
-final _getterSig = JS('', 'Symbol("sigGetter")');
-final _setterSig = JS('', 'Symbol("sigSetter")');
-final _staticMethodSig = JS('', 'Symbol("sigStaticMethod")');
-final _staticFieldSig = JS('', 'Symbol("sigStaticField")');
-final _staticGetterSig = JS('', 'Symbol("sigStaticGetter")');
-final _staticSetterSig = JS('', 'Symbol("sigStaticSetter")');
-final _genericTypeCtor = JS('', 'Symbol("genericType")');
-final _libraryUri = JS('', 'Symbol("libraryUri")');
-
-getConstructors(value) => _getMembers(value, _constructorSig);
-getMethods(value) => _getMembers(value, _methodSig);
-getFields(value) => _getMembers(value, _fieldSig);
-getGetters(value) => _getMembers(value, _getterSig);
-getSetters(value) => _getMembers(value, _setterSig);
-getStaticMethods(value) => _getMembers(value, _staticMethodSig);
-getStaticFields(value) => _getMembers(value, _staticFieldSig);
-getStaticGetters(value) => _getMembers(value, _staticGetterSig);
-getStaticSetters(value) => _getMembers(value, _staticSetterSig);
-
-getGenericTypeCtor(value) => JS('', '#[#]', value, _genericTypeCtor);
-
-/// Get the type of a method from an object using the stored signature
-getType(obj) =>
-    JS('', '# == null ? # : #.__proto__.constructor', obj, Object, obj);
-
-getLibraryUri(value) => JS('', '#[#]', value, _libraryUri);
-setLibraryUri(f, uri) => JS('', '#[#] = #', f, _libraryUri, uri);
-
-bool isJsInterop(obj) {
-  if (obj == null) return false;
-  if (JS('!', 'typeof # === "function"', obj)) {
-    // A function is a Dart function if it has runtime type information.
-    return JS('!', '#[#] == null', obj, _runtimeType);
-  }
-  // Primitive types are not JS interop types.
-  if (JS('!', 'typeof # !== "object"', obj)) return false;
-
-  // Extension types are not considered JS interop types.
-  // Note that it is still possible to call typed JS interop methods on
-  // extension types but the calls must be statically typed.
-  if (JS('!', '#[#] != null', obj, _extensionType)) return false;
-  return !_jsInstanceOf(obj, Object);
-}
-
-/// Get the type of a method from a type using the stored signature
-getMethodType(type, name) {
-  var m = getMethods(type);
-  return m != null ? JS('', '#[#]', m, name) : null;
-}
-
-/// Gets the type of the corresponding setter (this includes writable fields).
-getSetterType(type, name) {
-  var setters = getSetters(type);
-  if (setters != null) {
-    var type = JS('', '#[#]', setters, name);
-    if (type != null) {
-      return type;
-    }
-  }
-  var fields = getFields(type);
-  if (fields != null) {
-    var fieldInfo = JS('', '#[#]', fields, name);
-    if (fieldInfo != null && JS<bool>('!', '!#.isFinal', fieldInfo)) {
-      return JS('', '#.type', fieldInfo);
-    }
-  }
-  return null;
-}
-
-finalFieldType(type, metadata) =>
-    JS('', '{ type: #, isFinal: true, metadata: # }', type, metadata);
-
-fieldType(type, metadata) =>
-    JS('', '{ type: #, isFinal: false, metadata: # }', type, metadata);
-
-/// Get the type of a constructor from a class using the stored signature
-/// If name is undefined, returns the type of the default constructor
-/// Returns undefined if the constructor is not found.
-classGetConstructorType(cls, name) {
-  if (cls == null) return null;
-  if (name == null) name = 'new';
-  var ctors = getConstructors(cls);
-  return ctors != null ? JS('', '#[#]', ctors, name) : null;
-}
-
-void setMethodSignature(f, sigF) => JS('', '#[#] = #', f, _methodSig, sigF);
-void setFieldSignature(f, sigF) => JS('', '#[#] = #', f, _fieldSig, sigF);
-void setGetterSignature(f, sigF) => JS('', '#[#] = #', f, _getterSig, sigF);
-void setSetterSignature(f, sigF) => JS('', '#[#] = #', f, _setterSig, sigF);
-
-// Set up the constructor signature field on the constructor
-void setConstructorSignature(f, sigF) =>
-    JS('', '#[#] = #', f, _constructorSig, sigF);
-
-// Set up the static signature field on the constructor
-void setStaticMethodSignature(f, sigF) =>
-    JS('', '#[#] = #', f, _staticMethodSig, sigF);
-
-void setStaticFieldSignature(f, sigF) =>
-    JS('', '#[#] = #', f, _staticFieldSig, sigF);
-
-void setStaticGetterSignature(f, sigF) =>
-    JS('', '#[#] = #', f, _staticGetterSig, sigF);
-
-void setStaticSetterSignature(f, sigF) =>
-    JS('', '#[#] = #', f, _staticSetterSig, sigF);
-
-_getMembers(type, kind) {
-  var sig = JS('', '#[#]', type, kind);
-  return JS<bool>('!', 'typeof # == "function"', sig)
-      ? JS('', '#[#] = #()', type, kind, sig)
-      : sig;
-}
-
-bool _hasMember(type, kind, name) {
-  var sig = _getMembers(type, kind);
-  return sig != null && JS<bool>('!', '# in #', name, sig);
-}
-
-bool hasMethod(type, name) => _hasMember(type, _methodSig, name);
-bool hasGetter(type, name) => _hasMember(type, _getterSig, name);
-bool hasSetter(type, name) => _hasMember(type, _setterSig, name);
-bool hasField(type, name) => _hasMember(type, _fieldSig, name);
-
-final _extensionType = JS('', 'Symbol("extensionType")');
-
-final dartx = JS('', 'dartx');
-
-/// Install properties in prototype-first order.  Properties / descriptors from
-/// more specific types should overwrite ones from less specific types.
-void _installProperties(jsProto, dartType, installedParent) {
-  if (JS('!', '# === #', dartType, Object)) {
-    _installPropertiesForObject(jsProto);
-    return;
-  }
-  // If the extension methods of the parent have been installed on the parent
-  // of [jsProto], the methods will be available via prototype inheritance.
-  var dartSupertype = JS<Object>('!', '#.__proto__', dartType);
-  if (JS('!', '# !== #', dartSupertype, installedParent)) {
-    _installProperties(jsProto, dartSupertype, installedParent);
-  }
-
-  var dartProto = JS<Object>('!', '#.prototype', dartType);
-  copyTheseProperties(jsProto, dartProto, getOwnPropertySymbols(dartProto));
-}
-
-void _installPropertiesForObject(jsProto) {
-  // core.Object members need to be copied from the non-symbol name to the
-  // symbol name.
-  var coreObjProto = JS<Object>('!', '#.prototype', Object);
-  var names = getOwnPropertyNames(coreObjProto);
-  for (int i = 0, n = JS('!', '#.length', names); i < n; ++i) {
-    var name = JS<String>('!', '#[#]', names, i);
-    if (name == 'constructor') continue;
-    var desc = getOwnPropertyDescriptor(coreObjProto, name);
-    defineProperty(jsProto, JS('', '#.#', dartx, name), desc);
-  }
-}
-
-void _installPropertiesForGlobalObject(jsProto) {
-  _installPropertiesForObject(jsProto);
-  // Use JS toString for JS objects, rather than the Dart one.
-  JS('', '#[dartx.toString] = function() { return this.toString(); }', jsProto);
-  identityEquals ??= JS('', '#[dartx._equals]', jsProto);
-}
-
-final _extensionMap = JS('', 'new Map()');
-
-void _applyExtension(jsType, dartExtType) {
-  // TODO(vsm): Not all registered js types are real.
-  if (jsType == null) return;
-  var jsProto = JS('', '#.prototype', jsType);
-  if (jsProto == null) return;
-
-  if (JS('!', '# === #', dartExtType, Object)) {
-    _installPropertiesForGlobalObject(jsProto);
-    return;
-  }
-
-  _installProperties(
-      jsProto, dartExtType, JS('', '#[#]', jsProto, _extensionType));
-
-  // Mark the JS type's instances so we can easily check for extensions.
-  if (JS('!', '# !== #', dartExtType, JSFunction)) {
-    JS('', '#[#] = #', jsProto, _extensionType, dartExtType);
-  }
-  JS('', '#[#] = #[#]', jsType, _methodSig, dartExtType, _methodSig);
-  JS('', '#[#] = #[#]', jsType, _fieldSig, dartExtType, _fieldSig);
-  JS('', '#[#] = #[#]', jsType, _getterSig, dartExtType, _getterSig);
-  JS('', '#[#] = #[#]', jsType, _setterSig, dartExtType, _setterSig);
-}
-
-/// Apply the previously registered extension to the type of [nativeObject].
-/// This is intended for types that are not available to polyfill at startup.
-applyExtension(name, nativeObject) {
-  var dartExtType = JS('', '#.get(#)', _extensionMap, name);
-  var jsType = JS('', '#.constructor', nativeObject);
-  _applyExtension(jsType, dartExtType);
-}
-
-/// Apply all registered extensions to a window.  This is intended for
-/// different frames, where registrations need to be reapplied.
-applyAllExtensions(global) {
-  JS('', '#.forEach((dartExtType, name) => #(#[name], dartExtType))',
-      _extensionMap, _applyExtension, global);
-}
-
-/// Copy symbols from the prototype of the source to destination.
-/// These are the only properties safe to copy onto an existing public
-/// JavaScript class.
-registerExtension(name, dartExtType) {
-  JS('', '#.set(#, #)', _extensionMap, name, dartExtType);
-  var jsType = JS('', '#[#]', global_, name);
-  _applyExtension(jsType, dartExtType);
-}
-
-///
-/// Mark a concrete type as implementing extension methods.
-/// For example: `class MyIter implements Iterable`.
-///
-/// This takes a list of names, which are the extension methods implemented.
-/// It will add a forwarder, so the extension method name redirects to the
-/// normal Dart method name. For example:
-///
-///     defineExtensionMembers(MyType, ['add', 'remove']);
-///
-/// Results in:
-///
-///     MyType.prototype[dartx.add] = MyType.prototype.add;
-///     MyType.prototype[dartx.remove] = MyType.prototype.remove;
-///
-// TODO(jmesserly): essentially this gives two names to the same method.
-// This benefit is roughly equivalent call performance either way, but the
-// cost is we need to call defineExtensionMembers any time a subclass
-// overrides one of these methods.
-defineExtensionMethods(type, Iterable memberNames) {
-  var proto = JS('', '#.prototype', type);
-  for (var name in memberNames) {
-    JS('', '#[dartx.#] = #[#]', proto, name, proto, name);
-  }
-}
-
-/// Like [defineExtensionMethods], but for getter/setter pairs.
-void defineExtensionAccessors(type, Iterable memberNames) {
-  var proto = JS<Object>('!', '#.prototype', type);
-  for (var name in memberNames) {
-    // Find the member. It should always exist (or we have a compiler bug).
-    var member;
-    var p = proto;
-    for (;; p = JS<Object>('!', '#.__proto__', p)) {
-      member = getOwnPropertyDescriptor(p, name);
-      if (member != null) break;
-    }
-    defineProperty(proto, JS('', 'dartx[#]', name), member);
-  }
-}
-
-definePrimitiveHashCode(proto) {
-  defineProperty(proto, identityHashCode_,
-      getOwnPropertyDescriptor(proto, extensionSymbol('hashCode')));
-}
-
-/// Link the extension to the type it's extending as a base class.
-setBaseClass(derived, base) {
-  JS('', '#.prototype.__proto__ = #.prototype', derived, base);
-  // We use __proto__ to track the superclass hierarchy (see isSubtypeOf).
-  JS('', '#.__proto__ = #', derived, base);
-}
-
-/// Like [setBaseClass], but for generic extension types such as `JSArray<E>`.
-setExtensionBaseClass(dartType, jsType) {
-  // Mark the generic type as an extension type and link the prototype objects.
-  var dartProto = JS('', '#.prototype', dartType);
-  JS('', '#[#] = #', dartProto, _extensionType, dartType);
-  JS('', '#.__proto__ = #.prototype', dartProto, jsType);
-}
-
-/// Adds type test predicates to a class/interface type [ctor], using the
-/// provided [isClass] JS Symbol.
-///
-/// This will operate quickly for non-generic types, native extension types,
-/// as well as matching exact generic type arguments:
-///
-///     class C<T> {}
-///     class D extends C<int> {}
-///     main() { dynamic d = new D(); d as C<int>; }
-///
-addTypeTests(ctor, isClass) {
-  if (isClass == null) isClass = JS('', 'Symbol("_is_" + ctor.name)');
-  // TODO(jmesserly): since we know we're dealing with class/interface types,
-  // we can optimize this rather than go through the generic `dart.is` helpers.
-  JS('', '#.prototype[#] = true', ctor, isClass);
-  JS(
-      '',
-      '''#.is = function is_C(obj) {
-    return obj != null && (obj[#] || #(obj, this));
-  }''',
-      ctor,
-      isClass,
-      instanceOf);
-  JS(
-      '',
-      '''#.as = function as_C(obj) {
-    if (obj != null && obj[#]) return obj;
-    return #(obj, this);
-  }''',
-      ctor,
-      isClass,
-      cast);
-}
-
-/// Pre-initializes types with empty type caches.
-///
-/// Allows us to perform faster lookups on local caches without having to
-/// filter out the prototype chain. Also allows types to remain relatively
-/// monomorphic, which results in faster execution in V8.
-addTypeCaches(type) {
-  JS('', '#[#] = void 0', type, _cachedLegacy);
-  JS('', '#[#] = void 0', type, _cachedNullable);
-  var subtypeCacheMap = JS<Object>('!', 'new Map()');
-  JS('', '#[#] = #', type, _subtypeCache, subtypeCacheMap);
-  JS('', '#.push(#)', _cacheMaps, subtypeCacheMap);
-}
-
-// TODO(jmesserly): should we do this for all interfaces?
-
-/// The well known symbol for testing `is Future`
-final isFuture = JS('', 'Symbol("_is_Future")');
-
-/// The well known symbol for testing `is Iterable`
-final isIterable = JS('', 'Symbol("_is_Iterable")');
-
-/// The well known symbol for testing `is List`
-final isList = JS('', 'Symbol("_is_List")');
-
-/// The well known symbol for testing `is Map`
-final isMap = JS('', 'Symbol("_is_Map")');
-
-/// The well known symbol for testing `is Stream`
-final isStream = JS('', 'Symbol("_is_Stream")');
-
-/// The well known symbol for testing `is StreamSubscription`
-final isStreamSubscription = JS('', 'Symbol("_is_StreamSubscription")');
-
-/// The default `operator ==` that calls [identical].
-var identityEquals;
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
deleted file mode 100644
index ba418a4..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
+++ /dev/null
@@ -1,292 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart._runtime;
-
-// We need to set these properties while the sdk is only partially initialized
-// so we cannot use regular Dart fields.
-// The default values for these properties are set when the global_ final field
-// in runtime.dart is initialized.
-
-argumentError(value) {
-  throw ArgumentError.value(value);
-}
-
-throwUnimplementedError(String message) {
-  throw UnimplementedError(message);
-}
-
-// TODO(nshahan) Cleanup embeded strings and extract file location at runtime
-// from the stacktrace.
-assertFailed(String? message,
-    [String? fileUri, int? line, int? column, String? conditionSource]) {
-  throw AssertionErrorImpl(message, fileUri, line, column, conditionSource);
-}
-
-final _nullFailedSet = JS('!', 'new Set()');
-// Run-time null safety assertion per:
-// https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#automatic-debug-assertion-insertion
-nullFailed(String? fileUri, int? line, int? column, String? variable) {
-  if (strictNullSafety) {
-    throw AssertionErrorImpl(
-        'A null value was passed into a non-nullable parameter $variable',
-        fileUri,
-        line,
-        column,
-        '$variable != null');
-  } else {
-    var key = '$fileUri:$line:$column';
-    if (!JS('!', '#.has(#)', _nullFailedSet, key)) {
-      JS('', '#.add(#)', _nullFailedSet, key);
-      _nullWarn(
-          'A null value was passed into a non-nullable parameter $variable');
-    }
-  }
-}
-
-throwCyclicInitializationError([String? field]) {
-  throw CyclicInitializationError(field);
-}
-
-throwNullValueError() {
-  // TODO(vsm): Per spec, we should throw an NSM here.  Technically, we ought
-  // to thread through method info, but that uglifies the code and can't
-  // actually be queried ... it only affects how the error is printed.
-  throw NoSuchMethodError(null, Symbol('<Unexpected Null Value>'), null, null);
-}
-
-castError(obj, expectedType) {
-  var actualType = getReifiedType(obj);
-  var message = _castErrorMessage(actualType, expectedType);
-  throw TypeErrorImpl(message);
-}
-
-String _castErrorMessage(from, to) {
-  // If both types are generic classes, see if we can infer generic type
-  // arguments for `from` that would allow the subtype relation to work.
-  // TODO(#40326) Fix suggested type or remove this code if no longer needed.
-  // var fromClass = getGenericClass(from);
-  // if (fromClass != null) {
-  //   var fromTypeFormals = getGenericTypeFormals(fromClass);
-  //   var fromType = instantiateClass(fromClass, fromTypeFormals);
-  //   var inferrer = _TypeInferrer(fromTypeFormals);
-  //   if (inferrer.trySubtypeMatch(fromType, to)) {
-  //     var inferredTypes = inferrer.getInferredTypes();
-  //     if (inferredTypes != null) {
-  //       var inferred = instantiateClass(fromClass, inferredTypes);
-  //       return "Type '${typeName(from)}' should be '${typeName(inferred)}' "
-  //           "to implement expected type '${typeName(to)}'.";
-  //     }
-  //   }
-  // }
-  return "Expected a value of type '${typeName(to)}', "
-      "but got one of type '${typeName(from)}'";
-}
-
-/// The symbol that references the thrown Dart Object (typically but not
-/// necessarily an [Error] or [Exception]), used by the [exception] function.
-final Object _thrownValue = JS('', 'Symbol("_thrownValue")');
-
-/// For a Dart [Error], this provides access to the JS Error object that
-/// contains the stack trace if the error was thrown.
-final Object _jsError = JS('', 'Symbol("_jsError")');
-
-/// Gets the thrown Dart Object from an [error] caught by a JS catch.
-///
-/// If the throw originated in Dart, the result will typically be an [Error]
-/// or [Exception], but it could be any Dart object.
-///
-/// If the throw originated in JavaScript, then there is not a corresponding
-/// Dart value, so we just return the error object.
-Object? getThrown(Object? error) {
-  if (error != null) {
-    // Get the Dart thrown value, if any.
-    var value = JS('', '#[#]', error, _thrownValue);
-    if (value != null) return value;
-  }
-  // Otherwise return the original object.
-  return error;
-}
-
-final _stackTrace = JS('', 'Symbol("_stackTrace")');
-
-/// Returns the stack trace from an [error] caught by a JS catch.
-///
-/// If the throw originated in Dart, we should always have JS Error
-/// (see [throw_]) so we can create a Dart [StackTrace] from that (or return a
-/// previously created instance).
-///
-/// If the throw originated in JavaScript and was an `Error`, then we can get
-/// the corresponding stack trace the same way we do for Dart throws. If the
-/// throw object was not an Error, then we don't have a JS trace, so we create
-/// one here.
-StackTrace stackTrace(Object? error) {
-  if (JS<bool>('!', '!(# instanceof Error)', error)) {
-    // We caught something that isn't a JS Error.
-    //
-    // We should only hit this path when a non-Error was thrown from JS. In
-    // case, there is no stack trace available, so create one here.
-    return _StackTrace.missing(error);
-  }
-
-  // If we've already created the Dart stack trace object, return it.
-  StackTrace? trace = JS('', '#[#]', error, _stackTrace);
-  if (trace != null) return trace;
-
-  // Otherwise create the Dart stack trace (by parsing the JS stack), and
-  // cache it so we don't repeat the parsing/allocation.
-  return JS('', '#[#] = #', error, _stackTrace, _StackTrace(error));
-}
-
-StackTrace stackTraceForError(Error error) {
-  return stackTrace(JS('', '#[#]', error, _jsError));
-}
-
-/// Implements `rethrow` of [error], allowing rethrow in an expression context.
-///
-/// Note: [error] must be the raw JS error caught in the JS catch, not the
-/// unwrapped value returned by [getThrown].
-@JSExportName('rethrow')
-void rethrow_(Object error) {
-  JS('', 'throw #', error);
-}
-
-/// Subclass of JS `Error` that wraps a thrown Dart object, and evaluates the
-/// message lazily by calling `toString()` on the wrapped Dart object.
-///
-/// Also creates a pointer from the thrown Dart object to the JS Error
-/// (via [_jsError]). This is used to implement [Error.stackTrace], but also
-/// provides a way to recover the stack trace if we lose track of it.
-/// [Error] requires preserving the original stack trace if an error is
-/// rethrown, so we only update the pointer if it wasn't already set.
-///
-/// TODO(jmesserly): Dart Errors should simply be JS Errors.
-final Object DartError = JS(
-    '!',
-    '''class DartError extends Error {
-      constructor(error) {
-        super();
-        if (error == null) error = #;
-        this[#] = error;
-        if (error != null && typeof error == "object" && error[#] == null) {
-          error[#] = this;
-        }
-      }
-      get message() {
-        return #(this[#]);
-      }
-    }''',
-    NullThrownError(),
-    _thrownValue,
-    _jsError,
-    _jsError,
-    _toString,
-    _thrownValue);
-
-/// Subclass of [DartError] for cases where we're rethrowing with a different,
-/// original Dart StackTrace object.
-///
-/// This includes the original stack trace in the JS Error message so it doesn't
-/// get lost if the exception reaches JS.
-final Object RethrownDartError = JS(
-    '!',
-    '''class RethrownDartError extends # {
-      constructor(error, stackTrace) {
-        super(error);
-        this[#] = stackTrace;
-      }
-      get message() {
-        return super.message + "\\n    " + #(this[#]) + "\\n";
-      }
-    }''',
-    DartError,
-    _stackTrace,
-    _toString,
-    _stackTrace);
-
-/// Implements `throw` of [exception], allowing for throw in an expression
-/// context, and capturing the current stack trace.
-@JSExportName('throw')
-void throw_(Object? exception) {
-  /// Wrap the object so we capture a new stack trace, and so it will print
-  /// nicely from JS, as if it were a normal JS error.
-  JS('', 'throw new #(#)', DartError, exception);
-}
-
-/// Returns a JS error for throwing the Dart [exception] Object and using the
-/// provided stack [trace].
-///
-/// This is used by dart:async to rethrow unhandled errors in [Zone]s, and by
-/// `async`/`async*` to rethrow errors from Futures/Streams into the generator
-/// (so a try/catch in there can catch it).
-///
-/// If the exception and trace originated from the same Dart throw, then we can
-/// simply return the original JS Error. Otherwise, we have to create a new JS
-/// Error. The new error will have the correct Dart trace, but it will not have
-/// the correct JS stack trace (visible if JavaScript ends up handling it). To
-/// fix that, we use [RethrownDartError] to preserve the Dart trace and make
-/// sure it gets displayed in the JS error message.
-///
-/// If the stack trace is null, this will preserve the original stack trace
-/// on the exception, if available, otherwise it will capture the current stack
-/// trace.
-Object? createErrorWithStack(Object exception, StackTrace? trace) {
-  if (trace == null) {
-    var error = JS('', '#[#]', exception, _jsError);
-    return error != null ? error : JS('', 'new #(#)', DartError, exception);
-  }
-  if (trace is _StackTrace) {
-    /// Optimization: if this stack trace and exception already have a matching
-    /// Error, we can just rethrow it.
-    var originalError = trace._jsError;
-    if (identical(exception, getThrown(originalError))) {
-      return originalError;
-    }
-  }
-  return JS('', 'new #(#, #)', RethrownDartError, exception, trace);
-}
-
-// This is a utility function: it is only intended to be called from dev
-// tools.
-void stackPrint(Object error) {
-  JS('', 'console.log(#.stack ? #.stack : "No stack trace for: " + #)', error,
-      error, error);
-}
-
-class _StackTrace implements StackTrace {
-  final Object? _jsError;
-  final Object? _jsObjectMissingTrace;
-  String? _trace;
-
-  _StackTrace(this._jsError) : _jsObjectMissingTrace = null;
-
-  _StackTrace.missing(Object? caughtObj)
-      : _jsObjectMissingTrace = caughtObj != null ? caughtObj : 'null',
-        _jsError = JS('', 'Error()');
-
-  String toString() {
-    if (_trace != null) return _trace!;
-
-    var e = _jsError;
-    String trace = '';
-    if (e != null && JS<bool>('!', 'typeof # === "object"', e)) {
-      trace = e is NativeError ? e.dartStack() : JS<String>('', '#.stack', e);
-      var mapper = stackTraceMapper;
-      if (trace != null && mapper != null) {
-        trace = mapper(trace);
-      }
-    }
-    if (trace.isEmpty || _jsObjectMissingTrace != null) {
-      String jsToString;
-      try {
-        jsToString = JS('', '"" + #', _jsObjectMissingTrace);
-      } catch (_) {
-        jsToString = '<error converting JS object to string>';
-      }
-      trace = 'Non-error `$jsToString` thrown by JS does not have stack trace.'
-          '\nCaught in Dart at:\n\n$trace';
-    }
-    return _trace = trace;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart
deleted file mode 100644
index fd9a7d4..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart
+++ /dev/null
@@ -1,841 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// This library defines runtime operations on objects used by the code
-/// generator.
-part of dart._runtime;
-
-// TODO(jmesserly): remove this in favor of _Invocation.
-class InvocationImpl extends Invocation {
-  final Symbol memberName;
-  final List positionalArguments;
-  final Map<Symbol, dynamic> namedArguments;
-  final List<Type> typeArguments;
-  final bool isMethod;
-  final bool isGetter;
-  final bool isSetter;
-  final String failureMessage;
-
-  InvocationImpl(memberName, List<Object?> positionalArguments,
-      {namedArguments,
-      List typeArguments = const [],
-      this.isMethod = false,
-      this.isGetter = false,
-      this.isSetter = false,
-      this.failureMessage = 'method not found'})
-      : memberName =
-            isSetter ? _setterSymbol(memberName) : _dartSymbol(memberName),
-        positionalArguments = List.unmodifiable(positionalArguments),
-        namedArguments = _namedArgsToSymbols(namedArguments),
-        typeArguments = List.unmodifiable(typeArguments.map(wrapType));
-
-  static Map<Symbol, dynamic> _namedArgsToSymbols(namedArgs) {
-    if (namedArgs == null) return const {};
-    return Map.unmodifiable(Map.fromIterable(getOwnPropertyNames(namedArgs),
-        key: _dartSymbol, value: (k) => JS('', '#[#]', namedArgs, k)));
-  }
-}
-
-/// Given an object and a method name, tear off the method.
-/// Sets the runtime type of the torn off method appropriately,
-/// and also binds the object.
-///
-/// If the optional `f` argument is passed in, it will be used as the method.
-/// This supports cases like `super.foo` where we need to tear off the method
-/// from the superclass, not from the `obj` directly.
-// TODO(leafp): Consider caching the tearoff on the object?
-bind(obj, name, method) {
-  if (obj == null) obj = jsNull;
-  if (method == null) method = JS('', '#[#]', obj, name);
-  var f = JS('', '#.bind(#)', method, obj);
-  // TODO(jmesserly): canonicalize tearoffs.
-  JS('', '#._boundObject = #', f, obj);
-  JS('', '#._boundMethod = #', f, method);
-  JS('', '#[#] = #', f, _runtimeType, getMethodType(getType(obj), name));
-  return f;
-}
-
-/// Binds the `call` method of an interface type, handling null.
-///
-/// Essentially this works like `obj?.call`. It also handles the needs of
-/// [dsend]/[dcall], returning `null` if no method was found with the given
-/// canonical member [name].
-///
-/// [name] is typically `"call"` but it could be the [extensionSymbol] for
-/// `call`, if we define it on a native type, and [obj] is known statially to be
-/// a native type/interface with `call`.
-bindCall(obj, name) {
-  if (obj == null) return null;
-  var ftype = getMethodType(getType(obj), name);
-  if (ftype == null) return null;
-  var method = JS('', '#[#]', obj, name);
-  var f = JS('', '#.bind(#)', method, obj);
-  // TODO(jmesserly): canonicalize tearoffs.
-  JS('', '#._boundObject = #', f, obj);
-  JS('', '#._boundMethod = #', f, method);
-  JS('', '#[#] = #', f, _runtimeType, ftype);
-  return f;
-}
-
-/// Instantiate a generic method.
-///
-/// We need to apply the type arguments both to the function, as well as its
-/// associated function type.
-gbind(f, @rest List typeArgs) {
-  GenericFunctionType type = JS('!', '#[#]', f, _runtimeType);
-  type.checkBounds(typeArgs);
-  // Create a JS wrapper function that will also pass the type arguments, and
-  // tag it with the instantiated function type.
-  var result =
-      JS('', '(...args) => #.apply(null, #.concat(args))', f, typeArgs);
-  return fn(result, type.instantiate(typeArgs));
-}
-
-dloadRepl(obj, field) => dload(obj, replNameLookup(obj, field));
-
-// Warning: dload, dput, and dsend assume they are never called on methods
-// implemented by the Object base class as those methods can always be
-// statically resolved.
-dload(obj, field) {
-  if (JS('!', 'typeof # == "function" && # == "call"', obj, field)) {
-    return obj;
-  }
-  var f = _canonicalMember(obj, field);
-
-  trackCall(obj);
-  if (f != null) {
-    var type = getType(obj);
-
-    if (hasField(type, f) || hasGetter(type, f)) return JS('', '#[#]', obj, f);
-    if (hasMethod(type, f)) return bind(obj, f, null);
-
-    // Always allow for JS interop objects.
-    if (isJsInterop(obj)) return JS('', '#[#]', obj, f);
-  }
-  return noSuchMethod(obj, InvocationImpl(field, JS('', '[]'), isGetter: true));
-}
-
-_stripGenericArguments(type) {
-  var genericClass = getGenericClass(type);
-  if (genericClass != null) return JS('', '#()', genericClass);
-  return type;
-}
-
-dputRepl(obj, field, value) => dput(obj, replNameLookup(obj, field), value);
-
-dput(obj, field, value) {
-  var f = _canonicalMember(obj, field);
-  trackCall(obj);
-  if (f != null) {
-    var setterType = getSetterType(getType(obj), f);
-    if (setterType != null) {
-      return JS('', '#[#] = #.as(#)', obj, f, setterType, value);
-    }
-    // Always allow for JS interop objects.
-    if (isJsInterop(obj)) return JS('', '#[#] = #', obj, f, value);
-  }
-  noSuchMethod(
-      obj, InvocationImpl(field, JS('', '[#]', value), isSetter: true));
-  return value;
-}
-
-/// Returns an error message if function of a given [type] can't be applied to
-/// [actuals] and [namedActuals].
-///
-/// Returns `null` if all checks pass.
-String? _argumentErrors(FunctionType type, List actuals, namedActuals) {
-  // Check for too few required arguments.
-  int actualsCount = JS('!', '#.length', actuals);
-  var required = type.args;
-  int requiredCount = JS('!', '#.length', required);
-  if (actualsCount < requiredCount) {
-    return 'Dynamic call with too few arguments. '
-        'Expected: $requiredCount Actual: $actualsCount';
-  }
-
-  // Check for too many postional arguments.
-  var extras = actualsCount - requiredCount;
-  var optionals = type.optionals;
-  if (extras > JS<int>('!', '#.length', optionals)) {
-    return 'Dynamic call with too many arguments. '
-        'Expected: $requiredCount Actual: $actualsCount';
-  }
-
-  // Check if we have invalid named arguments.
-  Iterable? names;
-  var named = type.named;
-  var requiredNamed = type.requiredNamed;
-  if (namedActuals != null) {
-    names = getOwnPropertyNames(namedActuals);
-    for (var name in names) {
-      if (!JS<bool>('!', '(#.hasOwnProperty(#) || #.hasOwnProperty(#))', named,
-          name, requiredNamed, name)) {
-        return "Dynamic call with unexpected named argument '$name'.";
-      }
-    }
-  }
-  // Verify that all required named parameters are provided an argument.
-  Iterable requiredNames = getOwnPropertyNames(requiredNamed);
-  if (requiredNames.isNotEmpty) {
-    var missingRequired = namedActuals == null
-        ? requiredNames
-        : requiredNames.where((name) =>
-            !JS<bool>('!', '#.hasOwnProperty(#)', namedActuals, name));
-    if (missingRequired.isNotEmpty) {
-      var error = "Dynamic call with missing required named arguments: "
-          "${missingRequired.join(', ')}.";
-      if (!strictNullSafety) {
-        _nullWarn(error);
-      } else {
-        return error;
-      }
-    }
-  }
-  // Now that we know the signature matches, we can perform type checks.
-  for (var i = 0; i < requiredCount; ++i) {
-    JS('', '#[#].as(#[#])', required, i, actuals, i);
-  }
-  for (var i = 0; i < extras; ++i) {
-    JS('', '#[#].as(#[#])', optionals, i, actuals, i + requiredCount);
-  }
-  if (names != null) {
-    for (var name in names) {
-      JS('', '(#[#] || #[#]).as(#[#])', named, name, requiredNamed, name,
-          namedActuals, name);
-    }
-  }
-  return null;
-}
-
-_toSymbolName(symbol) => JS('', '''(() => {
-        let str = $symbol.toString();
-        // Strip leading 'Symbol(' and trailing ')'
-        return str.substring(7, str.length-1);
-    })()''');
-
-_toDisplayName(name) => JS('', '''(() => {
-      // Names starting with _ are escaped names used to disambiguate Dart and
-      // JS names.
-      if ($name[0] === '_') {
-        // Inverse of
-        switch($name) {
-          case '_get':
-            return '[]';
-          case '_set':
-            return '[]=';
-          case '_negate':
-            return 'unary-';
-          case '_constructor':
-          case '_prototype':
-            return $name.substring(1);
-        }
-      }
-      return $name;
-  })()''');
-
-Symbol _dartSymbol(name) {
-  return (JS<bool>('!', 'typeof # === "symbol"', name))
-      ? JS('Symbol', '#(new #.new(#, #))', const_, PrivateSymbol,
-          _toSymbolName(name), name)
-      : JS('Symbol', '#(new #.new(#))', const_, internal.Symbol,
-          _toDisplayName(name));
-}
-
-Symbol _setterSymbol(name) {
-  return (JS<bool>('!', 'typeof # === "symbol"', name))
-      ? JS('Symbol', '#(new #.new(# + "=", #))', const_, PrivateSymbol,
-          _toSymbolName(name), name)
-      : JS('Symbol', '#(new #.new(# + "="))', const_, internal.Symbol,
-          _toDisplayName(name));
-}
-
-_checkAndCall(f, ftype, obj, typeArgs, args, named, displayName) =>
-    JS('', '''(() => {
-  $trackCall($obj);
-
-  let originalTarget = obj === void 0 ? f : obj;
-
-  function callNSM(errorMessage) {
-    return $noSuchMethod(originalTarget, new $InvocationImpl.new(
-        $displayName, $args, {
-          namedArguments: $named,
-          // Repeated the default value here to avoid passing null from JS to a
-          // non-nullable argument.
-          typeArguments: $typeArgs || [],
-          isMethod: true,
-          failureMessage: errorMessage
-        }));
-  }
-  if ($f == null) return callNSM('Dynamic call of null.');
-  if (!($f instanceof Function)) {
-    // We're not a function (and hence not a method either)
-    // Grab the `call` method if it's not a function.
-    if ($f != null) {
-      // Getting the member succeeded, so update the originalTarget.
-      // (we're now trying `call()` on `f`, so we want to call its nSM rather
-      // than the original target's nSM).
-      originalTarget = f;
-      $f = ${bindCall(f, _canonicalMember(f, 'call'))};
-      $ftype = null;
-      $displayName = "call";
-    }
-    if ($f == null) return callNSM(
-        "Dynamic call of object has no instance method 'call'.");
-  }
-  // If f is a function, but not a method (no method type)
-  // then it should have been a function valued field, so
-  // get the type from the function.
-  if ($ftype == null) $ftype = $f[$_runtimeType];
-
-  if ($ftype == null) {
-    // TODO(leafp): Allow JS objects to go through?
-    if ($typeArgs != null) {
-      // TODO(jmesserly): is there a sensible way to handle these?
-      $throwTypeError('call to JS object `' + $obj +
-          '` with type arguments <' + $typeArgs + '> is not supported.');
-    }
-
-    if ($named != null) $args.push($named);
-    return $f.apply($obj, $args);
-  }
-
-  // Apply type arguments
-  if (${_jsInstanceOf(ftype, GenericFunctionType)}) {
-    let formalCount = $ftype.formalCount;
-
-    if ($typeArgs == null) {
-      $typeArgs = $ftype.instantiateDefaultBounds();
-    } else if ($typeArgs.length != formalCount) {
-      return callNSM('Dynamic call with incorrect number of type arguments. ' +
-          'Expected: ' + formalCount + ' Actual: ' + $typeArgs.length);
-    } else {
-      $ftype.checkBounds($typeArgs);
-    }
-    $ftype = $ftype.instantiate($typeArgs);
-  } else if ($typeArgs != null) {
-    return callNSM('Dynamic call with unexpected type arguments. ' +
-        'Expected: 0 Actual: ' + $typeArgs.length);
-  }
-  let errorMessage = $_argumentErrors($ftype, $args, $named);
-  if (errorMessage == null) {
-    if ($typeArgs != null) $args = $typeArgs.concat($args);
-    if ($named != null) $args.push($named);
-    return $f.apply($obj, $args);
-  }
-  return callNSM(errorMessage);
-})()''');
-
-dcall(f, args, [@undefined named]) => _checkAndCall(
-    f, null, JS('', 'void 0'), null, args, named, JS('', 'f.name'));
-
-dgcall(f, typeArgs, args, [@undefined named]) => _checkAndCall(f, null,
-    JS('', 'void 0'), typeArgs, args, named, JS('', "f.name || 'call'"));
-
-/// Helper for REPL dynamic invocation variants that make a best effort to
-/// enable accessing private members across library boundaries.
-replNameLookup(object, field) => JS('', '''(() => {
-  let rawField = $field;
-  if (typeof(field) == 'symbol') {
-    // test if the specified field exists in which case it is safe to use it.
-    if ($field in $object) return $field;
-
-    // Symbol is from a different library. Make a best effort to
-    $field = $field.toString();
-    $field = $field.substring('Symbol('.length, field.length - 1);
-
-  } else if ($field.charAt(0) != '_') {
-    // Not a private member so default call path is safe.
-    return $field;
-  }
-
-  // If the exact field name is present, invoke callback with it.
-  if ($field in $object) return $field;
-
-  // TODO(jacobr): warn if there are multiple private members with the same
-  // name which could happen if super classes in different libraries have
-  // the same private member name.
-  let proto = $object;
-  while (proto !== null) {
-    // Private field (indicated with "_").
-    let symbols = Object.getOwnPropertySymbols(proto);
-    let target = 'Symbol(' + $field + ')';
-
-    for (let s = 0; s < symbols.length; s++) {
-      let sym = symbols[s];
-      if (target == sym.toString()) return sym;
-    }
-    proto = proto.__proto__;
-  }
-  // We didn't find a plausible alternate private symbol so just fall back
-  // to the regular field.
-  return rawField;
-})()''');
-
-/// Shared code for dsend, dindex, and dsetindex.
-callMethod(obj, name, typeArgs, args, named, displayName) {
-  if (JS('!', 'typeof # == "function" && # == "call"', obj, name)) {
-    return dgcall(obj, typeArgs, args, named);
-  }
-  var symbol = _canonicalMember(obj, name);
-  if (symbol == null) {
-    return noSuchMethod(obj, InvocationImpl(displayName, args, isMethod: true));
-  }
-  var f = obj != null ? JS('', '#[#]', obj, symbol) : null;
-  var type = getType(obj);
-  var ftype = getMethodType(type, symbol);
-  // No such method if dart object and ftype is missing.
-  return _checkAndCall(f, ftype, obj, typeArgs, args, named, displayName);
-}
-
-dsend(obj, method, args, [@undefined named]) =>
-    callMethod(obj, method, null, args, named, method);
-
-dgsend(obj, typeArgs, method, args, [@undefined named]) =>
-    callMethod(obj, method, typeArgs, args, named, method);
-
-dsendRepl(obj, method, args, [@undefined named]) =>
-    callMethod(obj, replNameLookup(obj, method), null, args, named, method);
-
-dgsendRepl(obj, typeArgs, method, args, [@undefined named]) =>
-    callMethod(obj, replNameLookup(obj, method), typeArgs, args, named, method);
-
-dindex(obj, index) => callMethod(obj, '_get', null, [index], null, '[]');
-
-dsetindex(obj, index, value) =>
-    callMethod(obj, '_set', null, [index, value], null, '[]=');
-
-/// General implementation of the Dart `is` operator.
-///
-/// Some basic cases are handled directly by the `.is` methods that are attached
-/// directly on types, but any query that requires checking subtyping relations
-/// is handled here.
-@notNull
-@JSExportName('is')
-bool instanceOf(obj, type) {
-  if (obj == null) {
-    return _equalType(type, Null) ||
-        _isTop(type) ||
-        _jsInstanceOf(type, NullableType);
-  }
-  return isSubtypeOf(getReifiedType(obj), type);
-}
-
-/// General implementation of the Dart `as` operator.
-///
-/// Some basic cases are handled directly by the `.as` methods that are attached
-/// directly on types, but any query that requires checking subtyping relations
-/// is handled here.
-@JSExportName('as')
-cast(obj, type) {
-  // We hoist the common case where null is checked against another type here
-  // for better performance.
-  if (obj == null && !strictNullSafety) {
-    // Check the null comparison cache to avoid emitting repeated warnings.
-    _nullWarnOnType(type);
-    return obj;
-  } else {
-    var actual = getReifiedType(obj);
-    if (isSubtypeOf(actual, type)) return obj;
-  }
-
-  return castError(obj, type);
-}
-
-bool test(bool? obj) {
-  if (obj == null) throw BooleanConversionAssertionError();
-  return obj;
-}
-
-bool dtest(obj) {
-  // Only throw an AssertionError in weak mode for compatibility. Strong mode
-  // should throw a TypeError.
-  if (obj is! bool) booleanConversionFailed(strictNullSafety ? obj : test(obj));
-  return obj;
-}
-
-void booleanConversionFailed(obj) {
-  var actual = typeName(getReifiedType(obj));
-  throw TypeErrorImpl("type '$actual' is not a 'bool' in boolean expression");
-}
-
-asInt(obj) {
-  // Note: null (and undefined) will fail this test.
-  if (JS('!', 'Math.floor(#) != #', obj, obj)) {
-    if (obj == null && !strictNullSafety) {
-      _nullWarnOnType(JS('', '#', int));
-      return null;
-    } else {
-      castError(obj, JS('', '#', int));
-    }
-  }
-  return obj;
-}
-
-asNullableInt(obj) => obj == null ? null : asInt(obj);
-
-/// Checks that `x` is not null or undefined.
-//
-// TODO(jmesserly): inline this, either by generating it as a function into
-// the module, or via some other pattern such as:
-//
-//     <expr> || nullErr()
-//     (t0 = <expr>) != null ? t0 : nullErr()
-@JSExportName('notNull')
-_notNull(x) {
-  if (x == null) throwNullValueError();
-  return x;
-}
-
-/// Checks that `x` is not null or undefined.
-///
-/// Unlike `_notNull`, this throws a `CastError` (under strict checking)
-/// or emits a runtime warning (otherwise).  This is only used by the
-/// compiler when casting from nullable to non-nullable variants of the
-/// same type.
-nullCast(x, type) {
-  if (x == null) {
-    if (!strictNullSafety) {
-      _nullWarnOnType(type);
-    } else {
-      castError(x, type);
-    }
-  }
-  return x;
-}
-
-/// The global constant map table.
-final constantMaps = JS<Object>('!', 'new Map()');
-
-// TODO(leafp): This table gets quite large in apps.
-// Keeping the paths is probably expensive.  It would probably
-// be more space efficient to just use a direct hash table with
-// an appropriately defined structural equality function.
-Object _lookupNonTerminal(Object map, Object? key) {
-  var result = JS('', '#.get(#)', map, key);
-  if (result != null) return result;
-  JS('', '#.set(#, # = new Map())', map, key, result);
-  return result!;
-}
-
-Map<K, V> constMap<K, V>(JSArray elements) {
-  var count = elements.length;
-  var map = _lookupNonTerminal(constantMaps, count);
-  for (var i = 0; i < count; i++) {
-    map = _lookupNonTerminal(map, JS('', '#[#]', elements, i));
-  }
-  map = _lookupNonTerminal(map, K);
-  Map<K, V>? result = JS('', '#.get(#)', map, V);
-  if (result != null) return result;
-  result = ImmutableMap<K, V>.from(elements);
-  JS('', '#.set(#, #)', map, V, result);
-  return result;
-}
-
-final constantSets = JS<Object>('!', 'new Map()');
-var _immutableSetConstructor;
-
-// We cannot invoke private class constructors directly in Dart.
-Set<E> _createImmutableSet<E>(JSArray<E> elements) {
-  _immutableSetConstructor ??=
-      JS('', '#.#', getLibrary('dart:collection'), '_ImmutableSet\$');
-  return JS('', 'new (#(#)).from(#)', _immutableSetConstructor, E, elements);
-}
-
-Set<E> constSet<E>(JSArray<E> elements) {
-  var count = elements.length;
-  var map = _lookupNonTerminal(constantSets, count);
-  for (var i = 0; i < count; i++) {
-    map = _lookupNonTerminal(map, JS('', '#[#]', elements, i));
-  }
-  Set<E>? result = JS('', '#.get(#)', map, E);
-  if (result != null) return result;
-  result = _createImmutableSet<E>(elements);
-  JS('', '#.set(#, #)', map, E, result);
-  return result;
-}
-
-final _value = JS('', 'Symbol("_value")');
-
-///
-/// Looks up a sequence of [keys] in [map], recursively, and
-/// returns the result. If the value is not found, [valueFn] will be called to
-/// add it. For example:
-///
-///     let map = new Map();
-///     putIfAbsent(map, [1, 2, 'hi ', 'there '], () => 'world');
-///
-/// ... will create a Map with a structure like:
-///
-///     { 1: { 2: { 'hi ': { 'there ': 'world' } } } }
-///
-multiKeyPutIfAbsent(map, keys, valueFn) => JS('', '''(() => {
-  for (let k of $keys) {
-    let value = $map.get(k);
-    if (!value) {
-      // TODO(jmesserly): most of these maps are very small (e.g. 1 item),
-      // so it may be worth optimizing for that.
-      $map.set(k, value = new Map());
-    }
-    $map = value;
-  }
-  if ($map.has($_value)) return $map.get($_value);
-  let value = $valueFn();
-  $map.set($_value, value);
-  return value;
-})()''');
-
-/// The global constant table.
-/// This maps the number of names in the object (n)
-/// to a path of length 2*n of maps indexed by the name and
-/// and value of the field.  The final map is
-/// indexed by runtime type, and contains the canonical
-/// version of the object.
-final constants = JS('!', 'new Map()');
-
-///
-/// Canonicalize a constant object.
-///
-/// Preconditions:
-/// - `obj` is an objects or array, not a primitive.
-/// - nested values of the object are themselves already canonicalized.
-///
-@JSExportName('const')
-const_(obj) => JS('', '''(() => {
-  let names = $getOwnNamesAndSymbols($obj);
-  let count = names.length;
-  // Index by count.  All of the paths through this map
-  // will have 2*count length.
-  let map = $_lookupNonTerminal($constants, count);
-  // TODO(jmesserly): there's no guarantee in JS that names/symbols are
-  // returned in the same order.
-  //
-  // We could probably get the same order if we're judicious about
-  // initializing fields in a consistent order across all const constructors.
-  // Alternatively we need a way to sort them to make consistent.
-  //
-  // Right now we use the (name,value) pairs in sequence, which prevents
-  // an object with incorrect field values being returned, but won't
-  // canonicalize correctly if key order is different.
-  //
-  // See issue https://github.com/dart-lang/sdk/issues/30876
-  for (let i = 0; i < count; i++) {
-    let name = names[i];
-    map = $_lookupNonTerminal(map, name);
-    map = $_lookupNonTerminal(map, $obj[name]);
-  }
-  // TODO(leafp): It may be the case that the reified type
-  // is always one of the keys already used above?
-  let type = $getReifiedType($obj);
-  let value = map.get(type);
-  if (value) return value;
-  map.set(type, $obj);
-  return $obj;
-})()''');
-
-/// The global constant list table.
-/// This maps the number of elements in the list (n)
-/// to a path of length n of maps indexed by the value
-/// of the field.  The final map is indexed by the element
-/// type and contains the canonical version of the list.
-final constantLists = JS('', 'new Map()');
-
-/// Canonicalize a constant list
-constList(elements, elementType) => JS('', '''(() => {
-  let count = $elements.length;
-  let map = $_lookupNonTerminal($constantLists, count);
-  for (let i = 0; i < count; i++) {
-    map = $_lookupNonTerminal(map, elements[i]);
-  }
-  let value = map.get($elementType);
-  if (value) return value;
-
-  ${getGenericClass(JSArray)}($elementType).unmodifiable($elements);
-  map.set($elementType, elements);
-  return elements;
-})()''');
-
-constFn(x) => JS('', '() => x');
-
-/// Gets the extension symbol given a member [name].
-///
-/// This is inlined by the compiler when used with a literal string.
-extensionSymbol(String name) => JS('', 'dartx[#]', name);
-
-// The following are helpers for Object methods when the receiver
-// may be null. These should only be generated by the compiler.
-bool equals(x, y) {
-  // We handle `y == null` inside our generated operator methods, to keep this
-  // function minimal.
-  // This pattern resulted from performance testing; it found that dispatching
-  // was the fastest solution, even for primitive types.
-  return JS('!', '# == null ? # == null : #[#](#)', x, y, x,
-      extensionSymbol('_equals'), y);
-}
-
-int hashCode(obj) {
-  return obj == null ? 0 : JS('!', '#[#]', obj, extensionSymbol('hashCode'));
-}
-
-@JSExportName('toString')
-String _toString(obj) {
-  if (obj == null) return "null";
-  if (obj is String) return obj;
-  return JS('!', '#[#]()', obj, extensionSymbol('toString'));
-}
-
-/// Converts to a non-null [String], equivalent to
-/// `dart.notNull(dart.toString(obj))`.
-///
-/// This is commonly used in string interpolation.
-@notNull
-String str(obj) {
-  if (obj == null) return "null";
-  if (obj is String) return obj;
-  return _notNull(JS('!', '#[#]()', obj, extensionSymbol('toString')));
-}
-
-// TODO(jmesserly): is the argument type verified statically?
-noSuchMethod(obj, Invocation invocation) {
-  if (obj == null) defaultNoSuchMethod(obj, invocation);
-  return JS('', '#[#](#)', obj, extensionSymbol('noSuchMethod'), invocation);
-}
-
-/// The default implementation of `noSuchMethod` to match `Object.noSuchMethod`.
-defaultNoSuchMethod(obj, Invocation i) {
-  throw NoSuchMethodError.withInvocation(obj, i);
-}
-
-runtimeType(obj) {
-  return obj == null ? Null : JS('', '#[dartx.runtimeType]', obj);
-}
-
-final identityHashCode_ = JS<Object>('!', 'Symbol("_identityHashCode")');
-
-/// Adapts a Dart `get iterator` into a JS `[Symbol.iterator]`.
-// TODO(jmesserly): instead of an adaptor, we could compile Dart iterators
-// natively implementing the JS iterator protocol. This would allow us to
-// optimize them a bit.
-final JsIterator = JS('', '''
-  class JsIterator {
-    constructor(dartIterator) {
-      this.dartIterator = dartIterator;
-    }
-    next() {
-      let i = this.dartIterator;
-      let done = !i.moveNext();
-      return { done: done, value: done ? void 0 : i.current };
-    }
-  }
-''');
-
-_canonicalMember(obj, name) {
-  // Private names are symbols and are already canonical.
-  if (JS('!', 'typeof # === "symbol"', name)) return name;
-
-  if (obj != null && JS<bool>('!', '#[#] != null', obj, _extensionType)) {
-    return JS('', 'dartx.#', name);
-  }
-
-  // Check for certain names that we can't use in JS
-  if (JS('!', '# == "constructor" || # == "prototype"', name, name)) {
-    JS('', '# = "+" + #', name, name);
-  }
-  return name;
-}
-
-/// Emulates the implicit "loadLibrary" function provided by a deferred library.
-///
-/// Libraries are not actually deferred in DDC, so this just returns a future
-/// that completes immediately.
-Future loadLibrary() => Future.value();
-
-/// Defines lazy statics.
-///
-/// TODO: Remove useOldSemantics when non-null-safe late static field behavior is
-/// deprecated.
-void defineLazy(to, from, bool useOldSemantics) {
-  for (var name in getOwnNamesAndSymbols(from)) {
-    if (useOldSemantics) {
-      defineLazyFieldOld(to, name, getOwnPropertyDescriptor(from, name));
-    } else {
-      defineLazyField(to, name, getOwnPropertyDescriptor(from, name));
-    }
-  }
-}
-
-/// Defines a lazy static field.
-/// After initial get or set, it will replace itself with a value property.
-// TODO(jmesserly): reusing descriptor objects has been shown to improve
-// performance in other projects (e.g. webcomponents.js ShadowDOM polyfill).
-defineLazyField(to, name, desc) => JS('', '''(() => {
-  const initializer = $desc.get;
-  let init = initializer;
-  let value = null;
-  let executed = false;
-  $desc.get = function() {
-    if (init == null) return value;
-    if (!executed) {
-      // Record the field on first execution so we can reset it later if
-      // needed (hot restart).
-      $_resetFields.push(() => {
-        init = initializer;
-        value = null;
-        executed = false;
-      });
-      executed = true;
-    }
-    value = init();
-    init = null;
-    return value;
-  };
-  $desc.configurable = true;
-  if ($desc.set != null) {
-    $desc.set = function(x) {
-      init = null;
-      value = x;
-      // executed is dead since init is set to null
-    };
-  }
-  return ${defineProperty(to, name, desc)};
-})()''');
-
-/// Defines a lazy static field with pre-null-safety semantics.
-defineLazyFieldOld(to, name, desc) => JS('', '''(() => {
-  const initializer = $desc.get;
-  let init = initializer;
-  let value = null;
-  $desc.get = function() {
-    if (init == null) return value;
-    let f = init;
-    init = $throwCyclicInitializationError;
-    if (f === init) f($name); // throw cycle error
-
-    // On the first (non-cyclic) execution, record the field so we can reset it
-    // later if needed (hot restart).
-    $_resetFields.push(() => {
-      init = initializer;
-      value = null;
-    });
-
-    // Try to evaluate the field, using try+catch to ensure we implement the
-    // correct Dart error semantics.
-    try {
-      value = f();
-      init = null;
-      return value;
-    } catch (e) {
-      init = null;
-      value = null;
-      throw e;
-    }
-  };
-  $desc.configurable = true;
-  if ($desc.set != null) {
-    $desc.set = function(x) {
-      init = null;
-      value = x;
-    };
-  }
-  return ${defineProperty(to, name, desc)};
-})()''');
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart
deleted file mode 100644
index 1f362a8..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart
+++ /dev/null
@@ -1,227 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// This library defines the association between runtime objects and
-/// runtime types.
-part of dart._runtime;
-
-/// Runtime type information.  This module defines the mapping from
-/// runtime objects to their runtime type information.  See the types
-/// module for the definition of how type information is represented.
-///
-/// There are two kinds of objects that represent "types" at runtime. A
-/// "runtime type" contains all of the data needed to implement the runtime
-/// type checking inserted by the compiler. These objects fall into four
-/// categories:
-///
-///   - Things represented by javascript primitives, such as
-///     null, numbers, booleans, strings, and symbols.  For these
-///     we map directly from the javascript type (given by typeof)
-///     to the appropriate class type from core, which serves as their
-///     rtti.
-///
-///   - Functions, which are represented by javascript functions.
-///     Representations of Dart functions always have a
-///     _runtimeType property attached to them with the appropriate
-///     rtti.
-///
-///   - Objects (instances) which are represented by instances of
-///     javascript (ES6) classes.  Their types are given by their
-///     classes, and the rtti is accessed by projecting out their
-///     constructor field.
-///
-///   - Types objects, which are represented as described in the types
-///     module.  Types always have a _runtimeType property attached to
-///     them with the appropriate rtti.  The rtti for these is always
-///     core.Type.  TODO(leafp): consider the possibility that we can
-///     reliably recognize type objects and map directly to core.Type
-///     rather than attaching this property everywhere.
-///
-/// The other kind of object representing a "type" is the instances of the
-/// dart:core Type class. These are the user visible objects you get by calling
-/// "runtimeType" on an object or using a class literal expression. These are
-/// different from the above objects, and are created by calling `wrapType()`
-/// on a runtime type.
-
-/// Tag a closure with a type.
-///
-/// `dart.fn(closure, type)` marks [closure] with the provided runtime [type].
-fn(closure, type) {
-  JS('', '#[#] = #', closure, _runtimeType, type);
-  return closure;
-}
-
-/// Tag a closure with a type that's computed lazily.
-///
-/// `dart.fn(closure, type)` marks [closure] with a getter that uses
-/// [computeType] to return the runtime type.
-///
-/// The getter/setter replaces the property with a value property, so the
-/// resulting function is compatible with [fn] and the type can be set again
-/// safely.
-lazyFn(closure, Object Function() computeType) {
-  defineAccessor(closure, _runtimeType,
-      get: () => defineValue(closure, _runtimeType, computeType()),
-      set: (value) => defineValue(closure, _runtimeType, value),
-      configurable: true);
-  return closure;
-}
-
-// TODO(vsm): How should we encode the runtime type?
-final Object _runtimeType = JS('!', 'Symbol("_runtimeType")');
-
-final Object _moduleName = JS('!', 'Symbol("_moduleName")');
-
-getFunctionType(obj) {
-  // TODO(vsm): Encode this properly on the function for Dart-generated code.
-  var args = JS<List>('!', 'Array(#.length).fill(#)', obj, dynamic);
-  return fnType(bottom, args, JS('', 'void 0'));
-}
-
-/// Returns the runtime representation of the type of obj.
-///
-/// The resulting object is used internally for runtime type checking. This is
-/// different from the user-visible Type object returned by calling
-/// `runtimeType` on some Dart object.
-getReifiedType(obj) {
-  switch (JS<String>('!', 'typeof #', obj)) {
-    case "object":
-      if (obj == null) return JS('', '#', Null);
-      if (_jsInstanceOf(obj, Object)) {
-        return JS('', '#.constructor', obj);
-      }
-      var result = JS('', '#[#]', obj, _extensionType);
-      if (result == null) return JS('', '#', jsobject);
-      return result;
-    case "function":
-      // All Dart functions and callable classes must set _runtimeType
-      var result = JS('', '#[#]', obj, _runtimeType);
-      if (result != null) return result;
-      return JS('', '#', jsobject);
-    case "undefined":
-      return JS('', '#', Null);
-    case "number":
-      return JS('', 'Math.floor(#) == # ? # : #', obj, obj, int, double);
-    case "boolean":
-      return JS('', '#', bool);
-    case "string":
-      return JS('', '#', String);
-    case "symbol":
-    default:
-      return JS('', '#', jsobject);
-  }
-}
-
-/// Return the module name for a raw library object.
-String? getModuleName(Object module) => JS('', '#[#]', module, _moduleName);
-
-final _loadedModules = JS('', 'new Map()');
-final _loadedPartMaps = JS('', 'new Map()');
-final _loadedSourceMaps = JS('', 'new Map()');
-
-List<String> getModuleNames() {
-  return JS<List<String>>('', 'Array.from(#.keys())', _loadedModules);
-}
-
-String? getSourceMap(String moduleName) {
-  return JS('!', '#.get(#)', _loadedSourceMaps, moduleName);
-}
-
-/// Return all library objects in the specified module.
-getModuleLibraries(String name) {
-  var module = JS('', '#.get(#)', _loadedModules, name);
-  if (module == null) return null;
-  JS('', '#[#] = #', module, _moduleName, name);
-  return module;
-}
-
-/// Return the part map for a specific module.
-getModulePartMap(String name) => JS('', '#.get(#)', _loadedPartMaps, name);
-
-/// Track all libraries
-void trackLibraries(
-    String moduleName, Object libraries, Object parts, String? sourceMap) {
-  if (parts is String) {
-    // Added for backwards compatibility.
-    // package:build_web_compilers currently invokes this without [parts]
-    // in its bootstrap code.
-    sourceMap = parts;
-    parts = JS('', '{}');
-  }
-  JS('', '#.set(#, #)', _loadedSourceMaps, moduleName, sourceMap);
-  JS('', '#.set(#, #)', _loadedModules, moduleName, libraries);
-  JS('', '#.set(#, #)', _loadedPartMaps, moduleName, parts);
-  _libraries = null;
-  _libraryObjects = null;
-  _parts = null;
-}
-
-List<String>? _libraries;
-Map<String, Object?>? _libraryObjects;
-Map<String, List<String>?>? _parts;
-
-_computeLibraryMetadata() {
-  _libraries = [];
-  _libraryObjects = {};
-  _parts = {};
-  var modules = getModuleNames();
-  for (var name in modules) {
-    // Add libraries from each module.
-    var module = getModuleLibraries(name);
-    // TODO(nshahan) Can we optimize this cast and the one below to use
-    // JsArray.of() to be more efficient?
-    var libraries = getOwnPropertyNames(module).cast<String>();
-    _libraries!.addAll(libraries);
-    for (var library in libraries) {
-      _libraryObjects![library] = JS('', '#.#', module, library);
-    }
-
-    // Add parts from each module.
-    var partMap = getModulePartMap(name);
-    libraries = getOwnPropertyNames(partMap).cast<String>();
-    for (var library in libraries) {
-      _parts![library] = List.from(JS('List', '#.#', partMap, library));
-    }
-  }
-}
-
-/// Returns the JS library object for a given library [uri] or
-/// undefined / null if it isn't loaded.  Top-level types and
-/// methods are available on this object.
-Object? getLibrary(String uri) {
-  if (_libraryObjects == null) {
-    _computeLibraryMetadata();
-  }
-  return _libraryObjects![uri];
-}
-
-/// Returns a JSArray of library uris (e.g,
-/// ['dart:core', 'dart:_internal', ..., 'package:foo/bar.dart', ... 'main.dart'])
-/// loaded in this application.
-List<String> getLibraries() {
-  if (_libraries == null) {
-    _computeLibraryMetadata();
-  }
-  return _libraries!;
-}
-
-/// Returns a JSArray of part uris for a given [libraryUri].
-/// The part uris will be relative to the [libraryUri].
-///
-/// E.g., invoking `getParts('package:intl/intl.dart')` returns (as of this
-/// writing): ```
-/// ["src/intl/bidi_formatter.dart", "src/intl/bidi_utils.dart",
-///  "src/intl/compact_number_format.dart", "src/intl/date_format.dart",
-///  "src/intl/date_format_field.dart", "src/intl/date_format_helpers.dart",
-///  "src/intl/number_format.dart"]
-/// ```
-///
-/// If [libraryUri] doesn't map to a library or maps to a library with no
-/// parts, an empty list is returned.
-List<String> getParts(String libraryUri) {
-  if (_parts == null) {
-    _computeLibraryMetadata();
-  }
-  return _parts![libraryUri] ?? [];
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
deleted file mode 100644
index 4867462..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright (c) 2015, 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.
-
-@ReifyFunctionTypes(false)
-library dart._runtime;
-
-import 'dart:async';
-import 'dart:collection';
-
-import 'dart:_debugger' show stackTraceMapper, trackCall;
-import 'dart:_foreign_helper' show JS, JSExportName, rest, spread;
-import 'dart:_interceptors' show JSArray, jsNull, JSFunction, NativeError;
-import 'dart:_internal' as internal show Symbol;
-import 'dart:_js_helper'
-    show
-        AssertionErrorImpl,
-        BooleanConversionAssertionError,
-        CastErrorImpl,
-        DartIterator,
-        TypeErrorImpl,
-        JsLinkedHashMap,
-        ImmutableMap,
-        PrivateSymbol,
-        ReifyFunctionTypes,
-        NoReifyGeneric,
-        notNull,
-        undefined;
-
-export 'dart:_debugger' show getDynamicStats, clearDynamicStats, trackCall;
-
-part 'utils.dart';
-part 'classes.dart';
-part 'rtti.dart';
-part 'types.dart';
-part 'errors.dart';
-part 'operations.dart';
-
-// TODO(vsm): Move polyfill code to dart:html.
-// Note, native extensions are registered onto types in dart.global.
-// This polyfill needs to run before the corresponding dart:html code is run.
-final _polyfilled = JS('', 'Symbol("_polyfilled")');
-
-bool polyfill(window) => JS('', '''(() => {
-  if ($window[$_polyfilled]) return false;
-  $window[$_polyfilled] = true;
-
-  if (typeof $window.NodeList !== "undefined") {
-    // TODO(vsm): Do we still need these?
-    $window.NodeList.prototype.get = function(i) { return this[i]; };
-    $window.NamedNodeMap.prototype.get = function(i) { return this[i]; };
-    $window.DOMTokenList.prototype.get = function(i) { return this[i]; };
-    $window.HTMLCollection.prototype.get = function(i) { return this[i]; };
-
-    // Expose constructors for DOM types dart:html needs to assume are
-    // available on window.
-    if (typeof $window.PannerNode == "undefined") {
-      let audioContext;
-      if (typeof $window.AudioContext == "undefined" &&
-          (typeof $window.webkitAudioContext != "undefined")) {
-        audioContext = new $window.webkitAudioContext();
-      } else {
-        audioContext = new $window.AudioContext();
-        $window.StereoPannerNode =
-            audioContext.createStereoPanner().constructor;
-      }
-      $window.PannerNode = audioContext.createPanner().constructor;
-    }
-    if (typeof $window.AudioSourceNode == "undefined") {
-      $window.AudioSourceNode = MediaElementAudioSourceNode.__proto__;
-    }
-    if (typeof $window.FontFaceSet == "undefined") {
-      // CSS Font Loading is not supported on Edge.
-      if (typeof $window.document.fonts != "undefined") {
-        $window.FontFaceSet = $window.document.fonts.__proto__.constructor;
-      }
-    }
-    if (typeof $window.MemoryInfo == "undefined") {
-      if (typeof $window.performance.memory != "undefined") {
-        $window.MemoryInfo = $window.performance.memory.constructor;
-      }
-    }
-    if (typeof $window.Geolocation == "undefined") {
-      $window.Geolocation == $window.navigator.geolocation.constructor;
-    }
-    if (typeof $window.Animation == "undefined") {
-      let d = $window.document.createElement('div');
-      if (typeof d.animate != "undefined") {
-        $window.Animation = d.animate(d).constructor;
-      }
-    }
-    if (typeof $window.SourceBufferList == "undefined") {
-      if ('MediaSource' in $window) {
-        $window.SourceBufferList =
-          new $window.MediaSource().sourceBuffers.constructor;
-      }
-    }
-    if (typeof $window.SpeechRecognition == "undefined") {
-      $window.SpeechRecognition = $window.webkitSpeechRecognition;
-      $window.SpeechRecognitionError = $window.webkitSpeechRecognitionError;
-      $window.SpeechRecognitionEvent = $window.webkitSpeechRecognitionEvent;
-    }
-  }
-  return true;
-})()''');
-
-@JSExportName('global')
-final Object global_ = JS('', '''
-  function () {
-    // Find global object.
-    var globalState = (typeof window != "undefined") ? window
-      : (typeof global != "undefined") ? global
-      : (typeof self != "undefined") ? self : null;
-    if (!globalState) {
-      // Some platforms (e.g., d8) do not define any of the above.  The
-      // following is a non-CSP safe way to access the global object:
-      globalState = new Function('return this;')();
-    }
-
-    $polyfill(globalState);
-
-    // By default, stack traces cutoff at 10.  Set the limit to Infinity for
-    // better debugging.
-    if (globalState.Error) {
-      globalState.Error.stackTraceLimit = Infinity;
-    }
-
-    // These settings must be configured before the application starts so that
-    // user code runs with the correct configuration.
-    let settings = 'ddcSettings' in globalState ? globalState.ddcSettings : {};
-
-    $trackProfile(
-        'trackProfile' in settings ? settings.trackProfile : false);
-
-    return globalState;
-  }()
-''');
-
-void trackProfile(bool flag) {
-  JS('', 'dart.__trackProfile = #', flag);
-}
-
-final JsSymbol = JS('', 'Symbol');
-
-/// The prototype used for all Dart libraries.
-///
-/// This makes it easy to identify Dart library objects, and also improves
-/// performance (JS engines such as V8 tend to assume `Object.create(null)` is
-/// used for a Map, so they don't optimize it as they normally would for
-/// class-like objects).
-///
-/// The `dart.library` field is set by the compiler during SDK bootstrapping
-/// (because it is needed for dart:_runtime itself), so we don't need to
-/// initialize it here. The name `dart.library` is used because it reads nicely,
-/// for example:
-///
-///     const my_library = Object.create(dart.library);
-///
-Object libraryPrototype = JS('', 'dart.library');
-
-// TODO(vsm): Remove once this flag we've removed the ability to
-// whitelist / fallback on the old behavior.
-bool startAsyncSynchronously = true;
-void setStartAsyncSynchronously([bool value = true]) {
-  startAsyncSynchronously = value;
-}
-
-/// A list of all JS Maps used for caching results, such as by [isSubtypeOf] and
-/// [generic].
-///
-/// This is used by [hotRestart] to ensure we don't leak types from previous
-/// libraries.
-/// Results made against Null are cached in _nullComparisonSet and must be
-/// cleared separately.
-@notNull
-final List<Object> _cacheMaps = JS('!', '[]');
-
-/// A list of functions to reset static fields back to their uninitialized
-/// state.
-///
-/// This is populated by [defineLazyField], and only contains the list of fields
-/// that have actually been initialized.
-@notNull
-final List<void Function()> _resetFields = JS('', '[]');
-
-/// A counter to track each time [hotRestart] is invoked. This is used to ensure
-/// that pending callbacks that were created on a previous iteration (e.g. a
-/// timer callback or a DOM callback) will not execute when they get invoked.
-// TODO(sigmund): consider whether we should track and cancel callbacks to
-// reduce memory leaks.
-int hotRestartIteration = 0;
-
-/// Clears out runtime state in `dartdevc` so we can hot-restart.
-///
-/// This should be called when the user requests a hot-restart, when the UI is
-/// handling that user action.
-void hotRestart() {
-  // TODO(sigmund): prevent DOM callbacks from firing.
-  hotRestartIteration++;
-  for (var f in _resetFields) f();
-  _resetFields.clear();
-  for (var m in _cacheMaps) JS('', '#.clear()', m);
-  _cacheMaps.clear();
-  JS('', '#.clear()', _nullComparisonSet);
-  JS('', '#.clear()', constantMaps);
-}
-
-/// Marks enqueuing an async operation.
-///
-/// This will be called by library code when enqueuing an async operation
-/// controlled by the JavaScript event handler.
-///
-/// It will also call [removeAsyncCallback] when Dart callback is about to be
-/// executed (note this is called *before* the callback executes, so more
-/// async operations could be added from that).
-void Function() addAsyncCallback = JS('', 'function() {}');
-
-/// Marks leaving a javascript async operation.
-///
-/// See [addAsyncCallback].
-void Function() removeAsyncCallback = JS('', 'function() {}');
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
deleted file mode 100644
index 41cc31d..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart
+++ /dev/null
@@ -1,2022 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// This library defines the representation of runtime types.
-part of dart._runtime;
-
-_throwNullSafetyWarningError() => throw UnsupportedError(
-    'Null safety errors cannot be shown as warnings when running with sound '
-    'null safety.');
-
-@notNull
-bool _setNullSafety = false;
-
-@notNull
-bool strictNullSafety = false;
-
-/// Sets the mode of the runtime subtype checks.
-///
-/// Changing the mode after the application has started running is not
-/// supported.
-void nullSafety(bool soundNullSafety) {
-  if (_setNullSafety) {
-    throw UnsupportedError('The Null Safety mode can only be set once.');
-  }
-
-  if (soundNullSafety && _weakNullSafetyWarnings)
-    _throwNullSafetyWarningError();
-
-  strictNullSafety = soundNullSafety;
-  _setNullSafety = true;
-}
-
-@notNull
-bool _weakNullSafetyWarnings = false;
-
-/// Sets the runtime mode to show warnings when running with weak null safety.
-///
-/// These are warnings for issues that will become errors when sound null safety
-/// is enabled. Showing warnings while running with sound null safety is not
-/// supported (they will be errors).
-void weakNullSafetyWarnings(bool showWarnings) {
-  if (showWarnings && strictNullSafety) _throwNullSafetyWarningError();
-
-  _weakNullSafetyWarnings = showWarnings;
-}
-
-final metadata = JS('', 'Symbol("metadata")');
-
-/// Types in dart are represented internally at runtime as follows.
-///
-///   - Normal nominal types, produced from classes, are represented
-///     at runtime by the JS class of which they are an instance.
-///     If the type is the result of instantiating a generic class,
-///     then the "classes" module manages the association between the
-///     instantiated class and the original class declaration
-///     and the type arguments with which it was instantiated.  This
-///     association can be queried via the "classes" module".
-///
-///   - All other types are represented as instances of class [DartType],
-///     defined in this module.
-///     - Dynamic, Void, and Bottom are singleton instances of sentinel
-///       classes.
-///     - Function types are instances of subclasses of AbstractFunctionType.
-///
-/// Function types are represented in one of two ways:
-///   - As an instance of FunctionType.  These are eagerly computed.
-///   - As an instance of TypeDef.  The TypeDef representation lazily
-///     computes an instance of FunctionType, and delegates to that instance.
-///
-/// These above "runtime types" are what is used for implementing DDC's
-/// internal type checks. These objects are distinct from the objects exposed
-/// to user code by class literals and calling `Object.runtimeType`. In DDC,
-/// the latter are represented by instances of WrappedType which contain a
-/// real runtime type internally. This ensures that the returned object only
-/// exposes the API that Type defines:
-///
-///     get String name;
-///     String toString();
-///
-/// These "runtime types" have methods for performing type checks. The methods
-/// have the following JavaScript names which are designed to not collide with
-/// static methods, which are also placed 'on' the class constructor function.
-///
-///     T.is(o): Implements 'o is T'.
-///     T.as(o): Implements 'o as T'.
-///
-/// By convention, we used named JavaScript functions for these methods with the
-/// name 'is_X' and 'as_X' for various X to indicate the type or the
-/// implementation strategy for the test (e.g 'is_String', 'is_G' for generic
-/// types, etc.)
-// TODO(jmesserly): we shouldn't implement Type here. It should be moved down
-// to AbstractFunctionType.
-class DartType implements Type {
-  String get name => this.toString();
-
-  // TODO(jmesserly): these should never be reached, can be make them abstract?
-  @notNull
-  @JSExportName('is')
-  bool is_T(object) => instanceOf(object, this);
-
-  @JSExportName('as')
-  as_T(object) => cast(object, this);
-
-  DartType() {
-    // Every instance of a DartType requires a set of type caches.
-    JS('', '#(this)', addTypeCaches);
-  }
-}
-
-class DynamicType extends DartType {
-  toString() => 'dynamic';
-
-  @notNull
-  @JSExportName('is')
-  bool is_T(object) => true;
-
-  @JSExportName('as')
-  Object? as_T(Object? object) => object;
-}
-
-@notNull
-bool _isJsObject(obj) => JS('!', '# === #', getReifiedType(obj), jsobject);
-
-/// Asserts that [f] is a native JS functions and returns it if so.
-///
-/// This function should be used to ensure that a function is a native JS
-/// function before it is passed to native JS code.
-@NoReifyGeneric()
-F assertInterop<F extends Function>(F f) {
-  assert(
-      _isJsObject(f) ||
-          !JS<bool>('bool', '# instanceof #.Function', f, global_),
-      'Dart function requires `allowInterop` to be passed to JavaScript.');
-  return f;
-}
-
-bool isDartFunction(obj) =>
-    JS<bool>('!', '# instanceof Function', obj) &&
-    JS<bool>('!', '#[#] != null', obj, _runtimeType);
-
-Expando<Function> _assertInteropExpando = Expando<Function>();
-
-@NoReifyGeneric()
-F tearoffInterop<F extends Function?>(F f) {
-  // Wrap a JS function with a closure that ensures all function arguments are
-  // native JS functions.
-  if (!_isJsObject(f) || f == null) return f;
-  var ret = _assertInteropExpando[f];
-  if (ret == null) {
-    ret = JS(
-        '',
-        'function (...arguments) {'
-            ' var args = arguments.map(#);'
-            ' return #.apply(this, args);'
-            '}',
-        assertInterop,
-        f);
-    _assertInteropExpando[f] = ret;
-  }
-  // Suppress a cast back to F.
-  return JS('', '#', ret);
-}
-
-/// The Dart type that represents a JavaScript class(/constructor) type.
-///
-/// The JavaScript type may not exist, either because it's not loaded yet, or
-/// because it's not available (such as with mocks). To handle this gracefully,
-/// we disable type checks for in these cases, and allow any JS object to work
-/// as if it were an instance of this JS type.
-class LazyJSType extends DartType {
-  Function()? _getRawJSTypeFn;
-  @notNull
-  final String _dartName;
-  Object? _rawJSType;
-
-  LazyJSType(this._getRawJSTypeFn, this._dartName);
-
-  toString() {
-    var raw = _getRawJSType();
-    return raw != null ? typeName(raw) : "JSObject<$_dartName>";
-  }
-
-  Object? _getRawJSType() {
-    var raw = _rawJSType;
-    if (raw != null) return raw;
-
-    // Try to evaluate the JS type. If this fails for any reason, we'll try
-    // again next time.
-    // TODO(jmesserly): is it worth trying again? It may create unnecessary
-    // overhead, especially if exceptions are being thrown. Also it means the
-    // behavior of a given type check can change later on.
-    try {
-      raw = _getRawJSTypeFn!();
-    } catch (e) {}
-
-    if (raw == null) {
-      _warn('Cannot find native JavaScript type ($_dartName) for type check');
-    } else {
-      _rawJSType = raw;
-      _getRawJSTypeFn = null; // Free the function that computes the JS type.
-    }
-    return raw;
-  }
-
-  Object rawJSTypeForCheck() => _getRawJSType() ?? jsobject;
-
-  @notNull
-  bool isRawJSType(obj) {
-    var raw = _getRawJSType();
-    if (raw != null) return JS('!', '# instanceof #', obj, raw);
-    return _isJsObject(obj);
-  }
-
-  @notNull
-  @JSExportName('is')
-  bool is_T(obj) => isRawJSType(obj) || instanceOf(obj, this);
-
-  @JSExportName('as')
-  as_T(obj) => obj == null || is_T(obj) ? obj : castError(obj, this);
-}
-
-/// An anonymous JS type
-///
-/// For the purposes of subtype checks, these match any JS type.
-class AnonymousJSType extends DartType {
-  final String _dartName;
-  AnonymousJSType(this._dartName);
-  toString() => _dartName;
-
-  @JSExportName('is')
-  bool is_T(obj) => _isJsObject(obj) || instanceOf(obj, this);
-
-  @JSExportName('as')
-  as_T(obj) => obj == null || _isJsObject(obj) ? obj : cast(obj, this);
-}
-
-void _warn(arg) {
-  JS('void', 'console.warn(#)', arg);
-}
-
-void _nullWarn(arg) {
-  if (_weakNullSafetyWarnings) {
-    _warn('$arg\n'
-        'This will become a failure when runtime null safety is enabled.');
-  }
-}
-
-/// Tracks objects that have been compared against null (i.e., null is Type).
-/// Separating this null set out from _cacheMaps lets us fast-track common
-/// legacy type checks.
-/// TODO: Delete this set when legacy nullability is phased out.
-var _nullComparisonSet = JS<Object>('', 'new Set()');
-
-/// Warn on null cast failures when casting to a particular non-nullable
-/// `type`.  Note, we cache by type to avoid excessive warning messages at
-/// runtime.
-/// TODO(vsm): Consider changing all invocations to pass / cache on location
-/// instead.  That gives more useful feedback to the user.
-void _nullWarnOnType(type) {
-  bool result = JS('', '#.has(#)', _nullComparisonSet, type);
-  if (!result) {
-    JS('', '#.add(#)', _nullComparisonSet, type);
-    _nullWarn("Null is not a subtype of $type.");
-  }
-}
-
-var _lazyJSTypes = JS<Object>('', 'new Map()');
-var _anonymousJSTypes = JS<Object>('', 'new Map()');
-
-lazyJSType(Function() getJSTypeCallback, String name) {
-  var ret = JS('', '#.get(#)', _lazyJSTypes, name);
-  if (ret == null) {
-    ret = LazyJSType(getJSTypeCallback, name);
-    JS('', '#.set(#, #)', _lazyJSTypes, name, ret);
-  }
-  return ret;
-}
-
-anonymousJSType(String name) {
-  var ret = JS('', '#.get(#)', _anonymousJSTypes, name);
-  if (ret == null) {
-    ret = AnonymousJSType(name);
-    JS('', '#.set(#, #)', _anonymousJSTypes, name, ret);
-  }
-  return ret;
-}
-
-/// A javascript Symbol used to store a canonical version of T? on T.
-final _cachedNullable = JS('', 'Symbol("cachedNullable")');
-
-/// A javascript Symbol used to store a canonical version of T* on T.
-final _cachedLegacy = JS('', 'Symbol("cachedLegacy")');
-
-/// A javascript Symbol used to store prior subtype checks and their results.
-final _subtypeCache = JS('', 'Symbol("_subtypeCache")');
-
-/// Returns a nullable (question, ?) version of [type].
-///
-/// The resulting type returned in a normalized form based on the rules from the
-/// normalization doc:
-/// https://github.com/dart-lang/language/blob/master/resources/type-system/normalization.md
-@notNull
-Object nullable(@notNull Object type) {
-  // Check if a nullable version of this type has already been created.
-  var cached = JS<Object>('', '#[#]', type, _cachedNullable);
-  if (JS<bool>('!', '# !== void 0', cached)) {
-    return cached;
-  }
-
-  // Cache a canonical nullable version of this type on this type.
-  Object cachedType = _computeNullable(type);
-  JS('', '#[#] = #', type, _cachedNullable, cachedType);
-  return cachedType;
-}
-
-Object _computeNullable(@notNull Object type) {
-  // *? normalizes to ?.
-  if (_jsInstanceOf(type, LegacyType)) {
-    return nullable(JS<Object>('!', '#.type', type));
-  }
-  if (_jsInstanceOf(type, NullableType) ||
-      _isTop(type) ||
-      _equalType(type, Null) ||
-      // Normalize FutureOr<T?>? --> FutureOr<T?>
-      // All other runtime FutureOr normalization is in `normalizeFutureOr()`.
-      ((_isFutureOr(type)) &&
-          _jsInstanceOf(
-              JS<Object>('!', '#[0]', getGenericArgs(type)), NullableType))) {
-    return type;
-  }
-  if (_equalType(type, Never)) return unwrapType(Null);
-  return NullableType(JS<Type>('!', '#', type));
-}
-
-/// Returns a legacy (star, *) version of [type].
-///
-/// The resulting type returned in a normalized form based on the rules from the
-/// normalization doc:
-/// https://github.com/dart-lang/language/blob/master/resources/type-system/normalization.md
-@notNull
-Object legacy(@notNull Object type) {
-  // Check if a legacy version of this type has already been created.
-  var cached = JS<Object>('', '#[#]', type, _cachedLegacy);
-  if (JS<bool>('!', '# !== void 0', cached)) {
-    return cached;
-  }
-
-  // Cache a canonical legacy version of this type on this type.
-  Object cachedType = _computeLegacy(type);
-  JS('', '#[#] = #', type, _cachedLegacy, cachedType);
-  return cachedType;
-}
-
-Object _computeLegacy(@notNull Object type) {
-  // Note: ?* normalizes to ?, so we cache type? at type?[_cachedLegacy].
-  if (_jsInstanceOf(type, LegacyType) ||
-      _jsInstanceOf(type, NullableType) ||
-      _isTop(type) ||
-      _equalType(type, Null)) {
-    return type;
-  }
-  return LegacyType(JS<Type>('!', '#', type));
-}
-
-/// A wrapper to identify a nullable (question, ?) type of the form [type]?.
-class NullableType extends DartType {
-  final Type type;
-
-  NullableType(@notNull this.type);
-
-  @override
-  String get name => '$type?';
-
-  @override
-  String toString() => name;
-
-  @JSExportName('is')
-  bool is_T(obj) => obj == null || JS<bool>('!', '#.is(#)', type, obj);
-
-  @JSExportName('as')
-  as_T(obj) => obj == null || JS<bool>('!', '#.is(#)', type, obj)
-      ? obj
-      : cast(obj, this);
-}
-
-/// A wrapper to identify a legacy (star, *) type of the form [type]*.
-class LegacyType extends DartType {
-  final Type type;
-
-  LegacyType(@notNull this.type);
-
-  @override
-  String get name => '$type';
-
-  @override
-  String toString() => name;
-
-  @JSExportName('is')
-  bool is_T(obj) {
-    if (obj == null) {
-      // Object and Never are the only legacy types that should return true if
-      // obj is `null`.
-      return _equalType(type, Object) || _equalType(type, Never);
-    }
-    return JS<bool>('!', '#.is(#)', type, obj);
-  }
-
-  @JSExportName('as')
-  as_T(obj) => obj == null || JS<bool>('!', '#.is(#)', type, obj)
-      ? obj
-      : cast(obj, this);
-}
-
-// TODO(nshahan) Add override optimizations for is and as?
-class NeverType extends DartType {
-  @override
-  toString() => 'Never';
-}
-
-@JSExportName('Never')
-final _never = NeverType();
-
-@JSExportName('dynamic')
-final _dynamic = DynamicType();
-
-class VoidType extends DartType {
-  toString() => 'void';
-
-  @notNull
-  @JSExportName('is')
-  bool is_T(object) => true;
-
-  @JSExportName('as')
-  Object? as_T(Object? object) => object;
-}
-
-@JSExportName('void')
-final void_ = VoidType();
-
-// TODO(nshahan): Cleanup and consolidate NeverType, BottomType, bottom, _never.
-class BottomType extends DartType {
-  toString() => 'bottom';
-}
-
-final bottom = unwrapType(Null);
-
-class JSObjectType extends DartType {
-  toString() => 'NativeJavaScriptObject';
-}
-
-final jsobject = JSObjectType();
-
-/// Dev Compiler's implementation of Type, wrapping its internal [_type].
-class _Type extends Type {
-  /// The internal type representation, either a [DartType] or class constructor
-  /// function.
-  // TODO(jmesserly): introduce InterfaceType so we don't have to special case
-  // classes
-  @notNull
-  final Object _type;
-
-  _Type(this._type);
-
-  toString() => typeName(_type);
-
-  Type get runtimeType => Type;
-}
-
-/// Given an internal runtime type object [type], wraps it in a `_Type` object
-/// that implements the dart:core Type interface.
-///
-/// [isNormalized] is true when [type] is known to be in a canonicalized
-/// normal form, so the algorithm can directly wrap and return the value.
-Type wrapType(type, [@notNull bool isNormalized = false]) {
-  // If we've already wrapped this type once, use the previous wrapper. This
-  // way, multiple references to the same type return an identical Type.
-  if (JS('!', '#.hasOwnProperty(#)', type, _typeObject)) {
-    return JS('', '#[#]', type, _typeObject);
-  }
-  var result = isNormalized
-      ? _Type(type)
-      : (_jsInstanceOf(type, LegacyType)
-          ? wrapType(JS<Object>('!', '#.type', type))
-          : _canonicalizeNormalizedTypeObject(type));
-  JS('', '#[#] = #', type, _typeObject, result);
-  return result;
-}
-
-/// Constructs a normalized version of a type.
-///
-/// Used for type object identity. Normalization requires us to return a
-/// canonicalized version of the input with all legacy wrappers removed.
-Type _canonicalizeNormalizedTypeObject(type) {
-  assert(!_jsInstanceOf(type, LegacyType));
-  // We don't call _canonicalizeNormalizedTypeObject recursively but call wrap
-  // + unwrap to handle legacy types automatically and force caching the
-  // canonicalized type under the _typeObject cache property directly. This
-  // way we ensure we always use the canonical normalized instance for each
-  // type term.
-  Object normalizeHelper(a) => unwrapType(wrapType(a));
-
-  // GenericFunctionTypeIdentifiers are implicitly normalized.
-  if (_jsInstanceOf(type, GenericFunctionTypeIdentifier)) {
-    return wrapType(type, true);
-  }
-  if (_jsInstanceOf(type, FunctionType)) {
-    var normReturnType = normalizeHelper(type.returnType);
-    var normArgs = type.args.map(normalizeHelper).toList();
-    if (JS<bool>('!', '#.Object.keys(#).length === 0', global_, type.named) &&
-        JS<bool>('!', '#.Object.keys(#).length === 0', global_,
-            type.requiredNamed)) {
-      if (type.optionals.isEmpty) {
-        var normType = fnType(normReturnType, normArgs);
-        return wrapType(normType, true);
-      }
-      var normOptionals = type.optionals.map(normalizeHelper).toList();
-      var normType = fnType(normReturnType, normArgs, normOptionals);
-      return wrapType(normType, true);
-    }
-    var normNamed = JS('', '{}');
-    _transformJSObject(type.named, normNamed, normalizeHelper);
-    var normRequiredNamed = JS('', '{}');
-    _transformJSObject(type.requiredNamed, normRequiredNamed, normalizeHelper);
-    var normType =
-        fnType(normReturnType, normArgs, normNamed, normRequiredNamed);
-    return wrapType(normType, true);
-  }
-  if (_jsInstanceOf(type, GenericFunctionType)) {
-    var formals = _getCanonicalTypeFormals(type.typeFormals.length);
-    var normBounds =
-        type.instantiateTypeBounds(formals).map(normalizeHelper).toList();
-    var normFunc = normalizeHelper(type.instantiate(formals)) as FunctionType;
-    // Create a comparison key for structural identity.
-    var typeObjectIdKey = JS('', '[]');
-    JS('', '#.push(...#)', typeObjectIdKey, normBounds);
-    JS('', '#.push(#)', typeObjectIdKey, normFunc);
-    var memoizedId = _memoizeArray(_gFnTypeTypeMap, typeObjectIdKey,
-        () => GenericFunctionTypeIdentifier(formals, normBounds, normFunc));
-    return wrapType(memoizedId, true);
-  }
-  var args = getGenericArgs(type);
-  var normType;
-  if (args == null || args.isEmpty) {
-    normType = type;
-  } else {
-    var genericClass = getGenericClass(type);
-    var normArgs = args.map(normalizeHelper).toList();
-    normType = JS('!', '#(...#)', genericClass, normArgs);
-  }
-  return wrapType(normType, true);
-}
-
-/// Generates new values by applying [transform] to the values of [srcObject],
-/// storing them in [dstObject] with the same key.
-void _transformJSObject(srcObject, dstObject, Function transform) {
-  for (Object key in JS('!', '#.Object.keys(#)', global_, srcObject)) {
-    JS('', '#[#] = #', dstObject, key,
-        transform(JS('', '#[#]', srcObject, key)));
-  }
-}
-
-/// The symbol used to store the cached `Type` object associated with a class.
-final _typeObject = JS('', 'Symbol("typeObject")');
-
-/// Given a WrappedType, return the internal runtime type object.
-Object unwrapType(Type obj) => JS<_Type>('', '#', obj)._type;
-
-// Marker class for generic functions, typedefs, and non-generic functions.
-abstract class AbstractFunctionType extends DartType {}
-
-/// Memo table for named argument groups. A named argument packet
-/// {name1 : type1, ..., namen : typen} corresponds to the path
-/// n, name1, type1, ...., namen, typen.  The element of the map
-/// reached via this path (if any) is the canonical representative
-/// for this packet.
-final _fnTypeNamedArgMap = JS('', 'new Map()');
-
-/// Memo table for positional argument groups. A positional argument
-/// packet [type1, ..., typen] (required or optional) corresponds to
-/// the path n, type1, ...., typen.  The element reached via
-/// this path (if any) is the canonical representative for this
-/// packet. Note that required and optional parameters packages
-/// may have the same canonical representation.
-final _fnTypeArrayArgMap = JS('', 'new Map()');
-
-/// Memo table for function types. The index path consists of the
-/// path length - 1, the returnType, the canonical positional argument
-/// packet, and if present, the canonical optional or named argument
-/// packet.  A level of indirection could be avoided here if desired.
-final _fnTypeTypeMap = JS('', 'new Map()');
-
-/// Memo table for small function types with no optional or named
-/// arguments and less than a fixed n (currently 3) number of
-/// required arguments.  Indexing into this table by the number
-/// of required arguments yields a map which is indexed by the
-/// argument types themselves.  The element reached via this
-/// index path (if present) is the canonical function type.
-final List _fnTypeSmallMap = JS('', '[new Map(), new Map(), new Map()]');
-
-/// Memo table for generic function types. The index path consists of the
-/// type parameters' bounds and the underlying function instantiated to its
-/// bounds, subject to the same restrictions mentioned in _fnTypeTypeMap.
-final _gFnTypeTypeMap = JS('', 'new Map()');
-
-/// Pre-initialized type variables used to ensure that generic functions with
-/// the same generic relationship structure but different names canonicalize
-/// correctly.
-final _typeVariablePool = <TypeVariable>[];
-
-/// Returns a canonicalized sequence of type variables of size [count].
-List<TypeVariable> _getCanonicalTypeFormals(int count) {
-  while (count > _typeVariablePool.length) {
-    _fillTypeVariable();
-  }
-  return _typeVariablePool.sublist(0, count);
-}
-
-/// Inserts a new type variable into _typeVariablePool according to a
-/// pre-determined pattern.
-///
-/// The first 26 generics are alphanumerics; the remainder are represented as
-/// T$N, where N increments from 0.
-void _fillTypeVariable() {
-  if (_typeVariablePool.length < 26) {
-    _typeVariablePool
-        .add(TypeVariable(String.fromCharCode(65 + _typeVariablePool.length)));
-  } else {
-    _typeVariablePool.add(TypeVariable('T${_typeVariablePool.length - 26}'));
-  }
-}
-
-@NoReifyGeneric()
-T _memoizeArray<T>(map, arr, T create()) => JS('', '''(() => {
-  let len = $arr.length;
-  $map = $_lookupNonTerminal($map, len);
-  for (var i = 0; i < len-1; ++i) {
-    $map = $_lookupNonTerminal($map, $arr[i]);
-  }
-  let result = $map.get($arr[len-1]);
-  if (result !== void 0) return result;
-  $map.set($arr[len-1], result = $create());
-  return result;
-})()''');
-
-List _canonicalizeArray(List array, map) =>
-    _memoizeArray(map, array, () => array);
-
-// TODO(leafp): This only canonicalizes if the names are emitted
-// in a consistent order.
-_canonicalizeNamed(named, map) => JS('', '''(() => {
-  let key = [];
-  let names = $getOwnPropertyNames($named);
-  for (var i = 0; i < names.length; ++i) {
-    let name = names[i];
-    let type = $named[name];
-    key.push(name);
-    key.push(type);
-  }
-  return $_memoizeArray($map, key, () => $named);
-})()''');
-
-// TODO(leafp): This handles some low hanging fruit, but
-// really we should make all of this faster, and also
-// handle more cases here.
-FunctionType _createSmall(returnType, List required) => JS('', '''(() => {
-  let count = $required.length;
-  let map = $_fnTypeSmallMap[count];
-  for (var i = 0; i < count; ++i) {
-    map = $_lookupNonTerminal(map, $required[i]);
- }
- let result = map.get($returnType);
- if (result !== void 0) return result;
- result = ${new FunctionType(returnType, required, [], JS('', '{}'), JS('', '{}'))};
- map.set($returnType, result);
- return result;
-})()''');
-
-class FunctionType extends AbstractFunctionType {
-  final Type returnType;
-  final List args;
-  final List optionals;
-  // Named arguments native JS Object of the form { namedArgName: namedArgType }
-  final named;
-  final requiredNamed;
-  String? _stringValue;
-
-  /// Construct a function type.
-  ///
-  /// We eagerly normalize the argument types to avoid having to deal with this
-  /// logic in multiple places.
-  ///
-  /// This code does best effort canonicalization.  It does not guarantee that
-  /// all instances will share.
-  ///
-  /// Note: Generic function subtype checks assume types have been canonicalized
-  /// when testing if type bounds are equal.
-  static FunctionType create(
-      returnType, List args, optionalArgs, requiredNamedArgs) {
-    // Note that if optionalArgs is ever passed as an empty array or an empty
-    // map, we can end up with semantically identical function types that don't
-    // canonicalize to the same object since we won't fall into this fast path.
-    var noOptionalArgs = optionalArgs == null && requiredNamedArgs == null;
-    if (noOptionalArgs && JS<bool>('!', '#.length < 3', args)) {
-      return _createSmall(returnType, args);
-    }
-    args = _canonicalizeArray(args, _fnTypeArrayArgMap);
-    var keys = [];
-    FunctionType Function() create;
-    if (noOptionalArgs) {
-      keys = [returnType, args];
-      create =
-          () => FunctionType(returnType, args, [], JS('', '{}'), JS('', '{}'));
-    } else if (JS('!', '# instanceof Array', optionalArgs)) {
-      var optionals =
-          _canonicalizeArray(JS('', '#', optionalArgs), _fnTypeArrayArgMap);
-      keys = [returnType, args, optionals];
-      create = () =>
-          FunctionType(returnType, args, optionals, JS('', '{}'), JS('', '{}'));
-    } else {
-      var named = _canonicalizeNamed(optionalArgs, _fnTypeNamedArgMap);
-      var requiredNamed =
-          _canonicalizeNamed(requiredNamedArgs, _fnTypeNamedArgMap);
-      keys = [returnType, args, named, requiredNamed];
-      create = () => FunctionType(returnType, args, [], named, requiredNamed);
-    }
-    return _memoizeArray(_fnTypeTypeMap, keys, create);
-  }
-
-  FunctionType(this.returnType, this.args, this.optionals, this.named,
-      this.requiredNamed);
-
-  toString() => name;
-
-  int get requiredParameterCount => args.length;
-  int get positionalParameterCount => args.length + optionals.length;
-
-  getPositionalParameter(int i) {
-    int n = args.length;
-    return i < n ? args[i] : optionals[i + n];
-  }
-
-  /// Maps argument names to their canonicalized type.
-  Map<String, Object> _createNameMap(List<Object?> names) {
-    var result = <String, Object>{};
-    // TODO: Remove this sort if ordering can be conserved.
-    JS('', '#.sort()', names);
-    for (var i = 0; JS<bool>('!', '# < #.length', i, names); ++i) {
-      String name = JS('!', '#[#]', names, i);
-      result[name] = JS('', '#[#]', named, name);
-    }
-    return result;
-  }
-
-  /// Maps optional named parameter names to their canonicalized type.
-  Map<String, Object> getNamedParameters() =>
-      _createNameMap(getOwnPropertyNames(named).toList());
-
-  /// Maps required named parameter names to their canonicalized type.
-  Map<String, Object> getRequiredNamedParameters() =>
-      _createNameMap(getOwnPropertyNames(requiredNamed).toList());
-
-  get name {
-    if (_stringValue != null) return _stringValue!;
-    var buffer = '(';
-    for (var i = 0; JS<bool>('!', '# < #.length', i, args); ++i) {
-      if (i > 0) {
-        buffer += ', ';
-      }
-      buffer += typeName(JS('', '#[#]', args, i));
-    }
-    if (JS('!', '#.length > 0', optionals)) {
-      if (JS('!', '#.length > 0', args)) buffer += ', ';
-      buffer += '[';
-      for (var i = 0; JS<bool>('!', '# < #.length', i, optionals); ++i) {
-        if (i > 0) {
-          buffer += ', ';
-        }
-        buffer += typeName(JS('', '#[#]', optionals, i));
-      }
-      buffer += ']';
-    } else if (JS('!', 'Object.keys(#).length > 0 || Object.keys(#).length > 0',
-        named, requiredNamed)) {
-      if (JS('!', '#.length > 0', args)) buffer += ', ';
-      buffer += '{';
-      var names = getOwnPropertyNames(named);
-      JS('', '#.sort()', names);
-      for (var i = 0; JS<bool>('!', '# < #.length', i, names); i++) {
-        if (i > 0) {
-          buffer += ', ';
-        }
-        var typeNameString = typeName(JS('', '#[#[#]]', named, names, i));
-        buffer += '$typeNameString ${JS('', '#[#]', names, i)}';
-      }
-      if (JS('!', 'Object.keys(#).length > 0 && #.length > 0', requiredNamed,
-          names)) buffer += ', ';
-      names = getOwnPropertyNames(requiredNamed);
-      JS('', '#.sort()', names);
-      for (var i = 0; JS<bool>('!', '# < #.length', i, names); i++) {
-        if (i > 0) {
-          buffer += ', ';
-        }
-        var typeNameString =
-            typeName(JS('', '#[#[#]]', requiredNamed, names, i));
-        buffer += 'required $typeNameString ${JS('', '#[#]', names, i)}';
-      }
-      buffer += '}';
-    }
-    var returnTypeName = typeName(returnType);
-    buffer += ') => $returnTypeName';
-    _stringValue = buffer;
-    return buffer;
-  }
-
-  @JSExportName('is')
-  bool is_T(obj) {
-    if (JS('!', 'typeof # == "function"', obj)) {
-      var actual = JS('', '#[#]', obj, _runtimeType);
-      // If there's no actual type, it's a JS function.
-      // Allow them to subtype all Dart function types.
-      return actual == null || isSubtypeOf(actual, this);
-    }
-    return false;
-  }
-
-  @JSExportName('as')
-  as_T(obj) {
-    if (is_T(obj)) return obj;
-    // TODO(nshahan) This could directly call castError after we no longer allow
-    // a cast of null to succeed in weak mode.
-    return cast(obj, this);
-  }
-}
-
-/// A type variable, used by [GenericFunctionType] to represent a type formal.
-class TypeVariable extends DartType {
-  final String name;
-
-  TypeVariable(this.name);
-
-  toString() => name;
-}
-
-class Variance {
-  static const int unrelated = 0;
-  static const int covariant = 1;
-  static const int contravariant = 2;
-  static const int invariant = 3;
-}
-
-/// Uniquely identifies the runtime type object of a generic function.
-///
-/// We require that all objects stored in this object not have legacy
-/// nullability wrappers.
-class GenericFunctionTypeIdentifier extends AbstractFunctionType {
-  final typeFormals;
-  final typeBounds;
-  final FunctionType function;
-  String? _stringValue;
-
-  GenericFunctionTypeIdentifier(
-      this.typeFormals, this.typeBounds, this.function);
-
-  /// Returns the string-representation of the first generic function
-  /// with this runtime type object canonicalization.
-  ///
-  /// Type formal names may not correspond to those of the originating type.
-  /// We should consider auto-generating these to avoid confusion.
-  toString() {
-    if (_stringValue != null) return _stringValue!;
-    String s = "<";
-    var typeFormals = this.typeFormals;
-    var typeBounds = this.typeBounds;
-    for (int i = 0, n = typeFormals.length; i < n; i++) {
-      if (i != 0) s += ", ";
-      s += JS<String>('!', '#[#].name', typeFormals, i);
-      var bound = typeBounds[i];
-      if (_equalType(bound, dynamic) ||
-          JS<bool>('!', '# === #', bound, nullable(unwrapType(Object))) ||
-          (!strictNullSafety && _equalType(bound, Object))) {
-        // Do not print the bound when it is a top type. In weak mode the bounds
-        // of Object and Object* will also be elided.
-        continue;
-      }
-      s += " extends $bound";
-    }
-    s += ">" + this.function.toString();
-    return this._stringValue = s;
-  }
-}
-
-class GenericFunctionType extends AbstractFunctionType {
-  final _instantiateTypeParts;
-  final int formalCount;
-  final _instantiateTypeBounds;
-  final List<TypeVariable> _typeFormals;
-
-  GenericFunctionType(instantiateTypeParts, this._instantiateTypeBounds)
-      : _instantiateTypeParts = instantiateTypeParts,
-        formalCount = JS('!', '#.length', instantiateTypeParts),
-        _typeFormals = _typeFormalsFromFunction(instantiateTypeParts);
-
-  List<TypeVariable> get typeFormals => _typeFormals;
-
-  /// `true` if there are bounds on any of the generic type parameters.
-  get hasTypeBounds => _instantiateTypeBounds != null;
-
-  /// Checks that [typeArgs] satisfies the upper bounds of the [typeFormals],
-  /// and throws a [TypeError] if they do not.
-  void checkBounds(List typeArgs) {
-    // If we don't have explicit type parameter bounds, the bounds default to
-    // a top type, so there's nothing to check here.
-    if (!hasTypeBounds) return;
-
-    var bounds = instantiateTypeBounds(typeArgs);
-    var typeFormals = this.typeFormals;
-    for (var i = 0; i < typeArgs.length; i++) {
-      checkTypeBound(typeArgs[i], bounds[i], typeFormals[i].name);
-    }
-  }
-
-  FunctionType instantiate(typeArgs) {
-    var parts = JS('', '#.apply(null, #)', _instantiateTypeParts, typeArgs);
-    return FunctionType.create(JS('', '#[0]', parts), JS('', '#[1]', parts),
-        JS('', '#[2]', parts), JS('', '#[3]', parts));
-  }
-
-  List<Object> instantiateTypeBounds(List typeArgs) {
-    if (!hasTypeBounds) {
-      // We omit the a bound to represent Object*. Other bounds are explicitly
-      // represented, including Object, Object? and dynamic.
-      // TODO(nshahan) Revisit this representation when more libraries have
-      // migrated to null safety.
-      return List<Object>.filled(formalCount, legacy(unwrapType(Object)));
-    }
-    // Bounds can be recursive or depend on other type parameters, so we need to
-    // apply type arguments and return the resulting bounds.
-    return JS<List<Object>>(
-        '!', '#.apply(null, #)', _instantiateTypeBounds, typeArgs);
-  }
-
-  toString() {
-    String s = "<";
-    var typeFormals = this.typeFormals;
-    var typeBounds = instantiateTypeBounds(typeFormals);
-    for (int i = 0, n = typeFormals.length; i < n; i++) {
-      if (i != 0) s += ", ";
-      s += JS<String>('!', '#[#].name', typeFormals, i);
-      var bound = typeBounds[i];
-      if (JS('!', '# !== # && # !== #', bound, dynamic, bound, Object)) {
-        s += " extends $bound";
-      }
-    }
-    s += ">" + instantiate(typeFormals).toString();
-    return s;
-  }
-
-  /// Given a [DartType] [type], if [type] is an uninstantiated
-  /// parameterized type then instantiate the parameters to their
-  /// bounds and return those type arguments.
-  ///
-  /// See the issue for the algorithm description:
-  /// <https://github.com/dart-lang/sdk/issues/27526#issuecomment-260021397>
-  List instantiateDefaultBounds() {
-    /// Returns `true` if the default value for the type bound should be
-    /// `dynamic`.
-    ///
-    /// Dart 2 with null safety uses dynamic as the default value for types
-    /// without explicit bounds.
-    ///
-    /// This is similar to [_isTop] but removes the check for `void` (it can't
-    /// be written as a bound) and adds a check of `Object*` in weak mode.
-    bool defaultsToDynamic(type) {
-      // Technically this is wrong, only implicit bounds of `Object?` and
-      // `Object*` should default to dynamic but code that observes the
-      // difference is rare.
-      if (_equalType(type, dynamic)) return true;
-      if (_jsInstanceOf(type, NullableType) ||
-          (!strictNullSafety && _jsInstanceOf(type, LegacyType))) {
-        return _equalType(JS('!', '#.type', type), Object);
-      }
-      return false;
-    }
-
-    var typeFormals = this.typeFormals;
-
-    // All type formals
-    var all = HashMap<TypeVariable, int>.identity();
-    // ground types, by index.
-    //
-    // For each index, this will be a ground type for the corresponding type
-    // formal if known, or it will be the original TypeVariable if we are still
-    // solving for it. This array is passed to `instantiateToBounds` as we are
-    // progressively solving for type variables.
-    var defaults = List<Object?>.filled(typeFormals.length, null);
-    // not ground
-    var partials = Map<TypeVariable, Object>.identity();
-
-    var typeBounds = this.instantiateTypeBounds(typeFormals);
-    for (var i = 0; i < typeFormals.length; i++) {
-      var typeFormal = typeFormals[i];
-      var bound = typeBounds[i];
-      all[typeFormal] = i;
-      if (defaultsToDynamic(bound)) {
-        // TODO(nshahan) Persist the actual default values into the runtime so
-        // they can be used here instead of using dynamic for all top types
-        // implicit or explicit.
-        defaults[i] = _dynamic;
-      } else {
-        defaults[i] = typeFormal;
-        partials[typeFormal] = bound;
-      }
-    }
-
-    bool hasFreeFormal(t) {
-      if (partials.containsKey(t)) return true;
-
-      // Ignore nullability wrappers.
-      if (_jsInstanceOf(t, LegacyType) || _jsInstanceOf(t, NullableType)) {
-        return hasFreeFormal(JS<Object>('!', '#.type', t));
-      }
-      // Generic classes and typedefs.
-      var typeArgs = getGenericArgs(t);
-      if (typeArgs != null) return typeArgs.any(hasFreeFormal);
-      if (t is GenericFunctionType) {
-        return hasFreeFormal(t.instantiate(t.typeFormals));
-      }
-      if (t is FunctionType) {
-        return hasFreeFormal(t.returnType) || t.args.any(hasFreeFormal);
-      }
-      return false;
-    }
-
-    var hasProgress = true;
-    while (hasProgress) {
-      hasProgress = false;
-      for (var typeFormal in partials.keys) {
-        var partialBound = partials[typeFormal]!;
-        if (!hasFreeFormal(partialBound)) {
-          int index = all[typeFormal]!;
-          defaults[index] = instantiateTypeBounds(defaults)[index];
-          partials.remove(typeFormal);
-          hasProgress = true;
-          break;
-        }
-      }
-    }
-
-    // If we stopped making progress, and not all types are ground,
-    // then the whole type is malbounded and an error should be reported
-    // if errors are requested, and a partially completed type should
-    // be returned.
-    if (partials.isNotEmpty) {
-      throwTypeError('Instantiate to bounds failed for type with '
-          'recursive generic bounds: ${typeName(this)}. '
-          'Try passing explicit type arguments.');
-    }
-    return defaults;
-  }
-
-  @notNull
-  @JSExportName('is')
-  bool is_T(obj) {
-    if (JS('!', 'typeof # == "function"', obj)) {
-      var actual = JS('', '#[#]', obj, _runtimeType);
-      return actual != null && isSubtypeOf(actual, this);
-    }
-    return false;
-  }
-
-  @JSExportName('as')
-  as_T(obj) {
-    if (is_T(obj)) return obj;
-    // TODO(nshahan) This could directly call castError after we no longer allow
-    // a cast of null to succeed in weak mode.
-    return cast(obj, this);
-  }
-}
-
-List<TypeVariable> _typeFormalsFromFunction(Object? typeConstructor) {
-  // Extract parameter names from the function parameters.
-  //
-  // This is not robust in general for user-defined JS functions, but it
-  // should handle the functions generated by our compiler.
-  //
-  // TODO(jmesserly): names of TypeVariables are only used for display
-  // purposes, such as when an error happens or if someone calls
-  // `Type.toString()`. So we could recover them lazily rather than eagerly.
-  // Alternatively we could synthesize new names.
-  String str = JS('!', '#.toString()', typeConstructor);
-  var hasParens = str[0] == '(';
-  var end = str.indexOf(hasParens ? ')' : '=>');
-  if (hasParens) {
-    return str
-        .substring(1, end)
-        .split(',')
-        .map((n) => TypeVariable(n.trim()))
-        .toList();
-  } else {
-    return [TypeVariable(str.substring(0, end).trim())];
-  }
-}
-
-/// Create a function type.
-FunctionType fnType(returnType, List args,
-        [@undefined optional, @undefined requiredNamed]) =>
-    FunctionType.create(returnType, args, optional, requiredNamed);
-
-/// Creates a generic function type from [instantiateFn] and [typeBounds].
-///
-/// A function type consists of two things:
-/// * An instantiate function that takes type arguments and returns the
-///   function signature in the form of a two element list. The first element
-///   is the return type. The second element is a list of the argument types.
-/// * A function that returns a list of upper bound constraints for each of
-///   the type formals.
-///
-/// Both functions accept the type parameters, allowing us to substitute values.
-/// The upper bound constraints can be omitted if all of the type parameters use
-/// the default upper bound.
-///
-/// For example given the type <T extends Iterable<T>>(T) -> T, we can declare
-/// this type with `gFnType(T => [T, [T]], T => [Iterable$(T)])`.
-gFnType(instantiateFn, typeBounds) =>
-    GenericFunctionType(instantiateFn, typeBounds);
-
-/// Whether the given JS constructor [obj] is a Dart class type.
-@notNull
-bool isType(obj) => JS('', '#[#] === #', obj, _runtimeType, Type);
-
-void checkTypeBound(
-    @notNull Object type, @notNull Object bound, @notNull String name) {
-  if (!isSubtypeOf(type, bound)) {
-    throwTypeError('type `$type` does not extend `$bound` of `$name`.');
-  }
-}
-
-@notNull
-String typeName(type) => JS('', '''(() => {
-  if ($type === void 0) return "undefined type";
-  if ($type === null) return "null type";
-  // Non-instance types
-  if (${_jsInstanceOf(type, DartType)}) {
-    return $type.toString();
-  }
-
-  // Instance types
-  let tag = $type[$_runtimeType];
-  if (tag === $Type) {
-    let name = $type.name;
-    let args = ${getGenericArgs(type)};
-    if (args == null) return name;
-
-    if (${getGenericClass(type)} == ${getGenericClass(JSArray)}) name = 'List';
-
-    let result = name;
-    result += '<';
-    for (let i = 0; i < args.length; ++i) {
-      if (i > 0) result += ', ';
-      result += $typeName(args[i]);
-    }
-    result += '>';
-    return result;
-  }
-  if (tag) return "Not a type: " + tag.name;
-  return "JSObject<" + $type.name + ">";
-})()''');
-
-/// Returns true if [ft1] <: [ft2].
-_isFunctionSubtype(ft1, ft2, @notNull bool strictMode) => JS('', '''(() => {
-  let ret1 = $ft1.returnType;
-  let ret2 = $ft2.returnType;
-
-  let args1 = $ft1.args;
-  let args2 = $ft2.args;
-
-  if (args1.length > args2.length) {
-    return false;
-  }
-
-  for (let i = 0; i < args1.length; ++i) {
-    if (!$_isSubtype(args2[i], args1[i], strictMode)) {
-      return false;
-    }
-  }
-
-  let optionals1 = $ft1.optionals;
-  let optionals2 = $ft2.optionals;
-
-  if (args1.length + optionals1.length < args2.length + optionals2.length) {
-    return false;
-  }
-
-  let j = 0;
-  for (let i = args1.length; i < args2.length; ++i, ++j) {
-    if (!$_isSubtype(args2[i], optionals1[j], strictMode)) {
-      return false;
-    }
-  }
-
-  for (let i = 0; i < optionals2.length; ++i, ++j) {
-    if (!$_isSubtype(optionals2[i], optionals1[j], strictMode)) {
-      return false;
-    }
-  }
-
-  // Named parameter invariants:
-  // 1) All named params in the superclass are named params in the subclass.
-  // 2) All required named params in the subclass are required named params
-  //    in the superclass.
-  // 3) With strict null checking disabled, we treat required named params as
-  //    optional named params.
-  let named1 = $ft1.named;
-  let requiredNamed1 = $ft1.requiredNamed;
-  let named2 = $ft2.named;
-  let requiredNamed2 = $ft2.requiredNamed;
-  if (!strictMode) {
-    // In weak mode, treat required named params as optional named params.
-    named1 = Object.assign({}, named1, requiredNamed1);
-    named2 = Object.assign({}, named2, requiredNamed2);
-    requiredNamed1 = {};
-    requiredNamed2 = {};
-  }
-
-  let names = $getOwnPropertyNames(requiredNamed1);
-  for (let i = 0; i < names.length; ++i) {
-    let name = names[i];
-    let n2 = requiredNamed2[name];
-    if (n2 === void 0) {
-      return false;
-    }
-  }
-  names = $getOwnPropertyNames(named2);
-  for (let i = 0; i < names.length; ++i) {
-    let name = names[i];
-    let n1 = named1[name];
-    let n2 = named2[name];
-    if (n1 === void 0) {
-      return false;
-    }
-    if (!$_isSubtype(n2, n1, strictMode)) {
-      return false;
-    }
-  }
-  names = $getOwnPropertyNames(requiredNamed2);
-  for (let i = 0; i < names.length; ++i) {
-    let name = names[i];
-    let n1 = named1[name] || requiredNamed1[name];
-    let n2 = requiredNamed2[name];
-    if (n1 === void 0) {
-      return false;
-    }
-    if (!$_isSubtype(n2, n1, strictMode)) {
-      return false;
-    }
-  }
-
-  return $_isSubtype(ret1, ret2, strictMode);
-})()''');
-
-/// Returns true if [t1] <: [t2].
-@notNull
-bool isSubtypeOf(@notNull Object t1, @notNull Object t2) {
-  // TODO(jmesserly): we've optimized `is`/`as`/implicit type checks, so they're
-  // dispatched on the type. Can we optimize the subtype relation too?
-  var map = JS<Object>('!', '#[#]', t1, _subtypeCache);
-  bool result = JS('', '#.get(#)', map, t2);
-  if (JS('!', '# !== void 0', result)) return result;
-
-  var validSubtype = _isSubtype(t1, t2, true);
-  if (!validSubtype && !strictNullSafety) {
-    validSubtype = _isSubtype(t1, t2, false);
-    if (validSubtype) {
-      // TODO(nshahan) Need more information to be helpful here.
-      // File and line number that caused the subtype check?
-      // Possibly break into debugger?
-      _nullWarn("$t1 is not a subtype of $t2.");
-    }
-  }
-  JS('', '#.set(#, #)', map, t2, validSubtype);
-  return validSubtype;
-}
-
-@notNull
-bool _isBottom(type, @notNull bool strictMode) =>
-    _equalType(type, Never) || (!strictMode && _equalType(type, Null));
-
-@notNull
-bool _isTop(type) {
-  if (_jsInstanceOf(type, NullableType))
-    return JS('!', '#.type === #', type, Object);
-
-  return _equalType(type, dynamic) || JS('!', '# === #', type, void_);
-}
-
-/// Wraps the JavaScript `instanceof` operator returning  `true` if [type] is an
-/// instance of [cls].
-///
-/// This method is equivalent to:
-///
-///    JS<bool>('!', '# instanceof #', type, cls);
-///
-/// but the code is generated by the compiler directly (a low-tech way of
-/// inlining).
-@notNull
-external bool _jsInstanceOf(type, cls);
-
-/// Returns `true` if [type] is [cls].
-///
-/// This method is equivalent to:
-///
-///    JS<bool>('!', '# === #', type, unwrapType(cls));
-///
-/// but the code is generated by the compiler directly (a low-tech way of
-/// inlining).
-@notNull
-external bool _equalType(type, cls);
-
-/// Extracts the type argument as an unwrapped type preserving all forms of
-/// nullability.
-///
-/// Acts as a way to bypass extra calls of [wrapType] and [unwrapType]. For
-/// example `typeRep<Object?>()` emits `dart.nullable(core.Object)` directly.
-@notNull
-external Type typeRep<T>();
-
-/// Extracts the type argument as an unwrapped type and performs a shallow
-/// replacement of the nullability to a legacy type.
-///
-/// Acts as a way to bypass extra calls of [wrapType] and [unwrapType]. For
-/// example `legacyTypeRep<Object>()` emits `dart.legacy(core.Object)` directly.
-@notNull
-external Type legacyTypeRep<T>();
-
-@notNull
-bool _isFutureOr(type) {
-  var genericClass = getGenericClass(type);
-  return JS<bool>('!', '# && # === #', genericClass, genericClass,
-      getGenericClass(FutureOr));
-}
-
-@notNull
-bool _isSubtype(t1, t2, @notNull bool strictMode) => JS<bool>('!', '''(() => {
-  if (!$strictMode) {
-    // Strip nullable types when performing check in weak mode.
-    // TODO(nshahan) Investigate stripping off legacy types as well.
-    if (${_jsInstanceOf(t1, NullableType)}) {
-      t1 = t1.type;
-    }
-    if (${_jsInstanceOf(t2, NullableType)}) {
-      t2 = t2.type;
-    }
-  }
-  if ($t1 === $t2) {
-    return true;
-  }
-
-  // Trivially true, "Right Top" or "Left Bottom".
-  if (${_isTop(t2)} || ${_isBottom(t1, strictMode)}) {
-    return true;
-  }
-
-  // "Left Top".
-  if (${_equalType(t1, dynamic)} || $t1 === $void_) {
-    return $_isSubtype($nullable($Object), $t2, $strictMode);
-  }
-
-  // "Right Object".
-  if (${_equalType(t2, Object)}) {
-    // TODO(nshahan) Need to handle type variables.
-    // https://github.com/dart-lang/sdk/issues/38816
-    if (${_isFutureOr(t1)}) {
-      let t1TypeArg = ${getGenericArgs(t1)}[0];
-      return $_isSubtype(t1TypeArg, $Object, $strictMode);
-    }
-
-    if (${_jsInstanceOf(t1, LegacyType)}) {
-      return $_isSubtype(t1.type, t2, $strictMode);
-    }
-
-    if (${_equalType(t1, Null)} || ${_jsInstanceOf(t1, NullableType)}) {
-      // Checks for t1 is dynamic or void already performed in "Left Top" test.
-      return false;
-    }
-    return true;
-  }
-
-  // "Left Null".
-  if (${_equalType(t1, Null)}) {
-    // TODO(nshahan) Need to handle type variables.
-    // https://github.com/dart-lang/sdk/issues/38816
-    if (${_isFutureOr(t2)}) {
-      let t2TypeArg = ${getGenericArgs(t2)}[0];
-      return $_isSubtype($Null, t2TypeArg, $strictMode);
-    }
-
-    return ${_equalType(t2, Null)} || ${_jsInstanceOf(t2, LegacyType)} ||
-        ${_jsInstanceOf(t2, NullableType)};
-  }
-
-  // "Left Legacy".
-  if (${_jsInstanceOf(t1, LegacyType)}) {
-    return $_isSubtype(t1.type, t2, $strictMode);
-  }
-
-  // "Right Legacy".
-  if (${_jsInstanceOf(t2, LegacyType)}) {
-    return $_isSubtype(t1, $nullable(t2.type), $strictMode);
-  }
-
-  // Handle FutureOr<T> union type.
-  if (${_isFutureOr(t1)}) {
-    let t1TypeArg = ${getGenericArgs(t1)}[0];
-    if (${_isFutureOr(t2)}) {
-      let t2TypeArg = ${getGenericArgs(t2)}[0];
-      // FutureOr<A> <: FutureOr<B> iff A <: B
-      // TODO(nshahan): Proven to not actually be true and needs cleanup.
-      // https://github.com/dart-lang/sdk/issues/38818
-      return $_isSubtype(t1TypeArg, t2TypeArg, $strictMode);
-    }
-
-    // given t1 is Future<A> | A, then:
-    // (Future<A> | A) <: t2 iff Future<A> <: t2 and A <: t2.
-    let t1Future = ${getGenericClass(Future)}(t1TypeArg);
-    // Known to handle the case FutureOr<Null> <: Future<Null>.
-    return $_isSubtype(t1Future, $t2, $strictMode) &&
-        $_isSubtype(t1TypeArg, $t2, $strictMode);
-  }
-
-  // "Left Nullable".
-  if (${_jsInstanceOf(t1, NullableType)}) {
-    // TODO(nshahan) Need to handle type variables.
-    // https://github.com/dart-lang/sdk/issues/38816
-    return $_isSubtype(t1.type, t2, $strictMode) && $_isSubtype($Null, t2, $strictMode);
-  }
-
-  if ($_isFutureOr($t2)) {
-    // given t2 is Future<A> | A, then:
-    // t1 <: (Future<A> | A) iff t1 <: Future<A> or t1 <: A
-    let t2TypeArg = ${getGenericArgs(t2)}[0];
-    let t2Future = ${getGenericClass(Future)}(t2TypeArg);
-    // TODO(nshahan) Need to handle type variables on the left.
-    // https://github.com/dart-lang/sdk/issues/38816
-    return $_isSubtype($t1, t2Future, $strictMode) || $_isSubtype($t1, t2TypeArg, $strictMode);
-  }
-
-  // "Right Nullable".
-  if (${_jsInstanceOf(t2, NullableType)}) {
-    // TODO(nshahan) Need to handle type variables.
-    // https://github.com/dart-lang/sdk/issues/38816
-    return $_isSubtype(t1, t2.type, $strictMode) || $_isSubtype(t1, $Null, $strictMode);
-  }
-
-  // "Traditional" name-based subtype check.  Avoid passing
-  // function types to the class subtype checks, since we don't
-  // currently distinguish between generic typedefs and classes.
-  if (!${_jsInstanceOf(t2, AbstractFunctionType)}) {
-    // t2 is an interface type.
-
-    if (${_jsInstanceOf(t1, AbstractFunctionType)}) {
-      // Function types are only subtypes of interface types `Function` (and top
-      // types, handled already above).
-      return ${_equalType(t2, Function)};
-    }
-
-    // All JS types are subtypes of anonymous JS types.
-    if ($t1 === $jsobject && ${_jsInstanceOf(t2, AnonymousJSType)}) {
-      return true;
-    }
-
-    // Compare two interface types.
-    return ${_isInterfaceSubtype(t1, t2, strictMode)};
-  }
-
-  // Function subtyping.
-  if (!${_jsInstanceOf(t1, AbstractFunctionType)}) {
-    return false;
-  }
-
-  // Handle generic functions.
-  if (${_jsInstanceOf(t1, GenericFunctionType)}) {
-    if (!${_jsInstanceOf(t2, GenericFunctionType)}) {
-      return false;
-    }
-
-    // Given generic functions g1 and g2, g1 <: g2 iff:
-    //
-    //     g1<TFresh> <: g2<TFresh>
-    //
-    // where TFresh is a list of fresh type variables that both g1 and g2 will
-    // be instantiated with.
-    let formalCount = $t1.formalCount;
-    if (formalCount !== $t2.formalCount) {
-      return false;
-    }
-
-    // Using either function's type formals will work as long as they're both
-    // instantiated with the same ones. The instantiate operation is guaranteed
-    // to avoid capture because it does not depend on its TypeVariable objects,
-    // rather it uses JS function parameters to ensure correct binding.
-    let fresh = $t2.typeFormals;
-
-    // Without type bounds all will instantiate to dynamic. Only need to check
-    // further if at least one of the functions has type bounds.
-    if ($t1.hasTypeBounds || $t2.hasTypeBounds) {
-      // Check the bounds of the type parameters of g1 and g2. Given a type
-      // parameter `T1 extends U1` from g1, and a type parameter `T2 extends U2`
-      // from g2, we must ensure that U1 and U2 are mutual subtypes.
-      //
-      // (Note there is no variance in the type bounds of type parameters of
-      // generic functions).
-      let t1Bounds = $t1.instantiateTypeBounds(fresh);
-      let t2Bounds = $t2.instantiateTypeBounds(fresh);
-      for (let i = 0; i < formalCount; i++) {
-        if (t1Bounds[i] != t2Bounds[i]) {
-          if (!($_isSubtype(t1Bounds[i], t2Bounds[i], $strictMode)
-              && $_isSubtype(t2Bounds[i], t1Bounds[i], $strictMode))) {
-            return false;
-          }
-        }
-      }
-    }
-
-    $t1 = $t1.instantiate(fresh);
-    $t2 = $t2.instantiate(fresh);
-  } else if (${_jsInstanceOf(t2, GenericFunctionType)}) {
-    return false;
-  }
-
-  // Handle non-generic functions.
-  return ${_isFunctionSubtype(t1, t2, strictMode)};
-})()''');
-
-bool _isInterfaceSubtype(t1, t2, @notNull bool strictMode) => JS('', '''(() => {
-  // If we have lazy JS types, unwrap them.  This will effectively
-  // reduce to a prototype check below.
-  if (${_jsInstanceOf(t1, LazyJSType)}) $t1 = $t1.rawJSTypeForCheck();
-  if (${_jsInstanceOf(t2, LazyJSType)}) $t2 = $t2.rawJSTypeForCheck();
-
-  if ($t1 === $t2) {
-    return true;
-  }
-  if (${_equalType(t1, Object)}) {
-    return false;
-  }
-
-  // Classes cannot subtype `Function` or vice versa.
-  if (${_equalType(t1, Function)} || ${_equalType(t2, Function)}) {
-    return false;
-  }
-
-  // If t1 is a JS Object, we may not hit core.Object.
-  if ($t1 == null) {
-    return ${_equalType(t2, Object)} || ${_equalType(t2, dynamic)};
-  }
-
-  // Check if t1 and t2 have the same raw type.  If so, check covariance on
-  // type parameters.
-  let raw1 = $getGenericClass($t1);
-  let raw2 = $getGenericClass($t2);
-  if (raw1 != null && raw1 == raw2) {
-    let typeArguments1 = $getGenericArgs($t1);
-    let typeArguments2 = $getGenericArgs($t2);
-    if (typeArguments1.length != typeArguments2.length) {
-      $assertFailed();
-    }
-    let variances = $getGenericArgVariances($t1);
-    for (let i = 0; i < typeArguments1.length; ++i) {
-      // When using implicit variance, variances will be undefined and
-      // considered covariant.
-      if (variances === void 0 || variances[i] == ${Variance.covariant}) {
-        if (!$_isSubtype(typeArguments1[i], typeArguments2[i], $strictMode)) {
-          return false;
-        }
-      } else if (variances[i] == ${Variance.contravariant}) {
-        if (!$_isSubtype(typeArguments2[i], typeArguments1[i], $strictMode)) {
-          return false;
-        }
-      } else if (variances[i] == ${Variance.invariant}) {
-        if (!$_isSubtype(typeArguments1[i], typeArguments2[i], $strictMode) ||
-            !$_isSubtype(typeArguments2[i], typeArguments1[i], $strictMode)) {
-          return false;
-        }
-      }
-    }
-    return true;
-  }
-
-  if ($_isInterfaceSubtype(t1.__proto__, $t2, $strictMode)) {
-    return true;
-  }
-
-  // Check mixin.
-  let m1 = $getMixin($t1);
-  if (m1 != null && $_isInterfaceSubtype(m1, $t2, $strictMode)) {
-    return true;
-  }
-
-  // Check interfaces.
-  let getInterfaces = $getImplements($t1);
-  if (getInterfaces) {
-    for (let i1 of getInterfaces()) {
-      if ($_isInterfaceSubtype(i1, $t2, $strictMode)) {
-        return true;
-      }
-    }
-  }
-  return false;
-})()''');
-
-Object? extractTypeArguments<T>(T instance, Function f) {
-  if (instance == null) {
-    throw ArgumentError('Cannot extract type of null instance.');
-  }
-  var type = unwrapType(T);
-  // Get underlying type from nullability wrappers if needed.
-  type = JS<Object>('!', '#.type || #', type, type);
-
-  if (type is AbstractFunctionType || _isFutureOr(type)) {
-    throw ArgumentError('Cannot extract from non-class type ($type).');
-  }
-  var typeArguments = getGenericArgs(type);
-  if (typeArguments!.isEmpty) {
-    throw ArgumentError('Cannot extract from non-generic type ($type).');
-  }
-  var supertype = _getMatchingSupertype(getReifiedType(instance), type);
-  // The signature of this method guarantees that instance is a T, so we
-  // should have a valid non-empty list at this point.
-  assert(supertype != null);
-  var typeArgs = getGenericArgs(supertype);
-  assert(typeArgs != null && typeArgs.isNotEmpty);
-  return dgcall(f, typeArgs, []);
-}
-
-/// Infers type variables based on a series of [trySubtypeMatch] calls, followed
-/// by [getInferredTypes] to return the type.
-class _TypeInferrer {
-  final Map<TypeVariable, TypeConstraint> _typeVariables;
-
-  /// Creates a [TypeConstraintGatherer] which is prepared to gather type
-  /// constraints for the given type parameters.
-  _TypeInferrer(Iterable<TypeVariable> typeVariables)
-      : _typeVariables = Map.fromIterables(
-            typeVariables, typeVariables.map((_) => TypeConstraint()));
-
-  /// Returns the inferred types based on the current constraints.
-  List<Object>? getInferredTypes() {
-    var result = <Object>[];
-    for (var constraint in _typeVariables.values) {
-      // Prefer the known bound, if any.
-      if (constraint.lower != null) {
-        result.add(constraint.lower!);
-      } else if (constraint.upper != null) {
-        result.add(constraint.upper!);
-      } else {
-        return null;
-      }
-    }
-    return result;
-  }
-
-  /// Tries to match [subtype] against [supertype].
-  ///
-  /// If the match succeeds, the resulting type constraints are recorded for
-  /// later use by [computeConstraints].  If the match fails, the set of type
-  /// constraints is unchanged.
-  bool trySubtypeMatch(Object subtype, Object supertype) =>
-      _isSubtypeMatch(subtype, supertype);
-
-  void _constrainLower(TypeVariable parameter, Object lower) {
-    _typeVariables[parameter]!._constrainLower(lower);
-  }
-
-  void _constrainUpper(TypeVariable parameter, Object upper) {
-    _typeVariables[parameter]!._constrainUpper(upper);
-  }
-
-  bool _isFunctionSubtypeMatch(FunctionType subtype, FunctionType supertype) {
-    // A function type `(M0,..., Mn, [M{n+1}, ..., Mm]) -> R0` is a subtype
-    // match for a function type `(N0,..., Nk, [N{k+1}, ..., Nr]) -> R1` with
-    // respect to `L` under constraints `C0 + ... + Cr + C`
-    // - If `R0` is a subtype match for a type `R1` with respect to `L` under
-    //   constraints `C`:
-    // - If `n <= k` and `r <= m`.
-    // - And for `i` in `0...r`, `Ni` is a subtype match for `Mi` with respect
-    //   to `L` under constraints `Ci`.
-    // Function types with named parameters are treated analogously to the
-    // positional parameter case above.
-    // A generic function type `<T0 extends B0, ..., Tn extends Bn>F0` is a
-    // subtype match for a generic function type `<S0 extends B0, ..., Sn
-    // extends Bn>F1` with respect to `L` under constraints `Cl`:
-    // - If `F0[Z0/T0, ..., Zn/Tn]` is a subtype match for `F0[Z0/S0, ...,
-    //   Zn/Sn]` with respect to `L` under constraints `C`, where each `Zi` is a
-    //   fresh type variable with bound `Bi`.
-    // - And `Cl` is `C` with each constraint replaced with its closure with
-    //   respect to `[Z0, ..., Zn]`.
-    if (subtype.requiredParameterCount > supertype.requiredParameterCount) {
-      return false;
-    }
-    if (subtype.positionalParameterCount < supertype.positionalParameterCount) {
-      return false;
-    }
-    // Test the return types.
-    if (supertype.returnType is! VoidType &&
-        !_isSubtypeMatch(subtype.returnType, supertype.returnType)) {
-      return false;
-    }
-
-    // Test the parameter types.
-    for (int i = 0, n = supertype.positionalParameterCount; i < n; ++i) {
-      if (!_isSubtypeMatch(supertype.getPositionalParameter(i),
-          subtype.getPositionalParameter(i))) {
-        return false;
-      }
-    }
-
-    // Named parameter invariants:
-    // 1) All named params in the superclass are named params in the subclass.
-    // 2) All required named params in the subclass are required named params
-    //    in the superclass.
-    // 3) With strict null checking disabled, we treat required named params as
-    //    optional named params.
-    var supertypeNamed = supertype.getNamedParameters();
-    var supertypeRequiredNamed = supertype.getRequiredNamedParameters();
-    var subtypeNamed = supertype.getNamedParameters();
-    var subtypeRequiredNamed = supertype.getRequiredNamedParameters();
-    if (!strictNullSafety) {
-      // In weak mode, treat required named params as optional named params.
-      supertypeNamed = {...supertypeNamed, ...supertypeRequiredNamed};
-      subtypeNamed = {...subtypeNamed, ...subtypeRequiredNamed};
-      supertypeRequiredNamed = {};
-      subtypeRequiredNamed = {};
-    }
-    for (var name in subtypeRequiredNamed.keys) {
-      var supertypeParamType = supertypeRequiredNamed[name];
-      if (supertypeParamType == null) return false;
-    }
-    for (var name in supertypeNamed.keys) {
-      var subtypeParamType = subtypeNamed[name];
-      if (subtypeParamType == null) return false;
-      if (!_isSubtypeMatch(supertypeNamed[name]!, subtypeParamType)) {
-        return false;
-      }
-    }
-    for (var name in supertypeRequiredNamed.keys) {
-      var subtypeParamType = subtypeRequiredNamed[name] ?? subtypeNamed[name]!;
-      if (!_isSubtypeMatch(supertypeRequiredNamed[name]!, subtypeParamType)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  bool _isInterfaceSubtypeMatch(Object subtype, Object supertype) {
-    // A type `P<M0, ..., Mk>` is a subtype match for `P<N0, ..., Nk>` with
-    // respect to `L` under constraints `C0 + ... + Ck`:
-    // - If `Mi` is a subtype match for `Ni` with respect to `L` under
-    //   constraints `Ci`.
-    // A type `P<M0, ..., Mk>` is a subtype match for `Q<N0, ..., Nj>` with
-    // respect to `L` under constraints `C`:
-    // - If `R<B0, ..., Bj>` is the superclass of `P<M0, ..., Mk>` and `R<B0,
-    //   ..., Bj>` is a subtype match for `Q<N0, ..., Nj>` with respect to `L`
-    //   under constraints `C`.
-    // - Or `R<B0, ..., Bj>` is one of the interfaces implemented by `P<M0, ...,
-    //   Mk>` (considered in lexical order) and `R<B0, ..., Bj>` is a subtype
-    //   match for `Q<N0, ..., Nj>` with respect to `L` under constraints `C`.
-    // - Or `R<B0, ..., Bj>` is a mixin into `P<M0, ..., Mk>` (considered in
-    //   lexical order) and `R<B0, ..., Bj>` is a subtype match for `Q<N0, ...,
-    //   Nj>` with respect to `L` under constraints `C`.
-
-    // Note that since kernel requires that no class may only appear in the set
-    // of supertypes of a given type more than once, the order of the checks
-    // above is irrelevant; we just need to find the matched superclass,
-    // substitute, and then iterate through type variables.
-    var matchingSupertype = _getMatchingSupertype(subtype, supertype);
-    if (matchingSupertype == null) return false;
-
-    var matchingTypeArgs = getGenericArgs(matchingSupertype)!;
-    var supertypeTypeArgs = getGenericArgs(supertype)!;
-    for (int i = 0; i < supertypeTypeArgs.length; i++) {
-      if (!_isSubtypeMatch(matchingTypeArgs[i], supertypeTypeArgs[i])) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /// Attempts to match [subtype] as a subtype of [supertype], gathering any
-  /// constraints discovered in the process.
-  ///
-  /// If a set of constraints was found, `true` is returned and the caller
-  /// may proceed to call [computeConstraints].  Otherwise, `false` is returned.
-  ///
-  /// In the case where `false` is returned, some bogus constraints may have
-  /// been added to [_protoConstraints].  It is the caller's responsibility to
-  /// discard them if necessary.
-  // TODO(#40326) Update to support null safety subtyping algorithm.
-  bool _isSubtypeMatch(Object subtype, Object supertype) {
-    // A type variable `T` in `L` is a subtype match for any type schema `Q`:
-    // - Under constraint `T <: Q`.
-    if (subtype is TypeVariable && _typeVariables.containsKey(subtype)) {
-      _constrainUpper(subtype, supertype);
-      return true;
-    }
-    // A type schema `Q` is a subtype match for a type variable `T` in `L`:
-    // - Under constraint `Q <: T`.
-    if (supertype is TypeVariable && _typeVariables.containsKey(supertype)) {
-      _constrainLower(supertype, subtype);
-      return true;
-    }
-    // Any two equal types `P` and `Q` are subtype matches under no constraints.
-    // Note: to avoid making the algorithm quadratic, we just check for
-    // identical().  If P and Q are equal but not identical, recursing through
-    // the types will give the proper result.
-    if (identical(subtype, supertype)) return true;
-    // Any type `P` is a subtype match for `dynamic`, `Object`, or `void` under
-    // no constraints.
-    if (_isTop(supertype)) return true;
-    // `Null` is a subtype match for any type `Q` under no constraints.
-    // Note that nullable types will change this.
-    if (_equalType(subtype, Null)) return true;
-
-    // Handle FutureOr<T> union type.
-    if (_isFutureOr(subtype)) {
-      var subtypeArg = getGenericArgs(subtype)![0];
-      if (_isFutureOr(supertype)) {
-        // `FutureOr<P>` is a subtype match for `FutureOr<Q>` with respect to `L`
-        // under constraints `C`:
-        // - If `P` is a subtype match for `Q` with respect to `L` under constraints
-        //   `C`.
-        var supertypeArg = getGenericArgs(supertype)![0];
-        return _isSubtypeMatch(subtypeArg, supertypeArg);
-      }
-
-      // `FutureOr<P>` is a subtype match for `Q` with respect to `L` under
-      // constraints `C0 + C1`:
-      // - If `Future<P>` is a subtype match for `Q` with respect to `L` under
-      //   constraints `C0`.
-      // - And `P` is a subtype match for `Q` with respect to `L` under
-      //   constraints `C1`.
-      var subtypeFuture =
-          JS<Object>('!', '#(#)', getGenericClass(Future), subtypeArg);
-      return _isSubtypeMatch(subtypeFuture, supertype) &&
-          _isSubtypeMatch(subtypeArg!, supertype);
-    }
-
-    if (_isFutureOr(supertype)) {
-      // `P` is a subtype match for `FutureOr<Q>` with respect to `L` under
-      // constraints `C`:
-      // - If `P` is a subtype match for `Future<Q>` with respect to `L` under
-      //   constraints `C`.
-      // - Or `P` is not a subtype match for `Future<Q>` with respect to `L` under
-      //   constraints `C`
-      //   - And `P` is a subtype match for `Q` with respect to `L` under
-      //     constraints `C`
-      var supertypeArg = getGenericArgs(supertype)![0];
-      var supertypeFuture =
-          JS<Object>('!', '#(#)', getGenericClass(Future), supertypeArg);
-      return _isSubtypeMatch(subtype, supertypeFuture) ||
-          _isSubtypeMatch(subtype, supertypeArg);
-    }
-
-    // A type variable `T` not in `L` with bound `P` is a subtype match for the
-    // same type variable `T` with bound `Q` with respect to `L` under
-    // constraints `C`:
-    // - If `P` is a subtype match for `Q` with respect to `L` under constraints
-    //   `C`.
-    if (subtype is TypeVariable) {
-      return supertype is TypeVariable && identical(subtype, supertype);
-    }
-    if (subtype is GenericFunctionType) {
-      if (supertype is GenericFunctionType) {
-        // Given generic functions g1 and g2, g1 <: g2 iff:
-        //
-        //     g1<TFresh> <: g2<TFresh>
-        //
-        // where TFresh is a list of fresh type variables that both g1 and g2 will
-        // be instantiated with.
-        var formalCount = subtype.formalCount;
-        if (formalCount != supertype.formalCount) return false;
-
-        // Using either function's type formals will work as long as they're
-        // both instantiated with the same ones. The instantiate operation is
-        // guaranteed to avoid capture because it does not depend on its
-        // TypeVariable objects, rather it uses JS function parameters to ensure
-        // correct binding.
-        var fresh = supertype.typeFormals;
-
-        // Check the bounds of the type parameters of g1 and g2.
-        // given a type parameter `T1 extends U1` from g1, and a type parameter
-        // `T2 extends U2` from g2, we must ensure that:
-        //
-        //      U2 <: U1
-        //
-        // (Note the reversal of direction -- type formal bounds are
-        // contravariant, similar to the function's formal parameter types).
-        //
-        var t1Bounds = subtype.instantiateTypeBounds(fresh);
-        var t2Bounds = supertype.instantiateTypeBounds(fresh);
-        // TODO(jmesserly): we could optimize for the common case of no bounds.
-        for (var i = 0; i < formalCount; i++) {
-          if (!_isSubtypeMatch(t2Bounds[i], t1Bounds[i])) {
-            return false;
-          }
-        }
-        return _isFunctionSubtypeMatch(
-            subtype.instantiate(fresh), supertype.instantiate(fresh));
-      } else {
-        return false;
-      }
-    } else if (supertype is GenericFunctionType) {
-      return false;
-    }
-
-    // A type `P` is a subtype match for `Function` with respect to `L` under no
-    // constraints:
-    // - If `P` implements a call method.
-    // - Or if `P` is a function type.
-    // TODO(paulberry): implement this case.
-    // A type `P` is a subtype match for a type `Q` with respect to `L` under
-    // constraints `C`:
-    // - If `P` is an interface type which implements a call method of type `F`,
-    //   and `F` is a subtype match for a type `Q` with respect to `L` under
-    //   constraints `C`.
-    // TODO(paulberry): implement this case.
-    if (subtype is FunctionType) {
-      if (supertype is! FunctionType) {
-        if (_equalType(supertype, Function) || _equalType(supertype, Object)) {
-          return true;
-        } else {
-          return false;
-        }
-      }
-      if (supertype is FunctionType) {
-        return _isFunctionSubtypeMatch(subtype, supertype);
-      }
-    }
-    return _isInterfaceSubtypeMatch(subtype, supertype);
-  }
-
-  bool _isTop(Object type) =>
-      identical(type, _dynamic) ||
-      identical(type, void_) ||
-      _equalType(type, Object);
-}
-
-/// A constraint on a type parameter that we're inferring.
-class TypeConstraint {
-  /// The lower bound of the type being constrained.  This bound must be a
-  /// subtype of the type being constrained.
-  Object? lower;
-
-  /// The upper bound of the type being constrained.  The type being constrained
-  /// must be a subtype of this bound.
-  Object? upper;
-
-  void _constrainLower(Object type) {
-    var _lower = lower;
-    if (_lower != null) {
-      if (isSubtypeOf(_lower, type)) {
-        // nothing to do, existing lower bound is lower than the new one.
-        return;
-      }
-      if (!isSubtypeOf(type, _lower)) {
-        // Neither bound is lower and we don't have GLB, so use bottom type.
-        type = unwrapType(Null);
-      }
-    }
-    lower = type;
-  }
-
-  void _constrainUpper(Object type) {
-    var _upper = upper;
-    if (_upper != null) {
-      if (isSubtypeOf(type, _upper)) {
-        // nothing to do, existing upper bound is higher than the new one.
-        return;
-      }
-      if (!isSubtypeOf(_upper, type)) {
-        // Neither bound is higher and we don't have LUB, so use top type.
-        type = unwrapType(Object);
-      }
-    }
-    upper = type;
-  }
-
-  String toString() => '${typeName(lower)} <: <type> <: ${typeName(upper)}';
-}
-
-/// Finds a supertype of [subtype] that matches the class [supertype], but may
-/// contain different generic type arguments.
-Object? _getMatchingSupertype(Object? subtype, Object supertype) {
-  if (identical(subtype, supertype)) return supertype;
-  if (subtype == null || _equalType(subtype, Object)) return null;
-
-  var subclass = getGenericClass(subtype);
-  var superclass = getGenericClass(supertype);
-  if (subclass != null && identical(subclass, superclass)) {
-    return subtype; // matching supertype found!
-  }
-
-  var result = _getMatchingSupertype(JS('', '#.__proto__', subtype), supertype);
-  if (result != null) return result;
-
-  // Check mixin.
-  var mixin = getMixin(subtype);
-  if (mixin != null) {
-    result = _getMatchingSupertype(mixin, supertype);
-    if (result != null) return result;
-  }
-
-  // Check interfaces.
-  var getInterfaces = getImplements(subtype);
-  if (getInterfaces != null) {
-    for (var iface in getInterfaces()!) {
-      result = _getMatchingSupertype(iface, supertype);
-      if (result != null) return result;
-    }
-  }
-
-  return null;
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart
deleted file mode 100644
index 07a2faa..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/utils.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart._runtime;
-
-/// This library defines a set of general javascript utilities for us
-/// by the Dart runtime.
-// TODO(ochafik): Rewrite some of these in Dart when possible.
-
-final Function(Object, Object, Object) defineProperty =
-    JS('', 'Object.defineProperty');
-
-defineValue(obj, name, value) {
-  defineAccessor(obj, name, value: value, configurable: true, writable: true);
-  return value;
-}
-
-final Function(Object, Object,
-    {Object? get,
-    Object? set,
-    Object? value,
-    bool? configurable,
-    bool? writable}) defineAccessor = JS('', 'Object.defineProperty');
-
-final dynamic Function(Object, Object) getOwnPropertyDescriptor =
-    JS('', 'Object.getOwnPropertyDescriptor');
-
-final List Function(Object) getOwnPropertyNames =
-    JS('', 'Object.getOwnPropertyNames');
-
-final List Function(Object) getOwnPropertySymbols =
-    JS('', 'Object.getOwnPropertySymbols');
-
-final Function(Object) getPrototypeOf = JS('', 'Object.getPrototypeOf');
-
-/// This error indicates a strong mode specific failure, other than a type
-/// assertion failure (TypeError) or CastError.
-void throwTypeError(String message) {
-  throw TypeErrorImpl(message);
-}
-
-/// This error indicates a bug in the runtime or the compiler.
-void throwInternalError(String message) {
-  JS('', 'throw Error(#)', message);
-}
-
-Iterable getOwnNamesAndSymbols(obj) {
-  var names = getOwnPropertyNames(obj);
-  var symbols = getOwnPropertySymbols(obj);
-  return JS('', '#.concat(#)', names, symbols);
-}
-
-/// Returns the value of field `name` on `obj`.
-///
-/// We use this instead of obj[name] since obj[name] checks the entire
-/// prototype chain instead of just `obj`.
-safeGetOwnProperty(obj, name) {
-  if (JS<bool>('!', '#.hasOwnProperty(#)', obj, name))
-    return JS<Object>('', '#[#]', obj, name);
-}
-
-copyTheseProperties(to, from, names) {
-  for (int i = 0, n = JS('!', '#.length', names); i < n; ++i) {
-    var name = JS('', '#[#]', names, i);
-    if (name == 'constructor') continue;
-    copyProperty(to, from, name);
-  }
-  return to;
-}
-
-copyProperty(to, from, name) {
-  var desc = getOwnPropertyDescriptor(from, name);
-  if (JS('!', '# == Symbol.iterator', name)) {
-    // On native types, Symbol.iterator may already be present.
-    // TODO(jmesserly): investigate if we still need this.
-    // If so, we need to find a better solution.
-    // See https://github.com/dart-lang/sdk/issues/28324
-    var existing = getOwnPropertyDescriptor(to, name);
-    if (existing != null) {
-      if (JS('!', '#.writable', existing)) {
-        JS('', '#[#] = #.value', to, name, desc);
-      }
-      return;
-    }
-  }
-  defineProperty(to, name, desc);
-}
-
-@JSExportName('export')
-exportProperty(to, from, name) => copyProperty(to, from, name);
-
-/// Copy properties from source to destination object.
-/// This operation is commonly called `mixin` in JS.
-copyProperties(to, from) {
-  return copyTheseProperties(to, from, getOwnNamesAndSymbols(from));
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/debugger.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/debugger.dart
deleted file mode 100644
index f77d5c3..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/debugger.dart
+++ /dev/null
@@ -1,1015 +0,0 @@
-// Copyright (c) 2015, 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.
-
-library dart._debugger;
-
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show JSArray;
-import 'dart:_js_helper' show InternalMap;
-import 'dart:_runtime' as dart;
-import 'dart:core';
-import 'dart:collection';
-import 'dart:math';
-
-part 'profile.dart';
-
-/// JsonMLConfig object to pass to devtools to specify how an Object should
-/// be displayed. skipDart signals that an object should not be formatted
-/// by the Dart formatter. This is used to specify that an Object
-/// should just be displayed using the regular JavaScript view instead of a
-/// custom Dart view. For example, this is used to display the JavaScript view
-/// of a Dart Function as a child of the regular Function object. keyToString
-/// signals that a map key object should have its toString() displayed by
-/// the Dart formatter.
-///
-/// We'd like this to be an enum, but we can't because it's a dev_compiler bug.
-class JsonMLConfig {
-  const JsonMLConfig(this.name);
-
-  final String name;
-  static const none = JsonMLConfig("none");
-  static const skipDart = JsonMLConfig("skipDart");
-  static const keyToString = JsonMLConfig("keyToString");
-  static const asClass = JsonMLConfig("asClass");
-  static const asObject = JsonMLConfig("asObject");
-  static const asMap = JsonMLConfig("asMap");
-  toString() => "JsonMLConfig($name)";
-}
-
-int _maxSpanLength = 100;
-var _devtoolsFormatter = JsonMLFormatter(DartFormatter());
-
-/// We truncate a toString() longer than [maxStringLength].
-int maxFormatterStringLength = 100;
-
-String _typeof(object) => JS<String>('!', 'typeof #', object);
-
-List<String> getOwnPropertyNames(object) =>
-    JSArray<String>.of(dart.getOwnPropertyNames(object));
-
-List getOwnPropertySymbols(object) =>
-    JS('List', 'Object.getOwnPropertySymbols(#)', object);
-
-// TODO(jacobr): move this to dart:js and fully implement.
-class JSNative {
-  // Name may be a String or a Symbol.
-  static getProperty(object, name) => JS('', '#[#]', object, name);
-  // Name may be a String or a Symbol.
-  static setProperty(object, name, value) =>
-      JS('', '#[#]=#', object, name, value);
-}
-
-void addMetadataChildren(object, Set<NameValuePair> ret) {
-  ret.add(NameValuePair(
-      name: "[[class]]",
-      value: dart.getReifiedType(object),
-      config: JsonMLConfig.asClass));
-}
-
-/// Add properties from a signature definition [sig] for [object].
-/// Walk the prototype chain if [walkProtypeChain] is set.
-/// Tag types on function typed properties of [object] if [tagTypes] is set.
-///
-void addPropertiesFromSignature(
-    sig, Set<NameValuePair> properties, object, bool walkPrototypeChain,
-    {tagTypes = false}) {
-  // Including these property names doesn't add any value and just clutters
-  // the debugger output.
-  // TODO(jacobr): consider adding runtimeType to this list.
-  var skippedNames = Set()..add('hashCode');
-  var objectPrototype = JS('', 'Object.prototype');
-  while (sig != null && !identical(sig, objectPrototype)) {
-    for (var symbol in getOwnPropertySymbols(sig)) {
-      var dartName = symbolName(symbol);
-      String dartXPrefix = 'dartx.';
-      if (dartName.startsWith(dartXPrefix)) {
-        dartName = dartName.substring(dartXPrefix.length);
-      }
-      if (skippedNames.contains(dartName)) continue;
-      var value = safeGetProperty(object, symbol);
-      // Tag the function with its runtime type.
-      if (tagTypes && _typeof(value) == 'function') {
-        dart.fn(value, JS('', '#[#]', sig, symbol));
-      }
-      properties.add(NameValuePair(name: dartName, value: value));
-    }
-
-    for (var name in getOwnPropertyNames(sig)) {
-      var value = safeGetProperty(object, name);
-      if (skippedNames.contains(name)) continue;
-      // Tag the function with its runtime type.
-      if (tagTypes && _typeof(value) == 'function') {
-        dart.fn(value, JS('', '#[#]', sig, name));
-      }
-      properties.add(NameValuePair(name: name, value: value));
-    }
-
-    if (!walkPrototypeChain) break;
-
-    sig = dart.getPrototypeOf(sig);
-  }
-}
-
-/// Sort properties sorting public names before private names.
-List<NameValuePair> sortProperties(Iterable<NameValuePair> properties) {
-  var sortedProperties = properties.toList();
-
-  sortedProperties.sort((a, b) {
-    var aPrivate = a.name.startsWith('_');
-    var bPrivate = b.name.startsWith('_');
-    if (aPrivate != bPrivate) return aPrivate ? 1 : -1;
-    return a.name.compareTo(b.name);
-  });
-  return sortedProperties;
-}
-
-String getObjectTypeName(object) {
-  var reifiedType = dart.getReifiedType(object);
-  if (reifiedType == null) {
-    if (_typeof(object) == 'function') {
-      return '[[Raw JavaScript Function]]';
-    }
-    return '<Error getting type name>';
-  }
-  return getTypeName(reifiedType);
-}
-
-String getTypeName(type) {
-  // TODO(jacobr): it would be nice if there was a way we could distinguish
-  // between a List<dynamic> created from Dart and an Array passed in from
-  // JavaScript.
-  return dart.typeName(type);
-}
-
-String safePreview(object, config) {
-  try {
-    var preview = _devtoolsFormatter._simpleFormatter.preview(object, config);
-    if (preview != null) return preview;
-    return object.toString();
-  } catch (e) {
-    return '<Exception thrown> $e';
-  }
-}
-
-String symbolName(symbol) {
-  var name = symbol.toString();
-  assert(name.startsWith('Symbol('));
-  return name.substring('Symbol('.length, name.length - 1);
-}
-
-bool hasMethod(object, String name) {
-  try {
-    return dart.hasMethod(object, name);
-  } catch (e) {
-    return false;
-  }
-}
-
-/// [JsonMLFormatter] consumes [NameValuePair] objects and
-class NameValuePair {
-  NameValuePair(
-      {this.name = '',
-      this.value,
-      this.config = JsonMLConfig.none,
-      this.hideName = false});
-
-  // Define equality and hashCode so that NameValuePair can be used
-  // in a Set to dedupe entries with duplicate names.
-  bool operator ==(other) {
-    if (other is! NameValuePair) return false;
-    if (this.hideName || other.hideName) return identical(this, other);
-    return other.name == name;
-  }
-
-  int get hashCode => name.hashCode;
-
-  final String name;
-  final Object? value;
-  final JsonMLConfig config;
-  final bool hideName;
-
-  String get displayName => hideName ? '' : name;
-}
-
-class MapEntry {
-  MapEntry({this.key, this.value});
-
-  final Object? key;
-  final Object? value;
-}
-
-class IterableSpan {
-  IterableSpan(this.start, this.end, this.iterable);
-
-  final int start;
-  final int end;
-  final Iterable iterable;
-  int get length => end - start;
-
-  /// Using length - .5, a list of length 10000 results in a
-  /// maxPowerOfSubsetSize of 1, so the list will be broken up into 100,
-  /// 100-length subsets. A list of length 10001 results in a
-  /// maxPowerOfSubsetSize of 2, so the list will be broken up into 1
-  /// 10000-length subset and 1 1-length subset.
-  int get maxPowerOfSubsetSize =>
-      (log(length - .5) / log(_maxSpanLength)).truncate();
-  int get subsetSize => pow(_maxSpanLength, maxPowerOfSubsetSize).toInt();
-
-  Map<int, dynamic> asMap() =>
-      iterable.skip(start).take(length).toList().asMap();
-
-  List<NameValuePair> children() {
-    var children = <NameValuePair>[];
-    if (length <= _maxSpanLength) {
-      asMap().forEach((i, element) {
-        children
-            .add(NameValuePair(name: (i + start).toString(), value: element));
-      });
-    } else {
-      for (var i = start; i < end; i += subsetSize) {
-        var subSpan = IterableSpan(i, min(end, subsetSize + i), iterable);
-        if (subSpan.length == 1) {
-          children.add(
-              NameValuePair(name: i.toString(), value: iterable.elementAt(i)));
-        } else {
-          children.add(NameValuePair(
-              name: '[${i}...${subSpan.end - 1}]',
-              value: subSpan,
-              hideName: true));
-        }
-      }
-    }
-    return children;
-  }
-}
-
-class Library {
-  Library(this.name, this.object);
-
-  final String name;
-  final Object object;
-}
-
-class NamedConstructor {
-  NamedConstructor(this.object);
-
-  final Object object;
-}
-
-class HeritageClause {
-  HeritageClause(this.name, this.types);
-
-  final String name;
-  final List types;
-}
-
-Object safeGetProperty(Object protoChain, Object name) {
-  try {
-    return JSNative.getProperty(protoChain, name);
-  } catch (e) {
-    return '<Exception thrown> $e';
-  }
-}
-
-safeProperties(object) => Map.fromIterable(
-    getOwnPropertyNames(object)
-        .where((each) => safeGetProperty(object, each) != null),
-    key: (name) => name,
-    value: (name) => safeGetProperty(object, name));
-
-/// Class to simplify building the JsonML objects expected by the
-/// Devtools Formatter API.
-class JsonMLElement {
-  dynamic _attributes;
-  late List _jsonML;
-
-  JsonMLElement(tagName) {
-    _attributes = JS('', '{}');
-    _jsonML = [tagName, _attributes];
-  }
-
-  appendChild(element) {
-    _jsonML.add(element.toJsonML());
-  }
-
-  JsonMLElement createChild(String tagName) {
-    var c = JsonMLElement(tagName);
-    _jsonML.add(c.toJsonML());
-    return c;
-  }
-
-  JsonMLElement createObjectTag(object) =>
-      createChild('object')..addAttribute('object', object);
-
-  void setStyle(String style) {
-    _attributes.style = style;
-  }
-
-  addStyle(String style) {
-    if (_attributes.style == null) {
-      _attributes.style = style;
-    } else {
-      _attributes.style += style;
-    }
-  }
-
-  addAttribute(key, value) {
-    JSNative.setProperty(_attributes, key, value);
-  }
-
-  createTextChild(String text) {
-    _jsonML.add(text);
-  }
-
-  toJsonML() => _jsonML;
-}
-
-/// Whether an object is a native JavaScript type where we should display the
-/// JavaScript view of the object instead of the custom Dart specific render
-/// of properties.
-bool isNativeJavaScriptObject(object) {
-  var type = _typeof(object);
-  if (type != 'object' && type != 'function') return true;
-
-  // Consider all regular JS objects that do not represent Dart modules native
-  // JavaScript objects.
-  if (dart.isJsInterop(object) && dart.getModuleName(object) == null) {
-    return true;
-  }
-
-  // Treat Node objects as a native JavaScript type as the regular DOM render
-  // in devtools is superior to the dart specific view.
-  return JS<bool>('!', '# instanceof Node', object);
-}
-
-/// Class implementing the Devtools Formatter API described by:
-/// https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U
-/// Specifically, a formatter implements a header, hasBody, and body method.
-/// This class renders the simple structured format objects [_simpleFormatter]
-/// provides as JsonML.
-class JsonMLFormatter {
-  // TODO(jacobr): define a SimpleFormatter base class that DartFormatter
-  // implements if we decide to use this class elsewhere. We specify that the
-  // type is DartFormatter here purely to get type checking benefits not because
-  // this class is really intended to only support instances of type
-  // DartFormatter.
-  DartFormatter _simpleFormatter;
-
-  bool customFormattersOn = false;
-
-  JsonMLFormatter(this._simpleFormatter);
-
-  void setMaxSpanLengthForTestingOnly(int spanLength) {
-    _maxSpanLength = spanLength;
-  }
-
-  header(object, config) {
-    customFormattersOn = true;
-    if (config == JsonMLConfig.skipDart || isNativeJavaScriptObject(object)) {
-      return null;
-    }
-    var c = _simpleFormatter.preview(object, config);
-    if (c == null) return null;
-
-    if (config == JsonMLConfig.keyToString) {
-      c = object.toString();
-    }
-
-    // Indicate this is a Dart Object by using a Dart background color.
-    // This is stylistically a bit ugly but it eases distinguishing Dart and
-    // JS objects.
-    var element = JsonMLElement('span')
-      ..setStyle('background-color: #d9edf7;color: black')
-      ..createTextChild(c);
-    return element.toJsonML();
-  }
-
-  bool hasBody(object, config) => _simpleFormatter.hasChildren(object, config);
-
-  body(object, config) {
-    var body = JsonMLElement('ol')
-      ..setStyle('list-style-type: none;'
-          'padding-left: 0px;'
-          'margin-top: 0px;'
-          'margin-bottom: 0px;'
-          'margin-left: 12px;');
-    if (object is StackTrace) {
-      body.addStyle('background-color: thistle;color: rgb(196, 26, 22);');
-    }
-    var children = _simpleFormatter.children(object, config);
-    if (children == null) return body.toJsonML();
-    for (NameValuePair child in children) {
-      var li = body.createChild('li');
-      li.setStyle("padding-left: 13px;");
-
-      // The value is indented when it is on a different line from the name
-      // by setting right padding of the name to -13px and the padding of the
-      // value to 13px.
-      JsonMLElement? nameSpan;
-      var valueStyle = '';
-      if (!child.hideName) {
-        nameSpan = JsonMLElement('span')
-          ..createTextChild(
-              child.displayName.isNotEmpty ? '${child.displayName}: ' : '')
-          ..setStyle(
-              'background-color: thistle; color: rgb(136, 19, 145); margin-right: -13px');
-        valueStyle = 'margin-left: 13px';
-      }
-
-      if (_typeof(child.value) == 'object' ||
-          _typeof(child.value) == 'function') {
-        var valueSpan = JsonMLElement('span')..setStyle(valueStyle);
-        valueSpan.createObjectTag(child.value)
-          ..addAttribute('config', child.config);
-        if (nameSpan != null) {
-          li.appendChild(nameSpan);
-        }
-        li.appendChild(valueSpan);
-      } else {
-        var line = li.createChild('span');
-        if (nameSpan != null) {
-          line.appendChild(nameSpan);
-        }
-        line.appendChild(JsonMLElement('span')
-          ..createTextChild(safePreview(child.value, child.config))
-          ..setStyle(valueStyle));
-      }
-    }
-    return body.toJsonML();
-  }
-}
-
-abstract class Formatter {
-  bool accept(object, config);
-  String? preview(object);
-  bool hasChildren(object);
-  List<NameValuePair>? children(object);
-}
-
-class DartFormatter {
-  final List<Formatter> _formatters;
-
-  DartFormatter()
-      : _formatters = [
-          // Formatters earlier in the list take precedence.
-          ObjectInternalsFormatter(),
-          ClassFormatter(),
-          TypeFormatter(),
-          NamedConstructorFormatter(),
-          MapFormatter(),
-          MapOverviewFormatter(),
-          IterableFormatter(),
-          IterableSpanFormatter(),
-          MapEntryFormatter(),
-          StackTraceFormatter(),
-          ErrorAndExceptionFormatter(),
-          FunctionFormatter(),
-          HeritageClauseFormatter(),
-          LibraryModuleFormatter(),
-          LibraryFormatter(),
-          ObjectFormatter(),
-        ];
-
-  String? preview(object, config) {
-    try {
-      if (object == null ||
-          object is num ||
-          object is String ||
-          isNativeJavaScriptObject(object)) {
-        return object.toString();
-      }
-      for (var formatter in _formatters) {
-        if (formatter.accept(object, config)) return formatter.preview(object);
-      }
-    } catch (e, trace) {
-      // Log formatter internal errors as unfortunately the devtools cannot
-      // be used to debug formatter errors.
-      _printConsoleError("Caught exception $e\n trace:\n$trace");
-    }
-
-    return null;
-  }
-
-  bool hasChildren(object, config) {
-    if (object == null) return false;
-    try {
-      for (var formatter in _formatters) {
-        if (formatter.accept(object, config))
-          return formatter.hasChildren(object);
-      }
-    } catch (e, trace) {
-      // See comment for preview.
-      _printConsoleError("[hasChildren] Caught exception $e\n trace:\n$trace");
-    }
-    return false;
-  }
-
-  List<NameValuePair>? children(object, config) {
-    try {
-      if (object != null) {
-        for (var formatter in _formatters) {
-          if (formatter.accept(object, config))
-            return formatter.children(object);
-        }
-      }
-    } catch (e, trace) {
-      // See comment for preview.
-      _printConsoleError("Caught exception $e\n trace:\n$trace");
-    }
-    return <NameValuePair>[];
-  }
-
-  void _printConsoleError(String message) =>
-      JS('', 'window.console.error(#)', message);
-}
-
-/// Default formatter for Dart Objects.
-class ObjectFormatter extends Formatter {
-  bool accept(object, config) => !isNativeJavaScriptObject(object);
-
-  String preview(object) {
-    var typeName = getObjectTypeName(object);
-    try {
-      // An explicit toString() call might not actually be a string. This way
-      // we're sure.
-      var toString = "$object";
-      if (toString.length > maxFormatterStringLength) {
-        toString = toString.substring(0, maxFormatterStringLength - 3) + "...";
-      }
-      // The default toString() will be "Instance of 'Foo'", in which case we
-      // don't need any further indication of the class.
-      if (toString.contains(typeName)) {
-        return toString;
-      } else {
-        // If there's no class indication, e.g. an Int64 that just prints as a
-        // number, then add the class name.
-        return "$toString ($typeName)";
-      }
-    } catch (e) {}
-    // We will only get here if there was an error getting the toString, in
-    // which case we just use the type name.
-    return typeName;
-  }
-
-  bool hasChildren(object) => true;
-
-  children(object) {
-    var type = dart.getType(object);
-    var ret = LinkedHashSet<NameValuePair>();
-    // We use a Set rather than a List to avoid duplicates.
-    var fields = Set<NameValuePair>();
-    addPropertiesFromSignature(dart.getFields(type), fields, object, true);
-    var getters = Set<NameValuePair>();
-    addPropertiesFromSignature(dart.getGetters(type), getters, object, true);
-    ret.addAll(sortProperties(fields));
-    ret.addAll(sortProperties(getters));
-    addMetadataChildren(object, ret);
-    return ret.toList();
-  }
-}
-
-/// Show the object instance members and a reduced preview.
-///
-/// Used as a sub-entry to show the internals of objects that have a different
-/// primary format. For example, a Map shows the key-value pairs, but this makes
-/// the internals of the map visible for debugging.
-class ObjectInternalsFormatter extends ObjectFormatter {
-  bool accept(object, config) =>
-      super.accept(object, config) && config == JsonMLConfig.asObject;
-
-  // A minimal preview because we expect a full preview is already shown in a
-  // parent formatter.
-  String preview(object) {
-    return getObjectTypeName(object);
-  }
-}
-
-/// Formatter for module Dart Library objects.
-class LibraryModuleFormatter implements Formatter {
-  bool accept(object, config) => dart.getModuleName(object) != null;
-
-  bool hasChildren(object) => true;
-
-  String preview(object) {
-    var libraryNames = dart.getModuleName(object)!.split('/');
-    // Library names are received with a repeat directory name, so strip the
-    // last directory entry here to make the path cleaner. For example, the
-    // library "third_party/dart/utf/utf" shoud display as
-    // "third_party/dart/utf/".
-    if (libraryNames.length > 1 &&
-        libraryNames.last == libraryNames[libraryNames.length - 2]) {
-      libraryNames[libraryNames.length - 1] = '';
-    }
-    return 'Library Module: ${libraryNames.join('/')}';
-  }
-
-  List<NameValuePair> children(object) {
-    var children = LinkedHashSet<NameValuePair>();
-    for (var name in getOwnPropertyNames(object)) {
-      var value = safeGetProperty(object, name);
-      children.add(NameValuePair(
-          name: name, value: Library(name, value), hideName: true));
-    }
-    return children.toList();
-  }
-}
-
-class LibraryFormatter implements Formatter {
-  var genericParameters = HashMap<String, String>();
-
-  bool accept(object, config) => object is Library;
-
-  bool hasChildren(object) => true;
-
-  String preview(object) => object.name;
-
-  List<NameValuePair> children(object) {
-    // Maintain library member order rather than sorting members as is the
-    // case for class members.
-    var children = LinkedHashSet<NameValuePair>();
-    var objectProperties = safeProperties(object.object);
-    objectProperties.forEach((name, value) {
-      // Skip the generic constructors for each class as users are only
-      // interested in seeing the actual classes.
-      if (dart.getGenericTypeCtor(value) != null) return;
-
-      children.add(dart.isType(value)
-          ? classChild(name, value)
-          : NameValuePair(name: name, value: value));
-    });
-    return children.toList();
-  }
-
-  classChild(String name, Object child) {
-    var typeName = getTypeName(child);
-    return NameValuePair(
-        name: typeName, value: child, config: JsonMLConfig.asClass);
-  }
-}
-
-/// Formatter for Dart Function objects.
-/// Dart functions happen to be regular JavaScript Function objects but
-/// we can distinguish them based on whether they have been tagged with
-/// runtime type information.
-class FunctionFormatter implements Formatter {
-  bool accept(object, config) {
-    if (_typeof(object) != 'function') return false;
-    return dart.getReifiedType(object) != null;
-  }
-
-  bool hasChildren(object) => true;
-
-  String preview(object) {
-    // The debugger can createa a preview of a FunctionType while it's being
-    // constructed (before argument types exist), so we need to catch errors.
-    try {
-      return dart.typeName(dart.getReifiedType(object));
-    } catch (e) {
-      return safePreview(object, JsonMLConfig.none);
-    }
-  }
-
-  List<NameValuePair> children(object) => <NameValuePair>[
-        NameValuePair(name: 'signature', value: preview(object)),
-        NameValuePair(
-            name: 'JavaScript Function',
-            value: object,
-            config: JsonMLConfig.skipDart)
-      ];
-}
-
-/// Formatter for Objects that implement Map but are not system Maps.
-///
-/// This shows two sub-views, one for instance fields and one for
-/// Map key/value pairs.
-class MapOverviewFormatter implements Formatter {
-  // Because this comes after MapFormatter in the list, internal
-  // maps will be picked up by that formatter.
-  bool accept(object, config) => object is Map;
-
-  bool hasChildren(object) => true;
-
-  String preview(object) {
-    Map map = object;
-    try {
-      return '${getObjectTypeName(map)}';
-    } catch (e) {
-      return safePreview(object, JsonMLConfig.none);
-    }
-  }
-
-  List<NameValuePair> children(object) => [
-        NameValuePair(
-            name: "[[instance view]]",
-            value: object,
-            config: JsonMLConfig.asObject),
-        NameValuePair(
-            name: "[[entries]]", value: object, config: JsonMLConfig.asMap)
-      ];
-}
-
-/// Formatter for Dart Map objects.
-///
-/// This is only used for internal maps, or when shown as [[entries]]
-/// from MapOverViewFormatter.
-class MapFormatter implements Formatter {
-  bool accept(object, config) =>
-      object is InternalMap || config == JsonMLConfig.asMap;
-
-  bool hasChildren(object) => true;
-
-  String preview(object) {
-    Map map = object;
-    try {
-      return '${getObjectTypeName(map)} length ${map.length}';
-    } catch (e) {
-      return safePreview(object, JsonMLConfig.none);
-    }
-  }
-
-  List<NameValuePair> children(object) {
-    // TODO(jacobr): be lazier about enumerating contents of Maps that are not
-    // the build in LinkedHashMap class.
-    // TODO(jacobr): handle large Maps better.
-    Map map = object;
-    var entries = LinkedHashSet<NameValuePair>();
-    map.forEach((key, value) {
-      var entryWrapper = MapEntry(key: key, value: value);
-      entries.add(
-          NameValuePair(name: entries.length.toString(), value: entryWrapper));
-    });
-    addMetadataChildren(object, entries);
-    return entries.toList();
-  }
-}
-
-/// Formatter for Dart Iterable objects including List and Set.
-class IterableFormatter implements Formatter {
-  bool accept(object, config) => object is Iterable;
-
-  String preview(object) {
-    Iterable iterable = object;
-    try {
-      var length = iterable.length;
-      return '${getObjectTypeName(iterable)} length $length';
-    } catch (_) {
-      return '${getObjectTypeName(iterable)}';
-    }
-  }
-
-  bool hasChildren(object) => true;
-
-  List<NameValuePair> children(object) {
-    // TODO(jacobr): be lazier about enumerating contents of Iterables that
-    // are not the built in Set or List types.
-    // TODO(jacobr): handle large Iterables better.
-    // TODO(jacobr): consider only using numeric indices
-    var children = LinkedHashSet<NameValuePair>();
-    children.addAll(IterableSpan(0, object.length, object).children());
-    // TODO(jacobr): provide a link to show regular class properties here.
-    // required for subclasses of iterable, etc.
-    addMetadataChildren(object, children);
-    return children.toList();
-  }
-}
-
-class NamedConstructorFormatter implements Formatter {
-  bool accept(object, config) => object is NamedConstructor;
-
-  // TODO(bmilligan): Display the signature of the named constructor as the
-  // preview.
-  String preview(object) => 'Named Constructor';
-
-  bool hasChildren(object) => true;
-
-  List<NameValuePair> children(object) => <NameValuePair>[
-        NameValuePair(
-            name: 'JavaScript Function',
-            value: object,
-            config: JsonMLConfig.skipDart)
-      ];
-}
-
-/// Formatter for synthetic MapEntry objects used to display contents of a Map
-/// cleanly.
-class MapEntryFormatter implements Formatter {
-  bool accept(object, config) => object is MapEntry;
-
-  String preview(object) {
-    MapEntry entry = object;
-    return '${safePreview(entry.key, JsonMLConfig.none)} => ${safePreview(entry.value, JsonMLConfig.none)}';
-  }
-
-  bool hasChildren(object) => true;
-
-  List<NameValuePair> children(object) => <NameValuePair>[
-        NameValuePair(
-            name: 'key', value: object.key, config: JsonMLConfig.keyToString),
-        NameValuePair(name: 'value', value: object.value)
-      ];
-}
-
-/// Formatter for Dart Iterable objects including List and Set.
-class HeritageClauseFormatter implements Formatter {
-  bool accept(object, config) => object is HeritageClause;
-
-  String preview(object) {
-    HeritageClause clause = object;
-    var typeNames = clause.types.map(getTypeName);
-    return '${clause.name} ${typeNames.join(", ")}';
-  }
-
-  bool hasChildren(object) => true;
-
-  List<NameValuePair> children(object) {
-    HeritageClause clause = object;
-    var children = <NameValuePair>[];
-    for (var type in clause.types) {
-      children.add(NameValuePair(value: type, config: JsonMLConfig.asClass));
-    }
-    return children;
-  }
-}
-
-/// Formatter for synthetic IterableSpan objects used to display contents of
-/// an Iterable cleanly.
-class IterableSpanFormatter implements Formatter {
-  bool accept(object, config) => object is IterableSpan;
-
-  String preview(object) {
-    return '[${object.start}...${object.end - 1}]';
-  }
-
-  bool hasChildren(object) => true;
-
-  List<NameValuePair> children(object) => object.children();
-}
-
-/// Formatter for Dart Errors and Exceptions.
-class ErrorAndExceptionFormatter extends ObjectFormatter {
-  static final RegExp _pattern = RegExp(r'\d+\:\d+');
-
-  bool accept(object, config) => object is Error || object is Exception;
-
-  bool hasChildren(object) => true;
-
-  String preview(object) {
-    var trace = dart.stackTrace(object);
-    // TODO(vsm): Pull our stack mapping logic here.  We should aim to
-    // provide the first meaningful stack frame.
-    var line = '$trace'.split('\n').firstWhere(
-        (l) =>
-            l.contains(_pattern) &&
-            !l.contains('dart:sdk') &&
-            !l.contains('dart_sdk'),
-        orElse: () => '');
-    return line != '' ? '${object} at ${line}' : '${object}';
-  }
-
-  List<NameValuePair> children(object) {
-    var trace = dart.stackTrace(object);
-    var entries = LinkedHashSet<NameValuePair>();
-    entries.add(NameValuePair(name: 'stackTrace', value: trace));
-    addInstanceMembers(object, entries);
-    addMetadataChildren(object, entries);
-    return entries.toList();
-  }
-
-  // Add an ObjectFormatter view underneath.
-  void addInstanceMembers(object, Set<NameValuePair> ret) {
-    ret.add(NameValuePair(
-        name: "[[instance members]]",
-        value: object,
-        config: JsonMLConfig.asObject));
-  }
-}
-
-class StackTraceFormatter implements Formatter {
-  bool accept(object, config) => object is StackTrace;
-
-  String preview(object) => 'StackTrace';
-
-  bool hasChildren(object) => true;
-
-  // Using the stack_trace formatting would be ideal, but adding the
-  // dependency or re-writing the code is too messy, so each line of the
-  // StackTrace will be added as its own child.
-  List<NameValuePair> children(object) => object
-      .toString()
-      .split('\n')
-      .map((line) => NameValuePair(
-          value: line.replaceFirst(RegExp(r'^\s+at\s'), ''), hideName: true))
-      .toList();
-}
-
-class ClassFormatter implements Formatter {
-  bool accept(object, config) => config == JsonMLConfig.asClass;
-
-  String preview(type) {
-    var implements = dart.getImplements(type)();
-    var typeName = getTypeName(type);
-    if (implements != null) {
-      var typeNames = implements.map(getTypeName);
-      return '${typeName} implements ${typeNames.join(", ")}';
-    } else {
-      return typeName;
-    }
-  }
-
-  bool hasChildren(object) => true;
-
-  List<NameValuePair> children(type) {
-    // TODO(jacobr): add other entries describing the class such as
-    // implemented interfaces, and methods.
-    var ret = LinkedHashSet<NameValuePair>();
-
-    var staticProperties = Set<NameValuePair>();
-    var staticMethods = Set<NameValuePair>();
-    // Static fields and properties.
-    addPropertiesFromSignature(
-        dart.getStaticFields(type), staticProperties, type, false);
-    addPropertiesFromSignature(
-        dart.getStaticGetters(type), staticProperties, type, false);
-    // static methods.
-    addPropertiesFromSignature(
-        dart.getStaticMethods(type), staticMethods, type, false);
-
-    if (staticProperties.isNotEmpty || staticMethods.isNotEmpty) {
-      ret
-        ..add(NameValuePair(value: '[[Static members]]', hideName: true))
-        ..addAll(sortProperties(staticProperties))
-        ..addAll(sortProperties(staticMethods));
-    }
-
-    // instance methods.
-    var instanceMethods = Set<NameValuePair>();
-    // Instance methods are defined on the prototype not the constructor object.
-    addPropertiesFromSignature(dart.getMethods(type), instanceMethods,
-        JS('', '#.prototype', type), false,
-        tagTypes: true);
-    if (instanceMethods.isNotEmpty) {
-      ret
-        ..add(NameValuePair(value: '[[Instance Methods]]', hideName: true))
-        ..addAll(sortProperties(instanceMethods));
-    }
-
-    var mixin = dart.getMixin(type);
-    if (mixin != null) {
-      // TODO(jmesserly): this can only be one value.
-      ret.add(NameValuePair(
-          name: '[[Mixins]]', value: HeritageClause('mixins', [mixin])));
-    }
-
-    var baseProto = JS('', '#.__proto__', type);
-    if (baseProto != null && !dart.isJsInterop(baseProto)) {
-      ret.add(NameValuePair(
-          name: "[[base class]]",
-          value: baseProto,
-          config: JsonMLConfig.asClass));
-    }
-
-    // TODO(jacobr): add back fields for named constructors.
-    return ret.toList();
-  }
-}
-
-class TypeFormatter implements Formatter {
-  bool accept(object, config) => object is Type;
-
-  String preview(object) => object.toString();
-
-  bool hasChildren(object) => false;
-
-  List<NameValuePair> children(object) => [];
-}
-
-typedef String StackTraceMapper(String stackTrace);
-
-/// Hook for other parts of the SDK To use to map JS stack traces to Dart
-/// stack traces.
-///
-/// Raw JS stack traces are used if $dartStackTraceUtility has not been
-/// specified.
-StackTraceMapper? get stackTraceMapper {
-  var _util = JS('', r'#.$dartStackTraceUtility', dart.global_);
-  return _util != null ? JS('!', '#.mapper', _util) : null;
-}
-
-/// This entry point is automatically invoked by the code generated by
-/// Dart Dev Compiler
-registerDevtoolsFormatter() {
-  JS('', '#.devtoolsFormatters = [#]', dart.global_, _devtoolsFormatter);
-}
-
-// These methods are exposed here for debugger tests.
-//
-// TODO(jmesserly): these are not exports because there is existing code that
-// calls into them from JS. Currently `dartdevc` always resolves exports at
-// compile time, so there is no need to make exports available at runtime by
-// copying properties. For that reason we cannot use re-export.
-//
-// If these methods are only for tests, we should move them here, or change the
-// tests to call the methods directly on dart:_runtime.
-List<String> getModuleNames() => dart.getModuleNames();
-getModuleLibraries(String name) => dart.getModuleLibraries(name);
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/foreign_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/foreign_helper.dart
deleted file mode 100644
index 7f11505..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/foreign_helper.dart
+++ /dev/null
@@ -1,285 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library dart._foreign_helper;
-
-/**
- * Emits a JavaScript code fragment parameterized by arguments.
- *
- * Hash characters `#` in the [codeTemplate] are replaced in left-to-right order
- * with expressions that contain the values of, or evaluate to, the arguments.
- * The number of hash marks must match the number or arguments.  Although
- * declared with arguments [arg0] through [arg2], the form actually has no limit
- * on the number of arguments.
- *
- * The [typeDescription] argument is interpreted as a description of the
- * behavior of the JavaScript code.  Currently it describes the types that may
- * be returned by the expression, with the additional behavior that the returned
- * values may be fresh instances of the types.  The type information must be
- * correct as it is trusted by the compiler in optimizations, and it must be
- * precise as possible since it is used for native live type analysis to
- * tree-shake large parts of the DOM libraries.  If poorly written, the
- * [typeDescription] will cause unnecessarily bloated programs.  (You can check
- * for this by compiling with `--verbose`; there is an info message describing
- * the number of native (DOM) types that can be removed, which usually should be
- * greater than zero.)
- *
- * The [typeDescription] is a [String] which contains a union of types separated
- * by vertical bar `|` symbols, e.g.  `"num|String"` describes the union of
- * numbers and Strings.  There is no type in Dart that is this precise.  The
- * Dart alternative would be `Object` or `dynamic`, but these types imply that
- * the JS-code might also be creating instances of all the DOM types.  If `null`
- * is possible, it must be specified explicitly, e.g. `"String|Null"`.
- * [typeDescription] has several extensions to help describe the behavior more
- * accurately.  In addition to the union type already described:
- *
- *  + `=Object` is a plain JavaScript object.  Some DOM methods return instances
- *     that have no corresponding Dart type (e.g. cross-frame documents),
- *     `=Object` can be used to describe these untyped' values.
- *
- *  + `var` (or empty string).  If the entire [typeDescription] is `var` (or
- *    empty string) then the type is `dynamic` but the code is known to not
- *    create any instances.
- *
- * Examples:
- *
- *     // Parent window might be an opaque cross-frame window.
- *     var thing = JS('=Object|Window', '#.parent', myWindow);
- *
- * Guidelines:
- *
- *  + Do not use any parameter, local, method or field names in the
- *    [codeTemplate].  These names are all subject to arbitrary renaming by the
- *    compiler.  Pass the values in via `#` substition, and test with the
- *    `--minify` dart2js command-line option.
- *
- *  + The substituted expressions are values, not locations.
- *
- *        JS('void', '# += "x"', this.field);
- *
- *    `this.field` might not be a substituted as a reference to the field.  The
- *    generated code might accidentally work as intended, but it also might be
- *
- *        var t1 = this.field;
- *        t1 += "x";
- *
- *    or
- *
- *        this.get$field() += "x";
- *
- *    The remedy in this case is to expand the `+=` operator, leaving all
- *    references to the Dart field as Dart code:
- *
- *        this.field = JS<String>('!', '# + "x"', this.field);
- *
- *  + Never use `#` in function bodies.
- *
- *    This is a variation on the previous guideline.  Since `#` is replaced with
- *    an *expression* and the expression is only valid in the immediate context,
- *    `#` should never appear in a function body.  Doing so might defer the
- *    evaluation of the expression, and its side effects, until the function is
- *    called.
- *
- *    For example,
- *
- *        var value = foo();
- *        var f = JS('', 'function(){return #}', value)
- *
- *    might result in no immediate call to `foo` and a call to `foo` on every
- *    call to the JavaScript function bound to `f`.  This is better:
- *
- *        var f = JS('',
- *            '(function(val) { return function(){return val}; })(#)', value);
- *
- *    Since `#` occurs in the immediately evaluated expression, the expression
- *    is immediately evaluated and bound to `val` in the immediate call.
- *
- *
- * Additional notes.
- *
- * In the future we may extend [typeDescription] to include other aspects of the
- * behavior, for example, separating the returned types from the instantiated
- * types, or including effects to allow the compiler to perform more
- * optimizations around the code.  This might be an extension of [JS] or a new
- * function similar to [JS] with additional arguments for the new information.
- */
-// Add additional optional arguments if needed. The method is treated internally
-// as a variable argument method.
-external T JS<T extends Object?>(String typeDescription, String codeTemplate,
-    [arg0,
-    arg1,
-    arg2,
-    arg3,
-    arg4,
-    arg5,
-    arg6,
-    arg7,
-    arg8,
-    arg9,
-    arg10,
-    arg11,
-    arg12,
-    arg13,
-    arg14,
-    arg15,
-    arg16,
-    arg17,
-    arg18,
-    arg19]);
-
-/// Annotates the compiled Js name for fields and methods.
-/// Similar behaviour to `JS` from `package:js/js.dart` (but usable from runtime
-/// files), and not to be confused with `JSName` from `js_helper` (which deals
-/// with names of externs).
-// TODO(jmesserly): remove this in favor of js_helper's `@JSName`
-// (Currently they have slightly different semantics, but they can be unified.)
-class JSExportName {
-  final String name;
-  const JSExportName(this.name);
-}
-
-/**
- * Returns the JavaScript constructor function for Dart's Object class.
- * This can be used for type tests, as in
- *
- *     if (JS<bool>('!', '# instanceof #', obj, JS_DART_OBJECT_CONSTRUCTOR()))
- *       ...
- */
-JS_DART_OBJECT_CONSTRUCTOR() {}
-
-/**
- * Returns the interceptor for class [type].  The interceptor is the type's
- * constructor's `prototype` property.  [type] will typically be the class, not
- * an interface, e.g. `JS_INTERCEPTOR_CONSTANT(JSInt)`, not
- * `JS_INTERCEPTOR_CONSTANT(int)`.
- */
-JS_INTERCEPTOR_CONSTANT(Type type) {}
-
-/**
- * Returns the prefix used for generated is checks on classes.
- */
-external String JS_OPERATOR_IS_PREFIX();
-
-/**
- * Returns the prefix used for generated type argument substitutions on classes.
- */
-external String JS_OPERATOR_AS_PREFIX();
-
-/// Returns the name of the class `Object` in the generated code.
-external String JS_OBJECT_CLASS_NAME();
-
-/// Returns the name of the class `Null` in the generated code.
-external String JS_NULL_CLASS_NAME();
-
-/// Returns the name of the class `Function` in the generated code.
-external String JS_FUNCTION_CLASS_NAME();
-
-/**
- * Returns the field name used for determining if an object or its
- * interceptor has JavaScript indexing behavior.
- */
-external String JS_IS_INDEXABLE_FIELD_NAME();
-
-/// Returns the name used for generated function types on classes and methods.
-external String JS_SIGNATURE_NAME();
-
-/// Returns the name used to tag typedefs.
-external String JS_TYPEDEF_TAG();
-
-/// Returns the name used to tag function type representations in JavaScript.
-external String JS_FUNCTION_TYPE_TAG();
-
-/**
- * Returns the name used to tag void return in function type representations
- * in JavaScript.
- */
-external String JS_FUNCTION_TYPE_VOID_RETURN_TAG();
-
-/**
- * Returns the name used to tag return types in function type representations
- * in JavaScript.
- */
-external String JS_FUNCTION_TYPE_RETURN_TYPE_TAG();
-
-/**
- * Returns the name used to tag required parameters in function type
- * representations in JavaScript.
- */
-external String JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG();
-
-/**
- * Returns the name used to tag optional parameters in function type
- * representations in JavaScript.
- */
-external String JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG();
-
-/**
- * Returns the name used to tag named parameters in function type
- * representations in JavaScript.
- */
-external String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG();
-
-/// Returns the JS name for [name] from the Namer.
-external String JS_GET_NAME(String name);
-
-/// Returns the state of a flag that is determined by the state of the compiler
-/// when the program has been analyzed.
-external bool JS_GET_FLAG(String name);
-
-/**
- * Pretend [code] is executed.  Generates no executable code.  This is used to
- * model effects at some other point in external code.  For example, the
- * following models an assignment to foo with an unknown value.
- *
- *     var foo;
- *
- *     main() {
- *       JS_EFFECT((_){ foo = _; })
- *     }
- *
- * TODO(sra): Replace this hack with something to mark the volatile or
- * externally initialized elements.
- */
-void JS_EFFECT(Function code) {
-  code(null);
-}
-
-/**
- * Use this class for creating constants that hold JavaScript code.
- * For example:
- *
- * const constant = JS_CONST('typeof window != "undefined");
- *
- * This code will generate:
- * $.JS_CONST_1 = typeof window != "undefined";
- */
-class JS_CONST {
-  final String code;
-  const JS_CONST(this.code);
-}
-
-/**
- * JavaScript string concatenation. Inputs must be Strings.  Corresponds to the
- * HStringConcat SSA instruction and may be constant-folded.
- */
-String JS_STRING_CONCAT(String a, String b) {
-  // This body is unused, only here for type analysis.
-  return JS<String>('!', '# + #', a, b);
-}
-
-/// Same `@rest` annotation and `spread` function as in
-/// `package:js/src/varargs.dart`.
-///
-/// Runtime files cannot import packages, which is why we have an ad-hoc copy.
-
-class _Rest {
-  const _Rest();
-}
-
-const _Rest rest = _Rest();
-
-dynamic spread(args) {
-  throw StateError('The spread function cannot be called, '
-      'it should be compiled away.');
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/identity_hash_map.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/identity_hash_map.dart
deleted file mode 100644
index eda6c44..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/identity_hash_map.dart
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart._js_helper;
-
-class IdentityMap<K, V> extends InternalMap<K, V> {
-  final _map = JS('', 'new Map()');
-
-  // We track the number of modifications done to the key set of the
-  // hash map to be able to throw when the map is modified while being
-  // iterated over.
-  //
-  // Value cycles after 2^30 modifications so that modification counts are
-  // always unboxed (Smi) values. Modification detection will be missed if you
-  // make exactly some multiple of 2^30 modifications between advances of an
-  // iterator.
-  @notNull
-  int _modifications = 0;
-
-  IdentityMap();
-  IdentityMap.from(JSArray entries) {
-    var map = _map;
-    for (int i = 0, n = JS<int>('!', '#.length', entries); i < n; i += 2) {
-      JS('', '#.set(#[#], #[#])', map, entries, i, entries, i + 1);
-    }
-  }
-
-  int get length => JS<int>('!', '#.size', _map);
-  bool get isEmpty => JS<bool>('!', '#.size == 0', _map);
-  bool get isNotEmpty => JS<bool>('!', '#.size != 0', _map);
-
-  Iterable<K> get keys => _JSMapIterable<K>(this, true);
-  Iterable<V> get values => _JSMapIterable<V>(this, false);
-
-  bool containsKey(Object? key) {
-    return JS<bool>('!', '#.has(#)', _map, key);
-  }
-
-  bool containsValue(Object? value) {
-    for (var v in JS('', '#.values()', _map)) {
-      if (v == value) return true;
-    }
-    return false;
-  }
-
-  void addAll(Map<K, V> other) {
-    if (other.isNotEmpty) {
-      var map = _map;
-      other.forEach((key, value) {
-        JS('', '#.set(#, #)', map, key, value);
-      });
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-
-  V? operator [](Object? key) {
-    V value = JS('', '#.get(#)', _map, key);
-    return value == null ? null : value; // coerce undefined to null.
-  }
-
-  void operator []=(K key, V value) {
-    var map = _map;
-    int length = JS('!', '#.size', map);
-    JS('', '#.set(#, #)', map, key, value);
-    if (length != JS<int>('!', '#.size', map)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    if (JS<bool>('!', '#.has(#)', _map, key)) {
-      return JS('', '#.get(#)', _map, key);
-    }
-    V value = ifAbsent();
-    if (value == null) JS('', '# = null', value);
-    JS('', '#.set(#, #)', _map, key, value);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-    return value;
-  }
-
-  V? remove(Object? key) {
-    V value = JS('', '#.get(#)', _map, key);
-    if (JS<bool>('!', '#.delete(#)', _map, key)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-    return value == null ? null : value; // coerce undefined to null.
-  }
-
-  void clear() {
-    if (JS<int>('!', '#.size', _map) > 0) {
-      JS('', '#.clear()', _map);
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-}
-
-class _JSMapIterable<E> extends EfficientLengthIterable<E> {
-  final InternalMap _map;
-  @notNull
-  final bool _isKeys;
-  _JSMapIterable(this._map, this._isKeys);
-
-  int get length => _map.length;
-  bool get isEmpty => _map.isEmpty;
-
-  @JSExportName('Symbol.iterator')
-  _jsIterator() {
-    var map = _map;
-    var iterator =
-        JS('', '# ? #.keys() : #.values()', _isKeys, map._map, map._map);
-    int modifications = map._modifications;
-    return JS(
-        '',
-        '''{
-      next() {
-        if (# != #) {
-          throw #;
-        }
-        return #.next();
-      }
-    }''',
-        modifications,
-        map._modifications,
-        ConcurrentModificationError(map),
-        iterator);
-  }
-
-  Iterator<E> get iterator => DartIterator<E>(_jsIterator());
-
-  bool contains(Object? element) =>
-      _isKeys ? _map.containsKey(element) : _map.containsValue(element);
-
-  void forEach(void Function(E) f) {
-    for (var entry in this) f(entry);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/interceptors.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/interceptors.dart
deleted file mode 100644
index 04d492f..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/interceptors.dart
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library dart._interceptors;
-
-import 'dart:collection';
-import 'dart:_internal' hide Symbol;
-import 'dart:_js_helper';
-import 'dart:_foreign_helper' show JS, JSExportName;
-import 'dart:math' show Random, ln2;
-import 'dart:_runtime' as dart;
-
-part 'js_array.dart';
-part 'js_number.dart';
-part 'js_string.dart';
-
-// TODO(jmesserly): remove, this doesn't do anything for us.
-abstract class Interceptor {
-  const Interceptor();
-
-  // Use native JS toString method instead of standard Dart Object.toString.
-  String toString() => JS<String>('!', '#.toString()', this);
-}
-
-// TODO(jmesserly): remove
-getInterceptor(obj) => obj;
-
-/**
- * The interceptor class for [bool].
- */
-@JsPeerInterface(name: 'Boolean')
-class JSBool extends Interceptor implements bool {
-  const JSBool();
-
-  // Note: if you change this, also change the function [S].
-  @notNull
-  String toString() => JS<String>('!', r'String(#)', this);
-
-  // The values here are SMIs, co-prime and differ about half of the bit
-  // positions, including the low bit, so they are different mod 2^k.
-  @notNull
-  int get hashCode => this ? (2 * 3 * 23 * 3761) : (269 * 811);
-
-  @notNull
-  bool operator &(@nullCheck bool other) =>
-      JS<bool>('!', "# && #", other, this);
-
-  @notNull
-  bool operator |(@nullCheck bool other) =>
-      JS<bool>('!', "# || #", other, this);
-
-  @notNull
-  bool operator ^(@nullCheck bool other) => !identical(this, other);
-
-  Type get runtimeType => bool;
-}
-
-/**
- * The supertype for JSString and JSArray. Used by the backend as to
- * have a type mask that contains the objects that we can use the
- * native JS [] operator and length on.
- */
-abstract class JSIndexable<E> {
-  int get length;
-  E operator [](int index);
-}
-
-/**
- * The interface implemented by JavaScript objects.  These are methods in
- * addition to the regular Dart Object methods like [Object.hashCode].
- *
- * This is the type that should be exported by a JavaScript interop library.
- */
-abstract class JSObject {}
-
-/**
- * Interceptor base class for JavaScript objects not recognized as some more
- * specific native type.
- */
-abstract class JavaScriptObject extends Interceptor implements JSObject {
-  const JavaScriptObject();
-
-  // It would be impolite to stash a property on the object.
-  int get hashCode => 0;
-
-  Type get runtimeType => JSObject;
-}
-
-/**
- * Interceptor for plain JavaScript objects created as JavaScript object
- * literals or `new Object()`.
- */
-class PlainJavaScriptObject extends JavaScriptObject {
-  const PlainJavaScriptObject();
-}
-
-/**
- * Interceptor for unclassified JavaScript objects, typically objects with a
- * non-trivial prototype chain.
- *
- * This class also serves as a fallback for unknown JavaScript exceptions.
- */
-class UnknownJavaScriptObject extends JavaScriptObject {
-  const UnknownJavaScriptObject();
-
-  String toString() => JS<String>('!', 'String(#)', this);
-}
-
-class NativeError extends Interceptor {
-  String dartStack() => JS<String>('!', '#.stack', this);
-}
-
-// Note that this needs to be in interceptors.dart in order for
-// it to be picked up as an extension type.
-@JsPeerInterface(name: 'TypeError')
-class JSNoSuchMethodError extends NativeError implements NoSuchMethodError {
-  static final _nullError = RegExp(r"^Cannot read property '(.+)' of null$");
-  static final _notAFunction = RegExp(r"^(.+) is not a function$");
-  static final _extensionName = RegExp(r"^Symbol\(dartx\.(.+)\)$");
-  static final _privateName = RegExp(r"^Symbol\((_.+)\)$");
-
-  String? _fieldName(String message) {
-    RegExpMatch? match = _nullError.firstMatch(message);
-    if (match == null) return null;
-    String name = match[1]!;
-    match = _extensionName.firstMatch(name) ?? _privateName.firstMatch(name);
-    return match != null ? match[1] : name;
-  }
-
-  String? _functionCallTarget(String message) {
-    var match = _notAFunction.firstMatch(message);
-    return match != null ? match[1] : null;
-  }
-
-  String dartStack() {
-    var stack = super.dartStack();
-    // Strip TypeError from first line.
-    stack = toString() + '\n' + stack.split('\n').sublist(1).join('\n');
-    return stack;
-  }
-
-  StackTrace get stackTrace => dart.stackTrace(this);
-
-  String toString() {
-    String message = JS('!', '#.message', this);
-    var callTarget = _functionCallTarget(message);
-    if (callTarget != null) {
-      return "NoSuchMethodError: tried to call a non-function, such as null: "
-          "'$callTarget'";
-    }
-    // TODO(vsm): Distinguish between null reference errors and other
-    // TypeErrors.  We should not get non-null TypeErrors from DDC code,
-    // but we may from native JavaScript.
-    var name = _fieldName(message);
-    if (name == null) {
-      // Not a Null NSM error: fallback to JS.
-      return JS<String>('!', '#.toString()', this);
-    }
-    return "NoSuchMethodError: invalid member on null: '$name'";
-  }
-}
-
-@JsPeerInterface(name: 'Function')
-class JSFunction extends Interceptor {
-  toString() {
-    // If the function is a Type object, we should just display the type name.
-    //
-    // Regular Dart code should typically get wrapped type objects instead of
-    // raw type (aka JS constructor) objects, however raw type objects can be
-    // exposed to Dart code via JS interop or debugging tools.
-    if (dart.isType(this)) return dart.typeName(this);
-
-    return JS<String>('!', r'"Closure: " + # + " from: " + #',
-        dart.typeName(dart.getReifiedType(this)), this);
-  }
-
-  // TODO(jmesserly): remove these once we canonicalize tearoffs.
-  operator ==(other) {
-    if (other == null) return false;
-    var boundObj = JS<Object?>('', '#._boundObject', this);
-    if (boundObj == null) return JS<bool>('!', '# === #', this, other);
-    return JS(
-        'bool',
-        '# === #._boundObject && #._boundMethod === #._boundMethod',
-        boundObj,
-        other,
-        this,
-        other);
-  }
-
-  get hashCode {
-    var boundObj = JS<Object?>('', '#._boundObject', this);
-    if (boundObj == null) return identityHashCode(this);
-
-    var boundMethod = JS<Object>('!', '#._boundMethod', this);
-    int hash = (17 * 31 + boundObj.hashCode) & 0x1fffffff;
-    return (hash * 31 + identityHashCode(boundMethod)) & 0x1fffffff;
-  }
-
-  get runtimeType => dart.wrapType(dart.getReifiedType(this));
-}
-
-/// A class used for implementing `null` tear-offs.
-class JSNull {
-  toString() => 'null';
-  noSuchMethod(Invocation i) => dart.defaultNoSuchMethod(null, i);
-}
-
-final Object jsNull = JSNull();
-
-// Note that this needs to be in interceptors.dart in order for
-// it to be picked up as an extension type.
-@JsPeerInterface(name: 'RangeError')
-class JSRangeError extends Interceptor implements ArgumentError {
-  StackTrace get stackTrace => dart.stackTrace(this);
-
-  get invalidValue => null;
-  get name => null;
-  get message => JS<String>('!', '#.message', this);
-
-  String toString() => "Invalid argument: $message";
-}
-
-// Obsolete in dart dev compiler. Added only so that the same version of
-// dart:html can be used in dart2js an dev compiler.
-// Warning: calls to these methods need to be removed before custom elements
-// and cross-frame dom objects behave correctly in ddc.
-// See https://github.com/dart-lang/sdk/issues/28326
-findInterceptorConstructorForType(Type? type) {}
-findConstructorForNativeSubclassType(Type? type, String name) {}
-getNativeInterceptor(object) {}
-setDispatchProperty(object, value) {}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/isolate_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/isolate_helper.dart
deleted file mode 100644
index 6576653..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/isolate_helper.dart
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library dart._isolate_helper;
-
-import 'dart:_runtime' as dart;
-import 'dart:async';
-import 'dart:_foreign_helper' show JS;
-
-/// Deprecated way of initializing `main()` in DDC, typically called from JS.
-@deprecated
-void startRootIsolate(main, args) {
-  if (args == null) args = <String>[];
-  if (args is List) {
-    if (args is! List<String>) args = List<String>.from(args);
-    // DDC attaches signatures only when torn off, and the typical way of
-    // getting `main` via the JS ABI won't do this. So use JS to invoke main.
-    if (JS<bool>('!', 'typeof # == "function"', main)) {
-      // JS will ignore extra arguments.
-      JS('', '#(#, #)', main, args, null);
-    } else {
-      // Not a function. Use a dynamic call to throw an error.
-      (main as dynamic)(args);
-    }
-  } else {
-    throw ArgumentError("Arguments to main must be a List: $args");
-  }
-}
-
-// TODO(vsm): Other libraries import global from here.  Consider replacing
-// those uses to just refer to the one in dart:runtime.
-final global = dart.global_;
-
-class TimerImpl implements Timer {
-  final bool _once;
-  int? _handle;
-  int _tick = 0;
-
-  TimerImpl(int milliseconds, void callback()) : _once = true {
-    if (hasTimer()) {
-      int currentHotRestartIteration = dart.hotRestartIteration;
-      void internalCallback() {
-        _handle = null;
-        dart.removeAsyncCallback();
-        _tick = 1;
-        if (currentHotRestartIteration == dart.hotRestartIteration) {
-          callback();
-        }
-      }
-
-      dart.addAsyncCallback();
-
-      _handle = JS(
-          'int', '#.setTimeout(#, #)', global, internalCallback, milliseconds);
-    } else {
-      throw UnsupportedError("`setTimeout()` not found.");
-    }
-  }
-
-  TimerImpl.periodic(int milliseconds, void callback(Timer timer))
-      : _once = false {
-    if (hasTimer()) {
-      dart.addAsyncCallback();
-      int start = JS<int>('!', 'Date.now()');
-      int currentHotRestartIteration = dart.hotRestartIteration;
-      _handle = JS<int>('!', '#.setInterval(#, #)', global, () {
-        if (currentHotRestartIteration != dart.hotRestartIteration) {
-          cancel();
-          return;
-        }
-        int tick = this._tick + 1;
-        if (milliseconds > 0) {
-          int duration = JS<int>('!', 'Date.now()') - start;
-          if (duration > (tick + 1) * milliseconds) {
-            tick = duration ~/ milliseconds;
-          }
-        }
-        this._tick = tick;
-        callback(this);
-      }, milliseconds);
-    } else {
-      throw UnsupportedError("Periodic timer.");
-    }
-  }
-
-  int get tick => _tick;
-
-  void cancel() {
-    if (hasTimer()) {
-      if (_handle == null) return;
-      dart.removeAsyncCallback();
-      if (_once) {
-        JS('void', '#.clearTimeout(#)', global, _handle);
-      } else {
-        JS('void', '#.clearInterval(#)', global, _handle);
-      }
-      _handle = null;
-    } else {
-      throw UnsupportedError("Canceling a timer.");
-    }
-  }
-
-  bool get isActive => _handle != null;
-}
-
-bool hasTimer() {
-  return JS('', '#.setTimeout', global) != null;
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart
deleted file mode 100644
index 4538120..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_array.dart
+++ /dev/null
@@ -1,671 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._interceptors;
-
-/**
- * The interceptor class for [List]. The compiler recognizes this
- * class as an interceptor, and changes references to [:this:] to
- * actually use the receiver of the method, which is generated as an extra
- * argument added to each member.
- */
-@JsPeerInterface(name: 'Array')
-class JSArray<E> implements List<E>, JSIndexable<E> {
-  const JSArray();
-
-  /**
-   * Constructor for adding type parameters to an existing JavaScript
-   * Array. Used for creating literal lists.
-   */
-  factory JSArray.of(list) {
-    // TODO(sra): Move this to core.List for better readability.
-    //
-    // TODO(jmesserly): this uses special compiler magic to close over the
-    // parameterized ES6 'JSArray' class.
-    JS('', '#.__proto__ = JSArray.prototype', list);
-    return JS('-dynamic', '#', list);
-  }
-
-  // TODO(jmesserly): consider a fixed array subclass instead.
-  factory JSArray.fixed(list) {
-    JS('', '#.__proto__ = JSArray.prototype', list);
-    JS('', r'#.fixed$length = Array', list);
-    return JS('-dynamic', '#', list);
-  }
-
-  factory JSArray.unmodifiable(list) {
-    JS('', '#.__proto__ = JSArray.prototype', list);
-    JS('', r'#.fixed$length = Array', list);
-    JS('', r'#.immutable$list = Array', list);
-    return JS('-dynamic', '#', list);
-  }
-
-  static void markFixedList(list) {
-    // Functions are stored in the hidden class and not as properties in
-    // the object. We never actually look at the value, but only want
-    // to know if the property exists.
-    JS('', r'#.fixed$length = Array', list);
-  }
-
-  static void markUnmodifiableList(list) {
-    // Functions are stored in the hidden class and not as properties in
-    // the object. We never actually look at the value, but only want
-    // to know if the property exists.
-    JS('', r'#.fixed$length = Array', list);
-    JS('', r'#.immutable$list = Array', list);
-  }
-
-  checkMutable(reason) {
-    if (JS<bool>('!', r'#.immutable$list', this)) {
-      throw UnsupportedError(reason);
-    }
-  }
-
-  checkGrowable(reason) {
-    if (JS<bool>('!', r'#.fixed$length', this)) {
-      throw UnsupportedError(reason);
-    }
-  }
-
-  List<R> cast<R>() => List.castFrom<E, R>(this);
-  void add(E value) {
-    checkGrowable('add');
-    JS('void', r'#.push(#)', this, value);
-  }
-
-  E removeAt(@nullCheck int index) {
-    checkGrowable('removeAt');
-    if (index < 0 || index >= length) {
-      throw RangeError.value(index);
-    }
-    return JS('-dynamic', r'#.splice(#, 1)[0]', this, index);
-  }
-
-  void insert(@nullCheck int index, E value) {
-    checkGrowable('insert');
-    if (index < 0 || index > length) {
-      throw RangeError.value(index);
-    }
-    JS('void', r'#.splice(#, 0, #)', this, index, value);
-  }
-
-  void insertAll(@nullCheck int index, Iterable<E> iterable) {
-    checkGrowable('insertAll');
-    RangeError.checkValueInInterval(index, 0, this.length, "index");
-    if (iterable is! EfficientLengthIterable) {
-      iterable = iterable.toList();
-    }
-    @nullCheck
-    int insertionLength = iterable.length;
-    this.length += insertionLength;
-    int end = index + insertionLength;
-    this.setRange(end, this.length, this, index);
-    this.setRange(index, end, iterable);
-  }
-
-  void setAll(@nullCheck int index, Iterable<E> iterable) {
-    checkMutable('setAll');
-    RangeError.checkValueInInterval(index, 0, this.length, "index");
-    for (var element in iterable) {
-      this[index++] = element;
-    }
-  }
-
-  E removeLast() {
-    checkGrowable('removeLast');
-    if (length == 0) throw diagnoseIndexError(this, -1);
-    return JS('var', r'#.pop()', this);
-  }
-
-  bool remove(Object? element) {
-    checkGrowable('remove');
-    var length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (this[i] == element) {
-        JS('var', r'#.splice(#, 1)', this, i);
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Removes elements matching [test] from [this] List.
-   */
-  void removeWhere(bool Function(E) test) {
-    checkGrowable('removeWhere');
-    _removeWhere(test, true);
-  }
-
-  void retainWhere(bool Function(E) test) {
-    checkGrowable('retainWhere');
-    _removeWhere(test, false);
-  }
-
-  void _removeWhere(bool Function(E) test, bool removeMatching) {
-    // Performed in two steps, to avoid exposing an inconsistent state
-    // to the [test] function. First the elements to retain are found, and then
-    // the original list is updated to contain those elements.
-
-    // TODO(sra): Replace this algorithm with one that retains a list of ranges
-    // to be removed.  Most real uses remove 0, 1 or a few clustered elements.
-
-    List retained = [];
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      // !test() ensures bool conversion in checked mode.
-      if (!test(element) == removeMatching) {
-        retained.add(element);
-      }
-      if (this.length != end) throw ConcurrentModificationError(this);
-    }
-    if (retained.length == end) return;
-    this.length = retained.length;
-    @nullCheck
-    var length = retained.length;
-    for (int i = 0; i < length; i++) {
-      JS('', '#[#] = #[#]', this, i, retained, i);
-    }
-  }
-
-  Iterable<E> where(bool Function(E) f) {
-    return WhereIterable<E>(this, f);
-  }
-
-  Iterable<T> expand<T>(Iterable<T> Function(E) f) {
-    return ExpandIterable<E, T>(this, f);
-  }
-
-  void addAll(Iterable<E> collection) {
-    int i = this.length;
-    checkGrowable('addAll');
-    for (E e in collection) {
-      assert(i == this.length || (throw ConcurrentModificationError(this)));
-      i++;
-      JS('void', r'#.push(#)', this, e);
-    }
-  }
-
-  void clear() {
-    length = 0;
-  }
-
-  void forEach(void Function(E) f) {
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      f(element);
-      if (this.length != end) throw ConcurrentModificationError(this);
-    }
-  }
-
-  Iterable<T> map<T>(T Function(E) f) {
-    return MappedListIterable<E, T>(this, f);
-  }
-
-  String join([String separator = ""]) {
-    var length = this.length;
-    var list = List<String>.filled(length, "");
-    for (int i = 0; i < length; i++) {
-      list[i] = "${this[i]}";
-    }
-    return JS<String>('!', "#.join(#)", list, separator);
-  }
-
-  Iterable<E> take(int n) {
-    return SubListIterable<E>(this, 0, n);
-  }
-
-  Iterable<E> takeWhile(bool test(E value)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> skip(int n) {
-    return SubListIterable<E>(this, n, null);
-  }
-
-  Iterable<E> skipWhile(bool Function(E) test) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  E reduce(E combine(E previousValue, E element)) {
-    int length = this.length;
-    if (length == 0) throw IterableElementError.noElement();
-    E value = this[0];
-    for (int i = 1; i < length; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      value = combine(value, element);
-      if (length != this.length) throw ConcurrentModificationError(this);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T Function(T previousValue, E element) combine) {
-    var value = initialValue;
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      value = combine(value, element);
-      if (this.length != length) throw ConcurrentModificationError(this);
-    }
-    return value;
-  }
-
-  E firstWhere(bool Function(E) test, {E Function()? orElse}) {
-    int end = this.length;
-    for (int i = 0; i < end; ++i) {
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) return element;
-      if (this.length != end) throw ConcurrentModificationError(this);
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool Function(E) test, {E Function()? orElse}) {
-    int length = this.length;
-    for (int i = length - 1; i >= 0; i--) {
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) return element;
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool Function(E) test, {E Function()? orElse}) {
-    int length = this.length;
-    E? match = null;
-    bool matchFound = false;
-    for (int i = 0; i < length; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) {
-        if (matchFound) {
-          throw IterableElementError.tooMany();
-        }
-        matchFound = true;
-        match = element;
-      }
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    if (matchFound) return match as E;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    return this[index];
-  }
-
-  List<E> sublist(@nullCheck int start, [int? end]) {
-    if (start < 0 || start > length) {
-      throw RangeError.range(start, 0, length, "start");
-    }
-    if (end == null) {
-      end = length;
-    } else {
-      @notNull
-      var _end = end;
-      if (_end < start || _end > length) {
-        throw RangeError.range(end, start, length, "end");
-      }
-    }
-    if (start == end) return <E>[];
-    return JSArray<E>.of(JS('', r'#.slice(#, #)', this, start, end));
-  }
-
-  Iterable<E> getRange(int start, int end) {
-    RangeError.checkValidRange(start, end, this.length);
-    return SubListIterable<E>(this, start, end);
-  }
-
-  E get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  E get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  void removeRange(@nullCheck int start, @nullCheck int end) {
-    checkGrowable('removeRange');
-    RangeError.checkValidRange(start, end, this.length);
-    int deleteCount = end - start;
-    JS('', '#.splice(#, #)', this, start, deleteCount);
-  }
-
-  void setRange(@nullCheck int start, @nullCheck int end, Iterable<E> iterable,
-      [@nullCheck int skipCount = 0]) {
-    checkMutable('set range');
-
-    RangeError.checkValidRange(start, end, this.length);
-    int length = end - start;
-    if (length == 0) return;
-    RangeError.checkNotNegative(skipCount, "skipCount");
-
-    var otherList = <E>[];
-    int otherStart = 0;
-    // TODO(floitsch): Make this accept more.
-    if (iterable is List<E>) {
-      otherList = iterable;
-      otherStart = skipCount;
-    } else {
-      otherList = iterable.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + length > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    if (otherStart < start) {
-      // Copy backwards to ensure correct copy if [from] is this.
-      // TODO(sra): If [from] is the same Array as [this], we can copy without
-      // type annotation checks on the stores.
-      for (int i = length - 1; i >= 0; i--) {
-        // Use JS to avoid bounds check (the bounds check elimination
-        // optimzation is too weak). The 'E' type annotation is a store type
-        // check - we can't rely on iterable, it could be List<dynamic>.
-        var element = otherList[otherStart + i];
-        JS('', '#[#] = #', this, start + i, element);
-      }
-    } else {
-      for (int i = 0; i < length; i++) {
-        var element = otherList[otherStart + i];
-        JS('', '#[#] = #', this, start + i, element);
-      }
-    }
-  }
-
-  void fillRange(@nullCheck int start, @nullCheck int end, [E? fillValue]) {
-    checkMutable('fill range');
-    RangeError.checkValidRange(start, end, this.length);
-    E checkedFillValue = fillValue as E;
-    for (int i = start; i < end; i++) {
-      JS('', '#[#] = #', this, i, checkedFillValue);
-    }
-  }
-
-  void replaceRange(
-      @nullCheck int start, @nullCheck int end, Iterable<E> replacement) {
-    checkGrowable('replace range');
-    RangeError.checkValidRange(start, end, this.length);
-    if (replacement is! EfficientLengthIterable) {
-      replacement = replacement.toList();
-    }
-    int removeLength = end - start;
-    @nullCheck
-    int insertLength = replacement.length;
-    if (removeLength >= insertLength) {
-      int delta = removeLength - insertLength;
-      int insertEnd = start + insertLength;
-      int newLength = this.length - delta;
-      this.setRange(start, insertEnd, replacement);
-      if (delta != 0) {
-        this.setRange(insertEnd, newLength, this, end);
-        this.length = newLength;
-      }
-    } else {
-      int delta = insertLength - removeLength;
-      int newLength = this.length + delta;
-      int insertEnd = start + insertLength; // aka. end + delta.
-      this.length = newLength;
-      this.setRange(insertEnd, newLength, this, end);
-      this.setRange(start, insertEnd, replacement);
-    }
-  }
-
-  bool any(bool Function(E) test) {
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) return true;
-      if (this.length != end) throw ConcurrentModificationError(this);
-    }
-    return false;
-  }
-
-  bool every(bool Function(E) test) {
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      if (!test(element)) return false;
-      if (this.length != end) throw ConcurrentModificationError(this);
-    }
-    return true;
-  }
-
-  Iterable<E> get reversed => ReversedListIterable<E>(this);
-
-  void sort([int Function(E, E)? compare]) {
-    checkMutable('sort');
-    if (compare == null) {
-      Sort.sort(
-          this, (a, b) => Comparable.compare(a as Comparable, b as Comparable));
-    } else {
-      Sort.sort(this, compare);
-    }
-  }
-
-  void shuffle([Random? random]) {
-    checkMutable('shuffle');
-    if (random == null) random = Random();
-    int length = this.length;
-    while (length > 1) {
-      int pos = random.nextInt(length);
-      length -= 1;
-      var tmp = this[length];
-      this[length] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  int indexOf(Object? element, [@nullCheck int start = 0]) {
-    int length = this.length;
-    if (start >= length) {
-      return -1;
-    }
-    if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < length; i++) {
-      if (this[i] == element) {
-        return i;
-      }
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Object? element, [int? startIndex]) {
-    @notNull
-    int start = startIndex ?? this.length - 1;
-    if (start >= this.length) {
-      start = this.length - 1;
-    } else if (start < 0) {
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
-      if (this[i] == element) {
-        return i;
-      }
-    }
-    return -1;
-  }
-
-  bool contains(Object? other) {
-    var length = this.length;
-    for (int i = 0; i < length; i++) {
-      var element = JS<E>('', '#[#]', this, i);
-      if (element == other) return true;
-    }
-    return false;
-  }
-
-  @notNull
-  bool get isEmpty => length == 0;
-
-  @notNull
-  bool get isNotEmpty => !isEmpty;
-
-  String toString() => ListBase.listToString(this);
-
-  List<E> toList({@nullCheck bool growable = true}) {
-    var list = JS('', '#.slice()', this);
-    if (!growable) markFixedList(list);
-    return JSArray<E>.of(list);
-  }
-
-  Set<E> toSet() => Set<E>.from(this);
-
-  Iterator<E> get iterator => ArrayIterator<E>(this);
-
-  int get hashCode => identityHashCode(this);
-
-  @notNull
-  bool operator ==(other) => identical(this, other);
-
-  @notNull
-  int get length => JS<int>('!', r'#.length', this);
-
-  void set length(@nullCheck int newLength) {
-    checkGrowable('set length');
-    // TODO(sra): Remove this test and let JavaScript throw an error.
-    if (newLength < 0) {
-      throw RangeError.range(newLength, 0, null, 'newLength');
-    }
-    // JavaScript with throw a RangeError for numbers that are too big. The
-    // message does not contain the value.
-    JS('void', r'#.length = #', this, newLength);
-  }
-
-  E operator [](int index) {
-    // Suppress redundant null checks via JS.
-    if (index == null ||
-        JS<int>('!', '#', index) >= JS<int>('!', '#.length', this) ||
-        JS<int>('!', '#', index) < 0) {
-      throw diagnoseIndexError(this, index);
-    }
-    return JS<E>('', '#[#]', this, index);
-  }
-
-  void operator []=(int index, E value) {
-    checkMutable('indexed set');
-    if (index == null ||
-        JS<int>('!', '#', index) >= JS<int>('!', '#.length', this) ||
-        JS<int>('!', '#', index) < 0) {
-      throw diagnoseIndexError(this, index);
-    }
-    JS('void', r'#[#] = #', this, index, value);
-  }
-
-  Map<int, E> asMap() {
-    return ListMapView<E>(this);
-  }
-
-  Type get runtimeType =>
-      dart.wrapType(JS('', '#(#)', dart.getGenericClass(List), E));
-
-  Iterable<E> followedBy(Iterable<E> other) =>
-      FollowedByIterable<E>.firstEfficient(this, other);
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  List<E> operator +(List<E> other) => [...this, ...other];
-
-  int indexWhere(bool Function(E) test, [int start = 0]) {
-    if (start >= this.length) return -1;
-    if (start < 0) start = 0;
-    for (int i = start; i < this.length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool Function(E) test, [int? start]) {
-    if (start == null) start = this.length - 1;
-    if (start < 0) return -1;
-    for (int i = start; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  void set first(E element) {
-    if (this.isEmpty) throw RangeError.index(0, this);
-    this[0] = element;
-  }
-
-  void set last(E element) {
-    if (this.isEmpty) throw RangeError.index(0, this);
-    this[this.length - 1] = element;
-  }
-}
-
-/**
- * Dummy subclasses that allow the backend to track more precise
- * information about arrays through their type. The CPA type inference
- * relies on the fact that these classes do not override [] nor []=.
- *
- * These classes are really a fiction, and can have no methods, since
- * getInterceptor always returns JSArray.  We should consider pushing the
- * 'isGrowable' and 'isMutable' checks into the getInterceptor implementation so
- * these classes can have specialized implementations. Doing so will challenge
- * many assumptions in the JS backend.
- */
-class JSMutableArray<E> extends JSArray<E> {}
-
-class JSFixedArray<E> extends JSMutableArray<E> {}
-
-class JSExtendableArray<E> extends JSMutableArray<E> {}
-
-class JSUnmodifiableArray<E> extends JSArray<E> {} // Already is JSIndexable.
-
-/// An [Iterator] that iterates a JSArray.
-///
-class ArrayIterator<E> implements Iterator<E> {
-  final JSArray<E> _iterable;
-  @notNull
-  final int _length;
-  @notNull
-  int _index;
-  E? _current;
-
-  ArrayIterator(JSArray<E> iterable)
-      : _iterable = iterable,
-        _length = iterable.length,
-        _index = 0;
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    @notNull
-    int length = _iterable.length;
-
-    // We have to do the length check even on fixed length Arrays.  If we can
-    // inline moveNext() we might be able to GVN the length and eliminate this
-    // check on known fixed length JSArray.
-    if (_length != length) {
-      throw throwConcurrentModificationError(_iterable);
-    }
-
-    if (_index >= length) {
-      _current = null;
-      return false;
-    }
-    _current = _iterable[_index];
-    _index++;
-    return true;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_helper.dart
deleted file mode 100644
index 11a3a8e..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_helper.dart
+++ /dev/null
@@ -1,806 +0,0 @@
-// Copyright (c) 2013, 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.
-
-library dart._js_helper;
-
-import 'dart:collection';
-
-import 'dart:_foreign_helper' show JS, JS_STRING_CONCAT, JSExportName;
-
-import 'dart:_interceptors';
-import 'dart:_internal'
-    show
-        EfficientLengthIterable,
-        MappedIterable,
-        IterableElementError,
-        SubListIterable;
-
-import 'dart:_native_typed_data';
-import 'dart:_runtime' as dart;
-
-part 'annotations.dart';
-part 'linked_hash_map.dart';
-part 'identity_hash_map.dart';
-part 'custom_hash_map.dart';
-part 'native_helper.dart';
-part 'regexp_helper.dart';
-part 'string_helper.dart';
-part 'js_rti.dart';
-
-class _Patch {
-  const _Patch();
-}
-
-const _Patch patch = _Patch();
-
-/// Adapts a JS `[Symbol.iterator]` to a Dart `get iterator`.
-///
-/// This is the inverse of `JsIterator`, for classes where we can more
-/// efficiently obtain a JS iterator instead of a Dart one.
-///
-// TODO(jmesserly): this adapter is to work around
-// https://github.com/dart-lang/sdk/issues/28320
-class DartIterator<E> implements Iterator<E> {
-  final _jsIterator;
-  E? _current;
-
-  DartIterator(this._jsIterator);
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    final ret = JS('', '#.next()', _jsIterator);
-    _current = JS('', '#.value', ret);
-    return JS<bool>('!', '!#.done', ret);
-  }
-}
-
-/// Used to compile `sync*`.
-class SyncIterable<E> extends IterableBase<E> {
-  final Function() _initGenerator;
-  SyncIterable(this._initGenerator);
-
-  @JSExportName('Symbol.iterator')
-  _jsIterator() => _initGenerator();
-
-  get iterator => DartIterator(_initGenerator());
-}
-
-class Primitives {
-  static int? parseInt(@nullCheck String source, int? _radix) {
-    var re = JS('', r'/^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i');
-    // TODO(jmesserly): this isn't reified List<String>, but it's safe to use as
-    // long as we use it locally and don't expose it to user code.
-    List<String>? match = JS('', '#.exec(#)', re, source);
-    int digitsIndex = 1;
-    int hexIndex = 2;
-    int decimalIndex = 3;
-    if (match == null) {
-      // TODO(sra): It might be that the match failed due to unrecognized U+0085
-      // spaces.  We could replace them with U+0020 spaces and try matching
-      // again.
-      return null;
-    }
-    String? decimalMatch = match[decimalIndex];
-    if (_radix == null) {
-      if (decimalMatch != null) {
-        // Cannot fail because we know that the digits are all decimal.
-        return JS<int>('!', r'parseInt(#, 10)', source);
-      }
-      if (match[hexIndex] != null) {
-        // Cannot fail because we know that the digits are all hex.
-        return JS<int>('!', r'parseInt(#, 16)', source);
-      }
-      return null;
-    }
-    @notNull
-    var radix = _radix;
-    if (radix < 2 || radix > 36) {
-      throw RangeError.range(radix, 2, 36, 'radix');
-    }
-    if (radix == 10 && decimalMatch != null) {
-      // Cannot fail because we know that the digits are all decimal.
-      return JS<int>('!', r'parseInt(#, 10)', source);
-    }
-    // If radix >= 10 and we have only decimal digits the string is safe.
-    // Otherwise we need to check the digits.
-    if (radix < 10 || decimalMatch == null) {
-      // We know that the characters must be ASCII as otherwise the
-      // regexp wouldn't have matched. Lowercasing by doing `| 0x20` is thus
-      // guaranteed to be a safe operation, since it preserves digits
-      // and lower-cases ASCII letters.
-      int maxCharCode;
-      if (radix <= 10) {
-        // Allow all digits less than the radix. For example 0, 1, 2 for
-        // radix 3.
-        // "0".codeUnitAt(0) + radix - 1;
-        maxCharCode = (0x30 - 1) + radix;
-      } else {
-        // Letters are located after the digits in ASCII. Therefore we
-        // only check for the character code. The regexp above made already
-        // sure that the string does not contain anything but digits or
-        // letters.
-        // "a".codeUnitAt(0) + (radix - 10) - 1;
-        maxCharCode = (0x61 - 10 - 1) + radix;
-      }
-      assert(match[digitsIndex] is String);
-      String digitsPart = JS<String>('!', '#[#]', match, digitsIndex);
-      for (int i = 0; i < digitsPart.length; i++) {
-        int characterCode = digitsPart.codeUnitAt(i) | 0x20;
-        if (characterCode > maxCharCode) {
-          return null;
-        }
-      }
-    }
-    // The above matching and checks ensures the source has at least one digits
-    // and all digits are suitable for the radix, so parseInt cannot return NaN.
-    return JS<int>('!', r'parseInt(#, #)', source, radix);
-  }
-
-  static double? parseDouble(@nullCheck String source) {
-    // Notice that JS parseFloat accepts garbage at the end of the string.
-    // Accept only:
-    // - [+/-]NaN
-    // - [+/-]Infinity
-    // - a Dart double literal
-    // We do allow leading or trailing whitespace.
-    if (!JS(
-        'bool',
-        r'/^\s*[+-]?(?:Infinity|NaN|'
-            r'(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(#)',
-        source)) {
-      return null;
-    }
-    var result = JS<double>('!', r'parseFloat(#)', source);
-    if (result.isNaN) {
-      var trimmed = source.trim();
-      if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') {
-        return result;
-      }
-      return null;
-    }
-    return result;
-  }
-
-  /** `r"$".codeUnitAt(0)` */
-  static const int DOLLAR_CHAR_VALUE = 36;
-
-  static int dateNow() => JS<int>('!', r'Date.now()');
-
-  static void initTicker() {
-    if (timerFrequency != 0) return;
-    // Start with low-resolution. We overwrite the fields if we find better.
-    timerFrequency = 1000;
-    if (JS<bool>('!', 'typeof window == "undefined"')) return;
-    var jsWindow = JS('var', 'window');
-    if (jsWindow == null) return;
-    var performance = JS('var', '#.performance', jsWindow);
-    if (performance == null) return;
-    if (JS<bool>('!', 'typeof #.now != "function"', performance)) return;
-    timerFrequency = 1000000;
-    timerTicks = () => (1000 * JS<num>('!', '#.now()', performance)).floor();
-  }
-
-  /// 0 frequency indicates the default uninitialized state.
-  static int timerFrequency = 0;
-  static int Function() timerTicks = dateNow; // Low-resolution version.
-
-  static bool get isD8 {
-    return JS(
-        'bool',
-        'typeof version == "function"'
-            ' && typeof os == "object" && "system" in os');
-  }
-
-  static bool get isJsshell {
-    return JS(
-        'bool', 'typeof version == "function" && typeof system == "function"');
-  }
-
-  static String currentUri() {
-    // In a browser return self.location.href.
-    if (JS<bool>('!', '!!#.location', dart.global_)) {
-      return JS<String>('!', '#.location.href', dart.global_);
-    }
-
-    // TODO(vsm): Consider supporting properly in non-browser settings.
-    return '';
-  }
-
-  // This is to avoid stack overflows due to very large argument arrays in
-  // apply().  It fixes http://dartbug.com/6919
-  @notNull
-  static String _fromCharCodeApply(List<int> array) {
-    const kMaxApply = 500;
-    @nullCheck
-    int end = array.length;
-    if (end <= kMaxApply) {
-      return JS<String>('!', r'String.fromCharCode.apply(null, #)', array);
-    }
-    String result = '';
-    for (int i = 0; i < end; i += kMaxApply) {
-      int chunkEnd = (i + kMaxApply < end) ? i + kMaxApply : end;
-      result = JS(
-          'String',
-          r'# + String.fromCharCode.apply(null, #.slice(#, #))',
-          result,
-          array,
-          i,
-          chunkEnd);
-    }
-    return result;
-  }
-
-  @notNull
-  static String stringFromCodePoints(JSArray<int> codePoints) {
-    List<int> a = <int>[];
-    for (@nullCheck var i in codePoints) {
-      if (i <= 0xffff) {
-        a.add(i);
-      } else if (i <= 0x10ffff) {
-        a.add(0xd800 + ((((i - 0x10000) >> 10) & 0x3ff)));
-        a.add(0xdc00 + (i & 0x3ff));
-      } else {
-        throw argumentErrorValue(i);
-      }
-    }
-    return _fromCharCodeApply(a);
-  }
-
-  @notNull
-  static String stringFromCharCodes(JSArray<int> charCodes) {
-    for (@nullCheck var i in charCodes) {
-      if (i < 0) throw argumentErrorValue(i);
-      if (i > 0xffff) return stringFromCodePoints(charCodes);
-    }
-    return _fromCharCodeApply(charCodes);
-  }
-
-  // [start] and [end] are validated.
-  @notNull
-  static String stringFromNativeUint8List(
-      NativeUint8List charCodes, @nullCheck int start, @nullCheck int end) {
-    const kMaxApply = 500;
-    if (end <= kMaxApply && start == 0 && end == charCodes.length) {
-      return JS<String>('!', r'String.fromCharCode.apply(null, #)', charCodes);
-    }
-    String result = '';
-    for (int i = start; i < end; i += kMaxApply) {
-      int chunkEnd = (i + kMaxApply < end) ? i + kMaxApply : end;
-      result = JS(
-          'String',
-          r'# + String.fromCharCode.apply(null, #.subarray(#, #))',
-          result,
-          charCodes,
-          i,
-          chunkEnd);
-    }
-    return result;
-  }
-
-  @notNull
-  static String stringFromCharCode(@nullCheck int charCode) {
-    if (0 <= charCode) {
-      if (charCode <= 0xffff) {
-        return JS<String>('!', 'String.fromCharCode(#)', charCode);
-      }
-      if (charCode <= 0x10ffff) {
-        var bits = charCode - 0x10000;
-        var low = 0xDC00 | (bits & 0x3ff);
-        var high = 0xD800 | (bits >> 10);
-        return JS<String>('!', 'String.fromCharCode(#, #)', high, low);
-      }
-    }
-    throw RangeError.range(charCode, 0, 0x10ffff);
-  }
-
-  static String stringConcatUnchecked(String string1, String string2) {
-    return JS_STRING_CONCAT(string1, string2);
-  }
-
-  static String flattenString(String str) {
-    return JS<String>('!', "#.charCodeAt(0) == 0 ? # : #", str, str, str);
-  }
-
-  static String getTimeZoneName(DateTime receiver) {
-    // Firefox and Chrome emit the timezone in parenthesis.
-    // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)".
-    // We extract this name using a regexp.
-    var d = lazyAsJsDate(receiver);
-    List? match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d);
-    if (match != null) return match[1];
-
-    // Internet Explorer 10+ emits the zone name without parenthesis:
-    // Example: Thu Oct 31 14:07:44 PDT 2013
-    match = JS(
-        'JSArray|Null',
-        // Thu followed by a space.
-        r'/^[A-Z,a-z]{3}\s'
-            // Oct 31 followed by space.
-            r'[A-Z,a-z]{3}\s\d+\s'
-            // Time followed by a space.
-            r'\d{2}:\d{2}:\d{2}\s'
-            // The time zone name followed by a space.
-            r'([A-Z]{3,5})\s'
-            // The year.
-            r'\d{4}$/'
-            '.exec(#.toString())',
-        d);
-    if (match != null) return match[1];
-
-    // IE 9 and Opera don't provide the zone name. We fall back to emitting the
-    // UTC/GMT offset.
-    // Example (IE9): Wed Nov 20 09:51:00 UTC+0100 2013
-    //       (Opera): Wed Nov 20 2013 11:03:38 GMT+0100
-    match = JS('JSArray|Null', r'/(?:GMT|UTC)[+-]\d{4}/.exec(#.toString())', d);
-    if (match != null) return match[0];
-    return "";
-  }
-
-  static int getTimeZoneOffsetInMinutes(DateTime receiver) {
-    // Note that JS and Dart disagree on the sign of the offset.
-    return -JS<int>('!', r'#.getTimezoneOffset()', lazyAsJsDate(receiver));
-  }
-
-  static int? valueFromDecomposedDate(
-      @nullCheck int years,
-      @nullCheck int month,
-      @nullCheck int day,
-      @nullCheck int hours,
-      @nullCheck int minutes,
-      @nullCheck int seconds,
-      @nullCheck int milliseconds,
-      @nullCheck bool isUtc) {
-    final int MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
-    var jsMonth = month - 1;
-    int value;
-    if (isUtc) {
-      value = JS<int>('!', r'Date.UTC(#, #, #, #, #, #, #)', years, jsMonth,
-          day, hours, minutes, seconds, milliseconds);
-    } else {
-      value = JS<int>('!', r'new Date(#, #, #, #, #, #, #).valueOf()', years,
-          jsMonth, day, hours, minutes, seconds, milliseconds);
-    }
-    if (value.isNaN ||
-        value < -MAX_MILLISECONDS_SINCE_EPOCH ||
-        value > MAX_MILLISECONDS_SINCE_EPOCH) {
-      return null;
-    }
-    if (years <= 0 || years < 100) return patchUpY2K(value, years, isUtc);
-    return value;
-  }
-
-  static int patchUpY2K(value, years, isUtc) {
-    var date = JS<int>('!', r'new Date(#)', value);
-    if (isUtc) {
-      JS<int>('!', r'#.setUTCFullYear(#)', date, years);
-    } else {
-      JS<int>('!', r'#.setFullYear(#)', date, years);
-    }
-    return JS<int>('!', r'#.valueOf()', date);
-  }
-
-  // Lazily keep a JS Date stored in the JS object.
-  static lazyAsJsDate(DateTime receiver) {
-    if (JS<bool>('!', r'#.date === (void 0)', receiver)) {
-      JS('void', r'#.date = new Date(#)', receiver,
-          receiver.millisecondsSinceEpoch);
-    }
-    return JS('var', r'#.date', receiver);
-  }
-
-  // The getters for date and time parts below add a positive integer to ensure
-  // that the result is really an integer, because the JavaScript implementation
-  // may return -0.0 instead of 0.
-
-  static int getYear(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'(#.getUTCFullYear() + 0)', lazyAsJsDate(receiver))
-        : JS<int>('!', r'(#.getFullYear() + 0)', lazyAsJsDate(receiver));
-  }
-
-  static int getMonth(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'#.getUTCMonth() + 1', lazyAsJsDate(receiver))
-        : JS<int>('!', r'#.getMonth() + 1', lazyAsJsDate(receiver));
-  }
-
-  static int getDay(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'(#.getUTCDate() + 0)', lazyAsJsDate(receiver))
-        : JS<int>('!', r'(#.getDate() + 0)', lazyAsJsDate(receiver));
-  }
-
-  static int getHours(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'(#.getUTCHours() + 0)', lazyAsJsDate(receiver))
-        : JS<int>('!', r'(#.getHours() + 0)', lazyAsJsDate(receiver));
-  }
-
-  static int getMinutes(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'(#.getUTCMinutes() + 0)', lazyAsJsDate(receiver))
-        : JS<int>('!', r'(#.getMinutes() + 0)', lazyAsJsDate(receiver));
-  }
-
-  static int getSeconds(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'(#.getUTCSeconds() + 0)', lazyAsJsDate(receiver))
-        : JS<int>('!', r'(#.getSeconds() + 0)', lazyAsJsDate(receiver));
-  }
-
-  static int getMilliseconds(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS<int>('!', r'(#.getUTCMilliseconds() + 0)', lazyAsJsDate(receiver))
-        : JS<int>('!', r'(#.getMilliseconds() + 0)', lazyAsJsDate(receiver));
-  }
-
-  static int getWeekday(DateTime receiver) {
-    int weekday = (receiver.isUtc)
-        ? JS<int>('!', r'#.getUTCDay() + 0', lazyAsJsDate(receiver))
-        : JS<int>('!', r'#.getDay() + 0', lazyAsJsDate(receiver));
-    // Adjust by one because JS weeks start on Sunday.
-    return (weekday + 6) % 7 + 1;
-  }
-
-  static num valueFromDateString(str) {
-    if (str is! String) throw argumentErrorValue(str);
-    num value = JS('!', r'Date.parse(#)', str);
-    if (value.isNaN) throw argumentErrorValue(str);
-    return value;
-  }
-
-  static Object? getProperty(Object? object, Object key) {
-    if (object == null || object is bool || object is num || object is String) {
-      throw argumentErrorValue(object);
-    }
-    return JS('var', '#[#]', object, key);
-  }
-
-  static void setProperty(object, key, value) {
-    if (object == null || object is bool || object is num || object is String) {
-      throw argumentErrorValue(object);
-    }
-    JS('void', '#[#] = #', object, key, value);
-  }
-}
-
-/**
- * Diagnoses an indexing error. Returns the ArgumentError or RangeError that
- * describes the problem.
- */
-@NoInline()
-Error diagnoseIndexError(indexable, int index) {
-  int length = indexable.length;
-  // The following returns the same error that would be thrown by calling
-  // [RangeError.checkValidIndex] with no optional parameters provided.
-  if (index < 0 || index >= length) {
-    return RangeError.index(index, indexable, 'index', null, length);
-  }
-  // The above should always match, but if it does not, use the following.
-  return RangeError.value(index, 'index');
-}
-
-/**
- * Diagnoses a range error. Returns the ArgumentError or RangeError that
- * describes the problem.
- */
-@NoInline()
-Error diagnoseRangeError(int? start, int? end, int length) {
-  if (start == null) {
-    return ArgumentError.value(start, 'start');
-  }
-  if (start < 0 || start > length) {
-    return RangeError.range(start, 0, length, 'start');
-  }
-  if (end != null) {
-    if (end < start || end > length) {
-      return RangeError.range(end, start, length, 'end');
-    }
-  }
-  // The above should always match, but if it does not, use the following.
-  return ArgumentError.value(end, "end");
-}
-
-@notNull
-int stringLastIndexOfUnchecked(receiver, element, start) =>
-    JS<int>('!', r'#.lastIndexOf(#, #)', receiver, element, start);
-
-/// 'factory' for constructing ArgumentError.value to keep the call sites small.
-@NoInline()
-ArgumentError argumentErrorValue(object) {
-  return ArgumentError.value(object);
-}
-
-void throwArgumentErrorValue(value) {
-  throw argumentErrorValue(value);
-}
-
-checkInt(value) {
-  if (value is! int) throw argumentErrorValue(value);
-  return value;
-}
-
-throwRuntimeError(message) {
-  throw RuntimeError(message);
-}
-
-throwAbstractClassInstantiationError(className) {
-  throw AbstractClassInstantiationError(className);
-}
-
-@NoInline()
-throwConcurrentModificationError(collection) {
-  throw ConcurrentModificationError(collection);
-}
-
-class JsNoSuchMethodError extends Error implements NoSuchMethodError {
-  final String? _message;
-  final String? _method;
-  final String? _receiver;
-
-  JsNoSuchMethodError(this._message, match)
-      : _method = match == null ? null : JS('String|Null', '#.method', match),
-        _receiver =
-            match == null ? null : JS('String|Null', '#.receiver', match);
-
-  String toString() {
-    if (_method == null) return 'NoSuchMethodError: $_message';
-    if (_receiver == null) {
-      return "NoSuchMethodError: method not found: '$_method' ($_message)";
-    }
-    return "NoSuchMethodError: "
-        "method not found: '$_method' on '$_receiver' ($_message)";
-  }
-}
-
-class UnknownJsTypeError extends Error {
-  final String _message;
-
-  UnknownJsTypeError(this._message);
-
-  String toString() => _message.isEmpty ? 'Error' : 'Error: $_message';
-}
-
-/**
- * Called by generated code to build a map literal. [keyValuePairs] is
- * a list of key, value, key, value, ..., etc.
- */
-fillLiteralMap(keyValuePairs, Map result) {
-  // TODO(johnniwinther): Use JSArray to optimize this code instead of calling
-  // [getLength] and [getIndex].
-  int index = 0;
-  int length = getLength(keyValuePairs);
-  while (index < length) {
-    var key = getIndex(keyValuePairs, index++);
-    var value = getIndex(keyValuePairs, index++);
-    result[key] = value;
-  }
-  return result;
-}
-
-bool jsHasOwnProperty(jsObject, String property) {
-  return JS<bool>('!', r'#.hasOwnProperty(#)', jsObject, property);
-}
-
-jsPropertyAccess(jsObject, String property) {
-  return JS('var', r'#[#]', jsObject, property);
-}
-
-/**
- * Called at the end of unaborted switch cases to get the singleton
- * FallThroughError exception that will be thrown.
- */
-getFallThroughError() => FallThroughErrorImplementation();
-
-/**
- * A metadata annotation describing the types instantiated by a native element.
- *
- * The annotation is valid on a native method and a field of a native class.
- *
- * By default, a field of a native class is seen as an instantiation point for
- * all native classes that are a subtype of the field's type, and a native
- * method is seen as an instantiation point fo all native classes that are a
- * subtype of the method's return type, or the argument types of the declared
- * type of the method's callback parameter.
- *
- * An @[Creates] annotation overrides the default set of instantiated types.  If
- * one or more @[Creates] annotations are present, the type of the native
- * element is ignored, and the union of @[Creates] annotations is used instead.
- * The names in the strings are resolved and the program will fail to compile
- * with dart2js if they do not name types.
- *
- * The argument to [Creates] is a string.  The string is parsed as the names of
- * one or more types, separated by vertical bars `|`.  There are some special
- * names:
- *
- * * `=Object`. This means 'exactly Object', which is a plain JavaScript object
- *   with properties and none of the subtypes of Object.
- *
- * Example: we may know that a method always returns a specific implementation:
- *
- *     @Creates('_NodeList')
- *     List<Node> getElementsByTagName(String tag) native;
- *
- * Useful trick: A method can be marked as not instantiating any native classes
- * with the annotation `@Creates('Null')`.  This is useful for fields on native
- * classes that are used only in Dart code.
- *
- *     @Creates('Null')
- *     var _cachedFoo;
- */
-class Creates {
-  final String types;
-  const Creates(this.types);
-}
-
-/**
- * A metadata annotation describing the types returned or yielded by a native
- * element.
- *
- * The annotation is valid on a native method and a field of a native class.
- *
- * By default, a native method or field is seen as returning or yielding all
- * subtypes if the method return type or field type.  This annotation allows a
- * more precise set of types to be specified.
- *
- * See [Creates] for the syntax of the argument.
- *
- * Example: IndexedDB keys are numbers, strings and JavaScript Arrays of keys.
- *
- *     @Returns('String|num|JSExtendableArray')
- *     dynamic key;
- *
- *     // Equivalent:
- *     @Returns('String') @Returns('num') @Returns('JSExtendableArray')
- *     dynamic key;
- */
-class Returns {
-  final String types;
-  const Returns(this.types);
-}
-
-/**
- * A metadata annotation placed on native methods and fields of native classes
- * to specify the JavaScript name.
- *
- * This example declares a Dart field + getter + setter called `$dom_title` that
- * corresponds to the JavaScript property `title`.
- *
- *     class Document native "*Foo" {
- *       @JSName('title')
- *       String $dom_title;
- *     }
- */
-class JSName {
-  final String name;
-  const JSName(this.name);
-}
-
-/**
- * Special interface recognized by the compiler and implemented by DOM
- * objects that support integer indexing. This interface is not
- * visible to anyone, and is only injected into special libraries.
- */
-abstract class JavaScriptIndexingBehavior<E> {}
-
-/// Thrown by type assertions that fail.
-class TypeErrorImpl extends Error implements TypeError, CastError {
-  final String _message;
-
-  TypeErrorImpl(this._message);
-
-  String toString() => _message;
-}
-
-/// Thrown by the 'as' operator if the cast isn't valid.
-class CastErrorImpl extends Error implements CastError, TypeError {
-  final String _message;
-
-  CastErrorImpl(this._message);
-
-  String toString() => _message;
-}
-
-class FallThroughErrorImplementation extends FallThroughError {
-  String toString() => "Switch case fall-through.";
-}
-
-/**
- * Error thrown when a runtime error occurs.
- */
-class RuntimeError extends Error {
-  final message;
-  RuntimeError(this.message);
-  String toString() => "RuntimeError: $message";
-}
-
-/// Error thrown by DDC when an `assert()` fails (with or without a message).
-class AssertionErrorImpl extends AssertionError {
-  final String? _fileUri;
-  final int? _line;
-  final int? _column;
-  final String? _conditionSource;
-
-  AssertionErrorImpl(Object? message,
-      [this._fileUri, this._line, this._column, this._conditionSource])
-      : super(message);
-
-  String toString() {
-    var failureMessage = "";
-    if (_fileUri != null &&
-        _line != null &&
-        _column != null &&
-        _conditionSource != null) {
-      failureMessage += "$_fileUri:${_line}:${_column}\n$_conditionSource\n";
-    }
-    failureMessage +=
-        message != null ? Error.safeToString(message) : "is not true";
-
-    return "Assertion failed: $failureMessage";
-  }
-}
-
-/**
- * Creates a random number with 64 bits of randomness.
- *
- * This will be truncated to the 53 bits available in a double.
- */
-int random64() {
-  // TODO(lrn): Use a secure random source.
-  int int32a = JS("int", "(Math.random() * 0x100000000) >>> 0");
-  int int32b = JS("int", "(Math.random() * 0x100000000) >>> 0");
-  return int32a + int32b * 0x100000000;
-}
-
-class BooleanConversionAssertionError extends AssertionError {
-  toString() => 'Failed assertion: boolean expression must not be null';
-}
-
-// Hook to register new global object.  This is invoked from dart:html
-// whenever a new window is accessed for the first time.
-void registerGlobalObject(object) {
-  try {
-    if (dart.polyfill(object)) {
-      dart.applyAllExtensions(object);
-    }
-  } catch (e) {
-    // This may fail due to cross-origin errors.  In that case, we shouldn't
-    // need to polyfill as we can't get objects from that frame.
-
-    // TODO(vsm): Detect this more robustly - ideally before we try to polyfill.
-  }
-}
-
-/// Expose browser JS classes.
-void applyExtension(name, nativeObject) {
-  dart.applyExtension(name, nativeObject);
-}
-
-/// Used internally by DDC to map ES6 symbols to Dart.
-class PrivateSymbol implements Symbol {
-  // TODO(jmesserly): could also get this off the native symbol instead of
-  // storing it. Mirrors already does this conversion.
-  final String _name;
-  final Object _nativeSymbol;
-
-  const PrivateSymbol(this._name, this._nativeSymbol);
-
-  static String getName(Symbol symbol) => (symbol as PrivateSymbol)._name;
-
-  static Object? getNativeSymbol(Symbol symbol) {
-    if (symbol is PrivateSymbol) return symbol._nativeSymbol;
-    return null;
-  }
-
-  bool operator ==(other) =>
-      other is PrivateSymbol &&
-      _name == other._name &&
-      identical(_nativeSymbol, other._nativeSymbol);
-
-  get hashCode => _name.hashCode;
-
-  // TODO(jmesserly): is this equivalent to _nativeSymbol toString?
-  toString() => 'Symbol("$_name")';
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_number.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_number.dart
deleted file mode 100644
index d2b9661..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_number.dart
+++ /dev/null
@@ -1,627 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._interceptors;
-
-/**
- * The implementation of Dart's int & double methods.
- * These are made available as extension methods on `Number` in JS.
- */
-@JsPeerInterface(name: 'Number')
-class JSNumber extends Interceptor implements int, double {
-  const JSNumber();
-
-  @notNull
-  int compareTo(@nullCheck num b) {
-    if (this < b) {
-      return -1;
-    } else if (this > b) {
-      return 1;
-    } else if (this == b) {
-      if (this == 0) {
-        bool bIsNegative = b.isNegative;
-        if (isNegative == bIsNegative) return 0;
-        if (isNegative) return -1;
-        return 1;
-      }
-      return 0;
-    } else if (isNaN) {
-      if (b.isNaN) {
-        return 0;
-      }
-      return 1;
-    } else {
-      return -1;
-    }
-  }
-
-  @notNull
-  bool get isNegative => (this == 0) ? (1 / this) < 0 : this < 0;
-
-  @notNull
-  bool get isNaN => JS<bool>('!', r'isNaN(#)', this);
-
-  @notNull
-  bool get isInfinite {
-    return JS<bool>('!', r'# == (1/0)', this) ||
-        JS<bool>('!', r'# == (-1/0)', this);
-  }
-
-  @notNull
-  bool get isFinite => JS<bool>('!', r'isFinite(#)', this);
-
-  @notNull
-  JSNumber remainder(@nullCheck num b) {
-    return JS<JSNumber>('!', r'# % #', this, b);
-  }
-
-  @notNull
-  JSNumber abs() => JS<JSNumber>('!', r'Math.abs(#)', this);
-
-  @notNull
-  JSNumber get sign => (this > 0 ? 1 : this < 0 ? -1 : this) as JSNumber;
-
-  @notNull
-  static const int _MIN_INT32 = -0x80000000;
-  @notNull
-  static const int _MAX_INT32 = 0x7FFFFFFF;
-
-  @notNull
-  int toInt() {
-    if (this >= _MIN_INT32 && this <= _MAX_INT32) {
-      return JS<int>('!', '# | 0', this);
-    }
-    if (JS<bool>('!', r'isFinite(#)', this)) {
-      return JS<int>(
-          '!', r'# + 0', truncateToDouble()); // Converts -0.0 to +0.0.
-    }
-    // This is either NaN, Infinity or -Infinity.
-    throw UnsupportedError(JS("String", '"" + #', this));
-  }
-
-  @notNull
-  int truncate() => toInt();
-
-  @notNull
-  int ceil() => ceilToDouble().toInt();
-
-  @notNull
-  int floor() => floorToDouble().toInt();
-
-  @notNull
-  int round() {
-    if (this > 0) {
-      // This path excludes the special cases -0.0, NaN and -Infinity, leaving
-      // only +Infinity, for which a direct test is faster than [isFinite].
-      if (JS<bool>('!', r'# !== (1/0)', this)) {
-        return JS<int>('!', r'Math.round(#)', this);
-      }
-    } else if (JS<bool>('!', '# > (-1/0)', this)) {
-      // This test excludes NaN and -Infinity, leaving only -0.0.
-      //
-      // Subtraction from zero rather than negation forces -0.0 to 0.0 so code
-      // inside Math.round and code to handle result never sees -0.0, which on
-      // some JavaScript VMs can be a slow path.
-      return JS<int>('!', r'0 - Math.round(0 - #)', this);
-    }
-    // This is either NaN, Infinity or -Infinity.
-    throw UnsupportedError(JS("String", '"" + #', this));
-  }
-
-  @notNull
-  double ceilToDouble() => JS<double>('!', r'Math.ceil(#)', this);
-
-  @notNull
-  double floorToDouble() => JS<double>('!', r'Math.floor(#)', this);
-
-  @notNull
-  double roundToDouble() {
-    if (this < 0) {
-      return JS<double>('!', r'-Math.round(-#)', this);
-    } else {
-      return JS<double>('!', r'Math.round(#)', this);
-    }
-  }
-
-  @notNull
-  double truncateToDouble() => this < 0 ? ceilToDouble() : floorToDouble();
-
-  @notNull
-  num clamp(@nullCheck num lowerLimit, @nullCheck num upperLimit) {
-    if (lowerLimit.compareTo(upperLimit) > 0) {
-      throw argumentErrorValue(lowerLimit);
-    }
-    if (this.compareTo(lowerLimit) < 0) return lowerLimit;
-    if (this.compareTo(upperLimit) > 0) return upperLimit;
-    return this;
-  }
-
-  @notNull
-  double toDouble() => this;
-
-  @notNull
-  String toStringAsFixed(@notNull int fractionDigits) {
-    if (fractionDigits < 0 || fractionDigits > 20) {
-      throw RangeError.range(fractionDigits, 0, 20, "fractionDigits");
-    }
-    String result = JS<String>('!', r'#.toFixed(#)', this, fractionDigits);
-    if (this == 0 && isNegative) return "-$result";
-    return result;
-  }
-
-  @notNull
-  String toStringAsExponential([int? fractionDigits]) {
-    String result;
-    if (fractionDigits != null) {
-      @notNull
-      var _fractionDigits = fractionDigits;
-      if (_fractionDigits < 0 || _fractionDigits > 20) {
-        throw RangeError.range(_fractionDigits, 0, 20, "fractionDigits");
-      }
-      result = JS<String>('!', r'#.toExponential(#)', this, _fractionDigits);
-    } else {
-      result = JS<String>('!', r'#.toExponential()', this);
-    }
-    if (this == 0 && isNegative) return "-$result";
-    return result;
-  }
-
-  @notNull
-  String toStringAsPrecision(@nullCheck int precision) {
-    if (precision < 1 || precision > 21) {
-      throw RangeError.range(precision, 1, 21, "precision");
-    }
-    String result = JS<String>('!', r'#.toPrecision(#)', this, precision);
-    if (this == 0 && isNegative) return "-$result";
-    return result;
-  }
-
-  @notNull
-  String toRadixString(@nullCheck int radix) {
-    if (radix < 2 || radix > 36) {
-      throw RangeError.range(radix, 2, 36, "radix");
-    }
-    String result = JS<String>('!', r'#.toString(#)', this, radix);
-    const int rightParenCode = 0x29;
-    if (result.codeUnitAt(result.length - 1) != rightParenCode) {
-      return result;
-    }
-    return _handleIEtoString(result);
-  }
-
-  @notNull
-  static String _handleIEtoString(String result) {
-    // Result is probably IE's untraditional format for large numbers,
-    // e.g., "8.0000000000008(e+15)" for 0x8000000000000800.toString(16).
-    var match = JS<List?>(
-        '', r'/^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(#)', result);
-    if (match == null) {
-      // Then we don't know how to handle it at all.
-      throw UnsupportedError("Unexpected toString result: $result");
-    }
-    result = JS('!', '#', match[1]);
-    int exponent = JS("!", "+#", match[3]);
-    if (match[2] != null) {
-      result = JS('!', '# + #', result, match[2]);
-      exponent -= JS<int>('!', '#.length', match[2]);
-    }
-    return result + "0" * exponent;
-  }
-
-  // Note: if you change this, also change the function [S].
-  @notNull
-  String toString() {
-    if (this == 0 && JS<bool>('!', '(1 / #) < 0', this)) {
-      return '-0.0';
-    } else {
-      return JS<String>('!', r'"" + (#)', this);
-    }
-  }
-
-  @notNull
-  int get hashCode {
-    int intValue = JS<int>('!', '# | 0', this);
-    // Fast exit for integers in signed 32-bit range. Masking converts -0.0 to 0
-    // and ensures that result fits in JavaScript engine's Smi range.
-    if (this == intValue) return 0x1FFFFFFF & intValue;
-
-    // We would like to access the exponent and mantissa as integers but there
-    // are no JavaScript operations that do this, so use log2-floor-pow-divide
-    // to extract the values.
-    num absolute = JS<num>('!', 'Math.abs(#)', this);
-    num lnAbsolute = JS<num>('!', 'Math.log(#)', absolute);
-    num log2 = lnAbsolute / ln2;
-    // Floor via '# | 0' converts NaN to zero so the final result is not NaN.
-    int floorLog2 = JS<int>('!', '# | 0', log2);
-    num factor = JS<num>('!', 'Math.pow(2, #)', floorLog2);
-    num scaled = absolute < 1 ? absolute / factor : factor / absolute;
-    // [scaled] is in the range [0.5, 1].
-
-    // Multiply and truncate to pick up all the mantissa bits. Multiplying by
-    // 0x20000000000000 (which has 53 zero bits) converts the mantissa into an
-    // integer. There are interesting subsets where all the bit variance is in
-    // the most significant bits of the mantissa (e.g. 0.5, 0.625, 0.75), so we
-    // need to mix in the most significant bits. We do this by scaling with a
-    // constant that has many bits set to use the multiplier to mix in bits from
-    // all over the mantissa into low positions.
-    num rescaled1 = scaled * 0x20000000000000;
-    num rescaled2 = scaled * 0x0C95A6C285A6C9;
-    int d1 = JS<int>('!', '# | 0', rescaled1);
-    int d2 = JS<int>('!', '# | 0', rescaled2);
-    // Mix in exponent to distinguish e.g. 1.25 from 2.5.
-    int d3 = floorLog2;
-    int h = 0x1FFFFFFF & ((d1 + d2) * (601 * 997) + d3 * (1259));
-    return h;
-  }
-
-  @notNull
-  JSNumber operator -() => JS<JSNumber>('!', r'-#', this);
-
-  @notNull
-  JSNumber operator +(@nullCheck num other) {
-    return JS<JSNumber>('!', '# + #', this, other);
-  }
-
-  @notNull
-  JSNumber operator -(@nullCheck num other) {
-    return JS<JSNumber>('!', '# - #', this, other);
-  }
-
-  @notNull
-  double operator /(@nullCheck num other) {
-    return JS<double>('!', '# / #', this, other);
-  }
-
-  @notNull
-  JSNumber operator *(@nullCheck num other) {
-    return JS<JSNumber>('!', '# * #', this, other);
-  }
-
-  @notNull
-  JSNumber operator %(@nullCheck num other) {
-    // Euclidean Modulo.
-    JSNumber result = JS<JSNumber>('!', r'# % #', this, other);
-    if (result == 0) return (0 as JSNumber); // Make sure we don't return -0.0.
-    if (result > 0) return result;
-    if (JS<JSNumber>('!', '#', other) < 0) {
-      return result - JS<JSNumber>('!', '#', other);
-    } else {
-      return result + JS<JSNumber>('!', '#', other);
-    }
-  }
-
-  @notNull
-  bool _isInt32(@notNull num value) =>
-      JS<bool>('!', '(# | 0) === #', value, value);
-
-  @notNull
-  int operator ~/(@nullCheck num other) {
-    if (_isInt32(this) && _isInt32(other) && 0 != other && -1 != other) {
-      return JS<int>('!', r'(# / #) | 0', this, other);
-    } else {
-      return _tdivSlow(other);
-    }
-  }
-
-  @notNull
-  int _tdivSlow(num other) {
-    return JS<num>('!', r'# / #', this, other).toInt();
-  }
-
-  // TODO(ngeoffray): Move the bit operations below to [JSInt] and
-  // make them take an int. Because this will make operations slower,
-  // we define these methods on number for now but we need to decide
-  // the grain at which we do the type checks.
-
-  @notNull
-  int operator <<(@nullCheck num other) {
-    if (other < 0) throwArgumentErrorValue(other);
-    return _shlPositive(other);
-  }
-
-  @notNull
-  int _shlPositive(@notNull num other) {
-    // JavaScript only looks at the last 5 bits of the shift-amount. Shifting
-    // by 33 is hence equivalent to a shift by 1.
-    return JS<bool>('!', r'# > 31', other)
-        ? 0
-        : JS<int>('!', r'(# << #) >>> 0', this, other);
-  }
-
-  @notNull
-  int operator >>(@nullCheck num other) {
-    if (JS<num>('!', '#', other) < 0) throwArgumentErrorValue(other);
-    return _shrOtherPositive(other);
-  }
-
-  @notNull
-  int _shrOtherPositive(@notNull num other) {
-    return JS<num>('!', '#', this) > 0
-        ? _shrBothPositive(other)
-        // For negative numbers we just clamp the shift-by amount.
-        // `this` could be negative but not have its 31st bit set.
-        // The ">>" would then shift in 0s instead of 1s. Therefore
-        // we cannot simply return 0xFFFFFFFF.
-        : JS<int>('!', r'(# >> #) >>> 0', this, other > 31 ? 31 : other);
-  }
-
-  @notNull
-  int _shrBothPositive(@notNull num other) {
-    return JS<bool>('!', r'# > 31', other)
-        // JavaScript only looks at the last 5 bits of the shift-amount. In JS
-        // shifting by 33 is hence equivalent to a shift by 1. Shortcut the
-        // computation when that happens.
-        ? 0
-        // Given that `this` is positive we must not use '>>'. Otherwise a
-        // number that has the 31st bit set would be treated as negative and
-        // shift in ones.
-        : JS<int>('!', r'# >>> #', this, other);
-  }
-
-  @notNull
-  int operator &(@nullCheck num other) {
-    return JS<int>('!', r'(# & #) >>> 0', this, other);
-  }
-
-  @notNull
-  int operator |(@nullCheck num other) {
-    return JS<int>('!', r'(# | #) >>> 0', this, other);
-  }
-
-  @notNull
-  int operator ^(@nullCheck num other) {
-    return JS<int>('!', r'(# ^ #) >>> 0', this, other);
-  }
-
-  @notNull
-  bool operator <(@nullCheck num other) {
-    return JS<bool>('!', '# < #', this, other);
-  }
-
-  @notNull
-  bool operator >(@nullCheck num other) {
-    return JS<bool>('!', '# > #', this, other);
-  }
-
-  @notNull
-  bool operator <=(@nullCheck num other) {
-    return JS<bool>('!', '# <= #', this, other);
-  }
-
-  @notNull
-  bool operator >=(@nullCheck num other) {
-    return JS<bool>('!', '# >= #', this, other);
-  }
-
-  // int members.
-  // TODO(jmesserly): all numbers will have these in dynamic dispatch.
-  // We can fix by checking it at dispatch time but we'd need to structure them
-  // differently.
-
-  @notNull
-  bool get isEven => (this & 1) == 0;
-
-  @notNull
-  bool get isOdd => (this & 1) == 1;
-
-  @notNull
-  int toUnsigned(@nullCheck int width) {
-    return this & ((1 << width) - 1);
-  }
-
-  @notNull
-  int toSigned(@nullCheck int width) {
-    int signMask = 1 << (width - 1);
-    return (this & (signMask - 1)) - (this & signMask);
-  }
-
-  @notNull
-  int get bitLength {
-    int nonneg = this < 0 ? -this - 1 : this;
-    int wordBits = 32;
-    while (nonneg >= 0x100000000) {
-      nonneg = nonneg ~/ 0x100000000;
-      wordBits += 32;
-    }
-    return wordBits - _clz32(nonneg);
-  }
-
-  @notNull
-  static int _clz32(@notNull int uint32) {
-    // TODO(sra): Use `Math.clz32(uint32)` (not available on IE11).
-    return 32 - _bitCount(_spread(uint32));
-  }
-
-  // Returns pow(this, e) % m.
-  @notNull
-  int modPow(@nullCheck int e, @nullCheck int m) {
-    if (e < 0) throw RangeError.range(e, 0, null, "exponent");
-    if (m <= 0) throw RangeError.range(m, 1, null, "modulus");
-    if (e == 0) return 1;
-
-    const int maxPreciseInteger = 9007199254740991;
-
-    // Reject inputs that are outside the range of integer values that can be
-    // represented precisely as a Number (double).
-    if (this < -maxPreciseInteger || this > maxPreciseInteger) {
-      throw RangeError.range(
-          this, -maxPreciseInteger, maxPreciseInteger, 'receiver');
-    }
-    if (e > maxPreciseInteger) {
-      throw RangeError.range(e, 0, maxPreciseInteger, 'exponent');
-    }
-    if (m > maxPreciseInteger) {
-      throw RangeError.range(e, 1, maxPreciseInteger, 'modulus');
-    }
-
-    // This is floor(sqrt(maxPreciseInteger)).
-    const int maxValueThatCanBeSquaredWithoutTruncation = 94906265;
-    if (m > maxValueThatCanBeSquaredWithoutTruncation) {
-      // Use BigInt version to avoid truncation in multiplications below. The
-      // 'maxPreciseInteger' check on [m] ensures that toInt() does not round.
-      return BigInt.from(this).modPow(BigInt.from(e), BigInt.from(m)).toInt();
-    }
-
-    int b = this;
-    if (b < 0 || b > m) {
-      b %= m;
-    }
-    int r = 1;
-    while (e > 0) {
-      if (e.isOdd) {
-        r = (r * b) % m;
-      }
-      e ~/= 2;
-      b = (b * b) % m;
-    }
-    return r;
-  }
-
-  // If inv is false, returns gcd(x, y).
-  // If inv is true and gcd(x, y) = 1, returns d, so that c*x + d*y = 1.
-  // If inv is true and gcd(x, y) != 1, throws Exception("Not coprime").
-  @notNull
-  static int _binaryGcd(@notNull int x, @notNull int y, @notNull bool inv) {
-    int s = 1;
-    if (!inv) {
-      while (x.isEven && y.isEven) {
-        x ~/= 2;
-        y ~/= 2;
-        s *= 2;
-      }
-      if (y.isOdd) {
-        var t = x;
-        x = y;
-        y = t;
-      }
-    }
-    final bool ac = x.isEven;
-    int u = x;
-    int v = y;
-    int a = 1, b = 0, c = 0, d = 1;
-    do {
-      while (u.isEven) {
-        u ~/= 2;
-        if (ac) {
-          if (!a.isEven || !b.isEven) {
-            a += y;
-            b -= x;
-          }
-          a ~/= 2;
-        } else if (!b.isEven) {
-          b -= x;
-        }
-        b ~/= 2;
-      }
-      while (v.isEven) {
-        v ~/= 2;
-        if (ac) {
-          if (!c.isEven || !d.isEven) {
-            c += y;
-            d -= x;
-          }
-          c ~/= 2;
-        } else if (!d.isEven) {
-          d -= x;
-        }
-        d ~/= 2;
-      }
-      if (u >= v) {
-        u -= v;
-        if (ac) a -= c;
-        b -= d;
-      } else {
-        v -= u;
-        if (ac) c -= a;
-        d -= b;
-      }
-    } while (u != 0);
-    if (!inv) return s * v;
-    if (v != 1) throw Exception("Not coprime");
-    if (d < 0) {
-      d += x;
-      if (d < 0) d += x;
-    } else if (d > x) {
-      d -= x;
-      if (d > x) d -= x;
-    }
-    return d;
-  }
-
-  // Returns 1/this % m, with m > 0.
-  @notNull
-  int modInverse(@nullCheck int m) {
-    if (m <= 0) throw RangeError.range(m, 1, null, "modulus");
-    if (m == 1) return 0;
-    int t = this;
-    if ((t < 0) || (t >= m)) t %= m;
-    if (t == 1) return 1;
-    if ((t == 0) || (t.isEven && m.isEven)) {
-      throw Exception("Not coprime");
-    }
-    return _binaryGcd(m, t, true);
-  }
-
-  // Returns gcd of abs(this) and abs(other).
-  @notNull
-  int gcd(@nullCheck int other) {
-    int x = this.abs();
-    int y = other.abs();
-    if (x == 0) return y;
-    if (y == 0) return x;
-    if ((x == 1) || (y == 1)) return 1;
-    return _binaryGcd(x, y, false);
-  }
-
-  // Assumes i is <= 32-bit and unsigned.
-  @notNull
-  static int _bitCount(@notNull int i) {
-    // See "Hacker's Delight", section 5-1, "Counting 1-Bits".
-
-    // The basic strategy is to use "divide and conquer" to
-    // add pairs (then quads, etc.) of bits together to obtain
-    // sub-counts.
-    //
-    // A straightforward approach would look like:
-    //
-    // i = (i & 0x55555555) + ((i >>  1) & 0x55555555);
-    // i = (i & 0x33333333) + ((i >>  2) & 0x33333333);
-    // i = (i & 0x0F0F0F0F) + ((i >>  4) & 0x0F0F0F0F);
-    // i = (i & 0x00FF00FF) + ((i >>  8) & 0x00FF00FF);
-    // i = (i & 0x0000FFFF) + ((i >> 16) & 0x0000FFFF);
-    //
-    // The code below removes unnecessary &'s and uses a
-    // trick to remove one instruction in the first line.
-
-    i = _shru(i, 0) - (_shru(i, 1) & 0x55555555);
-    i = (i & 0x33333333) + (_shru(i, 2) & 0x33333333);
-    i = 0x0F0F0F0F & (i + _shru(i, 4));
-    i += _shru(i, 8);
-    i += _shru(i, 16);
-    return (i & 0x0000003F);
-  }
-
-  @notNull
-  static int _shru(int value, int shift) =>
-      JS<int>('!', '# >>> #', value, shift);
-  @notNull
-  static int _shrs(int value, int shift) =>
-      JS<int>('!', '# >> #', value, shift);
-  @notNull
-  static int _ors(int a, int b) => JS<int>('!', '# | #', a, b);
-
-  // Assumes i is <= 32-bit
-  @notNull
-  static int _spread(@notNull int i) {
-    i = _ors(i, _shrs(i, 1));
-    i = _ors(i, _shrs(i, 2));
-    i = _ors(i, _shrs(i, 4));
-    i = _ors(i, _shrs(i, 8));
-    i = _shru(_ors(i, _shrs(i, 16)), 0);
-    return i;
-  }
-
-  @notNull
-  int operator ~() => JS<int>('!', r'(~#) >>> 0', this);
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_primitives.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_primitives.dart
deleted file mode 100644
index 1347b62..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_primitives.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// dart2js "primitives", that is, features that cannot be implemented without
-/// access to JavaScript features.
-library dart2js._js_primitives;
-
-import 'dart:_foreign_helper' show JS;
-
-/**
- * This is the low-level method that is used to implement [print].  It is
- * possible to override this function from JavaScript by defining a function in
- * JavaScript called "dartPrint".
- *
- * Notice that it is also possible to intercept calls to [print] from within a
- * Dart program using zones. This means that there is no guarantee that a call
- * to print ends in this method.
- */
-void printString(String string) {
-  if (JS<bool>('!', r'typeof dartPrint == "function"')) {
-    // Support overriding print from JavaScript.
-    JS('void', r'dartPrint(#)', string);
-    return;
-  }
-
-  // Inside browser or nodejs.
-  if (JS<bool>('!', r'typeof console == "object"') &&
-      JS<bool>('!', r'typeof console.log != "undefined"')) {
-    JS('void', r'console.log(#)', string);
-    return;
-  }
-
-  // Don't throw inside IE, the console is only defined if dev tools is open.
-  if (JS<bool>('!', r'typeof window == "object"')) {
-    return;
-  }
-
-  // Running in d8, the V8 developer shell, or in Firefox' js-shell.
-  if (JS<bool>('!', r'typeof print == "function"')) {
-    JS('void', r'print(#)', string);
-    return;
-  }
-
-  // This is somewhat nasty, but we don't want to drag in a bunch of
-  // dependencies to handle a situation that cannot happen. So we
-  // avoid using Dart [:throw:] and Dart [toString].
-  JS('void', 'throw "Unable to print message: " + String(#)', string);
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_rti.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_rti.dart
deleted file mode 100644
index 483e721..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_rti.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._js_helper;
-
-// TODO(leafp): Maybe get rid of this?  Currently used by the interceptors
-// library, but that should probably be culled as well.
-Type? getRuntimeType(object) =>
-    JS('Type|null', 'dart.getReifiedType(#)', object);
-
-/// Returns the property [index] of the JavaScript array [array].
-getIndex(array, int index) {
-  assert(isJsArray(array));
-  return JS('var', r'#[#]', array, index);
-}
-
-/// Returns the length of the JavaScript array [array].
-int getLength(array) {
-  assert(isJsArray(array));
-  return JS<int>('!', r'#.length', array);
-}
-
-/// Returns whether [value] is a JavaScript array.
-bool isJsArray(value) {
-  return value is JSArray;
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_string.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_string.dart
deleted file mode 100644
index 2987812..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/js_string.dart
+++ /dev/null
@@ -1,507 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._interceptors;
-
-/**
- * The interceptor class for [String]. The compiler recognizes this
- * class as an interceptor, and changes references to [:this:] to
- * actually use the receiver of the method, which is generated as an extra
- * argument added to each member.
- */
-@JsPeerInterface(name: 'String')
-class JSString extends Interceptor implements String, JSIndexable<String> {
-  const JSString();
-
-  @notNull
-  int codeUnitAt(@nullCheck int index) {
-    // Suppress 2nd null check on index and null check on length
-    // (JS String.length cannot be null).
-    final len = this.length;
-    if (index < 0 || index >= len) {
-      throw RangeError.index(index, this, 'index', null, len);
-    }
-    return JS<int>('!', r'#.charCodeAt(#)', this, index);
-  }
-
-  @notNull
-  Iterable<Match> allMatches(@nullCheck String string,
-      [@nullCheck int start = 0]) {
-    final len = string.length;
-    if (0 > start || start > len) {
-      throw RangeError.range(start, 0, len);
-    }
-    return allMatchesInStringUnchecked(this, string, start);
-  }
-
-  Match? matchAsPrefix(@nullCheck String string, [@nullCheck int start = 0]) {
-    int stringLength = JS('!', '#.length', string);
-    if (start < 0 || start > stringLength) {
-      throw RangeError.range(start, 0, stringLength);
-    }
-    int thisLength = JS('!', '#.length', this);
-    if (start + thisLength > stringLength) return null;
-    for (int i = 0; i < thisLength; i++) {
-      if (string.codeUnitAt(start + i) != this.codeUnitAt(i)) {
-        return null;
-      }
-    }
-    return StringMatch(start, string, this);
-  }
-
-  @notNull
-  String operator +(@nullCheck String other) {
-    return JS<String>('!', r'# + #', this, other);
-  }
-
-  @notNull
-  bool endsWith(@nullCheck String other) {
-    var otherLength = other.length;
-    var thisLength = this.length;
-    if (otherLength > thisLength) return false;
-    return other == substring(thisLength - otherLength);
-  }
-
-  @notNull
-  String replaceAll(Pattern from, @nullCheck String to) {
-    return stringReplaceAllUnchecked(this, from, to);
-  }
-
-  @notNull
-  String replaceAllMapped(Pattern from, String Function(Match) convert) {
-    return this.splitMapJoin(from, onMatch: convert);
-  }
-
-  @notNull
-  String splitMapJoin(Pattern from,
-      {String Function(Match)? onMatch, String Function(String)? onNonMatch}) {
-    return stringReplaceAllFuncUnchecked(this, from, onMatch, onNonMatch);
-  }
-
-  @notNull
-  String replaceFirst(Pattern from, @nullCheck String to,
-      [@nullCheck int startIndex = 0]) {
-    RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
-    return stringReplaceFirstUnchecked(this, from, to, startIndex);
-  }
-
-  @notNull
-  String replaceFirstMapped(
-      Pattern from, @nullCheck String replace(Match match),
-      [@nullCheck int startIndex = 0]) {
-    RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
-    return stringReplaceFirstMappedUnchecked(this, from, replace, startIndex);
-  }
-
-  @notNull
-  List<String> split(@nullCheck Pattern pattern) {
-    if (pattern is String) {
-      return JSArray.of(JS('', r'#.split(#)', this, pattern));
-    } else if (pattern is JSSyntaxRegExp && regExpCaptureCount(pattern) == 0) {
-      var re = regExpGetNative(pattern);
-      return JSArray.of(JS('', r'#.split(#)', this, re));
-    } else {
-      return _defaultSplit(pattern);
-    }
-  }
-
-  @notNull
-  String replaceRange(
-      @nullCheck int start, int? end, @nullCheck String replacement) {
-    var e = RangeError.checkValidRange(start, end, this.length);
-    return stringReplaceRangeUnchecked(this, start, e, replacement);
-  }
-
-  @notNull
-  List<String> _defaultSplit(Pattern pattern) {
-    List<String> result = <String>[];
-    // End of most recent match. That is, start of next part to add to result.
-    int start = 0;
-    // Length of most recent match.
-    // Set >0, so no match on the empty string causes the result to be [""].
-    int length = 1;
-    for (var match in pattern.allMatches(this)) {
-      @notNull
-      int matchStart = match.start;
-      @notNull
-      int matchEnd = match.end;
-      length = matchEnd - matchStart;
-      if (length == 0 && start == matchStart) {
-        // An empty match right after another match is ignored.
-        // This includes an empty match at the start of the string.
-        continue;
-      }
-      int end = matchStart;
-      result.add(this.substring(start, end));
-      start = matchEnd;
-    }
-    if (start < this.length || length > 0) {
-      // An empty match at the end of the string does not cause a "" at the end.
-      // A non-empty match ending at the end of the string does add a "".
-      result.add(this.substring(start));
-    }
-    return result;
-  }
-
-  @notNull
-  bool startsWith(Pattern pattern, [@nullCheck int index = 0]) {
-    // Suppress null check on length and all but the first
-    // reference to index.
-    int length = JS<int>('!', '#.length', this);
-    if (index < 0 || JS<int>('!', '#', index) > length) {
-      throw RangeError.range(index, 0, this.length);
-    }
-    if (pattern is String) {
-      String other = pattern;
-      int otherLength = JS<int>('!', '#.length', other);
-      int endIndex = index + otherLength;
-      if (endIndex > length) return false;
-      return other ==
-          JS<String>('!', r'#.substring(#, #)', this, index, endIndex);
-    }
-    return pattern.matchAsPrefix(this, index) != null;
-  }
-
-  @notNull
-  String substring(@nullCheck int startIndex, [int? _endIndex]) {
-    var length = this.length;
-    final endIndex = _endIndex ?? length;
-    if (startIndex < 0) throw RangeError.value(startIndex);
-    if (startIndex > endIndex) throw RangeError.value(startIndex);
-    if (endIndex > length) throw RangeError.value(endIndex);
-    return JS<String>('!', r'#.substring(#, #)', this, startIndex, endIndex);
-  }
-
-  @notNull
-  String toLowerCase() {
-    return JS<String>('!', r'#.toLowerCase()', this);
-  }
-
-  @notNull
-  String toUpperCase() {
-    return JS<String>('!', r'#.toUpperCase()', this);
-  }
-
-  // Characters with Whitespace property (Unicode 6.3).
-  // 0009..000D    ; White_Space # Cc       <control-0009>..<control-000D>
-  // 0020          ; White_Space # Zs       SPACE
-  // 0085          ; White_Space # Cc       <control-0085>
-  // 00A0          ; White_Space # Zs       NO-BREAK SPACE
-  // 1680          ; White_Space # Zs       OGHAM SPACE MARK
-  // 2000..200A    ; White_Space # Zs       EN QUAD..HAIR SPACE
-  // 2028          ; White_Space # Zl       LINE SEPARATOR
-  // 2029          ; White_Space # Zp       PARAGRAPH SEPARATOR
-  // 202F          ; White_Space # Zs       NARROW NO-BREAK SPACE
-  // 205F          ; White_Space # Zs       MEDIUM MATHEMATICAL SPACE
-  // 3000          ; White_Space # Zs       IDEOGRAPHIC SPACE
-  //
-  // BOM: 0xFEFF
-  @notNull
-  static bool _isWhitespace(@notNull int codeUnit) {
-    // Most codeUnits should be less than 256. Special case with a smaller
-    // switch.
-    if (codeUnit < 256) {
-      switch (codeUnit) {
-        case 0x09:
-        case 0x0A:
-        case 0x0B:
-        case 0x0C:
-        case 0x0D:
-        case 0x20:
-        case 0x85:
-        case 0xA0:
-          return true;
-        default:
-          return false;
-      }
-    }
-    switch (codeUnit) {
-      case 0x1680:
-      case 0x2000:
-      case 0x2001:
-      case 0x2002:
-      case 0x2003:
-      case 0x2004:
-      case 0x2005:
-      case 0x2006:
-      case 0x2007:
-      case 0x2008:
-      case 0x2009:
-      case 0x200A:
-      case 0x2028:
-      case 0x2029:
-      case 0x202F:
-      case 0x205F:
-      case 0x3000:
-      case 0xFEFF:
-        return true;
-      default:
-        return false;
-    }
-  }
-
-  /// Finds the index of the first non-whitespace character, or the
-  /// end of the string. Start looking at position [index].
-  @notNull
-  static int _skipLeadingWhitespace(String string, @nullCheck int index) {
-    const int SPACE = 0x20;
-    const int CARRIAGE_RETURN = 0x0D;
-    var stringLength = string.length;
-    while (index < stringLength) {
-      int codeUnit = string.codeUnitAt(index);
-      if (codeUnit != SPACE &&
-          codeUnit != CARRIAGE_RETURN &&
-          !_isWhitespace(codeUnit)) {
-        break;
-      }
-      index++;
-    }
-    return index;
-  }
-
-  /// Finds the index after the last non-whitespace character, or 0.
-  /// Start looking at position [index - 1].
-  @notNull
-  static int _skipTrailingWhitespace(String string, @nullCheck int index) {
-    const int SPACE = 0x20;
-    const int CARRIAGE_RETURN = 0x0D;
-    while (index > 0) {
-      int codeUnit = string.codeUnitAt(index - 1);
-      if (codeUnit != SPACE &&
-          codeUnit != CARRIAGE_RETURN &&
-          !_isWhitespace(codeUnit)) {
-        break;
-      }
-      index--;
-    }
-    return index;
-  }
-
-  // Dart2js can't use JavaScript trim directly,
-  // because JavaScript does not trim
-  // the NEXT LINE (NEL) character (0x85).
-  @notNull
-  String trim() {
-    const int NEL = 0x85;
-
-    // Start by doing JS trim. Then check if it leaves a NEL at
-    // either end of the string.
-    String result = JS('!', '#.trim()', this);
-    final length = result.length;
-    if (length == 0) return result;
-    int firstCode = result.codeUnitAt(0);
-    int startIndex = 0;
-    if (firstCode == NEL) {
-      startIndex = _skipLeadingWhitespace(result, 1);
-      if (startIndex == length) return "";
-    }
-
-    int endIndex = length;
-    // We know that there is at least one character that is non-whitespace.
-    // Therefore we don't need to verify that endIndex > startIndex.
-    int lastCode = result.codeUnitAt(endIndex - 1);
-    if (lastCode == NEL) {
-      endIndex = _skipTrailingWhitespace(result, endIndex - 1);
-    }
-    if (startIndex == 0 && endIndex == length) return result;
-    return JS<String>('!', r'#.substring(#, #)', result, startIndex, endIndex);
-  }
-
-  // Dart2js can't use JavaScript trimLeft directly,
-  // because it is not in ES5, so not every browser implements it,
-  // and because those that do will not trim the NEXT LINE character (0x85).
-  @notNull
-  String trimLeft() {
-    const int NEL = 0x85;
-
-    // Start by doing JS trim. Then check if it leaves a NEL at
-    // the beginning of the string.
-    String result;
-    int startIndex = 0;
-    if (JS<bool>('!', 'typeof #.trimLeft != "undefined"', this)) {
-      result = JS<String>('!', '#.trimLeft()', this);
-      if (result.length == 0) return result;
-      int firstCode = result.codeUnitAt(0);
-      if (firstCode == NEL) {
-        startIndex = _skipLeadingWhitespace(result, 1);
-      }
-    } else {
-      result = this;
-      startIndex = _skipLeadingWhitespace(this, 0);
-    }
-    if (startIndex == 0) return result;
-    if (startIndex == result.length) return "";
-    return JS<String>('!', r'#.substring(#)', result, startIndex);
-  }
-
-  // Dart2js can't use JavaScript trimRight directly,
-  // because it is not in ES5 and because JavaScript does not trim
-  // the NEXT LINE character (0x85).
-  @notNull
-  String trimRight() {
-    const int NEL = 0x85;
-
-    // Start by doing JS trim. Then check if it leaves a NEL or BOM at
-    // the end of the string.
-    String result;
-    @notNull
-    int endIndex = 0;
-    // trimRight is implemented by Firefox and Chrome/Blink,
-    // so use it if it is there.
-    if (JS<bool>('!', 'typeof #.trimRight != "undefined"', this)) {
-      result = JS<String>('!', '#.trimRight()', this);
-      endIndex = result.length;
-      if (endIndex == 0) return result;
-      int lastCode = result.codeUnitAt(endIndex - 1);
-      if (lastCode == NEL) {
-        endIndex = _skipTrailingWhitespace(result, endIndex - 1);
-      }
-    } else {
-      result = this;
-      endIndex = _skipTrailingWhitespace(this, this.length);
-    }
-
-    if (endIndex == result.length) return result;
-    if (endIndex == 0) return "";
-    return JS<String>('!', r'#.substring(#, #)', result, 0, endIndex);
-  }
-
-  @notNull
-  String operator *(@nullCheck int times) {
-    if (0 >= times) return '';
-    if (times == 1 || this.length == 0) return this;
-    if (times != JS<int>('!', '# >>> 0', times)) {
-      // times >= 2^32. We can't create a string that big.
-      throw const OutOfMemoryError();
-    }
-    var result = '';
-    String s = this;
-    while (true) {
-      if (times & 1 == 1) result = s + result;
-      times = JS<int>('!', '# >>> 1', times);
-      if (times == 0) break;
-      s += s;
-    }
-    return result;
-  }
-
-  @notNull
-  String padLeft(@nullCheck int width, [String padding = ' ']) {
-    int delta = width - this.length;
-    if (delta <= 0) return this;
-    return padding * delta + this;
-  }
-
-  @notNull
-  String padRight(@nullCheck int width, [String padding = ' ']) {
-    int delta = width - this.length;
-    if (delta <= 0) return this;
-    return this + padding * delta;
-  }
-
-  @notNull
-  List<int> get codeUnits => CodeUnits(this);
-
-  @notNull
-  Runes get runes => Runes(this);
-
-  @notNull
-  int indexOf(@nullCheck Pattern pattern, [@nullCheck int start = 0]) {
-    if (start < 0 || start > this.length) {
-      throw RangeError.range(start, 0, this.length);
-    }
-    if (pattern is String) {
-      return stringIndexOfStringUnchecked(this, pattern, start);
-    }
-    if (pattern is JSSyntaxRegExp) {
-      JSSyntaxRegExp re = pattern;
-      Match? match = firstMatchAfter(re, this, start);
-      return (match == null) ? -1 : match.start;
-    }
-    var length = this.length;
-    for (int i = start; i <= length; i++) {
-      if (pattern.matchAsPrefix(this, i) != null) return i;
-    }
-    return -1;
-  }
-
-  @notNull
-  int lastIndexOf(@nullCheck Pattern pattern, [int? _start]) {
-    var length = this.length;
-    var start = _start ?? length;
-    if (start < 0 || start > length) {
-      throw RangeError.range(start, 0, length);
-    }
-    if (pattern is String) {
-      String other = pattern;
-      if (start + other.length > length) {
-        start = length - other.length;
-      }
-      return stringLastIndexOfUnchecked(this, other, start);
-    }
-    for (int i = start; i >= 0; i--) {
-      if (pattern.matchAsPrefix(this, i) != null) return i;
-    }
-    return -1;
-  }
-
-  @notNull
-  bool contains(@nullCheck Pattern other, [@nullCheck int startIndex = 0]) {
-    if (startIndex < 0 || startIndex > this.length) {
-      throw RangeError.range(startIndex, 0, this.length);
-    }
-    return stringContainsUnchecked(this, other, startIndex);
-  }
-
-  @notNull
-  bool get isEmpty => JS<int>('!', '#.length', this) == 0;
-
-  @notNull
-  bool get isNotEmpty => !isEmpty;
-
-  @notNull
-  int compareTo(@nullCheck String other) {
-    return this == other ? 0 : JS<bool>('!', r'# < #', this, other) ? -1 : 1;
-  }
-
-  // Note: if you change this, also change the function [S].
-  @notNull
-  String toString() => this;
-
-  /**
-   * This is the [Jenkins hash function][1] but using masking to keep
-   * values in SMI range.
-   *
-   * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
-   */
-  @notNull
-  int get hashCode {
-    // TODO(ahe): This method shouldn't have to use JS. Update when our
-    // optimizations are smarter.
-    int hash = 0;
-    int length = JS('!', '#.length', this);
-    for (int i = 0; i < length; i++) {
-      hash = 0x1fffffff & (hash + JS<int>('!', r'#.charCodeAt(#)', this, i));
-      hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-      hash = JS<int>('!', '# ^ (# >> 6)', hash, hash);
-    }
-    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-    hash = JS<int>('!', '# ^ (# >> 11)', hash, hash);
-    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-  }
-
-  @notNull
-  Type get runtimeType => String;
-
-  @notNull
-  int get length native;
-
-  @notNull
-  String operator [](@nullCheck int index) {
-    if (index >= JS<int>('!', '#.length', this) || index < 0) {
-      throw diagnoseIndexError(this, index);
-    }
-    return JS<String>('!', '#[#]', this, index);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/linked_hash_map.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/linked_hash_map.dart
deleted file mode 100644
index f797ea4..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/linked_hash_map.dart
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright (c) 2017, 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.
-
-// Efficient JavaScript based implementation of a linked hash map used as a
-// backing map for constant maps and the [LinkedHashMap] patch
-
-part of dart._js_helper;
-
-abstract class InternalMap<K, V> extends MapBase<K, V>
-    implements LinkedHashMap<K, V>, HashMap<K, V> {
-  @notNull
-  get _map;
-
-  @notNull
-  int get _modifications;
-
-  void forEach(void action(K key, V value)) {
-    int modifications = _modifications;
-    for (var entry in JS('Iterable', '#.entries()', _map)) {
-      action(JS('', '#[0]', entry), JS('', '#[1]', entry));
-      if (modifications != _modifications) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-  }
-}
-
-/// A linked hash map implementation based on ES6 Map.
-///
-/// Items that can use identity semantics are stored directly in the backing
-/// map.
-///
-/// Items that have a custom equality/hashCode are first canonicalized by
-/// looking up the canonical key by its hashCode.
-class LinkedMap<K, V> extends InternalMap<K, V> {
-  /// The backing store for this map.
-  ///
-  /// Keys that use identity equality are stored directly. For other types of
-  /// keys, we first look them up (by hashCode) in the [_keyMap] map, then
-  /// we lookup the key in this map.
-  @notNull
-  final _map = JS('', 'new Map()');
-
-  /// Items that use custom equality semantics.
-  ///
-  /// This maps from the item's hashCode to the canonical key, which is then
-  /// used to lookup the item in [_map]. Keeping the data in our primary backing
-  /// map gives us the ordering semantics requred by [LinkedHashMap], while
-  /// also providing convenient access to keys/values.
-  @notNull
-  final _keyMap = JS('', 'new Map()');
-
-  // We track the number of modifications done to the key set of the
-  // hash map to be able to throw when the map is modified while being
-  // iterated over.
-  //
-  // Value cycles after 2^30 modifications so that modification counts are
-  // always unboxed (Smi) values. Modification detection will be missed if you
-  // make exactly some multiple of 2^30 modifications between advances of an
-  // iterator.
-  @notNull
-  int _modifications = 0;
-
-  LinkedMap();
-
-  /// Called by generated code for a map literal.
-  LinkedMap.from(JSArray entries) {
-    var map = _map;
-    var keyMap = _keyMap;
-    for (int i = 0, n = JS('!', '#.length', entries); i < n; i += 2) {
-      K key = JS('', '#[#]', entries, i);
-      V value = JS('', '#[#]', entries, i + 1);
-      if (key == null) {
-        key = JS('', 'null');
-      } else if (JS<bool>('!', '#[#] !== #', key,
-          dart.extensionSymbol('_equals'), dart.identityEquals)) {
-        key = putLinkedMapKey(key, keyMap);
-      }
-      JS('', '#.set(#, #)', map, key, value);
-    }
-  }
-
-  @notNull
-  int get length => JS<int>('!', '#.size', _map);
-
-  @notNull
-  bool get isEmpty => JS<bool>('!', '#.size == 0', _map);
-
-  @notNull
-  bool get isNotEmpty => JS<bool>('!', '#.size != 0', _map);
-
-  Iterable<K> get keys => _JSMapIterable<K>(this, true);
-  Iterable<V> get values => _JSMapIterable<V>(this, false);
-
-  @notNull
-  bool containsKey(Object? key) {
-    if (key == null) {
-      key = JS('', 'null');
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, key.hashCode);
-      if (buckets != null) {
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          K k = JS('', '#[#]', buckets, i);
-          if (k == key) return true;
-        }
-      }
-      return false;
-    }
-    return JS<bool>('!', '#.has(#)', _map, key);
-  }
-
-  bool containsValue(Object? value) {
-    for (var v in JS('', '#.values()', _map)) {
-      if (v == value) return true;
-    }
-    return false;
-  }
-
-  void addAll(Map<K, V> other) {
-    var map = _map;
-    int length = JS('', '#.size', map);
-    other.forEach((K key, V value) {
-      if (key == null) {
-        key = JS('', 'null');
-      } else if (JS<bool>('!', '#[#] !== #', key,
-          dart.extensionSymbol('_equals'), dart.identityEquals)) {
-        key = putLinkedMapKey(key, _keyMap);
-      }
-      JS('', '#.set(#, #)', _map, key, value);
-    });
-    if (length != JS<int>('!', '#.size', map)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-
-  V? operator [](Object? key) {
-    if (key == null) {
-      key = JS('', 'null');
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      var buckets = JS('', '#.get(# & 0x3ffffff)', _keyMap, key.hashCode);
-      if (buckets != null) {
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          K k = JS('', '#[#]', buckets, i);
-          if (k == key) return JS('', '#.get(#)', _map, k);
-        }
-      }
-      return null;
-    }
-    V value = JS('', '#.get(#)', _map, key);
-    return value == null ? null : value; // coerce undefined to null.
-  }
-
-  void operator []=(K key, V value) {
-    if (key == null) {
-      key = JS('', 'null');
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      key = putLinkedMapKey(key, _keyMap);
-    }
-    var map = _map;
-    int length = JS('', '#.size', map);
-    JS('', '#.set(#, #)', map, key, value);
-    if (length != JS<int>('!', '#.size', map)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    var map = _map;
-    if (key == null) {
-      key = JS('', 'null');
-      if (JS<bool>('!', '#.has(null)', map)) return JS('', '#.get(null)', map);
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      @notNull
-      K k = key;
-      var hash = JS<int>('!', '# & 0x3ffffff', k.hashCode);
-      var buckets = JS('', '#.get(#)', _keyMap, hash);
-      if (buckets == null) {
-        JS('', '#.set(#, [#])', _keyMap, hash, key);
-      } else {
-        for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-          k = JS('', '#[#]', buckets, i);
-          if (k == key) return JS('', '#.get(#)', map, k);
-        }
-        JS('', '#.push(#)', buckets, key);
-      }
-    } else if (JS<bool>('!', '#.has(#)', map, key)) {
-      return JS('', '#.get(#)', map, key);
-    }
-    V value = ifAbsent();
-    if (value == null) {
-      value = JS('', 'null');
-    }
-    JS('', '#.set(#, #)', map, key, value);
-    _modifications = (_modifications + 1) & 0x3ffffff;
-    return value;
-  }
-
-  V? remove(Object? key) {
-    if (key == null) {
-      key = JS('', 'null');
-    } else if (JS<bool>('!', '#[#] !== #', key, dart.extensionSymbol('_equals'),
-        dart.identityEquals)) {
-      @notNull
-      var hash = JS<int>('!', '# & 0x3ffffff', key.hashCode);
-      var buckets = JS('', '#.get(#)', _keyMap, hash);
-      if (buckets == null) return null; // not found
-      for (int i = 0, n = JS('!', '#.length', buckets);;) {
-        K k = JS('', '#[#]', buckets, i);
-        if (k == key) {
-          key = k;
-          if (n == 1) {
-            JS('', '#.delete(#)', _keyMap, hash);
-          } else {
-            JS('', '#.splice(#, 1)', buckets, i);
-          }
-          break;
-        }
-        if (++i >= n) return null; // not found
-      }
-    }
-    var map = _map;
-    V value = JS('', '#.get(#)', map, key);
-    if (JS<bool>('!', '#.delete(#)', map, key)) {
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-    return value == null ? null : value; // coerce undefined to null.
-  }
-
-  void clear() {
-    var map = _map;
-    if (JS<int>('!', '#.size', map) > 0) {
-      JS('', '#.clear()', map);
-      JS('', '#.clear()', _keyMap);
-      _modifications = (_modifications + 1) & 0x3ffffff;
-    }
-  }
-}
-
-@NoReifyGeneric()
-K putLinkedMapKey<K>(@notNull K key, keyMap) {
-  var hash = JS<int>('!', '# & 0x3ffffff', key.hashCode);
-  var buckets = JS('', '#.get(#)', keyMap, hash);
-  if (buckets == null) {
-    JS('', '#.set(#, [#])', keyMap, hash, key);
-    return key;
-  }
-  for (int i = 0, n = JS('!', '#.length', buckets); i < n; i++) {
-    @notNull
-    K k = JS('', '#[#]', buckets, i);
-    if (k == key) return k;
-  }
-  JS('', '#.push(#)', buckets, key);
-  return key;
-}
-
-class ImmutableMap<K, V> extends LinkedMap<K, V> {
-  ImmutableMap.from(JSArray entries) : super.from(entries);
-
-  void operator []=(K key, V value) {
-    throw _unsupported();
-  }
-
-  void addAll(Object other) => throw _unsupported();
-  void clear() => throw _unsupported();
-  V? remove(Object? key) => throw _unsupported();
-  V putIfAbsent(K key, V ifAbsent()) => throw _unsupported();
-
-  static Error _unsupported() =>
-      UnsupportedError("Cannot modify unmodifiable map");
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/mirror_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/mirror_helper.dart
deleted file mode 100644
index 1b78136..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/mirror_helper.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/**
- * Helps dealing with reflection in the case that the source code has been
- * changed as a result of compiling with dart2dart.
- */
-library dart._mirror_helper;
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/native_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/native_helper.dart
deleted file mode 100644
index cc214e8..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/native_helper.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._js_helper;
-
-// Obsolete in dart dev compiler. Added only so that the same version of
-// dart:html can be used in dart2js an dev compiler.
-F convertDartClosureToJS<F>(F closure, int arity) {
-  return closure;
-}
-
-// Warning: calls to these methods need to be removed before custom elements
-// and cross-frame dom objects behave correctly in ddc
-// https://github.com/dart-lang/sdk/issues/28326
-setNativeSubclassDispatchRecord(proto, interceptor) {}
-findDispatchTagForInterceptorClass(interceptorClassConstructor) {}
-makeLeafDispatchRecord(interceptor) {}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/native_typed_data.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/native_typed_data.dart
deleted file mode 100644
index 3a7f409..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/native_typed_data.dart
+++ /dev/null
@@ -1,1826 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Specialized integers and floating point numbers,
-/// with SIMD support and efficient lists.
-library dart.typed_data.implementation;
-
-import 'dart:collection';
-import 'dart:_internal';
-import 'dart:_interceptors' show JSIndexable;
-import 'dart:_js_helper'
-    show
-        Creates,
-        JavaScriptIndexingBehavior,
-        JSName,
-        Native,
-        Returns,
-        diagnoseIndexError,
-        diagnoseRangeError;
-import 'dart:_foreign_helper' show JS;
-import 'dart:math' as Math;
-
-import 'dart:typed_data';
-
-@Native('ArrayBuffer')
-class NativeByteBuffer implements ByteBuffer {
-  @JSName('byteLength')
-  external int get lengthInBytes;
-
-  Type get runtimeType => ByteBuffer;
-
-  Uint8List asUint8List([int offsetInBytes = 0, int? length]) {
-    return NativeUint8List.view(this, offsetInBytes, length);
-  }
-
-  Int8List asInt8List([int offsetInBytes = 0, int? length]) {
-    return NativeInt8List.view(this, offsetInBytes, length);
-  }
-
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) {
-    return NativeUint8ClampedList.view(this, offsetInBytes, length);
-  }
-
-  Uint16List asUint16List([int offsetInBytes = 0, int? length]) {
-    return NativeUint16List.view(this, offsetInBytes, length);
-  }
-
-  Int16List asInt16List([int offsetInBytes = 0, int? length]) {
-    return NativeInt16List.view(this, offsetInBytes, length);
-  }
-
-  Uint32List asUint32List([int offsetInBytes = 0, int? length]) {
-    return NativeUint32List.view(this, offsetInBytes, length);
-  }
-
-  Int32List asInt32List([int offsetInBytes = 0, int? length]) {
-    return NativeInt32List.view(this, offsetInBytes, length);
-  }
-
-  Uint64List asUint64List([int offsetInBytes = 0, int? length]) {
-    throw UnsupportedError("Uint64List not supported by dart2js.");
-  }
-
-  Int64List asInt64List([int offsetInBytes = 0, int? length]) {
-    throw UnsupportedError("Int64List not supported by dart2js.");
-  }
-
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) {
-    var storage =
-        this.asInt32List(offsetInBytes, length != null ? length * 4 : null);
-    return NativeInt32x4List._externalStorage(storage);
-  }
-
-  Float32List asFloat32List([int offsetInBytes = 0, int? length]) {
-    return NativeFloat32List.view(this, offsetInBytes, length);
-  }
-
-  Float64List asFloat64List([int offsetInBytes = 0, int? length]) {
-    return NativeFloat64List.view(this, offsetInBytes, length);
-  }
-
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) {
-    var storage =
-        this.asFloat32List(offsetInBytes, length != null ? length * 4 : null);
-    return NativeFloat32x4List._externalStorage(storage);
-  }
-
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) {
-    var storage =
-        this.asFloat64List(offsetInBytes, length != null ? length * 2 : null);
-    return NativeFloat64x2List._externalStorage(storage);
-  }
-
-  ByteData asByteData([int offsetInBytes = 0, int? length]) {
-    return NativeByteData.view(this, offsetInBytes, length);
-  }
-}
-
-/// A fixed-length list of Float32x4 numbers that is viewable as a
-/// [TypedData]. For long lists, this implementation will be considerably more
-/// space- and time-efficient than the default [List] implementation.
-class NativeFloat32x4List extends Object
-    with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
-    implements Float32x4List {
-  final Float32List _storage;
-
-  /// Creates a [Float32x4List] of the specified length (in elements),
-  /// all of whose elements are initially zero.
-  NativeFloat32x4List(int length) : _storage = NativeFloat32List(length * 4);
-
-  NativeFloat32x4List._externalStorage(this._storage);
-
-  NativeFloat32x4List._slowFromList(List<Float32x4> list)
-      : _storage = NativeFloat32List(list.length * 4) {
-    for (int i = 0; i < list.length; i++) {
-      var e = list[i];
-      _storage[(i * 4) + 0] = e.x;
-      _storage[(i * 4) + 1] = e.y;
-      _storage[(i * 4) + 2] = e.z;
-      _storage[(i * 4) + 3] = e.w;
-    }
-  }
-
-  Type get runtimeType => Float32x4List;
-
-  /// Creates a [Float32x4List] with the same size as the [elements] list
-  /// and copies over the elements.
-  factory NativeFloat32x4List.fromList(List<Float32x4> list) {
-    if (list is NativeFloat32x4List) {
-      return NativeFloat32x4List._externalStorage(
-          NativeFloat32List.fromList(list._storage));
-    } else {
-      return NativeFloat32x4List._slowFromList(list);
-    }
-  }
-
-  ByteBuffer get buffer => _storage.buffer;
-
-  int get lengthInBytes => _storage.lengthInBytes;
-
-  int get offsetInBytes => _storage.offsetInBytes;
-
-  int get elementSizeInBytes => Float32x4List.bytesPerElement;
-
-  int get length => _storage.length ~/ 4;
-
-  Float32x4 operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    double _x = _storage[(index * 4) + 0];
-    double _y = _storage[(index * 4) + 1];
-    double _z = _storage[(index * 4) + 2];
-    double _w = _storage[(index * 4) + 3];
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  void operator []=(int index, Float32x4 value) {
-    _checkValidIndex(index, this, this.length);
-    _storage[(index * 4) + 0] = value.x;
-    _storage[(index * 4) + 1] = value.y;
-    _storage[(index * 4) + 2] = value.z;
-    _storage[(index * 4) + 3] = value.w;
-  }
-
-  Float32x4List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    return NativeFloat32x4List._externalStorage(
-        _storage.sublist(start * 4, stop * 4));
-  }
-}
-
-/// A fixed-length list of Int32x4 numbers that is viewable as a
-/// [TypedData]. For long lists, this implementation will be considerably more
-/// space- and time-efficient than the default [List] implementation.
-class NativeInt32x4List extends Object
-    with ListMixin<Int32x4>, FixedLengthListMixin<Int32x4>
-    implements Int32x4List {
-  final Int32List _storage;
-
-  /// Creates a [Int32x4List] of the specified length (in elements),
-  /// all of whose elements are initially zero.
-  NativeInt32x4List(int length) : _storage = NativeInt32List(length * 4);
-
-  NativeInt32x4List._externalStorage(Int32List storage) : _storage = storage;
-
-  NativeInt32x4List._slowFromList(List<Int32x4> list)
-      : _storage = NativeInt32List(list.length * 4) {
-    for (int i = 0; i < list.length; i++) {
-      var e = list[i];
-      _storage[(i * 4) + 0] = e.x;
-      _storage[(i * 4) + 1] = e.y;
-      _storage[(i * 4) + 2] = e.z;
-      _storage[(i * 4) + 3] = e.w;
-    }
-  }
-
-  Type get runtimeType => Int32x4List;
-
-  /// Creates a [Int32x4List] with the same size as the [elements] list
-  /// and copies over the elements.
-  factory NativeInt32x4List.fromList(List<Int32x4> list) {
-    if (list is NativeInt32x4List) {
-      return NativeInt32x4List._externalStorage(
-          NativeInt32List.fromList(list._storage));
-    } else {
-      return NativeInt32x4List._slowFromList(list);
-    }
-  }
-
-  ByteBuffer get buffer => _storage.buffer;
-
-  int get lengthInBytes => _storage.lengthInBytes;
-
-  int get offsetInBytes => _storage.offsetInBytes;
-
-  int get elementSizeInBytes => Int32x4List.bytesPerElement;
-
-  int get length => _storage.length ~/ 4;
-
-  Int32x4 operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    int _x = _storage[(index * 4) + 0];
-    int _y = _storage[(index * 4) + 1];
-    int _z = _storage[(index * 4) + 2];
-    int _w = _storage[(index * 4) + 3];
-    return NativeInt32x4._truncated(_x, _y, _z, _w);
-  }
-
-  void operator []=(int index, Int32x4 value) {
-    _checkValidIndex(index, this, this.length);
-    _storage[(index * 4) + 0] = value.x;
-    _storage[(index * 4) + 1] = value.y;
-    _storage[(index * 4) + 2] = value.z;
-    _storage[(index * 4) + 3] = value.w;
-  }
-
-  Int32x4List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    return NativeInt32x4List._externalStorage(
-        _storage.sublist(start * 4, stop * 4));
-  }
-}
-
-/// A fixed-length list of Float64x2 numbers that is viewable as a
-/// [TypedData]. For long lists, this implementation will be considerably more
-/// space- and time-efficient than the default [List] implementation.
-class NativeFloat64x2List extends Object
-    with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
-    implements Float64x2List {
-  final Float64List _storage;
-
-  /// Creates a [Float64x2List] of the specified length (in elements),
-  /// all of whose elements are initially zero.
-  NativeFloat64x2List(int length) : _storage = NativeFloat64List(length * 2);
-
-  NativeFloat64x2List._externalStorage(this._storage);
-
-  NativeFloat64x2List._slowFromList(List<Float64x2> list)
-      : _storage = NativeFloat64List(list.length * 2) {
-    for (int i = 0; i < list.length; i++) {
-      var e = list[i];
-      _storage[(i * 2) + 0] = e.x;
-      _storage[(i * 2) + 1] = e.y;
-    }
-  }
-
-  /// Creates a [Float64x2List] with the same size as the [elements] list
-  /// and copies over the elements.
-  factory NativeFloat64x2List.fromList(List<Float64x2> list) {
-    if (list is NativeFloat64x2List) {
-      return NativeFloat64x2List._externalStorage(
-          NativeFloat64List.fromList(list._storage));
-    } else {
-      return NativeFloat64x2List._slowFromList(list);
-    }
-  }
-
-  Type get runtimeType => Float64x2List;
-
-  ByteBuffer get buffer => _storage.buffer;
-
-  int get lengthInBytes => _storage.lengthInBytes;
-
-  int get offsetInBytes => _storage.offsetInBytes;
-
-  int get elementSizeInBytes => Float64x2List.bytesPerElement;
-
-  int get length => _storage.length ~/ 2;
-
-  Float64x2 operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    double _x = _storage[(index * 2) + 0];
-    double _y = _storage[(index * 2) + 1];
-    return Float64x2(_x, _y);
-  }
-
-  void operator []=(int index, Float64x2 value) {
-    _checkValidIndex(index, this, this.length);
-    _storage[(index * 2) + 0] = value.x;
-    _storage[(index * 2) + 1] = value.y;
-  }
-
-  Float64x2List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    return NativeFloat64x2List._externalStorage(
-        _storage.sublist(start * 2, stop * 2));
-  }
-}
-
-@Native('ArrayBufferView')
-class NativeTypedData implements TypedData {
-  /// Returns the byte buffer associated with this object.
-  @Creates('NativeByteBuffer')
-  @Returns('NativeByteBuffer')
-  external ByteBuffer get buffer;
-
-  /// Returns the length of this view, in bytes.
-  @JSName('byteLength')
-  external int get lengthInBytes;
-
-  /// Returns the offset in bytes into the underlying byte buffer of this view.
-  @JSName('byteOffset')
-  external int get offsetInBytes;
-
-  /// Returns the number of bytes in the representation of each element in this
-  /// list.
-  @JSName('BYTES_PER_ELEMENT')
-  external int get elementSizeInBytes;
-
-  void _invalidPosition(int position, int length, String name) {
-    if (position is! int) {
-      throw ArgumentError.value(position, name, 'Invalid list position');
-    } else {
-      throw RangeError.range(position, 0, length, name);
-    }
-  }
-
-  void _checkPosition(int position, int length, String name) {
-    if (JS<bool>('!', '(# >>> 0) !== #', position, position) ||
-        JS<int>('!', '#', position) > length) {
-      // 'int' guaranteed by above test.
-      _invalidPosition(position, length, name);
-    }
-  }
-}
-
-// Validates the unnamed constructor length argument.  Checking is necessary
-// because passing unvalidated values to the native constructors can cause
-// conversions or create views.
-int _checkLength(length) {
-  if (length is! int) throw ArgumentError('Invalid length $length');
-  return length;
-}
-
-// Validates `.view` constructor arguments.  Checking is necessary because
-// passing unvalidated values to the native constructors can cause conversions
-// (e.g. String arguments) or create typed data objects that are not actually
-// views of the input.
-void _checkViewArguments(buffer, offsetInBytes, length) {
-  if (buffer is! NativeByteBuffer) {
-    throw ArgumentError('Invalid view buffer');
-  }
-  if (offsetInBytes is! int) {
-    throw ArgumentError('Invalid view offsetInBytes $offsetInBytes');
-  }
-  if (length is! int?) {
-    throw ArgumentError('Invalid view length $length');
-  }
-}
-
-// Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
-// returns a copy of the list.
-List _ensureNativeList(List list) {
-  if (list is JSIndexable) return list;
-  List result = List.filled(list.length, null);
-  for (int i = 0; i < list.length; i++) {
-    result[i] = list[i];
-  }
-  return result;
-}
-
-@Native('DataView')
-class NativeByteData extends NativeTypedData implements ByteData {
-  /// Creates a [ByteData] of the specified length (in elements), all of
-  /// whose elements are initially zero.
-  factory NativeByteData(int length) => _create1(_checkLength(length));
-
-  /// Creates an [ByteData] _view_ of the specified region in the specified
-  /// byte buffer. Changes in the [ByteData] will be visible in the byte
-  /// buffer and vice versa. If the [offsetInBytes] index of the region is not
-  /// specified, it defaults to zero (the first byte in the byte buffer).
-  /// If the length is not specified, it defaults to null, which indicates
-  /// that the view extends to the end of the byte buffer.
-  ///
-  /// Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-  /// if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-  /// the length of [buffer].
-  factory NativeByteData.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => ByteData;
-
-  int get elementSizeInBytes => 1;
-
-  /// Returns the floating point number represented by the four bytes at
-  /// the specified [byteOffset] in this object, in IEEE 754
-  /// single-precision binary floating-point format (binary32).
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  double getFloat32(int byteOffset, [Endian endian = Endian.big]) =>
-      _getFloat32(byteOffset, Endian.little == endian);
-
-  @JSName('getFloat32')
-  @Returns('double')
-  double _getFloat32(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the floating point number represented by the eight bytes at
-  /// the specified [byteOffset] in this object, in IEEE 754
-  /// double-precision binary floating-point format (binary64).
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  double getFloat64(int byteOffset, [Endian endian = Endian.big]) =>
-      _getFloat64(byteOffset, Endian.little == endian);
-
-  @JSName('getFloat64')
-  @Returns('double')
-  double _getFloat64(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the (possibly negative) integer represented by the two bytes at
-  /// the specified [byteOffset] in this object, in two's complement binary
-  /// form.
-  /// The return value will be between 2<sup>15</sup> and 2<sup>15</sup> - 1,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  int getInt16(int byteOffset, [Endian endian = Endian.big]) =>
-      _getInt16(byteOffset, Endian.little == endian);
-
-  @JSName('getInt16')
-  @Returns('int')
-  int _getInt16(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the (possibly negative) integer represented by the four bytes at
-  /// the specified [byteOffset] in this object, in two's complement binary
-  /// form.
-  /// The return value will be between 2<sup>31</sup> and 2<sup>31</sup> - 1,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  int getInt32(int byteOffset, [Endian endian = Endian.big]) =>
-      _getInt32(byteOffset, Endian.little == endian);
-
-  @JSName('getInt32')
-  @Returns('int')
-  int _getInt32(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the (possibly negative) integer represented by the eight bytes at
-  /// the specified [byteOffset] in this object, in two's complement binary
-  /// form.
-  /// The return value will be between 2<sup>63</sup> and 2<sup>63</sup> - 1,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  int getInt64(int byteOffset, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Int64 accessor not supported by dart2js.');
-  }
-
-  /// Returns the (possibly negative) integer represented by the byte at the
-  /// specified [byteOffset] in this object, in two's complement binary
-  /// representation. The return value will be between -128 and 127, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// greater than or equal to the length of this object.
-  int getInt8(int byteOffset) native;
-
-  /// Returns the positive integer represented by the two bytes starting
-  /// at the specified [byteOffset] in this object, in unsigned binary
-  /// form.
-  /// The return value will be between 0 and  2<sup>16</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  int getUint16(int byteOffset, [Endian endian = Endian.big]) =>
-      _getUint16(byteOffset, Endian.little == endian);
-
-  @JSName('getUint16')
-  @Returns('int')
-  int _getUint16(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the positive integer represented by the four bytes starting
-  /// at the specified [byteOffset] in this object, in unsigned binary
-  /// form.
-  /// The return value will be between 0 and  2<sup>32</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  int getUint32(int byteOffset, [Endian endian = Endian.big]) =>
-      _getUint32(byteOffset, Endian.little == endian);
-
-  @JSName('getUint32')
-  @Returns('int')
-  int _getUint32(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the positive integer represented by the eight bytes starting
-  /// at the specified [byteOffset] in this object, in unsigned binary
-  /// form.
-  /// The return value will be between 0 and  2<sup>64</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  int getUint64(int byteOffset, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Uint64 accessor not supported by dart2js.');
-  }
-
-  /// Returns the positive integer represented by the byte at the specified
-  /// [byteOffset] in this object, in unsigned binary form. The
-  /// return value will be between 0 and 255, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// greater than or equal to the length of this object.
-  int getUint8(int byteOffset) native;
-
-  /// Sets the four bytes starting at the specified [byteOffset] in this
-  /// object to the IEEE 754 single-precision binary floating-point
-  /// (binary32) representation of the specified [value].
-  ///
-  /// **Note that this method can lose precision.** The input [value] is
-  /// a 64-bit floating point value, which will be converted to 32-bit
-  /// floating point value by IEEE 754 rounding rules before it is stored.
-  /// If [value] cannot be represented exactly as a binary32, it will be
-  /// converted to the nearest binary32 value.  If two binary32 values are
-  /// equally close, the one whose least significant bit is zero will be used.
-  /// Note that finite (but large) values can be converted to infinity, and
-  /// small non-zero values can be converted to zero.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  void setFloat32(int byteOffset, num value, [Endian endian = Endian.big]) =>
-      _setFloat32(byteOffset, value, Endian.little == endian);
-
-  @JSName('setFloat32')
-  void _setFloat32(int byteOffset, num value, [bool? littleEndian]) native;
-
-  /// Sets the eight bytes starting at the specified [byteOffset] in this
-  /// object to the IEEE 754 double-precision binary floating-point
-  /// (binary64) representation of the specified [value].
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  void setFloat64(int byteOffset, num value, [Endian endian = Endian.big]) =>
-      _setFloat64(byteOffset, value, Endian.little == endian);
-
-  @JSName('setFloat64')
-  void _setFloat64(int byteOffset, num value, [bool? littleEndian]) native;
-
-  /// Sets the two bytes starting at the specified [byteOffset] in this
-  /// object to the two's complement binary representation of the specified
-  /// [value], which must fit in two bytes. In other words, [value] must lie
-  /// between 2<sup>15</sup> and 2<sup>15</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  void setInt16(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setInt16(byteOffset, value, Endian.little == endian);
-
-  @JSName('setInt16')
-  void _setInt16(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the four bytes starting at the specified [byteOffset] in this
-  /// object to the two's complement binary representation of the specified
-  /// [value], which must fit in four bytes. In other words, [value] must lie
-  /// between 2<sup>31</sup> and 2<sup>31</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  void setInt32(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setInt32(byteOffset, value, Endian.little == endian);
-
-  @JSName('setInt32')
-  void _setInt32(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the eight bytes starting at the specified [byteOffset] in this
-  /// object to the two's complement binary representation of the specified
-  /// [value], which must fit in eight bytes. In other words, [value] must lie
-  /// between 2<sup>63</sup> and 2<sup>63</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  void setInt64(int byteOffset, int value, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Int64 accessor not supported by dart2js.');
-  }
-
-  /// Sets the byte at the specified [byteOffset] in this object to the
-  /// two's complement binary representation of the specified [value], which
-  /// must fit in a single byte. In other words, [value] must be between
-  /// -128 and 127, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// greater than or equal to the length of this object.
-  void setInt8(int byteOffset, int value) native;
-
-  /// Sets the two bytes starting at the specified [byteOffset] in this object
-  /// to the unsigned binary representation of the specified [value],
-  /// which must fit in two bytes. in other words, [value] must be between
-  /// 0 and 2<sup>16</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  void setUint16(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setUint16(byteOffset, value, Endian.little == endian);
-
-  @JSName('setUint16')
-  void _setUint16(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the four bytes starting at the specified [byteOffset] in this object
-  /// to the unsigned binary representation of the specified [value],
-  /// which must fit in four bytes. in other words, [value] must be between
-  /// 0 and 2<sup>32</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  void setUint32(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setUint32(byteOffset, value, Endian.little == endian);
-
-  @JSName('setUint32')
-  void _setUint32(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the eight bytes starting at the specified [byteOffset] in this object
-  /// to the unsigned binary representation of the specified [value],
-  /// which must fit in eight bytes. in other words, [value] must be between
-  /// 0 and 2<sup>64</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  void setUint64(int byteOffset, int value, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Uint64 accessor not supported by dart2js.');
-  }
-
-  /// Sets the byte at the specified [byteOffset] in this object to the
-  /// unsigned binary representation of the specified [value], which must fit
-  /// in a single byte. in other words, [value] must be between 0 and 255,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative,
-  /// or greater than or equal to the length of this object.
-  void setUint8(int byteOffset, int value) native;
-
-  static NativeByteData _create1(arg) =>
-      JS('NativeByteData', 'new DataView(new ArrayBuffer(#))', arg);
-
-  static NativeByteData _create2(arg1, arg2) =>
-      JS('NativeByteData', 'new DataView(#, #)', arg1, arg2);
-
-  static NativeByteData _create3(arg1, arg2, arg3) =>
-      JS('NativeByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
-}
-
-abstract class NativeTypedArray extends NativeTypedData
-    implements JavaScriptIndexingBehavior {
-  int get length;
-
-  void _setRangeFast(
-      int start, int end, NativeTypedArray source, int skipCount) {
-    int targetLength = this.length;
-    _checkPosition(start, targetLength, "start");
-    _checkPosition(end, targetLength, "end");
-    if (start > end) throw RangeError.range(start, 0, end);
-    int count = end - start;
-
-    if (skipCount < 0) throw ArgumentError(skipCount);
-
-    int sourceLength = source.length;
-    if (sourceLength - skipCount < count) {
-      throw StateError('Not enough elements');
-    }
-
-    if (skipCount != 0 || sourceLength != count) {
-      // Create a view of the exact subrange that is copied from the source.
-      source = JS('', '#.subarray(#, #)', source, skipCount, skipCount + count);
-    }
-    JS('void', '#.set(#, #)', this, source, start);
-  }
-}
-
-abstract class NativeTypedArrayOfDouble extends NativeTypedArray
-    with ListMixin<double>, FixedLengthListMixin<double> {
-  int get length => JS<int>('!', '#.length', this);
-
-  double operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<double>('!', '#[#]', this, index);
-  }
-
-  void operator []=(int index, num value) {
-    _checkValidIndex(index, this, this.length);
-    JS('void', '#[#] = #', this, index, value);
-  }
-
-  void setRange(int start, int end, Iterable<double> iterable,
-      [int skipCount = 0]) {
-    if (iterable is NativeTypedArrayOfDouble) {
-      _setRangeFast(start, end, iterable, skipCount);
-      return;
-    }
-    super.setRange(start, end, iterable, skipCount);
-  }
-}
-
-abstract class NativeTypedArrayOfInt extends NativeTypedArray
-    with ListMixin<int>, FixedLengthListMixin<int>
-    implements List<int> {
-  int get length => JS<int>('!', '#.length', this);
-
-  // operator[]() is not here since different versions have different return
-  // types
-
-  void operator []=(int index, int value) {
-    _checkValidIndex(index, this, this.length);
-    JS('void', '#[#] = #', this, index, value);
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable,
-      [int skipCount = 0]) {
-    if (iterable is NativeTypedArrayOfInt) {
-      _setRangeFast(start, end, iterable, skipCount);
-      return;
-    }
-    super.setRange(start, end, iterable, skipCount);
-  }
-}
-
-@Native('Float32Array')
-class NativeFloat32List extends NativeTypedArrayOfDouble
-    implements Float32List {
-  factory NativeFloat32List(int length) => _create1(_checkLength(length));
-
-  factory NativeFloat32List.fromList(List<double> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeFloat32List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Float32List;
-
-  Float32List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS<NativeFloat32List>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeFloat32List _create1(arg) =>
-      JS<NativeFloat32List>('!', 'new Float32Array(#)', arg);
-
-  static NativeFloat32List _create2(arg1, arg2) =>
-      JS<NativeFloat32List>('!', 'new Float32Array(#, #)', arg1, arg2);
-
-  static NativeFloat32List _create3(arg1, arg2, arg3) =>
-      JS<NativeFloat32List>('!', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Float64Array')
-class NativeFloat64List extends NativeTypedArrayOfDouble
-    implements Float64List {
-  factory NativeFloat64List(int length) => _create1(_checkLength(length));
-
-  factory NativeFloat64List.fromList(List<double> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeFloat64List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Float64List;
-
-  Float64List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeFloat64List _create1(arg) =>
-      JS('NativeFloat64List', 'new Float64Array(#)', arg);
-
-  static NativeFloat64List _create2(arg1, arg2) =>
-      JS('NativeFloat64List', 'new Float64Array(#, #)', arg1, arg2);
-
-  static NativeFloat64List _create3(arg1, arg2, arg3) =>
-      JS('NativeFloat64List', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Int16Array')
-class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
-  factory NativeInt16List(int length) => _create1(_checkLength(length));
-
-  factory NativeInt16List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeInt16List.view(
-      NativeByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Int16List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Int16List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeInt16List _create1(arg) =>
-      JS('NativeInt16List', 'new Int16Array(#)', arg);
-
-  static NativeInt16List _create2(arg1, arg2) =>
-      JS('NativeInt16List', 'new Int16Array(#, #)', arg1, arg2);
-
-  static NativeInt16List _create3(arg1, arg2, arg3) =>
-      JS('NativeInt16List', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Int32Array')
-class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
-  factory NativeInt32List(int length) => _create1(_checkLength(length));
-
-  factory NativeInt32List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeInt32List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Int32List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Int32List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS<NativeInt32List>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeInt32List _create1(arg) =>
-      JS<NativeInt32List>('!', 'new Int32Array(#)', arg);
-
-  static NativeInt32List _create2(arg1, arg2) =>
-      JS<NativeInt32List>('!', 'new Int32Array(#, #)', arg1, arg2);
-
-  static NativeInt32List _create3(arg1, arg2, arg3) =>
-      JS<NativeInt32List>('!', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Int8Array')
-class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
-  factory NativeInt8List(int length) => _create1(_checkLength(length));
-
-  factory NativeInt8List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeInt8List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Int8List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Int8List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS<NativeInt8List>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeInt8List _create1(arg) =>
-      JS<NativeInt8List>('!', 'new Int8Array(#)', arg);
-
-  static NativeInt8List _create2(arg1, arg2) =>
-      JS<NativeInt8List>('!', 'new Int8Array(#, #)', arg1, arg2);
-
-  static NativeInt8List _create3(arg1, arg2, arg3) =>
-      JS<NativeInt8List>('!', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Uint16Array')
-class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
-  factory NativeUint16List(int length) => _create1(_checkLength(length));
-
-  factory NativeUint16List.fromList(List<int> list) =>
-      _create1(_ensureNativeList(list));
-
-  factory NativeUint16List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint16List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Uint16List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS<NativeUint16List>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint16List _create1(arg) =>
-      JS<NativeUint16List>('!', 'new Uint16Array(#)', arg);
-
-  static NativeUint16List _create2(arg1, arg2) =>
-      JS<NativeUint16List>('!', 'new Uint16Array(#, #)', arg1, arg2);
-
-  static NativeUint16List _create3(arg1, arg2, arg3) =>
-      JS<NativeUint16List>('!', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Uint32Array')
-class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
-  factory NativeUint32List(int length) => _create1(_checkLength(length));
-
-  factory NativeUint32List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeUint32List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint32List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Uint32List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS<NativeUint32List>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint32List _create1(arg) =>
-      JS<NativeUint32List>('!', 'new Uint32Array(#)', arg);
-
-  static NativeUint32List _create2(arg1, arg2) =>
-      JS<NativeUint32List>('!', 'new Uint32Array(#, #)', arg1, arg2);
-
-  static NativeUint32List _create3(arg1, arg2, arg3) =>
-      JS<NativeUint32List>('!', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Uint8ClampedArray,CanvasPixelArray')
-class NativeUint8ClampedList extends NativeTypedArrayOfInt
-    implements Uint8ClampedList {
-  factory NativeUint8ClampedList(int length) => _create1(_checkLength(length));
-
-  factory NativeUint8ClampedList.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeUint8ClampedList.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint8ClampedList;
-
-  int get length => JS<int>('!', '#.length', this);
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Uint8ClampedList sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS<NativeUint8ClampedList>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint8ClampedList _create1(arg) =>
-      JS<NativeUint8ClampedList>('!', 'new Uint8ClampedArray(#)', arg);
-
-  static NativeUint8ClampedList _create2(arg1, arg2) =>
-      JS<NativeUint8ClampedList>(
-          '!', 'new Uint8ClampedArray(#, #)', arg1, arg2);
-
-  static NativeUint8ClampedList _create3(arg1, arg2, arg3) => JS(
-      'NativeUint8ClampedList',
-      'new Uint8ClampedArray(#, #, #)',
-      arg1,
-      arg2,
-      arg3);
-}
-
-// On some browsers Uint8ClampedArray is a subtype of Uint8Array.  Marking
-// Uint8List as !nonleaf ensures that the native dispatch correctly handles
-// the potential for Uint8ClampedArray to 'accidentally' pick up the
-// dispatch record for Uint8List.
-@Native('Uint8Array,!nonleaf')
-class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
-  factory NativeUint8List(int length) => _create1(_checkLength(length));
-
-  factory NativeUint8List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeUint8List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint8List;
-
-  int get length => JS<int>('!', '#.length', this);
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS<int>('!', '#[#]', this, index);
-  }
-
-  Uint8List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS<NativeUint8List>('!', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint8List _create1(arg) =>
-      JS<NativeUint8List>('!', 'new Uint8Array(#)', arg);
-
-  static NativeUint8List _create2(arg1, arg2) =>
-      JS<NativeUint8List>('!', 'new Uint8Array(#, #)', arg1, arg2);
-
-  static NativeUint8List _create3(arg1, arg2, arg3) =>
-      JS<NativeUint8List>('!', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
-}
-
-/// Implementation of Dart Float32x4 immutable value type and operations.
-/// Float32x4 stores 4 32-bit floating point values in "lanes".
-/// The lanes are "x", "y", "z", and "w" respectively.
-class NativeFloat32x4 implements Float32x4 {
-  final double x;
-  final double y;
-  final double z;
-  final double w;
-
-  static final NativeFloat32List _list = NativeFloat32List(4);
-  static final Uint32List _uint32view = _list.buffer.asUint32List();
-
-  static _truncate(x) {
-    _list[0] = x;
-    return _list[0];
-  }
-
-  NativeFloat32x4(double x, double y, double z, double w)
-      : this.x = _truncate(x),
-        this.y = _truncate(y),
-        this.z = _truncate(z),
-        this.w = _truncate(w) {
-    // We would prefer to check for `double` but in dart2js we can't see the
-    // difference anyway.
-    if (x is! num) throw ArgumentError(x);
-    if (y is! num) throw ArgumentError(y);
-    if (z is! num) throw ArgumentError(z);
-    if (w is! num) throw ArgumentError(w);
-  }
-
-  NativeFloat32x4.splat(double v) : this(v, v, v, v);
-  NativeFloat32x4.zero() : this._truncated(0.0, 0.0, 0.0, 0.0);
-
-  /// Returns a bit-wise copy of [i] as a Float32x4.
-  factory NativeFloat32x4.fromInt32x4Bits(Int32x4 i) {
-    _uint32view[0] = i.x;
-    _uint32view[1] = i.y;
-    _uint32view[2] = i.z;
-    _uint32view[3] = i.w;
-    return NativeFloat32x4._truncated(_list[0], _list[1], _list[2], _list[3]);
-  }
-
-  NativeFloat32x4.fromFloat64x2(Float64x2 v)
-      : this._truncated(_truncate(v.x), _truncate(v.y), 0.0, 0.0);
-
-  /// Creates a new NativeFloat32x4.
-  ///
-  /// Does not verify if the given arguments are non-null.
-  NativeFloat32x4._doubles(double x, double y, double z, double w)
-      : this.x = _truncate(x),
-        this.y = _truncate(y),
-        this.z = _truncate(z),
-        this.w = _truncate(w);
-
-  /// Creates a new NativeFloat32x4.
-  ///
-  /// The constructor does not truncate the arguments. They must already be in
-  /// the correct range. It does not verify the type of the given arguments,
-  /// either.
-  NativeFloat32x4._truncated(this.x, this.y, this.z, this.w);
-
-  String toString() {
-    return '[$x, $y, $z, $w]';
-  }
-
-  /// Addition operator.
-  Float32x4 operator +(Float32x4 other) {
-    double _x = x + other.x;
-    double _y = y + other.y;
-    double _z = z + other.z;
-    double _w = w + other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Negate operator.
-  Float32x4 operator -() {
-    return NativeFloat32x4._truncated(-x, -y, -z, -w);
-  }
-
-  /// Subtraction operator.
-  Float32x4 operator -(Float32x4 other) {
-    double _x = x - other.x;
-    double _y = y - other.y;
-    double _z = z - other.z;
-    double _w = w - other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Multiplication operator.
-  Float32x4 operator *(Float32x4 other) {
-    double _x = x * other.x;
-    double _y = y * other.y;
-    double _z = z * other.z;
-    double _w = w * other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Division operator.
-  Float32x4 operator /(Float32x4 other) {
-    double _x = x / other.x;
-    double _y = y / other.y;
-    double _z = z / other.z;
-    double _w = w / other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Relational less than.
-  Int32x4 lessThan(Float32x4 other) {
-    bool _cx = x < other.x;
-    bool _cy = y < other.y;
-    bool _cz = z < other.z;
-    bool _cw = w < other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational less than or equal.
-  Int32x4 lessThanOrEqual(Float32x4 other) {
-    bool _cx = x <= other.x;
-    bool _cy = y <= other.y;
-    bool _cz = z <= other.z;
-    bool _cw = w <= other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational greater than.
-  Int32x4 greaterThan(Float32x4 other) {
-    bool _cx = x > other.x;
-    bool _cy = y > other.y;
-    bool _cz = z > other.z;
-    bool _cw = w > other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational greater than or equal.
-  Int32x4 greaterThanOrEqual(Float32x4 other) {
-    bool _cx = x >= other.x;
-    bool _cy = y >= other.y;
-    bool _cz = z >= other.z;
-    bool _cw = w >= other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational equal.
-  Int32x4 equal(Float32x4 other) {
-    bool _cx = x == other.x;
-    bool _cy = y == other.y;
-    bool _cz = z == other.z;
-    bool _cw = w == other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational not-equal.
-  Int32x4 notEqual(Float32x4 other) {
-    bool _cx = x != other.x;
-    bool _cy = y != other.y;
-    bool _cz = z != other.z;
-    bool _cw = w != other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Returns a copy of [this] each lane being scaled by [s].
-  Float32x4 scale(double s) {
-    double _x = s * x;
-    double _y = s * y;
-    double _z = s * z;
-    double _w = s * w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Returns the absolute value of this [Float32x4].
-  Float32x4 abs() {
-    double _x = x.abs();
-    double _y = y.abs();
-    double _z = z.abs();
-    double _w = w.abs();
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Clamps [this] to be in the range [lowerLimit]-[upperLimit].
-  Float32x4 clamp(Float32x4 lowerLimit, Float32x4 upperLimit) {
-    double _lx = lowerLimit.x;
-    double _ly = lowerLimit.y;
-    double _lz = lowerLimit.z;
-    double _lw = lowerLimit.w;
-    double _ux = upperLimit.x;
-    double _uy = upperLimit.y;
-    double _uz = upperLimit.z;
-    double _uw = upperLimit.w;
-    double _x = x;
-    double _y = y;
-    double _z = z;
-    double _w = w;
-    // MAX(MIN(self, upper), lower).
-    _x = _x > _ux ? _ux : _x;
-    _y = _y > _uy ? _uy : _y;
-    _z = _z > _uz ? _uz : _z;
-    _w = _w > _uw ? _uw : _w;
-    _x = _x < _lx ? _lx : _x;
-    _y = _y < _ly ? _ly : _y;
-    _z = _z < _lz ? _lz : _z;
-    _w = _w < _lw ? _lw : _w;
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Extract the sign bit from each lane return them in the first 4 bits.
-  int get signMask {
-    var view = _uint32view;
-    var mx, my, mz, mw;
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    // This is correct because dart2js uses the unsigned right shift.
-    mx = (view[0] & 0x80000000) >> 31;
-    my = (view[1] & 0x80000000) >> 30;
-    mz = (view[2] & 0x80000000) >> 29;
-    mw = (view[3] & 0x80000000) >> 28;
-    return mx | my | mz | mw;
-  }
-
-  /// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
-  Float32x4 shuffle(int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, "mask");
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-
-    double _x = _list[mask & 0x3];
-    double _y = _list[(mask >> 2) & 0x3];
-    double _z = _list[(mask >> 4) & 0x3];
-    double _w = _list[(mask >> 6) & 0x3];
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Shuffle the lane values in [this] and [other]. The returned
-  /// Float32x4 will have XY lanes from [this] and ZW lanes from [other].
-  /// Uses the same [mask] as [shuffle].
-  Float32x4 shuffleMix(Float32x4 other, int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, "mask");
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    double _x = _list[mask & 0x3];
-    double _y = _list[(mask >> 2) & 0x3];
-
-    _list[0] = other.x;
-    _list[1] = other.y;
-    _list[2] = other.z;
-    _list[3] = other.w;
-    double _z = _list[(mask >> 4) & 0x3];
-    double _w = _list[(mask >> 6) & 0x3];
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Copy [this] and replace the [x] lane.
-  Float32x4 withX(double newX) {
-    return NativeFloat32x4._truncated(_truncate(newX), y, z, w);
-  }
-
-  /// Copy [this] and replace the [y] lane.
-  Float32x4 withY(double newY) {
-    return NativeFloat32x4._truncated(x, _truncate(newY), z, w);
-  }
-
-  /// Copy [this] and replace the [z] lane.
-  Float32x4 withZ(double newZ) {
-    return NativeFloat32x4._truncated(x, y, _truncate(newZ), w);
-  }
-
-  /// Copy [this] and replace the [w] lane.
-  Float32x4 withW(double newW) {
-    return NativeFloat32x4._truncated(x, y, z, _truncate(newW));
-  }
-
-  /// Returns the lane-wise minimum value in [this] or [other].
-  Float32x4 min(Float32x4 other) {
-    double _x = x < other.x ? x : other.x;
-    double _y = y < other.y ? y : other.y;
-    double _z = z < other.z ? z : other.z;
-    double _w = w < other.w ? w : other.w;
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Returns the lane-wise maximum value in [this] or [other].
-  Float32x4 max(Float32x4 other) {
-    double _x = x > other.x ? x : other.x;
-    double _y = y > other.y ? y : other.y;
-    double _z = z > other.z ? z : other.z;
-    double _w = w > other.w ? w : other.w;
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Returns the square root of [this].
-  Float32x4 sqrt() {
-    double _x = Math.sqrt(x);
-    double _y = Math.sqrt(y);
-    double _z = Math.sqrt(z);
-    double _w = Math.sqrt(w);
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Returns the reciprocal of [this].
-  Float32x4 reciprocal() {
-    double _x = 1.0 / x;
-    double _y = 1.0 / y;
-    double _z = 1.0 / z;
-    double _w = 1.0 / w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Returns the square root of the reciprocal of [this].
-  Float32x4 reciprocalSqrt() {
-    double _x = Math.sqrt(1.0 / x);
-    double _y = Math.sqrt(1.0 / y);
-    double _z = Math.sqrt(1.0 / z);
-    double _w = Math.sqrt(1.0 / w);
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-}
-
-/// Interface of Dart Int32x4 and operations.
-/// Int32x4 stores 4 32-bit bit-masks in "lanes".
-/// The lanes are "x", "y", "z", and "w" respectively.
-class NativeInt32x4 implements Int32x4 {
-  final int x;
-  final int y;
-  final int z;
-  final int w;
-
-  static final _list = NativeInt32List(4);
-
-  static _truncate(x) {
-    _list[0] = x;
-    return _list[0];
-  }
-
-  NativeInt32x4(int x, int y, int z, int w)
-      : this.x = _truncate(x),
-        this.y = _truncate(y),
-        this.z = _truncate(z),
-        this.w = _truncate(w) {
-    if (x != this.x && x is! int) throw ArgumentError(x);
-    if (y != this.y && y is! int) throw ArgumentError(y);
-    if (z != this.z && z is! int) throw ArgumentError(z);
-    if (w != this.w && w is! int) throw ArgumentError(w);
-  }
-
-  NativeInt32x4.bool(bool x, bool y, bool z, bool w)
-      : this.x = x ? -1 : 0,
-        this.y = y ? -1 : 0,
-        this.z = z ? -1 : 0,
-        this.w = w ? -1 : 0;
-
-  /// Returns a bit-wise copy of [f] as a Int32x4.
-  factory NativeInt32x4.fromFloat32x4Bits(Float32x4 f) {
-    NativeFloat32List floatList = NativeFloat32x4._list;
-    floatList[0] = f.x;
-    floatList[1] = f.y;
-    floatList[2] = f.z;
-    floatList[3] = f.w;
-    Int32List view = floatList.buffer.asInt32List();
-    return NativeInt32x4._truncated(view[0], view[1], view[2], view[3]);
-  }
-
-  NativeInt32x4._truncated(this.x, this.y, this.z, this.w);
-
-  String toString() => '[$x, $y, $z, $w]';
-
-  /// The bit-wise or operator.
-  Int32x4 operator |(Int32x4 other) {
-    // Dart2js uses unsigned results for bit-operations.
-    // We use "JS" to fall back to the signed versions.
-    return NativeInt32x4._truncated(
-        JS("int", "# | #", x, other.x),
-        JS("int", "# | #", y, other.y),
-        JS("int", "# | #", z, other.z),
-        JS("int", "# | #", w, other.w));
-  }
-
-  /// The bit-wise and operator.
-  Int32x4 operator &(Int32x4 other) {
-    // Dart2js uses unsigned results for bit-operations.
-    // We use "JS" to fall back to the signed versions.
-    return NativeInt32x4._truncated(
-        JS("int", "# & #", x, other.x),
-        JS("int", "# & #", y, other.y),
-        JS("int", "# & #", z, other.z),
-        JS("int", "# & #", w, other.w));
-  }
-
-  /// The bit-wise xor operator.
-  Int32x4 operator ^(Int32x4 other) {
-    // Dart2js uses unsigned results for bit-operations.
-    // We use "JS" to fall back to the signed versions.
-    return NativeInt32x4._truncated(
-        JS("int", "# ^ #", x, other.x),
-        JS("int", "# ^ #", y, other.y),
-        JS("int", "# ^ #", z, other.z),
-        JS("int", "# ^ #", w, other.w));
-  }
-
-  Int32x4 operator +(Int32x4 other) {
-    // Avoid going through the typed array by "| 0" the result.
-    return NativeInt32x4._truncated(
-        JS("int", "(# + #) | 0", x, other.x),
-        JS("int", "(# + #) | 0", y, other.y),
-        JS("int", "(# + #) | 0", z, other.z),
-        JS("int", "(# + #) | 0", w, other.w));
-  }
-
-  Int32x4 operator -(Int32x4 other) {
-    // Avoid going through the typed array by "| 0" the result.
-    return NativeInt32x4._truncated(
-        JS("int", "(# - #) | 0", x, other.x),
-        JS("int", "(# - #) | 0", y, other.y),
-        JS("int", "(# - #) | 0", z, other.z),
-        JS("int", "(# - #) | 0", w, other.w));
-  }
-
-  Int32x4 operator -() {
-    // Avoid going through the typed array by "| 0" the result.
-    return NativeInt32x4._truncated(
-        JS("int", "(-#) | 0", x),
-        JS("int", "(-#) | 0", y),
-        JS("int", "(-#) | 0", z),
-        JS("int", "(-#) | 0", w));
-  }
-
-  /// Extract the top bit from each lane return them in the first 4 bits.
-  int get signMask {
-    int mx = (x & 0x80000000) >> 31;
-    int my = (y & 0x80000000) >> 31;
-    int mz = (z & 0x80000000) >> 31;
-    int mw = (w & 0x80000000) >> 31;
-    return mx | my << 1 | mz << 2 | mw << 3;
-  }
-
-  /// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
-  Int32x4 shuffle(int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, "mask");
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    int _x = _list[mask & 0x3];
-    int _y = _list[(mask >> 2) & 0x3];
-    int _z = _list[(mask >> 4) & 0x3];
-    int _w = _list[(mask >> 6) & 0x3];
-    return NativeInt32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Shuffle the lane values in [this] and [other]. The returned
-  /// Int32x4 will have XY lanes from [this] and ZW lanes from [other].
-  /// Uses the same [mask] as [shuffle].
-  Int32x4 shuffleMix(Int32x4 other, int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, "mask");
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    int _x = _list[mask & 0x3];
-    int _y = _list[(mask >> 2) & 0x3];
-
-    _list[0] = other.x;
-    _list[1] = other.y;
-    _list[2] = other.z;
-    _list[3] = other.w;
-    int _z = _list[(mask >> 4) & 0x3];
-    int _w = _list[(mask >> 6) & 0x3];
-    return NativeInt32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new x value.
-  Int32x4 withX(int x) {
-    int _x = _truncate(x);
-    return NativeInt32x4._truncated(_x, y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new y value.
-  Int32x4 withY(int y) {
-    int _y = _truncate(y);
-    return NativeInt32x4._truncated(x, _y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new z value.
-  Int32x4 withZ(int z) {
-    int _z = _truncate(z);
-    return NativeInt32x4._truncated(x, y, _z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new w value.
-  Int32x4 withW(int w) {
-    int _w = _truncate(w);
-    return NativeInt32x4._truncated(x, y, z, _w);
-  }
-
-  /// Extracted x value. Returns `false` for 0, `true` for any other value.
-  bool get flagX => x != 0;
-
-  /// Extracted y value. Returns `false` for 0, `true` for any other value.
-  bool get flagY => y != 0;
-
-  /// Extracted z value. Returns `false` for 0, `true` for any other value.
-  bool get flagZ => z != 0;
-
-  /// Extracted w value. Returns `false` for 0, `true` for any other value.
-  bool get flagW => w != 0;
-
-  /// Returns a new [Int32x4] copied from [this] with a new x value.
-  Int32x4 withFlagX(bool flagX) {
-    int _x = flagX ? -1 : 0;
-    return NativeInt32x4._truncated(_x, y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new y value.
-  Int32x4 withFlagY(bool flagY) {
-    int _y = flagY ? -1 : 0;
-    return NativeInt32x4._truncated(x, _y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new z value.
-  Int32x4 withFlagZ(bool flagZ) {
-    int _z = flagZ ? -1 : 0;
-    return NativeInt32x4._truncated(x, y, _z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new w value.
-  Int32x4 withFlagW(bool flagW) {
-    int _w = flagW ? -1 : 0;
-    return NativeInt32x4._truncated(x, y, z, _w);
-  }
-
-  /// Merge [trueValue] and [falseValue] based on [this]' bit mask:
-  /// Select bit from [trueValue] when bit in [this] is on.
-  /// Select bit from [falseValue] when bit in [this] is off.
-  Float32x4 select(Float32x4 trueValue, Float32x4 falseValue) {
-    var floatList = NativeFloat32x4._list;
-    var intView = NativeFloat32x4._uint32view;
-
-    floatList[0] = trueValue.x;
-    floatList[1] = trueValue.y;
-    floatList[2] = trueValue.z;
-    floatList[3] = trueValue.w;
-    int stx = intView[0];
-    int sty = intView[1];
-    int stz = intView[2];
-    int stw = intView[3];
-
-    floatList[0] = falseValue.x;
-    floatList[1] = falseValue.y;
-    floatList[2] = falseValue.z;
-    floatList[3] = falseValue.w;
-    int sfx = intView[0];
-    int sfy = intView[1];
-    int sfz = intView[2];
-    int sfw = intView[3];
-    int _x = (x & stx) | (~x & sfx);
-    int _y = (y & sty) | (~y & sfy);
-    int _z = (z & stz) | (~z & sfz);
-    int _w = (w & stw) | (~w & sfw);
-    intView[0] = _x;
-    intView[1] = _y;
-    intView[2] = _z;
-    intView[3] = _w;
-    return NativeFloat32x4._truncated(
-        floatList[0], floatList[1], floatList[2], floatList[3]);
-  }
-}
-
-class NativeFloat64x2 implements Float64x2 {
-  final double x;
-  final double y;
-
-  static NativeFloat64List _list = NativeFloat64List(2);
-  static Uint32List _uint32View = _list.buffer.asUint32List();
-
-  NativeFloat64x2(this.x, this.y) {
-    if (x is! num) throw ArgumentError(x);
-    if (y is! num) throw ArgumentError(y);
-  }
-
-  NativeFloat64x2.splat(double v) : this(v, v);
-
-  NativeFloat64x2.zero() : this.splat(0.0);
-
-  NativeFloat64x2.fromFloat32x4(Float32x4 v) : this(v.x, v.y);
-
-  /// Arguments [x] and [y] must be doubles.
-  NativeFloat64x2._doubles(this.x, this.y);
-
-  String toString() => '[$x, $y]';
-
-  /// Addition operator.
-  Float64x2 operator +(Float64x2 other) {
-    return NativeFloat64x2._doubles(x + other.x, y + other.y);
-  }
-
-  /// Negate operator.
-  Float64x2 operator -() {
-    return NativeFloat64x2._doubles(-x, -y);
-  }
-
-  /// Subtraction operator.
-  Float64x2 operator -(Float64x2 other) {
-    return NativeFloat64x2._doubles(x - other.x, y - other.y);
-  }
-
-  /// Multiplication operator.
-  Float64x2 operator *(Float64x2 other) {
-    return NativeFloat64x2._doubles(x * other.x, y * other.y);
-  }
-
-  /// Division operator.
-  Float64x2 operator /(Float64x2 other) {
-    return NativeFloat64x2._doubles(x / other.x, y / other.y);
-  }
-
-  /// Returns a copy of [this] each lane being scaled by [s].
-  Float64x2 scale(double s) {
-    return NativeFloat64x2._doubles(x * s, y * s);
-  }
-
-  /// Returns the absolute value of this [Float64x2].
-  Float64x2 abs() {
-    return NativeFloat64x2._doubles(x.abs(), y.abs());
-  }
-
-  /// Clamps [this] to be in the range [lowerLimit]-[upperLimit].
-  Float64x2 clamp(Float64x2 lowerLimit, Float64x2 upperLimit) {
-    double _lx = lowerLimit.x;
-    double _ly = lowerLimit.y;
-    double _ux = upperLimit.x;
-    double _uy = upperLimit.y;
-    double _x = x;
-    double _y = y;
-    // MAX(MIN(self, upper), lower).
-    _x = _x > _ux ? _ux : _x;
-    _y = _y > _uy ? _uy : _y;
-    _x = _x < _lx ? _lx : _x;
-    _y = _y < _ly ? _ly : _y;
-    return NativeFloat64x2._doubles(_x, _y);
-  }
-
-  /// Extract the sign bits from each lane return them in the first 2 bits.
-  int get signMask {
-    var view = _uint32View;
-    _list[0] = x;
-    _list[1] = y;
-    var mx = (view[1] & 0x80000000) >> 31;
-    var my = (view[3] & 0x80000000) >> 31;
-    return mx | my << 1;
-  }
-
-  /// Returns a new [Float64x2] copied from [this] with a new x value.
-  Float64x2 withX(double x) {
-    if (x is! num) throw ArgumentError(x);
-    return NativeFloat64x2._doubles(x, y);
-  }
-
-  /// Returns a new [Float64x2] copied from [this] with a new y value.
-  Float64x2 withY(double y) {
-    if (y is! num) throw ArgumentError(y);
-    return NativeFloat64x2._doubles(x, y);
-  }
-
-  /// Returns the lane-wise minimum value in [this] or [other].
-  Float64x2 min(Float64x2 other) {
-    return NativeFloat64x2._doubles(
-        x < other.x ? x : other.x, y < other.y ? y : other.y);
-  }
-
-  /// Returns the lane-wise maximum value in [this] or [other].
-  Float64x2 max(Float64x2 other) {
-    return NativeFloat64x2._doubles(
-        x > other.x ? x : other.x, y > other.y ? y : other.y);
-  }
-
-  /// Returns the lane-wise square root of [this].
-  Float64x2 sqrt() {
-    return NativeFloat64x2._doubles(Math.sqrt(x), Math.sqrt(y));
-  }
-}
-
-/// Checks that the value is a Uint32. If not, it's not valid as an array
-/// index or offset. Also ensures that the value is non-negative.
-bool _isInvalidArrayIndex(int index) {
-  return (JS<bool>('!', '(# >>> 0 !== #)', index, index));
-}
-
-/// Checks that [index] is a valid index into [list] which has length [length].
-///
-/// That is, [index] is an integer in the range `0..length - 1`.
-void _checkValidIndex(int index, List list, int length) {
-  if (_isInvalidArrayIndex(index) || JS<int>('!', '#', index) >= length) {
-    throw diagnoseIndexError(list, index);
-  }
-}
-
-/// Checks that [start] and [end] form a range of a list of length [length].
-///
-/// That is: `start` and `end` are integers with `0 <= start <= end <= length`.
-/// If `end` is `null` in which case it is considered to be `length`
-///
-/// Returns the actual value of `end`, which is `length` if `end` is `null`, and
-/// the original value of `end` otherwise.
-int _checkValidRange(int start, int? end, int length) {
-  if (_isInvalidArrayIndex(start) || // Ensures start is non-negative int.
-      ((end == null)
-          ? start > length
-          : (_isInvalidArrayIndex(end) || start > end || end > length))) {
-    throw diagnoseRangeError(start, end, length);
-  }
-  if (end == null) return length;
-  return end;
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/README b/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/README
deleted file mode 100644
index 7eb614e..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/README
+++ /dev/null
@@ -1,17 +0,0 @@
-The files in this directory polyfill some of the functionality that browsers
-provide. When running command-line JS evaluators it is frequently necessary to
-execute the preambles before executing the output of dart2js.
-
-=Usage=
-- d8:
-    d8 <sdk>/lib/_internal/compiler/js_lib/preambles/d8.js <output>.js
-
-- jsshell:
-    jsshell -f <sdk>/lib/_internal/compiler/js_lib/preambles/d8.js -f <output>.js
-
-- node.js:
-  The d8 preamble file works for most programs.
-
-  Unfortunately we are not aware of any easy way to provide multiple input files
-  to node. It seems to be necessary to concatenate the d8 preamble and the
-  dart2js output.
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/d8.js b/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/d8.js
deleted file mode 100644
index 0c432f5..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/d8.js
+++ /dev/null
@@ -1,291 +0,0 @@
-// Copyright (c) 2014, 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.
-
-// Javascript preamble, that lets the output of dart2js run on V8's d8 shell.
-
-// Node wraps files and provides them with a different `this`. The global
-// `this` can be accessed through `global`.
-
-var self = this;
-if (typeof global != "undefined") self = global;  // Node.js.
-
-(function(self) {
-  // Using strict mode to avoid accidentally defining global variables.
-  "use strict"; // Should be first statement of this function.
-
-  // Location (Uri.base)
-
-  var workingDirectory;
-  // TODO(sgjesse): This does not work on Windows.
-  if (typeof os == "object" && "system" in os) {
-    // V8.
-    workingDirectory = os.system("pwd");
-    var length = workingDirectory.length;
-    if (workingDirectory[length - 1] == '\n') {
-      workingDirectory = workingDirectory.substring(0, length - 1);
-    }
-  } else if (typeof process != "undefined" &&
-             typeof process.cwd == "function") {
-    // Node.js.
-    workingDirectory = process.cwd();
-  }
-  self.location = { href: "file://" + workingDirectory + "/" };
-
-  // Event loop.
-  // Task queue as cyclic list queue.
-  var taskQueue = new Array(8);  // Length is power of 2.
-  var head = 0;
-  var tail = 0;
-  var mask = taskQueue.length - 1;
-  function addTask(elem) {
-    taskQueue[head] = elem;
-    head = (head + 1) & mask;
-    if (head == tail) _growTaskQueue();
-  }
-  function removeTask() {
-    if (head == tail) return;
-    var result = taskQueue[tail];
-    taskQueue[tail] = undefined;
-    tail = (tail + 1) & mask;
-    return result;
-  }
-  function _growTaskQueue() {
-    // head == tail.
-    var length = taskQueue.length;
-    var split = head;
-    taskQueue.length = length * 2;
-    if (split * 2 < length) {  // split < length / 2
-      for (var i = 0; i < split; i++) {
-        taskQueue[length + i] = taskQueue[i];
-        taskQueue[i] = undefined;
-      }
-      head += length;
-    } else {
-      for (var i = split; i < length; i++) {
-        taskQueue[length + i] = taskQueue[i];
-        taskQueue[i] = undefined;
-      }
-      tail += length;
-    }
-    mask = taskQueue.length - 1;
-  }
-
-  // Mapping from timer id to timer function.
-  // The timer id is written on the function as .$timerId.
-  // That field is cleared when the timer is cancelled, but it is not returned
-  // from the queue until its time comes.
-  var timerIds = {};
-  var timerIdCounter = 1;  // Counter used to assign ids.
-
-  // Zero-timer queue as simple array queue using push/shift.
-  var zeroTimerQueue = [];
-
-  function addTimer(f, ms) {
-    var id = timerIdCounter++;
-    f.$timerId = id;
-    timerIds[id] = f;
-    if (ms == 0 && !isNextTimerDue()) {
-      zeroTimerQueue.push(f);
-    } else {
-      addDelayedTimer(f, ms);
-    }
-    return id;
-  }
-
-  function nextZeroTimer() {
-    while (zeroTimerQueue.length > 0) {
-      var action = zeroTimerQueue.shift();
-      if (action.$timerId !== undefined) return action;
-    }
-  }
-
-  function nextEvent() {
-    var action = removeTask();
-    if (action) {
-      return action;
-    }
-    do {
-      action = nextZeroTimer();
-      if (action) break;
-      var nextList = nextDelayedTimerQueue();
-      if (!nextList) {
-        return;
-      }
-      var newTime = nextList.shift();
-      advanceTimeTo(newTime);
-      zeroTimerQueue = nextList;
-    } while (true)
-    var id = action.$timerId;
-    clearTimerId(action, id);
-    return action;
-  }
-
-  // Mocking time.
-  var timeOffset = 0;
-  var now = function() {
-    // Install the mock Date object only once.
-    // Following calls to "now" will just use the new (mocked) Date.now
-    // method directly.
-    installMockDate();
-    now = Date.now;
-    return Date.now();
-  };
-  var originalDate = Date;
-  var originalNow = originalDate.now;
-  function advanceTimeTo(time) {
-    var now = originalNow();
-    if (timeOffset < time - now) {
-      timeOffset = time - now;
-    }
-  }
-  function installMockDate() {
-    var NewDate = function Date(Y, M, D, h, m, s, ms) {
-      if (this instanceof Date) {
-        // Assume a construct call.
-        switch (arguments.length) {
-          case 0:  return new originalDate(originalNow() + timeOffset);
-          case 1:  return new originalDate(Y);
-          case 2:  return new originalDate(Y, M);
-          case 3:  return new originalDate(Y, M, D);
-          case 4:  return new originalDate(Y, M, D, h);
-          case 5:  return new originalDate(Y, M, D, h, m);
-          case 6:  return new originalDate(Y, M, D, h, m, s);
-          default: return new originalDate(Y, M, D, h, m, s, ms);
-        }
-      }
-      return new originalDate(originalNow() + timeOffset).toString();
-    };
-    NewDate.UTC = originalDate.UTC;
-    NewDate.parse = originalDate.parse;
-    NewDate.now = function now() { return originalNow() + timeOffset; };
-    NewDate.prototype = originalDate.prototype;
-    originalDate.prototype.constructor = NewDate;
-    Date = NewDate;
-  }
-
-  // Heap priority queue with key index.
-  // Each entry is list of [timeout, callback1 ... callbackn].
-  var timerHeap = [];
-  var timerIndex = {};
-  function addDelayedTimer(f, ms) {
-    var timeout = now() + ms;
-    var timerList = timerIndex[timeout];
-    if (timerList == null) {
-      timerList = [timeout, f];
-      timerIndex[timeout] = timerList;
-      var index = timerHeap.length;
-      timerHeap.length += 1;
-      bubbleUp(index, timeout, timerList);
-    } else {
-      timerList.push(f);
-    }
-  }
-
-  function isNextTimerDue() {
-    if (timerHeap.length == 0) return false;
-    var head = timerHeap[0];
-    return head[0] < originalNow() + timeOffset;
-  }
-
-  function nextDelayedTimerQueue() {
-    if (timerHeap.length == 0) return null;
-    var result = timerHeap[0];
-    var last = timerHeap.pop();
-    if (timerHeap.length > 0) {
-      bubbleDown(0, last[0], last);
-    }
-    return result;
-  }
-
-  function bubbleUp(index, key, value) {
-    while (index != 0) {
-      var parentIndex = (index - 1) >> 1;
-      var parent = timerHeap[parentIndex];
-      var parentKey = parent[0];
-      if (key > parentKey) break;
-      timerHeap[index] = parent;
-      index = parentIndex;
-    }
-    timerHeap[index] = value;
-  }
-
-  function bubbleDown(index, key, value) {
-    while (true) {
-      var leftChildIndex = index * 2 + 1;
-      if (leftChildIndex >= timerHeap.length) break;
-      var minChildIndex = leftChildIndex;
-      var minChild = timerHeap[leftChildIndex];
-      var minChildKey = minChild[0];
-      var rightChildIndex = leftChildIndex + 1;
-      if (rightChildIndex < timerHeap.length) {
-        var rightChild = timerHeap[rightChildIndex];
-        var rightKey = rightChild[0];
-        if (rightKey < minChildKey) {
-          minChildIndex = rightChildIndex;
-          minChild = rightChild;
-          minChildKey = rightKey;
-        }
-      }
-      if (minChildKey > key) break;
-      timerHeap[index] = minChild;
-      index = minChildIndex;
-    }
-    timerHeap[index] = value;
-  }
-
-  function addInterval(f, ms) {
-    var id = timerIdCounter++;
-    function repeat() {
-      // Reactivate with the same id.
-      repeat.$timerId = id;
-      timerIds[id] = repeat;
-      addDelayedTimer(repeat, ms);
-      f();
-    }
-    repeat.$timerId = id;
-    timerIds[id] = repeat;
-    addDelayedTimer(repeat, ms);
-    return id;
-  }
-
-  function cancelTimer(id) {
-    var f = timerIds[id];
-    if (f == null) return;
-    clearTimerId(f, id);
-  }
-
-  function clearTimerId(f, id) {
-    f.$timerId = undefined;
-    delete timerIds[id];
-  }
-
-  function eventLoop(action) {
-    while (action) {
-      try {
-        action();
-      } catch (e) {
-        if (typeof onerror == "function") {
-          onerror(e, null, -1);
-        } else {
-          throw e;
-        }
-      }
-      action = nextEvent();
-    }
-  }
-
-  // Global properties. "self" refers to the global object, so adding a
-  // property to "self" defines a global variable.
-  self.dartMainRunner = function(main, args) {
-    // Initialize.
-    var action = function() { main(args); }
-    eventLoop(action);
-  };
-  self.setTimeout = addTimer;
-  self.clearTimeout = cancelTimer;
-  self.setInterval = addInterval;
-  self.clearInterval = cancelTimer;
-  self.scheduleImmediate = addTask;
-  self.self = self;
-})(self);
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/jsshell.js b/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/jsshell.js
deleted file mode 100644
index 8f13bcc..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/preambles/jsshell.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2014, 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.
-
-// Javascript preamble, that lets the output of dart2js run on JSShell.
-
-(function(self) {
-  // Using strict mode to avoid accidentally defining global variables.
-  "use strict"; // Should be first statement of this function.
-
-  // Location (Uri.base)
-
-  var workingDirectory = environment["PWD"];
-  self.location = { href: "file://" + workingDirectory + "/" };
-
-  // Global properties. "self" refers to the global object, so adding a
-  // property to "self" defines a global variable.
-  self.self = self;
-})(this)
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/profile.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/profile.dart
deleted file mode 100644
index ede4363..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/profile.dart
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2017, 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.
-
-/// This file supports profiling dynamic calls.
-part of dart._debugger;
-
-class _MethodStats {
-  final String typeName;
-  final String frame;
-  double count = 0.0;
-
-  _MethodStats(this.typeName, this.frame);
-}
-
-class _CallMethodRecord {
-  var jsError;
-  var type;
-
-  _CallMethodRecord(this.jsError, this.type);
-}
-
-/// Size for the random sample of dynamic calls.
-int _callRecordSampleSize = 5000;
-
-/// If the number of dynamic calls exceeds [_callRecordSampleSize] this list
-/// will represent a random sample of the dynamic calls made.
-var _callMethodRecords = <_CallMethodRecord>[];
-
-/// If the number of dynamic calls exceeds [_callRecordSampleSize] this value
-/// will be greater than [_callMethodRecords.length].
-int _totalCallRecords = 0;
-
-/// Minimum number of samples to consider a profile entry relevant.
-/// This could be set a lot higher. We set this value so users are not
-/// confused into thinking that a dynamic call that occurred once but was
-/// randomly included in the sample is relevant.
-num _minCount = 2;
-
-/// Cache mapping from raw stack frames to source mapped stack frames to
-/// speedup lookup of source map frames when running the profiler.
-/// The number of source map entries looked up makes caching more important
-/// in this case than for typical source map use cases.
-var _frameMappingCache = <String, String>{};
-
-List<List<Object>> getDynamicStats() {
-  // Process the accumulated method stats. This may be quite slow as processing
-  // stack traces is expensive. If there are performance blockers, we should
-  // switch to a sampling approach that caps the number of _callMethodRecords
-  // and uses random sampling to decide whether to add each additional record
-  // to the sample. Main change required is that we need to still show the total
-  // raw number of dynamic calls so that the magnitude of the dynamic call
-  // performance hit is clear to users.
-
-  var callMethodStats = <String, _MethodStats>{};
-  if (_callMethodRecords.length > 0) {
-    // Ratio between total record count and sampled records count.
-    var recordRatio = _totalCallRecords / _callMethodRecords.length;
-    for (var record in _callMethodRecords) {
-      String stackStr = JS<String>('!', '#.stack', record.jsError);
-      var frames = stackStr.split('\n');
-      // Skip first two lines as the first couple frames are from the dart
-      // runtime.
-      var src = frames
-          .skip(2)
-          .map((f) => _frameMappingCache.putIfAbsent(
-              f, () => stackTraceMapper!('\n$f')))
-          .firstWhere((f) => !f.startsWith('dart:'), orElse: () => '');
-
-      var actualTypeName = dart.typeName(record.type);
-      callMethodStats
-          .putIfAbsent(
-              "$actualTypeName <$src>", () => _MethodStats(actualTypeName, src))
-          .count += recordRatio;
-    }
-
-    // filter out all calls that did not occur at least _minCount times in the
-    // random sample if we are dealing with a random sample instead of a
-    // complete profile.
-    if (_totalCallRecords != _callMethodRecords.length) {
-      for (var k in callMethodStats.keys.toList()) {
-        var stats = callMethodStats[k]!;
-        var threshold = _minCount * recordRatio;
-        if (stats.count + 0.001 < threshold) {
-          callMethodStats.remove(k);
-        }
-      }
-    }
-  }
-  _callMethodRecords.clear();
-  _totalCallRecords = 0;
-  var keys = callMethodStats.keys.toList();
-  keys.sort(
-      (a, b) => callMethodStats[b]!.count.compareTo(callMethodStats[a]!.count));
-  var ret = <List<Object>>[];
-  for (var key in keys) {
-    var stats = callMethodStats[key]!;
-    ret.add([stats.typeName, stats.frame, stats.count.round()]);
-  }
-  return ret;
-}
-
-clearDynamicStats() {
-  _callMethodRecords.clear();
-}
-
-// We need to set this property while the sdk is only partially initialized
-// so we cannot use a regular Dart field.
-bool get _trackProfile => JS<bool>('!', 'dart.__trackProfile');
-
-trackCall(obj) {
-  if (JS<bool>('!', '!#', _trackProfile)) return;
-  int index = -1;
-  _totalCallRecords++;
-  if (_callMethodRecords.length == _callRecordSampleSize) {
-    // Ensure that each sample has an equal
-    // _callRecordSampleSize / _totalCallRecords chance of inclusion
-    // by choosing to include the new record in the sample the with the
-    // appropriate probability randomly evicting one of the existing records.
-    // Unfortunately we can't use the excellent Random.nextInt method defined
-    // by Dart from within this library.
-    index = JS<int>('!', 'Math.floor(Math.random() * #)', _totalCallRecords);
-    if (index >= _callMethodRecords.length) return; // don't sample
-  }
-  var record =
-      _CallMethodRecord(JS('', 'new Error()'), dart.getReifiedType(obj));
-  if (index == -1) {
-    _callMethodRecords.add(record);
-  } else {
-    _callMethodRecords[index] = record;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/regexp_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/regexp_helper.dart
deleted file mode 100644
index 6ce53ac..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/regexp_helper.dart
+++ /dev/null
@@ -1,289 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._js_helper;
-
-// Helper method used by internal libraries.
-regExpGetNative(JSSyntaxRegExp regexp) => regexp._nativeRegExp;
-
-/**
- * Returns a native version of the RegExp with the global flag set.
- *
- * The RegExp's `lastIndex` property is zero when it is returned.
- *
- * The returned regexp is shared, and its `lastIndex` property may be
- * modified by other uses, so the returned regexp must be used immediately
- * when it's returned, with no user-provided code run in between.
- */
-regExpGetGlobalNative(JSSyntaxRegExp regexp) {
-  var nativeRegexp = regexp._nativeGlobalVersion;
-  JS("void", "#.lastIndex = 0", nativeRegexp);
-  return nativeRegexp;
-}
-
-/**
- * Computes the number of captures in a regexp.
- *
- * This currently involves creating a new RegExp object with a different
- * source and running it against the empty string (the last part is usually
- * fast).
- *
- * The JSSyntaxRegExp could cache the result, and set the cache any time
- * it finds a match.
- */
-int regExpCaptureCount(JSSyntaxRegExp regexp) {
-  var nativeAnchoredRegExp = regexp._nativeAnchoredVersion;
-  JSExtendableArray match =
-      JS('JSExtendableArray', "#.exec('')", nativeAnchoredRegExp);
-  // The native-anchored regexp always have one capture more than the original,
-  // and always matches the empty string.
-  return match.length - 2;
-}
-
-class JSSyntaxRegExp implements RegExp {
-  final String pattern;
-  final _nativeRegExp;
-  var _nativeGlobalRegExp;
-  var _nativeAnchoredRegExp;
-
-  String toString() =>
-      'RegExp/$pattern/' + JS<String>('!', '#.flags', _nativeRegExp);
-
-  JSSyntaxRegExp(String source,
-      {bool multiLine = false,
-      bool caseSensitive = true,
-      bool unicode = false,
-      bool dotAll = false})
-      : this.pattern = source,
-        this._nativeRegExp = makeNative(
-            source, multiLine, caseSensitive, unicode, dotAll, false);
-
-  get _nativeGlobalVersion {
-    if (_nativeGlobalRegExp != null) return _nativeGlobalRegExp;
-    return _nativeGlobalRegExp = makeNative(
-        pattern, _isMultiLine, _isCaseSensitive, _isUnicode, _isDotAll, true);
-  }
-
-  get _nativeAnchoredVersion {
-    if (_nativeAnchoredRegExp != null) return _nativeAnchoredRegExp;
-    // An "anchored version" of a regexp is created by adding "|()" to the
-    // source. This means that the regexp always matches at the first position
-    // that it tries, and you can see if the original regexp matched, or it
-    // was the added zero-width match that matched, by looking at the last
-    // capture. If it is a String, the match participated, otherwise it didn't.
-    return _nativeAnchoredRegExp = makeNative("$pattern|()", _isMultiLine,
-        _isCaseSensitive, _isUnicode, _isDotAll, true);
-  }
-
-  bool get _isMultiLine => JS("bool", "#.multiline", _nativeRegExp);
-  bool get _isCaseSensitive => JS("bool", "!#.ignoreCase", _nativeRegExp);
-  bool get _isUnicode => JS("bool", "#.unicode", _nativeRegExp);
-  // The "dotAll" property is not available on all browsers, but our internals
-  // currently assume this is non-null.  Coerce to false if not present.
-  bool get _isDotAll => JS("bool", "#.dotAll == true", _nativeRegExp);
-
-  static makeNative(@nullCheck String source, bool multiLine,
-      bool caseSensitive, bool unicode, bool dotAll, bool global) {
-    String m = multiLine ? 'm' : '';
-    String i = caseSensitive ? '' : 'i';
-    String u = unicode ? 'u' : '';
-    String s = dotAll ? 's' : '';
-    String g = global ? 'g' : '';
-    // We're using the JavaScript's try catch instead of the Dart one
-    // to avoid dragging in Dart runtime support just because of using
-    // RegExp.
-    var regexp = JS(
-        '',
-        '(function() {'
-            'try {'
-            'return new RegExp(#, # + # + # + # + #);'
-            '} catch (e) {'
-            'return e;'
-            '}'
-            '})()',
-        source,
-        m,
-        i,
-        u,
-        s,
-        g);
-    if (JS<bool>('!', '# instanceof RegExp', regexp)) return regexp;
-    // The returned value is the JavaScript exception. Turn it into a
-    // Dart exception.
-    String errorMessage = JS<String>('!', r'String(#)', regexp);
-    throw FormatException("Illegal RegExp pattern: $source, $errorMessage");
-  }
-
-  RegExpMatch? firstMatch(@nullCheck String string) {
-    List<String>? m =
-        JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp, string);
-    if (m == null) return null;
-    return _MatchImplementation(this, m);
-  }
-
-  @notNull
-  bool hasMatch(@nullCheck String string) {
-    return JS<bool>('!', r'#.test(#)', _nativeRegExp, string);
-  }
-
-  String? stringMatch(String string) {
-    var match = firstMatch(string);
-    if (match != null) return match.group(0);
-    return null;
-  }
-
-  Iterable<RegExpMatch> allMatches(@nullCheck String string,
-      [@nullCheck int start = 0]) {
-    if (start < 0 || start > string.length) {
-      throw RangeError.range(start, 0, string.length);
-    }
-    return _AllMatchesIterable(this, string, start);
-  }
-
-  RegExpMatch? _execGlobal(String string, int start) {
-    Object regexp = _nativeGlobalVersion;
-    JS("void", "#.lastIndex = #", regexp, start);
-    List<String>? match =
-        JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
-    if (match == null) return null;
-    return _MatchImplementation(this, match);
-  }
-
-  RegExpMatch? _execAnchored(String string, int start) {
-    Object regexp = _nativeAnchoredVersion;
-    JS("void", "#.lastIndex = #", regexp, start);
-    List<String>? match =
-        JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
-    if (match == null) return null;
-    // If the last capture group participated, the original regexp did not
-    // match at the start position.
-    if (match[match.length - 1] != null) return null;
-    match.length -= 1;
-    return _MatchImplementation(this, match);
-  }
-
-  Match? matchAsPrefix(String string, [int start = 0]) {
-    if (start < 0 || start > string.length) {
-      throw RangeError.range(start, 0, string.length);
-    }
-    return _execAnchored(string, start);
-  }
-
-  bool get isMultiLine => _isMultiLine;
-  bool get isCaseSensitive => _isCaseSensitive;
-  bool get isUnicode => _isUnicode;
-  bool get isDotAll => _isDotAll;
-}
-
-class _MatchImplementation implements RegExpMatch {
-  final Pattern pattern;
-  // Contains a JS RegExp match object.
-  // It is an Array of String values with extra "index" and "input" properties.
-  final List<String> _match;
-
-  _MatchImplementation(this.pattern, this._match) {
-    assert(JS("var", "#.input", _match) is String);
-    assert(JS("var", "#.index", _match) is int);
-  }
-
-  String get input => JS("String", "#.input", _match);
-  int get start => JS("int", "#.index", _match);
-  int get end => start + _match[0].length;
-
-  String? group(int index) => _match[index];
-  String? operator [](int index) => group(index);
-  int get groupCount => _match.length - 1;
-
-  List<String?> groups(List<int> groups) {
-    List<String?> out = [];
-    for (int i in groups) {
-      out.add(group(i));
-    }
-    return out;
-  }
-
-  String? namedGroup(String name) {
-    var groups = JS<Object?>('Object|Null', '#.groups', _match);
-    if (groups != null) {
-      var result = JS<String?>('', '#[#]', groups, name);
-      if (result != null || JS<bool>('!', '# in #', name, groups)) {
-        return result;
-      }
-    }
-    throw ArgumentError.value(name, "name", "Not a capture group name");
-  }
-
-  Iterable<String> get groupNames {
-    var groups = JS<Object?>('Object|Null', '#.groups', _match);
-    if (groups != null) {
-      var keys = JSArray<String>.of(JS('', 'Object.keys(#)', groups));
-      return SubListIterable(keys, 0, null);
-    }
-    return Iterable.empty();
-  }
-}
-
-class _AllMatchesIterable extends IterableBase<RegExpMatch> {
-  final JSSyntaxRegExp _re;
-  final String _string;
-  final int _start;
-
-  _AllMatchesIterable(this._re, this._string, this._start);
-
-  Iterator<RegExpMatch> get iterator =>
-      _AllMatchesIterator(_re, _string, _start);
-}
-
-class _AllMatchesIterator implements Iterator<RegExpMatch> {
-  final JSSyntaxRegExp _regExp;
-  String? _string;
-  int _nextIndex;
-  RegExpMatch? _current;
-
-  _AllMatchesIterator(this._regExp, this._string, this._nextIndex);
-
-  RegExpMatch get current => _current as RegExpMatch;
-
-  static bool _isLeadSurrogate(int c) {
-    return c >= 0xd800 && c <= 0xdbff;
-  }
-
-  static bool _isTrailSurrogate(int c) {
-    return c >= 0xdc00 && c <= 0xdfff;
-  }
-
-  bool moveNext() {
-    var string = _string;
-    if (string == null) return false;
-    if (_nextIndex <= string.length) {
-      var match = _regExp._execGlobal(string, _nextIndex);
-      if (match != null) {
-        _current = match;
-        int nextIndex = match.end;
-        if (match.start == nextIndex) {
-          // Zero-width match. Advance by one more, unless the regexp
-          // is in unicode mode and it would put us within a surrogate
-          // pair. In that case, advance past the code point as a whole.
-          if (_regExp.isUnicode &&
-              _nextIndex + 1 < string.length &&
-              _isLeadSurrogate(string.codeUnitAt(_nextIndex)) &&
-              _isTrailSurrogate(string.codeUnitAt(_nextIndex + 1))) {
-            nextIndex++;
-          }
-          nextIndex++;
-        }
-        _nextIndex = nextIndex;
-        return true;
-      }
-    }
-    _current = null;
-    _string = null; // Marks iteration as ended.
-    return false;
-  }
-}
-
-/** Find the first match of [regExp] in [string] at or after [start]. */
-RegExpMatch? firstMatchAfter(JSSyntaxRegExp regExp, String string, int start) {
-  return regExp._execGlobal(string, start);
-}
diff --git a/sdk_nnbd/lib/_internal/js_dev_runtime/private/string_helper.dart b/sdk_nnbd/lib/_internal/js_dev_runtime/private/string_helper.dart
deleted file mode 100644
index 7a0de57..0000000
--- a/sdk_nnbd/lib/_internal/js_dev_runtime/private/string_helper.dart
+++ /dev/null
@@ -1,297 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._js_helper;
-
-@notNull
-int stringIndexOfStringUnchecked(receiver, other, startIndex) {
-  return JS<int>('!', '#.indexOf(#, #)', receiver, other, startIndex);
-}
-
-@notNull
-String substring1Unchecked(receiver, startIndex) {
-  return JS('!', '#.substring(#)', receiver, startIndex);
-}
-
-@notNull
-String substring2Unchecked(receiver, startIndex, endIndex) {
-  return JS('!', '#.substring(#, #)', receiver, startIndex, endIndex);
-}
-
-@notNull
-bool stringContainsStringUnchecked(receiver, other, startIndex) {
-  return stringIndexOfStringUnchecked(receiver, other, startIndex) >= 0;
-}
-
-class StringMatch implements Match {
-  const StringMatch(int this.start, String this.input, String this.pattern);
-
-  int get end => start + pattern.length;
-  String operator [](int g) => group(g);
-  int get groupCount => 0;
-
-  String group(int group_) {
-    if (group_ != 0) {
-      throw RangeError.value(group_);
-    }
-    return pattern;
-  }
-
-  List<String> groups(List<int> groups_) {
-    List<String> result = <String>[];
-    for (int g in groups_) {
-      result.add(group(g));
-    }
-    return result;
-  }
-
-  final int start;
-  final String input;
-  final String pattern;
-}
-
-Iterable<Match> allMatchesInStringUnchecked(
-    String pattern, String string, int startIndex) {
-  return _StringAllMatchesIterable(string, pattern, startIndex);
-}
-
-class _StringAllMatchesIterable extends Iterable<Match> {
-  final String _input;
-  final String _pattern;
-  final int _index;
-
-  _StringAllMatchesIterable(this._input, this._pattern, this._index);
-
-  Iterator<Match> get iterator =>
-      _StringAllMatchesIterator(_input, _pattern, _index);
-
-  Match get first {
-    int index = stringIndexOfStringUnchecked(_input, _pattern, _index);
-    if (index >= 0) {
-      return StringMatch(index, _input, _pattern);
-    }
-    throw IterableElementError.noElement();
-  }
-}
-
-class _StringAllMatchesIterator implements Iterator<Match> {
-  final String _input;
-  final String _pattern;
-  int _index;
-  Match? _current;
-
-  _StringAllMatchesIterator(this._input, this._pattern, this._index);
-
-  bool moveNext() {
-    if (_index + _pattern.length > _input.length) {
-      _current = null;
-      return false;
-    }
-    var index = stringIndexOfStringUnchecked(_input, _pattern, _index);
-    if (index < 0) {
-      _index = _input.length + 1;
-      _current = null;
-      return false;
-    }
-    int end = index + _pattern.length;
-    _current = StringMatch(index, _input, _pattern);
-    // Empty match, don't start at same location again.
-    if (end == _index) end++;
-    _index = end;
-    return true;
-  }
-
-  Match get current => _current!;
-}
-
-@notNull
-bool stringContainsUnchecked(
-    @notNull String receiver, @notNull other, int startIndex) {
-  if (other is String) {
-    return stringContainsStringUnchecked(receiver, other, startIndex);
-  } else if (other is JSSyntaxRegExp) {
-    return other.hasMatch(receiver.substring(startIndex));
-  } else {
-    var substr = receiver.substring(startIndex);
-    return other.allMatches(substr).isNotEmpty;
-  }
-}
-
-@notNull
-String stringReplaceJS(String receiver, replacer, String replacement) {
-  // The JavaScript String.replace method recognizes replacement
-  // patterns in the replacement string. Dart does not have that
-  // behavior.
-  replacement = JS<String>('!', r'#.replace(/\$/g, "$$$$")', replacement);
-  return JS<String>('!', r'#.replace(#, #)', receiver, replacer, replacement);
-}
-
-@notNull
-String stringReplaceFirstRE(@notNull String receiver, JSSyntaxRegExp regexp,
-    String replacement, int startIndex) {
-  var match = regexp._execGlobal(receiver, startIndex);
-  if (match == null) return receiver;
-  var start = match.start;
-  var end = match.end;
-  return stringReplaceRangeUnchecked(receiver, start, end, replacement);
-}
-
-/// Returns a string for a RegExp pattern that matches [string]. This is done by
-/// escaping all RegExp metacharacters.
-@notNull
-String quoteStringForRegExp(string) {
-  return JS<String>('!', r'#.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&")', string);
-}
-
-@notNull
-String stringReplaceAllUnchecked(@notNull String receiver,
-    @nullCheck Pattern pattern, @nullCheck String replacement) {
-  if (pattern is String) {
-    if (pattern == "") {
-      if (receiver == "") {
-        return replacement;
-      } else {
-        StringBuffer result = StringBuffer();
-        int length = receiver.length;
-        result.write(replacement);
-        for (int i = 0; i < length; i++) {
-          result.write(receiver[i]);
-          result.write(replacement);
-        }
-        return result.toString();
-      }
-    } else {
-      return JS<String>(
-          '!', '#.split(#).join(#)', receiver, pattern, replacement);
-    }
-  } else if (pattern is JSSyntaxRegExp) {
-    var re = regExpGetGlobalNative(pattern);
-    return stringReplaceJS(receiver, re, replacement);
-  } else {
-    // TODO(floitsch): implement generic String.replace (with patterns).
-    throw "String.replaceAll(Pattern) UNIMPLEMENTED";
-  }
-}
-
-String _matchString(Match match) => match[0]!;
-String _stringIdentity(String string) => string;
-
-@notNull
-String stringReplaceAllFuncUnchecked(
-    String receiver,
-    @nullCheck Pattern pattern,
-    String Function(Match)? onMatch,
-    String Function(String)? onNonMatch) {
-  if (onMatch == null) onMatch = _matchString;
-  if (onNonMatch == null) onNonMatch = _stringIdentity;
-  if (pattern is String) {
-    return stringReplaceAllStringFuncUnchecked(
-        receiver, pattern, onMatch, onNonMatch);
-  }
-  StringBuffer buffer = StringBuffer();
-  int startIndex = 0;
-  for (Match match in pattern.allMatches(receiver)) {
-    buffer.write(onNonMatch(receiver.substring(startIndex, match.start)));
-    buffer.write(onMatch(match));
-    startIndex = match.end;
-  }
-  buffer.write(onNonMatch(receiver.substring(startIndex)));
-  return buffer.toString();
-}
-
-@notNull
-String stringReplaceAllEmptyFuncUnchecked(String receiver,
-    String onMatch(Match match), String onNonMatch(String nonMatch)) {
-  // Pattern is the empty string.
-  StringBuffer buffer = StringBuffer();
-  int length = receiver.length;
-  int i = 0;
-  buffer.write(onNonMatch(""));
-  while (i < length) {
-    buffer.write(onMatch(StringMatch(i, receiver, "")));
-    // Special case to avoid splitting a surrogate pair.
-    int code = receiver.codeUnitAt(i);
-    if ((code & ~0x3FF) == 0xD800 && length > i + 1) {
-      // Leading surrogate;
-      code = receiver.codeUnitAt(i + 1);
-      if ((code & ~0x3FF) == 0xDC00) {
-        // Matching trailing surrogate.
-        buffer.write(onNonMatch(receiver.substring(i, i + 2)));
-        i += 2;
-        continue;
-      }
-    }
-    buffer.write(onNonMatch(receiver[i]));
-    i++;
-  }
-  buffer.write(onMatch(StringMatch(i, receiver, "")));
-  buffer.write(onNonMatch(""));
-  return buffer.toString();
-}
-
-@notNull
-String stringReplaceAllStringFuncUnchecked(String receiver, String pattern,
-    String onMatch(Match match), String onNonMatch(String nonMatch)) {
-  int patternLength = pattern.length;
-  if (patternLength == 0) {
-    return stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch);
-  }
-  int length = receiver.length;
-  StringBuffer buffer = StringBuffer();
-  int startIndex = 0;
-  while (startIndex < length) {
-    int position = stringIndexOfStringUnchecked(receiver, pattern, startIndex);
-    if (position == -1) {
-      break;
-    }
-    buffer.write(onNonMatch(receiver.substring(startIndex, position)));
-    buffer.write(onMatch(StringMatch(position, receiver, pattern)));
-    startIndex = position + patternLength;
-  }
-  buffer.write(onNonMatch(receiver.substring(startIndex)));
-  return buffer.toString();
-}
-
-@notNull
-String stringReplaceFirstUnchecked(@notNull String receiver,
-    @nullCheck Pattern pattern, String replacement, int startIndex) {
-  if (pattern is String) {
-    int index = stringIndexOfStringUnchecked(receiver, pattern, startIndex);
-    if (index < 0) return receiver;
-    int end = index + pattern.length;
-    return stringReplaceRangeUnchecked(receiver, index, end, replacement);
-  }
-  if (pattern is JSSyntaxRegExp) {
-    return startIndex == 0
-        ? stringReplaceJS(receiver, regExpGetNative(pattern), replacement)
-        : stringReplaceFirstRE(receiver, pattern, replacement, startIndex);
-  }
-  Iterator<Match> matches = pattern.allMatches(receiver, startIndex).iterator;
-  if (!matches.moveNext()) return receiver;
-  Match match = matches.current;
-  return receiver.replaceRange(match.start, match.end, replacement);
-}
-
-@notNull
-String stringReplaceFirstMappedUnchecked(String receiver, Pattern pattern,
-    String replace(Match current), int startIndex) {
-  Iterator<Match> matches = pattern.allMatches(receiver, startIndex).iterator;
-  if (!matches.moveNext()) return receiver;
-  Match match = matches.current;
-  String replacement = "${replace(match)}";
-  return receiver.replaceRange(match.start, match.end, replacement);
-}
-
-@notNull
-String stringJoinUnchecked(array, separator) {
-  return JS<String>('!', r'#.join(#)', array, separator);
-}
-
-@notNull
-String stringReplaceRangeUnchecked(
-    String receiver, int start, int end, String replacement) {
-  String prefix = JS('!', '#.substring(0, #)', receiver, start);
-  String suffix = JS('!', '#.substring(#)', receiver, end);
-  return "$prefix$replacement$suffix";
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/.packages b/sdk_nnbd/lib/_internal/js_runtime/.packages
deleted file mode 100644
index adf8b36..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/.packages
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by pub on 2015-12-07 17:08:11.724.
-js_runtime:lib/
diff --git a/sdk_nnbd/lib/_internal/js_runtime/interceptors_sources.gni b/sdk_nnbd/lib/_internal/js_runtime/interceptors_sources.gni
deleted file mode 100644
index b3a8760..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/interceptors_sources.gni
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-interceptors_sdk_sources = [ "lib/interceptors.dart" ]
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/annotations.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/annotations.dart
deleted file mode 100644
index f53c5f3..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/annotations.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of _js_helper;
-
-/// Marks a class as native and defines its JavaScript name(s).
-class Native {
-  final String name;
-  const Native(this.name);
-}
-
-class _Patch {
-  const _Patch();
-}
-
-/// Annotation that marks the declaration as a patch.
-const _Patch patch = const _Patch();
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/async_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/async_patch.dart
deleted file mode 100644
index 45ed0c5..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/async_patch.dart
+++ /dev/null
@@ -1,708 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for the dart:async library.
-
-import 'dart:_js_helper'
-    show
-        patch,
-        ExceptionAndStackTrace,
-        convertDartClosureToJS,
-        getTraceFromException,
-        requiresPreamble,
-        wrapException,
-        unwrapException;
-
-import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
-
-import 'dart:_async_await_error_codes' as async_error_codes;
-
-import "dart:collection" show IterableBase;
-
-@patch
-class _AsyncRun {
-  @patch
-  static void _scheduleImmediate(void callback()) {
-    _scheduleImmediateClosure(callback);
-  }
-
-  // Lazily initialized.
-  static final Function _scheduleImmediateClosure =
-      _initializeScheduleImmediate();
-
-  static Function _initializeScheduleImmediate() {
-    requiresPreamble();
-    if (JS('', 'self.scheduleImmediate') != null) {
-      return _scheduleImmediateJsOverride;
-    }
-    if (JS('', 'self.MutationObserver') != null &&
-        JS('', 'self.document') != null) {
-      // Use mutationObservers.
-      var div = JS('', 'self.document.createElement("div")');
-      var span = JS('', 'self.document.createElement("span")');
-      var storedCallback;
-
-      internalCallback(_) {
-        var f = storedCallback;
-        storedCallback = null;
-        f();
-      }
-
-      var observer = JS('', 'new self.MutationObserver(#)',
-          convertDartClosureToJS(internalCallback, 1));
-      JS('', '#.observe(#, { childList: true })', observer, div);
-
-      return (void callback()) {
-        assert(storedCallback == null);
-        storedCallback = callback;
-        // Because of a broken shadow-dom polyfill we have to change the
-        // children instead a cheap property.
-        JS('', '#.firstChild ? #.removeChild(#): #.appendChild(#)', div, div,
-            span, div, span);
-      };
-    } else if (JS('', 'self.setImmediate') != null) {
-      return _scheduleImmediateWithSetImmediate;
-    }
-    // TODO(20055): We should use DOM promises when available.
-    return _scheduleImmediateWithTimer;
-  }
-
-  static void _scheduleImmediateJsOverride(void callback()) {
-    internalCallback() {
-      callback();
-    }
-
-    JS('void', 'self.scheduleImmediate(#)',
-        convertDartClosureToJS(internalCallback, 0));
-  }
-
-  static void _scheduleImmediateWithSetImmediate(void callback()) {
-    internalCallback() {
-      callback();
-    }
-
-    JS('void', 'self.setImmediate(#)',
-        convertDartClosureToJS(internalCallback, 0));
-  }
-
-  static void _scheduleImmediateWithTimer(void callback()) {
-    Timer._createTimer(Duration.zero, callback);
-  }
-}
-
-@patch
-class DeferredLibrary {
-  @patch
-  Future<Null> load() {
-    throw 'DeferredLibrary not supported. '
-        'please use the `import "lib.dart" deferred as lib` syntax.';
-  }
-}
-
-@patch
-class Timer {
-  @patch
-  static Timer _createTimer(Duration duration, void callback()) {
-    int milliseconds = duration.inMilliseconds;
-    if (milliseconds < 0) milliseconds = 0;
-    return new _TimerImpl(milliseconds, callback);
-  }
-
-  @patch
-  static Timer _createPeriodicTimer(
-      Duration duration, void callback(Timer timer)) {
-    int milliseconds = duration.inMilliseconds;
-    if (milliseconds < 0) milliseconds = 0;
-    return new _TimerImpl.periodic(milliseconds, callback);
-  }
-}
-
-class _TimerImpl implements Timer {
-  final bool _once;
-  int? _handle;
-  int _tick = 0;
-
-  _TimerImpl(int milliseconds, void callback()) : _once = true {
-    if (_hasTimer()) {
-      void internalCallback() {
-        _handle = null;
-        this._tick = 1;
-        callback();
-      }
-
-      _handle = JS('int', 'self.setTimeout(#, #)',
-          convertDartClosureToJS(internalCallback, 0), milliseconds);
-    } else {
-      throw new UnsupportedError('`setTimeout()` not found.');
-    }
-  }
-
-  _TimerImpl.periodic(int milliseconds, void callback(Timer timer))
-      : _once = false {
-    if (_hasTimer()) {
-      int start = JS('int', 'Date.now()');
-      _handle = JS(
-          'int',
-          'self.setInterval(#, #)',
-          convertDartClosureToJS(() {
-            int tick = this._tick + 1;
-            if (milliseconds > 0) {
-              int duration = JS('int', 'Date.now()') - start;
-              if (duration > (tick + 1) * milliseconds) {
-                tick = duration ~/ milliseconds;
-              }
-            }
-            this._tick = tick;
-            callback(this);
-          }, 0),
-          milliseconds);
-    } else {
-      throw new UnsupportedError('Periodic timer.');
-    }
-  }
-
-  @override
-  bool get isActive => _handle != null;
-
-  @override
-  int get tick => _tick;
-
-  @override
-  void cancel() {
-    if (_hasTimer()) {
-      if (_handle == null) return;
-      if (_once) {
-        JS('void', 'self.clearTimeout(#)', _handle);
-      } else {
-        JS('void', 'self.clearInterval(#)', _handle);
-      }
-      _handle = null;
-    } else {
-      throw new UnsupportedError('Canceling a timer.');
-    }
-  }
-}
-
-bool _hasTimer() {
-  requiresPreamble();
-  return JS('', 'self.setTimeout') != null;
-}
-
-class _AsyncAwaitCompleter<T> implements Completer<T> {
-  final _future = new _Future<T>();
-  bool isSync;
-
-  _AsyncAwaitCompleter() : isSync = false;
-
-  void complete([FutureOr<T>? value]) {
-    // All paths require that if value is null, null as T succeeds.
-    value = (value == null) ? value as T : value;
-    if (!isSync) {
-      _future._asyncComplete(value);
-    } else if (value is Future<T>) {
-      assert(!_future._isComplete);
-      _future._chainFuture(value);
-    } else {
-      // TODO(40014): Remove cast when type promotion works.
-      // This would normally be `as T` but we use `as dynamic` to make the
-      // unneeded check be implict to match dart2js unsound optimizations in the
-      // user code.
-      _future._completeWithValue(value as dynamic);
-    }
-  }
-
-  void completeError(Object e, [StackTrace? st]) {
-    st ??= AsyncError.defaultStackTrace(e);
-    if (isSync) {
-      _future._completeError(e, st);
-    } else {
-      _future._asyncCompleteError(e, st);
-    }
-  }
-
-  Future<T> get future => _future;
-  bool get isCompleted => !_future._mayComplete;
-}
-
-/// Creates a Completer for an `async` function.
-///
-/// Used as part of the runtime support for the async/await transformation.
-Completer<T> _makeAsyncAwaitCompleter<T>() {
-  return new _AsyncAwaitCompleter<T>();
-}
-
-/// Initiates the computation of an `async` function and starts the body
-/// synchronously.
-///
-/// Used as part of the runtime support for the async/await transformation.
-///
-/// This function sets up the first call into the transformed [bodyFunction].
-/// Independently, it takes the [completer] and returns the future of the
-/// completer for convenience of the transformed code.
-dynamic _asyncStartSync(
-    _WrappedAsyncBody bodyFunction, _AsyncAwaitCompleter completer) {
-  bodyFunction(async_error_codes.SUCCESS, null);
-  completer.isSync = true;
-  return completer.future;
-}
-
-/// Performs the `await` operation of an `async` function.
-///
-/// Used as part of the runtime support for the async/await transformation.
-///
-/// Arranges for [bodyFunction] to be called when the future or value [object]
-/// is completed with a code [async_error_codes.SUCCESS] or
-/// [async_error_codes.ERROR] depending on the success of the future.
-dynamic _asyncAwait(dynamic object, _WrappedAsyncBody bodyFunction) {
-  _awaitOnObject(object, bodyFunction);
-}
-
-/// Completes the future of an `async` function.
-///
-/// Used as part of the runtime support for the async/await transformation.
-///
-/// This function is used when the `async` function returns (explicitly or
-/// implicitly).
-dynamic _asyncReturn(dynamic object, Completer completer) {
-  completer.complete(object);
-}
-
-/// Completes the future of an `async` function with an error.
-///
-/// Used as part of the runtime support for the async/await transformation.
-///
-/// This function is used when the `async` function re-throws an exception.
-dynamic _asyncRethrow(dynamic object, Completer completer) {
-  // The error is a js-error.
-  completer.completeError(
-      unwrapException(object), getTraceFromException(object));
-}
-
-/// Awaits on the given [object].
-///
-/// If the [object] is a Future, registers on it, otherwise wraps it into a
-/// future first.
-///
-/// The [bodyFunction] argument is the continuation that should be invoked
-/// when the future completes.
-void _awaitOnObject(object, _WrappedAsyncBody bodyFunction) {
-  FutureOr<dynamic> Function(dynamic) thenCallback =
-      (result) => bodyFunction(async_error_codes.SUCCESS, result);
-
-  Function errorCallback = (dynamic error, StackTrace stackTrace) {
-    ExceptionAndStackTrace wrappedException =
-        new ExceptionAndStackTrace(error, stackTrace);
-    bodyFunction(async_error_codes.ERROR, wrappedException);
-  };
-
-  if (object is _Future) {
-    // We can skip the zone registration, since the bodyFunction is already
-    // registered (see [_wrapJsFunctionForAsync]).
-    object._thenAwait(thenCallback, errorCallback);
-  } else if (object is Future) {
-    object.then(thenCallback, onError: errorCallback);
-  } else {
-    _Future future = new _Future().._setValue(object);
-    // We can skip the zone registration, since the bodyFunction is already
-    // registered (see [_wrapJsFunctionForAsync]).
-    future._thenAwait(thenCallback, errorCallback);
-  }
-}
-
-typedef void _WrappedAsyncBody(int errorCode, dynamic result);
-
-_WrappedAsyncBody _wrapJsFunctionForAsync(dynamic /* js function */ function) {
-  var protected = JS(
-      '',
-      """
-        (function (fn, ERROR) {
-          // Invokes [function] with [errorCode] and [result].
-          //
-          // If (and as long as) the invocation throws, calls [function] again,
-          // with an error-code.
-          return function(errorCode, result) {
-            while (true) {
-              try {
-                fn(errorCode, result);
-                break;
-              } catch (error) {
-                result = error;
-                errorCode = ERROR;
-              }
-            }
-          }
-        })(#, #)""",
-      function,
-      async_error_codes.ERROR);
-
-  return Zone.current.registerBinaryCallback((int errorCode, dynamic result) {
-    JS('', '#(#, #)', protected, errorCode, result);
-  });
-}
-
-/// Implements the runtime support for async* functions.
-///
-/// Called by the transformed function for each original return, await, yield,
-/// yield* and before starting the function.
-///
-/// When the async* function wants to return it calls this function with
-/// [asyncBody] == [async_error_codes.SUCCESS], the asyncStarHelper takes this
-/// as signal to close the stream.
-///
-/// When the async* function wants to signal that an uncaught error was thrown,
-/// it calls this function with [asyncBody] == [async_error_codes.ERROR],
-/// the streamHelper takes this as signal to addError [object] to the
-/// [controller] and close it.
-///
-/// If the async* function wants to do a yield or yield*, it calls this function
-/// with [object] being an [IterationMarker].
-///
-/// In the case of a yield or yield*, if the stream subscription has been
-/// canceled, schedules [asyncBody] to be called with
-/// [async_error_codes.STREAM_WAS_CANCELED].
-///
-/// If [object] is a single-yield [IterationMarker], adds the value of the
-/// [IterationMarker] to the stream. If the stream subscription has been
-/// paused, return early. Otherwise schedule the helper function to be
-/// executed again.
-///
-/// If [object] is a yield-star [IterationMarker], starts listening to the
-/// yielded stream, and adds all events and errors to our own controller (taking
-/// care if the subscription has been paused or canceled) - when the sub-stream
-/// is done, schedules [asyncBody] again.
-///
-/// If the async* function wants to do an await it calls this function with
-/// [object] not an [IterationMarker].
-///
-/// If [object] is not a [Future], it is wrapped in a `Future.value`.
-/// The [asyncBody] is called on completion of the future (see [asyncHelper].
-void _asyncStarHelper(
-    dynamic object,
-    dynamic /* int | _WrappedAsyncBody */ bodyFunctionOrErrorCode,
-    _AsyncStarStreamController controller) {
-  if (identical(bodyFunctionOrErrorCode, async_error_codes.SUCCESS)) {
-    // This happens on return from the async* function.
-    if (controller.isCanceled) {
-      controller.cancelationFuture!._completeWithValue(null);
-    } else {
-      controller.close();
-    }
-    return;
-  } else if (identical(bodyFunctionOrErrorCode, async_error_codes.ERROR)) {
-    // The error is a js-error.
-    if (controller.isCanceled) {
-      controller.cancelationFuture!._completeError(
-          unwrapException(object), getTraceFromException(object));
-    } else {
-      controller.addError(
-          unwrapException(object), getTraceFromException(object));
-      controller.close();
-    }
-    return;
-  }
-
-  if (object is _IterationMarker) {
-    if (controller.isCanceled) {
-      bodyFunctionOrErrorCode(async_error_codes.STREAM_WAS_CANCELED, null);
-      return;
-    }
-    if (object.state == _IterationMarker.YIELD_SINGLE) {
-      controller.add(object.value);
-
-      scheduleMicrotask(() {
-        if (controller.isPaused) {
-          // We only suspend the thread inside the microtask in order to allow
-          // listeners on the output stream to pause in response to the just
-          // output value, and have the stream immediately stop producing.
-          controller.isSuspended = true;
-          return;
-        }
-        bodyFunctionOrErrorCode(null, async_error_codes.SUCCESS);
-      });
-      return;
-    } else if (object.state == _IterationMarker.YIELD_STAR) {
-      Stream stream = object.value;
-      // Errors of [stream] are passed though to the main stream. (see
-      // [AsyncStreamController.addStream]).
-      // TODO(sigurdm): The spec is not very clear here. Clarify with Gilad.
-      controller.addStream(stream).then((_) {
-        // No check for isPaused here because the spec 17.16.2 only
-        // demands checks *before* each element in [stream] not after the last
-        // one. On the other hand we check for isCanceled, as that check happens
-        // after insertion of each element.
-        int errorCode = controller.isCanceled
-            ? async_error_codes.STREAM_WAS_CANCELED
-            : async_error_codes.SUCCESS;
-        bodyFunctionOrErrorCode(errorCode, null);
-      });
-      return;
-    }
-  }
-
-  _awaitOnObject(object, bodyFunctionOrErrorCode);
-}
-
-Stream _streamOfController(_AsyncStarStreamController controller) {
-  return controller.stream;
-}
-
-/// A wrapper around a [StreamController] that keeps track of the state of
-/// the execution of an async* function.
-/// It can be in 1 of 3 states:
-///
-/// - running/scheduled
-/// - suspended
-/// - canceled
-///
-/// If yielding while the subscription is paused it will become suspended. And
-/// only resume after the subscription is resumed or canceled.
-class _AsyncStarStreamController<T> {
-  late StreamController<T> controller;
-  Stream get stream => controller.stream;
-
-  /// True when the async* function has yielded while being paused.
-  /// When true execution will only resume after a `onResume` or `onCancel`
-  /// event.
-  bool isSuspended = false;
-
-  bool get isPaused => controller.isPaused;
-
-  _Future? cancelationFuture = null;
-
-  /// True after the StreamSubscription has been cancelled.
-  /// When this is true, errors thrown from the async* body should go to the
-  /// [cancelationFuture] instead of adding them to [controller], and
-  /// returning from the async function should complete [cancelationFuture].
-  bool get isCanceled => cancelationFuture != null;
-
-  add(event) => controller.add(event);
-
-  addStream(Stream<T> stream) {
-    return controller.addStream(stream, cancelOnError: false);
-  }
-
-  addError(error, stackTrace) => controller.addError(error, stackTrace);
-
-  close() => controller.close();
-
-  _AsyncStarStreamController(_WrappedAsyncBody body) {
-    _resumeBody() {
-      scheduleMicrotask(() {
-        body(async_error_codes.SUCCESS, null);
-      });
-    }
-
-    controller = new StreamController<T>(onListen: () {
-      _resumeBody();
-    }, onResume: () {
-      // Only schedule again if the async* function actually is suspended.
-      // Resume directly instead of scheduling, so that the sequence
-      // `pause-resume-pause` will result in one extra event produced.
-      if (isSuspended) {
-        isSuspended = false;
-        _resumeBody();
-      }
-    }, onCancel: () {
-      // If the async* is finished we ignore cancel events.
-      if (!controller.isClosed) {
-        cancelationFuture = new _Future();
-        if (isSuspended) {
-          // Resume the suspended async* function to run finalizers.
-          isSuspended = false;
-          scheduleMicrotask(() {
-            body(async_error_codes.STREAM_WAS_CANCELED, null);
-          });
-        }
-        return cancelationFuture;
-      }
-    });
-  }
-}
-
-/// Creates a stream controller for an `async*` function.
-///
-/// Used as part of the runtime support for the async/await transformation.
-_makeAsyncStarStreamController<T>(_WrappedAsyncBody body) {
-  return new _AsyncStarStreamController<T>(body);
-}
-
-class _IterationMarker {
-  static const YIELD_SINGLE = 0;
-  static const YIELD_STAR = 1;
-  static const ITERATION_ENDED = 2;
-  static const UNCAUGHT_ERROR = 3;
-
-  final value;
-  final int state;
-
-  const _IterationMarker._(this.state, this.value);
-
-  static yieldStar(dynamic /* Iterable or Stream */ values) {
-    return new _IterationMarker._(YIELD_STAR, values);
-  }
-
-  static endOfIteration() {
-    return const _IterationMarker._(ITERATION_ENDED, null);
-  }
-
-  static yieldSingle(dynamic value) {
-    return new _IterationMarker._(YIELD_SINGLE, value);
-  }
-
-  static uncaughtError(dynamic error) {
-    return new _IterationMarker._(UNCAUGHT_ERROR, error);
-  }
-
-  toString() => "IterationMarker($state, $value)";
-}
-
-class _SyncStarIterator<T> implements Iterator<T> {
-  // _SyncStarIterator handles stepping a sync* generator body state machine.
-  //
-  // It also handles the stepping over 'nested' iterators to flatten yield*
-  // statements. For non-sync* iterators, [_nestedIterator] contains the
-  // iterator. We delegate to [_nestedIterator] when it is not `null`.
-  //
-  // For nested sync* iterators, [this] iterator acts on behalf of the innermost
-  // nested sync* iterator. The current state machine is suspended on a stack
-  // until the inner state machine ends.
-
-  // The state machine for the innermost _SyncStarIterator.
-  dynamic _body;
-
-  // The current value, unless iterating a non-sync* nested iterator.
-  T? _current = null;
-
-  // This is the nested iterator when iterating a yield* of a non-sync iterator.
-  Iterator<T>? _nestedIterator = null;
-
-  // Stack of suspended state machines when iterating a yield* of a sync*
-  // iterator.
-  List? _suspendedBodies = null;
-
-  _SyncStarIterator(this._body);
-
-  T get current {
-    var nested = _nestedIterator;
-    if (nested == null) return _current as dynamic; // implicit: as T;
-    return nested.current;
-  }
-
-  _runBody() {
-    // TODO(sra): Find a way to hard-wire SUCCESS and ERROR codes.
-    return JS(
-        '',
-        '''
-        // Invokes [body] with [errorCode] and [result].
-        //
-        // If (and as long as) the invocation throws, calls [function] again,
-        // with an error-code.
-        (function(body, SUCCESS, ERROR) {
-          var errorValue, errorCode = SUCCESS;
-          while (true) {
-            try {
-              return body(errorCode, errorValue);
-            } catch (error) {
-              errorValue = error;
-              errorCode = ERROR;
-            }
-          }
-        })(#, #, #)''',
-        _body,
-        async_error_codes.SUCCESS,
-        async_error_codes.ERROR);
-  }
-
-  bool moveNext() {
-    while (true) {
-      if (_nestedIterator != null) {
-        if (_nestedIterator!.moveNext()) {
-          return true;
-        } else {
-          _nestedIterator = null;
-        }
-      }
-      var value = _runBody();
-      if (value is _IterationMarker) {
-        int state = value.state;
-        if (state == _IterationMarker.ITERATION_ENDED) {
-          var suspendedBodies = _suspendedBodies;
-          if (suspendedBodies == null || suspendedBodies.isEmpty) {
-            _current = null;
-            // Rely on [_body] to repeatedly return `ITERATION_ENDED`.
-            return false;
-          }
-          // Resume the innermost suspended iterator.
-          _body = suspendedBodies.removeLast();
-          continue;
-        } else if (state == _IterationMarker.UNCAUGHT_ERROR) {
-          // Rely on [_body] to repeatedly return `UNCAUGHT_ERROR`.
-          // This is a wrapped exception, so we use JavaScript throw to throw
-          // it.
-          JS('', 'throw #', value.value);
-        } else {
-          assert(state == _IterationMarker.YIELD_STAR);
-          Iterator<T> inner = value.value.iterator;
-          if (inner is _SyncStarIterator) {
-            // The test needs to be 'is _SyncStarIterator<T>' for promotion to
-            // work. However, that test is much more expensive, so we use an
-            // unsafe cast.
-            _SyncStarIterator<T> innerSyncStarIterator = JS('', '#', inner);
-            // Suspend the current state machine and start acting on behalf of
-            // the nested state machine.
-            //
-            // TODO(sra): Recognize "tail yield*" statements and avoid
-            // suspending the current body when all it will do is step without
-            // effect to ITERATION_ENDED.
-            (_suspendedBodies ??= []).add(_body);
-            _body = innerSyncStarIterator._body;
-            continue;
-          } else {
-            _nestedIterator = inner;
-            // TODO(32956): Change to the following when strong-mode is the only
-            // option:
-            //
-            //     _nestedIterator = JS<Iterator<T>>('','#', inner);
-            continue;
-          }
-        }
-      } else {
-        // TODO(32956): Remove this test.
-        _current = JS<T>('', '#', value);
-        return true;
-      }
-    }
-    return false; // TODO(sra): Fix type inference so that this is not needed.
-  }
-}
-
-/// Creates an Iterable for a `sync*` function.
-///
-/// Used as part of the runtime support for the async/await transformation.
-_SyncStarIterable<T> _makeSyncStarIterable<T>(body) {
-  return new _SyncStarIterable<T>(body);
-}
-
-/// An Iterable corresponding to a sync* method.
-///
-/// Each invocation of a sync* method will return a new instance of this class.
-class _SyncStarIterable<T> extends IterableBase<T> {
-  // This is a function that will return a helper function that does the
-  // iteration of the sync*.
-  //
-  // Each invocation should give a body with fresh state.
-  final dynamic /* js function */ _outerHelper;
-
-  _SyncStarIterable(this._outerHelper);
-
-  Iterator<T> get iterator =>
-      new _SyncStarIterator<T>(JS('', '#()', _outerHelper));
-}
-
-@patch
-void _rethrow(Object error, StackTrace stackTrace) {
-  error = wrapException(error);
-  JS('void', '#.stack = #', error, stackTrace.toString());
-  JS('void', 'throw #', error);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/collection_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/collection_patch.dart
deleted file mode 100644
index a1d76bf..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/collection_patch.dart
+++ /dev/null
@@ -1,1716 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// Patch file for dart:collection classes.
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper'
-    show
-        fillLiteralMap,
-        fillLiteralSet,
-        InternalMap,
-        NoInline,
-        NoSideEffects,
-        NoThrows,
-        patch,
-        JsLinkedHashMap,
-        LinkedHashMapCell,
-        LinkedHashMapKeyIterable,
-        LinkedHashMapKeyIterator;
-
-import 'dart:_internal' hide Symbol;
-
-const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps");
-
-const int _mask30 = 0x3fffffff; // Low 30 bits.
-
-@patch
-class HashMap<K, V> {
-  @patch
-  factory HashMap(
-      {bool equals(K key1, K key2)?,
-      int hashCode(K key)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _HashMap<K, V>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _IdentityHashMap<K, V>();
-        }
-        if (equals == null) {
-          equals = _defaultEquals;
-        }
-      }
-    } else {
-      if (hashCode == null) {
-        hashCode = _defaultHashCode;
-      }
-      if (equals == null) {
-        equals = _defaultEquals;
-      }
-    }
-    return new _CustomHashMap<K, V>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory HashMap.identity() = _IdentityHashMap<K, V>;
-}
-
-class _HashMap<K, V> extends MapBase<K, V> implements HashMap<K, V> {
-  int _length = 0;
-
-  // The hash map contents are divided into three parts: one part for
-  // string keys, one for numeric keys, and one for the rest. String
-  // and numeric keys map directly to their values, but the rest of
-  // the entries are stored in bucket lists of the form:
-  //
-  //    [key-0, value-0, key-1, value-1, ...]
-  //
-  // where all keys in the same bucket share the same hash code.
-  var _strings;
-  var _nums;
-  var _rest;
-
-  // When iterating over the hash map, it is very convenient to have a
-  // list of all the keys. We cache that on the instance and clear the
-  // the cache whenever the key set changes. This is also used to
-  // guard against concurrent modifications.
-  List? _keys;
-
-  _HashMap();
-
-  int get length => _length;
-  bool get isEmpty => _length == 0;
-  bool get isNotEmpty => !isEmpty;
-
-  Iterable<K> get keys {
-    return new _HashMapKeyIterable<K>(this);
-  }
-
-  Iterable<V> get values {
-    return new MappedIterable<K, V>(keys, (each) => this[each] as V);
-  }
-
-  bool containsKey(Object? key) {
-    if (_isStringKey(key)) {
-      var strings = _strings;
-      return (strings == null) ? false : _hasTableEntry(strings, key);
-    } else if (_isNumericKey(key)) {
-      var nums = _nums;
-      return (nums == null) ? false : _hasTableEntry(nums, key);
-    } else {
-      return _containsKey(key);
-    }
-  }
-
-  bool _containsKey(Object? key) {
-    var rest = _rest;
-    if (rest == null) return false;
-    var bucket = _getBucket(rest, key);
-    return _findBucketIndex(bucket, key) >= 0;
-  }
-
-  bool containsValue(Object? value) {
-    return _computeKeys().any((each) => this[each] == value);
-  }
-
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      this[key] = value;
-    });
-  }
-
-  V? operator [](Object? key) {
-    if (_isStringKey(key)) {
-      var strings = _strings;
-      return JS('', '#', strings == null ? null : _getTableEntry(strings, key));
-    } else if (_isNumericKey(key)) {
-      var nums = _nums;
-      return JS('', '#', nums == null ? null : _getTableEntry(nums, key));
-    } else {
-      return _get(key);
-    }
-  }
-
-  V? _get(Object? key) {
-    var rest = _rest;
-    if (rest == null) return null;
-    var bucket = _getBucket(rest, key);
-    int index = _findBucketIndex(bucket, key);
-    return (index < 0) ? null : JS('', '#[#]', bucket, index + 1);
-  }
-
-  void operator []=(K key, V value) {
-    if (_isStringKey(key)) {
-      var strings = _strings;
-      if (strings == null) _strings = strings = _newHashTable();
-      _addHashTableEntry(strings, key, value);
-    } else if (_isNumericKey(key)) {
-      var nums = _nums;
-      if (nums == null) _nums = nums = _newHashTable();
-      _addHashTableEntry(nums, key, value);
-    } else {
-      _set(key, value);
-    }
-  }
-
-  void _set(K key, V value) {
-    var rest = _rest;
-    if (rest == null) _rest = rest = _newHashTable();
-    var hash = _computeHashCode(key);
-    var bucket = JS('var', '#[#]', rest, hash);
-    if (bucket == null) {
-      _setTableEntry(rest, hash, JS('var', '[#, #]', key, value));
-      _length++;
-      _keys = null;
-    } else {
-      int index = _findBucketIndex(bucket, key);
-      if (index >= 0) {
-        JS('void', '#[#] = #', bucket, index + 1, value);
-      } else {
-        JS('void', '#.push(#, #)', bucket, key, value);
-        _length++;
-        _keys = null;
-      }
-    }
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) return this[key] as V;
-    V value = ifAbsent();
-    this[key] = value;
-    return value;
-  }
-
-  V? remove(Object? key) {
-    if (_isStringKey(key)) {
-      return _removeHashTableEntry(_strings, key);
-    } else if (_isNumericKey(key)) {
-      return _removeHashTableEntry(_nums, key);
-    } else {
-      return _remove(key);
-    }
-  }
-
-  V? _remove(Object? key) {
-    var rest = _rest;
-    if (rest == null) return null;
-    var hash = _computeHashCode(key);
-    var bucket = JS('var', '#[#]', rest, hash);
-    int index = _findBucketIndex(bucket, key);
-    if (index < 0) return null;
-    _length--;
-    _keys = null;
-    // Use splice to remove the two [key, value] elements at the index and
-    // return the value.
-    V result = JS('', '#.splice(#, 2)[1]', bucket, index);
-    if (0 == JS('int', '#.length', bucket)) {
-      _deleteTableEntry(rest, hash);
-    }
-    return result;
-  }
-
-  void clear() {
-    if (_length > 0) {
-      _strings = _nums = _rest = _keys = null;
-      _length = 0;
-    }
-  }
-
-  void forEach(void action(K key, V value)) {
-    List keys = _computeKeys();
-    for (int i = 0, length = keys.length; i < length; i++) {
-      var key = JS('var', '#[#]', keys, i);
-      action(key, this[key] as V);
-      if (JS('bool', '# !== #', keys, _keys)) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-  }
-
-  List _computeKeys() {
-    var result = _keys;
-    if (result != null) return result;
-    result = List.filled(_length, null);
-    int index = 0;
-
-    // Add all string keys to the list.
-    var strings = _strings;
-    if (strings != null) {
-      var names = JS('var', 'Object.getOwnPropertyNames(#)', strings);
-      int entries = JS('int', '#.length', names);
-      for (int i = 0; i < entries; i++) {
-        String key = JS('String', '#[#]', names, i);
-        JS('void', '#[#] = #', result, index, key);
-        index++;
-      }
-    }
-
-    // Add all numeric keys to the list.
-    var nums = _nums;
-    if (nums != null) {
-      var names = JS('var', 'Object.getOwnPropertyNames(#)', nums);
-      int entries = JS('int', '#.length', names);
-      for (int i = 0; i < entries; i++) {
-        // Object.getOwnPropertyNames returns a list of strings, so we
-        // have to convert the keys back to numbers (+).
-        num key = JS('num', '+#[#]', names, i);
-        JS('void', '#[#] = #', result, index, key);
-        index++;
-      }
-    }
-
-    // Add all the remaining keys to the list.
-    var rest = _rest;
-    if (rest != null) {
-      var names = JS('var', 'Object.getOwnPropertyNames(#)', rest);
-      int entries = JS('int', '#.length', names);
-      for (int i = 0; i < entries; i++) {
-        var key = JS('String', '#[#]', names, i);
-        var bucket = JS('var', '#[#]', rest, key);
-        int length = JS('int', '#.length', bucket);
-        for (int i = 0; i < length; i += 2) {
-          var key = JS('var', '#[#]', bucket, i);
-          JS('void', '#[#] = #', result, index, key);
-          index++;
-        }
-      }
-    }
-    assert(index == _length);
-    _keys = result;
-    return result;
-  }
-
-  void _addHashTableEntry(var table, K key, V value) {
-    if (!_hasTableEntry(table, key)) {
-      _length++;
-      _keys = null;
-    }
-    _setTableEntry(table, key, value);
-  }
-
-  V? _removeHashTableEntry(var table, Object? key) {
-    if (table != null && _hasTableEntry(table, key)) {
-      V value = _getTableEntry(table, key);
-      _deleteTableEntry(table, key);
-      _length--;
-      _keys = null;
-      return value;
-    } else {
-      return null;
-    }
-  }
-
-  static bool _isStringKey(var key) {
-    return key is String && key != '__proto__';
-  }
-
-  static bool _isNumericKey(var key) {
-    // Only treat unsigned 30-bit integers as numeric keys. This way,
-    // we avoid converting them to strings when we use them as keys in
-    // the JavaScript hash table object.
-    return key is num && JS('bool', '(# & #) === #', key, _mask30, key);
-  }
-
-  int _computeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', key.hashCode, _mask30);
-  }
-
-  static bool _hasTableEntry(var table, var key) {
-    var entry = JS('var', '#[#]', table, key);
-    // We take care to only store non-null entries in the table, so we
-    // can check if the table has an entry for the given key with a
-    // simple null check.
-    return entry != null;
-  }
-
-  static _getTableEntry(var table, var key) {
-    var entry = JS('var', '#[#]', table, key);
-    // We store the table itself as the entry to signal that it really
-    // is a null value, so we have to map back to null here.
-    return JS('bool', '# === #', entry, table) ? null : entry;
-  }
-
-  static void _setTableEntry(var table, var key, var value) {
-    // We only store non-null entries in the table, so we have to
-    // change null values to refer to the table itself. Such values
-    // will be recognized and mapped back to null on access.
-    if (value == null) {
-      // Do not update [value] with [table], otherwise our
-      // optimizations could be confused by this opaque object being
-      // now used for more things than storing and fetching from it.
-      JS('void', '#[#] = #', table, key, table);
-    } else {
-      JS('void', '#[#] = #', table, key, value);
-    }
-  }
-
-  static void _deleteTableEntry(var table, var key) {
-    JS('void', 'delete #[#]', table, key);
-  }
-
-  List _getBucket(var table, var key) {
-    var hash = _computeHashCode(key);
-    return JS('var', '#[#]', table, hash);
-  }
-
-  int _findBucketIndex(var bucket, var key) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i += 2) {
-      if (JS('var', '#[#]', bucket, i) == key) return i;
-    }
-    return -1;
-  }
-
-  static _newHashTable() {
-    // Create a new JavaScript object to be used as a hash table. Use
-    // Object.create to avoid the properties on Object.prototype
-    // showing up as entries.
-    var table = JS('var', 'Object.create(null)');
-    // Attempt to force the hash table into 'dictionary' mode by
-    // adding a property to it and deleting it again.
-    var temporaryKey = '<non-identifier-key>';
-    _setTableEntry(table, temporaryKey, table);
-    _deleteTableEntry(table, temporaryKey);
-    return table;
-  }
-}
-
-class _IdentityHashMap<K, V> extends _HashMap<K, V> {
-  int _computeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', identityHashCode(key), _mask30);
-  }
-
-  int _findBucketIndex(var bucket, var key) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i += 2) {
-      if (identical(JS('var', '#[#]', bucket, i), key)) return i;
-    }
-    return -1;
-  }
-}
-
-class _CustomHashMap<K, V> extends _HashMap<K, V> {
-  final _Equality<K> _equals;
-  final _Hasher<K> _hashCode;
-  final _Predicate _validKey;
-
-  _CustomHashMap(this._equals, this._hashCode, bool validKey(potentialKey)?)
-      : _validKey = (validKey != null) ? validKey : ((v) => v is K);
-
-  V? operator [](Object? key) {
-    if (!_validKey(key)) return null;
-    return super._get(key);
-  }
-
-  void operator []=(K key, V value) {
-    super._set(key, value);
-  }
-
-  bool containsKey(Object? key) {
-    if (!_validKey(key)) return false;
-    return super._containsKey(key);
-  }
-
-  V? remove(Object? key) {
-    if (!_validKey(key)) return null;
-    return super._remove(key);
-  }
-
-  int _computeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', _hashCode(key), _mask30);
-  }
-
-  int _findBucketIndex(var bucket, var key) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i += 2) {
-      if (_equals(JS('var', '#[#]', bucket, i), key)) return i;
-    }
-    return -1;
-  }
-}
-
-class _HashMapKeyIterable<E> extends EfficientLengthIterable<E> {
-  final _map;
-  _HashMapKeyIterable(this._map);
-
-  int get length => _map._length;
-  bool get isEmpty => _map._length == 0;
-
-  Iterator<E> get iterator {
-    return new _HashMapKeyIterator<E>(_map, _map._computeKeys());
-  }
-
-  bool contains(Object? element) {
-    return _map.containsKey(element);
-  }
-
-  void forEach(void f(E element)) {
-    List keys = _map._computeKeys();
-    for (int i = 0, length = JS('int', '#.length', keys); i < length; i++) {
-      f(JS('var', '#[#]', keys, i));
-      if (JS('bool', '# !== #', keys, _map._keys)) {
-        throw new ConcurrentModificationError(_map);
-      }
-    }
-  }
-}
-
-class _HashMapKeyIterator<E> implements Iterator<E> {
-  final _map;
-  final List _keys;
-  int _offset = 0;
-  E? _current;
-
-  _HashMapKeyIterator(this._map, this._keys);
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    var keys = _keys;
-    int offset = _offset;
-    if (JS('bool', '# !== #', keys, _map._keys)) {
-      throw new ConcurrentModificationError(_map);
-    } else if (offset >= JS('int', '#.length', keys)) {
-      _current = null;
-      return false;
-    } else {
-      _current = JS('var', '#[#]', keys, offset);
-      // TODO(kasperl): For now, we have to tell the type inferrer to
-      // treat the result of doing offset + 1 as an int. Otherwise, we
-      // get unnecessary bailout code.
-      _offset = JS('int', '#', offset + 1);
-      return true;
-    }
-  }
-}
-
-@patch
-class LinkedHashMap<K, V> {
-  @patch
-  factory LinkedHashMap(
-      {bool equals(K key1, K key2)?,
-      int hashCode(K key)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new JsLinkedHashMap<K, V>.es6();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _LinkedIdentityHashMap<K, V>.es6();
-        }
-        if (equals == null) {
-          equals = _defaultEquals;
-        }
-      }
-    } else {
-      if (hashCode == null) {
-        hashCode = _defaultHashCode;
-      }
-      if (equals == null) {
-        equals = _defaultEquals;
-      }
-    }
-    return new _LinkedCustomHashMap<K, V>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>.es6;
-
-  // Private factory constructor called by generated code for map literals.
-  @pragma('dart2js:noInline')
-  factory LinkedHashMap._literal(List keyValuePairs) {
-    return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>.es6());
-  }
-
-  // Private factory constructor called by generated code for map literals.
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  @pragma('dart2js:noSideEffects')
-  factory LinkedHashMap._empty() {
-    return new JsLinkedHashMap<K, V>.es6();
-  }
-
-  // Private factory static function called by generated code for map literals.
-  // This version is for map literals without type parameters.
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  @pragma('dart2js:noSideEffects')
-  static _makeEmpty() => new JsLinkedHashMap();
-
-  // Private factory static function called by generated code for map literals.
-  // This version is for map literals without type parameters.
-  @pragma('dart2js:noInline')
-  static _makeLiteral(keyValuePairs) =>
-      fillLiteralMap(keyValuePairs, new JsLinkedHashMap());
-}
-
-class _LinkedIdentityHashMap<K, V> extends JsLinkedHashMap<K, V> {
-  static bool get _supportsEs6Maps {
-    return JS('returns:bool;depends:none;effects:none;throws:never;gvn:true',
-        'typeof Map != "undefined"');
-  }
-
-  factory _LinkedIdentityHashMap.es6() {
-    return (_USE_ES6_MAPS && _LinkedIdentityHashMap._supportsEs6Maps)
-        ? new _Es6LinkedIdentityHashMap<K, V>()
-        : new _LinkedIdentityHashMap<K, V>();
-  }
-
-  _LinkedIdentityHashMap();
-
-  int internalComputeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', identityHashCode(key), _mask30);
-  }
-
-  int internalFindBucketIndex(var bucket, var key) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      LinkedHashMapCell cell = JS('var', '#[#]', bucket, i);
-      if (identical(cell.hashMapCellKey, key)) return i;
-    }
-    return -1;
-  }
-}
-
-class _Es6LinkedIdentityHashMap<K, V> extends _LinkedIdentityHashMap<K, V>
-    implements InternalMap {
-  final _map;
-  int _modifications = 0;
-
-  _Es6LinkedIdentityHashMap() : _map = JS('var', 'new Map()');
-
-  int get length => JS('int', '#.size', _map);
-  bool get isEmpty => length == 0;
-  bool get isNotEmpty => !isEmpty;
-
-  Iterable<K> get keys => new _Es6MapIterable<K>(this, true);
-
-  Iterable<V> get values => new _Es6MapIterable<V>(this, false);
-
-  bool containsKey(Object? key) {
-    return JS('bool', '#.has(#)', _map, key);
-  }
-
-  bool containsValue(Object? value) {
-    return values.any((each) => each == value);
-  }
-
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      this[key] = value;
-    });
-  }
-
-  V? operator [](Object? key) {
-    return JS('var', '#.get(#)', _map, key);
-  }
-
-  void operator []=(K key, V value) {
-    JS('var', '#.set(#, #)', _map, key, value);
-    _modified();
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) return this[key] as V;
-    V value = ifAbsent();
-    this[key] = value;
-    return value;
-  }
-
-  V? remove(Object? key) {
-    V? value = this[key];
-    JS('bool', '#.delete(#)', _map, key);
-    _modified();
-    return value;
-  }
-
-  void clear() {
-    JS('void', '#.clear()', _map);
-    _modified();
-  }
-
-  void forEach(void action(K key, V value)) {
-    var jsEntries = JS('var', '#.entries()', _map);
-    int modifications = _modifications;
-    while (true) {
-      var next = JS('var', '#.next()', jsEntries);
-      bool done = JS('bool', '#.done', next);
-      if (done) break;
-      var entry = JS('var', '#.value', next);
-      var key = JS('var', '#[0]', entry);
-      var value = JS('var', '#[1]', entry);
-      action(key, value);
-      if (modifications != _modifications) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-  }
-
-  void _modified() {
-    // Value cycles after 2^30 modifications so that modification counts are
-    // always unboxed (Smi) values. Modification detection will be missed if you
-    // make exactly some multiple of 2^30 modifications between advances of an
-    // iterator.
-    _modifications = _mask30 & (_modifications + 1);
-  }
-}
-
-class _Es6MapIterable<E> extends EfficientLengthIterable<E> {
-  final _map;
-  final bool _isKeys;
-
-  _Es6MapIterable(this._map, this._isKeys);
-
-  int get length => _map.length;
-  bool get isEmpty => _map.isEmpty;
-
-  Iterator<E> get iterator =>
-      new _Es6MapIterator<E>(_map, _map._modifications, _isKeys);
-
-  bool contains(Object? element) => _map.containsKey(element);
-
-  void forEach(void f(E element)) {
-    var jsIterator;
-    if (_isKeys) {
-      jsIterator = JS('var', '#.keys()', _map._map);
-    } else {
-      jsIterator = JS('var', '#.values()', _map._map);
-    }
-    int modifications = _map._modifications;
-    while (true) {
-      var next = JS('var', '#.next()', jsIterator);
-      bool done = JS('bool', '#.done', next);
-      if (done) break;
-      var value = JS('var', '#.value', next);
-      f(value);
-      if (modifications != _map._modifications) {
-        throw new ConcurrentModificationError(_map);
-      }
-    }
-  }
-}
-
-class _Es6MapIterator<E> implements Iterator<E> {
-  final _map;
-  final int _modifications;
-  final bool _isKeys;
-  var _jsIterator;
-  var _next;
-  E? _current;
-  bool _done = false;
-
-  _Es6MapIterator(this._map, this._modifications, this._isKeys) {
-    if (_isKeys) {
-      _jsIterator = JS('var', '#.keys()', _map._map);
-    } else {
-      _jsIterator = JS('var', '#.values()', _map._map);
-    }
-  }
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    if (_modifications != _map._modifications) {
-      throw new ConcurrentModificationError(_map);
-    }
-    if (_done) return false;
-    _next = JS('var', '#.next()', _jsIterator);
-    bool done = JS('bool', '#.done', _next);
-    if (done) {
-      _current = null;
-      _done = true;
-      return false;
-    } else {
-      _current = JS('var', '#.value', _next);
-      return true;
-    }
-  }
-}
-
-// TODO(floitsch): use ES6 maps when available.
-class _LinkedCustomHashMap<K, V> extends JsLinkedHashMap<K, V> {
-  final _Equality<K> _equals;
-  final _Hasher<K> _hashCode;
-  final _Predicate _validKey;
-
-  _LinkedCustomHashMap(
-      this._equals, this._hashCode, bool validKey(potentialKey)?)
-      : _validKey = (validKey != null) ? validKey : ((v) => v is K);
-
-  V? operator [](Object? key) {
-    if (!_validKey(key)) return null;
-    return super.internalGet(key);
-  }
-
-  void operator []=(K key, V value) {
-    super.internalSet(key, value);
-  }
-
-  bool containsKey(Object? key) {
-    if (!_validKey(key)) return false;
-    return super.internalContainsKey(key);
-  }
-
-  V? remove(Object? key) {
-    if (!_validKey(key)) return null;
-    return super.internalRemove(key);
-  }
-
-  int internalComputeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', _hashCode(key), _mask30);
-  }
-
-  int internalFindBucketIndex(var bucket, var key) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      LinkedHashMapCell cell = JS('var', '#[#]', bucket, i);
-      if (_equals(cell.hashMapCellKey, key)) return i;
-    }
-    return -1;
-  }
-}
-
-@patch
-class HashSet<E> {
-  @patch
-  factory HashSet(
-      {bool equals(E e1, E e2)?,
-      int hashCode(E e)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _HashSet<E>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _IdentityHashSet<E>();
-        }
-        if (equals == null) {
-          equals = _defaultEquals;
-        }
-      }
-    } else {
-      if (hashCode == null) {
-        hashCode = _defaultHashCode;
-      }
-      if (equals == null) {
-        equals = _defaultEquals;
-      }
-    }
-    return new _CustomHashSet<E>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory HashSet.identity() = _IdentityHashSet<E>;
-}
-
-class _HashSet<E> extends _SetBase<E> implements HashSet<E> {
-  int _length = 0;
-
-  // The hash set contents are divided into three parts: one part for
-  // string elements, one for numeric elements, and one for the
-  // rest. String and numeric elements map directly to a sentinel
-  // value, but the rest of the entries are stored in bucket lists of
-  // the form:
-  //
-  //    [element-0, element-1, element-2, ...]
-  //
-  // where all elements in the same bucket share the same hash code.
-  var _strings;
-  var _nums;
-  var _rest;
-
-  // When iterating over the hash set, it is very convenient to have a
-  // list of all the elements. We cache that on the instance and clear
-  // the cache whenever the set changes. This is also used to
-  // guard against concurrent modifications.
-  List? _elements;
-
-  _HashSet();
-
-  Set<E> _newSet() => new _HashSet<E>();
-  Set<R> _newSimilarSet<R>() => new _HashSet<R>();
-
-  // Iterable.
-  Iterator<E> get iterator {
-    return new _HashSetIterator<E>(this, _computeElements());
-  }
-
-  int get length => _length;
-  bool get isEmpty => _length == 0;
-  bool get isNotEmpty => !isEmpty;
-
-  bool contains(Object? object) {
-    if (_isStringElement(object)) {
-      var strings = _strings;
-      return (strings == null) ? false : _hasTableEntry(strings, object);
-    } else if (_isNumericElement(object)) {
-      var nums = _nums;
-      return (nums == null) ? false : _hasTableEntry(nums, object);
-    } else {
-      return _contains(object);
-    }
-  }
-
-  bool _contains(Object? object) {
-    var rest = _rest;
-    if (rest == null) return false;
-    var bucket = _getBucket(rest, object);
-    return _findBucketIndex(bucket, object) >= 0;
-  }
-
-  E? lookup(Object? object) {
-    if (_isStringElement(object) || _isNumericElement(object)) {
-      return this.contains(object) ? object as E : null;
-    }
-    return _lookup(object);
-  }
-
-  E? _lookup(Object? object) {
-    var rest = _rest;
-    if (rest == null) return null;
-    var bucket = _getBucket(rest, object);
-    var index = _findBucketIndex(bucket, object);
-    if (index < 0) return null;
-    return bucket[index];
-  }
-
-  // Collection.
-  bool add(E element) {
-    if (_isStringElement(element)) {
-      var strings = _strings;
-      if (strings == null) _strings = strings = _newHashTable();
-      return _addHashTableEntry(strings, element);
-    } else if (_isNumericElement(element)) {
-      var nums = _nums;
-      if (nums == null) _nums = nums = _newHashTable();
-      return _addHashTableEntry(nums, element);
-    } else {
-      return _add(element);
-    }
-  }
-
-  bool _add(E element) {
-    var rest = _rest;
-    if (rest == null) _rest = rest = _newHashTable();
-    var hash = _computeHashCode(element);
-    var bucket = JS('var', '#[#]', rest, hash);
-    if (bucket == null) {
-      _setTableEntry(rest, hash, JS('var', '[#]', element));
-    } else {
-      int index = _findBucketIndex(bucket, element);
-      if (index >= 0) return false;
-      JS('void', '#.push(#)', bucket, element);
-    }
-    _length++;
-    _elements = null;
-    return true;
-  }
-
-  void addAll(Iterable<E> objects) {
-    for (E each in objects) {
-      add(each);
-    }
-  }
-
-  bool remove(Object? object) {
-    if (_isStringElement(object)) {
-      return _removeHashTableEntry(_strings, object);
-    } else if (_isNumericElement(object)) {
-      return _removeHashTableEntry(_nums, object);
-    } else {
-      return _remove(object);
-    }
-  }
-
-  bool _remove(Object? object) {
-    var rest = _rest;
-    if (rest == null) return false;
-    var hash = _computeHashCode(object);
-    var bucket = JS('var', '#[#]', rest, hash);
-    int index = _findBucketIndex(bucket, object);
-    if (index < 0) return false;
-    // TODO(kasperl): Consider getting rid of the bucket list when
-    // the length reaches zero.
-    _length--;
-    _elements = null;
-    // TODO(kasperl): It would probably be faster to move the element to the end
-    // and reduce the length of the bucket list.
-    JS('void', '#.splice(#, 1)', bucket, index);
-    if (0 == JS('int', '#.length', bucket)) {
-      _deleteTableEntry(rest, hash);
-    }
-    return true;
-  }
-
-  void clear() {
-    if (_length > 0) {
-      _strings = _nums = _rest = _elements = null;
-      _length = 0;
-    }
-  }
-
-  List _computeElements() {
-    var result = _elements;
-    if (result != null) return result;
-    result = List.filled(_length, null);
-    int index = 0;
-
-    // Add all string elements to the list.
-    var strings = _strings;
-    if (strings != null) {
-      var names = JS('var', 'Object.getOwnPropertyNames(#)', strings);
-      int entries = JS('int', '#.length', names);
-      for (int i = 0; i < entries; i++) {
-        String element = JS('String', '#[#]', names, i);
-        JS('void', '#[#] = #', result, index, element);
-        index++;
-      }
-    }
-
-    // Add all numeric elements to the list.
-    var nums = _nums;
-    if (nums != null) {
-      var names = JS('var', 'Object.getOwnPropertyNames(#)', nums);
-      int entries = JS('int', '#.length', names);
-      for (int i = 0; i < entries; i++) {
-        // Object.getOwnPropertyNames returns a list of strings, so we
-        // have to convert the elements back to numbers (+).
-        num element = JS('num', '+#[#]', names, i);
-        JS('void', '#[#] = #', result, index, element);
-        index++;
-      }
-    }
-
-    // Add all the remaining elements to the list.
-    var rest = _rest;
-    if (rest != null) {
-      var names = JS('var', 'Object.getOwnPropertyNames(#)', rest);
-      int entries = JS('int', '#.length', names);
-      for (int i = 0; i < entries; i++) {
-        var entry = JS('String', '#[#]', names, i);
-        var bucket = JS('var', '#[#]', rest, entry);
-        int length = JS('int', '#.length', bucket);
-        for (int i = 0; i < length; i++) {
-          JS('void', '#[#] = #[#]', result, index, bucket, i);
-          index++;
-        }
-      }
-    }
-    assert(index == _length);
-    _elements = result;
-    return result;
-  }
-
-  bool _addHashTableEntry(var table, E element) {
-    if (_hasTableEntry(table, element)) return false;
-    _setTableEntry(table, element, 0);
-    _length++;
-    _elements = null;
-    return true;
-  }
-
-  bool _removeHashTableEntry(var table, Object? element) {
-    if (table != null && _hasTableEntry(table, element)) {
-      _deleteTableEntry(table, element);
-      _length--;
-      _elements = null;
-      return true;
-    } else {
-      return false;
-    }
-  }
-
-  static bool _isStringElement(var element) {
-    return element is String && element != '__proto__';
-  }
-
-  static bool _isNumericElement(var element) {
-    // Only treat unsigned 30-bit integers as numeric elements. This
-    // way, we avoid converting them to strings when we use them as
-    // keys in the JavaScript hash table object.
-    return element is num &&
-        JS('bool', '(# & #) === #', element, _mask30, element);
-  }
-
-  int _computeHashCode(var element) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic elements like '__proto__'. Another
-    // option would be to throw an exception if the hash code isn't a
-    // number.
-    return JS('int', '# & #', element.hashCode, _mask30);
-  }
-
-  static bool _hasTableEntry(var table, var key) {
-    var entry = JS('var', '#[#]', table, key);
-    // We take care to only store non-null entries in the table, so we
-    // can check if the table has an entry for the given key with a
-    // simple null check.
-    return entry != null;
-  }
-
-  static void _setTableEntry(var table, var key, var value) {
-    assert(value != null);
-    JS('void', '#[#] = #', table, key, value);
-  }
-
-  static void _deleteTableEntry(var table, var key) {
-    JS('void', 'delete #[#]', table, key);
-  }
-
-  List _getBucket(var table, var element) {
-    var hash = _computeHashCode(element);
-    return JS('var', '#[#]', table, hash);
-  }
-
-  int _findBucketIndex(var bucket, var element) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      if (JS('var', '#[#]', bucket, i) == element) return i;
-    }
-    return -1;
-  }
-
-  static _newHashTable() {
-    // Create a new JavaScript object to be used as a hash table. Use
-    // Object.create to avoid the properties on Object.prototype
-    // showing up as entries.
-    var table = JS('var', 'Object.create(null)');
-    // Attempt to force the hash table into 'dictionary' mode by
-    // adding a property to it and deleting it again.
-    var temporaryKey = '<non-identifier-key>';
-    _setTableEntry(table, temporaryKey, table);
-    _deleteTableEntry(table, temporaryKey);
-    return table;
-  }
-}
-
-class _IdentityHashSet<E> extends _HashSet<E> {
-  Set<E> _newSet() => new _IdentityHashSet<E>();
-  Set<R> _newSimilarSet<R>() => new _IdentityHashSet<R>();
-
-  int _computeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', identityHashCode(key), _mask30);
-  }
-
-  int _findBucketIndex(var bucket, var element) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      if (identical(JS('var', '#[#]', bucket, i), element)) return i;
-    }
-    return -1;
-  }
-}
-
-class _CustomHashSet<E> extends _HashSet<E> {
-  _Equality<E> _equality;
-  _Hasher<E> _hasher;
-  _Predicate _validKey;
-  _CustomHashSet(this._equality, this._hasher, bool validKey(potentialKey)?)
-      : _validKey = (validKey != null) ? validKey : ((x) => x is E);
-
-  Set<E> _newSet() => new _CustomHashSet<E>(_equality, _hasher, _validKey);
-  Set<R> _newSimilarSet<R>() => new _HashSet<R>();
-
-  int _findBucketIndex(var bucket, var element) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      if (_equality(JS('var', '#[#]', bucket, i), element)) return i;
-    }
-    return -1;
-  }
-
-  int _computeHashCode(var element) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic elements like '__proto__'. Another
-    // option would be to throw an exception if the hash code isn't a
-    // number.
-    return JS('int', '# & #', _hasher(element), _mask30);
-  }
-
-  bool add(E object) => super._add(object);
-
-  bool contains(Object? object) {
-    if (!_validKey(object)) return false;
-    return super._contains(object);
-  }
-
-  E? lookup(Object? object) {
-    if (!_validKey(object)) return null;
-    return super._lookup(object);
-  }
-
-  bool remove(Object? object) {
-    if (!_validKey(object)) return false;
-    return super._remove(object);
-  }
-}
-
-// TODO(kasperl): Share this code with _HashMapKeyIterator<E>?
-class _HashSetIterator<E> implements Iterator<E> {
-  final _set;
-  final List _elements;
-  int _offset = 0;
-  E? _current;
-
-  _HashSetIterator(this._set, this._elements);
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    var elements = _elements;
-    int offset = _offset;
-    if (JS('bool', '# !== #', elements, _set._elements)) {
-      throw new ConcurrentModificationError(_set);
-    } else if (offset >= JS('int', '#.length', elements)) {
-      _current = null;
-      return false;
-    } else {
-      _current = JS('var', '#[#]', elements, offset);
-      // TODO(kasperl): For now, we have to tell the type inferrer to
-      // treat the result of doing offset + 1 as an int. Otherwise, we
-      // get unnecessary bailout code.
-      _offset = JS('int', '#', offset + 1);
-      return true;
-    }
-  }
-}
-
-@patch
-class LinkedHashSet<E> {
-  @patch
-  factory LinkedHashSet(
-      {bool equals(E e1, E e2)?,
-      int hashCode(E e)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _LinkedHashSet<E>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _LinkedIdentityHashSet<E>();
-        }
-        if (equals == null) {
-          equals = _defaultEquals;
-        }
-      }
-    } else {
-      if (hashCode == null) {
-        hashCode = _defaultHashCode;
-      }
-      if (equals == null) {
-        equals = _defaultEquals;
-      }
-    }
-    return new _LinkedCustomHashSet<E>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory LinkedHashSet.identity() = _LinkedIdentityHashSet<E>;
-
-  // Private factory constructor called by generated code for set literals.
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  @pragma('dart2js:noSideEffects')
-  factory LinkedHashSet._empty() => new _LinkedHashSet<E>();
-
-  // Private factory constructor called by generated code for set literals.
-  @pragma('dart2js:noInline')
-  factory LinkedHashSet._literal(List values) =>
-      fillLiteralSet(values, new _LinkedHashSet<E>());
-
-  // Private factory static function called by generated code for set literals.
-  // This version is for set literals without type parameters.
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  @pragma('dart2js:noSideEffects')
-  static _makeEmpty() => new _LinkedHashSet();
-
-  // Private factory static function called by generated code for set literals.
-  // This version is for set literals without type parameters.
-  @pragma('dart2js:noInline')
-  static _makeLiteral(List values) =>
-      fillLiteralSet(values, new _LinkedHashSet());
-}
-
-class _LinkedHashSet<E> extends _SetBase<E> implements LinkedHashSet<E> {
-  int _length = 0;
-
-  // The hash set contents are divided into three parts: one part for
-  // string elements, one for numeric elements, and one for the
-  // rest. String and numeric elements map directly to their linked
-  // cells, but the rest of the entries are stored in bucket lists of
-  // the form:
-  //
-  //    [cell-0, cell-1, ...]
-  //
-  // where all elements in the same bucket share the same hash code.
-  var _strings;
-  var _nums;
-  var _rest;
-
-  // The elements are stored in cells that are linked together
-  // to form a double linked list.
-  _LinkedHashSetCell? _first;
-  _LinkedHashSetCell? _last;
-
-  // We track the number of modifications done to the element set to
-  // be able to throw when the set is modified while being iterated
-  // over.
-  int _modifications = 0;
-
-  _LinkedHashSet();
-
-  Set<E> _newSet() => new _LinkedHashSet<E>();
-  Set<R> _newSimilarSet<R>() => new _LinkedHashSet<R>();
-
-  void _unsupported(String operation) {
-    throw 'LinkedHashSet: unsupported $operation';
-  }
-
-  // Iterable.
-  Iterator<E> get iterator {
-    return new _LinkedHashSetIterator(this, _modifications);
-  }
-
-  int get length => _length;
-  bool get isEmpty => _length == 0;
-  bool get isNotEmpty => !isEmpty;
-
-  bool contains(Object? object) {
-    if (_isStringElement(object)) {
-      var strings = _strings;
-      if (strings == null) return false;
-      _LinkedHashSetCell? cell = _getTableEntry(strings, object);
-      return cell != null;
-    } else if (_isNumericElement(object)) {
-      var nums = _nums;
-      if (nums == null) return false;
-      _LinkedHashSetCell? cell = _getTableEntry(nums, object);
-      return cell != null;
-    } else {
-      return _contains(object);
-    }
-  }
-
-  bool _contains(Object? object) {
-    var rest = _rest;
-    if (rest == null) return false;
-    var bucket = _getBucket(rest, object);
-    return _findBucketIndex(bucket, object) >= 0;
-  }
-
-  E? lookup(Object? object) {
-    if (_isStringElement(object) || _isNumericElement(object)) {
-      return this.contains(object) ? object as E : null;
-    } else {
-      return _lookup(object);
-    }
-  }
-
-  E? _lookup(Object? object) {
-    var rest = _rest;
-    if (rest == null) return null;
-    var bucket = _getBucket(rest, object);
-    var index = _findBucketIndex(bucket, object);
-    if (index < 0) return null;
-    return bucket[index]._element;
-  }
-
-  void forEach(void action(E element)) {
-    _LinkedHashSetCell? cell = _first;
-    int modifications = _modifications;
-    while (cell != null) {
-      action(cell._element);
-      if (modifications != _modifications) {
-        throw new ConcurrentModificationError(this);
-      }
-      cell = cell._next;
-    }
-  }
-
-  E get first {
-    var first = _first;
-    if (first == null) throw new StateError("No elements");
-    return first._element;
-  }
-
-  E get last {
-    var last = _last;
-    if (last == null) throw new StateError("No elements");
-    return last._element;
-  }
-
-  // Collection.
-  bool add(E element) {
-    if (_isStringElement(element)) {
-      var strings = _strings;
-      if (strings == null) _strings = strings = _newHashTable();
-      return _addHashTableEntry(strings, element);
-    } else if (_isNumericElement(element)) {
-      var nums = _nums;
-      if (nums == null) _nums = nums = _newHashTable();
-      return _addHashTableEntry(nums, element);
-    } else {
-      return _add(element);
-    }
-  }
-
-  bool _add(E element) {
-    var rest = _rest;
-    if (rest == null) _rest = rest = _newHashTable();
-    var hash = _computeHashCode(element);
-    var bucket = JS('var', '#[#]', rest, hash);
-    if (bucket == null) {
-      _LinkedHashSetCell cell = _newLinkedCell(element);
-      _setTableEntry(rest, hash, JS('var', '[#]', cell));
-    } else {
-      int index = _findBucketIndex(bucket, element);
-      if (index >= 0) return false;
-      _LinkedHashSetCell cell = _newLinkedCell(element);
-      JS('void', '#.push(#)', bucket, cell);
-    }
-    return true;
-  }
-
-  bool remove(Object? object) {
-    if (_isStringElement(object)) {
-      return _removeHashTableEntry(_strings, object);
-    } else if (_isNumericElement(object)) {
-      return _removeHashTableEntry(_nums, object);
-    } else {
-      return _remove(object);
-    }
-  }
-
-  bool _remove(Object? object) {
-    var rest = _rest;
-    if (rest == null) return false;
-    var hash = _computeHashCode(object);
-    var bucket = JS('var', '#[#]', rest, hash);
-    int index = _findBucketIndex(bucket, object);
-    if (index < 0) return false;
-    // Use splice to remove the [cell] element at the index and unlink it.
-    _LinkedHashSetCell cell = JS('var', '#.splice(#, 1)[0]', bucket, index);
-    if (0 == JS('int', '#.length', bucket)) {
-      _deleteTableEntry(rest, hash);
-    }
-    _unlinkCell(cell);
-    return true;
-  }
-
-  void removeWhere(bool test(E element)) {
-    _filterWhere(test, true);
-  }
-
-  void retainWhere(bool test(E element)) {
-    _filterWhere(test, false);
-  }
-
-  void _filterWhere(bool test(E element), bool removeMatching) {
-    _LinkedHashSetCell? cell = _first;
-    while (cell != null) {
-      E element = cell._element;
-      _LinkedHashSetCell? next = cell._next;
-      int modifications = _modifications;
-      bool shouldRemove = (removeMatching == test(element));
-      if (modifications != _modifications) {
-        throw new ConcurrentModificationError(this);
-      }
-      if (shouldRemove) remove(element);
-      cell = next;
-    }
-  }
-
-  void clear() {
-    if (_length > 0) {
-      _strings = _nums = _rest = _first = _last = null;
-      _length = 0;
-      _modified();
-    }
-  }
-
-  bool _addHashTableEntry(var table, E element) {
-    _LinkedHashSetCell? cell = _getTableEntry(table, element);
-    if (cell != null) return false;
-    _setTableEntry(table, element, _newLinkedCell(element));
-    return true;
-  }
-
-  bool _removeHashTableEntry(var table, Object? element) {
-    if (table == null) return false;
-    _LinkedHashSetCell? cell = _getTableEntry(table, element);
-    if (cell == null) return false;
-    _unlinkCell(cell);
-    _deleteTableEntry(table, element);
-    return true;
-  }
-
-  void _modified() {
-    // Value cycles after 2^30 modifications. If you keep hold of an
-    // iterator for that long, you might miss a modification
-    // detection, and iteration can go sour. Don't do that.
-    _modifications = _mask30 & (_modifications + 1);
-  }
-
-  // Create a new cell and link it in as the last one in the list.
-  _LinkedHashSetCell _newLinkedCell(E element) {
-    _LinkedHashSetCell cell = new _LinkedHashSetCell(element);
-    if (_first == null) {
-      _first = _last = cell;
-    } else {
-      _LinkedHashSetCell last = _last!;
-      cell._previous = last;
-      _last = last._next = cell;
-    }
-    _length++;
-    _modified();
-    return cell;
-  }
-
-  // Unlink the given cell from the linked list of cells.
-  void _unlinkCell(_LinkedHashSetCell cell) {
-    _LinkedHashSetCell? previous = cell._previous;
-    _LinkedHashSetCell? next = cell._next;
-    if (previous == null) {
-      assert(cell == _first);
-      _first = next;
-    } else {
-      previous._next = next;
-    }
-    if (next == null) {
-      assert(cell == _last);
-      _last = previous;
-    } else {
-      next._previous = previous;
-    }
-    _length--;
-    _modified();
-  }
-
-  static bool _isStringElement(var element) {
-    return element is String && element != '__proto__';
-  }
-
-  static bool _isNumericElement(var element) {
-    // Only treat unsigned 30-bit integers as numeric elements. This
-    // way, we avoid converting them to strings when we use them as
-    // keys in the JavaScript hash table object.
-    return element is num &&
-        JS('bool', '(# & #) === #', element, _mask30, element);
-  }
-
-  int _computeHashCode(var element) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic elements like '__proto__'. Another
-    // option would be to throw an exception if the hash code isn't a
-    // number.
-    return JS('int', '# & #', element.hashCode, _mask30);
-  }
-
-  static _getTableEntry(var table, var key) {
-    return JS('var', '#[#]', table, key);
-  }
-
-  static void _setTableEntry(var table, var key, var value) {
-    assert(value != null);
-    JS('void', '#[#] = #', table, key, value);
-  }
-
-  static void _deleteTableEntry(var table, var key) {
-    JS('void', 'delete #[#]', table, key);
-  }
-
-  List _getBucket(var table, var element) {
-    var hash = _computeHashCode(element);
-    return JS('var', '#[#]', table, hash);
-  }
-
-  int _findBucketIndex(var bucket, var element) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      _LinkedHashSetCell cell = JS('var', '#[#]', bucket, i);
-      if (cell._element == element) return i;
-    }
-    return -1;
-  }
-
-  static _newHashTable() {
-    // Create a new JavaScript object to be used as a hash table. Use
-    // Object.create to avoid the properties on Object.prototype
-    // showing up as entries.
-    var table = JS('var', 'Object.create(null)');
-    // Attempt to force the hash table into 'dictionary' mode by
-    // adding a property to it and deleting it again.
-    var temporaryKey = '<non-identifier-key>';
-    _setTableEntry(table, temporaryKey, table);
-    _deleteTableEntry(table, temporaryKey);
-    return table;
-  }
-}
-
-class _LinkedIdentityHashSet<E> extends _LinkedHashSet<E> {
-  Set<E> _newSet() => new _LinkedIdentityHashSet<E>();
-  Set<R> _newSimilarSet<R>() => new _LinkedIdentityHashSet<R>();
-
-  int _computeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & #', identityHashCode(key), _mask30);
-  }
-
-  int _findBucketIndex(var bucket, var element) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      _LinkedHashSetCell cell = JS('var', '#[#]', bucket, i);
-      if (identical(cell._element, element)) return i;
-    }
-    return -1;
-  }
-}
-
-class _LinkedCustomHashSet<E> extends _LinkedHashSet<E> {
-  _Equality<E> _equality;
-  _Hasher<E> _hasher;
-  _Predicate _validKey;
-  _LinkedCustomHashSet(
-      this._equality, this._hasher, bool validKey(potentialKey)?)
-      : _validKey = (validKey != null) ? validKey : ((x) => x is E);
-
-  Set<E> _newSet() =>
-      new _LinkedCustomHashSet<E>(_equality, _hasher, _validKey);
-  Set<R> _newSimilarSet<R>() => new _LinkedHashSet<R>();
-
-  int _findBucketIndex(var bucket, var element) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      _LinkedHashSetCell cell = JS('var', '#[#]', bucket, i);
-      if (_equality(cell._element, element)) return i;
-    }
-    return -1;
-  }
-
-  int _computeHashCode(var element) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic elements like '__proto__'. Another
-    // option would be to throw an exception if the hash code isn't a
-    // number.
-    return JS('int', '# & #', _hasher(element), _mask30);
-  }
-
-  bool add(E element) => super._add(element);
-
-  bool contains(Object? object) {
-    if (!_validKey(object)) return false;
-    return super._contains(object);
-  }
-
-  E? lookup(Object? object) {
-    if (!_validKey(object)) return null;
-    return super._lookup(object);
-  }
-
-  bool remove(Object? object) {
-    if (!_validKey(object)) return false;
-    return super._remove(object);
-  }
-
-  bool containsAll(Iterable<Object?> elements) {
-    for (Object? element in elements) {
-      if (!_validKey(element) || !this.contains(element)) return false;
-    }
-    return true;
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    for (Object? element in elements) {
-      if (_validKey(element)) {
-        super._remove(element);
-      }
-    }
-  }
-}
-
-class _LinkedHashSetCell {
-  final _element;
-
-  _LinkedHashSetCell? _next;
-  _LinkedHashSetCell? _previous;
-
-  _LinkedHashSetCell(this._element);
-}
-
-// TODO(kasperl): Share this code with LinkedHashMapKeyIterator<E>?
-class _LinkedHashSetIterator<E> implements Iterator<E> {
-  final _set;
-  final int _modifications;
-  _LinkedHashSetCell? _cell;
-  E? _current;
-
-  _LinkedHashSetIterator(this._set, this._modifications) {
-    _cell = _set._first;
-  }
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    var cell = _cell;
-    if (_modifications != _set._modifications) {
-      throw new ConcurrentModificationError(_set);
-    } else if (cell == null) {
-      _current = null;
-      return false;
-    } else {
-      _current = cell._element;
-      _cell = cell._next;
-      return true;
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/constant_map.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/constant_map.dart
deleted file mode 100644
index 0f673d8..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/constant_map.dart
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _js_helper;
-
-class ConstantMapView<K, V> extends UnmodifiableMapView<K, V>
-    implements ConstantMap<K, V> {
-  ConstantMapView(Map<K, V> base) : super(base);
-}
-
-abstract class ConstantMap<K, V> implements Map<K, V> {
-  // Used to create unmodifiable maps from other maps.
-  factory ConstantMap.from(Map other) {
-    var keys = new List<K>.from(other.keys);
-    bool allStrings = true;
-    for (var k in keys) {
-      if (k is! String) {
-        allStrings = false;
-        break;
-      }
-    }
-    if (allStrings) {
-      bool containsProto = false;
-      var protoValue = null;
-      var object = JS('=Object', '{}');
-      int length = 0;
-      for (var k in keys) {
-        V v = other[k];
-        if (k != '__proto__') {
-          if (!jsHasOwnProperty(object, k as String)) length++;
-          JS('void', '#[#] = #', object, k, v);
-        } else {
-          containsProto = true;
-          protoValue = v;
-        }
-      }
-      if (containsProto) {
-        length++;
-        return new ConstantProtoMap<K, V>._(length, object, keys, protoValue);
-      }
-      return new ConstantStringMap<K, V>._(length, object, keys);
-    }
-    // TODO(lrn): Make a proper unmodifiable map implementation.
-    return new ConstantMapView<K, V>(new Map.from(other));
-  }
-
-  const ConstantMap._();
-
-  Map<RK, RV> cast<RK, RV>() => Map.castFrom<K, V, RK, RV>(this);
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  String toString() => MapBase.mapToString(this);
-
-  static Never _throwUnmodifiable() {
-    throw new UnsupportedError('Cannot modify unmodifiable Map');
-  }
-
-  void operator []=(K key, V val) {
-    _throwUnmodifiable();
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    _throwUnmodifiable();
-  }
-
-  V? remove(Object? key) {
-    _throwUnmodifiable();
-  }
-
-  void clear() => _throwUnmodifiable();
-  void addAll(Map<K, V> other) => _throwUnmodifiable();
-
-  Iterable<MapEntry<K, V>> get entries sync* {
-    for (var key in keys) yield new MapEntry<K, V>(key, this[key]!);
-  }
-
-  void addEntries(Iterable<MapEntry<K, V>> entries) {
-    for (var entry in entries) this[entry.key] = entry.value;
-  }
-
-  Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(K key, V value)) {
-    var result = <K2, V2>{};
-    this.forEach((K key, V value) {
-      var entry = transform(key, value);
-      result[entry.key] = entry.value;
-    });
-    return result;
-  }
-
-  V update(K key, V update(V value), {V ifAbsent()?}) {
-    _throwUnmodifiable();
-  }
-
-  void updateAll(V update(K key, V value)) {
-    _throwUnmodifiable();
-  }
-
-  void removeWhere(bool test(K key, V value)) {
-    _throwUnmodifiable();
-  }
-}
-
-class ConstantStringMap<K, V> extends ConstantMap<K, V> {
-  // This constructor is not used for actual compile-time constants.
-  // The instantiation of constant maps is shortcut by the compiler.
-  const ConstantStringMap._(this._length, this._jsObject, this._keys)
-      : super._();
-
-  // TODO(18131): Ensure type inference knows the precise types of the fields.
-  final int _length;
-  // A constant map is backed by a JavaScript object.
-  final _jsObject;
-  final List<K> _keys;
-
-  int get length => JS('JSUInt31', '#', _length);
-  List<K> get _keysArray => JS('JSUnmodifiableArray', '#', _keys);
-
-  bool containsValue(Object? needle) {
-    return values.any((V value) => value == needle);
-  }
-
-  bool containsKey(Object? key) {
-    if (key is! String) return false;
-    if ('__proto__' == key) return false;
-    return jsHasOwnProperty(_jsObject, key);
-  }
-
-  V? operator [](Object? key) {
-    if (!containsKey(key)) return null;
-    return JS('', '#', _fetch(key));
-  }
-
-  // [_fetch] is the indexer for keys for which `containsKey(key)` is true.
-  _fetch(key) => jsPropertyAccess(_jsObject, key);
-
-  void forEach(void f(K key, V value)) {
-    // Use a JS 'cast' to get efficient loop.  Type inference doesn't get this
-    // since constant map representation is chosen after type inference and the
-    // instantiation is shortcut by the compiler.
-    var keys = _keysArray;
-    for (int i = 0; i < keys.length; i++) {
-      var key = keys[i];
-      f(key, _fetch(key));
-    }
-  }
-
-  Iterable<K> get keys {
-    return new _ConstantMapKeyIterable<K>(this);
-  }
-
-  Iterable<V> get values {
-    return new MappedIterable<K, V>(_keysArray, (key) => _fetch(key));
-  }
-}
-
-class ConstantProtoMap<K, V> extends ConstantStringMap<K, V> {
-  // This constructor is not used.  The instantiation is shortcut by the
-  // compiler. It is here to make the uninitialized final fields legal.
-  ConstantProtoMap._(length, jsObject, keys, this._protoValue)
-      : super._(length, jsObject, keys);
-
-  final V _protoValue;
-
-  bool containsKey(Object? key) {
-    if (key is! String) return false;
-    if ('__proto__' == key) return true;
-    return jsHasOwnProperty(_jsObject, key);
-  }
-
-  _fetch(key) =>
-      '__proto__' == key ? _protoValue : jsPropertyAccess(_jsObject, key);
-}
-
-class _ConstantMapKeyIterable<K> extends Iterable<K> {
-  ConstantStringMap<K, dynamic> _map;
-  _ConstantMapKeyIterable(this._map);
-
-  Iterator<K> get iterator => _map._keysArray.iterator;
-
-  int get length => _map._keysArray.length;
-}
-
-class GeneralConstantMap<K, V> extends ConstantMap<K, V> {
-  // This constructor is not used.  The instantiation is shortcut by the
-  // compiler. It is here to make the uninitialized final fields legal.
-  GeneralConstantMap(this._jsData) : super._();
-
-  // [_jsData] holds a key-value pair list.
-  final _jsData;
-
-  // We cannot create the backing map on creation since hashCode interceptors
-  // have not been defined when constants are created.
-  Map<K, V> _getMap() {
-    LinkedHashMap<K, V>? backingMap = JS('LinkedHashMap|Null', r'#.$map', this);
-    if (backingMap == null) {
-      backingMap = new JsLinkedHashMap<K, V>();
-      fillLiteralMap(_jsData, backingMap);
-      JS('', r'#.$map = #', this, backingMap);
-    }
-    return backingMap;
-  }
-
-  bool containsValue(Object? needle) {
-    return _getMap().containsValue(needle);
-  }
-
-  bool containsKey(Object? key) {
-    return _getMap().containsKey(key);
-  }
-
-  V? operator [](Object? key) {
-    return _getMap()[key];
-  }
-
-  void forEach(void f(K key, V value)) {
-    _getMap().forEach(f);
-  }
-
-  Iterable<K> get keys {
-    return _getMap().keys;
-  }
-
-  Iterable<V> get values {
-    return _getMap().values;
-  }
-
-  int get length => _getMap().length;
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/convert_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/convert_patch.dart
deleted file mode 100644
index d7dfb5f..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/convert_patch.dart
+++ /dev/null
@@ -1,484 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// Patch file for dart:convert library.
-
-import 'dart:_js_helper' show argumentErrorValue, patch;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show JSArray, JSExtendableArray;
-import 'dart:_internal' show MappedIterable, ListIterable;
-import 'dart:collection' show LinkedHashMap, MapBase;
-import 'dart:_native_typed_data' show NativeUint8List;
-
-/// Parses [json] and builds the corresponding parsed JSON value.
-///
-/// Parsed JSON values Nare of the types [num], [String], [bool], [Null],
-/// [List]s of parsed JSON values or [Map]s from [String] to parsed
-/// JSON values.
-///
-/// The optional [reviver] function, if provided, is called once for each object
-/// or list property parsed. The arguments are the property name ([String]) or
-/// list index ([int]), and the value is the parsed value.  The return value of
-/// the reviver will be used as the value of that property instead of the parsed
-/// value.  The top level value is passed to the reviver with the empty string
-/// as a key.
-///
-/// Throws [FormatException] if the input is not valid JSON text.
-@patch
-_parseJson(String source, reviver(key, value)?) {
-  if (source is! String) throw argumentErrorValue(source);
-
-  var parsed;
-  try {
-    parsed = JS('=Object|JSExtendableArray|Null|bool|num|String',
-        'JSON.parse(#)', source);
-  } catch (e) {
-    throw FormatException(JS<String>('String', 'String(#)', e));
-  }
-
-  if (reviver == null) {
-    return _convertJsonToDartLazy(parsed);
-  } else {
-    return _convertJsonToDart(parsed, reviver);
-  }
-}
-
-/// Walks the raw JavaScript value [json], replacing JavaScript Objects with
-/// Maps. [json] is expected to be freshly allocated so elements can be replaced
-/// in-place.
-_convertJsonToDart(json, reviver(Object? key, Object? value)) {
-  walk(e) {
-    // JavaScript null, string, number, bool are in the correct representation.
-    if (JS<bool>('bool', '# == null', e) ||
-        JS<bool>('bool', 'typeof # != "object"', e)) {
-      return e;
-    }
-
-    // This test is needed to avoid identifying '{"__proto__":[]}' as an Array.
-    // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
-    // bug 621 below is fixed.
-    if (JS<bool>('bool', 'Object.getPrototypeOf(#) === Array.prototype', e)) {
-      // In-place update of the elements since JS Array is a Dart List.
-      for (int i = 0; i < JS<int>('int', '#.length', e); i++) {
-        // Use JS indexing to avoid range checks.  We know this is the only
-        // reference to the list, but the compiler will likely never be able to
-        // tell that this instance of the list cannot have its length changed by
-        // the reviver even though it later will be passed to the reviver at the
-        // outer level.
-        var item = JS('', '#[#]', e, i);
-        JS('', '#[#]=#', e, i, reviver(i, walk(item)));
-      }
-      return e;
-    }
-
-    // Otherwise it is a plain object, so copy to a JSON map, so we process
-    // and revive all entries recursively.
-    _JsonMap map = _JsonMap(e);
-    var processed = map._processed;
-    List<String> keys = map._computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-      var revived = reviver(key, walk(JS('', '#[#]', e, key)));
-      JS('', '#[#]=#', processed, key, revived);
-    }
-
-    // Update the JSON map structure so future access is cheaper.
-    map._original = processed; // Don't keep two objects around.
-    return map;
-  }
-
-  return reviver(null, walk(json));
-}
-
-_convertJsonToDartLazy(object) {
-  // JavaScript null and undefined are represented as null.
-  if (object == null) return null;
-
-  // JavaScript string, number, bool already has the correct representation.
-  if (JS<bool>('bool', 'typeof # != "object"', object)) {
-    return object;
-  }
-
-  // This test is needed to avoid identifying '{"__proto__":[]}' as an array.
-  // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
-  // bug https://code.google.com/p/v8/issues/detail?id=621 is fixed.
-  if (JS<bool>(
-      'bool', 'Object.getPrototypeOf(#) !== Array.prototype', object)) {
-    return _JsonMap(object);
-  }
-
-  // Update the elements in place since JS arrays are Dart lists.
-  for (int i = 0; i < JS<int>('int', '#.length', object); i++) {
-    // Use JS indexing to avoid range checks.  We know this is the only
-    // reference to the list, but the compiler will likely never be able to
-    // tell that this instance of the list cannot have its length changed by
-    // the reviver even though it later will be passed to the reviver at the
-    // outer level.
-    var item = JS('', '#[#]', object, i);
-    JS('', '#[#]=#', object, i, _convertJsonToDartLazy(item));
-  }
-  return object;
-}
-
-class _JsonMap extends MapBase<String, dynamic> {
-  // The original JavaScript object remains unchanged until
-  // the map is eventually upgraded, in which case we null it
-  // out to reclaim the memory used by it.
-  var _original;
-
-  // We keep track of the map entries that we have already
-  // processed by adding them to a separate JavaScript object.
-  var _processed = _newJavaScriptObject();
-
-  // If the data slot isn't null, it represents either the list
-  // of keys (for non-upgraded JSON maps) or the upgraded map.
-  var _data = null;
-
-  _JsonMap(this._original);
-
-  operator [](key) {
-    if (_isUpgraded) {
-      return _upgradedMap[key];
-    } else if (key is! String) {
-      return null;
-    } else {
-      var result = _getProperty(_processed, key);
-      if (_isUnprocessed(result)) result = _process(key);
-      return result;
-    }
-  }
-
-  int get length => _isUpgraded ? _upgradedMap.length : _computeKeys().length;
-
-  bool get isEmpty => length == 0;
-  bool get isNotEmpty => length > 0;
-
-  Iterable<String> get keys {
-    if (_isUpgraded) return _upgradedMap.keys;
-    return _JsonMapKeyIterable(this);
-  }
-
-  Iterable get values {
-    if (_isUpgraded) return _upgradedMap.values;
-    return MappedIterable(_computeKeys(), (each) => this[each]);
-  }
-
-  operator []=(key, value) {
-    if (_isUpgraded) {
-      _upgradedMap[key] = value;
-    } else if (containsKey(key)) {
-      var processed = _processed;
-      _setProperty(processed, key, value);
-      var original = _original;
-      if (!identical(original, processed)) {
-        _setProperty(original, key, null); // Reclaim memory.
-      }
-    } else {
-      _upgrade()[key] = value;
-    }
-  }
-
-  void addAll(Map<String, dynamic> other) {
-    other.forEach((key, value) {
-      this[key] = value;
-    });
-  }
-
-  bool containsValue(value) {
-    if (_isUpgraded) return _upgradedMap.containsValue(value);
-    List<String> keys = _computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-      if (this[key] == value) return true;
-    }
-    return false;
-  }
-
-  bool containsKey(key) {
-    if (_isUpgraded) return _upgradedMap.containsKey(key);
-    if (key is! String) return false;
-    return _hasProperty(_original, key);
-  }
-
-  putIfAbsent(key, ifAbsent()) {
-    if (containsKey(key)) return this[key];
-    var value = ifAbsent();
-    this[key] = value;
-    return value;
-  }
-
-  remove(Object? key) {
-    if (!_isUpgraded && !containsKey(key)) return null;
-    return _upgrade().remove(key);
-  }
-
-  void clear() {
-    if (_isUpgraded) {
-      _upgradedMap.clear();
-    } else {
-      if (_data != null) {
-        // Clear the list of keys to make sure we force
-        // a concurrent modification error if anyone is
-        // currently iterating over it.
-        _data.clear();
-      }
-      _original = _processed = null;
-      _data = {};
-    }
-  }
-
-  void forEach(void f(String key, value)) {
-    if (_isUpgraded) return _upgradedMap.forEach(f);
-    List<String> keys = _computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-
-      // Compute the value under the assumption that the property
-      // is present but potentially not processed.
-      var value = _getProperty(_processed, key);
-      if (_isUnprocessed(value)) {
-        value = _convertJsonToDartLazy(_getProperty(_original, key));
-        _setProperty(_processed, key, value);
-      }
-
-      // Do the callback.
-      f(key, value);
-
-      // Check if invoking the callback function changed
-      // the key set. If so, throw an exception.
-      if (!identical(keys, _data)) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-  }
-
-  // ------------------------------------------
-  // Private helper methods.
-  // ------------------------------------------
-
-  bool get _isUpgraded => _processed == null;
-
-  Map<String, dynamic> get _upgradedMap {
-    assert(_isUpgraded);
-    // 'cast' the union type to LinkedHashMap.  It would be even better if we
-    // could 'cast' to the implementation type, since LinkedHashMap includes
-    // _JsonMap.
-    return JS('LinkedHashMap', '#', _data);
-  }
-
-  List<String> _computeKeys() {
-    assert(!_isUpgraded);
-    List? keys = _data;
-    if (keys == null) {
-      keys = _data = new JSArray<String>.typed(_getPropertyNames(_original));
-    }
-    return JS('JSExtendableArray', '#', keys);
-  }
-
-  Map<String, dynamic> _upgrade() {
-    if (_isUpgraded) return _upgradedMap;
-
-    // Copy all the (key, value) pairs to a freshly allocated
-    // linked hash map thus preserving the ordering.
-    var result = <String, dynamic>{};
-    List<String> keys = _computeKeys();
-    for (int i = 0; i < keys.length; i++) {
-      String key = keys[i];
-      result[key] = this[key];
-    }
-
-    // We only upgrade when we need to extend the map, so we can
-    // safely force a concurrent modification error in case
-    // someone is iterating over the map here.
-    if (keys.isEmpty) {
-      keys.add("");
-    } else {
-      keys.clear();
-    }
-
-    // Clear out the associated JavaScript objects and mark the
-    // map as having been upgraded.
-    _original = _processed = null;
-    _data = result;
-    assert(_isUpgraded);
-    return result;
-  }
-
-  _process(String key) {
-    if (!_hasProperty(_original, key)) return null;
-    var result = _convertJsonToDartLazy(_getProperty(_original, key));
-    return _setProperty(_processed, key, result);
-  }
-
-  // ------------------------------------------
-  // Private JavaScript helper methods.
-  // ------------------------------------------
-
-  static bool _hasProperty(object, String key) => JS<bool>(
-      'bool', 'Object.prototype.hasOwnProperty.call(#,#)', object, key);
-  static _getProperty(object, String key) => JS('', '#[#]', object, key);
-  static _setProperty(object, String key, value) =>
-      JS('', '#[#]=#', object, key, value);
-  static List _getPropertyNames(object) =>
-      JS('JSExtendableArray', 'Object.keys(#)', object);
-  static bool _isUnprocessed(object) =>
-      JS<bool>('bool', 'typeof(#)=="undefined"', object);
-  static _newJavaScriptObject() => JS('=Object', 'Object.create(null)');
-}
-
-class _JsonMapKeyIterable extends ListIterable<String> {
-  final _JsonMap _parent;
-
-  _JsonMapKeyIterable(this._parent);
-
-  int get length => _parent.length;
-
-  String elementAt(int index) {
-    return _parent._isUpgraded
-        ? _parent.keys.elementAt(index)
-        : _parent._computeKeys()[index];
-  }
-
-  /// Although [ListIterable] defines its own iterator, we return the iterator
-  /// of the underlying list [_keys] in order to propagate
-  /// [ConcurrentModificationError]s.
-  Iterator<String> get iterator {
-    return _parent._isUpgraded
-        ? _parent.keys.iterator
-        : _parent._computeKeys().iterator;
-  }
-
-  /// Delegate to [parent.containsKey] to ensure the performance expected
-  /// from [Map.keys.containsKey].
-  bool contains(Object? key) => _parent.containsKey(key);
-}
-
-@patch
-class JsonDecoder {
-  @patch
-  StringConversionSink startChunkedConversion(Sink<Object?> sink) {
-    return _JsonDecoderSink(_reviver, sink);
-  }
-}
-
-/// Implements the chunked conversion from a JSON string to its corresponding
-/// object.
-///
-/// The sink only creates one object, but its input can be chunked.
-// TODO(floitsch): don't accumulate everything before starting to decode.
-class _JsonDecoderSink extends _StringSinkConversionSink<StringBuffer> {
-  final Object? Function(Object? key, Object? value)? _reviver;
-  final Sink<Object?> _sink;
-
-  _JsonDecoderSink(this._reviver, this._sink) : super(StringBuffer(''));
-
-  void close() {
-    super.close();
-    String accumulated = _stringSink.toString();
-    _stringSink.clear();
-    Object? decoded = _parseJson(accumulated, _reviver);
-    _sink.add(decoded);
-    _sink.close();
-  }
-}
-
-@patch
-class Utf8Decoder {
-  // Always fall back to the Dart implementation for strings shorter than this
-  // threshold, as there is a large, constant overhead for using TextDecoder.
-  static const int _shortInputThreshold = 15;
-
-  @patch
-  Converter<List<int>, T> fuse<T>(Converter<String, T> next) {
-    return super.fuse(next);
-  }
-
-  @patch
-  static String? _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int? end) {
-    // Test `codeUnits is NativeUint8List`. Dart's NativeUint8List is
-    // implemented by JavaScript's Uint8Array.
-    if (JS<bool>('bool', '# instanceof Uint8Array', codeUnits)) {
-      // JS 'cast' to avoid a downcast equivalent to the is-check we hand-coded.
-      NativeUint8List casted =
-          JS<NativeUint8List>('NativeUint8List', '#', codeUnits);
-      // Always use Dart implementation for short strings.
-      end ??= casted.length;
-      if (end - start < _shortInputThreshold) {
-        return null;
-      }
-      String? result =
-          _convertInterceptedUint8List(allowMalformed, casted, start, end);
-      if (result != null && allowMalformed) {
-        // In principle, TextDecoder should have provided the correct result
-        // here, but some browsers deviate from the standard as to how many
-        // replacement characters they produce. Thus, we fall back to the Dart
-        // implementation if the result contains any replacement characters.
-        if (JS<int>('int', r'#.indexOf(#)', result, '\uFFFD') >= 0) {
-          return null;
-        }
-      }
-      return result;
-    }
-    return null; // This call was not intercepted.
-  }
-
-  static String? _convertInterceptedUint8List(
-      bool allowMalformed, NativeUint8List codeUnits, int start, int end) {
-    final decoder = allowMalformed ? _decoderNonfatal : _decoder;
-    if (decoder == null) return null;
-    if (0 == start && end == codeUnits.length) {
-      return _useTextDecoder(decoder, codeUnits);
-    }
-
-    int length = codeUnits.length;
-    end = RangeError.checkValidRange(start, end, length);
-
-    return _useTextDecoder(
-        decoder,
-        JS<NativeUint8List>(
-            'NativeUint8List', '#.subarray(#, #)', codeUnits, start, end));
-  }
-
-  static String? _useTextDecoder(decoder, NativeUint8List codeUnits) {
-    // If the input is malformed, catch the exception and return `null` to fall
-    // back on unintercepted decoder. The fallback will either succeed in
-    // decoding, or report the problem better than TextDecoder.
-    try {
-      return JS<String>('String', '#.decode(#)', decoder, codeUnits);
-    } catch (e) {}
-    return null;
-  }
-
-  // TextDecoder is not defined on some browsers and on the stand-alone d8 and
-  // jsshell engines. Use a lazy initializer to do feature detection once.
-  static final _decoder = () {
-    try {
-      return JS('', 'new TextDecoder("utf-8", {fatal: true})');
-    } catch (e) {}
-    return null;
-  }();
-  static final _decoderNonfatal = () {
-    try {
-      return JS('', 'new TextDecoder("utf-8", {fatal: false})');
-    } catch (e) {}
-    return null;
-  }();
-}
-
-@patch
-class _Utf8Decoder {
-  @patch
-  _Utf8Decoder(this.allowMalformed) : _state = beforeBom;
-
-  @patch
-  String convertSingle(List<int> codeUnits, int start, int? maybeEnd) {
-    return convertGeneral(codeUnits, start, maybeEnd, true);
-  }
-
-  @patch
-  String convertChunked(List<int> codeUnits, int start, int? maybeEnd) {
-    return convertGeneral(codeUnits, start, maybeEnd, false);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/core_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/core_patch.dart
deleted file mode 100644
index 6ffa92e..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/core_patch.dart
+++ /dev/null
@@ -1,2952 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for dart:core classes.
-import "dart:_internal" hide Symbol, LinkedList, LinkedListEntry;
-import "dart:_internal" as _symbol_dev;
-import 'dart:_interceptors';
-import 'dart:_js_helper'
-    show
-        checkInt,
-        Closure,
-        ConstantMap,
-        getRuntimeType,
-        JsLinkedHashMap,
-        jsonEncodeNative,
-        JSSyntaxRegExp,
-        NoInline,
-        objectHashCode,
-        patch,
-        Primitives,
-        quoteStringForRegExp,
-        stringJoinUnchecked,
-        getTraceFromException,
-        RuntimeError;
-
-import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
-
-import 'dart:_native_typed_data' show NativeUint8List;
-
-import "dart:convert" show Encoding, utf8;
-
-import 'dart:typed_data' show Endian, Uint8List, Uint16List;
-
-String _symbolToString(Symbol symbol) =>
-    _symbol_dev.Symbol.getName(symbol as _symbol_dev.Symbol);
-
-Map<String, dynamic>? _symbolMapToStringMap(Map<Symbol, dynamic>? map) {
-  if (map == null) return null;
-  var result = new Map<String, dynamic>();
-  map.forEach((Symbol key, value) {
-    result[_symbolToString(key)] = value;
-  });
-  return result;
-}
-
-@patch
-int identityHashCode(Object? object) => objectHashCode(object);
-
-// Patch for Object implementation.
-@patch
-class Object {
-  @patch
-  bool operator ==(Object other) => identical(this, other);
-
-  @patch
-  int get hashCode => Primitives.objectHashCode(this);
-
-  @patch
-  String toString() => Primitives.objectToHumanReadableString(this);
-
-  @patch
-  dynamic noSuchMethod(Invocation invocation) {
-    throw new NoSuchMethodError(this, invocation.memberName,
-        invocation.positionalArguments, invocation.namedArguments);
-  }
-
-  @patch
-  Type get runtimeType => getRuntimeType(this);
-}
-
-@patch
-class Null {
-  @patch
-  int get hashCode => super.hashCode;
-}
-
-// Patch for Function implementation.
-@patch
-class Function {
-  @patch
-  static apply(Function function, List<dynamic>? positionalArguments,
-      [Map<Symbol, dynamic>? namedArguments]) {
-    return Primitives.applyFunction(
-        function,
-        positionalArguments,
-        // Use this form so that if namedArguments is always null, we can
-        // tree-shake _symbolMapToStringMap.
-        namedArguments == null ? null : _symbolMapToStringMap(namedArguments));
-  }
-}
-
-// Patch for Expando implementation.
-@patch
-class Expando<T> {
-  static const String _EXPANDO_PROPERTY_NAME = 'expando\$values';
-
-  // Incremented to make unique keys.
-  static int _keyCount = 0;
-
-  // Stores either a JS WeakMap or a "unique" string key.
-  final Object _jsWeakMapOrKey;
-
-  @patch
-  Expando([String? name])
-      : this.name = name,
-        _jsWeakMapOrKey = JS('bool', 'typeof WeakMap == "function"')
-            ? JS('=Object', 'new WeakMap()')
-            : _createKey();
-
-  @patch
-  T? operator [](Object object) {
-    if (_jsWeakMapOrKey is! String) {
-      _checkType(object); // WeakMap doesn't check on reading, only writing.
-      return JS('', '#.get(#)', _jsWeakMapOrKey, object);
-    }
-    return _getFromObject(_jsWeakMapOrKey as String, object) as T?;
-  }
-
-  @patch
-  void operator []=(Object object, T? value) {
-    if (_jsWeakMapOrKey is! String) {
-      JS('void', '#.set(#, #)', _jsWeakMapOrKey, object, value);
-    } else {
-      _setOnObject(_jsWeakMapOrKey as String, object, value);
-    }
-  }
-
-  static Object _getFromObject(String key, Object object) {
-    var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    return (values == null) ? null : Primitives.getProperty(values, key);
-  }
-
-  static void _setOnObject(String key, Object object, Object? value) {
-    var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    if (values == null) {
-      values = new Object();
-      Primitives.setProperty(object, _EXPANDO_PROPERTY_NAME, values);
-    }
-    Primitives.setProperty(values, key, value);
-  }
-
-  static String _createKey() => "expando\$key\$${_keyCount++}";
-
-  static _checkType(object) {
-    if (object == null || object is bool || object is num || object is String) {
-      throw new ArgumentError.value(object,
-          "Expandos are not allowed on strings, numbers, booleans or null");
-    }
-  }
-}
-
-@patch
-class int {
-  @patch
-  static int parse(String source,
-      {int? radix, @deprecated int onError(String source)?}) {
-    int? value = tryParse(source, radix: radix);
-    if (value != null) return value;
-    if (onError != null) return onError(source);
-    throw new FormatException(source);
-  }
-
-  @patch
-  static int? tryParse(String source, {int? radix}) {
-    return Primitives.parseInt(source, radix);
-  }
-}
-
-@patch
-class double {
-  @patch
-  static double parse(String source,
-      [@deprecated double onError(String source)?]) {
-    double? value = tryParse(source);
-    if (value != null) return value;
-    if (onError != null) return onError(source);
-    throw new FormatException('Invalid double', source);
-  }
-
-  @patch
-  static double? tryParse(String source) {
-    return Primitives.parseDouble(source);
-  }
-}
-
-@patch
-class BigInt implements Comparable<BigInt> {
-  @patch
-  static BigInt get zero => _BigIntImpl.zero;
-  @patch
-  static BigInt get one => _BigIntImpl.one;
-  @patch
-  static BigInt get two => _BigIntImpl.two;
-
-  @patch
-  static BigInt parse(String source, {int? radix}) =>
-      _BigIntImpl.parse(source, radix: radix);
-
-  @patch
-  static BigInt? tryParse(String source, {int? radix}) =>
-      _BigIntImpl._tryParse(source, radix: radix);
-
-  @patch
-  factory BigInt.from(num value) = _BigIntImpl.from;
-}
-
-@patch
-class Error {
-  @patch
-  static String _objectToString(Object object) {
-    // Closures all have useful and safe toString methods.
-    if (object is Closure) return object.toString();
-    return Primitives.objectToHumanReadableString(object);
-  }
-
-  @patch
-  static String _stringToSafeString(String string) {
-    return jsonEncodeNative(string);
-  }
-
-  @patch
-  StackTrace? get stackTrace => Primitives.extractStackTrace(this);
-}
-
-@patch
-class FallThroughError {
-  @patch
-  FallThroughError._create(String url, int line);
-
-  @patch
-  String toString() => super.toString();
-}
-
-@patch
-class AbstractClassInstantiationError {
-  @patch
-  String toString() => "Cannot instantiate abstract class: '$_className'";
-}
-
-// Patch for DateTime implementation.
-@patch
-class DateTime {
-  @patch
-  DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
-      {bool isUtc: false})
-      // `0 + millisecondsSinceEpoch` forces the inferred result to be non-null.
-      : this._withValue(0 + millisecondsSinceEpoch, isUtc: isUtc);
-
-  @patch
-  DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch,
-      {bool isUtc: false})
-      : this._withValue(
-            _microsecondInRoundedMilliseconds(microsecondsSinceEpoch),
-            isUtc: isUtc);
-
-  @patch
-  DateTime._internal(int year, int month, int day, int hour, int minute,
-      int second, int millisecond, int microsecond, bool isUtc)
-      // checkBool is manually inlined here because dart2js doesn't inline it
-      // and [isUtc] is usually a constant.
-      : this.isUtc = isUtc is bool
-            ? isUtc
-            : throw new ArgumentError.value(isUtc, 'isUtc'),
-        _value = checkInt(Primitives.valueFromDecomposedDate(
-            year,
-            month,
-            day,
-            hour,
-            minute,
-            second,
-            millisecond + _microsecondInRoundedMilliseconds(microsecond),
-            isUtc));
-
-  @patch
-  DateTime._now()
-      : isUtc = false,
-        _value = Primitives.dateNow();
-
-  /// Rounds the given [microsecond] to the nearest milliseconds value.
-  ///
-  /// For example, invoked with argument `2600` returns `3`.
-  static int _microsecondInRoundedMilliseconds(int microsecond) {
-    return (microsecond / 1000).round();
-  }
-
-  @patch
-  static int? _brokenDownDateToValue(int year, int month, int day, int hour,
-      int minute, int second, int millisecond, int microsecond, bool isUtc) {
-    return Primitives.valueFromDecomposedDate(
-        year,
-        month,
-        day,
-        hour,
-        minute,
-        second,
-        millisecond + _microsecondInRoundedMilliseconds(microsecond),
-        isUtc);
-  }
-
-  @patch
-  String get timeZoneName {
-    if (isUtc) return "UTC";
-    return Primitives.getTimeZoneName(this);
-  }
-
-  @patch
-  Duration get timeZoneOffset {
-    if (isUtc) return new Duration();
-    return new Duration(minutes: Primitives.getTimeZoneOffsetInMinutes(this));
-  }
-
-  @patch
-  DateTime add(Duration duration) {
-    return new DateTime._withValue(_value + duration.inMilliseconds,
-        isUtc: isUtc);
-  }
-
-  @patch
-  DateTime subtract(Duration duration) {
-    return new DateTime._withValue(_value - duration.inMilliseconds,
-        isUtc: isUtc);
-  }
-
-  @patch
-  Duration difference(DateTime other) {
-    return new Duration(milliseconds: _value - other._value);
-  }
-
-  @patch
-  int get millisecondsSinceEpoch => _value;
-
-  @patch
-  int get microsecondsSinceEpoch => 1000 * _value;
-
-  @patch
-  int get year => Primitives.getYear(this);
-
-  @patch
-  int get month => Primitives.getMonth(this);
-
-  @patch
-  int get day => Primitives.getDay(this);
-
-  @patch
-  int get hour => Primitives.getHours(this);
-
-  @patch
-  int get minute => Primitives.getMinutes(this);
-
-  @patch
-  int get second => Primitives.getSeconds(this);
-
-  @patch
-  int get millisecond => Primitives.getMilliseconds(this);
-
-  @patch
-  int get microsecond => 0;
-
-  @patch
-  int get weekday => Primitives.getWeekday(this);
-
-  @patch
-  bool operator ==(Object other) =>
-      other is DateTime &&
-      _value == other.millisecondsSinceEpoch &&
-      isUtc == other.isUtc;
-
-  @patch
-  bool isBefore(DateTime other) => _value < other.millisecondsSinceEpoch;
-
-  @patch
-  bool isAfter(DateTime other) => _value > other.millisecondsSinceEpoch;
-
-  @patch
-  bool isAtSameMomentAs(DateTime other) =>
-      _value == other.millisecondsSinceEpoch;
-
-  @patch
-  int compareTo(DateTime other) =>
-      _value.compareTo(other.millisecondsSinceEpoch);
-}
-
-// Patch for Stopwatch implementation.
-@patch
-class Stopwatch {
-  @patch
-  static int _initTicker() {
-    Primitives.initTicker();
-    return Primitives.timerFrequency;
-  }
-
-  @patch
-  static int _now() => Primitives.timerTicks();
-
-  @patch
-  int get elapsedMicroseconds {
-    int ticks = elapsedTicks;
-    if (_frequency == 1000000) return ticks;
-    assert(_frequency == 1000);
-    return ticks * 1000;
-  }
-
-  @patch
-  int get elapsedMilliseconds {
-    int ticks = elapsedTicks;
-    if (_frequency == 1000) return ticks;
-    assert(_frequency == 1000000);
-    return ticks ~/ 1000;
-  }
-}
-
-// Patch for List implementation.
-@patch
-class List<E> {
-  @patch
-  factory List([int? length]) = JSArray<E>.list;
-
-  @patch
-  factory List.filled(int length, E fill, {bool growable: false}) {
-    var result = growable
-        ? new JSArray<E>.growable(length)
-        : new JSArray<E>.fixed(length);
-    if (length != 0 && fill != null) {
-      // TODO(sra): Consider using `Array.fill`.
-      for (int i = 0; i < result.length; i++) {
-        // Unchecked assignment equivalent to `result[i] = fill`;
-        // `fill` is checked statically at call site.
-        JS('', '#[#] = #', result, i, fill);
-      }
-    }
-    return result;
-  }
-
-  @patch
-  factory List.empty({bool growable: false}) {
-    return growable ? new JSArray<E>.growable(0) : new JSArray<E>.fixed(0);
-  }
-
-  @patch
-  factory List.from(Iterable elements, {bool growable: true}) {
-    List<E> list = <E>[];
-    for (E e in elements) {
-      list.add(e);
-    }
-    if (growable) return list;
-    return makeListFixedLength(list);
-  }
-
-  @patch
-  factory List.of(Iterable<E> elements, {bool growable: true}) {
-    // TODO(32937): Specialize to benefit from known element type.
-    return List.from(elements, growable: growable);
-  }
-
-  @patch
-  factory List.generate(int length, E generator(int index),
-      {bool growable = true}) {
-    final result = growable
-        ? new JSArray<E>.growable(length)
-        : new JSArray<E>.fixed(length);
-    for (int i = 0; i < length; i++) {
-      result[i] = generator(i);
-    }
-    return result;
-  }
-
-  @patch
-  factory List.unmodifiable(Iterable elements) {
-    var result = List<E>.from(elements, growable: false);
-    return makeFixedListUnmodifiable(result);
-  }
-}
-
-@patch
-class Map<K, V> {
-  @patch
-  factory Map.unmodifiable(Map other) = ConstantMap<K, V>.from;
-
-  @patch
-  factory Map() = JsLinkedHashMap<K, V>.es6;
-}
-
-@patch
-class String {
-  @patch
-  factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int? end]) {
-    if (charCodes is JSArray) {
-      // Type promotion doesn't work unless the check is `is JSArray<int>`,
-      // which is more expensive.
-      // TODO(41383): Optimize `is JSArray<int>` rather than do weird 'casts'.
-      JSArray array = JS('JSArray', '#', charCodes);
-      return _stringFromJSArray(array, start, end);
-    }
-    if (charCodes is NativeUint8List) {
-      return _stringFromUint8List(charCodes, start, end);
-    }
-    return _stringFromIterable(charCodes, start, end);
-  }
-
-  @patch
-  factory String.fromCharCode(int charCode) {
-    return Primitives.stringFromCharCode(charCode);
-  }
-
-  static String _stringFromJSArray(JSArray list, int start, int? endOrNull) {
-    int len = list.length;
-    int end = RangeError.checkValidRange(start, endOrNull, len);
-    if (start > 0 || end < len) {
-      list = JS('JSArray', '#.slice(#, #)', list, start, end);
-    }
-    return Primitives.stringFromCharCodes(list);
-  }
-
-  static String _stringFromUint8List(
-      NativeUint8List charCodes, int start, int? endOrNull) {
-    int len = charCodes.length;
-    int end = RangeError.checkValidRange(start, endOrNull, len);
-    return Primitives.stringFromNativeUint8List(charCodes, start, end);
-  }
-
-  static String _stringFromIterable(
-      Iterable<int> charCodes, int start, int? end) {
-    if (start < 0) throw new RangeError.range(start, 0, charCodes.length);
-    if (end != null && end < start) {
-      throw new RangeError.range(end, start, charCodes.length);
-    }
-    var it = charCodes.iterator;
-    for (int i = 0; i < start; i++) {
-      if (!it.moveNext()) {
-        throw new RangeError.range(start, 0, i);
-      }
-    }
-    var list = [];
-    if (end == null) {
-      while (it.moveNext()) list.add(it.current);
-    } else {
-      for (int i = start; i < end; i++) {
-        if (!it.moveNext()) {
-          throw new RangeError.range(end, start, i);
-        }
-        list.add(it.current);
-      }
-    }
-    return Primitives.stringFromCharCodes(list);
-  }
-}
-
-@patch
-class bool {
-  @patch
-  int get hashCode => super.hashCode;
-}
-
-@patch
-class RegExp {
-  @pragma('dart2js:noInline')
-  @patch
-  factory RegExp(String source,
-          {bool multiLine: false,
-          bool caseSensitive: true,
-          bool unicode: false,
-          bool dotAll: false}) =>
-      new JSSyntaxRegExp(source,
-          multiLine: multiLine,
-          caseSensitive: caseSensitive,
-          unicode: unicode,
-          dotAll: dotAll);
-
-  @patch
-  static String escape(String text) => quoteStringForRegExp(text);
-}
-
-// Patch for 'identical' function.
-@pragma(
-    'dart2js:noInline') // No inlining since we recognize the call in optimizer.
-@patch
-bool identical(Object? a, Object? b) {
-  return JS('bool', '(# == null ? # == null : # === #)', a, b, a, b);
-}
-
-@patch
-class StringBuffer {
-  String _contents;
-
-  @patch
-  StringBuffer([Object content = ""]) : _contents = '$content';
-
-  @patch
-  int get length => _contents.length;
-
-  @patch
-  void write(Object? obj) {
-    _writeString('$obj');
-  }
-
-  @patch
-  void writeCharCode(int charCode) {
-    _writeString(new String.fromCharCode(charCode));
-  }
-
-  @patch
-  void writeAll(Iterable<dynamic> objects, [String separator = ""]) {
-    _contents = _writeAll(_contents, objects, separator);
-  }
-
-  @patch
-  void writeln([Object? obj = ""]) {
-    _writeString('$obj\n');
-  }
-
-  @patch
-  void clear() {
-    _contents = "";
-  }
-
-  @patch
-  String toString() => Primitives.flattenString(_contents);
-
-  void _writeString(String str) {
-    _contents = Primitives.stringConcatUnchecked(_contents, str);
-  }
-
-  static String _writeAll(String string, Iterable objects, String separator) {
-    Iterator iterator = objects.iterator;
-    if (!iterator.moveNext()) return string;
-    if (separator.isEmpty) {
-      do {
-        string = _writeOne(string, iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      string = _writeOne(string, iterator.current);
-      while (iterator.moveNext()) {
-        string = _writeOne(string, separator);
-        string = _writeOne(string, iterator.current);
-      }
-    }
-    return string;
-  }
-
-  static String _writeOne(String string, Object? obj) {
-    return Primitives.stringConcatUnchecked(string, '$obj');
-  }
-}
-
-@patch
-class NoSuchMethodError {
-  final Object? _receiver;
-  final Symbol _memberName;
-  final List? _arguments;
-  final Map<Symbol, dynamic>? _namedArguments;
-  final List? _existingArgumentNames;
-
-  @patch
-  NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation)
-      : this(receiver, invocation.memberName, invocation.positionalArguments,
-            invocation.namedArguments);
-
-  @patch
-  NoSuchMethodError(Object? receiver, Symbol memberName,
-      List? positionalArguments, Map<Symbol, dynamic>? namedArguments,
-      [List? existingArgumentNames = null])
-      : _receiver = receiver,
-        _memberName = memberName,
-        _arguments = positionalArguments,
-        _namedArguments = namedArguments,
-        _existingArgumentNames = existingArgumentNames;
-
-  @patch
-  String toString() {
-    StringBuffer sb = StringBuffer('');
-    String comma = '';
-    var arguments = _arguments;
-    if (arguments != null) {
-      for (var argument in arguments) {
-        sb.write(comma);
-        sb.write(Error.safeToString(argument));
-        comma = ', ';
-      }
-    }
-    var namedArguments = _namedArguments;
-    if (namedArguments != null) {
-      namedArguments.forEach((Symbol key, var value) {
-        sb.write(comma);
-        sb.write(_symbolToString(key));
-        sb.write(": ");
-        sb.write(Error.safeToString(value));
-        comma = ', ';
-      });
-    }
-    String memberName = _symbolToString(_memberName);
-    String receiverText = Error.safeToString(_receiver);
-    String actualParameters = '$sb';
-    var existingArgumentNames = _existingArgumentNames;
-    if (existingArgumentNames == null) {
-      return "NoSuchMethodError: method not found: '$memberName'\n"
-          "Receiver: ${receiverText}\n"
-          "Arguments: [$actualParameters]";
-    } else {
-      String formalParameters = existingArgumentNames.join(', ');
-      return "NoSuchMethodError: incorrect number of arguments passed to "
-          "method named '$memberName'\n"
-          "Receiver: ${receiverText}\n"
-          "Tried calling: $memberName($actualParameters)\n"
-          "Found: $memberName($formalParameters)";
-    }
-  }
-}
-
-class _CompileTimeError extends Error {
-  final String _errorMsg;
-  // TODO(sigmund): consider calling `JS('', 'debugger')`.
-  _CompileTimeError(this._errorMsg);
-  String toString() => _errorMsg;
-}
-
-@patch
-class Uri {
-  @patch
-  static Uri get base {
-    String? uri = Primitives.currentUri();
-    if (uri != null) return Uri.parse(uri);
-    throw new UnsupportedError("'Uri.base' is not supported");
-  }
-}
-
-@patch
-class _Uri {
-  @patch
-  static bool get _isWindows => _isWindowsCached;
-
-  static final bool _isWindowsCached = JS(
-      'bool',
-      'typeof process != "undefined" && '
-          'Object.prototype.toString.call(process) == "[object process]" && '
-          'process.platform == "win32"');
-
-  // Matches a String that _uriEncodes to itself regardless of the kind of
-  // component.  This corresponds to [_unreservedTable], i.e. characters that
-  // are not encoded by any encoding table.
-  static final RegExp _needsNoEncoding = new RegExp(r'^[\-\.0-9A-Z_a-z~]*$');
-
-  /// This is the internal implementation of JavaScript's encodeURI function.
-  /// It encodes all characters in the string [text] except for those
-  /// that appear in [canonicalTable], and returns the escaped string.
-  @patch
-  static String _uriEncode(List<int> canonicalTable, String text,
-      Encoding encoding, bool spaceToPlus) {
-    if (identical(encoding, utf8) && _needsNoEncoding.hasMatch(text)) {
-      return text;
-    }
-
-    // Encode the string into bytes then generate an ASCII only string
-    // by percent encoding selected bytes.
-    StringBuffer result = new StringBuffer('');
-    var bytes = encoding.encode(text);
-    for (int i = 0; i < bytes.length; i++) {
-      int byte = bytes[i];
-      if (byte < 128 &&
-          ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
-        result.writeCharCode(byte);
-      } else if (spaceToPlus && byte == _SPACE) {
-        result.write('+');
-      } else {
-        const String hexDigits = '0123456789ABCDEF';
-        result.write('%');
-        result.write(hexDigits[(byte >> 4) & 0x0f]);
-        result.write(hexDigits[byte & 0x0f]);
-      }
-    }
-    return result.toString();
-  }
-}
-
-bool _hasErrorStackProperty = JS('bool', 'new Error().stack != void 0');
-
-@patch
-class StackTrace {
-  @patch
-  @pragma('dart2js:noInline')
-  static StackTrace get current {
-    if (_hasErrorStackProperty) {
-      return getTraceFromException(JS('', 'new Error()'));
-    }
-    // Fallback if new Error().stack does not exist.
-    // Currently only required for IE 11.
-    try {
-      throw '';
-    } catch (_, stackTrace) {
-      return stackTrace;
-    }
-  }
-}
-
-// Called from kernel generated code.
-_malformedTypeError(message) => new RuntimeError(message);
-
-// Called from kernel generated code.
-_genericNoSuchMethod(receiver, memberName, positionalArguments, namedArguments,
-    existingArguments) {
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedConstructorError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate an error that reads:
-  //
-  //     No constructor '$memberName' declared in class '$receiver'.
-
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedStaticGetterError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate customized message.
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedStaticSetterError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate customized message.
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedStaticMethodError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate customized message.
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedTopLevelGetterError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate customized message.
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedTopLevelSetterError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate customized message.
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-// Called from kernel generated code.
-_unresolvedTopLevelMethodError(receiver, memberName, positionalArguments,
-    namedArguments, existingArguments) {
-  // TODO(sra): Generate customized message.
-  return new NoSuchMethodError(
-      receiver, memberName, positionalArguments, namedArguments);
-}
-
-/// Used by Fasta to report a runtime error when a final field with an
-/// initializer is also initialized in a generative constructor.
-///
-/// Note: in strong mode, this is a compile-time error and this class becomes
-/// obsolete.
-class _DuplicatedFieldInitializerError extends Error {
-  final String _name;
-
-  _DuplicatedFieldInitializerError(this._name);
-
-  toString() => "Error: field '$_name' is already initialized.";
-}
-
-// TODO(sra): The rest of this core_patch.dart source should reside in an
-// included part file instead of being inlined. However, part files are not
-// properly supported here.
-
-// Copyright (c) 2017, 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.
-
-// part of dart.core;
-
-int _max(int a, int b) => a > b ? a : b;
-int _min(int a, int b) => a < b ? a : b;
-
-/// Empty list used as an initializer for local variables in the `_BigIntImpl`.
-final _dummyList = new Uint16List(0);
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
- * Copyright (c) 2003-2005  Tom Wu
- * Copyright (c) 2012 Adam Singer (adam@solvr.io)
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
- * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * In addition, the following condition applies:
- *
- * All redistributions must retain an intact copy of this copyright notice
- * and disclaimer.
- */
-
-/// An implementation for the arbitrarily large integer.
-///
-/// The integer number is represented by a sign, an array of 16-bit unsigned
-/// integers in little endian format, and a number of used digits in that array.
-class _BigIntImpl implements BigInt {
-  // Bits per digit.
-  static const int _digitBits = 16;
-  static const int _digitBase = 1 << _digitBits;
-  static const int _digitMask = (1 << _digitBits) - 1;
-
-  static final _BigIntImpl zero = new _BigIntImpl._fromInt(0);
-  static final _BigIntImpl one = new _BigIntImpl._fromInt(1);
-  static final _BigIntImpl two = new _BigIntImpl._fromInt(2);
-
-  static final _BigIntImpl _minusOne = -one;
-  static final _BigIntImpl _bigInt10000 = new _BigIntImpl._fromInt(10000);
-
-  // Result cache for last _divRem call.
-  // Result cache for last _divRem call.
-  static Uint16List? _lastDividendDigits;
-  static int? _lastDividendUsed;
-  static Uint16List? _lastDivisorDigits;
-  static int? _lastDivisorUsed;
-  static late Uint16List _lastQuoRemDigits;
-  static late int _lastQuoRemUsed;
-  static late int _lastRemUsed;
-  static late int _lastRem_nsh;
-
-  /// Whether this bigint is negative.
-  final bool _isNegative;
-
-  /// The unsigned digits of this bigint.
-  ///
-  /// The least significant digit is in slot 0.
-  /// The list may have more digits than needed. That is, `_digits.length` may
-  /// be strictly greater than `_used`.
-  final Uint16List _digits;
-
-  /// The number of used entries in [_digits].
-  ///
-  /// To avoid reallocating [Uint16List]s, lists that are too big are not
-  /// replaced.
-  final int _used;
-
-  /// Parses [source] as a, possibly signed, integer literal and returns its
-  /// value.
-  ///
-  /// The [source] must be a non-empty sequence of base-[radix] digits,
-  /// optionally prefixed with a minus or plus sign ('-' or '+').
-  ///
-  /// The [radix] must be in the range 2..36. The digits used are
-  /// first the decimal digits 0..9, and then the letters 'a'..'z' with
-  /// values 10 through 35. Also accepts upper-case letters with the same
-  /// values as the lower-case ones.
-  ///
-  /// If no [radix] is given then it defaults to 10. In this case, the [source]
-  /// digits may also start with `0x`, in which case the number is interpreted
-  /// as a hexadecimal literal, which effectively means that the `0x` is ignored
-  /// and the radix is instead set to 16.
-  ///
-  /// For any int `n` and radix `r`, it is guaranteed that
-  /// `n == int.parse(n.toRadixString(r), radix: r)`.
-  ///
-  /// Throws a [FormatException] if the [source] is not a valid integer literal,
-  /// optionally prefixed by a sign.
-  static _BigIntImpl parse(String source, {int? radix}) {
-    var result = _tryParse(source, radix: radix);
-    if (result == null) {
-      throw new FormatException("Could not parse BigInt", source);
-    }
-    return result;
-  }
-
-  /// Parses a decimal bigint literal.
-  ///
-  /// The [source] must not contain leading or trailing whitespace.
-  static _BigIntImpl _parseDecimal(String source, bool isNegative) {
-    const _0 = 48;
-
-    int part = 0;
-    _BigIntImpl result = zero;
-    // Read in the source 4 digits at a time.
-    // The first part may have a few leading virtual '0's to make the remaining
-    // parts all have exactly 4 digits.
-    var digitInPartCount = 4 - source.length.remainder(4);
-    if (digitInPartCount == 4) digitInPartCount = 0;
-    for (int i = 0; i < source.length; i++) {
-      part = part * 10 + source.codeUnitAt(i) - _0;
-      if (++digitInPartCount == 4) {
-        result = result * _bigInt10000 + new _BigIntImpl._fromInt(part);
-        part = 0;
-        digitInPartCount = 0;
-      }
-    }
-    if (isNegative) return -result;
-    return result;
-  }
-
-  /// Returns the value of a given source digit.
-  ///
-  /// Source digits between "0" and "9" (inclusive) return their decimal value.
-  ///
-  /// Source digits between "a" and "z", or "A" and "Z" (inclusive) return
-  /// 10 + their position in the ASCII alphabet.
-  ///
-  /// The incoming [codeUnit] must be an ASCII code-unit.
-  static int _codeUnitToRadixValue(int codeUnit) {
-    // We know that the characters must be ASCII as otherwise the
-    // regexp wouldn't have matched. Lowercasing by doing `| 0x20` is thus
-    // guaranteed to be a safe operation, since it preserves digits
-    // and lower-cases ASCII letters.
-    const int _0 = 48;
-    const int _9 = 57;
-    const int _a = 97;
-    if (_0 <= codeUnit && codeUnit <= _9) return codeUnit - _0;
-    codeUnit |= 0x20;
-    var result = codeUnit - _a + 10;
-    return result;
-  }
-
-  /// Parses the given [source] string, starting at [startPos], as a hex
-  /// literal.
-  ///
-  /// If [isNegative] is true, negates the result before returning it.
-  ///
-  /// The [source] (substring) must be a valid hex literal.
-  static _BigIntImpl? _parseHex(String source, int startPos, bool isNegative) {
-    int hexDigitsPerChunk = _digitBits ~/ 4;
-    int sourceLength = source.length - startPos;
-    int chunkCount = (sourceLength / hexDigitsPerChunk).ceil();
-    var digits = new Uint16List(chunkCount);
-
-    int lastDigitLength = sourceLength - (chunkCount - 1) * hexDigitsPerChunk;
-    int digitIndex = digits.length - 1;
-    int i = startPos;
-    int chunk = 0;
-    for (int j = 0; j < lastDigitLength; j++) {
-      var digitValue = _codeUnitToRadixValue(source.codeUnitAt(i++));
-      if (digitValue >= 16) return null;
-      chunk = chunk * 16 + digitValue;
-    }
-    digits[digitIndex--] = chunk;
-
-    while (i < source.length) {
-      chunk = 0;
-      for (int j = 0; j < hexDigitsPerChunk; j++) {
-        var digitValue = _codeUnitToRadixValue(source.codeUnitAt(i++));
-        if (digitValue >= 16) return null;
-        chunk = chunk * 16 + digitValue;
-      }
-      digits[digitIndex--] = chunk;
-    }
-    if (digits.length == 1 && digits[0] == 0) return zero;
-    return new _BigIntImpl._(isNegative, digits.length, digits);
-  }
-
-  /// Parses the given [source] as a [radix] literal.
-  ///
-  /// The [source] will be checked for invalid characters. If it is invalid,
-  /// this function returns `null`.
-  static _BigIntImpl? _parseRadix(String source, int radix, bool isNegative) {
-    var result = zero;
-    var base = new _BigIntImpl._fromInt(radix);
-    for (int i = 0; i < source.length; i++) {
-      var digitValue = _codeUnitToRadixValue(source.codeUnitAt(i));
-      if (digitValue >= radix) return null;
-      result = result * base + new _BigIntImpl._fromInt(digitValue);
-    }
-    if (isNegative) return -result;
-    return result;
-  }
-
-  /// Tries to parse the given [source] as a [radix] literal.
-  ///
-  /// Returns the parsed big integer, or `null` if it failed.
-  ///
-  /// If the [radix] is `null` accepts decimal literals or `0x` hex literals.
-  static _BigIntImpl? _tryParse(String source, {int? radix}) {
-    if (source == "") return null;
-
-    var match = _parseRE.firstMatch(source);
-    int signIndex = 1;
-    int hexIndex = 3;
-    int decimalIndex = 4;
-    int nonDecimalHexIndex = 5;
-    if (match == null) return null;
-
-    bool isNegative = match[signIndex] == "-";
-
-    String? decimalMatch = match[decimalIndex];
-    String? hexMatch = match[hexIndex];
-    String? nonDecimalMatch = match[nonDecimalHexIndex];
-
-    if (radix == null) {
-      if (decimalMatch != null) {
-        // Cannot fail because we know that the digits are all decimal.
-        return _parseDecimal(decimalMatch, isNegative);
-      }
-      if (hexMatch != null) {
-        // Cannot fail because we know that the digits are all hex.
-        return _parseHex(hexMatch, 2, isNegative);
-      }
-      return null;
-    }
-
-    if (radix is! int) {
-      throw new ArgumentError.value(radix, 'radix', 'is not an integer');
-    }
-    if (radix < 2 || radix > 36) {
-      throw new RangeError.range(radix, 2, 36, 'radix');
-    }
-    if (radix == 10 && decimalMatch != null) {
-      return _parseDecimal(decimalMatch, isNegative);
-    }
-    if (radix == 16 && (decimalMatch != null || nonDecimalMatch != null)) {
-      return _parseHex(decimalMatch ?? nonDecimalMatch!, 0, isNegative);
-    }
-
-    return _parseRadix(
-        decimalMatch ?? nonDecimalMatch ?? hexMatch!, radix, isNegative);
-  }
-
-  static RegExp _parseRE = RegExp(
-      r'^\s*([+-]?)((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$',
-      caseSensitive: false);
-
-  /// Finds the amount significant digits in the provided [digits] array.
-  static int _normalize(int used, Uint16List digits) {
-    while (used > 0 && digits[used - 1] == 0) used--;
-    return 0 + used; // force inferred result to be non-null.
-  }
-
-  /// Factory returning an instance initialized with the given field values.
-  /// If the [digits] array contains leading 0s, the [used] value is adjusted
-  /// accordingly. The [digits] array is not modified.
-  _BigIntImpl._(bool isNegative, int used, Uint16List digits)
-      : this._normalized(isNegative, _normalize(used, digits), digits);
-
-  _BigIntImpl._normalized(bool isNegative, this._used, this._digits)
-      : _isNegative = _used == 0 ? false : isNegative;
-
-  /// Whether this big integer is zero.
-  bool get _isZero => _used == 0;
-
-  /// Allocates an array of the given [length] and copies the [digits] in the
-  /// range [from] to [to-1], starting at index 0, followed by leading zero
-  /// digits.
-  static Uint16List _cloneDigits(
-      Uint16List digits, int from, int to, int length) {
-    var resultDigits = new Uint16List(length);
-    var n = to - from;
-    for (var i = 0; i < n; i++) {
-      resultDigits[i] = digits[from + i];
-    }
-    return resultDigits;
-  }
-
-  /// Allocates a big integer from the provided [value] number.
-  factory _BigIntImpl.from(num value) {
-    if (value == 0) return zero;
-    if (value == 1) return one;
-    if (value == 2) return two;
-
-    // Given this order dart2js will use the `_fromInt` for smaller value and
-    // then use the bit-manipulating `_fromDouble` for all other values.
-    if (value.abs() < 0x100000000)
-      return new _BigIntImpl._fromInt(value.toInt());
-    if (value is double) return new _BigIntImpl._fromDouble(value);
-    return new _BigIntImpl._fromInt(value as int);
-  }
-
-  factory _BigIntImpl._fromInt(int value) {
-    bool isNegative = value < 0;
-    assert(_digitBits == 16);
-    if (isNegative) {
-      // Handle the min 64-bit value differently, since its negation is not
-      // positive.
-      const int minInt64 = -0x80000000 * 0x100000000;
-      if (value == minInt64) {
-        var digits = new Uint16List(4);
-        digits[3] = 0x8000;
-        return new _BigIntImpl._(true, 4, digits);
-      }
-      value = -value;
-    }
-    if (value < _digitBase) {
-      var digits = new Uint16List(1);
-      digits[0] = value;
-      return new _BigIntImpl._(isNegative, 1, digits);
-    }
-    if (value <= 0xFFFFFFFF) {
-      var digits = new Uint16List(2);
-      digits[0] = value & _digitMask;
-      digits[1] = value >> _digitBits;
-      return new _BigIntImpl._(isNegative, 2, digits);
-    }
-
-    var bits = value.bitLength;
-    var digits = new Uint16List((bits - 1) ~/ _digitBits + 1);
-    var i = 0;
-    while (value != 0) {
-      digits[i++] = value & _digitMask;
-      value = value ~/ _digitBase;
-    }
-    return new _BigIntImpl._(isNegative, digits.length, digits);
-  }
-
-  /// An 8-byte Uint8List we can reuse for [_fromDouble] to avoid generating
-  /// garbage.
-  static final Uint8List _bitsForFromDouble = new Uint8List(8);
-
-  factory _BigIntImpl._fromDouble(double value) {
-    const int exponentBias = 1075;
-
-    if (value.isNaN || value.isInfinite) {
-      throw new ArgumentError("Value must be finite: $value");
-    }
-    bool isNegative = value < 0;
-    if (isNegative) value = -value;
-
-    value = value.floorToDouble();
-    if (value == 0) return zero;
-
-    var bits = _bitsForFromDouble;
-    for (int i = 0; i < 8; i++) {
-      bits[i] = 0;
-    }
-    bits.buffer.asByteData().setFloat64(0, value, Endian.little);
-    // The exponent is in bits 53..63.
-    var biasedExponent = (bits[7] << 4) + (bits[6] >> 4);
-    var exponent = biasedExponent - exponentBias;
-
-    assert(_digitBits == 16);
-    // The significant bits are in 0 .. 52.
-    var unshiftedDigits = new Uint16List(4);
-    unshiftedDigits[0] = (bits[1] << 8) + bits[0];
-    unshiftedDigits[1] = (bits[3] << 8) + bits[2];
-    unshiftedDigits[2] = (bits[5] << 8) + bits[4];
-    // Don't forget to add the hidden bit.
-    unshiftedDigits[3] = 0x10 | (bits[6] & 0xF);
-
-    var unshiftedBig = new _BigIntImpl._normalized(false, 4, unshiftedDigits);
-    _BigIntImpl absResult = unshiftedBig;
-    if (exponent < 0) {
-      absResult = unshiftedBig >> -exponent;
-    } else if (exponent > 0) {
-      absResult = unshiftedBig << exponent;
-    }
-    if (isNegative) return -absResult;
-    return absResult;
-  }
-
-  /// Return the negative value of this integer.
-  ///
-  /// The result of negating an integer always has the opposite sign, except
-  /// for zero, which is its own negation.
-  _BigIntImpl operator -() {
-    if (_used == 0) return this;
-    return new _BigIntImpl._(!_isNegative, _used, _digits);
-  }
-
-  /// Returns the absolute value of this integer.
-  ///
-  /// For any integer `x`, the result is the same as `x < 0 ? -x : x`.
-  _BigIntImpl abs() => _isNegative ? -this : this;
-
-  /// Returns this << n *_DIGIT_BITS.
-  _BigIntImpl _dlShift(int n) {
-    final used = _used;
-    if (used == 0) {
-      return zero;
-    }
-    final resultUsed = used + n;
-    final digits = _digits;
-    final resultDigits = new Uint16List(resultUsed);
-    for (int i = used - 1; i >= 0; i--) {
-      resultDigits[i + n] = digits[i];
-    }
-    return new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-  }
-
-  /// Same as [_dlShift] but works on the decomposed big integers.
-  ///
-  /// Returns `resultUsed`.
-  ///
-  /// `resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] << n*_DIGIT_BITS`.
-  static int _dlShiftDigits(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    if (xUsed == 0) {
-      return 0;
-    }
-    if (n == 0 && identical(resultDigits, xDigits)) {
-      return xUsed;
-    }
-    final resultUsed = xUsed + n;
-    for (int i = xUsed - 1; i >= 0; i--) {
-      resultDigits[i + n] = xDigits[i];
-    }
-    for (int i = n - 1; i >= 0; i--) {
-      resultDigits[i] = 0;
-    }
-    return resultUsed;
-  }
-
-  /// Returns `this >> n*_DIGIT_BITS`.
-  _BigIntImpl _drShift(int n) {
-    final used = _used;
-    if (used == 0) {
-      return zero;
-    }
-    final resultUsed = used - n;
-    if (resultUsed <= 0) {
-      return _isNegative ? _minusOne : zero;
-    }
-    final digits = _digits;
-    final resultDigits = new Uint16List(resultUsed);
-    for (var i = n; i < used; i++) {
-      resultDigits[i - n] = digits[i];
-    }
-    final result = new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-    if (_isNegative) {
-      // Round down if any bit was shifted out.
-      for (var i = 0; i < n; i++) {
-        if (digits[i] != 0) {
-          return result - one;
-        }
-      }
-    }
-    return result;
-  }
-
-  /// Shifts the digits of [xDigits] into the right place in [resultDigits].
-  ///
-  /// `resultDigits[ds..xUsed+ds] = xDigits[0..xUsed-1] << (n % _DIGIT_BITS)`
-  ///   where `ds = n ~/ _DIGIT_BITS`
-  ///
-  /// Does *not* clear digits below ds.
-  static void _lsh(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    assert(xUsed > 0);
-    final digitShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    final carryBitShift = _digitBits - bitShift;
-    final bitMask = (1 << carryBitShift) - 1;
-    var carry = 0;
-    for (int i = xUsed - 1; i >= 0; i--) {
-      final digit = xDigits[i];
-      resultDigits[i + digitShift + 1] = (digit >> carryBitShift) | carry;
-      carry = (digit & bitMask) << bitShift;
-    }
-    resultDigits[digitShift] = carry;
-  }
-
-  /// Shift the bits of this integer to the left by [shiftAmount].
-  ///
-  /// Shifting to the left makes the number larger, effectively multiplying
-  /// the number by `pow(2, shiftIndex)`.
-  ///
-  /// There is no limit on the size of the result. It may be relevant to
-  /// limit intermediate values by using the "and" operator with a suitable
-  /// mask.
-  ///
-  /// It is an error if [shiftAmount] is negative.
-  _BigIntImpl operator <<(int shiftAmount) {
-    if (shiftAmount < 0) {
-      throw new ArgumentError("shift-amount must be posititve $shiftAmount");
-    }
-    if (_isZero) return this;
-    final digitShift = shiftAmount ~/ _digitBits;
-    final bitShift = shiftAmount % _digitBits;
-    if (bitShift == 0) {
-      return _dlShift(digitShift);
-    }
-    var resultUsed = _used + digitShift + 1;
-    var resultDigits = new Uint16List(resultUsed);
-    _lsh(_digits, _used, shiftAmount, resultDigits);
-    return new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-  }
-
-  // resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] << n.
-  // Returns resultUsed.
-  static int _lShiftDigits(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    final digitsShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    if (bitShift == 0) {
-      return _dlShiftDigits(xDigits, xUsed, digitsShift, resultDigits);
-    }
-    var resultUsed = xUsed + digitsShift + 1;
-    _lsh(xDigits, xUsed, n, resultDigits);
-    var i = digitsShift;
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    if (resultDigits[resultUsed - 1] == 0) {
-      resultUsed--; // Clamp result.
-    }
-    return resultUsed;
-  }
-
-  // resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] >> n.
-  static void _rsh(
-      Uint16List xDigits, int xUsed, int n, Uint16List resultDigits) {
-    assert(xUsed > 0);
-    final digitsShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    final carryBitShift = _digitBits - bitShift;
-    final bitMask = (1 << bitShift) - 1;
-    var carry = xDigits[digitsShift] >> bitShift;
-    final last = xUsed - digitsShift - 1;
-    for (var i = 0; i < last; i++) {
-      final digit = xDigits[i + digitsShift + 1];
-      resultDigits[i] = ((digit & bitMask) << carryBitShift) | carry;
-      carry = digit >> bitShift;
-    }
-    resultDigits[last] = carry;
-  }
-
-  /// Shift the bits of this integer to the right by [shiftAmount].
-  ///
-  /// Shifting to the right makes the number smaller and drops the least
-  /// significant bits, effectively doing an integer division by
-  /// `pow(2, shiftIndex)`.
-  ///
-  /// It is an error if [shiftAmount] is negative.
-  _BigIntImpl operator >>(int shiftAmount) {
-    if (shiftAmount < 0) {
-      throw new ArgumentError("shift-amount must be posititve $shiftAmount");
-    }
-    if (_isZero) return this;
-    final digitShift = shiftAmount ~/ _digitBits;
-    final bitShift = shiftAmount % _digitBits;
-    if (bitShift == 0) {
-      return _drShift(digitShift);
-    }
-    final used = _used;
-    final resultUsed = used - digitShift;
-    if (resultUsed <= 0) {
-      return _isNegative ? _minusOne : zero;
-    }
-    final digits = _digits;
-    final resultDigits = new Uint16List(resultUsed);
-    _rsh(digits, used, shiftAmount, resultDigits);
-    final result = new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-    if (_isNegative) {
-      // Round down if any bit was shifted out.
-      if ((digits[digitShift] & ((1 << bitShift) - 1)) != 0) {
-        return result - one;
-      }
-      for (var i = 0; i < digitShift; i++) {
-        if (digits[i] != 0) {
-          return result - one;
-        }
-      }
-    }
-    return result;
-  }
-
-  /// Compares this to [other] taking the absolute value of both operands.
-  ///
-  /// Returns 0 if abs(this) == abs(other); a positive number if
-  /// abs(this) > abs(other); and a negative number if abs(this) < abs(other).
-  int _absCompare(_BigIntImpl other) {
-    return _compareDigits(_digits, _used, other._digits, other._used);
-  }
-
-  /// Compares this to `other`.
-  ///
-  /// Returns a negative number if `this` is less than `other`, zero if they are
-  /// equal, and a positive number if `this` is greater than `other`.
-  int compareTo(covariant _BigIntImpl other) {
-    if (_isNegative == other._isNegative) {
-      var result = _absCompare(other);
-      // Use 0 - result to avoid negative zero in JavaScript.
-      return _isNegative ? 0 - result : result;
-    }
-    return _isNegative ? -1 : 1;
-  }
-
-  /// Compares `digits[0..used-1]` with `otherDigits[0..otherUsed-1]`.
-  ///
-  /// Returns 0 if equal; a positive number if larger;
-  /// and a negative number if smaller.
-  static int _compareDigits(
-      Uint16List digits, int used, Uint16List otherDigits, int otherUsed) {
-    var result = used - otherUsed;
-    if (result == 0) {
-      for (int i = used - 1; i >= 0; i--) {
-        result = digits[i] - otherDigits[i];
-        if (result != 0) return result;
-      }
-    }
-    return result;
-  }
-
-  // resultDigits[0..used] = digits[0..used-1] + otherDigits[0..otherUsed-1].
-  // used >= otherUsed > 0.
-  static void _absAdd(Uint16List digits, int used, Uint16List otherDigits,
-      int otherUsed, Uint16List resultDigits) {
-    assert(used >= otherUsed && otherUsed > 0);
-    var carry = 0;
-    for (var i = 0; i < otherUsed; i++) {
-      carry += digits[i] + otherDigits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    for (var i = otherUsed; i < used; i++) {
-      carry += digits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    resultDigits[used] = carry;
-  }
-
-  // resultDigits[0..used-1] = digits[0..used-1] - otherDigits[0..otherUsed-1].
-  // used >= otherUsed > 0.
-  static void _absSub(Uint16List digits, int used, Uint16List otherDigits,
-      int otherUsed, Uint16List resultDigits) {
-    assert(used >= otherUsed && otherUsed > 0);
-
-    var carry = 0;
-    for (var i = 0; i < otherUsed; i++) {
-      carry += digits[i] - otherDigits[i];
-      resultDigits[i] = carry & _digitMask;
-      // Dart2js only supports unsigned shifts.
-      // Since the carry can only be -1 or 0 use this hack.
-      carry = 0 - ((carry >> _digitBits) & 1);
-    }
-    for (var i = otherUsed; i < used; i++) {
-      carry += digits[i];
-      resultDigits[i] = carry & _digitMask;
-      // Dart2js only supports unsigned shifts.
-      // Since the carry can only be -1 or 0 use this hack.
-      carry = 0 - ((carry >> _digitBits) & 1);
-    }
-  }
-
-  /// Returns `abs(this) + abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAddSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    if (used < otherUsed) {
-      return other._absAddSetSign(this, isNegative);
-    }
-    if (used == 0) {
-      assert(!isNegative);
-      return zero;
-    }
-    if (otherUsed == 0) {
-      return _isNegative == isNegative ? this : -this;
-    }
-    var resultUsed = used + 1;
-    var resultDigits = new Uint16List(resultUsed);
-    _absAdd(_digits, used, other._digits, otherUsed, resultDigits);
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) - abs(other)` with sign set according to [isNegative].
-  ///
-  /// Requirement: `abs(this) >= abs(other)`.
-  _BigIntImpl _absSubSetSign(_BigIntImpl other, bool isNegative) {
-    assert(_absCompare(other) >= 0);
-    var used = _used;
-    if (used == 0) {
-      assert(!isNegative);
-      return zero;
-    }
-    var otherUsed = other._used;
-    if (otherUsed == 0) {
-      return _isNegative == isNegative ? this : -this;
-    }
-    var resultDigits = new Uint16List(used);
-    _absSub(_digits, used, other._digits, otherUsed, resultDigits);
-    return new _BigIntImpl._(isNegative, used, resultDigits);
-  }
-
-  /// Returns `abs(this) & abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAndSetSign(_BigIntImpl other, bool isNegative) {
-    var resultUsed = _min(_used, other._used);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = new Uint16List(resultUsed);
-    for (var i = 0; i < resultUsed; i++) {
-      resultDigits[i] = digits[i] & otherDigits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) &~ abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAndNotSetSign(_BigIntImpl other, bool isNegative) {
-    var resultUsed = _used;
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = new Uint16List(resultUsed);
-    var m = _min(resultUsed, other._used);
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] & ~otherDigits[i];
-    }
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = digits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) | abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absOrSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    var resultUsed = _max(used, otherUsed);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = new Uint16List(resultUsed);
-    _BigIntImpl l;
-    int m;
-    if (used < otherUsed) {
-      l = other;
-      m = used;
-    } else {
-      l = this;
-      m = otherUsed;
-    }
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] | otherDigits[i];
-    }
-    var lDigits = l._digits;
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = lDigits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) ^ abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absXorSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    var resultUsed = _max(used, otherUsed);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = new Uint16List(resultUsed);
-    _BigIntImpl l;
-    int m;
-    if (used < otherUsed) {
-      l = other;
-      m = used;
-    } else {
-      l = this;
-      m = otherUsed;
-    }
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] ^ otherDigits[i];
-    }
-    var lDigits = l._digits;
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = lDigits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Bit-wise and operator.
-  ///
-  /// Treating both `this` and [other] as sufficiently large two's component
-  /// integers, the result is a number with only the bits set that are set in
-  /// both `this` and [other]
-  ///
-  /// Of both operands are negative, the result is negative, otherwise
-  /// the result is non-negative.
-  _BigIntImpl operator &(covariant _BigIntImpl other) {
-    if (_isZero || other._isZero) return zero;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) & (-other) == ~(this-1) & ~(other-1)
-        //                    == ~((this-1) | (other-1))
-        //                    == -(((this-1) | (other-1)) + 1)
-        _BigIntImpl this1 = _absSubSetSign(one, true);
-        _BigIntImpl other1 = other._absSubSetSign(one, true);
-        // Result cannot be zero if this and other are negative.
-        return this1._absOrSetSign(other1, true)._absAddSetSign(one, true);
-      }
-      return _absAndSetSign(other, false);
-    }
-    // _isNegative != other._isNegative
-    _BigIntImpl p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // & is symmetric.
-      p = this;
-      n = other;
-    }
-    // p & (-n) == p & ~(n-1) == p &~ (n-1)
-    var n1 = n._absSubSetSign(one, false);
-    return p._absAndNotSetSign(n1, false);
-  }
-
-  /// Bit-wise or operator.
-  ///
-  /// Treating both `this` and [other] as sufficiently large two's component
-  /// integers, the result is a number with the bits set that are set in either
-  /// of `this` and [other]
-  ///
-  /// If both operands are non-negative, the result is non-negative,
-  /// otherwise the result us negative.
-  _BigIntImpl operator |(covariant _BigIntImpl other) {
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) | (-other) == ~(this-1) | ~(other-1)
-        //                    == ~((this-1) & (other-1))
-        //                    == -(((this-1) & (other-1)) + 1)
-        var this1 = _absSubSetSign(one, true);
-        var other1 = other._absSubSetSign(one, true);
-        // Result cannot be zero if this and a are negative.
-        return this1._absAndSetSign(other1, true)._absAddSetSign(one, true);
-      }
-      return _absOrSetSign(other, false);
-    }
-    // _neg != a._neg
-    _BigIntImpl p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // | is symmetric.
-      p = this;
-      n = other;
-    }
-    // p | (-n) == p | ~(n-1) == ~((n-1) &~ p) == -(~((n-1) &~ p) + 1)
-    var n1 = n._absSubSetSign(one, true);
-    // Result cannot be zero if only one of this or a is negative.
-    return n1._absAndNotSetSign(p, true)._absAddSetSign(one, true);
-  }
-
-  /// Bit-wise exclusive-or operator.
-  ///
-  /// Treating both `this` and [other] as sufficiently large two's component
-  /// integers, the result is a number with the bits set that are set in one,
-  /// but not both, of `this` and [other]
-  ///
-  /// If the operands have the same sign, the result is non-negative,
-  /// otherwise the result is negative.
-  _BigIntImpl operator ^(covariant _BigIntImpl other) {
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) ^ (-other) == ~(this-1) ^ ~(other-1) == (this-1) ^ (other-1)
-        var this1 = _absSubSetSign(one, true);
-        var other1 = other._absSubSetSign(one, true);
-        return this1._absXorSetSign(other1, false);
-      }
-      return _absXorSetSign(other, false);
-    }
-    // _isNegative != a._isNegative
-    _BigIntImpl p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // ^ is symmetric.
-      p = this;
-      n = other;
-    }
-    // p ^ (-n) == p ^ ~(n-1) == ~(p ^ (n-1)) == -((p ^ (n-1)) + 1)
-    var n1 = n._absSubSetSign(one, true);
-    // Result cannot be zero if only one of this or a is negative.
-    return p._absXorSetSign(n1, true)._absAddSetSign(one, true);
-  }
-
-  /// The bit-wise negate operator.
-  ///
-  /// Treating `this` as a sufficiently large two's component integer,
-  /// the result is a number with the opposite bits set.
-  ///
-  /// This maps any integer `x` to `-x - 1`.
-  _BigIntImpl operator ~() {
-    if (_isZero) return _minusOne;
-    if (_isNegative) {
-      // ~(-this) == ~(~(this-1)) == this-1
-      return _absSubSetSign(one, false);
-    }
-    // ~this == -this-1 == -(this+1)
-    // Result cannot be zero if this is positive.
-    return _absAddSetSign(one, true);
-  }
-
-  /// Addition operator.
-  _BigIntImpl operator +(covariant _BigIntImpl other) {
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    var isNegative = _isNegative;
-    if (isNegative == other._isNegative) {
-      // this + other == this + other
-      // (-this) + (-other) == -(this + other)
-      return _absAddSetSign(other, isNegative);
-    }
-    // this + (-other) == this - other == -(this - other)
-    // (-this) + other == other - this == -(this - other)
-    if (_absCompare(other) >= 0) {
-      return _absSubSetSign(other, isNegative);
-    }
-    return other._absSubSetSign(this, !isNegative);
-  }
-
-  /// Subtraction operator.
-  _BigIntImpl operator -(covariant _BigIntImpl other) {
-    if (_isZero) return -other;
-    if (other._isZero) return this;
-    var isNegative = _isNegative;
-    if (isNegative != other._isNegative) {
-      // this - (-other) == this + other
-      // (-this) - other == -(this + other)
-      return _absAddSetSign(other, isNegative);
-    }
-    // this - other == this - a == -(this - other)
-    // (-this) - (-other) == other - this == -(this - other)
-    if (_absCompare(other) >= 0) {
-      return _absSubSetSign(other, isNegative);
-    }
-    return other._absSubSetSign(this, !isNegative);
-  }
-
-  /// Multiplies [x] with [multiplicandDigits] and adds the result to
-  /// [accumulatorDigits].
-  ///
-  /// The [multiplicandDigits] in the range [i] to [i]+[n]-1 are the
-  /// multiplicand digits.
-  ///
-  /// The [acculumatorDigits] in the range [j] to [j]+[n]-1 are the accumulator
-  /// digits.
-  ///
-  /// Adds the result of the multiplicand-digits * [x] to the accumulator.
-  ///
-  /// Concretely: `accumulatorDigits[j..j+n] += x * m_digits[i..i+n-1]`.
-  static void _mulAdd(int x, Uint16List multiplicandDigits, int i,
-      Uint16List accumulatorDigits, int j, int n) {
-    if (x == 0) {
-      // No-op if x is 0.
-      return;
-    }
-    int c = 0;
-    while (--n >= 0) {
-      int product = x * multiplicandDigits[i++];
-      int combined = product + accumulatorDigits[j] + c;
-      accumulatorDigits[j++] = combined & _digitMask;
-      // Note that this works with 53 bits, as the division will not lose
-      // bits.
-      c = combined ~/ _digitBase;
-    }
-    while (c != 0) {
-      int l = accumulatorDigits[j] + c;
-      accumulatorDigits[j++] = l & _digitMask;
-      c = l ~/ _digitBase;
-    }
-  }
-
-  /// Multiplication operator.
-  _BigIntImpl operator *(covariant _BigIntImpl other) {
-    var used = _used;
-    var otherUsed = other._used;
-    if (used == 0 || otherUsed == 0) {
-      return zero;
-    }
-    var resultUsed = used + otherUsed;
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = new Uint16List(resultUsed);
-    var i = 0;
-    while (i < otherUsed) {
-      _mulAdd(otherDigits[i], digits, 0, resultDigits, i, used);
-      i++;
-    }
-    return new _BigIntImpl._(
-        _isNegative != other._isNegative, resultUsed, resultDigits);
-  }
-
-  // r_digits[0..rUsed-1] = xDigits[0..xUsed-1]*otherDigits[0..otherUsed-1].
-  // Return resultUsed = xUsed + otherUsed.
-  static int _mulDigits(Uint16List xDigits, int xUsed, Uint16List otherDigits,
-      int otherUsed, Uint16List resultDigits) {
-    var resultUsed = xUsed + otherUsed;
-    var i = resultUsed;
-    assert(resultDigits.length >= i);
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    i = 0;
-    while (i < otherUsed) {
-      _mulAdd(otherDigits[i], xDigits, 0, resultDigits, i, xUsed);
-      i++;
-    }
-    return resultUsed;
-  }
-
-  /// Returns an estimate of `digits[i-1..i] ~/ topDigitDivisor`.
-  static int _estimateQuotientDigit(
-      int topDigitDivisor, Uint16List digits, int i) {
-    if (digits[i] == topDigitDivisor) return _digitMask;
-    var quotientDigit =
-        (digits[i] << _digitBits | digits[i - 1]) ~/ topDigitDivisor;
-    if (quotientDigit > _digitMask) return _digitMask;
-    return quotientDigit;
-  }
-
-  /// Returns `trunc(this / other)`, with `other != 0`.
-  _BigIntImpl _div(_BigIntImpl other) {
-    assert(other._used > 0);
-    if (_used < other._used) {
-      return zero;
-    }
-    _divRem(other);
-    // Return quotient, i.e.
-    // _lastQuoRem_digits[_lastRem_used.._lastQuoRem_used-1] with proper sign.
-    var lastQuo_used = _lastQuoRemUsed - _lastRemUsed;
-    var quo_digits = _cloneDigits(
-        _lastQuoRemDigits, _lastRemUsed, _lastQuoRemUsed, lastQuo_used);
-    var quo = new _BigIntImpl._(false, lastQuo_used, quo_digits);
-    if ((_isNegative != other._isNegative) && (quo._used > 0)) {
-      quo = -quo;
-    }
-    return quo;
-  }
-
-  /// Returns `this - other * trunc(this / other)`, with `other != 0`.
-  _BigIntImpl _rem(_BigIntImpl other) {
-    assert(other._used > 0);
-    if (_used < other._used) {
-      return this;
-    }
-    _divRem(other);
-    // Return remainder, i.e.
-    // denormalized _lastQuoRem_digits[0.._lastRem_used-1] with proper sign.
-    var remDigits =
-        _cloneDigits(_lastQuoRemDigits, 0, _lastRemUsed, _lastRemUsed);
-    var rem = new _BigIntImpl._(false, _lastRemUsed, remDigits);
-    if (_lastRem_nsh > 0) {
-      rem = rem >> _lastRem_nsh; // Denormalize remainder.
-    }
-    if (_isNegative && (rem._used > 0)) {
-      rem = -rem;
-    }
-    return rem;
-  }
-
-  /// Computes this ~/ other and this.remainder(other).
-  ///
-  /// Stores the result in [_lastQuoRemDigits], [_lastQuoRemUsed] and
-  /// [_lastRemUsed]. The [_lastQuoRemDigits] contains the digits of *both*, the
-  /// quotient and the remainder.
-  ///
-  /// Caches the input to avoid doing the work again when users write
-  /// `a ~/ b` followed by a `a % b`.
-  void _divRem(_BigIntImpl other) {
-    // Check if result is already cached.
-    if ((this._used == _lastDividendUsed) &&
-        (other._used == _lastDivisorUsed) &&
-        identical(this._digits, _lastDividendDigits) &&
-        identical(other._digits, _lastDivisorDigits)) {
-      return;
-    }
-    assert(_used >= other._used);
-
-    var nsh = _digitBits - other._digits[other._used - 1].bitLength;
-    // Concatenated positive quotient and normalized positive remainder.
-    // The resultDigits can have at most one more digit than the dividend.
-    Uint16List resultDigits;
-    int resultUsed;
-    // Normalized positive divisor.
-    // The normalized divisor has the most-significant bit of its most
-    // significant digit set.
-    // This makes estimating the quotient easier.
-    Uint16List yDigits;
-    int yUsed;
-    if (nsh > 0) {
-      yDigits = new Uint16List(other._used + 5);
-      yUsed = _lShiftDigits(other._digits, other._used, nsh, yDigits);
-      resultDigits = new Uint16List(_used + 5);
-      resultUsed = _lShiftDigits(_digits, _used, nsh, resultDigits);
-    } else {
-      yDigits = other._digits;
-      yUsed = other._used;
-      resultDigits = _cloneDigits(_digits, 0, _used, _used + 2);
-      resultUsed = _used;
-    }
-    var topDigitDivisor = yDigits[yUsed - 1];
-    var i = resultUsed;
-    var j = i - yUsed;
-    // tmpDigits is a temporary array of i (resultUsed) digits.
-    var tmpDigits = new Uint16List(i);
-    var tmpUsed = _dlShiftDigits(yDigits, yUsed, j, tmpDigits);
-    // Explicit first division step in case normalized dividend is larger or
-    // equal to shifted normalized divisor.
-    if (_compareDigits(resultDigits, resultUsed, tmpDigits, tmpUsed) >= 0) {
-      assert(i == resultUsed);
-      resultDigits[resultUsed++] = 1; // Quotient = 1.
-      // Subtract divisor from remainder.
-      _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-    } else {
-      // Account for possible carry in _mulAdd step.
-      resultDigits[resultUsed++] = 0;
-    }
-
-    // Negate y so we can later use _mulAdd instead of non-existent _mulSub.
-    var nyDigits = new Uint16List(yUsed + 2);
-    nyDigits[yUsed] = 1;
-    _absSub(nyDigits, yUsed + 1, yDigits, yUsed, nyDigits);
-    // nyDigits is read-only and has yUsed digits (possibly including several
-    // leading zeros).
-    // resultDigits is modified during iteration.
-    // resultDigits[0..yUsed-1] is the current remainder.
-    // resultDigits[yUsed..resultUsed-1] is the current quotient.
-    --i;
-
-    while (j > 0) {
-      var estimatedQuotientDigit =
-          _estimateQuotientDigit(topDigitDivisor, resultDigits, i);
-      j--;
-      _mulAdd(estimatedQuotientDigit, nyDigits, 0, resultDigits, j, yUsed);
-      if (resultDigits[i] < estimatedQuotientDigit) {
-        // Reusing the already existing tmpDigits array.
-        var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
-        _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-        while (resultDigits[i] < --estimatedQuotientDigit) {
-          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-        }
-      }
-      i--;
-    }
-    // Cache result.
-    _lastDividendDigits = _digits;
-    _lastDividendUsed = _used;
-    _lastDivisorDigits = other._digits;
-    _lastDivisorUsed = other._used;
-    _lastQuoRemDigits = resultDigits;
-    _lastQuoRemUsed = resultUsed;
-    _lastRemUsed = yUsed;
-    _lastRem_nsh = nsh;
-  }
-
-  int get hashCode {
-    // This is the [Jenkins hash function][1] but using masking to keep
-    // values in SMI range.
-    //
-    // [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
-
-    int combine(int hash, int value) {
-      hash = 0x1fffffff & (hash + value);
-      hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-      return hash ^ (hash >> 6);
-    }
-
-    int finish(int hash) {
-      hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-      hash = hash ^ (hash >> 11);
-      return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-    }
-
-    if (_isZero) return 6707; // Just a random number.
-    var hash = _isNegative ? 83585 : 429689; // Also random.
-    for (int i = 0; i < _used; i++) {
-      hash = combine(hash, _digits[i]);
-    }
-    return finish(hash);
-  }
-
-  /// Test whether this value is numerically equal to `other`.
-  ///
-  /// If [other] is a [_BigIntImpl] returns whether the two operands have the
-  /// same value.
-  ///
-  /// Returns false if `other` is not a [_BigIntImpl].
-  bool operator ==(Object other) =>
-      other is _BigIntImpl && compareTo(other) == 0;
-
-  /// Returns the minimum number of bits required to store this big integer.
-  ///
-  /// The number of bits excludes the sign bit, which gives the natural length
-  /// for non-negative (unsigned) values.  Negative values are complemented to
-  /// return the bit position of the first bit that differs from the sign bit.
-  ///
-  /// To find the number of bits needed to store the value as a signed value,
-  /// add one, i.e. use `x.bitLength + 1`.
-  ///
-  /// ```
-  /// x.bitLength == (-x-1).bitLength
-  ///
-  /// new BigInt.from(3).bitLength == 2;   // 00000011
-  /// new BigInt.from(2).bitLength == 2;   // 00000010
-  /// new BigInt.from(1).bitLength == 1;   // 00000001
-  /// new BigInt.from(0).bitLength == 0;   // 00000000
-  /// new BigInt.from(-1).bitLength == 0;  // 11111111
-  /// new BigInt.from(-2).bitLength == 1;  // 11111110
-  /// new BigInt.from(-3).bitLength == 2;  // 11111101
-  /// new BigInt.from(-4).bitLength == 2;  // 11111100
-  /// ```
-  int get bitLength {
-    if (_used == 0) return 0;
-    if (_isNegative) return (~this).bitLength;
-    return _digitBits * (_used - 1) + _digits[_used - 1].bitLength;
-  }
-
-  /// Truncating division operator.
-  ///
-  /// Performs a truncating integer division, where the remainder is discarded.
-  ///
-  /// The remainder can be computed using the [remainder] method.
-  ///
-  /// Examples:
-  /// ```
-  /// var seven = new BigInt.from(7);
-  /// var three = new BigInt.from(3);
-  /// seven ~/ three;    // => 2
-  /// (-seven) ~/ three; // => -2
-  /// seven ~/ -three;   // => -2
-  /// seven.remainder(three);    // => 1
-  /// (-seven).remainder(three); // => -1
-  /// seven.remainder(-three);   // => 1
-  /// ```
-  _BigIntImpl operator ~/(covariant _BigIntImpl other) {
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return _div(other);
-  }
-
-  /// Returns the remainder of the truncating division of `this` by [other].
-  ///
-  /// The result `r` of this operation satisfies:
-  /// `this == (this ~/ other) * other + r`.
-  /// As a consequence the remainder `r` has the same sign as the divider
-  /// `this`.
-  _BigIntImpl remainder(covariant _BigIntImpl other) {
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return _rem(other);
-  }
-
-  /// Division operator.
-  double operator /(BigInt other) => this.toDouble() / other.toDouble();
-
-  /// Relational less than operator.
-  bool operator <(covariant _BigIntImpl other) => compareTo(other) < 0;
-
-  /// Relational less than or equal operator.
-  bool operator <=(covariant _BigIntImpl other) => compareTo(other) <= 0;
-
-  /// Relational greater than operator.
-  bool operator >(covariant _BigIntImpl other) => compareTo(other) > 0;
-
-  /// Relational greater than or equal operator.
-  bool operator >=(covariant _BigIntImpl other) => compareTo(other) >= 0;
-
-  /// Euclidean modulo operator.
-  ///
-  /// Returns the remainder of the Euclidean division. The Euclidean division of
-  /// two integers `a` and `b` yields two integers `q` and `r` such that
-  /// `a == b * q + r` and `0 <= r < b.abs()`.
-  ///
-  /// The sign of the returned value `r` is always positive.
-  ///
-  /// See [remainder] for the remainder of the truncating division.
-  _BigIntImpl operator %(covariant _BigIntImpl other) {
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    var result = _rem(other);
-    if (result._isNegative) {
-      if (other._isNegative) {
-        result = result - other;
-      } else {
-        result = result + other;
-      }
-    }
-    return result;
-  }
-
-  /// Returns the sign of this big integer.
-  ///
-  /// Returns 0 for zero, -1 for values less than zero and
-  /// +1 for values greater than zero.
-  int get sign {
-    if (_used == 0) return 0;
-    return _isNegative ? -1 : 1;
-  }
-
-  /// Whether this big integer is even.
-  bool get isEven => _used == 0 || (_digits[0] & 1) == 0;
-
-  /// Whether this big integer is odd.
-  bool get isOdd => !isEven;
-
-  /// Whether this number is negative.
-  bool get isNegative => _isNegative;
-
-  _BigIntImpl pow(int exponent) {
-    if (exponent < 0) {
-      throw new ArgumentError("Exponent must not be negative: $exponent");
-    }
-    if (exponent == 0) return one;
-
-    // Exponentiation by squaring.
-    var result = one;
-    var base = this;
-    while (exponent != 0) {
-      if ((exponent & 1) == 1) {
-        result *= base;
-      }
-      exponent >>= 1;
-      // Skip unnecessary operation.
-      if (exponent != 0) {
-        base *= base;
-      }
-    }
-    return result;
-  }
-
-  /// Returns this integer to the power of [exponent] modulo [modulus].
-  ///
-  /// The [exponent] must be non-negative and [modulus] must be
-  /// positive.
-  _BigIntImpl modPow(
-      covariant _BigIntImpl exponent, covariant _BigIntImpl modulus) {
-    if (exponent._isNegative) {
-      throw new ArgumentError("exponent must be positive: $exponent");
-    }
-    if (modulus <= zero) {
-      throw new ArgumentError("modulus must be strictly positive: $modulus");
-    }
-    if (exponent._isZero) return one;
-
-    final modulusUsed = modulus._used;
-    final modulusUsed2p4 = 2 * modulusUsed + 4;
-    final exponentBitlen = exponent.bitLength;
-    if (exponentBitlen <= 0) return one;
-    _BigIntReduction z = new _BigIntClassic(modulus);
-    var resultDigits = new Uint16List(modulusUsed2p4);
-    var result2Digits = new Uint16List(modulusUsed2p4);
-    var gDigits = new Uint16List(modulusUsed);
-    var gUsed = z.convert(this, gDigits);
-    // Initialize result with g.
-    // Copy leading zero if any.
-    for (int j = gUsed - 1; j >= 0; j--) {
-      resultDigits[j] = gDigits[j];
-    }
-    var resultUsed = gUsed;
-    int result2Used;
-    for (int i = exponentBitlen - 2; i >= 0; i--) {
-      result2Used = z.sqr(resultDigits, resultUsed, result2Digits);
-      if (!(exponent & (one << i))._isZero) {
-        resultUsed =
-            z.mul(result2Digits, result2Used, gDigits, gUsed, resultDigits);
-      } else {
-        // Swap result and result2.
-        var tmpDigits = resultDigits;
-        var tmpUsed = resultUsed;
-        resultDigits = result2Digits;
-        resultUsed = result2Used;
-        result2Digits = tmpDigits;
-        result2Used = tmpUsed;
-      }
-    }
-    return z.revert(resultDigits, resultUsed);
-  }
-
-  // If inv is false, returns gcd(x, y).
-  // If inv is true and gcd(x, y) = 1, returns d, so that c*x + d*y = 1.
-  // If inv is true and gcd(x, y) != 1, throws Exception("Not coprime").
-  static _BigIntImpl _binaryGcd(_BigIntImpl x, _BigIntImpl y, bool inv) {
-    var xDigits = x._digits;
-    var yDigits = y._digits;
-    var xUsed = x._used;
-    var yUsed = y._used;
-    var maxUsed = xUsed > yUsed ? xUsed : yUsed;
-    var unshiftedMaxUsed = maxUsed; // Keep
-    xDigits = _cloneDigits(xDigits, 0, xUsed, maxUsed);
-    yDigits = _cloneDigits(yDigits, 0, yUsed, maxUsed);
-    int shiftAmount = 0;
-    if (inv) {
-      if ((yUsed == 1) && (yDigits[0] == 1)) return one;
-      if ((yUsed == 0) || (yDigits[0].isEven && xDigits[0].isEven)) {
-        throw new Exception("Not coprime");
-      }
-    } else {
-      if (x._isZero) {
-        throw new ArgumentError.value(0, "this", "must not be zero");
-      }
-      if (y._isZero) {
-        throw new ArgumentError.value(0, "other", "must not be zero");
-      }
-      if (((xUsed == 1) && (xDigits[0] == 1)) ||
-          ((yUsed == 1) && (yDigits[0] == 1))) return one;
-      while (((xDigits[0] & 1) == 0) && ((yDigits[0] & 1) == 0)) {
-        _rsh(xDigits, xUsed, 1, xDigits);
-        _rsh(yDigits, yUsed, 1, yDigits);
-        shiftAmount++;
-      }
-      if (shiftAmount >= _digitBits) {
-        var digitShiftAmount = shiftAmount ~/ _digitBits;
-        xUsed -= digitShiftAmount;
-        yUsed -= digitShiftAmount;
-        maxUsed -= digitShiftAmount;
-      }
-      if ((yDigits[0] & 1) == 1) {
-        // Swap x and y.
-        var tmpDigits = xDigits;
-        var tmpUsed = xUsed;
-        xDigits = yDigits;
-        xUsed = yUsed;
-        yDigits = tmpDigits;
-        yUsed = tmpUsed;
-      }
-    }
-    var uDigits = _cloneDigits(xDigits, 0, xUsed, unshiftedMaxUsed);
-    var vDigits =
-        _cloneDigits(yDigits, 0, yUsed, unshiftedMaxUsed + 2); // +2 for lsh.
-    final bool ac = (xDigits[0] & 1) == 0;
-
-    // Variables a, b, c, and d require one more digit.
-    final abcdUsed = maxUsed + 1;
-    final abcdLen = abcdUsed + 2; // +2 to satisfy _absAdd.
-    var aDigits = _dummyList;
-    var aIsNegative = false;
-    var cDigits = _dummyList;
-    var cIsNegative = false;
-    if (ac) {
-      aDigits = new Uint16List(abcdLen);
-      aDigits[0] = 1;
-      cDigits = new Uint16List(abcdLen);
-    }
-    var bDigits = new Uint16List(abcdLen);
-    var bIsNegative = false;
-    var dDigits = new Uint16List(abcdLen);
-    var dIsNegative = false;
-    dDigits[0] = 1;
-
-    while (true) {
-      while ((uDigits[0] & 1) == 0) {
-        _rsh(uDigits, maxUsed, 1, uDigits);
-        if (ac) {
-          if (((aDigits[0] & 1) == 1) || ((bDigits[0] & 1) == 1)) {
-            // a += y
-            if (aIsNegative) {
-              if ((aDigits[maxUsed] != 0) ||
-                  (_compareDigits(aDigits, maxUsed, yDigits, maxUsed)) > 0) {
-                _absSub(aDigits, abcdUsed, yDigits, maxUsed, aDigits);
-              } else {
-                _absSub(yDigits, maxUsed, aDigits, maxUsed, aDigits);
-                aIsNegative = false;
-              }
-            } else {
-              _absAdd(aDigits, abcdUsed, yDigits, maxUsed, aDigits);
-            }
-            // b -= x
-            if (bIsNegative) {
-              _absAdd(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-            } else if ((bDigits[maxUsed] != 0) ||
-                (_compareDigits(bDigits, maxUsed, xDigits, maxUsed) > 0)) {
-              _absSub(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-            } else {
-              _absSub(xDigits, maxUsed, bDigits, maxUsed, bDigits);
-              bIsNegative = true;
-            }
-          }
-          _rsh(aDigits, abcdUsed, 1, aDigits);
-        } else if ((bDigits[0] & 1) == 1) {
-          // b -= x
-          if (bIsNegative) {
-            _absAdd(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-          } else if ((bDigits[maxUsed] != 0) ||
-              (_compareDigits(bDigits, maxUsed, xDigits, maxUsed) > 0)) {
-            _absSub(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-          } else {
-            _absSub(xDigits, maxUsed, bDigits, maxUsed, bDigits);
-            bIsNegative = true;
-          }
-        }
-        _rsh(bDigits, abcdUsed, 1, bDigits);
-      }
-      while ((vDigits[0] & 1) == 0) {
-        _rsh(vDigits, maxUsed, 1, vDigits);
-        if (ac) {
-          if (((cDigits[0] & 1) == 1) || ((dDigits[0] & 1) == 1)) {
-            // c += y
-            if (cIsNegative) {
-              if ((cDigits[maxUsed] != 0) ||
-                  (_compareDigits(cDigits, maxUsed, yDigits, maxUsed) > 0)) {
-                _absSub(cDigits, abcdUsed, yDigits, maxUsed, cDigits);
-              } else {
-                _absSub(yDigits, maxUsed, cDigits, maxUsed, cDigits);
-                cIsNegative = false;
-              }
-            } else {
-              _absAdd(cDigits, abcdUsed, yDigits, maxUsed, cDigits);
-            }
-            // d -= x
-            if (dIsNegative) {
-              _absAdd(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-            } else if ((dDigits[maxUsed] != 0) ||
-                (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-              _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-            } else {
-              _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-              dIsNegative = true;
-            }
-          }
-          _rsh(cDigits, abcdUsed, 1, cDigits);
-        } else if ((dDigits[0] & 1) == 1) {
-          // d -= x
-          if (dIsNegative) {
-            _absAdd(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-          } else if ((dDigits[maxUsed] != 0) ||
-              (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-            _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-          } else {
-            _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-            dIsNegative = true;
-          }
-        }
-        _rsh(dDigits, abcdUsed, 1, dDigits);
-      }
-      if (_compareDigits(uDigits, maxUsed, vDigits, maxUsed) >= 0) {
-        // u -= v
-        _absSub(uDigits, maxUsed, vDigits, maxUsed, uDigits);
-        if (ac) {
-          // a -= c
-          if (aIsNegative == cIsNegative) {
-            var a_cmp_c = _compareDigits(aDigits, abcdUsed, cDigits, abcdUsed);
-            if (a_cmp_c > 0) {
-              _absSub(aDigits, abcdUsed, cDigits, abcdUsed, aDigits);
-            } else {
-              _absSub(cDigits, abcdUsed, aDigits, abcdUsed, aDigits);
-              aIsNegative = !aIsNegative && (a_cmp_c != 0);
-            }
-          } else {
-            _absAdd(aDigits, abcdUsed, cDigits, abcdUsed, aDigits);
-          }
-        }
-        // b -= d
-        if (bIsNegative == dIsNegative) {
-          var b_cmp_d = _compareDigits(bDigits, abcdUsed, dDigits, abcdUsed);
-          if (b_cmp_d > 0) {
-            _absSub(bDigits, abcdUsed, dDigits, abcdUsed, bDigits);
-          } else {
-            _absSub(dDigits, abcdUsed, bDigits, abcdUsed, bDigits);
-            bIsNegative = !bIsNegative && (b_cmp_d != 0);
-          }
-        } else {
-          _absAdd(bDigits, abcdUsed, dDigits, abcdUsed, bDigits);
-        }
-      } else {
-        // v -= u
-        _absSub(vDigits, maxUsed, uDigits, maxUsed, vDigits);
-        if (ac) {
-          // c -= a
-          if (cIsNegative == aIsNegative) {
-            var c_cmp_a = _compareDigits(cDigits, abcdUsed, aDigits, abcdUsed);
-            if (c_cmp_a > 0) {
-              _absSub(cDigits, abcdUsed, aDigits, abcdUsed, cDigits);
-            } else {
-              _absSub(aDigits, abcdUsed, cDigits, abcdUsed, cDigits);
-              cIsNegative = !cIsNegative && (c_cmp_a != 0);
-            }
-          } else {
-            _absAdd(cDigits, abcdUsed, aDigits, abcdUsed, cDigits);
-          }
-        }
-        // d -= b
-        if (dIsNegative == bIsNegative) {
-          var d_cmp_b = _compareDigits(dDigits, abcdUsed, bDigits, abcdUsed);
-          if (d_cmp_b > 0) {
-            _absSub(dDigits, abcdUsed, bDigits, abcdUsed, dDigits);
-          } else {
-            _absSub(bDigits, abcdUsed, dDigits, abcdUsed, dDigits);
-            dIsNegative = !dIsNegative && (d_cmp_b != 0);
-          }
-        } else {
-          _absAdd(dDigits, abcdUsed, bDigits, abcdUsed, dDigits);
-        }
-      }
-      // Exit loop if u == 0.
-      var i = maxUsed;
-      while ((i > 0) && (uDigits[i - 1] == 0)) --i;
-      if (i == 0) break;
-    }
-    if (!inv) {
-      if (shiftAmount > 0) {
-        maxUsed = _lShiftDigits(vDigits, maxUsed, shiftAmount, vDigits);
-      }
-      return new _BigIntImpl._(false, maxUsed, vDigits);
-    }
-    // No inverse if v != 1.
-    var i = maxUsed - 1;
-    while ((i > 0) && (vDigits[i] == 0)) --i;
-    if ((i != 0) || (vDigits[0] != 1)) {
-      throw new Exception("Not coprime");
-    }
-
-    if (dIsNegative) {
-      while ((dDigits[maxUsed] != 0) ||
-          (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-        // d += x, d still negative
-        _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-      }
-      // d += x
-      _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-      dIsNegative = false;
-    } else {
-      while ((dDigits[maxUsed] != 0) ||
-          (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) >= 0)) {
-        // d -= x
-        _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-      }
-    }
-    return new _BigIntImpl._(false, maxUsed, dDigits);
-  }
-
-  /// Returns the modular multiplicative inverse of this big integer
-  /// modulo [modulus].
-  ///
-  /// The [modulus] must be positive.
-  ///
-  /// It is an error if no modular inverse exists.
-  // Returns 1/this % modulus, with modulus > 0.
-  _BigIntImpl modInverse(covariant _BigIntImpl modulus) {
-    if (modulus <= zero) {
-      throw new ArgumentError("Modulus must be strictly positive: $modulus");
-    }
-    if (modulus == one) return zero;
-    var tmp = this;
-    if (tmp._isNegative || (tmp._absCompare(modulus) >= 0)) {
-      tmp %= modulus;
-    }
-    return _binaryGcd(modulus, tmp, true);
-  }
-
-  /// Returns the greatest common divisor of this big integer and [other].
-  ///
-  /// If either number is non-zero, the result is the numerically greatest
-  /// integer dividing both `this` and `other`.
-  ///
-  /// The greatest common divisor is independent of the order,
-  /// so `x.gcd(y)` is  always the same as `y.gcd(x)`.
-  ///
-  /// For any integer `x`, `x.gcd(x)` is `x.abs()`.
-  ///
-  /// If both `this` and `other` is zero, the result is also zero.
-  _BigIntImpl gcd(covariant _BigIntImpl other) {
-    if (_isZero) return other.abs();
-    if (other._isZero) return this.abs();
-    return _binaryGcd(this, other, false);
-  }
-
-  /// Returns the least significant [width] bits of this big integer as a
-  /// non-negative number (i.e. unsigned representation).  The returned value
-  /// has zeros in all bit positions higher than [width].
-  ///
-  /// ```
-  /// new BigInt.from(-1).toUnsigned(5) == 31   // 11111111  ->  00011111
-  /// ```
-  ///
-  /// This operation can be used to simulate arithmetic from low level
-  /// languages.  For example, to increment an 8 bit quantity:
-  ///
-  /// ```
-  /// q = (q + 1).toUnsigned(8);
-  /// ```
-  ///
-  /// `q` will count from `0` up to `255` and then wrap around to `0`.
-  ///
-  /// If the input fits in [width] bits without truncation, the result is the
-  /// same as the input.  The minimum width needed to avoid truncation of `x` is
-  /// given by `x.bitLength`, i.e.
-  ///
-  /// ```
-  /// x == x.toUnsigned(x.bitLength);
-  /// ```
-  _BigIntImpl toUnsigned(int width) {
-    return this & ((one << width) - one);
-  }
-
-  /// Returns the least significant [width] bits of this integer, extending the
-  /// highest retained bit to the sign.  This is the same as truncating the
-  /// value to fit in [width] bits using an signed 2-s complement
-  /// representation.  The returned value has the same bit value in all
-  /// positions higher than [width].
-  ///
-  /// ```
-  /// var big15 = new BigInt.from(15);
-  /// var big16 = new BigInt.from(16);
-  /// var big239 = new BigInt.from(239);
-  ///                                      V--sign bit-V
-  /// big16.toSigned(5) == -big16   //  00010000 -> 11110000
-  /// big239.toSigned(5) == big15   //  11101111 -> 00001111
-  ///                                      ^           ^
-  /// ```
-  ///
-  /// This operation can be used to simulate arithmetic from low level
-  /// languages.  For example, to increment an 8 bit signed quantity:
-  ///
-  /// ```
-  /// q = (q + 1).toSigned(8);
-  /// ```
-  ///
-  /// `q` will count from `0` up to `127`, wrap to `-128` and count back up to
-  /// `127`.
-  ///
-  /// If the input value fits in [width] bits without truncation, the result is
-  /// the same as the input.  The minimum width needed to avoid truncation of
-  /// `x` is `x.bitLength + 1`, i.e.
-  ///
-  /// ```
-  /// x == x.toSigned(x.bitLength + 1);
-  /// ```
-  _BigIntImpl toSigned(int width) {
-    // The value of binary number weights each bit by a power of two.  The
-    // twos-complement value weights the sign bit negatively.  We compute the
-    // value of the negative weighting by isolating the sign bit with the
-    // correct power of two weighting and subtracting it from the value of the
-    // lower bits.
-    var signMask = one << (width - 1);
-    return (this & (signMask - one)) - (this & signMask);
-  }
-
-  // Maximum number of digits that always fit in mantissa.
-  static const _simpleValidIntDigits = 53 ~/ _digitBits;
-
-  bool get isValidInt {
-    if (_used <= _simpleValidIntDigits) return true;
-    var asInt = toInt();
-    if (!asInt.toDouble().isFinite) return false;
-    return this == new _BigIntImpl._fromInt(asInt);
-  }
-
-  int toInt() {
-    var result = 0;
-    for (int i = _used - 1; i >= 0; i--) {
-      result = result * _digitBase + _digits[i];
-    }
-    return _isNegative ? -result : result;
-  }
-
-  /// Returns this [_BigIntImpl] as a [double].
-  ///
-  /// If the number is not representable as a [double], an
-  /// approximation is returned. For numerically large integers, the
-  /// approximation may be infinite.
-  double toDouble() {
-    const int exponentBias = 1075;
-    // There are 11 bits for the exponent.
-    // 2047 (all bits set to 1) is reserved for infinity and NaN.
-    // When storing the exponent in the 11 bits, it is biased by exponentBias
-    // to support negative exponents.
-    const int maxDoubleExponent = 2046 - exponentBias;
-    if (_isZero) return 0.0;
-
-    // We fill the 53 bits little-endian.
-    var resultBits = new Uint8List(8);
-
-    var length = _digitBits * (_used - 1) + _digits[_used - 1].bitLength;
-    if (length > maxDoubleExponent + 53) {
-      return _isNegative ? double.negativeInfinity : double.infinity;
-    }
-
-    // The most significant bit is for the sign.
-    if (_isNegative) resultBits[7] = 0x80;
-
-    // Write the exponent into bits 1..12:
-    var biasedExponent = length - 53 + exponentBias;
-    resultBits[6] = (biasedExponent & 0xF) << 4;
-    resultBits[7] |= biasedExponent >> 4;
-
-    int cachedBits = 0;
-    int cachedBitsLength = 0;
-    int digitIndex = _used - 1;
-    int readBits(int n) {
-      // Ensure that we have enough bits in [cachedBits].
-      while (cachedBitsLength < n) {
-        int nextDigit;
-        int nextDigitLength = _digitBits; // May get updated.
-        if (digitIndex < 0) {
-          nextDigit = 0;
-          digitIndex--;
-        } else {
-          nextDigit = _digits[digitIndex];
-          if (digitIndex == _used - 1) nextDigitLength = nextDigit.bitLength;
-          digitIndex--;
-        }
-        cachedBits = (cachedBits << nextDigitLength) + nextDigit;
-        cachedBitsLength += nextDigitLength;
-      }
-      // Read the top [n] bits.
-      var result = cachedBits >> (cachedBitsLength - n);
-      // Remove the bits from the cache.
-      cachedBits -= result << (cachedBitsLength - n);
-      cachedBitsLength -= n;
-      return result;
-    }
-
-    // The first leading 1 bit is implicit in the double-representation and can
-    // be discarded.
-    var leadingBits = readBits(5) & 0xF;
-    resultBits[6] |= leadingBits;
-
-    for (int i = 5; i >= 0; i--) {
-      // Get the remaining 48 bits.
-      resultBits[i] = readBits(8);
-    }
-
-    void roundUp() {
-      // Simply consists of adding 1 to the whole 64 bit "number".
-      // It will update the exponent, if necessary.
-      // It might even round up to infinity (which is what we want).
-      var carry = 1;
-      for (int i = 0; i < 8; i++) {
-        if (carry == 0) break;
-        var sum = resultBits[i] + carry;
-        resultBits[i] = sum & 0xFF;
-        carry = sum >> 8;
-      }
-    }
-
-    if (readBits(1) == 1) {
-      if (resultBits[0].isOdd) {
-        // Rounds to even all the time.
-        roundUp();
-      } else {
-        // Round up, if there is at least one other digit that is not 0.
-        if (cachedBits != 0) {
-          // There is already one in the cachedBits.
-          roundUp();
-        } else {
-          for (int i = digitIndex; i >= 0; i--) {
-            if (_digits[i] != 0) {
-              roundUp();
-              break;
-            }
-          }
-        }
-      }
-    }
-    return resultBits.buffer.asByteData().getFloat64(0, Endian.little);
-  }
-
-  /// Returns a String-representation of this integer.
-  ///
-  /// The returned string is parsable by [parse].
-  /// For any `_BigIntImpl` `i`, it is guaranteed that
-  /// `i == _BigIntImpl.parse(i.toString())`.
-  String toString() {
-    if (_used == 0) return "0";
-    if (_used == 1) {
-      if (_isNegative) return (-_digits[0]).toString();
-      return _digits[0].toString();
-    }
-
-    // Generate in chunks of 4 digits.
-    // The chunks are in reversed order.
-    var decimalDigitChunks = <String>[];
-    var rest = isNegative ? -this : this;
-    while (rest._used > 1) {
-      var digits4 = rest.remainder(_bigInt10000).toString();
-      decimalDigitChunks.add(digits4);
-      if (digits4.length == 1) decimalDigitChunks.add("000");
-      if (digits4.length == 2) decimalDigitChunks.add("00");
-      if (digits4.length == 3) decimalDigitChunks.add("0");
-      rest = rest ~/ _bigInt10000;
-    }
-    decimalDigitChunks.add(rest._digits[0].toString());
-    if (_isNegative) decimalDigitChunks.add("-");
-    return decimalDigitChunks.reversed.join();
-  }
-
-  int _toRadixCodeUnit(int digit) {
-    const int _0 = 48;
-    const int _a = 97;
-    if (digit < 10) return _0 + digit;
-    return _a + digit - 10;
-  }
-
-  /// Converts [this] to a string representation in the given [radix].
-  ///
-  /// In the string representation, lower-case letters are used for digits above
-  /// '9', with 'a' being 10 an 'z' being 35.
-  ///
-  /// The [radix] argument must be an integer in the range 2 to 36.
-  String toRadixString(int radix) {
-    if (radix > 36) throw new RangeError.range(radix, 2, 36);
-
-    if (_used == 0) return "0";
-
-    if (_used == 1) {
-      var digitString = _digits[0].toRadixString(radix);
-      if (_isNegative) return "-" + digitString;
-      return digitString;
-    }
-
-    if (radix == 16) return _toHexString();
-
-    var base = new _BigIntImpl._fromInt(radix);
-    var reversedDigitCodeUnits = <int>[];
-    var rest = this.abs();
-    while (!rest._isZero) {
-      var digit = rest.remainder(base).toInt();
-      rest = rest ~/ base;
-      reversedDigitCodeUnits.add(_toRadixCodeUnit(digit));
-    }
-    var digitString = new String.fromCharCodes(reversedDigitCodeUnits.reversed);
-    if (_isNegative) return "-" + digitString;
-    return digitString;
-  }
-
-  String _toHexString() {
-    var chars = <int>[];
-    for (int i = 0; i < _used - 1; i++) {
-      int chunk = _digits[i];
-      for (int j = 0; j < (_digitBits ~/ 4); j++) {
-        chars.add(_toRadixCodeUnit(chunk & 0xF));
-        chunk >>= 4;
-      }
-    }
-    var msbChunk = _digits[_used - 1];
-    while (msbChunk != 0) {
-      chars.add(_toRadixCodeUnit(msbChunk & 0xF));
-      msbChunk >>= 4;
-    }
-    if (_isNegative) {
-      const _dash = 45;
-      chars.add(_dash);
-    }
-    return new String.fromCharCodes(chars.reversed);
-  }
-}
-
-// Interface for modular reduction.
-abstract class _BigIntReduction {
-  // Return the number of digits used by r_digits.
-  int convert(_BigIntImpl x, Uint16List r_digits);
-  int mul(Uint16List xDigits, int xUsed, Uint16List yDigits, int yUsed,
-      Uint16List resultDigits);
-  int sqr(Uint16List xDigits, int xUsed, Uint16List resultDigits);
-
-  // Return x reverted to _BigIntImpl.
-  _BigIntImpl revert(Uint16List xDigits, int xUsed);
-}
-
-// Modular reduction using "classic" algorithm.
-class _BigIntClassic implements _BigIntReduction {
-  final _BigIntImpl _modulus; // Modulus.
-  final _BigIntImpl _normalizedModulus; // Normalized _modulus.
-
-  _BigIntClassic(this._modulus)
-      : _normalizedModulus = _modulus <<
-            (_BigIntImpl._digitBits -
-                _modulus._digits[_modulus._used - 1].bitLength);
-
-  int convert(_BigIntImpl x, Uint16List resultDigits) {
-    Uint16List digits;
-    int used;
-    if (x._isNegative || x._absCompare(_modulus) >= 0) {
-      var remainder = x._rem(_modulus);
-      if (x._isNegative && remainder._used > 0) {
-        assert(remainder._isNegative);
-        remainder += _modulus;
-      }
-      assert(!remainder._isNegative);
-      used = remainder._used;
-      digits = remainder._digits;
-    } else {
-      used = x._used;
-      digits = x._digits;
-    }
-    var i = used; // Copy leading zero if any.
-    while (--i >= 0) {
-      resultDigits[i] = digits[i];
-    }
-    return used;
-  }
-
-  _BigIntImpl revert(Uint16List xDigits, int xUsed) {
-    return new _BigIntImpl._(false, xUsed, xDigits);
-  }
-
-  int _reduce(Uint16List xDigits, int xUsed) {
-    if (xUsed < _modulus._used) {
-      return xUsed;
-    }
-    var reverted = revert(xDigits, xUsed);
-    var rem = reverted._rem(_normalizedModulus);
-    return convert(rem, xDigits);
-  }
-
-  int sqr(Uint16List xDigits, int xUsed, Uint16List resultDigits) {
-    var b = new _BigIntImpl._(false, xUsed, xDigits);
-    var b2 = b * b;
-    for (int i = 0; i < b2._used; i++) {
-      resultDigits[i] = b2._digits[i];
-    }
-    for (int i = b2._used; i < 2 * xUsed; i++) {
-      resultDigits[i] = 0;
-    }
-    return _reduce(resultDigits, 2 * xUsed);
-  }
-
-  int mul(Uint16List xDigits, int xUsed, Uint16List yDigits, int yUsed,
-      Uint16List resultDigits) {
-    var resultUsed =
-        _BigIntImpl._mulDigits(xDigits, xUsed, yDigits, yUsed, resultDigits);
-    return _reduce(resultDigits, resultUsed);
-  }
-}
-
-/// Creates an invocation object used in noSuchMethod forwarding stubs.
-///
-/// The signature is hardwired to the kernel nodes generated in the
-/// `Dart2jsTarget` and read in the `KernelSsaGraphBuilder`.
-external Invocation _createInvocationMirror(
-    String memberName,
-    List typeArguments,
-    List positionalArguments,
-    Map<String, dynamic> namedArguments,
-    int kind);
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/developer_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/developer_patch.dart
deleted file mode 100644
index aff3f55..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/developer_patch.dart
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// Patch file for dart:developer library.
-
-import 'dart:_js_helper' show patch, ForceInline;
-import 'dart:_foreign_helper' show JS;
-import 'dart:async' show Zone;
-import 'dart:isolate';
-
-@patch
-@pragma('dart2js:tryInline')
-bool debugger({bool when = true, String? message}) {
-  if (when) {
-    JS('', 'debugger');
-  }
-  return when;
-}
-
-@patch
-Object? inspect(Object? object) {
-  return object;
-}
-
-@patch
-void log(String message,
-    {DateTime? time,
-    int? sequenceNumber,
-    int level = 0,
-    String name = '',
-    Zone? zone,
-    Object? error,
-    StackTrace? stackTrace}) {
-  // TODO.
-}
-
-final _extensions = <String, ServiceExtensionHandler>{};
-
-@patch
-ServiceExtensionHandler? _lookupExtension(String method) {
-  return _extensions[method];
-}
-
-@patch
-_registerExtension(String method, ServiceExtensionHandler handler) {
-  _extensions[method] = handler;
-}
-
-@patch
-void _postEvent(String eventKind, String eventData) {
-  // TODO.
-}
-
-@patch
-bool _isDartStreamEnabled() {
-  return false;
-}
-
-@patch
-int _getTraceClock() {
-  // TODO.
-  return _clockValue++;
-}
-
-int _clockValue = 0;
-
-@patch
-void _reportFlowEvent(
-    String category, String name, int type, int id, String argumentsAsJson) {
-  // TODO.
-}
-
-@patch
-void _reportInstantEvent(String category, String name, String argumentsAsJson) {
-  // TODO.
-}
-
-@patch
-int _getNextAsyncId() {
-  return 0;
-}
-
-@patch
-void _reportTaskEvent(int taskId, String phase, String category, String name,
-    String argumentsAsJson) {
-  // TODO.
-}
-
-@patch
-int _getServiceMajorVersion() {
-  return 0;
-}
-
-@patch
-int _getServiceMinorVersion() {
-  return 0;
-}
-
-@patch
-void _getServerInfo(SendPort sendPort) {
-  sendPort.send(null);
-}
-
-@patch
-void _webServerControl(SendPort sendPort, bool enable) {
-  sendPort.send(null);
-}
-
-@patch
-String? _getIsolateIDFromSendPort(SendPort sendPort) {
-  return null;
-}
-
-@patch
-class UserTag {
-  @patch
-  factory UserTag(String label) = _FakeUserTag;
-
-  @patch
-  static UserTag get defaultTag => _FakeUserTag._defaultTag;
-}
-
-class _FakeUserTag implements UserTag {
-  static final _instances = <String, _FakeUserTag>{};
-
-  _FakeUserTag.real(this.label);
-
-  factory _FakeUserTag(String label) {
-    // Canonicalize by name.
-    var existingTag = _instances[label];
-    if (existingTag != null) {
-      return existingTag;
-    }
-    // Throw an exception if we've reached the maximum number of user tags.
-    if (_instances.length == UserTag.MAX_USER_TAGS) {
-      throw UnsupportedError(
-          'UserTag instance limit (${UserTag.MAX_USER_TAGS}) reached.');
-    }
-    return _instances[label] = _FakeUserTag.real(label);
-  }
-
-  final String label;
-
-  UserTag makeCurrent() {
-    var old = _currentTag;
-    _currentTag = this;
-    return old;
-  }
-
-  static final UserTag _defaultTag = new _FakeUserTag('Default');
-}
-
-var _currentTag = _FakeUserTag._defaultTag;
-
-@patch
-UserTag getCurrentTag() => _currentTag;
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/foreign_helper.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/foreign_helper.dart
deleted file mode 100644
index 88ca3d2..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/foreign_helper.dart
+++ /dev/null
@@ -1,279 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library _foreign_helper;
-
-import 'dart:_js_embedded_names' show JsGetName, JsBuiltin;
-import 'dart:_rti' show Rti;
-
-/// Emits a JavaScript code fragment parametrized by arguments.
-///
-/// Hash characters `#` in the [codeTemplate] are replaced in left-to-right
-/// order with expressions that contain the values of, or evaluate to, the
-/// arguments.  The number of hash marks must match the number or arguments.
-/// Although declared with arguments [arg0] through [arg2], the form actually
-/// has no limit on the number of arguments.
-///
-/// The [typeDescription] argument is interpreted as a description of the
-/// behavior of the JavaScript code.  Currently it describes the side effects
-/// types that may be returned by the expression, with the additional behavior
-/// that the returned values may be fresh instances of the types.  The type
-/// information must be correct as it is trusted by the compiler in
-/// optimizations, and it must be precise as possible since it is used for
-/// native live type analysis to tree-shake large parts of the DOM libraries.
-/// If poorly written, the [typeDescription] will cause unnecessarily bloated
-/// programs.  (You can check for this by compiling with `--verbose`; there is
-/// an info message describing the number of native (DOM) types that can be
-/// removed, which usually should be greater than zero.)
-///
-/// The [typeDescription] must be a [String]. Two forms of it are supported:
-///
-/// 1) a union of types separated by vertical bar `|` symbols, e.g.
-///    `"num|String"` describes the union of numbers and Strings.  There is no
-///    type in Dart that is this precise.  The Dart alternative would be
-///    `Object` or `dynamic`, but these types imply that the JS-code might also
-///    be creating instances of all the DOM types.
-///
-///    If `null` is possible, it must be specified explicitly, e.g.
-///    `"String|Null"`. [typeDescription] has several extensions to help
-///    describe the behavior more accurately.  In addition to the union type
-///    already described:
-///
-///    + `=Object` is a plain JavaScript object.  Some DOM methods return
-///       instances that have no corresponding Dart type (e.g. cross-frame
-///       documents), `=Object` can be used to describe these untyped' values.
-///
-///    + `var` or empty string.  If the entire [typeDescription] is `var` (or
-///      empty string) then the type is `dynamic` but the code is known to not
-///      create any instances.
-///
-///   Examples:
-///
-///       // Parent window might be an opaque cross-frame window.
-///       var thing = JS('=Object|Window', '#.parent', myWindow);
-///
-/// 2) a sequence of the form `<tag>:<value>;` where `<tag>` is one of
-///    `creates`, `returns`, `effects` or `depends`.
-///
-///    The first two tags are used to specify the created and returned types of
-///    the expression. The value of `creates` and `returns` is a type string as
-///    defined in 1).
-///
-///    The tags `effects` and `depends` encode the side effects of this call.
-///    They can be omitted, in which case the expression is parsed and a safe
-///    conservative side-effect estimation is computed.
-///
-///    The values of `effects` and `depends` may be 'all', 'none' or a
-///    comma-separated list of 'no-index', 'no-instance' and 'no-static'.
-///
-///    The value 'all' indicates that the call affects/depends on every
-///    side-effect. The flag 'none' signals that the call does not affect
-///    (resp. depends on) anything.
-///
-///    The value 'no-index' indicates that the call does *not* do (resp. depends
-///    on) any array index-store. The flag 'no-instance' indicates that the call
-///    does not modify (resp. depends on) any instance variable. Similarly,
-///    the 'no-static' value indicates that the call does not modify (resp.
-///    depends on) any static variable.
-///
-///    The `effects` and `depends` flag must be used in tandem. Either both are
-///    specified or none is.
-///
-///    Each tag (including the type tags) may only occur once in the sequence.
-///
-/// Guidelines:
-///
-///  + Do not use any parameter, local, method or field names in the
-///    [codeTemplate].  These names are all subject to arbitrary renaming by the
-///    compiler.  Pass the values in via `#` substition, and test with the
-///    `--minify` dart2js command-line option.
-///
-///  + The substituted expressions are values, not locations.
-///
-///        JS('void', '# += "x"', this.field);
-///
-///    `this.field` might not be a substituted as a reference to the field.  The
-///    generated code might accidentally work as intended, but it also might be
-///
-///        var t1 = this.field;
-///        t1 += "x";
-///
-///    or
-///
-///        this.get$field() += "x";
-///
-///    The remedy in this case is to expand the `+=` operator, leaving all
-///    references to the Dart field as Dart code:
-///
-///        this.field = JS('String', '# + "x"', this.field);
-///
-///  + Never use `#` in function bodies.
-///
-///    This is a variation on the previous guideline.  Since `#` is replaced
-///    with an *expression* and the expression is only valid in the immediate
-///    context, `#` should never appear in a function body.  Doing so might
-///    defer the evaluation of the expression, and its side effects, until the
-///    function is called.
-///
-///    For example,
-///
-///        var value = foo();
-///        var f = JS('', 'function(){return #}', value)
-///
-///    might result in no immediate call to `foo` and a call to `foo` on every
-///    call to the JavaScript function bound to `f`.  This is better:
-///
-///        var f = JS('',
-///            '(function(val) { return function(){return val}; })(#)', value);
-///
-///    Since `#` occurs in the immediately evaluated expression, the expression
-///    is immediately evaluated and bound to `val` in the immediate call.
-///
-///
-/// Type argument.
-///
-/// In Dart 2.0, the type argument additionally constrains the returned type.
-/// So, with type inference filling in the type argumemnt,
-///
-///     String s = JS('', 'JSON.stringify(#)', x);
-///
-/// will be the same as the current meaning of
-///
-///     var s = JS('String|Null', 'JSON.stringify(#)', x);
-///
-///
-/// Additional notes.
-///
-/// In the future we may extend [typeDescription] to include other aspects of
-/// the behavior, for example, separating the returned types from the
-/// instantiated types to allow the compiler to perform more optimizations
-/// around the code.
-///
-/// This might be an extension of [JS] or a new function similar to [JS] with
-/// additional arguments for the new information.
-// Add additional optional arguments if needed. The method is treated internally
-// as a variable argument method.
-external T JS<T>(String typeDescription, String codeTemplate,
-    [arg0,
-    arg1,
-    arg2,
-    arg3,
-    arg4,
-    arg5,
-    arg6,
-    arg7,
-    arg8,
-    arg9,
-    arg10,
-    arg11,
-    arg12,
-    arg13,
-    arg14,
-    arg51,
-    arg16,
-    arg17,
-    arg18,
-    arg19]);
-
-/// Converts the Dart closure [function] into a JavaScript closure.
-///
-/// Warning: This is no different from [RAW_DART_FUNCTION_REF] which means care
-/// must be taken to store the current isolate.
-external DART_CLOSURE_TO_JS(Function function);
-
-/// Returns a raw reference to the JavaScript function which implements
-/// [function].
-///
-/// Warning: this is dangerous, you should probably use
-/// [DART_CLOSURE_TO_JS] instead. The returned object is not a valid
-/// Dart closure, does not store the isolate context or arity.
-///
-/// A valid example of where this can be used is as the second argument
-/// to V8's Error.captureStackTrace. See
-/// https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi.
-external RAW_DART_FUNCTION_REF(Function function);
-
-/// Sets the current static state to [staticState].
-external void JS_SET_STATIC_STATE(staticState);
-
-/// Returns the interceptor for class [type].  The interceptor is the type's
-/// constructor's `prototype` property.  [type] will typically be the class, not
-/// an interface, e.g. `JS_INTERCEPTOR_CONSTANT(JSInt)`, not
-/// `JS_INTERCEPTOR_CONSTANT(int)`.
-external JS_INTERCEPTOR_CONSTANT(Type type);
-
-/// Returns the interceptor for [object].
-///
-/// Calls are replaced with the [HInterceptor] SSA instruction.
-external getInterceptor(object);
-
-/// Returns the Rti object for the type for JavaScript arrays via JS-interop.
-///
-/// Calls are replaced with a [HLoadType] SSA instruction.
-external Object getJSArrayInteropRti();
-
-/// Returns the object corresponding to Namer.staticStateHolder.
-external JS_GET_STATIC_STATE();
-
-/// Returns the JS name for [name] from the Namer.
-external String JS_GET_NAME(JsGetName name);
-
-/// Reads an embedded global.
-///
-/// The [name] should be a constant defined in the `_embedded_names` library.
-external JS_EMBEDDED_GLOBAL(String typeDescription, String name);
-
-/// Instructs the compiler to execute the [builtinName] action at the call-site.
-///
-/// The [builtin] should be a constant defined in the `_embedded_names`
-/// library.
-// Add additional optional arguments if needed. The method is treated internally
-// as a variable argument method.
-external JS_BUILTIN(String typeDescription, JsBuiltin builtin,
-    [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11]);
-
-/// Returns the state of a flag that is determined by the state of the compiler
-/// when the program has been analyzed.
-external bool JS_GET_FLAG(String name);
-
-/// Returns a TypeReference to [T].
-external Rti TYPE_REF<T>();
-
-/// Returns a TypeReference to [T]*.
-external Rti LEGACY_TYPE_REF<T>();
-
-/// Pretend [code] is executed.  Generates no executable code.  This is used to
-/// model effects at some other point in external code.  For example, the
-/// following models an assignment to foo with an unknown value.
-///
-///     var foo;
-///
-///     main() {
-///       JS_EFFECT((_){ foo = _; })
-///     }
-///
-/// TODO(sra): Replace this hack with something to mark the volatile or
-/// externally initialized elements.
-void JS_EFFECT(Function code) {
-  code(null);
-}
-
-/// Use this class for creating constants that hold JavaScript code.
-/// For example:
-///
-/// const constant = JS_CONST('typeof window != "undefined");
-///
-/// This code will generate:
-/// $.JS_CONST_1 = typeof window != "undefined";
-class JS_CONST {
-  final String code;
-  const JS_CONST(this.code);
-}
-
-/// JavaScript string concatenation. Inputs must be Strings.  Corresponds to the
-/// HStringConcat SSA instruction and may be constant-folded.
-String JS_STRING_CONCAT(String a, String b) {
-  // This body is unused, only here for type analysis.
-  return JS('String', '# + #', a, b);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/instantiation.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/instantiation.dart
deleted file mode 100644
index bb003e6..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/instantiation.dart
+++ /dev/null
@@ -1,334 +0,0 @@
-// Copyright (c) 2018, 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.
-
-part of _js_helper;
-
-/// Support class for generic function type instantiation (binding of types).
-///
-abstract class Instantiation extends Closure {
-  final Closure _genericClosure;
-  Instantiation(this._genericClosure) {
-    // TODO(sra): Copy some metadata used by Function.apply.
-
-    // Mark support code as used.  The JS condition is inscrutable to dart2js,
-    // so the 'if (false)' is in the final program.
-    // TODO(sra): Find a better way to do this. Generating the signature methods
-    // earlier as SSA on the instantiation closures should achieve this.
-    if (JS('bool', 'false')) {
-      // [instantiatedGenericFunctionType] is called from injected $signature
-      // methods with runtime type representations.
-      if (JS_GET_FLAG('USE_NEW_RTI')) {
-        newRti.instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
-      } else {
-        instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
-      }
-    }
-  }
-
-  /// Returns a list of the bound types.
-  List get _types;
-
-  String toString() {
-    var types = "<${_types.join(', ')}>";
-    // TODO(sra): Refactor Closure formatting to place type arguments inside,
-    // e.g. "Closure 'map<String>' of Instance of 'JSArray<int>'".
-    return '$_genericClosure with $types';
-  }
-}
-
-/// Instantiation classes are subclasses of [Instantiation]. For now we have a
-/// fixed number of subclasses. Later we might generate the classes on demand.
-class Instantiation1<T1> extends Instantiation {
-  Instantiation1(Closure f) : super(f);
-  List get _types => [T1];
-}
-
-class Instantiation2<T1, T2> extends Instantiation {
-  Instantiation2(Closure f) : super(f);
-  List get _types => [T1, T2];
-}
-
-class Instantiation3<T1, T2, T3> extends Instantiation {
-  Instantiation3(Closure f) : super(f);
-  List get _types => [T1, T2, T3];
-}
-
-class Instantiation4<T1, T2, T3, T4> extends Instantiation {
-  Instantiation4(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4];
-}
-
-class Instantiation5<T1, T2, T3, T4, T5> extends Instantiation {
-  Instantiation5(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5];
-}
-
-class Instantiation6<T1, T2, T3, T4, T5, T6> extends Instantiation {
-  Instantiation6(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6];
-}
-
-class Instantiation7<T1, T2, T3, T4, T5, T6, T7> extends Instantiation {
-  Instantiation7(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7];
-}
-
-class Instantiation8<T1, T2, T3, T4, T5, T6, T7, T8> extends Instantiation {
-  Instantiation8(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7, T8];
-}
-
-class Instantiation9<T1, T2, T3, T4, T5, T6, T7, T8, T9> extends Instantiation {
-  Instantiation9(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9];
-}
-
-class Instantiation10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
-    extends Instantiation {
-  Instantiation10(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10];
-}
-
-class Instantiation11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
-    extends Instantiation {
-  Instantiation11(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11];
-}
-
-class Instantiation12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
-    extends Instantiation {
-  Instantiation12(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12];
-}
-
-class Instantiation13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
-    extends Instantiation {
-  Instantiation13(Closure f) : super(f);
-  List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13];
-}
-
-class Instantiation14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14> extends Instantiation {
-  Instantiation14(Closure f) : super(f);
-  List get _types =>
-      [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14];
-}
-
-class Instantiation15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14, T15> extends Instantiation {
-  Instantiation15(Closure f) : super(f);
-  List get _types =>
-      [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15];
-}
-
-class Instantiation16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14, T15, T16> extends Instantiation {
-  Instantiation16(Closure f) : super(f);
-  List get _types =>
-      [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16];
-}
-
-class Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14, T15, T16, T17> extends Instantiation {
-  Instantiation17(Closure f) : super(f);
-  List get _types => [
-        T1,
-        T2,
-        T3,
-        T4,
-        T5,
-        T6,
-        T7,
-        T8,
-        T9,
-        T10,
-        T11,
-        T12,
-        T13,
-        T14,
-        T15,
-        T16,
-        T17
-      ];
-}
-
-class Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14, T15, T16, T17, T18> extends Instantiation {
-  Instantiation18(Closure f) : super(f);
-  List get _types => [
-        T1,
-        T2,
-        T3,
-        T4,
-        T5,
-        T6,
-        T7,
-        T8,
-        T9,
-        T10,
-        T11,
-        T12,
-        T13,
-        T14,
-        T15,
-        T16,
-        T17,
-        T18
-      ];
-}
-
-class Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14, T15, T16, T17, T18, T19> extends Instantiation {
-  Instantiation19(Closure f) : super(f);
-  List get _types => [
-        T1,
-        T2,
-        T3,
-        T4,
-        T5,
-        T6,
-        T7,
-        T8,
-        T9,
-        T10,
-        T11,
-        T12,
-        T13,
-        T14,
-        T15,
-        T16,
-        T17,
-        T18,
-        T19
-      ];
-}
-
-class Instantiation20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
-    T14, T15, T16, T17, T18, T19, T20> extends Instantiation {
-  Instantiation20(Closure f) : super(f);
-  List get _types => [
-        T1,
-        T2,
-        T3,
-        T4,
-        T5,
-        T6,
-        T7,
-        T8,
-        T9,
-        T10,
-        T11,
-        T12,
-        T13,
-        T14,
-        T15,
-        T16,
-        T17,
-        T18,
-        T19,
-        T20
-      ];
-}
-
-Instantiation instantiate1<T1>(Closure f) {
-  return new Instantiation1<T1>(f);
-}
-
-Instantiation instantiate2<T1, T2>(Closure f) {
-  return new Instantiation2<T1, T2>(f);
-}
-
-Instantiation instantiate3<T1, T2, T3>(Closure f) {
-  return new Instantiation3<T1, T2, T3>(f);
-}
-
-Instantiation instantiate4<T1, T2, T3, T4>(Closure f) {
-  return new Instantiation4<T1, T2, T3, T4>(f);
-}
-
-Instantiation instantiate5<T1, T2, T3, T4, T5>(Closure f) {
-  return new Instantiation5<T1, T2, T3, T4, T5>(f);
-}
-
-Instantiation instantiate6<T1, T2, T3, T4, T5, T6>(Closure f) {
-  return new Instantiation6<T1, T2, T3, T4, T5, T6>(f);
-}
-
-Instantiation instantiate7<T1, T2, T3, T4, T5, T6, T7>(Closure f) {
-  return new Instantiation7<T1, T2, T3, T4, T5, T6, T7>(f);
-}
-
-Instantiation instantiate8<T1, T2, T3, T4, T5, T6, T7, T8>(Closure f) {
-  return new Instantiation8<T1, T2, T3, T4, T5, T6, T7, T8>(f);
-}
-
-Instantiation instantiate9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Closure f) {
-  return new Instantiation9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(f);
-}
-
-Instantiation instantiate10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
-    Closure f) {
-  return new Instantiation10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(f);
-}
-
-Instantiation instantiate11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
-    Closure f) {
-  return new Instantiation11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(f);
-}
-
-Instantiation instantiate12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
-    Closure f) {
-  return new Instantiation12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
-      f);
-}
-
-Instantiation
-    instantiate13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
-        Closure f) {
-  return new Instantiation13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13>(f);
-}
-
-Instantiation
-    instantiate14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
-        Closure f) {
-  return new Instantiation14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14>(f);
-}
-
-Instantiation instantiate15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-    T13, T14, T15>(Closure f) {
-  return new Instantiation15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14, T15>(f);
-}
-
-Instantiation instantiate16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-    T13, T14, T15, T16>(Closure f) {
-  return new Instantiation16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14, T15, T16>(f);
-}
-
-Instantiation instantiate17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-    T13, T14, T15, T16, T17>(Closure f) {
-  return new Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14, T15, T16, T17>(f);
-}
-
-Instantiation instantiate18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-    T13, T14, T15, T16, T17, T18>(Closure f) {
-  return new Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14, T15, T16, T17, T18>(f);
-}
-
-Instantiation instantiate19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-    T13, T14, T15, T16, T17, T18, T19>(Closure f) {
-  return new Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14, T15, T16, T17, T18, T19>(f);
-}
-
-Instantiation instantiate20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-    T13, T14, T15, T16, T17, T18, T19, T20>(Closure f) {
-  return new Instantiation20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
-      T13, T14, T15, T16, T17, T18, T19, T20>(f);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/interceptors.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/interceptors.dart
deleted file mode 100644
index fc97282..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/interceptors.dart
+++ /dev/null
@@ -1,447 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library _interceptors;
-
-import 'dart:_js_embedded_names'
-    show DISPATCH_PROPERTY_NAME, TYPE_TO_INTERCEPTOR_MAP;
-
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' hide Symbol;
-import "dart:_internal" as _symbol_dev show Symbol;
-import 'dart:_js_helper'
-    show
-        allMatchesInStringUnchecked,
-        JSSyntaxRegExp,
-        Primitives,
-        argumentErrorValue,
-        checkBool,
-        checkInt,
-        checkNull,
-        checkNum,
-        checkString,
-        defineProperty,
-        diagnoseIndexError,
-        getIsolateAffinityTag,
-        getRuntimeType,
-        initNativeDispatch,
-        initNativeDispatchFlag,
-        regExpGetNative,
-        regExpCaptureCount,
-        stringContainsUnchecked,
-        stringIndexOfStringUnchecked,
-        stringLastIndexOfUnchecked,
-        stringReplaceAllFuncUnchecked,
-        stringReplaceAllUnchecked,
-        stringReplaceFirstUnchecked,
-        stringReplaceFirstMappedUnchecked,
-        stringReplaceRangeUnchecked,
-        stringSplitUnchecked,
-        throwConcurrentModificationError,
-        lookupAndCacheInterceptor,
-        StringMatch,
-        firstMatchAfter,
-        NoInline;
-
-import 'dart:_foreign_helper'
-    show
-        getInterceptor,
-        JS,
-        JS_EFFECT,
-        JS_EMBEDDED_GLOBAL,
-        JS_INTERCEPTOR_CONSTANT,
-        JS_STRING_CONCAT;
-import 'dart:math' show Random, ln2;
-
-part 'js_array.dart';
-part 'js_number.dart';
-part 'js_string.dart';
-
-final String DART_CLOSURE_PROPERTY_NAME =
-    getIsolateAffinityTag(r'_$dart_dartClosure');
-
-getDispatchProperty(object) {
-  return JS(
-      '', '#[#]', object, JS_EMBEDDED_GLOBAL('String', DISPATCH_PROPERTY_NAME));
-}
-
-setDispatchProperty(object, value) {
-  defineProperty(
-      object, JS_EMBEDDED_GLOBAL('String', DISPATCH_PROPERTY_NAME), value);
-}
-
-// Avoid inlining this method because inlining gives us multiple allocation
-// points for records which is bad because it leads to polymorphic access.
-@pragma('dart2js:noInline')
-makeDispatchRecord(interceptor, proto, extension, indexability) {
-  // Dispatch records are stored in the prototype chain, and in some cases, on
-  // instances.
-  //
-  // The record layout and field usage is designed to minimize the number of
-  // operations on the common paths.
-  //
-  // [interceptor] is the interceptor - a holder of methods for the object,
-  // i.e. the prototype of the interceptor class.
-  //
-  // [proto] is usually the prototype, used to check that the dispatch record
-  // matches the object and is not the dispatch record of a superclass.  Other
-  // values:
-  //  - `false` for leaf classes that need no check.
-  //  - `true` for Dart classes where the object is its own interceptor (unused)
-  //  - a function used to continue matching.
-  //
-  // [extension] is used for irregular cases.
-  //
-  // [indexability] is used to cache whether or not the object
-  // implements JavaScriptIndexingBehavior.
-  //
-  //     proto  interceptor extension action
-  //     -----  ----------- --------- ------
-  //     false  I                     use interceptor I
-  //     true   -                     use object
-  //     P      I                     if object's prototype is P, use I
-  //     F      -           P         if object's prototype is P, call F
-
-  return JS('', '{i: #, p: #, e: #, x: #}', interceptor, proto, extension,
-      indexability);
-}
-
-dispatchRecordInterceptor(record) => JS('', '#.i', record);
-dispatchRecordProto(record) => JS('', '#.p', record);
-dispatchRecordExtension(record) => JS('', '#.e', record);
-bool? dispatchRecordIndexability(record) => JS('bool|Null', '#.x', record);
-
-/// Returns the interceptor for a native class instance. Used by
-/// [getInterceptor].
-getNativeInterceptor(object) {
-  var record = getDispatchProperty(object);
-
-  if (record == null) {
-    if (initNativeDispatchFlag == null) {
-      initNativeDispatch();
-      record = getDispatchProperty(object);
-    }
-  }
-
-  if (record != null) {
-    var proto = dispatchRecordProto(record);
-    if (false == proto) return dispatchRecordInterceptor(record);
-    if (true == proto) return object;
-    var objectProto = JS('', 'Object.getPrototypeOf(#)', object);
-    if (JS('bool', '# === #', proto, objectProto)) {
-      return dispatchRecordInterceptor(record);
-    }
-
-    var extension = dispatchRecordExtension(record);
-    if (JS('bool', '# === #', extension, objectProto)) {
-      // TODO(sra): The discriminator returns a tag.  The tag is an uncached or
-      // instance-cached tag, defaulting to instance-cached if caching
-      // unspecified.
-      var discriminatedTag = JS('', '(#)(#, #)', proto, object, record);
-      throw new UnimplementedError('Return interceptor for $discriminatedTag');
-    }
-  }
-
-  // Check for cached UnknownJavaScriptObject. This avoids doing the slow
-  // dispatch-record based lookup for repeated js-interop classes.
-  var constructor = JS('', '#.constructor', object);
-  var interceptor = lookupInterceptorByConstructor(constructor);
-  if (interceptor != null) return interceptor;
-
-  // This takes care of dispatch-record based caching, but not constructor based
-  // caching of [UnknownJavaScriptObject]s.
-  interceptor = lookupAndCacheInterceptor(object);
-  if (interceptor != null) return interceptor;
-
-  // JavaScript Objects created via object literals and `Object.create(null)`
-  // are 'plain' Objects.  This test could be simplified and the dispatch path
-  // be faster if Object.prototype was pre-patched with a non-leaf dispatch
-  // record.
-  if (JS('bool', 'typeof # == "function"', object)) {
-    interceptor = JS_INTERCEPTOR_CONSTANT(JavaScriptFunction);
-    // TODO(sra): Investigate caching on `Function`. It might be impossible if
-    // some HTML embedded objects on some browsers are (still) JS functions.
-    return interceptor;
-  }
-  var proto = JS('', 'Object.getPrototypeOf(#)', object);
-  if (JS('bool', '# == null', proto)) {
-    // Nowhere to cache output.
-    return JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject);
-  }
-  interceptor = JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject);
-  if (JS('bool', '# === Object.prototype', proto)) {
-    interceptor = JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject);
-    // TODO(sra): Investigate caching on 'Object'. It might be impossible if
-    // some native class is plain Object (e.g. like Firefox's ImageData).
-    return interceptor;
-  }
-  if (JS('bool', 'typeof # == "function"', constructor)) {
-    cacheInterceptorOnConstructor(constructor, interceptor);
-    return interceptor;
-  }
-  return JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject);
-}
-
-// A JS String or Symbol.
-dynamic _JS_INTEROP_INTERCEPTOR_TAG = null;
-get JS_INTEROP_INTERCEPTOR_TAG {
-  return _JS_INTEROP_INTERCEPTOR_TAG ??= getIsolateAffinityTag(r'_$dart_js');
-}
-
-lookupInterceptorByConstructor(constructor) {
-  return constructor == null
-      ? null
-      : JS('', '#[#]', constructor, JS_INTEROP_INTERCEPTOR_TAG);
-}
-
-void cacheInterceptorOnConstructor(constructor, interceptor) {
-  defineProperty(constructor, JS_INTEROP_INTERCEPTOR_TAG, interceptor);
-}
-
-var constructorToInterceptor =
-    JS('', 'typeof(self.WeakMap) == "undefined" ? new Map() : new WeakMap()');
-
-XlookupInterceptorByConstructor(constructor) {
-  return JS('', '#.get(#)', constructorToInterceptor, constructor);
-}
-
-void XcacheInterceptorOnConstructor(constructor, interceptor) {
-  JS('', '#.set(#, #)', constructorToInterceptor, constructor, interceptor);
-}
-
-/// Data structure used to map a [Type] to the [Interceptor] and constructors
-/// for that type.  It is JavaScript array of 3N entries of adjacent slots
-/// containing a [Type], followed by an [Interceptor] class for the type,
-/// followed by a JavaScript object map for the constructors.
-///
-/// The value of this variable is set by the compiler and contains only types
-/// that are user extensions of native classes where the type occurs as a
-/// constant in the program.
-///
-/// The compiler, in CustomElementsAnalysis, assumes that [typeToInterceptorMap]
-/// is accessed only by code that also calls [findIndexForWebComponentType].  If
-/// this assumption is invalidated, the compiler will have to be updated.
-get typeToInterceptorMap {
-  return JS_EMBEDDED_GLOBAL('', TYPE_TO_INTERCEPTOR_MAP);
-}
-
-int? findIndexForNativeSubclassType(Type? type) {
-  if (JS('bool', '# == null', typeToInterceptorMap)) return null;
-  List map = JS('JSFixedArray', '#', typeToInterceptorMap);
-  for (int i = 0; i + 1 < map.length; i += 3) {
-    if (type == map[i]) {
-      return i;
-    }
-  }
-  return null;
-}
-
-findInterceptorConstructorForType(Type? type) {
-  var index = findIndexForNativeSubclassType(type);
-  if (index == null) return null;
-  List map = JS('JSFixedArray', '#', typeToInterceptorMap);
-  return map[index + 1];
-}
-
-/// Returns a JavaScript function that runs the constructor on its argument, or
-/// `null` if there is no such constructor.
-///
-/// The returned function takes one argument, the web component object.
-findConstructorForNativeSubclassType(Type? type, String name) {
-  var index = findIndexForNativeSubclassType(type);
-  if (index == null) return null;
-  List map = JS('JSFixedArray', '#', typeToInterceptorMap);
-  var constructorMap = map[index + 2];
-  var constructorFn = JS('', '#[#]', constructorMap, name);
-  return constructorFn;
-}
-
-findInterceptorForType(Type? type) {
-  var constructor = findInterceptorConstructorForType(type);
-  if (constructor == null) return null;
-  return JS('', '#.prototype', constructor);
-}
-
-/// The base interceptor class.
-///
-/// The code `r.foo(a)` is compiled to `getInterceptor(r).foo$1(r, a)`.  The
-/// value returned by [getInterceptor] holds the methods separately from the
-/// state of the instance.  The compiler converts the methods on an interceptor
-/// to take the Dart `this` argument as an explicit `receiver` argument.  The
-/// JavaScript `this` parameter is bound to the interceptor.
-///
-/// In order to have uniform call sites, if a method is defined on an
-/// interceptor, methods of that name on plain unintercepted classes also use
-/// the interceptor calling convention.  The plain classes are
-/// _self-interceptors_, and for them, `getInterceptor(r)` returns `r`.  Methods
-/// on plain unintercepted classes have a redundant `receiver` argument and, to
-/// enable some optimizations, must ignore `receiver` in favour of `this`.
-///
-/// In the case of mixins, a method may be placed on both an intercepted class
-/// and an unintercepted class.  In this case, the method must use the
-/// `receiver` parameter.
-///
-///
-/// There are various optimizations of the general call pattern.
-///
-/// When the interceptor can be statically determined, it can be used directly:
-///
-///     CONSTANT_INTERCEPTOR.foo$1(r, a)
-///
-/// If there are only a few classes, [getInterceptor] can be specialized with a
-/// more efficient dispatch:
-///
-///     getInterceptor$specialized(r).foo$1(r, a)
-///
-/// If it can be determined that the receiver is an unintercepted class, it can
-/// be called directly:
-///
-///     r.foo$1(r, a)
-///
-/// If, further, it is known that the call site cannot call a foo that is
-/// mixed-in to a native class, then it is known that the explicit receiver is
-/// ignored, and space-saving dummy value can be passed instead:
-///
-///     r.foo$1(0, a)
-///
-/// This class defines implementations of *all* methods on [Object] so no
-/// interceptor inherits an implementation from [Object].  This enables the
-/// implementations on Object to ignore the explicit receiver argument, which
-/// allows dummy receiver optimization.
-abstract class Interceptor {
-  const Interceptor();
-
-  bool operator ==(other) => identical(this, other);
-
-  int get hashCode => Primitives.objectHashCode(this);
-
-  String toString() => Primitives.objectToHumanReadableString(this);
-
-  // [Interceptor.noSuchMethod] is identical to [Object.noSuchMethod].  However,
-  // each copy is compiled differently.  The presence of the method on an
-  // Interceptor class forces [noSuchMethod] to use interceptor calling
-  // convention.  In the [Interceptor] version, `this` is the explicit receiver
-  // argument. In the [Object] version, as Object is not an intercepted class,
-  // `this` is the JavaScript receiver, and the explicit receiver is ignored.
-  // The noSuchMethod stubs for selectors that use the interceptor calling
-  // convention do not know the calling convention and forward `this` and
-  // `receiver` to one of these noSuchMethod implementations which selects the
-  // correct Dart receiver.
-  //
-  // We don't allow [noSuchMethod] on intercepted classes (that would force all
-  // calls to use interceptor calling convention).  If we did allow it, the
-  // interceptor context would select the correct `this`.
-  dynamic noSuchMethod(Invocation invocation) {
-    throw new NoSuchMethodError(this, invocation.memberName,
-        invocation.positionalArguments, invocation.namedArguments);
-  }
-
-  Type get runtimeType => getRuntimeType(this);
-}
-
-/// The interceptor class for [bool].
-class JSBool extends Interceptor implements bool {
-  const JSBool();
-
-  // Note: if you change this, also change the function [S].
-  String toString() => JS('String', r'String(#)', this);
-
-  bool operator &(bool other) => JS('bool', "# && #", checkBool(other), this);
-
-  bool operator |(bool other) => JS('bool', "# || #", checkBool(other), this);
-
-  bool operator ^(bool other) => !identical(this, checkBool(other));
-
-  // The values here are SMIs, co-prime and differ about half of the bit
-  // positions, including the low bit, so they are different mod 2^k.
-  int get hashCode => this ? (2 * 3 * 23 * 3761) : (269 * 811);
-
-  Type get runtimeType => bool;
-}
-
-/// The interceptor class for [Null].
-///
-/// This class defines implementations for *all* methods on [Object] since
-/// the methods on Object assume the receiver is non-null.  This means that
-/// JSNull will always be in the interceptor set for methods defined on Object.
-class JSNull extends Interceptor implements Null {
-  const JSNull();
-
-  bool operator ==(other) => identical(null, other);
-
-  // Note: if you change this, also change the function [S].
-  String toString() => 'null';
-
-  int get hashCode => 0;
-
-  // The spec guarantees that `null` is the singleton instance of the `Null`
-  // class. In the mirrors library we also have to patch the `type` getter to
-  // special case `null`.
-  Type get runtimeType => Null;
-
-  dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-/// The supertype for JSString and JSArray. Used by the backend as to
-/// have a type mask that contains the objects that we can use the
-/// native JS [] operator and length on.
-abstract class JSIndexable<E> {
-  int get length;
-  E operator [](int index);
-}
-
-/// The supertype for JSMutableArray and
-/// JavaScriptIndexingBehavior. Used by the backend to have a type mask
-/// that contains the objects we can use the JS []= operator on.
-abstract class JSMutableIndexable<E> extends JSIndexable<E> {
-  operator []=(int index, E value);
-}
-
-/// The interface implemented by JavaScript objects.  These are methods in
-/// addition to the regular Dart Object methods like [Object.hashCode].
-///
-/// This is the type that should be exported by a JavaScript interop library.
-abstract class JSObject {}
-
-/// Interceptor base class for JavaScript objects not recognized as some more
-/// specific native type.
-class JavaScriptObject extends Interceptor implements JSObject {
-  const JavaScriptObject();
-
-  // It would be impolite to stash a property on the object.
-  int get hashCode => 0;
-
-  Type get runtimeType => JSObject;
-
-  /// Returns the result of the JavaScript objects `toString` method.
-  String toString() => JS('String', 'String(#)', this);
-}
-
-/// Interceptor for plain JavaScript objects created as JavaScript object
-/// literals or `new Object()`.
-class PlainJavaScriptObject extends JavaScriptObject {
-  const PlainJavaScriptObject();
-}
-
-/// Interceptor for unclassified JavaScript objects, typically objects with a
-/// non-trivial prototype chain.
-///
-/// This class also serves as a fallback for unknown JavaScript exceptions.
-class UnknownJavaScriptObject extends JavaScriptObject {
-  const UnknownJavaScriptObject();
-}
-
-/// Interceptor for JavaScript function objects and Dart functions that have
-/// been converted to JavaScript functions.
-/// These interceptor methods are not always used as the JavaScript function
-/// object has also been mangled to support Dart function calling conventions.
-class JavaScriptFunction extends JavaScriptObject implements Function {
-  const JavaScriptFunction();
-
-  String toString() {
-    var dartClosure = JS('', '#.#', this, DART_CLOSURE_PROPERTY_NAME);
-    if (dartClosure == null) return super.toString();
-    return 'JavaScript function for ${dartClosure.toString()}';
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/internal_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/internal_patch.dart
deleted file mode 100644
index e2922ca..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/internal_patch.dart
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:core' hide Symbol;
-import 'dart:core' as core show Symbol;
-import 'dart:_js_primitives' show printString;
-import 'dart:_js_helper' show patch;
-import 'dart:_interceptors' show JSArray;
-import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
-
-@patch
-@pragma('dart2js:tryInline')
-bool typeAcceptsNull<T>() {
-  bool isLegacySubtyping = JS_GET_FLAG('LEGACY');
-  return isLegacySubtyping || null is T;
-}
-
-@patch
-class Symbol implements core.Symbol {
-  @patch
-  const Symbol(String name) : this._name = name;
-
-  @patch
-  int get hashCode {
-    int? hash = JS('int|Null', '#._hashCode', this);
-    if (hash != null) return hash;
-    const arbitraryPrime = 664597;
-    hash = 0x1fffffff & (arbitraryPrime * _name.hashCode);
-    JS('', '#._hashCode = #', this, hash);
-    return hash;
-  }
-
-  @patch
-  toString() => 'Symbol("$_name")';
-
-  @patch
-  static String computeUnmangledName(Symbol symbol) {
-    throw "unsupported operation";
-  }
-}
-
-@patch
-void printToConsole(String line) {
-  printString('$line');
-}
-
-@patch
-List<T> makeListFixedLength<T>(List<T> growableList) {
-  return JSArray.markFixedList(growableList);
-}
-
-@patch
-List<T> makeFixedListUnmodifiable<T>(List<T> fixedLengthList) {
-  return JSArray.markUnmodifiableList(fixedLengthList);
-}
-
-@patch
-@pragma('dart2js:noInline')
-Object extractTypeArguments<T>(T instance, Function extract) {
-  // This function is recognized and replaced with calls to js_runtime.
-
-  // This call to [extract] is required to model that the function is called and
-  // the returned value flows to the result of extractTypeArguments.
-  return extract();
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/io_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/io_patch.dart
deleted file mode 100644
index 77a2530..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/io_patch.dart
+++ /dev/null
@@ -1,707 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:_js_helper' show patch;
-import 'dart:_internal' hide Symbol;
-import 'dart:async';
-import 'dart:convert';
-import 'dart:isolate';
-import 'dart:typed_data';
-
-@patch
-class _Directory {
-  @patch
-  static _current(_Namespace namespace) {
-    throw new UnsupportedError("Directory._current");
-  }
-
-  @patch
-  static _setCurrent(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("Directory_SetCurrent");
-  }
-
-  @patch
-  static _createTemp(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("Directory._createTemp");
-  }
-
-  @patch
-  static String _systemTemp(_Namespace namespace) {
-    throw new UnsupportedError("Directory._systemTemp");
-  }
-
-  @patch
-  static _exists(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("Directory._exists");
-  }
-
-  @patch
-  static _create(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("Directory._create");
-  }
-
-  @patch
-  static _deleteNative(_Namespace namespace, Uint8List path, bool recursive) {
-    throw new UnsupportedError("Directory._deleteNative");
-  }
-
-  @patch
-  static _rename(_Namespace namespace, Uint8List path, String newPath) {
-    throw new UnsupportedError("Directory._rename");
-  }
-
-  @patch
-  static void _fillWithDirectoryListing(
-      _Namespace namespace,
-      List<FileSystemEntity> list,
-      Uint8List path,
-      bool recursive,
-      bool followLinks) {
-    throw new UnsupportedError("Directory._fillWithDirectoryListing");
-  }
-}
-
-@patch
-class _AsyncDirectoryListerOps {
-  @patch
-  factory _AsyncDirectoryListerOps(int pointer) {
-    throw new UnsupportedError("Directory._list");
-  }
-}
-
-@patch
-class _EventHandler {
-  @patch
-  static void _sendData(Object? sender, SendPort sendPort, int data) {
-    throw new UnsupportedError("EventHandler._sendData");
-  }
-}
-
-@patch
-class FileStat {
-  @patch
-  static _statSync(_Namespace namespace, String path) {
-    throw new UnsupportedError("FileStat.stat");
-  }
-}
-
-@patch
-class FileSystemEntity {
-  @patch
-  static _getTypeNative(
-      _Namespace namespace, Uint8List path, bool followLinks) {
-    throw new UnsupportedError("FileSystemEntity._getType");
-  }
-
-  @patch
-  static _identicalNative(_Namespace namespace, String path1, String path2) {
-    throw new UnsupportedError("FileSystemEntity._identical");
-  }
-
-  @patch
-  static _resolveSymbolicLinks(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("FileSystemEntity._resolveSymbolicLinks");
-  }
-}
-
-@patch
-class _File {
-  @patch
-  static _exists(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._exists");
-  }
-
-  @patch
-  static _create(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._create");
-  }
-
-  @patch
-  static _createLink(_Namespace namespace, Uint8List path, String target) {
-    throw new UnsupportedError("File._createLink");
-  }
-
-  @patch
-  static _linkTarget(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._linkTarget");
-  }
-
-  @patch
-  static _deleteNative(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._deleteNative");
-  }
-
-  @patch
-  static _deleteLinkNative(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._deleteLinkNative");
-  }
-
-  @patch
-  static _rename(_Namespace namespace, Uint8List oldPath, String newPath) {
-    throw new UnsupportedError("File._rename");
-  }
-
-  @patch
-  static _renameLink(_Namespace namespace, Uint8List oldPath, String newPath) {
-    throw new UnsupportedError("File._renameLink");
-  }
-
-  @patch
-  static _copy(_Namespace namespace, Uint8List oldPath, String newPath) {
-    throw new UnsupportedError("File._copy");
-  }
-
-  @patch
-  static _lengthFromPath(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._lengthFromPath");
-  }
-
-  @patch
-  static _lastModified(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._lastModified");
-  }
-
-  @patch
-  static _lastAccessed(_Namespace namespace, Uint8List path) {
-    throw new UnsupportedError("File._lastAccessed");
-  }
-
-  @patch
-  static _setLastModified(_Namespace namespace, Uint8List path, int millis) {
-    throw new UnsupportedError("File._setLastModified");
-  }
-
-  @patch
-  static _setLastAccessed(_Namespace namespace, Uint8List path, int millis) {
-    throw new UnsupportedError("File._setLastAccessed");
-  }
-
-  @patch
-  static _open(_Namespace namespace, Uint8List path, int mode) {
-    throw new UnsupportedError("File._open");
-  }
-
-  @patch
-  static int _openStdio(int fd) {
-    throw new UnsupportedError("File._openStdio");
-  }
-}
-
-@patch
-class _Namespace {
-  @patch
-  static void _setupNamespace(var namespace) {
-    throw new UnsupportedError("_Namespace");
-  }
-
-  @patch
-  static _Namespace get _namespace {
-    throw new UnsupportedError("_Namespace");
-  }
-
-  @patch
-  static int get _namespacePointer {
-    throw new UnsupportedError("_Namespace");
-  }
-}
-
-@patch
-class _RandomAccessFileOps {
-  @patch
-  factory _RandomAccessFileOps(int pointer) {
-    throw new UnsupportedError("RandomAccessFile");
-  }
-}
-
-@patch
-bool _isDirectIOCapableTypedList(List<int> buffer) {
-  throw UnsupportedError("_isDirectIOCapableTypedList");
-}
-
-@patch
-class _IOCrypto {
-  @patch
-  static Uint8List getRandomBytes(int count) {
-    throw new UnsupportedError("_IOCrypto.getRandomBytes");
-  }
-}
-
-@patch
-class _Platform {
-  @patch
-  static int _numberOfProcessors() {
-    throw new UnsupportedError("Platform._numberOfProcessors");
-  }
-
-  @patch
-  static String _pathSeparator() {
-    throw new UnsupportedError("Platform._pathSeparator");
-  }
-
-  @patch
-  static String _operatingSystem() {
-    throw new UnsupportedError("Platform._operatingSystem");
-  }
-
-  @patch
-  static _operatingSystemVersion() {
-    throw new UnsupportedError("Platform._operatingSystemVersion");
-  }
-
-  @patch
-  static _localHostname() {
-    throw new UnsupportedError("Platform._localHostname");
-  }
-
-  @patch
-  static _executable() {
-    throw new UnsupportedError("Platform._executable");
-  }
-
-  @patch
-  static _resolvedExecutable() {
-    throw new UnsupportedError("Platform._resolvedExecutable");
-  }
-
-  @patch
-  static List<String> _executableArguments() {
-    throw new UnsupportedError("Platform._executableArguments");
-  }
-
-  @patch
-  static String _packageRoot() {
-    throw new UnsupportedError("Platform._packageRoot");
-  }
-
-  @patch
-  static String _packageConfig() {
-    throw new UnsupportedError("Platform._packageConfig");
-  }
-
-  @patch
-  static _environment() {
-    throw new UnsupportedError("Platform._environment");
-  }
-
-  @patch
-  static String _version() {
-    throw new UnsupportedError("Platform._version");
-  }
-
-  @patch
-  static String _localeName() {
-    throw new UnsupportedError("Platform._localeName");
-  }
-
-  @patch
-  static Uri _script() {
-    throw new UnsupportedError("Platform._script");
-  }
-}
-
-@patch
-class _ProcessUtils {
-  @patch
-  static Never _exit(int status) {
-    throw new UnsupportedError("ProcessUtils._exit");
-  }
-
-  @patch
-  static void _setExitCode(int status) {
-    throw new UnsupportedError("ProcessUtils._setExitCode");
-  }
-
-  @patch
-  static int _getExitCode() {
-    throw new UnsupportedError("ProcessUtils._getExitCode");
-  }
-
-  @patch
-  static void _sleep(int millis) {
-    throw new UnsupportedError("ProcessUtils._sleep");
-  }
-
-  @patch
-  static int _pid(Process? process) {
-    throw new UnsupportedError("ProcessUtils._pid");
-  }
-
-  @patch
-  static Stream<ProcessSignal> _watchSignal(ProcessSignal signal) {
-    throw new UnsupportedError("ProcessUtils._watchSignal");
-  }
-}
-
-@patch
-class ProcessInfo {
-  @patch
-  static int get currentRss {
-    throw new UnsupportedError("ProcessInfo.currentRss");
-  }
-
-  @patch
-  static int get maxRss {
-    throw new UnsupportedError("ProcessInfo.maxRss");
-  }
-}
-
-@patch
-class Process {
-  @patch
-  static Future<Process> start(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      ProcessStartMode mode: ProcessStartMode.normal}) {
-    throw new UnsupportedError("Process.start");
-  }
-
-  @patch
-  static Future<ProcessResult> run(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      Encoding stdoutEncoding: systemEncoding,
-      Encoding stderrEncoding: systemEncoding}) {
-    throw new UnsupportedError("Process.run");
-  }
-
-  @patch
-  static ProcessResult runSync(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      Encoding stdoutEncoding: systemEncoding,
-      Encoding stderrEncoding: systemEncoding}) {
-    throw new UnsupportedError("Process.runSync");
-  }
-
-  @patch
-  static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
-    throw new UnsupportedError("Process.killPid");
-  }
-}
-
-@patch
-class InternetAddress {
-  @patch
-  static InternetAddress get LOOPBACK_IP_V4 {
-    throw new UnsupportedError("InternetAddress.LOOPBACK_IP_V4");
-  }
-
-  @patch
-  static InternetAddress get LOOPBACK_IP_V6 {
-    throw new UnsupportedError("InternetAddress.LOOPBACK_IP_V6");
-  }
-
-  @patch
-  static InternetAddress get ANY_IP_V4 {
-    throw new UnsupportedError("InternetAddress.ANY_IP_V4");
-  }
-
-  @patch
-  static InternetAddress get ANY_IP_V6 {
-    throw new UnsupportedError("InternetAddress.ANY_IP_V6");
-  }
-
-  @patch
-  factory InternetAddress(String address, {InternetAddressType? type}) {
-    throw new UnsupportedError("InternetAddress");
-  }
-
-  @patch
-  factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType? type}) {
-    throw new UnsupportedError("InternetAddress.fromRawAddress");
-  }
-
-  @patch
-  static Future<List<InternetAddress>> lookup(String host,
-      {InternetAddressType type: InternetAddressType.any}) {
-    throw new UnsupportedError("InternetAddress.lookup");
-  }
-
-  @patch
-  static InternetAddress _cloneWithNewHost(
-      InternetAddress address, String host) {
-    throw new UnsupportedError("InternetAddress._cloneWithNewHost");
-  }
-
-  @patch
-  static InternetAddress? tryParse(String address) {
-    throw UnsupportedError("InternetAddress.tryParse");
-  }
-}
-
-@patch
-class NetworkInterface {
-  @patch
-  static bool get listSupported {
-    throw new UnsupportedError("NetworkInterface.listSupported");
-  }
-
-  @patch
-  static Future<List<NetworkInterface>> list(
-      {bool includeLoopback: false,
-      bool includeLinkLocal: false,
-      InternetAddressType type: InternetAddressType.any}) {
-    throw new UnsupportedError("NetworkInterface.list");
-  }
-}
-
-@patch
-class RawServerSocket {
-  @patch
-  static Future<RawServerSocket> bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    throw new UnsupportedError("RawServerSocket.bind");
-  }
-}
-
-@patch
-class ServerSocket {
-  @patch
-  static Future<ServerSocket> _bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    throw new UnsupportedError("ServerSocket.bind");
-  }
-}
-
-@patch
-class RawSocket {
-  @patch
-  static Future<RawSocket> connect(dynamic host, int port,
-      {dynamic sourceAddress, Duration? timeout}) {
-    throw new UnsupportedError("RawSocket constructor");
-  }
-
-  @patch
-  static Future<ConnectionTask<RawSocket>> startConnect(dynamic host, int port,
-      {dynamic sourceAddress}) {
-    throw new UnsupportedError("RawSocket constructor");
-  }
-}
-
-@patch
-class Socket {
-  @patch
-  static Future<Socket> _connect(dynamic host, int port,
-      {dynamic sourceAddress, Duration? timeout}) {
-    throw new UnsupportedError("Socket constructor");
-  }
-
-  @patch
-  static Future<ConnectionTask<Socket>> _startConnect(dynamic host, int port,
-      {dynamic sourceAddress}) {
-    throw new UnsupportedError("Socket constructor");
-  }
-}
-
-@patch
-class SecureSocket {
-  @patch
-  factory SecureSocket._(RawSecureSocket rawSocket) {
-    throw new UnsupportedError("SecureSocket constructor");
-  }
-}
-
-@patch
-class RawSynchronousSocket {
-  @patch
-  static RawSynchronousSocket connectSync(dynamic host, int port) {
-    throw new UnsupportedError("RawSynchronousSocket.connectSync");
-  }
-}
-
-@patch
-class RawSocketOption {
-  @patch
-  static int _getOptionValue(int key) {
-    throw UnsupportedError("RawSocketOption._getOptionValue");
-  }
-}
-
-@patch
-class SecurityContext {
-  @patch
-  factory SecurityContext({bool withTrustedRoots: false}) {
-    throw new UnsupportedError("SecurityContext constructor");
-  }
-
-  @patch
-  static SecurityContext get defaultContext {
-    throw new UnsupportedError("default SecurityContext getter");
-  }
-
-  @patch
-  static bool get alpnSupported {
-    throw new UnsupportedError("SecurityContext alpnSupported getter");
-  }
-}
-
-@patch
-class X509Certificate {
-  @patch
-  factory X509Certificate._() {
-    throw new UnsupportedError("X509Certificate constructor");
-  }
-}
-
-@patch
-class RawDatagramSocket {
-  @patch
-  static Future<RawDatagramSocket> bind(dynamic host, int port,
-      {bool reuseAddress: true, bool reusePort: false, int ttl: 1}) {
-    throw new UnsupportedError("RawDatagramSocket.bind");
-  }
-}
-
-@patch
-class _SecureFilter {
-  @patch
-  factory _SecureFilter._() {
-    throw new UnsupportedError("_SecureFilter._SecureFilter");
-  }
-}
-
-@patch
-class _StdIOUtils {
-  @patch
-  static Stdin _getStdioInputStream(int fd) {
-    throw new UnsupportedError("StdIOUtils._getStdioInputStream");
-  }
-
-  @patch
-  static _getStdioOutputStream(int fd) {
-    throw new UnsupportedError("StdIOUtils._getStdioOutputStream");
-  }
-
-  @patch
-  static int _socketType(Socket socket) {
-    throw new UnsupportedError("StdIOUtils._socketType");
-  }
-
-  @patch
-  static _getStdioHandleType(int fd) {
-    throw new UnsupportedError("StdIOUtils._getStdioHandleType");
-  }
-}
-
-@patch
-class _WindowsCodePageDecoder {
-  @patch
-  static String _decodeBytes(List<int> bytes) {
-    throw new UnsupportedError("_WindowsCodePageDecoder._decodeBytes");
-  }
-}
-
-@patch
-class _WindowsCodePageEncoder {
-  @patch
-  static List<int> _encodeString(String string) {
-    throw new UnsupportedError("_WindowsCodePageEncoder._encodeString");
-  }
-}
-
-@patch
-class RawZLibFilter {
-  @patch
-  static RawZLibFilter _makeZLibDeflateFilter(
-      bool gzip,
-      int level,
-      int windowBits,
-      int memLevel,
-      int strategy,
-      List<int>? dictionary,
-      bool raw) {
-    throw new UnsupportedError("_newZLibDeflateFilter");
-  }
-
-  @patch
-  static RawZLibFilter _makeZLibInflateFilter(
-      int windowBits, List<int>? dictionary, bool raw) {
-    throw new UnsupportedError("_newZLibInflateFilter");
-  }
-}
-
-@patch
-class Stdin {
-  @patch
-  int readByteSync() {
-    throw new UnsupportedError("Stdin.readByteSync");
-  }
-
-  @patch
-  bool get echoMode {
-    throw new UnsupportedError("Stdin.echoMode");
-  }
-
-  @patch
-  void set echoMode(bool enabled) {
-    throw new UnsupportedError("Stdin.echoMode");
-  }
-
-  @patch
-  bool get lineMode {
-    throw new UnsupportedError("Stdin.lineMode");
-  }
-
-  @patch
-  void set lineMode(bool enabled) {
-    throw new UnsupportedError("Stdin.lineMode");
-  }
-
-  @patch
-  bool get supportsAnsiEscapes {
-    throw new UnsupportedError("Stdin.supportsAnsiEscapes");
-  }
-}
-
-@patch
-class Stdout {
-  @patch
-  bool _hasTerminal(int fd) {
-    throw new UnsupportedError("Stdout.hasTerminal");
-  }
-
-  @patch
-  int _terminalColumns(int fd) {
-    throw new UnsupportedError("Stdout.terminalColumns");
-  }
-
-  @patch
-  int _terminalLines(int fd) {
-    throw new UnsupportedError("Stdout.terminalLines");
-  }
-
-  @patch
-  static bool _supportsAnsiEscapes(int fd) {
-    throw new UnsupportedError("Stdout.supportsAnsiEscapes");
-  }
-}
-
-@patch
-class _FileSystemWatcher {
-  @patch
-  static Stream<FileSystemEvent> _watch(
-      String path, int events, bool recursive) {
-    throw new UnsupportedError("_FileSystemWatcher.watch");
-  }
-
-  @patch
-  static bool get isSupported {
-    throw new UnsupportedError("_FileSystemWatcher.isSupported");
-  }
-}
-
-@patch
-class _IOService {
-  @patch
-  static Future _dispatch(int request, List data) {
-    throw new UnsupportedError("_IOService._dispatch");
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/isolate_patch.dart
deleted file mode 100644
index 4c7f5c5..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/isolate_patch.dart
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for the dart:isolate library.
-
-import "dart:async";
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show patch;
-import "dart:typed_data" show TypedData;
-
-@patch
-class Isolate {
-  @patch
-  static Isolate get current {
-    throw new UnsupportedError("Isolate.current");
-  }
-
-  @patch
-  String? get debugName {
-    throw new UnsupportedError("Isolate.debugName");
-  }
-
-  @patch
-  static Future<Uri?> get packageRoot {
-    throw new UnsupportedError("Isolate.packageRoot");
-  }
-
-  @patch
-  static Future<Uri?> get packageConfig {
-    throw new UnsupportedError("Isolate.packageConfig");
-  }
-
-  @patch
-  static Future<Uri?> resolvePackageUri(Uri packageUri) {
-    throw new UnsupportedError("Isolate.resolvePackageUri");
-  }
-
-  @patch
-  static Future<Isolate> spawn<T>(void entryPoint(T message), T message,
-      {bool paused = false,
-      bool errorsAreFatal = true,
-      SendPort? onExit,
-      SendPort? onError}) {
-    throw new UnsupportedError("Isolate.spawn");
-  }
-
-  @patch
-  static Future<Isolate> spawnUri(Uri uri, List<String> args, var message,
-      {bool paused = false,
-      SendPort? onExit,
-      SendPort? onError,
-      bool errorsAreFatal = true,
-      bool? checked,
-      Map<String, String>? environment,
-      Uri? packageRoot,
-      Uri? packageConfig,
-      bool automaticPackageResolution = false,
-      String? debugName}) {
-    throw new UnsupportedError("Isolate.spawnUri");
-  }
-
-  @patch
-  void _pause(Capability resumeCapability) {
-    throw new UnsupportedError("Isolate._pause");
-  }
-
-  @patch
-  void resume(Capability resumeCapability) {
-    throw new UnsupportedError("Isolate.resume");
-  }
-
-  @patch
-  void addOnExitListener(SendPort responsePort, {Object? response}) {
-    throw new UnsupportedError("Isolate.addOnExitListener");
-  }
-
-  @patch
-  void removeOnExitListener(SendPort responsePort) {
-    throw new UnsupportedError("Isolate.removeOnExitListener");
-  }
-
-  @patch
-  void setErrorsFatal(bool errorsAreFatal) {
-    throw new UnsupportedError("Isolate.setErrorsFatal");
-  }
-
-  @patch
-  void kill({int priority = beforeNextEvent}) {
-    throw new UnsupportedError("Isolate.kill");
-  }
-
-  @patch
-  void ping(SendPort responsePort,
-      {Object? response, int priority = immediate}) {
-    throw new UnsupportedError("Isolate.ping");
-  }
-
-  @patch
-  void addErrorListener(SendPort port) {
-    throw new UnsupportedError("Isolate.addErrorListener");
-  }
-
-  @patch
-  void removeErrorListener(SendPort port) {
-    throw new UnsupportedError("Isolate.removeErrorListener");
-  }
-}
-
-@patch
-class ReceivePort {
-  @patch
-  factory ReceivePort() = _ReceivePortImpl;
-
-  @patch
-  factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) {
-    throw new UnsupportedError('new ReceivePort.fromRawReceivePort');
-  }
-}
-
-class _ReceivePortImpl extends Stream implements ReceivePort {
-  StreamSubscription listen(void Function(dynamic)? onData,
-      {Function? onError,
-      void Function()? onDone,
-      bool? cancelOnError = true}) {
-    throw new UnsupportedError("ReceivePort.listen");
-  }
-
-  void close() {}
-
-  SendPort get sendPort => throw new UnsupportedError("ReceivePort.sendPort");
-}
-
-@patch
-class RawReceivePort {
-  @patch
-  factory RawReceivePort([Function? handler]) {
-    throw new UnsupportedError('new RawReceivePort');
-  }
-}
-
-@patch
-class Capability {
-  @patch
-  factory Capability() {
-    throw new UnsupportedError('new Capability');
-  }
-}
-
-@patch
-abstract class TransferableTypedData {
-  @patch
-  factory TransferableTypedData.fromList(List<TypedData> list) {
-    throw new UnsupportedError('TransferableTypedData.fromList');
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart
deleted file mode 100644
index d131658..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_array.dart
+++ /dev/null
@@ -1,727 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _interceptors;
-
-class _Growable {
-  const _Growable();
-}
-
-const _ListConstructorSentinel = const _Growable();
-
-/// The interceptor class for [List]. The compiler recognizes this
-/// class as an interceptor, and changes references to [:this:] to
-/// actually use the receiver of the method, which is generated as an extra
-/// argument added to each member.
-class JSArray<E> extends Interceptor implements List<E>, JSIndexable<E> {
-  const JSArray();
-
-  // This factory constructor is the redirection target of the List() factory
-  // constructor. [length] has no type to permit the sentinel value.
-  factory JSArray.list([length = _ListConstructorSentinel]) {
-    if (_ListConstructorSentinel == length) {
-      return new JSArray<E>.emptyGrowable();
-    }
-    return new JSArray<E>.fixed(length);
-  }
-
-  /// Returns a fresh JavaScript Array, marked as fixed-length.
-  ///
-  /// [length] must be a non-negative integer.
-  factory JSArray.fixed(int length) {
-    // Explicit type test is necessary to guard against JavaScript conversions
-    // in unchecked mode, and against `new Array(null)` which creates a single
-    // element Array containing `null`.
-    if (length is! int) {
-      throw new ArgumentError.value(length, 'length', 'is not an integer');
-    }
-    // The JavaScript Array constructor with one argument throws if
-    // the value is not a UInt32. Give a better error message.
-    int maxJSArrayLength = 0xFFFFFFFF;
-    if (length < 0 || length > maxJSArrayLength) {
-      throw new RangeError.range(length, 0, maxJSArrayLength, 'length');
-    }
-    return new JSArray<E>.markFixed(JS('', 'new Array(#)', length));
-  }
-
-  /// Returns a fresh growable JavaScript Array of zero length length.
-  factory JSArray.emptyGrowable() => new JSArray<E>.markGrowable(JS('', '[]'));
-
-  /// Returns a fresh growable JavaScript Array with initial length.
-  ///
-  /// [validatedLength] must be a non-negative integer.
-  factory JSArray.growable(int length) {
-    // Explicit type test is necessary to guard against JavaScript conversions
-    // in unchecked mode.
-    if ((length is! int) || (length < 0)) {
-      throw new ArgumentError('Length must be a non-negative integer: $length');
-    }
-    return new JSArray<E>.markGrowable(JS('', 'new Array(#)', length));
-  }
-
-  /// Constructor for adding type parameters to an existing JavaScript Array.
-  /// The compiler specially recognizes this constructor.
-  ///
-  ///     var a = new JSArray<int>.typed(JS('JSExtendableArray', '[]'));
-  ///     a is List<int>    --> true
-  ///     a is List<String> --> false
-  ///
-  /// Usually either the [JSArray.markFixed] or [JSArray.markGrowable]
-  /// constructors is used instead.
-  ///
-  /// The input must be a JavaScript Array.  The JS form is just a re-assertion
-  /// to help type analysis when the input type is sloppy.
-  factory JSArray.typed(allocation) => JS('JSArray', '#', allocation);
-
-  factory JSArray.markFixed(allocation) =>
-      JS('JSFixedArray', '#', markFixedList(new JSArray<E>.typed(allocation)));
-
-  factory JSArray.markGrowable(allocation) =>
-      JS('JSExtendableArray', '#', new JSArray<E>.typed(allocation));
-
-  static List<T> markFixedList<T>(List<T> list) {
-    // Functions are stored in the hidden class and not as properties in
-    // the object. We never actually look at the value, but only want
-    // to know if the property exists.
-    JS('void', r'#.fixed$length = Array', list);
-    return JS('JSFixedArray', '#', list);
-  }
-
-  static List<T> markUnmodifiableList<T>(List list) {
-    // Functions are stored in the hidden class and not as properties in
-    // the object. We never actually look at the value, but only want
-    // to know if the property exists.
-    JS('void', r'#.fixed$length = Array', list);
-    JS('void', r'#.immutable$list = Array', list);
-    return JS('JSUnmodifiableArray', '#', list);
-  }
-
-  static bool isFixedLength(JSArray a) {
-    return !JS('bool', r'!#.fixed$length', a);
-  }
-
-  static bool isUnmodifiable(JSArray a) {
-    return !JS('bool', r'!#.immutable$list', a);
-  }
-
-  static bool isGrowable(JSArray a) {
-    return !isFixedLength(a);
-  }
-
-  static bool isMutable(JSArray a) {
-    return !isUnmodifiable(a);
-  }
-
-  checkMutable(String reason) {
-    if (!isMutable(this)) {
-      throw UnsupportedError(reason);
-    }
-  }
-
-  checkGrowable(String reason) {
-    if (!isGrowable(this)) {
-      throw UnsupportedError(reason);
-    }
-  }
-
-  List<R> cast<R>() => List.castFrom<E, R>(this);
-  void add(E value) {
-    checkGrowable('add');
-    JS('void', r'#.push(#)', this, value);
-  }
-
-  E removeAt(int index) {
-    checkGrowable('removeAt');
-    if (index is! int) throw argumentErrorValue(index);
-    if (index < 0 || index >= length) {
-      throw new RangeError.value(index);
-    }
-    return JS('', r'#.splice(#, 1)[0]', this, index);
-  }
-
-  void insert(int index, E value) {
-    checkGrowable('insert');
-    if (index is! int) throw argumentErrorValue(index);
-    if (index < 0 || index > length) {
-      throw new RangeError.value(index);
-    }
-    JS('void', r'#.splice(#, 0, #)', this, index, value);
-  }
-
-  void insertAll(int index, Iterable<E> iterable) {
-    checkGrowable('insertAll');
-    RangeError.checkValueInInterval(index, 0, this.length, 'index');
-    if (iterable is! EfficientLengthIterable) {
-      iterable = iterable.toList();
-    }
-    int insertionLength = iterable.length;
-    this.length += insertionLength;
-    int end = index + insertionLength;
-    this.setRange(end, this.length, this, index);
-    this.setRange(index, end, iterable);
-  }
-
-  void setAll(int index, Iterable<E> iterable) {
-    checkMutable('setAll');
-    RangeError.checkValueInInterval(index, 0, this.length, 'index');
-    for (var element in iterable) {
-      this[index++] = element;
-    }
-  }
-
-  E removeLast() {
-    checkGrowable('removeLast');
-    if (length == 0) throw diagnoseIndexError(this, -1);
-    return JS('', r'#.pop()', this);
-  }
-
-  bool remove(Object? element) {
-    checkGrowable('remove');
-    for (int i = 0; i < this.length; i++) {
-      if (this[i] == element) {
-        JS('', r'#.splice(#, 1)', this, i);
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /// Removes elements matching [test] from [this] List.
-  void removeWhere(bool test(E element)) {
-    checkGrowable('removeWhere');
-    _removeWhere(test, true);
-  }
-
-  void retainWhere(bool test(E element)) {
-    checkGrowable('retainWhere');
-    _removeWhere(test, false);
-  }
-
-  void _removeWhere(bool test(E element), bool removeMatching) {
-    // Performed in two steps, to avoid exposing an inconsistent state
-    // to the [test] function. First the elements to retain are found, and then
-    // the original list is updated to contain those elements.
-
-    // TODO(sra): Replace this algorithm with one that retains a list of ranges
-    // to be removed.  Most real uses remove 0, 1 or a few clustered elements.
-
-    List retained = [];
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      // !test() ensures bool conversion in checked mode.
-      if (!test(element) == removeMatching) {
-        retained.add(element);
-      }
-      if (this.length != end) throw new ConcurrentModificationError(this);
-    }
-    if (retained.length == end) return;
-    this.length = retained.length;
-    for (int i = 0; i < retained.length; i++) {
-      // We don't need a bounds check or an element type check.
-      JS('', '#[#] = #', this, i, retained[i]);
-    }
-  }
-
-  Iterable<E> where(bool f(E element)) {
-    return new WhereIterable<E>(this, f);
-  }
-
-  Iterable<T> expand<T>(Iterable<T> f(E element)) {
-    return new ExpandIterable<E, T>(this, f);
-  }
-
-  void addAll(Iterable<E> collection) {
-    int i = this.length;
-    checkGrowable('addAll');
-    for (E e in collection) {
-      assert(
-          i++ == this.length || (throw new ConcurrentModificationError(this)));
-      JS('void', r'#.push(#)', this, e);
-    }
-  }
-
-  void clear() {
-    length = 0;
-  }
-
-  void forEach(void f(E element)) {
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      f(element);
-      if (this.length != end) throw new ConcurrentModificationError(this);
-    }
-  }
-
-  Iterable<T> map<T>(T f(E element)) {
-    return new MappedListIterable<E, T>(this, f);
-  }
-
-  String join([String separator = '']) {
-    var list = List.filled(this.length, "");
-    for (int i = 0; i < this.length; i++) {
-      list[i] = '${this[i]}';
-    }
-    return JS('String', '#.join(#)', list, separator);
-  }
-
-  Iterable<E> take(int n) {
-    return new SubListIterable<E>(this, 0, n);
-  }
-
-  Iterable<E> takeWhile(bool test(E value)) {
-    return new TakeWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> skip(int n) {
-    return new SubListIterable<E>(this, n, null);
-  }
-
-  Iterable<E> skipWhile(bool test(E value)) {
-    return new SkipWhileIterable<E>(this, test);
-  }
-
-  E reduce(E combine(E previousValue, E element)) {
-    int length = this.length;
-    if (length == 0) throw IterableElementError.noElement();
-    E value = this[0];
-    for (int i = 1; i < length; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      value = combine(value, element);
-      if (length != this.length) throw new ConcurrentModificationError(this);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      value = combine(value, element);
-      if (this.length != length) throw new ConcurrentModificationError(this);
-    }
-    return value;
-  }
-
-  E firstWhere(bool Function(E) test, {E Function()? orElse}) {
-    var end = this.length;
-    for (int i = 0; i < end; ++i) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) return element;
-      if (this.length != end) throw new ConcurrentModificationError(this);
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool Function(E) test, {E Function()? orElse}) {
-    int length = this.length;
-    for (int i = length - 1; i >= 0; i--) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) return element;
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool Function(E) test, {E Function()? orElse}) {
-    int length = this.length;
-    E? match = null;
-    bool matchFound = false;
-    for (int i = 0; i < length; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) {
-        if (matchFound) {
-          throw IterableElementError.tooMany();
-        }
-        matchFound = true;
-        match = element;
-      }
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    if (matchFound) return match as E;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    return this[index];
-  }
-
-  List<E> sublist(int start, [int? end]) {
-    checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
-    if (start is! int) throw argumentErrorValue(start);
-    if (start < 0 || start > length) {
-      throw new RangeError.range(start, 0, length, 'start');
-    }
-    if (end == null) {
-      end = length;
-    } else {
-      if (end is! int) throw argumentErrorValue(end);
-      if (end < start || end > length) {
-        throw new RangeError.range(end, start, length, 'end');
-      }
-    }
-    if (start == end) return <E>[];
-    return new JSArray<E>.markGrowable(
-        JS('', r'#.slice(#, #)', this, start, end));
-  }
-
-  Iterable<E> getRange(int start, int end) {
-    RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<E>(this, start, end);
-  }
-
-  E get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  E get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  void removeRange(int start, int end) {
-    checkGrowable('removeRange');
-    RangeError.checkValidRange(start, end, this.length);
-    int deleteCount = end - start;
-    JS('', '#.splice(#, #)', this, start, deleteCount);
-  }
-
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    checkMutable('setRange');
-
-    RangeError.checkValidRange(start, end, this.length);
-    int length = end - start;
-    if (length == 0) return;
-    RangeError.checkNotNegative(skipCount, 'skipCount');
-
-    List<E> otherList;
-    int otherStart;
-    // TODO(floitsch): Make this accept more.
-    if (iterable is List) {
-      otherList = JS<List<E>>('', '#', iterable);
-      otherStart = skipCount;
-    } else {
-      otherList = iterable.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + length > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    if (otherStart < start) {
-      // Copy backwards to ensure correct copy if [from] is this.
-      // TODO(sra): If [from] is the same Array as [this], we can copy without
-      // type annotation checks on the stores.
-      for (int i = length - 1; i >= 0; i--) {
-        // Use JS to avoid bounds check (the bounds check elimination
-        // optimzation is too weak). The 'E' type annotation is a store type
-        // check - we can't rely on iterable, it could be List<dynamic>.
-        E element = otherList[otherStart + i];
-        JS('', '#[#] = #', this, start + i, element);
-      }
-    } else {
-      for (int i = 0; i < length; i++) {
-        E element = otherList[otherStart + i];
-        JS('', '#[#] = #', this, start + i, element);
-      }
-    }
-  }
-
-  void fillRange(int start, int end, [E? fillValue]) {
-    checkMutable('fill range');
-    RangeError.checkValidRange(start, end, this.length);
-    E checkedFillValue = fillValue as E;
-    for (int i = start; i < end; i++) {
-      // Store is safe since [checkedFillValue] type has been checked as
-      // parameter and for null.
-      JS('', '#[#] = #', this, i, checkedFillValue);
-    }
-  }
-
-  void replaceRange(int start, int end, Iterable<E> replacement) {
-    checkGrowable('replaceRange');
-    RangeError.checkValidRange(start, end, this.length);
-    if (replacement is! EfficientLengthIterable) {
-      replacement = replacement.toList();
-    }
-    int removeLength = end - start;
-    int insertLength = replacement.length;
-    if (removeLength >= insertLength) {
-      int delta = removeLength - insertLength;
-      int insertEnd = start + insertLength;
-      int newLength = this.length - delta;
-      this.setRange(start, insertEnd, replacement);
-      if (delta != 0) {
-        this.setRange(insertEnd, newLength, this, end);
-        this.length = newLength;
-      }
-    } else {
-      int delta = insertLength - removeLength;
-      int newLength = this.length + delta;
-      int insertEnd = start + insertLength; // aka. end + delta.
-      this.length = newLength;
-      this.setRange(insertEnd, newLength, this, end);
-      this.setRange(start, insertEnd, replacement);
-    }
-  }
-
-  bool any(bool test(E element)) {
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      if (test(element)) return true;
-      if (this.length != end) throw new ConcurrentModificationError(this);
-    }
-    return false;
-  }
-
-  bool every(bool test(E element)) {
-    int end = this.length;
-    for (int i = 0; i < end; i++) {
-      // TODO(22407): Improve bounds check elimination to allow this JS code to
-      // be replaced by indexing.
-      var element = JS<E>('', '#[#]', this, i);
-      if (!test(element)) return false;
-      if (this.length != end) throw new ConcurrentModificationError(this);
-    }
-    return true;
-  }
-
-  Iterable<E> get reversed => new ReversedListIterable<E>(this);
-
-  void sort([int Function(E, E)? compare]) {
-    checkMutable('sort');
-    Sort.sort(this, compare ?? _compareAny);
-  }
-
-  static int _compareAny(a, b) {
-    return Comparable.compare(a, b);
-  }
-
-  void shuffle([Random? random]) {
-    checkMutable('shuffle');
-    if (random == null) random = new Random();
-    int length = this.length;
-    while (length > 1) {
-      int pos = random.nextInt(length);
-      length -= 1;
-      var tmp = this[length];
-      this[length] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  int indexOf(Object? element, [int start = 0]) {
-    int length = this.length;
-    if (start >= length) {
-      return -1;
-    }
-    if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < length; i++) {
-      if (this[i] == element) {
-        return i;
-      }
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Object? element, [int? startIndex]) {
-    int start = startIndex ?? this.length - 1;
-    if (start < 0) {
-      return -1;
-    }
-    if (start >= this.length) {
-      start = this.length - 1;
-    }
-    for (int i = start; i >= 0; i--) {
-      if (this[i] == element) {
-        return i;
-      }
-    }
-    return -1;
-  }
-
-  bool contains(Object? other) {
-    for (int i = 0; i < length; i++) {
-      E element = JS('', '#[#]', this, i);
-      if (element == other) return true;
-    }
-    return false;
-  }
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  String toString() => ListBase.listToString(this);
-
-  List<E> toList({bool growable: true}) =>
-      growable ? _toListGrowable() : _toListFixed();
-
-  List<E> _toListGrowable() =>
-      // slice(0) is slightly faster than slice()
-      new JSArray<E>.markGrowable(JS('', '#.slice(0)', this));
-
-  List<E> _toListFixed() =>
-      new JSArray<E>.markFixed(JS('', '#.slice(0)', this));
-
-  Set<E> toSet() => new Set<E>.from(this);
-
-  Iterator<E> get iterator => new ArrayIterator<E>(this);
-
-  int get hashCode => Primitives.objectHashCode(this);
-
-  int get length => JS('JSUInt32', r'#.length', this);
-
-  set length(int newLength) {
-    checkGrowable('set length');
-    if (newLength is! int) {
-      throw new ArgumentError.value(newLength, 'newLength');
-    }
-    // TODO(sra): Remove this test and let JavaScript throw an error.
-    if (newLength < 0) {
-      throw new RangeError.range(newLength, 0, null, 'newLength');
-    }
-    // JavaScript with throw a RangeError for numbers that are too big. The
-    // message does not contain the value.
-    JS('void', r'#.length = #', this, newLength);
-  }
-
-  E operator [](int index) {
-    if (index is! int) throw diagnoseIndexError(this, index);
-    if (index >= length || index < 0) throw diagnoseIndexError(this, index);
-    return JS('', '#[#]', this, index);
-  }
-
-  void operator []=(int index, E value) {
-    checkMutable('indexed set');
-    if (index is! int) throw diagnoseIndexError(this, index);
-    if (index >= length || index < 0) throw diagnoseIndexError(this, index);
-    JS('void', r'#[#] = #', this, index, value);
-  }
-
-  Map<int, E> asMap() {
-    return new ListMapView<E>(this);
-  }
-
-  Iterable<E> followedBy(Iterable<E> other) =>
-      new FollowedByIterable<E>.firstEfficient(this, other);
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  List<E> operator +(List<E> other) => [...this, ...other];
-
-  int indexWhere(bool test(E element), [int start = 0]) {
-    if (start >= this.length) return -1;
-    if (start < 0) start = 0;
-    for (int i = start; i < this.length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(E element), [int? start]) {
-    if (start == null) start = this.length - 1;
-    if (start < 0) return -1;
-    for (int i = start; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  void set first(E element) {
-    if (this.isEmpty) throw IterableElementError.noElement();
-    this[0] = element;
-  }
-
-  void set last(E element) {
-    if (this.isEmpty) throw IterableElementError.noElement();
-    this[this.length - 1] = element;
-  }
-}
-
-/// Dummy subclasses that allow the backend to track more precise
-/// information about arrays through their type. The CPA type inference
-/// relies on the fact that these classes do not override [] nor []=.
-///
-/// These classes are really a fiction, and can have no methods, since
-/// getInterceptor always returns JSArray.  We should consider pushing the
-/// 'isGrowable' and 'isMutable' checks into the getInterceptor implementation
-/// so these classes can have specialized implementations. Doing so will
-/// challenge many assumptions in the JS backend.
-class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable<E> {}
-
-class JSFixedArray<E> extends JSMutableArray<E> {}
-
-class JSExtendableArray<E> extends JSMutableArray<E> {}
-
-class JSUnmodifiableArray<E> extends JSArray<E> {} // Already is JSIndexable.
-
-/// An [Iterator] that iterates a JSArray.
-///
-class ArrayIterator<E> implements Iterator<E> {
-  final JSArray<E> _iterable;
-  final int _length;
-  int _index;
-  E? _current;
-
-  ArrayIterator(JSArray<E> iterable)
-      : _iterable = iterable,
-        _length = iterable.length,
-        _index = 0;
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    int length = _iterable.length;
-
-    // We have to do the length check even on fixed length Arrays.  If we can
-    // inline moveNext() we might be able to GVN the length and eliminate this
-    // check on known fixed length JSArray.
-    if (_length != length) {
-      throw throwConcurrentModificationError(_iterable);
-    }
-
-    if (_index >= length) {
-      _current = null;
-      return false;
-    }
-    _current = _iterable[_index];
-    _index++;
-    return true;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_helper.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_helper.dart
deleted file mode 100644
index 488f359..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_helper.dart
+++ /dev/null
@@ -1,3329 +0,0 @@
-// Copyright (c) 2013, 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.
-
-library _js_helper;
-
-import 'dart:_js_embedded_names'
-    show
-        ARRAY_RTI_PROPERTY,
-        CURRENT_SCRIPT,
-        DEFERRED_LIBRARY_PARTS,
-        DEFERRED_PART_URIS,
-        DEFERRED_PART_HASHES,
-        GET_TYPE_FROM_NAME,
-        GET_ISOLATE_TAG,
-        INITIALIZE_LOADED_HUNK,
-        INTERCEPTED_NAMES,
-        INTERCEPTORS_BY_TAG,
-        IS_HUNK_LOADED,
-        IS_HUNK_INITIALIZED,
-        JsBuiltin,
-        JsGetName,
-        LEAF_TAGS,
-        NATIVE_SUPERCLASS_TAG_NAME,
-        STATIC_FUNCTION_NAME_PROPERTY_NAME;
-
-import 'dart:collection';
-
-import 'dart:async' show Completer, DeferredLoadException, Future;
-
-import 'dart:_foreign_helper'
-    show
-        DART_CLOSURE_TO_JS,
-        getInterceptor,
-        JS,
-        JS_BUILTIN,
-        JS_CONST,
-        JS_EFFECT,
-        JS_EMBEDDED_GLOBAL,
-        JS_GET_FLAG,
-        JS_GET_NAME,
-        JS_INTERCEPTOR_CONSTANT,
-        JS_STRING_CONCAT,
-        RAW_DART_FUNCTION_REF;
-
-import 'dart:_interceptors';
-import 'dart:_internal' as _symbol_dev;
-import 'dart:_internal'
-    show
-        EfficientLengthIterable,
-        MappedIterable,
-        IterableElementError,
-        SubListIterable;
-
-import 'dart:_native_typed_data';
-
-import 'dart:_js_names'
-    show
-        extractKeys,
-        unmangleGlobalNameIfPreservedAnyways,
-        unmangleAllIdentifiersIfPreservedAnyways;
-
-import 'dart:_rti' as newRti
-    show
-        createRuntimeType,
-        evalInInstance,
-        getRuntimeType,
-        getTypeFromTypesTable,
-        instanceTypeName,
-        instantiatedGenericFunctionType;
-
-part 'annotations.dart';
-part 'constant_map.dart';
-part 'instantiation.dart';
-part 'native_helper.dart';
-part 'regexp_helper.dart';
-part 'string_helper.dart';
-part 'js_rti.dart';
-part 'linked_hash_map.dart';
-
-/// Marks the internal map in dart2js, so that internal libraries can is-check
-/// them.
-abstract class InternalMap {}
-
-/// Extracts the JavaScript-constructor name from the given isCheckProperty.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-String isCheckPropertyToJsConstructorName(String isCheckProperty) {
-  return JS_BUILTIN('returns:String;depends:none;effects:none',
-      JsBuiltin.isCheckPropertyToJsConstructorName, isCheckProperty);
-}
-
-/// Returns true if the given [type] is a function type object.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-bool isDartFunctionType(Object type) {
-  // Function type test is using the `in` operator which doesn't work on
-  // primitive types.
-  assert(!(type == null || type is num || type is String));
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none', JsBuiltin.isFunctionType, type);
-}
-
-/// Returns true if the given [type] is a FutureOr type object.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-bool isDartFutureOrType(Object type) {
-  // FutureOr test is using the `in` operator which doesn't work on primitive
-  // types.
-  assert(!(type == null || type is num || type is String));
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none', JsBuiltin.isFutureOrType, type);
-}
-
-@pragma('dart2js:tryInline')
-bool isDartVoidTypeRti(Object type) {
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none', JsBuiltin.isVoidType, type);
-}
-
-/// Retrieves the class name from type information stored on the constructor of
-/// [type].
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-String rawRtiToJsConstructorName(Object rti) {
-  return JS_BUILTIN('String', JsBuiltin.rawRtiToJsConstructorName, rti);
-}
-
-/// Given a raw constructor name, return the unminified name, if available,
-/// otherwise tag the name with `minified:`.
-String unminifyOrTag(String rawClassName) {
-  String? preserved = unmangleGlobalNameIfPreservedAnyways(rawClassName);
-  if (preserved != null) return preserved;
-  if (JS_GET_FLAG('MINIFIED')) return 'minified:${rawClassName}';
-  return rawClassName;
-}
-
-/// Returns the rti from the given [constructorName].
-// TODO(floitsch): make this a builtin.
-jsConstructorNameToRti(String constructorName) {
-  var getTypeFromName = JS_EMBEDDED_GLOBAL('', GET_TYPE_FROM_NAME);
-  return JS('', '#(#)', getTypeFromName, constructorName);
-}
-
-/// Returns the raw runtime type of the given object [o].
-///
-/// The argument [o] must be the interceptor for primitive types. If
-/// necessary run it through [getInterceptor] first.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-// TODO(floitsch): we should call getInterceptor ourselves, but currently
-//    getInterceptor is not GVNed.
-@pragma('dart2js:tryInline')
-Object getRawRuntimeType(Object o) {
-  return JS_BUILTIN('', JsBuiltin.rawRuntimeType, o);
-}
-
-/// Returns whether the given [type] is a subtype of [other].
-///
-/// The argument [other] is the name of the other type, as computed by
-/// [runtimeTypeToString].
-@pragma('dart2js:tryInline')
-bool builtinIsSubtype(type, String other) {
-  return JS_BUILTIN('returns:bool;effects:none;depends:none',
-      JsBuiltin.isSubtype, other, type);
-}
-
-/// Returns true if the given [type] is _the_ `Function` type.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-bool isDartFunctionTypeRti(Object type) {
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none',
-      JsBuiltin.isGivenTypeRti,
-      type,
-      JS_GET_NAME(JsGetName.FUNCTION_CLASS_TYPE_NAME));
-}
-
-/// Returns true if the given [type] is _the_ `Null` type.
-@pragma('dart2js:tryInline')
-bool isNullType(Object type) {
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none',
-      JsBuiltin.isGivenTypeRti,
-      type,
-      JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME));
-}
-
-/// Returns whether the given type is the dynamic type.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-bool isDartDynamicTypeRti(type) {
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none', JsBuiltin.isDynamicType, type);
-}
-
-@pragma('dart2js:tryInline')
-bool isDartJsInteropTypeArgumentRti(type) {
-  return JS_BUILTIN('returns:bool;effects:none;depends:none',
-      JsBuiltin.isJsInteropTypeArgument, type);
-}
-
-/// Returns whether the given type is _the_ Dart Object type.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-bool isDartObjectTypeRti(type) {
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none',
-      JsBuiltin.isGivenTypeRti,
-      type,
-      JS_GET_NAME(JsGetName.OBJECT_CLASS_TYPE_NAME));
-}
-
-/// Returns whether the given type is _the_ null type.
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-bool isNullTypeRti(type) {
-  return JS_BUILTIN(
-      'returns:bool;effects:none;depends:none',
-      JsBuiltin.isGivenTypeRti,
-      type,
-      JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME));
-}
-
-/// Returns the metadata of the given [index].
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-getMetadata(int index) {
-  return JS_BUILTIN(
-      'returns:var;effects:none;depends:none', JsBuiltin.getMetadata, index);
-}
-
-/// Returns the type of the given [index].
-// TODO(floitsch): move this to foreign_helper.dart or similar.
-@pragma('dart2js:tryInline')
-getType(int index) {
-  return JS_BUILTIN(
-      'returns:var;effects:none;depends:none', JsBuiltin.getType, index);
-}
-
-/// No-op method that is called to inform the compiler that preambles might
-/// be needed when executing the resulting JS file in a command-line
-/// JS engine.
-requiresPreamble() {}
-
-bool isJsIndexable(var object, var record) {
-  if (record != null) {
-    var result = dispatchRecordIndexability(record);
-    if (result != null) return result;
-  }
-  return object is JavaScriptIndexingBehavior;
-}
-
-String S(value) {
-  if (value is String) return value;
-  if (value is num) {
-    if (value != 0) {
-      // ""+x is faster than String(x) for integers on most browsers.
-      return JS('String', r'"" + (#)', value);
-    }
-  } else if (true == value) {
-    return 'true';
-  } else if (false == value) {
-    return 'false';
-  } else if (value == null) {
-    return 'null';
-  }
-  var res = value.toString();
-  if (res is! String) throw argumentErrorValue(value);
-  return res;
-}
-
-// Called from generated code.
-createInvocationMirror(
-    String name, internalName, kind, arguments, argumentNames, types) {
-  // TODO(sra): [types] (the number of type arguments) could be omitted in the
-  // generated stub code to save an argument. Then we would use `types ?? 0`.
-  return new JSInvocationMirror(
-      name, internalName, kind, arguments, argumentNames, types);
-}
-
-createUnmangledInvocationMirror(
-    Symbol symbol, internalName, kind, arguments, argumentNames, types) {
-  return new JSInvocationMirror(
-      symbol, internalName, kind, arguments, argumentNames, types);
-}
-
-void throwInvalidReflectionError(String memberName) {
-  throw new UnsupportedError("Can't use '$memberName' in reflection "
-      "because it is not included in a @MirrorsUsed annotation.");
-}
-
-/// Helper used to instrument calls when the compiler is invoked with
-/// `--experiment-call-instrumentation`.
-///
-/// By default, whenever a method is invoked for the first time, it prints an id
-/// and the method name to the console. This can be overriden by adding a top
-/// level `dartCallInstrumentation` hook in JavaScript.
-@pragma('dart2js:noInline')
-void traceHelper(dynamic /*int*/ id, dynamic /*String*/ qualifiedName) {
-  // Note: this method is written mostly in JavaScript to prevent a stack
-  // overflow. In particular, we use dynamic argument types because with with
-  // types, traceHelper would include type checks for the parameter types, those
-  // checks (intTypeCheck, stringTypeCheck) are themselves calls that end up
-  // invoking this traceHelper and produce a stack overflow.  Similarly if we
-  // had Dart code below using, for example, string interpolation, we would
-  // include extra calls to the Dart runtime that could also trigger a stack
-  // overflow. This approach here is simpler than making the compiler smart
-  // about how to generate traceHelper calls more carefully.
-  JS(
-      '',
-      r'''
-      (function (id, name) {
-        var hook = self.dartCallInstrumentation;
-        if (typeof hook === "function") {
-          hook(id, name);
-          return;
-        }
-        if (!this.callInstrumentationCache) {
-          this.callInstrumentationCache = Object.create(null);
-        }
-        if (!this.callInstrumentationCache[id]) {
-          console.log(id, name);
-          this.callInstrumentationCache[id] = true;
-        }
-      })(#, #)''',
-      id,
-      qualifiedName);
-}
-
-class JSInvocationMirror implements Invocation {
-  static const METHOD = 0;
-  static const GETTER = 1;
-  static const SETTER = 2;
-
-  /// When [_memberName] is a String, it holds the mangled name of this
-  /// invocation.  When it is a Symbol, it holds the unmangled name.
-  var /* String or Symbol */ _memberName;
-  final String _internalName;
-  final int _kind;
-  final List _arguments;
-  final List _namedArgumentNames;
-  final int _typeArgumentCount;
-
-  JSInvocationMirror(this._memberName, this._internalName, this._kind,
-      this._arguments, this._namedArgumentNames, this._typeArgumentCount);
-
-  Symbol get memberName {
-    if (_memberName is Symbol) return _memberName;
-    return _memberName = new _symbol_dev.Symbol.unvalidated(_memberName);
-  }
-
-  bool get isMethod => _kind == METHOD;
-  bool get isGetter => _kind == GETTER;
-  bool get isSetter => _kind == SETTER;
-  bool get isAccessor => _kind != METHOD;
-
-  List<Type> get typeArguments {
-    if (_typeArgumentCount == 0) return const <Type>[];
-    int start = _arguments.length - _typeArgumentCount;
-    var list = <Type>[];
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      for (int index = 0; index < _typeArgumentCount; index++) {
-        list.add(newRti.createRuntimeType(_arguments[start + index]));
-      }
-    } else {
-      for (int index = 0; index < _typeArgumentCount; index++) {
-        list.add(createRuntimeType(_arguments[start + index]));
-      }
-    }
-    return JSArray.markUnmodifiableList(list);
-  }
-
-  List get positionalArguments {
-    if (isGetter) return const [];
-    var argumentCount =
-        _arguments.length - _namedArgumentNames.length - _typeArgumentCount;
-    if (argumentCount == 0) return const [];
-    var list = [];
-    for (var index = 0; index < argumentCount; index++) {
-      list.add(_arguments[index]);
-    }
-    return JSArray.markUnmodifiableList(list);
-  }
-
-  Map<Symbol, dynamic> get namedArguments {
-    if (isAccessor) return const <Symbol, dynamic>{};
-    int namedArgumentCount = _namedArgumentNames.length;
-    int namedArgumentsStartIndex =
-        _arguments.length - namedArgumentCount - _typeArgumentCount;
-    if (namedArgumentCount == 0) return const <Symbol, dynamic>{};
-    var map = new Map<Symbol, dynamic>();
-    for (int i = 0; i < namedArgumentCount; i++) {
-      map[new _symbol_dev.Symbol.unvalidated(_namedArgumentNames[i])] =
-          _arguments[namedArgumentsStartIndex + i];
-    }
-    return new ConstantMapView<Symbol, dynamic>(map);
-  }
-}
-
-class Primitives {
-  static int objectHashCode(object) {
-    int? hash = JS('int|Null', r'#.$identityHash', object);
-    if (hash == null) {
-      hash = JS('int', '(Math.random() * 0x3fffffff) | 0');
-      JS('void', r'#.$identityHash = #', object, hash);
-    }
-    return JS('int', '#', hash);
-  }
-
-  static int? parseInt(String source, int? radix) {
-    checkString(source);
-    var re = JS('', r'/^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i');
-    var match = JS('JSExtendableArray|Null', '#.exec(#)', re, source);
-    int digitsIndex = 1;
-    int hexIndex = 2;
-    int decimalIndex = 3;
-    if (match == null) {
-      // TODO(sra): It might be that the match failed due to unrecognized U+0085
-      // spaces.  We could replace them with U+0020 spaces and try matching
-      // again.
-      return null;
-    }
-    Object? decimalMatch = match[decimalIndex];
-    if (radix == null) {
-      if (decimalMatch != null) {
-        // Cannot fail because we know that the digits are all decimal.
-        return JS('int', r'parseInt(#, 10)', source);
-      }
-      if (match[hexIndex] != null) {
-        // Cannot fail because we know that the digits are all hex.
-        return JS('int', r'parseInt(#, 16)', source);
-      }
-      return null;
-    }
-
-    if (radix is! int) {
-      throw new ArgumentError.value(radix, 'radix', 'is not an integer');
-    }
-    if (radix < 2 || radix > 36) {
-      throw new RangeError.range(radix, 2, 36, 'radix');
-    }
-    if (radix == 10 && decimalMatch != null) {
-      // Cannot fail because we know that the digits are all decimal.
-      return JS('int', r'parseInt(#, 10)', source);
-    }
-    // If radix >= 10 and we have only decimal digits the string is safe.
-    // Otherwise we need to check the digits.
-    if (radix < 10 || decimalMatch == null) {
-      // We know that the characters must be ASCII as otherwise the
-      // regexp wouldn't have matched. Lowercasing by doing `| 0x20` is thus
-      // guaranteed to be a safe operation, since it preserves digits
-      // and lower-cases ASCII letters.
-      int maxCharCode;
-      if (radix <= 10) {
-        // Allow all digits less than the radix. For example 0, 1, 2 for
-        // radix 3.
-        // "0".codeUnitAt(0) + radix - 1;
-        maxCharCode = (0x30 - 1) + radix;
-      } else {
-        // Letters are located after the digits in ASCII. Therefore we
-        // only check for the character code. The regexp above made already
-        // sure that the string does not contain anything but digits or
-        // letters.
-        // "a".codeUnitAt(0) + (radix - 10) - 1;
-        maxCharCode = (0x61 - 10 - 1) + radix;
-      }
-      assert(match[digitsIndex] is String);
-      String digitsPart = JS('String', '#[#]', match, digitsIndex);
-      for (int i = 0; i < digitsPart.length; i++) {
-        int characterCode = digitsPart.codeUnitAt(i) | 0x20;
-        if (characterCode > maxCharCode) {
-          return null;
-        }
-      }
-    }
-    // The above matching and checks ensures the source has at least one digits
-    // and all digits are suitable for the radix, so parseInt cannot return NaN.
-    return JS('int', r'parseInt(#, #)', source, radix);
-  }
-
-  static double? parseDouble(String source) {
-    checkString(source);
-    // Notice that JS parseFloat accepts garbage at the end of the string.
-    // Accept only:
-    // - [+/-]NaN
-    // - [+/-]Infinity
-    // - a Dart double literal
-    // We do allow leading or trailing whitespace.
-    if (!JS(
-        'bool',
-        r'/^\s*[+-]?(?:Infinity|NaN|'
-            r'(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(#)',
-        source)) {
-      return null;
-    }
-    var result = JS('num', r'parseFloat(#)', source);
-    if (result.isNaN) {
-      var trimmed = source.trim();
-      if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') {
-        return result;
-      }
-      return null;
-    }
-    return result;
-  }
-
-  /// [: r"$".codeUnitAt(0) :]
-  static const int DOLLAR_CHAR_VALUE = 36;
-
-  /// Creates a string containing the complete type for the class [className]
-  /// with the given type arguments.
-  ///
-  /// In minified mode, uses the unminified names if available.
-  ///
-  /// The given [className] string generally contains the name of the JavaScript
-  /// constructor of the given class.
-  static String formatType(String className, List typeArguments) {
-    return unmangleAllIdentifiersIfPreservedAnyways(
-        '$className${joinArguments(typeArguments, 0)}');
-  }
-
-  /// Returns the type of [object] as a string (including type arguments).
-  /// Tries to return a sensible name for non-Dart objects.
-  ///
-  /// In minified mode, uses the unminified names if available, otherwise tags
-  /// them with 'minified:'.
-  @pragma('dart2js:noInline')
-  static String objectTypeName(Object object) {
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      return _objectTypeNameNewRti(object);
-    }
-    String className = _objectClassName(object);
-    String arguments = joinArguments(getRuntimeTypeInfo(object), 0);
-    return '${className}${arguments}';
-  }
-
-  static String _objectClassName(Object object) {
-    var interceptor = getInterceptor(object);
-    // The interceptor is either an object (self-intercepting plain Dart class),
-    // the prototype of the constructor for an Interceptor class (like
-    // `JSString.prototype`, `JSNull.prototype`), or an Interceptor object
-    // instance (`const JSString()`, should use `JSString.prototype`).
-    //
-    // These all should have a `constructor` property with a `name` property.
-    String? name;
-    var interceptorConstructor = JS('', '#.constructor', interceptor);
-    if (JS('bool', 'typeof # == "function"', interceptorConstructor)) {
-      var interceptorConstructorName = JS('', '#.name', interceptorConstructor);
-      if (interceptorConstructorName is String) {
-        name = interceptorConstructorName;
-      }
-    }
-
-    if (name == null ||
-        identical(interceptor, JS_INTERCEPTOR_CONSTANT(Interceptor)) ||
-        object is UnknownJavaScriptObject) {
-      // Try to do better.  If we do not find something better, leave the name
-      // as 'UnknownJavaScriptObject' or 'Interceptor' (or the minified name).
-      //
-      // When we get here via the UnknownJavaScriptObject test (for JavaScript
-      // objects from outside the program), the object's constructor has a
-      // better name that 'UnknownJavaScriptObject'.
-      //
-      // When we get here the Interceptor test (for Native classes that are
-      // declared in the Dart program but have been 'folded' into Interceptor),
-      // the native class's constructor name is better than the generic
-      // 'Interceptor' (an abstract class).
-
-      // Try the [constructorNameFallback]. This gets the constructor name for
-      // any browser (used by [getNativeInterceptor]).
-      String dispatchName = constructorNameFallback(object);
-      name ??= dispatchName;
-      if (dispatchName == 'Object') {
-        // Try to decompile the constructor by turning it into a string and get
-        // the name out of that. If the decompiled name is a string containing
-        // an identifier, we use that instead of the very generic 'Object'.
-        var objectConstructor = JS('', '#.constructor', object);
-        if (JS('bool', 'typeof # == "function"', objectConstructor)) {
-          var match = JS('var', r'#.match(/^\s*function\s*([\w$]*)\s*\(/)',
-              JS('var', r'String(#)', objectConstructor));
-          var decompiledName = match == null ? null : JS('var', r'#[1]', match);
-          if (decompiledName is String &&
-              JS('bool', r'/^\w+$/.test(#)', decompiledName)) {
-            name = decompiledName;
-          }
-        }
-      }
-      return JS('String', '#', name);
-    }
-
-    // Type inference does not understand that [name] is now always a non-null
-    // String. (There is some imprecision in the negation of the disjunction.)
-    name = JS<String>('String', '#', name);
-
-    // TODO(kasperl): If the namer gave us a fresh global name, we may
-    // want to remove the numeric suffix that makes it unique too.
-    if (name.length > 1 && identical(name.codeUnitAt(0), DOLLAR_CHAR_VALUE)) {
-      name = name.substring(1);
-    }
-    return unminifyOrTag(name);
-  }
-
-  /// Returns the type of [object] as a string (including type arguments).
-  /// Tries to return a sensible name for non-Dart objects.
-  ///
-  /// In minified mode, uses the unminified names if available, otherwise tags
-  /// them with 'minified:'.
-  static String _objectTypeNameNewRti(Object object) {
-    var dartObjectConstructor = JS_BUILTIN(
-        'depends:none;effects:none;', JsBuiltin.dartObjectConstructor);
-    if (JS('bool', '# instanceof #', object, dartObjectConstructor)) {
-      return newRti.instanceTypeName(object);
-    }
-
-    var interceptor = getInterceptor(object);
-    if (identical(interceptor, JS_INTERCEPTOR_CONSTANT(Interceptor)) ||
-        object is UnknownJavaScriptObject) {
-      // Try to do better.  If we do not find something better, fallthrough to
-      // Dart-type based name that leave the name as 'UnknownJavaScriptObject'
-      // or 'Interceptor' (or the minified versions thereof).
-      //
-      // When we get here via the UnknownJavaScriptObject test (for JavaScript
-      // objects from outside the program), the object's constructor has a
-      // better name that 'UnknownJavaScriptObject'.
-      //
-      // When we get here the Interceptor test (for Native classes that are
-      // declared in the Dart program but have been 'folded' into Interceptor),
-      // the native class's constructor name is better than the generic
-      // 'Interceptor' (an abstract class).
-
-      // Try the [constructorNameFallback]. This gets the constructor name for
-      // any browser (used by [getNativeInterceptor]).
-      String dispatchName = constructorNameFallback(object);
-      if (_saneNativeClassName(dispatchName)) return dispatchName;
-      var constructor = JS('', '#.constructor', object);
-      if (JS('bool', 'typeof # == "function"', constructor)) {
-        var constructorName = JS('', '#.name', constructor);
-        if (constructorName is String &&
-            _saneNativeClassName(constructorName)) {
-          return constructorName;
-        }
-      }
-    }
-
-    return newRti.instanceTypeName(object);
-  }
-
-  static bool _saneNativeClassName(name) =>
-      name != null && name != 'Object' && name != '';
-
-  /// In minified mode, uses the unminified names if available.
-  static String objectToHumanReadableString(Object object) {
-    String name = objectTypeName(object);
-    return "Instance of '$name'";
-  }
-
-  static int dateNow() => JS('int', r'Date.now()');
-
-  static void initTicker() {
-    if (timerFrequency != 0) return;
-    // Start with low-resolution. We overwrite the fields if we find better.
-    timerFrequency = 1000;
-    if (JS('bool', 'typeof window == "undefined"')) return;
-    var window = JS('var', 'window');
-    if (window == null) return;
-    var performance = JS('var', '#.performance', window);
-    if (performance == null) return;
-    if (JS('bool', 'typeof #.now != "function"', performance)) return;
-    timerFrequency = 1000000;
-    timerTicks = () => (1000 * JS('num', '#.now()', performance)).floor();
-  }
-
-  static int timerFrequency = 0;
-  static int Function() timerTicks = dateNow; // Low-resolution version.
-
-  static String? currentUri() {
-    requiresPreamble();
-    // In a browser return self.location.href.
-    if (JS('bool', '!!self.location')) {
-      return JS('String', 'self.location.href');
-    }
-
-    return null;
-  }
-
-  /// Version of `String.fromCharCode.apply` that chunks the conversion to avoid
-  /// stack overflows due to very large argument arrays.
-  ///
-  /// [array] is pre-validated as a JSArray of int values but is not typed as
-  /// <int> so it can be called with any JSArray.
-  static String _fromCharCodeApply(List array) {
-    const kMaxApply = 500;
-    int end = array.length;
-    if (end <= kMaxApply) {
-      return JS('String', r'String.fromCharCode.apply(null, #)', array);
-    }
-    String result = '';
-    for (int i = 0; i < end; i += kMaxApply) {
-      int chunkEnd = (i + kMaxApply < end) ? i + kMaxApply : end;
-      result = JS(
-          'String',
-          r'# + String.fromCharCode.apply(null, #.slice(#, #))',
-          result,
-          array,
-          i,
-          chunkEnd);
-    }
-    return result;
-  }
-
-  static String stringFromCodePoints(codePoints) {
-    List<int> a = <int>[];
-    for (var i in codePoints) {
-      if (i is! int) throw argumentErrorValue(i);
-      if (i <= 0xffff) {
-        a.add(i);
-      } else if (i <= 0x10ffff) {
-        a.add(0xd800 + ((((i - 0x10000) >> 10) & 0x3ff)));
-        a.add(0xdc00 + (i & 0x3ff));
-      } else {
-        throw argumentErrorValue(i);
-      }
-    }
-    return _fromCharCodeApply(a);
-  }
-
-  static String stringFromCharCodes(charCodes) {
-    for (var i in charCodes) {
-      if (i is! int) throw argumentErrorValue(i);
-      if (i < 0) throw argumentErrorValue(i);
-      if (i > 0xffff) return stringFromCodePoints(charCodes);
-    }
-    return _fromCharCodeApply(charCodes);
-  }
-
-  // [start] and [end] are validated.
-  static String stringFromNativeUint8List(
-      NativeUint8List charCodes, int start, int end) {
-    const kMaxApply = 500;
-    if (end <= kMaxApply && start == 0 && end == charCodes.length) {
-      return JS('String', r'String.fromCharCode.apply(null, #)', charCodes);
-    }
-    String result = '';
-    for (int i = start; i < end; i += kMaxApply) {
-      int chunkEnd = (i + kMaxApply < end) ? i + kMaxApply : end;
-      result = JS(
-          'String',
-          r'# + String.fromCharCode.apply(null, #.subarray(#, #))',
-          result,
-          charCodes,
-          i,
-          chunkEnd);
-    }
-    return result;
-  }
-
-  static String stringFromCharCode(charCode) {
-    if (0 <= charCode) {
-      if (charCode <= 0xffff) {
-        return JS('returns:String;effects:none;depends:none',
-            'String.fromCharCode(#)', charCode);
-      }
-      if (charCode <= 0x10ffff) {
-        var bits = charCode - 0x10000;
-        var low = 0xDC00 | (bits & 0x3ff);
-        var high = 0xD800 | (bits >> 10);
-        return JS('returns:String;effects:none;depends:none',
-            'String.fromCharCode(#, #)', high, low);
-      }
-    }
-    throw new RangeError.range(charCode, 0, 0x10ffff);
-  }
-
-  static String stringConcatUnchecked(String string1, String string2) {
-    return JS_STRING_CONCAT(string1, string2);
-  }
-
-  static String flattenString(String str) {
-    return JS('returns:String;depends:none;effects:none;throws:never;gvn:true',
-        '#.charCodeAt(0) == 0 ? # : #', str, str, str);
-  }
-
-  static String getTimeZoneName(DateTime receiver) {
-    // Firefox and Chrome emit the timezone in parenthesis.
-    // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)".
-    // We extract this name using a regexp.
-    var d = lazyAsJsDate(receiver);
-    List? match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d);
-    if (match != null) return match[1];
-
-    // Internet Explorer 10+ emits the zone name without parenthesis:
-    // Example: Thu Oct 31 14:07:44 PDT 2013
-    match = JS(
-        'JSArray|Null',
-        // Thu followed by a space.
-        r'/^[A-Z,a-z]{3}\s'
-            // Oct 31 followed by space.
-            r'[A-Z,a-z]{3}\s\d+\s'
-            // Time followed by a space.
-            r'\d{2}:\d{2}:\d{2}\s'
-            // The time zone name followed by a space.
-            r'([A-Z]{3,5})\s'
-            // The year.
-            r'\d{4}$/'
-            '.exec(#.toString())',
-        d);
-    if (match != null) return match[1];
-
-    // IE 9 and Opera don't provide the zone name. We fall back to emitting the
-    // UTC/GMT offset.
-    // Example (IE9): Wed Nov 20 09:51:00 UTC+0100 2013
-    //       (Opera): Wed Nov 20 2013 11:03:38 GMT+0100
-    match = JS('JSArray|Null', r'/(?:GMT|UTC)[+-]\d{4}/.exec(#.toString())', d);
-    if (match != null) return match[0];
-    return '';
-  }
-
-  static int getTimeZoneOffsetInMinutes(DateTime receiver) {
-    // Note that JS and Dart disagree on the sign of the offset.
-    // Subtract to avoid -0.0
-    return 0 - JS('int', r'#.getTimezoneOffset()', lazyAsJsDate(receiver))
-        as int;
-  }
-
-  static int? valueFromDecomposedDate(
-      years, month, day, hours, minutes, seconds, milliseconds, isUtc) {
-    final int MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
-    checkInt(years);
-    checkInt(month);
-    checkInt(day);
-    checkInt(hours);
-    checkInt(minutes);
-    checkInt(seconds);
-    checkInt(milliseconds);
-    checkBool(isUtc);
-    var jsMonth = month - 1;
-    // The JavaScript Date constructor 'corrects' year NN to 19NN. Sidestep that
-    // correction by adjusting years out of that range and compensating with an
-    // adjustment of months. This hack should not be sensitive to leap years but
-    // use 400 just in case.
-    if (0 <= years && years < 100) {
-      years += 400;
-      jsMonth -= 400 * 12;
-    }
-    var value;
-    if (isUtc) {
-      value = JS('num', r'Date.UTC(#, #, #, #, #, #, #)', years, jsMonth, day,
-          hours, minutes, seconds, milliseconds);
-    } else {
-      value = JS('num', r'new Date(#, #, #, #, #, #, #).valueOf()', years,
-          jsMonth, day, hours, minutes, seconds, milliseconds);
-    }
-    if (value.isNaN ||
-        value < -MAX_MILLISECONDS_SINCE_EPOCH ||
-        value > MAX_MILLISECONDS_SINCE_EPOCH) {
-      return null;
-    }
-    return JS('int', '#', value);
-  }
-
-  // Lazily keep a JS Date stored in the JS object.
-  static lazyAsJsDate(DateTime receiver) {
-    if (JS('bool', r'#.date === (void 0)', receiver)) {
-      JS('void', r'#.date = new Date(#)', receiver,
-          receiver.millisecondsSinceEpoch);
-    }
-    return JS('var', r'#.date', receiver);
-  }
-
-  // The getters for date and time parts below add a positive integer to ensure
-  // that the result is really an integer, because the JavaScript implementation
-  // may return -0.0 instead of 0.
-  //
-  // They are marked as @pragma('dart2js:noThrows') because `receiver` comes from a receiver of
-  // a method on DateTime (i.e. is not `null`).
-
-  // TODO(sra): These methods are GVN-able. dart2js should implement an
-  // annotation for that.
-
-  // TODO(sra): These methods often occur in groups (e.g. day, month and
-  // year). Is it possible to factor them so that the `Date` is visible and can
-  // be GVN-ed without a lot of code bloat?
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getYear(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS('int', r'(#.getUTCFullYear() + 0)', lazyAsJsDate(receiver))
-        : JS('int', r'(#.getFullYear() + 0)', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getMonth(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS('JSUInt31', r'#.getUTCMonth() + 1', lazyAsJsDate(receiver))
-        : JS('JSUInt31', r'#.getMonth() + 1', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getDay(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS('JSUInt31', r'(#.getUTCDate() + 0)', lazyAsJsDate(receiver))
-        : JS('JSUInt31', r'(#.getDate() + 0)', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getHours(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS('JSUInt31', r'(#.getUTCHours() + 0)', lazyAsJsDate(receiver))
-        : JS('JSUInt31', r'(#.getHours() + 0)', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getMinutes(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS('JSUInt31', r'(#.getUTCMinutes() + 0)', lazyAsJsDate(receiver))
-        : JS('JSUInt31', r'(#.getMinutes() + 0)', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getSeconds(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS('JSUInt31', r'(#.getUTCSeconds() + 0)', lazyAsJsDate(receiver))
-        : JS('JSUInt31', r'(#.getSeconds() + 0)', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getMilliseconds(DateTime receiver) {
-    return (receiver.isUtc)
-        ? JS(
-            'JSUInt31', r'(#.getUTCMilliseconds() + 0)', lazyAsJsDate(receiver))
-        : JS('JSUInt31', r'(#.getMilliseconds() + 0)', lazyAsJsDate(receiver));
-  }
-
-  @pragma('dart2js:noSideEffects')
-  @pragma('dart2js:noThrows')
-  @pragma('dart2js:noInline')
-  static getWeekday(DateTime receiver) {
-    int weekday = (receiver.isUtc)
-        ? JS('int', r'#.getUTCDay() + 0', lazyAsJsDate(receiver))
-        : JS('int', r'#.getDay() + 0', lazyAsJsDate(receiver));
-    // Adjust by one because JS weeks start on Sunday.
-    return (weekday + 6) % 7 + 1;
-  }
-
-  static valueFromDateString(str) {
-    if (str is! String) throw argumentErrorValue(str);
-    var value = JS('num', r'Date.parse(#)', str);
-    if (value.isNaN) throw argumentErrorValue(str);
-    return value;
-  }
-
-  static getProperty(object, key) {
-    if (object == null || object is bool || object is num || object is String) {
-      throw argumentErrorValue(object);
-    }
-    return JS('var', '#[#]', object, key);
-  }
-
-  static void setProperty(object, key, value) {
-    if (object == null || object is bool || object is num || object is String) {
-      throw argumentErrorValue(object);
-    }
-    JS('void', '#[#] = #', object, key, value);
-  }
-
-  static functionNoSuchMethod(function, List? positionalArguments,
-      Map<String, dynamic>? namedArguments) {
-    int argumentCount = 0;
-    List arguments = [];
-    List namedArgumentList = [];
-
-    if (positionalArguments != null) {
-      argumentCount += positionalArguments.length;
-      arguments.addAll(positionalArguments);
-    }
-
-    String names = '';
-    if (namedArguments != null && !namedArguments.isEmpty) {
-      namedArguments.forEach((String name, argument) {
-        names = '$names\$$name';
-        namedArgumentList.add(name);
-        arguments.add(argument);
-        argumentCount++;
-      });
-    }
-
-    String selectorName =
-        '${JS_GET_NAME(JsGetName.CALL_PREFIX)}\$$argumentCount$names';
-
-    return function.noSuchMethod(createUnmangledInvocationMirror(
-        #call,
-        selectorName,
-        JSInvocationMirror.METHOD,
-        arguments,
-        namedArgumentList,
-        0));
-  }
-
-  /// Implements [Function.apply] for the lazy and startup emitters.
-  ///
-  /// There are two types of closures that can reach this function:
-  ///
-  /// 1. tear-offs (including tear-offs of static functions).
-  /// 2. anonymous closures.
-  ///
-  /// They are treated differently (although there are lots of similarities).
-  /// Both have in common that they have
-  /// a [JsGetName.CALL_CATCH_ALL] and
-  /// a [JsGetName.REQUIRED_PARAMETER_PROPERTY] property.
-  ///
-  /// If the closure supports optional parameters, then they also feature
-  /// a [JsGetName.DEFAULT_VALUES_PROPERTY] property.
-  ///
-  /// The catch-all property is a method that takes all arguments (including
-  /// all optional positional or named arguments). If the function accepts
-  /// optional arguments, then the default-values property stores (potentially
-  /// wrapped in a function) the default values for the optional arguments. If
-  /// the function accepts optional positional arguments, then the value is a
-  /// JavaScript array with the default values. Otherwise, when the function
-  /// accepts optional named arguments, it is a JavaScript object.
-  ///
-  /// The default-values property may either contain the value directly, or
-  /// it can be a function that returns the default-values when invoked.
-  ///
-  /// If the function is an anonymous closure, then the catch-all property
-  /// only contains a string pointing to the property that should be used
-  /// instead. For example, if the catch-all property contains the string
-  /// "call$4", then the object's "call$4" property should be used as if it was
-  /// the value of the catch-all property.
-  static applyFunction(Function function, List? positionalArguments,
-      Map<String, dynamic>? namedArguments) {
-    // Fast shortcut for the common case.
-    if (JS('bool', '# instanceof Array', positionalArguments) &&
-        (namedArguments == null || namedArguments.isEmpty)) {
-      // Let the compiler know that we did a type-test.
-      List arguments = (JS('JSArray', '#', positionalArguments));
-      int argumentCount = arguments.length;
-      if (argumentCount == 0) {
-        String selectorName = JS_GET_NAME(JsGetName.CALL_PREFIX0);
-        if (JS('bool', '!!#[#]', function, selectorName)) {
-          return JS('', '#[#]()', function, selectorName);
-        }
-      } else if (argumentCount == 1) {
-        String selectorName = JS_GET_NAME(JsGetName.CALL_PREFIX1);
-        if (JS('bool', '!!#[#]', function, selectorName)) {
-          return JS('', '#[#](#[0])', function, selectorName, arguments);
-        }
-      } else if (argumentCount == 2) {
-        String selectorName = JS_GET_NAME(JsGetName.CALL_PREFIX2);
-        if (JS('bool', '!!#[#]', function, selectorName)) {
-          return JS('', '#[#](#[0],#[1])', function, selectorName, arguments,
-              arguments);
-        }
-      } else if (argumentCount == 3) {
-        String selectorName = JS_GET_NAME(JsGetName.CALL_PREFIX3);
-        if (JS('bool', '!!#[#]', function, selectorName)) {
-          return JS('', '#[#](#[0],#[1],#[2])', function, selectorName,
-              arguments, arguments, arguments);
-        }
-      } else if (argumentCount == 4) {
-        String selectorName = JS_GET_NAME(JsGetName.CALL_PREFIX4);
-        if (JS('bool', '!!#[#]', function, selectorName)) {
-          return JS('', '#[#](#[0],#[1],#[2],#[3])', function, selectorName,
-              arguments, arguments, arguments, arguments);
-        }
-      } else if (argumentCount == 5) {
-        String selectorName = JS_GET_NAME(JsGetName.CALL_PREFIX5);
-        if (JS('bool', '!!#[#]', function, selectorName)) {
-          return JS(
-              '',
-              '#[#](#[0],#[1],#[2],#[3],#[4])',
-              function,
-              selectorName,
-              arguments,
-              arguments,
-              arguments,
-              arguments,
-              arguments);
-        }
-      }
-      String selectorName =
-          '${JS_GET_NAME(JsGetName.CALL_PREFIX)}\$$argumentCount';
-      var jsStub = JS('var', r'#[#]', function, selectorName);
-      if (jsStub != null) {
-        return JS('var', '#.apply(#, #)', jsStub, function, arguments);
-      }
-    }
-
-    return _genericApplyFunction2(
-        function, positionalArguments, namedArguments);
-  }
-
-  static _genericApplyFunction2(Function function, List? positionalArguments,
-      Map<String, dynamic>? namedArguments) {
-    List arguments;
-    if (positionalArguments != null) {
-      if (JS('bool', '# instanceof Array', positionalArguments)) {
-        arguments = JS('JSArray', '#', positionalArguments);
-      } else {
-        arguments = new List.from(positionalArguments);
-      }
-    } else {
-      arguments = [];
-    }
-
-    int argumentCount = arguments.length;
-
-    int requiredParameterCount = JS('int', r'#[#]', function,
-        JS_GET_NAME(JsGetName.REQUIRED_PARAMETER_PROPERTY));
-
-    if (argumentCount < requiredParameterCount) {
-      return functionNoSuchMethod(function, arguments, namedArguments);
-    }
-
-    var defaultValuesClosure = JS('var', r'#[#]', function,
-        JS_GET_NAME(JsGetName.DEFAULT_VALUES_PROPERTY));
-
-    bool acceptsOptionalArguments = defaultValuesClosure != null;
-
-    // Default values are stored inside a JavaScript closure to avoid
-    // accessing them too early.
-    var defaultValues =
-        acceptsOptionalArguments ? JS('', '#()', defaultValuesClosure) : null;
-
-    var interceptor = getInterceptor(function);
-    var jsFunction =
-        JS('', '#[#]', interceptor, JS_GET_NAME(JsGetName.CALL_CATCH_ALL));
-    if (jsFunction is String) {
-      // Anonymous closures redirect to the catch-all property instead of
-      // storing the catch-all method directly in the catch-all property.
-      jsFunction = JS('', '#[#]', interceptor, jsFunction);
-    }
-
-    if (!acceptsOptionalArguments) {
-      if (namedArguments != null && namedArguments.isNotEmpty) {
-        // Tried to invoke a function that takes a fixed number of arguments
-        // with named (optional) arguments.
-        return functionNoSuchMethod(function, arguments, namedArguments);
-      }
-      if (argumentCount == requiredParameterCount) {
-        return JS('var', r'#.apply(#, #)', jsFunction, function, arguments);
-      }
-      return functionNoSuchMethod(function, arguments, namedArguments);
-    }
-
-    bool acceptsPositionalArguments =
-        JS('bool', '# instanceof Array', defaultValues);
-
-    if (acceptsPositionalArguments) {
-      if (namedArguments != null && namedArguments.isNotEmpty) {
-        // Tried to invoke a function that takes optional positional arguments
-        // with named arguments.
-        return functionNoSuchMethod(function, arguments, namedArguments);
-      }
-
-      int defaultsLength = JS('int', '#.length', defaultValues);
-      int maxArguments = requiredParameterCount + defaultsLength;
-      if (argumentCount > maxArguments) {
-        // The function expects fewer arguments.
-        return functionNoSuchMethod(function, arguments, null);
-      }
-      List missingDefaults = JS('JSArray', '#.slice(#)', defaultValues,
-          argumentCount - requiredParameterCount);
-      arguments.addAll(missingDefaults);
-      return JS('var', '#.apply(#, #)', jsFunction, function, arguments);
-    } else {
-      // Handle named arguments.
-
-      if (argumentCount > requiredParameterCount) {
-        // Tried to invoke a function that takes named parameters with
-        // too many positional arguments.
-        return functionNoSuchMethod(function, arguments, namedArguments);
-      }
-
-      List keys = JS('JSArray', r'Object.keys(#)', defaultValues);
-      if (namedArguments == null) {
-        for (String key in keys) {
-          var defaultValue = JS('var', '#[#]', defaultValues, key);
-          if (isRequired(defaultValue)) {
-            return functionNoSuchMethod(function, arguments, namedArguments);
-          }
-          arguments.add(defaultValue);
-        }
-      } else {
-        int used = 0;
-        for (String key in keys) {
-          if (namedArguments.containsKey(key)) {
-            used++;
-            arguments.add(namedArguments[key]);
-          } else {
-            var defaultValue = JS('var', '#[#]', defaultValues, key);
-            if (isRequired(defaultValue)) {
-              return functionNoSuchMethod(function, arguments, namedArguments);
-            }
-            arguments.add(defaultValue);
-          }
-        }
-        if (used != namedArguments.length) {
-          return functionNoSuchMethod(function, arguments, namedArguments);
-        }
-      }
-      return JS('var', r'#.apply(#, #)', jsFunction, function, arguments);
-    }
-  }
-
-  static StackTrace extractStackTrace(Error error) {
-    return getTraceFromException(JS('', r'#.$thrownJsError', error));
-  }
-}
-
-/// Helper class for allocating and using JS object literals as caches.
-class JsCache {
-  /// Returns a JavaScript object suitable for use as a cache.
-  static allocate() {
-    var result = JS('=Object', 'Object.create(null)');
-    // Deleting a property makes V8 assume that it shouldn't create a hidden
-    // class for [result] and map transitions. Although these map transitions
-    // pay off if there are many cache hits for the same keys, it becomes
-    // really slow when there aren't many repeated hits.
-    JS('void', '#.x=0', result);
-    JS('void', 'delete #.x', result);
-    return result;
-  }
-
-  static fetch(cache, String key) {
-    return JS('', '#[#]', cache, key);
-  }
-
-  static void update(cache, String key, value) {
-    JS('void', '#[#] = #', cache, key, value);
-  }
-}
-
-/// Called by generated code to throw an illegal-argument exception,
-/// for example, if a non-integer index is given to an optimized
-/// indexed access.
-@pragma('dart2js:noInline')
-iae(argument) {
-  throw argumentErrorValue(argument);
-}
-
-/// Called by generated code to throw an index-out-of-range exception, for
-/// example, if a bounds check fails in an optimized indexed access.  This may
-/// also be called when the index is not an integer, in which case it throws an
-/// illegal-argument exception instead, like [iae], or when the receiver is
-/// null.
-@pragma('dart2js:noInline')
-ioore(receiver, index) {
-  if (receiver == null) receiver.length; // Force a NoSuchMethodError.
-  throw diagnoseIndexError(receiver, index);
-}
-
-/// Diagnoses an indexing error. Returns the ArgumentError or RangeError that
-/// describes the problem.
-@pragma('dart2js:noInline')
-Error diagnoseIndexError(indexable, index) {
-  if (index is! int) return new ArgumentError.value(index, 'index');
-  int length = indexable.length;
-  // The following returns the same error that would be thrown by calling
-  // [RangeError.checkValidIndex] with no optional parameters provided.
-  if (index < 0 || index >= length) {
-    return new RangeError.index(index, indexable, 'index', null, length);
-  }
-  // The above should always match, but if it does not, use the following.
-  return new RangeError.value(index, 'index');
-}
-
-/// Diagnoses a range error. Returns the ArgumentError or RangeError that
-/// describes the problem.
-@pragma('dart2js:noInline')
-Error diagnoseRangeError(start, end, length) {
-  if (start is! int) {
-    return new ArgumentError.value(start, 'start');
-  }
-  if (start < 0 || start > length) {
-    return new RangeError.range(start, 0, length, 'start');
-  }
-  if (end != null) {
-    if (end is! int) {
-      return new ArgumentError.value(end, 'end');
-    }
-    if (end < start || end > length) {
-      return new RangeError.range(end, start, length, 'end');
-    }
-  }
-  // The above should always match, but if it does not, use the following.
-  return new ArgumentError.value(end, 'end');
-}
-
-stringLastIndexOfUnchecked(receiver, element, start) =>
-    JS('int', r'#.lastIndexOf(#, #)', receiver, element, start);
-
-/// 'factory' for constructing ArgumentError.value to keep the call sites small.
-@pragma('dart2js:noInline')
-ArgumentError argumentErrorValue(object) {
-  return new ArgumentError.value(object);
-}
-
-checkNull(object) {
-  if (object == null) throw argumentErrorValue(object);
-  return object;
-}
-
-@pragma('dart2js:noInline')
-num checkNum(value) {
-  if (value is! num) throw argumentErrorValue(value);
-  return value;
-}
-
-int checkInt(value) {
-  if (value is! int) throw argumentErrorValue(value);
-  return value;
-}
-
-bool checkBool(value) {
-  if (value is! bool) throw argumentErrorValue(value);
-  return value;
-}
-
-String checkString(value) {
-  if (value is! String) throw argumentErrorValue(value);
-  return value;
-}
-
-/// Wrap the given Dart object and record a stack trace.
-///
-/// The code in [unwrapException] deals with getting the original Dart
-/// object out of the wrapper again.
-@pragma('dart2js:noInline')
-wrapException(ex) {
-  if (ex == null) ex = new NullThrownError();
-  var wrapper = JS('', 'new Error()');
-  // [unwrapException] looks for the property 'dartException'.
-  JS('void', '#.dartException = #', wrapper, ex);
-
-  if (JS('bool', '"defineProperty" in Object')) {
-    // Define a JavaScript getter for 'message'. This is to work around V8 bug
-    // (https://code.google.com/p/v8/issues/detail?id=2519).  The default
-    // toString on Error returns the value of 'message' if 'name' is
-    // empty. Setting toString directly doesn't work, see the bug.
-    JS('void', 'Object.defineProperty(#, "message", { get: # })', wrapper,
-        DART_CLOSURE_TO_JS(toStringWrapper));
-    JS('void', '#.name = ""', wrapper);
-  } else {
-    // In the unlikely event the browser doesn't support Object.defineProperty,
-    // hope that it just calls toString.
-    JS('void', '#.toString = #', wrapper, DART_CLOSURE_TO_JS(toStringWrapper));
-  }
-
-  return wrapper;
-}
-
-/// Do not call directly.
-toStringWrapper() {
-  // This method gets installed as toString on a JavaScript object. Due to the
-  // weird scope rules of JavaScript, JS 'this' will refer to that object.
-  return JS('', r'this.dartException').toString();
-}
-
-/// This wraps the exception and does the throw.  It is possible to call this in
-/// a JS expression context, where the throw statement is not allowed.  Helpers
-/// are never inlined, so we don't risk inlining the throw statement into an
-/// expression context.
-throwExpression(ex) {
-  JS('void', 'throw #', wrapException(ex));
-}
-
-throwRuntimeError(message) {
-  throw new RuntimeError(message);
-}
-
-throwUnsupportedError(message) {
-  throw new UnsupportedError(message);
-}
-
-throwAbstractClassInstantiationError(className) {
-  throw new AbstractClassInstantiationError(className);
-}
-
-// This is used in open coded for-in loops on arrays.
-//
-//     checkConcurrentModificationError(a.length == startLength, a)
-//
-// is replaced in codegen by:
-//
-//     a.length == startLength || throwConcurrentModificationError(a)
-//
-// TODO(sra): We would like to annotate this as @pragma('dart2js:noSideEffects') so that loops
-// with no other effects can recognize that the array length does not
-// change. However, in the usual case where the loop does have other effects,
-// that causes the length in the loop condition to be phi(startLength,a.length),
-// which causes confusion in range analysis and the insertion of a bounds check.
-@pragma('dart2js:noInline')
-checkConcurrentModificationError(sameLength, collection) {
-  if (true != sameLength) {
-    throwConcurrentModificationError(collection);
-  }
-}
-
-@pragma('dart2js:noInline')
-throwConcurrentModificationError(collection) {
-  throw new ConcurrentModificationError(collection);
-}
-
-/// Helper class for building patterns recognizing native type errors.
-class TypeErrorDecoder {
-  // Field names are private to help tree-shaking.
-
-  /// A regular expression which matches is matched against an error message.
-  final String _pattern;
-
-  /// The group index of "arguments" in [_pattern], or -1 if _pattern has no
-  /// match for "arguments".
-  final int _arguments;
-
-  /// The group index of "argumentsExpr" in [_pattern], or -1 if _pattern has
-  /// no match for "argumentsExpr".
-  final int _argumentsExpr;
-
-  /// The group index of "expr" in [_pattern], or -1 if _pattern has no match
-  /// for "expr".
-  final int _expr;
-
-  /// The group index of "method" in [_pattern], or -1 if _pattern has no match
-  /// for "method".
-  final int _method;
-
-  /// The group index of "receiver" in [_pattern], or -1 if _pattern has no
-  /// match for "receiver".
-  final int _receiver;
-
-  /// Pattern used to recognize a NoSuchMethodError error (and
-  /// possibly extract the method name).
-  static final TypeErrorDecoder noSuchMethodPattern =
-      extractPattern(provokeCallErrorOn(buildJavaScriptObject()));
-
-  /// Pattern used to recognize an "object not a closure" error (and
-  /// possibly extract the method name).
-  static final TypeErrorDecoder notClosurePattern =
-      extractPattern(provokeCallErrorOn(buildJavaScriptObjectWithNonClosure()));
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript null
-  /// call.
-  static final TypeErrorDecoder nullCallPattern =
-      extractPattern(provokeCallErrorOn(JS('', 'null')));
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript literal null
-  /// call.
-  static final TypeErrorDecoder nullLiteralCallPattern =
-      extractPattern(provokeCallErrorOnNull());
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript
-  /// undefined call.
-  static final TypeErrorDecoder undefinedCallPattern =
-      extractPattern(provokeCallErrorOn(JS('', 'void 0')));
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript literal
-  /// undefined call.
-  static final TypeErrorDecoder undefinedLiteralCallPattern =
-      extractPattern(provokeCallErrorOnUndefined());
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript null
-  /// property access.
-  static final TypeErrorDecoder nullPropertyPattern =
-      extractPattern(provokePropertyErrorOn(JS('', 'null')));
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript literal null
-  /// property access.
-  static final TypeErrorDecoder nullLiteralPropertyPattern =
-      extractPattern(provokePropertyErrorOnNull());
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript
-  /// undefined property access.
-  static final TypeErrorDecoder undefinedPropertyPattern =
-      extractPattern(provokePropertyErrorOn(JS('', 'void 0')));
-
-  /// Pattern used to recognize a NoSuchMethodError on JavaScript literal
-  /// undefined property access.
-  static final TypeErrorDecoder undefinedLiteralPropertyPattern =
-      extractPattern(provokePropertyErrorOnUndefined());
-
-  TypeErrorDecoder(this._arguments, this._argumentsExpr, this._expr,
-      this._method, this._receiver, this._pattern);
-
-  /// Returns a JavaScript object literal (map) with at most the
-  /// following keys:
-  ///
-  /// * arguments: The arguments as formatted by the JavaScript
-  ///   engine. No browsers are known to provide this information.
-  ///
-  /// * argumentsExpr: The syntax of the arguments (JavaScript source
-  ///   code). No browsers are known to provide this information.
-  ///
-  /// * expr: The syntax of the receiver expression (JavaScript source
-  ///   code). Firefox provides this information, for example: "$expr$.$method$
-  ///   is not a function".
-  ///
-  /// * method: The name of the called method (mangled name). At least Firefox
-  ///   and Chrome/V8 provides this information, for example, "Object [object
-  ///   Object] has no method '$method$'".
-  ///
-  /// * receiver: The string representation of the receiver. Chrome/V8
-  ///   used to provide this information (by calling user-defined
-  ///   JavaScript toString on receiver), but it has degenerated into
-  ///   "[object Object]" in recent versions.
-  matchTypeError(message) {
-    var match = JS(
-        'JSExtendableArray|Null', 'new RegExp(#).exec(#)', _pattern, message);
-    if (match == null) return null;
-    var result = JS('', 'Object.create(null)');
-    if (_arguments != -1) {
-      JS('', '#.arguments = #[# + 1]', result, match, _arguments);
-    }
-    if (_argumentsExpr != -1) {
-      JS('', '#.argumentsExpr = #[# + 1]', result, match, _argumentsExpr);
-    }
-    if (_expr != -1) {
-      JS('', '#.expr = #[# + 1]', result, match, _expr);
-    }
-    if (_method != -1) {
-      JS('', '#.method = #[# + 1]', result, match, _method);
-    }
-    if (_receiver != -1) {
-      JS('', '#.receiver = #[# + 1]', result, match, _receiver);
-    }
-
-    return result;
-  }
-
-  /// Builds a JavaScript Object with a toString method saying
-  /// r"$receiver$".
-  static buildJavaScriptObject() {
-    return JS('', r'{ toString: function() { return "$receiver$"; } }');
-  }
-
-  /// Builds a JavaScript Object with a toString method saying
-  /// r"$receiver$". The property "$method" is defined, but is not a function.
-  static buildJavaScriptObjectWithNonClosure() {
-    return JS(
-        '',
-        r'{ $method$: null, '
-            r'toString: function() { return "$receiver$"; } }');
-  }
-
-  /// Extract a pattern from a JavaScript TypeError message.
-  ///
-  /// The patterns are extracted by forcing TypeErrors on known
-  /// objects thus forcing known strings into the error message. The
-  /// known strings are then replaced with wildcards which in theory
-  /// makes it possible to recognize the desired information even if
-  /// the error messages are reworded or translated.
-  static extractPattern(String message) {
-    // Some JavaScript implementations (V8 at least) include a
-    // representation of the receiver in the error message, however,
-    // this representation is not always [: receiver.toString() :],
-    // sometimes it is [: Object.prototype.toString(receiver) :], and
-    // sometimes it is an implementation specific method (but that
-    // doesn't seem to happen for object literals). So sometimes we
-    // get the text "[object Object]". The shortest way to get that
-    // string is using "String({})".
-    // See: http://code.google.com/p/v8/issues/detail?id=2519.
-    message = JS('String', r"#.replace(String({}), '$receiver$')", message);
-
-    // Since we want to create a new regular expression from an unknown string,
-    // we must escape all regular expression syntax.
-    message = quoteStringForRegExp(message);
-
-    // Look for the special pattern \$camelCase\$ (all the $ symbols
-    // have been escaped already), as we will soon be inserting
-    // regular expression syntax that we want interpreted by RegExp.
-    List<String>? match =
-        JS('JSExtendableArray|Null', r'#.match(/\\\$[a-zA-Z]+\\\$/g)', message);
-    if (match == null) match = [];
-
-    // Find the positions within the substring matches of the error message
-    // components.  This will help us extract information later, such as the
-    // method name.
-    int arguments = JS('int', '#.indexOf(#)', match, r'\$arguments\$');
-    int argumentsExpr = JS('int', '#.indexOf(#)', match, r'\$argumentsExpr\$');
-    int expr = JS('int', '#.indexOf(#)', match, r'\$expr\$');
-    int method = JS('int', '#.indexOf(#)', match, r'\$method\$');
-    int receiver = JS('int', '#.indexOf(#)', match, r'\$receiver\$');
-
-    // Replace the patterns with a regular expression wildcard.
-    // Note: in a perfect world, one would use "(.*)", but not in
-    // JavaScript, "." does not match newlines.
-    String pattern = JS(
-        'String',
-        r"#.replace(new RegExp('\\\\\\$arguments\\\\\\$', 'g'), "
-            r"'((?:x|[^x])*)')"
-            r".replace(new RegExp('\\\\\\$argumentsExpr\\\\\\$', 'g'),  "
-            r"'((?:x|[^x])*)')"
-            r".replace(new RegExp('\\\\\\$expr\\\\\\$', 'g'),  '((?:x|[^x])*)')"
-            r".replace(new RegExp('\\\\\\$method\\\\\\$', 'g'),  '((?:x|[^x])*)')"
-            r".replace(new RegExp('\\\\\\$receiver\\\\\\$', 'g'),  "
-            r"'((?:x|[^x])*)')",
-        message);
-
-    return new TypeErrorDecoder(
-        arguments, argumentsExpr, expr, method, receiver, pattern);
-  }
-
-  /// Provokes a TypeError and returns its message.
-  ///
-  /// The error is provoked so all known variable content can be recognized and
-  /// a pattern can be inferred.
-  static String provokeCallErrorOn(expression) {
-    // This function is carefully created to maximize the possibility
-    // of decoding the TypeError message and turning it into a general
-    // pattern.
-    //
-    // The idea is to inject something known into something unknown.  The
-    // unknown entity is the error message that the browser provides with a
-    // TypeError.  It is a human readable message, possibly localized in a
-    // language no dart2js engineer understand.  We assume that $name$ would
-    // never naturally occur in a human readable error message, yet it is easy
-    // to decode.
-    //
-    // For example, evaluate this in V8 version 3.13.7.6:
-    //
-    // var $expr$ = null; $expr$.$method$()
-    //
-    // The VM throws an instance of TypeError whose message property contains
-    // "Cannot call method '$method$' of null".  We can then reasonably assume
-    // that if the string contains $method$, that's where the method name will
-    // be in general.  Call this automatically reverse engineering the error
-    // format string in V8.
-    //
-    // So the error message from V8 is turned into this regular expression:
-    //
-    // "Cannot call method '(.*)' of null"
-    //
-    // Similarly, if we evaluate:
-    //
-    // var $expr$ = {toString: function() { return '$receiver$'; }};
-    // $expr$.$method$()
-    //
-    // We get this message: "Object $receiver$ has no method '$method$'"
-    //
-    // Which is turned into this regular expression:
-    //
-    // "Object (.*) has no method '(.*)'"
-    //
-    // Firefox/jsshell is slightly different, it tries to include the source
-    // code that caused the exception, so we get this message: "$expr$.$method$
-    // is not a function" which is turned into this regular expression:
-    //
-    // "(.*)\\.(.*) is not a function"
-
-    var function = JS('', r"""function($expr$) {
-  var $argumentsExpr$ = '$arguments$';
-  try {
-    $expr$.$method$($argumentsExpr$);
-  } catch (e) {
-    return e.message;
-  }
-}""");
-    return JS('String', '(#)(#)', function, expression);
-  }
-
-  /// Similar to [provokeCallErrorOn], but provokes an error directly on
-  /// literal "null" expression.
-  static String provokeCallErrorOnNull() {
-    // See [provokeCallErrorOn] for a detailed explanation.
-    var function = JS('', r"""function() {
-  var $argumentsExpr$ = '$arguments$';
-  try {
-    null.$method$($argumentsExpr$);
-  } catch (e) {
-    return e.message;
-  }
-}""");
-    return JS('String', '(#)()', function);
-  }
-
-  /// Similar to [provokeCallErrorOnNull], but provokes an error directly on
-  /// (void 0), that is, "undefined".
-  static String provokeCallErrorOnUndefined() {
-    // See [provokeCallErrorOn] for a detailed explanation.
-    var function = JS('', r"""function() {
-  var $argumentsExpr$ = '$arguments$';
-  try {
-    (void 0).$method$($argumentsExpr$);
-  } catch (e) {
-    return e.message;
-  }
-}""");
-    return JS('String', '(#)()', function);
-  }
-
-  /// Similar to [provokeCallErrorOn], but provokes a property access
-  /// error.
-  static String provokePropertyErrorOn(expression) {
-    // See [provokeCallErrorOn] for a detailed explanation.
-    var function = JS('', r"""function($expr$) {
-  try {
-    $expr$.$method$;
-  } catch (e) {
-    return e.message;
-  }
-}""");
-    return JS('String', '(#)(#)', function, expression);
-  }
-
-  /// Similar to [provokePropertyErrorOn], but provokes an property access
-  /// error directly on literal "null" expression.
-  static String provokePropertyErrorOnNull() {
-    // See [provokeCallErrorOn] for a detailed explanation.
-    var function = JS('', r"""function() {
-  try {
-    null.$method$;
-  } catch (e) {
-    return e.message;
-  }
-}""");
-    return JS('String', '(#)()', function);
-  }
-
-  /// Similar to [provokePropertyErrorOnNull], but provokes an property access
-  /// error directly on (void 0), that is, "undefined".
-  static String provokePropertyErrorOnUndefined() {
-    // See [provokeCallErrorOn] for a detailed explanation.
-    var function = JS('', r"""function() {
-  try {
-    (void 0).$method$;
-  } catch (e) {
-    return e.message;
-  }
-}""");
-    return JS('String', '(#)()', function);
-  }
-}
-
-class NullError extends Error implements NoSuchMethodError {
-  final String _message;
-  final String? _method;
-
-  NullError(this._message, match)
-      : _method = match == null ? null : JS('', '#.method', match);
-
-  String toString() {
-    if (_method == null) return 'NoSuchMethodError: $_message';
-    return "NoSuchMethodError: method not found: '$_method' on null";
-  }
-}
-
-class JsNoSuchMethodError extends Error implements NoSuchMethodError {
-  final String _message;
-  final String? _method;
-  final String? _receiver;
-
-  JsNoSuchMethodError(this._message, match)
-      : _method = match == null ? null : JS('String|Null', '#.method', match),
-        _receiver =
-            match == null ? null : JS('String|Null', '#.receiver', match);
-
-  String toString() {
-    if (_method == null) return 'NoSuchMethodError: $_message';
-    if (_receiver == null) {
-      return "NoSuchMethodError: method not found: '$_method' ($_message)";
-    }
-    return "NoSuchMethodError: "
-        "method not found: '$_method' on '$_receiver' ($_message)";
-  }
-}
-
-class UnknownJsTypeError extends Error {
-  final String _message;
-
-  UnknownJsTypeError(this._message);
-
-  String toString() => _message.isEmpty ? 'Error' : 'Error: $_message';
-}
-
-class NullThrownFromJavaScriptException implements Exception {
-  final dynamic _irritant;
-  NullThrownFromJavaScriptException(this._irritant);
-
-  @override
-  String toString() {
-    String description =
-        JS('bool', '# === null', _irritant) ? 'null' : 'undefined';
-    return "Throw of null ('$description' from JavaScript)";
-  }
-}
-
-/// A wrapper around an exception, much like the one created by [wrapException]
-/// but with a pre-given stack-trace.
-class ExceptionAndStackTrace {
-  dynamic dartException;
-  StackTrace stackTrace;
-
-  ExceptionAndStackTrace(this.dartException, this.stackTrace);
-}
-
-/// Called from catch blocks in generated code to extract the Dart exception
-/// from the thrown value. The thrown value may have been created by
-/// [wrapException] or it may be a 'native' JavaScript exception.
-///
-/// Some native exceptions are mapped to new Dart instances, others are
-/// returned unmodified.
-Object unwrapException(Object? ex) {
-  // Dart converts `null` to `NullThrownError()`. JavaScript can still throw a
-  // nullish value.
-  if (ex == null) {
-    return NullThrownFromJavaScriptException(ex);
-  }
-
-  if (ex is ExceptionAndStackTrace) {
-    return saveStackTrace(ex, ex.dartException);
-  }
-
-  // e.g. a primitive value thrown by JavaScript.
-  if (JS('bool', 'typeof # !== "object"', ex)) return ex;
-
-  if (JS('bool', r'"dartException" in #', ex)) {
-    return saveStackTrace(ex, JS('', r'#.dartException', ex));
-  }
-  return _unwrapNonDartException(ex);
-}
-
-/// If error implements Dart [Error], save [ex] in [error.$thrownJsError].
-/// Otherwise, do nothing. Later, the stack trace can then be extracted from
-/// [ex].
-Object saveStackTrace(Object ex, Object error) {
-  if (error is Error) {
-    var thrownStackTrace = JS('', r'#.$thrownJsError', error);
-    if (thrownStackTrace == null) {
-      JS('void', r'#.$thrownJsError = #', error, ex);
-    }
-  }
-  return error;
-}
-
-Object _unwrapNonDartException(Object ex) {
-  if (!JS('bool', r'"message" in #', ex)) {
-    return ex;
-  }
-  // Grab hold of the exception message. This field is available on
-  // all supported browsers.
-  var message = JS('var', r'#.message', ex);
-
-  // Internet Explorer has an error number.  This is the most reliable way to
-  // detect specific errors, so check for this first.
-  if (JS('bool', '"number" in #', ex) &&
-      JS('bool', 'typeof #.number == "number"', ex)) {
-    int number = JS('int', '#.number', ex);
-
-    // From http://msdn.microsoft.com/en-us/library/ie/hc53e755(v=vs.94).aspx
-    // "number" is a 32-bit word. The error code is the low 16 bits, and the
-    // facility code is the upper 16 bits.
-    var ieErrorCode = number & 0xffff;
-    var ieFacilityNumber = (number >> 16) & 0x1fff;
-
-    // http://msdn.microsoft.com/en-us/library/aa264975(v=vs.60).aspx
-    // http://msdn.microsoft.com/en-us/library/ie/1dk3k160(v=vs.94).aspx
-    if (ieFacilityNumber == 10) {
-      switch (ieErrorCode) {
-        case 438:
-          return saveStackTrace(
-              ex, JsNoSuchMethodError('$message (Error $ieErrorCode)', null));
-        case 445:
-        case 5007:
-          return saveStackTrace(
-              ex, NullError('$message (Error $ieErrorCode)', null));
-      }
-    }
-  }
-
-  if (JS('bool', r'# instanceof TypeError', ex)) {
-    var match;
-    var nsme = TypeErrorDecoder.noSuchMethodPattern;
-    var notClosure = TypeErrorDecoder.notClosurePattern;
-    var nullCall = TypeErrorDecoder.nullCallPattern;
-    var nullLiteralCall = TypeErrorDecoder.nullLiteralCallPattern;
-    var undefCall = TypeErrorDecoder.undefinedCallPattern;
-    var undefLiteralCall = TypeErrorDecoder.undefinedLiteralCallPattern;
-    var nullProperty = TypeErrorDecoder.nullPropertyPattern;
-    var nullLiteralProperty = TypeErrorDecoder.nullLiteralPropertyPattern;
-    var undefProperty = TypeErrorDecoder.undefinedPropertyPattern;
-    var undefLiteralProperty = TypeErrorDecoder.undefinedLiteralPropertyPattern;
-    if ((match = nsme.matchTypeError(message)) != null) {
-      return saveStackTrace(ex, JsNoSuchMethodError(message, match));
-    } else if ((match = notClosure.matchTypeError(message)) != null) {
-      // notClosure may match "({c:null}).c()" or "({c:1}).c()", so we
-      // cannot tell if this an attempt to invoke call on null or a
-      // non-function object.
-      // But we do know the method name is "call".
-      JS('', '#.method = "call"', match);
-      return saveStackTrace(ex, JsNoSuchMethodError(message, match));
-    } else if ((match = nullCall.matchTypeError(message)) != null ||
-        (match = nullLiteralCall.matchTypeError(message)) != null ||
-        (match = undefCall.matchTypeError(message)) != null ||
-        (match = undefLiteralCall.matchTypeError(message)) != null ||
-        (match = nullProperty.matchTypeError(message)) != null ||
-        (match = nullLiteralCall.matchTypeError(message)) != null ||
-        (match = undefProperty.matchTypeError(message)) != null ||
-        (match = undefLiteralProperty.matchTypeError(message)) != null) {
-      return saveStackTrace(ex, NullError(message, match));
-    }
-
-    // If we cannot determine what kind of error this is, we fall back
-    // to reporting this as a generic error. It's probably better than
-    // nothing.
-    return saveStackTrace(
-        ex, UnknownJsTypeError(message is String ? message : ''));
-  }
-
-  if (JS('bool', r'# instanceof RangeError', ex)) {
-    if (message is String && contains(message, 'call stack')) {
-      return StackOverflowError();
-    }
-
-    // In general, a RangeError is thrown when trying to pass a number as an
-    // argument to a function that does not allow a range that includes that
-    // number. Translate to a Dart ArgumentError with the same message.
-    // TODO(sra): Translate to RangeError.
-    message = tryStringifyException(ex);
-    if (message is String) {
-      message = JS('String', r'#.replace(/^RangeError:\s*/, "")', message);
-    }
-    return saveStackTrace(ex, ArgumentError(message));
-  }
-
-  // Check for the Firefox specific stack overflow signal.
-  if (JS(
-      'bool',
-      r'typeof InternalError == "function" && # instanceof InternalError',
-      ex)) {
-    if (message is String && message == 'too much recursion') {
-      return StackOverflowError();
-    }
-  }
-
-  // Just return the exception. We should not wrap it because in case the
-  // exception comes from the DOM, it is a JavaScript object that has a Dart
-  // interceptor.
-  return ex;
-}
-
-String? tryStringifyException(ex) {
-  // Since this function is called from [unwrapException] which is called from
-  // code injected into a catch-clause, use JavaScript try-catch to avoid a
-  // potential loop if stringifying crashes.
-  return JS(
-      'String|Null',
-      r'''
-    (function(ex) {
-      try {
-        return String(ex);
-      } catch (e) {}
-      return null;
-    })(#)
-    ''',
-      ex);
-}
-
-/// Called by generated code to fetch the stack trace from an
-/// exception. Should never return null.
-StackTrace getTraceFromException(exception) {
-  if (exception is ExceptionAndStackTrace) {
-    return exception.stackTrace;
-  }
-  if (exception == null) return new _StackTrace(exception);
-  _StackTrace? trace = JS('_StackTrace|Null', r'#.$cachedTrace', exception);
-  if (trace != null) return trace;
-  trace = new _StackTrace(exception);
-  return JS('_StackTrace', r'#.$cachedTrace = #', exception, trace);
-}
-
-class _StackTrace implements StackTrace {
-  var _exception;
-  String? _trace;
-  _StackTrace(this._exception);
-
-  String toString() {
-    if (_trace != null) return JS('String', '#', _trace);
-
-    String? trace;
-    if (JS('bool', '# !== null', _exception) &&
-        JS('bool', 'typeof # === "object"', _exception)) {
-      trace = JS('String|Null', r'#.stack', _exception);
-    }
-    return _trace = (trace == null) ? '' : trace;
-  }
-}
-
-int objectHashCode(var object) {
-  if (object == null || JS('bool', "typeof # != 'object'", object)) {
-    return object.hashCode;
-  } else {
-    return Primitives.objectHashCode(object);
-  }
-}
-
-/// Called by generated code to build a map literal. [keyValuePairs] is
-/// a list of key, value, key, value, ..., etc.
-fillLiteralMap(keyValuePairs, Map result) {
-  // TODO(johnniwinther): Use JSArray to optimize this code instead of calling
-  // [getLength] and [getIndex].
-  int index = 0;
-  int length = getLength(keyValuePairs);
-  while (index < length) {
-    var key = getIndex(keyValuePairs, index++);
-    var value = getIndex(keyValuePairs, index++);
-    result[key] = value;
-  }
-  return result;
-}
-
-/// Called by generated code to build a set literal.
-fillLiteralSet(values, Set result) {
-  // TODO(johnniwinther): Use JSArray to optimize this code instead of calling
-  // [getLength] and [getIndex].
-  int length = getLength(values);
-  for (int index = 0; index < length; index++) {
-    result.add(getIndex(values, index));
-  }
-  return result;
-}
-
-invokeClosure(Function closure, int numberOfArguments, var arg1, var arg2,
-    var arg3, var arg4) {
-  switch (numberOfArguments) {
-    case 0:
-      return closure();
-    case 1:
-      return closure(arg1);
-    case 2:
-      return closure(arg1, arg2);
-    case 3:
-      return closure(arg1, arg2, arg3);
-    case 4:
-      return closure(arg1, arg2, arg3, arg4);
-  }
-  throw new Exception('Unsupported number of arguments for wrapped closure');
-}
-
-/// Called by generated code to convert a Dart closure to a JS
-/// closure when the Dart closure is passed to the DOM.
-convertDartClosureToJS(closure, int arity) {
-  if (closure == null) return null;
-  var function = JS('var', r'#.$identity', closure);
-  if (JS('bool', r'!!#', function)) return function;
-
-  function = JS(
-      'var',
-      r'''
-        (function(closure, arity, invoke) {
-          return function(a1, a2, a3, a4) {
-            return invoke(closure, arity, a1, a2, a3, a4);
-          };
-        })(#,#,#)''',
-      closure,
-      arity,
-      DART_CLOSURE_TO_JS(invokeClosure));
-
-  JS('void', r'#.$identity = #', closure, function);
-  return function;
-}
-
-/// Superclass for Dart closures.
-///
-/// All static, tear-off, function declaration and function expression closures
-/// extend this class, but classes that implement Function via a `call` method
-/// do not.
-abstract class Closure implements Function {
-  // TODO(ahe): These constants must be in sync with
-  // reflection_data_parser.dart.
-  static const FUNCTION_INDEX = 0;
-  static const NAME_INDEX = 1;
-  static const CALL_NAME_INDEX = 2;
-  static const REQUIRED_PARAMETER_INDEX = 3;
-  static const OPTIONAL_PARAMETER_INDEX = 4;
-  static const DEFAULT_ARGUMENTS_INDEX = 5;
-
-  /// Global counter to prevent reusing function code objects.
-  ///
-  /// V8 will share the underlying function code objects when the same string is
-  /// passed to "new Function".  Shared function code objects can lead to
-  /// sub-optimal performance due to polymorphism, and can be prevented by
-  /// ensuring the strings are different, for example, by generating a local
-  /// variable with a name dependent on [functionCounter].
-  static int functionCounter = 0;
-
-  Closure();
-
-  /// Creates a new closure class for use by implicit getters associated with a
-  /// method.
-  ///
-  /// In other words, creates a tear-off closure.
-  ///
-  /// Called from [closureFromTearOff] as well as from reflection when tearing
-  /// of a method via `getField`.
-  ///
-  /// This method assumes that [functions] was created by the JavaScript
-  /// function `addStubs` in `reflection_data_parser.dart`. That is, a list of
-  /// JavaScript function objects with properties `$stubName` and `$callName`.
-  ///
-  /// Further assumes that [reflectionInfo] is the end of the array created by
-  /// [dart2js.js_emitter.ContainerBuilder.addMemberMethod] starting with
-  /// required parameter count or, in case of the new emitter, the runtime
-  /// representation of the function's type.
-  ///
-  /// Caution: this function may be called when building constants.
-  /// TODO(ahe): Don't call this function when building constants.
-  static fromTearOff(
-    receiver,
-    List functions,
-    int? applyTrampolineIndex,
-    var reflectionInfo,
-    bool isStatic,
-    bool isIntercepted,
-    String propertyName,
-  ) {
-    JS_EFFECT(() {
-      // The functions are called here to model the calls from JS forms below.
-      // The types in the JS forms in the arguments are propagated in type
-      // inference.
-      var aBoundClosure = JS('BoundClosure', '0');
-      var aString = JS('String', '0');
-      BoundClosure.receiverOf(aBoundClosure);
-      BoundClosure.selfOf(aBoundClosure);
-      BoundClosure.evalRecipeIntercepted(aBoundClosure, aString);
-      BoundClosure.evalRecipe(aBoundClosure, aString);
-      getType(JS('int', '0'));
-    });
-    // TODO(ahe): All the place below using \$ should be rewritten to go
-    // through the namer.
-    var function = JS('', '#[#]', functions, 0);
-    String? name = JS('String|Null', '#.\$stubName', function);
-    String? callName = JS('String|Null', '#[#]', function,
-        JS_GET_NAME(JsGetName.CALL_NAME_PROPERTY));
-
-    // This variable holds either an index into the types-table, or a function
-    // that can compute a function-rti. (The latter is necessary if the type
-    // is dependent on generic arguments).
-    var functionType = reflectionInfo;
-
-    // function tmp() {};
-    // tmp.prototype = BC.prototype;
-    // var proto = new tmp;
-    // for each computed prototype property:
-    //   proto[property] = ...;
-    // proto._init = BC;
-    // var dynClosureConstructor =
-    //     new Function('self', 'target', 'receiver', 'name',
-    //                  'this._init(self, target, receiver, name)');
-    // proto.constructor = dynClosureConstructor;
-    // dynClosureConstructor.prototype = proto;
-    // return dynClosureConstructor;
-
-    // We need to create a new subclass of TearOffClosure, one of StaticClosure
-    // or BoundClosure.  For this, we need to create an object whose prototype
-    // is the prototype is either StaticClosure.prototype or
-    // BoundClosure.prototype, respectively in pseudo JavaScript code. The
-    // simplest way to access the JavaScript construction function of a Dart
-    // class is to create an instance and access its constructor property.
-    // Creating an instance ensures that any lazy class initialization has taken
-    // place. The newly created instance could in theory be used directly as the
-    // prototype, but it might include additional fields that we don't need.  So
-    // we only use the new instance to access the constructor property and use
-    // Object.create to create the desired prototype.
-    //
-    // TODO(sra): Perhaps cache the prototype to avoid the allocation.
-    var prototype = isStatic
-        ? JS('StaticClosure', 'Object.create(#.constructor.prototype)',
-            new StaticClosure())
-        : JS('BoundClosure', 'Object.create(#.constructor.prototype)',
-            new BoundClosure(null, null, null, ''));
-
-    JS('', '#.\$initialize = #', prototype, JS('', '#.constructor', prototype));
-
-    // The constructor functions have names to prevent the JavaScript
-    // implementation from inventing a name that might have special meaning
-    // (e.g. clashing with minified 'Object' or 'Interceptor').
-    var constructor = isStatic
-        ? JS('', 'function static_tear_off(){this.\$initialize()}')
-        : isCsp
-            ? JS('', 'function tear_off(a,b,c,d) {this.\$initialize(a,b,c,d)}')
-            : JS(
-                '',
-                'new Function("a,b,c,d" + #,'
-                    ' "this.\$initialize(a,b,c,d" + # + ")")',
-                functionCounter,
-                functionCounter++);
-
-    // It is necessary to set the constructor property, otherwise it will be
-    // "Object".
-    JS('', '#.constructor = #', prototype, constructor);
-
-    JS('', '#.prototype = #', constructor, prototype);
-
-    // Create a closure and "monkey" patch it with call stubs.
-    var trampoline = function;
-    if (!isStatic) {
-      trampoline = forwardCallTo(receiver, function, isIntercepted);
-      JS('', '#.\$reflectionInfo = #', trampoline, reflectionInfo);
-    } else {
-      JS('', '#[#] = #', prototype, STATIC_FUNCTION_NAME_PROPERTY_NAME,
-          propertyName);
-    }
-
-    var signatureFunction = JS_GET_FLAG('USE_NEW_RTI')
-        ? _computeSignatureFunctionNewRti(functionType, isStatic, isIntercepted)
-        : _computeSignatureFunctionLegacy(
-            functionType, isStatic, isIntercepted);
-
-    JS('', '#[#] = #', prototype, JS_GET_NAME(JsGetName.SIGNATURE_NAME),
-        signatureFunction);
-    var applyTrampoline = trampoline;
-    JS('', '#[#] = #', prototype, callName, trampoline);
-    for (int i = 1; i < functions.length; i++) {
-      var stub = functions[i];
-      var stubCallName = JS('String|Null', '#[#]', stub,
-          JS_GET_NAME(JsGetName.CALL_NAME_PROPERTY));
-      if (stubCallName != null) {
-        stub = isStatic ? stub : forwardCallTo(receiver, stub, isIntercepted);
-        JS('', '#[#] = #', prototype, stubCallName, stub);
-      }
-      if (i == applyTrampolineIndex) {
-        applyTrampoline = stub;
-        JS('', '#.\$reflectionInfo = #', applyTrampoline, reflectionInfo);
-      }
-    }
-
-    JS('', '#[#] = #', prototype, JS_GET_NAME(JsGetName.CALL_CATCH_ALL),
-        applyTrampoline);
-    String reqArgProperty = JS_GET_NAME(JsGetName.REQUIRED_PARAMETER_PROPERTY);
-    String defValProperty = JS_GET_NAME(JsGetName.DEFAULT_VALUES_PROPERTY);
-    JS('', '#.# = #.#', prototype, reqArgProperty, function, reqArgProperty);
-    JS('', '#.# = #.#', prototype, defValProperty, function, defValProperty);
-
-    return constructor;
-  }
-
-  static _computeSignatureFunctionLegacy(
-      Object functionType, bool isStatic, bool isIntercepted) {
-    if (JS('bool', 'typeof # == "number"', functionType)) {
-      // We cannot call [getType] here, since the types-metadata might not be
-      // set yet. This is, because fromTearOff might be called for constants
-      // when the program isn't completely set up yet.
-      //
-      // Note that we cannot just textually inline the call
-      // `getType(functionType)` since we cannot guarantee that the (then)
-      // captured variable `functionType` isn't reused.
-      return JS(
-          '',
-          '''(function(getType, t) {
-                    return function(){ return getType(t); };
-                })(#, #)''',
-          RAW_DART_FUNCTION_REF(getType),
-          functionType);
-    }
-    if (JS('bool', 'typeof # == "function"', functionType)) {
-      if (isStatic) {
-        return functionType;
-      } else {
-        var getReceiver = isIntercepted
-            ? RAW_DART_FUNCTION_REF(BoundClosure.receiverOf)
-            : RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
-        return JS(
-            '',
-            'function(f,r){'
-                'return function(){'
-                'return f.apply({\$receiver:r(this)},arguments)'
-                '}'
-                '}(#,#)',
-            functionType,
-            getReceiver);
-      }
-    }
-    throw 'Error in functionType of tearoff';
-  }
-
-  static _computeSignatureFunctionNewRti(
-      Object functionType, bool isStatic, bool isIntercepted) {
-    if (JS('bool', 'typeof # == "number"', functionType)) {
-      // Index into types table.
-      //
-      // We cannot call [getTypeFromTypesTable] here, since the types-metadata
-      // might not be set yet. This is, because fromTearOff might be called for
-      // constants when the program isn't completely set up yet. We also want to
-      // avoid creating lots of types at startup.
-      return JS(
-          '',
-          '''(function(getType, t) {
-                 return function(){ return getType(t); };
-             })(#, #)''',
-          RAW_DART_FUNCTION_REF(newRti.getTypeFromTypesTable),
-          functionType);
-    }
-    if (JS('bool', 'typeof # == "string"', functionType)) {
-      // A recipe to evaluate against the instance type.
-      if (isStatic) {
-        // TODO(sra): Recipe for static tearoff.
-        throw 'Cannot compute signature for static tearoff.';
-      }
-      var typeEvalMethod = isIntercepted
-          ? RAW_DART_FUNCTION_REF(BoundClosure.evalRecipeIntercepted)
-          : RAW_DART_FUNCTION_REF(BoundClosure.evalRecipe);
-      return JS(
-          '',
-          '    function(recipe, evalOnReceiver) {'
-              '  return function() {'
-              '    return evalOnReceiver(this, recipe);'
-              '  };'
-              '}(#,#)',
-          functionType,
-          typeEvalMethod);
-    }
-    throw 'Error in functionType of tearoff';
-  }
-
-  static cspForwardCall(
-      int arity, bool isSuperCall, String? stubName, function) {
-    var getSelf = RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
-    // Handle intercepted stub-names with the default slow case.
-    if (isSuperCall) arity = -1;
-    switch (arity) {
-      case 0:
-        return JS(
-            '',
-            'function(n,S){'
-                'return function(){'
-                'return S(this)[n]()'
-                '}'
-                '}(#,#)',
-            stubName,
-            getSelf);
-      case 1:
-        return JS(
-            '',
-            'function(n,S){'
-                'return function(a){'
-                'return S(this)[n](a)'
-                '}'
-                '}(#,#)',
-            stubName,
-            getSelf);
-      case 2:
-        return JS(
-            '',
-            'function(n,S){'
-                'return function(a,b){'
-                'return S(this)[n](a,b)'
-                '}'
-                '}(#,#)',
-            stubName,
-            getSelf);
-      case 3:
-        return JS(
-            '',
-            'function(n,S){'
-                'return function(a,b,c){'
-                'return S(this)[n](a,b,c)'
-                '}'
-                '}(#,#)',
-            stubName,
-            getSelf);
-      case 4:
-        return JS(
-            '',
-            'function(n,S){'
-                'return function(a,b,c,d){'
-                'return S(this)[n](a,b,c,d)'
-                '}'
-                '}(#,#)',
-            stubName,
-            getSelf);
-      case 5:
-        return JS(
-            '',
-            'function(n,S){'
-                'return function(a,b,c,d,e){'
-                'return S(this)[n](a,b,c,d,e)'
-                '}'
-                '}(#,#)',
-            stubName,
-            getSelf);
-      default:
-        return JS(
-            '',
-            'function(f,s){'
-                'return function(){'
-                'return f.apply(s(this),arguments)'
-                '}'
-                '}(#,#)',
-            function,
-            getSelf);
-    }
-  }
-
-  static bool get isCsp => JS_GET_FLAG('USE_CONTENT_SECURITY_POLICY');
-
-  static forwardCallTo(receiver, function, bool isIntercepted) {
-    if (isIntercepted) return forwardInterceptedCallTo(receiver, function);
-    String? stubName = JS('String|Null', '#.\$stubName', function);
-    int arity = JS('int', '#.length', function);
-    var lookedUpFunction = JS('', '#[#]', receiver, stubName);
-    // The receiver[stubName] may not be equal to the function if we try to
-    // forward to a super-method. Especially when we create a bound closure
-    // of a super-call we need to make sure that we don't forward back to the
-    // dynamically looked up function.
-    bool isSuperCall = !identical(function, lookedUpFunction);
-
-    if (isCsp || isSuperCall || arity >= 27) {
-      return cspForwardCall(arity, isSuperCall, stubName, function);
-    }
-
-    if (arity == 0) {
-      // Incorporate functionCounter into a local.
-      String selfName = 'self${functionCounter++}';
-      return JS(
-          '',
-          '(new Function(#))()',
-          'return function(){'
-              'var $selfName = this.${BoundClosure.selfFieldName()};'
-              'return $selfName.$stubName();'
-              '}');
-    }
-    assert(1 <= arity && arity < 27);
-    String arguments = JS('String',
-        '"abcdefghijklmnopqrstuvwxyz".split("").splice(0,#).join(",")', arity);
-    arguments += '${functionCounter++}';
-    return JS(
-        '',
-        '(new Function(#))()',
-        'return function($arguments){'
-            'return this.${BoundClosure.selfFieldName()}.$stubName($arguments);'
-            '}');
-  }
-
-  static cspForwardInterceptedCall(
-      int arity, bool isSuperCall, String? name, function) {
-    var getSelf = RAW_DART_FUNCTION_REF(BoundClosure.selfOf);
-    var getReceiver = RAW_DART_FUNCTION_REF(BoundClosure.receiverOf);
-    // Handle intercepted stub-names with the default slow case.
-    if (isSuperCall) arity = -1;
-    switch (arity) {
-      case 0:
-        // Intercepted functions always takes at least one argument (the
-        // receiver).
-        throw new RuntimeError('Intercepted function with no arguments.');
-      case 1:
-        return JS(
-            '',
-            'function(n,s,r){'
-                'return function(){'
-                'return s(this)[n](r(this))'
-                '}'
-                '}(#,#,#)',
-            name,
-            getSelf,
-            getReceiver);
-      case 2:
-        return JS(
-            '',
-            'function(n,s,r){'
-                'return function(a){'
-                'return s(this)[n](r(this),a)'
-                '}'
-                '}(#,#,#)',
-            name,
-            getSelf,
-            getReceiver);
-      case 3:
-        return JS(
-            '',
-            'function(n,s,r){'
-                'return function(a,b){'
-                'return s(this)[n](r(this),a,b)'
-                '}'
-                '}(#,#,#)',
-            name,
-            getSelf,
-            getReceiver);
-      case 4:
-        return JS(
-            '',
-            'function(n,s,r){'
-                'return function(a,b,c){'
-                'return s(this)[n](r(this),a,b,c)'
-                '}'
-                '}(#,#,#)',
-            name,
-            getSelf,
-            getReceiver);
-      case 5:
-        return JS(
-            '',
-            'function(n,s,r){'
-                'return function(a,b,c,d){'
-                'return s(this)[n](r(this),a,b,c,d)'
-                '}'
-                '}(#,#,#)',
-            name,
-            getSelf,
-            getReceiver);
-      case 6:
-        return JS(
-            '',
-            'function(n,s,r){'
-                'return function(a,b,c,d,e){'
-                'return s(this)[n](r(this),a,b,c,d,e)'
-                '}'
-                '}(#,#,#)',
-            name,
-            getSelf,
-            getReceiver);
-      default:
-        return JS(
-            '',
-            'function(f,s,r,a){'
-                'return function(){'
-                'a=[r(this)];'
-                'Array.prototype.push.apply(a,arguments);'
-                'return f.apply(s(this),a)'
-                '}'
-                '}(#,#,#)',
-            function,
-            getSelf,
-            getReceiver);
-    }
-  }
-
-  static forwardInterceptedCallTo(receiver, function) {
-    String selfField = BoundClosure.selfFieldName();
-    String receiverField = BoundClosure.receiverFieldName();
-    String? stubName = JS('String|Null', '#.\$stubName', function);
-    int arity = JS('int', '#.length', function);
-    bool isCsp = JS_GET_FLAG('USE_CONTENT_SECURITY_POLICY');
-    var lookedUpFunction = JS('', '#[#]', receiver, stubName);
-    // The receiver[stubName] may not be equal to the function if we try to
-    // forward to a super-method. Especially when we create a bound closure
-    // of a super-call we need to make sure that we don't forward back to the
-    // dynamically looked up function.
-    bool isSuperCall = !identical(function, lookedUpFunction);
-
-    if (isCsp || isSuperCall || arity >= 28) {
-      return cspForwardInterceptedCall(arity, isSuperCall, stubName, function);
-    }
-    if (arity == 1) {
-      return JS(
-          '',
-          '(new Function(#))()',
-          'return function(){'
-              'return this.$selfField.$stubName(this.$receiverField);'
-              '${functionCounter++}'
-              '}');
-    }
-    assert(1 < arity && arity < 28);
-    String arguments = JS(
-        'String',
-        '"abcdefghijklmnopqrstuvwxyz".split("").splice(0,#).join(",")',
-        arity - 1);
-    return JS(
-        '',
-        '(new Function(#))()',
-        'return function($arguments){'
-            'return this.$selfField.$stubName(this.$receiverField, $arguments);'
-            '${functionCounter++}'
-            '}');
-  }
-
-  // The backend adds a special getter of the form
-  //
-  // Closure get call => this;
-  //
-  // to allow tearing off a closure from itself. We do this magically in the
-  // backend rather than simply adding it here, as we do not want this getter
-  // to be visible to resolution and the generation of extra stubs.
-
-  String toString() {
-    String? name;
-    var constructor = JS('', '#.constructor', this);
-    name =
-        constructor == null ? null : JS('String|Null', '#.name', constructor);
-    if (name == null) name = 'unknown';
-    return "Closure '${unminifyOrTag(name)}'";
-  }
-}
-
-/// Called from implicit method getter (aka tear-off).
-closureFromTearOff(receiver, functions, applyTrampolineIndex, reflectionInfo,
-    isStatic, isIntercepted, name) {
-  return Closure.fromTearOff(
-      receiver,
-      JS('JSArray', '#', functions),
-      JS('int|Null', '#', applyTrampolineIndex),
-      reflectionInfo,
-      JS('bool', '!!#', isStatic),
-      JS('bool', '!!#', isIntercepted),
-      JS('String', '#', name));
-}
-
-/// Represents an implicit closure of a function.
-abstract class TearOffClosure extends Closure {}
-
-class StaticClosure extends TearOffClosure {
-  String toString() {
-    String? name =
-        JS('String|Null', '#[#]', this, STATIC_FUNCTION_NAME_PROPERTY_NAME);
-    if (name == null) return 'Closure of unknown static method';
-    return "Closure '${unminifyOrTag(name)}'";
-  }
-}
-
-/// Represents a 'tear-off' or property extraction closure of an instance
-/// method, that is an instance method bound to a specific receiver (instance).
-class BoundClosure extends TearOffClosure {
-  /// The receiver or interceptor.
-  // TODO(ahe): This could just be the interceptor, we always know if
-  // we need the interceptor when generating the call method.
-  final _self;
-
-  /// The method.
-  final _target;
-
-  /// The receiver. Null if [_self] is not an interceptor.
-  final _receiver;
-
-  /// The name of the function. Only used by the mirror system.
-  final String _name;
-
-  BoundClosure(this._self, this._target, this._receiver, this._name);
-
-  bool operator ==(other) {
-    if (identical(this, other)) return true;
-    if (other is! BoundClosure) return false;
-    return JS('bool', '# === #', _self, other._self) &&
-        JS('bool', '# === #', _target, other._target) &&
-        JS('bool', '# === #', _receiver, other._receiver);
-  }
-
-  int get hashCode {
-    int receiverHashCode;
-    if (_receiver == null) {
-      // A bound closure on a regular Dart object, just use the
-      // identity hash code.
-      receiverHashCode = Primitives.objectHashCode(_self);
-    } else if (JS('String', 'typeof #', _receiver) != 'object') {
-      // A bound closure on a primitive JavaScript type. We
-      // use the hashCode method we define for those primitive types.
-      receiverHashCode = _receiver.hashCode;
-    } else {
-      // A bound closure on an intercepted native class, just use the
-      // identity hash code.
-      receiverHashCode = Primitives.objectHashCode(_receiver);
-    }
-    return receiverHashCode ^ Primitives.objectHashCode(_target);
-  }
-
-  toString() {
-    var receiver = _receiver == null ? _self : _receiver;
-    // TODO(sra): When minified, mark [_name] with a tag,
-    // e.g. 'minified-property:' so that it can be unminified.
-    return "Closure '$_name' of "
-        "${Primitives.objectToHumanReadableString(receiver)}";
-  }
-
-  static evalRecipe(BoundClosure closure, String recipe) {
-    return newRti.evalInInstance(closure._self, recipe);
-  }
-
-  static evalRecipeIntercepted(BoundClosure closure, String recipe) {
-    return newRti.evalInInstance(closure._receiver, recipe);
-  }
-
-  @pragma('dart2js:noInline')
-  static selfOf(BoundClosure closure) => closure._self;
-
-  static targetOf(BoundClosure closure) => closure._target;
-
-  @pragma('dart2js:noInline')
-  static receiverOf(BoundClosure closure) => closure._receiver;
-
-  static nameOf(BoundClosure closure) => closure._name;
-
-  static String? selfFieldNameCache;
-
-  static String selfFieldName() {
-    if (selfFieldNameCache == null) {
-      selfFieldNameCache = computeFieldNamed('self');
-    }
-    return selfFieldNameCache!;
-  }
-
-  static String? receiverFieldNameCache;
-
-  static String receiverFieldName() {
-    if (receiverFieldNameCache == null) {
-      receiverFieldNameCache = computeFieldNamed('receiver');
-    }
-    return receiverFieldNameCache!;
-  }
-
-  @pragma('dart2js:noInline')
-  @pragma('dart2js:noSideEffects')
-  static String computeFieldNamed(String fieldName) {
-    var template = new BoundClosure('self', 'target', 'receiver', 'name');
-    var names = JSArray.markFixedList(
-        JS('', 'Object.getOwnPropertyNames(#)', template));
-    for (int i = 0; i < names.length; i++) {
-      var name = names[i];
-      if (JS('bool', '#[#] === #', template, name, fieldName)) {
-        return JS('String', '#', name);
-      }
-    }
-    throw new ArgumentError("Field name $fieldName not found.");
-  }
-}
-
-bool jsHasOwnProperty(var jsObject, String property) {
-  return JS('bool', r'#.hasOwnProperty(#)', jsObject, property);
-}
-
-jsPropertyAccess(var jsObject, String property) {
-  return JS('var', r'#[#]', jsObject, property);
-}
-
-/// Called at the end of unaborted switch cases to get the singleton
-/// FallThroughError exception that will be thrown.
-getFallThroughError() => new FallThroughErrorImplementation();
-
-/// A metadata annotation describing the types instantiated by a native element.
-///
-/// The annotation is valid on a native method and a field of a native class.
-///
-/// By default, a field of a native class is seen as an instantiation point for
-/// all native classes that are a subtype of the field's type, and a native
-/// method is seen as an instantiation point fo all native classes that are a
-/// subtype of the method's return type, or the argument types of the declared
-/// type of the method's callback parameter.
-///
-/// An @[Creates] annotation overrides the default set of instantiated types.
-/// If one or more @[Creates] annotations are present, the type of the native
-/// element is ignored, and the union of @[Creates] annotations is used instead.
-/// The names in the strings are resolved and the program will fail to compile
-/// with dart2js if they do not name types.
-///
-/// The argument to [Creates] is a string.  The string is parsed as the names of
-/// one or more types, separated by vertical bars `|`.  There are some special
-/// names:
-///
-/// * `=Object`. This means 'exactly Object', which is a plain JavaScript object
-///   with properties and none of the subtypes of Object.
-///
-/// Example: we may know that a method always returns a specific implementation:
-///
-///     @Creates('_NodeList')
-///     List<Node> getElementsByTagName(String tag) native;
-///
-/// Useful trick: A method can be marked as not instantiating any native classes
-/// with the annotation `@Creates('Null')`.  This is useful for fields on native
-/// classes that are used only in Dart code.
-///
-///     @Creates('Null')
-///     var _cachedFoo;
-class Creates {
-  final String types;
-  const Creates(this.types);
-}
-
-/// A metadata annotation describing the types returned or yielded by a native
-/// element.
-///
-/// The annotation is valid on a native method and a field of a native class.
-///
-/// By default, a native method or field is seen as returning or yielding all
-/// subtypes if the method return type or field type.  This annotation allows a
-/// more precise set of types to be specified.
-///
-/// See [Creates] for the syntax of the argument.
-///
-/// Example: IndexedDB keys are numbers, strings and JavaScript Arrays of keys.
-///
-///     @Returns('String|num|JSExtendableArray')
-///     dynamic key;
-///
-///     // Equivalent:
-///     @Returns('String') @Returns('num') @Returns('JSExtendableArray')
-///     dynamic key;
-class Returns {
-  final String types;
-  const Returns(this.types);
-}
-
-/// A metadata annotation placed on native methods and fields of native classes
-/// to specify the JavaScript name.
-///
-/// This example declares a Dart field + getter + setter called `$dom_title`
-/// that corresponds to the JavaScript property `title`.
-///
-///     class Document native "*Foo" {
-///       @JSName('title')
-///       String $dom_title;
-///     }
-class JSName {
-  final String name;
-  const JSName(this.name);
-}
-
-/// The following methods are called by the runtime to implement checked mode
-/// and casts. We specialize each primitive type (eg int, bool), and use the
-/// compiler's convention to do is-checks on regular objects.
-boolConversionCheck(value) {
-  // The value from kernel should always be true, false, or null.
-  if (value == null) assertThrow('boolean expression must not be null');
-  return value;
-}
-
-extractFunctionTypeObjectFrom(o) {
-  var interceptor = getInterceptor(o);
-  return extractFunctionTypeObjectFromInternal(interceptor);
-}
-
-extractFunctionTypeObjectFromInternal(o) {
-  var signatureName = JS_GET_NAME(JsGetName.SIGNATURE_NAME);
-  if (JS('bool', '# in #', signatureName, o)) {
-    var signature = JS('', '#[#]', o, signatureName);
-    if (JS('bool', 'typeof # == "number"', signature)) {
-      return getType(signature);
-    } else {
-      return JS('', '#[#]()', o, signatureName);
-    }
-  }
-  return null;
-}
-
-@pragma('dart2js:noInline')
-void checkDeferredIsLoaded(String loadId) {
-  if (!_loadedLibraries.contains(loadId)) {
-    throw new DeferredNotLoadedError(loadId);
-  }
-}
-
-/// Special interface recognized by the compiler and implemented by DOM
-/// objects that support integer indexing. This interface is not
-/// visible to anyone, and is only injected into special libraries.
-abstract class JavaScriptIndexingBehavior<E> extends JSMutableIndexable<E> {}
-
-/// Thrown by type assertions that fail.
-class TypeErrorImplementation extends Error implements TypeError, CastError {
-  final String _message;
-
-  /// Normal type error caused by a failed subtype test.
-  TypeErrorImplementation(Object value, String type)
-      : _message = "TypeError: ${Error.safeToString(value)}: type "
-            "'${_typeDescription(value)}' is not a subtype of type '$type'";
-
-  TypeErrorImplementation.fromMessage(String this._message);
-
-  String toString() => _message;
-}
-
-/// Thrown by the 'as' operator if the cast isn't valid.
-class CastErrorImplementation extends Error implements CastError, TypeError {
-  final String _message;
-
-  /// Normal cast error caused by a failed type cast.
-  CastErrorImplementation(Object value, Object type)
-      : _message = "TypeError: ${Error.safeToString(value)}: type "
-            "'${_typeDescription(value)}' is not a subtype of type '$type'";
-
-  String toString() => _message;
-}
-
-String _typeDescription(value) {
-  if (value is Closure) {
-    var functionTypeObject = extractFunctionTypeObjectFrom(value);
-    if (functionTypeObject != null) {
-      return runtimeTypeToString(functionTypeObject);
-    }
-    return 'Closure';
-  }
-  return Primitives.objectTypeName(value);
-}
-
-class FallThroughErrorImplementation extends FallThroughError {
-  FallThroughErrorImplementation();
-  String toString() => 'Switch case fall-through.';
-}
-
-/// Helper function for implementing asserts. The compiler treats this
-/// specially.
-///
-/// Returns the negation of the condition. That is: `true` if the assert should
-/// fail.
-bool assertTest(condition) {
-  // Do bool success check first, it is common and faster than 'is Function'.
-  if (true == condition) return false;
-  if (condition is bool) return !condition;
-  throw new TypeErrorImplementation(condition, 'bool');
-}
-
-/// Helper function for implementing asserts with messages.
-/// The compiler treats this specially.
-void assertThrow(Object message) {
-  throw new _AssertionError(message);
-}
-
-/// Helper function for implementing asserts without messages.
-/// The compiler treats this specially.
-@pragma('dart2js:noInline')
-void assertHelper(condition) {
-  if (assertTest(condition)) throw new AssertionError();
-}
-
-/// Called by generated code when a method that must be statically
-/// resolved cannot be found.
-void throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {
-  Symbol memberName = new _symbol_dev.Symbol.unvalidated(name);
-  throw new NoSuchMethodError(
-      obj, memberName, arguments, new Map<Symbol, dynamic>());
-}
-
-/// Called by generated code when a static field's initializer references the
-/// field that is currently being initialized.
-void throwCyclicInit(String staticName) {
-  throw new CyclicInitializationError(staticName);
-}
-
-/// Error thrown when a runtime error occurs.
-class RuntimeError extends Error {
-  final message;
-  RuntimeError(this.message);
-  String toString() => 'RuntimeError: $message';
-}
-
-class DeferredNotLoadedError extends Error implements NoSuchMethodError {
-  String libraryName;
-
-  DeferredNotLoadedError(this.libraryName);
-
-  String toString() {
-    return 'Deferred library $libraryName was not loaded.';
-  }
-}
-
-// TODO(ahe): Remove this class and call noSuchMethod instead.
-class UnimplementedNoSuchMethodError extends Error
-    implements NoSuchMethodError {
-  final String _message;
-
-  UnimplementedNoSuchMethodError(this._message);
-
-  String toString() => 'Unsupported operation: $_message';
-}
-
-/// Creates a random number with 64 bits of randomness.
-///
-/// This will be truncated to the 53 bits available in a double.
-int random64() {
-  // TODO(lrn): Use a secure random source.
-  int int32a = JS('int', '(Math.random() * 0x100000000) >>> 0');
-  int int32b = JS('int', '(Math.random() * 0x100000000) >>> 0');
-  return int32a + int32b * 0x100000000;
-}
-
-String jsonEncodeNative(String string) {
-  return JS('String', 'JSON.stringify(#)', string);
-}
-
-/// Returns a property name for placing data on JavaScript objects shared
-/// between DOM isolates.  This happens when multiple programs are loaded in the
-/// same JavaScript context (i.e. page).  The name is based on [name] but with
-/// an additional part that is unique for each isolate.
-///
-/// The form of the name is '___dart_$name_$id'.
-String getIsolateAffinityTag(String name) {
-  var isolateTagGetter = JS_EMBEDDED_GLOBAL('', GET_ISOLATE_TAG);
-  return JS('String', '#(#)', isolateTagGetter, name);
-}
-
-typedef Future<Null> LoadLibraryFunctionType();
-
-LoadLibraryFunctionType _loadLibraryWrapper(String loadId) {
-  return () => loadDeferredLibrary(loadId);
-}
-
-final Map<String, Future<Null>?> _loadingLibraries = <String, Future<Null>?>{};
-final Set<String> _loadedLibraries = new Set<String>();
-
-/// Events used to diagnose failures from deferred loading requests.
-final List<String> _eventLog = <String>[];
-
-typedef void DeferredLoadCallback();
-
-// Function that will be called every time a new deferred import is loaded.
-DeferredLoadCallback? deferredLoadHook;
-
-Future<Null> loadDeferredLibrary(String loadId) {
-  // For each loadId there is a list of parts to load. The parts are represented
-  // by an index. There are two arrays, one that maps the index into a Uri and
-  // another that maps the index to a hash.
-  var partsMap = JS_EMBEDDED_GLOBAL('', DEFERRED_LIBRARY_PARTS);
-  List? indexes = JS('JSExtendableArray|Null', '#[#]', partsMap, loadId);
-  if (indexes == null) return new Future.value(null);
-  List<String> uris = <String>[];
-  List<String> hashes = <String>[];
-  List index2uri = JS_EMBEDDED_GLOBAL('JSArray', DEFERRED_PART_URIS);
-  List index2hash = JS_EMBEDDED_GLOBAL('JSArray', DEFERRED_PART_HASHES);
-  for (int i = 0; i < indexes.length; i++) {
-    int index = JS('int', '#[#]', indexes, i);
-    uris.add(JS('String', '#[#]', index2uri, index));
-    hashes.add(JS('String', '#[#]', index2hash, index));
-  }
-
-  int total = hashes.length;
-  assert(total == uris.length);
-  List<bool> waitingForLoad = new List.filled(total, true);
-  int nextHunkToInitialize = 0;
-  var isHunkLoaded = JS_EMBEDDED_GLOBAL('', IS_HUNK_LOADED);
-  var isHunkInitialized = JS_EMBEDDED_GLOBAL('', IS_HUNK_INITIALIZED);
-  var initializer = JS_EMBEDDED_GLOBAL('', INITIALIZE_LOADED_HUNK);
-
-  void initializeSomeLoadedHunks() {
-    for (int i = nextHunkToInitialize; i < total; ++i) {
-      // A hunk is initialized only if all the preceeding hunks have been
-      // initialized.
-      if (waitingForLoad[i]) return;
-      nextHunkToInitialize++;
-
-      // It is possible for a hash to be repeated. This happens when two
-      // different parts both end up empty. Checking in the loop rather than
-      // pre-filtering prevents duplicate hashes leading to duplicated
-      // initializations.
-      // TODO(29572): Merge small parts.
-      // TODO(29635): Remove duplicate parts from tables and output files.
-      var uri = uris[i];
-      var hash = hashes[i];
-      if (JS('bool', '#(#)', isHunkInitialized, hash)) {
-        _eventLog.add(' - already initialized: $uri ($hash)');
-        continue;
-      }
-      // On strange scenarios, e.g. if js encounters parse errors, we might get
-      // an "success" callback on the script load but the hunk will be null.
-      if (JS('bool', '#(#)', isHunkLoaded, hash)) {
-        _eventLog.add(' - initialize: $uri ($hash)');
-        JS('void', '#(#)', initializer, hash);
-      } else {
-        _eventLog.add(' - missing hunk: $uri ($hash)');
-        throw new DeferredLoadException("Loading ${uris[i]} failed: "
-            "the code with hash '${hash}' was not loaded.\n"
-            "event log:\n${_eventLog.join("\n")}\n");
-      }
-    }
-  }
-
-  Future loadAndInitialize(int i) {
-    if (JS('bool', '#(#)', isHunkLoaded, hashes[i])) {
-      waitingForLoad[i] = false;
-      return new Future.value();
-    }
-    return _loadHunk(uris[i]).then((Null _) {
-      waitingForLoad[i] = false;
-      initializeSomeLoadedHunks();
-    });
-  }
-
-  return Future.wait(new List.generate(total, loadAndInitialize)).then((_) {
-    initializeSomeLoadedHunks();
-    // At this point all hunks have been loaded, so there should be no pending
-    // initializations to do.
-    assert(nextHunkToInitialize == total);
-    bool updated = _loadedLibraries.add(loadId);
-    if (updated && deferredLoadHook != null) {
-      deferredLoadHook!();
-    }
-  });
-}
-
-/// The `nonce` value on the current script used for strict-CSP, if any.
-String? _cspNonce = _computeCspNonce();
-
-String? _computeCspNonce() {
-  var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
-  if (currentScript == null) return null;
-  String? nonce = JS('String|Null', '#.nonce', currentScript);
-  return (nonce != null && nonce != '')
-      ? nonce
-      : JS('String|Null', '#.getAttribute("nonce")', currentScript);
-}
-
-/// The 'crossOrigin' value on the current script used for CORS, if any.
-String? _crossOrigin = _computeCrossOrigin();
-
-String? _computeCrossOrigin() {
-  var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
-  if (currentScript == null) return null;
-  return JS('String|Null', '#.crossOrigin', currentScript);
-}
-
-/// Returns true if we are currently in a worker context.
-bool _isWorker() {
-  requiresPreamble();
-  return JS('', '!self.window && !!self.postMessage');
-}
-
-/// The src url for the script tag that loaded this code.
-String? thisScript = _computeThisScript();
-
-/// The src url for the script tag that loaded this function.
-///
-/// Used to create JavaScript workers and load deferred libraries.
-String? _computeThisScript() {
-  var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
-  if (currentScript != null) {
-    return JS('String', 'String(#.src)', currentScript);
-  }
-  // A worker has no script tag - so get an url from a stack-trace.
-  if (_isWorker()) return _computeThisScriptFromTrace();
-  // An isolate that doesn't support workers, but doesn't have a
-  // currentScript either. This is most likely a Chrome extension.
-  return null;
-}
-
-String _computeThisScriptFromTrace() {
-  var stack = JS('String|Null', 'new Error().stack');
-  if (stack == null) {
-    // According to Internet Explorer documentation, the stack
-    // property is not set until the exception is thrown. The stack
-    // property was not provided until IE10.
-    stack = JS(
-        'String|Null',
-        '(function() {'
-            'try { throw new Error() } catch(e) { return e.stack }'
-            '})()');
-    if (stack == null) throw new UnsupportedError('No stack trace');
-  }
-  var pattern, matches;
-
-  // This pattern matches V8, Chrome, and Internet Explorer stack
-  // traces that look like this:
-  // Error
-  //     at methodName (URI:LINE:COLUMN)
-  pattern = JS('', r'new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")');
-
-  matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern);
-  if (matches != null) return JS('String', '#[1]', matches);
-
-  // This pattern matches Firefox stack traces that look like this:
-  // methodName@URI:LINE
-  pattern = JS('', r'new RegExp("^[^@]*@(.*):[0-9]*$", "m")');
-
-  matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern);
-  if (matches != null) return JS('String', '#[1]', matches);
-
-  throw new UnsupportedError('Cannot extract URI from "$stack"');
-}
-
-Future<Null> _loadHunk(String hunkName) {
-  var future = _loadingLibraries[hunkName];
-  _eventLog.add(' - _loadHunk: $hunkName');
-  if (future != null) {
-    _eventLog.add('reuse: $hunkName');
-    return future.then((Null _) => null);
-  }
-
-  String uri = thisScript!;
-
-  int index = uri.lastIndexOf('/');
-  uri = '${uri.substring(0, index + 1)}$hunkName';
-  _eventLog.add(' - download: $hunkName from $uri');
-
-  var deferredLibraryLoader = JS('', 'self.dartDeferredLibraryLoader');
-  Completer<Null> completer = new Completer<Null>();
-
-  void success() {
-    _eventLog.add(' - download success: $hunkName');
-    completer.complete(null);
-  }
-
-  void failure(error, String context, StackTrace? stackTrace) {
-    _eventLog.add(' - download failed: $hunkName (context: $context)');
-    _loadingLibraries[hunkName] = null;
-    stackTrace ??= StackTrace.current;
-    completer.completeError(
-        new DeferredLoadException('Loading $uri failed: $error\n'
-            'event log:\n${_eventLog.join("\n")}\n'),
-        stackTrace);
-  }
-
-  var jsSuccess = convertDartClosureToJS(success, 0);
-  var jsFailure = convertDartClosureToJS((error) {
-    failure(unwrapException(error), 'js-failure-wrapper',
-        getTraceFromException(error));
-  }, 1);
-
-  if (JS('bool', 'typeof # === "function"', deferredLibraryLoader)) {
-    try {
-      JS('void', '#(#, #, #)', deferredLibraryLoader, uri, jsSuccess,
-          jsFailure);
-    } catch (error, stackTrace) {
-      failure(error, "invoking dartDeferredLibraryLoader hook", stackTrace);
-    }
-  } else if (_isWorker()) {
-    // We are in a web worker. Load the code with an XMLHttpRequest.
-    int index = uri.lastIndexOf('/');
-    uri = '${uri.substring(0, index + 1)}$hunkName';
-    var xhr = JS('var', 'new XMLHttpRequest()');
-    JS('void', '#.open("GET", #)', xhr, uri);
-    JS(
-        'void',
-        '#.addEventListener("load", #, false)',
-        xhr,
-        convertDartClosureToJS((event) {
-          int status = JS('int', '#.status', xhr);
-          if (status != 200) {
-            failure('Request status: $status', 'worker xhr', null);
-          }
-          String code = JS('String', '#.responseText', xhr);
-          try {
-            // Create a new function to avoid getting access to current function
-            // context.
-            JS('void', '(new Function(#))()', code);
-            success();
-          } catch (error, stackTrace) {
-            failure(error, 'evaluating the code in worker xhr', stackTrace);
-          }
-        }, 1));
-
-    JS('void', '#.addEventListener("error", #, false)', xhr, (e) {
-      failure(e, 'xhr error handler', null);
-    });
-    JS('void', '#.addEventListener("abort", #, false)', xhr, (e) {
-      failure(e, 'xhr abort handler', null);
-    });
-    JS('void', '#.send()', xhr);
-  } else {
-    // We are in a dom-context.
-    // Inject a script tag.
-    var script = JS('', 'document.createElement("script")');
-    JS('', '#.type = "text/javascript"', script);
-    JS('', '#.src = #', script, uri);
-    if (_cspNonce != null && _cspNonce != '') {
-      JS('', '#.nonce = #', script, _cspNonce);
-      JS('', '#.setAttribute("nonce", #)', script, _cspNonce);
-    }
-    if (_crossOrigin != null && _crossOrigin != '') {
-      JS('', '#.crossOrigin = #', script, _crossOrigin);
-    }
-    JS('', '#.addEventListener("load", #, false)', script, jsSuccess);
-    JS('', '#.addEventListener("error", #, false)', script, jsFailure);
-    JS('', 'document.body.appendChild(#)', script);
-  }
-  _loadingLibraries[hunkName] = completer.future;
-  return completer.future;
-}
-
-class MainError extends Error implements NoSuchMethodError {
-  final String _message;
-
-  MainError(this._message);
-
-  String toString() => 'NoSuchMethodError: $_message';
-}
-
-void missingMain() {
-  throw new MainError("No top-level function named 'main'.");
-}
-
-void badMain() {
-  throw new MainError("'main' is not a function.");
-}
-
-void mainHasTooManyParameters() {
-  throw new MainError("'main' expects too many parameters.");
-}
-
-class _AssertionError extends AssertionError {
-  _AssertionError(Object message) : super(message);
-
-  String toString() => "Assertion failed: " + Error.safeToString(message);
-}
-
-// [_UnreachableError] is a separate class because we always resolve
-// [assertUnreachable] and want to reduce the impact of resolving possibly
-// unneeded code.
-class _UnreachableError extends AssertionError {
-  _UnreachableError();
-  String toString() => 'Assertion failed: Reached dead code';
-}
-
-@pragma('dart2js:noInline')
-void assertUnreachable() {
-  throw new _UnreachableError();
-}
-
-// Hook to register new global object if necessary.
-// This is currently a no-op in dart2js.
-void registerGlobalObject(object) {}
-
-// Hook to register new browser classes.
-// This is currently a no-op in dart2js.
-void applyExtension(name, nativeObject) {}
-
-// See tests/dart2js_2/platform_environment_variable1_test.dart
-const String testPlatformEnvironmentVariableValue = String.fromEnvironment(
-    'dart2js.test.platform.environment.variable',
-    defaultValue: 'not-specified');
-
-String testingGetPlatformEnvironmentVariable() {
-  return testPlatformEnvironmentVariableValue;
-}
-
-// These are used to indicate that a named parameter is required when lazily
-// retrieving default values via [JsGetName.DEFAULT_VALUES_PROPERTY].
-class _Required {
-  const _Required();
-}
-
-const kRequiredSentinel = const _Required();
-bool isRequired(Object? value) => identical(kRequiredSentinel, value);
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_names.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_names.dart
deleted file mode 100644
index 10efacf..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_names.dart
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2013, 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.
-
-library dart._js_names;
-
-import 'dart:_js_embedded_names'
-    show JsGetName, MANGLED_GLOBAL_NAMES, MANGLED_NAMES;
-
-import 'dart:_foreign_helper' show JS, JS_EMBEDDED_GLOBAL, JS_GET_NAME;
-
-import 'dart:_js_helper' show JsCache, NoInline;
-
-import 'dart:_interceptors' show JSArray;
-
-/// No-op method that is called to inform the compiler that unmangled named
-/// must be preserved.
-preserveNames() {}
-
-/// A map from mangled names to "reflective" names, that is, unmangled names
-/// with some additional information, such as, number of required arguments.
-/// This map is for mangled names used as instance members.
-final _LazyMangledNamesMap mangledNames = new _LazyMangledInstanceNamesMap(
-    JS_EMBEDDED_GLOBAL('=Object', MANGLED_NAMES));
-
-/// A map from "reflective" names to mangled names (the reverse of
-/// [mangledNames]).
-final _LazyReflectiveNamesMap reflectiveNames = new _LazyReflectiveNamesMap(
-    JS_EMBEDDED_GLOBAL('=Object', MANGLED_NAMES), true);
-
-/// A map from mangled names to "reflective" names (see [mangledNames]).  This
-/// map is for globals, that is, static and top-level members.
-final _LazyMangledNamesMap mangledGlobalNames = new _LazyMangledNamesMap(
-    JS_EMBEDDED_GLOBAL('=Object', MANGLED_GLOBAL_NAMES));
-
-/// A map from "reflective" names to mangled names (the reverse of
-/// [mangledGlobalNames]).
-final _LazyReflectiveNamesMap reflectiveGlobalNames =
-    new _LazyReflectiveNamesMap(
-        JS_EMBEDDED_GLOBAL('=Object', MANGLED_GLOBAL_NAMES), false);
-
-/// Implements a mapping from mangled names to their reflective counterparts.
-/// The propertiy names of [_jsMangledNames] are the mangled names, and the
-/// values are the "reflective" names.
-class _LazyMangledNamesMap {
-  /// [_jsMangledNames] is a JavaScript object literal.
-  var _jsMangledNames;
-
-  _LazyMangledNamesMap(this._jsMangledNames);
-
-  String? operator [](String key) {
-    var result = JS('var', '#[#]', _jsMangledNames, key);
-    // Filter out all non-string values to protect against polution from
-    // ancillary fields in [_jsMangledNames].
-    bool filter = JS('bool', 'typeof # !== "string"', result);
-    // To ensure that the inferrer sees that result is a String, we explicitly
-    // give it a better type here.
-    return filter ? null : JS('String', '#', result);
-  }
-}
-
-/// Extends [_LazyMangledNamesMap] with additional support for adding mappings
-/// from mangled setter names to their reflective counterpart by rewriting a
-/// corresponding entry for a getter name, if it exists.
-class _LazyMangledInstanceNamesMap extends _LazyMangledNamesMap {
-  _LazyMangledInstanceNamesMap(_jsMangledNames) : super(_jsMangledNames);
-
-  String? operator [](String key) {
-    String? result = super[key];
-    String setterPrefix = JS_GET_NAME(JsGetName.SETTER_PREFIX);
-    if (result == null && key.startsWith(setterPrefix)) {
-      String getterPrefix = JS_GET_NAME(JsGetName.GETTER_PREFIX);
-      int setterPrefixLength = setterPrefix.length;
-
-      // Generate the setter name from the getter name.
-      key = '$getterPrefix${key.substring(setterPrefixLength)}';
-      result = super[key];
-      return (result != null) ? "${result}=" : null;
-    }
-    return result;
-  }
-}
-
-/// Implements the inverse of [_LazyMangledNamesMap]. As it would be too
-/// expensive to search the mangled names map for a value that corresponds to
-/// the lookup key on each invocation, we compute the full mapping in demand
-/// and cache it. The cache is invalidated when the underlying [_jsMangledNames]
-/// object changes its length. This condition is sufficient as the name mapping
-/// can only grow over time.
-/// When [_isInstance] is true, we also apply the inverse of the setter/getter
-/// name conversion implemented by [_LazyMangledInstanceNamesMap].
-class _LazyReflectiveNamesMap {
-  /// [_jsMangledNames] is a JavaScript object literal.
-  final _jsMangledNames;
-  final bool _isInstance;
-  int _cacheLength = 0;
-  Map<String, String>? _cache;
-
-  _LazyReflectiveNamesMap(this._jsMangledNames, this._isInstance);
-
-  Map<String, String> _updateReflectiveNames() {
-    preserveNames();
-    Map<String, String> result = <String, String>{};
-    List keys = JS('List', 'Object.keys(#)', _jsMangledNames);
-    for (String key in keys) {
-      var reflectiveName = JS('var', '#[#]', _jsMangledNames, key);
-      // Filter out all non-string values to protect against polution from
-      // ancillary fields in [_jsMangledNames].
-      bool filter = JS('bool', 'typeof # !== "string"', reflectiveName);
-      if (filter) continue;
-      result[reflectiveName] = JS('String', '#', key);
-
-      String getterPrefix = JS_GET_NAME(JsGetName.GETTER_PREFIX);
-      if (_isInstance && key.startsWith(getterPrefix)) {
-        int getterPrefixLength = getterPrefix.length;
-        String setterPrefix = JS_GET_NAME(JsGetName.SETTER_PREFIX);
-        result['$reflectiveName='] =
-            '$setterPrefix${key.substring(getterPrefixLength)}';
-      }
-    }
-    return result;
-  }
-
-  int get _jsMangledNamesLength =>
-      JS('int', 'Object.keys(#).length', _jsMangledNames);
-
-  String? operator [](String key) {
-    if (_cache == null || _jsMangledNamesLength != _cacheLength) {
-      _cache = _updateReflectiveNames();
-      _cacheLength = _jsMangledNamesLength;
-    }
-    return _cache![key];
-  }
-}
-
-@pragma('dart2js:noInline')
-List extractKeys(victim) {
-  var result = JS('', '# ? Object.keys(#) : []', victim, victim);
-  return new JSArray.markFixed(result);
-}
-
-/// Returns the (global) unmangled version of [name].
-///
-/// Normally, you should use [mangledGlobalNames] directly, but this method
-/// doesn't tell the compiler to preserve names. So this method only returns a
-/// non-null value if some other component has made the compiler preserve names.
-///
-/// This is used, for example, to return unmangled names from TypeImpl.toString
-/// *if* names are being preserved for other reasons (use of dart:mirrors, for
-/// example).
-String? unmangleGlobalNameIfPreservedAnyways(String name) {
-  var names = JS_EMBEDDED_GLOBAL('', MANGLED_GLOBAL_NAMES);
-  return JS('String|Null', '#', JsCache.fetch(names, name));
-}
-
-String unmangleAllIdentifiersIfPreservedAnyways(String str) {
-  return JS(
-      'String',
-      r'''
-        (function(str, names) {
-          return str.replace(
-              /[^<,> ]+/g,
-              function(m) { return names[m] || m; });
-        })(#, #)''',
-      str,
-      JS_EMBEDDED_GLOBAL('', MANGLED_GLOBAL_NAMES));
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_number.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_number.dart
deleted file mode 100644
index 489da64..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_number.dart
+++ /dev/null
@@ -1,707 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _interceptors;
-
-/// The super interceptor class for [JSInt] and [JSDouble]. The compiler
-/// recognizes this class as an interceptor, and changes references to
-/// [:this:] to actually use the receiver of the method, which is
-/// generated as an extra argument added to each member.
-///
-/// Note that none of the methods here delegate to a method defined on JSInt or
-/// JSDouble.  This is exploited in [tryComputeConstantInterceptor].
-class JSNumber extends Interceptor implements double {
-  const JSNumber();
-
-  int compareTo(num b) {
-    if (b is! num) throw argumentErrorValue(b);
-    if (this < b) {
-      return -1;
-    } else if (this > b) {
-      return 1;
-    } else if (this == b) {
-      if (this == 0) {
-        bool bIsNegative = b.isNegative;
-        if (isNegative == bIsNegative) return 0;
-        if (isNegative) return -1;
-        return 1;
-      }
-      return 0;
-    } else if (isNaN) {
-      if (b.isNaN) {
-        return 0;
-      }
-      return 1;
-    } else {
-      return -1;
-    }
-  }
-
-  bool get isNegative => (this == 0) ? (1 / this) < 0 : this < 0;
-
-  bool get isNaN => JS(
-      'returns:bool;effects:none;depends:none;throws:never;gvn:true',
-      r'isNaN(#)',
-      this);
-
-  bool get isInfinite {
-    return JS('bool', r'# == (1/0)', this) || JS('bool', r'# == (-1/0)', this);
-  }
-
-  bool get isFinite => JS(
-      'returns:bool;effects:none;depends:none;throws:never;gvn:true',
-      r'isFinite(#)',
-      this);
-
-  JSNumber remainder(num b) {
-    if (b is! num) throw argumentErrorValue(b);
-    return JS('num', r'# % #', this, b);
-  }
-
-  // Use invoke_dynamic_specializer instead of inlining.
-  @pragma('dart2js:noInline')
-  JSNumber abs() => JS(
-      'returns:num;effects:none;depends:none;throws:never;gvn:true',
-      r'Math.abs(#)',
-      this);
-
-  JSNumber get sign => (this > 0 ? 1 : this < 0 ? -1 : this) as JSNumber;
-
-  static const int _MIN_INT32 = -0x80000000;
-  static const int _MAX_INT32 = 0x7FFFFFFF;
-
-  int toInt() {
-    if (this >= _MIN_INT32 && this <= _MAX_INT32) {
-      // 0 and -0.0 handled here.
-      return JS('int', '# | 0', this);
-    }
-    if (JS('bool', r'isFinite(#)', this)) {
-      return JS('int', r'# + 0', truncateToDouble()); // Converts -0.0 to +0.0.
-    }
-    // [this] is either NaN, Infinity or -Infinity.
-    throw new UnsupportedError(JS('String', '"" + # + ".toInt()"', this));
-  }
-
-  int truncate() => toInt();
-
-  int ceil() {
-    if (this >= 0) {
-      if (this <= _MAX_INT32) {
-        int truncated = JS('int', '# | 0', this); // converts -0.0 to 0.
-        return this == truncated ? truncated : truncated + 1;
-      }
-    } else {
-      if (this >= _MIN_INT32) {
-        return JS('int', '# | 0', this);
-      }
-    }
-    var d = JS('num', 'Math.ceil(#)', this);
-    if (JS('bool', r'isFinite(#)', d)) {
-      return JS('int', r'#', d);
-    }
-    // [this] is either NaN, Infinity or -Infinity.
-    throw new UnsupportedError(JS('String', '"" + # + ".ceil()"', this));
-  }
-
-  int floor() {
-    if (this >= 0) {
-      if (this <= _MAX_INT32) {
-        return JS('int', '# | 0', this);
-      }
-    } else {
-      if (this >= _MIN_INT32) {
-        int truncated = JS('int', '# | 0', this);
-        return this == truncated ? truncated : truncated - 1;
-      }
-    }
-    var d = JS('num', 'Math.floor(#)', this);
-    if (JS('bool', r'isFinite(#)', d)) {
-      return JS('int', r'#', d);
-    }
-    // [this] is either NaN, Infinity or -Infinity.
-    throw new UnsupportedError(JS('String', '"" + # + ".floor()"', this));
-  }
-
-  int round() {
-    if (this > 0) {
-      // This path excludes the special cases -0.0, NaN and -Infinity, leaving
-      // only +Infinity, for which a direct test is faster than [isFinite].
-      if (JS('bool', r'# !== (1/0)', this)) {
-        return JS('int', r'Math.round(#)', this);
-      }
-    } else if (JS('bool', '# > (-1/0)', this)) {
-      // This test excludes NaN and -Infinity, leaving only -0.0.
-      //
-      // Subtraction from zero rather than negation forces -0.0 to 0.0 so code
-      // inside Math.round and code to handle result never sees -0.0, which on
-      // some JavaScript VMs can be a slow path.
-      return JS('int', r'0 - Math.round(0 - #)', this);
-    }
-    // [this] is either NaN, Infinity or -Infinity.
-    throw new UnsupportedError(JS('String', '"" + # + ".round()"', this));
-  }
-
-  double ceilToDouble() => JS('num', r'Math.ceil(#)', this);
-
-  double floorToDouble() => JS('num', r'Math.floor(#)', this);
-
-  double roundToDouble() {
-    if (this < 0) {
-      return JS('num', r'-Math.round(-#)', this);
-    } else {
-      return JS('num', r'Math.round(#)', this);
-    }
-  }
-
-  double truncateToDouble() => this < 0 ? ceilToDouble() : floorToDouble();
-
-  num clamp(lowerLimit, upperLimit) {
-    if (lowerLimit is! num) throw argumentErrorValue(lowerLimit);
-    if (upperLimit is! num) throw argumentErrorValue(upperLimit);
-    if (lowerLimit.compareTo(upperLimit) > 0) {
-      throw argumentErrorValue(lowerLimit);
-    }
-    if (this.compareTo(lowerLimit) < 0) return lowerLimit;
-    if (this.compareTo(upperLimit) > 0) return upperLimit;
-    return this;
-  }
-
-  // The return type is intentionally omitted to avoid type checker warnings
-  // from assigning JSNumber to double.
-  toDouble() => this;
-
-  String toStringAsFixed(int fractionDigits) {
-    checkInt(fractionDigits);
-    if (fractionDigits < 0 || fractionDigits > 20) {
-      throw new RangeError.range(fractionDigits, 0, 20, 'fractionDigits');
-    }
-    String result = JS('String', r'#.toFixed(#)', this, fractionDigits);
-    if (this == 0 && isNegative) return '-$result';
-    return result;
-  }
-
-  String toStringAsExponential([int? fractionDigits]) {
-    String result;
-    if (fractionDigits != null) {
-      checkInt(fractionDigits);
-      if (fractionDigits < 0 || fractionDigits > 20) {
-        throw new RangeError.range(fractionDigits, 0, 20, 'fractionDigits');
-      }
-      result = JS('String', r'#.toExponential(#)', this, fractionDigits);
-    } else {
-      result = JS('String', r'#.toExponential()', this);
-    }
-    if (this == 0 && isNegative) return '-$result';
-    return result;
-  }
-
-  String toStringAsPrecision(int precision) {
-    checkInt(precision);
-    if (precision < 1 || precision > 21) {
-      throw new RangeError.range(precision, 1, 21, 'precision');
-    }
-    String result = JS('String', r'#.toPrecision(#)', this, precision);
-    if (this == 0 && isNegative) return '-$result';
-    return result;
-  }
-
-  String toRadixString(int radix) {
-    checkInt(radix);
-    if (radix < 2 || radix > 36) {
-      throw new RangeError.range(radix, 2, 36, 'radix');
-    }
-    String result = JS('String', r'#.toString(#)', this, radix);
-    const int rightParenCode = 0x29;
-    if (result.codeUnitAt(result.length - 1) != rightParenCode) {
-      return result;
-    }
-    return _handleIEtoString(result);
-  }
-
-  static String _handleIEtoString(String result) {
-    // Result is probably IE's untraditional format for large numbers,
-    // e.g., "8.0000000000008(e+15)" for 0x8000000000000800.toString(16).
-    var match = JS('JSArray|Null',
-        r'/^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(#)', result);
-    if (match == null) {
-      // Then we don't know how to handle it at all.
-      throw new UnsupportedError('Unexpected toString result: $result');
-    }
-    result = JS('String', '#', match[1]);
-    int exponent = JS('int', '+#', match[3]);
-    if (match[2] != null) {
-      result = JS('String', '# + #', result, match[2]);
-      exponent -= JS<int>('int', '#.length', match[2]);
-    }
-    return result + '0' * exponent;
-  }
-
-  // Note: if you change this, also change the function [S].
-  String toString() {
-    if (this == 0 && JS('bool', '(1 / #) < 0', this)) {
-      return '-0.0';
-    } else {
-      return JS('String', r'"" + (#)', this);
-    }
-  }
-
-  int get hashCode {
-    int intValue = JS('int', '# | 0', this);
-    // Fast exit for integers in signed 32-bit range. Masking converts -0.0 to 0
-    // and ensures that result fits in JavaScript engine's Smi range.
-    if (this == intValue) return 0x1FFFFFFF & intValue;
-
-    // We would like to access the exponent and mantissa as integers but there
-    // are no JavaScript operations that do this, so use log2-floor-pow-divide
-    // to extract the values.
-    num absolute = JS('num', 'Math.abs(#)', this);
-    num lnAbsolute = JS('num', 'Math.log(#)', absolute);
-    num log2 = lnAbsolute / ln2;
-    // Floor via '# | 0' converts NaN to zero so the final result is not NaN.
-    int floorLog2 = JS('int', '# | 0', log2);
-    num factor = JS('num', 'Math.pow(2, #)', floorLog2);
-    num scaled = absolute < 1 ? absolute / factor : factor / absolute;
-    // [scaled] is in the range [0.5, 1].
-
-    // Multiply and truncate to pick up all the mantissa bits. Multiplying by
-    // 0x20000000000000 (which has 53 zero bits) converts the mantissa into an
-    // integer. There are interesting subsets where all the bit variance is in
-    // the most significant bits of the mantissa (e.g. 0.5, 0.625, 0.75), so we
-    // need to mix in the most significant bits. We do this by scaling with a
-    // constant that has many bits set to use the multiplier to mix in bits from
-    // all over the mantissa into low positions.
-    num rescaled1 = scaled * 0x20000000000000;
-    num rescaled2 = scaled * 0x0C95A6C285A6C9;
-    int d1 = JS('int', '# | 0', rescaled1);
-    int d2 = JS('int', '# | 0', rescaled2);
-    // Mix in exponent to distinguish e.g. 1.25 from 2.5.
-    int d3 = floorLog2;
-    int h = 0x1FFFFFFF & ((d1 + d2) * (601 * 997) + d3 * (1259));
-    return h;
-  }
-
-  JSNumber operator -() => JS('num', r'-#', this);
-
-  JSNumber operator +(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('num', '# + #', this, other);
-  }
-
-  JSNumber operator -(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('num', '# - #', this, other);
-  }
-
-  double operator /(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('num', '# / #', this, other);
-  }
-
-  JSNumber operator *(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('num', '# * #', this, other);
-  }
-
-  JSNumber operator %(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    // Euclidean Modulo.
-    JSNumber result = JS<JSNumber>('JSNumber', r'# % #', this, other);
-    if (result == 0) return JS('num', '0'); // Make sure we don't return -0.0.
-    if (result > 0) return result;
-    if (JS('num', '#', other) < 0) {
-      return result - JS<JSNumber>('JSNumber', '#', other);
-    } else {
-      return result + JS<JSNumber>('JSNumber', '#', other);
-    }
-  }
-
-  bool _isInt32(value) => JS('bool', '(# | 0) === #', value, value);
-
-  int operator ~/(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    if (false) _tdivFast(other); // Ensure resolution.
-    if (_isInt32(this)) {
-      if (other >= 1 || other < -1) {
-        return JS('int', r'(# / #) | 0', this, other);
-      }
-    }
-    return _tdivSlow(other);
-  }
-
-  int _tdivFast(num other) {
-    // [other] is known to be a number outside the range [-1, 1).
-    return _isInt32(this)
-        ? JS('int', r'(# / #) | 0', this, other)
-        : _tdivSlow(other);
-  }
-
-  int _tdivSlow(num other) {
-    var quotient = JS('num', r'# / #', this, other);
-    if (quotient >= _MIN_INT32 && quotient <= _MAX_INT32) {
-      // This path includes -0.0 and +0.0.
-      return JS('int', '# | 0', quotient);
-    }
-    if (quotient > 0) {
-      // This path excludes the special cases -0.0, NaN and -Infinity, leaving
-      // only +Infinity, for which a direct test is faster than [isFinite].
-      if (JS('bool', r'# !== (1/0)', quotient)) {
-        return JS('int', r'Math.floor(#)', quotient);
-      }
-    } else if (JS('bool', '# > (-1/0)', quotient)) {
-      // This test excludes NaN and -Infinity.
-      return JS('int', r'Math.ceil(#)', quotient);
-    }
-
-    // [quotient] is either NaN, Infinity or -Infinity.
-    throw new UnsupportedError(
-        'Result of truncating division is $quotient: $this ~/ $other');
-  }
-
-  // TODO(ngeoffray): Move the bit operations below to [JSInt] and
-  // make them take an int. Because this will make operations slower,
-  // we define these methods on number for now but we need to decide
-  // the grain at which we do the type checks.
-
-  num operator <<(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    if (JS('num', '#', other) < 0) throw argumentErrorValue(other);
-    return _shlPositive(other);
-  }
-
-  num _shlPositive(num other) {
-    // JavaScript only looks at the last 5 bits of the shift-amount. Shifting
-    // by 33 is hence equivalent to a shift by 1.
-    return JS('bool', r'# > 31', other)
-        ? 0
-        : JS('JSUInt32', r'(# << #) >>> 0', this, other);
-  }
-
-  num operator >>(num other) {
-    if (false) _shrReceiverPositive(other);
-    if (other is! num) throw argumentErrorValue(other);
-    if (JS('num', '#', other) < 0) throw argumentErrorValue(other);
-    return _shrOtherPositive(other);
-  }
-
-  num _shrOtherPositive(num other) {
-    return JS('num', '#', this) > 0
-        ? _shrBothPositive(other)
-        // For negative numbers we just clamp the shift-by amount.
-        // `this` could be negative but not have its 31st bit set.
-        // The ">>" would then shift in 0s instead of 1s. Therefore
-        // we cannot simply return 0xFFFFFFFF.
-        : JS('JSUInt32', r'(# >> #) >>> 0', this, other > 31 ? 31 : other);
-  }
-
-  num _shrReceiverPositive(num other) {
-    if (JS('num', '#', other) < 0) throw argumentErrorValue(other);
-    return _shrBothPositive(other);
-  }
-
-  num _shrBothPositive(num other) {
-    return JS('bool', r'# > 31', other)
-        // JavaScript only looks at the last 5 bits of the shift-amount. In JS
-        // shifting by 33 is hence equivalent to a shift by 1. Shortcut the
-        // computation when that happens.
-        ? 0
-        // Given that `this` is positive we must not use '>>'. Otherwise a
-        // number that has the 31st bit set would be treated as negative and
-        // shift in ones.
-        : JS('JSUInt32', r'# >>> #', this, other);
-  }
-
-  num operator &(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('JSUInt32', r'(# & #) >>> 0', this, other);
-  }
-
-  num operator |(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('JSUInt32', r'(# | #) >>> 0', this, other);
-  }
-
-  num operator ^(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('JSUInt32', r'(# ^ #) >>> 0', this, other);
-  }
-
-  bool operator <(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('bool', '# < #', this, other);
-  }
-
-  bool operator >(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('bool', '# > #', this, other);
-  }
-
-  bool operator <=(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('bool', '# <= #', this, other);
-  }
-
-  bool operator >=(num other) {
-    if (other is! num) throw argumentErrorValue(other);
-    return JS('bool', '# >= #', this, other);
-  }
-
-  Type get runtimeType => num;
-}
-
-/// The interceptor class for [int]s.
-///
-/// This class implements double (indirectly through JSNumber) since in
-/// JavaScript all numbers are doubles, so while we want to treat `2.0` as an
-/// integer for some operations, its interceptor should answer `true` to `is
-/// double`.
-class JSInt extends JSNumber implements int {
-  const JSInt();
-
-  @override
-  // Use invoke_dynamic_specializer instead of inlining.
-  @pragma('dart2js:noInline')
-  JSInt abs() => JS(
-      'returns:int;effects:none;depends:none;throws:never;gvn:true',
-      r'Math.abs(#)',
-      this);
-
-  @override
-  JSInt get sign => (this > 0 ? 1 : this < 0 ? -1 : this) as JSInt;
-
-  @override
-  JSInt operator -() => JS('int', r'-#', this);
-
-  bool get isEven => (this & 1) == 0;
-
-  bool get isOdd => (this & 1) == 1;
-
-  int toUnsigned(int width) {
-    return this & ((1 << width) - 1);
-  }
-
-  int toSigned(int width) {
-    int signMask = 1 << (width - 1);
-    return (this & (signMask - 1)) - (this & signMask);
-  }
-
-  int get bitLength {
-    int nonneg = (this < 0 ? -this - 1 : this) as int;
-    int wordBits = 32;
-    while (nonneg >= 0x100000000) {
-      nonneg = nonneg ~/ 0x100000000;
-      wordBits += 32;
-    }
-    return wordBits - _clz32(nonneg);
-  }
-
-  static int _clz32(int uint32) {
-    // TODO(sra): Use `Math.clz32(uint32)` (not available on IE11).
-    return 32 - _bitCount(_spread(uint32));
-  }
-
-  // Returns pow(this, e) % m.
-  int modPow(int e, int m) {
-    if (e is! int) {
-      throw ArgumentError.value(e, 'exponent', 'not an integer');
-    }
-    if (m is! int) {
-      throw ArgumentError.value(m, 'modulus', 'not an integer');
-    }
-    if (e < 0) throw RangeError.range(e, 0, null, 'exponent');
-    if (m <= 0) throw RangeError.range(m, 1, null, 'modulus');
-    if (e == 0) return 1;
-
-    const int maxPreciseInteger = 9007199254740991;
-
-    // Reject inputs that are outside the range of integer values that can be
-    // represented precisely as a Number (double).
-    if (this < -maxPreciseInteger || this > maxPreciseInteger) {
-      throw RangeError.range(
-          this, -maxPreciseInteger, maxPreciseInteger, 'receiver');
-    }
-    if (e > maxPreciseInteger) {
-      throw RangeError.range(e, 0, maxPreciseInteger, 'exponent');
-    }
-    if (m > maxPreciseInteger) {
-      throw RangeError.range(e, 1, maxPreciseInteger, 'modulus');
-    }
-
-    // This is floor(sqrt(maxPreciseInteger)).
-    const int maxValueThatCanBeSquaredWithoutTruncation = 94906265;
-    if (m > maxValueThatCanBeSquaredWithoutTruncation) {
-      // Use BigInt version to avoid truncation in multiplications below. The
-      // 'maxPreciseInteger' check on [m] ensures that toInt() does not round.
-      return BigInt.from(this).modPow(BigInt.from(e), BigInt.from(m)).toInt();
-    }
-
-    int b = this;
-    if (b < 0 || b > m) {
-      b %= m;
-    }
-    int r = 1;
-    while (e > 0) {
-      if (e.isOdd) {
-        r = (r * b) % m;
-      }
-      e ~/= 2;
-      b = (b * b) % m;
-    }
-    return r;
-  }
-
-  // If inv is false, returns gcd(x, y).
-  // If inv is true and gcd(x, y) = 1, returns d, so that c*x + d*y = 1.
-  // If inv is true and gcd(x, y) != 1, throws Exception("Not coprime").
-  static int _binaryGcd(int x, int y, bool inv) {
-    int s = 1;
-    if (!inv) {
-      while (x.isEven && y.isEven) {
-        x ~/= 2;
-        y ~/= 2;
-        s *= 2;
-      }
-      if (y.isOdd) {
-        var t = x;
-        x = y;
-        y = t;
-      }
-    }
-    final bool ac = x.isEven;
-    int u = x;
-    int v = y;
-    int a = 1, b = 0, c = 0, d = 1;
-    do {
-      while (u.isEven) {
-        u ~/= 2;
-        if (ac) {
-          if (!a.isEven || !b.isEven) {
-            a += y;
-            b -= x;
-          }
-          a ~/= 2;
-        } else if (!b.isEven) {
-          b -= x;
-        }
-        b ~/= 2;
-      }
-      while (v.isEven) {
-        v ~/= 2;
-        if (ac) {
-          if (!c.isEven || !d.isEven) {
-            c += y;
-            d -= x;
-          }
-          c ~/= 2;
-        } else if (!d.isEven) {
-          d -= x;
-        }
-        d ~/= 2;
-      }
-      if (u >= v) {
-        u -= v;
-        if (ac) a -= c;
-        b -= d;
-      } else {
-        v -= u;
-        if (ac) c -= a;
-        d -= b;
-      }
-    } while (u != 0);
-    if (!inv) return s * v;
-    if (v != 1) throw new Exception('Not coprime');
-    if (d < 0) {
-      d += x;
-      if (d < 0) d += x;
-    } else if (d > x) {
-      d -= x;
-      if (d > x) d -= x;
-    }
-    return d;
-  }
-
-  // Returns 1/this % m, with m > 0.
-  int modInverse(int m) {
-    if (m is! int) {
-      throw new ArgumentError.value(m, 'modulus', 'not an integer');
-    }
-    if (m <= 0) throw new RangeError.range(m, 1, null, 'modulus');
-    if (m == 1) return 0;
-    int t = this;
-    if ((t < 0) || (t >= m)) t %= m;
-    if (t == 1) return 1;
-    if ((t == 0) || (t.isEven && m.isEven)) {
-      throw new Exception('Not coprime');
-    }
-    return _binaryGcd(m, t, true);
-  }
-
-  // Returns gcd of abs(this) and abs(other).
-  int gcd(int other) {
-    if (other is! int) {
-      throw new ArgumentError.value(other, 'other', 'not an integer');
-    }
-    int x = this.abs();
-    int y = other.abs();
-    if (x == 0) return y;
-    if (y == 0) return x;
-    if ((x == 1) || (y == 1)) return 1;
-    return _binaryGcd(x, y, false);
-  }
-
-  // Assumes i is <= 32-bit and unsigned.
-  static int _bitCount(int i) {
-    // See "Hacker's Delight", section 5-1, "Counting 1-Bits".
-
-    // The basic strategy is to use "divide and conquer" to
-    // add pairs (then quads, etc.) of bits together to obtain
-    // sub-counts.
-    //
-    // A straightforward approach would look like:
-    //
-    // i = (i & 0x55555555) + ((i >>  1) & 0x55555555);
-    // i = (i & 0x33333333) + ((i >>  2) & 0x33333333);
-    // i = (i & 0x0F0F0F0F) + ((i >>  4) & 0x0F0F0F0F);
-    // i = (i & 0x00FF00FF) + ((i >>  8) & 0x00FF00FF);
-    // i = (i & 0x0000FFFF) + ((i >> 16) & 0x0000FFFF);
-    //
-    // The code below removes unnecessary &'s and uses a
-    // trick to remove one instruction in the first line.
-
-    i = _shru(i, 0) - (_shru(i, 1) & 0x55555555);
-    i = (i & 0x33333333) + (_shru(i, 2) & 0x33333333);
-    i = 0x0F0F0F0F & (i + _shru(i, 4));
-    i += _shru(i, 8);
-    i += _shru(i, 16);
-    return (i & 0x0000003F);
-  }
-
-  static int _shru(int value, int shift) => JS('int', '# >>> #', value, shift);
-  static int _shrs(int value, int shift) => JS('int', '# >> #', value, shift);
-  static int _ors(int a, int b) => JS('int', '# | #', a, b);
-
-  // Assumes i is <= 32-bit
-  static int _spread(int i) {
-    i = _ors(i, _shrs(i, 1));
-    i = _ors(i, _shrs(i, 2));
-    i = _ors(i, _shrs(i, 4));
-    i = _ors(i, _shrs(i, 8));
-    i = _shru(_ors(i, _shrs(i, 16)), 0);
-    return i;
-  }
-
-  Type get runtimeType => int;
-
-  int operator ~() => JS('JSUInt32', r'(~#) >>> 0', this);
-}
-
-class JSDouble extends JSNumber implements double {
-  const JSDouble();
-  Type get runtimeType => double;
-}
-
-class JSPositiveInt extends JSInt {}
-
-class JSUInt32 extends JSPositiveInt {}
-
-class JSUInt31 extends JSUInt32 {}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_patch.dart
deleted file mode 100644
index 1ff2e55..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_patch.dart
+++ /dev/null
@@ -1,568 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Patch file for dart:js library.
-import 'dart:collection' show HashMap, ListMixin;
-import 'dart:typed_data' show TypedData;
-
-import 'dart:_foreign_helper' show JS, DART_CLOSURE_TO_JS;
-import 'dart:_interceptors' show DART_CLOSURE_PROPERTY_NAME;
-import 'dart:_js_helper' show patch, Primitives, getIsolateAffinityTag;
-import 'dart:_js' show isBrowserObject, convertFromBrowserObject;
-
-@patch
-JsObject get context => _context;
-
-final JsObject _context = _castToJsObject(_wrapToDart(JS('', 'self')));
-
-_convertDartFunction(Function f, {bool captureThis: false}) {
-  return JS(
-      'JavaScriptFunction',
-      '''
-        function(_call, f, captureThis) {
-          return function() {
-            return _call(f, captureThis, this,
-                Array.prototype.slice.apply(arguments));
-          }
-        }(#, #, #)
-      ''',
-      DART_CLOSURE_TO_JS(_callDartFunction),
-      f,
-      captureThis);
-}
-
-_callDartFunction(callback, bool captureThis, self, List arguments) {
-  if (captureThis) {
-    arguments = [self]..addAll(arguments);
-  }
-  var dartArgs = List.from(arguments.map(_convertToDart));
-  return _convertToJS(Function.apply(callback, dartArgs));
-}
-
-@patch
-class JsObject {
-  // The wrapped JS object.
-  final Object _jsObject;
-
-  // This should only be called from _wrapToDart
-  JsObject._fromJs(this._jsObject) {
-    assert(_jsObject != null);
-  }
-
-  @patch
-  factory JsObject(JsFunction constructor, [List? arguments]) {
-    var ctor = _convertToJS(constructor);
-    if (arguments == null) {
-      return _castToJsObject(_wrapToDart(JS('', 'new #()', ctor)));
-    }
-
-    if (JS('bool', '# instanceof Array', arguments)) {
-      int argumentCount = JS('int', '#.length', arguments);
-      switch (argumentCount) {
-        case 0:
-          return _castToJsObject(_wrapToDart(JS('', 'new #()', ctor)));
-
-        case 1:
-          var arg0 = _convertToJS(JS('', '#[0]', arguments));
-          return _castToJsObject(_wrapToDart(JS('', 'new #(#)', ctor, arg0)));
-
-        case 2:
-          var arg0 = _convertToJS(JS('', '#[0]', arguments));
-          var arg1 = _convertToJS(JS('', '#[1]', arguments));
-          return _castToJsObject(
-              _wrapToDart(JS('', 'new #(#, #)', ctor, arg0, arg1)));
-
-        case 3:
-          var arg0 = _convertToJS(JS('', '#[0]', arguments));
-          var arg1 = _convertToJS(JS('', '#[1]', arguments));
-          var arg2 = _convertToJS(JS('', '#[2]', arguments));
-          return _castToJsObject(
-              _wrapToDart(JS('', 'new #(#, #, #)', ctor, arg0, arg1, arg2)));
-
-        case 4:
-          var arg0 = _convertToJS(JS('', '#[0]', arguments));
-          var arg1 = _convertToJS(JS('', '#[1]', arguments));
-          var arg2 = _convertToJS(JS('', '#[2]', arguments));
-          var arg3 = _convertToJS(JS('', '#[3]', arguments));
-          return _castToJsObject(_wrapToDart(
-              JS('', 'new #(#, #, #, #)', ctor, arg0, arg1, arg2, arg3)));
-      }
-    }
-
-    // The following code solves the problem of invoking a JavaScript
-    // constructor with an unknown number arguments.
-    // First bind the constructor to the argument list using bind.apply().
-    // The first argument to bind() is the binding of 'this', so add 'null' to
-    // the arguments list passed to apply().
-    // After that, use the JavaScript 'new' operator which overrides any binding
-    // of 'this' with the new instance.
-    var args = <Object?>[null]..addAll(arguments.map(_convertToJS));
-    var factoryFunction = JS('', '#.bind.apply(#, #)', ctor, ctor, args);
-    // Without this line, calling factoryFunction as a constructor throws
-    JS('String', 'String(#)', factoryFunction);
-    // This could return an UnknownJavaScriptObject, or a native
-    // object for which there is an interceptor
-    var jsObj = JS('', 'new #()', factoryFunction);
-
-    return _castToJsObject(_wrapToDart(jsObj));
-
-    // TODO(sra): Investigate:
-    //
-    //     var jsObj = JS('', 'Object.create(#.prototype)', ctor);
-    //     JS('', '#.apply(#, #)', ctor, jsObj,
-    //         []..addAll(arguments.map(_convertToJS)));
-    //     return _wrapToDart(jsObj);
-  }
-
-  @patch
-  factory JsObject.fromBrowserObject(Object object) {
-    if (object is num || object is String || object is bool || object == null) {
-      throw ArgumentError("object cannot be a num, string, bool, or null");
-    }
-    return _castToJsObject(_wrapToDart(_convertToJS(object)));
-  }
-
-  @patch
-  factory JsObject.jsify(Object object) {
-    if ((object is! Map) && (object is! Iterable)) {
-      throw ArgumentError("object must be a Map or Iterable");
-    }
-    return _castToJsObject(_wrapToDart(_convertDataTree(object)));
-  }
-
-  static _convertDataTree(Object data) {
-    var _convertedObjects = HashMap.identity();
-
-    _convert(Object? o) {
-      if (_convertedObjects.containsKey(o)) {
-        return _convertedObjects[o];
-      }
-      if (o is Map) {
-        final convertedMap = JS('=Object', '{}');
-        _convertedObjects[o] = convertedMap;
-        for (var key in o.keys) {
-          JS('=Object', '#[#] = #', convertedMap, key, _convert(o[key]));
-        }
-        return convertedMap;
-      } else if (o is Iterable) {
-        var convertedList = [];
-        _convertedObjects[o] = convertedList;
-        convertedList.addAll(o.map(_convert));
-        return convertedList;
-      } else {
-        return _convertToJS(o);
-      }
-    }
-
-    return _convert(data);
-  }
-
-  @patch
-  dynamic operator [](Object property) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    return _convertToDart(JS('', '#[#]', _jsObject, property));
-  }
-
-  @patch
-  void operator []=(Object property, Object? value) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    JS('', '#[#] = #', _jsObject, property, _convertToJS(value));
-  }
-
-  @patch
-  bool operator ==(Object other) =>
-      other is JsObject && JS('bool', '# === #', _jsObject, other._jsObject);
-
-  @patch
-  bool hasProperty(Object property) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    return JS('bool', '# in #', property, _jsObject);
-  }
-
-  @patch
-  void deleteProperty(Object property) {
-    if (property is! String && property is! num) {
-      throw ArgumentError("property is not a String or num");
-    }
-    JS('bool', 'delete #[#]', _jsObject, property);
-  }
-
-  @patch
-  bool instanceof(JsFunction type) {
-    return JS('bool', '# instanceof #', _jsObject, _convertToJS(type));
-  }
-
-  @patch
-  String toString() {
-    try {
-      return JS('String', 'String(#)', _jsObject);
-    } catch (e) {
-      return super.toString();
-    }
-  }
-
-  @patch
-  dynamic callMethod(Object method, [List? args]) {
-    if (method is! String && method is! num) {
-      throw ArgumentError("method is not a String or num");
-    }
-    return _convertToDart(JS('', '#[#].apply(#, #)', _jsObject, method,
-        _jsObject, args == null ? null : List.from(args.map(_convertToJS))));
-  }
-}
-
-@patch
-class JsFunction extends JsObject {
-  @patch
-  factory JsFunction.withThis(Function f) {
-    var jsFunc = _convertDartFunction(f, captureThis: true);
-    return JsFunction._fromJs(jsFunc);
-  }
-
-  JsFunction._fromJs(Object jsObject) : super._fromJs(jsObject);
-
-  @patch
-  dynamic apply(List args, {thisArg}) => _convertToDart(JS(
-      '',
-      '#.apply(#, #)',
-      _jsObject,
-      _convertToJS(thisArg),
-      args == null ? null : List.from(args.map(_convertToJS))));
-}
-
-@patch
-class JsArray<E> extends JsObject with ListMixin<E> {
-  @patch
-  factory JsArray() => JsArray<E>._fromJs([]);
-
-  @patch
-  factory JsArray.from(Iterable<E> other) =>
-      JsArray<E>._fromJs([]..addAll(other.map(_convertToJS)));
-
-  JsArray._fromJs(Object jsObject) : super._fromJs(jsObject);
-
-  _checkIndex(int index) {
-    if (index is int && (index < 0 || index >= length)) {
-      throw RangeError.range(index, 0, length);
-    }
-  }
-
-  _checkInsertIndex(int index) {
-    if (index is int && (index < 0 || index >= length + 1)) {
-      throw RangeError.range(index, 0, length);
-    }
-  }
-
-  static _checkRange(int start, int end, int length) {
-    if (start < 0 || start > length) {
-      throw RangeError.range(start, 0, length);
-    }
-    if (end < start || end > length) {
-      throw RangeError.range(end, start, length);
-    }
-  }
-
-  // Methods required by ListMixin
-
-  @patch
-  E operator [](Object index) {
-    if (index is int) {
-      _checkIndex(index);
-    }
-    return super[index];
-  }
-
-  @patch
-  void operator []=(Object index, Object? value) {
-    if (index is int) {
-      _checkIndex(index);
-    }
-    super[index] = value;
-  }
-
-  @patch
-  int get length {
-    // Check the length honours the List contract.
-    var len = JS('', '#.length', _jsObject);
-    // JavaScript arrays have lengths which are unsigned 32-bit integers.
-    if (JS('bool', 'typeof # === "number" && (# >>> 0) === #', len, len, len)) {
-      return JS('int', '#', len);
-    }
-    throw StateError('Bad JsArray length');
-  }
-
-  @patch
-  void set length(int length) {
-    super['length'] = length;
-  }
-
-  // Methods overridden for better performance
-
-  @patch
-  void add(E value) {
-    callMethod('push', [value]);
-  }
-
-  @patch
-  void addAll(Iterable<E> iterable) {
-    var list = (JS('bool', '# instanceof Array', iterable))
-        ? JS<List>('JSArray', '#', iterable)
-        : List.from(iterable);
-    callMethod('push', list);
-  }
-
-  @patch
-  void insert(int index, E element) {
-    _checkInsertIndex(index);
-    callMethod('splice', [index, 0, element]);
-  }
-
-  @patch
-  E removeAt(int index) {
-    _checkIndex(index);
-    return callMethod('splice', [index, 1])[0];
-  }
-
-  @patch
-  E removeLast() {
-    if (length == 0) throw RangeError(-1);
-    return callMethod('pop');
-  }
-
-  @patch
-  void removeRange(int start, int end) {
-    _checkRange(start, end, length);
-    callMethod('splice', [start, end - start]);
-  }
-
-  @patch
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    _checkRange(start, end, this.length);
-    int length = end - start;
-    if (length == 0) return;
-    if (skipCount < 0) throw ArgumentError(skipCount);
-    var args = <Object?>[start, length]
-      ..addAll(iterable.skip(skipCount).take(length));
-    callMethod('splice', args);
-  }
-
-  @patch
-  void sort([int compare(E a, E b)?]) {
-    // Note: arr.sort(null) is a type error in FF
-    callMethod('sort', compare == null ? [] : [compare]);
-  }
-}
-
-// property added to a Dart object referencing its JS-side DartObject proxy
-final String _DART_OBJECT_PROPERTY_NAME =
-    getIsolateAffinityTag(r'_$dart_dartObject');
-
-// property added to a JS object referencing its Dart-side JsObject proxy
-const _JS_OBJECT_PROPERTY_NAME = r'_$dart_jsObject';
-const _JS_FUNCTION_PROPERTY_NAME = r'$dart_jsFunction';
-const _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS = r'_$dart_jsFunctionCaptureThis';
-
-@pragma('dart2js:tryInline')
-JsObject _castToJsObject(o) => JS<JsObject>('', '#', o);
-
-bool _defineProperty(o, String name, value) {
-  try {
-    if (_isExtensible(o) &&
-        // TODO(ahe): Calling _hasOwnProperty to work around
-        // https://code.google.com/p/dart/issues/detail?id=21331.
-        !_hasOwnProperty(o, name)) {
-      JS('void', 'Object.defineProperty(#, #, { value: #})', o, name, value);
-      return true;
-    }
-  } catch (e) {
-    // object is native and lies about being extensible
-    // see https://bugzilla.mozilla.org/show_bug.cgi?id=775185
-    // Or, isExtensible throws for this object.
-  }
-  return false;
-}
-
-bool _hasOwnProperty(o, String name) {
-  return JS('bool', 'Object.prototype.hasOwnProperty.call(#, #)', o, name);
-}
-
-bool _isExtensible(o) => JS('bool', 'Object.isExtensible(#)', o);
-
-Object? _getOwnProperty(o, String name) {
-  if (_hasOwnProperty(o, name)) {
-    return JS('', '#[#]', o, name);
-  }
-  return null;
-}
-
-bool _isLocalObject(o) => JS('bool', '# instanceof Object', o);
-
-// The shared constructor function for proxies to Dart objects in JavaScript.
-final _dartProxyCtor = JS('', 'function DartObject(o) { this.o = o; }');
-
-Object? _convertToJS(Object? o) {
-  // Note: we don't write `if (o == null) return null;` to make sure dart2js
-  // doesn't convert `return null;` into `return;` (which would make `null` be
-  // `undefined` in Javascprit). See dartbug.com/20305 for details.
-  if (o == null || o is String || o is num || o is bool) {
-    return o;
-  }
-  if (o is JsObject) {
-    return o._jsObject;
-  }
-  if (isBrowserObject(o)) {
-    return o;
-  }
-  if (o is TypedData) {
-    return o;
-  }
-  if (o is DateTime) {
-    return Primitives.lazyAsJsDate(o);
-  }
-  if (o is Function) {
-    return _getJsProxy(o, _JS_FUNCTION_PROPERTY_NAME, (o) {
-      var jsFunction = _convertDartFunction(o);
-      // set a property on the JS closure referencing the Dart closure
-      _defineProperty(jsFunction, DART_CLOSURE_PROPERTY_NAME, o);
-      return jsFunction;
-    });
-  }
-  var ctor = _dartProxyCtor;
-  return _getJsProxy(
-      o, _JS_OBJECT_PROPERTY_NAME, (o) => JS('', 'new #(#)', ctor, o));
-}
-
-Object? _getJsProxy(o, String propertyName, createProxy(o)) {
-  var jsProxy = _getOwnProperty(o, propertyName);
-  if (jsProxy == null) {
-    jsProxy = createProxy(o);
-    _defineProperty(o, propertyName, jsProxy);
-  }
-  return jsProxy;
-}
-
-// converts a Dart object to a reference to a native JS object
-// which might be a DartObject JS->Dart proxy
-Object? _convertToDart(o) {
-  if (JS('bool', '# == null', o) ||
-      JS('bool', 'typeof # == "string"', o) ||
-      JS('bool', 'typeof # == "number"', o) ||
-      JS('bool', 'typeof # == "boolean"', o)) {
-    return o;
-  } else if (_isLocalObject(o) && isBrowserObject(o)) {
-    return convertFromBrowserObject(o);
-  } else if (_isLocalObject(o) && o is TypedData) {
-    return JS('TypedData', '#', o);
-  } else if (JS('bool', '# instanceof Date', o)) {
-    var ms = JS('num', '#.getTime()', o);
-    return DateTime.fromMillisecondsSinceEpoch(ms);
-  } else if (JS('bool', '#.constructor === #', o, _dartProxyCtor)) {
-    return JS('', '#.o', o);
-  } else {
-    return _wrapToDart(o);
-  }
-}
-
-Object _wrapToDart(o) {
-  if (JS('bool', 'typeof # == "function"', o)) {
-    return _getDartProxy(
-        o, DART_CLOSURE_PROPERTY_NAME, (o) => JsFunction._fromJs(o));
-  }
-  if (JS('bool', '# instanceof Array', o)) {
-    return _getDartProxy(
-        o, _DART_OBJECT_PROPERTY_NAME, (o) => JsArray._fromJs(o));
-  }
-  return _getDartProxy(
-      o, _DART_OBJECT_PROPERTY_NAME, (o) => JsObject._fromJs(o));
-}
-
-Object _getDartProxy(o, String propertyName, JsObject createProxy(o)) {
-  var dartProxy = _getOwnProperty(o, propertyName);
-  // Temporary fix for dartbug.com/15193
-  // In some cases it's possible to see a JavaScript object that
-  // came from a different context and was previously proxied to
-  // Dart in that context. The JS object will have a cached proxy
-  // but it won't be a valid Dart object in this context.
-  // For now we throw away the cached proxy, but we should be able
-  // to cache proxies from multiple JS contexts and Dart isolates.
-  if (dartProxy == null || !_isLocalObject(o)) {
-    dartProxy = createProxy(o);
-    _defineProperty(o, propertyName, dartProxy);
-  }
-  return dartProxy;
-}
-
-_convertDartFunctionFast(Function f) {
-  var existing = JS('', '#.#', f, _JS_FUNCTION_PROPERTY_NAME);
-  if (existing != null) return existing;
-  var ret = JS(
-      'JavaScriptFunction',
-      '''
-        function(_call, f) {
-          return function() {
-            return _call(f, Array.prototype.slice.apply(arguments));
-          }
-        }(#, #)
-      ''',
-      DART_CLOSURE_TO_JS(_callDartFunctionFast),
-      f);
-  JS('', '#.# = #', ret, DART_CLOSURE_PROPERTY_NAME, f);
-  JS('', '#.# = #', f, _JS_FUNCTION_PROPERTY_NAME, ret);
-  return ret;
-}
-
-_convertDartFunctionFastCaptureThis(Function f) {
-  var existing = JS('', '#.#', f, _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS);
-  if (existing != null) return existing;
-  var ret = JS(
-      'JavaScriptFunction',
-      '''
-        function(_call, f) {
-          return function() {
-            return _call(f, this,Array.prototype.slice.apply(arguments));
-          }
-        }(#, #)
-      ''',
-      DART_CLOSURE_TO_JS(_callDartFunctionFastCaptureThis),
-      f);
-  JS('', '#.# = #', ret, DART_CLOSURE_PROPERTY_NAME, f);
-  JS('', '#.# = #', f, _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS, ret);
-  return ret;
-}
-
-_callDartFunctionFast(callback, List arguments) {
-  return Function.apply(callback, arguments);
-}
-
-_callDartFunctionFastCaptureThis(callback, self, List arguments) {
-  return Function.apply(callback, [self]..addAll(arguments));
-}
-
-@patch
-F allowInterop<F extends Function>(F f) {
-  if (JS('bool', 'typeof(#) == "function"', f)) {
-    // Already supports interop, just use the existing function.
-    return f;
-  } else {
-    return _convertDartFunctionFast(f);
-  }
-}
-
-@patch
-Function allowInteropCaptureThis(Function f) {
-  if (JS('bool', 'typeof(#) == "function"', f)) {
-    // Behavior when the function is already a JS function is unspecified.
-    throw ArgumentError(
-        "Function is already a JS function so cannot capture this.");
-    return f;
-  } else {
-    return _convertDartFunctionFastCaptureThis(f);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_primitives.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_primitives.dart
deleted file mode 100644
index 97577a0..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_primitives.dart
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// dart2js "primitives", that is, features that cannot be implemented without
-/// access to JavaScript features.
-library dart2js._js_primitives;
-
-import 'dart:_foreign_helper' show JS;
-
-/// This is the low-level method that is used to implement [print].  It is
-/// possible to override this function from JavaScript by defining a function in
-/// JavaScript called "dartPrint".
-///
-/// Notice that it is also possible to intercept calls to [print] from within a
-/// Dart program using zones. This means that there is no guarantee that a call
-/// to print ends in this method.
-void printString(String string) {
-  if (JS('bool', r'typeof dartPrint == "function"')) {
-    // Support overriding print from JavaScript.
-    JS('void', r'dartPrint(#)', string);
-    return;
-  }
-
-  // Inside browser or nodejs.
-  if (JS('bool', r'typeof console == "object"') &&
-      JS('bool', r'typeof console.log != "undefined"')) {
-    JS('void', r'console.log(#)', string);
-    return;
-  }
-
-  // Don't throw inside IE, the console is only defined if dev tools is open.
-  if (JS('bool', r'typeof window == "object"')) {
-    return;
-  }
-
-  // Running in d8, the V8 developer shell, or in Firefox' js-shell.
-  if (JS('bool', r'typeof print == "function"')) {
-    JS('void', r'print(#)', string);
-    return;
-  }
-
-  // This is somewhat nasty, but we don't want to drag in a bunch of
-  // dependencies to handle a situation that cannot happen. So we
-  // avoid using Dart [:throw:] and Dart [toString].
-  JS('void', 'throw "Unable to print message: " + String(#)', string);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_rti.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_rti.dart
deleted file mode 100644
index 6bd9af5..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_rti.dart
+++ /dev/null
@@ -1,927 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// This part contains helpers for supporting runtime type information.
-///
-/// The helper use a mixture of Dart and JavaScript objects. To indicate which
-/// is used where we adopt the scheme of using explicit type annotation for Dart
-/// objects and 'var' or omitted return type for JavaScript objects.
-///
-/// Since bool, int, and String values are represented by the same JavaScript
-/// primitives, type annotations are used for these types in all cases.
-///
-/// Several methods use a common JavaScript encoding of runtime type
-/// information.  This encoding is referred to as the type representation which
-/// is one of these:
-///  1) a JavaScript constructor for a class C: the represented type is the raw
-///     type C.
-///  2) a JavaScript array: the first entry is of type 1 and contains the
-///     subtyping flags and the substitution of the type and the rest of the
-///     array are the type arguments.
-///  3) `null`: the dynamic type.
-///  4) a JavaScript object representing the function type. For instance, it has
-///     the form {ret: rti, args: [rti], opt: [rti], named: {name: rti}} for a
-///     function with a return type, regular, optional and named arguments.
-///     Generic function types have a 'bounds' property.
-///
-/// To check subtype relations between generic classes we use a JavaScript
-/// expression that describes the necessary substitution for type arguments.
-/// Such a substitution expression can be:
-///  1) `null`, if no substituted check is necessary, because the
-///     type variables are the same or there are no type variables in the class
-///     that is checked for.
-///  2) A list expression describing the type arguments to be used in the
-///     subtype check, if the type arguments to be used in the check do not
-///     depend on the type arguments of the object.
-///  3) A function mapping the type variables of the object to be checked to a
-///     list expression. The function may also return null, which is equivalent
-///     to an array containing only null values.
-
-part of _js_helper;
-
-/// Called from generated code.
-Type createRuntimeType(rti) {
-  return new TypeImpl(rti);
-}
-
-class TypeImpl implements Type {
-  final dynamic _rti;
-  String? __typeName;
-  String? _unmangledName;
-  int? _hashCode;
-
-  TypeImpl(this._rti);
-
-  String get _typeName => __typeName ??= runtimeTypeToString(_rti);
-
-  String toString() => _typeName;
-
-  // TODO(ahe): This is a poor hashCode as it collides with its name.
-  int get hashCode => _hashCode ??= _typeName.hashCode;
-
-  @pragma('dart2js:noInline')
-  bool operator ==(other) {
-    return (other is TypeImpl) && _typeName == other._typeName;
-  }
-}
-
-/// Represents a type variable.
-///
-/// This class holds the information needed when reflecting on generic classes
-/// and their members.
-class TypeVariable {
-  final Type owner;
-  final String name;
-  final int bound;
-
-  const TypeVariable(this.owner, this.name, this.bound);
-}
-
-/// Sets the runtime type information on [target]. [rti] is a type
-/// representation of type 4 or 5, that is, either a JavaScript array or `null`.
-///
-/// Called from generated code.
-///
-/// This is used only for marking JavaScript Arrays (JSArray) with the element
-/// type.
-// Don't inline.  Let the JS engine inline this.  The call expression is much
-// more compact that the inlined expansion.
-@pragma('dart2js:noInline')
-Object setRuntimeTypeInfo(Object target, var rti) {
-  if (JS_GET_FLAG('USE_NEW_RTI')) {
-    assert(rti != null);
-    var rtiProperty = JS_EMBEDDED_GLOBAL('', ARRAY_RTI_PROPERTY);
-    JS('var', r'#[#] = #', target, rtiProperty, rti);
-    return target;
-  } else {
-    assert(rti == null || isJsArray(rti));
-    String rtiName = JS_GET_NAME(JsGetName.RTI_NAME);
-    JS('var', r'#[#] = #', target, rtiName, rti);
-    return target;
-  }
-}
-
-/// Returns the runtime type information of [target]. The returned value is a
-/// list of type representations for the type arguments.
-///
-/// Called from generated code.
-getRuntimeTypeInfo(Object target) {
-  if (target == null) return null;
-  String rtiName = JS_GET_NAME(JsGetName.RTI_NAME);
-  return JS('var', r'#[#]', target, rtiName);
-}
-
-/// Returns the type arguments of [object] as an instance of [substitutionName].
-getRuntimeTypeArguments(interceptor, object, substitutionName) {
-  var substitution = getField(interceptor,
-      '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}$substitutionName');
-  return substitute(substitution, getRuntimeTypeInfo(object));
-}
-
-/// Returns the [index]th type argument of [target] as an instance of
-/// [substitutionName].
-///
-/// Called from generated code.
-@pragma('dart2js:noThrows')
-@pragma('dart2js:noSideEffects')
-@pragma('dart2js:noInline')
-getRuntimeTypeArgumentIntercepted(
-    interceptor, Object target, String substitutionName, int index) {
-  var arguments =
-      getRuntimeTypeArguments(interceptor, target, substitutionName);
-  return arguments == null ? null : getIndex(arguments, index);
-}
-
-/// Returns the [index]th type argument of [target] as an instance of
-/// [substitutionName].
-///
-/// Called from generated code.
-@pragma('dart2js:noThrows')
-@pragma('dart2js:noSideEffects')
-@pragma('dart2js:noInline')
-getRuntimeTypeArgument(Object target, String substitutionName, int index) {
-  var arguments = getRuntimeTypeArguments(target, target, substitutionName);
-  return arguments == null ? null : getIndex(arguments, index);
-}
-
-/// Returns the [index]th type argument of [target].
-///
-/// Called from generated code.
-@pragma('dart2js:noThrows')
-@pragma('dart2js:noSideEffects')
-@pragma('dart2js:noInline')
-getTypeArgumentByIndex(Object target, int index) {
-  var rti = getRuntimeTypeInfo(target);
-  return rti == null ? null : getIndex(rti, index);
-}
-
-/// Retrieves the class name from type information stored on the constructor
-/// of [object].
-String getClassName(var object) {
-  return rawRtiToJsConstructorName(getRawRuntimeType(getInterceptor(object)));
-}
-
-String _getRuntimeTypeAsString(var rti, List<String>? genericContext) {
-  assert(isJsArray(rti));
-  String className = unminifyOrTag(rawRtiToJsConstructorName(getIndex(rti, 0)));
-  return '$className${_joinArguments(rti, 1, genericContext)}';
-}
-
-/// Returns a human-readable representation of the type representation [rti].
-///
-/// Called from generated code.
-@pragma('dart2js:noInline')
-String runtimeTypeToString(var rti) {
-  return _runtimeTypeToString(rti, null);
-}
-
-String _runtimeTypeToString(var rti, List<String>? genericContext) {
-  if (isDartDynamicTypeRti(rti)) {
-    return 'dynamic';
-  }
-  if (isDartVoidTypeRti(rti)) {
-    return 'void';
-  }
-  if (isJsArray(rti)) {
-    // A list representing a type with arguments.
-    return _getRuntimeTypeAsString(rti, genericContext);
-  }
-  if (isJsFunction(rti)) {
-    // A reference to the constructor.
-    return unminifyOrTag(rawRtiToJsConstructorName(rti));
-  }
-  if (isDartJsInteropTypeArgumentRti(rti)) {
-    return 'dynamic';
-  }
-  if (isGenericFunctionTypeParameter(rti)) {
-    int index = rti;
-    if (genericContext == null || index < 0 || index >= genericContext.length) {
-      return 'unexpected-generic-index:${index}';
-    }
-    return '${genericContext[genericContext.length - index - 1]}';
-  }
-  if (isDartFunctionType(rti)) {
-    // TODO(sra): If there is a typedef tag, use the typedef name.
-    return _functionRtiToString(rti, genericContext);
-  }
-  if (isDartFutureOrType(rti)) {
-    var typeArgument = getFutureOrArgument(rti);
-    return 'FutureOr<${_runtimeTypeToString(typeArgument, genericContext)}>';
-  }
-  // We should not get here.
-  return 'unknown-reified-type';
-}
-
-// Returns a formatted String version of a function type.
-//
-// [genericContext] is list of the names of generic type parameters for generic
-// function types. The de Bruijn indexing scheme references the type variables
-// from the inner scope out. The parameters for each scope are pushed in
-// reverse, e.g.  `<P,Q>(<R,S,T>(R))` creates the list `[Q,P,T,S,R]`. This
-// allows the de Bruijn index to simply index backwards from the end of
-// [genericContext], e.g. in the outer scope index `0` is P and `1` is Q, and in
-// the inner scope index `0` is R, `3` is P, and `4` is Q.
-//
-// [genericContext] is initially `null`.
-String _functionRtiToString(var rti, List<String>? genericContext) {
-  String typeParameters = '';
-  int? outerContextLength;
-
-  String boundsTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_GENERIC_BOUNDS_TAG);
-  if (hasField(rti, boundsTag)) {
-    List boundsRti = JS('JSFixedArray', '#[#]', rti, boundsTag);
-    if (genericContext == null) {
-      genericContext = <String>[];
-    } else {
-      outerContextLength = genericContext.length;
-    }
-    int offset = genericContext.length;
-    for (int i = boundsRti.length; i > 0; i--) {
-      genericContext.add('T${offset + i}');
-    }
-    // All variables are in scope in the bounds.
-    String typeSep = '';
-    typeParameters = '<';
-    for (int i = 0; i < boundsRti.length; i++) {
-      typeParameters += typeSep;
-      typeParameters += genericContext[genericContext.length - i - 1];
-      typeSep = ', ';
-      var boundRti = boundsRti[i];
-      if (isInterestingBound(boundRti)) {
-        typeParameters +=
-            ' extends ' + _runtimeTypeToString(boundRti, genericContext);
-      }
-    }
-    typeParameters += '>';
-  }
-
-  String returnTypeText;
-  String voidTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG);
-  if (JS('bool', '!!#[#]', rti, voidTag)) {
-    returnTypeText = 'void';
-  } else {
-    String returnTypeTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG);
-    var returnRti = JS('', '#[#]', rti, returnTypeTag);
-    returnTypeText = _runtimeTypeToString(returnRti, genericContext);
-  }
-
-  String argumentsText = '';
-  String sep = '';
-
-  String requiredParamsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG);
-  if (hasField(rti, requiredParamsTag)) {
-    List arguments = JS('JSFixedArray', '#[#]', rti, requiredParamsTag);
-    for (var argument in arguments) {
-      argumentsText += sep;
-      argumentsText += _runtimeTypeToString(argument, genericContext);
-      sep = ', ';
-    }
-  }
-
-  String optionalParamsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG);
-  bool hasOptionalArguments = JS('bool', '# in #', optionalParamsTag, rti);
-  if (hasOptionalArguments) {
-    List optionalArguments = JS('JSFixedArray', '#[#]', rti, optionalParamsTag);
-    argumentsText += '$sep[';
-    sep = '';
-    for (var argument in optionalArguments) {
-      argumentsText += sep;
-      argumentsText += _runtimeTypeToString(argument, genericContext);
-      sep = ', ';
-    }
-    argumentsText += ']';
-  }
-
-  String namedParamsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG);
-  bool hasNamedArguments = JS('bool', '# in #', namedParamsTag, rti);
-  if (hasNamedArguments) {
-    var namedArguments = JS('', '#[#]', rti, namedParamsTag);
-    argumentsText += '$sep{';
-    sep = '';
-    for (String name in extractKeys(namedArguments)) {
-      argumentsText += sep;
-      argumentsText += _runtimeTypeToString(
-          JS('', '#[#]', namedArguments, name), genericContext);
-      argumentsText += ' $name';
-      sep = ', ';
-    }
-    argumentsText += '}';
-  }
-
-  if (outerContextLength != null) {
-    // Pop all of the generic type parameters.
-    JS('', '#.length = #', genericContext, outerContextLength);
-  }
-
-  // TODO(sra): Below is the same format as the VM. Change to:
-  //
-  //     return '${returnTypeText} Function${typeParameters}(${argumentsText})';
-  //
-  return '${typeParameters}(${argumentsText}) => ${returnTypeText}';
-}
-
-/// Creates a comma-separated string of human-readable representations of the
-/// type representations in the JavaScript array [types] starting at index
-/// [startIndex].
-String joinArguments(var types, int startIndex) {
-  return _joinArguments(types, startIndex, null);
-}
-
-String _joinArguments(var types, int startIndex, List<String>? genericContext) {
-  if (types == null) return '';
-  assert(isJsArray(types));
-  var separator = '';
-  bool allDynamic = true;
-  StringBuffer buffer = new StringBuffer('');
-  for (int index = startIndex; index < getLength(types); index++) {
-    buffer.write(separator);
-    separator = ', ';
-    var argument = getIndex(types, index);
-    if (argument != null) {
-      allDynamic = false;
-    }
-    buffer.write(_runtimeTypeToString(argument, genericContext));
-  }
-  return '<$buffer>';
-}
-
-Type getRuntimeType(var object) {
-  return newRti.getRuntimeType(object);
-}
-
-/// Applies the [substitution] on the [arguments].
-///
-/// See the comment in the beginning of this file for a description of the
-/// possible values for [substitution].
-substitute(var substitution, var arguments) {
-  if (substitution == null) return arguments;
-  assert(isJsFunction(substitution));
-  assert(arguments == null || isJsArray(arguments));
-  substitution = invoke(substitution, arguments);
-  if (substitution == null) return null;
-  if (isJsArray(substitution)) {
-    // Substitutions are generated too late to mark Array as used, so use a
-    // tautological JS 'cast' to mark Array as used. This is needed only in
-    // some tiny tests where the substition is the only thing that creates an
-    // Array.
-    return JS('JSArray', '#', substitution);
-  }
-  if (isJsFunction(substitution)) {
-    // TODO(johnniwinther): Check if this is still needed.
-    return invoke(substitution, arguments);
-  }
-  return arguments;
-}
-
-/// Returns the field's type name.
-///
-/// In minified mode, uses the unminified names if available.
-String computeTypeName(String isField, List arguments) {
-  // Extract the class name from the is field and append the textual
-  // representation of the type arguments.
-  return Primitives.formatType(
-      unminifyOrTag(isCheckPropertyToJsConstructorName(isField)), arguments);
-}
-
-throwTypeError(message) {
-  throw new TypeErrorImplementation.fromMessage(message);
-}
-
-bool checkArguments(
-    var substitution, var arguments, var sEnv, var checks, var tEnv) {
-  return areSubtypes(substitute(substitution, arguments), sEnv, checks, tEnv);
-}
-
-/// Checks whether the types of [s] are all subtypes of the types of [t].
-///
-/// [s] and [t] are either `null` or JavaScript arrays of type representations,
-/// A `null` argument is interpreted as the arguments of a raw type, that is a
-/// list of `dynamic`. If [s] and [t] are JavaScript arrays they must be of the
-/// same length.
-///
-/// See the comment in the beginning of this file for a description of type
-/// representations.
-
-bool areSubtypes(var s, var sEnv, var t, var tEnv) {
-  // `null` means a raw type.
-  if (t == null) return true;
-  if (s == null) {
-    int len = getLength(t);
-    for (int i = 0; i < len; i++) {
-      if (!_isSubtype(null, null, getIndex(t, i), tEnv)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  assert(isJsArray(s));
-  assert(isJsArray(t));
-  assert(getLength(s) == getLength(t));
-
-  int len = getLength(s);
-  for (int i = 0; i < len; i++) {
-    if (!_isSubtype(getIndex(s, i), sEnv, getIndex(t, i), tEnv)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-/// Computes the signature by applying the type arguments of [context] as an
-/// instance of [contextName] to the signature function [signature].
-computeSignature(var signature, var context, var contextName) {
-  var interceptor = getInterceptor(context);
-  var typeArguments =
-      getRuntimeTypeArguments(interceptor, context, contextName);
-  return invokeOn(signature, context, typeArguments);
-}
-
-/// Returns `true` if the runtime type representation [type] is a top type.
-/// That is, either `dynamic`, `void` or `Object`.
-@pragma('dart2js:tryInline')
-bool isTopType(var type) {
-  return isDartDynamicTypeRti(type) ||
-      isDartVoidTypeRti(type) ||
-      isDartObjectTypeRti(type) ||
-      isDartJsInteropTypeArgumentRti(type);
-}
-
-/// Returns the type argument of the `FutureOr` runtime type representation
-/// [type].
-///
-/// For instance `num` of `FutureOr<num>`.
-@pragma('dart2js:tryInline')
-Object getFutureOrArgument(var type) {
-  assert(isDartFutureOrType(type));
-  var typeArgumentTag = JS_GET_NAME(JsGetName.FUTURE_OR_TYPE_ARGUMENT_TAG);
-  return hasField(type, typeArgumentTag)
-      ? getField(type, typeArgumentTag)
-      : null;
-}
-
-/// Extracts the type arguments from a type representation. The result is a
-/// JavaScript array or `null`.
-getArguments(var type) {
-  return isJsArray(type) ? JS('var', r'#.slice(1)', type) : null;
-}
-
-/// Checks whether the type represented by the type representation [s] is a
-/// subtype of the type represented by the type representation [t].
-///
-/// See the comment in the beginning of this file for a description of type
-/// representations.
-///
-/// The arguments [s] and [t] must be types, usually represented by the
-/// constructor of the class, or an array (for generic class types).
-bool isSubtype(var s, var t) {
-  return _isSubtype(s, null, t, null);
-}
-
-bool _isSubtype(var s, var sEnv, var t, var tEnv) {
-  // Subtyping is reflexive.
-  if (isIdentical(s, t)) return true;
-
-  // [t] is a top type?
-  if (isTopType(t)) return true;
-
-  if (isDartJsInteropTypeArgumentRti(s)) return true;
-
-  // [s] is a top type?
-  if (isTopType(s)) {
-    if (isGenericFunctionTypeParameter(t)) {
-      // We need to check for function type variables because
-      // `isDartFutureOrType` doesn't work on numbers.
-      return false;
-    }
-    if (isDartFutureOrType(t)) {
-      // [t] is FutureOr<T>. Check [s] <: T.
-      var tTypeArgument = getFutureOrArgument(t);
-      return _isSubtype(s, sEnv, tTypeArgument, tEnv);
-    }
-    return false;
-  }
-
-  if (isGenericFunctionTypeParameter(s)) {
-    return _isSubtype(getIndex(sEnv, s), sEnv, t, tEnv);
-  }
-
-  if (isGenericFunctionTypeParameter(t)) return false;
-
-  if (isNullType(s)) return true;
-
-  // Get the object describing the class and check for the subtyping flag
-  // constructed from the type of [s].
-  var typeOfS = isJsArray(s) ? getIndex(s, 0) : s;
-
-  if (isDartFutureOrType(t)) {
-    // [t] is FutureOr<T>
-    var tTypeArgument = getFutureOrArgument(t);
-    if (isDartFutureOrType(s)) {
-      // [S] is FutureOr<S>. Check S <: T
-      var sTypeArgument = getFutureOrArgument(s);
-      return _isSubtype(sTypeArgument, sEnv, tTypeArgument, tEnv);
-    } else if (_isSubtype(s, sEnv, tTypeArgument, tEnv)) {
-      // `true` because [s] <: T.
-      return true;
-    } else {
-      // Check [s] <: Future<T>.
-      String futureClass = JS_GET_NAME(JsGetName.FUTURE_CLASS_TYPE_NAME);
-      if (!builtinIsSubtype(typeOfS, futureClass)) {
-        // [s] doesn't implement Future.
-        return false;
-      }
-      var typeOfSPrototype = JS('', '#.prototype', typeOfS);
-      var field = '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}${futureClass}';
-      var futureSubstitution = getField(typeOfSPrototype, field);
-      var futureArguments = substitute(futureSubstitution, getArguments(s));
-      var futureArgument =
-          isJsArray(futureArguments) ? getIndex(futureArguments, 0) : null;
-      // [s] implements Future<S>. Check S <: T.
-      return _isSubtype(futureArgument, sEnv, tTypeArgument, tEnv);
-    }
-  }
-
-  if (isDartFunctionType(t)) {
-    return _isFunctionSubtype(s, sEnv, t, tEnv);
-  }
-
-  if (isDartFunctionType(s)) {
-    // Check function types against the `Function` class (`Object` is also a
-    // supertype, but is tested above with other 'top' types.).
-    return isDartFunctionTypeRti(t);
-  }
-
-  // Get the object describing the class and check for the subtyping flag
-  // constructed from the type of [t].
-  var typeOfT = isJsArray(t) ? getIndex(t, 0) : t;
-
-  // Check for a subtyping flag.
-  // Get the necessary substitution of the type arguments, if there is one.
-  var substitution;
-  if (isNotIdentical(typeOfT, typeOfS)) {
-    String typeOfTString = rawRtiToJsConstructorName(typeOfT);
-    if (!builtinIsSubtype(typeOfS, typeOfTString)) {
-      return false;
-    }
-    var typeOfSPrototype = JS('', '#.prototype', typeOfS);
-    var field = '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}${typeOfTString}';
-    substitution = getField(typeOfSPrototype, field);
-  }
-  // The class of [s] is a subclass of the class of [t]. If [t] has no
-  // type arguments, it used as a raw type and [s] is a subtype of [t].
-  if (!isJsArray(t)) {
-    return true;
-  }
-  // Recursively check the type arguments.
-  return checkArguments(
-      substitution, getArguments(s), sEnv, getArguments(t), tEnv);
-}
-
-/// Top-level function subtype check when [t] is known to be a function type
-/// rti.
-bool isFunctionSubtype(var s, var t) {
-  return _isFunctionSubtype(s, null, t, null);
-}
-
-bool _isFunctionSubtype(var s, var sEnv, var t, var tEnv) {
-  assert(isDartFunctionType(t));
-  if (!isDartFunctionType(s)) return false;
-  var genericBoundsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_GENERIC_BOUNDS_TAG);
-  var voidReturnTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG);
-  var returnTypeTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG);
-
-  // Generic function types must agree on number of type parameters and bounds.
-  if (hasField(s, genericBoundsTag)) {
-    if (hasNoField(t, genericBoundsTag)) return false;
-    var sBounds = getField(s, genericBoundsTag);
-    var tBounds = getField(t, genericBoundsTag);
-    int sGenericParameters = getLength(sBounds);
-    int tGenericParameters = getLength(tBounds);
-    if (sGenericParameters != tGenericParameters) return false;
-    // TODO(sra): Compare bounds, which should be 'equal' trees due to the de
-    // Bruijn numbering of type parameters.
-    sEnv = sEnv == null ? sBounds : concat(sBounds, sEnv);
-    tEnv = tEnv == null ? tBounds : concat(tBounds, tEnv);
-  } else if (hasField(t, genericBoundsTag)) {
-    return false;
-  }
-
-  var sReturnType = getField(s, returnTypeTag);
-  var tReturnType = getField(t, returnTypeTag);
-  if (!_isSubtype(sReturnType, sEnv, tReturnType, tEnv)) return false;
-
-  var requiredParametersTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG);
-  var sParameterTypes = getField(s, requiredParametersTag);
-  var tParameterTypes = getField(t, requiredParametersTag);
-
-  var optionalParametersTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG);
-  var sOptionalParameterTypes = getField(s, optionalParametersTag);
-  var tOptionalParameterTypes = getField(t, optionalParametersTag);
-
-  int sParametersLen = sParameterTypes != null ? getLength(sParameterTypes) : 0;
-  int tParametersLen = tParameterTypes != null ? getLength(tParameterTypes) : 0;
-
-  int sOptionalParametersLen =
-      sOptionalParameterTypes != null ? getLength(sOptionalParameterTypes) : 0;
-  int tOptionalParametersLen =
-      tOptionalParameterTypes != null ? getLength(tOptionalParameterTypes) : 0;
-
-  if (sParametersLen > tParametersLen) {
-    // Too many required parameters in [s].
-    return false;
-  }
-  if (sParametersLen + sOptionalParametersLen <
-      tParametersLen + tOptionalParametersLen) {
-    // Too few required and optional parameters in [s].
-    return false;
-  }
-
-  int pos = 0;
-  // Check all required parameters of [s].
-  for (; pos < sParametersLen; pos++) {
-    if (!_isSubtype(getIndex(tParameterTypes, pos), tEnv,
-        getIndex(sParameterTypes, pos), sEnv)) {
-      return false;
-    }
-  }
-  int sPos = 0;
-  int tPos = pos;
-  // Check the remaining parameters of [t] with the first optional parameters
-  // of [s].
-  for (; tPos < tParametersLen; sPos++, tPos++) {
-    if (!_isSubtype(getIndex(tParameterTypes, tPos), tEnv,
-        getIndex(sOptionalParameterTypes, sPos), sEnv)) {
-      return false;
-    }
-  }
-  tPos = 0;
-  // Check the optional parameters of [t] with the remaining optional
-  // parameters of [s]:
-  for (; tPos < tOptionalParametersLen; sPos++, tPos++) {
-    if (!_isSubtype(getIndex(tOptionalParameterTypes, tPos), tEnv,
-        getIndex(sOptionalParameterTypes, sPos), sEnv)) {
-      return false;
-    }
-  }
-
-  var namedParametersTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG);
-  var sNamedParameters = getField(s, namedParametersTag);
-  var tNamedParameters = getField(t, namedParametersTag);
-  if (tNamedParameters == null) return true;
-  if (sNamedParameters == null) return false;
-  return namedParametersSubtypeCheck(
-      sNamedParameters, sEnv, tNamedParameters, tEnv);
-}
-
-bool namedParametersSubtypeCheck(var s, var sEnv, var t, var tEnv) {
-  assert(isJsObject(s));
-  assert(isJsObject(t));
-
-  // Each named parameter in [t] must exist in [s] and be a subtype of the type
-  // in [s].
-  List names = JS('JSFixedArray', 'Object.getOwnPropertyNames(#)', t);
-  for (int i = 0; i < names.length; i++) {
-    var name = names[i];
-    if (JS('bool', '!Object.hasOwnProperty.call(#, #)', s, name)) {
-      return false;
-    }
-    var tType = JS('', '#[#]', t, name);
-    var sType = JS('', '#[#]', s, name);
-    if (!_isSubtype(tType, tEnv, sType, sEnv)) return false;
-  }
-  return true;
-}
-
-/// Returns whether [type] is the representation of a generic function type
-/// parameter. Generic function type parameters are represented de Bruijn
-/// indexes.
-///
-/// This test is only valid if [type] is known _not_ to be the void rti, whose
-/// runtime representation is -1.
-bool isGenericFunctionTypeParameter(var type) {
-  assert(!isDartVoidTypeRti(type));
-  return type is num; // Actually int, but 'is num' is faster.
-}
-
-/// Returns [genericFunctionRti] with type parameters bound to [parameters].
-///
-/// [genericFunctionRti] must be an rti representation with a number of generic
-/// type parameters matching the number of types in [parameters].
-///
-/// Called from generated code.
-@pragma('dart2js:noInline')
-instantiatedGenericFunctionType(genericFunctionRti, parameters) {
-  if (genericFunctionRti == null) return null;
-
-  assert(isDartFunctionType(genericFunctionRti));
-
-  var genericBoundsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_GENERIC_BOUNDS_TAG);
-
-  assert(hasField(genericFunctionRti, genericBoundsTag));
-  var bounds = getField(genericFunctionRti, genericBoundsTag);
-
-  // Generic function types must agree on number of type parameters and bounds.
-  int boundLength = getLength(bounds);
-  int parametersLength = getLength(parameters);
-  assert(boundLength == parametersLength);
-
-  var result = JS('', '{#:1}', JS_GET_NAME(JsGetName.FUNCTION_TYPE_TAG));
-  return finishBindInstantiatedFunctionType(
-      genericFunctionRti, result, parameters, 0);
-}
-
-bindInstantiatedFunctionType(rti, parameters, int depth) {
-  var result = JS('', '{#:1}', JS_GET_NAME(JsGetName.FUNCTION_TYPE_TAG));
-
-  var genericBoundsTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_GENERIC_BOUNDS_TAG);
-  if (hasField(rti, genericBoundsTag)) {
-    var bounds = getField(rti, genericBoundsTag);
-    depth += getLength(bounds);
-    setField(result, genericBoundsTag,
-        bindInstantiatedTypes(bounds, parameters, depth));
-  }
-
-  return finishBindInstantiatedFunctionType(rti, result, parameters, depth);
-}
-
-/// Common code for function types that copies all non-bounds parts of the
-/// function [rti] into [result].
-finishBindInstantiatedFunctionType(rti, result, parameters, int depth) {
-  var voidReturnTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG);
-  var returnTypeTag = JS_GET_NAME(JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG);
-
-  if (hasField(rti, voidReturnTag)) {
-    setField(result, voidReturnTag, getField(rti, voidReturnTag));
-  } else if (hasField(rti, returnTypeTag)) {
-    setField(result, returnTypeTag,
-        bindInstantiatedType(getField(rti, returnTypeTag), parameters, depth));
-  }
-
-  var requiredParametersTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG);
-  if (hasField(rti, requiredParametersTag)) {
-    setField(
-        result,
-        requiredParametersTag,
-        bindInstantiatedTypes(
-            getField(rti, requiredParametersTag), parameters, depth));
-  }
-
-  String optionalParametersTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG);
-  if (hasField(rti, optionalParametersTag)) {
-    setField(
-        result,
-        optionalParametersTag,
-        bindInstantiatedTypes(
-            getField(rti, optionalParametersTag), parameters, depth));
-  }
-
-  String namedParametersTag =
-      JS_GET_NAME(JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG);
-  if (hasField(rti, namedParametersTag)) {
-    var namedParameters = getField(rti, namedParametersTag);
-    var boundNamed = JS('', '{}');
-    var names = JS('JSFixedArray', 'Object.keys(#)', namedParameters);
-    for (var name in names) {
-      setField(
-          boundNamed,
-          name,
-          bindInstantiatedType(
-              getField(namedParameters, name), parameters, depth));
-    }
-    setField(result, namedParametersTag, boundNamed);
-  }
-
-  return result;
-}
-
-/// Copies [rti], substituting generic type parameters from [parameters].
-///
-/// Generic type parameters are de Bruijn indexes counting up through the
-/// generic function type parameters scopes to index into [parameters].
-///
-/// [depth] is the number of subsequent generic function parameters that are in
-/// scope. This is subtracted off the de Bruijn index for the type parameter to
-/// arrive at an potential index into [parameters].
-bindInstantiatedType(rti, parameters, int depth) {
-  if (isDartDynamicTypeRti(rti)) return rti; // dynamic.
-  if (isDartVoidTypeRti(rti)) return rti; // void.
-  // Functions are constructors denoting the class of the constructor.
-  if (isJsFunction(rti)) return rti;
-
-  // de Bruijn type indexes.
-  if (isGenericFunctionTypeParameter(rti)) {
-    if (rti < depth) return rti;
-    return JS('', '#[#]', parameters, rti - depth);
-  }
-  // Other things encoded as numbers.
-  if (rti is num) return rti;
-
-  if (isJsArray(rti)) {
-    // An array is a parameterized class type, e.g. the list of three
-    // constructor functions [Map, String, int] represents `Map<String, int>`.
-    // Since the 'head' of the term and the arguments are encoded in the same
-    // scheme, it is sufficient to walk all the types.
-    return bindInstantiatedTypes(rti, parameters, depth);
-  }
-  if (isDartFunctionType(rti)) {
-    return bindInstantiatedFunctionType(rti, parameters, depth);
-  }
-
-  // Can't include the bad [rti] since it is not a Dart value.
-  throw new ArgumentError('Unknown RTI format in bindInstantiatedType.');
-}
-
-/// Returns a copy of array [rti] with each type bound.
-bindInstantiatedTypes(rti, parameters, int depth) {
-  List array = JS('JSFixedArray', '#.slice()', rti);
-  for (int i = 0; i < array.length; i++) {
-    array[i] = bindInstantiatedType(array[i], parameters, depth);
-  }
-  return array;
-}
-
-/// Calls the JavaScript [function] with the [arguments] with the global scope
-/// as the `this` context.
-invoke(var function, var arguments) => invokeOn(function, null, arguments);
-
-/// Calls the JavaScript [function] with the [arguments] with [receiver] as the
-/// `this` context.
-Object invokeOn(function, receiver, arguments) {
-  assert(isJsFunction(function));
-  assert(arguments == null || isJsArray(arguments));
-  return JS('var', r'#.apply(#, #)', function, receiver, arguments);
-}
-
-/// Calls the property [name] on the JavaScript [object].
-call(var object, String name) => JS('var', r'#[#]()', object, name);
-
-/// Returns the property [name] of the JavaScript object [object].
-getField(var object, String name) => JS('var', r'#[#]', object, name);
-
-/// Returns the property [index] of the JavaScript array [array].
-getIndex(var array, int index) {
-  assert(isJsArray(array));
-  return JS('var', r'#[#]', array, index);
-}
-
-setField(var object, String name, var value) {
-  JS('', '#[#] = #', object, name, value);
-}
-
-setIndex(var array, int index, var value) {
-  JS('', '#[#] = #', array, index, value);
-}
-
-/// Returns the length of the JavaScript array [array].
-int getLength(var array) {
-  assert(isJsArray(array));
-  return JS('int', r'#.length', array);
-}
-
-/// Returns whether [value] is a JavaScript array.
-bool isJsArray(var value) {
-  return value is JSArray;
-}
-
-hasField(var object, var name) => JS('bool', r'# in #', name, object);
-
-hasNoField(var object, var name) => !hasField(object, name);
-
-/// Returns `true` if [o] is a JavaScript function.
-bool isJsFunction(var o) => JS('bool', r'typeof # == "function"', o);
-
-/// Returns `true` if [o] is a JavaScript object.
-bool isJsObject(var o) => JS('bool', r"typeof # == 'object'", o);
-
-/// Returns `true` if the JavaScript values [s] and [t] are identical. We use
-/// this helper instead of [identical] because `identical` needs to merge
-/// `null` and `undefined` (which we can avoid).
-bool isIdentical(var s, var t) => JS('bool', '# === #', s, t);
-
-/// Returns `true` if the JavaScript values [s] and [t] are not identical. We
-/// use this helper instead of [identical] because `identical` needs to merge
-/// `null` and `undefined` (which we can avoid).
-bool isNotIdentical(var s, var t) => JS('bool', '# !== #', s, t);
-
-/// 'Top' bounds are uninteresting: null/undefined and Object.
-bool isInterestingBound(rti) =>
-    rti != null &&
-    isNotIdentical(
-        rti,
-        JS_BUILTIN(
-            'depends:none;effects:none;', JsBuiltin.dartObjectConstructor));
-
-concat(Object a1, Object a2) => JS('JSArray', '#.concat(#)', a1, a2);
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/js_string.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/js_string.dart
deleted file mode 100644
index 8ba4c37..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/js_string.dart
+++ /dev/null
@@ -1,470 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _interceptors;
-
-/// The interceptor class for [String]. The compiler recognizes this
-/// class as an interceptor, and changes references to [:this:] to
-/// actually use the receiver of the method, which is generated as an extra
-/// argument added to each member.
-class JSString extends Interceptor implements String, JSIndexable {
-  const JSString();
-
-  @pragma('dart2js:noInline')
-  int codeUnitAt(int index) {
-    if (index is! int) throw diagnoseIndexError(this, index);
-    if (index < 0) throw diagnoseIndexError(this, index);
-    return _codeUnitAt(index);
-  }
-
-  int _codeUnitAt(int index) {
-    if (index >= length) throw diagnoseIndexError(this, index);
-    return JS('JSUInt31', r'#.charCodeAt(#)', this, index);
-  }
-
-  Iterable<Match> allMatches(String string, [int start = 0]) {
-    checkString(string);
-    checkInt(start);
-    if (0 > start || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    return allMatchesInStringUnchecked(this, string, start);
-  }
-
-  Match? matchAsPrefix(String string, [int start = 0]) {
-    if (start < 0 || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    if (start + this.length > string.length) return null;
-    // TODO(lrn): See if this can be optimized.
-    for (int i = 0; i < this.length; i++) {
-      if (string.codeUnitAt(start + i) != this.codeUnitAt(i)) {
-        return null;
-      }
-    }
-    return new StringMatch(start, string, this);
-  }
-
-  String operator +(String other) {
-    if (other is! String) throw new ArgumentError.value(other);
-    return JS('String', r'# + #', this, other);
-  }
-
-  bool endsWith(String other) {
-    checkString(other);
-    int otherLength = other.length;
-    if (otherLength > length) return false;
-    return other == substring(length - otherLength);
-  }
-
-  String replaceAll(Pattern from, String to) {
-    return stringReplaceAllUnchecked(this, from, checkString(to));
-  }
-
-  String replaceAllMapped(Pattern from, String Function(Match) convert) {
-    return this.splitMapJoin(from, onMatch: convert);
-  }
-
-  String splitMapJoin(Pattern from,
-      {String Function(Match)? onMatch, String Function(String)? onNonMatch}) {
-    return stringReplaceAllFuncUnchecked(this, from, onMatch, onNonMatch);
-  }
-
-  String replaceFirst(Pattern from, String to, [int startIndex = 0]) {
-    checkString(to);
-    checkInt(startIndex);
-    RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
-    return stringReplaceFirstUnchecked(this, from, to, startIndex);
-  }
-
-  String replaceFirstMapped(Pattern from, String replace(Match match),
-      [int startIndex = 0]) {
-    checkNull(replace);
-    checkInt(startIndex);
-    RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
-    return stringReplaceFirstMappedUnchecked(this, from, replace, startIndex);
-  }
-
-  List<String> split(Pattern pattern) {
-    checkNull(pattern);
-    if (pattern is String) {
-      return stringSplitUnchecked(this, pattern);
-    } else if (pattern is JSSyntaxRegExp && regExpCaptureCount(pattern) == 0) {
-      var re = regExpGetNative(pattern);
-      return stringSplitUnchecked(this, re);
-    } else {
-      return _defaultSplit(pattern);
-    }
-  }
-
-  String replaceRange(int start, int? end, String replacement) {
-    checkString(replacement);
-    checkInt(start);
-    var e = RangeError.checkValidRange(start, end, this.length);
-    checkInt(e);
-    return stringReplaceRangeUnchecked(this, start, e, replacement);
-  }
-
-  List<String> _defaultSplit(Pattern pattern) {
-    List<String> result = <String>[];
-    // End of most recent match. That is, start of next part to add to result.
-    int start = 0;
-    // Length of most recent match.
-    // Set >0, so no match on the empty string causes the result to be [""].
-    int length = 1;
-    for (var match in pattern.allMatches(this)) {
-      int matchStart = match.start;
-      int matchEnd = match.end;
-      length = matchEnd - matchStart;
-      if (length == 0 && start == matchStart) {
-        // An empty match right after another match is ignored.
-        // This includes an empty match at the start of the string.
-        continue;
-      }
-      int end = matchStart;
-      result.add(this.substring(start, end));
-      start = matchEnd;
-    }
-    if (start < this.length || length > 0) {
-      // An empty match at the end of the string does not cause a "" at the end.
-      // A non-empty match ending at the end of the string does add a "".
-      result.add(this.substring(start));
-    }
-    return result;
-  }
-
-  bool startsWith(Pattern pattern, [int index = 0]) {
-    checkInt(index);
-    if (index < 0 || index > this.length) {
-      throw new RangeError.range(index, 0, this.length);
-    }
-    if (pattern is String) {
-      String other = pattern;
-      int otherLength = other.length;
-      int endIndex = index + otherLength;
-      if (endIndex > length) return false;
-      return other == JS('String', r'#.substring(#, #)', this, index, endIndex);
-    }
-    return pattern.matchAsPrefix(this, index) != null;
-  }
-
-  String substring(int startIndex, [int? endIndex]) {
-    checkInt(startIndex);
-    if (endIndex == null) endIndex = length;
-    checkInt(endIndex);
-    if (startIndex < 0) throw new RangeError.value(startIndex);
-    if (startIndex > endIndex) throw new RangeError.value(startIndex);
-    if (endIndex > length) throw new RangeError.value(endIndex);
-    return JS('String', r'#.substring(#, #)', this, startIndex, endIndex);
-  }
-
-  String toLowerCase() {
-    return JS('returns:String;effects:none;depends:none;throws:null(1)',
-        r'#.toLowerCase()', this);
-  }
-
-  String toUpperCase() {
-    return JS('returns:String;effects:none;depends:none;throws:null(1)',
-        r'#.toUpperCase()', this);
-  }
-
-  // Characters with Whitespace property (Unicode 6.3).
-  // 0009..000D    ; White_Space # Cc       <control-0009>..<control-000D>
-  // 0020          ; White_Space # Zs       SPACE
-  // 0085          ; White_Space # Cc       <control-0085>
-  // 00A0          ; White_Space # Zs       NO-BREAK SPACE
-  // 1680          ; White_Space # Zs       OGHAM SPACE MARK
-  // 2000..200A    ; White_Space # Zs       EN QUAD..HAIR SPACE
-  // 2028          ; White_Space # Zl       LINE SEPARATOR
-  // 2029          ; White_Space # Zp       PARAGRAPH SEPARATOR
-  // 202F          ; White_Space # Zs       NARROW NO-BREAK SPACE
-  // 205F          ; White_Space # Zs       MEDIUM MATHEMATICAL SPACE
-  // 3000          ; White_Space # Zs       IDEOGRAPHIC SPACE
-  //
-  // BOM: 0xFEFF
-  static bool _isWhitespace(int codeUnit) {
-    // Most codeUnits should be less than 256. Special case with a smaller
-    // switch.
-    if (codeUnit < 256) {
-      switch (codeUnit) {
-        case 0x09:
-        case 0x0A:
-        case 0x0B:
-        case 0x0C:
-        case 0x0D:
-        case 0x20:
-        case 0x85:
-        case 0xA0:
-          return true;
-        default:
-          return false;
-      }
-    }
-    switch (codeUnit) {
-      case 0x1680:
-      case 0x2000:
-      case 0x2001:
-      case 0x2002:
-      case 0x2003:
-      case 0x2004:
-      case 0x2005:
-      case 0x2006:
-      case 0x2007:
-      case 0x2008:
-      case 0x2009:
-      case 0x200A:
-      case 0x2028:
-      case 0x2029:
-      case 0x202F:
-      case 0x205F:
-      case 0x3000:
-      case 0xFEFF:
-        return true;
-      default:
-        return false;
-    }
-  }
-
-  /// Finds the index of the first non-whitespace character, or the
-  /// end of the string. Start looking at position [index].
-  static int _skipLeadingWhitespace(String string, int index) {
-    const int SPACE = 0x20;
-    const int CARRIAGE_RETURN = 0x0D;
-    while (index < string.length) {
-      int codeUnit = string.codeUnitAt(index);
-      if (codeUnit != SPACE &&
-          codeUnit != CARRIAGE_RETURN &&
-          !_isWhitespace(codeUnit)) {
-        break;
-      }
-      index++;
-    }
-    return index;
-  }
-
-  /// Finds the index after the last non-whitespace character, or 0.
-  /// Start looking at position [index - 1].
-  static int _skipTrailingWhitespace(String string, int index) {
-    const int SPACE = 0x20;
-    const int CARRIAGE_RETURN = 0x0D;
-    while (index > 0) {
-      int codeUnit = string.codeUnitAt(index - 1);
-      if (codeUnit != SPACE &&
-          codeUnit != CARRIAGE_RETURN &&
-          !_isWhitespace(codeUnit)) {
-        break;
-      }
-      index--;
-    }
-    return index;
-  }
-
-  // Dart2js can't use JavaScript trim directly,
-  // because JavaScript does not trim
-  // the NEXT LINE (NEL) character (0x85).
-  String trim() {
-    const int NEL = 0x85;
-
-    // Start by doing JS trim. Then check if it leaves a NEL at
-    // either end of the string.
-    String result = JS('String', '#.trim()', this);
-    if (result.length == 0) return result;
-    int firstCode = result.codeUnitAt(0);
-    int startIndex = 0;
-    if (firstCode == NEL) {
-      startIndex = _skipLeadingWhitespace(result, 1);
-      if (startIndex == result.length) return "";
-    }
-
-    int endIndex = result.length;
-    // We know that there is at least one character that is non-whitespace.
-    // Therefore we don't need to verify that endIndex > startIndex.
-    int lastCode = result.codeUnitAt(endIndex - 1);
-    if (lastCode == NEL) {
-      endIndex = _skipTrailingWhitespace(result, endIndex - 1);
-    }
-    if (startIndex == 0 && endIndex == result.length) return result;
-    return JS('String', r'#.substring(#, #)', result, startIndex, endIndex);
-  }
-
-  // Dart2js can't use JavaScript trimLeft directly,
-  // because it is not in ES5, so not every browser implements it,
-  // and because those that do will not trim the NEXT LINE character (0x85).
-  String trimLeft() {
-    const int NEL = 0x85;
-
-    // Start by doing JS trim. Then check if it leaves a NEL at
-    // the beginning of the string.
-    String result;
-    int startIndex = 0;
-    if (JS('bool', 'typeof #.trimLeft != "undefined"', this)) {
-      result = JS('String', '#.trimLeft()', this);
-      if (result.length == 0) return result;
-      int firstCode = result.codeUnitAt(0);
-      if (firstCode == NEL) {
-        startIndex = _skipLeadingWhitespace(result, 1);
-      }
-    } else {
-      result = this;
-      startIndex = _skipLeadingWhitespace(this, 0);
-    }
-    if (startIndex == 0) return result;
-    if (startIndex == result.length) return "";
-    return JS('String', r'#.substring(#)', result, startIndex);
-  }
-
-  // Dart2js can't use JavaScript trimRight directly,
-  // because it is not in ES5 and because JavaScript does not trim
-  // the NEXT LINE character (0x85).
-  String trimRight() {
-    const int NEL = 0x85;
-
-    // Start by doing JS trim. Then check if it leaves a NEL or BOM at
-    // the end of the string.
-    String result;
-    int endIndex;
-    // trimRight is implemented by Firefox and Chrome/Blink,
-    // so use it if it is there.
-    if (JS('bool', 'typeof #.trimRight != "undefined"', this)) {
-      result = JS('String', '#.trimRight()', this);
-      endIndex = result.length;
-      if (endIndex == 0) return result;
-      int lastCode = result.codeUnitAt(endIndex - 1);
-      if (lastCode == NEL) {
-        endIndex = _skipTrailingWhitespace(result, endIndex - 1);
-      }
-    } else {
-      result = this;
-      endIndex = _skipTrailingWhitespace(this, this.length);
-    }
-
-    if (endIndex == result.length) return result;
-    if (endIndex == 0) return "";
-    return JS('String', r'#.substring(#, #)', result, 0, endIndex);
-  }
-
-  String operator *(int times) {
-    if (0 >= times) return ''; // Unnecessary but hoists argument type check.
-    if (times == 1 || this.length == 0) return this;
-    if (times != JS('JSUInt32', '# >>> 0', times)) {
-      // times >= 2^32. We can't create a string that big.
-      throw const OutOfMemoryError();
-    }
-    var result = '';
-    String s = this;
-    while (true) {
-      if (times & 1 == 1) result = s + result;
-      times = JS('JSUInt31', '# >>> 1', times);
-      if (times == 0) break;
-      s += s;
-    }
-    return result;
-  }
-
-  String padLeft(int width, [String padding = ' ']) {
-    int delta = width - this.length;
-    if (delta <= 0) return this;
-    return padding * delta + this;
-  }
-
-  String padRight(int width, [String padding = ' ']) {
-    int delta = width - this.length;
-    if (delta <= 0) return this;
-    return this + padding * delta;
-  }
-
-  List<int> get codeUnits => new CodeUnits(this);
-
-  Runes get runes => new Runes(this);
-
-  int indexOf(Pattern pattern, [int start = 0]) {
-    checkNull(pattern);
-    if (start is! int) throw argumentErrorValue(start);
-    if (start < 0 || start > this.length) {
-      throw new RangeError.range(start, 0, this.length);
-    }
-    if (pattern is String) {
-      return stringIndexOfStringUnchecked(this, pattern, start);
-    }
-    if (pattern is JSSyntaxRegExp) {
-      JSSyntaxRegExp re = pattern;
-      Match? match = firstMatchAfter(re, this, start);
-      return (match == null) ? -1 : match.start;
-    }
-    for (int i = start; i <= this.length; i++) {
-      if (pattern.matchAsPrefix(this, i) != null) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Pattern pattern, [int? start]) {
-    checkNull(pattern);
-    if (start == null) {
-      start = length;
-    } else if (start is! int) {
-      throw argumentErrorValue(start);
-    } else if (start < 0 || start > this.length) {
-      throw new RangeError.range(start, 0, this.length);
-    }
-    if (pattern is String) {
-      String other = pattern;
-      if (start + other.length > this.length) {
-        start = this.length - other.length;
-      }
-      return stringLastIndexOfUnchecked(this, other, start);
-    }
-    for (int i = start; i >= 0; i--) {
-      if (pattern.matchAsPrefix(this, i) != null) return i;
-    }
-    return -1;
-  }
-
-  bool contains(Pattern other, [int startIndex = 0]) {
-    checkNull(other);
-    if (startIndex < 0 || startIndex > this.length) {
-      throw new RangeError.range(startIndex, 0, this.length);
-    }
-    return stringContainsUnchecked(this, other, startIndex);
-  }
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  int compareTo(String other) {
-    if (other is! String) throw argumentErrorValue(other);
-    return this == other ? 0 : JS('bool', r'# < #', this, other) ? -1 : 1;
-  }
-
-  // Note: if you change this, also change the function [S].
-  String toString() => this;
-
-  /// This is the [Jenkins hash function][1] but using masking to keep
-  /// values in SMI range.
-  ///
-  /// [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
-  int get hashCode {
-    // TODO(ahe): This method shouldn't have to use JS. Update when our
-    // optimizations are smarter.
-    int hash = 0;
-    for (int i = 0; i < length; i++) {
-      hash = 0x1fffffff & (hash + JS<int>('int', r'#.charCodeAt(#)', this, i));
-      hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-      hash = JS('int', '# ^ (# >> 6)', hash, hash);
-    }
-    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-    hash = JS<int>('int', '# ^ (# >> 11)', hash, hash);
-    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-  }
-
-  Type get runtimeType => String;
-
-  int get length => JS('int', r'#.length', this);
-
-  String operator [](int index) {
-    if (index is! int) throw diagnoseIndexError(this, index);
-    if (index >= length || index < 0) throw diagnoseIndexError(this, index);
-    return JS('String', '#[#]', this, index);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/linked_hash_map.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/linked_hash_map.dart
deleted file mode 100644
index 70882d8..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/linked_hash_map.dart
+++ /dev/null
@@ -1,441 +0,0 @@
-// Copyright (c) 2014, 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.
-
-// Efficient JavaScript based implementation of a linked hash map used as a
-// backing map for constant maps and the [LinkedHashMap] patch
-
-part of _js_helper;
-
-const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps");
-
-class JsLinkedHashMap<K, V> extends MapBase<K, V>
-    implements LinkedHashMap<K, V>, InternalMap {
-  int _length = 0;
-
-  // The hash map contents are divided into three parts: one part for
-  // string keys, one for numeric keys, and one for the rest. String
-  // and numeric keys map directly to their linked cells, but the rest
-  // of the entries are stored in bucket lists of the form:
-  //
-  //    [cell-0, cell-1, ...]
-  //
-  // where all keys in the same bucket share the same hash code.
-  var _strings;
-  var _nums;
-  var _rest;
-
-  // The keys and values are stored in cells that are linked together
-  // to form a double linked list.
-  LinkedHashMapCell? _first;
-  LinkedHashMapCell? _last;
-
-  // We track the number of modifications done to the key set of the
-  // hash map to be able to throw when the map is modified while being
-  // iterated over.
-  int _modifications = 0;
-
-  static bool get _supportsEs6Maps {
-    return JS('returns:bool;depends:none;effects:none;throws:never;gvn:true',
-        'typeof Map != "undefined"');
-  }
-
-  JsLinkedHashMap();
-
-  /// If ES6 Maps are available returns a linked hash-map backed by an ES6 Map.
-  @pragma('dart2js:tryInline')
-  factory JsLinkedHashMap.es6() {
-    return (_USE_ES6_MAPS && JsLinkedHashMap._supportsEs6Maps)
-        ? new Es6LinkedHashMap<K, V>()
-        : new JsLinkedHashMap<K, V>();
-  }
-
-  int get length => _length;
-  bool get isEmpty => _length == 0;
-  bool get isNotEmpty => !isEmpty;
-
-  Iterable<K> get keys {
-    return new LinkedHashMapKeyIterable<K>(this);
-  }
-
-  Iterable<V> get values {
-    return new MappedIterable<K, V>(keys, (each) => this[each] as V);
-  }
-
-  bool containsKey(Object? key) {
-    if (_isStringKey(key)) {
-      var strings = _strings;
-      if (strings == null) return false;
-      return _containsTableEntry(strings, key);
-    } else if (_isNumericKey(key)) {
-      var nums = _nums;
-      if (nums == null) return false;
-      return _containsTableEntry(nums, key);
-    } else {
-      return internalContainsKey(key);
-    }
-  }
-
-  bool internalContainsKey(Object? key) {
-    var rest = _rest;
-    if (rest == null) return false;
-    var bucket = _getBucket(rest, key);
-    return internalFindBucketIndex(bucket, key) >= 0;
-  }
-
-  bool containsValue(Object? value) {
-    return keys.any((each) => this[each] == value);
-  }
-
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      this[key] = value;
-    });
-  }
-
-  V? operator [](Object? key) {
-    if (_isStringKey(key)) {
-      var strings = _strings;
-      if (strings == null) return null;
-      LinkedHashMapCell? cell = _getTableCell(strings, key);
-      return JS('', '#', cell == null ? null : cell.hashMapCellValue);
-    } else if (_isNumericKey(key)) {
-      var nums = _nums;
-      if (nums == null) return null;
-      LinkedHashMapCell? cell = _getTableCell(nums, key);
-      return JS('', '#', cell == null ? null : cell.hashMapCellValue);
-    } else {
-      return internalGet(key);
-    }
-  }
-
-  V? internalGet(Object? key) {
-    var rest = _rest;
-    if (rest == null) return null;
-    var bucket = _getBucket(rest, key);
-    int index = internalFindBucketIndex(bucket, key);
-    if (index < 0) return null;
-    LinkedHashMapCell cell = JS('var', '#[#]', bucket, index);
-    return JS('', '#', cell.hashMapCellValue);
-  }
-
-  void operator []=(K key, V value) {
-    if (_isStringKey(key)) {
-      var strings = _strings;
-      if (strings == null) _strings = strings = _newHashTable();
-      _addHashTableEntry(strings, key, value);
-    } else if (_isNumericKey(key)) {
-      var nums = _nums;
-      if (nums == null) _nums = nums = _newHashTable();
-      _addHashTableEntry(nums, key, value);
-    } else {
-      internalSet(key, value);
-    }
-  }
-
-  void internalSet(K key, V value) {
-    var rest = _rest;
-    if (rest == null) _rest = rest = _newHashTable();
-    var hash = internalComputeHashCode(key);
-    var bucket = _getTableBucket(rest, hash);
-    if (bucket == null) {
-      LinkedHashMapCell cell = _newLinkedCell(key, value);
-      _setTableEntry(rest, hash, JS('var', '[#]', cell));
-    } else {
-      int index = internalFindBucketIndex(bucket, key);
-      if (index >= 0) {
-        LinkedHashMapCell cell = JS('var', '#[#]', bucket, index);
-        cell.hashMapCellValue = value;
-      } else {
-        LinkedHashMapCell cell = _newLinkedCell(key, value);
-        JS('void', '#.push(#)', bucket, cell);
-      }
-    }
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) return this[key] as V;
-    V value = ifAbsent();
-    this[key] = value;
-    return value;
-  }
-
-  V? remove(Object? key) {
-    if (_isStringKey(key)) {
-      return _removeHashTableEntry(_strings, key);
-    } else if (_isNumericKey(key)) {
-      return _removeHashTableEntry(_nums, key);
-    } else {
-      return internalRemove(key);
-    }
-  }
-
-  V? internalRemove(Object? key) {
-    var rest = _rest;
-    if (rest == null) return null;
-    var hash = internalComputeHashCode(key);
-    var bucket = _getTableBucket(rest, hash);
-    int index = internalFindBucketIndex(bucket, key);
-    if (index < 0) return null;
-    // Use splice to remove the [cell] element at the index and
-    // unlink the cell before returning its value.
-    LinkedHashMapCell cell = JS('var', '#.splice(#, 1)[0]', bucket, index);
-    _unlinkCell(cell);
-    // Remove empty bucket list to avoid memory leak.
-    if (JS('int', '#.length', bucket) == 0) {
-      _deleteTableEntry(rest, hash);
-    }
-    return JS('', '#', cell.hashMapCellValue);
-  }
-
-  void clear() {
-    if (_length > 0) {
-      _strings = _nums = _rest = _first = _last = null;
-      _length = 0;
-      _modified();
-    }
-  }
-
-  void forEach(void action(K key, V value)) {
-    LinkedHashMapCell? cell = _first;
-    int modifications = _modifications;
-    while (cell != null) {
-      K key = JS('', '#', cell.hashMapCellKey);
-      V value = JS('', '#', cell.hashMapCellValue);
-      action(key, value);
-      if (modifications != _modifications) {
-        throw new ConcurrentModificationError(this);
-      }
-      cell = cell._next;
-    }
-  }
-
-  void _addHashTableEntry(var table, K key, V value) {
-    LinkedHashMapCell? cell = _getTableCell(table, key);
-    if (cell == null) {
-      _setTableEntry(table, key, _newLinkedCell(key, value));
-    } else {
-      cell.hashMapCellValue = value;
-    }
-  }
-
-  V? _removeHashTableEntry(var table, Object? key) {
-    if (table == null) return null;
-    LinkedHashMapCell? cell = _getTableCell(table, key);
-    if (cell == null) return null;
-    _unlinkCell(cell);
-    _deleteTableEntry(table, key);
-    return JS('', '#', cell.hashMapCellValue);
-  }
-
-  void _modified() {
-    // Value cycles after 2^30 modifications so that modification counts are
-    // always unboxed (Smi) values. Modification detection will be missed if you
-    // make exactly some multiple of 2^30 modifications between advances of an
-    // iterator.
-    _modifications = (_modifications + 1) & 0x3ffffff;
-  }
-
-  // Create a new cell and link it in as the last one in the list.
-  LinkedHashMapCell _newLinkedCell(K key, V value) {
-    LinkedHashMapCell cell = new LinkedHashMapCell(key, value);
-    if (_first == null) {
-      _first = _last = cell;
-    } else {
-      LinkedHashMapCell last = _last!;
-      cell._previous = last;
-      _last = last._next = cell;
-    }
-    _length++;
-    _modified();
-    return cell;
-  }
-
-  // Unlink the given cell from the linked list of cells.
-  void _unlinkCell(LinkedHashMapCell cell) {
-    LinkedHashMapCell? previous = cell._previous;
-    LinkedHashMapCell? next = cell._next;
-    if (previous == null) {
-      assert(cell == _first);
-      _first = next;
-    } else {
-      previous._next = next;
-    }
-    if (next == null) {
-      assert(cell == _last);
-      _last = previous;
-    } else {
-      next._previous = previous;
-    }
-    _length--;
-    _modified();
-  }
-
-  static bool _isStringKey(var key) {
-    return key is String;
-  }
-
-  static bool _isNumericKey(var key) {
-    // Only treat unsigned 30-bit integers as numeric keys. This way,
-    // we avoid converting them to strings when we use them as keys in
-    // the JavaScript hash table object.
-    return key is num && JS('bool', '(# & 0x3ffffff) === #', key, key);
-  }
-
-  int internalComputeHashCode(var key) {
-    // We force the hash codes to be unsigned 30-bit integers to avoid
-    // issues with problematic keys like '__proto__'. Another option
-    // would be to throw an exception if the hash code isn't a number.
-    return JS('int', '# & 0x3ffffff', key.hashCode);
-  }
-
-  List<LinkedHashMapCell>? _getBucket(var table, var key) {
-    var hash = internalComputeHashCode(key);
-    return _getTableBucket(table, hash);
-  }
-
-  int internalFindBucketIndex(var bucket, var key) {
-    if (bucket == null) return -1;
-    int length = JS('int', '#.length', bucket);
-    for (int i = 0; i < length; i++) {
-      LinkedHashMapCell cell = JS('var', '#[#]', bucket, i);
-      if (cell.hashMapCellKey == key) return i;
-    }
-    return -1;
-  }
-
-  String toString() => MapBase.mapToString(this);
-
-  LinkedHashMapCell? _getTableCell(var table, var key) {
-    return JS('var', '#[#]', table, key);
-  }
-
-  List<LinkedHashMapCell>? _getTableBucket(var table, var key) {
-    return JS('var', '#[#]', table, key);
-  }
-
-  void _setTableEntry(var table, var key, var value) {
-    assert(value != null);
-    JS('void', '#[#] = #', table, key, value);
-  }
-
-  void _deleteTableEntry(var table, var key) {
-    JS('void', 'delete #[#]', table, key);
-  }
-
-  bool _containsTableEntry(var table, var key) {
-    LinkedHashMapCell? cell = _getTableCell(table, key);
-    return cell != null;
-  }
-
-  _newHashTable() {
-    // Create a new JavaScript object to be used as a hash table. Use
-    // Object.create to avoid the properties on Object.prototype
-    // showing up as entries.
-    var table = JS('var', 'Object.create(null)');
-    // Attempt to force the hash table into 'dictionary' mode by
-    // adding a property to it and deleting it again.
-    var temporaryKey = '<non-identifier-key>';
-    _setTableEntry(table, temporaryKey, table);
-    _deleteTableEntry(table, temporaryKey);
-    return table;
-  }
-}
-
-class Es6LinkedHashMap<K, V> extends JsLinkedHashMap<K, V> {
-  @override
-  LinkedHashMapCell? _getTableCell(var table, var key) {
-    return JS('var', '#.get(#)', table, key);
-  }
-
-  @override
-  List<LinkedHashMapCell>? _getTableBucket(var table, var key) {
-    return JS('var', '#.get(#)', table, key);
-  }
-
-  @override
-  void _setTableEntry(var table, var key, var value) {
-    JS('void', '#.set(#, #)', table, key, value);
-  }
-
-  @override
-  void _deleteTableEntry(var table, var key) {
-    JS('void', '#.delete(#)', table, key);
-  }
-
-  @override
-  bool _containsTableEntry(var table, var key) {
-    return JS('bool', '#.has(#)', table, key);
-  }
-
-  @override
-  _newHashTable() {
-    return JS('var', 'new Map()');
-  }
-}
-
-class LinkedHashMapCell {
-  final dynamic hashMapCellKey;
-  dynamic hashMapCellValue;
-
-  LinkedHashMapCell? _next;
-  LinkedHashMapCell? _previous;
-
-  LinkedHashMapCell(this.hashMapCellKey, this.hashMapCellValue);
-}
-
-class LinkedHashMapKeyIterable<E> extends EfficientLengthIterable<E> {
-  final dynamic _map;
-  LinkedHashMapKeyIterable(this._map);
-
-  int get length => _map._length;
-  bool get isEmpty => _map._length == 0;
-
-  Iterator<E> get iterator {
-    return new LinkedHashMapKeyIterator<E>(_map, _map._modifications);
-  }
-
-  bool contains(Object? element) {
-    return _map.containsKey(element);
-  }
-
-  void forEach(void f(E element)) {
-    LinkedHashMapCell? cell = _map._first;
-    int modifications = _map._modifications;
-    while (cell != null) {
-      f(JS('', '#', cell.hashMapCellKey));
-      if (modifications != _map._modifications) {
-        throw new ConcurrentModificationError(_map);
-      }
-      cell = cell._next;
-    }
-  }
-}
-
-class LinkedHashMapKeyIterator<E> implements Iterator<E> {
-  final dynamic _map;
-  final int _modifications;
-  LinkedHashMapCell? _cell;
-  E? _current;
-
-  LinkedHashMapKeyIterator(this._map, this._modifications) {
-    _cell = _map._first;
-  }
-
-  E get current => _current as E;
-
-  bool moveNext() {
-    if (_modifications != _map._modifications) {
-      throw new ConcurrentModificationError(_map);
-    }
-    var cell = _cell;
-    if (cell == null) {
-      _current = null;
-      return false;
-    } else {
-      _current = JS('', '#', cell.hashMapCellKey);
-      _cell = cell._next;
-      return true;
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/math_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/math_patch.dart
deleted file mode 100644
index 585f4c5..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/math_patch.dart
+++ /dev/null
@@ -1,329 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch file for dart:math library.
-import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show patch, checkNum;
-import 'dart:typed_data' show ByteData;
-
-@patch
-T min<T extends num>(T a, T b) => JS(
-    'returns:num;depends:none;effects:none;gvn:true',
-    r'Math.min(#, #)',
-    checkNum(a),
-    checkNum(b));
-
-@patch
-T max<T extends num>(T a, T b) => JS(
-    'returns:num;depends:none;effects:none;gvn:true',
-    r'Math.max(#, #)',
-    checkNum(a),
-    checkNum(b));
-
-@patch
-double sqrt(num x) => JS('num', r'Math.sqrt(#)', checkNum(x));
-
-@patch
-double sin(num radians) => JS('num', r'Math.sin(#)', checkNum(radians));
-
-@patch
-double cos(num radians) => JS('num', r'Math.cos(#)', checkNum(radians));
-
-@patch
-double tan(num radians) => JS('num', r'Math.tan(#)', checkNum(radians));
-
-@patch
-double acos(num x) => JS('num', r'Math.acos(#)', checkNum(x));
-
-@patch
-double asin(num x) => JS('num', r'Math.asin(#)', checkNum(x));
-
-@patch
-double atan(num x) => JS('num', r'Math.atan(#)', checkNum(x));
-
-@patch
-double atan2(num a, num b) =>
-    JS('num', r'Math.atan2(#, #)', checkNum(a), checkNum(b));
-
-@patch
-double exp(num x) => JS('num', r'Math.exp(#)', checkNum(x));
-
-@patch
-double log(num x) => JS('num', r'Math.log(#)', checkNum(x));
-
-@patch
-num pow(num x, num exponent) {
-  checkNum(x);
-  checkNum(exponent);
-  return JS('num', r'Math.pow(#, #)', x, exponent);
-}
-
-const int _POW2_32 = 0x100000000;
-
-@patch
-class Random {
-  static Random? _secureRandom;
-
-  @patch
-  factory Random([int? seed]) =>
-      (seed == null) ? const _JSRandom() : new _Random(seed);
-
-  @patch
-  factory Random.secure() => _secureRandom ??= _JSSecureRandom();
-}
-
-class _JSRandom implements Random {
-  // The Dart2JS implementation of Random doesn't use a seed.
-  const _JSRandom();
-
-  int nextInt(int max) {
-    if (max <= 0 || max > _POW2_32) {
-      throw new RangeError('max must be in range 0 < max ≤ 2^32, was $max');
-    }
-    return JS('int', '(Math.random() * #) >>> 0', max);
-  }
-
-  /// Generates a positive random floating point value uniformly distributed on
-  /// the range from 0.0, inclusive, to 1.0, exclusive.
-  double nextDouble() => JS('double', 'Math.random()');
-
-  /// Generates a random boolean value.
-  bool nextBool() => JS('bool', 'Math.random() < 0.5');
-}
-
-class _Random implements Random {
-  // Constants used by the algorithm or masking.
-  static const double _POW2_53_D = 1.0 * (0x20000000000000);
-  static const double _POW2_27_D = 1.0 * (1 << 27);
-  static const int _MASK32 = 0xFFFFFFFF;
-
-  // State comprised of two unsigned 32 bit integers.
-  int _lo = 0;
-  int _hi = 0;
-
-  // Implements:
-  //   uint64_t hash = 0;
-  //   do {
-  //      hash = hash * 1037 ^ mix64((uint64_t)seed);
-  //      seed >>= 64;
-  //   } while (seed != 0 && seed != -1);  // Limits for pos/neg seed.
-  //   if (hash == 0) {
-  //     hash = 0x5A17;
-  //   }
-  //   _lo = hash & _MASK_32;
-  //   _hi = hash >> 32;
-  // and then does four _nextState calls to shuffle bits around.
-  _Random(int seed) {
-    int empty_seed = 0;
-    if (seed < 0) {
-      empty_seed = -1;
-    }
-    do {
-      int low = seed & _MASK32;
-      seed = (seed - low) ~/ _POW2_32;
-      int high = seed & _MASK32;
-      seed = (seed - high) ~/ _POW2_32;
-
-      // Thomas Wang's 64-bit mix function.
-      // http://www.concentric.net/~Ttwang/tech/inthash.htm
-      // via. http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
-
-      // key = ~key + (key << 21);
-      int tmplow = low << 21;
-      int tmphigh = (high << 21) | (low >> 11);
-      tmplow = (~low & _MASK32) + tmplow;
-      low = tmplow & _MASK32;
-      high = (~high + tmphigh + ((tmplow - low) ~/ 0x100000000)) & _MASK32;
-      // key = key ^ (key >> 24).
-      tmphigh = high >> 24;
-      tmplow = (low >> 24) | (high << 8);
-      low ^= tmplow;
-      high ^= tmphigh;
-      // key = key * 265
-      tmplow = low * 265;
-      low = tmplow & _MASK32;
-      high = (high * 265 + (tmplow - low) ~/ 0x100000000) & _MASK32;
-      // key = key ^ (key >> 14);
-      tmphigh = high >> 14;
-      tmplow = (low >> 14) | (high << 18);
-      low ^= tmplow;
-      high ^= tmphigh;
-      // key = key * 21
-      tmplow = low * 21;
-      low = tmplow & _MASK32;
-      high = (high * 21 + (tmplow - low) ~/ 0x100000000) & _MASK32;
-      // key = key ^ (key >> 28).
-      tmphigh = high >> 28;
-      tmplow = (low >> 28) | (high << 4);
-      low ^= tmplow;
-      high ^= tmphigh;
-      // key = key + (key << 31);
-      tmplow = low << 31;
-      tmphigh = (high << 31) | (low >> 1);
-      tmplow += low;
-      low = tmplow & _MASK32;
-      high = (high + tmphigh + (tmplow - low) ~/ 0x100000000) & _MASK32;
-      // Mix end.
-
-      // seed = seed * 1037 ^ key;
-      tmplow = _lo * 1037;
-      _lo = tmplow & _MASK32;
-      _hi = (_hi * 1037 + (tmplow - _lo) ~/ 0x100000000) & _MASK32;
-      _lo ^= low;
-      _hi ^= high;
-    } while (seed != empty_seed);
-
-    if (_hi == 0 && _lo == 0) {
-      _lo = 0x5A17;
-    }
-    _nextState();
-    _nextState();
-    _nextState();
-    _nextState();
-  }
-
-  // The algorithm used here is Multiply with Carry (MWC) with a Base b = 2^32.
-  // http://en.wikipedia.org/wiki/Multiply-with-carry
-  // The constant A (0xFFFFDA61) is selected from "Numerical Recipes 3rd
-  // Edition" p.348 B1.
-
-  // Implements:
-  //   var state = (A * _lo + _hi) & _MASK_64;
-  //   _lo = state & _MASK_32;
-  //   _hi = state >> 32;
-  void _nextState() {
-    // Simulate (0xFFFFDA61 * lo + hi) without overflowing 53 bits.
-    int tmpHi = 0xFFFF0000 * _lo; // At most 48 bits of significant result.
-    int tmpHiLo = tmpHi & _MASK32; // Get the lower 32 bits.
-    int tmpHiHi = tmpHi - tmpHiLo; // And just the upper 32 bits.
-    int tmpLo = 0xDA61 * _lo;
-    int tmpLoLo = tmpLo & _MASK32;
-    int tmpLoHi = tmpLo - tmpLoLo;
-
-    int newLo = tmpLoLo + tmpHiLo + _hi;
-    _lo = newLo & _MASK32;
-    int newLoHi = newLo - _lo;
-    _hi = ((tmpLoHi + tmpHiHi + newLoHi) ~/ _POW2_32) & _MASK32;
-    assert(_lo < _POW2_32);
-    assert(_hi < _POW2_32);
-  }
-
-  int nextInt(int max) {
-    if (max <= 0 || max > _POW2_32) {
-      throw new RangeError('max must be in range 0 < max ≤ 2^32, was $max');
-    }
-    if ((max & (max - 1)) == 0) {
-      // Fast case for powers of two.
-      _nextState();
-      return _lo & (max - 1);
-    }
-
-    int rnd32;
-    int result;
-    do {
-      _nextState();
-      rnd32 = _lo;
-      result = rnd32.remainder(max) as int; // % max;
-    } while ((rnd32 - result + max) >= _POW2_32);
-    return result;
-  }
-
-  double nextDouble() {
-    _nextState();
-    int bits26 = _lo & ((1 << 26) - 1);
-    _nextState();
-    int bits27 = _lo & ((1 << 27) - 1);
-    return (bits26 * _POW2_27_D + bits27) / _POW2_53_D;
-  }
-
-  bool nextBool() {
-    _nextState();
-    return (_lo & 1) == 0;
-  }
-}
-
-class _JSSecureRandom implements Random {
-  // Reused buffer with room enough for a double.
-  final _buffer = new ByteData(8);
-
-  _JSSecureRandom() {
-    var crypto = JS('', 'self.crypto');
-    if (crypto != null) {
-      var getRandomValues = JS('', '#.getRandomValues', crypto);
-      if (getRandomValues != null) {
-        return;
-      }
-    }
-    throw new UnsupportedError(
-        'No source of cryptographically secure random numbers available.');
-  }
-
-  /// Fill _buffer from [start] to `start + length` with random bytes.
-  void _getRandomBytes(int start, int length) {
-    JS('void', 'crypto.getRandomValues(#)',
-        _buffer.buffer.asUint8List(start, length));
-  }
-
-  bool nextBool() {
-    _getRandomBytes(0, 1);
-    return _buffer.getUint8(0).isOdd;
-  }
-
-  double nextDouble() {
-    _getRandomBytes(1, 7);
-    // Set top bits 12 of double to 0x3FF which is the exponent for numbers
-    // between 1.0 and 2.0.
-    _buffer.setUint8(0, 0x3F);
-    int highByte = _buffer.getUint8(1);
-    _buffer.setUint8(1, highByte | 0xF0);
-
-    // Buffer now contains double in the range [1.0-2.0)
-    // with 52 bits of entropy (not 53).
-    // To get 53 bits, we extract the 53rd bit from higthByte before
-    // overwriting it, and add that as a least significant bit.
-    // The getFloat64 method is big-endian as default.
-    double result = _buffer.getFloat64(0) - 1.0;
-    if (highByte & 0x10 != 0) {
-      result += 1.1102230246251565e-16; // pow(2,-53).
-    }
-    return result;
-  }
-
-  int nextInt(int max) {
-    if (max <= 0 || max > _POW2_32) {
-      throw new RangeError('max must be in range 0 < max ≤ 2^32, was $max');
-    }
-    int byteCount = 1;
-    if (max > 0xFF) {
-      byteCount++;
-      if (max > 0xFFFF) {
-        byteCount++;
-        if (max > 0xFFFFFF) {
-          byteCount++;
-        }
-      }
-    }
-    _buffer.setUint32(0, 0);
-    int start = 4 - byteCount;
-    int randomLimit = pow(256, byteCount) as int;
-    while (true) {
-      _getRandomBytes(start, byteCount);
-      // The getUint32 method is big-endian as default.
-      int random = _buffer.getUint32(0);
-      if (max & (max - 1) == 0) {
-        // Max is power of 2.
-        return random & (max - 1);
-      }
-      int result = random.remainder(max) as int;
-      // Ensure results have equal probability by rejecting values in the
-      // last range of k*max .. 256**byteCount.
-      // TODO: Consider picking a higher byte count if the last range is a
-      // significant portion of the entire range - a 50% chance of having
-      // to use two more bytes is no worse than always using one more.
-      if (random - result + max < randomLimit) {
-        return result;
-      }
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart
deleted file mode 100644
index cd961a0..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Patch library for dart:mirrors.
-
-import 'dart:_js_helper' show patch;
-import 'dart:mirrors';
-
-const String _message = 'dart:mirrors is no longer supported for web apps';
-
-@patch
-MirrorSystem currentMirrorSystem() => throw new UnsupportedError(_message);
-
-@patch
-InstanceMirror reflect(dynamic reflectee) =>
-    throw new UnsupportedError(_message);
-
-@patch
-ClassMirror reflectClass(Type key) => throw new UnsupportedError(_message);
-
-@patch
-TypeMirror reflectType(Type key, [List<Type> typeArguments]) =>
-    throw new UnsupportedError(_message);
-
-@patch
-abstract class MirrorSystem {
-  Map<Uri, LibraryMirror> get libraries;
-  IsolateMirror get isolate;
-  TypeMirror get dynamicType;
-  TypeMirror get voidType;
-  TypeMirror get neverType;
-
-  @patch
-  LibraryMirror findLibrary(Symbol libraryName) =>
-      throw new UnsupportedError(_message);
-
-  @patch
-  static String getName(Symbol symbol) => throw new UnsupportedError(_message);
-
-  @patch
-  static Symbol getSymbol(String name, [LibraryMirror library]) =>
-      throw new UnsupportedError(_message);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart
deleted file mode 100644
index f5f40b7..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/native_helper.dart
+++ /dev/null
@@ -1,593 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _js_helper;
-
-// TODO(ngeoffray): stop using this method once our optimizers can
-// change str1.contains(str2) into str1.indexOf(str2) != -1.
-bool contains(String userAgent, String name) {
-  return JS('int', '#.indexOf(#)', userAgent, name) != -1;
-}
-
-int arrayLength(List array) {
-  return JS('int', '#.length', array);
-}
-
-arrayGet(List array, int index) {
-  return JS('var', '#[#]', array, index);
-}
-
-void arraySet(List array, int index, var value) {
-  JS('var', '#[#] = #', array, index, value);
-}
-
-propertyGet(var object, String property) {
-  return JS('var', '#[#]', object, property);
-}
-
-bool callHasOwnProperty(var function, var object, String property) {
-  return JS('bool', '#.call(#, #)', function, object, property);
-}
-
-void propertySet(var object, String property, var value) {
-  JS('var', '#[#] = #', object, property, value);
-}
-
-getPropertyFromPrototype(var object, String name) {
-  return JS('var', 'Object.getPrototypeOf(#)[#]', object, name);
-}
-
-/// Returns a String tag identifying the type of the native object, or `null`.
-/// The tag is not the name of the type, but usually the name of the JavaScript
-/// constructor function.  Initialized by [initHooks].
-Function? getTagFunction;
-
-/// If a lookup via [getTagFunction] on an object [object] that has [tag] fails,
-/// this function is called to provide an alternate tag.  This allows us to fail
-/// gracefully if we can make a good guess, for example, when browsers add novel
-/// kinds of HTMLElement that we have never heard of.  Initialized by
-/// [initHooks].
-Function? alternateTagFunction;
-
-/// Returns the prototype for the JavaScript constructor named by an input tag.
-/// Returns `null` if there is no such constructor, or if pre-patching of the
-/// constructor is to be avoided.  Initialized by [initHooks].
-Function? prototypeForTagFunction;
-
-String toStringForNativeObject(var obj) {
-  // TODO(sra): Is this code dead?
-  // [getTagFunction] might be uninitialized, but in usual usage, toString has
-  // been called via an interceptor and initialized it.
-  String name = getTagFunction == null
-      ? '<Unknown>'
-      : JS('String', '#', getTagFunction!(obj));
-  return 'Instance of $name';
-}
-
-int hashCodeForNativeObject(object) => Primitives.objectHashCode(object);
-
-/// Sets a JavaScript property on an object.
-void defineProperty(var obj, String property, var value) {
-  JS(
-      'void',
-      'Object.defineProperty(#, #, '
-          '{value: #, enumerable: false, writable: true, configurable: true})',
-      obj,
-      property,
-      value);
-}
-
-// Is [obj] an instance of a Dart-defined class?
-bool isDartObject(obj) {
-  // Some of the extra parens here are necessary.
-  return JS(
-      'bool',
-      '((#) instanceof (#))',
-      obj,
-      JS_BUILTIN(
-          'depends:none;effects:none;', JsBuiltin.dartObjectConstructor));
-}
-
-/// A JavaScript object mapping tags to the constructors of interceptors.
-/// This is a JavaScript object with no prototype.
-///
-/// Example: 'HTMLImageElement' maps to the ImageElement class constructor.
-get interceptorsByTag => JS_EMBEDDED_GLOBAL('=Object', INTERCEPTORS_BY_TAG);
-
-/// A JavaScript object mapping tags to `true` or `false`.
-///
-/// Example: 'HTMLImageElement' maps to `true` since, as there are no subclasses
-/// of ImageElement, it is a leaf class in the native class hierarchy.
-get leafTags => JS_EMBEDDED_GLOBAL('=Object', LEAF_TAGS);
-
-String findDispatchTagForInterceptorClass(interceptorClassConstructor) {
-  return JS(
-      '', r'#.#', interceptorClassConstructor, NATIVE_SUPERCLASS_TAG_NAME);
-}
-
-/// Cache of dispatch records for instances.  This is a JavaScript object used
-/// as a map.  Keys are instance tags, e.g. "!SomeThing".  The cache permits the
-/// sharing of one dispatch record between multiple instances.
-var dispatchRecordsForInstanceTags;
-
-/// Cache of interceptors indexed by uncacheable tags, e.g. "~SomeThing".
-/// This is a JavaScript object used as a map.
-var interceptorsForUncacheableTags;
-
-lookupInterceptor(String tag) {
-  return propertyGet(interceptorsByTag, tag);
-}
-
-// Dispatch tag marks are optional prefixes for a dispatch tag that direct how
-// the interceptor for the tag may be cached.
-
-/// No caching permitted.
-const UNCACHED_MARK = '~';
-
-/// Dispatch record must be cached per instance
-const INSTANCE_CACHED_MARK = '!';
-
-/// Dispatch record is cached on immediate prototype.
-const LEAF_MARK = '-';
-
-/// Dispatch record is cached on immediate prototype with a prototype
-/// verification to prevent the interceptor being associated with a subclass
-/// before a dispatch record is cached on the subclass.
-const INTERIOR_MARK = '+';
-
-/// A 'discriminator' function is to be used. TBD.
-const DISCRIMINATED_MARK = '*';
-
-/// Returns the interceptor for a native object, or returns `null` if not found.
-///
-/// A dispatch record is cached according to the specification of the dispatch
-/// tag for [obj].
-@pragma('dart2js:noInline')
-lookupAndCacheInterceptor(obj) {
-  assert(!isDartObject(obj));
-  String tag = getTagFunction!(obj);
-
-  // Fast path for instance (and uncached) tags because the lookup is repeated
-  // for each instance (or getInterceptor call).
-  var record = propertyGet(dispatchRecordsForInstanceTags, tag);
-  if (record != null) return patchInstance(obj, record);
-  var interceptor = propertyGet(interceptorsForUncacheableTags, tag);
-  if (interceptor != null) return interceptor;
-
-  // This lookup works for derived dispatch tags because we add them all in
-  // [initNativeDispatch].
-  var interceptorClass = lookupInterceptor(tag);
-  if (interceptorClass == null) {
-    String? altTag = alternateTagFunction!(obj, tag);
-    if (altTag != null) {
-      tag = altTag;
-      // Fast path for instance and uncached tags again.
-      record = propertyGet(dispatchRecordsForInstanceTags, tag);
-      if (record != null) return patchInstance(obj, record);
-      interceptor = propertyGet(interceptorsForUncacheableTags, tag);
-      if (interceptor != null) return interceptor;
-
-      interceptorClass = lookupInterceptor(tag);
-    }
-  }
-
-  if (interceptorClass == null) {
-    // This object is not known to Dart.  There could be several reasons for
-    // that, including (but not limited to):
-    //
-    // * A bug in native code (hopefully this is caught during development).
-    // * An unknown DOM object encountered.
-    // * JavaScript code running in an unexpected context.  For example, on
-    //   node.js.
-    return null;
-  }
-
-  interceptor = JS('', '#.prototype', interceptorClass);
-
-  var mark = JS('String|Null', '#[0]', tag);
-
-  if (mark == INSTANCE_CACHED_MARK) {
-    record = makeLeafDispatchRecord(interceptor);
-    propertySet(dispatchRecordsForInstanceTags, tag, record);
-    return patchInstance(obj, record);
-  }
-
-  if (mark == UNCACHED_MARK) {
-    propertySet(interceptorsForUncacheableTags, tag, interceptor);
-    return interceptor;
-  }
-
-  if (mark == LEAF_MARK) {
-    return patchProto(obj, makeLeafDispatchRecord(interceptor));
-  }
-
-  if (mark == INTERIOR_MARK) {
-    return patchInteriorProto(obj, interceptor);
-  }
-
-  if (mark == DISCRIMINATED_MARK) {
-    // TODO(sra): Use discriminator of tag.
-    throw new UnimplementedError(tag);
-  }
-
-  // [tag] was not explicitly an interior or leaf tag, so
-  var isLeaf = JS('bool', '(#[#]) === true', leafTags, tag);
-  if (isLeaf) {
-    return patchProto(obj, makeLeafDispatchRecord(interceptor));
-  } else {
-    return patchInteriorProto(obj, interceptor);
-  }
-}
-
-patchInstance(obj, record) {
-  setDispatchProperty(obj, record);
-  return dispatchRecordInterceptor(record);
-}
-
-patchProto(obj, record) {
-  setDispatchProperty(JS('', 'Object.getPrototypeOf(#)', obj), record);
-  return dispatchRecordInterceptor(record);
-}
-
-patchInteriorProto(obj, interceptor) {
-  var proto = JS('', 'Object.getPrototypeOf(#)', obj);
-  var record = makeDispatchRecord(interceptor, proto, null, null);
-  setDispatchProperty(proto, record);
-  return interceptor;
-}
-
-makeLeafDispatchRecord(interceptor) {
-  var fieldName = JS_GET_NAME(JsGetName.IS_INDEXABLE_FIELD_NAME);
-  bool indexability = JS('bool', r'!!#[#]', interceptor, fieldName);
-  return makeDispatchRecord(interceptor, false, null, indexability);
-}
-
-makeDefaultDispatchRecord(tag, interceptorClass, proto) {
-  var interceptor = JS('', '#.prototype', interceptorClass);
-  var isLeaf = JS('bool', '(#[#]) === true', leafTags, tag);
-  if (isLeaf) {
-    return makeLeafDispatchRecord(interceptor);
-  } else {
-    return makeDispatchRecord(interceptor, proto, null, null);
-  }
-}
-
-/// [proto] should have no shadowing prototypes that are not also assigned a
-/// dispatch rescord.
-setNativeSubclassDispatchRecord(proto, interceptor) {
-  setDispatchProperty(proto, makeLeafDispatchRecord(interceptor));
-}
-
-String constructorNameFallback(object) {
-  return JS('String', '#(#)', _constructorNameFallback, object);
-}
-
-var initNativeDispatchFlag; // null or true
-
-@pragma('dart2js:noInline')
-void initNativeDispatch() {
-  if (true == initNativeDispatchFlag) return;
-  initNativeDispatchFlag = true;
-  initNativeDispatchContinue();
-}
-
-@pragma('dart2js:noInline')
-void initNativeDispatchContinue() {
-  dispatchRecordsForInstanceTags = JS('', 'Object.create(null)');
-  interceptorsForUncacheableTags = JS('', 'Object.create(null)');
-
-  initHooks();
-
-  // Try to pro-actively patch prototypes of DOM objects.  For each of our known
-  // tags `TAG`, if `window.TAG` is a (constructor) function, set the dispatch
-  // property if the function's prototype to a dispatch record.
-  var map = interceptorsByTag;
-  var tags = JS('JSMutableArray', 'Object.getOwnPropertyNames(#)', map);
-
-  if (JS('bool', 'typeof window != "undefined"')) {
-    var context = JS('=Object', 'window');
-    var fun = JS('=Object', 'function () {}');
-    for (int i = 0; i < tags.length; i++) {
-      var tag = tags[i];
-      var proto = prototypeForTagFunction!(tag);
-      if (proto != null) {
-        var interceptorClass = JS('', '#[#]', map, tag);
-        var record = makeDefaultDispatchRecord(tag, interceptorClass, proto);
-        if (record != null) {
-          setDispatchProperty(proto, record);
-          // Ensure the modified prototype is still fast by assigning it to
-          // the prototype property of a function object.
-          JS('', '#.prototype = #', fun, proto);
-        }
-      }
-    }
-  }
-
-  // [interceptorsByTag] maps 'plain' dispatch tags.  Add all the derived
-  // dispatch tags to simplify lookup of derived tags.
-  for (int i = 0; i < tags.length; i++) {
-    var tag = JS('String', '#[#]', tags, i);
-    if (JS('bool', '/^[A-Za-z_]/.test(#)', tag)) {
-      var interceptorClass = propertyGet(map, tag);
-      propertySet(map, INSTANCE_CACHED_MARK + tag, interceptorClass);
-      propertySet(map, UNCACHED_MARK + tag, interceptorClass);
-      propertySet(map, LEAF_MARK + tag, interceptorClass);
-      propertySet(map, INTERIOR_MARK + tag, interceptorClass);
-      propertySet(map, DISCRIMINATED_MARK + tag, interceptorClass);
-    }
-  }
-}
-
-/// Initializes [getTagFunction] and [alternateTagFunction].
-///
-/// These functions are 'hook functions', collectively 'hooks'.  They
-/// initialized by applying a series of hooks transformers.  Built-in hooks
-/// transformers deal with various known browser behaviours.
-///
-/// Each hook tranformer takes a 'hooks' input which is a JavaScript object
-/// containing the hook functions, and returns the same or a new object with
-/// replacements.  The replacements can wrap the originals to provide alternate
-/// or modified behaviour.
-///
-///     { getTag: function(obj) {...},
-///       getUnknownTag: function(obj, tag) {...},
-///       prototypeForTag: function(tag) {...},
-///       discriminator: function(tag) {...},
-///      }
-///
-/// * getTag(obj) returns the dispatch tag, or `null`.
-/// * getUnknownTag(obj, tag) returns a tag when [getTag] fails.
-/// * prototypeForTag(tag) returns the prototype of the constructor for tag,
-///   or `null` if not available or prepatching is undesirable.
-/// * discriminator(tag) returns a function TBD.
-///
-/// The web site can adapt a dart2js application by loading code ahead of the
-/// dart2js application that defines hook transformers to be after the built in
-/// ones.  Code defining a transformer HT should use the following pattern to
-/// ensure multiple transformers can be composed:
-///
-///     (dartNativeDispatchHooksTransformer =
-///      window.dartNativeDispatchHooksTransformer || []).push(HT);
-///
-///
-/// TODO: Implement and describe dispatch tags and their caching methods.
-void initHooks() {
-  // The initial simple hooks:
-  var hooks = JS('', '#()', _baseHooks);
-
-  // Customize for browsers where `object.constructor.name` fails:
-  var _fallbackConstructorHooksTransformer = JS('', '#(#)',
-      _fallbackConstructorHooksTransformerGenerator, _constructorNameFallback);
-  hooks = applyHooksTransformer(_fallbackConstructorHooksTransformer, hooks);
-
-  // Customize for browsers:
-  hooks = applyHooksTransformer(_firefoxHooksTransformer, hooks);
-  hooks = applyHooksTransformer(_ieHooksTransformer, hooks);
-  hooks = applyHooksTransformer(_operaHooksTransformer, hooks);
-  hooks = applyHooksTransformer(_safariHooksTransformer, hooks);
-
-  hooks = applyHooksTransformer(_fixDocumentHooksTransformer, hooks);
-
-  // TODO(sra): Update ShadowDOM polyfil to use
-  // [dartNativeDispatchHooksTransformer] and remove this hook.
-  hooks = applyHooksTransformer(
-      _dartExperimentalFixupGetTagHooksTransformer, hooks);
-
-  // Apply global hooks.
-  //
-  // If defined, dartNativeDispatchHookdTransformer should be a single function
-  // of a JavaScript Array of functions.
-
-  if (JS('bool', 'typeof dartNativeDispatchHooksTransformer != "undefined"')) {
-    var transformers = JS('', 'dartNativeDispatchHooksTransformer');
-    if (JS('bool', 'typeof # == "function"', transformers)) {
-      transformers = [transformers];
-    }
-    if (JS('bool', '#.constructor == Array', transformers)) {
-      for (int i = 0; i < JS('int', '#.length', transformers); i++) {
-        var transformer = JS('', '#[#]', transformers, i);
-        if (JS('bool', 'typeof # == "function"', transformer)) {
-          hooks = applyHooksTransformer(transformer, hooks);
-        }
-      }
-    }
-  }
-
-  var getTag = JS('', '#.getTag', hooks);
-  var getUnknownTag = JS('', '#.getUnknownTag', hooks);
-  var prototypeForTag = JS('', '#.prototypeForTag', hooks);
-
-  getTagFunction = (o) => JS('String|Null', '#(#)', getTag, o);
-  alternateTagFunction =
-      (o, String tag) => JS('String|Null', '#(#, #)', getUnknownTag, o, tag);
-  prototypeForTagFunction =
-      (String tag) => JS('', '#(#)', prototypeForTag, tag);
-}
-
-applyHooksTransformer(transformer, hooks) {
-  var newHooks = JS('=Object|Null', '#(#)', transformer, hooks);
-  return JS('', '# || #', newHooks, hooks);
-}
-
-// JavaScript code fragments.
-//
-// This is a temporary place for the JavaScript code.
-//
-// TODO(sra): These code fragments are not minified.  They could be generated by
-// the code emitter, or JS_CONST could be improved to parse entire functions and
-// take care of the minification.
-
-const _baseHooks = const JS_CONST(r'''
-function() {
-  var toStringFunction = Object.prototype.toString;
-  function getTag(o) {
-    var s = toStringFunction.call(o);
-    return s.substring(8, s.length - 1);
-  }
-  function getUnknownTag(object, tag) {
-    // This code really belongs in [getUnknownTagGenericBrowser] but having it
-    // here allows [getUnknownTag] to be tested on d8.
-    if (/^HTML[A-Z].*Element$/.test(tag)) {
-      // Check that it is not a simple JavaScript object.
-      var name = toStringFunction.call(object);
-      if (name == "[object Object]") return null;
-      return "HTMLElement";
-    }
-  }
-  function getUnknownTagGenericBrowser(object, tag) {
-    if (self.HTMLElement && object instanceof HTMLElement) return "HTMLElement";
-    return getUnknownTag(object, tag);
-  }
-  function prototypeForTag(tag) {
-    if (typeof window == "undefined") return null;
-    if (typeof window[tag] == "undefined") return null;
-    var constructor = window[tag];
-    if (typeof constructor != "function") return null;
-    return constructor.prototype;
-  }
-  function discriminator(tag) { return null; }
-
-  var isBrowser = typeof navigator == "object";
-
-  return {
-    getTag: getTag,
-    getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag,
-    prototypeForTag: prototypeForTag,
-    discriminator: discriminator };
-}''');
-
-/// Returns the name of the constructor function for browsers where
-/// `object.constructor.name` is not reliable.
-///
-/// This function is split out of
-/// [_fallbackConstructorHooksTransformerGenerator] as it is called from both
-/// the dispatch hooks and via [constructorNameFallback] from objectToString.
-const _constructorNameFallback = const JS_CONST(r'''
-function getTagFallback(o) {
-  var s = Object.prototype.toString.call(o);
-  return s.substring(8, s.length - 1);
-}''');
-
-const _fallbackConstructorHooksTransformerGenerator = const JS_CONST(r'''
-function(getTagFallback) {
-  return function(hooks) {
-    // If we are not in a browser, assume we are in d8.
-    // TODO(sra): Recognize jsshell.
-    if (typeof navigator != "object") return hooks;
-
-    var ua = navigator.userAgent;
-    // TODO(antonm): remove a reference to DumpRenderTree.
-    if (ua.indexOf("DumpRenderTree") >= 0) return hooks;
-    if (ua.indexOf("Chrome") >= 0) {
-      // Confirm constructor name is usable for dispatch.
-      function confirm(p) {
-        return typeof window == "object" && window[p] && window[p].name == p;
-      }
-      if (confirm("Window") && confirm("HTMLElement")) return hooks;
-    }
-
-    hooks.getTag = getTagFallback;
-  };
-}''');
-
-const _ieHooksTransformer = const JS_CONST(r'''
-function(hooks) {
-  var userAgent = typeof navigator == "object" ? navigator.userAgent : "";
-  if (userAgent.indexOf("Trident/") == -1) return hooks;
-
-  var getTag = hooks.getTag;
-
-  var quickMap = {
-    "BeforeUnloadEvent": "Event",
-    "DataTransfer": "Clipboard",
-    "HTMLDDElement": "HTMLElement",
-    "HTMLDTElement": "HTMLElement",
-    "HTMLPhraseElement": "HTMLElement",
-    "Position": "Geoposition"
-  };
-
-  function getTagIE(o) {
-    var tag = getTag(o);
-    var newTag = quickMap[tag];
-    if (newTag) return newTag;
-    // Patches for types which report themselves as Objects.
-    if (tag == "Object") {
-      if (window.DataView && (o instanceof window.DataView)) return "DataView";
-    }
-    return tag;
-  }
-
-  function prototypeForTagIE(tag) {
-    var constructor = window[tag];
-    if (constructor == null) return null;
-    return constructor.prototype;
-  }
-
-  hooks.getTag = getTagIE;
-  hooks.prototypeForTag = prototypeForTagIE;
-}''');
-
-const _fixDocumentHooksTransformer = const JS_CONST(r'''
-function(hooks) {
-  var getTag = hooks.getTag;
-  var prototypeForTag = hooks.prototypeForTag;
-  function getTagFixed(o) {
-    var tag = getTag(o);
-    if (tag == "Document") {
-      // Some browsers and the polymer polyfill call both HTML and XML documents
-      // "Document", so we check for the xmlVersion property, which is the empty
-      // string on HTML documents. Since both dart:html classes Document and
-      // HtmlDocument share the same type, we must patch the instances and not
-      // the prototype.
-      if (!!o.xmlVersion) return "!Document";
-      return "!HTMLDocument";
-    }
-    return tag;
-  }
-
-  function prototypeForTagFixed(tag) {
-    if (tag == "Document") return null;  // Do not pre-patch Document.
-    return prototypeForTag(tag);
-  }
-
-  hooks.getTag = getTagFixed;
-  hooks.prototypeForTag = prototypeForTagFixed;
-}''');
-
-const _firefoxHooksTransformer = const JS_CONST(r'''
-function(hooks) {
-  var userAgent = typeof navigator == "object" ? navigator.userAgent : "";
-  if (userAgent.indexOf("Firefox") == -1) return hooks;
-
-  var getTag = hooks.getTag;
-
-  var quickMap = {
-    "BeforeUnloadEvent": "Event",
-    "DataTransfer": "Clipboard",
-    "GeoGeolocation": "Geolocation",
-    "Location": "!Location",               // Fixes issue 18151
-    "WorkerMessageEvent": "MessageEvent",
-    "XMLDocument": "!Document"};
-
-  function getTagFirefox(o) {
-    var tag = getTag(o);
-    return quickMap[tag] || tag;
-  }
-
-  hooks.getTag = getTagFirefox;
-}''');
-
-const _operaHooksTransformer = const JS_CONST(r'''
-function(hooks) { return hooks; }
-''');
-
-const _safariHooksTransformer = const JS_CONST(r'''
-function(hooks) { return hooks; }
-''');
-
-const _dartExperimentalFixupGetTagHooksTransformer = const JS_CONST(r'''
-function(hooks) {
-  if (typeof dartExperimentalFixupGetTag != "function") return hooks;
-  hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag);
-}''');
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/native_typed_data.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/native_typed_data.dart
deleted file mode 100644
index 39d527b..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/native_typed_data.dart
+++ /dev/null
@@ -1,1816 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Specialized integers and floating point numbers,
-/// with SIMD support and efficient lists.
-library dart.typed_data.implementation;
-
-import 'dart:collection' show ListMixin;
-import 'dart:_internal' show FixedLengthListMixin hide Symbol;
-import 'dart:_interceptors' show JSIndexable, JSUInt32, JSUInt31;
-import 'dart:_js_helper'
-    show
-        Creates,
-        JavaScriptIndexingBehavior,
-        JSName,
-        Native,
-        Returns,
-        diagnoseIndexError,
-        diagnoseRangeError;
-import 'dart:_foreign_helper' show JS;
-import 'dart:math' as Math;
-
-import 'dart:typed_data';
-
-@Native('ArrayBuffer')
-class NativeByteBuffer implements ByteBuffer {
-  @JSName('byteLength')
-  int get lengthInBytes native;
-
-  Type get runtimeType => ByteBuffer;
-
-  Uint8List asUint8List([int offsetInBytes = 0, int? length]) {
-    return NativeUint8List.view(this, offsetInBytes, length);
-  }
-
-  Int8List asInt8List([int offsetInBytes = 0, int? length]) {
-    return NativeInt8List.view(this, offsetInBytes, length);
-  }
-
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) {
-    return NativeUint8ClampedList.view(this, offsetInBytes, length);
-  }
-
-  Uint16List asUint16List([int offsetInBytes = 0, int? length]) {
-    return NativeUint16List.view(this, offsetInBytes, length);
-  }
-
-  Int16List asInt16List([int offsetInBytes = 0, int? length]) {
-    return NativeInt16List.view(this, offsetInBytes, length);
-  }
-
-  Uint32List asUint32List([int offsetInBytes = 0, int? length]) {
-    return NativeUint32List.view(this, offsetInBytes, length);
-  }
-
-  Int32List asInt32List([int offsetInBytes = 0, int? length]) {
-    return NativeInt32List.view(this, offsetInBytes, length);
-  }
-
-  Uint64List asUint64List([int offsetInBytes = 0, int? length]) {
-    throw UnsupportedError('Uint64List not supported by dart2js.');
-  }
-
-  Int64List asInt64List([int offsetInBytes = 0, int? length]) {
-    throw UnsupportedError('Int64List not supported by dart2js.');
-  }
-
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) {
-    var storage =
-        this.asInt32List(offsetInBytes, length != null ? length * 4 : null);
-    return NativeInt32x4List._externalStorage(storage);
-  }
-
-  Float32List asFloat32List([int offsetInBytes = 0, int? length]) {
-    return NativeFloat32List.view(this, offsetInBytes, length);
-  }
-
-  Float64List asFloat64List([int offsetInBytes = 0, int? length]) {
-    return NativeFloat64List.view(this, offsetInBytes, length);
-  }
-
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) {
-    var storage =
-        this.asFloat32List(offsetInBytes, length != null ? length * 4 : null);
-    return NativeFloat32x4List._externalStorage(storage);
-  }
-
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) {
-    var storage =
-        this.asFloat64List(offsetInBytes, length != null ? length * 2 : null);
-    return NativeFloat64x2List._externalStorage(storage);
-  }
-
-  ByteData asByteData([int offsetInBytes = 0, int? length]) {
-    return NativeByteData.view(this, offsetInBytes, length);
-  }
-}
-
-/// A fixed-length list of Float32x4 numbers that is viewable as a
-/// [TypedData]. For long lists, this implementation will be considerably more
-/// space- and time-efficient than the default [List] implementation.
-class NativeFloat32x4List extends Object
-    with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
-    implements Float32x4List {
-  final Float32List _storage;
-
-  /// Creates a [Float32x4List] of the specified length (in elements),
-  /// all of whose elements are initially zero.
-  NativeFloat32x4List(int length) : _storage = NativeFloat32List(length * 4);
-
-  NativeFloat32x4List._externalStorage(this._storage);
-
-  NativeFloat32x4List._slowFromList(List<Float32x4> list)
-      : _storage = NativeFloat32List(list.length * 4) {
-    for (int i = 0; i < list.length; i++) {
-      var e = list[i];
-      _storage[(i * 4) + 0] = e.x;
-      _storage[(i * 4) + 1] = e.y;
-      _storage[(i * 4) + 2] = e.z;
-      _storage[(i * 4) + 3] = e.w;
-    }
-  }
-
-  Type get runtimeType => Float32x4List;
-
-  /// Creates a [Float32x4List] with the same size as the [elements] list
-  /// and copies over the elements.
-  factory NativeFloat32x4List.fromList(List<Float32x4> list) {
-    if (list is NativeFloat32x4List) {
-      return NativeFloat32x4List._externalStorage(
-          NativeFloat32List.fromList(list._storage));
-    } else {
-      return NativeFloat32x4List._slowFromList(list);
-    }
-  }
-
-  ByteBuffer get buffer => _storage.buffer;
-
-  int get lengthInBytes => _storage.lengthInBytes;
-
-  int get offsetInBytes => _storage.offsetInBytes;
-
-  int get elementSizeInBytes => Float32x4List.bytesPerElement;
-
-  int get length => _storage.length ~/ 4;
-
-  Float32x4 operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    double _x = _storage[(index * 4) + 0];
-    double _y = _storage[(index * 4) + 1];
-    double _z = _storage[(index * 4) + 2];
-    double _w = _storage[(index * 4) + 3];
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  void operator []=(int index, Float32x4 value) {
-    _checkValidIndex(index, this, this.length);
-    _storage[(index * 4) + 0] = value.x;
-    _storage[(index * 4) + 1] = value.y;
-    _storage[(index * 4) + 2] = value.z;
-    _storage[(index * 4) + 3] = value.w;
-  }
-
-  Float32x4List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    return NativeFloat32x4List._externalStorage(
-        _storage.sublist(start * 4, stop * 4));
-  }
-}
-
-/// A fixed-length list of Int32x4 numbers that is viewable as a
-/// [TypedData]. For long lists, this implementation will be considerably more
-/// space- and time-efficient than the default [List] implementation.
-class NativeInt32x4List extends Object
-    with ListMixin<Int32x4>, FixedLengthListMixin<Int32x4>
-    implements Int32x4List {
-  final Int32List _storage;
-
-  /// Creates a [Int32x4List] of the specified length (in elements),
-  /// all of whose elements are initially zero.
-  NativeInt32x4List(int length) : _storage = NativeInt32List(length * 4);
-
-  NativeInt32x4List._externalStorage(Int32List storage) : _storage = storage;
-
-  NativeInt32x4List._slowFromList(List<Int32x4> list)
-      : _storage = NativeInt32List(list.length * 4) {
-    for (int i = 0; i < list.length; i++) {
-      var e = list[i];
-      _storage[(i * 4) + 0] = e.x;
-      _storage[(i * 4) + 1] = e.y;
-      _storage[(i * 4) + 2] = e.z;
-      _storage[(i * 4) + 3] = e.w;
-    }
-  }
-
-  Type get runtimeType => Int32x4List;
-
-  /// Creates a [Int32x4List] with the same size as the [elements] list
-  /// and copies over the elements.
-  factory NativeInt32x4List.fromList(List<Int32x4> list) {
-    if (list is NativeInt32x4List) {
-      return NativeInt32x4List._externalStorage(
-          NativeInt32List.fromList(list._storage));
-    } else {
-      return NativeInt32x4List._slowFromList(list);
-    }
-  }
-
-  ByteBuffer get buffer => _storage.buffer;
-
-  int get lengthInBytes => _storage.lengthInBytes;
-
-  int get offsetInBytes => _storage.offsetInBytes;
-
-  int get elementSizeInBytes => Int32x4List.bytesPerElement;
-
-  int get length => _storage.length ~/ 4;
-
-  Int32x4 operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    int _x = _storage[(index * 4) + 0];
-    int _y = _storage[(index * 4) + 1];
-    int _z = _storage[(index * 4) + 2];
-    int _w = _storage[(index * 4) + 3];
-    return NativeInt32x4._truncated(_x, _y, _z, _w);
-  }
-
-  void operator []=(int index, Int32x4 value) {
-    _checkValidIndex(index, this, this.length);
-    _storage[(index * 4) + 0] = value.x;
-    _storage[(index * 4) + 1] = value.y;
-    _storage[(index * 4) + 2] = value.z;
-    _storage[(index * 4) + 3] = value.w;
-  }
-
-  Int32x4List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    return NativeInt32x4List._externalStorage(
-        _storage.sublist(start * 4, stop * 4));
-  }
-}
-
-/// A fixed-length list of Float64x2 numbers that is viewable as a
-/// [TypedData]. For long lists, this implementation will be considerably more
-/// space- and time-efficient than the default [List] implementation.
-class NativeFloat64x2List extends Object
-    with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
-    implements Float64x2List {
-  final Float64List _storage;
-
-  /// Creates a [Float64x2List] of the specified length (in elements),
-  /// all of whose elements are initially zero.
-  NativeFloat64x2List(int length) : _storage = NativeFloat64List(length * 2);
-
-  NativeFloat64x2List._externalStorage(this._storage);
-
-  NativeFloat64x2List._slowFromList(List<Float64x2> list)
-      : _storage = NativeFloat64List(list.length * 2) {
-    for (int i = 0; i < list.length; i++) {
-      var e = list[i];
-      _storage[(i * 2) + 0] = e.x;
-      _storage[(i * 2) + 1] = e.y;
-    }
-  }
-
-  /// Creates a [Float64x2List] with the same size as the [elements] list
-  /// and copies over the elements.
-  factory NativeFloat64x2List.fromList(List<Float64x2> list) {
-    if (list is NativeFloat64x2List) {
-      return NativeFloat64x2List._externalStorage(
-          NativeFloat64List.fromList(list._storage));
-    } else {
-      return NativeFloat64x2List._slowFromList(list);
-    }
-  }
-
-  Type get runtimeType => Float64x2List;
-
-  ByteBuffer get buffer => _storage.buffer;
-
-  int get lengthInBytes => _storage.lengthInBytes;
-
-  int get offsetInBytes => _storage.offsetInBytes;
-
-  int get elementSizeInBytes => Float64x2List.bytesPerElement;
-
-  int get length => _storage.length ~/ 2;
-
-  Float64x2 operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    double _x = _storage[(index * 2) + 0];
-    double _y = _storage[(index * 2) + 1];
-    return Float64x2(_x, _y);
-  }
-
-  void operator []=(int index, Float64x2 value) {
-    _checkValidIndex(index, this, this.length);
-    _storage[(index * 2) + 0] = value.x;
-    _storage[(index * 2) + 1] = value.y;
-  }
-
-  Float64x2List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    return NativeFloat64x2List._externalStorage(
-        _storage.sublist(start * 2, stop * 2));
-  }
-}
-
-@Native('ArrayBufferView')
-class NativeTypedData implements TypedData {
-  /// Returns the byte buffer associated with this object.
-  @Creates('NativeByteBuffer')
-  @Returns('NativeByteBuffer')
-  ByteBuffer get buffer native;
-
-  /// Returns the length of this view, in bytes.
-  @JSName('byteLength')
-  int get lengthInBytes native;
-
-  /// Returns the offset in bytes into the underlying byte buffer of this view.
-  @JSName('byteOffset')
-  int get offsetInBytes native;
-
-  /// Returns the number of bytes in the representation of each element in this
-  /// list.
-  @JSName('BYTES_PER_ELEMENT')
-  int get elementSizeInBytes native;
-
-  void _invalidPosition(int position, int length, String name) {
-    if (position is! int) {
-      throw ArgumentError.value(position, name, 'Invalid list position');
-    } else {
-      throw RangeError.range(position, 0, length, name);
-    }
-  }
-
-  void _checkPosition(int position, int length, String name) {
-    if (JS('bool', '(# >>> 0) !== #', position, position) ||
-        JS('int', '#', position) > length) {
-      // 'int' guaranteed by above test.
-      _invalidPosition(position, length, name);
-    }
-  }
-}
-
-// Validates the unnamed constructor length argument.  Checking is necessary
-// because passing unvalidated values to the native constructors can cause
-// conversions or create views.
-int _checkLength(length) {
-  if (length is! int) throw ArgumentError('Invalid length $length');
-  return length;
-}
-
-// Validates `.view` constructor arguments.  Checking is necessary because
-// passing unvalidated values to the native constructors can cause conversions
-// (e.g. String arguments) or create typed data objects that are not actually
-// views of the input.
-void _checkViewArguments(buffer, offsetInBytes, length) {
-  if (buffer is! NativeByteBuffer) {
-    throw ArgumentError('Invalid view buffer');
-  }
-  if (offsetInBytes is! int) {
-    throw ArgumentError('Invalid view offsetInBytes $offsetInBytes');
-  }
-  if (length is! int?) {
-    throw ArgumentError('Invalid view length $length');
-  }
-}
-
-// Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
-// returns a copy of the list.
-List _ensureNativeList(List list) {
-  if (list is JSIndexable) return list;
-  List result = List.filled(list.length, null);
-  for (int i = 0; i < list.length; i++) {
-    result[i] = list[i];
-  }
-  return result;
-}
-
-@Native('DataView')
-class NativeByteData extends NativeTypedData implements ByteData {
-  /// Creates a [ByteData] of the specified length (in elements), all of
-  /// whose elements are initially zero.
-  factory NativeByteData(int length) => _create1(_checkLength(length));
-
-  /// Creates an [ByteData] _view_ of the specified region in the specified
-  /// byte buffer. Changes in the [ByteData] will be visible in the byte
-  /// buffer and vice versa. If the [offsetInBytes] index of the region is not
-  /// specified, it defaults to zero (the first byte in the byte buffer).
-  /// If the length is not specified, it defaults to null, which indicates
-  /// that the view extends to the end of the byte buffer.
-  ///
-  /// Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-  /// if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-  /// the length of [buffer].
-  factory NativeByteData.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => ByteData;
-
-  int get elementSizeInBytes => 1;
-
-  /// Returns the floating point number represented by the four bytes at
-  /// the specified [byteOffset] in this object, in IEEE 754
-  /// single-precision binary floating-point format (binary32).
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  double getFloat32(int byteOffset, [Endian endian = Endian.big]) =>
-      _getFloat32(byteOffset, Endian.little == endian);
-
-  @JSName('getFloat32')
-  @Returns('double')
-  double _getFloat32(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the floating point number represented by the eight bytes at
-  /// the specified [byteOffset] in this object, in IEEE 754
-  /// double-precision binary floating-point format (binary64).
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  double getFloat64(int byteOffset, [Endian endian = Endian.big]) =>
-      _getFloat64(byteOffset, Endian.little == endian);
-
-  @JSName('getFloat64')
-  @Returns('double')
-  double _getFloat64(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the (possibly negative) integer represented by the two bytes at
-  /// the specified [byteOffset] in this object, in two's complement binary
-  /// form.
-  /// The return value will be between 2<sup>15</sup> and 2<sup>15</sup> - 1,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  int getInt16(int byteOffset, [Endian endian = Endian.big]) =>
-      _getInt16(byteOffset, Endian.little == endian);
-
-  @JSName('getInt16')
-  @Returns('int')
-  int _getInt16(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the (possibly negative) integer represented by the four bytes at
-  /// the specified [byteOffset] in this object, in two's complement binary
-  /// form.
-  /// The return value will be between 2<sup>31</sup> and 2<sup>31</sup> - 1,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  int getInt32(int byteOffset, [Endian endian = Endian.big]) =>
-      _getInt32(byteOffset, Endian.little == endian);
-
-  @JSName('getInt32')
-  @Returns('int')
-  int _getInt32(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the (possibly negative) integer represented by the eight bytes at
-  /// the specified [byteOffset] in this object, in two's complement binary
-  /// form.
-  /// The return value will be between 2<sup>63</sup> and 2<sup>63</sup> - 1,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  int getInt64(int byteOffset, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Int64 accessor not supported by dart2js.');
-  }
-
-  /// Returns the (possibly negative) integer represented by the byte at the
-  /// specified [byteOffset] in this object, in two's complement binary
-  /// representation. The return value will be between -128 and 127, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// greater than or equal to the length of this object.
-  int getInt8(int byteOffset) native;
-
-  /// Returns the positive integer represented by the two bytes starting
-  /// at the specified [byteOffset] in this object, in unsigned binary
-  /// form.
-  /// The return value will be between 0 and  2<sup>16</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  int getUint16(int byteOffset, [Endian endian = Endian.big]) =>
-      _getUint16(byteOffset, Endian.little == endian);
-
-  @JSName('getUint16')
-  @Returns('JSUInt31')
-  int _getUint16(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the positive integer represented by the four bytes starting
-  /// at the specified [byteOffset] in this object, in unsigned binary
-  /// form.
-  /// The return value will be between 0 and  2<sup>32</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  int getUint32(int byteOffset, [Endian endian = Endian.big]) =>
-      _getUint32(byteOffset, Endian.little == endian);
-
-  @JSName('getUint32')
-  @Returns('JSUInt32')
-  int _getUint32(int byteOffset, [bool? littleEndian]) native;
-
-  /// Returns the positive integer represented by the eight bytes starting
-  /// at the specified [byteOffset] in this object, in unsigned binary
-  /// form.
-  /// The return value will be between 0 and  2<sup>64</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  int getUint64(int byteOffset, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Uint64 accessor not supported by dart2js.');
-  }
-
-  /// Returns the positive integer represented by the byte at the specified
-  /// [byteOffset] in this object, in unsigned binary form. The
-  /// return value will be between 0 and 255, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// greater than or equal to the length of this object.
-  int getUint8(int byteOffset) native;
-
-  /// Sets the four bytes starting at the specified [byteOffset] in this
-  /// object to the IEEE 754 single-precision binary floating-point
-  /// (binary32) representation of the specified [value].
-  ///
-  /// **Note that this method can lose precision.** The input [value] is
-  /// a 64-bit floating point value, which will be converted to 32-bit
-  /// floating point value by IEEE 754 rounding rules before it is stored.
-  /// If [value] cannot be represented exactly as a binary32, it will be
-  /// converted to the nearest binary32 value.  If two binary32 values are
-  /// equally close, the one whose least significant bit is zero will be used.
-  /// Note that finite (but large) values can be converted to infinity, and
-  /// small non-zero values can be converted to zero.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  void setFloat32(int byteOffset, num value, [Endian endian = Endian.big]) =>
-      _setFloat32(byteOffset, value, Endian.little == endian);
-
-  @JSName('setFloat32')
-  void _setFloat32(int byteOffset, num value, [bool? littleEndian]) native;
-
-  /// Sets the eight bytes starting at the specified [byteOffset] in this
-  /// object to the IEEE 754 double-precision binary floating-point
-  /// (binary64) representation of the specified [value].
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  void setFloat64(int byteOffset, num value, [Endian endian = Endian.big]) =>
-      _setFloat64(byteOffset, value, Endian.little == endian);
-
-  @JSName('setFloat64')
-  void _setFloat64(int byteOffset, num value, [bool? littleEndian]) native;
-
-  /// Sets the two bytes starting at the specified [byteOffset] in this
-  /// object to the two's complement binary representation of the specified
-  /// [value], which must fit in two bytes. In other words, [value] must lie
-  /// between 2<sup>15</sup> and 2<sup>15</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  void setInt16(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setInt16(byteOffset, value, Endian.little == endian);
-
-  @JSName('setInt16')
-  void _setInt16(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the four bytes starting at the specified [byteOffset] in this
-  /// object to the two's complement binary representation of the specified
-  /// [value], which must fit in four bytes. In other words, [value] must lie
-  /// between 2<sup>31</sup> and 2<sup>31</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  void setInt32(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setInt32(byteOffset, value, Endian.little == endian);
-
-  @JSName('setInt32')
-  void _setInt32(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the eight bytes starting at the specified [byteOffset] in this
-  /// object to the two's complement binary representation of the specified
-  /// [value], which must fit in eight bytes. In other words, [value] must lie
-  /// between 2<sup>63</sup> and 2<sup>63</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  void setInt64(int byteOffset, int value, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Int64 accessor not supported by dart2js.');
-  }
-
-  /// Sets the byte at the specified [byteOffset] in this object to the
-  /// two's complement binary representation of the specified [value], which
-  /// must fit in a single byte. In other words, [value] must be between
-  /// -128 and 127, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// greater than or equal to the length of this object.
-  void setInt8(int byteOffset, int value) native;
-
-  /// Sets the two bytes starting at the specified [byteOffset] in this object
-  /// to the unsigned binary representation of the specified [value],
-  /// which must fit in two bytes. in other words, [value] must be between
-  /// 0 and 2<sup>16</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 2` is greater than the length of this object.
-  void setUint16(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setUint16(byteOffset, value, Endian.little == endian);
-
-  @JSName('setUint16')
-  void _setUint16(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the four bytes starting at the specified [byteOffset] in this object
-  /// to the unsigned binary representation of the specified [value],
-  /// which must fit in four bytes. in other words, [value] must be between
-  /// 0 and 2<sup>32</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 4` is greater than the length of this object.
-  void setUint32(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _setUint32(byteOffset, value, Endian.little == endian);
-
-  @JSName('setUint32')
-  void _setUint32(int byteOffset, int value, [bool? littleEndian]) native;
-
-  /// Sets the eight bytes starting at the specified [byteOffset] in this object
-  /// to the unsigned binary representation of the specified [value],
-  /// which must fit in eight bytes. in other words, [value] must be between
-  /// 0 and 2<sup>64</sup> - 1, inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative, or
-  /// `byteOffset + 8` is greater than the length of this object.
-  void setUint64(int byteOffset, int value, [Endian endian = Endian.big]) {
-    throw UnsupportedError('Uint64 accessor not supported by dart2js.');
-  }
-
-  /// Sets the byte at the specified [byteOffset] in this object to the
-  /// unsigned binary representation of the specified [value], which must fit
-  /// in a single byte. in other words, [value] must be between 0 and 255,
-  /// inclusive.
-  ///
-  /// Throws [RangeError] if [byteOffset] is negative,
-  /// or greater than or equal to the length of this object.
-  void setUint8(int byteOffset, int value) native;
-
-  static NativeByteData _create1(arg) =>
-      JS('NativeByteData', 'new DataView(new ArrayBuffer(#))', arg);
-
-  static NativeByteData _create2(arg1, arg2) =>
-      JS('NativeByteData', 'new DataView(#, #)', arg1, arg2);
-
-  static NativeByteData _create3(arg1, arg2, arg3) =>
-      JS('NativeByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
-}
-
-abstract class NativeTypedArray<E> extends NativeTypedData
-    implements JavaScriptIndexingBehavior<E> {
-  int get length => JS('JSUInt32', '#.length', this);
-
-  void _setRangeFast(
-      int start, int end, NativeTypedArray source, int skipCount) {
-    int targetLength = this.length;
-    _checkPosition(start, targetLength, 'start');
-    _checkPosition(end, targetLength, 'end');
-    if (start > end) throw RangeError.range(start, 0, end);
-    int count = end - start;
-
-    if (skipCount < 0) throw ArgumentError(skipCount);
-
-    int sourceLength = source.length;
-    if (sourceLength - skipCount < count) {
-      throw StateError('Not enough elements');
-    }
-
-    if (skipCount != 0 || sourceLength != count) {
-      // Create a view of the exact subrange that is copied from the source.
-      source = JS('', '#.subarray(#, #)', source, skipCount, skipCount + count);
-    }
-    JS('void', '#.set(#, #)', this, source, start);
-  }
-}
-
-abstract class NativeTypedArrayOfDouble extends NativeTypedArray<double>
-    with ListMixin<double>, FixedLengthListMixin<double> {
-  double operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('num', '#[#]', this, index);
-  }
-
-  void operator []=(int index, double value) {
-    _checkValidIndex(index, this, this.length);
-    JS('void', '#[#] = #', this, index, value);
-  }
-
-  void setRange(int start, int end, Iterable<double> iterable,
-      [int skipCount = 0]) {
-    if (iterable is NativeTypedArrayOfDouble) {
-      _setRangeFast(start, end, iterable, skipCount);
-      return;
-    }
-    super.setRange(start, end, iterable, skipCount);
-  }
-}
-
-abstract class NativeTypedArrayOfInt extends NativeTypedArray<int>
-    with ListMixin<int>, FixedLengthListMixin<int>
-    implements List<int> {
-  // operator[]() is not here since different versions have different return
-  // types
-
-  void operator []=(int index, int value) {
-    _checkValidIndex(index, this, this.length);
-    JS('void', '#[#] = #', this, index, value);
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable,
-      [int skipCount = 0]) {
-    if (iterable is NativeTypedArrayOfInt) {
-      _setRangeFast(start, end, iterable, skipCount);
-      return;
-    }
-    super.setRange(start, end, iterable, skipCount);
-  }
-}
-
-@Native('Float32Array')
-class NativeFloat32List extends NativeTypedArrayOfDouble
-    implements Float32List {
-  factory NativeFloat32List(int length) => _create1(_checkLength(length));
-
-  factory NativeFloat32List.fromList(List<double> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeFloat32List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Float32List;
-
-  Float32List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeFloat32List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeFloat32List _create1(arg) =>
-      JS('NativeFloat32List', 'new Float32Array(#)', arg);
-
-  static NativeFloat32List _create2(arg1, arg2) =>
-      JS('NativeFloat32List', 'new Float32Array(#, #)', arg1, arg2);
-
-  static NativeFloat32List _create3(arg1, arg2, arg3) =>
-      JS('NativeFloat32List', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Float64Array')
-class NativeFloat64List extends NativeTypedArrayOfDouble
-    implements Float64List {
-  factory NativeFloat64List(int length) => _create1(_checkLength(length));
-
-  factory NativeFloat64List.fromList(List<double> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeFloat64List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Float64List;
-
-  Float64List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeFloat64List _create1(arg) =>
-      JS('NativeFloat64List', 'new Float64Array(#)', arg);
-
-  static NativeFloat64List _create2(arg1, arg2) =>
-      JS('NativeFloat64List', 'new Float64Array(#, #)', arg1, arg2);
-
-  static NativeFloat64List _create3(arg1, arg2, arg3) =>
-      JS('NativeFloat64List', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Int16Array')
-class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
-  factory NativeInt16List(int length) => _create1(_checkLength(length));
-
-  factory NativeInt16List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeInt16List.view(
-      NativeByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Int16List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('int', '#[#]', this, index);
-  }
-
-  Int16List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeInt16List _create1(arg) =>
-      JS('NativeInt16List', 'new Int16Array(#)', arg);
-
-  static NativeInt16List _create2(arg1, arg2) =>
-      JS('NativeInt16List', 'new Int16Array(#, #)', arg1, arg2);
-
-  static NativeInt16List _create3(arg1, arg2, arg3) =>
-      JS('NativeInt16List', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Int32Array')
-class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
-  factory NativeInt32List(int length) => _create1(_checkLength(length));
-
-  factory NativeInt32List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeInt32List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Int32List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('int', '#[#]', this, index);
-  }
-
-  Int32List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt32List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeInt32List _create1(arg) =>
-      JS('NativeInt32List', 'new Int32Array(#)', arg);
-
-  static NativeInt32List _create2(arg1, arg2) =>
-      JS('NativeInt32List', 'new Int32Array(#, #)', arg1, arg2);
-
-  static NativeInt32List _create3(arg1, arg2, arg3) =>
-      JS('NativeInt32List', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Int8Array')
-class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
-  factory NativeInt8List(int length) => _create1(_checkLength(length));
-
-  factory NativeInt8List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeInt8List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Int8List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('int', '#[#]', this, index);
-  }
-
-  Int8List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeInt8List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeInt8List _create1(arg) =>
-      JS('NativeInt8List', 'new Int8Array(#)', arg);
-
-  static NativeInt8List _create2(arg1, arg2) =>
-      JS('NativeInt8List', 'new Int8Array(#, #)', arg1, arg2);
-
-  static NativeInt8List _create3(arg1, arg2, arg3) =>
-      JS('NativeInt8List', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Uint16Array')
-class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
-  factory NativeUint16List(int length) => _create1(_checkLength(length));
-
-  factory NativeUint16List.fromList(List<int> list) =>
-      _create1(_ensureNativeList(list));
-
-  factory NativeUint16List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint16List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('JSUInt31', '#[#]', this, index);
-  }
-
-  Uint16List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeUint16List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint16List _create1(arg) =>
-      JS('NativeUint16List', 'new Uint16Array(#)', arg);
-
-  static NativeUint16List _create2(arg1, arg2) =>
-      JS('NativeUint16List', 'new Uint16Array(#, #)', arg1, arg2);
-
-  static NativeUint16List _create3(arg1, arg2, arg3) =>
-      JS('NativeUint16List', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Uint32Array')
-class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
-  factory NativeUint32List(int length) => _create1(_checkLength(length));
-
-  factory NativeUint32List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeUint32List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint32List;
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('JSUInt32', '#[#]', this, index);
-  }
-
-  Uint32List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeUint32List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint32List _create1(arg) =>
-      JS('NativeUint32List', 'new Uint32Array(#)', arg);
-
-  static NativeUint32List _create2(arg1, arg2) =>
-      JS('NativeUint32List', 'new Uint32Array(#, #)', arg1, arg2);
-
-  static NativeUint32List _create3(arg1, arg2, arg3) =>
-      JS('NativeUint32List', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
-}
-
-@Native('Uint8ClampedArray,CanvasPixelArray')
-class NativeUint8ClampedList extends NativeTypedArrayOfInt
-    implements Uint8ClampedList {
-  factory NativeUint8ClampedList(int length) => _create1(_checkLength(length));
-
-  factory NativeUint8ClampedList.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeUint8ClampedList.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint8ClampedList;
-
-  int get length => JS('JSUInt32', '#.length', this);
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('JSUInt31', '#[#]', this, index);
-  }
-
-  Uint8ClampedList sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source =
-        JS('NativeUint8ClampedList', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint8ClampedList _create1(arg) =>
-      JS('NativeUint8ClampedList', 'new Uint8ClampedArray(#)', arg);
-
-  static NativeUint8ClampedList _create2(arg1, arg2) =>
-      JS('NativeUint8ClampedList', 'new Uint8ClampedArray(#, #)', arg1, arg2);
-
-  static NativeUint8ClampedList _create3(arg1, arg2, arg3) => JS(
-      'NativeUint8ClampedList',
-      'new Uint8ClampedArray(#, #, #)',
-      arg1,
-      arg2,
-      arg3);
-}
-
-// On some browsers Uint8ClampedArray is a subtype of Uint8Array.  Marking
-// Uint8List as !nonleaf ensures that the native dispatch correctly handles
-// the potential for Uint8ClampedArray to 'accidentally' pick up the
-// dispatch record for Uint8List.
-@Native('Uint8Array,!nonleaf')
-class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
-  factory NativeUint8List(int length) => _create1(_checkLength(length));
-
-  factory NativeUint8List.fromList(List<int> elements) =>
-      _create1(_ensureNativeList(elements));
-
-  factory NativeUint8List.view(
-      ByteBuffer buffer, int offsetInBytes, int? length) {
-    _checkViewArguments(buffer, offsetInBytes, length);
-    return length == null
-        ? _create2(buffer, offsetInBytes)
-        : _create3(buffer, offsetInBytes, length);
-  }
-
-  Type get runtimeType => Uint8List;
-
-  int get length => JS('JSUInt32', '#.length', this);
-
-  int operator [](int index) {
-    _checkValidIndex(index, this, this.length);
-    return JS('JSUInt31', '#[#]', this, index);
-  }
-
-  Uint8List sublist(int start, [int? end]) {
-    var stop = _checkValidRange(start, end, this.length);
-    var source = JS('NativeUint8List', '#.subarray(#, #)', this, start, stop);
-    return _create1(source);
-  }
-
-  static NativeUint8List _create1(arg) =>
-      JS('NativeUint8List', 'new Uint8Array(#)', arg);
-
-  static NativeUint8List _create2(arg1, arg2) =>
-      JS('NativeUint8List', 'new Uint8Array(#, #)', arg1, arg2);
-
-  static NativeUint8List _create3(arg1, arg2, arg3) =>
-      JS('NativeUint8List', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
-}
-
-/// Implementation of Dart Float32x4 immutable value type and operations.
-/// Float32x4 stores 4 32-bit floating point values in "lanes".
-/// The lanes are "x", "y", "z", and "w" respectively.
-class NativeFloat32x4 implements Float32x4 {
-  final double x;
-  final double y;
-  final double z;
-  final double w;
-
-  static final NativeFloat32List _list = NativeFloat32List(4);
-  static final Uint32List _uint32view = _list.buffer.asUint32List();
-
-  static _truncate(x) {
-    _list[0] = x;
-    return _list[0];
-  }
-
-  NativeFloat32x4(double x, double y, double z, double w)
-      : this.x = _truncate(x),
-        this.y = _truncate(y),
-        this.z = _truncate(z),
-        this.w = _truncate(w) {
-    // We would prefer to check for `double` but in dart2js we can't see the
-    // difference anyway.
-    if (x is! num) throw ArgumentError(x);
-    if (y is! num) throw ArgumentError(y);
-    if (z is! num) throw ArgumentError(z);
-    if (w is! num) throw ArgumentError(w);
-  }
-
-  NativeFloat32x4.splat(double v) : this(v, v, v, v);
-  NativeFloat32x4.zero() : this._truncated(0.0, 0.0, 0.0, 0.0);
-
-  /// Returns a bit-wise copy of [i] as a Float32x4.
-  factory NativeFloat32x4.fromInt32x4Bits(Int32x4 i) {
-    _uint32view[0] = i.x;
-    _uint32view[1] = i.y;
-    _uint32view[2] = i.z;
-    _uint32view[3] = i.w;
-    return NativeFloat32x4._truncated(_list[0], _list[1], _list[2], _list[3]);
-  }
-
-  NativeFloat32x4.fromFloat64x2(Float64x2 v)
-      : this._truncated(_truncate(v.x), _truncate(v.y), 0.0, 0.0);
-
-  /// Creates a new NativeFloat32x4.
-  ///
-  /// Does not verify if the given arguments are non-null.
-  NativeFloat32x4._doubles(double x, double y, double z, double w)
-      : this.x = _truncate(x),
-        this.y = _truncate(y),
-        this.z = _truncate(z),
-        this.w = _truncate(w);
-
-  /// Creates a new NativeFloat32x4.
-  ///
-  /// The constructor does not truncate the arguments. They must already be in
-  /// the correct range. It does not verify the type of the given arguments,
-  /// either.
-  NativeFloat32x4._truncated(this.x, this.y, this.z, this.w);
-
-  String toString() {
-    return '[$x, $y, $z, $w]';
-  }
-
-  /// Addition operator.
-  Float32x4 operator +(Float32x4 other) {
-    double _x = x + other.x;
-    double _y = y + other.y;
-    double _z = z + other.z;
-    double _w = w + other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Negate operator.
-  Float32x4 operator -() {
-    return NativeFloat32x4._truncated(-x, -y, -z, -w);
-  }
-
-  /// Subtraction operator.
-  Float32x4 operator -(Float32x4 other) {
-    double _x = x - other.x;
-    double _y = y - other.y;
-    double _z = z - other.z;
-    double _w = w - other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Multiplication operator.
-  Float32x4 operator *(Float32x4 other) {
-    double _x = x * other.x;
-    double _y = y * other.y;
-    double _z = z * other.z;
-    double _w = w * other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Division operator.
-  Float32x4 operator /(Float32x4 other) {
-    double _x = x / other.x;
-    double _y = y / other.y;
-    double _z = z / other.z;
-    double _w = w / other.w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Relational less than.
-  Int32x4 lessThan(Float32x4 other) {
-    bool _cx = x < other.x;
-    bool _cy = y < other.y;
-    bool _cz = z < other.z;
-    bool _cw = w < other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational less than or equal.
-  Int32x4 lessThanOrEqual(Float32x4 other) {
-    bool _cx = x <= other.x;
-    bool _cy = y <= other.y;
-    bool _cz = z <= other.z;
-    bool _cw = w <= other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational greater than.
-  Int32x4 greaterThan(Float32x4 other) {
-    bool _cx = x > other.x;
-    bool _cy = y > other.y;
-    bool _cz = z > other.z;
-    bool _cw = w > other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational greater than or equal.
-  Int32x4 greaterThanOrEqual(Float32x4 other) {
-    bool _cx = x >= other.x;
-    bool _cy = y >= other.y;
-    bool _cz = z >= other.z;
-    bool _cw = w >= other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational equal.
-  Int32x4 equal(Float32x4 other) {
-    bool _cx = x == other.x;
-    bool _cy = y == other.y;
-    bool _cz = z == other.z;
-    bool _cw = w == other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Relational not-equal.
-  Int32x4 notEqual(Float32x4 other) {
-    bool _cx = x != other.x;
-    bool _cy = y != other.y;
-    bool _cz = z != other.z;
-    bool _cw = w != other.w;
-    return NativeInt32x4._truncated(
-        _cx ? -1 : 0, _cy ? -1 : 0, _cz ? -1 : 0, _cw ? -1 : 0);
-  }
-
-  /// Returns a copy of [this] each lane being scaled by [s].
-  Float32x4 scale(double s) {
-    double _x = s * x;
-    double _y = s * y;
-    double _z = s * z;
-    double _w = s * w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Returns the absolute value of this [Float32x4].
-  Float32x4 abs() {
-    double _x = x.abs();
-    double _y = y.abs();
-    double _z = z.abs();
-    double _w = w.abs();
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Clamps [this] to be in the range [lowerLimit]-[upperLimit].
-  Float32x4 clamp(Float32x4 lowerLimit, Float32x4 upperLimit) {
-    double _lx = lowerLimit.x;
-    double _ly = lowerLimit.y;
-    double _lz = lowerLimit.z;
-    double _lw = lowerLimit.w;
-    double _ux = upperLimit.x;
-    double _uy = upperLimit.y;
-    double _uz = upperLimit.z;
-    double _uw = upperLimit.w;
-    double _x = x;
-    double _y = y;
-    double _z = z;
-    double _w = w;
-    // MAX(MIN(self, upper), lower).
-    _x = _x > _ux ? _ux : _x;
-    _y = _y > _uy ? _uy : _y;
-    _z = _z > _uz ? _uz : _z;
-    _w = _w > _uw ? _uw : _w;
-    _x = _x < _lx ? _lx : _x;
-    _y = _y < _ly ? _ly : _y;
-    _z = _z < _lz ? _lz : _z;
-    _w = _w < _lw ? _lw : _w;
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Extract the sign bit from each lane return them in the first 4 bits.
-  int get signMask {
-    var view = _uint32view;
-    var mx, my, mz, mw;
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    // This is correct because dart2js uses the unsigned right shift.
-    mx = (view[0] & 0x80000000) >> 31;
-    my = (view[1] & 0x80000000) >> 30;
-    mz = (view[2] & 0x80000000) >> 29;
-    mw = (view[3] & 0x80000000) >> 28;
-    return mx | my | mz | mw;
-  }
-
-  /// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
-  Float32x4 shuffle(int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, 'mask');
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-
-    double _x = _list[mask & 0x3];
-    double _y = _list[(mask >> 2) & 0x3];
-    double _z = _list[(mask >> 4) & 0x3];
-    double _w = _list[(mask >> 6) & 0x3];
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Shuffle the lane values in [this] and [other]. The returned
-  /// Float32x4 will have XY lanes from [this] and ZW lanes from [other].
-  /// Uses the same [mask] as [shuffle].
-  Float32x4 shuffleMix(Float32x4 other, int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, 'mask');
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    double _x = _list[mask & 0x3];
-    double _y = _list[(mask >> 2) & 0x3];
-
-    _list[0] = other.x;
-    _list[1] = other.y;
-    _list[2] = other.z;
-    _list[3] = other.w;
-    double _z = _list[(mask >> 4) & 0x3];
-    double _w = _list[(mask >> 6) & 0x3];
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Copy [this] and replace the [x] lane.
-  Float32x4 withX(double newX) {
-    return NativeFloat32x4._truncated(_truncate(newX), y, z, w);
-  }
-
-  /// Copy [this] and replace the [y] lane.
-  Float32x4 withY(double newY) {
-    return NativeFloat32x4._truncated(x, _truncate(newY), z, w);
-  }
-
-  /// Copy [this] and replace the [z] lane.
-  Float32x4 withZ(double newZ) {
-    return NativeFloat32x4._truncated(x, y, _truncate(newZ), w);
-  }
-
-  /// Copy [this] and replace the [w] lane.
-  Float32x4 withW(double newW) {
-    return NativeFloat32x4._truncated(x, y, z, _truncate(newW));
-  }
-
-  /// Returns the lane-wise minimum value in [this] or [other].
-  Float32x4 min(Float32x4 other) {
-    double _x = x < other.x ? x : other.x;
-    double _y = y < other.y ? y : other.y;
-    double _z = z < other.z ? z : other.z;
-    double _w = w < other.w ? w : other.w;
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Returns the lane-wise maximum value in [this] or [other].
-  Float32x4 max(Float32x4 other) {
-    double _x = x > other.x ? x : other.x;
-    double _y = y > other.y ? y : other.y;
-    double _z = z > other.z ? z : other.z;
-    double _w = w > other.w ? w : other.w;
-    return NativeFloat32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Returns the square root of [this].
-  Float32x4 sqrt() {
-    double _x = Math.sqrt(x);
-    double _y = Math.sqrt(y);
-    double _z = Math.sqrt(z);
-    double _w = Math.sqrt(w);
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Returns the reciprocal of [this].
-  Float32x4 reciprocal() {
-    double _x = 1.0 / x;
-    double _y = 1.0 / y;
-    double _z = 1.0 / z;
-    double _w = 1.0 / w;
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-
-  /// Returns the square root of the reciprocal of [this].
-  Float32x4 reciprocalSqrt() {
-    double _x = Math.sqrt(1.0 / x);
-    double _y = Math.sqrt(1.0 / y);
-    double _z = Math.sqrt(1.0 / z);
-    double _w = Math.sqrt(1.0 / w);
-    return NativeFloat32x4._doubles(_x, _y, _z, _w);
-  }
-}
-
-/// Interface of Dart Int32x4 and operations.
-/// Int32x4 stores 4 32-bit bit-masks in "lanes".
-/// The lanes are "x", "y", "z", and "w" respectively.
-class NativeInt32x4 implements Int32x4 {
-  final int x;
-  final int y;
-  final int z;
-  final int w;
-
-  static final _list = NativeInt32List(4);
-
-  static _truncate(x) {
-    _list[0] = x;
-    return _list[0];
-  }
-
-  NativeInt32x4(int x, int y, int z, int w)
-      : this.x = _truncate(x),
-        this.y = _truncate(y),
-        this.z = _truncate(z),
-        this.w = _truncate(w) {
-    if (x != this.x && x is! int) throw ArgumentError(x);
-    if (y != this.y && y is! int) throw ArgumentError(y);
-    if (z != this.z && z is! int) throw ArgumentError(z);
-    if (w != this.w && w is! int) throw ArgumentError(w);
-  }
-
-  NativeInt32x4.bool(bool x, bool y, bool z, bool w)
-      : this.x = x ? -1 : 0,
-        this.y = y ? -1 : 0,
-        this.z = z ? -1 : 0,
-        this.w = w ? -1 : 0;
-
-  /// Returns a bit-wise copy of [f] as a Int32x4.
-  factory NativeInt32x4.fromFloat32x4Bits(Float32x4 f) {
-    NativeFloat32List floatList = NativeFloat32x4._list;
-    floatList[0] = f.x;
-    floatList[1] = f.y;
-    floatList[2] = f.z;
-    floatList[3] = f.w;
-    var view = floatList.buffer.asInt32List();
-    return NativeInt32x4._truncated(view[0], view[1], view[2], view[3]);
-  }
-
-  NativeInt32x4._truncated(this.x, this.y, this.z, this.w);
-
-  String toString() => '[$x, $y, $z, $w]';
-
-  /// The bit-wise or operator.
-  Int32x4 operator |(Int32x4 other) {
-    // Dart2js uses unsigned results for bit-operations.
-    // We use "JS" to fall back to the signed versions.
-    return NativeInt32x4._truncated(
-        JS('int', '# | #', x, other.x),
-        JS('int', '# | #', y, other.y),
-        JS('int', '# | #', z, other.z),
-        JS('int', '# | #', w, other.w));
-  }
-
-  /// The bit-wise and operator.
-  Int32x4 operator &(Int32x4 other) {
-    // Dart2js uses unsigned results for bit-operations.
-    // We use "JS" to fall back to the signed versions.
-    return NativeInt32x4._truncated(
-        JS('int', '# & #', x, other.x),
-        JS('int', '# & #', y, other.y),
-        JS('int', '# & #', z, other.z),
-        JS('int', '# & #', w, other.w));
-  }
-
-  /// The bit-wise xor operator.
-  Int32x4 operator ^(Int32x4 other) {
-    // Dart2js uses unsigned results for bit-operations.
-    // We use "JS" to fall back to the signed versions.
-    return NativeInt32x4._truncated(
-        JS('int', '# ^ #', x, other.x),
-        JS('int', '# ^ #', y, other.y),
-        JS('int', '# ^ #', z, other.z),
-        JS('int', '# ^ #', w, other.w));
-  }
-
-  Int32x4 operator +(Int32x4 other) {
-    // Avoid going through the typed array by "| 0" the result.
-    return NativeInt32x4._truncated(
-        JS('int', '(# + #) | 0', x, other.x),
-        JS('int', '(# + #) | 0', y, other.y),
-        JS('int', '(# + #) | 0', z, other.z),
-        JS('int', '(# + #) | 0', w, other.w));
-  }
-
-  Int32x4 operator -(Int32x4 other) {
-    // Avoid going through the typed array by "| 0" the result.
-    return NativeInt32x4._truncated(
-        JS('int', '(# - #) | 0', x, other.x),
-        JS('int', '(# - #) | 0', y, other.y),
-        JS('int', '(# - #) | 0', z, other.z),
-        JS('int', '(# - #) | 0', w, other.w));
-  }
-
-  Int32x4 operator -() {
-    // Avoid going through the typed array by "| 0" the result.
-    return NativeInt32x4._truncated(
-        JS('int', '(-#) | 0', x),
-        JS('int', '(-#) | 0', y),
-        JS('int', '(-#) | 0', z),
-        JS('int', '(-#) | 0', w));
-  }
-
-  /// Extract the top bit from each lane return them in the first 4 bits.
-  int get signMask {
-    int mx = (x & 0x80000000) >> 31;
-    int my = (y & 0x80000000) >> 31;
-    int mz = (z & 0x80000000) >> 31;
-    int mw = (w & 0x80000000) >> 31;
-    return mx | my << 1 | mz << 2 | mw << 3;
-  }
-
-  /// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
-  Int32x4 shuffle(int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, 'mask');
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    int _x = _list[mask & 0x3];
-    int _y = _list[(mask >> 2) & 0x3];
-    int _z = _list[(mask >> 4) & 0x3];
-    int _w = _list[(mask >> 6) & 0x3];
-    return NativeInt32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Shuffle the lane values in [this] and [other]. The returned
-  /// Int32x4 will have XY lanes from [this] and ZW lanes from [other].
-  /// Uses the same [mask] as [shuffle].
-  Int32x4 shuffleMix(Int32x4 other, int mask) {
-    if ((mask < 0) || (mask > 255)) {
-      throw RangeError.range(mask, 0, 255, 'mask');
-    }
-    _list[0] = x;
-    _list[1] = y;
-    _list[2] = z;
-    _list[3] = w;
-    int _x = _list[mask & 0x3];
-    int _y = _list[(mask >> 2) & 0x3];
-
-    _list[0] = other.x;
-    _list[1] = other.y;
-    _list[2] = other.z;
-    _list[3] = other.w;
-    int _z = _list[(mask >> 4) & 0x3];
-    int _w = _list[(mask >> 6) & 0x3];
-    return NativeInt32x4._truncated(_x, _y, _z, _w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new x value.
-  Int32x4 withX(int x) {
-    int _x = _truncate(x);
-    return NativeInt32x4._truncated(_x, y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new y value.
-  Int32x4 withY(int y) {
-    int _y = _truncate(y);
-    return NativeInt32x4._truncated(x, _y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new z value.
-  Int32x4 withZ(int z) {
-    int _z = _truncate(z);
-    return NativeInt32x4._truncated(x, y, _z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new w value.
-  Int32x4 withW(int w) {
-    int _w = _truncate(w);
-    return NativeInt32x4._truncated(x, y, z, _w);
-  }
-
-  /// Extracted x value. Returns `false` for 0, `true` for any other value.
-  bool get flagX => x != 0;
-
-  /// Extracted y value. Returns `false` for 0, `true` for any other value.
-  bool get flagY => y != 0;
-
-  /// Extracted z value. Returns `false` for 0, `true` for any other value.
-  bool get flagZ => z != 0;
-
-  /// Extracted w value. Returns `false` for 0, `true` for any other value.
-  bool get flagW => w != 0;
-
-  /// Returns a new [Int32x4] copied from [this] with a new x value.
-  Int32x4 withFlagX(bool flagX) {
-    int _x = flagX ? -1 : 0;
-    return NativeInt32x4._truncated(_x, y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new y value.
-  Int32x4 withFlagY(bool flagY) {
-    int _y = flagY ? -1 : 0;
-    return NativeInt32x4._truncated(x, _y, z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new z value.
-  Int32x4 withFlagZ(bool flagZ) {
-    int _z = flagZ ? -1 : 0;
-    return NativeInt32x4._truncated(x, y, _z, w);
-  }
-
-  /// Returns a new [Int32x4] copied from [this] with a new w value.
-  Int32x4 withFlagW(bool flagW) {
-    int _w = flagW ? -1 : 0;
-    return NativeInt32x4._truncated(x, y, z, _w);
-  }
-
-  /// Merge [trueValue] and [falseValue] based on [this]' bit mask:
-  /// Select bit from [trueValue] when bit in [this] is on.
-  /// Select bit from [falseValue] when bit in [this] is off.
-  Float32x4 select(Float32x4 trueValue, Float32x4 falseValue) {
-    var floatList = NativeFloat32x4._list;
-    var intView = NativeFloat32x4._uint32view;
-
-    floatList[0] = trueValue.x;
-    floatList[1] = trueValue.y;
-    floatList[2] = trueValue.z;
-    floatList[3] = trueValue.w;
-    int stx = intView[0];
-    int sty = intView[1];
-    int stz = intView[2];
-    int stw = intView[3];
-
-    floatList[0] = falseValue.x;
-    floatList[1] = falseValue.y;
-    floatList[2] = falseValue.z;
-    floatList[3] = falseValue.w;
-    int sfx = intView[0];
-    int sfy = intView[1];
-    int sfz = intView[2];
-    int sfw = intView[3];
-    int _x = (x & stx) | (~x & sfx);
-    int _y = (y & sty) | (~y & sfy);
-    int _z = (z & stz) | (~z & sfz);
-    int _w = (w & stw) | (~w & sfw);
-    intView[0] = _x;
-    intView[1] = _y;
-    intView[2] = _z;
-    intView[3] = _w;
-    return NativeFloat32x4._truncated(
-        floatList[0], floatList[1], floatList[2], floatList[3]);
-  }
-}
-
-class NativeFloat64x2 implements Float64x2 {
-  final double x;
-  final double y;
-
-  static NativeFloat64List _list = NativeFloat64List(2);
-  static Uint32List _uint32View = _list.buffer.asUint32List();
-
-  NativeFloat64x2(this.x, this.y) {
-    if (x is! num) throw ArgumentError(x);
-    if (y is! num) throw ArgumentError(y);
-  }
-
-  NativeFloat64x2.splat(double v) : this(v, v);
-
-  NativeFloat64x2.zero() : this.splat(0.0);
-
-  NativeFloat64x2.fromFloat32x4(Float32x4 v) : this(v.x, v.y);
-
-  /// Arguments [x] and [y] must be doubles.
-  NativeFloat64x2._doubles(this.x, this.y);
-
-  String toString() => '[$x, $y]';
-
-  /// Addition operator.
-  Float64x2 operator +(Float64x2 other) {
-    return NativeFloat64x2._doubles(x + other.x, y + other.y);
-  }
-
-  /// Negate operator.
-  Float64x2 operator -() {
-    return NativeFloat64x2._doubles(-x, -y);
-  }
-
-  /// Subtraction operator.
-  Float64x2 operator -(Float64x2 other) {
-    return NativeFloat64x2._doubles(x - other.x, y - other.y);
-  }
-
-  /// Multiplication operator.
-  Float64x2 operator *(Float64x2 other) {
-    return NativeFloat64x2._doubles(x * other.x, y * other.y);
-  }
-
-  /// Division operator.
-  Float64x2 operator /(Float64x2 other) {
-    return NativeFloat64x2._doubles(x / other.x, y / other.y);
-  }
-
-  /// Returns a copy of [this] each lane being scaled by [s].
-  Float64x2 scale(double s) {
-    return NativeFloat64x2._doubles(x * s, y * s);
-  }
-
-  /// Returns the absolute value of this [Float64x2].
-  Float64x2 abs() {
-    return NativeFloat64x2._doubles(x.abs(), y.abs());
-  }
-
-  /// Clamps [this] to be in the range [lowerLimit]-[upperLimit].
-  Float64x2 clamp(Float64x2 lowerLimit, Float64x2 upperLimit) {
-    double _lx = lowerLimit.x;
-    double _ly = lowerLimit.y;
-    double _ux = upperLimit.x;
-    double _uy = upperLimit.y;
-    double _x = x;
-    double _y = y;
-    // MAX(MIN(self, upper), lower).
-    _x = _x > _ux ? _ux : _x;
-    _y = _y > _uy ? _uy : _y;
-    _x = _x < _lx ? _lx : _x;
-    _y = _y < _ly ? _ly : _y;
-    return NativeFloat64x2._doubles(_x, _y);
-  }
-
-  /// Extract the sign bits from each lane return them in the first 2 bits.
-  int get signMask {
-    var view = _uint32View;
-    _list[0] = x;
-    _list[1] = y;
-    var mx = (view[1] & 0x80000000) >> 31;
-    var my = (view[3] & 0x80000000) >> 31;
-    return mx | my << 1;
-  }
-
-  /// Returns a new [Float64x2] copied from [this] with a new x value.
-  Float64x2 withX(double x) {
-    if (x is! num) throw ArgumentError(x);
-    return NativeFloat64x2._doubles(x, y);
-  }
-
-  /// Returns a new [Float64x2] copied from [this] with a new y value.
-  Float64x2 withY(double y) {
-    if (y is! num) throw ArgumentError(y);
-    return NativeFloat64x2._doubles(x, y);
-  }
-
-  /// Returns the lane-wise minimum value in [this] or [other].
-  Float64x2 min(Float64x2 other) {
-    return NativeFloat64x2._doubles(
-        x < other.x ? x : other.x, y < other.y ? y : other.y);
-  }
-
-  /// Returns the lane-wise maximum value in [this] or [other].
-  Float64x2 max(Float64x2 other) {
-    return NativeFloat64x2._doubles(
-        x > other.x ? x : other.x, y > other.y ? y : other.y);
-  }
-
-  /// Returns the lane-wise square root of [this].
-  Float64x2 sqrt() {
-    return NativeFloat64x2._doubles(Math.sqrt(x), Math.sqrt(y));
-  }
-}
-
-/// Checks that the value is a Uint32. If not, it's not valid as an array
-/// index or offset. Also ensures that the value is non-negative.
-bool _isInvalidArrayIndex(int index) {
-  return (JS('bool', '(# >>> 0 !== #)', index, index));
-}
-
-/// Checks that [index] is a valid index into [list] which has length [length].
-///
-/// That is, [index] is an integer in the range `0..length - 1`.
-void _checkValidIndex(int index, List list, int length) {
-  if (_isInvalidArrayIndex(index) || JS('int', '#', index) >= length) {
-    throw diagnoseIndexError(list, index);
-  }
-}
-
-/// Checks that [start] and [end] form a range of a list of length [length].
-///
-/// That is: `start` and `end` are integers with `0 <= start <= end <= length`.
-/// If `end` is `null` in which case it is considered to be `length`
-///
-/// Returns the actual value of `end`, which is `length` if `end` is `null`, and
-/// the original value of `end` otherwise.
-int _checkValidRange(int start, int? end, int length) {
-  if (_isInvalidArrayIndex(start) || // Ensures start is non-negative int.
-      ((end == null)
-          ? start > length
-          : (_isInvalidArrayIndex(end) || start > end || end > length))) {
-    throw diagnoseRangeError(start, end, length);
-  }
-  if (end == null) return length;
-  return end;
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/README b/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/README
deleted file mode 100644
index 4465012..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/README
+++ /dev/null
@@ -1,17 +0,0 @@
-The files in this directory polyfill some of the functionality that browsers
-provide. When running command-line JS evaluators it is frequently necessary to
-execute the preambles before executing the output of dart2js.
-
-=Usage=
-- d8:
-    d8 <sdk>/lib/_internal/js_runtime/lib/preambles/d8.js <output>.js
-
-- jsshell:
-    jsshell -f <sdk>/lib/_internal/js_runtime/lib/preambles/d8.js -f <output>.js
-
-- node.js:
-  The d8 preamble file works for most programs.
-
-  Unfortunately we are not aware of any easy way to provide multiple input files
-  to node. It seems to be necessary to concatenate the d8 preamble and the
-  dart2js output.
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/d8.js b/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/d8.js
deleted file mode 100644
index 0174d95..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/d8.js
+++ /dev/null
@@ -1,348 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// Javascript preamble, that lets the output of dart2js run on V8's d8 shell.
-
-// Node wraps files and provides them with a different `this`. The global
-// `this` can be accessed through `global`.
-
-var self = this;
-if (typeof global != "undefined") self = global;  // Node.js.
-
-(function(self) {
-  // Using strict mode to avoid accidentally defining global variables.
-  "use strict"; // Should be first statement of this function.
-
-  // Location (Uri.base)
-  var baseUri = 'org-dartlang-d8-preamble:///mock/uri/base/';
-  if (typeof process != "undefined" &&
-             typeof process.cwd == "function") {
-    // Node.js.
-    baseUri = 'file://' + process.cwd() + '/';
-  }
-  self.location = { href: baseUri };
-
-  // Event loop.
-
-  // Task queue as cyclic list queue.
-  var taskQueue = new Array(8);  // Length is power of 2.
-  var head = 0;
-  var tail = 0;
-  var mask = taskQueue.length - 1;
-  function addTask(elem) {
-    taskQueue[head] = elem;
-    head = (head + 1) & mask;
-    if (head == tail) _growTaskQueue();
-  }
-  function removeTask() {
-    if (head == tail) return;
-    var result = taskQueue[tail];
-    taskQueue[tail] = undefined;
-    tail = (tail + 1) & mask;
-    return result;
-  }
-  function _growTaskQueue() {
-    // head == tail.
-    var length = taskQueue.length;
-    var split = head;
-    taskQueue.length = length * 2;
-    if (split * 2 < length) {  // split < length / 2
-      for (var i = 0; i < split; i++) {
-        taskQueue[length + i] = taskQueue[i];
-        taskQueue[i] = undefined;
-      }
-      head += length;
-    } else {
-      for (var i = split; i < length; i++) {
-        taskQueue[length + i] = taskQueue[i];
-        taskQueue[i] = undefined;
-      }
-      tail += length;
-    }
-    mask = taskQueue.length - 1;
-  }
-
-  // Mapping from timer id to timer function.
-  // The timer id is written on the function as .$timerId.
-  // That field is cleared when the timer is cancelled, but it is not returned
-  // from the queue until its time comes.
-  var timerIds = {};
-  var timerIdCounter = 1;  // Counter used to assign ids.
-
-  // Zero-timer queue as simple array queue using push/shift.
-  var zeroTimerQueue = [];
-
-  function addTimer(f, ms) {
-    var id = timerIdCounter++;
-    f.$timerId = id;
-    timerIds[id] = f;
-    if (ms == 0 && !isNextTimerDue()) {
-      zeroTimerQueue.push(f);
-    } else {
-      addDelayedTimer(f, ms);
-    }
-    return id;
-  }
-
-  function nextZeroTimer() {
-    while (zeroTimerQueue.length > 0) {
-      var action = zeroTimerQueue.shift();
-      if (action.$timerId !== undefined) return action;
-    }
-  }
-
-  function nextEvent() {
-    var action = removeTask();
-    if (action) {
-      return action;
-    }
-    do {
-      action = nextZeroTimer();
-      if (action) break;
-      var nextList = nextDelayedTimerQueue();
-      if (!nextList) {
-        return;
-      }
-      var newTime = nextList.shift();
-      advanceTimeTo(newTime);
-      zeroTimerQueue = nextList;
-    } while (true)
-    var id = action.$timerId;
-    clearTimerId(action, id);
-    return action;
-  }
-
-  // Mocking time.
-  var timeOffset = 0;
-  var now = function() {
-    // Install the mock Date object only once.
-    // Following calls to "now" will just use the new (mocked) Date.now
-    // method directly.
-    installMockDate();
-    now = Date.now;
-    return Date.now();
-  };
-  var originalDate = Date;
-  var originalNow = originalDate.now;
-  function advanceTimeTo(time) {
-    var now = originalNow();
-    if (timeOffset < time - now) {
-      timeOffset = time - now;
-    }
-  }
-  function installMockDate() {
-    var NewDate = function Date(Y, M, D, h, m, s, ms) {
-      if (this instanceof Date) {
-        // Assume a construct call.
-        switch (arguments.length) {
-          case 0:  return new originalDate(originalNow() + timeOffset);
-          case 1:  return new originalDate(Y);
-          case 2:  return new originalDate(Y, M);
-          case 3:  return new originalDate(Y, M, D);
-          case 4:  return new originalDate(Y, M, D, h);
-          case 5:  return new originalDate(Y, M, D, h, m);
-          case 6:  return new originalDate(Y, M, D, h, m, s);
-          default: return new originalDate(Y, M, D, h, m, s, ms);
-        }
-      }
-      return new originalDate(originalNow() + timeOffset).toString();
-    };
-    NewDate.UTC = originalDate.UTC;
-    NewDate.parse = originalDate.parse;
-    NewDate.now = function now() { return originalNow() + timeOffset; };
-    NewDate.prototype = originalDate.prototype;
-    originalDate.prototype.constructor = NewDate;
-    Date = NewDate;
-  }
-
-  // Heap priority queue with key index.
-  // Each entry is list of [timeout, callback1 ... callbackn].
-  var timerHeap = [];
-  var timerIndex = {};
-  function addDelayedTimer(f, ms) {
-    var timeout = now() + ms;
-    var timerList = timerIndex[timeout];
-    if (timerList == null) {
-      timerList = [timeout, f];
-      timerIndex[timeout] = timerList;
-      var index = timerHeap.length;
-      timerHeap.length += 1;
-      bubbleUp(index, timeout, timerList);
-    } else {
-      timerList.push(f);
-    }
-  }
-
-  function isNextTimerDue() {
-    if (timerHeap.length == 0) return false;
-    var head = timerHeap[0];
-    return head[0] < originalNow() + timeOffset;
-  }
-
-  function nextDelayedTimerQueue() {
-    if (timerHeap.length == 0) return null;
-    var result = timerHeap[0];
-    var last = timerHeap.pop();
-    if (timerHeap.length > 0) {
-      bubbleDown(0, last[0], last);
-    }
-    return result;
-  }
-
-  function bubbleUp(index, key, value) {
-    while (index != 0) {
-      var parentIndex = (index - 1) >> 1;
-      var parent = timerHeap[parentIndex];
-      var parentKey = parent[0];
-      if (key > parentKey) break;
-      timerHeap[index] = parent;
-      index = parentIndex;
-    }
-    timerHeap[index] = value;
-  }
-
-  function bubbleDown(index, key, value) {
-    while (true) {
-      var leftChildIndex = index * 2 + 1;
-      if (leftChildIndex >= timerHeap.length) break;
-      var minChildIndex = leftChildIndex;
-      var minChild = timerHeap[leftChildIndex];
-      var minChildKey = minChild[0];
-      var rightChildIndex = leftChildIndex + 1;
-      if (rightChildIndex < timerHeap.length) {
-        var rightChild = timerHeap[rightChildIndex];
-        var rightKey = rightChild[0];
-        if (rightKey < minChildKey) {
-          minChildIndex = rightChildIndex;
-          minChild = rightChild;
-          minChildKey = rightKey;
-        }
-      }
-      if (minChildKey > key) break;
-      timerHeap[index] = minChild;
-      index = minChildIndex;
-    }
-    timerHeap[index] = value;
-  }
-
-  function addInterval(f, ms) {
-    var id = timerIdCounter++;
-    function repeat() {
-      // Reactivate with the same id.
-      repeat.$timerId = id;
-      timerIds[id] = repeat;
-      addDelayedTimer(repeat, ms);
-      f();
-    }
-    repeat.$timerId = id;
-    timerIds[id] = repeat;
-    addDelayedTimer(repeat, ms);
-    return id;
-  }
-
-  function cancelTimer(id) {
-    var f = timerIds[id];
-    if (f == null) return;
-    clearTimerId(f, id);
-  }
-
-  function clearTimerId(f, id) {
-    f.$timerId = undefined;
-    delete timerIds[id];
-  }
-
-  function eventLoop(action) {
-    while (action) {
-      try {
-        action();
-      } catch (e) {
-        if (typeof onerror == "function") {
-          onerror(e, null, -1);
-        } else {
-          throw e;
-        }
-      }
-      action = nextEvent();
-    }
-  }
-
-  // Global properties. "self" refers to the global object, so adding a
-  // property to "self" defines a global variable.
-  self.self = self;
-  self.dartMainRunner = function(main, args) {
-    // Initialize.
-    var action = function() { main(args); }
-    eventLoop(action);
-  };
-  self.setTimeout = addTimer;
-  self.clearTimeout = cancelTimer;
-  self.setInterval = addInterval;
-  self.clearInterval = cancelTimer;
-  self.scheduleImmediate = addTask;
-
-  function computeCurrentScript() {
-    try {
-      throw new Error();
-    } catch(e) {
-      var stack = e.stack;
-      // The V8 stack looks like:
-      //    at computeCurrentScript (preambles/d8.js:286:13)
-      //    at Object.currentScript (preambles/d8.js:308:31)
-      //    at init.currentScript (/tmp/foo.js:308:19)
-      //    at /tmp/foo.js:320:7
-      //    at /tmp/foo.js:331:4
-      // Sometimes the 'init.currentScript' line is in the format without the
-      // function name, so match with or without parentheses.
-
-      //              vvvvvvvvvvvv Optional prefix up to '('.
-      var re = /^ *at (?:[^(]*\()?(.*):[0-9]*:[0-9]*\)?$/mg
-      //              Optional ')' at end           ^^^
-
-      var lastMatch = null;
-      do {
-        var match = re.exec(stack);
-        if (match != null) lastMatch = match;
-      } while (match != null);
-      return lastMatch[1];
-    }
-  }
-
-  // Adding a 'document' is dangerous since it invalidates the 'typeof document'
-  // test to see if we are running in the browser. It means that the runtime
-  // needs to do more precise checks.
-  // Note that we can't run "currentScript" right away, since that would give
-  // us the location of the preamble file. Instead we wait for the first access
-  // which should happen just before invoking main. At this point we are in
-  // the main file and setting the currentScript property is correct.
-  var cachedCurrentScript = null;
-  self.document = { get currentScript() {
-      if (cachedCurrentScript == null) {
-        cachedCurrentScript = {src: computeCurrentScript()};
-      }
-      return cachedCurrentScript;
-    }
-  };
-
-  // Support for deferred loading.
-  self.dartDeferredLibraryLoader = function(uri, successCallback, errorCallback) {
-    try {
-      load(uri);
-      successCallback();
-    } catch (error) {
-      errorCallback(error);
-    }
-  };
-
-  // Mock cryptographically secure random by using plain random.
-  self.crypto = {getRandomValues: function(array) {
-    for (var i = 0; i < array.length; i++) {
-      array[i] = Math.random() * 256;
-    }
-  }};
-
-  // D8 Workers are not sufficiently compatible with browser Workers
-  // so pretend they don't exist.
-  // TODO(30217): Try to use D8's worker.
-  delete self.Worker;
-})(self);
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/jsshell.js b/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/jsshell.js
deleted file mode 100644
index a6b41c4..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/preambles/jsshell.js
+++ /dev/null
@@ -1,340 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// Javascript preamble, that lets the output of dart2js run on JSShell.
-
-(function(self) {
-  // Using strict mode to avoid accidentally defining global variables.
-  "use strict"; // Should be first statement of this function.
-
-  // Location (Uri.base)
-
-  var workingDirectory = os.getenv("PWD");
-
-  // Global properties. "self" refers to the global object, so adding a
-  // property to "self" defines a global variable.
-  self.self = self;
-
-  self.location = { href: "file://" + workingDirectory + "/" };
-
-  // Event loop.
-
-  // Task queue as cyclic list queue.
-  var taskQueue = new Array(8);  // Length is power of 2.
-  var head = 0;
-  var tail = 0;
-  var mask = taskQueue.length - 1;
-  function addTask(elem) {
-    taskQueue[head] = elem;
-    head = (head + 1) & mask;
-    if (head == tail) _growTaskQueue();
-  }
-  function removeTask() {
-    if (head == tail) return;
-    var result = taskQueue[tail];
-    taskQueue[tail] = undefined;
-    tail = (tail + 1) & mask;
-    return result;
-  }
-  function _growTaskQueue() {
-    // head == tail.
-    var length = taskQueue.length;
-    var split = head;
-    taskQueue.length = length * 2;
-    if (split * 2 < length) {  // split < length / 2
-      for (var i = 0; i < split; i++) {
-        taskQueue[length + i] = taskQueue[i];
-        taskQueue[i] = undefined;
-      }
-      head += length;
-    } else {
-      for (var i = split; i < length; i++) {
-        taskQueue[length + i] = taskQueue[i];
-        taskQueue[i] = undefined;
-      }
-      tail += length;
-    }
-    mask = taskQueue.length - 1;
-  }
-
-  // Mapping from timer id to timer function.
-  // The timer id is written on the function as .$timerId.
-  // That field is cleared when the timer is cancelled, but it is not returned
-  // from the queue until its time comes.
-  var timerIds = {};
-  var timerIdCounter = 1;  // Counter used to assign ids.
-
-  // Zero-timer queue as simple array queue using push/shift.
-  var zeroTimerQueue = [];
-
-  function addTimer(f, ms) {
-    var id = timerIdCounter++;
-    f.$timerId = id;
-    timerIds[id] = f;
-    if (ms == 0 && !isNextTimerDue()) {
-      zeroTimerQueue.push(f);
-    } else {
-      addDelayedTimer(f, ms);
-    }
-    return id;
-  }
-
-  function nextZeroTimer() {
-    while (zeroTimerQueue.length > 0) {
-      var action = zeroTimerQueue.shift();
-      if (action.$timerId !== undefined) return action;
-    }
-  }
-
-  function nextEvent() {
-    var action = removeTask();
-    if (action) {
-      return action;
-    }
-    do {
-      action = nextZeroTimer();
-      if (action) break;
-      var nextList = nextDelayedTimerQueue();
-      if (!nextList) {
-        return;
-      }
-      var newTime = nextList.shift();
-      advanceTimeTo(newTime);
-      zeroTimerQueue = nextList;
-    } while (true)
-    var id = action.$timerId;
-    clearTimerId(action, id);
-    return action;
-  }
-
-  // Mocking time.
-  var timeOffset = 0;
-  var now = function() {
-    // Install the mock Date object only once.
-    // Following calls to "now" will just use the new (mocked) Date.now
-    // method directly.
-    installMockDate();
-    now = Date.now;
-    return Date.now();
-  };
-  var originalDate = Date;
-  var originalNow = originalDate.now;
-  function advanceTimeTo(time) {
-    var now = originalNow();
-    if (timeOffset < time - now) {
-      timeOffset = time - now;
-    }
-  }
-  function installMockDate() {
-    var NewDate = function Date(Y, M, D, h, m, s, ms) {
-      if (this instanceof Date) {
-        // Assume a construct call.
-        switch (arguments.length) {
-          case 0:  return new originalDate(originalNow() + timeOffset);
-          case 1:  return new originalDate(Y);
-          case 2:  return new originalDate(Y, M);
-          case 3:  return new originalDate(Y, M, D);
-          case 4:  return new originalDate(Y, M, D, h);
-          case 5:  return new originalDate(Y, M, D, h, m);
-          case 6:  return new originalDate(Y, M, D, h, m, s);
-          default: return new originalDate(Y, M, D, h, m, s, ms);
-        }
-      }
-      return new originalDate(originalNow() + timeOffset).toString();
-    };
-    NewDate.UTC = originalDate.UTC;
-    NewDate.parse = originalDate.parse;
-    NewDate.now = function now() { return originalNow() + timeOffset; };
-    NewDate.prototype = originalDate.prototype;
-    originalDate.prototype.constructor = NewDate;
-    Date = NewDate;
-  }
-
-  // Heap priority queue with key index.
-  // Each entry is list of [timeout, callback1 ... callbackn].
-  var timerHeap = [];
-  var timerIndex = {};
-  function addDelayedTimer(f, ms) {
-    var timeout = now() + ms;
-    var timerList = timerIndex[timeout];
-    if (timerList == null) {
-      timerList = [timeout, f];
-      timerIndex[timeout] = timerList;
-      var index = timerHeap.length;
-      timerHeap.length += 1;
-      bubbleUp(index, timeout, timerList);
-    } else {
-      timerList.push(f);
-    }
-  }
-
-  function isNextTimerDue() {
-    if (timerHeap.length == 0) return false;
-    var head = timerHeap[0];
-    return head[0] < originalNow() + timeOffset;
-  }
-
-  function nextDelayedTimerQueue() {
-    if (timerHeap.length == 0) return null;
-    var result = timerHeap[0];
-    var last = timerHeap.pop();
-    if (timerHeap.length > 0) {
-      bubbleDown(0, last[0], last);
-    }
-    return result;
-  }
-
-  function bubbleUp(index, key, value) {
-    while (index != 0) {
-      var parentIndex = (index - 1) >> 1;
-      var parent = timerHeap[parentIndex];
-      var parentKey = parent[0];
-      if (key > parentKey) break;
-      timerHeap[index] = parent;
-      index = parentIndex;
-    }
-    timerHeap[index] = value;
-  }
-
-  function bubbleDown(index, key, value) {
-    while (true) {
-      var leftChildIndex = index * 2 + 1;
-      if (leftChildIndex >= timerHeap.length) break;
-      var minChildIndex = leftChildIndex;
-      var minChild = timerHeap[leftChildIndex];
-      var minChildKey = minChild[0];
-      var rightChildIndex = leftChildIndex + 1;
-      if (rightChildIndex < timerHeap.length) {
-        var rightChild = timerHeap[rightChildIndex];
-        var rightKey = rightChild[0];
-        if (rightKey < minChildKey) {
-          minChildIndex = rightChildIndex;
-          minChild = rightChild;
-          minChildKey = rightKey;
-        }
-      }
-      if (minChildKey > key) break;
-      timerHeap[index] = minChild;
-      index = minChildIndex;
-    }
-    timerHeap[index] = value;
-  }
-
-  function addInterval(f, ms) {
-    var id = timerIdCounter++;
-    function repeat() {
-      // Reactivate with the same id.
-      repeat.$timerId = id;
-      timerIds[id] = repeat;
-      addDelayedTimer(repeat, ms);
-      f();
-    }
-    repeat.$timerId = id;
-    timerIds[id] = repeat;
-    addDelayedTimer(repeat, ms);
-    return id;
-  }
-
-  function cancelTimer(id) {
-    var f = timerIds[id];
-    if (f == null) return;
-    clearTimerId(f, id);
-  }
-
-  function clearTimerId(f, id) {
-    f.$timerId = undefined;
-    delete timerIds[id];
-  }
-
-  function eventLoop(action) {
-    while (action) {
-      try {
-        action();
-      } catch (e) {
-        if (typeof onerror == "function") {
-          onerror(e, null, -1);
-        } else {
-          throw e;
-        }
-      }
-      action = nextEvent();
-    }
-  }
-
-  self.dartMainRunner = function(main, args) {
-    // Initialize.
-    var action = function() { main(args); }
-    eventLoop(action);
-  };
-  self.setTimeout = addTimer;
-  self.clearTimeout = cancelTimer;
-  self.setInterval = addInterval;
-  self.clearInterval = cancelTimer;
-  self.scheduleImmediate = addTask;
-
-  function computeCurrentScript() {
-    try {
-      throw new Error();
-    } catch(e) {
-      var stack = e.stack;
-      print(stack);
-      // The jsshell stack looks like:
-      //   computeCurrentScript@...preambles/jsshell.js:23:13
-      //   self.document.currentScript@...preambles/jsshell.js:53:37
-      //   @/tmp/foo.js:308:1
-      //   @/tmp/foo.js:303:1
-      //   @/tmp/foo.js:5:1
-      var re = new RegExp("^.*@(.*):[0-9]*:[0-9]*$", "mg");
-      var lastMatch = null;
-      do {
-        var match = re.exec(stack);
-        if (match != null) lastMatch = match;
-      } while (match != null);
-      return lastMatch[1];
-    }
-  }
-
-  // Adding a 'document' is dangerous since it invalidates the 'typeof document'
-  // test to see if we are running in the browser. It means that the runtime
-  // needs to do more precise checks.
-  // Note that we can't run "currentScript" right away, since that would give
-  // us the location of the preamble file. Instead we wait for the first access
-  // which should happen just before invoking main. At this point we are in
-  // the main file and setting the currentScript property is correct.
-  // Note that we cannot use `thisFileName()`, since that would give us the
-  // preamble and not the script file.
-  var cachedCurrentScript = null;
-  self.document = { get currentScript() {
-      if (cachedCurrentScript == null) {
-        cachedCurrentScript = {src: computeCurrentScript()};
-      }
-      return cachedCurrentScript;
-    }
-  };
-
-  // Support for deferred loading.
-  self.dartDeferredLibraryLoader = function(uri, successCallback, errorCallback) {
-    try {
-      load(uri);
-      successCallback();
-    } catch (error) {
-      errorCallback(error);
-    }
-  };
-
-  // Mock cryptographically secure random by using plain random.
-  self.crypto = {getRandomValues: function(array) {
-    for (var i = 0; i < array.length; i++) {
-      array[i] = Math.random() * 256;
-    }
-  }};
-})(this)
-
-var getKeys = function(obj){
-   var keys = [];
-   for(var key in obj){
-      keys.push(key);
-   }
-   return keys;
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/regexp_helper.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/regexp_helper.dart
deleted file mode 100644
index 8eaad60..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/regexp_helper.dart
+++ /dev/null
@@ -1,295 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _js_helper;
-
-// Helper method used by internal libraries.
-regExpGetNative(JSSyntaxRegExp regexp) => regexp._nativeRegExp;
-
-/// Returns a native version of the RegExp with the global flag set.
-///
-/// The RegExp's `lastIndex` property is zero when it is returned.
-///
-/// The returned regexp is shared, and its `lastIndex` property may be
-/// modified by other uses, so the returned regexp must be used immediately
-/// when it's returned, with no user-provided code run in between.
-regExpGetGlobalNative(JSSyntaxRegExp regexp) {
-  var nativeRegexp = regexp._nativeGlobalVersion;
-  JS('void', '#.lastIndex = 0', nativeRegexp);
-  return nativeRegexp;
-}
-
-/// Computes the number of captures in a regexp.
-///
-/// This currently involves creating a new RegExp object with a different
-/// source and running it against the empty string (the last part is usually
-/// fast).
-///
-/// The JSSyntaxRegExp could cache the result, and set the cache any time
-/// it finds a match.
-int regExpCaptureCount(JSSyntaxRegExp regexp) {
-  var nativeAnchoredRegExp = regexp._nativeAnchoredVersion;
-  var match = JS('JSExtendableArray', '#.exec("")', nativeAnchoredRegExp);
-  // The native-anchored regexp always have one capture more than the original,
-  // and always matches the empty string.
-  return match.length - 2;
-}
-
-class JSSyntaxRegExp implements RegExp {
-  final String pattern;
-  final _nativeRegExp;
-  var _nativeGlobalRegExp;
-  var _nativeAnchoredRegExp;
-
-  String toString() =>
-      'RegExp/$pattern/' + JS('String', '#.flags', _nativeRegExp);
-
-  JSSyntaxRegExp(String source,
-      {bool multiLine: false,
-      bool caseSensitive: true,
-      bool unicode: false,
-      bool dotAll: false})
-      : this.pattern = source,
-        this._nativeRegExp = makeNative(
-            source, multiLine, caseSensitive, unicode, dotAll, false);
-
-  get _nativeGlobalVersion {
-    if (_nativeGlobalRegExp != null) return _nativeGlobalRegExp;
-    return _nativeGlobalRegExp = makeNative(
-        pattern, _isMultiLine, _isCaseSensitive, _isUnicode, _isDotAll, true);
-  }
-
-  get _nativeAnchoredVersion {
-    if (_nativeAnchoredRegExp != null) return _nativeAnchoredRegExp;
-    // An "anchored version" of a regexp is created by adding "|()" to the
-    // source. This means that the regexp always matches at the first position
-    // that it tries, and you can see if the original regexp matched, or it
-    // was the added zero-width match that matched, by looking at the last
-    // capture. If it is a String, the match participated, otherwise it didn't.
-    return _nativeAnchoredRegExp = makeNative('$pattern|()', _isMultiLine,
-        _isCaseSensitive, _isUnicode, _isDotAll, true);
-  }
-
-  bool get _isMultiLine => JS('bool', '#.multiline', _nativeRegExp);
-  bool get _isCaseSensitive => JS('bool', '!#.ignoreCase', _nativeRegExp);
-  bool get _isUnicode => JS('bool', '#.unicode', _nativeRegExp);
-  bool get _isDotAll => JS('bool', '#.dotAll', _nativeRegExp);
-
-  static makeNative(String source, bool multiLine, bool caseSensitive,
-      bool unicode, bool dotAll, bool global) {
-    checkString(source);
-    String m = multiLine == true ? 'm' : '';
-    String i = caseSensitive == true ? '' : 'i';
-    String u = unicode ? 'u' : '';
-    String s = dotAll ? 's' : '';
-    String g = global ? 'g' : '';
-    // We're using the JavaScript's try catch instead of the Dart one to avoid
-    // dragging in Dart runtime support just because of using RegExp.
-    var regexp = JS(
-        '',
-        r'''
-          (function(source, modifiers) {
-            try {
-              return new RegExp(source, modifiers);
-            } catch (e) {
-              return e;
-            }
-          })(#, # + # + # + # + #)''',
-        source,
-        m,
-        i,
-        u,
-        s,
-        g);
-    if (JS('bool', '# instanceof RegExp', regexp)) return regexp;
-    // The returned value is the JavaScript exception. Turn it into a
-    // Dart exception.
-    String errorMessage = JS('String', r'String(#)', regexp);
-    throw new FormatException('Illegal RegExp pattern ($errorMessage)', source);
-  }
-
-  RegExpMatch? firstMatch(String string) {
-    JSArray? m = JS('JSExtendableArray|Null', r'#.exec(#)', _nativeRegExp,
-        checkString(string));
-    if (m == null) return null;
-    return new _MatchImplementation(this, m);
-  }
-
-  bool hasMatch(String string) {
-    return JS('bool', r'#.test(#)', _nativeRegExp, checkString(string));
-  }
-
-  String? stringMatch(String string) {
-    var match = firstMatch(string);
-    if (match != null) return match.group(0);
-    return null;
-  }
-
-  Iterable<RegExpMatch> allMatches(String string, [int start = 0]) {
-    checkString(string);
-    checkInt(start);
-    if (start < 0 || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    return new _AllMatchesIterable(this, string, start);
-  }
-
-  RegExpMatch? _execGlobal(String string, int start) {
-    Object regexp = _nativeGlobalVersion;
-    JS('void', '#.lastIndex = #', regexp, start);
-    JSArray? match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
-    if (match == null) return null;
-    return new _MatchImplementation(this, match);
-  }
-
-  RegExpMatch? _execAnchored(String string, int start) {
-    Object regexp = _nativeAnchoredVersion;
-    JS('void', '#.lastIndex = #', regexp, start);
-    JSArray? match = JS('JSExtendableArray|Null', '#.exec(#)', regexp, string);
-    if (match == null) return null;
-    // If the last capture group participated, the original regexp did not
-    // match at the start position.
-    if (match.removeLast() != null) return null;
-    return new _MatchImplementation(this, match);
-  }
-
-  RegExpMatch? matchAsPrefix(String string, [int start = 0]) {
-    if (start < 0 || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    return _execAnchored(string, start);
-  }
-
-  bool get isMultiLine => _isMultiLine;
-  bool get isCaseSensitive => _isCaseSensitive;
-  bool get isUnicode => _isUnicode;
-  bool get isDotAll => _isDotAll;
-}
-
-class _MatchImplementation implements RegExpMatch {
-  final Pattern pattern;
-  // Contains a JS RegExp match object.
-  // It is an Array of String values with extra 'index' and 'input' properties.
-  // If there were named capture groups, there will also be an extra 'groups'
-  // property containing an object with capture group names as keys and
-  // matched strings as values.
-  // We didn't force it to be JSArray<String>, so it is JSArray<dynamic>, but
-  // containing String or `undefined` values.
-  final JSArray _match;
-
-  _MatchImplementation(this.pattern, this._match) {
-    assert(JS('var', '#.input', _match) is String);
-    assert(JS('var', '#.index', _match) is int);
-  }
-
-  String get input => JS('String', '#.input', _match);
-
-  int get start =>
-      JS('returns:int;depends:none;effects:none;gvn:true', '#.index', _match);
-
-  int get end => (start +
-      JS('returns:int;depends:none;effects:none;gvn:true', '#[0].length',
-          _match)) as int;
-
-  // The JS below changes the static type to avoid an implicit cast.
-  // TODO(sra): Find a nicer way to do this, e.g. unsafeCast.
-  String? group(int index) => JS('String|Null', '#', _match[index]);
-
-  String? operator [](int index) => group(index);
-
-  int get groupCount => _match.length - 1;
-
-  List<String?> groups(List<int> groups) {
-    List<String?> out = [];
-    for (int i in groups) {
-      out.add(group(i));
-    }
-    return out;
-  }
-
-  String namedGroup(String name) {
-    var groups = JS('Object|Null', '#.groups', _match);
-    if (groups != null) {
-      var result = JS('String|Null', '#[#]', groups, name);
-      if (result != null || JS('bool', '# in #', name, groups)) {
-        return result;
-      }
-    }
-    throw ArgumentError.value(name, "name", "Not a capture group name");
-  }
-
-  Iterable<String> get groupNames {
-    var groups = JS('Object|Null', '#.groups', _match);
-    if (groups != null) {
-      var keys = new JSArray<String>.markGrowable(
-          JS('returns:JSExtendableArray;new:true', 'Object.keys(#)', groups));
-      return SubListIterable(keys, 0, null);
-    }
-    return Iterable.empty();
-  }
-}
-
-class _AllMatchesIterable extends IterableBase<RegExpMatch> {
-  final JSSyntaxRegExp _re;
-  final String _string;
-  final int _start;
-
-  _AllMatchesIterable(this._re, this._string, this._start);
-
-  Iterator<RegExpMatch> get iterator =>
-      new _AllMatchesIterator(_re, _string, _start);
-}
-
-class _AllMatchesIterator implements Iterator<RegExpMatch> {
-  final JSSyntaxRegExp _regExp;
-  String? _string;
-  int _nextIndex;
-  RegExpMatch? _current;
-
-  _AllMatchesIterator(this._regExp, this._string, this._nextIndex);
-
-  RegExpMatch get current => _current!;
-
-  static bool _isLeadSurrogate(int c) {
-    return c >= 0xd800 && c <= 0xdbff;
-  }
-
-  static bool _isTrailSurrogate(int c) {
-    return c >= 0xdc00 && c <= 0xdfff;
-  }
-
-  bool moveNext() {
-    var string = _string;
-    if (string == null) return false;
-    if (_nextIndex <= string.length) {
-      RegExpMatch? match = _regExp._execGlobal(string, _nextIndex);
-      if (match != null) {
-        _current = match;
-        int nextIndex = match.end;
-        if (match.start == nextIndex) {
-          // Zero-width match. Advance by one more, unless the regexp
-          // is in unicode mode and it would put us within a surrogate
-          // pair. In that case, advance past the code point as a whole.
-          if (_regExp.isUnicode &&
-              _nextIndex + 1 < string.length &&
-              _isLeadSurrogate(string.codeUnitAt(_nextIndex)) &&
-              _isTrailSurrogate(string.codeUnitAt(_nextIndex + 1))) {
-            nextIndex++;
-          }
-          nextIndex++;
-        }
-        _nextIndex = nextIndex;
-        return true;
-      }
-    }
-    _current = null;
-    _string = null; // Marks iteration as ended.
-    return false;
-  }
-}
-
-/// Find the first match of [regExp] in [string] at or after [start].
-RegExpMatch? firstMatchAfter(JSSyntaxRegExp regExp, String string, int start) {
-  return regExp._execGlobal(string, start);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart
deleted file mode 100644
index 77dfe84..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/rti.dart
+++ /dev/null
@@ -1,3159 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This library contains support for runtime type information.
-library rti;
-
-import 'dart:_foreign_helper'
-    show
-        getInterceptor,
-        getJSArrayInteropRti,
-        JS,
-        JS_BUILTIN,
-        JS_EMBEDDED_GLOBAL,
-        JS_GET_FLAG,
-        JS_GET_NAME,
-        JS_STRING_CONCAT,
-        RAW_DART_FUNCTION_REF,
-        TYPE_REF,
-        LEGACY_TYPE_REF;
-
-import 'dart:_interceptors'
-    show JavaScriptFunction, JSArray, JSNull, JSUnmodifiableArray;
-
-import 'dart:_js_names' show unmangleGlobalNameIfPreservedAnyways;
-
-import 'dart:_js_embedded_names'
-    show
-        JsBuiltin,
-        JsGetName,
-        RtiUniverseFieldNames,
-        ARRAY_RTI_PROPERTY,
-        CONSTRUCTOR_RTI_CACHE_PROPERTY_NAME,
-        RTI_UNIVERSE,
-        TYPES;
-
-import 'dart:_recipe_syntax';
-
-// The top type `Object?` is used throughout this library even when values are
-// not nullable or have narrower types in order to avoid incurring type checks
-// before the type checking infrastructure has been set up.
-// We could use `dynamic`, but this would allow inadvertent implicit downcasts.
-// TODO(fishythefish, dart-lang/language#115): Replace `Object?` with a typedef
-// when possible.
-
-/// An Rti object represents both a type (e.g `Map<int, String>`) and a type
-/// environment (`Map<int, String>` binds `Map.K=int` and `Map.V=String`).
-///
-/// There is a single [Rti] class to help reduce polymorphism in the JavaScript
-/// runtime. The class has a default constructor and no final fields so it can
-/// be created before much of the runtime exists.
-///
-/// The fields are declared in an order that gets shorter minified names for the
-/// more commonly used fields. (TODO: we should exploit the fact that an Rti
-/// instance never appears in a dynamic context, so does not need field names to
-/// be distinct from dynamic selectors).
-///
-class Rti {
-  /// JavaScript method for 'as' check. The method is called from generated code,
-  /// e.g. `o as T` generates something like `rtiForT._as(o)`.
-  @pragma('dart2js:noElision')
-  Object? _as;
-
-  /// JavaScript method for 'is' test.  The method is called from generated
-  /// code, e.g. `o is T` generates something like `rtiForT._is(o)`.
-  @pragma('dart2js:noElision')
-  Object? _is;
-
-  static void _setAsCheckFunction(Rti rti, Object? fn) {
-    rti._as = fn;
-  }
-
-  static void _setIsTestFunction(Rti rti, Object? fn) {
-    rti._is = fn;
-  }
-
-  @pragma('dart2js:tryInline')
-  static bool _asCheck(Rti rti, Object? object) {
-    return JS(
-        'bool', '#.#(#)', rti, JS_GET_NAME(JsGetName.RTI_FIELD_AS), object);
-  }
-
-  @pragma('dart2js:tryInline')
-  static bool _isCheck(Rti rti, Object? object) {
-    return JS(
-        'bool', '#.#(#)', rti, JS_GET_NAME(JsGetName.RTI_FIELD_IS), object);
-  }
-
-  /// Method called from generated code to evaluate a type environment recipe in
-  /// `this` type environment.
-  Rti _eval(Object? recipe) {
-    // TODO(sra): Clone the fast-path of _Universe.evalInEnvironment to here.
-    return _rtiEval(this, _Utils.asString(recipe));
-  }
-
-  /// Method called from generated code to extend `this` type environment (an
-  /// interface or binding Rti) with function type arguments (a singleton
-  /// argument or tuple of arguments).
-  Rti _bind(Object? typeOrTuple) => _rtiBind(this, _Utils.asRti(typeOrTuple));
-
-  /// Method called from generated code to extend `this` type (as a singleton
-  /// type environment) with function type arguments (a singleton argument or
-  /// tuple of arguments).
-  Rti _bind1(Object? typeOrTuple) => _rtiBind1(this, _Utils.asRti(typeOrTuple));
-
-  // Precomputed derived types. These fields are used to hold derived types that
-  // are computed eagerly.
-  // TODO(sra): Implement precomputed type optimizations.
-
-  /// If kind == kindInterface, holds the first type argument (if any).
-  /// If kind == kindFutureOr, holds Future<T> where T is the base type.
-  /// - This case is lazily initialized during subtype checks.
-  /// If kind == kindStar, holds T? where T is the base type.
-  /// - This case is lazily initialized during subtype checks.
-  @pragma('dart2js:noElision')
-  Object? _precomputed1;
-
-  static Object? _getPrecomputed1(Rti rti) => rti._precomputed1;
-
-  static void _setPrecomputed1(Rti rti, Object? precomputed) {
-    rti._precomputed1 = precomputed;
-  }
-
-  static Rti _getQuestionFromStar(Object? universe, Rti rti) {
-    assert(_getKind(rti) == kindStar);
-    Rti? question = _Utils.asRtiOrNull(_getPrecomputed1(rti));
-    if (question == null) {
-      question =
-          _Universe._lookupQuestionRti(universe, _getStarArgument(rti), true);
-      Rti._setPrecomputed1(rti, question);
-    }
-    return question;
-  }
-
-  static Rti _getFutureFromFutureOr(Object? universe, Rti rti) {
-    assert(_getKind(rti) == kindFutureOr);
-    Rti? future = _Utils.asRtiOrNull(_getPrecomputed1(rti));
-    if (future == null) {
-      future = _Universe._lookupFutureRti(universe, _getFutureOrArgument(rti));
-      Rti._setPrecomputed1(rti, future);
-    }
-    return future;
-  }
-
-  Object? _precomputed2;
-  Object? _precomputed3;
-  Object? _precomputed4;
-
-  // Data value used by some tests.
-  @pragma('dart2js:noElision')
-  Object? _specializedTestResource;
-
-  static Object? _getSpecializedTestResource(Rti rti) {
-    return rti._specializedTestResource;
-  }
-
-  static void _setSpecializedTestResource(Rti rti, Object? value) {
-    rti._specializedTestResource = value;
-  }
-
-  // The Type object corresponding to this Rti.
-  Object? _cachedRuntimeType;
-  static _Type? _getCachedRuntimeType(Rti rti) =>
-      JS('_Type|Null', '#', rti._cachedRuntimeType);
-  static void _setCachedRuntimeType(Rti rti, _Type type) {
-    rti._cachedRuntimeType = type;
-  }
-
-  /// The kind of Rti `this` is, one of the kindXXX constants below.
-  ///
-  /// We don't use an enum since we need to create Rti objects very early.
-  ///
-  /// The zero initializer ensures dart2js type analysis considers [_kind] is
-  /// non-nullable.
-  Object? /*int*/ _kind = 0;
-
-  static int _getKind(Rti rti) => _Utils.asInt(rti._kind);
-  static void _setKind(Rti rti, int kind) {
-    rti._kind = kind;
-  }
-
-  // Terminal terms.
-  static const int kindNever = 1;
-  static const int kindDynamic = 2;
-  static const int kindVoid = 3; // TODO(sra): Use `dynamic` instead?
-  static const int kindAny = 4; // Dart1-style 'dynamic' for JS-interop.
-  static const int kindErased = 5;
-  // Unary terms.
-  static const int kindStar = 6;
-  static const int kindQuestion = 7;
-  static const int kindFutureOr = 8;
-  // More complex terms.
-  static const int kindInterface = 9;
-  // A vector of type parameters from enclosing functions and closures.
-  static const int kindBinding = 10;
-  static const int kindFunction = 11;
-  static const int kindGenericFunction = 12;
-  static const int kindGenericFunctionParameter = 13;
-
-  static bool _isUnionOfFunctionType(Rti rti) {
-    int kind = Rti._getKind(rti);
-    if (kind == kindStar || kind == kindQuestion || kind == kindFutureOr) {
-      return _isUnionOfFunctionType(_Utils.asRti(_getPrimary(rti)));
-    }
-    return kind == kindFunction || kind == kindGenericFunction;
-  }
-
-  /// Primary data associated with type.
-  ///
-  /// - Minified name of interface for interface types.
-  /// - Underlying type for unary terms.
-  /// - Class part of a type environment inside a generic class, or `null` for
-  ///   type tuple.
-  /// - Return type of a function type.
-  /// - Underlying function type for a generic function.
-  /// - de Bruijn index for a generic function parameter.
-  Object? _primary;
-
-  static Object? _getPrimary(Rti rti) => rti._primary;
-  static void _setPrimary(Rti rti, Object? value) {
-    rti._primary = value;
-  }
-
-  /// Additional data associated with type.
-  ///
-  /// - The type arguments of an interface type.
-  /// - The type arguments from enclosing functions and closures for a
-  ///   kindBinding.
-  /// - The [_FunctionParameters] of a function type.
-  /// - The type parameter bounds of a generic function.
-  Object? _rest;
-
-  static Object? _getRest(Rti rti) => rti._rest;
-  static void _setRest(Rti rti, Object? value) {
-    rti._rest = value;
-  }
-
-  static String _getInterfaceName(Rti rti) {
-    assert(_getKind(rti) == kindInterface);
-    return _Utils.asString(_getPrimary(rti));
-  }
-
-  static JSArray _getInterfaceTypeArguments(Rti rti) {
-    // The array is a plain JavaScript Array, otherwise we would need the type
-    // `JSArray<Rti>` to exist before we could create the type `JSArray<Rti>`.
-    assert(_getKind(rti) == kindInterface);
-    return JS('JSUnmodifiableArray', '#', _getRest(rti));
-  }
-
-  static Rti _getBindingBase(Rti rti) {
-    assert(_getKind(rti) == kindBinding);
-    return _Utils.asRti(_getPrimary(rti));
-  }
-
-  static JSArray _getBindingArguments(Rti rti) {
-    assert(_getKind(rti) == kindBinding);
-    return JS('JSUnmodifiableArray', '#', _getRest(rti));
-  }
-
-  static Rti _getStarArgument(Rti rti) {
-    assert(_getKind(rti) == kindStar);
-    return _Utils.asRti(_getPrimary(rti));
-  }
-
-  static Rti _getQuestionArgument(Rti rti) {
-    assert(_getKind(rti) == kindQuestion);
-    return _Utils.asRti(_getPrimary(rti));
-  }
-
-  static Rti _getFutureOrArgument(Rti rti) {
-    assert(_getKind(rti) == kindFutureOr);
-    return _Utils.asRti(_getPrimary(rti));
-  }
-
-  static Rti _getReturnType(Rti rti) {
-    assert(_getKind(rti) == kindFunction);
-    return _Utils.asRti(_getPrimary(rti));
-  }
-
-  static _FunctionParameters _getFunctionParameters(Rti rti) {
-    assert(_getKind(rti) == kindFunction);
-    return JS('_FunctionParameters', '#', _getRest(rti));
-  }
-
-  static Rti _getGenericFunctionBase(Rti rti) {
-    assert(_getKind(rti) == kindGenericFunction);
-    return _Utils.asRti(_getPrimary(rti));
-  }
-
-  static JSArray _getGenericFunctionBounds(Rti rti) {
-    assert(_getKind(rti) == kindGenericFunction);
-    return JS('JSUnmodifiableArray', '#', _getRest(rti));
-  }
-
-  static int _getGenericFunctionParameterIndex(Rti rti) {
-    assert(_getKind(rti) == kindGenericFunctionParameter);
-    return _Utils.asInt(_getPrimary(rti));
-  }
-
-  /// On [Rti]s that are type environments*, derived types are cached on the
-  /// environment to ensure fast canonicalization. Ground-term types (i.e. not
-  /// dependent on class or function type parameters) are cached in the
-  /// universe. This field starts as `null` and the cache is created on demand.
-  ///
-  /// *Any Rti can be a type environment, since we use the type for a function
-  /// type environment. The ambiguity between 'generic class is the environment'
-  /// and 'generic class is a singleton type argument' is resolved by using
-  /// different indexing in the recipe.
-  Object? _evalCache;
-
-  static Object? _getEvalCache(Rti rti) => rti._evalCache;
-  static void _setEvalCache(Rti rti, Object? value) {
-    rti._evalCache = value;
-  }
-
-  /// On [Rti]s that are type environments*, extended environments are cached on
-  /// the base environment to ensure fast canonicalization.
-  ///
-  /// This field starts as `null` and the cache is created on demand.
-  ///
-  /// *This is valid only on kindInterface and kindBinding Rtis. The ambiguity
-  /// between 'generic class is the base environment' and 'generic class is a
-  /// singleton type argument' is resolved [TBD] (either (1) a bind1 cache, or
-  /// (2)using `env._eval("@<0>")._bind(args)` in place of `env._bind1(args)`).
-  ///
-  /// On [Rti]s that are generic function types, results of instantiation are
-  /// cached on the generic function type to ensure fast repeated
-  /// instantiations.
-  Object? _bindCache;
-
-  static Object? _getBindCache(Rti rti) => rti._bindCache;
-  static void _setBindCache(Rti rti, Object? value) {
-    rti._bindCache = value;
-  }
-
-  static Rti allocate() {
-    return new Rti();
-  }
-
-  Object? _canonicalRecipe;
-
-  static String _getCanonicalRecipe(Rti rti) {
-    var s = rti._canonicalRecipe;
-    assert(_Utils.isString(s), 'Missing canonical recipe');
-    return _Utils.asString(s);
-  }
-
-  static void _setCanonicalRecipe(Rti rti, String s) {
-    rti._canonicalRecipe = s;
-  }
-}
-
-class _FunctionParameters {
-  static _FunctionParameters allocate() => _FunctionParameters();
-
-  Object? _requiredPositional;
-  static JSArray _getRequiredPositional(_FunctionParameters parameters) =>
-      JS('JSUnmodifiableArray', '#', parameters._requiredPositional);
-  static void _setRequiredPositional(
-      _FunctionParameters parameters, Object? requiredPositional) {
-    parameters._requiredPositional = requiredPositional;
-  }
-
-  Object? _optionalPositional;
-  static JSArray _getOptionalPositional(_FunctionParameters parameters) =>
-      JS('JSUnmodifiableArray', '#', parameters._optionalPositional);
-  static void _setOptionalPositional(
-      _FunctionParameters parameters, Object? optionalPositional) {
-    parameters._optionalPositional = optionalPositional;
-  }
-
-  /// These are a sequence of name/bool/type triplets that correspond to named
-  /// parameters.
-  ///
-  ///   void foo({int bar, required double baz})
-  ///
-  /// would be encoded as ["bar", false, int, "baz", true, double], where each
-  /// triplet consists of the name [String], a bool indicating whether or not
-  /// the parameter is required, and the [Rti].
-  ///
-  /// Invariant: These groups are sorted by name in lexicographically ascending order.
-  Object? _named;
-  static JSArray _getNamed(_FunctionParameters parameters) =>
-      JS('JSUnmodifiableArray', '#', parameters._named);
-  static void _setNamed(_FunctionParameters parameters, Object? named) {
-    parameters._named = named;
-  }
-}
-
-Object? _theUniverse() => JS_EMBEDDED_GLOBAL('', RTI_UNIVERSE);
-
-Rti _rtiEval(Rti environment, String recipe) {
-  return _Universe.evalInEnvironment(_theUniverse(), environment, recipe);
-}
-
-Rti _rtiBind1(Rti environment, Rti types) {
-  return _Universe.bind1(_theUniverse(), environment, types);
-}
-
-Rti _rtiBind(Rti environment, Rti types) {
-  return _Universe.bind(_theUniverse(), environment, types);
-}
-
-/// Evaluate a ground-term type.
-/// Called from generated code.
-Rti findType(String recipe) {
-  // Since [findType] should only be called on recipes computed during
-  // compilation, we can assume that the recipe is already normalized (since all
-  // [DartType]s are normalized. This allows us to avoid an unfortunate cycle:
-  //
-  // If we attempt to normalize here, then during the course of normalization,
-  // we may attempt to access a [TYPE_REF]. This uses the `type$` object, and
-  // the values of this object are calls to [findType]. Thus, if we're currently
-  // in one of these calls, then `type$` will appear to be undefined.
-  return _Universe.eval(_theUniverse(), recipe, false);
-}
-
-/// Evaluate a type recipe in the environment of an instance.
-Rti evalInInstance(Object? instance, String recipe) {
-  return _rtiEval(instanceType(instance), recipe);
-}
-
-/// Returns [genericFunctionRti] with type parameters bound to those specified
-/// by [instantiationRti].
-///
-/// [genericFunctionRti] must be an rti representation with a number of generic
-/// type parameters matching the number of types provided by [instantiationRti].
-///
-/// Called from generated code.
-@pragma('dart2js:noInline')
-Rti? instantiatedGenericFunctionType(
-    Rti? genericFunctionRti, Rti instantiationRti) {
-  // If --lax-runtime-type-to-string is enabled and we never check the function
-  // type, then the function won't have a signature, so its RTI will be null. In
-  // this case, there is nothing to instantiate, so we return `null` and the
-  // instantiation appears to be an interface type instead.
-  if (genericFunctionRti == null) return null;
-  var bounds = Rti._getGenericFunctionBounds(genericFunctionRti);
-  var typeArguments = Rti._getInterfaceTypeArguments(instantiationRti);
-  assert(_Utils.arrayLength(bounds) == _Utils.arrayLength(typeArguments));
-
-  var cache = Rti._getBindCache(genericFunctionRti);
-  if (cache == null) {
-    cache = JS('', 'new Map()');
-    Rti._setBindCache(genericFunctionRti, cache);
-  }
-  String key = Rti._getCanonicalRecipe(instantiationRti);
-  var probe = _Utils.mapGet(cache, key);
-  if (probe != null) return _Utils.asRti(probe);
-  Rti rti = _substitute(_theUniverse(),
-      Rti._getGenericFunctionBase(genericFunctionRti), typeArguments, 0);
-  _Utils.mapSet(cache, key, rti);
-  return rti;
-}
-
-/// Substitutes [typeArguments] for generic function parameters in [rti].
-///
-/// Generic function parameters are de Bruijn indices counting up through the
-/// parameters' scopes to index into [typeArguments].
-///
-/// [depth] is the number of subsequent generic function parameters that are in
-/// scope. This is subtracted off the de Bruijn index for the type parameter to
-/// arrive at an potential index into [typeArguments].
-///
-/// In order to do a partial substitution - that is, substituting only some
-/// type parameters rather than all of them - we encode the unsubstituted
-/// positions of the argument list as `undefined` or `null`.
-Rti _substitute(Object? universe, Rti rti, Object? typeArguments, int depth) {
-  int kind = Rti._getKind(rti);
-  switch (kind) {
-    case Rti.kindErased:
-    case Rti.kindNever:
-    case Rti.kindDynamic:
-    case Rti.kindVoid:
-    case Rti.kindAny:
-      return rti;
-    case Rti.kindStar:
-      Rti baseType = _Utils.asRti(Rti._getPrimary(rti));
-      Rti substitutedBaseType =
-          _substitute(universe, baseType, typeArguments, depth);
-      if (_Utils.isIdentical(substitutedBaseType, baseType)) return rti;
-      return _Universe._lookupStarRti(universe, substitutedBaseType, true);
-    case Rti.kindQuestion:
-      Rti baseType = _Utils.asRti(Rti._getPrimary(rti));
-      Rti substitutedBaseType =
-          _substitute(universe, baseType, typeArguments, depth);
-      if (_Utils.isIdentical(substitutedBaseType, baseType)) return rti;
-      return _Universe._lookupQuestionRti(universe, substitutedBaseType, true);
-    case Rti.kindFutureOr:
-      Rti baseType = _Utils.asRti(Rti._getPrimary(rti));
-      Rti substitutedBaseType =
-          _substitute(universe, baseType, typeArguments, depth);
-      if (_Utils.isIdentical(substitutedBaseType, baseType)) return rti;
-      return _Universe._lookupFutureOrRti(universe, substitutedBaseType, true);
-    case Rti.kindInterface:
-      var interfaceTypeArguments = Rti._getInterfaceTypeArguments(rti);
-      var substitutedInterfaceTypeArguments = _substituteArray(
-          universe, interfaceTypeArguments, typeArguments, depth);
-      if (_Utils.isIdentical(
-          substitutedInterfaceTypeArguments, interfaceTypeArguments))
-        return rti;
-      return _Universe._lookupInterfaceRti(universe, Rti._getInterfaceName(rti),
-          substitutedInterfaceTypeArguments);
-    case Rti.kindBinding:
-      Rti base = Rti._getBindingBase(rti);
-      Rti substitutedBase = _substitute(universe, base, typeArguments, depth);
-      var arguments = Rti._getBindingArguments(rti);
-      var substitutedArguments =
-          _substituteArray(universe, arguments, typeArguments, depth);
-      if (_Utils.isIdentical(substitutedBase, base) &&
-          _Utils.isIdentical(substitutedArguments, arguments)) return rti;
-      return _Universe._lookupBindingRti(
-          universe, substitutedBase, substitutedArguments);
-    case Rti.kindFunction:
-      Rti returnType = Rti._getReturnType(rti);
-      Rti substitutedReturnType =
-          _substitute(universe, returnType, typeArguments, depth);
-      _FunctionParameters functionParameters = Rti._getFunctionParameters(rti);
-      _FunctionParameters substitutedFunctionParameters =
-          _substituteFunctionParameters(
-              universe, functionParameters, typeArguments, depth);
-      if (_Utils.isIdentical(substitutedReturnType, returnType) &&
-          _Utils.isIdentical(substitutedFunctionParameters, functionParameters))
-        return rti;
-      return _Universe._lookupFunctionRti(
-          universe, substitutedReturnType, substitutedFunctionParameters);
-    case Rti.kindGenericFunction:
-      var bounds = Rti._getGenericFunctionBounds(rti);
-      depth += _Utils.arrayLength(bounds);
-      var substitutedBounds =
-          _substituteArray(universe, bounds, typeArguments, depth);
-      Rti base = Rti._getGenericFunctionBase(rti);
-      Rti substitutedBase = _substitute(universe, base, typeArguments, depth);
-      if (_Utils.isIdentical(substitutedBounds, bounds) &&
-          _Utils.isIdentical(substitutedBase, base)) return rti;
-      return _Universe._lookupGenericFunctionRti(
-          universe, substitutedBase, substitutedBounds, true);
-    case Rti.kindGenericFunctionParameter:
-      int index = Rti._getGenericFunctionParameterIndex(rti);
-      // Indices below the current depth are out of scope for substitution and
-      // can be returned unchanged.
-      if (index < depth) return rti;
-      var argument = _Utils.arrayAt(typeArguments, index - depth);
-      // In order to do a partial substitution - that is, substituting only some
-      // type parameters rather than all of them - we encode the unsubstituted
-      // positions of the argument list as `undefined` (which will compare equal
-      // to `null`).
-      if (argument == null) return rti;
-      return _Utils.asRti(argument);
-    default:
-      throw AssertionError('Attempted to substitute unexpected RTI kind $kind');
-  }
-}
-
-Object? _substituteArray(
-    Object? universe, Object? rtiArray, Object? typeArguments, int depth) {
-  bool changed = false;
-  int length = _Utils.arrayLength(rtiArray);
-  Object? result = JS('', '[]');
-  for (int i = 0; i < length; i++) {
-    Rti rti = _Utils.asRti(_Utils.arrayAt(rtiArray, i));
-    Rti substitutedRti = _substitute(universe, rti, typeArguments, depth);
-    if (_Utils.isNotIdentical(substitutedRti, rti)) {
-      changed = true;
-    }
-    _Utils.arrayPush(result, substitutedRti);
-  }
-  return changed ? result : rtiArray;
-}
-
-Object? _substituteNamed(
-    Object? universe, Object? namedArray, Object? typeArguments, int depth) {
-  bool changed = false;
-  int length = _Utils.arrayLength(namedArray);
-  assert(_Utils.isMultipleOf(length, 3));
-  Object? result = JS('', '[]');
-  for (int i = 0; i < length; i += 3) {
-    String name = _Utils.asString(_Utils.arrayAt(namedArray, i));
-    bool isRequired = _Utils.asBool(_Utils.arrayAt(namedArray, i + 1));
-    Rti rti = _Utils.asRti(_Utils.arrayAt(namedArray, i + 2));
-    Rti substitutedRti = _substitute(universe, rti, typeArguments, depth);
-    if (_Utils.isNotIdentical(substitutedRti, rti)) {
-      changed = true;
-    }
-    _Utils.arrayPush(result, name);
-    _Utils.arrayPush(result, isRequired);
-    _Utils.arrayPush(result, substitutedRti);
-  }
-  return changed ? result : namedArray;
-}
-
-_FunctionParameters _substituteFunctionParameters(Object? universe,
-    _FunctionParameters functionParameters, Object? typeArguments, int depth) {
-  var requiredPositional =
-      _FunctionParameters._getRequiredPositional(functionParameters);
-  var substitutedRequiredPositional =
-      _substituteArray(universe, requiredPositional, typeArguments, depth);
-  var optionalPositional =
-      _FunctionParameters._getOptionalPositional(functionParameters);
-  var substitutedOptionalPositional =
-      _substituteArray(universe, optionalPositional, typeArguments, depth);
-  var named = _FunctionParameters._getNamed(functionParameters);
-  var substitutedNamed =
-      _substituteNamed(universe, named, typeArguments, depth);
-  if (_Utils.isIdentical(substitutedRequiredPositional, requiredPositional) &&
-      _Utils.isIdentical(substitutedOptionalPositional, optionalPositional) &&
-      _Utils.isIdentical(substitutedNamed, named)) return functionParameters;
-  _FunctionParameters result = _FunctionParameters.allocate();
-  _FunctionParameters._setRequiredPositional(
-      result, substitutedRequiredPositional);
-  _FunctionParameters._setOptionalPositional(
-      result, substitutedOptionalPositional);
-  _FunctionParameters._setNamed(result, substitutedNamed);
-  return result;
-}
-
-bool _isDartObject(Object? object) => _Utils.instanceOf(object,
-    JS_BUILTIN('depends:none;effects:none;', JsBuiltin.dartObjectConstructor));
-
-bool _isClosure(Object? object) => _Utils.instanceOf(object,
-    JS_BUILTIN('depends:none;effects:none;', JsBuiltin.dartClosureConstructor));
-
-/// Returns the structural function [Rti] of [closure], or `null`.
-/// [closure] must be a subclass of [Closure].
-/// Called from generated code.
-Rti? closureFunctionType(Object? closure) {
-  var signatureName = JS_GET_NAME(JsGetName.SIGNATURE_NAME);
-  var signature = JS('', '#[#]', closure, signatureName);
-  if (signature != null) {
-    if (JS('bool', 'typeof # == "number"', signature)) {
-      return getTypeFromTypesTable(_Utils.asInt(signature));
-    }
-    return _Utils.asRti(JS('', '#[#]()', closure, signatureName));
-  }
-  return null;
-}
-
-/// Returns the Rti type of [object]. Closures have both an interface type
-/// (Closures implement `Function`) and a structural function type. Uses
-/// [testRti] to choose the appropriate type.
-///
-/// Called from generated code.
-Rti instanceOrFunctionType(Object? object, Rti testRti) {
-  if (Rti._isUnionOfFunctionType(testRti)) {
-    if (_isClosure(object)) {
-      // If [testRti] is e.g. `FutureOr<Action>` (where `Action` is some
-      // function type), we don't need to worry about the `Future<Action>`
-      // branch because closures can't be `Future`s.
-      Rti? rti = closureFunctionType(object);
-      if (rti != null) return rti;
-    }
-  }
-  return instanceType(object);
-}
-
-/// Returns the Rti type of [object].
-/// This is the general entry for obtaining the interface type of any value.
-/// Called from generated code.
-Rti instanceType(Object? object) {
-  // TODO(sra): Add interceptor-based specializations of this method. Inject a
-  // _getRti method into (Dart)Object, JSArray, and Interceptor. Then calls to
-  // this method can be generated as `getInterceptor(o)._getRti(o)`, allowing
-  // interceptor optimizations to select the specialization. If the only use of
-  // `getInterceptor` is for calling `_getRti`, then `instanceType` can be
-  // called, similar to a one-shot interceptor call. This would improve type
-  // lookup in ListMixin code as the interceptor is JavaScript 'this'.
-
-  if (_isDartObject(object)) {
-    return _instanceType(object);
-  }
-
-  if (_Utils.isArray(object)) {
-    return _arrayInstanceType(object);
-  }
-
-  var interceptor = getInterceptor(object);
-  return _instanceTypeFromConstructor(interceptor);
-}
-
-/// Returns the Rti type of JavaScript Array [object].
-/// Called from generated code.
-Rti _arrayInstanceType(Object? object) {
-  // A JavaScript Array can come from three places:
-  //   1. This Dart program.
-  //   2. Another Dart program loaded in the JavaScript environment.
-  //   3. From outside of a Dart program.
-  //
-  // In case 3 we default to a fixed type for all external Arrays.  To protect
-  // against an Array passed between two Dart programs loaded into the same
-  // JavaScript isolate (communicating e.g. via JS-interop), we check that the
-  // stored value is 'our' Rti type.
-  //
-  // TODO(40175): Investigate if it is more efficient to have each Dart program
-  // use a unique JavaScript property so that both case 2 and case 3 look like a
-  // missing value. In ES6 we could use a globally named JavaScript Symbol. For
-  // IE11 we would have to synthesise a String property-name with almost zero
-  // chance of conflict.
-
-  var rti = JS('', r'#[#]', object, JS_EMBEDDED_GLOBAL('', ARRAY_RTI_PROPERTY));
-  var defaultRti = getJSArrayInteropRti();
-
-  // Case 3.
-  if (rti == null) return _Utils.asRti(defaultRti);
-
-  // Case 2 and perhaps case 3. Check constructor of extracted type against a
-  // known instance of Rti - this is an easy way to get the constructor.
-  if (JS('bool', '#.constructor !== #.constructor', rti, defaultRti)) {
-    return _Utils.asRti(defaultRti);
-  }
-
-  // Case 1.
-  return _Utils.asRti(rti);
-}
-
-/// Returns the Rti type of user-defined class [object].
-/// [object] must not be an intercepted class or a closure.
-/// Called from generated code.
-Rti _instanceType(Object? object) {
-  var rti = JS('', r'#[#]', object, JS_GET_NAME(JsGetName.RTI_NAME));
-  return rti != null ? _Utils.asRti(rti) : _instanceTypeFromConstructor(object);
-}
-
-String instanceTypeName(Object? object) {
-  Rti rti = instanceType(object);
-  return _rtiToString(rti, null);
-}
-
-Rti _instanceTypeFromConstructor(Object? instance) {
-  var constructor = JS('', '#.constructor', instance);
-  var probe = JS('', r'#[#]', constructor, CONSTRUCTOR_RTI_CACHE_PROPERTY_NAME);
-  if (probe != null) return _Utils.asRti(probe);
-  return _instanceTypeFromConstructorMiss(instance, constructor);
-}
-
-@pragma('dart2js:noInline')
-Rti _instanceTypeFromConstructorMiss(Object? instance, Object? constructor) {
-  // Subclasses of Closure are synthetic classes. The synthetic classes all
-  // extend a 'normal' class (Closure, BoundClosure, StaticClosure), so make
-  // them appear to be the superclass. Instantiations have a `$ti` field so
-  // don't reach here.
-  //
-  // TODO(39214): This will need fixing if we ever use instances of
-  // StaticClosure for static tear-offs.
-  //
-  // TODO(sra): Can this test be avoided, e.g. by putting $ti on the
-  // prototype of Closure/BoundClosure/StaticClosure classes?
-  var effectiveConstructor = _isClosure(instance)
-      ? JS('', '#.__proto__.__proto__.constructor', instance)
-      : constructor;
-  Rti rti = _Universe.findErasedType(
-      _theUniverse(), JS('String', '#.name', effectiveConstructor));
-  JS('', r'#[#] = #', constructor, CONSTRUCTOR_RTI_CACHE_PROPERTY_NAME, rti);
-  return rti;
-}
-
-/// Returns the structural function type of [object], or `null` if the object is
-/// not a closure.
-Rti? _instanceFunctionType(Object? object) =>
-    _isClosure(object) ? closureFunctionType(object) : null;
-
-/// Returns Rti from types table. The types table is initialized with recipe
-/// strings.
-Rti getTypeFromTypesTable(int index) {
-  var table = JS_EMBEDDED_GLOBAL('', TYPES);
-  var type = _Utils.arrayAt(table, index);
-  if (_Utils.isString(type)) {
-    Rti rti = findType(_Utils.asString(type));
-    _Utils.arraySetAt(table, index, rti);
-    return rti;
-  }
-  return _Utils.asRti(type);
-}
-
-Type getRuntimeType(Object? object) {
-  Rti rti = _instanceFunctionType(object) ?? instanceType(object);
-  return createRuntimeType(rti);
-}
-
-/// Called from generated code.
-Type createRuntimeType(Rti rti) {
-  _Type? type = Rti._getCachedRuntimeType(rti);
-  if (type != null) return type;
-  if (JS_GET_FLAG('PRINT_LEGACY_STARS')) {
-    return _Type(rti);
-  } else {
-    String recipe = Rti._getCanonicalRecipe(rti);
-    String starErasedRecipe = JS('String', '#.replace(/\\*/g, "")', recipe);
-    if (starErasedRecipe == recipe) {
-      return _Type(rti);
-    }
-    Rti starErasedRti = _Universe.eval(_theUniverse(), starErasedRecipe, true);
-    type = Rti._getCachedRuntimeType(starErasedRti) ?? _Type(starErasedRti);
-    Rti._setCachedRuntimeType(rti, type);
-    return type;
-  }
-}
-
-/// Called from generated code in the constant pool.
-Type typeLiteral(String recipe) {
-  return createRuntimeType(findType(recipe));
-}
-
-/// Implementation of [Type] based on Rti.
-class _Type implements Type {
-  final Rti _rti;
-
-  _Type(this._rti) : assert(Rti._getCachedRuntimeType(_rti) == null) {
-    Rti._setCachedRuntimeType(_rti, this);
-  }
-
-  @override
-  String toString() => _rtiToString(_rti, null);
-}
-
-/// Called from generated code.
-///
-/// The first time the default `_is` method is called, it replaces itself with a
-/// specialized version.
-// TODO(sra): Emit code to force-replace the `_is` method, generated dependent
-// on the types used in the program. e.g.
-//
-//     findType("bool")._is = H._isBool;
-//
-// This could be omitted if (1) the `bool` rti is not used directly for a test
-// (e.g. we lower a check to a direct helper), and (2) `bool` does not flow to a
-// tested type parameter. The trick will be to ensure that `H._isBool` is
-// generated.
-bool _installSpecializedIsTest(Object? object) {
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-
-  if (isObjectType(testRti)) {
-    return _finishIsFn(testRti, object, RAW_DART_FUNCTION_REF(_isObject));
-  }
-  if (isTopType(testRti)) {
-    return _finishIsFn(testRti, object, RAW_DART_FUNCTION_REF(_isTop));
-  }
-
-  // `o is T*` generally behaves like `o is T`.
-  // The exeptions are `Object*` (handled above) and `Never*`
-  //
-  //   `null is Never`  --> `false`
-  //   `null is Never*` --> `true`
-  Rti unstarred = Rti._getKind(testRti) == Rti.kindStar
-      ? Rti._getStarArgument(testRti)
-      : testRti;
-
-  var isFn = _simpleSpecializedIsTest(unstarred);
-  if (isFn != null) {
-    return _finishIsFn(testRti, object, isFn);
-  }
-
-  if (Rti._getKind(unstarred) == Rti.kindInterface) {
-    String name = Rti._getInterfaceName(unstarred);
-    var arguments = Rti._getInterfaceTypeArguments(unstarred);
-    // This recognizes interface types instantiated with Top, which includes the
-    // common case of interfaces that have no type parameters.
-    // TODO(sra): Can we easily recognize other interface types instantiated to
-    // bounds?
-    if (JS('bool', '#.every(#)', arguments, RAW_DART_FUNCTION_REF(isTopType))) {
-      String propertyName =
-          '${JS_GET_NAME(JsGetName.OPERATOR_IS_PREFIX)}${name}';
-      Rti._setSpecializedTestResource(testRti, propertyName);
-      return _finishIsFn(
-          testRti, object, RAW_DART_FUNCTION_REF(_isTestViaProperty));
-    }
-    // fall through to general implementation.
-  } else if (Rti._getKind(testRti) == Rti.kindQuestion) {
-    return _finishIsFn(testRti, object,
-        RAW_DART_FUNCTION_REF(_generalNullableIsTestImplementation));
-  }
-  return _finishIsFn(
-      testRti, object, RAW_DART_FUNCTION_REF(_generalIsTestImplementation));
-}
-
-@pragma('dart2js:noInline') // Slightly smaller code.
-bool _finishIsFn(Rti testRti, Object? object, Object? isFn) {
-  Rti._setIsTestFunction(testRti, isFn);
-  return Rti._isCheck(testRti, object);
-}
-
-Object? _simpleSpecializedIsTest(Rti testRti) {
-  // Note: We must not match `Never` below.
-  var isFn = null;
-  if (_Utils.isIdentical(testRti, TYPE_REF<int>())) {
-    isFn = RAW_DART_FUNCTION_REF(_isInt);
-  } else if (_Utils.isIdentical(testRti, TYPE_REF<double>()) ||
-      _Utils.isIdentical(testRti, TYPE_REF<num>())) {
-    isFn = RAW_DART_FUNCTION_REF(_isNum);
-  } else if (_Utils.isIdentical(testRti, TYPE_REF<String>())) {
-    isFn = RAW_DART_FUNCTION_REF(_isString);
-  } else if (_Utils.isIdentical(testRti, TYPE_REF<bool>())) {
-    isFn = RAW_DART_FUNCTION_REF(_isBool);
-  }
-  return isFn;
-}
-
-/// Called from generated code.
-///
-/// The first time this default `_as` method is called, it replaces itself with
-/// a specialized version.
-bool _installSpecializedAsCheck(Object? object) {
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-
-  var asFn = RAW_DART_FUNCTION_REF(_generalAsCheckImplementation);
-  if (isTopType(testRti)) {
-    asFn = RAW_DART_FUNCTION_REF(_asTop);
-  } else if (isObjectType(testRti)) {
-    asFn = RAW_DART_FUNCTION_REF(_asObject);
-  } else {
-    if (JS_GET_FLAG('LEGACY') || isNullable(testRti)) {
-      asFn = RAW_DART_FUNCTION_REF(_generalNullableAsCheckImplementation);
-    }
-  }
-
-  Rti._setAsCheckFunction(testRti, asFn);
-  return Rti._asCheck(testRti, object);
-}
-
-bool _nullIs(Rti testRti) {
-  int kind = Rti._getKind(testRti);
-  return isTopType(testRti) ||
-      _Utils.isIdentical(testRti, LEGACY_TYPE_REF<Never>()) ||
-      kind == Rti.kindQuestion ||
-      isNullType(testRti);
-}
-
-/// Called from generated code.
-bool _generalIsTestImplementation(Object? object) {
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-  if (object == null) return _nullIs(testRti);
-  Rti objectRti = instanceOrFunctionType(object, testRti);
-  return isSubtype(_theUniverse(), objectRti, testRti);
-}
-
-/// Specialized test for `x is T1` where `T1` has the form `T2?`.  Test is
-/// compositional, calling `T2._is(object)`, so if `T2` has a specialized
-/// version, the composed test will be fast (but not quite as fast as a
-/// single-step specialization).
-///
-/// Called from generated code.
-bool _generalNullableIsTestImplementation(Object? object) {
-  if (object == null) return true;
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-  Rti baseRti = Rti._getQuestionArgument(testRti);
-  return Rti._isCheck(baseRti, object);
-}
-
-/// Called from generated code.
-bool _isTestViaProperty(Object? object) {
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-  if (object == null) return _nullIs(testRti);
-  var tag = Rti._getSpecializedTestResource(testRti);
-
-  // This test is redundant with getInterceptor below, but getInterceptor does
-  // the tests in the wrong order for most tags, so it is usually faster to have
-  // this check.
-  if (_isDartObject(object)) {
-    return JS('bool', '!!#[#]', object, tag);
-  }
-
-  var interceptor = getInterceptor(object);
-  return JS('bool', '!!#[#]', interceptor, tag);
-}
-
-/// General unspecialized 'as' check that works for any type.
-/// Called from generated code.
-Object? _generalAsCheckImplementation(Object? object) {
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-  if (object == null) {
-    if (JS_GET_FLAG('LEGACY') || isNullable(testRti)) return object;
-  } else if (Rti._isCheck(testRti, object)) return object;
-  _failedAsCheck(object, testRti);
-}
-
-/// General 'as' check for types that accept `null`.
-/// Called from generated code.
-Object? _generalNullableAsCheckImplementation(Object? object) {
-  // This static method is installed on an Rti object as a JavaScript instance
-  // method. The Rti object is 'this'.
-  Rti testRti = _Utils.asRti(JS('', 'this'));
-  if (object == null) {
-    return object;
-  } else if (Rti._isCheck(testRti, object)) return object;
-  _failedAsCheck(object, testRti);
-}
-
-void _failedAsCheck(Object? object, Rti testRti) {
-  Rti objectRti = instanceOrFunctionType(object, testRti);
-  String message =
-      _Error.compose(object, objectRti, _rtiToString(testRti, null));
-  throw _TypeError.fromMessage(message);
-}
-
-/// Called from generated code.
-Rti checkTypeBound(Rti type, Rti bound, String variable, String methodName) {
-  if (isSubtype(_theUniverse(), type, bound)) return type;
-  String message = "The type argument '${_rtiToString(type, null)}' is not"
-      " a subtype of the type variable bound '${_rtiToString(bound, null)}'"
-      " of type variable '$variable' in '$methodName'.";
-  throw _TypeError.fromMessage(message);
-}
-
-/// Base class to _TypeError.
-class _Error extends Error {
-  final String _message;
-  _Error(this._message);
-
-  static String compose(
-      Object? object, Rti? objectRti, String checkedTypeDescription) {
-    String objectDescription = Error.safeToString(object);
-    objectRti ??= instanceType(object);
-    String objectTypeDescription = _rtiToString(objectRti, null);
-    return "${objectDescription}:"
-        " type '${objectTypeDescription}'"
-        " is not a subtype of type '${checkedTypeDescription}'";
-  }
-
-  @override
-  String toString() => _message;
-}
-
-class _TypeError extends _Error implements TypeError, CastError {
-  _TypeError.fromMessage(String message) : super('TypeError: $message');
-
-  factory _TypeError.forType(object, String type) {
-    return _TypeError.fromMessage(_Error.compose(object, null, type));
-  }
-
-  @override
-  String get message => _message;
-}
-
-// Specializations.
-//
-// Specializations can be placed on Rti objects as the _as and _is
-// 'methods'. They can also be called directly called from generated code.
-
-/// Specialization for 'is Object'.
-/// Called from generated code via Rti `_is` method.
-bool _isObject(Object? object) {
-  return !JS_GET_FLAG('NNBD') || object != null;
-}
-
-/// Specialization for 'as Object'.
-/// Called from generated code via Rti `_as` method.
-Object? _asObject(Object? object) {
-  if (JS_GET_FLAG('LEGACY') || object != null) return object;
-  throw _TypeError.forType(object, 'Object');
-}
-
-/// Specialization for 'is dynamic' and other top types.
-/// Called from generated code via Rti `_is` method.
-bool _isTop(Object? object) {
-  return true;
-}
-
-/// Specialization for 'as dynamic' and other top types.
-/// Called from generated code via Rti `_as` methods.
-Object? _asTop(Object? object) {
-  return object;
-}
-
-/// Specialization for 'is bool'.
-/// Called from generated code.
-bool _isBool(Object? object) {
-  return true == object || false == object;
-}
-
-// TODO(fishythefish): Change `dynamic` to `Object?` below once promotion works.
-
-/// Specialization for 'as bool'.
-/// Called from generated code.
-bool _asBool(Object? object) {
-  if (_isBool(object)) return _Utils.asBool(object);
-  throw _TypeError.forType(object, 'bool');
-}
-
-/// Specialization for 'as bool*'.
-/// Called from generated code.
-bool? _asBoolS(dynamic object) {
-  if (_isBool(object)) return _Utils.asBool(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'bool');
-}
-
-/// Specialization for 'as bool?'.
-/// Called from generated code.
-bool? _asBoolQ(dynamic object) {
-  if (_isBool(object)) return _Utils.asBool(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'bool?');
-}
-
-/// Specialization for 'as double'.
-/// Called from generated code.
-double _asDouble(Object? object) {
-  if (_isNum(object)) return _Utils.asDouble(object);
-  throw _TypeError.forType(object, 'double');
-}
-
-/// Specialization for 'as double*'.
-/// Called from generated code.
-double? _asDoubleS(dynamic object) {
-  if (_isNum(object)) return _Utils.asDouble(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'double');
-}
-
-/// Specialization for 'as double?'.
-/// Called from generated code.
-double? _asDoubleQ(dynamic object) {
-  if (_isNum(object)) return _Utils.asDouble(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'double?');
-}
-
-/// Specialization for 'is int'.
-/// Called from generated code.
-bool _isInt(Object? object) {
-  return JS('bool', 'typeof # == "number"', object) &&
-      JS('bool', 'Math.floor(#) === #', object, object);
-}
-
-/// Specialization for 'as int'.
-/// Called from generated code.
-int _asInt(Object? object) {
-  if (_isInt(object)) return _Utils.asInt(object);
-  throw _TypeError.forType(object, 'int');
-}
-
-/// Specialization for 'as int*'.
-/// Called from generated code.
-int? _asIntS(dynamic object) {
-  if (_isInt(object)) return _Utils.asInt(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'int');
-}
-
-/// Specialization for 'as int?'.
-/// Called from generated code.
-int? _asIntQ(dynamic object) {
-  if (_isInt(object)) return _Utils.asInt(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'int?');
-}
-
-/// Specialization for 'is num' and 'is double'.
-/// Called from generated code.
-bool _isNum(Object? object) {
-  return JS('bool', 'typeof # == "number"', object);
-}
-
-/// Specialization for 'as num'.
-/// Called from generated code.
-num _asNum(Object? object) {
-  if (_isNum(object)) return _Utils.asNum(object);
-  throw _TypeError.forType(object, 'num');
-}
-
-/// Specialization for 'as num*'.
-/// Called from generated code.
-num? _asNumS(dynamic object) {
-  if (_isNum(object)) return _Utils.asNum(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'num');
-}
-
-/// Specialization for 'as num?'.
-/// Called from generated code.
-num? _asNumQ(dynamic object) {
-  if (_isNum(object)) return _Utils.asNum(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'num?');
-}
-
-/// Specialization for 'is String'.
-/// Called from generated code.
-bool _isString(Object? object) {
-  return JS('bool', 'typeof # == "string"', object);
-}
-
-/// Specialization for 'as String'.
-/// Called from generated code.
-String _asString(Object? object) {
-  if (_isString(object)) return _Utils.asString(object);
-  throw _TypeError.forType(object, 'String');
-}
-
-/// Specialization for 'as String*'.
-/// Called from generated code.
-String? _asStringS(dynamic object) {
-  if (_isString(object)) return _Utils.asString(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'String');
-}
-
-/// Specialization for 'as String?'.
-/// Called from generated code.
-String? _asStringQ(dynamic object) {
-  if (_isString(object)) return _Utils.asString(object);
-  if (object == null) return object;
-  throw _TypeError.forType(object, 'String?');
-}
-
-String _rtiArrayToString(Object? array, List<String>? genericContext) {
-  String s = '', sep = '';
-  for (int i = 0; i < _Utils.arrayLength(array); i++) {
-    s += sep +
-        _rtiToString(_Utils.asRti(_Utils.arrayAt(array, i)), genericContext);
-    sep = ', ';
-  }
-  return s;
-}
-
-String _functionRtiToString(Rti functionType, List<String>? genericContext,
-    {Object? bounds = null}) {
-  String typeParametersText = '';
-  int? outerContextLength;
-
-  if (bounds != null) {
-    int boundsLength = _Utils.arrayLength(bounds);
-    if (genericContext == null) {
-      genericContext = <String>[];
-    } else {
-      outerContextLength = genericContext.length;
-    }
-    int offset = genericContext.length;
-    for (int i = boundsLength; i > 0; i--) {
-      genericContext.add('T${offset + i}');
-    }
-
-    String typeSep = '';
-    typeParametersText = '<';
-    for (int i = 0; i < boundsLength; i++) {
-      typeParametersText += typeSep;
-      typeParametersText += genericContext[genericContext.length - 1 - i];
-      Rti boundRti = _Utils.asRti(_Utils.arrayAt(bounds, i));
-      if (!isTopType(boundRti)) {
-        typeParametersText +=
-            ' extends ' + _rtiToString(boundRti, genericContext);
-      }
-      typeSep = ', ';
-    }
-    typeParametersText += '>';
-  }
-
-  Rti returnType = Rti._getReturnType(functionType);
-  _FunctionParameters parameters = Rti._getFunctionParameters(functionType);
-  var requiredPositional =
-      _FunctionParameters._getRequiredPositional(parameters);
-  int requiredPositionalLength = _Utils.arrayLength(requiredPositional);
-  var optionalPositional =
-      _FunctionParameters._getOptionalPositional(parameters);
-  int optionalPositionalLength = _Utils.arrayLength(optionalPositional);
-  var named = _FunctionParameters._getNamed(parameters);
-  int namedLength = _Utils.arrayLength(named);
-  assert(optionalPositionalLength == 0 || namedLength == 0);
-
-  String returnTypeText = _rtiToString(returnType, genericContext);
-
-  String argumentsText = '';
-  String sep = '';
-  for (int i = 0; i < requiredPositionalLength; i++) {
-    argumentsText += sep +
-        _rtiToString(_Utils.asRti(_Utils.arrayAt(requiredPositional, i)),
-            genericContext);
-    sep = ', ';
-  }
-
-  if (optionalPositionalLength > 0) {
-    argumentsText += sep + '[';
-    sep = '';
-    for (int i = 0; i < optionalPositionalLength; i++) {
-      argumentsText += sep +
-          _rtiToString(_Utils.asRti(_Utils.arrayAt(optionalPositional, i)),
-              genericContext);
-      sep = ', ';
-    }
-    argumentsText += ']';
-  }
-
-  if (namedLength > 0) {
-    argumentsText += sep + '{';
-    sep = '';
-    for (int i = 0; i < namedLength; i += 3) {
-      argumentsText += sep;
-      if (_Utils.asBool(_Utils.arrayAt(named, i + 1))) {
-        argumentsText += 'required ';
-      }
-      argumentsText += _rtiToString(
-              _Utils.asRti(_Utils.arrayAt(named, i + 2)), genericContext) +
-          ' ' +
-          _Utils.asString(_Utils.arrayAt(named, i));
-      sep = ', ';
-    }
-    argumentsText += '}';
-  }
-
-  if (outerContextLength != null) {
-    // Pop all of the generic type parameters.
-    JS('', '#.length = #', genericContext!, outerContextLength);
-  }
-
-  // TODO(fishythefish): Below is the same format as the VM. Change to:
-  //
-  //     return '${returnTypeText} Function${typeParametersText}(${argumentsText})';
-  //
-  return '${typeParametersText}(${argumentsText}) => ${returnTypeText}';
-}
-
-String _rtiToString(Rti rti, List<String>? genericContext) {
-  int kind = Rti._getKind(rti);
-
-  if (kind == Rti.kindErased) return 'erased';
-  if (kind == Rti.kindDynamic) return 'dynamic';
-  if (kind == Rti.kindVoid) return 'void';
-  if (kind == Rti.kindNever) return 'Never';
-  if (kind == Rti.kindAny) return 'any';
-
-  if (kind == Rti.kindStar) {
-    Rti starArgument = Rti._getStarArgument(rti);
-    String s = _rtiToString(starArgument, genericContext);
-    if (JS_GET_FLAG('PRINT_LEGACY_STARS')) {
-      int argumentKind = Rti._getKind(starArgument);
-      if (argumentKind == Rti.kindFunction ||
-          argumentKind == Rti.kindGenericFunction) {
-        s = '(' + s + ')';
-      }
-      return s + '*';
-    } else {
-      return s;
-    }
-  }
-
-  if (kind == Rti.kindQuestion) {
-    Rti questionArgument = Rti._getQuestionArgument(rti);
-    String s = _rtiToString(questionArgument, genericContext);
-    int argumentKind = Rti._getKind(questionArgument);
-    if (argumentKind == Rti.kindFunction ||
-        argumentKind == Rti.kindGenericFunction) {
-      s = '(' + s + ')';
-    }
-    return s + '?';
-  }
-
-  if (kind == Rti.kindFutureOr) {
-    Rti futureOrArgument = Rti._getFutureOrArgument(rti);
-    return 'FutureOr<${_rtiToString(futureOrArgument, genericContext)}>';
-  }
-
-  if (kind == Rti.kindInterface) {
-    String name = Rti._getInterfaceName(rti);
-    name = _unminifyOrTag(name);
-    var arguments = Rti._getInterfaceTypeArguments(rti);
-    if (arguments.length != 0) {
-      name += '<' + _rtiArrayToString(arguments, genericContext) + '>';
-    }
-    return name;
-  }
-
-  if (kind == Rti.kindFunction) {
-    return _functionRtiToString(rti, genericContext);
-  }
-
-  if (kind == Rti.kindGenericFunction) {
-    Rti baseFunctionType = Rti._getGenericFunctionBase(rti);
-    var bounds = Rti._getGenericFunctionBounds(rti);
-    return _functionRtiToString(baseFunctionType, genericContext,
-        bounds: bounds);
-  }
-
-  if (kind == Rti.kindGenericFunctionParameter) {
-    var context = genericContext!;
-    int index = Rti._getGenericFunctionParameterIndex(rti);
-    return context[context.length - 1 - index];
-  }
-
-  return '?';
-}
-
-String _unminifyOrTag(String rawClassName) {
-  String? preserved = unmangleGlobalNameIfPreservedAnyways(rawClassName);
-  if (preserved != null) return preserved;
-  return JS_GET_FLAG('MINIFIED') ? 'minified:$rawClassName' : rawClassName;
-}
-
-String _rtiArrayToDebugString(Object? array) {
-  String s = '[', sep = '';
-  for (int i = 0; i < _Utils.arrayLength(array); i++) {
-    s += sep + _rtiToDebugString(_Utils.asRti(_Utils.arrayAt(array, i)));
-    sep = ', ';
-  }
-  return s + ']';
-}
-
-String functionParametersToString(_FunctionParameters parameters) {
-  String s = '(', sep = '';
-  var requiredPositional =
-      _FunctionParameters._getRequiredPositional(parameters);
-  int requiredPositionalLength = _Utils.arrayLength(requiredPositional);
-  var optionalPositional =
-      _FunctionParameters._getOptionalPositional(parameters);
-  int optionalPositionalLength = _Utils.arrayLength(optionalPositional);
-  var named = _FunctionParameters._getNamed(parameters);
-  int namedLength = _Utils.arrayLength(named);
-  assert(optionalPositionalLength == 0 || namedLength == 0);
-
-  for (int i = 0; i < requiredPositionalLength; i++) {
-    s += sep +
-        _rtiToDebugString(_Utils.asRti(_Utils.arrayAt(requiredPositional, i)));
-    sep = ', ';
-  }
-
-  if (optionalPositionalLength > 0) {
-    s += sep + '[';
-    sep = '';
-    for (int i = 0; i < optionalPositionalLength; i++) {
-      s += sep +
-          _rtiToDebugString(
-              _Utils.asRti(_Utils.arrayAt(optionalPositional, i)));
-      sep = ', ';
-    }
-    s += ']';
-  }
-
-  if (namedLength > 0) {
-    s += sep + '{';
-    sep = '';
-    for (int i = 0; i < namedLength; i += 3) {
-      s += sep;
-      if (_Utils.asBool(_Utils.arrayAt(named, i + 1))) {
-        s += 'required ';
-      }
-      s += _rtiToDebugString(_Utils.asRti(_Utils.arrayAt(named, i + 2))) +
-          ' ' +
-          _Utils.asString(_Utils.arrayAt(named, i));
-      sep = ', ';
-    }
-    s += '}';
-  }
-
-  return s + ')';
-}
-
-String _rtiToDebugString(Rti rti) {
-  int kind = Rti._getKind(rti);
-
-  if (kind == Rti.kindErased) return 'erased';
-  if (kind == Rti.kindDynamic) return 'dynamic';
-  if (kind == Rti.kindVoid) return 'void';
-  if (kind == Rti.kindNever) return 'Never';
-  if (kind == Rti.kindAny) return 'any';
-
-  if (kind == Rti.kindStar) {
-    Rti starArgument = Rti._getStarArgument(rti);
-    return 'star(${_rtiToDebugString(starArgument)})';
-  }
-
-  if (kind == Rti.kindQuestion) {
-    Rti questionArgument = Rti._getQuestionArgument(rti);
-    return 'question(${_rtiToDebugString(questionArgument)})';
-  }
-
-  if (kind == Rti.kindFutureOr) {
-    Rti futureOrArgument = Rti._getFutureOrArgument(rti);
-    return 'FutureOr(${_rtiToDebugString(futureOrArgument)})';
-  }
-
-  if (kind == Rti.kindInterface) {
-    String name = Rti._getInterfaceName(rti);
-    var arguments = Rti._getInterfaceTypeArguments(rti);
-    if (_Utils.arrayLength(arguments) == 0) {
-      return 'interface("$name")';
-    } else {
-      return 'interface("$name", ${_rtiArrayToDebugString(arguments)})';
-    }
-  }
-
-  if (kind == Rti.kindBinding) {
-    Rti base = Rti._getBindingBase(rti);
-    var arguments = Rti._getBindingArguments(rti);
-    return 'binding(${_rtiToDebugString(base)}, ${_rtiArrayToDebugString(arguments)})';
-  }
-
-  if (kind == Rti.kindFunction) {
-    Rti returnType = Rti._getReturnType(rti);
-    _FunctionParameters parameters = Rti._getFunctionParameters(rti);
-    return 'function(${_rtiToDebugString(returnType)}, ${functionParametersToString(parameters)})';
-  }
-
-  if (kind == Rti.kindGenericFunction) {
-    Rti baseFunctionType = Rti._getGenericFunctionBase(rti);
-    var bounds = Rti._getGenericFunctionBounds(rti);
-    return 'genericFunction(${_rtiToDebugString(baseFunctionType)}, ${_rtiArrayToDebugString(bounds)})';
-  }
-
-  if (kind == Rti.kindGenericFunctionParameter) {
-    int index = Rti._getGenericFunctionParameterIndex(rti);
-    return 'genericFunctionParameter($index)';
-  }
-
-  return 'other(kind=$kind)';
-}
-
-/// Class of static methods for the universe of Rti objects.
-///
-/// The universe is the manager object for the Rti instances.
-///
-/// The universe itself is allocated at startup before any types or Dart objects
-/// can be created, so it does not have a Dart type.
-class _Universe {
-  _Universe._() {
-    throw UnimplementedError('_Universe is static methods only');
-  }
-
-  @pragma('dart2js:noInline')
-  static Object create() {
-    // This needs to be kept in sync with `FragmentEmitter.createRtiUniverse` in
-    // `fragment_emitter.dart`.
-    return JS(
-        '',
-        '{'
-            '#: new Map(),'
-            '#: {},'
-            '#: {},'
-            '#: {},'
-            '#: [],' // shared empty array.
-            '}',
-        RtiUniverseFieldNames.evalCache,
-        RtiUniverseFieldNames.typeRules,
-        RtiUniverseFieldNames.erasedTypes,
-        RtiUniverseFieldNames.typeParameterVariances,
-        RtiUniverseFieldNames.sharedEmptyArray);
-  }
-
-  // Field accessors.
-
-  static Object evalCache(Object? universe) =>
-      JS('', '#.#', universe, RtiUniverseFieldNames.evalCache);
-
-  static Object typeRules(Object? universe) =>
-      JS('', '#.#', universe, RtiUniverseFieldNames.typeRules);
-
-  static Object erasedTypes(Object? universe) =>
-      JS('', '#.#', universe, RtiUniverseFieldNames.erasedTypes);
-
-  static Object typeParameterVariances(Object? universe) =>
-      JS('', '#.#', universe, RtiUniverseFieldNames.typeParameterVariances);
-
-  static Object? _findRule(Object? universe, String targetType) =>
-      JS('', '#.#', typeRules(universe), targetType);
-
-  static Object? findRule(Object? universe, String targetType) {
-    var rule = _findRule(universe, targetType);
-    while (_Utils.isString(rule)) {
-      rule = _findRule(universe, _Utils.asString(rule));
-    }
-    return rule;
-  }
-
-  static Rti findErasedType(Object? universe, String cls) {
-    var metadata = erasedTypes(universe);
-    var probe = JS('', '#.#', metadata, cls);
-    if (probe == null) {
-      return eval(universe, cls, false);
-    } else if (_Utils.isNum(probe)) {
-      int length = _Utils.asInt(probe);
-      Rti erased = _lookupErasedRti(universe);
-      Object? arguments = JS('', '[]');
-      for (int i = 0; i < length; i++) {
-        _Utils.arrayPush(arguments, erased);
-      }
-      Rti interface = _lookupInterfaceRti(universe, cls, arguments);
-      JS('', '#.# = #', metadata, cls, interface);
-      return interface;
-    } else {
-      return _Utils.asRti(probe);
-    }
-  }
-
-  static Object? findTypeParameterVariances(Object? universe, String cls) =>
-      JS('', '#.#', typeParameterVariances(universe), cls);
-
-  static void addRules(Object? universe, Object? rules) =>
-      _Utils.objectAssign(typeRules(universe), rules);
-
-  static void addErasedTypes(Object? universe, Object? types) =>
-      _Utils.objectAssign(erasedTypes(universe), types);
-
-  static void addTypeParameterVariances(Object? universe, Object? variances) =>
-      _Utils.objectAssign(typeParameterVariances(universe), variances);
-
-  static JSArray sharedEmptyArray(Object? universe) =>
-      JS('JSArray', '#.#', universe, RtiUniverseFieldNames.sharedEmptyArray);
-
-  /// Evaluates [recipe] in the global environment.
-  static Rti eval(Object? universe, String recipe, bool normalize) {
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, recipe);
-    if (probe != null) return _Utils.asRti(probe);
-    Rti rti = _parseRecipe(universe, null, recipe, normalize);
-    _Utils.mapSet(cache, recipe, rti);
-    return rti;
-  }
-
-  static Rti evalInEnvironment(
-      Object? universe, Rti environment, String recipe) {
-    var cache = Rti._getEvalCache(environment);
-    if (cache == null) {
-      cache = JS('', 'new Map()');
-      Rti._setEvalCache(environment, cache);
-    }
-    var probe = _Utils.mapGet(cache, recipe);
-    if (probe != null) return _Utils.asRti(probe);
-    Rti rti = _parseRecipe(universe, environment, recipe, true);
-    _Utils.mapSet(cache, recipe, rti);
-    return rti;
-  }
-
-  static Rti bind(Object? universe, Rti environment, Rti argumentsRti) {
-    var cache = Rti._getBindCache(environment);
-    if (cache == null) {
-      cache = JS('', 'new Map()');
-      Rti._setBindCache(environment, cache);
-    }
-    String argumentsRecipe = Rti._getCanonicalRecipe(argumentsRti);
-    var probe = _Utils.mapGet(cache, argumentsRecipe);
-    if (probe != null) return _Utils.asRti(probe);
-    var argumentsArray;
-    if (Rti._getKind(argumentsRti) == Rti.kindBinding) {
-      argumentsArray = Rti._getBindingArguments(argumentsRti);
-    } else {
-      argumentsArray = JS('', '[#]', argumentsRti);
-    }
-    Rti rti = _lookupBindingRti(universe, environment, argumentsArray);
-    _Utils.mapSet(cache, argumentsRecipe, rti);
-    return rti;
-  }
-
-  static Rti bind1(Object? universe, Rti environment, Rti argumentsRti) {
-    throw UnimplementedError('_Universe.bind1');
-  }
-
-  static Rti evalTypeVariable(Object? universe, Rti environment, String name) {
-    int kind = Rti._getKind(environment);
-    if (kind == Rti.kindBinding) {
-      environment = Rti._getBindingBase(environment);
-    }
-
-    String interfaceName = Rti._getInterfaceName(environment);
-    var rule = _Universe.findRule(universe, interfaceName);
-    assert(rule != null);
-    String? recipe = TypeRule.lookupTypeVariable(rule, name);
-    if (recipe == null) {
-      throw 'No "$name" in "${Rti._getCanonicalRecipe(environment)}"';
-    }
-    return _Universe.evalInEnvironment(universe, environment, recipe);
-  }
-
-  static Rti _parseRecipe(
-      Object? universe, Object? environment, String recipe, bool normalize) {
-    var parser = _Parser.create(universe, environment, recipe, normalize);
-    Rti rti = _Parser.parse(parser);
-    return rti;
-  }
-
-  static Rti _installTypeTests(Object? universe, Rti rti) {
-    // Set up methods to perform type tests. The general as-check methods use
-    // the is-test method. The is-test method on first use overwrites itself,
-    // and possibly the as-check methods, with a specialized version.
-    var asFn = RAW_DART_FUNCTION_REF(_installSpecializedAsCheck);
-    var isFn = RAW_DART_FUNCTION_REF(_installSpecializedIsTest);
-    Rti._setAsCheckFunction(rti, asFn);
-    Rti._setIsTestFunction(rti, isFn);
-    return rti;
-  }
-
-  static Rti _installRti(Object? universe, String key, Rti rti) {
-    _Utils.mapSet(evalCache(universe), key, rti);
-    return rti;
-  }
-
-  // These helpers are used for creating canonical recipes. The key feature of
-  // the generated code is that it makes no reference to the constant pool,
-  // which does not exist when the type$ pool is created.
-  //
-  // The strange association is so that usage like
-  //
-  //     s = _recipeJoin3(s, a, b);
-  //
-  // associates as `s+=(a+b)` rather than `s=s+a+b`. As recipe fragments are
-  // small, this tends to create smaller cons-string trees.
-
-  static String _recipeJoin(String s1, String s2) => JS_STRING_CONCAT(s1, s2);
-  static String _recipeJoin3(String s1, String s2, String s3) =>
-      JS_STRING_CONCAT(s1, JS_STRING_CONCAT(s2, s3));
-  static String _recipeJoin4(String s1, String s2, String s3, String s4) =>
-      JS_STRING_CONCAT(s1, JS_STRING_CONCAT(JS_STRING_CONCAT(s2, s3), s4));
-  static String _recipeJoin5(
-          String s1, String s2, String s3, String s4, String s5) =>
-      JS_STRING_CONCAT(s1,
-          JS_STRING_CONCAT(JS_STRING_CONCAT(JS_STRING_CONCAT(s2, s3), s4), s5));
-
-  // For each kind of Rti there are three methods:
-  //
-  // * `lookupXXX` which takes the component parts and returns an existing Rti
-  //   object if it exists.
-  // * `canonicalRecipeOfXXX` that returns the compositional canonical recipe
-  //   for the proposed type.
-  // * `createXXX` to create the type if it does not exist.
-  //
-  // The create method performs normalization before allocating a new Rti. Cache
-  // keys are not normalized, so if multiple recipes normalize to the same type,
-  // then their corresponding cache entries will point to the same value. This
-  // prevents us from having to normalize on every lookup instead of every
-  // allocation.
-
-  static String _canonicalRecipeOfErased() => Recipe.pushErasedString;
-  static String _canonicalRecipeOfDynamic() => Recipe.pushDynamicString;
-  static String _canonicalRecipeOfVoid() => Recipe.pushVoidString;
-  static String _canonicalRecipeOfNever() =>
-      _recipeJoin(Recipe.pushNeverExtensionString, Recipe.extensionOpString);
-  static String _canonicalRecipeOfAny() =>
-      _recipeJoin(Recipe.pushAnyExtensionString, Recipe.extensionOpString);
-
-  static String _canonicalRecipeOfStar(Rti baseType) =>
-      _recipeJoin(Rti._getCanonicalRecipe(baseType), Recipe.wrapStarString);
-  static String _canonicalRecipeOfQuestion(Rti baseType) =>
-      _recipeJoin(Rti._getCanonicalRecipe(baseType), Recipe.wrapQuestionString);
-  static String _canonicalRecipeOfFutureOr(Rti baseType) =>
-      _recipeJoin(Rti._getCanonicalRecipe(baseType), Recipe.wrapFutureOrString);
-
-  static String _canonicalRecipeOfGenericFunctionParameter(int index) =>
-      _recipeJoin('$index', Recipe.genericFunctionTypeParameterIndexString);
-
-  static Rti _lookupErasedRti(Object? universe) {
-    return _lookupTerminalRti(
-        universe, Rti.kindErased, _canonicalRecipeOfErased());
-  }
-
-  static Rti _lookupDynamicRti(Object? universe) {
-    return _lookupTerminalRti(
-        universe, Rti.kindDynamic, _canonicalRecipeOfDynamic());
-  }
-
-  static Rti _lookupVoidRti(Object? universe) {
-    return _lookupTerminalRti(universe, Rti.kindVoid, _canonicalRecipeOfVoid());
-  }
-
-  static Rti _lookupNeverRti(Object? universe) {
-    return _lookupTerminalRti(
-        universe, Rti.kindNever, _canonicalRecipeOfNever());
-  }
-
-  static Rti _lookupAnyRti(Object? universe) {
-    return _lookupTerminalRti(universe, Rti.kindAny, _canonicalRecipeOfAny());
-  }
-
-  static Rti _lookupTerminalRti(Object? universe, int kind, String key) {
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(universe, key, _createTerminalRti(universe, kind, key));
-  }
-
-  static Rti _createTerminalRti(Object? universe, int kind, String key) {
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, kind);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static Rti _lookupStarRti(Object? universe, Rti baseType, bool normalize) {
-    String key = _canonicalRecipeOfStar(baseType);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(
-        universe, key, _createStarRti(universe, baseType, key, normalize));
-  }
-
-  static Rti _createStarRti(
-      Object? universe, Rti baseType, String key, bool normalize) {
-    if (normalize) {
-      int baseKind = Rti._getKind(baseType);
-      if (isStrongTopType(baseType) ||
-          isNullType(baseType) ||
-          baseKind == Rti.kindQuestion ||
-          baseKind == Rti.kindStar) {
-        return baseType;
-      }
-    }
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindStar);
-    Rti._setPrimary(rti, baseType);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static Rti _lookupQuestionRti(
-      Object? universe, Rti baseType, bool normalize) {
-    String key = _canonicalRecipeOfQuestion(baseType);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(
-        universe, key, _createQuestionRti(universe, baseType, key, normalize));
-  }
-
-  static Rti _createQuestionRti(
-      Object? universe, Rti baseType, String key, bool normalize) {
-    if (normalize) {
-      int baseKind = Rti._getKind(baseType);
-      if (isStrongTopType(baseType) ||
-          isNullType(baseType) ||
-          baseKind == Rti.kindQuestion ||
-          baseKind == Rti.kindFutureOr &&
-              isNullable(Rti._getFutureOrArgument(baseType))) {
-        return baseType;
-      } else if (baseKind == Rti.kindNever ||
-          _Utils.isIdentical(baseType, LEGACY_TYPE_REF<Never>())) {
-        return TYPE_REF<Null>();
-      } else if (baseKind == Rti.kindStar) {
-        Rti starArgument = Rti._getStarArgument(baseType);
-        int starArgumentKind = Rti._getKind(starArgument);
-        if (starArgumentKind == Rti.kindFutureOr &&
-            isNullable(Rti._getFutureOrArgument(starArgument))) {
-          return starArgument;
-        } else {
-          return Rti._getQuestionFromStar(universe, baseType);
-        }
-      }
-    }
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindQuestion);
-    Rti._setPrimary(rti, baseType);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static Rti _lookupFutureOrRti(
-      Object? universe, Rti baseType, bool normalize) {
-    String key = _canonicalRecipeOfFutureOr(baseType);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(
-        universe, key, _createFutureOrRti(universe, baseType, key, normalize));
-  }
-
-  static Rti _createFutureOrRti(
-      Object? universe, Rti baseType, String key, bool normalize) {
-    if (normalize) {
-      int baseKind = Rti._getKind(baseType);
-      if (isTopType(baseType) || isObjectType(baseType)) {
-        return baseType;
-      } else if (baseKind == Rti.kindNever) {
-        return _lookupFutureRti(universe, baseType);
-      } else if (isNullType(baseType)) {
-        return JS_GET_FLAG('NNBD')
-            ? TYPE_REF<Future<Null>?>()
-            : TYPE_REF<Future<Null>>();
-      }
-    }
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindFutureOr);
-    Rti._setPrimary(rti, baseType);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static Rti _lookupGenericFunctionParameterRti(Object? universe, int index) {
-    String key = _canonicalRecipeOfGenericFunctionParameter(index);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(universe, key,
-        _createGenericFunctionParameterRti(universe, index, key));
-  }
-
-  static Rti _createGenericFunctionParameterRti(
-      Object? universe, int index, String key) {
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindGenericFunctionParameter);
-    Rti._setPrimary(rti, index);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static String _canonicalRecipeJoin(Object? arguments) {
-    String s = '', sep = '';
-    int length = _Utils.arrayLength(arguments);
-    for (int i = 0; i < length; i++) {
-      Rti argument = _Utils.asRti(_Utils.arrayAt(arguments, i));
-      String subrecipe = Rti._getCanonicalRecipe(argument);
-      s = _recipeJoin3(s, sep, subrecipe);
-      sep = Recipe.separatorString;
-    }
-    return s;
-  }
-
-  static String _canonicalRecipeJoinNamed(Object? arguments) {
-    String s = '', sep = '';
-    int length = _Utils.arrayLength(arguments);
-    assert(_Utils.isMultipleOf(length, 3));
-    for (int i = 0; i < length; i += 3) {
-      String name = _Utils.asString(_Utils.arrayAt(arguments, i));
-      bool isRequired = _Utils.asBool(_Utils.arrayAt(arguments, i + 1));
-      String nameSep = isRequired
-          ? Recipe.requiredNameSeparatorString
-          : Recipe.nameSeparatorString;
-      Rti type = _Utils.asRti(_Utils.arrayAt(arguments, i + 2));
-      String subrecipe = Rti._getCanonicalRecipe(type);
-      s = _recipeJoin5(s, sep, name, nameSep, subrecipe);
-      sep = Recipe.separatorString;
-    }
-    return s;
-  }
-
-  static String _canonicalRecipeOfInterface(String name, Object? arguments) {
-    assert(_Utils.isString(name));
-    String s = _Utils.asString(name);
-    int length = _Utils.arrayLength(arguments);
-    if (length != 0) {
-      s = _recipeJoin4(s, Recipe.startTypeArgumentsString,
-          _canonicalRecipeJoin(arguments), Recipe.endTypeArgumentsString);
-    }
-    return s;
-  }
-
-  static Rti _lookupInterfaceRti(
-      Object? universe, String name, Object? arguments) {
-    String key = _canonicalRecipeOfInterface(name, arguments);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(
-        universe, key, _createInterfaceRti(universe, name, arguments, key));
-  }
-
-  static Rti _createInterfaceRti(
-      Object? universe, String name, Object? typeArguments, String key) {
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindInterface);
-    Rti._setPrimary(rti, name);
-    Rti._setRest(rti, typeArguments);
-    int length = _Utils.arrayLength(typeArguments);
-    if (length > 0) {
-      Rti._setPrecomputed1(rti, _Utils.arrayAt(typeArguments, 0));
-    }
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static Rti _lookupFutureRti(Object? universe, Rti base) =>
-      _lookupInterfaceRti(universe,
-          JS_GET_NAME(JsGetName.FUTURE_CLASS_TYPE_NAME), JS('', '[#]', base));
-
-  static String _canonicalRecipeOfBinding(Rti base, Object? arguments) {
-    return _recipeJoin5(
-        Rti._getCanonicalRecipe(base),
-        // TODO(sra): Omit when base encoding is Rti without ToType:
-        Recipe.toTypeString,
-        Recipe.startTypeArgumentsString,
-        _canonicalRecipeJoin(arguments),
-        Recipe.endTypeArgumentsString);
-  }
-
-  /// [arguments] becomes owned by the created Rti.
-  static Rti _lookupBindingRti(Object? universe, Rti base, Object? arguments) {
-    Rti newBase = base;
-    var newArguments = arguments;
-    if (Rti._getKind(base) == Rti.kindBinding) {
-      newBase = Rti._getBindingBase(base);
-      newArguments =
-          _Utils.arrayConcat(Rti._getBindingArguments(base), arguments);
-    }
-    String key = _canonicalRecipeOfBinding(newBase, newArguments);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(
-        universe, key, _createBindingRti(universe, newBase, newArguments, key));
-  }
-
-  static Rti _createBindingRti(
-      Object? universe, Rti base, Object? arguments, String key) {
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindBinding);
-    Rti._setPrimary(rti, base);
-    Rti._setRest(rti, arguments);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static String _canonicalRecipeOfFunction(
-          Rti returnType, _FunctionParameters parameters) =>
-      _recipeJoin(Rti._getCanonicalRecipe(returnType),
-          _canonicalRecipeOfFunctionParameters(parameters));
-
-  static String _canonicalRecipeOfFunctionParameters(
-      _FunctionParameters parameters) {
-    var requiredPositional =
-        _FunctionParameters._getRequiredPositional(parameters);
-    int requiredPositionalLength = _Utils.arrayLength(requiredPositional);
-    var optionalPositional =
-        _FunctionParameters._getOptionalPositional(parameters);
-    int optionalPositionalLength = _Utils.arrayLength(optionalPositional);
-    var named = _FunctionParameters._getNamed(parameters);
-    int namedLength = _Utils.arrayLength(named);
-    assert(optionalPositionalLength == 0 || namedLength == 0);
-
-    String recipe = _recipeJoin(Recipe.startFunctionArgumentsString,
-        _canonicalRecipeJoin(requiredPositional));
-
-    if (optionalPositionalLength > 0) {
-      String sep = requiredPositionalLength > 0 ? Recipe.separatorString : '';
-      recipe = _recipeJoin5(
-          recipe,
-          sep,
-          Recipe.startOptionalGroupString,
-          _canonicalRecipeJoin(optionalPositional),
-          Recipe.endOptionalGroupString);
-    }
-
-    if (namedLength > 0) {
-      String sep = requiredPositionalLength > 0 ? Recipe.separatorString : '';
-      recipe = _recipeJoin5(recipe, sep, Recipe.startNamedGroupString,
-          _canonicalRecipeJoinNamed(named), Recipe.endNamedGroupString);
-    }
-
-    return _recipeJoin(recipe, Recipe.endFunctionArgumentsString);
-  }
-
-  static Rti _lookupFunctionRti(
-      Object? universe, Rti returnType, _FunctionParameters parameters) {
-    String key = _canonicalRecipeOfFunction(returnType, parameters);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(universe, key,
-        _createFunctionRti(universe, returnType, parameters, key));
-  }
-
-  static Rti _createFunctionRti(Object? universe, Rti returnType,
-      _FunctionParameters parameters, String key) {
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindFunction);
-    Rti._setPrimary(rti, returnType);
-    Rti._setRest(rti, parameters);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-
-  static String _canonicalRecipeOfGenericFunction(
-          Rti baseFunctionType, Object? bounds) =>
-      _recipeJoin4(
-          Rti._getCanonicalRecipe(baseFunctionType),
-          Recipe.startTypeArgumentsString,
-          _canonicalRecipeJoin(bounds),
-          Recipe.endTypeArgumentsString);
-
-  static Rti _lookupGenericFunctionRti(
-      Object? universe, Rti baseFunctionType, Object? bounds, bool normalize) {
-    String key = _canonicalRecipeOfGenericFunction(baseFunctionType, bounds);
-    var cache = evalCache(universe);
-    var probe = _Utils.mapGet(cache, key);
-    if (probe != null) return _Utils.asRti(probe);
-    return _installRti(
-        universe,
-        key,
-        _createGenericFunctionRti(
-            universe, baseFunctionType, bounds, key, normalize));
-  }
-
-  static Rti _createGenericFunctionRti(Object? universe, Rti baseFunctionType,
-      Object? bounds, String key, bool normalize) {
-    if (normalize) {
-      int length = _Utils.arrayLength(bounds);
-      int count = 0;
-      Object? typeArguments = JS('', 'new Array(#)', length);
-      for (int i = 0; i < length; i++) {
-        Rti bound = _Utils.asRti(_Utils.arrayAt(bounds, i));
-        if (Rti._getKind(bound) == Rti.kindNever) {
-          _Utils.arraySetAt(typeArguments, i, bound);
-          count++;
-        }
-      }
-      if (count > 0) {
-        var substitutedBase =
-            _substitute(universe, baseFunctionType, typeArguments, 0);
-        var substitutedBounds =
-            _substituteArray(universe, bounds, typeArguments, 0);
-        return _lookupGenericFunctionRti(
-            universe,
-            substitutedBase,
-            substitutedBounds,
-            _Utils.isNotIdentical(bounds, substitutedBounds));
-      }
-    }
-    Rti rti = Rti.allocate();
-    Rti._setKind(rti, Rti.kindGenericFunction);
-    Rti._setPrimary(rti, baseFunctionType);
-    Rti._setRest(rti, bounds);
-    Rti._setCanonicalRecipe(rti, key);
-    return _installTypeTests(universe, rti);
-  }
-}
-
-/// Class of static methods implementing recipe parser.
-///
-/// The recipe is a sequence of operations on a stack machine. The operations
-/// are described below using the format
-///
-///      operation: stack elements before --- stack elements after
-///
-/// integer:  --- integer-value
-///
-/// identifier:  --- string-value
-///
-/// identifier-with-one-period:  --- type-variable-value
-///
-///   Period may be in any position, including first and last e.g. `.x`.
-///
-/// ',':  ---
-///
-///   Ignored. Used to separate elements.
-///
-/// ';': item  ---  ToType(item)
-///
-///   Used to separate elements.
-///
-/// '#': --- erasedType
-///
-/// '@': --- dynamicType
-///
-/// '~': --- voidType
-///
-/// '?':  type  ---  type?
-///
-/// '&':  0  ---  NeverType
-/// '&':  1  ---  anyType
-///
-///   Escape op-code with small integer values for encoding rare operations.
-///
-/// '<':  --- position
-///
-///   Saves (pushes) position register, sets position register to end of stack.
-///
-/// '>':  name saved-position type ... type  ---  name<type, ..., type>
-/// '>':  type saved-position type ... type  ---  binding(type, type, ..., type)
-///
-///   When first element is a String: Creates interface type from string 'name'
-///   and the types pushed since the position register was last set. The types
-///   are converted with a ToType operation. Restores position register to
-///   previous saved value.
-///
-///   When first element is an Rti: Creates binding Rti wrapping the first
-///   element. Binding Rtis are flattened: if the first element is a binding
-///   Rti, the new binding Rti has the concatentation of the first element
-///   bindings and new type.
-///
-///
-/// The ToType operation coerces an item to an Rti. This saves encoding looking
-/// up simple interface names and indexed variables.
-///
-///   ToType(string): Creates an interface Rti for the non-generic class.
-///   ToType(integer): Indexes into the environment.
-///   ToType(Rti): Same Rti
-///
-///
-/// Notes on enviroments and indexing.
-///
-/// To avoid creating a binding Rti for a single function type parameter, the
-/// type is passed without creating a 1-tuple object. This means that the
-/// interface Rti for, say, `Map<num,dynamic>` serves as two environments with
-/// different shapes. It is a class environment (K=num, V=dynamic) and a simple
-/// 1-tuple environment. This is supported by index '0' refering to the whole
-/// type, and '1 and '2' refering to K and V positionally:
-///
-///     interface("Map", [num,dynamic])
-///     0                 1   2
-///
-/// Thus the type expression `List<K>` encodes as `List<1>` and in this
-/// environment evaluates to `List<num>`. `List<Map<K,V>>` could be encoded as
-/// either `List<0>` or `List<Map<1,2>>` (and in this environment evaluates to
-/// `List<Map<num,dynamic>>`).
-///
-/// When `Map<num,dynamic>` is combined with a binding `<int,bool>` (e.g. inside
-/// the instance method `Map<K,V>.cast<RK,RV>()`), '0' refers to the base object
-/// of the binding, and then the numbering counts the bindings followed by the
-/// class parameters.
-///
-///     binding(interface("Map", [num,dynamic]), [int, bool])
-///             0                 3   4           1    2
-///
-/// Any environment can be reconstructed via a recipe. The above enviroment for
-/// method `cast` can be constructed as the ground term
-/// `Map<num,dynamic><int,bool>`, or (somewhat pointlessly) reconstructed via
-/// `0<1,2>` or `Map<3,4><1,2>`. The ability to construct an environment
-/// directly rather than via `bind` calls is used in folding sequences of `eval`
-/// and `bind` calls.
-///
-/// While a single type parameter is passed as the type, multiple type
-/// parameters are passed as a tuple. Tuples are encoded as a binding with an
-/// ignored base. `dynamic` can be used as the base, giving an encoding like
-/// `@<int,bool>`.
-///
-/// Bindings flatten, so `@<int><bool><num>` is the same as `@<int,bool,num>`.
-///
-/// The base of a binding does not have to have type parameters. Consider
-/// `CodeUnits`, which mixes in `ListMixin<int>`. The environment inside of
-/// `ListMixin.fold` (from the call `x.codeUnits.fold<bool>(...)`) would be
-///
-///     binding(interface("CodeUnits", []), [bool])
-///
-/// This can be encoded as `CodeUnits;<bool>` (note the `;` to force ToType to
-/// avoid creating an interface type Rti with a single class type
-/// argument). Metadata about the supertypes is used to resolve the recipe
-/// `ListMixin.E` to `int`.
-
-class _Parser {
-  _Parser._() {
-    throw UnimplementedError('_Parser is static methods only');
-  }
-
-  /// Creates a parser object for parsing a recipe against an environment in a
-  /// universe.
-  ///
-  /// Marked as no-inline so the object literal is not cloned by inlining.
-  @pragma('dart2js:noInline')
-  static Object create(
-      Object? universe, Object? environment, String recipe, bool normalize) {
-    return JS(
-        '',
-        '{'
-            'u:#,' // universe
-            'e:#,' // environment
-            'r:#,' // recipe
-            's:[],' // stack
-            'p:0,' // position of sequence start
-            'n:#,' // whether to normalize
-            '}',
-        universe,
-        environment,
-        recipe,
-        normalize);
-  }
-
-  // Field accessors for the parser.
-  static Object universe(Object? parser) => JS('', '#.u', parser);
-  static Rti environment(Object? parser) => JS('Rti', '#.e', parser);
-  static String recipe(Object? parser) => JS('String', '#.r', parser);
-  static Object stack(Object? parser) => JS('', '#.s', parser);
-  static int position(Object? parser) => JS('int', '#.p', parser);
-  static void setPosition(Object? parser, int p) {
-    JS('', '#.p = #', parser, p);
-  }
-
-  static bool normalize(Object? parser) => JS('bool', '#.n', parser);
-
-  static int charCodeAt(String s, int i) => JS('int', '#.charCodeAt(#)', s, i);
-  static void push(Object? stack, Object? value) {
-    JS('', '#.push(#)', stack, value);
-  }
-
-  static Object? pop(Object? stack) => JS('', '#.pop()', stack);
-
-  static Rti parse(Object? parser) {
-    String source = _Parser.recipe(parser);
-    var stack = _Parser.stack(parser);
-    int i = 0;
-    while (i < source.length) {
-      int ch = charCodeAt(source, i);
-      if (Recipe.isDigit(ch)) {
-        i = handleDigit(i + 1, ch, source, stack);
-      } else if (Recipe.isIdentifierStart(ch)) {
-        i = handleIdentifier(parser, i, source, stack, false);
-      } else if (ch == Recipe.period) {
-        i = handleIdentifier(parser, i, source, stack, true);
-      } else {
-        i++;
-        switch (ch) {
-          case Recipe.separator:
-            break;
-
-          case Recipe.nameSeparator:
-            push(stack, false);
-            break;
-
-          case Recipe.requiredNameSeparator:
-            push(stack, true);
-            break;
-
-          case Recipe.toType:
-            push(stack,
-                toType(universe(parser), environment(parser), pop(stack)));
-            break;
-
-          case Recipe.genericFunctionTypeParameterIndex:
-            push(stack,
-                toGenericFunctionParameter(universe(parser), pop(stack)));
-            break;
-
-          case Recipe.pushErased:
-            push(stack, _Universe._lookupErasedRti(universe(parser)));
-            break;
-
-          case Recipe.pushDynamic:
-            push(stack, _Universe._lookupDynamicRti(universe(parser)));
-            break;
-
-          case Recipe.pushVoid:
-            push(stack, _Universe._lookupVoidRti(universe(parser)));
-            break;
-
-          case Recipe.startTypeArguments:
-            pushStackFrame(parser, stack);
-            break;
-
-          case Recipe.endTypeArguments:
-            handleTypeArguments(parser, stack);
-            break;
-
-          case Recipe.extensionOp:
-            handleExtendedOperations(parser, stack);
-            break;
-
-          case Recipe.wrapStar:
-            var u = universe(parser);
-            push(
-                stack,
-                _Universe._lookupStarRti(
-                    u,
-                    toType(u, environment(parser), pop(stack)),
-                    normalize(parser)));
-            break;
-
-          case Recipe.wrapQuestion:
-            var u = universe(parser);
-            push(
-                stack,
-                _Universe._lookupQuestionRti(
-                    u,
-                    toType(u, environment(parser), pop(stack)),
-                    normalize(parser)));
-            break;
-
-          case Recipe.wrapFutureOr:
-            var u = universe(parser);
-            push(
-                stack,
-                _Universe._lookupFutureOrRti(
-                    u,
-                    toType(u, environment(parser), pop(stack)),
-                    normalize(parser)));
-            break;
-
-          case Recipe.startFunctionArguments:
-            pushStackFrame(parser, stack);
-            break;
-
-          case Recipe.endFunctionArguments:
-            handleFunctionArguments(parser, stack);
-            break;
-
-          case Recipe.startOptionalGroup:
-            pushStackFrame(parser, stack);
-            break;
-
-          case Recipe.endOptionalGroup:
-            handleOptionalGroup(parser, stack);
-            break;
-
-          case Recipe.startNamedGroup:
-            pushStackFrame(parser, stack);
-            break;
-
-          case Recipe.endNamedGroup:
-            handleNamedGroup(parser, stack);
-            break;
-
-          default:
-            JS('', 'throw "Bad character " + #', ch);
-        }
-      }
-    }
-    var item = pop(stack);
-    return toType(universe(parser), environment(parser), item);
-  }
-
-  static void pushStackFrame(Object? parser, Object? stack) {
-    push(stack, position(parser));
-    setPosition(parser, _Utils.arrayLength(stack));
-  }
-
-  static int handleDigit(int i, int digit, String source, Object? stack) {
-    int value = Recipe.digitValue(digit);
-    for (; i < source.length; i++) {
-      int ch = charCodeAt(source, i);
-      if (!Recipe.isDigit(ch)) break;
-      value = value * 10 + Recipe.digitValue(ch);
-    }
-    push(stack, value);
-    return i;
-  }
-
-  static int handleIdentifier(
-      Object? parser, int start, String source, Object? stack, bool hasPeriod) {
-    int i = start + 1;
-    for (; i < source.length; i++) {
-      int ch = charCodeAt(source, i);
-      if (ch == Recipe.period) {
-        if (hasPeriod) break;
-        hasPeriod = true;
-      } else if (Recipe.isIdentifierStart(ch) || Recipe.isDigit(ch)) {
-        // Accept.
-      } else {
-        break;
-      }
-    }
-    String string = _Utils.substring(source, start, i);
-    if (hasPeriod) {
-      push(
-          stack,
-          _Universe.evalTypeVariable(
-              universe(parser), environment(parser), string));
-    } else {
-      push(stack, string);
-    }
-    return i;
-  }
-
-  static void handleTypeArguments(Object? parser, Object? stack) {
-    var universe = _Parser.universe(parser);
-    var arguments = collectArray(parser, stack);
-    var head = pop(stack);
-    if (_Utils.isString(head)) {
-      String name = _Utils.asString(head);
-      push(stack, _Universe._lookupInterfaceRti(universe, name, arguments));
-    } else {
-      Rti base = toType(universe, environment(parser), head);
-      switch (Rti._getKind(base)) {
-        case Rti.kindFunction:
-          push(
-              stack,
-              _Universe._lookupGenericFunctionRti(
-                  universe, base, arguments, normalize(parser)));
-          break;
-
-        default:
-          push(stack, _Universe._lookupBindingRti(universe, base, arguments));
-          break;
-      }
-    }
-  }
-
-  static const int optionalPositionalSentinel = -1;
-  static const int namedSentinel = -2;
-
-  static void handleFunctionArguments(Object? parser, Object? stack) {
-    var universe = _Parser.universe(parser);
-    _FunctionParameters parameters = _FunctionParameters.allocate();
-    Object? optionalPositional = _Universe.sharedEmptyArray(universe);
-    Object? named = _Universe.sharedEmptyArray(universe);
-
-    var head = pop(stack);
-    if (_Utils.isNum(head)) {
-      int sentinel = _Utils.asInt(head);
-      switch (sentinel) {
-        case optionalPositionalSentinel:
-          optionalPositional = pop(stack);
-          break;
-
-        case namedSentinel:
-          named = pop(stack);
-          break;
-
-        default:
-          push(stack, head);
-          break;
-      }
-    } else {
-      push(stack, head);
-    }
-
-    _FunctionParameters._setRequiredPositional(
-        parameters, collectArray(parser, stack));
-    _FunctionParameters._setOptionalPositional(parameters, optionalPositional);
-    _FunctionParameters._setNamed(parameters, named);
-    Rti returnType = toType(universe, environment(parser), pop(stack));
-    push(stack, _Universe._lookupFunctionRti(universe, returnType, parameters));
-  }
-
-  static void handleOptionalGroup(Object? parser, Object? stack) {
-    var parameters = collectArray(parser, stack);
-    push(stack, parameters);
-    push(stack, optionalPositionalSentinel);
-  }
-
-  static void handleNamedGroup(Object? parser, Object? stack) {
-    var parameters = collectNamed(parser, stack);
-    push(stack, parameters);
-    push(stack, namedSentinel);
-  }
-
-  static void handleExtendedOperations(Object? parser, Object? stack) {
-    var top = pop(stack);
-    if (0 == top) {
-      push(stack, _Universe._lookupNeverRti(universe(parser)));
-      return;
-    }
-    if (1 == top) {
-      push(stack, _Universe._lookupAnyRti(universe(parser)));
-      return;
-    }
-    throw AssertionError('Unexpected extended operation $top');
-  }
-
-  static JSArray collectArray(Object? parser, Object? stack) {
-    var array = _Utils.arraySplice(stack, position(parser));
-    toTypes(_Parser.universe(parser), environment(parser), array);
-    setPosition(parser, _Utils.asInt(pop(stack)));
-    return array;
-  }
-
-  static JSArray collectNamed(Object? parser, Object? stack) {
-    var array = _Utils.arraySplice(stack, position(parser));
-    toTypesNamed(_Parser.universe(parser), environment(parser), array);
-    setPosition(parser, _Utils.asInt(pop(stack)));
-    return array;
-  }
-
-  /// Coerce a stack item into an Rti object. Strings are converted to interface
-  /// types, integers are looked up in the type environment.
-  static Rti toType(Object? universe, Rti environment, Object? item) {
-    if (_Utils.isString(item)) {
-      String name = _Utils.asString(item);
-      return _Universe._lookupInterfaceRti(
-          universe, name, _Universe.sharedEmptyArray(universe));
-    } else if (_Utils.isNum(item)) {
-      return _Parser.indexToType(universe, environment, _Utils.asInt(item));
-    } else {
-      return _Utils.asRti(item);
-    }
-  }
-
-  static void toTypes(Object? universe, Rti environment, Object? items) {
-    int length = _Utils.arrayLength(items);
-    for (int i = 0; i < length; i++) {
-      var item = _Utils.arrayAt(items, i);
-      Rti type = toType(universe, environment, item);
-      _Utils.arraySetAt(items, i, type);
-    }
-  }
-
-  static void toTypesNamed(Object? universe, Rti environment, Object? items) {
-    int length = _Utils.arrayLength(items);
-    assert(_Utils.isMultipleOf(length, 3));
-    for (int i = 2; i < length; i += 3) {
-      var item = _Utils.arrayAt(items, i);
-      Rti type = toType(universe, environment, item);
-      _Utils.arraySetAt(items, i, type);
-    }
-  }
-
-  static Rti indexToType(Object? universe, Rti environment, int index) {
-    int kind = Rti._getKind(environment);
-    if (kind == Rti.kindBinding) {
-      if (index == 0) return Rti._getBindingBase(environment);
-      var typeArguments = Rti._getBindingArguments(environment);
-      int len = _Utils.arrayLength(typeArguments);
-      if (index <= len) {
-        return _Utils.asRti(_Utils.arrayAt(typeArguments, index - 1));
-      }
-      // Is index into interface Rti in base.
-      index -= len;
-      environment = Rti._getBindingBase(environment);
-      kind = Rti._getKind(environment);
-    } else {
-      if (index == 0) return environment;
-    }
-    if (kind != Rti.kindInterface) {
-      throw AssertionError('Indexed base must be an interface type');
-    }
-    var typeArguments = Rti._getInterfaceTypeArguments(environment);
-    int len = _Utils.arrayLength(typeArguments);
-    if (index <= len) {
-      return _Utils.asRti(_Utils.arrayAt(typeArguments, index - 1));
-    }
-    throw AssertionError('Bad index $index for $environment');
-  }
-
-  static Rti toGenericFunctionParameter(Object? universe, Object? item) {
-    assert(_Utils.isNum(item));
-    return _Universe._lookupGenericFunctionParameterRti(
-        universe, _Utils.asInt(item));
-  }
-}
-
-/// Represents the set of supertypes and type variable bindings for a given
-/// target type. The target type itself is not stored on the [TypeRule].
-class TypeRule {
-  TypeRule._() {
-    throw UnimplementedError("TypeRule is static methods only.");
-  }
-
-  static String? lookupTypeVariable(Object? rule, String typeVariable) =>
-      JS('', '#.#', rule, typeVariable);
-
-  static JSArray? lookupSupertype(Object? rule, String supertype) =>
-      JS('', '#.#', rule, supertype);
-}
-
-// This needs to be kept in sync with `Variance` in `entities.dart`.
-class Variance {
-  // TODO(fishythefish): Try bitmask representation.
-  static const int legacyCovariant = 0;
-  static const int covariant = 1;
-  static const int contravariant = 2;
-  static const int invariant = 3;
-}
-
-// -------- Subtype tests ------------------------------------------------------
-
-// Future entry point from compiled code.
-bool isSubtype(Object? universe, Rti s, Rti t) {
-  return _isSubtype(universe, s, null, t, null);
-}
-
-/// Based on
-/// https://github.com/dart-lang/language/blob/master/resources/type-system/subtyping.md#rules
-/// and https://github.com/dart-lang/language/pull/388.
-/// In particular, the bulk of the structure is derived from the former
-/// resource, with a few adaptations taken from the latter.
-/// - We freely skip subcases which would have already been handled by a
-/// previous case.
-/// - Some rules are reordered in conjunction with the previous point to reduce
-/// the amount of casework.
-/// - Left Type Variable Bound in particular is split into two pieces: an
-/// optimistic check performed early in the algorithm to reduce the number of
-/// backtracking cases when a union appears on the right, and a pessimistic
-/// check performed at the usual place in order to completely eliminate the
-/// case.
-/// - Function type rules are applied before interface type rules.
-///
-/// [s] is considered a legacy subtype of [t] if [s] would be a subtype of [t]
-/// in a modification of the NNBD rules in which `?` on types were ignored, `*`
-/// were added to each time, and `required` parameters were treated as
-/// optional. In effect, `Never` is equivalent to `Null`, `Null` is restored to
-/// the bottom of the type hierarchy, `Object` is treated as nullable, and
-/// `required` is ignored on named parameters. This should provide the same
-/// subtyping results as pre-NNBD Dart.
-bool _isSubtype(Object? universe, Rti s, Object? sEnv, Rti t, Object? tEnv) {
-  bool isLegacy = JS_GET_FLAG('LEGACY');
-
-  // Reflexivity:
-  if (_Utils.isIdentical(s, t)) return true;
-
-  // Right Top:
-  if (isTopType(t)) return true;
-
-  int sKind = Rti._getKind(s);
-  if (sKind == Rti.kindAny) return true;
-
-  // Left Top:
-  if (isStrongTopType(s)) return false;
-
-  // Left Bottom:
-  if (isBottomType(s)) return true;
-
-  // Left Type Variable Bound 1:
-  bool leftTypeVariable = sKind == Rti.kindGenericFunctionParameter;
-  if (leftTypeVariable) {
-    int index = Rti._getGenericFunctionParameterIndex(s);
-    Rti bound = _Utils.asRti(_Utils.arrayAt(sEnv, index));
-    if (_isSubtype(universe, bound, sEnv, t, tEnv)) return true;
-  }
-
-  int tKind = Rti._getKind(t);
-
-  // Left Null:
-  // Note: Interchanging the Left Null and Right Object rules allows us to
-  // reduce casework.
-  if (!isLegacy && isNullType(s)) {
-    if (tKind == Rti.kindFutureOr) {
-      return _isSubtype(universe, s, sEnv, Rti._getFutureOrArgument(t), tEnv);
-    }
-    return isNullType(t) || tKind == Rti.kindQuestion || tKind == Rti.kindStar;
-  }
-
-  // Right Object:
-  if (!isLegacy && isObjectType(t)) {
-    if (sKind == Rti.kindFutureOr) {
-      return _isSubtype(universe, Rti._getFutureOrArgument(s), sEnv, t, tEnv);
-    }
-    if (sKind == Rti.kindStar) {
-      return _isSubtype(universe, Rti._getStarArgument(s), sEnv, t, tEnv);
-    }
-    return sKind != Rti.kindQuestion;
-  }
-
-  // Left Legacy:
-  if (sKind == Rti.kindStar) {
-    return _isSubtype(universe, Rti._getStarArgument(s), sEnv, t, tEnv);
-  }
-
-  // Right Legacy:
-  if (tKind == Rti.kindStar) {
-    return _isSubtype(
-        universe,
-        s,
-        sEnv,
-        isLegacy
-            ? Rti._getStarArgument(t)
-            : Rti._getQuestionFromStar(universe, t),
-        tEnv);
-  }
-
-  // Left FutureOr:
-  if (sKind == Rti.kindFutureOr) {
-    if (!_isSubtype(universe, Rti._getFutureOrArgument(s), sEnv, t, tEnv)) {
-      return false;
-    }
-    return _isSubtype(
-        universe, Rti._getFutureFromFutureOr(universe, s), sEnv, t, tEnv);
-  }
-
-  // Left Nullable:
-  if (sKind == Rti.kindQuestion) {
-    return (isLegacy ||
-            _isSubtype(universe, TYPE_REF<Null>(), sEnv, t, tEnv)) &&
-        _isSubtype(universe, Rti._getQuestionArgument(s), sEnv, t, tEnv);
-  }
-
-  // Type Variable Reflexivity 1 is subsumed by Reflexivity and therefore
-  // elided.
-  // Type Variable Reflexivity 2 does not apply at runtime.
-  // Right Promoted Variable does not apply at runtime.
-
-  // Right FutureOr:
-  if (tKind == Rti.kindFutureOr) {
-    if (_isSubtype(universe, s, sEnv, Rti._getFutureOrArgument(t), tEnv)) {
-      return true;
-    }
-    return _isSubtype(
-        universe, s, sEnv, Rti._getFutureFromFutureOr(universe, t), tEnv);
-  }
-
-  // Right Nullable:
-  if (tKind == Rti.kindQuestion) {
-    return (!isLegacy &&
-            _isSubtype(universe, s, sEnv, TYPE_REF<Null>(), tEnv)) ||
-        _isSubtype(universe, s, sEnv, Rti._getQuestionArgument(t), tEnv);
-  }
-
-  // Left Promoted Variable does not apply at runtime.
-
-  // Left Type Variable Bound 2:
-  if (leftTypeVariable) return false;
-
-  // Function Type/Function:
-  if ((sKind == Rti.kindFunction || sKind == Rti.kindGenericFunction) &&
-      isFunctionType(t)) {
-    return true;
-  }
-
-  // Positional Function Types + Named Function Types:
-  // TODO(fishythefish): Disallow JavaScriptFunction as a subtype of function
-  // types using features inaccessible from JavaScript.
-  if (tKind == Rti.kindGenericFunction) {
-    if (isJsFunctionType(s)) return true;
-    if (sKind != Rti.kindGenericFunction) return false;
-
-    var sBounds = Rti._getGenericFunctionBounds(s);
-    var tBounds = Rti._getGenericFunctionBounds(t);
-    int sLength = _Utils.arrayLength(sBounds);
-    int tLength = _Utils.arrayLength(tBounds);
-    if (sLength != tLength) return false;
-
-    sEnv = sEnv == null ? sBounds : _Utils.arrayConcat(sBounds, sEnv);
-    tEnv = tEnv == null ? tBounds : _Utils.arrayConcat(tBounds, tEnv);
-
-    for (int i = 0; i < sLength; i++) {
-      var sBound = _Utils.asRti(_Utils.arrayAt(sBounds, i));
-      var tBound = _Utils.asRti(_Utils.arrayAt(tBounds, i));
-      if (!_isSubtype(universe, sBound, sEnv, tBound, tEnv) ||
-          !_isSubtype(universe, tBound, tEnv, sBound, sEnv)) {
-        return false;
-      }
-    }
-
-    return _isFunctionSubtype(universe, Rti._getGenericFunctionBase(s), sEnv,
-        Rti._getGenericFunctionBase(t), tEnv);
-  }
-  if (tKind == Rti.kindFunction) {
-    if (isJsFunctionType(s)) return true;
-    if (sKind != Rti.kindFunction) return false;
-    return _isFunctionSubtype(universe, s, sEnv, t, tEnv);
-  }
-
-  // Interface Compositionality + Super-Interface:
-  if (sKind == Rti.kindInterface) {
-    if (tKind != Rti.kindInterface) return false;
-    return _isInterfaceSubtype(universe, s, sEnv, t, tEnv);
-  }
-
-  return false;
-}
-
-bool _isFunctionSubtype(
-    Object? universe, Rti s, Object? sEnv, Rti t, Object? tEnv) {
-  assert(Rti._getKind(s) == Rti.kindFunction);
-  assert(Rti._getKind(t) == Rti.kindFunction);
-
-  Rti sReturnType = Rti._getReturnType(s);
-  Rti tReturnType = Rti._getReturnType(t);
-  if (!_isSubtype(universe, sReturnType, sEnv, tReturnType, tEnv)) {
-    return false;
-  }
-
-  _FunctionParameters sParameters = Rti._getFunctionParameters(s);
-  _FunctionParameters tParameters = Rti._getFunctionParameters(t);
-
-  var sRequiredPositional =
-      _FunctionParameters._getRequiredPositional(sParameters);
-  var tRequiredPositional =
-      _FunctionParameters._getRequiredPositional(tParameters);
-  int sRequiredPositionalLength = _Utils.arrayLength(sRequiredPositional);
-  int tRequiredPositionalLength = _Utils.arrayLength(tRequiredPositional);
-  if (sRequiredPositionalLength > tRequiredPositionalLength) return false;
-  int requiredPositionalDelta =
-      tRequiredPositionalLength - sRequiredPositionalLength;
-
-  var sOptionalPositional =
-      _FunctionParameters._getOptionalPositional(sParameters);
-  var tOptionalPositional =
-      _FunctionParameters._getOptionalPositional(tParameters);
-  int sOptionalPositionalLength = _Utils.arrayLength(sOptionalPositional);
-  int tOptionalPositionalLength = _Utils.arrayLength(tOptionalPositional);
-  if (sRequiredPositionalLength + sOptionalPositionalLength <
-      tRequiredPositionalLength + tOptionalPositionalLength) return false;
-
-  for (int i = 0; i < sRequiredPositionalLength; i++) {
-    Rti sParameter = _Utils.asRti(_Utils.arrayAt(sRequiredPositional, i));
-    Rti tParameter = _Utils.asRti(_Utils.arrayAt(tRequiredPositional, i));
-    if (!_isSubtype(universe, tParameter, tEnv, sParameter, sEnv)) {
-      return false;
-    }
-  }
-
-  for (int i = 0; i < requiredPositionalDelta; i++) {
-    Rti sParameter = _Utils.asRti(_Utils.arrayAt(sOptionalPositional, i));
-    Rti tParameter = _Utils.asRti(
-        _Utils.arrayAt(tRequiredPositional, sRequiredPositionalLength + i));
-    if (!_isSubtype(universe, tParameter, tEnv, sParameter, sEnv)) {
-      return false;
-    }
-  }
-
-  for (int i = 0; i < tOptionalPositionalLength; i++) {
-    Rti sParameter = _Utils.asRti(
-        _Utils.arrayAt(sOptionalPositional, requiredPositionalDelta + i));
-    Rti tParameter = _Utils.asRti(_Utils.arrayAt(tOptionalPositional, i));
-    if (!_isSubtype(universe, tParameter, tEnv, sParameter, sEnv)) {
-      return false;
-    }
-  }
-
-  var sNamed = _FunctionParameters._getNamed(sParameters);
-  var tNamed = _FunctionParameters._getNamed(tParameters);
-  int sNamedLength = _Utils.arrayLength(sNamed);
-  int tNamedLength = _Utils.arrayLength(tNamed);
-
-  int sIndex = 0;
-  for (int tIndex = 0; tIndex < tNamedLength; tIndex += 3) {
-    String tName = _Utils.asString(_Utils.arrayAt(tNamed, tIndex));
-    while (true) {
-      if (sIndex >= sNamedLength) return false;
-      String sName = _Utils.asString(_Utils.arrayAt(sNamed, sIndex));
-      sIndex += 3;
-      if (_Utils.stringLessThan(tName, sName)) return false;
-      bool sIsRequired = _Utils.asBool(_Utils.arrayAt(sNamed, sIndex - 2));
-      if (_Utils.stringLessThan(sName, tName)) {
-        if (sIsRequired) return false;
-        continue;
-      }
-      bool tIsRequired = _Utils.asBool(_Utils.arrayAt(tNamed, tIndex + 1));
-      if (sIsRequired && !tIsRequired) return false;
-      Rti sType = _Utils.asRti(_Utils.arrayAt(sNamed, sIndex - 1));
-      Rti tType = _Utils.asRti(_Utils.arrayAt(tNamed, tIndex + 2));
-      if (!_isSubtype(universe, tType, tEnv, sType, sEnv)) return false;
-      break;
-    }
-  }
-  while (sIndex < sNamedLength) {
-    if (_Utils.asBool(_Utils.arrayAt(sNamed, sIndex + 1))) return false;
-    sIndex += 3;
-  }
-  return true;
-}
-
-bool _isInterfaceSubtype(
-    Object? universe, Rti s, Object? sEnv, Rti t, Object? tEnv) {
-  String sName = Rti._getInterfaceName(s);
-  String tName = Rti._getInterfaceName(t);
-
-  // Interface Compositionality:
-  if (sName == tName) {
-    var sArgs = Rti._getInterfaceTypeArguments(s);
-    var tArgs = Rti._getInterfaceTypeArguments(t);
-    int length = _Utils.arrayLength(sArgs);
-    assert(length == _Utils.arrayLength(tArgs));
-
-    var sVariances;
-    bool? hasVariances;
-    if (JS_GET_FLAG("VARIANCE")) {
-      sVariances = _Universe.findTypeParameterVariances(universe, sName);
-      hasVariances = sVariances != null;
-      assert(!hasVariances || length == _Utils.arrayLength(sVariances));
-    }
-
-    for (int i = 0; i < length; i++) {
-      Rti sArg = _Utils.asRti(_Utils.arrayAt(sArgs, i));
-      Rti tArg = _Utils.asRti(_Utils.arrayAt(tArgs, i));
-      if (JS_GET_FLAG("VARIANCE")) {
-        int sVariance = hasVariances != null
-            ? _Utils.asInt(_Utils.arrayAt(sVariances, i))
-            : Variance.legacyCovariant;
-        switch (sVariance) {
-          case Variance.legacyCovariant:
-          case Variance.covariant:
-            if (!_isSubtype(universe, sArg, sEnv, tArg, tEnv)) {
-              return false;
-            }
-            break;
-          case Variance.contravariant:
-            if (!_isSubtype(universe, tArg, tEnv, sArg, sEnv)) {
-              return false;
-            }
-            break;
-          case Variance.invariant:
-            if (!_isSubtype(universe, sArg, sEnv, tArg, tEnv) ||
-                !_isSubtype(universe, tArg, tEnv, sArg, sEnv)) {
-              return false;
-            }
-            break;
-          default:
-            throw StateError(
-                "Unknown variance given for subtype check: $sVariance");
-        }
-      } else {
-        if (!_isSubtype(universe, sArg, sEnv, tArg, tEnv)) {
-          return false;
-        }
-      }
-    }
-    return true;
-  }
-
-  // The Super-Interface rule says that if [s] has superinterfaces C0,...,Cn,
-  // then we need to check if for some i, Ci <: [t]. However, this requires us
-  // to iterate over the superinterfaces. Instead, we can perform case
-  // analysis on [t]. By this point, [t] can only be Never, a type variable,
-  // or an interface type. (Bindings do not participate in subtype checks and
-  // all other cases have been eliminated.) If [t] is not an interface, then
-  // [s] </: [t]. Therefore, the only remaining case is that [t] is an
-  // interface, so rather than iterating over the Ci, we can instead look up
-  // [t] in our ruleset.
-  // TODO(fishythefish): Handle variance correctly.
-
-  // We don't list Object explicitly as a supertype of each interface, so check
-  // this trivial case first.
-  if (isObjectType(t)) return true;
-  var rule = _Universe.findRule(universe, sName);
-  if (rule == null) return false;
-  var supertypeArgs = TypeRule.lookupSupertype(rule, tName);
-  if (supertypeArgs == null) return false;
-  int length = _Utils.arrayLength(supertypeArgs);
-  var tArgs = Rti._getInterfaceTypeArguments(t);
-  assert(length == _Utils.arrayLength(tArgs));
-  for (int i = 0; i < length; i++) {
-    String recipe = _Utils.asString(_Utils.arrayAt(supertypeArgs, i));
-    Rti supertypeArg = _Universe.evalInEnvironment(universe, s, recipe);
-    Rti tArg = _Utils.asRti(_Utils.arrayAt(tArgs, i));
-    if (!_isSubtype(universe, supertypeArg, sEnv, tArg, tEnv)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-bool isNullable(Rti t) {
-  int kind = Rti._getKind(t);
-  return isNullType(t) ||
-      isStrongTopType(t) ||
-      kind == Rti.kindQuestion ||
-      kind == Rti.kindStar && isNullable(Rti._getStarArgument(t)) ||
-      kind == Rti.kindFutureOr && isNullable(Rti._getFutureOrArgument(t));
-}
-
-@pragma('dart2js:parameter:trust')
-bool isTopType(Rti t) =>
-    isStrongTopType(t) ||
-    isLegacyObjectType(t) ||
-    JS_GET_FLAG('LEGACY') && isObjectType(t);
-
-bool isStrongTopType(Rti t) {
-  int kind = Rti._getKind(t);
-  return kind == Rti.kindDynamic ||
-      kind == Rti.kindVoid ||
-      kind == Rti.kindAny ||
-      kind == Rti.kindErased ||
-      isNullableObjectType(t);
-}
-
-bool isBottomType(Rti t) =>
-    Rti._getKind(t) == Rti.kindNever || JS_GET_FLAG('LEGACY') && isNullType(t);
-
-bool isObjectType(Rti t) => _Utils.isIdentical(t, TYPE_REF<Object>());
-bool isLegacyObjectType(Rti t) =>
-    _Utils.isIdentical(t, LEGACY_TYPE_REF<Object>());
-bool isNullableObjectType(Rti t) => _Utils.isIdentical(t, TYPE_REF<Object?>());
-bool isNullType(Rti t) =>
-    _Utils.isIdentical(t, TYPE_REF<Null>()) ||
-    _Utils.isIdentical(t, TYPE_REF<JSNull>());
-bool isFunctionType(Rti t) => _Utils.isIdentical(t, TYPE_REF<Function>());
-bool isJsFunctionType(Rti t) =>
-    _Utils.isIdentical(t, TYPE_REF<JavaScriptFunction>());
-
-class _Utils {
-  static bool asBool(Object? o) => JS('bool', '#', o);
-  static double asDouble(Object? o) => JS('double', '#', o);
-  static int asInt(Object? o) => JS('int', '#', o);
-  static num asNum(Object? o) => JS('num', '#', o);
-  static String asString(Object? o) => JS('String', '#', o);
-  static Rti asRti(Object? s) => JS('Rti', '#', s);
-  static Rti? asRtiOrNull(Object? s) => JS('Rti|Null', '#', s);
-
-  static bool isString(Object? o) => JS('bool', 'typeof # == "string"', o);
-  static bool isNum(Object? o) => JS('bool', 'typeof # == "number"', o);
-
-  static bool instanceOf(Object? o, Object? constructor) =>
-      JS('bool', '# instanceof #', o, constructor);
-
-  static bool isIdentical(Object? s, Object? t) => JS('bool', '# === #', s, t);
-  static bool isNotIdentical(Object? s, Object? t) =>
-      JS('bool', '# !== #', s, t);
-
-  static bool isMultipleOf(int n, int d) => JS('bool', '# % # === 0', n, d);
-
-  static JSArray objectKeys(Object? o) =>
-      JS('returns:JSArray;new:true;', 'Object.keys(#)', o);
-
-  static void objectAssign(Object? o, Object? other) {
-    // TODO(fishythefish): Use `Object.assign()` when IE11 is deprecated.
-    var keys = objectKeys(other);
-    int length = arrayLength(keys);
-    for (int i = 0; i < length; i++) {
-      String key = asString(arrayAt(keys, i));
-      JS('', '#[#] = #[#]', o, key, other, key);
-    }
-  }
-
-  static bool isArray(Object? o) => JS('bool', 'Array.isArray(#)', o);
-
-  static int arrayLength(Object? array) => JS('int', '#.length', array);
-
-  static Object? arrayAt(Object? array, int i) => JS('', '#[#]', array, i);
-
-  static void arraySetAt(Object? array, int i, Object? value) {
-    JS('', '#[#] = #', array, i, value);
-  }
-
-  static JSArray arrayShallowCopy(Object? array) =>
-      JS('JSArray', '#.slice()', array);
-
-  static JSArray arraySplice(Object? array, int position) =>
-      JS('JSArray', '#.splice(#)', array, position);
-
-  static JSArray arrayConcat(Object? a1, Object? a2) =>
-      JS('JSArray', '#.concat(#)', a1, a2);
-
-  static void arrayPush(Object? array, Object? value) {
-    JS('', '#.push(#)', array, value);
-  }
-
-  static String substring(String s, int start, int end) =>
-      JS('String', '#.substring(#, #)', s, start, end);
-
-  static bool stringLessThan(String s1, String s2) =>
-      JS('bool', '# < #', s1, s2);
-
-  static Object? mapGet(Object? cache, Object? key) =>
-      JS('', '#.get(#)', cache, key);
-
-  static void mapSet(Object? cache, Object? key, Object? value) {
-    JS('', '#.set(#, #)', cache, key, value);
-  }
-}
-
-// -------- Entry points for testing -------------------------------------------
-
-String testingCanonicalRecipe(Rti rti) {
-  return Rti._getCanonicalRecipe(rti);
-}
-
-String testingRtiToString(Rti rti) {
-  return _rtiToString(rti, null);
-}
-
-String testingRtiToDebugString(Rti rti) {
-  return _rtiToDebugString(rti);
-}
-
-Object testingCreateUniverse() {
-  return _Universe.create();
-}
-
-void testingAddRules(Object? universe, Object? rules) {
-  _Universe.addRules(universe, rules);
-}
-
-void testingAddTypeParameterVariances(Object? universe, Object? variances) {
-  _Universe.addTypeParameterVariances(universe, variances);
-}
-
-bool testingIsSubtype(Object? universe, Rti rti1, Rti rti2) {
-  return isSubtype(universe, rti1, rti2);
-}
-
-Rti testingUniverseEval(Object? universe, String recipe) {
-  return _Universe.eval(universe, recipe, true);
-}
-
-void testingUniverseEvalOverride(Object? universe, String recipe, Rti rti) {
-  var cache = _Universe.evalCache(universe);
-  _Utils.mapSet(cache, recipe, rti);
-}
-
-Rti testingEnvironmentEval(Object? universe, Rti environment, String recipe) {
-  return _Universe.evalInEnvironment(universe, environment, recipe);
-}
-
-Rti testingEnvironmentBind(Object? universe, Rti environment, Rti arguments) {
-  return _Universe.bind(universe, environment, arguments);
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart
deleted file mode 100644
index f87406b..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// Contains error codes that transformed async/async* functions use to
-/// communicate with js_helper functions.
-
-const int SUCCESS = 0;
-const int ERROR = 1;
-const int STREAM_WAS_CANCELED = 2;
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/shared/embedded_names.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/shared/embedded_names.dart
deleted file mode 100644
index 31b46c5f..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/shared/embedded_names.dart
+++ /dev/null
@@ -1,454 +0,0 @@
-// Copyright (c) 2014, 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.
-
-/// Contains the names of globals that are embedded into the output by the
-/// compiler.
-///
-/// Variables embedded this way should be access with `JS_EMBEDDED_GLOBAL` from
-/// the `_foreign_helper` library.
-///
-/// This library is shared between the compiler and the runtime system.
-library dart2js._embedded_names;
-
-/// The name of the property that is used to mark a type as typedef.
-///
-/// Without reflection typedefs are removed (expanded to their function type)
-/// but with reflection an object is needed to have the typedef's name. The
-/// object is marked with this property.
-///
-/// This property name only lives on internal type-objects and is only used
-/// when reflection is enabled.
-const TYPEDEF_PREDICATE_PROPERTY_NAME = r"$$isTypedef";
-
-/// The name of the property that is used to find the function type of a
-/// typedef.
-///
-/// Without reflection typedefs are removed (expanded to their function type)
-/// but with reflection an object is needed to have the typedef's name.
-///
-/// The typedef's object contains a pointer to its function type (as an index
-/// into the embedded global [TYPES]) in this property.
-///
-/// This property name only lives on internal type-objects and is only used
-/// when reflection is enabled.
-const TYPEDEF_TYPE_PROPERTY_NAME = r"$typedefType";
-
-/// The name of the property that is used to find the native superclass of
-/// an extended class.
-///
-/// Every class that extends a native class has this property set on its
-/// native class.
-const NATIVE_SUPERCLASS_TAG_NAME = r"$nativeSuperclassTag";
-
-/// The name of the static-function property name.
-///
-/// This property is set for all tear-offs of static functions, and provides
-/// the static function's unique (potentially minified) name.
-const STATIC_FUNCTION_NAME_PROPERTY_NAME = r'$static_name';
-
-/// The name of a property on the constructor function of Dart Object
-/// and interceptor types, used for caching Rti types.
-const CONSTRUCTOR_RTI_CACHE_PROPERTY_NAME = r'$ccache';
-
-/// The name of the embedded global for metadata.
-///
-/// Use [JsBuiltin.getMetadata] instead of directly accessing this embedded
-/// global.
-const METADATA = 'metadata';
-
-/// A list of types used in the program e.g. for reflection or encoding of
-/// function types.
-///
-/// Use [JsBuiltin.getType] instead of directly accessing this embedded global.
-const TYPES = 'types';
-
-/// Returns a function that maps a name of a class to its type.
-///
-/// This embedded global is used by the runtime when computing the internal
-/// runtime-type-information (rti) object.
-const GET_TYPE_FROM_NAME = 'getTypeFromName';
-
-/// A JS map from mangled global names to their unmangled names.
-///
-/// If the program does not use reflection, this embedded global may be empty
-/// (but not null or undefined).
-const MANGLED_GLOBAL_NAMES = 'mangledGlobalNames';
-
-/// A JS map from mangled instance names to their unmangled names.
-///
-/// This embedded global is mainly used for reflection, but is also used to
-/// map const-symbols (`const Symbol('x')`) to the mangled instance names.
-///
-/// This embedded global may be empty (but not null or undefined).
-const MANGLED_NAMES = 'mangledNames';
-
-/// A JS map from dispatch tags (usually constructor names of DOM classes) to
-/// interceptor class. This map is used to find the correct interceptor for
-/// native classes.
-///
-/// This embedded global is used for natives.
-const INTERCEPTORS_BY_TAG = 'interceptorsByTag';
-
-/// A JS map from dispatch tags (usually constructor names of DOM classes) to
-/// booleans. Every tag entry of [INTERCEPTORS_BY_TAG] has a corresponding
-/// entry in the leaf-tags map.
-///
-/// A tag-entry is true, when a class can be treated as leaf class in the
-/// hierarchy. That is, even though it might have subclasses, all subclasses
-/// have the same code for the used methods.
-///
-/// This embedded global is used for natives.
-const LEAF_TAGS = 'leafTags';
-
-/// A JS function that returns the isolate tag for a given name.
-///
-/// This function uses the [ISOLATE_TAG] (below) to construct a name that is
-/// unique per isolate.
-///
-/// This embedded global is used for natives.
-// TODO(floitsch): should we rename this variable to avoid confusion with
-//    [INTERCEPTORS_BY_TAG] and [LEAF_TAGS].
-const GET_ISOLATE_TAG = 'getIsolateTag';
-
-/// A string that is different for each running isolate.
-///
-/// When this embedded global is initialized a global variable is used to
-/// ensure that no other running isolate uses the same isolate-tag string.
-///
-/// This embedded global is used for natives.
-// TODO(floitsch): should we rename this variable to avoid confusion with
-//    [INTERCEPTORS_BY_TAG] and [LEAF_TAGS].
-const ISOLATE_TAG = 'isolateTag';
-
-/// An embedded global that contains the property used to store type information
-/// on JavaScript Array instances. This is a Symbol (except for IE11, where is
-/// is a String).
-const ARRAY_RTI_PROPERTY = 'arrayRti';
-
-/// This embedded global (a function) returns the isolate-specific dispatch-tag
-/// that is used to accelerate interceptor calls.
-const DISPATCH_PROPERTY_NAME = "dispatchPropertyName";
-
-/// An embedded global that maps a [Type] to the [Interceptor] and constructors
-/// for that type.
-///
-/// More documentation can be found in the interceptors library (close to its
-/// use).
-const TYPE_TO_INTERCEPTOR_MAP = "typeToInterceptorMap";
-
-/// The current script's URI when the program was loaded.
-///
-/// This embedded global is set at startup, just before invoking `main`.
-const CURRENT_SCRIPT = 'currentScript';
-
-/// Contains a map from load-ids to lists of part indexes.
-///
-/// To load the deferred library that is represented by the load-id, the runtime
-/// must load all associated URIs (named in DEFERRED_PART_URIS) and initialize
-/// all the loaded hunks (DEFERRED_PART_HASHES).
-///
-/// This embedded global is only used for deferred loading.
-const DEFERRED_LIBRARY_PARTS = 'deferredLibraryParts';
-
-/// Contains a list of URIs (Strings), indexed by part.
-///
-/// The lists in the DEFERRED_LIBRARY_PARTS map contain indexes into this list.
-///
-/// This embedded global is only used for deferred loading.
-const DEFERRED_PART_URIS = 'deferredPartUris';
-
-/// Contains a list of hashes, indexed by part.
-///
-/// The lists in the DEFERRED_LIBRARY_PARTS map contain indexes into this list.
-///
-/// The hashes are associated with the URIs of the load-ids (see
-/// [DEFERRED_PART_URIS]). They are SHA1 (or similar) hashes of the code that
-/// must be loaded. By using cryptographic hashes we can (1) handle loading in
-/// the same web page the parts from multiple Dart applications (2) avoid
-/// loading similar code multiple times.
-///
-/// This embedded global is only used for deferred loading.
-const DEFERRED_PART_HASHES = 'deferredPartHashes';
-
-/// Initialize a loaded hunk.
-///
-/// Once a hunk (the code from a deferred URI) has been loaded it must be
-/// initialized. Calling this function with the corresponding hash (see
-/// [DEFERRED_LIBRARY_HASHES]) initializes the code.
-///
-/// This embedded global is only used for deferred loading.
-const INITIALIZE_LOADED_HUNK = 'initializeLoadedHunk';
-
-/// Returns, whether a hunk (identified by its hash) has already been loaded.
-///
-/// This embedded global is only used for deferred loading.
-const IS_HUNK_LOADED = 'isHunkLoaded';
-
-/// Returns, whether a hunk (identified by its hash) has already been
-/// initialized.
-///
-/// This embedded global is only used for deferred loading.
-const IS_HUNK_INITIALIZED = 'isHunkInitialized';
-
-/// A set (implemented as map to booleans) of hunks (identified by hashes) that
-/// have already been initialized.
-///
-/// This embedded global is only used for deferred loading.
-///
-/// This global is an emitter-internal embedded global, and not used by the
-/// runtime. The constant remains in this file to make sure that other embedded
-/// globals don't clash with it.
-const DEFERRED_INITIALIZED = 'deferredInitialized';
-
-/// A 'Universe' object used by 'dart:_rti'.
-///
-/// This embedded global is used for --experiment-new-rti.
-const RTI_UNIVERSE = 'typeUniverse';
-
-/// Returns a function that creates all precompiled functions (in particular
-/// constructors).
-///
-/// That is, the function returns the array that the full emitter would
-/// otherwise build dynamically when it finishes all classes.
-///
-/// This constant is only used in CSP mode.
-///
-/// This global is an emitter-internal embedded global, and not used by the
-/// runtime. The constant remains in this file to make sure that other embedded
-/// globals don't clash with it.
-const PRECOMPILED = 'precompiled';
-
-/// An emitter-internal embedded global. This global is not used by the runtime.
-const FINISHED_CLASSES = 'finishedClasses';
-
-/// A JavaScript object literal that maps the (minified) JavaScript constructor
-/// name (as given by [JsBuiltin.rawRtiToJsConstructorName] to the
-/// JavaScript constructor.
-///
-/// This embedded global is only used by reflection.
-const ALL_CLASSES = 'allClasses';
-
-/// A map from element to type information.
-///
-/// This embedded global is only used by reflection.
-const TYPE_INFORMATION = 'typeInformation';
-
-/// A map from statics to their descriptors.
-///
-/// This embedded global is only used by reflection.
-const STATICS = 'statics';
-
-/// An array of library descriptors.
-///
-/// The descriptor contains information such as name, uri, classes, ...
-///
-/// This embedded global is only used by reflection.
-const LIBRARIES = 'libraries';
-
-/// A map from lazy statics to their initializers.
-///
-/// This embedded global is only used by reflection.
-const LAZIES = 'lazies';
-
-/// Names that are supported by [JS_GET_NAME].
-// TODO(herhut): Make entries lower case (as in fields) and find a better name.
-enum JsGetName {
-  GETTER_PREFIX,
-  SETTER_PREFIX,
-  CALL_PREFIX,
-  CALL_PREFIX0,
-  CALL_PREFIX1,
-  CALL_PREFIX2,
-  CALL_PREFIX3,
-  CALL_PREFIX4,
-  CALL_PREFIX5,
-  CALL_CATCH_ALL,
-  REFLECTABLE,
-  CLASS_DESCRIPTOR_PROPERTY,
-  REQUIRED_PARAMETER_PROPERTY,
-  DEFAULT_VALUES_PROPERTY,
-  CALL_NAME_PROPERTY,
-  DEFERRED_ACTION_PROPERTY,
-
-  /// Prefix used for generated type argument substitutions on classes.
-  OPERATOR_AS_PREFIX,
-
-  /// Prefix used for generated type test property on classes.
-  OPERATOR_IS_PREFIX,
-
-  /// Name used for generated function types on classes and methods.
-  SIGNATURE_NAME,
-
-  /// Name of JavaScript property used to store runtime-type information on
-  /// instances of parameterized classes.
-  RTI_NAME,
-
-  /// Name used to tag a function type.
-  FUNCTION_TYPE_TAG,
-
-  /// Name used to tag bounds of a generic function type. If bounds are present,
-  /// the property value is an Array of bounds (the length gives the number of
-  /// type parameters). If absent, the type is not a generic function type.
-  FUNCTION_TYPE_GENERIC_BOUNDS_TAG,
-
-  /// Name used to tag void return in function type representations in
-  /// JavaScript.
-  FUNCTION_TYPE_VOID_RETURN_TAG,
-
-  /// Name used to tag return types in function type representations in
-  /// JavaScript.
-  FUNCTION_TYPE_RETURN_TYPE_TAG,
-
-  /// Name used to tag required parameters in function type representations
-  /// in JavaScript.
-  FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG,
-
-  /// Name used to tag optional parameters in function type representations
-  /// in JavaScript.
-  FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG,
-
-  /// Name used to tag named parameters in function type representations in
-  /// JavaScript.
-  FUNCTION_TYPE_NAMED_PARAMETERS_TAG,
-
-  /// Name used to tag a FutureOr type.
-  FUTURE_OR_TAG,
-
-  /// Name used to tag type arguments types in FutureOr type representations in
-  /// JavaScript.
-  FUTURE_OR_TYPE_ARGUMENT_TAG,
-
-  /// String representation of the type of the Future class.
-  FUTURE_CLASS_TYPE_NAME,
-
-  /// Field name used for determining if an object or its interceptor has
-  /// JavaScript indexing behavior.
-  IS_INDEXABLE_FIELD_NAME,
-
-  /// String representation of the type of the null class.
-  NULL_CLASS_TYPE_NAME,
-
-  /// String representation of the type of the object class.
-  OBJECT_CLASS_TYPE_NAME,
-
-  /// String representation of the type of the function class.
-  FUNCTION_CLASS_TYPE_NAME,
-
-  /// String representation of the type of the JavaScriptFunction class.
-  JS_FUNCTION_CLASS_TYPE_NAME,
-
-  /// Property name for Rti._as field.
-  RTI_FIELD_AS,
-
-  /// Property name for Rti._is field.
-  RTI_FIELD_IS,
-}
-
-enum JsBuiltin {
-  /// Returns the JavaScript constructor function for Dart's Object class.
-  /// This can be used for type tests, as in
-  ///
-  ///     var constructor = JS_BUILTIN('', JsBuiltin.dartObjectConstructor);
-  ///     if (JS('bool', '# instanceof #', obj, constructor))
-  ///       ...
-  dartObjectConstructor,
-
-  /// Returns the JavaScript constructor function for the runtime's Closure
-  /// class, the base class of all closure objects.  This can be used for type
-  /// tests, as in
-  ///
-  ///     var constructor = JS_BUILTIN('', JsBuiltin.dartClosureConstructor);
-  ///     if (JS('bool', '# instanceof #', obj, constructor))
-  ///       ...
-  dartClosureConstructor,
-
-  /// Returns the JavaScript-constructor name given an [isCheckProperty].
-  ///
-  /// This relies on a deterministic encoding of is-check properties (for
-  /// example `$isFoo` for a class `Foo`). In minified code the returned
-  /// classname is the minified name of the class.
-  ///
-  ///     JS_BUILTIN('returns:String;depends:none;effects:none',
-  ///                JsBuiltin.isCheckPropertyToJsConstructorName,
-  ///                isCheckProperty);
-  isCheckPropertyToJsConstructorName,
-
-  /// Returns true if the given type is a function type. Returns false for
-  /// the one `Function` type singleton. (See [isFunctionTypeSingleton]).
-  ///
-  ///     JS_BUILTIN('bool', JsBuiltin.isFunctionType, o)
-  isFunctionType,
-
-  /// Returns true if the given type is a FutureOr type.
-  ///
-  ///     JS_BUILTIN('bool', JsBuiltin.isFutureOrType, o)
-  isFutureOrType,
-
-  /// Returns true if the given type is the `void` type.
-  ///
-  ///     JS_BUILTIN('bool', JsBuiltin.isVoidType, o)
-  isVoidType,
-
-  /// Returns true if the given type is the `dynamic` type.
-  ///
-  ///     JS_BUILTIN('bool', JsBuiltin.isDynamicType, o)
-  isDynamicType,
-
-  /// Returns true if the given type is a type argument of a js-interop class
-  /// or a supertype of a js-interop class.
-  ///
-  ///     JS_BUILTIN('bool', JsBuiltin.isJsInteropTypeArgument, o)
-  isJsInteropTypeArgument,
-
-  /// Returns the JavaScript-constructor name given an rti encoding.
-  ///
-  ///     JS_BUILTIN('String', JsBuiltin.rawRtiToJsConstructorName, rti)
-  rawRtiToJsConstructorName,
-
-  /// Returns the raw runtime type of the given object. The given argument
-  /// [o] should be the interceptor (for non-Dart objects).
-  ///
-  ///     JS_BUILTIN('', JsBuiltin.rawRuntimeType, o)
-  rawRuntimeType,
-
-  /// Returns whether the given type is a subtype of other.
-  ///
-  /// The argument `other` is the name of the potential supertype. It is
-  /// computed by `runtimeTypeToString`;
-  ///
-  /// *The `other` name must be passed in before the `type`.*
-  ///
-  ///     JS_BUILTIN('returns:bool;effects:none;depends:none',
-  ///                JsBuiltin.isSubtype, other, type);
-  isSubtype,
-
-  /// Returns true if the given type equals the type given as second
-  /// argument. Use the JS_GET_NAME helpers to get the type representation
-  /// for various Dart classes.
-  ///
-  ///     JS_BUILTIN('returns:bool;effects:none;depends:none',
-  ///                JsBuiltin.isFunctionTypeLiteral, type, name);
-  isGivenTypeRti,
-
-  /// Returns the metadata of the given [index].
-  ///
-  ///     JS_BUILTIN('returns:var;effects:none;depends:none',
-  ///                JsBuiltin.getMetadata, index);
-  getMetadata,
-
-  /// Returns the type of the given [index].
-  ///
-  ///     JS_BUILTIN('returns:var;effects:none;depends:none',
-  ///                JsBuiltin.getType, index);
-  getType,
-}
-
-/// Names of fields of the Rti Universe object.
-class RtiUniverseFieldNames {
-  static String evalCache = 'eC';
-  static String typeRules = 'tR';
-  static String erasedTypes = 'eT';
-  static String typeParameterVariances = 'tPV';
-  static String sharedEmptyArray = 'sEA';
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart
deleted file mode 100644
index c183861..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart
+++ /dev/null
@@ -1,237 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Constants and predicates used for encoding and decoding type recipes.
-///
-/// This library is shared between the compiler and the runtime system.
-library dart2js._recipe_syntax;
-
-abstract class Recipe {
-  Recipe._();
-
-  // Operators.
-
-  static const int separator = _comma;
-  static const String separatorString = _commaString;
-
-  static const int toType = _semicolon;
-  static const String toTypeString = _semicolonString;
-
-  static const int pushErased = _hash;
-  static const String pushErasedString = _hashString;
-  static const int pushDynamic = _at;
-  static const String pushDynamicString = _atString;
-  static const int pushVoid = _tilde;
-  static const String pushVoidString = _tildeString;
-
-  static const int wrapStar = _asterisk;
-  static const String wrapStarString = _asteriskString;
-  static const int wrapQuestion = _question;
-  static const String wrapQuestionString = _questionString;
-  static const int wrapFutureOr = _slash;
-  static const String wrapFutureOrString = _slashString;
-
-  static const int startTypeArguments = _lessThan;
-  static const String startTypeArgumentsString = _lessThanString;
-  static const int endTypeArguments = _greaterThan;
-  static const String endTypeArgumentsString = _greaterThanString;
-
-  static const int startFunctionArguments = _leftParen;
-  static const String startFunctionArgumentsString = _leftParenString;
-  static const int endFunctionArguments = _rightParen;
-  static const String endFunctionArgumentsString = _rightParenString;
-  static const int startOptionalGroup = _leftBracket;
-  static const String startOptionalGroupString = _leftBracketString;
-  static const int endOptionalGroup = _rightBracket;
-  static const String endOptionalGroupString = _rightBracketString;
-  static const int startNamedGroup = _leftBrace;
-  static const String startNamedGroupString = _leftBraceString;
-  static const int endNamedGroup = _rightBrace;
-  static const String endNamedGroupString = _rightBraceString;
-  static const int nameSeparator = _colon;
-  static const String nameSeparatorString = _colonString;
-  static const int requiredNameSeparator = _exclamation;
-  static const String requiredNameSeparatorString = _exclamationString;
-
-  static const int genericFunctionTypeParameterIndex = _circumflex;
-  static const String genericFunctionTypeParameterIndexString =
-      _circumflexString;
-
-  static const int extensionOp = _ampersand;
-  static const String extensionOpString = _ampersandString;
-  static const int pushNeverExtension = 0;
-  static const String pushNeverExtensionString = '$pushNeverExtension';
-  static const int pushAnyExtension = 1;
-  static const String pushAnyExtensionString = '$pushAnyExtension';
-
-  // Number and name components.
-
-  static bool isDigit(int code) => code >= _digit0 && code <= _digit9;
-  static int digitValue(int code) => code - _digit0;
-
-  static bool isIdentifierStart(int ch) =>
-      (((ch | 32) - _lowercaseA) & 0xffff) < 26 ||
-      (ch == _underscore) ||
-      (ch == _dollar);
-
-  static const int period = _period;
-
-  // Private names.
-
-  static const int _formfeed = 0x0C;
-  static const String _formfeedString = '\f';
-
-  static const int _space = 0x20;
-  static const String _spaceString = ' ';
-  static const int _exclamation = 0x21;
-  static const String _exclamationString = '!';
-  static const int _hash = 0x23;
-  static const String _hashString = '#';
-  static const int _dollar = 0x24;
-  static const String _dollarString = r'$';
-  static const int _percent = 0x25;
-  static const String _percentString = '%';
-  static const int _ampersand = 0x26;
-  static const String _ampersandString = '&';
-  static const int _apostrophe = 0x27;
-  static const String _apostropheString = "'";
-  static const int _leftParen = 0x28;
-  static const String _leftParenString = '(';
-  static const int _rightParen = 0x29;
-  static const String _rightParenString = ')';
-  static const int _asterisk = 0x2A;
-  static const String _asteriskString = '*';
-  static const int _plus = 0x2B;
-  static const String _plusString = '+';
-  static const int _comma = 0x2C;
-  static const String _commaString = ',';
-  static const int _minus = 0x2D;
-  static const String _minusString = '-';
-  static const int _period = 0x2E;
-  static const String _periodString = '.';
-  static const int _slash = 0x2F;
-  static const String _slashString = '/';
-
-  static const int _digit0 = 0x30;
-  static const int _digit9 = 0x39;
-
-  static const int _colon = 0x3A;
-  static const String _colonString = ':';
-  static const int _semicolon = 0x3B;
-  static const String _semicolonString = ';';
-  static const int _lessThan = 0x3C;
-  static const String _lessThanString = '<';
-  static const int _equals = 0x3D;
-  static const String _equalsString = '=';
-  static const int _greaterThan = 0x3E;
-  static const String _greaterThanString = '>';
-  static const int _question = 0x3F;
-  static const String _questionString = '?';
-  static const int _at = 0x40;
-  static const String _atString = '@';
-
-  static const int _uppercaseA = 0x41;
-  static const int _uppercaseZ = 0x5A;
-
-  static const int _leftBracket = 0x5B;
-  static const String _leftBracketString = '[';
-  static const int _backslash = 0x5C;
-  static const String _backslashString = r'\';
-  static const int _rightBracket = 0x5D;
-  static const String _rightBracketString = ']';
-  static const int _circumflex = 0x5E;
-  static const String _circumflexString = '^';
-  static const int _underscore = 0x5F;
-  static const String _underscoreString = '_';
-  static const int _backtick = 0x60;
-  static const String _backtickString = '`';
-
-  static const int _lowercaseA = 0x61;
-  static const int _lowercaseZ = 0x7A;
-
-  static const int _leftBrace = 0x7B;
-  static const String _leftBraceString = '{';
-  static const int _vertical = 0x7C;
-  static const String _verticalString = '|';
-  static const int _rightBrace = 0x7D;
-  static const String _rightBraceString = '}';
-  static const int _tilde = 0x7E;
-  static const String _tildeString = '~';
-
-  static void testEquivalence() {
-    void test(String label, int charCode, String str) {
-      if (String.fromCharCode(charCode) != str) {
-        throw StateError("$label: String.fromCharCode($charCode) != $str");
-      }
-    }
-
-    void testExtension(String label, int op, String str) {
-      if ('$op' != str) {
-        throw StateError("$label: $op.toString() != $str");
-      }
-    }
-
-    test("separator", separator, separatorString);
-    test("toType", toType, toTypeString);
-    test("pushErased", pushErased, pushErasedString);
-    test("pushDynamic", pushDynamic, pushDynamicString);
-    test("pushVoid", pushVoid, pushVoidString);
-    test("wrapStar", wrapStar, wrapStarString);
-    test("wrapQuestion", wrapQuestion, wrapQuestionString);
-    test("wrapFutureOr", wrapFutureOr, wrapFutureOrString);
-    test("startTypeArguments", startTypeArguments, startTypeArgumentsString);
-    test("endTypeArguments", endTypeArguments, endTypeArgumentsString);
-    test("startFunctionArguments", startFunctionArguments,
-        startFunctionArgumentsString);
-    test("endFunctionArguments", endFunctionArguments,
-        endFunctionArgumentsString);
-    test("startOptionalGroup", startOptionalGroup, startOptionalGroupString);
-    test("endOptionalGroup", endOptionalGroup, endOptionalGroupString);
-    test("startNamedGroup", startNamedGroup, startNamedGroupString);
-    test("endNamedGroup", endNamedGroup, endNamedGroupString);
-    test("nameSeparator", nameSeparator, nameSeparatorString);
-    test("requiredNameSeparator", requiredNameSeparator,
-        requiredNameSeparatorString);
-    test("genericFunctionTypeParameterIndex", genericFunctionTypeParameterIndex,
-        genericFunctionTypeParameterIndexString);
-    test("extensionOp", extensionOp, extensionOpString);
-    testExtension(
-        "pushNeverExtension", pushNeverExtension, pushNeverExtensionString);
-    testExtension("pushAnyExtension", pushAnyExtension, pushAnyExtensionString);
-
-    test("_formfeed", _formfeed, _formfeedString);
-    test("_space", _space, _spaceString);
-    test("_exclamation", _exclamation, _exclamationString);
-    test("_hash", _hash, _hashString);
-    test("_dollar", _dollar, _dollarString);
-    test("_percent", _percent, _percentString);
-    test("_ampersand", _ampersand, _ampersandString);
-    test("_apostrophe", _apostrophe, _apostropheString);
-    test("_leftParen", _leftParen, _leftParenString);
-    test("_rightParen", _rightParen, _rightParenString);
-    test("_asterisk", _asterisk, _asteriskString);
-    test("_plus", _plus, _plusString);
-    test("_comma", _comma, _commaString);
-    test("_minus", _minus, _minusString);
-    test("_period", _period, _periodString);
-    test("_slash", _slash, _slashString);
-    test("_colon", _colon, _colonString);
-    test("_semicolon", _semicolon, _semicolonString);
-    test("_lessThan", _lessThan, _lessThanString);
-    test("_equals", _equals, _equalsString);
-    test("_greaterThan", _greaterThan, _greaterThanString);
-    test("_question", _question, _questionString);
-    test("_at", _at, _atString);
-    test("_leftBracket", _leftBracket, _leftBracketString);
-    test("_backslash", _backslash, _backslashString);
-    test("_rightBracket", _rightBracket, _rightBracketString);
-    test("_circumflex", _circumflex, _circumflexString);
-    test("_underscore", _underscore, _underscoreString);
-    test("_backtick", _backtick, _backtickString);
-    test("_leftBrace", _leftBrace, _leftBraceString);
-    test("_vertical", _vertical, _verticalString);
-    test("_rightBrace", _rightBrace, _rightBraceString);
-    test("_tilde", _tilde, _tildeString);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/string_helper.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/string_helper.dart
deleted file mode 100644
index 3e07cdd..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/string_helper.dart
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of _js_helper;
-
-stringIndexOfStringUnchecked(receiver, other, startIndex) {
-  return JS('int', '#.indexOf(#, #)', receiver, other, startIndex);
-}
-
-substring1Unchecked(receiver, startIndex) {
-  return JS('String', '#.substring(#)', receiver, startIndex);
-}
-
-substring2Unchecked(receiver, startIndex, endIndex) {
-  return JS('String', '#.substring(#, #)', receiver, startIndex, endIndex);
-}
-
-stringContainsStringUnchecked(receiver, other, startIndex) {
-  return stringIndexOfStringUnchecked(receiver, other, startIndex) >= 0;
-}
-
-List<String> stringSplitUnchecked(String receiver, pattern) {
-  return new JSArray<String>.markGrowable(JS(
-      'returns:JSExtendableArray;new:true', '#.split(#)', receiver, pattern));
-}
-
-class StringMatch implements Match {
-  const StringMatch(int this.start, String this.input, String this.pattern);
-
-  int get end => start + pattern.length;
-  String operator [](int g) => group(g);
-  int get groupCount => 0;
-
-  String group(int group_) {
-    if (group_ != 0) {
-      throw new RangeError.value(group_);
-    }
-    return pattern;
-  }
-
-  List<String> groups(List<int> groups_) {
-    List<String> result = <String>[];
-    for (int g in groups_) {
-      result.add(group(g));
-    }
-    return result;
-  }
-
-  final int start;
-  final String input;
-  final String pattern;
-}
-
-Iterable<Match> allMatchesInStringUnchecked(
-    String pattern, String string, int startIndex) {
-  return new _StringAllMatchesIterable(string, pattern, startIndex);
-}
-
-class _StringAllMatchesIterable extends Iterable<Match> {
-  final String _input;
-  final String _pattern;
-  final int _index;
-
-  _StringAllMatchesIterable(this._input, this._pattern, this._index);
-
-  Iterator<Match> get iterator =>
-      new _StringAllMatchesIterator(_input, _pattern, _index);
-
-  Match get first {
-    int index = stringIndexOfStringUnchecked(_input, _pattern, _index);
-    if (index >= 0) {
-      return new StringMatch(index, _input, _pattern);
-    }
-    throw IterableElementError.noElement();
-  }
-}
-
-class _StringAllMatchesIterator implements Iterator<Match> {
-  final String _input;
-  final String _pattern;
-  int _index;
-  Match? _current;
-
-  _StringAllMatchesIterator(this._input, this._pattern, this._index);
-
-  bool moveNext() {
-    if (_index + _pattern.length > _input.length) {
-      _current = null;
-      return false;
-    }
-    var index = stringIndexOfStringUnchecked(_input, _pattern, _index);
-    if (index < 0) {
-      _index = _input.length + 1;
-      _current = null;
-      return false;
-    }
-    int end = index + _pattern.length;
-    _current = new StringMatch(index, _input, _pattern);
-    // Empty match, don't start at same location again.
-    if (end == _index) end++;
-    _index = end;
-    return true;
-  }
-
-  Match get current => _current!;
-}
-
-stringContainsUnchecked(receiver, other, startIndex) {
-  if (other is String) {
-    return stringContainsStringUnchecked(receiver, other, startIndex);
-  } else if (other is JSSyntaxRegExp) {
-    return other.hasMatch(receiver.substring(startIndex));
-  } else {
-    var substr = receiver.substring(startIndex);
-    return other.allMatches(substr).isNotEmpty;
-  }
-}
-
-String stringReplaceJS(String receiver, jsRegExp, String replacement) {
-  return JS('String', r'#.replace(#, #)', receiver, jsRegExp,
-      escapeReplacement(replacement));
-}
-
-String escapeReplacement(String replacement) {
-  // The JavaScript `String.prototype.replace` method recognizes replacement
-  // patterns in the replacement string. Dart does not have that behavior, so
-  // the replacement patterns need to be escaped.
-
-  // `String.prototype.replace` tends to be slower when there are replacement
-  // patterns, and the escaping itself uses replacement patterns, so it is
-  // worthwhile checking for `$` first.
-  if (stringContainsStringUnchecked(replacement, r'$', 0)) {
-    return JS('String', r'#.replace(/\$/g, "$$$$")', replacement);
-  }
-  return replacement;
-}
-
-stringReplaceFirstRE(receiver, regexp, replacement, startIndex) {
-  var match = regexp._execGlobal(receiver, startIndex);
-  if (match == null) return receiver;
-  var start = match.start;
-  var end = match.end;
-  return stringReplaceRangeUnchecked(receiver, start, end, replacement);
-}
-
-/// Returns a string for a RegExp pattern that matches [string]. This is done by
-/// escaping all RegExp metacharacters.
-quoteStringForRegExp(string) {
-  // We test and replace essentially the same RegExp because replacement when
-  // there are replacement patterns is slow enough to be worth avoiding.
-  if (JS('bool', r'/[[\]{}()*+?.\\^$|]/.test(#)', string)) {
-    return JS('String', r'#.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&")', string);
-  }
-  return string;
-}
-
-stringReplaceAllUnchecked(receiver, pattern, replacement) {
-  checkString(replacement);
-  if (pattern is String) {
-    return stringReplaceAllUncheckedString(receiver, pattern, replacement);
-  }
-
-  if (pattern is JSSyntaxRegExp) {
-    var re = regExpGetGlobalNative(pattern);
-    return stringReplaceJS(receiver, re, replacement);
-  }
-
-  checkNull(pattern);
-  // TODO(floitsch): implement generic String.replace (with patterns).
-  throw "String.replaceAll(Pattern) UNIMPLEMENTED";
-}
-
-/// Replaces all non-overlapping occurences of [pattern] in [receiver] with
-/// [replacement].  This should be replace with
-/// (String.prototype.replaceAll)[https://github.com/tc39/proposal-string-replace-all]
-/// when available.
-String stringReplaceAllUncheckedString(
-    String receiver, String pattern, String replacement) {
-  if (pattern == "") {
-    if (receiver == "") {
-      return JS('String', '#', replacement); // help type inference.
-    }
-    StringBuffer result = new StringBuffer('');
-    int length = receiver.length;
-    result.write(replacement);
-    for (int i = 0; i < length; i++) {
-      result.write(receiver[i]);
-      result.write(replacement);
-    }
-    return result.toString();
-  }
-
-  if (!const bool.fromEnvironment(
-      'dart2js.testing.String.replaceAll.force.regexp')) {
-    // First check for no match.
-    int index = stringIndexOfStringUnchecked(receiver, pattern, 0);
-    if (index < 0) return receiver;
-
-    // The fastest approach in general is to replace with a global RegExp, but
-    // this requires the receiver string to be long enough to amortize the cost
-    // of creating the RegExp, and the replacement to have no '$' patterns,
-    // which tend to make `String.prototype.replace` much slower. In these
-    // cases, using split-join usually wins.
-    if (receiver.length < 500 ||
-        stringContainsStringUnchecked(replacement, r'$', 0)) {
-      return stringReplaceAllUsingSplitJoin(receiver, pattern, replacement);
-    }
-  }
-  var quoted = quoteStringForRegExp(pattern);
-  var replacer = JS('', "new RegExp(#, 'g')", quoted);
-  return stringReplaceJS(receiver, replacer, replacement);
-}
-
-String stringReplaceAllUsingSplitJoin(receiver, pattern, replacement) {
-  return JS('String', '#.split(#).join(#)', receiver, pattern, replacement);
-}
-
-String? _matchString(Match match) => match[0];
-String _stringIdentity(String string) => string;
-
-stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) {
-  if (onMatch == null) onMatch = _matchString;
-  if (onNonMatch == null) onNonMatch = _stringIdentity;
-  if (pattern is String) {
-    return stringReplaceAllStringFuncUnchecked(
-        receiver, pattern, onMatch, onNonMatch);
-  }
-  // Placing the Pattern test here is indistinguishable from placing it at the
-  // top of the method but it saves an extra check on the `pattern is String`
-  // path.
-  if (pattern is! Pattern) {
-    throw new ArgumentError.value(pattern, 'pattern', 'is not a Pattern');
-  }
-  StringBuffer buffer = new StringBuffer('');
-  int startIndex = 0;
-  for (Match match in pattern.allMatches(receiver)) {
-    buffer.write(onNonMatch(receiver.substring(startIndex, match.start)));
-    buffer.write(onMatch(match));
-    startIndex = match.end;
-  }
-  buffer.write(onNonMatch(receiver.substring(startIndex)));
-  return buffer.toString();
-}
-
-stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch) {
-  // Pattern is the empty string.
-  StringBuffer buffer = new StringBuffer('');
-  int length = receiver.length;
-  int i = 0;
-  buffer.write(onNonMatch(""));
-  while (i < length) {
-    buffer.write(onMatch(new StringMatch(i, receiver, "")));
-    // Special case to avoid splitting a surrogate pair.
-    int code = receiver.codeUnitAt(i);
-    if ((code & ~0x3FF) == 0xD800 && length > i + 1) {
-      // Leading surrogate;
-      code = receiver.codeUnitAt(i + 1);
-      if ((code & ~0x3FF) == 0xDC00) {
-        // Matching trailing surrogate.
-        buffer.write(onNonMatch(receiver.substring(i, i + 2)));
-        i += 2;
-        continue;
-      }
-    }
-    buffer.write(onNonMatch(receiver[i]));
-    i++;
-  }
-  buffer.write(onMatch(new StringMatch(i, receiver, "")));
-  buffer.write(onNonMatch(""));
-  return buffer.toString();
-}
-
-stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onNonMatch) {
-  int patternLength = pattern.length;
-  if (patternLength == 0) {
-    return stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch);
-  }
-  int length = receiver.length;
-  StringBuffer buffer = new StringBuffer('');
-  int startIndex = 0;
-  while (startIndex < length) {
-    int position = stringIndexOfStringUnchecked(receiver, pattern, startIndex);
-    if (position == -1) {
-      break;
-    }
-    buffer.write(onNonMatch(receiver.substring(startIndex, position)));
-    buffer.write(onMatch(new StringMatch(position, receiver, pattern)));
-    startIndex = position + patternLength;
-  }
-  buffer.write(onNonMatch(receiver.substring(startIndex)));
-  return buffer.toString();
-}
-
-stringReplaceFirstUnchecked(receiver, pattern, replacement, int startIndex) {
-  if (pattern is String) {
-    int index = stringIndexOfStringUnchecked(receiver, pattern, startIndex);
-    if (index < 0) return receiver;
-    int end = index + pattern.length;
-    return stringReplaceRangeUnchecked(receiver, index, end, replacement);
-  }
-  if (pattern is JSSyntaxRegExp) {
-    return startIndex == 0
-        ? stringReplaceJS(receiver, regExpGetNative(pattern), replacement)
-        : stringReplaceFirstRE(receiver, pattern, replacement, startIndex);
-  }
-  checkNull(pattern);
-  Iterator<Match> matches = pattern.allMatches(receiver, startIndex).iterator;
-  if (!matches.moveNext()) return receiver;
-  Match match = matches.current;
-  return receiver.replaceRange(match.start, match.end, replacement);
-}
-
-stringReplaceFirstMappedUnchecked(receiver, pattern, replace, int startIndex) {
-  Iterator<Match> matches = pattern.allMatches(receiver, startIndex).iterator;
-  if (!matches.moveNext()) return receiver;
-  Match match = matches.current;
-  String replacement = "${replace(match)}";
-  return receiver.replaceRange(match.start, match.end, replacement);
-}
-
-stringJoinUnchecked(array, separator) {
-  return JS('String', r'#.join(#)', array, separator);
-}
-
-String stringReplaceRangeUnchecked(
-    String receiver, int start, int end, String replacement) {
-  var prefix = JS('String', '#.substring(0, #)', receiver, start);
-  var suffix = JS('String', '#.substring(#)', receiver, end);
-  return "$prefix$replacement$suffix";
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/lib/typed_data_patch.dart b/sdk_nnbd/lib/_internal/js_runtime/lib/typed_data_patch.dart
deleted file mode 100644
index d1c6a1a..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/lib/typed_data_patch.dart
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:_js_helper' show patch;
-import 'dart:_native_typed_data';
-
-@patch
-class ByteData {
-  @patch
-  factory ByteData(int length) = NativeByteData;
-}
-
-@patch
-class Float32List {
-  @patch
-  factory Float32List(int length) = NativeFloat32List;
-
-  @patch
-  factory Float32List.fromList(List<double> elements) =
-      NativeFloat32List.fromList;
-}
-
-@patch
-class Float64List {
-  @patch
-  factory Float64List(int length) = NativeFloat64List;
-
-  @patch
-  factory Float64List.fromList(List<double> elements) =
-      NativeFloat64List.fromList;
-}
-
-@patch
-class Int16List {
-  @patch
-  factory Int16List(int length) = NativeInt16List;
-
-  @patch
-  factory Int16List.fromList(List<int> elements) = NativeInt16List.fromList;
-}
-
-@patch
-class Int32List {
-  @patch
-  factory Int32List(int length) = NativeInt32List;
-
-  @patch
-  factory Int32List.fromList(List<int> elements) = NativeInt32List.fromList;
-}
-
-@patch
-class Int8List {
-  @patch
-  factory Int8List(int length) = NativeInt8List;
-
-  @patch
-  factory Int8List.fromList(List<int> elements) = NativeInt8List.fromList;
-}
-
-@patch
-class Uint32List {
-  @patch
-  factory Uint32List(int length) = NativeUint32List;
-
-  @patch
-  factory Uint32List.fromList(List<int> elements) = NativeUint32List.fromList;
-}
-
-@patch
-class Uint16List {
-  @patch
-  factory Uint16List(int length) = NativeUint16List;
-
-  @patch
-  factory Uint16List.fromList(List<int> elements) = NativeUint16List.fromList;
-}
-
-@patch
-class Uint8ClampedList {
-  @patch
-  factory Uint8ClampedList(int length) = NativeUint8ClampedList;
-
-  @patch
-  factory Uint8ClampedList.fromList(List<int> elements) =
-      NativeUint8ClampedList.fromList;
-}
-
-@patch
-class Uint8List {
-  @patch
-  factory Uint8List(int length) = NativeUint8List;
-
-  @patch
-  factory Uint8List.fromList(List<int> elements) = NativeUint8List.fromList;
-}
-
-@patch
-class Int64List {
-  @patch
-  factory Int64List(int length) {
-    throw UnsupportedError("Int64List not supported on the web.");
-  }
-
-  @patch
-  factory Int64List.fromList(List<int> elements) {
-    throw UnsupportedError("Int64List not supported on the web.");
-  }
-}
-
-@patch
-class Uint64List {
-  @patch
-  factory Uint64List(int length) {
-    throw UnsupportedError("Uint64List not supported on the web.");
-  }
-
-  @patch
-  factory Uint64List.fromList(List<int> elements) {
-    throw UnsupportedError("Uint64List not supported on the web.");
-  }
-}
-
-@patch
-class Int32x4List {
-  @patch
-  factory Int32x4List(int length) = NativeInt32x4List;
-
-  @patch
-  factory Int32x4List.fromList(List<Int32x4> elements) =
-      NativeInt32x4List.fromList;
-}
-
-@patch
-class Float32x4List {
-  @patch
-  factory Float32x4List(int length) = NativeFloat32x4List;
-
-  @patch
-  factory Float32x4List.fromList(List<Float32x4> elements) =
-      NativeFloat32x4List.fromList;
-}
-
-@patch
-class Float64x2List {
-  @patch
-  factory Float64x2List(int length) = NativeFloat64x2List;
-
-  @patch
-  factory Float64x2List.fromList(List<Float64x2> elements) =
-      NativeFloat64x2List.fromList;
-}
-
-@patch
-class Float32x4 {
-  @patch
-  factory Float32x4(double x, double y, double z, double w) = NativeFloat32x4;
-  @patch
-  factory Float32x4.splat(double v) = NativeFloat32x4.splat;
-  @patch
-  factory Float32x4.zero() = NativeFloat32x4.zero;
-  @patch
-  factory Float32x4.fromInt32x4Bits(Int32x4 x) =
-      NativeFloat32x4.fromInt32x4Bits;
-  @patch
-  factory Float32x4.fromFloat64x2(Float64x2 v) = NativeFloat32x4.fromFloat64x2;
-}
-
-@patch
-class Int32x4 {
-  @patch
-  factory Int32x4(int x, int y, int z, int w) = NativeInt32x4;
-  @patch
-  factory Int32x4.bool(bool x, bool y, bool z, bool w) = NativeInt32x4.bool;
-  @patch
-  factory Int32x4.fromFloat32x4Bits(Float32x4 x) =
-      NativeInt32x4.fromFloat32x4Bits;
-}
-
-@patch
-class Float64x2 {
-  @patch
-  factory Float64x2(double x, double y) = NativeFloat64x2;
-  @patch
-  factory Float64x2.splat(double v) = NativeFloat64x2.splat;
-  @patch
-  factory Float64x2.zero() = NativeFloat64x2.zero;
-  @patch
-  factory Float64x2.fromFloat32x4(Float32x4 v) = NativeFloat64x2.fromFloat32x4;
-}
diff --git a/sdk_nnbd/lib/_internal/js_runtime/pubspec.yaml b/sdk_nnbd/lib/_internal/js_runtime/pubspec.yaml
deleted file mode 100644
index 821aaac..0000000
--- a/sdk_nnbd/lib/_internal/js_runtime/pubspec.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-# Note: This package is not meant to be uploaded to pub. This file is used to
-# make it easier to develop on dart2js.
-name: js_runtime
-publish_to: none
-environment:
-  sdk: '>=2.0.0 <3.0.0'
diff --git a/sdk_nnbd/lib/_internal/sdk_library_metadata/lib/libraries.dart b/sdk_nnbd/lib/_internal/sdk_library_metadata/lib/libraries.dart
deleted file mode 100644
index ab7da7e..0000000
--- a/sdk_nnbd/lib/_internal/sdk_library_metadata/lib/libraries.dart
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// @dart = 2.5
-
-library libraries;
-
-/**
- * A bit flag used by [LibraryInfo] indicating that a library is used by dart2js
- */
-const int DART2JS_PLATFORM = 1;
-
-/**
- * A bit flag used by [LibraryInfo] indicating that a library is used by the VM
- */
-const int VM_PLATFORM = 2;
-
-/// The contexts that a library can be used from.
-enum Category {
-  /// Indicates that a library can be used in a browser context.
-  client,
-
-  /// Indicates that a library can be used in a command line context.
-  server,
-
-  /// Indicates that a library can be used from embedded devices.
-  embedded
-}
-
-Category parseCategory(String name) {
-  switch (name) {
-    case "Client":
-      return Category.client;
-    case "Server":
-      return Category.server;
-    case "Embedded":
-      return Category.embedded;
-  }
-  return null;
-}
-
-/// Mapping of "dart:" library name (e.g. "core") to information about that
-/// library.
-const Map<String, LibraryInfo> libraries = const {
-  "async": const LibraryInfo("async/async.dart",
-      categories: "Client,Server",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/async_patch.dart"),
-  "collection": const LibraryInfo("collection/collection.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/collection_patch.dart"),
-  "convert": const LibraryInfo("convert/convert.dart",
-      categories: "Client,Server",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/convert_patch.dart"),
-  "core": const LibraryInfo("core/core.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/core_patch.dart"),
-  "developer": const LibraryInfo("developer/developer.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.UNSTABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"),
-  "ffi": const LibraryInfo("ffi/ffi.dart",
-      categories: "Server",
-      // TODO(dacoharkes): Update maturity when we release dart:ffi.
-      // https://github.com/dart-lang/sdk/issues/34452
-      maturity: Maturity.EXPERIMENTAL),
-  "html": const LibraryInfo("html/dart2js/html_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "html_common": const LibraryInfo("html/html_common/html_common.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      dart2jsPath: "html/html_common/html_common_dart2js.dart",
-      documented: false,
-      implementation: true),
-  "indexed_db": const LibraryInfo("indexed_db/dart2js/indexed_db_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "_http":
-      const LibraryInfo("_http/http.dart", categories: "", documented: false),
-  "io": const LibraryInfo("io/io.dart",
-      categories: "Server",
-      dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"),
-  "isolate": const LibraryInfo("isolate/isolate.dart",
-      categories: "Client,Server",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"),
-  "js": const LibraryInfo("js/js.dart",
-      categories: "Client",
-      maturity: Maturity.STABLE,
-      platforms: DART2JS_PLATFORM,
-      dart2jsPatchPath: "_internal/js_runtime/lib/js_patch.dart"),
-  "_js": const LibraryInfo("js/_js.dart",
-      categories: "Client",
-      dart2jsPatchPath: "js/_js_client.dart",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "js_util": const LibraryInfo("js_util/js_util.dart",
-      categories: "Client",
-      maturity: Maturity.STABLE,
-      platforms: DART2JS_PLATFORM),
-  "math": const LibraryInfo("math/math.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/math_patch.dart"),
-  "mirrors": const LibraryInfo("mirrors/mirrors.dart",
-      categories: "Client,Server",
-      maturity: Maturity.UNSTABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/mirrors_patch_cfe.dart"),
-  "nativewrappers": const LibraryInfo("html/dartium/nativewrappers.dart",
-      categories: "Client",
-      implementation: true,
-      documented: false,
-      platforms: VM_PLATFORM),
-  "typed_data": const LibraryInfo("typed_data/typed_data.dart",
-      categories: "Client,Server,Embedded",
-      maturity: Maturity.STABLE,
-      dart2jsPatchPath: "_internal/js_runtime/lib/typed_data_patch.dart"),
-  "_native_typed_data": const LibraryInfo(
-      "_internal/js_runtime/lib/native_typed_data.dart",
-      categories: "",
-      implementation: true,
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "cli": const LibraryInfo("cli/cli.dart",
-      categories: "Server", platforms: VM_PLATFORM),
-  "svg": const LibraryInfo("svg/dart2js/svg_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "wasm": const LibraryInfo("wasm/wasm.dart",
-      categories: "Server", maturity: Maturity.EXPERIMENTAL),
-  "web_audio": const LibraryInfo("web_audio/dart2js/web_audio_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "web_gl": const LibraryInfo("web_gl/dart2js/web_gl_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "web_sql": const LibraryInfo("web_sql/dart2js/web_sql_dart2js.dart",
-      categories: "Client",
-      maturity: Maturity.WEB_STABLE,
-      platforms: DART2JS_PLATFORM),
-  "_internal": const LibraryInfo("internal/internal.dart",
-      categories: "",
-      documented: false,
-      dart2jsPatchPath: "_internal/js_runtime/lib/internal_patch.dart"),
-  "_js_helper": const LibraryInfo("_internal/js_runtime/lib/js_helper.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_rti": const LibraryInfo("_internal/js_runtime/lib/rti.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_interceptors": const LibraryInfo(
-      "_internal/js_runtime/lib/interceptors.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_foreign_helper": const LibraryInfo(
-      "_internal/js_runtime/lib/foreign_helper.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_js_names": const LibraryInfo("_internal/js_runtime/lib/js_names.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_js_primitives": const LibraryInfo(
-      "_internal/js_runtime/lib/js_primitives.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_js_embedded_names": const LibraryInfo(
-      "_internal/js_runtime/lib/shared/embedded_names.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_async_await_error_codes": const LibraryInfo(
-      "_internal/js_runtime/lib/shared/async_await_error_codes.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_recipe_syntax": const LibraryInfo(
-      "_internal/js_runtime/lib/shared/recipe_syntax.dart",
-      categories: "",
-      documented: false,
-      platforms: DART2JS_PLATFORM),
-  "_metadata": const LibraryInfo("html/html_common/metadata.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-  "_js_annotations": const LibraryInfo("js/_js_annotations.dart",
-      categories: "", documented: false, platforms: DART2JS_PLATFORM),
-};
-
-/**
- * Information about a "dart:" library.
- */
-class LibraryInfo {
-  /**
-   * Path to the library's *.dart file relative to this file.
-   */
-  final String path;
-
-  /**
-   * The categories in which the library can be used encoded as a
-   * comma-separated String.
-   */
-  final String _categories;
-
-  /**
-   * Path to the dart2js library's *.dart file relative to this file
-   * or null if dart2js uses the common library path defined above.
-   * Access using the [#getDart2JsPath()] method.
-   */
-  final String dart2jsPath;
-
-  /**
-   * Path to the dart2js library's patch file relative to this file
-   * or null if no dart2js patch file associated with this library.
-   * Access using the [#getDart2JsPatchPath()] method.
-   */
-  final String dart2jsPatchPath;
-
-  /**
-   * True if this library is documented and should be shown to the user.
-   */
-  final bool documented;
-
-  /**
-   * Bit flags indicating which platforms consume this library.
-   * See [DART2JS_LIBRARY] and [VM_LIBRARY].
-   */
-  final int platforms;
-
-  /**
-   * True if the library contains implementation details for another library.
-   * The implication is that these libraries are less commonly used
-   * and that tools like Dart Editor should not show these libraries
-   * in a list of all libraries unless the user specifically asks the tool to
-   * do so.
-   */
-  final bool implementation;
-
-  /**
-   * States the current maturity of this library.
-   */
-  final Maturity maturity;
-
-  const LibraryInfo(this.path,
-      {String categories: "",
-      this.dart2jsPath,
-      this.dart2jsPatchPath,
-      this.implementation: false,
-      this.documented: true,
-      this.maturity: Maturity.UNSPECIFIED,
-      this.platforms: DART2JS_PLATFORM | VM_PLATFORM})
-      : _categories = categories;
-
-  bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0;
-  bool get isVmLibrary => (platforms & VM_PLATFORM) != 0;
-
-  /**
-   * The categories in which the library can be used.
-   *
-   * If no categories are specified, the library is internal and can not be
-   * loaded by user code.
-   */
-  List<Category> get categories {
-    // `"".split(,)` returns [""] not [], so we handle that case separately.
-    if (_categories == "") return const <Category>[];
-    return _categories.split(",").map(parseCategory).toList();
-  }
-
-  bool get isInternal => categories.isEmpty;
-
-  /// The original "categories" String that was passed to the constructor.
-  ///
-  /// Can be used to construct a slightly modified copy of this LibraryInfo.
-  String get categoriesString {
-    return _categories;
-  }
-}
-
-/**
- * Abstraction to capture the maturity of a library.
- */
-class Maturity {
-  final int level;
-  final String name;
-  final String description;
-
-  const Maturity(this.level, this.name, this.description);
-
-  String toString() => "$name: $level\n$description\n";
-
-  static const Maturity DEPRECATED = const Maturity(0, "Deprecated",
-      "This library will be remove before next major release.");
-
-  static const Maturity EXPERIMENTAL = const Maturity(
-      1,
-      "Experimental",
-      "This library is experimental and will likely change or be removed\n"
-          "in future versions.");
-
-  static const Maturity UNSTABLE = const Maturity(
-      2,
-      "Unstable",
-      "This library is in still changing and have not yet endured\n"
-          "sufficient real-world testing.\n"
-          "Backwards-compatibility is NOT guaranteed.");
-
-  static const Maturity WEB_STABLE = const Maturity(
-      3,
-      "Web Stable",
-      "This library is tracking the DOM evolution as defined by WC3.\n"
-          "Backwards-compatibility is NOT guaranteed.");
-
-  static const Maturity STABLE = const Maturity(
-      4,
-      "Stable",
-      "The library is stable. API backwards-compatibility is guaranteed.\n"
-          "However implementation details might change.");
-
-  static const Maturity LOCKED = const Maturity(5, "Locked",
-      "This library will not change except when serious bugs are encountered.");
-
-  static const Maturity UNSPECIFIED = const Maturity(-1, "Unspecified",
-      "The maturity for this library has not been specified.");
-}
diff --git a/sdk_nnbd/lib/_internal/sdk_library_metadata/pubspec.yaml b/sdk_nnbd/lib/_internal/sdk_library_metadata/pubspec.yaml
deleted file mode 100644
index 08b5518..0000000
--- a/sdk_nnbd/lib/_internal/sdk_library_metadata/pubspec.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-# Note: This package is not meant to be uploaded to pub. This file is used to
-# make it easer to depend on libraries.dart from sdk packages like dart2js.
-name: sdk_library_metadata
-publish_to: none
-environment:
-  sdk: '>=2.0.0 <3.0.0'
diff --git a/sdk_nnbd/lib/_internal/vm/bin/builtin.dart b/sdk_nnbd/lib/_internal/vm/bin/builtin.dart
deleted file mode 100644
index 59f9392..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/builtin.dart
+++ /dev/null
@@ -1,627 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library builtin;
-
-// NOTE: Do not import 'dart:io' in builtin.
-import 'dart:async';
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' hide Symbol;
-import 'dart:io';
-import 'dart:convert';
-import 'dart:isolate';
-import 'dart:typed_data';
-
-// Embedder sets this to true if the --trace-loading flag was passed on the
-// command line.
-bool _traceLoading = false;
-
-// Before handling an embedder entrypoint we finalize the setup of the
-// dart:_builtin library.
-bool _setupCompleted = false;
-
-// 'print' implementation.
-// The standalone embedder registers the closurized _print function with the
-// dart:core library.
-void _printString(String s) native "Builtin_PrintString";
-
-void _print(arg) {
-  _printString(arg.toString());
-}
-
-@pragma("vm:entry-point")
-_getPrintClosure() => _print;
-
-// The current working directory when the embedder was launched.
-late Uri _workingDirectory;
-
-// The URI that the root script was loaded from. Remembered so that
-// package imports can be resolved relative to it. The root script is the basis
-// for the root library in the VM.
-Uri? _rootScript;
-
-// packagesConfig specified for the isolate.
-Uri? _packagesConfigUri;
-
-// Packages are either resolved looking up in a map or resolved from within a
-// package root.
-bool get _packagesReady => (_packageMap != null) || (_packageError != null);
-
-// Error string set if there was an error resolving package configuration.
-// For example not finding a .packages file or packages/ directory, malformed
-// .packages file or any other related error.
-String? _packageError = null;
-
-// The map describing how certain package names are mapped to Uris.
-Uri? _packageConfig = null;
-Map<String, Uri>? _packageMap = null;
-
-// Special handling for Windows paths so that they are compatible with URI
-// handling.
-// Embedder sets this to true if we are running on Windows.
-@pragma("vm:entry-point")
-bool _isWindows = false;
-
-// Logging from builtin.dart is prefixed with a '*'.
-String _logId = (Isolate.current.hashCode % 0x100000).toRadixString(16);
-_log(msg) {
-  _print("* $_logId $msg");
-}
-
-_sanitizeWindowsPath(path) {
-  // For Windows we need to massage the paths a bit according to
-  // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx
-  //
-  // Convert
-  // C:\one\two\three
-  // to
-  // /C:/one/two/three
-
-  if (_isWindows == false) {
-    // Do nothing when not running Windows.
-    return path;
-  }
-
-  var fixedPath = "${path.replaceAll('\\', '/')}";
-
-  if ((path.length > 2) && (path[1] == ':')) {
-    // Path begins with a drive letter.
-    return '/$fixedPath';
-  }
-
-  return fixedPath;
-}
-
-_setPackagesConfig(String packagesParam) {
-  var packagesName = _sanitizeWindowsPath(packagesParam);
-  var packagesUri = Uri.parse(packagesName);
-  if (packagesUri.scheme == '') {
-    // Script does not have a scheme, assume that it is a path,
-    // resolve it against the working directory.
-    packagesUri = _workingDirectory.resolveUri(packagesUri);
-  }
-  _packagesConfigUri = packagesUri;
-}
-
-// Given a uri with a 'package' scheme, return a Uri that is prefixed with
-// the package root or resolved relative to the package configuration.
-Uri _resolvePackageUri(Uri uri) {
-  assert(uri.scheme == "package");
-  assert(_packagesReady);
-
-  if (uri.host.isNotEmpty) {
-    var path = '${uri.host}${uri.path}';
-    var right = 'package:$path';
-    var wrong = 'package://$path';
-
-    throw "URIs using the 'package:' scheme should look like "
-        "'$right', not '$wrong'.";
-  }
-
-  var packageNameEnd = uri.path.indexOf('/');
-  if (packageNameEnd == 0) {
-    // Package URIs must have a non-empty package name (not start with "/").
-    throw "URIS using the 'package:' scheme should look like "
-        "'package:packageName${uri.path}', not 'package:${uri.path}'";
-  }
-  if (_traceLoading) {
-    _log('Resolving package with uri path: ${uri.path}');
-  }
-  var resolvedUri;
-  final error = _packageError;
-  if (error != null) {
-    if (_traceLoading) {
-      _log("Resolving package with pending resolution error: $error");
-    }
-    throw error;
-  } else {
-    if (packageNameEnd < 0) {
-      // Package URIs must have a path after the package name, even if it's
-      // just "/".
-      throw "URIS using the 'package:' scheme should look like "
-          "'package:${uri.path}/', not 'package:${uri.path}'";
-    }
-    var packageName = uri.path.substring(0, packageNameEnd);
-    final mapping = _packageMap![packageName];
-    if (_traceLoading) {
-      _log("Mapped '$packageName' package to '$mapping'");
-    }
-    if (mapping == null) {
-      throw "No mapping for '$packageName' package when resolving '$uri'.";
-    }
-    var path;
-    assert(uri.path.length > packageName.length);
-    path = uri.path.substring(packageName.length + 1);
-    if (_traceLoading) {
-      _log("Path to be resolved in package: $path");
-    }
-    resolvedUri = mapping.resolve(path);
-  }
-  if (_traceLoading) {
-    _log("Resolved '$uri' to '$resolvedUri'.");
-  }
-  return resolvedUri;
-}
-
-void _requestPackagesMap(Uri? packageConfig) {
-  dynamic msg = null;
-  if (packageConfig != null) {
-    // Explicitly specified .packages path.
-    msg = _handlePackagesRequest(_traceLoading, -2, packageConfig);
-  } else {
-    // Search for .packages starting at the root script.
-    msg = _handlePackagesRequest(_traceLoading, -1, _rootScript!);
-  }
-  if (_traceLoading) {
-    _log("Requested packages map for '$_rootScript'.");
-  }
-  if (msg is String) {
-    if (_traceLoading) {
-      _log("Got failure response on package port: '$msg'");
-    }
-    // Remember the error message.
-    _packageError = msg;
-  } else if (msg is List) {
-    // First entry contains the location of the loaded .packages file.
-    assert((msg.length % 2) == 0);
-    assert(msg.length >= 2);
-    assert(msg[1] == null);
-    _packageConfig = Uri.parse(msg[0]);
-    final pmap = new Map<String, Uri>();
-    _packageMap = pmap;
-    for (var i = 2; i < msg.length; i += 2) {
-      // TODO(iposva): Complain about duplicate entries.
-      pmap[msg[i]] = Uri.parse(msg[i + 1]);
-    }
-    if (_traceLoading) {
-      _log("Setup package map: $_packageMap");
-    }
-  } else {
-    _packageError = "Bad type of packages reply: ${msg.runtimeType}";
-    if (_traceLoading) {
-      _log(_packageError);
-    }
-  }
-}
-
-// The values go from ' ' to DEL and `x` means disallowed.
-const String _invalidPackageNameChars =
-    'x.xx.x.........x..........x.x.xx...........................xxxx.x..........................xxx.x';
-
-bool _isValidPackageName(String packageName) {
-  const space = 0x20;
-  const del = 0x7F;
-  const dot = 0x2e;
-  const lowerX = 0x78;
-  for (int i = 0; i < packageName.length; ++i) {
-    final int char = packageName.codeUnitAt(i);
-    if (char < space || del < char) {
-      return false;
-    }
-    final int allowed = _invalidPackageNameChars.codeUnitAt(char - space);
-    assert(allowed == dot || allowed == lowerX);
-    if (allowed == lowerX) {
-      return false;
-    }
-  }
-  return true;
-}
-
-_parsePackagesFile(bool traceLoading, Uri packagesFile, String data) {
-  // The first entry contains the location of the identified .packages file
-  // instead of a mapping.
-  final List result = [packagesFile.toString(), null];
-
-  final lines = LineSplitter.split(data);
-  for (String line in lines) {
-    final hashIndex = line.indexOf('#');
-    if (hashIndex == 0) {
-      continue;
-    }
-    if (hashIndex > 0) {
-      line = line.substring(0, hashIndex);
-    }
-    line = line.trimRight();
-    if (line.isEmpty) {
-      continue;
-    }
-
-    final colonIndex = line.indexOf(':');
-    if (colonIndex <= 0) {
-      return 'Line in "$packagesFile" should be of the format '
-          '`<package-name>:<path>" but was: "$line"';
-    }
-    final packageName = line.substring(0, colonIndex);
-    if (!_isValidPackageName(packageName)) {
-      return 'Package name in $packagesFile contains disallowed characters ('
-          'was: "$packageName")';
-    }
-
-    String packageUri = line.substring(colonIndex + 1);
-    if (traceLoading) {
-      _log("packageName: $packageName");
-      _log("packageUri: $packageUri");
-    }
-    // Ensure the package uri ends with a /.
-    if (!packageUri.endsWith('/')) {
-      packageUri += '/';
-    }
-    final resolvedPackageUri = packagesFile.resolve(packageUri).toString();
-    if (traceLoading) {
-      _log("mapping: $packageName -> $resolvedPackageUri");
-    }
-    result.add(packageName);
-    result.add(resolvedPackageUri);
-  }
-  if (traceLoading) {
-    _log("Parsed packages file at $packagesFile. Sending:\n$result");
-  }
-  return result;
-}
-
-// The .dart_tool/package_config.json format is described in
-//
-// https://github.com/dart-lang/language/blob/master/accepted/future-releases/language-versioning/package-config-file-v2.md
-//
-// The returned list has the format:
-//
-//    [0] Location of package_config.json file.
-//    [1] null
-//    [n*2] Name of n-th package
-//    [n*2 + 1] Location of n-th package's sources (as a String)
-//
-List _parsePackageConfig(bool traceLoading, Uri packageConfig, String data) {
-  final Map packageJson = json.decode(data);
-  final version = packageJson['configVersion'];
-  if (version != 2) {
-    throw 'The package configuration file has an unsupported version.';
-  }
-  // The first entry contains the location of the identified
-  // .dart_tool/package_config.json file instead of a mapping.
-  final result = <dynamic>[packageConfig.toString(), null];
-  final List packages = packageJson['packages'] ?? [];
-  for (final Map package in packages) {
-    String rootUri = package['rootUri'];
-    if (!rootUri.endsWith('/')) rootUri += '/';
-    final String packageName = package['name'];
-    final String? packageUri = package['packageUri'];
-    final Uri resolvedRootUri = packageConfig.resolve(rootUri);
-    final Uri resolvedPackageUri = packageUri != null
-        ? resolvedRootUri.resolve(packageUri)
-        : resolvedRootUri;
-    if (packageUri != null &&
-        !'$resolvedPackageUri'.contains('$resolvedRootUri')) {
-      throw 'The resolved "packageUri" is not a subdirectory of the "rootUri".';
-    }
-    if (!_isValidPackageName(packageName)) {
-      throw 'Package name in $packageConfig contains disallowed characters ('
-          'was: "$packageName")';
-    }
-    result.add(packageName);
-    result.add(resolvedPackageUri.toString());
-    if (traceLoading) {
-      _log('Resolved package "$packageName" to be at $resolvedPackageUri');
-    }
-  }
-  return result;
-}
-
-_findPackagesConfiguration(bool traceLoading, Uri base) {
-  try {
-    // Walk up the directory hierarchy to check for the existence of either one
-    // of
-    //   - .packages (preferred)
-    //   - .dart_tool/package_config.json
-    var currentDir = new File.fromUri(base).parent;
-    while (true) {
-      final dirUri = currentDir.uri;
-
-      // We prefer using `.dart_tool/package_config.json` over `.packages`.
-      final packageConfig = dirUri.resolve(".dart_tool/package_config.json");
-      if (traceLoading) {
-        _log("Checking for $packageConfig file.");
-      }
-      File file = File.fromUri(packageConfig);
-      bool exists = file.existsSync();
-      if (traceLoading) {
-        _log("$packageConfig exists: $exists");
-      }
-      if (exists) {
-        final data = utf8.decode(file.readAsBytesSync());
-        if (traceLoading) {
-          _log("Loaded package config file from $packageConfig:$data\n");
-        }
-        return _parsePackageConfig(traceLoading, packageConfig, data);
-      }
-
-      // We fallback to using `.packages` if it exists.
-      final packagesFile = dirUri.resolve(".packages");
-      if (traceLoading) {
-        _log("Checking for $packagesFile file.");
-      }
-      file = File.fromUri(packagesFile);
-      exists = file.existsSync();
-      if (traceLoading) {
-        _log("$packagesFile exists: $exists");
-      }
-      if (exists) {
-        final String data = utf8.decode(file.readAsBytesSync());
-        if (traceLoading) {
-          _log("Loaded packages file from $packagesFile:\n$data");
-        }
-        return _parsePackagesFile(traceLoading, packagesFile, data);
-      }
-
-      final parentDir = currentDir.parent;
-      if (dirUri == parentDir.uri) break;
-      currentDir = parentDir;
-    }
-
-    if (traceLoading) {
-      _log("Could not resolve a package configuration from $base");
-    }
-    return "Could not resolve a package configuration for base at $base";
-  } catch (e, s) {
-    if (traceLoading) {
-      _log("Error loading packages: $e\n$s");
-    }
-    return "Uncaught error ($e) loading packages file.";
-  }
-}
-
-int _indexOfFirstNonWhitespaceCharacter(String data) {
-  // Whitespace characters ignored in JSON spec:
-  // https://tools.ietf.org/html/rfc7159
-  const tab = 0x09;
-  const lf = 0x0A;
-  const cr = 0x0D;
-  const space = 0x20;
-
-  int index = 0;
-  while (index < data.length) {
-    final int char = data.codeUnitAt(index);
-    if (char != lf && char != cr && char != space && char != tab) {
-      break;
-    }
-    index++;
-  }
-  return index;
-}
-
-bool _canBeValidJson(String data) {
-  const int openCurly = 0x7B;
-  final int index = _indexOfFirstNonWhitespaceCharacter(data);
-  return index < data.length && data.codeUnitAt(index) == openCurly;
-}
-
-_parsePackageConfiguration(bool traceLoading, Uri resource, Uint8List bytes) {
-  try {
-    final data = utf8.decode(bytes);
-    if (_canBeValidJson(data)) {
-      return _parsePackageConfig(traceLoading, resource, data);
-    } else {
-      return _parsePackagesFile(traceLoading, resource, data);
-    }
-  } catch (e) {
-    return "The resource '$resource' is neither a valid '.packages' file nor "
-        "a valid '.dart_tool/package_config.json' file.";
-  }
-}
-
-bool _isValidUtf8DataUrl(UriData data) {
-  final mime = data.mimeType;
-  if (mime != "text/plain") {
-    return false;
-  }
-  final charset = data.charset;
-  if (charset != "utf-8" && charset != "US-ASCII") {
-    return false;
-  }
-  return true;
-}
-
-_handlePackagesRequest(bool traceLoading, int tag, Uri resource) {
-  try {
-    if (tag == -1) {
-      if (resource.scheme == '' || resource.scheme == 'file') {
-        return _findPackagesConfiguration(traceLoading, resource);
-      } else {
-        return "Unsupported scheme used to locate .packages file:'$resource'.";
-      }
-    } else if (tag == -2) {
-      if (traceLoading) {
-        _log("Handling load of packages map: '$resource'.");
-      }
-      late Uint8List bytes;
-      if (resource.scheme == '' || resource.scheme == 'file') {
-        final file = File.fromUri(resource);
-        if (!file.existsSync()) {
-          return "Packages file '$resource' does not exit.";
-        }
-        bytes = file.readAsBytesSync();
-      } else if (resource.scheme == 'data') {
-        final uriData = resource.data!;
-        if (!_isValidUtf8DataUrl(uriData)) {
-          return "The data resource '$resource' must have a 'text/plain' mime "
-              "type and a 'utf-8' or 'US-ASCII' charset.";
-        }
-        bytes = uriData.contentAsBytes();
-      } else {
-        return "Unknown scheme (${resource.scheme}) for package file at "
-            "'$resource'.";
-      }
-      return _parsePackageConfiguration(traceLoading, resource, bytes);
-    } else {
-      return "Unknown packages request tag: $tag for '$resource'.";
-    }
-  } catch (e, s) {
-    if (traceLoading) {
-      _log("Error handling packages request: $e\n$s");
-    }
-    return "Uncaught error ($e) handling packages request.";
-  }
-}
-
-// Embedder Entrypoint:
-// The embedder calls this method to initial the package resolution state.
-@pragma("vm:entry-point")
-void _Init(String packagesConfig, String workingDirectory, String rootScript) {
-  // Register callbacks and hooks with the rest of core libraries.
-  _setupHooks();
-
-  // _workingDirectory must be set first.
-  _workingDirectory = new Uri.directory(workingDirectory);
-
-  // setup _rootScript.
-  if (rootScript != null) {
-    _rootScript = Uri.parse(rootScript);
-  }
-
-  // If the --packages flag was passed, setup _packagesConfig.
-  if (packagesConfig != null) {
-    _packageMap = null;
-    _setPackagesConfig(packagesConfig);
-  }
-}
-
-// Embedder Entrypoint:
-// The embedder calls this method with the current working directory.
-@pragma("vm:entry-point")
-void _setWorkingDirectory(String cwd) {
-  if (!_setupCompleted) {
-    _setupHooks();
-  }
-  if (_traceLoading) {
-    _log('Setting working directory: $cwd');
-  }
-  _workingDirectory = new Uri.directory(cwd);
-  if (_traceLoading) {
-    _log('Working directory URI: $_workingDirectory');
-  }
-}
-
-// Embedder Entrypoint:
-// The embedder calls this method with the value of the --packages command line
-// option. It can point to a ".packages" or a ".dart_tool/package_config.json"
-// file.
-@pragma("vm:entry-point")
-String _setPackagesMap(String packagesParam) {
-  if (!_setupCompleted) {
-    _setupHooks();
-  }
-  // First convert the packages parameter from the command line to a URI which
-  // can be handled by the loader code.
-  // TODO(iposva): Consider refactoring the common code below which is almost
-  // shared with resolution of the root script.
-  if (_traceLoading) {
-    _log("Resolving packages map: $packagesParam");
-  }
-  var packagesName = _sanitizeWindowsPath(packagesParam);
-  var packagesUri = Uri.parse(packagesName);
-  if (packagesUri.scheme == '') {
-    // Script does not have a scheme, assume that it is a path,
-    // resolve it against the working directory.
-    packagesUri = _workingDirectory.resolveUri(packagesUri);
-  }
-  var packagesUriStr = packagesUri.toString();
-  VMLibraryHooks.packageConfigString = packagesUriStr;
-  if (_traceLoading) {
-    _log('Resolved packages map to: $packagesUri');
-  }
-  return packagesUriStr;
-}
-
-// Resolves the script uri in the current working directory iff the given uri
-// did not specify a scheme (e.g. a path to a script file on the command line).
-@pragma("vm:entry-point")
-String _resolveScriptUri(String scriptName) {
-  if (_traceLoading) {
-    _log("Resolving script: $scriptName");
-  }
-  scriptName = _sanitizeWindowsPath(scriptName);
-
-  var scriptUri = Uri.parse(scriptName);
-  if (scriptUri.scheme == '') {
-    // Script does not have a scheme, assume that it is a path,
-    // resolve it against the working directory.
-    scriptUri = _workingDirectory.resolveUri(scriptUri);
-  }
-
-  // Remember the root script URI so that we can resolve packages based on
-  // this location.
-  _rootScript = scriptUri;
-
-  if (_traceLoading) {
-    _log('Resolved entry point to: $_rootScript');
-  }
-  return scriptUri.toString();
-}
-
-// Register callbacks and hooks with the rest of the core libraries.
-@pragma("vm:entry-point")
-_setupHooks() {
-  _setupCompleted = true;
-  VMLibraryHooks.packageConfigUriFuture = _getPackageConfigFuture;
-  VMLibraryHooks.resolvePackageUriFuture = _resolvePackageUriFuture;
-}
-
-Future<Uri?> _getPackageConfigFuture() {
-  if (_traceLoading) {
-    _log("Request for package config from user code.");
-  }
-  if (!_packagesReady) {
-    _requestPackagesMap(_packagesConfigUri);
-  }
-  // Respond with the packages config (if any) after package resolution.
-  return Future.value(_packageConfig);
-}
-
-Future<Uri?> _resolvePackageUriFuture(Uri packageUri) {
-  if (_traceLoading) {
-    _log("Request for package Uri resolution from user code: $packageUri");
-  }
-  if (packageUri.scheme != "package") {
-    if (_traceLoading) {
-      _log("Non-package Uri, returning unmodified: $packageUri");
-    }
-    // Return the incoming parameter if not passed a package: URI.
-    return Future.value(packageUri);
-  }
-  if (!_packagesReady) {
-    _requestPackagesMap(_packagesConfigUri);
-  }
-  Uri? resolvedUri;
-  try {
-    resolvedUri = _resolvePackageUri(packageUri);
-  } catch (e, s) {
-    if (_traceLoading) {
-      _log("Exception when resolving package URI: $packageUri:\n$e\n$s");
-    }
-    resolvedUri = null;
-  }
-  if (_traceLoading) {
-    _log("Resolved '$packageUri' to '$resolvedUri'");
-  }
-  return Future.value(resolvedUri);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/cli_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/cli_patch.dart
deleted file mode 100644
index 504a0db..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/cli_patch.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "dart:_internal" show patch;
-
-@patch
-void _waitForEvent(int timeoutMillis) native "CLI_WaitForEvent";
diff --git a/sdk_nnbd/lib/_internal/vm/bin/common_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/common_patch.dart
deleted file mode 100644
index 9899f2e..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/common_patch.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:io" which contains all the imports used by
-/// patches of that library. We plan to change this when we have a shared front
-/// end and simply use parts.
-
-import "dart:_internal" show VMLibraryHooks, patch, checkNotNullable, ClassID;
-
-import "dart:async"
-    show
-        Completer,
-        Future,
-        Stream,
-        StreamConsumer,
-        StreamController,
-        StreamSubscription,
-        Timer,
-        Zone,
-        scheduleMicrotask;
-
-import "dart:collection" show HashMap;
-
-import "dart:convert" show Encoding, utf8;
-
-import "dart:developer" show registerExtension;
-
-import "dart:isolate" show RawReceivePort, ReceivePort, SendPort;
-
-import "dart:math" show min;
-
-import "dart:nativewrappers" show NativeFieldWrapperClass1;
-
-import "dart:typed_data" show Uint8List;
-
-/// These are the additional parts of this patch library:
-// part "directory_patch.dart";
-// part "eventhandler_patch.dart";
-// part "file_patch.dart";
-// part "file_system_entity_patch.dart";
-// part "filter_patch.dart";
-// part "io_service_patch.dart";
-// part "platform_patch.dart";
-// part "process_patch.dart";
-// part "socket_patch.dart";
-// part "stdio_patch.dart";
-// part "secure_socket_patch.dart";
-// part "sync_socket_patch.dart";
-
-@patch
-bool _isDirectIOCapableTypedList(List<int> buffer) {
-  int classID = ClassID.getID(buffer);
-  return classID == ClassID.cidExternalInt8Array ||
-      classID == ClassID.cidExternalUint8Array ||
-      classID == ClassID.cidExternalUint8ClampedArray ||
-      classID == ClassID.cidInt8Array ||
-      classID == ClassID.cidInt8ArrayView ||
-      classID == ClassID.cidUint8Array ||
-      classID == ClassID.cidUint8ArrayView ||
-      classID == ClassID.cidUint8ClampedArray;
-}
-
-@patch
-class _IOCrypto {
-  @patch
-  static Uint8List getRandomBytes(int count) native "Crypto_GetRandomBytes";
-}
-
-@pragma("vm:entry-point", "call")
-_setupHooks() {
-  VMLibraryHooks.eventHandlerSendData = _EventHandler._sendData;
-  VMLibraryHooks.timerMillisecondClock = _EventHandler._timerMillisecondClock;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/directory_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/directory_patch.dart
deleted file mode 100644
index 7549f72..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/directory_patch.dart
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class _Directory {
-  @patch
-  static _current(_Namespace namespace) native "Directory_Current";
-  @patch
-  static _setCurrent(_Namespace namespace, Uint8List rawPath)
-      native "Directory_SetCurrent";
-  @patch
-  static _createTemp(_Namespace namespace, Uint8List rawPath)
-      native "Directory_CreateTemp";
-  @patch
-  static String _systemTemp(_Namespace namespace) native "Directory_SystemTemp";
-  @patch
-  static _exists(_Namespace namespace, Uint8List rawPath)
-      native "Directory_Exists";
-  @patch
-  static _create(_Namespace namespace, Uint8List rawPath)
-      native "Directory_Create";
-  @patch
-  static _deleteNative(_Namespace namespace, Uint8List rawPath, bool recursive)
-      native "Directory_Delete";
-  @patch
-  static _rename(_Namespace namespace, Uint8List rawPath, String newPath)
-      native "Directory_Rename";
-  @patch
-  static void _fillWithDirectoryListing(
-      _Namespace namespace,
-      List<FileSystemEntity> list,
-      Uint8List rawPath,
-      bool recursive,
-      bool followLinks) native "Directory_FillWithDirectoryListing";
-}
-
-@patch
-class _AsyncDirectoryListerOps {
-  @patch
-  factory _AsyncDirectoryListerOps(int pointer) =>
-      new _AsyncDirectoryListerOpsImpl(pointer);
-}
-
-class _AsyncDirectoryListerOpsImpl extends NativeFieldWrapperClass1
-    implements _AsyncDirectoryListerOps {
-  _AsyncDirectoryListerOpsImpl._();
-
-  factory _AsyncDirectoryListerOpsImpl(int pointer) =>
-      new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer);
-
-  void _setPointer(int pointer)
-      native "Directory_SetAsyncDirectoryListerPointer";
-  int getPointer() native "Directory_GetAsyncDirectoryListerPointer";
-}
-
-// Corelib 'Uri.base' implementation.
-// Uri.base is susceptible to changes in the current working directory.
-Uri _uriBaseClosure() {
-  var result = _Directory._current(_Namespace._namespace);
-  if (result is OSError) {
-    throw new FileSystemException(
-        "Getting current working directory failed", "", result);
-  }
-  return new Uri.directory(result);
-}
-
-@pragma("vm:entry-point", "call")
-_getUriBaseClosure() => _uriBaseClosure;
diff --git a/sdk_nnbd/lib/_internal/vm/bin/eventhandler_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/eventhandler_patch.dart
deleted file mode 100644
index 072d995..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/eventhandler_patch.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class _EventHandler {
-  @patch
-  static void _sendData(Object? sender, SendPort sendPort, int data)
-      native "EventHandler_SendData";
-
-  static int _timerMillisecondClock()
-      native "EventHandler_TimerMillisecondClock";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/file_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/file_patch.dart
deleted file mode 100644
index 033abea..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/file_patch.dart
+++ /dev/null
@@ -1,440 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class _File {
-  @patch
-  static _exists(_Namespace namespace, Uint8List rawPath) native "File_Exists";
-  @patch
-  static _create(_Namespace namespace, Uint8List rawPath) native "File_Create";
-  @patch
-  static _createLink(_Namespace namespace, Uint8List rawPath, String target)
-      native "File_CreateLink";
-  @patch
-  static _linkTarget(_Namespace namespace, Uint8List rawPath)
-      native "File_LinkTarget";
-  @patch
-  static _deleteNative(_Namespace namespace, Uint8List rawPath)
-      native "File_Delete";
-  @patch
-  static _deleteLinkNative(_Namespace namespace, Uint8List rawPath)
-      native "File_DeleteLink";
-  @patch
-  static _rename(_Namespace namespace, Uint8List oldPath, String newPath)
-      native "File_Rename";
-  @patch
-  static _renameLink(_Namespace namespace, Uint8List oldPath, String newPath)
-      native "File_RenameLink";
-  @patch
-  static _copy(_Namespace namespace, Uint8List oldPath, String newPath)
-      native "File_Copy";
-  @patch
-  static _lengthFromPath(_Namespace namespace, Uint8List rawPath)
-      native "File_LengthFromPath";
-  @patch
-  static _lastModified(_Namespace namespace, Uint8List rawPath)
-      native "File_LastModified";
-  @patch
-  static _setLastModified(_Namespace namespace, Uint8List rawPath, int millis)
-      native "File_SetLastModified";
-  @patch
-  static _lastAccessed(_Namespace namespace, Uint8List rawPath)
-      native "File_LastAccessed";
-  @patch
-  static _setLastAccessed(_Namespace namespace, Uint8List rawPath, int millis)
-      native "File_SetLastAccessed";
-  @patch
-  static _open(_Namespace namespace, Uint8List rawPath, int mode)
-      native "File_Open";
-  @patch
-  static int _openStdio(int fd) native "File_OpenStdio";
-}
-
-@patch
-class _RandomAccessFileOps {
-  @patch
-  factory _RandomAccessFileOps(int pointer) =>
-      new _RandomAccessFileOpsImpl(pointer);
-}
-
-@pragma("vm:entry-point")
-class _RandomAccessFileOpsImpl extends NativeFieldWrapperClass1
-    implements _RandomAccessFileOps {
-  _RandomAccessFileOpsImpl._();
-
-  factory _RandomAccessFileOpsImpl(int pointer) =>
-      new _RandomAccessFileOpsImpl._().._setPointer(pointer);
-
-  void _setPointer(int pointer) native "File_SetPointer";
-
-  int getPointer() native "File_GetPointer";
-  int close() native "File_Close";
-  readByte() native "File_ReadByte";
-  read(int bytes) native "File_Read";
-  readInto(List<int> buffer, int start, int? end) native "File_ReadInto";
-  writeByte(int value) native "File_WriteByte";
-  writeFrom(List<int> buffer, int start, int? end) native "File_WriteFrom";
-  position() native "File_Position";
-  setPosition(int position) native "File_SetPosition";
-  truncate(int length) native "File_Truncate";
-  length() native "File_Length";
-  flush() native "File_Flush";
-  lock(int lock, int start, int end) native "File_Lock";
-}
-
-class _WatcherPath {
-  final int pathId;
-  final String path;
-  final int events;
-  int count = 0;
-  _WatcherPath(this.pathId, this.path, this.events);
-}
-
-@patch
-abstract class _FileSystemWatcher {
-  void _pathWatchedEnd();
-
-  static int? _id;
-  static final Map<int, _WatcherPath> _idMap = {};
-
-  final String _path;
-  final int _events;
-  final bool _recursive;
-
-  _WatcherPath? _watcherPath;
-
-  final StreamController<FileSystemEvent> _broadcastController =
-      new StreamController<FileSystemEvent>.broadcast();
-
-  @patch
-  static Stream<FileSystemEvent> _watch(
-      String path, int events, bool recursive) {
-    if (Platform.isLinux) {
-      return new _InotifyFileSystemWatcher(path, events, recursive)._stream;
-    }
-    if (Platform.isWindows) {
-      return new _Win32FileSystemWatcher(path, events, recursive)._stream;
-    }
-    if (Platform.isMacOS) {
-      return new _FSEventStreamFileSystemWatcher(path, events, recursive)
-          ._stream;
-    }
-    throw new FileSystemException(
-        "File system watching is not supported on this platform");
-  }
-
-  _FileSystemWatcher._(this._path, this._events, this._recursive) {
-    if (!isSupported) {
-      throw new FileSystemException(
-          "File system watching is not supported on this platform", _path);
-    }
-    _broadcastController
-      ..onListen = _listen
-      ..onCancel = _cancel;
-  }
-
-  Stream<FileSystemEvent> get _stream => _broadcastController.stream;
-
-  void _listen() {
-    if (_id == null) {
-      try {
-        _id = _initWatcher();
-        _newWatcher();
-      } on dynamic catch (e) {
-        _broadcastController.addError(new FileSystemException(
-            "Failed to initialize file system entity watcher", null, e));
-        _broadcastController.close();
-        return;
-      }
-    }
-    var pathId;
-    try {
-      pathId =
-          _watchPath(_id!, _Namespace._namespace, _path, _events, _recursive);
-    } on dynamic catch (e) {
-      _broadcastController
-          .addError(new FileSystemException("Failed to watch path", _path, e));
-      _broadcastController.close();
-      return;
-    }
-    if (!_idMap.containsKey(pathId)) {
-      _idMap[pathId] = new _WatcherPath(pathId, _path, _events);
-    }
-    _watcherPath = _idMap[pathId];
-    _watcherPath!.count++;
-    _pathWatched().pipe(_broadcastController);
-  }
-
-  void _cancel() {
-    final watcherPath = _watcherPath;
-    if (watcherPath != null) {
-      assert(watcherPath.count > 0);
-      watcherPath.count--;
-      if (watcherPath.count == 0) {
-        _unwatchPath(_id!, watcherPath.pathId);
-        _pathWatchedEnd();
-        _idMap.remove(watcherPath.pathId);
-      }
-      _watcherPath = null;
-    }
-    final id = _id;
-    if (_idMap.isEmpty && id != null) {
-      _closeWatcher(id);
-      _doneWatcher();
-      _id = null;
-    }
-  }
-
-  // Called when (and after) a new watcher instance is created and available.
-  void _newWatcher() {}
-  // Called when a watcher is no longer needed.
-  void _doneWatcher() {}
-  // Called when a new path is being watched.
-  Stream _pathWatched();
-  // Called when a path is no longer being watched.
-  void _donePathWatched() {}
-
-  static _WatcherPath _pathFromPathId(int pathId) {
-    return _idMap[pathId]!;
-  }
-
-  static Stream _listenOnSocket(int socketId, int id, int pathId) {
-    var native = new _NativeSocket.watch(socketId);
-    var socket = new _RawSocket(native);
-    return socket.expand((event) {
-      var stops = [];
-      var events = [];
-      var pair = {};
-      if (event == RawSocketEvent.read) {
-        String getPath(event) {
-          var path = _pathFromPathId(event[4]).path;
-          if (event[2] != null && event[2].isNotEmpty) {
-            path += Platform.pathSeparator;
-            path += event[2];
-          }
-          return path;
-        }
-
-        bool getIsDir(event) {
-          if (Platform.isWindows) {
-            // Windows does not get 'isDir' as part of the event.
-            // Links should also be skipped.
-            return FileSystemEntity.isDirectorySync(getPath(event)) &&
-                !FileSystemEntity.isLinkSync(getPath(event));
-          }
-          return (event[0] & FileSystemEvent._isDir) != 0;
-        }
-
-        void add(id, event) {
-          if ((event.type & _pathFromPathId(id).events) == 0) return;
-          events.add([id, event]);
-        }
-
-        void rewriteMove(event, isDir) {
-          if (event[3]) {
-            add(event[4], new FileSystemCreateEvent._(getPath(event), isDir));
-          } else {
-            add(event[4], new FileSystemDeleteEvent._(getPath(event), false));
-          }
-        }
-
-        int eventCount;
-        do {
-          eventCount = 0;
-          for (var event in _readEvents(id, pathId)) {
-            if (event == null) continue;
-            eventCount++;
-            int pathId = event[4];
-            if (!_idMap.containsKey(pathId)) {
-              // Path is no longer being wathed.
-              continue;
-            }
-            bool isDir = getIsDir(event);
-            var path = getPath(event);
-            if ((event[0] & FileSystemEvent.create) != 0) {
-              add(event[4], new FileSystemCreateEvent._(path, isDir));
-            }
-            if ((event[0] & FileSystemEvent.modify) != 0) {
-              add(event[4], new FileSystemModifyEvent._(path, isDir, true));
-            }
-            if ((event[0] & FileSystemEvent._modifyAttributes) != 0) {
-              add(event[4], new FileSystemModifyEvent._(path, isDir, false));
-            }
-            if ((event[0] & FileSystemEvent.move) != 0) {
-              int link = event[1];
-              if (link > 0) {
-                pair.putIfAbsent(pathId, () => {});
-                if (pair[pathId].containsKey(link)) {
-                  add(
-                      event[4],
-                      new FileSystemMoveEvent._(
-                          getPath(pair[pathId][link]), isDir, path));
-                  pair[pathId].remove(link);
-                } else {
-                  pair[pathId][link] = event;
-                }
-              } else {
-                rewriteMove(event, isDir);
-              }
-            }
-            if ((event[0] & FileSystemEvent.delete) != 0) {
-              add(event[4], new FileSystemDeleteEvent._(path, false));
-            }
-            if ((event[0] & FileSystemEvent._deleteSelf) != 0) {
-              add(event[4], new FileSystemDeleteEvent._(path, false));
-              // Signal done event.
-              stops.add([event[4], null]);
-            }
-          }
-        } while (eventCount > 0);
-        // Be sure to clear this manually, as the sockets are not read through
-        // the _NativeSocket interface.
-        native.available = 0;
-        for (var map in pair.values) {
-          for (var event in map.values) {
-            rewriteMove(event, getIsDir(event));
-          }
-        }
-      } else if (event == RawSocketEvent.closed) {
-      } else if (event == RawSocketEvent.readClosed) {
-        // If Directory watcher buffer overflows, it will send an readClosed event.
-        // Normal closing will cancel stream subscription so that path is
-        // no longer being watched, not present in _idMap.
-        if (_idMap.containsKey(pathId)) {
-          var path = _pathFromPathId(pathId).path;
-          _idMap.remove(pathId);
-          if (_idMap.isEmpty && _id != null) {
-            _closeWatcher(_id!);
-            _id = null;
-          }
-          throw FileSystemException(
-              'Directory watcher closed unexpectedly', path);
-        }
-      } else {
-        assert(false);
-      }
-      events.addAll(stops);
-      return events;
-    });
-  }
-
-  @patch
-  static bool get isSupported native "FileSystemWatcher_IsSupported";
-
-  static int _initWatcher() native "FileSystemWatcher_InitWatcher";
-  static void _closeWatcher(int id) native "FileSystemWatcher_CloseWatcher";
-
-  static int _watchPath(int id, _Namespace namespace, String path, int events,
-      bool recursive) native "FileSystemWatcher_WatchPath";
-  static void _unwatchPath(int id, int path_id)
-      native "FileSystemWatcher_UnwatchPath";
-  static List _readEvents(int id, int path_id)
-      native "FileSystemWatcher_ReadEvents";
-  static int _getSocketId(int id, int path_id)
-      native "FileSystemWatcher_GetSocketId";
-}
-
-class _InotifyFileSystemWatcher extends _FileSystemWatcher {
-  static final Map<int, StreamController> _idMap = {};
-  static late StreamSubscription _subscription;
-
-  _InotifyFileSystemWatcher(path, events, recursive)
-      : super._(path, events, recursive);
-
-  void _newWatcher() {
-    int id = _FileSystemWatcher._id!;
-    _subscription =
-        _FileSystemWatcher._listenOnSocket(id, id, 0).listen((event) {
-      if (_idMap.containsKey(event[0])) {
-        if (event[1] != null) {
-          _idMap[event[0]]!.add(event[1]);
-        } else {
-          _idMap[event[0]]!.close();
-        }
-      }
-    });
-  }
-
-  void _doneWatcher() {
-    _subscription.cancel();
-  }
-
-  Stream _pathWatched() {
-    var pathId = _watcherPath!.pathId;
-    if (!_idMap.containsKey(pathId)) {
-      _idMap[pathId] = new StreamController<FileSystemEvent>.broadcast();
-    }
-    return _idMap[pathId]!.stream;
-  }
-
-  void _pathWatchedEnd() {
-    var pathId = _watcherPath!.pathId;
-    if (!_idMap.containsKey(pathId)) return;
-    _idMap[pathId]!.close();
-    _idMap.remove(pathId);
-  }
-}
-
-class _Win32FileSystemWatcher extends _FileSystemWatcher {
-  late StreamSubscription _subscription;
-  late StreamController _controller;
-
-  _Win32FileSystemWatcher(path, events, recursive)
-      : super._(path, events, recursive);
-
-  Stream _pathWatched() {
-    var pathId = _watcherPath!.pathId;
-    _controller = new StreamController<FileSystemEvent>();
-    _subscription =
-        _FileSystemWatcher._listenOnSocket(pathId, 0, pathId).listen((event) {
-      assert(event[0] == pathId);
-      if (event[1] != null) {
-        _controller.add(event[1]);
-      } else {
-        _controller.close();
-      }
-    });
-    return _controller.stream;
-  }
-
-  void _pathWatchedEnd() {
-    _subscription.cancel();
-    _controller.close();
-  }
-}
-
-class _FSEventStreamFileSystemWatcher extends _FileSystemWatcher {
-  late StreamSubscription _subscription;
-  late StreamController _controller;
-
-  _FSEventStreamFileSystemWatcher(path, events, recursive)
-      : super._(path, events, recursive);
-
-  Stream _pathWatched() {
-    var pathId = _watcherPath!.pathId;
-    var socketId = _FileSystemWatcher._getSocketId(0, pathId);
-    _controller = new StreamController<FileSystemEvent>();
-    _subscription =
-        _FileSystemWatcher._listenOnSocket(socketId, 0, pathId).listen((event) {
-      if (event[1] != null) {
-        _controller.add(event[1]);
-      } else {
-        _controller.close();
-      }
-    });
-    return _controller.stream;
-  }
-
-  void _pathWatchedEnd() {
-    _subscription.cancel();
-    _controller.close();
-  }
-}
-
-@pragma("vm:entry-point", "call")
-Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) {
-  return new Uint8List.view(source.buffer, offsetInBytes, length);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/file_system_entity_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/file_system_entity_patch.dart
deleted file mode 100644
index 973e6b6..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/file_system_entity_patch.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class FileStat {
-  @patch
-  static _statSync(_Namespace namespace, String path) native "File_Stat";
-}
-
-@patch
-class FileSystemEntity {
-  @patch
-  static _getTypeNative(_Namespace namespace, Uint8List rawPath,
-      bool followLinks) native "File_GetType";
-  @patch
-  static _identicalNative(_Namespace namespace, String path1, String path2)
-      native "File_AreIdentical";
-  @patch
-  static _resolveSymbolicLinks(_Namespace namespace, Uint8List path)
-      native "File_ResolveSymbolicLinks";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/filter_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/filter_patch.dart
deleted file mode 100644
index 06898f4..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/filter_patch.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "common_patch.dart";
-
-class _FilterImpl extends NativeFieldWrapperClass1 implements RawZLibFilter {
-  void process(List<int> data, int start, int end) native "Filter_Process";
-
-  List<int>? processed({bool flush: true, bool end: false})
-      native "Filter_Processed";
-}
-
-class _ZLibInflateFilter extends _FilterImpl {
-  _ZLibInflateFilter(int windowBits, List<int>? dictionary, bool raw) {
-    _init(windowBits, dictionary, raw);
-  }
-  void _init(int windowBits, List<int>? dictionary, bool raw)
-      native "Filter_CreateZLibInflate";
-}
-
-class _ZLibDeflateFilter extends _FilterImpl {
-  _ZLibDeflateFilter(bool gzip, int level, int windowBits, int memLevel,
-      int strategy, List<int>? dictionary, bool raw) {
-    _init(gzip, level, windowBits, memLevel, strategy, dictionary, raw);
-  }
-  void _init(bool gzip, int level, int windowBits, int memLevel, int strategy,
-      List<int>? dictionary, bool raw) native "Filter_CreateZLibDeflate";
-}
-
-@patch
-class RawZLibFilter {
-  @patch
-  static RawZLibFilter _makeZLibDeflateFilter(
-          bool gzip,
-          int level,
-          int windowBits,
-          int memLevel,
-          int strategy,
-          List<int>? dictionary,
-          bool raw) =>
-      new _ZLibDeflateFilter(
-          gzip, level, windowBits, memLevel, strategy, dictionary, raw);
-  @patch
-  static RawZLibFilter _makeZLibInflateFilter(
-          int windowBits, List<int>? dictionary, bool raw) =>
-      new _ZLibInflateFilter(windowBits, dictionary, raw);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/io_service_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/io_service_patch.dart
deleted file mode 100644
index d54bbf2..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/io_service_patch.dart
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "common_patch.dart";
-
-class _IOServicePorts {
-  // We limit the number of IO Service ports per isolate so that we don't
-  // spawn too many threads all at once, which can crash the VM on Windows.
-  static const int maxPorts = 32;
-  List<SendPort> _ports = <SendPort>[];
-  List<SendPort> _freePorts = <SendPort>[];
-  Map<int, SendPort> _usedPorts = new HashMap<int, SendPort>();
-
-  _IOServicePorts();
-
-  SendPort _getPort(int forRequestId) {
-    if (_freePorts.isEmpty && _usedPorts.length < maxPorts) {
-      final SendPort port = _newServicePort();
-      _ports.add(port);
-      _freePorts.add(port);
-    }
-    if (!_freePorts.isEmpty) {
-      final SendPort port = _freePorts.removeLast();
-      assert(!_usedPorts.containsKey(forRequestId));
-      _usedPorts[forRequestId] = port;
-      return port;
-    }
-    // We have already allocated the max number of ports. Re-use an
-    // existing one.
-    final SendPort port = _ports[forRequestId % maxPorts];
-    _usedPorts[forRequestId] = port;
-    return port;
-  }
-
-  void _returnPort(int forRequestId) {
-    final SendPort port = _usedPorts.remove(forRequestId)!;
-    if (!_usedPorts.values.contains(port)) {
-      _freePorts.add(port);
-    }
-  }
-
-  static SendPort _newServicePort() native "IOService_NewServicePort";
-}
-
-@patch
-class _IOService {
-  static _IOServicePorts _servicePorts = new _IOServicePorts();
-  static RawReceivePort? _receivePort;
-  static late SendPort _replyToPort;
-  static HashMap<int, Completer> _messageMap = new HashMap<int, Completer>();
-  static int _id = 0;
-
-  @patch
-  static Future _dispatch(int request, List data) {
-    int id;
-    do {
-      id = _getNextId();
-    } while (_messageMap.containsKey(id));
-    final SendPort servicePort = _servicePorts._getPort(id);
-    _ensureInitialize();
-    final Completer completer = new Completer();
-    _messageMap[id] = completer;
-    try {
-      servicePort.send(<dynamic>[id, _replyToPort, request, data]);
-    } catch (error) {
-      _messageMap.remove(id)!.complete(error);
-      if (_messageMap.length == 0) {
-        _finalize();
-      }
-    }
-    return completer.future;
-  }
-
-  static void _ensureInitialize() {
-    if (_receivePort == null) {
-      _receivePort = new RawReceivePort();
-      _replyToPort = _receivePort!.sendPort;
-      _receivePort!.handler = (data) {
-        assert(data is List && data.length == 2);
-        _messageMap.remove(data[0])!.complete(data[1]);
-        _servicePorts._returnPort(data[0]);
-        if (_messageMap.length == 0) {
-          _finalize();
-        }
-      };
-    }
-  }
-
-  static void _finalize() {
-    _id = 0;
-    _receivePort!.close();
-    _receivePort = null;
-  }
-
-  static int _getNextId() {
-    if (_id == 0x7FFFFFFF) _id = 0;
-    return _id++;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/namespace_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/namespace_patch.dart
deleted file mode 100644
index 2cf329f..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/namespace_patch.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2017, 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.
-
-@pragma("vm:entry-point")
-class _NamespaceImpl extends NativeFieldWrapperClass1 implements _Namespace {
-  _NamespaceImpl._();
-
-  static _NamespaceImpl _create(_NamespaceImpl namespace, var n)
-      native "Namespace_Create";
-  static int _getPointer(_NamespaceImpl namespace)
-      native "Namespace_GetPointer";
-  static int _getDefault() native "Namespace_GetDefault";
-
-  // If the platform supports "namespaces", this method is called by the
-  // embedder with the platform-specific namespace information.
-  static _NamespaceImpl? _cachedNamespace = null;
-  static void _setupNamespace(var namespace) {
-    _cachedNamespace = _create(new _NamespaceImpl._(), namespace);
-  }
-
-  static _NamespaceImpl get _namespace {
-    if (_cachedNamespace == null) {
-      // The embedder has not supplied a namespace before one is needed, so
-      // instead use a safe-ish default value.
-      _cachedNamespace = _create(new _NamespaceImpl._(), _getDefault());
-    }
-    return _cachedNamespace!;
-  }
-
-  static int get _namespacePointer => _getPointer(_namespace);
-}
-
-@patch
-@pragma("vm:entry-point")
-class _Namespace {
-  @patch
-  @pragma("vm:entry-point", "call")
-  static void _setupNamespace(var namespace) {
-    _NamespaceImpl._setupNamespace(namespace);
-  }
-
-  @patch
-  static _Namespace get _namespace => _NamespaceImpl._namespace;
-
-  @patch
-  static int get _namespacePointer => _NamespaceImpl._namespacePointer;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/platform_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/platform_patch.dart
deleted file mode 100644
index d187101..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/platform_patch.dart
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "common_patch.dart";
-
-@patch
-@pragma("vm:entry-point")
-class _Platform {
-  @patch
-  static int _numberOfProcessors() native "Platform_NumberOfProcessors";
-  @patch
-  static String _pathSeparator() native "Platform_PathSeparator";
-  @patch
-  static String _operatingSystem() native "Platform_OperatingSystem";
-  @patch
-  static _operatingSystemVersion() native "Platform_OperatingSystemVersion";
-  @patch
-  static _localHostname() native "Platform_LocalHostname";
-  @patch
-  static _executable() native "Platform_ExecutableName";
-  @patch
-  static _resolvedExecutable() native "Platform_ResolvedExecutableName";
-  @patch
-  static _environment() native "Platform_Environment";
-  @patch
-  static List<String> _executableArguments()
-      native "Platform_ExecutableArguments";
-  @patch
-  static String _version() native "Platform_GetVersion";
-
-  @patch
-  static String _localeName() native "Platform_LocaleName";
-
-  @patch
-  static String? _packageRoot() => VMLibraryHooks.packageRootString;
-  @patch
-  static String? _packageConfig() => VMLibraryHooks.packageConfigString;
-
-  @patch
-  static Uri _script() => VMLibraryHooks.platformScript;
-
-  // This script singleton is written to by the embedder if applicable.
-  @pragma("vm:entry-point")
-  static void set _nativeScript(String path) {
-    VMLibraryHooks.platformScript = (() {
-      if (path.startsWith('http:') ||
-          path.startsWith('https:') ||
-          path.startsWith('package:') ||
-          path.startsWith('dart:') ||
-          path.startsWith('data:') ||
-          path.startsWith('file:')) {
-        return Uri.parse(path);
-      } else {
-        return Uri.base.resolveUri(new Uri.file(path));
-      }
-    });
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart
deleted file mode 100644
index bb86a0d..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/process_patch.dart
+++ /dev/null
@@ -1,617 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class _WindowsCodePageDecoder {
-  @patch
-  static String _decodeBytes(List<int> bytes) native "SystemEncodingToString";
-}
-
-@patch
-class _WindowsCodePageEncoder {
-  @patch
-  static List<int> _encodeString(String string) native "StringToSystemEncoding";
-}
-
-@patch
-class Process {
-  @patch
-  static Future<Process> start(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      ProcessStartMode mode: ProcessStartMode.normal}) {
-    _ProcessImpl process = new _ProcessImpl(
-        executable,
-        arguments,
-        workingDirectory,
-        environment,
-        includeParentEnvironment,
-        runInShell,
-        mode);
-    return process._start();
-  }
-
-  @patch
-  static Future<ProcessResult> run(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      Encoding? stdoutEncoding: systemEncoding,
-      Encoding? stderrEncoding: systemEncoding}) {
-    return _runNonInteractiveProcess(
-        executable,
-        arguments,
-        workingDirectory,
-        environment,
-        includeParentEnvironment,
-        runInShell,
-        stdoutEncoding,
-        stderrEncoding);
-  }
-
-  @patch
-  static ProcessResult runSync(String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      Encoding? stdoutEncoding: systemEncoding,
-      Encoding? stderrEncoding: systemEncoding}) {
-    return _runNonInteractiveProcessSync(
-        executable,
-        arguments,
-        workingDirectory,
-        environment,
-        includeParentEnvironment,
-        runInShell,
-        stdoutEncoding,
-        stderrEncoding);
-  }
-
-  @patch
-  static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(signal, "signal");
-    return _ProcessUtils._killPid(pid, signal._signalNumber);
-  }
-}
-
-List<_SignalController?> _signalControllers = new List.filled(32, null);
-
-class _SignalController {
-  final ProcessSignal signal;
-
-  final _controller = new StreamController<ProcessSignal>.broadcast();
-  var _id;
-
-  _SignalController(this.signal) {
-    _controller
-      ..onListen = _listen
-      ..onCancel = _cancel;
-  }
-
-  Stream<ProcessSignal> get stream => _controller.stream;
-
-  void _listen() {
-    var id = _setSignalHandler(signal._signalNumber);
-    if (id is! int) {
-      _controller
-          .addError(new SignalException("Failed to listen for $signal", id));
-      return;
-    }
-    _id = id;
-    var socket = new _RawSocket(new _NativeSocket.watchSignal(id));
-    socket.listen((event) {
-      if (event == RawSocketEvent.read) {
-        var bytes = socket.read()!;
-        for (int i = 0; i < bytes.length; i++) {
-          _controller.add(signal);
-        }
-      }
-    });
-  }
-
-  void _cancel() {
-    if (_id != null) {
-      _clearSignalHandler(signal._signalNumber);
-      _id = null;
-    }
-  }
-
-  static _setSignalHandler(int signal) native "Process_SetSignalHandler";
-  static void _clearSignalHandler(int signal)
-      native "Process_ClearSignalHandler";
-}
-
-@pragma("vm:entry-point", "call")
-Function _getWatchSignalInternal() => _ProcessUtils._watchSignalInternal;
-
-@patch
-class _ProcessUtils {
-  @patch
-  static Never _exit(int status) native "Process_Exit";
-  @patch
-  static void _setExitCode(int status) native "Process_SetExitCode";
-  @patch
-  static int _getExitCode() native "Process_GetExitCode";
-  @patch
-  static void _sleep(int millis) native "Process_Sleep";
-  @patch
-  static int _pid(Process? process) native "Process_Pid";
-  static bool _killPid(int pid, int signal) native "Process_KillPid";
-  @patch
-  static Stream<ProcessSignal> _watchSignal(ProcessSignal signal) {
-    if (signal != ProcessSignal.sighup &&
-        signal != ProcessSignal.sigint &&
-        signal != ProcessSignal.sigterm &&
-        (Platform.isWindows ||
-            (signal != ProcessSignal.sigusr1 &&
-                signal != ProcessSignal.sigusr2 &&
-                signal != ProcessSignal.sigwinch))) {
-      throw new SignalException(
-          "Listening for signal $signal is not supported");
-    }
-    return _watchSignalInternal(signal);
-  }
-
-  static Stream<ProcessSignal> _watchSignalInternal(ProcessSignal signal) {
-    if (_signalControllers[signal._signalNumber] == null) {
-      _signalControllers[signal._signalNumber] = new _SignalController(signal);
-    }
-    return _signalControllers[signal._signalNumber]!.stream;
-  }
-}
-
-@patch
-class ProcessInfo {
-  @patch
-  static int get maxRss {
-    var result = _maxRss();
-    if (result is OSError) {
-      throw result;
-    }
-    return result;
-  }
-
-  @patch
-  static int get currentRss {
-    var result = _currentRss();
-    if (result is OSError) {
-      throw result;
-    }
-    return result;
-  }
-
-  static _maxRss() native "ProcessInfo_MaxRSS";
-  static _currentRss() native "ProcessInfo_CurrentRSS";
-}
-
-@pragma("vm:entry-point")
-class _ProcessStartStatus {
-  @pragma("vm:entry-point", "set")
-  int? _errorCode; // Set to OS error code if process start failed.
-  @pragma("vm:entry-point", "set")
-  String? _errorMessage; // Set to OS error message if process start failed.
-}
-
-// The NativeFieldWrapperClass1 can not be used with a mixin, due to missing
-// implicit constructor.
-class _ProcessImplNativeWrapper extends NativeFieldWrapperClass1 {}
-
-class _ProcessImpl extends _ProcessImplNativeWrapper implements Process {
-  static bool connectedResourceHandler = false;
-
-  _ProcessImpl(
-      String path,
-      List<String> arguments,
-      this._workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment,
-      bool runInShell,
-      this._mode)
-      : super() {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(path, "path");
-    ArgumentError.checkNotNull(arguments, "arguments");
-    for (int i = 0; i < arguments.length; i++) {
-      ArgumentError.checkNotNull(arguments[i], "arguments[]");
-    }
-    ArgumentError.checkNotNull(_mode, "mode");
-
-    if (!connectedResourceHandler) {
-      registerExtension(
-          'ext.dart.io.getProcesses', _ProcessResourceInfo.getStartedProcesses);
-      registerExtension('ext.dart.io.getProcessById',
-          _ProcessResourceInfo.getProcessInfoMapById);
-      connectedResourceHandler = true;
-    }
-
-    if (runInShell) {
-      arguments = _getShellArguments(path, arguments);
-      path = _getShellCommand();
-    }
-
-    if (Platform.isWindows && path.contains(' ') && !path.contains('"')) {
-      // Escape paths that may contain spaces
-      // Bug: https://github.com/dart-lang/sdk/issues/37751
-      _path = '"$path"';
-    } else {
-      _path = path;
-    }
-
-    _arguments = [
-      for (int i = 0; i < arguments.length; i++)
-        Platform.isWindows
-            ? _windowsArgumentEscape(arguments[i])
-            : arguments[i],
-    ];
-
-    _environment = [];
-    // Ensure that we have a non-null environment.
-    environment ??= const {};
-    environment.forEach((key, value) {
-      _environment.add('$key=$value');
-    });
-    if (includeParentEnvironment) {
-      Platform.environment.forEach((key, value) {
-        // Do not override keys already set as part of environment.
-        if (!environment!.containsKey(key)) {
-          _environment.add('$key=$value');
-        }
-      });
-    }
-
-    if (_modeHasStdio(_mode)) {
-      // stdin going to process.
-      _stdin = new _StdSink(new _Socket._writePipe().._owner = this);
-      // stdout coming from process.
-      _stdout = new _StdStream(new _Socket._readPipe().._owner = this);
-      // stderr coming from process.
-      _stderr = new _StdStream(new _Socket._readPipe().._owner = this);
-    }
-    if (_modeIsAttached(_mode)) {
-      _exitHandler = new _Socket._readPipe();
-    }
-  }
-
-  _NativeSocket get _stdinNativeSocket =>
-      (_stdin!._sink as _Socket)._nativeSocket;
-  _NativeSocket get _stdoutNativeSocket =>
-      (_stdout!._stream as _Socket)._nativeSocket;
-  _NativeSocket get _stderrNativeSocket =>
-      (_stderr!._stream as _Socket)._nativeSocket;
-
-  static bool _modeIsAttached(ProcessStartMode mode) {
-    return (mode == ProcessStartMode.normal) ||
-        (mode == ProcessStartMode.inheritStdio);
-  }
-
-  static bool _modeHasStdio(ProcessStartMode mode) {
-    return (mode == ProcessStartMode.normal) ||
-        (mode == ProcessStartMode.detachedWithStdio);
-  }
-
-  static String _getShellCommand() {
-    if (Platform.isWindows) {
-      return 'cmd.exe';
-    }
-    return '/bin/sh';
-  }
-
-  static List<String> _getShellArguments(
-      String executable, List<String> arguments) {
-    List<String> shellArguments = [];
-    if (Platform.isWindows) {
-      shellArguments.add('/c');
-      shellArguments.add(executable);
-      for (var arg in arguments) {
-        shellArguments.add(arg);
-      }
-    } else {
-      var commandLine = new StringBuffer();
-      executable = executable.replaceAll("'", "'\"'\"'");
-      commandLine.write("'$executable'");
-      shellArguments.add("-c");
-      for (var arg in arguments) {
-        arg = arg.replaceAll("'", "'\"'\"'");
-        commandLine.write(" '$arg'");
-      }
-      shellArguments.add(commandLine.toString());
-    }
-    return shellArguments;
-  }
-
-  String _windowsArgumentEscape(String argument) {
-    if (argument.isEmpty) {
-      return '""';
-    }
-    var result = argument;
-    if (argument.contains('\t') ||
-        argument.contains(' ') ||
-        argument.contains('"')) {
-      // Produce something that the C runtime on Windows will parse
-      // back as this string.
-
-      // Replace any number of '\' followed by '"' with
-      // twice as many '\' followed by '\"'.
-      var backslash = '\\'.codeUnitAt(0);
-      var sb = new StringBuffer();
-      var nextPos = 0;
-      var quotePos = argument.indexOf('"', nextPos);
-      while (quotePos != -1) {
-        var numBackslash = 0;
-        var pos = quotePos - 1;
-        while (pos >= 0 && argument.codeUnitAt(pos) == backslash) {
-          numBackslash++;
-          pos--;
-        }
-        sb.write(argument.substring(nextPos, quotePos - numBackslash));
-        for (var i = 0; i < numBackslash; i++) {
-          sb.write(r'\\');
-        }
-        sb.write(r'\"');
-        nextPos = quotePos + 1;
-        quotePos = argument.indexOf('"', nextPos);
-      }
-      sb.write(argument.substring(nextPos, argument.length));
-      result = sb.toString();
-
-      // Add '"' at the beginning and end and replace all '\' at
-      // the end with two '\'.
-      sb = new StringBuffer('"');
-      sb.write(result);
-      nextPos = argument.length - 1;
-      while (argument.codeUnitAt(nextPos) == backslash) {
-        sb.write('\\');
-        nextPos--;
-      }
-      sb.write('"');
-      result = sb.toString();
-    }
-
-    return result;
-  }
-
-  int _intFromBytes(List<int> bytes, int offset) {
-    return (bytes[offset] +
-        (bytes[offset + 1] << 8) +
-        (bytes[offset + 2] << 16) +
-        (bytes[offset + 3] << 24));
-  }
-
-  Future<Process> _start() {
-    var completer = new Completer<Process>();
-    if (_modeIsAttached(_mode)) {
-      _exitCode = new Completer<int>();
-    }
-    // TODO(ager): Make the actual process starting really async instead of
-    // simulating it with a timer.
-    Timer.run(() {
-      var status = new _ProcessStartStatus();
-      bool success = _startNative(
-          _Namespace._namespace,
-          _path,
-          _arguments,
-          _workingDirectory,
-          _environment,
-          _mode._mode,
-          _modeHasStdio(_mode) ? _stdinNativeSocket : null,
-          _modeHasStdio(_mode) ? _stdoutNativeSocket : null,
-          _modeHasStdio(_mode) ? _stderrNativeSocket : null,
-          _modeIsAttached(_mode) ? _exitHandler._nativeSocket : null,
-          status);
-      if (!success) {
-        completer.completeError(new ProcessException(
-            _path, _arguments, status._errorMessage!, status._errorCode!));
-        return;
-      }
-
-      _started = true;
-      final resourceInfo = new _ProcessResourceInfo(this);
-
-      // Setup an exit handler to handle internal cleanup and possible
-      // callback when a process terminates.
-      if (_modeIsAttached(_mode)) {
-        int exitDataRead = 0;
-        final int EXIT_DATA_SIZE = 8;
-        List<int> exitDataBuffer = new List<int>.filled(EXIT_DATA_SIZE, 0);
-        _exitHandler.listen((data) {
-          int exitCode(List<int> ints) {
-            var code = _intFromBytes(ints, 0);
-            var negative = _intFromBytes(ints, 4);
-            assert(negative == 0 || negative == 1);
-            return (negative == 0) ? code : -code;
-          }
-
-          void handleExit() {
-            _ended = true;
-            _exitCode!.complete(exitCode(exitDataBuffer));
-            // Kill stdin, helping hand if the user forgot to do it.
-            if (_modeHasStdio(_mode)) {
-              (_stdin!._sink as _Socket).destroy();
-            }
-            resourceInfo.stopped();
-          }
-
-          exitDataBuffer.setRange(
-              exitDataRead, exitDataRead + data.length, data);
-          exitDataRead += data.length;
-          if (exitDataRead == EXIT_DATA_SIZE) {
-            handleExit();
-          }
-        });
-      }
-
-      completer.complete(this);
-    });
-    return completer.future;
-  }
-
-  ProcessResult _runAndWait(
-      Encoding? stdoutEncoding, Encoding? stderrEncoding) {
-    var status = new _ProcessStartStatus();
-    _exitCode = new Completer<int>();
-    bool success = _startNative(
-        _Namespace._namespace,
-        _path,
-        _arguments,
-        _workingDirectory,
-        _environment,
-        ProcessStartMode.normal._mode,
-        _stdinNativeSocket,
-        _stdoutNativeSocket,
-        _stderrNativeSocket,
-        _exitHandler._nativeSocket,
-        status);
-    if (!success) {
-      throw new ProcessException(
-          _path, _arguments, status._errorMessage!, status._errorCode!);
-    }
-
-    final resourceInfo = new _ProcessResourceInfo(this);
-
-    var result = _wait(_stdinNativeSocket, _stdoutNativeSocket,
-        _stderrNativeSocket, _exitHandler._nativeSocket);
-
-    getOutput(output, encoding) {
-      if (encoding == null) return output;
-      return encoding.decode(output);
-    }
-
-    resourceInfo.stopped();
-
-    return new ProcessResult(
-        result[0],
-        result[1],
-        getOutput(result[2], stdoutEncoding),
-        getOutput(result[3], stderrEncoding));
-  }
-
-  bool _startNative(
-      _Namespace namespace,
-      String path,
-      List<String> arguments,
-      String? workingDirectory,
-      List<String> environment,
-      int mode,
-      _NativeSocket? stdin,
-      _NativeSocket? stdout,
-      _NativeSocket? stderr,
-      _NativeSocket? exitHandler,
-      _ProcessStartStatus status) native "Process_Start";
-
-  _wait(_NativeSocket? stdin, _NativeSocket? stdout, _NativeSocket? stderr,
-      _NativeSocket exitHandler) native "Process_Wait";
-
-  Stream<List<int>> get stdout =>
-      _stdout ?? (throw StateError("stdio is not connected"));
-
-  Stream<List<int>> get stderr =>
-      _stderr ?? (throw StateError("stdio is not connected"));
-
-  IOSink get stdin => _stdin ?? (throw StateError("stdio is not connected"));
-
-  Future<int> get exitCode =>
-      _exitCode?.future ?? (throw StateError("Process is detached"));
-
-  bool kill([ProcessSignal signal = ProcessSignal.sigterm]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(kill, "kill");
-    assert(_started);
-    if (_ended) return false;
-    return _ProcessUtils._killPid(pid, signal._signalNumber);
-  }
-
-  int get pid => _ProcessUtils._pid(this);
-
-  late String _path;
-  late List<String> _arguments;
-  String? _workingDirectory;
-  late List<String> _environment;
-  final ProcessStartMode _mode;
-  // Private methods of Socket are used by _in, _out, and _err.
-  _StdSink? _stdin;
-  _StdStream? _stdout;
-  _StdStream? _stderr;
-  late _Socket _exitHandler;
-  bool _ended = false;
-  bool _started = false;
-  Completer<int>? _exitCode;
-}
-
-// _NonInteractiveProcess is a wrapper around an interactive process
-// that buffers output so it can be delivered when the process exits.
-// _NonInteractiveProcess is used to implement the Process.run
-// method.
-Future<ProcessResult> _runNonInteractiveProcess(
-    String path,
-    List<String> arguments,
-    String? workingDirectory,
-    Map<String, String>? environment,
-    bool includeParentEnvironment,
-    bool runInShell,
-    Encoding? stdoutEncoding,
-    Encoding? stderrEncoding) {
-  // Start the underlying process.
-  return Process.start(path, arguments,
-          workingDirectory: workingDirectory,
-          environment: environment,
-          includeParentEnvironment: includeParentEnvironment,
-          runInShell: runInShell)
-      .then((Process p) {
-    int pid = p.pid;
-
-    // Make sure the process stdin is closed.
-    p.stdin.close();
-
-    // Setup stdout and stderr handling.
-    Future foldStream(Stream<List<int>> stream, Encoding? encoding) {
-      if (encoding == null) {
-        return stream
-            .fold<BytesBuilder>(
-                new BytesBuilder(), (builder, data) => builder..add(data))
-            .then((builder) => builder.takeBytes());
-      } else {
-        return stream
-            .transform(encoding.decoder)
-            .fold<StringBuffer>(new StringBuffer(), (buf, data) {
-          buf.write(data);
-          return buf;
-        }).then((sb) => sb.toString());
-      }
-    }
-
-    Future stdout = foldStream(p.stdout, stdoutEncoding);
-    Future stderr = foldStream(p.stderr, stderrEncoding);
-
-    return Future.wait([p.exitCode, stdout, stderr]).then((result) {
-      return new ProcessResult(pid, result[0], result[1], result[2]);
-    });
-  });
-}
-
-ProcessResult _runNonInteractiveProcessSync(
-    String executable,
-    List<String> arguments,
-    String? workingDirectory,
-    Map<String, String>? environment,
-    bool includeParentEnvironment,
-    bool runInShell,
-    Encoding? stdoutEncoding,
-    Encoding? stderrEncoding) {
-  var process = new _ProcessImpl(
-      executable,
-      arguments,
-      workingDirectory,
-      environment,
-      includeParentEnvironment,
-      runInShell,
-      ProcessStartMode.normal);
-  return process._runAndWait(stdoutEncoding, stderrEncoding);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/secure_socket_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/secure_socket_patch.dart
deleted file mode 100644
index 9a0586d..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/secure_socket_patch.dart
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class SecureSocket {
-  @patch
-  factory SecureSocket._(RawSecureSocket rawSocket) =>
-      new _SecureSocket(rawSocket);
-}
-
-@patch
-class _SecureFilter {
-  @patch
-  factory _SecureFilter._() => new _SecureFilterImpl._();
-}
-
-@patch
-@pragma("vm:entry-point")
-class X509Certificate {
-  @patch
-  @pragma("vm:entry-point")
-  factory X509Certificate._() => new _X509CertificateImpl._();
-}
-
-class _SecureSocket extends _Socket implements SecureSocket {
-  _RawSecureSocket? get _raw => super._raw as _RawSecureSocket?;
-
-  _SecureSocket(RawSecureSocket raw) : super(raw);
-
-  void renegotiate(
-      {bool useSessionCache: true,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false}) {
-    _raw!.renegotiate(
-        useSessionCache: useSessionCache,
-        requestClientCertificate: requestClientCertificate,
-        requireClientCertificate: requireClientCertificate);
-  }
-
-  X509Certificate? get peerCertificate {
-    if (_raw == null) {
-      throw new StateError("peerCertificate called on destroyed SecureSocket");
-    }
-    return _raw!.peerCertificate;
-  }
-
-  String? get selectedProtocol {
-    if (_raw == null) {
-      throw new StateError("selectedProtocol called on destroyed SecureSocket");
-    }
-    return _raw!.selectedProtocol;
-  }
-}
-
-/**
- * _SecureFilterImpl wraps a filter that encrypts and decrypts data travelling
- * over an encrypted socket.  The filter also handles the handshaking
- * and certificate verification.
- *
- * The filter exposes its input and output buffers as Dart objects that
- * are backed by an external C array of bytes, so that both Dart code and
- * native code can access the same data.
- */
-@pragma("vm:entry-point")
-class _SecureFilterImpl extends NativeFieldWrapperClass1
-    implements _SecureFilter {
-  // Performance is improved if a full buffer of plaintext fits
-  // in the encrypted buffer, when encrypted.
-  // SIZE and ENCRYPTED_SIZE are referenced from C++.
-  @pragma("vm:entry-point")
-  static final int SIZE = 8 * 1024;
-  @pragma("vm:entry-point")
-  static final int ENCRYPTED_SIZE = 10 * 1024;
-
-  _SecureFilterImpl._() {
-    buffers = <_ExternalBuffer>[
-      for (int i = 0; i < _RawSecureSocket.bufferCount; ++i)
-        new _ExternalBuffer(
-            _RawSecureSocket._isBufferEncrypted(i) ? ENCRYPTED_SIZE : SIZE),
-    ];
-  }
-
-  void connect(
-      String hostName,
-      SecurityContext context,
-      bool isServer,
-      bool requestClientCertificate,
-      bool requireClientCertificate,
-      Uint8List protocols) native "SecureSocket_Connect";
-
-  void destroy() {
-    buffers = null;
-    _destroy();
-  }
-
-  void _destroy() native "SecureSocket_Destroy";
-
-  void handshake() native "SecureSocket_Handshake";
-
-  void rehandshake() => throw new UnimplementedError();
-
-  int processBuffer(int bufferIndex) => throw new UnimplementedError();
-
-  String? selectedProtocol() native "SecureSocket_GetSelectedProtocol";
-
-  void renegotiate(bool useSessionCache, bool requestClientCertificate,
-      bool requireClientCertificate) native "SecureSocket_Renegotiate";
-
-  void init() native "SecureSocket_Init";
-
-  X509Certificate? get peerCertificate native "SecureSocket_PeerCertificate";
-
-  void registerBadCertificateCallback(Function callback)
-      native "SecureSocket_RegisterBadCertificateCallback";
-
-  void registerHandshakeCompleteCallback(Function handshakeCompleteHandler)
-      native "SecureSocket_RegisterHandshakeCompleteCallback";
-
-  // This is a security issue, as it exposes a raw pointer to Dart code.
-  int _pointer() native "SecureSocket_FilterPointer";
-
-  @pragma("vm:entry-point", "get")
-  List<_ExternalBuffer>? buffers;
-}
-
-@patch
-class SecurityContext {
-  @patch
-  factory SecurityContext({bool withTrustedRoots: false}) {
-    return new _SecurityContext(withTrustedRoots);
-  }
-
-  @patch
-  static SecurityContext get defaultContext {
-    return _SecurityContext.defaultContext;
-  }
-
-  @patch
-  static bool get alpnSupported => true;
-}
-
-class _SecurityContext extends NativeFieldWrapperClass1
-    implements SecurityContext {
-  _SecurityContext(bool withTrustedRoots) {
-    _createNativeContext();
-    if (withTrustedRoots) {
-      _trustBuiltinRoots();
-    }
-  }
-
-  void _createNativeContext() native "SecurityContext_Allocate";
-
-  static final SecurityContext defaultContext = new _SecurityContext(true);
-
-  void usePrivateKey(String file, {String? password}) {
-    List<int> bytes = (new File(file)).readAsBytesSync();
-    usePrivateKeyBytes(bytes, password: password);
-  }
-
-  void usePrivateKeyBytes(List<int> keyBytes, {String? password})
-      native "SecurityContext_UsePrivateKeyBytes";
-
-  void setTrustedCertificates(String file, {String? password}) {
-    List<int> bytes = (new File(file)).readAsBytesSync();
-    setTrustedCertificatesBytes(bytes, password: password);
-  }
-
-  void setTrustedCertificatesBytes(List<int> certBytes, {String? password})
-      native "SecurityContext_SetTrustedCertificatesBytes";
-
-  void useCertificateChain(String file, {String? password}) {
-    List<int> bytes = (new File(file)).readAsBytesSync();
-    useCertificateChainBytes(bytes, password: password);
-  }
-
-  void useCertificateChainBytes(List<int> chainBytes, {String? password})
-      native "SecurityContext_UseCertificateChainBytes";
-
-  void setClientAuthorities(String file, {String? password}) {
-    List<int> bytes = (new File(file)).readAsBytesSync();
-    setClientAuthoritiesBytes(bytes, password: password);
-  }
-
-  void setClientAuthoritiesBytes(List<int> authCertBytes, {String? password})
-      native "SecurityContext_SetClientAuthoritiesBytes";
-
-  void setAlpnProtocols(List<String> protocols, bool isServer) {
-    Uint8List encodedProtocols =
-        SecurityContext._protocolsToLengthEncoding(protocols);
-    _setAlpnProtocols(encodedProtocols, isServer);
-  }
-
-  void _setAlpnProtocols(Uint8List protocols, bool isServer)
-      native "SecurityContext_SetAlpnProtocols";
-  void _trustBuiltinRoots() native "SecurityContext_TrustBuiltinRoots";
-}
-
-/**
- * _X509CertificateImpl wraps an X509 certificate object held by the BoringSSL
- * library. It exposes the fields of the certificate object.
- */
-class _X509CertificateImpl extends NativeFieldWrapperClass1
-    implements X509Certificate {
-  // The native field must be set manually on a new object, in native code.
-  // This is done by WrappedX509 in secure_socket.cc.
-  _X509CertificateImpl._();
-
-  Uint8List get _der native "X509_Der";
-  late final Uint8List der = _der;
-
-  String get _pem native "X509_Pem";
-  late final String pem = _pem;
-
-  Uint8List get _sha1 native "X509_Sha1";
-  late final Uint8List sha1 = _sha1;
-
-  String get subject native "X509_Subject";
-  String get issuer native "X509_Issuer";
-  DateTime get startValidity {
-    return new DateTime.fromMillisecondsSinceEpoch(_startValidity(),
-        isUtc: true);
-  }
-
-  DateTime get endValidity {
-    return new DateTime.fromMillisecondsSinceEpoch(_endValidity(), isUtc: true);
-  }
-
-  int _startValidity() native "X509_StartValidity";
-  int _endValidity() native "X509_EndValidity";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/socket_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/socket_patch.dart
deleted file mode 100644
index e2bff2f..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/socket_patch.dart
+++ /dev/null
@@ -1,2243 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class RawServerSocket {
-  @patch
-  static Future<RawServerSocket> bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    return _RawServerSocket.bind(address, port, backlog, v6Only, shared);
-  }
-}
-
-@patch
-class RawSocket {
-  @patch
-  static Future<RawSocket> connect(dynamic host, int port,
-      {dynamic sourceAddress, Duration? timeout}) {
-    return _RawSocket.connect(host, port, sourceAddress, timeout);
-  }
-
-  @patch
-  static Future<ConnectionTask<RawSocket>> startConnect(dynamic host, int port,
-      {dynamic sourceAddress}) {
-    return _RawSocket.startConnect(host, port, sourceAddress);
-  }
-}
-
-@patch
-class RawSocketOption {
-  static final List<int?> _optionsCache =
-      List<int?>.filled(_RawSocketOptions.values.length, null);
-
-  @patch
-  static int _getOptionValue(int key) {
-    if (key > _RawSocketOptions.values.length) {
-      throw ArgumentError.value(key, 'key');
-    }
-    return _optionsCache[key] ??= _getNativeOptionValue(key);
-  }
-
-  static int _getNativeOptionValue(int key)
-      native "RawSocketOption_GetOptionValue";
-}
-
-@patch
-class InternetAddress {
-  @patch
-  static InternetAddress get LOOPBACK_IP_V4 {
-    return _InternetAddress.loopbackIPv4;
-  }
-
-  @patch
-  static InternetAddress get LOOPBACK_IP_V6 {
-    return _InternetAddress.loopbackIPv6;
-  }
-
-  @patch
-  static InternetAddress get ANY_IP_V4 {
-    return _InternetAddress.anyIPv4;
-  }
-
-  @patch
-  static InternetAddress get ANY_IP_V6 {
-    return _InternetAddress.anyIPv6;
-  }
-
-  @patch
-  factory InternetAddress(String address, {InternetAddressType? type}) {
-    return _InternetAddress.fromString(address, type: type);
-  }
-
-  @patch
-  factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType? type}) {
-    return _InternetAddress.fromRawAddress(rawAddress, type: type);
-  }
-
-  @patch
-  static Future<List<InternetAddress>> lookup(String host,
-      {InternetAddressType type: InternetAddressType.any}) {
-    return _NativeSocket.lookup(host, type: type);
-  }
-
-  @patch
-  static InternetAddress _cloneWithNewHost(
-      InternetAddress address, String host) {
-    return (address as _InternetAddress)._cloneWithNewHost(host);
-  }
-
-  @patch
-  static InternetAddress? tryParse(String address) {
-    return _InternetAddress.tryParse(address);
-  }
-}
-
-@patch
-class NetworkInterface {
-  @patch
-  static bool get listSupported {
-    return _listSupported();
-  }
-
-  @patch
-  static Future<List<NetworkInterface>> list(
-      {bool includeLoopback: false,
-      bool includeLinkLocal: false,
-      InternetAddressType type: InternetAddressType.any}) {
-    return _NativeSocket.listInterfaces(
-        includeLoopback: includeLoopback,
-        includeLinkLocal: includeLinkLocal,
-        type: type);
-  }
-
-  static bool _listSupported() native "NetworkInterface_ListSupported";
-}
-
-void _throwOnBadPort(int port) {
-  // TODO(40614): Remove once non-nullability is sound.
-  ArgumentError.checkNotNull(port, "port");
-  if ((port < 0) || (port > 0xFFFF)) {
-    throw new ArgumentError("Invalid port $port");
-  }
-}
-
-void _throwOnBadTtl(int ttl) {
-  // TODO(40614): Remove once non-nullability is sound.
-  ArgumentError.checkNotNull(ttl, "ttl");
-  if (ttl < 1 || ttl > 255) {
-    throw new ArgumentError('Invalid ttl $ttl');
-  }
-}
-
-class _InternetAddress implements InternetAddress {
-  static const int _addressLoopbackIPv4 = 0;
-  static const int _addressLoopbackIPv6 = 1;
-  static const int _addressAnyIPv4 = 2;
-  static const int _addressAnyIPv6 = 3;
-  static const int _IPv4AddrLength = 4;
-  static const int _IPv6AddrLength = 16;
-
-  static _InternetAddress loopbackIPv4 =
-      _InternetAddress.fixed(_addressLoopbackIPv4);
-  static _InternetAddress loopbackIPv6 =
-      _InternetAddress.fixed(_addressLoopbackIPv6);
-  static _InternetAddress anyIPv4 = _InternetAddress.fixed(_addressAnyIPv4);
-  static _InternetAddress anyIPv6 = _InternetAddress.fixed(_addressAnyIPv6);
-
-  final String address;
-  final String? _host;
-  final Uint8List _in_addr;
-  final int _scope_id;
-  final InternetAddressType type;
-
-  String get host => _host ?? address;
-
-  Uint8List get rawAddress => new Uint8List.fromList(_in_addr);
-
-  bool get isLoopback {
-    switch (type) {
-      case InternetAddressType.IPv4:
-        return _in_addr[0] == 127;
-
-      case InternetAddressType.IPv6:
-        for (int i = 0; i < _IPv6AddrLength - 1; i++) {
-          if (_in_addr[i] != 0) return false;
-        }
-        return _in_addr[_IPv6AddrLength - 1] == 1;
-
-      case InternetAddressType.unix:
-        return false;
-    }
-    throw new UnsupportedError("Unexpected address type $type");
-  }
-
-  bool get isLinkLocal {
-    switch (type) {
-      case InternetAddressType.IPv4:
-        // Checking for 169.254.0.0/16.
-        return _in_addr[0] == 169 && _in_addr[1] == 254;
-
-      case InternetAddressType.IPv6:
-        // Checking for fe80::/10.
-        return _in_addr[0] == 0xFE && (_in_addr[1] & 0xB0) == 0x80;
-
-      case InternetAddressType.unix:
-        return false;
-    }
-    throw new UnsupportedError("Unexpected address type $type");
-  }
-
-  bool get isMulticast {
-    switch (type) {
-      case InternetAddressType.IPv4:
-        // Checking for 224.0.0.0 through 239.255.255.255.
-        return _in_addr[0] >= 224 && _in_addr[0] < 240;
-
-      case InternetAddressType.IPv6:
-        // Checking for ff00::/8.
-        return _in_addr[0] == 0xFF;
-
-      case InternetAddressType.unix:
-        return false;
-    }
-    throw new UnsupportedError("Unexpected address type $type");
-  }
-
-  Future<InternetAddress> reverse() {
-    if (type == InternetAddressType.unix) {
-      return Future.value(this);
-    }
-    return _NativeSocket.reverseLookup(this);
-  }
-
-  _InternetAddress(this.type, this.address, this._host, this._in_addr,
-      [this._scope_id = 0]);
-
-  factory _InternetAddress.fromString(String address,
-      {InternetAddressType? type}) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(address, 'address');
-    if (type == InternetAddressType.unix) {
-      var rawAddress = FileSystemEntity._toUtf8Array(address);
-      return _InternetAddress(
-          InternetAddressType.unix, address, null, rawAddress);
-    } else {
-      var in_addr = _parse(address);
-      if (in_addr == null) {
-        throw ArgumentError("Invalid internet address $address");
-      }
-      InternetAddressType type = in_addr.length == _IPv4AddrLength
-          ? InternetAddressType.IPv4
-          : InternetAddressType.IPv6;
-      return _InternetAddress(type, address, null, in_addr);
-    }
-  }
-
-  factory _InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {InternetAddressType? type}) {
-    if (type == InternetAddressType.unix) {
-      ArgumentError.checkNotNull(rawAddress, 'rawAddress');
-      var rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawAddress);
-      var address = FileSystemEntity._toStringFromUtf8Array(rawAddress);
-      return _InternetAddress(InternetAddressType.unix, address, null, rawPath);
-    } else {
-      int type = -1;
-      if (rawAddress.length == _IPv4AddrLength) {
-        type = 0;
-      } else {
-        if (rawAddress.length != _IPv6AddrLength) {
-          throw ArgumentError("Invalid internet address ${rawAddress}");
-        }
-        type = 1;
-      }
-      var address = _rawAddrToString(rawAddress);
-      return _InternetAddress(
-          InternetAddressType._from(type), address, null, rawAddress);
-    }
-  }
-
-  static _InternetAddress? tryParse(String address) {
-    checkNotNullable(address, "address");
-    var addressBytes = _parse(address);
-    if (addressBytes == null) return null;
-    var type = addressBytes.length == _IPv4AddrLength
-        ? InternetAddressType.IPv4
-        : InternetAddressType.IPv6;
-    return _InternetAddress(type, address, null, addressBytes);
-  }
-
-  factory _InternetAddress.fixed(int id) {
-    switch (id) {
-      case _addressLoopbackIPv4:
-        var in_addr = Uint8List(_IPv4AddrLength);
-        in_addr[0] = 127;
-        in_addr[_IPv4AddrLength - 1] = 1;
-        return _InternetAddress(
-            InternetAddressType.IPv4, "127.0.0.1", null, in_addr);
-      case _addressLoopbackIPv6:
-        var in_addr = Uint8List(_IPv6AddrLength);
-        in_addr[_IPv6AddrLength - 1] = 1;
-        return _InternetAddress(InternetAddressType.IPv6, "::1", null, in_addr);
-      case _addressAnyIPv4:
-        var in_addr = Uint8List(_IPv4AddrLength);
-        return _InternetAddress(
-            InternetAddressType.IPv4, "0.0.0.0", "0.0.0.0", in_addr);
-      case _addressAnyIPv6:
-        var in_addr = Uint8List(_IPv6AddrLength);
-        return _InternetAddress(InternetAddressType.IPv6, "::", "::", in_addr);
-      default:
-        assert(false);
-        throw ArgumentError();
-    }
-  }
-
-  // Create a clone of this _InternetAddress replacing the host.
-  _InternetAddress _cloneWithNewHost(String host) {
-    return _InternetAddress(type, address, host, Uint8List.fromList(_in_addr));
-  }
-
-  bool operator ==(other) {
-    if (!(other is _InternetAddress)) return false;
-    if (other.type != type) return false;
-    if (type == InternetAddressType.unix) {
-      return address == other.address;
-    }
-    bool equals = true;
-    for (int i = 0; i < _in_addr.length && equals; i++) {
-      equals = other._in_addr[i] == _in_addr[i];
-    }
-    return equals;
-  }
-
-  int get hashCode {
-    if (type == InternetAddressType.unix) {
-      return address.hashCode;
-    }
-    int result = 1;
-    for (int i = 0; i < _in_addr.length; i++) {
-      result = (result * 31 + _in_addr[i]) & 0x3FFFFFFF;
-    }
-    return result;
-  }
-
-  String toString() {
-    return "InternetAddress('$address', ${type.name})";
-  }
-
-  static String _rawAddrToString(Uint8List address)
-      native "InternetAddress_RawAddrToString";
-
-  static Uint8List? _parse(String address) native "InternetAddress_Parse";
-}
-
-class _NetworkInterface implements NetworkInterface {
-  final String name;
-  final int index;
-  final List<InternetAddress> addresses = [];
-
-  _NetworkInterface(this.name, this.index);
-
-  String toString() {
-    return "NetworkInterface('$name', $addresses)";
-  }
-}
-
-// The NativeFieldWrapperClass1 cannot be used with a mixin, due to missing
-// implicit constructor.
-class _NativeSocketNativeWrapper extends NativeFieldWrapperClass1 {}
-
-// The _NativeSocket class encapsulates an OS socket.
-class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
-  // Bit flags used when communicating between the eventhandler and
-  // dart code. The EVENT flags are used to indicate events of
-  // interest when sending a message from dart code to the
-  // eventhandler. When receiving a message from the eventhandler the
-  // EVENT flags indicate the events that actually happened. The
-  // COMMAND flags are used to send commands from dart to the
-  // eventhandler. COMMAND flags are never received from the
-  // eventhandler. Additional flags are used to communicate other
-  // information.
-  static const int readEvent = 0;
-  static const int writeEvent = 1;
-  static const int errorEvent = 2;
-  static const int closedEvent = 3;
-  static const int destroyedEvent = 4;
-  static const int firstEvent = readEvent;
-  static const int lastEvent = destroyedEvent;
-  static const int eventCount = lastEvent - firstEvent + 1;
-
-  static const int closeCommand = 8;
-  static const int shutdownReadCommand = 9;
-  static const int shutdownWriteCommand = 10;
-  // The lower bits of returnTokenCommand messages contains the number
-  // of tokens returned.
-  static const int returnTokenCommand = 11;
-  static const int setEventMaskCommand = 12;
-  static const int firstCommand = closeCommand;
-  static const int lastCommand = setEventMaskCommand;
-
-  // Type flag send to the eventhandler providing additional
-  // information on the type of the file descriptor.
-  static const int listeningSocket = 16;
-  static const int pipeSocket = 17;
-  static const int typeNormalSocket = 0;
-  static const int typeListeningSocket = 1 << listeningSocket;
-  static const int typePipe = 1 << pipeSocket;
-  static const int typeTypeMask = typeListeningSocket | pipeSocket;
-
-  // Protocol flags.
-  // Keep in sync with SocketType enum in socket.h.
-  static const int tcpSocket = 18;
-  static const int udpSocket = 19;
-  static const int internalSocket = 20;
-  static const int internalSignalSocket = 21;
-  static const int typeTcpSocket = 1 << tcpSocket;
-  static const int typeUdpSocket = 1 << udpSocket;
-  static const int typeInternalSocket = 1 << internalSocket;
-  static const int typeInternalSignalSocket = 1 << internalSignalSocket;
-  static const int typeProtocolMask = typeTcpSocket |
-      typeUdpSocket |
-      typeInternalSocket |
-      typeInternalSignalSocket;
-
-  // Native port messages.
-  static const hostNameLookupMessage = 0;
-  static const listInterfacesMessage = 1;
-  static const reverseLookupMessage = 2;
-
-  // Protocol flags.
-  static const int protocolIPv4 = 1 << 0;
-  static const int protocolIPv6 = 1 << 1;
-
-  static const int normalTokenBatchSize = 8;
-  static const int listeningTokenBatchSize = 2;
-
-  static const Duration _retryDuration = const Duration(milliseconds: 250);
-  static const Duration _retryDurationLoopback =
-      const Duration(milliseconds: 25);
-
-  // Socket close state
-  bool isClosed = false;
-  bool isClosing = false;
-  bool isClosedRead = false;
-  bool closedReadEventSent = false;
-  bool isClosedWrite = false;
-  Completer closeCompleter = new Completer.sync();
-
-  // Handlers and receive port for socket events from the event handler.
-  final List eventHandlers = new List.filled(eventCount + 1, null);
-  RawReceivePort? eventPort;
-  bool flagsSent = false;
-
-  // The type flags for this socket.
-  final int typeFlags;
-
-  // Holds the port of the socket, 0 if not known.
-  int localPort = 0;
-
-  // Holds the address used to connect or bind the socket.
-  late InternetAddress localAddress;
-
-  // The size of data that is ready to be read, for TCP sockets.
-  // This might be out-of-date when Read is called.
-  // The number of pending connections, for Listening sockets.
-  int available = 0;
-
-  // Only used for UDP sockets.
-  bool _availableDatagram = false;
-
-  // The number of incoming connnections for Listening socket.
-  int connections = 0;
-
-  // The count of received event from eventhandler.
-  int tokens = 0;
-
-  bool sendReadEvents = false;
-  bool readEventIssued = false;
-
-  bool sendWriteEvents = false;
-  bool writeEventIssued = false;
-  bool writeAvailable = false;
-
-  static bool connectedResourceHandler = false;
-  _SocketResourceInfo? resourceInfo;
-
-  // The owner object is the object that the Socket is being used by, e.g.
-  // a HttpServer, a WebSocket connection, a process pipe, etc.
-  Object? owner;
-
-  static Future<List<InternetAddress>> lookup(String host,
-      {InternetAddressType type: InternetAddressType.any}) {
-    return _IOService._dispatch(_IOService.socketLookup, [host, type._value])
-        .then((response) {
-      if (isErrorResponse(response)) {
-        throw createError(response, "Failed host lookup: '$host'");
-      } else {
-        return response.skip(1).map<InternetAddress>((result) {
-          var type = InternetAddressType._from(result[0]);
-          return _InternetAddress(type, result[1], host, result[2], result[3]);
-        }).toList();
-      }
-    });
-  }
-
-  static Future<InternetAddress> reverseLookup(InternetAddress addr) {
-    return _IOService._dispatch(_IOService.socketReverseLookup,
-        [(addr as _InternetAddress)._in_addr]).then((response) {
-      if (isErrorResponse(response)) {
-        throw createError(response, "Failed reverse host lookup", addr);
-      } else {
-        return (addr as _InternetAddress)._cloneWithNewHost(response);
-      }
-    });
-  }
-
-  static Future<List<NetworkInterface>> listInterfaces(
-      {bool includeLoopback: false,
-      bool includeLinkLocal: false,
-      InternetAddressType type: InternetAddressType.any}) {
-    return _IOService._dispatch(_IOService.socketListInterfaces, [type._value])
-        .then((response) {
-      if (isErrorResponse(response)) {
-        throw createError(response, "Failed listing interfaces");
-      } else {
-        var map = response.skip(1).fold(new Map<String, NetworkInterface>(),
-            (map, result) {
-          var type = InternetAddressType._from(result[0]);
-          var name = result[3];
-          var index = result[4];
-          var address = _InternetAddress(type, result[1], "", result[2]);
-          if (!includeLinkLocal && address.isLinkLocal) return map;
-          if (!includeLoopback && address.isLoopback) return map;
-          map.putIfAbsent(name, () => new _NetworkInterface(name, index));
-          map[name].addresses.add(address);
-          return map;
-        });
-        return map.values.toList();
-      }
-    });
-  }
-
-  static String escapeLinkLocalAddress(String host) {
-    // if the host contains escape, host is an IPv6 address with scope ID.
-    // Remove '25' before feeding into native calls.
-    int index = host.indexOf('%');
-    if (index >= 0) {
-      if (!checkLinkLocalAddress(host)) {
-        // The only well defined usage is link-local address. Checks Section 4 of https://tools.ietf.org/html/rfc6874.
-        // If it is not a valid link-local address and contains escape character, throw an exception.
-        throw new FormatException(
-            '${host} is not a valid link-local address but contains %. Scope id should be used as part of link-local address.',
-            host,
-            index);
-      }
-      if (host.startsWith("25", index + 1)) {
-        // Remove '25' after '%' if present
-        host = host.replaceRange(index + 1, index + 3, '');
-      }
-    }
-    return host;
-  }
-
-  static bool checkLinkLocalAddress(String host) {
-    // The shortest possible link-local address is [fe80::1]
-    if (host.length < 7) return false;
-    var char = host[2];
-    return host.startsWith('fe') &&
-        (char == '8' || char == '9' || char == 'a' || char == 'b');
-  }
-
-  static Future<ConnectionTask<_NativeSocket>> startConnect(
-      dynamic host, int port, dynamic sourceAddress) {
-    if (host is String) {
-      host = escapeLinkLocalAddress(host);
-    }
-    _throwOnBadPort(port);
-    if (sourceAddress != null && sourceAddress is! _InternetAddress) {
-      if (sourceAddress is String) {
-        sourceAddress = new InternetAddress(sourceAddress);
-      }
-    }
-    return new Future.value(host).then((host) {
-      if (host is _InternetAddress) return [host];
-      return lookup(host).then((addresses) {
-        if (addresses.isEmpty) {
-          throw createError(null, "Failed host lookup: '$host'");
-        }
-        return addresses;
-      });
-    }).then((addresses) {
-      var completer = new Completer<_NativeSocket>();
-      var it = (addresses as List<InternetAddress>).iterator;
-      var error = null;
-      var connecting = new HashMap();
-
-      void connectNext() {
-        if (!it.moveNext()) {
-          if (connecting.isEmpty) {
-            assert(error != null);
-            completer.completeError(error);
-          }
-          return;
-        }
-        final _InternetAddress address = it.current as _InternetAddress;
-        var socket = new _NativeSocket.normal(address);
-        var result;
-        if (sourceAddress == null) {
-          if (address.type == InternetAddressType.unix) {
-            result = socket.nativeCreateUnixDomainConnect(
-                address.address, _Namespace._namespace);
-          } else {
-            result = socket.nativeCreateConnect(
-                address._in_addr, port, address._scope_id);
-          }
-        } else {
-          assert(sourceAddress is _InternetAddress);
-          if (address.type == InternetAddressType.unix) {
-            assert(sourceAddress.type == InternetAddressType.unix);
-            result = socket.nativeCreateUnixDomainBindConnect(
-                address.address, sourceAddress.address, _Namespace._namespace);
-          } else {
-            result = socket.nativeCreateBindConnect(address._in_addr, port,
-                sourceAddress._in_addr, address._scope_id);
-          }
-        }
-        if (result is OSError) {
-          // Keep first error, if present.
-          if (error == null) {
-            int errorCode = result.errorCode;
-            if (sourceAddress != null &&
-                errorCode != null &&
-                socket.isBindError(errorCode)) {
-              error = createError(result, "Bind failed", sourceAddress);
-            } else {
-              error = createError(result, "Connection failed", address, port);
-            }
-          }
-          connectNext();
-        } else {
-          // Query the local port for error messages.
-          try {
-            socket.port;
-          } catch (e) {
-            if (error == null) {
-              error = createError(e, "Connection failed", address, port);
-            }
-            connectNext();
-          }
-          // Set up timer for when we should retry the next address
-          // (if any).
-          var duration =
-              address.isLoopback ? _retryDurationLoopback : _retryDuration;
-          var timer = new Timer(duration, connectNext);
-          setupResourceInfo(socket);
-
-          connecting[socket] = timer;
-          // Setup handlers for receiving the first write event which
-          // indicate that the socket is fully connected.
-          socket.setHandlers(write: () {
-            timer.cancel();
-            connecting.remove(socket);
-            // From 'man 2 connect':
-            // After select(2) indicates writability, use getsockopt(2) to read
-            // the SO_ERROR option at level SOL_SOCKET to determine whether
-            // connect() completed successfully (SO_ERROR is zero) or
-            // unsuccessfully.
-            OSError osError = socket.nativeGetError();
-            if (osError.errorCode != 0) {
-              socket.close();
-              if (error == null) error = osError;
-              if (connecting.isEmpty) connectNext();
-              return;
-            }
-            socket.setListening(read: false, write: false);
-            completer.complete(socket);
-            connecting.forEach((s, t) {
-              t.cancel();
-              s.close();
-              s.setHandlers();
-              s.setListening(read: false, write: false);
-            });
-            connecting.clear();
-          }, error: (e, st) {
-            timer.cancel();
-            socket.close();
-            // Keep first error, if present.
-            if (error == null) error = e;
-            connecting.remove(socket);
-            if (connecting.isEmpty) connectNext();
-          });
-          socket.setListening(read: false, write: true);
-        }
-      }
-
-      void onCancel() {
-        connecting.forEach((s, t) {
-          t.cancel();
-          s.close();
-          s.setHandlers();
-          s.setListening(read: false, write: false);
-          if (error == null) {
-            error = createError(null,
-                "Connection attempt cancelled, host: ${host}, port: ${port}");
-          }
-        });
-        connecting.clear();
-        if (!completer.isCompleted) {
-          completer.completeError(error);
-        }
-      }
-
-      connectNext();
-      return new ConnectionTask<_NativeSocket>._(completer.future, onCancel);
-    });
-  }
-
-  static Future<_NativeSocket> connect(
-      dynamic host, int port, dynamic sourceAddress, Duration? timeout) {
-    return startConnect(host, port, sourceAddress)
-        .then((ConnectionTask<_NativeSocket> task) {
-      Future<_NativeSocket> socketFuture = task.socket;
-      if (timeout != null) {
-        socketFuture = socketFuture.timeout(timeout, onTimeout: () {
-          task.cancel();
-          throw createError(
-              null, "Connection timed out, host: ${host}, port: ${port}");
-        });
-      }
-      return socketFuture;
-    });
-  }
-
-  static Future<_InternetAddress> _resolveHost(dynamic host) async {
-    if (host is _InternetAddress) {
-      return host;
-    } else {
-      final list = await lookup(host);
-      if (list.isEmpty) {
-        throw createError(null, "Failed host lookup: '$host'");
-      }
-      return list.first as _InternetAddress;
-    }
-  }
-
-  static Future<_NativeSocket> bind(
-      host, int port, int backlog, bool v6Only, bool shared) async {
-    _throwOnBadPort(port);
-    if (host is String) {
-      host = escapeLinkLocalAddress(host);
-    }
-    final address = await _resolveHost(host);
-
-    var socket = new _NativeSocket.listen(address);
-    var result;
-    if (address.type == InternetAddressType.unix) {
-      var path = address.address;
-      if (FileSystemEntity.isLinkSync(path)) {
-        path = Link(path).targetSync();
-      }
-      result = socket.nativeCreateUnixDomainBindListen(
-          path, backlog, shared, _Namespace._namespace);
-    } else {
-      result = socket.nativeCreateBindListen(
-          address._in_addr, port, backlog, v6Only, shared, address._scope_id);
-    }
-    if (result is OSError) {
-      throw new SocketException("Failed to create server socket",
-          osError: result, address: address, port: port);
-    }
-    if (port != 0) socket.localPort = port;
-    setupResourceInfo(socket);
-    socket.connectToEventHandler();
-    return socket;
-  }
-
-  static void setupResourceInfo(_NativeSocket socket) {
-    socket.resourceInfo = new _SocketResourceInfo(socket);
-  }
-
-  static Future<_NativeSocket> bindDatagram(
-      host, int port, bool reuseAddress, bool reusePort, int ttl) async {
-    _throwOnBadPort(port);
-    _throwOnBadTtl(ttl);
-
-    final address = await _resolveHost(host);
-
-    var socket = new _NativeSocket.datagram(address);
-    var result = socket.nativeCreateBindDatagram(
-        address._in_addr, port, reuseAddress, reusePort, ttl);
-    if (result is OSError) {
-      throw new SocketException("Failed to create datagram socket",
-          osError: result, address: address, port: port);
-    }
-    if (port != 0) socket.localPort = port;
-    setupResourceInfo(socket);
-    return socket;
-  }
-
-  _NativeSocket.datagram(this.localAddress)
-      : typeFlags = typeNormalSocket | typeUdpSocket;
-
-  _NativeSocket.normal(this.localAddress)
-      : typeFlags = typeNormalSocket | typeTcpSocket;
-
-  _NativeSocket.listen(this.localAddress)
-      : typeFlags = typeListeningSocket | typeTcpSocket {
-    isClosedWrite = true;
-  }
-
-  _NativeSocket.pipe() : typeFlags = typePipe;
-
-  _NativeSocket._watchCommon(int id, int type)
-      : typeFlags = typeNormalSocket | type {
-    isClosedWrite = true;
-    nativeSetSocketId(id, typeFlags);
-  }
-
-  _NativeSocket.watchSignal(int id)
-      : this._watchCommon(id, typeInternalSignalSocket);
-
-  _NativeSocket.watch(int id) : this._watchCommon(id, typeInternalSocket);
-
-  bool get isListening => (typeFlags & typeListeningSocket) != 0;
-  bool get isPipe => (typeFlags & typePipe) != 0;
-  bool get isInternal => (typeFlags & typeInternalSocket) != 0;
-  bool get isInternalSignal => (typeFlags & typeInternalSignalSocket) != 0;
-  bool get isTcp => (typeFlags & typeTcpSocket) != 0;
-  bool get isUdp => (typeFlags & typeUdpSocket) != 0;
-
-  Map _toJSON(bool ref) => throw new UnimplementedError();
-  String get _serviceTypePath => throw new UnimplementedError();
-  String get _serviceTypeName => throw new UnimplementedError();
-
-  Uint8List? read(int? count) {
-    if (count != null && count <= 0) {
-      throw ArgumentError("Illegal length $count");
-    }
-    if (isClosing || isClosed) return null;
-    try {
-      Uint8List? list;
-      if (count != null) {
-        list = nativeRead(count);
-        available = nativeAvailable();
-      } else {
-        // If count is null, read as many bytes as possible.
-        // Loop here to ensure bytes that arrived while this read was
-        // issued are also read.
-        BytesBuilder builder = BytesBuilder();
-        do {
-          assert(available > 0);
-          list = nativeRead(available);
-          if (list == null) {
-            break;
-          }
-          builder.add(list);
-          available = nativeAvailable();
-        } while (available > 0);
-        if (builder.isEmpty) {
-          list = null;
-        } else {
-          list = builder.toBytes();
-        }
-      }
-      final resourceInformation = resourceInfo;
-      assert(resourceInformation != null ||
-          isPipe ||
-          isInternal ||
-          isInternalSignal);
-      if (list != null) {
-        if (resourceInformation != null) {
-          resourceInformation.totalRead += list.length;
-        }
-      }
-      if (resourceInformation != null) {
-        resourceInformation.didRead();
-      }
-      if (!const bool.fromEnvironment("dart.vm.product")) {
-        _SocketProfile.collectStatistic(
-            nativeGetSocketId(), _SocketProfileType.readBytes, list?.length);
-      }
-      return list;
-    } catch (e) {
-      reportError(e, StackTrace.current, "Read failed");
-      return null;
-    }
-  }
-
-  Datagram? receive() {
-    if (isClosing || isClosed) return null;
-    try {
-      Datagram? result = nativeRecvFrom();
-      if (result != null) {
-        final resourceInformation = resourceInfo;
-        if (resourceInformation != null) {
-          resourceInformation.totalRead += result.data.length;
-        }
-      }
-      final resourceInformation = resourceInfo;
-      if (resourceInformation != null) {
-        resourceInformation.didRead();
-      }
-      if (!const bool.fromEnvironment("dart.vm.product")) {
-        _SocketProfile.collectStatistic(nativeGetSocketId(),
-            _SocketProfileType.readBytes, result?.data.length);
-      }
-      _availableDatagram = nativeAvailableDatagram();
-      return result;
-    } catch (e) {
-      reportError(e, StackTrace.current, "Receive failed");
-      return null;
-    }
-  }
-
-  static int _fixOffset(int? offset) => offset ?? 0;
-
-  int write(List<int> buffer, int offset, int? bytes) {
-    // TODO(40614): Remove once non-nullability is sound.
-    offset = _fixOffset(offset);
-    if (bytes == null) {
-      if (offset > buffer.length) {
-        throw new RangeError.value(offset);
-      }
-      bytes = buffer.length - offset;
-    }
-    if (offset < 0) throw new RangeError.value(offset);
-    if (bytes < 0) throw new RangeError.value(bytes);
-    if ((offset + bytes) > buffer.length) {
-      throw new RangeError.value(offset + bytes);
-    }
-    if (isClosing || isClosed) return 0;
-    if (bytes == 0) return 0;
-    try {
-      _BufferAndStart bufferAndStart =
-          _ensureFastAndSerializableByteData(buffer, offset, offset + bytes);
-      if (!const bool.fromEnvironment("dart.vm.product")) {
-        _SocketProfile.collectStatistic(
-            nativeGetSocketId(),
-            _SocketProfileType.writeBytes,
-            bufferAndStart.buffer.length - bufferAndStart.start);
-      }
-      int result =
-          nativeWrite(bufferAndStart.buffer, bufferAndStart.start, bytes);
-      // The result may be negative, if we forced a short write for testing
-      // purpose. In such case, don't mark writeAvailable as false, as we don't
-      // know if we'll receive an event. It's better to just retry.
-      if (result >= 0 && result < bytes) {
-        writeAvailable = false;
-      }
-      // Negate the result, as stated above.
-      if (result < 0) result = -result;
-      final resourceInformation = resourceInfo;
-      assert(resourceInformation != null ||
-          isPipe ||
-          isInternal ||
-          isInternalSignal);
-      if (resourceInformation != null) {
-        resourceInformation.addWrite(result);
-      }
-      return result;
-    } catch (e) {
-      StackTrace st = StackTrace.current;
-      scheduleMicrotask(() => reportError(e, st, "Write failed"));
-      return 0;
-    }
-  }
-
-  int send(List<int> buffer, int offset, int bytes, InternetAddress address,
-      int port) {
-    _throwOnBadPort(port);
-    if (isClosing || isClosed) return 0;
-    try {
-      _BufferAndStart bufferAndStart =
-          _ensureFastAndSerializableByteData(buffer, offset, bytes);
-      if (!const bool.fromEnvironment("dart.vm.product")) {
-        _SocketProfile.collectStatistic(
-            nativeGetSocketId(),
-            _SocketProfileType.writeBytes,
-            bufferAndStart.buffer.length - bufferAndStart.start);
-      }
-      int result = nativeSendTo(bufferAndStart.buffer, bufferAndStart.start,
-          bytes, (address as _InternetAddress)._in_addr, port);
-      final resourceInformation = resourceInfo;
-      assert(resourceInformation != null ||
-          isPipe ||
-          isInternal ||
-          isInternalSignal);
-      if (resourceInformation != null) {
-        resourceInformation.addWrite(result);
-      }
-      return result;
-    } catch (e) {
-      StackTrace st = StackTrace.current;
-      scheduleMicrotask(() => reportError(e, st, "Send failed"));
-      return 0;
-    }
-  }
-
-  _NativeSocket? accept() {
-    // Don't issue accept if we're closing.
-    if (isClosing || isClosed) return null;
-    assert(connections > 0);
-    connections--;
-    tokens++;
-    returnTokens(listeningTokenBatchSize);
-    var socket = new _NativeSocket.normal(address);
-    if (nativeAccept(socket) != true) return null;
-    socket.localPort = localPort;
-    setupResourceInfo(socket);
-    final resourceInformation = resourceInfo;
-    assert(resourceInformation != null ||
-        isPipe ||
-        isInternal ||
-        isInternalSignal);
-    if (resourceInformation != null) {
-      // We track this as read one byte.
-      resourceInformation.addRead(1);
-    }
-    return socket;
-  }
-
-  int get port {
-    if (localAddress.type == InternetAddressType.unix) return 0;
-    if (localPort != 0) return localPort;
-    if (isClosing || isClosed) throw const SocketException.closed();
-    return localPort = nativeGetPort();
-  }
-
-  int get remotePort {
-    if (localAddress.type == InternetAddressType.unix) return 0;
-    if (isClosing || isClosed) throw const SocketException.closed();
-    return nativeGetRemotePeer()[1];
-  }
-
-  InternetAddress get address => localAddress;
-
-  InternetAddress get remoteAddress {
-    if (isClosing || isClosed) throw const SocketException.closed();
-    var result = nativeGetRemotePeer();
-    var addr = result[0];
-    var type = new InternetAddressType._from(addr[0]);
-    if (type == InternetAddressType.unix) {
-      return _InternetAddress.fromString(addr[1],
-          type: InternetAddressType.unix);
-    }
-    return _InternetAddress(type, addr[1], null, addr[2]);
-  }
-
-  void issueReadEvent() {
-    if (closedReadEventSent) return;
-    if (readEventIssued) return;
-    readEventIssued = true;
-    void issue() {
-      readEventIssued = false;
-      if (isClosing) return;
-      if (!sendReadEvents) return;
-      if (stopRead()) {
-        if (isClosedRead && !closedReadEventSent) {
-          if (isClosedWrite) close();
-          var handler = eventHandlers[closedEvent];
-          if (handler == null) return;
-          closedReadEventSent = true;
-          handler();
-        }
-        return;
-      }
-      var handler = eventHandlers[readEvent];
-      if (handler == null) return;
-      readEventIssued = true;
-      handler();
-      scheduleMicrotask(issue);
-    }
-
-    scheduleMicrotask(issue);
-  }
-
-  bool stopRead() {
-    if (isUdp) {
-      return !_availableDatagram;
-    } else {
-      return available == 0;
-    }
-  }
-
-  void issueWriteEvent({bool delayed: true}) {
-    if (writeEventIssued) return;
-    if (!writeAvailable) return;
-    void issue() {
-      writeEventIssued = false;
-      if (!writeAvailable) return;
-      if (isClosing) return;
-      if (!sendWriteEvents) return;
-      sendWriteEvents = false;
-      var handler = eventHandlers[writeEvent];
-      if (handler == null) return;
-      handler();
-    }
-
-    if (delayed) {
-      writeEventIssued = true;
-      scheduleMicrotask(issue);
-    } else {
-      issue();
-    }
-  }
-
-  // Multiplexes socket events to the socket handlers.
-  void multiplex(Object eventsObj) {
-    // TODO(paulberry): when issue #31305 is fixed, we should be able to simply
-    // declare `events` as a `covariant int` parameter.
-    int events = eventsObj as int;
-    for (int i = firstEvent; i <= lastEvent; i++) {
-      if (((events & (1 << i)) != 0)) {
-        if ((i == closedEvent || i == readEvent) && isClosedRead) continue;
-        if (isClosing && i != destroyedEvent) continue;
-        if (i == closedEvent && !isListening && !isClosing && !isClosed) {
-          isClosedRead = true;
-          issueReadEvent();
-          continue;
-        }
-
-        if (i == writeEvent) {
-          writeAvailable = true;
-          issueWriteEvent(delayed: false);
-          continue;
-        }
-
-        if (i == readEvent) {
-          if (isListening) {
-            connections++;
-          } else {
-            if (isUdp) {
-              _availableDatagram = nativeAvailableDatagram();
-            } else {
-              available = nativeAvailable();
-            }
-            issueReadEvent();
-            continue;
-          }
-        }
-
-        var handler = eventHandlers[i];
-        if (i == destroyedEvent) {
-          assert(isClosing);
-          assert(!isClosed);
-          final resourceInformation = resourceInfo;
-          assert(resourceInformation != null ||
-              isPipe ||
-              isInternal ||
-              isInternalSignal);
-          if (resourceInformation != null) {
-            _SocketResourceInfo.SocketClosed(resourceInformation);
-          }
-          isClosed = true;
-          closeCompleter.complete();
-          disconnectFromEventHandler();
-          if (handler != null) handler();
-          continue;
-        }
-
-        if (i == errorEvent) {
-          if (!isClosing) {
-            reportError(nativeGetError(), null, "");
-          }
-        } else if (!isClosed) {
-          // If the connection is closed right after it's accepted, there's a
-          // chance the close-handler is not set.
-          if (handler != null) handler();
-        }
-      }
-    }
-    if (!isListening) {
-      tokens++;
-      returnTokens(normalTokenBatchSize);
-    }
-  }
-
-  void returnTokens(int tokenBatchSize) {
-    if (!isClosing && !isClosed) {
-      assert(eventPort != null);
-      // Return in batches.
-      if (tokens == tokenBatchSize) {
-        assert(tokens < (1 << firstCommand));
-        sendToEventHandler((1 << returnTokenCommand) | tokens);
-        tokens = 0;
-      }
-    }
-  }
-
-  void setHandlers({read, write, error, closed, destroyed}) {
-    eventHandlers[readEvent] = read;
-    eventHandlers[writeEvent] = write;
-    eventHandlers[errorEvent] = error;
-    eventHandlers[closedEvent] = closed;
-    eventHandlers[destroyedEvent] = destroyed;
-  }
-
-  void setListening({bool read: true, bool write: true}) {
-    sendReadEvents = read;
-    sendWriteEvents = write;
-    if (read) issueReadEvent();
-    if (write) issueWriteEvent();
-    if (!flagsSent && !isClosing) {
-      flagsSent = true;
-      int flags = 1 << setEventMaskCommand;
-      if (!isClosedRead) flags |= 1 << readEvent;
-      if (!isClosedWrite) flags |= 1 << writeEvent;
-      sendToEventHandler(flags);
-    }
-  }
-
-  Future close() {
-    if (!isClosing && !isClosed) {
-      sendToEventHandler(1 << closeCommand);
-      isClosing = true;
-    }
-    return closeCompleter.future;
-  }
-
-  void shutdown(SocketDirection direction) {
-    if (!isClosing && !isClosed) {
-      switch (direction) {
-        case SocketDirection.receive:
-          shutdownRead();
-          break;
-        case SocketDirection.send:
-          shutdownWrite();
-          break;
-        case SocketDirection.both:
-          close();
-          break;
-        default:
-          throw new ArgumentError(direction);
-      }
-    }
-  }
-
-  void shutdownWrite() {
-    if (!isClosing && !isClosed) {
-      if (closedReadEventSent) {
-        close();
-      } else {
-        sendToEventHandler(1 << shutdownWriteCommand);
-      }
-      isClosedWrite = true;
-    }
-  }
-
-  void shutdownRead() {
-    if (!isClosing && !isClosed) {
-      if (isClosedWrite) {
-        close();
-      } else {
-        sendToEventHandler(1 << shutdownReadCommand);
-      }
-      isClosedRead = true;
-    }
-  }
-
-  void sendToEventHandler(int data) {
-    int fullData = (typeFlags & typeTypeMask) | data;
-    assert(!isClosing);
-    connectToEventHandler();
-    _EventHandler._sendData(this, eventPort!.sendPort, fullData);
-  }
-
-  void connectToEventHandler() {
-    assert(!isClosed);
-    if (eventPort == null) {
-      eventPort = new RawReceivePort(multiplex);
-    }
-    if (!connectedResourceHandler) {
-      registerExtension(
-          'ext.dart.io.getOpenSockets', _SocketResourceInfo.getOpenSockets);
-      registerExtension('ext.dart.io.getSocketByID',
-          _SocketResourceInfo.getSocketInfoMapByID);
-
-      connectedResourceHandler = true;
-    }
-  }
-
-  void disconnectFromEventHandler() {
-    eventPort!.close();
-    eventPort = null;
-    // Now that we don't track this Socket anymore, we can clear the owner
-    // field.
-    owner = null;
-  }
-
-  // Check whether this is an error response from a native port call.
-  static bool isErrorResponse(response) {
-    return response is List && response[0] != _successResponse;
-  }
-
-  // Create the appropriate error/exception from different returned
-  // error objects.
-  static createError(error, String message,
-      [InternetAddress? address, int? port]) {
-    if (error is OSError) {
-      return new SocketException(message,
-          osError: error, address: address, port: port);
-    } else if (error is List) {
-      assert(isErrorResponse(error));
-      switch (error[0]) {
-        case _illegalArgumentResponse:
-          return new ArgumentError();
-        case _osErrorResponse:
-          return new SocketException(message,
-              osError: new OSError(error[2], error[1]),
-              address: address,
-              port: port);
-        default:
-          return new Exception("Unknown error");
-      }
-    } else {
-      return new SocketException(message, address: address, port: port);
-    }
-  }
-
-  void reportError(error, StackTrace? st, String message) {
-    var e =
-        createError(error, message, isUdp || isTcp ? address : null, localPort);
-    // Invoke the error handler if any.
-    if (eventHandlers[errorEvent] != null) {
-      eventHandlers[errorEvent](e, st);
-    }
-    // For all errors we close the socket
-    close();
-  }
-
-  dynamic getOption(SocketOption option) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(option, "option");
-    var result = nativeGetOption(option._value, address.type._value);
-    if (result is OSError) throw result;
-    return result;
-  }
-
-  bool setOption(SocketOption option, value) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(option, "option");
-    nativeSetOption(option._value, address.type._value, value);
-    return true;
-  }
-
-  Uint8List getRawOption(RawSocketOption option) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(option, "option");
-    ArgumentError.checkNotNull(option.value, "option.value");
-    nativeGetRawOption(option.level, option.option, option.value);
-    return option.value;
-  }
-
-  void setRawOption(RawSocketOption option) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(option, "option");
-    ArgumentError.checkNotNull(option.value, "option.value");
-    nativeSetRawOption(option.level, option.option, option.value);
-  }
-
-  InternetAddress? multicastAddress(
-      InternetAddress addr, NetworkInterface? interface) {
-    // On Mac OS using the interface index for joining IPv4 multicast groups
-    // is not supported. Here the IP address of the interface is needed.
-    if (Platform.isMacOS && addr.type == InternetAddressType.IPv4) {
-      if (interface != null) {
-        for (int i = 0; i < interface.addresses.length; i++) {
-          if (interface.addresses[i].type == InternetAddressType.IPv4) {
-            return interface.addresses[i];
-          }
-        }
-        // No IPv4 address found on the interface.
-        throw new SocketException(
-            "The network interface does not have an address "
-            "of the same family as the multicast address");
-      } else {
-        // Default to the ANY address if no interface is specified.
-        return InternetAddress.anyIPv4;
-      }
-    } else {
-      return null;
-    }
-  }
-
-  void joinMulticast(InternetAddress addr, NetworkInterface? interface) {
-    final interfaceAddr =
-        multicastAddress(addr, interface) as _InternetAddress?;
-    var interfaceIndex = interface == null ? 0 : interface.index;
-    nativeJoinMulticast((addr as _InternetAddress)._in_addr,
-        interfaceAddr?._in_addr, interfaceIndex);
-  }
-
-  void leaveMulticast(InternetAddress addr, NetworkInterface? interface) {
-    final interfaceAddr =
-        multicastAddress(addr, interface) as _InternetAddress?;
-    var interfaceIndex = interface == null ? 0 : interface.index;
-    nativeLeaveMulticast((addr as _InternetAddress)._in_addr,
-        interfaceAddr?._in_addr, interfaceIndex);
-  }
-
-  void nativeSetSocketId(int id, int typeFlags) native "Socket_SetSocketId";
-  int nativeAvailable() native "Socket_Available";
-  bool nativeAvailableDatagram() native "Socket_AvailableDatagram";
-  Uint8List? nativeRead(int len) native "Socket_Read";
-  Datagram? nativeRecvFrom() native "Socket_RecvFrom";
-  int nativeWrite(List<int> buffer, int offset, int bytes)
-      native "Socket_WriteList";
-  int nativeSendTo(List<int> buffer, int offset, int bytes, Uint8List address,
-      int port) native "Socket_SendTo";
-  nativeCreateConnect(Uint8List addr, int port, int scope_id)
-      native "Socket_CreateConnect";
-  nativeCreateUnixDomainConnect(String addr, _Namespace namespace)
-      native "Socket_CreateUnixDomainConnect";
-  nativeCreateBindConnect(Uint8List addr, int port, Uint8List sourceAddr,
-      int scope_id) native "Socket_CreateBindConnect";
-  nativeCreateUnixDomainBindConnect(String addr, String sourceAddr,
-      _Namespace namespace) native "Socket_CreateUnixDomainBindConnect";
-  bool isBindError(int errorNumber) native "SocketBase_IsBindError";
-  nativeCreateBindListen(Uint8List addr, int port, int backlog, bool v6Only,
-      bool shared, int scope_id) native "ServerSocket_CreateBindListen";
-  nativeCreateUnixDomainBindListen(String addr, int backlog, bool shared,
-      _Namespace namespace) native "ServerSocket_CreateUnixDomainBindListen";
-  nativeCreateBindDatagram(Uint8List addr, int port, bool reuseAddress,
-      bool reusePort, int ttl) native "Socket_CreateBindDatagram";
-  bool nativeAccept(_NativeSocket socket) native "ServerSocket_Accept";
-  int nativeGetPort() native "Socket_GetPort";
-  List nativeGetRemotePeer() native "Socket_GetRemotePeer";
-  int nativeGetSocketId() native "Socket_GetSocketId";
-  OSError nativeGetError() native "Socket_GetError";
-  nativeGetOption(int option, int protocol) native "Socket_GetOption";
-  void nativeGetRawOption(int level, int option, Uint8List data)
-      native "Socket_GetRawOption";
-  void nativeSetOption(int option, int protocol, value)
-      native "Socket_SetOption";
-  void nativeSetRawOption(int level, int option, Uint8List data)
-      native "Socket_SetRawOption";
-  void nativeJoinMulticast(Uint8List addr, Uint8List? interfaceAddr,
-      int interfaceIndex) native "Socket_JoinMulticast";
-  void nativeLeaveMulticast(Uint8List addr, Uint8List? interfaceAddr,
-      int interfaceIndex) native "Socket_LeaveMulticast";
-}
-
-class _RawServerSocket extends Stream<RawSocket> implements RawServerSocket {
-  final _NativeSocket _socket;
-  StreamController<RawSocket>? _controller;
-  bool _v6Only;
-
-  static Future<_RawServerSocket> bind(
-      address, int port, int backlog, bool v6Only, bool shared) {
-    _throwOnBadPort(port);
-    if (backlog < 0) throw new ArgumentError("Invalid backlog $backlog");
-    return _NativeSocket.bind(address, port, backlog, v6Only, shared)
-        .then((socket) => new _RawServerSocket(socket, v6Only));
-  }
-
-  _RawServerSocket(this._socket, this._v6Only);
-
-  StreamSubscription<RawSocket> listen(void onData(RawSocket event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    if (_controller != null) {
-      throw new StateError("Stream was already listened to");
-    }
-    var zone = Zone.current;
-    final controller = _controller = new StreamController(
-        sync: true,
-        onListen: _onSubscriptionStateChange,
-        onCancel: _onSubscriptionStateChange,
-        onPause: _onPauseStateChange,
-        onResume: _onPauseStateChange);
-    _socket.setHandlers(
-        read: zone.bindCallbackGuarded(() {
-          while (_socket.connections > 0) {
-            var socket = _socket.accept();
-            if (socket == null) return;
-            if (!const bool.fromEnvironment("dart.vm.product")) {
-              _SocketProfile.collectNewSocket(socket.nativeGetSocketId(),
-                  _tcpSocket, socket.address, socket.port);
-            }
-            controller.add(_RawSocket(socket));
-            if (controller.isPaused) return;
-          }
-        }),
-        error: zone.bindBinaryCallbackGuarded((Object e, StackTrace? st) {
-          controller.addError(e, st);
-          controller.close();
-        }),
-        destroyed: () => controller.close());
-    return controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  int get port => _socket.port;
-
-  InternetAddress get address => _socket.address;
-
-  Future<RawServerSocket> close() {
-    return _socket.close().then<RawServerSocket>((_) => this);
-  }
-
-  void _pause() {
-    _socket.setListening(read: false, write: false);
-  }
-
-  void _resume() {
-    _socket.setListening(read: true, write: false);
-  }
-
-  void _onSubscriptionStateChange() {
-    if (_controller!.hasListener) {
-      _resume();
-    } else {
-      _socket.close();
-    }
-  }
-
-  void _onPauseStateChange() {
-    if (_controller!.isPaused) {
-      _pause();
-    } else {
-      _resume();
-    }
-  }
-
-  void set _owner(owner) {
-    _socket.owner = owner;
-  }
-}
-
-class _RawSocket extends Stream<RawSocketEvent> implements RawSocket {
-  final _NativeSocket _socket;
-  final _controller = new StreamController<RawSocketEvent>(sync: true);
-  bool _readEventsEnabled = true;
-  bool _writeEventsEnabled = true;
-
-  // Flag to handle Ctrl-D closing of stdio on Mac OS.
-  bool _isMacOSTerminalInput = false;
-
-  static Future<RawSocket> connect(
-      dynamic host, int port, dynamic sourceAddress, Duration? timeout) {
-    return _NativeSocket.connect(host, port, sourceAddress, timeout)
-        .then((socket) {
-      if (!const bool.fromEnvironment("dart.vm.product")) {
-        _SocketProfile.collectNewSocket(
-            socket.nativeGetSocketId(), _tcpSocket, socket.address, port);
-      }
-      return _RawSocket(socket);
-    });
-  }
-
-  static Future<ConnectionTask<_RawSocket>> startConnect(
-      dynamic host, int port, dynamic sourceAddress) {
-    return _NativeSocket.startConnect(host, port, sourceAddress)
-        .then((ConnectionTask<_NativeSocket> nativeTask) {
-      final Future<_RawSocket> raw =
-          nativeTask.socket.then((_NativeSocket nativeSocket) {
-        if (!const bool.fromEnvironment("dart.vm.product")) {
-          _SocketProfile.collectNewSocket(nativeSocket.nativeGetSocketId(),
-              _tcpSocket, nativeSocket.address, port);
-        }
-        return _RawSocket(nativeSocket);
-      });
-      return ConnectionTask<_RawSocket>._(raw, nativeTask._onCancel);
-    });
-  }
-
-  _RawSocket(this._socket) {
-    var zone = Zone.current;
-    _controller
-      ..onListen = _onSubscriptionStateChange
-      ..onCancel = _onSubscriptionStateChange
-      ..onPause = _onPauseStateChange
-      ..onResume = _onPauseStateChange;
-    _socket.setHandlers(
-        read: () => _controller.add(RawSocketEvent.read),
-        write: () {
-          // The write event handler is automatically disabled by the
-          // event handler when it fires.
-          writeEventsEnabled = false;
-          _controller.add(RawSocketEvent.write);
-        },
-        closed: () => _controller.add(RawSocketEvent.readClosed),
-        destroyed: () {
-          _controller.add(RawSocketEvent.closed);
-          _controller.close();
-        },
-        error: zone.bindBinaryCallbackGuarded((Object e, StackTrace? st) {
-          _controller.addError(e, st);
-          _socket.close();
-        }));
-  }
-
-  factory _RawSocket._writePipe() {
-    var native = new _NativeSocket.pipe();
-    native.isClosedRead = true;
-    native.closedReadEventSent = true;
-    return new _RawSocket(native);
-  }
-
-  factory _RawSocket._readPipe(int? fd) {
-    var native = new _NativeSocket.pipe();
-    native.isClosedWrite = true;
-    if (fd != null) _getStdioHandle(native, fd);
-    var result = new _RawSocket(native);
-    if (fd != null) {
-      var socketType = _StdIOUtils._nativeSocketType(result._socket);
-      result._isMacOSTerminalInput =
-          Platform.isMacOS && socketType == _stdioHandleTypeTerminal;
-    }
-    return result;
-  }
-
-  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  int available() => _socket.available;
-
-  Uint8List? read([int? len]) {
-    if (_isMacOSTerminalInput) {
-      var available = this.available();
-      if (available == 0) return null;
-      var data = _socket.read(len);
-      if (data == null || data.length < available) {
-        // Reading less than available from a Mac OS terminal indicate Ctrl-D.
-        // This is interpreted as read closed.
-        scheduleMicrotask(() => _controller.add(RawSocketEvent.readClosed));
-      }
-      return data;
-    } else {
-      return _socket.read(len);
-    }
-  }
-
-  int write(List<int> buffer, [int offset = 0, int? count]) =>
-      _socket.write(buffer, offset, count);
-
-  Future<RawSocket> close() => _socket.close().then<RawSocket>((_) {
-        if (!const bool.fromEnvironment("dart.vm.product")) {
-          _SocketProfile.collectStatistic(
-              _socket.nativeGetSocketId(), _SocketProfileType.endTime);
-        }
-        return this;
-      });
-
-  void shutdown(SocketDirection direction) => _socket.shutdown(direction);
-
-  int get port => _socket.port;
-
-  int get remotePort => _socket.remotePort;
-
-  InternetAddress get address => _socket.address;
-
-  InternetAddress get remoteAddress => _socket.remoteAddress;
-
-  bool get readEventsEnabled => _readEventsEnabled;
-  void set readEventsEnabled(bool value) {
-    if (value != _readEventsEnabled) {
-      _readEventsEnabled = value;
-      if (!_controller.isPaused) _resume();
-    }
-  }
-
-  bool get writeEventsEnabled => _writeEventsEnabled;
-  void set writeEventsEnabled(bool value) {
-    if (value != _writeEventsEnabled) {
-      _writeEventsEnabled = value;
-      if (!_controller.isPaused) _resume();
-    }
-  }
-
-  bool setOption(SocketOption option, bool enabled) =>
-      _socket.setOption(option, enabled);
-
-  Uint8List getRawOption(RawSocketOption option) =>
-      _socket.getRawOption(option);
-  void setRawOption(RawSocketOption option) => _socket.setRawOption(option);
-
-  _pause() {
-    _socket.setListening(read: false, write: false);
-  }
-
-  void _resume() {
-    _socket.setListening(read: _readEventsEnabled, write: _writeEventsEnabled);
-  }
-
-  void _onPauseStateChange() {
-    if (_controller.isPaused) {
-      _pause();
-    } else {
-      _resume();
-    }
-  }
-
-  void _onSubscriptionStateChange() {
-    if (_controller.hasListener) {
-      _resume();
-    } else {
-      _socket.close();
-    }
-  }
-
-  void set _owner(owner) {
-    _socket.owner = owner;
-  }
-}
-
-@patch
-class ServerSocket {
-  @patch
-  static Future<ServerSocket> _bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    return _ServerSocket.bind(address, port, backlog, v6Only, shared);
-  }
-}
-
-class _ServerSocket extends Stream<Socket> implements ServerSocket {
-  final _socket;
-
-  static Future<_ServerSocket> bind(
-      address, int port, int backlog, bool v6Only, bool shared) {
-    return _RawServerSocket.bind(address, port, backlog, v6Only, shared)
-        .then((socket) => new _ServerSocket(socket));
-  }
-
-  _ServerSocket(this._socket);
-
-  StreamSubscription<Socket> listen(void onData(Socket event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _socket.map<Socket>((rawSocket) => new _Socket(rawSocket)).listen(
-        onData,
-        onError: onError,
-        onDone: onDone,
-        cancelOnError: cancelOnError);
-  }
-
-  int get port => _socket.port;
-
-  InternetAddress get address => _socket.address;
-
-  Future<ServerSocket> close() =>
-      _socket.close().then<ServerSocket>((_) => this);
-
-  void set _owner(owner) {
-    _socket._owner = owner;
-  }
-}
-
-@patch
-class Socket {
-  @patch
-  static Future<Socket> _connect(dynamic host, int port,
-      {dynamic sourceAddress, Duration? timeout}) {
-    return RawSocket.connect(host, port,
-            sourceAddress: sourceAddress, timeout: timeout)
-        .then((socket) => new _Socket(socket));
-  }
-
-  @patch
-  static Future<ConnectionTask<Socket>> _startConnect(dynamic host, int port,
-      {dynamic sourceAddress}) {
-    return RawSocket.startConnect(host, port, sourceAddress: sourceAddress)
-        .then((rawTask) {
-      Future<Socket> socket =
-          rawTask.socket.then((rawSocket) => new _Socket(rawSocket));
-      return new ConnectionTask<Socket>._(socket, rawTask._onCancel);
-    });
-  }
-}
-
-class _SocketStreamConsumer extends StreamConsumer<List<int>> {
-  StreamSubscription? subscription;
-  final _Socket socket;
-  int? offset;
-  List<int>? buffer;
-  bool paused = false;
-  Completer<Socket>? streamCompleter;
-
-  _SocketStreamConsumer(this.socket);
-
-  Future<Socket> addStream(Stream<List<int>> stream) {
-    socket._ensureRawSocketSubscription();
-    final completer = streamCompleter = new Completer<Socket>();
-    if (socket._raw != null) {
-      subscription = stream.listen((data) {
-        assert(!paused);
-        assert(buffer == null);
-        buffer = data;
-        offset = 0;
-        try {
-          write();
-        } catch (e) {
-          socket.destroy();
-          stop();
-          done(e);
-        }
-      }, onError: (error, [stackTrace]) {
-        socket.destroy();
-        done(error, stackTrace);
-      }, onDone: () {
-        done();
-      }, cancelOnError: true);
-    }
-    return completer.future;
-  }
-
-  Future<Socket> close() {
-    socket._consumerDone();
-    return new Future.value(socket);
-  }
-
-  void write() {
-    final sub = subscription;
-    if (sub == null) return;
-    // Write as much as possible.
-    offset =
-        offset! + socket._write(buffer!, offset!, buffer!.length - offset!);
-    if (offset! < buffer!.length) {
-      if (!paused) {
-        paused = true;
-        sub.pause();
-      }
-      socket._enableWriteEvent();
-    } else {
-      buffer = null;
-      if (paused) {
-        paused = false;
-        sub.resume();
-      }
-    }
-  }
-
-  void done([error, stackTrace]) {
-    final completer = streamCompleter;
-    if (completer != null) {
-      if (error != null) {
-        completer.completeError(error, stackTrace);
-      } else {
-        completer.complete(socket);
-      }
-      streamCompleter = null;
-    }
-  }
-
-  void stop() {
-    final sub = subscription;
-    if (sub == null) return;
-    sub.cancel();
-    subscription = null;
-    paused = false;
-    socket._disableWriteEvent();
-  }
-}
-
-class _Socket extends Stream<Uint8List> implements Socket {
-  RawSocket? _raw; // Set to null when the raw socket is closed.
-  bool _closed = false; // Set to true when the raw socket is closed.
-  final _controller = new StreamController<Uint8List>(sync: true);
-  bool _controllerClosed = false;
-  late _SocketStreamConsumer _consumer;
-  late IOSink _sink;
-  StreamSubscription? _subscription;
-  var _detachReady;
-
-  _Socket(RawSocket raw) : _raw = raw {
-    _controller
-      ..onListen = _onSubscriptionStateChange
-      ..onCancel = _onSubscriptionStateChange
-      ..onPause = _onPauseStateChange
-      ..onResume = _onPauseStateChange;
-    _consumer = new _SocketStreamConsumer(this);
-    _sink = new IOSink(_consumer);
-
-    // Disable read events until there is a subscription.
-    raw.readEventsEnabled = false;
-
-    // Disable write events until the consumer needs it for pending writes.
-    raw.writeEventsEnabled = false;
-  }
-
-  factory _Socket._writePipe() {
-    return new _Socket(new _RawSocket._writePipe());
-  }
-
-  factory _Socket._readPipe([int? fd]) {
-    return new _Socket(new _RawSocket._readPipe(fd));
-  }
-
-  // Note: this code seems a bit suspicious because _raw can be _RawSocket and
-  // it can be _RawSecureSocket because _SecureSocket extends _Socket
-  // and these two types are incompatible because _RawSecureSocket._socket
-  // is Socket and not _NativeSocket.
-  _NativeSocket get _nativeSocket => (_raw as _RawSocket)._socket;
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Encoding get encoding => _sink.encoding;
-
-  void set encoding(Encoding value) {
-    _sink.encoding = value;
-  }
-
-  void write(Object? obj) => _sink.write(obj);
-
-  void writeln([Object? obj = ""]) => _sink.writeln(obj);
-
-  void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
-
-  void writeAll(Iterable objects, [String sep = ""]) =>
-      _sink.writeAll(objects, sep);
-
-  void add(List<int> bytes) => _sink.add(bytes);
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    throw new UnsupportedError("Cannot send errors on sockets");
-  }
-
-  Future addStream(Stream<List<int>> stream) {
-    return _sink.addStream(stream);
-  }
-
-  Future flush() => _sink.flush();
-
-  Future close() => _sink.close();
-
-  Future get done => _sink.done;
-
-  void destroy() {
-    // Destroy can always be called to get rid of a socket.
-    if (_raw == null) return;
-    _consumer.stop();
-    _closeRawSocket();
-    _controllerClosed = true;
-    _controller.close();
-  }
-
-  bool setOption(SocketOption option, bool enabled) {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    return raw.setOption(option, enabled);
-  }
-
-  Uint8List getRawOption(RawSocketOption option) {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    return raw.getRawOption(option);
-  }
-
-  void setRawOption(RawSocketOption option) {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    raw.setRawOption(option);
-  }
-
-  int get port {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    return raw.port;
-  }
-
-  InternetAddress get address {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    return raw.address;
-  }
-
-  int get remotePort {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    return raw.remotePort;
-  }
-
-  InternetAddress get remoteAddress {
-    final raw = _raw;
-    if (raw == null) throw const SocketException.closed();
-    return raw.remoteAddress;
-  }
-
-  Future _detachRaw() {
-    _detachReady = new Completer();
-    _sink.close();
-    return _detachReady.future.then((_) {
-      assert(_consumer.buffer == null);
-      var raw = _raw;
-      _raw = null;
-      return [raw, _subscription];
-    });
-  }
-
-  // Ensure a subscription on the raw socket. Both the stream and the
-  // consumer needs a subscription as they share the error and done
-  // events from the raw socket.
-  void _ensureRawSocketSubscription() {
-    final raw = _raw;
-    if (_subscription == null && raw != null) {
-      _subscription = raw.listen(_onData,
-          onError: _onError, onDone: _onDone, cancelOnError: true);
-    }
-  }
-
-  _closeRawSocket() {
-    var raw = _raw!;
-    _raw = null;
-    _closed = true;
-    raw.close();
-  }
-
-  void _onSubscriptionStateChange() {
-    final raw = _raw;
-    if (_controller.hasListener) {
-      _ensureRawSocketSubscription();
-      // Enable read events for providing data to subscription.
-      if (raw != null) {
-        raw.readEventsEnabled = true;
-      }
-    } else {
-      _controllerClosed = true;
-      if (raw != null) {
-        raw.shutdown(SocketDirection.receive);
-      }
-    }
-  }
-
-  void _onPauseStateChange() {
-    _raw?.readEventsEnabled = !_controller.isPaused;
-  }
-
-  void _onData(event) {
-    switch (event) {
-      case RawSocketEvent.read:
-        if (_raw == null) break;
-        var buffer = _raw!.read();
-        if (buffer != null) _controller.add(buffer);
-        break;
-      case RawSocketEvent.write:
-        _consumer.write();
-        break;
-      case RawSocketEvent.readClosed:
-        _controllerClosed = true;
-        _controller.close();
-        break;
-    }
-  }
-
-  void _onDone() {
-    if (!_controllerClosed) {
-      _controllerClosed = true;
-      _controller.close();
-    }
-    _consumer.done();
-  }
-
-  void _onError(error, stackTrace) {
-    if (!_controllerClosed) {
-      _controllerClosed = true;
-      _controller.addError(error, stackTrace);
-      _controller.close();
-    }
-    _consumer.done(error, stackTrace);
-  }
-
-  int _write(List<int> data, int offset, int length) {
-    final raw = _raw;
-    if (raw != null) {
-      return raw.write(data, offset, length);
-    }
-    return 0;
-  }
-
-  void _enableWriteEvent() {
-    _raw?.writeEventsEnabled = true;
-  }
-
-  void _disableWriteEvent() {
-    _raw?.writeEventsEnabled = false;
-  }
-
-  void _consumerDone() {
-    if (_detachReady != null) {
-      _detachReady.complete(null);
-    } else {
-      final raw = _raw;
-      if (raw != null) {
-        raw.shutdown(SocketDirection.send);
-        _disableWriteEvent();
-      }
-    }
-  }
-
-  void set _owner(owner) {
-    // Note: _raw can be _RawSocket and _RawSecureSocket which are two
-    // incompatible types.
-    (_raw as dynamic)._owner = owner;
-  }
-}
-
-@patch
-class RawDatagramSocket {
-  @patch
-  static Future<RawDatagramSocket> bind(host, int port,
-      {bool reuseAddress: true, bool reusePort: false, int ttl: 1}) {
-    return _RawDatagramSocket.bind(host, port, reuseAddress, reusePort, ttl);
-  }
-}
-
-class _RawDatagramSocket extends Stream<RawSocketEvent>
-    implements RawDatagramSocket {
-  _NativeSocket _socket;
-  late StreamController<RawSocketEvent> _controller;
-  bool _readEventsEnabled = true;
-  bool _writeEventsEnabled = true;
-
-  _RawDatagramSocket(this._socket) {
-    var zone = Zone.current;
-    _controller = new StreamController<RawSocketEvent>(
-        sync: true,
-        onListen: _onSubscriptionStateChange,
-        onCancel: _onSubscriptionStateChange,
-        onPause: _onPauseStateChange,
-        onResume: _onPauseStateChange);
-    _socket.setHandlers(
-        read: () => _controller.add(RawSocketEvent.read),
-        write: () {
-          // The write event handler is automatically disabled by the
-          // event handler when it fires.
-          writeEventsEnabled = false;
-          _controller.add(RawSocketEvent.write);
-        },
-        closed: () => _controller.add(RawSocketEvent.readClosed),
-        destroyed: () {
-          _controller.add(RawSocketEvent.closed);
-          _controller.close();
-        },
-        error: zone.bindBinaryCallbackGuarded((Object e, StackTrace? st) {
-          _controller.addError(e, st);
-          _socket.close();
-        }));
-  }
-
-  static Future<RawDatagramSocket> bind(
-      host, int port, bool reuseAddress, bool reusePort, int ttl) {
-    _throwOnBadPort(port);
-    _throwOnBadTtl(ttl);
-    return _NativeSocket.bindDatagram(host, port, reuseAddress, reusePort, ttl)
-        .then((socket) {
-      if (!const bool.fromEnvironment("dart.vm.product")) {
-        _SocketProfile.collectNewSocket(
-            socket.nativeGetSocketId(), _udpSocket, socket.address, port);
-      }
-      return _RawDatagramSocket(socket);
-    });
-  }
-
-  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Future close() => _socket.close().then<RawDatagramSocket>((_) {
-        if (!const bool.fromEnvironment("dart.vm.product")) {
-          _SocketProfile.collectStatistic(
-              _socket.nativeGetSocketId(), _SocketProfileType.endTime);
-        }
-        return this;
-      });
-
-  int send(List<int> buffer, InternetAddress address, int port) =>
-      _socket.send(buffer, 0, buffer.length, address, port);
-
-  Datagram? receive() {
-    return _socket.receive();
-  }
-
-  void joinMulticast(InternetAddress group, [NetworkInterface? interface]) {
-    _socket.joinMulticast(group, interface);
-  }
-
-  void leaveMulticast(InternetAddress group, [NetworkInterface? interface]) {
-    _socket.leaveMulticast(group, interface);
-  }
-
-  bool get readEventsEnabled => _readEventsEnabled;
-  void set readEventsEnabled(bool value) {
-    if (value != _readEventsEnabled) {
-      _readEventsEnabled = value;
-      if (!_controller.isPaused) _resume();
-    }
-  }
-
-  bool get writeEventsEnabled => _writeEventsEnabled;
-  void set writeEventsEnabled(bool value) {
-    if (value != _writeEventsEnabled) {
-      _writeEventsEnabled = value;
-      if (!_controller.isPaused) _resume();
-    }
-  }
-
-  bool get multicastLoopback =>
-      _socket.getOption(SocketOption._ipMulticastLoop);
-  void set multicastLoopback(bool value) =>
-      _socket.setOption(SocketOption._ipMulticastLoop, value);
-
-  int get multicastHops => _socket.getOption(SocketOption._ipMulticastHops);
-  void set multicastHops(int value) =>
-      _socket.setOption(SocketOption._ipMulticastHops, value);
-
-  NetworkInterface get multicastInterface => throw UnimplementedError();
-  void set multicastInterface(NetworkInterface? value) =>
-      throw UnimplementedError();
-
-  bool get broadcastEnabled => _socket.getOption(SocketOption._ipBroadcast);
-  void set broadcastEnabled(bool value) =>
-      _socket.setOption(SocketOption._ipBroadcast, value);
-
-  int get port => _socket.port;
-
-  InternetAddress get address => _socket.address;
-
-  _pause() {
-    _socket.setListening(read: false, write: false);
-  }
-
-  void _resume() {
-    _socket.setListening(read: _readEventsEnabled, write: _writeEventsEnabled);
-  }
-
-  void _onPauseStateChange() {
-    if (_controller.isPaused) {
-      _pause();
-    } else {
-      _resume();
-    }
-  }
-
-  void _onSubscriptionStateChange() {
-    if (_controller.hasListener) {
-      _resume();
-    } else {
-      _socket.close();
-    }
-  }
-
-  Uint8List getRawOption(RawSocketOption option) =>
-      _socket.getRawOption(option);
-  void setRawOption(RawSocketOption option) => _socket.setRawOption(option);
-}
-
-@pragma("vm:entry-point", "call")
-Datagram _makeDatagram(
-    Uint8List data, String address, Uint8List in_addr, int port, int type) {
-  return new Datagram(
-      data,
-      _InternetAddress(InternetAddressType._from(type), address, null, in_addr),
-      port);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/stdio_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/stdio_patch.dart
deleted file mode 100644
index bc32221..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/stdio_patch.dart
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class _StdIOUtils {
-  @patch
-  static Stdin _getStdioInputStream(int fd) {
-    final type = _getStdioHandleType(fd);
-    if (type is OSError) {
-      throw FileSystemException(
-          "Failed to get type of stdio handle (fd $fd)", "", type);
-    }
-    switch (type) {
-      case _stdioHandleTypeTerminal:
-      case _stdioHandleTypePipe:
-      case _stdioHandleTypeSocket:
-      case _stdioHandleTypeOther:
-        return new Stdin._(new _Socket._readPipe(fd), fd);
-      case _stdioHandleTypeFile:
-        return new Stdin._(new _FileStream.forStdin(), fd);
-    }
-    throw new UnsupportedError("Unexpected handle type $type");
-  }
-
-  @patch
-  static _getStdioOutputStream(int fd) {
-    final type = _getStdioHandleType(fd);
-    if (type is OSError) {
-      throw FileSystemException(
-          "Failed to get type of stdio handle (fd $fd)", "", type);
-    }
-    return new Stdout._(new IOSink(new _StdConsumer(fd)), fd);
-  }
-
-  @patch
-  static int? _socketType(Socket socket) {
-    if (socket is _Socket) return _nativeSocketType(socket._nativeSocket);
-    return null;
-  }
-
-  static int _nativeSocketType(_NativeSocket nativeSocket) {
-    var result = _getSocketType(nativeSocket);
-    if (result is OSError) {
-      throw new FileSystemException("Error retrieving socket type", "", result);
-    }
-    return result;
-  }
-
-  @patch
-  static _getStdioHandleType(int fd) native "File_GetStdioHandleType";
-}
-
-@patch
-class Stdin {
-  @patch
-  int readByteSync() {
-    var result = _readByte(_fd);
-    if (result is OSError) {
-      throw new StdinException("Error reading byte from stdin", result);
-    }
-    return result;
-  }
-
-  @patch
-  bool get echoMode {
-    var result = _echoMode(_fd);
-    if (result is OSError) {
-      throw new StdinException("Error getting terminal echo mode", result);
-    }
-    return result;
-  }
-
-  @patch
-  void set echoMode(bool enabled) {
-    if (!_EmbedderConfig._maySetEchoMode) {
-      throw new UnsupportedError(
-          "This embedder disallows setting Stdin.echoMode");
-    }
-    var result = _setEchoMode(_fd, enabled);
-    if (result is OSError) {
-      throw new StdinException("Error setting terminal echo mode", result);
-    }
-  }
-
-  @patch
-  bool get lineMode {
-    var result = _lineMode(_fd);
-    if (result is OSError) {
-      throw new StdinException("Error getting terminal line mode", result);
-    }
-    return result;
-  }
-
-  @patch
-  void set lineMode(bool enabled) {
-    if (!_EmbedderConfig._maySetLineMode) {
-      throw new UnsupportedError(
-          "This embedder disallows setting Stdin.lineMode");
-    }
-    var result = _setLineMode(_fd, enabled);
-    if (result is OSError) {
-      throw new StdinException("Error setting terminal line mode", result);
-    }
-  }
-
-  @patch
-  bool get supportsAnsiEscapes {
-    var result = _supportsAnsiEscapes(_fd);
-    if (result is OSError) {
-      throw new StdinException("Error determining ANSI support", result);
-    }
-    return result;
-  }
-
-  static _echoMode(int fd) native "Stdin_GetEchoMode";
-  static _setEchoMode(int fd, bool enabled) native "Stdin_SetEchoMode";
-  static _lineMode(int fd) native "Stdin_GetLineMode";
-  static _setLineMode(int fd, bool enabled) native "Stdin_SetLineMode";
-  static _readByte(int fd) native "Stdin_ReadByte";
-  static _supportsAnsiEscapes(int fd) native "Stdin_AnsiSupported";
-}
-
-@patch
-class Stdout {
-  @patch
-  bool _hasTerminal(int fd) {
-    try {
-      _terminalSize(fd);
-      return true;
-    } catch (_) {
-      return false;
-    }
-  }
-
-  @patch
-  int _terminalColumns(int fd) => _terminalSize(fd)[0];
-  @patch
-  int _terminalLines(int fd) => _terminalSize(fd)[1];
-
-  static List _terminalSize(int fd) {
-    var size = _getTerminalSize(fd);
-    if (size is! List) {
-      throw new StdoutException("Could not get terminal size", size);
-    }
-    return size;
-  }
-
-  static _getTerminalSize(int fd) native "Stdout_GetTerminalSize";
-
-  @patch
-  static bool _supportsAnsiEscapes(int fd) {
-    var result = _getAnsiSupported(fd);
-    if (result is! bool) {
-      throw new StdoutException("Error determining ANSI support", result);
-    }
-    return result;
-  }
-
-  static _getAnsiSupported(int fd) native "Stdout_AnsiSupported";
-}
-
-bool _getStdioHandle(_NativeSocket socket, int num)
-    native "Socket_GetStdioHandle";
-_getSocketType(_NativeSocket nativeSocket) native "Socket_GetType";
diff --git a/sdk_nnbd/lib/_internal/vm/bin/sync_socket_patch.dart b/sdk_nnbd/lib/_internal/vm/bin/sync_socket_patch.dart
deleted file mode 100644
index f602449..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/sync_socket_patch.dart
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright (c) 2017, 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.
-
-// part of "common_patch.dart";
-
-@patch
-class RawSynchronousSocket {
-  @patch
-  static RawSynchronousSocket connectSync(host, int port) {
-    return _RawSynchronousSocket.connectSync(host, port);
-  }
-}
-
-class _RawSynchronousSocket implements RawSynchronousSocket {
-  final _NativeSynchronousSocket _socket;
-
-  _RawSynchronousSocket(this._socket);
-
-  static RawSynchronousSocket connectSync(host, int port) {
-    _throwOnBadPort(port);
-    return new _RawSynchronousSocket(
-        _NativeSynchronousSocket.connectSync(host, port));
-  }
-
-  InternetAddress get address => _socket.address;
-  int get port => _socket.port;
-  InternetAddress get remoteAddress => _socket.remoteAddress;
-  int get remotePort => _socket.remotePort;
-
-  int available() => _socket.available;
-
-  void closeSync() => _socket.closeSync();
-
-  int readIntoSync(List<int> buffer, [int start = 0, int? end]) =>
-      _socket.readIntoSync(buffer, start, end);
-
-  List<int>? readSync(int bytes) => _socket.readSync(bytes);
-
-  void shutdown(SocketDirection direction) => _socket.shutdown(direction);
-
-  void writeFromSync(List<int> buffer, [int start = 0, int? end]) =>
-      _socket.writeFromSync(buffer, start, end);
-}
-
-// The NativeFieldWrapperClass1 can not be used with a mixin, due to missing
-// implicit constructor.
-class _NativeSynchronousSocketNativeWrapper extends NativeFieldWrapperClass1 {}
-
-// The _NativeSynchronousSocket class encapsulates a synchronous OS socket.
-class _NativeSynchronousSocket extends _NativeSynchronousSocketNativeWrapper {
-  // Socket close state.
-  bool isClosed = false;
-  bool isClosedRead = false;
-  bool isClosedWrite = false;
-
-  // Holds the address used to connect the socket.
-  late InternetAddress localAddress;
-
-  // Holds the port of the socket, 0 if not known.
-  int localPort = 0;
-
-  // Always set by setupResourceInfo called by connectSync.
-  late _SocketResourceInfo resourceInfo;
-
-  static _NativeSynchronousSocket connectSync(host, int port) {
-    if (host == null) {
-      throw new ArgumentError("Parameter host cannot be null");
-    }
-    late List<_InternetAddress> addresses;
-    var error = null;
-    if (host is _InternetAddress) {
-      addresses = [host];
-    } else {
-      try {
-        addresses = lookup(host);
-      } catch (e) {
-        error = e;
-      }
-      if (error != null || addresses == null || addresses.isEmpty) {
-        throw createError(error, "Failed host lookup: '$host'");
-      }
-    }
-    var it = addresses.iterator;
-    _NativeSynchronousSocket connectNext() {
-      if (!it.moveNext()) {
-        // Could not connect. Throw the first connection error we encountered.
-        assert(error != null);
-        throw error;
-      }
-      var address = it.current;
-      var socket = new _NativeSynchronousSocket();
-      socket.localAddress = address;
-      var result = socket._nativeCreateConnectSync(address._in_addr, port);
-      if (result is OSError) {
-        // Keep first error, if present.
-        if (error == null) {
-          error = createError(result, "Connection failed", address, port);
-        }
-        return connectNext();
-      } else {
-        // Query the local port, for error messages.
-        try {
-          socket.port;
-        } catch (e) {
-          if (error == null) {
-            error = createError(e, "Connection failed", address, port);
-          }
-          return connectNext();
-        }
-        setupResourceInfo(socket);
-      }
-      return socket;
-    }
-
-    return connectNext();
-  }
-
-  InternetAddress get address => localAddress;
-  int get available => _nativeAvailable();
-
-  int get port {
-    if (localPort != 0) {
-      return localPort;
-    }
-    if (isClosed) {
-      throw const SocketException.closed();
-    }
-    var result = _nativeGetPort();
-    if (result is OSError) {
-      throw result;
-    }
-    return localPort = result;
-  }
-
-  InternetAddress get remoteAddress {
-    if (isClosed) {
-      throw const SocketException.closed();
-    }
-    var result = _nativeGetRemotePeer();
-    if (result is OSError) {
-      throw result;
-    }
-    var addr = result[0];
-    var type = InternetAddressType._from(addr[0]);
-    if (type == InternetAddressType.unix) {
-      return _InternetAddress.fromString(addr[1],
-          type: InternetAddressType.unix);
-    }
-    return _InternetAddress(type, addr[1], null, addr[2]);
-  }
-
-  int get remotePort {
-    if (isClosed) {
-      throw const SocketException.closed();
-    }
-    var result = _nativeGetRemotePeer();
-    if (result is OSError) {
-      throw result;
-    }
-    return result[1];
-  }
-
-  void closeSync() {
-    if (!isClosed) {
-      _nativeCloseSync();
-      _SocketResourceInfo.SocketClosed(resourceInfo);
-      isClosed = true;
-    }
-  }
-
-  // Create the appropriate error/exception from different returned
-  // error objects.
-  static createError(error, String message,
-      [InternetAddress? address, int? port]) {
-    if (error is OSError) {
-      return new SocketException(message,
-          osError: error, address: address, port: port);
-    } else {
-      return new SocketException(message, address: address, port: port);
-    }
-  }
-
-  static List<_InternetAddress> lookup(String host,
-      {InternetAddressType type: InternetAddressType.ANY}) {
-    var response = _nativeLookupRequest(host, type._value);
-    if (response is OSError) {
-      throw response;
-    }
-    return <_InternetAddress>[
-      for (int i = 0; i < response.length; ++i)
-        new _InternetAddress(InternetAddressType._from(response[i][0]),
-            response[i][1], host, response[i][2]),
-    ];
-  }
-
-  int readIntoSync(List<int> buffer, int start, int? end) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(buffer, "buffer");
-    ArgumentError.checkNotNull(start, "start");
-    _checkAvailable();
-    if (isClosedRead) {
-      throw new SocketException("Socket is closed for reading");
-    }
-    end = RangeError.checkValidRange(start, end, buffer.length);
-    if (end == start) {
-      return 0;
-    }
-    var result = _nativeReadInto(buffer, start, end - start);
-    if (result is OSError) {
-      throw new SocketException("readIntoSync failed", osError: result);
-    }
-    resourceInfo.addRead(result);
-    return result;
-  }
-
-  List<int>? readSync(int len) {
-    _checkAvailable();
-    if (isClosedRead) {
-      throw new SocketException("Socket is closed for reading");
-    }
-
-    if ((len != null) && (len < 0)) {
-      throw new ArgumentError("Illegal length $len");
-    }
-    if (len == 0) {
-      return null;
-    }
-    var result = _nativeRead(len);
-    if (result is OSError) {
-      throw result;
-    }
-    if (result is List<int>) {
-      resourceInfo.totalRead += result.length;
-    }
-    resourceInfo.didRead();
-    return result;
-  }
-
-  static void setupResourceInfo(_NativeSynchronousSocket socket) {
-    socket.resourceInfo = new _SocketResourceInfo(socket);
-  }
-
-  void shutdown(SocketDirection direction) {
-    if (isClosed) {
-      return;
-    }
-    switch (direction) {
-      case SocketDirection.receive:
-        shutdownRead();
-        break;
-      case SocketDirection.send:
-        shutdownWrite();
-        break;
-      case SocketDirection.both:
-        closeSync();
-        break;
-      default:
-        throw new ArgumentError(direction);
-    }
-  }
-
-  void shutdownRead() {
-    if (isClosed || isClosedRead) {
-      return;
-    }
-    if (isClosedWrite) {
-      closeSync();
-    } else {
-      _nativeShutdownRead();
-    }
-    isClosedRead = true;
-  }
-
-  void shutdownWrite() {
-    if (isClosed || isClosedWrite) {
-      return;
-    }
-    if (isClosedRead) {
-      closeSync();
-    } else {
-      _nativeShutdownWrite();
-    }
-    isClosedWrite = true;
-  }
-
-  void writeFromSync(List<int> buffer, int start, int? end) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(buffer, "buffer");
-    ArgumentError.checkNotNull(start, "start");
-    _checkAvailable();
-    if (isClosedWrite) {
-      throw new SocketException("Socket is closed for writing");
-    }
-    end = RangeError.checkValidRange(start, end, buffer.length);
-    if (end == start) {
-      return;
-    }
-    _BufferAndStart bufferAndStart =
-        _ensureFastAndSerializableByteData(buffer, start, end);
-    var result = _nativeWrite(bufferAndStart.buffer, bufferAndStart.start,
-        end - (start - bufferAndStart.start));
-    if (result is OSError) {
-      throw new SocketException("writeFromSync failed", osError: result);
-    }
-    resourceInfo.addWrite(result);
-  }
-
-  void _checkAvailable() {
-    if (isClosed) {
-      throw const SocketException.closed();
-    }
-  }
-
-  // Native method declarations.
-  static _nativeLookupRequest(host, int type)
-      native "SynchronousSocket_LookupRequest";
-  _nativeCreateConnectSync(host, int port)
-      native "SynchronousSocket_CreateConnectSync";
-  _nativeAvailable() native "SynchronousSocket_Available";
-  _nativeCloseSync() native "SynchronousSocket_CloseSync";
-  int _nativeGetPort() native "SynchronousSocket_GetPort";
-  List _nativeGetRemotePeer() native "SynchronousSocket_GetRemotePeer";
-  _nativeRead(int len) native "SynchronousSocket_Read";
-  _nativeReadInto(List<int> buffer, int offset, int bytes)
-      native "SynchronousSocket_ReadList";
-  _nativeShutdownRead() native "SynchronousSocket_ShutdownRead";
-  _nativeShutdownWrite() native "SynchronousSocket_ShutdownWrite";
-  _nativeWrite(List<int> buffer, int offset, int bytes)
-      native "SynchronousSocket_WriteList";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/bin/vmservice_io.dart b/sdk_nnbd/lib/_internal/vm/bin/vmservice_io.dart
deleted file mode 100644
index aea026b..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/vmservice_io.dart
+++ /dev/null
@@ -1,266 +0,0 @@
-// Copyright (c) 2013, 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.
-
-library vmservice_io;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-import 'dart:_vmservice';
-
-part 'vmservice_server.dart';
-
-// The TCP ip/port that the HTTP server listens on.
-@pragma('vm:entry-point')
-int _port = 0;
-@pragma('vm:entry-point')
-String _ip = '';
-// Should the HTTP server auto start?
-@pragma('vm:entry-point')
-bool _autoStart = false;
-// Should the HTTP server require an auth code?
-@pragma('vm:entry-point')
-bool _authCodesDisabled = false;
-// Should the HTTP server run in devmode?
-@pragma('vm:entry-point')
-bool _originCheckDisabled = false;
-// Location of file to output VM service connection info.
-@pragma('vm:entry-point')
-String? _serviceInfoFilename;
-@pragma('vm:entry-point')
-bool _isWindows = false;
-@pragma('vm:entry-point')
-bool _isFuchsia = false;
-@pragma('vm:entry-point')
-var _signalWatch = null;
-var _signalSubscription;
-@pragma("vm:entry-point")
-bool _enableServicePortFallback = false;
-
-// HTTP server.
-Server? server;
-Future<Server>? serverFuture;
-
-Server _lazyServerBoot() {
-  var localServer = server;
-  if (localServer != null) {
-    return localServer;
-  }
-  // Lazily create service.
-  final service = VMService();
-  // Lazily create server.
-  localServer = Server(service, _ip, _port, _originCheckDisabled,
-      _authCodesDisabled, _serviceInfoFilename, _enableServicePortFallback);
-  server = localServer;
-  return localServer;
-}
-
-Future cleanupCallback() async {
-  // Cancel the sigquit subscription.
-  if (_signalSubscription != null) {
-    await _signalSubscription.cancel();
-    _signalSubscription = null;
-  }
-  final localServer = server;
-  if (localServer != null) {
-    try {
-      await localServer.cleanup(true);
-    } catch (e, st) {
-      print('Error in vm-service shutdown: $e\n$st\n');
-    }
-  }
-  if (_registerSignalHandlerTimer != null) {
-    _registerSignalHandlerTimer!.cancel();
-    _registerSignalHandlerTimer = null;
-  }
-  // Call out to embedder's shutdown callback.
-  _shutdown();
-}
-
-Future<Uri> createTempDirCallback(String base) async {
-  final temp = await Directory.systemTemp.createTemp(base);
-  // Underneath the temporary directory, create a directory with the
-  // same name as the DevFS name [base].
-  final fsUri = temp.uri.resolveUri(Uri.directory(base));
-  await Directory.fromUri(fsUri).create();
-  return fsUri;
-}
-
-Future deleteDirCallback(Uri path) async =>
-    await Directory.fromUri(path).delete(recursive: true);
-
-class PendingWrite {
-  PendingWrite(this.uri, this.bytes);
-  final completer = Completer<void>();
-  final Uri uri;
-  final List<int> bytes;
-
-  Future write() async {
-    final file = File.fromUri(uri);
-    final parent_directory = file.parent;
-    await parent_directory.create(recursive: true);
-    if (await file.exists()) {
-      await file.delete();
-    }
-    await file.writeAsBytes(bytes);
-    completer.complete();
-    WriteLimiter._writeCompleted();
-  }
-}
-
-class WriteLimiter {
-  static final pendingWrites = <PendingWrite>[];
-
-  // non-rooted Android devices have a very low limit for the number of
-  // open files. Artificially cap ourselves to 16.
-  static const kMaxOpenWrites = 16;
-  static int openWrites = 0;
-
-  static Future scheduleWrite(Uri path, List<int> bytes) async {
-    // Create a new pending write.
-    final pw = PendingWrite(path, bytes);
-    pendingWrites.add(pw);
-    _maybeWriteFiles();
-    return pw.completer.future;
-  }
-
-  static _maybeWriteFiles() {
-    while (openWrites < kMaxOpenWrites) {
-      if (pendingWrites.length > 0) {
-        final pw = pendingWrites.removeLast();
-        pw.write();
-        openWrites++;
-      } else {
-        break;
-      }
-    }
-  }
-
-  static _writeCompleted() {
-    openWrites--;
-    assert(openWrites >= 0);
-    _maybeWriteFiles();
-  }
-}
-
-Future writeFileCallback(Uri path, List<int> bytes) async =>
-    WriteLimiter.scheduleWrite(path, bytes);
-
-Future<void> writeStreamFileCallback(Uri path, Stream<List<int>> bytes) async {
-  final file = File.fromUri(path);
-  final parent_directory = file.parent;
-  await parent_directory.create(recursive: true);
-  if (await file.exists()) {
-    await file.delete();
-  }
-  final sink = await file.openWrite();
-  await sink.addStream(bytes);
-  await sink.close();
-}
-
-Future<List<int>> readFileCallback(Uri path) async =>
-    await File.fromUri(path).readAsBytes();
-
-Future<List<Map<String, dynamic>>> listFilesCallback(Uri dirPath) async {
-  final dir = Directory.fromUri(dirPath);
-  final dirPathStr = dirPath.path;
-  final stream = dir.list(recursive: true);
-  final result = <Map<String, dynamic>>[];
-  await for (var fileEntity in stream) {
-    final filePath = Uri.file(fileEntity.path).path;
-    final stat = await fileEntity.stat();
-    if (stat.type == FileSystemEntityType.file &&
-        filePath.startsWith(dirPathStr)) {
-      final map = <String, dynamic>{};
-      map['name'] = '/' + filePath.substring(dirPathStr.length);
-      map['size'] = stat.size;
-      map['modified'] = stat.modified.millisecondsSinceEpoch;
-      result.add(map);
-    }
-  }
-  return result;
-}
-
-Uri? serverInformationCallback() => _lazyServerBoot().serverAddress;
-
-Future<Uri?> webServerControlCallback(bool enable) async {
-  final _server = _lazyServerBoot();
-  if (_server.running != enable) {
-    if (enable) {
-      await _server.startup();
-    } else {
-      await _server.shutdown(true);
-    }
-  }
-  return _server.serverAddress;
-}
-
-void webServerAcceptNewWebSocketConnections(bool enable) {
-  final _server = _lazyServerBoot();
-  _server.acceptNewWebSocketConnections = enable;
-}
-
-void _clearFuture(_) {
-  serverFuture = null;
-}
-
-_onSignal(ProcessSignal signal) {
-  if (serverFuture != null) {
-    // Still waiting.
-    return;
-  }
-  final _server = _lazyServerBoot();
-  // Toggle HTTP server.
-  if (_server.running) {
-    _server.shutdown(true).then(_clearFuture);
-  } else {
-    _server.startup().then(_clearFuture);
-  }
-}
-
-Timer? _registerSignalHandlerTimer;
-
-_registerSignalHandler() {
-  _registerSignalHandlerTimer = null;
-  if (_signalWatch == null) {
-    // Cannot register for signals.
-    return;
-  }
-  if (_isWindows || _isFuchsia) {
-    // Cannot register for signals on Windows or Fuchsia.
-    return;
-  }
-  _signalSubscription = _signalWatch(ProcessSignal.sigquit).listen(_onSignal);
-}
-
-@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
-main() {
-  // Set embedder hooks.
-  VMServiceEmbedderHooks.cleanup = cleanupCallback;
-  VMServiceEmbedderHooks.createTempDir = createTempDirCallback;
-  VMServiceEmbedderHooks.deleteDir = deleteDirCallback;
-  VMServiceEmbedderHooks.writeFile = writeFileCallback;
-  VMServiceEmbedderHooks.writeStreamFile = writeStreamFileCallback;
-  VMServiceEmbedderHooks.readFile = readFileCallback;
-  VMServiceEmbedderHooks.listFiles = listFilesCallback;
-  VMServiceEmbedderHooks.serverInformation = serverInformationCallback;
-  VMServiceEmbedderHooks.webServerControl = webServerControlCallback;
-  VMServiceEmbedderHooks.acceptNewWebSocketConnections =
-      webServerAcceptNewWebSocketConnections;
-  // Always instantiate the vmservice object so that the exit message
-  // can be delivered and waiting loaders can be cancelled.
-  VMService();
-  if (_autoStart) {
-    final _server = _lazyServerBoot();
-    _server.startup();
-    // It's just here to push an event on the event loop so that we invoke the
-    // scheduled microtasks.
-    Timer.run(() {});
-  }
-  // Register signal handler after a small delay to avoid stalling main
-  // isolate startup.
-  _registerSignalHandlerTimer = Timer(shortDelay, _registerSignalHandler);
-}
-
-_shutdown() native 'VMServiceIO_Shutdown';
diff --git a/sdk_nnbd/lib/_internal/vm/bin/vmservice_server.dart b/sdk_nnbd/lib/_internal/vm/bin/vmservice_server.dart
deleted file mode 100644
index 26f1bfa..0000000
--- a/sdk_nnbd/lib/_internal/vm/bin/vmservice_server.dart
+++ /dev/null
@@ -1,511 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of vmservice_io;
-
-final bool silentObservatory = bool.fromEnvironment('SILENT_OBSERVATORY');
-
-void serverPrint(String s) {
-  if (silentObservatory) {
-    // We've been requested to be silent.
-    return;
-  }
-  print(s);
-}
-
-class WebSocketClient extends Client {
-  static const int parseErrorCode = 4000;
-  static const int binaryMessageErrorCode = 4001;
-  static const int notMapErrorCode = 4002;
-  static const int idErrorCode = 4003;
-  final WebSocket socket;
-
-  WebSocketClient(this.socket, VMService service) : super(service) {
-    socket.listen((message) => onWebSocketMessage(message));
-    socket.done.then((_) => close());
-  }
-
-  disconnect() {
-    if (socket != null) {
-      socket.close();
-    }
-  }
-
-  void onWebSocketMessage(message) {
-    if (message is String) {
-      Map map;
-      try {
-        map = json.decode(message);
-      } catch (e) {
-        socket.close(parseErrorCode, 'Message parse error: $e');
-        return;
-      }
-      if (map is! Map) {
-        socket.close(notMapErrorCode, 'Message must be a JSON map.');
-        return;
-      }
-      try {
-        final rpc = Message.fromJsonRpc(this, map);
-        switch (rpc.type) {
-          case MessageType.Request:
-            onRequest(rpc);
-            break;
-          case MessageType.Notification:
-            onNotification(rpc);
-            break;
-          case MessageType.Response:
-            onResponse(rpc);
-            break;
-        }
-      } on dynamic catch (e) {
-        socket.close(idErrorCode, e.message);
-      }
-    } else {
-      socket.close(binaryMessageErrorCode, 'Message must be a string.');
-    }
-  }
-
-  void post(Response? result) {
-    if (result == null) {
-      // The result of a notification event. Do nothing.
-      return;
-    }
-    try {
-      switch (result.kind) {
-        case ResponsePayloadKind.String:
-        case ResponsePayloadKind.Binary:
-          socket.add(result.payload);
-          break;
-        case ResponsePayloadKind.Utf8String:
-          socket.addUtf8Text(result.payload);
-          break;
-      }
-    } on StateError catch (_) {
-      // VM has shutdown, do nothing.
-      return;
-    }
-  }
-
-  Map<String, dynamic> toJson() => {
-        ...super.toJson(),
-        'type': 'WebSocketClient',
-        'socket': '$socket',
-      };
-}
-
-class HttpRequestClient extends Client {
-  static final jsonContentType =
-      ContentType('application', 'json', charset: 'utf-8');
-  final HttpRequest request;
-
-  HttpRequestClient(this.request, VMService service)
-      : super(service, sendEvents: false);
-
-  disconnect() {
-    request.response.close();
-    close();
-  }
-
-  void post(Response? result) {
-    if (result == null) {
-      // The result of a notification event. Nothing to do other than close the
-      // connection.
-      close();
-      return;
-    }
-
-    HttpResponse response = request.response;
-    // We closed the connection for bad origins earlier.
-    response.headers.add('Access-Control-Allow-Origin', '*');
-    response.headers.contentType = jsonContentType;
-    switch (result.kind) {
-      case ResponsePayloadKind.String:
-        response.write(result.payload);
-        break;
-      case ResponsePayloadKind.Utf8String:
-        response.add(result.payload);
-        break;
-      case ResponsePayloadKind.Binary:
-        throw 'Can not handle binary responses';
-    }
-    response.close();
-    close();
-  }
-
-  Map<String, dynamic> toJson() {
-    final map = super.toJson();
-    map['type'] = 'HttpRequestClient';
-    map['request'] = '$request';
-    return map;
-  }
-}
-
-class Server {
-  static const WEBSOCKET_PATH = '/ws';
-  static const ROOT_REDIRECT_PATH = '/index.html';
-
-  final VMService _service;
-  final String _ip;
-  final bool _originCheckDisabled;
-  final bool _authCodesDisabled;
-  final bool _enableServicePortFallback;
-  final String? _serviceInfoFilename;
-  HttpServer? _server;
-  bool get running => _server != null;
-  bool acceptNewWebSocketConnections = true;
-  int _port = -1;
-
-  /// Returns the server address including the auth token.
-  Uri? get serverAddress {
-    if (!running) {
-      return null;
-    }
-    final server = _server!;
-    final ip = server.address.address;
-    final port = server.port;
-    final path = !_authCodesDisabled ? '$serviceAuthToken/' : '/';
-    return Uri(scheme: 'http', host: ip, port: port, path: path);
-  }
-
-  // On Fuchsia, authentication codes are disabled by default. To enable, the authentication token
-  // would have to be written into the hub alongside the port number.
-  Server(
-      this._service,
-      this._ip,
-      this._port,
-      this._originCheckDisabled,
-      bool authCodesDisabled,
-      this._serviceInfoFilename,
-      this._enableServicePortFallback)
-      : _authCodesDisabled = (authCodesDisabled || Platform.isFuchsia);
-
-  bool _isAllowedOrigin(String origin) {
-    Uri uri;
-    try {
-      uri = Uri.parse(origin);
-    } catch (_) {
-      return false;
-    }
-
-    // Explicitly add localhost and 127.0.0.1 on any port (necessary for
-    // adb port forwarding).
-    if ((uri.host == 'localhost') ||
-        (uri.host == '::1') ||
-        (uri.host == '127.0.0.1')) {
-      return true;
-    }
-
-    final server = _server!;
-    if ((uri.port == server.port) &&
-        ((uri.host == server.address.address) ||
-            (uri.host == server.address.host))) {
-      return true;
-    }
-
-    return false;
-  }
-
-  bool _originCheck(HttpRequest request) {
-    if (_originCheckDisabled) {
-      // Always allow.
-      return true;
-    }
-    // First check the web-socket specific origin.
-    List<String>? origins = request.headers['Sec-WebSocket-Origin'];
-    if (origins == null) {
-      // Fall back to the general Origin field.
-      origins = request.headers['Origin'];
-    }
-    if (origins == null) {
-      // No origin sent. This is a non-browser client or a same-origin request.
-      return true;
-    }
-    for (final origin in origins) {
-      if (_isAllowedOrigin(origin)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /// Checks the [requestUri] for the service auth token and returns the path
-  /// as a String. If the service auth token check fails, returns null.
-  /// Returns a Uri if a redirect is required.
-  dynamic _checkAuthTokenAndGetPath(Uri requestUri) {
-    if (_authCodesDisabled) {
-      return requestUri.path == '/' ? ROOT_REDIRECT_PATH : requestUri.path;
-    }
-    final List<String> requestPathSegments = requestUri.pathSegments;
-    if (requestPathSegments.isEmpty) {
-      // Malformed.
-      return null;
-    }
-    // Check that we were given the auth token.
-    final authToken = requestPathSegments[0];
-    if (authToken != serviceAuthToken) {
-      // Malformed.
-      return null;
-    }
-    // Missing a trailing '/'. We'll need to redirect to serve
-    // ROOT_REDIRECT_PATH correctly, otherwise the response is misinterpreted.
-    if (requestPathSegments.length == 1) {
-      // requestPathSegments is unmodifiable. Copy it.
-      final pathSegments = List<String>.from(requestPathSegments);
-
-      // Adding an empty string to the path segments results in the path having
-      // a trailing '/'.
-      pathSegments.add('');
-
-      return requestUri.replace(pathSegments: pathSegments);
-    }
-    // Construct the actual request path by chopping off the auth token.
-    return (requestPathSegments[1] == '')
-        ? ROOT_REDIRECT_PATH
-        : '/${requestPathSegments.sublist(1).join('/')}';
-  }
-
-  Future _requestHandler(HttpRequest request) async {
-    if (!_originCheck(request)) {
-      // This is a cross origin attempt to connect
-      request.response.statusCode = HttpStatus.forbidden;
-      request.response.write('forbidden origin');
-      request.response.close();
-      return;
-    }
-    if (request.method == 'PUT') {
-      // PUT requests are forwarded to DevFS for processing.
-
-      List fsNameList;
-      List? fsPathList;
-      List? fsPathBase64List;
-      List? fsUriBase64List;
-      Object? fsName;
-      Object? fsPath;
-      Uri? fsUri;
-
-      try {
-        // Extract the fs name and fs path from the request headers.
-        fsNameList = request.headers['dev_fs_name']!;
-        fsName = fsNameList[0];
-
-        // Prefer Uri encoding first.
-        fsUriBase64List = request.headers['dev_fs_uri_b64'];
-        if ((fsUriBase64List != null) && (fsUriBase64List.length > 0)) {
-          final decodedFsUri = utf8.decode(base64.decode(fsUriBase64List[0]));
-          fsUri = Uri.parse(decodedFsUri);
-        }
-
-        // Fallback to path encoding.
-        if (fsUri == null) {
-          fsPathList = request.headers['dev_fs_path'];
-          fsPathBase64List = request.headers['dev_fs_path_b64'];
-          // If the 'dev_fs_path_b64' header field was sent, use that instead.
-          if ((fsPathBase64List != null) && fsPathBase64List.isNotEmpty) {
-            fsPath = utf8.decode(base64.decode(fsPathBase64List[0]));
-          } else if (fsPathList != null && fsPathList.isNotEmpty) {
-            fsPath = fsPathList[0];
-          }
-        }
-      } catch (e) {/* ignore */}
-
-      String result;
-      try {
-        result = await _service.devfs.handlePutStream(fsName, fsPath, fsUri,
-            request.cast<List<int>>().transform(gzip.decoder));
-      } catch (e) {
-        request.response.statusCode = HttpStatus.internalServerError;
-        request.response.write(e);
-        request.response.close();
-        return;
-      }
-
-      if (result != null) {
-        request.response.headers.contentType =
-            HttpRequestClient.jsonContentType;
-        request.response.write(result);
-      }
-      request.response.close();
-      return;
-    }
-    if (request.method != 'GET') {
-      // Not a GET request. Do nothing.
-      request.response.statusCode = HttpStatus.methodNotAllowed;
-      request.response.write('method not allowed');
-      request.response.close();
-      return;
-    }
-
-    final result = _checkAuthTokenAndGetPath(request.uri);
-    if (result == null) {
-      // Either no authentication code was provided when one was expected or an
-      // incorrect authentication code was provided.
-      request.response.statusCode = HttpStatus.forbidden;
-      request.response.write('missing or invalid authentication code');
-      request.response.close();
-      return;
-    } else if (result is Uri) {
-      // The URI contains the valid auth token but is missing a trailing '/'.
-      // Redirect to the same URI with the trailing '/' to correctly serve
-      // index.html.
-      request.response.redirect(result);
-      return;
-    }
-
-    final String path = result;
-    if (path == WEBSOCKET_PATH) {
-      if (acceptNewWebSocketConnections) {
-        WebSocketTransformer.upgrade(request,
-                compression: CompressionOptions.compressionOff)
-            .then((WebSocket webSocket) {
-          WebSocketClient(webSocket, _service);
-        });
-      } else {
-        // Forward the websocket connection request to DDS.
-        request.response.redirect(_service.ddsUri!);
-      }
-      return;
-    }
-
-    if (assets == null) {
-      request.response.headers.contentType = ContentType.text;
-      request.response.write('This VM was built without the Observatory UI.');
-      request.response.close();
-      return;
-    }
-    final asset = assets[path];
-    if (asset != null) {
-      // Serving up a static asset (e.g. .css, .html, .png).
-      request.response.headers.contentType = ContentType.parse(asset.mimeType);
-      request.response.add(asset.data);
-      request.response.close();
-      return;
-    }
-    // HTTP based service request.
-    final client = HttpRequestClient(request, _service);
-    final message = Message.fromUri(
-        client, Uri(path: path, queryParameters: request.uri.queryParameters));
-    client.onRequest(message); // exception free, no need to try catch
-  }
-
-  Future<void> _dumpServiceInfoToFile(String serviceInfoFilenameLocal) async {
-    final serviceInfo = <String, dynamic>{
-      'uri': serverAddress.toString(),
-    };
-    final file = File.fromUri(Uri.parse(serviceInfoFilenameLocal));
-    return file.writeAsString(json.encode(serviceInfo));
-  }
-
-  Future<Server> startup() async {
-    if (_server != null) {
-      // Already running.
-      return this;
-    }
-
-    // Startup HTTP server.
-    var pollError;
-    var pollStack;
-    Future<bool> poll() async {
-      try {
-        var address;
-        var addresses = await InternetAddress.lookup(_ip);
-        // Prefer IPv4 addresses.
-        for (int i = 0; i < addresses.length; i++) {
-          address = addresses[i];
-          if (address.type == InternetAddressType.IPv4) break;
-        }
-        _server = await HttpServer.bind(address, _port);
-        return true;
-      } catch (e, st) {
-        pollError = e;
-        pollStack = st;
-        return false;
-      }
-    }
-
-    // poll for the network for ~10 seconds.
-    int attempts = 0;
-    final maxAttempts = 10;
-    while (!await poll()) {
-      attempts++;
-      serverPrint('Observatory server failed to start after $attempts tries');
-      if (attempts > maxAttempts) {
-        serverPrint('Could not start Observatory HTTP server:\n'
-            '$pollError\n$pollStack\n');
-        _notifyServerState('');
-        onServerAddressChange(null);
-        return this;
-      }
-      if (_port != 0 && _enableServicePortFallback && attempts >= 3) {
-        _port = 0;
-        serverPrint('Falling back to automatic port selection');
-      }
-      await Future<void>.delayed(const Duration(seconds: 1));
-    }
-    if (_service.isExiting) {
-      serverPrint('Observatory HTTP server exiting before listening as '
-          'vm service has received exit request\n');
-      await shutdown(true);
-      return this;
-    }
-    final server = _server!;
-    server.listen(_requestHandler, cancelOnError: true);
-    serverPrint('Observatory listening on $serverAddress');
-    if (Platform.isFuchsia) {
-      // Create a file with the port number.
-      final tmp = Directory.systemTemp.path;
-      final path = '$tmp/dart.services/${server.port}';
-      serverPrint('Creating $path');
-      File(path)..createSync(recursive: true);
-    }
-    final serviceInfoFilenameLocal = _serviceInfoFilename;
-    if (serviceInfoFilenameLocal != null &&
-        serviceInfoFilenameLocal.isNotEmpty) {
-      await _dumpServiceInfoToFile(serviceInfoFilenameLocal);
-    }
-    // Server is up and running.
-    _notifyServerState(serverAddress.toString());
-    onServerAddressChange('$serverAddress');
-    return this;
-  }
-
-  Future<void> cleanup(bool force) {
-    final serverLocal = _server;
-    if (serverLocal == null) {
-      return Future.value();
-    }
-    if (Platform.isFuchsia) {
-      // Remove the file with the port number.
-      final tmp = Directory.systemTemp.path;
-      final path = '$tmp/dart.services/${serverLocal.port}';
-      serverPrint('Deleting $path');
-      File(path)..deleteSync();
-    }
-    return serverLocal.close(force: force);
-  }
-
-  Future<Server> shutdown(bool forced) {
-    if (_server == null) {
-      // Not started.
-      return Future.value(this);
-    }
-
-    // Shutdown HTTP server and subscription.
-    Uri oldServerAddress = serverAddress!;
-    return cleanup(forced).then((_) {
-      serverPrint('Observatory no longer listening on $oldServerAddress');
-      _server = null;
-      _notifyServerState('');
-      onServerAddressChange(null);
-      return this;
-    }).catchError((e, st) {
-      _server = null;
-      serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
-      _notifyServerState('');
-      onServerAddressChange(null);
-      return this;
-    });
-  }
-}
-
-void _notifyServerState(String uri) native 'VMServiceIO_NotifyServerState';
diff --git a/sdk_nnbd/lib/_internal/vm/lib/array.dart b/sdk_nnbd/lib/_internal/vm/lib/array.dart
deleted file mode 100644
index 5304841..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/array.dart
+++ /dev/null
@@ -1,268 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@pragma("vm:entry-point")
-class _List<E> extends FixedLengthListBase<E> {
-  @pragma("vm:exact-result-type",
-      <dynamic>[_List, "result-type-uses-passed-type-arguments"])
-  @pragma("vm:prefer-inline")
-  factory _List(length) native "List_allocate";
-
-  E operator [](int index) native "List_getIndexed";
-
-  void operator []=(int index, E value) {
-    _setIndexed(index, value);
-  }
-
-  void _setIndexed(int index, E value) native "List_setIndexed";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "List_getLength";
-
-  @pragma("vm:prefer-inline")
-  _List _slice(int start, int count, bool needsTypeArgument) {
-    if (count <= 64) {
-      final result = needsTypeArgument ? new _List<E>(count) : new _List(count);
-      for (int i = 0; i < result.length; i++) {
-        result[i] = this[start + i];
-      }
-      return result;
-    } else {
-      return _sliceInternal(start, count, needsTypeArgument);
-    }
-  }
-
-  _List _sliceInternal(int start, int count, bool needsTypeArgument)
-      native "List_slice";
-
-  // List interface.
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    if (start < 0 || start > this.length) {
-      throw new RangeError.range(start, 0, this.length);
-    }
-    if (end < start || end > this.length) {
-      throw new RangeError.range(end, start, this.length);
-    }
-    int length = end - start;
-    if (length == 0) return;
-    if (identical(this, iterable)) {
-      Lists.copy(this, skipCount, this, start, length);
-    } else if (ClassID.getID(iterable) == ClassID.cidArray) {
-      final _List<E> iterableAsList = unsafeCast<_List<E>>(iterable);
-      Lists.copy(iterableAsList, skipCount, this, start, length);
-    } else if (iterable is List<E>) {
-      Lists.copy(iterable, skipCount, this, start, length);
-    } else {
-      Iterator<E> it = iterable.iterator;
-      while (skipCount > 0) {
-        if (!it.moveNext()) return;
-        skipCount--;
-      }
-      for (int i = start; i < end; i++) {
-        if (!it.moveNext()) return;
-        this[i] = it.current;
-      }
-    }
-  }
-
-  void setAll(int index, Iterable<E> iterable) {
-    if (index < 0 || index > this.length) {
-      throw new RangeError.range(index, 0, this.length, "index");
-    }
-    List<E> iterableAsList;
-    if (identical(this, iterable)) {
-      iterableAsList = this;
-    } else if (ClassID.getID(iterable) == ClassID.cidArray) {
-      iterableAsList = unsafeCast<_List<E>>(iterable);
-    } else if (iterable is List<E>) {
-      iterableAsList = iterable;
-    } else {
-      for (var value in iterable) {
-        this[index++] = value;
-      }
-      return;
-    }
-    int length = iterableAsList.length;
-    if (index + length > this.length) {
-      throw new RangeError.range(index + length, 0, this.length);
-    }
-    Lists.copy(iterableAsList, 0, this, index, length);
-  }
-
-  List<E> sublist(int start, [int? end]) {
-    final int listLength = this.length;
-    final int actualEnd = RangeError.checkValidRange(start, end, listLength);
-    int length = actualEnd - start;
-    if (length == 0) return <E>[];
-    var result = new _GrowableList<E>._withData(_slice(start, length, false));
-    result._setLength(length);
-    return result;
-  }
-
-  // Iterable interface.
-
-  @pragma("vm:prefer-inline")
-  void forEach(f(E element)) {
-    final length = this.length;
-    for (int i = 0; i < length; i++) {
-      f(this[i]);
-    }
-  }
-
-  @pragma("vm:prefer-inline")
-  Iterator<E> get iterator {
-    return new _FixedSizeArrayIterator<E>(this);
-  }
-
-  E get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  E get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  List<E> toList({bool growable: true}) {
-    var length = this.length;
-    if (length > 0) {
-      _List result = _slice(0, length, !growable);
-      if (growable) {
-        return new _GrowableList<E>._withData(result).._setLength(length);
-      }
-      return unsafeCast<_List<E>>(result);
-    }
-    // _GrowableList._withData must not be called with empty list.
-    return growable ? <E>[] : new _List<E>(0);
-  }
-}
-
-// This is essentially the same class as _List, but it does not
-// permit any modification of array elements from Dart code. We use
-// this class for arrays constructed from Dart array literals.
-// TODO(hausner): We should consider the trade-offs between two
-// classes (and inline cache misses) versus a field in the native
-// implementation (checks when modifying). We should keep watching
-// the inline cache misses.
-@pragma("vm:entry-point")
-class _ImmutableList<E> extends UnmodifiableListBase<E> {
-  factory _ImmutableList._uninstantiable() {
-    throw new UnsupportedError(
-        "ImmutableArray can only be allocated by the VM");
-  }
-
-  factory _ImmutableList._from(List from, int offset, int length)
-      native "ImmutableList_from";
-
-  E operator [](int index) native "List_getIndexed";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "List_getLength";
-
-  List<E> sublist(int start, [int? end]) {
-    final int actualEnd = RangeError.checkValidRange(start, end, this.length);
-    int length = actualEnd - start;
-    if (length == 0) return <E>[];
-    final list = new _List(length);
-    for (int i = 0; i < length; i++) {
-      list[i] = this[start + i];
-    }
-    final result = new _GrowableList<E>._withData(list);
-    result._setLength(length);
-    return result;
-  }
-
-  // Collection interface.
-
-  @pragma("vm:prefer-inline")
-  void forEach(f(E element)) {
-    final length = this.length;
-    for (int i = 0; i < length; i++) {
-      f(this[i]);
-    }
-  }
-
-  @pragma("vm:prefer-inline")
-  Iterator<E> get iterator {
-    return new _FixedSizeArrayIterator<E>(this);
-  }
-
-  E get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  E get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  List<E> toList({bool growable: true}) {
-    final int length = this.length;
-    if (length > 0) {
-      if (growable) {
-        final list = new _List(length);
-        for (int i = 0; i < length; i++) {
-          list[i] = this[i];
-        }
-        return _GrowableList<E>._withData(list).._setLength(length);
-      } else {
-        final list = new _List<E>(length);
-        for (int i = 0; i < length; i++) {
-          list[i] = this[i];
-        }
-        return list;
-      }
-    }
-    return growable ? <E>[] : new _List<E>(0);
-  }
-}
-
-// Iterator for arrays with fixed size.
-class _FixedSizeArrayIterator<E> implements Iterator<E> {
-  final List<E> _array;
-  final int _length; // Cache array length for faster access.
-  int _index;
-  E? _current;
-
-  _FixedSizeArrayIterator(List<E> array)
-      : _array = array,
-        _length = array.length,
-        _index = 0 {
-    assert(array is _List<E> || array is _ImmutableList<E>);
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-
-  @pragma("vm:prefer-inline")
-  bool moveNext() {
-    if (_index >= _length) {
-      _current = null;
-      return false;
-    }
-    _current = _array[_index];
-    _index++;
-    return true;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/array_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/array_patch.dart
deleted file mode 100644
index ef181be..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/array_patch.dart
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class List<E> {
-  @patch
-  factory List.empty({bool growable = false}) {
-    return growable ? <E>[] : _List<E>(0);
-  }
-
-  @patch
-  factory List([int? length]) native "List_new";
-
-  @patch
-  factory List.filled(int length, E fill, {bool growable: false}) {
-    // All error handling on the length parameter is done at the implementation
-    // of new _List.
-    var result = growable ? new _GrowableList<E>(length) : new _List<E>(length);
-    if (fill != null) {
-      for (int i = 0; i < length; i++) {
-        result[i] = fill;
-      }
-    }
-    return result;
-  }
-
-  @patch
-  factory List.from(Iterable elements, {bool growable: true}) {
-    if (elements is EfficientLengthIterable<E>) {
-      int length = elements.length;
-      var list = growable ? new _GrowableList<E>(length) : new _List<E>(length);
-      if (length > 0) {
-        // Avoid creating iterator unless necessary.
-        int i = 0;
-        for (var element in elements) {
-          list[i++] = element;
-        }
-      }
-      return list;
-    }
-    // If elements is an Iterable<E>, we won't need a type-test for each
-    // element. In the "common case" that elements is an Iterable<E>, this
-    // replaces a type-test on every element with a single type-test before
-    // starting the loop.
-    if (elements is Iterable<E>) {
-      List<E> list = new _GrowableList<E>(0);
-      for (E e in elements) {
-        list.add(e);
-      }
-      if (growable) return list;
-      return makeListFixedLength(list);
-    } else {
-      List<E> list = new _GrowableList<E>(0);
-      for (E e in elements) {
-        list.add(e);
-      }
-      if (growable) return list;
-      return makeListFixedLength(list);
-    }
-  }
-
-  @patch
-  factory List.of(Iterable<E> elements, {bool growable: true}) {
-    // TODO(32937): Specialize to benefit from known element type.
-    return List.from(elements, growable: growable);
-  }
-
-  @patch
-  @pragma("vm:prefer-inline")
-  factory List.generate(int length, E generator(int index),
-      {bool growable = true}) {
-    final List<E> result =
-        growable ? new _GrowableList<E>(length) : new _List<E>(length);
-    for (int i = 0; i < result.length; ++i) {
-      result[i] = generator(i);
-    }
-    return result;
-  }
-
-  @patch
-  factory List.unmodifiable(Iterable elements) {
-    final result = new List<E>.from(elements, growable: false);
-    return makeFixedListUnmodifiable(result);
-  }
-
-  // Factory constructing a mutable List from a parser generated List literal.
-  // [elements] contains elements that are already type checked.
-  @pragma("vm:entry-point", "call")
-  factory List._fromLiteral(List elements) {
-    if (elements.isEmpty) {
-      return new _GrowableList<E>(0);
-    }
-    final result = new _GrowableList<E>._withData(unsafeCast<_List>(elements));
-    result._setLength(elements.length);
-    return result;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/async_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/async_patch.dart
deleted file mode 100644
index c3201d3..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/async_patch.dart
+++ /dev/null
@@ -1,334 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:async" which contains all the imports used
-/// by patches of that library. We plan to change this when we have a shared
-/// front end and simply use parts.
-
-import "dart:_internal" show VMLibraryHooks, patch;
-
-/// These are the additional parts of this patch library:
-// part "deferred_load_patch.dart";
-// part "schedule_microtask_patch.dart";
-// part "timer_patch.dart";
-
-// Equivalent of calling FATAL from C++ code.
-_fatal(msg) native "DartAsync_fatal";
-
-class _AsyncAwaitCompleter<T> implements Completer<T> {
-  @pragma("vm:entry-point")
-  final _future = new _Future<T>();
-  @pragma("vm:entry-point")
-  bool isSync;
-
-  @pragma("vm:entry-point")
-  _AsyncAwaitCompleter() : isSync = false;
-
-  @pragma("vm:entry-point")
-  void complete([FutureOr<T>? value]) {
-    // All paths require that if value is null, null as T succeeds.
-    value = (value == null) ? value as T : value;
-    if (!isSync) {
-      _future._asyncComplete(value);
-    } else if (value is Future<T>) {
-      assert(!_future._isComplete);
-      _future._chainFuture(value);
-    } else {
-      // TODO(40014): Remove cast when type promotion works.
-      _future._completeWithValue(value as T);
-    }
-  }
-
-  void completeError(Object e, [StackTrace? st]) {
-    st ??= AsyncError.defaultStackTrace(e);
-    if (isSync) {
-      _future._completeError(e, st);
-    } else {
-      _future._asyncCompleteError(e, st);
-    }
-  }
-
-  @pragma("vm:entry-point")
-  void start(void Function() f) {
-    f();
-    isSync = true;
-  }
-
-  Future<T> get future => _future;
-  bool get isCompleted => !_future._mayComplete;
-}
-
-// We need to pass the value as first argument and leave the second and third
-// arguments empty (used for error handling).
-dynamic Function(dynamic) _asyncThenWrapperHelper(
-    dynamic Function(dynamic) continuation) {
-  // Any function that is used as an asynchronous callback must be registered
-  // in the current Zone. Normally, this is done by the future when a
-  // callback is registered (for example with `.then` or `.catchError`). In our
-  // case we want to reuse the same callback multiple times and therefore avoid
-  // the multiple registrations. For our internal futures (`_Future`) we can
-  // use the shortcut-version of `.then`, and skip the registration. However,
-  // that means that the continuation must be registered by us.
-  //
-  // Furthermore, we know that the root-zone doesn't actually do anything and
-  // we can therefore skip the registration call for it.
-  //
-  // Note, that the continuation accepts up to three arguments. If the current
-  // zone is the root zone, we don't wrap the continuation, and a bad
-  // `Future` implementation could potentially invoke the callback with the
-  // wrong number of arguments.
-  if (Zone.current == Zone.root) return continuation;
-  return Zone.current.registerUnaryCallback<dynamic, dynamic>(continuation);
-}
-
-// We need to pass the exception and stack trace objects as second and third
-// parameter to the continuation.
-dynamic Function(Object, StackTrace) _asyncErrorWrapperHelper(
-    dynamic Function(dynamic, dynamic, StackTrace) continuation) {
-  // See comments of `_asyncThenWrapperHelper`.
-  dynamic errorCallback(Object e, StackTrace s) => continuation(null, e, s);
-  if (Zone.current == Zone.root) return errorCallback;
-  return Zone.current
-      .registerBinaryCallback<dynamic, Object, StackTrace>(errorCallback);
-}
-
-/// Registers the [thenCallback] and [errorCallback] on the given [object].
-///
-/// If [object] is not a future, then it is wrapped into one.
-///
-/// Returns the result of registering with `.then`.
-Future _awaitHelper(var object, dynamic Function(dynamic) thenCallback,
-    dynamic Function(dynamic, StackTrace) errorCallback, Function awaiter) {
-  late _Future future;
-  if (object is! Future) {
-    future = new _Future().._setValue(object);
-  } else if (object is _Future) {
-    future = object;
-  } else {
-    return object.then(thenCallback, onError: errorCallback);
-  }
-  // `object` is a `_Future`.
-  //
-  // Since the callbacks have been registered in the current zone (see
-  // [_asyncThenWrapperHelper] and [_asyncErrorWrapperHelper]), we can avoid
-  // another registration and directly invoke the no-zone-registration `.then`.
-  //
-  // We can only do this for our internal futures (the default implementation of
-  // all futures that are constructed by the `dart:async` library).
-  future._awaiter = awaiter;
-  return future._thenAwait<dynamic>(thenCallback, errorCallback);
-}
-
-// Called as part of the 'await for (...)' construct. Registers the
-// awaiter on the stream.
-void _asyncStarListenHelper(var object, var awaiter) {
-  if (object is! _StreamImpl) {
-    return;
-  }
-  // `object` is a `_StreamImpl`.
-  object._awaiter = awaiter;
-}
-
-@pragma("vm:entry-point", "call")
-void _asyncStarMoveNextHelper(var stream) {
-  if (stream is! _StreamImpl) {
-    return;
-  }
-  // stream is a _StreamImpl.
-  final generator = stream._generator;
-  if (generator == null) {
-    // No generator registered, this isn't an async* Stream.
-    return;
-  }
-  _moveNextDebuggerStepCheck(generator);
-}
-
-// _AsyncStarStreamController is used by the compiler to implement
-// async* generator functions.
-@pragma("vm:entry-point")
-class _AsyncStarStreamController<T> {
-  @pragma("vm:entry-point")
-  StreamController<T> controller;
-  Function asyncStarBody;
-  bool isAdding = false;
-  bool onListenReceived = false;
-  bool isScheduled = false;
-  bool isSuspendedAtYield = false;
-  _Future? cancellationFuture = null;
-
-  Stream<T> get stream {
-    final Stream<T> local = controller.stream;
-    if (local is _StreamImpl<T>) {
-      local._generator = asyncStarBody;
-    }
-    return local;
-  }
-
-  void runBody() {
-    isScheduled = false;
-    isSuspendedAtYield = false;
-    asyncStarBody();
-  }
-
-  void scheduleGenerator() {
-    if (isScheduled || controller.isPaused || isAdding) {
-      return;
-    }
-    isScheduled = true;
-    scheduleMicrotask(runBody);
-  }
-
-  // Adds element to stream, returns true if the caller should terminate
-  // execution of the generator.
-  //
-  // TODO(hausner): Per spec, the generator should be suspended before
-  // exiting when the stream is closed. We could add a getter like this:
-  // get isCancelled => controller.hasListener;
-  // The generator would translate a 'yield e' statement to
-  // controller.add(e);
-  // suspend;
-  // if (controller.isCancelled) return;
-  bool add(T event) {
-    if (!onListenReceived) _fatal("yield before stream is listened to");
-    if (isSuspendedAtYield) _fatal("unexpected yield");
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) {
-      return true;
-    }
-    controller.add(event);
-    scheduleGenerator();
-    isSuspendedAtYield = true;
-    return false;
-  }
-
-  // Adds the elements of stream into this controller's stream.
-  // The generator will be scheduled again when all of the
-  // elements of the added stream have been consumed.
-  // Returns true if the caller should terminate
-  // execution of the generator.
-  bool addStream(Stream<T> stream) {
-    if (!onListenReceived) _fatal("yield before stream is listened to");
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) return true;
-    isAdding = true;
-    var whenDoneAdding = controller.addStream(stream, cancelOnError: false);
-    whenDoneAdding.then((_) {
-      isAdding = false;
-      scheduleGenerator();
-      if (!isScheduled) isSuspendedAtYield = true;
-    });
-    return false;
-  }
-
-  void addError(Object error, StackTrace stackTrace) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    final future = cancellationFuture;
-    if ((future != null) && future._mayComplete) {
-      // If the stream has been cancelled, complete the cancellation future
-      // with the error.
-      future._completeError(error, stackTrace);
-      return;
-    }
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) return;
-    controller.addError(error, stackTrace);
-    // No need to schedule the generator body here. This code is only
-    // called from the catch clause of the implicit try-catch-finally
-    // around the generator body. That is, we are on the error path out
-    // of the generator and do not need to run the generator again.
-  }
-
-  close() {
-    final future = cancellationFuture;
-    if ((future != null) && future._mayComplete) {
-      // If the stream has been cancelled, complete the cancellation future
-      // with the error.
-      future._completeWithValue(null);
-    }
-    controller.close();
-  }
-
-  _AsyncStarStreamController(this.asyncStarBody)
-      : controller = new StreamController() {
-    controller.onListen = this.onListen;
-    controller.onResume = this.onResume;
-    controller.onCancel = this.onCancel;
-  }
-
-  onListen() {
-    assert(!onListenReceived);
-    onListenReceived = true;
-    scheduleGenerator();
-  }
-
-  onResume() {
-    if (isSuspendedAtYield) {
-      scheduleGenerator();
-    }
-  }
-
-  onCancel() {
-    if (controller.isClosed) {
-      return null;
-    }
-    if (cancellationFuture == null) {
-      cancellationFuture = new _Future();
-      // Only resume the generator if it is suspended at a yield.
-      // Cancellation does not affect an async generator that is
-      // suspended at an await.
-      if (isSuspendedAtYield) {
-        scheduleGenerator();
-      }
-    }
-    return cancellationFuture;
-  }
-}
-
-@patch
-void _rethrow(Object error, StackTrace stackTrace) native "Async_rethrow";
-
-@patch
-class _Future<T> {
-  /// The closure implementing the async[*]-body that is `await`ing this future.
-  Function? _awaiter;
-}
-
-@patch
-class _StreamImpl<T> {
-  /// The closure implementing the async[*]-body that is `await`ing this future.
-  Function? _awaiter;
-
-  /// The closure implementing the async-generator body that is creating events
-  /// for this stream.
-  Function? _generator;
-}
-
-@pragma("vm:entry-point", "call")
-void _completeOnAsyncReturn(Completer completer, Object value) {
-  completer.complete(value);
-}
-
-/// Returns a [StackTrace] object containing the synchronous prefix for this
-/// asynchronous method.
-//
-// This method is recognized. It performs a runtime call if
-// FLAG_causal_async_stacks is enabled or returns `null` otherwise.
-@pragma("vm:prefer-inline")
-Object _asyncStackTraceHelper(Function async_op)
-    native "StackTrace_asyncStackTraceHelper";
-
-// This method is asm intrinsified.
-@pragma("vm:entry-point", "call")
-void _clearAsyncThreadStackTrace()
-    native "StackTrace_clearAsyncThreadStackTrace";
-
-// This method is asm intrinsified.
-@pragma("vm:entry-point", "call")
-void _setAsyncThreadStackTrace(StackTrace stackTrace)
-    native "StackTrace_setAsyncThreadStackTrace";
-
-void _moveNextDebuggerStepCheck(Function async_op)
-    native "AsyncStarMoveNext_debuggerStepCheck";
diff --git a/sdk_nnbd/lib/_internal/vm/lib/bigint_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/bigint_patch.dart
deleted file mode 100644
index 5cc0bef..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/bigint_patch.dart
+++ /dev/null
@@ -1,2853 +0,0 @@
-// Copyright (c) 2017, 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.
-
-// part of dart.core;
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
- * Copyright (c) 2003-2005  Tom Wu
- * Copyright (c) 2012 Adam Singer (adam@solvr.io)
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
- * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
- * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * In addition, the following condition applies:
- *
- * All redistributions must retain an intact copy of this copyright notice
- * and disclaimer.
- */
-
-@patch
-class BigInt implements Comparable<BigInt> {
-  @patch
-  static BigInt get zero => _BigIntImpl.zero;
-  @patch
-  static BigInt get one => _BigIntImpl.one;
-  @patch
-  static BigInt get two => _BigIntImpl.two;
-
-  @patch
-  static BigInt parse(String source, {int? radix}) =>
-      _BigIntImpl.parse(source, radix: radix);
-
-  @patch
-  static BigInt? tryParse(String source, {int? radix}) =>
-      _BigIntImpl._tryParse(source, radix: radix);
-
-  @patch
-  factory BigInt.from(num value) => new _BigIntImpl.from(value);
-}
-
-int _max(int a, int b) => a > b ? a : b;
-int _min(int a, int b) => a < b ? a : b;
-
-/// Allocate a new digits list of even length.
-Uint32List _newDigits(int length) => new Uint32List(length + (length & 1));
-
-/**
- * An implementation for the arbitrarily large integer.
- *
- * The integer number is represented by a sign, an array of 32-bit unsigned
- * integers in little endian format, and a number of used digits in that array.
- */
-class _BigIntImpl implements BigInt {
-  // Bits per digit.
-  static const int _digitBits = 32;
-  static const int _digitBase = 1 << _digitBits;
-  static const int _digitMask = (1 << _digitBits) - 1;
-
-  // Bits per half digit.
-  static const int _halfDigitBits = _digitBits >> 1;
-  static const int _halfDigitMask = (1 << _halfDigitBits) - 1;
-
-  static final _BigIntImpl zero = new _BigIntImpl._fromInt(0);
-  static final _BigIntImpl one = new _BigIntImpl._fromInt(1);
-  static final _BigIntImpl two = new _BigIntImpl._fromInt(2);
-
-  static final _BigIntImpl _minusOne = -one;
-  static final _BigIntImpl _oneDigitMask = new _BigIntImpl._fromInt(_digitMask);
-  static final _BigIntImpl _twoDigitMask = (one << (2 * _digitBits)) - one;
-  static final _BigIntImpl _oneBillion = new _BigIntImpl._fromInt(1000000000);
-  static const int _minInt = -0x8000000000000000;
-  static const int _maxInt = 0x7fffffffffffffff;
-
-  /// Certain methods of _BigIntImpl class are intrinsified by the VM
-  /// depending on the runtime flags. They return number of processed
-  /// digits (2) which is different from non-intrinsic implementation (1).
-  /// This flag is used to confuse constant propagation at compile time and
-  /// avoid propagating return value to the callers. It should not be
-  /// evaluated to a constant.
-  /// Note that [_isIntrinsified] is still false if intrinsification occurs,
-  /// so it should be used only inside methods which are replaced by
-  /// intrinsification.
-  static final bool _isIntrinsified =
-      new bool.fromEnvironment('dart.vm.not.a.compile.time.constant');
-
-  // Result cache for last _divRem call.
-  static Uint32List? _lastDividendDigits;
-  static int? _lastDividendUsed;
-  static Uint32List? _lastDivisorDigits;
-  static int? _lastDivisorUsed;
-  static late Uint32List _lastQuoRemDigits;
-  static late int _lastQuoRemUsed;
-  static late int _lastRemUsed;
-  static late int _lastRem_nsh;
-
-  /// Whether this bigint is negative.
-  final bool _isNegative;
-
-  /// The unsigned digits of this bigint.
-  ///
-  /// The least significant digit is in slot 0.
-  /// The list may have more digits than needed. That is, `_digits.length` may
-  /// be strictly greater than `_used`.
-  /// Also, `_digits.length` must always be even, because intrinsics on 64-bit
-  /// platforms may process a digit pair as a 64-bit value.
-  final Uint32List _digits;
-
-  /// The number of used entries in [_digits].
-  ///
-  /// To avoid reallocating [Uint32List]s, lists that are too big are not
-  /// replaced, but `_used` reflects the smaller number of digits actually used.
-  ///
-  /// Note that functions shortening an existing list of digits to a smaller
-  /// `_used` number of digits must ensure that the highermost pair of digits
-  /// is correct when read as a 64-bit value by intrinsics. Therefore, if the
-  /// smaller '_used' number is odd, the high digit of that pair must be
-  /// explicitly cleared, i.e. _digits[_used] = 0, which cannot result in an
-  /// out of bounds access, since the length of the list is guaranteed to be
-  /// even.
-  final int _used;
-
-  /**
-   * Parses [source] as a, possibly signed, integer literal and returns its
-   * value.
-   *
-   * The [source] must be a non-empty sequence of base-[radix] digits,
-   * optionally prefixed with a minus or plus sign ('-' or '+').
-   *
-   * The [radix] must be in the range 2..36. The digits used are
-   * first the decimal digits 0..9, and then the letters 'a'..'z' with
-   * values 10 through 35. Also accepts upper-case letters with the same
-   * values as the lower-case ones.
-   *
-   * If no [radix] is given then it defaults to 10. In this case, the [source]
-   * digits may also start with `0x`, in which case the number is interpreted
-   * as a hexadecimal literal, which effectively means that the `0x` is ignored
-   * and the radix is instead set to 16.
-   *
-   * For any int `n` and radix `r`, it is guaranteed that
-   * `n == int.parse(n.toRadixString(r), radix: r)`.
-   *
-   * Throws a [FormatException] if the [source] is not a valid integer literal,
-   * optionally prefixed by a sign.
-   */
-  static _BigIntImpl parse(String source, {int? radix}) {
-    var result = _tryParse(source, radix: radix);
-    if (result == null) {
-      throw new FormatException("Could not parse BigInt", source);
-    }
-    return result;
-  }
-
-  /// Parses a decimal bigint literal.
-  ///
-  /// The [source] must not contain leading or trailing whitespace.
-  static _BigIntImpl _parseDecimal(String source, bool isNegative) {
-    const _0 = 48;
-
-    int part = 0;
-    _BigIntImpl result = zero;
-    // Read in the source 9 digits at a time.
-    // The first part may have a few leading virtual '0's to make the remaining
-    // parts all have exactly 9 digits.
-    int digitInPartCount = 9 - unsafeCast<int>(source.length.remainder(9));
-    if (digitInPartCount == 9) digitInPartCount = 0;
-    for (int i = 0; i < source.length; i++) {
-      part = part * 10 + source.codeUnitAt(i) - _0;
-      if (++digitInPartCount == 9) {
-        result = result * _oneBillion + new _BigIntImpl._fromInt(part);
-        part = 0;
-        digitInPartCount = 0;
-      }
-    }
-    if (isNegative) return -result;
-    return result;
-  }
-
-  /// Returns the value of a given source digit.
-  ///
-  /// Source digits between "0" and "9" (inclusive) return their decimal value.
-  ///
-  /// Source digits between "a" and "z", or "A" and "Z" (inclusive) return
-  /// 10 + their position in the ASCII alphabet.
-  ///
-  /// The incoming [codeUnit] must be an ASCII code-unit.
-  static int _codeUnitToRadixValue(int codeUnit) {
-    // We know that the characters must be ASCII as otherwise the
-    // regexp wouldn't have matched. Lowercasing by doing `| 0x20` is thus
-    // guaranteed to be a safe operation, since it preserves digits
-    // and lower-cases ASCII letters.
-    const int _0 = 48;
-    const int _9 = 57;
-    const int _a = 97;
-    if (_0 <= codeUnit && codeUnit <= _9) return codeUnit - _0;
-    codeUnit |= 0x20;
-    var result = codeUnit - _a + 10;
-    return result;
-  }
-
-  /// Parses the given [source] string, starting at [startPos], as a hex
-  /// literal.
-  ///
-  /// If [isNegative] is true, negates the result before returning it.
-  ///
-  /// The [source] (substring) must be a valid hex literal.
-  static _BigIntImpl? _parseHex(String source, int startPos, bool isNegative) {
-    int hexCharsPerDigit = _digitBits ~/ 4;
-    int sourceLength = source.length - startPos;
-    int used = (sourceLength + hexCharsPerDigit - 1) ~/ hexCharsPerDigit;
-    var digits = _newDigits(used);
-
-    int lastDigitLength = sourceLength - (used - 1) * hexCharsPerDigit;
-    int digitIndex = used - 1;
-    int i = startPos;
-    int digit = 0;
-    for (int j = 0; j < lastDigitLength; j++) {
-      var value = _codeUnitToRadixValue(source.codeUnitAt(i++));
-      if (value >= 16) return null;
-      digit = digit * 16 + value;
-    }
-    digits[digitIndex--] = digit;
-
-    while (i < source.length) {
-      digit = 0;
-      for (int j = 0; j < hexCharsPerDigit; j++) {
-        var value = _codeUnitToRadixValue(source.codeUnitAt(i++));
-        if (value >= 16) return null;
-        digit = digit * 16 + value;
-      }
-      digits[digitIndex--] = digit;
-    }
-    if (used == 1 && digits[0] == 0) return zero;
-    return new _BigIntImpl._(isNegative, used, digits);
-  }
-
-  /// Parses the given [source] as a [radix] literal.
-  ///
-  /// The [source] will be checked for invalid characters. If it is invalid,
-  /// this function returns `null`.
-  static _BigIntImpl? _parseRadix(String source, int radix, bool isNegative) {
-    var result = zero;
-    var base = new _BigIntImpl._fromInt(radix);
-    for (int i = 0; i < source.length; i++) {
-      var value = _codeUnitToRadixValue(source.codeUnitAt(i));
-      if (value >= radix) return null;
-      result = result * base + new _BigIntImpl._fromInt(value);
-    }
-    if (isNegative) return -result;
-    return result;
-  }
-
-  /// Tries to parse the given [source] as a [radix] literal.
-  ///
-  /// Returns the parsed big integer, or `null` if it failed.
-  ///
-  /// If the [radix] is `null` accepts decimal literals or `0x` hex literals.
-  static _BigIntImpl? _tryParse(String source, {int? radix}) {
-    if (source == "") return null;
-
-    final match = _parseRE.firstMatch(source);
-    int signIndex = 1;
-    int hexIndex = 3;
-    int decimalIndex = 4;
-    int nonDecimalHexIndex = 5;
-    if (match == null) return null;
-
-    final bool isNegative = match[signIndex] == "-";
-
-    final String? decimalMatch = match[decimalIndex];
-    final String? hexMatch = match[hexIndex];
-    final String? nonDecimalMatch = match[nonDecimalHexIndex];
-
-    if (radix == null) {
-      if (decimalMatch != null) {
-        // Cannot fail because we know that the digits are all decimal.
-        return _parseDecimal(decimalMatch, isNegative);
-      }
-      if (hexMatch != null) {
-        // Cannot fail because we know that the digits are all hex.
-        return _parseHex(hexMatch, 2, isNegative);
-      }
-      return null;
-    }
-
-    if (radix < 2 || radix > 36) {
-      throw new RangeError.range(radix, 2, 36, 'radix');
-    }
-    if (radix == 10 && decimalMatch != null) {
-      return _parseDecimal(decimalMatch, isNegative);
-    }
-    if (radix == 16) {
-      final match = decimalMatch ?? nonDecimalMatch;
-      if (match != null) {
-        return _parseHex(match, 0, isNegative);
-      }
-    }
-
-    // The RegExp guarantees that one of the 3 matches is non-null.
-    final nonNullMatch = (decimalMatch ?? nonDecimalMatch ?? hexMatch)!;
-    return _parseRadix(nonNullMatch, radix, isNegative);
-  }
-
-  static RegExp _parseRE = RegExp(
-      r'^\s*([+-]?)((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$',
-      caseSensitive: false);
-
-  /// Finds the amount significant digits in the provided [digits] array.
-  static int _normalize(int used, Uint32List digits) {
-    while (used > 0 && digits[used - 1] == 0) used--;
-    return used;
-  }
-
-  /// Factory returning an instance initialized with the given field values.
-  /// If the [digits] array contains leading 0s, the [used] value is adjusted
-  /// accordingly. The [digits] array is not modified.
-  _BigIntImpl._(bool isNegative, int used, Uint32List digits)
-      : this._normalized(isNegative, _normalize(used, digits), digits);
-
-  _BigIntImpl._normalized(bool isNegative, this._used, this._digits)
-      : _isNegative = _used == 0 ? false : isNegative {
-    assert(_digits.length.isEven);
-    assert(_used.isEven || _digits[_used] == 0); // Leading zero for 64-bit.
-  }
-
-  /// Whether this big integer is zero.
-  bool get _isZero => _used == 0;
-
-  /// Allocates an array of the given [length] and copies the [digits] in the
-  /// range [from] to [to-1], starting at index 0, followed by leading zero
-  /// digits.
-  static Uint32List _cloneDigits(
-      Uint32List digits, int from, int to, int length) {
-    var resultDigits = _newDigits(length);
-    var n = to - from;
-    for (var i = 0; i < n; i++) {
-      resultDigits[i] = digits[from + i];
-    }
-    return resultDigits;
-  }
-
-  /// Allocates a big integer from the provided [value] number.
-  factory _BigIntImpl.from(num value) {
-    if (value == 0) return zero;
-    if (value == 1) return one;
-    if (value == 2) return two;
-
-    if (value.abs() < 0x100000000) {
-      return new _BigIntImpl._fromInt(value.toInt());
-    }
-    if (value is double) {
-      return new _BigIntImpl._fromDouble(value);
-    }
-    return new _BigIntImpl._fromInt(value as int);
-  }
-
-  factory _BigIntImpl._fromInt(int value) {
-    bool isNegative = value < 0;
-    assert(_digitBits == 32);
-    var digits = _newDigits(2);
-    if (isNegative) {
-      // Handle the min 64-bit value differently, since its negation is not
-      // positive.
-      if (value == _minInt) {
-        digits[1] = 0x80000000;
-        return new _BigIntImpl._(true, 2, digits);
-      }
-      value = -value;
-    }
-    if (value < _digitBase) {
-      digits[0] = value;
-      return new _BigIntImpl._(isNegative, 1, digits);
-    }
-    digits[0] = value & _digitMask;
-    digits[1] = value >> _digitBits;
-    return new _BigIntImpl._(isNegative, 2, digits);
-  }
-
-  /// An 8-byte Uint8List we can reuse for [_fromDouble] to avoid generating
-  /// garbage.
-  static final Uint8List _bitsForFromDouble = new Uint8List(8);
-
-  factory _BigIntImpl._fromDouble(double value) {
-    const int exponentBias = 1075;
-
-    if (value.isNaN || value.isInfinite) {
-      throw new ArgumentError("Value must be finite: $value");
-    }
-    bool isNegative = value < 0;
-    if (isNegative) value = -value;
-
-    value = value.floorToDouble();
-    if (value == 0) return zero;
-
-    var bits = _bitsForFromDouble;
-    for (int i = 0; i < 8; i++) {
-      bits[i] = 0;
-    }
-    bits.buffer.asByteData().setFloat64(0, value, Endian.little);
-    // The exponent is in bits 53..63.
-    var biasedExponent = (bits[7] << 4) + (bits[6] >> 4);
-    var exponent = biasedExponent - exponentBias;
-
-    assert(_digitBits == 32);
-    // The significant bits are in 0 .. 52.
-    var unshiftedDigits = _newDigits(2);
-    unshiftedDigits[0] =
-        (bits[3] << 24) + (bits[2] << 16) + (bits[1] << 8) + bits[0];
-    // Don't forget to add the hidden bit.
-    unshiftedDigits[1] =
-        ((0x10 | (bits[6] & 0xF)) << 16) + (bits[5] << 8) + bits[4];
-
-    var unshiftedBig = new _BigIntImpl._normalized(false, 2, unshiftedDigits);
-    _BigIntImpl absResult = unshiftedBig;
-    if (exponent < 0) {
-      absResult = unshiftedBig >> -exponent;
-    } else if (exponent > 0) {
-      absResult = unshiftedBig << exponent;
-    }
-    if (isNegative) return -absResult;
-    return absResult;
-  }
-
-  /**
-   * Return the negative value of this integer.
-   *
-   * The result of negating an integer always has the opposite sign, except
-   * for zero, which is its own negation.
-   */
-  _BigIntImpl operator -() {
-    if (_used == 0) return this;
-    return new _BigIntImpl._(!_isNegative, _used, _digits);
-  }
-
-  /**
-   * Returns the absolute value of this integer.
-   *
-   * For any integer `x`, the result is the same as `x < 0 ? -x : x`.
-   */
-  _BigIntImpl abs() => _isNegative ? -this : this;
-
-  /// Returns this << n*_digitBits.
-  _BigIntImpl _dlShift(int n) {
-    final used = _used;
-    if (used == 0) {
-      return zero;
-    }
-    final resultUsed = used + n;
-    final digits = _digits;
-    final resultDigits = _newDigits(resultUsed);
-    for (int i = used - 1; i >= 0; i--) {
-      resultDigits[i + n] = digits[i];
-    }
-    return new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-  }
-
-  /// Same as [_dlShift] but works on the decomposed big integers.
-  ///
-  /// Returns `resultUsed`.
-  ///
-  /// `resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] << n*_digitBits`.
-  static int _dlShiftDigits(
-      Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
-    if (xUsed == 0) {
-      return 0;
-    }
-    if (n == 0 && identical(resultDigits, xDigits)) {
-      return xUsed;
-    }
-    final resultUsed = xUsed + n;
-    assert(resultDigits.length >= resultUsed + (resultUsed & 1));
-    for (int i = xUsed - 1; i >= 0; i--) {
-      resultDigits[i + n] = xDigits[i];
-    }
-    for (int i = n - 1; i >= 0; i--) {
-      resultDigits[i] = 0;
-    }
-    if (resultUsed.isOdd) {
-      resultDigits[resultUsed] = 0;
-    }
-    return resultUsed;
-  }
-
-  /// Returns `this >> n*_digitBits`.
-  _BigIntImpl _drShift(int n) {
-    final used = _used;
-    if (used == 0) {
-      return zero;
-    }
-    final resultUsed = used - n;
-    if (resultUsed <= 0) {
-      return _isNegative ? _minusOne : zero;
-    }
-    final digits = _digits;
-    final resultDigits = _newDigits(resultUsed);
-    for (var i = n; i < used; i++) {
-      resultDigits[i - n] = digits[i];
-    }
-    final result = new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-    if (_isNegative) {
-      // Round down if any bit was shifted out.
-      for (var i = 0; i < n; i++) {
-        if (digits[i] != 0) {
-          return result - one;
-        }
-      }
-    }
-    return result;
-  }
-
-  /// Same as [_drShift] but works on the decomposed big integers.
-  ///
-  /// Returns `resultUsed`.
-  ///
-  /// `resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] >> n*_digitBits`.
-  static int _drShiftDigits(
-      Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
-    final resultUsed = xUsed - n;
-    if (resultUsed <= 0) {
-      return 0;
-    }
-    assert(resultDigits.length >= resultUsed + (resultUsed & 1));
-    for (var i = n; i < xUsed; i++) {
-      resultDigits[i - n] = xDigits[i];
-    }
-    if (resultUsed.isOdd) {
-      resultDigits[resultUsed] = 0;
-    }
-    return resultUsed;
-  }
-
-  /// Shifts the digits of [xDigits] into the right place in [resultDigits].
-  ///
-  /// `resultDigits[ds..xUsed+ds] = xDigits[0..xUsed-1] << (n % _digitBits)`
-  ///   where `ds = n ~/ _digitBits`
-  ///
-  /// Does *not* clear digits below ds.
-  ///
-  /// Note: This function may be intrinsified.
-  @pragma("vm:never-inline")
-  static void _lsh(
-      Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
-    assert(xUsed > 0);
-    final digitShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    final carryBitShift = _digitBits - bitShift;
-    final bitMask = (1 << carryBitShift) - 1;
-    var carry = 0;
-    for (int i = xUsed - 1; i >= 0; i--) {
-      final digit = xDigits[i];
-      resultDigits[i + digitShift + 1] = (digit >> carryBitShift) | carry;
-      carry = (digit & bitMask) << bitShift;
-    }
-    resultDigits[digitShift] = carry;
-  }
-
-  /**
-   * Shift the bits of this integer to the left by [shiftAmount].
-   *
-   * Shifting to the left makes the number larger, effectively multiplying
-   * the number by `pow(2, shiftIndex)`.
-   *
-   * There is no limit on the size of the result. It may be relevant to
-   * limit intermediate values by using the "and" operator with a suitable
-   * mask.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  _BigIntImpl operator <<(int shiftAmount) {
-    if (shiftAmount < 0) {
-      throw new ArgumentError("shift-amount must be positive $shiftAmount");
-    }
-    if (_isZero) return this;
-    final digitShift = shiftAmount ~/ _digitBits;
-    final bitShift = shiftAmount % _digitBits;
-    if (bitShift == 0) {
-      return _dlShift(digitShift);
-    }
-    // Need one extra digit to hold bits shifted by bitShift.
-    var resultUsed = _used + digitShift + 1;
-    // The 64-bit intrinsic requires one extra pair to work with.
-    var resultDigits = _newDigits(resultUsed + 1);
-    _lsh(_digits, _used, shiftAmount, resultDigits);
-    return new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-  }
-
-  /// resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] << n.
-  /// Returns resultUsed.
-  static int _lShiftDigits(
-      Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
-    final digitsShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    if (bitShift == 0) {
-      return _dlShiftDigits(xDigits, xUsed, digitsShift, resultDigits);
-    }
-    // Need one extra digit to hold bits shifted by bitShift.
-    var resultUsed = xUsed + digitsShift + 1;
-    // The 64-bit intrinsic requires one extra pair to work with.
-    assert(resultDigits.length >= resultUsed + 2 - (resultUsed & 1));
-    _lsh(xDigits, xUsed, n, resultDigits);
-    var i = digitsShift;
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    if (resultDigits[resultUsed - 1] == 0) {
-      resultUsed--; // Clamp result.
-    } else if (resultUsed.isOdd) {
-      resultDigits[resultUsed] = 0;
-    }
-    return resultUsed;
-  }
-
-  /// resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] >> n.
-  ///
-  /// Note: This function may be intrinsified.
-  @pragma("vm:never-inline")
-  static void _rsh(
-      Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
-    assert(xUsed > 0);
-    final digitsShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    final carryBitShift = _digitBits - bitShift;
-    final bitMask = (1 << bitShift) - 1;
-    var carry = xDigits[digitsShift] >> bitShift;
-    final last = xUsed - digitsShift - 1;
-    for (var i = 0; i < last; i++) {
-      final digit = xDigits[i + digitsShift + 1];
-      resultDigits[i] = ((digit & bitMask) << carryBitShift) | carry;
-      carry = digit >> bitShift;
-    }
-    resultDigits[last] = carry;
-  }
-
-  /**
-   * Shift the bits of this integer to the right by [shiftAmount].
-   *
-   * Shifting to the right makes the number smaller and drops the least
-   * significant bits, effectively doing an integer division by
-   *`pow(2, shiftIndex)`.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  _BigIntImpl operator >>(int shiftAmount) {
-    if (shiftAmount < 0) {
-      throw new ArgumentError("shift-amount must be positive $shiftAmount");
-    }
-    if (_isZero) return this;
-    final digitShift = shiftAmount ~/ _digitBits;
-    final bitShift = shiftAmount % _digitBits;
-    if (bitShift == 0) {
-      return _drShift(digitShift);
-    }
-    final used = _used;
-    final resultUsed = used - digitShift;
-    if (resultUsed <= 0) {
-      return _isNegative ? _minusOne : zero;
-    }
-    final digits = _digits;
-    final resultDigits = _newDigits(resultUsed);
-    _rsh(digits, used, shiftAmount, resultDigits);
-    final result = new _BigIntImpl._(_isNegative, resultUsed, resultDigits);
-    if (_isNegative) {
-      // Round down if any bit was shifted out.
-      if ((digits[digitShift] & ((1 << bitShift) - 1)) != 0) {
-        return result - one;
-      }
-      for (var i = 0; i < digitShift; i++) {
-        if (digits[i] != 0) {
-          return result - one;
-        }
-      }
-    }
-    return result;
-  }
-
-  /// resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1] >> n.
-  /// Returns resultUsed.
-  static int _rShiftDigits(
-      Uint32List xDigits, int xUsed, int n, Uint32List resultDigits) {
-    final digitShift = n ~/ _digitBits;
-    final bitShift = n % _digitBits;
-    if (bitShift == 0) {
-      return _drShiftDigits(xDigits, xUsed, digitShift, resultDigits);
-    }
-    var resultUsed = xUsed - digitShift;
-    if (resultUsed <= 0) {
-      return 0;
-    }
-    assert(resultDigits.length >= resultUsed + (resultUsed & 1));
-    _rsh(xDigits, xUsed, n, resultDigits);
-    if (resultDigits[resultUsed - 1] == 0) {
-      resultUsed--; // Clamp result.
-    } else if (resultUsed.isOdd) {
-      resultDigits[resultUsed] = 0;
-    }
-    return resultUsed;
-  }
-
-  /// Compares this to [other] taking the absolute value of both operands.
-  ///
-  /// Returns 0 if abs(this) == abs(other); a positive number if
-  /// abs(this) > abs(other); and a negative number if abs(this) < abs(other).
-  int _absCompare(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    return _compareDigits(_digits, _used, other._digits, other._used);
-  }
-
-  /**
-   * Compares this to `other`.
-   *
-   * Returns a negative number if `this` is less than `other`, zero if they are
-   * equal, and a positive number if `this` is greater than `other`.
-   */
-  int compareTo(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isNegative == other._isNegative) {
-      var result = _absCompare(other);
-      // Use 0 - result to avoid negative zero in JavaScript.
-      return _isNegative ? 0 - result : result;
-    }
-    return _isNegative ? -1 : 1;
-  }
-
-  /// Compares `digits[0..used-1]` with `otherDigits[0..otherUsed-1]`.
-  ///
-  /// Returns 0 if equal; a positive number if larger;
-  /// and a negative number if smaller.
-  static int _compareDigits(
-      Uint32List digits, int used, Uint32List otherDigits, int otherUsed) {
-    var result = used - otherUsed;
-    if (result == 0) {
-      for (int i = used - 1; i >= 0; i--) {
-        result = digits[i] - otherDigits[i];
-        if (result != 0) return result;
-      }
-    }
-    return result;
-  }
-
-  /// resultDigits[0..used] = digits[0..used-1] + otherDigits[0..otherUsed-1].
-  /// used >= otherUsed > 0.
-  ///
-  /// Note: This function may be intrinsified.
-  @pragma("vm:never-inline")
-  static void _absAdd(Uint32List digits, int used, Uint32List otherDigits,
-      int otherUsed, Uint32List resultDigits) {
-    assert(used >= otherUsed && otherUsed > 0);
-    var carry = 0;
-    for (var i = 0; i < otherUsed; i++) {
-      carry += digits[i] + otherDigits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    for (var i = otherUsed; i < used; i++) {
-      carry += digits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    resultDigits[used] = carry;
-  }
-
-  /// resultDigits[0..used-1] = digits[0..used-1] - otherDigits[0..otherUsed-1].
-  /// used >= otherUsed > 0.
-  ///
-  /// Note: This function may be intrinsified.
-  @pragma("vm:never-inline")
-  static void _absSub(Uint32List digits, int used, Uint32List otherDigits,
-      int otherUsed, Uint32List resultDigits) {
-    assert(used >= otherUsed && otherUsed > 0);
-    var carry = 0;
-    for (var i = 0; i < otherUsed; i++) {
-      carry += digits[i] - otherDigits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-    for (var i = otherUsed; i < used; i++) {
-      carry += digits[i];
-      resultDigits[i] = carry & _digitMask;
-      carry >>= _digitBits;
-    }
-  }
-
-  /// Returns `abs(this) + abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAddSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    if (used < otherUsed) {
-      return other._absAddSetSign(this, isNegative);
-    }
-    if (used == 0) {
-      assert(!isNegative);
-      return zero;
-    }
-    if (otherUsed == 0) {
-      return _isNegative == isNegative ? this : -this;
-    }
-    var resultUsed = used + 1;
-    var resultDigits = _newDigits(resultUsed);
-    _absAdd(_digits, used, other._digits, otherUsed, resultDigits);
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) - abs(other)` with sign set according to [isNegative].
-  ///
-  /// Requirement: `abs(this) >= abs(other)`.
-  _BigIntImpl _absSubSetSign(_BigIntImpl other, bool isNegative) {
-    assert(_absCompare(other) >= 0);
-    var used = _used;
-    if (used == 0) {
-      assert(!isNegative);
-      return zero;
-    }
-    var otherUsed = other._used;
-    if (otherUsed == 0) {
-      return _isNegative == isNegative ? this : -this;
-    }
-    var resultDigits = _newDigits(used);
-    _absSub(_digits, used, other._digits, otherUsed, resultDigits);
-    return new _BigIntImpl._(isNegative, used, resultDigits);
-  }
-
-  /// Returns `abs(this) & abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAndSetSign(_BigIntImpl other, bool isNegative) {
-    var resultUsed = _min(_used, other._used);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = _newDigits(resultUsed);
-    for (var i = 0; i < resultUsed; i++) {
-      resultDigits[i] = digits[i] & otherDigits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) &~ abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absAndNotSetSign(_BigIntImpl other, bool isNegative) {
-    var resultUsed = _used;
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = _newDigits(resultUsed);
-    var m = _min(resultUsed, other._used);
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] & ~otherDigits[i];
-    }
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = digits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) | abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absOrSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    var resultUsed = _max(used, otherUsed);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = _newDigits(resultUsed);
-    var l, m;
-    if (used < otherUsed) {
-      l = other;
-      m = used;
-    } else {
-      l = this;
-      m = otherUsed;
-    }
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] | otherDigits[i];
-    }
-    var lDigits = l._digits;
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = lDigits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /// Returns `abs(this) ^ abs(other)` with sign set according to [isNegative].
-  _BigIntImpl _absXorSetSign(_BigIntImpl other, bool isNegative) {
-    var used = _used;
-    var otherUsed = other._used;
-    var resultUsed = _max(used, otherUsed);
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = _newDigits(resultUsed);
-    var l, m;
-    if (used < otherUsed) {
-      l = other;
-      m = used;
-    } else {
-      l = this;
-      m = otherUsed;
-    }
-    for (var i = 0; i < m; i++) {
-      resultDigits[i] = digits[i] ^ otherDigits[i];
-    }
-    var lDigits = l._digits;
-    for (var i = m; i < resultUsed; i++) {
-      resultDigits[i] = lDigits[i];
-    }
-    return new _BigIntImpl._(isNegative, resultUsed, resultDigits);
-  }
-
-  /**
-   * Bit-wise and operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with only the bits set that are set in
-   * both `this` and [other]
-   *
-   * Of both operands are negative, the result is negative, otherwise
-   * the result is non-negative.
-   */
-  _BigIntImpl operator &(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isZero || other._isZero) return zero;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) & (-other) == ~(this-1) & ~(other-1)
-        //                    == ~((this-1) | (other-1))
-        //                    == -(((this-1) | (other-1)) + 1)
-        _BigIntImpl this1 = _absSubSetSign(one, true);
-        _BigIntImpl other1 = other._absSubSetSign(one, true);
-        // Result cannot be zero if this and other are negative.
-        return this1._absOrSetSign(other1, true)._absAddSetSign(one, true);
-      }
-      return _absAndSetSign(other, false);
-    }
-    // _isNegative != other._isNegative
-    var p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // & is symmetric.
-      p = this;
-      n = other;
-    }
-    // p & (-n) == p & ~(n-1) == p &~ (n-1)
-    var n1 = n._absSubSetSign(one, false);
-    return p._absAndNotSetSign(n1, false);
-  }
-
-  /**
-   * Bit-wise or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in either
-   * of `this` and [other]
-   *
-   * If both operands are non-negative, the result is non-negative,
-   * otherwise the result us negative.
-   */
-  _BigIntImpl operator |(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) | (-other) == ~(this-1) | ~(other-1)
-        //                    == ~((this-1) & (other-1))
-        //                    == -(((this-1) & (other-1)) + 1)
-        var this1 = _absSubSetSign(one, true);
-        var other1 = other._absSubSetSign(one, true);
-        // Result cannot be zero if this and a are negative.
-        return this1._absAndSetSign(other1, true)._absAddSetSign(one, true);
-      }
-      return _absOrSetSign(other, false);
-    }
-    // _neg != a._neg
-    var p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // | is symmetric.
-      p = this;
-      n = other;
-    }
-    // p | (-n) == p | ~(n-1) == ~((n-1) &~ p) == -(~((n-1) &~ p) + 1)
-    var n1 = n._absSubSetSign(one, true);
-    // Result cannot be zero if only one of this or a is negative.
-    return n1._absAndNotSetSign(p, true)._absAddSetSign(one, true);
-  }
-
-  /**
-   * Bit-wise exclusive-or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in one,
-   * but not both, of `this` and [other]
-   *
-   * If the operands have the same sign, the result is non-negative,
-   * otherwise the result is negative.
-   */
-  _BigIntImpl operator ^(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    if (_isNegative == other._isNegative) {
-      if (_isNegative) {
-        // (-this) ^ (-other) == ~(this-1) ^ ~(other-1) == (this-1) ^ (other-1)
-        var this1 = _absSubSetSign(one, true);
-        var other1 = other._absSubSetSign(one, true);
-        return this1._absXorSetSign(other1, false);
-      }
-      return _absXorSetSign(other, false);
-    }
-    // _isNegative != a._isNegative
-    var p, n;
-    if (_isNegative) {
-      p = other;
-      n = this;
-    } else {
-      // ^ is symmetric.
-      p = this;
-      n = other;
-    }
-    // p ^ (-n) == p ^ ~(n-1) == ~(p ^ (n-1)) == -((p ^ (n-1)) + 1)
-    var n1 = n._absSubSetSign(one, true);
-    // Result cannot be zero if only one of this or a is negative.
-    return p._absXorSetSign(n1, true)._absAddSetSign(one, true);
-  }
-
-  /**
-   * The bit-wise negate operator.
-   *
-   * Treating `this` as a sufficiently large two's component integer,
-   * the result is a number with the opposite bits set.
-   *
-   * This maps any integer `x` to `-x - 1`.
-   */
-  _BigIntImpl operator ~() {
-    if (_isZero) return _minusOne;
-    if (_isNegative) {
-      // ~(-this) == ~(~(this-1)) == this-1
-      return _absSubSetSign(one, false);
-    }
-    // ~this == -this-1 == -(this+1)
-    // Result cannot be zero if this is positive.
-    return _absAddSetSign(one, true);
-  }
-
-  /// Addition operator.
-  _BigIntImpl operator +(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isZero) return other;
-    if (other._isZero) return this;
-    var isNegative = _isNegative;
-    if (isNegative == other._isNegative) {
-      // this + other == this + other
-      // (-this) + (-other) == -(this + other)
-      return _absAddSetSign(other, isNegative);
-    }
-    // this + (-other) == this - other == -(this - other)
-    // (-this) + other == other - this == -(this - other)
-    if (_absCompare(other) >= 0) {
-      return _absSubSetSign(other, isNegative);
-    }
-    return other._absSubSetSign(this, !isNegative);
-  }
-
-  /// Subtraction operator.
-  _BigIntImpl operator -(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isZero) return -other;
-    if (other._isZero) return this;
-    var isNegative = _isNegative;
-    if (isNegative != other._isNegative) {
-      // this - (-other) == this + other
-      // (-this) - other == -(this + other)
-      return _absAddSetSign(other, isNegative);
-    }
-    // this - other == this - a == -(this - other)
-    // (-this) - (-other) == other - this == -(this - other)
-    if (_absCompare(other) >= 0) {
-      return _absSubSetSign(other, isNegative);
-    }
-    return other._absSubSetSign(this, !isNegative);
-  }
-
-  /// Multiplies `xDigits[xIndex]` with `multiplicandDigits` and adds the result
-  /// to `accumulatorDigits`.
-  ///
-  /// The `multiplicandDigits` in the range `i` to `i`+`n`-1 are the
-  /// multiplicand digits.
-  ///
-  /// The `accumulatorDigits` in the range `j` to `j`+`n`-1 are the accumulator
-  /// digits.
-  ///
-  /// Concretely:
-  /// `accumulatorDigits[j..j+n] += xDigits[xIndex] * m_digits[i..i+n-1]`.
-  /// Returns 1.
-  ///
-  /// Note: This function may be intrinsified. Intrinsics on 64-bit platforms
-  /// process digit pairs at even indices and returns 2.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:never-inline")
-  static int _mulAdd(
-      Uint32List xDigits,
-      int xIndex,
-      Uint32List multiplicandDigits,
-      int i,
-      Uint32List accumulatorDigits,
-      int j,
-      int n) {
-    int x = xDigits[xIndex];
-    if (x == 0) {
-      // No-op if x is 0.
-      return _isIntrinsified ? 2 : 1;
-    }
-    int carry = 0;
-    int xl = x & _halfDigitMask;
-    int xh = x >> _halfDigitBits;
-    while (--n >= 0) {
-      int ml = multiplicandDigits[i] & _halfDigitMask;
-      int mh = multiplicandDigits[i++] >> _halfDigitBits;
-      int ph = xh * ml + mh * xl;
-      int pl = xl * ml +
-          ((ph & _halfDigitMask) << _halfDigitBits) +
-          accumulatorDigits[j] +
-          carry;
-      carry = (pl >> _digitBits) + (ph >> _halfDigitBits) + xh * mh;
-      accumulatorDigits[j++] = pl & _digitMask;
-    }
-    while (carry != 0) {
-      int l = accumulatorDigits[j] + carry;
-      carry = l >> _digitBits;
-      accumulatorDigits[j++] = l & _digitMask;
-    }
-    return _isIntrinsified ? 2 : 1;
-  }
-
-  /// Multiplies `xDigits[i]` with `xDigits` and adds the result to
-  /// `accumulatorDigits`.
-  ///
-  /// The `xDigits` in the range `i` to `used`-1 are the multiplicand digits.
-  ///
-  /// The `accumulatorDigits` in the range 2*`i` to `i`+`used`-1 are the
-  /// accumulator digits.
-  ///
-  /// Concretely:
-  /// `accumulatorDigits[2*i..i+used-1] += xDigits[i]*xDigits[i] +
-  /// 2*xDigits[i]*xDigits[i+1..used-1]`.
-  /// Returns 1.
-  ///
-  /// Note: This function may be intrinsified. Intrinsics on 64-bit platforms
-  /// process digit pairs at even indices and returns 2.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:never-inline")
-  static int _sqrAdd(
-      Uint32List xDigits, int i, Uint32List acculumatorDigits, int used) {
-    int x = xDigits[i];
-    if (x == 0) return _isIntrinsified ? 2 : 1;
-    int j = 2 * i;
-    int carry = 0;
-    int xl = x & _halfDigitMask;
-    int xh = x >> _halfDigitBits;
-    int ph = 2 * xh * xl;
-    int pl = xl * xl +
-        ((ph & _halfDigitMask) << _halfDigitBits) +
-        acculumatorDigits[j];
-    carry = (pl >> _digitBits) + (ph >> _halfDigitBits) + xh * xh;
-    acculumatorDigits[j] = pl & _digitMask;
-    x <<= 1;
-    xl = x & _halfDigitMask;
-    xh = x >> _halfDigitBits;
-    int n = used - i - 1;
-    int k = i + 1;
-    j++;
-    while (--n >= 0) {
-      int l = xDigits[k] & _halfDigitMask;
-      int h = xDigits[k++] >> _halfDigitBits;
-      int ph = xh * l + h * xl;
-      int pl = xl * l +
-          ((ph & _halfDigitMask) << _halfDigitBits) +
-          acculumatorDigits[j] +
-          carry;
-      carry = (pl >> _digitBits) + (ph >> _halfDigitBits) + xh * h;
-      acculumatorDigits[j++] = pl & _digitMask;
-    }
-    carry += acculumatorDigits[i + used];
-    if (carry >= _digitBase) {
-      acculumatorDigits[i + used] = carry - _digitBase;
-      acculumatorDigits[i + used + 1] = 1;
-    } else {
-      acculumatorDigits[i + used] = carry;
-    }
-    return _isIntrinsified ? 2 : 1;
-  }
-
-  /// Multiplication operator.
-  _BigIntImpl operator *(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    var used = _used;
-    var otherUsed = other._used;
-    if (used == 0 || otherUsed == 0) {
-      return zero;
-    }
-    var resultUsed = used + otherUsed;
-    var digits = _digits;
-    var otherDigits = other._digits;
-    var resultDigits = _newDigits(resultUsed);
-    var i = 0;
-    while (i < otherUsed) {
-      i += _mulAdd(otherDigits, i, digits, 0, resultDigits, i, used);
-    }
-    return new _BigIntImpl._(
-        _isNegative != other._isNegative, resultUsed, resultDigits);
-  }
-
-  // resultDigits[0..resultUsed-1] =
-  //     xDigits[0..xUsed-1]*otherDigits[0..otherUsed-1].
-  // Returns resultUsed = xUsed + otherUsed.
-  static int _mulDigits(Uint32List xDigits, int xUsed, Uint32List otherDigits,
-      int otherUsed, Uint32List resultDigits) {
-    var resultUsed = xUsed + otherUsed;
-    var i = resultUsed + (resultUsed & 1);
-    assert(resultDigits.length >= i);
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    i = 0;
-    while (i < otherUsed) {
-      i += _mulAdd(otherDigits, i, xDigits, 0, resultDigits, i, xUsed);
-    }
-    return resultUsed;
-  }
-
-  // resultDigits[0..resultUsed-1] = xDigits[0..xUsed-1]^2.
-  // Returns resultUsed = 2*xUsed.
-  static int _sqrDigits(
-      Uint32List xDigits, int xUsed, Uint32List resultDigits) {
-    var resultUsed = 2 * xUsed;
-    assert(resultDigits.length >= resultUsed);
-    // Since resultUsed is even, no need for a leading zero for
-    // 64-bit processing.
-    var i = resultUsed;
-    while (--i >= 0) {
-      resultDigits[i] = 0;
-    }
-    i = 0;
-    while (i < xUsed - 1) {
-      i += _sqrAdd(xDigits, i, resultDigits, xUsed);
-    }
-    // The last step is already done if digit pairs were processed above.
-    if (i < xUsed) {
-      _mulAdd(xDigits, i, xDigits, i, resultDigits, 2 * i, 1);
-    }
-    return resultUsed;
-  }
-
-  // Indices of the arguments of _estimateQuotientDigit.
-  // For 64-bit processing by intrinsics on 64-bit platforms, the top digit pair
-  // of the divisor is provided in the args array, and a 64-bit estimated
-  // quotient is returned. However, on 32-bit platforms, the low 32-bit digit is
-  // ignored and only one 32-bit digit is returned as the estimated quotient.
-  static const int _divisorLowTopDigit = 0; // Low digit of top pair of divisor.
-  static const int _divisorTopDigit = 1; // Top digit of divisor.
-  static const int _quotientDigit = 2; // Estimated quotient.
-  static const int _quotientHighDigit = 3; // High digit of estimated quotient.
-
-  /// Estimate `args[_quotientDigit] = digits[i-1..i] ~/ args[_divisorTopDigit]`
-  /// Returns 1.
-  ///
-  /// Note: This function may be intrinsified. Intrinsics on 64-bit platforms
-  /// process a digit pair (i always odd):
-  /// Estimate `args[_quotientDigit.._quotientHighDigit] = digits[i-3..i] ~/
-  /// args[_divisorLowTopDigit.._divisorTopDigit]`.
-  /// Returns 2.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:never-inline")
-  static int _estimateQuotientDigit(Uint32List args, Uint32List digits, int i) {
-    // Verify that digit pairs are accessible for 64-bit processing.
-    assert(digits.length >= 4);
-    if (digits[i] == args[_divisorTopDigit]) {
-      args[_quotientDigit] = _digitMask;
-    } else {
-      // Chop off one bit, since a Mint cannot hold 2 digits.
-      var quotientDigit =
-          ((digits[i] << (_digitBits - 1)) | (digits[i - 1] >> 1)) ~/
-              (args[_divisorTopDigit] >> 1);
-      if (quotientDigit > _digitMask) {
-        args[_quotientDigit] = _digitMask;
-      } else {
-        args[_quotientDigit] = quotientDigit;
-      }
-    }
-    return _isIntrinsified ? 2 : 1;
-  }
-
-  /// Returns `trunc(this / other)`, with `other != 0`.
-  _BigIntImpl _div(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    assert(other._used > 0);
-    if (_used < other._used) {
-      return zero;
-    }
-    _divRem(other);
-    // Return quotient, i.e.
-    // _lastQuoRem_digits[_lastRem_used.._lastQuoRem_used-1] with proper sign.
-    var lastQuo_used = _lastQuoRemUsed - _lastRemUsed;
-    var quo_digits = _cloneDigits(
-        _lastQuoRemDigits, _lastRemUsed, _lastQuoRemUsed, lastQuo_used);
-    var quo = new _BigIntImpl._(false, lastQuo_used, quo_digits);
-    if ((_isNegative != other._isNegative) && (quo._used > 0)) {
-      quo = -quo;
-    }
-    return quo;
-  }
-
-  /// Returns `this - other * trunc(this / other)`, with `other != 0`.
-  _BigIntImpl _rem(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    assert(other._used > 0);
-    if (_used < other._used) {
-      return this;
-    }
-    _divRem(other);
-    // Return remainder, i.e.
-    // denormalized _lastQuoRem_digits[0.._lastRem_used-1] with proper sign.
-    var remDigits =
-        _cloneDigits(_lastQuoRemDigits, 0, _lastRemUsed, _lastRemUsed);
-    var rem = new _BigIntImpl._(false, _lastRemUsed, remDigits);
-    if (_lastRem_nsh > 0) {
-      rem = rem >> _lastRem_nsh; // Denormalize remainder.
-    }
-    if (_isNegative && (rem._used > 0)) {
-      rem = -rem;
-    }
-    return rem;
-  }
-
-  /// Computes this ~/ other and this.remainder(other).
-  ///
-  /// Stores the result in [_lastQuoRemDigits], [_lastQuoRemUsed] and
-  /// [_lastRemUsed]. The [_lastQuoRemDigits] contains the digits of *both*, the
-  /// quotient and the remainder.
-  ///
-  /// Caches the input to avoid doing the work again when users write
-  /// `a ~/ b` followed by a `a % b`.
-  void _divRem(_BigIntImpl other) {
-    // Check if result is already cached.
-    if ((this._used == _lastDividendUsed) &&
-        (other._used == _lastDivisorUsed) &&
-        identical(this._digits, _lastDividendDigits) &&
-        identical(other._digits, _lastDivisorDigits)) {
-      return;
-    }
-    assert(_used >= other._used);
-
-    var nsh = _digitBits - other._digits[other._used - 1].bitLength;
-    // For 64-bit processing, make sure other has an even number of digits.
-    if (other._used.isOdd) {
-      nsh += _digitBits;
-    }
-    // Concatenated positive quotient and normalized positive remainder.
-    // The resultDigits can have at most one more digit than the dividend.
-    Uint32List resultDigits;
-    int resultUsed;
-    // Normalized positive divisor (referred to as 'y').
-    // The normalized divisor has the most-significant bit of its most
-    // significant digit set.
-    // This makes estimating the quotient easier.
-    Uint32List yDigits;
-    int yUsed;
-    if (nsh > 0) {
-      // Extra digits for normalization, also used for possible _mulAdd carry.
-      var numExtraDigits = (nsh + _digitBits - 1) ~/ _digitBits + 1;
-      yDigits = _newDigits(other._used + numExtraDigits);
-      yUsed = _lShiftDigits(other._digits, other._used, nsh, yDigits);
-      resultDigits = _newDigits(_used + numExtraDigits);
-      resultUsed = _lShiftDigits(_digits, _used, nsh, resultDigits);
-    } else {
-      yDigits = other._digits;
-      yUsed = other._used;
-      // Extra digit to hold possible _mulAdd carry.
-      resultDigits = _cloneDigits(_digits, 0, _used, _used + 1);
-      resultUsed = _used;
-    }
-    Uint32List args = _newDigits(4);
-    args[_divisorLowTopDigit] = yDigits[yUsed - 2];
-    args[_divisorTopDigit] = yDigits[yUsed - 1];
-    // For 64-bit processing, make sure yUsed, i, and j are even.
-    assert(yUsed.isEven);
-    var i = resultUsed + (resultUsed & 1);
-    var j = i - yUsed;
-    // tmpDigits is a temporary array of i (even resultUsed) digits.
-    var tmpDigits = _newDigits(i);
-    var tmpUsed = _dlShiftDigits(yDigits, yUsed, j, tmpDigits);
-    // Explicit first division step in case normalized dividend is larger or
-    // equal to shifted normalized divisor.
-    if (_compareDigits(resultDigits, resultUsed, tmpDigits, tmpUsed) >= 0) {
-      assert(i == resultUsed);
-      resultDigits[resultUsed++] = 1; // Quotient = 1.
-      // Subtract divisor from remainder.
-      _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-    } else {
-      // Account for possible carry in _mulAdd step.
-      resultDigits[resultUsed++] = 0;
-    }
-    if (resultUsed.isOdd) {
-      resultDigits[resultUsed] = 0; // Leading zero for 64-bit processing.
-    }
-    // Negate y so we can later use _mulAdd instead of non-existent _mulSub.
-    var nyDigits = _newDigits(yUsed + 2);
-    nyDigits[yUsed] = 1;
-    _absSub(nyDigits, yUsed + 1, yDigits, yUsed, nyDigits);
-    // nyDigits is read-only and has yUsed digits (possibly including several
-    // leading zeros) plus a leading zero for 64-bit processing.
-    // resultDigits is modified during iteration.
-    // resultDigits[0..yUsed-1] is the current remainder.
-    // resultDigits[yUsed..resultUsed-1] is the current quotient.
-    --i;
-    while (j > 0) {
-      var d0 = _estimateQuotientDigit(args, resultDigits, i);
-      j -= d0;
-      var d1 =
-          _mulAdd(args, _quotientDigit, nyDigits, 0, resultDigits, j, yUsed);
-      // _estimateQuotientDigit and _mulAdd must agree on the number of digits
-      // to process.
-      assert(d0 == d1);
-      if (d0 == 1) {
-        if (resultDigits[i] < args[_quotientDigit]) {
-          // Reusing the already existing tmpDigits array.
-          var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
-          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-          while (resultDigits[i] < --args[_quotientDigit]) {
-            _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-          }
-        }
-      } else {
-        assert(d0 == 2);
-        assert(resultDigits[i] <= args[_quotientHighDigit]);
-        if (resultDigits[i] < args[_quotientHighDigit] ||
-            resultDigits[i - 1] < args[_quotientDigit]) {
-          // Reusing the already existing tmpDigits array.
-          var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
-          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-          if (args[_quotientDigit] == 0) {
-            --args[_quotientHighDigit];
-          }
-          --args[_quotientDigit];
-          assert(resultDigits[i] <= args[_quotientHighDigit]);
-          while (resultDigits[i] < args[_quotientHighDigit] ||
-              resultDigits[i - 1] < args[_quotientDigit]) {
-            _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-            if (args[_quotientDigit] == 0) {
-              --args[_quotientHighDigit];
-            }
-            --args[_quotientDigit];
-            assert(resultDigits[i] <= args[_quotientHighDigit]);
-          }
-        }
-      }
-      i -= d0;
-    }
-    // Cache result.
-    _lastDividendDigits = _digits;
-    _lastDividendUsed = _used;
-    _lastDivisorDigits = other._digits;
-    _lastDivisorUsed = other._used;
-    _lastQuoRemDigits = resultDigits;
-    _lastQuoRemUsed = resultUsed;
-    _lastRemUsed = yUsed;
-    _lastRem_nsh = nsh;
-  }
-
-  // Customized version of _rem() minimizing allocations for use in reduction.
-  // Input:
-  //   xDigits[0..xUsed-1]: positive dividend.
-  //   yDigits[0..yUsed-1]: normalized positive divisor.
-  //   nyDigits[0..yUsed-1]: negated yDigits.
-  //   nsh: normalization shift amount.
-  //   args: top y digit(s) and place holder for estimated quotient digit(s).
-  //   tmpDigits: temp array of 2*yUsed digits.
-  //   resultDigits: result digits array large enough to temporarily hold
-  //                 concatenated quotient and normalized remainder.
-  // Output:
-  //   resultDigits[0..resultUsed-1]: positive remainder.
-  // Returns resultUsed.
-  static int _remDigits(
-      Uint32List xDigits,
-      int xUsed,
-      Uint32List yDigits,
-      int yUsed,
-      Uint32List nyDigits,
-      int nsh,
-      Uint32List args,
-      Uint32List tmpDigits,
-      Uint32List resultDigits) {
-    // Initialize resultDigits to normalized positive dividend.
-    var resultUsed = _lShiftDigits(xDigits, xUsed, nsh, resultDigits);
-    // For 64-bit processing, make sure yUsed, i, and j are even.
-    assert(yUsed.isEven);
-    var i = resultUsed + (resultUsed & 1);
-    var j = i - yUsed;
-    var tmpUsed = _dlShiftDigits(yDigits, yUsed, j, tmpDigits);
-    // Explicit first division step in case normalized dividend is larger or
-    // equal to shifted normalized divisor.
-    if (_compareDigits(resultDigits, resultUsed, tmpDigits, tmpUsed) >= 0) {
-      assert(i == resultUsed);
-      resultDigits[resultUsed++] = 1; // Quotient = 1.
-      // Subtract divisor from remainder.
-      _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-    } else {
-      // Account for possible carry in _mulAdd step.
-      resultDigits[resultUsed++] = 0;
-    }
-    if (resultUsed.isOdd) {
-      resultDigits[resultUsed] = 0; // Leading zero for 64-bit processing.
-    }
-    // Negated yDigits passed in nyDigits allow the use of _mulAdd instead of
-    // unimplemented _mulSub.
-    // nyDigits is read-only and has yUsed digits (possibly including several
-    // leading zeros) plus a leading zero for 64-bit processing.
-    // resultDigits is modified during iteration.
-    // resultDigits[0..yUsed-1] is the current remainder.
-    // resultDigits[yUsed..resultUsed-1] is the current quotient.
-    --i;
-    while (j > 0) {
-      var d0 = _estimateQuotientDigit(args, resultDigits, i);
-      j -= d0;
-      var d1 =
-          _mulAdd(args, _quotientDigit, nyDigits, 0, resultDigits, j, yUsed);
-      // _estimateQuotientDigit and _mulAdd must agree on the number of digits
-      // to process.
-      assert(d0 == d1);
-      if (d0 == 1) {
-        if (resultDigits[i] < args[_quotientDigit]) {
-          var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
-          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-          while (resultDigits[i] < --args[_quotientDigit]) {
-            _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-          }
-        }
-      } else {
-        assert(d0 == 2);
-        assert(resultDigits[i] <= args[_quotientHighDigit]);
-        if ((resultDigits[i] < args[_quotientHighDigit]) ||
-            (resultDigits[i - 1] < args[_quotientDigit])) {
-          var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
-          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-          if (args[_quotientDigit] == 0) {
-            --args[_quotientHighDigit];
-          }
-          --args[_quotientDigit];
-          assert(resultDigits[i] <= args[_quotientHighDigit]);
-          while ((resultDigits[i] < args[_quotientHighDigit]) ||
-              (resultDigits[i - 1] < args[_quotientDigit])) {
-            _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
-            if (args[_quotientDigit] == 0) {
-              --args[_quotientHighDigit];
-            }
-            --args[_quotientDigit];
-            assert(resultDigits[i] <= args[_quotientHighDigit]);
-          }
-        }
-      }
-      i -= d0;
-    }
-    // Return remainder, i.e. denormalized resultDigits[0..yUsed-1].
-    resultUsed = yUsed;
-    if (nsh > 0) {
-      // Denormalize remainder.
-      resultUsed = _rShiftDigits(resultDigits, resultUsed, nsh, resultDigits);
-    }
-    return resultUsed;
-  }
-
-  int get hashCode {
-    // This is the [Jenkins hash function][1] but using masking to keep
-    // values in SMI range.
-    //
-    // [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
-
-    int combine(int hash, int value) {
-      hash = 0x1fffffff & (hash + value);
-      hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-      return hash ^ (hash >> 6);
-    }
-
-    int finish(int hash) {
-      hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-      hash = hash ^ (hash >> 11);
-      return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-    }
-
-    if (_isZero) return 6707; // Just a random number.
-    var hash = _isNegative ? 83585 : 429689; // Also random.
-    for (int i = 0; i < _used; i++) {
-      hash = combine(hash, _digits[i]);
-    }
-    return finish(hash);
-  }
-
-  /**
-   * Test whether this value is numerically equal to `other`.
-   *
-   * If [other] is a [_BigIntImpl] returns whether the two operands have the
-   * same value.
-   *
-   * Returns false if `other` is not a [_BigIntImpl].
-   */
-  bool operator ==(Object other) =>
-      other is _BigIntImpl && compareTo(other) == 0;
-
-  /**
-   * Returns the minimum number of bits required to store this big integer.
-   *
-   * The number of bits excludes the sign bit, which gives the natural length
-   * for non-negative (unsigned) values.  Negative values are complemented to
-   * return the bit position of the first bit that differs from the sign bit.
-   *
-   * To find the number of bits needed to store the value as a signed value,
-   * add one, i.e. use `x.bitLength + 1`.
-   *
-   * ```
-   * x.bitLength == (-x-1).bitLength
-   *
-   * new BigInt.from(3).bitLength == 2;   // 00000011
-   * new BigInt.from(2).bitLength == 2;   // 00000010
-   * new BigInt.from(1).bitLength == 1;   // 00000001
-   * new BigInt.from(0).bitLength == 0;   // 00000000
-   * new BigInt.from(-1).bitLength == 0;  // 11111111
-   * new BigInt.from(-2).bitLength == 1;  // 11111110
-   * new BigInt.from(-3).bitLength == 2;  // 11111101
-   * new BigInt.from(-4).bitLength == 2;  // 11111100
-   * ```
-   */
-  int get bitLength {
-    if (_used == 0) return 0;
-    if (_isNegative) return (~this).bitLength;
-    return _digitBits * (_used - 1) + _digits[_used - 1].bitLength;
-  }
-
-  /**
-   * Truncating division operator.
-   *
-   * Performs a truncating integer division, where the remainder is discarded.
-   *
-   * The remainder can be computed using the [remainder] method.
-   *
-   * Examples:
-   * ```
-   * var seven = new BigInt.from(7);
-   * var three = new BigInt.from(3);
-   * seven ~/ three;    // => 2
-   * (-seven) ~/ three; // => -2
-   * seven ~/ -three;   // => -2
-   * seven.remainder(three);    // => 1
-   * (-seven).remainder(three); // => -1
-   * seven.remainder(-three);   // => 1
-   * ```
-   */
-  _BigIntImpl operator ~/(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return _div(other);
-  }
-
-  /**
-   * Returns the remainder of the truncating division of `this` by [other].
-   *
-   * The result `r` of this operation satisfies:
-   * `this == (this ~/ other) * other + r`.
-   * As a consequence the remainder `r` has the same sign as the divider `this`.
-   */
-  _BigIntImpl remainder(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return _rem(other);
-  }
-
-  /// Division operator.
-  double operator /(BigInt other) => this.toDouble() / other.toDouble();
-
-  /** Relational less than operator. */
-  bool operator <(BigInt other) => compareTo(other) < 0;
-
-  /** Relational less than or equal operator. */
-  bool operator <=(BigInt other) => compareTo(other) <= 0;
-
-  /** Relational greater than operator. */
-  bool operator >(BigInt other) => compareTo(other) > 0;
-
-  /** Relational greater than or equal operator. */
-  bool operator >=(BigInt other) => compareTo(other) >= 0;
-
-  /**
-   * Euclidean modulo operator.
-   *
-   * Returns the remainder of the Euclidean division. The Euclidean division of
-   * two integers `a` and `b` yields two integers `q` and `r` such that
-   * `a == b * q + r` and `0 <= r < b.abs()`.
-   *
-   * The sign of the returned value `r` is always positive.
-   *
-   * See [remainder] for the remainder of the truncating division.
-   */
-  _BigIntImpl operator %(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (other._used == 0) {
-      throw const IntegerDivisionByZeroException();
-    }
-    var result = _rem(other);
-    if (result._isNegative) {
-      if (other._isNegative) {
-        result = result - other;
-      } else {
-        result = result + other;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns the sign of this big integer.
-   *
-   * Returns 0 for zero, -1 for values less than zero and
-   * +1 for values greater than zero.
-   */
-  int get sign {
-    if (_used == 0) return 0;
-    return _isNegative ? -1 : 1;
-  }
-
-  /// Whether this big integer is even.
-  bool get isEven => _used == 0 || (_digits[0] & 1) == 0;
-
-  /// Whether this big integer is odd.
-  bool get isOdd => !isEven;
-
-  /// Whether this number is negative.
-  bool get isNegative => _isNegative;
-
-  _BigIntImpl pow(int exponent) {
-    if (exponent < 0) {
-      throw new ArgumentError("Exponent must not be negative: $exponent");
-    }
-    if (exponent == 0) return one;
-
-    // Exponentiation by squaring.
-    var result = one;
-    var base = this;
-    while (exponent != 0) {
-      if ((exponent & 1) == 1) {
-        result *= base;
-      }
-      exponent >>= 1;
-      // Skip unnecessary operation.
-      if (exponent != 0) {
-        base *= base;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns this integer to the power of [exponent] modulo [modulus].
-   *
-   * The [exponent] must be non-negative and [modulus] must be
-   * positive.
-   */
-  _BigIntImpl modPow(BigInt bigExponent, BigInt bigModulus) {
-    final exponent = _ensureSystemBigInt(bigExponent, 'bigExponent');
-    final modulus = _ensureSystemBigInt(bigModulus, 'bigModulus');
-    if (exponent._isNegative) {
-      throw new ArgumentError("exponent must be positive: $exponent");
-    }
-    if (modulus <= zero) {
-      throw new ArgumentError("modulus must be strictly positive: $modulus");
-    }
-    if (exponent._isZero) return one;
-
-    final exponentBitlen = exponent.bitLength;
-    if (exponentBitlen <= 0) return one;
-    final bool cannotUseMontgomery = modulus.isEven || abs() >= modulus;
-    if (cannotUseMontgomery || exponentBitlen < 64) {
-      _BigIntReduction z = (cannotUseMontgomery || exponentBitlen < 8)
-          ? new _BigIntClassicReduction(modulus)
-          : new _BigIntMontgomeryReduction(modulus);
-      var resultDigits = _newDigits(2 * z._normModulusUsed + 2);
-      var result2Digits = _newDigits(2 * z._normModulusUsed + 2);
-      var gDigits = _newDigits(z._normModulusUsed);
-      var gUsed = z._convert(this, gDigits);
-      // Initialize result with g.
-      // Copy leading zero if any.
-      for (int j = gUsed + (gUsed & 1) - 1; j >= 0; j--) {
-        resultDigits[j] = gDigits[j];
-      }
-      var resultUsed = gUsed;
-      var result2Used;
-      for (int i = exponentBitlen - 2; i >= 0; i--) {
-        result2Used = z._sqr(resultDigits, resultUsed, result2Digits);
-        if (exponent._digits[i ~/ _digitBits] & (1 << (i % _digitBits)) != 0) {
-          resultUsed =
-              z._mul(result2Digits, result2Used, gDigits, gUsed, resultDigits);
-        } else {
-          // Swap result and result2.
-          var tmpDigits = resultDigits;
-          var tmpUsed = resultUsed;
-          resultDigits = result2Digits;
-          resultUsed = result2Used;
-          result2Digits = tmpDigits;
-          result2Used = tmpUsed;
-        }
-      }
-      return z._revert(resultDigits, resultUsed);
-    }
-    late int k;
-    if (exponentBitlen < 18)
-      k = 1;
-    else if (exponentBitlen < 48)
-      k = 3;
-    else if (exponentBitlen < 144)
-      k = 4;
-    else if (exponentBitlen < 768)
-      k = 5;
-    else
-      k = 6;
-    _BigIntReduction z = new _BigIntMontgomeryReduction(modulus);
-    var n = 3;
-    final int k1 = k - 1;
-    final km = (1 << k) - 1;
-    List gDigits = new List.filled(km + 1, null);
-    List gUsed = new List.filled(km + 1, null);
-    gDigits[1] = _newDigits(z._normModulusUsed);
-    gUsed[1] = z._convert(this, gDigits[1]);
-    if (k > 1) {
-      var g2Digits = _newDigits(2 * z._normModulusUsed + 2);
-      var g2Used = z._sqr(gDigits[1], gUsed[1], g2Digits);
-      while (n <= km) {
-        gDigits[n] = _newDigits(2 * z._normModulusUsed + 2);
-        gUsed[n] =
-            z._mul(g2Digits, g2Used, gDigits[n - 2], gUsed[n - 2], gDigits[n]);
-        n += 2;
-      }
-    }
-    var w;
-    var isOne = true;
-    var resultDigits = one._digits;
-    var resultUsed = one._used;
-    var result2Digits = _newDigits(2 * z._normModulusUsed + 2);
-    var result2Used;
-    var exponentDigits = exponent._digits;
-    var j = exponent._used - 1;
-    int i = exponentDigits[j].bitLength - 1;
-    while (j >= 0) {
-      if (i >= k1) {
-        w = (exponentDigits[j] >> (i - k1)) & km;
-      } else {
-        w = (exponentDigits[j] & ((1 << (i + 1)) - 1)) << (k1 - i);
-        if (j > 0) {
-          w |= exponentDigits[j - 1] >> (_digitBits + i - k1);
-        }
-      }
-      n = k;
-      while ((w & 1) == 0) {
-        w >>= 1;
-        --n;
-      }
-      if ((i -= n) < 0) {
-        i += _digitBits;
-        --j;
-      }
-      if (isOne) {
-        // r == 1, don't bother squaring or multiplying it.
-        resultDigits = _newDigits(2 * z._normModulusUsed + 2);
-        resultUsed = gUsed[w];
-        var gwDigits = gDigits[w];
-        var ri = resultUsed + (resultUsed & 1); // Copy leading zero if any.
-        while (--ri >= 0) {
-          resultDigits[ri] = gwDigits[ri];
-        }
-        isOne = false;
-      } else {
-        while (n > 1) {
-          result2Used = z._sqr(resultDigits, resultUsed, result2Digits);
-          resultUsed = z._sqr(result2Digits, result2Used, resultDigits);
-          n -= 2;
-        }
-        if (n > 0) {
-          result2Used = z._sqr(resultDigits, resultUsed, result2Digits);
-        } else {
-          var swapDigits = resultDigits;
-          var swapUsed = resultUsed;
-          resultDigits = result2Digits;
-          resultUsed = result2Used;
-          result2Digits = swapDigits;
-          result2Used = swapUsed;
-        }
-        resultUsed = z._mul(
-            result2Digits, result2Used, gDigits[w], gUsed[w], resultDigits);
-      }
-      while (j >= 0 && (exponentDigits[j] & (1 << i)) == 0) {
-        result2Used = z._sqr(resultDigits, resultUsed, result2Digits);
-        var swapDigits = resultDigits;
-        var swapUsed = resultUsed;
-        resultDigits = result2Digits;
-        resultUsed = result2Used;
-        result2Digits = swapDigits;
-        result2Used = swapUsed;
-        if (--i < 0) {
-          i = _digitBits - 1;
-          --j;
-        }
-      }
-    }
-    assert(!isOne);
-    return z._revert(resultDigits, resultUsed);
-  }
-
-  // If inv is false, returns gcd(x, y).
-  // If inv is true and gcd(x, y) = 1, returns d, so that c*x + d*y = 1.
-  // If inv is true and gcd(x, y) != 1, throws Exception("Not coprime").
-  static _BigIntImpl _binaryGcd(_BigIntImpl x, _BigIntImpl y, bool inv) {
-    var xDigits = x._digits;
-    var yDigits = y._digits;
-    var xUsed = x._used;
-    var yUsed = y._used;
-    var maxUsed = _max(xUsed, yUsed);
-    final maxLen = maxUsed + (maxUsed & 1);
-    xDigits = _cloneDigits(xDigits, 0, xUsed, maxLen);
-    yDigits = _cloneDigits(yDigits, 0, yUsed, maxLen);
-    int shiftAmount = 0;
-    if (inv) {
-      if ((yUsed == 1) && (yDigits[0] == 1)) return one;
-      if ((yUsed == 0) || (yDigits[0].isEven && xDigits[0].isEven)) {
-        throw new Exception("Not coprime");
-      }
-    } else {
-      if (x._isZero) {
-        throw new ArgumentError.value(0, "this", "must not be zero");
-      }
-      if (y._isZero) {
-        throw new ArgumentError.value(0, "other", "must not be zero");
-      }
-      if (((xUsed == 1) && (xDigits[0] == 1)) ||
-          ((yUsed == 1) && (yDigits[0] == 1))) return one;
-      while (((xDigits[0] & 1) == 0) && ((yDigits[0] & 1) == 0)) {
-        _rsh(xDigits, xUsed, 1, xDigits);
-        _rsh(yDigits, yUsed, 1, yDigits);
-        shiftAmount++;
-      }
-      if (shiftAmount >= _digitBits) {
-        var digitShiftAmount = shiftAmount ~/ _digitBits;
-        xUsed -= digitShiftAmount;
-        yUsed -= digitShiftAmount;
-        maxUsed -= digitShiftAmount;
-      }
-      if ((yDigits[0] & 1) == 1) {
-        // Swap x and y.
-        var tmpDigits = xDigits;
-        var tmpUsed = xUsed;
-        xDigits = yDigits;
-        xUsed = yUsed;
-        yDigits = tmpDigits;
-        yUsed = tmpUsed;
-      }
-    }
-    var uDigits = _cloneDigits(xDigits, 0, xUsed, maxLen);
-    var vDigits = _cloneDigits(yDigits, 0, yUsed, maxLen + 2); // +2 for lsh.
-    final bool ac = (xDigits[0] & 1) == 0;
-
-    // Variables a, b, c, and d require one more digit.
-    final abcdUsed = maxUsed + 1;
-    final abcdLen = abcdUsed + (abcdUsed & 1) + 2; // +2 to satisfy _absAdd.
-
-    bool aIsNegative = false;
-    bool cIsNegative = false;
-    late final Uint32List aDigits, cDigits;
-    if (ac) {
-      aDigits = _newDigits(abcdLen);
-      aDigits[0] = 1;
-      cDigits = _newDigits(abcdLen);
-    }
-    final Uint32List bDigits = _newDigits(abcdLen);
-    final Uint32List dDigits = _newDigits(abcdLen);
-    bool bIsNegative = false;
-    bool dIsNegative = false;
-    dDigits[0] = 1;
-
-    while (true) {
-      while ((uDigits[0] & 1) == 0) {
-        _rsh(uDigits, maxUsed, 1, uDigits);
-        if (ac) {
-          if (((aDigits[0] & 1) == 1) || ((bDigits[0] & 1) == 1)) {
-            // a += y
-            if (aIsNegative) {
-              if ((aDigits[maxUsed] != 0) ||
-                  (_compareDigits(aDigits, maxUsed, yDigits, maxUsed)) > 0) {
-                _absSub(aDigits, abcdUsed, yDigits, maxUsed, aDigits);
-              } else {
-                _absSub(yDigits, maxUsed, aDigits, maxUsed, aDigits);
-                aIsNegative = false;
-              }
-            } else {
-              _absAdd(aDigits, abcdUsed, yDigits, maxUsed, aDigits);
-            }
-            // b -= x
-            if (bIsNegative) {
-              _absAdd(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-            } else if ((bDigits[maxUsed] != 0) ||
-                (_compareDigits(bDigits, maxUsed, xDigits, maxUsed) > 0)) {
-              _absSub(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-            } else {
-              _absSub(xDigits, maxUsed, bDigits, maxUsed, bDigits);
-              bIsNegative = true;
-            }
-          }
-          _rsh(aDigits, abcdUsed, 1, aDigits);
-        } else if ((bDigits[0] & 1) == 1) {
-          // b -= x
-          if (bIsNegative) {
-            _absAdd(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-          } else if ((bDigits[maxUsed] != 0) ||
-              (_compareDigits(bDigits, maxUsed, xDigits, maxUsed) > 0)) {
-            _absSub(bDigits, abcdUsed, xDigits, maxUsed, bDigits);
-          } else {
-            _absSub(xDigits, maxUsed, bDigits, maxUsed, bDigits);
-            bIsNegative = true;
-          }
-        }
-        _rsh(bDigits, abcdUsed, 1, bDigits);
-      }
-      while ((vDigits[0] & 1) == 0) {
-        _rsh(vDigits, maxUsed, 1, vDigits);
-        if (ac) {
-          if (((cDigits[0] & 1) == 1) || ((dDigits[0] & 1) == 1)) {
-            // c += y
-            if (cIsNegative) {
-              if ((cDigits[maxUsed] != 0) ||
-                  (_compareDigits(cDigits, maxUsed, yDigits, maxUsed) > 0)) {
-                _absSub(cDigits, abcdUsed, yDigits, maxUsed, cDigits);
-              } else {
-                _absSub(yDigits, maxUsed, cDigits, maxUsed, cDigits);
-                cIsNegative = false;
-              }
-            } else {
-              _absAdd(cDigits, abcdUsed, yDigits, maxUsed, cDigits);
-            }
-            // d -= x
-            if (dIsNegative) {
-              _absAdd(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-            } else if ((dDigits[maxUsed] != 0) ||
-                (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-              _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-            } else {
-              _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-              dIsNegative = true;
-            }
-          }
-          _rsh(cDigits, abcdUsed, 1, cDigits);
-        } else if ((dDigits[0] & 1) == 1) {
-          // d -= x
-          if (dIsNegative) {
-            _absAdd(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-          } else if ((dDigits[maxUsed] != 0) ||
-              (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-            _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-          } else {
-            _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-            dIsNegative = true;
-          }
-        }
-        _rsh(dDigits, abcdUsed, 1, dDigits);
-      }
-      if (_compareDigits(uDigits, maxUsed, vDigits, maxUsed) >= 0) {
-        // u -= v
-        _absSub(uDigits, maxUsed, vDigits, maxUsed, uDigits);
-        if (ac) {
-          // a -= c
-          if (aIsNegative == cIsNegative) {
-            var a_cmp_c = _compareDigits(aDigits, abcdUsed, cDigits, abcdUsed);
-            if (a_cmp_c > 0) {
-              _absSub(aDigits, abcdUsed, cDigits, abcdUsed, aDigits);
-            } else {
-              _absSub(cDigits, abcdUsed, aDigits, abcdUsed, aDigits);
-              aIsNegative = !aIsNegative && (a_cmp_c != 0);
-            }
-          } else {
-            _absAdd(aDigits, abcdUsed, cDigits, abcdUsed, aDigits);
-          }
-        }
-        // b -= d
-        if (bIsNegative == dIsNegative) {
-          var b_cmp_d = _compareDigits(bDigits, abcdUsed, dDigits, abcdUsed);
-          if (b_cmp_d > 0) {
-            _absSub(bDigits, abcdUsed, dDigits, abcdUsed, bDigits);
-          } else {
-            _absSub(dDigits, abcdUsed, bDigits, abcdUsed, bDigits);
-            bIsNegative = !bIsNegative && (b_cmp_d != 0);
-          }
-        } else {
-          _absAdd(bDigits, abcdUsed, dDigits, abcdUsed, bDigits);
-        }
-      } else {
-        // v -= u
-        _absSub(vDigits, maxUsed, uDigits, maxUsed, vDigits);
-        if (ac) {
-          // c -= a
-          if (cIsNegative == aIsNegative) {
-            var c_cmp_a = _compareDigits(cDigits, abcdUsed, aDigits, abcdUsed);
-            if (c_cmp_a > 0) {
-              _absSub(cDigits, abcdUsed, aDigits, abcdUsed, cDigits);
-            } else {
-              _absSub(aDigits, abcdUsed, cDigits, abcdUsed, cDigits);
-              cIsNegative = !cIsNegative && (c_cmp_a != 0);
-            }
-          } else {
-            _absAdd(cDigits, abcdUsed, aDigits, abcdUsed, cDigits);
-          }
-        }
-        // d -= b
-        if (dIsNegative == bIsNegative) {
-          var d_cmp_b = _compareDigits(dDigits, abcdUsed, bDigits, abcdUsed);
-          if (d_cmp_b > 0) {
-            _absSub(dDigits, abcdUsed, bDigits, abcdUsed, dDigits);
-          } else {
-            _absSub(bDigits, abcdUsed, dDigits, abcdUsed, dDigits);
-            dIsNegative = !dIsNegative && (d_cmp_b != 0);
-          }
-        } else {
-          _absAdd(dDigits, abcdUsed, bDigits, abcdUsed, dDigits);
-        }
-      }
-      // Exit loop if u == 0.
-      var i = maxUsed;
-      while ((i > 0) && (uDigits[i - 1] == 0)) --i;
-      if (i == 0) break;
-    }
-    if (!inv) {
-      if (shiftAmount > 0) {
-        maxUsed = _lShiftDigits(vDigits, maxUsed, shiftAmount, vDigits);
-      }
-      return new _BigIntImpl._(false, maxUsed, vDigits);
-    }
-    // No inverse if v != 1.
-    var i = maxUsed - 1;
-    while ((i > 0) && (vDigits[i] == 0)) --i;
-    if ((i != 0) || (vDigits[0] != 1)) {
-      throw new Exception("Not coprime");
-    }
-
-    if (dIsNegative) {
-      while ((dDigits[maxUsed] != 0) ||
-          (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) > 0)) {
-        // d += x, d still negative
-        _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-      }
-      // d += x
-      _absSub(xDigits, maxUsed, dDigits, maxUsed, dDigits);
-      dIsNegative = false;
-    } else {
-      while ((dDigits[maxUsed] != 0) ||
-          (_compareDigits(dDigits, maxUsed, xDigits, maxUsed) >= 0)) {
-        // d -= x
-        _absSub(dDigits, abcdUsed, xDigits, maxUsed, dDigits);
-      }
-    }
-    return new _BigIntImpl._(false, maxUsed, dDigits);
-  }
-
-  /**
-   * Returns the modular multiplicative inverse of this big integer
-   * modulo [modulus].
-   *
-   * The [modulus] must be positive.
-   *
-   * It is an error if no modular inverse exists.
-   */
-  // Returns 1/this % modulus, with modulus > 0.
-  _BigIntImpl modInverse(BigInt bigInt) {
-    final modulus = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (modulus <= zero) {
-      throw new ArgumentError("Modulus must be strictly positive: $modulus");
-    }
-    if (modulus == one) return zero;
-    var tmp = this;
-    if (tmp._isNegative || (tmp._absCompare(modulus) >= 0)) {
-      tmp %= modulus;
-    }
-    return _binaryGcd(modulus, tmp, true);
-  }
-
-  /**
-   * Returns the greatest common divisor of this big integer and [other].
-   *
-   * If either number is non-zero, the result is the numerically greatest
-   * integer dividing both `this` and `other`.
-   *
-   * The greatest common divisor is independent of the order,
-   * so `x.gcd(y)` is  always the same as `y.gcd(x)`.
-   *
-   * For any integer `x`, `x.gcd(x)` is `x.abs()`.
-   *
-   * If both `this` and `other` is zero, the result is also zero.
-   */
-  _BigIntImpl gcd(BigInt bigInt) {
-    final other = _ensureSystemBigInt(bigInt, 'bigInt');
-    if (_isZero) return other.abs();
-    if (other._isZero) return this.abs();
-    return _binaryGcd(this, other, false);
-  }
-
-  /**
-   * Returns the least significant [width] bits of this big integer as a
-   * non-negative number (i.e. unsigned representation).  The returned value has
-   * zeros in all bit positions higher than [width].
-   *
-   * ```
-   * new BigInt.from(-1).toUnsigned(5) == 31   // 11111111  ->  00011111
-   * ```
-   *
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit quantity:
-   *
-   * ```
-   * q = (q + 1).toUnsigned(8);
-   * ```
-   *
-   * `q` will count from `0` up to `255` and then wrap around to `0`.
-   *
-   * If the input fits in [width] bits without truncation, the result is the
-   * same as the input.  The minimum width needed to avoid truncation of `x` is
-   * given by `x.bitLength`, i.e.
-   *
-   * ```
-   * x == x.toUnsigned(x.bitLength);
-   * ```
-   */
-  _BigIntImpl toUnsigned(int width) {
-    return this & ((one << width) - one);
-  }
-
-  /**
-   * Returns the least significant [width] bits of this integer, extending the
-   * highest retained bit to the sign.  This is the same as truncating the value
-   * to fit in [width] bits using an signed 2-s complement representation.  The
-   * returned value has the same bit value in all positions higher than [width].
-   *
-   * ```
-   * var big15 = new BigInt.from(15);
-   * var big16 = new BigInt.from(16);
-   * var big239 = new BigInt.from(239);
-   *                                      V--sign bit-V
-   * big16.toSigned(5) == -big16   //  00010000 -> 11110000
-   * big239.toSigned(5) == big15   //  11101111 -> 00001111
-   *                                      ^           ^
-   * ```
-   *
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit signed quantity:
-   *
-   * ```
-   * q = (q + 1).toSigned(8);
-   * ```
-   *
-   * `q` will count from `0` up to `127`, wrap to `-128` and count back up to
-   * `127`.
-   *
-   * If the input value fits in [width] bits without truncation, the result is
-   * the same as the input.  The minimum width needed to avoid truncation of `x`
-   * is `x.bitLength + 1`, i.e.
-   *
-   * ```
-   * x == x.toSigned(x.bitLength + 1);
-   * ```
-   */
-  _BigIntImpl toSigned(int width) {
-    // The value of binary number weights each bit by a power of two.  The
-    // twos-complement value weights the sign bit negatively.  We compute the
-    // value of the negative weighting by isolating the sign bit with the
-    // correct power of two weighting and subtracting it from the value of the
-    // lower bits.
-    var signMask = one << (width - 1);
-    return (this & (signMask - one)) - (this & signMask);
-  }
-
-  bool get isValidInt {
-    assert(_digitBits == 32);
-    return _used < 2 ||
-        (_used == 2 &&
-            (_digits[1] < 0x80000000 ||
-                (_isNegative && _digits[1] == 0x80000000 && _digits[0] == 0)));
-  }
-
-  int toInt() {
-    assert(_digitBits == 32);
-    if (_used == 0) return 0;
-    if (_used == 1) return _isNegative ? -_digits[0] : _digits[0];
-    if (_used == 2 && _digits[1] < 0x80000000) {
-      var result = (_digits[1] << _digitBits) | _digits[0];
-      return _isNegative ? -result : result;
-    }
-    return _isNegative ? _minInt : _maxInt;
-  }
-
-  /**
-   * Returns this [_BigIntImpl] as a [double].
-   *
-   * If the number is not representable as a [double], an
-   * approximation is returned. For numerically large integers, the
-   * approximation may be infinite.
-   */
-  double toDouble() {
-    const int exponentBias = 1075;
-    // There are 11 bits for the exponent.
-    // 2047 (all bits set to 1) is reserved for infinity and NaN.
-    // When storing the exponent in the 11 bits, it is biased by exponentBias
-    // to support negative exponents.
-    const int maxDoubleExponent = 2046 - exponentBias;
-    if (_isZero) return 0.0;
-
-    // We fill the 53 bits little-endian.
-    var resultBits = new Uint8List(8);
-
-    var length = _digitBits * (_used - 1) + _digits[_used - 1].bitLength;
-    if (length > maxDoubleExponent + 53) {
-      return _isNegative ? double.negativeInfinity : double.infinity;
-    }
-
-    // The most significant bit is for the sign.
-    if (_isNegative) resultBits[7] = 0x80;
-
-    // Write the exponent into bits 1..12:
-    var biasedExponent = length - 53 + exponentBias;
-    resultBits[6] = (biasedExponent & 0xF) << 4;
-    resultBits[7] |= biasedExponent >> 4;
-
-    int cachedBits = 0;
-    int cachedBitsLength = 0;
-    int digitIndex = _used - 1;
-    int readBits(int n) {
-      // Ensure that we have enough bits in [cachedBits].
-      while (cachedBitsLength < n) {
-        int nextDigit;
-        int nextDigitLength = _digitBits; // May get updated.
-        if (digitIndex < 0) {
-          nextDigit = 0;
-          digitIndex--;
-        } else {
-          nextDigit = _digits[digitIndex];
-          if (digitIndex == _used - 1) nextDigitLength = nextDigit.bitLength;
-          digitIndex--;
-        }
-        cachedBits = (cachedBits << nextDigitLength) + nextDigit;
-        cachedBitsLength += nextDigitLength;
-      }
-      // Read the top [n] bits.
-      var result = cachedBits >> (cachedBitsLength - n);
-      // Remove the bits from the cache.
-      cachedBits -= result << (cachedBitsLength - n);
-      cachedBitsLength -= n;
-      return result;
-    }
-
-    // The first leading 1 bit is implicit in the double-representation and can
-    // be discarded.
-    var leadingBits = readBits(5) & 0xF;
-    resultBits[6] |= leadingBits;
-
-    for (int i = 5; i >= 0; i--) {
-      // Get the remaining 48 bits.
-      resultBits[i] = readBits(8);
-    }
-
-    void roundUp() {
-      // Simply consists of adding 1 to the whole 64 bit "number".
-      // It will update the exponent, if necessary.
-      // It might even round up to infinity (which is what we want).
-      var carry = 1;
-      for (int i = 0; i < 8; i++) {
-        if (carry == 0) break;
-        var sum = resultBits[i] + carry;
-        resultBits[i] = sum & 0xFF;
-        carry = sum >> 8;
-      }
-    }
-
-    if (readBits(1) == 1) {
-      if (resultBits[0].isOdd) {
-        // Rounds to even all the time.
-        roundUp();
-      } else {
-        // Round up, if there is at least one other digit that is not 0.
-        if (cachedBits != 0) {
-          // There is already one in the cachedBits.
-          roundUp();
-        } else {
-          for (int i = digitIndex; i >= 0; i--) {
-            if (_digits[i] != 0) {
-              roundUp();
-              break;
-            }
-          }
-        }
-      }
-    }
-    return resultBits.buffer.asByteData().getFloat64(0, Endian.little);
-  }
-
-  /**
-   * Returns a String-representation of this integer.
-   *
-   * The returned string is parsable by [parse].
-   * For any `_BigIntImpl` `i`, it is guaranteed that
-   * `i == _BigIntImpl.parse(i.toString())`.
-   */
-  String toString() {
-    if (_used == 0) return "0";
-    if (_used == 1) {
-      if (_isNegative) return (-_digits[0]).toString();
-      return _digits[0].toString();
-    }
-
-    // Generate in chunks of 9 digits.
-    // The chunks are in reversed order.
-    var decimalDigitChunks = <String>[];
-    var rest = isNegative ? -this : this;
-    while (rest._used > 1) {
-      var digits9 = rest.remainder(_oneBillion).toString();
-      decimalDigitChunks.add(digits9);
-      var zeros = 9 - digits9.length;
-      if (zeros == 8) {
-        decimalDigitChunks.add("00000000");
-      } else {
-        if (zeros >= 4) {
-          zeros -= 4;
-          decimalDigitChunks.add("0000");
-        }
-        if (zeros >= 2) {
-          zeros -= 2;
-          decimalDigitChunks.add("00");
-        }
-        if (zeros >= 1) {
-          decimalDigitChunks.add("0");
-        }
-      }
-      rest = rest ~/ _oneBillion;
-    }
-    decimalDigitChunks.add(rest._digits[0].toString());
-    if (_isNegative) decimalDigitChunks.add("-");
-    return decimalDigitChunks.reversed.join();
-  }
-
-  int _toRadixCodeUnit(int digit) {
-    const int _0 = 48;
-    const int _a = 97;
-    if (digit < 10) return _0 + digit;
-    return _a + digit - 10;
-  }
-
-  /**
-   * Converts [this] to a string representation in the given [radix].
-   *
-   * In the string representation, lower-case letters are used for digits above
-   * '9', with 'a' being 10 an 'z' being 35.
-   *
-   * The [radix] argument must be an integer in the range 2 to 36.
-   */
-  String toRadixString(int radix) {
-    if (radix > 36) throw new RangeError.range(radix, 2, 36);
-
-    if (_used == 0) return "0";
-
-    if (_used == 1) {
-      var digitString = _digits[0].toRadixString(radix);
-      if (_isNegative) return "-" + digitString;
-      return digitString;
-    }
-
-    if (radix == 16) return _toHexString();
-
-    var base = new _BigIntImpl._fromInt(radix);
-    var reversedDigitCodeUnits = <int>[];
-    var rest = this.abs();
-    while (!rest._isZero) {
-      var digit = rest.remainder(base).toInt();
-      rest = rest ~/ base;
-      reversedDigitCodeUnits.add(_toRadixCodeUnit(digit));
-    }
-    var digitString = new String.fromCharCodes(reversedDigitCodeUnits.reversed);
-    if (_isNegative) return "-" + digitString;
-    return digitString;
-  }
-
-  String _toHexString() {
-    var chars = <int>[];
-    for (int i = 0; i < _used - 1; i++) {
-      int chunk = _digits[i];
-      for (int j = 0; j < (_digitBits ~/ 4); j++) {
-        chars.add(_toRadixCodeUnit(chunk & 0xF));
-        chunk >>= 4;
-      }
-    }
-    var msbChunk = _digits[_used - 1];
-    while (msbChunk != 0) {
-      chars.add(_toRadixCodeUnit(msbChunk & 0xF));
-      msbChunk >>= 4;
-    }
-    if (_isNegative) {
-      const _dash = 45;
-      chars.add(_dash);
-    }
-    return new String.fromCharCodes(chars.reversed);
-  }
-
-  static _BigIntImpl _ensureSystemBigInt(BigInt bigInt, String parameterName) {
-    if (bigInt is _BigIntImpl) return bigInt;
-    throw ArgumentError.value(
-        bigInt, parameterName, "Must be a platform BigInt");
-  }
-}
-
-// Interface for modular reduction.
-abstract class _BigIntReduction {
-  int get _normModulusUsed;
-  // Return the number of digits used by resultDigits.
-  int _convert(_BigIntImpl x, Uint32List resultDigits);
-  int _mul(Uint32List xDigits, int xUsed, Uint32List yDigits, int yUsed,
-      Uint32List resultDigits);
-  int _sqr(Uint32List xDigits, int xUsed, Uint32List resultDigits);
-
-  // Return x reverted to _BigIntImpl.
-  _BigIntImpl _revert(Uint32List xDigits, int xUsed);
-}
-
-// Montgomery reduction on _BigIntImpl.
-class _BigIntMontgomeryReduction implements _BigIntReduction {
-  final _BigIntImpl _modulus;
-  final int _normModulusUsed; // Even if processing 64-bit (digit pairs).
-  final Uint32List _modulusDigits;
-  final Uint32List _args;
-  final int _digitsPerStep; // Number of digits processed in one step. 1 or 2.
-  static const int _xDigit = 0; // Index of digit of x.
-  static const int _xHighDigit = 1; // Index of high digit of x (64-bit only).
-  static const int _rhoDigit = 2; // Index of digit of rho.
-  static const int _rhoHighDigit = 3; // Index of high digit of rho (64-bit).
-  static const int _muDigit = 4; // Index of mu.
-  static const int _muHighDigit = 5; // Index of high 32-bits of mu (64-bit).
-
-  factory _BigIntMontgomeryReduction(_BigIntImpl modulus) {
-    final Uint32List modulusDigits = modulus._digits;
-    final Uint32List args = _newDigits(6);
-
-    // Determine if we can process digit pairs by calling an intrinsic.
-    final int digitsPerStep = _mulMod(args, args, 0);
-    args[_xDigit] = modulusDigits[0];
-
-    int normModulusUsed = modulus._used;
-    if (digitsPerStep == 1) {
-      _invDigit(args);
-    } else {
-      assert(digitsPerStep == 2);
-      normModulusUsed += modulus._used & 1;
-      args[_xHighDigit] = modulusDigits[1];
-      _invDigitPair(args);
-    }
-    return _BigIntMontgomeryReduction._(
-        modulus, normModulusUsed, modulusDigits, args, digitsPerStep);
-  }
-
-  _BigIntMontgomeryReduction._(this._modulus, this._normModulusUsed,
-      this._modulusDigits, this._args, this._digitsPerStep);
-
-  // Calculates -1/x % _digitBase, x is 32-bit digit.
-  //         xy == 1 (mod m)
-  //         xy =  1+km
-  //   xy(2-xy) = (1+km)(1-km)
-  // x(y(2-xy)) = 1-k^2 m^2
-  // x(y(2-xy)) == 1 (mod m^2)
-  // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
-  // Should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
-  //
-  // Operation:
-  //   args[_rhoDigit] = 1/args[_xDigit] mod _digitBase.
-  static void _invDigit(Uint32List args) {
-    var x = args[_xDigit];
-    var y = x & 3; // y == 1/x mod 2^2
-    y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
-    y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
-    y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16
-    y = (y * (2 - x * y % _BigIntImpl._digitBase)) % _BigIntImpl._digitBase;
-    // y == 1/x mod _digitBase
-    y = -y; // We really want the negative inverse.
-    args[_rhoDigit] = y & _BigIntImpl._digitMask;
-    assert(((x * y) & _BigIntImpl._digitMask) == _BigIntImpl._digitMask);
-  }
-
-  // Calculates -1/x % _digitBase^2, x is a pair of 32-bit digits.
-  // Operation:
-  //   args[_rhoDigit.._rhoHighDigit] =
-  //     1/args[_xDigit.._xHighDigit] mod _digitBase^2.
-  static void _invDigitPair(Uint32List args) {
-    var xl = args[_xDigit]; // Lower 32-bit digit of x.
-    var y = xl & 3; // y == 1/x mod 2^2
-    y = (y * (2 - (xl & 0xf) * y)) & 0xf; // y == 1/x mod 2^4
-    y = (y * (2 - (xl & 0xff) * y)) & 0xff; // y == 1/x mod 2^8
-    y = (y * (2 - (((xl & 0xffff) * y) & 0xffff))) & 0xffff;
-    // y == 1/x mod 2^16
-    y = (y * (2 - ((xl * y) & 0xffffffff))) & 0xffffffff; // y == 1/x mod 2^32
-    var x = (args[_xHighDigit] << _BigIntImpl._digitBits) | xl;
-    y *= 2 - x * y; // Masking with 2^64-1 is implied by 64-bit arithmetic.
-    // y == 1/x mod _digitBase^2
-    y = -y; // We really want the negative inverse.
-    args[_rhoDigit] = y & _BigIntImpl._digitMask;
-    args[_rhoHighDigit] =
-        (y >> _BigIntImpl._digitBits) & _BigIntImpl._digitMask;
-    assert(x * y == -1);
-  }
-
-  // Operation:
-  //   args[_muDigit] = args[_rhoDigit]*digits[i] mod _digitBase.
-  //   Returns 1.
-  // Note: Intrinsics on 64-bit platforms process digit pairs at even indices:
-  //   args[_muDigit.._muHighDigit] =
-  //     args[_rhoDigit.._rhoHighDigit] * digits[i..i+1] mod _digitBase^2.
-  //   Returns 2.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:never-inline")
-  static int _mulMod(Uint32List args, Uint32List digits, int i) {
-    var rhol = args[_rhoDigit] & _BigIntImpl._halfDigitMask;
-    var rhoh = args[_rhoDigit] >> _BigIntImpl._halfDigitBits;
-    var dh = digits[i] >> _BigIntImpl._halfDigitBits;
-    var dl = digits[i] & _BigIntImpl._halfDigitMask;
-    args[_muDigit] = (dl * rhol +
-            (((dl * rhoh + dh * rhol) & _BigIntImpl._halfDigitMask) <<
-                _BigIntImpl._halfDigitBits)) &
-        _BigIntImpl._digitMask;
-    return _BigIntImpl._isIntrinsified ? 2 : 1;
-  }
-
-  // result = x*R mod _modulus.
-  // Returns resultUsed.
-  int _convert(_BigIntImpl x, Uint32List resultDigits) {
-    // Montgomery reduction only works if abs(x) < _modulus.
-    assert(x.abs() < _modulus);
-    assert(_digitsPerStep == 1 || _normModulusUsed.isEven);
-    var result = x.abs()._dlShift(_normModulusUsed)._rem(_modulus);
-    if (x._isNegative && !result._isNegative && result._used > 0) {
-      result = _modulus - result;
-    }
-    var used = result._used;
-    var digits = result._digits;
-    var i = used + (used & 1);
-    while (--i >= 0) {
-      resultDigits[i] = digits[i];
-    }
-    return used;
-  }
-
-  _BigIntImpl _revert(Uint32List xDigits, int xUsed) {
-    // Reserve enough digits for modulus squaring and accumulator carry.
-    var resultDigits = _newDigits(2 * _normModulusUsed + 2);
-    var i = xUsed + (xUsed & 1);
-    while (--i >= 0) {
-      resultDigits[i] = xDigits[i];
-    }
-    var resultUsed = _reduce(resultDigits, xUsed);
-    return new _BigIntImpl._(false, resultUsed, resultDigits);
-  }
-
-  // x = x/R mod _modulus.
-  // Returns xUsed.
-  int _reduce(Uint32List xDigits, int xUsed) {
-    while (xUsed < 2 * _normModulusUsed + 2) {
-      // Pad x so _mulAdd has enough room later for a possible carry.
-      xDigits[xUsed++] = 0;
-    }
-    var i = 0;
-    while (i < _normModulusUsed) {
-      var d = _mulMod(_args, xDigits, i);
-      assert(d == _digitsPerStep);
-      d = _BigIntImpl._mulAdd(
-          _args, _muDigit, _modulusDigits, 0, xDigits, i, _normModulusUsed);
-      assert(d == _digitsPerStep);
-      i += d;
-    }
-    // Clamp x.
-    while (xUsed > 0 && xDigits[xUsed - 1] == 0) {
-      --xUsed;
-    }
-    xUsed = _BigIntImpl._drShiftDigits(xDigits, xUsed, i, xDigits);
-    if (_BigIntImpl._compareDigits(
-            xDigits, xUsed, _modulusDigits, _normModulusUsed) >=
-        0) {
-      _BigIntImpl._absSub(
-          xDigits, xUsed, _modulusDigits, _normModulusUsed, xDigits);
-    }
-    // Clamp x.
-    while (xUsed > 0 && xDigits[xUsed - 1] == 0) {
-      --xUsed;
-    }
-    return xUsed;
-  }
-
-  int _sqr(Uint32List xDigits, int xUsed, Uint32List resultDigits) {
-    var resultUsed = _BigIntImpl._sqrDigits(xDigits, xUsed, resultDigits);
-    return _reduce(resultDigits, resultUsed);
-  }
-
-  int _mul(Uint32List xDigits, int xUsed, Uint32List yDigits, int yUsed,
-      Uint32List resultDigits) {
-    var resultUsed =
-        _BigIntImpl._mulDigits(xDigits, xUsed, yDigits, yUsed, resultDigits);
-    return _reduce(resultDigits, resultUsed);
-  }
-}
-
-// Modular reduction using "classic" algorithm.
-class _BigIntClassicReduction implements _BigIntReduction {
-  final _BigIntImpl _modulus; // Modulus.
-  int _normModulusUsed;
-  _BigIntImpl _normModulus; // Normalized _modulus.
-  Uint32List _normModulusDigits;
-  Uint32List _negNormModulusDigits; // Negated _normModulus digits.
-  int _modulusNsh; // Normalization shift amount.
-  Uint32List _args; // Top _normModulus digit(s) and place holder for estimated
-  // quotient digit(s).
-  Uint32List _tmpDigits; // Temporary digits used during reduction.
-
-  factory _BigIntClassicReduction(_BigIntImpl modulus) {
-    // Preprocess arguments to _remDigits.
-    int nsh =
-        _BigIntImpl._digitBits - modulus._digits[modulus._used - 1].bitLength;
-    // For 64-bit processing, make sure _negNormModulusDigits has an even number
-    // of digits.
-    if (modulus._used.isOdd) {
-      nsh += _BigIntImpl._digitBits;
-    }
-    final _BigIntImpl normModulus = modulus << nsh;
-    final int normModulusUsed = normModulus._used;
-    final Uint32List normModulusDigits = normModulus._digits;
-    assert(normModulusUsed.isEven);
-
-    final Uint32List args = _newDigits(4);
-    args[_BigIntImpl._divisorLowTopDigit] =
-        normModulusDigits[normModulusUsed - 2];
-    args[_BigIntImpl._divisorTopDigit] = normModulusDigits[normModulusUsed - 1];
-    // Negate normModulus so we can use _mulAdd instead of
-    // unimplemented  _mulSub.
-    final _BigIntImpl negNormModulus =
-        _BigIntImpl.one._dlShift(normModulusUsed) - normModulus;
-    late Uint32List negNormModulusDigits;
-    if (negNormModulus._used < normModulusUsed) {
-      negNormModulusDigits = _BigIntImpl._cloneDigits(
-          negNormModulus._digits, 0, normModulusUsed, normModulusUsed);
-    } else {
-      negNormModulusDigits = negNormModulus._digits;
-    }
-    // negNormModulusDigits is read-only and has normModulusUsed digits (possibly
-    // including several leading zeros) plus a leading zero for 64-bit
-    // processing.
-    final Uint32List tmpDigits = _newDigits(2 * normModulusUsed);
-
-    return _BigIntClassicReduction._(modulus, normModulusUsed, normModulus,
-        normModulusDigits, negNormModulusDigits, nsh, args, tmpDigits);
-  }
-
-  _BigIntClassicReduction._(
-      this._modulus,
-      this._normModulusUsed,
-      this._normModulus,
-      this._normModulusDigits,
-      this._negNormModulusDigits,
-      this._modulusNsh,
-      this._args,
-      this._tmpDigits);
-
-  int _convert(_BigIntImpl x, Uint32List resultDigits) {
-    var digits;
-    var used;
-    if (x._isNegative || x._absCompare(_modulus) >= 0) {
-      var remainder = x._rem(_modulus);
-      if (x._isNegative && remainder._used > 0) {
-        assert(remainder._isNegative);
-        remainder += _modulus;
-      }
-      assert(!remainder._isNegative);
-      used = remainder._used;
-      digits = remainder._digits;
-    } else {
-      used = x._used;
-      digits = x._digits;
-    }
-    var i = used + (used & 1); // Copy leading zero if any.
-    while (--i >= 0) {
-      resultDigits[i] = digits[i];
-    }
-    return used;
-  }
-
-  _BigIntImpl _revert(Uint32List xDigits, int xUsed) {
-    return new _BigIntImpl._(false, xUsed, xDigits);
-  }
-
-  int _reduce(Uint32List xDigits, int xUsed) {
-    if (xUsed < _modulus._used) {
-      return xUsed;
-    }
-    // The function _BigIntImpl._remDigits(...) is optimized for reduction and
-    // equivalent to calling
-    // 'convert(revert(xDigits, xUsed)._rem(_normModulus), xDigits);'
-    return _BigIntImpl._remDigits(
-        xDigits,
-        xUsed,
-        _normModulusDigits,
-        _normModulusUsed,
-        _negNormModulusDigits,
-        _modulusNsh,
-        _args,
-        _tmpDigits,
-        xDigits);
-  }
-
-  int _sqr(Uint32List xDigits, int xUsed, Uint32List resultDigits) {
-    var resultUsed = _BigIntImpl._sqrDigits(xDigits, xUsed, resultDigits);
-    return _reduce(resultDigits, resultUsed);
-  }
-
-  int _mul(Uint32List xDigits, int xUsed, Uint32List yDigits, int yUsed,
-      Uint32List resultDigits) {
-    var resultUsed =
-        _BigIntImpl._mulDigits(xDigits, xUsed, yDigits, yUsed, resultDigits);
-    return _reduce(resultDigits, resultUsed);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/bool_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/bool_patch.dart
deleted file mode 100644
index d627d46..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/bool_patch.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-@pragma("vm:entry-point")
-class bool {
-  @patch
-  const factory bool.fromEnvironment(String name, {bool defaultValue: false})
-      native "Bool_fromEnvironment";
-
-  @patch
-  const factory bool.hasEnvironment(String name) native "Bool_hasEnvironment";
-
-  @patch
-  int get hashCode => this ? 1231 : 1237;
-
-  int get _identityHashCode => this ? 1231 : 1237;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/class_id.dart b/sdk_nnbd/lib/_internal/vm/lib/class_id.dart
deleted file mode 100644
index ff9d0b6..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/class_id.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2014, 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.
-
-// part of "internal_patch.dart";
-
-@pragma("vm:entry-point")
-class ClassID {
-  @pragma("vm:entry-point")
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  static int getID(Object value) native "ClassID_getID";
-
-  // VM injects class id constants into this class.
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/class_id_fasta.dart b/sdk_nnbd/lib/_internal/vm/lib/class_id_fasta.dart
deleted file mode 100644
index c81bd60..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/class_id_fasta.dart
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2017, 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.
-
-// part of "internal_patch.dart";
-
-@pragma("vm:entry-point")
-class ClassID {
-  @pragma("vm:entry-point", "call")
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  static int getID(Object value) native "ClassID_getID";
-
-  @pragma("vm:entry-point")
-  static final int cidArray = 0;
-  @pragma("vm:entry-point")
-  static final int cidExternalOneByteString = 0;
-  @pragma("vm:entry-point")
-  static final int cidGrowableObjectArray = 0;
-  @pragma("vm:entry-point")
-  static final int cidImmutableArray = 0;
-  @pragma("vm:entry-point")
-  static final int cidOneByteString = 0;
-  @pragma("vm:entry-point")
-  static final int cidTwoByteString = 0;
-  @pragma("vm:entry-point")
-  static final int cidUint8ArrayView = 0;
-  @pragma("vm:entry-point")
-  static final int cidUint8Array = 0;
-  @pragma("vm:entry-point")
-  static final int cidInt8ArrayView = 0;
-  @pragma("vm:entry-point")
-  static final int cidInt8Array = 0;
-  @pragma("vm:entry-point")
-  static final int cidExternalUint8Array = 0;
-  @pragma("vm:entry-point")
-  static final int cidExternalInt8Array = 0;
-  @pragma("vm:entry-point")
-  static final int cidUint8ClampedArray = 0;
-  @pragma("vm:entry-point")
-  static final int cidExternalUint8ClampedArray = 0;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/collection_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/collection_patch.dart
deleted file mode 100644
index 1307fb7..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/collection_patch.dart
+++ /dev/null
@@ -1,921 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:collection" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal" as internal;
-
-import "dart:_internal" show patch, IterableElementError;
-
-import "dart:typed_data" show Uint32List;
-
-class _TypeTest<T> {
-  bool test(v) => v is T;
-}
-
-/// These are the additional parts of this patch library:
-// part "compact_hash.dart";
-
-@patch
-class HashMap<K, V> {
-  @patch
-  factory HashMap(
-      {bool equals(K key1, K key2)?,
-      int hashCode(K key)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _HashMap<K, V>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _IdentityHashMap<K, V>();
-        }
-        equals ??= _defaultEquals;
-      }
-    } else {
-      hashCode ??= _defaultHashCode;
-      equals ??= _defaultEquals;
-    }
-    return new _CustomHashMap<K, V>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory HashMap.identity() => new _IdentityHashMap<K, V>();
-
-  Set<K> _newKeySet();
-}
-
-const int _MODIFICATION_COUNT_MASK = 0x3fffffff;
-
-class _HashMap<K, V> extends MapBase<K, V> implements HashMap<K, V> {
-  static const int _INITIAL_CAPACITY = 8;
-
-  int _elementCount = 0;
-  var _buckets = List<_HashMapEntry<K, V>?>.filled(_INITIAL_CAPACITY, null);
-  int _modificationCount = 0;
-
-  int get length => _elementCount;
-  bool get isEmpty => _elementCount == 0;
-  bool get isNotEmpty => _elementCount != 0;
-
-  Iterable<K> get keys => new _HashMapKeyIterable<K, V>(this);
-  Iterable<V> get values => new _HashMapValueIterable<K, V>(this);
-
-  bool containsKey(Object? key) {
-    final hashCode = key.hashCode;
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && entry.key == key) return true;
-      entry = entry.next;
-    }
-    return false;
-  }
-
-  bool containsValue(Object? value) {
-    final buckets = _buckets;
-    final length = buckets.length;
-    for (int i = 0; i < length; i++) {
-      var entry = buckets[i];
-      while (entry != null) {
-        if (entry.value == value) return true;
-        entry = entry.next;
-      }
-    }
-    return false;
-  }
-
-  V? operator [](Object? key) {
-    final hashCode = key.hashCode;
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && entry.key == key) {
-        return entry.value;
-      }
-      entry = entry.next;
-    }
-    return null;
-  }
-
-  void operator []=(K key, V value) {
-    final hashCode = key.hashCode;
-    final buckets = _buckets;
-    final length = buckets.length;
-    final index = hashCode & (length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && entry.key == key) {
-        entry.value = value;
-        return;
-      }
-      entry = entry.next;
-    }
-    _addEntry(buckets, index, length, key, value, hashCode);
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    final hashCode = key.hashCode;
-    final buckets = _buckets;
-    final length = buckets.length;
-    final index = hashCode & (length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && entry.key == key) {
-        return entry.value;
-      }
-      entry = entry.next;
-    }
-    final stamp = _modificationCount;
-    final V value = ifAbsent();
-    if (stamp == _modificationCount) {
-      _addEntry(buckets, index, length, key, value, hashCode);
-    } else {
-      this[key] = value;
-    }
-    return value;
-  }
-
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      this[key] = value;
-    });
-  }
-
-  void forEach(void action(K key, V value)) {
-    final stamp = _modificationCount;
-    final buckets = _buckets;
-    final length = buckets.length;
-    for (int i = 0; i < length; i++) {
-      var entry = buckets[i];
-      while (entry != null) {
-        action(entry.key, entry.value);
-        if (stamp != _modificationCount) {
-          throw new ConcurrentModificationError(this);
-        }
-        entry = entry.next;
-      }
-    }
-  }
-
-  V? remove(Object? key) {
-    final hashCode = key.hashCode;
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    _HashMapEntry<K, V>? previous = null;
-    while (entry != null) {
-      final next = entry.next;
-      if (hashCode == entry.hashCode && entry.key == key) {
-        _removeEntry(entry, previous, index);
-        _elementCount--;
-        _modificationCount =
-            (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-        return entry.value;
-      }
-      previous = entry;
-      entry = next;
-    }
-    return null;
-  }
-
-  void clear() {
-    _buckets = new List.filled(_INITIAL_CAPACITY, null);
-    if (_elementCount > 0) {
-      _elementCount = 0;
-      _modificationCount = (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-    }
-  }
-
-  void _removeEntry(_HashMapEntry<K, V> entry,
-      _HashMapEntry<K, V>? previousInBucket, int bucketIndex) {
-    if (previousInBucket == null) {
-      _buckets[bucketIndex] = entry.next;
-    } else {
-      previousInBucket.next = entry.next;
-    }
-  }
-
-  void _addEntry(List<_HashMapEntry<K, V>?> buckets, int index, int length,
-      K key, V value, int hashCode) {
-    final entry = new _HashMapEntry<K, V>(key, value, hashCode, buckets[index]);
-    buckets[index] = entry;
-    final newElements = _elementCount + 1;
-    _elementCount = newElements;
-    // If we end up with more than 75% non-empty entries, we
-    // resize the backing store.
-    if ((newElements << 2) > ((length << 1) + length)) _resize();
-    _modificationCount = (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-  }
-
-  void _resize() {
-    final oldBuckets = _buckets;
-    final oldLength = oldBuckets.length;
-    final newLength = oldLength << 1;
-    final newBuckets = new List<_HashMapEntry<K, V>?>.filled(newLength, null);
-    for (int i = 0; i < oldLength; i++) {
-      var entry = oldBuckets[i];
-      while (entry != null) {
-        final next = entry.next;
-        final hashCode = entry.hashCode;
-        final index = hashCode & (newLength - 1);
-        entry.next = newBuckets[index];
-        newBuckets[index] = entry;
-        entry = next;
-      }
-    }
-    _buckets = newBuckets;
-  }
-
-  Set<K> _newKeySet() => new _HashSet<K>();
-}
-
-class _CustomHashMap<K, V> extends _HashMap<K, V> {
-  final _Equality<K> _equals;
-  final _Hasher<K> _hashCode;
-  final _Predicate _validKey;
-  _CustomHashMap(this._equals, this._hashCode, _Predicate? validKey)
-      : _validKey = (validKey != null) ? validKey : new _TypeTest<K>().test;
-
-  bool containsKey(Object? key) {
-    if (!_validKey(key)) return false;
-    K lkey = key as K;
-    final hashCode = _hashCode(lkey);
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && _equals(entry.key, lkey)) return true;
-      entry = entry.next;
-    }
-    return false;
-  }
-
-  V? operator [](Object? key) {
-    if (!_validKey(key)) return null;
-    K lkey = key as K;
-    final hashCode = _hashCode(lkey);
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && _equals(entry.key, lkey)) {
-        return entry.value;
-      }
-      entry = entry.next;
-    }
-    return null;
-  }
-
-  void operator []=(K key, V value) {
-    final hashCode = _hashCode(key);
-    final buckets = _buckets;
-    final length = buckets.length;
-    final index = hashCode & (length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && _equals(entry.key, key)) {
-        entry.value = value;
-        return;
-      }
-      entry = entry.next;
-    }
-    _addEntry(buckets, index, length, key, value, hashCode);
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    final hashCode = _hashCode(key);
-    final buckets = _buckets;
-    final length = buckets.length;
-    final index = hashCode & (length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && _equals(entry.key, key)) {
-        return entry.value;
-      }
-      entry = entry.next;
-    }
-    int stamp = _modificationCount;
-    V value = ifAbsent();
-    if (stamp == _modificationCount) {
-      _addEntry(buckets, index, length, key, value, hashCode);
-    } else {
-      this[key] = value;
-    }
-    return value;
-  }
-
-  V? remove(Object? key) {
-    if (!_validKey(key)) return null;
-    K lkey = key as K;
-    final hashCode = _hashCode(lkey);
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    _HashMapEntry<K, V>? previous = null;
-    while (entry != null) {
-      final next = entry.next;
-      if (hashCode == entry.hashCode && _equals(entry.key, lkey)) {
-        _removeEntry(entry, previous, index);
-        _elementCount--;
-        _modificationCount =
-            (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-        return entry.value;
-      }
-      previous = entry;
-      entry = next;
-    }
-    return null;
-  }
-
-  Set<K> _newKeySet() => new _CustomHashSet<K>(_equals, _hashCode, _validKey);
-}
-
-class _IdentityHashMap<K, V> extends _HashMap<K, V> {
-  bool containsKey(Object? key) {
-    final hashCode = identityHashCode(key);
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && identical(entry.key, key)) return true;
-      entry = entry.next;
-    }
-    return false;
-  }
-
-  V? operator [](Object? key) {
-    final hashCode = identityHashCode(key);
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && identical(entry.key, key)) {
-        return entry.value;
-      }
-      entry = entry.next;
-    }
-    return null;
-  }
-
-  void operator []=(K key, V value) {
-    final hashCode = identityHashCode(key);
-    final buckets = _buckets;
-    final length = buckets.length;
-    final index = hashCode & (length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && identical(entry.key, key)) {
-        entry.value = value;
-        return;
-      }
-      entry = entry.next;
-    }
-    _addEntry(buckets, index, length, key, value, hashCode);
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    final hashCode = identityHashCode(key);
-    final buckets = _buckets;
-    final length = buckets.length;
-    final index = hashCode & (length - 1);
-    var entry = buckets[index];
-    while (entry != null) {
-      if (hashCode == entry.hashCode && identical(entry.key, key)) {
-        return entry.value;
-      }
-      entry = entry.next;
-    }
-    final stamp = _modificationCount;
-    V value = ifAbsent();
-    if (stamp == _modificationCount) {
-      _addEntry(buckets, index, length, key, value, hashCode);
-    } else {
-      this[key] = value;
-    }
-    return value;
-  }
-
-  V? remove(Object? key) {
-    final hashCode = identityHashCode(key);
-    final buckets = _buckets;
-    final index = hashCode & (buckets.length - 1);
-    var entry = buckets[index];
-    _HashMapEntry<K, V>? previous = null;
-    while (entry != null) {
-      final next = entry.next;
-      if (hashCode == entry.hashCode && identical(entry.key, key)) {
-        _removeEntry(entry, previous, index);
-        _elementCount--;
-        _modificationCount =
-            (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-        return entry.value;
-      }
-      previous = entry;
-      entry = next;
-    }
-    return null;
-  }
-
-  Set<K> _newKeySet() => new _IdentityHashSet<K>();
-}
-
-class _HashMapEntry<K, V> {
-  final K key;
-  V value;
-  final int hashCode;
-  _HashMapEntry<K, V>? next;
-  _HashMapEntry(this.key, this.value, this.hashCode, this.next);
-}
-
-abstract class _HashMapIterable<K, V, E>
-    extends internal.EfficientLengthIterable<E> {
-  final _HashMap<K, V> _map;
-  _HashMapIterable(this._map);
-  int get length => _map.length;
-  bool get isEmpty => _map.isEmpty;
-  bool get isNotEmpty => _map.isNotEmpty;
-}
-
-class _HashMapKeyIterable<K, V> extends _HashMapIterable<K, V, K> {
-  _HashMapKeyIterable(_HashMap<K, V> map) : super(map);
-  Iterator<K> get iterator => new _HashMapKeyIterator<K, V>(_map);
-  bool contains(Object? key) => _map.containsKey(key);
-  void forEach(void action(K key)) {
-    _map.forEach((K key, _) {
-      action(key);
-    });
-  }
-
-  Set<K> toSet() => _map._newKeySet()..addAll(this);
-}
-
-class _HashMapValueIterable<K, V> extends _HashMapIterable<K, V, V> {
-  _HashMapValueIterable(_HashMap<K, V> map) : super(map);
-  Iterator<V> get iterator => new _HashMapValueIterator<K, V>(_map);
-  bool contains(Object? value) => _map.containsValue(value);
-  void forEach(void action(V value)) {
-    _map.forEach((_, V value) {
-      action(value);
-    });
-  }
-}
-
-abstract class _HashMapIterator<K, V, E> implements Iterator<E> {
-  final _HashMap<K, V> _map;
-  final int _stamp;
-
-  int _index = 0;
-  _HashMapEntry<K, V>? _entry;
-
-  _HashMapIterator(this._map) : _stamp = _map._modificationCount;
-
-  bool moveNext() {
-    if (_stamp != _map._modificationCount) {
-      throw new ConcurrentModificationError(_map);
-    }
-    var entry = _entry;
-    if (entry != null) {
-      final next = entry.next;
-      if (next != null) {
-        _entry = next;
-        return true;
-      }
-      _entry = null;
-    }
-    final buckets = _map._buckets;
-    final length = buckets.length;
-    for (int i = _index; i < length; i++) {
-      entry = buckets[i];
-      if (entry != null) {
-        _index = i + 1;
-        _entry = entry;
-        return true;
-      }
-    }
-    _index = length;
-    return false;
-  }
-}
-
-class _HashMapKeyIterator<K, V> extends _HashMapIterator<K, V, K> {
-  _HashMapKeyIterator(_HashMap<K, V> map) : super(map);
-  K get current => _entry!.key;
-}
-
-class _HashMapValueIterator<K, V> extends _HashMapIterator<K, V, V> {
-  _HashMapValueIterator(_HashMap<K, V> map) : super(map);
-  V get current => _entry!.value;
-}
-
-@patch
-class HashSet<E> {
-  @patch
-  factory HashSet(
-      {bool equals(E e1, E e2)?,
-      int hashCode(E e)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _HashSet<E>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _IdentityHashSet<E>();
-        }
-        equals ??= _defaultEquals;
-      }
-    } else {
-      hashCode ??= _defaultHashCode;
-      equals ??= _defaultEquals;
-    }
-    return new _CustomHashSet<E>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory HashSet.identity() => new _IdentityHashSet<E>();
-}
-
-class _HashSet<E> extends _SetBase<E> implements HashSet<E> {
-  static const int _INITIAL_CAPACITY = 8;
-
-  var _buckets = List<_HashSetEntry<E>?>.filled(_INITIAL_CAPACITY, null);
-  int _elementCount = 0;
-  int _modificationCount = 0;
-
-  bool _equals(Object? e1, Object? e2) => e1 == e2;
-  int _hashCode(Object? e) => e.hashCode;
-
-  static Set<R> _newEmpty<R>() => new _HashSet<R>();
-
-  // Iterable.
-
-  Iterator<E> get iterator => new _HashSetIterator<E>(this);
-
-  int get length => _elementCount;
-
-  bool get isEmpty => _elementCount == 0;
-
-  bool get isNotEmpty => _elementCount != 0;
-
-  bool contains(Object? object) {
-    int index = _hashCode(object) & (_buckets.length - 1);
-    var entry = _buckets[index];
-    while (entry != null) {
-      if (_equals(entry.key, object)) return true;
-      entry = entry.next;
-    }
-    return false;
-  }
-
-  E? lookup(Object? object) {
-    int index = _hashCode(object) & (_buckets.length - 1);
-    var entry = _buckets[index];
-    while (entry != null) {
-      var key = entry.key;
-      if (_equals(key, object)) return key;
-      entry = entry.next;
-    }
-    return null;
-  }
-
-  E get first {
-    for (int i = 0; i < _buckets.length; i++) {
-      var entry = _buckets[i];
-      if (entry != null) {
-        return entry.key;
-      }
-    }
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    for (int i = _buckets.length - 1; i >= 0; i--) {
-      var entry = _buckets[i];
-      if (entry != null) {
-        var nextEntry = entry.next;
-        while (nextEntry != null) {
-          entry = nextEntry;
-          nextEntry = nextEntry.next;
-        }
-        return entry!.key;
-      }
-    }
-    throw IterableElementError.noElement();
-  }
-
-  // Set.
-
-  bool add(E element) {
-    final hashCode = _hashCode(element);
-    final index = hashCode & (_buckets.length - 1);
-    var entry = _buckets[index];
-    while (entry != null) {
-      if (_equals(entry.key, element)) return false;
-      entry = entry.next;
-    }
-    _addEntry(element, hashCode, index);
-    return true;
-  }
-
-  void addAll(Iterable<E> objects) {
-    for (E object in objects) {
-      add(object);
-    }
-  }
-
-  bool _remove(Object? object, int hashCode) {
-    final index = hashCode & (_buckets.length - 1);
-    var entry = _buckets[index];
-    _HashSetEntry<E>? previous = null;
-    while (entry != null) {
-      if (_equals(entry.key, object)) {
-        final next = entry.remove();
-        if (previous == null) {
-          _buckets[index] = next;
-        } else {
-          previous.next = next;
-        }
-        _elementCount--;
-        _modificationCount =
-            (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-        return true;
-      }
-      previous = entry;
-      entry = entry.next;
-    }
-    return false;
-  }
-
-  bool remove(Object? object) => _remove(object, _hashCode(object));
-
-  void removeAll(Iterable<Object?> objectsToRemove) {
-    for (Object? object in objectsToRemove) {
-      _remove(object, _hashCode(object));
-    }
-  }
-
-  void _filterWhere(bool test(E element), bool removeMatching) {
-    int length = _buckets.length;
-    for (int index = 0; index < length; index++) {
-      var entry = _buckets[index];
-      _HashSetEntry<E>? previous = null;
-      while (entry != null) {
-        int modificationCount = _modificationCount;
-        bool testResult = test(entry.key);
-        if (modificationCount != _modificationCount) {
-          throw new ConcurrentModificationError(this);
-        }
-        if (testResult == removeMatching) {
-          final next = entry.remove();
-          if (previous == null) {
-            _buckets[index] = next;
-          } else {
-            previous.next = next;
-          }
-          _elementCount--;
-          _modificationCount =
-              (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-          entry = next;
-        } else {
-          previous = entry;
-          entry = entry.next;
-        }
-      }
-    }
-  }
-
-  void removeWhere(bool test(E element)) {
-    _filterWhere(test, true);
-  }
-
-  void retainWhere(bool test(E element)) {
-    _filterWhere(test, false);
-  }
-
-  void clear() {
-    _buckets = List<_HashSetEntry<E>?>.filled(_INITIAL_CAPACITY, null);
-    if (_elementCount > 0) {
-      _elementCount = 0;
-      _modificationCount = (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-    }
-  }
-
-  void _addEntry(E key, int hashCode, int index) {
-    _buckets[index] = new _HashSetEntry<E>(key, hashCode, _buckets[index]);
-    int newElements = _elementCount + 1;
-    _elementCount = newElements;
-    int length = _buckets.length;
-    // If we end up with more than 75% non-empty entries, we
-    // resize the backing store.
-    if ((newElements << 2) > ((length << 1) + length)) _resize();
-    _modificationCount = (_modificationCount + 1) & _MODIFICATION_COUNT_MASK;
-  }
-
-  void _resize() {
-    final oldLength = _buckets.length;
-    final newLength = oldLength << 1;
-    final oldBuckets = _buckets;
-    final newBuckets = List<_HashSetEntry<E>?>.filled(newLength, null);
-    for (int i = 0; i < oldLength; i++) {
-      var entry = oldBuckets[i];
-      while (entry != null) {
-        final next = entry.next;
-        int newIndex = entry.hashCode & (newLength - 1);
-        entry.next = newBuckets[newIndex];
-        newBuckets[newIndex] = entry;
-        entry = next;
-      }
-    }
-    _buckets = newBuckets;
-  }
-
-  HashSet<E> _newSet() => new _HashSet<E>();
-  HashSet<R> _newSimilarSet<R>() => new _HashSet<R>();
-}
-
-class _IdentityHashSet<E> extends _HashSet<E> {
-  int _hashCode(Object? e) => identityHashCode(e);
-  bool _equals(Object? e1, Object? e2) => identical(e1, e2);
-
-  HashSet<E> _newSet() => new _IdentityHashSet<E>();
-  HashSet<R> _newSimilarSet<R>() => new _IdentityHashSet<R>();
-}
-
-class _CustomHashSet<E> extends _HashSet<E> {
-  final _Equality<E> _equality;
-  final _Hasher<E> _hasher;
-  final _Predicate _validKey;
-  _CustomHashSet(this._equality, this._hasher, _Predicate? validKey)
-      : _validKey = (validKey != null) ? validKey : new _TypeTest<E>().test;
-
-  bool remove(Object? element) {
-    if (!_validKey(element)) return false;
-    return super.remove(element);
-  }
-
-  bool contains(Object? element) {
-    if (!_validKey(element)) return false;
-    return super.contains(element);
-  }
-
-  E? lookup(Object? element) {
-    if (!_validKey(element)) return null;
-    return super.lookup(element);
-  }
-
-  bool containsAll(Iterable<Object?> elements) {
-    for (Object? element in elements) {
-      if (!_validKey(element) || !this.contains(element)) return false;
-    }
-    return true;
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    for (Object? element in elements) {
-      if (_validKey(element)) {
-        super._remove(element, _hashCode(element));
-      }
-    }
-  }
-
-  bool _equals(Object? e1, Object? e2) => _equality(e1 as E, e2 as E);
-  int _hashCode(Object? e) => _hasher(e as E);
-
-  HashSet<E> _newSet() => new _CustomHashSet<E>(_equality, _hasher, _validKey);
-  HashSet<R> _newSimilarSet<R>() => new _HashSet<R>();
-}
-
-class _HashSetEntry<E> {
-  final E key;
-  final int hashCode;
-  _HashSetEntry<E>? next;
-  _HashSetEntry(this.key, this.hashCode, this.next);
-
-  _HashSetEntry<E>? remove() {
-    final result = next;
-    next = null;
-    return result;
-  }
-}
-
-class _HashSetIterator<E> implements Iterator<E> {
-  final _HashSet<E> _set;
-  final int _modificationCount;
-  int _index = 0;
-  _HashSetEntry<E>? _next;
-  E? _current;
-
-  _HashSetIterator(this._set) : _modificationCount = _set._modificationCount;
-
-  bool moveNext() {
-    if (_modificationCount != _set._modificationCount) {
-      throw new ConcurrentModificationError(_set);
-    }
-    var localNext = _next;
-    if (localNext != null) {
-      _current = localNext.key;
-      _next = localNext.next;
-      return true;
-    }
-    final buckets = _set._buckets;
-    while (_index < buckets.length) {
-      localNext = buckets[_index];
-      _index = _index + 1;
-      if (localNext != null) {
-        _current = localNext.key;
-        _next = localNext.next;
-        return true;
-      }
-    }
-    _current = null;
-    return false;
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-}
-
-/**
- * A hash-based map that iterates keys and values in key insertion order.
- * This is never actually instantiated any more - the constructor always
- * returns an instance of _CompactLinkedHashMap or _InternalLinkedHashMap,
- * which despite the names do not use links (but are insertion-ordered as if
- * they did).
- */
-@patch
-class LinkedHashMap<K, V> {
-  @patch
-  factory LinkedHashMap(
-      {bool equals(K key1, K key2)?,
-      int hashCode(K key)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _InternalLinkedHashMap<K, V>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _CompactLinkedIdentityHashMap<K, V>();
-        }
-        equals ??= _defaultEquals;
-      }
-    } else {
-      hashCode ??= _defaultHashCode;
-      equals ??= _defaultEquals;
-    }
-    return new _CompactLinkedCustomHashMap<K, V>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory LinkedHashMap.identity() => new _CompactLinkedIdentityHashMap<K, V>();
-}
-
-@patch
-class LinkedHashSet<E> {
-  @patch
-  factory LinkedHashSet(
-      {bool equals(E e1, E e2)?,
-      int hashCode(E e)?,
-      bool isValidKey(potentialKey)?}) {
-    if (isValidKey == null) {
-      if (hashCode == null) {
-        if (equals == null) {
-          return new _CompactLinkedHashSet<E>();
-        }
-        hashCode = _defaultHashCode;
-      } else {
-        if (identical(identityHashCode, hashCode) &&
-            identical(identical, equals)) {
-          return new _CompactLinkedIdentityHashSet<E>();
-        }
-        equals ??= _defaultEquals;
-      }
-    } else {
-      hashCode ??= _defaultHashCode;
-      equals ??= _defaultEquals;
-    }
-    return new _CompactLinkedCustomHashSet<E>(equals, hashCode, isValidKey);
-  }
-
-  @patch
-  factory LinkedHashSet.identity() => new _CompactLinkedIdentityHashSet<E>();
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/compact_hash.dart b/sdk_nnbd/lib/_internal/vm/lib/compact_hash.dart
deleted file mode 100644
index 67ba9b2..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/compact_hash.dart
+++ /dev/null
@@ -1,668 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// part of "collection_patch.dart";
-
-// Hash table with open addressing that separates the index from keys/values.
-
-// This function takes care of rehashing of the linked hashmaps in [objects]. We
-// do this eagerly after snapshot deserialization.
-@pragma("vm:entry-point", "call")
-void _rehashObjects(List objects) {
-  final int length = objects.length;
-  for (int i = 0; i < length; ++i) {
-    objects[i]._regenerateIndex();
-  }
-}
-
-abstract class _HashFieldBase {
-  // Each occupied entry in _index is a fixed-size integer that encodes a pair:
-  //   [ hash pattern for key | index of entry in _data ]
-  // The hash pattern is based on hashCode, but is guaranteed to be non-zero.
-  // The length of _index is always a power of two, and there is always at
-  // least one unoccupied entry.
-  // NOTE: When maps are deserialized, their _index and _hashMask is regenerated
-  // eagerly by _regenerateIndex.
-  Uint32List _index = new Uint32List(_HashBase._INITIAL_INDEX_SIZE);
-
-  // Cached in-place mask for the hash pattern component.
-  int _hashMask = _HashBase._indexSizeToHashMask(_HashBase._INITIAL_INDEX_SIZE);
-
-  // Fixed-length list of keys (set) or key/value at even/odd indices (map).
-  List _data;
-
-  // Length of _data that is used (i.e., keys + values for a map).
-  int _usedData = 0;
-
-  // Number of deleted keys.
-  int _deletedKeys = 0;
-
-  // Note: All fields are initialized in a single constructor so that the VM
-  // recognizes they cannot hold null values. This makes a big (20%) performance
-  // difference on some operations.
-  _HashFieldBase(int dataSize) : this._data = new List.filled(dataSize, null);
-}
-
-// Base class for VM-internal classes; keep in sync with _HashFieldBase.
-abstract class _HashVMBase {
-  @pragma("vm:exact-result-type", "dart:typed_data#_Uint32List")
-  @pragma("vm:prefer-inline")
-  Uint32List get _index native "LinkedHashMap_getIndex";
-  @pragma("vm:prefer-inline")
-  void set _index(Uint32List value) native "LinkedHashMap_setIndex";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get _hashMask native "LinkedHashMap_getHashMask";
-  @pragma("vm:prefer-inline")
-  void set _hashMask(int value) native "LinkedHashMap_setHashMask";
-
-  @pragma("vm:exact-result-type", "dart:core#_List")
-  @pragma("vm:prefer-inline")
-  List get _data native "LinkedHashMap_getData";
-  @pragma("vm:prefer-inline")
-  void set _data(List value) native "LinkedHashMap_setData";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get _usedData native "LinkedHashMap_getUsedData";
-  @pragma("vm:prefer-inline")
-  void set _usedData(int value) native "LinkedHashMap_setUsedData";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get _deletedKeys native "LinkedHashMap_getDeletedKeys";
-  @pragma("vm:prefer-inline")
-  void set _deletedKeys(int value) native "LinkedHashMap_setDeletedKeys";
-}
-
-// This mixin can be applied to _HashFieldBase or _HashVMBase (for
-// normal and VM-internalized classes, respectiveley), which provide the
-// actual fields/accessors that this mixin assumes.
-// TODO(koda): Consider moving field comments to _HashFieldBase.
-abstract class _HashBase implements _HashVMBase {
-  // The number of bits used for each component is determined by table size.
-  // The length of _index is twice the number of entries in _data, and both
-  // are doubled when _data is full. Thus, _index will have a max load factor
-  // of 1/2, which enables one more bit to be used for the hash.
-  // TODO(koda): Consider growing _data by factor sqrt(2), twice as often.
-  static const int _INITIAL_INDEX_BITS = 3;
-  static const int _INITIAL_INDEX_SIZE = 1 << (_INITIAL_INDEX_BITS + 1);
-
-  // Unused and deleted entries are marked by 0 and 1, respectively.
-  static const int _UNUSED_PAIR = 0;
-  static const int _DELETED_PAIR = 1;
-
-  // On 32-bit, the top bits are wasted to avoid Mint allocation.
-  // TODO(koda): Reclaim the bits by making the compiler treat hash patterns
-  // as unsigned words.
-  static int _indexSizeToHashMask(int indexSize) {
-    int indexBits = indexSize.bitLength - 2;
-    return internal.is64Bit
-        ? (1 << (32 - indexBits)) - 1
-        : (1 << (30 - indexBits)) - 1;
-  }
-
-  static int _hashPattern(int fullHash, int hashMask, int size) {
-    final int maskedHash = fullHash & hashMask;
-    // TODO(koda): Consider keeping bit length and use left shift.
-    return (maskedHash == 0) ? (size >> 1) : maskedHash * (size >> 1);
-  }
-
-  // Linear probing.
-  static int _firstProbe(int fullHash, int sizeMask) {
-    final int i = fullHash & sizeMask;
-    // Light, fast shuffle to mitigate bad hashCode (e.g., sequential).
-    return ((i << 1) + i) & sizeMask;
-  }
-
-  static int _nextProbe(int i, int sizeMask) => (i + 1) & sizeMask;
-
-  // A self-loop is used to mark a deleted key or value.
-  static bool _isDeleted(List data, Object? keyOrValue) =>
-      identical(keyOrValue, data);
-  static void _setDeletedAt(List data, int d) {
-    data[d] = data;
-  }
-
-  // Concurrent modification detection relies on this checksum monotonically
-  // increasing between reallocations of _data.
-  int get _checkSum => _usedData + _deletedKeys;
-  bool _isModifiedSince(List oldData, int oldCheckSum) =>
-      !identical(_data, oldData) || (_checkSum != oldCheckSum);
-
-  int get length;
-}
-
-class _OperatorEqualsAndHashCode {
-  int _hashCode(e) => e.hashCode;
-  bool _equals(e1, e2) => e1 == e2;
-}
-
-class _IdenticalAndIdentityHashCode {
-  int _hashCode(e) => identityHashCode(e);
-  bool _equals(e1, e2) => identical(e1, e2);
-}
-
-// VM-internalized implementation of a default-constructed LinkedHashMap.
-@pragma("vm:entry-point")
-class _InternalLinkedHashMap<K, V> extends _HashVMBase
-    with
-        MapMixin<K, V>,
-        _LinkedHashMapMixin<K, V>,
-        _HashBase,
-        _OperatorEqualsAndHashCode
-    implements LinkedHashMap<K, V> {
-  _InternalLinkedHashMap() {
-    _index = new Uint32List(_HashBase._INITIAL_INDEX_SIZE);
-    _hashMask = _HashBase._indexSizeToHashMask(_HashBase._INITIAL_INDEX_SIZE);
-    _data = new List.filled(_HashBase._INITIAL_INDEX_SIZE, null);
-    _usedData = 0;
-    _deletedKeys = 0;
-  }
-}
-
-abstract class _LinkedHashMapMixin<K, V> implements _HashBase {
-  int _hashCode(e);
-  bool _equals(e1, e2);
-  int get _checkSum;
-  bool _isModifiedSince(List oldData, int oldCheckSum);
-
-  int get length => (_usedData >> 1) - _deletedKeys;
-  bool get isEmpty => length == 0;
-  bool get isNotEmpty => !isEmpty;
-
-  void _rehash() {
-    if ((_deletedKeys << 2) > _usedData) {
-      // TODO(koda): Consider shrinking.
-      // TODO(koda): Consider in-place compaction and more costly CME check.
-      _init(_index.length, _hashMask, _data, _usedData);
-    } else {
-      // TODO(koda): Support 32->64 bit transition (and adjust _hashMask).
-      _init(_index.length << 1, _hashMask >> 1, _data, _usedData);
-    }
-  }
-
-  void clear() {
-    if (!isEmpty) {
-      _init(_HashBase._INITIAL_INDEX_SIZE, _hashMask, null, 0);
-    }
-  }
-
-  // Allocate new _index and _data, and optionally copy existing contents.
-  void _init(int size, int hashMask, List? oldData, int oldUsed) {
-    assert(size & (size - 1) == 0);
-    assert(_HashBase._UNUSED_PAIR == 0);
-    _index = new Uint32List(size);
-    _hashMask = hashMask;
-    _data = new List.filled(size, null);
-    _usedData = 0;
-    _deletedKeys = 0;
-    if (oldData != null) {
-      for (int i = 0; i < oldUsed; i += 2) {
-        var key = oldData[i];
-        if (!_HashBase._isDeleted(oldData, key)) {
-          // TODO(koda): While there are enough hash bits, avoid hashCode calls.
-          this[key] = oldData[i + 1];
-        }
-      }
-    }
-  }
-
-  // This method is called by [_rehashObjects] (see above).
-  void _regenerateIndex() {
-    _index = new Uint32List(_data.length);
-    assert(_hashMask == 0);
-    _hashMask = _HashBase._indexSizeToHashMask(_index.length);
-    final int tmpUsed = _usedData;
-    _usedData = 0;
-    for (int i = 0; i < tmpUsed; i += 2) {
-      this[_data[i]] = _data[i + 1];
-    }
-  }
-
-  void _insert(K key, V value, int hashPattern, int i) {
-    if (_usedData == _data.length) {
-      _rehash();
-      this[key] = value;
-    } else {
-      assert(1 <= hashPattern && hashPattern < (1 << 32));
-      final int index = _usedData >> 1;
-      assert((index & hashPattern) == 0);
-      _index[i] = hashPattern | index;
-      _data[_usedData++] = key;
-      _data[_usedData++] = value;
-    }
-  }
-
-  // If key is present, returns the index of the value in _data, else returns
-  // the negated insertion point in _index.
-  int _findValueOrInsertPoint(K key, int fullHash, int hashPattern, int size) {
-    final int sizeMask = size - 1;
-    final int maxEntries = size >> 1;
-    int i = _HashBase._firstProbe(fullHash, sizeMask);
-    int firstDeleted = -1;
-    int pair = _index[i];
-    while (pair != _HashBase._UNUSED_PAIR) {
-      if (pair == _HashBase._DELETED_PAIR) {
-        if (firstDeleted < 0) {
-          firstDeleted = i;
-        }
-      } else {
-        final int entry = hashPattern ^ pair;
-        if (entry < maxEntries) {
-          final int d = entry << 1;
-          if (_equals(key, _data[d])) {
-            return d + 1;
-          }
-        }
-      }
-      i = _HashBase._nextProbe(i, sizeMask);
-      pair = _index[i];
-    }
-    return firstDeleted >= 0 ? -firstDeleted : -i;
-  }
-
-  void operator []=(K key, V value) {
-    final int size = _index.length;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    final int d = _findValueOrInsertPoint(key, fullHash, hashPattern, size);
-    if (d > 0) {
-      _data[d] = value;
-    } else {
-      final int i = -d;
-      _insert(key, value, hashPattern, i);
-    }
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    final int size = _index.length;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    final int d = _findValueOrInsertPoint(key, fullHash, hashPattern, size);
-    if (d > 0) {
-      return _data[d];
-    }
-    // 'ifAbsent' is allowed to modify the map.
-    List oldData = _data;
-    int oldCheckSum = _checkSum;
-    V value = ifAbsent();
-    if (_isModifiedSince(oldData, oldCheckSum)) {
-      this[key] = value;
-    } else {
-      final int i = -d;
-      _insert(key, value, hashPattern, i);
-    }
-    return value;
-  }
-
-  V? remove(Object? key) {
-    final int size = _index.length;
-    final int sizeMask = size - 1;
-    final int maxEntries = size >> 1;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    int i = _HashBase._firstProbe(fullHash, sizeMask);
-    int pair = _index[i];
-    while (pair != _HashBase._UNUSED_PAIR) {
-      if (pair != _HashBase._DELETED_PAIR) {
-        final int entry = hashPattern ^ pair;
-        if (entry < maxEntries) {
-          final int d = entry << 1;
-          if (_equals(key, _data[d])) {
-            _index[i] = _HashBase._DELETED_PAIR;
-            _HashBase._setDeletedAt(_data, d);
-            V value = _data[d + 1];
-            _HashBase._setDeletedAt(_data, d + 1);
-            ++_deletedKeys;
-            return value;
-          }
-        }
-      }
-      i = _HashBase._nextProbe(i, sizeMask);
-      pair = _index[i];
-    }
-    return null;
-  }
-
-  // If key is absent, return _data (which is never a value).
-  Object? _getValueOrData(Object? key) {
-    final int size = _index.length;
-    final int sizeMask = size - 1;
-    final int maxEntries = size >> 1;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    int i = _HashBase._firstProbe(fullHash, sizeMask);
-    int pair = _index[i];
-    while (pair != _HashBase._UNUSED_PAIR) {
-      if (pair != _HashBase._DELETED_PAIR) {
-        final int entry = hashPattern ^ pair;
-        if (entry < maxEntries) {
-          final int d = entry << 1;
-          if (_equals(key, _data[d])) {
-            return _data[d + 1];
-          }
-        }
-      }
-      i = _HashBase._nextProbe(i, sizeMask);
-      pair = _index[i];
-    }
-    return _data;
-  }
-
-  bool containsKey(Object? key) => !identical(_data, _getValueOrData(key));
-
-  V? operator [](Object? key) {
-    var v = _getValueOrData(key);
-    return identical(_data, v) ? null : internal.unsafeCast<V>(v);
-  }
-
-  bool containsValue(Object? value) {
-    for (var v in values) {
-      // Spec. says this should always use "==", also for identity maps, etc.
-      if (v == value) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  void forEach(void f(K key, V value)) {
-    var ki = keys.iterator;
-    var vi = values.iterator;
-    while (ki.moveNext()) {
-      vi.moveNext();
-      f(ki.current, vi.current);
-    }
-  }
-
-  Iterable<K> get keys =>
-      new _CompactIterable<K>(this, _data, _usedData, -2, 2);
-  Iterable<V> get values =>
-      new _CompactIterable<V>(this, _data, _usedData, -1, 2);
-}
-
-class _CompactLinkedIdentityHashMap<K, V> extends _HashFieldBase
-    with
-        MapMixin<K, V>,
-        _LinkedHashMapMixin<K, V>,
-        _HashBase,
-        _IdenticalAndIdentityHashCode
-    implements LinkedHashMap<K, V> {
-  _CompactLinkedIdentityHashMap() : super(_HashBase._INITIAL_INDEX_SIZE);
-}
-
-class _CompactLinkedCustomHashMap<K, V> extends _HashFieldBase
-    with MapMixin<K, V>, _LinkedHashMapMixin<K, V>, _HashBase
-    implements LinkedHashMap<K, V> {
-  final _equality;
-  final _hasher;
-  final _validKey;
-
-  // TODO(koda): Ask gbracha why I cannot have fields _equals/_hashCode.
-  int _hashCode(e) => _hasher(e);
-  bool _equals(e1, e2) => _equality(e1, e2);
-
-  bool containsKey(Object? o) => _validKey(o) ? super.containsKey(o) : false;
-  V? operator [](Object? o) => _validKey(o) ? super[o] : null;
-  V? remove(Object? o) => _validKey(o) ? super.remove(o) : null;
-
-  _CompactLinkedCustomHashMap(this._equality, this._hasher, validKey)
-      : _validKey = (validKey != null) ? validKey : new _TypeTest<K>().test,
-        super(_HashBase._INITIAL_INDEX_SIZE);
-}
-
-// Iterates through _data[_offset + _step], _data[_offset + 2*_step], ...
-// and checks for concurrent modification.
-class _CompactIterable<E> extends Iterable<E> {
-  final _HashBase _table;
-  final List _data;
-  final int _len;
-  final int _offset;
-  final int _step;
-
-  _CompactIterable(
-      this._table, this._data, this._len, this._offset, this._step);
-
-  Iterator<E> get iterator =>
-      new _CompactIterator<E>(_table, _data, _len, _offset, _step);
-
-  int get length => _table.length;
-  bool get isEmpty => length == 0;
-  bool get isNotEmpty => !isEmpty;
-}
-
-class _CompactIterator<E> implements Iterator<E> {
-  final _HashBase _table;
-  final List _data;
-  final int _len;
-  int _offset;
-  final int _step;
-  final int _checkSum;
-  E? _current;
-
-  _CompactIterator(
-      _HashBase table, this._data, this._len, this._offset, this._step)
-      : _table = table,
-        _checkSum = table._checkSum;
-
-  bool moveNext() {
-    if (_table._isModifiedSince(_data, _checkSum)) {
-      throw new ConcurrentModificationError(_table);
-    }
-    do {
-      _offset += _step;
-    } while (_offset < _len && _HashBase._isDeleted(_data, _data[_offset]));
-    if (_offset < _len) {
-      _current = internal.unsafeCast<E>(_data[_offset]);
-      return true;
-    } else {
-      _current = null;
-      return false;
-    }
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-}
-
-// Set implementation, analogous to _CompactLinkedHashMap.
-@pragma('vm:entry-point')
-class _CompactLinkedHashSet<E> extends _HashFieldBase
-    with _HashBase, _OperatorEqualsAndHashCode, SetMixin<E>
-    implements LinkedHashSet<E> {
-  _CompactLinkedHashSet() : super(_HashBase._INITIAL_INDEX_SIZE >> 1) {
-    assert(_HashBase._UNUSED_PAIR == 0);
-  }
-
-  static Set<R> _newEmpty<R>() => new _CompactLinkedHashSet<R>();
-
-  Set<R> cast<R>() => Set.castFrom<E, R>(this, newSet: _newEmpty);
-  int get length => _usedData - _deletedKeys;
-
-  E get first {
-    for (int offset = 0; offset < _usedData; offset++) {
-      Object? current = _data[offset];
-      if (!_HashBase._isDeleted(_data, current)) {
-        return current as E;
-      }
-    }
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    for (int offset = _usedData - 1; offset >= 0; offset--) {
-      Object? current = _data[offset];
-      if (!_HashBase._isDeleted(_data, current)) {
-        return current as E;
-      }
-    }
-    throw IterableElementError.noElement();
-  }
-
-  void _rehash() {
-    if ((_deletedKeys << 1) > _usedData) {
-      _init(_index.length, _hashMask, _data, _usedData);
-    } else {
-      _init(_index.length << 1, _hashMask >> 1, _data, _usedData);
-    }
-  }
-
-  void clear() {
-    if (!isEmpty) {
-      _init(_HashBase._INITIAL_INDEX_SIZE, _hashMask, null, 0);
-    }
-  }
-
-  void _init(int size, int hashMask, List? oldData, int oldUsed) {
-    _index = new Uint32List(size);
-    _hashMask = hashMask;
-    _data = new List.filled(size >> 1, null);
-    _usedData = 0;
-    _deletedKeys = 0;
-    if (oldData != null) {
-      for (int i = 0; i < oldUsed; i += 1) {
-        var key = oldData[i];
-        if (!_HashBase._isDeleted(oldData, key)) {
-          add(key);
-        }
-      }
-    }
-  }
-
-  bool add(E key) {
-    final int size = _index.length;
-    final int sizeMask = size - 1;
-    final int maxEntries = size >> 1;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    int i = _HashBase._firstProbe(fullHash, sizeMask);
-    int firstDeleted = -1;
-    int pair = _index[i];
-    while (pair != _HashBase._UNUSED_PAIR) {
-      if (pair == _HashBase._DELETED_PAIR) {
-        if (firstDeleted < 0) {
-          firstDeleted = i;
-        }
-      } else {
-        final int d = hashPattern ^ pair;
-        if (d < maxEntries && _equals(key, _data[d])) {
-          return false;
-        }
-      }
-      i = _HashBase._nextProbe(i, sizeMask);
-      pair = _index[i];
-    }
-    if (_usedData == _data.length) {
-      _rehash();
-      add(key);
-    } else {
-      final int insertionPoint = (firstDeleted >= 0) ? firstDeleted : i;
-      assert(1 <= hashPattern && hashPattern < (1 << 32));
-      assert((hashPattern & _usedData) == 0);
-      _index[insertionPoint] = hashPattern | _usedData;
-      _data[_usedData++] = key;
-    }
-    return true;
-  }
-
-  // If key is absent, return _data (which is never a value).
-  Object? _getKeyOrData(Object? key) {
-    final int size = _index.length;
-    final int sizeMask = size - 1;
-    final int maxEntries = size >> 1;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    int i = _HashBase._firstProbe(fullHash, sizeMask);
-    int pair = _index[i];
-    while (pair != _HashBase._UNUSED_PAIR) {
-      if (pair != _HashBase._DELETED_PAIR) {
-        final int d = hashPattern ^ pair;
-        if (d < maxEntries && _equals(key, _data[d])) {
-          return _data[d]; // Note: Must return the existing key.
-        }
-      }
-      i = _HashBase._nextProbe(i, sizeMask);
-      pair = _index[i];
-    }
-    return _data;
-  }
-
-  E? lookup(Object? key) {
-    var k = _getKeyOrData(key);
-    return identical(_data, k) ? null : internal.unsafeCast<E>(k);
-  }
-
-  bool contains(Object? key) => !identical(_data, _getKeyOrData(key));
-
-  bool remove(Object? key) {
-    final int size = _index.length;
-    final int sizeMask = size - 1;
-    final int maxEntries = size >> 1;
-    final int fullHash = _hashCode(key);
-    final int hashPattern = _HashBase._hashPattern(fullHash, _hashMask, size);
-    int i = _HashBase._firstProbe(fullHash, sizeMask);
-    int pair = _index[i];
-    while (pair != _HashBase._UNUSED_PAIR) {
-      if (pair != _HashBase._DELETED_PAIR) {
-        final int d = hashPattern ^ pair;
-        if (d < maxEntries && _equals(key, _data[d])) {
-          _index[i] = _HashBase._DELETED_PAIR;
-          _HashBase._setDeletedAt(_data, d);
-          ++_deletedKeys;
-          return true;
-        }
-      }
-      i = _HashBase._nextProbe(i, sizeMask);
-      pair = _index[i];
-    }
-    return false;
-  }
-
-  Iterator<E> get iterator =>
-      new _CompactIterator<E>(this, _data, _usedData, -1, 1);
-
-  // Returns a set of the same type, although this
-  // is not required by the spec. (For instance, always using an identity set
-  // would be technically correct, albeit surprising.)
-  Set<E> toSet() => new _CompactLinkedHashSet<E>()..addAll(this);
-
-  // This method is called by [_rehashObjects] (see above).
-  void _regenerateIndex() {
-    _rehash();
-  }
-}
-
-class _CompactLinkedIdentityHashSet<E> extends _CompactLinkedHashSet<E>
-    with _IdenticalAndIdentityHashCode {
-  Set<E> toSet() => new _CompactLinkedIdentityHashSet<E>()..addAll(this);
-
-  static Set<R> _newEmpty<R>() => new _CompactLinkedIdentityHashSet<R>();
-
-  Set<R> cast<R>() => Set.castFrom<E, R>(this, newSet: _newEmpty);
-}
-
-class _CompactLinkedCustomHashSet<E> extends _CompactLinkedHashSet<E> {
-  final _equality;
-  final _hasher;
-  final _validKey;
-
-  int _hashCode(e) => _hasher(e);
-  bool _equals(e1, e2) => _equality(e1, e2);
-
-  bool contains(Object? o) => _validKey(o) ? super.contains(o) : false;
-  E? lookup(Object? o) => _validKey(o) ? super.lookup(o) : null;
-  bool remove(Object? o) => _validKey(o) ? super.remove(o) : false;
-
-  _CompactLinkedCustomHashSet(this._equality, this._hasher, validKey)
-      : _validKey = (validKey != null) ? validKey : new _TypeTest<E>().test;
-
-  Set<R> cast<R>() => Set.castFrom<E, R>(this);
-  Set<E> toSet() =>
-      new _CompactLinkedCustomHashSet<E>(_equality, _hasher, _validKey)
-        ..addAll(this);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/convert_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/convert_patch.dart
deleted file mode 100644
index 6f82337..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/convert_patch.dart
+++ /dev/null
@@ -1,2055 +0,0 @@
-// Copyright (c) 2014, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:convert" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal"
-    show
-        allocateOneByteString,
-        allocateTwoByteString,
-        ClassID,
-        copyRangeFromUint8ListToOneByteString,
-        patch,
-        POWERS_OF_TEN,
-        unsafeCast,
-        writeIntoOneByteString,
-        writeIntoTwoByteString;
-
-import "dart:typed_data" show Uint8List, Uint16List;
-
-/// This patch library has no additional parts.
-
-// JSON conversion.
-
-@patch
-dynamic _parseJson(
-    String source, Object? Function(Object? key, Object? value)? reviver) {
-  _BuildJsonListener listener;
-  if (reviver == null) {
-    listener = new _BuildJsonListener();
-  } else {
-    listener = new _ReviverJsonListener(reviver);
-  }
-  var parser = new _JsonStringParser(listener);
-  parser.chunk = source;
-  parser.chunkEnd = source.length;
-  parser.parse(0);
-  parser.close();
-  return listener.result;
-}
-
-@patch
-class Utf8Decoder {
-  @patch
-  Converter<List<int>, T> fuse<T>(Converter<String, T> next) {
-    if (next is JsonDecoder) {
-      return new _JsonUtf8Decoder(
-              (next as JsonDecoder)._reviver, this._allowMalformed)
-          as dynamic/*=Converter<List<int>, T>*/;
-    }
-    // TODO(lrn): Recognize a fused decoder where the next step is JsonDecoder.
-    return super.fuse<T>(next);
-  }
-
-  // Allow intercepting of UTF-8 decoding when built-in lists are passed.
-  @patch
-  static String? _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int? end) {
-    return null; // This call was not intercepted.
-  }
-}
-
-class _JsonUtf8Decoder extends Converter<List<int>, Object> {
-  final Object? Function(Object? key, Object? value)? _reviver;
-  final bool _allowMalformed;
-
-  _JsonUtf8Decoder(this._reviver, this._allowMalformed);
-
-  Object convert(List<int> input) {
-    var parser = _JsonUtf8DecoderSink._createParser(_reviver, _allowMalformed);
-    parser.chunk = input;
-    parser.chunkEnd = input.length;
-    parser.parse(0);
-    parser.close();
-    return parser.result;
-  }
-
-  ByteConversionSink startChunkedConversion(Sink<Object?> sink) {
-    return new _JsonUtf8DecoderSink(_reviver, sink, _allowMalformed);
-  }
-}
-
-//// Implementation ///////////////////////////////////////////////////////////
-
-// Simple API for JSON parsing.
-
-/**
- * Listener for parsing events from [_ChunkedJsonParser].
- */
-abstract class _JsonListener {
-  void handleString(String value) {}
-  void handleNumber(num value) {}
-  void handleBool(bool value) {}
-  void handleNull() {}
-  void beginObject() {}
-  void propertyName() {}
-  void propertyValue() {}
-  void endObject() {}
-  void beginArray() {}
-  void arrayElement() {}
-  void endArray() {}
-
-  /**
-   * Read out the final result of parsing a JSON string.
-   *
-   * Must only be called when the entire input has been parsed.
-   */
-  dynamic get result;
-}
-
-/**
- * A [_JsonListener] that builds data objects from the parser events.
- *
- * This is a simple stack-based object builder. It keeps the most recently
- * seen value in a variable, and uses it depending on the following event.
- */
-class _BuildJsonListener extends _JsonListener {
-  /**
-   * Stack used to handle nested containers.
-   *
-   * The current container is pushed on the stack when a new one is
-   * started. If the container is a [Map], there is also a current [key]
-   * which is also stored on the stack.
-   */
-  final List<Object?> stack = [];
-  /** The current [Map] or [List] being built. */
-  dynamic currentContainer;
-  /** The most recently read property key. */
-  String key = '';
-  /** The most recently read value. */
-  dynamic value;
-
-  /** Pushes the currently active container (and key, if a [Map]). */
-  void pushContainer() {
-    if (currentContainer is Map) stack.add(key);
-    stack.add(currentContainer);
-  }
-
-  /** Pops the top container from the [stack], including a key if applicable. */
-  void popContainer() {
-    value = currentContainer;
-    currentContainer = stack.removeLast();
-    if (currentContainer is Map) key = stack.removeLast() as String;
-  }
-
-  void handleString(String value) {
-    this.value = value;
-  }
-
-  void handleNumber(num value) {
-    this.value = value;
-  }
-
-  void handleBool(bool value) {
-    this.value = value;
-  }
-
-  void handleNull() {
-    this.value = null;
-  }
-
-  void beginObject() {
-    pushContainer();
-    currentContainer = <String, dynamic>{};
-  }
-
-  void propertyName() {
-    key = value;
-    value = null;
-  }
-
-  void propertyValue() {
-    Map map = currentContainer;
-    map[key] = value;
-    key = '';
-    value = null;
-  }
-
-  void endObject() {
-    popContainer();
-  }
-
-  void beginArray() {
-    pushContainer();
-    currentContainer = [];
-  }
-
-  void arrayElement() {
-    currentContainer.add(value);
-    value = null;
-  }
-
-  void endArray() {
-    popContainer();
-  }
-
-  /** Read out the final result of parsing a JSON string. */
-  dynamic get result {
-    assert(currentContainer == null);
-    return value;
-  }
-}
-
-class _ReviverJsonListener extends _BuildJsonListener {
-  final Object? Function(Object? key, Object? value) reviver;
-  _ReviverJsonListener(this.reviver);
-
-  void arrayElement() {
-    List list = currentContainer;
-    value = reviver(list.length, value);
-    super.arrayElement();
-  }
-
-  void propertyValue() {
-    value = reviver(key, value);
-    super.propertyValue();
-  }
-
-  dynamic get result {
-    return reviver(null, value);
-  }
-}
-
-/**
- * Buffer holding parts of a numeral.
- *
- * The buffer contains the characters of a JSON number.
- * These are all ASCII, so an [Uint8List] is used as backing store.
- *
- * This buffer is used when a JSON number is split between separate chunks.
- *
- */
-class _NumberBuffer {
-  static const int minCapacity = 16;
-  static const int kDefaultOverhead = 5;
-  Uint8List list;
-  int length = 0;
-  _NumberBuffer(int initialCapacity)
-      : list = new Uint8List(_initialCapacity(initialCapacity));
-
-  int get capacity => list.length;
-
-  // Pick an initial capacity greater than the first part's size.
-  // The typical use case has two parts, this is the attempt at
-  // guessing the size of the second part without overdoing it.
-  // The default estimate of the second part is [kDefaultOverhead],
-  // then round to multiplum of four, and return the result,
-  // or [minCapacity] if that is greater.
-  static int _initialCapacity(int minCapacity) {
-    minCapacity += kDefaultOverhead;
-    if (minCapacity < minCapacity) return minCapacity;
-    minCapacity = (minCapacity + 3) & ~3; // Round to multiple of four.
-    return minCapacity;
-  }
-
-  // Grows to the exact size asked for.
-  void ensureCapacity(int newCapacity) {
-    Uint8List list = this.list;
-    if (newCapacity <= list.length) return;
-    Uint8List newList = new Uint8List(newCapacity);
-    newList.setRange(0, list.length, list, 0);
-    this.list = newList;
-  }
-
-  String getString() {
-    String result = new String.fromCharCodes(list, 0, length);
-    return result;
-  }
-
-  // TODO(lrn): See if parsing of numbers can be abstracted to something
-  // not only working on strings, but also on char-code lists, without lossing
-  // performance.
-  num parseNum() => num.parse(getString());
-  double parseDouble() => double.parse(getString());
-}
-
-/**
- * Chunked JSON parser.
- *
- * Receives inputs in chunks, gives access to individual parts of the input,
- * and stores input state between chunks.
- *
- * Implementations include [String] and UTF-8 parsers.
- */
-abstract class _ChunkedJsonParser<T> {
-  // A simple non-recursive state-based parser for JSON.
-  //
-  // Literal values accepted in states ARRAY_EMPTY, ARRAY_COMMA, OBJECT_COLON
-  // and strings also in OBJECT_EMPTY, OBJECT_COMMA.
-  //               VALUE  STRING  :  ,  }  ]        Transitions to
-  // EMPTY            X      X                   -> END
-  // ARRAY_EMPTY      X      X             @     -> ARRAY_VALUE / pop
-  // ARRAY_VALUE                     @     @     -> ARRAY_COMMA / pop
-  // ARRAY_COMMA      X      X                   -> ARRAY_VALUE
-  // OBJECT_EMPTY            X          @        -> OBJECT_KEY / pop
-  // OBJECT_KEY                   @              -> OBJECT_COLON
-  // OBJECT_COLON     X      X                   -> OBJECT_VALUE
-  // OBJECT_VALUE                    @  @        -> OBJECT_COMMA / pop
-  // OBJECT_COMMA            X                   -> OBJECT_KEY
-  // END
-  // Starting a new array or object will push the current state. The "pop"
-  // above means restoring this state and then marking it as an ended value.
-  // X means generic handling, @ means special handling for just that
-  // state - that is, values are handled generically, only punctuation
-  // cares about the current state.
-  // Values for states are chosen so bits 0 and 1 tell whether
-  // a string/value is allowed, and setting bits 0 through 2 after a value
-  // gets to the next state (not empty, doesn't allow a value).
-
-  // State building-block constants.
-  static const int TOP_LEVEL = 0;
-  static const int INSIDE_ARRAY = 1;
-  static const int INSIDE_OBJECT = 2;
-  static const int AFTER_COLON = 3; // Always inside object.
-
-  static const int ALLOW_STRING_MASK = 8; // Allowed if zero.
-  static const int ALLOW_VALUE_MASK = 4; // Allowed if zero.
-  static const int ALLOW_VALUE = 0;
-  static const int STRING_ONLY = 4;
-  static const int NO_VALUES = 12;
-
-  // Objects and arrays are "empty" until their first property/element.
-  // At this position, they may either have an entry or a close-bracket.
-  static const int EMPTY = 0;
-  static const int NON_EMPTY = 16;
-  static const int EMPTY_MASK = 16; // Empty if zero.
-
-  // Actual states               : Context | Is empty? | Next?
-  static const int STATE_INITIAL = TOP_LEVEL | EMPTY | ALLOW_VALUE;
-  static const int STATE_END = TOP_LEVEL | NON_EMPTY | NO_VALUES;
-
-  static const int STATE_ARRAY_EMPTY = INSIDE_ARRAY | EMPTY | ALLOW_VALUE;
-  static const int STATE_ARRAY_VALUE = INSIDE_ARRAY | NON_EMPTY | NO_VALUES;
-  static const int STATE_ARRAY_COMMA = INSIDE_ARRAY | NON_EMPTY | ALLOW_VALUE;
-
-  static const int STATE_OBJECT_EMPTY = INSIDE_OBJECT | EMPTY | STRING_ONLY;
-  static const int STATE_OBJECT_KEY = INSIDE_OBJECT | NON_EMPTY | NO_VALUES;
-  static const int STATE_OBJECT_COLON = AFTER_COLON | NON_EMPTY | ALLOW_VALUE;
-  static const int STATE_OBJECT_VALUE = AFTER_COLON | NON_EMPTY | NO_VALUES;
-  static const int STATE_OBJECT_COMMA = INSIDE_OBJECT | NON_EMPTY | STRING_ONLY;
-
-  // Bits set in state after successfully reading a value.
-  // This transitions the state to expect the next punctuation.
-  static const int VALUE_READ_BITS = NON_EMPTY | NO_VALUES;
-
-  // Character code constants.
-  static const int BACKSPACE = 0x08;
-  static const int TAB = 0x09;
-  static const int NEWLINE = 0x0a;
-  static const int CARRIAGE_RETURN = 0x0d;
-  static const int FORM_FEED = 0x0c;
-  static const int SPACE = 0x20;
-  static const int QUOTE = 0x22;
-  static const int PLUS = 0x2b;
-  static const int COMMA = 0x2c;
-  static const int MINUS = 0x2d;
-  static const int DECIMALPOINT = 0x2e;
-  static const int SLASH = 0x2f;
-  static const int CHAR_0 = 0x30;
-  static const int CHAR_9 = 0x39;
-  static const int COLON = 0x3a;
-  static const int CHAR_E = 0x45;
-  static const int LBRACKET = 0x5b;
-  static const int BACKSLASH = 0x5c;
-  static const int RBRACKET = 0x5d;
-  static const int CHAR_a = 0x61;
-  static const int CHAR_b = 0x62;
-  static const int CHAR_e = 0x65;
-  static const int CHAR_f = 0x66;
-  static const int CHAR_l = 0x6c;
-  static const int CHAR_n = 0x6e;
-  static const int CHAR_r = 0x72;
-  static const int CHAR_s = 0x73;
-  static const int CHAR_t = 0x74;
-  static const int CHAR_u = 0x75;
-  static const int LBRACE = 0x7b;
-  static const int RBRACE = 0x7d;
-
-  // State of partial value at chunk split.
-  static const int NO_PARTIAL = 0;
-  static const int PARTIAL_STRING = 1;
-  static const int PARTIAL_NUMERAL = 2;
-  static const int PARTIAL_KEYWORD = 3;
-  static const int MASK_PARTIAL = 3;
-
-  // Partial states for numerals. Values can be |'ed with PARTIAL_NUMERAL.
-  static const int NUM_SIGN = 0; // After initial '-'.
-  static const int NUM_ZERO = 4; // After '0' as first digit.
-  static const int NUM_DIGIT = 8; // After digit, no '.' or 'e' seen.
-  static const int NUM_DOT = 12; // After '.'.
-  static const int NUM_DOT_DIGIT = 16; // After a decimal digit (after '.').
-  static const int NUM_E = 20; // After 'e' or 'E'.
-  static const int NUM_E_SIGN = 24; // After '-' or '+' after 'e' or 'E'.
-  static const int NUM_E_DIGIT = 28; // After exponent digit.
-  static const int NUM_SUCCESS = 32; // Never stored as partial state.
-
-  // Partial states for strings.
-  static const int STR_PLAIN = 0; // Inside string, but not escape.
-  static const int STR_ESCAPE = 4; // After '\'.
-  static const int STR_U = 16; // After '\u' and 0-3 hex digits.
-  static const int STR_U_COUNT_SHIFT = 2; // Hex digit count in bits 2-3.
-  static const int STR_U_VALUE_SHIFT = 5; // Hex digit value in bits 5+.
-
-  // Partial states for keywords.
-  static const int KWD_TYPE_MASK = 12;
-  static const int KWD_TYPE_SHIFT = 2;
-  static const int KWD_NULL = 0; // Prefix of "null" seen.
-  static const int KWD_TRUE = 4; // Prefix of "true" seen.
-  static const int KWD_FALSE = 8; // Prefix of "false" seen.
-  static const int KWD_BOM = 12; // Prefix of BOM seen.
-  static const int KWD_COUNT_SHIFT = 4; // Prefix length in bits 4+.
-
-  // Mask used to mask off two lower bits.
-  static const int TWO_BIT_MASK = 3;
-
-  final _JsonListener listener;
-
-  // The current parsing state.
-  int state = STATE_INITIAL;
-  List<int> states = <int>[];
-
-  /**
-   * Stores tokenizer state between chunks.
-   *
-   * This state is stored when a chunk stops in the middle of a
-   * token (string, numeral, boolean or null).
-   *
-   * The partial state is used to continue parsing on the next chunk.
-   * The previous chunk is not retained, any data needed are stored in
-   * this integer, or in the [buffer] field as a string-building buffer
-   * or a [_NumberBuffer].
-   *
-   * Prefix state stored in [prefixState] as bits.
-   *
-   *            ..00 : No partial value (NO_PARTIAL).
-   *
-   *         ..00001 : Partial string, not inside escape.
-   *         ..00101 : Partial string, after '\'.
-   *     ..vvvv1dd01 : Partial \u escape.
-   *                   The 'dd' bits (2-3) encode the number of hex digits seen.
-   *                   Bits 5-16 encode the value of the hex digits seen so far.
-   *
-   *        ..0ddd10 : Partial numeral.
-   *                   The `ddd` bits store the parts of in the numeral seen so
-   *                   far, as the constants `NUM_*` defined above.
-   *                   The characters of the numeral are stored in [buffer]
-   *                   as a [_NumberBuffer].
-   *
-   *      ..0ddd0011 : Partial 'null' keyword.
-   *      ..0ddd0111 : Partial 'true' keyword.
-   *      ..0ddd1011 : Partial 'false' keyword.
-   *      ..0ddd1111 : Partial UTF-8 BOM byte seqeuence ("\xEF\xBB\xBF").
-   *                   For all keywords, the `ddd` bits encode the number
-   *                   of letters seen.
-   *                   The BOM byte sequence is only used by [_JsonUtf8Parser],
-   *                   and only at the very beginning of input.
-   */
-  int partialState = NO_PARTIAL;
-
-  /**
-   * Extra data stored while parsing a primitive value.
-   * May be set during parsing, always set at chunk end if a value is partial.
-   *
-   * May contain a string buffer while parsing strings.
-   */
-  dynamic buffer = null;
-
-  _ChunkedJsonParser(this.listener);
-
-  /**
-   * Push the current parse [state] on a stack.
-   *
-   * State is pushed when a new array or object literal starts,
-   * so the parser can go back to the correct value when the literal ends.
-   */
-  void saveState(int state) {
-    states.add(state);
-  }
-
-  /**
-   * Restore a state pushed with [saveState].
-   */
-  int restoreState() {
-    return states.removeLast(); // Throws if empty.
-  }
-
-  /**
-   * Finalizes the parsing.
-   *
-   * Throws if the source read so far doesn't end up with a complete
-   * parsed value. That means it must not be inside a list or object
-   * literal, and any partial value read should also be a valid complete
-   * value.
-   *
-   * The only valid partial state is a number that ends in a digit, and
-   * only if the number is the entire JSON value being parsed
-   * (otherwise it would be inside a list or object).
-   * Such a number will be completed. Any other partial state is an error.
-   */
-  void close() {
-    if (partialState != NO_PARTIAL) {
-      int partialType = partialState & MASK_PARTIAL;
-      if (partialType == PARTIAL_NUMERAL) {
-        int numState = partialState & ~MASK_PARTIAL;
-        // A partial number might be a valid number if we know it's done.
-        // There is an unnecessary overhead if input is a single number,
-        // but this is assumed to be rare.
-        _NumberBuffer buffer = this.buffer;
-        this.buffer = null;
-        finishChunkNumber(numState, 0, 0, buffer);
-      } else if (partialType == PARTIAL_STRING) {
-        fail(chunkEnd, "Unterminated string");
-      } else {
-        assert(partialType == PARTIAL_KEYWORD);
-        fail(chunkEnd); // Incomplete literal.
-      }
-    }
-    if (state != STATE_END) {
-      fail(chunkEnd);
-    }
-  }
-
-  /**
-   * Read out the result after successfully closing the parser.
-   *
-   * The parser is closed by calling [close] or calling [addSourceChunk] with
-   * `true` as second (`isLast`) argument.
-   */
-  dynamic get result {
-    return listener.result;
-  }
-
-  /** Sets the current source chunk. */
-  void set chunk(T source);
-
-  /**
-   * Length of current chunk.
-   *
-   * The valid arguments to [getChar] are 0 .. `chunkEnd - 1`.
-   */
-  int get chunkEnd;
-
-  /**
-   * Returns the chunk itself.
-   *
-   * Only used by [fail] to include the chunk in the thrown [FormatException].
-   */
-  T get chunk;
-
-  /**
-   * Get charcacter/code unit of current chunk.
-   *
-   * The [index] must be non-negative and less than `chunkEnd`.
-   * In practive, [index] will be no smaller than the `start` argument passed
-   * to [parse].
-   */
-  int getChar(int index);
-
-  /**
-   * Copy ASCII characters from start to end of chunk into a list.
-   *
-   * Used for number buffer (always copies ASCII, so encoding is not important).
-   */
-  void copyCharsToList(int start, int end, List<int> target, int offset);
-
-  /**
-   * Build a string using input code units.
-   *
-   * Creates a string buffer and enables adding characters and slices
-   * to that buffer.
-   * The buffer is stored in the [buffer] field. If the string is unterminated,
-   * the same buffer is used to continue parsing in the next chunk.
-   */
-  void beginString();
-  /**
-   * Add single character code to string being built.
-   *
-   * Used for unparsed escape sequences.
-   */
-  void addCharToString(int charCode);
-
-  /**
-   * Adds slice of current chunk to string being built.
-   *
-   * The [start] positions is inclusive, [end] is exclusive.
-   */
-  void addSliceToString(int start, int end);
-
-  /** Finalizes the string being built and returns it as a String. */
-  String endString();
-
-  /**
-   * Extracts a literal string from a slice of the current chunk.
-   *
-   * No interpretation of the content is performed, except for converting
-   * the source format to string.
-   * This can be implemented more or less efficiently depending on the
-   * underlying source.
-   *
-   * This is used for string literals that contain no escapes.
-   *
-   * The [bits] integer is an upper bound on the code point in the range
-   * from `start` to `end`.
-   * Usually found by doing bitwise or of all the values.
-   * The function may choose to optimize depending on the value.
-   */
-  String getString(int start, int end, int bits);
-
-  /**
-   * Parse a slice of the current chunk as a number.
-   *
-   * Since integers have a maximal value, and we don't track the value
-   * in the buffer, a sequence of digits can be either an int or a double.
-   * The `num.parse` function does the right thing.
-   *
-   * The format is expected to be correct.
-   */
-  num parseNum(int start, int end) {
-    const int asciiBits = 0x7f; // Number literals are ASCII only.
-    return num.parse(getString(start, end, asciiBits));
-  }
-
-  /**
-   * Parse a slice of the current chunk as a double.
-   *
-   * The format is expected to be correct.
-   * This is used by [parseNumber] when the double value cannot be
-   * built exactly during parsing.
-   */
-  double parseDouble(int start, int end) {
-    const int asciiBits = 0x7f; // Double literals are ASCII only.
-    return double.parse(getString(start, end, asciiBits));
-  }
-
-  /**
-   * Continues parsing a partial value.
-   */
-  int parsePartial(int position) {
-    if (position == chunkEnd) return position;
-    int partialState = this.partialState;
-    assert(partialState != NO_PARTIAL);
-    int partialType = partialState & MASK_PARTIAL;
-    this.partialState = NO_PARTIAL;
-    partialState = partialState & ~MASK_PARTIAL;
-    assert(partialType != 0);
-    if (partialType == PARTIAL_STRING) {
-      position = parsePartialString(position, partialState);
-    } else if (partialType == PARTIAL_NUMERAL) {
-      position = parsePartialNumber(position, partialState);
-    } else if (partialType == PARTIAL_KEYWORD) {
-      position = parsePartialKeyword(position, partialState);
-    }
-    return position;
-  }
-
-  /**
-   * Parses the remainder of a number into the number buffer.
-   *
-   * Syntax is checked while pasing.
-   * Starts at position, which is expected to be the start of the chunk,
-   * and returns the index of the first non-number-literal character found,
-   * or chunkEnd if the entire chunk is a valid number continuation.
-   * Throws if a syntax error is detected.
-   */
-  int parsePartialNumber(int position, int state) {
-    int start = position;
-    // Primitive implementation, can be optimized.
-    _NumberBuffer buffer = this.buffer;
-    this.buffer = null;
-    int end = chunkEnd;
-    toBailout:
-    {
-      if (position == end) break toBailout;
-      int char = getChar(position);
-      int digit = char ^ CHAR_0;
-      if (state == NUM_SIGN) {
-        if (digit <= 9) {
-          if (digit == 0) {
-            state = NUM_ZERO;
-          } else {
-            state = NUM_DIGIT;
-          }
-          position++;
-          if (position == end) break toBailout;
-          char = getChar(position);
-          digit = char ^ CHAR_0;
-        } else {
-          fail(position);
-        }
-      }
-      if (state == NUM_ZERO) {
-        // JSON does not allow insignificant leading zeros (e.g., "09").
-        if (digit <= 9) fail(position);
-        state = NUM_DIGIT;
-      }
-      while (state == NUM_DIGIT) {
-        if (digit > 9) {
-          if (char == DECIMALPOINT) {
-            state = NUM_DOT;
-          } else if ((char | 0x20) == CHAR_e) {
-            state = NUM_E;
-          } else {
-            finishChunkNumber(state, start, position, buffer);
-            return position;
-          }
-        }
-        position++;
-        if (position == end) break toBailout;
-        char = getChar(position);
-        digit = char ^ CHAR_0;
-      }
-      if (state == NUM_DOT) {
-        if (digit > 9) fail(position);
-        state = NUM_DOT_DIGIT;
-      }
-      while (state == NUM_DOT_DIGIT) {
-        if (digit > 9) {
-          if ((char | 0x20) == CHAR_e) {
-            state = NUM_E;
-          } else {
-            finishChunkNumber(state, start, position, buffer);
-            return position;
-          }
-        }
-        position++;
-        if (position == end) break toBailout;
-        char = getChar(position);
-        digit = char ^ CHAR_0;
-      }
-      if (state == NUM_E) {
-        if (char == PLUS || char == MINUS) {
-          state = NUM_E_SIGN;
-          position++;
-          if (position == end) break toBailout;
-          char = getChar(position);
-          digit = char ^ CHAR_0;
-        }
-      }
-      assert(state >= NUM_E);
-      while (digit <= 9) {
-        state = NUM_E_DIGIT;
-        position++;
-        if (position == end) break toBailout;
-        char = getChar(position);
-        digit = char ^ CHAR_0;
-      }
-      finishChunkNumber(state, start, position, buffer);
-      return position;
-    }
-    // Bailout code in case the current chunk ends while parsing the numeral.
-    assert(position == end);
-    continueChunkNumber(state, start, buffer);
-    return chunkEnd;
-  }
-
-  /**
-   * Continues parsing a partial string literal.
-   *
-   * Handles partial escapes and then hands the parsing off to
-   * [parseStringToBuffer].
-   */
-  int parsePartialString(int position, int partialState) {
-    if (partialState == STR_PLAIN) {
-      return parseStringToBuffer(position);
-    }
-    if (partialState == STR_ESCAPE) {
-      position = parseStringEscape(position);
-      // parseStringEscape sets partialState if it sees the end.
-      if (position == chunkEnd) return position;
-      return parseStringToBuffer(position);
-    }
-    assert((partialState & STR_U) != 0);
-    int value = partialState >> STR_U_VALUE_SHIFT;
-    int count = (partialState >> STR_U_COUNT_SHIFT) & TWO_BIT_MASK;
-    for (int i = count; i < 4; i++, position++) {
-      if (position == chunkEnd) return chunkStringEscapeU(i, value);
-      int char = getChar(position);
-      int digit = parseHexDigit(char);
-      if (digit < 0) fail(position, "Invalid hex digit");
-      value = 16 * value + digit;
-    }
-    addCharToString(value);
-    return parseStringToBuffer(position);
-  }
-
-  /**
-   * Continues parsing a partial keyword.
-   */
-  int parsePartialKeyword(int position, int partialState) {
-    int keywordType = partialState & KWD_TYPE_MASK;
-    int count = partialState >> KWD_COUNT_SHIFT;
-    int keywordTypeIndex = keywordType >> KWD_TYPE_SHIFT;
-    String keyword =
-        const ["null", "true", "false", "\xEF\xBB\xBF"][keywordTypeIndex];
-    assert(count < keyword.length);
-    do {
-      if (position == chunkEnd) {
-        this.partialState =
-            PARTIAL_KEYWORD | keywordType | (count << KWD_COUNT_SHIFT);
-        return chunkEnd;
-      }
-      int expectedChar = keyword.codeUnitAt(count);
-      if (getChar(position) != expectedChar) {
-        if (count == 0) {
-          assert(keywordType == KWD_BOM);
-          return position;
-        }
-        fail(position);
-      }
-      position++;
-      count++;
-    } while (count < keyword.length);
-    if (keywordType == KWD_NULL) {
-      listener.handleNull();
-    } else if (keywordType != KWD_BOM) {
-      listener.handleBool(keywordType == KWD_TRUE);
-    }
-    return position;
-  }
-
-  /** Convert hex-digit to its value. Returns -1 if char is not a hex digit. */
-  int parseHexDigit(int char) {
-    int digit = char ^ 0x30;
-    if (digit <= 9) return digit;
-    int letter = (char | 0x20) ^ 0x60;
-    // values 1 .. 6 are 'a' through 'f'
-    if (letter <= 6 && letter > 0) return letter + 9;
-    return -1;
-  }
-
-  /**
-   * Parses the current chunk as a chunk of JSON.
-   *
-   * Starts parsing at [position] and continues until [chunkEnd].
-   * Continues parsing where the previous chunk (if any) ended.
-   */
-  void parse(int position) {
-    int length = chunkEnd;
-    if (partialState != NO_PARTIAL) {
-      position = parsePartial(position);
-      if (position == length) return;
-    }
-    int state = this.state;
-    while (position < length) {
-      int char = getChar(position);
-      switch (char) {
-        case SPACE:
-        case CARRIAGE_RETURN:
-        case NEWLINE:
-        case TAB:
-          position++;
-          break;
-        case QUOTE:
-          if ((state & ALLOW_STRING_MASK) != 0) fail(position);
-          state |= VALUE_READ_BITS;
-          position = parseString(position + 1);
-          break;
-        case LBRACKET:
-          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
-          listener.beginArray();
-          saveState(state);
-          state = STATE_ARRAY_EMPTY;
-          position++;
-          break;
-        case LBRACE:
-          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
-          listener.beginObject();
-          saveState(state);
-          state = STATE_OBJECT_EMPTY;
-          position++;
-          break;
-        case CHAR_n:
-          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
-          state |= VALUE_READ_BITS;
-          position = parseNull(position);
-          break;
-        case CHAR_f:
-          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
-          state |= VALUE_READ_BITS;
-          position = parseFalse(position);
-          break;
-        case CHAR_t:
-          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
-          state |= VALUE_READ_BITS;
-          position = parseTrue(position);
-          break;
-        case COLON:
-          if (state != STATE_OBJECT_KEY) fail(position);
-          listener.propertyName();
-          state = STATE_OBJECT_COLON;
-          position++;
-          break;
-        case COMMA:
-          if (state == STATE_OBJECT_VALUE) {
-            listener.propertyValue();
-            state = STATE_OBJECT_COMMA;
-            position++;
-          } else if (state == STATE_ARRAY_VALUE) {
-            listener.arrayElement();
-            state = STATE_ARRAY_COMMA;
-            position++;
-          } else {
-            fail(position);
-          }
-          break;
-        case RBRACKET:
-          if (state == STATE_ARRAY_EMPTY) {
-            listener.endArray();
-          } else if (state == STATE_ARRAY_VALUE) {
-            listener.arrayElement();
-            listener.endArray();
-          } else {
-            fail(position);
-          }
-          state = restoreState() | VALUE_READ_BITS;
-          position++;
-          break;
-        case RBRACE:
-          if (state == STATE_OBJECT_EMPTY) {
-            listener.endObject();
-          } else if (state == STATE_OBJECT_VALUE) {
-            listener.propertyValue();
-            listener.endObject();
-          } else {
-            fail(position);
-          }
-          state = restoreState() | VALUE_READ_BITS;
-          position++;
-          break;
-        default:
-          if ((state & ALLOW_VALUE_MASK) != 0) fail(position);
-          state |= VALUE_READ_BITS;
-          position = parseNumber(char, position);
-          break;
-      }
-    }
-    this.state = state;
-  }
-
-  /**
-   * Parses a "true" literal starting at [position].
-   *
-   * The character `source[position]` must be "t".
-   */
-  int parseTrue(int position) {
-    assert(getChar(position) == CHAR_t);
-    if (chunkEnd < position + 4) {
-      return parseKeywordPrefix(position, "true", KWD_TRUE);
-    }
-    if (getChar(position + 1) != CHAR_r ||
-        getChar(position + 2) != CHAR_u ||
-        getChar(position + 3) != CHAR_e) {
-      fail(position);
-    }
-    listener.handleBool(true);
-    return position + 4;
-  }
-
-  /**
-   * Parses a "false" literal starting at [position].
-   *
-   * The character `source[position]` must be "f".
-   */
-  int parseFalse(int position) {
-    assert(getChar(position) == CHAR_f);
-    if (chunkEnd < position + 5) {
-      return parseKeywordPrefix(position, "false", KWD_FALSE);
-    }
-    if (getChar(position + 1) != CHAR_a ||
-        getChar(position + 2) != CHAR_l ||
-        getChar(position + 3) != CHAR_s ||
-        getChar(position + 4) != CHAR_e) {
-      fail(position);
-    }
-    listener.handleBool(false);
-    return position + 5;
-  }
-
-  /**
-   * Parses a "null" literal starting at [position].
-   *
-   * The character `source[position]` must be "n".
-   */
-  int parseNull(int position) {
-    assert(getChar(position) == CHAR_n);
-    if (chunkEnd < position + 4) {
-      return parseKeywordPrefix(position, "null", KWD_NULL);
-    }
-    if (getChar(position + 1) != CHAR_u ||
-        getChar(position + 2) != CHAR_l ||
-        getChar(position + 3) != CHAR_l) {
-      fail(position);
-    }
-    listener.handleNull();
-    return position + 4;
-  }
-
-  int parseKeywordPrefix(int position, String chars, int type) {
-    assert(getChar(position) == chars.codeUnitAt(0));
-    int length = chunkEnd;
-    int start = position;
-    int count = 1;
-    while (++position < length) {
-      int char = getChar(position);
-      if (char != chars.codeUnitAt(count)) fail(start);
-      count++;
-    }
-    this.partialState = PARTIAL_KEYWORD | type | (count << KWD_COUNT_SHIFT);
-    return length;
-  }
-
-  /**
-   * Parses a string value.
-   *
-   * Initial [position] is right after the initial quote.
-   * Returned position right after the final quote.
-   */
-  int parseString(int position) {
-    // Format: '"'([^\x00-\x1f\\\"]|'\\'[bfnrt/\\"])*'"'
-    // Initial position is right after first '"'.
-    int start = position;
-    int end = chunkEnd;
-    int bits = 0;
-    while (position < end) {
-      int char = getChar(position++);
-      bits |= char; // Includes final '"', but that never matters.
-      // BACKSLASH is larger than QUOTE and SPACE.
-      if (char > BACKSLASH) {
-        continue;
-      }
-      if (char == BACKSLASH) {
-        beginString();
-        int sliceEnd = position - 1;
-        if (start < sliceEnd) addSliceToString(start, sliceEnd);
-        return parseStringToBuffer(sliceEnd);
-      }
-      if (char == QUOTE) {
-        listener.handleString(getString(start, position - 1, bits));
-        return position;
-      }
-      if (char < SPACE) {
-        fail(position - 1, "Control character in string");
-      }
-    }
-    beginString();
-    if (start < end) addSliceToString(start, end);
-    return chunkString(STR_PLAIN);
-  }
-
-  /**
-   * Sets up a partial string state.
-   *
-   * The state is either not inside an escape, or right after a backslash.
-   * For partial strings ending inside a Unicode escape, use
-   * [chunkStringEscapeU].
-   */
-  int chunkString(int stringState) {
-    partialState = PARTIAL_STRING | stringState;
-    return chunkEnd;
-  }
-
-  /**
-   * Sets up a partial string state for a partially parsed Unicode escape.
-   *
-   * The partial string state includes the current [buffer] and the
-   * number of hex digits of the Unicode seen so far (e.g., for `"\u30')
-   * the state knows that two digits have been seen, and what their value is.
-   *
-   * Returns [chunkEnd] so it can be used as part of a return statement.
-   */
-  int chunkStringEscapeU(int count, int value) {
-    partialState = PARTIAL_STRING |
-        STR_U |
-        (count << STR_U_COUNT_SHIFT) |
-        (value << STR_U_VALUE_SHIFT);
-    return chunkEnd;
-  }
-
-  /**
-   * Parses the remainder of a string literal into a buffer.
-   *
-   * The buffer is stored in [buffer] and its underlying format depends on
-   * the input chunk type. For example UTF-8 decoding happens in the
-   * buffer, not in the parser, since all significant JSON characters are ASCII.
-   *
-   * This function scans through the string literal for escapes, and copies
-   * slices of non-escape characters using [addSliceToString].
-   */
-  int parseStringToBuffer(int position) {
-    int end = chunkEnd;
-    int start = position;
-    while (true) {
-      if (position == end) {
-        if (position > start) {
-          addSliceToString(start, position);
-        }
-        return chunkString(STR_PLAIN);
-      }
-      int char = getChar(position++);
-      if (char > BACKSLASH) continue;
-      if (char < SPACE) {
-        fail(position - 1); // Control character in string.
-      }
-      if (char == QUOTE) {
-        int quotePosition = position - 1;
-        if (quotePosition > start) {
-          addSliceToString(start, quotePosition);
-        }
-        listener.handleString(endString());
-        return position;
-      }
-      if (char != BACKSLASH) {
-        continue;
-      }
-      // Handle escape.
-      if (position - 1 > start) {
-        addSliceToString(start, position - 1);
-      }
-      if (position == end) return chunkString(STR_ESCAPE);
-      position = parseStringEscape(position);
-      if (position == end) return position;
-      start = position;
-    }
-    return -1; // UNREACHABLE.
-  }
-
-  /**
-   * Parse a string escape.
-   *
-   * Position is right after the initial backslash.
-   * The following escape is parsed into a character code which is added to
-   * the current string buffer using [addCharToString].
-   *
-   * Returns position after the last character of the escape.
-   */
-  int parseStringEscape(int position) {
-    int char = getChar(position++);
-    int length = chunkEnd;
-    switch (char) {
-      case CHAR_b:
-        char = BACKSPACE;
-        break;
-      case CHAR_f:
-        char = FORM_FEED;
-        break;
-      case CHAR_n:
-        char = NEWLINE;
-        break;
-      case CHAR_r:
-        char = CARRIAGE_RETURN;
-        break;
-      case CHAR_t:
-        char = TAB;
-        break;
-      case SLASH:
-      case BACKSLASH:
-      case QUOTE:
-        break;
-      case CHAR_u:
-        int hexStart = position - 1;
-        int value = 0;
-        for (int i = 0; i < 4; i++) {
-          if (position == length) return chunkStringEscapeU(i, value);
-          char = getChar(position++);
-          int digit = char ^ 0x30;
-          value *= 16;
-          if (digit <= 9) {
-            value += digit;
-          } else {
-            digit = (char | 0x20) - CHAR_a;
-            if (digit < 0 || digit > 5) {
-              fail(hexStart, "Invalid unicode escape");
-            }
-            value += digit + 10;
-          }
-        }
-        char = value;
-        break;
-      default:
-        if (char < SPACE) fail(position, "Control character in string");
-        fail(position, "Unrecognized string escape");
-    }
-    addCharToString(char);
-    if (position == length) return chunkString(STR_PLAIN);
-    return position;
-  }
-
-  /// Sets up a partial numeral state.
-  /// Returns chunkEnd to allow easy one-line bailout tests.
-  int beginChunkNumber(int state, int start) {
-    int end = chunkEnd;
-    int length = end - start;
-    var buffer = new _NumberBuffer(length);
-    copyCharsToList(start, end, buffer.list, 0);
-    buffer.length = length;
-    this.buffer = buffer;
-    this.partialState = PARTIAL_NUMERAL | state;
-    return end;
-  }
-
-  void addNumberChunk(_NumberBuffer buffer, int start, int end, int overhead) {
-    int length = end - start;
-    int count = buffer.length;
-    int newCount = count + length;
-    int newCapacity = newCount + overhead;
-    buffer.ensureCapacity(newCapacity);
-    copyCharsToList(start, end, buffer.list, count);
-    buffer.length = newCount;
-  }
-
-  // Continues an already chunked number across an entire chunk.
-  int continueChunkNumber(int state, int start, _NumberBuffer buffer) {
-    int end = chunkEnd;
-    addNumberChunk(buffer, start, end, _NumberBuffer.kDefaultOverhead);
-    this.buffer = buffer;
-    this.partialState = PARTIAL_NUMERAL | state;
-    return end;
-  }
-
-  int finishChunkNumber(int state, int start, int end, _NumberBuffer buffer) {
-    if (state == NUM_ZERO) {
-      listener.handleNumber(0);
-      return end;
-    }
-    if (end > start) {
-      addNumberChunk(buffer, start, end, 0);
-    }
-    if (state == NUM_DIGIT) {
-      num value = buffer.parseNum();
-      listener.handleNumber(value);
-    } else if (state == NUM_DOT_DIGIT || state == NUM_E_DIGIT) {
-      listener.handleNumber(buffer.parseDouble());
-    } else {
-      fail(chunkEnd, "Unterminated number literal");
-    }
-    return end;
-  }
-
-  int parseNumber(int char, int position) {
-    // Also called on any unexpected character.
-    // Format:
-    //  '-'?('0'|[1-9][0-9]*)('.'[0-9]+)?([eE][+-]?[0-9]+)?
-    int start = position;
-    int length = chunkEnd;
-    // Collects an int value while parsing. Used for both an integer literal,
-    // and the exponent part of a double literal.
-    // Stored as negative to ensure we can represent -2^63.
-    int intValue = 0;
-    double doubleValue = 0.0; // Collect double value while parsing.
-    // 1 if there is no leading -, -1 if there is.
-    int sign = 1;
-    bool isDouble = false;
-    // Break this block when the end of the number literal is reached.
-    // At that time, position points to the next character, and isDouble
-    // is set if the literal contains a decimal point or an exponential.
-    if (char == MINUS) {
-      sign = -1;
-      position++;
-      if (position == length) return beginChunkNumber(NUM_SIGN, start);
-      char = getChar(position);
-    }
-    int digit = char ^ CHAR_0;
-    if (digit > 9) {
-      if (sign < 0) {
-        fail(position, "Missing expected digit");
-      } else {
-        // If it doesn't even start out as a numeral.
-        fail(position);
-      }
-    }
-    if (digit == 0) {
-      position++;
-      if (position == length) return beginChunkNumber(NUM_ZERO, start);
-      char = getChar(position);
-      digit = char ^ CHAR_0;
-      // If starting with zero, next character must not be digit.
-      if (digit <= 9) fail(position);
-    } else {
-      int digitCount = 0;
-      do {
-        if (digitCount >= 18) {
-          // Check for overflow.
-          // Is 1 if digit is 8 or 9 and sign == 0, or digit is 9 and sign < 0;
-          int highDigit = digit >> 3;
-          if (sign < 0) highDigit &= digit;
-          if (digitCount == 19 || intValue - highDigit < -922337203685477580) {
-            isDouble = true;
-            // Big value that we know is not trusted to be exact later,
-            // forcing reparsing using `double.parse`.
-            doubleValue = 9223372036854775808.0;
-          }
-        }
-        intValue = 10 * intValue - digit;
-        digitCount++;
-        position++;
-        if (position == length) return beginChunkNumber(NUM_DIGIT, start);
-        char = getChar(position);
-        digit = char ^ CHAR_0;
-      } while (digit <= 9);
-    }
-    if (char == DECIMALPOINT) {
-      if (!isDouble) {
-        isDouble = true;
-        doubleValue = (intValue == 0) ? 0.0 : -intValue.toDouble();
-      }
-      intValue = 0;
-      position++;
-      if (position == length) return beginChunkNumber(NUM_DOT, start);
-      char = getChar(position);
-      digit = char ^ CHAR_0;
-      if (digit > 9) fail(position);
-      do {
-        doubleValue = 10.0 * doubleValue + digit;
-        intValue -= 1;
-        position++;
-        if (position == length) return beginChunkNumber(NUM_DOT_DIGIT, start);
-        char = getChar(position);
-        digit = char ^ CHAR_0;
-      } while (digit <= 9);
-    }
-    if ((char | 0x20) == CHAR_e) {
-      if (!isDouble) {
-        isDouble = true;
-        doubleValue = (intValue == 0) ? 0.0 : -intValue.toDouble();
-        intValue = 0;
-      }
-      position++;
-      if (position == length) return beginChunkNumber(NUM_E, start);
-      char = getChar(position);
-      int expSign = 1;
-      int exponent = 0;
-      if (((char + 1) | 2) == 0x2e /*+ or -*/) {
-        expSign = 0x2C - char; // -1 for MINUS, +1 for PLUS
-        position++;
-        if (position == length) return beginChunkNumber(NUM_E_SIGN, start);
-        char = getChar(position);
-      }
-      digit = char ^ CHAR_0;
-      if (digit > 9) {
-        fail(position, "Missing expected digit");
-      }
-      bool exponentOverflow = false;
-      do {
-        exponent = 10 * exponent + digit;
-        if (exponent > 400) exponentOverflow = true;
-        position++;
-        if (position == length) return beginChunkNumber(NUM_E_DIGIT, start);
-        char = getChar(position);
-        digit = char ^ CHAR_0;
-      } while (digit <= 9);
-      if (exponentOverflow) {
-        if (doubleValue == 0.0 || expSign < 0) {
-          listener.handleNumber(sign < 0 ? -0.0 : 0.0);
-        } else {
-          listener.handleNumber(
-              sign < 0 ? double.negativeInfinity : double.infinity);
-        }
-        return position;
-      }
-      intValue += expSign * exponent;
-    }
-    if (!isDouble) {
-      int bitFlag = -(sign + 1) >> 1; // 0 if sign == -1, -1 if sign == 1
-      // Negate if bitFlag is -1 by doing ~intValue + 1
-      listener.handleNumber((intValue ^ bitFlag) - bitFlag);
-      return position;
-    }
-    // Double values at or above this value (2 ** 53) may have lost precision.
-    // Only trust results that are below this value.
-    const double maxExactDouble = 9007199254740992.0;
-    if (doubleValue < maxExactDouble) {
-      int exponent = intValue;
-      double signedMantissa = doubleValue * sign;
-      if (exponent >= -22) {
-        if (exponent < 0) {
-          listener.handleNumber(signedMantissa / POWERS_OF_TEN[-exponent]);
-          return position;
-        }
-        if (exponent == 0) {
-          listener.handleNumber(signedMantissa);
-          return position;
-        }
-        if (exponent <= 22) {
-          listener.handleNumber(signedMantissa * POWERS_OF_TEN[exponent]);
-          return position;
-        }
-      }
-    }
-    // If the value is outside the range +/-maxExactDouble or
-    // exponent is outside the range +/-22, then we can't trust simple double
-    // arithmetic to get the exact result, so we use the system double parsing.
-    listener.handleNumber(parseDouble(start, position));
-    return position;
-  }
-
-  Never fail(int position, [String? message]) {
-    if (message == null) {
-      message = "Unexpected character";
-      if (position == chunkEnd) message = "Unexpected end of input";
-    }
-    throw new FormatException(message, chunk, position);
-  }
-}
-
-/**
- * Chunked JSON parser that parses [String] chunks.
- */
-class _JsonStringParser extends _ChunkedJsonParser<String> {
-  String chunk = '';
-  int chunkEnd = 0;
-
-  _JsonStringParser(_JsonListener listener) : super(listener);
-
-  int getChar(int position) => chunk.codeUnitAt(position);
-
-  String getString(int start, int end, int bits) {
-    return chunk.substring(start, end);
-  }
-
-  void beginString() {
-    this.buffer = new StringBuffer();
-  }
-
-  void addSliceToString(int start, int end) {
-    StringBuffer buffer = this.buffer;
-    buffer.write(chunk.substring(start, end));
-  }
-
-  void addCharToString(int charCode) {
-    StringBuffer buffer = this.buffer;
-    buffer.writeCharCode(charCode);
-  }
-
-  String endString() {
-    StringBuffer buffer = this.buffer;
-    this.buffer = null;
-    return buffer.toString();
-  }
-
-  void copyCharsToList(int start, int end, List target, int offset) {
-    int length = end - start;
-    for (int i = 0; i < length; i++) {
-      target[offset + i] = chunk.codeUnitAt(start + i);
-    }
-  }
-
-  double parseDouble(int start, int end) {
-    return _parseDouble(chunk, start, end);
-  }
-}
-
-@patch
-class JsonDecoder {
-  @patch
-  StringConversionSink startChunkedConversion(Sink<Object?> sink) {
-    return new _JsonStringDecoderSink(this._reviver, sink);
-  }
-}
-
-/**
- * Implements the chunked conversion from a JSON string to its corresponding
- * object.
- *
- * The sink only creates one object, but its input can be chunked.
- */
-class _JsonStringDecoderSink extends StringConversionSinkBase {
-  _JsonStringParser _parser;
-  final Object? Function(Object? key, Object? value)? _reviver;
-  final Sink<Object?> _sink;
-
-  _JsonStringDecoderSink(this._reviver, this._sink)
-      : _parser = _createParser(_reviver);
-
-  static _JsonStringParser _createParser(
-      Object? Function(Object? key, Object? value)? reviver) {
-    _BuildJsonListener listener;
-    if (reviver == null) {
-      listener = new _BuildJsonListener();
-    } else {
-      listener = new _ReviverJsonListener(reviver);
-    }
-    return new _JsonStringParser(listener);
-  }
-
-  void addSlice(String chunk, int start, int end, bool isLast) {
-    _parser.chunk = chunk;
-    _parser.chunkEnd = end;
-    _parser.parse(start);
-    if (isLast) _parser.close();
-  }
-
-  void add(String chunk) {
-    addSlice(chunk, 0, chunk.length, false);
-  }
-
-  void close() {
-    _parser.close();
-    var decoded = _parser.result;
-    _sink.add(decoded);
-    _sink.close();
-  }
-
-  ByteConversionSink asUtf8Sink(bool allowMalformed) {
-    return new _JsonUtf8DecoderSink(_reviver, _sink, allowMalformed);
-  }
-}
-
-/**
- * Chunked JSON parser that parses UTF-8 chunks.
- */
-class _JsonUtf8Parser extends _ChunkedJsonParser<List<int>> {
-  static final Uint8List emptyChunk = Uint8List(0);
-
-  final _Utf8Decoder decoder;
-  List<int> chunk = emptyChunk;
-  int chunkEnd = 0;
-
-  _JsonUtf8Parser(_JsonListener listener, bool allowMalformed)
-      : decoder = new _Utf8Decoder(allowMalformed),
-        super(listener) {
-    // Starts out checking for an optional BOM (KWD_BOM, count = 0).
-    partialState =
-        _ChunkedJsonParser.PARTIAL_KEYWORD | _ChunkedJsonParser.KWD_BOM;
-  }
-
-  int getChar(int position) => chunk[position];
-
-  String getString(int start, int end, int bits) {
-    const int maxAsciiChar = 0x7f;
-    if (bits <= maxAsciiChar) {
-      return new String.fromCharCodes(chunk, start, end);
-    }
-    beginString();
-    if (start < end) addSliceToString(start, end);
-    String result = endString();
-    return result;
-  }
-
-  void beginString() {
-    decoder.reset();
-    this.buffer = new StringBuffer();
-  }
-
-  void addSliceToString(int start, int end) {
-    final StringBuffer buffer = this.buffer;
-    buffer.write(decoder.convertChunked(chunk, start, end));
-  }
-
-  void addCharToString(int charCode) {
-    final StringBuffer buffer = this.buffer;
-    decoder.flush(buffer);
-    buffer.writeCharCode(charCode);
-  }
-
-  String endString() {
-    final StringBuffer buffer = this.buffer;
-    decoder.flush(buffer);
-    this.buffer = null;
-    return buffer.toString();
-  }
-
-  void copyCharsToList(int start, int end, List target, int offset) {
-    int length = end - start;
-    target.setRange(offset, offset + length, chunk, start);
-  }
-
-  double parseDouble(int start, int end) {
-    String string = getString(start, end, 0x7f);
-    return _parseDouble(string, 0, string.length);
-  }
-}
-
-double _parseDouble(String source, int start, int end) native "Double_parse";
-
-/**
- * Implements the chunked conversion from a UTF-8 encoding of JSON
- * to its corresponding object.
- */
-class _JsonUtf8DecoderSink extends ByteConversionSinkBase {
-  final _JsonUtf8Parser _parser;
-  final Sink<Object?> _sink;
-
-  _JsonUtf8DecoderSink(reviver, this._sink, bool allowMalformed)
-      : _parser = _createParser(reviver, allowMalformed);
-
-  static _JsonUtf8Parser _createParser(
-      Object? Function(Object? key, Object? value)? reviver,
-      bool allowMalformed) {
-    _BuildJsonListener listener;
-    if (reviver == null) {
-      listener = new _BuildJsonListener();
-    } else {
-      listener = new _ReviverJsonListener(reviver);
-    }
-    return new _JsonUtf8Parser(listener, allowMalformed);
-  }
-
-  void addSlice(List<int> chunk, int start, int end, bool isLast) {
-    _addChunk(chunk, start, end);
-    if (isLast) close();
-  }
-
-  void add(List<int> chunk) {
-    _addChunk(chunk, 0, chunk.length);
-  }
-
-  void _addChunk(List<int> chunk, int start, int end) {
-    _parser.chunk = chunk;
-    _parser.chunkEnd = end;
-    _parser.parse(start);
-  }
-
-  void close() {
-    _parser.close();
-    var decoded = _parser.result;
-    _sink.add(decoded);
-    _sink.close();
-  }
-}
-
-@patch
-class _Utf8Decoder {
-  /// Flags indicating presence of the various kinds of bytes in the input.
-  int _scanFlags = 0;
-
-  /// How many bytes of the BOM have been read so far. Set to -1 when the BOM
-  /// has been skipped (or was not present).
-  int _bomIndex = 0;
-
-  // Table for the scanning phase, which quickly scans through the input.
-  //
-  // Each input byte is looked up in the table, providing a size and some flags.
-  // The sizes are summed, and the flags are or'ed together.
-  //
-  // The resulting size and flags indicate:
-  // A) How many UTF-16 code units will be emitted by the decoding of this
-  //    input. This can be used to allocate a string of the correct length up
-  //    front.
-  // B) Which decoder and resulting string representation is appropriate. There
-  //    are three cases:
-  //    1) Pure ASCII (flags == 0): The input can simply be put into a
-  //       OneByteString without further decoding.
-  //    2) Latin1 (flags == (flagLatin1 | flagExtension)): The result can be
-  //       represented by a OneByteString, and the decoder can assume that only
-  //       Latin1 characters are present.
-  //    3) Arbitrary input (otherwise): Needs a full-featured decoder. Output
-  //       can be represented by a TwoByteString.
-
-  static const int sizeMask = 0x03;
-  static const int flagsMask = 0x3C;
-
-  static const int flagExtension = 1 << 2;
-  static const int flagLatin1 = 1 << 3;
-  static const int flagNonLatin1 = 1 << 4;
-  static const int flagIllegal = 1 << 5;
-
-  // ASCII     'A' = 64 + (1);
-  // Extension 'D' = 64 + (0 | flagExtension);
-  // Latin1    'I' = 64 + (1 | flagLatin1);
-  // BMP       'Q' = 64 + (1 | flagNonLatin1);
-  // Non-BMP   'R' = 64 + (2 | flagNonLatin1);
-  // Illegal   'a' = 64 + (1 | flagIllegal);
-  // Illegal   'b' = 64 + (2 | flagIllegal);
-  static const String scanTable = ""
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 00-1F
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 20-3F
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 40-5F
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 60-7F
-      "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" // 80-9F
-      "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" // A0-BF
-      "aaIIQQQQQQQQQQQQQQQQQQQQQQQQQQQQ" // C0-DF
-      "QQQQQQQQQQQQQQQQRRRRRbbbbbbbbbbb" // E0-FF
-      ;
-
-  /// Max chunk to scan at a time. Avoids staying away from safepoints too long.
-  static const int scanChunkSize = 65536;
-
-  /// Reset the decoder to a state where it is ready to decode a new string but
-  /// will not skip a leading BOM. Used by the fused UTF-8 / JSON decoder.
-  void reset() {
-    _state = initial;
-    _bomIndex = -1;
-  }
-
-  @pragma("vm:prefer-inline")
-  int scan(Uint8List bytes, int start, int end) {
-    // Assumes 0 <= start <= end <= bytes.length
-    int size = 0;
-    _scanFlags = 0;
-    int localStart = start;
-    while (end - localStart > scanChunkSize) {
-      int localEnd = localStart + scanChunkSize;
-      size += _scan(bytes, localStart, localEnd, scanTable);
-      localStart = localEnd;
-    }
-    size += _scan(bytes, localStart, end, scanTable);
-    return size;
-  }
-
-  // This method is recognized by the VM and compiled into specialized code.
-  @pragma("vm:prefer-inline")
-  int _scan(Uint8List bytes, int start, int end, String scanTable) {
-    int size = 0;
-    int flags = 0;
-    for (int i = start; i < end; i++) {
-      int t = scanTable.codeUnitAt(bytes[i]);
-      size += t & sizeMask;
-      flags |= t;
-    }
-    _scanFlags |= flags & flagsMask;
-    return size;
-  }
-
-  @pragma("vm:prefer-inline")
-  static bool _isNativeUint8List(List<int> array) {
-    final int cid = ClassID.getID(array);
-    return cid == ClassID.cidUint8ArrayView ||
-        cid == ClassID.cidUint8Array ||
-        cid == ClassID.cidExternalUint8Array;
-  }
-
-  // The VM decoder handles BOM explicitly instead of via the state machine.
-  @patch
-  _Utf8Decoder(this.allowMalformed) : _state = initial;
-
-  @patch
-  String convertSingle(List<int> codeUnits, int start, int? maybeEnd) {
-    int end = RangeError.checkValidRange(start, maybeEnd, codeUnits.length);
-
-    // Have bytes as Uint8List.
-    Uint8List bytes;
-    int errorOffset;
-    if (_isNativeUint8List(codeUnits)) {
-      bytes = unsafeCast<Uint8List>(codeUnits);
-      errorOffset = 0;
-    } else {
-      bytes = _makeUint8List(codeUnits, start, end);
-      errorOffset = start;
-      end -= start;
-      start = 0;
-    }
-
-    // Skip initial BOM.
-    start = skipBomSingle(bytes, start, end);
-
-    // Special case empty input.
-    if (start == end) return "";
-
-    // Scan input to determine size and appropriate decoder.
-    int size = scan(bytes, start, end);
-    int flags = _scanFlags;
-
-    if (flags == 0) {
-      // Pure ASCII.
-      assert(size == end - start);
-      String result = allocateOneByteString(size);
-      copyRangeFromUint8ListToOneByteString(bytes, result, start, 0, size);
-      return result;
-    }
-
-    String result;
-    if (flags == (flagLatin1 | flagExtension)) {
-      // Latin1.
-      result = decode8(bytes, start, end, size);
-    } else {
-      // Arbitrary Unicode.
-      result = decode16(bytes, start, end, size);
-    }
-    if (_state == accept) {
-      return result;
-    }
-
-    if (!allowMalformed) {
-      if (!isErrorState(_state)) {
-        // Unfinished sequence.
-        _state = errorUnfinished;
-        _charOrIndex = end;
-      }
-      final String message = errorDescription(_state);
-      throw FormatException(message, codeUnits, errorOffset + _charOrIndex);
-    }
-
-    // Start over on slow path.
-    _state = initial;
-    result = decodeGeneral(bytes, start, end, true);
-    assert(!isErrorState(_state));
-    return result;
-  }
-
-  @patch
-  String convertChunked(List<int> codeUnits, int start, int? maybeEnd) {
-    int end = RangeError.checkValidRange(start, maybeEnd, codeUnits.length);
-
-    // Have bytes as Uint8List.
-    Uint8List bytes;
-    int errorOffset;
-    if (_isNativeUint8List(codeUnits)) {
-      bytes = unsafeCast<Uint8List>(codeUnits);
-      errorOffset = 0;
-    } else {
-      bytes = _makeUint8List(codeUnits, start, end);
-      errorOffset = start;
-      end -= start;
-      start = 0;
-    }
-
-    // Skip initial BOM.
-    start = skipBomChunked(bytes, start, end);
-
-    // Special case empty input.
-    if (start == end) return "";
-
-    // Scan input to determine size and appropriate decoder.
-    int size = scan(bytes, start, end);
-    int flags = _scanFlags;
-
-    // Adjust scan flags and size based on carry-over state.
-    switch (_state) {
-      case IA:
-        break;
-      case X1:
-        flags |= _charOrIndex < (0x100 >> 6) ? flagLatin1 : flagNonLatin1;
-        if (end - start >= 1) {
-          size += _charOrIndex < (0x10000 >> 6) ? 1 : 2;
-        }
-        break;
-      case X2:
-        flags |= flagNonLatin1;
-        if (end - start >= 2) {
-          size += _charOrIndex < (0x10000 >> 12) ? 1 : 2;
-        }
-        break;
-      case TO:
-      case TS:
-        flags |= flagNonLatin1;
-        if (end - start >= 2) size += 1;
-        break;
-      case X3:
-      case QO:
-      case QR:
-        flags |= flagNonLatin1;
-        if (end - start >= 3) size += 2;
-        break;
-    }
-
-    if (flags == 0) {
-      // Pure ASCII.
-      assert(_state == accept);
-      assert(size == end - start);
-      String result = allocateOneByteString(size);
-      copyRangeFromUint8ListToOneByteString(bytes, result, start, 0, size);
-      return result;
-    }
-
-    // Do not include any final, incomplete character in size.
-    int extensionCount = 0;
-    int i = end - 1;
-    while (i >= start && (bytes[i] & 0xC0) == 0x80) {
-      extensionCount++;
-      i--;
-    }
-    if (i >= start && bytes[i] >= ((~0x3F >> extensionCount) & 0xFF)) {
-      size -= bytes[i] >= 0xF0 ? 2 : 1;
-    }
-
-    final int carryOverState = _state;
-    final int carryOverChar = _charOrIndex;
-    String result;
-    if (flags == (flagLatin1 | flagExtension)) {
-      // Latin1.
-      result = decode8(bytes, start, end, size);
-    } else {
-      // Arbitrary Unicode.
-      result = decode16(bytes, start, end, size);
-    }
-    if (!isErrorState(_state)) {
-      return result;
-    }
-    assert(_bomIndex == -1);
-
-    if (!allowMalformed) {
-      final String message = errorDescription(_state);
-      _state = initial; // Ready for more input.
-      throw FormatException(message, codeUnits, errorOffset + _charOrIndex);
-    }
-
-    // Start over on slow path.
-    _state = carryOverState;
-    _charOrIndex = carryOverChar;
-    result = decodeGeneral(bytes, start, end, false);
-    assert(!isErrorState(_state));
-    return result;
-  }
-
-  @pragma("vm:prefer-inline")
-  int skipBomSingle(Uint8List bytes, int start, int end) {
-    if (end - start >= 3 &&
-        bytes[start] == 0xEF &&
-        bytes[start + 1] == 0xBB &&
-        bytes[start + 2] == 0xBF) {
-      return start + 3;
-    }
-    return start;
-  }
-
-  @pragma("vm:prefer-inline")
-  int skipBomChunked(Uint8List bytes, int start, int end) {
-    assert(start <= end);
-    int bomIndex = _bomIndex;
-    // Already skipped?
-    if (bomIndex == -1) return start;
-
-    const bomValues = <int>[0xEF, 0xBB, 0xBF];
-    int i = start;
-    while (bomIndex < 3) {
-      if (i == end) {
-        // Unfinished BOM.
-        _bomIndex = bomIndex;
-        return start;
-      }
-      if (bytes[i++] != bomValues[bomIndex++]) {
-        // No BOM.
-        _bomIndex = -1;
-        return start;
-      }
-    }
-    // Complete BOM.
-    _bomIndex = -1;
-    _state = initial;
-    return i;
-  }
-
-  String decode8(Uint8List bytes, int start, int end, int size) {
-    assert(start < end);
-    String result = allocateOneByteString(size);
-    int i = start;
-    int j = 0;
-    if (_state == X1) {
-      // Half-way though 2-byte sequence
-      assert(_charOrIndex == 2 || _charOrIndex == 3);
-      final int e = bytes[i++] ^ 0x80;
-      if (e >= 0x40) {
-        _state = errorMissingExtension;
-        _charOrIndex = i - 1;
-        return "";
-      }
-      writeIntoOneByteString(result, j++, (_charOrIndex << 6) | e);
-      _state = accept;
-    }
-    assert(_state == accept);
-    while (i < end) {
-      int byte = bytes[i++];
-      if (byte >= 0x80) {
-        if (byte < 0xC0) {
-          _state = errorUnexpectedExtension;
-          _charOrIndex = i - 1;
-          return "";
-        }
-        assert(byte == 0xC2 || byte == 0xC3);
-        if (i == end) {
-          _state = X1;
-          _charOrIndex = byte & 0x1F;
-          break;
-        }
-        final int e = bytes[i++] ^ 0x80;
-        if (e >= 0x40) {
-          _state = errorMissingExtension;
-          _charOrIndex = i - 1;
-          return "";
-        }
-        byte = (byte << 6) | e;
-      }
-      writeIntoOneByteString(result, j++, byte);
-    }
-    // Output size must match, unless we are doing single conversion and are
-    // inside an unfinished sequence (which will trigger an error later).
-    assert(_bomIndex == 0 && _state != accept
-        ? (j == size - 1 || j == size - 2)
-        : (j == size));
-    return result;
-  }
-
-  String decode16(Uint8List bytes, int start, int end, int size) {
-    assert(start < end);
-    final String typeTable = _Utf8Decoder.typeTable;
-    final String transitionTable = _Utf8Decoder.transitionTable;
-    String result = allocateTwoByteString(size);
-    int i = start;
-    int j = 0;
-    int state = _state;
-    int char;
-
-    // First byte
-    assert(!isErrorState(state));
-    final int byte = bytes[i++];
-    final int type = typeTable.codeUnitAt(byte) & typeMask;
-    if (state == accept) {
-      char = byte & (shiftedByteMask >> type);
-      state = transitionTable.codeUnitAt(type);
-    } else {
-      char = (byte & 0x3F) | (_charOrIndex << 6);
-      state = transitionTable.codeUnitAt(state + type);
-    }
-
-    while (i < end) {
-      final int byte = bytes[i++];
-      final int type = typeTable.codeUnitAt(byte) & typeMask;
-      if (state == accept) {
-        if (char >= 0x10000) {
-          assert(char < 0x110000);
-          writeIntoTwoByteString(result, j++, 0xD7C0 + (char >> 10));
-          writeIntoTwoByteString(result, j++, 0xDC00 + (char & 0x3FF));
-        } else {
-          writeIntoTwoByteString(result, j++, char);
-        }
-        char = byte & (shiftedByteMask >> type);
-        state = transitionTable.codeUnitAt(type);
-      } else if (isErrorState(state)) {
-        _state = state;
-        _charOrIndex = i - 2;
-        return "";
-      } else {
-        char = (byte & 0x3F) | (char << 6);
-        state = transitionTable.codeUnitAt(state + type);
-      }
-    }
-
-    // Final write?
-    if (state == accept) {
-      if (char >= 0x10000) {
-        assert(char < 0x110000);
-        writeIntoTwoByteString(result, j++, 0xD7C0 + (char >> 10));
-        writeIntoTwoByteString(result, j++, 0xDC00 + (char & 0x3FF));
-      } else {
-        writeIntoTwoByteString(result, j++, char);
-      }
-    } else if (isErrorState(state)) {
-      _state = state;
-      _charOrIndex = end - 1;
-      return "";
-    }
-
-    _state = state;
-    _charOrIndex = char;
-    // Output size must match, unless we are doing single conversion and are
-    // inside an unfinished sequence (which will trigger an error later).
-    assert(_bomIndex == 0 && _state != accept
-        ? (j == size - 1 || j == size - 2)
-        : (j == size));
-    return result;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/core_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/core_patch.dart
deleted file mode 100644
index 2133763..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/core_patch.dart
+++ /dev/null
@@ -1,207 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:core" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal" as internal show Symbol;
-
-import "dart:_internal"
-    show
-        allocateOneByteString,
-        allocateTwoByteString,
-        ClassID,
-        CodeUnits,
-        copyRangeFromUint8ListToOneByteString,
-        EfficientLengthIterable,
-        FixedLengthListBase,
-        IterableElementError,
-        ListIterator,
-        Lists,
-        POWERS_OF_TEN,
-        SubListIterable,
-        UnmodifiableListBase,
-        is64Bit,
-        makeFixedListUnmodifiable,
-        makeListFixedLength,
-        patch,
-        unsafeCast,
-        writeIntoOneByteString,
-        writeIntoTwoByteString;
-
-import "dart:async" show Completer, Future, Timer;
-
-import "dart:collection"
-    show
-        HashMap,
-        IterableBase,
-        LinkedHashMap,
-        LinkedList,
-        LinkedListEntry,
-        ListBase,
-        MapBase,
-        Maps,
-        UnmodifiableMapBase,
-        UnmodifiableMapView;
-
-import "dart:convert" show ascii, Encoding, json, latin1, utf8;
-
-import "dart:isolate" show Isolate;
-
-import "dart:math" show Random;
-
-import "dart:typed_data"
-    show Endian, Uint8List, Int64List, Uint16List, Uint32List;
-
-/// These are the additional parts of this patch library:
-// part "array.dart";
-// part "array_patch.dart";
-// part "bigint_patch.dart";
-// part "bool_patch.dart";
-// part "date_patch.dart";
-// part "double.dart";
-// part "double_patch.dart";
-// part "errors_patch.dart";
-// part "expando_patch.dart";
-// part "function.dart";
-// part "function_patch.dart";
-// part "growable_array.dart";
-// part "identical_patch.dart";
-// part "immutable_map.dart";
-// part "integers.dart";
-// part "integers_patch.dart";
-// part "invocation_mirror_patch.dart";
-// part "lib_prefix.dart";
-// part "map_patch.dart";
-// part "null_patch.dart";
-// part "object_patch.dart";
-// part "regexp_patch.dart";
-// part "stacktrace.dart";
-// part "stopwatch_patch.dart";
-// part "string_buffer_patch.dart";
-// part "string_patch.dart";
-// part "type_patch.dart";
-// part "uri_patch.dart";
-// part "weak_property.dart";
-
-@patch
-class num {
-  num _addFromInteger(int other);
-  num _subFromInteger(int other);
-  num _mulFromInteger(int other);
-  int _truncDivFromInteger(int other);
-  num _moduloFromInteger(int other);
-  num _remainderFromInteger(int other);
-  bool _greaterThanFromInteger(int other);
-  bool _equalToInteger(int other);
-}
-
-// _SyncIterable and _syncIterator are used by the compiler to
-// implement sync* generator functions. A sync* generator allocates
-// and returns a new _SyncIterable object.
-
-typedef _SyncGeneratorCallback<T> = bool Function(_SyncIterator<T>);
-typedef _SyncGeneratorCallbackCallback<T> = _SyncGeneratorCallback<T>
-    Function();
-
-class _SyncIterable<T> extends IterableBase<T> {
-  // Closure that effectively "clones" the inner _moveNextFn.
-  // This means a _SyncIterable creates _SyncIterators that do not share state.
-  final _SyncGeneratorCallbackCallback<T> _moveNextFnMaker;
-
-  const _SyncIterable(this._moveNextFnMaker);
-
-  Iterator<T> get iterator {
-    return _SyncIterator<T>(_moveNextFnMaker());
-  }
-}
-
-class _SyncIterator<T> implements Iterator<T> {
-  _SyncGeneratorCallback<T>? _moveNextFn;
-  Iterator<T>? _yieldEachIterator;
-
-  // Stack of suspended _moveNextFn.
-  List<_SyncGeneratorCallback<T>>? _stack;
-
-  // These two fields are set by generated code for the yield and yield*
-  // statement.
-  T? _current;
-  Iterable<T>? _yieldEachIterable;
-
-  @override
-  T get current {
-    final iterator = _yieldEachIterator;
-    if (iterator != null) {
-      return iterator.current;
-    } else {
-      final cur = _current;
-      return (cur != null) ? cur : cur as T;
-    }
-  }
-
-  _SyncIterator(this._moveNextFn);
-
-  @override
-  bool moveNext() {
-    if (_moveNextFn == null) {
-      return false;
-    }
-
-    while (true) {
-      // If the active iterator isn't a nested _SyncIterator, we have to
-      // delegate downwards from the immediate iterator.
-      final iterator = _yieldEachIterator;
-      if (iterator != null) {
-        if (iterator.moveNext()) {
-          return true;
-        }
-        _yieldEachIterator = null;
-      }
-
-      final stack = _stack;
-      if (!_moveNextFn!.call(this)) {
-        _moveNextFn = null;
-        _current = null;
-        // If we have any suspended parent generators, continue next one up:
-        if (stack != null && stack.isNotEmpty) {
-          _moveNextFn = stack.removeLast();
-          continue;
-        }
-        return false;
-      }
-
-      final iterable = _yieldEachIterable;
-      if (iterable != null) {
-        if (iterable is _SyncIterable) {
-          // We got a recursive yield* of sync* function. Instead of creating
-          // a new iterator we replace our _moveNextFn (remembering the
-          // current _moveNextFn for later resumption).
-          if (stack == null) {
-            _stack = [];
-          }
-          _stack!.add(_moveNextFn!);
-          final typedIterable = unsafeCast<_SyncIterable<T>>(iterable);
-          _moveNextFn = typedIterable._moveNextFnMaker();
-        } else {
-          _yieldEachIterator = iterable.iterator;
-        }
-        _yieldEachIterable = null;
-        _current = null;
-
-        // Fetch the next item.
-        continue;
-      }
-
-      return true;
-    }
-  }
-}
-
-@patch
-class StackTrace {
-  @patch
-  static StackTrace get current native "StackTrace_current";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/date_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/date_patch.dart
deleted file mode 100644
index ee3b5a3..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/date_patch.dart
+++ /dev/null
@@ -1,446 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-// VM implementation of DateTime.
-@patch
-class DateTime {
-  // Natives.
-  // The natives have been moved up here to work around Issue 10401.
-  static int _getCurrentMicros() native "DateTime_currentTimeMicros";
-
-  static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch)
-      native "DateTime_timeZoneName";
-
-  static int _timeZoneOffsetInSecondsForClampedSeconds(int secondsSinceEpoch)
-      native "DateTime_timeZoneOffsetInSeconds";
-
-  static int _localTimeZoneAdjustmentInSeconds()
-      native "DateTime_localTimeZoneAdjustmentInSeconds";
-
-  static const _MICROSECOND_INDEX = 0;
-  static const _MILLISECOND_INDEX = 1;
-  static const _SECOND_INDEX = 2;
-  static const _MINUTE_INDEX = 3;
-  static const _HOUR_INDEX = 4;
-  static const _DAY_INDEX = 5;
-  static const _WEEKDAY_INDEX = 6;
-  static const _MONTH_INDEX = 7;
-  static const _YEAR_INDEX = 8;
-
-  List? __parts;
-
-  @patch
-  DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
-      {bool isUtc: false})
-      : this._withValue(
-            millisecondsSinceEpoch * Duration.microsecondsPerMillisecond,
-            isUtc: isUtc);
-
-  @patch
-  DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch,
-      {bool isUtc: false})
-      : this._withValue(microsecondsSinceEpoch, isUtc: isUtc);
-
-  @patch
-  DateTime._internal(int year, int month, int day, int hour, int minute,
-      int second, int millisecond, int microsecond, bool isUtc)
-      : this.isUtc = isUtc,
-        this._value = _brokenDownDateToValue(year, month, day, hour, minute,
-                second, millisecond, microsecond, isUtc) ??
-            -1 {
-    if (_value == -1) throw new ArgumentError();
-    if (isUtc == null) throw new ArgumentError();
-  }
-
-  @patch
-  DateTime._now()
-      : isUtc = false,
-        _value = _getCurrentMicros();
-
-  @patch
-  String get timeZoneName {
-    if (isUtc) return "UTC";
-    return _timeZoneName(microsecondsSinceEpoch);
-  }
-
-  @patch
-  Duration get timeZoneOffset {
-    if (isUtc) return new Duration();
-    int offsetInSeconds = _timeZoneOffsetInSeconds(microsecondsSinceEpoch);
-    return new Duration(seconds: offsetInSeconds);
-  }
-
-  @patch
-  bool operator ==(dynamic other) =>
-      other is DateTime &&
-      _value == other.microsecondsSinceEpoch &&
-      isUtc == other.isUtc;
-
-  @patch
-  bool isBefore(DateTime other) => _value < other.microsecondsSinceEpoch;
-
-  @patch
-  bool isAfter(DateTime other) => _value > other.microsecondsSinceEpoch;
-
-  @patch
-  bool isAtSameMomentAs(DateTime other) =>
-      _value == other.microsecondsSinceEpoch;
-
-  @patch
-  int compareTo(DateTime other) =>
-      _value.compareTo(other.microsecondsSinceEpoch);
-
-  /** The first list contains the days until each month in non-leap years. The
-    * second list contains the days in leap years. */
-  static const List<List<int>> _DAYS_UNTIL_MONTH = const [
-    const [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],
-    const [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]
-  ];
-
-  static List<int> _computeUpperPart(int localMicros) {
-    const int DAYS_IN_4_YEARS = 4 * 365 + 1;
-    const int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
-    const int DAYS_IN_400_YEARS = 4 * DAYS_IN_100_YEARS + 1;
-    const int DAYS_1970_TO_2000 = 30 * 365 + 7;
-    const int DAYS_OFFSET =
-        1000 * DAYS_IN_400_YEARS + 5 * DAYS_IN_400_YEARS - DAYS_1970_TO_2000;
-    const int YEARS_OFFSET = 400000;
-
-    int resultYear = 0;
-    int resultMonth = 0;
-    int resultDay = 0;
-
-    // Always round down.
-    final int daysSince1970 =
-        _flooredDivision(localMicros, Duration.microsecondsPerDay);
-    int days = daysSince1970;
-    days += DAYS_OFFSET;
-    resultYear = 400 * (days ~/ DAYS_IN_400_YEARS) - YEARS_OFFSET;
-    days = unsafeCast<int>(days.remainder(DAYS_IN_400_YEARS));
-    days--;
-    int yd1 = days ~/ DAYS_IN_100_YEARS;
-    days = unsafeCast<int>(days.remainder(DAYS_IN_100_YEARS));
-    resultYear += 100 * yd1;
-    days++;
-    int yd2 = days ~/ DAYS_IN_4_YEARS;
-    days = unsafeCast<int>(days.remainder(DAYS_IN_4_YEARS));
-    resultYear += 4 * yd2;
-    days--;
-    int yd3 = days ~/ 365;
-    days = unsafeCast<int>(days.remainder(365));
-    resultYear += yd3;
-
-    bool isLeap = (yd1 == 0 || yd2 != 0) && yd3 == 0;
-    if (isLeap) days++;
-
-    List<int> daysUntilMonth = _DAYS_UNTIL_MONTH[isLeap ? 1 : 0];
-    for (resultMonth = 12;
-        daysUntilMonth[resultMonth - 1] > days;
-        resultMonth--) {
-      // Do nothing.
-    }
-    resultDay = days - daysUntilMonth[resultMonth - 1] + 1;
-
-    int resultMicrosecond = localMicros % Duration.microsecondsPerMillisecond;
-    int resultMillisecond =
-        _flooredDivision(localMicros, Duration.microsecondsPerMillisecond) %
-            Duration.millisecondsPerSecond;
-    int resultSecond =
-        _flooredDivision(localMicros, Duration.microsecondsPerSecond) %
-            Duration.secondsPerMinute;
-
-    int resultMinute =
-        _flooredDivision(localMicros, Duration.microsecondsPerMinute);
-    resultMinute %= Duration.minutesPerHour;
-
-    int resultHour =
-        _flooredDivision(localMicros, Duration.microsecondsPerHour);
-    resultHour %= Duration.hoursPerDay;
-
-    // In accordance with ISO 8601 a week
-    // starts with Monday. Monday has the value 1 up to Sunday with 7.
-    // 1970-1-1 was a Thursday.
-    int resultWeekday = ((daysSince1970 + DateTime.thursday - DateTime.monday) %
-            DateTime.daysPerWeek) +
-        DateTime.monday;
-
-    List<int> list = new List<int>.filled(_YEAR_INDEX + 1, 0);
-    list[_MICROSECOND_INDEX] = resultMicrosecond;
-    list[_MILLISECOND_INDEX] = resultMillisecond;
-    list[_SECOND_INDEX] = resultSecond;
-    list[_MINUTE_INDEX] = resultMinute;
-    list[_HOUR_INDEX] = resultHour;
-    list[_DAY_INDEX] = resultDay;
-    list[_WEEKDAY_INDEX] = resultWeekday;
-    list[_MONTH_INDEX] = resultMonth;
-    list[_YEAR_INDEX] = resultYear;
-    return list;
-  }
-
-  get _parts {
-    return __parts ??= _computeUpperPart(_localDateInUtcMicros);
-  }
-
-  @patch
-  DateTime add(Duration duration) {
-    return new DateTime._withValue(_value + duration.inMicroseconds,
-        isUtc: isUtc);
-  }
-
-  @patch
-  DateTime subtract(Duration duration) {
-    return new DateTime._withValue(_value - duration.inMicroseconds,
-        isUtc: isUtc);
-  }
-
-  @patch
-  Duration difference(DateTime other) {
-    return new Duration(microseconds: _value - other._value);
-  }
-
-  @patch
-  int get millisecondsSinceEpoch =>
-      _value ~/ Duration.microsecondsPerMillisecond;
-
-  @patch
-  int get microsecondsSinceEpoch => _value;
-
-  @patch
-  int get microsecond => _parts[_MICROSECOND_INDEX];
-
-  @patch
-  int get millisecond => _parts[_MILLISECOND_INDEX];
-
-  @patch
-  int get second => _parts[_SECOND_INDEX];
-
-  @patch
-  int get minute => _parts[_MINUTE_INDEX];
-
-  @patch
-  int get hour => _parts[_HOUR_INDEX];
-
-  @patch
-  int get day => _parts[_DAY_INDEX];
-
-  @patch
-  int get weekday => _parts[_WEEKDAY_INDEX];
-
-  @patch
-  int get month => _parts[_MONTH_INDEX];
-
-  @patch
-  int get year => _parts[_YEAR_INDEX];
-
-  /**
-   * Returns the amount of microseconds in UTC that represent the same values
-   * as [this].
-   *
-   * Say `t` is the result of this function, then
-   * * `this.year == new DateTime.fromMicrosecondsSinceEpoch(t, true).year`,
-   * * `this.month == new DateTime.fromMicrosecondsSinceEpoch(t, true).month`,
-   * * `this.day == new DateTime.fromMicrosecondsSinceEpoch(t, true).day`,
-   * * `this.hour == new DateTime.fromMicrosecondsSinceEpoch(t, true).hour`,
-   * * ...
-   *
-   * Daylight savings is computed as if the date was computed in [1970..2037].
-   * If [this] lies outside this range then it is a year with similar
-   * properties (leap year, weekdays) is used instead.
-   */
-  int get _localDateInUtcMicros {
-    int micros = _value;
-    if (isUtc) return micros;
-    int offset =
-        _timeZoneOffsetInSeconds(micros) * Duration.microsecondsPerSecond;
-    return micros + offset;
-  }
-
-  static int _flooredDivision(int a, int b) {
-    return (a - (a < 0 ? b - 1 : 0)) ~/ b;
-  }
-
-  // Returns the days since 1970 for the start of the given [year].
-  // [year] may be before epoch.
-  static int _dayFromYear(int year) {
-    return 365 * (year - 1970) +
-        _flooredDivision(year - 1969, 4) -
-        _flooredDivision(year - 1901, 100) +
-        _flooredDivision(year - 1601, 400);
-  }
-
-  static bool _isLeapYear(y) {
-    // (y % 16 == 0) matches multiples of 400, and is faster than % 400.
-    return (y % 4 == 0) && ((y % 16 == 0) || (y % 100 != 0));
-  }
-
-  /// Converts the given broken down date to microseconds.
-  @patch
-  static int? _brokenDownDateToValue(int year, int month, int day, int hour,
-      int minute, int second, int millisecond, int microsecond, bool isUtc) {
-    // Simplify calculations by working with zero-based month.
-    --month;
-    // Deal with under and overflow.
-    if (month >= 12) {
-      year += month ~/ 12;
-      month = month % 12;
-    } else if (month < 0) {
-      int realMonth = month % 12;
-      year += (month - realMonth) ~/ 12;
-      month = realMonth;
-    }
-
-    // First compute the seconds in UTC, independent of the [isUtc] flag. If
-    // necessary we will add the time-zone offset later on.
-    int days = day - 1;
-    days += _DAYS_UNTIL_MONTH[_isLeapYear(year) ? 1 : 0][month];
-    days += _dayFromYear(year);
-    int microsecondsSinceEpoch = days * Duration.microsecondsPerDay +
-        hour * Duration.microsecondsPerHour +
-        minute * Duration.microsecondsPerMinute +
-        second * Duration.microsecondsPerSecond +
-        millisecond * Duration.microsecondsPerMillisecond +
-        microsecond;
-
-    // Since [_timeZoneOffsetInSeconds] will crash if the input is far out of
-    // the valid range we do a preliminary test that weeds out values that can
-    // not become valid even with timezone adjustments.
-    // The timezone adjustment is always less than a day, so adding a security
-    // margin of one day should be enough.
-    if (microsecondsSinceEpoch.abs() >
-        _maxMillisecondsSinceEpoch * 1000 + Duration.microsecondsPerDay) {
-      return null;
-    }
-
-    if (!isUtc) {
-      // Note that we can't literally follow the ECMAScript spec (which this
-      // code is based on), because it leads to incorrect computations at
-      // the DST transition points.
-      //
-      // See V8's comment here:
-      // https://github.com/v8/v8/blob/089dd7d2447d6eaf57c8ba6d8f37957f3a269777/src/date.h#L118
-
-      // We need to remove the local timezone adjustment before asking for the
-      // correct zone offset.
-      int adjustment =
-          _localTimeZoneAdjustmentInSeconds() * Duration.microsecondsPerSecond;
-      // The adjustment is independent of the actual date and of the daylight
-      // saving time. It is positive east of the Prime Meridian and negative
-      // west of it, e.g. -28800 sec for America/Los_Angeles timezone.
-
-      // We remove one hour to ensure that we have the correct offset at
-      // DST transitioning points. This is a temporary solution and only
-      // correct in timezones that shift for exactly one hour.
-      adjustment += Duration.microsecondsPerHour;
-      int zoneOffset =
-          _timeZoneOffsetInSeconds(microsecondsSinceEpoch - adjustment);
-
-      // The zoneOffset depends on the actual date and reflects any daylight
-      // saving time and/or historical deviation relative to UTC time.
-      // It is positive east of the Prime Meridian and negative west of it,
-      // e.g. -25200 sec for America/Los_Angeles timezone during DST.
-      microsecondsSinceEpoch -= zoneOffset * Duration.microsecondsPerSecond;
-      // The resulting microsecondsSinceEpoch value is therefore the calculated
-      // UTC value decreased by a (positive if east of GMT) timezone adjustment
-      // and decreased by typically one hour if DST is in effect.
-    }
-    if (microsecondsSinceEpoch.abs() >
-        _maxMillisecondsSinceEpoch * Duration.microsecondsPerMillisecond) {
-      return null;
-    }
-    return microsecondsSinceEpoch;
-  }
-
-  static int _weekDay(y) {
-    // 1/1/1970 was a Thursday.
-    return (_dayFromYear(y) + 4) % 7;
-  }
-
-  /**
-   * Returns a year in the range 2008-2035 matching
-   * * leap year, and
-   * * week day of first day.
-   *
-   * Leap seconds are ignored.
-   * Adapted from V8's date implementation. See ECMA 262 - 15.9.1.9.
-   */
-  static int _equivalentYear(int year) {
-    // Returns year y so that _weekDay(y) == _weekDay(year).
-    // _weekDay returns the week day (in range 0 - 6).
-    // 1/1/1956 was a Sunday (i.e. weekday 0). 1956 was a leap-year.
-    // 1/1/1967 was a Sunday (i.e. weekday 0).
-    // Without leap years a subsequent year has a week day + 1 (for example
-    // 1/1/1968 was a Monday). With leap-years it jumps over one week day
-    // (e.g. 1/1/1957 was a Tuesday).
-    // After 12 years the weekdays have advanced by 12 days + 3 leap days =
-    // 15 days. 15 % 7 = 1. So after 12 years the week day has always
-    // (now independently of leap-years) advanced by one.
-    // weekDay * 12 gives thus a year starting with the wanted weekDay.
-    int recentYear = (_isLeapYear(year) ? 1956 : 1967) + (_weekDay(year) * 12);
-    // Close to the year 2008 the calendar cycles every 4 * 7 years (4 for the
-    // leap years, 7 for the weekdays).
-    // Find the year in the range 2008..2037 that is equivalent mod 28.
-    return 2008 + (recentYear - 2008) % 28;
-  }
-
-  /**
-   * Returns the UTC year for the corresponding [secondsSinceEpoch].
-   * It is relatively fast for values in the range 0 to year 2098.
-   *
-   * Code is adapted from V8.
-   */
-  static int _yearsFromSecondsSinceEpoch(int secondsSinceEpoch) {
-    const int DAYS_IN_4_YEARS = 4 * 365 + 1;
-    const int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
-    const int DAYS_YEAR_2098 = DAYS_IN_100_YEARS + 6 * DAYS_IN_4_YEARS;
-
-    int days = secondsSinceEpoch ~/ Duration.secondsPerDay;
-    if (days > 0 && days < DAYS_YEAR_2098) {
-      // According to V8 this fast case works for dates from 1970 to 2099.
-      return 1970 + (4 * days + 2) ~/ DAYS_IN_4_YEARS;
-    }
-    int micros = secondsSinceEpoch * Duration.microsecondsPerSecond;
-    return _computeUpperPart(micros)[_YEAR_INDEX];
-  }
-
-  /**
-   * Returns a date in seconds that is equivalent to the given
-   * date in microseconds [microsecondsSinceEpoch]. An equivalent
-   * date has the same fields (`month`, `day`, etc.) as the given
-   * date, but the `year` is in the range [1901..2038].
-   *
-   * * The time since the beginning of the year is the same.
-   * * If the given date is in a leap year then the returned
-   *   seconds are in a leap year, too.
-   * * The week day of given date is the same as the one for the
-   *   returned date.
-   */
-  static int _equivalentSeconds(int microsecondsSinceEpoch) {
-    const int CUT_OFF_SECONDS = 0x7FFFFFFF;
-
-    int secondsSinceEpoch = _flooredDivision(
-        microsecondsSinceEpoch, Duration.microsecondsPerSecond);
-
-    if (secondsSinceEpoch.abs() > CUT_OFF_SECONDS) {
-      int year = _yearsFromSecondsSinceEpoch(secondsSinceEpoch);
-      int days = _dayFromYear(year);
-      int equivalentYear = _equivalentYear(year);
-      int equivalentDays = _dayFromYear(equivalentYear);
-      int diffDays = equivalentDays - days;
-      secondsSinceEpoch += diffDays * Duration.secondsPerDay;
-    }
-    return secondsSinceEpoch;
-  }
-
-  static int _timeZoneOffsetInSeconds(int microsecondsSinceEpoch) {
-    int equivalentSeconds = _equivalentSeconds(microsecondsSinceEpoch);
-    return _timeZoneOffsetInSecondsForClampedSeconds(equivalentSeconds);
-  }
-
-  static String _timeZoneName(int microsecondsSinceEpoch) {
-    int equivalentSeconds = _equivalentSeconds(microsecondsSinceEpoch);
-    return _timeZoneNameForClampedSeconds(equivalentSeconds);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/deferred_load_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/deferred_load_patch.dart
deleted file mode 100644
index 3f3cf12..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/deferred_load_patch.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "async_patch.dart";
-
-final Set<String> _loadedLibraries = new Set<String>();
-
-@patch
-class DeferredLibrary {
-  @patch
-  Future<Null> load() {
-    // Dummy implementation that should eventually be replaced by real
-    // implementation.
-    Future<Null> future = new Future<Null>.value(null);
-    _loadedLibraries.add(libraryName);
-    return future;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/developer.dart b/sdk_nnbd/lib/_internal/vm/lib/developer.dart
deleted file mode 100644
index d9c87a8..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/developer.dart
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:developer" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal" show patch;
-
-import "dart:async" show Future, Zone;
-
-import "dart:isolate" show SendPort;
-
-/// These are the additional parts of this patch library:
-// part "profiler.dart"
-// part "timeline.dart"
-
-@patch
-bool debugger({bool when: true, String? message}) native "Developer_debugger";
-
-@patch
-Object inspect(Object object) native "Developer_inspect";
-
-@patch
-void log(String message,
-    {DateTime? time,
-    int? sequenceNumber,
-    int level: 0,
-    String name: '',
-    Zone? zone,
-    Object? error,
-    StackTrace? stackTrace}) {
-  if (message is! String) {
-    throw new ArgumentError.value(message, "message", "Must be a String");
-  }
-  time ??= new DateTime.now();
-  if (time is! DateTime) {
-    throw new ArgumentError.value(time, "time", "Must be a DateTime");
-  }
-  if (sequenceNumber == null) {
-    sequenceNumber = _nextSequenceNumber++;
-  } else {
-    _nextSequenceNumber = sequenceNumber + 1;
-  }
-  _log(message, time.millisecondsSinceEpoch, sequenceNumber, level, name, zone,
-      error, stackTrace);
-}
-
-int _nextSequenceNumber = 0;
-
-_log(String message, int timestamp, int sequenceNumber, int level, String name,
-    Zone? zone, Object? error, StackTrace? stackTrace) native "Developer_log";
-
-@patch
-void _postEvent(String eventKind, String eventData)
-    native "Developer_postEvent";
-
-@patch
-ServiceExtensionHandler? _lookupExtension(String method)
-    native "Developer_lookupExtension";
-
-@patch
-_registerExtension(String method, ServiceExtensionHandler handler)
-    native "Developer_registerExtension";
-
-// This code is only invoked when there is no other Dart code on the stack.
-@pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
-_runExtension(
-    ServiceExtensionHandler handler,
-    String method,
-    List<String> parameterKeys,
-    List<String> parameterValues,
-    SendPort replyPort,
-    Object id,
-    bool trace_service) {
-  var parameters = <String, String>{};
-  for (var i = 0; i < parameterKeys.length; i++) {
-    parameters[parameterKeys[i]] = parameterValues[i];
-  }
-  var response;
-  try {
-    response = handler(method, parameters);
-  } catch (e, st) {
-    var errorDetails = (st == null) ? '$e' : '$e\n$st';
-    response = new ServiceExtensionResponse.error(
-        ServiceExtensionResponse.kExtensionError, errorDetails);
-    _postResponse(replyPort, id, response, trace_service);
-    return;
-  }
-  if (response is! Future) {
-    response = new ServiceExtensionResponse.error(
-        ServiceExtensionResponse.kExtensionError,
-        "Extension handler must return a Future");
-    _postResponse(replyPort, id, response, trace_service);
-    return;
-  }
-  response.catchError((e, st) {
-    // Catch any errors eagerly and wrap them in a ServiceExtensionResponse.
-    var errorDetails = (st == null) ? '$e' : '$e\n$st';
-    return new ServiceExtensionResponse.error(
-        ServiceExtensionResponse.kExtensionError, errorDetails);
-  }).then((response) {
-    // Post the valid response or the wrapped error after verifying that
-    // the response is a ServiceExtensionResponse.
-    if (response is! ServiceExtensionResponse) {
-      response = new ServiceExtensionResponse.error(
-          ServiceExtensionResponse.kExtensionError,
-          "Extension handler must complete to a ServiceExtensionResponse");
-    }
-    _postResponse(replyPort, id, response, trace_service);
-  }).catchError((e, st) {
-    // We do not expect any errors to occur in the .then or .catchError blocks
-    // but, suppress them just in case.
-  });
-}
-
-// This code is only invoked by _runExtension.
-_postResponse(SendPort replyPort, Object id, ServiceExtensionResponse response,
-    bool trace_service) {
-  assert(replyPort != null);
-  if (id == null) {
-    if (trace_service) {
-      print("vm-service: posting no response for request");
-    }
-    // No id -> no response.
-    replyPort.send(null);
-    return;
-  }
-  assert(id != null);
-  StringBuffer sb = new StringBuffer();
-  sb.write('{"jsonrpc":"2.0",');
-  if (response.isError()) {
-    if (trace_service) {
-      print("vm-service: posting error response for request $id");
-    }
-    sb.write('"error":');
-  } else {
-    if (trace_service) {
-      print("vm-service: posting response for request $id");
-    }
-    sb.write('"result":');
-  }
-  sb.write('${response._toString()},');
-  if (id is String) {
-    sb.write('"id":"$id"}');
-  } else {
-    sb.write('"id":$id}');
-  }
-  replyPort.send(sb.toString());
-}
-
-@patch
-int _getServiceMajorVersion() native "Developer_getServiceMajorVersion";
-
-@patch
-int _getServiceMinorVersion() native "Developer_getServiceMinorVersion";
-
-@patch
-void _getServerInfo(SendPort sendPort) native "Developer_getServerInfo";
-
-@patch
-void _webServerControl(SendPort sendPort, bool enable)
-    native "Developer_webServerControl";
-
-@patch
-String _getIsolateIDFromSendPort(SendPort sendPort)
-    native "Developer_getIsolateIDFromSendPort";
diff --git a/sdk_nnbd/lib/_internal/vm/lib/double.dart b/sdk_nnbd/lib/_internal/vm/lib/double.dart
deleted file mode 100644
index 83b3262..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/double.dart
+++ /dev/null
@@ -1,360 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@pragma("vm:entry-point")
-class _Double implements double {
-  @pragma("vm:exact-result-type", _Double)
-  factory _Double.fromInteger(int value) native "Double_doubleFromInteger";
-
-  int get hashCode native "Double_hashCode";
-  int get _identityHashCode native "Double_hashCode";
-
-  @pragma("vm:exact-result-type", _Double)
-  @pragma("vm:never-inline")
-  double operator +(num other) {
-    return _add(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", _Double)
-  double _add(double other) native "Double_add";
-
-  @pragma("vm:exact-result-type", _Double)
-  @pragma("vm:never-inline")
-  double operator -(num other) {
-    return _sub(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", _Double)
-  double _sub(double other) native "Double_sub";
-
-  @pragma("vm:exact-result-type", _Double)
-  @pragma("vm:never-inline")
-  double operator *(num other) {
-    return _mul(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", _Double)
-  double _mul(double other) native "Double_mul";
-
-  int operator ~/(num other) {
-    return _trunc_div(other.toDouble());
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  int _trunc_div(double other) native "Double_trunc_div";
-
-  @pragma("vm:exact-result-type", _Double)
-  @pragma("vm:never-inline")
-  double operator /(num other) {
-    return _div(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", _Double)
-  double _div(double other) native "Double_div";
-
-  double operator %(num other) {
-    return _modulo(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", _Double)
-  double _modulo(double other) native "Double_modulo";
-
-  double remainder(num other) {
-    return _remainder(other.toDouble());
-  }
-
-  double _remainder(double other) native "Double_remainder";
-
-  @pragma("vm:exact-result-type", _Double)
-  double operator -() native "Double_flipSignBit";
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator ==(Object other) {
-    return (other is num) && _equal(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool _equal(double other) native "Double_equal";
-  @pragma("vm:exact-result-type", bool)
-  bool _equalToInteger(int other) native "Double_equalToInteger";
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator <(num other) {
-    return other > this;
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator >(num other) {
-    return _greaterThan(other.toDouble());
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool _greaterThan(double other) native "Double_greaterThan";
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator >=(num other) {
-    return (this == other) || (this > other);
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator <=(num other) {
-    return (this == other) || (this < other);
-  }
-
-  double _addFromInteger(int other) {
-    return new _Double.fromInteger(other)._add(this);
-  }
-
-  double _subFromInteger(int other) {
-    return new _Double.fromInteger(other)._sub(this);
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double _mulFromInteger(int other) {
-    return new _Double.fromInteger(other)._mul(this);
-  }
-
-  int _truncDivFromInteger(int other) {
-    return new _Double.fromInteger(other)._trunc_div(this);
-  }
-
-  double _moduloFromInteger(int other) {
-    return new _Double.fromInteger(other)._modulo(this);
-  }
-
-  double _remainderFromInteger(int other) {
-    return new _Double.fromInteger(other)._remainder(this);
-  }
-
-  bool _greaterThanFromInteger(int other)
-      native "Double_greaterThanFromInteger";
-
-  @pragma("vm:exact-result-type", bool)
-  bool get isNegative native "Double_getIsNegative";
-  @pragma("vm:exact-result-type", bool)
-  bool get isInfinite native "Double_getIsInfinite";
-  @pragma("vm:exact-result-type", bool)
-  bool get isNaN native "Double_getIsNaN";
-  bool get isFinite => !isInfinite && !isNaN; // Can be optimized.
-
-  double abs() {
-    // Handle negative 0.0.
-    if (this == 0.0) return 0.0;
-    return this < 0.0 ? -this : this;
-  }
-
-  double get sign {
-    if (this > 0.0) return 1.0;
-    if (this < 0.0) return -1.0;
-    return this; // +/-0.0 or NaN.
-  }
-
-  int round() => roundToDouble().toInt();
-  int floor() => floorToDouble().toInt();
-  int ceil() => ceilToDouble().toInt();
-  int truncate() => truncateToDouble().toInt();
-
-  @pragma("vm:exact-result-type", _Double)
-  double roundToDouble() native "Double_round";
-  @pragma("vm:exact-result-type", _Double)
-  double floorToDouble() native "Double_floor";
-  @pragma("vm:exact-result-type", _Double)
-  double ceilToDouble() native "Double_ceil";
-  @pragma("vm:exact-result-type", _Double)
-  double truncateToDouble() native "Double_truncate";
-
-  num clamp(num lowerLimit, num upperLimit) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (lowerLimit == null) {
-      throw new ArgumentError.notNull("lowerLimit");
-    }
-    if (upperLimit == null) {
-      throw new ArgumentError.notNull("upperLimit");
-    }
-    if (lowerLimit.compareTo(upperLimit) > 0) {
-      throw new ArgumentError(lowerLimit);
-    }
-    if (lowerLimit.isNaN) return lowerLimit;
-    if (this.compareTo(lowerLimit) < 0) return lowerLimit;
-    if (this.compareTo(upperLimit) > 0) return upperLimit;
-    return this;
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  int toInt() native "Double_toInt";
-
-  double toDouble() {
-    return this;
-  }
-
-  static const int CACHE_SIZE_LOG2 = 3;
-  static const int CACHE_LENGTH = 1 << (CACHE_SIZE_LOG2 + 1);
-  static const int CACHE_MASK = CACHE_LENGTH - 1;
-  // Each key (double) followed by its toString result.
-  static final List _cache = new List.filled(CACHE_LENGTH, null);
-  static int _cacheEvictIndex = 0;
-
-  String _toString() native "Double_toString";
-
-  String toString() {
-    // TODO(koda): Consider starting at most recently inserted.
-    for (int i = 0; i < CACHE_LENGTH; i += 2) {
-      // Need 'identical' to handle negative zero, etc.
-      if (identical(_cache[i], this)) {
-        return _cache[i + 1];
-      }
-    }
-    // TODO(koda): Consider optimizing all small integral values.
-    if (identical(0.0, this)) {
-      return "0.0";
-    }
-    String result = _toString();
-    // Replace the least recently inserted entry.
-    _cache[_cacheEvictIndex] = this;
-    _cache[_cacheEvictIndex + 1] = result;
-    _cacheEvictIndex = (_cacheEvictIndex + 2) & CACHE_MASK;
-    return result;
-  }
-
-  String toStringAsFixed(int fractionDigits) {
-    // See ECMAScript-262, 15.7.4.5 for details.
-
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (fractionDigits == null) {
-      throw new ArgumentError.notNull("fractionDigits");
-    }
-
-    // Step 2.
-    if (fractionDigits < 0 || fractionDigits > 20) {
-      throw new RangeError.range(fractionDigits, 0, 20, "fractionDigits");
-    }
-
-    // Step 3.
-    double x = this;
-
-    // Step 4.
-    if (isNaN) return "NaN";
-
-    // Step 5 and 6 skipped. Will be dealt with by native function.
-
-    // Step 7.
-    if (x >= 1e21 || x <= -1e21) {
-      return x.toString();
-    }
-
-    return _toStringAsFixed(fractionDigits);
-  }
-
-  String _toStringAsFixed(int fractionDigits) native "Double_toStringAsFixed";
-
-  String toStringAsExponential([int? fractionDigits]) {
-    // See ECMAScript-262, 15.7.4.6 for details.
-
-    // The EcmaScript specification checks for NaN and Infinity before looking
-    // at the fractionDigits. In Dart we are consistent with toStringAsFixed and
-    // look at the fractionDigits first.
-
-    // Step 7.
-    if (fractionDigits != null) {
-      if (fractionDigits < 0 || fractionDigits > 20) {
-        throw new RangeError.range(fractionDigits, 0, 20, "fractionDigits");
-      }
-    }
-
-    if (isNaN) return "NaN";
-    if (this == double.infinity) return "Infinity";
-    if (this == -double.infinity) return "-Infinity";
-
-    // The dart function prints the shortest representation when fractionDigits
-    // equals null. The native function wants -1 instead.
-    fractionDigits = (fractionDigits == null) ? -1 : fractionDigits;
-
-    return _toStringAsExponential(fractionDigits);
-  }
-
-  String _toStringAsExponential(int fractionDigits)
-      native "Double_toStringAsExponential";
-
-  String toStringAsPrecision(int precision) {
-    // See ECMAScript-262, 15.7.4.7 for details.
-
-    if (precision == null) {
-      throw new ArgumentError.notNull("precision");
-    }
-    // The EcmaScript specification checks for NaN and Infinity before looking
-    // at the fractionDigits. In Dart we are consistent with toStringAsFixed and
-    // look at the fractionDigits first.
-
-    // Step 8.
-    if (precision < 1 || precision > 21) {
-      throw new RangeError.range(precision, 1, 21, "precision");
-    }
-
-    if (isNaN) return "NaN";
-    if (this == double.infinity) return "Infinity";
-    if (this == -double.infinity) return "-Infinity";
-
-    return _toStringAsPrecision(precision);
-  }
-
-  String _toStringAsPrecision(int fractionDigits)
-      native "Double_toStringAsPrecision";
-
-  // Order is: NaN > Infinity > ... > 0.0 > -0.0 > ... > -Infinity.
-  int compareTo(num other) {
-    const int EQUAL = 0, LESS = -1, GREATER = 1;
-    if (this < other) {
-      return LESS;
-    } else if (this > other) {
-      return GREATER;
-    } else if (this == other) {
-      if (this == 0.0) {
-        bool thisIsNegative = isNegative;
-        bool otherIsNegative = other.isNegative;
-        if (thisIsNegative == otherIsNegative) {
-          return EQUAL;
-        }
-        return thisIsNegative ? LESS : GREATER;
-      } else if (other is int) {
-        // Compare as integers as it is more precise if the integer value is
-        // outside of MIN_EXACT_INT_TO_DOUBLE..MAX_EXACT_INT_TO_DOUBLE range.
-        const int MAX_EXACT_INT_TO_DOUBLE = 9007199254740992; // 2^53.
-        const int MIN_EXACT_INT_TO_DOUBLE = -MAX_EXACT_INT_TO_DOUBLE;
-        if ((MIN_EXACT_INT_TO_DOUBLE <= other) &&
-            (other <= MAX_EXACT_INT_TO_DOUBLE)) {
-          return EQUAL;
-        }
-        const bool limitIntsTo64Bits = ((1 << 64) == 0);
-        if (limitIntsTo64Bits) {
-          // With integers limited to 64 bits, double.toInt() clamps
-          // double value to fit into the MIN_INT64..MAX_INT64 range.
-          // MAX_INT64 is not precisely representable as double, so
-          // integers near MAX_INT64 compare as equal to (MAX_INT64 + 1) when
-          // represented as doubles.
-          // There is no similar problem with MIN_INT64 as it is precisely
-          // representable as double.
-          const double maxInt64Plus1AsDouble = 9223372036854775808.0;
-          if (this >= maxInt64Plus1AsDouble) {
-            return GREATER;
-          }
-        }
-        return toInt().compareTo(other);
-      } else {
-        return EQUAL;
-      }
-    } else if (isNaN) {
-      return other.isNaN ? EQUAL : GREATER;
-    } else {
-      // Other is NaN.
-      return LESS;
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/double_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/double_patch.dart
deleted file mode 100644
index e6ccf5c..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/double_patch.dart
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-// VM implementation of double.
-
-@patch
-class double {
-  static double? _nativeParse(String str, int start, int end)
-      native "Double_parse";
-
-  static double? _tryParseDouble(String str, int start, int end) {
-    assert(start < end);
-    const int _DOT = 0x2e; // '.'
-    const int _ZERO = 0x30; // '0'
-    const int _MINUS = 0x2d; // '-'
-    const int _N = 0x4e; // 'N'
-    const int _a = 0x61; // 'a'
-    const int _I = 0x49; // 'I'
-    const int _e = 0x65; // 'e'
-    int exponent = 0;
-    // Set to non-zero if a digit is seen. Avoids accepting ".".
-    bool digitsSeen = false;
-    // Added to exponent for each digit. Set to -1 when seeing '.'.
-    int exponentDelta = 0;
-    double doubleValue = 0.0;
-    double sign = 1.0;
-    int firstChar = str.codeUnitAt(start);
-    if (firstChar == _MINUS) {
-      sign = -1.0;
-      start++;
-      if (start == end) return null;
-      firstChar = str.codeUnitAt(start);
-    }
-    if (firstChar == _I) {
-      if (end == start + 8 && str.startsWith("nfinity", start + 1)) {
-        return sign * double.infinity;
-      }
-      return null;
-    }
-    if (firstChar == _N) {
-      if (end == start + 3 &&
-          str.codeUnitAt(start + 1) == _a &&
-          str.codeUnitAt(start + 2) == _N) {
-        return double.nan;
-      }
-      return null;
-    }
-
-    int firstDigit = firstChar ^ _ZERO;
-    if (firstDigit <= 9) {
-      start++;
-      doubleValue = firstDigit.toDouble();
-      digitsSeen = true;
-    }
-    for (int i = start; i < end; i++) {
-      int c = str.codeUnitAt(i);
-      int digit = c ^ _ZERO; // '0'-'9' characters are now 0-9 integers.
-      if (digit <= 9) {
-        doubleValue = 10.0 * doubleValue + digit;
-        // Doubles at or above this value (2**53) might have lost precission.
-        const double MAX_EXACT_DOUBLE = 9007199254740992.0;
-        if (doubleValue >= MAX_EXACT_DOUBLE) return null;
-        exponent += exponentDelta;
-        digitsSeen = true;
-      } else if (c == _DOT && exponentDelta == 0) {
-        exponentDelta = -1;
-      } else if ((c | 0x20) == _e) {
-        i++;
-        if (i == end) return null;
-        // int._tryParseSmi treats its end argument as inclusive.
-        final int? expPart = int._tryParseSmi(str, i, end - 1);
-        if (expPart == null) return null;
-        exponent += expPart;
-        break;
-      } else {
-        return null;
-      }
-    }
-    if (!digitsSeen) return null; // No digits.
-    if (exponent == 0) return sign * doubleValue;
-    const P10 = POWERS_OF_TEN; // From shared library
-    if (exponent < 0) {
-      int negExponent = -exponent;
-      if (negExponent >= P10.length) return null;
-      return sign * (doubleValue / P10[negExponent]);
-    }
-    if (exponent >= P10.length) return null;
-    return sign * (doubleValue * P10[exponent]);
-  }
-
-  static double? _parse(String str) {
-    int len = str.length;
-    final strbase = str as _StringBase;
-    int start = strbase._firstNonWhitespace();
-    if (start == len) return null; // All whitespace.
-    int end = strbase._lastNonWhitespace() + 1;
-    assert(start < end);
-    var result = _tryParseDouble(str, start, end);
-    if (result != null) return result;
-    return _nativeParse(str, start, end);
-  }
-
-  @patch
-  static double parse(String source,
-      [@deprecated double onError(String source)?]) {
-    var result = _parse(source);
-    if (result == null) {
-      if (onError == null) throw new FormatException("Invalid double", source);
-      return onError(source);
-    }
-    return result;
-  }
-
-  @patch
-  static double? tryParse(String source) => _parse(source);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/empty_source.dart b/sdk_nnbd/lib/_internal/vm/lib/empty_source.dart
deleted file mode 100644
index 95e028f..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/empty_source.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// THIS FILE INTENTIONALLY LEFT BLANK.
diff --git a/sdk_nnbd/lib/_internal/vm/lib/errors_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/errors_patch.dart
deleted file mode 100644
index c4b91f2..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/errors_patch.dart
+++ /dev/null
@@ -1,503 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class Error {
-  @patch
-  static String _objectToString(Object object) {
-    return Object._toString(object);
-  }
-
-  @patch
-  static String _stringToSafeString(String string) {
-    return json.encode(string);
-  }
-
-  @patch
-  StackTrace? get stackTrace => _stackTrace;
-
-  @pragma("vm:entry-point")
-  StackTrace? _stackTrace;
-}
-
-class _AssertionError extends Error implements AssertionError {
-  @pragma("vm:entry-point")
-  _AssertionError._create(
-      this._failedAssertion, this._url, this._line, this._column, this.message);
-
-  // AssertionError_throwNew in errors.cc fishes the assertion source code
-  // out of the script. It expects a Dart stack frame from class
-  // _AssertionError. Thus we need a Dart stub that calls the native code.
-  @pragma("vm:entry-point", "call")
-  static _throwNew(int assertionStart, int assertionEnd, Object? message) {
-    _doThrowNew(assertionStart, assertionEnd, message);
-  }
-
-  static _doThrowNew(int assertionStart, int assertionEnd, Object? message)
-      native "AssertionError_throwNew";
-
-  @pragma("vm:entry-point", "call")
-  static _evaluateAssertion(condition) {
-    if (identical(condition, true) || identical(condition, false)) {
-      return condition;
-    }
-    if (condition is _Closure) {
-      return (condition as dynamic)();
-    }
-    if (condition is Function) {
-      condition = condition();
-    }
-    return condition;
-  }
-
-  String get _messageString {
-    final msg = message;
-    if (msg == null) return "is not true.";
-    if (msg is String) return msg;
-    return Error.safeToString(msg);
-  }
-
-  String toString() {
-    if (_url == null) {
-      if (message == null) return _failedAssertion.trim();
-      return "'${_failedAssertion.trim()}': $_messageString";
-    }
-    var columnInfo = "";
-    if (_column > 0) {
-      // Only add column information if it is valid.
-      columnInfo = " pos $_column";
-    }
-    return "'$_url': Failed assertion: line $_line$columnInfo: "
-        "'$_failedAssertion': $_messageString";
-  }
-
-  final String _failedAssertion;
-  final String _url;
-  final int _line;
-  final int _column;
-  final Object? message;
-}
-
-class _TypeError extends Error implements TypeError, CastError {
-  @pragma("vm:entry-point")
-  _TypeError._create(this._url, this._line, this._column, this._message);
-
-  @pragma("vm:entry-point", "call")
-  static _throwNew(int location, Object srcValue, _Type dstType, String dstName)
-      native "TypeError_throwNew";
-
-  String toString() => _message;
-
-  final String _url;
-  final int _line;
-  final int _column;
-  final String _message;
-}
-
-class _CastError extends Error implements CastError, TypeError {
-  @pragma("vm:entry-point")
-  _CastError._create(this._url, this._line, this._column, this._errorMsg);
-
-  // A CastError is allocated by TypeError._throwNew() when dstName equals
-  // Symbols::InTypeCast().
-
-  String toString() => _errorMsg;
-
-  // Fields _url, _line, and _column are only used for debugging purposes.
-  final String _url;
-  final int _line;
-  final int _column;
-  final String _errorMsg;
-}
-
-@patch
-class FallThroughError {
-  @patch
-  @pragma("vm:entry-point")
-  FallThroughError._create(this._url, this._line);
-
-  static _throwNew(int caseClausePos) native "FallThroughError_throwNew";
-
-  @patch
-  String toString() {
-    return "'$_url': Switch case fall-through at line $_line.";
-  }
-
-  // These new fields cannot be declared final, because a constructor exists
-  // in the original version of this patched class.
-  String? _url;
-  int _line = 0;
-}
-
-class _InternalError {
-  @pragma("vm:entry-point")
-  const _InternalError(this._msg);
-  String toString() => "InternalError: '${_msg}'";
-  final String _msg;
-}
-
-@patch
-@pragma("vm:entry-point")
-class UnsupportedError {
-  static _throwNew(String msg) {
-    throw new UnsupportedError(msg);
-  }
-}
-
-@patch
-class CyclicInitializationError {
-  static _throwNew(String variableName) {
-    throw new CyclicInitializationError(variableName);
-  }
-}
-
-@patch
-class AbstractClassInstantiationError {
-  @pragma("vm:entry-point")
-  AbstractClassInstantiationError._create(
-      this._className, this._url, this._line);
-
-  static _throwNew(int caseClausePos, String className)
-      native "AbstractClassInstantiationError_throwNew";
-
-  @patch
-  String toString() {
-    return "Cannot instantiate abstract class $_className: "
-        "_url '$_url' line $_line";
-  }
-
-  // These new fields cannot be declared final, because a constructor exists
-  // in the original version of this patched class.
-  String? _url;
-  int _line = 0;
-}
-
-@patch
-class NoSuchMethodError {
-  final Object? _receiver;
-  final Invocation _invocation;
-
-  @patch
-  NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation)
-      : _receiver = receiver,
-        _invocation = invocation;
-
-  static void _throwNewInvocation(Object? receiver, Invocation invocation) {
-    throw new NoSuchMethodError.withInvocation(receiver, invocation);
-  }
-
-  // The compiler emits a call to _throwNew when it cannot resolve a static
-  // method at compile time. The receiver is actually the literal class of the
-  // unresolved method.
-  @pragma("vm:entry-point", "call")
-  static void _throwNew(
-      Object receiver,
-      String memberName,
-      int invocationType,
-      int typeArgumentsLength,
-      Object? typeArguments,
-      List? arguments,
-      List? argumentNames) {
-    throw new NoSuchMethodError._withType(receiver, memberName, invocationType,
-        typeArgumentsLength, typeArguments, arguments, argumentNames);
-  }
-
-  // Deprecated constructor.
-  @patch
-  NoSuchMethodError(this._receiver, Symbol memberName,
-      List? positionalArguments, Map<Symbol, dynamic>? namedArguments,
-      [List? existingArgumentNames = null]) // existingArgumentNames ignored.
-      : this._invocation = new _InvocationMirror._withType(
-            memberName,
-            _InvocationMirror._UNINITIALIZED,
-            null, // Type arguments not supported in deprecated constructor.
-            positionalArguments,
-            namedArguments);
-
-  // Helper to build a map of named arguments.
-  static Map<Symbol, dynamic> _NamedArgumentsMap(
-      List arguments, List argumentNames) {
-    Map<Symbol, dynamic> namedArguments = new Map<Symbol, dynamic>();
-    int numPositionalArguments = arguments.length - argumentNames.length;
-    for (int i = 0; i < argumentNames.length; i++) {
-      final argValue = arguments[numPositionalArguments + i];
-      namedArguments[new Symbol(argumentNames[i])] = argValue;
-    }
-    return namedArguments;
-  }
-
-  // Constructor called from Exceptions::ThrowByType(kNoSuchMethod) and from
-  // _throwNew above, taking a TypeArguments object rather than an unpacked list
-  // of types, as well as a list of all arguments and a list of names, rather
-  // than a separate list of positional arguments and a map of named arguments.
-  @pragma("vm:entry-point")
-  NoSuchMethodError._withType(
-      this._receiver,
-      String memberName,
-      int invocationType,
-      int typeArgumentsLength, // Needed with all-dynamic (null) typeArguments.
-      Object? typeArguments,
-      List? arguments,
-      List? argumentNames)
-      : this._invocation = new _InvocationMirror._withType(
-            new Symbol(memberName),
-            invocationType,
-            _InvocationMirror._unpackTypeArguments(
-                typeArguments, typeArgumentsLength),
-            argumentNames != null
-                ? arguments!.sublist(0, arguments.length - argumentNames.length)
-                : arguments,
-            argumentNames != null
-                ? _NamedArgumentsMap(arguments!, argumentNames)
-                : null);
-
-  static String? _existingMethodSignature(Object? receiver, String methodName,
-      int invocationType) native "NoSuchMethodError_existingMethodSignature";
-
-  @patch
-  String toString() {
-    final localInvocation = _invocation;
-    if (localInvocation is _InvocationMirror) {
-      var internalName = localInvocation.memberName as internal.Symbol;
-      String memberName = internal.Symbol.computeUnmangledName(internalName);
-
-      var level = (localInvocation._type >> _InvocationMirror._LEVEL_SHIFT) &
-          _InvocationMirror._LEVEL_MASK;
-      var kind = localInvocation._type & _InvocationMirror._KIND_MASK;
-      if (kind == _InvocationMirror._LOCAL_VAR) {
-        return "NoSuchMethodError: Cannot assign to final variable '$memberName'";
-      }
-
-      StringBuffer? typeArgumentsBuf = null;
-      final typeArguments = localInvocation.typeArguments;
-      if ((typeArguments != null) && (typeArguments.length > 0)) {
-        final argsBuf = new StringBuffer();
-        argsBuf.write("<");
-        for (int i = 0; i < typeArguments.length; i++) {
-          if (i > 0) {
-            argsBuf.write(", ");
-          }
-          argsBuf.write(Error.safeToString(typeArguments[i]));
-        }
-        argsBuf.write(">");
-        typeArgumentsBuf = argsBuf;
-      }
-      StringBuffer argumentsBuf = new StringBuffer();
-      var positionalArguments = localInvocation.positionalArguments;
-      int argumentCount = 0;
-      if (positionalArguments != null) {
-        for (; argumentCount < positionalArguments.length; argumentCount++) {
-          if (argumentCount > 0) {
-            argumentsBuf.write(", ");
-          }
-          argumentsBuf
-              .write(Error.safeToString(positionalArguments[argumentCount]));
-        }
-      }
-      var namedArguments = localInvocation.namedArguments;
-      if (namedArguments != null) {
-        namedArguments.forEach((Symbol key, var value) {
-          if (argumentCount > 0) {
-            argumentsBuf.write(", ");
-          }
-          var internalName = key as internal.Symbol;
-          argumentsBuf
-              .write(internal.Symbol.computeUnmangledName(internalName));
-          argumentsBuf.write(": ");
-          argumentsBuf.write(Error.safeToString(value));
-          argumentCount++;
-        });
-      }
-      String? existingSig = _existingMethodSignature(
-          _receiver, memberName, localInvocation._type);
-      String argsMsg = existingSig != null ? " with matching arguments" : "";
-
-      String kindBuf = "function";
-      if (kind >= 0 && kind < 5) {
-        kindBuf = (const [
-          "method",
-          "getter",
-          "setter",
-          "getter or setter",
-          "variable"
-        ])[kind];
-      }
-
-      StringBuffer msgBuf = new StringBuffer("NoSuchMethodError: ");
-      bool isTypeCall = false;
-      switch (level) {
-        case _InvocationMirror._DYNAMIC:
-          {
-            if (_receiver == null) {
-              if (existingSig != null) {
-                msgBuf.writeln("The null object does not have a $kindBuf "
-                    "'$memberName'$argsMsg.");
-              } else {
-                msgBuf
-                    .writeln("The $kindBuf '$memberName' was called on null.");
-              }
-            } else {
-              if (_receiver is _Closure) {
-                msgBuf.writeln("Closure call with mismatched arguments: "
-                    "function '$memberName'");
-              } else if (_receiver is _Type && memberName == "call") {
-                isTypeCall = true;
-                String name = _receiver.toString();
-                msgBuf.writeln("Attempted to use type '$name' as a function. "
-                    "Since types do not define a method 'call', this is not "
-                    "possible. Did you intend to call the $name constructor and "
-                    "forget the 'new' operator?");
-              } else {
-                msgBuf
-                    .writeln("Class '${_receiver.runtimeType}' has no instance "
-                        "$kindBuf '$memberName'$argsMsg.");
-              }
-            }
-            break;
-          }
-        case _InvocationMirror._SUPER:
-          {
-            msgBuf
-                .writeln("Super class of class '${_receiver.runtimeType}' has "
-                    "no instance $kindBuf '$memberName'$argsMsg.");
-            memberName = "super.$memberName";
-            break;
-          }
-        case _InvocationMirror._STATIC:
-          {
-            msgBuf.writeln("No static $kindBuf '$memberName'$argsMsg "
-                "declared in class '$_receiver'.");
-            break;
-          }
-        case _InvocationMirror._CONSTRUCTOR:
-          {
-            msgBuf.writeln("No constructor '$memberName'$argsMsg declared "
-                "in class '$_receiver'.");
-            memberName = "new $memberName";
-            break;
-          }
-        case _InvocationMirror._TOP_LEVEL:
-          {
-            msgBuf.writeln("No top-level $kindBuf '$memberName'$argsMsg "
-                "declared.");
-            break;
-          }
-      }
-
-      if (level == _InvocationMirror._TOP_LEVEL) {
-        msgBuf.writeln("Receiver: top-level");
-      } else {
-        msgBuf.writeln("Receiver: ${Error.safeToString(_receiver)}");
-      }
-
-      if (kind == _InvocationMirror._METHOD) {
-        String m = isTypeCall ? "$_receiver" : "$memberName";
-        msgBuf.write("Tried calling: $m");
-        if (typeArgumentsBuf != null) {
-          msgBuf.write(typeArgumentsBuf);
-        }
-        msgBuf.write("($argumentsBuf)");
-      } else if (argumentCount == 0) {
-        msgBuf.write("Tried calling: $memberName");
-      } else if (kind == _InvocationMirror._SETTER) {
-        msgBuf.write("Tried calling: $memberName$argumentsBuf");
-      } else {
-        msgBuf.write("Tried calling: $memberName = $argumentsBuf");
-      }
-
-      if (existingSig != null) {
-        msgBuf.write("\nFound: $memberName$existingSig");
-      }
-
-      return msgBuf.toString();
-    }
-    return _toStringPlain(_receiver, localInvocation);
-  }
-
-  /// Creates a string representation of an invocation.
-  ///
-  /// Used for situations where there is no extra information available
-  /// about the failed invocation than the [Invocation] object and receiver,
-  /// which includes errors created using [NoSuchMethodError.withInvocation].
-  static String _toStringPlain(Object? receiver, Invocation invocation) {
-    var name = _symbolToString(invocation.memberName);
-    var receiverType = "${receiver.runtimeType}";
-    if (invocation.isAccessor) {
-      return "NoSuchMethodError: $receiverType has no $name "
-          "${invocation.isGetter ? "getter" : "setter"}";
-    }
-    var buffer = StringBuffer("NoSuchMethodError")..write(": ");
-    buffer.write("$receiverType has no $name method accepting arguments ");
-    var separator = "";
-    if (invocation.typeArguments.isNotEmpty) {
-      buffer.write("<");
-      for (var type in invocation.typeArguments) {
-        buffer..write(separator)..write("_");
-        separator = ", ";
-      }
-      buffer.write(">");
-      separator = "";
-    }
-    buffer.write("(");
-    for (var argument in invocation.positionalArguments) {
-      buffer..write(separator)..write("_");
-      separator = ", ";
-    }
-    if (invocation.namedArguments.isNotEmpty) {
-      buffer..write(separator)..write("{");
-      separator = "";
-      for (var name in invocation.namedArguments.keys) {
-        buffer..write(separator)..write(_symbolToString(name))..write(": _");
-        separator = ",";
-      }
-      buffer.write("}");
-    }
-    buffer.write(")");
-    return buffer.toString();
-  }
-
-  static String _symbolToString(Symbol symbol) {
-    if (symbol is internal.Symbol) {
-      return internal.Symbol.computeUnmangledName(symbol);
-    }
-    return "$symbol";
-  }
-}
-
-@pragma("vm:entry-point")
-class _CompileTimeError extends Error {
-  final String _errorMsg;
-  _CompileTimeError(this._errorMsg);
-  String toString() => _errorMsg;
-}
-
-/// Used by Fasta to report a runtime error when a final field with an
-/// initializer is also initialized in a generative constructor.
-///
-/// Note: in strong mode, this is a compile-time error and this class becomes
-/// obsolete.
-class _DuplicatedFieldInitializerError extends Error {
-  final String _name;
-
-  _DuplicatedFieldInitializerError(this._name);
-
-  toString() => "Error: field '$_name' is already initialized.";
-}
-
-class _LateInitializationError extends Error
-    implements LateInitializationError {
-  @pragma("vm:entry-point")
-  _LateInitializationError(this._name);
-
-  @pragma("vm:entry-point")
-  static void _throwNew(String name) {
-    throw _LateInitializationError(name);
-  }
-
-  String toString() => "LateInitializationError: $_name";
-
-  final String _name;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/expando_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/expando_patch.dart
deleted file mode 100644
index 1d99cab..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/expando_patch.dart
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class Expando<T> {
-  @patch
-  Expando([String? name])
-      : name = name,
-        _data = new List.filled(_minSize, null),
-        _used = 0;
-
-  static const _minSize = 8;
-  static final _deletedEntry = new _WeakProperty(null, null);
-
-  @patch
-  T? operator [](Object object) {
-    _checkType(object);
-
-    var mask = _size - 1;
-    var idx = object._identityHashCode & mask;
-    var wp = _data[idx];
-
-    while (wp != null) {
-      if (identical(wp.key, object)) {
-        return wp.value;
-      } else if (wp.key == null) {
-        // This entry has been cleared by the GC.
-        _data[idx] = _deletedEntry;
-      }
-      idx = (idx + 1) & mask;
-      wp = _data[idx];
-    }
-
-    return null;
-  }
-
-  @patch
-  void operator []=(Object object, T? value) {
-    _checkType(object);
-
-    var mask = _size - 1;
-    var idx = object._identityHashCode & mask;
-    var empty_idx = -1;
-    var wp = _data[idx];
-
-    while (wp != null) {
-      if (identical(wp.key, object)) {
-        if (value != null) {
-          // Update the associated value.
-          wp.value = value;
-        } else {
-          // Mark the entry as deleted.
-          _data[idx] = _deletedEntry;
-        }
-        return;
-      } else if ((empty_idx < 0) && identical(wp, _deletedEntry)) {
-        empty_idx = idx; // Insert at this location if not found.
-      } else if (wp.key == null) {
-        // This entry has been cleared by the GC.
-        _data[idx] = _deletedEntry;
-        if (empty_idx < 0) {
-          empty_idx = idx; // Insert at this location if not found.
-        }
-      }
-      idx = (idx + 1) & mask;
-      wp = _data[idx];
-    }
-
-    if (value == null) {
-      // Not entering a null value. We just needed to make sure to clear an
-      // existing value if it existed.
-      return;
-    }
-
-    if (empty_idx >= 0) {
-      // We will be reusing the empty slot below.
-      _used--;
-      idx = empty_idx;
-    }
-
-    if (_used < _limit) {
-      _data[idx] = new _WeakProperty(object, value);
-      _used++;
-      return;
-    }
-
-    // Grow/reallocate if too many slots have been used.
-    _rehash();
-    this[object] = value; // Recursively add the value.
-  }
-
-  _rehash() {
-    // Determine the population count of the map to allocate an appropriately
-    // sized map below.
-    var count = 0;
-    var old_data = _data;
-    var len = old_data.length;
-    for (var i = 0; i < len; i++) {
-      var entry = old_data[i];
-      if ((entry != null) && (entry.key != null)) {
-        // Only count non-cleared entries.
-        count++;
-      }
-    }
-
-    var new_size = _size;
-    if (count <= (new_size >> 2)) {
-      new_size = new_size >> 1;
-    } else if (count > (new_size >> 1)) {
-      new_size = new_size << 1;
-    }
-    new_size = (new_size < _minSize) ? _minSize : new_size;
-
-    // Reset the mappings to empty so that we can just add the existing
-    // valid entries.
-    _data = new List.filled(new_size, null);
-    _used = 0;
-
-    for (var i = 0; i < old_data.length; i++) {
-      var entry = old_data[i];
-      if (entry != null) {
-        // Ensure that the entry.key is not cleared between checking for it and
-        // inserting it into the new table.
-        var val = entry.value;
-        var key = entry.key;
-        if (key != null) {
-          this[key] = val;
-        }
-      }
-    }
-  }
-
-  static _checkType(object) {
-    if ((object == null) ||
-        (object is bool) ||
-        (object is num) ||
-        (object is String)) {
-      throw new ArgumentError.value(object,
-          "Expandos are not allowed on strings, numbers, booleans or null");
-    }
-  }
-
-  get _size => _data.length;
-  get _limit => (3 * (_size ~/ 4));
-
-  List _data;
-  int _used; // Number of used (active and deleted) slots.
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart
deleted file mode 100644
index 303c5a4..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/ffi_dynamic_library_patch.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// All imports must be in all FFI patch files to not depend on the order
-// the patches are applied.
-import "dart:_internal" show patch;
-import 'dart:typed_data';
-import 'dart:isolate';
-
-DynamicLibrary _open(String name) native "Ffi_dl_open";
-DynamicLibrary _processLibrary() native "Ffi_dl_processLibrary";
-DynamicLibrary _executableLibrary() native "Ffi_dl_executableLibrary";
-
-@patch
-@pragma("vm:entry-point")
-class DynamicLibrary {
-  @patch
-  factory DynamicLibrary.open(String name) {
-    return _open(name);
-  }
-
-  @patch
-  factory DynamicLibrary.process() => _processLibrary();
-
-  @patch
-  factory DynamicLibrary.executable() => _executableLibrary();
-
-  @patch
-  Pointer<T> lookup<T extends NativeType>(String symbolName)
-      native "Ffi_dl_lookup";
-
-  // TODO(dacoharkes): Expose this to users, or extend Pointer?
-  // https://github.com/dart-lang/sdk/issues/35881
-  int getHandle() native "Ffi_dl_getHandle";
-
-  @patch
-  bool operator ==(Object other) {
-    if (other is! DynamicLibrary) return false;
-    DynamicLibrary otherLib = other;
-    return getHandle() == otherLib.getHandle();
-  }
-
-  @patch
-  int get hashCode {
-    return getHandle().hashCode;
-  }
-
-  @patch
-  Pointer<Void> get handle => Pointer.fromAddress(getHandle());
-}
-
-extension DynamicLibraryExtension on DynamicLibrary {
-  @patch
-  DS lookupFunction<NS extends Function, DS extends Function>(
-          String symbolName) =>
-      throw UnsupportedError("The body is inlined in the frontend.");
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/ffi_native_type_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/ffi_native_type_patch.dart
deleted file mode 100644
index cc7831b..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/ffi_native_type_patch.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// All imports must be in all FFI patch files to not depend on the order
-// the patches are applied.
-import "dart:_internal" show patch;
-import 'dart:typed_data';
-import 'dart:isolate';
-
-// NativeType is not private, because it is used in type arguments.
-// NativeType is abstract because it not used with const constructors in
-// annotations directly, so it should never be instantiated at runtime.
-@patch
-@pragma("vm:entry-point")
-abstract class NativeType {}
-
-@patch
-@pragma("vm:entry-point")
-class _NativeInteger extends NativeType {}
-
-@patch
-@pragma("vm:entry-point")
-class _NativeDouble extends NativeType {}
-
-@patch
-@pragma("vm:entry-point")
-class Int8 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Int16 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Int32 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Int64 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Uint8 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Uint16 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Uint32 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Uint64 extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class IntPtr extends _NativeInteger {}
-
-@patch
-@pragma("vm:entry-point")
-class Float extends _NativeDouble {}
-
-@patch
-@pragma("vm:entry-point")
-class Double extends _NativeDouble {}
-
-@patch
-@pragma("vm:entry-point")
-abstract class Void extends NativeType {}
-
-@patch
-@pragma("vm:entry-point")
-abstract class Handle extends NativeType {}
-
-@patch
-@pragma("vm:entry-point")
-abstract class NativeFunction<T extends Function> extends NativeType {}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/ffi_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/ffi_patch.dart
deleted file mode 100644
index d42689c..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/ffi_patch.dart
+++ /dev/null
@@ -1,478 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// All imports must be in all FFI patch files to not depend on the order
-// the patches are applied.
-import "dart:_internal" show patch;
-import 'dart:typed_data';
-import 'dart:isolate';
-
-const Map<Type, int> _knownSizes = {
-  Int8: 1,
-  Uint8: 1,
-  Int16: 2,
-  Uint16: 2,
-  Int32: 4,
-  Uint32: 4,
-  Int64: 8,
-  Uint64: 8,
-  Float: 4,
-  Double: 8,
-};
-
-@pragma("vm:prefer-inline")
-int get _intPtrSize => (const [8, 4, 4])[_abi()];
-
-@patch
-int sizeOf<T extends NativeType>() {
-  // This is not super fast, but it is faster than a runtime entry.
-  // Hot loops with elementAt().load() do not use this sizeOf, elementAt is
-  // optimized per NativeType statically to prevent use of sizeOf at runtime.
-  final int? knownSize = _knownSizes[T];
-  if (knownSize != null) return knownSize;
-  if (T == IntPtr) return _intPtrSize;
-  if (T == Pointer) return _intPtrSize;
-  // For structs we fall back to a runtime entry.
-  return _sizeOf<T>();
-}
-
-int _sizeOf<T extends NativeType>() native "Ffi_sizeOf";
-
-// Implemented in the method recognizer, bytecode interpreter uses runtime.
-Pointer<T> _fromAddress<T extends NativeType>(int ptr) native "Ffi_fromAddress";
-
-// The real implementation of this function (for interface calls) lives in
-// BuildFfiAsFunctionCall in the Kernel frontend. No calls can actually reach
-// this function.
-DS _asFunctionInternal<DS extends Function, NS extends Function>(
-    Pointer<NativeFunction<NS>> ptr) native "Ffi_asFunctionInternal";
-
-dynamic _asExternalTypedData(Pointer ptr, int count)
-    native "Ffi_asExternalTypedData";
-
-// Returns a Function object for a native callback.
-//
-// Calls to [Pointer.fromFunction] are re-written by the FE into calls to this
-// method + _pointerFromFunction. All three arguments must be constants.
-//
-// In AOT we evaluate calls to this function during precompilation and replace
-// them with Constant instruction referencing the callback trampoline, to ensure
-// that it will be precompiled.
-//
-// In all JIT modes we call a native runtime entry. We *cannot* use the IL
-// implementation, since that would pull the callback trampoline into JIT
-// snapshots. The callback trampolines can only be serialized into AOT snapshots
-// because they embed the addresses of runtime routines in JIT mode.
-//
-// Function objects returned by this native method are not Dart instances,
-// so we need to use top type as a return type to avoid type check.
-dynamic _nativeCallbackFunction<NS extends Function>(Function target,
-    Object exceptionalReturn) native "Ffi_nativeCallbackFunction";
-
-Pointer<NS> _pointerFromFunction<NS extends NativeFunction>(dynamic function)
-    native "Ffi_pointerFromFunction";
-
-@patch
-@pragma("vm:entry-point")
-class Pointer<T extends NativeType> {
-  @patch
-  factory Pointer.fromAddress(int ptr) => _fromAddress(ptr);
-
-  // All static calls to this method are replaced by the FE into
-  // _nativeCallbackFunction + _pointerFromFunction.
-  //
-  // We still need to throw an error on a dynamic invocations, invocations
-  // through tearoffs or reflective calls.
-  @patch
-  static Pointer<NativeFunction<T>> fromFunction<T extends Function>(
-      @DartRepresentationOf("T") Function f,
-      [Object? exceptionalReturn]) {
-    throw UnsupportedError(
-        "Pointer.fromFunction cannot be called dynamically.");
-  }
-
-  // Implemented in the method recognizer, bytecode interpreter uses runtime.
-  @patch
-  int get address native "Ffi_address";
-
-  // For statically known types, this is rewired.
-  // (Method sizeOf is slow, see notes above.)
-  @patch
-  Pointer<T> elementAt(int index) =>
-      Pointer.fromAddress(address + sizeOf<T>() * index);
-
-  @patch
-  Pointer<T> _offsetBy(int offsetInBytes) =>
-      Pointer.fromAddress(address + offsetInBytes);
-
-  @patch
-  Pointer<U> cast<U extends NativeType>() => Pointer.fromAddress(address);
-}
-
-/// Returns an integer encoding the ABI used for size and alignment
-/// calculations. See pkg/vm/lib/transformations/ffi.dart.
-@pragma('vm:prefer-inline')
-int _abi()
-    native "Recognized method: method is directly interpreted by the bytecode interpreter or IR graph is built in the flow graph builder.";
-
-// The following functions are implemented in the method recognizer, but the
-// bytecode interpreter uses native entries.
-//
-// TODO(38172): Since these are not inlined (force optimize), they force
-// allocating a Pointer with in elementAt/offsetBy. Allocating these pointers
-// and GCing new spaces takes a lot of the benchmark time. The next speedup is
-// getting rid of these allocations by inlining these functions.
-int _loadInt8(Pointer pointer, int offsetInBytes) native "Ffi_loadInt8";
-
-int _loadInt16(Pointer pointer, int offsetInBytes) native "Ffi_loadInt16";
-
-int _loadInt32(Pointer pointer, int offsetInBytes) native "Ffi_loadInt32";
-
-int _loadInt64(Pointer pointer, int offsetInBytes) native "Ffi_loadInt64";
-
-int _loadUint8(Pointer pointer, int offsetInBytes) native "Ffi_loadUint8";
-
-int _loadUint16(Pointer pointer, int offsetInBytes) native "Ffi_loadUint16";
-
-int _loadUint32(Pointer pointer, int offsetInBytes) native "Ffi_loadUint32";
-
-int _loadUint64(Pointer pointer, int offsetInBytes) native "Ffi_loadUint64";
-
-int _loadIntPtr(Pointer pointer, int offsetInBytes) native "Ffi_loadIntPtr";
-
-double _loadFloat(Pointer pointer, int offsetInBytes) native "Ffi_loadFloat";
-
-double _loadDouble(Pointer pointer, int offsetInBytes) native "Ffi_loadDouble";
-
-Pointer<S> _loadPointer<S extends NativeType>(
-    Pointer pointer, int offsetInBytes) native "Ffi_loadPointer";
-
-S _loadStruct<S extends Struct>(Pointer<S> pointer, int index)
-    native "Ffi_loadStruct";
-
-void _storeInt8(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeInt8";
-
-void _storeInt16(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeInt16";
-
-void _storeInt32(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeInt32";
-
-void _storeInt64(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeInt64";
-
-void _storeUint8(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeUint8";
-
-void _storeUint16(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeUint16";
-
-void _storeUint32(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeUint32";
-
-void _storeUint64(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeUint64";
-
-void _storeIntPtr(Pointer pointer, int offsetInBytes, int value)
-    native "Ffi_storeIntPtr";
-
-void _storeFloat(Pointer pointer, int offsetInBytes, double value)
-    native "Ffi_storeFloat";
-
-void _storeDouble(Pointer pointer, int offsetInBytes, double value)
-    native "Ffi_storeDouble";
-
-void _storePointer<S extends NativeType>(Pointer pointer, int offsetInBytes,
-    Pointer<S> value) native "Ffi_storePointer";
-
-Pointer<Int8> _elementAtInt8(Pointer<Int8> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 1 * index);
-
-Pointer<Int16> _elementAtInt16(Pointer<Int16> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 2 * index);
-
-Pointer<Int32> _elementAtInt32(Pointer<Int32> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 4 * index);
-
-Pointer<Int64> _elementAtInt64(Pointer<Int64> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 8 * index);
-
-Pointer<Uint8> _elementAtUint8(Pointer<Uint8> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 1 * index);
-
-Pointer<Uint16> _elementAtUint16(Pointer<Uint16> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 2 * index);
-
-Pointer<Uint32> _elementAtUint32(Pointer<Uint32> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 4 * index);
-
-Pointer<Uint64> _elementAtUint64(Pointer<Uint64> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 8 * index);
-
-Pointer<IntPtr> _elementAtIntPtr(Pointer<IntPtr> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + _intPtrSize * index);
-
-Pointer<Float> _elementAtFloat(Pointer<Float> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 4 * index);
-
-Pointer<Double> _elementAtDouble(Pointer<Double> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + 8 * index);
-
-Pointer<Pointer<S>> _elementAtPointer<S extends NativeType>(
-        Pointer<Pointer<S>> pointer, int index) =>
-    Pointer.fromAddress(pointer.address + _intPtrSize * index);
-
-extension NativeFunctionPointer<NF extends Function>
-    on Pointer<NativeFunction<NF>> {
-  @patch
-  DF asFunction<DF extends Function>() =>
-      throw UnsupportedError("The body is inlined in the frontend.");
-}
-
-//
-// The following code is generated, do not edit by hand.
-//
-// Code generated by `runtime/tools/ffi/sdk_lib_ffi_generator.dart`.
-//
-
-extension Int8Pointer on Pointer<Int8> {
-  @patch
-  int get value => _loadInt8(this, 0);
-
-  @patch
-  set value(int value) => _storeInt8(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadInt8(this, index);
-
-  @patch
-  operator []=(int index, int value) => _storeInt8(this, index, value);
-
-  @patch
-  Int8List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Int16Pointer on Pointer<Int16> {
-  @patch
-  int get value => _loadInt16(this, 0);
-
-  @patch
-  set value(int value) => _storeInt16(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadInt16(this, 2 * index);
-
-  @patch
-  operator []=(int index, int value) => _storeInt16(this, 2 * index, value);
-
-  @patch
-  Int16List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Int32Pointer on Pointer<Int32> {
-  @patch
-  int get value => _loadInt32(this, 0);
-
-  @patch
-  set value(int value) => _storeInt32(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadInt32(this, 4 * index);
-
-  @patch
-  operator []=(int index, int value) => _storeInt32(this, 4 * index, value);
-
-  @patch
-  Int32List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Int64Pointer on Pointer<Int64> {
-  @patch
-  int get value => _loadInt64(this, 0);
-
-  @patch
-  set value(int value) => _storeInt64(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadInt64(this, 8 * index);
-
-  @patch
-  operator []=(int index, int value) => _storeInt64(this, 8 * index, value);
-
-  @patch
-  Int64List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Uint8Pointer on Pointer<Uint8> {
-  @patch
-  int get value => _loadUint8(this, 0);
-
-  @patch
-  set value(int value) => _storeUint8(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadUint8(this, index);
-
-  @patch
-  operator []=(int index, int value) => _storeUint8(this, index, value);
-
-  @patch
-  Uint8List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Uint16Pointer on Pointer<Uint16> {
-  @patch
-  int get value => _loadUint16(this, 0);
-
-  @patch
-  set value(int value) => _storeUint16(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadUint16(this, 2 * index);
-
-  @patch
-  operator []=(int index, int value) => _storeUint16(this, 2 * index, value);
-
-  @patch
-  Uint16List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Uint32Pointer on Pointer<Uint32> {
-  @patch
-  int get value => _loadUint32(this, 0);
-
-  @patch
-  set value(int value) => _storeUint32(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadUint32(this, 4 * index);
-
-  @patch
-  operator []=(int index, int value) => _storeUint32(this, 4 * index, value);
-
-  @patch
-  Uint32List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension Uint64Pointer on Pointer<Uint64> {
-  @patch
-  int get value => _loadUint64(this, 0);
-
-  @patch
-  set value(int value) => _storeUint64(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadUint64(this, 8 * index);
-
-  @patch
-  operator []=(int index, int value) => _storeUint64(this, 8 * index, value);
-
-  @patch
-  Uint64List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension IntPtrPointer on Pointer<IntPtr> {
-  @patch
-  int get value => _loadIntPtr(this, 0);
-
-  @patch
-  set value(int value) => _storeIntPtr(this, 0, value);
-
-  @patch
-  int operator [](int index) => _loadIntPtr(this, _intPtrSize * index);
-
-  @patch
-  operator []=(int index, int value) =>
-      _storeIntPtr(this, _intPtrSize * index, value);
-}
-
-extension FloatPointer on Pointer<Float> {
-  @patch
-  double get value => _loadFloat(this, 0);
-
-  @patch
-  set value(double value) => _storeFloat(this, 0, value);
-
-  @patch
-  double operator [](int index) => _loadFloat(this, 4 * index);
-
-  @patch
-  operator []=(int index, double value) => _storeFloat(this, 4 * index, value);
-
-  @patch
-  Float32List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-extension DoublePointer on Pointer<Double> {
-  @patch
-  double get value => _loadDouble(this, 0);
-
-  @patch
-  set value(double value) => _storeDouble(this, 0, value);
-
-  @patch
-  double operator [](int index) => _loadDouble(this, 8 * index);
-
-  @patch
-  operator []=(int index, double value) => _storeDouble(this, 8 * index, value);
-
-  @patch
-  Float64List asTypedList(int elements) => _asExternalTypedData(this, elements);
-}
-
-//
-// End of generated code.
-//
-
-extension PointerPointer<T extends NativeType> on Pointer<Pointer<T>> {
-  @patch
-  Pointer<T> get value => _loadPointer(this, 0);
-
-  @patch
-  set value(Pointer<T> value) => _storePointer(this, 0, value);
-
-  @patch
-  Pointer<T> operator [](int index) => _loadPointer(this, _intPtrSize * index);
-
-  @patch
-  operator []=(int index, Pointer<T> value) =>
-      _storePointer(this, _intPtrSize * index, value);
-}
-
-extension StructPointer<T extends Struct> on Pointer<T> {
-  @patch
-  T get ref => _loadStruct(this, 0);
-
-  @patch
-  T operator [](int index) => _loadStruct(this, index);
-}
-
-extension NativePort on SendPort {
-  @patch
-  int get nativePort native "SendPortImpl_get_id";
-}
-
-int _nativeApiFunctionPointer(String symbol) native "NativeApiFunctionPointer";
-
-@patch
-abstract class NativeApi {
-  @patch
-  static Pointer<NativeFunction<Int8 Function(Int64, Pointer<Dart_CObject>)>>
-      get postCObject =>
-          Pointer.fromAddress(_nativeApiFunctionPointer("Dart_PostCObject"));
-
-  @patch
-  static Pointer<
-      NativeFunction<
-          Int64 Function(
-              Pointer<Uint8>,
-              Pointer<NativeFunction<Dart_NativeMessageHandler>>,
-              Int8)>> get newNativePort =>
-      Pointer.fromAddress(_nativeApiFunctionPointer("Dart_NewNativePort"));
-
-  @patch
-  static Pointer<NativeFunction<Int8 Function(Int64)>> get closeNativePort =>
-      Pointer.fromAddress(_nativeApiFunctionPointer("Dart_CloseNativePort"));
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/ffi_struct_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/ffi_struct_patch.dart
deleted file mode 100644
index 8fad967..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/ffi_struct_patch.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// All imports must be in all FFI patch files to not depend on the order
-// the patches are applied.
-import "dart:_internal" show patch;
-import 'dart:typed_data';
-import 'dart:isolate';
-
-@pragma("vm:entry-point")
-abstract class Struct extends NativeType {}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/function.dart b/sdk_nnbd/lib/_internal/vm/lib/function.dart
deleted file mode 100644
index 1c99ca2..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/function.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "core_patch.dart";
-
-@pragma("vm:entry-point")
-class _Closure implements Function {
-  factory _Closure._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  bool operator ==(Object other) native "Closure_equals";
-
-  int get hashCode {
-    _hash ??= _computeHash();
-    return _hash;
-  }
-
-  _Closure get call => this;
-
-  _Closure _clone() native "Closure_clone";
-
-  int _computeHash() native "Closure_computeHash";
-
-  // No instance fields should be declared before the following fields whose
-  // offsets must be identical in Dart and C++.
-
-  // The following fields are declared both in raw_object.h (for direct access
-  // from C++ code) and also here so that the offset-to-field map used by
-  // deferred objects is properly initialized.
-  // Caution: These fields are not Dart instances, but VM objects. Their Dart
-  // names do not need to match the C++ names, but they must be private.
-  @pragma("vm:entry-point")
-  var _instantiator_type_arguments;
-  @pragma("vm:entry-point")
-  var _function_type_arguments;
-  @pragma("vm:entry-point")
-  var _delayed_type_arguments;
-  @pragma("vm:entry-point")
-  var _function;
-  @pragma("vm:entry-point")
-  var _context;
-
-  // Note: _Closure objects are created by VM "magically", without invoking
-  // constructor. So, _Closure default constructor is never compiled and
-  // detection of default-initialized fields is not performed.
-  // As a consequence, VM incorrectly assumes that _hash field is not
-  // nullable and may incorrectly remove 'if (_hash == null)' in get:hashCode.
-  // This initializer makes _hash field nullable even without constructor
-  // compilation.
-  @pragma("vm:entry-point")
-  var _hash = null;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/function_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/function_patch.dart
deleted file mode 100644
index b4d3daa..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/function_patch.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class Function {
-  // TODO(regis): Pass type arguments to generic functions. Wait for API spec.
-  static _apply(List<dynamic>? arguments, List<dynamic>? names)
-      native "Function_apply";
-
-  @patch
-  static apply(Function function, List<dynamic>? positionalArguments,
-      [Map<Symbol, dynamic>? namedArguments]) {
-    int numPositionalArguments = 1 + // Function is first implicit argument.
-        (positionalArguments != null ? positionalArguments.length : 0);
-    int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
-    int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List<dynamic>.filled(numArguments, null);
-    arguments[0] = function;
-    if (positionalArguments != null) {
-      arguments.setRange(1, numPositionalArguments, positionalArguments);
-    }
-    List names = new List<dynamic>.filled(numNamedArguments, null);
-    int argumentIndex = numPositionalArguments;
-    int nameIndex = 0;
-    if (numNamedArguments > 0) {
-      namedArguments?.forEach((name, value) {
-        arguments[argumentIndex++] = value;
-        names[nameIndex++] = internal.Symbol.getName(name as internal.Symbol);
-      });
-    }
-    return _apply(arguments, names);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/growable_array.dart b/sdk_nnbd/lib/_internal/vm/lib/growable_array.dart
deleted file mode 100644
index bca95ab..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/growable_array.dart
+++ /dev/null
@@ -1,410 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@pragma("vm:entry-point")
-class _GrowableList<T> extends ListBase<T> {
-  void insert(int index, T element) {
-    if ((index < 0) || (index > length)) {
-      throw new RangeError.range(index, 0, length);
-    }
-    int oldLength = this.length;
-    add(element);
-    if (index == oldLength) {
-      return;
-    }
-    Lists.copy(this, index, this, index + 1, oldLength - index);
-    this[index] = element;
-  }
-
-  T removeAt(int index) {
-    var result = this[index];
-    int newLength = this.length - 1;
-    if (index < newLength) {
-      Lists.copy(this, index + 1, this, index, newLength - index);
-    }
-    this.length = newLength;
-    return result;
-  }
-
-  bool remove(Object? element) {
-    for (int i = 0; i < this.length; i++) {
-      if (this[i] == element) {
-        removeAt(i);
-        return true;
-      }
-    }
-    return false;
-  }
-
-  void insertAll(int index, Iterable<T> iterable) {
-    if (index < 0 || index > length) {
-      throw new RangeError.range(index, 0, length);
-    }
-    // TODO(floitsch): we can probably detect more cases.
-    if (iterable is! List && iterable is! Set && iterable is! SubListIterable) {
-      iterable = iterable.toList();
-    }
-    int insertionLength = iterable.length;
-    // There might be errors after the length change, in which case the list
-    // will end up being modified but the operation not complete. Unless we
-    // always go through a "toList" we can't really avoid that.
-    int capacity = _capacity;
-    int newLength = length + insertionLength;
-    if (newLength > capacity) {
-      do {
-        capacity = _nextCapacity(capacity);
-      } while (newLength > capacity);
-      _grow(capacity);
-    }
-    _setLength(newLength);
-    setRange(index + insertionLength, this.length, this, index);
-    setAll(index, iterable);
-  }
-
-  void setAll(int index, Iterable<T> iterable) {
-    if (iterable is List) {
-      setRange(index, index + iterable.length, iterable);
-    } else {
-      for (T element in iterable) {
-        this[index++] = element;
-      }
-    }
-  }
-
-  void removeRange(int start, int end) {
-    RangeError.checkValidRange(start, end, this.length);
-    Lists.copy(this, end, this, start, this.length - end);
-    this.length = this.length - (end - start);
-  }
-
-  List<T> sublist(int start, [int? end]) {
-    final int actualEnd = RangeError.checkValidRange(start, end, this.length);
-    int length = actualEnd - start;
-    if (length == 0) return <T>[];
-    final list = new _List(length);
-    for (int i = 0; i < length; i++) {
-      list[i] = this[start + i];
-    }
-    final result = new _GrowableList<T>._withData(list);
-    result._setLength(length);
-    return result;
-  }
-
-  factory _GrowableList(int length) {
-    var data = _allocateData(length);
-    var result = new _GrowableList<T>._withData(data);
-    if (length > 0) {
-      result._setLength(length);
-    }
-    return result;
-  }
-
-  factory _GrowableList.withCapacity(int capacity) {
-    var data = _allocateData(capacity);
-    return new _GrowableList<T>._withData(data);
-  }
-
-  @pragma("vm:exact-result-type",
-      <dynamic>[_GrowableList, "result-type-uses-passed-type-arguments"])
-  factory _GrowableList._withData(_List data) native "GrowableList_allocate";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get _capacity native "GrowableList_getCapacity";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "GrowableList_getLength";
-
-  void set length(int new_length) {
-    int old_capacity = _capacity;
-    int new_capacity = new_length;
-    if (new_capacity > old_capacity) {
-      // Verify that element type is nullable.
-      null as T;
-      _grow(new_capacity);
-      _setLength(new_length);
-      return;
-    }
-    // We are shrinking. Pick the method which has fewer writes.
-    // In the shrink-to-fit path, we write |new_capacity + new_length| words
-    // (null init + copy).
-    // In the non-shrink-to-fit path, we write |length - new_length| words
-    // (null overwrite).
-    final bool shouldShrinkToFit =
-        (new_capacity + new_length) < (length - new_length);
-    if (shouldShrinkToFit) {
-      _shrink(new_capacity, new_length);
-    } else {
-      for (int i = new_length; i < length; i++) {
-        _setIndexed(i, null);
-      }
-    }
-    _setLength(new_length);
-  }
-
-  void _setLength(int new_length) native "GrowableList_setLength";
-
-  void _setData(_List array) native "GrowableList_setData";
-
-  T operator [](int index) native "GrowableList_getIndexed";
-
-  void operator []=(int index, T value) {
-    _setIndexed(index, value);
-  }
-
-  void _setIndexed(int index, T? value) native "GrowableList_setIndexed";
-
-  @pragma("vm:entry-point", "call")
-  @pragma("vm:prefer-inline")
-  void add(T value) {
-    var len = length;
-    if (len == _capacity) {
-      _grow(_nextCapacity(len));
-    }
-    _setLength(len + 1);
-    this[len] = value;
-  }
-
-  void addAll(Iterable<T> iterable) {
-    var len = length;
-    final cid = ClassID.getID(iterable);
-    final isVMList = (cid == ClassID.cidArray) ||
-        (cid == ClassID.cidGrowableObjectArray) ||
-        (cid == ClassID.cidImmutableArray);
-    if (isVMList || (iterable is EfficientLengthIterable)) {
-      var cap = _capacity;
-      // Pregrow if we know iterable.length.
-      var iterLen = iterable.length;
-      var newLen = len + iterLen;
-      if (newLen > cap) {
-        do {
-          cap = _nextCapacity(cap);
-        } while (newLen > cap);
-        _grow(cap);
-      }
-      if (isVMList) {
-        if (identical(iterable, this)) {
-          throw new ConcurrentModificationError(this);
-        }
-        this._setLength(newLen);
-        final ListBase<T> iterableAsList = iterable as ListBase<T>;
-        for (int i = 0; i < iterLen; i++) {
-          this[len++] = iterableAsList[i];
-        }
-        return;
-      }
-    }
-    Iterator it = iterable.iterator;
-    if (!it.moveNext()) return;
-    do {
-      while (len < _capacity) {
-        int newLen = len + 1;
-        this._setLength(newLen);
-        this[len] = it.current;
-        if (!it.moveNext()) return;
-        if (this.length != newLen) throw new ConcurrentModificationError(this);
-        len = newLen;
-      }
-      _grow(_nextCapacity(_capacity));
-    } while (true);
-  }
-
-  @pragma("vm:prefer-inline")
-  T removeLast() {
-    var len = length - 1;
-    var elem = this[len];
-    this.length = len;
-    return elem;
-  }
-
-  T get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  T get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  T get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  // Shared array used as backing for new empty growable arrays.
-  static final _List _emptyList = new _List(0);
-
-  static _List _allocateData(int capacity) {
-    if (capacity == 0) {
-      // Use shared empty list as backing.
-      return _emptyList;
-    }
-    // Round up size to the next odd number, since this is free
-    // because of alignment requirements of the GC.
-    return new _List(capacity | 1);
-  }
-
-  // Grow from 0 to 3, and then double + 1.
-  int _nextCapacity(int old_capacity) => (old_capacity * 2) | 3;
-
-  void _grow(int new_capacity) {
-    var newData = _allocateData(new_capacity);
-    // This is a work-around for dartbug.com/30090: array-bound-check
-    // generalization causes excessive deoptimizations because it
-    // hoists CheckArrayBound(i, ...) out of the loop below and turns it
-    // into CheckArrayBound(length - 1, ...). Which deoptimizes
-    // if length == 0. However the loop itself does not execute
-    // if length == 0.
-    if (length > 0) {
-      for (int i = 0; i < length; i++) {
-        newData[i] = this[i];
-      }
-    }
-    _setData(newData);
-  }
-
-  void _shrink(int new_capacity, int new_length) {
-    var newData = _allocateData(new_capacity);
-    // This is a work-around for dartbug.com/30090. See the comment in _grow.
-    if (new_length > 0) {
-      for (int i = 0; i < new_length; i++) {
-        newData[i] = this[i];
-      }
-    }
-    _setData(newData);
-  }
-
-  // Iterable interface.
-
-  @pragma("vm:prefer-inline")
-  void forEach(f(T element)) {
-    int initialLength = length;
-    for (int i = 0; i < length; i++) {
-      f(this[i]);
-      if (length != initialLength) throw new ConcurrentModificationError(this);
-    }
-  }
-
-  String join([String separator = ""]) {
-    final int length = this.length;
-    if (length == 0) return "";
-    if (length == 1) return "${this[0]}";
-    if (separator.isNotEmpty) return _joinWithSeparator(separator);
-    var i = 0;
-    var codeUnitCount = 0;
-    while (i < length) {
-      final element = this[i];
-      // While list contains one-byte strings.
-      if (element is _OneByteString) {
-        codeUnitCount += element.length;
-        i++;
-        // Loop back while strings are one-byte strings.
-        continue;
-      }
-      // Otherwise, never loop back to the outer loop, and
-      // handle the remaining strings below.
-
-      // Loop while elements are strings,
-      final int firstNonOneByteStringLimit = i;
-      var nextElement = element;
-      while (nextElement is String) {
-        i++;
-        if (i == length) {
-          return _StringBase._concatRangeNative(this, 0, length);
-        }
-        nextElement = this[i];
-      }
-
-      // Not all elements are strings, so allocate a new backing array.
-      final list = new _List(length);
-      for (int copyIndex = 0; copyIndex < i; copyIndex++) {
-        list[copyIndex] = this[copyIndex];
-      }
-      // Is non-zero if list contains a non-onebyte string.
-      var onebyteCanary = i - firstNonOneByteStringLimit;
-      while (true) {
-        final String elementString = "$nextElement";
-        onebyteCanary |=
-            (ClassID.getID(elementString) ^ ClassID.cidOneByteString);
-        list[i] = elementString;
-        codeUnitCount += elementString.length;
-        i++;
-        if (i == length) break;
-        nextElement = this[i];
-      }
-      if (onebyteCanary == 0) {
-        // All elements returned a one-byte string from toString.
-        return _OneByteString._concatAll(list, codeUnitCount);
-      }
-      return _StringBase._concatRangeNative(list, 0, length);
-    }
-    // All elements were one-byte strings.
-    return _OneByteString._concatAll(this, codeUnitCount);
-  }
-
-  String _joinWithSeparator(String separator) {
-    StringBuffer buffer = new StringBuffer();
-    buffer.write(this[0]);
-    for (int i = 1; i < this.length; i++) {
-      buffer.write(separator);
-      buffer.write(this[i]);
-    }
-    return buffer.toString();
-  }
-
-  T elementAt(int index) {
-    return this[index];
-  }
-
-  bool get isEmpty {
-    return this.length == 0;
-  }
-
-  bool get isNotEmpty => !isEmpty;
-
-  void clear() {
-    this.length = 0;
-  }
-
-  String toString() => ListBase.listToString(this);
-
-  @pragma("vm:prefer-inline")
-  Iterator<T> get iterator {
-    return new ListIterator<T>(this);
-  }
-
-  List<T> toList({bool growable: true}) {
-    final length = this.length;
-    if (growable) {
-      if (length > 0) {
-        final list = new _List(length);
-        for (int i = 0; i < length; i++) {
-          list[i] = this[i];
-        }
-        final result = new _GrowableList<T>._withData(list);
-        result._setLength(length);
-        return result;
-      }
-      return <T>[];
-    } else {
-      if (length > 0) {
-        final list = new _List<T>(length);
-        for (int i = 0; i < length; i++) {
-          list[i] = this[i];
-        }
-        return list;
-      }
-      return List<T>.empty(growable: false);
-    }
-  }
-
-  Set<T> toSet() {
-    return new Set<T>.of(this);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/identical_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/identical_patch.dart
deleted file mode 100644
index 4b57430..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/identical_patch.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-@pragma("vm:exact-result-type", bool)
-bool identical(Object? a, Object? b) native "Identical_comparison";
-
-@patch
-@pragma("vm:entry-point", "call")
-int identityHashCode(Object? object) => object._identityHashCode;
diff --git a/sdk_nnbd/lib/_internal/vm/lib/immutable_map.dart b/sdk_nnbd/lib/_internal/vm/lib/immutable_map.dart
deleted file mode 100644
index 7be9890..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/immutable_map.dart
+++ /dev/null
@@ -1,229 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-/// Immutable map class for compiler generated map literals.
-// TODO(lrn): Extend MapBase with UnmodifiableMapMixin when mixins
-// support forwarding const constructors.
-@pragma("vm:entry-point")
-class _ImmutableMap<K, V> implements Map<K, V> {
-  final _ImmutableList _kvPairs;
-
-  @pragma("vm:entry-point")
-  const _ImmutableMap._create(_ImmutableList keyValuePairs)
-      : _kvPairs = keyValuePairs;
-
-  Map<K2, V2> cast<K2, V2>() => Map.castFrom<K, V, K2, V2>(this);
-  V? operator [](Object? key) {
-    // To preserve the key-value order of the map literal, the keys are
-    // not sorted. Need to do linear search or implement an additional
-    // lookup table.
-    for (int i = 0; i < _kvPairs.length - 1; i += 2) {
-      if (key == _kvPairs[i]) {
-        return _kvPairs[i + 1];
-      }
-    }
-    return null;
-  }
-
-  bool get isEmpty {
-    return _kvPairs.length == 0;
-  }
-
-  bool get isNotEmpty => !isEmpty;
-
-  int get length {
-    return _kvPairs.length ~/ 2;
-  }
-
-  void forEach(void f(K key, V value)) {
-    for (int i = 0; i < _kvPairs.length; i += 2) {
-      f(_kvPairs[i], _kvPairs[i + 1]);
-    }
-  }
-
-  Iterable<K> get keys {
-    return new _ImmutableMapKeyIterable<K>(this);
-  }
-
-  Iterable<V> get values {
-    return new _ImmutableMapValueIterable<V>(this);
-  }
-
-  bool containsKey(Object? key) {
-    for (int i = 0; i < _kvPairs.length; i += 2) {
-      if (key == _kvPairs[i]) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  bool containsValue(Object? value) {
-    for (int i = 1; i < _kvPairs.length; i += 2) {
-      if (value == _kvPairs[i]) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  void operator []=(K key, V value) {
-    throw new UnsupportedError("Cannot set value in unmodifiable Map");
-  }
-
-  void addAll(Map<K, V> other) {
-    throw new UnsupportedError("Cannot set value in unmodifiable Map");
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    throw new UnsupportedError("Cannot set value in unmodifiable Map");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear unmodifiable Map");
-  }
-
-  V? remove(Object? key) {
-    throw new UnsupportedError("Cannot remove from unmodifiable Map");
-  }
-
-  Iterable<MapEntry<K, V>> get entries =>
-      new _ImmutableMapEntryIterable<K, V>(this);
-
-  Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> f(K key, V value)) {
-    var result = <K2, V2>{};
-    for (int i = 0; i < _kvPairs.length; i += 2) {
-      var entry = f(_kvPairs[i], _kvPairs[i + 1]);
-      result[entry.key] = entry.value;
-    }
-    return result;
-  }
-
-  void addEntries(Iterable<MapEntry<K, V>> newEntries) {
-    throw new UnsupportedError("Cannot modify an unmodifiable Map");
-  }
-
-  V update(K key, V update(V value), {V ifAbsent()?}) {
-    throw new UnsupportedError("Cannot modify an unmodifiable Map");
-  }
-
-  void updateAll(V update(K key, V value)) {
-    throw new UnsupportedError("Cannot modify an unmodifiable Map");
-  }
-
-  void removeWhere(bool predicate(K key, V value)) {
-    throw new UnsupportedError("Cannot modify an unmodifiable Map");
-  }
-
-  String toString() => MapBase.mapToString(this);
-}
-
-class _ImmutableMapKeyIterable<E> extends EfficientLengthIterable<E> {
-  final _ImmutableMap _map;
-  _ImmutableMapKeyIterable(this._map);
-
-  Iterator<E> get iterator {
-    return new _ImmutableMapKeyIterator<E>(_map);
-  }
-
-  int get length => _map.length;
-}
-
-class _ImmutableMapValueIterable<E> extends EfficientLengthIterable<E> {
-  final _ImmutableMap _map;
-  _ImmutableMapValueIterable(this._map);
-
-  Iterator<E> get iterator {
-    return new _ImmutableMapValueIterator<E>(_map);
-  }
-
-  int get length => _map.length;
-}
-
-class _ImmutableMapEntryIterable<K, V>
-    extends EfficientLengthIterable<MapEntry<K, V>> {
-  final _ImmutableMap _map;
-  _ImmutableMapEntryIterable(this._map);
-
-  Iterator<MapEntry<K, V>> get iterator {
-    return new _ImmutableMapEntryIterator<K, V>(_map);
-  }
-
-  int get length => _map.length;
-}
-
-class _ImmutableMapKeyIterator<E> implements Iterator<E> {
-  _ImmutableMap _map;
-  int _nextIndex = 0;
-  E? _current;
-
-  _ImmutableMapKeyIterator(this._map);
-
-  bool moveNext() {
-    int newIndex = _nextIndex;
-    if (newIndex < _map.length) {
-      _nextIndex = newIndex + 1;
-      _current = _map._kvPairs[newIndex * 2];
-      return true;
-    }
-    _current = null;
-    return false;
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-}
-
-class _ImmutableMapValueIterator<E> implements Iterator<E> {
-  _ImmutableMap _map;
-  int _nextIndex = 0;
-  E? _current;
-
-  _ImmutableMapValueIterator(this._map);
-
-  bool moveNext() {
-    int newIndex = _nextIndex;
-    if (newIndex < _map.length) {
-      _nextIndex = newIndex + 1;
-      _current = _map._kvPairs[newIndex * 2 + 1];
-      return true;
-    }
-    _current = null;
-    return false;
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-}
-
-class _ImmutableMapEntryIterator<K, V> implements Iterator<MapEntry<K, V>> {
-  _ImmutableMap _map;
-  int _nextIndex = 0;
-  MapEntry<K, V>? _current;
-
-  _ImmutableMapEntryIterator(this._map);
-
-  bool moveNext() {
-    int newIndex = _nextIndex;
-    if (newIndex < _map.length) {
-      _nextIndex = newIndex + 1;
-      _current = new MapEntry<K, V>(
-          _map._kvPairs[newIndex * 2], _map._kvPairs[newIndex * 2 + 1]);
-      return true;
-    }
-    _current = null;
-    return false;
-  }
-
-  MapEntry<K, V> get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as MapEntry<K, V>;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/integers.dart b/sdk_nnbd/lib/_internal/vm/lib/integers.dart
deleted file mode 100644
index 9fd3a76..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/integers.dart
+++ /dev/null
@@ -1,735 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-abstract class _IntegerImplementation implements int {
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  num operator +(num other) => other._addFromInteger(this);
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  num operator -(num other) => other._subFromInteger(this);
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  num operator *(num other) => other._mulFromInteger(this);
-
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator ~/(num other) {
-    if ((other is int) && (other == 0)) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return other._truncDivFromInteger(this);
-  }
-
-  double operator /(num other) {
-    return this.toDouble() / other.toDouble();
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  num operator %(num other) {
-    if ((other is int) && (other == 0)) {
-      throw const IntegerDivisionByZeroException();
-    }
-    return other._moduloFromInteger(this);
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator -() {
-    // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
-    // result type as `num`.
-    return unsafeCast<int>(0 - this);
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator &(int other) => other._bitAndFromInteger(this);
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator |(int other) => other._bitOrFromInteger(this);
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator ^(int other) => other._bitXorFromInteger(this);
-
-  num remainder(num other) {
-    return other._remainderFromInteger(this);
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  int _bitAndFromSmi(_Smi other) native "Integer_bitAndFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _bitAndFromInteger(int other) native "Integer_bitAndFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _bitOrFromInteger(int other) native "Integer_bitOrFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _bitXorFromInteger(int other) native "Integer_bitXorFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _shrFromInteger(int other) native "Integer_shrFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _shlFromInteger(int other) native "Integer_shlFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _addFromInteger(int other) native "Integer_addFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _subFromInteger(int other) native "Integer_subFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _mulFromInteger(int other) native "Integer_mulFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _truncDivFromInteger(int other) native "Integer_truncDivFromInteger";
-  @pragma("vm:non-nullable-result-type")
-  int _moduloFromInteger(int other) native "Integer_moduloFromInteger";
-  int _remainderFromInteger(int other) {
-    // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
-    // result type as `num`.
-    return unsafeCast<int>(other - (other ~/ this) * this);
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator >>(int other) => other._shrFromInteger(this);
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:never-inline")
-  int operator <<(int other) => other._shlFromInteger(this);
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator <(num other) {
-    return other > this;
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator >(num other) {
-    return other._greaterThanFromInteger(this);
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator >=(num other) {
-    return (this == other) || (this > other);
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator <=(num other) {
-    return (this == other) || (this < other);
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool _greaterThanFromInteger(int other)
-      native "Integer_greaterThanFromInteger";
-
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:never-inline")
-  bool operator ==(Object other) {
-    if (other is num) {
-      return other._equalToInteger(this);
-    }
-    return false;
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool _equalToInteger(int other) native "Integer_equalToInteger";
-  int abs() {
-    return this < 0 ? -this : this;
-  }
-
-  int get sign {
-    return (this > 0) ? 1 : (this < 0) ? -1 : 0;
-  }
-
-  bool get isEven => ((this & 1) == 0);
-  bool get isOdd => !isEven;
-  bool get isNaN => false;
-  bool get isNegative => this < 0;
-  bool get isInfinite => false;
-  bool get isFinite => true;
-
-  int toUnsigned(int width) {
-    return this & ((1 << width) - 1);
-  }
-
-  int toSigned(int width) {
-    // The value of binary number weights each bit by a power of two.  The
-    // twos-complement value weights the sign bit negatively.  We compute the
-    // value of the negative weighting by isolating the sign bit with the
-    // correct power of two weighting and subtracting it from the value of the
-    // lower bits.
-    int signMask = 1 << (width - 1);
-    return (this & (signMask - 1)) - (this & signMask);
-  }
-
-  int compareTo(num other) {
-    const int EQUAL = 0, LESS = -1, GREATER = 1;
-    if (other is double) {
-      const int MAX_EXACT_INT_TO_DOUBLE = 9007199254740992; // 2^53.
-      const int MIN_EXACT_INT_TO_DOUBLE = -MAX_EXACT_INT_TO_DOUBLE;
-      const bool limitIntsTo64Bits = ((1 << 64) == 0);
-      if (limitIntsTo64Bits) {
-        // With integers limited to 64 bits, double.toInt() clamps
-        // double value to fit into the MIN_INT64..MAX_INT64 range.
-        // Check if the double value is outside of this range.
-        // This check handles +/-infinity as well.
-        const double minInt64AsDouble = -9223372036854775808.0;
-        // MAX_INT64 is not precisely representable in doubles, so
-        // check against (MAX_INT64 + 1).
-        const double maxInt64Plus1AsDouble = 9223372036854775808.0;
-        if (other < minInt64AsDouble) {
-          return GREATER;
-        } else if (other >= maxInt64Plus1AsDouble) {
-          return LESS;
-        }
-      } else {
-        if (other.isInfinite) {
-          return other.isNegative ? GREATER : LESS;
-        }
-      }
-      if (other.isNaN) {
-        return LESS;
-      }
-      if (MIN_EXACT_INT_TO_DOUBLE <= this && this <= MAX_EXACT_INT_TO_DOUBLE) {
-        // Let the double implementation deal with -0.0.
-        return -(other.compareTo(this.toDouble()));
-      } else {
-        // If abs(other) > MAX_EXACT_INT_TO_DOUBLE, then other has an integer
-        // value (no bits below the decimal point).
-        other = other.toInt();
-      }
-    }
-    if (this < other) {
-      return LESS;
-    } else if (this > other) {
-      return GREATER;
-    } else {
-      return EQUAL;
-    }
-  }
-
-  int round() {
-    return this;
-  }
-
-  int floor() {
-    return this;
-  }
-
-  int ceil() {
-    return this;
-  }
-
-  int truncate() {
-    return this;
-  }
-
-  double roundToDouble() {
-    return this.toDouble();
-  }
-
-  double floorToDouble() {
-    return this.toDouble();
-  }
-
-  double ceilToDouble() {
-    return this.toDouble();
-  }
-
-  double truncateToDouble() {
-    return this.toDouble();
-  }
-
-  num clamp(num lowerLimit, num upperLimit) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (lowerLimit == null) {
-      throw new ArgumentError.notNull("lowerLimit");
-    }
-    if (upperLimit == null) {
-      throw new ArgumentError.notNull("upperLimit");
-    }
-    // Special case for integers.
-    if (lowerLimit is int && upperLimit is int && lowerLimit <= upperLimit) {
-      if (this < lowerLimit) return lowerLimit;
-      if (this > upperLimit) return upperLimit;
-      return this;
-    }
-    // Generic case involving doubles, and invalid integer ranges.
-    if (lowerLimit.compareTo(upperLimit) > 0) {
-      throw new ArgumentError(lowerLimit);
-    }
-    if (lowerLimit.isNaN) return lowerLimit;
-    // Note that we don't need to care for -0.0 for the lower limit.
-    if (this < lowerLimit) return lowerLimit;
-    if (this.compareTo(upperLimit) > 0) return upperLimit;
-    return this;
-  }
-
-  int toInt() {
-    return this;
-  }
-
-  @pragma("vm:exact-result-type", _Double)
-  double toDouble() {
-    return new _Double.fromInteger(this);
-  }
-
-  String toStringAsFixed(int fractionDigits) {
-    return this.toDouble().toStringAsFixed(fractionDigits);
-  }
-
-  String toStringAsExponential([int? fractionDigits]) {
-    return this.toDouble().toStringAsExponential(fractionDigits);
-  }
-
-  String toStringAsPrecision(int precision) {
-    return this.toDouble().toStringAsPrecision(precision);
-  }
-
-  static const _digits = "0123456789abcdefghijklmnopqrstuvwxyz";
-
-  String toRadixString(int radix) {
-    if (radix < 2 || 36 < radix) {
-      throw new RangeError.range(radix, 2, 36, "radix");
-    }
-    if (radix & (radix - 1) == 0) {
-      return _toPow2String(radix);
-    }
-    if (radix == 10) return this.toString();
-    final bool isNegative = this < 0;
-    int value = isNegative ? -this : this;
-    if (value < 0) {
-      // With integers limited to 64 bits, the value
-      // MIN_INT64 = -0x8000000000000000 overflows at negation:
-      // -MIN_INT64 == MIN_INT64, so it requires special handling.
-      return _minInt64ToRadixString(radix);
-    }
-    var temp = <int>[];
-    do {
-      int digit = value % radix;
-      value ~/= radix;
-      temp.add(_digits.codeUnitAt(digit));
-    } while (value > 0);
-    if (isNegative) temp.add(0x2d); // '-'.
-
-    _OneByteString string = _OneByteString._allocate(temp.length);
-    for (int i = 0, j = temp.length; j > 0; i++) {
-      string._setAt(i, temp[--j]);
-    }
-    return string;
-  }
-
-  String _toPow2String(int radix) {
-    int value = this;
-    if (value == 0) return "0";
-    assert(radix & (radix - 1) == 0);
-    var negative = value < 0;
-    var bitsPerDigit = radix.bitLength - 1;
-    var length = 0;
-    if (negative) {
-      value = -value;
-      length = 1;
-      if (value < 0) {
-        // With integers limited to 64 bits, the value
-        // MIN_INT64 = -0x8000000000000000 overflows at negation:
-        // -MIN_INT64 == MIN_INT64, so it requires special handling.
-        return _minInt64ToRadixString(radix);
-      }
-    }
-    // Integer division, rounding up, to find number of _digits.
-    length += (value.bitLength + bitsPerDigit - 1) ~/ bitsPerDigit;
-    _OneByteString string = _OneByteString._allocate(length);
-    string._setAt(0, 0x2d); // '-'. Is overwritten if not negative.
-    var mask = radix - 1;
-    do {
-      string._setAt(--length, _digits.codeUnitAt(value & mask));
-      value >>= bitsPerDigit;
-    } while (value > 0);
-    return string;
-  }
-
-  /// Converts negative value to radix string.
-  /// This method is only used to handle corner case of
-  /// MIN_INT64 = -0x8000000000000000.
-  String _minInt64ToRadixString(int radix) {
-    var temp = <int>[];
-    int value = this;
-    assert(value < 0);
-    do {
-      int digit = -unsafeCast<int>(value.remainder(radix));
-      value ~/= radix;
-      temp.add(_digits.codeUnitAt(digit));
-    } while (value != 0);
-    temp.add(0x2d); // '-'.
-
-    _OneByteString string = _OneByteString._allocate(temp.length);
-    for (int i = 0, j = temp.length; j > 0; i++) {
-      string._setAt(i, temp[--j]);
-    }
-    return string;
-  }
-
-  // Returns pow(this, e) % m.
-  int modPow(int e, int m) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (e == null) {
-      throw new ArgumentError.notNull("exponent");
-    }
-    if (m == null) {
-      throw new ArgumentError.notNull("modulus");
-    }
-    if (e < 0) throw new RangeError.range(e, 0, null, "exponent");
-    if (m <= 0) throw new RangeError.range(m, 1, null, "modulus");
-    if (e == 0) return 1;
-
-    // This is floor(sqrt(2^63)).
-    const int maxValueThatCanBeSquaredWithoutTruncation = 3037000499;
-    if (m > maxValueThatCanBeSquaredWithoutTruncation) {
-      // Use BigInt version to avoid truncation in multiplications below.
-      return BigInt.from(this).modPow(BigInt.from(e), BigInt.from(m)).toInt();
-    }
-
-    int b = this;
-    if (b < 0 || b > m) {
-      b %= m;
-    }
-    int r = 1;
-    while (e > 0) {
-      if (e.isOdd) {
-        r = (r * b) % m;
-      }
-      e >>= 1;
-      b = (b * b) % m;
-    }
-    return r;
-  }
-
-  // If inv is false, returns gcd(x, y).
-  // If inv is true and gcd(x, y) = 1, returns d, so that c*x + d*y = 1.
-  // If inv is true and gcd(x, y) != 1, throws Exception("Not coprime").
-  static int _binaryGcd(int x, int y, bool inv) {
-    int s = 0;
-    if (!inv) {
-      while (x.isEven && y.isEven) {
-        x >>= 1;
-        y >>= 1;
-        s++;
-      }
-      if (y.isOdd) {
-        var t = x;
-        x = y;
-        y = t;
-      }
-    }
-    final bool ac = x.isEven;
-    int u = x;
-    int v = y;
-    int a = 1, b = 0, c = 0, d = 1;
-    do {
-      while (u.isEven) {
-        u >>= 1;
-        if (ac) {
-          if (!a.isEven || !b.isEven) {
-            a += y;
-            b -= x;
-          }
-          a >>= 1;
-        } else if (!b.isEven) {
-          b -= x;
-        }
-        b >>= 1;
-      }
-      while (v.isEven) {
-        v >>= 1;
-        if (ac) {
-          if (!c.isEven || !d.isEven) {
-            c += y;
-            d -= x;
-          }
-          c >>= 1;
-        } else if (!d.isEven) {
-          d -= x;
-        }
-        d >>= 1;
-      }
-      if (u >= v) {
-        u -= v;
-        if (ac) a -= c;
-        b -= d;
-      } else {
-        v -= u;
-        if (ac) c -= a;
-        d -= b;
-      }
-    } while (u != 0);
-    if (!inv) return v << s;
-    if (v != 1) {
-      throw new Exception("Not coprime");
-    }
-    if (d < 0) {
-      d += x;
-      if (d < 0) d += x;
-    } else if (d > x) {
-      d -= x;
-      if (d > x) d -= x;
-    }
-    return d;
-  }
-
-  // Returns 1/this % m, with m > 0.
-  int modInverse(int m) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (m == null) {
-      throw new ArgumentError.notNull("modulus");
-    }
-    if (m <= 0) throw new RangeError.range(m, 1, null, "modulus");
-    if (m == 1) return 0;
-    int t = this;
-    if ((t < 0) || (t >= m)) t %= m;
-    if (t == 1) return 1;
-    if ((t == 0) || (t.isEven && m.isEven)) {
-      throw new Exception("Not coprime");
-    }
-    return _binaryGcd(m, t, true);
-  }
-
-  // Returns gcd of abs(this) and abs(other).
-  int gcd(int other) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (other == null) {
-      throw new ArgumentError.notNull("other");
-    }
-    int x = this.abs();
-    int y = other.abs();
-    if (x == 0) return y;
-    if (y == 0) return x;
-    if ((x == 1) || (y == 1)) return 1;
-    return _binaryGcd(x, y, false);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Smi extends _IntegerImplementation {
-  factory _Smi._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  int get hashCode => this;
-  int get _identityHashCode => this;
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator ~() native "Smi_bitNegate";
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int get bitLength native "Smi_bitLength";
-
-  int operator &(int other) => other._bitAndFromSmi(this);
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int _bitAndFromSmi(_Smi other) native "Smi_bitAndFromSmi";
-
-  /**
-   * The digits of '00', '01', ... '99' as a single array.
-   *
-   * Get the digits of `n`, with `0 <= n < 100`, as
-   * `_digitTable[n * 2]` and `_digitTable[n * 2 + 1]`.
-   */
-  static const _digitTable = const [
-    0x30, 0x30, 0x30, 0x31, 0x30, 0x32, 0x30, 0x33, //
-    0x30, 0x34, 0x30, 0x35, 0x30, 0x36, 0x30, 0x37, //
-    0x30, 0x38, 0x30, 0x39, 0x31, 0x30, 0x31, 0x31, //
-    0x31, 0x32, 0x31, 0x33, 0x31, 0x34, 0x31, 0x35, //
-    0x31, 0x36, 0x31, 0x37, 0x31, 0x38, 0x31, 0x39, //
-    0x32, 0x30, 0x32, 0x31, 0x32, 0x32, 0x32, 0x33, //
-    0x32, 0x34, 0x32, 0x35, 0x32, 0x36, 0x32, 0x37, //
-    0x32, 0x38, 0x32, 0x39, 0x33, 0x30, 0x33, 0x31, //
-    0x33, 0x32, 0x33, 0x33, 0x33, 0x34, 0x33, 0x35, //
-    0x33, 0x36, 0x33, 0x37, 0x33, 0x38, 0x33, 0x39, //
-    0x34, 0x30, 0x34, 0x31, 0x34, 0x32, 0x34, 0x33, //
-    0x34, 0x34, 0x34, 0x35, 0x34, 0x36, 0x34, 0x37, //
-    0x34, 0x38, 0x34, 0x39, 0x35, 0x30, 0x35, 0x31, //
-    0x35, 0x32, 0x35, 0x33, 0x35, 0x34, 0x35, 0x35, //
-    0x35, 0x36, 0x35, 0x37, 0x35, 0x38, 0x35, 0x39, //
-    0x36, 0x30, 0x36, 0x31, 0x36, 0x32, 0x36, 0x33, //
-    0x36, 0x34, 0x36, 0x35, 0x36, 0x36, 0x36, 0x37, //
-    0x36, 0x38, 0x36, 0x39, 0x37, 0x30, 0x37, 0x31, //
-    0x37, 0x32, 0x37, 0x33, 0x37, 0x34, 0x37, 0x35, //
-    0x37, 0x36, 0x37, 0x37, 0x37, 0x38, 0x37, 0x39, //
-    0x38, 0x30, 0x38, 0x31, 0x38, 0x32, 0x38, 0x33, //
-    0x38, 0x34, 0x38, 0x35, 0x38, 0x36, 0x38, 0x37, //
-    0x38, 0x38, 0x38, 0x39, 0x39, 0x30, 0x39, 0x31, //
-    0x39, 0x32, 0x39, 0x33, 0x39, 0x34, 0x39, 0x35, //
-    0x39, 0x36, 0x39, 0x37, 0x39, 0x38, 0x39, 0x39, //
-  ];
-
-  /**
-   * Result of int.toString for -99, -98, ..., 98, 99.
-   */
-  static const _smallLookupTable = const [
-    "-99", "-98", "-97", "-96", "-95", "-94", "-93", "-92", "-91", "-90", //
-    "-89", "-88", "-87", "-86", "-85", "-84", "-83", "-82", "-81", "-80", //
-    "-79", "-78", "-77", "-76", "-75", "-74", "-73", "-72", "-71", "-70", //
-    "-69", "-68", "-67", "-66", "-65", "-64", "-63", "-62", "-61", "-60", //
-    "-59", "-58", "-57", "-56", "-55", "-54", "-53", "-52", "-51", "-50", //
-    "-49", "-48", "-47", "-46", "-45", "-44", "-43", "-42", "-41", "-40", //
-    "-39", "-38", "-37", "-36", "-35", "-34", "-33", "-32", "-31", "-30", //
-    "-29", "-28", "-27", "-26", "-25", "-24", "-23", "-22", "-21", "-20", //
-    "-19", "-18", "-17", "-16", "-15", "-14", "-13", "-12", "-11", "-10", //
-    "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", //
-    "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", //
-    "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", //
-    "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", //
-    "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", //
-    "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", //
-    "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", //
-    "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", //
-    "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", //
-    "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", //
-    "91", "92", "93", "94", "95", "96", "97", "98", "99" //
-  ];
-
-  // Powers of 10 above 1000000 are indistinguishable by eye.
-  static const int _POW_10_7 = 10000000;
-  static const int _POW_10_8 = 100000000;
-  static const int _POW_10_9 = 1000000000;
-
-  // Find the number of decimal digits in a positive smi.
-  // Never called with numbers < 100. These are handled before calling.
-  static int _positiveBase10Length(var smi) {
-    // A positive smi has length <= 19 if 63-bit,  <=10 if 31-bit.
-    // Avoid comparing a 31-bit smi to a non-smi.
-    if (smi < 1000) return 3;
-    if (smi < 10000) return 4;
-    if (smi < _POW_10_7) {
-      if (smi < 100000) return 5;
-      if (smi < 1000000) return 6;
-      return 7;
-    }
-    if (smi < _POW_10_8) return 8;
-    if (smi < _POW_10_9) return 9;
-    smi = smi ~/ _POW_10_9;
-    // Handle numbers < 100 before calling recursively.
-    if (smi < 10) return 10;
-    if (smi < 100) return 11;
-    return 9 + _positiveBase10Length(smi);
-  }
-
-  String toString() {
-    if (this < 100 && this > -100) {
-      // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
-      // result type as `num`.
-      return _smallLookupTable[unsafeCast<int>(this + 99)];
-    }
-    if (this < 0) return _negativeToString(this);
-    // Inspired by Andrei Alexandrescu: "Three Optimization Tips for C++"
-    // Avoid expensive remainder operation by doing it on more than
-    // one digit at a time.
-    const int DIGIT_ZERO = 0x30;
-    int length = _positiveBase10Length(this);
-    _OneByteString result = _OneByteString._allocate(length);
-    int index = length - 1;
-    _Smi smi = this;
-    do {
-      // Two digits at a time.
-      final int twoDigits = unsafeCast<int>(smi.remainder(100));
-      smi = unsafeCast<_Smi>(smi ~/ 100);
-      int digitIndex = twoDigits * 2;
-      result._setAt(index, _digitTable[digitIndex + 1]);
-      result._setAt(index - 1, _digitTable[digitIndex]);
-      index -= 2;
-    } while (smi >= 100);
-    if (smi < 10) {
-      // Character code for '0'.
-      // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
-      // result type as `num`.
-      result._setAt(index, unsafeCast<int>(DIGIT_ZERO + smi));
-    } else {
-      // No remainder for this case.
-      // Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
-      // result type as `num`.
-      int digitIndex = unsafeCast<int>(smi * 2);
-      result._setAt(index, _digitTable[digitIndex + 1]);
-      result._setAt(index - 1, _digitTable[digitIndex]);
-    }
-    return result;
-  }
-
-  // Find the number of decimal digits in a negative smi.
-  // Never called with numbers > -100. These are handled before calling.
-  static int _negativeBase10Length(var negSmi) {
-    // A negative smi has length <= 19 if 63-bit, <=10 if 31-bit.
-    // Avoid comparing a 31-bit smi to a non-smi.
-    if (negSmi > -1000) return 3;
-    if (negSmi > -10000) return 4;
-    if (negSmi > -_POW_10_7) {
-      if (negSmi > -100000) return 5;
-      if (negSmi > -1000000) return 6;
-      return 7;
-    }
-    if (negSmi > -_POW_10_8) return 8;
-    if (negSmi > -_POW_10_9) return 9;
-    negSmi = negSmi ~/ _POW_10_9;
-    // Handle numbers > -100 before calling recursively.
-    if (negSmi > -10) return 10;
-    if (negSmi > -100) return 11;
-    return 9 + _negativeBase10Length(negSmi);
-  }
-
-  // Convert a negative smi to a string.
-  // Doesn't negate the smi to avoid negating the most negative smi, which
-  // would become a non-smi.
-  static String _negativeToString(int negSmi) {
-    // Character code for '-'
-    const int MINUS_SIGN = 0x2d;
-    // Character code for '0'.
-    const int DIGIT_ZERO = 0x30;
-    if (negSmi > -10) {
-      return _OneByteString._allocate(2)
-        .._setAt(0, MINUS_SIGN)
-        .._setAt(1, DIGIT_ZERO - negSmi);
-    }
-    if (negSmi > -100) {
-      int digitIndex = 2 * -negSmi;
-      return _OneByteString._allocate(3)
-        .._setAt(0, MINUS_SIGN)
-        .._setAt(1, _digitTable[digitIndex])
-        .._setAt(2, _digitTable[digitIndex + 1]);
-    }
-    // Number of digits, not including minus.
-    int digitCount = _negativeBase10Length(negSmi);
-    _OneByteString result = _OneByteString._allocate(digitCount + 1);
-    result._setAt(0, MINUS_SIGN); // '-'.
-    int index = digitCount;
-    do {
-      int twoDigits = unsafeCast<int>(negSmi.remainder(100));
-      negSmi = negSmi ~/ 100;
-      int digitIndex = -twoDigits * 2;
-      result._setAt(index, _digitTable[digitIndex + 1]);
-      result._setAt(index - 1, _digitTable[digitIndex]);
-      index -= 2;
-    } while (negSmi <= -100);
-    if (negSmi > -10) {
-      result._setAt(index, DIGIT_ZERO - negSmi);
-    } else {
-      // No remainder necessary for this case.
-      int digitIndex = -negSmi * 2;
-      result._setAt(index, _digitTable[digitIndex + 1]);
-      result._setAt(index - 1, _digitTable[digitIndex]);
-    }
-    return result;
-  }
-}
-
-// Represents integers that cannot be represented by Smi but fit into 64bits.
-@pragma("vm:entry-point")
-class _Mint extends _IntegerImplementation {
-  factory _Mint._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  int get hashCode => this;
-  int get _identityHashCode => this;
-  @pragma("vm:non-nullable-result-type")
-  int operator ~() native "Mint_bitNegate";
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int get bitLength native "Mint_bitLength";
-
-  int _bitAndFromSmi(_Smi other) => _bitAndFromInteger(other);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/integers_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/integers_patch.dart
deleted file mode 100644
index 4831353..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/integers_patch.dart
+++ /dev/null
@@ -1,308 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-/// VM implementation of int.
-@patch
-class int {
-  @patch
-  const factory int.fromEnvironment(String name, {int defaultValue = 0})
-      native "Integer_fromEnvironment";
-
-  int _bitAndFromSmi(_Smi other);
-  int _bitAndFromInteger(int other);
-  int _bitOrFromInteger(int other);
-  int _bitXorFromInteger(int other);
-  int _shrFromInteger(int other);
-  int _shlFromInteger(int other);
-
-  static int? _tryParseSmi(String str, int first, int last) {
-    assert(first <= last);
-    var ix = first;
-    var sign = 1;
-    var c = str.codeUnitAt(ix);
-    // Check for leading '+' or '-'.
-    if ((c == 0x2b) || (c == 0x2d)) {
-      ix++;
-      sign = 0x2c - c; // -1 for '-', +1 for '+'.
-      if (ix > last) {
-        return null; // Empty.
-      }
-    }
-    var smiLimit = is64Bit ? 18 : 9;
-    if ((last - ix) >= smiLimit) {
-      return null; // May not fit into a Smi.
-    }
-    var result = 0;
-    for (int i = ix; i <= last; i++) {
-      var c = 0x30 ^ str.codeUnitAt(i);
-      if (9 < c) {
-        return null;
-      }
-      result = 10 * result + c;
-    }
-    return sign * result;
-  }
-
-  @patch
-  static int parse(String source, {int? radix, int onError(String source)?}) {
-    if (source == null) throw new ArgumentError("The source must not be null");
-    if (source.isEmpty) {
-      return _throwFormatException(onError, source, 0, radix, null);
-    }
-    if (radix == null || radix == 10) {
-      // Try parsing immediately, without trimming whitespace.
-      int? result = _tryParseSmi(source, 0, source.length - 1);
-      if (result != null) return result;
-    } else if (radix < 2 || radix > 36) {
-      throw new RangeError("Radix $radix not in range 2..36");
-    }
-    // Split here so improve odds of parse being inlined and the checks omitted.
-    return _parse(unsafeCast<_StringBase>(source), radix, onError);
-  }
-
-  static int _parse(_StringBase source, int? radix, onError) {
-    int end = source._lastNonWhitespace() + 1;
-    if (end == 0) {
-      return _throwFormatException(onError, source, source.length, radix, null);
-    }
-    int start = source._firstNonWhitespace();
-
-    int first = source.codeUnitAt(start);
-    int sign = 1;
-    if (first == 0x2b /* + */ || first == 0x2d /* - */) {
-      sign = 0x2c - first; // -1 if '-', +1 if '+'.
-      start++;
-      if (start == end) {
-        return _throwFormatException(onError, source, end, radix, null);
-      }
-      first = source.codeUnitAt(start);
-    }
-    if (radix == null) {
-      // check for 0x prefix.
-      int index = start;
-      if (first == 0x30 /* 0 */) {
-        index++;
-        if (index == end) return 0;
-        first = source.codeUnitAt(index);
-        if ((first | 0x20) == 0x78 /* x */) {
-          index++;
-          if (index == end) {
-            return _throwFormatException(onError, source, index, null, null);
-          }
-          return _parseRadix(source, 16, index, end, sign, sign > 0, onError);
-        }
-      }
-      radix = 10;
-    }
-    return _parseRadix(source, radix, start, end, sign, false, onError);
-  }
-
-  @patch
-  static int? tryParse(String source, {int? radix}) {
-    if (source == null) throw new ArgumentError("The source must not be null");
-    if (source.isEmpty) return null;
-    if (radix == null || radix == 10) {
-      // Try parsing immediately, without trimming whitespace.
-      int? result = _tryParseSmi(source, 0, source.length - 1);
-      if (result != null) return result;
-    } else if (radix < 2 || radix > 36) {
-      throw new RangeError("Radix $radix not in range 2..36");
-    }
-    try {
-      return _parse(unsafeCast<_StringBase>(source), radix, _kNull);
-    } catch (e) {
-      return null;
-    }
-  }
-
-  static Null _kNull(_) => null;
-
-  static int _throwFormatException(onError, source, index, radix, message) {
-    if (onError != null) return onError(source);
-    if (message != null) {
-      throw new FormatException(message, source, index);
-    }
-    if (radix == null) {
-      throw new FormatException("Invalid number", source, index);
-    }
-    throw new FormatException("Invalid radix-$radix number", source, index);
-  }
-
-  static int _parseRadix(String source, int radix, int start, int end, int sign,
-      bool allowU64, onError) {
-    int tableIndex = (radix - 2) * 4 + (is64Bit ? 2 : 0);
-    int blockSize = _PARSE_LIMITS[tableIndex];
-    int length = end - start;
-    if (length <= blockSize) {
-      int? smi = _parseBlock(source, radix, start, end);
-      if (smi == null) {
-        return _throwFormatException(onError, source, start, radix, null);
-      }
-      return sign * smi;
-    }
-
-    // Often cheaper than: int smallBlockSize = length % blockSize;
-    // because digit count generally tends towards smaller. rather
-    // than larger.
-    int smallBlockSize = length;
-    while (smallBlockSize >= blockSize) smallBlockSize -= blockSize;
-    int result = 0;
-    if (smallBlockSize > 0) {
-      int blockEnd = start + smallBlockSize;
-      int? smi = _parseBlock(source, radix, start, blockEnd);
-      if (smi == null) {
-        return _throwFormatException(onError, source, start, radix, null);
-      }
-      result = sign * smi;
-      start = blockEnd;
-    }
-    int multiplier = _PARSE_LIMITS[tableIndex + 1];
-    int positiveOverflowLimit = 0;
-    int negativeOverflowLimit = 0;
-    tableIndex = tableIndex << 1; // pre-multiply by 2 for simpler indexing
-    positiveOverflowLimit = _int64OverflowLimits[tableIndex];
-    if (positiveOverflowLimit == 0) {
-      positiveOverflowLimit = _initInt64OverflowLimits(tableIndex, multiplier);
-    }
-    negativeOverflowLimit = _int64OverflowLimits[tableIndex + 1];
-    int blockEnd = start + blockSize;
-    do {
-      int? smi = _parseBlock(source, radix, start, blockEnd);
-      if (smi == null) {
-        return _throwFormatException(onError, source, start, radix, null);
-      }
-      if (result >= positiveOverflowLimit) {
-        if ((result > positiveOverflowLimit) ||
-            (smi > _int64OverflowLimits[tableIndex + 2])) {
-          // Although the unsigned overflow limits do not depend on the
-          // platform, the multiplier and block size, which are used to
-          // compute it, do.
-          int X = is64Bit ? 1 : 0;
-          if (allowU64 &&
-              !(result >= _int64UnsignedOverflowLimits[X] &&
-                  (result > _int64UnsignedOverflowLimits[X] ||
-                      smi > _int64UnsignedSmiOverflowLimits[X])) &&
-              blockEnd + blockSize > end) {
-            return (result * multiplier) + smi;
-          }
-          return _throwFormatException(onError, source, null, radix,
-              "Positive input exceeds the limit of integer");
-        }
-      } else if (result <= negativeOverflowLimit) {
-        if ((result < negativeOverflowLimit) ||
-            (smi > _int64OverflowLimits[tableIndex + 3])) {
-          return _throwFormatException(onError, source, null, radix,
-              "Negative input exceeds the limit of integer");
-        }
-      }
-      result = (result * multiplier) + (sign * smi);
-      start = blockEnd;
-      blockEnd = start + blockSize;
-    } while (blockEnd <= end);
-    return result;
-  }
-
-  // Parse block of digits into a Smi.
-  static _Smi? _parseBlock(String source, int radix, int start, int end) {
-    _Smi result = unsafeCast<_Smi>(0);
-    if (radix <= 10) {
-      for (int i = start; i < end; i++) {
-        int digit = source.codeUnitAt(i) ^ 0x30;
-        if (digit >= radix) return null;
-        result = (radix * result + digit) as _Smi;
-      }
-    } else {
-      for (int i = start; i < end; i++) {
-        int char = source.codeUnitAt(i);
-        int digit = char ^ 0x30;
-        if (digit > 9) {
-          digit = (char | 0x20) - (0x61 - 10);
-          if (digit < 10 || digit >= radix) return null;
-        }
-        result = (radix * result + digit) as _Smi;
-      }
-    }
-    return result;
-  }
-
-  // For each radix, 2-36, how many digits are guaranteed to fit in a smi,
-  // and magnitude of such a block (radix ** digit-count).
-  // 32-bit limit/multiplier at (radix - 2)*4, 64-bit limit at (radix-2)*4+2
-  static const _PARSE_LIMITS = const [
-    30, 1073741824, 62, 4611686018427387904, // radix: 2
-    18, 387420489, 39, 4052555153018976267,
-    15, 1073741824, 30, 1152921504606846976,
-    12, 244140625, 26, 1490116119384765625, //  radix: 5
-    11, 362797056, 23, 789730223053602816,
-    10, 282475249, 22, 3909821048582988049,
-    10, 1073741824, 20, 1152921504606846976,
-    9, 387420489, 19, 1350851717672992089,
-    9, 1000000000, 18, 1000000000000000000, //  radix: 10
-    8, 214358881, 17, 505447028499293771,
-    8, 429981696, 17, 2218611106740436992,
-    8, 815730721, 16, 665416609183179841,
-    7, 105413504, 16, 2177953337809371136,
-    7, 170859375, 15, 437893890380859375, //    radix: 15
-    7, 268435456, 15, 1152921504606846976,
-    7, 410338673, 15, 2862423051509815793,
-    7, 612220032, 14, 374813367582081024,
-    7, 893871739, 14, 799006685782884121,
-    6, 64000000, 14, 1638400000000000000, //    radix: 20
-    6, 85766121, 14, 3243919932521508681,
-    6, 113379904, 13, 282810057883082752,
-    6, 148035889, 13, 504036361936467383,
-    6, 191102976, 13, 876488338465357824,
-    6, 244140625, 13, 1490116119384765625, //   radix: 25
-    6, 308915776, 13, 2481152873203736576,
-    6, 387420489, 13, 4052555153018976267,
-    6, 481890304, 12, 232218265089212416,
-    6, 594823321, 12, 353814783205469041,
-    6, 729000000, 12, 531441000000000000, //    radix: 30
-    6, 887503681, 12, 787662783788549761,
-    6, 1073741824, 12, 1152921504606846976,
-    5, 39135393, 12, 1667889514952984961,
-    5, 45435424, 12, 2386420683693101056,
-    5, 52521875, 12, 3379220508056640625, //    radix: 35
-    5, 60466176, 11, 131621703842267136,
-  ];
-
-  static const _maxInt64 = 0x7fffffffffffffff;
-  static const _minInt64 = -0x8000000000000000;
-
-  static const _int64UnsignedOverflowLimits = const [0xfffffffff, 0xf];
-  static const _int64UnsignedSmiOverflowLimits = const [
-    0xfffffff,
-    0xfffffffffffffff
-  ];
-
-  /// Calculation of the expression
-  ///
-  ///   result = (result * multiplier) + (sign * smi)
-  ///
-  /// in `_parseRadix()` may overflow 64-bit integers. In such case,
-  /// `int.parse()` should stop with an error.
-  ///
-  /// This table is lazily filled with int64 overflow limits for result and smi.
-  /// For each multiplier from `_PARSE_LIMITS[tableIndex + 1]` this table
-  /// contains
-  ///
-  /// * `[tableIndex*2]` = positive limit for result
-  /// * `[tableIndex*2 + 1]` = negative limit for result
-  /// * `[tableIndex*2 + 2]` = limit for smi if result is exactly at positive limit
-  /// * `[tableIndex*2 + 3]` = limit for smi if result is exactly at negative limit
-  static final Int64List _int64OverflowLimits =
-      new Int64List(_PARSE_LIMITS.length * 2);
-
-  static int _initInt64OverflowLimits(int tableIndex, int multiplier) {
-    _int64OverflowLimits[tableIndex] = _maxInt64 ~/ multiplier;
-    _int64OverflowLimits[tableIndex + 1] = _minInt64 ~/ multiplier;
-    _int64OverflowLimits[tableIndex + 2] =
-        unsafeCast<int>(_maxInt64.remainder(multiplier));
-    _int64OverflowLimits[tableIndex + 3] =
-        -unsafeCast<int>(_minInt64.remainder(multiplier));
-    return _int64OverflowLimits[tableIndex];
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/internal_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/internal_patch.dart
deleted file mode 100644
index b904f9e..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/internal_patch.dart
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:_internal" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:core" hide Symbol;
-
-import "dart:isolate" show SendPort;
-import "dart:typed_data" show Int32List, Uint8List;
-
-/// These are the additional parts of this patch library:
-// part "class_id_fasta.dart";
-// part "print_patch.dart";
-// part "symbol_patch.dart";
-
-// On the VM, we don't make the entire legacy weak mode check
-// const to avoid having a constant in the platform libraries
-// which evaluates differently in weak vs strong mode.
-@patch
-bool typeAcceptsNull<T>() => (const <Null>[]) is List<int> || null is T;
-
-@patch
-List<T> makeListFixedLength<T>(List<T> growableList)
-    native "Internal_makeListFixedLength";
-
-@patch
-List<T> makeFixedListUnmodifiable<T>(List<T> fixedLengthList)
-    native "Internal_makeFixedListUnmodifiable";
-
-@patch
-Object extractTypeArguments<T>(T instance, Function extract)
-    native "Internal_extractTypeArguments";
-
-/// The returned string is a [_OneByteString] with uninitialized content.
-@pragma("vm:entry-point", "call")
-String allocateOneByteString(int length)
-    native "Internal_allocateOneByteString";
-
-/// The [string] must be a [_OneByteString]. The [index] must be valid.
-@pragma("vm:entry-point", "call")
-void writeIntoOneByteString(String string, int index, int codePoint)
-    native "Internal_writeIntoOneByteString";
-
-/// This function is recognized by the VM and compiled into specialized code.
-/// It is assumed that [from] is a native [Uint8List] class and [to] is a
-/// [_OneByteString]. The [fromStart] and [toStart] indices together with the
-/// [length] must specify ranges within the bounds of the list / string.
-@pragma("vm:prefer-inline")
-void copyRangeFromUint8ListToOneByteString(
-    Uint8List from, String to, int fromStart, int toStart, int length) {
-  for (int i = 0; i < length; i++) {
-    writeIntoOneByteString(to, toStart + i, from[fromStart + i]);
-  }
-}
-
-/// The returned string is a [_TwoByteString] with uninitialized content.
-@pragma("vm:entry-point", "call")
-String allocateTwoByteString(int length)
-    native "Internal_allocateTwoByteString";
-
-/// The [string] must be a [_TwoByteString]. The [index] must be valid.
-@pragma("vm:entry-point", "call")
-void writeIntoTwoByteString(String string, int index, int codePoint)
-    native "Internal_writeIntoTwoByteString";
-
-class VMLibraryHooks {
-  // Example: "dart:isolate _Timer._factory"
-  static var timerFactory;
-
-  // Example: "dart:io _EventHandler._sendData"
-  static var eventHandlerSendData;
-
-  // A nullary closure that answers the current clock value in milliseconds.
-  // Example: "dart:io _EventHandler._timerMillisecondClock"
-  static var timerMillisecondClock;
-
-  // Implementation of Resource.readAsBytes.
-  static var resourceReadAsBytes;
-
-  // Implementation of package root/map provision.
-  static var packageRootString;
-  static var packageConfigString;
-  static var packageConfigUriFuture;
-  static var resolvePackageUriFuture;
-
-  static var _computeScriptUri;
-  static var _cachedScript;
-  static set platformScript(var f) {
-    _computeScriptUri = f;
-    _cachedScript = null;
-  }
-
-  static get platformScript {
-    if (_cachedScript == null && _computeScriptUri != null) {
-      _cachedScript = _computeScriptUri();
-    }
-    return _cachedScript;
-  }
-}
-
-final bool is64Bit = _inquireIs64Bit();
-
-bool _inquireIs64Bit() native "Internal_inquireIs64Bit";
-
-@pragma("vm:entry-point", "call")
-@pragma("vm:exact-result-type", bool)
-@pragma("vm:prefer-inline")
-bool _classRangeCheck(int cid, int lowerLimit, int upperLimit) {
-  return cid >= lowerLimit && cid <= upperLimit;
-}
-
-// Utility class now only used by the VM.
-class Lists {
-  @pragma("vm:prefer-inline")
-  static void copy(List src, int srcStart, List dst, int dstStart, int count) {
-    if (srcStart < dstStart) {
-      for (int i = srcStart + count - 1, j = dstStart + count - 1;
-          i >= srcStart;
-          i--, j--) {
-        dst[j] = src[i];
-      }
-    } else {
-      for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) {
-        dst[j] = src[i];
-      }
-    }
-  }
-}
-
-// Prepend the parent type arguments (maybe null) of length 'parentLen' to the
-// function type arguments (may be null). The result is null if both input
-// vectors are null or is a newly allocated and canonicalized vector of length
-// 'totalLen'.
-@pragma("vm:entry-point", "call")
-_prependTypeArguments(functionTypeArguments, parentTypeArguments, parentLen,
-    totalLen) native "Internal_prependTypeArguments";
-
-// Check that a set of type arguments satisfy the type parameter bounds on a
-// closure.
-@pragma("vm:entry-point", "call")
-_boundsCheckForPartialInstantiation(closure, typeArgs)
-    native "Internal_boundsCheckForPartialInstantiation";
-
-// Called by IRRegExpMacroAssembler::GrowStack.
-Int32List _growRegExpStack(Int32List stack) {
-  final newStack = new Int32List(stack.length * 2);
-  for (int i = 0; i < stack.length; i++) {
-    newStack[i] = stack[i];
-  }
-  return newStack;
-}
-
-// This function can be used to skip implicit or explicit checked down casts in
-// the parts of the core library implementation where we know by construction the
-// type of a value.
-//
-// Important: this is unsafe and must be used with care.
-T unsafeCast<T>(Object? v) native "Internal_unsafeCast";
-
-// This function can be used to keep an object alive til that point.
-//
-// This is implemented by a recognized method, but in bytecode through a native.
-@pragma('vm:prefer-inline')
-void reachabilityFence(Object object) native "Internal_reachabilityFence";
-
-void sendAndExit(SendPort sendPort, var message)
-    native "SendPortImpl_sendAndExitInternal_";
-
-void spawnFunction(
-    SendPort readyPort,
-    String uri,
-    Function topLevelFunction,
-    var message,
-    bool paused,
-    bool errorsAreFatal,
-    SendPort? onExit,
-    SendPort? onError,
-    String? packageConfig,
-    bool newIsolateGroup,
-    String? debugName) native "Isolate_spawnFunction";
-
-// Collection of functions which should only be used for testing purposes.
-abstract class VMInternalsForTesting {
-  // This function can be used by tests to enforce garbage collection.
-  static void collectAllGarbage() native "Internal_collectAllGarbage";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/invocation_mirror_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/invocation_mirror_patch.dart
deleted file mode 100644
index 075e001..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/invocation_mirror_patch.dart
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-// NOTE: When making changes to this class, please also update
-// `VmTarget.instantiateInvocation` and `VmTarget._invocationType` in
-// `pkg/kernel/lib/target/vm.dart`.
-class _InvocationMirror implements Invocation {
-  // Constants describing the invocation kind.
-  // _FIELD cannot be generated by regular invocation mirrors.
-  static const int _UNINITIALIZED = -1;
-  static const int _METHOD = 0;
-  static const int _GETTER = 1;
-  static const int _SETTER = 2;
-  static const int _FIELD = 3;
-  static const int _LOCAL_VAR = 4;
-  static const int _KIND_SHIFT = 0;
-  static const int _KIND_BITS = 3;
-  static const int _KIND_MASK = (1 << _KIND_BITS) - 1;
-
-  // These values, except _DYNAMIC and _SUPER, are only used when throwing
-  // NoSuchMethodError for compile-time resolution failures.
-  static const int _DYNAMIC = 0;
-  static const int _SUPER = 1;
-  static const int _STATIC = 2;
-  static const int _CONSTRUCTOR = 3;
-  static const int _TOP_LEVEL = 4;
-  static const int _LEVEL_SHIFT = _KIND_BITS;
-  static const int _LEVEL_BITS = 3;
-  static const int _LEVEL_MASK = (1 << _LEVEL_BITS) - 1;
-
-  // ArgumentsDescriptor layout. Keep in sync with enum in dart_entry.h.
-  static const int _TYPE_ARGS_LEN = 0;
-  static const int _COUNT = 1;
-  static const int _SIZE = 2;
-  static const int _POSITIONAL_COUNT = 3;
-  static const int _FIRST_NAMED_ENTRY = 4;
-
-  // Internal representation of the invocation mirror.
-  String? _functionName;
-  List? _argumentsDescriptor;
-  List? _arguments;
-  bool _isSuperInvocation = false;
-  int _delayedTypeArgumentsLen = 0;
-
-  // External representation of the invocation mirror; populated on demand.
-  Symbol? _memberName;
-  int _type = _UNINITIALIZED;
-  List<Type>? _typeArguments;
-  List? _positionalArguments;
-  Map<Symbol, dynamic>? _namedArguments;
-
-  _InvocationMirror._withType(this._memberName, int? type, this._typeArguments,
-      this._positionalArguments, this._namedArguments)
-      : _type = type ?? _UNINITIALIZED {
-    _typeArguments ??= const <Type>[];
-    _positionalArguments ??= const [];
-    _namedArguments ??= const {};
-  }
-
-  void _setMemberNameAndType() {
-    final funcName = _functionName!;
-    if (_type == _UNINITIALIZED) {
-      _type = 0;
-    }
-    if (funcName.startsWith("get:")) {
-      _type |= _GETTER;
-      _memberName = new internal.Symbol.unvalidated(funcName.substring(4));
-    } else if (funcName.startsWith("set:")) {
-      _type |= _SETTER;
-      _memberName =
-          new internal.Symbol.unvalidated(funcName.substring(4) + "=");
-    } else {
-      _type |=
-          _isSuperInvocation ? (_SUPER << _LEVEL_SHIFT) | _METHOD : _METHOD;
-      _memberName = new internal.Symbol.unvalidated(funcName);
-    }
-  }
-
-  Symbol get memberName {
-    if (_memberName == null) {
-      _setMemberNameAndType();
-    }
-    return _memberName!;
-  }
-
-  int get _typeArgsLen {
-    int typeArgsLen = _argumentsDescriptor![_TYPE_ARGS_LEN];
-    return typeArgsLen == 0 ? _delayedTypeArgumentsLen : typeArgsLen;
-  }
-
-  List<Type> get typeArguments {
-    if (_typeArguments == null) {
-      if (_typeArgsLen == 0) {
-        return _typeArguments = const <Type>[];
-      }
-      // A TypeArguments object does not have a corresponding Dart class and
-      // cannot be accessed as an array in Dart. Therefore, we need a native
-      // call to unpack the individual types into a list.
-      _typeArguments = _unpackTypeArguments(_arguments![0], _typeArgsLen);
-    }
-    return _typeArguments!;
-  }
-
-  // Unpack the given TypeArguments object into a new list of individual types.
-  static List<Type> _unpackTypeArguments(typeArguments, int numTypeArguments)
-      native "InvocationMirror_unpackTypeArguments";
-
-  List get positionalArguments {
-    if (_positionalArguments == null) {
-      // The argument descriptor counts the receiver, but not the type arguments
-      // as positional arguments.
-      int numPositionalArguments = _argumentsDescriptor![_POSITIONAL_COUNT] - 1;
-      if (numPositionalArguments == 0) {
-        return _positionalArguments = const [];
-      }
-      // Exclude receiver and type args in the returned list.
-      int receiverIndex = _typeArgsLen > 0 ? 1 : 0;
-      var args = _arguments!;
-      _positionalArguments = new _ImmutableList._from(
-          args, receiverIndex + 1, numPositionalArguments);
-    }
-    return _positionalArguments!;
-  }
-
-  Map<Symbol, dynamic> get namedArguments {
-    if (_namedArguments == null) {
-      final argsDescriptor = _argumentsDescriptor!;
-      int numArguments = argsDescriptor[_COUNT] - 1; // Exclude receiver.
-      int numPositionalArguments = argsDescriptor[_POSITIONAL_COUNT] - 1;
-      int numNamedArguments = numArguments - numPositionalArguments;
-      if (numNamedArguments == 0) {
-        return _namedArguments = const {};
-      }
-      int receiverIndex = _typeArgsLen > 0 ? 1 : 0;
-      final namedArguments = new Map<Symbol, dynamic>();
-      for (int i = 0; i < numNamedArguments; i++) {
-        int namedEntryIndex = _FIRST_NAMED_ENTRY + 2 * i;
-        int pos = argsDescriptor[namedEntryIndex + 1];
-        String arg_name = argsDescriptor[namedEntryIndex];
-        var arg_value = _arguments![receiverIndex + pos];
-        namedArguments[new internal.Symbol.unvalidated(arg_name)] = arg_value;
-      }
-      _namedArguments = new Map.unmodifiable(namedArguments);
-    }
-    return _namedArguments!;
-  }
-
-  bool get isMethod {
-    if (_type == _UNINITIALIZED) {
-      _setMemberNameAndType();
-    }
-    return (_type & _KIND_MASK) == _METHOD;
-  }
-
-  bool get isAccessor {
-    if (_type == _UNINITIALIZED) {
-      _setMemberNameAndType();
-    }
-    return (_type & _KIND_MASK) != _METHOD;
-  }
-
-  bool get isGetter {
-    if (_type == _UNINITIALIZED) {
-      _setMemberNameAndType();
-    }
-    return (_type & _KIND_MASK) == _GETTER;
-  }
-
-  bool get isSetter {
-    if (_type == _UNINITIALIZED) {
-      _setMemberNameAndType();
-    }
-    return (_type & _KIND_MASK) == _SETTER;
-  }
-
-  _InvocationMirror(this._functionName, this._argumentsDescriptor,
-      this._arguments, this._isSuperInvocation, this._type,
-      [this._delayedTypeArgumentsLen = 0]);
-
-  _InvocationMirror._withoutType(this._functionName, this._typeArguments,
-      this._positionalArguments, this._namedArguments, this._isSuperInvocation,
-      [this._delayedTypeArgumentsLen = 0]);
-
-  @pragma("vm:entry-point", "call")
-  static _allocateInvocationMirror(String functionName,
-      List argumentsDescriptor, List arguments, bool isSuperInvocation,
-      [int type = _UNINITIALIZED]) {
-    return new _InvocationMirror(
-        functionName, argumentsDescriptor, arguments, isSuperInvocation, type);
-  }
-
-  // This factory is used when creating an `Invocation` for a closure call which
-  // may have delayed type arguments. In that case, the arguments descriptor will
-  // indicate 0 type arguments, but the actual number of type arguments are
-  // passed in `delayedTypeArgumentsLen`. If any type arguments are available,
-  // the type arguments vector will be the first entry in `arguments`.
-  @pragma("vm:entry-point", "call")
-  static _allocateInvocationMirrorForClosure(
-      String functionName,
-      List argumentsDescriptor,
-      List arguments,
-      int? type,
-      int delayedTypeArgumentsLen) {
-    return new _InvocationMirror(functionName, argumentsDescriptor, arguments,
-        false, type ?? _UNINITIALIZED, delayedTypeArgumentsLen);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/isolate_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/isolate_patch.dart
deleted file mode 100644
index da2ed68..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/isolate_patch.dart
+++ /dev/null
@@ -1,676 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:isolate" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal" show ClassID, VMLibraryHooks, patch;
-
-import "dart:async"
-    show Completer, Future, Stream, StreamController, StreamSubscription, Timer;
-
-import "dart:collection" show HashMap;
-import "dart:typed_data" show ByteBuffer, TypedData, Uint8List;
-import "dart:_internal" show spawnFunction;
-
-/// These are the additional parts of this patch library:
-// part "timer_impl.dart";
-
-@patch
-class ReceivePort {
-  @patch
-  factory ReceivePort() => new _ReceivePortImpl();
-
-  @patch
-  factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) {
-    return new _ReceivePortImpl.fromRawReceivePort(rawPort);
-  }
-}
-
-@patch
-class Capability {
-  @patch
-  factory Capability() => new _CapabilityImpl();
-}
-
-@pragma("vm:entry-point")
-class _CapabilityImpl implements Capability {
-  factory _CapabilityImpl() native "CapabilityImpl_factory";
-
-  bool operator ==(var other) {
-    return (other is _CapabilityImpl) && _equals(other);
-  }
-
-  int get hashCode {
-    return _get_hashcode();
-  }
-
-  _equals(other) native "CapabilityImpl_equals";
-  _get_hashcode() native "CapabilityImpl_get_hashcode";
-}
-
-@patch
-class RawReceivePort {
-  /**
-   * Opens a long-lived port for receiving messages.
-   *
-   * A [RawReceivePort] is low level and does not work with [Zone]s. It
-   * can not be paused. The data-handler must be set before the first
-   * event is received.
-   */
-  @patch
-  factory RawReceivePort([Function? handler]) {
-    _RawReceivePortImpl result = new _RawReceivePortImpl();
-    result.handler = handler;
-    return result;
-  }
-}
-
-class _ReceivePortImpl extends Stream implements ReceivePort {
-  _ReceivePortImpl() : this.fromRawReceivePort(new RawReceivePort());
-
-  _ReceivePortImpl.fromRawReceivePort(this._rawPort)
-      : _controller = new StreamController(sync: true) {
-    _controller.onCancel = close;
-    _rawPort.handler = _controller.add;
-  }
-
-  SendPort get sendPort {
-    return _rawPort.sendPort;
-  }
-
-  StreamSubscription listen(void onData(var message)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  close() {
-    _rawPort.close();
-    _controller.close();
-  }
-
-  final RawReceivePort _rawPort;
-  final StreamController _controller;
-}
-
-typedef void _ImmediateCallback();
-
-/// The callback that has been registered through `scheduleImmediate`.
-_ImmediateCallback? _pendingImmediateCallback;
-
-/// The closure that should be used as scheduleImmediateClosure, when the VM
-/// is responsible for the event loop.
-void _isolateScheduleImmediate(void callback()) {
-  assert((_pendingImmediateCallback == null) ||
-      (_pendingImmediateCallback == callback));
-  _pendingImmediateCallback = callback;
-}
-
-@pragma("vm:entry-point", "call")
-void _runPendingImmediateCallback() {
-  final callback = _pendingImmediateCallback;
-  if (callback != null) {
-    _pendingImmediateCallback = null;
-    callback();
-  }
-}
-
-/// The embedder can execute this function to get hold of
-/// [_isolateScheduleImmediate] above.
-@pragma("vm:entry-point", "call")
-Function _getIsolateScheduleImmediateClosure() {
-  return _isolateScheduleImmediate;
-}
-
-@pragma("vm:entry-point")
-class _RawReceivePortImpl implements RawReceivePort {
-  factory _RawReceivePortImpl() native "RawReceivePortImpl_factory";
-
-  close() {
-    // Close the port and remove it from the handler map.
-    _handlerMap.remove(this._closeInternal());
-  }
-
-  SendPort get sendPort {
-    return _get_sendport();
-  }
-
-  bool operator ==(var other) {
-    return (other is _RawReceivePortImpl) &&
-        (this._get_id() == other._get_id());
-  }
-
-  int get hashCode {
-    return sendPort.hashCode;
-  }
-
-  /**** Internal implementation details ****/
-  _get_id() native "RawReceivePortImpl_get_id";
-  _get_sendport() native "RawReceivePortImpl_get_sendport";
-
-  // Called from the VM to retrieve the handler for a message.
-  @pragma("vm:entry-point", "call")
-  static _lookupHandler(int id) {
-    var result = _handlerMap[id];
-    return result;
-  }
-
-  // Called from the VM to dispatch to the handler.
-  @pragma("vm:entry-point", "call")
-  static void _handleMessage(Function handler, var message) {
-    // TODO(floitsch): this relies on the fact that any exception aborts the
-    // VM. Once we have non-fatal global exceptions we need to catch errors
-    // so that we can run the immediate callbacks.
-    handler(message);
-    _runPendingImmediateCallback();
-  }
-
-  // Call into the VM to close the VM maintained mappings.
-  _closeInternal() native "RawReceivePortImpl_closeInternal";
-
-  void set handler(Function? value) {
-    _handlerMap[this._get_id()] = value;
-  }
-
-  // TODO(iposva): Ideally keep this map in the VM.
-  // id to handler mapping.
-  static _initHandlerMap() {
-    // TODO(18511): Workaround bad CheckSmi hoisting.
-    var tempMap = new HashMap();
-    // Collect feedback that not all keys are Smis.
-    tempMap["."] = 1;
-    tempMap["."] = 2;
-
-    return new HashMap();
-  }
-
-  static final Map _handlerMap = _initHandlerMap();
-}
-
-@pragma("vm:entry-point")
-class _SendPortImpl implements SendPort {
-  factory _SendPortImpl._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  /*--- public interface ---*/
-  @pragma("vm:entry-point", "call")
-  void send(var message) {
-    _sendInternal(message);
-  }
-
-  bool operator ==(var other) {
-    return (other is _SendPortImpl) && (this._get_id() == other._get_id());
-  }
-
-  int get hashCode {
-    return _get_hashcode();
-  }
-
-  /*--- private implementation ---*/
-  _get_id() native "SendPortImpl_get_id";
-  _get_hashcode() native "SendPortImpl_get_hashcode";
-
-  // Forward the implementation of sending messages to the VM.
-  void _sendInternal(var message) native "SendPortImpl_sendInternal_";
-}
-
-typedef _NullaryFunction();
-typedef _UnaryFunction(Never args);
-typedef _BinaryFunction(Never args, Never message);
-
-/**
- * Takes the real entry point as argument and invokes it with the
- * initial message.  Defers execution of the entry point until the
- * isolate is in the message loop.
- */
-@pragma("vm:entry-point", "call")
-void _startMainIsolate(Function entryPoint, List<String> args) {
-  _startIsolate(
-      null, // no parent port
-      entryPoint,
-      args,
-      null, // no message
-      true, // isSpawnUri
-      null, // no control port
-      null); // no capabilities
-}
-
-/**
- * Returns the _startMainIsolate function. This closurization allows embedders
- * to setup trampolines to the main function. This workaround can be removed
- * once support for @pragma("vm:entry_point", "get") as documented in
- * https://github.com/dart-lang/sdk/issues/35720 lands.
- */
-@pragma("vm:entry-point", "call")
-Function _getStartMainIsolateFunction() {
-  return _startMainIsolate;
-}
-
-/**
- * Takes the real entry point as argument and invokes it with the initial
- * message.
- */
-@pragma("vm:entry-point", "call")
-void _startIsolate(
-    SendPort? parentPort,
-    Function entryPoint,
-    List<String>? args,
-    Object? message,
-    bool isSpawnUri,
-    RawReceivePort? controlPort,
-    List? capabilities) {
-  // The control port (aka the main isolate port) does not handle any messages.
-  if (controlPort != null) {
-    controlPort.handler = (_) {}; // Nobody home on the control port.
-
-    if (parentPort != null) {
-      // Build a message to our parent isolate providing access to the
-      // current isolate's control port and capabilities.
-      //
-      // TODO(floitsch): Send an error message if we can't find the entry point.
-      final readyMessage = List<Object?>.filled(2, null);
-      readyMessage[0] = controlPort.sendPort;
-      readyMessage[1] = capabilities;
-
-      // Out of an excess of paranoia we clear the capabilities from the
-      // stack.  Not really necessary.
-      capabilities = null;
-      parentPort.send(readyMessage);
-    }
-  }
-  assert(capabilities == null);
-
-  // Delay all user code handling to the next run of the message loop. This
-  // allows us to intercept certain conditions in the event dispatch, such as
-  // starting in paused state.
-  RawReceivePort port = new RawReceivePort();
-  port.handler = (_) {
-    port.close();
-
-    if (isSpawnUri) {
-      if (entryPoint is _BinaryFunction) {
-        (entryPoint as dynamic)(args, message);
-      } else if (entryPoint is _UnaryFunction) {
-        (entryPoint as dynamic)(args);
-      } else {
-        entryPoint();
-      }
-    } else {
-      entryPoint(message);
-    }
-  };
-  // Make sure the message handler is triggered.
-  port.sendPort.send(null);
-}
-
-@patch
-class Isolate {
-  static final _currentIsolate = _getCurrentIsolate();
-  static final _rootUri = _getCurrentRootUri();
-
-  @patch
-  static Isolate get current => _currentIsolate;
-
-  @patch
-  String get debugName => _getDebugName(controlPort);
-
-  @patch
-  static Future<Uri?> get packageRoot {
-    return Future.value(null);
-  }
-
-  @patch
-  static Future<Uri?> get packageConfig {
-    var hook = VMLibraryHooks.packageConfigUriFuture;
-    if (hook == null) {
-      throw new UnsupportedError("Isolate.packageConfig");
-    }
-    return hook();
-  }
-
-  @patch
-  static Future<Uri?> resolvePackageUri(Uri packageUri) {
-    var hook = VMLibraryHooks.resolvePackageUriFuture;
-    if (hook == null) {
-      throw new UnsupportedError("Isolate.resolvePackageUri");
-    }
-    return hook(packageUri);
-  }
-
-  static bool _packageSupported() =>
-      (VMLibraryHooks.packageConfigUriFuture != null) &&
-      (VMLibraryHooks.resolvePackageUriFuture != null);
-
-  @patch
-  static Future<Isolate> spawn<T>(void entryPoint(T message), T message,
-      {bool paused = false,
-      bool errorsAreFatal = true,
-      SendPort? onExit,
-      SendPort? onError,
-      String? debugName}) async {
-    // `paused` isn't handled yet.
-    // Check for the type of `entryPoint` on the spawning isolate to make
-    // error-handling easier.
-    if (entryPoint is! _UnaryFunction) {
-      throw new ArgumentError(entryPoint);
-    }
-    // The VM will invoke [_startIsolate] with entryPoint as argument.
-
-    // We do not inherit the package config settings from the parent isolate,
-    // instead we use the values that were set on the command line.
-    var packageConfig = VMLibraryHooks.packageConfigString;
-    var script = VMLibraryHooks.platformScript;
-    if (script == null) {
-      // We do not have enough information to support spawning the new
-      // isolate.
-      throw new UnsupportedError("Isolate.spawn");
-    }
-    if (script.isScheme("package")) {
-      script = await Isolate.resolvePackageUri(script);
-    }
-
-    const bool newIsolateGroup = false;
-    final RawReceivePort readyPort = new RawReceivePort();
-    try {
-      spawnFunction(
-          readyPort.sendPort,
-          script.toString(),
-          entryPoint,
-          message,
-          paused,
-          errorsAreFatal,
-          onExit,
-          onError,
-          packageConfig,
-          newIsolateGroup,
-          debugName);
-      return await _spawnCommon(readyPort);
-    } catch (e, st) {
-      readyPort.close();
-      return await new Future<Isolate>.error(e, st);
-    }
-  }
-
-  @patch
-  static Future<Isolate> spawnUri(Uri uri, List<String> args, var message,
-      {bool paused = false,
-      SendPort? onExit,
-      SendPort? onError,
-      bool errorsAreFatal = true,
-      bool? checked,
-      Map<String, String>? environment,
-      Uri? packageRoot,
-      Uri? packageConfig,
-      bool automaticPackageResolution = false,
-      String? debugName}) async {
-    if (environment != null) {
-      throw new UnimplementedError("environment");
-    }
-
-    // Verify that no mutually exclusive arguments have been passed.
-    if (automaticPackageResolution) {
-      if (packageRoot != null) {
-        throw new ArgumentError("Cannot simultaneously request "
-            "automaticPackageResolution and specify a"
-            "packageRoot.");
-      }
-      if (packageConfig != null) {
-        throw new ArgumentError("Cannot simultaneously request "
-            "automaticPackageResolution and specify a"
-            "packageConfig.");
-      }
-    } else {
-      if ((packageRoot != null) && (packageConfig != null)) {
-        throw new ArgumentError("Cannot simultaneously specify a "
-            "packageRoot and a packageConfig.");
-      }
-    }
-    // Resolve the uri against the current isolate's root Uri first.
-    final Uri spawnedUri = _rootUri!.resolveUri(uri);
-
-    // Inherit this isolate's package resolution setup if not overridden.
-    if (!automaticPackageResolution && packageConfig == null) {
-      if (Isolate._packageSupported()) {
-        packageConfig = await Isolate.packageConfig;
-      }
-    }
-
-    // Ensure to resolve package: URIs being handed in as parameters.
-    if (packageConfig != null) {
-      // Avoid calling resolvePackageUri if not strictly necessary in case
-      // the API is not supported.
-      if (packageConfig.isScheme("package")) {
-        packageConfig = await Isolate.resolvePackageUri(packageConfig);
-      }
-    }
-
-    // The VM will invoke [_startIsolate] and not `main`.
-    final packageConfigString = packageConfig?.toString();
-
-    final RawReceivePort readyPort = new RawReceivePort();
-    try {
-      _spawnUri(
-          readyPort.sendPort,
-          spawnedUri.toString(),
-          args,
-          message,
-          paused,
-          onExit,
-          onError,
-          errorsAreFatal,
-          checked,
-          null,
-          /* environment */
-          packageConfigString,
-          debugName);
-      return await _spawnCommon(readyPort);
-    } catch (e) {
-      readyPort.close();
-      rethrow;
-    }
-  }
-
-  static Future<Isolate> _spawnCommon(RawReceivePort readyPort) {
-    final completer = new Completer<Isolate>.sync();
-    readyPort.handler = (readyMessage) {
-      readyPort.close();
-      if (readyMessage is List && readyMessage.length == 2) {
-        SendPort controlPort = readyMessage[0];
-        List capabilities = readyMessage[1];
-        completer.complete(new Isolate(controlPort,
-            pauseCapability: capabilities[0],
-            terminateCapability: capabilities[1]));
-      } else if (readyMessage is String) {
-        // We encountered an error while starting the new isolate.
-        completer.completeError(new IsolateSpawnException(
-            'Unable to spawn isolate: ${readyMessage}'));
-      } else {
-        // This shouldn't happen.
-        completer.completeError(new IsolateSpawnException(
-            "Internal error: unexpected format for ready message: "
-            "'${readyMessage}'"));
-      }
-    };
-    return completer.future;
-  }
-
-  // TODO(iposva): Cleanup to have only one definition.
-  // These values need to be kept in sync with the class IsolateMessageHandler
-  // in vm/isolate.cc.
-  static const _PAUSE = 1;
-  static const _RESUME = 2;
-  static const _PING = 3;
-  static const _KILL = 4;
-  static const _ADD_EXIT = 5;
-  static const _DEL_EXIT = 6;
-  static const _ADD_ERROR = 7;
-  static const _DEL_ERROR = 8;
-  static const _ERROR_FATAL = 9;
-
-  // For 'spawnFunction' see internal_patch.dart.
-
-  static void _spawnUri(
-      SendPort readyPort,
-      String uri,
-      List<String> args,
-      var message,
-      bool paused,
-      SendPort? onExit,
-      SendPort? onError,
-      bool errorsAreFatal,
-      bool? checked,
-      List? environment,
-      String? packageConfig,
-      String? debugName) native "Isolate_spawnUri";
-
-  static void _sendOOB(port, msg) native "Isolate_sendOOB";
-
-  static String _getDebugName(SendPort controlPort)
-      native "Isolate_getDebugName";
-
-  @patch
-  void _pause(Capability resumeCapability) {
-    // _sendOOB expects a fixed length array and hence we create a fixed
-    // length array and assign values to it instead of using [ ... ].
-    var msg = new List<Object?>.filled(4, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _PAUSE
-      ..[2] = pauseCapability
-      ..[3] = resumeCapability;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void resume(Capability resumeCapability) {
-    var msg = new List<Object?>.filled(4, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _RESUME
-      ..[2] = pauseCapability
-      ..[3] = resumeCapability;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void addOnExitListener(SendPort responsePort, {Object? response}) {
-    var msg = new List<Object?>.filled(4, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _ADD_EXIT
-      ..[2] = responsePort
-      ..[3] = response;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void removeOnExitListener(SendPort responsePort) {
-    var msg = new List<Object?>.filled(3, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _DEL_EXIT
-      ..[2] = responsePort;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void setErrorsFatal(bool errorsAreFatal) {
-    var msg = new List<Object?>.filled(4, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _ERROR_FATAL
-      ..[2] = terminateCapability
-      ..[3] = errorsAreFatal;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void kill({int priority: beforeNextEvent}) {
-    var msg = new List<Object?>.filled(4, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _KILL
-      ..[2] = terminateCapability
-      ..[3] = priority;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void ping(SendPort responsePort,
-      {Object? response, int priority: immediate}) {
-    var msg = new List<Object?>.filled(5, null)
-      ..[0] = 0 // Make room for OOM message type.
-      ..[1] = _PING
-      ..[2] = responsePort
-      ..[3] = priority
-      ..[4] = response;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void addErrorListener(SendPort port) {
-    var msg = new List<Object?>.filled(3, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _ADD_ERROR
-      ..[2] = port;
-    _sendOOB(controlPort, msg);
-  }
-
-  @patch
-  void removeErrorListener(SendPort port) {
-    var msg = new List<Object?>.filled(3, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = _DEL_ERROR
-      ..[2] = port;
-    _sendOOB(controlPort, msg);
-  }
-
-  static Isolate _getCurrentIsolate() {
-    List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate();
-    return new Isolate(portAndCapabilities[0],
-        pauseCapability: portAndCapabilities[1],
-        terminateCapability: portAndCapabilities[2]);
-  }
-
-  static List _getPortAndCapabilitiesOfCurrentIsolate()
-      native "Isolate_getPortAndCapabilitiesOfCurrentIsolate";
-
-  static Uri? _getCurrentRootUri() {
-    try {
-      return Uri.parse(_getCurrentRootUriStr());
-    } catch (e) {
-      return null;
-    }
-  }
-
-  static String _getCurrentRootUriStr() native "Isolate_getCurrentRootUriStr";
-}
-
-@patch
-abstract class TransferableTypedData {
-  @patch
-  factory TransferableTypedData.fromList(List<TypedData> chunks) {
-    if (chunks == null) {
-      throw ArgumentError(chunks);
-    }
-    final int cid = ClassID.getID(chunks);
-    if (cid != ClassID.cidArray &&
-        cid != ClassID.cidGrowableObjectArray &&
-        cid != ClassID.cidImmutableArray) {
-      chunks = List.unmodifiable(chunks);
-    }
-    return _TransferableTypedDataImpl(chunks);
-  }
-}
-
-@pragma("vm:entry-point")
-class _TransferableTypedDataImpl implements TransferableTypedData {
-  factory _TransferableTypedDataImpl(List<TypedData> list)
-      native "TransferableTypedData_factory";
-
-  ByteBuffer materialize() {
-    return _materializeIntoUint8List().buffer;
-  }
-
-  Uint8List _materializeIntoUint8List()
-      native "TransferableTypedData_materialize";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart b/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart
deleted file mode 100644
index d8e52fd..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/lib_prefix.dart
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2014, 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.
-
-// part of "core_patch.dart";
-
-// This type corresponds to the VM-internal class LibraryPrefix.
-@pragma("vm:entry-point")
-class _LibraryPrefix {
-  factory _LibraryPrefix._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  bool _isLoaded() native "LibraryPrefix_isLoaded";
-  void _setLoaded() native "LibraryPrefix_setLoaded";
-}
-
-class _DeferredNotLoadedError extends Error implements NoSuchMethodError {
-  final _LibraryPrefix prefix;
-
-  _DeferredNotLoadedError(this.prefix);
-
-  String toString() {
-    return "Deferred library $prefix was not loaded.";
-  }
-}
-
-@pragma("vm:entry-point")
-@pragma("vm:never-inline") // Don't duplicate prefix checking code.
-Future<void> _loadLibrary(_LibraryPrefix prefix) {
-  return new Future<void>(() {
-    prefix._setLoaded();
-  });
-}
-
-@pragma("vm:entry-point")
-@pragma("vm:never-inline") // Don't duplicate prefix checking code.
-void _checkLoaded(_LibraryPrefix prefix) {
-  if (!prefix._isLoaded()) {
-    throw new _DeferredNotLoadedError(prefix);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/map_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/map_patch.dart
deleted file mode 100644
index 07dbc69..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/map_patch.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class Map<K, V> {
-  // Factory constructing a Map from a parser generated Map literal.
-  // [elements] contains n key-value pairs.
-  // The keys are at position 2*n and are already type checked by the parser
-  // in checked mode.
-  // The values are at position 2*n+1 and are not yet type checked.
-  @pragma("vm:entry-point", "call")
-  factory Map._fromLiteral(List elements) {
-    var map = new LinkedHashMap<K, V>();
-    var len = elements.length;
-    for (int i = 1; i < len; i += 2) {
-      map[elements[i - 1]] = elements[i];
-    }
-    return map;
-  }
-
-  @patch
-  factory Map.unmodifiable(Map other) {
-    return new UnmodifiableMapView<K, V>(new Map<K, V>.from(other));
-  }
-
-  @patch
-  factory Map() => new LinkedHashMap<K, V>();
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/math_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/math_patch.dart
deleted file mode 100644
index b41daad..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/math_patch.dart
+++ /dev/null
@@ -1,301 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:math" which contains all the imports used
-/// by patches of that library. We plan to change this when we have a shared
-/// front end and simply use parts.
-
-import "dart:_internal" show patch;
-
-import "dart:typed_data" show Uint32List;
-
-/// There are no parts of this patch library.
-
-@patch
-@pragma("vm:prefer-inline")
-T min<T extends num>(T a, T b) {
-  if (a > b) return b;
-  if (a < b) return a;
-  if (b is double) {
-    // Special case for NaN and -0.0. If one argument is NaN return NaN.
-    // [min] must also distinguish between -0.0 and 0.0.
-    if (a is double) {
-      if (a == 0.0) {
-        // a is either 0.0 or -0.0. b is either 0.0, -0.0 or NaN.
-        // The following returns -0.0 if either a or b is -0.0, and it
-        // returns NaN if b is NaN.
-        num n = (a + b) * a * b;
-        return n as T;
-      }
-    }
-    // Check for NaN and b == -0.0.
-    if (a == 0 && b.isNegative || b.isNaN) return b;
-    return a;
-  }
-  return a;
-}
-
-@patch
-@pragma("vm:prefer-inline")
-T max<T extends num>(T a, T b) {
-  if (a > b) return a;
-  if (a < b) return b;
-  if (b is double) {
-    // Special case for NaN and -0.0. If one argument is NaN return NaN.
-    // [max] must also distinguish between -0.0 and 0.0.
-    if (a is double) {
-      if (a == 0.0) {
-        // a is either 0.0 or -0.0. b is either 0.0, -0.0, or NaN.
-        // The following returns 0.0 if either a or b is 0.0, and it
-        // returns NaN if b is NaN.
-        num n = a + b;
-        return n as T;
-      }
-    }
-    // Check for NaN.
-    if (b.isNaN) return b;
-    return a;
-  }
-  // max(-0.0, 0) must return 0.
-  if (b == 0 && a.isNegative) return b;
-  return a;
-}
-
-// If [x] is an [int] and [exponent] is a non-negative [int], the result is
-// an [int], otherwise the result is a [double].
-@patch
-@pragma("vm:prefer-inline")
-num pow(num x, num exponent) {
-  if ((x is int) && (exponent is int) && (exponent >= 0)) {
-    return _intPow(x, exponent);
-  }
-  return _doublePow(x.toDouble(), exponent.toDouble());
-}
-
-@pragma("vm:exact-result-type", "dart:core#_Double")
-double _doublePow(double base, double exponent) {
-  if (exponent == 0.0) {
-    return 1.0; // ECMA-262 15.8.2.13
-  }
-  // Speed up simple cases.
-  if (exponent == 1.0) return base;
-  if (exponent == 2.0) return base * base;
-  if (exponent == 3.0) return base * base * base;
-
-  if (base == 1.0) return 1.0;
-
-  if (base.isNaN || exponent.isNaN) {
-    return double.nan;
-  }
-  if ((base != -double.infinity) && (exponent == 0.5)) {
-    if (base == 0.0) {
-      return 0.0;
-    }
-    return sqrt(base);
-  }
-  return _pow(base.toDouble(), exponent.toDouble());
-}
-
-double _pow(double base, double exponent) native "Math_doublePow";
-
-int _intPow(int base, int exponent) {
-  // Exponentiation by squaring.
-  int result = 1;
-  while (exponent != 0) {
-    if ((exponent & 1) == 1) {
-      result *= base;
-    }
-    exponent >>= 1;
-    // Skip unnecessary operation (can overflow to Mint).
-    if (exponent != 0) {
-      base *= base;
-    }
-  }
-  return result;
-}
-
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double atan2(num a, num b) => _atan2(a.toDouble(), b.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double sin(num radians) => _sin(radians.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double cos(num radians) => _cos(radians.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double tan(num radians) => _tan(radians.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double acos(num x) => _acos(x.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double asin(num x) => _asin(x.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double atan(num x) => _atan(x.toDouble());
-@patch
-@pragma("vm:exact-result-type", "dart:core#_Double")
-@pragma("vm:never-inline")
-double sqrt(num x) => _sqrt(x.toDouble());
-@patch
-@pragma("vm:prefer-inline")
-double exp(num x) => _exp(x.toDouble());
-@patch
-@pragma("vm:prefer-inline")
-double log(num x) => _log(x.toDouble());
-
-double _atan2(double a, double b) native "Math_atan2";
-double _sin(double x) native "Math_sin";
-double _cos(double x) native "Math_cos";
-double _tan(double x) native "Math_tan";
-double _acos(double x) native "Math_acos";
-double _asin(double x) native "Math_asin";
-double _atan(double x) native "Math_atan";
-double _sqrt(double x) native "Math_sqrt";
-double _exp(double x) native "Math_exp";
-double _log(double x) native "Math_log";
-
-// TODO(iposva): Handle patch methods within a patch class correctly.
-@patch
-class Random {
-  @patch
-  factory Random([int? seed]) {
-    var state = _Random._setupSeed((seed == null) ? _Random._nextSeed() : seed);
-    // Crank a couple of times to distribute the seed bits a bit further.
-    return new _Random._withState(state)
-      .._nextState()
-      .._nextState()
-      .._nextState()
-      .._nextState();
-  }
-
-  @patch
-  factory Random.secure() {
-    return new _SecureRandom();
-  }
-}
-
-class _Random implements Random {
-  // Internal state of the random number generator.
-  @pragma("vm:entry-point")
-  final Uint32List _state;
-  static const _kSTATE_LO = 0;
-  static const _kSTATE_HI = 1; // Unused in Dart code.
-
-  _Random._withState(this._state);
-
-  // The algorithm used here is Multiply with Carry (MWC) with a Base b = 2^32.
-  // http://en.wikipedia.org/wiki/Multiply-with-carry
-  // The constant A is selected from "Numerical Recipes 3rd Edition" p.348 B1.
-
-  // Implements:
-  //   const _A = 0xffffda61;
-  //   var state =
-  //       ((_A * (_state[_kSTATE_LO])) + _state[_kSTATE_HI]) & ((1 << 64) - 1);
-  //   _state[_kSTATE_LO] = state & ((1 << 32) - 1);
-  //   _state[_kSTATE_HI] = state >> 32;
-  // This is a native to prevent 64-bit operations in Dart, which
-  // fail with --throw_on_javascript_int_overflow.
-  // TODO(regis): Implement in Dart and remove Random_nextState in math.cc.
-  void _nextState() native "Random_nextState";
-
-  int nextInt(int max) {
-    const limit = 0x3FFFFFFF;
-    if ((max <= 0) || ((max > limit) && (max > _POW2_32))) {
-      throw new RangeError.range(
-          max, 1, _POW2_32, "max", "Must be positive and <= 2^32");
-    }
-    if ((max & -max) == max) {
-      // Fast case for powers of two.
-      _nextState();
-      return _state[_kSTATE_LO] & (max - 1);
-    }
-
-    var rnd32;
-    var result;
-    do {
-      _nextState();
-      rnd32 = _state[_kSTATE_LO];
-      result = rnd32 % max;
-    } while ((rnd32 - result + max) > _POW2_32);
-    return result;
-  }
-
-  double nextDouble() {
-    return ((nextInt(1 << 26) * _POW2_27_D) + nextInt(1 << 27)) / _POW2_53_D;
-  }
-
-  bool nextBool() {
-    return nextInt(2) == 0;
-  }
-
-  // Constants used by the algorithm.
-  static const _POW2_32 = 1 << 32;
-  static const _POW2_53_D = 1.0 * (1 << 53);
-  static const _POW2_27_D = 1.0 * (1 << 27);
-
-  // Use a singleton Random object to get a new seed if no seed was passed.
-  static final _prng = new _Random._withState(_initialSeed());
-
-  // This is a native to prevent 64-bit operations in Dart, which
-  // fail with --throw_on_javascript_int_overflow.
-  // TODO(regis): Implement here in Dart and remove native in math.cc.
-  static Uint32List _setupSeed(int seed) native "Random_setupSeed";
-  // Get a seed from the VM's random number provider.
-  static Uint32List _initialSeed() native "Random_initialSeed";
-
-  static int _nextSeed() {
-    // Trigger the PRNG once to change the internal state.
-    _prng._nextState();
-    return _prng._state[_kSTATE_LO];
-  }
-}
-
-class _SecureRandom implements Random {
-  _SecureRandom() {
-    // Throw early in constructor if entropy source is not hooked up.
-    _getBytes(1);
-  }
-
-  // Return count bytes of entropy as a positive integer; count <= 8.
-  static int _getBytes(int count) native "SecureRandom_getBytes";
-
-  int nextInt(int max) {
-    RangeError.checkValueInInterval(
-        max, 1, _POW2_32, "max", "Must be positive and <= 2^32");
-    final byteCount = ((max - 1).bitLength + 7) >> 3;
-    if (byteCount == 0) {
-      return 0; // Not random if max == 1.
-    }
-    var rnd;
-    var result;
-    do {
-      rnd = _getBytes(byteCount);
-      result = rnd % max;
-    } while ((rnd - result + max) > (1 << (byteCount << 3)));
-    return result;
-  }
-
-  double nextDouble() {
-    return (_getBytes(7) >> 3) / _POW2_53_D;
-  }
-
-  bool nextBool() {
-    return _getBytes(1).isEven;
-  }
-
-  // Constants used by the algorithm.
-  static const _POW2_32 = 1 << 32;
-  static const _POW2_53_D = 1.0 * (1 << 53);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/mirror_reference.dart b/sdk_nnbd/lib/_internal/vm/lib/mirror_reference.dart
deleted file mode 100644
index 0cb1e37..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/mirror_reference.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "mirrors_patch.dart";
-
-@pragma("vm:entry-point")
-class _MirrorReference {
-  factory _MirrorReference._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  bool operator ==(Object other) native "MirrorReference_equals";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/mirrors_impl.dart b/sdk_nnbd/lib/_internal/vm/lib/mirrors_impl.dart
deleted file mode 100644
index a7f1f13..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/mirrors_impl.dart
+++ /dev/null
@@ -1,1499 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "mirrors_patch.dart";
-
-var _dirty = false; // Set to true by the VM when more libraries are loaded.
-
-class _InternalMirrorError extends Error {
-  final String _msg;
-  _InternalMirrorError(this._msg);
-  String toString() => _msg;
-}
-
-String _n(Symbol symbol) => internal.Symbol.getName(symbol as internal.Symbol);
-
-Symbol _s(String name) {
-  return new internal.Symbol.unvalidated(name);
-}
-
-Symbol? _sOpt(String? name) {
-  if (name == null) return null;
-  return new internal.Symbol.unvalidated(name);
-}
-
-Symbol _computeQualifiedName(DeclarationMirror? owner, Symbol simpleName) {
-  if (owner == null) return simpleName;
-  return _s('${_n(owner.qualifiedName)}.${_n(simpleName)}');
-}
-
-String _makeSignatureString(
-    TypeMirror returnType, List<ParameterMirror> parameters) {
-  StringBuffer buf = new StringBuffer();
-  buf.write('(');
-  bool found_optional_positional = false;
-  bool found_optional_named = false;
-
-  for (int i = 0; i < parameters.length; i++) {
-    var param = parameters[i];
-    if (param.isOptional && param.isNamed && !found_optional_named) {
-      buf.write('{');
-      found_optional_named = true;
-    }
-    if (param.isOptional && !param.isNamed && !found_optional_positional) {
-      buf.write('[');
-      found_optional_positional = true;
-    }
-    if (param.isNamed) {
-      buf.write(_n(param.simpleName));
-      buf.write(': ');
-    }
-    buf.write(_n(param.type.qualifiedName));
-    if (i < (parameters.length - 1)) {
-      buf.write(', ');
-    }
-  }
-  if (found_optional_named) {
-    buf.write('}');
-  }
-  if (found_optional_positional) {
-    buf.write(']');
-  }
-  buf.write(') -> ');
-  buf.write(_n(returnType.qualifiedName));
-  return buf.toString();
-}
-
-SourceLocation? _location(reflectee) native "DeclarationMirror_location";
-
-List<dynamic> _metadata(reflectee) native 'DeclarationMirror_metadata';
-
-List<InstanceMirror> _wrapMetadata(List reflectees) {
-  var mirrors = <InstanceMirror>[];
-  for (var reflectee in reflectees) {
-    mirrors.add(reflect(reflectee));
-  }
-  return new UnmodifiableListView<InstanceMirror>(mirrors);
-}
-
-bool _subtypeTest(Type a, Type b) native 'TypeMirror_subtypeTest';
-
-class _MirrorSystem extends MirrorSystem {
-  final TypeMirror dynamicType = new _SpecialTypeMirror._('dynamic');
-  final TypeMirror voidType = new _SpecialTypeMirror._('void');
-  final TypeMirror neverType = new _SpecialTypeMirror._('Never');
-
-  var _libraries;
-  Map<Uri, LibraryMirror> get libraries {
-    if ((_libraries == null) || _dirty) {
-      _libraries = new Map<Uri, LibraryMirror>();
-      for (LibraryMirror lib in _computeLibraries()) {
-        _libraries[lib.uri] = lib;
-      }
-      _libraries = new UnmodifiableMapView<Uri, LibraryMirror>(_libraries);
-      _dirty = false;
-    }
-    return _libraries;
-  }
-
-  static List<dynamic> _computeLibraries() native "MirrorSystem_libraries";
-
-  IsolateMirror? _isolate;
-  IsolateMirror get isolate {
-    var i = _isolate;
-    if (i != null) return i;
-    return _isolate = _computeIsolate();
-  }
-
-  static IsolateMirror _computeIsolate() native "MirrorSystem_isolate";
-
-  String toString() => "MirrorSystem for isolate '${isolate.debugName}'";
-}
-
-class _SourceLocation implements SourceLocation {
-  _SourceLocation._(uriString, this.line, this.column)
-      : this.sourceUri = Uri.parse(uriString);
-
-  // Line and column positions are 1-origin, or 0 if unknown.
-  final int line;
-  final int column;
-
-  final Uri sourceUri;
-
-  String toString() {
-    return column == 0 ? "$sourceUri:$line" : "$sourceUri:$line:$column";
-  }
-}
-
-class _IsolateMirror extends Mirror implements IsolateMirror {
-  final String debugName;
-  final LibraryMirror rootLibrary;
-
-  _IsolateMirror._(this.debugName, this.rootLibrary);
-
-  bool get isCurrent => true;
-
-  String toString() => "IsolateMirror on '$debugName'";
-
-  Future<LibraryMirror> loadUri(Uri uri) async {
-    var result = _loadUri(uri.toString());
-    if (result == null) {
-      // Censored library.
-      throw new Exception("Cannot load $uri");
-    }
-    return result;
-  }
-
-  static LibraryMirror? _loadUri(String uri) native "IsolateMirror_loadUri";
-}
-
-class _SyntheticAccessor implements MethodMirror {
-  final DeclarationMirror owner;
-  final Symbol simpleName;
-  final bool isGetter;
-  final bool isStatic;
-  final bool isTopLevel;
-  final _target;
-
-  _SyntheticAccessor(this.owner, this.simpleName, this.isGetter, this.isStatic,
-      this.isTopLevel, this._target);
-
-  bool get isSynthetic => true;
-  bool get isRegularMethod => false;
-  bool get isOperator => false;
-  bool get isConstructor => false;
-  bool get isConstConstructor => false;
-  bool get isGenerativeConstructor => false;
-  bool get isFactoryConstructor => false;
-  bool get isExternal => false;
-  bool get isRedirectingConstructor => false;
-  bool get isAbstract => false;
-  bool get isExtensionMember => false;
-
-  bool get isSetter => !isGetter;
-  bool get isPrivate => _n(simpleName).startsWith('_');
-
-  Symbol get qualifiedName => _computeQualifiedName(owner, simpleName);
-  Symbol get constructorName => Symbol.empty;
-
-  TypeMirror get returnType => _target.type;
-  List<ParameterMirror> get parameters {
-    if (isGetter) return const <ParameterMirror>[];
-    return new UnmodifiableListView<ParameterMirror>(
-        <ParameterMirror>[new _SyntheticSetterParameter(this, this._target)]);
-  }
-
-  SourceLocation? get location => null;
-  List<InstanceMirror> get metadata => const <InstanceMirror>[];
-  String? get source => null;
-}
-
-class _SyntheticSetterParameter implements ParameterMirror {
-  final DeclarationMirror owner;
-  final VariableMirror _target;
-
-  _SyntheticSetterParameter(this.owner, this._target);
-
-  Symbol get simpleName => _target.simpleName;
-  Symbol get qualifiedName => _computeQualifiedName(owner, simpleName);
-  TypeMirror get type => _target.type;
-
-  bool get isOptional => false;
-  bool get isNamed => false;
-  bool get isStatic => false;
-  bool get isTopLevel => false;
-  bool get isConst => false;
-  bool get isFinal => true;
-  bool get isPrivate => false;
-  bool get isExtensionMember => false;
-  bool get hasDefaultValue => false;
-  InstanceMirror? get defaultValue => null;
-  SourceLocation? get location => null;
-  List<InstanceMirror> get metadata => const <InstanceMirror>[];
-}
-
-abstract class _ObjectMirror extends Mirror implements ObjectMirror {
-  _invoke(reflectee, functionName, arguments, argumentNames);
-  _invokeGetter(reflectee, getterName);
-  _invokeSetter(reflectee, setterName, value);
-
-  final _reflectee; // May be a MirrorReference or an ordinary object.
-
-  _ObjectMirror._(this._reflectee);
-
-  InstanceMirror invoke(Symbol memberName, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
-    int numPositionalArguments = positionalArguments.length;
-    int numNamedArguments = namedArguments.length;
-    int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List<dynamic>.filled(numArguments, null);
-    arguments.setRange(0, numPositionalArguments, positionalArguments);
-    List names = new List<dynamic>.filled(numNamedArguments, null);
-    int argumentIndex = numPositionalArguments;
-    int nameIndex = 0;
-    if (numNamedArguments > 0) {
-      namedArguments.forEach((name, value) {
-        arguments[argumentIndex++] = value;
-        names[nameIndex++] = _n(name);
-      });
-    }
-
-    return reflect(this._invoke(_reflectee, _n(memberName), arguments, names));
-  }
-
-  InstanceMirror getField(Symbol memberName) {
-    return reflect(this._invokeGetter(_reflectee, _n(memberName)));
-  }
-
-  InstanceMirror setField(Symbol memberName, dynamic value) {
-    this._invokeSetter(_reflectee, _n(memberName), value);
-    return reflect(value);
-  }
-
-  delegate(Invocation invocation) {
-    if (invocation.isMethod) {
-      return this
-          .invoke(invocation.memberName, invocation.positionalArguments,
-              invocation.namedArguments)
-          .reflectee;
-    }
-    if (invocation.isGetter) {
-      return this.getField(invocation.memberName).reflectee;
-    }
-    if (invocation.isSetter) {
-      var unwrapped = _n(invocation.memberName);
-      var withoutEqual = _s(unwrapped.substring(0, unwrapped.length - 1));
-      var arg = invocation.positionalArguments[0];
-      this.setField(withoutEqual, arg).reflectee;
-      return arg;
-    }
-    throw "UNREACHABLE";
-  }
-}
-
-class _InstanceMirror extends _ObjectMirror implements InstanceMirror {
-  _InstanceMirror._(reflectee) : super._(reflectee);
-
-  ClassMirror? _type;
-  ClassMirror get type {
-    var t = _type;
-    if (t != null) return t;
-
-    // Note it not safe to use reflectee.runtimeType because runtimeType may
-    // be overridden.
-    return _type = reflectType(_computeType(reflectee)) as ClassMirror;
-  }
-
-  // LocalInstanceMirrors always reflect local instances
-  bool get hasReflectee => true;
-
-  get reflectee => _reflectee;
-
-  String toString() => 'InstanceMirror on ${Error.safeToString(_reflectee)}';
-
-  bool operator ==(Object other) {
-    return other is _InstanceMirror && identical(_reflectee, other._reflectee);
-  }
-
-  int get hashCode {
-    // Avoid hash collisions with the reflectee. This constant is in Smi range
-    // and happens to be the inner padding from RFC 2104.
-    return identityHashCode(_reflectee) ^ 0x36363636;
-  }
-
-  InstanceMirror getField(Symbol memberName) {
-    return reflect(_invokeGetter(_reflectee, _n(memberName)));
-  }
-
-  InstanceMirror setField(Symbol memberName, dynamic arg) {
-    _invokeSetter(_reflectee, _n(memberName), arg);
-    return reflect(arg);
-  }
-
-  // Override to include the receiver in the arguments.
-  InstanceMirror invoke(Symbol memberName, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
-    int numPositionalArguments = positionalArguments.length + 1; // Receiver.
-    int numNamedArguments = namedArguments.length;
-    int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List<dynamic>.filled(numArguments, null);
-    arguments[0] = _reflectee; // Receiver.
-    arguments.setRange(1, numPositionalArguments, positionalArguments);
-    List names = new List<dynamic>.filled(numNamedArguments, null);
-    int argumentIndex = numPositionalArguments;
-    int nameIndex = 0;
-    if (numNamedArguments > 0) {
-      namedArguments.forEach((name, value) {
-        arguments[argumentIndex++] = value;
-        names[nameIndex++] = _n(name);
-      });
-    }
-
-    return reflect(this._invoke(_reflectee, _n(memberName), arguments, names));
-  }
-
-  _invoke(reflectee, functionName, arguments, argumentNames)
-      native 'InstanceMirror_invoke';
-
-  _invokeGetter(reflectee, getterName) native 'InstanceMirror_invokeGetter';
-
-  _invokeSetter(reflectee, setterName, value)
-      native 'InstanceMirror_invokeSetter';
-
-  static _computeType(reflectee) native 'InstanceMirror_computeType';
-}
-
-class _ClosureMirror extends _InstanceMirror implements ClosureMirror {
-  _ClosureMirror._(reflectee) : super._(reflectee);
-
-  MethodMirror? _function;
-  MethodMirror get function {
-    var f = _function;
-    if (f != null) return f;
-    return _function = _computeFunction(reflectee);
-  }
-
-  InstanceMirror apply(List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
-    return this.invoke(#call, positionalArguments, namedArguments);
-  }
-
-  String toString() => "ClosureMirror on '${Error.safeToString(_reflectee)}'";
-
-  static _computeFunction(reflectee) native 'ClosureMirror_function';
-}
-
-abstract class _TypeMirror {
-  Type get _reflectedType;
-}
-
-class _ClassMirror extends _ObjectMirror implements ClassMirror, _TypeMirror {
-  final Type _reflectedType;
-  Symbol? _simpleName;
-  DeclarationMirror? _owner;
-  final bool isAbstract;
-  final bool _isGeneric;
-
-  // Since Dart 2, mixins are erased by kernel transformation.
-  // Resulting classes have this flag set, and mixed-in type is pulled into
-  // the end of interfaces list.
-  final bool _isTransformedMixinApplication;
-
-  final bool _isGenericDeclaration;
-  final bool isEnum;
-  Type _instantiator;
-
-  _ClassMirror._(
-      reflectee,
-      reflectedType,
-      String? simpleName,
-      this._owner,
-      this.isAbstract,
-      this._isGeneric,
-      this._isTransformedMixinApplication,
-      this._isGenericDeclaration,
-      this.isEnum)
-      : this._simpleName = _sOpt(simpleName),
-        this._reflectedType = reflectedType,
-        this._instantiator = reflectedType,
-        super._(reflectee);
-
-  bool get hasReflectedType => !_isGenericDeclaration;
-  Type get reflectedType {
-    if (!hasReflectedType) {
-      throw new UnsupportedError(
-          "Declarations of generics have no reflected type");
-    }
-    return _reflectedType;
-  }
-
-  Symbol get simpleName {
-    // All but anonymous mixin applications have their name set at construction.
-    var n = _simpleName;
-    if (n != null) return n;
-
-    return _simpleName = this._mixinApplicationName;
-  }
-
-  Symbol? _qualifiedName;
-  Symbol get qualifiedName {
-    var n = _qualifiedName;
-    if (n != null) return n;
-
-    return _qualifiedName = _computeQualifiedName(owner, simpleName);
-  }
-
-  DeclarationMirror? get owner {
-    var o = _owner;
-    if (o != null) return o;
-
-    var uri = _ClassMirror._libraryUri(_reflectee);
-    return _owner = currentMirrorSystem().libraries[Uri.parse(uri)];
-  }
-
-  bool get isPrivate => _n(simpleName).startsWith('_');
-
-  bool get isTopLevel => true;
-
-  SourceLocation? get location {
-    return _location(_reflectee);
-  }
-
-  _ClassMirror? _trueSuperclassField;
-  _ClassMirror? get _trueSuperclass {
-    if (_trueSuperclassField == null) {
-      Type? supertype = isOriginalDeclaration
-          ? _supertype(_reflectedType)
-          : _supertypeInstantiated(_reflectedType);
-      if (supertype == null) {
-        // Object has no superclass.
-        return null;
-      }
-      var supertypeMirror = reflectType(supertype) as _ClassMirror;
-      supertypeMirror._instantiator = _instantiator;
-      _trueSuperclassField = supertypeMirror;
-    }
-    return _trueSuperclassField;
-  }
-
-  ClassMirror? get superclass {
-    return _trueSuperclass;
-  }
-
-  var _superinterfaces;
-  List<ClassMirror> get superinterfaces {
-    var i = _superinterfaces;
-    if (i != null) return i;
-
-    var interfaceTypes = isOriginalDeclaration
-        ? _nativeInterfaces(_reflectedType)
-        : _nativeInterfacesInstantiated(_reflectedType);
-    if (_isTransformedMixinApplication) {
-      interfaceTypes = interfaceTypes.sublist(0, interfaceTypes.length - 1);
-    }
-    var interfaceMirrors = <ClassMirror>[];
-    for (var interfaceType in interfaceTypes) {
-      interfaceMirrors.add(reflectType(interfaceType) as ClassMirror);
-    }
-    return _superinterfaces =
-        new UnmodifiableListView<ClassMirror>(interfaceMirrors);
-  }
-
-  Symbol get _mixinApplicationName {
-    var mixins = <ClassMirror>[];
-    var klass = this;
-    while (_nativeMixin(klass._reflectedType) != null) {
-      mixins.add(klass.mixin);
-      klass = klass.superclass as _ClassMirror;
-    }
-    return _s(_n(klass.qualifiedName) +
-        ' with ' +
-        mixins.reversed.map((ClassMirror m) => _n(m.qualifiedName)).join(', '));
-  }
-
-  ClassMirror? _mixin;
-  ClassMirror get mixin {
-    var m = _mixin;
-    if (m != null) return m;
-
-    Type? mixinType = _nativeMixinInstantiated(_reflectedType, _instantiator);
-    if (mixinType == null) {
-      // The reflectee is not a mixin application.
-      return _mixin = this;
-    } else {
-      return _mixin = reflectType(mixinType) as ClassMirror;
-    }
-  }
-
-  var _cachedStaticMembers;
-  Map<Symbol, MethodMirror> get staticMembers {
-    var m = _cachedStaticMembers;
-    if (m != null) m;
-
-    var result = new Map<Symbol, MethodMirror>();
-    var library = this.owner as LibraryMirror;
-    declarations.values.forEach((decl) {
-      if (decl is MethodMirror && decl.isStatic && !decl.isConstructor) {
-        result[decl.simpleName] = decl;
-      }
-      if (decl is VariableMirror && decl.isStatic) {
-        var getterName = decl.simpleName;
-        result[getterName] =
-            new _SyntheticAccessor(this, getterName, true, true, false, decl);
-        if (!decl.isFinal) {
-          var setterName = _asSetter(decl.simpleName, library);
-          result[setterName] = new _SyntheticAccessor(
-              this, setterName, false, true, false, decl);
-        }
-      }
-    });
-    return _cachedStaticMembers =
-        new UnmodifiableMapView<Symbol, MethodMirror>(result);
-  }
-
-  var _cachedInstanceMembers;
-  Map<Symbol, MethodMirror> get instanceMembers {
-    var m = _cachedInstanceMembers;
-    if (m != null) return m;
-
-    var result = new Map<Symbol, MethodMirror>();
-    var library = this.owner as LibraryMirror;
-    var sup = superclass;
-    if (sup != null) {
-      result.addAll(sup.instanceMembers);
-    }
-    declarations.values.forEach((decl) {
-      if (decl is MethodMirror &&
-          !decl.isStatic &&
-          !decl.isConstructor &&
-          !decl.isAbstract) {
-        result[decl.simpleName] = decl;
-      }
-      if (decl is VariableMirror && !decl.isStatic) {
-        var getterName = decl.simpleName;
-        result[getterName] =
-            new _SyntheticAccessor(this, getterName, true, false, false, decl);
-        if (!decl.isFinal) {
-          var setterName = _asSetter(decl.simpleName, library);
-          result[setterName] = new _SyntheticAccessor(
-              this, setterName, false, false, false, decl);
-        }
-      }
-    });
-    return _cachedInstanceMembers =
-        new UnmodifiableMapView<Symbol, MethodMirror>(result);
-  }
-
-  Map<Symbol, DeclarationMirror>? _declarations;
-  Map<Symbol, DeclarationMirror> get declarations {
-    var d = _declarations;
-    if (d != null) return d;
-
-    var decls = new Map<Symbol, DeclarationMirror>();
-
-    var members = _computeMembers(mixin, _instantiator, _reflectee);
-    for (var member in members) {
-      decls[member.simpleName] = member;
-    }
-
-    var constructors = _computeConstructors(_instantiator, _reflectee);
-    var stringName = _n(simpleName);
-    for (var constructor in constructors) {
-      constructor._patchConstructorName(stringName);
-      decls[constructor.simpleName] = constructor;
-    }
-
-    for (var typeVariable in typeVariables) {
-      decls[typeVariable.simpleName] = typeVariable;
-    }
-
-    return _declarations =
-        new UnmodifiableMapView<Symbol, DeclarationMirror>(decls);
-  }
-
-  // Note: returns correct result only for Dart 1 anonymous mixin applications.
-  bool get _isAnonymousMixinApplication {
-    if (mixin == this) return false; // Not a mixin application.
-    return true;
-  }
-
-  List<TypeVariableMirror>? _typeVariables;
-  List<TypeVariableMirror> get typeVariables {
-    var v = _typeVariables;
-    if (v != null) return v;
-
-    if (!_isTransformedMixinApplication && _isAnonymousMixinApplication) {
-      return _typeVariables = const <TypeVariableMirror>[];
-    }
-    var result = <TypeVariableMirror>[];
-
-    List params = _ClassMirror_type_variables(_reflectee);
-    ClassMirror owner = originalDeclaration;
-    var mirror;
-    for (var i = 0; i < params.length; i += 2) {
-      mirror = new _TypeVariableMirror._(params[i + 1], params[i], owner);
-      result.add(mirror);
-    }
-    return _typeVariables =
-        new UnmodifiableListView<TypeVariableMirror>(result);
-  }
-
-  List<TypeMirror>? _typeArguments;
-  List<TypeMirror> get typeArguments {
-    var a = _typeArguments;
-    if (a != null) return a;
-
-    if (_isGenericDeclaration ||
-        (!_isTransformedMixinApplication && _isAnonymousMixinApplication)) {
-      return _typeArguments = const <TypeMirror>[];
-    } else {
-      return _typeArguments = new UnmodifiableListView<TypeMirror>(
-          _computeTypeArguments(_reflectedType).cast<TypeMirror>());
-    }
-  }
-
-  bool get isOriginalDeclaration => !_isGeneric || _isGenericDeclaration;
-
-  ClassMirror get originalDeclaration {
-    if (isOriginalDeclaration) {
-      return this;
-    } else {
-      return reflectClass(_reflectedType);
-    }
-  }
-
-  String toString() => "ClassMirror on '${MirrorSystem.getName(simpleName)}'";
-
-  InstanceMirror newInstance(Symbol constructorName, List positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]) {
-    // Native code will add the 1 or 2 implicit arguments depending on whether
-    // we end up invoking a factory or constructor respectively.
-    int numPositionalArguments = positionalArguments.length;
-    int numNamedArguments = namedArguments.length;
-    int numArguments = numPositionalArguments + numNamedArguments;
-    List arguments = new List<dynamic>.filled(numArguments, null);
-    arguments.setRange(0, numPositionalArguments, positionalArguments);
-    List names = new List<dynamic>.filled(numNamedArguments, null);
-    int argumentIndex = numPositionalArguments;
-    int nameIndex = 0;
-    if (numNamedArguments > 0) {
-      namedArguments.forEach((name, value) {
-        arguments[argumentIndex++] = value;
-        names[nameIndex++] = _n(name);
-      });
-    }
-
-    return reflect(_invokeConstructor(
-        _reflectee, _reflectedType, _n(constructorName), arguments, names));
-  }
-
-  List<InstanceMirror> get metadata {
-    return _wrapMetadata(_metadata(_reflectee));
-  }
-
-  bool operator ==(Object other) {
-    return other is _ClassMirror &&
-        this._reflectee == other._reflectee &&
-        this._reflectedType == other._reflectedType &&
-        this._isGenericDeclaration == other._isGenericDeclaration;
-  }
-
-  int get hashCode => simpleName.hashCode;
-
-  bool isSubtypeOf(TypeMirror other) {
-    if (other == currentMirrorSystem().dynamicType) return true;
-    if (other == currentMirrorSystem().voidType) return true;
-    if (other == currentMirrorSystem().neverType) return false;
-    return _subtypeTest(_reflectedType, (other as _TypeMirror)._reflectedType);
-  }
-
-  bool isAssignableTo(TypeMirror other) {
-    if (other == currentMirrorSystem().dynamicType) return true;
-    if (other == currentMirrorSystem().voidType) return true;
-    if (other == currentMirrorSystem().neverType) return false;
-    final otherReflectedType = (other as _TypeMirror)._reflectedType;
-    return _subtypeTest(_reflectedType, otherReflectedType) ||
-        _subtypeTest(otherReflectedType, _reflectedType);
-  }
-
-  bool isSubclassOf(ClassMirror other) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (other == null) {
-      throw new ArgumentError.notNull('other');
-    }
-    ClassMirror otherDeclaration = other.originalDeclaration as ClassMirror;
-    ClassMirror c = this;
-    while (c != null) {
-      c = c.originalDeclaration as ClassMirror;
-      if (c == otherDeclaration) return true;
-      c = c.superclass as ClassMirror;
-    }
-    return false;
-  }
-
-  static String _libraryUri(reflectee) native "ClassMirror_libraryUri";
-
-  static Type? _supertype(reflectedType) native "ClassMirror_supertype";
-
-  static Type? _supertypeInstantiated(reflectedType)
-      native "ClassMirror_supertype_instantiated";
-
-  static List<dynamic> _nativeInterfaces(reflectedType)
-      native "ClassMirror_interfaces";
-
-  static List<dynamic> _nativeInterfacesInstantiated(reflectedType)
-      native "ClassMirror_interfaces_instantiated";
-
-  static Type? _nativeMixin(reflectedType) native "ClassMirror_mixin";
-
-  static Type? _nativeMixinInstantiated(reflectedType, instantiator)
-      native "ClassMirror_mixin_instantiated";
-
-  static List<dynamic> _computeMembers(owner, reflectee, instantiator)
-      native "ClassMirror_members";
-
-  List<dynamic> _computeConstructors(reflectee, instantiator)
-      native "ClassMirror_constructors";
-
-  _invoke(reflectee, memberName, arguments, argumentNames)
-      native 'ClassMirror_invoke';
-
-  _invokeGetter(reflectee, getterName) native 'ClassMirror_invokeGetter';
-
-  _invokeSetter(reflectee, setterName, value) native 'ClassMirror_invokeSetter';
-
-  static _invokeConstructor(reflectee, type, constructorName, arguments,
-      argumentNames) native 'ClassMirror_invokeConstructor';
-
-  static List<dynamic> _ClassMirror_type_variables(reflectee)
-      native "ClassMirror_type_variables";
-
-  static List<dynamic> _computeTypeArguments(reflectee)
-      native "ClassMirror_type_arguments";
-}
-
-class _FunctionTypeMirror extends _ClassMirror implements FunctionTypeMirror {
-  final _functionReflectee;
-  _FunctionTypeMirror._(reflectee, this._functionReflectee, reflectedType)
-      : super._(reflectee, reflectedType, null, null, false, false, false,
-            false, false);
-
-  bool get _isAnonymousMixinApplication => false;
-
-  // FunctionTypeMirrors have a simpleName generated from their signature.
-  Symbol? _simpleName;
-  Symbol get simpleName {
-    var n = _simpleName;
-    if (n != null) return n;
-    return _simpleName = _s(_makeSignatureString(returnType, parameters));
-  }
-
-  MethodMirror? _callMethod;
-  MethodMirror get callMethod {
-    var m = _callMethod;
-    if (m != null) return m;
-    return _callMethod = _FunctionTypeMirror_call_method(_functionReflectee);
-  }
-
-  TypeMirror? _returnType;
-  TypeMirror get returnType {
-    var t = _returnType;
-    if (t != null) return t;
-    return _returnType =
-        reflectType(_FunctionTypeMirror_return_type(_functionReflectee));
-  }
-
-  List<ParameterMirror>? _parameters;
-  List<ParameterMirror> get parameters {
-    var p = _parameters;
-    if (p != null) return p;
-    return _parameters = new UnmodifiableListView<ParameterMirror>(
-        _FunctionTypeMirror_parameters(_functionReflectee)
-            .cast<ParameterMirror>());
-  }
-
-  bool get isOriginalDeclaration => true;
-  ClassMirror get originalDeclaration => this;
-  List<TypeVariableMirror> get typeVariables => const <TypeVariableMirror>[];
-  List<TypeMirror> get typeArguments => const <TypeMirror>[];
-  List<InstanceMirror> get metadata => const <InstanceMirror>[];
-  SourceLocation? get location => null;
-
-  String toString() => "FunctionTypeMirror on '${_n(simpleName)}'";
-
-  MethodMirror _FunctionTypeMirror_call_method(functionReflectee)
-      native "FunctionTypeMirror_call_method";
-
-  static Type _FunctionTypeMirror_return_type(functionReflectee)
-      native "FunctionTypeMirror_return_type";
-
-  List<dynamic> _FunctionTypeMirror_parameters(functionReflectee)
-      native "FunctionTypeMirror_parameters";
-}
-
-abstract class _DeclarationMirror extends Mirror implements DeclarationMirror {
-  final _reflectee;
-  Symbol _simpleName;
-
-  _DeclarationMirror._(this._reflectee, this._simpleName);
-
-  Symbol get simpleName => _simpleName;
-
-  Symbol? _qualifiedName;
-  Symbol get qualifiedName {
-    var n = _qualifiedName;
-    if (n != null) return n;
-    return _qualifiedName = _computeQualifiedName(owner, simpleName);
-  }
-
-  bool get isPrivate => _n(simpleName).startsWith('_');
-
-  SourceLocation? get location {
-    return _location(_reflectee);
-  }
-
-  List<InstanceMirror> get metadata {
-    return _wrapMetadata(_metadata(_reflectee));
-  }
-
-  bool operator ==(Object other) {
-    return other is _DeclarationMirror && this._reflectee == other._reflectee;
-  }
-
-  int get hashCode => simpleName.hashCode;
-}
-
-class _TypeVariableMirror extends _DeclarationMirror
-    implements TypeVariableMirror, _TypeMirror {
-  _TypeVariableMirror._(reflectee, String simpleName, this._owner)
-      : super._(reflectee, _s(simpleName));
-
-  DeclarationMirror? _owner;
-  DeclarationMirror get owner {
-    var o = _owner;
-    if (o != null) return o;
-    return _owner = (_TypeVariableMirror_owner(_reflectee) as TypeMirror)
-        .originalDeclaration;
-  }
-
-  bool get isStatic => false;
-  bool get isTopLevel => false;
-
-  TypeMirror? _upperBound;
-  TypeMirror get upperBound {
-    var b = _upperBound;
-    if (b != null) return b;
-    return _upperBound =
-        reflectType(_TypeVariableMirror_upper_bound(_reflectee));
-  }
-
-  bool get hasReflectedType => false;
-  Type get reflectedType {
-    throw new UnsupportedError('Type variables have no reflected type');
-  }
-
-  Type get _reflectedType => _reflectee;
-
-  List<TypeVariableMirror> get typeVariables => const <TypeVariableMirror>[];
-  List<TypeMirror> get typeArguments => const <TypeMirror>[];
-
-  bool get isOriginalDeclaration => true;
-  TypeMirror get originalDeclaration => this;
-
-  String toString() => "TypeVariableMirror on '${_n(simpleName)}'";
-
-  bool operator ==(Object other) {
-    return other is TypeVariableMirror &&
-        simpleName == other.simpleName &&
-        owner == other.owner;
-  }
-
-  int get hashCode => simpleName.hashCode;
-
-  bool isSubtypeOf(TypeMirror other) {
-    if (other == currentMirrorSystem().dynamicType) return true;
-    if (other == currentMirrorSystem().voidType) return true;
-    if (other == currentMirrorSystem().neverType) return false;
-    return _subtypeTest(_reflectedType, (other as _TypeMirror)._reflectedType);
-  }
-
-  bool isAssignableTo(TypeMirror other) {
-    if (other == currentMirrorSystem().dynamicType) return true;
-    if (other == currentMirrorSystem().voidType) return true;
-    if (other == currentMirrorSystem().neverType) return false;
-    final otherReflectedType = (other as _TypeMirror)._reflectedType;
-    return _subtypeTest(_reflectedType, otherReflectedType) ||
-        _subtypeTest(otherReflectedType, _reflectedType);
-  }
-
-  static DeclarationMirror _TypeVariableMirror_owner(reflectee)
-      native "TypeVariableMirror_owner";
-
-  static Type _TypeVariableMirror_upper_bound(reflectee)
-      native "TypeVariableMirror_upper_bound";
-}
-
-class _TypedefMirror extends _DeclarationMirror
-    implements TypedefMirror, _TypeMirror {
-  final Type _reflectedType;
-  final bool _isGeneric;
-  final bool _isGenericDeclaration;
-
-  _TypedefMirror(reflectee, this._reflectedType, String simpleName,
-      this._isGeneric, this._isGenericDeclaration, this._owner)
-      : super._(reflectee, _s(simpleName));
-
-  bool get isTopLevel => true;
-
-  DeclarationMirror? _owner;
-  DeclarationMirror? get owner {
-    var o = _owner;
-    if (o != null) return o;
-    var uri = _ClassMirror._libraryUri(_reflectee);
-    return _owner = currentMirrorSystem().libraries[Uri.parse(uri)];
-  }
-
-  _FunctionTypeMirror? _referent;
-  FunctionTypeMirror get referent {
-    var r = _referent;
-    if (r != null) return r;
-    var result = _nativeReferent(_reflectedType) as _FunctionTypeMirror;
-    result._instantiator = _reflectedType;
-    return _referent = result;
-  }
-
-  bool get hasReflectedType => !_isGenericDeclaration;
-  Type get reflectedType {
-    if (!hasReflectedType) {
-      throw new UnsupportedError(
-          "Declarations of generics have no reflected type");
-    }
-    return _reflectedType;
-  }
-
-  bool get isOriginalDeclaration => !_isGeneric || _isGenericDeclaration;
-
-  TypedefMirror get originalDeclaration {
-    if (isOriginalDeclaration) {
-      return this;
-    } else {
-      return _nativeDeclaration(_reflectedType);
-    }
-  }
-
-  List<TypeVariableMirror>? _typeVariables;
-  List<TypeVariableMirror> get typeVariables {
-    var v = _typeVariables;
-    if (v != null) return v;
-
-    var result = <TypeVariableMirror>[];
-    List params = _ClassMirror._ClassMirror_type_variables(_reflectee);
-    TypedefMirror owner = originalDeclaration;
-    var mirror;
-    for (var i = 0; i < params.length; i += 2) {
-      mirror = new _TypeVariableMirror._(params[i + 1], params[i], owner);
-      result.add(mirror);
-    }
-    return _typeVariables =
-        new UnmodifiableListView<TypeVariableMirror>(result);
-  }
-
-  List<TypeMirror>? _typeArguments;
-  List<TypeMirror> get typeArguments {
-    var a = _typeArguments;
-    if (a != null) return a;
-
-    if (_isGenericDeclaration) {
-      return _typeArguments = const <TypeMirror>[];
-    } else {
-      return _typeArguments = new UnmodifiableListView<TypeMirror>(
-          _ClassMirror._computeTypeArguments(_reflectedType)
-              .cast<TypeMirror>());
-    }
-  }
-
-  String toString() => "TypedefMirror on '${_n(simpleName)}'";
-
-  bool isSubtypeOf(TypeMirror other) {
-    if (other == currentMirrorSystem().dynamicType) return true;
-    if (other == currentMirrorSystem().voidType) return true;
-    if (other == currentMirrorSystem().neverType) return false;
-    return _subtypeTest(_reflectedType, (other as _TypeMirror)._reflectedType);
-  }
-
-  bool isAssignableTo(TypeMirror other) {
-    if (other == currentMirrorSystem().dynamicType) return true;
-    if (other == currentMirrorSystem().voidType) return true;
-    if (other == currentMirrorSystem().neverType) return false;
-    final otherReflectedType = (other as _TypeMirror)._reflectedType;
-    return _subtypeTest(_reflectedType, otherReflectedType) ||
-        _subtypeTest(otherReflectedType, _reflectedType);
-  }
-
-  static FunctionTypeMirror _nativeReferent(reflectedType)
-      native "TypedefMirror_referent";
-
-  static TypedefMirror _nativeDeclaration(reflectedType)
-      native "TypedefMirror_declaration";
-}
-
-Symbol _asSetter(Symbol getter, LibraryMirror library) {
-  var unwrapped = MirrorSystem.getName(getter);
-  return MirrorSystem.getSymbol('${unwrapped}=', library);
-}
-
-class _LibraryMirror extends _ObjectMirror implements LibraryMirror {
-  final Symbol simpleName;
-  final Uri uri;
-
-  _LibraryMirror._(reflectee, String simpleName, String url)
-      : this.simpleName = _s(simpleName),
-        this.uri = Uri.parse(url),
-        super._(reflectee);
-
-  // The simple name and the qualified name are the same for a library.
-  Symbol get qualifiedName => simpleName;
-
-  DeclarationMirror? get owner => null;
-
-  bool get isPrivate => false;
-  bool get isTopLevel => false;
-
-  Type? get _instantiator => null;
-
-  Map<Symbol, DeclarationMirror>? _declarations;
-  Map<Symbol, DeclarationMirror> get declarations {
-    var d = _declarations;
-    if (d != null) return d;
-
-    var decls = new Map<Symbol, DeclarationMirror>();
-    var members = _computeMembers(_reflectee);
-    for (var member in members) {
-      decls[member.simpleName] = member;
-    }
-
-    return _declarations =
-        new UnmodifiableMapView<Symbol, DeclarationMirror>(decls);
-  }
-
-  SourceLocation? get location {
-    return _location(_reflectee);
-  }
-
-  List<InstanceMirror> get metadata {
-    return _wrapMetadata(_metadata(_reflectee));
-  }
-
-  bool operator ==(Object other) {
-    return other is _LibraryMirror && this._reflectee == other._reflectee;
-  }
-
-  int get hashCode => simpleName.hashCode;
-
-  String toString() => "LibraryMirror on '${_n(simpleName)}'";
-
-  var _cachedLibraryDependencies;
-  get libraryDependencies {
-    var d = _cachedLibraryDependencies;
-    if (d != null) return d;
-    return _cachedLibraryDependencies =
-        new UnmodifiableListView<LibraryDependencyMirror>(
-            _libraryDependencies(_reflectee).cast<LibraryDependencyMirror>());
-  }
-
-  List<dynamic> _libraryDependencies(reflectee)
-      native 'LibraryMirror_libraryDependencies';
-
-  _invoke(reflectee, memberName, arguments, argumentNames)
-      native 'LibraryMirror_invoke';
-
-  _invokeGetter(reflectee, getterName) native 'LibraryMirror_invokeGetter';
-
-  _invokeSetter(reflectee, setterName, value)
-      native 'LibraryMirror_invokeSetter';
-
-  List<dynamic> _computeMembers(reflectee) native "LibraryMirror_members";
-}
-
-class _LibraryDependencyMirror extends Mirror
-    implements LibraryDependencyMirror {
-  final LibraryMirror sourceLibrary;
-  var _targetMirrorOrPrefix;
-  final List<CombinatorMirror> combinators;
-  final Symbol? prefix;
-  final bool isImport;
-  final bool isDeferred;
-  final List<InstanceMirror> metadata;
-
-  _LibraryDependencyMirror._(
-      this.sourceLibrary,
-      this._targetMirrorOrPrefix,
-      List<dynamic> mutableCombinators,
-      prefixString,
-      this.isImport,
-      this.isDeferred,
-      List<dynamic> unwrappedMetadata)
-      : prefix = _sOpt(prefixString),
-        combinators = new UnmodifiableListView<CombinatorMirror>(
-            mutableCombinators.cast<CombinatorMirror>()),
-        metadata = _wrapMetadata(unwrappedMetadata);
-
-  bool get isExport => !isImport;
-
-  LibraryMirror? get targetLibrary {
-    if (_targetMirrorOrPrefix is _LibraryMirror) {
-      return _targetMirrorOrPrefix;
-    }
-    var mirrorOrNull = _tryUpgradePrefix(_targetMirrorOrPrefix);
-    if (mirrorOrNull != null) {
-      _targetMirrorOrPrefix = mirrorOrNull;
-    }
-    return mirrorOrNull;
-  }
-
-  Future<LibraryMirror> loadLibrary() {
-    if (_targetMirrorOrPrefix is _LibraryMirror) {
-      return new Future.value(_targetMirrorOrPrefix);
-    }
-    var savedPrefix = _targetMirrorOrPrefix;
-    return savedPrefix.loadLibrary().then((_) {
-      return _tryUpgradePrefix(savedPrefix);
-    });
-  }
-
-  static LibraryMirror _tryUpgradePrefix(libraryPrefix)
-      native "LibraryMirror_fromPrefix";
-
-  SourceLocation? get location => null;
-}
-
-class _CombinatorMirror extends Mirror implements CombinatorMirror {
-  final List<Symbol> identifiers;
-  final bool isShow;
-
-  _CombinatorMirror._(identifierString, this.isShow)
-      : this.identifiers =
-            new UnmodifiableListView<Symbol>(<Symbol>[_s(identifierString)]);
-
-  bool get isHide => !isShow;
-}
-
-class _MethodMirror extends _DeclarationMirror implements MethodMirror {
-  final Type _instantiator;
-  final bool isStatic;
-  final int _kindFlags;
-
-  _MethodMirror._(reflectee, String simpleName, this._owner, this._instantiator,
-      this.isStatic, this._kindFlags)
-      : super._(reflectee, _s(simpleName));
-
-  static const kAbstract = 0;
-  static const kGetter = 1;
-  static const kSetter = 2;
-  static const kConstructor = 3;
-  static const kConstCtor = 4;
-  static const kGenerativeCtor = 5;
-  static const kRedirectingCtor = 6;
-  static const kFactoryCtor = 7;
-  static const kExternal = 8;
-  static const kSynthetic = 9;
-  static const kExtensionMember = 10;
-
-  // These offsets much be kept in sync with those in mirrors.h.
-  bool get isAbstract => 0 != (_kindFlags & (1 << kAbstract));
-  bool get isGetter => 0 != (_kindFlags & (1 << kGetter));
-  bool get isSetter => 0 != (_kindFlags & (1 << kSetter));
-  bool get isConstructor => 0 != (_kindFlags & (1 << kConstructor));
-  bool get isConstConstructor => 0 != (_kindFlags & (1 << kConstCtor));
-  bool get isGenerativeConstructor =>
-      0 != (_kindFlags & (1 << kGenerativeCtor));
-  bool get isRedirectingConstructor =>
-      0 != (_kindFlags & (1 << kRedirectingCtor));
-  bool get isFactoryConstructor => 0 != (_kindFlags & (1 << kFactoryCtor));
-  bool get isExternal => 0 != (_kindFlags & (1 << kExternal));
-  bool get isSynthetic => 0 != (_kindFlags & (1 << kSynthetic));
-  bool get isExtensionMember => 0 != (_kindFlags & (1 << kExtensionMember));
-
-  static const _operators = const [
-    "%", "&", "*", "+", "-", "/", "<", "<<", //
-    "<=", "==", ">", ">=", ">>", "[]", "[]=",
-    "^", "|", "~", "unary-", "~/",
-  ];
-  bool get isOperator => _operators.contains(_n(simpleName));
-
-  DeclarationMirror? _owner;
-  DeclarationMirror get owner {
-    // For nested closures it is possible, that the mirror for the owner has not
-    // been created yet.
-    var o = _owner;
-    if (o != null) return o;
-    return _owner = _MethodMirror_owner(_reflectee, _instantiator);
-  }
-
-  bool get isPrivate =>
-      _n(simpleName).startsWith('_') || _n(constructorName).startsWith('_');
-
-  bool get isTopLevel => owner is LibraryMirror;
-
-  TypeMirror? _returnType;
-  TypeMirror get returnType {
-    var t = _returnType;
-    if (t != null) return t;
-    if (isConstructor) {
-      return _returnType = owner as _ClassMirror;
-    } else {
-      return _returnType =
-          reflectType(_MethodMirror_return_type(_reflectee, _instantiator));
-    }
-  }
-
-  List<ParameterMirror>? _parameters;
-  List<ParameterMirror> get parameters {
-    var p = _parameters;
-    if (p != null) return p;
-    return _parameters = new UnmodifiableListView<ParameterMirror>(
-        _MethodMirror_parameters(_reflectee).cast<ParameterMirror>());
-  }
-
-  bool get isRegularMethod => !isGetter && !isSetter && !isConstructor;
-
-  Symbol? _constructorName;
-  Symbol get constructorName {
-    var n = _constructorName;
-    if (n != null) return n;
-
-    if (!isConstructor) {
-      return _constructorName = _s('');
-    } else {
-      var parts = MirrorSystem.getName(simpleName).split('.');
-      if (parts.length > 2) {
-        throw new _InternalMirrorError(
-            'Internal error in MethodMirror.constructorName: '
-            'malformed name <$simpleName>');
-      } else if (parts.length == 2) {
-        LibraryMirror definingLibrary = owner.owner as _LibraryMirror;
-        return _constructorName =
-            MirrorSystem.getSymbol(parts[1], definingLibrary);
-      } else {
-        return _constructorName = _s('');
-      }
-    }
-  }
-
-  String? get source => _MethodMirror_source(_reflectee);
-
-  void _patchConstructorName(ownerName) {
-    var cn = _n(constructorName);
-    if (cn == '') {
-      _simpleName = _s(ownerName);
-    } else {
-      _simpleName = _s(ownerName + "." + cn);
-    }
-  }
-
-  String toString() => "MethodMirror on '${MirrorSystem.getName(simpleName)}'";
-
-  static dynamic _MethodMirror_owner(reflectee, instantiator)
-      native "MethodMirror_owner";
-
-  static dynamic _MethodMirror_return_type(reflectee, instantiator)
-      native "MethodMirror_return_type";
-
-  List<dynamic> _MethodMirror_parameters(reflectee)
-      native "MethodMirror_parameters";
-
-  static String? _MethodMirror_source(reflectee) native "MethodMirror_source";
-}
-
-class _VariableMirror extends _DeclarationMirror implements VariableMirror {
-  final DeclarationMirror owner;
-  final bool isStatic;
-  final bool isFinal;
-  final bool isConst;
-  final bool isExtensionMember;
-
-  _VariableMirror._(reflectee, String simpleName, this.owner, this._type,
-      this.isStatic, this.isFinal, this.isConst, this.isExtensionMember)
-      : super._(reflectee, _s(simpleName));
-
-  bool get isTopLevel => owner is LibraryMirror;
-
-  Type? get _instantiator {
-    final o = owner; // Note: need local variable for promotion to happen.
-    if (o is _ClassMirror) {
-      return o._instantiator;
-    } else if (o is _MethodMirror) {
-      return o._instantiator;
-    } else if (o is _LibraryMirror) {
-      return o._instantiator;
-    } else {
-      throw new UnsupportedError("unexpected owner ${owner}");
-    }
-  }
-
-  TypeMirror? _type;
-  TypeMirror get type {
-    var t = _type;
-    if (t != null) return t;
-    return _type = reflectType(_VariableMirror_type(_reflectee, _instantiator));
-  }
-
-  String toString() =>
-      "VariableMirror on '${MirrorSystem.getName(simpleName)}'";
-
-  static _VariableMirror_type(reflectee, instantiator)
-      native "VariableMirror_type";
-}
-
-class _ParameterMirror extends _VariableMirror implements ParameterMirror {
-  final int _position;
-  final bool isOptional;
-  final bool isNamed;
-  final List? _unmirroredMetadata;
-
-  _ParameterMirror._(
-      reflectee,
-      String simpleName,
-      DeclarationMirror owner,
-      this._position,
-      this.isOptional,
-      this.isNamed,
-      bool isFinal,
-      this._defaultValueReflectee,
-      this._unmirroredMetadata)
-      : super._(
-            reflectee,
-            simpleName,
-            owner,
-            null, // We override the type.
-            false, // isStatic does not apply.
-            isFinal,
-            false, // Not const.
-            false // Not extension member.
-            );
-
-  Object _defaultValueReflectee;
-  InstanceMirror? _defaultValue;
-  InstanceMirror? get defaultValue {
-    if (!isOptional) {
-      return null;
-    }
-    if (_defaultValue == null) {
-      _defaultValue = reflect(_defaultValueReflectee);
-    }
-    return _defaultValue;
-  }
-
-  bool get hasDefaultValue => _defaultValueReflectee != null;
-
-  SourceLocation? get location {
-    throw new UnsupportedError("ParameterMirror.location unimplemented");
-  }
-
-  List<InstanceMirror> get metadata {
-    var m = _unmirroredMetadata;
-    if (m == null) return const <InstanceMirror>[];
-    return _wrapMetadata(m);
-  }
-
-  TypeMirror? _type;
-  TypeMirror get type {
-    var t = _type;
-    if (t != null) return t;
-    return _type = reflectType(
-        _ParameterMirror_type(_reflectee, _position, _instantiator));
-  }
-
-  String toString() => "ParameterMirror on '${_n(simpleName)}'";
-
-  static Type _ParameterMirror_type(_reflectee, _position, instantiator)
-      native "ParameterMirror_type";
-}
-
-class _SpecialTypeMirror extends Mirror
-    implements TypeMirror, DeclarationMirror {
-  final Symbol simpleName;
-
-  _SpecialTypeMirror._(String name) : simpleName = _s(name);
-
-  bool get isPrivate => false;
-  bool get isTopLevel => true;
-
-  DeclarationMirror? get owner => null;
-
-  SourceLocation? get location => null;
-  List<InstanceMirror> get metadata => const <InstanceMirror>[];
-
-  bool get hasReflectedType => simpleName == #dynamic;
-  Type get reflectedType {
-    if (simpleName == #dynamic) return dynamic;
-    throw new UnsupportedError("void has no reflected type");
-  }
-
-  List<TypeVariableMirror> get typeVariables => const <TypeVariableMirror>[];
-  List<TypeMirror> get typeArguments => const <TypeMirror>[];
-
-  bool get isOriginalDeclaration => true;
-  TypeMirror get originalDeclaration => this;
-
-  Symbol get qualifiedName => simpleName;
-
-  bool operator ==(Object other) {
-    if (other is! _SpecialTypeMirror) {
-      return false;
-    }
-    return this.simpleName == other.simpleName;
-  }
-
-  int get hashCode => simpleName.hashCode;
-
-  String toString() => "TypeMirror on '${_n(simpleName)}'";
-
-  bool isSubtypeOf(TypeMirror other) {
-    return simpleName == #dynamic || other is _SpecialTypeMirror;
-  }
-
-  bool isAssignableTo(TypeMirror other) {
-    return simpleName == #dynamic || other is _SpecialTypeMirror;
-  }
-}
-
-class _Mirrors {
-  static MirrorSystem _currentMirrorSystem = new _MirrorSystem();
-  static MirrorSystem currentMirrorSystem() {
-    return _currentMirrorSystem;
-  }
-
-  // Creates a new local mirror for some Object.
-  static InstanceMirror reflect(dynamic reflectee) {
-    return reflectee is Function
-        ? new _ClosureMirror._(reflectee)
-        : new _InstanceMirror._(reflectee);
-  }
-
-  static _ClassMirror _makeLocalClassMirror(Type key)
-      native "Mirrors_makeLocalClassMirror";
-  static TypeMirror _makeLocalTypeMirror(Type key)
-      native "Mirrors_makeLocalTypeMirror";
-  static Type _instantiateGenericType(Type key, typeArguments)
-      native "Mirrors_instantiateGenericType";
-
-  static Expando<_ClassMirror> _declarationCache = new Expando("ClassMirror");
-  static Expando<TypeMirror> _instantiationCache = new Expando("TypeMirror");
-
-  static ClassMirror reflectClass(Type key) {
-    var classMirror = _declarationCache[key];
-    if (classMirror == null) {
-      classMirror = _makeLocalClassMirror(key);
-      _declarationCache[key] = classMirror;
-      if (!classMirror._isGeneric) {
-        _instantiationCache[key] = classMirror;
-      }
-    }
-    return classMirror;
-  }
-
-  static TypeMirror reflectType(Type key, [List<Type>? typeArguments]) {
-    if (typeArguments != null) {
-      key = _instantiateType(key, typeArguments);
-    }
-    var typeMirror = _instantiationCache[key];
-    if (typeMirror == null) {
-      typeMirror = _makeLocalTypeMirror(key);
-      _instantiationCache[key] = typeMirror;
-      if (typeMirror is _ClassMirror && !typeMirror._isGeneric) {
-        _declarationCache[key] = typeMirror;
-      }
-    }
-    return typeMirror;
-  }
-
-  static Type _instantiateType(Type key, List<Type> typeArguments) {
-    if (typeArguments.isEmpty) {
-      throw new ArgumentError.value(typeArguments, 'typeArguments',
-          'Type arguments list cannot be empty.');
-    }
-    return _instantiateGenericType(key, typeArguments.toList(growable: false));
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/mirrors_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/mirrors_patch.dart
deleted file mode 100644
index a06d546..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/mirrors_patch.dart
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:_internal" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal" as internal;
-
-import "dart:_internal" show patch;
-
-import "dart:async" show Future;
-
-import "dart:collection" show UnmodifiableListView, UnmodifiableMapView;
-
-/// These are the additional parts of this patch library:
-// part "mirrors_impl.dart";
-// part "mirror_reference.dart";
-
-/**
- * Returns a [MirrorSystem] for the current isolate.
- */
-@patch
-MirrorSystem currentMirrorSystem() {
-  return _Mirrors.currentMirrorSystem();
-}
-
-/**
- * Returns an [InstanceMirror] for some Dart language object.
- *
- * This only works if this mirror system is associated with the
- * current running isolate.
- */
-@patch
-InstanceMirror reflect(dynamic reflectee) {
-  return _Mirrors.reflect(reflectee);
-}
-
-/**
- * Returns a [ClassMirror] for the class represented by a Dart
- * Type object.
- *
- * This only works with objects local to the current isolate.
- */
-@patch
-ClassMirror reflectClass(Type key) {
-  return _Mirrors.reflectClass(key);
-}
-
-@patch
-TypeMirror reflectType(Type key, [List<Type>? typeArguments]) {
-  return _Mirrors.reflectType(key, typeArguments);
-}
-
-@patch
-class MirrorSystem {
-  @patch
-  LibraryMirror findLibrary(Symbol libraryName) {
-    var candidates =
-        libraries.values.where((lib) => lib.simpleName == libraryName);
-    if (candidates.length == 1) {
-      return candidates.single;
-    }
-    if (candidates.length > 1) {
-      var uris = candidates.map((lib) => lib.uri.toString()).toList();
-      throw new Exception("There are multiple libraries named "
-          "'${getName(libraryName)}': $uris");
-    }
-    throw new Exception("There is no library named '${getName(libraryName)}'");
-  }
-
-  @patch
-  static String getName(Symbol symbol) {
-    return internal.Symbol.computeUnmangledName(symbol as internal.Symbol);
-  }
-
-  @patch
-  static Symbol getSymbol(String name, [LibraryMirror? library]) {
-    if ((library != null && library is! _LibraryMirror) ||
-        ((name.length > 0) && (name[0] == '_') && (library == null))) {
-      throw new ArgumentError(library);
-    }
-    if (library != null) {
-      name = _mangleName(name, (library as _LibraryMirror)._reflectee);
-    }
-    return new internal.Symbol.unvalidated(name);
-  }
-
-  static _mangleName(String name, _MirrorReference lib)
-      native "Mirrors_mangleName";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/null_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/null_patch.dart
deleted file mode 100644
index 01bb5aa..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/null_patch.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "core_patch.dart";
-
-@patch
-@pragma("vm:entry-point")
-class Null {
-  static const _HASH_CODE = 2011; // The year Dart was announced and a prime.
-
-  @patch
-  int get hashCode => _HASH_CODE;
-
-  int get _identityHashCode => _HASH_CODE;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/object_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/object_patch.dart
deleted file mode 100644
index e862e5c..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/object_patch.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@pragma("vm:exact-result-type", "dart:core#_Smi")
-int _getHash(obj) native "Object_getHash";
-void _setHash(obj, hash) native "Object_setHash";
-
-@patch
-@pragma("vm:entry-point")
-class Object {
-  // The VM has its own implementation of equals.
-  @patch
-  @pragma("vm:exact-result-type", bool)
-  @pragma("vm:prefer-inline")
-  bool operator ==(Object other) native "Object_equals";
-
-  // Helpers used to implement hashCode. If a hashCode is used, we remember it
-  // in a weak table in the VM (32 bit) or in the header of the object (64
-  // bit). A new hashCode value is calculated using a random number generator.
-  static final _hashCodeRnd = new Random();
-
-  static int _objectHashCode(obj) {
-    var result = _getHash(obj);
-    if (result == 0) {
-      // We want the hash to be a Smi value greater than 0.
-      result = _hashCodeRnd.nextInt(0x40000000);
-      do {
-        result = _hashCodeRnd.nextInt(0x40000000);
-      } while (result == 0);
-      _setHash(obj, result);
-    }
-    return result;
-  }
-
-  @patch
-  int get hashCode => _objectHashCode(this);
-  int get _identityHashCode => _objectHashCode(this);
-
-  @patch
-  String toString() native "Object_toString";
-  // A statically dispatched version of Object.toString.
-  static String _toString(obj) native "Object_toString";
-
-  @patch
-  @pragma("vm:entry-point", "call")
-  dynamic noSuchMethod(Invocation invocation) {
-    // TODO(regis): Remove temp constructor identifier 'withInvocation'.
-    throw new NoSuchMethodError.withInvocation(this, invocation);
-  }
-
-  @patch
-  @pragma("vm:exact-result-type", "dart:core#_Type")
-  Type get runtimeType native "Object_runtimeType";
-
-  @pragma("vm:entry-point", "call")
-  @pragma("vm:exact-result-type", bool)
-  static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType";
-
-  // Call this function instead of inlining instanceof, thus collecting
-  // type feedback and reducing code size of unoptimized code.
-  @pragma("vm:entry-point", "call")
-  bool _instanceOf(instantiatorTypeArguments, functionTypeArguments, type)
-      native "Object_instanceOf";
-
-  // Group of functions for implementing fast simple instance of.
-  @pragma("vm:entry-point", "call")
-  bool _simpleInstanceOf(type) native "Object_simpleInstanceOf";
-  @pragma("vm:entry-point", "call")
-  bool _simpleInstanceOfTrue(type) => true;
-  @pragma("vm:entry-point", "call")
-  bool _simpleInstanceOfFalse(type) => false;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/print_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/print_patch.dart
deleted file mode 100644
index f0e7d91..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/print_patch.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "internal_patch.dart";
-
-// A print-closure gets a String that should be printed. In general the
-// string is a line, but it may contain "\n" characters.
-typedef void _PrintClosure(String line);
-
-@patch
-void printToConsole(String line) {
-  _printClosure(line);
-}
-
-void _unsupportedPrint(String line) {
-  throw new UnsupportedError("'print' is not supported");
-}
-
-// _printClosure can be overwritten by the embedder to supply a different
-// print implementation.
-@pragma("vm:entry-point")
-_PrintClosure _printClosure = _unsupportedPrint;
diff --git a/sdk_nnbd/lib/_internal/vm/lib/profiler.dart b/sdk_nnbd/lib/_internal/vm/lib/profiler.dart
deleted file mode 100644
index 745eaa5..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/profiler.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2014, 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.
-
-// part of "developer.dart";
-
-@patch
-class UserTag {
-  @patch
-  factory UserTag(String label) {
-    return new _UserTag(label);
-  }
-  @patch
-  static UserTag get defaultTag => _getDefaultTag();
-}
-
-@pragma("vm:entry-point")
-class _UserTag implements UserTag {
-  factory _UserTag(String label) native "UserTag_new";
-  String get label native "UserTag_label";
-  UserTag makeCurrent() native "UserTag_makeCurrent";
-}
-
-@patch
-UserTag getCurrentTag() => _getCurrentTag();
-UserTag _getCurrentTag() native "Profiler_getCurrentTag";
-
-UserTag _getDefaultTag() native "UserTag_defaultTag";
diff --git a/sdk_nnbd/lib/_internal/vm/lib/regexp_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/regexp_patch.dart
deleted file mode 100644
index 7a57583..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/regexp_patch.dart
+++ /dev/null
@@ -1,417 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class RegExp {
-  @patch
-  factory RegExp(String source,
-      {bool multiLine: false,
-      bool caseSensitive: true,
-      bool unicode: false,
-      bool dotAll: false}) {
-    _RegExpHashKey key =
-        new _RegExpHashKey(source, multiLine, caseSensitive, unicode, dotAll);
-    _RegExpHashValue? value = _cache[key];
-
-    if (value == null) {
-      if (_cache.length > _MAX_CACHE_SIZE) {
-        _RegExpHashKey lastKey = _recentlyUsed.last;
-        _recentlyUsed.remove(lastKey);
-        _cache.remove(lastKey);
-      }
-
-      value = new _RegExpHashValue(
-          new _RegExp(source,
-              multiLine: multiLine,
-              caseSensitive: caseSensitive,
-              unicode: unicode,
-              dotAll: dotAll),
-          key);
-      _cache[key] = value;
-    } else {
-      value.key.unlink();
-    }
-
-    assert(value != null);
-
-    _recentlyUsed.addFirst(value.key);
-    assert(_recentlyUsed.length == _cache.length);
-
-    // TODO(zerny): We might not want to canonicalize regexp objects.
-    return value.regexp;
-  }
-
-  /**
-   * Finds the index of the first RegExp-significant char in [text].
-   *
-   * Starts looking from [start]. Returns `text.length` if no character
-   * is found that has special meaning in RegExp syntax.
-   */
-  static int _findEscapeChar(String text, int start) {
-    // Table where each character in the range U+0000 to U+007f is represented
-    // by whether it needs to be escaped in a regexp.
-    // The \x00 characters means escacped, and \x01 means non-escaped.
-    const escapes =
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
-        //                 $               (   )   *   +           .
-        "\x01\x01\x01\x01\x00\x01\x01\x01\x00\x00\x00\x00\x01\x01\x00\x01"
-        //                                                             ?
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00"
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
-        //                                             [   \   ]   ^
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x01"
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
-        //                                             {   |   }
-        "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x00\x00\x01\x01";
-    for (int i = start; i < text.length; i++) {
-      int char = text.codeUnitAt(i);
-      if (char <= 0x7f && escapes.codeUnitAt(char) == 0) return i;
-    }
-    return text.length;
-  }
-
-  @patch
-  static String escape(String text) {
-    int escapeCharIndex = _findEscapeChar(text, 0);
-    // If the text contains no characters needing escape, return it directly.
-    if (escapeCharIndex == text.length) return text;
-
-    var buffer = new StringBuffer();
-    int previousSliceEndIndex = 0;
-    do {
-      // Copy characters from previous escape to current escape into result.
-      // This includes the previously escaped character.
-      buffer.write(text.substring(previousSliceEndIndex, escapeCharIndex));
-      // Prepare the current character to be escaped by prefixing it with a '\'.
-      buffer.write(r"\");
-      previousSliceEndIndex = escapeCharIndex;
-      escapeCharIndex = _findEscapeChar(text, escapeCharIndex + 1);
-    } while (escapeCharIndex < text.length);
-    // Copy tail of string into result.
-    buffer.write(text.substring(previousSliceEndIndex, escapeCharIndex));
-    return buffer.toString();
-  }
-
-  // Regular expression objects are stored in a cache of up to _MAX_CACHE_SIZE
-  // elements using an LRU eviction strategy.
-  // TODO(zerny): Do not impose a fixed limit on the number of cached objects.
-  // Other possibilities could be limiting by the size of the regexp objects,
-  // or imposing a lower time bound for the most recent use under which a regexp
-  // may not be removed from the cache.
-  // TODO(zerny): Use self-sizing cache similar to _AccessorCache in
-  // mirrors_impl.dart.
-  static const int _MAX_CACHE_SIZE = 256;
-  static final Map<_RegExpHashKey, _RegExpHashValue> _cache =
-      new HashMap<_RegExpHashKey, _RegExpHashValue>();
-  static final LinkedList<_RegExpHashKey> _recentlyUsed =
-      new LinkedList<_RegExpHashKey>();
-
-  int get _groupCount;
-  Iterable<String> get _groupNames;
-  int _groupNameIndex(String name);
-}
-
-// Represents both a key in the regular expression cache as well as its
-// corresponding entry in the LRU list.
-class _RegExpHashKey extends LinkedListEntry<_RegExpHashKey> {
-  final String pattern;
-  final bool multiLine;
-  final bool caseSensitive;
-  final bool unicode;
-  final bool dotAll;
-
-  _RegExpHashKey(this.pattern, this.multiLine, this.caseSensitive, this.unicode,
-      this.dotAll);
-
-  int get hashCode => pattern.hashCode;
-  bool operator ==(that) {
-    return (that is _RegExpHashKey) &&
-        (this.pattern == that.pattern) &&
-        (this.multiLine == that.multiLine) &&
-        (this.caseSensitive == that.caseSensitive) &&
-        (this.unicode == that.unicode) &&
-        (this.dotAll == that.dotAll);
-  }
-}
-
-// Represents a value in the regular expression cache. Contains a pointer
-// back to the key in order to access the corresponding LRU entry.
-class _RegExpHashValue {
-  final _RegExp regexp;
-  final _RegExpHashKey key;
-
-  _RegExpHashValue(this.regexp, this.key);
-}
-
-class _RegExpMatch implements RegExpMatch {
-  _RegExpMatch._(this._regexp, this.input, this._match);
-
-  int get start => _start(0);
-  int get end => _end(0);
-
-  int _start(int groupIdx) {
-    return _match[(groupIdx * _MATCH_PAIR)];
-  }
-
-  int _end(int groupIdx) {
-    return _match[(groupIdx * _MATCH_PAIR) + 1];
-  }
-
-  String? group(int groupIdx) {
-    if (groupIdx < 0 || groupIdx > _regexp._groupCount) {
-      throw new RangeError.value(groupIdx);
-    }
-    int startIndex = _start(groupIdx);
-    int endIndex = _end(groupIdx);
-    if (startIndex == -1) {
-      assert(endIndex == -1);
-      return null;
-    }
-    return input._substringUnchecked(startIndex, endIndex);
-  }
-
-  String? operator [](int groupIdx) {
-    return this.group(groupIdx);
-  }
-
-  List<String?> groups(List<int> groupsSpec) {
-    var groupsList = new List<String?>.filled(groupsSpec.length, null);
-    for (int i = 0; i < groupsSpec.length; i++) {
-      groupsList[i] = group(groupsSpec[i]);
-    }
-    return groupsList;
-  }
-
-  int get groupCount => _regexp._groupCount;
-
-  Pattern get pattern => _regexp;
-
-  String? namedGroup(String name) {
-    var idx = _regexp._groupNameIndex(name);
-    if (idx < 0) {
-      throw ArgumentError("Not a capture group name: ${name}");
-    }
-    return group(idx);
-  }
-
-  Iterable<String> get groupNames {
-    return _regexp._groupNames;
-  }
-
-  final RegExp _regexp;
-  final String input;
-  final List<int> _match;
-  static const int _MATCH_PAIR = 2;
-}
-
-@pragma("vm:entry-point")
-class _RegExp implements RegExp {
-  factory _RegExp(String pattern,
-      {bool multiLine: false,
-      bool caseSensitive: true,
-      bool unicode: false,
-      bool dotAll: false}) native "RegExp_factory";
-
-  RegExpMatch? firstMatch(String input) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (input == null) throw new ArgumentError.notNull('input');
-    final match = _ExecuteMatch(input, 0);
-    if (match == null) {
-      return null;
-    }
-    return new _RegExpMatch._(this, input, match);
-  }
-
-  Iterable<RegExpMatch> allMatches(String string, [int start = 0]) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (string == null) throw new ArgumentError.notNull('string');
-    if (start == null) throw new ArgumentError.notNull('start');
-    if (0 > start || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    return new _AllMatchesIterable(this, string, start);
-  }
-
-  RegExpMatch? matchAsPrefix(String string, [int start = 0]) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (string == null) throw new ArgumentError.notNull('string');
-    if (start == null) throw new ArgumentError.notNull('start');
-    if (start < 0 || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    final list = _ExecuteMatchSticky(string, start);
-    if (list == null) return null;
-    return new _RegExpMatch._(this, string, list);
-  }
-
-  bool hasMatch(String input) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (input == null) throw new ArgumentError.notNull('input');
-    List? match = _ExecuteMatch(input, 0);
-    return (match == null) ? false : true;
-  }
-
-  String? stringMatch(String input) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (input == null) throw new ArgumentError.notNull('input');
-    List? match = _ExecuteMatch(input, 0);
-    if (match == null) {
-      return null;
-    }
-    return input._substringUnchecked(match[0], match[1]);
-  }
-
-  String get pattern native "RegExp_getPattern";
-
-  bool get isMultiLine native "RegExp_getIsMultiLine";
-
-  bool get isCaseSensitive native "RegExp_getIsCaseSensitive";
-
-  bool get isUnicode native "RegExp_getIsUnicode";
-
-  bool get isDotAll native "RegExp_getIsDotAll";
-
-  int get _groupCount native "RegExp_getGroupCount";
-
-  /// The names and indices of named capture group.
-  ///
-  /// Returns a [List] of alternating strings and integers,
-  /// `[String, int, String, int, ...]` where each
-  /// [String] is the name of a capture group and the following
-  /// [int] is that capture group's index.
-  /// Returns `null` if there are no group names.
-  List? get _groupNameList native "RegExp_getGroupNameMap";
-
-  Iterable<String> get _groupNames sync* {
-    final nameList = _groupNameList;
-    if (nameList == null) return;
-    for (var i = 0; i < nameList.length; i += 2) {
-      yield nameList[i] as String;
-    }
-  }
-
-  int _groupNameIndex(String name) {
-    var nameList = _groupNameList;
-    if (nameList == null) return -1;
-    for (var i = 0; i < nameList.length; i += 2) {
-      if (name == nameList[i]) {
-        return nameList[i + 1] as int;
-      }
-    }
-    return -1;
-  }
-
-  // Byte map of one byte characters with a 0xff if the character is a word
-  // character (digit, letter or underscore) and 0x00 otherwise.
-  // Used by generated RegExp code.
-  static const List<int> _wordCharacterMap = const <int>[
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // '0' - '7'
-    0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // '8' - '9'
-
-    0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 'A' - 'G'
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 'H' - 'O'
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 'P' - 'W'
-    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, // 'X' - 'Z', '_'
-
-    0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 'a' - 'g'
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 'h' - 'o'
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // 'p' - 'w'
-    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, // 'x' - 'z'
-    // Latin-1 range
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  ];
-
-  List<int>? _ExecuteMatch(String str, int start_index)
-      native "RegExp_ExecuteMatch";
-
-  List<int>? _ExecuteMatchSticky(String str, int start_index)
-      native "RegExp_ExecuteMatchSticky";
-}
-
-class _AllMatchesIterable extends IterableBase<RegExpMatch> {
-  final _RegExp _re;
-  final String _str;
-  final int _start;
-
-  _AllMatchesIterable(this._re, this._str, this._start);
-
-  Iterator<RegExpMatch> get iterator =>
-      new _AllMatchesIterator(_re, _str, _start);
-}
-
-class _AllMatchesIterator implements Iterator<RegExpMatch> {
-  final String _str;
-  int _nextIndex;
-  _RegExp? _re;
-  RegExpMatch? _current;
-
-  _AllMatchesIterator(this._re, this._str, this._nextIndex);
-
-  RegExpMatch get current => _current!;
-
-  static bool _isLeadSurrogate(int c) {
-    return c >= 0xd800 && c <= 0xdbff;
-  }
-
-  static bool _isTrailSurrogate(int c) {
-    return c >= 0xdc00 && c <= 0xdfff;
-  }
-
-  bool moveNext() {
-    final re = _re;
-    if (re == null) return false; // Cleared after a failed match.
-    if (_nextIndex <= _str.length) {
-      final match = re._ExecuteMatch(_str, _nextIndex);
-      if (match != null) {
-        var current = new _RegExpMatch._(re, _str, match);
-        _current = current;
-        _nextIndex = current.end;
-        if (_nextIndex == current.start) {
-          // Zero-width match. Advance by one more, unless the regexp
-          // is in unicode mode and it would put us within a surrogate
-          // pair. In that case, advance past the code point as a whole.
-          if (re.isUnicode &&
-              _nextIndex + 1 < _str.length &&
-              _isLeadSurrogate(_str.codeUnitAt(_nextIndex)) &&
-              _isTrailSurrogate(_str.codeUnitAt(_nextIndex + 1))) {
-            _nextIndex++;
-          }
-          _nextIndex++;
-        }
-        return true;
-      }
-    }
-    _current = null;
-    _re = null;
-    return false;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/schedule_microtask_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/schedule_microtask_patch.dart
deleted file mode 100644
index 3abbcb5..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/schedule_microtask_patch.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "async_patch.dart";
-
-@patch
-class _AsyncRun {
-  @patch
-  static void _scheduleImmediate(void callback()) {
-    final closure = _ScheduleImmediate._closure;
-    if (closure == null) {
-      throw new UnsupportedError("Microtasks are not supported");
-    }
-    closure(callback);
-  }
-}
-
-typedef void _ScheduleImmediateClosure(void callback());
-
-class _ScheduleImmediate {
-  static _ScheduleImmediateClosure? _closure;
-}
-
-@pragma("vm:entry-point", "call")
-void _setScheduleImmediateClosure(_ScheduleImmediateClosure closure) {
-  _ScheduleImmediate._closure = closure;
-}
-
-@pragma("vm:entry-point", "call")
-void _ensureScheduleImmediate() {
-  _AsyncRun._scheduleImmediate(_startMicrotaskLoop);
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/stacktrace.dart b/sdk_nnbd/lib/_internal/vm/lib/stacktrace.dart
deleted file mode 100644
index 719d55a..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/stacktrace.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "core_patch.dart";
-
-/// VM internal StackTrace implementation.
-@pragma("vm:entry-point")
-class _StackTrace implements StackTrace {
-  // toString() is overridden on the C++ side.
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/stopwatch_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/stopwatch_patch.dart
deleted file mode 100644
index df29eca..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/stopwatch_patch.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class Stopwatch {
-  static const _maxInt = 0x7FFFFFFFFFFFFFFF;
-
-  @patch
-  static int _initTicker() => _computeFrequency();
-
-  // Returns the current clock tick.
-  @patch
-  static int _now() native "Stopwatch_now";
-
-  // Returns the frequency of clock ticks in Hz.
-  static int _computeFrequency() native "Stopwatch_frequency";
-
-  @patch
-  int get elapsedMicroseconds {
-    int ticks = elapsedTicks;
-    // Special case the more likely frequencies to avoid division,
-    // or divide by a known value.
-    if (_frequency == 1000000000) return ticks ~/ 1000;
-    if (_frequency == 1000000) return ticks;
-    if (_frequency == 1000) return ticks * 1000;
-    if (ticks <= (_maxInt ~/ 1000000)) {
-      return (ticks * 1000000) ~/ _frequency;
-    }
-    // Multiplication would have overflowed.
-    int ticksPerSecond = ticks ~/ _frequency;
-    int remainingTicks = unsafeCast<int>(ticks.remainder(_frequency));
-    return ticksPerSecond * 1000000 + (remainingTicks * 1000000) ~/ _frequency;
-  }
-
-  @patch
-  int get elapsedMilliseconds {
-    int ticks = elapsedTicks;
-    if (_frequency == 1000000000) return ticks ~/ 1000000;
-    if (_frequency == 1000000) return ticks ~/ 1000;
-    if (_frequency == 1000) return ticks;
-    if (ticks <= (_maxInt ~/ 1000)) {
-      return (ticks * 1000) ~/ _frequency;
-    }
-    // Multiplication would have overflowed.
-    int ticksPerSecond = ticks ~/ _frequency;
-    int remainingTicks = unsafeCast<int>(ticks.remainder(_frequency));
-    return ticksPerSecond * 1000 + (remainingTicks * 1000) ~/ _frequency;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/string_buffer_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/string_buffer_patch.dart
deleted file mode 100644
index 0a1b06d..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/string_buffer_patch.dart
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@patch
-class StringBuffer {
-  static const int _BUFFER_SIZE = 64;
-  static const int _PARTS_TO_COMPACT = 128;
-  static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8;
-
-  /**
-   * When strings are written to the string buffer, we add them to a
-   * list of string parts.
-   */
-  List<String>? _parts;
-
-  /**
-    * Total number of code units in the string parts. Does not include
-    * the code units added to the buffer.
-    */
-  int _partsCodeUnits = 0;
-
-  /**
-   * To preserve memory, we sometimes compact the parts. This combines
-   * several smaller parts into a single larger part to cut down on the
-   * cost that comes from the per-object memory overhead. We keep track
-   * of the last index where we ended our compaction and the number of
-   * code units added since the last compaction.
-   */
-  int _partsCompactionIndex = 0;
-  int _partsCodeUnitsSinceCompaction = 0;
-
-  /**
-   * The buffer is used to build up a string from code units. It is
-   * used when writing short strings or individual char codes to the
-   * buffer. The buffer is allocated on demand.
-   */
-  Uint16List? _buffer;
-  int _bufferPosition = 0;
-
-  /**
-   * Collects the approximate maximal magnitude of the code units added
-   * to the buffer.
-   *
-   * The value of each added code unit is or'ed with this variable, so the
-   * most significant bit set in any code unit is also set in this value.
-   * If below 256, the string in the buffer is a Latin-1 string.
-   */
-  int _bufferCodeUnitMagnitude = 0;
-
-  /// Creates the string buffer with an initial content.
-  @patch
-  StringBuffer([Object content = ""]) {
-    write(content);
-  }
-
-  @patch
-  int get length => _partsCodeUnits + _bufferPosition;
-
-  @patch
-  void write(Object? obj) {
-    String str = obj.toString();
-    if (str.isEmpty) return;
-    _consumeBuffer();
-    _addPart(str);
-  }
-
-  @patch
-  void writeCharCode(int charCode) {
-    if (charCode <= 0xFFFF) {
-      if (charCode < 0) {
-        throw new RangeError.range(charCode, 0, 0x10FFFF);
-      }
-      _ensureCapacity(1);
-      final localBuffer = _buffer!;
-      localBuffer[_bufferPosition++] = charCode;
-      _bufferCodeUnitMagnitude |= charCode;
-    } else {
-      if (charCode > 0x10FFFF) {
-        throw new RangeError.range(charCode, 0, 0x10FFFF);
-      }
-      _ensureCapacity(2);
-      int bits = charCode - 0x10000;
-      final localBuffer = _buffer!;
-      localBuffer[_bufferPosition++] = 0xD800 | (bits >> 10);
-      localBuffer[_bufferPosition++] = 0xDC00 | (bits & 0x3FF);
-      _bufferCodeUnitMagnitude |= 0xFFFF;
-    }
-  }
-
-  @patch
-  void writeAll(Iterable objects, [String separator = ""]) {
-    Iterator iterator = objects.iterator;
-    if (!iterator.moveNext()) return;
-    if (separator.isEmpty) {
-      do {
-        write(iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      write(iterator.current);
-      while (iterator.moveNext()) {
-        write(separator);
-        write(iterator.current);
-      }
-    }
-  }
-
-  @patch
-  void writeln([Object? obj = ""]) {
-    write(obj);
-    write("\n");
-  }
-
-  /** Makes the buffer empty. */
-  @patch
-  void clear() {
-    _parts = null;
-    _partsCodeUnits = _bufferPosition = _bufferCodeUnitMagnitude = 0;
-  }
-
-  /** Returns the contents of buffer as a string. */
-  @patch
-  String toString() {
-    _consumeBuffer();
-    final localParts = _parts;
-    return (_partsCodeUnits == 0 || localParts == null)
-        ? ""
-        : _StringBase._concatRange(localParts, 0, localParts.length);
-  }
-
-  /** Ensures that the buffer has enough capacity to add n code units. */
-  void _ensureCapacity(int n) {
-    final localBuffer = _buffer;
-    if (localBuffer == null) {
-      _buffer = new Uint16List(_BUFFER_SIZE);
-    } else if (_bufferPosition + n > localBuffer.length) {
-      _consumeBuffer();
-    }
-  }
-
-  /**
-   * Consumes the content of the buffer by turning it into a string
-   * and adding it as a part. After calling this the buffer position
-   * will be reset to zero.
-   */
-  void _consumeBuffer() {
-    if (_bufferPosition == 0) return;
-    bool isLatin1 = _bufferCodeUnitMagnitude <= 0xFF;
-    String str = _create(_buffer!, _bufferPosition, isLatin1);
-    _bufferPosition = _bufferCodeUnitMagnitude = 0;
-    _addPart(str);
-  }
-
-  /**
-   * Adds a new part to this string buffer and keeps track of how
-   * many code units are contained in the parts.
-   */
-  void _addPart(String str) {
-    final localParts = _parts;
-    int length = str.length;
-    _partsCodeUnits += length;
-    _partsCodeUnitsSinceCompaction += length;
-
-    if (localParts == null) {
-      // Empirically this is a good capacity to minimize total bytes allocated.
-      _parts = new _GrowableList.withCapacity(10)..add(str);
-    } else {
-      localParts.add(str);
-      int partsSinceCompaction = localParts.length - _partsCompactionIndex;
-      if (partsSinceCompaction == _PARTS_TO_COMPACT) {
-        _compact();
-      }
-    }
-  }
-
-  /**
-   * Compacts the last N parts if their average size allows us to save a
-   * lot of memory by turning them all into a single part.
-   */
-  void _compact() {
-    final localParts = _parts!;
-    if (_partsCodeUnitsSinceCompaction < _PARTS_TO_COMPACT_SIZE_LIMIT) {
-      String compacted = _StringBase._concatRange(
-          localParts,
-          _partsCompactionIndex, // Start
-          _partsCompactionIndex + _PARTS_TO_COMPACT // End
-          );
-      localParts.length = localParts.length - _PARTS_TO_COMPACT;
-      localParts.add(compacted);
-    }
-    _partsCodeUnitsSinceCompaction = 0;
-    _partsCompactionIndex = localParts.length;
-  }
-
-  /**
-   * Create a [String] from the UFT-16 code units in buffer.
-   */
-  static String _create(Uint16List buffer, int length, bool isLatin1)
-      native "StringBuffer_createStringFromUint16Array";
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/string_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/string_patch.dart
deleted file mode 100644
index 55fc053..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/string_patch.dart
+++ /dev/null
@@ -1,1416 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-const int _maxAscii = 0x7f;
-const int _maxLatin1 = 0xff;
-const int _maxUtf16 = 0xffff;
-const int _maxUnicode = 0x10ffff;
-
-@patch
-class String {
-  @patch
-  factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int? end]) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (charCodes == null) throw new ArgumentError.notNull("charCodes");
-    if (start == null) throw new ArgumentError.notNull("start");
-    return _StringBase.createFromCharCodes(charCodes, start, end, null);
-  }
-
-  @patch
-  factory String.fromCharCode(int charCode) {
-    if (charCode >= 0) {
-      if (charCode <= 0xff) {
-        return _OneByteString._allocate(1).._setAt(0, charCode);
-      }
-      if (charCode <= 0xffff) {
-        return _StringBase._createFromCodePoints(
-            new _List(1)..[0] = charCode, 0, 1);
-      }
-      if (charCode <= 0x10ffff) {
-        var low = 0xDC00 | (charCode & 0x3ff);
-        int bits = charCode - 0x10000;
-        var high = 0xD800 | (bits >> 10);
-        return _StringBase._createFromCodePoints(
-            new _List(2)
-              ..[0] = high
-              ..[1] = low,
-            0,
-            2);
-      }
-    }
-    throw new RangeError.range(charCode, 0, 0x10ffff);
-  }
-
-  @patch
-  const factory String.fromEnvironment(String name, {String defaultValue = ""})
-      native "String_fromEnvironment";
-
-  bool get _isOneByte;
-  String _substringUnchecked(int startIndex, int endIndex);
-}
-
-/**
- * [_StringBase] contains common methods used by concrete String
- * implementations, e.g., _OneByteString.
- */
-abstract class _StringBase implements String {
-  bool _isWhitespace(int codeUnit);
-
-  // Constants used by replaceAll encoding of string slices between matches.
-  // A string slice (start+length) is encoded in a single Smi to save memory
-  // overhead in the common case.
-  // We use fewer bits for length (11 bits) than for the start index (19+ bits).
-  // For long strings, it's possible to have many large indices,
-  // but it's unlikely to have many long lengths since slices don't overlap.
-  // If there are few matches in a long string, then there are few long slices,
-  // and if there are many matches, there'll likely be many short slices.
-  //
-  // Encoding is: 0((start << _lengthBits) | length)
-
-  // Number of bits used by length.
-  // This is the shift used to encode and decode the start index.
-  static const int _lengthBits = 11;
-  // The maximal allowed length value in an encoded slice.
-  static const int _maxLengthValue = (1 << _lengthBits) - 1;
-  // Mask of length in encoded smi value.
-  static const int _lengthMask = _maxLengthValue;
-  static const int _startBits = _maxUnsignedSmiBits - _lengthBits;
-  // Maximal allowed start index value in an encoded slice.
-  static const int _maxStartValue = (1 << _startBits) - 1;
-  // We pick 30 as a safe lower bound on available bits in a negative smi.
-  // TODO(lrn): Consider allowing more bits for start on 64-bit systems.
-  static const int _maxUnsignedSmiBits = 30;
-
-  // For longer strings, calling into C++ to create the result of a
-  // [replaceAll] is faster than [_joinReplaceAllOneByteResult].
-  // TODO(lrn): See if this limit can be tweaked.
-  static const int _maxJoinReplaceOneByteStringLength = 500;
-
-  factory _StringBase._uninstantiable() {
-    throw new UnsupportedError("_StringBase can't be instaniated");
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int get hashCode native "String_getHashCode";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int get _identityHashCode native "String_getHashCode";
-
-  bool get _isOneByte {
-    // Alternatively return false and override it on one-byte string classes.
-    int id = ClassID.getID(this);
-    return id == ClassID.cidOneByteString ||
-        id == ClassID.cidExternalOneByteString;
-  }
-
-  /**
-   * Create the most efficient string representation for specified
-   * [charCodes].
-   *
-   * Only uses the character codes between index [start] and index [end] of
-   * `charCodes`. They must satisfy `0 <= start <= end <= charCodes.length`.
-   *
-   * The [limit] is an upper limit on the character codes in the iterable.
-   * It's `null` if unknown.
-   */
-  static String createFromCharCodes(
-      Iterable<int> charCodes, int start, int? end, int? limit) {
-    // TODO(srdjan): Also skip copying of wide typed arrays.
-    final ccid = ClassID.getID(charCodes);
-    if ((ccid != ClassID.cidArray) &&
-        (ccid != ClassID.cidGrowableObjectArray) &&
-        (ccid != ClassID.cidImmutableArray)) {
-      if (charCodes is Uint8List) {
-        final actualEnd =
-            RangeError.checkValidRange(start, end, charCodes.length);
-        return _createOneByteString(charCodes, start, actualEnd - start);
-      } else if (charCodes is! Uint16List) {
-        return _createStringFromIterable(charCodes, start, end);
-      }
-    }
-    final int codeCount = charCodes.length;
-    final actualEnd = RangeError.checkValidRange(start, end, codeCount);
-    final len = actualEnd - start;
-    if (len == 0) return "";
-
-    final typedCharCodes = unsafeCast<List<int>>(charCodes);
-
-    final int actualLimit =
-        limit ?? _scanCodeUnits(typedCharCodes, start, actualEnd);
-    if (actualLimit < 0) {
-      throw new ArgumentError(typedCharCodes);
-    }
-    if (actualLimit <= _maxLatin1) {
-      return _createOneByteString(typedCharCodes, start, len);
-    }
-    if (actualLimit <= _maxUtf16) {
-      return _TwoByteString._allocateFromTwoByteList(
-          typedCharCodes, start, actualEnd);
-    }
-    // TODO(lrn): Consider passing limit to _createFromCodePoints, because
-    // the function is currently fully generic and doesn't know that its
-    // charCodes are not all Latin-1 or Utf-16.
-    return _createFromCodePoints(typedCharCodes, start, actualEnd);
-  }
-
-  static int _scanCodeUnits(List<int> charCodes, int start, int end) {
-    int bits = 0;
-    for (int i = start; i < end; i++) {
-      int code = charCodes[i];
-      if (code is! _Smi) throw new ArgumentError(charCodes);
-      bits |= code;
-    }
-    return bits;
-  }
-
-  static String _createStringFromIterable(
-      Iterable<int> charCodes, int start, int? end) {
-    // Treat charCodes as Iterable.
-    if (charCodes is EfficientLengthIterable) {
-      int length = charCodes.length;
-      final endVal = RangeError.checkValidRange(start, end, length);
-      final charCodeList = new List<int>.from(
-          charCodes.take(endVal).skip(start),
-          growable: false);
-      return createFromCharCodes(charCodeList, 0, charCodeList.length, null);
-    }
-    // Don't know length of iterable, so iterate and see if all the values
-    // are there.
-    if (start < 0) throw new RangeError.range(start, 0, charCodes.length);
-    var it = charCodes.iterator;
-    for (int i = 0; i < start; i++) {
-      if (!it.moveNext()) {
-        throw new RangeError.range(start, 0, i);
-      }
-    }
-    List<int> charCodeList;
-    int bits = 0; // Bitwise-or of all char codes in list.
-    final endVal = end;
-    if (endVal == null) {
-      var list = <int>[];
-      while (it.moveNext()) {
-        int code = it.current;
-        bits |= code;
-        list.add(code);
-      }
-      charCodeList = makeListFixedLength<int>(list);
-    } else {
-      if (endVal < start) {
-        throw new RangeError.range(endVal, start, charCodes.length);
-      }
-      int len = endVal - start;
-      charCodeList = new List<int>.generate(len, (int i) {
-        if (!it.moveNext()) {
-          throw new RangeError.range(endVal, start, start + i);
-        }
-        int code = it.current;
-        bits |= code;
-        return code;
-      });
-    }
-    int length = charCodeList.length;
-    if (bits < 0) {
-      throw new ArgumentError(charCodes);
-    }
-    bool isOneByteString = (bits <= _maxLatin1);
-    if (isOneByteString) {
-      return _createOneByteString(charCodeList, 0, length);
-    }
-    return createFromCharCodes(charCodeList, 0, length, bits);
-  }
-
-  // Inlining is disabled as a workaround to http://dartbug.com/37800.
-  @pragma("vm:never-inline")
-  static String _createOneByteString(List<int> charCodes, int start, int len) {
-    // It's always faster to do this in Dart than to call into the runtime.
-    var s = _OneByteString._allocate(len);
-
-    // Special case for native Uint8 typed arrays.
-    final int cid = ClassID.getID(charCodes);
-    if (cid == ClassID.cidUint8ArrayView ||
-        cid == ClassID.cidUint8Array ||
-        cid == ClassID.cidExternalUint8Array) {
-      Uint8List bytes = unsafeCast<Uint8List>(charCodes);
-      copyRangeFromUint8ListToOneByteString(bytes, s, start, 0, len);
-      return s;
-    }
-
-    // Fall through to normal case.
-    for (int i = 0; i < len; i++) {
-      s._setAt(i, charCodes[start + i]);
-    }
-    return s;
-  }
-
-  static String _createFromCodePoints(List<int> codePoints, int start, int end)
-      native "StringBase_createFromCodePoints";
-
-  String operator [](int index) native "String_charAt";
-
-  int codeUnitAt(int index); // Implemented in the subclasses.
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "String_getLength";
-
-  @pragma("vm:exact-result-type", bool)
-  bool get isEmpty {
-    return this.length == 0;
-  }
-
-  bool get isNotEmpty => !isEmpty;
-
-  String operator +(String other) native "String_concat";
-
-  String toString() {
-    return this;
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool operator ==(Object other) {
-    if (identical(this, other)) {
-      return true;
-    }
-    if (other is String && this.length == other.length) {
-      final len = this.length;
-      for (int i = 0; i < len; i++) {
-        if (this.codeUnitAt(i) != other.codeUnitAt(i)) {
-          return false;
-        }
-      }
-      return true;
-    }
-    return false;
-  }
-
-  int compareTo(String other) {
-    int thisLength = this.length;
-    int otherLength = other.length;
-    int len = (thisLength < otherLength) ? thisLength : otherLength;
-    for (int i = 0; i < len; i++) {
-      int thisCodeUnit = this.codeUnitAt(i);
-      int otherCodeUnit = other.codeUnitAt(i);
-      if (thisCodeUnit < otherCodeUnit) {
-        return -1;
-      }
-      if (thisCodeUnit > otherCodeUnit) {
-        return 1;
-      }
-    }
-    if (thisLength < otherLength) return -1;
-    if (thisLength > otherLength) return 1;
-    return 0;
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool _substringMatches(int start, String other) {
-    if (other.isEmpty) return true;
-    final len = other.length;
-    if ((start < 0) || (start + len > this.length)) {
-      return false;
-    }
-    for (int i = 0; i < len; i++) {
-      if (this.codeUnitAt(i + start) != other.codeUnitAt(i)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  bool endsWith(String other) {
-    return _substringMatches(this.length - other.length, other);
-  }
-
-  bool startsWith(Pattern pattern, [int index = 0]) {
-    if ((index < 0) || (index > this.length)) {
-      throw new RangeError.range(index, 0, this.length);
-    }
-    if (pattern is String) {
-      return _substringMatches(index, pattern);
-    }
-    return pattern.matchAsPrefix(this, index) != null;
-  }
-
-  int indexOf(Pattern pattern, [int start = 0]) {
-    if ((start < 0) || (start > this.length)) {
-      throw new RangeError.range(start, 0, this.length, "start");
-    }
-    if (pattern is String) {
-      String other = pattern;
-      int maxIndex = this.length - other.length;
-      // TODO: Use an efficient string search (e.g. BMH).
-      for (int index = start; index <= maxIndex; index++) {
-        if (_substringMatches(index, other)) {
-          return index;
-        }
-      }
-      return -1;
-    }
-    for (int i = start; i <= this.length; i++) {
-      // TODO(11276); This has quadratic behavior because matchAsPrefix tries
-      // to find a later match too. Optimize matchAsPrefix to avoid this.
-      if (pattern.matchAsPrefix(this, i) != null) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Pattern pattern, [int? start]) {
-    if (start == null) {
-      start = this.length;
-    } else if (start < 0 || start > this.length) {
-      throw new RangeError.range(start, 0, this.length);
-    }
-    if (pattern is String) {
-      String other = pattern;
-      int maxIndex = this.length - other.length;
-      if (maxIndex < start) start = maxIndex;
-      for (int index = start; index >= 0; index--) {
-        if (_substringMatches(index, other)) {
-          return index;
-        }
-      }
-      return -1;
-    }
-    for (int i = start; i >= 0; i--) {
-      // TODO(11276); This has quadratic behavior because matchAsPrefix tries
-      // to find a later match too. Optimize matchAsPrefix to avoid this.
-      if (pattern.matchAsPrefix(this, i) != null) return i;
-    }
-    return -1;
-  }
-
-  String substring(int startIndex, [int? endIndex]) {
-    endIndex ??= this.length;
-
-    if ((startIndex < 0) || (startIndex > this.length)) {
-      throw new RangeError.value(startIndex);
-    }
-    if ((endIndex < 0) || (endIndex > this.length)) {
-      throw new RangeError.value(endIndex);
-    }
-    if (startIndex > endIndex) {
-      throw new RangeError.value(startIndex);
-    }
-    return _substringUnchecked(startIndex, endIndex);
-  }
-
-  String _substringUnchecked(int startIndex, int endIndex) {
-    assert(endIndex != null);
-    assert((startIndex >= 0) && (startIndex <= this.length));
-    assert((endIndex >= 0) && (endIndex <= this.length));
-    assert(startIndex <= endIndex);
-
-    if (startIndex == endIndex) {
-      return "";
-    }
-    if ((startIndex == 0) && (endIndex == this.length)) {
-      return this;
-    }
-    if ((startIndex + 1) == endIndex) {
-      return this[startIndex];
-    }
-    return _substringUncheckedNative(startIndex, endIndex);
-  }
-
-  String _substringUncheckedNative(int startIndex, int endIndex)
-      native "StringBase_substringUnchecked";
-
-  // Checks for one-byte whitespaces only.
-  static bool _isOneByteWhitespace(int codeUnit) {
-    if (codeUnit <= 32) {
-      return ((codeUnit == 32) || // Space.
-          ((codeUnit <= 13) && (codeUnit >= 9))); // CR, LF, TAB, etc.
-    }
-    return (codeUnit == 0x85) || (codeUnit == 0xA0); // NEL, NBSP.
-  }
-
-  // Characters with Whitespace property (Unicode 6.3).
-  // 0009..000D    ; White_Space # Cc       <control-0009>..<control-000D>
-  // 0020          ; White_Space # Zs       SPACE
-  // 0085          ; White_Space # Cc       <control-0085>
-  // 00A0          ; White_Space # Zs       NO-BREAK SPACE
-  // 1680          ; White_Space # Zs       OGHAM SPACE MARK
-  // 2000..200A    ; White_Space # Zs       EN QUAD..HAIR SPACE
-  // 2028          ; White_Space # Zl       LINE SEPARATOR
-  // 2029          ; White_Space # Zp       PARAGRAPH SEPARATOR
-  // 202F          ; White_Space # Zs       NARROW NO-BREAK SPACE
-  // 205F          ; White_Space # Zs       MEDIUM MATHEMATICAL SPACE
-  // 3000          ; White_Space # Zs       IDEOGRAPHIC SPACE
-  //
-  // BOM: 0xFEFF
-  static bool _isTwoByteWhitespace(int codeUnit) {
-    if (codeUnit <= 32) {
-      return (codeUnit == 32) || ((codeUnit <= 13) && (codeUnit >= 9));
-    }
-    if (codeUnit < 0x85) return false;
-    if ((codeUnit == 0x85) || (codeUnit == 0xA0)) return true;
-    return (codeUnit <= 0x200A)
-        ? ((codeUnit == 0x1680) || (0x2000 <= codeUnit))
-        : ((codeUnit == 0x2028) ||
-            (codeUnit == 0x2029) ||
-            (codeUnit == 0x202F) ||
-            (codeUnit == 0x205F) ||
-            (codeUnit == 0x3000) ||
-            (codeUnit == 0xFEFF));
-  }
-
-  int _firstNonWhitespace() {
-    final len = this.length;
-    int first = 0;
-    for (; first < len; first++) {
-      if (!_isWhitespace(this.codeUnitAt(first))) {
-        break;
-      }
-    }
-    return first;
-  }
-
-  int _lastNonWhitespace() {
-    int last = this.length - 1;
-    for (; last >= 0; last--) {
-      if (!_isWhitespace(this.codeUnitAt(last))) {
-        break;
-      }
-    }
-    return last;
-  }
-
-  String trim() {
-    final len = this.length;
-    int first = _firstNonWhitespace();
-    if (len == first) {
-      // String contains only whitespaces.
-      return "";
-    }
-    int last = _lastNonWhitespace() + 1;
-    if ((first == 0) && (last == len)) {
-      // Returns this string since it does not have leading or trailing
-      // whitespaces.
-      return this;
-    }
-    return _substringUnchecked(first, last);
-  }
-
-  String trimLeft() {
-    final len = this.length;
-    int first = 0;
-    for (; first < len; first++) {
-      if (!_isWhitespace(this.codeUnitAt(first))) {
-        break;
-      }
-    }
-    if (len == first) {
-      // String contains only whitespaces.
-      return "";
-    }
-    if (first == 0) {
-      // Returns this string since it does not have leading or trailing
-      // whitespaces.
-      return this;
-    }
-    return _substringUnchecked(first, len);
-  }
-
-  String trimRight() {
-    final len = this.length;
-    int last = len - 1;
-    for (; last >= 0; last--) {
-      if (!_isWhitespace(this.codeUnitAt(last))) {
-        break;
-      }
-    }
-    if (last == -1) {
-      // String contains only whitespaces.
-      return "";
-    }
-    if (last == (len - 1)) {
-      // Returns this string since it does not have trailing whitespaces.
-      return this;
-    }
-    return _substringUnchecked(0, last + 1);
-  }
-
-  String operator *(int times) {
-    if (times <= 0) return "";
-    if (times == 1) return this;
-    StringBuffer buffer = new StringBuffer(this);
-    for (int i = 1; i < times; i++) {
-      buffer.write(this);
-    }
-    return buffer.toString();
-  }
-
-  String padLeft(int width, [String padding = ' ']) {
-    int delta = width - this.length;
-    if (delta <= 0) return this;
-    StringBuffer buffer = new StringBuffer();
-    for (int i = 0; i < delta; i++) {
-      buffer.write(padding);
-    }
-    buffer.write(this);
-    return buffer.toString();
-  }
-
-  String padRight(int width, [String padding = ' ']) {
-    int delta = width - this.length;
-    if (delta <= 0) return this;
-    StringBuffer buffer = new StringBuffer(this);
-    for (int i = 0; i < delta; i++) {
-      buffer.write(padding);
-    }
-    return buffer.toString();
-  }
-
-  bool contains(Pattern pattern, [int startIndex = 0]) {
-    if (pattern is String) {
-      if (startIndex < 0 || startIndex > this.length) {
-        throw new RangeError.range(startIndex, 0, this.length);
-      }
-      return indexOf(pattern, startIndex) >= 0;
-    }
-    return pattern.allMatches(this.substring(startIndex)).isNotEmpty;
-  }
-
-  String replaceFirst(Pattern pattern, String replacement,
-      [int startIndex = 0]) {
-    // TODO: Remove these null checks once all code is opted into strong nonnullable mode.
-    if (pattern == null) {
-      throw new ArgumentError.notNull("pattern");
-    }
-    if (replacement == null) {
-      throw new ArgumentError.notNull("replacement");
-    }
-    if (startIndex == null) {
-      throw new ArgumentError.notNull("startIndex");
-    }
-    RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
-    Iterator iterator = startIndex == 0
-        ? pattern.allMatches(this).iterator
-        : pattern.allMatches(this, startIndex).iterator;
-    if (!iterator.moveNext()) return this;
-    Match match = iterator.current;
-    return replaceRange(match.start, match.end, replacement);
-  }
-
-  String replaceRange(int start, int? end, String replacement) {
-    final length = this.length;
-    final localEnd = RangeError.checkValidRange(start, end, length);
-    bool replacementIsOneByte = replacement._isOneByte;
-    if (start == 0 && localEnd == length) return replacement;
-    int replacementLength = replacement.length;
-    int totalLength = start + (length - localEnd) + replacementLength;
-    if (replacementIsOneByte && this._isOneByte) {
-      var result = _OneByteString._allocate(totalLength);
-      int index = 0;
-      index = result._setRange(index, this, 0, start);
-      index = result._setRange(start, replacement, 0, replacementLength);
-      result._setRange(index, this, localEnd, length);
-      return result;
-    }
-    List slices = [];
-    _addReplaceSlice(slices, 0, start);
-    if (replacement.length > 0) slices.add(replacement);
-    _addReplaceSlice(slices, localEnd, length);
-    return _joinReplaceAllResult(
-        this, slices, totalLength, replacementIsOneByte);
-  }
-
-  static int _addReplaceSlice(List matches, int start, int end) {
-    int length = end - start;
-    if (length > 0) {
-      if (length <= _maxLengthValue && start <= _maxStartValue) {
-        matches.add(-((start << _lengthBits) | length));
-      } else {
-        matches.add(start);
-        matches.add(end);
-      }
-    }
-    return length;
-  }
-
-  String replaceAll(Pattern pattern, String replacement) {
-    if (pattern == null) throw new ArgumentError.notNull("pattern");
-    if (replacement == null) throw new ArgumentError.notNull("replacement");
-
-    int startIndex = 0;
-    // String fragments that replace the the prefix [this] up to [startIndex].
-    List matches = [];
-    int length = 0; // Length of all fragments.
-    int replacementLength = replacement.length;
-
-    if (replacementLength == 0) {
-      for (Match match in pattern.allMatches(this)) {
-        length += _addReplaceSlice(matches, startIndex, match.start);
-        startIndex = match.end;
-      }
-    } else {
-      for (Match match in pattern.allMatches(this)) {
-        length += _addReplaceSlice(matches, startIndex, match.start);
-        matches.add(replacement);
-        length += replacementLength;
-        startIndex = match.end;
-      }
-    }
-    // No match, or a zero-length match at start with zero-length replacement.
-    if (startIndex == 0 && length == 0) return this;
-    length += _addReplaceSlice(matches, startIndex, this.length);
-    bool replacementIsOneByte = replacement._isOneByte;
-    if (replacementIsOneByte &&
-        length < _maxJoinReplaceOneByteStringLength &&
-        this._isOneByte) {
-      // TODO(lrn): Is there a cut-off point, or is runtime always faster?
-      return _joinReplaceAllOneByteResult(this, matches, length);
-    }
-    return _joinReplaceAllResult(this, matches, length, replacementIsOneByte);
-  }
-
-  /**
-   * As [_joinReplaceAllResult], but knowing that the result
-   * is always a [_OneByteString].
-   */
-  static String _joinReplaceAllOneByteResult(
-      String base, List matches, int length) {
-    _OneByteString result = _OneByteString._allocate(length);
-    int writeIndex = 0;
-    for (int i = 0; i < matches.length; i++) {
-      var entry = matches[i];
-      if (entry is _Smi) {
-        int sliceStart = entry;
-        int sliceEnd;
-        if (sliceStart < 0) {
-          int bits = -sliceStart;
-          int sliceLength = bits & _lengthMask;
-          sliceStart = bits >> _lengthBits;
-          sliceEnd = sliceStart + sliceLength;
-        } else {
-          i++;
-          // This function should only be called with valid matches lists.
-          // If the list is short, or sliceEnd is not an integer, one of
-          // the next few lines will throw anyway.
-          assert(i < matches.length);
-          sliceEnd = matches[i];
-        }
-        for (int j = sliceStart; j < sliceEnd; j++) {
-          result._setAt(writeIndex++, base.codeUnitAt(j));
-        }
-      } else {
-        // Replacement is a one-byte string.
-        String replacement = entry;
-        for (int j = 0; j < replacement.length; j++) {
-          result._setAt(writeIndex++, replacement.codeUnitAt(j));
-        }
-      }
-    }
-    assert(writeIndex == length);
-    return result;
-  }
-
-  /**
-   * Combine the results of a [replaceAll] match into a new string.
-   *
-   * The [matches] lists contains Smi index pairs representing slices of
-   * [base] and [String]s to be put in between the slices.
-   *
-   * The total [length] of the resulting string is known, as is
-   * whether the replacement strings are one-byte strings.
-   * If they are, then we have to check the base string slices to know
-   * whether the result must be a one-byte string.
-   */
-  static String
-      _joinReplaceAllResult(String base, List matches, int length,
-          bool replacementStringsAreOneByte)
-      native "StringBase_joinReplaceAllResult";
-
-  String replaceAllMapped(Pattern pattern, String replace(Match match)) {
-    if (pattern == null) throw new ArgumentError.notNull("pattern");
-    if (replace == null) throw new ArgumentError.notNull("replace");
-    List matches = [];
-    int length = 0;
-    int startIndex = 0;
-    bool replacementStringsAreOneByte = true;
-    for (Match match in pattern.allMatches(this)) {
-      length += _addReplaceSlice(matches, startIndex, match.start);
-      var replacement = "${replace(match)}";
-      matches.add(replacement);
-      length += replacement.length;
-      replacementStringsAreOneByte =
-          replacementStringsAreOneByte && replacement._isOneByte;
-      startIndex = match.end;
-    }
-    if (matches.isEmpty) return this;
-    length += _addReplaceSlice(matches, startIndex, this.length);
-    if (replacementStringsAreOneByte &&
-        length < _maxJoinReplaceOneByteStringLength &&
-        this._isOneByte) {
-      return _joinReplaceAllOneByteResult(this, matches, length);
-    }
-    return _joinReplaceAllResult(
-        this, matches, length, replacementStringsAreOneByte);
-  }
-
-  String replaceFirstMapped(Pattern pattern, String replace(Match match),
-      [int startIndex = 0]) {
-    if (pattern == null) throw new ArgumentError.notNull("pattern");
-    if (replace == null) throw new ArgumentError.notNull("replace");
-    if (startIndex == null) throw new ArgumentError.notNull("startIndex");
-    RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
-
-    var matches = pattern.allMatches(this, startIndex).iterator;
-    if (!matches.moveNext()) return this;
-    var match = matches.current;
-    var replacement = "${replace(match)}";
-    return replaceRange(match.start, match.end, replacement);
-  }
-
-  static String _matchString(Match match) => match[0]!;
-  static String _stringIdentity(String string) => string;
-
-  String _splitMapJoinEmptyString(
-      String onMatch(Match match), String onNonMatch(String nonMatch)) {
-    // Pattern is the empty string.
-    StringBuffer buffer = new StringBuffer();
-    int length = this.length;
-    int i = 0;
-    buffer.write(onNonMatch(""));
-    while (i < length) {
-      buffer.write(onMatch(new _StringMatch(i, this, "")));
-      // Special case to avoid splitting a surrogate pair.
-      int code = this.codeUnitAt(i);
-      if ((code & ~0x3FF) == 0xD800 && length > i + 1) {
-        // Leading surrogate;
-        code = this.codeUnitAt(i + 1);
-        if ((code & ~0x3FF) == 0xDC00) {
-          // Matching trailing surrogate.
-          buffer.write(onNonMatch(this.substring(i, i + 2)));
-          i += 2;
-          continue;
-        }
-      }
-      buffer.write(onNonMatch(this[i]));
-      i++;
-    }
-    buffer.write(onMatch(new _StringMatch(i, this, "")));
-    buffer.write(onNonMatch(""));
-    return buffer.toString();
-  }
-
-  String splitMapJoin(Pattern pattern,
-      {String onMatch(Match match)?, String onNonMatch(String nonMatch)?}) {
-    if (pattern == null) {
-      throw new ArgumentError.notNull("pattern");
-    }
-    onMatch ??= _matchString;
-    onNonMatch ??= _stringIdentity;
-    if (pattern is String) {
-      String stringPattern = pattern;
-      if (stringPattern.isEmpty) {
-        return _splitMapJoinEmptyString(onMatch, onNonMatch);
-      }
-    }
-    StringBuffer buffer = new StringBuffer();
-    int startIndex = 0;
-    for (Match match in pattern.allMatches(this)) {
-      buffer.write(onNonMatch(this.substring(startIndex, match.start)));
-      buffer.write(onMatch(match).toString());
-      startIndex = match.end;
-    }
-    buffer.write(onNonMatch(this.substring(startIndex)));
-    return buffer.toString();
-  }
-
-  // Convert single object to string.
-  @pragma("vm:entry-point", "call")
-  static String _interpolateSingle(Object o) {
-    if (o is String) return o;
-    final s = o.toString();
-    if (s is! String) {
-      throw new ArgumentError(s);
-    }
-    return s;
-  }
-
-  /**
-   * Convert all objects in [values] to strings and concat them
-   * into a result string.
-   * Modifies the input list if it contains non-`String` values.
-   */
-  @pragma("vm:entry-point", "call")
-  static String _interpolate(final List values) {
-    final numValues = values.length;
-    int totalLength = 0;
-    int i = 0;
-    while (i < numValues) {
-      final e = values[i];
-      final s = e.toString();
-      values[i] = s;
-      if (ClassID.getID(s) == ClassID.cidOneByteString) {
-        totalLength += s.length;
-        i++;
-      } else if (s is! String) {
-        throw new ArgumentError(s);
-      } else {
-        // Handle remaining elements without checking for one-byte-ness.
-        while (++i < numValues) {
-          final e = values[i];
-          final s = e.toString();
-          values[i] = s;
-          if (s is! String) {
-            throw new ArgumentError(s);
-          }
-        }
-        return _concatRangeNative(values, 0, numValues);
-      }
-    }
-    // All strings were one-byte strings.
-    return _OneByteString._concatAll(values, totalLength);
-  }
-
-  Iterable<Match> allMatches(String string, [int start = 0]) {
-    if (start < 0 || start > string.length) {
-      throw new RangeError.range(start, 0, string.length, "start");
-    }
-    return new _StringAllMatchesIterable(string, this, start);
-  }
-
-  Match? matchAsPrefix(String string, [int start = 0]) {
-    if (start < 0 || start > string.length) {
-      throw new RangeError.range(start, 0, string.length);
-    }
-    if (start + this.length > string.length) return null;
-    for (int i = 0; i < this.length; i++) {
-      if (string.codeUnitAt(start + i) != this.codeUnitAt(i)) {
-        return null;
-      }
-    }
-    return new _StringMatch(start, string, this);
-  }
-
-  List<String> split(Pattern pattern) {
-    if ((pattern is String) && pattern.isEmpty) {
-      List<String> result =
-          new List<String>.generate(this.length, (int i) => this[i]);
-      return result;
-    }
-    int length = this.length;
-    Iterator iterator = pattern.allMatches(this).iterator;
-    if (length == 0 && iterator.moveNext()) {
-      // A matched empty string input returns the empty list.
-      return <String>[];
-    }
-    List<String> result = <String>[];
-    int startIndex = 0;
-    int previousIndex = 0;
-    // 'pattern' may not be implemented correctly and therefore we cannot
-    // call _substringUnhchecked unless it is a trustworthy type (e.g. String).
-    while (true) {
-      if (startIndex == length || !iterator.moveNext()) {
-        result.add(this.substring(previousIndex, length));
-        break;
-      }
-      Match match = iterator.current;
-      if (match.start == length) {
-        result.add(this.substring(previousIndex, length));
-        break;
-      }
-      int endIndex = match.end;
-      if (startIndex == endIndex && endIndex == previousIndex) {
-        ++startIndex; // empty match, advance and restart
-        continue;
-      }
-      result.add(this.substring(previousIndex, match.start));
-      startIndex = previousIndex = endIndex;
-    }
-    return result;
-  }
-
-  List<int> get codeUnits => new CodeUnits(this);
-
-  Runes get runes => new Runes(this);
-
-  String toUpperCase() native "String_toUpperCase";
-
-  String toLowerCase() native "String_toLowerCase";
-
-  // Concatenate ['start', 'end'[ elements of 'strings'.
-  static String _concatRange(List<String> strings, int start, int end) {
-    if ((end - start) == 1) {
-      return strings[start];
-    }
-    return _concatRangeNative(strings, start, end);
-  }
-
-  // Call this method if all elements of [strings] are known to be strings
-  // but not all are known to be OneByteString(s).
-  static String _concatRangeNative(List strings, int start, int end)
-      native "String_concatRange";
-}
-
-@pragma("vm:entry-point")
-class _OneByteString extends _StringBase {
-  factory _OneByteString._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int get hashCode native "String_getHashCode";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int codeUnitAt(int index) native "String_codeUnitAt";
-
-  bool _isWhitespace(int codeUnit) {
-    return _StringBase._isOneByteWhitespace(codeUnit);
-  }
-
-  @pragma("vm:exact-result-type", bool)
-  bool operator ==(Object other) {
-    return super == other;
-  }
-
-  @pragma("vm:exact-result-type", _OneByteString)
-  String _substringUncheckedNative(int startIndex, int endIndex)
-      native "OneByteString_substringUnchecked";
-
-  List<String> _splitWithCharCode(int charCode)
-      native "OneByteString_splitWithCharCode";
-
-  List<String> split(Pattern pattern) {
-    // TODO(vegorov) investigate if this can be rewritten as `is _OneByteString`
-    // check without performance penalty. Front-end would then promote
-    // pattern variable to _OneByteString.
-    if (ClassID.getID(pattern) == ClassID.cidOneByteString) {
-      final String patternAsString = unsafeCast<String>(pattern);
-      if (patternAsString.length == 1) {
-        return _splitWithCharCode(patternAsString.codeUnitAt(0));
-      }
-    }
-    return super.split(pattern);
-  }
-
-  // All element of 'strings' must be OneByteStrings.
-  static _concatAll(List strings, int totalLength) {
-    if (totalLength > 128) {
-      // Native is quicker.
-      return _StringBase._concatRangeNative(strings, 0, strings.length);
-    }
-    final res = _OneByteString._allocate(totalLength);
-    final stringsLength = strings.length;
-    int rIx = 0;
-    for (int i = 0; i < stringsLength; i++) {
-      final _OneByteString e = strings[i];
-      final eLength = e.length;
-      for (int s = 0; s < eLength; s++) {
-        res._setAt(rIx++, e.codeUnitAt(s));
-      }
-    }
-    return res;
-  }
-
-  int indexOf(Pattern pattern, [int start = 0]) {
-    // Specialize for single character pattern.
-    final pCid = ClassID.getID(pattern);
-    if ((pCid == ClassID.cidOneByteString) ||
-        (pCid == ClassID.cidTwoByteString) ||
-        (pCid == ClassID.cidExternalOneByteString)) {
-      final String patternAsString = unsafeCast<String>(pattern);
-      final len = this.length;
-      if ((patternAsString.length == 1) && (start >= 0) && (start < len)) {
-        final patternCu0 = patternAsString.codeUnitAt(0);
-        if (patternCu0 > 0xFF) {
-          return -1;
-        }
-        for (int i = start; i < len; i++) {
-          if (this.codeUnitAt(i) == patternCu0) {
-            return i;
-          }
-        }
-        return -1;
-      }
-    }
-    return super.indexOf(pattern, start);
-  }
-
-  bool contains(Pattern pattern, [int start = 0]) {
-    final pCid = ClassID.getID(pattern);
-    if ((pCid == ClassID.cidOneByteString) ||
-        (pCid == ClassID.cidTwoByteString) ||
-        (pCid == ClassID.cidExternalOneByteString)) {
-      final String patternAsString = unsafeCast<String>(pattern);
-      final len = this.length;
-      if ((patternAsString.length == 1) && (start >= 0) && (start < len)) {
-        final patternCu0 = patternAsString.codeUnitAt(0);
-        if (patternCu0 > 0xFF) {
-          return false;
-        }
-        for (int i = start; i < len; i++) {
-          if (this.codeUnitAt(i) == patternCu0) {
-            return true;
-          }
-        }
-        return false;
-      }
-    }
-    return super.contains(pattern, start);
-  }
-
-  String operator *(int times) {
-    if (times <= 0) return "";
-    if (times == 1) return this;
-    int length = this.length;
-    if (this.isEmpty) return this; // Don't clone empty string.
-    _OneByteString result = _OneByteString._allocate(length * times);
-    int index = 0;
-    for (int i = 0; i < times; i++) {
-      for (int j = 0; j < length; j++) {
-        result._setAt(index++, this.codeUnitAt(j));
-      }
-    }
-    return result;
-  }
-
-  String padLeft(int width, [String padding = ' ']) {
-    int padCid = ClassID.getID(padding);
-    if ((padCid != ClassID.cidOneByteString) &&
-        (padCid != ClassID.cidExternalOneByteString)) {
-      return super.padLeft(width, padding);
-    }
-    int length = this.length;
-    int delta = width - length;
-    if (delta <= 0) return this;
-    int padLength = padding.length;
-    int resultLength = padLength * delta + length;
-    _OneByteString result = _OneByteString._allocate(resultLength);
-    int index = 0;
-    if (padLength == 1) {
-      int padChar = padding.codeUnitAt(0);
-      for (int i = 0; i < delta; i++) {
-        result._setAt(index++, padChar);
-      }
-    } else {
-      for (int i = 0; i < delta; i++) {
-        for (int j = 0; j < padLength; j++) {
-          result._setAt(index++, padding.codeUnitAt(j));
-        }
-      }
-    }
-    for (int i = 0; i < length; i++) {
-      result._setAt(index++, this.codeUnitAt(i));
-    }
-    return result;
-  }
-
-  String padRight(int width, [String padding = ' ']) {
-    int padCid = ClassID.getID(padding);
-    if ((padCid != ClassID.cidOneByteString) &&
-        (padCid != ClassID.cidExternalOneByteString)) {
-      return super.padRight(width, padding);
-    }
-    int length = this.length;
-    int delta = width - length;
-    if (delta <= 0) return this;
-    int padLength = padding.length;
-    int resultLength = length + padLength * delta;
-    _OneByteString result = _OneByteString._allocate(resultLength);
-    int index = 0;
-    for (int i = 0; i < length; i++) {
-      result._setAt(index++, this.codeUnitAt(i));
-    }
-    if (padLength == 1) {
-      int padChar = padding.codeUnitAt(0);
-      for (int i = 0; i < delta; i++) {
-        result._setAt(index++, padChar);
-      }
-    } else {
-      for (int i = 0; i < delta; i++) {
-        for (int j = 0; j < padLength; j++) {
-          result._setAt(index++, padding.codeUnitAt(j));
-        }
-      }
-    }
-    return result;
-  }
-
-  // Lower-case conversion table for Latin-1 as string.
-  // Upper-case ranges: 0x41-0x5a ('A' - 'Z'), 0xc0-0xd6, 0xd8-0xde.
-  // Conversion to lower case performed by adding 0x20.
-  static const _LC_TABLE =
-      "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-      "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
-      "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-      "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-      "\x40\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
-      "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x5b\x5c\x5d\x5e\x5f"
-      "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
-      "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
-      "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-      "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-      "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
-      "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-      "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-      "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xd7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf"
-      "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-      "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
-
-  // Upper-case conversion table for Latin-1 as string.
-  // Lower-case ranges: 0x61-0x7a ('a' - 'z'), 0xe0-0xff.
-  // The characters 0xb5 (µ) and 0xff (ÿ) have upper case variants
-  // that are not Latin-1. These are both marked as 0x00 in the table.
-  // The German "sharp s" \xdf (ß) should be converted into two characters (SS),
-  // and is also marked with 0x00.
-  // Conversion to lower case performed by subtracting 0x20.
-  static const _UC_TABLE =
-      "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-      "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
-      "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-      "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-      "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-      "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
-      "\x60\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-      "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x7b\x7c\x7d\x7e\x7f"
-      "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-      "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-      "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
-      "\xb0\xb1\xb2\xb3\xb4\x00\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-      "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-      "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\x00"
-      "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-      "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xf7\xd8\xd9\xda\xdb\xdc\xdd\xde\x00";
-
-  String toLowerCase() {
-    for (int i = 0; i < this.length; i++) {
-      final c = this.codeUnitAt(i);
-      if (c == _LC_TABLE.codeUnitAt(c)) continue;
-      // Upper-case character found.
-      final result = _allocate(this.length);
-      for (int j = 0; j < i; j++) {
-        result._setAt(j, this.codeUnitAt(j));
-      }
-      for (int j = i; j < this.length; j++) {
-        result._setAt(j, _LC_TABLE.codeUnitAt(this.codeUnitAt(j)));
-      }
-      return result;
-    }
-    return this;
-  }
-
-  String toUpperCase() {
-    for (int i = 0; i < this.length; i++) {
-      final c = this.codeUnitAt(i);
-      // Continue loop if character is unchanged by upper-case conversion.
-      if (c == _UC_TABLE.codeUnitAt(c)) continue;
-
-      // Check rest of string for characters that do not convert to
-      // single-characters in the Latin-1 range.
-      for (int j = i; j < this.length; j++) {
-        final c = this.codeUnitAt(j);
-        if ((_UC_TABLE.codeUnitAt(c) == 0x00) && (c != 0x00)) {
-          // We use the 0x00 value for characters other than the null character,
-          // that don't convert to a single Latin-1 character when upper-cased.
-          // In that case, call the generic super-class method.
-          return super.toUpperCase();
-        }
-      }
-      // Some lower-case characters found, but all upper-case to single Latin-1
-      // characters.
-      final result = _allocate(this.length);
-      for (int j = 0; j < i; j++) {
-        result._setAt(j, this.codeUnitAt(j));
-      }
-      for (int j = i; j < this.length; j++) {
-        result._setAt(j, _UC_TABLE.codeUnitAt(this.codeUnitAt(j)));
-      }
-      return result;
-    }
-    return this;
-  }
-
-  // Allocates a string of given length, expecting its content to be
-  // set using _setAt.
-  @pragma("vm:exact-result-type", _OneByteString)
-  @pragma("vm:prefer-inline")
-  static _OneByteString _allocate(int length) {
-    return unsafeCast<_OneByteString>(allocateOneByteString(length));
-  }
-
-  static _OneByteString _allocateFromOneByteList(List<int> list, int start,
-      int end) native "OneByteString_allocateFromOneByteList";
-
-  // This is internal helper method. Code point value must be a valid
-  // Latin1 value (0..0xFF), index must be valid.
-  @pragma("vm:prefer-inline")
-  void _setAt(int index, int codePoint) {
-    writeIntoOneByteString(this, index, codePoint);
-  }
-
-  // Should be optimizable to a memory move.
-  // Accepts both _OneByteString and _ExternalOneByteString as argument.
-  // Returns index after last character written.
-  int _setRange(int index, String oneByteString, int start, int end) {
-    assert(oneByteString._isOneByte);
-    assert(0 <= start);
-    assert(start <= end);
-    assert(end <= oneByteString.length);
-    assert(0 <= index);
-    assert(index + (end - start) <= length);
-    for (int i = start; i < end; i++) {
-      _setAt(index, oneByteString.codeUnitAt(i));
-      index += 1;
-    }
-    return index;
-  }
-}
-
-@pragma("vm:entry-point")
-class _TwoByteString extends _StringBase {
-  factory _TwoByteString._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Allocates a string of given length, expecting its content to be
-  // set using _setAt.
-  @pragma("vm:exact-result-type", _TwoByteString)
-  @pragma("vm:prefer-inline")
-  static _TwoByteString _allocate(int length) {
-    return unsafeCast<_TwoByteString>(allocateTwoByteString(length));
-  }
-
-  static String _allocateFromTwoByteList(List<int> list, int start, int end)
-      native "TwoByteString_allocateFromTwoByteList";
-
-  // This is internal helper method. Code point value must be a valid
-  // UTF-16 value (0..0xFFFF), index must be valid.
-  @pragma("vm:prefer-inline")
-  void _setAt(int index, int codePoint) {
-    writeIntoTwoByteString(this, index, codePoint);
-  }
-
-  bool _isWhitespace(int codeUnit) {
-    return _StringBase._isTwoByteWhitespace(codeUnit);
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int codeUnitAt(int index) native "String_codeUnitAt";
-
-  @pragma("vm:exact-result-type", bool)
-  bool operator ==(Object other) {
-    return super == other;
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalOneByteString extends _StringBase {
-  factory _ExternalOneByteString._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  bool _isWhitespace(int codeUnit) {
-    return _StringBase._isOneByteWhitespace(codeUnit);
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int codeUnitAt(int index) native "String_codeUnitAt";
-
-  bool operator ==(Object other) {
-    return super == other;
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalTwoByteString extends _StringBase {
-  factory _ExternalTwoByteString._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  bool _isWhitespace(int codeUnit) {
-    return _StringBase._isTwoByteWhitespace(codeUnit);
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int codeUnitAt(int index) native "String_codeUnitAt";
-
-  bool operator ==(Object other) {
-    return super == other;
-  }
-}
-
-class _StringMatch implements Match {
-  const _StringMatch(this.start, this.input, this.pattern);
-
-  int get end => start + pattern.length;
-  String operator [](int g) => group(g);
-  int get groupCount => 0;
-
-  String group(int group) {
-    if (group != 0) {
-      throw new RangeError.value(group);
-    }
-    return pattern;
-  }
-
-  List<String> groups(List<int> groups) {
-    List<String> result = <String>[];
-    for (int g in groups) {
-      result.add(group(g));
-    }
-    return result;
-  }
-
-  final int start;
-  final String input;
-  final String pattern;
-}
-
-class _StringAllMatchesIterable extends Iterable<Match> {
-  final String _input;
-  final String _pattern;
-  final int _index;
-
-  _StringAllMatchesIterable(this._input, this._pattern, this._index);
-
-  Iterator<Match> get iterator =>
-      new _StringAllMatchesIterator(_input, _pattern, _index);
-
-  Match get first {
-    int index = _input.indexOf(_pattern, _index);
-    if (index >= 0) {
-      return new _StringMatch(index, _input, _pattern);
-    }
-    throw IterableElementError.noElement();
-  }
-}
-
-class _StringAllMatchesIterator implements Iterator<Match> {
-  final String _input;
-  final String _pattern;
-  int _index;
-  Match? _current;
-
-  _StringAllMatchesIterator(this._input, this._pattern, this._index);
-
-  bool moveNext() {
-    if (_index + _pattern.length > _input.length) {
-      _current = null;
-      return false;
-    }
-    var index = _input.indexOf(_pattern, _index);
-    if (index < 0) {
-      _index = _input.length + 1;
-      _current = null;
-      return false;
-    }
-    int end = index + _pattern.length;
-    _current = new _StringMatch(index, _input, _pattern);
-    // Empty match, don't start at same location again.
-    if (end == _index) end++;
-    _index = end;
-    return true;
-  }
-
-  Match get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as Match;
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/symbol_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/symbol_patch.dart
deleted file mode 100644
index 06eb588..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/symbol_patch.dart
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "internal_patch.dart";
-
-@patch
-class Symbol {
-  @patch
-  const Symbol(String name) : this._name = name;
-
-  @patch
-  String toString() => 'Symbol("${computeUnmangledName(this)}")';
-
-  @patch
-  static String computeUnmangledName(Symbol symbol) {
-    String string = Symbol.getName(symbol);
-
-    // get:foo -> foo
-    // set:foo -> foo=
-    // get:_foo@xxx -> _foo
-    // set:_foo@xxx -> _foo=
-    // Class._constructor@xxx -> Class._constructor
-    // _Class@xxx._constructor@xxx -> _Class._constructor
-    // lib._S@xxx with lib._M1@xxx, lib._M2@xxx -> lib._S with lib._M1, lib._M2
-    StringBuffer result = new StringBuffer();
-    bool add_setter_suffix = false;
-    var pos = 0;
-    if (string.length >= 4 && string[3] == ':') {
-      // Drop 'get:' or 'set:' prefix.
-      pos = 4;
-      if (string[0] == 's') {
-        add_setter_suffix = true;
-      }
-    }
-    // Skip everything between AT and PERIOD, SPACE, COMMA or END
-    bool skip = false;
-    for (; pos < string.length; pos++) {
-      var char = string[pos];
-      if (char == '@') {
-        skip = true;
-      } else if (char == '.' || char == ' ' || char == ',') {
-        skip = false;
-      }
-      if (!skip) {
-        result.write(char);
-      }
-    }
-    if (add_setter_suffix) {
-      result.write('=');
-    }
-    return result.toString();
-  }
-
-  @patch
-  int get hashCode {
-    const arbitraryPrime = 664597;
-    return 0x1fffffff & (arbitraryPrime * _name.hashCode);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/timeline.dart b/sdk_nnbd/lib/_internal/vm/lib/timeline.dart
deleted file mode 100644
index 5e8066b..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/timeline.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// part of "developer.dart";
-
-@patch
-bool _isDartStreamEnabled() native "Timeline_isDartStreamEnabled";
-
-@patch
-int _getTraceClock() native "Timeline_getTraceClock";
-
-@patch
-int _getNextAsyncId() native "Timeline_getNextAsyncId";
-
-@patch
-void _reportTaskEvent(int taskId, String phase, String category, String name,
-    String argumentsAsJson) native "Timeline_reportTaskEvent";
-
-@patch
-void _reportFlowEvent(String category, String name, int type, int id,
-    String argumentsAsJson) native "Timeline_reportFlowEvent";
-
-@patch
-void _reportInstantEvent(String category, String name, String argumentsAsJson)
-    native "Timeline_reportInstantEvent";
diff --git a/sdk_nnbd/lib/_internal/vm/lib/timer_impl.dart b/sdk_nnbd/lib/_internal/vm/lib/timer_impl.dart
deleted file mode 100644
index db626c2..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/timer_impl.dart
+++ /dev/null
@@ -1,486 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "isolate_patch.dart";
-
-// Timer heap implemented as a array-based binary heap[0].
-// This allows for O(1) `first`, O(log(n)) `remove`/`removeFirst` and O(log(n))
-// `add`.
-//
-// To ensure the timers are ordered by insertion time, the _Timer class has a
-// `_id` field set when added to the heap.
-//
-// [0] http://en.wikipedia.org/wiki/Binary_heap
-class _TimerHeap {
-  List<_Timer> _list;
-  int _used = 0;
-
-  _TimerHeap([int initSize = 7])
-      : _list = List<_Timer>.filled(initSize, _Timer._sentinelTimer);
-
-  bool get isEmpty => _used == 0;
-
-  _Timer get first => _list[0];
-
-  bool isFirst(_Timer timer) => timer._indexOrNext == 0;
-
-  void add(_Timer timer) {
-    if (_used == _list.length) {
-      _resize();
-    }
-    timer._indexOrNext = _used++;
-    _list[timer._indexOrNext] = timer;
-    _bubbleUp(timer);
-  }
-
-  _Timer removeFirst() {
-    var f = first;
-    remove(f);
-    return f;
-  }
-
-  void remove(_Timer timer) {
-    _used--;
-    if (isEmpty) {
-      _list[0] = _Timer._sentinelTimer;
-      timer._indexOrNext = null;
-      return;
-    }
-    var last = _list[_used];
-    if (!identical(last, timer)) {
-      last._indexOrNext = timer._indexOrNext;
-      _list[last._indexOrNext] = last;
-      if (last._compareTo(timer) < 0) {
-        _bubbleUp(last);
-      } else {
-        _bubbleDown(last);
-      }
-    }
-    _list[_used] = _Timer._sentinelTimer;
-    timer._indexOrNext = null;
-  }
-
-  void _resize() {
-    var newList =
-        List<_Timer>.filled(_list.length * 2 + 1, _Timer._sentinelTimer);
-    newList.setRange(0, _used, _list);
-    _list = newList;
-  }
-
-  void _bubbleUp(_Timer timer) {
-    while (!isFirst(timer)) {
-      _Timer parent = _parent(timer);
-      if (timer._compareTo(parent) < 0) {
-        _swap(timer, parent);
-      } else {
-        break;
-      }
-    }
-  }
-
-  void _bubbleDown(_Timer timer) {
-    while (true) {
-      int leftIndex = _leftChildIndex(timer._indexOrNext);
-      int rightIndex = _rightChildIndex(timer._indexOrNext);
-      _Timer newest = timer;
-      if (leftIndex < _used && _list[leftIndex]._compareTo(newest) < 0) {
-        newest = _list[leftIndex];
-      }
-      if (rightIndex < _used && _list[rightIndex]._compareTo(newest) < 0) {
-        newest = _list[rightIndex];
-      }
-      if (identical(newest, timer)) {
-        // We are where we should be, break.
-        break;
-      }
-      _swap(newest, timer);
-    }
-  }
-
-  void _swap(_Timer first, _Timer second) {
-    int tmp = first._indexOrNext;
-    first._indexOrNext = second._indexOrNext;
-    second._indexOrNext = tmp;
-    _list[first._indexOrNext] = first;
-    _list[second._indexOrNext] = second;
-  }
-
-  _Timer _parent(_Timer timer) => _list[_parentIndex(timer._indexOrNext)];
-
-  static int _parentIndex(int index) => (index - 1) ~/ 2;
-  static int _leftChildIndex(int index) => 2 * index + 1;
-  static int _rightChildIndex(int index) => 2 * index + 2;
-}
-
-class _Timer implements Timer {
-  // Cancels the timer in the event handler.
-  static const _NO_TIMER = -1;
-
-  // A generic null timer object that is used to populate unused slots
-  // in TimerHeap.
-  static final _sentinelTimer = _Timer._sentinel();
-
-  // We distinguish what kind of message arrived based on the value being sent.
-  static const _ZERO_EVENT = 1;
-  static const _TIMEOUT_EVENT = null;
-
-  // Timers are ordered by wakeup time. Timers with a timeout value of > 0 do
-  // end up on the TimerHeap. Timers with a timeout of 0 are queued in a list.
-  static final _heap = new _TimerHeap();
-  static _Timer? _firstZeroTimer;
-  static _Timer _lastZeroTimer = _sentinelTimer;
-
-  // We use an id to be able to sort timers with the same expiration time.
-  // ids are recycled after ID_MASK enqueues or when the timer queue is empty.
-  static const _ID_MASK = 0x1fffffff;
-  static int _idCount = 0;
-
-  static RawReceivePort? _receivePort;
-  static SendPort? _sendPort;
-  static int _scheduledWakeupTime = 0;
-
-  static bool _handlingCallbacks = false;
-
-  Function? _callback; // Closure to call when timer fires. null if canceled.
-  int _wakeupTime; // Expiration time.
-  final int _milliSeconds; // Duration specified at creation.
-  final bool _repeating; // Indicates periodic timers.
-  var _indexOrNext; // Index if part of the TimerHeap, link otherwise.
-  int _id; // Incrementing id to enable sorting of timers with same expiry.
-
-  int _tick = 0; // Backing for [tick],
-
-  // Get the next available id. We accept collisions and reordering when the
-  // _idCount overflows and the timers expire at the same millisecond.
-  static int _nextId() {
-    var result = _idCount;
-    _idCount = (_idCount + 1) & _ID_MASK;
-    return result;
-  }
-
-  _Timer._sentinel()
-      : _callback = null,
-        _wakeupTime = 0,
-        _milliSeconds = 0,
-        _repeating = false,
-        _indexOrNext = null,
-        _id = -1;
-
-  _Timer._internal(
-      this._callback, this._wakeupTime, this._milliSeconds, this._repeating)
-      : _id = _nextId();
-
-  static _Timer _createTimer(
-      void callback(Timer timer), int milliSeconds, bool repeating) {
-    // Negative timeouts are treated as if 0 timeout.
-    if (milliSeconds < 0) {
-      milliSeconds = 0;
-    }
-    // Add one because DateTime.now() is assumed to round down
-    // to nearest millisecond, not up, so that time + duration is before
-    // duration milliseconds from now. Using microsecond timers like
-    // Stopwatch allows detecting that the timer fires early.
-    int now = VMLibraryHooks.timerMillisecondClock();
-    int wakeupTime = (milliSeconds == 0) ? now : (now + 1 + milliSeconds);
-
-    _Timer timer =
-        new _Timer._internal(callback, wakeupTime, milliSeconds, repeating);
-    // Enqueue this newly created timer in the appropriate structure and
-    // notify if necessary.
-    timer._enqueue();
-    return timer;
-  }
-
-  factory _Timer(int milliSeconds, void callback(Timer timer)) {
-    return _createTimer(callback, milliSeconds, false);
-  }
-
-  factory _Timer.periodic(int milliSeconds, void callback(Timer timer)) {
-    return _createTimer(callback, milliSeconds, true);
-  }
-
-  bool get _isInHeap => _indexOrNext is int;
-
-  int _compareTo(_Timer other) {
-    int c = _wakeupTime - other._wakeupTime;
-    if (c != 0) return c;
-    return _id - other._id;
-  }
-
-  bool get isActive => _callback != null;
-
-  int get tick => _tick;
-
-  // Cancels a set timer. The timer is removed from the timer heap if it is a
-  // non-zero timer. Zero timers are kept in the list as they need to consume
-  // the corresponding pending message.
-  void cancel() {
-    _callback = null;
-    // Only heap timers are really removed. Zero timers need to consume their
-    // corresponding wakeup message so they are left in the queue.
-    if (!_isInHeap) return;
-    bool update = _heap.isFirst(this);
-    _heap.remove(this);
-    if (update) {
-      _notifyEventHandler();
-    }
-  }
-
-  void _advanceWakeupTime() {
-    // Recalculate the next wakeup time. For repeating timers with a 0 timeout
-    // the next wakeup time is now.
-    _id = _nextId();
-    if (_milliSeconds > 0) {
-      _wakeupTime += _milliSeconds;
-    } else {
-      _wakeupTime = VMLibraryHooks.timerMillisecondClock();
-    }
-  }
-
-  // Adds a timer to the heap or timer list. Timers with the same wakeup time
-  // are enqueued in order and notified in FIFO order.
-  void _enqueue() {
-    if (_milliSeconds == 0) {
-      if (_firstZeroTimer == null) {
-        _lastZeroTimer = this;
-        _firstZeroTimer = this;
-      } else {
-        _lastZeroTimer._indexOrNext = this;
-        _lastZeroTimer = this;
-      }
-      // Every zero timer gets its own event.
-      _notifyZeroHandler();
-    } else {
-      _heap.add(this);
-      if (_heap.isFirst(this)) {
-        _notifyEventHandler();
-      }
-    }
-  }
-
-  // Enqueue one message for each zero timer. To be able to distinguish from
-  // EventHandler messages we send a _ZERO_EVENT instead of a _TIMEOUT_EVENT.
-  static void _notifyZeroHandler() {
-    var port = _sendPort;
-    if (port == null) {
-      port = _createTimerHandler();
-      _sendPort = port;
-    }
-    port.send(_ZERO_EVENT);
-  }
-
-  // Handle the notification of a zero timer. Make sure to also execute non-zero
-  // timers with a lower expiration time.
-  static List _queueFromZeroEvent() {
-    var pendingTimers = <dynamic>[];
-    final firstTimer = _firstZeroTimer;
-    if (firstTimer != null) {
-      // Collect pending timers from the timer heap that have an expiration prior
-      // to the currently notified zero timer.
-      var timer;
-      while (!_heap.isEmpty && (_heap.first._compareTo(firstTimer) < 0)) {
-        timer = _heap.removeFirst();
-        pendingTimers.add(timer);
-      }
-      // Append the first zero timer to the pending timers.
-      timer = _firstZeroTimer;
-      _firstZeroTimer = timer._indexOrNext;
-      timer._indexOrNext = null;
-      pendingTimers.add(timer);
-    }
-    return pendingTimers;
-  }
-
-  static void _notifyEventHandler() {
-    if (_handlingCallbacks) {
-      // While we are already handling callbacks we will not notify the event
-      // handler. _handleTimeout will call _notifyEventHandler once all pending
-      // timers are processed.
-      return;
-    }
-
-    // If there are no pending timers. Close down the receive port.
-    if ((_firstZeroTimer == null) && _heap.isEmpty) {
-      // No pending timers: Close the receive port and let the event handler
-      // know.
-      if (_sendPort != null) {
-        _cancelWakeup();
-        _shutdownTimerHandler();
-      }
-      return;
-    } else if (_heap.isEmpty) {
-      // Only zero timers are left. Cancel any scheduled wakeups.
-      _cancelWakeup();
-      return;
-    }
-
-    // Only send a message if the requested wakeup time differs from the
-    // already scheduled wakeup time.
-    var wakeupTime = _heap.first._wakeupTime;
-    if ((_scheduledWakeupTime == 0) || (wakeupTime != _scheduledWakeupTime)) {
-      _scheduleWakeup(wakeupTime);
-    }
-  }
-
-  static List _queueFromTimeoutEvent() {
-    var pendingTimers = [];
-    final firstTimer = _firstZeroTimer;
-    if (firstTimer != null) {
-      // Collect pending timers from the timer heap that have an expiration
-      // prior to the next zero timer.
-      // By definition the first zero timer has been scheduled before the
-      // current time, meaning all timers which are "less than" the first zero
-      // timer are expired. The first zero timer will be dispatched when its
-      // corresponding message is delivered.
-      var timer;
-      while (!_heap.isEmpty && (_heap.first._compareTo(firstTimer) < 0)) {
-        timer = _heap.removeFirst();
-        pendingTimers.add(timer);
-      }
-    } else {
-      // Collect pending timers from the timer heap which have expired at this
-      // time.
-      var currentTime = VMLibraryHooks.timerMillisecondClock();
-      var timer;
-      while (!_heap.isEmpty && (_heap.first._wakeupTime <= currentTime)) {
-        timer = _heap.removeFirst();
-        pendingTimers.add(timer);
-      }
-    }
-    return pendingTimers;
-  }
-
-  static void _runTimers(List pendingTimers) {
-    // If there are no pending timers currently reset the id space before we
-    // have a chance to enqueue new timers.
-    if (_heap.isEmpty && (_firstZeroTimer == null)) {
-      _idCount = 0;
-    }
-
-    // Fast exit if no pending timers.
-    if (pendingTimers.length == 0) {
-      return;
-    }
-
-    // Trigger all of the pending timers. New timers added as part of the
-    // callbacks will be enqueued now and notified in the next spin at the
-    // earliest.
-    _handlingCallbacks = true;
-    var i = 0;
-    try {
-      for (; i < pendingTimers.length; i++) {
-        // Next pending timer.
-        var timer = pendingTimers[i];
-        timer._indexOrNext = null;
-
-        // One of the timers in the pending_timers list can cancel
-        // one of the later timers which will set the callback to
-        // null. Or the pending zero timer has been canceled earlier.
-        if (timer._callback != null) {
-          var callback = timer._callback;
-          if (!timer._repeating) {
-            // Mark timer as inactive.
-            timer._callback = null;
-          } else if (timer._milliSeconds > 0) {
-            var ms = timer._milliSeconds;
-            int overdue =
-                VMLibraryHooks.timerMillisecondClock() - timer._wakeupTime;
-            if (overdue > ms) {
-              int missedTicks = overdue ~/ ms;
-              timer._wakeupTime += missedTicks * ms;
-              timer._tick += missedTicks;
-            }
-          }
-          timer._tick += 1;
-
-          callback(timer);
-          // Re-insert repeating timer if not canceled.
-          if (timer._repeating && (timer._callback != null)) {
-            timer._advanceWakeupTime();
-            timer._enqueue();
-          }
-          // Execute pending micro tasks.
-          _runPendingImmediateCallback();
-        }
-      }
-    } finally {
-      _handlingCallbacks = false;
-      // Re-queue timers we didn't get to.
-      for (i++; i < pendingTimers.length; i++) {
-        var timer = pendingTimers[i];
-        timer._enqueue();
-      }
-      _notifyEventHandler();
-    }
-  }
-
-  static void _handleMessage(msg) {
-    var pendingTimers;
-    if (msg == _ZERO_EVENT) {
-      pendingTimers = _queueFromZeroEvent();
-      assert(pendingTimers.length > 0);
-    } else {
-      assert(msg == _TIMEOUT_EVENT);
-      _scheduledWakeupTime = 0; // Consumed the last scheduled wakeup now.
-      pendingTimers = _queueFromTimeoutEvent();
-    }
-    _runTimers(pendingTimers);
-    // Notify the event handler or shutdown the port if no more pending
-    // timers are present.
-    _notifyEventHandler();
-  }
-
-  // Tell the event handler to wake this isolate at a specific time.
-  static void _scheduleWakeup(int wakeupTime) {
-    var port = _sendPort;
-    if (port == null) {
-      port = _createTimerHandler();
-      _sendPort = port;
-    }
-    VMLibraryHooks.eventHandlerSendData(null, port, wakeupTime);
-    _scheduledWakeupTime = wakeupTime;
-  }
-
-  // Cancel pending wakeups in the event handler.
-  static void _cancelWakeup() {
-    if (_sendPort != null) {
-      VMLibraryHooks.eventHandlerSendData(null, _sendPort, _NO_TIMER);
-      _scheduledWakeupTime = 0;
-    }
-  }
-
-  // Create a receive port and register a message handler for the timer
-  // events.
-  static SendPort _createTimerHandler() {
-    assert(_receivePort == null);
-    assert(_sendPort == null);
-    final port = new RawReceivePort(_handleMessage);
-    final sendPort = port.sendPort;
-    _receivePort = port;
-    _sendPort = sendPort;
-    _scheduledWakeupTime = 0;
-    return sendPort;
-  }
-
-  static void _shutdownTimerHandler() {
-    _sendPort = null;
-    _scheduledWakeupTime = 0;
-    _receivePort!.close();
-    _receivePort = null;
-  }
-
-  // The Timer factory registered with the dart:async library by the embedder.
-  static Timer _factory(
-      int milliSeconds, void callback(Timer timer), bool repeating) {
-    if (repeating) {
-      return new _Timer.periodic(milliSeconds, callback);
-    }
-    return new _Timer(milliSeconds, callback);
-  }
-}
-
-@pragma("vm:entry-point", "call")
-_setupHooks() {
-  VMLibraryHooks.timerFactory = _Timer._factory;
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/timer_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/timer_patch.dart
deleted file mode 100644
index 5e8b987..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/timer_patch.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "async_patch.dart";
-
-@patch
-class Timer {
-  @patch
-  static Timer _createTimer(Duration duration, void callback()) {
-    final factory = VMLibraryHooks.timerFactory;
-    if (factory == null) {
-      throw new UnsupportedError("Timer interface not supported.");
-    }
-    int milliseconds = duration.inMilliseconds;
-    if (milliseconds < 0) milliseconds = 0;
-    return factory(milliseconds, (_) {
-      callback();
-    }, false);
-  }
-
-  @patch
-  static Timer _createPeriodicTimer(
-      Duration duration, void callback(Timer timer)) {
-    final factory = VMLibraryHooks.timerFactory;
-    if (factory == null) {
-      throw new UnsupportedError("Timer interface not supported.");
-    }
-    int milliseconds = duration.inMilliseconds;
-    if (milliseconds < 0) milliseconds = 0;
-    return factory(milliseconds, callback, true);
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/type_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/type_patch.dart
deleted file mode 100644
index 1b8f3c1..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/type_patch.dart
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-// These Dart classes correspond to the VM internal implementation classes.
-
-// Equivalent of RawAbstractType.
-abstract class _AbstractType implements Type {
-  String toString() native "AbstractType_toString";
-}
-
-// Equivalent of RawType.
-@pragma("vm:entry-point")
-class _Type extends _AbstractType {
-  factory _Type._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int get hashCode native "Type_getHashCode";
-
-  @pragma("vm:exact-result-type", bool)
-  bool operator ==(other) native "Type_equality";
-}
-
-// Equivalent of RawTypeRef.
-@pragma("vm:entry-point")
-class _TypeRef extends _AbstractType {
-  factory _TypeRef._uninstantiable() {
-    throw "Unreachable";
-  }
-}
-
-// Equivalent of RawTypeParameter.
-@pragma("vm:entry-point")
-class _TypeParameter extends _AbstractType {
-  factory _TypeParameter._uninstantiable() {
-    throw "Unreachable";
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/typed_data_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/typed_data_patch.dart
deleted file mode 100644
index 6d0cc5a..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/typed_data_patch.dart
+++ /dev/null
@@ -1,4816 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Note: the VM concatenates all patch files into a single patch file. This
-/// file is the first patch in "dart:typed_data" which contains all the imports
-/// used by patches of that library. We plan to change this when we have a
-/// shared front end and simply use parts.
-
-import "dart:_internal"
-    show
-        ClassID,
-        CodeUnits,
-        ExpandIterable,
-        FollowedByIterable,
-        IterableElementError,
-        ListMapView,
-        Lists,
-        MappedIterable,
-        MappedIterable,
-        ReversedListIterable,
-        SkipWhileIterable,
-        Sort,
-        SubListIterable,
-        TakeWhileIterable,
-        WhereIterable,
-        WhereTypeIterable,
-        patch;
-
-import "dart:collection" show ListBase;
-
-import 'dart:math' show Random;
-
-/// There are no parts in patch library:
-
-@patch
-class ByteData implements TypedData {
-  @patch
-  @pragma("vm:entry-point")
-  factory ByteData(int length) {
-    final list = new Uint8List(length) as _TypedList;
-    _rangeCheck(list.lengthInBytes, 0, length);
-    return new _ByteDataView._(list, 0, length);
-  }
-
-  // Called directly from C code.
-  @pragma("vm:entry-point")
-  factory ByteData._view(_TypedList typedData, int offsetInBytes, int length) {
-    _rangeCheck(typedData.lengthInBytes, offsetInBytes, length);
-    return new _ByteDataView._(typedData, offsetInBytes, length);
-  }
-}
-
-// Based class for _TypedList that provides common methods for implementing
-// the collection and list interfaces.
-// This class does not extend ListBase<T> since that would add type arguments
-// to instances of _TypeListBase. Instead the subclasses use type specific
-// mixins (like _IntListMixin, _DoubleListMixin) to implement ListBase<T>.
-abstract class _TypedListBase {
-  int get length;
-  int get elementSizeInBytes;
-  int get offsetInBytes;
-  _ByteBuffer get buffer;
-
-  // Method(s) implementing the Collection interface.
-  String join([String separator = ""]) {
-    StringBuffer buffer = new StringBuffer();
-    buffer.writeAll(this as Iterable, separator);
-    return buffer.toString();
-  }
-
-  bool get isEmpty {
-    return this.length == 0;
-  }
-
-  bool get isNotEmpty => !isEmpty;
-
-  // Method(s) implementing the List interface.
-
-  set length(newLength) {
-    throw new UnsupportedError("Cannot resize a fixed-length list");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  bool remove(Object? element) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void replaceRange(int start, int end, Iterable iterable) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  // Method(s) implementing Object interface.
-  String toString() => ListBase.listToString(this as List);
-
-  // Internal utility methods.
-
-  // Returns true if operation succeeds.
-  // 'fromCid' and 'toCid' may be cid-s of the views and therefore may not
-  // match the cids of 'this' and 'from'.
-  // Uses toCid and fromCid to decide if clamping is necessary.
-  // Element size of toCid and fromCid must match (test at caller).
-  bool _setRange(int startInBytes, int lengthInBytes, _TypedListBase from,
-      int startFromInBytes, int toCid, int fromCid) native "TypedData_setRange";
-}
-
-mixin _IntListMixin implements List<int> {
-  int get elementSizeInBytes;
-  int get offsetInBytes;
-  _ByteBuffer get buffer;
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  Iterable<int> followedBy(Iterable<int> other) =>
-      new FollowedByIterable<int>.firstEfficient(this, other);
-
-  List<R> cast<R>() => List.castFrom<int, R>(this);
-  void set first(int value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[0] = value;
-  }
-
-  void set last(int value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[this.length - 1] = value;
-  }
-
-  int indexWhere(bool test(int element), [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(int element), [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  List<int> operator +(List<int> other) {
-    int totalLength = this.length + other.length;
-    return <int>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
-
-  bool contains(Object? element) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (this[i] == element) return true;
-    }
-    return false;
-  }
-
-  void shuffle([Random? random]) {
-    random ??= new Random();
-    var i = this.length;
-    while (i > 1) {
-      int pos = random.nextInt(i);
-      i -= 1;
-      var tmp = this[i];
-      this[i] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  Iterable<int> where(bool f(int element)) => new WhereIterable<int>(this, f);
-
-  Iterable<int> take(int n) => new SubListIterable<int>(this, 0, n);
-
-  Iterable<int> takeWhile(bool test(int element)) =>
-      new TakeWhileIterable<int>(this, test);
-
-  Iterable<int> skip(int n) => new SubListIterable<int>(this, n, null);
-
-  Iterable<int> skipWhile(bool test(int element)) =>
-      new SkipWhileIterable<int>(this, test);
-
-  Iterable<int> get reversed => new ReversedListIterable<int>(this);
-
-  Map<int, int> asMap() => new ListMapView<int>(this);
-
-  Iterable<int> getRange(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<int>(this, start, endIndex);
-  }
-
-  Iterator<int> get iterator => new _TypedListIterator<int>(this);
-
-  List<int> toList({bool growable: true}) {
-    return new List<int>.from(this, growable: growable);
-  }
-
-  Set<int> toSet() {
-    return new Set<int>.from(this);
-  }
-
-  void forEach(void f(int element)) {
-    var len = this.length;
-    for (var i = 0; i < len; i++) {
-      f(this[i]);
-    }
-  }
-
-  int reduce(int combine(int value, int element)) {
-    var len = this.length;
-    if (len == 0) throw IterableElementError.noElement();
-    var value = this[0];
-    for (var i = 1; i < len; ++i) {
-      value = combine(value, this[i]);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T initialValue, int element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      initialValue = combine(initialValue, this[i]);
-    }
-    return initialValue;
-  }
-
-  Iterable<T> map<T>(T f(int element)) => new MappedIterable<int, T>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(int element)) =>
-      new ExpandIterable<int, T>(this, f);
-
-  bool every(bool f(int element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (!f(this[i])) return false;
-    }
-    return true;
-  }
-
-  bool any(bool f(int element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (f(this[i])) return true;
-    }
-    return false;
-  }
-
-  int firstWhere(bool test(int element), {int orElse()?}) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  int lastWhere(bool test(int element), {int orElse()?}) {
-    var len = this.length;
-    for (var i = len - 1; i >= 0; --i) {
-      var element = this[i];
-      if (test(element)) {
-        return element;
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  int singleWhere(bool test(int element), {int orElse()?}) {
-    var result = null;
-    bool foundMatching = false;
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void addAll(Iterable<int> value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void insert(int index, int value) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void insertAll(int index, Iterable<int> values) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void sort([int compare(int a, int b)?]) {
-    Sort.sort(this, compare ?? Comparable.compare);
-  }
-
-  int indexOf(int element, [int start = 0]) {
-    if (start >= this.length) {
-      return -1;
-    } else if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < this.length; i++) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(int element, [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  int removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  int get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  int get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    final end = iterable.length + index;
-    setRange(index, end, iterable);
-  }
-
-  void fillRange(int start, int end, [int? fillValue]) {
-    RangeError.checkValidRange(start, end, this.length);
-    if (start == end) return;
-    if (fillValue == null) {
-      throw ArgumentError.notNull("fillValue");
-    }
-    for (var i = start; i < end; ++i) {
-      this[i] = fillValue;
-    }
-  }
-}
-
-mixin _TypedIntListMixin<SpawnedType extends List<int>> on _IntListMixin
-    implements List<int> {
-  SpawnedType _createList(int length);
-
-  void setRange(int start, int end, Iterable<int> from, [int skipCount = 0]) {
-    // Check ranges.
-    if (0 > start || start > end || end > length) {
-      RangeError.checkValidRange(start, end, length); // Always throws.
-      assert(false);
-    }
-    if (skipCount < 0) {
-      throw RangeError.range(skipCount, 0, null, "skipCount");
-    }
-
-    final count = end - start;
-    if ((from.length - skipCount) < count) {
-      throw IterableElementError.tooFew();
-    }
-
-    if (count == 0) return;
-
-    if (from is _TypedListBase) {
-      // Note: _TypedListBase is not related to Iterable<int> so there is
-      // no promotion here.
-      final fromAsTypedList = from as _TypedListBase;
-      if (this.elementSizeInBytes == fromAsTypedList.elementSizeInBytes) {
-        if ((count < 10) && (fromAsTypedList.buffer != this.buffer)) {
-          Lists.copy(from as List<int>, skipCount, this, start, count);
-          return;
-        } else if (this.buffer._data._setRange(
-            start * elementSizeInBytes + this.offsetInBytes,
-            count * elementSizeInBytes,
-            fromAsTypedList.buffer._data,
-            skipCount * elementSizeInBytes + fromAsTypedList.offsetInBytes,
-            ClassID.getID(this),
-            ClassID.getID(from))) {
-          return;
-        }
-      } else if (fromAsTypedList.buffer == this.buffer) {
-        // Different element sizes, but same buffer means that we need
-        // an intermediate structure.
-        // TODO(srdjan): Optimize to skip copying if the range does not overlap.
-        final fromAsList = from as List<int>;
-        final tempBuffer = _createList(count);
-        for (var i = 0; i < count; i++) {
-          tempBuffer[i] = fromAsList[skipCount + i];
-        }
-        for (var i = start; i < end; i++) {
-          this[i] = tempBuffer[i - start];
-        }
-        return;
-      }
-    }
-
-    List otherList;
-    int otherStart;
-    if (from is List<int>) {
-      otherList = from;
-      otherStart = skipCount;
-    } else {
-      otherList = from.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + count > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    Lists.copy(otherList, otherStart, this, start, count);
-  }
-
-  SpawnedType sublist(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    var length = endIndex - start;
-    SpawnedType result = _createList(length);
-    result.setRange(0, length, this, start);
-    return result;
-  }
-}
-
-mixin _DoubleListMixin implements List<double> {
-  int get elementSizeInBytes;
-  int get offsetInBytes;
-  _ByteBuffer get buffer;
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  Iterable<double> followedBy(Iterable<double> other) =>
-      new FollowedByIterable<double>.firstEfficient(this, other);
-
-  List<R> cast<R>() => List.castFrom<double, R>(this);
-  void set first(double value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[0] = value;
-  }
-
-  void set last(double value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[this.length - 1] = value;
-  }
-
-  int indexWhere(bool test(double element), [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(double element), [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  List<double> operator +(List<double> other) {
-    int totalLength = this.length + other.length;
-    return <double>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
-
-  bool contains(Object? element) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (this[i] == element) return true;
-    }
-    return false;
-  }
-
-  void shuffle([Random? random]) {
-    random ??= new Random();
-    var i = this.length;
-    while (i > 1) {
-      int pos = random.nextInt(i);
-      i -= 1;
-      var tmp = this[i];
-      this[i] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  Iterable<double> where(bool f(double element)) =>
-      new WhereIterable<double>(this, f);
-
-  Iterable<double> take(int n) => new SubListIterable<double>(this, 0, n);
-
-  Iterable<double> takeWhile(bool test(double element)) =>
-      new TakeWhileIterable<double>(this, test);
-
-  Iterable<double> skip(int n) => new SubListIterable<double>(this, n, null);
-
-  Iterable<double> skipWhile(bool test(double element)) =>
-      new SkipWhileIterable<double>(this, test);
-
-  Iterable<double> get reversed => new ReversedListIterable<double>(this);
-
-  Map<int, double> asMap() => new ListMapView<double>(this);
-
-  Iterable<double> getRange(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<double>(this, start, endIndex);
-  }
-
-  Iterator<double> get iterator => new _TypedListIterator<double>(this);
-
-  List<double> toList({bool growable: true}) {
-    return new List<double>.from(this, growable: growable);
-  }
-
-  Set<double> toSet() {
-    return new Set<double>.from(this);
-  }
-
-  void forEach(void f(double element)) {
-    var len = this.length;
-    for (var i = 0; i < len; i++) {
-      f(this[i]);
-    }
-  }
-
-  double reduce(double combine(double value, double element)) {
-    var len = this.length;
-    if (len == 0) throw IterableElementError.noElement();
-    var value = this[0];
-    for (var i = 1; i < len; ++i) {
-      value = combine(value, this[i]);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T initialValue, double element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      initialValue = combine(initialValue, this[i]);
-    }
-    return initialValue;
-  }
-
-  Iterable<T> map<T>(T f(double element)) =>
-      new MappedIterable<double, T>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(double element)) =>
-      new ExpandIterable<double, T>(this, f);
-
-  bool every(bool f(double element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (!f(this[i])) return false;
-    }
-    return true;
-  }
-
-  bool any(bool f(double element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (f(this[i])) return true;
-    }
-    return false;
-  }
-
-  double firstWhere(bool test(double element), {double orElse()?}) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  double lastWhere(bool test(double element), {double orElse()?}) {
-    var len = this.length;
-    for (var i = len - 1; i >= 0; --i) {
-      var element = this[i];
-      if (test(element)) {
-        return element;
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  double singleWhere(bool test(double element), {double orElse()?}) {
-    var result = null;
-    bool foundMatching = false;
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  double elementAt(int index) {
-    return this[index];
-  }
-
-  void add(double value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void addAll(Iterable<double> value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void insert(int index, double value) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void insertAll(int index, Iterable<double> values) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void sort([int compare(double a, double b)?]) {
-    Sort.sort(this, compare ?? Comparable.compare);
-  }
-
-  int indexOf(double element, [int start = 0]) {
-    if (start >= this.length) {
-      return -1;
-    } else if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < this.length; i++) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(double element, [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  double removeLast() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  double removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void removeWhere(bool test(double element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void retainWhere(bool test(double element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  double get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  double get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  double get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  void setAll(int index, Iterable<double> iterable) {
-    final end = iterable.length + index;
-    setRange(index, end, iterable);
-  }
-
-  void fillRange(int start, int end, [double? fillValue]) {
-    // TODO(eernst): Could use zero as default and not throw; issue .
-    RangeError.checkValidRange(start, end, this.length);
-    if (start == end) return;
-    if (fillValue == null) {
-      throw ArgumentError.notNull("fillValue");
-    }
-    for (var i = start; i < end; ++i) {
-      this[i] = fillValue;
-    }
-  }
-}
-
-mixin _TypedDoubleListMixin<SpawnedType extends List<double>>
-    on _DoubleListMixin implements List<double> {
-  SpawnedType _createList(int length);
-
-  void setRange(int start, int end, Iterable<double> from,
-      [int skipCount = 0]) {
-    // Check ranges.
-    if (0 > start || start > end || end > length) {
-      RangeError.checkValidRange(start, end, length); // Always throws.
-      assert(false);
-    }
-    if (skipCount < 0) {
-      throw RangeError.range(skipCount, 0, null, "skipCount");
-    }
-
-    final count = end - start;
-    if ((from.length - skipCount) < count) {
-      throw IterableElementError.tooFew();
-    }
-
-    if (count == 0) return;
-
-    if (from is _TypedListBase) {
-      // Note: _TypedListBase is not related to Iterable<double> so there is
-      // no promotion here.
-      final fromAsTypedList = from as _TypedListBase;
-      if (this.elementSizeInBytes == fromAsTypedList.elementSizeInBytes) {
-        if ((count < 10) && (fromAsTypedList.buffer != this.buffer)) {
-          Lists.copy(from as List<double>, skipCount, this, start, count);
-          return;
-        } else if (this.buffer._data._setRange(
-            start * elementSizeInBytes + this.offsetInBytes,
-            count * elementSizeInBytes,
-            fromAsTypedList.buffer._data,
-            skipCount * elementSizeInBytes + fromAsTypedList.offsetInBytes,
-            ClassID.getID(this),
-            ClassID.getID(from))) {
-          return;
-        }
-      } else if (fromAsTypedList.buffer == this.buffer) {
-        // Different element sizes, but same buffer means that we need
-        // an intermediate structure.
-        // TODO(srdjan): Optimize to skip copying if the range does not overlap.
-        final fromAsList = from as List<double>;
-        final tempBuffer = _createList(count);
-        for (var i = 0; i < count; i++) {
-          tempBuffer[i] = fromAsList[skipCount + i];
-        }
-        for (var i = start; i < end; i++) {
-          this[i] = tempBuffer[i - start];
-        }
-        return;
-      }
-    }
-
-    List otherList;
-    int otherStart;
-    if (from is List<double>) {
-      otherList = from;
-      otherStart = skipCount;
-    } else {
-      otherList = from.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + count > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    Lists.copy(otherList, otherStart, this, start, count);
-  }
-
-  SpawnedType sublist(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    var length = endIndex - start;
-    SpawnedType result = _createList(length);
-    result.setRange(0, length, this, start);
-    return result;
-  }
-}
-
-abstract class _Float32x4ListMixin implements List<Float32x4> {
-  int get elementSizeInBytes;
-  int get offsetInBytes;
-  _ByteBuffer get buffer;
-
-  Float32x4List _createList(int length);
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  Iterable<Float32x4> followedBy(Iterable<Float32x4> other) =>
-      new FollowedByIterable<Float32x4>.firstEfficient(this, other);
-
-  List<R> cast<R>() => List.castFrom<Float32x4, R>(this);
-  void set first(Float32x4 value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[0] = value;
-  }
-
-  void set last(Float32x4 value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[this.length - 1] = value;
-  }
-
-  int indexWhere(bool test(Float32x4 element), [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(Float32x4 element), [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  List<Float32x4> operator +(List<Float32x4> other) {
-    int totalLength = this.length + other.length;
-    return <Float32x4>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
-
-  bool contains(Object? element) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (this[i] == element) return true;
-    }
-    return false;
-  }
-
-  void shuffle([Random? random]) {
-    random ??= new Random();
-    var i = this.length;
-    while (i > 1) {
-      int pos = random.nextInt(i);
-      i -= 1;
-      var tmp = this[i];
-      this[i] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  void setRange(int start, int end, Iterable<Float32x4> from,
-      [int skipCount = 0]) {
-    // Check ranges.
-    if (0 > start || start > end || end > length) {
-      RangeError.checkValidRange(start, end, length); // Always throws.
-      assert(false);
-    }
-    if (skipCount < 0) {
-      throw RangeError.range(skipCount, 0, null, "skipCount");
-    }
-
-    final count = end - start;
-    if ((from.length - skipCount) < count) {
-      throw IterableElementError.tooFew();
-    }
-
-    if (count == 0) return;
-
-    if (from is _TypedListBase) {
-      // Note: _TypedListBase is not related to Iterable<Float32x4> so there is
-      // no promotion here.
-      final fromAsTypedList = from as _TypedListBase;
-      if (this.elementSizeInBytes == fromAsTypedList.elementSizeInBytes) {
-        if ((count < 10) && (fromAsTypedList.buffer != this.buffer)) {
-          Lists.copy(from as List<Float32x4>, skipCount, this, start, count);
-          return;
-        } else if (this.buffer._data._setRange(
-            start * elementSizeInBytes + this.offsetInBytes,
-            count * elementSizeInBytes,
-            fromAsTypedList.buffer._data,
-            skipCount * elementSizeInBytes + fromAsTypedList.offsetInBytes,
-            ClassID.getID(this),
-            ClassID.getID(from))) {
-          return;
-        }
-      } else if (fromAsTypedList.buffer == this.buffer) {
-        // Different element sizes, but same buffer means that we need
-        // an intermediate structure.
-        // TODO(srdjan): Optimize to skip copying if the range does not overlap.
-        final fromAsList = from as List<Float32x4>;
-        final tempBuffer = _createList(count);
-        for (var i = 0; i < count; i++) {
-          tempBuffer[i] = fromAsList[skipCount + i];
-        }
-        for (var i = start; i < end; i++) {
-          this[i] = tempBuffer[i - start];
-        }
-        return;
-      }
-    }
-
-    List otherList;
-    int otherStart;
-    if (from is List<Float32x4>) {
-      otherList = from;
-      otherStart = skipCount;
-    } else {
-      otherList = from.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + count > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    Lists.copy(otherList, otherStart, this, start, count);
-  }
-
-  Iterable<Float32x4> where(bool f(Float32x4 element)) =>
-      new WhereIterable<Float32x4>(this, f);
-
-  Iterable<Float32x4> take(int n) => new SubListIterable<Float32x4>(this, 0, n);
-
-  Iterable<Float32x4> takeWhile(bool test(Float32x4 element)) =>
-      new TakeWhileIterable<Float32x4>(this, test);
-
-  Iterable<Float32x4> skip(int n) =>
-      new SubListIterable<Float32x4>(this, n, null);
-
-  Iterable<Float32x4> skipWhile(bool test(Float32x4 element)) =>
-      new SkipWhileIterable<Float32x4>(this, test);
-
-  Iterable<Float32x4> get reversed => new ReversedListIterable<Float32x4>(this);
-
-  Map<int, Float32x4> asMap() => new ListMapView<Float32x4>(this);
-
-  Iterable<Float32x4> getRange(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<Float32x4>(this, start, endIndex);
-  }
-
-  Iterator<Float32x4> get iterator => new _TypedListIterator<Float32x4>(this);
-
-  List<Float32x4> toList({bool growable: true}) {
-    return new List<Float32x4>.from(this, growable: growable);
-  }
-
-  Set<Float32x4> toSet() {
-    return new Set<Float32x4>.from(this);
-  }
-
-  void forEach(void f(Float32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; i++) {
-      f(this[i]);
-    }
-  }
-
-  Float32x4 reduce(Float32x4 combine(Float32x4 value, Float32x4 element)) {
-    var len = this.length;
-    if (len == 0) throw IterableElementError.noElement();
-    var value = this[0];
-    for (var i = 1; i < len; ++i) {
-      value = combine(value, this[i]);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T initialValue, Float32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      initialValue = combine(initialValue, this[i]);
-    }
-    return initialValue;
-  }
-
-  Iterable<T> map<T>(T f(Float32x4 element)) =>
-      new MappedIterable<Float32x4, T>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(Float32x4 element)) =>
-      new ExpandIterable<Float32x4, T>(this, f);
-
-  bool every(bool f(Float32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (!f(this[i])) return false;
-    }
-    return true;
-  }
-
-  bool any(bool f(Float32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (f(this[i])) return true;
-    }
-    return false;
-  }
-
-  Float32x4 firstWhere(bool test(Float32x4 element), {Float32x4 orElse()?}) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Float32x4 lastWhere(bool test(Float32x4 element), {Float32x4 orElse()?}) {
-    var len = this.length;
-    for (var i = len - 1; i >= 0; --i) {
-      var element = this[i];
-      if (test(element)) {
-        return element;
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Float32x4 singleWhere(bool test(Float32x4 element), {Float32x4 orElse()?}) {
-    var result = null;
-    bool foundMatching = false;
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Float32x4 elementAt(int index) {
-    return this[index];
-  }
-
-  void add(Float32x4 value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void addAll(Iterable<Float32x4> value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void insert(int index, Float32x4 value) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void insertAll(int index, Iterable<Float32x4> values) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void sort([int compare(Float32x4 a, Float32x4 b)?]) {
-    if (compare == null) {
-      throw "SIMD don't have default compare.";
-    }
-    Sort.sort(this, compare);
-  }
-
-  int indexOf(Float32x4 element, [int start = 0]) {
-    if (start >= this.length) {
-      return -1;
-    } else if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < this.length; i++) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Float32x4 element, [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  Float32x4 removeLast() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  Float32x4 removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void removeWhere(bool test(Float32x4 element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void retainWhere(bool test(Float32x4 element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  Float32x4 get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  Float32x4 get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  Float32x4 get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  Float32x4List sublist(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    var length = endIndex - start;
-    Float32x4List result = _createList(length);
-    result.setRange(0, length, this, start);
-    return result;
-  }
-
-  void setAll(int index, Iterable<Float32x4> iterable) {
-    final end = iterable.length + index;
-    setRange(index, end, iterable);
-  }
-
-  void fillRange(int start, int end, [Float32x4? fillValue]) {
-    RangeError.checkValidRange(start, end, this.length);
-    if (start == end) return;
-    if (fillValue == null) {
-      throw ArgumentError.notNull("fillValue");
-    }
-    for (var i = start; i < end; ++i) {
-      this[i] = fillValue;
-    }
-  }
-}
-
-abstract class _Int32x4ListMixin implements List<Int32x4> {
-  int get elementSizeInBytes;
-  int get offsetInBytes;
-  _ByteBuffer get buffer;
-
-  Int32x4List _createList(int length);
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  Iterable<Int32x4> followedBy(Iterable<Int32x4> other) =>
-      new FollowedByIterable<Int32x4>.firstEfficient(this, other);
-
-  List<R> cast<R>() => List.castFrom<Int32x4, R>(this);
-  void set first(Int32x4 value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[0] = value;
-  }
-
-  void set last(Int32x4 value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[this.length - 1] = value;
-  }
-
-  int indexWhere(bool test(Int32x4 element), [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(Int32x4 element), [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  List<Int32x4> operator +(List<Int32x4> other) {
-    int totalLength = this.length + other.length;
-    return <Int32x4>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
-
-  bool contains(Object? element) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (this[i] == element) return true;
-    }
-    return false;
-  }
-
-  void shuffle([Random? random]) {
-    random ??= new Random();
-    var i = this.length;
-    while (i > 1) {
-      int pos = random.nextInt(i);
-      i -= 1;
-      var tmp = this[i];
-      this[i] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  void setRange(int start, int end, Iterable<Int32x4> from,
-      [int skipCount = 0]) {
-    // Check ranges.
-    if (0 > start || start > end || end > length) {
-      RangeError.checkValidRange(start, end, length); // Always throws.
-      assert(false);
-    }
-    if (skipCount < 0) {
-      throw RangeError.range(skipCount, 0, null, "skipCount");
-    }
-
-    final count = end - start;
-    if ((from.length - skipCount) < count) {
-      throw IterableElementError.tooFew();
-    }
-
-    if (count == 0) return;
-
-    if (from is _TypedListBase) {
-      // Note: _TypedListBase is not related to Iterable<Int32x4> so there is
-      // no promotion here.
-      final fromAsTypedList = from as _TypedListBase;
-      if (this.elementSizeInBytes == fromAsTypedList.elementSizeInBytes) {
-        if ((count < 10) && (fromAsTypedList.buffer != this.buffer)) {
-          Lists.copy(from as List<Int32x4>, skipCount, this, start, count);
-          return;
-        } else if (this.buffer._data._setRange(
-            start * elementSizeInBytes + this.offsetInBytes,
-            count * elementSizeInBytes,
-            fromAsTypedList.buffer._data,
-            skipCount * elementSizeInBytes + fromAsTypedList.offsetInBytes,
-            ClassID.getID(this),
-            ClassID.getID(from))) {
-          return;
-        }
-      } else if (fromAsTypedList.buffer == this.buffer) {
-        // Different element sizes, but same buffer means that we need
-        // an intermediate structure.
-        // TODO(srdjan): Optimize to skip copying if the range does not overlap.
-        final fromAsList = from as List<Int32x4>;
-        final tempBuffer = _createList(count);
-        for (var i = 0; i < count; i++) {
-          tempBuffer[i] = fromAsList[skipCount + i];
-        }
-        for (var i = start; i < end; i++) {
-          this[i] = tempBuffer[i - start];
-        }
-        return;
-      }
-    }
-
-    List otherList;
-    int otherStart;
-    if (from is List<Int32x4>) {
-      otherList = from;
-      otherStart = skipCount;
-    } else {
-      otherList = from.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + count > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    Lists.copy(otherList, otherStart, this, start, count);
-  }
-
-  Iterable<Int32x4> where(bool f(Int32x4 element)) =>
-      new WhereIterable<Int32x4>(this, f);
-
-  Iterable<Int32x4> take(int n) => new SubListIterable<Int32x4>(this, 0, n);
-
-  Iterable<Int32x4> takeWhile(bool test(Int32x4 element)) =>
-      new TakeWhileIterable<Int32x4>(this, test);
-
-  Iterable<Int32x4> skip(int n) => new SubListIterable<Int32x4>(this, n, null);
-
-  Iterable<Int32x4> skipWhile(bool test(Int32x4 element)) =>
-      new SkipWhileIterable<Int32x4>(this, test);
-
-  Iterable<Int32x4> get reversed => new ReversedListIterable<Int32x4>(this);
-
-  Map<int, Int32x4> asMap() => new ListMapView<Int32x4>(this);
-
-  Iterable<Int32x4> getRange(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<Int32x4>(this, start, endIndex);
-  }
-
-  Iterator<Int32x4> get iterator => new _TypedListIterator<Int32x4>(this);
-
-  List<Int32x4> toList({bool growable: true}) {
-    return new List<Int32x4>.from(this, growable: growable);
-  }
-
-  Set<Int32x4> toSet() {
-    return new Set<Int32x4>.from(this);
-  }
-
-  void forEach(void f(Int32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; i++) {
-      f(this[i]);
-    }
-  }
-
-  Int32x4 reduce(Int32x4 combine(Int32x4 value, Int32x4 element)) {
-    var len = this.length;
-    if (len == 0) throw IterableElementError.noElement();
-    var value = this[0];
-    for (var i = 1; i < len; ++i) {
-      value = combine(value, this[i]);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T initialValue, Int32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      initialValue = combine(initialValue, this[i]);
-    }
-    return initialValue;
-  }
-
-  Iterable<T> map<T>(T f(Int32x4 element)) =>
-      new MappedIterable<Int32x4, T>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(Int32x4 element)) =>
-      new ExpandIterable<Int32x4, T>(this, f);
-
-  bool every(bool f(Int32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (!f(this[i])) return false;
-    }
-    return true;
-  }
-
-  bool any(bool f(Int32x4 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (f(this[i])) return true;
-    }
-    return false;
-  }
-
-  Int32x4 firstWhere(bool test(Int32x4 element), {Int32x4 orElse()?}) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Int32x4 lastWhere(bool test(Int32x4 element), {Int32x4 orElse()?}) {
-    var len = this.length;
-    for (var i = len - 1; i >= 0; --i) {
-      var element = this[i];
-      if (test(element)) {
-        return element;
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Int32x4 singleWhere(bool test(Int32x4 element), {Int32x4 orElse()?}) {
-    var result = null;
-    bool foundMatching = false;
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Int32x4 elementAt(int index) {
-    return this[index];
-  }
-
-  void add(Int32x4 value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void addAll(Iterable<Int32x4> value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void insert(int index, Int32x4 value) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void insertAll(int index, Iterable<Int32x4> values) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void sort([int compare(Int32x4 a, Int32x4 b)?]) {
-    if (compare == null) {
-      throw "SIMD don't have default compare.";
-    }
-    Sort.sort(this, compare);
-  }
-
-  int indexOf(Int32x4 element, [int start = 0]) {
-    if (start >= this.length) {
-      return -1;
-    } else if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < this.length; i++) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Int32x4 element, [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  Int32x4 removeLast() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  Int32x4 removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void removeWhere(bool test(Int32x4 element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void retainWhere(bool test(Int32x4 element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  Int32x4 get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  Int32x4 get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  Int32x4 get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  Int32x4List sublist(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    var length = endIndex - start;
-    Int32x4List result = _createList(length);
-    result.setRange(0, length, this, start);
-    return result;
-  }
-
-  void setAll(int index, Iterable<Int32x4> iterable) {
-    final end = iterable.length + index;
-    setRange(index, end, iterable);
-  }
-
-  void fillRange(int start, int end, [Int32x4? fillValue]) {
-    RangeError.checkValidRange(start, end, this.length);
-    if (start == end) return;
-    if (fillValue == null) {
-      throw ArgumentError.notNull("fillValue");
-    }
-    for (var i = start; i < end; ++i) {
-      this[i] = fillValue;
-    }
-  }
-}
-
-abstract class _Float64x2ListMixin implements List<Float64x2> {
-  int get elementSizeInBytes;
-  int get offsetInBytes;
-  _ByteBuffer get buffer;
-
-  Float64x2List _createList(int length);
-
-  Iterable<T> whereType<T>() => new WhereTypeIterable<T>(this);
-
-  Iterable<Float64x2> followedBy(Iterable<Float64x2> other) =>
-      new FollowedByIterable<Float64x2>.firstEfficient(this, other);
-
-  List<R> cast<R>() => List.castFrom<Float64x2, R>(this);
-  void set first(Float64x2 value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[0] = value;
-  }
-
-  void set last(Float64x2 value) {
-    if (this.length == 0) throw new RangeError.index(0, this);
-    this[this.length - 1] = value;
-  }
-
-  int indexWhere(bool test(Float64x2 element), [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(Float64x2 element), [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  List<Float64x2> operator +(List<Float64x2> other) {
-    int totalLength = this.length + other.length;
-    return <Float64x2>[]
-      ..length = totalLength
-      ..setRange(0, this.length, this)
-      ..setRange(this.length, totalLength, other);
-  }
-
-  bool contains(Object? element) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (this[i] == element) return true;
-    }
-    return false;
-  }
-
-  void shuffle([Random? random]) {
-    random ??= new Random();
-    var i = this.length;
-    while (i > 1) {
-      int pos = random.nextInt(i);
-      i -= 1;
-      var tmp = this[i];
-      this[i] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  void setRange(int start, int end, Iterable<Float64x2> from,
-      [int skipCount = 0]) {
-    // Check ranges.
-    if (0 > start || start > end || end > length) {
-      RangeError.checkValidRange(start, end, length); // Always throws.
-      assert(false);
-    }
-    if (skipCount < 0) {
-      throw RangeError.range(skipCount, 0, null, "skipCount");
-    }
-
-    final count = end - start;
-    if ((from.length - skipCount) < count) {
-      throw IterableElementError.tooFew();
-    }
-
-    if (count == 0) return;
-
-    if (from is _TypedListBase) {
-      // Note: _TypedListBase is not related to Iterable<Float64x2> so there is
-      // no promotion here.
-      final fromAsTypedList = from as _TypedListBase;
-      if (this.elementSizeInBytes == fromAsTypedList.elementSizeInBytes) {
-        if ((count < 10) && (fromAsTypedList.buffer != this.buffer)) {
-          Lists.copy(from as List<Float64x2>, skipCount, this, start, count);
-          return;
-        } else if (this.buffer._data._setRange(
-            start * elementSizeInBytes + this.offsetInBytes,
-            count * elementSizeInBytes,
-            fromAsTypedList.buffer._data,
-            skipCount * elementSizeInBytes + fromAsTypedList.offsetInBytes,
-            ClassID.getID(this),
-            ClassID.getID(from))) {
-          return;
-        }
-      } else if (fromAsTypedList.buffer == this.buffer) {
-        // Different element sizes, but same buffer means that we need
-        // an intermediate structure.
-        // TODO(srdjan): Optimize to skip copying if the range does not overlap.
-        final fromAsList = from as List<Float64x2>;
-        final tempBuffer = _createList(count);
-        for (var i = 0; i < count; i++) {
-          tempBuffer[i] = fromAsList[skipCount + i];
-        }
-        for (var i = start; i < end; i++) {
-          this[i] = tempBuffer[i - start];
-        }
-        return;
-      }
-    }
-
-    List otherList;
-    int otherStart;
-    if (from is List<Float64x2>) {
-      otherList = from;
-      otherStart = skipCount;
-    } else {
-      otherList = from.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + count > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    Lists.copy(otherList, otherStart, this, start, count);
-  }
-
-  Iterable<Float64x2> where(bool f(Float64x2 element)) =>
-      new WhereIterable<Float64x2>(this, f);
-
-  Iterable<Float64x2> take(int n) => new SubListIterable<Float64x2>(this, 0, n);
-
-  Iterable<Float64x2> takeWhile(bool test(Float64x2 element)) =>
-      new TakeWhileIterable<Float64x2>(this, test);
-
-  Iterable<Float64x2> skip(int n) =>
-      new SubListIterable<Float64x2>(this, n, null);
-
-  Iterable<Float64x2> skipWhile(bool test(Float64x2 element)) =>
-      new SkipWhileIterable<Float64x2>(this, test);
-
-  Iterable<Float64x2> get reversed => new ReversedListIterable<Float64x2>(this);
-
-  Map<int, Float64x2> asMap() => new ListMapView<Float64x2>(this);
-
-  Iterable<Float64x2> getRange(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    return new SubListIterable<Float64x2>(this, start, endIndex);
-  }
-
-  Iterator<Float64x2> get iterator => new _TypedListIterator<Float64x2>(this);
-
-  List<Float64x2> toList({bool growable: true}) {
-    return new List<Float64x2>.from(this, growable: growable);
-  }
-
-  Set<Float64x2> toSet() {
-    return new Set<Float64x2>.from(this);
-  }
-
-  void forEach(void f(Float64x2 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; i++) {
-      f(this[i]);
-    }
-  }
-
-  Float64x2 reduce(Float64x2 combine(Float64x2 value, Float64x2 element)) {
-    var len = this.length;
-    if (len == 0) throw IterableElementError.noElement();
-    var value = this[0];
-    for (var i = 1; i < len; ++i) {
-      value = combine(value, this[i]);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T initialValue, Float64x2 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      initialValue = combine(initialValue, this[i]);
-    }
-    return initialValue;
-  }
-
-  Iterable<T> map<T>(T f(Float64x2 element)) =>
-      new MappedIterable<Float64x2, T>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(Float64x2 element)) =>
-      new ExpandIterable<Float64x2, T>(this, f);
-
-  bool every(bool f(Float64x2 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (!f(this[i])) return false;
-    }
-    return true;
-  }
-
-  bool any(bool f(Float64x2 element)) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      if (f(this[i])) return true;
-    }
-    return false;
-  }
-
-  Float64x2 firstWhere(bool test(Float64x2 element), {Float64x2 orElse()?}) {
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Float64x2 lastWhere(bool test(Float64x2 element), {Float64x2 orElse()?}) {
-    var len = this.length;
-    for (var i = len - 1; i >= 0; --i) {
-      var element = this[i];
-      if (test(element)) {
-        return element;
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Float64x2 singleWhere(bool test(Float64x2 element), {Float64x2 orElse()?}) {
-    var result = null;
-    bool foundMatching = false;
-    var len = this.length;
-    for (var i = 0; i < len; ++i) {
-      var element = this[i];
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  Float64x2 elementAt(int index) {
-    return this[index];
-  }
-
-  void add(Float64x2 value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void addAll(Iterable<Float64x2> value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  void insert(int index, Float64x2 value) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void insertAll(int index, Iterable<Float64x2> values) {
-    throw new UnsupportedError("Cannot insert into a fixed-length list");
-  }
-
-  void sort([int compare(Float64x2 a, Float64x2 b)?]) {
-    if (compare == null) {
-      throw "SIMD don't have default compare.";
-    }
-    Sort.sort(this, compare);
-  }
-
-  int indexOf(Float64x2 element, [int start = 0]) {
-    if (start >= this.length) {
-      return -1;
-    } else if (start < 0) {
-      start = 0;
-    }
-    for (int i = start; i < this.length; i++) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Float64x2 element, [int? start]) {
-    int startIndex =
-        (start == null || start >= this.length) ? this.length - 1 : start;
-    for (int i = startIndex; i >= 0; i--) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  Float64x2 removeLast() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  Float64x2 removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void removeWhere(bool test(Float64x2 element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  void retainWhere(bool test(Float64x2 element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  Float64x2 get first {
-    if (length > 0) return this[0];
-    throw IterableElementError.noElement();
-  }
-
-  Float64x2 get last {
-    if (length > 0) return this[length - 1];
-    throw IterableElementError.noElement();
-  }
-
-  Float64x2 get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw IterableElementError.noElement();
-    throw IterableElementError.tooMany();
-  }
-
-  Float64x2List sublist(int start, [int? end]) {
-    int endIndex = RangeError.checkValidRange(start, end, this.length);
-    var length = endIndex - start;
-    Float64x2List result = _createList(length);
-    result.setRange(0, length, this, start);
-    return result;
-  }
-
-  void setAll(int index, Iterable<Float64x2> iterable) {
-    final end = iterable.length + index;
-    setRange(index, end, iterable);
-  }
-
-  void fillRange(int start, int end, [Float64x2? fillValue]) {
-    RangeError.checkValidRange(start, end, this.length);
-    if (start == end) return;
-    if (fillValue == null) {
-      throw ArgumentError.notNull("fillValue");
-    }
-    for (var i = start; i < end; ++i) {
-      this[i] = fillValue;
-    }
-  }
-}
-
-@pragma("vm:entry-point")
-class _ByteBuffer implements ByteBuffer {
-  final _TypedList _data;
-
-  _ByteBuffer(this._data);
-
-  @pragma("vm:entry-point")
-  factory _ByteBuffer._New(data) => new _ByteBuffer(data);
-
-  // Forward calls to _data.
-  int get lengthInBytes => _data.lengthInBytes;
-  int get hashCode => _data.hashCode;
-  bool operator ==(Object other) =>
-      (other is _ByteBuffer) && identical(_data, other._data);
-
-  ByteData asByteData([int offsetInBytes = 0, int? length]) {
-    length ??= this.lengthInBytes - offsetInBytes;
-    _rangeCheck(this._data.lengthInBytes, offsetInBytes, length);
-    return new _ByteDataView._(this._data, offsetInBytes, length);
-  }
-
-  Int8List asInt8List([int offsetInBytes = 0, int? length]) {
-    length ??= (this.lengthInBytes - offsetInBytes) ~/ Int8List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Int8List.bytesPerElement);
-    return new _Int8ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Uint8List asUint8List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Uint8List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Uint8List.bytesPerElement);
-    return new _Uint8ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) {
-    length ??= (this.lengthInBytes - offsetInBytes) ~/
-        Uint8ClampedList.bytesPerElement;
-    _rangeCheck(this.lengthInBytes, offsetInBytes,
-        length * Uint8ClampedList.bytesPerElement);
-    return new _Uint8ClampedArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Int16List asInt16List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Int16List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Int16List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Int16List.bytesPerElement);
-    return new _Int16ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Uint16List asUint16List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Uint16List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Uint16List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Uint16List.bytesPerElement);
-    return new _Uint16ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Int32List asInt32List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Int32List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Int32List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Int32List.bytesPerElement);
-    return new _Int32ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Uint32List asUint32List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Uint32List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Uint32List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Uint32List.bytesPerElement);
-    return new _Uint32ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Int64List asInt64List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Int64List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Int64List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Int64List.bytesPerElement);
-    return new _Int64ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Uint64List asUint64List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Uint64List.bytesPerElement;
-    _rangeCheck(
-        this.lengthInBytes, offsetInBytes, length * Uint64List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Uint64List.bytesPerElement);
-    return new _Uint64ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Float32List asFloat32List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Float32List.bytesPerElement;
-    _rangeCheck(this.lengthInBytes, offsetInBytes,
-        length * Float32List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Float32List.bytesPerElement);
-    return new _Float32ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Float64List asFloat64List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Float64List.bytesPerElement;
-    _rangeCheck(this.lengthInBytes, offsetInBytes,
-        length * Float64List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Float64List.bytesPerElement);
-    return new _Float64ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Float32x4List.bytesPerElement;
-    _rangeCheck(this.lengthInBytes, offsetInBytes,
-        length * Float32x4List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Float32x4List.bytesPerElement);
-    return new _Float32x4ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Int32x4List.bytesPerElement;
-    _rangeCheck(this.lengthInBytes, offsetInBytes,
-        length * Int32x4List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Int32x4List.bytesPerElement);
-    return new _Int32x4ArrayView._(this._data, offsetInBytes, length);
-  }
-
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) {
-    length ??=
-        (this.lengthInBytes - offsetInBytes) ~/ Float64x2List.bytesPerElement;
-    _rangeCheck(this.lengthInBytes, offsetInBytes,
-        length * Float64x2List.bytesPerElement);
-    _offsetAlignmentCheck(offsetInBytes, Float64x2List.bytesPerElement);
-    return new _Float64x2ArrayView._(this._data, offsetInBytes, length);
-  }
-}
-
-abstract class _TypedList extends _TypedListBase {
-  int get elementSizeInBytes;
-
-  // Default method implementing parts of the TypedData interface.
-  int get offsetInBytes {
-    return 0;
-  }
-
-  int get lengthInBytes {
-    return length * elementSizeInBytes;
-  }
-
-  _ByteBuffer get buffer => new _ByteBuffer(this);
-
-  // Methods implementing the collection interface.
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "TypedData_length";
-
-  // Internal utility methods.
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int _getInt8(int offsetInBytes) native "TypedData_GetInt8";
-  void _setInt8(int offsetInBytes, int value) native "TypedData_SetInt8";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int _getUint8(int offsetInBytes) native "TypedData_GetUint8";
-  void _setUint8(int offsetInBytes, int value) native "TypedData_SetUint8";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int _getInt16(int offsetInBytes) native "TypedData_GetInt16";
-  void _setInt16(int offsetInBytes, int value) native "TypedData_SetInt16";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int _getUint16(int offsetInBytes) native "TypedData_GetUint16";
-  void _setUint16(int offsetInBytes, int value) native "TypedData_SetUint16";
-
-  int _getInt32(int offsetInBytes) native "TypedData_GetInt32";
-  void _setInt32(int offsetInBytes, int value) native "TypedData_SetInt32";
-
-  int _getUint32(int offsetInBytes) native "TypedData_GetUint32";
-  void _setUint32(int offsetInBytes, int value) native "TypedData_SetUint32";
-
-  int _getInt64(int offsetInBytes) native "TypedData_GetInt64";
-  void _setInt64(int offsetInBytes, int value) native "TypedData_SetInt64";
-
-  int _getUint64(int offsetInBytes) native "TypedData_GetUint64";
-  void _setUint64(int offsetInBytes, int value) native "TypedData_SetUint64";
-
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double _getFloat32(int offsetInBytes) native "TypedData_GetFloat32";
-  void _setFloat32(int offsetInBytes, double value)
-      native "TypedData_SetFloat32";
-
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double _getFloat64(int offsetInBytes) native "TypedData_GetFloat64";
-  void _setFloat64(int offsetInBytes, double value)
-      native "TypedData_SetFloat64";
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 _getFloat32x4(int offsetInBytes) native "TypedData_GetFloat32x4";
-  void _setFloat32x4(int offsetInBytes, Float32x4 value)
-      native "TypedData_SetFloat32x4";
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _getInt32x4(int offsetInBytes) native "TypedData_GetInt32x4";
-  void _setInt32x4(int offsetInBytes, Int32x4 value)
-      native "TypedData_SetInt32x4";
-
-  Float64x2 _getFloat64x2(int offsetInBytes) native "TypedData_GetFloat64x2";
-  void _setFloat64x2(int offsetInBytes, Float64x2 value)
-      native "TypedData_SetFloat64x2";
-
-  /**
-   * Stores the [CodeUnits] as UTF-16 units into this TypedData at
-   * positions [start]..[end] (uint16 indices).
-   */
-  void _setCodeUnits(
-      CodeUnits units, int byteStart, int length, int skipCount) {
-    assert(byteStart + length * Uint16List.bytesPerElement <= lengthInBytes);
-    String string = CodeUnits.stringOf(units);
-    int sliceEnd = skipCount + length;
-    RangeError.checkValidRange(
-        skipCount, sliceEnd, string.length, "skipCount", "skipCount + length");
-    for (int i = 0; i < length; i++) {
-      _setUint16(byteStart + i * Uint16List.bytesPerElement,
-          string.codeUnitAt(skipCount + i));
-    }
-  }
-}
-
-@patch
-class Int8List {
-  @patch
-  @pragma("vm:exact-result-type", _Int8List)
-  factory Int8List(int length) native "TypedData_Int8Array_new";
-
-  @patch
-  factory Int8List.fromList(List<int> elements) {
-    return new Int8List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int8List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int8List>
-    implements Int8List {
-  factory _Int8List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getInt8(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setInt8(index, _toInt8(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int8List _createList(int length) {
-    return new Int8List(length);
-  }
-}
-
-@patch
-class Uint8List {
-  @patch
-  @pragma("vm:exact-result-type", _Uint8List)
-  factory Uint8List(int length) native "TypedData_Uint8Array_new";
-
-  @patch
-  factory Uint8List.fromList(List<int> elements) {
-    return new Uint8List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint8List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint8List>
-    implements Uint8List {
-  factory _Uint8List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Methods implementing List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getUint8(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setUint8(index, _toUint8(value));
-  }
-
-  // Methods implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Uint8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint8List _createList(int length) {
-    return new Uint8List(length);
-  }
-}
-
-@patch
-class Uint8ClampedList {
-  @patch
-  @pragma("vm:exact-result-type", _Uint8ClampedList)
-  factory Uint8ClampedList(int length) native "TypedData_Uint8ClampedArray_new";
-
-  @patch
-  factory Uint8ClampedList.fromList(List<int> elements) {
-    return new Uint8ClampedList(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint8ClampedList extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint8ClampedList>
-    implements Uint8ClampedList {
-  factory _Uint8ClampedList._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Methods implementing List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getUint8(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setUint8(index, _toClampedUint8(value));
-  }
-
-  // Methods implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Uint8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint8ClampedList _createList(int length) {
-    return new Uint8ClampedList(length);
-  }
-}
-
-@patch
-class Int16List {
-  @patch
-  @pragma("vm:exact-result-type", _Int16List)
-  factory Int16List(int length) native "TypedData_Int16Array_new";
-
-  @patch
-  factory Int16List.fromList(List<int> elements) {
-    return new Int16List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int16List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int16List>
-    implements Int16List {
-  factory _Int16List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt16(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt16(index, _toInt16(value));
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable,
-      [int skipCount = 0]) {
-    if (iterable is CodeUnits) {
-      end = RangeError.checkValidRange(start, end, this.length);
-      int length = end - start;
-      int byteStart = this.offsetInBytes + start * Int16List.bytesPerElement;
-      _setCodeUnits(iterable, byteStart, length, skipCount);
-    } else {
-      super.setRange(start, end, iterable, skipCount);
-    }
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int16List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int16List _createList(int length) {
-    return new Int16List(length);
-  }
-
-  int _getIndexedInt16(int index) {
-    return _getInt16(index * Int16List.bytesPerElement);
-  }
-
-  void _setIndexedInt16(int index, int value) {
-    _setInt16(index * Int16List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Uint16List {
-  @patch
-  @pragma("vm:exact-result-type", _Uint16List)
-  factory Uint16List(int length) native "TypedData_Uint16Array_new";
-
-  @patch
-  factory Uint16List.fromList(List<int> elements) {
-    return new Uint16List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint16List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint16List>
-    implements Uint16List {
-  factory _Uint16List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedUint16(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedUint16(index, _toUint16(value));
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable,
-      [int skipCount = 0]) {
-    if (iterable is CodeUnits) {
-      end = RangeError.checkValidRange(start, end, this.length);
-      int length = end - start;
-      int byteStart = this.offsetInBytes + start * Uint16List.bytesPerElement;
-      _setCodeUnits(iterable, byteStart, length, skipCount);
-    } else {
-      super.setRange(start, end, iterable, skipCount);
-    }
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint16List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint16List _createList(int length) {
-    return new Uint16List(length);
-  }
-
-  int _getIndexedUint16(int index) {
-    return _getUint16(index * Uint16List.bytesPerElement);
-  }
-
-  void _setIndexedUint16(int index, int value) {
-    _setUint16(index * Uint16List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Int32List {
-  @patch
-  @pragma("vm:exact-result-type", _Int32List)
-  factory Int32List(int length) native "TypedData_Int32Array_new";
-
-  @patch
-  factory Int32List.fromList(List<int> elements) {
-    return new Int32List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int32List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int32List>
-    implements Int32List {
-  factory _Int32List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt32(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt32(index, _toInt32(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int32List _createList(int length) {
-    return new Int32List(length);
-  }
-
-  int _getIndexedInt32(int index) {
-    return _getInt32(index * Int32List.bytesPerElement);
-  }
-
-  void _setIndexedInt32(int index, int value) {
-    _setInt32(index * Int32List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Uint32List {
-  @patch
-  @pragma("vm:exact-result-type", _Uint32List)
-  factory Uint32List(int length) native "TypedData_Uint32Array_new";
-
-  @patch
-  factory Uint32List.fromList(List<int> elements) {
-    return new Uint32List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint32List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint32List>
-    implements Uint32List {
-  factory _Uint32List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedUint32(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedUint32(index, _toUint32(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint32List _createList(int length) {
-    return new Uint32List(length);
-  }
-
-  int _getIndexedUint32(int index) {
-    return _getUint32(index * Uint32List.bytesPerElement);
-  }
-
-  void _setIndexedUint32(int index, int value) {
-    _setUint32(index * Uint32List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Int64List {
-  @patch
-  @pragma("vm:exact-result-type", _Int64List)
-  factory Int64List(int length) native "TypedData_Int64Array_new";
-
-  @patch
-  factory Int64List.fromList(List<int> elements) {
-    return new Int64List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int64List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int64List>
-    implements Int64List {
-  factory _Int64List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt64(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt64(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int64List _createList(int length) {
-    return new Int64List(length);
-  }
-
-  int _getIndexedInt64(int index) {
-    return _getInt64(index * Int64List.bytesPerElement);
-  }
-
-  void _setIndexedInt64(int index, int value) {
-    _setInt64(index * Int64List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Uint64List {
-  @patch
-  @pragma("vm:exact-result-type", _Uint64List)
-  factory Uint64List(int length) native "TypedData_Uint64Array_new";
-
-  @patch
-  factory Uint64List.fromList(List<int> elements) {
-    return new Uint64List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint64List extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint64List>
-    implements Uint64List {
-  factory _Uint64List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedUint64(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedUint64(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint64List _createList(int length) {
-    return new Uint64List(length);
-  }
-
-  int _getIndexedUint64(int index) {
-    return _getUint64(index * Uint64List.bytesPerElement);
-  }
-
-  void _setIndexedUint64(int index, int value) {
-    _setUint64(index * Uint64List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Float32List {
-  @patch
-  @pragma("vm:exact-result-type", _Float32List)
-  factory Float32List(int length) native "TypedData_Float32Array_new";
-
-  @patch
-  factory Float32List.fromList(List<double> elements) {
-    return new Float32List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float32List extends _TypedList
-    with _DoubleListMixin, _TypedDoubleListMixin<Float32List>
-    implements Float32List {
-  factory _Float32List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat32(index);
-  }
-
-  void operator []=(int index, double value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat32(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float32List _createList(int length) {
-    return new Float32List(length);
-  }
-
-  double _getIndexedFloat32(int index) {
-    return _getFloat32(index * Float32List.bytesPerElement);
-  }
-
-  void _setIndexedFloat32(int index, double value) {
-    _setFloat32(index * Float32List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Float64List {
-  @patch
-  @pragma("vm:exact-result-type", _Float64List)
-  factory Float64List(int length) native "TypedData_Float64Array_new";
-
-  @patch
-  factory Float64List.fromList(List<double> elements) {
-    return new Float64List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float64List extends _TypedList
-    with _DoubleListMixin, _TypedDoubleListMixin<Float64List>
-    implements Float64List {
-  factory _Float64List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat64(index);
-  }
-
-  void operator []=(int index, double value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat64(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float64List _createList(int length) {
-    return new Float64List(length);
-  }
-
-  double _getIndexedFloat64(int index) {
-    return _getFloat64(index * Float64List.bytesPerElement);
-  }
-
-  void _setIndexedFloat64(int index, double value) {
-    _setFloat64(index * Float64List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Float32x4List {
-  @patch
-  @pragma("vm:exact-result-type", _Float32x4List)
-  factory Float32x4List(int length) native "TypedData_Float32x4Array_new";
-
-  @patch
-  factory Float32x4List.fromList(List<Float32x4> elements) {
-    return new Float32x4List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float32x4List extends _TypedList
-    with _Float32x4ListMixin
-    implements Float32x4List {
-  factory _Float32x4List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat32x4(index);
-  }
-
-  void operator []=(int index, Float32x4 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat32x4(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float32x4List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float32x4List _createList(int length) {
-    return new Float32x4List(length);
-  }
-
-  Float32x4 _getIndexedFloat32x4(int index) {
-    return _getFloat32x4(index * Float32x4List.bytesPerElement);
-  }
-
-  void _setIndexedFloat32x4(int index, Float32x4 value) {
-    _setFloat32x4(index * Float32x4List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Int32x4List {
-  @patch
-  @pragma("vm:exact-result-type", _Int32x4List)
-  factory Int32x4List(int length) native "TypedData_Int32x4Array_new";
-
-  @patch
-  factory Int32x4List.fromList(List<Int32x4> elements) {
-    return new Int32x4List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int32x4List extends _TypedList
-    with _Int32x4ListMixin
-    implements Int32x4List {
-  factory _Int32x4List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt32x4(index);
-  }
-
-  void operator []=(int index, Int32x4 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt32x4(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int32x4List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int32x4List _createList(int length) {
-    return new Int32x4List(length);
-  }
-
-  Int32x4 _getIndexedInt32x4(int index) {
-    return _getInt32x4(index * Int32x4List.bytesPerElement);
-  }
-
-  void _setIndexedInt32x4(int index, Int32x4 value) {
-    _setInt32x4(index * Int32x4List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Float64x2List {
-  @patch
-  @pragma("vm:exact-result-type", _Float64x2List)
-  factory Float64x2List(int length) native "TypedData_Float64x2Array_new";
-
-  @patch
-  factory Float64x2List.fromList(List<Float64x2> elements) {
-    return new Float64x2List(elements.length)
-      ..setRange(0, elements.length, elements);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float64x2List extends _TypedList
-    with _Float64x2ListMixin
-    implements Float64x2List {
-  factory _Float64x2List._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat64x2(index);
-  }
-
-  void operator []=(int index, Float64x2 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat64x2(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float64x2List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float64x2List _createList(int length) {
-    return new Float64x2List(length);
-  }
-
-  Float64x2 _getIndexedFloat64x2(int index) {
-    return _getFloat64x2(index * Float64x2List.bytesPerElement);
-  }
-
-  void _setIndexedFloat64x2(int index, Float64x2 value) {
-    _setFloat64x2(index * Float64x2List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalInt8Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int8List>
-    implements Int8List {
-  factory _ExternalInt8Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getInt8(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setInt8(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int8List _createList(int length) {
-    return new Int8List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalUint8Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint8List>
-    implements Uint8List {
-  factory _ExternalUint8Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getUint8(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setUint8(index, _toUint8(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint8List _createList(int length) {
-    return new Uint8List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalUint8ClampedArray extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint8ClampedList>
-    implements Uint8ClampedList {
-  factory _ExternalUint8ClampedArray._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getUint8(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setUint8(index, _toClampedUint8(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint8ClampedList _createList(int length) {
-    return new Uint8ClampedList(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalInt16Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int16List>
-    implements Int16List {
-  factory _ExternalInt16Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt16(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt16(index, _toInt16(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int16List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int16List _createList(int length) {
-    return new Int16List(length);
-  }
-
-  int _getIndexedInt16(int index) {
-    return _getInt16(index * Int16List.bytesPerElement);
-  }
-
-  void _setIndexedInt16(int index, int value) {
-    _setInt16(index * Int16List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalUint16Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint16List>
-    implements Uint16List {
-  factory _ExternalUint16Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedUint16(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedUint16(index, _toUint16(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint16List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint16List _createList(int length) {
-    return new Uint16List(length);
-  }
-
-  int _getIndexedUint16(int index) {
-    return _getUint16(index * Uint16List.bytesPerElement);
-  }
-
-  void _setIndexedUint16(int index, int value) {
-    _setUint16(index * Uint16List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalInt32Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int32List>
-    implements Int32List {
-  factory _ExternalInt32Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt32(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt32(index, _toInt32(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int32List _createList(int length) {
-    return new Int32List(length);
-  }
-
-  int _getIndexedInt32(int index) {
-    return _getInt32(index * Int32List.bytesPerElement);
-  }
-
-  void _setIndexedInt32(int index, int value) {
-    _setInt32(index * Int32List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalUint32Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint32List>
-    implements Uint32List {
-  factory _ExternalUint32Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedUint32(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedUint32(index, _toUint32(value));
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint32List _createList(int length) {
-    return new Uint32List(length);
-  }
-
-  int _getIndexedUint32(int index) {
-    return _getUint32(index * Uint32List.bytesPerElement);
-  }
-
-  void _setIndexedUint32(int index, int value) {
-    _setUint32(index * Uint32List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalInt64Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Int64List>
-    implements Int64List {
-  factory _ExternalInt64Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt64(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt64(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int64List _createList(int length) {
-    return new Int64List(length);
-  }
-
-  int _getIndexedInt64(int index) {
-    return _getInt64(index * Int64List.bytesPerElement);
-  }
-
-  void _setIndexedInt64(int index, int value) {
-    _setInt64(index * Int64List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalUint64Array extends _TypedList
-    with _IntListMixin, _TypedIntListMixin<Uint64List>
-    implements Uint64List {
-  factory _ExternalUint64Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedUint64(index);
-  }
-
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedUint64(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Uint64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint64List _createList(int length) {
-    return new Uint64List(length);
-  }
-
-  int _getIndexedUint64(int index) {
-    return _getUint64(index * Uint64List.bytesPerElement);
-  }
-
-  void _setIndexedUint64(int index, int value) {
-    _setUint64(index * Uint64List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalFloat32Array extends _TypedList
-    with _DoubleListMixin, _TypedDoubleListMixin<Float32List>
-    implements Float32List {
-  factory _ExternalFloat32Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  double operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat32(index);
-  }
-
-  void operator []=(int index, double value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat32(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float32List _createList(int length) {
-    return new Float32List(length);
-  }
-
-  double _getIndexedFloat32(int index) {
-    return _getFloat32(index * Float32List.bytesPerElement);
-  }
-
-  void _setIndexedFloat32(int index, double value) {
-    _setFloat32(index * Float32List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalFloat64Array extends _TypedList
-    with _DoubleListMixin, _TypedDoubleListMixin<Float64List>
-    implements Float64List {
-  factory _ExternalFloat64Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  double operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat64(index);
-  }
-
-  void operator []=(int index, double value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat64(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float64List _createList(int length) {
-    return new Float64List(length);
-  }
-
-  double _getIndexedFloat64(int index) {
-    return _getFloat64(index * Float64List.bytesPerElement);
-  }
-
-  void _setIndexedFloat64(int index, double value) {
-    _setFloat64(index * Float64List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalFloat32x4Array extends _TypedList
-    with _Float32x4ListMixin
-    implements Float32x4List {
-  factory _ExternalFloat32x4Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  Float32x4 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat32x4(index);
-  }
-
-  void operator []=(int index, Float32x4 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat32x4(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float32x4List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float32x4List _createList(int length) {
-    return new Float32x4List(length);
-  }
-
-  Float32x4 _getIndexedFloat32x4(int index) {
-    return _getFloat32x4(index * Float32x4List.bytesPerElement);
-  }
-
-  void _setIndexedFloat32x4(int index, Float32x4 value) {
-    _setFloat32x4(index * Float32x4List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalInt32x4Array extends _TypedList
-    with _Int32x4ListMixin
-    implements Int32x4List {
-  factory _ExternalInt32x4Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  Int32x4 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedInt32x4(index);
-  }
-
-  void operator []=(int index, Int32x4 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedInt32x4(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Int32x4List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int32x4List _createList(int length) {
-    return new Int32x4List(length);
-  }
-
-  Int32x4 _getIndexedInt32x4(int index) {
-    return _getInt32x4(index * Int32x4List.bytesPerElement);
-  }
-
-  void _setIndexedInt32x4(int index, Int32x4 value) {
-    _setInt32x4(index * Int32x4List.bytesPerElement, value);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ExternalFloat64x2Array extends _TypedList
-    with _Float64x2ListMixin
-    implements Float64x2List {
-  factory _ExternalFloat64x2Array._uninstantiable() {
-    throw "Unreachable";
-  }
-
-  // Method(s) implementing the List interface.
-  Float64x2 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _getIndexedFloat64x2(index);
-  }
-
-  void operator []=(int index, Float64x2 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _setIndexedFloat64x2(index, value);
-  }
-
-  // Method(s) implementing the TypedData interface.
-  int get elementSizeInBytes {
-    return Float64x2List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float64x2List _createList(int length) {
-    return new Float64x2List(length);
-  }
-
-  Float64x2 _getIndexedFloat64x2(int index) {
-    return _getFloat64x2(index * Float64x2List.bytesPerElement);
-  }
-
-  void _setIndexedFloat64x2(int index, Float64x2 value) {
-    _setFloat64x2(index * Float64x2List.bytesPerElement, value);
-  }
-}
-
-@patch
-class Float32x4 {
-  @patch
-  @pragma("vm:prefer-inline")
-  factory Float32x4(double x, double y, double z, double w) {
-    _throwIfNull(x, 'x');
-    _throwIfNull(y, 'y');
-    _throwIfNull(z, 'z');
-    _throwIfNull(w, 'w');
-    return _Float32x4FromDoubles(x, y, z, w);
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  static _Float32x4 _Float32x4FromDoubles(
-      double x, double y, double z, double w) native "Float32x4_fromDoubles";
-
-  @patch
-  @pragma("vm:prefer-inline")
-  factory Float32x4.splat(double v) {
-    _throwIfNull(v, 'v');
-    return _Float32x4Splat(v);
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  static _Float32x4 _Float32x4Splat(double v) native "Float32x4_splat";
-
-  @patch
-  @pragma("vm:exact-result-type", _Float32x4)
-  factory Float32x4.zero() native "Float32x4_zero";
-
-  @patch
-  @pragma("vm:exact-result-type", _Float32x4)
-  factory Float32x4.fromInt32x4Bits(Int32x4 x)
-      native "Float32x4_fromInt32x4Bits";
-
-  @patch
-  @pragma("vm:exact-result-type", _Float32x4)
-  factory Float32x4.fromFloat64x2(Float64x2 v) native "Float32x4_fromFloat64x2";
-}
-
-@pragma("vm:entry-point")
-class _Float32x4 implements Float32x4 {
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 operator +(Float32x4 other) native "Float32x4_add";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 operator -() native "Float32x4_negate";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 operator -(Float32x4 other) native "Float32x4_sub";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 operator *(Float32x4 other) native "Float32x4_mul";
-  Float32x4 operator /(Float32x4 other) native "Float32x4_div";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 lessThan(Float32x4 other) native "Float32x4_cmplt";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 lessThanOrEqual(Float32x4 other) native "Float32x4_cmplte";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 greaterThan(Float32x4 other) native "Float32x4_cmpgt";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 greaterThanOrEqual(Float32x4 other) native "Float32x4_cmpgte";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 equal(Float32x4 other) native "Float32x4_cmpequal";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 notEqual(Float32x4 other) native "Float32x4_cmpnequal";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 scale(double s) native "Float32x4_scale";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 abs() native "Float32x4_abs";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 clamp(Float32x4 lowerLimit, Float32x4 upperLimit)
-      native "Float32x4_clamp";
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double get x native "Float32x4_getX";
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double get y native "Float32x4_getY";
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double get z native "Float32x4_getZ";
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double get w native "Float32x4_getW";
-  int get signMask native "Float32x4_getSignMask";
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 shuffle(int mask) native "Float32x4_shuffle";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 shuffleMix(Float32x4 zw, int mask) native "Float32x4_shuffleMix";
-
-  @pragma("vm:prefer-inline")
-  Float32x4 withX(double x) {
-    _throwIfNull(x, 'x');
-    return _withX(x);
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 _withX(double x) native "Float32x4_setX";
-
-  @pragma("vm:prefer-inline")
-  Float32x4 withY(double y) {
-    _throwIfNull(y, 'y');
-    return _withY(y);
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 _withY(double y) native "Float32x4_setY";
-
-  @pragma("vm:prefer-inline")
-  Float32x4 withZ(double z) {
-    _throwIfNull(z, 'z');
-    return _withZ(z);
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 _withZ(double z) native "Float32x4_setZ";
-
-  @pragma("vm:prefer-inline")
-  Float32x4 withW(double w) {
-    _throwIfNull(w, 'w');
-    return _withW(w);
-  }
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 _withW(double w) native "Float32x4_setW";
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 min(Float32x4 other) native "Float32x4_min";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 max(Float32x4 other) native "Float32x4_max";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 sqrt() native "Float32x4_sqrt";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 reciprocal() native "Float32x4_reciprocal";
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 reciprocalSqrt() native "Float32x4_reciprocalSqrt";
-}
-
-@patch
-class Int32x4 {
-  @patch
-  @pragma("vm:prefer-inline")
-  factory Int32x4(int x, int y, int z, int w) {
-    _throwIfNull(x, 'x');
-    _throwIfNull(y, 'y');
-    _throwIfNull(z, 'z');
-    _throwIfNull(w, 'w');
-    return _Int32x4FromInts(x, y, z, w);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  static _Int32x4 _Int32x4FromInts(int x, int y, int z, int w)
-      native "Int32x4_fromInts";
-
-  @patch
-  @pragma("vm:prefer-inline")
-  factory Int32x4.bool(bool x, bool y, bool z, bool w) {
-    _throwIfNull(x, 'x');
-    _throwIfNull(y, 'y');
-    _throwIfNull(z, 'z');
-    _throwIfNull(w, 'w');
-    return _Int32x4FromBools(x, y, z, w);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  static _Int32x4 _Int32x4FromBools(bool x, bool y, bool z, bool w)
-      native "Int32x4_fromBools";
-
-  @patch
-  @pragma("vm:exact-result-type", _Int32x4)
-  factory Int32x4.fromFloat32x4Bits(Float32x4 x)
-      native "Int32x4_fromFloat32x4Bits";
-}
-
-@pragma("vm:entry-point")
-class _Int32x4 implements Int32x4 {
-  Int32x4 operator |(Int32x4 other) native "Int32x4_or";
-  Int32x4 operator &(Int32x4 other) native "Int32x4_and";
-  Int32x4 operator ^(Int32x4 other) native "Int32x4_xor";
-  Int32x4 operator +(Int32x4 other) native "Int32x4_add";
-  Int32x4 operator -(Int32x4 other) native "Int32x4_sub";
-  int get x native "Int32x4_getX";
-  int get y native "Int32x4_getY";
-  int get z native "Int32x4_getZ";
-  int get w native "Int32x4_getW";
-  int get signMask native "Int32x4_getSignMask";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 shuffle(int mask) native "Int32x4_shuffle";
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 shuffleMix(Int32x4 zw, int mask) native "Int32x4_shuffleMix";
-
-  @pragma("vm:prefer-inline")
-  Int32x4 withX(int x) {
-    _throwIfNull(x, 'x');
-    return _withX(x);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withX(int x) native "Int32x4_setX";
-
-  @pragma("vm:prefer-inline")
-  Int32x4 withY(int y) {
-    _throwIfNull(y, 'y');
-    return _withY(y);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withY(int y) native "Int32x4_setY";
-
-  @pragma("vm:prefer-inline")
-  Int32x4 withZ(int z) {
-    _throwIfNull(z, 'z');
-    return _withZ(z);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withZ(int z) native "Int32x4_setZ";
-
-  @pragma("vm:prefer-inline")
-  Int32x4 withW(int w) {
-    _throwIfNull(w, 'w');
-    return _withW(w);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withW(int w) native "Int32x4_setW";
-
-  @pragma("vm:exact-result-type", bool)
-  bool get flagX native "Int32x4_getFlagX";
-  @pragma("vm:exact-result-type", bool)
-  bool get flagY native "Int32x4_getFlagY";
-  @pragma("vm:exact-result-type", bool)
-  bool get flagZ native "Int32x4_getFlagZ";
-  @pragma("vm:exact-result-type", bool)
-  bool get flagW native "Int32x4_getFlagW";
-
-  @pragma("vm:prefer-inline", _Int32x4)
-  Int32x4 withFlagX(bool x) {
-    _throwIfNull(x, 'x');
-    return _withFlagX(x);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withFlagX(bool x) native "Int32x4_setFlagX";
-
-  @pragma("vm:prefer-inline", _Int32x4)
-  Int32x4 withFlagY(bool y) {
-    _throwIfNull(y, 'y');
-    return _withFlagY(y);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withFlagY(bool y) native "Int32x4_setFlagY";
-
-  @pragma("vm:prefer-inline", _Int32x4)
-  Int32x4 withFlagZ(bool z) {
-    _throwIfNull(z, 'z');
-    return _withFlagZ(z);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withFlagZ(bool z) native "Int32x4_setFlagZ";
-
-  @pragma("vm:prefer-inline", _Int32x4)
-  Int32x4 withFlagW(bool w) {
-    _throwIfNull(w, 'w');
-    return _withFlagW(w);
-  }
-
-  @pragma("vm:exact-result-type", _Int32x4)
-  Int32x4 _withFlagW(bool w) native "Int32x4_setFlagW";
-
-  @pragma("vm:exact-result-type", _Float32x4)
-  Float32x4 select(Float32x4 trueValue, Float32x4 falseValue)
-      native "Int32x4_select";
-}
-
-@patch
-class Float64x2 {
-  @patch
-  @pragma("vm:prefer-inline")
-  factory Float64x2(double x, double y) {
-    _throwIfNull(x, 'x');
-    _throwIfNull(y, 'y');
-    return _Float64x2FromDoubles(x, y);
-  }
-
-  @pragma("vm:exact-result-type", _Float64x2)
-  static _Float64x2 _Float64x2FromDoubles(double x, double y)
-      native "Float64x2_fromDoubles";
-
-  @patch
-  @pragma("vm:prefer-inline")
-  factory Float64x2.splat(double v) {
-    _throwIfNull(v, 'v');
-    return _Float64x2Splat(v);
-  }
-
-  @pragma("vm:exact-result-type", _Float64x2)
-  static _Float64x2 _Float64x2Splat(double v) native "Float64x2_splat";
-
-  @patch
-  @pragma("vm:exact-result-type", _Float64x2)
-  factory Float64x2.zero() native "Float64x2_zero";
-
-  @patch
-  @pragma("vm:exact-result-type", _Float64x2)
-  factory Float64x2.fromFloat32x4(Float32x4 v) native "Float64x2_fromFloat32x4";
-}
-
-@pragma("vm:entry-point")
-class _Float64x2 implements Float64x2 {
-  Float64x2 operator +(Float64x2 other) native "Float64x2_add";
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 operator -() native "Float64x2_negate";
-  Float64x2 operator -(Float64x2 other) native "Float64x2_sub";
-  Float64x2 operator *(Float64x2 other) native "Float64x2_mul";
-  Float64x2 operator /(Float64x2 other) native "Float64x2_div";
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 scale(double s) native "Float64x2_scale";
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 abs() native "Float64x2_abs";
-  Float64x2 clamp(Float64x2 lowerLimit, Float64x2 upperLimit)
-      native "Float64x2_clamp";
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double get x native "Float64x2_getX";
-  @pragma("vm:exact-result-type", "dart:core#_Double")
-  double get y native "Float64x2_getY";
-  int get signMask native "Float64x2_getSignMask";
-
-  @pragma("vm:prefer-inline")
-  Float64x2 withX(double x) {
-    _throwIfNull(x, 'x');
-    return _withX(x);
-  }
-
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 _withX(double x) native "Float64x2_setX";
-
-  @pragma("vm:prefer-inline")
-  Float64x2 withY(double y) {
-    _throwIfNull(y, 'y');
-    return _withY(y);
-  }
-
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 _withY(double y) native "Float64x2_setY";
-
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 min(Float64x2 other) native "Float64x2_min";
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 max(Float64x2 other) native "Float64x2_max";
-  @pragma("vm:exact-result-type", _Float64x2)
-  Float64x2 sqrt() native "Float64x2_sqrt";
-}
-
-class _TypedListIterator<E> implements Iterator<E> {
-  final List<E> _array;
-  final int _length;
-  int _position;
-  E? _current;
-
-  _TypedListIterator(List<E> array)
-      : _array = array,
-        _length = array.length,
-        _position = -1 {
-    assert(array is _TypedList || array is _TypedListView);
-  }
-
-  bool moveNext() {
-    int nextPosition = _position + 1;
-    if (nextPosition < _length) {
-      _current = _array[nextPosition];
-      _position = nextPosition;
-      return true;
-    }
-    _position = _length;
-    _current = null;
-    return false;
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-}
-
-abstract class _TypedListView extends _TypedListBase implements TypedData {
-  // Method(s) implementing the TypedData interface.
-
-  int get lengthInBytes {
-    return length * elementSizeInBytes;
-  }
-
-  _ByteBuffer get buffer {
-    return _typedData.buffer;
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:prefer-inline")
-  _TypedList get _typedData native "TypedDataView_typedData";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get offsetInBytes native "TypedDataView_offsetInBytes";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "TypedDataView_length";
-}
-
-@pragma("vm:entry-point")
-class _Int8ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Int8List>
-    implements Int8List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Int8ArrayView)
-  factory _Int8ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Int8ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getInt8(offsetInBytes + (index * Int8List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setInt8(
-        offsetInBytes + (index * Int8List.bytesPerElement), _toInt8(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int8List _createList(int length) {
-    return new Int8List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint8ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Uint8List>
-    implements Uint8List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Uint8ArrayView)
-  factory _Uint8ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Uint8ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getUint8(offsetInBytes + (index * Uint8List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setUint8(
-        offsetInBytes + (index * Uint8List.bytesPerElement), _toUint8(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Uint8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint8List _createList(int length) {
-    return new Uint8List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint8ClampedArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Uint8ClampedList>
-    implements Uint8ClampedList {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Uint8ClampedArrayView)
-  factory _Uint8ClampedArrayView._(_TypedList buffer, int offsetInBytes,
-      int length) native "TypedDataView_Uint8ClampedArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getUint8(offsetInBytes + (index * Uint8List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setUint8(offsetInBytes + (index * Uint8List.bytesPerElement),
-        _toClampedUint8(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Uint8List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint8ClampedList _createList(int length) {
-    return new Uint8ClampedList(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int16ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Int16List>
-    implements Int16List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Int16ArrayView)
-  factory _Int16ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Int16ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getInt16(offsetInBytes + (index * Int16List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setInt16(
-        offsetInBytes + (index * Int16List.bytesPerElement), _toInt16(value));
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable,
-      [int skipCount = 0]) {
-    if (iterable is CodeUnits) {
-      end = RangeError.checkValidRange(start, end, this.length);
-      int length = end - start;
-      int byteStart = this.offsetInBytes + start * Int16List.bytesPerElement;
-      _typedData._setCodeUnits(iterable, byteStart, length, skipCount);
-    } else {
-      super.setRange(start, end, iterable, skipCount);
-    }
-  }
-
-  // Method(s) implementing TypedData interface.
-
-  int get elementSizeInBytes {
-    return Int16List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int16List _createList(int length) {
-    return new Int16List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint16ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Uint16List>
-    implements Uint16List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Uint16ArrayView)
-  factory _Uint16ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Uint16ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getUint16(offsetInBytes + (index * Uint16List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setUint16(
-        offsetInBytes + (index * Uint16List.bytesPerElement), _toUint16(value));
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable,
-      [int skipCount = 0]) {
-    if (iterable is CodeUnits) {
-      end = RangeError.checkValidRange(start, end, this.length);
-      int length = end - start;
-      int byteStart = this.offsetInBytes + start * Uint16List.bytesPerElement;
-      _typedData._setCodeUnits(iterable, byteStart, length, skipCount);
-    } else {
-      super.setRange(start, end, iterable, skipCount);
-    }
-  }
-
-  // Method(s) implementing TypedData interface.
-
-  int get elementSizeInBytes {
-    return Uint16List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-
-  Uint16List _createList(int length) {
-    return new Uint16List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int32ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Int32List>
-    implements Int32List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Int32ArrayView)
-  factory _Int32ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Int32ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getInt32(offsetInBytes + (index * Int32List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setInt32(
-        offsetInBytes + (index * Int32List.bytesPerElement), _toInt32(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int32List _createList(int length) {
-    return new Int32List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint32ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Uint32List>
-    implements Uint32List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Uint32ArrayView)
-  factory _Uint32ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Uint32ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getUint32(offsetInBytes + (index * Uint32List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setUint32(
-        offsetInBytes + (index * Uint32List.bytesPerElement), _toUint32(value));
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Uint32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint32List _createList(int length) {
-    return new Uint32List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int64ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Int64List>
-    implements Int64List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Int64ArrayView)
-  factory _Int64ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Int64ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getInt64(offsetInBytes + (index * Int64List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setInt64(
-        offsetInBytes + (index * Int64List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int64List _createList(int length) {
-    return new Int64List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Uint64ArrayView extends _TypedListView
-    with _IntListMixin, _TypedIntListMixin<Uint64List>
-    implements Uint64List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Uint64ArrayView)
-  factory _Uint64ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Uint64ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  int operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getUint64(offsetInBytes + (index * Uint64List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, int value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setUint64(
-        offsetInBytes + (index * Uint64List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Uint64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Uint64List _createList(int length) {
-    return new Uint64List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float32ArrayView extends _TypedListView
-    with _DoubleListMixin, _TypedDoubleListMixin<Float32List>
-    implements Float32List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Float32ArrayView)
-  factory _Float32ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Float32ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  double operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getFloat32(offsetInBytes + (index * Float32List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, double value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setFloat32(
-        offsetInBytes + (index * Float32List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Float32List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float32List _createList(int length) {
-    return new Float32List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float64ArrayView extends _TypedListView
-    with _DoubleListMixin, _TypedDoubleListMixin<Float64List>
-    implements Float64List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Float64ArrayView)
-  factory _Float64ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Float64ArrayView_new";
-
-  // Method(s) implementing List interface.
-  @pragma("vm:prefer-inline")
-  double operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getFloat64(offsetInBytes + (index * Float64List.bytesPerElement));
-  }
-
-  @pragma("vm:prefer-inline")
-  void operator []=(int index, double value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setFloat64(
-        offsetInBytes + (index * Float64List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Float64List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float64List _createList(int length) {
-    return new Float64List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float32x4ArrayView extends _TypedListView
-    with _Float32x4ListMixin
-    implements Float32x4List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Float32x4ArrayView)
-  factory _Float32x4ArrayView._(_TypedList buffer, int offsetInBytes,
-      int length) native "TypedDataView_Float32x4ArrayView_new";
-
-  // Method(s) implementing List interface.
-  Float32x4 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getFloat32x4(offsetInBytes + (index * Float32x4List.bytesPerElement));
-  }
-
-  void operator []=(int index, Float32x4 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setFloat32x4(
-        offsetInBytes + (index * Float32x4List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Float32x4List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float32x4List _createList(int length) {
-    return new Float32x4List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Int32x4ArrayView extends _TypedListView
-    with _Int32x4ListMixin
-    implements Int32x4List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Int32x4ArrayView)
-  factory _Int32x4ArrayView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_Int32x4ArrayView_new";
-
-  // Method(s) implementing List interface.
-  Int32x4 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getInt32x4(offsetInBytes + (index * Int32x4List.bytesPerElement));
-  }
-
-  void operator []=(int index, Int32x4 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setInt32x4(
-        offsetInBytes + (index * Int32x4List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Int32x4List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Int32x4List _createList(int length) {
-    return new Int32x4List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _Float64x2ArrayView extends _TypedListView
-    with _Float64x2ListMixin
-    implements Float64x2List {
-  // Constructor.
-  @pragma("vm:exact-result-type", _Float64x2ArrayView)
-  factory _Float64x2ArrayView._(_TypedList buffer, int offsetInBytes,
-      int length) native "TypedDataView_Float64x2ArrayView_new";
-
-  // Method(s) implementing List interface.
-  Float64x2 operator [](int index) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _typedData
-        ._getFloat64x2(offsetInBytes + (index * Float64x2List.bytesPerElement));
-  }
-
-  void operator []=(int index, Float64x2 value) {
-    if (index < 0 || index >= length) {
-      throw new RangeError.index(index, this, "index");
-    }
-    _typedData._setFloat64x2(
-        offsetInBytes + (index * Float64x2List.bytesPerElement), value);
-  }
-
-  // Method(s) implementing TypedData interface.
-  int get elementSizeInBytes {
-    return Float64x2List.bytesPerElement;
-  }
-
-  // Internal utility methods.
-  Float64x2List _createList(int length) {
-    return new Float64x2List(length);
-  }
-}
-
-@pragma("vm:entry-point")
-class _ByteDataView implements ByteData {
-  @pragma("vm:exact-result-type", _ByteDataView)
-  factory _ByteDataView._(_TypedList buffer, int offsetInBytes, int length)
-      native "TypedDataView_ByteDataView_new";
-
-  // Method(s) implementing TypedData interface.
-  _ByteBuffer get buffer {
-    return _typedData.buffer;
-  }
-
-  int get lengthInBytes {
-    return length;
-  }
-
-  int get elementSizeInBytes {
-    return 1;
-  }
-
-  // Method(s) implementing ByteData interface.
-
-  @pragma("vm:prefer-inline")
-  int getInt8(int byteOffset) {
-    if (byteOffset < 0 || byteOffset >= length) {
-      throw new RangeError.index(byteOffset, this, "byteOffset");
-    }
-    return _typedData._getInt8(offsetInBytes + byteOffset);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setInt8(int byteOffset, int value) {
-    if (byteOffset < 0 || byteOffset >= length) {
-      throw new RangeError.index(byteOffset, this, "byteOffset");
-    }
-    _typedData._setInt8(offsetInBytes + byteOffset, value);
-  }
-
-  @pragma("vm:prefer-inline")
-  int getUint8(int byteOffset) {
-    if (byteOffset < 0 || byteOffset >= length) {
-      throw new RangeError.index(byteOffset, this, "byteOffset");
-    }
-    return _typedData._getUint8(offsetInBytes + byteOffset);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setUint8(int byteOffset, int value) {
-    if (byteOffset < 0 || byteOffset >= length) {
-      throw new RangeError.index(byteOffset, this, "byteOffset");
-    }
-    _typedData._setUint8(offsetInBytes + byteOffset, value);
-  }
-
-  @pragma("vm:prefer-inline")
-  int getInt16(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 1 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
-    }
-    var result = _typedData._getInt16(offsetInBytes + byteOffset);
-    if (identical(endian, Endian.host)) {
-      return result;
-    }
-    return _byteSwap16(result).toSigned(16);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setInt16(int byteOffset, int value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 1 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
-    }
-    _typedData._setInt16(offsetInBytes + byteOffset,
-        identical(endian, Endian.host) ? value : _byteSwap16(value));
-  }
-
-  @pragma("vm:prefer-inline")
-  int getUint16(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 1 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
-    }
-    var result = _typedData._getUint16(offsetInBytes + byteOffset);
-    if (identical(endian, Endian.host)) {
-      return result;
-    }
-    return _byteSwap16(result);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setUint16(int byteOffset, int value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 1 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 2, "byteOffset");
-    }
-    _typedData._setUint16(offsetInBytes + byteOffset,
-        identical(endian, Endian.host) ? value : _byteSwap16(value));
-  }
-
-  @pragma("vm:prefer-inline")
-  int getInt32(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    var result = _typedData._getInt32(offsetInBytes + byteOffset);
-    if (identical(endian, Endian.host)) {
-      return result;
-    }
-    return _byteSwap32(result).toSigned(32);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setInt32(int byteOffset, int value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    _typedData._setInt32(offsetInBytes + byteOffset,
-        identical(endian, Endian.host) ? value : _byteSwap32(value));
-  }
-
-  @pragma("vm:prefer-inline")
-  int getUint32(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    var result = _typedData._getUint32(offsetInBytes + byteOffset);
-    if (identical(endian, Endian.host)) {
-      return result;
-    }
-    return _byteSwap32(result);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setUint32(int byteOffset, int value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    _typedData._setUint32(offsetInBytes + byteOffset,
-        identical(endian, Endian.host) ? value : _byteSwap32(value));
-  }
-
-  @pragma("vm:prefer-inline")
-  int getInt64(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 7 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
-    }
-    var result = _typedData._getInt64(offsetInBytes + byteOffset);
-    if (identical(endian, Endian.host)) {
-      return result;
-    }
-    return _byteSwap64(result).toSigned(64);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setInt64(int byteOffset, int value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 7 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
-    }
-    _typedData._setInt64(offsetInBytes + byteOffset,
-        identical(endian, Endian.host) ? value : _byteSwap64(value));
-  }
-
-  @pragma("vm:prefer-inline")
-  int getUint64(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 7 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
-    }
-    var result = _typedData._getUint64(offsetInBytes + byteOffset);
-    if (identical(endian, Endian.host)) {
-      return result;
-    }
-    return _byteSwap64(result);
-  }
-
-  @pragma("vm:prefer-inline")
-  void setUint64(int byteOffset, int value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 7 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
-    }
-    _typedData._setUint64(offsetInBytes + byteOffset,
-        identical(endian, Endian.host) ? value : _byteSwap64(value));
-  }
-
-  @pragma("vm:prefer-inline")
-  double getFloat32(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    if (identical(endian, Endian.host)) {
-      return _typedData._getFloat32(offsetInBytes + byteOffset);
-    }
-    _convU32[0] =
-        _byteSwap32(_typedData._getUint32(offsetInBytes + byteOffset));
-    return _convF32[0];
-  }
-
-  @pragma("vm:prefer-inline")
-  void setFloat32(int byteOffset, double value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    if (identical(endian, Endian.host)) {
-      _typedData._setFloat32(offsetInBytes + byteOffset, value);
-      return;
-    }
-    _convF32[0] = value;
-    _typedData._setUint32(offsetInBytes + byteOffset, _byteSwap32(_convU32[0]));
-  }
-
-  @pragma("vm:prefer-inline")
-  double getFloat64(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 7 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
-    }
-    if (identical(endian, Endian.host)) {
-      return _typedData._getFloat64(offsetInBytes + byteOffset);
-    }
-    _convU64[0] =
-        _byteSwap64(_typedData._getUint64(offsetInBytes + byteOffset));
-    return _convF64[0];
-  }
-
-  @pragma("vm:prefer-inline")
-  void setFloat64(int byteOffset, double value, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 7 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 8, "byteOffset");
-    }
-    if (identical(endian, Endian.host)) {
-      _typedData._setFloat64(offsetInBytes + byteOffset, value);
-      return;
-    }
-    _convF64[0] = value;
-    _typedData._setUint64(offsetInBytes + byteOffset, _byteSwap64(_convU64[0]));
-  }
-
-  Float32x4 getFloat32x4(int byteOffset, [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    // TODO(johnmccutchan) : Need to resolve this for endianity.
-    return _typedData._getFloat32x4(offsetInBytes + byteOffset);
-  }
-
-  void setFloat32x4(int byteOffset, Float32x4 value,
-      [Endian endian = Endian.big]) {
-    if (byteOffset < 0 || byteOffset + 3 >= length) {
-      throw new RangeError.range(byteOffset, 0, length - 4, "byteOffset");
-    }
-    // TODO(johnmccutchan) : Need to resolve this for endianity.
-    _typedData._setFloat32x4(offsetInBytes + byteOffset, value);
-  }
-
-  @pragma("vm:non-nullable-result-type")
-  @pragma("vm:prefer-inline")
-  _TypedList get _typedData native "TypedDataView_typedData";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get offsetInBytes native "TypedDataView_offsetInBytes";
-
-  @pragma("vm:exact-result-type", "dart:core#_Smi")
-  @pragma("vm:prefer-inline")
-  int get length native "TypedDataView_length";
-}
-
-@pragma("vm:prefer-inline")
-int _byteSwap16(int value) {
-  return ((value & 0xFF00) >> 8) | ((value & 0x00FF) << 8);
-}
-
-@pragma("vm:prefer-inline")
-int _byteSwap32(int value) {
-  value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
-  value = ((value & 0xFFFF0000) >> 16) | ((value & 0x0000FFFF) << 16);
-  return value;
-}
-
-@pragma("vm:prefer-inline")
-int _byteSwap64(int value) {
-  return (_byteSwap32(value) << 32) | _byteSwap32(value >> 32);
-}
-
-final _convU32 = new Uint32List(2);
-final _convU64 = new Uint64List.view(_convU32.buffer);
-final _convF32 = new Float32List.view(_convU32.buffer);
-final _convF64 = new Float64List.view(_convU32.buffer);
-
-// Top level utility methods.
-@pragma("vm:prefer-inline")
-int _toInt(int value, int mask) {
-  value &= mask;
-  if (value > (mask >> 1)) value -= mask + 1;
-  return value;
-}
-
-@pragma("vm:prefer-inline")
-int _toInt8(int value) {
-  return _toInt(value, 0xFF);
-}
-
-@pragma("vm:prefer-inline")
-int _toUint8(int value) {
-  return value & 0xFF;
-}
-
-@pragma("vm:exact-result-type", "dart:core#_Smi")
-int _toClampedUint8(int value) {
-  if (value < 0) return 0;
-  if (value > 0xFF) return 0xFF;
-  return value;
-}
-
-@pragma("vm:prefer-inline")
-int _toInt16(int value) {
-  return _toInt(value, 0xFFFF);
-}
-
-@pragma("vm:prefer-inline")
-int _toUint16(int value) {
-  return value & 0xFFFF;
-}
-
-@pragma("vm:prefer-inline")
-int _toInt32(int value) {
-  return _toInt(value, 0xFFFFFFFF);
-}
-
-@pragma("vm:prefer-inline")
-int _toUint32(int value) {
-  return value & 0xFFFFFFFF;
-}
-
-@pragma("vm:prefer-inline")
-void _throwIfNull(val, String name) {
-  if (val == null) {
-    throw ArgumentError.notNull(name);
-  }
-}
-
-// In addition to explicitly checking the range, this method implicitly ensures
-// that all arguments are non-null (a no such method error gets thrown
-// otherwise).
-void _rangeCheck(int listLength, int start, int length) {
-  if (length < 0) {
-    throw new RangeError.value(length);
-  }
-  if (start < 0) {
-    throw new RangeError.value(start);
-  }
-  if (start + length > listLength) {
-    throw new RangeError.value(start + length);
-  }
-}
-
-void _offsetAlignmentCheck(int offset, int alignment) {
-  if ((offset % alignment) != 0) {
-    throw new RangeError('Offset ($offset) must be a multiple of '
-        'BYTES_PER_ELEMENT ($alignment)');
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/uri_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/uri_patch.dart
deleted file mode 100644
index de10c9e..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/uri_patch.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// part of "core_patch.dart";
-
-typedef Uri _UriBaseClosure();
-
-Uri _unsupportedUriBase() {
-  throw new UnsupportedError("'Uri.base' is not supported");
-}
-
-// _uriBaseClosure can be overwritten by the embedder to supply a different
-// value for Uri.base.
-@pragma("vm:entry-point")
-_UriBaseClosure _uriBaseClosure = _unsupportedUriBase;
-
-@patch
-class Uri {
-  @patch
-  static Uri get base => _uriBaseClosure();
-}
-
-/// VM implementation of Uri.
-@patch
-class _Uri {
-  static final bool _isWindowsCached = _isWindowsPlatform;
-
-  static bool get _isWindowsPlatform native "Uri_isWindowsPlatform";
-
-  @patch
-  static bool get _isWindows => _isWindowsCached;
-
-  @patch
-  static String _uriEncode(List<int> canonicalTable, String text,
-      Encoding encoding, bool spaceToPlus) {
-    // First check if the text will be changed by encoding.
-    int i = 0;
-    if (identical(encoding, utf8) ||
-        identical(encoding, latin1) ||
-        identical(encoding, ascii)) {
-      // Encoding is compatible with the original string.
-      // Find first character that needs encoding.
-      for (; i < text.length; i++) {
-        var char = text.codeUnitAt(i);
-        if (char >= 128 ||
-            canonicalTable[char >> 4] & (1 << (char & 0x0f)) == 0) {
-          break;
-        }
-      }
-    }
-    if (i == text.length) return text;
-
-    // Encode the string into bytes then generate an ASCII only string
-    // by percent encoding selected bytes.
-    StringBuffer result = new StringBuffer();
-    for (int j = 0; j < i; j++) {
-      result.writeCharCode(text.codeUnitAt(j));
-    }
-
-    // TODO(lrn): Is there a way to only encode from index i and forwards.
-    var bytes = encoding.encode(text);
-    for (; i < bytes.length; i++) {
-      int byte = bytes[i];
-      if (byte < 128 &&
-          ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
-        result.writeCharCode(byte);
-      } else if (spaceToPlus && byte == _SPACE) {
-        result.writeCharCode(_PLUS);
-      } else {
-        const String hexDigits = '0123456789ABCDEF';
-        result
-          ..writeCharCode(_PERCENT)
-          ..writeCharCode(hexDigits.codeUnitAt(byte >> 4))
-          ..writeCharCode(hexDigits.codeUnitAt(byte & 0x0f));
-      }
-    }
-    return result.toString();
-  }
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/wasm_patch.dart b/sdk_nnbd/lib/_internal/vm/lib/wasm_patch.dart
deleted file mode 100644
index f3a996d..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/wasm_patch.dart
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:_internal' show patch;
-import "dart:nativewrappers" show NativeFieldWrapperClass1;
-import 'dart:typed_data';
-
-@patch
-@pragma("vm:entry-point")
-class Int32 {}
-
-@patch
-@pragma("vm:entry-point")
-class Int64 {}
-
-@patch
-@pragma("vm:entry-point")
-class Float {}
-
-@patch
-@pragma("vm:entry-point")
-class Double {}
-
-@patch
-@pragma("vm:entry-point")
-class Void {}
-
-@patch
-class WasmModule {
-  @patch
-  factory WasmModule(Uint8List data) {
-    return _NativeWasmModule(data);
-  }
-}
-
-@patch
-class WasmMemory {
-  @patch
-  factory WasmMemory(int initialPages, [int? maxPages]) {
-    return _NativeWasmMemory(initialPages, maxPages);
-  }
-}
-
-@patch
-class WasmImports {
-  @patch
-  factory WasmImports() {
-    return _NativeWasmImports();
-  }
-}
-
-class _NativeWasmModule extends NativeFieldWrapperClass1 implements WasmModule {
-  _NativeWasmModule(Uint8List data) {
-    _init(data);
-  }
-
-  WasmInstance instantiate(covariant _NativeWasmImports imports) {
-    return _NativeWasmInstance(this, imports);
-  }
-
-  void _init(Uint8List data) native 'Wasm_initModule';
-  String describe() native 'Wasm_describeModule';
-}
-
-class _NativeWasmImports extends NativeFieldWrapperClass1
-    implements WasmImports {
-  List<WasmMemory> _memories;
-  List<Function> _fns;
-
-  _NativeWasmImports()
-      : _memories = [],
-        _fns = [] {
-    _init();
-  }
-
-  void addMemory(String moduleName, String name, WasmMemory memory) {
-    _memories.add(memory);
-    _addMemory(moduleName, name, memory);
-  }
-
-  void addGlobal<T>(String moduleName, String name, num value, bool mutable) {
-    _addGlobal(moduleName, name, value, T, mutable);
-  }
-
-  void addFunction<T extends Function>(
-      String moduleName, String name, Function fn) {
-    int id = _fns.length;
-    _fns.add(fn);
-    _addFunction(moduleName, name, id, T);
-  }
-
-  @pragma("vm:entry-point")
-  static Function getFunction(_NativeWasmImports imp, int id) {
-    return imp._fns[id];
-  }
-
-  void _init() native 'Wasm_initImports';
-  void _addMemory(String moduleName, String name, WasmMemory memory)
-      native 'Wasm_addMemoryImport';
-  void _addGlobal(String moduleName, String name, num value, Type type,
-      bool mutable) native 'Wasm_addGlobalImport';
-  void _addFunction(String moduleName, String name, int id, Type type)
-      native 'Wasm_addFunctionImport';
-}
-
-class _NativeWasmMemory extends NativeFieldWrapperClass1 implements WasmMemory {
-  late int _pages;
-  late Uint8List _buffer;
-
-  _NativeWasmMemory(int initialPages, int? maxPages) {
-    _buffer = _init(initialPages, maxPages);
-    _pages = initialPages;
-  }
-
-  _NativeWasmMemory.fromInstance(_NativeWasmInstance inst) {
-    _buffer = _initFromInstance(inst);
-    _pages = _getPages();
-  }
-
-  int get lengthInPages => _pages;
-  int get lengthInBytes => _buffer.lengthInBytes;
-  int operator [](int index) => _buffer[index];
-  void operator []=(int index, int value) {
-    _buffer[index] = value;
-  }
-
-  int grow(int deltaPages) {
-    int oldPages = _pages;
-    _buffer = _grow(deltaPages);
-    _pages += deltaPages;
-    return oldPages;
-  }
-
-  Uint8List _init(int initialPages, int? maxPages) native 'Wasm_initMemory';
-  Uint8List _grow(int deltaPages) native 'Wasm_growMemory';
-  Uint8List _initFromInstance(_NativeWasmInstance inst)
-      native 'Wasm_initMemoryFromInstance';
-  int _getPages() native 'Wasm_getMemoryPages';
-}
-
-class _NativeWasmInstance extends NativeFieldWrapperClass1
-    implements WasmInstance {
-  _NativeWasmModule _module;
-  _NativeWasmImports _imports;
-
-  _NativeWasmInstance(_NativeWasmModule module, _NativeWasmImports imports)
-      : _module = module,
-        _imports = imports {
-    _init(module, imports);
-  }
-
-  WasmFunction<T> lookupFunction<T extends Function>(String name) {
-    return _NativeWasmFunction<T>(this, name);
-  }
-
-  WasmMemory get memory {
-    return _NativeWasmMemory.fromInstance(this);
-  }
-
-  void _init(_NativeWasmModule module, _NativeWasmImports imports)
-      native 'Wasm_initInstance';
-}
-
-class _NativeWasmFunction<T extends Function> extends NativeFieldWrapperClass1
-    implements WasmFunction<T> {
-  _NativeWasmInstance _inst;
-
-  _NativeWasmFunction(_NativeWasmInstance inst, String name) : _inst = inst {
-    _init(inst, name, T);
-  }
-
-  num call(List<num> args) {
-    var arg_copy = List<num>.from(args, growable: false);
-    return _call(arg_copy);
-  }
-
-  void _init(_NativeWasmInstance inst, String name, Type fnType)
-      native 'Wasm_initFunction';
-  num _call(List<num> args) native 'Wasm_callFunction';
-}
diff --git a/sdk_nnbd/lib/_internal/vm/lib/weak_property.dart b/sdk_nnbd/lib/_internal/vm/lib/weak_property.dart
deleted file mode 100644
index bc903e9..0000000
--- a/sdk_nnbd/lib/_internal/vm/lib/weak_property.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// part of "core_patch.dart";
-
-@pragma("vm:entry-point")
-class _WeakProperty {
-  factory _WeakProperty(key, value) => _new(key, value);
-
-  get key => _getKey();
-  get value => _getValue();
-  set value(value) => _setValue(value);
-
-  static _WeakProperty _new(key, value) native "WeakProperty_new";
-
-  _getKey() native "WeakProperty_getKey";
-  _getValue() native "WeakProperty_getValue";
-  _setValue(value) native "WeakProperty_setValue";
-}
diff --git a/sdk_nnbd/lib/async/async.dart b/sdk_nnbd/lib/async/async.dart
deleted file mode 100644
index 8cce959..0000000
--- a/sdk_nnbd/lib/async/async.dart
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/**
- * Support for asynchronous programming,
- * with classes such as Future and Stream.
- *
- * Understanding [Future]s and [Stream]s is a prerequisite for
- * writing just about any Dart program.
- *
- * To use this library in your code:
- *
- *     import 'dart:async';
- *
- * ## Future
- *
- * A Future object represents a computation whose return value
- * might not yet be available.
- * The Future returns the value of the computation
- * when it completes at some time in the future.
- * Futures are often used for potentially lengthy computations
- * such as I/O and interaction with users.
- *
- * Many methods in the Dart libraries return Futures when
- * performing tasks. For example, when binding an HttpServer
- * to a host and port, the `bind()` method returns a Future.
- *
- *      HttpServer.bind('127.0.0.1', 4444)
- *          .then((server) => print('${server.isBroadcast}'))
- *          .catchError(print);
- *
- * [Future.then] registers a callback function that runs
- * when the Future's operation, in this case the `bind()` method,
- * completes successfully.
- * The value returned by the operation
- * is passed into the callback function.
- * In this example, the `bind()` method returns the HttpServer
- * object. The callback function prints one of its properties.
- * [Future.catchError] registers a callback function that
- * runs if an error occurs within the Future.
- *
- * ## Stream
- *
- * A Stream provides an asynchronous sequence of data.
- * Examples of data sequences include individual events, like mouse clicks,
- * or sequential chunks of larger data, like multiple byte lists with the
- * contents of a file
- * such as mouse clicks, and a stream of byte lists read from a file.
- * The following example opens a file for reading.
- * [Stream.listen] registers a callback function that runs
- * each time more data is available.
- *
- *     Stream<List<int>> stream = new File('quotes.txt').openRead();
- *     stream.transform(utf8.decoder).listen(print);
- *
- * The stream emits a sequence of a list of bytes.
- * The program must interpret the bytes or handle the raw byte data.
- * Here, the code uses a UTF-8 decoder (provided in the `dart:convert` library)
- * to convert the sequence of bytes into a sequence
- * of Dart strings.
- *
- * Another common use of streams is for user-generated events
- * in a web app: The following code listens for mouse clicks on a button.
- *
- *     querySelector('#myButton').onClick.listen((_) => print('Click.'));
- *
- * ## Other resources
- *
- * * The [dart:async section of the library tour][asynchronous-programming]:
- *   A brief overview of asynchronous programming.
- *
- * * [Use Future-Based APIs][futures-tutorial]: A closer look at Futures and
- *   how to use them to write asynchronous Dart code.
- *
- * * [Futures and Error Handling][futures-error-handling]: Everything you
- *   wanted to know about handling errors and exceptions when working with
- *   Futures (but were afraid to ask).
- *
- * * [The Event Loop and Dart](https://www.dartlang.org/articles/event-loop/):
- *   Learn how Dart handles the event queue and microtask queue, so you can
- *   write better asynchronous code with fewer surprises.
- *
- * * [test package: Asynchronous Tests][test-readme]: How to test asynchronous
- *   code.
- *
- * [asynchronous-programming]: https://www.dartlang.org/docs/dart-up-and-running/ch03.html#dartasync---asynchronous-programming
- * [futures-tutorial]: https://www.dartlang.org/docs/tutorials/futures/
- * [futures-error-handling]: https://www.dartlang.org/articles/futures-and-error-handling/
- * [test-readme]: https://pub.dev/packages/test
- *
- * {@category Core}
- */
-library dart.async;
-
-import "dart:collection" show HashMap;
-import "dart:_internal"
-    show
-        CastStream,
-        CastStreamTransformer,
-        EmptyIterator,
-        IterableElementError,
-        printToZone,
-        printToConsole,
-        Since,
-        typeAcceptsNull;
-
-part 'async_error.dart';
-part 'broadcast_stream_controller.dart';
-part 'deferred_load.dart';
-part 'future.dart';
-part 'future_impl.dart';
-part 'schedule_microtask.dart';
-part 'stream.dart';
-part 'stream_controller.dart';
-part 'stream_impl.dart';
-part 'stream_pipe.dart';
-part 'stream_transformers.dart';
-part 'timer.dart';
-part 'zone.dart';
diff --git a/sdk_nnbd/lib/async/async_error.dart b/sdk_nnbd/lib/async/async_error.dart
deleted file mode 100644
index a7172bd..0000000
--- a/sdk_nnbd/lib/async/async_error.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-_invokeErrorHandler(
-    Function errorHandler, Object error, StackTrace stackTrace) {
-  var handler = errorHandler; // Rename to avoid promotion.
-  if (handler is ZoneBinaryCallback<dynamic, Never, Never>) {
-    // Dynamic invocation because we don't know the actual type of the
-    // first argument or the error object, but we should successfully call
-    // the handler if they match up.
-    return errorHandler(error, stackTrace);
-  } else {
-    return errorHandler(error);
-  }
-}
diff --git a/sdk_nnbd/lib/async/async_sources.gni b/sdk_nnbd/lib/async/async_sources.gni
deleted file mode 100644
index 3299cd4..0000000
--- a/sdk_nnbd/lib/async/async_sources.gni
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# This file contains all sources for the dart:async library.
-async_sdk_sources = [
-  "async.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "async_error.dart",
-  "broadcast_stream_controller.dart",
-  "deferred_load.dart",
-  "future.dart",
-  "future_impl.dart",
-  "schedule_microtask.dart",
-  "stream.dart",
-  "stream_controller.dart",
-  "stream_impl.dart",
-  "stream_pipe.dart",
-  "stream_transformers.dart",
-  "timer.dart",
-  "zone.dart",
-]
diff --git a/sdk_nnbd/lib/async/broadcast_stream_controller.dart b/sdk_nnbd/lib/async/broadcast_stream_controller.dart
deleted file mode 100644
index c362eea..0000000
--- a/sdk_nnbd/lib/async/broadcast_stream_controller.dart
+++ /dev/null
@@ -1,528 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-class _BroadcastStream<T> extends _ControllerStream<T> {
-  _BroadcastStream(_StreamControllerLifecycle<T> controller)
-      : super(controller);
-
-  bool get isBroadcast => true;
-}
-
-class _BroadcastSubscription<T> extends _ControllerSubscription<T> {
-  static const int _STATE_EVENT_ID = 1;
-  static const int _STATE_FIRING = 2;
-  static const int _STATE_REMOVE_AFTER_FIRING = 4;
-  // TODO(lrn): Use the _state field on _ControllerSubscription to
-  // also store this state. Requires that the subscription implementation
-  // does not assume that it's use of the state integer is the only use.
-  int _eventState = 0; // Initialized to help dart2js type inference.
-
-  _BroadcastSubscription<T>? _next;
-  _BroadcastSubscription<T>? _previous;
-
-  _BroadcastSubscription(
-      _StreamControllerLifecycle<T> controller,
-      void onData(T data)?,
-      Function? onError,
-      void onDone()?,
-      bool cancelOnError)
-      : super(controller, onData, onError, onDone, cancelOnError) {
-    _next = _previous = this;
-  }
-
-  bool _expectsEvent(int eventId) => (_eventState & _STATE_EVENT_ID) == eventId;
-
-  void _toggleEventId() {
-    _eventState ^= _STATE_EVENT_ID;
-  }
-
-  bool get _isFiring => (_eventState & _STATE_FIRING) != 0;
-
-  void _setRemoveAfterFiring() {
-    assert(_isFiring);
-    _eventState |= _STATE_REMOVE_AFTER_FIRING;
-  }
-
-  bool get _removeAfterFiring =>
-      (_eventState & _STATE_REMOVE_AFTER_FIRING) != 0;
-
-  // The controller._recordPause doesn't do anything for a broadcast controller,
-  // so we don't bother calling it.
-  void _onPause() {}
-
-  // The controller._recordResume doesn't do anything for a broadcast
-  // controller, so we don't bother calling it.
-  void _onResume() {}
-
-  // _onCancel is inherited.
-}
-
-abstract class _BroadcastStreamController<T>
-    implements _StreamControllerBase<T> {
-  static const int _STATE_INITIAL = 0;
-  static const int _STATE_EVENT_ID = 1;
-  static const int _STATE_FIRING = 2;
-  static const int _STATE_CLOSED = 4;
-  static const int _STATE_ADDSTREAM = 8;
-
-  void Function()? onListen;
-  FutureOr<void> Function()? onCancel;
-
-  // State of the controller.
-  int _state;
-
-  // Double-linked list of active listeners.
-  _BroadcastSubscription<T>? _firstSubscription;
-  _BroadcastSubscription<T>? _lastSubscription;
-
-  // Extra state used during an [addStream] call.
-  _AddStreamState<T>? _addStreamState;
-
-  /**
-   * Future returned by [close] and [done].
-   *
-   * The future is completed whenever the done event has been sent to all
-   * relevant listeners.
-   * The relevant listeners are the ones that were listening when [close] was
-   * called. When all of these have been canceled (sending the done event makes
-   * them cancel, but they can also be canceled before sending the event),
-   * this future completes.
-   *
-   * Any attempt to listen after calling [close] will throw, so there won't
-   * be any further listeners.
-   */
-  _Future<void>? _doneFuture;
-
-  _BroadcastStreamController(this.onListen, this.onCancel)
-      : _state = _STATE_INITIAL;
-
-  void Function() get onPause {
-    throw new UnsupportedError(
-        "Broadcast stream controllers do not support pause callbacks");
-  }
-
-  void set onPause(void onPauseHandler()?) {
-    throw new UnsupportedError(
-        "Broadcast stream controllers do not support pause callbacks");
-  }
-
-  void Function() get onResume {
-    throw new UnsupportedError(
-        "Broadcast stream controllers do not support pause callbacks");
-  }
-
-  void set onResume(void onResumeHandler()?) {
-    throw new UnsupportedError(
-        "Broadcast stream controllers do not support pause callbacks");
-  }
-
-  // StreamController interface.
-
-  Stream<T> get stream => new _BroadcastStream<T>(this);
-
-  StreamSink<T> get sink => new _StreamSinkWrapper<T>(this);
-
-  bool get isClosed => (_state & _STATE_CLOSED) != 0;
-
-  /**
-   * A broadcast controller is never paused.
-   *
-   * Each receiving stream may be paused individually, and they handle their
-   * own buffering.
-   */
-  bool get isPaused => false;
-
-  /** Whether there are currently one or more subscribers. */
-  bool get hasListener => !_isEmpty;
-
-  /**
-   * Test whether the stream has exactly one listener.
-   *
-   * Assumes that the stream has a listener (not [_isEmpty]).
-   */
-  bool get _hasOneListener {
-    assert(!_isEmpty);
-    return identical(_firstSubscription, _lastSubscription);
-  }
-
-  /** Whether an event is being fired (sent to some, but not all, listeners). */
-  bool get _isFiring => (_state & _STATE_FIRING) != 0;
-
-  bool get _isAddingStream => (_state & _STATE_ADDSTREAM) != 0;
-
-  bool get _mayAddEvent => (_state < _STATE_CLOSED);
-
-  _Future<void> _ensureDoneFuture() => _doneFuture ??= _Future<void>();
-
-  // Linked list helpers
-
-  bool get _isEmpty => _firstSubscription == null;
-
-  /** Adds subscription to linked list of active listeners. */
-  void _addListener(_BroadcastSubscription<T> subscription) {
-    assert(identical(subscription._next, subscription));
-    subscription._eventState = (_state & _STATE_EVENT_ID);
-    // Insert in linked list as last subscription.
-    _BroadcastSubscription<T>? oldLast = _lastSubscription;
-    _lastSubscription = subscription;
-    subscription._next = null;
-    subscription._previous = oldLast;
-    if (oldLast == null) {
-      _firstSubscription = subscription;
-    } else {
-      oldLast._next = subscription;
-    }
-  }
-
-  void _removeListener(_BroadcastSubscription<T> subscription) {
-    assert(identical(subscription._controller, this));
-    assert(!identical(subscription._next, subscription));
-    _BroadcastSubscription<T>? previous = subscription._previous;
-    _BroadcastSubscription<T>? next = subscription._next;
-    if (previous == null) {
-      // This was the first subscription.
-      _firstSubscription = next;
-    } else {
-      previous._next = next;
-    }
-    if (next == null) {
-      // This was the last subscription.
-      _lastSubscription = previous;
-    } else {
-      next._previous = previous;
-    }
-
-    subscription._next = subscription._previous = subscription;
-  }
-
-  // _StreamControllerLifecycle interface.
-
-  StreamSubscription<T> _subscribe(void onData(T data)?, Function? onError,
-      void onDone()?, bool cancelOnError) {
-    if (isClosed) {
-      return new _DoneStreamSubscription<T>(onDone);
-    }
-    var subscription = new _BroadcastSubscription<T>(
-        this, onData, onError, onDone, cancelOnError);
-    _addListener(subscription);
-    if (identical(_firstSubscription, _lastSubscription)) {
-      // Only one listener, so it must be the first listener.
-      _runGuarded(onListen);
-    }
-    return subscription;
-  }
-
-  Future<void>? _recordCancel(StreamSubscription<T> sub) {
-    _BroadcastSubscription<T> subscription = sub as _BroadcastSubscription<T>;
-    // If already removed by the stream, don't remove it again.
-    if (identical(subscription._next, subscription)) return null;
-    if (subscription._isFiring) {
-      subscription._setRemoveAfterFiring();
-    } else {
-      _removeListener(subscription);
-      // If we are currently firing an event, the empty-check is performed at
-      // the end of the listener loop instead of here.
-      if (!_isFiring && _isEmpty) {
-        _callOnCancel();
-      }
-    }
-    return null;
-  }
-
-  void _recordPause(StreamSubscription<T> subscription) {}
-  void _recordResume(StreamSubscription<T> subscription) {}
-
-  // EventSink interface.
-
-  Error _addEventError() {
-    if (isClosed) {
-      return new StateError("Cannot add new events after calling close");
-    }
-    assert(_isAddingStream);
-    return new StateError("Cannot add new events while doing an addStream");
-  }
-
-  void add(T data) {
-    if (!_mayAddEvent) throw _addEventError();
-    _sendData(data);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    if (!_mayAddEvent) throw _addEventError();
-    AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-    if (replacement != null) {
-      error = replacement.error;
-      stackTrace = replacement.stackTrace;
-    } else {
-      stackTrace ??= AsyncError.defaultStackTrace(error);
-    }
-    if (stackTrace == null) throw "unreachable"; // TODO(40088)
-    _sendError(error, stackTrace);
-  }
-
-  Future close() {
-    if (isClosed) {
-      assert(_doneFuture != null);
-      return _doneFuture!;
-    }
-    if (!_mayAddEvent) throw _addEventError();
-    _state |= _STATE_CLOSED;
-    Future doneFuture = _ensureDoneFuture();
-    _sendDone();
-    return doneFuture;
-  }
-
-  Future<void> get done => _ensureDoneFuture();
-
-  Future addStream(Stream<T> stream, {bool? cancelOnError}) {
-    if (!_mayAddEvent) throw _addEventError();
-    _state |= _STATE_ADDSTREAM;
-    var addStreamState =
-        new _AddStreamState(this, stream, cancelOnError ?? false);
-    _addStreamState = addStreamState;
-    return addStreamState.addStreamFuture;
-  }
-
-  // _EventSink interface, called from AddStreamState.
-  void _add(T data) {
-    _sendData(data);
-  }
-
-  void _addError(Object error, StackTrace stackTrace) {
-    _sendError(error, stackTrace);
-  }
-
-  void _close() {
-    assert(_isAddingStream);
-    _AddStreamState addState = _addStreamState!;
-    _addStreamState = null;
-    _state &= ~_STATE_ADDSTREAM;
-    addState.complete();
-  }
-
-  // Event handling.
-  void _forEachListener(
-      void action(_BufferingStreamSubscription<T> subscription)) {
-    if (_isFiring) {
-      throw new StateError(
-          "Cannot fire new event. Controller is already firing an event");
-    }
-    if (_isEmpty) return;
-
-    // Get event id of this event.
-    int id = (_state & _STATE_EVENT_ID);
-    // Start firing (set the _STATE_FIRING bit). We don't do [onCancel]
-    // callbacks while firing, and we prevent reentrancy of this function.
-    //
-    // Set [_state]'s event id to the next event's id.
-    // Any listeners added while firing this event will expect the next event,
-    // not this one, and won't get notified.
-    _state ^= _STATE_EVENT_ID | _STATE_FIRING;
-    _BroadcastSubscription<T>? subscription = _firstSubscription;
-    while (subscription != null) {
-      if (subscription._expectsEvent(id)) {
-        subscription._eventState |= _BroadcastSubscription._STATE_FIRING;
-        action(subscription);
-        subscription._toggleEventId();
-        _BroadcastSubscription<T>? next = subscription._next;
-        if (subscription._removeAfterFiring) {
-          _removeListener(subscription);
-        }
-        subscription._eventState &= ~_BroadcastSubscription._STATE_FIRING;
-        subscription = next;
-      } else {
-        subscription = subscription._next;
-      }
-    }
-    _state &= ~_STATE_FIRING;
-
-    if (_isEmpty) {
-      _callOnCancel();
-    }
-  }
-
-  void _callOnCancel() {
-    assert(_isEmpty);
-    if (isClosed) {
-      // When closed, _doneFuture is not null.
-      var doneFuture = _doneFuture!;
-      if (doneFuture._mayComplete) {
-        doneFuture._asyncComplete(null);
-      }
-    }
-    _runGuarded(onCancel);
-  }
-}
-
-class _SyncBroadcastStreamController<T> extends _BroadcastStreamController<T>
-    implements SynchronousStreamController<T> {
-  _SyncBroadcastStreamController(void onListen()?, void onCancel()?)
-      : super(onListen, onCancel);
-
-  // EventDispatch interface.
-
-  bool get _mayAddEvent => super._mayAddEvent && !_isFiring;
-
-  _addEventError() {
-    if (_isFiring) {
-      return new StateError(
-          "Cannot fire new event. Controller is already firing an event");
-    }
-    return super._addEventError();
-  }
-
-  void _sendData(T data) {
-    if (_isEmpty) return;
-    if (_hasOneListener) {
-      _state |= _BroadcastStreamController._STATE_FIRING;
-      _BroadcastSubscription<T> firstSubscription =
-          _firstSubscription as dynamic;
-      firstSubscription._add(data);
-      _state &= ~_BroadcastStreamController._STATE_FIRING;
-      if (_isEmpty) {
-        _callOnCancel();
-      }
-      return;
-    }
-    _forEachListener((_BufferingStreamSubscription<T> subscription) {
-      subscription._add(data);
-    });
-  }
-
-  void _sendError(Object error, StackTrace stackTrace) {
-    if (_isEmpty) return;
-    _forEachListener((_BufferingStreamSubscription<T> subscription) {
-      subscription._addError(error, stackTrace);
-    });
-  }
-
-  void _sendDone() {
-    if (!_isEmpty) {
-      _forEachListener((_BufferingStreamSubscription<T> subscription) {
-        subscription._close();
-      });
-    } else {
-      assert(_doneFuture != null && _doneFuture!._mayComplete);
-      _doneFuture!._asyncComplete(null);
-    }
-  }
-}
-
-class _AsyncBroadcastStreamController<T> extends _BroadcastStreamController<T> {
-  _AsyncBroadcastStreamController(void onListen()?, void onCancel()?)
-      : super(onListen, onCancel);
-
-  // EventDispatch interface.
-
-  void _sendData(T data) {
-    for (var subscription = _firstSubscription;
-        subscription != null;
-        subscription = subscription._next) {
-      subscription._addPending(new _DelayedData<T>(data));
-    }
-  }
-
-  void _sendError(Object error, StackTrace stackTrace) {
-    for (var subscription = _firstSubscription;
-        subscription != null;
-        subscription = subscription._next) {
-      subscription._addPending(new _DelayedError(error, stackTrace));
-    }
-  }
-
-  void _sendDone() {
-    if (!_isEmpty) {
-      for (var subscription = _firstSubscription;
-          subscription != null;
-          subscription = subscription._next) {
-        subscription._addPending(const _DelayedDone());
-      }
-    } else {
-      assert(_doneFuture != null && _doneFuture!._mayComplete);
-      _doneFuture!._asyncComplete(null);
-    }
-  }
-}
-
-/**
- * Stream controller that is used by [Stream.asBroadcastStream].
- *
- * This stream controller allows incoming events while it is firing
- * other events. This is handled by delaying the events until the
- * current event is done firing, and then fire the pending events.
- *
- * This class extends [_SyncBroadcastStreamController]. Events of
- * an "asBroadcastStream" stream are always initiated by events
- * on another stream, and it is fine to forward them synchronously.
- */
-class _AsBroadcastStreamController<T> extends _SyncBroadcastStreamController<T>
-    implements _EventDispatch<T> {
-  _StreamImplEvents<T>? _pending;
-
-  _AsBroadcastStreamController(void onListen()?, void onCancel()?)
-      : super(onListen, onCancel);
-
-  bool get _hasPending {
-    var pending = _pending;
-    return pending != null && !pending.isEmpty;
-  }
-
-  void _addPendingEvent(_DelayedEvent event) {
-    (_pending ??= new _StreamImplEvents<T>()).add(event);
-  }
-
-  void add(T data) {
-    if (!isClosed && _isFiring) {
-      _addPendingEvent(new _DelayedData<T>(data));
-      return;
-    }
-    super.add(data);
-    _flushPending();
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    stackTrace ??= AsyncError.defaultStackTrace(error);
-    if (!isClosed && _isFiring) {
-      _addPendingEvent(new _DelayedError(error, stackTrace));
-      return;
-    }
-    if (!_mayAddEvent) throw _addEventError();
-    _sendError(error, stackTrace);
-    _flushPending();
-  }
-
-  void _flushPending() {
-    var pending = _pending;
-    while (pending != null && !pending.isEmpty) {
-      pending.handleNext(this);
-      pending = _pending;
-    }
-  }
-
-  Future close() {
-    if (!isClosed && _isFiring) {
-      _addPendingEvent(const _DelayedDone());
-      _state |= _BroadcastStreamController._STATE_CLOSED;
-      return super.done;
-    }
-    Future result = super.close();
-    assert(!_hasPending);
-    return result;
-  }
-
-  void _callOnCancel() {
-    var pending = _pending;
-    if (pending != null) {
-      pending.clear();
-      _pending = null;
-    }
-    super._callOnCancel();
-  }
-}
diff --git a/sdk_nnbd/lib/async/deferred_load.dart b/sdk_nnbd/lib/async/deferred_load.dart
deleted file mode 100644
index 419db58..0000000
--- a/sdk_nnbd/lib/async/deferred_load.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.async;
-
-/**
- * Indicates that loading of [libraryName] is deferred.
- *
- * This class is obsolete. Instead use the syntax:
- * import "library.dart" deferred as prefix;
- */
-@Deprecated("Dart sdk v. 1.8")
-class DeferredLibrary {
-  final String libraryName;
-  final String? uri;
-
-  const DeferredLibrary(this.libraryName, {this.uri});
-
-  /**
-   * Ensure that [libraryName] has been loaded.
-   *
-   * If the library fails to load, the Future will complete with a
-   * DeferredLoadException.
-   */
-  external Future<Null> load();
-}
-
-/**
- * Thrown when a deferred library fails to load.
- */
-class DeferredLoadException implements Exception {
-  DeferredLoadException(String message) : _s = message;
-  String toString() => "DeferredLoadException: '$_s'";
-  final String _s;
-}
diff --git a/sdk_nnbd/lib/async/future.dart b/sdk_nnbd/lib/async/future.dart
deleted file mode 100644
index 8a43bce..0000000
--- a/sdk_nnbd/lib/async/future.dart
+++ /dev/null
@@ -1,951 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-/// A type representing values that are either `Future<T>` or `T`.
-///
-/// This class declaration is a public stand-in for an internal
-/// future-or-value generic type. References to this class are resolved to the
-/// internal type.
-///
-/// It is a compile-time error for any class to extend, mix in or implement
-/// `FutureOr`.
-///
-/// # Examples
-/// ``` dart
-/// // The `Future<T>.then` function takes a callback [f] that returns either
-/// // an `S` or a `Future<S>`.
-/// Future<S> then<S>(FutureOr<S> f(T x), ...);
-///
-/// // `Completer<T>.complete` takes either a `T` or `Future<T>`.
-/// void complete(FutureOr<T> value);
-/// ```
-///
-/// # Advanced
-/// The `FutureOr<int>` type is actually the "type union" of the types `int` and
-/// `Future<int>`. This type union is defined in such a way that
-/// `FutureOr<Object>` is both a super- and sub-type of `Object` (sub-type
-/// because `Object` is one of the types of the union, super-type because
-/// `Object` is a super-type of both of the types of the union). Together it
-/// means that `FutureOr<Object>` is equivalent to `Object`.
-///
-/// As a corollary, `FutureOr<Object>` is equivalent to
-/// `FutureOr<FutureOr<Object>>`, `FutureOr<Future<Object>>` is equivalent to
-/// `Future<Object>`.
-abstract class FutureOr<T> {
-  // Private generative constructor, so that it is not subclassable, mixable, or
-  // instantiable.
-  FutureOr._() {
-    throw new UnsupportedError("FutureOr can't be instantiated");
-  }
-}
-
-/**
- * An object representing a delayed computation.
- *
- * A [Future] is used to represent a potential value, or error,
- * that will be available at some time in the future.
- * Receivers of a [Future] can register callbacks
- * that handle the value or error once it is available.
- * For example:
- *
- *     Future<int> future = getFuture();
- *     future.then((value) => handleValue(value))
- *           .catchError((error) => handleError(error));
- *
- * A [Future] can be completed in two ways:
- * with a value ("the future succeeds")
- * or with an error ("the future fails").
- * Users can install callbacks for each case.
- *
- * In some cases we say that a future is completed with another future.
- * This is a short way of stating that the future is completed in the same way,
- * with the same value or error,
- * as the other future once that completes.
- * Whenever a function in the core library may complete a future
- * (for example [Completer.complete] or [new Future.value]),
- * then it also accepts another future and does this work for the developer.
- *
- * The result of registering a pair of callbacks is a new Future (the
- * "successor") which in turn is completed with the result of invoking the
- * corresponding callback.
- * The successor is completed with an error if the invoked callback throws.
- * For example:
- * ```
- * Future<int> successor = future.then((int value) {
- *     // Invoked when the future is completed with a value.
- *     return 42;  // The successor is completed with the value 42.
- *   },
- *   onError: (e) {
- *     // Invoked when the future is completed with an error.
- *     if (canHandle(e)) {
- *       return 499;  // The successor is completed with the value 499.
- *     } else {
- *       throw e;  // The successor is completed with the error e.
- *     }
- *   });
- * ```
- *
- * If a future does not have a successor when it completes with an error,
- * it forwards the error message to the global error-handler.
- * This behavior makes sure that no error is silently dropped.
- * However, it also means that error handlers should be installed early,
- * so that they are present as soon as a future is completed with an error.
- * The following example demonstrates this potential bug:
- * ```
- * var future = getFuture();
- * new Timer(new Duration(milliseconds: 5), () {
- *   // The error-handler is not attached until 5 ms after the future has
- *   // been received. If the future fails before that, the error is
- *   // forwarded to the global error-handler, even though there is code
- *   // (just below) to eventually handle the error.
- *   future.then((value) { useValue(value); },
- *               onError: (e) { handleError(e); });
- * });
- * ```
- *
- * When registering callbacks, it's often more readable to register the two
- * callbacks separately, by first using [then] with one argument
- * (the value handler) and using a second [catchError] for handling errors.
- * Each of these will forward the result that they don't handle
- * to their successors, and together they handle both value and error result.
- * It also has the additional benefit of the [catchError] handling errors in the
- * [then] value callback too.
- * Using sequential handlers instead of parallel ones often leads to code that
- * is easier to reason about.
- * It also makes asynchronous code very similar to synchronous code:
- * ```
- * // Synchronous code.
- * try {
- *   int value = foo();
- *   return bar(value);
- * } catch (e) {
- *   return 499;
- * }
- * ```
- *
- * Equivalent asynchronous code, based on futures:
- * ```
- * Future<int> future = new Future(foo);  // Result of foo() as a future.
- * future.then((int value) => bar(value))
- *       .catchError((e) => 499);
- * ```
- *
- * Similar to the synchronous code, the error handler (registered with
- * [catchError]) is handling any errors thrown by either `foo` or `bar`.
- * If the error-handler had been registered as the `onError` parameter of
- * the `then` call, it would not catch errors from the `bar` call.
- *
- * Futures can have more than one callback-pair registered. Each successor is
- * treated independently and is handled as if it was the only successor.
- *
- * A future may also fail to ever complete. In that case, no callbacks are
- * called.
- */
-abstract class Future<T> {
-  /// A `Future<Null>` completed with `null`.
-  static final _Future<Null> _nullFuture =
-      new _Future<Null>.zoneValue(null, _rootZone);
-
-  /// A `Future<bool>` completed with `false`.
-  static final _Future<bool> _falseFuture =
-      new _Future<bool>.zoneValue(false, _rootZone);
-
-  /**
-   * Creates a future containing the result of calling [computation]
-   * asynchronously with [Timer.run].
-   *
-   * If the result of executing [computation] throws, the returned future is
-   * completed with the error.
-   *
-   * If the returned value is itself a [Future], completion of
-   * the created future will wait until the returned future completes,
-   * and will then complete with the same result.
-   *
-   * If a non-future value is returned, the returned future is completed
-   * with that value.
-   */
-  factory Future(FutureOr<T> computation()) {
-    _Future<T> result = new _Future<T>();
-    Timer.run(() {
-      try {
-        result._complete(computation());
-      } catch (e, s) {
-        _completeWithErrorCallback(result, e, s);
-      }
-    });
-    return result;
-  }
-
-  /**
-   * Creates a future containing the result of calling [computation]
-   * asynchronously with [scheduleMicrotask].
-   *
-   * If executing [computation] throws,
-   * the returned future is completed with the thrown error.
-   *
-   * If calling [computation] returns a [Future], completion of
-   * the created future will wait until the returned future completes,
-   * and will then complete with the same result.
-   *
-   * If calling [computation] returns a non-future value,
-   * the returned future is completed with that value.
-   */
-  factory Future.microtask(FutureOr<T> computation()) {
-    _Future<T> result = new _Future<T>();
-    scheduleMicrotask(() {
-      try {
-        result._complete(computation());
-      } catch (e, s) {
-        _completeWithErrorCallback(result, e, s);
-      }
-    });
-    return result;
-  }
-
-  /**
-   * Returns a future containing the result of immediately calling
-   * [computation].
-   *
-   * If calling [computation] throws, the returned future is completed with the
-   * error.
-   *
-   * If calling [computation] returns a `Future<T>`, that future is returned.
-   *
-   * If calling [computation] returns a non-future value,
-   * a future is returned which has been completed with that value.
-   */
-  factory Future.sync(FutureOr<T> computation()) {
-    try {
-      var result = computation();
-      if (result is Future<T>) {
-        return result;
-      } else {
-        // TODO(40014): Remove cast when type promotion works.
-        return new _Future<T>.value(result as dynamic);
-      }
-    } catch (error, stackTrace) {
-      var future = new _Future<T>();
-      AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-      if (replacement != null) {
-        future._asyncCompleteError(replacement.error, replacement.stackTrace);
-      } else {
-        future._asyncCompleteError(error, stackTrace);
-      }
-      return future;
-    }
-  }
-
-  /**
-   * Creates a future completed with [value].
-   *
-   * If [value] is a future, the created future waits for the
-   * [value] future to complete, and then completes with the same result.
-   * Since a [value] future can complete with an error, so can the future
-   * created by [Future.value], even if the name suggests otherwise.
-   *
-   * If [value] is not a [Future], the created future is completed
-   * with the [value] value,
-   * equivalently to `new Future<T>.sync(() => value)`.
-   *
-   * If [value] is omitted or `null`, it is converted to `FutureOr<T>` by
-   * `value as FutureOr<T>`. If `T` is not nullable, then the [value] is
-   * required, otherwise the construction throws.
-   *
-   * Use [Completer] to create a future and complete it later.
-   */
-  @pragma("vm:entry-point")
-  factory Future.value([FutureOr<T>? value]) {
-    return new _Future<T>.immediate(value == null ? value as dynamic : value);
-  }
-
-  /**
-   * Creates a future that completes with an error.
-   *
-   * The created future will be completed with an error in a future microtask.
-   * This allows enough time for someone to add an error handler on the future.
-   * If an error handler isn't added before the future completes, the error
-   * will be considered unhandled.
-   *
-   * Use [Completer] to create a future and complete it later.
-   */
-  factory Future.error(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    if (!identical(Zone.current, _rootZone)) {
-      AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-      if (replacement != null) {
-        error = replacement.error;
-        stackTrace = replacement.stackTrace;
-      }
-    }
-    stackTrace ??= AsyncError.defaultStackTrace(error);
-    return new _Future<T>.immediateError(error, stackTrace);
-  }
-
-  /**
-   * Creates a future that runs its computation after a delay.
-   *
-   * The [computation] will be executed after the given [duration] has passed,
-   * and the future is completed with the result of the computation.
-   *
-   * If [computation] returns a future,
-   * the future returned by this constructor will complete with the value or
-   * error of that future.
-   *
-   * If the duration is 0 or less,
-   * it completes no sooner than in the next event-loop iteration,
-   * after all microtasks have run.
-   *
-   * If [computation] is omitted,
-   * it will be treated as if [computation] was `() => null`,
-   * and the future will eventually complete with the `null` value.
-   * In that case, [T] must be nullable.
-   *
-   * If calling [computation] throws, the created future will complete with the
-   * error.
-   *
-   * See also [Completer] for a way to create and complete a future at a
-   * later time that isn't necessarily after a known fixed duration.
-   */
-  factory Future.delayed(Duration duration, [FutureOr<T> computation()?]) {
-    if (computation == null && !typeAcceptsNull<T>()) {
-      throw ArgumentError.value(
-          null, "computation", "The type parameter is not nullable");
-    }
-    _Future<T> result = new _Future<T>();
-    new Timer(duration, () {
-      if (computation == null) {
-        result._complete(null as T);
-      } else {
-        try {
-          result._complete(computation());
-        } catch (e, s) {
-          _completeWithErrorCallback(result, e, s);
-        }
-      }
-    });
-    return result;
-  }
-
-  /**
-   * Waits for multiple futures to complete and collects their results.
-   *
-   * Returns a future which will complete once all the provided futures
-   * have completed, either with their results, or with an error if any
-   * of the provided futures fail.
-   *
-   * The value of the returned future will be a list of all the values that
-   * were produced in the order that the futures are provided by iterating
-   * [futures].
-   *
-   * If any future completes with an error,
-   * then the returned future completes with that error.
-   * If further futures also complete with errors, those errors are discarded.
-   *
-   * If `eagerError` is true, the returned future completes with an error
-   * immediately on the first error from one of the futures. Otherwise all
-   * futures must complete before the returned future is completed (still with
-   * the first error; the remaining errors are silently dropped).
-   *
-   * In the case of an error, [cleanUp] (if provided), is invoked on any
-   * non-null result of successful futures.
-   * This makes it possible to `cleanUp` resources that would otherwise be
-   * lost (since the returned future does not provide access to these values).
-   * The [cleanUp] function is unused if there is no error.
-   *
-   * The call to [cleanUp] should not throw. If it does, the error will be an
-   * uncaught asynchronous error.
-   */
-  static Future<List<T>> wait<T>(Iterable<Future<T>> futures,
-      {bool eagerError = false, void cleanUp(T successValue)?}) {
-    final _Future<List<T>> result = new _Future<List<T>>();
-    List<T?>? values; // Collects the values. Set to null on error.
-    int remaining = 0; // How many futures are we waiting for.
-    late Object error; // The first error from a future.
-    late StackTrace stackTrace; // The stackTrace that came with the error.
-
-    // Handle an error from any of the futures.
-    void handleError(Object theError, StackTrace theStackTrace) {
-      remaining--;
-      List<T?>? valueList = values;
-      if (valueList != null) {
-        if (cleanUp != null) {
-          for (var value in valueList) {
-            if (value != null) {
-              // Ensure errors from cleanUp are uncaught.
-              T cleanUpValue = value;
-              new Future.sync(() {
-                cleanUp(cleanUpValue);
-              });
-            }
-          }
-        }
-        values = null;
-        if (remaining == 0 || eagerError) {
-          result._completeError(theError, theStackTrace);
-        } else {
-          error = theError;
-          stackTrace = theStackTrace;
-        }
-      } else if (remaining == 0 && !eagerError) {
-        result._completeError(error, stackTrace);
-      }
-    }
-
-    try {
-      // As each future completes, put its value into the corresponding
-      // position in the list of values.
-      for (var future in futures) {
-        int pos = remaining;
-        future.then((T value) {
-          remaining--;
-          List<T?>? valueList = values;
-          if (valueList != null) {
-            valueList[pos] = value;
-            if (remaining == 0) {
-              result._completeWithValue(List<T>.from(valueList));
-            }
-          } else {
-            if (cleanUp != null && value != null) {
-              // Ensure errors from cleanUp are uncaught.
-              new Future.sync(() {
-                cleanUp(value);
-              });
-            }
-            if (remaining == 0 && !eagerError) {
-              // If eagerError is false, and valueList is null, then
-              // error and stackTrace have been set in handleError above.
-              result._completeError(error, stackTrace);
-            }
-          }
-        }, onError: handleError);
-        // Increment the 'remaining' after the call to 'then'.
-        // If that call throws, we don't expect any future callback from
-        // the future, and we also don't increment remaining.
-        remaining++;
-      }
-      if (remaining == 0) {
-        return new Future<List<T>>.value(const <Never>[]);
-      }
-      values = new List<T?>.filled(remaining, null);
-    } catch (e, st) {
-      // The error must have been thrown while iterating over the futures
-      // list, or while installing a callback handler on the future.
-      // This is a breach of the `Future` protocol, but we try to handle it
-      // gracefully.
-      if (remaining == 0 || eagerError) {
-        // Throw a new Future.error.
-        // Don't just call `result._completeError` since that would propagate
-        // the error too eagerly, not giving the callers time to install
-        // error handlers.
-        // Also, don't use `_asyncCompleteError` since that one doesn't give
-        // zones the chance to intercept the error.
-        return new Future.error(e, st);
-      } else {
-        // Don't allocate a list for values, thus indicating that there was an
-        // error.
-        // Set error to the caught exception.
-        error = e;
-        stackTrace = st;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns the result of the first future in [futures] to complete.
-   *
-   * The returned future is completed with the result of the first
-   * future in [futures] to report that it is complete,
-   * whether it's with a value or an error.
-   * The results of all the other futures are discarded.
-   *
-   * If [futures] is empty, or if none of its futures complete,
-   * the returned future never completes.
-   */
-  static Future<T> any<T>(Iterable<Future<T>> futures) {
-    var completer = new Completer<T>.sync();
-    void onValue(T value) {
-      if (!completer.isCompleted) completer.complete(value);
-    }
-
-    void onError(Object error, StackTrace stack) {
-      if (!completer.isCompleted) completer.completeError(error, stack);
-    }
-
-    for (var future in futures) {
-      future.then(onValue, onError: onError);
-    }
-    return completer.future;
-  }
-
-  /**
-   * Performs an action for each element of the iterable, in turn.
-   *
-   * The [action] may be either synchronous or asynchronous.
-   *
-   * Calls [action] with each element in [elements] in order.
-   * If the call to [action] returns a `Future<T>`, the iteration waits
-   * until the future is completed before continuing with the next element.
-   *
-   * Returns a [Future] that completes with `null` when all elements have been
-   * processed.
-   *
-   * Non-[Future] return values, and completion-values of returned [Future]s,
-   * are discarded.
-   *
-   * Any error from [action], synchronous or asynchronous,
-   * will stop the iteration and be reported in the returned [Future].
-   */
-  static Future forEach<T>(Iterable<T> elements, FutureOr action(T element)) {
-    var iterator = elements.iterator;
-    return doWhile(() {
-      if (!iterator.moveNext()) return false;
-      var result = action(iterator.current);
-      if (result is Future) return result.then(_kTrue);
-      return true;
-    });
-  }
-
-  // Constant `true` function, used as callback by [forEach].
-  static bool _kTrue(Object? _) => true;
-
-  /**
-   * Performs an operation repeatedly until it returns `false`.
-   *
-   * The operation, [action], may be either synchronous or asynchronous.
-   *
-   * The operation is called repeatedly as long as it returns either the [bool]
-   * value `true` or a `Future<bool>` which completes with the value `true`.
-   *
-   * If a call to [action] returns `false` or a [Future] that completes to
-   * `false`, iteration ends and the future returned by [doWhile] is completed
-   * with a `null` value.
-   *
-   * If a call to [action] throws or a future returned by [action] completes
-   * with an error, iteration ends and the future returned by [doWhile]
-   * completes with the same error.
-   *
-   * Calls to [action] may happen at any time,
-   * including immediately after calling `doWhile`.
-   * The only restriction is a new call to [action] won't happen before
-   * the previous call has returned, and if it returned a `Future<bool>`, not
-   * until that future has completed.
-   */
-  static Future doWhile(FutureOr<bool> action()) {
-    _Future<void> doneSignal = new _Future<void>();
-    late void Function(bool) nextIteration;
-    // Bind this callback explicitly so that each iteration isn't bound in the
-    // context of all the previous iterations' callbacks.
-    // This avoids, e.g., deeply nested stack traces from the stack trace
-    // package.
-    nextIteration = Zone.current.bindUnaryCallbackGuarded((bool keepGoing) {
-      while (keepGoing) {
-        FutureOr<bool> result;
-        try {
-          result = action();
-        } catch (error, stackTrace) {
-          // Cannot use _completeWithErrorCallback because it completes
-          // the future synchronously.
-          _asyncCompleteWithErrorCallback(doneSignal, error, stackTrace);
-          return;
-        }
-        if (result is Future<bool>) {
-          result.then(nextIteration, onError: doneSignal._completeError);
-          return;
-        }
-        // TODO(40014): Remove cast when type promotion works.
-        keepGoing = result as bool;
-      }
-      doneSignal._complete(null);
-    });
-    nextIteration(true);
-    return doneSignal;
-  }
-
-  /**
-   * Register callbacks to be called when this future completes.
-   *
-   * When this future completes with a value,
-   * the [onValue] callback will be called with that value.
-   * If this future is already completed, the callback will not be called
-   * immediately, but will be scheduled in a later microtask.
-   *
-   * If [onError] is provided, and this future completes with an error,
-   * the `onError` callback is called with that error and its stack trace.
-   * The `onError` callback must accept either one argument or two arguments
-   * where the latter is a [StackTrace].
-   * If `onError` accepts two arguments,
-   * it is called with both the error and the stack trace,
-   * otherwise it is called with just the error object.
-   * The `onError` callback must return a value or future that can be used
-   * to complete the returned future, so it must be something assignable to
-   * `FutureOr<R>`.
-   *
-   * Returns a new [Future]
-   * which is completed with the result of the call to `onValue`
-   * (if this future completes with a value)
-   * or to `onError` (if this future completes with an error).
-   *
-   * If the invoked callback throws,
-   * the returned future is completed with the thrown error
-   * and a stack trace for the error.
-   * In the case of `onError`,
-   * if the exception thrown is `identical` to the error argument to `onError`,
-   * the throw is considered a rethrow,
-   * and the original stack trace is used instead.
-   *
-   * If the callback returns a [Future],
-   * the future returned by `then` will be completed with
-   * the same result as the future returned by the callback.
-   *
-   * If [onError] is not given, and this future completes with an error,
-   * the error is forwarded directly to the returned future.
-   *
-   * In most cases, it is more readable to use [catchError] separately, possibly
-   * with a `test` parameter, instead of handling both value and error in a
-   * single [then] call.
-   *
-   * Note that futures don't delay reporting of errors until listeners are
-   * added. If the first `then` or `catchError` call happens after this future
-   * has completed with an error then the error is reported as unhandled error.
-   * See the description on [Future].
-   */
-  Future<R> then<R>(FutureOr<R> onValue(T value), {Function? onError});
-
-  /**
-   * Handles errors emitted by this [Future].
-   *
-   * This is the asynchronous equivalent of a "catch" block.
-   *
-   * Returns a new [Future] that will be completed with either the result of
-   * this future or the result of calling the `onError` callback.
-   *
-   * If this future completes with a value,
-   * the returned future completes with the same value.
-   *
-   * If this future completes with an error,
-   * then [test] is first called with the error value.
-   *
-   * If `test` returns false, the exception is not handled by this `catchError`,
-   * and the returned future completes with the same error and stack trace
-   * as this future.
-   *
-   * If `test` returns `true`,
-   * [onError] is called with the error and possibly stack trace,
-   * and the returned future is completed with the result of this call
-   * in exactly the same way as for [then]'s `onError`.
-   *
-   * If `test` is omitted, it defaults to a function that always returns true.
-   * The `test` function should not throw, but if it does, it is handled as
-   * if the `onError` function had thrown.
-   *
-   * Note that futures don't delay reporting of errors until listeners are
-   * added. If the first `catchError` (or `then`) call happens after this future
-   * has completed with an error then the error is reported as unhandled error.
-   * See the description on [Future].
-   */
-  // The `Function` below stands for one of two types:
-  // - (dynamic) -> FutureOr<T>
-  // - (dynamic, StackTrace) -> FutureOr<T>
-  // Given that there is a `test` function that is usually used to do an
-  // `isCheck` we should also expect functions that take a specific argument.
-  Future<T> catchError(Function onError, {bool test(Object error)?});
-
-  /**
-   * Registers a function to be called when this future completes.
-   *
-   * The [action] function is called when this future completes, whether it
-   * does so with a value or with an error.
-   *
-   * This is the asynchronous equivalent of a "finally" block.
-   *
-   * The future returned by this call, `f`, will complete the same way
-   * as this future unless an error occurs in the [action] call, or in
-   * a [Future] returned by the [action] call. If the call to [action]
-   * does not return a future, its return value is ignored.
-   *
-   * If the call to [action] throws, then `f` is completed with the
-   * thrown error.
-   *
-   * If the call to [action] returns a [Future], `f2`, then completion of
-   * `f` is delayed until `f2` completes. If `f2` completes with
-   * an error, that will be the result of `f` too. The value of `f2` is always
-   * ignored.
-   *
-   * This method is equivalent to:
-   *
-   *     Future<T> whenComplete(action()) {
-   *       return this.then((v) {
-   *         var f2 = action();
-   *         if (f2 is Future) return f2.then((_) => v);
-   *         return v
-   *       }, onError: (e) {
-   *         var f2 = action();
-   *         if (f2 is Future) return f2.then((_) { throw e; });
-   *         throw e;
-   *       });
-   *     }
-   */
-  Future<T> whenComplete(FutureOr<void> action());
-
-  /**
-   * Creates a [Stream] containing the result of this future.
-   *
-   * The stream will produce single data or error event containing the
-   * completion result of this future, and then it will close with a
-   * done event.
-   *
-   * If the future never completes, the stream will not produce any events.
-   */
-  Stream<T> asStream();
-
-  /**
-   * Time-out the future computation after [timeLimit] has passed.
-   *
-   * Returns a new future that completes with the same value as this future,
-   * if this future completes in time.
-   *
-   * If this future does not complete before `timeLimit` has passed,
-   * the [onTimeout] action is executed instead, and its result (whether it
-   * returns or throws) is used as the result of the returned future.
-   * The [onTimeout] function must return a [T] or a `Future<T>`.
-   *
-   * If `onTimeout` is omitted, a timeout will cause the returned future to
-   * complete with a [TimeoutException].
-   */
-  Future<T> timeout(Duration timeLimit, {FutureOr<T> onTimeout()?});
-}
-
-/**
- * Thrown when a scheduled timeout happens while waiting for an async result.
- */
-class TimeoutException implements Exception {
-  /** Description of the cause of the timeout. */
-  final String? message;
-  /** The duration that was exceeded. */
-  final Duration? duration;
-
-  TimeoutException(this.message, [this.duration]);
-
-  String toString() {
-    String result = "TimeoutException";
-    if (duration != null) result = "TimeoutException after $duration";
-    if (message != null) result = "$result: $message";
-    return result;
-  }
-}
-
-/**
- * A way to produce Future objects and to complete them later
- * with a value or error.
- *
- * Most of the time, the simplest way to create a future is to just use
- * one of the [Future] constructors to capture the result of a single
- * asynchronous computation:
- * ```
- * new Future(() { doSomething(); return result; });
- * ```
- * or, if the future represents the result of a sequence of asynchronous
- * computations, they can be chained using [Future.then] or similar functions
- * on [Future]:
- * ```
- * Future doStuff(){
- *   return someAsyncOperation().then((result) {
- *     return someOtherAsyncOperation(result);
- *   });
- * }
- * ```
- * If you do need to create a Future from scratch — for example,
- * when you're converting a callback-based API into a Future-based
- * one — you can use a Completer as follows:
- * ```
- * class AsyncOperation {
- *   Completer _completer = new Completer();
- *
- *   Future<T> doOperation() {
- *     _startOperation();
- *     return _completer.future; // Send future object back to client.
- *   }
- *
- *   // Something calls this when the value is ready.
- *   void _finishOperation(T result) {
- *     _completer.complete(result);
- *   }
- *
- *   // If something goes wrong, call this.
- *   void _errorHappened(error) {
- *     _completer.completeError(error);
- *   }
- * }
- * ```
- */
-abstract class Completer<T> {
-  /**
-   * Creates a new completer.
-   *
-   * The general workflow for creating a new future is to 1) create a
-   * new completer, 2) hand out its future, and, at a later point, 3) invoke
-   * either [complete] or [completeError].
-   *
-   * The completer completes the future asynchronously. That means that
-   * callbacks registered on the future are not called immediately when
-   * [complete] or [completeError] is called. Instead the callbacks are
-   * delayed until a later microtask.
-   *
-   * Example:
-   * ```
-   * var completer = new Completer();
-   * handOut(completer.future);
-   * later: {
-   *   completer.complete('completion value');
-   * }
-   * ```
-   */
-  factory Completer() => new _AsyncCompleter<T>();
-
-  /**
-   * Completes the future synchronously.
-   *
-   * This constructor should be avoided unless the completion of the future is
-   * known to be the final result of another asynchronous operation. If in doubt
-   * use the default [Completer] constructor.
-   *
-   * Using an normal, asynchronous, completer will never give the wrong
-   * behavior, but using a synchronous completer incorrectly can cause
-   * otherwise correct programs to break.
-   *
-   * A synchronous completer is only intended for optimizing event
-   * propagation when one asynchronous event immediately triggers another.
-   * It should not be used unless the calls to [complete] and [completeError]
-   * are guaranteed to occur in places where it won't break `Future` invariants.
-   *
-   * Completing synchronously means that the completer's future will be
-   * completed immediately when calling the [complete] or [completeError]
-   * method on a synchronous completer, which also calls any callbacks
-   * registered on that future.
-   *
-   * Completing synchronously must not break the rule that when you add a
-   * callback on a future, that callback must not be called until the code
-   * that added the callback has completed.
-   * For that reason, a synchronous completion must only occur at the very end
-   * (in "tail position") of another synchronous event,
-   * because at that point, completing the future immediately is be equivalent
-   * to returning to the event loop and completing the future in the next
-   * microtask.
-   *
-   * Example:
-   *
-   *     var completer = new Completer.sync();
-   *     // The completion is the result of the asynchronous onDone event.
-   *     // No other operation is performed after the completion. It is safe
-   *     // to use the Completer.sync constructor.
-   *     stream.listen(print, onDone: () { completer.complete("done"); });
-   *
-   * Bad example. Do not use this code. Only for illustrative purposes:
-   *
-   *     var completer = new Completer.sync();
-   *     completer.future.then((_) { bar(); });
-   *     // The completion is the result of the asynchronous onDone event.
-   *     // However, there is still code executed after the completion. This
-   *     // operation is *not* safe.
-   *     stream.listen(print, onDone: () {
-   *       completer.complete("done");
-   *       foo();  // In this case, foo() runs after bar().
-   *     });
-   */
-  factory Completer.sync() => new _SyncCompleter<T>();
-
-  /**
-   * The future that is completed by this completer.
-   *
-   * The future that is completed when [complete] or [completeError] is called.
-   */
-  Future<T> get future;
-
-  /**
-   * Completes [future] with the supplied values.
-   *
-   * The value must be either a value of type [T]
-   * or a future of type `Future<T>`.
-   * If the value is omitted or null, and `T` is not nullable, the call
-   * to `complete` throws.
-   *
-   * If the value is itself a future, the completer will wait for that future
-   * to complete, and complete with the same result, whether it is a success
-   * or an error.
-   *
-   * Calling [complete] or [completeError] must be done at most once.
-   *
-   * All listeners on the future are informed about the value.
-   */
-  void complete([FutureOr<T>? value]);
-
-  /**
-   * Complete [future] with an error.
-   *
-   * Calling [complete] or [completeError] must be done at most once.
-   *
-   * Completing a future with an error indicates that an exception was thrown
-   * while trying to produce a value.
-   *
-   * If `error` is a `Future`, the future itself is used as the error value.
-   * If you want to complete with the result of the future, you can use:
-   * ```
-   * thisCompleter.complete(theFuture)
-   * ```
-   * or if you only want to handle an error from the future:
-   * ```
-   * theFuture.catchError(thisCompleter.completeError);
-   * ```
-   */
-  void completeError(Object error, [StackTrace? stackTrace]);
-
-  /**
-   * Whether the [future] has been completed.
-   *
-   * Reflects whether [complete] or [completeError] has been called.
-   * A `true` value doesn't necessarily mean that listeners of this future
-   * have been invoked yet, either because the completer usually waits until
-   * a later microtask to propagate the result, or because [complete]
-   * was called with a future that hasn't completed yet.
-   *
-   * When this value is `true`, [complete] and [completeError] must not be
-   * called again.
-   */
-  bool get isCompleted;
-}
-
-// Helper function completing a _Future with error, but checking the zone
-// for error replacement and missing stack trace first.
-void _completeWithErrorCallback(
-    _Future result, Object error, StackTrace? stackTrace) {
-  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-  if (replacement != null) {
-    error = replacement.error;
-    stackTrace = replacement.stackTrace;
-  } else {
-    stackTrace ??= AsyncError.defaultStackTrace(error);
-  }
-  if (stackTrace == null) throw "unreachable"; // TODO(40088).
-  result._completeError(error, stackTrace);
-}
-
-// Like [_completeWithErrorCallback] but completes asynchronously.
-void _asyncCompleteWithErrorCallback(
-    _Future result, Object error, StackTrace? stackTrace) {
-  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-  if (replacement != null) {
-    error = replacement.error;
-    stackTrace = replacement.stackTrace;
-  } else {
-    stackTrace ??= AsyncError.defaultStackTrace(error);
-  }
-  if (stackTrace == null) {
-    throw "unreachable"; // TODO(lrn): Remove when type promotion works.
-  }
-  result._asyncCompleteError(error, stackTrace);
-}
diff --git a/sdk_nnbd/lib/async/future_impl.dart b/sdk_nnbd/lib/async/future_impl.dart
deleted file mode 100644
index 3f33737..0000000
--- a/sdk_nnbd/lib/async/future_impl.dart
+++ /dev/null
@@ -1,833 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-/** The onValue and onError handlers return either a value or a future */
-typedef FutureOr<T> _FutureOnValue<S, T>(S value);
-/** Test used by [Future.catchError] to handle skip some errors. */
-typedef bool _FutureErrorTest(Object error);
-/** Used by [WhenFuture]. */
-typedef dynamic _FutureAction();
-
-abstract class _Completer<T> implements Completer<T> {
-  final _Future<T> future = new _Future<T>();
-
-  void complete([FutureOr<T>? value]);
-
-  void completeError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    if (!future._mayComplete) throw new StateError("Future already completed");
-    AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-    if (replacement != null) {
-      error = replacement.error;
-      stackTrace = replacement.stackTrace;
-    } else {
-      stackTrace ??= AsyncError.defaultStackTrace(error);
-    }
-    if (stackTrace == null) throw "unreachable"; // TODO(40088)
-    _completeError(error, stackTrace);
-  }
-
-  void _completeError(Object error, StackTrace stackTrace);
-
-  // The future's _isComplete doesn't take into account pending completions.
-  // We therefore use _mayComplete.
-  bool get isCompleted => !future._mayComplete;
-}
-
-class _AsyncCompleter<T> extends _Completer<T> {
-  void complete([FutureOr<T>? value]) {
-    if (!future._mayComplete) throw new StateError("Future already completed");
-    future._asyncComplete(value == null ? value as dynamic : value);
-  }
-
-  void _completeError(Object error, StackTrace stackTrace) {
-    future._asyncCompleteError(error, stackTrace);
-  }
-}
-
-class _SyncCompleter<T> extends _Completer<T> {
-  void complete([FutureOr<T>? value]) {
-    if (!future._mayComplete) throw new StateError("Future already completed");
-    future._complete(value == null ? value as dynamic : value);
-  }
-
-  void _completeError(Object error, StackTrace stackTrace) {
-    future._completeError(error, stackTrace);
-  }
-}
-
-class _FutureListener<S, T> {
-  static const int maskValue = 1;
-  static const int maskError = 2;
-  static const int maskTestError = 4;
-  static const int maskWhencomplete = 8;
-  static const int stateChain = 0;
-  static const int stateThen = maskValue;
-  static const int stateThenOnerror = maskValue | maskError;
-  static const int stateCatcherror = maskError;
-  static const int stateCatcherrorTest = maskError | maskTestError;
-  static const int stateWhencomplete = maskWhencomplete;
-  static const int maskType =
-      maskValue | maskError | maskTestError | maskWhencomplete;
-  static const int stateIsAwait = 16;
-  // Listeners on the same future are linked through this link.
-  _FutureListener? _nextListener;
-  // The future to complete when this listener is activated.
-  final _Future<T> result;
-  // Which fields means what.
-  final int state;
-  // Used for then/whenDone callback and error test
-  @pragma("vm:entry-point")
-  final Function? callback;
-  // Used for error callbacks.
-  final Function? errorCallback;
-
-  _FutureListener.then(
-      this.result, FutureOr<T> Function(S) onValue, Function? errorCallback)
-      : callback = onValue,
-        errorCallback = errorCallback,
-        state = (errorCallback == null) ? stateThen : stateThenOnerror;
-
-  _FutureListener.thenAwait(
-      this.result, _FutureOnValue<S, T> onValue, Function errorCallback)
-      : callback = onValue,
-        errorCallback = errorCallback,
-        state = ((errorCallback == null) ? stateThen : stateThenOnerror) |
-            stateIsAwait;
-
-  _FutureListener.catchError(this.result, this.errorCallback, this.callback)
-      : state = (callback == null) ? stateCatcherror : stateCatcherrorTest;
-
-  _FutureListener.whenComplete(this.result, this.callback)
-      : errorCallback = null,
-        state = stateWhencomplete;
-
-  _Zone get _zone => result._zone;
-
-  bool get handlesValue => (state & maskValue != 0);
-  bool get handlesError => (state & maskError != 0);
-  bool get hasErrorTest => (state & maskType == stateCatcherrorTest);
-  bool get handlesComplete => (state & maskType == stateWhencomplete);
-  bool get isAwait => (state & stateIsAwait != 0);
-
-  FutureOr<T> Function(S) get _onValue {
-    assert(handlesValue);
-    return callback as dynamic;
-  }
-
-  Function? get _onError => errorCallback;
-
-  _FutureErrorTest get _errorTest {
-    assert(hasErrorTest);
-    return callback as dynamic;
-  }
-
-  _FutureAction get _whenCompleteAction {
-    assert(handlesComplete);
-    return callback as dynamic;
-  }
-
-  /// Whether this listener has an error callback.
-  ///
-  /// This function must only be called if the listener [handlesError].
-  bool get hasErrorCallback {
-    assert(handlesError);
-    return _onError != null;
-  }
-
-  FutureOr<T> handleValue(S sourceResult) {
-    return _zone.runUnary<FutureOr<T>, S>(_onValue, sourceResult);
-  }
-
-  bool matchesErrorTest(AsyncError asyncError) {
-    if (!hasErrorTest) return true;
-    return _zone.runUnary<bool, Object>(_errorTest, asyncError.error);
-  }
-
-  FutureOr<T> handleError(AsyncError asyncError) {
-    assert(handlesError && hasErrorCallback);
-    var errorCallback = this.errorCallback; // To enable promotion.
-    // If the errorCallback returns something which is not a FutureOr<T>,
-    // this return statement throws, and the caller handles the error.
-    if (errorCallback is dynamic Function(Object, StackTrace)) {
-      return _zone.runBinary<dynamic, Object, StackTrace>(
-          errorCallback, asyncError.error, asyncError.stackTrace);
-    } else {
-      return _zone.runUnary<dynamic, Object>(
-          errorCallback as dynamic, asyncError.error);
-    }
-  }
-
-  dynamic handleWhenComplete() {
-    assert(!handlesError);
-    return _zone.run(_whenCompleteAction);
-  }
-}
-
-class _Future<T> implements Future<T> {
-  /// Initial state, waiting for a result. In this state, the
-  /// [resultOrListeners] field holds a single-linked list of
-  /// [_FutureListener] listeners.
-  static const int _stateIncomplete = 0;
-
-  /// Pending completion. Set when completed using [_asyncComplete] or
-  /// [_asyncCompleteError]. It is an error to try to complete it again.
-  /// [resultOrListeners] holds listeners.
-  static const int _statePendingComplete = 1;
-
-  /// The future has been chained to another future. The result of that
-  /// other future becomes the result of this future as well.
-  /// [resultOrListeners] contains the source future.
-  static const int _stateChained = 2;
-
-  /// The future has been completed with a value result.
-  static const int _stateValue = 4;
-
-  /// The future has been completed with an error result.
-  static const int _stateError = 8;
-
-  /** Whether the future is complete, and as what. */
-  int _state = _stateIncomplete;
-
-  /**
-   * Zone that the future was completed from.
-   * This is the zone that an error result belongs to.
-   *
-   * Until the future is completed, the field may hold the zone that
-   * listener callbacks used to create this future should be run in.
-   */
-  final _Zone _zone;
-
-  /**
-   * Either the result, a list of listeners or another future.
-   *
-   * The result of the future is either a value or an error.
-   * A result is only stored when the future has completed.
-   *
-   * The listeners is an internally linked list of [_FutureListener]s.
-   * Listeners are only remembered while the future is not yet complete,
-   * and it is not chained to another future.
-   *
-   * The future is another future that his future is chained to. This future
-   * is waiting for the other future to complete, and when it does, this future
-   * will complete with the same result.
-   * All listeners are forwarded to the other future.
-   */
-  @pragma("vm:entry-point")
-  var _resultOrListeners;
-
-  // This constructor is used by async/await.
-  _Future() : _zone = Zone._current;
-
-  _Future.immediate(FutureOr<T> result) : _zone = Zone._current {
-    _asyncComplete(result);
-  }
-
-  /** Creates a future with the value and the specified zone. */
-  _Future.zoneValue(T value, this._zone) {
-    _setValue(value);
-  }
-
-  _Future.immediateError(var error, StackTrace stackTrace)
-      : _zone = Zone._current {
-    _asyncCompleteError(error, stackTrace);
-  }
-
-  /** Creates a future that is already completed with the value. */
-  _Future.value(T value) : this.zoneValue(value, Zone._current);
-
-  bool get _mayComplete => _state == _stateIncomplete;
-  bool get _isPendingComplete => _state == _statePendingComplete;
-  bool get _mayAddListener => _state <= _statePendingComplete;
-  bool get _isChained => _state == _stateChained;
-  bool get _isComplete => _state >= _stateValue;
-  bool get _hasError => _state == _stateError;
-
-  static List<Function>? _continuationFunctions(_Future<Object> future) {
-    List<Function>? result = null;
-    while (true) {
-      if (future._mayAddListener) return result;
-      assert(!future._isComplete);
-      assert(!future._isChained);
-      // So _resultOrListeners contains listeners.
-      _FutureListener<Object, Object>? listener = future._resultOrListeners;
-      if (listener != null &&
-          listener._nextListener == null &&
-          listener.isAwait) {
-        (result ??= <Function>[]).add(listener.handleValue);
-        future = listener.result;
-        assert(!future._isComplete);
-      } else {
-        break;
-      }
-    }
-    return result;
-  }
-
-  void _setChained(_Future source) {
-    assert(_mayAddListener);
-    _state = _stateChained;
-    _resultOrListeners = source;
-  }
-
-  Future<R> then<R>(FutureOr<R> f(T value), {Function? onError}) {
-    Zone currentZone = Zone.current;
-    if (!identical(currentZone, _rootZone)) {
-      f = currentZone.registerUnaryCallback<FutureOr<R>, T>(f);
-      if (onError != null) {
-        // In checked mode, this checks that onError is assignable to one of:
-        //   dynamic Function(Object)
-        //   dynamic Function(Object, StackTrace)
-        onError = _registerErrorHandler(onError, currentZone);
-      }
-    }
-    _Future<R> result = new _Future<R>();
-    _addListener(new _FutureListener<T, R>.then(result, f, onError));
-    return result;
-  }
-
-  /// Registers a system created result and error continuation.
-  ///
-  /// Used by the implementation of `await` to listen to a future.
-  /// The system created liseners are not registered in the zone,
-  /// and the listener is marked as being from an `await`.
-  /// This marker is used in [_continuationFunctions].
-  Future<E> _thenAwait<E>(FutureOr<E> f(T value), Function onError) {
-    _Future<E> result = new _Future<E>();
-    _addListener(new _FutureListener<T, E>.thenAwait(result, f, onError));
-    return result;
-  }
-
-  Future<T> catchError(Function onError, {bool test(Object error)?}) {
-    _Future<T> result = new _Future<T>();
-    if (!identical(result._zone, _rootZone)) {
-      onError = _registerErrorHandler(onError, result._zone);
-      if (test != null) test = result._zone.registerUnaryCallback(test);
-    }
-    _addListener(new _FutureListener<T, T>.catchError(result, onError, test));
-    return result;
-  }
-
-  Future<T> whenComplete(dynamic action()) {
-    _Future<T> result = new _Future<T>();
-    if (!identical(result._zone, _rootZone)) {
-      action = result._zone.registerCallback<dynamic>(action);
-    }
-    _addListener(new _FutureListener<T, T>.whenComplete(result, action));
-    return result;
-  }
-
-  Stream<T> asStream() => new Stream<T>.fromFuture(this);
-
-  void _setPendingComplete() {
-    assert(_mayComplete);
-    _state = _statePendingComplete;
-  }
-
-  void _clearPendingComplete() {
-    assert(_isPendingComplete);
-    _state = _stateIncomplete;
-  }
-
-  AsyncError get _error {
-    assert(_hasError);
-    return _resultOrListeners;
-  }
-
-  _Future get _chainSource {
-    assert(_isChained);
-    return _resultOrListeners;
-  }
-
-  // This method is used by async/await.
-  void _setValue(T value) {
-    assert(!_isComplete); // But may have a completion pending.
-    _state = _stateValue;
-    _resultOrListeners = value;
-  }
-
-  void _setErrorObject(AsyncError error) {
-    assert(!_isComplete); // But may have a completion pending.
-    _state = _stateError;
-    _resultOrListeners = error;
-  }
-
-  void _setError(Object error, StackTrace stackTrace) {
-    _setErrorObject(new AsyncError(error, stackTrace));
-  }
-
-  /// Copy the completion result of [source] into this future.
-  ///
-  /// Used when a chained future notices that its source is completed.
-  void _cloneResult(_Future source) {
-    assert(!_isComplete);
-    assert(source._isComplete);
-    _state = source._state;
-    _resultOrListeners = source._resultOrListeners;
-  }
-
-  void _addListener(_FutureListener listener) {
-    assert(listener._nextListener == null);
-    if (_mayAddListener) {
-      listener._nextListener = _resultOrListeners;
-      _resultOrListeners = listener;
-    } else {
-      if (_isChained) {
-        // Delegate listeners to chained source future.
-        // If the source is complete, instead copy its values and
-        // drop the chaining.
-        _Future source = _chainSource;
-        if (!source._isComplete) {
-          source._addListener(listener);
-          return;
-        }
-        _cloneResult(source);
-      }
-      assert(_isComplete);
-      // Handle late listeners asynchronously.
-      _zone.scheduleMicrotask(() {
-        _propagateToListeners(this, listener);
-      });
-    }
-  }
-
-  void _prependListeners(_FutureListener? listeners) {
-    if (listeners == null) return;
-    if (_mayAddListener) {
-      _FutureListener? existingListeners = _resultOrListeners;
-      _resultOrListeners = listeners;
-      if (existingListeners != null) {
-        _FutureListener cursor = listeners;
-        _FutureListener? next = cursor._nextListener;
-        while (next != null) {
-          cursor = next;
-          next = cursor._nextListener;
-        }
-        cursor._nextListener = existingListeners;
-      }
-    } else {
-      if (_isChained) {
-        // Delegate listeners to chained source future.
-        // If the source is complete, instead copy its values and
-        // drop the chaining.
-        _Future source = _chainSource;
-        if (!source._isComplete) {
-          source._prependListeners(listeners);
-          return;
-        }
-        _cloneResult(source);
-      }
-      assert(_isComplete);
-      listeners = _reverseListeners(listeners);
-      _zone.scheduleMicrotask(() {
-        _propagateToListeners(this, listeners);
-      });
-    }
-  }
-
-  _FutureListener? _removeListeners() {
-    // Reverse listeners before returning them, so the resulting list is in
-    // subscription order.
-    assert(!_isComplete);
-    _FutureListener? current = _resultOrListeners;
-    _resultOrListeners = null;
-    return _reverseListeners(current);
-  }
-
-  _FutureListener? _reverseListeners(_FutureListener? listeners) {
-    _FutureListener? prev = null;
-    _FutureListener? current = listeners;
-    while (current != null) {
-      _FutureListener? next = current._nextListener;
-      current._nextListener = prev;
-      prev = current;
-      current = next;
-    }
-    return prev;
-  }
-
-  // Take the value (when completed) of source and complete target with that
-  // value (or error). This function could chain all Futures, but is slower
-  // for _Future than _chainCoreFuture, so you must use _chainCoreFuture
-  // in that case.
-  static void _chainForeignFuture(Future source, _Future target) {
-    assert(!target._isComplete);
-    assert(source is! _Future);
-
-    // Mark the target as chained (and as such half-completed).
-    target._setPendingComplete();
-    try {
-      source.then((value) {
-        assert(target._isPendingComplete);
-        // The "value" may be another future if the foreign future
-        // implementation is mis-behaving,
-        // so use _complete instead of _completeWithValue.
-        target._clearPendingComplete(); // Clear this first, it's set again.
-        target._complete(value);
-      }, onError: (Object error, StackTrace stackTrace) {
-        assert(target._isPendingComplete);
-        target._completeError(error, stackTrace);
-      });
-    } catch (e, s) {
-      // This only happens if the `then` call threw synchronously when given
-      // valid arguments.
-      // That requires a non-conforming implementation of the Future interface,
-      // which should, hopefully, never happen.
-      scheduleMicrotask(() {
-        target._completeError(e, s);
-      });
-    }
-  }
-
-  // Take the value (when completed) of source and complete target with that
-  // value (or error). This function expects that source is a _Future.
-  static void _chainCoreFuture(_Future source, _Future target) {
-    assert(target._mayAddListener); // Not completed, not already chained.
-    while (source._isChained) {
-      source = source._chainSource;
-    }
-    if (source._isComplete) {
-      _FutureListener? listeners = target._removeListeners();
-      target._cloneResult(source);
-      _propagateToListeners(target, listeners);
-    } else {
-      _FutureListener? listeners = target._resultOrListeners;
-      target._setChained(source);
-      source._prependListeners(listeners);
-    }
-  }
-
-  void _complete(FutureOr<T> value) {
-    assert(!_isComplete);
-    if (value is Future<T>) {
-      if (value is _Future<T>) {
-        _chainCoreFuture(value, this);
-      } else {
-        _chainForeignFuture(value, this);
-      }
-    } else {
-      _FutureListener? listeners = _removeListeners();
-      // TODO(40014): Remove cast when type promotion works.
-      // This would normally be `as T` but we use `as dynamic` to make the
-      // unneeded check be implict to match dart2js unsound optimizations in the
-      // user code.
-      _setValue(value as dynamic); // Value promoted to T.
-      _propagateToListeners(this, listeners);
-    }
-  }
-
-  void _completeWithValue(T value) {
-    assert(!_isComplete);
-    assert(value is! Future<T>);
-
-    _FutureListener? listeners = _removeListeners();
-    _setValue(value);
-    _propagateToListeners(this, listeners);
-  }
-
-  void _completeError(Object error, StackTrace stackTrace) {
-    assert(!_isComplete);
-
-    _FutureListener? listeners = _removeListeners();
-    _setError(error, stackTrace);
-    _propagateToListeners(this, listeners);
-  }
-
-  void _asyncComplete(FutureOr<T> value) {
-    assert(!_isComplete);
-    // Two corner cases if the value is a future:
-    //   1. the future is already completed and an error.
-    //   2. the future is not yet completed but might become an error.
-    // The first case means that we must not immediately complete the Future,
-    // as our code would immediately start propagating the error without
-    // giving the time to install error-handlers.
-    // However the second case requires us to deal with the value immediately.
-    // Otherwise the value could complete with an error and report an
-    // unhandled error, even though we know we are already going to listen to
-    // it.
-
-    if (value is Future<T>) {
-      _chainFuture(value);
-      return;
-    }
-    // TODO(40014): Remove cast when type promotion works.
-    // This would normally be `as T` but we use `as dynamic` to make the
-    // unneeded check be implict to match dart2js unsound optimizations in the
-    // user code.
-    _asyncCompleteWithValue(value as dynamic); // Value promoted to T.
-  }
-
-  void _asyncCompleteWithValue(T value) {
-    _setPendingComplete();
-    _zone.scheduleMicrotask(() {
-      _completeWithValue(value);
-    });
-  }
-
-  void _chainFuture(Future<T> value) {
-    if (value is _Future<T>) {
-      if (value._hasError) {
-        // Delay completion to allow the user to register callbacks.
-        _setPendingComplete();
-        _zone.scheduleMicrotask(() {
-          _chainCoreFuture(value, this);
-        });
-      } else {
-        _chainCoreFuture(value, this);
-      }
-      return;
-    }
-    // Just listen on the foreign future. This guarantees an async delay.
-    _chainForeignFuture(value, this);
-  }
-
-  void _asyncCompleteError(Object error, StackTrace stackTrace) {
-    assert(!_isComplete);
-
-    _setPendingComplete();
-    _zone.scheduleMicrotask(() {
-      _completeError(error, stackTrace);
-    });
-  }
-
-  /**
-   * Propagates the value/error of [source] to its [listeners], executing the
-   * listeners' callbacks.
-   */
-  static void _propagateToListeners(
-      _Future source, _FutureListener? listeners) {
-    while (true) {
-      assert(source._isComplete);
-      bool hasError = source._hasError;
-      if (listeners == null) {
-        if (hasError) {
-          AsyncError asyncError = source._error;
-          source._zone
-              .handleUncaughtError(asyncError.error, asyncError.stackTrace);
-        }
-        return;
-      }
-      // Usually futures only have one listener. If they have several, we
-      // call handle them separately in recursive calls, continuing
-      // here only when there is only one listener left.
-      _FutureListener listener = listeners;
-      _FutureListener? nextListener = listener._nextListener;
-      while (nextListener != null) {
-        listener._nextListener = null;
-        _propagateToListeners(source, listener);
-        listener = nextListener;
-        nextListener = listener._nextListener;
-      }
-
-      final sourceResult = source._resultOrListeners;
-      // Do the actual propagation.
-      // Set initial state of listenerHasError and listenerValueOrError. These
-      // variables are updated with the outcome of potential callbacks.
-      // Non-error results, including futures, are stored in
-      // listenerValueOrError and listenerHasError is set to false. Errors
-      // are stored in listenerValueOrError as an [AsyncError] and
-      // listenerHasError is set to true.
-      bool listenerHasError = hasError;
-      var listenerValueOrError = sourceResult;
-
-      // Only if we either have an error or callbacks, go into this, somewhat
-      // expensive, branch. Here we'll enter/leave the zone. Many futures
-      // don't have callbacks, so this is a significant optimization.
-      if (hasError || listener.handlesValue || listener.handlesComplete) {
-        _Zone zone = listener._zone;
-        if (hasError && !source._zone.inSameErrorZone(zone)) {
-          // Don't cross zone boundaries with errors.
-          AsyncError asyncError = source._error;
-          source._zone
-              .handleUncaughtError(asyncError.error, asyncError.stackTrace);
-          return;
-        }
-
-        _Zone? oldZone;
-        if (!identical(Zone._current, zone)) {
-          // Change zone if it's not current.
-          oldZone = Zone._enter(zone);
-        }
-
-        // These callbacks are abstracted to isolate the try/catch blocks
-        // from the rest of the code to work around a V8 glass jaw.
-        void handleWhenCompleteCallback() {
-          // The whenComplete-handler is not combined with normal value/error
-          // handling. This means at most one handleX method is called per
-          // listener.
-          assert(!listener.handlesValue);
-          assert(!listener.handlesError);
-          var completeResult;
-          try {
-            completeResult = listener.handleWhenComplete();
-          } catch (e, s) {
-            if (hasError && identical(source._error.error, e)) {
-              listenerValueOrError = source._error;
-            } else {
-              listenerValueOrError = new AsyncError(e, s);
-            }
-            listenerHasError = true;
-            return;
-          }
-          if (completeResult is _Future && completeResult._isComplete) {
-            if (completeResult._hasError) {
-              listenerValueOrError = completeResult._error;
-              listenerHasError = true;
-            }
-            // Otherwise use the existing result of source.
-            return;
-          }
-          if (completeResult is Future) {
-            // We have to wait for the completeResult future to complete
-            // before knowing if it's an error or we should use the result
-            // of source.
-            var originalSource = source;
-            listenerValueOrError = completeResult.then((_) => originalSource);
-            listenerHasError = false;
-          }
-        }
-
-        void handleValueCallback() {
-          try {
-            listenerValueOrError = listener.handleValue(sourceResult);
-          } catch (e, s) {
-            listenerValueOrError = new AsyncError(e, s);
-            listenerHasError = true;
-          }
-        }
-
-        void handleError() {
-          try {
-            AsyncError asyncError = source._error;
-            if (listener.matchesErrorTest(asyncError) &&
-                listener.hasErrorCallback) {
-              listenerValueOrError = listener.handleError(asyncError);
-              listenerHasError = false;
-            }
-          } catch (e, s) {
-            if (identical(source._error.error, e)) {
-              listenerValueOrError = source._error;
-            } else {
-              listenerValueOrError = new AsyncError(e, s);
-            }
-            listenerHasError = true;
-          }
-        }
-
-        if (listener.handlesComplete) {
-          handleWhenCompleteCallback();
-        } else if (!hasError) {
-          if (listener.handlesValue) {
-            handleValueCallback();
-          }
-        } else {
-          if (listener.handlesError) {
-            handleError();
-          }
-        }
-
-        // If we changed zone, oldZone will not be null.
-        if (oldZone != null) Zone._leave(oldZone);
-
-        // If the listener's value is a future we need to chain it. Note that
-        // this can only happen if there is a callback.
-        if (listenerValueOrError is Future) {
-          Future chainSource = listenerValueOrError;
-          // Shortcut if the chain-source is already completed. Just continue
-          // the loop.
-          _Future result = listener.result;
-          if (chainSource is _Future) {
-            if (chainSource._isComplete) {
-              listeners = result._removeListeners();
-              result._cloneResult(chainSource);
-              source = chainSource;
-              continue;
-            } else {
-              _chainCoreFuture(chainSource, result);
-            }
-          } else {
-            _chainForeignFuture(chainSource, result);
-          }
-          return;
-        }
-      }
-      _Future result = listener.result;
-      listeners = result._removeListeners();
-      if (!listenerHasError) {
-        result._setValue(listenerValueOrError);
-      } else {
-        AsyncError asyncError = listenerValueOrError;
-        result._setErrorObject(asyncError);
-      }
-      // Prepare for next round.
-      source = result;
-    }
-  }
-
-  Future<T> timeout(Duration timeLimit, {FutureOr<T> onTimeout()?}) {
-    if (_isComplete) return new _Future.immediate(this);
-    _Future<T> result = new _Future<T>();
-    Timer timer;
-    if (onTimeout == null) {
-      timer = new Timer(timeLimit, () {
-        result._completeError(
-            new TimeoutException("Future not completed", timeLimit),
-            StackTrace.empty);
-      });
-    } else {
-      Zone zone = Zone.current;
-      FutureOr<T> Function() onTimeoutHandler =
-          zone.registerCallback(onTimeout);
-
-      timer = new Timer(timeLimit, () {
-        try {
-          result._complete(zone.run(onTimeoutHandler));
-        } catch (e, s) {
-          result._completeError(e, s);
-        }
-      });
-    }
-    this.then((T v) {
-      if (timer.isActive) {
-        timer.cancel();
-        result._completeWithValue(v);
-      }
-    }, onError: (Object e, StackTrace s) {
-      if (timer.isActive) {
-        timer.cancel();
-        result._completeError(e, s);
-      }
-    });
-    return result;
-  }
-}
-
-/// Registers errorHandler in zone if it has the correct type.
-///
-/// Checks that the function accepts either an [Object] and a [StackTrace]
-/// or just one [Object]. Does not check the return type.
-/// The actually returned value must be `FutureOr<R>` where `R` is the
-/// value type of the future that the call will complete (either returned
-/// by [Future.then] or [Future.catchError]). We check the returned value
-/// dynamically because the functions are passed as arguments in positions
-/// without inference, so a function expression won't infer the return type.
-///
-/// Throws if the type is not valid.
-Function _registerErrorHandler(Function errorHandler, Zone zone) {
-  if (errorHandler is dynamic Function(Object, StackTrace)) {
-    return zone
-        .registerBinaryCallback<dynamic, Object, StackTrace>(errorHandler);
-  }
-  if (errorHandler is dynamic Function(Object)) {
-    return zone.registerUnaryCallback<dynamic, Object>(errorHandler);
-  }
-  throw new ArgumentError.value(
-      errorHandler,
-      "onError",
-      "Error handler must accept one Object or one Object and a StackTrace"
-          " as arguments, and return a a valid result");
-}
diff --git a/sdk_nnbd/lib/async/schedule_microtask.dart b/sdk_nnbd/lib/async/schedule_microtask.dart
deleted file mode 100644
index 940989c..0000000
--- a/sdk_nnbd/lib/async/schedule_microtask.dart
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.async;
-
-typedef void _AsyncCallback();
-
-class _AsyncCallbackEntry {
-  final _AsyncCallback callback;
-  _AsyncCallbackEntry? next;
-  _AsyncCallbackEntry(this.callback);
-}
-
-/** Head of single linked list of pending callbacks. */
-_AsyncCallbackEntry? _nextCallback;
-/** Tail of single linked list of pending callbacks. */
-_AsyncCallbackEntry? _lastCallback;
-/**
- * Tail of priority callbacks added by the currently executing callback.
- *
- * Priority callbacks are put at the beginning of the
- * callback queue, so that if one callback schedules more than one
- * priority callback, they are still enqueued in scheduling order.
- */
-_AsyncCallbackEntry? _lastPriorityCallback;
-/**
- * Whether we are currently inside the callback loop.
- *
- * If we are inside the loop, we never need to schedule the loop,
- * even if adding a first element.
- */
-bool _isInCallbackLoop = false;
-
-void _microtaskLoop() {
-  for (var entry = _nextCallback; entry != null; entry = _nextCallback) {
-    _lastPriorityCallback = null;
-    var next = entry.next;
-    _nextCallback = next;
-    if (next == null) _lastCallback = null;
-    (entry.callback)();
-  }
-}
-
-void _startMicrotaskLoop() {
-  _isInCallbackLoop = true;
-  try {
-    // Moved to separate function because try-finally prevents
-    // good optimization.
-    _microtaskLoop();
-  } finally {
-    _lastPriorityCallback = null;
-    _isInCallbackLoop = false;
-    if (_nextCallback != null) {
-      _AsyncRun._scheduleImmediate(_startMicrotaskLoop);
-    }
-  }
-}
-
-/**
- * Schedules a callback to be called as a microtask.
- *
- * The microtask is called after all other currently scheduled
- * microtasks, but as part of the current system event.
- */
-void _scheduleAsyncCallback(_AsyncCallback callback) {
-  _AsyncCallbackEntry newEntry = new _AsyncCallbackEntry(callback);
-  _AsyncCallbackEntry? lastCallback = _lastCallback;
-  if (lastCallback == null) {
-    _nextCallback = _lastCallback = newEntry;
-    if (!_isInCallbackLoop) {
-      _AsyncRun._scheduleImmediate(_startMicrotaskLoop);
-    }
-  } else {
-    lastCallback.next = newEntry;
-    _lastCallback = newEntry;
-  }
-}
-
-/**
- * Schedules a callback to be called before all other currently scheduled ones.
- *
- * This callback takes priority over existing scheduled callbacks.
- * It is only used internally to give higher priority to error reporting.
- *
- * Is always run in the root zone.
- */
-void _schedulePriorityAsyncCallback(_AsyncCallback callback) {
-  if (_nextCallback == null) {
-    _scheduleAsyncCallback(callback);
-    _lastPriorityCallback = _lastCallback;
-    return;
-  }
-  _AsyncCallbackEntry entry = new _AsyncCallbackEntry(callback);
-  _AsyncCallbackEntry? lastPriorityCallback = _lastPriorityCallback;
-  if (lastPriorityCallback == null) {
-    entry.next = _nextCallback;
-    _nextCallback = _lastPriorityCallback = entry;
-  } else {
-    var next = lastPriorityCallback.next;
-    entry.next = next;
-    lastPriorityCallback.next = entry;
-    _lastPriorityCallback = entry;
-    if (next == null) {
-      _lastCallback = entry;
-    }
-  }
-}
-
-/**
- * Runs a function asynchronously.
- *
- * Callbacks registered through this function are always executed in order and
- * are guaranteed to run before other asynchronous events (like [Timer] events,
- * or DOM events).
- *
- * **Warning:** it is possible to starve the DOM by registering asynchronous
- * callbacks through this method. For example the following program runs
- * the callbacks without ever giving the Timer callback a chance to execute:
- *
- *     main() {
- *       Timer.run(() { print("executed"); });  // Will never be executed.
- *       foo() {
- *         scheduleMicrotask(foo);  // Schedules [foo] in front of other events.
- *       }
- *       foo();
- *     }
- *
- * ## Other resources
- *
- * * [The Event Loop and Dart](https://www.dartlang.org/articles/event-loop/):
- * Learn how Dart handles the event queue and microtask queue, so you can write
- * better asynchronous code with fewer surprises.
- */
-void scheduleMicrotask(void Function() callback) {
-  _Zone currentZone = Zone._current;
-  if (identical(_rootZone, currentZone)) {
-    // No need to bind the callback. We know that the root's scheduleMicrotask
-    // will be invoked in the root zone.
-    _rootScheduleMicrotask(null, null, _rootZone, callback);
-    return;
-  }
-  _ZoneFunction implementation = currentZone._scheduleMicrotask;
-  if (identical(_rootZone, implementation.zone) &&
-      _rootZone.inSameErrorZone(currentZone)) {
-    _rootScheduleMicrotask(
-        null, null, currentZone, currentZone.registerCallback(callback));
-    return;
-  }
-  Zone.current.scheduleMicrotask(Zone.current.bindCallbackGuarded(callback));
-}
-
-class _AsyncRun {
-  /** Schedule the given callback before any other event in the event-loop. */
-  external static void _scheduleImmediate(void Function() callback);
-}
diff --git a/sdk_nnbd/lib/async/stream.dart b/sdk_nnbd/lib/async/stream.dart
deleted file mode 100644
index 46ec161..0000000
--- a/sdk_nnbd/lib/async/stream.dart
+++ /dev/null
@@ -1,2232 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.async;
-
-// -------------------------------------------------------------------
-// Core Stream types
-// -------------------------------------------------------------------
-
-typedef void _TimerCallback();
-
-/**
- * A source of asynchronous data events.
- *
- * A Stream provides a way to receive a sequence of events.
- * Each event is either a data event, also called an *element* of the stream,
- * or an error event, which is a notification that something has failed.
- * When a stream has emitted all its event,
- * a single "done" event will notify the listener that the end has been reached.
- *
- * You [listen] on a stream to make it start generating events,
- * and to set up listeners that receive the events.
- * When you listen, you receive a [StreamSubscription] object
- * which is the active object providing the events,
- * and which can be used to stop listening again,
- * or to temporarily pause events from the subscription.
- *
- * There are two kinds of streams: "Single-subscription" streams and
- * "broadcast" streams.
- *
- * *A single-subscription stream* allows only a single listener during the whole
- * lifetime of the stream.
- * It doesn't start generating events until it has a listener,
- * and it stops sending events when the listener is unsubscribed,
- * even if the source of events could still provide more.
- *
- * Listening twice on a single-subscription stream is not allowed, even after
- * the first subscription has been canceled.
- *
- * Single-subscription streams are generally used for streaming chunks of
- * larger contiguous data like file I/O.
- *
- * *A broadcast stream* allows any number of listeners, and it fires
- * its events when they are ready, whether there are listeners or not.
- *
- * Broadcast streams are used for independent events/observers.
- *
- * If several listeners want to listen to a single subscription stream,
- * use [asBroadcastStream] to create a broadcast stream on top of the
- * non-broadcast stream.
- *
- * On either kind of stream, stream transformations, such as [where] and
- * [skip], return the same type of stream as the one the method was called on,
- * unless otherwise noted.
- *
- * When an event is fired, the listener(s) at that time will receive the event.
- * If a listener is added to a broadcast stream while an event is being fired,
- * that listener will not receive the event currently being fired.
- * If a listener is canceled, it immediately stops receiving events.
- * Listening on a broadcast stream can be treated as listening on a new stream
- * containing only the events that have not yet been emitted when the [listen]
- * call occurs.
- * For example, the [first] getter listens to the stream, then returns the first
- * event that listener receives.
- * This is not necessarily the first even emitted by the stream, but the first
- * of the *remaining* events of the broadcast stream.
- *
- * When the "done" event is fired, subscribers are unsubscribed before
- * receiving the event. After the event has been sent, the stream has no
- * subscribers. Adding new subscribers to a broadcast stream after this point
- * is allowed, but they will just receive a new "done" event as soon
- * as possible.
- *
- * Stream subscriptions always respect "pause" requests. If necessary they need
- * to buffer their input, but often, and preferably, they can simply request
- * their input to pause too.
- *
- * The default implementation of [isBroadcast] returns false.
- * A broadcast stream inheriting from [Stream] must override [isBroadcast]
- * to return `true`.
- */
-abstract class Stream<T> {
-  Stream();
-
-  /**
-   * Internal use only. We do not want to promise that Stream stays const.
-   *
-   * If mixins become compatible with const constructors, we may use a
-   * stream mixin instead of extending Stream from a const class.
-   */
-  const Stream._internal();
-
-  /**
-   * Creates an empty broadcast stream.
-   *
-   * This is a stream which does nothing except sending a done event
-   * when it's listened to.
-   */
-  const factory Stream.empty() = _EmptyStream<T>;
-
-  /**
-   * Creates a stream which emits a single data event before completing.
-   *
-   * This stream emits a single data event of [value]
-   * and then completes with a done event.
-   *
-   * Example:
-   * ```dart
-   * Future<void> printThings(Stream<String> data) async {
-   *   await for (var x in data) {
-   *     print(x);
-   *   }
-   * }
-   * printThings(Stream<String>.value("ok")); // prints "ok".
-   * ```
-   *
-   * The returned stream is effectively equivalent to one created by
-   * `(() async* { yield value; } ())` or `Future<T>.value(value).asStream()`.
-   */
-  @Since("2.5")
-  factory Stream.value(T value) =>
-      (_AsyncStreamController<T>(null, null, null, null)
-            .._add(value)
-            .._closeUnchecked())
-          .stream;
-
-  /**
-   * Creates a stream which emits a single error event before completing.
-   *
-   * This stream emits a single error event of [error] and [stackTrace]
-   * and then completes with a done event.
-   *
-   * Example:
-   * ```dart
-   * Future<void> tryThings(Stream<int> data) async {
-   *   try {
-   *     await for (var x in data) {
-   *       print("Data: $x");
-   *     }
-   *   } catch (e) {
-   *     print(e);
-   *   }
-   * }
-   * tryThings(Stream<int>.error("Error")); // prints "Error".
-   * ```
-   * The returned stream is effectively equivalent to one created by
-   * `Future<T>.error(error, stackTrace).asStream()`, by or
-   * `(() async* { throw error; } ())`, except that you can control the
-   * stack trace as well.
-   */
-  @Since("2.5")
-  factory Stream.error(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    return (_AsyncStreamController<T>(null, null, null, null)
-          .._addError(error, stackTrace ?? AsyncError.defaultStackTrace(error))
-          .._closeUnchecked())
-        .stream;
-  }
-
-  /**
-   * Creates a new single-subscription stream from the future.
-   *
-   * When the future completes, the stream will fire one event, either
-   * data or error, and then close with a done-event.
-   */
-  factory Stream.fromFuture(Future<T> future) {
-    // Use the controller's buffering to fill in the value even before
-    // the stream has a listener. For a single value, it's not worth it
-    // to wait for a listener before doing the `then` on the future.
-    _StreamController<T> controller =
-        new _SyncStreamController<T>(null, null, null, null);
-    future.then((value) {
-      controller._add(value);
-      controller._closeUnchecked();
-    }, onError: (error, stackTrace) {
-      controller._addError(error, stackTrace);
-      controller._closeUnchecked();
-    });
-    return controller.stream;
-  }
-
-  /**
-   * Create a stream from a group of futures.
-   *
-   * The stream reports the results of the futures on the stream in the order
-   * in which the futures complete.
-   * Each future provides either a data event or an error event,
-   * depending on how the future completes.
-   *
-   * If some futures have already completed when `Stream.fromFutures` is called,
-   * their results will be emitted in some unspecified order.
-   *
-   * When all futures have completed, the stream is closed.
-   *
-   * If [futures] is empty, the stream closes as soon as possible.
-   */
-  factory Stream.fromFutures(Iterable<Future<T>> futures) {
-    _StreamController<T> controller =
-        new _SyncStreamController<T>(null, null, null, null);
-    int count = 0;
-    // Declare these as variables holding closures instead of as
-    // function declarations.
-    // This avoids creating a new closure from the functions for each future.
-    void onValue(T value) {
-      if (!controller.isClosed) {
-        controller._add(value);
-        if (--count == 0) controller._closeUnchecked();
-      }
-    }
-
-    void onError(Object error, StackTrace stack) {
-      if (!controller.isClosed) {
-        controller._addError(error, stack);
-        if (--count == 0) controller._closeUnchecked();
-      }
-    }
-
-    // The futures are already running, so start listening to them immediately
-    // (instead of waiting for the stream to be listened on).
-    // If we wait, we might not catch errors in the futures in time.
-    for (var future in futures) {
-      count++;
-      future.then(onValue, onError: onError);
-    }
-    // Use schedule microtask since controller is sync.
-    if (count == 0) scheduleMicrotask(controller.close);
-    return controller.stream;
-  }
-
-  /**
-   * Creates a single-subscription stream that gets its data from [elements].
-   *
-   * The iterable is iterated when the stream receives a listener, and stops
-   * iterating if the listener cancels the subscription, or if the
-   * [Iterator.moveNext] method returns `false` or throws.
-   * Iteration is suspended while the stream subscription is paused.
-   *
-   * If calling [Iterator.moveNext] on `elements.iterator` throws,
-   * the stream emits that error and then it closes.
-   * If reading [Iterator.current] on `elements.iterator` throws,
-   * the stream emits that error, but keeps iterating.
-   */
-  factory Stream.fromIterable(Iterable<T> elements) {
-    return new _GeneratedStreamImpl<T>(
-        () => new _IterablePendingEvents<T>(elements));
-  }
-
-  /**
-   * Creates a stream that repeatedly emits events at [period] intervals.
-   *
-   * The event values are computed by invoking [computation]. The argument to
-   * this callback is an integer that starts with 0 and is incremented for
-   * every event.
-   *
-   * The [period] must a non-negative [Duration].
-   *
-   * If [computation] is omitted the event values will all be `null`.
-   *
-   * The [computation] must not be omitted if the event type [T] does not
-   * allow `null` as a value.
-   */
-  factory Stream.periodic(Duration period,
-      [T computation(int computationCount)?]) {
-    if (computation == null && !typeAcceptsNull<T>()) {
-      throw ArgumentError.value(null, "computation",
-          "Must not be omitted when the event type is non-nullable");
-    }
-    var controller = _SyncStreamController<T>(null, null, null, null);
-    // Counts the time that the Stream was running (and not paused).
-    Stopwatch watch = new Stopwatch();
-    controller.onListen = () {
-      int computationCount = 0;
-      void sendEvent(_) {
-        watch.reset();
-        if (computation != null) {
-          T event;
-          try {
-            event = computation(computationCount++);
-          } catch (e, s) {
-            controller.addError(e, s);
-            return;
-          }
-          controller.add(event);
-        } else {
-          controller.add(null as T); // We have checked that null is T.
-        }
-      }
-
-      Timer timer = Timer.periodic(period, sendEvent);
-      controller
-        ..onCancel = () {
-          timer.cancel();
-          return Future._nullFuture;
-        }
-        ..onPause = () {
-          watch.stop();
-          timer.cancel();
-        }
-        ..onResume = () {
-          Duration elapsed = watch.elapsed;
-          watch.start();
-          timer = new Timer(period - elapsed, () {
-            timer = Timer.periodic(period, sendEvent);
-            sendEvent(null);
-          });
-        };
-    };
-    return controller.stream;
-  }
-
-  /**
-   * Creates a stream where all events of an existing stream are piped through
-   * a sink-transformation.
-   *
-   * The given [mapSink] closure is invoked when the returned stream is
-   * listened to. All events from the [source] are added into the event sink
-   * that is returned from the invocation. The transformation puts all
-   * transformed events into the sink the [mapSink] closure received during
-   * its invocation. Conceptually the [mapSink] creates a transformation pipe
-   * with the input sink being the returned [EventSink] and the output sink
-   * being the sink it received.
-   *
-   * This constructor is frequently used to build transformers.
-   *
-   * Example use for a duplicating transformer:
-   *
-   *     class DuplicationSink implements EventSink<String> {
-   *       final EventSink<String> _outputSink;
-   *       DuplicationSink(this._outputSink);
-   *
-   *       void add(String data) {
-   *         _outputSink.add(data);
-   *         _outputSink.add(data);
-   *       }
-   *
-   *       void addError(e, [st]) { _outputSink.addError(e, st); }
-   *       void close() { _outputSink.close(); }
-   *     }
-   *
-   *     class DuplicationTransformer extends StreamTransformerBase<String, String> {
-   *       // Some generic types omitted for brevity.
-   *       Stream bind(Stream stream) => new Stream<String>.eventTransformed(
-   *           stream,
-   *           (EventSink sink) => new DuplicationSink(sink));
-   *     }
-   *
-   *     stringStream.transform(new DuplicationTransformer());
-   *
-   * The resulting stream is a broadcast stream if [source] is.
-   */
-  factory Stream.eventTransformed(
-      Stream<dynamic> source, EventSink<dynamic> mapSink(EventSink<T> sink)) {
-    return new _BoundSinkStream(source, mapSink);
-  }
-
-  /**
-   * Adapts [source] to be a `Stream<T>`.
-   *
-   * This allows [source] to be used at the new type, but at run-time it
-   * must satisfy the requirements of both the new type and its original type.
-   *
-   * Data events created by the source stream must also be instances of [T].
-   */
-  static Stream<T> castFrom<S, T>(Stream<S> source) =>
-      new CastStream<S, T>(source);
-
-  /**
-   * Whether this stream is a broadcast stream.
-   */
-  bool get isBroadcast => false;
-
-  /**
-   * Returns a multi-subscription stream that produces the same events as this.
-   *
-   * The returned stream will subscribe to this stream when its first
-   * subscriber is added, and will stay subscribed until this stream ends,
-   * or a callback cancels the subscription.
-   *
-   * If [onListen] is provided, it is called with a subscription-like object
-   * that represents the underlying subscription to this stream. It is
-   * possible to pause, resume or cancel the subscription during the call
-   * to [onListen]. It is not possible to change the event handlers, including
-   * using [StreamSubscription.asFuture].
-   *
-   * If [onCancel] is provided, it is called in a similar way to [onListen]
-   * when the returned stream stops having listener. If it later gets
-   * a new listener, the [onListen] function is called again.
-   *
-   * Use the callbacks, for example, for pausing the underlying subscription
-   * while having no subscribers to prevent losing events, or canceling the
-   * subscription when there are no listeners.
-   */
-  Stream<T> asBroadcastStream(
-      {void onListen(StreamSubscription<T> subscription)?,
-      void onCancel(StreamSubscription<T> subscription)?}) {
-    return new _AsBroadcastStream<T>(this, onListen, onCancel);
-  }
-
-  /**
-   * Adds a subscription to this stream.
-   *
-   * Returns a [StreamSubscription] which handles events from this stream using
-   * the provided [onData], [onError] and [onDone] handlers.
-   * The handlers can be changed on the subscription, but they start out
-   * as the provided functions.
-   *
-   * On each data event from this stream, the subscriber's [onData] handler
-   * is called. If [onData] is `null`, nothing happens.
-   *
-   * On errors from this stream, the [onError] handler is called with the
-   * error object and possibly a stack trace.
-   *
-   * The [onError] callback must be of type `void onError(Object error)` or
-   * `void onError(Object error, StackTrace stackTrace)`. If [onError] accepts
-   * two arguments it is called with the error object and the stack trace
-   * (which could be `null` if this stream itself received an error without
-   * stack trace).
-   * Otherwise it is called with just the error object.
-   * If [onError] is omitted, any errors on this stream are considered unhandled,
-   * and will be passed to the current [Zone]'s error handler.
-   * By default unhandled async errors are treated
-   * as if they were uncaught top-level errors.
-   *
-   * If this stream closes and sends a done event, the [onDone] handler is
-   * called. If [onDone] is `null`, nothing happens.
-   *
-   * If [cancelOnError] is true, the subscription is automatically canceled
-   * when the first error event is delivered. The default is `false`.
-   *
-   * While a subscription is paused, or when it has been canceled,
-   * the subscription doesn't receive events and none of the
-   * event handler functions are called.
-   */
-  StreamSubscription<T> listen(void onData(T event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError});
-
-  /**
-   * Creates a new stream from this stream that discards some elements.
-   *
-   * The new stream sends the same error and done events as this stream,
-   * but it only sends the data events that satisfy the [test].
-   *
-   * If the [test] function throws, the data event is dropped and the
-   * error is emitted on the returned stream instead.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * If a broadcast stream is listened to more than once, each subscription
-   * will individually perform the `test`.
-   */
-  Stream<T> where(bool test(T event)) {
-    return new _WhereStream<T>(this, test);
-  }
-
-  /**
-   * Transforms each element of this stream into a new stream event.
-   *
-   * Creates a new stream that converts each element of this stream
-   * to a new value using the [convert] function, and emits the result.
-   *
-   * For each data event, `o`, in this stream, the returned stream
-   * provides a data event with the value `convert(o)`.
-   * If [convert] throws, the returned stream reports it as an error
-   * event instead.
-   *
-   * Error and done events are passed through unchanged to the returned stream.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * The [convert] function is called once per data event per listener.
-   * If a broadcast stream is listened to more than once, each subscription
-   * will individually call [convert] on each data event.
-   *
-   * Unlike [transform], this method does not treat the stream as
-   * chunks of a single value. Instead each event is converted independently
-   * of the previous and following events, which may not always be correct.
-   * For example, UTF-8 encoding, or decoding, will give wrong results
-   * if a surrogate pair, or a multibyte UTF-8 encoding, is split into
-   * separate events, and those events are attempted encoded or decoded
-   * independently.
-   */
-  Stream<S> map<S>(S convert(T event)) {
-    return new _MapStream<T, S>(this, convert);
-  }
-
-  /**
-   * Creates a new stream with each data event of this stream asynchronously
-   * mapped to a new event.
-   *
-   * This acts like [map], except that [convert] may return a [Future],
-   * and in that case, this stream waits for that future to complete before
-   * continuing with its result.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   */
-  Stream<E> asyncMap<E>(FutureOr<E> convert(T event)) {
-    _StreamControllerBase<E> controller;
-    if (isBroadcast) {
-      controller = _SyncBroadcastStreamController<E>(null, null);
-    } else {
-      controller = _SyncStreamController<E>(null, null, null, null);
-    }
-
-    controller.onListen = () {
-      StreamSubscription<T> subscription = this.listen(null,
-          onError: controller._addError, // Avoid Zone error replacement.
-          onDone: controller.close);
-      FutureOr<Null> add(E value) {
-        controller.add(value);
-      }
-
-      final addError = controller._addError;
-      final resume = subscription.resume;
-      subscription.onData((T event) {
-        FutureOr<E> newValue;
-        try {
-          newValue = convert(event);
-        } catch (e, s) {
-          controller.addError(e, s);
-          return;
-        }
-        if (newValue is Future<E>) {
-          subscription.pause();
-          newValue.then(add, onError: addError).whenComplete(resume);
-        } else {
-          // TODO(40014): Remove cast when type promotion works.
-          controller.add(newValue as dynamic);
-        }
-      });
-      controller.onCancel = subscription.cancel;
-      if (!isBroadcast) {
-        controller
-          ..onPause = subscription.pause
-          ..onResume = resume;
-      }
-    };
-    return controller.stream;
-  }
-
-  /**
-   * Transforms each element into a sequence of asynchronous events.
-   *
-   * Returns a new stream and for each event of this stream, do the following:
-   *
-   * * If the event is an error event or a done event, it is emitted directly
-   * by the returned stream.
-   * * Otherwise it is an element. Then the [convert] function is called
-   * with the element as argument to produce a convert-stream for the element.
-   * * If that call throws, the error is emitted on the returned stream.
-   * * If the call returns `null`, no further action is taken for the elements.
-   * * Otherwise, this stream is paused and convert-stream is listened to.
-   * Every data and error event of the convert-stream is emitted on the returned
-   * stream in the order it is produced.
-   * When the convert-stream ends, this stream is resumed.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   */
-  Stream<E> asyncExpand<E>(Stream<E>? convert(T event)) {
-    _StreamControllerBase<E> controller;
-    if (isBroadcast) {
-      controller = _SyncBroadcastStreamController<E>(null, null);
-    } else {
-      controller = _SyncStreamController<E>(null, null, null, null);
-    }
-
-    controller.onListen = () {
-      StreamSubscription<T> subscription = this.listen(null,
-          onError: controller._addError, // Avoid Zone error replacement.
-          onDone: controller.close);
-      subscription.onData((T event) {
-        Stream<E>? newStream;
-        try {
-          newStream = convert(event);
-        } catch (e, s) {
-          controller.addError(e, s);
-          return;
-        }
-        if (newStream != null) {
-          subscription.pause();
-          controller.addStream(newStream).whenComplete(subscription.resume);
-        }
-      });
-      controller.onCancel = subscription.cancel;
-      if (!isBroadcast) {
-        controller
-          ..onPause = subscription.pause
-          ..onResume = subscription.resume;
-      }
-    };
-    return controller.stream;
-  }
-
-  /**
-   * Creates a wrapper Stream that intercepts some errors from this stream.
-   *
-   * If this stream sends an error that matches [test], then it is intercepted
-   * by the [onError] function.
-   *
-   * The [onError] callback must be of type `void onError(Object error)` or
-   * `void onError(Object error, StackTrace stackTrace)`.
-   * The function type determines whether [onError] is invoked with a stack
-   * trace argument.
-   * The stack trace argument may be `null` if this stream received an error
-   * without a stack trace.
-   *
-   * An asynchronous error `error` is matched by a test function if
-   *`test(error)` returns true. If [test] is omitted, every error is considered
-   * matching.
-   *
-   * If the error is intercepted, the [onError] function can decide what to do
-   * with it. It can throw if it wants to raise a new (or the same) error,
-   * or simply return to make this stream forget the error.
-   * If the received `error` value is thrown again by the [onError] function,
-   * it acts like a `rethrow` and it is emitted along with its original
-   * stack trace, not the stack trace of the `throw` inside [onError].
-   *
-   * If you need to transform an error into a data event, use the more generic
-   * [Stream.transform] to handle the event by writing a data event to
-   * the output sink.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * If a broadcast stream is listened to more than once, each subscription
-   * will individually perform the `test` and handle the error.
-   */
-  Stream<T> handleError(Function onError, {bool test(error)?}) {
-    return new _HandleErrorStream<T>(this, onError, test);
-  }
-
-  /**
-   * Transforms each element of this stream into a sequence of elements.
-   *
-   * Returns a new stream where each element of this stream is replaced
-   * by zero or more data events.
-   * The event values are provided as an [Iterable] by a call to [convert]
-   * with the element as argument, and the elements of that iterable is
-   * emitted in iteration order.
-   * If calling [convert] throws, or if the iteration of the returned values
-   * throws, the error is emitted on the returned stream and iteration ends
-   * for that element of this stream.
-   *
-   * Error events and the done event of this stream are forwarded directly
-   * to the returned stream.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * If a broadcast stream is listened to more than once, each subscription
-   * will individually call `convert` and expand the events.
-   */
-  Stream<S> expand<S>(Iterable<S> convert(T element)) {
-    return new _ExpandStream<T, S>(this, convert);
-  }
-
-  /**
-   * Pipes the events of this stream into [streamConsumer].
-   *
-   * All events of this stream are added to `streamConsumer` using
-   * [StreamConsumer.addStream].
-   * The `streamConsumer` is closed when this stream has been successfully added
-   * to it - when the future returned by `addStream` completes without an error.
-   *
-   * Returns a future which completes when this stream has been consumed
-   * and the consumer has been closed.
-   *
-   * The returned future completes with the same result as the future returned
-   * by [StreamConsumer.close].
-   * If the call to [StreamConsumer.addStream] fails in some way, this
-   * method fails in the same way.
-   */
-  Future pipe(StreamConsumer<T> streamConsumer) {
-    return streamConsumer.addStream(this).then((_) => streamConsumer.close());
-  }
-
-  /**
-   * Applies [streamTransformer] to this stream.
-   *
-   * Returns the transformed stream,
-   * that is, the result of `streamTransformer.bind(this)`.
-   * This method simply allows writing the call to `streamTransformer.bind`
-   * in a chained fashion, like
-   * ```
-   * stream.map(mapping).transform(transformation).toList()
-   * ```
-   * which can be more convenient than calling `bind` directly.
-   *
-   * The [streamTransformer] can return any stream.
-   * Whether the returned stream is a broadcast stream or not,
-   * and which elements it will contain,
-   * is entirely up to the transformation.
-   *
-   * This method should always be used for transformations which treat
-   * the entire stream as representing a single value
-   * which has perhaps been split into several parts for transport,
-   * like a file being read from disk or being fetched over a network.
-   * The transformation will then produce a new stream which
-   * transforms the stream's value incrementally (perhaps using
-   * [Converter.startChunkedConversion]). The resulting stream
-   * may again be chunks of the result, but does not have to
-   * correspond to specific events from the source string.
-   */
-  Stream<S> transform<S>(StreamTransformer<T, S> streamTransformer) {
-    return streamTransformer.bind(this);
-  }
-
-  /**
-   * Combines a sequence of values by repeatedly applying [combine].
-   *
-   * Similar to [Iterable.reduce], this function maintains a value,
-   * starting with the first element of this stream
-   * and updated for each further element of this stream.
-   * For each element after the first,
-   * the value is updated to the result of calling [combine]
-   * with the previous value and the element.
-   *
-   * When this stream is done, the returned future is completed with
-   * the value at that time.
-   *
-   * If this stream is empty, the returned future is completed with
-   * an error.
-   * If this stream emits an error, or the call to [combine] throws,
-   * the returned future is completed with that error,
-   * and processing is stopped.
-   */
-  Future<T> reduce(T combine(T previous, T element)) {
-    _Future<T> result = new _Future<T>();
-    bool seenFirst = false;
-    late T value;
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: result._completeError, onDone: () {
-      if (!seenFirst) {
-        try {
-          // Throw and recatch, instead of just doing
-          //  _completeWithErrorCallback, e, theError, StackTrace.current),
-          // to ensure that the stackTrace is set on the error.
-          throw IterableElementError.noElement();
-        } catch (e, s) {
-          _completeWithErrorCallback(result, e, s);
-        }
-      } else {
-        result._complete(value);
-      }
-    }, cancelOnError: true);
-    subscription.onData((T element) {
-      if (seenFirst) {
-        _runUserCode(() => combine(value, element), (T newValue) {
-          value = newValue;
-        }, _cancelAndErrorClosure(subscription, result));
-      } else {
-        value = element;
-        seenFirst = true;
-      }
-    });
-    return result;
-  }
-
-  /**
-   * Combines a sequence of values by repeatedly applying [combine].
-   *
-   * Similar to [Iterable.fold], this function maintains a value,
-   * starting with [initialValue] and updated for each element of
-   * this stream.
-   * For each element, the value is updated to the result of calling
-   * [combine] with the previous value and the element.
-   *
-   * When this stream is done, the returned future is completed with
-   * the value at that time.
-   * For an empty stream, the future is completed with [initialValue].
-   *
-   * If this stream emits an error, or the call to [combine] throws,
-   * the returned future is completed with that error,
-   * and processing is stopped.
-   */
-  Future<S> fold<S>(S initialValue, S combine(S previous, T element)) {
-    _Future<S> result = new _Future<S>();
-    S value = initialValue;
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: result._completeError, onDone: () {
-      result._complete(value);
-    }, cancelOnError: true);
-    subscription.onData((T element) {
-      _runUserCode(() => combine(value, element), (S newValue) {
-        value = newValue;
-      }, _cancelAndErrorClosure(subscription, result));
-    });
-    return result;
-  }
-
-  /**
-   * Combines the string representation of elements into a single string.
-   *
-   * Each element is converted to a string using its [Object.toString] method.
-   * If [separator] is provided, it is inserted between element string
-   * representations.
-   *
-   * The returned future is completed with the combined string when this stream
-   * is done.
-   *
-   * If this stream emits an error, or the call to [Object.toString] throws,
-   * the returned future is completed with that error,
-   * and processing stops.
-   */
-  Future<String> join([String separator = ""]) {
-    _Future<String> result = new _Future<String>();
-    StringBuffer buffer = new StringBuffer();
-    bool first = true;
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: result._completeError, onDone: () {
-      result._complete(buffer.toString());
-    }, cancelOnError: true);
-    subscription.onData(separator.isEmpty
-        ? (T element) {
-            try {
-              buffer.write(element);
-            } catch (e, s) {
-              _cancelAndErrorWithReplacement(subscription, result, e, s);
-            }
-          }
-        : (T element) {
-            if (!first) {
-              buffer.write(separator);
-            }
-            first = false;
-            try {
-              buffer.write(element);
-            } catch (e, s) {
-              _cancelAndErrorWithReplacement(subscription, result, e, s);
-            }
-          });
-    return result;
-  }
-
-  /**
-   * Returns whether [needle] occurs in the elements provided by this stream.
-   *
-   * Compares each element of this stream to [needle] using [Object.==].
-   * If an equal element is found, the returned future is completed with `true`.
-   * If this stream ends without finding a match, the future is completed with
-   * `false`.
-   *
-   * If this stream emits an error, or the call to [Object.==] throws,
-   * the returned future is completed with that error,
-   * and processing stops.
-   */
-  Future<bool> contains(Object? needle) {
-    _Future<bool> future = new _Future<bool>();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      future._complete(false);
-    }, cancelOnError: true);
-    subscription.onData((T element) {
-      _runUserCode(() => (element == needle), (bool isMatch) {
-        if (isMatch) {
-          _cancelAndValue(subscription, future, true);
-        }
-      }, _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * Executes [action] on each element of this stream.
-   *
-   * Completes the returned [Future] when all elements of this stream
-   * have been processed.
-   *
-   * If this stream emits an error, or if the call to [action] throws,
-   * the returned future completes with that error,
-   * and processing stops.
-   */
-  Future forEach(void action(T element)) {
-    _Future future = new _Future();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      future._complete(null);
-    }, cancelOnError: true);
-    subscription.onData((T element) {
-      _runUserCode<void>(() => action(element), (_) {},
-          _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * Checks whether [test] accepts all elements provided by this stream.
-   *
-   * Calls [test] on each element of this stream.
-   * If the call returns `false`, the returned future is completed with `false`
-   * and processing stops.
-   *
-   * If this stream ends without finding an element that [test] rejects,
-   * the returned future is completed with `true`.
-   *
-   * If this stream emits an error, or if the call to [test] throws,
-   * the returned future is completed with that error,
-   * and processing stops.
-   */
-  Future<bool> every(bool test(T element)) {
-    _Future<bool> future = new _Future<bool>();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      future._complete(true);
-    }, cancelOnError: true);
-    subscription.onData((T element) {
-      _runUserCode(() => test(element), (bool isMatch) {
-        if (!isMatch) {
-          _cancelAndValue(subscription, future, false);
-        }
-      }, _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * Checks whether [test] accepts any element provided by this stream.
-   *
-   * Calls [test] on each element of this stream.
-   * If the call returns `true`, the returned future is completed with `true`
-   * and processing stops.
-   *
-   * If this stream ends without finding an element that [test] accepts,
-   * the returned future is completed with `false`.
-   *
-   * If this stream emits an error, or if the call to [test] throws,
-   * the returned future is completed with that error,
-   * and processing stops.
-   */
-  Future<bool> any(bool test(T element)) {
-    _Future<bool> future = new _Future<bool>();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      future._complete(false);
-    }, cancelOnError: true);
-    subscription.onData((T element) {
-      _runUserCode(() => test(element), (bool isMatch) {
-        if (isMatch) {
-          _cancelAndValue(subscription, future, true);
-        }
-      }, _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * The number of elements in this stream.
-   *
-   * Waits for all elements of this stream. When this stream ends,
-   * the returned future is completed with the number of elements.
-   *
-   * If this stream emits an error,
-   * the returned future is completed with that error,
-   * and processing stops.
-   *
-   * This operation listens to this stream, and a non-broadcast stream cannot
-   * be reused after finding its length.
-   */
-  Future<int> get length {
-    _Future<int> future = new _Future<int>();
-    int count = 0;
-    this.listen(
-        (_) {
-          count++;
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(count);
-        },
-        cancelOnError: true);
-    return future;
-  }
-
-  /**
-   * Whether this stream contains any elements.
-   *
-   * Waits for the first element of this stream, then completes the returned
-   * future with `false`.
-   * If this stream ends without emitting any elements, the returned future is
-   * completed with `true`.
-   *
-   * If the first event is an error, the returned future is completed with that
-   * error.
-   *
-   * This operation listens to this stream, and a non-broadcast stream cannot
-   * be reused after checking whether it is empty.
-   */
-  Future<bool> get isEmpty {
-    _Future<bool> future = new _Future<bool>();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      future._complete(true);
-    }, cancelOnError: true);
-    subscription.onData((_) {
-      _cancelAndValue(subscription, future, false);
-    });
-    return future;
-  }
-
-  /**
-   * Adapt this stream to be a `Stream<R>`.
-   *
-   * This stream is wrapped as a `Stream<R>` which checks at run-time that
-   * each data event emitted by this stream is also an instance of [R].
-   */
-  Stream<R> cast<R>() => Stream.castFrom<T, R>(this);
-  /**
-   * Collects all elements of this stream in a [List].
-   *
-   * Creates a `List<T>` and adds all elements of this stream to the list
-   * in the order they arrive.
-   * When this stream ends, the returned future is completed with that list.
-   *
-   * If this stream emits an error,
-   * the returned future is completed with that error,
-   * and processing stops.
-   */
-  Future<List<T>> toList() {
-    List<T> result = <T>[];
-    _Future<List<T>> future = new _Future<List<T>>();
-    this.listen(
-        (T data) {
-          result.add(data);
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(result);
-        },
-        cancelOnError: true);
-    return future;
-  }
-
-  /**
-   * Collects the data of this stream in a [Set].
-   *
-   * Creates a `Set<T>` and adds all elements of this stream to the set.
-   * in the order they arrive.
-   * When this stream ends, the returned future is completed with that set.
-   *
-   * The returned set is the same type as returned by `new Set<T>()`.
-   * If another type of set is needed, either use [forEach] to add each
-   * element to the set, or use
-   * `toList().then((list) => new SomeOtherSet.from(list))`
-   * to create the set.
-   *
-   * If this stream emits an error,
-   * the returned future is completed with that error,
-   * and processing stops.
-   */
-  Future<Set<T>> toSet() {
-    Set<T> result = new Set<T>();
-    _Future<Set<T>> future = new _Future<Set<T>>();
-    this.listen(
-        (T data) {
-          result.add(data);
-        },
-        onError: future._completeError,
-        onDone: () {
-          future._complete(result);
-        },
-        cancelOnError: true);
-    return future;
-  }
-
-  /**
-   * Discards all data on this stream, but signals when it is done or an error
-   * occurred.
-   *
-   * When subscribing using [drain], cancelOnError will be true. This means
-   * that the future will complete with the first error on this stream and then
-   * cancel the subscription.
-   *
-   * If this stream emits an error, the returned future is completed with
-   * that error, and processing is stopped.
-   *
-   * In case of a `done` event the future completes with the given
-   * [futureValue].
-   *
-   * The [futureValue] must not be omitted if `null` is not assignable to [E].
-   */
-  Future<E> drain<E>([E? futureValue]) {
-    if (futureValue == null) {
-      futureValue = futureValue as E;
-    }
-    return listen(null, cancelOnError: true).asFuture<E>(futureValue);
-  }
-
-  /**
-   * Provides at most the first [count] data events of this stream.
-   *
-   * Returns a stream that emits the same events that this stream would
-   * if listened to at the same time,
-   * until either this stream ends or it has emitted [count] data events,
-   * at which point the returned stream is done.
-   *
-   * If this stream produces fewer than [count] data events before it's done,
-   * so will the returned stream.
-   *
-   * Starts listening to this stream when the returned stream is listened to
-   * and stops listening when the first [count] data events have been received.
-   *
-   * This means that if this is a single-subscription (non-broadcast) streams
-   * it cannot be reused after the returned stream has been listened to.
-   *
-   * If this is a broadcast stream, the returned stream is a broadcast stream.
-   * In that case, the events are only counted from the time
-   * the returned stream is listened to.
-   */
-  Stream<T> take(int count) {
-    return new _TakeStream<T>(this, count);
-  }
-
-  /**
-   * Forwards data events while [test] is successful.
-   *
-   * Returns a stream that provides the same events as this stream
-   * until [test] fails for a data event.
-   * The returned stream is done when either this stream is done,
-   * or when this stream first emits a data event that fails [test].
-   *
-   * The `test` call is considered failing if it returns a non-`true` value
-   * or if it throws. If the `test` call throws, the error is emitted as the
-   * last event on the returned streams.
-   *
-   * Stops listening to this stream after the accepted elements.
-   *
-   * Internally the method cancels its subscription after these elements. This
-   * means that single-subscription (non-broadcast) streams are closed and
-   * cannot be reused after a call to this method.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * For a broadcast stream, the events are only tested from the time
-   * the returned stream is listened to.
-   */
-  Stream<T> takeWhile(bool test(T element)) {
-    return new _TakeWhileStream<T>(this, test);
-  }
-
-  /**
-   * Skips the first [count] data events from this stream.
-   *
-   * Returns a stream that emits the same events as this stream would
-   * if listened to at the same time, except that the first [count]
-   * data events are not emitted.
-   * The returned stream is done when this stream is.
-   *
-   * If this stream emits fewer than [count] data events
-   * before being done, the returned stream emits no data events.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * For a broadcast stream, the events are only counted from the time
-   * the returned stream is listened to.
-   */
-  Stream<T> skip(int count) {
-    return new _SkipStream<T>(this, count);
-  }
-
-  /**
-   * Skip data events from this stream while they are matched by [test].
-   *
-   * Returns a stream that emits the same events as this stream,
-   * except that data events are not emitted until a data event fails `test`.
-   * The test fails when called with a data event
-   * if it returns a non-`true` value or if the call to `test` throws.
-   * If the call throws, the error is emitted as an error event
-   * on the returned stream instead of the data event,
-   * otherwise the event that made `test` return non-true is emitted as the
-   * first data event.
-   *
-   * Error and done events are provided by the returned stream unmodified.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * For a broadcast stream, the events are only tested from the time
-   * the returned stream is listened to.
-   */
-  Stream<T> skipWhile(bool test(T element)) {
-    return new _SkipWhileStream<T>(this, test);
-  }
-
-  /**
-   * Skips data events if they are equal to the previous data event.
-   *
-   * The returned stream provides the same events as this stream, except
-   * that it never provides two consecutive data events that are equal.
-   * That is, errors are passed through to the returned stream, and
-   * data events are passed through if they are distinct from the most
-   * recently emitted data event.
-   *
-   * Equality is determined by the provided [equals] method. If that is
-   * omitted, the '==' operator on the last provided data element is used.
-   *
-   * If [equals] throws, the data event is replaced by an error event
-   * containing the thrown error. The behavior is equivalent to the
-   * original stream emitting the error event, and it doesn't change
-   * the what the most recently emitted data event is.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * If a broadcast stream is listened to more than once, each subscription
-   * will individually perform the `equals` test.
-   */
-  Stream<T> distinct([bool equals(T previous, T next)?]) {
-    return new _DistinctStream<T>(this, equals);
-  }
-
-  /**
-   * The first element of this stream.
-   *
-   * Stops listening to this stream after the first element has been received.
-   *
-   * Internally the method cancels its subscription after the first element.
-   * This means that single-subscription (non-broadcast) streams are closed
-   * and cannot be reused after a call to this getter.
-   *
-   * If an error event occurs before the first data event, the returned future
-   * is completed with that error.
-   *
-   * If this stream is empty (a done event occurs before the first data event),
-   * the returned future completes with an error.
-   *
-   * Except for the type of the error, this method is equivalent to
-   * `this.elementAt(0)`.
-   */
-  Future<T> get first {
-    _Future<T> future = new _Future<T>();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      try {
-        throw IterableElementError.noElement();
-      } catch (e, s) {
-        _completeWithErrorCallback(future, e, s);
-      }
-    }, cancelOnError: true);
-    subscription.onData((T value) {
-      _cancelAndValue(subscription, future, value);
-    });
-    return future;
-  }
-
-  /**
-   * The last element of this stream.
-   *
-   * If this stream emits an error event,
-   * the returned future is completed with that error
-   * and processing stops.
-   *
-   * If this stream is empty (the done event is the first event),
-   * the returned future completes with an error.
-   */
-  Future<T> get last {
-    _Future<T> future = new _Future<T>();
-    late T result;
-    bool foundResult = false;
-    listen(
-        (T value) {
-          foundResult = true;
-          result = value;
-        },
-        onError: future._completeError,
-        onDone: () {
-          if (foundResult) {
-            future._complete(result);
-            return;
-          }
-          try {
-            throw IterableElementError.noElement();
-          } catch (e, s) {
-            _completeWithErrorCallback(future, e, s);
-          }
-        },
-        cancelOnError: true);
-    return future;
-  }
-
-  /**
-   * The single element of this stream.
-   *
-   * If this stream emits an error event,
-   * the returned future is completed with that error
-   * and processing stops.
-   *
-   * If [this] is empty or has more than one element,
-   * the returned future completes with an error.
-   */
-  Future<T> get single {
-    _Future<T> future = new _Future<T>();
-    late T result;
-    bool foundResult = false;
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      if (foundResult) {
-        future._complete(result);
-        return;
-      }
-      try {
-        throw IterableElementError.noElement();
-      } catch (e, s) {
-        _completeWithErrorCallback(future, e, s);
-      }
-    }, cancelOnError: true);
-    subscription.onData((T value) {
-      if (foundResult) {
-        // This is the second element we get.
-        try {
-          throw IterableElementError.tooMany();
-        } catch (e, s) {
-          _cancelAndErrorWithReplacement(subscription, future, e, s);
-        }
-        return;
-      }
-      foundResult = true;
-      result = value;
-    });
-    return future;
-  }
-
-  /**
-   * Finds the first element of this stream matching [test].
-   *
-   * Returns a future that is completed with the first element of this stream
-   * that [test] returns `true` for.
-   *
-   * If no such element is found before this stream is done, and a
-   * [orElse] function is provided, the result of calling [orElse]
-   * becomes the value of the future. If [orElse] throws, the returned
-   * future is completed with that error.
-   *
-   * If this stream emits an error before the first matching element,
-   * the returned future is completed with that error, and processing stops.
-   *
-   * Stops listening to this stream after the first matching element or error
-   * has been received.
-   *
-   * Internally the method cancels its subscription after the first element that
-   * matches the predicate. This means that single-subscription (non-broadcast)
-   * streams are closed and cannot be reused after a call to this method.
-   *
-   * If an error occurs, or if this stream ends without finding a match and
-   * with no [orElse] function provided,
-   * the returned future is completed with an error.
-   */
-  Future<T> firstWhere(bool test(T element), {T orElse()?}) {
-    _Future<T> future = new _Future();
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      if (orElse != null) {
-        _runUserCode(orElse, future._complete, future._completeError);
-        return;
-      }
-      try {
-        // Sets stackTrace on error.
-        throw IterableElementError.noElement();
-      } catch (e, s) {
-        _completeWithErrorCallback(future, e, s);
-      }
-    }, cancelOnError: true);
-
-    subscription.onData((T value) {
-      _runUserCode(() => test(value), (bool isMatch) {
-        if (isMatch) {
-          _cancelAndValue(subscription, future, value);
-        }
-      }, _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * Finds the last element in this stream matching [test].
-   *
-   * If this stream emits an error, the returned future is completed with that
-   * error, and processing stops.
-   *
-   * Otherwise as [firstWhere], except that the last matching element is found
-   * instead of the first.
-   * That means that a non-error result cannot be provided before this stream
-   * is done.
-   */
-  Future<T> lastWhere(bool test(T element), {T orElse()?}) {
-    _Future<T> future = new _Future();
-    late T result;
-    bool foundResult = false;
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      if (foundResult) {
-        future._complete(result);
-        return;
-      }
-      if (orElse != null) {
-        _runUserCode(orElse, future._complete, future._completeError);
-        return;
-      }
-      try {
-        throw IterableElementError.noElement();
-      } catch (e, s) {
-        _completeWithErrorCallback(future, e, s);
-      }
-    }, cancelOnError: true);
-
-    subscription.onData((T value) {
-      _runUserCode(() => test(value), (bool isMatch) {
-        if (isMatch) {
-          foundResult = true;
-          result = value;
-        }
-      }, _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * Finds the single element in this stream matching [test].
-   *
-   * Like [lastWhere], except that it is an error if more than one
-   * matching element occurs in this stream.
-   */
-  Future<T> singleWhere(bool test(T element), {T orElse()?}) {
-    _Future<T> future = new _Future<T>();
-    late T result;
-    bool foundResult = false;
-    StreamSubscription<T> subscription =
-        this.listen(null, onError: future._completeError, onDone: () {
-      if (foundResult) {
-        future._complete(result);
-        return;
-      }
-      if (orElse != null) {
-        _runUserCode(orElse, future._complete, future._completeError);
-        return;
-      }
-      try {
-        throw IterableElementError.noElement();
-      } catch (e, s) {
-        _completeWithErrorCallback(future, e, s);
-      }
-    }, cancelOnError: true);
-
-    subscription.onData((T value) {
-      _runUserCode(() => test(value), (bool isMatch) {
-        if (isMatch) {
-          if (foundResult) {
-            try {
-              throw IterableElementError.tooMany();
-            } catch (e, s) {
-              _cancelAndErrorWithReplacement(subscription, future, e, s);
-            }
-            return;
-          }
-          foundResult = true;
-          result = value;
-        }
-      }, _cancelAndErrorClosure(subscription, future));
-    });
-    return future;
-  }
-
-  /**
-   * Returns the value of the [index]th data event of this stream.
-   *
-   * Stops listening to this stream after the [index]th data event has been
-   * received.
-   *
-   * Internally the method cancels its subscription after these elements. This
-   * means that single-subscription (non-broadcast) streams are closed and
-   * cannot be reused after a call to this method.
-   *
-   * If an error event occurs before the value is found, the future completes
-   * with this error.
-   *
-   * If a done event occurs before the value is found, the future completes
-   * with a [RangeError].
-   */
-  Future<T> elementAt(int index) {
-    RangeError.checkNotNegative(index, "index");
-    _Future<T> result = new _Future<T>();
-    int elementIndex = 0;
-    StreamSubscription<T> subscription;
-    subscription =
-        this.listen(null, onError: result._completeError, onDone: () {
-      result._completeError(
-          new RangeError.index(index, this, "index", null, elementIndex),
-          StackTrace.empty);
-    }, cancelOnError: true);
-    subscription.onData((T value) {
-      if (index == elementIndex) {
-        _cancelAndValue(subscription, result, value);
-        return;
-      }
-      elementIndex += 1;
-    });
-
-    return result;
-  }
-
-  /**
-   * Creates a new stream with the same events as this stream.
-   *
-   * Whenever more than [timeLimit] passes between two events from this stream,
-   * the [onTimeout] function is called, which can emit further events on
-   * the returned stream.
-   *
-   * The countdown doesn't start until the returned stream is listened to.
-   * The countdown is reset every time an event is forwarded from this stream,
-   * or when this stream is paused and resumed.
-   *
-   * The [onTimeout] function is called with one argument: an
-   * [EventSink] that allows putting events into the returned stream.
-   * This `EventSink` is only valid during the call to [onTimeout].
-   * Calling [EventSink.close] on the sink passed to [onTimeout] closes the
-   * returned stream, and no further events are processed.
-   *
-   * If [onTimeout] is omitted, a timeout will just put a [TimeoutException]
-   * into the error channel of the returned stream.
-   * If the call to [onTimeout] throws, the error is emitted on the returned
-   * stream.
-   *
-   * The returned stream is a broadcast stream if this stream is.
-   * If a broadcast stream is listened to more than once, each subscription
-   * will have its individually timer that starts counting on listen,
-   * and the subscriptions' timers can be paused individually.
-   */
-  Stream<T> timeout(Duration timeLimit, {void onTimeout(EventSink<T> sink)?}) {
-    _StreamControllerBase<T> controller;
-    if (isBroadcast) {
-      controller = new _SyncBroadcastStreamController<T>(null, null);
-    } else {
-      controller = new _SyncStreamController<T>(null, null, null, null);
-    }
-
-    Zone zone = Zone.current;
-    // Register callback immediately.
-    _TimerCallback timeoutCallback;
-    if (onTimeout == null) {
-      timeoutCallback = () {
-        controller.addError(
-            new TimeoutException("No stream event", timeLimit), null);
-      };
-    } else {
-      // TODO(floitsch): the return type should be 'void', and the type
-      // should be inferred.
-      var registeredOnTimeout =
-          zone.registerUnaryCallback<void, EventSink<T>>(onTimeout);
-      var wrapper = new _ControllerEventSinkWrapper<T>(null);
-      timeoutCallback = () {
-        wrapper._sink = controller; // Only valid during call.
-        zone.runUnaryGuarded(registeredOnTimeout, wrapper);
-        wrapper._sink = null;
-      };
-    }
-
-    // All further setup happens inside `onListen`.
-    controller.onListen = () {
-      Timer timer = zone.createTimer(timeLimit, timeoutCallback);
-      var subscription = this.listen(null);
-      // Set up event forwarding. Each data or error event resets the timer
-      subscription
-        ..onData((T event) {
-          timer.cancel();
-          timer = zone.createTimer(timeLimit, timeoutCallback);
-          // Controller is synchronous, and the call might close the stream
-          // and cancel the timer,
-          // so create the Timer before calling into add();
-          // issue: https://github.com/dart-lang/sdk/issues/37565
-          controller.add(event);
-        })
-        ..onError((Object error, StackTrace stackTrace) {
-          timer.cancel();
-          timer = zone.createTimer(timeLimit, timeoutCallback);
-          controller._addError(
-              error, stackTrace); // Avoid Zone error replacement.
-        })
-        ..onDone(() {
-          timer.cancel();
-          controller.close();
-        });
-      // Set up further controller callbacks.
-      controller.onCancel = () {
-        timer.cancel();
-        return subscription.cancel();
-      };
-      if (!isBroadcast) {
-        controller
-          ..onPause = () {
-            timer.cancel();
-            subscription.pause();
-          }
-          ..onResume = () {
-            subscription.resume();
-            timer = zone.createTimer(timeLimit, timeoutCallback);
-          };
-      }
-    };
-
-    return controller.stream;
-  }
-}
-
-/**
- * A subscription on events from a [Stream].
- *
- * When you listen on a [Stream] using [Stream.listen],
- * a [StreamSubscription] object is returned.
- *
- * The subscription provides events to the listener,
- * and holds the callbacks used to handle the events.
- * The subscription can also be used to unsubscribe from the events,
- * or to temporarily pause the events from the stream.
- */
-abstract class StreamSubscription<T> {
-  /**
-   * Cancels this subscription.
-   *
-   * After this call, the subscription no longer receives events.
-   *
-   * The stream may need to shut down the source of events and clean up after
-   * the subscription is canceled.
-   *
-   * Returns a future that is completed once the stream has finished
-   * its cleanup.
-   *
-   * Typically, cleanup happens when the stream needs to release resources.
-   * For example, a stream might need to close an open file (as an asynchronous
-   * operation). If the listener wants to delete the file after having
-   * canceled the subscription, it must wait for the cleanup future to complete.
-   *
-   * If the cleanup throws, which it really shouldn't, the returned future
-   * completes with that error.
-   */
-  Future<void> cancel();
-
-  /**
-   * Replaces the data event handler of this subscription.
-   *
-   * The [handleData] function is called for each element of the stream
-   * after this function is called.
-   * If [handleData] is `null`, further elements are ignored.
-   *
-   * This method replaces the current handler set by the invocation of
-   * [Stream.listen] or by a previous call to [onData].
-   */
-  void onData(void handleData(T data)?);
-
-  /**
-   * Replaces the error event handler of this subscription.
-   *
-   * The [handleError] function must be able to be called with either
-   * one positional argument, or with two positional arguments
-   * where the seconds is always a [StackTrace].
-   *
-   * The [handleError] argument may be `null`, in which case further
-   * error events are considered unhandled, and will be reported to
-   * [Zone.handleUncaughtError].
-   *
-   * The provided function is called for all error events from the
-   * stream subscription.
-   *
-   * This method replaces the current handler set by the invocation of
-   * [Stream.listen], by calling [asFuture], or by a previous call to [onError].
-   */
-  void onError(Function? handleError);
-
-  /**
-   * Replaces the done event handler of this subscription.
-   *
-   * The [handleDone] function is called when the stream closes.
-   * The value may be `null`, in which case no function is called.
-   *
-   * This method replaces the current handler set by the invocation of
-   * [Stream.listen], by calling [asFuture], or by a previous call to [onDone].
-   */
-  void onDone(void handleDone()?);
-
-  /**
-   * Request that the stream pauses events until further notice.
-   *
-   * While paused, the subscription will not fire any events.
-   * If it receives events from its source, they will be buffered until
-   * the subscription is resumed.
-   * For non-broadcast streams, the underlying source is usually informed
-   * about the pause,
-   * so it can stop generating events until the subscription is resumed.
-   *
-   * To avoid buffering events on a broadcast stream, it is better to
-   * cancel this subscription, and start to listen again when events
-   * are needed, if the intermediate events are not important.
-   *
-   * If [resumeSignal] is provided, the stream subscription will undo the pause
-   * when the future completes, as if by a call to [resume].
-   * If the future completes with an error,
-   * the stream will still resume, but the error will be considered unhandled
-   * and is passed to [Zone.handleUncaughtError].
-   *
-   * A call to [resume] will also undo a pause.
-   *
-   * If the subscription is paused more than once, an equal number
-   * of resumes must be performed to resume the stream.
-   * Calls to [resume] and the completion of a [resumeSignal] are
-   * interchangeable - the [pause] which was passed a [resumeSignal] may be
-   * ended by a call to [resume], and completing the [resumeSignal] may end a
-   * different [pause].
-   *
-   * It is safe to [resume] or complete a [resumeSignal] even when the
-   * subscription is not paused, and the resume will have no effect.
-   *
-   * Currently DOM streams silently drop events when the stream is paused. This
-   * is a bug and will be fixed.
-   */
-  void pause([Future<void>? resumeSignal]);
-
-  /**
-   * Resume after a pause.
-   *
-   * This undoes one previous call to [pause].
-   * When all previously calls to [pause] have been matched by a calls to
-   * [resume], possibly through a `resumeSignal` passed to [pause],
-   * the stream subscription may emit events again.
-   *
-   * It is safe to [resume] even when the subscription is not paused, and the
-   * resume will have no effect.
-   */
-  void resume();
-
-  /**
-   * Whether the [StreamSubscription] is currently paused.
-   *
-   * If there have been more calls to [pause] than to [resume] on this
-   * stream subscription, the subscription is paused, and this getter
-   * returns `true`.
-   *
-   * Returns `false` if the stream can currently emit events, or if
-   * the subscription has completed or been cancelled.
-   */
-  bool get isPaused;
-
-  /**
-   * Returns a future that handles the [onDone] and [onError] callbacks.
-   *
-   * This method *overwrites* the existing [onDone] and [onError] callbacks
-   * with new ones that complete the returned future.
-   *
-   * In case of an error the subscription will automatically cancel (even
-   * when it was listening with `cancelOnError` set to `false`).
-   *
-   * In case of a `done` event the future completes with the given
-   * [futureValue].
-   *
-   * If [futureValue] is omitted, the value `null as E` is used as a default.
-   * If `E` is not nullable, this will throw immediately when [asFuture]
-   * is called.
-   */
-  Future<E> asFuture<E>([E? futureValue]);
-}
-
-/**
- * A [Sink] that supports adding errors.
- *
- * This makes it suitable for capturing the results of asynchronous
- * computations, which can complete with a value or an error.
- *
- * The [EventSink] has been designed to handle asynchronous events from
- * [Stream]s. See, for example, [Stream.eventTransformed] which uses
- * `EventSink`s to transform events.
- */
-abstract class EventSink<T> implements Sink<T> {
-  /**
-   * Adds a data [event] to the sink.
-   *
-   * Must not be called on a closed sink.
-   */
-  void add(T event);
-
-  /**
-   * Adds an [error] to the sink.
-   *
-   * Must not be called on a closed sink.
-   */
-  void addError(Object error, [StackTrace? stackTrace]);
-
-  /**
-   * Closes the sink.
-   *
-   * Calling this method more than once is allowed, but does nothing.
-   *
-   * Neither [add] nor [addError] must be called after this method.
-   */
-  void close();
-}
-
-/** [Stream] wrapper that only exposes the [Stream] interface. */
-class StreamView<T> extends Stream<T> {
-  final Stream<T> _stream;
-
-  const StreamView(Stream<T> stream)
-      : _stream = stream,
-        super._internal();
-
-  bool get isBroadcast => _stream.isBroadcast;
-
-  Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription)?,
-          void onCancel(StreamSubscription<T> subscription)?}) =>
-      _stream.asBroadcastStream(onListen: onListen, onCancel: onCancel);
-
-  StreamSubscription<T> listen(void onData(T value)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-}
-
-/**
- * Abstract interface for a "sink" accepting multiple entire streams.
- *
- * A consumer can accept a number of consecutive streams using [addStream],
- * and when no further data need to be added, the [close] method tells the
- * consumer to complete its work and shut down.
- *
- * The [Stream.pipe] accepts a `StreamConsumer` and will pass the stream
- * to the consumer's [addStream] method. When that completes, it will
- * call [close] and then complete its own returned future.
- */
-abstract class StreamConsumer<S> {
-  /**
-   * Consumes the elements of [stream].
-   *
-   * Listens on [stream] and does something for each event.
-   *
-   * Returns a future which is completed when the stream is done being added,
-   * and the consumer is ready to accept a new stream.
-   * No further calls to [addStream] or [close] should happen before the
-   * returned future has completed.
-   *
-   * The consumer may stop listening to the stream after an error,
-   * it may consume all the errors and only stop at a done event,
-   * or it may be canceled early if the receiver don't want any further events.
-   *
-   * If the consumer stops listening because of some error preventing it
-   * from continuing, it may report this error in the returned future,
-   * otherwise it will just complete the future with `null`.
-   */
-  Future addStream(Stream<S> stream);
-
-  /**
-   * Tells the consumer that no further streams will be added.
-   *
-   * This allows the consumer to complete any remaining work and release
-   * resources that are no longer needed
-   *
-   * Returns a future which is completed when the consumer has shut down.
-   * If cleaning up can fail, the error may be reported in the returned future,
-   * otherwise it completes with `null`.
-   */
-  Future close();
-}
-
-/**
- * A object that accepts stream events both synchronously and asynchronously.
- *
- * A [StreamSink] combines the methods from [StreamConsumer] and [EventSink].
- *
- * The [EventSink] methods can't be used while the [addStream] is called.
- * As soon as the [addStream]'s [Future] completes with a value, the
- * [EventSink] methods can be used again.
- *
- * If [addStream] is called after any of the [EventSink] methods, it'll
- * be delayed until the underlying system has consumed the data added by the
- * [EventSink] methods.
- *
- * When [EventSink] methods are used, the [done] [Future] can be used to
- * catch any errors.
- *
- * When [close] is called, it will return the [done] [Future].
- */
-abstract class StreamSink<S> implements EventSink<S>, StreamConsumer<S> {
-  /**
-   * Tells the stream sink that no further streams will be added.
-   *
-   * This allows the stream sink to complete any remaining work and release
-   * resources that are no longer needed
-   *
-   * Returns a future which is completed when the stream sink has shut down.
-   * If cleaning up can fail, the error may be reported in the returned future,
-   * otherwise it completes with `null`.
-   *
-   * Returns the same future as [done].
-   *
-   * The stream sink may close before the [close] method is called, either due
-   * to an error or because it is itself providing events to someone who has
-   * stopped listening. In that case, the [done] future is completed first,
-   * and the `close` method will return the `done` future when called.
-   *
-   * Unifies [StreamConsumer.close] and [EventSink.close] which both mark their
-   * object as not expecting any further events.
-   */
-  Future close();
-
-  /**
-   * Return a future which is completed when the [StreamSink] is finished.
-   *
-   * If the `StreamSink` fails with an error,
-   * perhaps in response to adding events using [add], [addError] or [close],
-   * the [done] future will complete with that error.
-   *
-   * Otherwise, the returned future will complete when either:
-   *
-   * * all events have been processed and the sink has been closed, or
-   * * the sink has otherwise been stopped from handling more events
-   *   (for example by canceling a stream subscription).
-   */
-  Future get done;
-}
-
-/**
- * Transforms a Stream.
- *
- * When a stream's [Stream.transform] method is invoked with a
- * [StreamTransformer], the stream calls the [bind] method on the provided
- * transformer. The resulting stream is then returned from the
- * [Stream.transform] method.
- *
- * Conceptually, a transformer is simply a function from [Stream] to [Stream]
- * that is encapsulated into a class.
- *
- * It is good practice to write transformers that can be used multiple times.
- *
- * All other transforming methods on [Stream], such as [Stream.map],
- * [Stream.where] or [Stream.expand] can be implemented using
- * [Stream.transform]. A [StreamTransformer] is thus very powerful but often
- * also a bit more complicated to use.
- */
-abstract class StreamTransformer<S, T> {
-  /**
-   * Creates a [StreamTransformer] based on the given [onListen] callback.
-   *
-   * The returned stream transformer uses the provided [onListen] callback
-   * when a transformed stream is listened to. At that time, the callback
-   * receives the input stream (the one passed to [bind]) and a
-   * boolean flag `cancelOnError` to create a [StreamSubscription].
-   *
-   * If the transformed stream is a broadcast stream, so is the stream
-   * returned by the [StreamTransformer.bind] method by this transformer.
-   *
-   * If the transformed stream is listened to multiple times, the [onListen]
-   * callback is called again for each new [Stream.listen] call.
-   * This happens whether the stream is a broadcast stream or not,
-   * but the call will usually fail for non-broadcast streams.
-   *
-   * The [onListen] callback does *not* receive the handlers that were passed
-   * to [Stream.listen]. These are automatically set after the call to the
-   * [onListen] callback (using [StreamSubscription.onData],
-   * [StreamSubscription.onError] and [StreamSubscription.onDone]).
-   *
-   * Most commonly, an [onListen] callback will first call [Stream.listen] on
-   * the provided stream (with the corresponding `cancelOnError` flag), and then
-   * return a new [StreamSubscription].
-   *
-   * There are two common ways to create a StreamSubscription:
-   *
-   * 1. by allocating a [StreamController] and to return the result of
-   *    listening to its stream. It's important to forward pause, resume and
-   *    cancel events (unless the transformer intentionally wants to change
-   *    this behavior).
-   * 2. by creating a new class that implements [StreamSubscription].
-   *    Note that the subscription should run callbacks in the [Zone] the
-   *    stream was listened to (see [Zone] and [Zone.bindCallback]).
-   *
-   * Example:
-   *
-   * ```
-   * /// Starts listening to [input] and duplicates all non-error events.
-   * StreamSubscription<int> _onListen(Stream<int> input, bool cancelOnError) {
-   *   StreamSubscription<String> subscription;
-   *   // Create controller that forwards pause, resume and cancel events.
-   *   var controller = new StreamController<String>(
-   *       onPause: () {
-   *         subscription.pause();
-   *       },
-   *       onResume: () {
-   *         subscription.resume();
-   *       },
-   *       onCancel: () => subscription.cancel(),
-   *       sync: true); // "sync" is correct here, since events are forwarded.
-   *
-   *   // Listen to the provided stream using `cancelOnError`.
-   *   subscription = input.listen((data) {
-   *     // Duplicate the data.
-   *     controller.add(data);
-   *     controller.add(data);
-   *   },
-   *       onError: controller.addError,
-   *       onDone: controller.close,
-   *       cancelOnError: cancelOnError);
-   *
-   *   // Return a new [StreamSubscription] by listening to the controller's
-   *   // stream.
-   *   return controller.stream.listen(null);
-   * }
-   *
-   * // Instantiate a transformer:
-   * var duplicator = const StreamTransformer<int, int>(_onListen);
-   *
-   * // Use as follows:
-   * intStream.transform(duplicator);
-   * ```
-   */
-  const factory StreamTransformer(
-          StreamSubscription<T> onListen(
-              Stream<S> stream, bool cancelOnError)) =
-      _StreamSubscriptionTransformer<S, T>;
-
-  /**
-   * Creates a [StreamTransformer] that delegates events to the given functions.
-   *
-   * Example use of a duplicating transformer:
-   *
-   * ```
-   * stringStream.transform(new StreamTransformer<String, String>.fromHandlers(
-   *     handleData: (String value, EventSink<String> sink) {
-   *       sink.add(value);
-   *       sink.add(value);  // Duplicate the incoming events.
-   *     }));
-   * ```
-   *
-   * Transformers that are constructed this way cannot use captured state if
-   * they are used in streams that can be listened to multiple times.
-   * ```
-   * StreamController<String> controller;
-   * controller = new StreamController.broadcast(onListen: () {
-   *   scheduleMicrotask(() {
-   *     controller.addError("Bad");
-   *     controller.addError("Worse");
-   *     controller.addError("Worst");
-   *   });
-   * });
-   * var sharedState = 0;
-   * var transformedStream = controller.stream.transform(
-   *     new StreamTransformer<String>.fromHandlers(
-   *         handleError: (error, stackTrace, sink) {
-   *   sharedState++; // Increment shared error-counter.
-   *   sink.add("Error $sharedState: $error");
-   * }));
-   *
-   * transformedStream.listen(print);
-   * transformedStream.listen(print); // Listen twice.
-   * // Listening twice to the same stream makes the transformer share the same
-   * // state. Instead of having "Error 1: Bad", "Error 2: Worse",
-   * // "Error 3: Worst" as output (each twice for the separate subscriptions),
-   * // this program emits:
-   * // Error 1: Bad
-   * // Error 2: Bad
-   * // Error 3: Worse
-   * // Error 4: Worse
-   * // Error 5: Worst
-   * // Error 6: Worst
-   * ```
-   */
-  factory StreamTransformer.fromHandlers(
-      {void handleData(S data, EventSink<T> sink)?,
-      void handleError(Object error, StackTrace stackTrace, EventSink<T> sink)?,
-      void handleDone(EventSink<T> sink)?}) = _StreamHandlerTransformer<S, T>;
-
-  /**
-   * Creates a [StreamTransformer] based on a [bind] callback.
-   *
-   * The returned stream transformer uses the [bind] argument to implement the
-   * [StreamTransformer.bind] API and can be used when the transformation is
-   * available as a stream-to-stream function.
-   *
-   * ```dart
-   * final splitDecoded = StreamTransformer<List<int>, String>.fromBind(
-   *     (stream) => stream.transform(utf8.decoder).transform(LineSplitter()));
-   * ```
-   */
-  @Since("2.1")
-  factory StreamTransformer.fromBind(Stream<T> Function(Stream<S>) bind) =
-      _StreamBindTransformer<S, T>;
-
-  /**
-   * Adapts [source] to be a `StreamTransformer<TS, TT>`.
-   *
-   * This allows [source] to be used at the new type, but at run-time it
-   * must satisfy the requirements of both the new type and its original type.
-   *
-   * Data events passed into the returned transformer must also be instances
-   * of [SS], and data events produced by [source] for those events must
-   * also be instances of [TT].
-   */
-  static StreamTransformer<TS, TT> castFrom<SS, ST, TS, TT>(
-      StreamTransformer<SS, ST> source) {
-    return new CastStreamTransformer<SS, ST, TS, TT>(source);
-  }
-
-  /**
-   * Transforms the provided [stream].
-   *
-   * Returns a new stream with events that are computed from events of the
-   * provided [stream].
-   *
-   * The [StreamTransformer] interface is completely generic,
-   * so it cannot say what subclasses do.
-   * Each [StreamTransformer] should document clearly how it transforms the
-   * stream (on the class or variable used to access the transformer),
-   * as well as any differences from the following typical behavior:
-   *
-   * * When the returned stream is listened to, it starts listening to the
-   *   input [stream].
-   * * Subscriptions of the returned stream forward (in a reasonable time)
-   *   a [StreamSubscription.pause] call to the subscription of the input
-   *   [stream].
-   * * Similarly, canceling a subscription of the returned stream eventually
-   *   (in reasonable time) cancels the subscription of the input [stream].
-   *
-   * "Reasonable time" depends on the transformer and stream. Some transformers,
-   * like a "timeout" transformer, might make these operations depend on a
-   * duration. Others might not delay them at all, or just by a microtask.
-   *
-   * Transformers are free to handle errors in any way.
-   * A transformer implementation may choose to propagate errors,
-   * or convert them to other events, or ignore them completely,
-   * but if errors are ignored, it should be documented explicitly.
-   */
-  Stream<T> bind(Stream<S> stream);
-
-  /**
-   * Provides a `StreamTransformer<RS, RT>` view of this stream transformer.
-   *
-   * The resulting transformer will check at run-time that all data events
-   * of the stream it transforms are actually instances of [S],
-   * and it will check that all data events produced by this transformer
-   * are actually instances of [RT].
-   */
-  StreamTransformer<RS, RT> cast<RS, RT>();
-}
-
-/**
- * Base class for implementing [StreamTransformer].
- *
- * Contains default implementations of every method except [bind].
- */
-abstract class StreamTransformerBase<S, T> implements StreamTransformer<S, T> {
-  const StreamTransformerBase();
-
-  StreamTransformer<RS, RT> cast<RS, RT>() =>
-      StreamTransformer.castFrom<S, T, RS, RT>(this);
-}
-
-/**
- * An [Iterator] like interface for the values of a [Stream].
- *
- * This wraps a [Stream] and a subscription on the stream. It listens
- * on the stream, and completes the future returned by [moveNext] when the
- * next value becomes available.
- *
- * The stream may be paused between calls to [moveNext].
- */
-abstract class StreamIterator<T> {
-  /** Create a [StreamIterator] on [stream]. */
-  factory StreamIterator(Stream<T> stream)
-      // TODO(lrn): use redirecting factory constructor when type
-      // arguments are supported.
-      =>
-      new _StreamIterator<T>(stream);
-
-  /**
-   * Wait for the next stream value to be available.
-   *
-   * Returns a future which will complete with either `true` or `false`.
-   * Completing with `true` means that another event has been received and
-   * can be read as [current].
-   * Completing with `false` means that the stream iteration is done and
-   * no further events will ever be available.
-   * The future may complete with an error, if the stream produces an error,
-   * which also ends iteration.
-   *
-   * The function must not be called again until the future returned by a
-   * previous call is completed.
-   */
-  Future<bool> moveNext();
-
-  /**
-   * The current value of the stream.
-   *
-   * Is `null` before the first call to [moveNext] and after a call to
-   * `moveNext` completes with a `false` result or an error.
-   *
-   * When a `moveNext` call completes with `true`, the `current` field holds
-   * the most recent event of the stream, and it stays like that until the next
-   * call to `moveNext`.
-   * Between a call to `moveNext` and when its returned future completes,
-   * the value is unspecified.
-   */
-  T get current;
-
-  /**
-   * Cancels the stream iterator (and the underlying stream subscription) early.
-   *
-   * The stream iterator is automatically canceled if the [moveNext] future
-   * completes with either `false` or an error.
-   *
-   * If you need to stop listening for values before the stream iterator is
-   * automatically closed, you must call [cancel] to ensure that the stream
-   * is properly closed.
-   *
-   * If [moveNext] has been called when the iterator is canceled,
-   * its returned future will complete with `false` as value,
-   * as will all further calls to [moveNext].
-   *
-   * Returns a future if the cancel-operation is not completed synchronously.
-   * Otherwise returns `null`.
-   */
-  Future cancel();
-}
-
-/**
- * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
- */
-class _ControllerEventSinkWrapper<T> implements EventSink<T> {
-  EventSink? _sink;
-  _ControllerEventSinkWrapper(this._sink);
-
-  EventSink _ensureSink() {
-    var sink = _sink;
-    if (sink == null) throw StateError("Sink not available");
-    return sink;
-  }
-
-  void add(T data) {
-    _ensureSink().add(data);
-  }
-
-  void addError(error, [StackTrace? stackTrace]) {
-    _ensureSink().addError(error, stackTrace);
-  }
-
-  void close() {
-    _ensureSink().close();
-  }
-}
diff --git a/sdk_nnbd/lib/async/stream_controller.dart b/sdk_nnbd/lib/async/stream_controller.dart
deleted file mode 100644
index 9688dd1..0000000
--- a/sdk_nnbd/lib/async/stream_controller.dart
+++ /dev/null
@@ -1,987 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-// -------------------------------------------------------------------
-// Controller for creating and adding events to a stream.
-// -------------------------------------------------------------------
-
-/**
- * Type of a stream controller's `onListen`, `onPause` and `onResume` callbacks.
- */
-typedef void ControllerCallback();
-
-/**
- * Type of stream controller `onCancel` callbacks.
- */
-typedef FutureOr<void> ControllerCancelCallback();
-
-/**
- * A controller with the stream it controls.
- *
- * This controller allows sending data, error and done events on
- * its [stream].
- * This class can be used to create a simple stream that others
- * can listen on, and to push events to that stream.
- *
- * It's possible to check whether the stream is paused or not, and whether
- * it has subscribers or not, as well as getting a callback when either of
- * these change.
- */
-abstract class StreamController<T> implements StreamSink<T> {
-  /** The stream that this controller is controlling. */
-  Stream<T> get stream;
-
-  /**
-   * A controller with a [stream] that supports only one single subscriber.
-   *
-   * If [sync] is true, the returned stream controller is a
-   * [SynchronousStreamController], and must be used with the care
-   * and attention necessary to not break the [Stream] contract. If in doubt,
-   * use the non-sync version.
-   *
-   * Using an asynchronous controller will never give the wrong
-   * behavior, but using a synchronous controller incorrectly can cause
-   * otherwise correct programs to break.
-   *
-   * A synchronous controller is only intended for optimizing event
-   * propagation when one asynchronous event immediately triggers another.
-   * It should not be used unless the calls to [add] or [addError]
-   * are guaranteed to occur in places where it won't break `Stream` invariants.
-   *
-   * Use synchronous controllers only to forward (potentially transformed)
-   * events from another stream or a future.
-   *
-   * A Stream should be inert until a subscriber starts listening on it (using
-   * the [onListen] callback to start producing events). Streams should not
-   * leak resources (like websockets) when no user ever listens on the stream.
-   *
-   * The controller buffers all incoming events until a subscriber is
-   * registered, but this feature should only be used in rare circumstances.
-   *
-   * The [onPause] function is called when the stream becomes
-   * paused. [onResume] is called when the stream resumed.
-   *
-   * The [onListen] callback is called when the stream
-   * receives its listener and [onCancel] when the listener ends
-   * its subscription. If [onCancel] needs to perform an asynchronous operation,
-   * [onCancel] should return a future that completes when the cancel operation
-   * is done.
-   *
-   * If the stream is canceled before the controller needs data the
-   * [onResume] call might not be executed.
-   */
-  factory StreamController(
-      {void onListen()?,
-      void onPause()?,
-      void onResume()?,
-      FutureOr<void> onCancel()?,
-      bool sync = false}) {
-    return sync
-        ? _SyncStreamController<T>(onListen, onPause, onResume, onCancel)
-        : _AsyncStreamController<T>(onListen, onPause, onResume, onCancel);
-  }
-
-  /**
-   * A controller where [stream] can be listened to more than once.
-   *
-   * The [Stream] returned by [stream] is a broadcast stream.
-   * It can be listened to more than once.
-   *
-   * A Stream should be inert until a subscriber starts listening on it (using
-   * the [onListen] callback to start producing events). Streams should not
-   * leak resources (like websockets) when no user ever listens on the stream.
-   *
-   * Broadcast streams do not buffer events when there is no listener.
-   *
-   * The controller distributes any events to all currently subscribed
-   * listeners at the time when [add], [addError] or [close] is called.
-   * It is not allowed to call `add`, `addError`, or `close` before a previous
-   * call has returned. The controller does not have any internal queue of
-   * events, and if there are no listeners at the time the event is added,
-   * it will just be dropped, or, if it is an error, be reported as uncaught.
-   *
-   * Each listener subscription is handled independently,
-   * and if one pauses, only the pausing listener is affected.
-   * A paused listener will buffer events internally until unpaused or canceled.
-   *
-   * If [sync] is true, events may be fired directly by the stream's
-   * subscriptions during an [add], [addError] or [close] call.
-   * The returned stream controller is a [SynchronousStreamController],
-   * and must be used with the care and attention necessary to not break
-   * the [Stream] contract.
-   * See [Completer.sync] for some explanations on when a synchronous
-   * dispatching can be used.
-   * If in doubt, keep the controller non-sync.
-   *
-   * If [sync] is false, the event will always be fired at a later time,
-   * after the code adding the event has completed.
-   * In that case, no guarantees are given with regard to when
-   * multiple listeners get the events, except that each listener will get
-   * all events in the correct order. Each subscription handles the events
-   * individually.
-   * If two events are sent on an async controller with two listeners,
-   * one of the listeners may get both events
-   * before the other listener gets any.
-   * A listener must be subscribed both when the event is initiated
-   * (that is, when [add] is called)
-   * and when the event is later delivered,
-   * in order to receive the event.
-   *
-   * The [onListen] callback is called when the first listener is subscribed,
-   * and the [onCancel] is called when there are no longer any active listeners.
-   * If a listener is added again later, after the [onCancel] was called,
-   * the [onListen] will be called again.
-   */
-  factory StreamController.broadcast(
-      {void onListen()?, void onCancel()?, bool sync = false}) {
-    return sync
-        ? _SyncBroadcastStreamController<T>(onListen, onCancel)
-        : _AsyncBroadcastStreamController<T>(onListen, onCancel);
-  }
-
-  /**
-   * The callback which is called when the stream is listened to.
-   *
-   * May be set to `null`, in which case no callback will happen.
-   */
-  void Function()? get onListen;
-
-  void set onListen(void onListenHandler()?);
-
-  /**
-   * The callback which is called when the stream is paused.
-   *
-   * May be set to `null`, in which case no callback will happen.
-   *
-   * Pause related callbacks are not supported on broadcast stream controllers.
-   */
-  void Function()? get onPause;
-
-  void set onPause(void onPauseHandler()?);
-
-  /**
-   * The callback which is called when the stream is resumed.
-   *
-   * May be set to `null`, in which case no callback will happen.
-   *
-   * Pause related callbacks are not supported on broadcast stream controllers.
-   */
-  void Function()? get onResume;
-
-  void set onResume(void onResumeHandler()?);
-
-  /**
-   * The callback which is called when the stream is canceled.
-   *
-   * May be set to `null`, in which case no callback will happen.
-   */
-  FutureOr<void> Function()? get onCancel;
-
-  void set onCancel(FutureOr<void> onCancelHandler()?);
-
-  /**
-   * Returns a view of this object that only exposes the [StreamSink] interface.
-   */
-  StreamSink<T> get sink;
-
-  /**
-   * Whether the stream controller is closed for adding more events.
-   *
-   * The controller becomes closed by calling the [close] method.
-   * New events cannot be added, by calling [add] or [addError],
-   * to a closed controller.
-   *
-   * If the controller is closed,
-   * the "done" event might not have been delivered yet,
-   * but it has been scheduled, and it is too late to add more events.
-   */
-  bool get isClosed;
-
-  /**
-   * Whether the subscription would need to buffer events.
-   *
-   * This is the case if the controller's stream has a listener and it is
-   * paused, or if it has not received a listener yet. In that case, the
-   * controller is considered paused as well.
-   *
-   * A broadcast stream controller is never considered paused. It always
-   * forwards its events to all uncanceled subscriptions, if any,
-   * and let the subscriptions handle their own pausing and buffering.
-   */
-  bool get isPaused;
-
-  /** Whether there is a subscriber on the [Stream]. */
-  bool get hasListener;
-
-  /**
-   * Sends a data [event].
-   *
-   * Listeners receive this event in a later microtask.
-   *
-   * Note that a synchronous controller (created by passing true to the `sync`
-   * parameter of the `StreamController` constructor) delivers events
-   * immediately. Since this behavior violates the contract mentioned here,
-   * synchronous controllers should only be used as described in the
-   * documentation to ensure that the delivered events always *appear* as if
-   * they were delivered in a separate microtask.
-   */
-  void add(T event);
-
-  /**
-   * Sends or enqueues an error event.
-   *
-   * If [error] is `null`, it is replaced by a [NullThrownError].
-   *
-   * Listeners receive this event at a later microtask. This behavior can be
-   * overridden by using `sync` controllers. Note, however, that sync
-   * controllers have to satisfy the preconditions mentioned in the
-   * documentation of the constructors.
-   */
-  void addError(Object error, [StackTrace? stackTrace]);
-
-  /**
-   * Closes the stream.
-   *
-   * No further events can be added to a closed stream.
-   *
-   * The returned future is the same future provided by [done].
-   * It is completed when the stream listeners is done sending events,
-   * This happens either when the done event has been sent,
-   * or when the subscriber on a single-subscription stream is canceled.
-   *
-   * A broadcast stream controller will send the done event
-   * even if listeners are paused, so some broadcast events may not have been
-   * received yet when the returned future completes.
-   *
-   * If noone listens to a non-broadcast stream,
-   * or the listener pauses and never resumes,
-   * the done event will not be sent and this future will never complete.
-   */
-  Future close();
-
-  /**
-   * A future which is completed when the stream controller is done
-   * sending events.
-   *
-   * This happens either when the done event has been sent, or if the
-   * subscriber on a single-subscription stream is canceled.
-   *
-   * A broadcast stream controller will send the done event
-   * even if listeners are paused, so some broadcast events may not have been
-   * received yet when the returned future completes.
-   *
-   * If there is no listener on a non-broadcast stream,
-   * or the listener pauses and never resumes,
-   * the done event will not be sent and this future will never complete.
-   */
-  Future get done;
-
-  /**
-   * Receives events from [source] and puts them into this controller's stream.
-   *
-   * Returns a future which completes when the source stream is done.
-   *
-   * Events must not be added directly to this controller using [add],
-   * [addError], [close] or [addStream], until the returned future
-   * is complete.
-   *
-   * Data and error events are forwarded to this controller's stream. A done
-   * event on the source will end the `addStream` operation and complete the
-   * returned future.
-   *
-   * If [cancelOnError] is true, only the first error on [source] is
-   * forwarded to the controller's stream, and the `addStream` ends
-   * after this. If [cancelOnError] is false, all errors are forwarded
-   * and only a done event will end the `addStream`.
-   * If [cancelOnError] is omitted or `null`, it defaults to false.
-   */
-  Future addStream(Stream<T> source, {bool? cancelOnError});
-}
-
-/**
- * A stream controller that delivers its events synchronously.
- *
- * A synchronous stream controller is intended for cases where
- * an already asynchronous event triggers an event on a stream.
- *
- * Instead of adding the event to the stream in a later microtask,
- * causing extra latency, the event is instead fired immediately by the
- * synchronous stream controller, as if the stream event was
- * the current event or microtask.
- *
- * The synchronous stream controller can be used to break the contract
- * on [Stream], and it must be used carefully to avoid doing so.
- *
- * The only advantage to using a [SynchronousStreamController] over a
- * normal [StreamController] is the improved latency.
- * Only use the synchronous version if the improvement is significant,
- * and if its use is safe. Otherwise just use a normal stream controller,
- * which will always have the correct behavior for a [Stream], and won't
- * accidentally break other code.
- *
- * Adding events to a synchronous controller should only happen as the
- * very last part of the handling of the original event.
- * At that point, adding an event to the stream is equivalent to
- * returning to the event loop and adding the event in the next microtask.
- *
- * Each listener callback will be run as if it was a top-level event
- * or microtask. This means that if it throws, the error will be reported as
- * uncaught as soon as possible.
- * This is one reason to add the event as the last thing in the original event
- * handler - any action done after adding the event will delay the report of
- * errors in the event listener callbacks.
- *
- * If an event is added in a setting that isn't known to be another event,
- * it may cause the stream's listener to get that event before the listener
- * is ready to handle it. We promise that after calling [Stream.listen],
- * you won't get any events until the code doing the listen has completed.
- * Calling [add] in response to a function call of unknown origin may break
- * that promise.
- *
- * An [onListen] callback from the controller is *not* an asynchronous event,
- * and adding events to the controller in the `onListen` callback is always
- * wrong. The events will be delivered before the listener has even received
- * the subscription yet.
- *
- * The synchronous broadcast stream controller also has a restrictions that a
- * normal stream controller does not:
- * The [add], [addError], [close] and [addStream] methods *must not* be
- * called while an event is being delivered.
- * That is, if a callback on a subscription on the controller's stream causes
- * a call to any of the functions above, the call will fail.
- * A broadcast stream may have more than one listener, and if an
- * event is added synchronously while another is being also in the process
- * of being added, the latter event might reach some listeners before
- * the former. To prevent that, an event cannot be added while a previous
- * event is being fired.
- * This guarantees that an event is fully delivered when the
- * first [add], [addError] or [close] returns,
- * and further events will be delivered in the correct order.
- *
- * This still only guarantees that the event is delivered to the subscription.
- * If the subscription is paused, the actual callback may still happen later,
- * and the event will instead be buffered by the subscription.
- * Barring pausing, and the following buffered events that haven't been
- * delivered yet, callbacks will be called synchronously when an event is added.
- *
- * Adding an event to a synchronous non-broadcast stream controller while
- * another event is in progress may cause the second event to be delayed
- * and not be delivered synchronously, and until that event is delivered,
- * the controller will not act synchronously.
- */
-abstract class SynchronousStreamController<T> implements StreamController<T> {
-  /**
-   * Adds event to the controller's stream.
-   *
-   * As [StreamController.add], but must not be called while an event is
-   * being added by [add], [addError] or [close].
-   */
-  void add(T data);
-
-  /**
-   * Adds error to the controller's stream.
-   *
-   * As [StreamController.addError], but must not be called while an event is
-   * being added by [add], [addError] or [close].
-   */
-  void addError(Object error, [StackTrace? stackTrace]);
-
-  /**
-   * Closes the controller's stream.
-   *
-   * As [StreamController.close], but must not be called while an event is
-   * being added by [add], [addError] or [close].
-   */
-  Future close();
-}
-
-abstract class _StreamControllerLifecycle<T> {
-  StreamSubscription<T> _subscribe(void onData(T data)?, Function? onError,
-      void onDone()?, bool cancelOnError);
-  void _recordPause(StreamSubscription<T> subscription) {}
-  void _recordResume(StreamSubscription<T> subscription) {}
-  Future<void>? _recordCancel(StreamSubscription<T> subscription) => null;
-}
-
-// Base type for implementations of stream controllers.
-abstract class _StreamControllerBase<T>
-    implements
-        StreamController<T>,
-        _StreamControllerLifecycle<T>,
-        _EventSink<T>,
-        _EventDispatch<T> {}
-
-/**
- * Default implementation of [StreamController].
- *
- * Controls a stream that only supports a single controller.
- */
-abstract class _StreamController<T> implements _StreamControllerBase<T> {
-  // The states are bit-flags. More than one can be set at a time.
-  //
-  // The "subscription state" goes through the states:
-  //   initial -> subscribed -> canceled.
-  // These are mutually exclusive.
-  // The "closed" state records whether the [close] method has been called
-  // on the controller. This can be done at any time. If done before
-  // subscription, the done event is queued. If done after cancel, the done
-  // event is ignored (just as any other event after a cancel).
-
-  /** The controller is in its initial state with no subscription. */
-  static const int _STATE_INITIAL = 0;
-  /**
-   * The controller has a subscription, but hasn't been closed or canceled.
-   *
-   * Keep in sync with
-   * runtime/vm/stack_trace.cc:kStreamController_StateSubscribed.
-   */
-  static const int _STATE_SUBSCRIBED = 1;
-  /** The subscription is canceled. */
-  static const int _STATE_CANCELED = 2;
-  /** Mask for the subscription state. */
-  static const int _STATE_SUBSCRIPTION_MASK = 3;
-
-  // The following state relate to the controller, not the subscription.
-  // If closed, adding more events is not allowed.
-  // If executing an [addStream], new events are not allowed either, but will
-  // be added by the stream.
-
-  /**
-   * The controller is closed due to calling [close].
-   *
-   * When the stream is closed, you can neither add new events nor add new
-   * listeners.
-   */
-  static const int _STATE_CLOSED = 4;
-  /**
-   * The controller is in the middle of an [addStream] operation.
-   *
-   * While adding events from a stream, no new events can be added directly
-   * on the controller.
-   */
-  static const int _STATE_ADDSTREAM = 8;
-
-  /**
-   * Field containing different data depending on the current subscription
-   * state.
-   *
-   * If [_state] is [_STATE_INITIAL], the field may contain a [_PendingEvents]
-   * for events added to the controller before a subscription.
-   *
-   * While [_state] is [_STATE_SUBSCRIBED], the field contains the subscription.
-   *
-   * When [_state] is [_STATE_CANCELED] the field is currently not used,
-   * and will contain `null`.
-   */
-  @pragma("vm:entry-point")
-  Object? _varData;
-
-  /** Current state of the controller. */
-  @pragma("vm:entry-point")
-  int _state = _STATE_INITIAL;
-
-  /**
-   * Future completed when the stream sends its last event.
-   *
-   * This is also the future returned by [close].
-   */
-  // TODO(lrn): Could this be stored in the varData field too, if it's not
-  // accessed until the call to "close"? Then we need to special case if it's
-  // accessed earlier, or if close is called before subscribing.
-  _Future<void>? _doneFuture;
-
-  void Function()? onListen;
-  void Function()? onPause;
-  void Function()? onResume;
-  FutureOr<void> Function()? onCancel;
-
-  _StreamController(this.onListen, this.onPause, this.onResume, this.onCancel);
-
-  // Return a new stream every time. The streams are equal, but not identical.
-  Stream<T> get stream => _ControllerStream<T>(this);
-
-  /**
-   * Returns a view of this object that only exposes the [StreamSink] interface.
-   */
-  StreamSink<T> get sink => _StreamSinkWrapper<T>(this);
-
-  /**
-   * Whether a listener has existed and been canceled.
-   *
-   * After this, adding more events will be ignored.
-   */
-  bool get _isCanceled => (_state & _STATE_CANCELED) != 0;
-
-  /** Whether there is an active listener. */
-  bool get hasListener => (_state & _STATE_SUBSCRIBED) != 0;
-
-  /** Whether there has not been a listener yet. */
-  bool get _isInitialState =>
-      (_state & _STATE_SUBSCRIPTION_MASK) == _STATE_INITIAL;
-
-  bool get isClosed => (_state & _STATE_CLOSED) != 0;
-
-  bool get isPaused =>
-      hasListener ? _subscription._isInputPaused : !_isCanceled;
-
-  bool get _isAddingStream => (_state & _STATE_ADDSTREAM) != 0;
-
-  /** New events may not be added after close, or during addStream. */
-  bool get _mayAddEvent => (_state < _STATE_CLOSED);
-
-  // Returns the pending events.
-  // Pending events are events added before a subscription exists.
-  // They are added to the subscription when it is created.
-  // Pending events, if any, are kept in the _varData field until the
-  // stream is listened to.
-  // While adding a stream, pending events are moved into the
-  // state object to allow the state object to use the _varData field.
-  _PendingEvents<T>? get _pendingEvents {
-    assert(_isInitialState);
-    if (!_isAddingStream) {
-      return _varData as dynamic;
-    }
-    _StreamControllerAddStreamState<T> state = _varData as dynamic;
-    return state.varData;
-  }
-
-  // Returns the pending events, and creates the object if necessary.
-  _StreamImplEvents<T> _ensurePendingEvents() {
-    assert(_isInitialState);
-    if (!_isAddingStream) {
-      Object? events = _varData;
-      if (events == null) {
-        _varData = events = _StreamImplEvents<T>();
-      }
-      return events as dynamic;
-    }
-    _StreamControllerAddStreamState<T> state = _varData as dynamic;
-    Object? events = state.varData;
-    if (events == null) {
-      state.varData = events = _StreamImplEvents<T>();
-    }
-    return events as dynamic;
-  }
-
-  // Get the current subscription.
-  // If we are adding a stream, the subscription is moved into the state
-  // object to allow the state object to use the _varData field.
-  _ControllerSubscription<T> get _subscription {
-    assert(hasListener);
-    Object? varData = _varData;
-    if (_isAddingStream) {
-      _StreamControllerAddStreamState<Object?> streamState = varData as dynamic;
-      varData = streamState.varData;
-    }
-    return varData as dynamic;
-  }
-
-  /**
-   * Creates an error describing why an event cannot be added.
-   *
-   * The reason, and therefore the error message, depends on the current state.
-   */
-  Error _badEventState() {
-    if (isClosed) {
-      return StateError("Cannot add event after closing");
-    }
-    assert(_isAddingStream);
-    return StateError("Cannot add event while adding a stream");
-  }
-
-  // StreamSink interface.
-  Future addStream(Stream<T> source, {bool? cancelOnError}) {
-    if (!_mayAddEvent) throw _badEventState();
-    if (_isCanceled) return _Future.immediate(null);
-    _StreamControllerAddStreamState<T> addState =
-        _StreamControllerAddStreamState<T>(
-            this, _varData, source, cancelOnError ?? false);
-    _varData = addState;
-    _state |= _STATE_ADDSTREAM;
-    return addState.addStreamFuture;
-  }
-
-  /**
-   * Returns a future that is completed when the stream is done
-   * processing events.
-   *
-   * This happens either when the done event has been sent, or if the
-   * subscriber of a single-subscription stream is cancelled.
-   */
-  Future<void> get done => _ensureDoneFuture();
-
-  Future<void> _ensureDoneFuture() =>
-      _doneFuture ??= _isCanceled ? Future._nullFuture : _Future<void>();
-
-  /**
-   * Send or enqueue a data event.
-   */
-  void add(T value) {
-    if (!_mayAddEvent) throw _badEventState();
-    _add(value);
-  }
-
-  /**
-   * Send or enqueue an error event.
-   */
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    if (!_mayAddEvent) throw _badEventState();
-    AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-    if (replacement != null) {
-      error = replacement.error;
-      stackTrace = replacement.stackTrace;
-    } else {
-      stackTrace ??= AsyncError.defaultStackTrace(error);
-    }
-    if (stackTrace == null) throw "unreachable"; // TODO(40088)
-    _addError(error, stackTrace);
-  }
-
-  /**
-   * Closes this controller and sends a done event on the stream.
-   *
-   * The first time a controller is closed, a "done" event is added to its
-   * stream.
-   *
-   * You are allowed to close the controller more than once, but only the first
-   * call has any effect.
-   *
-   * After closing, no further events may be added using [add], [addError]
-   * or [addStream].
-   *
-   * The returned future is completed when the done event has been delivered.
-   */
-  Future close() {
-    if (isClosed) {
-      return _ensureDoneFuture();
-    }
-    if (!_mayAddEvent) throw _badEventState();
-    _closeUnchecked();
-    return _ensureDoneFuture();
-  }
-
-  void _closeUnchecked() {
-    _state |= _STATE_CLOSED;
-    if (hasListener) {
-      _sendDone();
-    } else if (_isInitialState) {
-      _ensurePendingEvents().add(const _DelayedDone());
-    }
-  }
-
-  // EventSink interface. Used by the [addStream] events.
-
-  // Add data event, used both by the [addStream] events and by [add].
-  void _add(T value) {
-    if (hasListener) {
-      _sendData(value);
-    } else if (_isInitialState) {
-      _ensurePendingEvents().add(_DelayedData<T>(value));
-    }
-  }
-
-  void _addError(Object error, StackTrace stackTrace) {
-    if (hasListener) {
-      _sendError(error, stackTrace);
-    } else if (_isInitialState) {
-      _ensurePendingEvents().add(_DelayedError(error, stackTrace));
-    }
-  }
-
-  void _close() {
-    // End of addStream stream.
-    assert(_isAddingStream);
-    _StreamControllerAddStreamState<T> addState = _varData as dynamic;
-    _varData = addState.varData;
-    _state &= ~_STATE_ADDSTREAM;
-    addState.complete();
-  }
-
-  // _StreamControllerLifeCycle interface
-
-  StreamSubscription<T> _subscribe(void onData(T data)?, Function? onError,
-      void onDone()?, bool cancelOnError) {
-    if (!_isInitialState) {
-      throw StateError("Stream has already been listened to.");
-    }
-    _ControllerSubscription<T> subscription = _ControllerSubscription<T>(
-        this, onData, onError, onDone, cancelOnError);
-
-    _PendingEvents<T>? pendingEvents = _pendingEvents;
-    _state |= _STATE_SUBSCRIBED;
-    if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
-      addState.varData = subscription;
-      addState.resume();
-    } else {
-      _varData = subscription;
-    }
-    subscription._setPendingEvents(pendingEvents);
-    subscription._guardCallback(() {
-      _runGuarded(onListen);
-    });
-
-    return subscription;
-  }
-
-  Future<void>? _recordCancel(StreamSubscription<T> subscription) {
-    // When we cancel, we first cancel any stream being added,
-    // Then we call `onCancel`, and finally the _doneFuture is completed.
-    // If either of addStream's cancel or `onCancel` returns a future,
-    // we wait for it before continuing.
-    // Any error during this process ends up in the returned future.
-    // If more errors happen, we act as if it happens inside nested try/finallys
-    // or whenComplete calls, and only the last error ends up in the
-    // returned future.
-    Future<void>? result;
-    if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
-      result = addState.cancel();
-    }
-    _varData = null;
-    _state =
-        (_state & ~(_STATE_SUBSCRIBED | _STATE_ADDSTREAM)) | _STATE_CANCELED;
-
-    var onCancel = this.onCancel;
-    if (onCancel != null) {
-      if (result == null) {
-        // Only introduce a future if one is needed.
-        // If _onCancel returns null, no future is needed.
-        try {
-          var cancelResult = onCancel();
-          if (cancelResult is Future<void>) {
-            result = cancelResult;
-          }
-        } catch (e, s) {
-          // Return the error in the returned future.
-          // Complete it asynchronously, so there is time for a listener
-          // to handle the error.
-          result = _Future().._asyncCompleteError(e, s);
-        }
-      } else {
-        // Simpler case when we already know that we will return a future.
-        result = result.whenComplete(onCancel);
-      }
-    }
-
-    void complete() {
-      var doneFuture = _doneFuture;
-      if (doneFuture != null && doneFuture._mayComplete) {
-        doneFuture._asyncComplete(null);
-      }
-    }
-
-    if (result != null) {
-      result = result.whenComplete(complete);
-    } else {
-      complete();
-    }
-
-    return result;
-  }
-
-  void _recordPause(StreamSubscription<T> subscription) {
-    if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
-      addState.pause();
-    }
-    _runGuarded(onPause);
-  }
-
-  void _recordResume(StreamSubscription<T> subscription) {
-    if (_isAddingStream) {
-      _StreamControllerAddStreamState<T> addState = _varData as dynamic;
-      addState.resume();
-    }
-    _runGuarded(onResume);
-  }
-}
-
-abstract class _SyncStreamControllerDispatch<T>
-    implements _StreamController<T>, SynchronousStreamController<T> {
-  int get _state;
-  void set _state(int state);
-
-  void _sendData(T data) {
-    _subscription._add(data);
-  }
-
-  void _sendError(Object error, StackTrace stackTrace) {
-    _subscription._addError(error, stackTrace);
-  }
-
-  void _sendDone() {
-    _subscription._close();
-  }
-}
-
-abstract class _AsyncStreamControllerDispatch<T>
-    implements _StreamController<T> {
-  void _sendData(T data) {
-    _subscription._addPending(_DelayedData<T>(data));
-  }
-
-  void _sendError(Object error, StackTrace stackTrace) {
-    _subscription._addPending(_DelayedError(error, stackTrace));
-  }
-
-  void _sendDone() {
-    _subscription._addPending(const _DelayedDone());
-  }
-}
-
-// TODO(lrn): Use common superclass for callback-controllers when VM supports
-// constructors in mixin superclasses.
-
-class _AsyncStreamController<T> = _StreamController<T>
-    with _AsyncStreamControllerDispatch<T>;
-
-class _SyncStreamController<T> = _StreamController<T>
-    with _SyncStreamControllerDispatch<T>;
-
-void _runGuarded(void Function()? notificationHandler) {
-  if (notificationHandler == null) return;
-  try {
-    notificationHandler();
-  } catch (e, s) {
-    Zone.current.handleUncaughtError(e, s);
-  }
-}
-
-class _ControllerStream<T> extends _StreamImpl<T> {
-  _StreamControllerLifecycle<T> _controller;
-
-  _ControllerStream(this._controller);
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-          Function? onError, void onDone()?, bool cancelOnError) =>
-      _controller._subscribe(onData, onError, onDone, cancelOnError);
-
-  // Override == and hashCode so that new streams returned by the same
-  // controller are considered equal. The controller returns a new stream
-  // each time it's queried, but doesn't have to cache the result.
-
-  int get hashCode => _controller.hashCode ^ 0x35323532;
-
-  bool operator ==(Object other) {
-    if (identical(this, other)) return true;
-    return other is _ControllerStream &&
-        identical(other._controller, this._controller);
-  }
-}
-
-class _ControllerSubscription<T> extends _BufferingStreamSubscription<T> {
-  final _StreamControllerLifecycle<T> _controller;
-
-  _ControllerSubscription(this._controller, void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError)
-      : super(onData, onError, onDone, cancelOnError);
-
-  Future<void>? _onCancel() {
-    return _controller._recordCancel(this);
-  }
-
-  void _onPause() {
-    _controller._recordPause(this);
-  }
-
-  void _onResume() {
-    _controller._recordResume(this);
-  }
-}
-
-/** A class that exposes only the [StreamSink] interface of an object. */
-class _StreamSinkWrapper<T> implements StreamSink<T> {
-  final StreamController _target;
-  _StreamSinkWrapper(this._target);
-  void add(T data) {
-    _target.add(data);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    _target.addError(error, stackTrace);
-  }
-
-  Future close() => _target.close();
-
-  Future addStream(Stream<T> source) => _target.addStream(source);
-
-  Future get done => _target.done;
-}
-
-/**
- * Object containing the state used to handle [StreamController.addStream].
- */
-class _AddStreamState<T> {
-  // [_Future] returned by call to addStream.
-  final _Future addStreamFuture;
-
-  // Subscription on stream argument to addStream.
-  final StreamSubscription addSubscription;
-
-  _AddStreamState(
-      _EventSink<T> controller, Stream<T> source, bool cancelOnError)
-      : addStreamFuture = _Future(),
-        addSubscription = source.listen(controller._add,
-            onError: cancelOnError
-                ? makeErrorHandler(controller)
-                : controller._addError,
-            onDone: controller._close,
-            cancelOnError: cancelOnError);
-
-  static makeErrorHandler(_EventSink controller) => (Object e, StackTrace s) {
-        controller._addError(e, s);
-        controller._close();
-      };
-
-  void pause() {
-    addSubscription.pause();
-  }
-
-  void resume() {
-    addSubscription.resume();
-  }
-
-  /**
-   * Stop adding the stream.
-   *
-   * Complete the future returned by `StreamController.addStream` when
-   * the cancel is complete.
-   *
-   * Return a future if the cancel takes time, otherwise return `null`.
-   */
-  Future<void> cancel() {
-    var cancel = addSubscription.cancel();
-    if (cancel == null) {
-      addStreamFuture._asyncComplete(null);
-      return Future._nullFuture;
-    }
-    return cancel.whenComplete(() {
-      addStreamFuture._asyncComplete(null);
-    });
-  }
-
-  void complete() {
-    addStreamFuture._asyncComplete(null);
-  }
-}
-
-class _StreamControllerAddStreamState<T> extends _AddStreamState<T> {
-  // The subscription or pending data of a _StreamController.
-  // Stored here because we reuse the `_varData` field  in the _StreamController
-  // to store this state object.
-  var varData;
-
-  _StreamControllerAddStreamState(_StreamController<T> controller, this.varData,
-      Stream<T> source, bool cancelOnError)
-      : super(controller, source, cancelOnError) {
-    if (controller.isPaused) {
-      addSubscription.pause();
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/async/stream_impl.dart b/sdk_nnbd/lib/async/stream_impl.dart
deleted file mode 100644
index 1c6fa50..0000000
--- a/sdk_nnbd/lib/async/stream_impl.dart
+++ /dev/null
@@ -1,1099 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-/** Abstract and private interface for a place to put events. */
-abstract class _EventSink<T> {
-  void _add(T data);
-  void _addError(Object error, StackTrace stackTrace);
-  void _close();
-}
-
-/**
- * Abstract and private interface for a place to send events.
- *
- * Used by event buffering to finally dispatch the pending event, where
- * [_EventSink] is where the event first enters the stream subscription,
- * and may yet be buffered.
- */
-abstract class _EventDispatch<T> {
-  void _sendData(T data);
-  void _sendError(Object error, StackTrace stackTrace);
-  void _sendDone();
-}
-
-/**
- * Default implementation of stream subscription of buffering events.
- *
- * The only public methods are those of [StreamSubscription], so instances of
- * [_BufferingStreamSubscription] can be returned directly as a
- * [StreamSubscription] without exposing internal functionality.
- *
- * The [StreamController] is a public facing version of [Stream] and this class,
- * with some methods made public.
- *
- * The user interface of [_BufferingStreamSubscription] are the following
- * methods:
- *
- * * [_add]: Add a data event to the stream.
- * * [_addError]: Add an error event to the stream.
- * * [_close]: Request to close the stream.
- * * [_onCancel]: Called when the subscription will provide no more events,
- *     either due to being actively canceled, or after sending a done event.
- * * [_onPause]: Called when the subscription wants the event source to pause.
- * * [_onResume]: Called when allowing new events after a pause.
- *
- * The user should not add new events when the subscription requests a paused,
- * but if it happens anyway, the subscription will enqueue the events just as
- * when new events arrive while still firing an old event.
- */
-class _BufferingStreamSubscription<T>
-    implements StreamSubscription<T>, _EventSink<T>, _EventDispatch<T> {
-  /** The `cancelOnError` flag from the `listen` call. */
-  static const int _STATE_CANCEL_ON_ERROR = 1;
-  /**
-   * Whether the "done" event has been received.
-   * No further events are accepted after this.
-   */
-  static const int _STATE_CLOSED = 2;
-  /**
-   * Set if the input has been asked not to send events.
-   *
-   * This is not the same as being paused, since the input will remain paused
-   * after a call to [resume] if there are pending events.
-   */
-  static const int _STATE_INPUT_PAUSED = 4;
-  /**
-   * Whether the subscription has been canceled.
-   *
-   * Set by calling [cancel], or by handling a "done" event, or an "error" event
-   * when `cancelOnError` is true.
-   */
-  static const int _STATE_CANCELED = 8;
-  /**
-   * Set when either:
-   *
-   *   * an error is sent, and [cancelOnError] is true, or
-   *   * a done event is sent.
-   *
-   * If the subscription is canceled while _STATE_WAIT_FOR_CANCEL is set, the
-   * state is unset, and no further events must be delivered.
-   */
-  static const int _STATE_WAIT_FOR_CANCEL = 16;
-  static const int _STATE_IN_CALLBACK = 32;
-  static const int _STATE_HAS_PENDING = 64;
-  static const int _STATE_PAUSE_COUNT = 128;
-
-  /* Event handlers provided in constructor. */
-  @pragma("vm:entry-point")
-  _DataHandler<T> _onData;
-  Function _onError;
-  _DoneHandler _onDone;
-
-  final Zone _zone;
-
-  /** Bit vector based on state-constants above. */
-  int _state;
-
-  // TODO(floitsch): reuse another field
-  /** The future [_onCancel] may return. */
-  Future? _cancelFuture;
-
-  /**
-   * Queue of pending events.
-   *
-   * Is created when necessary, or set in constructor for preconfigured events.
-   */
-  _PendingEvents<T>? _pending;
-
-  _BufferingStreamSubscription(void onData(T data)?, Function? onError,
-      void onDone()?, bool cancelOnError)
-      : this.zoned(Zone.current, onData, onError, onDone, cancelOnError);
-
-  _BufferingStreamSubscription.zoned(this._zone, void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError)
-      : _state = (cancelOnError ? _STATE_CANCEL_ON_ERROR : 0),
-        _onData = _registerDataHandler<T>(_zone, onData),
-        _onError = _registerErrorHandler(_zone, onError),
-        _onDone = _registerDoneHandler(_zone, onDone);
-
-  /**
-   * Sets the subscription's pending events object.
-   *
-   * This can only be done once. The pending events object is used for the
-   * rest of the subscription's life cycle.
-   */
-  void _setPendingEvents(_PendingEvents<T>? pendingEvents) {
-    assert(_pending == null);
-    if (pendingEvents == null) return;
-    _pending = pendingEvents;
-    if (!pendingEvents.isEmpty) {
-      _state |= _STATE_HAS_PENDING;
-      pendingEvents.schedule(this);
-    }
-  }
-
-  // StreamSubscription interface.
-
-  void onData(void handleData(T event)?) {
-    _onData = _registerDataHandler<T>(_zone, handleData);
-  }
-
-  static void Function(T) _registerDataHandler<T>(
-      Zone zone, void Function(T)? handleData) {
-    return zone.registerUnaryCallback<void, T>(handleData ?? _nullDataHandler);
-  }
-
-  void onError(Function? handleError) {
-    _onError = _registerErrorHandler(_zone, handleError);
-  }
-
-  static Function _registerErrorHandler(Zone zone, Function? handleError) {
-    // TODO(lrn): Consider whether we need to register the null handler.
-    handleError ??= _nullErrorHandler;
-    if (handleError is void Function(Object, StackTrace)) {
-      return zone
-          .registerBinaryCallback<dynamic, Object, StackTrace>(handleError);
-    }
-    if (handleError is void Function(Object)) {
-      return zone.registerUnaryCallback<dynamic, Object>(handleError);
-    }
-    throw new ArgumentError("handleError callback must take either an Object "
-        "(the error), or both an Object (the error) and a StackTrace.");
-  }
-
-  void onDone(void handleDone()?) {
-    _onDone = _registerDoneHandler(_zone, handleDone);
-  }
-
-  static void Function() _registerDoneHandler(
-      Zone zone, void Function()? handleDone) {
-    return zone.registerCallback(handleDone ?? _nullDoneHandler);
-  }
-
-  void pause([Future<void>? resumeSignal]) {
-    if (_isCanceled) return;
-    bool wasPaused = _isPaused;
-    bool wasInputPaused = _isInputPaused;
-    // Increment pause count and mark input paused (if it isn't already).
-    _state = (_state + _STATE_PAUSE_COUNT) | _STATE_INPUT_PAUSED;
-    resumeSignal?.whenComplete(resume);
-    if (!wasPaused) _pending?.cancelSchedule();
-    if (!wasInputPaused && !_inCallback) _guardCallback(_onPause);
-  }
-
-  void resume() {
-    if (_isCanceled) return;
-    if (_isPaused) {
-      _decrementPauseCount();
-      if (!_isPaused) {
-        if (_hasPending && !_pending!.isEmpty) {
-          // Input is still paused.
-          _pending!.schedule(this);
-        } else {
-          assert(_mayResumeInput);
-          _state &= ~_STATE_INPUT_PAUSED;
-          if (!_inCallback) _guardCallback(_onResume);
-        }
-      }
-    }
-  }
-
-  Future cancel() {
-    // The user doesn't want to receive any further events. If there is an
-    // error or done event pending (waiting for the cancel to be done) discard
-    // that event.
-    _state &= ~_STATE_WAIT_FOR_CANCEL;
-    if (!_isCanceled) {
-      _cancel();
-    }
-    return _cancelFuture ?? Future._nullFuture;
-  }
-
-  Future<E> asFuture<E>([E? futureValue]) {
-    E resultValue;
-    if (futureValue == null) {
-      if (!typeAcceptsNull<E>()) {
-        throw ArgumentError.notNull("futureValue");
-      }
-      resultValue = futureValue as dynamic;
-    } else {
-      resultValue = futureValue;
-    }
-    // Overwrite the onDone and onError handlers.
-    _Future<E> result = new _Future<E>();
-    _onDone = () {
-      result._complete(resultValue);
-    };
-    _onError = (Object error, StackTrace stackTrace) {
-      Future cancelFuture = cancel();
-      if (!identical(cancelFuture, Future._nullFuture)) {
-        cancelFuture.whenComplete(() {
-          result._completeError(error, stackTrace);
-        });
-      } else {
-        result._completeError(error, stackTrace);
-      }
-    };
-    return result;
-  }
-
-  // State management.
-
-  bool get _isInputPaused => (_state & _STATE_INPUT_PAUSED) != 0;
-  bool get _isClosed => (_state & _STATE_CLOSED) != 0;
-  bool get _isCanceled => (_state & _STATE_CANCELED) != 0;
-  bool get _waitsForCancel => (_state & _STATE_WAIT_FOR_CANCEL) != 0;
-  bool get _inCallback => (_state & _STATE_IN_CALLBACK) != 0;
-  bool get _hasPending => (_state & _STATE_HAS_PENDING) != 0;
-  bool get _isPaused => _state >= _STATE_PAUSE_COUNT;
-  bool get _canFire => _state < _STATE_IN_CALLBACK;
-  bool get _mayResumeInput => !_isPaused && (_pending?.isEmpty ?? true);
-  bool get _cancelOnError => (_state & _STATE_CANCEL_ON_ERROR) != 0;
-
-  bool get isPaused => _isPaused;
-
-  void _cancel() {
-    _state |= _STATE_CANCELED;
-    if (_hasPending) {
-      _pending!.cancelSchedule();
-    }
-    if (!_inCallback) _pending = null;
-    _cancelFuture = _onCancel();
-  }
-
-  /**
-   * Decrements the pause count.
-   *
-   * Does not automatically unpause the input (call [_onResume]) when
-   * the pause count reaches zero. This is handled elsewhere, and only
-   * if there are no pending events buffered.
-   */
-  void _decrementPauseCount() {
-    assert(_isPaused);
-    _state -= _STATE_PAUSE_COUNT;
-  }
-
-  // _EventSink interface.
-
-  void _add(T data) {
-    assert(!_isClosed);
-    if (_isCanceled) return;
-    if (_canFire) {
-      _sendData(data);
-    } else {
-      _addPending(new _DelayedData<T>(data));
-    }
-  }
-
-  void _addError(Object error, StackTrace stackTrace) {
-    if (_isCanceled) return;
-    if (_canFire) {
-      _sendError(error, stackTrace); // Reports cancel after sending.
-    } else {
-      _addPending(new _DelayedError(error, stackTrace));
-    }
-  }
-
-  void _close() {
-    assert(!_isClosed);
-    if (_isCanceled) return;
-    _state |= _STATE_CLOSED;
-    if (_canFire) {
-      _sendDone();
-    } else {
-      _addPending(const _DelayedDone());
-    }
-  }
-
-  // Hooks called when the input is paused, unpaused or canceled.
-  // These must not throw. If overwritten to call user code, include suitable
-  // try/catch wrapping and send any errors to
-  // [_Zone.current.handleUncaughtError].
-  void _onPause() {
-    assert(_isInputPaused);
-  }
-
-  void _onResume() {
-    assert(!_isInputPaused);
-  }
-
-  Future<void>? _onCancel() {
-    assert(_isCanceled);
-    return null;
-  }
-
-  // Handle pending events.
-
-  /**
-   * Add a pending event.
-   *
-   * If the subscription is not paused, this also schedules a firing
-   * of pending events later (if necessary).
-   */
-  void _addPending(_DelayedEvent event) {
-    _StreamImplEvents<T>? pending = _pending as dynamic;
-    pending ??= _StreamImplEvents<T>();
-    _pending = pending;
-    pending.add(event);
-    if (!_hasPending) {
-      _state |= _STATE_HAS_PENDING;
-      if (!_isPaused) {
-        pending.schedule(this);
-      }
-    }
-  }
-
-  /* _EventDispatch interface. */
-
-  void _sendData(T data) {
-    assert(!_isCanceled);
-    assert(!_isPaused);
-    assert(!_inCallback);
-    bool wasInputPaused = _isInputPaused;
-    _state |= _STATE_IN_CALLBACK;
-    _zone.runUnaryGuarded(_onData, data);
-    _state &= ~_STATE_IN_CALLBACK;
-    _checkState(wasInputPaused);
-  }
-
-  void _sendError(Object error, StackTrace stackTrace) {
-    assert(!_isCanceled);
-    assert(!_isPaused);
-    assert(!_inCallback);
-    bool wasInputPaused = _isInputPaused;
-
-    void sendError() {
-      // If the subscription has been canceled while waiting for the cancel
-      // future to finish we must not report the error.
-      if (_isCanceled && !_waitsForCancel) return;
-      _state |= _STATE_IN_CALLBACK;
-      // TODO(floitsch): this dynamic should be 'void'.
-      var onError = _onError;
-      if (onError is void Function(Object, StackTrace)) {
-        _zone.runBinaryGuarded<Object, StackTrace>(onError, error, stackTrace);
-      } else {
-        _zone.runUnaryGuarded<Object>(_onError as dynamic, error);
-      }
-      _state &= ~_STATE_IN_CALLBACK;
-    }
-
-    if (_cancelOnError) {
-      _state |= _STATE_WAIT_FOR_CANCEL;
-      _cancel();
-      var cancelFuture = _cancelFuture;
-      if (cancelFuture != null &&
-          !identical(cancelFuture, Future._nullFuture)) {
-        cancelFuture.whenComplete(sendError);
-      } else {
-        sendError();
-      }
-    } else {
-      sendError();
-      // Only check state if not cancelOnError.
-      _checkState(wasInputPaused);
-    }
-  }
-
-  void _sendDone() {
-    assert(!_isCanceled);
-    assert(!_isPaused);
-    assert(!_inCallback);
-
-    void sendDone() {
-      // If the subscription has been canceled while waiting for the cancel
-      // future to finish we must not report the done event.
-      if (!_waitsForCancel) return;
-      _state |= (_STATE_CANCELED | _STATE_CLOSED | _STATE_IN_CALLBACK);
-      _zone.runGuarded(_onDone);
-      _state &= ~_STATE_IN_CALLBACK;
-    }
-
-    _cancel();
-    _state |= _STATE_WAIT_FOR_CANCEL;
-    var cancelFuture = _cancelFuture;
-    if (cancelFuture != null && !identical(cancelFuture, Future._nullFuture)) {
-      cancelFuture.whenComplete(sendDone);
-    } else {
-      sendDone();
-    }
-  }
-
-  /**
-   * Call a hook function.
-   *
-   * The call is properly wrapped in code to avoid other callbacks
-   * during the call, and it checks for state changes after the call
-   * that should cause further callbacks.
-   */
-  void _guardCallback(void Function() callback) {
-    assert(!_inCallback);
-    bool wasInputPaused = _isInputPaused;
-    _state |= _STATE_IN_CALLBACK;
-    callback();
-    _state &= ~_STATE_IN_CALLBACK;
-    _checkState(wasInputPaused);
-  }
-
-  /**
-   * Check if the input needs to be informed of state changes.
-   *
-   * State changes are pausing, resuming and canceling.
-   *
-   * After canceling, no further callbacks will happen.
-   *
-   * The cancel callback is called after a user cancel, or after
-   * the final done event is sent.
-   */
-  void _checkState(bool wasInputPaused) {
-    assert(!_inCallback);
-    if (_hasPending && _pending!.isEmpty) {
-      _state &= ~_STATE_HAS_PENDING;
-      if (_isInputPaused && _mayResumeInput) {
-        _state &= ~_STATE_INPUT_PAUSED;
-      }
-    }
-    // If the state changes during a callback, we immediately
-    // make a new state-change callback. Loop until the state didn't change.
-    while (true) {
-      if (_isCanceled) {
-        _pending = null;
-        return;
-      }
-      bool isInputPaused = _isInputPaused;
-      if (wasInputPaused == isInputPaused) break;
-      _state ^= _STATE_IN_CALLBACK;
-      if (isInputPaused) {
-        _onPause();
-      } else {
-        _onResume();
-      }
-      _state &= ~_STATE_IN_CALLBACK;
-      wasInputPaused = isInputPaused;
-    }
-    if (_hasPending && !_isPaused) {
-      _pending!.schedule(this);
-    }
-  }
-}
-
-// -------------------------------------------------------------------
-// Common base class for single and multi-subscription streams.
-// -------------------------------------------------------------------
-abstract class _StreamImpl<T> extends Stream<T> {
-  // ------------------------------------------------------------------
-  // Stream interface.
-
-  StreamSubscription<T> listen(void onData(T data)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    cancelOnError ??= false;
-    StreamSubscription<T> subscription =
-        _createSubscription(onData, onError, onDone, cancelOnError);
-    _onListen(subscription);
-    return subscription;
-  }
-
-  // -------------------------------------------------------------------
-  /** Create a subscription object. Called by [subcribe]. */
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    return new _BufferingStreamSubscription<T>(
-        onData, onError, onDone, cancelOnError);
-  }
-
-  /** Hook called when the subscription has been created. */
-  void _onListen(StreamSubscription subscription) {}
-}
-
-typedef _PendingEvents<T> _EventGenerator<T>();
-
-/** Stream that generates its own events. */
-class _GeneratedStreamImpl<T> extends _StreamImpl<T> {
-  final _EventGenerator<T> _pending;
-  bool _isUsed = false;
-  /**
-   * Initializes the stream to have only the events provided by a
-   * [_PendingEvents].
-   *
-   * A new [_PendingEvents] must be generated for each listen.
-   */
-  _GeneratedStreamImpl(this._pending);
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    if (_isUsed) throw new StateError("Stream has already been listened to.");
-    _isUsed = true;
-    return new _BufferingStreamSubscription<T>(
-        onData, onError, onDone, cancelOnError)
-      .._setPendingEvents(_pending());
-  }
-}
-
-/** Pending events object that gets its events from an [Iterable]. */
-class _IterablePendingEvents<T> extends _PendingEvents<T> {
-  // The iterator providing data for data events.
-  // Set to null when iteration has completed.
-  Iterator<T>? _iterator;
-
-  _IterablePendingEvents(Iterable<T> data) : _iterator = data.iterator;
-
-  bool get isEmpty => _iterator == null;
-
-  void handleNext(_EventDispatch<T> dispatch) {
-    var iterator = _iterator;
-    if (iterator == null) {
-      throw new StateError("No events pending.");
-    }
-    // Send one event per call to moveNext.
-    // If moveNext returns true, send the current element as data.
-    // If current throws, send that error, but keep iterating.
-    // If moveNext returns false, send a done event and clear the _iterator.
-    // If moveNext throws an error, send an error and prepare to send a done
-    // event afterwards.
-    bool movedNext = false;
-    try {
-      if (iterator.moveNext()) {
-        movedNext = true;
-        dispatch._sendData(iterator.current);
-      } else {
-        _iterator = null;
-        dispatch._sendDone();
-      }
-    } catch (e, s) {
-      if (!movedNext) {
-        // Threw in .moveNext().
-        // Ensure that we send a done afterwards.
-        _iterator = const EmptyIterator<Never>();
-      }
-      // Else threw in .current.
-      dispatch._sendError(e, s);
-    }
-  }
-
-  void clear() {
-    if (isScheduled) cancelSchedule();
-    _iterator = null;
-  }
-}
-
-// Internal helpers.
-
-// Types of the different handlers on a stream. Types used to type fields.
-typedef void _DataHandler<T>(T value);
-typedef void _DoneHandler();
-
-/** Default data handler, does nothing. */
-void _nullDataHandler(dynamic value) {}
-
-/** Default error handler, reports the error to the current zone's handler. */
-void _nullErrorHandler(Object error, StackTrace stackTrace) {
-  Zone.current.handleUncaughtError(error, stackTrace);
-}
-
-/** Default done handler, does nothing. */
-void _nullDoneHandler() {}
-
-/** A delayed event on a buffering stream subscription. */
-abstract class _DelayedEvent<T> {
-  /** Added as a linked list on the [StreamController]. */
-  _DelayedEvent? next;
-  /** Execute the delayed event on the [StreamController]. */
-  void perform(_EventDispatch<T> dispatch);
-}
-
-/** A delayed data event. */
-class _DelayedData<T> extends _DelayedEvent<T> {
-  final T value;
-  _DelayedData(this.value);
-  void perform(_EventDispatch<T> dispatch) {
-    dispatch._sendData(value);
-  }
-}
-
-/** A delayed error event. */
-class _DelayedError extends _DelayedEvent {
-  final Object error;
-  final StackTrace stackTrace;
-
-  _DelayedError(this.error, this.stackTrace);
-  void perform(_EventDispatch dispatch) {
-    dispatch._sendError(error, stackTrace);
-  }
-}
-
-/** A delayed done event. */
-class _DelayedDone implements _DelayedEvent {
-  const _DelayedDone();
-  void perform(_EventDispatch dispatch) {
-    dispatch._sendDone();
-  }
-
-  _DelayedEvent? get next => null;
-
-  void set next(_DelayedEvent? _) {
-    throw new StateError("No events after a done.");
-  }
-}
-
-/** Superclass for provider of pending events. */
-abstract class _PendingEvents<T> {
-  // No async event has been scheduled.
-  static const int _STATE_UNSCHEDULED = 0;
-  // An async event has been scheduled to run a function.
-  static const int _STATE_SCHEDULED = 1;
-  // An async event has been scheduled, but it will do nothing when it runs.
-  // Async events can't be preempted.
-  static const int _STATE_CANCELED = 3;
-
-  /**
-   * State of being scheduled.
-   *
-   * Set to [_STATE_SCHEDULED] when pending events are scheduled for
-   * async dispatch. Since we can't cancel a [scheduleMicrotask] call, if
-   * scheduling is "canceled", the _state is simply set to [_STATE_CANCELED]
-   * which will make the async code do nothing except resetting [_state].
-   *
-   * If events are scheduled while the state is [_STATE_CANCELED], it is
-   * merely switched back to [_STATE_SCHEDULED], but no new call to
-   * [scheduleMicrotask] is performed.
-   */
-  int _state = _STATE_UNSCHEDULED;
-
-  bool get isEmpty;
-
-  bool get isScheduled => _state == _STATE_SCHEDULED;
-  bool get _eventScheduled => _state >= _STATE_SCHEDULED;
-
-  /**
-   * Schedule an event to run later.
-   *
-   * If called more than once, it should be called with the same dispatch as
-   * argument each time. It may reuse an earlier argument in some cases.
-   */
-  void schedule(_EventDispatch<T> dispatch) {
-    if (isScheduled) return;
-    assert(!isEmpty);
-    if (_eventScheduled) {
-      assert(_state == _STATE_CANCELED);
-      _state = _STATE_SCHEDULED;
-      return;
-    }
-    scheduleMicrotask(() {
-      int oldState = _state;
-      _state = _STATE_UNSCHEDULED;
-      if (oldState == _STATE_CANCELED) return;
-      handleNext(dispatch);
-    });
-    _state = _STATE_SCHEDULED;
-  }
-
-  void cancelSchedule() {
-    if (isScheduled) _state = _STATE_CANCELED;
-  }
-
-  void handleNext(_EventDispatch<T> dispatch);
-
-  /** Throw away any pending events and cancel scheduled events. */
-  void clear();
-}
-
-/** Class holding pending events for a [_StreamImpl]. */
-class _StreamImplEvents<T> extends _PendingEvents<T> {
-  /// Single linked list of [_DelayedEvent] objects.
-  _DelayedEvent? firstPendingEvent;
-
-  /// Last element in the list of pending events. New events are added after it.
-  _DelayedEvent? lastPendingEvent;
-
-  bool get isEmpty => lastPendingEvent == null;
-
-  void add(_DelayedEvent event) {
-    var lastEvent = lastPendingEvent;
-    if (lastEvent == null) {
-      firstPendingEvent = lastPendingEvent = event;
-    } else {
-      lastPendingEvent = lastEvent.next = event;
-    }
-  }
-
-  void handleNext(_EventDispatch<T> dispatch) {
-    assert(!isScheduled);
-    assert(!isEmpty);
-    _DelayedEvent event = firstPendingEvent!;
-    _DelayedEvent? nextEvent = event.next;
-    firstPendingEvent = nextEvent;
-    if (nextEvent == null) {
-      lastPendingEvent = null;
-    }
-    event.perform(dispatch);
-  }
-
-  void clear() {
-    if (isScheduled) cancelSchedule();
-    firstPendingEvent = lastPendingEvent = null;
-  }
-}
-
-typedef void _BroadcastCallback<T>(StreamSubscription<T> subscription);
-
-/**
- * Done subscription that will send one done event as soon as possible.
- */
-class _DoneStreamSubscription<T> implements StreamSubscription<T> {
-  static const int _DONE_SENT = 1;
-  static const int _SCHEDULED = 2;
-  static const int _PAUSED = 4;
-
-  final Zone _zone;
-  int _state = 0;
-  _DoneHandler? _onDone;
-
-  _DoneStreamSubscription(this._onDone) : _zone = Zone.current {
-    _schedule();
-  }
-
-  bool get _isSent => (_state & _DONE_SENT) != 0;
-  bool get _isScheduled => (_state & _SCHEDULED) != 0;
-  bool get isPaused => _state >= _PAUSED;
-
-  void _schedule() {
-    if (_isScheduled) return;
-    _zone.scheduleMicrotask(_sendDone);
-    _state |= _SCHEDULED;
-  }
-
-  void onData(void handleData(T data)?) {}
-  void onError(Function? handleError) {}
-  void onDone(void handleDone()?) {
-    _onDone = handleDone;
-  }
-
-  void pause([Future<void>? resumeSignal]) {
-    _state += _PAUSED;
-    if (resumeSignal != null) resumeSignal.whenComplete(resume);
-  }
-
-  void resume() {
-    if (isPaused) {
-      _state -= _PAUSED;
-      if (!isPaused && !_isSent) {
-        _schedule();
-      }
-    }
-  }
-
-  Future cancel() => Future._nullFuture;
-
-  Future<E> asFuture<E>([E? futureValue]) {
-    E resultValue;
-    if (futureValue == null) {
-      if (!typeAcceptsNull<E>()) {
-        throw ArgumentError.notNull("futureValue");
-      }
-      resultValue = futureValue as dynamic;
-    } else {
-      resultValue = futureValue;
-    }
-    _Future<E> result = new _Future<E>();
-    _onDone = () {
-      result._completeWithValue(resultValue);
-    };
-    return result;
-  }
-
-  void _sendDone() {
-    _state &= ~_SCHEDULED;
-    if (isPaused) return;
-    _state |= _DONE_SENT;
-    var doneHandler = _onDone;
-    if (doneHandler != null) _zone.runGuarded(doneHandler);
-  }
-}
-
-class _AsBroadcastStream<T> extends Stream<T> {
-  final Stream<T> _source;
-  final _BroadcastCallback<T>? _onListenHandler;
-  final _BroadcastCallback<T>? _onCancelHandler;
-  final Zone _zone;
-
-  _AsBroadcastStreamController<T>? _controller;
-  StreamSubscription<T>? _subscription;
-
-  _AsBroadcastStream(
-      this._source,
-      void onListenHandler(StreamSubscription<T> subscription)?,
-      void onCancelHandler(StreamSubscription<T> subscription)?)
-      : _onListenHandler = onListenHandler == null
-            ? null
-            : Zone.current.registerUnaryCallback<void, StreamSubscription<T>>(
-                onListenHandler),
-        _onCancelHandler = onCancelHandler == null
-            ? null
-            : Zone.current.registerUnaryCallback<void, StreamSubscription<T>>(
-                onCancelHandler),
-        _zone = Zone.current {
-    _controller = new _AsBroadcastStreamController<T>(_onListen, _onCancel);
-  }
-
-  bool get isBroadcast => true;
-
-  StreamSubscription<T> listen(void onData(T data)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    var controller = _controller;
-    if (controller == null || controller.isClosed) {
-      // Return a dummy subscription backed by nothing, since
-      // it will only ever send one done event.
-      return new _DoneStreamSubscription<T>(onDone);
-    }
-    _subscription ??= _source.listen(controller.add,
-        onError: controller.addError, onDone: controller.close);
-    return controller._subscribe(
-        onData, onError, onDone, cancelOnError ?? false);
-  }
-
-  void _onCancel() {
-    var controller = _controller;
-    bool shutdown = (controller == null) || controller.isClosed;
-    var cancelHandler = _onCancelHandler;
-    if (cancelHandler != null) {
-      _zone.runUnary(cancelHandler, new _BroadcastSubscriptionWrapper<T>(this));
-    }
-    if (shutdown) {
-      var subscription = _subscription;
-      if (subscription != null) {
-        subscription.cancel();
-        _subscription = null;
-      }
-    }
-  }
-
-  void _onListen() {
-    var listenHandler = _onListenHandler;
-    if (listenHandler != null) {
-      _zone.runUnary(listenHandler, new _BroadcastSubscriptionWrapper<T>(this));
-    }
-  }
-
-  // Methods called from _BroadcastSubscriptionWrapper.
-  void _cancelSubscription() {
-    // Called by [_controller] when it has no subscribers left.
-    var subscription = _subscription;
-    if (subscription != null) {
-      _subscription = null;
-      _controller = null; // Marks the stream as no longer listenable.
-      subscription.cancel();
-    }
-  }
-
-  void _pauseSubscription(Future<void>? resumeSignal) {
-    _subscription?.pause(resumeSignal);
-  }
-
-  void _resumeSubscription() {
-    _subscription?.resume();
-  }
-
-  bool get _isSubscriptionPaused {
-    return _subscription?.isPaused ?? false;
-  }
-}
-
-/**
- * Wrapper for subscription that disallows changing handlers.
- */
-class _BroadcastSubscriptionWrapper<T> implements StreamSubscription<T> {
-  final _AsBroadcastStream _stream;
-
-  _BroadcastSubscriptionWrapper(this._stream);
-
-  void onData(void handleData(T data)?) {
-    throw new UnsupportedError(
-        "Cannot change handlers of asBroadcastStream source subscription.");
-  }
-
-  void onError(Function? handleError) {
-    throw new UnsupportedError(
-        "Cannot change handlers of asBroadcastStream source subscription.");
-  }
-
-  void onDone(void handleDone()?) {
-    throw new UnsupportedError(
-        "Cannot change handlers of asBroadcastStream source subscription.");
-  }
-
-  void pause([Future<void>? resumeSignal]) {
-    _stream._pauseSubscription(resumeSignal);
-  }
-
-  void resume() {
-    _stream._resumeSubscription();
-  }
-
-  Future cancel() {
-    _stream._cancelSubscription();
-    return Future._nullFuture;
-  }
-
-  bool get isPaused {
-    return _stream._isSubscriptionPaused;
-  }
-
-  Future<E> asFuture<E>([E? futureValue]) {
-    throw new UnsupportedError(
-        "Cannot change handlers of asBroadcastStream source subscription.");
-  }
-}
-
-/**
- * Simple implementation of [StreamIterator].
- *
- * Pauses the stream between calls to [moveNext].
- */
-class _StreamIterator<T> implements StreamIterator<T> {
-  // The stream iterator is always in one of four states.
-  // The value of the [_stateData] field depends on the state.
-  //
-  // When `_subscription == null` and `_stateData != null`:
-  // The stream iterator has been created, but [moveNext] has not been called
-  // yet. The [_stateData] field contains the stream to listen to on the first
-  // call to [moveNext] and [current] returns `null`.
-  //
-  // When `_subscription != null` and `!_isPaused`:
-  // The user has called [moveNext] and the iterator is waiting for the next
-  // event. The [_stateData] field contains the [_Future] returned by the
-  // [_moveNext] call and [current] returns `null.`
-  //
-  // When `_subscription != null` and `_isPaused`:
-  // The most recent call to [moveNext] has completed with a `true` value
-  // and [current] provides the value of the data event.
-  // The [_stateData] field contains the [current] value.
-  //
-  // When `_subscription == null` and `_stateData == null`:
-  // The stream has completed or been canceled using [cancel].
-  // The stream completes on either a done event or an error event.
-  // The last call to [moveNext] has completed with `false` and [current]
-  // returns `null`.
-
-  /// Subscription being listened to.
-  ///
-  /// Set to `null` when the stream subscription is done or canceled.
-  StreamSubscription<T>? _subscription;
-
-  /// Data value depending on the current state.
-  ///
-  /// Before first call to [moveNext]: The stream to listen to.
-  ///
-  /// After calling [moveNext] but before the returned future completes:
-  /// The returned future.
-  ///
-  /// After calling [moveNext] and the returned future has completed
-  /// with `true`: The value of [current].
-  ///
-  /// After calling [moveNext] and the returned future has completed
-  /// with `false`, or after calling [cancel]: `null`.
-  @pragma("vm:entry-point")
-  Object? _stateData;
-
-  /// Whether the iterator is between calls to `moveNext`.
-  /// This will usually cause the [_subscription] to be paused, but as an
-  /// optimization, we only pause after the [moveNext] future has been
-  /// completed.
-  bool _isPaused = false;
-
-  _StreamIterator(final Stream<T> stream) : _stateData = stream {
-    ArgumentError.checkNotNull(stream, "stream");
-  }
-
-  T get current {
-    if (_subscription != null && _isPaused) {
-      return _stateData as dynamic;
-    }
-    return null as dynamic;
-  }
-
-  Future<bool> moveNext() {
-    var subscription = _subscription;
-    if (subscription != null) {
-      if (_isPaused) {
-        var future = new _Future<bool>();
-        _stateData = future;
-        _isPaused = false;
-        subscription.resume();
-        return future;
-      }
-      throw new StateError("Already waiting for next.");
-    }
-    return _initializeOrDone();
-  }
-
-  /// Called if there is no active subscription when [moveNext] is called.
-  ///
-  /// Either starts listening on the stream if this is the first call to
-  /// [moveNext], or returns a `false` future because the stream has already
-  /// ended.
-  Future<bool> _initializeOrDone() {
-    assert(_subscription == null);
-    var stateData = _stateData;
-    if (stateData != null) {
-      Stream<T> stream = stateData as dynamic;
-      _subscription = stream.listen(_onData,
-          onError: _onError, onDone: _onDone, cancelOnError: true);
-      var future = new _Future<bool>();
-      _stateData = future;
-      return future;
-    }
-    return Future._falseFuture;
-  }
-
-  Future cancel() {
-    StreamSubscription<T>? subscription = _subscription;
-    Object? stateData = _stateData;
-    _stateData = null;
-    if (subscription != null) {
-      _subscription = null;
-      if (!_isPaused) {
-        _Future<bool> future = stateData as dynamic;
-        future._asyncComplete(false);
-      }
-      return subscription.cancel();
-    }
-    return Future._nullFuture;
-  }
-
-  void _onData(T data) {
-    assert(_subscription != null && !_isPaused);
-    _Future<bool> moveNextFuture = _stateData as dynamic;
-    _stateData = data;
-    _isPaused = true;
-    moveNextFuture._complete(true);
-    if (_isPaused) _subscription?.pause();
-  }
-
-  void _onError(Object error, StackTrace stackTrace) {
-    assert(_subscription != null && !_isPaused);
-    _Future<bool> moveNextFuture = _stateData as dynamic;
-    _subscription = null;
-    _stateData = null;
-    moveNextFuture._completeError(error, stackTrace);
-  }
-
-  void _onDone() {
-    assert(_subscription != null && !_isPaused);
-    _Future<bool> moveNextFuture = _stateData as dynamic;
-    _subscription = null;
-    _stateData = null;
-    moveNextFuture._complete(false);
-  }
-}
-
-/** An empty broadcast stream, sending a done event as soon as possible. */
-class _EmptyStream<T> extends Stream<T> {
-  const _EmptyStream() : super._internal();
-  bool get isBroadcast => true;
-  StreamSubscription<T> listen(void onData(T data)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return new _DoneStreamSubscription<T>(onDone);
-  }
-}
diff --git a/sdk_nnbd/lib/async/stream_pipe.dart b/sdk_nnbd/lib/async/stream_pipe.dart
deleted file mode 100644
index fd20228..0000000
--- a/sdk_nnbd/lib/async/stream_pipe.dart
+++ /dev/null
@@ -1,475 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-/** Runs user code and takes actions depending on success or failure. */
-_runUserCode<T>(T userCode(), onSuccess(T value),
-    onError(Object error, StackTrace stackTrace)) {
-  try {
-    onSuccess(userCode());
-  } catch (e, s) {
-    AsyncError? replacement = Zone.current.errorCallback(e, s);
-    if (replacement == null) {
-      onError(e, s);
-    } else {
-      var error = replacement.error;
-      var stackTrace = replacement.stackTrace;
-      onError(error, stackTrace);
-    }
-  }
-}
-
-/** Helper function to cancel a subscription and wait for the potential future,
-  before completing with an error. */
-void _cancelAndError(StreamSubscription subscription, _Future future,
-    Object error, StackTrace stackTrace) {
-  var cancelFuture = subscription.cancel();
-  if (cancelFuture != null && !identical(cancelFuture, Future._nullFuture)) {
-    cancelFuture.whenComplete(() => future._completeError(error, stackTrace));
-  } else {
-    future._completeError(error, stackTrace);
-  }
-}
-
-void _cancelAndErrorWithReplacement(StreamSubscription subscription,
-    _Future future, Object error, StackTrace stackTrace) {
-  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-  if (replacement != null) {
-    error = replacement.error;
-    stackTrace = replacement.stackTrace;
-  }
-  _cancelAndError(subscription, future, error, stackTrace);
-}
-
-/** Helper function to make an onError argument to [_runUserCode]. */
-void Function(Object error, StackTrace stackTrace) _cancelAndErrorClosure(
-    StreamSubscription subscription, _Future future) {
-  return (Object error, StackTrace stackTrace) {
-    _cancelAndError(subscription, future, error, stackTrace);
-  };
-}
-
-/** Helper function to cancel a subscription and wait for the potential future,
-  before completing with a value. */
-void _cancelAndValue(StreamSubscription subscription, _Future future, value) {
-  var cancelFuture = subscription.cancel();
-  if (cancelFuture != null && !identical(cancelFuture, Future._nullFuture)) {
-    cancelFuture.whenComplete(() => future._complete(value));
-  } else {
-    future._complete(value);
-  }
-}
-
-/**
- * A [Stream] that forwards subscriptions to another stream.
- *
- * This stream implements [Stream], but forwards all subscriptions
- * to an underlying stream, and wraps the returned subscription to
- * modify the events on the way.
- *
- * This class is intended for internal use only.
- */
-abstract class _ForwardingStream<S, T> extends Stream<T> {
-  final Stream<S> _source;
-
-  _ForwardingStream(this._source);
-
-  bool get isBroadcast => _source.isBroadcast;
-
-  StreamSubscription<T> listen(void onData(T value)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _createSubscription(onData, onError, onDone, cancelOnError ?? false);
-  }
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    return new _ForwardingStreamSubscription<S, T>(
-        this, onData, onError, onDone, cancelOnError);
-  }
-
-  // Override the following methods in subclasses to change the behavior.
-
-  void _handleData(S data, _EventSink<T> sink);
-
-  void _handleError(Object error, StackTrace stackTrace, _EventSink<T> sink) {
-    sink._addError(error, stackTrace);
-  }
-
-  void _handleDone(_EventSink<T> sink) {
-    sink._close();
-  }
-}
-
-/**
- * Abstract superclass for subscriptions that forward to other subscriptions.
- */
-class _ForwardingStreamSubscription<S, T>
-    extends _BufferingStreamSubscription<T> {
-  final _ForwardingStream<S, T> _stream;
-
-  StreamSubscription<S>? _subscription;
-
-  _ForwardingStreamSubscription(this._stream, void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError)
-      : super(onData, onError, onDone, cancelOnError) {
-    _subscription = _stream._source
-        .listen(_handleData, onError: _handleError, onDone: _handleDone);
-  }
-
-  // _StreamSink interface.
-  // Transformers sending more than one event have no way to know if the stream
-  // is canceled or closed after the first, so we just ignore remaining events.
-
-  void _add(T data) {
-    if (_isClosed) return;
-    super._add(data);
-  }
-
-  void _addError(Object error, StackTrace stackTrace) {
-    if (_isClosed) return;
-    super._addError(error, stackTrace);
-  }
-
-  // StreamSubscription callbacks.
-
-  void _onPause() {
-    _subscription?.pause();
-  }
-
-  void _onResume() {
-    _subscription?.resume();
-  }
-
-  Future<void>? _onCancel() {
-    var subscription = _subscription;
-    if (subscription != null) {
-      _subscription = null;
-      return subscription.cancel();
-    }
-    return null;
-  }
-
-  // Methods used as listener on source subscription.
-
-  void _handleData(S data) {
-    _stream._handleData(data, this);
-  }
-
-  void _handleError(error, StackTrace stackTrace) {
-    _stream._handleError(error, stackTrace, this);
-  }
-
-  void _handleDone() {
-    _stream._handleDone(this);
-  }
-}
-
-// -------------------------------------------------------------------
-// Stream transformers used by the default Stream implementation.
-// -------------------------------------------------------------------
-
-void _addErrorWithReplacement(
-    _EventSink sink, Object error, StackTrace stackTrace) {
-  AsyncError? replacement = Zone.current.errorCallback(error, stackTrace);
-  if (replacement != null) {
-    error = replacement.error;
-    stackTrace = replacement.stackTrace;
-  }
-  sink._addError(error, stackTrace);
-}
-
-class _WhereStream<T> extends _ForwardingStream<T, T> {
-  final bool Function(T) _test;
-
-  _WhereStream(Stream<T> source, bool test(T value))
-      : _test = test,
-        super(source);
-
-  void _handleData(T inputEvent, _EventSink<T> sink) {
-    bool satisfies;
-    try {
-      satisfies = _test(inputEvent);
-    } catch (e, s) {
-      _addErrorWithReplacement(sink, e, s);
-      return;
-    }
-    if (satisfies) {
-      sink._add(inputEvent);
-    }
-  }
-}
-
-typedef T _Transformation<S, T>(S value);
-
-/**
- * A stream pipe that converts data events before passing them on.
- */
-class _MapStream<S, T> extends _ForwardingStream<S, T> {
-  final _Transformation<S, T> _transform;
-
-  _MapStream(Stream<S> source, T transform(S event))
-      : this._transform = transform,
-        super(source);
-
-  void _handleData(S inputEvent, _EventSink<T> sink) {
-    T outputEvent;
-    try {
-      outputEvent = _transform(inputEvent);
-    } catch (e, s) {
-      _addErrorWithReplacement(sink, e, s);
-      return;
-    }
-    sink._add(outputEvent);
-  }
-}
-
-/**
- * A stream pipe that converts data events before passing them on.
- */
-class _ExpandStream<S, T> extends _ForwardingStream<S, T> {
-  final _Transformation<S, Iterable<T>> _expand;
-
-  _ExpandStream(Stream<S> source, Iterable<T> expand(S event))
-      : this._expand = expand,
-        super(source);
-
-  void _handleData(S inputEvent, _EventSink<T> sink) {
-    try {
-      for (T value in _expand(inputEvent)) {
-        sink._add(value);
-      }
-    } catch (e, s) {
-      // If either _expand or iterating the generated iterator throws,
-      // we abort the iteration.
-      _addErrorWithReplacement(sink, e, s);
-    }
-  }
-}
-
-/**
- * A stream pipe that converts or disposes error events
- * before passing them on.
- */
-class _HandleErrorStream<T> extends _ForwardingStream<T, T> {
-  final Function _transform;
-  final bool Function(Object)? _test;
-
-  _HandleErrorStream(
-      Stream<T> source, Function onError, bool test(Object error)?)
-      : this._transform = onError,
-        this._test = test,
-        super(source);
-
-  void _handleData(T data, _EventSink<T> sink) {
-    sink._add(data);
-  }
-
-  void _handleError(Object error, StackTrace stackTrace, _EventSink<T> sink) {
-    bool matches = true;
-    var test = _test;
-    if (test != null) {
-      try {
-        matches = test(error);
-      } catch (e, s) {
-        _addErrorWithReplacement(sink, e, s);
-        return;
-      }
-    }
-    if (matches) {
-      try {
-        _invokeErrorHandler(_transform, error, stackTrace);
-      } catch (e, s) {
-        if (identical(e, error)) {
-          sink._addError(error, stackTrace);
-        } else {
-          _addErrorWithReplacement(sink, e, s);
-        }
-        return;
-      }
-    } else {
-      sink._addError(error, stackTrace);
-    }
-  }
-}
-
-class _TakeStream<T> extends _ForwardingStream<T, T> {
-  final int _count;
-
-  _TakeStream(Stream<T> source, int count)
-      : this._count = count,
-        super(source);
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    if (_count == 0) {
-      _source.listen(null).cancel();
-      return new _DoneStreamSubscription<T>(onDone);
-    }
-    return new _StateStreamSubscription<int, T>(
-        this, onData, onError, onDone, cancelOnError, _count);
-  }
-
-  void _handleData(T inputEvent, _EventSink<T> sink) {
-    var subscription = sink as _StateStreamSubscription<int, T>;
-    int count = subscription._subState;
-    if (count > 0) {
-      sink._add(inputEvent);
-      count -= 1;
-      subscription._subState = count;
-      if (count == 0) {
-        // Closing also unsubscribes all subscribers, which unsubscribes
-        // this from source.
-        sink._close();
-      }
-    }
-  }
-}
-
-/**
- * A [_ForwardingStreamSubscription] with one extra state field.
- *
- * Use by several different classes, storing an integer, bool or general.
- */
-class _StateStreamSubscription<S, T>
-    extends _ForwardingStreamSubscription<T, T> {
-  S _subState;
-
-  _StateStreamSubscription(_ForwardingStream<T, T> stream, void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError, this._subState)
-      : super(stream, onData, onError, onDone, cancelOnError);
-}
-
-class _TakeWhileStream<T> extends _ForwardingStream<T, T> {
-  final bool Function(T) _test;
-
-  _TakeWhileStream(Stream<T> source, bool test(T value))
-      : this._test = test,
-        super(source);
-
-  void _handleData(T inputEvent, _EventSink<T> sink) {
-    bool satisfies;
-    try {
-      satisfies = _test(inputEvent);
-    } catch (e, s) {
-      _addErrorWithReplacement(sink, e, s);
-      // The test didn't say true. Didn't say false either, but we stop anyway.
-      sink._close();
-      return;
-    }
-    if (satisfies) {
-      sink._add(inputEvent);
-    } else {
-      sink._close();
-    }
-  }
-}
-
-class _SkipStream<T> extends _ForwardingStream<T, T> {
-  final int _count;
-
-  _SkipStream(Stream<T> source, int count)
-      : this._count = count,
-        super(source) {
-    // This test is done early to avoid handling an async error
-    // in the _handleData method.
-    RangeError.checkNotNegative(count, "count");
-  }
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    return new _StateStreamSubscription<int, T>(
-        this, onData, onError, onDone, cancelOnError, _count);
-  }
-
-  void _handleData(T inputEvent, _EventSink<T> sink) {
-    var subscription = sink as _StateStreamSubscription<int, T>;
-    int count = subscription._subState;
-    if (count > 0) {
-      subscription._subState = count - 1;
-      return;
-    }
-    sink._add(inputEvent);
-  }
-}
-
-class _SkipWhileStream<T> extends _ForwardingStream<T, T> {
-  final bool Function(T) _test;
-
-  _SkipWhileStream(Stream<T> source, bool test(T value))
-      : this._test = test,
-        super(source);
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    return new _StateStreamSubscription<bool, T>(
-        this, onData, onError, onDone, cancelOnError, false);
-  }
-
-  void _handleData(T inputEvent, _EventSink<T> sink) {
-    var subscription = sink as _StateStreamSubscription<bool, T>;
-    bool hasFailed = subscription._subState;
-    if (hasFailed) {
-      sink._add(inputEvent);
-      return;
-    }
-    bool satisfies;
-    try {
-      satisfies = _test(inputEvent);
-    } catch (e, s) {
-      _addErrorWithReplacement(sink, e, s);
-      // A failure to return a boolean is considered "not matching".
-      subscription._subState = true;
-      return;
-    }
-    if (!satisfies) {
-      subscription._subState = true;
-      sink._add(inputEvent);
-    }
-  }
-}
-
-class _DistinctStream<T> extends _ForwardingStream<T, T> {
-  static final _SENTINEL = new Object();
-
-  final bool Function(T, T)? _equals;
-
-  _DistinctStream(Stream<T> source, bool equals(T a, T b)?)
-      : _equals = equals,
-        super(source);
-
-  StreamSubscription<T> _createSubscription(void onData(T data)?,
-      Function? onError, void onDone()?, bool cancelOnError) {
-    return new _StateStreamSubscription<Object?, T>(
-        this, onData, onError, onDone, cancelOnError, _SENTINEL);
-  }
-
-  void _handleData(T inputEvent, _EventSink<T> sink) {
-    var subscription = sink as _StateStreamSubscription<Object?, T>;
-    var previous = subscription._subState;
-    if (identical(previous, _SENTINEL)) {
-      // First event. Cannot use [_equals].
-      subscription._subState = inputEvent;
-      sink._add(inputEvent);
-    } else {
-      T previousEvent = previous as T;
-      var equals = _equals;
-      bool isEqual;
-      try {
-        if (equals == null) {
-          isEqual = (previousEvent == inputEvent);
-        } else {
-          isEqual = equals(previousEvent, inputEvent);
-        }
-      } catch (e, s) {
-        _addErrorWithReplacement(sink, e, s);
-        return;
-      }
-      if (!isEqual) {
-        sink._add(inputEvent);
-        subscription._subState = inputEvent;
-      }
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/async/stream_transformers.dart b/sdk_nnbd/lib/async/stream_transformers.dart
deleted file mode 100644
index ca7934c..0000000
--- a/sdk_nnbd/lib/async/stream_transformers.dart
+++ /dev/null
@@ -1,338 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.async;
-
-/**
- * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
- */
-class _EventSinkWrapper<T> implements EventSink<T> {
-  _EventSink<T> _sink;
-  _EventSinkWrapper(this._sink);
-
-  void add(T data) {
-    _sink._add(data);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    _sink._addError(error, stackTrace ?? AsyncError.defaultStackTrace(error));
-  }
-
-  void close() {
-    _sink._close();
-  }
-}
-
-/**
- * A StreamSubscription that pipes data through a sink.
- *
- * The constructor of this class takes a [_SinkMapper] which maps from
- * [EventSink] to [EventSink]. The input to the mapper is the output of
- * the transformation. The returned sink is the transformation's input.
- */
-class _SinkTransformerStreamSubscription<S, T>
-    extends _BufferingStreamSubscription<T> {
-  /// The transformer's input sink.
-  late EventSink<S> _transformerSink;
-
-  /// The subscription to the input stream.
-  StreamSubscription<S>? _subscription;
-
-  _SinkTransformerStreamSubscription(
-      Stream<S> source,
-      _SinkMapper<S, T> mapper,
-      void onData(T data)?,
-      Function? onError,
-      void onDone()?,
-      bool cancelOnError)
-      // We set the adapter's target only when the user is allowed to send data.
-      : super(onData, onError, onDone, cancelOnError) {
-    _transformerSink = mapper(_EventSinkWrapper<T>(this));
-    _subscription =
-        source.listen(_handleData, onError: _handleError, onDone: _handleDone);
-  }
-
-  // _EventSink interface.
-
-  /**
-   * Adds an event to this subscriptions.
-   *
-   * Contrary to normal [_BufferingStreamSubscription]s we may receive
-   * events when the stream is already closed. Report them as state
-   * error.
-   */
-  void _add(T data) {
-    if (_isClosed) {
-      throw StateError("Stream is already closed");
-    }
-    super._add(data);
-  }
-
-  /**
-   * Adds an error event to this subscriptions.
-   *
-   * Contrary to normal [_BufferingStreamSubscription]s we may receive
-   * events when the stream is already closed. Report them as state
-   * error.
-   */
-  void _addError(Object error, StackTrace stackTrace) {
-    if (_isClosed) {
-      throw new StateError("Stream is already closed");
-    }
-    super._addError(error, stackTrace);
-  }
-
-  /**
-   * Adds a close event to this subscriptions.
-   *
-   * Contrary to normal [_BufferingStreamSubscription]s we may receive
-   * events when the stream is already closed. Report them as state
-   * error.
-   */
-  void _close() {
-    if (_isClosed) {
-      throw new StateError("Stream is already closed");
-    }
-    super._close();
-  }
-
-  // _BufferingStreamSubscription hooks.
-
-  void _onPause() {
-    _subscription?.pause();
-  }
-
-  void _onResume() {
-    _subscription?.resume();
-  }
-
-  Future<void>? _onCancel() {
-    var subscription = _subscription;
-    if (subscription != null) {
-      _subscription = null;
-      return subscription.cancel();
-    }
-    return null;
-  }
-
-  void _handleData(S data) {
-    try {
-      _transformerSink.add(data);
-    } catch (e, s) {
-      _addError(e, s);
-    }
-  }
-
-  void _handleError(Object error, StackTrace stackTrace) {
-    try {
-      _transformerSink.addError(error, stackTrace);
-    } catch (e, s) {
-      if (identical(e, error)) {
-        _addError(error, stackTrace);
-      } else {
-        _addError(e, s);
-      }
-    }
-  }
-
-  void _handleDone() {
-    try {
-      _subscription = null;
-      _transformerSink.close();
-    } catch (e, s) {
-      _addError(e, s);
-    }
-  }
-}
-
-typedef EventSink<S> _SinkMapper<S, T>(EventSink<T> output);
-
-/**
- * A StreamTransformer for Sink-mappers.
- *
- * A Sink-mapper takes an [EventSink] (its output) and returns another
- * EventSink (its input).
- *
- * Note that this class can be `const`.
- */
-class _StreamSinkTransformer<S, T> extends StreamTransformerBase<S, T> {
-  final _SinkMapper<S, T> _sinkMapper;
-  const _StreamSinkTransformer(this._sinkMapper);
-
-  Stream<T> bind(Stream<S> stream) =>
-      new _BoundSinkStream<S, T>(stream, _sinkMapper);
-}
-
-/**
- * The result of binding a StreamTransformer for Sink-mappers.
- *
- * It contains the bound Stream and the sink-mapper. Only when the user starts
- * listening to this stream is the sink-mapper invoked. The result is used
- * to create a StreamSubscription that transforms events.
- */
-class _BoundSinkStream<S, T> extends Stream<T> {
-  final _SinkMapper<S, T> _sinkMapper;
-  final Stream<S> _stream;
-
-  bool get isBroadcast => _stream.isBroadcast;
-
-  _BoundSinkStream(this._stream, this._sinkMapper);
-
-  StreamSubscription<T> listen(void onData(T event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    StreamSubscription<T> subscription =
-        _SinkTransformerStreamSubscription<S, T>(_stream, _sinkMapper, onData,
-            onError, onDone, cancelOnError ?? false);
-    return subscription;
-  }
-}
-
-/// Data-handler coming from [StreamTransformer.fromHandlers].
-typedef void _TransformDataHandler<S, T>(S data, EventSink<T> sink);
-
-/// Error-handler coming from [StreamTransformer.fromHandlers].
-typedef void _TransformErrorHandler<T>(
-    Object error, StackTrace stackTrace, EventSink<T> sink);
-
-/// Done-handler coming from [StreamTransformer.fromHandlers].
-typedef void _TransformDoneHandler<T>(EventSink<T> sink);
-
-/**
- * Wraps handlers (from [StreamTransformer.fromHandlers]) into an `EventSink`.
- *
- * This way we can reuse the code from [_StreamSinkTransformer].
- */
-class _HandlerEventSink<S, T> implements EventSink<S> {
-  final _TransformDataHandler<S, T>? _handleData;
-  final _TransformErrorHandler<T>? _handleError;
-  final _TransformDoneHandler<T>? _handleDone;
-
-  /// The output sink where the handlers should send their data into.
-  /// Set to `null` when closed.
-  EventSink<T>? _sink;
-
-  _HandlerEventSink(this._handleData, this._handleError, this._handleDone,
-      EventSink<T> this._sink);
-
-  void add(S data) {
-    var sink = _sink;
-    if (sink == null) {
-      throw StateError("Sink is closed");
-    }
-    var handleData = _handleData;
-    if (handleData != null) {
-      handleData(data, sink);
-    } else {
-      sink.add(data as T);
-    }
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    var sink = _sink;
-    if (sink == null) {
-      throw StateError("Sink is closed");
-    }
-    var handleError = _handleError;
-    stackTrace ??= AsyncError.defaultStackTrace(error);
-    if (handleError != null) {
-      handleError(error, stackTrace, sink);
-    } else {
-      sink.addError(error, stackTrace);
-    }
-  }
-
-  void close() {
-    var sink = _sink;
-    if (sink == null) return;
-    _sink = null;
-    var handleDone = _handleDone;
-    if (handleDone != null) {
-      handleDone(sink);
-    } else {
-      sink.close();
-    }
-  }
-}
-
-/**
- * A StreamTransformer that transformers events with the given handlers.
- *
- * Note that this transformer can only be used once.
- */
-class _StreamHandlerTransformer<S, T> extends _StreamSinkTransformer<S, T> {
-  _StreamHandlerTransformer(
-      {void handleData(S data, EventSink<T> sink)?,
-      void handleError(Object error, StackTrace stackTrace, EventSink<T> sink)?,
-      void handleDone(EventSink<T> sink)?})
-      : super((EventSink<T> outputSink) {
-          return new _HandlerEventSink<S, T>(
-              handleData, handleError, handleDone, outputSink);
-        });
-
-  Stream<T> bind(Stream<S> stream) {
-    return super.bind(stream);
-  }
-}
-
-/**
- * A StreamTransformer that overrides [StreamTransformer.bind] with a callback.
- */
-class _StreamBindTransformer<S, T> extends StreamTransformerBase<S, T> {
-  final Stream<T> Function(Stream<S>) _bind;
-  _StreamBindTransformer(this._bind);
-
-  Stream<T> bind(Stream<S> stream) => _bind(stream);
-}
-
-/// A closure mapping a stream and cancelOnError to a StreamSubscription.
-typedef StreamSubscription<T> _SubscriptionTransformer<S, T>(
-    Stream<S> stream, bool cancelOnError);
-
-/**
- * A [StreamTransformer] that minimizes the number of additional classes.
- *
- * Instead of implementing three classes: a [StreamTransformer], a [Stream]
- * (as the result of a `bind` call) and a [StreamSubscription] (which does the
- * actual work), this class only requires a function that is invoked when the
- * last bit (the subscription) of the transformer-workflow is needed.
- *
- * The given transformer function maps from Stream and cancelOnError to a
- * `StreamSubscription`. As such it can also act on `cancel` events, making it
- * fully general.
- */
-class _StreamSubscriptionTransformer<S, T> extends StreamTransformerBase<S, T> {
-  final _SubscriptionTransformer<S, T> _onListen;
-
-  const _StreamSubscriptionTransformer(this._onListen);
-
-  Stream<T> bind(Stream<S> stream) =>
-      new _BoundSubscriptionStream<S, T>(stream, _onListen);
-}
-
-/**
- * A stream transformed by a [_StreamSubscriptionTransformer].
- *
- * When this stream is listened to it invokes the [_onListen] function with
- * the stored [_stream]. Usually the transformer starts listening at this
- * moment.
- */
-class _BoundSubscriptionStream<S, T> extends Stream<T> {
-  final _SubscriptionTransformer<S, T> _onListen;
-  final Stream<S> _stream;
-
-  bool get isBroadcast => _stream.isBroadcast;
-
-  _BoundSubscriptionStream(this._stream, this._onListen);
-
-  StreamSubscription<T> listen(void onData(T event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    StreamSubscription<T> result = _onListen(_stream, cancelOnError ?? false);
-    result.onData(onData);
-    result.onError(onError);
-    result.onDone(onDone);
-    return result;
-  }
-}
diff --git a/sdk_nnbd/lib/async/timer.dart b/sdk_nnbd/lib/async/timer.dart
deleted file mode 100644
index e0ef447..0000000
--- a/sdk_nnbd/lib/async/timer.dart
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.async;
-
-/**
- * A count-down timer that can be configured to fire once or repeatedly.
- *
- * The timer counts down from the specified duration to 0.
- * When the timer reaches 0, the timer invokes the specified callback function.
- * Use a periodic timer to repeatedly count down the same interval.
- *
- * A negative duration is treated the same as a duration of 0.
- * If the duration is statically known to be 0, consider using [run].
- *
- * Frequently the duration is either a constant or computed as in the
- * following example (taking advantage of the multiplication operator of
- * the [Duration] class):
- * ```dart
- * const timeout = const Duration(seconds: 3);
- * const ms = const Duration(milliseconds: 1);
- *
- * startTimeout([int milliseconds]) {
- *   var duration = milliseconds == null ? timeout : ms * milliseconds;
- *   return new Timer(duration, handleTimeout);
- * }
- * ...
- * void handleTimeout() {  // callback function
- *   ...
- * }
- * ```
- * Note: If Dart code using Timer is compiled to JavaScript, the finest
- * granularity available in the browser is 4 milliseconds.
- *
- * See [Stopwatch] for measuring elapsed time.
- */
-abstract class Timer {
-  /**
-   * Creates a new timer.
-   *
-   * The [callback] function is invoked after the given [duration].
-   *
-   */
-  factory Timer(Duration duration, void Function() callback) {
-    if (Zone.current == Zone.root) {
-      // No need to bind the callback. We know that the root's timer will
-      // be invoked in the root zone.
-      return Zone.current.createTimer(duration, callback);
-    }
-    return Zone.current
-        .createTimer(duration, Zone.current.bindCallbackGuarded(callback));
-  }
-
-  /**
-   * Creates a new repeating timer.
-   *
-   * The [callback] is invoked repeatedly with [duration] intervals until
-   * canceled with the [cancel] function.
-   *
-   * The exact timing depends on the underlying timer implementation.
-   * No more than `n` callbacks will be made in `duration * n` time,
-   * but the time between two consecutive callbacks
-   * can be shorter and longer than `duration`.
-   *
-   * In particular, an implementation may schedule the next callback, e.g.,
-   * a `duration` after either when the previous callback ended,
-   * when the previous callback started, or when the previous callback was
-   * scheduled for - even if the actual callback was delayed.
-   *
-   * [duration] must a non-negative [Duration].
-   */
-  factory Timer.periodic(Duration duration, void callback(Timer timer)) {
-    if (Zone.current == Zone.root) {
-      // No need to bind the callback. We know that the root's timer will
-      // be invoked in the root zone.
-      return Zone.current.createPeriodicTimer(duration, callback);
-    }
-    var boundCallback = Zone.current.bindUnaryCallbackGuarded<Timer>(callback);
-    return Zone.current.createPeriodicTimer(duration, boundCallback);
-  }
-
-  /**
-   * Runs the given [callback] asynchronously as soon as possible.
-   *
-   * This function is equivalent to `new Timer(Duration.zero, callback)`.
-   */
-  static void run(void Function() callback) {
-    new Timer(Duration.zero, callback);
-  }
-
-  /**
-   * Cancels the timer.
-   *
-   * Once a [Timer] has been canceled, the callback function will not be called
-   * by the timer. Calling [cancel] more than once on a [Timer] is allowed, and
-   * will have no further effect.
-   */
-  void cancel();
-
-  /**
-   * The number of durations preceding the most recent timer event.
-   *
-   * The value starts at zero and is incremented each time a timer event
-   * occurs, so each callback will see a larger value than the previous one.
-   *
-   * If a periodic timer with a non-zero duration is delayed too much,
-   * so more than one tick should have happened,
-   * all but the last tick in the past are considered "missed",
-   * and no callback is invoked for them.
-   * The [tick] count reflects the number of durations that have passed and
-   * not the number of callback invocations that have happened.
-   */
-  int get tick;
-
-  /**
-   * Returns whether the timer is still active.
-   *
-   * A non-periodic timer is active if the callback has not been executed,
-   * and the timer has not been canceled.
-   *
-   * A periodic timer is active if it has not been canceled.
-   */
-  bool get isActive;
-
-  external static Timer _createTimer(
-      Duration duration, void Function() callback);
-  external static Timer _createPeriodicTimer(
-      Duration duration, void callback(Timer timer));
-}
diff --git a/sdk_nnbd/lib/async/zone.dart b/sdk_nnbd/lib/async/zone.dart
deleted file mode 100644
index b4e3994..0000000
--- a/sdk_nnbd/lib/async/zone.dart
+++ /dev/null
@@ -1,1630 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.async;
-
-typedef R ZoneCallback<R>();
-typedef R ZoneUnaryCallback<R, T>(T arg);
-typedef R ZoneBinaryCallback<R, T1, T2>(T1 arg1, T2 arg2);
-
-typedef HandleUncaughtErrorHandler = void Function(Zone self,
-    ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace);
-typedef RunHandler = R Function<R>(
-    Zone self, ZoneDelegate parent, Zone zone, R Function() f);
-typedef RunUnaryHandler = R Function<R, T>(
-    Zone self, ZoneDelegate parent, Zone zone, R Function(T arg) f, T arg);
-typedef RunBinaryHandler = R Function<R, T1, T2>(Zone self, ZoneDelegate parent,
-    Zone zone, R Function(T1 arg1, T2 arg2) f, T1 arg1, T2 arg2);
-typedef RegisterCallbackHandler = ZoneCallback<R> Function<R>(
-    Zone self, ZoneDelegate parent, Zone zone, R Function() f);
-typedef RegisterUnaryCallbackHandler = ZoneUnaryCallback<R, T> Function<R, T>(
-    Zone self, ZoneDelegate parent, Zone zone, R Function(T arg) f);
-typedef RegisterBinaryCallbackHandler
-    = ZoneBinaryCallback<R, T1, T2> Function<R, T1, T2>(Zone self,
-        ZoneDelegate parent, Zone zone, R Function(T1 arg1, T2 arg2) f);
-typedef AsyncError? ErrorCallbackHandler(Zone self, ZoneDelegate parent,
-    Zone zone, Object error, StackTrace? stackTrace);
-typedef void ScheduleMicrotaskHandler(
-    Zone self, ZoneDelegate parent, Zone zone, void f());
-typedef Timer CreateTimerHandler(
-    Zone self, ZoneDelegate parent, Zone zone, Duration duration, void f());
-typedef Timer CreatePeriodicTimerHandler(Zone self, ZoneDelegate parent,
-    Zone zone, Duration period, void f(Timer timer));
-typedef void PrintHandler(
-    Zone self, ZoneDelegate parent, Zone zone, String line);
-typedef Zone ForkHandler(Zone self, ZoneDelegate parent, Zone zone,
-    ZoneSpecification? specification, Map<Object?, Object?>? zoneValues);
-
-/** Pair of error and stack trace. Returned by [Zone.errorCallback]. */
-class AsyncError implements Error {
-  final Object error;
-  final StackTrace stackTrace;
-
-  AsyncError(this.error, StackTrace? stackTrace)
-      : stackTrace = stackTrace ?? defaultStackTrace(error) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-  }
-
-  /// A default stack trace for an error.
-  ///
-  /// If [error] is an [Error] and it has an [Error.stackTrace],
-  /// that stack trace is returned.
-  /// If not, the [StackTrace.empty] default stack trace is returned.
-  static StackTrace defaultStackTrace(Object error) {
-    if (error is Error) {
-      var stackTrace = error.stackTrace;
-      if (stackTrace != null) return stackTrace;
-    }
-    return StackTrace.empty;
-  }
-
-  String toString() => '$error';
-}
-
-class _ZoneFunction<T extends Function> {
-  final _Zone zone;
-  final T function;
-  const _ZoneFunction(this.zone, this.function);
-}
-
-class _RunNullaryZoneFunction {
-  final _Zone zone;
-  final RunHandler function;
-  const _RunNullaryZoneFunction(this.zone, this.function);
-}
-
-class _RunUnaryZoneFunction {
-  final _Zone zone;
-  final RunUnaryHandler function;
-  const _RunUnaryZoneFunction(this.zone, this.function);
-}
-
-class _RunBinaryZoneFunction {
-  final _Zone zone;
-  final RunBinaryHandler function;
-  const _RunBinaryZoneFunction(this.zone, this.function);
-}
-
-class _RegisterNullaryZoneFunction {
-  final _Zone zone;
-  final RegisterCallbackHandler function;
-  const _RegisterNullaryZoneFunction(this.zone, this.function);
-}
-
-class _RegisterUnaryZoneFunction {
-  final _Zone zone;
-  final RegisterUnaryCallbackHandler function;
-  const _RegisterUnaryZoneFunction(this.zone, this.function);
-}
-
-class _RegisterBinaryZoneFunction {
-  final _Zone zone;
-  final RegisterBinaryCallbackHandler function;
-  const _RegisterBinaryZoneFunction(this.zone, this.function);
-}
-
-/**
- * This class provides the specification for a forked zone.
- *
- * When forking a new zone (see [Zone.fork]) one can override the default
- * behavior of the zone by providing callbacks. These callbacks must be
- * given in an instance of this class.
- *
- * Handlers have the same signature as the same-named methods on [Zone] but
- * receive three additional arguments:
- *
- *   1. the zone the handlers are attached to (the "self" zone).
- *   2. a [ZoneDelegate] to the parent zone.
- *   3. the zone that first received the request (before the request was
- *     bubbled up).
- *
- * Handlers can either stop propagation the request (by simply not calling the
- * parent handler), or forward to the parent zone, potentially modifying the
- * arguments on the way.
- */
-abstract class ZoneSpecification {
-  /**
-   * Creates a specification with the provided handlers.
-   */
-  const factory ZoneSpecification(
-      {HandleUncaughtErrorHandler? handleUncaughtError,
-      RunHandler? run,
-      RunUnaryHandler? runUnary,
-      RunBinaryHandler? runBinary,
-      RegisterCallbackHandler? registerCallback,
-      RegisterUnaryCallbackHandler? registerUnaryCallback,
-      RegisterBinaryCallbackHandler? registerBinaryCallback,
-      ErrorCallbackHandler? errorCallback,
-      ScheduleMicrotaskHandler? scheduleMicrotask,
-      CreateTimerHandler? createTimer,
-      CreatePeriodicTimerHandler? createPeriodicTimer,
-      PrintHandler? print,
-      ForkHandler? fork}) = _ZoneSpecification;
-
-  /**
-   * Creates a specification from [other] with the provided handlers overriding
-   * the ones in [other].
-   */
-  factory ZoneSpecification.from(ZoneSpecification other,
-      {HandleUncaughtErrorHandler? handleUncaughtError,
-      RunHandler? run,
-      RunUnaryHandler? runUnary,
-      RunBinaryHandler? runBinary,
-      RegisterCallbackHandler? registerCallback,
-      RegisterUnaryCallbackHandler? registerUnaryCallback,
-      RegisterBinaryCallbackHandler? registerBinaryCallback,
-      ErrorCallbackHandler? errorCallback,
-      ScheduleMicrotaskHandler? scheduleMicrotask,
-      CreateTimerHandler? createTimer,
-      CreatePeriodicTimerHandler? createPeriodicTimer,
-      PrintHandler? print,
-      ForkHandler? fork}) {
-    return new ZoneSpecification(
-        handleUncaughtError: handleUncaughtError ?? other.handleUncaughtError,
-        run: run ?? other.run,
-        runUnary: runUnary ?? other.runUnary,
-        runBinary: runBinary ?? other.runBinary,
-        registerCallback: registerCallback ?? other.registerCallback,
-        registerUnaryCallback:
-            registerUnaryCallback ?? other.registerUnaryCallback,
-        registerBinaryCallback:
-            registerBinaryCallback ?? other.registerBinaryCallback,
-        errorCallback: errorCallback ?? other.errorCallback,
-        scheduleMicrotask: scheduleMicrotask ?? other.scheduleMicrotask,
-        createTimer: createTimer ?? other.createTimer,
-        createPeriodicTimer: createPeriodicTimer ?? other.createPeriodicTimer,
-        print: print ?? other.print,
-        fork: fork ?? other.fork);
-  }
-
-  HandleUncaughtErrorHandler? get handleUncaughtError;
-  RunHandler? get run;
-  RunUnaryHandler? get runUnary;
-  RunBinaryHandler? get runBinary;
-  RegisterCallbackHandler? get registerCallback;
-  RegisterUnaryCallbackHandler? get registerUnaryCallback;
-  RegisterBinaryCallbackHandler? get registerBinaryCallback;
-  ErrorCallbackHandler? get errorCallback;
-  ScheduleMicrotaskHandler? get scheduleMicrotask;
-  CreateTimerHandler? get createTimer;
-  CreatePeriodicTimerHandler? get createPeriodicTimer;
-  PrintHandler? get print;
-  ForkHandler? get fork;
-}
-
-/**
- * Internal [ZoneSpecification] class.
- *
- * The implementation wants to rely on the fact that the getters cannot change
- * dynamically. We thus require users to go through the redirecting
- * [ZoneSpecification] constructor which instantiates this class.
- */
-class _ZoneSpecification implements ZoneSpecification {
-  const _ZoneSpecification(
-      {this.handleUncaughtError,
-      this.run,
-      this.runUnary,
-      this.runBinary,
-      this.registerCallback,
-      this.registerUnaryCallback,
-      this.registerBinaryCallback,
-      this.errorCallback,
-      this.scheduleMicrotask,
-      this.createTimer,
-      this.createPeriodicTimer,
-      this.print,
-      this.fork});
-
-  final HandleUncaughtErrorHandler? handleUncaughtError;
-  final RunHandler? run;
-  final RunUnaryHandler? runUnary;
-  final RunBinaryHandler? runBinary;
-  final RegisterCallbackHandler? registerCallback;
-  final RegisterUnaryCallbackHandler? registerUnaryCallback;
-  final RegisterBinaryCallbackHandler? registerBinaryCallback;
-  final ErrorCallbackHandler? errorCallback;
-  final ScheduleMicrotaskHandler? scheduleMicrotask;
-  final CreateTimerHandler? createTimer;
-  final CreatePeriodicTimerHandler? createPeriodicTimer;
-  final PrintHandler? print;
-  final ForkHandler? fork;
-}
-
-/**
- * An adapted view of the parent zone.
- *
- * This class allows the implementation of a zone method to invoke methods on
- * the parent zone while retaining knowledge of the originating zone.
- *
- * Custom zones (created through [Zone.fork] or [runZoned]) can provide
- * implementations of most methods of zones. This is similar to overriding
- * methods on [Zone], except that this mechanism doesn't require subclassing.
- *
- * A custom zone function (provided through a [ZoneSpecification]) typically
- * records or wraps its parameters and then delegates the operation to its
- * parent zone using the provided [ZoneDelegate].
- *
- * While zones have access to their parent zone (through [Zone.parent]) it is
- * recommended to call the methods on the provided parent delegate for two
- * reasons:
- * 1. the delegate methods take an additional `zone` argument which is the
- *   zone the action has been initiated in.
- * 2. delegate calls are more efficient, since the implementation knows how
- *   to skip zones that would just delegate to their parents.
- */
-abstract class ZoneDelegate {
-  void handleUncaughtError(Zone zone, Object error, StackTrace stackTrace);
-  R run<R>(Zone zone, R f());
-  R runUnary<R, T>(Zone zone, R f(T arg), T arg);
-  R runBinary<R, T1, T2>(Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2);
-  ZoneCallback<R> registerCallback<R>(Zone zone, R f());
-  ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(Zone zone, R f(T arg));
-  ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
-      Zone zone, R f(T1 arg1, T2 arg2));
-  AsyncError? errorCallback(Zone zone, Object error, StackTrace? stackTrace);
-  void scheduleMicrotask(Zone zone, void f());
-  Timer createTimer(Zone zone, Duration duration, void f());
-  Timer createPeriodicTimer(Zone zone, Duration period, void f(Timer timer));
-  void print(Zone zone, String line);
-  Zone fork(Zone zone, ZoneSpecification? specification, Map? zoneValues);
-}
-
-/**
- * A zone represents an environment that remains stable across asynchronous
- * calls.
- *
- * Code is always executed in the context of a zone, available as
- * [Zone.current]. The initial `main` function runs in the context of the
- * default zone ([Zone.root]). Code can be run in a different zone using either
- * [runZoned], to create a new zone, or [Zone.run] to run code in the context of
- * an existing zone likely created using [Zone.fork].
- *
- * Developers can create a new zone that overrides some of the functionality of
- * an existing zone. For example, custom zones can replace of modify the
- * behavior of `print`, timers, microtasks or how uncaught errors are handled.
- *
- * The [Zone] class is not subclassable, but users can provide custom zones by
- * forking an existing zone (usually [Zone.current]) with a [ZoneSpecification].
- * This is similar to creating a new class that extends the base `Zone` class
- * and that overrides some methods, except without actually creating a new
- * class. Instead the overriding methods are provided as functions that
- * explicitly take the equivalent of their own class, the "super" class and the
- * `this` object as parameters.
- *
- * Asynchronous callbacks always run in the context of the zone where they were
- * scheduled. This is implemented using two steps:
- * 1. the callback is first registered using one of [registerCallback],
- *   [registerUnaryCallback], or [registerBinaryCallback]. This allows the zone
- *   to record that a callback exists and potentially modify it (by returning a
- *   different callback). The code doing the registration (e.g., `Future.then`)
- *   also remembers the current zone so that it can later run the callback in
- *   that zone.
- * 2. At a later point the registered callback is run in the remembered zone.
- *
- * This is all handled internally by the platform code and most users don't need
- * to worry about it. However, developers of new asynchronous operations,
- * provided by the underlying system or through native extensions, must follow
- * the protocol to be zone compatible.
- *
- * For convenience, zones provide [bindCallback] (and the corresponding
- * [bindUnaryCallback] and [bindBinaryCallback]) to make it easier to respect
- * the zone contract: these functions first invoke the corresponding `register`
- * functions and then wrap the returned function so that it runs in the current
- * zone when it is later asynchronously invoked.
- *
- * Similarly, zones provide [bindCallbackGuarded] (and the corresponding
- * [bindUnaryCallbackGuarded] and [bindBinaryCallbackGuarded]), when the
- * callback should be invoked through [Zone.runGuarded].
- */
-abstract class Zone {
-  // Private constructor so that it is not possible instantiate a Zone class.
-  Zone._();
-
-  /**
-   * The root zone.
-   *
-   * All isolate entry functions (`main` or spawned functions) start running in
-   * the root zone (that is, [Zone.current] is identical to [Zone.root] when the
-   * entry function is called). If no custom zone is created, the rest of the
-   * program always runs in the root zone.
-   *
-   * The root zone implements the default behavior of all zone operations.
-   * Many methods, like [registerCallback] do the bare minimum required of the
-   * function, and are only provided as a hook for custom zones. Others, like
-   * [scheduleMicrotask], interact with the underlying system to implement the
-   * desired behavior.
-   */
-  static const Zone root = _rootZone;
-
-  /** The currently running zone. */
-  static _Zone _current = _rootZone;
-
-  /** The zone that is currently active. */
-  static Zone get current => _current;
-
-  /**
-   * Handles uncaught asynchronous errors.
-   *
-   * There are two kind of asynchronous errors that are handled by this
-   * function:
-   * 1. Uncaught errors that were thrown in asynchronous callbacks, for example,
-   *   a `throw` in the function passed to [Timer.run].
-   * 2. Asynchronous errors that are pushed through [Future] and [Stream]
-   *   chains, but for which no child registered an error handler.
-   *   Most asynchronous classes, like [Future] or [Stream] push errors to their
-   *   listeners. Errors are propagated this way until either a listener handles
-   *   the error (for example with [Future.catchError]), or no listener is
-   *   available anymore. In the latter case, futures and streams invoke the
-   *   zone's [handleUncaughtError].
-   *
-   * By default, when handled by the root zone, uncaught asynchronous errors are
-   * treated like uncaught synchronous exceptions.
-   */
-  void handleUncaughtError(Object error, StackTrace stackTrace);
-
-  /**
-   * The parent zone of the this zone.
-   *
-   * Is `null` if `this` is the [root] zone.
-   *
-   * Zones are created by [fork] on an existing zone, or by [runZoned] which
-   * forks the [current] zone. The new zone's parent zone is the zone it was
-   * forked from.
-   */
-  Zone? get parent;
-
-  /**
-   * The error zone is the one that is responsible for dealing with uncaught
-   * errors.
-   *
-   * This is the closest parent zone of this zone that provides a
-   * [handleUncaughtError] method.
-   *
-   * Asynchronous errors never cross zone boundaries between zones with
-   * different error handlers.
-   *
-   * Example:
-   * ```
-   * import 'dart:async';
-   *
-   * main() {
-   *   var future;
-   *   runZoned(() {
-   *     // The asynchronous error is caught by the custom zone which prints
-   *     // 'asynchronous error'.
-   *     future = Future.error("asynchronous error");
-   *   }, onError: (e) { print(e); });  // Creates a zone with an error handler.
-   *   // The following `catchError` handler is never invoked, because the
-   *   // custom zone created by the call to `runZoned` provides an
-   *   // error handler.
-   *   future.catchError((e) { throw "is never reached"; });
-   * }
-   * ```
-   *
-   * Note that errors cannot enter a child zone with a different error handler
-   * either:
-   * ```
-   * import 'dart:async';
-   *
-   * main() {
-   *   runZoned(() {
-   *     // The following asynchronous error is *not* caught by the `catchError`
-   *     // in the nested zone, since errors are not to cross zone boundaries
-   *     // with different error handlers.
-   *     // Instead the error is handled by the current error handler,
-   *     // printing "Caught by outer zone: asynchronous error".
-   *     var future = Future.error("asynchronous error");
-   *     runZoned(() {
-   *       future.catchError((e) { throw "is never reached"; });
-   *     }, onError: (e) { throw "is never reached"; });
-   *   }, onError: (e) { print("Caught by outer zone: $e"); });
-   * }
-   * ```
-   */
-  Zone get errorZone;
-
-  /**
-   * Returns true if `this` and [otherZone] are in the same error zone.
-   *
-   * Two zones are in the same error zone if they have the same [errorZone].
-   */
-  bool inSameErrorZone(Zone otherZone);
-
-  /**
-   * Creates a new zone as a child of `this`.
-   *
-   * The new zone uses the closures in the given [specification] to override
-   * the current's zone behavior. All specification entries that are `null`
-   * inherit the behavior from the parent zone (`this`).
-   *
-   * The new zone inherits the stored values (accessed through [operator []])
-   * of this zone and updates them with values from [zoneValues], which either
-   * adds new values or overrides existing ones.
-   *
-   * Note that the fork operation is interceptible. A zone can thus change
-   * the zone specification (or zone values), giving the forking zone full
-   * control over the child zone.
-   */
-  Zone fork(
-      {ZoneSpecification? specification, Map<Object?, Object?>? zoneValues});
-
-  /**
-   * Executes [action] in this zone.
-   *
-   * By default (as implemented in the [root] zone), runs [action]
-   * with [current] set to this zone.
-   *
-   * If [action] throws, the synchronous exception is not caught by the zone's
-   * error handler. Use [runGuarded] to achieve that.
-   *
-   * Since the root zone is the only zone that can modify the value of
-   * [current], custom zones intercepting run should always delegate to their
-   * parent zone. They may take actions before and after the call.
-   */
-  R run<R>(R action());
-
-  /**
-   * Executes the given [action] with [argument] in this zone.
-   *
-   * As [run] except that [action] is called with one [argument] instead of
-   * none.
-   */
-  R runUnary<R, T>(R action(T argument), T argument);
-
-  /**
-   * Executes the given [action] with [argument1] and [argument2] in this
-   * zone.
-   *
-   * As [run] except that [action] is called with two arguments instead of none.
-   */
-  R runBinary<R, T1, T2>(
-      R action(T1 argument1, T2 argument2), T1 argument1, T2 argument2);
-
-  /**
-   * Executes the given [action] in this zone and catches synchronous
-   * errors.
-   *
-   * This function is equivalent to:
-   * ```
-   * try {
-   *   this.run(action);
-   * } catch (e, s) {
-   *   this.handleUncaughtError(e, s);
-   * }
-   * ```
-   *
-   * See [run].
-   */
-  void runGuarded(void action());
-
-  /**
-   * Executes the given [action] with [argument] in this zone and
-   * catches synchronous errors.
-   *
-   * See [runGuarded].
-   */
-  void runUnaryGuarded<T>(void action(T argument), T argument);
-
-  /**
-   * Executes the given [action] with [argument1] and [argument2] in this
-   * zone and catches synchronous errors.
-   *
-   * See [runGuarded].
-   */
-  void runBinaryGuarded<T1, T2>(
-      void action(T1 argument1, T2 argument2), T1 argument1, T2 argument2);
-
-  /**
-   * Registers the given callback in this zone.
-   *
-   * When implementing an asynchronous primitive that uses callbacks, the
-   * callback must be registered using [registerCallback] at the point where the
-   * user provides the callback. This allows zones to record other information
-   * that they need at the same time, perhaps even wrapping the callback, so
-   * that the callback is prepared when it is later run in the same zones
-   * (using [run]). For example, a zone may decide
-   * to store the stack trace (at the time of the registration) with the
-   * callback.
-   *
-   * Returns the callback that should be used in place of the provided
-   * [callback]. Frequently zones simply return the original callback.
-   *
-   * Custom zones may intercept this operation. The default implementation in
-   * [Zone.root] returns the original callback unchanged.
-   */
-  ZoneCallback<R> registerCallback<R>(R callback());
-
-  /**
-   * Registers the given callback in this zone.
-   *
-   * Similar to [registerCallback] but with a unary callback.
-   */
-  ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(R callback(T arg));
-
-  /**
-   * Registers the given callback in this zone.
-   *
-   * Similar to [registerCallback] but with a unary callback.
-   */
-  ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
-      R callback(T1 arg1, T2 arg2));
-
-  /**
-   *  Registers the provided [callback] and returns a function that will
-   *  execute in this zone.
-   *
-   *  Equivalent to:
-   *
-   *      ZoneCallback registered = this.registerCallback(callback);
-   *      return () => this.run(registered);
-   *
-   */
-  ZoneCallback<R> bindCallback<R>(R callback());
-
-  /**
-   *  Registers the provided [callback] and returns a function that will
-   *  execute in this zone.
-   *
-   *  Equivalent to:
-   *
-   *      ZoneCallback registered = this.registerUnaryCallback(callback);
-   *      return (arg) => thin.runUnary(registered, arg);
-   */
-  ZoneUnaryCallback<R, T> bindUnaryCallback<R, T>(R callback(T argument));
-
-  /**
-   *  Registers the provided [callback] and returns a function that will
-   *  execute in this zone.
-   *
-   *  Equivalent to:
-   *
-   *      ZoneCallback registered = registerBinaryCallback(callback);
-   *      return (arg1, arg2) => thin.runBinary(registered, arg1, arg2);
-   */
-  ZoneBinaryCallback<R, T1, T2> bindBinaryCallback<R, T1, T2>(
-      R callback(T1 argument1, T2 argument2));
-
-  /**
-   * Registers the provided [callback] and returns a function that will
-   * execute in this zone.
-   *
-   * When the function executes, errors are caught and treated as uncaught
-   * errors.
-   *
-   * Equivalent to:
-   *
-   *     ZoneCallback registered = this.registerCallback(callback);
-   *     return () => this.runGuarded(registered);
-   *
-   */
-  void Function() bindCallbackGuarded(void Function() callback);
-
-  /**
-   * Registers the provided [callback] and returns a function that will
-   * execute in this zone.
-   *
-   * When the function executes, errors are caught and treated as uncaught
-   * errors.
-   *
-   * Equivalent to:
-   *
-   *     ZoneCallback registered = this.registerUnaryCallback(callback);
-   *     return (arg) => this.runUnaryGuarded(registered, arg);
-   */
-  void Function(T) bindUnaryCallbackGuarded<T>(void callback(T argument));
-
-  /**
-   *  Registers the provided [callback] and returns a function that will
-   *  execute in this zone.
-   *
-   *  Equivalent to:
-   *
-   *      ZoneCallback registered = registerBinaryCallback(callback);
-   *      return (arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2);
-   */
-  void Function(T1, T2) bindBinaryCallbackGuarded<T1, T2>(
-      void callback(T1 argument1, T2 argument2));
-
-  /**
-   * Intercepts errors when added programmatically to a `Future` or `Stream`.
-   *
-   * When calling [Completer.completeError], [StreamController.addError],
-   * or some [Future] constructors, the current zone is allowed to intercept
-   * and replace the error.
-   *
-   * Future constructors invoke this function when the error is received
-   * directly, for example with [Future.error], or when the error is caught
-   * synchronously, for example with [Future.sync].
-   *
-   * There is no guarantee that an error is only sent through [errorCallback]
-   * once. Libraries that use intermediate controllers or completers might
-   * end up invoking [errorCallback] multiple times.
-   *
-   * Returns `null` if no replacement is desired. Otherwise returns an instance
-   * of [AsyncError] holding the new pair of error and stack trace.
-   *
-   * Although not recommended, the returned instance may have its `error` member
-   * ([AsyncError.error]) be equal to `null` in which case the error should be
-   * replaced by a [NullThrownError].
-   *
-   * Custom zones may intercept this operation.
-   *
-   * Implementations of a new asynchronous primitive that converts synchronous
-   * errors to asynchronous errors rarely need to invoke [errorCallback], since
-   * errors are usually reported through future completers or stream
-   * controllers.
-   */
-  AsyncError? errorCallback(Object error, StackTrace? stackTrace);
-
-  /**
-   * Runs [callback] asynchronously in this zone.
-   *
-   * The global `scheduleMicrotask` delegates to the current zone's
-   * [scheduleMicrotask]. The root zone's implementation interacts with the
-   * underlying system to schedule the given callback as a microtask.
-   *
-   * Custom zones may intercept this operation (for example to wrap the given
-   * [callback]).
-   */
-  void scheduleMicrotask(void Function() callback);
-
-  /**
-   * Creates a Timer where the callback is executed in this zone.
-   */
-  Timer createTimer(Duration duration, void Function() callback);
-
-  /**
-   * Creates a periodic Timer where the callback is executed in this zone.
-   */
-  Timer createPeriodicTimer(Duration period, void callback(Timer timer));
-
-  /**
-   * Prints the given [line].
-   *
-   * The global `print` function delegates to the current zone's [print]
-   * function which makes it possible to intercept printing.
-   *
-   * Example:
-   * ```
-   * import 'dart:async';
-   *
-   * main() {
-   *   runZoned(() {
-   *     // Ends up printing: "Intercepted: in zone".
-   *     print("in zone");
-   *   }, zoneSpecification: new ZoneSpecification(
-   *       print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
-   *     parent.print(zone, "Intercepted: $line");
-   *   }));
-   * }
-   * ```
-   */
-  void print(String line);
-
-  /**
-   * Call to enter the Zone.
-   *
-   * The previous current zone is returned.
-   */
-  static _Zone _enter(_Zone zone) {
-    assert(!identical(zone, _current));
-    _Zone previous = _current;
-    _current = zone;
-    return previous;
-  }
-
-  /**
-   * Call to leave the Zone.
-   *
-   * The previous Zone must be provided as `previous`.
-   */
-  static void _leave(_Zone previous) {
-    assert(previous != null);
-    Zone._current = previous;
-  }
-
-  /**
-   * Retrieves the zone-value associated with [key].
-   *
-   * If this zone does not contain the value looks up the same key in the
-   * parent zone. If the [key] is not found returns `null`.
-   *
-   * Any object can be used as key, as long as it has compatible `operator ==`
-   * and `hashCode` implementations.
-   * By controlling access to the key, a zone can grant or deny access to the
-   * zone value.
-   */
-  dynamic operator [](Object? key);
-}
-
-class _ZoneDelegate implements ZoneDelegate {
-  final _Zone _delegationTarget;
-
-  _ZoneDelegate(this._delegationTarget);
-
-  void handleUncaughtError(Zone zone, Object error, StackTrace stackTrace) {
-    var implementation = _delegationTarget._handleUncaughtError;
-    _Zone implZone = implementation.zone;
-    HandleUncaughtErrorHandler handler = implementation.function;
-    return handler(implZone, implZone._parentDelegate, zone, error, stackTrace);
-  }
-
-  R run<R>(Zone zone, R f()) {
-    var implementation = _delegationTarget._run;
-    _Zone implZone = implementation.zone;
-    var handler = implementation.function as RunHandler;
-    return handler(implZone, implZone._parentDelegate, zone, f);
-  }
-
-  R runUnary<R, T>(Zone zone, R f(T arg), T arg) {
-    var implementation = _delegationTarget._runUnary;
-    _Zone implZone = implementation.zone;
-    var handler = implementation.function as RunUnaryHandler;
-    return handler(implZone, implZone._parentDelegate, zone, f, arg);
-  }
-
-  R runBinary<R, T1, T2>(Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-    var implementation = _delegationTarget._runBinary;
-    _Zone implZone = implementation.zone;
-    var handler = implementation.function as RunBinaryHandler;
-    return handler(implZone, implZone._parentDelegate, zone, f, arg1, arg2);
-  }
-
-  ZoneCallback<R> registerCallback<R>(Zone zone, R f()) {
-    var implementation = _delegationTarget._registerCallback;
-    _Zone implZone = implementation.zone;
-    var handler = implementation.function as RegisterCallbackHandler;
-    return handler(implZone, implZone._parentDelegate, zone, f);
-  }
-
-  ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(Zone zone, R f(T arg)) {
-    var implementation = _delegationTarget._registerUnaryCallback;
-    _Zone implZone = implementation.zone;
-    var handler = implementation.function as RegisterUnaryCallbackHandler;
-    return handler(implZone, implZone._parentDelegate, zone, f);
-  }
-
-  ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
-      Zone zone, R f(T1 arg1, T2 arg2)) {
-    var implementation = _delegationTarget._registerBinaryCallback;
-    _Zone implZone = implementation.zone;
-    var handler = implementation.function as RegisterBinaryCallbackHandler;
-    return handler(implZone, implZone._parentDelegate, zone, f);
-  }
-
-  AsyncError? errorCallback(Zone zone, Object error, StackTrace? stackTrace) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    var implementation = _delegationTarget._errorCallback;
-    _Zone implZone = implementation.zone;
-    if (identical(implZone, _rootZone)) return null;
-    ErrorCallbackHandler handler = implementation.function;
-    return handler(implZone, implZone._parentDelegate, zone, error, stackTrace);
-  }
-
-  void scheduleMicrotask(Zone zone, f()) {
-    var implementation = _delegationTarget._scheduleMicrotask;
-    _Zone implZone = implementation.zone;
-    ScheduleMicrotaskHandler handler = implementation.function;
-    handler(implZone, implZone._parentDelegate, zone, f);
-  }
-
-  Timer createTimer(Zone zone, Duration duration, void f()) {
-    var implementation = _delegationTarget._createTimer;
-    _Zone implZone = implementation.zone;
-    CreateTimerHandler handler = implementation.function;
-    return handler(implZone, implZone._parentDelegate, zone, duration, f);
-  }
-
-  Timer createPeriodicTimer(Zone zone, Duration period, void f(Timer timer)) {
-    var implementation = _delegationTarget._createPeriodicTimer;
-    _Zone implZone = implementation.zone;
-    CreatePeriodicTimerHandler handler = implementation.function;
-    return handler(implZone, implZone._parentDelegate, zone, period, f);
-  }
-
-  void print(Zone zone, String line) {
-    var implementation = _delegationTarget._print;
-    _Zone implZone = implementation.zone;
-    PrintHandler handler = implementation.function;
-    handler(implZone, implZone._parentDelegate, zone, line);
-  }
-
-  Zone fork(Zone zone, ZoneSpecification? specification,
-      Map<Object?, Object?>? zoneValues) {
-    var implementation = _delegationTarget._fork;
-    _Zone implZone = implementation.zone;
-    ForkHandler handler = implementation.function;
-    return handler(
-        implZone, implZone._parentDelegate, zone, specification, zoneValues);
-  }
-}
-
-/**
- * Base class for Zone implementations.
- */
-abstract class _Zone implements Zone {
-  const _Zone();
-
-  // TODO(floitsch): the types of the `_ZoneFunction`s should have a type for
-  // all fields.
-  _RunNullaryZoneFunction get _run;
-  _RunUnaryZoneFunction get _runUnary;
-  _RunBinaryZoneFunction get _runBinary;
-  _RegisterNullaryZoneFunction get _registerCallback;
-  _RegisterUnaryZoneFunction get _registerUnaryCallback;
-  _RegisterBinaryZoneFunction get _registerBinaryCallback;
-  _ZoneFunction<ErrorCallbackHandler> get _errorCallback;
-  _ZoneFunction<ScheduleMicrotaskHandler> get _scheduleMicrotask;
-  _ZoneFunction<CreateTimerHandler> get _createTimer;
-  _ZoneFunction<CreatePeriodicTimerHandler> get _createPeriodicTimer;
-  _ZoneFunction<PrintHandler> get _print;
-  _ZoneFunction<ForkHandler> get _fork;
-  _ZoneFunction<HandleUncaughtErrorHandler> get _handleUncaughtError;
-  // Parent zone. Only `null` for the root zone.
-  _Zone? get parent;
-  ZoneDelegate get _delegate;
-  ZoneDelegate get _parentDelegate;
-  Map<Object?, Object?> get _map;
-
-  bool inSameErrorZone(Zone otherZone) {
-    return identical(this, otherZone) ||
-        identical(errorZone, otherZone.errorZone);
-  }
-}
-
-class _CustomZone extends _Zone {
-  // The actual zone and implementation of each of these
-  // inheritable zone functions.
-  // TODO(floitsch): the types of the `_ZoneFunction`s should have a type for
-  // all fields, but we can't use generic function types as type arguments.
-  _RunNullaryZoneFunction _run;
-  _RunUnaryZoneFunction _runUnary;
-  _RunBinaryZoneFunction _runBinary;
-  _RegisterNullaryZoneFunction _registerCallback;
-  _RegisterUnaryZoneFunction _registerUnaryCallback;
-  _RegisterBinaryZoneFunction _registerBinaryCallback;
-  _ZoneFunction<ErrorCallbackHandler> _errorCallback;
-  _ZoneFunction<ScheduleMicrotaskHandler> _scheduleMicrotask;
-  _ZoneFunction<CreateTimerHandler> _createTimer;
-  _ZoneFunction<CreatePeriodicTimerHandler> _createPeriodicTimer;
-  _ZoneFunction<PrintHandler> _print;
-  _ZoneFunction<ForkHandler> _fork;
-  _ZoneFunction<HandleUncaughtErrorHandler> _handleUncaughtError;
-
-  // A cached delegate to this zone.
-  ZoneDelegate? _delegateCache;
-
-  /// The parent zone.
-  final _Zone parent;
-
-  /// The zone's scoped value declaration map.
-  ///
-  /// This is always a [HashMap].
-  final Map<Object?, Object?> _map;
-
-  ZoneDelegate get _delegate => _delegateCache ??= _ZoneDelegate(this);
-  ZoneDelegate get _parentDelegate => parent._delegate;
-
-  _CustomZone(this.parent, ZoneSpecification specification, this._map)
-      : _run = parent._run,
-        _runUnary = parent._runUnary,
-        _runBinary = parent._runBinary,
-        _registerCallback = parent._registerCallback,
-        _registerUnaryCallback = parent._registerUnaryCallback,
-        _registerBinaryCallback = parent._registerBinaryCallback,
-        _errorCallback = parent._errorCallback,
-        _scheduleMicrotask = parent._scheduleMicrotask,
-        _createTimer = parent._createTimer,
-        _createPeriodicTimer = parent._createPeriodicTimer,
-        _print = parent._print,
-        _fork = parent._fork,
-        _handleUncaughtError = parent._handleUncaughtError {
-    // The root zone will have implementations of all parts of the
-    // specification, so it will never try to access the (null) parent.
-    // All other zones have a non-null parent.
-    var run = specification.run;
-    if (run != null) {
-      _run = _RunNullaryZoneFunction(this, run);
-    }
-    var runUnary = specification.runUnary;
-    if (runUnary != null) {
-      _runUnary = _RunUnaryZoneFunction(this, runUnary);
-    }
-    var runBinary = specification.runBinary;
-    if (runBinary != null) {
-      _runBinary = _RunBinaryZoneFunction(this, runBinary);
-    }
-    var registerCallback = specification.registerCallback;
-    if (registerCallback != null) {
-      _registerCallback = _RegisterNullaryZoneFunction(this, registerCallback);
-    }
-    var registerUnaryCallback = specification.registerUnaryCallback;
-    if (registerUnaryCallback != null) {
-      _registerUnaryCallback =
-          _RegisterUnaryZoneFunction(this, registerUnaryCallback);
-    }
-    var registerBinaryCallback = specification.registerBinaryCallback;
-    if (registerBinaryCallback != null) {
-      _registerBinaryCallback =
-          _RegisterBinaryZoneFunction(this, registerBinaryCallback);
-    }
-    var errorCallback = specification.errorCallback;
-    if (errorCallback != null) {
-      _errorCallback = _ZoneFunction<ErrorCallbackHandler>(this, errorCallback);
-    }
-    var scheduleMicrotask = specification.scheduleMicrotask;
-    if (scheduleMicrotask != null) {
-      _scheduleMicrotask =
-          _ZoneFunction<ScheduleMicrotaskHandler>(this, scheduleMicrotask);
-    }
-    var createTimer = specification.createTimer;
-    if (createTimer != null) {
-      _createTimer = _ZoneFunction<CreateTimerHandler>(this, createTimer);
-    }
-    var createPeriodicTimer = specification.createPeriodicTimer;
-    if (createPeriodicTimer != null) {
-      _createPeriodicTimer =
-          _ZoneFunction<CreatePeriodicTimerHandler>(this, createPeriodicTimer);
-    }
-    var print = specification.print;
-    if (print != null) {
-      _print = _ZoneFunction<PrintHandler>(this, print);
-    }
-    var fork = specification.fork;
-    if (fork != null) {
-      _fork = _ZoneFunction<ForkHandler>(this, fork);
-    }
-    var handleUncaughtError = specification.handleUncaughtError;
-    if (handleUncaughtError != null) {
-      _handleUncaughtError =
-          _ZoneFunction<HandleUncaughtErrorHandler>(this, handleUncaughtError);
-    }
-  }
-
-  /**
-   * The closest error-handling zone.
-   *
-   * Returns `this` if `this` has an error-handler. Otherwise returns the
-   * parent's error-zone.
-   */
-  Zone get errorZone => _handleUncaughtError.zone;
-
-  void runGuarded(void f()) {
-    try {
-      run(f);
-    } catch (e, s) {
-      handleUncaughtError(e, s);
-    }
-  }
-
-  void runUnaryGuarded<T>(void f(T arg), T arg) {
-    try {
-      runUnary(f, arg);
-    } catch (e, s) {
-      handleUncaughtError(e, s);
-    }
-  }
-
-  void runBinaryGuarded<T1, T2>(void f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-    try {
-      runBinary(f, arg1, arg2);
-    } catch (e, s) {
-      handleUncaughtError(e, s);
-    }
-  }
-
-  ZoneCallback<R> bindCallback<R>(R f()) {
-    var registered = registerCallback(f);
-    return () => this.run(registered);
-  }
-
-  ZoneUnaryCallback<R, T> bindUnaryCallback<R, T>(R f(T arg)) {
-    var registered = registerUnaryCallback(f);
-    return (arg) => this.runUnary(registered, arg);
-  }
-
-  ZoneBinaryCallback<R, T1, T2> bindBinaryCallback<R, T1, T2>(
-      R f(T1 arg1, T2 arg2)) {
-    var registered = registerBinaryCallback(f);
-    return (arg1, arg2) => this.runBinary(registered, arg1, arg2);
-  }
-
-  void Function() bindCallbackGuarded(void f()) {
-    var registered = registerCallback(f);
-    return () => this.runGuarded(registered);
-  }
-
-  void Function(T) bindUnaryCallbackGuarded<T>(void f(T arg)) {
-    var registered = registerUnaryCallback(f);
-    return (arg) => this.runUnaryGuarded(registered, arg);
-  }
-
-  void Function(T1, T2) bindBinaryCallbackGuarded<T1, T2>(
-      void f(T1 arg1, T2 arg2)) {
-    var registered = registerBinaryCallback(f);
-    return (arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2);
-  }
-
-  dynamic operator [](Object? key) {
-    var result = _map[key];
-    if (result != null || _map.containsKey(key)) return result;
-    // If we are not the root zone, look up in the parent zone.
-    if (parent != null) {
-      // We do not optimize for repeatedly looking up a key which isn't
-      // there. That would require storing the key and keeping it alive.
-      // Copying the key/value from the parent does not keep any new values
-      // alive.
-      var value = parent[key];
-      if (value != null) {
-        _map[key] = value;
-      }
-      return value;
-    }
-    assert(this == _rootZone);
-    return null;
-  }
-
-  // Methods that can be customized by the zone specification.
-
-  void handleUncaughtError(Object error, StackTrace stackTrace) {
-    var implementation = this._handleUncaughtError;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    HandleUncaughtErrorHandler handler = implementation.function;
-    return handler(
-        implementation.zone, parentDelegate, this, error, stackTrace);
-  }
-
-  Zone fork(
-      {ZoneSpecification? specification, Map<Object?, Object?>? zoneValues}) {
-    var implementation = this._fork;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    ForkHandler handler = implementation.function;
-    return handler(
-        implementation.zone, parentDelegate, this, specification, zoneValues);
-  }
-
-  R run<R>(R f()) {
-    var implementation = this._run;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    var handler = implementation.function as RunHandler;
-    return handler(implementation.zone, parentDelegate, this, f);
-  }
-
-  R runUnary<R, T>(R f(T arg), T arg) {
-    var implementation = this._runUnary;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    var handler = implementation.function as RunUnaryHandler;
-    return handler(implementation.zone, parentDelegate, this, f, arg);
-  }
-
-  R runBinary<R, T1, T2>(R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-    var implementation = this._runBinary;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    var handler = implementation.function as RunBinaryHandler;
-    return handler(implementation.zone, parentDelegate, this, f, arg1, arg2);
-  }
-
-  ZoneCallback<R> registerCallback<R>(R callback()) {
-    var implementation = this._registerCallback;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    var handler = implementation.function as RegisterCallbackHandler;
-    return handler(implementation.zone, parentDelegate, this, callback);
-  }
-
-  ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(R callback(T arg)) {
-    var implementation = this._registerUnaryCallback;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    var handler = implementation.function as RegisterUnaryCallbackHandler;
-    return handler(implementation.zone, parentDelegate, this, callback);
-  }
-
-  ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
-      R callback(T1 arg1, T2 arg2)) {
-    var implementation = this._registerBinaryCallback;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    var handler = implementation.function as RegisterBinaryCallbackHandler;
-    return handler(implementation.zone, parentDelegate, this, callback);
-  }
-
-  AsyncError? errorCallback(Object error, StackTrace? stackTrace) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    var implementation = this._errorCallback;
-    final _Zone implementationZone = implementation.zone;
-    if (identical(implementationZone, _rootZone)) return null;
-    final ZoneDelegate parentDelegate = implementationZone._parentDelegate;
-    ErrorCallbackHandler handler = implementation.function;
-    return handler(implementationZone, parentDelegate, this, error, stackTrace);
-  }
-
-  void scheduleMicrotask(void f()) {
-    var implementation = this._scheduleMicrotask;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    ScheduleMicrotaskHandler handler = implementation.function;
-    return handler(implementation.zone, parentDelegate, this, f);
-  }
-
-  Timer createTimer(Duration duration, void f()) {
-    var implementation = this._createTimer;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    CreateTimerHandler handler = implementation.function;
-    return handler(implementation.zone, parentDelegate, this, duration, f);
-  }
-
-  Timer createPeriodicTimer(Duration duration, void f(Timer timer)) {
-    var implementation = this._createPeriodicTimer;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    CreatePeriodicTimerHandler handler = implementation.function;
-    return handler(implementation.zone, parentDelegate, this, duration, f);
-  }
-
-  void print(String line) {
-    var implementation = this._print;
-    ZoneDelegate parentDelegate = implementation.zone._parentDelegate;
-    PrintHandler handler = implementation.function;
-    return handler(implementation.zone, parentDelegate, this, line);
-  }
-}
-
-void _rootHandleUncaughtError(Zone? self, ZoneDelegate? parent, Zone zone,
-    Object error, StackTrace stackTrace) {
-  _schedulePriorityAsyncCallback(() {
-    _rethrow(error, stackTrace);
-  });
-}
-
-external void _rethrow(Object error, StackTrace stackTrace);
-
-R _rootRun<R>(Zone? self, ZoneDelegate? parent, Zone zone, R f()) {
-  if (identical(Zone._current, zone)) return f();
-
-  if (zone is! _Zone) {
-    throw ArgumentError.value(zone, "zone", "Can only run in platform zones");
-  }
-
-  _Zone old = Zone._enter(zone);
-  try {
-    return f();
-  } finally {
-    Zone._leave(old);
-  }
-}
-
-R _rootRunUnary<R, T>(
-    Zone? self, ZoneDelegate? parent, Zone zone, R f(T arg), T arg) {
-  if (identical(Zone._current, zone)) return f(arg);
-
-  if (zone is! _Zone) {
-    throw ArgumentError.value(zone, "zone", "Can only run in platform zones");
-  }
-
-  _Zone old = Zone._enter(zone);
-  try {
-    return f(arg);
-  } finally {
-    Zone._leave(old);
-  }
-}
-
-R _rootRunBinary<R, T1, T2>(Zone? self, ZoneDelegate? parent, Zone zone,
-    R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-  if (identical(Zone._current, zone)) return f(arg1, arg2);
-
-  if (zone is! _Zone) {
-    throw ArgumentError.value(zone, "zone", "Can only run in platform zones");
-  }
-
-  _Zone old = Zone._enter(zone);
-  try {
-    return f(arg1, arg2);
-  } finally {
-    Zone._leave(old);
-  }
-}
-
-ZoneCallback<R> _rootRegisterCallback<R>(
-    Zone self, ZoneDelegate parent, Zone zone, R f()) {
-  return f;
-}
-
-ZoneUnaryCallback<R, T> _rootRegisterUnaryCallback<R, T>(
-    Zone self, ZoneDelegate parent, Zone zone, R f(T arg)) {
-  return f;
-}
-
-ZoneBinaryCallback<R, T1, T2> _rootRegisterBinaryCallback<R, T1, T2>(
-    Zone self, ZoneDelegate parent, Zone zone, R f(T1 arg1, T2 arg2)) {
-  return f;
-}
-
-AsyncError? _rootErrorCallback(Zone self, ZoneDelegate parent, Zone zone,
-        Object error, StackTrace? stackTrace) =>
-    null;
-
-void _rootScheduleMicrotask(
-    Zone? self, ZoneDelegate? parent, Zone zone, void f()) {
-  if (!identical(_rootZone, zone)) {
-    bool hasErrorHandler = !_rootZone.inSameErrorZone(zone);
-    if (hasErrorHandler) {
-      f = zone.bindCallbackGuarded(f);
-    } else {
-      f = zone.bindCallback(f);
-    }
-  }
-  _scheduleAsyncCallback(f);
-}
-
-Timer _rootCreateTimer(Zone self, ZoneDelegate parent, Zone zone,
-    Duration duration, void Function() callback) {
-  if (!identical(_rootZone, zone)) {
-    callback = zone.bindCallback(callback);
-  }
-  return Timer._createTimer(duration, callback);
-}
-
-Timer _rootCreatePeriodicTimer(Zone self, ZoneDelegate parent, Zone zone,
-    Duration duration, void callback(Timer timer)) {
-  if (!identical(_rootZone, zone)) {
-    callback = zone.bindUnaryCallback<void, Timer>(callback);
-  }
-  return Timer._createPeriodicTimer(duration, callback);
-}
-
-void _rootPrint(Zone self, ZoneDelegate parent, Zone zone, String line) {
-  printToConsole(line);
-}
-
-void _printToZone(String line) {
-  Zone.current.print(line);
-}
-
-Zone _rootFork(Zone? self, ZoneDelegate? parent, Zone zone,
-    ZoneSpecification? specification, Map<Object?, Object?>? zoneValues) {
-  if (zone is! _Zone) {
-    throw ArgumentError.value(zone, "zone", "Can only fork a platform zone");
-  }
-  // TODO(floitsch): it would be nice if we could get rid of this hack.
-  // Change the static zoneOrDirectPrint function to go through zones
-  // from now on.
-  printToZone = _printToZone;
-
-  if (specification == null) {
-    specification = const ZoneSpecification();
-  } else if (specification is! _ZoneSpecification) {
-    specification = ZoneSpecification.from(specification);
-  }
-  Map<Object?, Object?> valueMap;
-  if (zoneValues == null) {
-    valueMap = zone._map;
-  } else {
-    valueMap = HashMap<Object?, Object?>.from(zoneValues);
-  }
-  if (specification == null)
-    throw "unreachable"; // TODO(lrn): Remove when type promotion works.
-  return _CustomZone(zone, specification, valueMap);
-}
-
-class _RootZone extends _Zone {
-  const _RootZone();
-
-  _RunNullaryZoneFunction get _run =>
-      const _RunNullaryZoneFunction(_rootZone, _rootRun);
-  _RunUnaryZoneFunction get _runUnary =>
-      const _RunUnaryZoneFunction(_rootZone, _rootRunUnary);
-  _RunBinaryZoneFunction get _runBinary =>
-      const _RunBinaryZoneFunction(_rootZone, _rootRunBinary);
-  _RegisterNullaryZoneFunction get _registerCallback =>
-      const _RegisterNullaryZoneFunction(_rootZone, _rootRegisterCallback);
-  _RegisterUnaryZoneFunction get _registerUnaryCallback =>
-      const _RegisterUnaryZoneFunction(_rootZone, _rootRegisterUnaryCallback);
-  _RegisterBinaryZoneFunction get _registerBinaryCallback =>
-      const _RegisterBinaryZoneFunction(_rootZone, _rootRegisterBinaryCallback);
-  _ZoneFunction<ErrorCallbackHandler> get _errorCallback =>
-      const _ZoneFunction<ErrorCallbackHandler>(_rootZone, _rootErrorCallback);
-  _ZoneFunction<ScheduleMicrotaskHandler> get _scheduleMicrotask =>
-      const _ZoneFunction<ScheduleMicrotaskHandler>(
-          _rootZone, _rootScheduleMicrotask);
-  _ZoneFunction<CreateTimerHandler> get _createTimer =>
-      const _ZoneFunction<CreateTimerHandler>(_rootZone, _rootCreateTimer);
-  _ZoneFunction<CreatePeriodicTimerHandler> get _createPeriodicTimer =>
-      const _ZoneFunction<CreatePeriodicTimerHandler>(
-          _rootZone, _rootCreatePeriodicTimer);
-  _ZoneFunction<PrintHandler> get _print =>
-      const _ZoneFunction<PrintHandler>(_rootZone, _rootPrint);
-  _ZoneFunction<ForkHandler> get _fork =>
-      const _ZoneFunction<ForkHandler>(_rootZone, _rootFork);
-  _ZoneFunction<HandleUncaughtErrorHandler> get _handleUncaughtError =>
-      const _ZoneFunction<HandleUncaughtErrorHandler>(
-          _rootZone, _rootHandleUncaughtError);
-
-  // The parent zone.
-  _Zone? get parent => null;
-
-  /// The zone's scoped value declaration map.
-  ///
-  /// This is always a [HashMap].
-  Map<Object?, Object?> get _map => _rootMap;
-
-  static final _rootMap = HashMap();
-
-  static ZoneDelegate? _rootDelegate;
-
-  ZoneDelegate get _delegate => _rootDelegate ??= new _ZoneDelegate(this);
-  // It's a lie, but the root zone never uses the parent delegate.
-  ZoneDelegate get _parentDelegate => _delegate;
-
-  /**
-   * The closest error-handling zone.
-   *
-   * Returns `this` if `this` has an error-handler. Otherwise returns the
-   * parent's error-zone.
-   */
-  Zone get errorZone => this;
-
-  // Zone interface.
-
-  void runGuarded(void f()) {
-    try {
-      if (identical(_rootZone, Zone._current)) {
-        f();
-        return;
-      }
-      _rootRun(null, null, this, f);
-    } catch (e, s) {
-      handleUncaughtError(e, s);
-    }
-  }
-
-  void runUnaryGuarded<T>(void f(T arg), T arg) {
-    try {
-      if (identical(_rootZone, Zone._current)) {
-        f(arg);
-        return;
-      }
-      _rootRunUnary(null, null, this, f, arg);
-    } catch (e, s) {
-      handleUncaughtError(e, s);
-    }
-  }
-
-  void runBinaryGuarded<T1, T2>(void f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-    try {
-      if (identical(_rootZone, Zone._current)) {
-        f(arg1, arg2);
-        return;
-      }
-      _rootRunBinary(null, null, this, f, arg1, arg2);
-    } catch (e, s) {
-      handleUncaughtError(e, s);
-    }
-  }
-
-  ZoneCallback<R> bindCallback<R>(R f()) {
-    return () => this.run<R>(f);
-  }
-
-  ZoneUnaryCallback<R, T> bindUnaryCallback<R, T>(R f(T arg)) {
-    return (arg) => this.runUnary<R, T>(f, arg);
-  }
-
-  ZoneBinaryCallback<R, T1, T2> bindBinaryCallback<R, T1, T2>(
-      R f(T1 arg1, T2 arg2)) {
-    return (arg1, arg2) => this.runBinary<R, T1, T2>(f, arg1, arg2);
-  }
-
-  void Function() bindCallbackGuarded(void f()) {
-    return () => this.runGuarded(f);
-  }
-
-  void Function(T) bindUnaryCallbackGuarded<T>(void f(T arg)) {
-    return (arg) => this.runUnaryGuarded(f, arg);
-  }
-
-  void Function(T1, T2) bindBinaryCallbackGuarded<T1, T2>(
-      void f(T1 arg1, T2 arg2)) {
-    return (arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2);
-  }
-
-  dynamic operator [](Object? key) => null;
-
-  // Methods that can be customized by the zone specification.
-
-  void handleUncaughtError(Object error, StackTrace stackTrace) {
-    _rootHandleUncaughtError(null, null, this, error, stackTrace);
-  }
-
-  Zone fork(
-      {ZoneSpecification? specification, Map<Object?, Object?>? zoneValues}) {
-    return _rootFork(null, null, this, specification, zoneValues);
-  }
-
-  R run<R>(R f()) {
-    if (identical(Zone._current, _rootZone)) return f();
-    return _rootRun(null, null, this, f);
-  }
-
-  R runUnary<R, T>(R f(T arg), T arg) {
-    if (identical(Zone._current, _rootZone)) return f(arg);
-    return _rootRunUnary(null, null, this, f, arg);
-  }
-
-  R runBinary<R, T1, T2>(R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) {
-    if (identical(Zone._current, _rootZone)) return f(arg1, arg2);
-    return _rootRunBinary(null, null, this, f, arg1, arg2);
-  }
-
-  ZoneCallback<R> registerCallback<R>(R f()) => f;
-
-  ZoneUnaryCallback<R, T> registerUnaryCallback<R, T>(R f(T arg)) => f;
-
-  ZoneBinaryCallback<R, T1, T2> registerBinaryCallback<R, T1, T2>(
-          R f(T1 arg1, T2 arg2)) =>
-      f;
-
-  AsyncError? errorCallback(Object error, StackTrace? stackTrace) => null;
-
-  void scheduleMicrotask(void f()) {
-    _rootScheduleMicrotask(null, null, this, f);
-  }
-
-  Timer createTimer(Duration duration, void f()) {
-    return Timer._createTimer(duration, f);
-  }
-
-  Timer createPeriodicTimer(Duration duration, void f(Timer timer)) {
-    return Timer._createPeriodicTimer(duration, f);
-  }
-
-  void print(String line) {
-    printToConsole(line);
-  }
-}
-
-const _Zone _rootZone = const _RootZone();
-
-/**
- * Runs [body] in its own zone.
- *
- * Creates a new zone using [Zone.fork] based on [zoneSpecification] and
- * [zoneValues], then runs [body] in that zone and returns the result.
- *
- * If [onError] is provided, it must have one of the types
- * * `void Function(Object)`
- * * `void Function(Object, StackTrace)`
- * and the [onError] handler is used *both* to handle asynchronous errors
- * by overriding [ZoneSpecification.handleUncaughtError] in [zoneSpecification],
- * if any, *and* to handle errors thrown synchronously by the call to [body].
- *
- * If an error occurs synchronously in [body],
- * then throwing in the [onError] handler
- * makes the call to `runZone` throw that error,
- * and otherwise the call to `runZoned` attempt to return `null`.
- *
- * If the zone specification has a `handleUncaughtError` value or the [onError]
- * parameter is provided, the zone becomes an error-zone.
- *
- * Errors will never cross error-zone boundaries by themselves.
- * Errors that try to cross error-zone boundaries are considered uncaught in
- * their originating error zone.
- *
- *     var future = new Future.value(499);
- *     runZoned(() {
- *       var future2 = future.then((_) { throw "error in first error-zone"; });
- *       runZoned(() {
- *         var future3 = future2.catchError((e) { print("Never reached!"); });
- *       }, onError: (e, s) { print("unused error handler"); });
- *     }, onError: (e, s) { print("catches error of first error-zone."); });
- *
- * Example:
- *
- *     runZoned(() {
- *       new Future(() { throw "asynchronous error"; });
- *     }, onError: (e, s) => print(e));  // Will print "asynchronous error".
- *
- * It is possible to manually pass an error from one error zone to another
- * by re-throwing it in the new zone. If [onError] throws, that error will
- * occur in the original zone where [runZoned] was called.
- */
-R runZoned<R>(R body(),
-    {Map<Object?, Object?>? zoneValues,
-    ZoneSpecification? zoneSpecification,
-    @Deprecated("Use runZonedGuarded instead") Function? onError}) {
-  ArgumentError.checkNotNull(body, "body");
-  if (onError != null) {
-    // TODO: Remove this when code have been migrated off using [onError].
-    if (onError is! void Function(Object, StackTrace)) {
-      if (onError is void Function(Object)) {
-        var originalOnError = onError;
-        onError = (Object error, StackTrace stack) => originalOnError(error);
-      } else {
-        throw ArgumentError.value(onError, "onError",
-            "Must be Function(Object) or Function(Object, StackTrace)");
-      }
-    }
-    return runZonedGuarded(body, onError,
-        zoneSpecification: zoneSpecification, zoneValues: zoneValues) as R;
-  }
-  return _runZoned<R>(body, zoneValues, zoneSpecification);
-}
-
-/**
- * Runs [body] in its own error zone.
- *
- * Creates a new zone using [Zone.fork] based on [zoneSpecification] and
- * [zoneValues], then runs [body] in that zone and returns the result.
- *
- * The [onError] function is used *both* to handle asynchronous errors
- * by overriding [ZoneSpecification.handleUncaughtError] in [zoneSpecification],
- * if any, *and* to handle errors thrown synchronously by the call to [body].
- *
- * If an error occurs synchronously in [body],
- * then throwing in the [onError] handler
- * makes the call to `runZonedGuarded` throw that error,
- * and otherwise the call to `runZonedGuarded` returns `null`.
- *
- * The zone will always be an error-zone.
- *
- * Errors will never cross error-zone boundaries by themselves.
- * Errors that try to cross error-zone boundaries are considered uncaught in
- * their originating error zone.
- * ```dart
- * var future = Future.value(499);
- * runZonedGuarded(() {
- *   var future2 = future.then((_) { throw "error in first error-zone"; });
- *   runZonedGuarded(() {
- *     var future3 = future2.catchError((e) { print("Never reached!"); });
- *   }, (e, s) { print("unused error handler"); });
- * }, (e, s) { print("catches error of first error-zone."); });
- * ```
- * Example:
- * ```dart
- * runZonedGuarded(() {
- *   new Future(() { throw "asynchronous error"; });
- * }, (e, s) => print(e));  // Will print "asynchronous error".
- * ```
- * It is possible to manually pass an error from one error zone to another
- * by re-throwing it in the new zone. If [onError] throws, that error will
- * occur in the original zone where [runZoned] was called.
- */
-@Since("2.8")
-R? runZonedGuarded<R>(R body(), void onError(Object error, StackTrace stack),
-    {Map<Object?, Object?>? zoneValues, ZoneSpecification? zoneSpecification}) {
-  ArgumentError.checkNotNull(body, "body");
-  ArgumentError.checkNotNull(onError, "onError");
-  _Zone parentZone = Zone._current;
-  HandleUncaughtErrorHandler errorHandler = (Zone self, ZoneDelegate parent,
-      Zone zone, Object error, StackTrace stackTrace) {
-    try {
-      parentZone.runBinary(onError, error, stackTrace);
-    } catch (e, s) {
-      if (identical(e, error)) {
-        parent.handleUncaughtError(zone, error, stackTrace);
-      } else {
-        parent.handleUncaughtError(zone, e, s);
-      }
-    }
-  };
-  if (zoneSpecification == null) {
-    zoneSpecification =
-        new ZoneSpecification(handleUncaughtError: errorHandler);
-  } else {
-    zoneSpecification = ZoneSpecification.from(zoneSpecification,
-        handleUncaughtError: errorHandler);
-  }
-  try {
-    return _runZoned<R>(body, zoneValues, zoneSpecification);
-  } catch (error, stackTrace) {
-    onError(error, stackTrace);
-  }
-  return null;
-}
-
-/// Runs [body] in a new zone based on [zoneValues] and [specification].
-R _runZoned<R>(R body(), Map<Object?, Object?>? zoneValues,
-        ZoneSpecification? specification) =>
-    Zone.current
-        .fork(specification: specification, zoneValues: zoneValues)
-        .run<R>(body);
diff --git a/sdk_nnbd/lib/cli/cli.dart b/sdk_nnbd/lib/cli/cli.dart
deleted file mode 100644
index 9c19c3a..0000000
--- a/sdk_nnbd/lib/cli/cli.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2017, 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.
-
-/// {@category VM}
-library dart.cli;
-
-import 'dart:async';
-import 'dart:math';
-
-part 'wait_for.dart';
diff --git a/sdk_nnbd/lib/cli/cli_sources.gni b/sdk_nnbd/lib/cli/cli_sources.gni
deleted file mode 100644
index e90e1de..0000000
--- a/sdk_nnbd/lib/cli/cli_sources.gni
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2017, 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.
-
-cli_sdk_sources = [
-  "cli.dart",
-
-  # The above file needs to be first if additional parts are added to the lib.
-  "wait_for.dart",
-]
diff --git a/sdk_nnbd/lib/cli/wait_for.dart b/sdk_nnbd/lib/cli/wait_for.dart
deleted file mode 100644
index 35cb307..0000000
--- a/sdk_nnbd/lib/cli/wait_for.dart
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart.cli;
-
-/**
- * Synchronously blocks the calling isolate to wait for asynchronous events to
- * complete.
- *
- * If the [timeout] parameter is supplied, [waitForEvent] will return after
- * the specified timeout even if no events have occurred.
- *
- * This call does the following:
- * - suspends the current execution stack,
- * - runs the microtask queue until it is empty,
- * - waits until the message queue is not empty,
- * - handles messages on the message queue, plus their associated microtasks,
- *   until the message queue is empty,
- * - resumes the original stack.
- *
- * This function breaks the usual promise offered by Dart semantics that
- * message handlers and microtasks run to completion before the next message
- * handler or microtask begins to run. Of particular note is that use of this
- * function in a finally block will allow microtasks and message handlers to
- * run before all finally blocks for an exception have completed, possibly
- * breaking invariants in your program.
- *
- * This function will synchronously throw the first unhandled exception it
- * encounters in running the microtasks and message handlers as though the
- * throwing microtask or message handler was the only Dart invocation on the
- * stack. That is, unhandled exceptions in a microtask or message handler will
- * skip over stacks suspended in a call to [waitForEvent].
- *
- * Calls to this function may be nested. Earlier invocations will not
- * be able to complete until subsequent ones do. Messages that arrive after
- * a subsequent invocation are "consumed" by that invocation, and do not
- * unblock an earlier invocation. Please be aware that nesting calls to
- * [waitForEvent] can lead to deadlock when subsequent calls block to wait for
- * a condition that is only satisfied after an earlier call returns.
- *
- * Please note that this call is only available in the standalone command-line
- * Dart VM. Further, because it suspends the current execution stack until the
- * message queue is empty, even when running in the standalone command-line VM
- * there exists a risk that the current execution stack will be starved.
- */
-external void _waitForEvent(int timeoutMillis);
-
-@pragma("vm:entry-point")
-void Function(int) _getWaitForEvent() => _waitForEvent;
-
-// This should be set from C++ code by the embedder to wire up waitFor() to the
-// native implementation. In the standalone VM this is set to _waitForEvent()
-// above. If it is null, calling waitFor() will throw an UnsupportedError.
-@pragma("vm:entry-point")
-void Function(int)? _waitForEventClosure;
-
-class _WaitForUtils {
-  static void waitForEvent({Duration? timeout}) {
-    final closure = _waitForEventClosure;
-    if (closure == null) {
-      throw new UnsupportedError("waitFor is not supported by this embedder");
-    }
-    closure(timeout == null ? 0 : max(1, timeout.inMilliseconds));
-  }
-}
-
-/**
- * Suspends the stack, runs microtasks, and handles incoming events until
- * [future] completes.
- *
- * WARNING: EXPERIMENTAL. USE AT YOUR OWN RISK.
- *
- * This call does the following:
- * - While [future] is not completed:
- *   - suspends the current execution stack,
- *   - runs the microtask queue until it is empty,
- *   - waits until the message queue is not empty,
- *   - handles messages on the message queue, plus their associated microtasks,
- *     until the message queue is empty,
- *   - resumes the original stack.
- *
- * This function breaks the usual promise offered by Dart semantics that
- * message handlers and microtasks run to completion before the next message
- * handler or microtask begins to run. Of particular note is that use of this
- * function in a finally block will allow microtasks and message handlers to
- * run before all finally blocks for an exception have completed, possibly
- * breaking invariants in your program.
- *
- * Use of this function should be considered a last resort when it is not
- * possible to convert a Dart program entirely to an asynchronous style using
- * `async` and `await`.
- *
- * If the [Future] completes normally, its result is returned. If the [Future]
- * completes with an error, the error and stack trace are wrapped in an
- * [AsyncError] and thrown. If a microtask or message handler run during this
- * call results in an unhandled exception, that exception will be propagated
- * as though the microtask or message handler was the only Dart invocation on
- * the stack. That is, unhandled exceptions in a microtask or message handler
- * will skip over stacks suspended in a call to [waitFor].
- *
- * If the optional `timeout` parameter is passed, [waitFor] throws a
- * [TimeoutException] if the [Future] is not completed within the specified
- * period.
- *
- * Calls to [waitFor] may be nested. Earlier invocations will not complete
- * until subsequent ones do, but the completion of a subsequent invocation will
- * cause the previous invocation to wake up and check its [Future] for
- * completion.
- *
- * Please be aware that nesting calls to [waitFor] can lead to deadlock if
- * subsequent calls block waiting for a condition that is only satisfied when
- * an earlier call returns.
- */
-T waitFor<T>(Future<T> future, {Duration? timeout}) {
-  late T result;
-  bool futureCompleted = false;
-  Object? error;
-  StackTrace? stacktrace;
-  future.then((T r) {
-    futureCompleted = true;
-    result = r;
-  }, onError: (e, st) {
-    error = e;
-    stacktrace = st;
-  });
-
-  late Stopwatch s;
-  if (timeout != null) {
-    s = new Stopwatch()..start();
-  }
-  Timer.run(() {}); // Enusre there is at least one message.
-  while (!futureCompleted && (error == null)) {
-    Duration? remaining;
-    if (timeout != null) {
-      if (s.elapsed >= timeout) {
-        throw new TimeoutException("waitFor() timed out", timeout);
-      }
-      remaining = timeout - s.elapsed;
-    }
-    _WaitForUtils.waitForEvent(timeout: remaining);
-  }
-  if (timeout != null) {
-    s.stop();
-  }
-  Timer.run(() {}); // Ensure that previous calls to waitFor are woken up.
-
-  if (error != null) {
-    throw new AsyncError(error!, stacktrace);
-  }
-
-  return result;
-}
diff --git a/sdk_nnbd/lib/collection/collection.dart b/sdk_nnbd/lib/collection/collection.dart
deleted file mode 100644
index b050a48..0000000
--- a/sdk_nnbd/lib/collection/collection.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Classes and utilities that supplement the collection support in dart:core.
-///
-/// To use this library in your code:
-///
-///     import 'dart:collection';
-///
-/// {@category Core}
-library dart.collection;
-
-import 'dart:_internal' hide Symbol;
-import 'dart:math' show Random; // Used by ListMixin.shuffle.
-
-part 'collections.dart';
-part 'hash_map.dart';
-part 'hash_set.dart';
-part 'iterable.dart';
-part 'iterator.dart';
-part 'linked_hash_map.dart';
-part 'linked_hash_set.dart';
-part 'linked_list.dart';
-part 'list.dart';
-part 'maps.dart';
-part 'queue.dart';
-part 'set.dart';
-part 'splay_tree.dart';
diff --git a/sdk_nnbd/lib/collection/collection_sources.gni b/sdk_nnbd/lib/collection/collection_sources.gni
deleted file mode 100644
index 3f2f19e..0000000
--- a/sdk_nnbd/lib/collection/collection_sources.gni
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# This file contains all sources for the dart:collection library.
-collection_sdk_sources = [
-  "collection.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "collections.dart",
-  "hash_map.dart",
-  "hash_set.dart",
-  "iterable.dart",
-  "iterator.dart",
-  "linked_hash_map.dart",
-  "linked_hash_set.dart",
-  "linked_list.dart",
-  "list.dart",
-  "maps.dart",
-  "queue.dart",
-  "set.dart",
-  "splay_tree.dart",
-]
diff --git a/sdk_nnbd/lib/collection/collections.dart b/sdk_nnbd/lib/collection/collections.dart
deleted file mode 100644
index 9b43996..0000000
--- a/sdk_nnbd/lib/collection/collections.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// An unmodifiable [List] view of another List.
-///
-/// The source of the elements may be a [List] or any [Iterable] with
-/// efficient [Iterable.length] and [Iterable.elementAt].
-class UnmodifiableListView<E> extends UnmodifiableListBase<E> {
-  final Iterable<E> _source;
-
-  /// Creates an unmodifiable list backed by [source].
-  ///
-  /// The [source] of the elements may be a [List] or any [Iterable] with
-  /// efficient [Iterable.length] and [Iterable.elementAt].
-  UnmodifiableListView(Iterable<E> source) : _source = source;
-
-  List<R> cast<R>() => UnmodifiableListView(_source.cast<R>());
-  int get length => _source.length;
-
-  E operator [](int index) => _source.elementAt(index);
-}
diff --git a/sdk_nnbd/lib/collection/hash_map.dart b/sdk_nnbd/lib/collection/hash_map.dart
deleted file mode 100644
index 3990cd2..0000000
--- a/sdk_nnbd/lib/collection/hash_map.dart
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// Default function for equality comparison in customized HashMaps.
-bool _defaultEquals(Object? a, Object? b) => a == b;
-
-/// Default function for hash-code computation in customized HashMaps.
-int _defaultHashCode(Object? a) => a.hashCode;
-
-/// Type of custom equality function.
-typedef _Equality<K> = bool Function(K a, K b);
-
-/// Type of custom hash code function.
-typedef _Hasher<K> = int Function(K object);
-
-/// A hash-table based implementation of [Map].
-///
-/// The keys of a `HashMap` must have consistent [Object.==]
-/// and [Object.hashCode] implementations. This means that the `==` operator
-/// must define a stable equivalence relation on the keys (reflexive,
-/// symmetric, transitive, and consistent over time), and that `hashCode`
-/// must be the same for objects that are considered equal by `==`.
-///
-/// The map allows `null` as a key.
-///
-/// Iterating the map's keys, values or entries (through [forEach])
-/// may happen in any order.
-/// The iteration order only changes when the map is modified.
-/// Values are iterated in the same order as their associated keys,
-/// so iterating the [keys] and [values] in parallel
-/// will give matching key and value pairs.
-abstract class HashMap<K, V> implements Map<K, V> {
-  /// Creates an unordered hash-table based [Map].
-  ///
-  /// The created map is not ordered in any way. When iterating the keys or
-  /// values, the iteration order is unspecified except that it will stay the
-  /// same as long as the map isn't changed.
-  ///
-  /// If [equals] is provided, it is used to compare the keys in the table with
-  /// new keys. If [equals] is omitted, the key's own [Object.==] is used
-  /// instead.
-  ///
-  /// Similar, if [hashCode] is provided, it is used to produce a hash value
-  /// for keys in order to place them in the hash table. If it is omitted, the
-  /// key's own [Object.hashCode] is used.
-  ///
-  /// If using methods like [operator []], [remove] and [containsKey] together
-  /// with a custom equality and hashcode, an extra `isValidKey` function
-  /// can be supplied. This function is called before calling [equals] or
-  /// [hashCode] with an argument that may not be a [K] instance, and if the
-  /// call returns false, the key is assumed to not be in the set.
-  /// The [isValidKey] function defaults to just testing if the object is a
-  /// [K] instance.
-  ///
-  /// Example:
-  ///
-  ///     new HashMap<int,int>(equals: (int a, int b) => (b - a) % 5 == 0,
-  ///                          hashCode: (int e) => e % 5)
-  ///
-  /// This example map does not need an `isValidKey` function to be passed.
-  /// The default function accepts only `int` values, which can safely be
-  /// passed to both the `equals` and `hashCode` functions.
-  ///
-  /// If neither `equals`, `hashCode`, nor `isValidKey` is provided,
-  /// the default `isValidKey` instead accepts all keys.
-  /// The default equality and hashcode operations are assumed to work on all
-  /// objects.
-  ///
-  /// Likewise, if `equals` is [identical], `hashCode` is [identityHashCode]
-  /// and `isValidKey` is omitted, the resulting map is identity based,
-  /// and the `isValidKey` defaults to accepting all keys.
-  /// Such a map can be created directly using [HashMap.identity].
-  ///
-  /// The used `equals` and `hashCode` method should always be consistent,
-  /// so that if `equals(a, b)` then `hashCode(a) == hashCode(b)`. The hash
-  /// of an object, or what it compares equal to, should not change while the
-  /// object is a key in the map. If it does change, the result is
-  /// unpredictable.
-  ///
-  /// If you supply one of [equals] and [hashCode],
-  /// you should generally also to supply the other.
-  external factory HashMap(
-      {bool Function(K, K)? equals,
-      int Function(K)? hashCode,
-      bool Function(dynamic)? isValidKey});
-
-  /// Creates an unordered identity-based map.
-  ///
-  /// Effectively a shorthand for:
-  ///
-  ///     new HashMap<K, V>(equals: identical,
-  ///                       hashCode: identityHashCode)
-  external factory HashMap.identity();
-
-  /// Creates a [HashMap] that contains all key/value pairs of [other].
-  ///
-  /// The keys must all be instances of [K] and the values of [V].
-  /// The [other] map itself can have any type.
-  factory HashMap.from(Map<dynamic, dynamic> other) {
-    HashMap<K, V> result = HashMap<K, V>();
-    other.forEach((dynamic k, dynamic v) {
-      result[k as K] = v as V;
-    });
-    return result;
-  }
-
-  /// Creates a [HashMap] that contains all key/value pairs of [other].
-  factory HashMap.of(Map<K, V> other) => HashMap<K, V>()..addAll(other);
-
-  /// Creates a [HashMap] where the keys and values are computed from the
-  /// [iterable].
-  ///
-  /// For each element of the [iterable] this constructor computes a key/value
-  /// pair, by applying [key] and [value] respectively.
-  ///
-  /// The keys of the key/value pairs do not need to be unique. The last
-  /// occurrence of a key will simply overwrite any previous value.
-  ///
-  /// If no values are specified for [key] and [value] the default is the
-  /// identity function.
-  factory HashMap.fromIterable(Iterable iterable,
-      {K Function(dynamic element)? key, V Function(dynamic element)? value}) {
-    HashMap<K, V> map = HashMap<K, V>();
-    MapBase._fillMapWithMappedIterable(map, iterable, key, value);
-    return map;
-  }
-
-  /// Creates a [HashMap] associating the given [keys] to [values].
-  ///
-  /// This constructor iterates over [keys] and [values] and maps each element
-  /// of [keys] to the corresponding element of [values].
-  ///
-  /// If [keys] contains the same object multiple times, the last occurrence
-  /// overwrites the previous value.
-  ///
-  /// It is an error if the two [Iterable]s don't have the same length.
-  factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
-    HashMap<K, V> map = HashMap<K, V>();
-    MapBase._fillMapWithIterables(map, keys, values);
-    return map;
-  }
-
-  /// Creates a [HashMap] containing the entries of [entries].
-  ///
-  /// Returns a new `HashMap<K, V>` where all entries of [entries]
-  /// have been added in iteration order.
-  ///
-  /// If multiple [entries] have the same key,
-  /// later occurrences overwrite the earlier ones.
-  @Since("2.1")
-  factory HashMap.fromEntries(Iterable<MapEntry<K, V>> entries) =>
-      HashMap<K, V>()..addEntries(entries);
-}
diff --git a/sdk_nnbd/lib/collection/hash_set.dart b/sdk_nnbd/lib/collection/hash_set.dart
deleted file mode 100644
index 6ebb04e..0000000
--- a/sdk_nnbd/lib/collection/hash_set.dart
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// An unordered hash-table based [Set] implementation.
-///
-/// The elements of a `HashSet` must have consistent equality
-/// and hashCode implementations. This means that the equals operation
-/// must define a stable equivalence relation on the elements (reflexive,
-/// symmetric, transitive, and consistent over time), and that the hashCode
-/// must consistent with equality, so that the same for objects that are
-/// considered equal.
-///
-/// The set allows `null` as an element.
-///
-/// Most simple operations on `HashSet` are done in (potentially amortized)
-/// constant time: [add], [contains], [remove], and [length], provided the hash
-/// codes of objects are well distributed.
-///
-/// The iteration order of the set is not specified and depends on
-/// the hashcodes of the provided elements. However, the order is stable:
-/// multiple iterations over the same set produce the same order, as long as
-/// the set is not modified.
-abstract class HashSet<E> implements Set<E> {
-  /// Create a hash set using the provided [equals] as equality.
-  ///
-  /// The provided [equals] must define a stable equivalence relation, and
-  /// [hashCode] must be consistent with [equals]. If the [equals] or [hashCode]
-  /// methods won't work on all objects, but only on some instances of E, the
-  /// [isValidKey] predicate can be used to restrict the keys that the functions
-  /// are applied to.
-  /// Any key for which [isValidKey] returns false is automatically assumed
-  /// to not be in the set when asking `contains`.
-  ///
-  /// If [equals] or [hashCode] are omitted, the set uses
-  /// the elements' intrinsic [Object.==] and [Object.hashCode].
-  ///
-  /// If you supply one of [equals] and [hashCode],
-  /// you should generally also to supply the other.
-  ///
-  /// If the supplied `equals` or `hashCode` functions won't work on all [E]
-  /// objects, and the map will be used in a setting where a non-`E` object
-  /// is passed to, e.g., `contains`, then the [isValidKey] function should
-  /// also be supplied.
-  ///
-  /// If [isValidKey] is omitted, it defaults to testing if the object is an
-  /// [E] instance. That means that:
-  ///
-  ///     new HashSet<int>(equals: (int e1, int e2) => (e1 - e2) % 5 == 0,
-  ///                      hashCode: (int e) => e % 5)
-  ///
-  /// does not need an `isValidKey` argument, because it defaults to only
-  /// accepting `int` values which are accepted by both `equals` and `hashCode`.
-  ///
-  /// If neither `equals`, `hashCode`, nor `isValidKey` is provided,
-  /// the default `isValidKey` instead accepts all values.
-  /// The default equality and hashcode operations are assumed to work on all
-  /// objects.
-  ///
-  /// Likewise, if `equals` is [identical], `hashCode` is [identityHashCode]
-  /// and `isValidKey` is omitted, the resulting set is identity based,
-  /// and the `isValidKey` defaults to accepting all keys.
-  /// Such a map can be created directly using [HashSet.identity].
-  external factory HashSet(
-      {bool Function(E, E)? equals,
-      int Function(E)? hashCode,
-      bool Function(dynamic)? isValidKey});
-
-  /// Creates an unordered identity-based set.
-  ///
-  /// Effectively a shorthand for:
-  ///
-  ///     new HashSet<E>(equals: identical,
-  ///                    hashCode: identityHashCode)
-  external factory HashSet.identity();
-
-  /// Create a hash set containing all [elements].
-  ///
-  /// Creates a hash set as by `HashSet<E>()` and adds all given [elements]
-  /// to the set. The elements are added in order. If [elements] contains
-  /// two entries that are equal, but not identical, then the first one is
-  /// the one in the resulting set.
-  ///
-  /// All the [elements] should be instances of [E].
-  /// The `elements` iterable itself may have any element type, so this
-  /// constructor can be used to down-cast a `Set`, for example as:
-  /// ```dart
-  /// Set<SuperType> superSet = ...;
-  /// Set<SubType> subSet =
-  ///     HashSet<SubType>.from(superSet.whereType<SubType>());
-  /// ```
-  factory HashSet.from(Iterable<dynamic> elements) {
-    HashSet<E> result = HashSet<E>();
-    for (final e in elements) {
-      result.add(e as E);
-    }
-    return result;
-  }
-
-  /// Create a hash set containing all [elements].
-  ///
-  /// Creates a hash set as by `new HashSet<E>()` and adds all given [elements]
-  /// to the set. The elements are added in order. If [elements] contains
-  /// two entries that are equal, but not identical, then the first one is
-  /// the one in the resulting set.
-  factory HashSet.of(Iterable<E> elements) => HashSet<E>()..addAll(elements);
-
-  /// Provides an iterator that iterates over the elements of this set.
-  ///
-  /// The order of iteration is unspecified,
-  /// but consistent between changes to the set.
-  Iterator<E> get iterator;
-}
diff --git a/sdk_nnbd/lib/collection/iterable.dart b/sdk_nnbd/lib/collection/iterable.dart
deleted file mode 100644
index 17f84a2..0000000
--- a/sdk_nnbd/lib/collection/iterable.dart
+++ /dev/null
@@ -1,400 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.collection;
-
-/// This [Iterable] mixin implements all [Iterable] members except `iterator`.
-///
-/// All other methods are implemented in terms of `iterator`.
-abstract class IterableMixin<E> implements Iterable<E> {
-  // This class has methods copied verbatim into:
-  // - IterableBase
-  // - SetMixin
-  // If changing a method here, also change the other copies.
-
-  Iterable<R> cast<R>() => Iterable.castFrom<E, R>(this);
-  Iterable<T> map<T>(T f(E element)) => MappedIterable<E, T>(this, f);
-
-  Iterable<E> where(bool f(E element)) => WhereIterable<E>(this, f);
-
-  Iterable<T> whereType<T>() => WhereTypeIterable<T>(this);
-
-  Iterable<T> expand<T>(Iterable<T> f(E element)) =>
-      ExpandIterable<E, T>(this, f);
-
-  Iterable<E> followedBy(Iterable<E> other) {
-    // Type workaround because IterableMixin<E> doesn't promote
-    // to EfficientLengthIterable<E>.
-    Iterable<E> self = this;
-    if (self is EfficientLengthIterable<E>) {
-      return FollowedByIterable<E>.firstEfficient(self, other);
-    }
-    return FollowedByIterable<E>(this, other);
-  }
-
-  bool contains(Object? element) {
-    for (E e in this) {
-      if (e == element) return true;
-    }
-    return false;
-  }
-
-  void forEach(void f(E element)) {
-    for (E element in this) f(element);
-  }
-
-  E reduce(E combine(E value, E element)) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E value = iterator.current;
-    while (iterator.moveNext()) {
-      value = combine(value, iterator.current);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    for (E element in this) value = combine(value, element);
-    return value;
-  }
-
-  bool every(bool f(E element)) {
-    for (E element in this) {
-      if (!f(element)) return false;
-    }
-    return true;
-  }
-
-  String join([String separator = ""]) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) return "";
-    StringBuffer buffer = StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write("${iterator.current}");
-      } while (iterator.moveNext());
-    } else {
-      buffer.write("${iterator.current}");
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write("${iterator.current}");
-      }
-    }
-    return buffer.toString();
-  }
-
-  bool any(bool test(E element)) {
-    for (E element in this) {
-      if (test(element)) return true;
-    }
-    return false;
-  }
-
-  List<E> toList({bool growable = true}) =>
-      List<E>.from(this, growable: growable);
-
-  Set<E> toSet() => Set<E>.from(this);
-
-  int get length {
-    assert(this is! EfficientLengthIterable);
-    int count = 0;
-    Iterator it = iterator;
-    while (it.moveNext()) {
-      count++;
-    }
-    return count;
-  }
-
-  bool get isEmpty => !iterator.moveNext();
-
-  bool get isNotEmpty => !isEmpty;
-
-  Iterable<E> take(int count) {
-    return TakeIterable<E>(this, count);
-  }
-
-  Iterable<E> takeWhile(bool test(E value)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> skip(int count) {
-    return SkipIterable<E>(this, count);
-  }
-
-  Iterable<E> skipWhile(bool test(E value)) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  E get first {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    return it.current;
-  }
-
-  E get last {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E result;
-    do {
-      result = it.current;
-    } while (it.moveNext());
-    return result;
-  }
-
-  E get single {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) throw IterableElementError.noElement();
-    E result = it.current;
-    if (it.moveNext()) throw IterableElementError.tooMany();
-    return result;
-  }
-
-  E firstWhere(bool test(E value), {E Function()? orElse}) {
-    for (E element in this) {
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E element), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    ArgumentError.checkNotNull(index, "index");
-    RangeError.checkNotNegative(index, "index");
-    int elementIndex = 0;
-    for (E element in this) {
-      if (index == elementIndex) return element;
-      elementIndex++;
-    }
-    throw RangeError.index(index, this, "index", null, elementIndex);
-  }
-
-  String toString() => IterableBase.iterableToShortString(this, '(', ')');
-}
-
-/// Base class for implementing [Iterable].
-///
-/// This class implements all methods of [Iterable], except [Iterable.iterator],
-/// in terms of `iterator`.
-abstract class IterableBase<E> extends Iterable<E> {
-  const IterableBase();
-
-  /// Convert an `Iterable` to a string like [IterableBase.toString].
-  ///
-  /// Allows using other delimiters than '(' and ')'.
-  ///
-  /// Handles circular references where converting one of the elements
-  /// to a string ends up converting [iterable] to a string again.
-  static String iterableToShortString(Iterable iterable,
-      [String leftDelimiter = '(', String rightDelimiter = ')']) {
-    if (_isToStringVisiting(iterable)) {
-      if (leftDelimiter == "(" && rightDelimiter == ")") {
-        // Avoid creating a new string in the "common" case.
-        return "(...)";
-      }
-      return "$leftDelimiter...$rightDelimiter";
-    }
-    List<String> parts = <String>[];
-    _toStringVisiting.add(iterable);
-    try {
-      _iterablePartsToStrings(iterable, parts);
-    } finally {
-      assert(identical(_toStringVisiting.last, iterable));
-      _toStringVisiting.removeLast();
-    }
-    return (StringBuffer(leftDelimiter)
-          ..writeAll(parts, ", ")
-          ..write(rightDelimiter))
-        .toString();
-  }
-
-  /// Converts an `Iterable` to a string.
-  ///
-  /// Converts each elements to a string, and separates the results by ", ".
-  /// Then wraps the result in [leftDelimiter] and [rightDelimiter].
-  ///
-  /// Unlike [iterableToShortString], this conversion doesn't omit any
-  /// elements or puts any limit on the size of the result.
-  ///
-  /// Handles circular references where converting one of the elements
-  /// to a string ends up converting [iterable] to a string again.
-  static String iterableToFullString(Iterable iterable,
-      [String leftDelimiter = '(', String rightDelimiter = ')']) {
-    if (_isToStringVisiting(iterable)) {
-      return "$leftDelimiter...$rightDelimiter";
-    }
-    StringBuffer buffer = StringBuffer(leftDelimiter);
-    _toStringVisiting.add(iterable);
-    try {
-      buffer.writeAll(iterable, ", ");
-    } finally {
-      assert(identical(_toStringVisiting.last, iterable));
-      _toStringVisiting.removeLast();
-    }
-    buffer.write(rightDelimiter);
-    return buffer.toString();
-  }
-}
-
-/// A collection used to identify cyclic lists during toString() calls.
-final List<Object> _toStringVisiting = [];
-
-/// Check if we are currently visiting `o` in a toString call.
-bool _isToStringVisiting(Object o) {
-  for (int i = 0; i < _toStringVisiting.length; i++) {
-    if (identical(o, _toStringVisiting[i])) return true;
-  }
-  return false;
-}
-
-/// Convert elements of [iterable] to strings and store them in [parts].
-void _iterablePartsToStrings(Iterable<Object?> iterable, List<String> parts) {
-  /*
-   * This is the complicated part of [iterableToShortString].
-   * It is extracted as a separate function to avoid having too much code
-   * inside the try/finally.
-   */
-  /// Try to stay below this many characters.
-  const int lengthLimit = 80;
-
-  /// Always at least this many elements at the start.
-  const int headCount = 3;
-
-  /// Always at least this many elements at the end.
-  const int tailCount = 2;
-
-  /// Stop iterating after this many elements. Iterables can be infinite.
-  const int maxCount = 100;
-  // Per entry length overhead. It's for ", " for all after the first entry,
-  // and for "(" and ")" for the initial entry. By pure luck, that's the same
-  // number.
-  const int overhead = 2;
-  const int ellipsisSize = 3; // "...".length.
-
-  int length = 0;
-  int count = 0;
-  Iterator<Object?> it = iterable.iterator;
-  // Initial run of elements, at least headCount, and then continue until
-  // passing at most lengthLimit characters.
-  while (length < lengthLimit || count < headCount) {
-    if (!it.moveNext()) return;
-    String next = "${it.current}";
-    parts.add(next);
-    length += next.length + overhead;
-    count++;
-  }
-
-  String penultimateString;
-  String ultimateString;
-
-  // Find last two elements. One or more of them may already be in the
-  // parts array. Include their length in `length`.
-  if (!it.moveNext()) {
-    if (count <= headCount + tailCount) return;
-    ultimateString = parts.removeLast();
-    penultimateString = parts.removeLast();
-  } else {
-    Object? penultimate = it.current;
-    count++;
-    if (!it.moveNext()) {
-      if (count <= headCount + 1) {
-        parts.add("$penultimate");
-        return;
-      }
-      ultimateString = "$penultimate";
-      penultimateString = parts.removeLast();
-      length += ultimateString.length + overhead;
-    } else {
-      Object? ultimate = it.current;
-      count++;
-      // Then keep looping, keeping the last two elements in variables.
-      assert(count < maxCount);
-      while (it.moveNext()) {
-        penultimate = ultimate;
-        ultimate = it.current;
-        count++;
-        if (count > maxCount) {
-          // If we haven't found the end before maxCount, give up.
-          // This cannot happen in the code above because each entry
-          // increases length by at least two, so there is no way to
-          // visit more than ~40 elements before this loop.
-
-          // Remove any surplus elements until length, including ", ...)",
-          // is at most lengthLimit.
-          while (length > lengthLimit - ellipsisSize - overhead &&
-              count > headCount) {
-            length -= parts.removeLast().length + overhead;
-            count--;
-          }
-          parts.add("...");
-          return;
-        }
-      }
-      penultimateString = "$penultimate";
-      ultimateString = "$ultimate";
-      length += ultimateString.length + penultimateString.length + 2 * overhead;
-    }
-  }
-
-  // If there is a gap between the initial run and the last two,
-  // prepare to add an ellipsis.
-  String? elision;
-  if (count > parts.length + tailCount) {
-    elision = "...";
-    length += ellipsisSize + overhead;
-  }
-
-  // If the last two elements were very long, and we have more than
-  // headCount elements in the initial run, drop some to make room for
-  // the last two.
-  while (length > lengthLimit && parts.length > headCount) {
-    length -= parts.removeLast().length + overhead;
-    if (elision == null) {
-      elision = "...";
-      length += ellipsisSize + overhead;
-    }
-  }
-  if (elision != null) {
-    parts.add(elision);
-  }
-  parts.add(penultimateString);
-  parts.add(ultimateString);
-}
diff --git a/sdk_nnbd/lib/collection/iterator.dart b/sdk_nnbd/lib/collection/iterator.dart
deleted file mode 100644
index 671f0ee..0000000
--- a/sdk_nnbd/lib/collection/iterator.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.collection;
-
-/// The [HasNextIterator] class wraps an [Iterator] and provides methods to
-/// iterate over an object using `hasNext` and `next`.
-///
-/// An [HasNextIterator] does not implement the [Iterator] interface.
-class HasNextIterator<E> {
-  static const int _HAS_NEXT_AND_NEXT_IN_CURRENT = 0;
-  static const int _NO_NEXT = 1;
-  static const int _NOT_MOVED_YET = 2;
-
-  Iterator<E> _iterator;
-  int _state = _NOT_MOVED_YET;
-
-  HasNextIterator(this._iterator);
-
-  bool get hasNext {
-    if (_state == _NOT_MOVED_YET) _move();
-    return _state == _HAS_NEXT_AND_NEXT_IN_CURRENT;
-  }
-
-  E next() {
-    // Call to hasNext is necessary to make sure we are positioned at the first
-    // element when we start iterating.
-    if (!hasNext) throw StateError("No more elements");
-    assert(_state == _HAS_NEXT_AND_NEXT_IN_CURRENT);
-    E result = _iterator.current;
-    _move();
-    return result;
-  }
-
-  void _move() {
-    if (_iterator.moveNext()) {
-      _state = _HAS_NEXT_AND_NEXT_IN_CURRENT;
-    } else {
-      _state = _NO_NEXT;
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/collection/linked_hash_map.dart b/sdk_nnbd/lib/collection/linked_hash_map.dart
deleted file mode 100644
index 9dfdb99..0000000
--- a/sdk_nnbd/lib/collection/linked_hash_map.dart
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// A hash-table based implementation of [Map].
-///
-/// The insertion order of keys is remembered,
-/// and keys are iterated in the order they were inserted into the map.
-/// Values are iterated in their corresponding key's order.
-/// Changing a key's value, when the key is already in the map,
-/// does not change the iteration order,
-/// but removing the key and adding it again
-/// will make it be last in the iteration order.
-///
-/// The keys of a `LinkedHashMap` must have consistent [Object.==]
-/// and [Object.hashCode] implementations. This means that the `==` operator
-/// must define a stable equivalence relation on the keys (reflexive,
-/// symmetric, transitive, and consistent over time), and that `hashCode`
-/// must be the same for objects that are considered equal by `==`.
-///
-/// The map allows `null` as a key.
-abstract class LinkedHashMap<K, V> implements Map<K, V> {
-  /// Creates an insertion-ordered hash-table based [Map].
-  ///
-  /// If [equals] is provided, it is used to compare the keys in the table with
-  /// new keys. If [equals] is omitted, the key's own [Object.==] is used
-  /// instead.
-  ///
-  /// Similar, if [hashCode] is provided, it is used to produce a hash value
-  /// for keys in order to place them in the hash table. If it is omitted, the
-  /// key's own [Object.hashCode] is used.
-  ///
-  /// If using methods like [operator []], [remove] and [containsKey] together
-  /// with a custom equality and hashcode, an extra `isValidKey` function
-  /// can be supplied. This function is called before calling [equals] or
-  /// [hashCode] with an argument that may not be a [K] instance, and if the
-  /// call returns false, the key is assumed to not be in the set.
-  /// The [isValidKey] function defaults to just testing if the object is a
-  /// [K] instance.
-  ///
-  /// Example:
-  ///
-  ///     new LinkedHashMap<int,int>(equals: (int a, int b) => (b - a) % 5 == 0,
-  ///                                hashCode: (int e) => e % 5)
-  ///
-  /// This example map does not need an `isValidKey` function to be passed.
-  /// The default function accepts only `int` values, which can safely be
-  /// passed to both the `equals` and `hashCode` functions.
-  ///
-  /// If neither `equals`, `hashCode`, nor `isValidKey` is provided,
-  /// the default `isValidKey` instead accepts all keys.
-  /// The default equality and hashcode operations are assumed to work on all
-  /// objects.
-  ///
-  /// Likewise, if `equals` is [identical], `hashCode` is [identityHashCode]
-  /// and `isValidKey` is omitted, the resulting map is identity based,
-  /// and the `isValidKey` defaults to accepting all keys.
-  /// Such a map can be created directly using [LinkedHashMap.identity].
-  ///
-  /// The used `equals` and `hashCode` method should always be consistent,
-  /// so that if `equals(a, b)` then `hashCode(a) == hashCode(b)`. The hash
-  /// of an object, or what it compares equal to, should not change while the
-  /// object is in the table. If it does change, the result is unpredictable.
-  ///
-  /// If you supply one of [equals] and [hashCode],
-  /// you should generally also to supply the other.
-  external factory LinkedHashMap(
-      {bool Function(K, K)? equals,
-      int Function(K)? hashCode,
-      bool Function(dynamic)? isValidKey});
-
-  /// Creates an insertion-ordered identity-based map.
-  ///
-  /// Effectively a shorthand for:
-  ///
-  ///     new LinkedHashMap<K, V>(equals: identical,
-  ///                             hashCode: identityHashCode)
-  external factory LinkedHashMap.identity();
-
-  /// Creates a [LinkedHashMap] that contains all key value pairs of [other].
-  ///
-  /// The keys must all be instances of [K] and the values to [V].
-  /// The [other] map itself can have any type.
-  factory LinkedHashMap.from(Map<dynamic, dynamic> other) {
-    LinkedHashMap<K, V> result = LinkedHashMap<K, V>();
-    other.forEach((dynamic k, dynamic v) {
-      result[k as K] = v as V;
-    });
-    return result;
-  }
-
-  /// Creates a [LinkedHashMap] that contains all key value pairs of [other].
-  factory LinkedHashMap.of(Map<K, V> other) =>
-      LinkedHashMap<K, V>()..addAll(other);
-
-  /// Creates a [LinkedHashMap] where the keys and values are computed from the
-  /// [iterable].
-  ///
-  /// For each element of the [iterable] this constructor computes a key/value
-  /// pair, by applying [key] and [value] respectively.
-  ///
-  /// The keys of the key/value pairs do not need to be unique. The last
-  /// occurrence of a key will simply overwrite any previous value.
-  ///
-  /// If no values are specified for [key] and [value] the default is the
-  /// identity function.
-  factory LinkedHashMap.fromIterable(Iterable iterable,
-      {K Function(dynamic element)? key, V Function(dynamic element)? value}) {
-    LinkedHashMap<K, V> map = LinkedHashMap<K, V>();
-    MapBase._fillMapWithMappedIterable(map, iterable, key, value);
-    return map;
-  }
-
-  /// Creates a [LinkedHashMap] associating the given [keys] to [values].
-  ///
-  /// This constructor iterates over [keys] and [values] and maps each element of
-  /// [keys] to the corresponding element of [values].
-  ///
-  /// If [keys] contains the same object multiple times, the last occurrence
-  /// overwrites the previous value.
-  ///
-  /// It is an error if the two [Iterable]s don't have the same length.
-  factory LinkedHashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
-    LinkedHashMap<K, V> map = LinkedHashMap<K, V>();
-    MapBase._fillMapWithIterables(map, keys, values);
-    return map;
-  }
-
-  /// Creates a [LinkedHashMap] containing the entries of [entries].
-  ///
-  /// Returns a new `LinkedHashMap<K, V>` where all entries of [entries]
-  /// have been added in iteration order.
-  ///
-  /// If multiple [entries] have the same key,
-  /// later occurrences overwrite the earlier ones.
-  @Since("2.1")
-  factory LinkedHashMap.fromEntries(Iterable<MapEntry<K, V>> entries) =>
-      LinkedHashMap<K, V>()..addEntries(entries);
-}
diff --git a/sdk_nnbd/lib/collection/linked_hash_set.dart b/sdk_nnbd/lib/collection/linked_hash_set.dart
deleted file mode 100644
index c4f6818..0000000
--- a/sdk_nnbd/lib/collection/linked_hash_set.dart
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// A [LinkedHashSet] is a hash-table based [Set] implementation.
-///
-/// The `LinkedHashSet` also keep track of the order that elements were inserted
-/// in, and iteration happens in first-to-last insertion order.
-///
-/// The elements of a `LinkedHashSet` must have consistent [Object.==]
-/// and [Object.hashCode] implementations. This means that the `==` operator
-/// must define a stable equivalence relation on the elements (reflexive,
-/// symmetric, transitive, and consistent over time), and that `hashCode`
-/// must be the same for objects that are considered equal by `==`.
-///
-/// The set allows `null` as an element.
-///
-/// Iteration of elements is done in element insertion order.
-/// An element that was added after another will occur later in the iteration.
-/// Adding an element that is already in the set
-/// does not change its position in the iteration order,
-/// but removing an element and adding it again,
-/// will make it the last element of an iteration.
-///
-/// Most simple operations on `HashSet` are done in (potentially amortized)
-/// constant time: [add], [contains], [remove], and [length], provided the hash
-/// codes of objects are well distributed..
-abstract class LinkedHashSet<E> implements Set<E> {
-  /// Create an insertion-ordered hash set using the provided
-  /// [equals] and [hashCode].
-  ///
-  /// The provided [equals] must define a stable equivalence relation, and
-  /// [hashCode] must be consistent with [equals]. If the [equals] or [hashCode]
-  /// methods won't work on all objects, but only on some instances of E, the
-  /// [isValidKey] predicate can be used to restrict the keys that the functions
-  /// are applied to.
-  /// Any key for which [isValidKey] returns false is automatically assumed
-  /// to not be in the set when asking `contains`.
-  ///
-  /// If [equals] or [hashCode] are omitted, the set uses
-  /// the elements' intrinsic [Object.==] and [Object.hashCode],
-  /// and [isValidKey] is ignored since these operations are assumed
-  /// to work on all objects.
-  ///
-  /// If you supply one of [equals] and [hashCode],
-  /// you should generally also to supply the other.
-  ///
-  /// If the supplied `equals` or `hashCode` functions won't work on all [E]
-  /// objects, and the map will be used in a setting where a non-`E` object
-  /// is passed to, e.g., `contains`, then the [isValidKey] function should
-  /// also be supplied.
-  ///
-  /// If [isValidKey] is omitted, it defaults to testing if the object is an
-  /// [E] instance. That means that:
-  ///
-  ///     new LinkedHashSet<int>(equals: (int e1, int e2) => (e1 - e2) % 5 == 0,
-  ///                            hashCode: (int e) => e % 5)
-  ///
-  /// does not need an `isValidKey` argument, because it defaults to only
-  /// accepting `int` values which are accepted by both `equals` and `hashCode`.
-  ///
-  /// If neither `equals`, `hashCode`, nor `isValidKey` is provided,
-  /// the default `isValidKey` instead accepts all values.
-  /// The default equality and hashcode operations are assumed to work on all
-  /// objects.
-  ///
-  /// Likewise, if `equals` is [identical], `hashCode` is [identityHashCode]
-  /// and `isValidKey` is omitted, the resulting set is identity based,
-  /// and the `isValidKey` defaults to accepting all keys.
-  /// Such a map can be created directly using [LinkedHashSet.identity].
-  external factory LinkedHashSet(
-      {bool Function(E, E)? equals,
-      int Function(E)? hashCode,
-      bool Function(dynamic)? isValidKey});
-
-  /// Creates an insertion-ordered identity-based set.
-  ///
-  /// Effectively a shorthand for:
-  ///
-  ///     new LinkedHashSet<E>(equals: identical,
-  ///                          hashCode: identityHashCode)
-  external factory LinkedHashSet.identity();
-
-  /// Create a linked hash set containing all [elements].
-  ///
-  /// Creates a linked hash set as by `new LinkedHashSet<E>()` and adds each
-  /// element of `elements` to this set in the order they are iterated.
-  ///
-  /// All the [elements] should be instances of [E].
-  /// The `elements` iterable itself may have any element type,
-  /// so this constructor can be used to down-cast a `Set`, for example as:
-  ///
-  ///     Set<SuperType> superSet = ...;
-  ///     Iterable<SuperType> tmp = superSet.where((e) => e is SubType);
-  ///     Set<SubType> subSet = new LinkedHashSet<SubType>.from(tmp);
-  factory LinkedHashSet.from(Iterable<dynamic> elements) {
-    LinkedHashSet<E> result = LinkedHashSet<E>();
-    for (final element in elements) {
-      result.add(element as E);
-    }
-    return result;
-  }
-
-  /// Create a linked hash set from [elements].
-  ///
-  /// Creates a linked hash set as by `new LinkedHashSet<E>()` and adds each
-  /// element of `elements` to this set in the order they are iterated.
-  factory LinkedHashSet.of(Iterable<E> elements) =>
-      LinkedHashSet<E>()..addAll(elements);
-
-  /// Executes a function on each element of the set.
-  ///
-  /// The elements are iterated in insertion order.
-  void forEach(void action(E element));
-
-  /// Provides an iterator that iterates over the elements in insertion order.
-  Iterator<E> get iterator;
-}
diff --git a/sdk_nnbd/lib/collection/linked_list.dart b/sdk_nnbd/lib/collection/linked_list.dart
deleted file mode 100644
index 843eedd..0000000
--- a/sdk_nnbd/lib/collection/linked_list.dart
+++ /dev/null
@@ -1,266 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// A specialized double-linked list of elements that extends [LinkedListEntry].
-///
-/// This is not a generic data structure. It only accepts elements that extend
-/// the [LinkedListEntry] class. See the [Queue] implementations for generic
-/// collections that allow constant time adding and removing at the ends.
-///
-/// This is not a [List] implementation. Despite its name, this class does not
-/// implement the [List] interface. It does not allow constant time lookup by
-/// index.
-///
-/// Because the elements themselves contain the links of this linked list,
-/// each element can be in only one list at a time. To add an element to another
-/// list, it must first be removed from its current list (if any).
-///
-/// In return, each element knows its own place in the linked list, as well as
-/// which list it is in. This allows constant time
-/// [LinkedListEntry.insertAfter], [LinkedListEntry.insertBefore] and
-/// [LinkedListEntry.unlink] operations when all you have is the element.
-///
-/// A `LinkedList` also allows constant time adding and removing at either end,
-/// and a constant time length getter.
-class LinkedList<E extends LinkedListEntry<E>> extends Iterable<E> {
-  int _modificationCount = 0;
-  int _length = 0;
-  E? _first;
-
-  /// Construct a new empty linked list.
-  LinkedList();
-
-  /// Add [entry] to the beginning of the linked list.
-  void addFirst(E entry) {
-    _insertBefore(_first, entry, updateFirst: true);
-    _first = entry;
-  }
-
-  /// Add [entry] to the end of the linked list.
-  void add(E entry) {
-    _insertBefore(_first, entry, updateFirst: false);
-  }
-
-  /// Add [entries] to the end of the linked list.
-  void addAll(Iterable<E> entries) {
-    entries.forEach(add);
-  }
-
-  /// Remove [entry] from the linked list.
-  ///
-  /// Returns false and does nothing if [entry] is not in this linked list.
-  ///
-  /// This is equivalent to calling `entry.unlink()` if the entry is in this
-  /// list.
-  bool remove(E entry) {
-    if (entry._list != this) return false;
-    _unlink(entry); // Unlink will decrement length.
-    return true;
-  }
-
-  Iterator<E> get iterator => _LinkedListIterator<E>(this);
-
-  int get length => _length;
-
-  /// Remove all elements from this linked list.
-  void clear() {
-    _modificationCount++;
-    if (isEmpty) return;
-
-    E next = _first!;
-    do {
-      E entry = next;
-      next = entry._next!;
-      entry._next = entry._previous = entry._list = null;
-    } while (!identical(next, _first));
-
-    _first = null;
-    _length = 0;
-  }
-
-  E get first {
-    if (isEmpty) {
-      throw StateError('No such element');
-    }
-    return _first!;
-  }
-
-  E get last {
-    if (isEmpty) {
-      throw StateError('No such element');
-    }
-    return _first!._previous!;
-  }
-
-  E get single {
-    if (isEmpty) {
-      throw StateError('No such element');
-    }
-    if (_length > 1) {
-      throw StateError('Too many elements');
-    }
-    return _first!;
-  }
-
-  /// Call [action] with each entry in this linked list.
-  ///
-  /// It's an error if [action] modifies the linked list.
-  void forEach(void action(E entry)) {
-    int modificationCount = _modificationCount;
-    if (isEmpty) return;
-
-    E current = _first!;
-    do {
-      action(current);
-      if (modificationCount != _modificationCount) {
-        throw ConcurrentModificationError(this);
-      }
-      current = current._next!;
-    } while (!identical(current, _first));
-  }
-
-  bool get isEmpty => _length == 0;
-
-  /// Inserts [newEntry] as last entry of the list.
-  ///
-  /// If [updateFirst] is true and [entry] is the first entry in the list,
-  /// updates the [_first] field to point to the [newEntry] as first entry.
-  void _insertBefore(E? entry, E newEntry, {required bool updateFirst}) {
-    if (newEntry.list != null) {
-      throw StateError('LinkedListEntry is already in a LinkedList');
-    }
-    _modificationCount++;
-
-    newEntry._list = this;
-    if (isEmpty) {
-      assert(entry == null);
-      newEntry._previous = newEntry._next = newEntry;
-      _first = newEntry;
-      _length++;
-      return;
-    }
-    E predecessor = entry!._previous!;
-    E successor = entry;
-    newEntry._previous = predecessor;
-    newEntry._next = successor;
-    predecessor._next = newEntry;
-    successor._previous = newEntry;
-    if (updateFirst && identical(entry, _first)) {
-      _first = newEntry;
-    }
-    _length++;
-  }
-
-  void _unlink(E entry) {
-    _modificationCount++;
-    entry._next!._previous = entry._previous;
-    E? next = entry._previous!._next = entry._next;
-    _length--;
-    entry._list = entry._next = entry._previous = null;
-    if (isEmpty) {
-      _first = null;
-    } else if (identical(entry, _first)) {
-      _first = next;
-    }
-  }
-}
-
-class _LinkedListIterator<E extends LinkedListEntry<E>> implements Iterator<E> {
-  final LinkedList<E> _list;
-  final int _modificationCount;
-  E? _current;
-  E? _next;
-  bool _visitedFirst;
-
-  _LinkedListIterator(LinkedList<E> list)
-      : _list = list,
-        _modificationCount = list._modificationCount,
-        _next = list._first,
-        _visitedFirst = false;
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-
-  bool moveNext() {
-    if (_modificationCount != _list._modificationCount) {
-      throw ConcurrentModificationError(this);
-    }
-    if (_list.isEmpty || (_visitedFirst && identical(_next, _list.first))) {
-      _current = null;
-      return false;
-    }
-    _visitedFirst = true;
-    _current = _next;
-    _next = _next!._next;
-    return true;
-  }
-}
-
-/// An object that can be an element in a [LinkedList].
-///
-/// All elements of a `LinkedList` must extend this class.
-/// The class provides the internal links that link elements together
-/// in the `LinkedList`, and a reference to the linked list itself
-/// that an element is currently part of.
-///
-/// An entry can be in at most one linked list at a time.
-/// While an entry is in a linked list, the [list] property points to that
-/// linked list, and otherwise the `list` property is `null`.
-///
-/// When created, an entry is not in any linked list.
-abstract class LinkedListEntry<E extends LinkedListEntry<E>> {
-  LinkedList<E>? _list;
-  E? _next;
-  E? _previous;
-
-  /// Get the linked list containing this element.
-  ///
-  /// Returns `null` if this entry is not currently in any list.
-  LinkedList<E>? get list => _list;
-
-  /// Unlink the element from its linked list.
-  ///
-  /// The entry must currently be in a linked list when this method is called.
-  void unlink() {
-    _list!._unlink(this as E);
-  }
-
-  /// Return the successor of this element in its linked list.
-  ///
-  /// Returns `null` if there is no successor in the linked list, or if this
-  /// entry is not currently in any list.
-  E? get next {
-    if (_list == null || identical(_list!.first, _next)) return null;
-    return _next;
-  }
-
-  /// Return the predecessor of this element in its linked list.
-  ///
-  /// Returns `null` if there is no predecessor in the linked list, or if this
-  /// entry is not currently in any list.
-  E? get previous {
-    if (_list == null || identical(this, _list!.first)) return null;
-    return _previous;
-  }
-
-  /// Insert an element after this element in this element's linked list.
-  ///
-  /// This entry must be in a linked list when this method is called.
-  /// The [entry] must not be in a linked list.
-  void insertAfter(E entry) {
-    _list!._insertBefore(_next, entry, updateFirst: false);
-  }
-
-  /// Insert an element before this element in this element's linked list.
-  ///
-  /// This entry must be in a linked list when this method is called.
-  /// The [entry] must not be in a linked list.
-  void insertBefore(E entry) {
-    _list!._insertBefore(this as E, entry, updateFirst: true);
-  }
-}
diff --git a/sdk_nnbd/lib/collection/list.dart b/sdk_nnbd/lib/collection/list.dart
deleted file mode 100644
index fdf2f8a..0000000
--- a/sdk_nnbd/lib/collection/list.dart
+++ /dev/null
@@ -1,569 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.collection;
-
-/// Abstract implementation of a list.
-///
-/// `ListBase` can be used as a base class for implementing the `List`
-/// interface.
-///
-/// All operations are defined in terms of `length`, `operator[]`,
-/// `operator[]=` and `length=`, which need to be implemented.
-///
-/// *NOTICE*: Forwarding just these four operations to a normal growable [List]
-/// (as created by `[]`) will give very bad performance for `add` and
-/// `addAll` operations of `ListBase`. These operations are implemented by
-/// increasing the length of the list by one for each `add` operation, and
-/// repeatedly increasing the length of a growable list is not efficient.
-/// To avoid this, either override 'add' and 'addAll' to also forward directly
-/// to the growable list, or, preferably, use `DelegatingList` from
-/// "package:collection/collection.dart" instead.
-abstract class ListBase<E> extends Object with ListMixin<E> {
-  /// Converts a [List] to a [String].
-  ///
-  /// Converts [list] to a string by converting each element to a string (by
-  /// calling [Object.toString]), joining them with ", ", and wrapping the
-  /// result in "[" and "]".
-  ///
-  /// Handles circular references where converting one of the elements
-  /// to a string ends up converting [list] to a string again.
-  static String listToString(List list) =>
-      IterableBase.iterableToFullString(list, '[', ']');
-}
-
-/// Base implementation of a [List] class.
-///
-/// `ListMixin` can be used as a mixin to make a class implement
-/// the `List` interface.
-///
-/// This implements all read operations using only the `length` and
-/// `operator[]` members. It implements write operations using those and
-/// `length=` and `operator[]=`
-///
-/// *NOTICE*: Forwarding just these four operations to a normal growable [List]
-/// (as created by `[]`) will give very bad performance for `add` and
-/// `addAll` operations of `ListBase`. These operations are implemented by
-/// increasing the length of the list by one for each `add` operation, and
-/// repeatedly increasing the length of a growable list is not efficient.
-/// To avoid this, either override 'add' and 'addAll' to also forward directly
-/// to the growable list, or, if possible, use `DelegatingList` from
-/// "package:collection/collection.dart" instead.
-abstract class ListMixin<E> implements List<E> {
-  // Iterable interface.
-  // TODO(lrn): When we get composable mixins, reuse IterableMixin instead
-  // of redaclating everything.
-  Iterator<E> get iterator => ListIterator<E>(this);
-
-  E elementAt(int index) => this[index];
-
-  Iterable<E> followedBy(Iterable<E> other) =>
-      FollowedByIterable<E>.firstEfficient(this, other);
-
-  void forEach(void action(E element)) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      action(this[i]);
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-  }
-
-  @pragma("vm:prefer-inline")
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  E get first {
-    if (length == 0) throw IterableElementError.noElement();
-    return this[0];
-  }
-
-  void set first(E value) {
-    if (length == 0) throw IterableElementError.noElement();
-    this[0] = value;
-  }
-
-  E get last {
-    if (length == 0) throw IterableElementError.noElement();
-    return this[length - 1];
-  }
-
-  void set last(E value) {
-    if (length == 0) throw IterableElementError.noElement();
-    this[length - 1] = value;
-  }
-
-  E get single {
-    if (length == 0) throw IterableElementError.noElement();
-    if (length > 1) throw IterableElementError.tooMany();
-    return this[0];
-  }
-
-  bool contains(Object? element) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (this[i] == element) return true;
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    return false;
-  }
-
-  bool every(bool test(E element)) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (!test(this[i])) return false;
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    return true;
-  }
-
-  bool any(bool test(E element)) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (test(this[i])) return true;
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    return false;
-  }
-
-  E firstWhere(bool test(E element), {E Function()? orElse}) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      E element = this[i];
-      if (test(element)) return element;
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E element), {E Function()? orElse}) {
-    int length = this.length;
-    for (int i = length - 1; i >= 0; i--) {
-      E element = this[i];
-      if (test(element)) return element;
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E element), {E Function()? orElse}) {
-    int length = this.length;
-    late E match;
-    bool matchFound = false;
-    for (int i = 0; i < length; i++) {
-      E element = this[i];
-      if (test(element)) {
-        if (matchFound) {
-          throw IterableElementError.tooMany();
-        }
-        matchFound = true;
-        match = element;
-      }
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    if (matchFound) return match;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  String join([String separator = ""]) {
-    if (length == 0) return "";
-    StringBuffer buffer = StringBuffer()..writeAll(this, separator);
-    return buffer.toString();
-  }
-
-  Iterable<E> where(bool test(E element)) => WhereIterable<E>(this, test);
-
-  Iterable<T> whereType<T>() => WhereTypeIterable<T>(this);
-
-  Iterable<T> map<T>(T f(E element)) => MappedListIterable<E, T>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(E element)) =>
-      ExpandIterable<E, T>(this, f);
-
-  E reduce(E combine(E previousValue, E element)) {
-    int length = this.length;
-    if (length == 0) throw IterableElementError.noElement();
-    E value = this[0];
-    for (int i = 1; i < length; i++) {
-      value = combine(value, this[i]);
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      value = combine(value, this[i]);
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    return value;
-  }
-
-  Iterable<E> skip(int count) => SubListIterable<E>(this, count, null);
-
-  Iterable<E> skipWhile(bool test(E element)) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> take(int count) => SubListIterable<E>(this, 0, count);
-
-  Iterable<E> takeWhile(bool test(E element)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  List<E> toList({bool growable = true}) {
-    if (this.isEmpty) return List<E>.empty(growable: growable);
-    var first = this[0];
-    var result = List<E>.filled(this.length, first, growable: growable);
-    for (int i = 1; i < this.length; i++) {
-      result[i] = this[i];
-    }
-    return result;
-  }
-
-  Set<E> toSet() {
-    Set<E> result = Set<E>();
-    for (int i = 0; i < length; i++) {
-      result.add(this[i]);
-    }
-    return result;
-  }
-
-  // List interface.
-  void add(E element) {
-    this[this.length++] = element;
-  }
-
-  void addAll(Iterable<E> iterable) {
-    int i = this.length;
-    for (E element in iterable) {
-      assert(this.length == i || (throw ConcurrentModificationError(this)));
-      add(element);
-      i++;
-    }
-  }
-
-  bool remove(Object? element) {
-    for (int i = 0; i < this.length; i++) {
-      if (this[i] == element) {
-        this._closeGap(i, i + 1);
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /// Removes elements from the list starting at [start] up to but not including
-  /// [end].  Arguments are pre-validated.
-  void _closeGap(int start, int end) {
-    int length = this.length;
-    assert(0 <= start);
-    assert(start < end);
-    assert(end <= length);
-    int size = end - start;
-    for (int i = end; i < length; i++) {
-      this[i - size] = this[i];
-    }
-    this.length = length - size;
-  }
-
-  void removeWhere(bool test(E element)) {
-    _filter(test, false);
-  }
-
-  void retainWhere(bool test(E element)) {
-    _filter(test, true);
-  }
-
-  void _filter(bool test(E element), bool retainMatching) {
-    List<E> retained = <E>[];
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      var element = this[i];
-      if (test(element) == retainMatching) {
-        retained.add(element);
-      }
-      if (length != this.length) {
-        throw ConcurrentModificationError(this);
-      }
-    }
-    if (retained.length != this.length) {
-      this.setRange(0, retained.length, retained);
-      this.length = retained.length;
-    }
-  }
-
-  void clear() {
-    this.length = 0;
-  }
-
-  List<R> cast<R>() => List.castFrom<E, R>(this);
-  E removeLast() {
-    if (length == 0) {
-      throw IterableElementError.noElement();
-    }
-    E result = this[length - 1];
-    length--;
-    return result;
-  }
-
-  void sort([int Function(E a, E b)? compare]) {
-    Sort.sort(this, compare ?? _compareAny);
-  }
-
-  static int _compareAny(dynamic a, dynamic b) {
-    return Comparable.compare(a as Comparable, b as Comparable);
-  }
-
-  void shuffle([Random? random]) {
-    random ??= Random();
-    if (random == null) throw "!"; // TODO(38493): The `??=` should promote.
-
-    int length = this.length;
-    while (length > 1) {
-      int pos = random.nextInt(length);
-      length -= 1;
-      var tmp = this[length];
-      this[length] = this[pos];
-      this[pos] = tmp;
-    }
-  }
-
-  Map<int, E> asMap() {
-    return ListMapView<E>(this);
-  }
-
-  List<E> operator +(List<E> other) => [...this, ...other];
-
-  List<E> sublist(int start, [int? end]) {
-    int listLength = this.length;
-    end ??= listLength;
-    if (end == null) throw "!"; // TODO(38493): The `??=` should promote.
-
-    RangeError.checkValidRange(start, end, listLength);
-    return List.from(getRange(start, end));
-  }
-
-  Iterable<E> getRange(int start, int end) {
-    RangeError.checkValidRange(start, end, this.length);
-    return SubListIterable<E>(this, start, end);
-  }
-
-  void removeRange(int start, int end) {
-    RangeError.checkValidRange(start, end, this.length);
-    if (end > start) {
-      _closeGap(start, end);
-    }
-  }
-
-  void fillRange(int start, int end, [E? fill]) {
-    // Hoist the case to fail eagerly if the user provides an invalid `null`
-    // value (or omits it) when E is a non-nullable type.
-    E value = fill as E;
-    RangeError.checkValidRange(start, end, this.length);
-    for (int i = start; i < end; i++) {
-      this[i] = value;
-    }
-  }
-
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    RangeError.checkValidRange(start, end, this.length);
-    int length = end - start;
-    if (length == 0) return;
-    RangeError.checkNotNegative(skipCount, "skipCount");
-
-    List<E> otherList;
-    int otherStart;
-    // TODO(floitsch): Make this accept more.
-    if (iterable is List<E>) {
-      otherList = iterable;
-      otherStart = skipCount;
-    } else {
-      otherList = iterable.skip(skipCount).toList(growable: false);
-      otherStart = 0;
-    }
-    if (otherStart + length > otherList.length) {
-      throw IterableElementError.tooFew();
-    }
-    if (otherStart < start) {
-      // Copy backwards to ensure correct copy if [from] is this.
-      for (int i = length - 1; i >= 0; i--) {
-        this[start + i] = otherList[otherStart + i];
-      }
-    } else {
-      for (int i = 0; i < length; i++) {
-        this[start + i] = otherList[otherStart + i];
-      }
-    }
-  }
-
-  void replaceRange(int start, int end, Iterable<E> newContents) {
-    RangeError.checkValidRange(start, end, this.length);
-    if (start == this.length) {
-      addAll(newContents);
-      return;
-    }
-    if (newContents is! EfficientLengthIterable) {
-      newContents = newContents.toList();
-    }
-    int removeLength = end - start;
-    int insertLength = newContents.length;
-    if (removeLength >= insertLength) {
-      int insertEnd = start + insertLength;
-      this.setRange(start, insertEnd, newContents);
-      if (removeLength > insertLength) {
-        _closeGap(insertEnd, end);
-      }
-    } else if (end == this.length) {
-      int i = start;
-      for (E element in newContents) {
-        if (i < end) {
-          this[i] = element;
-        } else {
-          add(element);
-        }
-        i++;
-      }
-    } else {
-      int delta = insertLength - removeLength;
-      int oldLength = this.length;
-      int insertEnd = start + insertLength; // aka. end + delta.
-      for (int i = oldLength - delta; i < oldLength; ++i) {
-        add(this[i > 0 ? i : 0]);
-      }
-      if (insertEnd < oldLength) {
-        this.setRange(insertEnd, oldLength, this, end);
-      }
-      this.setRange(start, insertEnd, newContents);
-    }
-  }
-
-  int indexOf(Object? element, [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < this.length; i++) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int indexWhere(bool test(E element), [int start = 0]) {
-    if (start < 0) start = 0;
-    for (int i = start; i < this.length; i++) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexOf(Object? element, [int? start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-
-    // TODO(38493): The previous line should promote.
-    if (start == null) throw "!";
-
-    for (int i = start; i >= 0; i--) {
-      if (this[i] == element) return i;
-    }
-    return -1;
-  }
-
-  int lastIndexWhere(bool test(E element), [int? start]) {
-    if (start == null || start >= this.length) start = this.length - 1;
-
-    // TODO(38493): The previous line should promote.
-    if (start == null) throw "!";
-
-    for (int i = start; i >= 0; i--) {
-      if (test(this[i])) return i;
-    }
-    return -1;
-  }
-
-  void insert(int index, E element) {
-    ArgumentError.checkNotNull(index, "index");
-    RangeError.checkValueInInterval(index, 0, length, "index");
-    if (index == this.length) {
-      add(element);
-      return;
-    }
-    this.length++;
-    setRange(index + 1, this.length, this, index);
-    this[index] = element;
-  }
-
-  E removeAt(int index) {
-    E result = this[index];
-    _closeGap(index, index + 1);
-    return result;
-  }
-
-  void insertAll(int index, Iterable<E> iterable) {
-    RangeError.checkValueInInterval(index, 0, length, "index");
-    if (index == length) {
-      addAll(iterable);
-      return;
-    }
-    if (iterable is! EfficientLengthIterable || identical(iterable, this)) {
-      iterable = iterable.toList();
-    }
-    int insertionLength = iterable.length;
-    if (insertionLength == 0) {
-      return;
-    }
-    // There might be errors after the length change, in which case the list
-    // will end up being modified but the operation not complete. Unless we
-    // always go through a "toList" we can't really avoid that.
-    int oldLength = length;
-    for (int i = oldLength - insertionLength; i < oldLength; ++i) {
-      add(this[i > 0 ? i : 0]);
-    }
-    if (iterable.length != insertionLength) {
-      // If the iterable's length is linked to this list's length somehow,
-      // we can't insert one in the other.
-      this.length -= insertionLength;
-      throw ConcurrentModificationError(iterable);
-    }
-    int oldCopyStart = index + insertionLength;
-    if (oldCopyStart < oldLength) {
-      setRange(oldCopyStart, oldLength, this, index);
-    }
-    setAll(index, iterable);
-  }
-
-  void setAll(int index, Iterable<E> iterable) {
-    if (iterable is List) {
-      setRange(index, index + iterable.length, iterable);
-    } else {
-      for (E element in iterable) {
-        this[index++] = element;
-      }
-    }
-  }
-
-  Iterable<E> get reversed => ReversedListIterable<E>(this);
-
-  String toString() => IterableBase.iterableToFullString(this, '[', ']');
-}
diff --git a/sdk_nnbd/lib/collection/maps.dart b/sdk_nnbd/lib/collection/maps.dart
deleted file mode 100644
index 85a3155..0000000
--- a/sdk_nnbd/lib/collection/maps.dart
+++ /dev/null
@@ -1,388 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.collection;
-
-/// Base class for implementing a [Map].
-///
-/// This class has a basic implementation of all but five of the members of
-/// [Map].
-/// A basic `Map` class can be implemented by extending this class and
-/// implementing `keys`, `operator[]`, `operator[]=`, `remove` and `clear`.
-/// The remaining operations are implemented in terms of these five.
-///
-/// The `keys` iterable should have efficient [Iterable.length] and
-/// [Iterable.contains] operations, and it should catch concurrent modifications
-/// of the keys while iterating.
-///
-/// A more efficient implementation is usually possible by overriding
-/// some of the other members as well.
-abstract class MapBase<K, V> extends MapMixin<K, V> {
-  static String mapToString(Map<Object?, Object?> m) {
-    // Reuses the list in IterableBase for detecting toString cycles.
-    if (_isToStringVisiting(m)) {
-      return '{...}';
-    }
-
-    var result = StringBuffer();
-    try {
-      _toStringVisiting.add(m);
-      result.write('{');
-      bool first = true;
-      m.forEach((Object? k, Object? v) {
-        if (!first) {
-          result.write(', ');
-        }
-        first = false;
-        result.write(k);
-        result.write(': ');
-        result.write(v);
-      });
-      result.write('}');
-    } finally {
-      assert(identical(_toStringVisiting.last, m));
-      _toStringVisiting.removeLast();
-    }
-
-    return result.toString();
-  }
-
-  static Object? _id(Object? x) => x;
-
-  /// Fills a [Map] with key/value pairs computed from [iterable].
-  ///
-  /// This method is used by [Map] classes in the named constructor
-  /// `fromIterable`.
-  static void _fillMapWithMappedIterable(
-      Map<Object?, Object?> map,
-      Iterable<Object?> iterable,
-      Object? Function(Object? element)? key,
-      Object? Function(Object? element)? value) {
-    key ??= _id;
-    value ??= _id;
-
-    if (key == null) throw "!"; // TODO(38493): The `??=` should promote.
-    if (value == null) throw "!"; // TODO(38493): The `??=` should promote.
-
-    for (var element in iterable) {
-      map[key(element)] = value(element);
-    }
-  }
-
-  /// Fills a map by associating the [keys] to [values].
-  ///
-  /// This method is used by [Map] classes in the named constructor
-  /// `fromIterables`.
-  static void _fillMapWithIterables(Map<Object?, Object?> map,
-      Iterable<Object?> keys, Iterable<Object?> values) {
-    Iterator<Object?> keyIterator = keys.iterator;
-    Iterator<Object?> valueIterator = values.iterator;
-
-    bool hasNextKey = keyIterator.moveNext();
-    bool hasNextValue = valueIterator.moveNext();
-
-    while (hasNextKey && hasNextValue) {
-      map[keyIterator.current] = valueIterator.current;
-      hasNextKey = keyIterator.moveNext();
-      hasNextValue = valueIterator.moveNext();
-    }
-
-    if (hasNextKey || hasNextValue) {
-      throw ArgumentError("Iterables do not have same length.");
-    }
-  }
-}
-
-/// Mixin implementing a [Map].
-///
-/// This mixin has a basic implementation of all but five of the members of
-/// [Map].
-/// A basic `Map` class can be implemented by mixin in this class and
-/// implementing `keys`, `operator[]`, `operator[]=`, `remove` and `clear`.
-/// The remaining operations are implemented in terms of these five.
-///
-/// The `keys` iterable should have efficient [Iterable.length] and
-/// [Iterable.contains] operations, and it should catch concurrent modifications
-/// of the keys while iterating.
-///
-/// A more efficient implementation is usually possible by overriding
-/// some of the other members as well.
-abstract class MapMixin<K, V> implements Map<K, V> {
-  Iterable<K> get keys;
-  V? operator [](Object? key);
-  operator []=(K key, V value);
-  V? remove(Object? key);
-  // The `clear` operation should not be based on `remove`.
-  // It should clear the map even if some keys are not equal to themselves.
-  void clear();
-
-  Map<RK, RV> cast<RK, RV>() => Map.castFrom<K, V, RK, RV>(this);
-  void forEach(void action(K key, V value)) {
-    for (K key in keys) {
-      action(key, this[key] as V);
-    }
-  }
-
-  void addAll(Map<K, V> other) {
-    for (K key in other.keys) {
-      this[key] = other[key] as V;
-    }
-  }
-
-  bool containsValue(Object? value) {
-    for (K key in keys) {
-      if (this[key] == value) return true;
-    }
-    return false;
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    if (containsKey(key)) {
-      return this[key] as V;
-    }
-    return this[key] = ifAbsent();
-  }
-
-  V update(K key, V update(V value), {V Function()? ifAbsent}) {
-    if (this.containsKey(key)) {
-      return this[key] = update(this[key] as V);
-    }
-    if (ifAbsent != null) {
-      return this[key] = ifAbsent();
-    }
-    throw ArgumentError.value(key, "key", "Key not in map.");
-  }
-
-  void updateAll(V update(K key, V value)) {
-    for (var key in this.keys) {
-      this[key] = update(key, this[key] as V);
-    }
-  }
-
-  Iterable<MapEntry<K, V>> get entries {
-    return keys.map((K key) => MapEntry<K, V>(key, this[key] as V));
-  }
-
-  Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(K key, V value)) {
-    var result = <K2, V2>{};
-    for (var key in this.keys) {
-      var entry = transform(key, this[key] as V);
-      result[entry.key] = entry.value;
-    }
-    return result;
-  }
-
-  void addEntries(Iterable<MapEntry<K, V>> newEntries) {
-    for (var entry in newEntries) {
-      this[entry.key] = entry.value;
-    }
-  }
-
-  void removeWhere(bool test(K key, V value)) {
-    var keysToRemove = <K>[];
-    for (var key in keys) {
-      if (test(key, this[key] as V)) keysToRemove.add(key);
-    }
-    for (var key in keysToRemove) {
-      this.remove(key);
-    }
-  }
-
-  bool containsKey(Object? key) => keys.contains(key);
-  int get length => keys.length;
-  bool get isEmpty => keys.isEmpty;
-  bool get isNotEmpty => keys.isNotEmpty;
-  Iterable<V> get values => _MapBaseValueIterable<K, V>(this);
-  String toString() => MapBase.mapToString(this);
-}
-
-/// Basic implementation of an unmodifiable [Map].
-///
-/// This class has a basic implementation of all but two of the members of
-/// an umodifiable [Map].
-/// A simple unmodifiable `Map` class can be implemented by extending this
-/// class and implementing `keys` and `operator[]`.
-///
-/// Modifying operations throw when used.
-/// The remaining non-modifying operations are implemented in terms of `keys`
-/// and `operator[]`.
-///
-/// The `keys` iterable should have efficient [Iterable.length] and
-/// [Iterable.contains] operations, and it should catch concurrent modifications
-/// of the keys while iterating.
-///
-/// A more efficient implementation is usually possible by overriding
-/// some of the other members as well.
-abstract class UnmodifiableMapBase<K, V> = MapBase<K, V>
-    with _UnmodifiableMapMixin<K, V>;
-
-/// Implementation of [Map.values] based on the map and its [Map.keys] iterable.
-///
-/// Iterable that iterates over the values of a `Map`.
-/// It accesses the values by iterating over the keys of the map, and using the
-/// map's `operator[]` to lookup the keys.
-class _MapBaseValueIterable<K, V> extends EfficientLengthIterable<V> {
-  final Map<K, V> _map;
-  _MapBaseValueIterable(this._map);
-
-  int get length => _map.length;
-  bool get isEmpty => _map.isEmpty;
-  bool get isNotEmpty => _map.isNotEmpty;
-  V get first => _map[_map.keys.first] as V;
-  V get single => _map[_map.keys.single] as V;
-  V get last => _map[_map.keys.last] as V;
-
-  Iterator<V> get iterator => _MapBaseValueIterator<K, V>(_map);
-}
-
-/// Iterator created by [_MapBaseValueIterable].
-///
-/// Iterates over the values of a map by iterating its keys and lookup up the
-/// values.
-class _MapBaseValueIterator<K, V> implements Iterator<V> {
-  final Iterator<K> _keys;
-  final Map<K, V> _map;
-  V? _current;
-
-  _MapBaseValueIterator(Map<K, V> map)
-      : _map = map,
-        _keys = map.keys.iterator;
-
-  bool moveNext() {
-    if (_keys.moveNext()) {
-      _current = _map[_keys.current];
-      return true;
-    }
-    _current = null;
-    return false;
-  }
-
-  V get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as V;
-  }
-}
-
-/// Mixin that overrides mutating map operations with implementations that
-/// throw.
-abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {
-  /// This operation is not supported by an unmodifiable map.
-  void operator []=(K key, V value) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  void addAll(Map<K, V> other) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  void addEntries(Iterable<MapEntry<K, V>> entries) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  void clear() {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  V remove(Object? key) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  void removeWhere(bool test(K key, V value)) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  V putIfAbsent(K key, V ifAbsent()) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  V update(K key, V update(V value), {V Function()? ifAbsent}) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-
-  /// This operation is not supported by an unmodifiable map.
-  void updateAll(V update(K key, V value)) {
-    throw UnsupportedError("Cannot modify unmodifiable map");
-  }
-}
-
-/// Wrapper around a class that implements [Map] that only exposes `Map`
-/// members.
-///
-/// A simple wrapper that delegates all `Map` members to the map provided in the
-/// constructor.
-///
-/// Base for delegating map implementations like [UnmodifiableMapView].
-class MapView<K, V> implements Map<K, V> {
-  final Map<K, V> _map;
-  const MapView(Map<K, V> map) : _map = map;
-
-  Map<RK, RV> cast<RK, RV>() => _map.cast<RK, RV>();
-  V? operator [](Object? key) => _map[key];
-  void operator []=(K key, V value) {
-    _map[key] = value;
-  }
-
-  void addAll(Map<K, V> other) {
-    _map.addAll(other);
-  }
-
-  void clear() {
-    _map.clear();
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) => _map.putIfAbsent(key, ifAbsent);
-  bool containsKey(Object? key) => _map.containsKey(key);
-  bool containsValue(Object? value) => _map.containsValue(value);
-  void forEach(void action(K key, V value)) {
-    _map.forEach(action);
-  }
-
-  bool get isEmpty => _map.isEmpty;
-  bool get isNotEmpty => _map.isNotEmpty;
-  int get length => _map.length;
-  Iterable<K> get keys => _map.keys;
-  V? remove(Object? key) => _map.remove(key);
-  String toString() => _map.toString();
-  Iterable<V> get values => _map.values;
-
-  Iterable<MapEntry<K, V>> get entries => _map.entries;
-
-  void addEntries(Iterable<MapEntry<K, V>> entries) {
-    _map.addEntries(entries);
-  }
-
-  Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(K key, V value)) =>
-      _map.map<K2, V2>(transform);
-
-  V update(K key, V update(V value), {V Function()? ifAbsent}) =>
-      _map.update(key, update, ifAbsent: ifAbsent);
-
-  void updateAll(V update(K key, V value)) {
-    _map.updateAll(update);
-  }
-
-  void removeWhere(bool test(K key, V value)) {
-    _map.removeWhere(test);
-  }
-}
-
-/// View of a [Map] that disallow modifying the map.
-///
-/// A wrapper around a `Map` that forwards all members to the map provided in
-/// the constructor, except for operations that modify the map.
-/// Modifying operations throw instead.
-class UnmodifiableMapView<K, V> extends MapView<K, V>
-    with _UnmodifiableMapMixin<K, V> {
-  UnmodifiableMapView(Map<K, V> map) : super(map);
-
-  Map<RK, RV> cast<RK, RV>() =>
-      UnmodifiableMapView<RK, RV>(_map.cast<RK, RV>());
-}
diff --git a/sdk_nnbd/lib/collection/queue.dart b/sdk_nnbd/lib/collection/queue.dart
deleted file mode 100644
index 26abbfe..0000000
--- a/sdk_nnbd/lib/collection/queue.dart
+++ /dev/null
@@ -1,919 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.collection;
-
-/// A [Queue] is a collection that can be manipulated at both ends. One
-/// can iterate over the elements of a queue through [forEach] or with
-/// an [Iterator].
-///
-/// It is generally not allowed to modify the queue (add or remove entries)
-/// while an operation on the queue is being performed, for example during a
-/// call to [forEach].
-/// Modifying the queue while it is being iterated will most likely break the
-/// iteration.
-/// This goes both for using the [iterator] directly, or for iterating an
-/// `Iterable` returned by a method like [map] or [where].
-abstract class Queue<E> implements EfficientLengthIterable<E> {
-  /// Creates a queue.
-  factory Queue() = ListQueue<E>;
-
-  /// Creates a queue containing all [elements].
-  ///
-  /// The element order in the queue is as if the elements were added using
-  /// [addLast] in the order provided by [elements.iterator].
-  ///
-  /// All the [elements] should be instances of [E].
-  /// The `elements` iterable itself may have any element type, so this
-  /// constructor can be used to down-cast a `Queue`, for example as:
-  /// ```dart
-  /// Queue<SuperType> superQueue = ...;
-  /// Queue<SubType> subQueue =
-  ///     new Queue<SubType>.from(superQueue.whereType<SubType>());
-  /// ```
-  factory Queue.from(Iterable elements) = ListQueue<E>.from;
-
-  /// Creates a queue from [elements].
-  ///
-  /// The element order in the queue is as if the elements were added using
-  /// [addLast] in the order provided by [elements.iterator].
-  factory Queue.of(Iterable<E> elements) = ListQueue<E>.of;
-
-  /// Adapts [source] to be a `Queue<T>`.
-  ///
-  /// Any time the queue would produce an element that is not a [T],
-  /// the element access will throw.
-  ///
-  /// Any time a [T] value is attempted stored into the adapted queue,
-  /// the store will throw unless the value is also an instance of [S].
-  ///
-  /// If all accessed elements of [source] are actually instances of [T],
-  /// and if all elements stored into the returned queue are actually instance
-  /// of [S],
-  /// then the returned queue can be used as a `Queue<T>`.
-  static Queue<T> castFrom<S, T>(Queue<S> source) => CastQueue<S, T>(source);
-
-  /// Provides a view of this queue as a queue of [R] instances, if necessary.
-  ///
-  /// If this queue contains only instances of [R], all read operations
-  /// will work correctly. If any operation tries to access an element
-  /// that is not an instance of [R], the access will throw instead.
-  ///
-  /// Elements added to the queue (e.g., by using [addFirst] or [addAll])
-  /// must be instance of [R] to be valid arguments to the adding function,
-  /// and they must be instances of [E] as well to be accepted by
-  /// this queue as well.
-  Queue<R> cast<R>();
-
-  /// Removes and returns the first element of this queue.
-  ///
-  /// The queue must not be empty when this method is called.
-  E removeFirst();
-
-  /// Removes and returns the last element of the queue.
-  ///
-  /// The queue must not be empty when this method is called.
-  E removeLast();
-
-  /// Adds [value] at the beginning of the queue.
-  void addFirst(E value);
-
-  /// Adds [value] at the end of the queue.
-  void addLast(E value);
-
-  /// Adds [value] at the end of the queue.
-  void add(E value);
-
-  /// Remove a single instance of [value] from the queue.
-  ///
-  /// Returns `true` if a value was removed, or `false` if the queue
-  /// contained no element equal to [value].
-  bool remove(Object? value);
-
-  /// Adds all elements of [iterable] at the end of the queue. The
-  /// length of the queue is extended by the length of [iterable].
-  void addAll(Iterable<E> iterable);
-
-  /// Removes all elements matched by [test] from the queue.
-  ///
-  /// The `test` function must not throw or modify the queue.
-  void removeWhere(bool test(E element));
-
-  /// Removes all elements not matched by [test] from the queue.
-  ///
-  /// The `test` function must not throw or modify the queue.
-  void retainWhere(bool test(E element));
-
-  /// Removes all elements in the queue. The size of the queue becomes zero.
-  void clear();
-}
-
-class _DoubleLink<Link extends _DoubleLink<Link>> {
-  Link? _previousLink;
-  Link? _nextLink;
-
-  void _link(Link? previous, Link? next) {
-    _nextLink = next;
-    _previousLink = previous;
-    if (previous != null) previous._nextLink = this as Link;
-    if (next != null) next._previousLink = this as Link;
-  }
-
-  void _unlink() {
-    if (_previousLink != null) _previousLink!._nextLink = _nextLink;
-    if (_nextLink != null) _nextLink!._previousLink = _previousLink;
-    _nextLink = null;
-    _previousLink = null;
-  }
-}
-
-/// An entry in a doubly linked list. It contains a pointer to the next
-/// entry, the previous entry, and the boxed element.
-class DoubleLinkedQueueEntry<E> extends _DoubleLink<DoubleLinkedQueueEntry<E>> {
-  // TODO(rnystrom): This needs to be nullable because the subclass
-  // _DoubleLinkedQueueSentinel does not have an element. A cleaner solution is
-  // probably to refactor the class hierarchy so that _DoubleLinkedQueueSentinel
-  // does not inherit an element field.
-  E? _element;
-
-  /// The element in the queue.
-  E get element => _element as E;
-  set element(E element) {
-    _element = element;
-  }
-
-  DoubleLinkedQueueEntry(this._element);
-
-  /// Appends the given [e] as entry just after this entry.
-  void append(E e) {
-    DoubleLinkedQueueEntry<E>(e)._link(this, _nextLink);
-  }
-
-  /// Prepends the given [e] as entry just before this entry.
-  void prepend(E e) {
-    DoubleLinkedQueueEntry<E>(e)._link(_previousLink, this);
-  }
-
-  E remove() {
-    _unlink();
-    return element;
-  }
-
-  /// Returns the previous entry or `null` if there is none.
-  DoubleLinkedQueueEntry<E>? previousEntry() => _previousLink;
-
-  /// Returns the next entry or `null` if there is none.
-  DoubleLinkedQueueEntry<E>? nextEntry() => _nextLink;
-}
-
-/// Interface for the link classes used by [DoubleLinkedQueue].
-///
-/// Both the [_DoubleLinkedQueueElement] and [_DoubleLinkedQueueSentinel]
-/// implement this interface.
-/// The entry contains a link back to the queue, so calling `append`
-/// or `prepend` can correctly update the element count.
-abstract class _DoubleLinkedQueueEntry<E> extends DoubleLinkedQueueEntry<E> {
-  DoubleLinkedQueue<E>? _queue;
-  _DoubleLinkedQueueEntry(E? element, this._queue) : super(element);
-
-  DoubleLinkedQueueEntry<E>? _asNonSentinelEntry();
-
-  void _append(E e) {
-    _DoubleLinkedQueueElement<E>(e, _queue)._link(this, _nextLink);
-  }
-
-  void _prepend(E e) {
-    _DoubleLinkedQueueElement<E>(e, _queue)._link(_previousLink, this);
-  }
-
-  E _remove();
-
-  E get _element => super._element as E;
-
-  DoubleLinkedQueueEntry<E>? nextEntry() {
-    _DoubleLinkedQueueEntry<E> entry = _nextLink as _DoubleLinkedQueueEntry<E>;
-    return entry._asNonSentinelEntry();
-  }
-
-  DoubleLinkedQueueEntry<E>? previousEntry() {
-    _DoubleLinkedQueueEntry<E> entry =
-        _previousLink as _DoubleLinkedQueueEntry<E>;
-    return entry._asNonSentinelEntry();
-  }
-}
-
-/// The actual entry type used by the [DoubleLinkedQueue].
-///
-/// The entry contains a reference to the queue, allowing
-/// [append]/[prepend] to update the list length.
-class _DoubleLinkedQueueElement<E> extends _DoubleLinkedQueueEntry<E> {
-  _DoubleLinkedQueueElement(E element, DoubleLinkedQueue<E>? queue)
-      : super(element, queue);
-
-  void append(E e) {
-    _append(e);
-    if (_queue != null) _queue!._elementCount++;
-  }
-
-  void prepend(E e) {
-    _prepend(e);
-    if (_queue != null) _queue!._elementCount++;
-  }
-
-  E _remove() {
-    _queue = null;
-    _unlink();
-    return element;
-  }
-
-  E remove() {
-    if (_queue != null) _queue!._elementCount--;
-    return _remove();
-  }
-
-  _DoubleLinkedQueueElement<E>? _asNonSentinelEntry() {
-    return this;
-  }
-}
-
-/// A sentinel in a double linked list is used to manipulate the list
-/// at both ends.
-/// A double linked list has exactly one sentinel,
-/// which is the only entry when the list is constructed.
-/// Initially, a sentinel has its next and previous entry point to itself.
-/// A sentinel does not box any user element.
-class _DoubleLinkedQueueSentinel<E> extends _DoubleLinkedQueueEntry<E> {
-  _DoubleLinkedQueueSentinel(DoubleLinkedQueue<E> queue) : super(null, queue) {
-    _previousLink = this;
-    _nextLink = this;
-  }
-
-  DoubleLinkedQueueEntry<E>? _asNonSentinelEntry() {
-    return null;
-  }
-
-  /// Hit by, e.g., [DoubleLinkedQueue.removeFirst] if the queue is empty.
-  E _remove() {
-    throw IterableElementError.noElement();
-  }
-
-  /// Hit by, e.g., [DoubleLinkedQueue.first] if the queue is empty.
-  E get _element {
-    throw IterableElementError.noElement();
-  }
-}
-
-/// A [Queue] implementation based on a double-linked list.
-///
-/// Allows constant time add, remove-at-ends and peek operations.
-class DoubleLinkedQueue<E> extends Iterable<E> implements Queue<E> {
-  late _DoubleLinkedQueueSentinel<E> _sentinel =
-      _DoubleLinkedQueueSentinel<E>(this);
-
-  int _elementCount = 0;
-
-  DoubleLinkedQueue();
-
-  /// Creates a double-linked queue containing all [elements].
-  ///
-  /// The element order in the queue is as if the elements were added using
-  /// [addLast] in the order provided by [elements.iterator].
-  ///
-  /// All the [elements] should be instances of [E].
-  /// The `elements` iterable itself may have any element type, so this
-  /// constructor can be used to down-cast a `Queue`, for example as:
-  /// ```dart
-  /// Queue<SuperType> superQueue = ...;
-  /// Queue<SubType> subQueue =
-  ///     new DoubleLinkedQueue<SubType>.from(superQueue.whereType<SubType>());
-  /// ```
-  factory DoubleLinkedQueue.from(Iterable<dynamic> elements) {
-    DoubleLinkedQueue<E> list = DoubleLinkedQueue<E>();
-    for (final e in elements) {
-      list.addLast(e as E);
-    }
-    return list;
-  }
-
-  /// Creates a double-linked queue from [elements].
-  ///
-  /// The element order in the queue is as if the elements were added using
-  /// [addLast] in the order provided by [elements.iterator].
-  factory DoubleLinkedQueue.of(Iterable<E> elements) =>
-      DoubleLinkedQueue<E>()..addAll(elements);
-
-  Queue<R> cast<R>() => Queue.castFrom<E, R>(this);
-  int get length => _elementCount;
-
-  void addLast(E value) {
-    _sentinel._prepend(value);
-    _elementCount++;
-  }
-
-  void addFirst(E value) {
-    _sentinel._append(value);
-    _elementCount++;
-  }
-
-  void add(E value) {
-    _sentinel._prepend(value);
-    _elementCount++;
-  }
-
-  void addAll(Iterable<E> iterable) {
-    for (final E value in iterable) {
-      _sentinel._prepend(value);
-      _elementCount++;
-    }
-  }
-
-  E removeLast() {
-    _DoubleLinkedQueueEntry<E> lastEntry =
-        _sentinel._previousLink as _DoubleLinkedQueueEntry<E>;
-    E result = lastEntry._remove();
-    _elementCount--;
-    return result;
-  }
-
-  E removeFirst() {
-    _DoubleLinkedQueueEntry<E> firstEntry =
-        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
-    E result = firstEntry._remove();
-    _elementCount--;
-    return result;
-  }
-
-  bool remove(Object? o) {
-    _DoubleLinkedQueueEntry<E> entry =
-        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
-    while (!identical(entry, _sentinel)) {
-      bool equals = (entry._element == o);
-      if (!identical(this, entry._queue)) {
-        // Entry must still be in the queue.
-        throw ConcurrentModificationError(this);
-      }
-      if (equals) {
-        entry._remove();
-        _elementCount--;
-        return true;
-      }
-      entry = entry._nextLink as _DoubleLinkedQueueEntry<E>;
-    }
-    return false;
-  }
-
-  void _filter(bool test(E element), bool removeMatching) {
-    _DoubleLinkedQueueEntry<E> entry =
-        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
-    while (!identical(entry, _sentinel)) {
-      bool matches = test(entry._element);
-      if (!identical(this, entry._queue)) {
-        // Entry must still be in the queue.
-        throw ConcurrentModificationError(this);
-      }
-      DoubleLinkedQueueEntry<E> next = entry._nextLink!; // Cannot be null.
-      if (identical(removeMatching, matches)) {
-        entry._remove();
-        _elementCount--;
-      }
-      entry = next as _DoubleLinkedQueueEntry<E>;
-    }
-  }
-
-  void removeWhere(bool test(E element)) {
-    _filter(test, true);
-  }
-
-  void retainWhere(bool test(E element)) {
-    _filter(test, false);
-  }
-
-  E get first {
-    DoubleLinkedQueueEntry<E> firstEntry = _sentinel._nextLink!;
-    return firstEntry._element as E;
-  }
-
-  E get last {
-    DoubleLinkedQueueEntry<E> lastEntry = _sentinel._previousLink!;
-    return lastEntry._element as E;
-  }
-
-  E get single {
-    // Note that this throws correctly if the queue is empty
-    // because reading the element of the sentinel throws.
-    if (identical(_sentinel._nextLink, _sentinel._previousLink)) {
-      DoubleLinkedQueueEntry<E> entry = _sentinel._nextLink!;
-      return entry._element as E;
-    }
-    throw IterableElementError.tooMany();
-  }
-
-  /// The entry object of the first element in the queue.
-  ///
-  /// Each element of the queue has an associated [DoubleLinkedQueueEntry].
-  ///
-  /// Returns the entry object corresponding to the first element of the queue,
-  /// or `null` if the queue is empty.
-  ///
-  /// The entry objects can also be accessed using [lastEntry],
-  /// and they can be iterated using [DoubleLinkedQueueEntry.nextEntry] and
-  /// [DoubleLinkedQueueEntry.previousEntry].
-  DoubleLinkedQueueEntry<E>? firstEntry() {
-    return _sentinel.nextEntry();
-  }
-
-  /// The entry object of the last element in the queue.
-  ///
-  /// Each element of the queue has an associated [DoubleLinkedQueueEntry].
-  ///
-  /// Returns the entry object corresponding to the last element of the queue,
-  /// or `null` if the queue is empty.
-  ///
-  /// The entry objects can also be accessed using [firstEntry],
-  /// and they can be iterated using [DoubleLinkedQueueEntry.nextEntry] and
-  /// [DoubleLinkedQueueEntry.previousEntry].
-  DoubleLinkedQueueEntry<E>? lastEntry() {
-    return _sentinel.previousEntry();
-  }
-
-  bool get isEmpty {
-    return (identical(_sentinel._nextLink, _sentinel));
-  }
-
-  void clear() {
-    _sentinel._nextLink = _sentinel;
-    _sentinel._previousLink = _sentinel;
-    _elementCount = 0;
-  }
-
-  /// Calls [action] for each entry object of this double-linked queue.
-  ///
-  /// Each element of the queue has an associated [DoubleLinkedQueueEntry].
-  /// This method iterates the entry objects from first to last and calls
-  /// [action] with each object in turn.
-  ///
-  /// The entry objects can also be accessed using [firstEntry] and [lastEntry],
-  /// and iterated using [DoubleLinkedQueueEntry.nextEntry()] and
-  /// [DoubleLinkedQueueEntry.previousEntry()].
-  ///
-  /// The [action] function can use methods on [DoubleLinkedQueueEntry] to
-  /// remove the entry or it can insert elements before or after then entry.
-  /// If the current entry is removed, iteration continues with the entry that
-  /// was following the current entry when [action] was called. Any elements
-  /// inserted after the current element before it is removed will not be
-  /// visited by the iteration.
-  void forEachEntry(void action(DoubleLinkedQueueEntry<E> element)) {
-    _DoubleLinkedQueueEntry<E> entry =
-        _sentinel._nextLink as _DoubleLinkedQueueEntry<E>;
-    while (!identical(entry, _sentinel)) {
-      _DoubleLinkedQueueElement<E> element =
-          entry as _DoubleLinkedQueueElement<E>;
-      _DoubleLinkedQueueEntry<E> next =
-          element._nextLink as _DoubleLinkedQueueEntry<E>;
-      // Remember both entry and entry._nextLink.
-      // If someone calls `element.remove()` we continue from `next`.
-      // Otherwise we use the value of entry._nextLink which may have been
-      // updated.
-      action(element);
-      if (identical(this, entry._queue)) {
-        next = entry._nextLink as _DoubleLinkedQueueEntry<E>;
-      } else if (!identical(this, next._queue)) {
-        throw ConcurrentModificationError(this);
-      }
-      entry = next;
-    }
-  }
-
-  _DoubleLinkedQueueIterator<E> get iterator {
-    return _DoubleLinkedQueueIterator<E>(_sentinel);
-  }
-
-  String toString() => IterableBase.iterableToFullString(this, '{', '}');
-}
-
-class _DoubleLinkedQueueIterator<E> implements Iterator<E> {
-  _DoubleLinkedQueueSentinel<E>? _sentinel;
-  DoubleLinkedQueueEntry<E>? _nextEntry;
-  E? _current;
-
-  _DoubleLinkedQueueIterator(_DoubleLinkedQueueSentinel<E> sentinel)
-      : _sentinel = sentinel,
-        _nextEntry = sentinel._nextLink;
-
-  bool moveNext() {
-    if (identical(_nextEntry, _sentinel)) {
-      _current = null;
-      _nextEntry = null;
-      _sentinel = null;
-      return false;
-    }
-    _DoubleLinkedQueueEntry<E> elementEntry =
-        _nextEntry as _DoubleLinkedQueueEntry<E>;
-    if (!identical(_sentinel!._queue, elementEntry._queue)) {
-      throw ConcurrentModificationError(_sentinel!._queue);
-    }
-    _current = elementEntry._element;
-    _nextEntry = elementEntry._nextLink;
-    return true;
-  }
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-}
-
-/// List based [Queue].
-///
-/// Keeps a cyclic buffer of elements, and grows to a larger buffer when
-/// it fills up. This guarantees constant time peek and remove operations, and
-/// amortized constant time add operations.
-///
-/// The structure is efficient for any queue or stack usage.
-class ListQueue<E> extends ListIterable<E> implements Queue<E> {
-  static const int _INITIAL_CAPACITY = 8;
-  List<E?> _table;
-  int _head;
-  int _tail;
-  int _modificationCount = 0;
-
-  /// Create an empty queue.
-  ///
-  /// If [initialCapacity] is given, prepare the queue for at least that many
-  /// elements.
-  ListQueue([int? initialCapacity])
-      : _head = 0,
-        _tail = 0,
-        _table = List<E?>.filled(_calculateCapacity(initialCapacity), null);
-
-  static int _calculateCapacity(int? initialCapacity) {
-    if (initialCapacity == null || initialCapacity < _INITIAL_CAPACITY) {
-      return _INITIAL_CAPACITY;
-    } else if (!_isPowerOf2(initialCapacity)) {
-      return _nextPowerOf2(initialCapacity);
-    }
-    assert(_isPowerOf2(initialCapacity));
-    return initialCapacity;
-  }
-
-  /// Create a `ListQueue` containing all [elements].
-  ///
-  /// The elements are added to the queue, as by [addLast], in the order given
-  /// by `elements.iterator`.
-  ///
-  /// All the [elements] should be instances of [E].
-  /// The `elements` iterable itself may have any element type, so this
-  /// constructor can be used to down-cast a `Queue`, for example as:
-  /// ```dart
-  /// Queue<SuperType> superQueue = ...;
-  /// Queue<SubType> subQueue =
-  ///     new ListQueue<SubType>.from(superQueue.whereType<SubType>());
-  /// ```
-  factory ListQueue.from(Iterable<dynamic> elements) {
-    if (elements is List<dynamic>) {
-      int length = elements.length;
-      ListQueue<E> queue = ListQueue<E>(length + 1);
-      assert(queue._table.length > length);
-      for (int i = 0; i < length; i++) {
-        queue._table[i] = elements[i] as E;
-      }
-      queue._tail = length;
-      return queue;
-    } else {
-      int capacity = _INITIAL_CAPACITY;
-      if (elements is EfficientLengthIterable) {
-        capacity = elements.length;
-      }
-      ListQueue<E> result = ListQueue<E>(capacity);
-      for (final element in elements) {
-        result.addLast(element as E);
-      }
-      return result;
-    }
-  }
-
-  /// Create a `ListQueue` from [elements].
-  ///
-  /// The elements are added to the queue, as by [addLast], in the order given
-  /// by `elements.iterator`.
-  factory ListQueue.of(Iterable<E> elements) =>
-      ListQueue<E>()..addAll(elements);
-
-  // Iterable interface.
-
-  Queue<R> cast<R>() => Queue.castFrom<E, R>(this);
-  Iterator<E> get iterator => _ListQueueIterator<E>(this);
-
-  void forEach(void f(E element)) {
-    int modificationCount = _modificationCount;
-    for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
-      f(_table[i] as E);
-      _checkModification(modificationCount);
-    }
-  }
-
-  bool get isEmpty => _head == _tail;
-
-  int get length => (_tail - _head) & (_table.length - 1);
-
-  E get first {
-    if (_head == _tail) throw IterableElementError.noElement();
-    return _table[_head] as E;
-  }
-
-  E get last {
-    if (_head == _tail) throw IterableElementError.noElement();
-    return _table[(_tail - 1) & (_table.length - 1)] as E;
-  }
-
-  E get single {
-    if (_head == _tail) throw IterableElementError.noElement();
-    if (length > 1) throw IterableElementError.tooMany();
-    return _table[_head] as E;
-  }
-
-  E elementAt(int index) {
-    RangeError.checkValidIndex(index, this);
-    return _table[(_head + index) & (_table.length - 1)] as E;
-  }
-
-  List<E> toList({bool growable = true}) {
-    int mask = _table.length - 1;
-    int length = (_tail - _head) & mask;
-    if (length == 0) return List<E>.empty(growable: growable);
-
-    var list = List<E>.filled(length, first, growable: growable);
-    for (int i = 0; i < length; i++) {
-      list[i] = _table[(_head + i) & mask] as E;
-    }
-    return list;
-  }
-
-  // Collection interface.
-
-  void add(E value) {
-    _add(value);
-  }
-
-  void addAll(Iterable<E> elements) {
-    if (elements is List<E>) {
-      List<E> list = elements;
-      int addCount = list.length;
-      int length = this.length;
-      if (length + addCount >= _table.length) {
-        _preGrow(length + addCount);
-        // After preGrow, all elements are at the start of the list.
-        _table.setRange(length, length + addCount, list, 0);
-        _tail += addCount;
-      } else {
-        // Adding addCount elements won't reach _head.
-        int endSpace = _table.length - _tail;
-        if (addCount < endSpace) {
-          _table.setRange(_tail, _tail + addCount, list, 0);
-          _tail += addCount;
-        } else {
-          int preSpace = addCount - endSpace;
-          _table.setRange(_tail, _tail + endSpace, list, 0);
-          _table.setRange(0, preSpace, list, endSpace);
-          _tail = preSpace;
-        }
-      }
-      _modificationCount++;
-    } else {
-      for (E element in elements) _add(element);
-    }
-  }
-
-  bool remove(Object? value) {
-    for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
-      E? element = _table[i];
-      if (element == value) {
-        _remove(i);
-        _modificationCount++;
-        return true;
-      }
-    }
-    return false;
-  }
-
-  void _filterWhere(bool test(E element), bool removeMatching) {
-    int modificationCount = _modificationCount;
-    int i = _head;
-    while (i != _tail) {
-      E element = _table[i] as E;
-      bool remove = identical(removeMatching, test(element));
-      _checkModification(modificationCount);
-      if (remove) {
-        i = _remove(i);
-        modificationCount = ++_modificationCount;
-      } else {
-        i = (i + 1) & (_table.length - 1);
-      }
-    }
-  }
-
-  /// Remove all elements matched by [test].
-  ///
-  /// This method is inefficient since it works by repeatedly removing single
-  /// elements, each of which can take linear time.
-  void removeWhere(bool test(E element)) {
-    _filterWhere(test, true);
-  }
-
-  /// Remove all elements not matched by [test].
-  ///
-  /// This method is inefficient since it works by repeatedly removing single
-  /// elements, each of which can take linear time.
-  void retainWhere(bool test(E element)) {
-    _filterWhere(test, false);
-  }
-
-  void clear() {
-    if (_head != _tail) {
-      for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
-        _table[i] = null;
-      }
-      _head = _tail = 0;
-      _modificationCount++;
-    }
-  }
-
-  String toString() => IterableBase.iterableToFullString(this, "{", "}");
-
-  // Queue interface.
-
-  void addLast(E value) {
-    _add(value);
-  }
-
-  void addFirst(E value) {
-    _head = (_head - 1) & (_table.length - 1);
-    _table[_head] = value;
-    if (_head == _tail) _grow();
-    _modificationCount++;
-  }
-
-  E removeFirst() {
-    if (_head == _tail) throw IterableElementError.noElement();
-    _modificationCount++;
-    E result = _table[_head] as E;
-    _table[_head] = null;
-    _head = (_head + 1) & (_table.length - 1);
-    return result;
-  }
-
-  E removeLast() {
-    if (_head == _tail) throw IterableElementError.noElement();
-    _modificationCount++;
-    _tail = (_tail - 1) & (_table.length - 1);
-    E result = _table[_tail] as E;
-    _table[_tail] = null;
-    return result;
-  }
-
-  // Internal helper functions.
-
-  /// Whether [number] is a power of two.
-  ///
-  /// Only works for positive numbers.
-  static bool _isPowerOf2(int number) => (number & (number - 1)) == 0;
-
-  /// Rounds [number] up to the nearest power of 2.
-  ///
-  /// If [number] is a power of 2 already, it is returned.
-  ///
-  /// Only works for positive numbers.
-  static int _nextPowerOf2(int number) {
-    assert(number > 0);
-    number = (number << 1) - 1;
-    for (;;) {
-      int nextNumber = number & (number - 1);
-      if (nextNumber == 0) return number;
-      number = nextNumber;
-    }
-  }
-
-  /// Check if the queue has been modified during iteration.
-  void _checkModification(int expectedModificationCount) {
-    if (expectedModificationCount != _modificationCount) {
-      throw ConcurrentModificationError(this);
-    }
-  }
-
-  /// Adds element at end of queue. Used by both [add] and [addAll].
-  void _add(E element) {
-    _table[_tail] = element;
-    _tail = (_tail + 1) & (_table.length - 1);
-    if (_head == _tail) _grow();
-    _modificationCount++;
-  }
-
-  /// Removes the element at [offset] into [_table].
-  ///
-  /// Removal is performed by linearly moving elements either before or after
-  /// [offset] by one position.
-  ///
-  /// Returns the new offset of the following element. This may be the same
-  /// offset or the following offset depending on how elements are moved
-  /// to fill the hole.
-  int _remove(int offset) {
-    int mask = _table.length - 1;
-    int startDistance = (offset - _head) & mask;
-    int endDistance = (_tail - offset) & mask;
-    if (startDistance < endDistance) {
-      // Closest to start.
-      int i = offset;
-      while (i != _head) {
-        int prevOffset = (i - 1) & mask;
-        _table[i] = _table[prevOffset];
-        i = prevOffset;
-      }
-      _table[_head] = null;
-      _head = (_head + 1) & mask;
-      return (offset + 1) & mask;
-    } else {
-      _tail = (_tail - 1) & mask;
-      int i = offset;
-      while (i != _tail) {
-        int nextOffset = (i + 1) & mask;
-        _table[i] = _table[nextOffset];
-        i = nextOffset;
-      }
-      _table[_tail] = null;
-      return offset;
-    }
-  }
-
-  /// Grow the table when full.
-  void _grow() {
-    List<E?> newTable = List<E?>.filled(_table.length * 2, null);
-    int split = _table.length - _head;
-    newTable.setRange(0, split, _table, _head);
-    newTable.setRange(split, split + _head, _table, 0);
-    _head = 0;
-    _tail = _table.length;
-    _table = newTable;
-  }
-
-  int _writeToList(List<E?> target) {
-    assert(target.length >= length);
-    if (_head <= _tail) {
-      int length = _tail - _head;
-      target.setRange(0, length, _table, _head);
-      return length;
-    } else {
-      int firstPartSize = _table.length - _head;
-      target.setRange(0, firstPartSize, _table, _head);
-      target.setRange(firstPartSize, firstPartSize + _tail, _table, 0);
-      return _tail + firstPartSize;
-    }
-  }
-
-  /// Grows the table even if it is not full.
-  void _preGrow(int newElementCount) {
-    assert(newElementCount >= length);
-
-    // Add some extra room to ensure that there's room for more elements after
-    // expansion.
-    newElementCount += newElementCount >> 1;
-    int newCapacity = _nextPowerOf2(newElementCount);
-    List<E?> newTable = List<E?>.filled(newCapacity, null);
-    _tail = _writeToList(newTable);
-    _table = newTable;
-    _head = 0;
-  }
-}
-
-/// Iterator for a [ListQueue].
-///
-/// Considers any add or remove operation a concurrent modification.
-class _ListQueueIterator<E> implements Iterator<E> {
-  final ListQueue<E> _queue;
-  final int _end;
-  final int _modificationCount;
-  int _position;
-  E? _current;
-
-  _ListQueueIterator(ListQueue<E> queue)
-      : _queue = queue,
-        _end = queue._tail,
-        _modificationCount = queue._modificationCount,
-        _position = queue._head;
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-
-  bool moveNext() {
-    _queue._checkModification(_modificationCount);
-    if (_position == _end) {
-      _current = null;
-      return false;
-    }
-    _current = _queue._table[_position];
-    _position = (_position + 1) & (_queue._table.length - 1);
-    return true;
-  }
-}
diff --git a/sdk_nnbd/lib/collection/set.dart b/sdk_nnbd/lib/collection/set.dart
deleted file mode 100644
index 1eb7491..0000000
--- a/sdk_nnbd/lib/collection/set.dart
+++ /dev/null
@@ -1,626 +0,0 @@
-// Copyright (c) 2014, 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.
-
-/// Base implementations of [Set].
-part of dart.collection;
-
-/// Mixin implementation of [Set].
-///
-/// This class provides a base implementation of a `Set` that depends only
-/// on the abstract members: [add], [contains], [lookup], [remove],
-/// [iterator], [length] and [toSet].
-///
-/// Some of the methods assume that `toSet` creates a modifiable set.
-/// If using this mixin for an unmodifiable set,
-/// where `toSet` should return an unmodifiable set,
-/// it's necessary to reimplement
-/// [retainAll], [union], [intersection] and [difference].
-///
-/// Implementations of `Set` using this mixin should consider also implementing
-/// `clear` in constant time. The default implementation works by removing every
-/// element.
-abstract class SetMixin<E> implements Set<E> {
-  // This class reimplements all of [IterableMixin].
-  // If/when Dart mixins get more powerful, we should just create a single
-  // Mixin class from IterableMixin and the new methods of this class.
-
-  bool add(E value);
-
-  bool contains(Object? element);
-
-  E? lookup(Object? element);
-
-  bool remove(Object? value);
-
-  Iterator<E> get iterator;
-
-  Set<E> toSet();
-
-  int get length;
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => length != 0;
-
-  Set<R> cast<R>() => Set.castFrom<E, R>(this);
-  Iterable<E> followedBy(Iterable<E> other) =>
-      FollowedByIterable<E>.firstEfficient(this, other);
-
-  Iterable<T> whereType<T>() => WhereTypeIterable<T>(this);
-
-  void clear() {
-    removeAll(toList());
-  }
-
-  void addAll(Iterable<E> elements) {
-    for (E element in elements) add(element);
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    for (Object? element in elements) remove(element);
-  }
-
-  void retainAll(Iterable<Object?> elements) {
-    // Create a copy of the set, remove all of elements from the copy,
-    // then remove all remaining elements in copy from this.
-    Set<E> toRemove = toSet();
-    for (Object? o in elements) {
-      toRemove.remove(o);
-    }
-    removeAll(toRemove);
-  }
-
-  void removeWhere(bool test(E element)) {
-    List<Object?> toRemove = [];
-    for (E element in this) {
-      if (test(element)) toRemove.add(element);
-    }
-    removeAll(toRemove);
-  }
-
-  void retainWhere(bool test(E element)) {
-    List<Object?> toRemove = [];
-    for (E element in this) {
-      if (!test(element)) toRemove.add(element);
-    }
-    removeAll(toRemove);
-  }
-
-  bool containsAll(Iterable<Object?> other) {
-    for (var o in other) {
-      if (!contains(o)) return false;
-    }
-    return true;
-  }
-
-  Set<E> union(Set<E> other) {
-    return toSet()..addAll(other);
-  }
-
-  Set<E> intersection(Set<Object?> other) {
-    Set<E> result = toSet();
-    for (E element in this) {
-      if (!other.contains(element)) result.remove(element);
-    }
-    return result;
-  }
-
-  Set<E> difference(Set<Object?> other) {
-    Set<E> result = toSet();
-    for (E element in this) {
-      if (other.contains(element)) result.remove(element);
-    }
-    return result;
-  }
-
-  List<E> toList({bool growable = true}) =>
-      List<E>.of(this, growable: growable);
-
-  Iterable<T> map<T>(T f(E element)) =>
-      EfficientLengthMappedIterable<E, T>(this, f);
-
-  E get single {
-    if (length > 1) throw IterableElementError.tooMany();
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) throw IterableElementError.noElement();
-    E result = it.current;
-    return result;
-  }
-
-  String toString() => IterableBase.iterableToFullString(this, '{', '}');
-
-  // Copied from IterableMixin.
-  // Should be inherited if we had multi-level mixins.
-
-  Iterable<E> where(bool f(E element)) => WhereIterable<E>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(E element)) =>
-      ExpandIterable<E, T>(this, f);
-
-  void forEach(void f(E element)) {
-    for (E element in this) f(element);
-  }
-
-  E reduce(E combine(E value, E element)) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E value = iterator.current;
-    while (iterator.moveNext()) {
-      value = combine(value, iterator.current);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    for (E element in this) value = combine(value, element);
-    return value;
-  }
-
-  bool every(bool f(E element)) {
-    for (E element in this) {
-      if (!f(element)) return false;
-    }
-    return true;
-  }
-
-  String join([String separator = ""]) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) return "";
-    StringBuffer buffer = StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write(iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      buffer.write(iterator.current);
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write(iterator.current);
-      }
-    }
-    return buffer.toString();
-  }
-
-  bool any(bool test(E element)) {
-    for (E element in this) {
-      if (test(element)) return true;
-    }
-    return false;
-  }
-
-  Iterable<E> take(int n) {
-    return TakeIterable<E>(this, n);
-  }
-
-  Iterable<E> takeWhile(bool test(E value)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> skip(int n) {
-    return SkipIterable<E>(this, n);
-  }
-
-  Iterable<E> skipWhile(bool test(E value)) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  E get first {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    return it.current;
-  }
-
-  E get last {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E result;
-    do {
-      result = it.current;
-    } while (it.moveNext());
-    return result;
-  }
-
-  E firstWhere(bool test(E value), {E Function()? orElse}) {
-    for (E element in this) {
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    ArgumentError.checkNotNull(index, "index");
-    RangeError.checkNotNegative(index, "index");
-    int elementIndex = 0;
-    for (E element in this) {
-      if (index == elementIndex) return element;
-      elementIndex++;
-    }
-    throw RangeError.index(index, this, "index", null, elementIndex);
-  }
-}
-
-/// Base implementation of [Set].
-///
-/// This class provides a base implementation of a `Set` that depends only
-/// on the abstract members: [add], [contains], [lookup], [remove],
-/// [iterator], [length] and [toSet].
-///
-/// Some of the methods assume that `toSet` creates a modifiable set.
-/// If using this base class for an unmodifiable set,
-/// where `toSet` should return an unmodifiable set,
-/// it's necessary to reimplement
-/// [retainAll], [union], [intersection] and [difference].
-///
-/// Implementations of `Set` using this base should consider also implementing
-/// `clear` in constant time. The default implementation works by removing every
-/// element.
-abstract class SetBase<E> extends Object with SetMixin<E> {
-  /// Converts a [Set] to a [String].
-  ///
-  /// Converts [set] to a string by converting each element to a string (by
-  /// calling [Object.toString]), joining them with ", ", and wrapping the
-  /// result in "{" and "}".
-  ///
-  /// Handles circular references where converting one of the elements
-  /// to a string ends up converting [set] to a string again.
-  static String setToString(Set set) =>
-      IterableBase.iterableToFullString(set, '{', '}');
-}
-
-/// Common internal implementation of some [Set] methods.
-// TODO(35548): Make this mix-in SetMixin, by adding `with SetMixin<E>`
-// and removing the copied members below,
-// when analyzer supports const constructors for mixin applications.
-abstract class _SetBase<E> implements Set<E> {
-  // The following two methods override the ones in SetBase.
-  // It's possible to be more efficient if we have a way to create an empty
-  // set of the correct type.
-  const _SetBase();
-
-  Set<E> _newSet();
-
-  Set<R> _newSimilarSet<R>();
-
-  Set<R> cast<R>() => Set.castFrom<E, R>(this, newSet: _newSimilarSet);
-
-  Set<E> difference(Set<Object?> other) {
-    Set<E> result = _newSet();
-    for (var element in this) {
-      if (!other.contains(element)) result.add(element);
-    }
-    return result;
-  }
-
-  Set<E> intersection(Set<Object?> other) {
-    Set<E> result = _newSet();
-    for (var element in this) {
-      if (other.contains(element)) result.add(element);
-    }
-    return result;
-  }
-
-  // Subclasses can optimize this further.
-  Set<E> toSet() => _newSet()..addAll(this);
-
-  /// TODO(35548): Remove the following declarations again when the analyzer
-  /// supports mixins with const constructors, and mix in `SetMixin` instead.
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => length != 0;
-
-  Iterable<E> followedBy(Iterable<E> other) =>
-      FollowedByIterable<E>.firstEfficient(this, other);
-
-  Iterable<T> whereType<T>() => WhereTypeIterable<T>(this);
-
-  void clear() {
-    removeAll(toList());
-  }
-
-  void addAll(Iterable<E> elements) {
-    for (E element in elements) add(element);
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    for (Object? element in elements) remove(element);
-  }
-
-  void retainAll(Iterable<Object?> elements) {
-    // Create a copy of the set, remove all of elements from the copy,
-    // then remove all remaining elements in copy from this.
-    Set<E> toRemove = toSet();
-    for (Object? o in elements) {
-      toRemove.remove(o);
-    }
-    removeAll(toRemove);
-  }
-
-  void removeWhere(bool test(E element)) {
-    List<Object?> toRemove = [];
-    for (E element in this) {
-      if (test(element)) toRemove.add(element);
-    }
-    removeAll(toRemove);
-  }
-
-  void retainWhere(bool test(E element)) {
-    List<Object?> toRemove = [];
-    for (E element in this) {
-      if (!test(element)) toRemove.add(element);
-    }
-    removeAll(toRemove);
-  }
-
-  bool containsAll(Iterable<Object?> other) {
-    for (Object? o in other) {
-      if (!contains(o)) return false;
-    }
-    return true;
-  }
-
-  Set<E> union(Set<E> other) {
-    return toSet()..addAll(other);
-  }
-
-  List<E> toList({bool growable = true}) =>
-      List<E>.of(this, growable: growable);
-
-  Iterable<T> map<T>(T f(E element)) =>
-      EfficientLengthMappedIterable<E, T>(this, f);
-
-  E get single {
-    if (length > 1) throw IterableElementError.tooMany();
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) throw IterableElementError.noElement();
-    E result = it.current;
-    return result;
-  }
-
-  String toString() => IterableBase.iterableToFullString(this, '{', '}');
-
-  Iterable<E> where(bool f(E element)) => WhereIterable<E>(this, f);
-
-  Iterable<T> expand<T>(Iterable<T> f(E element)) =>
-      ExpandIterable<E, T>(this, f);
-
-  void forEach(void f(E element)) {
-    for (E element in this) f(element);
-  }
-
-  E reduce(E combine(E value, E element)) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E value = iterator.current;
-    while (iterator.moveNext()) {
-      value = combine(value, iterator.current);
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    for (E element in this) value = combine(value, element);
-    return value;
-  }
-
-  bool every(bool f(E element)) {
-    for (E element in this) {
-      if (!f(element)) return false;
-    }
-    return true;
-  }
-
-  String join([String separator = ""]) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) return "";
-    StringBuffer buffer = StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write(iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      buffer.write(iterator.current);
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write(iterator.current);
-      }
-    }
-    return buffer.toString();
-  }
-
-  bool any(bool test(E element)) {
-    for (E element in this) {
-      if (test(element)) return true;
-    }
-    return false;
-  }
-
-  Iterable<E> take(int n) {
-    return TakeIterable<E>(this, n);
-  }
-
-  Iterable<E> takeWhile(bool test(E value)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  Iterable<E> skip(int n) {
-    return SkipIterable<E>(this, n);
-  }
-
-  Iterable<E> skipWhile(bool test(E value)) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  E get first {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    return it.current;
-  }
-
-  E get last {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E result;
-    do {
-      result = it.current;
-    } while (it.moveNext());
-    return result;
-  }
-
-  E firstWhere(bool test(E value), {E Function()? orElse}) {
-    for (E element in this) {
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E value), {E Function()? orElse}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    ArgumentError.checkNotNull(index, "index");
-    RangeError.checkNotNegative(index, "index");
-    int elementIndex = 0;
-    for (E element in this) {
-      if (index == elementIndex) return element;
-      elementIndex++;
-    }
-    throw RangeError.index(index, this, "index", null, elementIndex);
-  }
-}
-
-/// Class used to implement const sets.
-class _UnmodifiableSet<E> extends _SetBase<E> {
-  final Map<E, Null> _map;
-
-  const _UnmodifiableSet(this._map);
-
-  Set<E> _newSet() => LinkedHashSet<E>();
-
-  Set<R> _newSimilarSet<R>() => LinkedHashSet<R>();
-
-  // Lookups use map methods.
-
-  bool contains(Object? element) => _map.containsKey(element);
-
-  Iterator<E> get iterator => _map.keys.iterator;
-
-  int get length => _map.length;
-
-  E? lookup(Object? element) {
-    for (var key in _map.keys) {
-      if (key == element) return key;
-    }
-    return null;
-  }
-
-  // Mutating methods throw.
-
-  bool add(E value) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  void clear() {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  void addAll(Iterable<E> elements) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  void retainAll(Iterable<Object?> elements) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  void removeWhere(bool test(E element)) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  void retainWhere(bool test(E element)) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-
-  bool remove(Object? value) {
-    throw UnsupportedError("Cannot change unmodifiable set");
-  }
-}
diff --git a/sdk_nnbd/lib/collection/splay_tree.dart b/sdk_nnbd/lib/collection/splay_tree.dart
deleted file mode 100644
index a019b64..0000000
--- a/sdk_nnbd/lib/collection/splay_tree.dart
+++ /dev/null
@@ -1,918 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.collection;
-
-typedef _Predicate<T> = bool Function(T value);
-
-/// A node in a splay tree. It holds the sorting key and the left
-/// and right children in the tree.
-class _SplayTreeNode<K, Node extends _SplayTreeNode<K, Node>> {
-  final K key;
-
-  Node? left;
-  Node? right;
-
-  _SplayTreeNode(this.key);
-}
-
-/// A node in a splay tree based set.
-class _SplayTreeSetNode<K> extends _SplayTreeNode<K, _SplayTreeSetNode<K>> {
-  _SplayTreeSetNode(K key) : super(key);
-}
-
-/// A node in a splay tree based map.
-///
-/// A [_SplayTreeNode] that also contains a value
-class _SplayTreeMapNode<K, V>
-    extends _SplayTreeNode<K, _SplayTreeMapNode<K, V>> {
-  V value;
-  _SplayTreeMapNode(K key, this.value) : super(key);
-}
-
-/// A splay tree is a self-balancing binary search tree.
-///
-/// It has the additional property that recently accessed elements
-/// are quick to access again.
-/// It performs basic operations such as insertion, look-up and
-/// removal, in O(log(n)) amortized time.
-abstract class _SplayTree<K, Node extends _SplayTreeNode<K, Node>> {
-  // The root node of the splay tree. It will contain either the last
-  // element inserted or the last element looked up.
-  Node? get _root;
-  set _root(Node? newValue);
-
-  // Number of elements in the splay tree.
-  int _count = 0;
-
-  /// Counter incremented whenever the keys in the map changes.
-  ///
-  /// Used to detect concurrent modifications.
-  int _modificationCount = 0;
-
-  /// Counter incremented whenever the tree structure changes.
-  ///
-  /// Used to detect that an in-place traversal cannot use
-  /// cached information that relies on the tree structure.
-  int _splayCount = 0;
-
-  /// The comparator that is used for this splay tree.
-  Comparator<K> get _compare;
-
-  /// The predicate to determine that a given object is a valid key.
-  _Predicate get _validKey;
-
-  /// Perform the splay operation for the given key. Moves the node with
-  /// the given key to the top of the tree.  If no node has the given
-  /// key, the last node on the search path is moved to the top of the
-  /// tree. This is the simplified top-down splaying algorithm from:
-  /// "Self-adjusting Binary Search Trees" by Sleator and Tarjan.
-  ///
-  /// Returns the result of comparing the new root of the tree to [key].
-  /// Returns -1 if the table is empty.
-  int _splay(K key) {
-    if (_root == null) return -1;
-
-    // The right and newTreeRight variables start out null, and are set
-    // after the first move left.  The right node is the destination
-    // for subsequent left rebalances, and newTreeRight holds the left
-    // child of the final tree.  The newTreeRight variable is set at most
-    // once, after the first move left, and is null iff right is null.
-    // The left and newTreeLeft variables play the corresponding role for
-    // right rebalances.
-    Node? right;
-    Node? newTreeRight;
-    Node? left;
-    Node? newTreeLeft;
-    var current = _root!;
-    // Hoist the field read out of the loop.
-    var compare = _compare;
-    int comp;
-    while (true) {
-      comp = compare(current.key, key);
-      if (comp > 0) {
-        var currentLeft = current.left;
-        if (currentLeft == null) break;
-        comp = compare(currentLeft.key, key);
-        if (comp > 0) {
-          // Rotate right.
-          current.left = currentLeft.right;
-          currentLeft.right = current;
-          current = currentLeft;
-          currentLeft = current.left;
-          if (currentLeft == null) break;
-        }
-        // Link right.
-        if (right == null) {
-          // First left rebalance, store the eventual right child
-          newTreeRight = current;
-        } else {
-          right.left = current;
-        }
-        right = current;
-        current = currentLeft;
-      } else if (comp < 0) {
-        var currentRight = current.right;
-        if (currentRight == null) break;
-        comp = compare(currentRight.key, key);
-        if (comp < 0) {
-          // Rotate left.
-          current.right = currentRight.left;
-          currentRight.left = current;
-          current = currentRight;
-          currentRight = current.right;
-          if (currentRight == null) break;
-        }
-        // Link left.
-        if (left == null) {
-          // First right rebalance, store the eventual left child
-          newTreeLeft = current;
-        } else {
-          left.right = current;
-        }
-        left = current;
-        current = currentRight;
-      } else {
-        break;
-      }
-    }
-    // Assemble.
-    if (left != null) {
-      left.right = current.left;
-      current.left = newTreeLeft;
-    }
-    if (right != null) {
-      right.left = current.right;
-      current.right = newTreeRight;
-    }
-    _root = current;
-
-    _splayCount++;
-    return comp;
-  }
-
-  // Emulates splaying with a key that is smaller than any in the subtree
-  // anchored at [node].
-  // and that node is returned. It should replace the reference to [node]
-  // in any parent tree or root pointer.
-  Node _splayMin(Node node) {
-    var current = node;
-    var nextLeft = current.left;
-    while (nextLeft != null) {
-      var left = nextLeft;
-      current.left = left.right;
-      left.right = current;
-      current = left;
-      nextLeft = current.left;
-    }
-    return current;
-  }
-
-  // Emulates splaying with a key that is greater than any in the subtree
-  // anchored at [node].
-  // After this, the largest element in the tree is the root of the subtree,
-  // and that node is returned. It should replace the reference to [node]
-  // in any parent tree or root pointer.
-  Node _splayMax(Node node) {
-    var current = node;
-    var nextRight = current.right;
-    while (nextRight != null) {
-      var right = nextRight;
-      current.right = right.left;
-      right.left = current;
-      current = right;
-      nextRight = current.right;
-    }
-    return current;
-  }
-
-  Node? _remove(K key) {
-    if (_root == null) return null;
-    int comp = _splay(key);
-    if (comp != 0) return null;
-    var root = _root!;
-    var result = root;
-    var left = root.left;
-    _count--;
-    // assert(_count >= 0);
-    if (left == null) {
-      _root = root.right;
-    } else {
-      var right = root.right;
-      // Splay to make sure that the new root has an empty right child.
-      root = _splayMax(left);
-
-      // Insert the original right child as the right child of the new
-      // root.
-      root.right = right;
-      _root = root;
-    }
-    _modificationCount++;
-    return result;
-  }
-
-  /// Adds a new root node with the given [key] or [value].
-  ///
-  /// The [comp] value is the result of comparing the existing root's key
-  /// with key.
-  void _addNewRoot(Node node, int comp) {
-    _count++;
-    _modificationCount++;
-    var root = _root;
-    if (root == null) {
-      _root = node;
-      return;
-    }
-    // assert(_count >= 0);
-    if (comp < 0) {
-      node.left = root;
-      node.right = root.right;
-      root.right = null;
-    } else {
-      node.right = root;
-      node.left = root.left;
-      root.left = null;
-    }
-    _root = node;
-  }
-
-  Node? get _first {
-    var root = _root;
-    if (root == null) return null;
-    _root = _splayMin(root);
-    return _root;
-  }
-
-  Node? get _last {
-    var root = _root;
-    if (root == null) return null;
-    _root = _splayMax(root);
-    return _root;
-  }
-
-  void _clear() {
-    _root = null;
-    _count = 0;
-    _modificationCount++;
-  }
-}
-
-int _dynamicCompare(dynamic a, dynamic b) => Comparable.compare(a, b);
-
-Comparator<K> _defaultCompare<K>() {
-  // If K <: Comparable, then we can just use Comparable.compare
-  // with no casts.
-  Object compare = Comparable.compare;
-  if (compare is Comparator<K>) {
-    return compare;
-  }
-  // Otherwise wrap and cast the arguments on each call.
-  return _dynamicCompare;
-}
-
-/// A [Map] of objects that can be ordered relative to each other.
-///
-/// The map is based on a self-balancing binary tree. It allows most operations
-/// in amortized logarithmic time.
-///
-/// Keys of the map are compared using the `compare` function passed in
-/// the constructor, both for ordering and for equality.
-/// If the map contains only the key `a`, then `map.containsKey(b)`
-/// will return `true` if and only if `compare(a, b) == 0`,
-/// and the value of `a == b` is not even checked.
-/// If the compare function is omitted, the objects are assumed to be
-/// [Comparable], and are compared using their [Comparable.compareTo] method.
-/// Non-comparable objects (including `null`) will not work as keys
-/// in that case.
-///
-/// To allow calling [operator []], [remove] or [containsKey] with objects
-/// that are not supported by the `compare` function, an extra `isValidKey`
-/// predicate function can be supplied. This function is tested before
-/// using the `compare` function on an argument value that may not be a [K]
-/// value. If omitted, the `isValidKey` function defaults to testing if the
-/// value is a [K].
-class SplayTreeMap<K, V> extends _SplayTree<K, _SplayTreeMapNode<K, V>>
-    with MapMixin<K, V> {
-  _SplayTreeMapNode<K, V>? _root;
-
-  Comparator<K> _compare;
-  _Predicate _validKey;
-
-  SplayTreeMap(
-      [int Function(K key1, K key2)? compare,
-      bool Function(dynamic potentialKey)? isValidKey])
-      : _compare = compare ?? _defaultCompare<K>(),
-        _validKey = isValidKey ?? ((dynamic v) => v is K);
-
-  /// Creates a [SplayTreeMap] that contains all key/value pairs of [other].
-  ///
-  /// The keys must all be instances of [K] and the values of [V].
-  /// The [other] map itself can have any type.
-  factory SplayTreeMap.from(Map<dynamic, dynamic> other,
-      [int Function(K key1, K key2)? compare,
-      bool Function(dynamic potentialKey)? isValidKey]) {
-    if (other is Map<K, V>) {
-      return SplayTreeMap<K, V>.of(other, compare, isValidKey);
-    }
-    SplayTreeMap<K, V> result = SplayTreeMap<K, V>(compare, isValidKey);
-    other.forEach((dynamic k, dynamic v) {
-      result[k] = v;
-    });
-    return result;
-  }
-
-  /// Creates a [SplayTreeMap] that contains all key/value pairs of [other].
-  factory SplayTreeMap.of(Map<K, V> other,
-          [int Function(K key1, K key2)? compare,
-          bool Function(dynamic potentialKey)? isValidKey]) =>
-      SplayTreeMap<K, V>(compare, isValidKey)..addAll(other);
-
-  /// Creates a [SplayTreeMap] where the keys and values are computed from the
-  /// [iterable].
-  ///
-  /// For each element of the [iterable] this constructor computes a key/value
-  /// pair, by applying [key] and [value] respectively.
-  ///
-  /// The keys of the key/value pairs do not need to be unique. The last
-  /// occurrence of a key will simply overwrite any previous value.
-  ///
-  /// If no functions are specified for [key] and [value] the default is to
-  /// use the iterable value itself.
-  factory SplayTreeMap.fromIterable(Iterable iterable,
-      {K Function(dynamic element)? key,
-      V Function(dynamic element)? value,
-      int Function(K key1, K key2)? compare,
-      bool Function(dynamic potentialKey)? isValidKey}) {
-    SplayTreeMap<K, V> map = SplayTreeMap<K, V>(compare, isValidKey);
-    MapBase._fillMapWithMappedIterable(map, iterable, key, value);
-    return map;
-  }
-
-  /// Creates a [SplayTreeMap] associating the given [keys] to [values].
-  ///
-  /// This constructor iterates over [keys] and [values] and maps each element
-  /// of [keys] to the corresponding element of [values].
-  ///
-  /// If [keys] contains the same object multiple times, the last occurrence
-  /// overwrites the previous value.
-  ///
-  /// It is an error if the two [Iterable]s don't have the same length.
-  factory SplayTreeMap.fromIterables(Iterable<K> keys, Iterable<V> values,
-      [int Function(K key1, K key2)? compare,
-      bool Function(dynamic potentialKey)? isValidKey]) {
-    SplayTreeMap<K, V> map = SplayTreeMap<K, V>(compare, isValidKey);
-    MapBase._fillMapWithIterables(map, keys, values);
-    return map;
-  }
-
-  V? operator [](Object? key) {
-    if (!_validKey(key)) return null;
-    if (_root != null) {
-      int comp = _splay(key as dynamic);
-      if (comp == 0) {
-        return _root!.value;
-      }
-    }
-    return null;
-  }
-
-  V? remove(Object? key) {
-    if (!_validKey(key)) return null;
-    _SplayTreeMapNode<K, V>? mapRoot = _remove(key as dynamic);
-    if (mapRoot != null) return mapRoot.value;
-    return null;
-  }
-
-  void operator []=(K key, V value) {
-    if (key == null) throw ArgumentError(key);
-    // Splay on the key to move the last node on the search path for
-    // the key to the root of the tree.
-    int comp = _splay(key);
-    if (comp == 0) {
-      _root!.value = value;
-      return;
-    }
-    _addNewRoot(_SplayTreeMapNode(key, value), comp);
-  }
-
-  V putIfAbsent(K key, V ifAbsent()) {
-    if (key == null) throw ArgumentError(key);
-    int comp = _splay(key);
-    if (comp == 0) {
-      return _root!.value;
-    }
-    int modificationCount = _modificationCount;
-    int splayCount = _splayCount;
-    V value = ifAbsent();
-    if (modificationCount != _modificationCount) {
-      throw ConcurrentModificationError(this);
-    }
-    if (splayCount != _splayCount) {
-      comp = _splay(key);
-      // Key is still not there, otherwise _modificationCount would be changed.
-      assert(comp != 0);
-    }
-    _addNewRoot(_SplayTreeMapNode(key, value), comp);
-    return value;
-  }
-
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      this[key] = value;
-    });
-  }
-
-  bool get isEmpty {
-    return (_root == null);
-  }
-
-  bool get isNotEmpty => !isEmpty;
-
-  void forEach(void f(K key, V value)) {
-    Iterator<_SplayTreeMapNode<K, V>> nodes =
-        _SplayTreeNodeIterator<K, _SplayTreeMapNode<K, V>>(this);
-    while (nodes.moveNext()) {
-      _SplayTreeMapNode<K, V> node = nodes.current;
-      f(node.key, node.value);
-    }
-  }
-
-  int get length {
-    return _count;
-  }
-
-  void clear() {
-    _clear();
-  }
-
-  bool containsKey(Object? key) {
-    return _validKey(key) && _splay(key as dynamic) == 0;
-  }
-
-  bool containsValue(Object? value) {
-    int initialSplayCount = _splayCount;
-    bool visit(_SplayTreeMapNode<K, V>? node) {
-      while (node != null) {
-        if (node.value == value) return true;
-        if (initialSplayCount != _splayCount) {
-          throw ConcurrentModificationError(this);
-        }
-        if (node.right != null && visit(node.right)) {
-          return true;
-        }
-        node = node.left;
-      }
-      return false;
-    }
-
-    return visit(_root);
-  }
-
-  Iterable<K> get keys =>
-      _SplayTreeKeyIterable<K, _SplayTreeMapNode<K, V>>(this);
-
-  Iterable<V> get values => _SplayTreeValueIterable<K, V>(this);
-
-  /// Get the first key in the map. Returns `null` if the map is empty.
-  K? firstKey() {
-    if (_root == null) return null;
-    return _first!.key;
-  }
-
-  /// Get the last key in the map. Returns `null` if the map is empty.
-  K? lastKey() {
-    if (_root == null) return null;
-    return _last!.key;
-  }
-
-  /// Get the last key in the map that is strictly smaller than [key]. Returns
-  /// `null` if no key was not found.
-  K? lastKeyBefore(K key) {
-    if (key == null) throw ArgumentError(key);
-    if (_root == null) return null;
-    int comp = _splay(key);
-    if (comp < 0) return _root!.key;
-    _SplayTreeMapNode<K, V>? node = _root!.left;
-    if (node == null) return null;
-    var nodeRight = node.right;
-    while (nodeRight != null) {
-      node = nodeRight;
-      nodeRight = node.right;
-    }
-    return node!.key;
-  }
-
-  /// Get the first key in the map that is strictly larger than [key]. Returns
-  /// `null` if no key was not found.
-  K? firstKeyAfter(K key) {
-    if (key == null) throw ArgumentError(key);
-    if (_root == null) return null;
-    int comp = _splay(key);
-    if (comp > 0) return _root!.key;
-    _SplayTreeMapNode<K, V>? node = _root!.right;
-    if (node == null) return null;
-    var nodeLeft = node.left;
-    while (nodeLeft != null) {
-      node = nodeLeft;
-      nodeLeft = node.left;
-    }
-    return node!.key;
-  }
-}
-
-abstract class _SplayTreeIterator<K, Node extends _SplayTreeNode<K, Node>, T>
-    implements Iterator<T> {
-  final _SplayTree<K, Node> _tree;
-
-  /// Worklist of nodes to visit.
-  ///
-  /// These nodes have been passed over on the way down in a
-  /// depth-first left-to-right traversal. Visiting each node,
-  /// and their right subtrees will visit the remainder of
-  /// the nodes of a full traversal.
-  ///
-  /// Only valid as long as the original tree isn't reordered.
-  final List<Node> _workList = [];
-
-  /// Original modification counter of [_tree].
-  ///
-  /// Incremented on [_tree] when a key is added or removed.
-  /// If it changes, iteration is aborted.
-  ///
-  /// Not final because some iterators may modify the tree knowingly,
-  /// and they update the modification count in that case.
-  int _modificationCount;
-
-  /// Count of splay operations on [_tree] when [_workList] was built.
-  ///
-  /// If the splay count on [_tree] increases, [_workList] becomes invalid.
-  int _splayCount;
-
-  /// Current node.
-  Node? _currentNode;
-
-  _SplayTreeIterator(_SplayTree<K, Node> tree)
-      : _tree = tree,
-        _modificationCount = tree._modificationCount,
-        _splayCount = tree._splayCount {
-    _findLeftMostDescendent(tree._root);
-  }
-
-  _SplayTreeIterator.startAt(_SplayTree<K, Node> tree, K startKey)
-      : _tree = tree,
-        _modificationCount = tree._modificationCount,
-        _splayCount = -1 {
-    if (tree._root == null) return;
-    int compare = tree._splay(startKey);
-    _splayCount = tree._splayCount;
-    if (compare < 0) {
-      // Don't include the root, start at the next element after the root.
-      _findLeftMostDescendent(tree._root!.right);
-    } else {
-      _workList.add(tree._root!);
-    }
-  }
-
-  T get current {
-    var node = _currentNode;
-    if (node == null) return null as T;
-    return _getValue(node);
-  }
-
-  void _findLeftMostDescendent(Node? node) {
-    while (node != null) {
-      _workList.add(node);
-      node = node.left;
-    }
-  }
-
-  /// Called when the tree structure of the tree has changed.
-  ///
-  /// This can be caused by a splay operation.
-  /// If the key-set changes, iteration is aborted before getting
-  /// here, so we know that the keys are the same as before, it's
-  /// only the tree that has been reordered.
-  void _rebuildWorkList(Node currentNode) {
-    assert(_workList.isNotEmpty);
-    _workList.clear();
-    _tree._splay(currentNode.key);
-    _findLeftMostDescendent(_tree._root!.right);
-    assert(_workList.isNotEmpty);
-  }
-
-  bool moveNext() {
-    if (_modificationCount != _tree._modificationCount) {
-      throw ConcurrentModificationError(_tree);
-    }
-    // Picks the next element in the worklist as current.
-    // Updates the worklist with the left-most path of the current node's
-    // right-hand child.
-    // If the worklist is no longer valid (after a splay), it is rebuild
-    // from scratch.
-    if (_workList.isEmpty) {
-      _currentNode = null;
-      return false;
-    }
-    if (_tree._splayCount != _splayCount && _currentNode != null) {
-      _rebuildWorkList(_currentNode!);
-    }
-    _currentNode = _workList.removeLast();
-    _findLeftMostDescendent(_currentNode!.right);
-    return true;
-  }
-
-  T _getValue(Node node);
-}
-
-class _SplayTreeKeyIterable<K, Node extends _SplayTreeNode<K, Node>>
-    extends EfficientLengthIterable<K> {
-  _SplayTree<K, Node> _tree;
-  _SplayTreeKeyIterable(this._tree);
-  int get length => _tree._count;
-  bool get isEmpty => _tree._count == 0;
-  Iterator<K> get iterator => _SplayTreeKeyIterator<K, Node>(_tree);
-
-  Set<K> toSet() {
-    SplayTreeSet<K> set = SplayTreeSet<K>(_tree._compare, _tree._validKey);
-    set._count = _tree._count;
-    set._root = set._copyNode<Node>(_tree._root);
-    return set;
-  }
-}
-
-class _SplayTreeValueIterable<K, V> extends EfficientLengthIterable<V> {
-  SplayTreeMap<K, V> _map;
-  _SplayTreeValueIterable(this._map);
-  int get length => _map._count;
-  bool get isEmpty => _map._count == 0;
-  Iterator<V> get iterator => _SplayTreeValueIterator<K, V>(_map);
-}
-
-class _SplayTreeKeyIterator<K, Node extends _SplayTreeNode<K, Node>>
-    extends _SplayTreeIterator<K, Node, K> {
-  _SplayTreeKeyIterator(_SplayTree<K, Node> map) : super(map);
-  K _getValue(Node node) => node.key;
-}
-
-class _SplayTreeValueIterator<K, V>
-    extends _SplayTreeIterator<K, _SplayTreeMapNode<K, V>, V> {
-  _SplayTreeValueIterator(SplayTreeMap<K, V> map) : super(map);
-  V _getValue(_SplayTreeMapNode<K, V> node) => node.value;
-}
-
-class _SplayTreeNodeIterator<K, Node extends _SplayTreeNode<K, Node>>
-    extends _SplayTreeIterator<K, Node, Node> {
-  _SplayTreeNodeIterator(_SplayTree<K, Node> tree) : super(tree);
-  _SplayTreeNodeIterator.startAt(_SplayTree<K, Node> tree, K startKey)
-      : super.startAt(tree, startKey);
-  Node _getValue(Node node) => node;
-}
-
-/// A [Set] of objects that can be ordered relative to each other.
-///
-/// The set is based on a self-balancing binary tree. It allows most operations
-/// in amortized logarithmic time.
-///
-/// Elements of the set are compared using the `compare` function passed in
-/// the constructor, both for ordering and for equality.
-/// If the set contains only an object `a`, then `set.contains(b)`
-/// will return `true` if and only if `compare(a, b) == 0`,
-/// and the value of `a == b` is not even checked.
-/// If the compare function is omitted, the objects are assumed to be
-/// [Comparable], and are compared using their [Comparable.compareTo] method.
-/// Non-comparable objects (including `null`) will not work as an element
-/// in that case.
-class SplayTreeSet<E> extends _SplayTree<E, _SplayTreeSetNode<E>>
-    with IterableMixin<E>, SetMixin<E> {
-  _SplayTreeSetNode<E>? _root;
-
-  Comparator<E> _compare;
-  _Predicate _validKey;
-
-  /// Create a new [SplayTreeSet] with the given compare function.
-  ///
-  /// If the [compare] function is omitted, it defaults to [Comparable.compare],
-  /// and the elements must be comparable.
-  ///
-  /// A provided `compare` function may not work on all objects. It may not even
-  /// work on all `E` instances.
-  ///
-  /// For operations that add elements to the set, the user is supposed to not
-  /// pass in objects that doesn't work with the compare function.
-  ///
-  /// The methods [contains], [remove], [lookup], [removeAll] or [retainAll]
-  /// are typed to accept any object(s), and the [isValidKey] test can used to
-  /// filter those objects before handing them to the `compare` function.
-  ///
-  /// If [isValidKey] is provided, only values satisfying `isValidKey(other)`
-  /// are compared using the `compare` method in the methods mentioned above.
-  /// If the `isValidKey` function returns false for an object, it is assumed to
-  /// not be in the set.
-  ///
-  /// If omitted, the `isValidKey` function defaults to checking against the
-  /// type parameter: `other is E`.
-  SplayTreeSet(
-      [int Function(E key1, E key2)? compare,
-      bool Function(dynamic potentialKey)? isValidKey])
-      : _compare = compare ?? _defaultCompare<E>(),
-        _validKey = isValidKey ?? ((dynamic v) => v is E);
-
-  /// Creates a [SplayTreeSet] that contains all [elements].
-  ///
-  /// The set works as if created by `new SplayTreeSet<E>(compare, isValidKey)`.
-  ///
-  /// All the [elements] should be instances of [E] and valid arguments to
-  /// [compare].
-  /// The `elements` iterable itself may have any element type, so this
-  /// constructor can be used to down-cast a `Set`, for example as:
-  /// ```dart
-  /// Set<SuperType> superSet = ...;
-  /// Set<SubType> subSet =
-  ///     new SplayTreeSet<SubType>.from(superSet.whereType<SubType>());
-  /// ```
-  factory SplayTreeSet.from(Iterable elements,
-      [int Function(E key1, E key2)? compare,
-      bool Function(dynamic potentialKey)? isValidKey]) {
-    if (elements is Iterable<E>) {
-      return SplayTreeSet<E>.of(elements, compare, isValidKey);
-    }
-    SplayTreeSet<E> result = SplayTreeSet<E>(compare, isValidKey);
-    for (var element in elements) {
-      result.add(element as dynamic);
-    }
-    return result;
-  }
-
-  /// Creates a [SplayTreeSet] from [elements].
-  ///
-  /// The set works as if created by `new SplayTreeSet<E>(compare, isValidKey)`.
-  ///
-  /// All the [elements] should be valid as arguments to the [compare] function.
-  factory SplayTreeSet.of(Iterable<E> elements,
-          [int Function(E key1, E key2)? compare,
-          bool Function(dynamic potentialKey)? isValidKey]) =>
-      SplayTreeSet(compare, isValidKey)..addAll(elements);
-
-  Set<T> _newSet<T>() =>
-      SplayTreeSet<T>((T a, T b) => _compare(a as E, b as E), _validKey);
-
-  Set<R> cast<R>() => Set.castFrom<E, R>(this, newSet: _newSet);
-
-  // From Iterable.
-
-  Iterator<E> get iterator =>
-      _SplayTreeKeyIterator<E, _SplayTreeSetNode<E>>(this);
-
-  int get length => _count;
-  bool get isEmpty => _root == null;
-  bool get isNotEmpty => _root != null;
-
-  E get first {
-    if (_count == 0) throw IterableElementError.noElement();
-    return _first!.key;
-  }
-
-  E get last {
-    if (_count == 0) throw IterableElementError.noElement();
-    return _last!.key;
-  }
-
-  E get single {
-    if (_count == 0) throw IterableElementError.noElement();
-    if (_count > 1) throw IterableElementError.tooMany();
-    return _root!.key;
-  }
-
-  // From Set.
-  bool contains(Object? element) {
-    return _validKey(element) && _splay(element as E) == 0;
-  }
-
-  bool add(E element) {
-    int compare = _splay(element);
-    if (compare == 0) return false;
-    _addNewRoot(_SplayTreeSetNode(element), compare);
-    return true;
-  }
-
-  bool remove(Object? object) {
-    if (!_validKey(object)) return false;
-    return _remove(object as E) != null;
-  }
-
-  void addAll(Iterable<E> elements) {
-    for (E element in elements) {
-      int compare = _splay(element);
-      if (compare != 0) {
-        _addNewRoot(_SplayTreeSetNode(element), compare);
-      }
-    }
-  }
-
-  void removeAll(Iterable<Object?> elements) {
-    for (Object? element in elements) {
-      if (_validKey(element)) _remove(element as E);
-    }
-  }
-
-  void retainAll(Iterable<Object?> elements) {
-    // Build a set with the same sense of equality as this set.
-    SplayTreeSet<E> retainSet = SplayTreeSet<E>(_compare, _validKey);
-    int modificationCount = _modificationCount;
-    for (Object? object in elements) {
-      if (modificationCount != _modificationCount) {
-        // The iterator should not have side effects.
-        throw ConcurrentModificationError(this);
-      }
-      // Equivalent to this.contains(object).
-      if (_validKey(object) && _splay(object as E) == 0) {
-        retainSet.add(_root!.key);
-      }
-    }
-    // Take over the elements from the retained set, if it differs.
-    if (retainSet._count != _count) {
-      _root = retainSet._root;
-      _count = retainSet._count;
-      _modificationCount++;
-    }
-  }
-
-  E? lookup(Object? object) {
-    if (!_validKey(object)) return null;
-    int comp = _splay(object as E);
-    if (comp != 0) return null;
-    return _root!.key;
-  }
-
-  Set<E> intersection(Set<Object?> other) {
-    Set<E> result = SplayTreeSet<E>(_compare, _validKey);
-    for (E element in this) {
-      if (other.contains(element)) result.add(element);
-    }
-    return result;
-  }
-
-  Set<E> difference(Set<Object?> other) {
-    Set<E> result = SplayTreeSet<E>(_compare, _validKey);
-    for (E element in this) {
-      if (!other.contains(element)) result.add(element);
-    }
-    return result;
-  }
-
-  Set<E> union(Set<E> other) {
-    return _clone()..addAll(other);
-  }
-
-  SplayTreeSet<E> _clone() {
-    var set = SplayTreeSet<E>(_compare, _validKey);
-    set._count = _count;
-    set._root = _copyNode<_SplayTreeSetNode<E>>(_root);
-    return set;
-  }
-
-  // Copies the structure of a SplayTree into a new similar structure.
-  // Works on _SplayTreeMapNode as well, but only copies the keys,
-  _SplayTreeSetNode<E>? _copyNode<Node extends _SplayTreeNode<E, Node>>(
-      Node? node) {
-    if (node == null) return null;
-    // Given a source node and a destination node, copy the left
-    // and right subtrees of the source node into the destination node.
-    // The left subtree is copied recursively, but the right spine
-    // of every subtree is copied iteratively.
-    void copyChildren(Node node, _SplayTreeSetNode<E> dest) {
-      Node? left;
-      Node? right;
-      do {
-        left = node.left;
-        right = node.right;
-        if (left != null) {
-          var newLeft = _SplayTreeSetNode<E>(left.key);
-          dest.left = newLeft;
-          // Recursively copy the left tree.
-          copyChildren(left, newLeft);
-        }
-        if (right != null) {
-          var newRight = _SplayTreeSetNode<E>(right.key);
-          dest.right = newRight;
-          // Set node and dest to copy the right tree iteratively.
-          node = right;
-          dest = newRight;
-        }
-      } while (right != null);
-    }
-
-    var result = _SplayTreeSetNode<E>(node.key);
-    copyChildren(node, result);
-    return result;
-  }
-
-  void clear() {
-    _clear();
-  }
-
-  Set<E> toSet() => _clone();
-
-  String toString() => IterableBase.iterableToFullString(this, '{', '}');
-}
diff --git a/sdk_nnbd/lib/convert/ascii.dart b/sdk_nnbd/lib/convert/ascii.dart
deleted file mode 100644
index 9d98016..0000000
--- a/sdk_nnbd/lib/convert/ascii.dart
+++ /dev/null
@@ -1,291 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// An instance of the default implementation of the [AsciiCodec].
-///
-/// This instance provides a convenient access to the most common ASCII
-/// use cases.
-///
-/// Examples:
-/// ```dart
-/// var encoded = ascii.encode("This is ASCII!");
-/// var decoded = ascii.decode([0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73,
-///                             0x20, 0x41, 0x53, 0x43, 0x49, 0x49, 0x21]);
-/// ```
-const AsciiCodec ascii = AsciiCodec();
-
-const int _asciiMask = 0x7F;
-
-/// An [AsciiCodec] allows encoding strings as ASCII bytes
-/// and decoding ASCII bytes to strings.
-class AsciiCodec extends Encoding {
-  final bool _allowInvalid;
-
-  /// Instantiates a new [AsciiCodec].
-  ///
-  /// If [allowInvalid] is true, the [decode] method and the converter
-  /// returned by [decoder] will default to allowing invalid values.
-  /// If allowing invalid values, the values will be decoded into the Unicode
-  /// Replacement character (U+FFFD). If not, an exception will be thrown.
-  /// Calls to the [decode] method can choose to override this default.
-  ///
-  /// Encoders will not accept invalid (non ASCII) characters.
-  const AsciiCodec({bool allowInvalid = false}) : _allowInvalid = allowInvalid;
-
-  /// The name of this codec, "us-ascii".
-  String get name => "us-ascii";
-
-  Uint8List encode(String source) => encoder.convert(source);
-
-  /// Decodes the ASCII [bytes] (a list of unsigned 7-bit integers) to the
-  /// corresponding string.
-  ///
-  /// If [bytes] contains values that are not in the range 0 .. 127, the decoder
-  /// will eventually throw a [FormatException].
-  ///
-  /// If [allowInvalid] is not provided, it defaults to the value used to create
-  /// this [AsciiCodec].
-  String decode(List<int> bytes, {bool? allowInvalid}) {
-    if (allowInvalid ?? _allowInvalid) {
-      return const AsciiDecoder(allowInvalid: true).convert(bytes);
-    } else {
-      return const AsciiDecoder(allowInvalid: false).convert(bytes);
-    }
-  }
-
-  AsciiEncoder get encoder => const AsciiEncoder();
-
-  AsciiDecoder get decoder => _allowInvalid
-      ? const AsciiDecoder(allowInvalid: true)
-      : const AsciiDecoder(allowInvalid: false);
-}
-
-// Superclass for [AsciiEncoder] and [Latin1Encoder].
-// Generalizes common operations that only differ by a mask;
-class _UnicodeSubsetEncoder extends Converter<String, List<int>> {
-  final int _subsetMask;
-
-  const _UnicodeSubsetEncoder(this._subsetMask);
-
-  /// Converts the [String] into a list of its code units.
-  ///
-  /// If [start] and [end] are provided, only the substring
-  /// `string.substring(start, end)` is used as input to the conversion.
-  Uint8List convert(String string, [int start = 0, int? end]) {
-    var stringLength = string.length;
-    end = RangeError.checkValidRange(start, end, stringLength);
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (end == null) {
-      throw RangeError("Invalid range");
-    }
-    var length = end - start;
-    var result = Uint8List(length);
-    for (var i = 0; i < length; i++) {
-      var codeUnit = string.codeUnitAt(start + i);
-      if ((codeUnit & ~_subsetMask) != 0) {
-        throw ArgumentError.value(
-            string, "string", "Contains invalid characters.");
-      }
-      result[i] = codeUnit;
-    }
-    return result;
-  }
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [ByteConversionSink].
-  StringConversionSink startChunkedConversion(Sink<List<int>> sink) {
-    return _UnicodeSubsetEncoderSink(_subsetMask,
-        sink is ByteConversionSink ? sink : ByteConversionSink.from(sink));
-  }
-
-  // Override the base-class' bind, to provide a better type.
-  Stream<List<int>> bind(Stream<String> stream) => super.bind(stream);
-}
-
-/// This class converts strings of only ASCII characters to bytes.
-class AsciiEncoder extends _UnicodeSubsetEncoder {
-  const AsciiEncoder() : super(_asciiMask);
-}
-
-/// This class encodes chunked strings to bytes (unsigned 8-bit
-/// integers).
-class _UnicodeSubsetEncoderSink extends StringConversionSinkBase {
-  final ByteConversionSink _sink;
-  final int _subsetMask;
-
-  _UnicodeSubsetEncoderSink(this._subsetMask, this._sink);
-
-  void close() {
-    _sink.close();
-  }
-
-  void addSlice(String source, int start, int end, bool isLast) {
-    RangeError.checkValidRange(start, end, source.length);
-    for (var i = start; i < end; i++) {
-      var codeUnit = source.codeUnitAt(i);
-      if ((codeUnit & ~_subsetMask) != 0) {
-        throw ArgumentError(
-            "Source contains invalid character with code point: $codeUnit.");
-      }
-    }
-    _sink.add(source.codeUnits.sublist(start, end));
-    if (isLast) {
-      close();
-    }
-  }
-}
-
-/// This class converts Latin-1 bytes (lists of unsigned 8-bit integers)
-/// to a string.
-abstract class _UnicodeSubsetDecoder extends Converter<List<int>, String> {
-  final bool _allowInvalid;
-  final int _subsetMask;
-
-  /// Instantiates a new decoder.
-  ///
-  /// The [_allowInvalid] argument defines how [convert] deals
-  /// with invalid bytes.
-  ///
-  /// The [_subsetMask] argument is a bit mask used to define the subset
-  /// of Unicode being decoded. Use [_LATIN1_MASK] for Latin-1 (8-bit) or
-  /// [_asciiMask] for ASCII (7-bit).
-  ///
-  /// If [_allowInvalid] is `true`, [convert] replaces invalid bytes with the
-  /// Unicode Replacement character `U+FFFD` (�).
-  /// Otherwise it throws a [FormatException].
-  const _UnicodeSubsetDecoder(this._allowInvalid, this._subsetMask);
-
-  /// Converts the [bytes] (a list of unsigned 7- or 8-bit integers) to the
-  /// corresponding string.
-  ///
-  /// If [start] and [end] are provided, only the sub-list of bytes from
-  /// `start` to `end` (`end` not inclusive) is used as input to the conversion.
-  String convert(List<int> bytes, [int start = 0, int? end]) {
-    end = RangeError.checkValidRange(start, end, bytes.length);
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (end == null) {
-      throw RangeError("Invalid range");
-    }
-    for (var i = start; i < end; i++) {
-      var byte = bytes[i];
-      if ((byte & ~_subsetMask) != 0) {
-        if (!_allowInvalid) {
-          throw FormatException("Invalid value in input: $byte");
-        }
-        return _convertInvalid(bytes, start, end);
-      }
-    }
-    return String.fromCharCodes(bytes, start, end);
-  }
-
-  String _convertInvalid(List<int> bytes, int start, int end) {
-    var buffer = StringBuffer();
-    for (var i = start; i < end; i++) {
-      var value = bytes[i];
-      if ((value & ~_subsetMask) != 0) value = 0xFFFD;
-      buffer.writeCharCode(value);
-    }
-    return buffer.toString();
-  }
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [StringConversionSink].
-  ByteConversionSink startChunkedConversion(Sink<String> sink);
-
-  // Override the base-class's bind, to provide a better type.
-  Stream<String> bind(Stream<List<int>> stream) => super.bind(stream);
-}
-
-class AsciiDecoder extends _UnicodeSubsetDecoder {
-  const AsciiDecoder({bool allowInvalid = false})
-      : super(allowInvalid, _asciiMask);
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [StringConversionSink].
-  ByteConversionSink startChunkedConversion(Sink<String> sink) {
-    StringConversionSink stringSink;
-    if (sink is StringConversionSink) {
-      stringSink = sink;
-    } else {
-      stringSink = StringConversionSink.from(sink);
-    }
-    // TODO(lrn): Use asUtf16Sink when it becomes available. It
-    // works just as well, is likely to have less decoding overhead,
-    // and make adding U+FFFD easier.
-    // At that time, merge this with _Latin1DecoderSink;
-    if (_allowInvalid) {
-      return _ErrorHandlingAsciiDecoderSink(stringSink.asUtf8Sink(false));
-    } else {
-      return _SimpleAsciiDecoderSink(stringSink);
-    }
-  }
-}
-
-class _ErrorHandlingAsciiDecoderSink extends ByteConversionSinkBase {
-  ByteConversionSink _utf8Sink;
-  _ErrorHandlingAsciiDecoderSink(this._utf8Sink);
-
-  void close() {
-    _utf8Sink.close();
-  }
-
-  void add(List<int> source) {
-    addSlice(source, 0, source.length, false);
-  }
-
-  void addSlice(List<int> source, int start, int end, bool isLast) {
-    RangeError.checkValidRange(start, end, source.length);
-    for (var i = start; i < end; i++) {
-      if ((source[i] & ~_asciiMask) != 0) {
-        if (i > start) _utf8Sink.addSlice(source, start, i, false);
-        // Add UTF-8 encoding of U+FFFD.
-        _utf8Sink.add(const <int>[0xEF, 0xBF, 0xBD]);
-        start = i + 1;
-      }
-    }
-    if (start < end) {
-      _utf8Sink.addSlice(source, start, end, isLast);
-    } else if (isLast) {
-      close();
-    }
-  }
-}
-
-class _SimpleAsciiDecoderSink extends ByteConversionSinkBase {
-  Sink _sink;
-  _SimpleAsciiDecoderSink(this._sink);
-
-  void close() {
-    _sink.close();
-  }
-
-  void add(List<int> source) {
-    for (var i = 0; i < source.length; i++) {
-      if ((source[i] & ~_asciiMask) != 0) {
-        throw FormatException("Source contains non-ASCII bytes.");
-      }
-    }
-    _sink.add(String.fromCharCodes(source));
-  }
-
-  void addSlice(List<int> source, int start, int end, bool isLast) {
-    final length = source.length;
-    RangeError.checkValidRange(start, end, length);
-    if (start < end) {
-      if (start != 0 || end != length) {
-        source = source.sublist(start, end);
-      }
-      add(source);
-    }
-    if (isLast) close();
-  }
-}
diff --git a/sdk_nnbd/lib/convert/base64.dart b/sdk_nnbd/lib/convert/base64.dart
deleted file mode 100644
index 0955ca1..0000000
--- a/sdk_nnbd/lib/convert/base64.dart
+++ /dev/null
@@ -1,870 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart.convert;
-
-/// A [base64](https://tools.ietf.org/html/rfc4648) encoder and decoder.
-///
-/// It encodes using the default base64 alphabet,
-/// decodes using both the base64 and base64url alphabets,
-/// does not allow invalid characters and requires padding.
-///
-/// Examples:
-///
-///     var encoded = base64.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
-///                                  0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
-///     var decoded = base64.decode("YmzDpWLDpnJncsO4ZAo=");
-///
-/// The top-level [base64Encode] and [base64Decode] functions may be used
-/// instead if a local variable shadows the [base64] constant.
-const Base64Codec base64 = Base64Codec();
-
-/// A [base64url](https://tools.ietf.org/html/rfc4648) encoder and decoder.
-///
-/// It encodes and decodes using the base64url alphabet,
-/// decodes using both the base64 and base64url alphabets,
-/// does not allow invalid characters and requires padding.
-///
-/// Examples:
-///
-///     var encoded = base64Url.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
-///                                     0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
-///     var decoded = base64Url.decode("YmzDpWLDpnJncsO4ZAo=");
-const Base64Codec base64Url = Base64Codec.urlSafe();
-
-/// Encodes [bytes] using [base64](https://tools.ietf.org/html/rfc4648) encoding.
-///
-/// Shorthand for `base64.encode(bytes)`. Useful if a local variable shadows the global
-/// [base64] constant.
-String base64Encode(List<int> bytes) => base64.encode(bytes);
-
-/// Encodes [bytes] using [base64url](https://tools.ietf.org/html/rfc4648) encoding.
-///
-/// Shorthand for `base64url.encode(bytes)`.
-String base64UrlEncode(List<int> bytes) => base64Url.encode(bytes);
-
-/// Decodes [base64](https://tools.ietf.org/html/rfc4648) or [base64url](https://tools.ietf.org/html/rfc4648) encoded bytes.
-///
-/// Shorthand for `base64.decode(bytes)`. Useful if a local variable shadows the
-/// global [base64] constant.
-Uint8List base64Decode(String source) => base64.decode(source);
-
-// Constants used in more than one class.
-const int _paddingChar = 0x3d; // '='.
-
-/// A [base64](https://tools.ietf.org/html/rfc4648) encoder and decoder.
-///
-/// A [Base64Codec] allows base64 encoding bytes into ASCII strings and
-/// decoding valid encodings back to bytes.
-///
-/// This implementation only handles the simplest RFC 4648 base64 and base64url
-/// encodings.
-/// It does not allow invalid characters when decoding and it requires,
-/// and generates, padding so that the input is always a multiple of four
-/// characters.
-class Base64Codec extends Codec<List<int>, String> {
-  final Base64Encoder _encoder;
-  const Base64Codec() : _encoder = const Base64Encoder();
-  const Base64Codec.urlSafe() : _encoder = const Base64Encoder.urlSafe();
-
-  Base64Encoder get encoder => _encoder;
-
-  Base64Decoder get decoder => const Base64Decoder();
-
-  /// Decodes [encoded].
-  ///
-  /// The input is decoded as if by `decoder.convert`.
-  ///
-  /// The returned [Uint8List] contains exactly the decoded bytes,
-  /// so the [Uint8List.length] is precisely the number of decoded bytes.
-  /// The [Uint8List.buffer] may be larger than the decoded bytes.
-  Uint8List decode(String encoded) => decoder.convert(encoded);
-
-  /// Validates and normalizes the base64 encoded data in [source].
-  ///
-  /// Only acts on the substring from [start] to [end], with [end]
-  /// defaulting to the end of the string.
-  ///
-  /// Normalization will:
-  /// * Unescape any `%`-escapes.
-  /// * Only allow valid characters (`A`-`Z`, `a`-`z`, `0`-`9`, `/` and `+`).
-  /// * Normalize a `_` or `-` character to `/` or `+`.
-  /// * Validate that existing padding (trailing `=` characters) is correct.
-  /// * If no padding exists, add correct padding if necessary and possible.
-  /// * Validate that the length is correct (a multiple of four).
-  String normalize(String source, [int start = 0, int? end]) {
-    end = RangeError.checkValidRange(start, end, source.length);
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (end == null) {
-      throw RangeError("Invalid range");
-    }
-    const percent = 0x25;
-    const equals = 0x3d;
-    StringBuffer? buffer;
-    var sliceStart = start;
-    var alphabet = _Base64Encoder._base64Alphabet;
-    var inverseAlphabet = _Base64Decoder._inverseAlphabet;
-    var firstPadding = -1;
-    var firstPaddingSourceIndex = -1;
-    var paddingCount = 0;
-    for (var i = start; i < end;) {
-      var sliceEnd = i;
-      var char = source.codeUnitAt(i++);
-      var originalChar = char;
-      // Normalize char, keep originalChar to see if it matches the source.
-      if (char == percent) {
-        if (i + 2 <= end) {
-          char = parseHexByte(source, i); // May be negative.
-          i += 2;
-          // We know that %25 isn't valid, but our table considers it
-          // a potential padding start, so skip the checks.
-          if (char == percent) char = -1;
-        } else {
-          // An invalid HEX escape (too short).
-          // Just skip past the handling and reach the throw below.
-          char = -1;
-        }
-      }
-      // If char is negative here, hex-decoding failed in some way.
-      if (0 <= char && char <= 127) {
-        var value = inverseAlphabet[char];
-        if (value >= 0) {
-          char = alphabet.codeUnitAt(value);
-          if (char == originalChar) continue;
-        } else if (value == _Base64Decoder._padding) {
-          // We have ruled out percent, so char is '='.
-          if (firstPadding < 0) {
-            // Mark position in normalized output where padding occurs.
-            firstPadding = (buffer?.length ?? 0) + (sliceEnd - sliceStart);
-            firstPaddingSourceIndex = sliceEnd;
-          }
-          paddingCount++;
-          // It could have been an escaped equals (%3D).
-          if (originalChar == equals) continue;
-        }
-        if (value != _Base64Decoder._invalid) {
-          (buffer ??= StringBuffer())
-            ..write(source.substring(sliceStart, sliceEnd))
-            ..writeCharCode(char);
-          sliceStart = i;
-          continue;
-        }
-      }
-      throw FormatException("Invalid base64 data", source, sliceEnd);
-    }
-    if (buffer != null) {
-      buffer.write(source.substring(sliceStart, end));
-      if (firstPadding >= 0) {
-        // There was padding in the source. Check that it is valid:
-        // * result length a multiple of four
-        // * one or two padding characters at the end.
-        _checkPadding(source, firstPaddingSourceIndex, end, firstPadding,
-            paddingCount, buffer.length);
-      } else {
-        // Length of last chunk (1-4 chars) in the encoding.
-        var endLength = ((buffer.length - 1) % 4) + 1;
-        if (endLength == 1) {
-          // The data must have length 0, 2 or 3 modulo 4.
-          throw FormatException("Invalid base64 encoding length ", source, end);
-        }
-        while (endLength < 4) {
-          buffer.write("=");
-          endLength++;
-        }
-      }
-      return source.replaceRange(start, end, buffer.toString());
-    }
-    // Original was already normalized, only check padding.
-    var length = end - start;
-    if (firstPadding >= 0) {
-      _checkPadding(source, firstPaddingSourceIndex, end, firstPadding,
-          paddingCount, length);
-    } else {
-      // No padding given, so add some if needed it.
-      var endLength = length % 4;
-      if (endLength == 1) {
-        // The data must have length 0, 2 or 3 modulo 4.
-        throw FormatException("Invalid base64 encoding length ", source, end);
-      }
-      if (endLength > 1) {
-        // There is no "insertAt" on String, but this works as well.
-        source = source.replaceRange(end, end, (endLength == 2) ? "==" : "=");
-      }
-    }
-    return source;
-  }
-
-  static void _checkPadding(String source, int sourceIndex, int sourceEnd,
-      int firstPadding, int paddingCount, int length) {
-    if (length % 4 != 0) {
-      throw FormatException(
-          "Invalid base64 padding, padded length must be multiple of four, "
-          "is $length",
-          source,
-          sourceEnd);
-    }
-    if (firstPadding + paddingCount != length) {
-      throw FormatException(
-          "Invalid base64 padding, '=' not at the end", source, sourceIndex);
-    }
-    if (paddingCount > 2) {
-      throw FormatException(
-          "Invalid base64 padding, more than two '=' characters",
-          source,
-          sourceIndex);
-    }
-  }
-}
-
-// ------------------------------------------------------------------------
-// Encoder
-// ------------------------------------------------------------------------
-
-/// Base64 and base64url encoding converter.
-///
-/// Encodes lists of bytes using base64 or base64url encoding.
-///
-/// The results are ASCII strings using a restricted alphabet.
-class Base64Encoder extends Converter<List<int>, String> {
-  final bool _urlSafe;
-
-  const Base64Encoder() : _urlSafe = false;
-  const Base64Encoder.urlSafe() : _urlSafe = true;
-
-  String convert(List<int> input) {
-    if (input.isEmpty) return "";
-    var encoder = _Base64Encoder(_urlSafe);
-    var buffer = encoder.encode(input, 0, input.length, true)!;
-    return String.fromCharCodes(buffer);
-  }
-
-  ByteConversionSink startChunkedConversion(Sink<String> sink) {
-    if (sink is StringConversionSink) {
-      return _Utf8Base64EncoderSink(sink.asUtf8Sink(false), _urlSafe);
-    }
-    return _AsciiBase64EncoderSink(sink, _urlSafe);
-  }
-}
-
-/// Helper class for encoding bytes to base64.
-class _Base64Encoder {
-  /// The RFC 4648 base64 encoding alphabet.
-  static const String _base64Alphabet =
-      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-  /// The RFC 4648 base64url encoding alphabet.
-  static const String _base64UrlAlphabet =
-      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
-
-  /// Shift-count to extract the values stored in [_state].
-  static const int _valueShift = 2;
-
-  /// Mask to extract the count value stored in [_state].
-  static const int _countMask = 3;
-
-  static const int _sixBitMask = 0x3F;
-
-  /// Intermediate state between chunks.
-  ///
-  /// Encoding handles three bytes at a time.
-  /// If fewer than three bytes has been seen, this value encodes
-  /// the number of bytes seen (0, 1 or 2) and their values.
-  int _state = 0;
-
-  /// Alphabet used for encoding.
-  final String _alphabet;
-
-  _Base64Encoder(bool urlSafe)
-      : _alphabet = urlSafe ? _base64UrlAlphabet : _base64Alphabet;
-
-  /// Encode count and bits into a value to be stored in [_state].
-  static int _encodeState(int count, int bits) {
-    assert(count <= _countMask);
-    return bits << _valueShift | count;
-  }
-
-  /// Extract bits from encoded state.
-  static int _stateBits(int state) => state >> _valueShift;
-
-  /// Extract count from encoded state.
-  static int _stateCount(int state) => state & _countMask;
-
-  /// Create a [Uint8List] with the provided length.
-  Uint8List createBuffer(int bufferLength) => Uint8List(bufferLength);
-
-  /// Encode [bytes] from [start] to [end] and the bits in [_state].
-  ///
-  /// Returns a [Uint8List] of the ASCII codes of the encoded data.
-  ///
-  /// If the input, including left over [_state] from earlier encodings,
-  /// are not a multiple of three bytes, then the partial state is stored
-  /// back into [_state].
-  /// If [isLast] is true, partial state is encoded in the output instead,
-  /// with the necessary padding.
-  ///
-  /// Returns `null` if there is no output.
-  Uint8List? encode(List<int> bytes, int start, int end, bool isLast) {
-    assert(0 <= start);
-    assert(start <= end);
-    assert(end <= bytes.length);
-    var length = end - start;
-
-    var count = _stateCount(_state);
-    var byteCount = (count + length);
-    var fullChunks = byteCount ~/ 3;
-    var partialChunkLength = byteCount - fullChunks * 3;
-    var bufferLength = fullChunks * 4;
-    if (isLast && partialChunkLength > 0) {
-      bufferLength += 4; // Room for padding.
-    }
-    var output = createBuffer(bufferLength);
-    _state =
-        encodeChunk(_alphabet, bytes, start, end, isLast, output, 0, _state);
-    if (bufferLength > 0) return output;
-    // If the input plus the data in state is still less than three bytes,
-    // there may not be any output.
-    return null;
-  }
-
-  static int encodeChunk(String alphabet, List<int> bytes, int start, int end,
-      bool isLast, Uint8List output, int outputIndex, int state) {
-    var bits = _stateBits(state);
-    // Count number of missing bytes in three-byte chunk.
-    var expectedChars = 3 - _stateCount(state);
-
-    // The input must be a list of bytes (integers in the range 0..255).
-    // The value of `byteOr` will be the bitwise or of all the values in
-    // `bytes` and a later check will validate that they were all valid bytes.
-    var byteOr = 0;
-    for (var i = start; i < end; i++) {
-      var byte = bytes[i];
-      byteOr |= byte;
-      bits = ((bits << 8) | byte) & 0xFFFFFF; // Never store more than 24 bits.
-      expectedChars--;
-      if (expectedChars == 0) {
-        output[outputIndex++] = alphabet.codeUnitAt((bits >> 18) & _sixBitMask);
-        output[outputIndex++] = alphabet.codeUnitAt((bits >> 12) & _sixBitMask);
-        output[outputIndex++] = alphabet.codeUnitAt((bits >> 6) & _sixBitMask);
-        output[outputIndex++] = alphabet.codeUnitAt(bits & _sixBitMask);
-        expectedChars = 3;
-        bits = 0;
-      }
-    }
-    if (byteOr >= 0 && byteOr <= 255) {
-      if (isLast && expectedChars < 3) {
-        writeFinalChunk(alphabet, output, outputIndex, 3 - expectedChars, bits);
-        return 0;
-      }
-      return _encodeState(3 - expectedChars, bits);
-    }
-
-    // There was an invalid byte value somewhere in the input - find it!
-    var i = start;
-    while (i < end) {
-      var byte = bytes[i];
-      if (byte < 0 || byte > 255) break;
-      i++;
-    }
-    throw ArgumentError.value(
-        bytes, "Not a byte value at index $i: 0x${bytes[i].toRadixString(16)}");
-  }
-
-  /// Writes a final encoded four-character chunk.
-  ///
-  /// Only used when the [_state] contains a partial (1 or 2 byte)
-  /// input.
-  static void writeFinalChunk(
-      String alphabet, Uint8List output, int outputIndex, int count, int bits) {
-    assert(count > 0);
-    if (count == 1) {
-      output[outputIndex++] = alphabet.codeUnitAt((bits >> 2) & _sixBitMask);
-      output[outputIndex++] = alphabet.codeUnitAt((bits << 4) & _sixBitMask);
-      output[outputIndex++] = _paddingChar;
-      output[outputIndex++] = _paddingChar;
-    } else {
-      assert(count == 2);
-      output[outputIndex++] = alphabet.codeUnitAt((bits >> 10) & _sixBitMask);
-      output[outputIndex++] = alphabet.codeUnitAt((bits >> 4) & _sixBitMask);
-      output[outputIndex++] = alphabet.codeUnitAt((bits << 2) & _sixBitMask);
-      output[outputIndex++] = _paddingChar;
-    }
-  }
-}
-
-class _BufferCachingBase64Encoder extends _Base64Encoder {
-  /// Reused buffer.
-  ///
-  /// When the buffer isn't released to the sink, only used to create another
-  /// value (a string), the buffer can be reused between chunks.
-  Uint8List? bufferCache;
-
-  _BufferCachingBase64Encoder(bool urlSafe) : super(urlSafe);
-
-  Uint8List createBuffer(int bufferLength) {
-    Uint8List? buffer = bufferCache;
-    if (buffer == null || buffer.length < bufferLength) {
-      bufferCache = buffer = Uint8List(bufferLength);
-    }
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (buffer == null) {
-      throw "unreachable";
-    }
-    // Return a view of the buffer, so it has the requested length.
-    return Uint8List.view(buffer.buffer, buffer.offsetInBytes, bufferLength);
-  }
-}
-
-abstract class _Base64EncoderSink extends ByteConversionSinkBase {
-  void add(List<int> source) {
-    _add(source, 0, source.length, false);
-  }
-
-  void close() {
-    _add(const [], 0, 0, true);
-  }
-
-  void addSlice(List<int> source, int start, int end, bool isLast) {
-    if (end == null) throw ArgumentError.notNull("end");
-    RangeError.checkValidRange(start, end, source.length);
-    _add(source, start, end, isLast);
-  }
-
-  void _add(List<int> source, int start, int end, bool isLast);
-}
-
-class _AsciiBase64EncoderSink extends _Base64EncoderSink {
-  final Sink<String> _sink;
-  final _Base64Encoder _encoder;
-
-  _AsciiBase64EncoderSink(this._sink, bool urlSafe)
-      : _encoder = _BufferCachingBase64Encoder(urlSafe);
-
-  void _add(List<int> source, int start, int end, bool isLast) {
-    var buffer = _encoder.encode(source, start, end, isLast);
-    if (buffer != null) {
-      var string = String.fromCharCodes(buffer);
-      _sink.add(string);
-    }
-    if (isLast) {
-      _sink.close();
-    }
-  }
-}
-
-class _Utf8Base64EncoderSink extends _Base64EncoderSink {
-  final ByteConversionSink _sink;
-  final _Base64Encoder _encoder;
-
-  _Utf8Base64EncoderSink(this._sink, bool urlSafe)
-      : _encoder = _Base64Encoder(urlSafe);
-
-  void _add(List<int> source, int start, int end, bool isLast) {
-    var buffer = _encoder.encode(source, start, end, isLast);
-    if (buffer != null) {
-      _sink.addSlice(buffer, 0, buffer.length, isLast);
-    }
-  }
-}
-
-// ------------------------------------------------------------------------
-// Decoder
-// ------------------------------------------------------------------------
-
-/// Decoder for base64 encoded data.
-///
-/// This decoder accepts both base64 and base64url ("url-safe") encodings.
-///
-/// The encoding is required to be properly padded.
-class Base64Decoder extends Converter<String, List<int>> {
-  const Base64Decoder();
-
-  /// Decodes the characters of [input] from [start] to [end] as base64.
-  ///
-  /// If [start] is omitted, it defaults to the start of [input].
-  /// If [end] is omitted, it defaults to the end of [input].
-  ///
-  /// The returned [Uint8List] contains exactly the decoded bytes,
-  /// so the [Uint8List.length] is precisely the number of decoded bytes.
-  /// The [Uint8List.buffer] may be larger than the decoded bytes.
-  Uint8List convert(String input, [int start = 0, int? end]) {
-    end = RangeError.checkValidRange(start, end, input.length);
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (end == null) {
-      throw RangeError("Invalid range");
-    }
-    if (start == end) return Uint8List(0);
-    var decoder = _Base64Decoder();
-    var buffer = decoder.decode(input, start, end)!;
-    decoder.close(input, end);
-    return buffer;
-  }
-
-  StringConversionSink startChunkedConversion(Sink<List<int>> sink) {
-    return _Base64DecoderSink(sink);
-  }
-}
-
-/// Helper class implementing base64 decoding with intermediate state.
-class _Base64Decoder {
-  /// Shift-count to extract the values stored in [_state].
-  static const int _valueShift = 2;
-
-  /// Mask to extract the count value stored in [_state].
-  static const int _countMask = 3;
-
-  /// Invalid character in decoding table.
-  static const int _invalid = -2;
-
-  /// Padding character in decoding table.
-  static const int _padding = -1;
-
-  // Shorthands to make the table more readable.
-  static const int __ = _invalid;
-  static const int _p = _padding;
-
-  /// Mapping from ASCII characters to their index in the base64 alphabet.
-  ///
-  /// Uses [_invalid] for invalid indices and [_padding] for the padding
-  /// character.
-  ///
-  /// Accepts the "URL-safe" alphabet as well (`-` and `_` are the
-  /// 62nd and 63rd alphabet characters), and considers `%` a padding
-  /// character, which must then be followed by `3D`, the percent-escape
-  /// for `=`.
-  static final List<int> _inverseAlphabet = Int8List.fromList([
-    __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, //
-    __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, //
-    __, __, __, __, __, _p, __, __, __, __, __, 62, __, 62, __, 63, //
-    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, __, __, __, _p, __, __, //
-    __, 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, //
-    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, __, __, __, __, 63, //
-    __, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, //
-    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, __, __, __, __, __, //
-  ]);
-
-  // Character constants.
-  static const int _char_percent = 0x25; // '%'.
-  static const int _char_3 = 0x33; // '3'.
-  static const int _char_d = 0x64; // 'd'.
-
-  /// Maintains the intermediate state of a partly-decoded input.
-  ///
-  /// Base64 is decoded in chunks of four characters. If a chunk does not
-  /// contain a full block, the decoded bits (six per character) of the
-  /// available characters are stored in [_state] until the next call to
-  /// [_decode] or [_close].
-  ///
-  /// If no padding has been seen, the value is
-  ///   `numberOfCharactersSeen | (decodedBits << 2)`
-  /// where `numberOfCharactersSeen` is between 0 and 3 and decoded bits
-  /// contains six bits per seen character.
-  ///
-  /// If padding has been seen the value is negative. It's the bitwise negation
-  /// of the number of remaining allowed padding characters (always ~0 or ~1).
-  ///
-  /// A state of `0` or `~0` are valid places to end decoding, all other values
-  /// mean that a four-character block has not been completed.
-  int _state = 0;
-
-  /// Encodes [count] and [bits] as a value to be stored in [_state].
-  static int _encodeCharacterState(int count, int bits) {
-    assert(count == (count & _countMask));
-    return (bits << _valueShift | count);
-  }
-
-  /// Extracts count from a [_state] value.
-  static int _stateCount(int state) {
-    assert(state >= 0);
-    return state & _countMask;
-  }
-
-  /// Extracts value bits from a [_state] value.
-  static int _stateBits(int state) {
-    assert(state >= 0);
-    return state >> _valueShift;
-  }
-
-  /// Encodes a number of expected padding characters to be stored in [_state].
-  static int _encodePaddingState(int expectedPadding) {
-    assert(expectedPadding >= 0);
-    assert(expectedPadding <= 5);
-    return -expectedPadding - 1; // ~expectedPadding adapted to dart2js.
-  }
-
-  /// Extracts expected padding character count from a [_state] value.
-  static int _statePadding(int state) {
-    assert(state < 0);
-    return -state - 1; // ~state adapted to dart2js.
-  }
-
-  static bool _hasSeenPadding(int state) => state < 0;
-
-  /// Decodes [input] from [start] to [end].
-  ///
-  /// Returns a [Uint8List] with the decoded bytes.
-  /// If a previous call had an incomplete four-character block, the bits from
-  /// those are included in decoding
-  Uint8List? decode(String input, int start, int end) {
-    assert(0 <= start);
-    assert(start <= end);
-    assert(end <= input.length);
-    if (_hasSeenPadding(_state)) {
-      _state = _checkPadding(input, start, end, _state);
-      return null;
-    }
-    if (start == end) return Uint8List(0);
-    var buffer = _allocateBuffer(input, start, end, _state);
-    _state = decodeChunk(input, start, end, buffer, 0, _state);
-    return buffer;
-  }
-
-  /// Checks that [_state] represents a valid decoding.
-  void close(String? input, int? end) {
-    if (_state < _encodePaddingState(0)) {
-      throw FormatException("Missing padding character", input, end);
-    }
-    if (_state > 0) {
-      throw FormatException(
-          "Invalid length, must be multiple of four", input, end);
-    }
-    _state = _encodePaddingState(0);
-  }
-
-  /// Decodes [input] from [start] to [end].
-  ///
-  /// Includes the state returned by a previous call in the decoding.
-  /// Writes the decoding to [output] at [outIndex], and there must
-  /// be room in the output.
-  static int decodeChunk(String input, int start, int end, Uint8List output,
-      int outIndex, int state) {
-    assert(!_hasSeenPadding(state));
-    const asciiMask = 127;
-    const asciiMax = 127;
-    const eightBitMask = 0xFF;
-    const bitsPerCharacter = 6;
-
-    var bits = _stateBits(state);
-    var count = _stateCount(state);
-    // String contents should be all ASCII.
-    // Instead of checking for each character, we collect the bitwise-or of
-    // all the characters in `charOr` and later validate that all characters
-    // were ASCII.
-    var charOr = 0;
-    final inverseAlphabet = _Base64Decoder._inverseAlphabet;
-    for (var i = start; i < end; i++) {
-      var char = input.codeUnitAt(i);
-      charOr |= char;
-      var code = inverseAlphabet[char & asciiMask];
-      if (code >= 0) {
-        bits = ((bits << bitsPerCharacter) | code) & 0xFFFFFF;
-        count = (count + 1) & 3;
-        if (count == 0) {
-          assert(outIndex + 3 <= output.length);
-          output[outIndex++] = (bits >> 16) & eightBitMask;
-          output[outIndex++] = (bits >> 8) & eightBitMask;
-          output[outIndex++] = bits & eightBitMask;
-          bits = 0;
-        }
-        continue;
-      } else if (code == _padding && count > 1) {
-        if (charOr < 0 || charOr > asciiMax) break;
-        if (count == 3) {
-          if ((bits & 0x03) != 0) {
-            throw FormatException("Invalid encoding before padding", input, i);
-          }
-          output[outIndex++] = bits >> 10;
-          output[outIndex++] = bits >> 2;
-        } else {
-          if ((bits & 0x0F) != 0) {
-            throw FormatException("Invalid encoding before padding", input, i);
-          }
-          output[outIndex++] = bits >> 4;
-        }
-        // Expected padding is the number of expected padding characters,
-        // where `=` counts as three and `%3D` counts as one per character.
-        //
-        // Expect either zero or one padding depending on count (2 or 3),
-        // plus two more characters if the code was `%` (a partial padding).
-        var expectedPadding = (3 - count) * 3;
-        if (char == _char_percent) expectedPadding += 2;
-        state = _encodePaddingState(expectedPadding);
-        return _checkPadding(input, i + 1, end, state);
-      }
-      throw FormatException("Invalid character", input, i);
-    }
-    if (charOr >= 0 && charOr <= asciiMax) {
-      return _encodeCharacterState(count, bits);
-    }
-    // There is an invalid (non-ASCII) character in the input.
-    int i;
-    for (i = start; i < end; i++) {
-      var char = input.codeUnitAt(i);
-      if (char < 0 || char > asciiMax) break;
-    }
-    throw FormatException("Invalid character", input, i);
-  }
-
-  static Uint8List _emptyBuffer = Uint8List(0);
-
-  /// Allocates a buffer with room for the decoding of a substring of [input].
-  ///
-  /// Includes room for the characters in [state], and handles padding correctly.
-  static Uint8List _allocateBuffer(
-      String input, int start, int end, int state) {
-    assert(state >= 0);
-    var paddingStart = _trimPaddingChars(input, start, end);
-    var length = _stateCount(state) + (paddingStart - start);
-    // Three bytes per full four bytes in the input.
-    var bufferLength = (length >> 2) * 3;
-    // If padding was seen, then this is the last chunk, and the final partial
-    // chunk should be decoded too.
-    var remainderLength = length & 3;
-    if (remainderLength != 0 && paddingStart < end) {
-      bufferLength += remainderLength - 1;
-    }
-    if (bufferLength > 0) return Uint8List(bufferLength);
-    // If the input plus state is less than four characters, and it's not
-    // at the end of input, no buffer is needed.
-    return _emptyBuffer;
-  }
-
-  /// Returns the position of the start of padding at the end of the input.
-  ///
-  /// Returns the end of input if there is no padding.
-  ///
-  /// This is used to ensure that the decoding buffer has the exact size
-  /// it needs when input is valid, and at least enough bytes to reach the error
-  /// when input is invalid.
-  ///
-  /// Never count more than two padding sequences since any more than that
-  /// will raise an error anyway, and we only care about being precise for
-  /// successful conversions.
-  static int _trimPaddingChars(String input, int start, int end) {
-    // This may count '%=' as two paddings. That's ok, it will err later,
-    // but the buffer will be large enough to reach the error.
-    var padding = 0;
-    var index = end;
-    var newEnd = end;
-    while (index > start && padding < 2) {
-      index--;
-      var char = input.codeUnitAt(index);
-      if (char == _paddingChar) {
-        padding++;
-        newEnd = index;
-        continue;
-      }
-      if ((char | 0x20) == _char_d) {
-        if (index == start) break;
-        index--;
-        char = input.codeUnitAt(index);
-      }
-      if (char == _char_3) {
-        if (index == start) break;
-        index--;
-        char = input.codeUnitAt(index);
-      }
-      if (char == _char_percent) {
-        padding++;
-        newEnd = index;
-        continue;
-      }
-      break;
-    }
-    return newEnd;
-  }
-
-  /// Check that the remainder of the string is valid padding.
-  ///
-  /// Valid padding is a correct number (0, 1 or 2) of `=` characters
-  /// or `%3D` sequences depending on the number of preceding base64 characters.
-  /// The [state] parameter encodes which padding continuations are allowed
-  /// as the number of expected characters. That number is the number of
-  /// expected padding characters times 3 minus the number of padding characters
-  /// seen so far, where `=` counts as 3 counts as three characters,
-  /// and the padding sequence `%3D` counts as one character per character.
-  ///
-  /// The number of missing characters is always between 0 and 5 because we
-  /// only call this function after having seen at least one `=` or `%`
-  /// character.
-  /// If the number of missing characters is not 3 or 0, we have seen (at least)
-  /// a `%` character and expects the rest of the `%3D` sequence, and a `=` is
-  /// not allowed. When missing 3 characters, either `=` or `%` is allowed.
-  ///
-  /// When the value is 0, no more padding (or any other character) is allowed.
-  static int _checkPadding(String input, int start, int end, int state) {
-    assert(_hasSeenPadding(state));
-    if (start == end) return state;
-    var expectedPadding = _statePadding(state);
-    assert(expectedPadding >= 0);
-    assert(expectedPadding < 6);
-    while (expectedPadding > 0) {
-      var char = input.codeUnitAt(start);
-      if (expectedPadding == 3) {
-        if (char == _paddingChar) {
-          expectedPadding -= 3;
-          start++;
-          break;
-        }
-        if (char == _char_percent) {
-          expectedPadding--;
-          start++;
-          if (start == end) break;
-          char = input.codeUnitAt(start);
-        } else {
-          break;
-        }
-      }
-      // Partial padding means we have seen part of a "%3D" escape.
-      var expectedPartialPadding = expectedPadding;
-      if (expectedPartialPadding > 3) expectedPartialPadding -= 3;
-      if (expectedPartialPadding == 2) {
-        // Expects '3'
-        if (char != _char_3) break;
-        start++;
-        expectedPadding--;
-        if (start == end) break;
-        char = input.codeUnitAt(start);
-      }
-      // Expects 'D' or 'd'.
-      if ((char | 0x20) != _char_d) break;
-      start++;
-      expectedPadding--;
-      if (start == end) break;
-    }
-    if (start != end) {
-      throw FormatException("Invalid padding character", input, start);
-    }
-    return _encodePaddingState(expectedPadding);
-  }
-}
-
-class _Base64DecoderSink extends StringConversionSinkBase {
-  /// Output sink
-  final Sink<List<int>> _sink;
-  final _Base64Decoder _decoder = _Base64Decoder();
-
-  _Base64DecoderSink(this._sink);
-
-  void add(String string) {
-    if (string.isEmpty) return;
-    var buffer = _decoder.decode(string, 0, string.length);
-    if (buffer != null) _sink.add(buffer);
-  }
-
-  void close() {
-    _decoder.close(null, null);
-    _sink.close();
-  }
-
-  void addSlice(String string, int start, int end, bool isLast) {
-    RangeError.checkValidRange(start, end, string.length);
-    if (start == end) return;
-    var buffer = _decoder.decode(string, start, end);
-    if (buffer != null) _sink.add(buffer);
-    if (isLast) {
-      _decoder.close(string, end);
-      _sink.close();
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/convert/byte_conversion.dart b/sdk_nnbd/lib/convert/byte_conversion.dart
deleted file mode 100644
index 3d52d78..0000000
--- a/sdk_nnbd/lib/convert/byte_conversion.dart
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// The [ByteConversionSink] provides an interface for converters to
-/// efficiently transmit byte data.
-///
-/// Instead of limiting the interface to one non-chunked list of bytes it
-/// accepts its input in chunks (themselves being lists of bytes).
-///
-/// This abstract class will likely get more methods over time. Implementers are
-/// urged to extend or mix in [ByteConversionSinkBase] to ensure that their
-/// class covers the newly added methods.
-abstract class ByteConversionSink extends ChunkedConversionSink<List<int>> {
-  ByteConversionSink();
-  factory ByteConversionSink.withCallback(
-      void callback(List<int> accumulated)) = _ByteCallbackSink;
-  factory ByteConversionSink.from(Sink<List<int>> sink) = _ByteAdapterSink;
-
-  /// Adds the next [chunk] to `this`.
-  ///
-  /// Adds the bytes defined by [start] and [end]-exclusive to `this`.
-  ///
-  /// If [isLast] is `true` closes `this`.
-  ///
-  /// Contrary to `add` the given [chunk] must not be held onto. Once the method
-  /// returns, it is safe to overwrite the data in it.
-  void addSlice(List<int> chunk, int start, int end, bool isLast);
-
-  // TODO(floitsch): add more methods:
-  // - iterateBytes.
-}
-
-/// This class provides a base-class for converters that need to accept byte
-/// inputs.
-abstract class ByteConversionSinkBase extends ByteConversionSink {
-  void add(List<int> chunk);
-  void close();
-
-  void addSlice(List<int> chunk, int start, int end, bool isLast) {
-    add(chunk.sublist(start, end));
-    if (isLast) close();
-  }
-}
-
-/// This class adapts a simple [Sink] to a [ByteConversionSink].
-///
-/// All additional methods of the [ByteConversionSink] (compared to the
-/// ChunkedConversionSink) are redirected to the `add` method.
-class _ByteAdapterSink extends ByteConversionSinkBase {
-  final Sink<List<int>> _sink;
-
-  _ByteAdapterSink(this._sink);
-
-  void add(List<int> chunk) {
-    _sink.add(chunk);
-  }
-
-  void close() {
-    _sink.close();
-  }
-}
-
-/// This class accumulates all chunks into one list of bytes
-/// and invokes a callback when the sink is closed.
-///
-/// This class can be used to terminate a chunked conversion.
-class _ByteCallbackSink extends ByteConversionSinkBase {
-  static const _INITIAL_BUFFER_SIZE = 1024;
-
-  final void Function(List<int>) _callback;
-  List<int> _buffer = Uint8List(_INITIAL_BUFFER_SIZE);
-  int _bufferIndex = 0;
-
-  _ByteCallbackSink(void callback(List<int> accumulated))
-      : _callback = callback;
-
-  void add(Iterable<int> chunk) {
-    var freeCount = _buffer.length - _bufferIndex;
-    if (chunk.length > freeCount) {
-      // Grow the buffer.
-      var oldLength = _buffer.length;
-      var newLength = _roundToPowerOf2(chunk.length + oldLength) * 2;
-      var grown = Uint8List(newLength);
-      grown.setRange(0, _buffer.length, _buffer);
-      _buffer = grown;
-    }
-    _buffer.setRange(_bufferIndex, _bufferIndex + chunk.length, chunk);
-    _bufferIndex += chunk.length;
-  }
-
-  static int _roundToPowerOf2(int v) {
-    assert(v > 0);
-    v--;
-    v |= v >> 1;
-    v |= v >> 2;
-    v |= v >> 4;
-    v |= v >> 8;
-    v |= v >> 16;
-    v++;
-    return v;
-  }
-
-  void close() {
-    _callback(_buffer.sublist(0, _bufferIndex));
-  }
-}
diff --git a/sdk_nnbd/lib/convert/chunked_conversion.dart b/sdk_nnbd/lib/convert/chunked_conversion.dart
deleted file mode 100644
index d2c24f0..0000000
--- a/sdk_nnbd/lib/convert/chunked_conversion.dart
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// A [ChunkedConversionSink] is used to transmit data more efficiently between
-/// two converters during chunked conversions.
-///
-/// The basic `ChunkedConversionSink` is just a [Sink], and converters should
-/// work with a plain `Sink`, but may work more efficiently with certain
-/// specialized types of `ChunkedConversionSink`.
-///
-/// It is recommended that implementations of `ChunkedConversionSink` extend
-/// this class, to inherit any further methods that may be added to the class.
-abstract class ChunkedConversionSink<T> implements Sink<T> {
-  ChunkedConversionSink();
-  factory ChunkedConversionSink.withCallback(
-      void callback(List<T> accumulated)) = _SimpleCallbackSink<T>;
-
-  /// Adds chunked data to this sink.
-  ///
-  /// This method is also used when converters are used as [StreamTransformer]s.
-  void add(T chunk);
-
-  /// Closes the sink.
-  ///
-  /// This signals the end of the chunked conversion. This method is called
-  /// when converters are used as [StreamTransformer]'s.
-  void close();
-}
-
-/// This class accumulates all chunks and invokes a callback with a list of
-/// the chunks when the sink is closed.
-///
-/// This class can be used to terminate a chunked conversion.
-class _SimpleCallbackSink<T> extends ChunkedConversionSink<T> {
-  final void Function(List<T>) _callback;
-  final List<T> _accumulated = <T>[];
-
-  _SimpleCallbackSink(this._callback);
-
-  void add(T chunk) {
-    _accumulated.add(chunk);
-  }
-
-  void close() {
-    _callback(_accumulated);
-  }
-}
-
-/// This class implements the logic for a chunked conversion as a
-/// stream transformer.
-///
-/// It is used as strategy in the [EventTransformStream].
-///
-/// It also implements the [ChunkedConversionSink] interface so that it
-/// can be used as output sink in a chunked conversion.
-class _ConverterStreamEventSink<S, T> implements EventSink<S> {
-  /// The output sink for the converter.
-  final EventSink<T> _eventSink;
-
-  /// The input sink for new data. All data that is received with
-  /// [handleData] is added into this sink.
-  final Sink<S> _chunkedSink;
-
-  _ConverterStreamEventSink(Converter<S, T> converter, EventSink<T> sink)
-      : _eventSink = sink,
-        _chunkedSink = converter.startChunkedConversion(sink);
-
-  void add(S o) {
-    _chunkedSink.add(o);
-  }
-
-  void addError(Object error, [StackTrace? stackTrace]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(error, "error");
-    _eventSink.addError(error, stackTrace);
-  }
-
-  void close() {
-    _chunkedSink.close();
-  }
-}
diff --git a/sdk_nnbd/lib/convert/codec.dart b/sdk_nnbd/lib/convert/codec.dart
deleted file mode 100644
index 38e4a3c..0000000
--- a/sdk_nnbd/lib/convert/codec.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// A [Codec] encodes and (if supported) decodes data.
-///
-/// Codecs can be fused. For example fusing [json] and [utf8] produces
-/// an encoder that can convert Json objects directly to bytes, or can decode
-/// bytes directly to json objects.
-///
-/// Fused codecs generally attempt to optimize the operations and can be faster
-/// than executing each step of an encoding separately.
-abstract class Codec<S, T> {
-  const Codec();
-
-  /// Encodes [input].
-  ///
-  /// The input is encoded as if by `encoder.convert`.
-  T encode(S input) => encoder.convert(input);
-
-  /// Decodes [encoded] data.
-  ///
-  /// The input is decoded as if by `decoder.convert`.
-  S decode(T encoded) => decoder.convert(encoded);
-
-  /// Returns the encoder from [S] to [T].
-  ///
-  /// It may be stateful and should not be reused.
-  Converter<S, T> get encoder;
-
-  /// Returns the decoder of `this`, converting from [T] to [S].
-  ///
-  /// It may be stateful and should not be reused.
-  Converter<T, S> get decoder;
-
-  /// Fuses `this` with `other`.
-  ///
-  /// When encoding, the resulting codec encodes with `this` before
-  /// encoding with [other].
-  ///
-  /// When decoding, the resulting codec decodes with [other] before decoding
-  /// with `this`.
-  ///
-  /// In some cases one needs to use the [inverted] codecs to be able to fuse
-  /// them correctly. That is, the output type of `this` ([T]) must match the
-  /// input type of the second codec [other].
-  ///
-  /// Examples:
-  /// ```dart
-  /// final jsonToBytes = json.fuse(utf8);
-  /// List<int> bytes = jsonToBytes.encode(["json-object"]);
-  /// var decoded = jsonToBytes.decode(bytes);
-  /// assert(decoded is List && decoded[0] == "json-object");
-  ///
-  /// var inverted = json.inverted;
-  /// var jsonIdentity = json.fuse(inverted);
-  /// var jsonObject = jsonIdentity.encode(["1", 2]);
-  /// assert(jsonObject is List && jsonObject[0] == "1" && jsonObject[1] == 2);
-  /// ```
-  // TODO(floitsch): use better example with line-splitter once that one is
-  // in this library.
-  Codec<S, R> fuse<R>(Codec<T, R> other) {
-    return _FusedCodec<S, T, R>(this, other);
-  }
-
-  /// Inverts `this`.
-  ///
-  /// The [encoder] and [decoder] of the resulting codec are swapped.
-  Codec<T, S> get inverted => _InvertedCodec<T, S>(this);
-}
-
-/// Fuses the given codecs.
-///
-/// In the non-chunked conversion simply invokes the non-chunked conversions in
-/// sequence.
-class _FusedCodec<S, M, T> extends Codec<S, T> {
-  final Codec<S, M> _first;
-  final Codec<M, T> _second;
-
-  Converter<S, T> get encoder => _first.encoder.fuse<T>(_second.encoder);
-  Converter<T, S> get decoder => _second.decoder.fuse<S>(_first.decoder);
-
-  _FusedCodec(this._first, this._second);
-}
-
-class _InvertedCodec<T, S> extends Codec<T, S> {
-  final Codec<S, T> _codec;
-
-  _InvertedCodec(Codec<S, T> codec) : _codec = codec;
-
-  Converter<T, S> get encoder => _codec.decoder;
-  Converter<S, T> get decoder => _codec.encoder;
-
-  Codec<S, T> get inverted => _codec;
-}
diff --git a/sdk_nnbd/lib/convert/convert.dart b/sdk_nnbd/lib/convert/convert.dart
deleted file mode 100644
index 6173782..0000000
--- a/sdk_nnbd/lib/convert/convert.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2013, 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.
-
-///
-/// Encoders and decoders for converting between different data representations,
-/// including JSON and UTF-8.
-///
-/// In addition to converters for common data representations, this library
-/// provides support for implementing converters in a way which makes them easy to
-/// chain and to use with streams.
-///
-/// To use this library in your code:
-///
-///     import 'dart:convert';
-///
-/// Two commonly used converters are the top-level instances of
-/// [JsonCodec] and [Utf8Codec], named [json] and [utf8], respectively.
-///
-/// JSON is a simple text format for representing
-/// structured objects and collections.
-/// The JSON encoder/decoder transforms between strings and
-/// object structures, such as lists and maps, using the JSON format.
-///
-/// UTF-8 is a common variable-width encoding that can represent
-/// every character in the Unicode character set.
-/// The UTF-8 encoder/decoder transforms between Strings and bytes.
-///
-/// Converters are often used with streams
-/// to transform the data that comes through the stream
-/// as it becomes available.
-/// The following code uses two converters.
-/// The first is a UTF-8 decoder, which converts the data from bytes to UTF-8
-/// as it's read from a file,
-/// The second is an instance of [LineSplitter],
-/// which splits the data on newline boundaries.
-///
-///     var lineNumber = 1;
-///     var stream = File('quotes.txt').openRead();
-///
-///     stream.transform(utf8.decoder)
-///           .transform(const LineSplitter())
-///           .listen((line) {
-///             if (showLineNumbers) {
-///               stdout.write('${lineNumber++} ');
-///             }
-///             stdout.writeln(line);
-///           });
-///
-/// See the documentation for the [Codec] and [Converter] classes
-/// for information about creating your own converters.
-///
-/// {@category Core}
-library dart.convert;
-
-import 'dart:async';
-import 'dart:typed_data';
-import 'dart:_internal' show CastConverter, parseHexByte;
-
-part 'ascii.dart';
-part 'base64.dart';
-part 'byte_conversion.dart';
-part 'chunked_conversion.dart';
-part 'codec.dart';
-part 'converter.dart';
-part 'encoding.dart';
-part 'html_escape.dart';
-part 'json.dart';
-part 'latin1.dart';
-part 'line_splitter.dart';
-part 'string_conversion.dart';
-part 'utf.dart';
diff --git a/sdk_nnbd/lib/convert/convert_sources.gni b/sdk_nnbd/lib/convert/convert_sources.gni
deleted file mode 100644
index ad79649..0000000
--- a/sdk_nnbd/lib/convert/convert_sources.gni
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# This file contains all sources for the dart:convert library.
-convert_sdk_sources = [
-  "convert.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "ascii.dart",
-  "base64.dart",
-  "byte_conversion.dart",
-  "chunked_conversion.dart",
-  "codec.dart",
-  "converter.dart",
-  "encoding.dart",
-  "html_escape.dart",
-  "json.dart",
-  "latin1.dart",
-  "line_splitter.dart",
-  "string_conversion.dart",
-  "utf.dart",
-]
diff --git a/sdk_nnbd/lib/convert/converter.dart b/sdk_nnbd/lib/convert/converter.dart
deleted file mode 100644
index 2167933..0000000
--- a/sdk_nnbd/lib/convert/converter.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// A [Converter] converts data from one representation into another.
-///
-/// It is recommended that implementations of `Converter` extend this class,
-/// to inherit any further methods that may be added to the class.
-abstract class Converter<S, T> extends StreamTransformerBase<S, T> {
-  const Converter();
-
-  /// Adapts [source] to be a `Converter<TS, TT>`.
-  ///
-  /// This allows [source] to be used at the new type, but at run-time it
-  /// must satisfy the requirements of both the new type and its original type.
-  ///
-  /// Conversion input must be both [SS] and [TS] and the output created by
-  /// [source] for those input must be both [ST] and [TT].
-  static Converter<TS, TT> castFrom<SS, ST, TS, TT>(Converter<SS, ST> source) =>
-      CastConverter<SS, ST, TS, TT>(source);
-
-  /// Converts [input] and returns the result of the conversion.
-  T convert(S input);
-
-  /// Fuses `this` with [other].
-  ///
-  /// Encoding with the resulting converter is equivalent to converting with
-  /// `this` before converting with `other`.
-  Converter<S, TT> fuse<TT>(Converter<T, TT> other) {
-    return _FusedConverter<S, T, TT>(this, other);
-  }
-
-  /// Starts a chunked conversion.
-  ///
-  /// The returned sink serves as input for the long-running conversion. The
-  /// given [sink] serves as output.
-  Sink<S> startChunkedConversion(Sink<T> sink) {
-    throw UnsupportedError(
-        "This converter does not support chunked conversions: $this");
-  }
-
-  Stream<T> bind(Stream<S> stream) {
-    return Stream<T>.eventTransformed(
-        stream, (EventSink sink) => _ConverterStreamEventSink(this, sink));
-  }
-
-  /// Provides a `Converter<RS, RT>` view of this stream transformer.
-  ///
-  /// The resulting transformer will check at run-time that all conversion
-  /// inputs are actually instances of [S],
-  /// and it will check that all conversion output produced by this converter
-  /// are actually instances of [RT].
-  Converter<RS, RT> cast<RS, RT>() => Converter.castFrom<S, T, RS, RT>(this);
-}
-
-/// Fuses two converters.
-///
-/// For a non-chunked conversion converts the input in sequence.
-class _FusedConverter<S, M, T> extends Converter<S, T> {
-  final Converter<S, M> _first;
-  final Converter<M, T> _second;
-
-  _FusedConverter(this._first, this._second);
-
-  T convert(S input) => _second.convert(_first.convert(input));
-
-  Sink<S> startChunkedConversion(Sink<T> sink) {
-    return _first.startChunkedConversion(_second.startChunkedConversion(sink));
-  }
-}
diff --git a/sdk_nnbd/lib/convert/encoding.dart b/sdk_nnbd/lib/convert/encoding.dart
deleted file mode 100644
index b9238a8..0000000
--- a/sdk_nnbd/lib/convert/encoding.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// Open-ended Encoding enum.
-abstract class Encoding extends Codec<String, List<int>> {
-  const Encoding();
-
-  /// Returns the encoder from `String` to `List<int>`.
-  ///
-  /// It may be stateful and should not be reused.
-  Converter<String, List<int>> get encoder;
-
-  /// Returns the decoder of `this`, converting from `List<int>` to `String`.
-  ///
-  /// It may be stateful and should not be reused.
-  Converter<List<int>, String> get decoder;
-
-  Future<String> decodeStream(Stream<List<int>> byteStream) {
-    return decoder
-        .bind(byteStream)
-        .fold(StringBuffer(),
-            (StringBuffer buffer, String string) => buffer..write(string))
-        .then((StringBuffer buffer) => buffer.toString());
-  }
-
-  /// Name of the encoding.
-  ///
-  /// If the encoding is standardized, this is the lower-case version of one of
-  /// the IANA official names for the character set (see
-  /// http://www.iana.org/assignments/character-sets/character-sets.xml)
-  String get name;
-
-  // All aliases (in lowercase) of supported encoding from
-  // http://www.iana.org/assignments/character-sets/character-sets.xml.
-  static final Map<String, Encoding> _nameToEncoding = <String, Encoding>{
-    // ISO_8859-1:1987.
-    "iso_8859-1:1987": latin1,
-    "iso-ir-100": latin1,
-    "iso_8859-1": latin1,
-    "iso-8859-1": latin1,
-    "latin1": latin1,
-    "l1": latin1,
-    "ibm819": latin1,
-    "cp819": latin1,
-    "csisolatin1": latin1,
-
-    // US-ASCII.
-    "iso-ir-6": ascii,
-    "ansi_x3.4-1968": ascii,
-    "ansi_x3.4-1986": ascii,
-    "iso_646.irv:1991": ascii,
-    "iso646-us": ascii,
-    "us-ascii": ascii,
-    "us": ascii,
-    "ibm367": ascii,
-    "cp367": ascii,
-    "csascii": ascii,
-    "ascii": ascii, // This is not in the IANA official names.
-
-    // UTF-8.
-    "csutf8": utf8,
-    "utf-8": utf8
-  };
-
-  /// Gets an [Encoding] object from the name of the character set
-  /// name. The names used are the IANA official names for the
-  /// character set (see
-  /// http://www.iana.org/assignments/character-sets/character-sets.xml).
-  ///
-  /// The [name] passed is case insensitive.
-  ///
-  /// If character set is not supported `null` is returned.
-  static Encoding? getByName(String? name) {
-    if (name == null) return null;
-    return _nameToEncoding[name.toLowerCase()];
-  }
-}
diff --git a/sdk_nnbd/lib/convert/html_escape.dart b/sdk_nnbd/lib/convert/html_escape.dart
deleted file mode 100644
index 317e6c1..0000000
--- a/sdk_nnbd/lib/convert/html_escape.dart
+++ /dev/null
@@ -1,228 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// A `String` converter that converts characters to HTML entities.
-///
-/// This is intended to sanitize text before inserting the text into an HTML
-/// document. Characters that are meaningful in HTML are converted to
-/// HTML entities (like `&amp;` for `&`).
-///
-/// The general converter escapes all characters that are meaningful in HTML
-/// attributes or normal element context. Elements with special content types
-/// (like CSS or JavaScript) may need a more specialized escaping that
-/// understands that content type.
-///
-/// If the context where the text will be inserted is known in more detail,
-/// it's possible to omit escaping some characters (like quotes when not
-/// inside an attribute value).
-///
-/// The escaped text should only be used inside quoted HTML attributes values
-/// or as text content of a normal element. Using the escaped text inside a
-/// tag, but not inside a quoted attribute value, is still dangerous.
-const HtmlEscape htmlEscape = HtmlEscape();
-
-/// HTML escape modes.
-///
-/// Allows specifying a mode for HTML escaping that depend on the context
-/// where the escaped result is going to be used.
-/// The relevant contexts are:
-///
-/// * as text content of an HTML element.
-/// * as value of a (single- or double-) quoted attribute value.
-///
-/// All modes require escaping of `&` (ampersand) characters, and may
-/// enable escaping of more characters.
-///
-/// Custom escape modes can be created using the [HtmlEscapeMode.HtmlEscapeMode]
-/// constructor.
-class HtmlEscapeMode {
-  final String _name;
-
-  /// Whether to escape '<' and '>'.
-  final bool escapeLtGt;
-
-  /// Whether to escape '"' (quote).
-  final bool escapeQuot;
-
-  /// Whether to escape "'" (apostrophe).
-  final bool escapeApos;
-
-  /// Whether to escape "/" (forward slash, solidus).
-  ///
-  /// Escaping a slash is recommended to avoid cross-site scripting attacks by
-  /// [the Open Web Application Security Project](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content)
-  final bool escapeSlash;
-
-  /// Default escaping mode which escape all characters.
-  ///
-  /// The result of such an escaping is usable both in element content and
-  /// in any attribute value.
-  ///
-  /// The escaping only works for elements with normal HTML content,
-  /// and not for, for example, script or style element content,
-  /// which require escapes matching their particular content syntax.
-  static const HtmlEscapeMode unknown =
-      HtmlEscapeMode._('unknown', true, true, true, true);
-
-  /// Escaping mode for text going into double-quoted HTML attribute values.
-  ///
-  /// The result should not be used as the content of an unquoted
-  /// or single-quoted attribute value.
-  ///
-  /// Escapes double quotes (`"`) but not single quotes (`'`),
-  /// and escapes `<` and `>` characters because they are not allowed
-  /// in strict XHTML attributes
-  static const HtmlEscapeMode attribute =
-      HtmlEscapeMode._('attribute', true, true, false, false);
-
-  /// Escaping mode for text going into single-quoted HTML attribute values.
-  ///
-  /// The result should not be used as the content of an unquoted
-  /// or double-quoted attribute value.
-  ///
-  /// Escapes single quotes (`'`) but not double quotes (`"`),
-  /// and escapes `<` and `>` characters because they are not allowed
-  /// in strict XHTML attributes
-  static const HtmlEscapeMode sqAttribute =
-      HtmlEscapeMode._('attribute', true, false, true, false);
-
-  /// Escaping mode for text going into HTML element content.
-  ///
-  /// The escaping only works for elements with normal HTML content,
-  /// and not for, for example, script or style element content,
-  /// which require escapes matching their particular content syntax.
-  ///
-  /// Escapes `<` and `>` characters.
-  static const HtmlEscapeMode element =
-      HtmlEscapeMode._('element', true, false, false, false);
-
-  const HtmlEscapeMode._(this._name, this.escapeLtGt, this.escapeQuot,
-      this.escapeApos, this.escapeSlash);
-
-  /// Create a custom escaping mode.
-  ///
-  /// All modes escape `&`.
-  /// The mode can further be set to escape `<` and `>` ([escapeLtGt]),
-  /// `"` ([escapeQuot]), `'` ([escapeApos]), and/or `/` ([escapeSlash]).
-  const HtmlEscapeMode(
-      {String name = "custom",
-      this.escapeLtGt = false,
-      this.escapeQuot = false,
-      this.escapeApos = false,
-      this.escapeSlash = false})
-      : _name = name;
-
-  String toString() => _name;
-}
-
-/// Converter which escapes characters with special meaning in HTML.
-///
-/// The converter finds characters that are significant in HTML source and
-/// replaces them with corresponding HTML entities.
-///
-/// The characters that need escaping in HTML are:
-///
-/// * `&` (ampersand) always need to be escaped.
-/// * `<` (less than) and '>' (greater than) when inside an element.
-/// * `"` (quote) when inside a double-quoted attribute value.
-/// * `'` (apostrophe) when inside a single-quoted attribute value.
-///       Apostrophe is escaped as `&#39;` instead of `&apos;` since
-///       not all browsers understand `&apos;`.
-/// * `/` (slash) is recommended to be escaped because it may be used
-///       to terminate an element in some HTML dialects.
-///
-/// Escaping `>` (greater than) isn't necessary, but the result is often
-/// found to be easier to read if greater-than is also escaped whenever
-/// less-than is.
-class HtmlEscape extends Converter<String, String> {
-  /// The [HtmlEscapeMode] used by the converter.
-  final HtmlEscapeMode mode;
-
-  /// Create converter that escapes HTML characters.
-  ///
-  /// If [mode] is provided as either [HtmlEscapeMode.attribute] or
-  /// [HtmlEscapeMode.element], only the corresponding subset of HTML
-  /// characters are escaped.
-  /// The default is to escape all HTML characters.
-  const HtmlEscape([this.mode = HtmlEscapeMode.unknown]);
-
-  String convert(String text) {
-    var val = _convert(text, 0, text.length);
-    return val == null ? text : val;
-  }
-
-  /// Converts the substring of text from start to end.
-  ///
-  /// Returns `null` if no changes were necessary, otherwise returns
-  /// the converted string.
-  String? _convert(String text, int start, int end) {
-    StringBuffer? result;
-    for (var i = start; i < end; i++) {
-      var ch = text[i];
-      String? replacement;
-      switch (ch) {
-        case '&':
-          replacement = '&amp;';
-          break;
-        case '"':
-          if (mode.escapeQuot) replacement = '&quot;';
-          break;
-        case "'":
-          if (mode.escapeApos) replacement = '&#39;';
-          break;
-        case '<':
-          if (mode.escapeLtGt) replacement = '&lt;';
-          break;
-        case '>':
-          if (mode.escapeLtGt) replacement = '&gt;';
-          break;
-        case '/':
-          if (mode.escapeSlash) replacement = '&#47;';
-          break;
-      }
-      if (replacement != null) {
-        result ??= StringBuffer();
-        // TODO(38725): Remove workaround when assignment promotion is
-        // implemented
-        if (result == null) {
-          throw "unreachable";
-        }
-        if (i > start) result.write(text.substring(start, i));
-        result.write(replacement);
-        start = i + 1;
-      }
-    }
-    if (result == null) return null;
-    if (end > start) result.write(text.substring(start, end));
-    return result.toString();
-  }
-
-  StringConversionSink startChunkedConversion(Sink<String> sink) {
-    return _HtmlEscapeSink(this,
-        sink is StringConversionSink ? sink : StringConversionSink.from(sink));
-  }
-}
-
-class _HtmlEscapeSink extends StringConversionSinkBase {
-  final HtmlEscape _escape;
-  final StringConversionSink _sink;
-
-  _HtmlEscapeSink(this._escape, this._sink);
-
-  void addSlice(String chunk, int start, int end, bool isLast) {
-    var val = _escape._convert(chunk, start, end);
-    if (val == null) {
-      _sink.addSlice(chunk, start, end, isLast);
-    } else {
-      _sink.add(val);
-      if (isLast) _sink.close();
-    }
-  }
-
-  void close() {
-    _sink.close();
-  }
-}
diff --git a/sdk_nnbd/lib/convert/json.dart b/sdk_nnbd/lib/convert/json.dart
deleted file mode 100644
index 6d897a0..0000000
--- a/sdk_nnbd/lib/convert/json.dart
+++ /dev/null
@@ -1,1088 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// Error thrown by JSON serialization if an object cannot be serialized.
-///
-/// The [unsupportedObject] field holds that object that failed to be serialized.
-///
-/// If an object isn't directly serializable, the serializer calls the `toJson`
-/// method on the object. If that call fails, the error will be stored in the
-/// [cause] field. If the call returns an object that isn't directly
-/// serializable, the [cause] is null.
-class JsonUnsupportedObjectError extends Error {
-  /// The object that could not be serialized.
-  final Object? unsupportedObject;
-
-  /// The exception thrown when trying to convert the object.
-  final Object? cause;
-
-  /// The partial result of the conversion, up until the error happened.
-  ///
-  /// May be null.
-  final String? partialResult;
-
-  JsonUnsupportedObjectError(this.unsupportedObject,
-      {this.cause, this.partialResult});
-
-  String toString() {
-    var safeString = Error.safeToString(unsupportedObject);
-    String prefix;
-    if (cause != null) {
-      prefix = "Converting object to an encodable object failed:";
-    } else {
-      prefix = "Converting object did not return an encodable object:";
-    }
-    return "$prefix $safeString";
-  }
-}
-
-/// Reports that an object could not be stringified due to cyclic references.
-///
-/// An object that references itself cannot be serialized by
-/// [JsonCodec.encode]/[JsonEncoder.convert].
-/// When the cycle is detected, a [JsonCyclicError] is thrown.
-class JsonCyclicError extends JsonUnsupportedObjectError {
-  /// The first object that was detected as part of a cycle.
-  JsonCyclicError(Object? object) : super(object);
-  String toString() => "Cyclic error in JSON stringify";
-}
-
-/// An instance of the default implementation of the [JsonCodec].
-///
-/// This instance provides a convenient access to the most common JSON
-/// use cases.
-///
-/// Examples:
-///
-///     var encoded = json.encode([1, 2, { "a": null }]);
-///     var decoded = json.decode('["foo", { "bar": 499 }]');
-///
-/// The top-level [jsonEncode] and [jsonDecode] functions may be used instead if
-/// a local variable shadows the [json] constant.
-const JsonCodec json = JsonCodec();
-
-/// Converts [value] to a JSON string.
-///
-/// If value contains objects that are not directly encodable to a JSON
-/// string (a value that is not a number, boolean, string, null, list or a map
-/// with string keys), the [toEncodable] function is used to convert it to an
-/// object that must be directly encodable.
-///
-/// If [toEncodable] is omitted, it defaults to a function that returns the
-/// result of calling `.toJson()` on the unencodable object.
-///
-/// Shorthand for `json.encode`. Useful if a local variable shadows the global
-/// [json] constant.
-String jsonEncode(Object? object,
-        {Object? toEncodable(Object? nonEncodable)?}) =>
-    json.encode(object, toEncodable: toEncodable);
-
-/// Parses the string and returns the resulting Json object.
-///
-/// The optional [reviver] function is called once for each object or list
-/// property that has been parsed during decoding. The `key` argument is either
-/// the integer list index for a list property, the string map key for object
-/// properties, or `null` for the final result.
-///
-/// The default [reviver] (when not provided) is the identity function.
-///
-/// Shorthand for `json.decode`. Useful if a local variable shadows the global
-/// [json] constant.
-dynamic jsonDecode(String source,
-        {Object? reviver(Object? key, Object? value)?}) =>
-    json.decode(source, reviver: reviver);
-
-/// A [JsonCodec] encodes JSON objects to strings and decodes strings to
-/// JSON objects.
-///
-/// Examples:
-///
-///     var encoded = json.encode([1, 2, { "a": null }]);
-///     var decoded = json.decode('["foo", { "bar": 499 }]');
-class JsonCodec extends Codec<Object?, String> {
-  final Object? Function(Object? key, Object? value)? _reviver;
-  final Object? Function(dynamic)? _toEncodable;
-
-  /// Creates a `JsonCodec` with the given reviver and encoding function.
-  ///
-  /// The [reviver] function is called during decoding. It is invoked once for
-  /// each object or list property that has been parsed.
-  /// The `key` argument is either the integer list index for a list property,
-  /// the string map key for object properties, or `null` for the final result.
-  ///
-  /// If [reviver] is omitted, it defaults to returning the value argument.
-  ///
-  /// The [toEncodable] function is used during encoding. It is invoked for
-  /// values that are not directly encodable to a string (a value that is not a
-  /// number, boolean, string, null, list or a map with string keys). The
-  /// function must return an object that is directly encodable. The elements of
-  /// a returned list and values of a returned map do not need to be directly
-  /// encodable, and if they aren't, `toEncodable` will be used on them as well.
-  /// Please notice that it is possible to cause an infinite recursive regress
-  /// in this way, by effectively creating an infinite data structure through
-  /// repeated call to `toEncodable`.
-  ///
-  /// If [toEncodable] is omitted, it defaults to a function that returns the
-  /// result of calling `.toJson()` on the unencodable object.
-  const JsonCodec(
-      {Object? reviver(Object? key, Object? value)?,
-      Object? toEncodable(dynamic object)?})
-      : _reviver = reviver,
-        _toEncodable = toEncodable;
-
-  /// Creates a `JsonCodec` with the given reviver.
-  ///
-  /// The [reviver] function is called once for each object or list property
-  /// that has been parsed during decoding. The `key` argument is either the
-  /// integer list index for a list property, the string map key for object
-  /// properties, or `null` for the final result.
-  JsonCodec.withReviver(dynamic reviver(Object? key, Object? value))
-      : this(reviver: reviver);
-
-  /// Parses the string and returns the resulting Json object.
-  ///
-  /// The optional [reviver] function is called once for each object or list
-  /// property that has been parsed during decoding. The `key` argument is either
-  /// the integer list index for a list property, the string map key for object
-  /// properties, or `null` for the final result.
-  ///
-  /// The default [reviver] (when not provided) is the identity function.
-  dynamic decode(String source,
-      {Object? reviver(Object? key, Object? value)?}) {
-    reviver ??= _reviver;
-    if (reviver == null) return decoder.convert(source);
-    return JsonDecoder(reviver).convert(source);
-  }
-
-  /// Converts [value] to a JSON string.
-  ///
-  /// If value contains objects that are not directly encodable to a JSON
-  /// string (a value that is not a number, boolean, string, null, list or a map
-  /// with string keys), the [toEncodable] function is used to convert it to an
-  /// object that must be directly encodable.
-  ///
-  /// If [toEncodable] is omitted, it defaults to a function that returns the
-  /// result of calling `.toJson()` on the unencodable object.
-  String encode(Object? value, {Object? toEncodable(dynamic object)?}) {
-    toEncodable ??= _toEncodable;
-    if (toEncodable == null) return encoder.convert(value);
-    return JsonEncoder(toEncodable).convert(value);
-  }
-
-  JsonEncoder get encoder {
-    if (_toEncodable == null) return const JsonEncoder();
-    return JsonEncoder(_toEncodable);
-  }
-
-  JsonDecoder get decoder {
-    if (_reviver == null) return const JsonDecoder();
-    return JsonDecoder(_reviver);
-  }
-}
-
-/// This class converts JSON objects to strings.
-class JsonEncoder extends Converter<Object?, String> {
-  /// The string used for indention.
-  ///
-  /// When generating multi-line output, this string is inserted once at the
-  /// beginning of each indented line for each level of indentation.
-  ///
-  /// If `null`, the output is encoded as a single line.
-  final String? indent;
-
-  /// Function called on non-encodable objects to return a replacement
-  /// encodable object that will be encoded in the orignal's place.
-  final Object? Function(dynamic)? _toEncodable;
-
-  /// Creates a JSON encoder.
-  ///
-  /// The JSON encoder handles numbers, strings, booleans, null, lists and
-  /// maps with string keys directly.
-  ///
-  /// Any other object is attempted converted by [toEncodable] to an
-  /// object that is of one of the convertible types.
-  ///
-  /// If [toEncodable] is omitted, it defaults to calling `.toJson()` on
-  /// the object.
-  const JsonEncoder([Object? toEncodable(dynamic object)?])
-      : indent = null,
-        _toEncodable = toEncodable;
-
-  /// Creates a JSON encoder that creates multi-line JSON.
-  ///
-  /// The encoding of elements of lists and maps are indented and put on separate
-  /// lines. The [indent] string is prepended to these elements, once for each
-  /// level of indentation.
-  ///
-  /// If [indent] is `null`, the output is encoded as a single line.
-  ///
-  /// The JSON encoder handles numbers, strings, booleans, null, lists and
-  /// maps with string keys directly.
-  ///
-  /// Any other object is attempted converted by [toEncodable] to an
-  /// object that is of one of the convertible types.
-  ///
-  /// If [toEncodable] is omitted, it defaults to calling `.toJson()` on
-  /// the object.
-  const JsonEncoder.withIndent(this.indent,
-      [Object? toEncodable(dynamic object)?])
-      : _toEncodable = toEncodable;
-
-  /// Converts [object] to a JSON [String].
-  ///
-  /// Directly serializable values are [num], [String], [bool], and [Null], as
-  /// well as some [List] and [Map] values. For [List], the elements must all be
-  /// serializable. For [Map], the keys must be [String] and the values must be
-  /// serializable.
-  ///
-  /// If a value of any other type is attempted to be serialized, the
-  /// `toEncodable` function provided in the constructor is called with the value
-  /// as argument. The result, which must be a directly serializable value, is
-  /// serialized instead of the original value.
-  ///
-  /// If the conversion throws, or returns a value that is not directly
-  /// serializable, a [JsonUnsupportedObjectError] exception is thrown.
-  /// If the call throws, the error is caught and stored in the
-  /// [JsonUnsupportedObjectError]'s [:cause:] field.
-  ///
-  /// If a [List] or [Map] contains a reference to itself, directly or through
-  /// other lists or maps, it cannot be serialized and a [JsonCyclicError] is
-  /// thrown.
-  ///
-  /// [object] should not change during serialization.
-  ///
-  /// If an object is serialized more than once, [convert] may cache the text
-  /// for it. In other words, if the content of an object changes after it is
-  /// first serialized, the new values may not be reflected in the result.
-  String convert(Object? object) =>
-      _JsonStringStringifier.stringify(object, _toEncodable, indent);
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [StringConversionSink].
-  ///
-  /// Returns a chunked-conversion sink that accepts at most one object. It is
-  /// an error to invoke `add` more than once on the returned sink.
-  ChunkedConversionSink<Object?> startChunkedConversion(Sink<String> sink) {
-    if (sink is _Utf8EncoderSink) {
-      return _JsonUtf8EncoderSink(
-          sink._sink,
-          _toEncodable,
-          JsonUtf8Encoder._utf8Encode(indent),
-          JsonUtf8Encoder._defaultBufferSize);
-    }
-    return _JsonEncoderSink(
-        sink is StringConversionSink ? sink : StringConversionSink.from(sink),
-        _toEncodable,
-        indent);
-  }
-
-  // Override the base class's bind, to provide a better type.
-  Stream<String> bind(Stream<Object?> stream) => super.bind(stream);
-
-  Converter<Object?, T> fuse<T>(Converter<String, T> other) {
-    if (other is Utf8Encoder) {
-      // The instance check guarantees that `T` is (a subtype of) List<int>,
-      // but the static type system doesn't know that, and so we cast.
-      return JsonUtf8Encoder(indent, _toEncodable) as Converter<Object?, T>;
-    }
-    return super.fuse<T>(other);
-  }
-}
-
-/// Encoder that encodes a single object as a UTF-8 encoded JSON string.
-///
-/// This encoder works equivalently to first converting the object to
-/// a JSON string, and then UTF-8 encoding the string, but without
-/// creating an intermediate string.
-class JsonUtf8Encoder extends Converter<Object?, List<int>> {
-  /// Default buffer size used by the JSON-to-UTF-8 encoder.
-  static const int _defaultBufferSize = 256;
-  @deprecated
-  static const int DEFAULT_BUFFER_SIZE = _defaultBufferSize;
-
-  /// Indentation used in pretty-print mode, `null` if not pretty.
-  final List<int>? _indent;
-
-  /// Function called with each un-encodable object encountered.
-  final Object? Function(dynamic)? _toEncodable;
-
-  /// UTF-8 buffer size.
-  final int _bufferSize;
-
-  /// Create converter.
-  ///
-  /// If [indent] is non-`null`, the converter attempts to "pretty-print" the
-  /// JSON, and uses `indent` as the indentation. Otherwise the result has no
-  /// whitespace outside of string literals.
-  /// If `indent` contains characters that are not valid JSON whitespace
-  /// characters, the result will not be valid JSON. JSON whitespace characters
-  /// are space (U+0020), tab (U+0009), line feed (U+000a) and carriage return
-  /// (U+000d) ([ECMA
-  /// 404](http://www.ecma-international.org/publications/standards/Ecma-404.htm)).
-  ///
-  /// The [bufferSize] is the size of the internal buffers used to collect
-  /// UTF-8 code units.
-  /// If using [startChunkedConversion], it will be the size of the chunks.
-  ///
-  /// The JSON encoder handles numbers, strings, booleans, null, lists and maps
-  /// directly.
-  ///
-  /// Any other object is attempted converted by [toEncodable] to an object that
-  /// is of one of the convertible types.
-  ///
-  /// If [toEncodable] is omitted, it defaults to calling `.toJson()` on the
-  /// object.
-  JsonUtf8Encoder(
-      [String? indent, dynamic toEncodable(dynamic object)?, int? bufferSize])
-      : _indent = _utf8Encode(indent),
-        _toEncodable = toEncodable,
-        _bufferSize = bufferSize ?? _defaultBufferSize;
-
-  static List<int>? _utf8Encode(String? string) {
-    if (string == null) return null;
-    if (string.isEmpty) return Uint8List(0);
-    checkAscii:
-    {
-      for (var i = 0; i < string.length; i++) {
-        if (string.codeUnitAt(i) >= 0x80) break checkAscii;
-      }
-      return string.codeUnits;
-    }
-    return utf8.encode(string);
-  }
-
-  /// Convert [object] into UTF-8 encoded JSON.
-  List<int> convert(Object? object) {
-    var bytes = <List<int>>[];
-    // The `stringify` function always converts into chunks.
-    // Collect the chunks into the `bytes` list, then combine them afterwards.
-    void addChunk(Uint8List chunk, int start, int end) {
-      if (start > 0 || end < chunk.length) {
-        var length = end - start;
-        chunk =
-            Uint8List.view(chunk.buffer, chunk.offsetInBytes + start, length);
-      }
-      bytes.add(chunk);
-    }
-
-    _JsonUtf8Stringifier.stringify(
-        object, _indent, _toEncodable, _bufferSize, addChunk);
-    if (bytes.length == 1) return bytes[0];
-    var length = 0;
-    for (var i = 0; i < bytes.length; i++) {
-      length += bytes[i].length;
-    }
-    var result = Uint8List(length);
-    for (var i = 0, offset = 0; i < bytes.length; i++) {
-      var byteList = bytes[i];
-      int end = offset + byteList.length;
-      result.setRange(offset, end, byteList);
-      offset = end;
-    }
-    return result;
-  }
-
-  /// Start a chunked conversion.
-  ///
-  /// Only one object can be passed into the returned sink.
-  ///
-  /// The argument [sink] will receive byte lists in sizes depending on the
-  /// `bufferSize` passed to the constructor when creating this encoder.
-  ChunkedConversionSink<Object?> startChunkedConversion(Sink<List<int>> sink) {
-    ByteConversionSink byteSink;
-    if (sink is ByteConversionSink) {
-      byteSink = sink;
-    } else {
-      byteSink = ByteConversionSink.from(sink);
-    }
-    return _JsonUtf8EncoderSink(byteSink, _toEncodable, _indent, _bufferSize);
-  }
-
-  // Override the base class's bind, to provide a better type.
-  Stream<List<int>> bind(Stream<Object?> stream) {
-    return super.bind(stream);
-  }
-}
-
-/// Implements the chunked conversion from object to its JSON representation.
-///
-/// The sink only accepts one value, but will produce output in a chunked way.
-class _JsonEncoderSink extends ChunkedConversionSink<Object?> {
-  final String? _indent;
-  final Object? Function(dynamic)? _toEncodable;
-  final StringConversionSink _sink;
-  bool _isDone = false;
-
-  _JsonEncoderSink(this._sink, this._toEncodable, this._indent);
-
-  /// Encodes the given object [o].
-  ///
-  /// It is an error to invoke this method more than once on any instance. While
-  /// this makes the input effectively non-chunked the output will be generated
-  /// in a chunked way.
-  void add(Object? o) {
-    if (_isDone) {
-      throw StateError("Only one call to add allowed");
-    }
-    _isDone = true;
-    var stringSink = _sink.asStringSink();
-    _JsonStringStringifier.printOn(o, stringSink, _toEncodable, _indent);
-    stringSink.close();
-  }
-
-  void close() {/* do nothing */}
-}
-
-/// Sink returned when starting a chunked conversion from object to bytes.
-class _JsonUtf8EncoderSink extends ChunkedConversionSink<Object?> {
-  /// The byte sink receiveing the encoded chunks.
-  final ByteConversionSink _sink;
-  final List<int>? _indent;
-  final Object? Function(dynamic)? _toEncodable;
-  final int _bufferSize;
-  bool _isDone = false;
-  _JsonUtf8EncoderSink(
-      this._sink, this._toEncodable, this._indent, this._bufferSize);
-
-  /// Callback called for each slice of result bytes.
-  void _addChunk(Uint8List chunk, int start, int end) {
-    _sink.addSlice(chunk, start, end, false);
-  }
-
-  void add(Object? object) {
-    if (_isDone) {
-      throw StateError("Only one call to add allowed");
-    }
-    _isDone = true;
-    _JsonUtf8Stringifier.stringify(
-        object, _indent, _toEncodable, _bufferSize, _addChunk);
-    _sink.close();
-  }
-
-  void close() {
-    if (!_isDone) {
-      _isDone = true;
-      _sink.close();
-    }
-  }
-}
-
-/// This class parses JSON strings and builds the corresponding objects.
-///
-/// A JSON input must be the JSON encoding of a single JSON value,
-/// which can be a list or map containing other values.
-///
-/// When used as a [StreamTransformer], the input stream may emit
-/// multiple strings. The concatenation of all of these strings must
-/// be a valid JSON encoding of a single JSON value.
-class JsonDecoder extends Converter<String, Object?> {
-  final Object? Function(Object? key, Object? value)? _reviver;
-
-  /// Constructs a new JsonDecoder.
-  ///
-  /// The [reviver] may be `null`.
-  const JsonDecoder([Object? reviver(Object? key, Object? value)?])
-      : _reviver = reviver;
-
-  /// Converts the given JSON-string [input] to its corresponding object.
-  ///
-  /// Parsed JSON values are of the types [num], [String], [bool], [Null],
-  /// [List]s of parsed JSON values or [Map]s from [String] to parsed JSON
-  /// values.
-  ///
-  /// If `this` was initialized with a reviver, then the parsing operation
-  /// invokes the reviver on every object or list property that has been parsed.
-  /// The arguments are the property name ([String]) or list index ([int]), and
-  /// the value is the parsed value. The return value of the reviver is used as
-  /// the value of that property instead the parsed value.
-  ///
-  /// Throws [FormatException] if the input is not valid JSON text.
-  dynamic convert(String input) => _parseJson(input, _reviver);
-
-  /// Starts a conversion from a chunked JSON string to its corresponding object.
-  ///
-  /// The output [sink] receives exactly one decoded element through `add`.
-  external StringConversionSink startChunkedConversion(Sink<Object?> sink);
-
-  // Override the base class's bind, to provide a better type.
-  Stream<Object?> bind(Stream<String> stream) => super.bind(stream);
-}
-
-// Internal optimized JSON parsing implementation.
-external dynamic _parseJson(String source, reviver(key, value)?);
-
-// Implementation of encoder/stringifier.
-
-dynamic _defaultToEncodable(dynamic object) => object.toJson();
-
-/// JSON encoder that traverses an object structure and writes JSON source.
-///
-/// This is an abstract implementation that doesn't decide on the output
-/// format, but writes the JSON through abstract methods like [writeString].
-abstract class _JsonStringifier {
-  // Character code constants.
-  static const int backspace = 0x08;
-  static const int tab = 0x09;
-  static const int newline = 0x0a;
-  static const int carriageReturn = 0x0d;
-  static const int formFeed = 0x0c;
-  static const int quote = 0x22;
-  static const int char_0 = 0x30;
-  static const int backslash = 0x5c;
-  static const int char_b = 0x62;
-  static const int char_d = 0x64;
-  static const int char_f = 0x66;
-  static const int char_n = 0x6e;
-  static const int char_r = 0x72;
-  static const int char_t = 0x74;
-  static const int char_u = 0x75;
-  static const int surrogateMin = 0xd800;
-  static const int surrogateMask = 0xfc00;
-  static const int surrogateLead = 0xd800;
-  static const int surrogateTrail = 0xdc00;
-
-  /// List of objects currently being traversed. Used to detect cycles.
-  final List _seen = [];
-
-  /// Function called for each un-encodable object encountered.
-  final Function(dynamic) _toEncodable;
-
-  _JsonStringifier(dynamic toEncodable(dynamic o)?)
-      : _toEncodable = toEncodable ?? _defaultToEncodable;
-
-  String? get _partialResult;
-
-  /// Append a string to the JSON output.
-  void writeString(String characters);
-
-  /// Append part of a string to the JSON output.
-  void writeStringSlice(String characters, int start, int end);
-
-  /// Append a single character, given by its code point, to the JSON output.
-  void writeCharCode(int charCode);
-
-  /// Write a number to the JSON output.
-  void writeNumber(num number);
-
-  // ('0' + x) or ('a' + x - 10)
-  static int hexDigit(int x) => x < 10 ? 48 + x : 87 + x;
-
-  /// Write, and suitably escape, a string's content as a JSON string literal.
-  void writeStringContent(String s) {
-    var offset = 0;
-    final length = s.length;
-    for (var i = 0; i < length; i++) {
-      var charCode = s.codeUnitAt(i);
-      if (charCode > backslash) {
-        if (charCode >= surrogateMin) {
-          // Possible surrogate. Check if it is unpaired.
-          if (((charCode & surrogateMask) == surrogateLead &&
-                  !(i + 1 < length &&
-                      (s.codeUnitAt(i + 1) & surrogateMask) ==
-                          surrogateTrail)) ||
-              ((charCode & surrogateMask) == surrogateTrail &&
-                  !(i - 1 >= 0 &&
-                      (s.codeUnitAt(i - 1) & surrogateMask) ==
-                          surrogateLead))) {
-            // Lone surrogate.
-            if (i > offset) writeStringSlice(s, offset, i);
-            offset = i + 1;
-            writeCharCode(backslash);
-            writeCharCode(char_u);
-            writeCharCode(char_d);
-            writeCharCode(hexDigit((charCode >> 8) & 0xf));
-            writeCharCode(hexDigit((charCode >> 4) & 0xf));
-            writeCharCode(hexDigit(charCode & 0xf));
-          }
-        }
-        continue;
-      }
-      if (charCode < 32) {
-        if (i > offset) writeStringSlice(s, offset, i);
-        offset = i + 1;
-        writeCharCode(backslash);
-        switch (charCode) {
-          case backspace:
-            writeCharCode(char_b);
-            break;
-          case tab:
-            writeCharCode(char_t);
-            break;
-          case newline:
-            writeCharCode(char_n);
-            break;
-          case formFeed:
-            writeCharCode(char_f);
-            break;
-          case carriageReturn:
-            writeCharCode(char_r);
-            break;
-          default:
-            writeCharCode(char_u);
-            writeCharCode(char_0);
-            writeCharCode(char_0);
-            writeCharCode(hexDigit((charCode >> 4) & 0xf));
-            writeCharCode(hexDigit(charCode & 0xf));
-            break;
-        }
-      } else if (charCode == quote || charCode == backslash) {
-        if (i > offset) writeStringSlice(s, offset, i);
-        offset = i + 1;
-        writeCharCode(backslash);
-        writeCharCode(charCode);
-      }
-    }
-    if (offset == 0) {
-      writeString(s);
-    } else if (offset < length) {
-      writeStringSlice(s, offset, length);
-    }
-  }
-
-  /// Check if an encountered object is already being traversed.
-  ///
-  /// Records the object if it isn't already seen. Should have a matching call to
-  /// [_removeSeen] when the object is no longer being traversed.
-  void _checkCycle(Object? object) {
-    for (var i = 0; i < _seen.length; i++) {
-      if (identical(object, _seen[i])) {
-        throw JsonCyclicError(object);
-      }
-    }
-    _seen.add(object);
-  }
-
-  /// Remove [object] from the list of currently traversed objects.
-  ///
-  /// Should be called in the opposite order of the matching [_checkCycle]
-  /// calls.
-  void _removeSeen(Object? object) {
-    assert(_seen.isNotEmpty);
-    assert(identical(_seen.last, object));
-    _seen.removeLast();
-  }
-
-  /// Write an object.
-  ///
-  /// If [object] isn't directly encodable, the [_toEncodable] function gets one
-  /// chance to return a replacement which is encodable.
-  void writeObject(Object? object) {
-    // Tries stringifying object directly. If it's not a simple value, List or
-    // Map, call toJson() to get a custom representation and try serializing
-    // that.
-    if (writeJsonValue(object)) return;
-    _checkCycle(object);
-    try {
-      var customJson = _toEncodable(object);
-      if (!writeJsonValue(customJson)) {
-        throw JsonUnsupportedObjectError(object, partialResult: _partialResult);
-      }
-      _removeSeen(object);
-    } catch (e) {
-      throw JsonUnsupportedObjectError(object,
-          cause: e, partialResult: _partialResult);
-    }
-  }
-
-  /// Serialize a [num], [String], [bool], [Null], [List] or [Map] value.
-  ///
-  /// Returns true if the value is one of these types, and false if not.
-  /// If a value is both a [List] and a [Map], it's serialized as a [List].
-  bool writeJsonValue(Object? object) {
-    if (object is num) {
-      if (!object.isFinite) return false;
-      writeNumber(object);
-      return true;
-    } else if (identical(object, true)) {
-      writeString('true');
-      return true;
-    } else if (identical(object, false)) {
-      writeString('false');
-      return true;
-    } else if (object == null) {
-      writeString('null');
-      return true;
-    } else if (object is String) {
-      writeString('"');
-      writeStringContent(object);
-      writeString('"');
-      return true;
-    } else if (object is List) {
-      _checkCycle(object);
-      writeList(object);
-      _removeSeen(object);
-      return true;
-    } else if (object is Map) {
-      _checkCycle(object);
-      // writeMap can fail if keys are not all strings.
-      var success = writeMap(object);
-      _removeSeen(object);
-      return success;
-    } else {
-      return false;
-    }
-  }
-
-  /// Serialize a [List].
-  void writeList(List<Object?> list) {
-    writeString('[');
-    if (list.isNotEmpty) {
-      writeObject(list[0]);
-      for (var i = 1; i < list.length; i++) {
-        writeString(',');
-        writeObject(list[i]);
-      }
-    }
-    writeString(']');
-  }
-
-  /// Serialize a [Map].
-  bool writeMap(Map<Object?, Object?> map) {
-    if (map.isEmpty) {
-      writeString("{}");
-      return true;
-    }
-    var keyValueList = List<Object?>.filled(map.length * 2, null);
-    var i = 0;
-    var allStringKeys = true;
-    map.forEach((key, value) {
-      if (key is! String) {
-        allStringKeys = false;
-      }
-      keyValueList[i++] = key;
-      keyValueList[i++] = value;
-    });
-    if (!allStringKeys) return false;
-    writeString('{');
-    var separator = '"';
-    for (var i = 0; i < keyValueList.length; i += 2) {
-      writeString(separator);
-      separator = ',"';
-      writeStringContent(keyValueList[i] as String);
-      writeString('":');
-      writeObject(keyValueList[i + 1]);
-    }
-    writeString('}');
-    return true;
-  }
-}
-
-/// A modification of [_JsonStringifier] which indents the contents of [List] and
-/// [Map] objects using the specified indent value.
-///
-/// Subclasses should implement [writeIndentation].
-abstract class _JsonPrettyPrintMixin implements _JsonStringifier {
-  int _indentLevel = 0;
-
-  /// Add [indentLevel] indentations to the JSON output.
-  void writeIndentation(int indentLevel);
-
-  void writeList(List<Object?> list) {
-    if (list.isEmpty) {
-      writeString('[]');
-    } else {
-      writeString('[\n');
-      _indentLevel++;
-      writeIndentation(_indentLevel);
-      writeObject(list[0]);
-      for (var i = 1; i < list.length; i++) {
-        writeString(',\n');
-        writeIndentation(_indentLevel);
-        writeObject(list[i]);
-      }
-      writeString('\n');
-      _indentLevel--;
-      writeIndentation(_indentLevel);
-      writeString(']');
-    }
-  }
-
-  bool writeMap(Map<Object?, Object?> map) {
-    if (map.isEmpty) {
-      writeString("{}");
-      return true;
-    }
-    var keyValueList = List<Object?>.filled(map.length * 2, null);
-    var i = 0;
-    var allStringKeys = true;
-    map.forEach((key, value) {
-      if (key is! String) {
-        allStringKeys = false;
-      }
-      keyValueList[i++] = key;
-      keyValueList[i++] = value;
-    });
-    if (!allStringKeys) return false;
-    writeString('{\n');
-    _indentLevel++;
-    var separator = "";
-    for (var i = 0; i < keyValueList.length; i += 2) {
-      writeString(separator);
-      separator = ",\n";
-      writeIndentation(_indentLevel);
-      writeString('"');
-      writeStringContent(keyValueList[i] as String);
-      writeString('": ');
-      writeObject(keyValueList[i + 1]);
-    }
-    writeString('\n');
-    _indentLevel--;
-    writeIndentation(_indentLevel);
-    writeString('}');
-    return true;
-  }
-}
-
-/// A specialization of [_JsonStringifier] that writes its JSON to a string.
-class _JsonStringStringifier extends _JsonStringifier {
-  final StringSink _sink;
-
-  _JsonStringStringifier(
-      this._sink, dynamic Function(dynamic object)? _toEncodable)
-      : super(_toEncodable);
-
-  /// Convert object to a string.
-  ///
-  /// The [toEncodable] function is used to convert non-encodable objects
-  /// to encodable ones.
-  ///
-  /// If [indent] is not `null`, the resulting JSON will be "pretty-printed"
-  /// with newlines and indentation. The `indent` string is added as indentation
-  /// for each indentation level. It should only contain valid JSON whitespace
-  /// characters (space, tab, carriage return or line feed).
-  static String stringify(
-      Object? object, dynamic toEncodable(dynamic object)?, String? indent) {
-    var output = StringBuffer();
-    printOn(object, output, toEncodable, indent);
-    return output.toString();
-  }
-
-  /// Convert object to a string, and write the result to the [output] sink.
-  ///
-  /// The result is written piecemally to the sink.
-  static void printOn(Object? object, StringSink output,
-      dynamic toEncodable(dynamic o)?, String? indent) {
-    _JsonStringifier stringifier;
-    if (indent == null) {
-      stringifier = _JsonStringStringifier(output, toEncodable);
-    } else {
-      stringifier = _JsonStringStringifierPretty(output, toEncodable, indent);
-    }
-    stringifier.writeObject(object);
-  }
-
-  String? get _partialResult => _sink is StringBuffer ? _sink.toString() : null;
-
-  void writeNumber(num number) {
-    _sink.write(number.toString());
-  }
-
-  void writeString(String string) {
-    _sink.write(string);
-  }
-
-  void writeStringSlice(String string, int start, int end) {
-    _sink.write(string.substring(start, end));
-  }
-
-  void writeCharCode(int charCode) {
-    _sink.writeCharCode(charCode);
-  }
-}
-
-class _JsonStringStringifierPretty extends _JsonStringStringifier
-    with _JsonPrettyPrintMixin {
-  final String _indent;
-
-  _JsonStringStringifierPretty(
-      StringSink sink, dynamic toEncodable(dynamic o)?, this._indent)
-      : super(sink, toEncodable);
-
-  void writeIndentation(int count) {
-    for (var i = 0; i < count; i++) writeString(_indent);
-  }
-}
-
-/// Specialization of [_JsonStringifier] that writes the JSON as UTF-8.
-///
-/// The JSON text is UTF-8 encoded and written to [Uint8List] buffers.
-/// The buffers are then passed back to a user provided callback method.
-class _JsonUtf8Stringifier extends _JsonStringifier {
-  final int bufferSize;
-  final void Function(Uint8List list, int start, int end) addChunk;
-  Uint8List buffer;
-  int index = 0;
-
-  _JsonUtf8Stringifier(
-      dynamic toEncodable(dynamic o)?, this.bufferSize, this.addChunk)
-      : buffer = Uint8List(bufferSize),
-        super(toEncodable);
-
-  /// Convert [object] to UTF-8 encoded JSON.
-  ///
-  /// Calls [addChunk] with slices of UTF-8 code units.
-  /// These will typically have size [bufferSize], but may be shorter.
-  /// The buffers are not reused, so the [addChunk] call may keep and reuse the
-  /// chunks.
-  ///
-  /// If [indent] is non-`null`, the result will be "pretty-printed" with extra
-  /// newlines and indentation, using [indent] as the indentation.
-  static void stringify(
-      Object? object,
-      List<int>? indent,
-      dynamic toEncodable(dynamic o)?,
-      int bufferSize,
-      void addChunk(Uint8List chunk, int start, int end)) {
-    _JsonUtf8Stringifier stringifier;
-    if (indent != null) {
-      stringifier =
-          _JsonUtf8StringifierPretty(toEncodable, indent, bufferSize, addChunk);
-    } else {
-      stringifier = _JsonUtf8Stringifier(toEncodable, bufferSize, addChunk);
-    }
-    stringifier.writeObject(object);
-    stringifier.flush();
-  }
-
-  /// Must be called at the end to push the last chunk to the [addChunk]
-  /// callback.
-  void flush() {
-    if (index > 0) {
-      addChunk(buffer, 0, index);
-    }
-    buffer = Uint8List(0);
-    index = 0;
-  }
-
-  String? get _partialResult => null;
-
-  void writeNumber(num number) {
-    writeAsciiString(number.toString());
-  }
-
-  /// Write a string that is known to not have non-ASCII characters.
-  void writeAsciiString(String string) {
-    // TODO(lrn): Optimize by copying directly into buffer instead of going
-    // through writeCharCode;
-    for (var i = 0; i < string.length; i++) {
-      var char = string.codeUnitAt(i);
-      assert(char <= 0x7f);
-      writeByte(char);
-    }
-  }
-
-  void writeString(String string) {
-    writeStringSlice(string, 0, string.length);
-  }
-
-  void writeStringSlice(String string, int start, int end) {
-    // TODO(lrn): Optimize by copying directly into buffer instead of going
-    // through writeCharCode/writeByte. Assumption is the most characters
-    // in strings are plain ASCII.
-    for (var i = start; i < end; i++) {
-      var char = string.codeUnitAt(i);
-      if (char <= 0x7f) {
-        writeByte(char);
-      } else {
-        if ((char & 0xF800) == 0xD800) {
-          // Surrogate.
-          if (char < 0xDC00 && i + 1 < end) {
-            // Lead surrogate.
-            var nextChar = string.codeUnitAt(i + 1);
-            if ((nextChar & 0xFC00) == 0xDC00) {
-              // Tail surrogate.
-              char = 0x10000 + ((char & 0x3ff) << 10) + (nextChar & 0x3ff);
-              writeFourByteCharCode(char);
-              i++;
-              continue;
-            }
-          }
-          // Unpaired surrogate.
-          writeMultiByteCharCode(unicodeReplacementCharacterRune);
-          continue;
-        }
-        writeMultiByteCharCode(char);
-      }
-    }
-  }
-
-  void writeCharCode(int charCode) {
-    if (charCode <= 0x7f) {
-      writeByte(charCode);
-      return;
-    }
-    writeMultiByteCharCode(charCode);
-  }
-
-  void writeMultiByteCharCode(int charCode) {
-    if (charCode <= 0x7ff) {
-      writeByte(0xC0 | (charCode >> 6));
-      writeByte(0x80 | (charCode & 0x3f));
-      return;
-    }
-    if (charCode <= 0xffff) {
-      writeByte(0xE0 | (charCode >> 12));
-      writeByte(0x80 | ((charCode >> 6) & 0x3f));
-      writeByte(0x80 | (charCode & 0x3f));
-      return;
-    }
-    writeFourByteCharCode(charCode);
-  }
-
-  void writeFourByteCharCode(int charCode) {
-    assert(charCode <= 0x10ffff);
-    writeByte(0xF0 | (charCode >> 18));
-    writeByte(0x80 | ((charCode >> 12) & 0x3f));
-    writeByte(0x80 | ((charCode >> 6) & 0x3f));
-    writeByte(0x80 | (charCode & 0x3f));
-  }
-
-  void writeByte(int byte) {
-    assert(byte <= 0xff);
-    if (index == buffer.length) {
-      addChunk(buffer, 0, index);
-      buffer = Uint8List(bufferSize);
-      index = 0;
-    }
-    buffer[index++] = byte;
-  }
-}
-
-/// Pretty-printing version of [_JsonUtf8Stringifier].
-class _JsonUtf8StringifierPretty extends _JsonUtf8Stringifier
-    with _JsonPrettyPrintMixin {
-  final List<int> indent;
-  _JsonUtf8StringifierPretty(dynamic toEncodable(dynamic o)?, this.indent,
-      int bufferSize, void addChunk(Uint8List buffer, int start, int end))
-      : super(toEncodable, bufferSize, addChunk);
-
-  void writeIndentation(int count) {
-    var indent = this.indent;
-    var indentLength = indent.length;
-    if (indentLength == 1) {
-      var char = indent[0];
-      while (count > 0) {
-        writeByte(char);
-        count -= 1;
-      }
-      return;
-    }
-    while (count > 0) {
-      count--;
-      var end = index + indentLength;
-      if (end <= buffer.length) {
-        buffer.setRange(index, end, indent);
-        index = end;
-      } else {
-        for (var i = 0; i < indentLength; i++) {
-          writeByte(indent[i]);
-        }
-      }
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/convert/latin1.dart b/sdk_nnbd/lib/convert/latin1.dart
deleted file mode 100644
index f396682..0000000
--- a/sdk_nnbd/lib/convert/latin1.dart
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// An instance of the default implementation of the [Latin1Codec].
-///
-/// This instance provides a convenient access to the most common ISO Latin 1
-/// use cases.
-///
-/// Examples:
-/// ```dart
-/// var encoded = latin1.encode("blåbærgrød");
-/// var decoded = latin1.decode([0x62, 0x6c, 0xe5, 0x62, 0xe6,
-///                              0x72, 0x67, 0x72, 0xf8, 0x64]);
-/// ```
-const Latin1Codec latin1 = Latin1Codec();
-
-const int _latin1Mask = 0xFF;
-
-/// A [Latin1Codec] encodes strings to ISO Latin-1 (aka ISO-8859-1) bytes
-/// and decodes Latin-1 bytes to strings.
-class Latin1Codec extends Encoding {
-  final bool _allowInvalid;
-
-  /// Instantiates a new [Latin1Codec].
-  ///
-  /// If [allowInvalid] is true, the [decode] method and the converter
-  /// returned by [decoder] will default to allowing invalid values. Invalid
-  /// values are decoded into the Unicode Replacement character (U+FFFD).
-  /// Calls to the [decode] method can override this default.
-  ///
-  /// Encoders will not accept invalid (non Latin-1) characters.
-  const Latin1Codec({bool allowInvalid = false}) : _allowInvalid = allowInvalid;
-
-  /// The name of this codec, "iso-8859-1".
-  String get name => "iso-8859-1";
-
-  Uint8List encode(String source) => encoder.convert(source);
-
-  /// Decodes the Latin-1 [bytes] (a list of unsigned 8-bit integers) to the
-  /// corresponding string.
-  ///
-  /// If [bytes] contains values that are not in the range 0 .. 255, the decoder
-  /// will eventually throw a [FormatException].
-  ///
-  /// If [allowInvalid] is not provided, it defaults to the value used to create
-  /// this [Latin1Codec].
-  String decode(List<int> bytes, {bool? allowInvalid}) {
-    if (allowInvalid ?? _allowInvalid) {
-      return const Latin1Decoder(allowInvalid: true).convert(bytes);
-    } else {
-      return const Latin1Decoder(allowInvalid: false).convert(bytes);
-    }
-  }
-
-  Latin1Encoder get encoder => const Latin1Encoder();
-
-  Latin1Decoder get decoder => _allowInvalid
-      ? const Latin1Decoder(allowInvalid: true)
-      : const Latin1Decoder(allowInvalid: false);
-}
-
-/// This class converts strings of only ISO Latin-1 characters to bytes.
-class Latin1Encoder extends _UnicodeSubsetEncoder {
-  const Latin1Encoder() : super(_latin1Mask);
-}
-
-/// This class converts Latin-1 bytes (lists of unsigned 8-bit integers)
-/// to a string.
-class Latin1Decoder extends _UnicodeSubsetDecoder {
-  /// Instantiates a new [Latin1Decoder].
-  ///
-  /// The optional [allowInvalid] argument defines how [convert] deals
-  /// with invalid bytes.
-  ///
-  /// If it is `true`, [convert] replaces invalid bytes with the Unicode
-  /// Replacement character `U+FFFD` (�).
-  /// Otherwise it throws a [FormatException].
-  const Latin1Decoder({bool allowInvalid = false})
-      : super(allowInvalid, _latin1Mask);
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [StringConversionSink].
-  ByteConversionSink startChunkedConversion(Sink<String> sink) {
-    StringConversionSink stringSink;
-    if (sink is StringConversionSink) {
-      stringSink = sink;
-    } else {
-      stringSink = StringConversionSink.from(sink);
-    }
-    // TODO(lrn): Use stringSink.asUtf16Sink() if it becomes available.
-    if (!_allowInvalid) return _Latin1DecoderSink(stringSink);
-    return _Latin1AllowInvalidDecoderSink(stringSink);
-  }
-}
-
-class _Latin1DecoderSink extends ByteConversionSinkBase {
-  StringConversionSink? _sink;
-  _Latin1DecoderSink(this._sink);
-
-  void close() {
-    _sink!.close();
-    _sink = null;
-  }
-
-  void add(List<int> source) {
-    addSlice(source, 0, source.length, false);
-  }
-
-  void _addSliceToSink(List<int> source, int start, int end, bool isLast) {
-    // If _sink was a UTF-16 conversion sink, just add the slice directly with
-    // _sink.addSlice(source, start, end, isLast).
-    // The code below is an moderately stupid workaround until a real
-    // solution can be made.
-    _sink!.add(String.fromCharCodes(source, start, end));
-    if (isLast) close();
-  }
-
-  void addSlice(List<int> source, int start, int end, bool isLast) {
-    RangeError.checkValidRange(start, end, source.length);
-    if (start == end) return;
-    if (source is! Uint8List) {
-      // List may contain value outside of the 0..255 range. If so, throw.
-      // Technically, we could excuse Uint8ClampedList as well, but it unlikely
-      // to be relevant.
-      _checkValidLatin1(source, start, end);
-    }
-    _addSliceToSink(source, start, end, isLast);
-  }
-
-  static void _checkValidLatin1(List<int> source, int start, int end) {
-    var mask = 0;
-    for (var i = start; i < end; i++) {
-      mask |= source[i];
-    }
-    if (mask >= 0 && mask <= _latin1Mask) {
-      return;
-    }
-    _reportInvalidLatin1(source, start, end); // Always throws.
-  }
-
-  static void _reportInvalidLatin1(List<int> source, int start, int end) {
-    // Find the index of the first non-Latin-1 character code.
-    for (var i = start; i < end; i++) {
-      var char = source[i];
-      if (char < 0 || char > _latin1Mask) {
-        throw FormatException(
-            "Source contains non-Latin-1 characters.", source, i);
-      }
-    }
-    // Unreachable - we only call the function if the loop above throws.
-    assert(false);
-  }
-}
-
-class _Latin1AllowInvalidDecoderSink extends _Latin1DecoderSink {
-  _Latin1AllowInvalidDecoderSink(StringConversionSink sink) : super(sink);
-
-  void addSlice(List<int> source, int start, int end, bool isLast) {
-    RangeError.checkValidRange(start, end, source.length);
-    for (var i = start; i < end; i++) {
-      var char = source[i];
-      if (char > _latin1Mask || char < 0) {
-        if (i > start) _addSliceToSink(source, start, i, false);
-        // Add UTF-8 encoding of U+FFFD.
-        _addSliceToSink(const [0xFFFD], 0, 1, false);
-        start = i + 1;
-      }
-    }
-    if (start < end) {
-      _addSliceToSink(source, start, end, isLast);
-    }
-    if (isLast) {
-      close();
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/convert/line_splitter.dart b/sdk_nnbd/lib/convert/line_splitter.dart
deleted file mode 100644
index fa0be3f..0000000
--- a/sdk_nnbd/lib/convert/line_splitter.dart
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-// Character constants.
-const int _LF = 10;
-const int _CR = 13;
-
-/// A [StreamTransformer] that splits a [String] into individual lines.
-///
-/// A line is terminated by either a CR (U+000D), a LF (U+000A), a
-/// CR+LF sequence (DOS line ending),
-/// and a final non-empty line can be ended by the end of the string.
-///
-/// The returned lines do not contain the line terminators.
-
-class LineSplitter extends StreamTransformerBase<String, String> {
-  const LineSplitter();
-
-  /// Split [lines] into individual lines.
-  ///
-  /// If [start] and [end] are provided, only split the contents of
-  /// `lines.substring(start, end)`. The [start] and [end] values must
-  /// specify a valid sub-range of [lines]
-  /// (`0 <= start <= end <= lines.length`).
-  static Iterable<String> split(String lines, [int start = 0, int? end]) sync* {
-    end = RangeError.checkValidRange(start, end, lines.length);
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (end == null) {
-      throw RangeError("Invalid range");
-    }
-    var sliceStart = start;
-    var char = 0;
-    for (var i = start; i < end; i++) {
-      var previousChar = char;
-      char = lines.codeUnitAt(i);
-      if (char != _CR) {
-        if (char != _LF) continue;
-        if (previousChar == _CR) {
-          sliceStart = i + 1;
-          continue;
-        }
-      }
-      yield lines.substring(sliceStart, i);
-      sliceStart = i + 1;
-    }
-    if (sliceStart < end) {
-      yield lines.substring(sliceStart, end);
-    }
-  }
-
-  List<String> convert(String data) {
-    var lines = <String>[];
-    var end = data.length;
-    var sliceStart = 0;
-    var char = 0;
-    for (var i = 0; i < end; i++) {
-      var previousChar = char;
-      char = data.codeUnitAt(i);
-      if (char != _CR) {
-        if (char != _LF) continue;
-        if (previousChar == _CR) {
-          sliceStart = i + 1;
-          continue;
-        }
-      }
-      lines.add(data.substring(sliceStart, i));
-      sliceStart = i + 1;
-    }
-    if (sliceStart < end) {
-      lines.add(data.substring(sliceStart, end));
-    }
-    return lines;
-  }
-
-  StringConversionSink startChunkedConversion(Sink<String> sink) {
-    return _LineSplitterSink(
-        sink is StringConversionSink ? sink : StringConversionSink.from(sink));
-  }
-
-  Stream<String> bind(Stream<String> stream) {
-    return Stream<String>.eventTransformed(
-        stream, (EventSink<String> sink) => _LineSplitterEventSink(sink));
-  }
-}
-
-// TODO(floitsch): deal with utf8.
-class _LineSplitterSink extends StringConversionSinkBase {
-  final StringConversionSink _sink;
-
-  /// The carry-over from the previous chunk.
-  ///
-  /// If the previous slice ended in a line without a line terminator,
-  /// then the next slice may continue the line.
-  String? _carry;
-
-  /// Whether to skip a leading LF character from the next slice.
-  ///
-  /// If the previous slice ended on a CR character, a following LF
-  /// would be part of the same line termination, and should be ignored.
-  ///
-  /// Only `true` when [_carry] is `null`.
-  bool _skipLeadingLF = false;
-
-  _LineSplitterSink(this._sink);
-
-  void addSlice(String chunk, int start, int end, bool isLast) {
-    end = RangeError.checkValidRange(start, end, chunk.length);
-    // If the chunk is empty, it's probably because it's the last one.
-    // Handle that here, so we know the range is non-empty below.
-    if (start >= end) {
-      if (isLast) close();
-      return;
-    }
-    String? carry = _carry;
-    if (carry != null) {
-      assert(!_skipLeadingLF);
-      chunk = carry + chunk.substring(start, end);
-      start = 0;
-      end = chunk.length;
-      _carry = null;
-    } else if (_skipLeadingLF) {
-      if (chunk.codeUnitAt(start) == _LF) {
-        start += 1;
-      }
-      _skipLeadingLF = false;
-    }
-    _addLines(chunk, start, end);
-    if (isLast) close();
-  }
-
-  void close() {
-    if (_carry != null) {
-      _sink.add(_carry!);
-      _carry = null;
-    }
-    _sink.close();
-  }
-
-  void _addLines(String lines, int start, int end) {
-    var sliceStart = start;
-    var char = 0;
-    for (var i = start; i < end; i++) {
-      var previousChar = char;
-      char = lines.codeUnitAt(i);
-      if (char != _CR) {
-        if (char != _LF) continue;
-        if (previousChar == _CR) {
-          sliceStart = i + 1;
-          continue;
-        }
-      }
-      _sink.add(lines.substring(sliceStart, i));
-      sliceStart = i + 1;
-    }
-    if (sliceStart < end) {
-      _carry = lines.substring(sliceStart, end);
-    } else {
-      _skipLeadingLF = (char == _CR);
-    }
-  }
-}
-
-class _LineSplitterEventSink extends _LineSplitterSink
-    implements EventSink<String> {
-  final EventSink<String> _eventSink;
-
-  _LineSplitterEventSink(EventSink<String> eventSink)
-      : _eventSink = eventSink,
-        super(StringConversionSink.from(eventSink));
-
-  void addError(Object o, [StackTrace? stackTrace]) {
-    _eventSink.addError(o, stackTrace);
-  }
-}
diff --git a/sdk_nnbd/lib/convert/string_conversion.dart b/sdk_nnbd/lib/convert/string_conversion.dart
deleted file mode 100644
index 2315330..0000000
--- a/sdk_nnbd/lib/convert/string_conversion.dart
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// This class provides an interface for converters to
-/// efficiently transmit String data.
-///
-/// Instead of limiting the interface to one non-chunked String it accepts
-/// partial strings or can be transformed into a byte sink that
-/// accepts UTF-8 code units.
-///
-/// This abstract class will likely get more methods over time. Implementers are
-/// urged to extend [StringConversionSinkBase] or to mix in
-/// [StringConversionSinkMixin], to ensure that their class covers the newly
-/// added methods.
-abstract class StringConversionSink extends ChunkedConversionSink<String> {
-  StringConversionSink();
-  factory StringConversionSink.withCallback(void callback(String accumulated)) =
-      _StringCallbackSink;
-  factory StringConversionSink.from(Sink<String> sink) = _StringAdapterSink;
-
-  /// Creates a new instance wrapping the given [sink].
-  ///
-  /// Every string that is added to the returned instance is forwarded to
-  /// the [sink]. The instance is allowed to buffer and is not required to
-  /// forward immediately.
-  factory StringConversionSink.fromStringSink(StringSink sink) =
-      _StringSinkConversionSink<StringSink>;
-
-  /// Adds the next [chunk] to `this`.
-  ///
-  /// Adds the substring defined by [start] and [end]-exclusive to `this`.
-  ///
-  /// If [isLast] is `true` closes `this`.
-  void addSlice(String chunk, int start, int end, bool isLast);
-
-  /// Returns `this` as a sink that accepts UTF-8 input.
-  ///
-  /// If used, this method must be the first and only call to `this`. It
-  /// invalidates `this`. All further operations must be performed on the result.
-  ByteConversionSink asUtf8Sink(bool allowMalformed);
-  // - asRuneSink
-  // - asCodeUnitsSink
-
-  /// Returns `this` as a [ClosableStringSink].
-  ///
-  /// If used, this method must be the first and only call to `this`. It
-  /// invalidates `this`. All further operations must be performed on the result.
-  ClosableStringSink asStringSink();
-}
-
-/// A [ClosableStringSink] extends the [StringSink] interface by adding a
-/// `close` method.
-abstract class ClosableStringSink extends StringSink {
-  /// Creates a new instance combining a [StringSink] [sink] and a callback
-  /// [onClose] which is invoked when the returned instance is closed.
-  factory ClosableStringSink.fromStringSink(StringSink sink, void onClose()) =
-      _ClosableStringSink;
-
-  /// Closes `this` and flushes any outstanding data.
-  void close();
-}
-
-/// This class wraps an existing [StringSink] and invokes a
-/// closure when [close] is invoked.
-class _ClosableStringSink implements ClosableStringSink {
-  final void Function() _callback;
-  final StringSink _sink;
-
-  _ClosableStringSink(this._sink, this._callback);
-
-  void close() {
-    _callback();
-  }
-
-  void writeCharCode(int charCode) {
-    _sink.writeCharCode(charCode);
-  }
-
-  void write(Object? o) {
-    _sink.write(o);
-  }
-
-  void writeln([Object? o = ""]) {
-    _sink.writeln(o);
-  }
-
-  void writeAll(Iterable objects, [String separator = ""]) {
-    _sink.writeAll(objects, separator);
-  }
-}
-
-/// This class wraps an existing [StringConversionSink] and exposes a
-/// [ClosableStringSink] interface. The wrapped sink only needs to implement
-/// `add` and `close`.
-// TODO(floitsch): make this class public?
-class _StringConversionSinkAsStringSinkAdapter implements ClosableStringSink {
-  static const _MIN_STRING_SIZE = 16;
-
-  final StringBuffer _buffer;
-  final StringConversionSink _chunkedSink;
-
-  _StringConversionSinkAsStringSinkAdapter(this._chunkedSink)
-      : _buffer = StringBuffer();
-
-  void close() {
-    if (_buffer.isNotEmpty) _flush();
-    _chunkedSink.close();
-  }
-
-  void writeCharCode(int charCode) {
-    _buffer.writeCharCode(charCode);
-    if (_buffer.length > _MIN_STRING_SIZE) _flush();
-  }
-
-  void write(Object? o) {
-    if (_buffer.isNotEmpty) _flush();
-    _chunkedSink.add(o.toString());
-  }
-
-  void writeln([Object? o = ""]) {
-    _buffer.writeln(o);
-    if (_buffer.length > _MIN_STRING_SIZE) _flush();
-  }
-
-  void writeAll(Iterable objects, [String separator = ""]) {
-    if (_buffer.isNotEmpty) _flush();
-    var iterator = objects.iterator;
-    if (!iterator.moveNext()) return;
-    if (separator.isEmpty) {
-      do {
-        _chunkedSink.add(iterator.current.toString());
-      } while (iterator.moveNext());
-    } else {
-      _chunkedSink.add(iterator.current.toString());
-      while (iterator.moveNext()) {
-        write(separator);
-        _chunkedSink.add(iterator.current.toString());
-      }
-    }
-  }
-
-  void _flush() {
-    var accumulated = _buffer.toString();
-    _buffer.clear();
-    _chunkedSink.add(accumulated);
-  }
-}
-
-/// This class provides a base-class for converters that need to accept String
-/// inputs.
-abstract class StringConversionSinkBase extends StringConversionSinkMixin {}
-
-/// This class provides a mixin for converters that need to accept String
-/// inputs.
-abstract class StringConversionSinkMixin implements StringConversionSink {
-  void addSlice(String str, int start, int end, bool isLast);
-  void close();
-
-  void add(String str) {
-    addSlice(str, 0, str.length, false);
-  }
-
-  ByteConversionSink asUtf8Sink(bool allowMalformed) {
-    return _Utf8ConversionSink(this, allowMalformed);
-  }
-
-  ClosableStringSink asStringSink() {
-    return _StringConversionSinkAsStringSinkAdapter(this);
-  }
-}
-
-/// This class is a [StringConversionSink] that wraps a [StringSink].
-class _StringSinkConversionSink<TStringSink extends StringSink>
-    extends StringConversionSinkBase {
-  final TStringSink _stringSink;
-  _StringSinkConversionSink(this._stringSink);
-
-  void close() {}
-
-  void addSlice(String str, int start, int end, bool isLast) {
-    if (start != 0 || end != str.length) {
-      for (var i = start; i < end; i++) {
-        _stringSink.writeCharCode(str.codeUnitAt(i));
-      }
-    } else {
-      _stringSink.write(str);
-    }
-    if (isLast) close();
-  }
-
-  void add(String str) {
-    _stringSink.write(str);
-  }
-
-  ByteConversionSink asUtf8Sink(bool allowMalformed) {
-    return _Utf8StringSinkAdapter(this, _stringSink, allowMalformed);
-  }
-
-  ClosableStringSink asStringSink() {
-    return ClosableStringSink.fromStringSink(_stringSink, close);
-  }
-}
-
-/// This class accumulates all chunks into one string
-/// and invokes a callback when the sink is closed.
-///
-/// This class can be used to terminate a chunked conversion.
-class _StringCallbackSink extends _StringSinkConversionSink<StringBuffer> {
-  final void Function(String) _callback;
-
-  _StringCallbackSink(this._callback) : super(StringBuffer());
-
-  void close() {
-    var accumulated = _stringSink.toString();
-    _stringSink.clear();
-    _callback(accumulated);
-  }
-
-  ByteConversionSink asUtf8Sink(bool allowMalformed) {
-    return _Utf8StringSinkAdapter(this, _stringSink, allowMalformed);
-  }
-}
-
-/// This class adapts a simple [ChunkedConversionSink] to a
-/// [StringConversionSink].
-///
-/// All additional methods of the [StringConversionSink] (compared to the
-/// ChunkedConversionSink) are redirected to the `add` method.
-class _StringAdapterSink extends StringConversionSinkBase {
-  final Sink<String> _sink;
-
-  _StringAdapterSink(this._sink);
-
-  void add(String str) {
-    _sink.add(str);
-  }
-
-  void addSlice(String str, int start, int end, bool isLast) {
-    if (start == 0 && end == str.length) {
-      add(str);
-    } else {
-      add(str.substring(start, end));
-    }
-    if (isLast) close();
-  }
-
-  void close() {
-    _sink.close();
-  }
-}
-
-/// Decodes UTF-8 code units and stores them in a [StringSink].
-///
-/// The `Sink` provided is closed when this sink is closed.
-class _Utf8StringSinkAdapter extends ByteConversionSink {
-  final _Utf8Decoder _decoder;
-  final Sink<Object?> _sink;
-  final StringSink _stringSink;
-
-  _Utf8StringSinkAdapter(this._sink, this._stringSink, bool allowMalformed)
-      : _decoder = _Utf8Decoder(allowMalformed);
-
-  void close() {
-    _decoder.flush(_stringSink);
-    _sink.close();
-  }
-
-  void add(List<int> chunk) {
-    addSlice(chunk, 0, chunk.length, false);
-  }
-
-  void addSlice(
-      List<int> codeUnits, int startIndex, int endIndex, bool isLast) {
-    _stringSink.write(_decoder.convertChunked(codeUnits, startIndex, endIndex));
-    if (isLast) close();
-  }
-}
-
-/// Decodes UTF-8 code units.
-///
-/// Forwards the decoded strings to the given [StringConversionSink].
-// TODO(floitsch): make this class public?
-class _Utf8ConversionSink extends ByteConversionSink {
-  final _Utf8Decoder _decoder;
-  final StringConversionSink _chunkedSink;
-  final StringBuffer _buffer;
-  _Utf8ConversionSink(StringConversionSink sink, bool allowMalformed)
-      : this._(sink, StringBuffer(), allowMalformed);
-
-  _Utf8ConversionSink._(
-      this._chunkedSink, StringBuffer stringBuffer, bool allowMalformed)
-      : _decoder = _Utf8Decoder(allowMalformed),
-        _buffer = stringBuffer;
-
-  void close() {
-    _decoder.flush(_buffer);
-    if (_buffer.isNotEmpty) {
-      var accumulated = _buffer.toString();
-      _buffer.clear();
-      _chunkedSink.addSlice(accumulated, 0, accumulated.length, true);
-    } else {
-      _chunkedSink.close();
-    }
-  }
-
-  void add(List<int> chunk) {
-    addSlice(chunk, 0, chunk.length, false);
-  }
-
-  void addSlice(List<int> chunk, int startIndex, int endIndex, bool isLast) {
-    _buffer.write(_decoder.convertChunked(chunk, startIndex, endIndex));
-    if (_buffer.isNotEmpty) {
-      var accumulated = _buffer.toString();
-      _chunkedSink.addSlice(accumulated, 0, accumulated.length, isLast);
-      _buffer.clear();
-      return;
-    }
-    if (isLast) close();
-  }
-}
diff --git a/sdk_nnbd/lib/convert/utf.dart b/sdk_nnbd/lib/convert/utf.dart
deleted file mode 100644
index c74f918..0000000
--- a/sdk_nnbd/lib/convert/utf.dart
+++ /dev/null
@@ -1,691 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.convert;
-
-/// The Unicode Replacement character `U+FFFD` (�).
-const int unicodeReplacementCharacterRune = 0xFFFD;
-
-/// The Unicode Byte Order Marker (BOM) character `U+FEFF`.
-const int unicodeBomCharacterRune = 0xFEFF;
-
-/// An instance of the default implementation of the [Utf8Codec].
-///
-/// This instance provides a convenient access to the most common UTF-8
-/// use cases.
-///
-/// Examples:
-///
-///     var encoded = utf8.encode("Îñţérñåţîöñåļîžåţîờñ");
-///     var decoded = utf8.decode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
-///                                0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
-const Utf8Codec utf8 = Utf8Codec();
-
-/// A [Utf8Codec] encodes strings to utf-8 code units (bytes) and decodes
-/// UTF-8 code units to strings.
-class Utf8Codec extends Encoding {
-  final bool _allowMalformed;
-
-  /// Instantiates a new [Utf8Codec].
-  ///
-  /// The optional [allowMalformed] argument defines how [decoder] (and [decode])
-  /// deal with invalid or unterminated character sequences.
-  ///
-  /// If it is `true` (and not overridden at the method invocation) [decode] and
-  /// the [decoder] replace invalid (or unterminated) octet
-  /// sequences with the Unicode Replacement character `U+FFFD` (�). Otherwise
-  /// they throw a [FormatException].
-  const Utf8Codec({bool allowMalformed = false})
-      : _allowMalformed = allowMalformed;
-
-  /// The name of this codec, "utf-8".
-  String get name => "utf-8";
-
-  /// Decodes the UTF-8 [codeUnits] (a list of unsigned 8-bit integers) to the
-  /// corresponding string.
-  ///
-  /// If the [codeUnits] start with the encoding of a
-  /// [unicodeBomCharacterRune], that character is discarded.
-  ///
-  /// If [allowMalformed] is `true` the decoder replaces invalid (or
-  /// unterminated) character sequences with the Unicode Replacement character
-  /// `U+FFFD` (�). Otherwise it throws a [FormatException].
-  ///
-  /// If [allowMalformed] is not given, it defaults to the `allowMalformed` that
-  /// was used to instantiate `this`.
-  String decode(List<int> codeUnits, {bool? allowMalformed}) {
-    // Switch between const objects to avoid allocation.
-    Utf8Decoder decoder = allowMalformed ?? _allowMalformed
-        ? const Utf8Decoder(allowMalformed: true)
-        : const Utf8Decoder(allowMalformed: false);
-    return decoder.convert(codeUnits);
-  }
-
-  Utf8Encoder get encoder => const Utf8Encoder();
-  Utf8Decoder get decoder {
-    // Switch between const objects to avoid allocation.
-    return _allowMalformed
-        ? const Utf8Decoder(allowMalformed: true)
-        : const Utf8Decoder(allowMalformed: false);
-  }
-}
-
-/// This class converts strings to their UTF-8 code units (a list of
-/// unsigned 8-bit integers).
-class Utf8Encoder extends Converter<String, List<int>> {
-  const Utf8Encoder();
-
-  /// Converts [string] to its UTF-8 code units (a list of
-  /// unsigned 8-bit integers).
-  ///
-  /// If [start] and [end] are provided, only the substring
-  /// `string.substring(start, end)` is converted.
-  ///
-  /// Any unpaired surrogate character (`U+D800`-`U+DFFF`) in the input string
-  /// is encoded as a Unicode Replacement character `U+FFFD` (�).
-  Uint8List convert(String string, [int start = 0, int? end]) {
-    var stringLength = string.length;
-    end = RangeError.checkValidRange(start, end, stringLength);
-    // TODO(38725): Remove workaround when assignment promotion is implemented
-    if (end == null) {
-      throw RangeError("Invalid range");
-    }
-    var length = end - start;
-    if (length == 0) return Uint8List(0);
-    // Create a new encoder with a length that is guaranteed to be big enough.
-    // A single code unit uses at most 3 bytes, a surrogate pair at most 4.
-    var encoder = _Utf8Encoder.withBufferSize(length * 3);
-    var endPosition = encoder._fillBuffer(string, start, end);
-    assert(endPosition >= end - 1);
-    if (endPosition != end) {
-      // Encoding skipped the last code unit.
-      // That can only happen if the last code unit is a leadsurrogate.
-      // Force encoding of the lead surrogate by itself.
-      var lastCodeUnit = string.codeUnitAt(end - 1);
-      assert(_isLeadSurrogate(lastCodeUnit));
-      // Write a replacement character to represent the unpaired surrogate.
-      encoder._writeReplacementCharacter();
-    }
-    return encoder._buffer.sublist(0, encoder._bufferIndex);
-  }
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [ByteConversionSink].
-  StringConversionSink startChunkedConversion(Sink<List<int>> sink) {
-    return _Utf8EncoderSink(
-        sink is ByteConversionSink ? sink : ByteConversionSink.from(sink));
-  }
-
-  // Override the base-classes bind, to provide a better type.
-  Stream<List<int>> bind(Stream<String> stream) => super.bind(stream);
-}
-
-/// This class encodes Strings to UTF-8 code units (unsigned 8 bit integers).
-// TODO(floitsch): make this class public.
-class _Utf8Encoder {
-  int _carry = 0;
-  int _bufferIndex = 0;
-  final Uint8List _buffer;
-
-  static const _DEFAULT_BYTE_BUFFER_SIZE = 1024;
-
-  _Utf8Encoder() : this.withBufferSize(_DEFAULT_BYTE_BUFFER_SIZE);
-
-  _Utf8Encoder.withBufferSize(int bufferSize)
-      : _buffer = _createBuffer(bufferSize);
-
-  /// Allow an implementation to pick the most efficient way of storing bytes.
-  static Uint8List _createBuffer(int size) => Uint8List(size);
-
-  /// Write a replacement character (U+FFFD). Used for unpaired surrogates.
-  void _writeReplacementCharacter() {
-    _buffer[_bufferIndex++] = 0xEF;
-    _buffer[_bufferIndex++] = 0xBF;
-    _buffer[_bufferIndex++] = 0xBD;
-  }
-
-  /// Tries to combine the given [leadingSurrogate] with the [nextCodeUnit] and
-  /// writes it to [_buffer].
-  ///
-  /// Returns true if the [nextCodeUnit] was combined with the
-  /// [leadingSurrogate]. If it wasn't then nextCodeUnit was not a trailing
-  /// surrogate and has not been written yet.
-  ///
-  /// It is safe to pass 0 for [nextCodeUnit] in which case a replacement
-  /// character is written to represent the unpaired lead surrogate.
-  bool _writeSurrogate(int leadingSurrogate, int nextCodeUnit) {
-    if (_isTailSurrogate(nextCodeUnit)) {
-      var rune = _combineSurrogatePair(leadingSurrogate, nextCodeUnit);
-      // If the rune is encoded with 2 code-units then it must be encoded
-      // with 4 bytes in UTF-8.
-      assert(rune > _THREE_BYTE_LIMIT);
-      assert(rune <= _FOUR_BYTE_LIMIT);
-      _buffer[_bufferIndex++] = 0xF0 | (rune >> 18);
-      _buffer[_bufferIndex++] = 0x80 | ((rune >> 12) & 0x3f);
-      _buffer[_bufferIndex++] = 0x80 | ((rune >> 6) & 0x3f);
-      _buffer[_bufferIndex++] = 0x80 | (rune & 0x3f);
-      return true;
-    } else {
-      // Unpaired lead surrogate.
-      _writeReplacementCharacter();
-      return false;
-    }
-  }
-
-  /// Fills the [_buffer] with as many characters as possible.
-  ///
-  /// Does not encode any trailing lead-surrogate. This must be done by the
-  /// caller.
-  ///
-  /// Returns the position in the string. The returned index points to the
-  /// first code unit that hasn't been encoded.
-  int _fillBuffer(String str, int start, int end) {
-    if (start != end && _isLeadSurrogate(str.codeUnitAt(end - 1))) {
-      // Don't handle a trailing lead-surrogate in this loop. The caller has
-      // to deal with those.
-      end--;
-    }
-    int stringIndex;
-    for (stringIndex = start; stringIndex < end; stringIndex++) {
-      var codeUnit = str.codeUnitAt(stringIndex);
-      // ASCII has the same representation in UTF-8 and UTF-16.
-      if (codeUnit <= _ONE_BYTE_LIMIT) {
-        if (_bufferIndex >= _buffer.length) break;
-        _buffer[_bufferIndex++] = codeUnit;
-      } else if (_isLeadSurrogate(codeUnit)) {
-        if (_bufferIndex + 4 > _buffer.length) break;
-        // Note that it is safe to read the next code unit. We decremented
-        // [end] above when the last valid code unit was a leading surrogate.
-        var nextCodeUnit = str.codeUnitAt(stringIndex + 1);
-        var wasCombined = _writeSurrogate(codeUnit, nextCodeUnit);
-        if (wasCombined) stringIndex++;
-      } else if (_isTailSurrogate(codeUnit)) {
-        if (_bufferIndex + 3 > _buffer.length) break;
-        // Unpaired tail surrogate.
-        _writeReplacementCharacter();
-      } else {
-        var rune = codeUnit;
-        if (rune <= _TWO_BYTE_LIMIT) {
-          if (_bufferIndex + 1 >= _buffer.length) break;
-          _buffer[_bufferIndex++] = 0xC0 | (rune >> 6);
-          _buffer[_bufferIndex++] = 0x80 | (rune & 0x3f);
-        } else {
-          assert(rune <= _THREE_BYTE_LIMIT);
-          if (_bufferIndex + 2 >= _buffer.length) break;
-          _buffer[_bufferIndex++] = 0xE0 | (rune >> 12);
-          _buffer[_bufferIndex++] = 0x80 | ((rune >> 6) & 0x3f);
-          _buffer[_bufferIndex++] = 0x80 | (rune & 0x3f);
-        }
-      }
-    }
-    return stringIndex;
-  }
-}
-
-/// This class encodes chunked strings to UTF-8 code units (unsigned 8-bit
-/// integers).
-class _Utf8EncoderSink extends _Utf8Encoder with StringConversionSinkMixin {
-  final ByteConversionSink _sink;
-
-  _Utf8EncoderSink(this._sink);
-
-  void close() {
-    if (_carry != 0) {
-      // addSlice will call close again, but then the carry must be equal to 0.
-      addSlice("", 0, 0, true);
-      return;
-    }
-    _sink.close();
-  }
-
-  void addSlice(String str, int start, int end, bool isLast) {
-    _bufferIndex = 0;
-
-    if (start == end && !isLast) {
-      return;
-    }
-
-    if (_carry != 0) {
-      var nextCodeUnit = 0;
-      if (start != end) {
-        nextCodeUnit = str.codeUnitAt(start);
-      } else {
-        assert(isLast);
-      }
-      var wasCombined = _writeSurrogate(_carry, nextCodeUnit);
-      // Either we got a non-empty string, or we must not have been combined.
-      assert(!wasCombined || start != end);
-      if (wasCombined) start++;
-      _carry = 0;
-    }
-    do {
-      start = _fillBuffer(str, start, end);
-      var isLastSlice = isLast && (start == end);
-      if (start == end - 1 && _isLeadSurrogate(str.codeUnitAt(start))) {
-        if (isLast && _bufferIndex < _buffer.length - 3) {
-          // There is still space for the replacement character to represent
-          // the last incomplete surrogate.
-          _writeReplacementCharacter();
-        } else {
-          // Otherwise store it in the carry. If isLast is true, then
-          // close will flush the last carry.
-          _carry = str.codeUnitAt(start);
-        }
-        start++;
-      }
-      _sink.addSlice(_buffer, 0, _bufferIndex, isLastSlice);
-      _bufferIndex = 0;
-    } while (start < end);
-    if (isLast) close();
-  }
-
-  // TODO(floitsch): implement asUtf8Sink. Sligthly complicated because it
-  // needs to deal with malformed input.
-}
-
-/// This class converts UTF-8 code units (lists of unsigned 8-bit integers)
-/// to a string.
-class Utf8Decoder extends Converter<List<int>, String> {
-  final bool _allowMalformed;
-
-  /// Instantiates a new [Utf8Decoder].
-  ///
-  /// The optional [allowMalformed] argument defines how [convert] deals
-  /// with invalid or unterminated character sequences.
-  ///
-  /// If it is `true` [convert] replaces invalid (or unterminated) character
-  /// sequences with the Unicode Replacement character `U+FFFD` (�). Otherwise
-  /// it throws a [FormatException].
-  const Utf8Decoder({bool allowMalformed = false})
-      : _allowMalformed = allowMalformed;
-
-  /// Converts the UTF-8 [codeUnits] (a list of unsigned 8-bit integers) to the
-  /// corresponding string.
-  ///
-  /// Uses the code units from [start] to, but no including, [end].
-  /// If [end] is omitted, it defaults to `codeUnits.length`.
-  ///
-  /// If the [codeUnits] start with the encoding of a
-  /// [unicodeBomCharacterRune], that character is discarded.
-  String convert(List<int> codeUnits, [int start = 0, int? end]) {
-    // Allow the implementation to intercept and specialize based on the type
-    // of codeUnits.
-    var result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
-    if (result != null) {
-      return result;
-    }
-
-    return _Utf8Decoder(_allowMalformed).convertSingle(codeUnits, start, end);
-  }
-
-  /// Starts a chunked conversion.
-  ///
-  /// The converter works more efficiently if the given [sink] is a
-  /// [StringConversionSink].
-  ByteConversionSink startChunkedConversion(Sink<String> sink) {
-    StringConversionSink stringSink;
-    if (sink is StringConversionSink) {
-      stringSink = sink;
-    } else {
-      stringSink = StringConversionSink.from(sink);
-    }
-    return stringSink.asUtf8Sink(_allowMalformed);
-  }
-
-  // Override the base-classes bind, to provide a better type.
-  Stream<String> bind(Stream<List<int>> stream) => super.bind(stream);
-
-  external Converter<List<int>, T> fuse<T>(Converter<String, T> next);
-
-  external static String? _convertIntercepted(
-      bool allowMalformed, List<int> codeUnits, int start, int? end);
-}
-
-// UTF-8 constants.
-const int _ONE_BYTE_LIMIT = 0x7f; // 7 bits
-const int _TWO_BYTE_LIMIT = 0x7ff; // 11 bits
-const int _THREE_BYTE_LIMIT = 0xffff; // 16 bits
-const int _FOUR_BYTE_LIMIT = 0x10ffff; // 21 bits, truncated to Unicode max.
-
-// UTF-16 constants.
-const int _SURROGATE_TAG_MASK = 0xFC00;
-const int _SURROGATE_VALUE_MASK = 0x3FF;
-const int _LEAD_SURROGATE_MIN = 0xD800;
-const int _TAIL_SURROGATE_MIN = 0xDC00;
-
-bool _isLeadSurrogate(int codeUnit) =>
-    (codeUnit & _SURROGATE_TAG_MASK) == _LEAD_SURROGATE_MIN;
-bool _isTailSurrogate(int codeUnit) =>
-    (codeUnit & _SURROGATE_TAG_MASK) == _TAIL_SURROGATE_MIN;
-int _combineSurrogatePair(int lead, int tail) =>
-    0x10000 + ((lead & _SURROGATE_VALUE_MASK) << 10) |
-    (tail & _SURROGATE_VALUE_MASK);
-
-class _Utf8Decoder {
-  /// Decode malformed UTF-8 as replacement characters (instead of throwing)?
-  final bool allowMalformed;
-
-  /// Decoder DFA state.
-  int _state;
-
-  /// Partially decoded character. Meaning depends on state. Not used when in
-  /// the initial/accept state. When in an error state, contains the index into
-  /// the input of the error.
-  int _charOrIndex = 0;
-
-  // State machine for UTF-8 decoding, based on this decoder by Björn Höhrmann:
-  // https://bjoern.hoehrmann.de/utf-8/decoder/dfa/
-  //
-  // One iteration in the state machine proceeds as:
-  //
-  // type = typeTable[byte];
-  // char = (state != accept)
-  //     ? (byte & 0x3F) | (char << 6)
-  //     : byte & (shiftedByteMask >> type);
-  // state = transitionTable[state + type];
-  //
-  // After each iteration, if state == accept, char is output as a character.
-
-  // Mask to and on the type read from the table.
-  static const int typeMask = 0x1F;
-  // Mask shifted right by byte type to mask first byte of sequence.
-  static const int shiftedByteMask = 0xF0FE;
-
-  // Byte types.
-  // 'A' = ASCII, 00-7F
-  // 'B' = 2-byte, C2-DF
-  // 'C' = 3-byte, E1-EC, EE
-  // 'D' = 3-byte (possibly surrogate), ED
-  // 'E' = Illegal, C0-C1, F5+
-  // 'F' = Low extension, 80-8F
-  // 'G' = Mid extension, 90-9F
-  // 'H' = High extension, A0-BA, BC-BE
-  // 'I' = Second byte of BOM, BB
-  // 'J' = Third byte of BOM, BF
-  // 'K' = 3-byte (possibly overlong), E0
-  // 'L' = First byte of BOM, EF
-  // 'M' = 4-byte (possibly out-of-range), F4
-  // 'N' = 4-byte, F1-F3
-  // 'O' = 4-byte (possibly overlong), F0
-  static const String typeTable = ""
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 00-1F
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 20-3F
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 40-5F
-      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // 60-7F
-      "FFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGG" // 80-9F
-      "HHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJ" // A0-BF
-      "EEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" // C0-DF
-      "KCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE" // E0-FF
-      ;
-
-  // States (offsets into transition table).
-  static const int IA = 0x00; // Initial / Accept
-  static const int BB = 0x10; // Before BOM
-  static const int AB = 0x20; // After BOM
-  static const int X1 = 0x30; // Expecting one extension byte
-  static const int X2 = 0x3A; // Expecting two extension bytes
-  static const int X3 = 0x44; // Expecting three extension bytes
-  static const int TO = 0x4E; // Possibly overlong 3-byte
-  static const int TS = 0x58; // Possibly surrogate
-  static const int QO = 0x62; // Possibly overlong 4-byte
-  static const int QR = 0x6C; // Possibly out-of-range 4-byte
-  static const int B1 = 0x76; // One byte into BOM
-  static const int B2 = 0x80; // Two bytes into BOM
-  static const int E1 = 0x41; // Error: Missing extension byte
-  static const int E2 = 0x43; // Error: Unexpected extension byte
-  static const int E3 = 0x45; // Error: Invalid byte
-  static const int E4 = 0x47; // Error: Overlong encoding
-  static const int E5 = 0x49; // Error: Out of range
-  static const int E6 = 0x4B; // Error: Surrogate
-  static const int E7 = 0x4D; // Error: Unfinished
-
-  // Character equivalents for states.
-  static const String _IA = '\u0000';
-  static const String _BB = '\u0010';
-  static const String _AB = '\u0020';
-  static const String _X1 = '\u0030';
-  static const String _X2 = '\u003A';
-  static const String _X3 = '\u0044';
-  static const String _TO = '\u004E';
-  static const String _TS = '\u0058';
-  static const String _QO = '\u0062';
-  static const String _QR = '\u006C';
-  static const String _B1 = '\u0076';
-  static const String _B2 = '\u0080';
-  static const String _E1 = '\u0041';
-  static const String _E2 = '\u0043';
-  static const String _E3 = '\u0045';
-  static const String _E4 = '\u0047';
-  static const String _E5 = '\u0049';
-  static const String _E6 = '\u004B';
-  static const String _E7 = '\u004D';
-
-  // Transition table of the state machine. Maps state and byte type
-  // to next state.
-  static const String transitionTable = " "
-      // A   B   C   D   E   F   G   H   I   J   K   L   M   N   O
-      "$_IA$_X1$_X2$_TS$_E3$_E2$_E2$_E2$_E2$_E2$_TO$_X2$_QR$_X3$_QO " // IA
-      "$_IA$_X1$_X2$_TS$_E3$_E2$_E2$_E2$_E2$_E2$_TO$_B1$_QR$_X3$_QO " // BB
-      "$_IA$_X1$_X2$_TS$_E3$_E2$_E2$_E2$_E2$_E2$_TO$_X2$_QR$_X3$_QO " // AB
-      "$_E1$_E1$_E1$_E1$_E1$_IA$_IA$_IA$_IA$_IA" // Overlap 5 E1s        X1
-      "$_E1$_E1$_E1$_E1$_E1$_X1$_X1$_X1$_X1$_X1" // Overlap 5 E1s        X2
-      "$_E1$_E1$_E1$_E1$_E1$_X2$_X2$_X2$_X2$_X2" // Overlap 5 E1s        X3
-      "$_E1$_E1$_E1$_E1$_E1$_E4$_E4$_X1$_X1$_X1" // Overlap 5 E1s        TO
-      "$_E1$_E1$_E1$_E1$_E1$_X1$_X1$_E6$_E6$_E6" // Overlap 5 E1s        TS
-      "$_E1$_E1$_E1$_E1$_E1$_E4$_X2$_X2$_X2$_X2" // Overlap 5 E1s        QO
-      "$_E1$_E1$_E1$_E1$_E1$_X2$_E5$_E5$_E5$_E5" // Overlap 5 E1s        QR
-      "$_E1$_E1$_E1$_E1$_E1$_X1$_X1$_X1$_B2$_X1" // Overlap 5 E1s        B1
-      "$_E1$_E1$_E1$_E1$_E1$_IA$_IA$_IA$_IA$_AB$_E1$_E1$_E1$_E1$_E1" //  B2
-      ;
-
-  // Aliases for states.
-  static const int initial = IA;
-  static const int accept = IA;
-  static const int beforeBom = BB;
-  static const int afterBom = AB;
-  static const int errorMissingExtension = E1;
-  static const int errorUnexpectedExtension = E2;
-  static const int errorInvalid = E3;
-  static const int errorOverlong = E4;
-  static const int errorOutOfRange = E5;
-  static const int errorSurrogate = E6;
-  static const int errorUnfinished = E7;
-
-  @pragma("vm:prefer-inline")
-  static bool isErrorState(int state) => (state & 1) != 0;
-
-  static String errorDescription(int state) {
-    switch (state) {
-      case errorMissingExtension:
-        return "Missing extension byte";
-      case errorUnexpectedExtension:
-        return "Unexpected extension byte";
-      case errorInvalid:
-        return "Invalid UTF-8 byte";
-      case errorOverlong:
-        return "Overlong encoding";
-      case errorOutOfRange:
-        return "Out of unicode range";
-      case errorSurrogate:
-        return "Encoded surrogate";
-      case errorUnfinished:
-        return "Unfinished UTF-8 octet sequence";
-      default:
-        return "";
-    }
-  }
-
-  external _Utf8Decoder(bool allowMalformed);
-
-  external String convertSingle(List<int> codeUnits, int start, int? maybeEnd);
-
-  external String convertChunked(List<int> codeUnits, int start, int? maybeEnd);
-
-  String convertGeneral(
-      List<int> codeUnits, int start, int? maybeEnd, bool single) {
-    int end = RangeError.checkValidRange(start, maybeEnd, codeUnits.length);
-
-    if (start == end) return "";
-
-    // Have bytes as Uint8List.
-    Uint8List bytes;
-    int errorOffset;
-    if (codeUnits is Uint8List) {
-      bytes = codeUnits;
-      errorOffset = 0;
-    } else {
-      bytes = _makeUint8List(codeUnits, start, end);
-      errorOffset = start;
-      end -= start;
-      start = 0;
-    }
-
-    String result = _convertRecursive(bytes, start, end, single);
-    if (isErrorState(_state)) {
-      String message = errorDescription(_state);
-      _state = initial; // Ready for more input.
-      throw FormatException(message, codeUnits, errorOffset + _charOrIndex);
-    }
-    return result;
-  }
-
-  String _convertRecursive(Uint8List bytes, int start, int end, bool single) {
-    // Chunk long strings to avoid a pathological case of JS repeated string
-    // concatenation.
-    if (end - start > 1000) {
-      int mid = (start + end) ~/ 2;
-      String s1 = _convertRecursive(bytes, start, mid, false);
-      if (isErrorState(_state)) return s1;
-      String s2 = _convertRecursive(bytes, mid, end, single);
-      return s1 + s2;
-    }
-    return decodeGeneral(bytes, start, end, single);
-  }
-
-  /// Flushes this decoder as if closed.
-  ///
-  /// This method throws if the input was partial and the decoder was
-  /// constructed with `allowMalformed` set to `false`.
-  void flush(StringSink sink) {
-    final int state = _state;
-    _state = initial;
-    if (state <= afterBom) {
-      return;
-    }
-    // Unfinished sequence.
-    if (allowMalformed) {
-      sink.writeCharCode(unicodeReplacementCharacterRune);
-    } else {
-      throw FormatException(errorDescription(errorUnfinished), null, null);
-    }
-  }
-
-  String decodeGeneral(Uint8List bytes, int start, int end, bool single) {
-    final String typeTable = _Utf8Decoder.typeTable;
-    final String transitionTable = _Utf8Decoder.transitionTable;
-    int state = _state;
-    int char = _charOrIndex;
-    final StringBuffer buffer = StringBuffer();
-    int i = start;
-    int byte = bytes[i++];
-    loop:
-    while (true) {
-      multibyte:
-      while (true) {
-        int type = typeTable.codeUnitAt(byte) & typeMask;
-        char = (state <= afterBom)
-            ? byte & (shiftedByteMask >> type)
-            : (byte & 0x3F) | (char << 6);
-        state = transitionTable.codeUnitAt(state + type);
-        if (state == accept) {
-          buffer.writeCharCode(char);
-          if (i == end) break loop;
-          break multibyte;
-        } else if (isErrorState(state)) {
-          if (allowMalformed) {
-            switch (state) {
-              case errorInvalid:
-              case errorUnexpectedExtension:
-                // A single byte that can't start a sequence.
-                buffer.writeCharCode(unicodeReplacementCharacterRune);
-                break;
-              case errorMissingExtension:
-                // Unfinished sequence followed by a byte that can start a
-                // sequence.
-                buffer.writeCharCode(unicodeReplacementCharacterRune);
-                // Re-parse offending byte.
-                i -= 1;
-                break;
-              default:
-                // Unfinished sequence followed by a byte that can't start a
-                // sequence.
-                buffer.writeCharCode(unicodeReplacementCharacterRune);
-                buffer.writeCharCode(unicodeReplacementCharacterRune);
-                break;
-            }
-            state = initial;
-          } else {
-            _state = state;
-            _charOrIndex = i - 1;
-            return "";
-          }
-        }
-        if (i == end) break loop;
-        byte = bytes[i++];
-      }
-
-      final int markStart = i;
-      byte = bytes[i++];
-      if (byte < 128) {
-        int markEnd = end;
-        while (i < end) {
-          byte = bytes[i++];
-          if (byte >= 128) {
-            markEnd = i - 1;
-            break;
-          }
-        }
-        assert(markStart < markEnd);
-        if (markEnd - markStart < 20) {
-          for (int m = markStart; m < markEnd; m++) {
-            buffer.writeCharCode(bytes[m]);
-          }
-        } else {
-          buffer.write(String.fromCharCodes(bytes, markStart, markEnd));
-        }
-        if (markEnd == end) break loop;
-      }
-    }
-
-    if (single && state > afterBom) {
-      // Unfinished sequence.
-      if (allowMalformed) {
-        buffer.writeCharCode(unicodeReplacementCharacterRune);
-      } else {
-        _state = errorUnfinished;
-        _charOrIndex = end;
-        return "";
-      }
-    }
-    _state = state;
-    _charOrIndex = char;
-    return buffer.toString();
-  }
-
-  static Uint8List _makeUint8List(List<int> codeUnits, int start, int end) {
-    final int length = end - start;
-    final Uint8List bytes = Uint8List(length);
-    for (int i = 0; i < length; i++) {
-      int b = codeUnits[start + i];
-      if ((b & ~0xFF) != 0) {
-        // Replace invalid byte values by FF, which is also invalid.
-        b = 0xFF;
-      }
-      bytes[i] = b;
-    }
-    return bytes;
-  }
-}
diff --git a/sdk_nnbd/lib/core/annotations.dart b/sdk_nnbd/lib/core/annotations.dart
deleted file mode 100644
index f407683..0000000
--- a/sdk_nnbd/lib/core/annotations.dart
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.core;
-
-/**
- * The annotation `@Deprecated('migration')` marks a feature as deprecated.
- *
- * The annotation [deprecated] is a shorthand for deprecating until
- * an unspecified "next release" without migration instructions.
- *
- * The intent of the `@Deprecated` annotation is to inform users of a feature
- * that they should change their code, even if it is currently still working
- * correctly.
- *
- * A deprecated feature is scheduled to be removed at a later time, possibly
- * specified in [message]. A deprecated feature should not be used, code using
- * it will break at some point in the future. If existing code is using the
- * feature it should be rewritten to not use the deprecated feature.
- *
- * A deprecated feature should document how the same effect can be achieved in
- * [message], so the programmer knows how to rewrite the code.
- *
- * The `@Deprecated` annotation applies to libraries, top-level declarations
- * (variables, getters, setters, functions, classes and typedefs),
- * class-level declarations (variables, getters, setters, methods, operators or
- * constructors, whether static or not), named optional arguments and
- * trailing optional positional parameters.
- *
- * Deprecation is transitive:
- *
- *  - If a library is deprecated, so is every member of it.
- *  - If a class is deprecated, so is every member of it.
- *  - If a variable is deprecated, so are its implicit getter and setter.
- *
- *
- * A tool that processes Dart source code may report when:
- *
- * - the code imports a deprecated library.
- * - the code exports a deprecated library, or any deprecated member of
- *   a non-deprecated library.
- * - the code refers statically to a deprecated declaration.
- * - the code dynamically uses a member of an object with a statically known
- *   type, where the member is deprecated on the static type of the object.
- * - the code dynamically calls a method with an argument where the
- *   corresponding optional parameter is deprecated on the object's static type.
- *
- *
- * If the deprecated use is inside a library, class or method which is itself
- * deprecated, the tool should not bother the user about it.
- * A deprecated feature is expected to use other deprecated features.
- */
-class Deprecated {
-  /**
-   * Message provided to the user when they use the deprecated feature.
-   *
-   * The message should explain how to migrate away from the feature if an
-   * alternative is available, and when the deprecated feature is expected to be
-   * removed.
-   */
-  final String message;
-
-  /**
-   * Create a deprecation annotation which specifies the migration path and
-   * expiration of the annotated feature.
-   *
-   * The [message] argument should be readable by programmers, and should state
-   * an alternative feature (if available) as well as when an annotated feature
-   * is expected to be removed.
-   */
-  const Deprecated(this.message);
-
-  @Deprecated('Use `message` instead. Will be removed in Dart 3.0.0')
-  String get expires => message;
-
-  String toString() => "Deprecated feature: $message";
-}
-
-/**
- * Marks a feature as [Deprecated] until the next release.
- */
-const Deprecated deprecated = Deprecated("next release");
-
-class _Override {
-  const _Override();
-}
-
-/**
- * The annotation `@override` marks an instance member as overriding a
- * superclass member with the same name.
- *
- * The annotation applies to instance methods, getters and setters, and to
- * instance fields, where it means that the implicit getter and setter of the
- * field is marked as overriding, but the field itself is not.
- *
- * The intent of the `@override` notation is to catch situations where a
- * superclass renames a member, and an independent subclass which used to
- * override the member, could silently continue working using the
- * superclass implementation.
- *
- * The editor, or a similar tool aimed at the programmer, may report if no
- * declaration of an annotated member is inherited by the class from either a
- * superclass or an interface.
- *
- * Use the `@override` annotation judiciously and only for methods where
- * the superclass is not under the programmer's control, the superclass is in a
- * different library or package, and it is not considered stable.
- * In any case, the use of `@override` is optional.
- *
- * For example, the annotation is intentionally not used in the Dart platform
- * libraries, since they only depend on themselves.
- */
-const Object override = _Override();
-
-/**
- * An annotation class that was used during development of Dart 2.
- *
- * Should not be used any more.
- */
-@deprecated
-class Provisional {
-  String? get message => null;
-  const Provisional({String? message});
-}
-
-/**
- * An annotation that was used during development of Dart 2.
- *
- * Should not be used any more.
- */
-@deprecated
-const Null provisional = null;
-
-class _Proxy {
-  const _Proxy();
-}
-
-/**
- * This annotation is deprecated and will be removed in Dart 2.
- *
- * Dart 2 has a more restrictive type system than Dart 1, and it requires
- * method access to be either through a known interface or by using
- * dynamic invocations. The original intent of `@proxy` (to implement a class
- * that isn't known statically, as documented at the end of this text),
- * is not supported by Dart 2.
- * To continue to perform dynamic invocations on an object,
- * it should be accessed through a reference of type `dynamic`.
- *
- * The annotation `@proxy` marks a class as implementing members dynamically
- * through `noSuchMethod`.
- *
- * The annotation applies to any class. It is inherited by subclasses from both
- * superclass and interfaces.
- *
- * If a class is annotated with `@proxy`, or it implements any class that is
- * annotated, then all member accesses are allowed on an object of that type.
- * As such, it is not a static type warning to access any member of the object
- * which is not implemented by the class, or to call a method with a different
- * number of parameters than it is declared with.
- *
- * The annotation does not change which classes the annotated class implements,
- * and does not prevent static warnings for assigning an object to a variable
- * with a static type not implemented by the object.
- *
- * The suppression of warnings only affect static type warnings about
- * member access.
- * The runtime type of the object is unaffected.
- * It is not considered to implement any special interfaces,
- * so assigning it to a typed variable may fail in checked mode,
- * and testing it with the `is` operator
- * will only return true for types it actually implements or extends.
- * Accessing a member which isn't implemented by the class
- * will cause the `noSuchMethod` method to be called normally,
- * the `@proxy` annotation merely states the intent to handle (some of) those
- * `noSuchMethod` calls gracefully.
- *
- * A class that marked as `@proxy` should override the `noSuchMethod`
- * declared on [Object].
- *
- * The intent of the `@proxy` notation is to create objects that implement a
- * type (or multiple types) that are not known at compile time. If the types
- * are known at compile time, a class can be written that implements these
- * types.
- */
-@deprecated
-const Object proxy = _Proxy();
-
-/**
- * A hint to tools.
- *
- * Tools that work with Dart programs may accept hints to guide their behavior
- * as `pragma` annotations on declarations.
- * Each tool decides which hints it accepts, what they mean, and whether and
- * how they apply to sub-parts of the annotated entity.
- *
- * Tools that recognize pragma hints should pick a pragma prefix to identify
- * the tool. They should recognize any hint with a [name] starting with their
- * prefix followed by `:` as if it was intended for that tool. A hint with a
- * prefix for another tool should be ignored (unless compatibility with that
- * other tool is a goal).
- *
- * A tool may recognize unprefixed names as well, if they would recognize that
- * name with their own prefix in front.
- *
- * If the hint can be parameterized, an extra [options] object can be added as well.
- *
- * For example:
- *
- * ```dart
- * @pragma('Tool:pragma-name', [param1, param2, ...])
- * class Foo { }
- *
- * @pragma('OtherTool:other-pragma')
- * void foo() { }
- * ```
- *
- * Here class Foo is annotated with a Tool specific pragma 'pragma-name' and
- * function foo is annotated with a pragma 'other-pragma' specific to OtherTool.
- *
- */
-@pragma('vm:entry-point')
-class pragma {
-  /**
-   * The name of the hint.
-   *
-   * A string that is recognized by one or more tools, or such a string prefixed
-   * by a tool identifier and a colon, which is only recognized by that
-   * particular tool.
-   */
-  final String name;
-
-  /** Optional extra data parameterizing the hint. */
-  final Object? options;
-
-  /** Creates a hint named [name] with optional [options]. */
-  const factory pragma(String name, [Object? options]) = pragma._;
-
-  const pragma._(this.name, [this.options]);
-}
diff --git a/sdk_nnbd/lib/core/bigint.dart b/sdk_nnbd/lib/core/bigint.dart
deleted file mode 100644
index 94a9445..0000000
--- a/sdk_nnbd/lib/core/bigint.dart
+++ /dev/null
@@ -1,414 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart.core;
-
-/**
- * An arbitrarily large integer.
- */
-abstract class BigInt implements Comparable<BigInt> {
-  external static BigInt get zero;
-  external static BigInt get one;
-  external static BigInt get two;
-
-  /**
-   * Parses [source] as a, possibly signed, integer literal and returns its
-   * value.
-   *
-   * The [source] must be a non-empty sequence of base-[radix] digits,
-   * optionally prefixed with a minus or plus sign ('-' or '+').
-   *
-   * The [radix] must be in the range 2..36. The digits used are
-   * first the decimal digits 0..9, and then the letters 'a'..'z' with
-   * values 10 through 35. Also accepts upper-case letters with the same
-   * values as the lower-case ones.
-   *
-   * If no [radix] is given then it defaults to 10. In this case, the [source]
-   * digits may also start with `0x`, in which case the number is interpreted
-   * as a hexadecimal literal, which effectively means that the `0x` is ignored
-   * and the radix is instead set to 16.
-   *
-   * For any int `n` and radix `r`, it is guaranteed that
-   * `n == int.parse(n.toRadixString(r), radix: r)`.
-   *
-   * Throws a [FormatException] if the [source] is not a valid integer literal,
-   * optionally prefixed by a sign.
-   */
-  external static BigInt parse(String source, {int? radix});
-
-  /**
-   * Parses [source] as a, possibly signed, integer literal and returns its
-   * value.
-   *
-   * As [parse] except that this method returns `null` if the input is not
-   * valid
-   */
-  external static BigInt? tryParse(String source, {int? radix});
-
-  /// Allocates a big integer from the provided [value] number.
-  external factory BigInt.from(num value);
-
-  /**
-   * Returns the absolute value of this integer.
-   *
-   * For any integer `x`, the result is the same as `x < 0 ? -x : x`.
-   */
-  BigInt abs();
-
-  /**
-   * Return the negative value of this integer.
-   *
-   * The result of negating an integer always has the opposite sign, except
-   * for zero, which is its own negation.
-   */
-  BigInt operator -();
-
-  /// Addition operator.
-  BigInt operator +(BigInt other);
-
-  /// Subtraction operator.
-  BigInt operator -(BigInt other);
-
-  /// Multiplication operator.
-  BigInt operator *(BigInt other);
-
-  /// Division operator.
-  double operator /(BigInt other);
-
-  /**
-   * Truncating division operator.
-   *
-   * Performs a truncating integer division, where the remainder is discarded.
-   *
-   * The remainder can be computed using the [remainder] method.
-   *
-   * Examples:
-   * ```
-   * var seven = new BigInt.from(7);
-   * var three = new BigInt.from(3);
-   * seven ~/ three;    // => 2
-   * (-seven) ~/ three; // => -2
-   * seven ~/ -three;   // => -2
-   * seven.remainder(three);    // => 1
-   * (-seven).remainder(three); // => -1
-   * seven.remainder(-three);   // => 1
-   * ```
-   */
-  BigInt operator ~/(BigInt other);
-
-  /**
-   * Euclidean modulo operator.
-   *
-   * Returns the remainder of the Euclidean division. The Euclidean division of
-   * two integers `a` and `b` yields two integers `q` and `r` such that
-   * `a == b * q + r` and `0 <= r < b.abs()`.
-   *
-   * The sign of the returned value `r` is always positive.
-   *
-   * See [remainder] for the remainder of the truncating division.
-   */
-  BigInt operator %(BigInt other);
-
-  /**
-   * Returns the remainder of the truncating division of `this` by [other].
-   *
-   * The result `r` of this operation satisfies:
-   * `this == (this ~/ other) * other + r`.
-   * As a consequence the remainder `r` has the same sign as the divider `this`.
-   */
-  BigInt remainder(BigInt other);
-
-  /**
-   * Shift the bits of this integer to the left by [shiftAmount].
-   *
-   * Shifting to the left makes the number larger, effectively multiplying
-   * the number by `pow(2, shiftIndex)`.
-   *
-   * There is no limit on the size of the result. It may be relevant to
-   * limit intermediate values by using the "and" operator with a suitable
-   * mask.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  BigInt operator <<(int shiftAmount);
-
-  /**
-   * Shift the bits of this integer to the right by [shiftAmount].
-   *
-   * Shifting to the right makes the number smaller and drops the least
-   * significant bits, effectively doing an integer division by
-   *`pow(2, shiftIndex)`.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  BigInt operator >>(int shiftAmount);
-
-  /**
-   * Bit-wise and operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with only the bits set that are set in
-   * both `this` and [other]
-   *
-   * Of both operands are negative, the result is negative, otherwise
-   * the result is non-negative.
-   */
-  BigInt operator &(BigInt other);
-
-  /**
-   * Bit-wise or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in either
-   * of `this` and [other]
-   *
-   * If both operands are non-negative, the result is non-negative,
-   * otherwise the result us negative.
-   */
-  BigInt operator |(BigInt other);
-
-  /**
-   * Bit-wise exclusive-or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in one,
-   * but not both, of `this` and [other]
-   *
-   * If the operands have the same sign, the result is non-negative,
-   * otherwise the result is negative.
-   */
-  BigInt operator ^(BigInt other);
-
-  /**
-   * The bit-wise negate operator.
-   *
-   * Treating `this` as a sufficiently large two's component integer,
-   * the result is a number with the opposite bits set.
-   *
-   * This maps any integer `x` to `-x - 1`.
-   */
-  BigInt operator ~();
-
-  /** Relational less than operator. */
-  bool operator <(BigInt other);
-
-  /** Relational less than or equal operator. */
-  bool operator <=(BigInt other);
-
-  /** Relational greater than operator. */
-  bool operator >(BigInt other);
-
-  /** Relational greater than or equal operator. */
-  bool operator >=(BigInt other);
-
-  /**
-   * Compares this to `other`.
-   *
-   * Returns a negative number if `this` is less than `other`, zero if they are
-   * equal, and a positive number if `this` is greater than `other`.
-   */
-  int compareTo(BigInt other);
-
-  /**
-   * Returns the minimum number of bits required to store this big integer.
-   *
-   * The number of bits excludes the sign bit, which gives the natural length
-   * for non-negative (unsigned) values.  Negative values are complemented to
-   * return the bit position of the first bit that differs from the sign bit.
-   *
-   * To find the number of bits needed to store the value as a signed value,
-   * add one, i.e. use `x.bitLength + 1`.
-   *
-   * ```
-   * x.bitLength == (-x-1).bitLength
-   *
-   * new BigInt.from(3).bitLength == 2;   // 00000011
-   * new BigInt.from(2).bitLength == 2;   // 00000010
-   * new BigInt.from(1).bitLength == 1;   // 00000001
-   * new BigInt.from(0).bitLength == 0;   // 00000000
-   * new BigInt.from(-1).bitLength == 0;  // 11111111
-   * new BigInt.from(-2).bitLength == 1;  // 11111110
-   * new BigInt.from(-3).bitLength == 2;  // 11111101
-   * new BigInt.from(-4).bitLength == 2;  // 11111100
-   * ```
-   */
-  int get bitLength;
-
-  /**
-   * Returns the sign of this big integer.
-   *
-   * Returns 0 for zero, -1 for values less than zero and
-   * +1 for values greater than zero.
-   */
-  int get sign;
-
-  /// Whether this big integer is even.
-  bool get isEven;
-
-  /// Whether this big integer is odd.
-  bool get isOdd;
-
-  /// Whether this number is negative.
-  bool get isNegative;
-
-  /**
-   * Returns `this` to the power of [exponent].
-   *
-   * Returns [one] if the [exponent] equals 0.
-   *
-   * The [exponent] must otherwise be positive.
-   *
-   * The result is always equal to the mathematical result of this to the power
-   * [exponent], only limited by the available memory.
-   */
-  BigInt pow(int exponent);
-
-  /**
-   * Returns this integer to the power of [exponent] modulo [modulus].
-   *
-   * The [exponent] must be non-negative and [modulus] must be
-   * positive.
-   */
-  BigInt modPow(BigInt exponent, BigInt modulus);
-
-  /**
-   * Returns the modular multiplicative inverse of this big integer
-   * modulo [modulus].
-   *
-   * The [modulus] must be positive.
-   *
-   * It is an error if no modular inverse exists.
-   */
-  // Returns 1/this % modulus, with modulus > 0.
-  BigInt modInverse(BigInt modulus);
-
-  /**
-   * Returns the greatest common divisor of this big integer and [other].
-   *
-   * If either number is non-zero, the result is the numerically greatest
-   * integer dividing both `this` and `other`.
-   *
-   * The greatest common divisor is independent of the order,
-   * so `x.gcd(y)` is  always the same as `y.gcd(x)`.
-   *
-   * For any integer `x`, `x.gcd(x)` is `x.abs()`.
-   *
-   * If both `this` and `other` is zero, the result is also zero.
-   */
-  BigInt gcd(BigInt other);
-
-  /**
-   * Returns the least significant [width] bits of this big integer as a
-   * non-negative number (i.e. unsigned representation).  The returned value has
-   * zeros in all bit positions higher than [width].
-   *
-   * ```
-   * new BigInt.from(-1).toUnsigned(5) == 31   // 11111111  ->  00011111
-   * ```
-   *
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit quantity:
-   *
-   * ```
-   * q = (q + 1).toUnsigned(8);
-   * ```
-   *
-   * `q` will count from `0` up to `255` and then wrap around to `0`.
-   *
-   * If the input fits in [width] bits without truncation, the result is the
-   * same as the input.  The minimum width needed to avoid truncation of `x` is
-   * given by `x.bitLength`, i.e.
-   *
-   * ```
-   * x == x.toUnsigned(x.bitLength);
-   * ```
-   */
-  BigInt toUnsigned(int width);
-
-  /**
-   * Returns the least significant [width] bits of this integer, extending the
-   * highest retained bit to the sign.  This is the same as truncating the value
-   * to fit in [width] bits using an signed 2-s complement representation.  The
-   * returned value has the same bit value in all positions higher than [width].
-   *
-   * ```
-   * var big15 = new BigInt.from(15);
-   * var big16 = new BigInt.from(16);
-   * var big239 = new BigInt.from(239);
-   *                                      V--sign bit-V
-   * big16.toSigned(5) == -big16   //  00010000 -> 11110000
-   * big239.toSigned(5) == big15   //  11101111 -> 00001111
-   *                                      ^           ^
-   * ```
-   *
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit signed quantity:
-   *
-   * ```
-   * q = (q + 1).toSigned(8);
-   * ```
-   *
-   * `q` will count from `0` up to `127`, wrap to `-128` and count back up to
-   * `127`.
-   *
-   * If the input value fits in [width] bits without truncation, the result is
-   * the same as the input.  The minimum width needed to avoid truncation of `x`
-   * is `x.bitLength + 1`, i.e.
-   *
-   * ```
-   * x == x.toSigned(x.bitLength + 1);
-   * ```
-   */
-  BigInt toSigned(int width);
-
-  /**
-   * Whether this big integer can be represented as an `int` without losing
-   * precision.
-   *
-   * Warning: this function may give a different result on
-   * dart2js, dev compiler, and the VM, due to the differences in
-   * integer precision.
-   */
-  bool get isValidInt;
-
-  /**
-   * Returns this [BigInt] as an [int].
-   *
-   * If the number does not fit, clamps to the max (or min)
-   * integer.
-   *
-   * Warning: the clamping behaves differently on dart2js, dev
-   * compiler, and the VM, due to the differences in integer
-   * precision.
-   */
-  int toInt();
-
-  /**
-   * Returns this [BigInt] as a [double].
-   *
-   * If the number is not representable as a [double], an
-   * approximation is returned. For numerically large integers, the
-   * approximation may be infinite.
-   */
-  double toDouble();
-
-  /**
-   * Returns a String-representation of this integer.
-   *
-   * The returned string is parsable by [parse].
-   * For any `BigInt` `i`, it is guaranteed that
-   * `i == BigInt.parse(i.toString())`.
-   */
-  String toString();
-
-  /**
-   * Converts [this] to a string representation in the given [radix].
-   *
-   * In the string representation, lower-case letters are used for digits above
-   * '9', with 'a' being 10 an 'z' being 35.
-   *
-   * The [radix] argument must be an integer in the range 2 to 36.
-   */
-  String toRadixString(int radix);
-}
diff --git a/sdk_nnbd/lib/core/bool.dart b/sdk_nnbd/lib/core/bool.dart
deleted file mode 100644
index 3d35d80..0000000
--- a/sdk_nnbd/lib/core/bool.dart
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * The reserved words `true` and `false` denote objects that are the only two
- * instances of this class.
- *
- * It is a compile-time error for a class to attempt to extend or implement
- * bool.
- */
-@pragma("vm:entry-point")
-class bool {
-  /**
-   * Returns the boolean value of the environment declaration [name].
-   *
-   * The boolean value of the declaration is `true` if the declared value is
-   * the string `"true"`, and `false` if the value is `"false"`.
-   *
-   * In all other cases, including when there is no declaration for `name`,
-   * the result is the [defaultValue].
-   *
-   * The result is the same as would be returned by:
-   * ```dart
-   * (const String.fromEnvironment(name) == "true")
-   *     ? true
-   *     : (const String.fromEnvironment(name) == "false")
-   *         ? false
-   *         : defaultValue
-   * ```
-   * Example:
-   * ```dart
-   * const loggingFlag = const bool.fromEnvironment("logging");
-   * ```
-   * If you want to use a different truth-string than `"true"`, you can use the
-   * [String.fromEnvironment] constructor directly:
-   * ```dart
-   * const isLoggingOn = (const String.fromEnvironment("logging") == "on");
-   * ```
-   */
-  // The .fromEnvironment() constructors are special in that we do not want
-  // users to call them using "new". We prohibit that by giving them bodies
-  // that throw, even though const constructors are not allowed to have bodies.
-  // Disable those static errors.
-  //ignore: const_constructor_with_body
-  //ignore: const_factory
-  external const factory bool.fromEnvironment(String name,
-      {bool defaultValue = false});
-
-  /// Whether there is an environment declaration [name].
-  ///
-  /// Returns true iff there is an environment declaration with the name [name]
-  /// If there is then the value of that declaration can be accessed using
-  /// `const String.fromEnvironment(name)`. Otherwise,
-  /// `String.fromEnvironment(name, defaultValue: someString)`
-  /// will evaluate to the given `defaultValue`.
-  ///
-  /// This constructor can be used to handle an absent declaration
-  /// specifically, in ways that cannot be represented by providing
-  /// a default value to the `C.fromEnvironment` constructor where `C`
-  /// is [String], [int], or [bool].
-  ///
-  /// Example:
-  /// ```dart
-  /// const loggingIsDeclared = const bool.hasEnvironment("logging");
-  ///
-  /// const String? logger = loggingIsDeclared
-  ///     ? String.fromEnvironment("logging")
-  ///     : null;
-  /// ```
-  // The .hasEnvironment() constructor is special in that we do not want
-  // users to call them using "new". We prohibit that by giving them bodies
-  // that throw, even though const constructors are not allowed to have bodies.
-  // Disable those static errors.
-  //ignore: const_constructor_with_body
-  //ignore: const_factory
-  external const factory bool.hasEnvironment(String name);
-
-  external int get hashCode;
-
-  /// The logical conjunction ("and") of this and [other].
-  ///
-  /// Returns `true` if both this and [other] are `true`, and `false` otherwise.
-  @Since("2.1")
-  bool operator &(bool other) => other && this;
-
-  /// The logical disjunction ("inclusive or") of this and [other].
-  ///
-  /// Returns `true` if either this or [other] is `true`, and `false` otherwise.
-  @Since("2.1")
-  bool operator |(bool other) => other || this;
-
-  /// The logical exclusive disjunction ("exclusive or") of this and [other].
-  ///
-  /// Returns whether this and [other] are neither both `true` nor both `false`.
-  @Since("2.1")
-  bool operator ^(bool other) => !other == this;
-
-  /**
-   * Returns either `"true"` for `true` and `"false"` for `false`.
-   */
-  String toString() {
-    return this ? "true" : "false";
-  }
-}
diff --git a/sdk_nnbd/lib/core/comparable.dart b/sdk_nnbd/lib/core/comparable.dart
deleted file mode 100644
index 835aa34..0000000
--- a/sdk_nnbd/lib/core/comparable.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * The signature of a generic comparison function.
- *
- * A comparison function represents an ordering on a type of objects.
- * A total ordering on a type means that for two values, either they
- * are equal or one is greater than the other (and the latter must then be
- * smaller than the former).
- *
- * A [Comparator] function represents such a total ordering by returning
- *
- * * a negative integer if [a] is smaller than [b],
- * * zero if [a] is equal to [b], and
- * * a positive integer if [a] is greater than [b].
- */
-typedef Comparator<T> = int Function(T a, T b);
-
-/**
- * Interface used by types that have an intrinsic ordering.
- *
- * The [compareTo] operation defines a total ordering of objects,
- * which can be used for ordering and sorting.
- *
- * The [Comparable] interface should be used for the natural ordering of a type.
- * If a type can be ordered in more than one way,
- * and none of them is the obvious natural ordering,
- * then it might be better not to use the [Comparable] interface,
- * and to provide separate [Comparator]s instead.
- *
- * It is recommended that the order of a [Comparable] agrees
- * with its operator [operator ==] equality (`a.compareTo(b) == 0` iff `a == b`),
- * but this is not a requirement.
- * For example, [double] and [DateTime] have `compareTo` methods
- * that do not agree with operator [operator ==].
- * For doubles the [compareTo] method is more precise than the equality,
- * and for [DateTime] it is less precise.
- *
- * Examples:
- *
- *      (0.0).compareTo(-0.0);  // => 1
- *      0.0 == -0.0;            // => true
- *      var dt = new DateTime.now();
- *      var dt2 = dt.toUtc();
- *      dt == dt2;              // => false
- *      dt.compareTo(dt2);      // => 0
- *
- * The [Comparable] interface does not imply the existence
- * of the comparison operators `<`, `<=`, `>` and `>=`.
- * These should only be defined
- * if the ordering is a less-than/greater-than ordering,
- * that is, an ordering where you would naturally
- * use the words "less than" about the order of two elements.
- *
- * If the equality operator and [compareTo] disagree,
- * the comparison operators should follow the equality operator,
- * and will likely also disagree with [compareTo].
- * Otherwise they should match the [compareTo] method,
- * so that `a < b` iff `a.compareTo(b) < 0`.
- *
- * The [double] class defines comparison operators
- * that are compatible with equality.
- * The operators differ from `double.compareTo` on -0.0 and NaN.
- *
- * The [DateTime] class has no comparison operators, instead it has the more
- * precisely named [DateTime.isBefore] and [DateTime.isAfter].
- */
-abstract class Comparable<T> {
-  /**
-   * Compares this object to another [Comparable]
-   *
-   * Returns a value like a [Comparator] when comparing `this` to [other].
-   * That is, it returns a negative integer if `this` is ordered before [other],
-   * a positive integer if `this` is ordered after [other],
-   * and zero if `this` and [other] are ordered together.
-   *
-   * The [other] argument must be a value that is comparable to this object.
-   */
-  int compareTo(T other);
-
-  /**
-   * A [Comparator] that compares one comparable to another.
-   *
-   * It returns the result of `a.compareTo(b)`.
-   *
-   * This utility function is used as the default comparator
-   * for ordering collections, for example in the [List] sort function.
-   */
-  static int compare(Comparable a, Comparable b) => a.compareTo(b);
-}
diff --git a/sdk_nnbd/lib/core/core.dart b/sdk_nnbd/lib/core/core.dart
deleted file mode 100644
index dc037a3..0000000
--- a/sdk_nnbd/lib/core/core.dart
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/**
- *
- * Built-in types, collections,
- * and other core functionality for every Dart program.
- *
- * This library is automatically imported.
- *
- * Some classes in this library,
- * such as [String] and [num],
- * support Dart's built-in data types.
- * Other classes, such as [List] and [Map], provide data structures
- * for managing collections of objects.
- * And still other classes represent commonly used types of data
- * such as URIs, dates and times, and errors.
- *
- * ## Numbers and booleans
- *
- * [int] and [double] provide support for Dart's built-in numerical data types:
- * integers and double-precision floating point numbers, respectively.
- * An object of type [bool] is either true or false.
- * Variables of these types can be constructed from literals:
- *
- *     int meaningOfLife = 42;
- *     double valueOfPi  = 3.141592;
- *     bool visible      = true;
- *
- * ## Strings and regular expressions
- *
- * A [String] is immutable and represents a sequence of characters.
- *
- *     String shakespeareQuote = "All the world's a stage, ...";
- *
- * [StringBuffer] provides a way to construct strings efficiently.
- *
- *     StringBuffer moreShakespeare = new StringBuffer();
- *     moreShakespeare.write('And all the men and women ');
- *     moreShakespeare.write('merely players; ...');
- *
- * The String and StringBuffer classes implement string concatenation,
- * interpolation, and other string manipulation features.
- *
- *     String philosophy = 'Live on ';
- *     String get palindrome => philosophy + philosophy.split('').reversed.join();
- *
- * [RegExp] implements Dart regular expressions,
- * which provide a grammar for matching patterns within text.
- * For example, here's a regular expression that matches
- * a string of one or more digits:
- *
- *     var numbers = new RegExp(r'\d+');
- *
- * Dart regular expressions have the same syntax and semantics as
- * JavaScript regular expressions. See
- * <http://ecma-international.org/ecma-262/5.1/#sec-15.10>
- * for the specification of JavaScript regular expressions.
- *
- * ## Collections
- *
- * The dart:core library provides basic collections,
- * such as [List], [Map], and [Set].
- *
- * A List is an ordered collection of objects, with a length.
- * Lists are sometimes called arrays.
- * Use a List when you need to access objects by index.
- *
- *     List superheroes = [ 'Batman', 'Superman', 'Harry Potter' ];
- *
- * A Set is an unordered collection of unique objects.
- * You cannot get an item by index (position).
- * Adding a duplicate item has no effect.
- *
- *     Set villains = new Set();
- *     villains.add('Joker');
- *     villains.addAll( ['Lex Luther', 'Voldemort'] );
- *
- * A Map is an unordered collection of key-value pairs.
- * Maps are sometimes called associative arrays because
- * maps associate a key to some value for easy retrieval.
- * Keys are unique.
- * Use a Map when you need to access objects
- * by a unique identifier.
- *
- *     Map sidekicks = { 'Batman': 'Robin',
- *                       'Superman': 'Lois Lane',
- *                       'Harry Potter': 'Ron and Hermione' };
- *
- * In addition to these classes,
- * dart:core contains [Iterable],
- * an interface that defines functionality
- * common in collections of objects.
- * Examples include the ability
- * to run a function on each element in the collection,
- * to apply a test to each element,
- * to retrieve an object, and to determine length.
- *
- * Iterable is implemented by List and Set,
- * and used by Map for its keys and values.
- *
- * For other kinds of collections, check out the
- * `dart:collection` library.
- *
- * ## Date and time
- *
- * Use [DateTime] to represent a point in time
- * and [Duration] to represent a span of time.
- *
- * You can create DateTime objects with constructors
- * or by parsing a correctly formatted string.
- *
- *     DateTime now = new DateTime.now();
- *     DateTime berlinWallFell = new DateTime(1989, 11, 9);
- *     DateTime moonLanding = DateTime.parse("1969-07-20");
- *
- * Create a Duration object specifying the individual time units.
- *
- *     Duration timeRemaining = new Duration(hours:56, minutes:14);
- *
- * In addition to DateTime and Duration,
- * dart:core contains the [Stopwatch] class for measuring elapsed time.
- *
- * ## Uri
- *
- * A [Uri] object represents a uniform resource identifier,
- * which identifies a resource on the web.
- *
- *     Uri dartlang = Uri.parse('http://dartlang.org/');
- *
- * ## Errors
- *
- * The [Error] class represents the occurrence of an error
- * during runtime.
- * Subclasses of this class represent specific kinds of errors.
- *
- * ## Other documentation
- *
- * For more information about how to use the built-in types, refer to [Built-in
- * Types](http://www.dartlang.org/docs/dart-up-and-running/contents/ch02.html#built-in-types)
- * in Chapter 2 of
- * [Dart: Up and Running](http://www.dartlang.org/docs/dart-up-and-running/).
- *
- * Also, see [dart:core - Numbers, Collections, Strings, and
- * More](https://www.dartlang.org/docs/dart-up-and-running/ch03.html#dartcore---numbers-collections-strings-and-more)
- * for more coverage of classes in this package.
- *
- * The
- * [Dart Language Specification](http://www.dartlang.org/docs/spec/)
- * provides technical details.
- *
- * {@category Core}
- */
-library dart.core;
-
-import "dart:collection";
-import "dart:_internal" hide Symbol, LinkedList, LinkedListEntry;
-import "dart:_internal" as internal show Symbol;
-import "dart:convert"
-    show
-        ascii,
-        base64,
-        Base64Codec,
-        Encoding,
-        latin1,
-        StringConversionSink,
-        utf8;
-import "dart:math" show Random; // Used by List.shuffle.
-import "dart:typed_data" show Uint8List;
-
-@Since("2.1")
-export "dart:async" show Future, Stream;
-
-part "annotations.dart";
-part "bigint.dart";
-part "bool.dart";
-part "comparable.dart";
-part "date_time.dart";
-part "double.dart";
-part "duration.dart";
-part "errors.dart";
-part "exceptions.dart";
-part "expando.dart";
-part "function.dart";
-part "identical.dart";
-part "int.dart";
-part "invocation.dart";
-part "iterable.dart";
-part "iterator.dart";
-part "list.dart";
-part "map.dart";
-part "null.dart";
-part "num.dart";
-part "object.dart";
-part "pattern.dart";
-part "print.dart";
-part "regexp.dart";
-part "set.dart";
-part "sink.dart";
-part "stacktrace.dart";
-part "stopwatch.dart";
-part "string.dart";
-part "string_buffer.dart";
-part "string_sink.dart";
-part "symbol.dart";
-part "type.dart";
-part "uri.dart";
diff --git a/sdk_nnbd/lib/core/core_sources.gni b/sdk_nnbd/lib/core/core_sources.gni
deleted file mode 100644
index ce2785e..0000000
--- a/sdk_nnbd/lib/core/core_sources.gni
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2017, 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.
-
-core_sdk_sources = [
-  "core.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "annotations.dart",
-  "bigint.dart",
-  "bool.dart",
-  "comparable.dart",
-  "date_time.dart",
-  "double.dart",
-  "duration.dart",
-  "errors.dart",
-  "exceptions.dart",
-  "expando.dart",
-  "function.dart",
-  "identical.dart",
-  "int.dart",
-  "invocation.dart",
-  "iterable.dart",
-  "iterator.dart",
-  "list.dart",
-  "map.dart",
-  "null.dart",
-  "num.dart",
-  "object.dart",
-  "pattern.dart",
-  "print.dart",
-  "regexp.dart",
-  "set.dart",
-  "sink.dart",
-  "stacktrace.dart",
-  "stopwatch.dart",
-  "string.dart",
-  "string_buffer.dart",
-  "string_sink.dart",
-  "symbol.dart",
-  "type.dart",
-  "uri.dart",
-]
diff --git a/sdk_nnbd/lib/core/date_time.dart b/sdk_nnbd/lib/core/date_time.dart
deleted file mode 100644
index ae13922..0000000
--- a/sdk_nnbd/lib/core/date_time.dart
+++ /dev/null
@@ -1,875 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * An instant in time, such as July 20, 1969, 8:18pm GMT.
- *
- * DateTimes can represent time values that are at a distance of at most
- * 100,000,000 days from epoch (1970-01-01 UTC): -271821-04-20 to 275760-09-13.
- *
- * Create a DateTime object by using one of the constructors
- * or by parsing a correctly formatted string,
- * which complies with a subset of ISO 8601.
- * Note that hours are specified between 0 and 23,
- * as in a 24-hour clock.
- * For example:
- *
- * ```
- * var now = new DateTime.now();
- * var berlinWallFell = new DateTime.utc(1989, 11, 9);
- * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");  // 8:18pm
- * ```
- *
- * A DateTime object is anchored either in the UTC time zone
- * or in the local time zone of the current computer
- * when the object is created.
- *
- * Once created, neither the value nor the time zone
- * of a DateTime object may be changed.
- *
- * You can use properties to get
- * the individual units of a DateTime object.
- *
- * ```
- * assert(berlinWallFell.month == 11);
- * assert(moonLanding.hour == 20);
- * ```
- *
- * For convenience and readability,
- * the DateTime class provides a constant for each day and month
- * name - for example, [august] and [friday].
- * You can use these constants to improve code readability:
- *
- * ```
- * var berlinWallFell = new DateTime.utc(1989, DateTime.november, 9);
- * assert(berlinWallFell.weekday == DateTime.thursday);
- * ```
- *
- * Day and month values begin at 1, and the week starts on Monday.
- * That is, the constants [january] and [monday] are both 1.
- *
- * ## Working with UTC and local time
- *
- * A DateTime object is in the local time zone
- * unless explicitly created in the UTC time zone.
- *
- * ```
- * var dDay = new DateTime.utc(1944, 6, 6);
- * ```
- *
- * Use [isUtc] to determine whether a DateTime object is based in UTC.
- * Use the methods [toLocal] and [toUtc]
- * to get the equivalent date/time value specified in the other time zone.
- * Use [timeZoneName] to get an abbreviated name of the time zone
- * for the DateTime object.
- * To find the difference
- * between UTC and the time zone of a DateTime object
- * call [timeZoneOffset].
- *
- * ## Comparing DateTime objects
- *
- * The DateTime class contains several handy methods,
- * such as [isAfter], [isBefore], and [isAtSameMomentAs],
- * for comparing DateTime objects.
- *
- * ```
- * assert(berlinWallFell.isAfter(moonLanding) == true);
- * assert(berlinWallFell.isBefore(moonLanding) == false);
- * ```
- *
- * ## Using DateTime with Duration
- *
- * Use the [add] and [subtract] methods with a [Duration] object
- * to create a new DateTime object based on another.
- * For example, to find the date that is sixty days (24 * 60 hours) after today,
- * write:
- *
- * ```
- * var now = new DateTime.now();
- * var sixtyDaysFromNow = now.add(new Duration(days: 60));
- * ```
- *
- * To find out how much time is between two DateTime objects use
- * [difference], which returns a [Duration] object:
- *
- * ```
- * var difference = berlinWallFell.difference(moonLanding);
- * assert(difference.inDays == 7416);
- * ```
- *
- * The difference between two dates in different time zones
- * is just the number of nanoseconds between the two points in time.
- * It doesn't take calendar days into account.
- * That means that the difference between two midnights in local time may be
- * less than 24 hours times the number of days between them,
- * if there is a daylight saving change in between.
- * If the difference above is calculated using Australian local time, the
- * difference is 7415 days and 23 hours, which is only 7415 whole days as
- * reported by `inDays`.
- *
- * ## Other resources
- *
- * See [Duration] to represent a span of time.
- * See [Stopwatch] to measure timespans.
- *
- * The DateTime class does not provide internationalization.
- * To internationalize your code, use
- * the [intl](https://pub.dev/packages/intl) package.
- *
- */
-class DateTime implements Comparable<DateTime> {
-  // Weekday constants that are returned by [weekday] method:
-  static const int monday = 1;
-  static const int tuesday = 2;
-  static const int wednesday = 3;
-  static const int thursday = 4;
-  static const int friday = 5;
-  static const int saturday = 6;
-  static const int sunday = 7;
-  static const int daysPerWeek = 7;
-
-  // Month constants that are returned by the [month] getter.
-  static const int january = 1;
-  static const int february = 2;
-  static const int march = 3;
-  static const int april = 4;
-  static const int may = 5;
-  static const int june = 6;
-  static const int july = 7;
-  static const int august = 8;
-  static const int september = 9;
-  static const int october = 10;
-  static const int november = 11;
-  static const int december = 12;
-  static const int monthsPerYear = 12;
-
-  /**
-   * The value of this DateTime.
-   *
-   * The content of this field is implementation dependent. On JavaScript it is
-   * equal to [millisecondsSinceEpoch]. On the VM it is equal to
-   * [microsecondsSinceEpoch].
-   */
-  final int _value;
-
-  /**
-   * True if this [DateTime] is set to UTC time.
-   *
-   * ```
-   * var dDay = new DateTime.utc(1944, 6, 6);
-   * assert(dDay.isUtc);
-   * ```
-   *
-   */
-  final bool isUtc;
-
-  /**
-   * Constructs a [DateTime] instance specified in the local time zone.
-   *
-   * For example,
-   * to create a new DateTime object representing the 7th of September 2017,
-   * 5:30pm
-   *
-   * ```
-   * var dentistAppointment = new DateTime(2017, 9, 7, 17, 30);
-   * ```
-   */
-  DateTime(int year,
-      [int month = 1,
-      int day = 1,
-      int hour = 0,
-      int minute = 0,
-      int second = 0,
-      int millisecond = 0,
-      int microsecond = 0])
-      : this._internal(year, month, day, hour, minute, second, millisecond,
-            microsecond, false);
-
-  /**
-   * Constructs a [DateTime] instance specified in the UTC time zone.
-   *
-   * ```
-   * var moonLanding = new DateTime.utc(1969, 7, 20, 20, 18, 04);
-   * ```
-   *
-   * When dealing with dates or historic events prefer to use UTC DateTimes,
-   * since they are unaffected by daylight-saving changes and are unaffected
-   * by the local timezone.
-   */
-  DateTime.utc(int year,
-      [int month = 1,
-      int day = 1,
-      int hour = 0,
-      int minute = 0,
-      int second = 0,
-      int millisecond = 0,
-      int microsecond = 0])
-      : this._internal(year, month, day, hour, minute, second, millisecond,
-            microsecond, true);
-
-  /**
-   * Constructs a [DateTime] instance with current date and time in the
-   * local time zone.
-   *
-   * ```
-   * var thisInstant = new DateTime.now();
-   * ```
-   */
-  DateTime.now() : this._now();
-
-  /**
-   * Constructs a new [DateTime] instance based on [formattedString].
-   *
-   * The [formattedString] must not be `null`.
-   * Throws a [FormatException] if the input string cannot be parsed.
-   *
-   * The function parses a subset of ISO 8601
-   * which includes the subset accepted by RFC 3339.
-   *
-   * The accepted inputs are currently:
-   *
-   * * A date: A signed four-to-six digit year, two digit month and
-   *   two digit day, optionally separated by `-` characters.
-   *   Examples: "19700101", "-0004-12-24", "81030-04-01".
-   * * An optional time part, separated from the date by either `T` or a space.
-   *   The time part is a two digit hour,
-   *   then optionally a two digit minutes value,
-   *   then optionally a two digit seconds value, and
-   *   then optionally a '.' or ',' followed by at least a one digit
-   *   second fraction.
-   *   The minutes and seconds may be separated from the previous parts by a
-   *   ':'.
-   *   Examples: "12", "12:30:24.124", "12:30:24,124", "123010.50".
-   * * An optional time-zone offset part,
-   *   possibly separated from the previous by a space.
-   *   The time zone is either 'z' or 'Z', or it is a signed two digit hour
-   *   part and an optional two digit minute part. The sign must be either
-   *   "+" or "-", and can not be omitted.
-   *   The minutes may be separated from the hours by a ':'.
-   *   Examples: "Z", "-10", "+01:30", "+1130".
-   *
-   * This includes the output of both [toString] and [toIso8601String], which
-   * will be parsed back into a `DateTime` object with the same time as the
-   * original.
-   *
-   * The result is always in either local time or UTC.
-   * If a time zone offset other than UTC is specified,
-   * the time is converted to the equivalent UTC time.
-   *
-   * Examples of accepted strings:
-   *
-   * * `"2012-02-27 13:27:00"`
-   * * `"2012-02-27 13:27:00.123456789z"`
-   * * `"2012-02-27 13:27:00,123456789z"`
-   * * `"20120227 13:27:00"`
-   * * `"20120227T132700"`
-   * * `"20120227"`
-   * * `"+20120227"`
-   * * `"2012-02-27T14Z"`
-   * * `"2012-02-27T14+00:00"`
-   * * `"-123450101 00:00:00 Z"`: in the year -12345.
-   * * `"2002-02-27T14:00:00-0500"`: Same as `"2002-02-27T19:00:00Z"`
-   */
-  // TODO(lrn): restrict incorrect values like  2003-02-29T50:70:80.
-  // Or not, that may be a breaking change.
-  static DateTime parse(String formattedString) {
-    var re = _parseFormat;
-    Match? match = re.firstMatch(formattedString);
-    if (match != null) {
-      int parseIntOrZero(String? matched) {
-        if (matched == null) return 0;
-        return int.parse(matched);
-      }
-
-      // Parses fractional second digits of '.(\d+)' into the combined
-      // microseconds. We only use the first 6 digits because of DateTime
-      // precision of 999 milliseconds and 999 microseconds.
-      int parseMilliAndMicroseconds(String? matched) {
-        if (matched == null) return 0;
-        int length = matched.length;
-        assert(length >= 1);
-        int result = 0;
-        for (int i = 0; i < 6; i++) {
-          result *= 10;
-          if (i < matched.length) {
-            result += matched.codeUnitAt(i) ^ 0x30;
-          }
-        }
-        return result;
-      }
-
-      int years = int.parse(match[1]!);
-      int month = int.parse(match[2]!);
-      int day = int.parse(match[3]!);
-      int hour = parseIntOrZero(match[4]);
-      int minute = parseIntOrZero(match[5]);
-      int second = parseIntOrZero(match[6]);
-      int milliAndMicroseconds = parseMilliAndMicroseconds(match[7]);
-      int millisecond =
-          milliAndMicroseconds ~/ Duration.microsecondsPerMillisecond;
-      int microsecond = milliAndMicroseconds
-          .remainder(Duration.microsecondsPerMillisecond) as int;
-      bool isUtc = false;
-      if (match[8] != null) {
-        // timezone part
-        isUtc = true;
-        String? tzSign = match[9];
-        if (tzSign != null) {
-          // timezone other than 'Z' and 'z'.
-          int sign = (tzSign == '-') ? -1 : 1;
-          int hourDifference = int.parse(match[10]!);
-          int minuteDifference = parseIntOrZero(match[11]);
-          minuteDifference += 60 * hourDifference;
-          minute -= sign * minuteDifference;
-        }
-      }
-      int? value = _brokenDownDateToValue(years, month, day, hour, minute,
-          second, millisecond, microsecond, isUtc);
-      if (value == null) {
-        throw FormatException("Time out of range", formattedString);
-      }
-      return DateTime._withValue(value, isUtc: isUtc);
-    } else {
-      throw FormatException("Invalid date format", formattedString);
-    }
-  }
-
-  /**
-   * Constructs a new [DateTime] instance based on [formattedString].
-   *
-   * Works like [parse] except that this function returns `null`
-   * where [parse] would throw a [FormatException].
-   */
-  static DateTime? tryParse(String formattedString) {
-    // TODO: Optimize to avoid throwing.
-    try {
-      return parse(formattedString);
-    } on FormatException {
-      return null;
-    }
-  }
-
-  static const int _maxMillisecondsSinceEpoch = 8640000000000000;
-
-  /**
-   * Constructs a new [DateTime] instance
-   * with the given [millisecondsSinceEpoch].
-   *
-   * If [isUtc] is false then the date is in the local time zone.
-   *
-   * The constructed [DateTime] represents
-   * 1970-01-01T00:00:00Z + [millisecondsSinceEpoch] ms in the given
-   * time zone (local or UTC).
-   */
-  external DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
-      {bool isUtc = false});
-
-  /**
-   * Constructs a new [DateTime] instance
-   * with the given [microsecondsSinceEpoch].
-   *
-   * If [isUtc] is false then the date is in the local time zone.
-   *
-   * The constructed [DateTime] represents
-   * 1970-01-01T00:00:00Z + [microsecondsSinceEpoch] us in the given
-   * time zone (local or UTC).
-   */
-  external DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch,
-      {bool isUtc = false});
-
-  /**
-   * Constructs a new [DateTime] instance with the given value.
-   *
-   * If [isUtc] is false then the date is in the local time zone.
-   */
-  DateTime._withValue(this._value, {required this.isUtc}) {
-    if (millisecondsSinceEpoch.abs() > _maxMillisecondsSinceEpoch ||
-        (millisecondsSinceEpoch.abs() == _maxMillisecondsSinceEpoch &&
-            microsecond != 0)) {
-      throw ArgumentError(
-          "DateTime is outside valid range: $millisecondsSinceEpoch");
-    }
-    // For backwards compatibility with legacy mode.
-    ArgumentError.checkNotNull(isUtc, "isUtc");
-  }
-
-  /**
-   * Returns true if [other] is a [DateTime] at the same moment and in the
-   * same time zone (UTC or local).
-   *
-   * ```
-   * var dDayUtc = new DateTime.utc(1944, 6, 6);
-   * var dDayLocal = dDayUtc.toLocal();
-   *
-   * // These two dates are at the same moment, but are in different zones.
-   * assert(dDayUtc != dDayLocal);
-   * ```
-   *
-   * See [isAtSameMomentAs] for a comparison that compares moments in time
-   * independently of their zones.
-   */
-  external bool operator ==(Object other);
-
-  /**
-   * Returns true if [this] occurs before [other].
-   *
-   * The comparison is independent
-   * of whether the time is in UTC or in the local time zone.
-   *
-   * ```
-   * var now = new DateTime.now();
-   * var earlier = now.subtract(const Duration(seconds: 5));
-   * assert(earlier.isBefore(now));
-   * assert(!now.isBefore(now));
-   *
-   * // This relation stays the same, even when changing timezones.
-   * assert(earlier.isBefore(now.toUtc()));
-   * assert(earlier.toUtc().isBefore(now));
-   *
-   * assert(!now.toUtc().isBefore(now));
-   * assert(!now.isBefore(now.toUtc()));
-   * ```
-   */
-  external bool isBefore(DateTime other);
-
-  /**
-   * Returns true if [this] occurs after [other].
-   *
-   * The comparison is independent
-   * of whether the time is in UTC or in the local time zone.
-   *
-   * ```
-   * var now = new DateTime.now();
-   * var later = now.add(const Duration(seconds: 5));
-   * assert(later.isAfter(now));
-   * assert(!now.isBefore(now));
-   *
-   * // This relation stays the same, even when changing timezones.
-   * assert(later.isAfter(now.toUtc()));
-   * assert(later.toUtc().isAfter(now));
-   *
-   * assert(!now.toUtc().isBefore(now));
-   * assert(!now.isBefore(now.toUtc()));
-   * ```
-   */
-  external bool isAfter(DateTime other);
-
-  /**
-   * Returns true if [this] occurs at the same moment as [other].
-   *
-   * The comparison is independent of whether the time is in UTC or in the local
-   * time zone.
-   *
-   * ```
-   * var now = new DateTime.now();
-   * var later = now.add(const Duration(seconds: 5));
-   * assert(!later.isAtSameMomentAs(now));
-   * assert(now.isAtSameMomentAs(now));
-   *
-   * // This relation stays the same, even when changing timezones.
-   * assert(!later.isAtSameMomentAs(now.toUtc()));
-   * assert(!later.toUtc().isAtSameMomentAs(now));
-   *
-   * assert(now.toUtc().isAtSameMomentAs(now));
-   * assert(now.isAtSameMomentAs(now.toUtc()));
-   * ```
-   */
-  external bool isAtSameMomentAs(DateTime other);
-
-  /**
-   * Compares this DateTime object to [other],
-   * returning zero if the values are equal.
-   *
-   * Returns a negative value if this DateTime [isBefore] [other]. It returns 0
-   * if it [isAtSameMomentAs] [other], and returns a positive value otherwise
-   * (when this [isAfter] [other]).
-   */
-  external int compareTo(DateTime other);
-
-  int get hashCode => (_value ^ (_value >> 30)) & 0x3FFFFFFF;
-
-  /**
-   * Returns this DateTime value in the local time zone.
-   *
-   * Returns [this] if it is already in the local time zone.
-   * Otherwise this method is equivalent to:
-   *
-   * ```
-   * new DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch,
-   *                                         isUtc: false)
-   * ```
-   */
-  DateTime toLocal() {
-    if (isUtc) {
-      return DateTime._withValue(_value, isUtc: false);
-    }
-    return this;
-  }
-
-  /**
-   * Returns this DateTime value in the UTC time zone.
-   *
-   * Returns [this] if it is already in UTC.
-   * Otherwise this method is equivalent to:
-   *
-   * ```
-   * new DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch,
-   *                                         isUtc: true)
-   * ```
-   */
-  DateTime toUtc() {
-    if (isUtc) return this;
-    return DateTime._withValue(_value, isUtc: true);
-  }
-
-  static String _fourDigits(int n) {
-    int absN = n.abs();
-    String sign = n < 0 ? "-" : "";
-    if (absN >= 1000) return "$n";
-    if (absN >= 100) return "${sign}0$absN";
-    if (absN >= 10) return "${sign}00$absN";
-    return "${sign}000$absN";
-  }
-
-  static String _sixDigits(int n) {
-    assert(n < -9999 || n > 9999);
-    int absN = n.abs();
-    String sign = n < 0 ? "-" : "+";
-    if (absN >= 100000) return "$sign$absN";
-    return "${sign}0$absN";
-  }
-
-  static String _threeDigits(int n) {
-    if (n >= 100) return "${n}";
-    if (n >= 10) return "0${n}";
-    return "00${n}";
-  }
-
-  static String _twoDigits(int n) {
-    if (n >= 10) return "${n}";
-    return "0${n}";
-  }
-
-  /**
-   * Returns a human-readable string for this instance.
-   *
-   * The returned string is constructed for the time zone of this instance.
-   * The `toString()` method provides a simply formatted string.
-   * It does not support internationalized strings.
-   * Use the [intl](https://pub.dev/packages/intl) package
-   * at the pub shared packages repo.
-   *
-   * The resulting string can be parsed back using [parse].
-   */
-  String toString() {
-    String y = _fourDigits(year);
-    String m = _twoDigits(month);
-    String d = _twoDigits(day);
-    String h = _twoDigits(hour);
-    String min = _twoDigits(minute);
-    String sec = _twoDigits(second);
-    String ms = _threeDigits(millisecond);
-    String us = microsecond == 0 ? "" : _threeDigits(microsecond);
-    if (isUtc) {
-      return "$y-$m-$d $h:$min:$sec.$ms${us}Z";
-    } else {
-      return "$y-$m-$d $h:$min:$sec.$ms$us";
-    }
-  }
-
-  /**
-   * Returns an ISO-8601 full-precision extended format representation.
-   *
-   * The format is `yyyy-MM-ddTHH:mm:ss.mmmuuuZ` for UTC time, and
-   * `yyyy-MM-ddTHH:mm:ss.mmmuuu` (no trailing "Z") for local/non-UTC time,
-   * where:
-   *
-   * * `yyyy` is a, possibly negative, four digit representation of the year,
-   *   if the year is in the range -9999 to 9999,
-   *   otherwise it is a signed six digit representation of the year.
-   * * `MM` is the month in the range 01 to 12,
-   * * `dd` is the day of the month in the range 01 to 31,
-   * * `HH` are hours in the range 00 to 23,
-   * * `mm` are minutes in the range 00 to 59,
-   * * `ss` are seconds in the range 00 to 59 (no leap seconds),
-   * * `mmm` are milliseconds in the range 000 to 999, and
-   * * `uuu` are microseconds in the range 001 to 999. If [microsecond] equals
-   *   0, then this part is omitted.
-   *
-   * The resulting string can be parsed back using [parse].
-   */
-  String toIso8601String() {
-    String y =
-        (year >= -9999 && year <= 9999) ? _fourDigits(year) : _sixDigits(year);
-    String m = _twoDigits(month);
-    String d = _twoDigits(day);
-    String h = _twoDigits(hour);
-    String min = _twoDigits(minute);
-    String sec = _twoDigits(second);
-    String ms = _threeDigits(millisecond);
-    String us = microsecond == 0 ? "" : _threeDigits(microsecond);
-    if (isUtc) {
-      return "$y-$m-${d}T$h:$min:$sec.$ms${us}Z";
-    } else {
-      return "$y-$m-${d}T$h:$min:$sec.$ms$us";
-    }
-  }
-
-  /**
-   * Returns a new [DateTime] instance with [duration] added to [this].
-   *
-   * ```
-   * var today = new DateTime.now();
-   * var fiftyDaysFromNow = today.add(new Duration(days: 50));
-   * ```
-   *
-   * Notice that the duration being added is actually 50 * 24 * 60 * 60
-   * seconds. If the resulting `DateTime` has a different daylight saving offset
-   * than `this`, then the result won't have the same time-of-day as `this`, and
-   * may not even hit the calendar date 50 days later.
-   *
-   * Be careful when working with dates in local time.
-   */
-  external DateTime add(Duration duration);
-
-  /**
-   * Returns a new [DateTime] instance with [duration] subtracted from [this].
-   *
-   * ```
-   * DateTime today = new DateTime.now();
-   * DateTime fiftyDaysAgo = today.subtract(new Duration(days: 50));
-   * ```
-   *
-   * Notice that the duration being subtracted is actually 50 * 24 * 60 * 60
-   * seconds. If the resulting `DateTime` has a different daylight saving offset
-   * than `this`, then the result won't have the same time-of-day as `this`, and
-   * may not even hit the calendar date 50 days earlier.
-   *
-   * Be careful when working with dates in local time.
-   */
-  external DateTime subtract(Duration duration);
-
-  /**
-   * Returns a [Duration] with the difference when subtracting [other] from
-   * [this].
-   *
-   * The returned [Duration] will be negative if [other] occurs after [this].
-   *
-   * ```
-   * var berlinWallFell = new DateTime.utc(1989, DateTime.november, 9);
-   * var dDay = new DateTime.utc(1944, DateTime.june, 6);
-   *
-   * Duration difference = berlinWallFell.difference(dDay);
-   * assert(difference.inDays == 16592);
-   * ```
-   *
-   * The difference is measured in seconds and fractions of seconds.
-   * The difference above counts the number of fractional seconds between
-   * midnight at the beginning of those dates.
-   * If the dates above had been in local time, not UTC, then the difference
-   * between two midnights may not be a multiple of 24 hours due to daylight
-   * saving differences.
-   *
-   * For example, in Australia, similar code using local time instead of UTC:
-   *
-   * ```
-   * var berlinWallFell = new DateTime(1989, DateTime.november, 9);
-   * var dDay = new DateTime(1944, DateTime.june, 6);
-   * Duration difference = berlinWallFell.difference(dDay);
-   * assert(difference.inDays == 16592);
-   * ```
-   * will fail because the difference is actually 16591 days and 23 hours, and
-   * [Duration.inDays] only returns the number of whole days.
-   */
-  external Duration difference(DateTime other);
-
-  external DateTime._internal(int year, int month, int day, int hour,
-      int minute, int second, int millisecond, int microsecond, bool isUtc);
-
-  external DateTime._now();
-
-  /// Returns the time as value (millisecond or microsecond since epoch), or
-  /// null if the values are out of range.
-  external static int? _brokenDownDateToValue(
-      int year,
-      int month,
-      int day,
-      int hour,
-      int minute,
-      int second,
-      int millisecond,
-      int microsecond,
-      bool isUtc);
-
-  /**
-   * The number of milliseconds since
-   * the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
-   *
-   * This value is independent of the time zone.
-   *
-   * This value is at most
-   * 8,640,000,000,000,000ms (100,000,000 days) from the Unix epoch.
-   * In other words: `millisecondsSinceEpoch.abs() <= 8640000000000000`.
-   */
-  external int get millisecondsSinceEpoch;
-
-  /**
-   * The number of microseconds since
-   * the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
-   *
-   * This value is independent of the time zone.
-   *
-   * This value is at most
-   * 8,640,000,000,000,000,000us (100,000,000 days) from the Unix epoch.
-   * In other words: `microsecondsSinceEpoch.abs() <= 8640000000000000000`.
-   *
-   * Note that this value does not fit into 53 bits (the size of a IEEE double).
-   * A JavaScript number is not able to hold this value.
-   */
-  external int get microsecondsSinceEpoch;
-
-  /**
-   * The time zone name.
-   *
-   * This value is provided by the operating system and may be an
-   * abbreviation or a full name.
-   *
-   * In the browser or on Unix-like systems commonly returns abbreviations,
-   * such as "CET" or "CEST". On Windows returns the full name, for example
-   * "Pacific Standard Time".
-   */
-  external String get timeZoneName;
-
-  /**
-   * The time zone offset, which
-   * is the difference between local time and UTC.
-   *
-   * The offset is positive for time zones east of UTC.
-   *
-   * Note, that JavaScript, Python and C return the difference between UTC and
-   * local time. Java, C# and Ruby return the difference between local time and
-   * UTC.
-   */
-  external Duration get timeZoneOffset;
-
-  /**
-   * The year.
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.year == 1969);
-   * ```
-   */
-  external int get year;
-
-  /**
-   * The month [1..12].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.month == 7);
-   * assert(moonLanding.month == DateTime.july);
-   * ```
-   */
-  external int get month;
-
-  /**
-   * The day of the month [1..31].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.day == 20);
-   * ```
-   */
-  external int get day;
-
-  /**
-   * The hour of the day, expressed as in a 24-hour clock [0..23].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.hour == 20);
-   * ```
-   */
-  external int get hour;
-
-  /**
-   * The minute [0...59].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.minute == 18);
-   * ```
-   */
-  external int get minute;
-
-  /**
-   * The second [0...59].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.second == 4);
-   * ```
-   */
-  external int get second;
-
-  /**
-   * The millisecond [0...999].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.millisecond == 0);
-   * ```
-   */
-  external int get millisecond;
-
-  /**
-   * The microsecond [0...999].
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.microsecond == 0);
-   * ```
-   */
-  external int get microsecond;
-
-  /**
-   * The day of the week [monday]..[sunday].
-   *
-   * In accordance with ISO 8601
-   * a week starts with Monday, which has the value 1.
-   *
-   * ```
-   * var moonLanding = DateTime.parse("1969-07-20 20:18:04Z");
-   * assert(moonLanding.weekday == 7);
-   * assert(moonLanding.weekday == DateTime.sunday);
-   * ```
-   */
-  external int get weekday;
-
-  /*
-   * date ::= yeardate time_opt timezone_opt
-   * yeardate ::= year colon_opt month colon_opt day
-   * year ::= sign_opt digit{4,6}
-   * colon_opt :: <empty> | ':'
-   * sign ::= '+' | '-'
-   * sign_opt ::=  <empty> | sign
-   * month ::= digit{2}
-   * day ::= digit{2}
-   * time_opt ::= <empty> | (' ' | 'T') hour minutes_opt
-   * minutes_opt ::= <empty> | colon_opt digit{2} seconds_opt
-   * seconds_opt ::= <empty> | colon_opt digit{2} millis_opt
-   * micros_opt ::= <empty> | ('.' | ',') digit+
-   * timezone_opt ::= <empty> | space_opt timezone
-   * space_opt :: ' ' | <empty>
-   * timezone ::= 'z' | 'Z' | sign digit{2} timezonemins_opt
-   * timezonemins_opt ::= <empty> | colon_opt digit{2}
-   */
-  static final RegExp _parseFormat =
-      RegExp(r'^([+-]?\d{4,6})-?(\d\d)-?(\d\d)' // Day part.
-          r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d+))?)?)?' // Time part.
-          r'( ?[zZ]| ?([-+])(\d\d)(?::?(\d\d))?)?)?$'); // Timezone part.
-}
diff --git a/sdk_nnbd/lib/core/double.dart b/sdk_nnbd/lib/core/double.dart
deleted file mode 100644
index 42ff566..0000000
--- a/sdk_nnbd/lib/core/double.dart
+++ /dev/null
@@ -1,218 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-// TODO: Convert this abstract class into a concrete class double
-// that uses the patch class functionality to account for the
-// different platform implementations.
-
-/**
- * A double-precision floating point number.
- *
- * Representation of Dart doubles containing double specific constants
- * and operations and specializations of operations inherited from
- * [num]. Dart doubles are 64-bit floating-point numbers as specified in the
- * IEEE 754 standard.
- *
- * The [double] type is contagious. Operations on [double]s return
- * [double] results.
- *
- * It is a compile-time error for a class to attempt to extend or implement
- * double.
- */
-abstract class double extends num {
-  static const double nan = 0.0 / 0.0;
-  static const double infinity = 1.0 / 0.0;
-  static const double negativeInfinity = -infinity;
-  static const double minPositive = 5e-324;
-  static const double maxFinite = 1.7976931348623157e+308;
-
-  double remainder(num other);
-
-  /** Addition operator. */
-  double operator +(num other);
-
-  /** Subtraction operator. */
-  double operator -(num other);
-
-  /** Multiplication operator. */
-  double operator *(num other);
-
-  double operator %(num other);
-
-  /** Division operator. */
-  double operator /(num other);
-
-  /**
-   * Truncating division operator.
-   *
-   * The result of the truncating division `a ~/ b` is equivalent to
-   * `(a / b).truncate()`.
-   */
-  int operator ~/(num other);
-
-  /** Negate operator. */
-  double operator -();
-
-  /** Returns the absolute value of this [double]. */
-  double abs();
-
-  /**
-   * Returns the sign of the double's numerical value.
-   *
-   * Returns -1.0 if the value is less than zero,
-   * +1.0 if the value is greater than zero,
-   * and the value itself if it is -0.0, 0.0 or NaN.
-   */
-  double get sign;
-
-  /**
-   * Returns the integer closest to `this`.
-   *
-   * Rounds away from zero when there is no closest integer:
-   *  `(3.5).round() == 4` and `(-3.5).round() == -4`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int round();
-
-  /**
-   * Returns the greatest integer no greater than `this`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int floor();
-
-  /**
-   * Returns the least integer no smaller than `this`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int ceil();
-
-  /**
-   * Returns the integer obtained by discarding any fractional
-   * digits from `this`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int truncate();
-
-  /**
-   * Returns the integer double value closest to `this`.
-   *
-   * Rounds away from zero when there is no closest integer:
-   *  `(3.5).roundToDouble() == 4` and `(-3.5).roundToDouble() == -4`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is not
-   * a finite value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`,
-   * and `-0.0` is therefore considered closer to negative numbers than `0.0`.
-   * This means that for a value, `d` in the range `-0.5 < d < 0.0`,
-   * the result is `-0.0`.
-   */
-  double roundToDouble();
-
-  /**
-   * Returns the greatest integer double value no greater than `this`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is not
-   * a finite value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`.
-   * A number `d` in the range `0.0 < d < 1.0` will return `0.0`.
-   */
-  double floorToDouble();
-
-  /**
-   * Returns the least integer double value no smaller than `this`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is not
-   * a finite value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`.
-   * A number `d` in the range `-1.0 < d < 0.0` will return `-0.0`.
-   */
-  double ceilToDouble();
-
-  /**
-   * Returns the integer double value obtained by discarding any fractional
-   * digits from `this`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is not
-   * a finite value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`.
-   * A number `d` in the range `-1.0 < d < 0.0` will return `-0.0`, and
-   * in the range `0.0 < d < 1.0` it will return 0.0.
-   */
-  double truncateToDouble();
-
-  /**
-   * Provide a representation of this [double] value.
-   *
-   * The representation is a number literal such that the closest double value
-   * to the representation's mathematical value is this [double].
-   *
-   * Returns "NaN" for the Not-a-Number value.
-   * Returns "Infinity" and "-Infinity" for positive and negative Infinity.
-   * Returns "-0.0" for negative zero.
-   *
-   * For all doubles, `d`, converting to a string and parsing the string back
-   * gives the same value again: `d == double.parse(d.toString())` (except when
-   * `d` is NaN).
-   */
-  String toString();
-
-  /**
-   * Parse [source] as an double literal and return its value.
-   *
-   * Accepts an optional sign (`+` or `-`) followed by either the characters
-   * "Infinity", the characters "NaN" or a floating-point representation.
-   * A floating-point representation is composed of a mantissa and an optional
-   * exponent part. The mantissa is either a decimal point (`.`) followed by a
-   * sequence of (decimal) digits, or a sequence of digits
-   * optionally followed by a decimal point and optionally more digits. The
-   * (optional) exponent part consists of the character "e" or "E", an optional
-   * sign, and one or more digits.
-   * The [source] must not be `null`.
-   *
-   * Leading and trailing whitespace is ignored.
-   *
-   * If the [source] string is not a valid double literal, the [onError]
-   * is called with the [source] as argument, and its return value is
-   * used instead. If no `onError` is provided, a [FormatException]
-   * is thrown instead.
-   *
-   * The [onError] function is only invoked if [source] is a [String] with an
-   * invalid format. It is not invoked if [source] is `null`.
-   *
-   * Examples of accepted strings:
-   *
-   *     "3.14"
-   *     "  3.14 \xA0"
-   *     "0."
-   *     ".0"
-   *     "-1.e3"
-   *     "1234E+7"
-   *     "+.12e-9"
-   *     "-NaN"
-   *
-   * The [onError] parameter is deprecated and will be removed.
-   * Instead of `double.parse(string, (string) { ... })`,
-   * you should use `double.tryParse(string) ?? (...)`.
-   */
-  external static double parse(String source,
-      [@deprecated double onError(String source)?]);
-
-  /**
-   * Parse [source] as an double literal and return its value.
-   *
-   * Like [parse] except that this function returns `null` for invalid inputs
-   * instead of throwing, and the [source] must still not be `null`.
-   */
-  external static double? tryParse(String source);
-}
diff --git a/sdk_nnbd/lib/core/duration.dart b/sdk_nnbd/lib/core/duration.dart
deleted file mode 100644
index 2a1f406..0000000
--- a/sdk_nnbd/lib/core/duration.dart
+++ /dev/null
@@ -1,295 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * A span of time, such as 27 days, 4 hours, 12 minutes, and 3 seconds.
- *
- * A `Duration` represents a difference from one point in time to another. The
- * duration may be "negative" if the difference is from a later time to an
- * earlier.
- *
- * Durations are context independent. For example, a duration of 2 days is
- * always 48 hours, even when it is added to a `DateTime` just when the
- * time zone is about to do a daylight-savings switch. (See [DateTime.add]).
- *
- * Despite the same name, a `Duration` object does not implement "Durations"
- * as specified by ISO 8601. In particular, a duration object does not keep
- * track of the individually provided members (such as "days" or "hours"), but
- * only uses these arguments to compute the length of the corresponding time
- * interval.
- *
- * To create a new Duration object, use this class's single constructor
- * giving the appropriate arguments:
- * ```dart
- * Duration fastestMarathon = new Duration(hours:2, minutes:3, seconds:2);
- * ```
- * The [Duration] is the sum of all individual parts.
- * This means that individual parts can be larger than the next-bigger unit.
- * For example, [inMinutes] can be greater than 59.
- * ```dart
- * assert(fastestMarathon.inMinutes == 123);
- * ```
- * All individual parts are allowed to be negative.
- *
- * Use one of the properties, such as [inDays],
- * to retrieve the integer value of the Duration in the specified time unit.
- * Note that the returned value is rounded down.
- * For example,
- * ```dart
- * Duration aLongWeekend = new Duration(hours:88);
- * assert(aLongWeekend.inDays == 3);
- * ```
- * This class provides a collection of arithmetic
- * and comparison operators,
- * plus a set of constants useful for converting time units.
- *
- * See [DateTime] to represent a point in time.
- * See [Stopwatch] to measure time-spans.
- */
-class Duration implements Comparable<Duration> {
-  static const int microsecondsPerMillisecond = 1000;
-  static const int millisecondsPerSecond = 1000;
-  static const int secondsPerMinute = 60;
-  static const int minutesPerHour = 60;
-  static const int hoursPerDay = 24;
-
-  static const int microsecondsPerSecond =
-      microsecondsPerMillisecond * millisecondsPerSecond;
-  static const int microsecondsPerMinute =
-      microsecondsPerSecond * secondsPerMinute;
-  static const int microsecondsPerHour = microsecondsPerMinute * minutesPerHour;
-  static const int microsecondsPerDay = microsecondsPerHour * hoursPerDay;
-
-  static const int millisecondsPerMinute =
-      millisecondsPerSecond * secondsPerMinute;
-  static const int millisecondsPerHour = millisecondsPerMinute * minutesPerHour;
-  static const int millisecondsPerDay = millisecondsPerHour * hoursPerDay;
-
-  static const int secondsPerHour = secondsPerMinute * minutesPerHour;
-  static const int secondsPerDay = secondsPerHour * hoursPerDay;
-
-  static const int minutesPerDay = minutesPerHour * hoursPerDay;
-
-  static const Duration zero = Duration(seconds: 0);
-
-  /*
-   * The value of this Duration object in microseconds.
-   */
-  final int _duration;
-
-  /**
-   * Creates a new Duration object whose value
-   * is the sum of all individual parts.
-   *
-   * Individual parts can be larger than the next-bigger unit.
-   * For example, [hours] can be greater than 23.
-   *
-   * All individual parts are allowed to be negative.
-   * All arguments are 0 by default.
-   */
-  const Duration(
-      {int days = 0,
-      int hours = 0,
-      int minutes = 0,
-      int seconds = 0,
-      int milliseconds = 0,
-      int microseconds = 0})
-      : this._microseconds(microsecondsPerDay * days +
-            microsecondsPerHour * hours +
-            microsecondsPerMinute * minutes +
-            microsecondsPerSecond * seconds +
-            microsecondsPerMillisecond * milliseconds +
-            microseconds);
-
-  // Fast path internal direct constructor to avoids the optional arguments and
-  // [_microseconds] recomputation.
-  const Duration._microseconds(this._duration);
-
-  /**
-   * Adds this Duration and [other] and
-   * returns the sum as a new Duration object.
-   */
-  Duration operator +(Duration other) {
-    return Duration._microseconds(_duration + other._duration);
-  }
-
-  /**
-   * Subtracts [other] from this Duration and
-   * returns the difference as a new Duration object.
-   */
-  Duration operator -(Duration other) {
-    return Duration._microseconds(_duration - other._duration);
-  }
-
-  /**
-   * Multiplies this Duration by the given [factor] and returns the result
-   * as a new Duration object.
-   *
-   * Note that when [factor] is a double, and the duration is greater than
-   * 53 bits, precision is lost because of double-precision arithmetic.
-   */
-  Duration operator *(num factor) {
-    return Duration._microseconds((_duration * factor).round());
-  }
-
-  /**
-   * Divides this Duration by the given [quotient] and returns the truncated
-   * result as a new Duration object.
-   *
-   * Throws an [IntegerDivisionByZeroException] if [quotient] is `0`.
-   */
-  Duration operator ~/(int quotient) {
-    // By doing the check here instead of relying on "~/" below we get the
-    // exception even with dart2js.
-    if (quotient == 0) throw IntegerDivisionByZeroException();
-    return Duration._microseconds(_duration ~/ quotient);
-  }
-
-  /**
-   * Returns `true` if the value of this Duration
-   * is less than the value of [other].
-   */
-  bool operator <(Duration other) => this._duration < other._duration;
-
-  /**
-   * Returns `true` if the value of this Duration
-   * is greater than the value of [other].
-   */
-  bool operator >(Duration other) => this._duration > other._duration;
-
-  /**
-   * Returns `true` if the value of this Duration
-   * is less than or equal to the value of [other].
-   */
-  bool operator <=(Duration other) => this._duration <= other._duration;
-
-  /**
-   * Returns `true` if the value of this Duration
-   * is greater than or equal to the value of [other].
-   */
-  bool operator >=(Duration other) => this._duration >= other._duration;
-
-  /**
-   * Returns the number of whole days spanned by this Duration.
-   */
-  int get inDays => _duration ~/ Duration.microsecondsPerDay;
-
-  /**
-   * Returns the number of whole hours spanned by this Duration.
-   *
-   * The returned value can be greater than 23.
-   */
-  int get inHours => _duration ~/ Duration.microsecondsPerHour;
-
-  /**
-   * Returns the number of whole minutes spanned by this Duration.
-   *
-   * The returned value can be greater than 59.
-   */
-  int get inMinutes => _duration ~/ Duration.microsecondsPerMinute;
-
-  /**
-   * Returns the number of whole seconds spanned by this Duration.
-   *
-   * The returned value can be greater than 59.
-   */
-  int get inSeconds => _duration ~/ Duration.microsecondsPerSecond;
-
-  /**
-   * Returns number of whole milliseconds spanned by this Duration.
-   *
-   * The returned value can be greater than 999.
-   */
-  int get inMilliseconds => _duration ~/ Duration.microsecondsPerMillisecond;
-
-  /**
-   * Returns number of whole microseconds spanned by this Duration.
-   */
-  int get inMicroseconds => _duration;
-
-  /**
-   * Returns `true` if this [Duration] has the same value as [other].
-   */
-  bool operator ==(Object other) =>
-      other is Duration && _duration == other.inMicroseconds;
-
-  int get hashCode => _duration.hashCode;
-
-  /**
-   * Compares this [Duration] to [other], returning zero if the values are equal.
-   *
-   * Returns a negative integer if this `Duration` is shorter than
-   * [other], or a positive integer if it is longer.
-   *
-   * A negative `Duration` is always considered shorter than a positive one.
-   *
-   * It is always the case that `duration1.compareTo(duration2) < 0` iff
-   * `(someDate + duration1).compareTo(someDate + duration2) < 0`.
-   */
-  int compareTo(Duration other) => _duration.compareTo(other._duration);
-
-  /**
-   * Returns a string representation of this `Duration`.
-   *
-   * Returns a string with hours, minutes, seconds, and microseconds, in the
-   * following format: `HH:MM:SS.mmmmmm`. For example,
-   *
-   *     var d = new Duration(days:1, hours:1, minutes:33, microseconds: 500);
-   *     d.toString();  // "25:33:00.000500"
-   */
-  String toString() {
-    String sixDigits(int n) {
-      if (n >= 100000) return "$n";
-      if (n >= 10000) return "0$n";
-      if (n >= 1000) return "00$n";
-      if (n >= 100) return "000$n";
-      if (n >= 10) return "0000$n";
-      return "00000$n";
-    }
-
-    String twoDigits(int n) {
-      if (n >= 10) return "$n";
-      return "0$n";
-    }
-
-    if (inMicroseconds < 0) {
-      return "-${-this}";
-    }
-    String twoDigitMinutes =
-        twoDigits(inMinutes.remainder(minutesPerHour) as int);
-    String twoDigitSeconds =
-        twoDigits(inSeconds.remainder(secondsPerMinute) as int);
-    String sixDigitUs =
-        sixDigits(inMicroseconds.remainder(microsecondsPerSecond) as int);
-    return "$inHours:$twoDigitMinutes:$twoDigitSeconds.$sixDigitUs";
-  }
-
-  /**
-   * Returns whether this `Duration` is negative.
-   *
-   * A negative `Duration` represents the difference from a later time to an
-   * earlier time.
-   */
-  bool get isNegative => _duration < 0;
-
-  /**
-   * Returns a new `Duration` representing the absolute value of this
-   * `Duration`.
-   *
-   * The returned `Duration` has the same length as this one, but is always
-   * positive.
-   */
-  Duration abs() => Duration._microseconds(_duration.abs());
-
-  /**
-   * Returns a new `Duration` representing this `Duration` negated.
-   *
-   * The returned `Duration` has the same length as this one, but will have the
-   * opposite sign of this one.
-   */
-  // Using subtraction helps dart2js avoid negative zeros.
-  Duration operator -() => Duration._microseconds(0 - _duration);
-}
diff --git a/sdk_nnbd/lib/core/errors.dart b/sdk_nnbd/lib/core/errors.dart
deleted file mode 100644
index a84c6ee..0000000
--- a/sdk_nnbd/lib/core/errors.dart
+++ /dev/null
@@ -1,643 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * Error objects thrown in the case of a program failure.
- *
- * An `Error` object represents a program failure that the programmer
- * should have avoided.
- *
- * Examples include calling a function with invalid arguments,
- * or even with the wrong number of arguments,
- * or calling it at a time when it is not allowed.
- *
- * These are not errors that a caller should expect or catch -
- * if they occur, the program is erroneous,
- * and terminating the program may be the safest response.
- *
- * When deciding that a function throws an error,
- * the conditions where it happens should be clearly described,
- * and they should be detectable and predictable,
- * so the programmer using the function can avoid triggering the error.
- *
- * Such descriptions often uses words like
- * "must" or "must not" to describe the condition,
- * and if you see words like that in a function's documentation,
- * then not satisfying the requirement
- * is very likely to cause an error to be thrown.
- *
- * Example (from [String.contains]):
- *
- *        `startIndex` must not be negative or greater than `length`.
- *
- * In this case, an error will be thrown if `startIndex` is negative
- * or too large.
- *
- * If the conditions are not detectable before calling a function,
- * the called function should not throw an `Error`.
- * It may still throw a value,
- * but the caller will have to catch the thrown value,
- * effectively making it an alternative result rather than an error.
- * The thrown object can choose to implement [Exception]
- * to document that it represents an exceptional, but not erroneous, occurrence,
- * but it has no other effect than documentation.
- *
- * All non-`null` values can be thrown in Dart.
- * Objects extending `Error` are handled specially:
- * The first time they are thrown,
- * the stack trace at the throw point is recorded
- * and stored in the error object.
- * It can be retrieved using the [stackTrace] getter.
- * An error object that merely implements `Error`, and doesn't extend it,
- * will not store the stack trace automatically.
- *
- * Error objects are also used for system wide failures
- * like stack overflow or an out-of-memory situation.
- *
- * Since errors are not created to be caught,
- * there is no need for subclasses to distinguish the errors.
- * Instead subclasses have been created in order to make groups
- * of related errors easy to create with consistent error messages.
- * For example, the [String.contains] method will use a [RangeError]
- * if its `startIndex` isn't in the range `0..length`,
- * which is easily created by `new RangeError.range(startIndex, 0, length)`.
- */
-class Error {
-  Error(); // Prevent use as mixin.
-
-  /**
-   * Safely convert a value to a [String] description.
-   *
-   * The conversion is guaranteed to not throw, so it won't use the object's
-   * toString method.
-   */
-  static String safeToString(Object? object) {
-    if (object is num || object is bool || null == object) {
-      return object.toString();
-    }
-    if (object is String) {
-      return _stringToSafeString(object);
-    }
-    return _objectToString(object);
-  }
-
-  /** Convert string to a valid string literal with no control characters. */
-  external static String _stringToSafeString(String string);
-
-  external static String _objectToString(Object object);
-
-  external StackTrace? get stackTrace;
-}
-
-/**
- * Error thrown by the runtime system when an assert statement fails.
- */
-class AssertionError extends Error {
-  /** Message describing the assertion error. */
-  final Object? message;
-
-  AssertionError([this.message]);
-
-  String toString() {
-    if (message != null) {
-      return "Assertion failed: ${Error.safeToString(message)}";
-    }
-    return "Assertion failed";
-  }
-}
-
-/**
- * Error thrown by the runtime system when a dynamic type error happens.
- */
-class TypeError extends Error {}
-
-/**
- * Error thrown by the runtime system when a cast operation fails.
- */
-@Deprecated("Use TypeError instead")
-class CastError extends Error {}
-
-/**
- * Error thrown when attempting to throw `null`.
- */
-class NullThrownError extends Error {
-  @pragma("vm:entry-point")
-  NullThrownError();
-  String toString() => "Throw of null.";
-}
-
-/**
- * Error thrown when a function is passed an unacceptable argument.
- */
-class ArgumentError extends Error {
-  /** Whether value was provided. */
-  final bool _hasValue;
-  /** The invalid value. */
-  final dynamic invalidValue;
-  /** Name of the invalid argument, if available. */
-  final String? name;
-  /** Message describing the problem. */
-  final dynamic message;
-
-  /**
-   * The [message] describes the erroneous argument.
-   *
-   * Existing code may be using `message` to hold the invalid value.
-   * If the `message` is not a [String], it is assumed to be a value instead
-   * of a message.
-   */
-  @pragma("vm:entry-point")
-  ArgumentError([this.message])
-      : invalidValue = null,
-        _hasValue = false,
-        name = null;
-
-  /**
-   * Creates error containing the invalid [value].
-   *
-   * A message is built by suffixing the [message] argument with
-   * the [name] argument (if provided) and the value. Example
-   *
-   *    "Invalid argument (foo): null"
-   *
-   * The `name` should match the argument name of the function, but if
-   * the function is a method implementing an interface, and its argument
-   * names differ from the interface, it might be more useful to use the
-   * interface method's argument name (or just rename arguments to match).
-   */
-  @pragma("vm:entry-point")
-  ArgumentError.value(value, [this.name, this.message])
-      : invalidValue = value,
-        _hasValue = true;
-
-  /**
-   * Create an argument error for a `null` argument that must not be `null`.
-   */
-  ArgumentError.notNull([this.name])
-      : _hasValue = false,
-        message = "Must not be null",
-        invalidValue = null;
-
-  /**
-   * Throws if [argument] is `null`.
-   *
-   * If [name] is supplied, it is used as the parameter name
-   * in the error message.
-   *
-   * Returns the [argument] if it is not null.
-   */
-  @Since("2.1")
-  static T checkNotNull<@Since("2.8") T>(T? argument, [String? name]) {
-    if (argument == null) throw ArgumentError.notNull(name);
-    return argument;
-  }
-
-  // Helper functions for toString overridden in subclasses.
-  String get _errorName => "Invalid argument${!_hasValue ? "(s)" : ""}";
-  String get _errorExplanation => "";
-
-  String toString() {
-    String? name = this.name;
-    String nameString = (name == null) ? "" : " ($name)";
-    Object? message = this.message;
-    var messageString = (message == null) ? "" : ": ${message}";
-    String prefix = "$_errorName$nameString$messageString";
-    if (!_hasValue) return prefix;
-    // If we know the invalid value, we can try to describe the problem.
-    String explanation = _errorExplanation;
-    String errorValue = Error.safeToString(invalidValue);
-    return "$prefix$explanation: $errorValue";
-  }
-}
-
-/**
- * Error thrown due to an index being outside a valid range.
- */
-class RangeError extends ArgumentError {
-  /** The minimum value that [value] is allowed to assume. */
-  final num? start;
-  /** The maximum value that [value] is allowed to assume. */
-  final num? end;
-
-  // TODO(lrn): This constructor should be called only with string values.
-  // It currently isn't in all cases.
-  /**
-   * Create a new [RangeError] with the given [message].
-   */
-  @pragma("vm:entry-point")
-  RangeError(var message)
-      : start = null,
-        end = null,
-        super(message);
-
-  /**
-   * Create a new [RangeError] with a message for the given [value].
-   *
-   * An optional [name] can specify the argument name that has the
-   * invalid value, and the [message] can override the default error
-   * description.
-   */
-  RangeError.value(num value, [String? name, String? message])
-      : start = null,
-        end = null,
-        super.value(value, name, message ?? "Value not in range");
-
-  /**
-   * Create a new [RangeError] for a value being outside the valid range.
-   *
-   * The allowed range is from [minValue] to [maxValue], inclusive.
-   * If `minValue` or `maxValue` are `null`, the range is infinite in
-   * that direction.
-   *
-   * For a range from 0 to the length of something, end exclusive, use
-   * [RangeError.index].
-   *
-   * An optional [name] can specify the argument name that has the
-   * invalid value, and the [message] can override the default error
-   * description.
-   */
-  @pragma("vm:entry-point")
-  RangeError.range(num invalidValue, int? minValue, int? maxValue,
-      [String? name, String? message])
-      : start = minValue,
-        end = maxValue,
-        super.value(invalidValue, name, message ?? "Invalid value");
-
-  /**
-   * Creates a new [RangeError] stating that [index] is not a valid index
-   * into [indexable].
-   *
-   * An optional [name] can specify the argument name that has the
-   * invalid value, and the [message] can override the default error
-   * description.
-   *
-   * The [length] is the length of [indexable] at the time of the error.
-   * If `length` is omitted, it defaults to `indexable.length`.
-   */
-  factory RangeError.index(int index, dynamic indexable,
-      [String? name, String? message, int? length]) = IndexError;
-
-  /**
-   * Check that an integer [value] lies in a specific interval.
-   *
-   * Throws if [value] is not in the interval.
-   * The interval is from [minValue] to [maxValue], both inclusive.
-   *
-   * If [name] or [message] are provided, they are used as the parameter
-   * name and message text of the thrown error.
-   *
-   * Returns [value] if it is in the interval.
-   */
-  static int checkValueInInterval(int value, int minValue, int maxValue,
-      [String? name, String? message]) {
-    if (value < minValue || value > maxValue) {
-      throw RangeError.range(value, minValue, maxValue, name, message);
-    }
-    return value;
-  }
-
-  /**
-   * Check that [index] is a valid index into an indexable object.
-   *
-   * Throws if [index] is not a valid index into [indexable].
-   *
-   * An indexable object is one that has a `length` and a and index-operator
-   * `[]` that accepts an index if `0 <= index < length`.
-   *
-   * If [name] or [message] are provided, they are used as the parameter
-   * name and message text of the thrown error. If [name] is omitted, it
-   * defaults to `"index"`.
-   *
-   * If [length] is provided, it is used as the length of the indexable object,
-   * otherwise the length is found as `indexable.length`.
-   *
-   * Returns [index] if it is a valid index.
-   */
-  static int checkValidIndex(int index, dynamic indexable,
-      [String? name, int? length, String? message]) {
-    length ??= (indexable.length as int);
-    // Comparing with `0` as receiver produces better dart2js type inference.
-    if (0 > index || index >= length) {
-      name ??= "index";
-      throw RangeError.index(index, indexable, name, message, length);
-    }
-    return index;
-  }
-
-  /**
-   * Check that a range represents a slice of an indexable object.
-   *
-   * Throws if the range is not valid for an indexable object with
-   * the given [length].
-   * A range is valid for an indexable object with a given [length]
-   *
-   * if `0 <= [start] <= [end] <= [length]`.
-   * An `end` of `null` is considered equivalent to `length`.
-   *
-   * The [startName] and [endName] defaults to `"start"` and `"end"`,
-   * respectively.
-   *
-   * Returns the actual `end` value, which is `length` if `end` is `null`,
-   * and `end` otherwise.
-   */
-  static int checkValidRange(int start, int? end, int length,
-      [String? startName, String? endName, String? message]) {
-    // Comparing with `0` as receiver produces better dart2js type inference.
-    // Ditto `start > end` below.
-    if (0 > start || start > length) {
-      startName ??= "start";
-      throw RangeError.range(start, 0, length, startName, message);
-    }
-    if (end != null) {
-      if (start > end || end > length) {
-        endName ??= "end";
-        throw RangeError.range(end, start, length, endName, message);
-      }
-      return end;
-    }
-    return length;
-  }
-
-  /**
-   * Check that an integer value is non-negative.
-   *
-   * Throws if the value is negative.
-   *
-   * If [name] or [message] are provided, they are used as the parameter
-   * name and message text of the thrown error. If [name] is omitted, it
-   * defaults to `index`.
-   *
-   * Returns [value] if it is not negative.
-   */
-  static int checkNotNegative(int value, [String? name, String? message]) {
-    if (value < 0) throw RangeError.range(value, 0, null, name, message);
-    return value;
-  }
-
-  String get _errorName => "RangeError";
-  String get _errorExplanation {
-    assert(_hasValue);
-    String explanation = "";
-    num? start = this.start;
-    num? end = this.end;
-    if (start == null) {
-      if (end != null) {
-        explanation = ": Not less than or equal to $end";
-      }
-      // If both are null, we don't add a description of the limits.
-    } else if (end == null) {
-      explanation = ": Not greater than or equal to $start";
-    } else if (end > start) {
-      explanation = ": Not in inclusive range $start..$end";
-    } else if (end < start) {
-      explanation = ": Valid value range is empty";
-    } else {
-      // end == start.
-      explanation = ": Only valid value is $start";
-    }
-    return explanation;
-  }
-}
-
-/**
- * A specialized [RangeError] used when an index is not in the range
- * `0..indexable.length-1`.
- *
- * Also contains the indexable object, its length at the time of the error,
- * and the invalid index itself.
- */
-class IndexError extends ArgumentError implements RangeError {
-  /** The indexable object that [invalidValue] was not a valid index into. */
-  final indexable;
-  /** The length of [indexable] at the time of the error. */
-  final int length;
-
-  /**
-   * Creates a new [IndexError] stating that [invalidValue] is not a valid index
-   * into [indexable].
-   *
-   * The [length] is the length of [indexable] at the time of the error.
-   * If `length` is omitted, it defaults to `indexable.length`.
-   *
-   * The message is used as part of the string representation of the error.
-   */
-  IndexError(int invalidValue, dynamic indexable,
-      [String? name, String? message, int? length])
-      : this.indexable = indexable,
-        this.length = length ?? indexable.length,
-        super.value(invalidValue, name, message ?? "Index out of range");
-
-  // Getters inherited from RangeError.
-  int get start => 0;
-  int get end => length - 1;
-
-  String get _errorName => "RangeError";
-  String get _errorExplanation {
-    assert(_hasValue);
-    int invalidValue = this.invalidValue;
-    if (invalidValue < 0) {
-      return ": index must not be negative";
-    }
-    if (length == 0) {
-      return ": no indices are valid";
-    }
-    return ": index should be less than $length";
-  }
-}
-
-/**
- * Error thrown when control reaches the end of a switch case.
- *
- * The Dart specification requires this error to be thrown when
- * control reaches the end of a switch case (except the last case
- * of a switch) without meeting a break or similar end of the control
- * flow.
- */
-class FallThroughError extends Error {
-  FallThroughError();
-  @pragma("vm:entry-point")
-  external FallThroughError._create(String url, int line);
-
-  external String toString();
-}
-
-/**
- * Error thrown when trying to instantiate an abstract class.
- */
-class AbstractClassInstantiationError extends Error {
-  final String _className;
-  AbstractClassInstantiationError(String className) : _className = className;
-
-  external String toString();
-}
-
-/**
- * Error thrown by the default implementation of [:noSuchMethod:] on [Object].
- */
-class NoSuchMethodError extends Error {
-  /**
-   * Create a [NoSuchMethodError] corresponding to a failed method call.
-   *
-   * The [receiver] is the receiver of the method call.
-   * That is, the object on which the method was attempted called.
-   *
-   * The [invocation] represents the method call that failed. It
-   * should not be `null`.
-   */
-  external NoSuchMethodError.withInvocation(
-      Object? receiver, Invocation invocation);
-
-  // Deprecated constructor to be removed after dart2js updates to the above.
-  /**
-   * Create a [NoSuchMethodError] corresponding to a failed method call.
-   *
-   * The [receiver] is the receiver of the method call.
-   * That is, the object on which the method was attempted called.
-   * If the receiver is `null`, it is interpreted as a call to a top-level
-   * function of a library.
-   *
-   * The [memberName] is a [Symbol] representing the name of the called method
-   * or accessor. It should not be `null`.
-   *
-   * The [positionalArguments] is a list of the positional arguments that the
-   * method was called with. If `null`, it is considered equivalent to the
-   * empty list.
-   *
-   * The [namedArguments] is a map from [Symbol]s to the values of named
-   * arguments that the method was called with. If null, it is considered
-   * equivalent to the empty map.
-   *
-   * This constructor does not handle type arguments.
-   * To include type variables, create an [Invocation] and use
-   * [NoSuchMethodError.withInvocation].
-   */
-  @Deprecated("Use NoSuchMethod.withInvocation instead")
-  external NoSuchMethodError(Object? receiver, Symbol memberName,
-      List? positionalArguments, Map<Symbol, dynamic>? namedArguments);
-
-  external String toString();
-}
-
-/**
- * The operation was not allowed by the object.
- *
- * This [Error] is thrown when an instance cannot implement one of the methods
- * in its signature.
- */
-@pragma("vm:entry-point")
-class UnsupportedError extends Error {
-  final String? message;
-  @pragma("vm:entry-point")
-  UnsupportedError(String this.message);
-  String toString() => "Unsupported operation: $message";
-}
-
-/**
- * Thrown by operations that have not been implemented yet.
- *
- * This [Error] is thrown by unfinished code that hasn't yet implemented
- * all the features it needs.
- *
- * If a class is not intending to implement the feature, it should throw
- * an [UnsupportedError] instead. This error is only intended for
- * use during development.
- */
-class UnimplementedError extends Error implements UnsupportedError {
-  final String? message;
-  UnimplementedError([this.message]);
-  String toString() {
-    var message = this.message;
-    return (message != null)
-        ? "UnimplementedError: $message"
-        : "UnimplementedError";
-  }
-}
-
-/**
- * The operation was not allowed by the current state of the object.
- *
- * This is a generic error used for a variety of different erroneous
- * actions. The message should be descriptive.
- */
-class StateError extends Error {
-  final String message;
-  StateError(this.message);
-  String toString() => "Bad state: $message";
-}
-
-/**
- * Error occurring when a collection is modified during iteration.
- *
- * Some modifications may be allowed for some collections, so each collection
- * ([Iterable] or similar collection of values) should declare which operations
- * are allowed during an iteration.
- */
-class ConcurrentModificationError extends Error {
-  /** The object that was modified in an incompatible way. */
-  final Object? modifiedObject;
-
-  ConcurrentModificationError([this.modifiedObject]);
-
-  String toString() {
-    if (modifiedObject == null) {
-      return "Concurrent modification during iteration.";
-    }
-    return "Concurrent modification during iteration: "
-        "${Error.safeToString(modifiedObject)}.";
-  }
-}
-
-class OutOfMemoryError implements Error {
-  @pragma("vm:entry-point")
-  const OutOfMemoryError();
-  String toString() => "Out of Memory";
-
-  StackTrace? get stackTrace => null;
-}
-
-class StackOverflowError implements Error {
-  @pragma("vm:entry-point")
-  const StackOverflowError();
-  String toString() => "Stack Overflow";
-
-  StackTrace? get stackTrace => null;
-}
-
-/**
- * Error thrown when a lazily initialized variable cannot be initialized.
- *
- * A static/library variable with an initializer expression is initialized
- * the first time it is read. If evaluating the initializer expression causes
- * another read of the variable, this error is thrown.
- */
-class CyclicInitializationError extends Error {
-  final String? variableName;
-  @pragma("vm:entry-point")
-  CyclicInitializationError([this.variableName]);
-  String toString() {
-    var variableName = this.variableName;
-    return variableName == null
-        ? "Reading static variable during its initialization"
-        : "Reading static variable '$variableName' during its initialization";
-  }
-}
-
-/**
- * Error thrown when a late variable is accessed in an invalid manner.
- *
- * A late variable must be initialized before it's read.
- * If a late variable has no initializer expression and has not
- * been written to, then reading it will throw a
- * late initialization error.
- *
- * A late final variable with no initializer expression may only
- * be written to once.
- * If it is written to again, the writing will throw a
- * late initialization error.
- */
-abstract class LateInitializationError extends Error {
-  factory LateInitializationError._() => throw UnsupportedError("");
-}
diff --git a/sdk_nnbd/lib/core/exceptions.dart b/sdk_nnbd/lib/core/exceptions.dart
deleted file mode 100644
index 7d76a66..0000000
--- a/sdk_nnbd/lib/core/exceptions.dart
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-// Exceptions are thrown either by the VM or from Dart code.
-
-/**
- * A marker interface implemented by all core library exceptions.
- *
- * An [Exception] is intended to convey information to the user about a failure,
- * so that the error can be addressed programmatically. It is intended to be
- * caught, and it should contain useful data fields.
- *
- * Creating instances of [Exception] directly with `Exception("message")`
- * is discouraged in library code since it doesn't give users a precise
- * type they can catch. It may be reasonable to use instances of this
- * class in tests or during development.
- */
-abstract class Exception {
-  factory Exception([var message]) => _Exception(message);
-}
-
-/** Default implementation of [Exception] which carries a message. */
-class _Exception implements Exception {
-  final dynamic message;
-
-  _Exception([this.message]);
-
-  String toString() {
-    Object? message = this.message;
-    if (message == null) return "Exception";
-    return "Exception: $message";
-  }
-}
-
-/**
- * Exception thrown when a string or some other data does not have an expected
- * format and cannot be parsed or processed.
- */
-class FormatException implements Exception {
-  /**
-   * A message describing the format error.
-   */
-  final String message;
-
-  /**
-   * The actual source input which caused the error.
-   *
-   * This is usually a [String], but can be other types too.
-   * If it is a string, parts of it may be included in the [toString] message.
-   *
-   * The source is `null` if omitted or unknown.
-   */
-  final dynamic source;
-
-  /**
-   * The offset in [source] where the error was detected.
-   *
-   * A zero-based offset into the source that marks the format error causing
-   * this exception to be created. If `source` is a string, this should be a
-   * string index in the range `0 <= offset <= source.length`.
-   *
-   * If input is a string, the [toString] method may represent this offset as
-   * a line and character position. The offset should be inside the string,
-   * or at the end of the string.
-   *
-   * May be omitted. If present, [source] should also be present if possible.
-   */
-  final int? offset;
-
-  /**
-   * Creates a new FormatException with an optional error [message].
-   *
-   * Optionally also supply the actual [source] with the incorrect format,
-   * and the [offset] in the format where a problem was detected.
-   */
-  @pragma("vm:entry-point")
-  const FormatException([this.message = "", this.source, this.offset]);
-
-  /**
-   * Returns a description of the format exception.
-   *
-   * The description always contains the [message].
-   *
-   * If [source] is present and is a string, the description will contain
-   * (at least a part of) the source.
-   * If [offset] is also provided, the part of the source included will
-   * contain that offset, and the offset will be marked.
-   *
-   * If the source is a string and it contains a line break before offset,
-   * only the line containing offset will be included, and its line number
-   * will also be part of the description. Line and character offsets are
-   * 1-based.
-   */
-  String toString() {
-    String report = "FormatException";
-    Object? message = this.message;
-    if (message != null && "" != message) {
-      report = "$report: $message";
-    }
-    int? offset = this.offset;
-    Object? source = this.source;
-    if (source is String) {
-      if (offset != null && (offset < 0 || offset > source.length)) {
-        offset = null;
-      }
-      // Source is string and offset is null or valid.
-      if (offset == null) {
-        if (source.length > 78) {
-          source = source.substring(0, 75) + "...";
-        }
-        return "$report\n$source";
-      }
-      int lineNum = 1;
-      int lineStart = 0;
-      bool previousCharWasCR = false;
-      for (int i = 0; i < offset; i++) {
-        int char = source.codeUnitAt(i);
-        if (char == 0x0a) {
-          if (lineStart != i || !previousCharWasCR) {
-            lineNum++;
-          }
-          lineStart = i + 1;
-          previousCharWasCR = false;
-        } else if (char == 0x0d) {
-          lineNum++;
-          lineStart = i + 1;
-          previousCharWasCR = true;
-        }
-      }
-      if (lineNum > 1) {
-        report += " (at line $lineNum, character ${offset - lineStart + 1})\n";
-      } else {
-        report += " (at character ${offset + 1})\n";
-      }
-      int lineEnd = source.length;
-      for (int i = offset; i < source.length; i++) {
-        int char = source.codeUnitAt(i);
-        if (char == 0x0a || char == 0x0d) {
-          lineEnd = i;
-          break;
-        }
-      }
-      int length = lineEnd - lineStart;
-      int start = lineStart;
-      int end = lineEnd;
-      String prefix = "";
-      String postfix = "";
-      if (length > 78) {
-        // Can't show entire line. Try to anchor at the nearest end, if
-        // one is within reach.
-        int index = offset - lineStart;
-        if (index < 75) {
-          end = start + 75;
-          postfix = "...";
-        } else if (end - offset < 75) {
-          start = end - 75;
-          prefix = "...";
-        } else {
-          // Neither end is near, just pick an area around the offset.
-          start = offset - 36;
-          end = offset + 36;
-          prefix = postfix = "...";
-        }
-      }
-      String slice = source.substring(start, end);
-      int markOffset = offset - start + prefix.length;
-      return "$report$prefix$slice$postfix\n${" " * markOffset}^\n";
-    } else {
-      // The source is not a string.
-      if (offset != null) {
-        report += " (at offset $offset)";
-      }
-      return report;
-    }
-  }
-}
-
-// Exception thrown when doing integer division with a zero divisor.
-class IntegerDivisionByZeroException implements Exception {
-  @pragma("vm:entry-point")
-  const IntegerDivisionByZeroException();
-  String toString() => "IntegerDivisionByZeroException";
-}
diff --git a/sdk_nnbd/lib/core/expando.dart b/sdk_nnbd/lib/core/expando.dart
deleted file mode 100644
index ac36b9b..0000000
--- a/sdk_nnbd/lib/core/expando.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * An [Expando] allows adding new properties to objects.
- *
- * Does not work on numbers, strings, booleans or `null`.
- *
- * An `Expando` does not hold on to the added property value after an object
- * becomes inaccessible.
- *
- * Since you can always create a new number that is identical to an existing
- * number, it means that an expando property on a number could never be
- * released. To avoid this, expando properties cannot be added to numbers.
- * The same argument applies to strings, booleans and `null`, which also have
- * literals that evaluate to identical values when they occur more than once.
- *
- * There is no restriction on other classes, even for compile time constant
- * objects. Be careful if adding expando properties to compile time constants,
- * since they will stay alive forever.
- */
-class Expando<T extends Object> {
-  /**
-   * The name of the this [Expando] as passed to the constructor. If
-   * no name was passed to the constructor, the name is `null`.
-   */
-  final String? name;
-
-  /**
-   * Creates a new [Expando]. The optional name is only used for
-   * debugging purposes and creating two different [Expando]s with the
-   * same name yields two [Expando]s that work on different properties
-   * of the objects they are used on.
-   */
-  external Expando([String? name]);
-
-  /**
-   * Expando toString method override.
-   */
-  String toString() => "Expando:${name.toString()}";
-
-  /**
-   * Gets the value of this [Expando]'s property on the given
-   * object. If the object hasn't been expanded, the method returns
-   * `null`.
-   *
-   * The object must not be a number, a string, a boolean or null.
-   */
-  external T? operator [](Object object);
-
-  /**
-   * Sets the value of this [Expando]'s property on the given
-   * object. Properties can effectively be removed again by setting
-   * their value to null.
-   *
-   * The object must not be a number, a string, a boolean or null.
-   */
-  external void operator []=(Object object, T? value);
-}
diff --git a/sdk_nnbd/lib/core/function.dart b/sdk_nnbd/lib/core/function.dart
deleted file mode 100644
index b21f6759..0000000
--- a/sdk_nnbd/lib/core/function.dart
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * The base class for all function types.
- *
- * A function value, or an instance of a class with a "call" method, is a
- * subtype of a function type, and as such, a subtype of [Function].
- */
-abstract class Function {
-  /**
-   * Dynamically call [function] with the specified arguments.
-   *
-   * Acts the same as calling function with positional arguments
-   * corresponding to the elements of [positionalArguments] and
-   * named arguments corresponding to the elements of [namedArguments].
-   *
-   * This includes giving the same errors if [function] isn't callable or
-   * if it expects different parameters.
-   *
-   * Example:
-   * ```
-   * Function.apply(foo, [1,2,3], {#f: 4, #g: 5});
-   * ```
-   *
-   * gives exactly the same result as
-   * ```
-   * foo(1, 2, 3, f: 4, g: 5).
-   * ```
-   *
-   * If [positionalArguments] is null, it's considered an empty list.
-   * If [namedArguments] is omitted or null, it is considered an empty map.
-   */
-  external static apply(Function function, List<dynamic>? positionalArguments,
-      [Map<Symbol, dynamic>? namedArguments]);
-
-  /**
-   * Returns a hash code value that is compatible with `operator==`.
-   */
-  int get hashCode;
-
-  /**
-   * Test whether another object is equal to this function.
-   *
-   * Function objects are only equal to other function objects
-   * (an object satisfying `object is Function`),
-   * and never to non-function objects.
-   *
-   * Some function objects are considered equal by `==`
-   * because they are recognized as representing the "same function":
-   *
-   * - It is the same object. Static and top-level functions are compile time
-   *   constants when used as values, so referring to the same function twice
-   *   always give the same object, as does referring to a local function
-   *   declaration twice in the same scope where it was declared.
-   * - if they refer to the same member method extracted from the same object.
-   *   Repeatedly extracting an instance method of an object as a function value
-   *   gives equal, but not necessarily identical, function values.
-   *
-   * Different evaluations of function literals
-   * never give rise to equal function objects.
-   * Each time a function literal is evaluated,
-   * it creates a new function value that is not equal to any other function
-   * value, not even ones created by the same expression.
-   */
-  bool operator ==(Object other);
-}
diff --git a/sdk_nnbd/lib/core/identical.dart b/sdk_nnbd/lib/core/identical.dart
deleted file mode 100644
index 20d331e..0000000
--- a/sdk_nnbd/lib/core/identical.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * Check whether two references are to the same object.
- */
-external bool identical(Object? a, Object? b);
-
-/**
- * Returns the identity hash code of `object`.
- *
- * Returns the same value as `object.hashCode` if [object] has not overridden
- * [Object.hashCode]. Returns the value that [Object.hashCode] would return
- * on this object, even if `hashCode` has been overridden.
- *
- * This hash code is compatible with [identical].
- */
-@pragma("vm:entry-point")
-external int identityHashCode(Object? object);
diff --git a/sdk_nnbd/lib/core/int.dart b/sdk_nnbd/lib/core/int.dart
deleted file mode 100644
index b1203ed..0000000
--- a/sdk_nnbd/lib/core/int.dart
+++ /dev/null
@@ -1,356 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * An integer number.
- *
- * The default implementation of `int` is 64-bit two's complement integers
- * with operations that wrap to that range on overflow.
- *
- * **Note:** When compiling to JavaScript, integers are restricted to values
- * that can be represented exactly by double-precision floating point values.
- * The available integer values include all integers between -2^53 and 2^53,
- * and some integers with larger magnitude. That includes some integers larger
- * than 2^63.
- * The behavior of the operators and methods in the [int]
- * class therefore sometimes differs between the Dart VM and Dart code
- * compiled to JavaScript. For example, the bitwise operators truncate their
- * operands to 32-bit integers when compiled to JavaScript.
- *
- * Classes cannot extend, implement, or mix in `int`.
- */
-abstract class int extends num {
-  /**
-   * Returns the integer value of the given environment declaration [name].
-   *
-   * The result is the same as would be returned by:
-   * ```
-   * int.tryParse(const String.fromEnvironment(name, defaultValue: ""))
-   *     ?? defaultValue
-   * ```
-   * Example:
-   * ```
-   * const int.fromEnvironment("defaultPort", defaultValue: 80)
-   * ```
-   */
-  // The .fromEnvironment() constructors are special in that we do not want
-  // users to call them using "new". We prohibit that by giving them bodies
-  // that throw, even though const constructors are not allowed to have bodies.
-  // Disable those static errors.
-  //ignore: const_constructor_with_body
-  //ignore: const_factory
-  external const factory int.fromEnvironment(String name,
-      {int defaultValue = 0});
-
-  /**
-   * Bit-wise and operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with only the bits set that are set in
-   * both `this` and [other]
-   *
-   * If both operands are negative, the result is negative, otherwise
-   * the result is non-negative.
-   */
-  int operator &(int other);
-
-  /**
-   * Bit-wise or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in either
-   * of `this` and [other]
-   *
-   * If both operands are non-negative, the result is non-negative,
-   * otherwise the result is negative.
-   */
-  int operator |(int other);
-
-  /**
-   * Bit-wise exclusive-or operator.
-   *
-   * Treating both `this` and [other] as sufficiently large two's component
-   * integers, the result is a number with the bits set that are set in one,
-   * but not both, of `this` and [other]
-   *
-   * If the operands have the same sign, the result is non-negative,
-   * otherwise the result is negative.
-   */
-  int operator ^(int other);
-
-  /**
-   * The bit-wise negate operator.
-   *
-   * Treating `this` as a sufficiently large two's component integer,
-   * the result is a number with the opposite bits set.
-   *
-   * This maps any integer `x` to `-x - 1`.
-   */
-  int operator ~();
-
-  /**
-   * Shift the bits of this integer to the left by [shiftAmount].
-   *
-   * Shifting to the left makes the number larger, effectively multiplying
-   * the number by `pow(2, shiftIndex)`.
-   *
-   * There is no limit on the size of the result. It may be relevant to
-   * limit intermediate values by using the "and" operator with a suitable
-   * mask.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  int operator <<(int shiftAmount);
-
-  /**
-   * Shift the bits of this integer to the right by [shiftAmount].
-   *
-   * Shifting to the right makes the number smaller and drops the least
-   * significant bits, effectively doing an integer division by
-   *`pow(2, shiftIndex)`.
-   *
-   * It is an error if [shiftAmount] is negative.
-   */
-  int operator >>(int shiftAmount);
-
-  /**
-   * Returns this integer to the power of [exponent] modulo [modulus].
-   *
-   * The [exponent] must be non-negative and [modulus] must be
-   * positive.
-   */
-  int modPow(int exponent, int modulus);
-
-  /**
-   * Returns the modular multiplicative inverse of this integer
-   * modulo [modulus].
-   *
-   * The [modulus] must be positive.
-   *
-   * It is an error if no modular inverse exists.
-   */
-  int modInverse(int modulus);
-
-  /**
-   * Returns the greatest common divisor of this integer and [other].
-   *
-   * If either number is non-zero, the result is the numerically greatest
-   * integer dividing both `this` and `other`.
-   *
-   * The greatest common divisor is independent of the order,
-   * so `x.gcd(y)` is  always the same as `y.gcd(x)`.
-   *
-   * For any integer `x`, `x.gcd(x)` is `x.abs()`.
-   *
-   * If both `this` and `other` is zero, the result is also zero.
-   */
-  int gcd(int other);
-
-  /** Returns true if and only if this integer is even. */
-  bool get isEven;
-
-  /** Returns true if and only if this integer is odd. */
-  bool get isOdd;
-
-  /**
-   * Returns the minimum number of bits required to store this integer.
-   *
-   * The number of bits excludes the sign bit, which gives the natural length
-   * for non-negative (unsigned) values.  Negative values are complemented to
-   * return the bit position of the first bit that differs from the sign bit.
-   *
-   * To find the number of bits needed to store the value as a signed value,
-   * add one, i.e. use `x.bitLength + 1`.
-   * ```
-   * x.bitLength == (-x-1).bitLength
-   *
-   * 3.bitLength == 2;     // 00000011
-   * 2.bitLength == 2;     // 00000010
-   * 1.bitLength == 1;     // 00000001
-   * 0.bitLength == 0;     // 00000000
-   * (-1).bitLength == 0;  // 11111111
-   * (-2).bitLength == 1;  // 11111110
-   * (-3).bitLength == 2;  // 11111101
-   * (-4).bitLength == 2;  // 11111100
-   * ```
-   */
-  int get bitLength;
-
-  /**
-   * Returns the least significant [width] bits of this integer as a
-   * non-negative number (i.e. unsigned representation).  The returned value has
-   * zeros in all bit positions higher than [width].
-   * ```
-   * (-1).toUnsigned(5) == 31   // 11111111  ->  00011111
-   * ```
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit quantity:
-   * ```
-   * q = (q + 1).toUnsigned(8);
-   * ```
-   * `q` will count from `0` up to `255` and then wrap around to `0`.
-   *
-   * If the input fits in [width] bits without truncation, the result is the
-   * same as the input.  The minimum width needed to avoid truncation of `x` is
-   * given by `x.bitLength`, i.e.
-   * ```
-   * x == x.toUnsigned(x.bitLength);
-   * ```
-   */
-  int toUnsigned(int width);
-
-  /**
-   * Returns the least significant [width] bits of this integer, extending the
-   * highest retained bit to the sign.  This is the same as truncating the value
-   * to fit in [width] bits using an signed 2-s complement representation.  The
-   * returned value has the same bit value in all positions higher than [width].
-   *
-   * ```
-   *                                V--sign bit-V
-   * 16.toSigned(5) == -16   //  00010000 -> 11110000
-   * 239.toSigned(5) == 15   //  11101111 -> 00001111
-   *                                ^           ^
-   * ```
-   * This operation can be used to simulate arithmetic from low level languages.
-   * For example, to increment an 8 bit signed quantity:
-   * ```
-   * q = (q + 1).toSigned(8);
-   * ```
-   * `q` will count from `0` up to `127`, wrap to `-128` and count back up to
-   * `127`.
-   *
-   * If the input value fits in [width] bits without truncation, the result is
-   * the same as the input.  The minimum width needed to avoid truncation of `x`
-   * is `x.bitLength + 1`, i.e.
-   * ```
-   * x == x.toSigned(x.bitLength + 1);
-   * ```
-   */
-  int toSigned(int width);
-
-  /**
-   * Return the negative value of this integer.
-   *
-   * The result of negating an integer always has the opposite sign, except
-   * for zero, which is its own negation.
-   */
-  int operator -();
-
-  /**
-   * Returns the absolute value of this integer.
-   *
-   * For any integer `x`, the result is the same as `x < 0 ? -x : x`.
-   */
-  int abs();
-
-  /**
-   * Returns the sign of this integer.
-   *
-   * Returns 0 for zero, -1 for values less than zero and
-   * +1 for values greater than zero.
-   */
-  int get sign;
-
-  /** Returns `this`. */
-  int round();
-
-  /** Returns `this`. */
-  int floor();
-
-  /** Returns `this`. */
-  int ceil();
-
-  /** Returns `this`. */
-  int truncate();
-
-  /** Returns `this.toDouble()`. */
-  double roundToDouble();
-
-  /** Returns `this.toDouble()`. */
-  double floorToDouble();
-
-  /** Returns `this.toDouble()`. */
-  double ceilToDouble();
-
-  /** Returns `this.toDouble()`. */
-  double truncateToDouble();
-
-  /**
-   * Returns a string representation of this integer.
-   *
-   * The returned string is parsable by [parse].
-   * For any `int` `i`, it is guaranteed that
-   * `i == int.parse(i.toString())`.
-   */
-  String toString();
-
-  /**
-   * Converts [this] to a string representation in the given [radix].
-   *
-   * In the string representation, lower-case letters are used for digits above
-   * '9', with 'a' being 10 an 'z' being 35.
-   *
-   * The [radix] argument must be an integer in the range 2 to 36.
-   */
-  String toRadixString(int radix);
-
-  /**
-   * Parse [source] as a, possibly signed, integer literal and return its value.
-   *
-   * The [source] must be a non-empty sequence of base-[radix] digits,
-   * optionally prefixed with a minus or plus sign ('-' or '+').
-   * It must not be `null`.
-   *
-   * The [radix] must be in the range 2..36. The digits used are
-   * first the decimal digits 0..9, and then the letters 'a'..'z' with
-   * values 10 through 35. Also accepts upper-case letters with the same
-   * values as the lower-case ones.
-   *
-   * If no [radix] is given then it defaults to 10. In this case, the [source]
-   * digits may also start with `0x`, in which case the number is interpreted
-   * as a hexadecimal integer literal,
-   * When `int` is implemented by 64-bit signed integers,
-   * hexadecimal integer literals may represent values larger than
-   * 2<sup>63</sup>, in which case the value is parsed as if it is an
-   * *unsigned* number, and the resulting value is the corresponding
-   * signed integer value.
-   *
-   * For any int `n` and valid radix `r`, it is guaranteed that
-   * `n == int.parse(n.toRadixString(r), radix: r)`.
-   *
-   * If the [source] string does not contain a valid integer literal,
-   * optionally prefixed by a sign, a [FormatException] is thrown
-   * (unless the deprecated [onError] parameter is used, see below).
-   *
-   * Instead of throwing and immediately catching the [FormatException],
-   * instead use [tryParse] to handle a parsing error.
-   * Example:
-   * ```dart
-   * var value = int.tryParse(text);
-   * if (value == null) ... handle the problem
-   * ```
-   *
-   * The [onError] parameter is deprecated and will be removed.
-   * Instead of `int.parse(string, onError: (string) => ...)`,
-   * you should use `int.tryParse(string) ?? (...)`.
-   *
-   * When the source string is not valid and [onError] is provided,
-   * whenever a [FormatException] would be thrown,
-   * [onError] is instead called with [source] as argument,
-   * and the result of that call is returned by [parse].
-   */
-  external static int parse(String source,
-      {int? radix, @deprecated int onError(String source)?});
-
-  /**
-   * Parse [source] as a, possibly signed, integer literal and return its value.
-   *
-   * Like [parse] except that this function returns `null` where a
-   * similar call to [parse] would throw a [FormatException],
-   * and the [source] must still not be `null`.
-   */
-  external static int? tryParse(String source, {int? radix});
-}
diff --git a/sdk_nnbd/lib/core/invocation.dart b/sdk_nnbd/lib/core/invocation.dart
deleted file mode 100644
index 7d28cea..0000000
--- a/sdk_nnbd/lib/core/invocation.dart
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * Representation of the invocation of a member on an object.
- *
- * This is the type of objects passed to [Object.noSuchMethod] when
- * an object doesn't support the member invocation that was attempted
- * on it.
- */
-abstract class Invocation {
-  Invocation();
-
-  /**
-   * Creates an invocation corresponding to a method invocation.
-   *
-   * The method invocation has no type arguments.
-   * If the named arguments are omitted, they default to no named arguments.
-   */
-  factory Invocation.method(
-          Symbol memberName, Iterable<Object?>? positionalArguments,
-          [Map<Symbol, Object?>? namedArguments]) =>
-      _Invocation.method(memberName, null, positionalArguments, namedArguments);
-
-  /**
-   * Creates an invocation corresponding to a generic method invocation.
-   *
-   * If [typeArguments] is `null` or empty, the constructor is equivalent to
-   * calling [Invocation.method] with the remaining arguments.
-   * All the individual type arguments must be non-null.
-   *
-   * If the named arguments are omitted, they default to no named arguments.
-   */
-  factory Invocation.genericMethod(Symbol memberName,
-          Iterable<Type>? typeArguments, Iterable<Object?>? positionalArguments,
-          [Map<Symbol, Object?>? namedArguments]) =>
-      _Invocation.method(
-          memberName, typeArguments, positionalArguments, namedArguments);
-
-  /**
-   * Creates an invocation corresponding to a getter invocation.
-   */
-  factory Invocation.getter(Symbol name) = _Invocation.getter;
-
-  /**
-   * Creates an invocation corresponding to a setter invocation.
-   *
-   * This constructor accepts any [Symbol] as [memberName], but remember that
-   * *actual setter names* end in `=`, so the invocation corresponding
-   * to `object.member = value` is
-   * ```dart
-   * Invocation.setter(const Symbol("member="), value)
-   * ```
-   */
-  factory Invocation.setter(Symbol memberName, Object? argument) =
-      _Invocation.setter;
-
-  /** The name of the invoked member. */
-  Symbol get memberName;
-
-  /**
-   * An unmodifiable view of the type arguments of the call.
-   *
-   * If the member is a getter, setter or operator,
-   * the type argument list is always empty.
-   */
-  List<Type> get typeArguments => const <Type>[];
-
-  /**
-   * An unmodifiable view of the positional arguments of the call.
-   *
-   * If the member is a getter, the positional arguments list is
-   * always empty.
-   */
-  List<dynamic> get positionalArguments;
-
-  /**
-   * An unmodifiable view of the named arguments of the call.
-   *
-   * If the member is a getter, setter or operator,
-   * the named arguments map is always empty.
-   */
-  Map<Symbol, dynamic> get namedArguments;
-
-  /** Whether the invocation was a method call. */
-  bool get isMethod;
-
-  /**
-   * Whether the invocation was a getter call.
-   * If so, all three types of arguments lists are empty.
-   */
-  bool get isGetter;
-
-  /**
-   * Whether the invocation was a setter call.
-   *
-   * If so, [positionalArguments] has exactly one positional
-   * argument, [namedArguments] is empty, and typeArguments is
-   * empty.
-   */
-  bool get isSetter;
-
-  /** Whether the invocation was a getter or a setter call. */
-  bool get isAccessor => isGetter || isSetter;
-}
-
-/** Implementation of [Invocation] used by its factory constructors. */
-class _Invocation implements Invocation {
-  final Symbol memberName;
-  final List<Type> typeArguments;
-  // Positional arguments is `null` for getters only.
-  final List<Object?>? _positional;
-  // Named arguments is `null` for accessors only.
-  final Map<Symbol, Object?>? _named;
-
-  _Invocation.method(this.memberName, Iterable<Type>? types,
-      Iterable<Object?>? positional, Map<Symbol, Object?>? named)
-      : typeArguments = _ensureNonNullTypes(types),
-        _positional = positional == null
-            ? const <Object?>[]
-            : List<Object?>.unmodifiable(positional),
-        _named = (named == null || named.isEmpty)
-            ? const <Symbol, Object?>{}
-            : Map<Symbol, Object?>.unmodifiable(named);
-
-  _Invocation.getter(this.memberName)
-      : typeArguments = const <Type>[],
-        _positional = null,
-        _named = null;
-
-  _Invocation.setter(this.memberName, Object? argument)
-      : typeArguments = const <Type>[],
-        _positional = List<Object?>.unmodifiable([argument]),
-        _named = null;
-
-  List<dynamic> get positionalArguments => _positional ?? const <Object>[];
-
-  Map<Symbol, dynamic> get namedArguments => _named ?? const <Symbol, Object>{};
-
-  bool get isMethod => _named != null;
-  bool get isGetter => _positional == null;
-  bool get isSetter => _positional != null && _named == null;
-  bool get isAccessor => _named == null;
-
-  /// Checks that the elements of [types] are not null.
-  static List<Type> _ensureNonNullTypes(Iterable<Type>? types) {
-    if (types == null) return const <Type>[];
-    List<Type> typeArguments = List<Type>.unmodifiable(types);
-    for (int i = 0; i < typeArguments.length; i++) {
-      if (typeArguments[i] == null) {
-        throw ArgumentError.value(types, "types",
-            "Type arguments must be non-null, was null at index $i.");
-      }
-    }
-    return typeArguments;
-  }
-}
diff --git a/sdk_nnbd/lib/core/iterable.dart b/sdk_nnbd/lib/core/iterable.dart
deleted file mode 100644
index 839792e..0000000
--- a/sdk_nnbd/lib/core/iterable.dart
+++ /dev/null
@@ -1,711 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * A collection of values, or "elements", that can be accessed sequentially.
- *
- * The elements of the iterable are accessed by getting an [Iterator]
- * using the [iterator] getter, and using it to step through the values.
- * Stepping with the iterator is done by calling [Iterator.moveNext],
- * and if the call returns `true`,
- * the iterator has now moved to the next element,
- * which is then available as [Iterator.current].
- * If the call returns `false`, there are no more elements.
- * The [Iterator.current] value must only be used when the most
- * recent call to [Iterator.moveNext] has returned `true`.
- * If it is used before calling [Iterator.moveNext] the first time
- * on an iterator, or after a call has returned false or has thrown an error,
- * reading [Iterator.current] may throw or may return an arbitrary value.
- *
- * You can create more than one iterator from the same `Iterable`.
- * Each time `iterator` is read, it returns a new iterator,
- * and different iterators can be stepped through independently,
- * each giving access to all the elements of the iterable.
- * The iterators of the same iterable *should* provide the same values
- * in the same order (unless the underlying collection is modified between
- * the iterations, which some collections allow).
- *
- * You can also iterate over the elements of an `Iterable`
- * using the for-in loop construct, which uses the `iterator` getter behind the
- * scenes.
- * For example, you can iterate over all of the keys of a [Map],
- * because `Map` keys are iterable.
- *
- *     Map kidsBooks = {'Matilda': 'Roald Dahl',
- *                      'Green Eggs and Ham': 'Dr Seuss',
- *                      'Where the Wild Things Are': 'Maurice Sendak'};
- *     for (var book in kidsBooks.keys) {
- *       print('$book was written by ${kidsBooks[book]}');
- *     }
- *
- * The [List] and [Set] classes are both `Iterable`,
- * as are most classes in the `dart:collection` library.
- *
- * Some [Iterable] collections can be modified.
- * Adding an element to a `List` or `Set` will change which elements it
- * contains, and adding a new key to a `Map` changes the elements of [Map.keys].
- * Iterators created after the change will provide the new elements, and may
- * or may not preserve the order of existing elements
- * (for example, a [HashSet] may completely change its order when a single
- * element is added).
- *
- * Changing a collection *while* it is being iterated
- * is generally *not* allowed.
- * Doing so will break the iteration, which is typically signalled
- * by throwing a [ConcurrentModificationError]
- * the next time [Iterator.moveNext] is called.
- * The current value of [Iterator.current] getter
- * should not be affected by the change in the collection,
- * the `current` value was set by the previous call to [Iterator.moveNext].
- *
- * Some iterables compute their elements dynamically every time they are
- * iterated, like the one returned by [Iterable.generate] or the iterable
- * returned by a `sync*` generator function. If the computation doesn't depend
- * on other objects that may change, then the generated sequence should be
- * the same one every time it's iterated.
- *
- * The members of `Iterable`, other than `iterator` itself,
- * work by looking at the elements of the iterable.
- * This can be implemented by running through the [iterator], but some classes
- * may have more efficient ways of finding the result
- * (like [last] or [length] on a [List], or [contains] on a [Set]).
- *
- * The methods that return another `Iterable` (like [map] and [where])
- * are all *lazy* - they will iterate the original (as necessary)
- * every time the returned iterable is iterated, and not before.
- *
- * Since an iterable may be iterated more than once, it's not recommended to
- * have detectable side-effects in the iterator.
- * For methods like [map] and [where], the returned iterable will execute the
- * argument function on every iteration, so those functions should also not
- * have side effects.
- */
-abstract class Iterable<E> {
-  // TODO(lrn): When we allow forwarding const constructors through
-  // mixin applications, make this class implement [IterableMixin].
-  const Iterable();
-
-  /**
-   * Creates an `Iterable` which generates its elements dynamically.
-   *
-   * The generated iterable has [count] elements,
-   * and the element at index `n` is computed by calling `generator(n)`.
-   * Values are not cached, so each iteration computes the values again.
-   *
-   * If [generator] is omitted, it defaults to an identity function
-   * on integers `(int x) => x`, so it may only be omitted if the type
-   * parameter allows integer values. That is, if [E] is a super-type
-   * of [int].
-   *
-   * As an `Iterable`, `new Iterable.generate(n, generator))` is equivalent to
-   * `const [0, ..., n - 1].map(generator)`.
-   */
-  factory Iterable.generate(int count, [E generator(int index)?]) {
-    if (count <= 0) return EmptyIterable<E>();
-    return _GeneratorIterable<E>(count, generator);
-  }
-
-  /**
-   * Creates an empty iterable.
-   *
-   * The empty iterable has no elements, and iterating it always stops
-   * immediately.
-   */
-  const factory Iterable.empty() = EmptyIterable<E>;
-
-  /**
-   * Adapts [source] to be an `Iterable<T>`.
-   *
-   * Any time the iterable would produce an element that is not a [T],
-   * the element access will throw. If all elements of [source] are actually
-   * instances of [T], or if only elements that are actually instances of [T]
-   * are accessed, then the resulting iterable can be used as an `Iterable<T>`.
-   */
-  static Iterable<T> castFrom<S, T>(Iterable<S> source) =>
-      CastIterable<S, T>(source);
-
-  /**
-   * Returns a new `Iterator` that allows iterating the elements of this
-   * `Iterable`.
-   *
-   * Iterable classes may specify the iteration order of their elements
-   * (for example [List] always iterate in index order),
-   * or they may leave it unspecified (for example a hash-based [Set]
-   * may iterate in any order).
-   *
-   * Each time `iterator` is read, it returns a new iterator,
-   * which can be used to iterate through all the elements again.
-   * The iterators of the same iterable can be stepped through independently,
-   * but should return the same elements in the same order,
-   * as long as the underlying collection isn't changed.
-   *
-   * Modifying the collection may cause new iterators to produce
-   * different elements, and may change the order of existing elements.
-   * A [List] specifies its iteration order precisely,
-   * so modifying the list changes the iteration order predictably.
-   * A hash-based [Set] may change its iteration order completely
-   * when adding a new element to the set.
-   *
-   * Modifying the underlying collection after creating the new iterator
-   * may cause an error the next time [Iterator.moveNext] is called
-   * on that iterator.
-   * Any *modifiable* iterable class should specify which operations will
-   * break iteration.
-   */
-  Iterator<E> get iterator;
-
-  /**
-   * Provides a view of this iterable as an iterable of [R] instances.
-   *
-   * If this iterable only contains instances of [R], all operations
-   * will work correctly. If any operation tries to access an element
-   * that is not an instance of [R], the access will throw instead.
-   *
-   * When the returned iterable creates a new object that depends on
-   * the type [R], e.g., from [toList], it will have exactly the type [R].
-   */
-  Iterable<R> cast<R>() => Iterable.castFrom<E, R>(this);
-
-  /**
-   * Returns the lazy concatentation of this iterable and [other].
-   *
-   * The returned iterable will provide the same elements as this iterable,
-   * and, after that, the elements of [other], in the same order as in the
-   * original iterables.
-   */
-  Iterable<E> followedBy(Iterable<E> other) {
-    var self = this; // TODO(lrn): Remove when we can promote `this`.
-    if (self is EfficientLengthIterable<E>) {
-      return FollowedByIterable<E>.firstEfficient(self, other);
-    }
-    return FollowedByIterable<E>(this, other);
-  }
-
-  /**
-   * Returns a new lazy [Iterable] with elements that are created by
-   * calling `f` on each element of this `Iterable` in iteration order.
-   *
-   * This method returns a view of the mapped elements. As long as the
-   * returned [Iterable] is not iterated over, the supplied function [f] will
-   * not be invoked. The transformed elements will not be cached. Iterating
-   * multiple times over the returned [Iterable] will invoke the supplied
-   * function [f] multiple times on the same element.
-   *
-   * Methods on the returned iterable are allowed to omit calling `f`
-   * on any element where the result isn't needed.
-   * For example, [elementAt] may call `f` only once.
-   */
-  Iterable<T> map<T>(T f(E e)) => MappedIterable<E, T>(this, f);
-
-  /**
-   * Returns a new lazy [Iterable] with all elements that satisfy the
-   * predicate [test].
-   *
-   * The matching elements have the same order in the returned iterable
-   * as they have in [iterator].
-   *
-   * This method returns a view of the mapped elements.
-   * As long as the returned [Iterable] is not iterated over,
-   * the supplied function [test] will not be invoked.
-   * Iterating will not cache results, and thus iterating multiple times over
-   * the returned [Iterable] may invoke the supplied
-   * function [test] multiple times on the same element.
-   */
-  Iterable<E> where(bool test(E element)) => WhereIterable<E>(this, test);
-
-  /**
-   * Returns a new lazy [Iterable] with all elements that have type [T].
-   *
-   * The matching elements have the same order in the returned iterable
-   * as they have in [iterator].
-   *
-   * This method returns a view of the mapped elements.
-   * Iterating will not cache results, and thus iterating multiple times over
-   * the returned [Iterable] may yield different results,
-   * if the underlying elements change between iterations.
-   */
-  Iterable<T> whereType<T>() => WhereTypeIterable<T>(this);
-
-  /**
-   * Expands each element of this [Iterable] into zero or more elements.
-   *
-   * The resulting Iterable runs through the elements returned
-   * by [f] for each element of this, in iteration order.
-   *
-   * The returned [Iterable] is lazy, and calls [f] for each element
-   * of this every time it's iterated.
-   *
-   * Example:
-   *
-   *     var pairs = [[1, 2], [3, 4]];
-   *     var flattened = pairs.expand((pair) => pair).toList();
-   *     print(flattened); // => [1, 2, 3, 4];
-   *
-   *     var input = [1, 2, 3];
-   *     var duplicated = input.expand((i) => [i, i]).toList();
-   *     print(duplicated); // => [1, 1, 2, 2, 3, 3]
-   *
-   */
-  Iterable<T> expand<T>(Iterable<T> f(E element)) =>
-      ExpandIterable<E, T>(this, f);
-
-  /**
-   * Returns true if the collection contains an element equal to [element].
-   *
-   * This operation will check each element in order for being equal to
-   * [element], unless it has a more efficient way to find an element
-   * equal to [element].
-   *
-   * The equality used to determine whether [element] is equal to an element of
-   * the iterable defaults to the [Object.==] of the element.
-   *
-   * Some types of iterable may have a different equality used for its elements.
-   * For example, a [Set] may have a custom equality
-   * (see [Set.identity]) that its `contains` uses.
-   * Likewise the `Iterable` returned by a [Map.keys] call
-   * should use the same equality that the `Map` uses for keys.
-   */
-  bool contains(Object? element) {
-    for (E e in this) {
-      if (e == element) return true;
-    }
-    return false;
-  }
-
-  /**
-   * Applies the function [f] to each element of this collection in iteration
-   * order.
-   */
-  void forEach(void f(E element)) {
-    for (E element in this) f(element);
-  }
-
-  /**
-   * Reduces a collection to a single value by iteratively combining elements
-   * of the collection using the provided function.
-   *
-   * The iterable must have at least one element.
-   * If it has only one element, that element is returned.
-   *
-   * Otherwise this method starts with the first element from the iterator,
-   * and then combines it with the remaining elements in iteration order,
-   * as if by:
-   *
-   *     E value = iterable.first;
-   *     iterable.skip(1).forEach((element) {
-   *       value = combine(value, element);
-   *     });
-   *     return value;
-   *
-   * Example of calculating the sum of an iterable:
-   *
-   *     iterable.reduce((value, element) => value + element);
-   *
-   */
-  E reduce(E combine(E value, E element)) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E value = iterator.current;
-    while (iterator.moveNext()) {
-      value = combine(value, iterator.current);
-    }
-    return value;
-  }
-
-  /**
-   * Reduces a collection to a single value by iteratively combining each
-   * element of the collection with an existing value
-   *
-   * Uses [initialValue] as the initial value,
-   * then iterates through the elements and updates the value with
-   * each element using the [combine] function, as if by:
-   *
-   *     var value = initialValue;
-   *     for (E element in this) {
-   *       value = combine(value, element);
-   *     }
-   *     return value;
-   *
-   * Example of calculating the sum of an iterable:
-   *
-   *     iterable.fold(0, (prev, element) => prev + element);
-   *
-   */
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    for (E element in this) value = combine(value, element);
-    return value;
-  }
-
-  /**
-   * Checks whether every element of this iterable satisfies [test].
-   *
-   * Checks every element in iteration order, and returns `false` if
-   * any of them make [test] return `false`, otherwise returns `true`.
-   */
-  bool every(bool test(E element)) {
-    for (E element in this) {
-      if (!test(element)) return false;
-    }
-    return true;
-  }
-
-  /**
-   * Converts each element to a [String] and concatenates the strings.
-   *
-   * Iterates through elements of this iterable,
-   * converts each one to a [String] by calling [Object.toString],
-   * and then concatenates the strings, with the
-   * [separator] string interleaved between the elements.
-   */
-  String join([String separator = ""]) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) return "";
-    StringBuffer buffer = StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write(iterator.current.toString());
-      } while (iterator.moveNext());
-    } else {
-      buffer.write(iterator.current.toString());
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write(iterator.current.toString());
-      }
-    }
-    return buffer.toString();
-  }
-
-  /**
-   * Checks whether any element of this iterable satisfies [test].
-   *
-   * Checks every element in iteration order, and returns `true` if
-   * any of them make [test] return `true`, otherwise returns false.
-   */
-  bool any(bool test(E element)) {
-    for (E element in this) {
-      if (test(element)) return true;
-    }
-    return false;
-  }
-
-  /**
-   * Creates a [List] containing the elements of this [Iterable].
-   *
-   * The elements are in iteration order.
-   * The list is fixed-length if [growable] is false.
-   */
-  List<E> toList({bool growable = true}) {
-    return List<E>.of(this, growable: growable);
-  }
-
-  /**
-   * Creates a [Set] containing the same elements as this iterable.
-   *
-   * The set may contain fewer elements than the iterable,
-   * if the iterable contains an element more than once,
-   * or it contains one or more elements that are equal.
-   * The order of the elements in the set is not guaranteed to be the same
-   * as for the iterable.
-   */
-  Set<E> toSet() => Set<E>.of(this);
-
-  /**
-   * Returns the number of elements in [this].
-   *
-   * Counting all elements may involve iterating through all elements and can
-   * therefore be slow.
-   * Some iterables have a more efficient way to find the number of elements.
-   */
-  int get length {
-    assert(this is! EfficientLengthIterable);
-    int count = 0;
-    Iterator it = iterator;
-    while (it.moveNext()) {
-      count++;
-    }
-    return count;
-  }
-
-  /**
-   * Returns `true` if there are no elements in this collection.
-   *
-   * May be computed by checking if `iterator.moveNext()` returns `false`.
-   */
-  bool get isEmpty => !iterator.moveNext();
-
-  /**
-   * Returns true if there is at least one element in this collection.
-   *
-   * May be computed by checking if `iterator.moveNext()` returns `true`.
-   */
-  bool get isNotEmpty => !isEmpty;
-
-  /**
-   * Returns a lazy iterable of the [count] first elements of this iterable.
-   *
-   * The returned `Iterable` may contain fewer than `count` elements, if `this`
-   * contains fewer than `count` elements.
-   *
-   * The elements can be computed by stepping through [iterator] until [count]
-   * elements have been seen.
-   *
-   * The `count` must not be negative.
-   */
-  Iterable<E> take(int count) {
-    return TakeIterable<E>(this, count);
-  }
-
-  /**
-   * Returns a lazy iterable of the leading elements satisfying [test].
-   *
-   * The filtering happens lazily. Every new iterator of the returned
-   * iterable starts iterating over the elements of `this`.
-   *
-   * The elements can be computed by stepping through [iterator] until an
-   * element is found where `test(element)` is false. At that point,
-   * the returned iterable stops (its `moveNext()` returns false).
-   */
-  Iterable<E> takeWhile(bool test(E value)) {
-    return TakeWhileIterable<E>(this, test);
-  }
-
-  /**
-   * Returns an [Iterable] that provides all but the first [count] elements.
-   *
-   * When the returned iterable is iterated, it starts iterating over `this`,
-   * first skipping past the initial [count] elements.
-   * If `this` has fewer than `count` elements, then the resulting Iterable is
-   * empty.
-   * After that, the remaining elements are iterated in the same order as
-   * in this iterable.
-   *
-   * Some iterables may be able to find later elements without first iterating
-   * through earlier elements, for example when iterating a [List].
-   * Such iterables are allowed to ignore the initial skipped elements.
-   *
-   * The [count] must not be negative.
-   */
-  Iterable<E> skip(int count) {
-    return SkipIterable<E>(this, count);
-  }
-
-  /**
-   * Returns an `Iterable` that skips leading elements while [test] is satisfied.
-   *
-   * The filtering happens lazily. Every new [Iterator] of the returned
-   * iterable iterates over all elements of `this`.
-   *
-   * The returned iterable provides elements by iterating this iterable,
-   * but skipping over all initial elements where `test(element)` returns
-   * true. If all elements satisfy `test` the resulting iterable is empty,
-   * otherwise it iterates the remaining elements in their original order,
-   * starting with the first element for which `test(element)` returns `false`.
-   */
-  Iterable<E> skipWhile(bool test(E value)) {
-    return SkipWhileIterable<E>(this, test);
-  }
-
-  /**
-   * Returns the first element.
-   *
-   * Throws a [StateError] if `this` is empty.
-   * Otherwise returns the first element in the iteration order,
-   * equivalent to `this.elementAt(0)`.
-   */
-  E get first {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    return it.current;
-  }
-
-  /**
-   * Returns the last element.
-   *
-   * Throws a [StateError] if `this` is empty.
-   * Otherwise may iterate through the elements and returns the last one
-   * seen.
-   * Some iterables may have more efficient ways to find the last element
-   * (for example a list can directly access the last element,
-   * without iterating through the previous ones).
-   */
-  E get last {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) {
-      throw IterableElementError.noElement();
-    }
-    E result;
-    do {
-      result = it.current;
-    } while (it.moveNext());
-    return result;
-  }
-
-  /**
-   * Checks that this iterable has only one element, and returns that element.
-   *
-   * Throws a [StateError] if `this` is empty or has more than one element.
-   */
-  E get single {
-    Iterator<E> it = iterator;
-    if (!it.moveNext()) throw IterableElementError.noElement();
-    E result = it.current;
-    if (it.moveNext()) throw IterableElementError.tooMany();
-    return result;
-  }
-
-  /**
-   * Returns the first element that satisfies the given predicate [test].
-   *
-   * Iterates through elements and returns the first to satisfy [test].
-   *
-   * If no element satisfies [test], the result of invoking the [orElse]
-   * function is returned.
-   * If [orElse] is omitted, it defaults to throwing a [StateError].
-   */
-  E firstWhere(bool test(E element), {E orElse()?}) {
-    for (E element in this) {
-      if (test(element)) return element;
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  /**
-   * Returns the last element that satisfies the given predicate [test].
-   *
-   * An iterable that can access its elements directly may check its
-   * elements in any order (for example a list starts by checking the
-   * last element and then moves towards the start of the list).
-   * The default implementation iterates elements in iteration order,
-   * checks `test(element)` for each,
-   * and finally returns that last one that matched.
-   *
-   * If no element satisfies [test], the result of invoking the [orElse]
-   * function is returned.
-   * If [orElse] is omitted, it defaults to throwing a [StateError].
-   */
-  E lastWhere(bool test(E element), {E orElse()?}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  /**
-   * Returns the single element that satisfies [test].
-   *
-   * Checks elements to see if `test(element)` returns true.
-   * If exactly one element satisfies [test], that element is returned.
-   * If more than one matching element is found, throws [StateError].
-   * If no matching element is found, returns the result of [orElse].
-   * If [orElse] is omitted, it defaults to throwing a [StateError].
-   */
-  E singleWhere(bool test(E element), {E orElse()?}) {
-    late E result;
-    bool foundMatching = false;
-    for (E element in this) {
-      if (test(element)) {
-        if (foundMatching) {
-          throw IterableElementError.tooMany();
-        }
-        result = element;
-        foundMatching = true;
-      }
-    }
-    if (foundMatching) return result;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  /**
-   * Returns the [index]th element.
-   *
-   * The [index] must be non-negative and less than [length].
-   * Index zero represents the first element (so `iterable.elementAt(0)` is
-   * equivalent to `iterable.first`).
-   *
-   * May iterate through the elements in iteration order, ignoring the
-   * first [index] elements and then returning the next.
-   * Some iterables may have a more efficient way to find the element.
-   */
-  E elementAt(int index) {
-    RangeError.checkNotNegative(index, "index");
-    int elementIndex = 0;
-    for (E element in this) {
-      if (index == elementIndex) return element;
-      elementIndex++;
-    }
-    throw RangeError.index(index, this, "index", null, elementIndex);
-  }
-
-  /**
-   * Returns a string representation of (some of) the elements of `this`.
-   *
-   * Elements are represented by their own `toString` results.
-   *
-   * The default representation always contains the first three elements.
-   * If there are less than a hundred elements in the iterable, it also
-   * contains the last two elements.
-   *
-   * If the resulting string isn't above 80 characters, more elements are
-   * included from the start of the iterable.
-   *
-   * The conversion may omit calling `toString` on some elements if they
-   * are known to not occur in the output, and it may stop iterating after
-   * a hundred elements.
-   */
-  String toString() => IterableBase.iterableToShortString(this, '(', ')');
-}
-
-class _GeneratorIterable<E> extends ListIterable<E> {
-  /// The length of the generated iterable.
-  final int length;
-
-  /// The function mapping indices to values.
-  final E Function(int) _generator;
-
-  /// Creates the generated iterable.
-  ///
-  /// If [generator] is `null`, it is checked that `int` is assignable to [E].
-  _GeneratorIterable(this.length, E generator(int index)?)
-      : // The `as` below is used as check to make sure that `int` is assignable
-        // to [E].
-        _generator = generator ?? (_id as E Function(int));
-
-  E elementAt(int index) {
-    RangeError.checkValidIndex(index, this);
-    return _generator(index);
-  }
-
-  /// Helper function used as default _generator function.
-  static int _id(int n) => n;
-}
-
-/**
- * An [Iterator] that allows moving backwards as well as forwards.
- */
-abstract class BidirectionalIterator<E> implements Iterator<E> {
-  /**
-   * Move back to the previous element.
-   *
-   * Returns true and updates [current] if successful. Returns false
-   * and updates [current] to an implementation defined state if there is no
-   * previous element
-   */
-  bool movePrevious();
-}
diff --git a/sdk_nnbd/lib/core/iterator.dart b/sdk_nnbd/lib/core/iterator.dart
deleted file mode 100644
index f116c1b..0000000
--- a/sdk_nnbd/lib/core/iterator.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * An interface for getting items, one at a time, from an object.
- *
- * The for-in construct transparently uses `Iterator` to test for the end
- * of the iteration, and to get each item (or _element_).
- *
- * If the object iterated over is changed during the iteration, the
- * behavior is unspecified.
- *
- * The `Iterator` is initially positioned before the first element.
- * Before accessing the first element the iterator must thus be advanced using
- * [moveNext] to point to the first element.
- * If no element is left, then [moveNext] returns false,
- * and all further calls to [moveNext] will also return false.
- *
- * The [current] value must not be accessed before calling [moveNext]
- * or after a call to [moveNext] has returned false.
- *
- * A typical usage of an Iterator looks as follows:
- *
- *     var it = obj.iterator;
- *     while (it.moveNext()) {
- *       use(it.current);
- *     }
- *
- * **See also:**
- * [Iteration](http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html#iteration)
- * in the [library tour](http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html)
- */
-abstract class Iterator<E> {
-  /**
-   * Advances the iterator to the next element of the iteration.
-   *
-   * Should be called before reading [current].
-   * It the call to `moveNext` returns `true`,
-   * then [current] will contain the next element of the iteration
-   * until `moveNext` is called again.
-   * If the call returns `false`, there are no further elements
-   * and [current] should not be used any more.
-   *
-   * It is safe to call [moveNext] after it has already returned `false`,
-   * but it must keep returning `false` and not have any other effect.
-   *
-   * A call to `moveNext` may throw for various reasons,
-   * including a concurrent change to an underlying collection.
-   * If that happens, the iterator may be in an inconsistent
-   * state, and any further behavior of the iterator is unspecified,
-   * including the effect of reading [current].
-   */
-  bool moveNext();
-
-  /**
-   * Returns the current element.
-   *
-   * If the iterator has not yet been moved to the first element
-   * ([moveNext] has not been called yet),
-   * or if the iterator has been moved past the last element of the [Iterable]
-   * ([moveNext] has returned false),
-   * then [current] is unspecified.
-   * An [Iterator] may either throw or return an iterator specific default value
-   * in that case.
-   *
-   * The `current` getter should keep its value until the next call to
-   * [moveNext], even if an underlying collection changes.
-   * After a successful call to `moveNext`, the user doesn't need to cache
-   * the current value, but can keep reading it from the iterator.
-   */
-  E get current;
-}
diff --git a/sdk_nnbd/lib/core/list.dart b/sdk_nnbd/lib/core/list.dart
deleted file mode 100644
index afd7f11..0000000
--- a/sdk_nnbd/lib/core/list.dart
+++ /dev/null
@@ -1,759 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * An indexable collection of objects with a length.
- *
- * Subclasses of this class implement different kinds of lists.
- * The most common kinds of lists are:
- *
- * * Fixed-length list.
- *   An error occurs when attempting to use operations
- *   that can change the length of the list.
- *
- * * Growable list. Full implementation of the API defined in this class.
- *
- * The default growable list, as created by `[]`, keeps
- * an internal buffer, and grows that buffer when necessary. This guarantees
- * that a sequence of [add] operations will each execute in amortized constant
- * time. Setting the length directly may take time proportional to the new
- * length, and may change the internal capacity so that a following add
- * operation will need to immediately increase the buffer capacity.
- * Other list implementations may have different performance behavior.
- *
- * The following code illustrates that some List implementations support
- * only a subset of the API.
- *
- *     List<int> fixedLengthList = new List(5);
- *     fixedLengthList.length = 0;  // Error
- *     fixedLengthList.add(499);    // Error
- *     fixedLengthList[0] = 87;
- *     List<int> growableList = [1, 2];
- *     growableList.length = 0;
- *     growableList.add(499);
- *     growableList[0] = 87;
- *
- * Lists are [Iterable]. Iteration occurs over values in index order. Changing
- * the values does not affect iteration, but changing the valid
- * indices&mdash;that is, changing the list's length&mdash;between iteration
- * steps causes a [ConcurrentModificationError]. This means that only growable
- * lists can throw ConcurrentModificationError. If the length changes
- * temporarily and is restored before continuing the iteration, the iterator
- * does not detect it.
- *
- * It is generally not allowed to modify the list's length (adding or removing
- * elements) while an operation on the list is being performed,
- * for example during a call to [forEach] or [sort].
- * Changing the list's length while it is being iterated, either by iterating it
- * directly or through iterating an [Iterable] that is backed by the list, will
- * break the iteration.
- */
-abstract class List<E> implements EfficientLengthIterable<E> {
-  /**
-   * Creates a list of the given length.
-   *
-   * This constructor will throw an exception if [E] is not a nullable type.
-   * In this case, another constructor such as [List.filled] must be used
-   * instead.
-   *
-   * The created list is fixed-length if [length] is provided.
-   *
-   *     List fixedLengthList = new List(3);
-   *     fixedLengthList.length;     // 3
-   *     fixedLengthList.length = 1; // Error
-   *
-   * The list has length 0 and is growable if [length] is omitted.
-   *
-   *     List growableList = [];
-   *     growableList.length; // 0;
-   *     growableList.length = 3;
-   *
-   * To create a growable list with a given length, for a nullable element type,
-   * just assign the length right after creation:
-   *
-   *     List growableList = []..length = 500;
-   *
-   * For a non-nullable element type, an alternative is the following:
-   *
-   *     List<int> growableList = List<int>.filled(500, 0, growable: true);
-   *
-   * The [length] must not be negative or null, if it is provided.
-   *
-   * If the element type is not nullable, [length] must not be greater than
-   * zero.
-   *
-   * This constructor cannot be used in null-safe code.
-   * Use [List.filled] to create a non-empty list.
-   * This requires a fill value to initialize the list elements with.
-   * To create an empty list, use `[]` for a growable list or
-   * `List.empty` for a fixed length list (or where growability is determined
-   * at run-time).
-   */
-  external factory List([int? length]);
-
-  /**
-   * Creates a list of the given length with [fill] at each position.
-   *
-   * The [length] must be a non-negative integer.
-   *
-   * Example:
-   * ```dart
-   * new List<int>.filled(3, 0, growable: true); // [0, 0, 0]
-   * ```
-   *
-   * The created list is fixed-length if [growable] is false (the default)
-   * and growable if [growable] is true.
-   * If the list is growable, changing its length will not initialize new
-   * entries with [fill].
-   * After being created and filled, the list is no different from any other
-   * growable or fixed-length list created using [List].
-   *
-   * All elements of the returned list share the same [fill] value.
-   * ```
-   * var shared = new List.filled(3, []);
-   * shared[0].add(499);
-   * print(shared);  // => [[499], [499], [499]]
-   * ```
-   *
-   * You can use [List.generate] to create a list with a new object at
-   * each position.
-   * ```
-   * var unique = new List.generate(3, (_) => []);
-   * unique[0].add(499);
-   * print(unique); // => [[499], [], []]
-   * ```
-   */
-  external factory List.filled(int length, E fill, {bool growable = false});
-
-  /**
-   * Creates a new empty list.
-   *
-   * If [growable] is `false`, which is the default,
-   * the list is a fixed-length list of length zero.
-   * If [growable] is `true`, the list is growable and equivalent to `<E>[]`.
-   */
-  @Since("2.8")
-  external factory List.empty({bool growable = false});
-
-  /**
-   * Creates a list containing all [elements].
-   *
-   * The [Iterator] of [elements] provides the order of the elements.
-   *
-   * All the [elements] should be instances of [E].
-   * The `elements` iterable itself may have any element type, so this
-   * constructor can be used to down-cast a `List`, for example as:
-   * ```dart
-   * List<SuperType> superList = ...;
-   * List<SubType> subList =
-   *     new List<SubType>.from(superList.whereType<SubType>());
-   * ```
-   *
-   * This constructor creates a growable list when [growable] is true;
-   * otherwise, it returns a fixed-length list.
-   */
-  external factory List.from(Iterable elements, {bool growable = true});
-
-  /**
-   * Creates a list from [elements].
-   *
-   * The [Iterator] of [elements] provides the order of the elements.
-   *
-   * This constructor creates a growable list when [growable] is true;
-   * otherwise, it returns a fixed-length list.
-   */
-  external factory List.of(Iterable<E> elements, {bool growable = true});
-
-  /**
-   * Generates a list of values.
-   *
-   * Creates a list with [length] positions and fills it with values created by
-   * calling [generator] for each index in the range `0` .. `length - 1`
-   * in increasing order.
-   * ```dart
-   * List<int>.generate(3, (int index) => index * index); // [0, 1, 4]
-   * ```
-   * The created list is fixed-length if [growable] is set to false.
-   *
-   * The [length] must be non-negative.
-   */
-  external factory List.generate(int length, E generator(int index),
-      {bool growable = true});
-
-  /**
-   * Creates an unmodifiable list containing all [elements].
-   *
-   * The [Iterator] of [elements] provides the order of the elements.
-   *
-   * An unmodifiable list cannot have its length or elements changed.
-   * If the elements are themselves immutable, then the resulting list
-   * is also immutable.
-   */
-  external factory List.unmodifiable(Iterable elements);
-
-  /**
-   * Adapts [source] to be a `List<T>`.
-   *
-   * Any time the list would produce an element that is not a [T],
-   * the element access will throw.
-   *
-   * Any time a [T] value is attempted stored into the adapted list,
-   * the store will throw unless the value is also an instance of [S].
-   *
-   * If all accessed elements of [source] are actually instances of [T],
-   * and if all elements stored into the returned list are actually instance
-   * of [S],
-   * then the returned list can be used as a `List<T>`.
-   */
-  static List<T> castFrom<S, T>(List<S> source) => CastList<S, T>(source);
-
-  /**
-   * Copy a range of one list into another list.
-   *
-   * This is a utility function that can be used to implement methods like
-   * [setRange].
-   *
-   * The range from [start] to [end] must be a valid range of [source],
-   * and there must be room for `end - start` elements from position [at].
-   * If [start] is omitted, it defaults to zero.
-   * If [end] is omitted, it defaults to [source.length].
-   *
-   * If [source] and [target] is the same list, overlapping source and target
-   * ranges are respected so that the target range ends up containing the
-   * initial content of the source range.
-   * Otherwise the order of element copying is not guaranteed.
-   */
-  static void copyRange<T>(List<T> target, int at, List<T> source,
-      [int? start, int? end]) {
-    start ??= 0;
-    end = RangeError.checkValidRange(start, end, source.length);
-    if (end == null) {
-      // TODO(dart-lang/language#440): Remove when promotion works.
-      throw "unreachable";
-    }
-    int length = end - start;
-    if (target.length < at + length) {
-      throw ArgumentError.value(target, "target",
-          "Not big enough to hold $length elements at position $at");
-    }
-    if (!identical(source, target) || start >= at) {
-      for (int i = 0; i < length; i++) {
-        target[at + i] = source[start + i];
-      }
-    } else {
-      for (int i = length; --i >= 0;) {
-        target[at + i] = source[start + i];
-      }
-    }
-  }
-
-  /**
-   * Write the elements of an iterable into a list.
-   *
-   * This is a utility function that can be used to implement methods like
-   * [setAll].
-   *
-   * The elements of [source] are written into [target] from position [at].
-   * The [source] must not contain more elements after writing the last
-   * position of [target].
-   *
-   * If the source is a list, the [copyRange] function is likely to be more
-   * efficient.
-   */
-  static void writeIterable<T>(List<T> target, int at, Iterable<T> source) {
-    RangeError.checkValueInInterval(at, 0, target.length, "at");
-    int index = at;
-    int targetLength = target.length;
-    for (var element in source) {
-      if (index == targetLength) {
-        throw IndexError(targetLength, target);
-      }
-      target[index] = element;
-      index++;
-    }
-  }
-
-  /**
-   * Returns a view of this list as a list of [R] instances.
-   *
-   * If this list contains only instances of [R], all read operations
-   * will work correctly. If any operation tries to access an element
-   * that is not an instance of [R], the access will throw instead.
-   *
-   * Elements added to the list (e.g., by using [add] or [addAll])
-   * must be instance of [R] to be valid arguments to the adding function,
-   * and they must be instances of [E] as well to be accepted by
-   * this list as well.
-   *
-   * Typically implemented as `List.castFrom<E, R>(this)`.
-   */
-  List<R> cast<R>();
-
-  /**
-   * Returns the object at the given [index] in the list
-   * or throws a [RangeError] if [index] is out of bounds.
-   */
-  E operator [](int index);
-
-  /**
-   * Sets the value at the given [index] in the list to [value]
-   * or throws a [RangeError] if [index] is out of bounds.
-   */
-  void operator []=(int index, E value);
-
-  /**
-   * Updates the first position of the list to contain [value].
-   *
-   * Equivalent to `theList[0] = value;`.
-   *
-   * The list must be non-empty.
-   */
-  void set first(E value);
-
-  /**
-   * Updates the last position of the list to contain [value].
-   *
-   * Equivalent to `theList[theList.length - 1] = value;`.
-   *
-   * The list must be non-empty.
-   */
-  void set last(E value);
-
-  /**
-   * The number of objects in this list.
-   *
-   * The valid indices for a list are `0` through `length - 1`.
-   */
-  int get length;
-
-  /**
-   * Changes the length of this list.
-   *
-   * If [newLength] is greater than
-   * the current length, entries are initialized to `null`.
-   * Increasing the length fails if the element type does not allow `null`.
-   *
-   * Throws an [UnsupportedError] if the list is fixed-length or
-   * if attempting tp enlarge the list when `null` is not a valid element.
-   */
-  set length(int newLength);
-
-  /**
-   * Adds [value] to the end of this list,
-   * extending the length by one.
-   *
-   * Throws an [UnsupportedError] if the list is fixed-length.
-   */
-  void add(E value);
-
-  /**
-   * Appends all objects of [iterable] to the end of this list.
-   *
-   * Extends the length of the list by the number of objects in [iterable].
-   * Throws an [UnsupportedError] if this list is fixed-length.
-   */
-  void addAll(Iterable<E> iterable);
-
-  /**
-   * Returns an [Iterable] of the objects in this list in reverse order.
-   */
-  Iterable<E> get reversed;
-
-  /**
-   * Sorts this list according to the order specified by the [compare] function.
-   *
-   * The [compare] function must act as a [Comparator].
-   *
-   *     List<String> numbers = ['two', 'three', 'four'];
-   *     // Sort from shortest to longest.
-   *     numbers.sort((a, b) => a.length.compareTo(b.length));
-   *     print(numbers);  // [two, four, three]
-   *
-   * The default List implementations use [Comparable.compare] if
-   * [compare] is omitted.
-   *
-   *     List<int> nums = [13, 2, -11];
-   *     nums.sort();
-   *     print(nums);  // [-11, 2, 13]
-   *
-   * A [Comparator] may compare objects as equal (return zero), even if they
-   * are distinct objects.
-   * The sort function is not guaranteed to be stable, so distinct objects
-   * that compare as equal may occur in any order in the result:
-   *
-   *     List<String> numbers = ['one', 'two', 'three', 'four'];
-   *     numbers.sort((a, b) => a.length.compareTo(b.length));
-   *     print(numbers);  // [one, two, four, three] OR [two, one, four, three]
-   */
-  void sort([int compare(E a, E b)?]);
-
-  /**
-   * Shuffles the elements of this list randomly.
-   */
-  void shuffle([Random? random]);
-
-  /**
-   * Returns the first index of [element] in this list.
-   *
-   * Searches the list from index [start] to the end of the list.
-   * The first time an object [:o:] is encountered so that [:o == element:],
-   * the index of [:o:] is returned.
-   *
-   *     List<String> notes = ['do', 're', 'mi', 're'];
-   *     notes.indexOf('re');    // 1
-   *     notes.indexOf('re', 2); // 3
-   *
-   * Returns -1 if [element] is not found.
-   *
-   *     notes.indexOf('fa');    // -1
-   */
-  int indexOf(E element, [int start = 0]);
-
-  /**
-   * Returns the first index in the list that satisfies the provided [test].
-   *
-   * Searches the list from index [start] to the end of the list.
-   * The first time an object `o` is encountered so that `test(o)` is true,
-   * the index of `o` is returned.
-   *
-   * ```
-   * List<String> notes = ['do', 're', 'mi', 're'];
-   * notes.indexWhere((note) => note.startsWith('r'));       // 1
-   * notes.indexWhere((note) => note.startsWith('r'), 2);    // 3
-   * ```
-   *
-   * Returns -1 if [element] is not found.
-   * ```
-   * notes.indexWhere((note) => note.startsWith('k'));    // -1
-   * ```
-   */
-  int indexWhere(bool test(E element), [int start = 0]);
-
-  /**
-   * Returns the last index in the list that satisfies the provided [test].
-   *
-   * Searches the list from index [start] to 0.
-   * The first time an object `o` is encountered so that `test(o)` is true,
-   * the index of `o` is returned.
-   * If [start] is omitted, it defaults to the [length] of the list.
-   *
-   * ```
-   * List<String> notes = ['do', 're', 'mi', 're'];
-   * notes.lastIndexWhere((note) => note.startsWith('r'));       // 3
-   * notes.lastIndexWhere((note) => note.startsWith('r'), 2);    // 1
-   * ```
-   *
-   * Returns -1 if [element] is not found.
-   * ```
-   * notes.lastIndexWhere((note) => note.startsWith('k'));    // -1
-   * ```
-   */
-  int lastIndexWhere(bool test(E element), [int? start]);
-
-  /**
-   * Returns the last index of [element] in this list.
-   *
-   * Searches the list backwards from index [start] to 0.
-   *
-   * The first time an object [:o:] is encountered so that [:o == element:],
-   * the index of [:o:] is returned.
-   *
-   *     List<String> notes = ['do', 're', 'mi', 're'];
-   *     notes.lastIndexOf('re', 2); // 1
-   *
-   * If [start] is not provided, this method searches from the end of the
-   * list.
-   *
-   *     notes.lastIndexOf('re');  // 3
-   *
-   * Returns -1 if [element] is not found.
-   *
-   *     notes.lastIndexOf('fa');  // -1
-   */
-  int lastIndexOf(E element, [int? start]);
-
-  /**
-   * Removes all objects from this list;
-   * the length of the list becomes zero.
-   *
-   * Throws an [UnsupportedError], and retains all objects, if this
-   * is a fixed-length list.
-   */
-  void clear();
-
-  /**
-   * Inserts the object at position [index] in this list.
-   *
-   * This increases the length of the list by one and shifts all objects
-   * at or after the index towards the end of the list.
-   *
-   * The list must be growable.
-   * The [index] value must be non-negative and no greater than [length].
-   */
-  void insert(int index, E element);
-
-  /**
-   * Inserts all objects of [iterable] at position [index] in this list.
-   *
-   * This increases the length of the list by the length of [iterable] and
-   * shifts all later objects towards the end of the list.
-   *
-   * The list must be growable.
-   * The [index] value must be non-negative and no greater than [length].
-   */
-  void insertAll(int index, Iterable<E> iterable);
-
-  /**
-   * Overwrites objects of `this` with the objects of [iterable], starting
-   * at position [index] in this list.
-   *
-   *     List<String> list = ['a', 'b', 'c'];
-   *     list.setAll(1, ['bee', 'sea']);
-   *     list.join(', '); // 'a, bee, sea'
-   *
-   * This operation does not increase the length of `this`.
-   *
-   * The [index] must be non-negative and no greater than [length].
-   *
-   * The [iterable] must not have more elements than what can fit from [index]
-   * to [length].
-   *
-   * If `iterable` is based on this list, its values may change /during/ the
-   * `setAll` operation.
-   */
-  void setAll(int index, Iterable<E> iterable);
-
-  /**
-   * Removes the first occurrence of [value] from this list.
-   *
-   * Returns true if [value] was in the list, false otherwise.
-   *
-   *     List<String> parts = ['head', 'shoulders', 'knees', 'toes'];
-   *     parts.remove('head'); // true
-   *     parts.join(', ');     // 'shoulders, knees, toes'
-   *
-   * The method has no effect if [value] was not in the list.
-   *
-   *     // Note: 'head' has already been removed.
-   *     parts.remove('head'); // false
-   *     parts.join(', ');     // 'shoulders, knees, toes'
-   *
-   * An [UnsupportedError] occurs if the list is fixed-length.
-   */
-  bool remove(Object? value);
-
-  /**
-   * Removes the object at position [index] from this list.
-   *
-   * This method reduces the length of `this` by one and moves all later objects
-   * down by one position.
-   *
-   * Returns the removed object.
-   *
-   * The [index] must be in the range `0 ≤ index < length`.
-   *
-   * Throws an [UnsupportedError] if this is a fixed-length list. In that case
-   * the list is not modified.
-   */
-  E removeAt(int index);
-
-  /**
-   * Pops and returns the last object in this list.
-   *
-   * The list must not be empty.
-   *
-   * Throws an [UnsupportedError] if this is a fixed-length list.
-   */
-  E removeLast();
-
-  /**
-   * Removes all objects from this list that satisfy [test].
-   *
-   * An object [:o:] satisfies [test] if [:test(o):] is true.
-   *
-   *     List<String> numbers = ['one', 'two', 'three', 'four'];
-   *     numbers.removeWhere((item) => item.length == 3);
-   *     numbers.join(', '); // 'three, four'
-   *
-   * Throws an [UnsupportedError] if this is a fixed-length list.
-   */
-  void removeWhere(bool test(E element));
-
-  /**
-   * Removes all objects from this list that fail to satisfy [test].
-   *
-   * An object [:o:] satisfies [test] if [:test(o):] is true.
-   *
-   *     List<String> numbers = ['one', 'two', 'three', 'four'];
-   *     numbers.retainWhere((item) => item.length == 3);
-   *     numbers.join(', '); // 'one, two'
-   *
-   * Throws an [UnsupportedError] if this is a fixed-length list.
-   */
-  void retainWhere(bool test(E element));
-
-  /**
-   * Returns the concatenation of this list and [other].
-   *
-   * Returns a new list containing the elements of this list followed by
-   * the elements of [other].
-   *
-   * The default behavior is to return a normal growable list.
-   * Some list types may choose to return a list of the same type as themselves
-   * (see [Uint8List.+]);
-   */
-  List<E> operator +(List<E> other);
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `List<E>` containing the elements of this list at
-   * positions greater than or equal to [start] and less than [end] in the same
-   * order as they occur in this list.
-   *
-   * ```dart
-   * var colors = ["red", "green", "blue", "orange", "pink"];
-   * print(colors.sublist(1, 3)); // [green, blue]
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(colors.sublist(1)); // [green, blue, orange, pink]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  List<E> sublist(int start, [int? end]);
-
-  /**
-   * Returns an [Iterable] that iterates over the objects in the range
-   * [start] inclusive to [end] exclusive.
-   *
-   * The provided range, given by [start] and [end], must be valid at the time
-   * of the call.
-   *
-   * A range from [start] to [end] is valid if `0 <= start <= end <= len`, where
-   * `len` is this list's `length`. The range starts at `start` and has length
-   * `end - start`. An empty range (with `end == start`) is valid.
-   *
-   * The returned [Iterable] behaves like `skip(start).take(end - start)`.
-   * That is, it does *not* throw if this list changes size.
-   *
-   *     List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
-   *     Iterable<String> range = colors.getRange(1, 4);
-   *     range.join(', ');  // 'green, blue, orange'
-   *     colors.length = 3;
-   *     range.join(', ');  // 'green, blue'
-   */
-  Iterable<E> getRange(int start, int end);
-
-  /**
-   * Copies the objects of [iterable], skipping [skipCount] objects first,
-   * into the range [start], inclusive, to [end], exclusive, of the list.
-   *
-   *     List<int> list1 = [1, 2, 3, 4];
-   *     List<int> list2 = [5, 6, 7, 8, 9];
-   *     // Copies the 4th and 5th items in list2 as the 2nd and 3rd items
-   *     // of list1.
-   *     list1.setRange(1, 3, list2, 3);
-   *     list1.join(', '); // '1, 8, 9, 4'
-   *
-   * The provided range, given by [start] and [end], must be valid.
-   * A range from [start] to [end] is valid if `0 <= start <= end <= len`, where
-   * `len` is this list's `length`. The range starts at `start` and has length
-   * `end - start`. An empty range (with `end == start`) is valid.
-   *
-   * The [iterable] must have enough objects to fill the range from `start`
-   * to `end` after skipping [skipCount] objects.
-   *
-   * If `iterable` is this list, the operation copies the elements
-   * originally in the range from `skipCount` to `skipCount + (end - start)` to
-   * the range `start` to `end`, even if the two ranges overlap.
-   *
-   * If `iterable` depends on this list in some other way, no guarantees are
-   * made.
-   */
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]);
-
-  /**
-   * Removes the objects in the range [start] inclusive to [end] exclusive.
-   *
-   * The provided range, given by [start] and [end], must be valid.
-   * A range from [start] to [end] is valid if `0 <= start <= end <= len`, where
-   * `len` is this list's `length`. The range starts at `start` and has length
-   * `end - start`. An empty range (with `end == start`) is valid.
-   *
-   * Throws an [UnsupportedError] if this is a fixed-length list. In that case
-   * the list is not modified.
-   */
-  void removeRange(int start, int end);
-
-  /**
-   * Sets the objects in the range [start] inclusive to [end] exclusive
-   * to the given [fillValue].
-   *
-   * The provided range, given by [start] and [end], must be valid.
-   * A range from [start] to [end] is valid if `0 <= start <= end <= len`, where
-   * `len` is this list's `length`. The range starts at `start` and has length
-   * `end - start`. An empty range (with `end == start`) is valid.
-   *
-   * Example:
-   * ```dart
-   *  List<int> list = new List(3);
-   *     list.fillRange(0, 2, 1);
-   *     print(list); //  [1, 1, null]
-   * ```
-   *
-   * If the element type is not nullable, omitting [fillValue] or passing `null`
-   * as [fillValue] will make the `fillRange` fail.
-   */
-  void fillRange(int start, int end, [E? fillValue]);
-
-  /**
-   * Removes the objects in the range [start] inclusive to [end] exclusive
-   * and inserts the contents of [replacement] in its place.
-   *
-   *     List<int> list = [1, 2, 3, 4, 5];
-   *     list.replaceRange(1, 4, [6, 7]);
-   *     list.join(', '); // '1, 6, 7, 5'
-   *
-   * The provided range, given by [start] and [end], must be valid.
-   * A range from [start] to [end] is valid if `0 <= start <= end <= len`, where
-   * `len` is this list's `length`. The range starts at `start` and has length
-   * `end - start`. An empty range (with `end == start`) is valid.
-   *
-   * This method does not work on fixed-length lists, even when [replacement]
-   * has the same number of elements as the replaced range. In that case use
-   * [setRange] instead.
-   */
-  void replaceRange(int start, int end, Iterable<E> replacement);
-
-  /**
-   * Returns an unmodifiable [Map] view of `this`.
-   *
-   * The map uses the indices of this list as keys and the corresponding objects
-   * as values. The `Map.keys` [Iterable] iterates the indices of this list
-   * in numerical order.
-   *
-   *     List<String> words = ['fee', 'fi', 'fo', 'fum'];
-   *     Map<int, String> map = words.asMap();
-   *     map[0] + map[1];   // 'feefi';
-   *     map.keys.toList(); // [0, 1, 2, 3]
-   */
-  Map<int, E> asMap();
-
-  /**
-  * Whether this list is equal to [other].
-  *
-  * Lists are, by default, only equal to themselves.
-  * Even if [other] is also a list, the equality comparison
-  * does not compare the elements of the two lists.
-  */
-  bool operator ==(Object other);
-}
diff --git a/sdk_nnbd/lib/core/map.dart b/sdk_nnbd/lib/core/map.dart
deleted file mode 100644
index a92d08d..0000000
--- a/sdk_nnbd/lib/core/map.dart
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * A collection of key/value pairs, from which you retrieve a value
- * using its associated key.
- *
- * There is a finite number of keys in the map,
- * and each key has exactly one value associated with it.
- *
- * Maps, and their keys and values, can be iterated.
- * The order of iteration is defined by the individual type of map.
- * Examples:
- *
- * * The plain [HashMap] is unordered (no order is guaranteed),
- * * the [LinkedHashMap] iterates in key insertion order,
- * * and a sorted map like [SplayTreeMap] iterates the keys in sorted order.
- *
- * It is generally not allowed to modify the map (add or remove keys) while
- * an operation is being performed on the map, for example in functions called
- * during a [forEach] or [putIfAbsent] call.
- * Modifying the map while iterating the keys or values
- * may also break the iteration.
- *
- * It is generally not allowed to modify the equality of keys (and thus not
- * their hashcode) while they are in the map. Some specialized subtypes may be
- * more permissive, in which case they should document this behavior.
- */
-abstract class Map<K, V> {
-  /**
-   * Creates a Map instance with the default implementation, [LinkedHashMap].
-   *
-   * This constructor is equivalent to the non-const map literal `<K,V>{}`.
-   *
-   * A `LinkedHashMap` requires the keys to implement compatible
-   * `operator==` and `hashCode`, and it allows null as a key.
-   * It iterates in key insertion order.
-   */
-  external factory Map();
-
-  /**
-   * Creates a [LinkedHashMap] instance that contains all key/value pairs of
-   * [other].
-   *
-   * The keys must all be instances of [K] and the values of [V].
-   * The [other] map itself can have any type.
-   *
-   * A `LinkedHashMap` requires the keys to implement compatible
-   * `operator==` and `hashCode`, and it allows `null` as a key.
-   * It iterates in key insertion order.
-   */
-  factory Map.from(Map other) = LinkedHashMap<K, V>.from;
-
-  /**
-   * Creates a [LinkedHashMap] with the same keys and values as [other].
-   *
-   * A `LinkedHashMap` requires the keys to implement compatible
-   * `operator==` and `hashCode`, and it allows `null` as a key.
-   * It iterates in key insertion order.
-   */
-  factory Map.of(Map<K, V> other) = LinkedHashMap<K, V>.of;
-
-  /**
-   * Creates an unmodifiable hash based map containing the entries of [other].
-   *
-   * The keys must all be instances of [K] and the values of [V].
-   * The [other] map itself can have any type.
-   *
-   * The map requires the keys to implement compatible
-   * `operator==` and `hashCode`, and it allows `null` as a key.
-   * The created map iterates keys in a fixed order,
-   * preserving the order provided by [other].
-   *
-   * The resulting map behaves like the result of [Map.from],
-   * except that the map returned by this constructor is not modifiable.
-   */
-  external factory Map.unmodifiable(Map<dynamic, dynamic> other);
-
-  /**
-   * Creates an identity map with the default implementation, [LinkedHashMap].
-   *
-   * An identity map uses [identical] for equality and [identityHashCode]
-   * for hash codes of keys instead of the intrinsic [Object.operator==] and
-   * [Object.hashCode] of the keys.
-   *
-   * The returned map allows `null` as a key.
-   * It iterates in key insertion order.
-   */
-  factory Map.identity() = LinkedHashMap<K, V>.identity;
-
-  /**
-   * Creates a Map instance in which the keys and values are computed from the
-   * [iterable].
-   *
-   * The created map is a [LinkedHashMap].
-   * A `LinkedHashMap` requires the keys to implement compatible
-   * `operator==` and `hashCode`, and it allows null as a key.
-   * It iterates in key insertion order.
-   *
-   * For each element of the [iterable] this constructor computes a key/value
-   * pair, by applying [key] and [value] respectively.
-   *
-   * The example below creates a new Map from a List. The keys of `map` are
-   * `list` values converted to strings, and the values of the `map` are the
-   * squares of the `list` values:
-   *
-   *     List<int> list = [1, 2, 3];
-   *     Map<String, int> map = new Map.fromIterable(list,
-   *         key: (item) => item.toString(),
-   *         value: (item) => item * item);
-   *
-   *     map['1'] + map['2']; // 1 + 4
-   *     map['3'] - map['2']; // 9 - 4
-   *
-   * If no values are specified for [key] and [value] the default is the
-   * identity function.
-   *
-   * In the following example, the keys and corresponding values of `map`
-   * are `list` values:
-   *
-   *     map = new Map.fromIterable(list);
-   *     map[1] + map[2]; // 1 + 2
-   *     map[3] - map[2]; // 3 - 2
-   *
-   * The keys computed by the source [iterable] do not need to be unique. The
-   * last occurrence of a key will simply overwrite any previous value.
-   */
-  factory Map.fromIterable(Iterable iterable,
-      {K key(element)?, V value(element)?}) = LinkedHashMap<K, V>.fromIterable;
-
-  /**
-   * Creates a Map instance associating the given [keys] to [values].
-   *
-   * The created map is a [LinkedHashMap].
-   * A `LinkedHashMap` requires the keys to implement compatible
-   * `operator==` and `hashCode`, and it allows null as a key.
-   * It iterates in key insertion order.
-   *
-   * This constructor iterates over [keys] and [values] and maps each element of
-   * [keys] to the corresponding element of [values].
-   *
-   *     List<String> letters = ['b', 'c'];
-   *     List<String> words = ['bad', 'cat'];
-   *     Map<String, String> map = new Map.fromIterables(letters, words);
-   *     map['b'] + map['c'];  // badcat
-   *
-   * If [keys] contains the same object multiple times, the last occurrence
-   * overwrites the previous value.
-   *
-   * The two [Iterable]s must have the same length.
-   */
-  factory Map.fromIterables(Iterable<K> keys, Iterable<V> values) =
-      LinkedHashMap<K, V>.fromIterables;
-
-  /**
-   * Adapts [source] to be a `Map<K2, V2>`.
-   *
-   * Any time the set would produce a key or value that is not a [K2] or [V2],
-   * the access will throw.
-   *
-   * Any time [K2] key or [V2] value is attempted added into the adapted map,
-   * the store will throw unless the key is also an instance of [K] and
-   * the value is also an instance of [V].
-   *
-   * If all accessed entries of [source] are have [K2] keys and [V2] values
-   * and if all entries added to the returned map have [K] keys and [V]] values,
-   * then the returned map can be used as a `Map<K2, V2>`.
-   */
-  static Map<K2, V2> castFrom<K, V, K2, V2>(Map<K, V> source) =>
-      CastMap<K, V, K2, V2>(source);
-
-  /**
-   * Creates a new map and adds all entries.
-   *
-   * Returns a new `Map<K, V>` where all entries of [entries]
-   * have been added in iteration order.
-   *
-   * If multiple [entries] have the same key,
-   * later occurrences overwrite the earlier ones.
-   */
-  factory Map.fromEntries(Iterable<MapEntry<K, V>> entries) =>
-      <K, V>{}..addEntries(entries);
-
-  /**
-   * Provides a view of this map as having [RK] keys and [RV] instances,
-   * if necessary.
-   *
-   * If this map is already a `Map<RK, RV>`, it is returned unchanged.
-   *
-   * If this set contains only keys of type [RK] and values of type [RV],
-   * all read operations will work correctly.
-   * If any operation exposes a non-[RK] key or non-[RV] value,
-   * the operation will throw instead.
-   *
-   * Entries added to the map must be valid for both a `Map<K, V>` and a
-   * `Map<RK, RV>`.
-   */
-  Map<RK, RV> cast<RK, RV>();
-
-  /**
-   * Returns true if this map contains the given [value].
-   *
-   * Returns true if any of the values in the map are equal to `value`
-   * according to the `==` operator.
-   */
-  bool containsValue(Object? value);
-
-  /**
-   * Returns true if this map contains the given [key].
-   *
-   * Returns true if any of the keys in the map are equal to `key`
-   * according to the equality used by the map.
-   */
-  bool containsKey(Object? key);
-
-  /**
-   * Returns the value for the given [key] or null if [key] is not in the map.
-   *
-   * Some maps allow keys to have `null` as a value.
-   * For those maps, a lookup using this operator cannot distinguish between a
-   * key not being in the map and the key having a `null` value.
-   * Methods like [containsKey] or [putIfAbsent] can be used if the distinction
-   * is important.
-   */
-  V? operator [](Object? key);
-
-  /**
-   * Associates the [key] with the given [value].
-   *
-   * If the key was already in the map, its associated value is changed.
-   * Otherwise the key/value pair is added to the map.
-   */
-  void operator []=(K key, V value);
-
-  /**
-   * The map entries of [this].
-   */
-  Iterable<MapEntry<K, V>> get entries;
-
-  /**
-   * Returns a new map where all entries of this map are transformed by
-   * the given [f] function.
-   */
-  Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> f(K key, V value));
-
-  /**
-   * Adds all key/value pairs of [newEntries] to this map.
-   *
-   * If a key of [newEntries] is already in this map,
-   * the corresponding value is overwritten.
-   *
-   * The operation is equivalent to doing `this[entry.key] = entry.value`
-   * for each [MapEntry] of the iterable.
-   */
-  void addEntries(Iterable<MapEntry<K, V>> newEntries);
-
-  /**
-   * Updates the value for the provided [key].
-   *
-   * Returns the new value of the key.
-   *
-   * If the key is present, invokes [update] with the current value and stores
-   * the new value in the map.
-   *
-   * If the key is not present and [ifAbsent] is provided, calls [ifAbsent]
-   * and adds the key with the returned value to the map.
-   *
-   * It's an error if the key is not present and [ifAbsent] is not provided.
-   */
-  V update(K key, V update(V value), {V ifAbsent()?});
-
-  /**
-   * Updates all values.
-   *
-   * Iterates over all entries in the map and updates them with the result
-   * of invoking [update].
-   */
-  void updateAll(V update(K key, V value));
-
-  /**
-   * Removes all entries of this map that satisfy the given [predicate].
-   */
-  void removeWhere(bool predicate(K key, V value));
-
-  /**
-   * Look up the value of [key], or add a new value if it isn't there.
-   *
-   * Returns the value associated to [key], if there is one.
-   * Otherwise calls [ifAbsent] to get a new value, associates [key] to
-   * that value, and then returns the new value.
-   *
-   *     Map<String, int> scores = {'Bob': 36};
-   *     for (var key in ['Bob', 'Rohan', 'Sophena']) {
-   *       scores.putIfAbsent(key, () => key.length);
-   *     }
-   *     scores['Bob'];      // 36
-   *     scores['Rohan'];    //  5
-   *     scores['Sophena'];  //  7
-   *
-   * Calling [ifAbsent] must not add or remove keys from the map.
-   */
-  V putIfAbsent(K key, V ifAbsent());
-
-  /**
-   * Adds all key/value pairs of [other] to this map.
-   *
-   * If a key of [other] is already in this map, its value is overwritten.
-   *
-   * The operation is equivalent to doing `this[key] = value` for each key
-   * and associated value in other. It iterates over [other], which must
-   * therefore not change during the iteration.
-   */
-  void addAll(Map<K, V> other);
-
-  /**
-   * Removes [key] and its associated value, if present, from the map.
-   *
-   * Returns the value associated with `key` before it was removed.
-   * Returns `null` if `key` was not in the map.
-   *
-   * Note that values can be `null` and a returned `null` value doesn't
-   * always mean that the key was absent.
-   */
-  V? remove(Object? key);
-
-  /**
-   * Removes all pairs from the map.
-   *
-   * After this, the map is empty.
-   */
-  void clear();
-
-  /**
-   * Applies [f] to each key/value pair of the map.
-   *
-   * Calling `f` must not add or remove keys from the map.
-   */
-  void forEach(void f(K key, V value));
-
-  /**
-   * The keys of [this].
-   *
-   * The returned iterable has efficient `length` and `contains` operations,
-   * based on [length] and [containsKey] of the map.
-   *
-   * The order of iteration is defined by the individual `Map` implementation,
-   * but must be consistent between changes to the map.
-   *
-   * Modifying the map while iterating the keys
-   * may break the iteration.
-   */
-  Iterable<K> get keys;
-
-  /**
-   * The values of [this].
-   *
-   * The values are iterated in the order of their corresponding keys.
-   * This means that iterating [keys] and [values] in parallel will
-   * provide matching pairs of keys and values.
-   *
-   * The returned iterable has an efficient `length` method based on the
-   * [length] of the map. Its [Iterable.contains] method is based on
-   * `==` comparison.
-   *
-   * Modifying the map while iterating the
-   * values may break the iteration.
-   */
-  Iterable<V> get values;
-
-  /**
-   * The number of key/value pairs in the map.
-   */
-  int get length;
-
-  /**
-   * Returns true if there is no key/value pair in the map.
-   */
-  bool get isEmpty;
-
-  /**
-   * Returns true if there is at least one key/value pair in the map.
-   */
-  bool get isNotEmpty;
-}
-
-/**
- * A key/value pair representing an entry in a [Map].
- */
-class MapEntry<K, V> {
-  /** The key of the entry. */
-  final K key;
-
-  /** The value associated to [key] in the map. */
-  final V value;
-
-  /** Creates an entry with [key] and [value]. */
-  const factory MapEntry(K key, V value) = MapEntry<K, V>._;
-
-  const MapEntry._(this.key, this.value);
-
-  String toString() => "MapEntry(${key.toString()}: ${value.toString()})";
-}
diff --git a/sdk_nnbd/lib/core/null.dart b/sdk_nnbd/lib/core/null.dart
deleted file mode 100644
index f8588a1..0000000
--- a/sdk_nnbd/lib/core/null.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.core;
-
-/**
- * The reserved word `null` denotes an object that is the sole instance of
- * this class.
- *
- * It is a compile-time error for a class to attempt to extend or implement
- * [Null].
- */
-@pragma("vm:entry-point")
-class Null {
-  factory Null._uninstantiable() {
-    throw UnsupportedError('class Null cannot be instantiated');
-  }
-
-  external int get hashCode;
-
-  /** Returns the string `"null"`. */
-  String toString() => "null";
-}
diff --git a/sdk_nnbd/lib/core/num.dart b/sdk_nnbd/lib/core/num.dart
deleted file mode 100644
index 55bb910..0000000
--- a/sdk_nnbd/lib/core/num.dart
+++ /dev/null
@@ -1,489 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * An integer or floating-point number.
- *
- * It is a compile-time error for any type other than [int] or [double]
- * to attempt to extend or implement num.
- */
-abstract class num implements Comparable<num> {
-  /**
-   * Test whether this value is numerically equal to `other`.
-   *
-   * If both operands are doubles, they are equal if they have the same
-   * representation, except that:
-   *
-   *   * zero and minus zero (0.0 and -0.0) are considered equal. They
-   *     both have the numerical value zero.
-   *   * NaN is not equal to anything, including NaN. If either operand is
-   *     NaN, the result is always false.
-   *
-   * If one operand is a double and the other is an int, they are equal if
-   * the double has an integer value (finite with no fractional part) and
-   * `identical(doubleValue.toInt(), intValue)` is true.
-   *
-   * If both operands are integers, they are equal if they have the same value.
-   *
-   * Returns false if `other` is not a [num].
-   *
-   * Notice that the behavior for NaN is non-reflexive. This means that
-   * equality of double values is not a proper equality relation, as is
-   * otherwise required of `operator==`. Using NaN in, e.g., a [HashSet]
-   * will fail to work. The behavior is the standard IEEE-754 equality of
-   * doubles.
-   *
-   * If you can avoid NaN values, the remaining doubles do have a proper
-   * equality relation, and can be used safely.
-   *
-   * Use [compareTo] for a comparison that distinguishes zero and minus zero,
-   * and that considers NaN values as equal.
-   */
-  bool operator ==(Object other);
-
-  /**
-   * Returns a hash code for a numerical value.
-   *
-   * The hash code is compatible with equality. It returns the same value
-   * for an [int] and a [double] with the same numerical value, and therefore
-   * the same value for the doubles zero and minus zero.
-   *
-   * No guarantees are made about the hash code of NaN values.
-   */
-  int get hashCode;
-
-  /**
-   * Compares this to `other`.
-   *
-   * Returns a negative number if `this` is less than `other`, zero if they are
-   * equal, and a positive number if `this` is greater than `other`.
-   *
-   * The ordering represented by this method is a total ordering of [num]
-   * values. All distinct doubles are non-equal, as are all distinct integers,
-   * but integers are equal to doubles if they have the same numerical
-   * value.
-   *
-   * For doubles, the `compareTo` operation is different from the partial
-   * ordering given by [operator==], [operator<] and [operator>]. For example,
-   * IEEE doubles impose that `0.0 == -0.0` and all comparison operations on
-   * NaN return false.
-   *
-   * This function imposes a complete ordering for doubles. When using
-   * `compareTo` the following properties hold:
-   *
-   * - All NaN values are considered equal, and greater than any numeric value.
-   * - -0.0 is less than 0.0 (and the integer 0), but greater than any non-zero
-   *    negative value.
-   * - Negative infinity is less than all other values and positive infinity is
-   *   greater than all non-NaN values.
-   * - All other values are compared using their numeric value.
-   *
-   * Examples:
-   * ```
-   * print(1.compareTo(2)); // => -1
-   * print(2.compareTo(1)); // => 1
-   * print(1.compareTo(1)); // => 0
-   *
-   * // The following comparisons yield different results than the
-   * // corresponding comparison operators.
-   * print((-0.0).compareTo(0.0));  // => -1
-   * print(double.nan.compareTo(double.nan));  // => 0
-   * print(double.infinity.compareTo(double.nan)); // => -1
-   *
-   * // -0.0, and NaN comparison operators have rules imposed by the IEEE
-   * // standard.
-   * print(-0.0 == 0.0); // => true
-   * print(double.nan == double.nan);  // => false
-   * print(double.infinity < double.nan);  // => false
-   * print(double.nan < double.infinity);  // => false
-   * print(double.nan == double.infinity);  // => false
-   * ```
-   */
-  int compareTo(num other);
-
-  /** Addition operator. */
-  num operator +(num other);
-
-  /** Subtraction operator. */
-  num operator -(num other);
-
-  /** Multiplication operator. */
-  num operator *(num other);
-
-  /**
-   * Euclidean modulo operator.
-   *
-   * Returns the remainder of the Euclidean division. The Euclidean division of
-   * two integers `a` and `b` yields two integers `q` and `r` such that
-   * `a == b * q + r` and `0 <= r < b.abs()`.
-   *
-   * The Euclidean division is only defined for integers, but can be easily
-   * extended to work with doubles. In that case `r` may have a non-integer
-   * value, but it still verifies `0 <= r < |b|`.
-   *
-   * The sign of the returned value `r` is always positive.
-   *
-   * See [remainder] for the remainder of the truncating division.
-   */
-  num operator %(num other);
-
-  /** Division operator. */
-  double operator /(num other);
-
-  /**
-   * Truncating division operator.
-   *
-   * If either operand is a [double] then the result of the truncating division
-   * `a ~/ b` is equivalent to `(a / b).truncate().toInt()`.
-   *
-   * If both operands are [int]s then `a ~/ b` performs the truncating
-   * integer division.
-   */
-  int operator ~/(num other);
-
-  /** Negate operator. */
-  num operator -();
-
-  /**
-   * Returns the remainder of the truncating division of `this` by [other].
-   *
-   * The result `r` of this operation satisfies:
-   * `this == (this ~/ other) * other + r`.
-   * As a consequence the remainder `r` has the same sign as the divider `this`.
-   */
-  num remainder(num other);
-
-  /** Relational less than operator. */
-  bool operator <(num other);
-
-  /** Relational less than or equal operator. */
-  bool operator <=(num other);
-
-  /** Relational greater than operator. */
-  bool operator >(num other);
-
-  /** Relational greater than or equal operator. */
-  bool operator >=(num other);
-
-  /** True if the number is the double Not-a-Number value; otherwise, false. */
-  bool get isNaN;
-
-  /**
-   * True if the number is negative; otherwise, false.
-   *
-   * Negative numbers are those less than zero, and the double `-0.0`.
-   */
-  bool get isNegative;
-
-  /**
-   * True if the number is positive infinity or negative infinity; otherwise,
-   * false.
-   */
-  bool get isInfinite;
-
-  /**
-   * True if the number is finite; otherwise, false.
-   *
-   * The only non-finite numbers are NaN, positive infinity, and
-   * negative infinity.
-   */
-  bool get isFinite;
-
-  /** Returns the absolute value of this [num]. */
-  num abs();
-
-  /**
-   * Returns minus one, zero or plus one depending on the sign and
-   * numerical value of the number.
-   *
-   * Returns minus one if the number is less than zero,
-   * plus one if the number is greater than zero,
-   * and zero if the number is equal to zero.
-   *
-   * Returns NaN if the number is the double NaN value.
-   *
-   * Returns a number of the same type as this number.
-   * For doubles, `-0.0.sign == -0.0`.
-
-   * The result satisfies:
-   *
-   *     n == n.sign * n.abs()
-   *
-   * for all numbers `n` (except NaN, because NaN isn't `==` to itself).
-   */
-  num get sign;
-
-  /**
-   * Returns the integer closest to `this`.
-   *
-   * Rounds away from zero when there is no closest integer:
-   *  `(3.5).round() == 4` and `(-3.5).round() == -4`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int round();
-
-  /**
-   * Returns the greatest integer no greater than `this`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int floor();
-
-  /**
-   * Returns the least integer no smaller than `this`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int ceil();
-
-  /**
-   * Returns the integer obtained by discarding any fractional
-   * digits from `this`.
-   *
-   * If `this` is not finite (`NaN` or infinity), throws an [UnsupportedError].
-   */
-  int truncate();
-
-  /**
-   * Returns the double integer value closest to `this`.
-   *
-   * Rounds away from zero when there is no closest integer:
-   *  `(3.5).roundToDouble() == 4` and `(-3.5).roundToDouble() == -4`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is a
-   * non-finite double value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`,
-   * and `-0.0` is therefore considered closer to negative numbers than `0.0`.
-   * This means that for a value, `d` in the range `-0.5 < d < 0.0`,
-   * the result is `-0.0`.
-   *
-   * The result is always a double.
-   * If this is a numerically large integer, the result may be an infinite
-   * double.
-   */
-  double roundToDouble();
-
-  /**
-   * Returns the greatest double integer value no greater than `this`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is a
-   * non-finite double value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`.
-   * A number `d` in the range `0.0 < d < 1.0` will return `0.0`.
-   *
-   * The result is always a double.
-   * If this is a numerically large integer, the result may be an infinite
-   * double.
-   */
-  double floorToDouble();
-
-  /**
-   * Returns the least double integer value no smaller than `this`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is a
-   * non-finite double value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`.
-   * A number `d` in the range `-1.0 < d < 0.0` will return `-0.0`.
-   *
-   * The result is always a double.
-   * If this is a numerically large integer, the result may be an infinite
-   * double.
-   */
-  double ceilToDouble();
-
-  /**
-   * Returns the double integer value obtained by discarding any fractional
-   * digits from the double value of `this`.
-   *
-   * If this is already an integer valued double, including `-0.0`, or it is a
-   * non-finite double value, the value is returned unmodified.
-   *
-   * For the purpose of rounding, `-0.0` is considered to be below `0.0`.
-   * A number `d` in the range `-1.0 < d < 0.0` will return `-0.0`, and
-   * in the range `0.0 < d < 1.0` it will return 0.0.
-   *
-   * The result is always a double.
-   * If this is a numerically large integer, the result may be an infinite
-   * double.
-   */
-  double truncateToDouble();
-
-  /**
-   * Returns this [num] clamped to be in the range [lowerLimit]-[upperLimit].
-   *
-   * The comparison is done using [compareTo] and therefore takes `-0.0` into
-   * account. This also implies that [double.nan] is treated as the maximal
-   * double value.
-   *
-   * The arguments [lowerLimit] and [upperLimit] must form a valid range where
-   * `lowerLimit.compareTo(upperLimit) <= 0`.
-   */
-  num clamp(num lowerLimit, num upperLimit);
-
-  /** Truncates this [num] to an integer and returns the result as an [int]. */
-  int toInt();
-
-  /**
-   * Return this [num] as a [double].
-   *
-   * If the number is not representable as a [double], an
-   * approximation is returned. For numerically large integers, the
-   * approximation may be infinite.
-   */
-  double toDouble();
-
-  /**
-   * Returns a decimal-point string-representation of `this`.
-   *
-   * Converts `this` to a [double] before computing the string representation.
-   *
-   * If the absolute value of `this` is greater or equal to `10^21` then this
-   * methods returns an exponential representation computed by
-   * `this.toStringAsExponential()`. Otherwise the result
-   * is the closest string representation with exactly [fractionDigits] digits
-   * after the decimal point. If [fractionDigits] equals 0 then the decimal
-   * point is omitted.
-   *
-   * The parameter [fractionDigits] must be an integer satisfying:
-   * `0 <= fractionDigits <= 20`.
-   *
-   * Examples:
-   *
-   *     1.toStringAsFixed(3);  // 1.000
-   *     (4321.12345678).toStringAsFixed(3);  // 4321.123
-   *     (4321.12345678).toStringAsFixed(5);  // 4321.12346
-   *     123456789012345.toStringAsFixed(3);  // 123456789012345.000
-   *     10000000000000000.toStringAsFixed(4); // 10000000000000000.0000
-   *     5.25.toStringAsFixed(0); // 5
-   */
-  String toStringAsFixed(int fractionDigits);
-
-  /**
-   * Returns an exponential string-representation of `this`.
-   *
-   * Converts `this` to a [double] before computing the string representation.
-   *
-   * If [fractionDigits] is given then it must be an integer satisfying:
-   * `0 <= fractionDigits <= 20`. In this case the string contains exactly
-   * [fractionDigits] after the decimal point. Otherwise, without the parameter,
-   * the returned string uses the shortest number of digits that accurately
-   * represent [this].
-   *
-   * If [fractionDigits] equals 0 then the decimal point is omitted.
-   * Examples:
-   *
-   *     1.toStringAsExponential();       // 1e+0
-   *     1.toStringAsExponential(3);      // 1.000e+0
-   *     123456.toStringAsExponential();  // 1.23456e+5
-   *     123456.toStringAsExponential(3); // 1.235e+5
-   *     123.toStringAsExponential(0);    // 1e+2
-   */
-  String toStringAsExponential([int? fractionDigits]);
-
-  /**
-   * Converts `this` to a double and returns a string representation with
-   * exactly [precision] significant digits.
-   *
-   * The parameter [precision] must be an integer satisfying:
-   * `1 <= precision <= 21`.
-   *
-   * Examples:
-   *
-   *     1.toStringAsPrecision(2);       // 1.0
-   *     1e15.toStringAsPrecision(3);    // 1.00e+15
-   *     1234567.toStringAsPrecision(3); // 1.23e+6
-   *     1234567.toStringAsPrecision(9); // 1234567.00
-   *     12345678901234567890.toStringAsPrecision(20); // 12345678901234567168
-   *     12345678901234567890.toStringAsPrecision(14); // 1.2345678901235e+19
-   *     0.00000012345.toStringAsPrecision(15); // 1.23450000000000e-7
-   *     0.0000012345.toStringAsPrecision(15);  // 0.00000123450000000000
-   */
-  String toStringAsPrecision(int precision);
-
-  /**
-   * Returns the shortest string that correctly represent the input number.
-   *
-   * All [double]s in the range `10^-6` (inclusive) to `10^21` (exclusive)
-   * are converted to their decimal representation with at least one digit
-   * after the decimal point. For all other doubles,
-   * except for special values like `NaN` or `Infinity`, this method returns an
-   * exponential representation (see [toStringAsExponential]).
-   *
-   * Returns `"NaN"` for [double.nan], `"Infinity"` for [double.infinity], and
-   * `"-Infinity"` for [double.negativeInfinity].
-   *
-   * An [int] is converted to a decimal representation with no decimal point.
-   *
-   * Examples:
-   *
-   *     (0.000001).toString();  // "0.000001"
-   *     (0.0000001).toString(); // "1e-7"
-   *     (111111111111111111111.0).toString();  // "111111111111111110000.0"
-   *     (100000000000000000000.0).toString();  // "100000000000000000000.0"
-   *     (1000000000000000000000.0).toString(); // "1e+21"
-   *     (1111111111111111111111.0).toString(); // "1.1111111111111111e+21"
-   *     1.toString(); // "1"
-   *     111111111111111111111.toString();  // "111111111111111110000"
-   *     100000000000000000000.toString();  // "100000000000000000000"
-   *     1000000000000000000000.toString(); // "1000000000000000000000"
-   *     1111111111111111111111.toString(); // "1111111111111111111111"
-   *     1.234e5.toString();   // 123400
-   *     1234.5e6.toString();  // 1234500000
-   *     12.345e67.toString(); // 1.2345e+68
-   *
-   * Note: the conversion may round the output if the returned string
-   * is accurate enough to uniquely identify the input-number.
-   * For example the most precise representation of the [double] `9e59` equals
-   * `"899999999999999918767229449717619953810131273674690656206848"`, but
-   * this method returns the shorter (but still uniquely identifying) `"9e59"`.
-   *
-   */
-  String toString();
-
-  /**
-   * Parses a string containing a number literal into a number.
-   *
-   * The method first tries to read the [input] as integer (similar to
-   * [int.parse] without a radix).
-   * If that fails, it tries to parse the [input] as a double (similar to
-   * [double.parse]).
-   * If that fails, too, it invokes [onError] with [input], and the result
-   * of that invocation becomes the result of calling `parse`.
-   *
-   * If no [onError] is supplied, it defaults to a function that throws a
-   * [FormatException].
-   *
-   * For any number `n`, this function satisfies
-   * `identical(n, num.parse(n.toString()))` (except when `n` is a NaN `double`
-   * with a payload).
-   *
-   * The [onError] parameter is deprecated and will be removed.
-   * Instead of `num.parse(string, (string) { ... })`,
-   * you should use `num.tryParse(string) ?? (...)`.
-   */
-  static num parse(String input, [@deprecated num onError(String input)?]) {
-    num? result = tryParse(input);
-    if (result != null) return result;
-    if (onError == null) throw FormatException(input);
-    return onError(input);
-  }
-
-  /**
-   * Parses a string containing a number literal into a number.
-   *
-   * Like [parse] except that this function returns `null` for invalid inputs
-   * instead of throwing.
-   */
-  static num? tryParse(String input) {
-    String source = input.trim();
-    // TODO(lrn): Optimize to detect format and result type in one check.
-    return int.tryParse(source) ?? double.tryParse(source);
-  }
-}
diff --git a/sdk_nnbd/lib/core/object.dart b/sdk_nnbd/lib/core/object.dart
deleted file mode 100644
index 31602df..0000000
--- a/sdk_nnbd/lib/core/object.dart
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * The base class for all Dart objects.
- *
- * Because Object is the root of the Dart class hierarchy,
- * every other Dart class is a subclass of Object.
- *
- * When you define a class, you should override [toString]
- * to return a string describing an instance of that class.
- * You might also need to define [hashCode] and [operator ==], as described in the
- * [Implementing map
- * keys](https://www.dartlang.org/docs/dart-up-and-running/ch03.html#implementing-map-keys)
- * section of the [library
- * tour](http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html).
- */
-@pragma("vm:entry-point")
-class Object {
-  /**
-   * Creates a new [Object] instance.
-   *
-   * [Object] instances have no meaningful state, and are only useful
-   * through their identity. An [Object] instance is equal to itself
-   * only.
-   */
-  const Object();
-
-  /**
-   * The equality operator.
-   *
-   * The default behavior for all [Object]s is to return true if and
-   * only if `this` and [other] are the same object.
-   *
-   * Override this method to specify a different equality relation on
-   * a class. The overriding method must still be an equivalence relation.
-   * That is, it must be:
-   *
-   *  * Total: It must return a boolean for all arguments. It should never throw
-   *    or return `null`.
-   *
-   *  * Reflexive: For all objects `o`, `o == o` must be true.
-   *
-   *  * Symmetric: For all objects `o1` and `o2`, `o1 == o2` and `o2 == o1` must
-   *    either both be true, or both be false.
-   *
-   *  * Transitive: For all objects `o1`, `o2`, and `o3`, if `o1 == o2` and
-   *    `o2 == o3` are true, then `o1 == o3` must be true.
-   *
-   * The method should also be consistent over time,
-   * so whether two objects are equal should only change
-   * if at least one of the objects was modified.
-   *
-   * If a subclass overrides the equality operator it should override
-   * the [hashCode] method as well to maintain consistency.
-   */
-  external bool operator ==(Object other);
-
-  /**
-   * The hash code for this object.
-   *
-   * A hash code is a single integer which represents the state of the object
-   * that affects [operator ==] comparisons.
-   *
-   * All objects have hash codes.
-   * The default hash code represents only the identity of the object,
-   * the same way as the default [operator ==] implementation only considers objects
-   * equal if they are identical (see [identityHashCode]).
-   *
-   * If [operator ==] is overridden to use the object state instead,
-   * the hash code must also be changed to represent that state.
-   *
-   * Hash codes must be the same for objects that are equal to each other
-   * according to [operator ==].
-   * The hash code of an object should only change if the object changes
-   * in a way that affects equality.
-   * There are no further requirements for the hash codes.
-   * They need not be consistent between executions of the same program
-   * and there are no distribution guarantees.
-   *
-   * Objects that are not equal are allowed to have the same hash code,
-   * it is even technically allowed that all instances have the same hash code,
-   * but if clashes happen too often, it may reduce the efficiency of hash-based
-   * data structures like [HashSet] or [HashMap].
-   *
-   * If a subclass overrides [hashCode], it should override the
-   * [operator ==] operator as well to maintain consistency.
-   */
-  external int get hashCode;
-
-  /**
-   * Returns a string representation of this object.
-   */
-  external String toString();
-
-  /**
-   * Invoked when a non-existent method or property is accessed.
-   *
-   * Classes can override [noSuchMethod] to provide custom behavior.
-   *
-   * If a value is returned, it becomes the result of the original invocation.
-   *
-   * The default behavior is to throw a [NoSuchMethodError].
-   */
-  @pragma("vm:entry-point")
-  external dynamic noSuchMethod(Invocation invocation);
-
-  /**
-   * A representation of the runtime type of the object.
-   */
-  external Type get runtimeType;
-}
diff --git a/sdk_nnbd/lib/core/pattern.dart b/sdk_nnbd/lib/core/pattern.dart
deleted file mode 100644
index 7a3d933..0000000
--- a/sdk_nnbd/lib/core/pattern.dart
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * An interface for basic searches within strings.
- */
-abstract class Pattern {
-  /**
-   * Match this pattern against the string repeatedly.
-   *
-   * If [start] is provided, matching will start at that index.
-   *
-   * The returned iterable lazily computes all the non-overlapping matches
-   * of the pattern on the string, ordered by start index.
-   * If a user only requests the first
-   * match, this function should not compute all possible matches.
-   *
-   * The matches are found by repeatedly finding the first match
-   * of the pattern on the string, starting from the end of the previous
-   * match, and initially starting from index zero.
-   *
-   * If the pattern matches the empty string at some point, the next
-   * match is found by starting at the previous match's end plus one.
-   */
-  Iterable<Match> allMatches(String string, [int start = 0]);
-
-  /**
-   * Match this pattern against the start of `string`.
-   *
-   * If [start] is provided, it must be an integer in the range `0` ..
-   * `string.length`. In that case, this patten is tested against the
-   * string at the [start] position. That is, a [Match] is returned if the
-   * pattern can match a part of the string starting from position [start].
-   * Returns `null` if the pattern doesn't match.
-   */
-  Match? matchAsPrefix(String string, [int start = 0]);
-}
-
-/**
- * A result from searching within a string.
- *
- * A Match or an [Iterable] of Match objects is returned from [Pattern]
- * matching methods.
- *
- * The following example finds all matches of a [RegExp] in a [String]
- * and iterates through the returned iterable of Match objects.
- *
- *     RegExp exp = new RegExp(r"(\w+)");
- *     String str = "Parse my string";
- *     Iterable<Match> matches = exp.allMatches(str);
- *     for (Match m in matches) {
- *       String match = m.group(0);
- *       print(match);
- *     }
- *
- * The output of the example is:
- *
- *     Parse
- *     my
- *     string
- *
- * Some patterns, regular expressions in particular, may record substrings
- * that were part of the matching. These are called _groups_ in the Match
- * object. Some patterns may never have any groups, and their matches always
- * have zero [groupCount].
- */
-abstract class Match {
-  /**
-   * Returns the index in the string where the match starts.
-   */
-  int get start;
-
-  /**
-   * Returns the index in the string after the last character of the
-   * match.
-   */
-  int get end;
-
-  /**
-   * Returns the string matched by the given [group].
-   *
-   * If [group] is 0, returns the match of the pattern.
-   *
-   * The result may be `null` if the pattern didn't assign a value to it
-   * as part of this match.
-   */
-  String? group(int group);
-
-  /**
-   * Returns the string matched by the given [group].
-   *
-   * If [group] is 0, returns the match of the pattern.
-   *
-   * Short alias for [Match.group].
-   */
-  String? operator [](int group);
-
-  /**
-   * Returns a list of the groups with the given indices.
-   *
-   * The list contains the strings returned by [group] for each index in
-   * [groupIndices].
-   */
-  List<String?> groups(List<int> groupIndices);
-
-  /**
-   * Returns the number of captured groups in the match.
-   *
-   * Some patterns may capture parts of the input that was used to
-   * compute the full match. This is the number of captured groups,
-   * which is also the maximal allowed argument to the [group] method.
-   */
-  int get groupCount;
-
-  /**
-   * The string on which this match was computed.
-   */
-  String get input;
-
-  /**
-   * The pattern used to search in [input].
-   */
-  Pattern get pattern;
-}
diff --git a/sdk_nnbd/lib/core/print.dart b/sdk_nnbd/lib/core/print.dart
deleted file mode 100644
index d88ea7f..0000000
--- a/sdk_nnbd/lib/core/print.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/// Prints a string representation of the object to the console.
-void print(Object? object) {
-  String line = object.toString();
-  var toZone = printToZone;
-  if (toZone == null) {
-    printToConsole(line);
-  } else {
-    toZone(line);
-  }
-}
diff --git a/sdk_nnbd/lib/core/regexp.dart b/sdk_nnbd/lib/core/regexp.dart
deleted file mode 100644
index b75882d..0000000
--- a/sdk_nnbd/lib/core/regexp.dart
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * A regular expression pattern.
- *
- * Regular expressions are [Pattern]s, and can as such be used to match strings
- * or parts of strings.
- *
- * Dart regular expressions have the same syntax and semantics as
- * JavaScript regular expressions. See
- * <https://ecma-international.org/ecma-262/9.0/#sec-regexp-regular-expression-objects>
- * for the specification of JavaScript regular expressions.
- *
- * [firstMatch] is the main implementation method that applies a regular
- * expression to a string and returns the first [RegExpMatch]. All
- * other methods in [RegExp] can build on it.
- *
- * Use [allMatches] to look for all matches of a regular expression in
- * a string.
- *
- * The following example finds all matches of a regular expression in
- * a string.
- * ```dart
- * RegExp exp = new RegExp(r"(\w+)");
- * String str = "Parse my string";
- * Iterable<RegExpMatch> matches = exp.allMatches(str);
- * ```
- *
- * Note the use of a _raw string_ (a string prefixed with `r`)
- * in the example above. Use a raw string to treat each character in a string
- * as a literal character.
- */
-abstract class RegExp implements Pattern {
-  /**
-   * Constructs a regular expression.
-   *
-   * Throws a [FormatException] if [source] is not valid regular
-   * expression syntax.
-   *
-   * If `multiLine` is enabled, then `^` and `$` will match the beginning and
-   * end of a _line_, in addition to matching beginning and end of input,
-   * respectively.
-   *
-   * If `caseSensitive` is disabled, then case is ignored.
-   *
-   * If `unicode` is enabled, then the pattern is treated as a Unicode
-   * pattern as described by the ECMAScript standard.
-   *
-   * If `dotAll` is enabled, then the `.` pattern will match _all_ characters,
-   * including line terminators.
-   *
-   * Example:
-   *
-   * ```dart
-   * var wordPattern = RegExp(r"(\w+)");
-   * var bracketedNumberValue = RegExp("$key: \\[\\d+\\]");
-   * ```
-   *
-   * Notice the use of a _raw string_ in the first example, and a regular
-   * string in the second. Because of the many character classes used in
-   * regular expressions, it is common to use a raw string here, unless string
-   * interpolation is required.
-   */
-  external factory RegExp(String source,
-      {bool multiLine = false,
-      bool caseSensitive = true,
-      @Since("2.4") bool unicode = false,
-      @Since("2.4") bool dotAll = false});
-
-  /**
-   * Returns a regular expression that matches [text].
-   *
-   * If [text] contains characters that are meaningful in regular expressions,
-   * the resulting regular expression will match those characters literally.
-   * If [text] contains no characters that have special meaning in a regular
-   * expression, it is returned unmodified.
-   *
-   * The characters that have special meaning in regular expressions are:
-   * `(`, `)`, `[`, `]`, `{`, `}`, `*`, `+`, `?`, `.`, `^`, `$`, `|` and `\`.
-   */
-  external static String escape(String text);
-
-  /**
-   * Searches for the first match of the regular expression
-   * in the string [input]. Returns `null` if there is no match.
-   */
-  RegExpMatch? firstMatch(String input);
-
-  /**
-   * Returns an iterable of the matches of the regular expression on [input].
-   *
-   * If [start] is provided, only start looking for matches at `start`.
-   */
-  Iterable<RegExpMatch> allMatches(String input, [int start = 0]);
-
-  /**
-   * Returns whether the regular expression has a match in the string [input].
-   */
-  bool hasMatch(String input);
-
-  /**
-   * Returns the first substring match of this regular expression in [input].
-   */
-  String? stringMatch(String input);
-
-  /**
-   * The source regular expression string used to create this `RegExp`.
-   */
-  String get pattern;
-
-  /**
-   * Whether this regular expression matches multiple lines.
-   *
-   * If the regexp does match multiple lines, the "^" and "$" characters
-   * match the beginning and end of lines. If not, the character match the
-   * beginning and end of the input.
-   */
-  bool get isMultiLine;
-
-  /**
-   * Whether this regular expression is case sensitive.
-   *
-   * If the regular expression is not case sensitive, it will match an input
-   * letter with a pattern letter even if the two letters are different case
-   * versions of the same letter.
-   */
-  bool get isCaseSensitive;
-
-  /**
-   * Whether this regular expression is in Unicode mode.
-   *
-   * In Unicode mode, UTF-16 surrogate pairs in the original string will be
-   * treated as a single code point and will not match separately. Otherwise,
-   * the target string will be treated purely as a sequence of individual code
-   * units and surrogates will not be treated specially.
-   *
-   * In Unicode mode, the syntax of the RegExp pattern is more restricted, but
-   * some pattern features, like Unicode property escapes, are only available in
-   * this mode.
-   */
-  @Since("2.4")
-  bool get isUnicode;
-
-  /**
-   * Whether "." in this regular expression matches line terminators.
-   *
-   * When false, the "." character matches a single character, unless that
-   * character is a line terminator. When true, then the "." character will
-   * match any single character including line terminators.
-   *
-   * This feature is distinct from [isMultiline], as they affect the behavior
-   * of different pattern characters, and so they can be used together or
-   * separately.
-   */
-  @Since("2.4")
-  bool get isDotAll;
-}
-
-/**
- * A regular expression match.
- *
- * Regular expression matches are [Match]es, but also include the ability
- * to retrieve the names for any named capture groups and to retrieve
- * matches for named capture groups by name instead of their index.
- */
-@Since("2.3")
-abstract class RegExpMatch implements Match {
-  /**
-   * The string matched by the group named [name].
-   *
-   * Returns the string matched by the capture group named [name], or
-   * `null` if no string was matched by that capture group as part of
-   * this match.
-   *
-   * The [name] must be the name of a named capture group in the regular
-   * expression creating this match (that is, the name must be in
-   * [groupNames]).
-   */
-  String? namedGroup(String name);
-
-  /**
-   * The names of the captured groups in the match.
-   */
-  Iterable<String> get groupNames;
-}
diff --git a/sdk_nnbd/lib/core/set.dart b/sdk_nnbd/lib/core/set.dart
deleted file mode 100644
index ae1e381..0000000
--- a/sdk_nnbd/lib/core/set.dart
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * A collection of objects in which each object can occur only once.
- *
- * That is, for each object of the element type, the object is either considered
- * to be in the set, or to _not_ be in the set.
- *
- * Set implementations may consider some elements indistinguishable. These
- * elements are treated as being the same for any operation on the set.
- *
- * The default [Set] implementation, [LinkedHashSet], considers objects
- * indistinguishable if they are equal with regard to
- * operator [Object.==].
- *
- * Iterating over elements of a set may be either unordered
- * or ordered in some way. Examples:
- *
- * * A [HashSet] is unordered, which means that its iteration order is
- *   unspecified,
- * * [LinkedHashSet] iterates in the insertion order of its elements, and
- * * a sorted set like [SplayTreeSet] iterates the elements in sorted order.
- *
- * It is generally not allowed to modify the set (add or remove elements) while
- * an operation on the set is being performed, for example during a call to
- * [forEach] or [containsAll]. Nor is it allowed to modify the set while
- * iterating either the set itself or any [Iterable] that is backed by the set,
- * such as the ones returned by methods like [where] and [map].
- *
- * It is generally not allowed to modify the equality of elements (and thus not
- * their hashcode) while they are in the set. Some specialized subtypes may be
- * more permissive, in which case they should document this behavior.
- */
-abstract class Set<E> extends EfficientLengthIterable<E> {
-  /**
-   * Creates an empty [Set].
-   *
-   * The created [Set] is a plain [LinkedHashSet].
-   * As such, it considers elements that are equal (using [operator ==]) to be
-   * indistinguishable, and requires them to have a compatible
-   * [Object.hashCode] implementation.
-   *
-   * The set is equivalent to one created by `new LinkedHashSet<E>()`.
-   */
-  factory Set() = LinkedHashSet<E>;
-
-  /**
-   * Creates an empty identity [Set].
-   *
-   * The created [Set] is a [LinkedHashSet] that uses identity as equality
-   * relation.
-   *
-   * The set is equivalent to one created by `new LinkedHashSet<E>.identity()`.
-   */
-  factory Set.identity() = LinkedHashSet<E>.identity;
-
-  /**
-   * Creates a [Set] that contains all [elements].
-   *
-   * All the [elements] should be instances of [E].
-   * The `elements` iterable itself can have any type,
-   * so this constructor can be used to down-cast a `Set`, for example as:
-   *
-   *     Set<SuperType> superSet = ...;
-   *     Set<SubType> subSet =
-   *         new Set<SubType>.from(superSet.where((e) => e is SubType));
-   *
-   * The created [Set] is a [LinkedHashSet]. As such, it considers elements that
-   * are equal (using [operator ==]) to be indistinguishable, and requires them to
-   * have a compatible [Object.hashCode] implementation.
-   *
-   * The set is equivalent to one created by
-   * `new LinkedHashSet<E>.from(elements)`.
-   */
-  factory Set.from(Iterable elements) = LinkedHashSet<E>.from;
-
-  /**
-   * Creates a [Set] from [elements].
-   *
-   * The created [Set] is a [LinkedHashSet]. As such, it considers elements that
-   * are equal (using [operator ==]) to be indistinguishable, and requires them to
-   * have a compatible [Object.hashCode] implementation.
-   *
-   * The set is equivalent to one created by
-   * `new LinkedHashSet<E>.of(elements)`.
-   */
-  factory Set.of(Iterable<E> elements) = LinkedHashSet<E>.of;
-
-  /**
-   * Adapts [source] to be a `Set<T>`.
-   *
-   * If [newSet] is provided, it is used to create the new sets returned
-   * by [toSet], [union], and is also used for [intersection] and [difference].
-   * If [newSet] is omitted, it defaults to creating a new set using the
-   * default [Set] constructor, and [intersection] and [difference]
-   * returns an adapted version of calling the same method on the source.
-   *
-   * Any time the set would produce an element that is not a [T],
-   * the element access will throw.
-   *
-   * Any time a [T] value is attempted added into the adapted set,
-   * the store will throw unless the value is also an instance of [S].
-   *
-   * If all accessed elements of [source] are actually instances of [T],
-   * and if all elements added to the returned set are actually instance
-   * of [S],
-   * then the returned set can be used as a `Set<T>`.
-   */
-  static Set<T> castFrom<S, T>(Set<S> source, {Set<R> Function<R>()? newSet}) =>
-      CastSet<S, T>(source, newSet);
-
-  /**
-   * Provides a view of this set as a set of [R] instances.
-   *
-   * If this set contains only instances of [R], all read operations
-   * will work correctly. If any operation tries to access an element
-   * that is not an instance of [R], the access will throw instead.
-   *
-   * Elements added to the set (e.g., by using [add] or [addAll])
-   * must be instance of [R] to be valid arguments to the adding function,
-   * and they must be instances of [E] as well to be accepted by
-   * this set as well.
-   */
-  Set<R> cast<R>();
-
-  /**
-   * Provides an iterator that iterates over the elements of this set.
-   *
-   * The order of iteration is defined by the individual `Set` implementation,
-   * but must be consistent between changes to the set.
-   */
-  Iterator<E> get iterator;
-
-  /**
-   * Returns true if [value] is in the set.
-   */
-  bool contains(Object? value);
-
-  /**
-   * Adds [value] to the set.
-   *
-   * Returns `true` if [value] (or an equal value) was not yet in the set.
-   * Otherwise returns `false` and the set is not changed.
-   *
-   * Example:
-   *
-   *     var set = new Set();
-   *     var time1 = new DateTime.fromMillisecondsSinceEpoch(0);
-   *     var time2 = new DateTime.fromMillisecondsSinceEpoch(0);
-   *     // time1 and time2 are equal, but not identical.
-   *     Expect.isTrue(time1 == time2);
-   *     Expect.isFalse(identical(time1, time2));
-   *     set.add(time1);  // => true.
-   *     // A value equal to time2 exists already in the set, and the call to
-   *     // add doesn't change the set.
-   *     set.add(time2);  // => false.
-   *     Expect.isTrue(set.length == 1);
-   *     Expect.isTrue(identical(time1, set.first));
-   */
-  bool add(E value);
-
-  /**
-   * Adds all [elements] to this Set.
-   *
-   * Equivalent to adding each element in [elements] using [add],
-   * but some collections may be able to optimize it.
-   */
-  void addAll(Iterable<E> elements);
-
-  /**
-   * Removes [value] from the set. Returns true if [value] was
-   * in the set. Returns false otherwise. The method has no effect
-   * if [value] value was not in the set.
-   */
-  bool remove(Object? value);
-
-  /**
-   * If an object equal to [object] is in the set, return it.
-   *
-   * Checks whether [object] is in the set, like [contains], and if so,
-   * returns the object in the set, otherwise returns `null`.
-   *
-   * If the equality relation used by the set is not identity,
-   * then the returned object may not be *identical* to [object].
-   * Some set implementations may not be able to implement this method.
-   * If the [contains] method is computed,
-   * rather than being based on an actual object instance,
-   * then there may not be a specific object instance representing the
-   * set element.
-   */
-  E? lookup(Object? object);
-
-  /**
-   * Removes each element of [elements] from this set.
-   */
-  void removeAll(Iterable<Object?> elements);
-
-  /**
-   * Removes all elements of this set that are not elements in [elements].
-   *
-   * Checks for each element of [elements] whether there is an element in this
-   * set that is equal to it (according to `this.contains`), and if so, the
-   * equal element in this set is retained, and elements that are not equal
-   * to any element in `elements` are removed.
-   */
-  void retainAll(Iterable<Object?> elements);
-
-  /**
-   * Removes all elements of this set that satisfy [test].
-   */
-  void removeWhere(bool test(E element));
-
-  /**
-   * Removes all elements of this set that fail to satisfy [test].
-   */
-  void retainWhere(bool test(E element));
-
-  /**
-   * Returns whether this Set contains all the elements of [other].
-   */
-  bool containsAll(Iterable<Object?> other);
-
-  /**
-   * Returns a new set which is the intersection between this set and [other].
-   *
-   * That is, the returned set contains all the elements of this [Set] that
-   * are also elements of [other] according to `other.contains`.
-   */
-  Set<E> intersection(Set<Object?> other);
-
-  /**
-   * Returns a new set which contains all the elements of this set and [other].
-   *
-   * That is, the returned set contains all the elements of this [Set] and
-   * all the elements of [other].
-   */
-  Set<E> union(Set<E> other);
-
-  /**
-   * Returns a new set with the elements of this that are not in [other].
-   *
-   * That is, the returned set contains all the elements of this [Set] that
-   * are not elements of [other] according to `other.contains`.
-   */
-  Set<E> difference(Set<Object?> other);
-
-  /**
-   * Removes all elements in the set.
-   */
-  void clear();
-
-  /* Creates a [Set] with the same elements and behavior as this `Set`.
-   *
-   * The returned set behaves the same as this set
-   * with regard to adding and removing elements.
-   * It initially contains the same elements.
-   * If this set specifies an ordering of the elements,
-   * the returned set will have the same order.
-   */
-  Set<E> toSet();
-}
diff --git a/sdk_nnbd/lib/core/sink.dart b/sdk_nnbd/lib/core/sink.dart
deleted file mode 100644
index c79214b..0000000
--- a/sdk_nnbd/lib/core/sink.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2014, 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.
-
-part of dart.core;
-
-/**
- * A generic destination for data.
- *
- * Multiple data values can be put into a sink, and when no more data is
- * available, the sink should be closed.
- *
- * This is a generic interface that other data receivers can implement.
- */
-abstract class Sink<T> {
-  /**
-   * Adds [data] to the sink.
-   *
-   * Must not be called after a call to [close].
-   */
-  void add(T data);
-
-  /**
-   * Closes the sink.
-   *
-   * The [add] method must not be called after this method.
-   *
-   * Calling this method more than once is allowed, but does nothing.
-   */
-  void close();
-}
diff --git a/sdk_nnbd/lib/core/stacktrace.dart b/sdk_nnbd/lib/core/stacktrace.dart
deleted file mode 100644
index ef08f71..0000000
--- a/sdk_nnbd/lib/core/stacktrace.dart
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.core;
-
-/**
- * An interface implemented by all stack trace objects.
- *
- * A [StackTrace] is intended to convey information to the user about the call
- * sequence that triggered an exception.
- *
- * These objects are created by the runtime, it is not possible to create
- * them programmatically.
- */
-abstract class StackTrace {
-  /// A stack trace object with no information.
-  ///
-  /// This stack trace is used as the default in situations where
-  /// a stack trace is required, but the user has not supplied one.
-  @Since("2.8")
-  static const empty = const _StringStackTrace("");
-
-  StackTrace(); // In case existing classes extend StackTrace.
-
-  /**
-   * Create a `StackTrace` object from [stackTraceString].
-   *
-   * The created stack trace will have a `toString` method returning
-   * `stackTraceString`.
-   *
-   * The `stackTraceString` can be a string returned by some other
-   * stack trace, or it can be any string at all.
-   * If the string doesn't look like a stack trace, code that interprets
-   * stack traces is likely to fail, so fake stack traces should be used
-   * with care.
-   */
-  factory StackTrace.fromString(String stackTraceString) = _StringStackTrace;
-
-  /**
-   * Returns a representation of the current stack trace.
-   *
-   * This is similar to what can be achieved by doing:
-   *
-   *     try { throw 0; } catch (_, stack) { return stack; }
-   *
-   * The getter achieves this without throwing, except on platforms that
-   * have no other way to get a stack trace.
-   */
-  external static StackTrace get current;
-
-  /**
-   * Returns a [String] representation of the stack trace.
-   *
-   * The string represents the full stack trace starting from
-   * the point where a throw occurred to the top of the current call sequence.
-   *
-   * The exact format of the string representation is not final.
-   */
-  String toString();
-}
-
-class _StringStackTrace implements StackTrace {
-  final String _stackTrace;
-  const _StringStackTrace(this._stackTrace);
-  String toString() => _stackTrace;
-}
diff --git a/sdk_nnbd/lib/core/stopwatch.dart b/sdk_nnbd/lib/core/stopwatch.dart
deleted file mode 100644
index 311db3d..0000000
--- a/sdk_nnbd/lib/core/stopwatch.dart
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * A simple stopwatch interface to measure elapsed time.
- */
-class Stopwatch {
-  /**
-   * Cached frequency of the system in Hz (ticks per second).
-   *
-   * Value must be returned by [_initTicker], which is called only once.
-   */
-  static final int _frequency = _initTicker();
-
-  // The _start and _stop fields capture the time when [start] and [stop]
-  // are called respectively.
-  // If _stop is null, the stopwatch is running.
-  int _start = 0;
-  int? _stop = 0;
-
-  /**
-   * Creates a [Stopwatch] in stopped state with a zero elapsed count.
-   *
-   * The following example shows how to start a [Stopwatch]
-   * immediately after allocation.
-   * ```
-   * var stopwatch = new Stopwatch()..start();
-   * ```
-   */
-  Stopwatch() {
-    _frequency; // Ensures initialization before using any method.
-  }
-
-  /**
-   * Frequency of the elapsed counter in Hz.
-   */
-  int get frequency => _frequency;
-
-  /**
-   * Starts the [Stopwatch].
-   *
-   * The [elapsed] count is increasing monotonically. If the [Stopwatch] has
-   * been stopped, then calling start again restarts it without resetting the
-   * [elapsed] count.
-   *
-   * If the [Stopwatch] is currently running, then calling start does nothing.
-   */
-  void start() {
-    int? stop = _stop;
-    if (stop != null) {
-      // (Re)start this stopwatch.
-      // Don't count the time while the stopwatch has been stopped.
-      _start += _now() - stop;
-      _stop = null;
-    }
-  }
-
-  /**
-   * Stops the [Stopwatch].
-   *
-   * The [elapsedTicks] count stops increasing after this call. If the
-   * [Stopwatch] is currently not running, then calling this method has no
-   * effect.
-   */
-  void stop() {
-    _stop ??= _now();
-  }
-
-  /**
-   * Resets the [elapsed] count to zero.
-   *
-   * This method does not stop or start the [Stopwatch].
-   */
-  void reset() {
-    _start = _stop ?? _now();
-  }
-
-  /**
-   * The elapsed number of clock ticks since calling [start] while the
-   * [Stopwatch] is running.
-   *
-   * This is the elapsed number of clock ticks between calling [start] and
-   * calling [stop].
-   *
-   * Is 0 if the [Stopwatch] has never been started.
-   *
-   * The elapsed number of clock ticks increases by [frequency] every second.
-   */
-  int get elapsedTicks {
-    return (_stop ?? _now()) - _start;
-  }
-
-  /**
-   * The [elapsedTicks] counter converted to a [Duration].
-   */
-  Duration get elapsed {
-    return Duration(microseconds: elapsedMicroseconds);
-  }
-
-  /**
-   * The [elapsedTicks] counter converted to microseconds.
-   */
-  external int get elapsedMicroseconds;
-
-  /**
-   * The [elapsedTicks] counter converted to milliseconds.
-   */
-  external int get elapsedMilliseconds;
-
-  /**
-   * Whether the [Stopwatch] is currently running.
-   */
-  bool get isRunning => _stop == null;
-
-  /**
-   * Initializes the time-measuring system. *Must* return the [_frequency]
-   * variable. May do other necessary initialization.
-   */
-  external static int _initTicker();
-  external static int _now();
-}
diff --git a/sdk_nnbd/lib/core/string.dart b/sdk_nnbd/lib/core/string.dart
deleted file mode 100644
index 4a353b2..0000000
--- a/sdk_nnbd/lib/core/string.dart
+++ /dev/null
@@ -1,840 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * A sequence of UTF-16 code units.
- *
- * Strings are mainly used to represent text. A character may be represented by
- * multiple code points, each code point consisting of one or two code
- * units. For example the Papua New Guinea flag character requires four code
- * units to represent two code points, but should be treated like a single
- * character: "🇵🇬". Platforms that do not support the flag character may show
- * the letters "PG" instead. If the code points are swapped, it instead becomes
- * the Guadeloupe flag "🇬🇵" ("GP").
- *
- * A string can be either single or multiline. Single line strings are
- * written using matching single or double quotes, and multiline strings are
- * written using triple quotes. The following are all valid Dart strings:
- *
- *     'Single quotes';
- *     "Double quotes";
- *     'Double quotes in "single" quotes';
- *     "Single quotes in 'double' quotes";
- *
- *     '''A
- *     multiline
- *     string''';
- *
- *     """
- *     Another
- *     multiline
- *     string""";
- *
- * Strings are immutable. Although you cannot change a string, you can perform
- * an operation on a string and assign the result to a new string:
- *
- *     var string = 'Dart is fun';
- *     var newString = string.substring(0, 5);
- *
- * You can use the plus (`+`) operator to concatenate strings:
- *
- *     'Dart ' + 'is ' + 'fun!'; // 'Dart is fun!'
- *
- * You can also use adjacent string literals for concatenation:
- *
- *     'Dart ' 'is ' 'fun!';    // 'Dart is fun!'
- *
- * You can use `${}` to interpolate the value of Dart expressions
- * within strings. The curly braces can be omitted when evaluating identifiers:
- *
- *     string = 'dartlang';
- *     '$string has ${string.length} letters'; // 'dartlang has 8 letters'
- *
- * A string is represented by a sequence of Unicode UTF-16 code units
- * accessible through the [codeUnitAt] or the [codeUnits] members:
- *
- *     string = 'Dart';
- *     string.codeUnitAt(0); // 68
- *     string.codeUnits;     // [68, 97, 114, 116]
- *
- * The string representation of code units is accessible through the index
- * operator:
- *
- *     string[0];            // 'D'
- *
- * The characters of a string are encoded in UTF-16. Decoding UTF-16, which
- * combines surrogate pairs, yields Unicode code points. Following a similar
- * terminology to Go, we use the name 'rune' for an integer representing a
- * Unicode code point. Use the [runes] property to get the runes of a string:
- *
- *     string.runes.toList(); // [68, 97, 114, 116]
- *
- * For a character outside the Basic Multilingual Plane (plane 0) that is
- * composed of a surrogate pair, [runes] combines the pair and returns a
- * single integer.  For example, the Unicode character for a
- * musical G-clef ('𝄞') with rune value 0x1D11E consists of a UTF-16 surrogate
- * pair: `0xD834` and `0xDD1E`. Using [codeUnits] returns the surrogate pair,
- * and using `runes` returns their combined value:
- *
- *     var clef = '\u{1D11E}';
- *     clef.codeUnits;         // [0xD834, 0xDD1E]
- *     clef.runes.toList();    // [0x1D11E]
- *
- * The String class can not be extended or implemented. Attempting to do so
- * yields a compile-time error.
- *
- * ## Other resources
- *
- * See [StringBuffer] to efficiently build a string incrementally. See
- * [RegExp] to work with regular expressions.
- *
- * Also see:
- *
- * * [Dart Cookbook](https://www.dartlang.org/docs/cookbook/#strings)
- *   for String examples and recipes.
- * * [Dart Up and Running](https://www.dartlang.org/docs/dart-up-and-running/ch03.html#strings-and-regular-expressions)
- */
-@pragma('vm:entry-point')
-abstract class String implements Comparable<String>, Pattern {
-  /**
-   * Allocates a new String for the specified [charCodes].
-   *
-   * The [charCodes] can be UTF-16 code units or runes. If a char-code value is
-   * 16-bit, it is copied verbatim:
-   *
-   *     new String.fromCharCodes([68]); // 'D'
-   *
-   * If a char-code value is greater than 16-bits, it is decomposed into a
-   * surrogate pair:
-   *
-   *     var clef = new String.fromCharCodes([0x1D11E]);
-   *     clef.codeUnitAt(0); // 0xD834
-   *     clef.codeUnitAt(1); // 0xDD1E
-   *
-   * If [start] and [end] is provided, only the values of [charCodes]
-   * at positions from `start` to, but not including, `end`, are used.
-   * The `start` and `end` values must satisfy
-   * `0 <= start <= end <= charCodes.length`.
-   */
-  external factory String.fromCharCodes(Iterable<int> charCodes,
-      [int start = 0, int? end]);
-
-  /**
-   * Allocates a new String for the specified [charCode].
-   *
-   * If the [charCode] can be represented by a single UTF-16 code unit, the new
-   * string contains a single code unit. Otherwise, the [length] is 2 and
-   * the code units form a surrogate pair. See documentation for
-   * [fromCharCodes].
-   *
-   * Creating a [String] with one half of a surrogate pair is allowed.
-   */
-  external factory String.fromCharCode(int charCode);
-
-  /**
-   * Returns the string value of the environment declaration [name].
-   *
-   * Environment declarations are provided by the surrounding system compiling
-   * or running the Dart program. Declarations map a string key to a string
-   * value.
-   *
-   * If [name] is not declared in the environment, the result is instead
-   * [defaultValue].
-   *
-   * Example of getting a value:
-   * ```
-   * const String.fromEnvironment("defaultFloo", defaultValue: "no floo")
-   * ```
-   * In order to check whether a declaration is there at all, use
-   * [bool.hasEnvironment]. Example:
-   * ```
-   * const maybeDeclared = bool.hasEnvironment("maybeDeclared")
-   *     ? String.fromEnvironment("maybeDeclared")
-   *     : null;
-   * ```
-   */
-  // The .fromEnvironment() constructors are special in that we do not want
-  // users to call them using "new". We prohibit that by giving them bodies
-  // that throw, even though const constructors are not allowed to have bodies.
-  // Disable those static errors.
-  //ignore: const_constructor_with_body
-  //ignore: const_factory
-  external const factory String.fromEnvironment(String name,
-      {String defaultValue = ""});
-
-  /**
-   * Gets the character (as a single-code-unit [String]) at the given [index].
-   *
-   * The returned string represents exactly one UTF-16 code unit, which may be
-   * half of a surrogate pair. A single member of a surrogate pair is an
-   * invalid UTF-16 string:
-   *
-   *     var clef = '\u{1D11E}';
-   *     // These represent invalid UTF-16 strings.
-   *     clef[0].codeUnits;      // [0xD834]
-   *     clef[1].codeUnits;      // [0xDD1E]
-   *
-   * This method is equivalent to
-   * `new String.fromCharCode(this.codeUnitAt(index))`.
-   */
-  String operator [](int index);
-
-  /**
-   * Returns the 16-bit UTF-16 code unit at the given [index].
-   */
-  int codeUnitAt(int index);
-
-  /**
-   * The length of the string.
-   *
-   * Returns the number of UTF-16 code units in this string. The number
-   * of [runes] might be fewer, if the string contains characters outside
-   * the Basic Multilingual Plane (plane 0):
-   *
-   *     'Dart'.length;          // 4
-   *     'Dart'.runes.length;    // 4
-   *
-   *     var clef = '\u{1D11E}';
-   *     clef.length;            // 2
-   *     clef.runes.length;      // 1
-   */
-  int get length;
-
-  /**
-   * Returns a hash code derived from the code units of the string.
-   *
-   * This is compatible with [operator ==]. Strings with the same sequence
-   * of code units have the same hash code.
-   */
-  int get hashCode;
-
-  /**
-   * Returns true if other is a `String` with the same sequence of code units.
-   *
-   * This method compares each individual code unit of the strings.
-   * It does not check for Unicode equivalence.
-   * For example, both the following strings represent the string 'Amélie',
-   * but due to their different encoding, are not equal:
-   *
-   *     'Am\xe9lie' == 'Ame\u{301}lie'; // false
-   *
-   * The first string encodes 'é' as a single unicode code unit (also
-   * a single rune), whereas the second string encodes it as 'e' with the
-   * combining accent character '◌́'.
-   */
-  bool operator ==(Object other);
-
-  /**
-   * Compares this string to [other].
-   *
-   * Returns a negative value if `this` is ordered before `other`,
-   * a positive value if `this` is ordered after `other`,
-   * or zero if `this` and `other` are equivalent.
-   *
-   * The ordering is the same as the ordering of the code points at the first
-   * position where the two strings differ.
-   * If one string is a prefix of the other,
-   * then the shorter string is ordered before the longer string.
-   * If the strings have exactly the same content, they are equivalent with
-   * regard to the ordering.
-   * Ordering does not check for Unicode equivalence.
-   * The comparison is case sensitive.
-   */
-  int compareTo(String other);
-
-  /**
-   * Returns true if this string ends with [other]. For example:
-   *
-   *     'Dart'.endsWith('t'); // true
-   */
-  bool endsWith(String other);
-
-  /**
-   * Returns true if this string starts with a match of [pattern].
-   *
-   *     var string = 'Dart';
-   *     string.startsWith('D');                       // true
-   *     string.startsWith(new RegExp(r'[A-Z][a-z]')); // true
-   *
-   * If [index] is provided, this method checks if the substring starting
-   * at that index starts with a match of [pattern]:
-   *
-   *     string.startsWith('art', 1);                  // true
-   *     string.startsWith(new RegExp(r'\w{3}'));      // true
-   *
-   * [index] must not be negative or greater than [length].
-   *
-   * A [RegExp] containing '^' does not match if the [index] is greater than
-   * zero. The pattern works on the string as a whole, and does not extract
-   * a substring starting at [index] first:
-   *
-   *     string.startsWith(new RegExp(r'^art'), 1);    // false
-   *     string.startsWith(new RegExp(r'art'), 1);     // true
-   */
-  bool startsWith(Pattern pattern, [int index = 0]);
-
-  /**
-   * Returns the position of the first match of [pattern] in this string,
-   * starting at [start], inclusive:
-   *
-   *     var string = 'Dartisans';
-   *     string.indexOf('art');                     // 1
-   *     string.indexOf(new RegExp(r'[A-Z][a-z]')); // 0
-   *
-   * Returns -1 if no match is found:
-   *
-   *     string.indexOf(new RegExp(r'dart'));       // -1
-   *
-   * [start] must be non-negative and not greater than [length].
-   */
-  int indexOf(Pattern pattern, [int start = 0]);
-
-  /**
-   * Returns the starting position of the last match [pattern] in this string,
-   * searching backward starting at [start], inclusive:
-   *
-   *     var string = 'Dartisans';
-   *     string.lastIndexOf('a');                    // 6
-   *     string.lastIndexOf(RegExp(r'a(r|n)'));      // 6
-   *
-   * Returns -1 if [pattern] could not be found in this string.
-   *
-   *     string.lastIndexOf(RegExp(r'DART'));        // -1
-   *
-   * If [start] is omitted, search starts from the end of the string.
-   * If supplied, [start] must be non-negative and not greater than [length].
-   */
-  int lastIndexOf(Pattern pattern, [int? start]);
-
-  /**
-   * Returns true if this string is empty.
-   */
-  bool get isEmpty;
-
-  /**
-   * Returns true if this string is not empty.
-   */
-  bool get isNotEmpty;
-
-  /**
-   * Creates a new string by concatenating this string with [other].
-   *
-   *     'dart' + 'lang'; // 'dartlang'
-   */
-  String operator +(String other);
-
-  /**
-   * Returns the substring of this string that extends from [startIndex],
-   * inclusive, to [endIndex], exclusive.
-   *
-   *     var string = 'dartlang';
-   *     string.substring(1);    // 'artlang'
-   *     string.substring(1, 4); // 'art'
-   */
-  String substring(int startIndex, [int? endIndex]);
-
-  /**
-   * Returns the string without any leading and trailing whitespace.
-   *
-   * If the string contains leading or trailing whitespace, a new string with no
-   * leading and no trailing whitespace is returned:
-   * ```dart
-   * '\tDart is fun\n'.trim(); // 'Dart is fun'
-   * ```
-   * Otherwise, the original string itself is returned:
-   * ```dart
-   * var str1 = 'Dart';
-   * var str2 = str1.trim();
-   * identical(str1, str2);    // true
-   * ```
-   * Whitespace is defined by the Unicode White_Space property (as defined in
-   * version 6.2 or later) and the BOM character, 0xFEFF.
-   *
-   * Here is the list of trimmed characters according to Unicode version 6.3:
-   * ```
-   *     0009..000D    ; White_Space # Cc   <control-0009>..<control-000D>
-   *     0020          ; White_Space # Zs   SPACE
-   *     0085          ; White_Space # Cc   <control-0085>
-   *     00A0          ; White_Space # Zs   NO-BREAK SPACE
-   *     1680          ; White_Space # Zs   OGHAM SPACE MARK
-   *     2000..200A    ; White_Space # Zs   EN QUAD..HAIR SPACE
-   *     2028          ; White_Space # Zl   LINE SEPARATOR
-   *     2029          ; White_Space # Zp   PARAGRAPH SEPARATOR
-   *     202F          ; White_Space # Zs   NARROW NO-BREAK SPACE
-   *     205F          ; White_Space # Zs   MEDIUM MATHEMATICAL SPACE
-   *     3000          ; White_Space # Zs   IDEOGRAPHIC SPACE
-   *
-   *     FEFF          ; BOM                ZERO WIDTH NO_BREAK SPACE
-   * ```
-   * Some later versions of Unicode do not include U+0085 as a whitespace
-   * character. Whether it is trimmed depends on the Unicode version
-   * used by the system.
-   */
-  String trim();
-
-  /**
-   * Returns the string without any leading whitespace.
-   *
-   * As [trim], but only removes leading whitespace.
-   */
-  String trimLeft();
-
-  /**
-   * Returns the string without any trailing whitespace.
-   *
-   * As [trim], but only removes trailing whitespace.
-   */
-  String trimRight();
-
-  /**
-   * Creates a new string by concatenating this string with itself a number
-   * of times.
-   *
-   * The result of `str * n` is equivalent to
-   * `str + str + ...`(n times)`... + str`.
-   *
-   * Returns an empty string if [times] is zero or negative.
-   */
-  String operator *(int times);
-
-  /**
-   * Pads this string on the left if it is shorter than [width].
-   *
-   * Return a new string that prepends [padding] onto this string
-   * one time for each position the length is less than [width].
-   *
-   * If [width] is already smaller than or equal to `this.length`,
-   * no padding is added. A negative `width` is treated as zero.
-   *
-   * If [padding] has length different from 1, the result will not
-   * have length `width`. This may be useful for cases where the
-   * padding is a longer string representing a single character, like
-   * `"&nbsp;"` or `"\u{10002}`".
-   * In that case, the user should make sure that `this.length` is
-   * the correct measure of the strings length.
-   */
-  String padLeft(int width, [String padding = ' ']);
-
-  /**
-   * Pads this string on the right if it is shorter than [width].
-   *
-   * Return a new string that appends [padding] after this string
-   * one time for each position the length is less than [width].
-   *
-   * If [width] is already smaller than or equal to `this.length`,
-   * no padding is added. A negative `width` is treated as zero.
-   *
-   * If [padding] has length different from 1, the result will not
-   * have length `width`. This may be useful for cases where the
-   * padding is a longer string representing a single character, like
-   * `"&nbsp;"` or `"\u{10002}`".
-   * In that case, the user should make sure that `this.length` is
-   * the correct measure of the strings length.
-   */
-  String padRight(int width, [String padding = ' ']);
-
-  /**
-   * Returns true if this string contains a match of [other]:
-   *
-   *     var string = 'Dart strings';
-   *     string.contains('D');                     // true
-   *     string.contains(new RegExp(r'[A-Z]'));    // true
-   *
-   * If [startIndex] is provided, this method matches only at or after that
-   * index:
-   *
-   *     string.contains('X', 1);                  // false
-   *     string.contains(new RegExp(r'[A-Z]'), 1); // false
-   *
-   * [startIndex] must not be negative or greater than [length].
-   */
-  bool contains(Pattern other, [int startIndex = 0]);
-
-  /**
-   * Returns a new string in which the first occurrence of [from] in this string
-   * is replaced with [to], starting from [startIndex]:
-   *
-   *     '0.0001'.replaceFirst(new RegExp(r'0'), ''); // '.0001'
-   *     '0.0001'.replaceFirst(new RegExp(r'0'), '7', 1); // '0.7001'
-   */
-  String replaceFirst(Pattern from, String to, [int startIndex = 0]);
-
-  /**
-   * Replace the first occurrence of [from] in this string.
-   *
-   * Returns a new string, which is this string
-   * except that the first match of [from], starting from [startIndex],
-   * is replaced by the result of calling [replace] with the match object.
-   *
-   * The optional [startIndex] is by default set to 0. If provided, it must be
-   * an integer in the range `[0 .. len]`, where `len` is this string's length.
-   */
-  String replaceFirstMapped(Pattern from, String replace(Match match),
-      [int startIndex = 0]);
-
-  /**
-   * Replaces all substrings that match [from] with [replace].
-   *
-   * Returns a new string in which the non-overlapping substrings matching
-   * [from] (the ones iterated by `from.allMatches(thisString)`) are replaced
-   * by the literal string [replace].
-   *
-   *     'resume'.replaceAll(new RegExp(r'e'), 'é'); // 'résumé'
-   *
-   * Notice that the [replace] string is not interpreted. If the replacement
-   * depends on the match (for example on a [RegExp]'s capture groups), use
-   * the [replaceAllMapped] method instead.
-   */
-  String replaceAll(Pattern from, String replace);
-
-  /**
-   * Replace all substrings that match [from] by a string computed from the
-   * match.
-   *
-   * Returns a new string in which the non-overlapping substrings that match
-   * [from] (the ones iterated by `from.allMatches(thisString)`) are replaced
-   * by the result of calling [replace] on the corresponding [Match] object.
-   *
-   * This can be used to replace matches with new content that depends on the
-   * match, unlike [replaceAll] where the replacement string is always the same.
-   *
-   * The [replace] function is called with the [Match] generated
-   * by the pattern, and its result is used as replacement.
-   *
-   * The function defined below converts each word in a string to simplified
-   * 'pig latin' using [replaceAllMapped]:
-   *
-   *     pigLatin(String words) => words.replaceAllMapped(
-   *         new RegExp(r'\b(\w*?)([aeiou]\w*)', caseSensitive: false),
-   *         (Match m) => "${m[2]}${m[1]}${m[1].isEmpty ? 'way' : 'ay'}");
-   *
-   *     pigLatin('I have a secret now!'); // 'Iway avehay away ecretsay ownay!'
-   */
-  String replaceAllMapped(Pattern from, String Function(Match match) replace);
-
-  /**
-   * Replaces the substring from [start] to [end] with [replacement].
-   *
-   * Returns a new string equivalent to:
-   *
-   *     this.substring(0, start) + replacement + this.substring(end)
-   *
-   * The [start] and [end] indices must specify a valid range of this string.
-   * That is `0 <= start <= end <= this.length`.
-   * If [end] is `null`, it defaults to [length].
-   */
-  String replaceRange(int start, int? end, String replacement);
-
-  /**
-   * Splits the string at matches of [pattern] and returns a list of substrings.
-   *
-   * Finds all the matches of `pattern` in this string,
-   * and returns the list of the substrings between the matches.
-   *
-   *     var string = "Hello world!";
-   *     string.split(" ");                      // ['Hello', 'world!'];
-   *
-   * Empty matches at the beginning and end of the strings are ignored,
-   * and so are empty matches right after another match.
-   *
-   *     var string = "abba";
-   *     string.split(new RegExp(r"b*"));        // ['a', 'a']
-   *                                             // not ['', 'a', 'a', '']
-   *
-   * If this string is empty, the result is an empty list if `pattern` matches
-   * the empty string, and it is `[""]` if the pattern doesn't match.
-   *
-   *     var string = '';
-   *     string.split('');                       // []
-   *     string.split("a");                      // ['']
-   *
-   * Splitting with an empty pattern splits the string into single-code unit
-   * strings.
-   *
-   *     var string = 'Pub';
-   *     string.split('');                       // ['P', 'u', 'b']
-   *
-   *     string.codeUnits.map((unit) {
-   *       return new String.fromCharCode(unit);
-   *     }).toList();                            // ['P', 'u', 'b']
-   *
-   * Splitting happens at UTF-16 code unit boundaries,
-   * and not at rune boundaries:
-   *
-   *     // String made up of two code units, but one rune.
-   *     string = '\u{1D11E}';
-   *     string.split('').length;                 // 2 surrogate values
-   *
-   * To get a list of strings containing the individual runes of a string,
-   * you should not use split. You can instead map each rune to a string
-   * as follows:
-   *
-   *     string.runes.map((rune) => new String.fromCharCode(rune)).toList();
-   */
-  List<String> split(Pattern pattern);
-
-  /**
-   * Splits the string, converts its parts, and combines them into a new
-   * string.
-   *
-   * [pattern] is used to split the string into parts and separating matches.
-   *
-   * Each match is converted to a string by calling [onMatch]. If [onMatch]
-   * is omitted, the matched string is used.
-   *
-   * Each non-matched part is converted by a call to [onNonMatch]. If
-   * [onNonMatch] is omitted, the non-matching part is used.
-   *
-   * Then all the converted parts are combined into the resulting string.
-   *
-   *     'Eats shoots leaves'.splitMapJoin((new RegExp(r'shoots')),
-   *         onMatch:    (m) => '${m.group(0)}',
-   *         onNonMatch: (n) => '*'); // *shoots*
-   */
-  String splitMapJoin(Pattern pattern,
-      {String Function(Match)? onMatch, String Function(String)? onNonMatch});
-
-  /**
-   * Returns an unmodifiable list of the UTF-16 code units of this string.
-   */
-  List<int> get codeUnits;
-
-  /**
-   * Returns an [Iterable] of Unicode code-points of this string.
-   *
-   * If the string contains surrogate pairs, they are combined and returned
-   * as one integer by this iterator. Unmatched surrogate halves are treated
-   * like valid 16-bit code-units.
-   */
-  Runes get runes;
-
-  /**
-   * Converts all characters in this string to lower case.
-   * If the string is already in all lower case, this method returns `this`.
-   *
-   *     'ALPHABET'.toLowerCase(); // 'alphabet'
-   *     'abc'.toLowerCase();      // 'abc'
-   *
-   * This function uses the language independent Unicode mapping and thus only
-   * works in some languages.
-   */
-  // TODO(floitsch): document better. (See EcmaScript for description).
-  String toLowerCase();
-
-  /**
-   * Converts all characters in this string to upper case.
-   * If the string is already in all upper case, this method returns `this`.
-   *
-   *     'alphabet'.toUpperCase(); // 'ALPHABET'
-   *     'ABC'.toUpperCase();      // 'ABC'
-   *
-   * This function uses the language independent Unicode mapping and thus only
-   * works in some languages.
-   */
-  // TODO(floitsch): document better. (See EcmaScript for description).
-  String toUpperCase();
-}
-
-/**
- * The runes (integer Unicode code points) of a [String].
- */
-class Runes extends Iterable<int> {
-  final String string;
-  Runes(this.string);
-
-  RuneIterator get iterator => RuneIterator(string);
-
-  int get last {
-    if (string.length == 0) {
-      throw StateError('No elements.');
-    }
-    int length = string.length;
-    int code = string.codeUnitAt(length - 1);
-    if (_isTrailSurrogate(code) && string.length > 1) {
-      int previousCode = string.codeUnitAt(length - 2);
-      if (_isLeadSurrogate(previousCode)) {
-        return _combineSurrogatePair(previousCode, code);
-      }
-    }
-    return code;
-  }
-}
-
-// Is then code (a 16-bit unsigned integer) a UTF-16 lead surrogate.
-bool _isLeadSurrogate(int code) => (code & 0xFC00) == 0xD800;
-
-// Is then code (a 16-bit unsigned integer) a UTF-16 trail surrogate.
-bool _isTrailSurrogate(int code) => (code & 0xFC00) == 0xDC00;
-
-// Combine a lead and a trail surrogate value into a single code point.
-int _combineSurrogatePair(int start, int end) {
-  return 0x10000 + ((start & 0x3FF) << 10) + (end & 0x3FF);
-}
-
-/**
- * [Iterator] for reading runes (integer Unicode code points) of a Dart string.
- */
-class RuneIterator implements BidirectionalIterator<int> {
-  /** String being iterated. */
-  final String string;
-  /** Position before the current code point. */
-  int _position;
-  /** Position after the current code point. */
-  int _nextPosition;
-  /**
-   * Current code point.
-   *
-   * If the iterator has hit either end, the [_currentCodePoint] is -1
-   * and `_position == _nextPosition`.
-   */
-  int _currentCodePoint = -1;
-
-  /** Create an iterator positioned at the beginning of the string. */
-  RuneIterator(String string)
-      : this.string = string,
-        _position = 0,
-        _nextPosition = 0;
-
-  /**
-   * Create an iterator positioned before the [index]th code unit of the string.
-   *
-   * When created, there is no [current] value.
-   * A [moveNext] will use the rune starting at [index] the current value,
-   * and a [movePrevious] will use the rune ending just before [index] as the
-   * the current value.
-   *
-   * The [index] position must not be in the middle of a surrogate pair.
-   */
-  RuneIterator.at(String string, int index)
-      : string = string,
-        _position = index,
-        _nextPosition = index {
-    RangeError.checkValueInInterval(index, 0, string.length);
-    _checkSplitSurrogate(index);
-  }
-
-  /** Throw an error if the index is in the middle of a surrogate pair. */
-  void _checkSplitSurrogate(int index) {
-    if (index > 0 &&
-        index < string.length &&
-        _isLeadSurrogate(string.codeUnitAt(index - 1)) &&
-        _isTrailSurrogate(string.codeUnitAt(index))) {
-      throw ArgumentError('Index inside surrogate pair: $index');
-    }
-  }
-
-  /**
-   * The starting position of the current rune in the string.
-   *
-   * Returns -1 if there is no current rune ([current] is -1).
-   */
-  int get rawIndex => (_position != _nextPosition) ? _position : -1;
-
-  /**
-   * Resets the iterator to the rune at the specified index of the string.
-   *
-   * Setting a negative [rawIndex], or one greater than or equal to
-   * `string.length`, is an error. So is setting it in the middle of a surrogate
-   *  pair.
-   *
-   * Setting the position to the end of then string means that there is no
-   * current rune.
-   */
-  void set rawIndex(int rawIndex) {
-    RangeError.checkValidIndex(rawIndex, string, "rawIndex");
-    reset(rawIndex);
-    moveNext();
-  }
-
-  /**
-   * Resets the iterator to the given index into the string.
-   *
-   * After this the [current] value is unset.
-   * You must call [moveNext] make the rune at the position current,
-   * or [movePrevious] for the last rune before the position.
-   *
-   * The [rawIndex] must be non-negative and no greater than `string.length`.
-   * It must also not be the index of the trailing surrogate of a surrogate
-   * pair.
-   */
-  void reset([int rawIndex = 0]) {
-    RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex");
-    _checkSplitSurrogate(rawIndex);
-    _position = _nextPosition = rawIndex;
-    _currentCodePoint = -1;
-  }
-
-  /**
-   * The rune (integer Unicode code point) starting at the current position in
-   * the string.
-   *
-   * The value is -1 if there is no current code point.
-   */
-  int get current => _currentCodePoint;
-
-  /**
-   * The number of code units comprising the current rune.
-   *
-   * Returns zero if there is no current rune ([current] is -1).
-   */
-  int get currentSize => _nextPosition - _position;
-
-  /**
-   * A string containing the current rune.
-   *
-   * For runes outside the basic multilingual plane, this will be
-   * a String of length 2, containing two code units.
-   *
-   * Returns an empty string if there is no [current] value.
-   */
-  String get currentAsString {
-    if (_position == _nextPosition) return "";
-    if (_position + 1 == _nextPosition) return string[_position];
-    return string.substring(_position, _nextPosition);
-  }
-
-  bool moveNext() {
-    _position = _nextPosition;
-    if (_position == string.length) {
-      _currentCodePoint = -1;
-      return false;
-    }
-    int codeUnit = string.codeUnitAt(_position);
-    int nextPosition = _position + 1;
-    if (_isLeadSurrogate(codeUnit) && nextPosition < string.length) {
-      int nextCodeUnit = string.codeUnitAt(nextPosition);
-      if (_isTrailSurrogate(nextCodeUnit)) {
-        _nextPosition = nextPosition + 1;
-        _currentCodePoint = _combineSurrogatePair(codeUnit, nextCodeUnit);
-        return true;
-      }
-    }
-    _nextPosition = nextPosition;
-    _currentCodePoint = codeUnit;
-    return true;
-  }
-
-  bool movePrevious() {
-    _nextPosition = _position;
-    if (_position == 0) {
-      _currentCodePoint = -1;
-      return false;
-    }
-    int position = _position - 1;
-    int codeUnit = string.codeUnitAt(position);
-    if (_isTrailSurrogate(codeUnit) && position > 0) {
-      int prevCodeUnit = string.codeUnitAt(position - 1);
-      if (_isLeadSurrogate(prevCodeUnit)) {
-        _position = position - 1;
-        _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit);
-        return true;
-      }
-    }
-    _position = position;
-    _currentCodePoint = codeUnit;
-    return true;
-  }
-}
diff --git a/sdk_nnbd/lib/core/string_buffer.dart b/sdk_nnbd/lib/core/string_buffer.dart
deleted file mode 100644
index d664101..0000000
--- a/sdk_nnbd/lib/core/string_buffer.dart
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart.core;
-
-/**
- * A class for concatenating strings efficiently.
- *
- * Allows for the incremental building of a string using write*() methods.
- * The strings are concatenated to a single string only when [toString] is
- * called.
- */
-class StringBuffer implements StringSink {
-  /** Creates the string buffer with an initial content. */
-  external StringBuffer([Object content = ""]);
-
-  /**
-   * Returns the length of the content that has been accumulated so far.
-   * This is a constant-time operation.
-   */
-  external int get length;
-
-  /** Returns whether the buffer is empty. This is a constant-time operation. */
-  bool get isEmpty => length == 0;
-
-  /**
-   * Returns whether the buffer is not empty. This is a constant-time
-   * operation.
-   */
-  bool get isNotEmpty => !isEmpty;
-
-  /// Adds the contents of [obj], converted to a string, to the buffer.
-  external void write(Object? obj);
-
-  /// Adds the string representation of [charCode] to the buffer.
-  external void writeCharCode(int charCode);
-
-  external void writeAll(Iterable<dynamic> objects, [String separator = ""]);
-
-  external void writeln([Object? obj = ""]);
-
-  /**
-   * Clears the string buffer.
-   */
-  external void clear();
-
-  /// Returns the contents of buffer as a concatenated string.
-  external String toString();
-}
diff --git a/sdk_nnbd/lib/core/string_sink.dart b/sdk_nnbd/lib/core/string_sink.dart
deleted file mode 100644
index c507424..0000000
--- a/sdk_nnbd/lib/core/string_sink.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.core;
-
-abstract class StringSink {
-  /**
-   * Converts [obj] to a String by invoking [Object.toString] and
-   * adds the result to `this`.
-   */
-  void write(Object? obj);
-
-  /**
-   * Iterates over the given [objects] and [write]s them in sequence.
-   */
-  void writeAll(Iterable<dynamic> objects, [String separator = ""]);
-
-  /**
-   * Converts [obj] to a String by invoking [Object.toString] and
-   * adds the result to `this`, followed by a newline.
-   */
-  void writeln([Object? obj = ""]);
-
-  /**
-   * Writes the [charCode] to `this`.
-   *
-   * This method is equivalent to `write(new String.fromCharCode(charCode))`.
-   */
-  void writeCharCode(int charCode);
-}
diff --git a/sdk_nnbd/lib/core/symbol.dart b/sdk_nnbd/lib/core/symbol.dart
deleted file mode 100644
index 65e83ff..0000000
--- a/sdk_nnbd/lib/core/symbol.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.core;
-
-/// Opaque name used by mirrors, invocations and [Function.apply].
-abstract class Symbol {
-  /** The symbol corresponding to the name of the unary minus operator. */
-  static const Symbol unaryMinus = Symbol("unary-");
-
-  /**
-   * The empty symbol.
-   *
-   * The empty symbol is the name of libraries with no library declaration,
-   * and the base-name of the unnamed constructor.
-   */
-  static const Symbol empty = Symbol("");
-
-  /**
-   * Constructs a new [Symbol] representing the provided name.
-   *
-   * The name must be a valid public Dart member name,
-   * public constructor name, or library name, optionally qualified.
-   *
-   * A qualified name is a valid name preceded by a public identifier name
-   * and a '`.`', e.g., `foo.bar.baz=` is a qualified version of `baz=`.
-   * That means that the content of the [name] String must be either
-   *
-   * * a valid public Dart identifier
-   *   (that is, an identifier not starting with "`_`"),
-   * * such an identifier followed by "=" (a setter name),
-   * * the name of a declarable operator
-   *   (one of "`+`", "`-`", "`*`", "`/`", "`%`", "`~/`", "`&`", "`|`",
-   *   "`^`", "`~`", "`<<`", "`>>`", "`<`", "`<=`", "`>`", "`>=`", "`==`",
-   *   "`[]`", "`[]=`", or "`unary-`"),
-   * * any of the above preceded by any number of qualifiers,
-   *   where a qualifier is a non-private identifier followed by '`.`',
-   * * or the empty string (the default name of a library with no library
-   *   name declaration).
-   *
-   * Symbol instances created from the same [name] are equal,
-   * but not necessarily identical, but symbols created as compile-time
-   * constants are canonicalized, as all other constant object creations.
-   *
-   * ```dart
-   * assert(new Symbol("foo") == new Symbol("foo"));
-   * assert(identical(const Symbol("foo"), const Symbol("foo")));
-   * ```
-   *
-   * If [name] is a single identifier that does not start with an underscore,
-   * or it is a qualified identifier,
-   * or it is an operator name different from `unary-`,
-   * then the result of `const Symbol(name)` is the same instance that
-   * the symbol literal created by prefixing `#` to the content of [name]
-   * would evaluate to.
-   *
-   * ```dart
-   * assert(new Symbol("foo") == #foo);
-   * assert(new Symbol("[]=") == #[]=]);
-   * assert(new Symbol("foo.bar") == #foo.bar);
-   * assert(identical(const Symbol("foo"), #foo));
-   * assert(identical(const Symbol("[]="), #[]=]));
-   * assert(identical(const Symbol("foo.bar"), #foo.bar));
-   * ```
-   *
-   * This constructor cannot create a [Symbol] instance that is equal to
-   * a private symbol literal like `#_foo`.
-   * ```dart
-   * const Symbol("_foo") // Invalid
-   * ```
-   *
-   * The created instance overrides [Object.==].
-   *
-   * The following text is non-normative:
-   *
-   * Creating non-const Symbol instances may result in larger output.  If
-   * possible, use `MirrorsUsed` from "dart:mirrors" to specify which names
-   * might be passed to this constructor.
-   */
-  const factory Symbol(String name) = internal.Symbol;
-
-  /**
-   * Returns a hash code compatible with [operator==].
-   *
-   * Equal symbols have the same hash code.
-   */
-  int get hashCode;
-
-  /**
-   * Symbols are equal to other symbols that correspond to the same member name.
-   *
-   * Qualified member names, like `#foo.bar` are equal only if they have the
-   * same identifiers before the same final member name.
-   */
-  bool operator ==(Object other);
-}
diff --git a/sdk_nnbd/lib/core/type.dart b/sdk_nnbd/lib/core/type.dart
deleted file mode 100644
index d2e107b..0000000
--- a/sdk_nnbd/lib/core/type.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-/**
- * Runtime representation of a type.
- */
-abstract class Type {}
diff --git a/sdk_nnbd/lib/core/uri.dart b/sdk_nnbd/lib/core/uri.dart
deleted file mode 100644
index 234241c..0000000
--- a/sdk_nnbd/lib/core/uri.dart
+++ /dev/null
@@ -1,4695 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.core;
-
-// Frequently used character codes.
-const int _SPACE = 0x20;
-const int _PERCENT = 0x25;
-const int _AMPERSAND = 0x26;
-const int _PLUS = 0x2B;
-const int _DOT = 0x2E;
-const int _SLASH = 0x2F;
-const int _COLON = 0x3A;
-const int _EQUALS = 0x3d;
-const int _UPPER_CASE_A = 0x41;
-const int _UPPER_CASE_Z = 0x5A;
-const int _LEFT_BRACKET = 0x5B;
-const int _BACKSLASH = 0x5C;
-const int _RIGHT_BRACKET = 0x5D;
-const int _LOWER_CASE_A = 0x61;
-const int _LOWER_CASE_F = 0x66;
-const int _LOWER_CASE_Z = 0x7A;
-
-const String _hexDigits = "0123456789ABCDEF";
-
-/**
- * A parsed URI, such as a URL.
- *
- * **See also:**
- *
- * * [URIs][uris] in the [library tour][libtour]
- * * [RFC-3986](http://tools.ietf.org/html/rfc3986)
- *
- * [uris]: https://www.dartlang.org/docs/dart-up-and-running/ch03.html#uris
- * [libtour]: https://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html
- */
-abstract class Uri {
-  /**
-   * Returns the natural base URI for the current platform.
-   *
-   * When running in a browser this is the current URL of the current page
-   * (from `window.location.href`).
-   *
-   * When not running in a browser this is the file URI referencing
-   * the current working directory.
-   */
-  external static Uri get base;
-
-  /**
-   * Creates a new URI from its components.
-   *
-   * Each component is set through a named argument. Any number of
-   * components can be provided. The [path] and [query] components can be set
-   * using either of two different named arguments.
-   *
-   * The scheme component is set through [scheme]. The scheme is
-   * normalized to all lowercase letters. If the scheme is omitted or empty,
-   * the URI will not have a scheme part.
-   *
-   * The user info part of the authority component is set through
-   * [userInfo]. It defaults to the empty string, which will be omitted
-   * from the string representation of the URI.
-   *
-   * The host part of the authority component is set through
-   * [host]. The host can either be a hostname, an IPv4 address or an
-   * IPv6 address, contained in '[' and ']'. If the host contains a
-   * ':' character, the '[' and ']' are added if not already provided.
-   * The host is normalized to all lowercase letters.
-   *
-   * The port part of the authority component is set through
-   * [port].
-   * If [port] is omitted or `null`, it implies the default port for
-   * the URI's scheme, and is equivalent to passing that port explicitly.
-   * The recognized schemes, and their default ports, are "http" (80) and
-   * "https" (443). All other schemes are considered as having zero as the
-   * default port.
-   *
-   * If any of `userInfo`, `host` or `port` are provided,
-   * the URI has an authority according to [hasAuthority].
-   *
-   * The path component is set through either [path] or
-   * [pathSegments].
-   * When [path] is used, it should be a valid URI path,
-   * but invalid characters, except the general delimiters ':/@[]?#',
-   * will be escaped if necessary.
-   * When [pathSegments] is used, each of the provided segments
-   * is first percent-encoded and then joined using the forward slash
-   * separator.
-   *
-   * The percent-encoding of the path segments encodes all
-   * characters except for the unreserved characters and the following
-   * list of characters: `!$&'()*+,;=:@`. If the other components
-   * necessitate an absolute path, a leading slash `/` is prepended if
-   * not already there.
-   *
-   * The query component is set through either [query] or [queryParameters].
-   * When [query] is used, the provided string should be a valid URI query,
-   * but invalid characters, other than general delimiters,
-   * will be escaped if necessary.
-   * When [queryParameters] is used the query is built from the
-   * provided map. Each key and value in the map is percent-encoded
-   * and joined using equal and ampersand characters.
-   * A value in the map must be either a string, or an [Iterable] of strings,
-   * where the latter corresponds to multiple values for the same key.
-   *
-   * The percent-encoding of the keys and values encodes all characters
-   * except for the unreserved characters, and replaces spaces with `+`.
-   * If `query` is the empty string, it is equivalent to omitting it.
-   * To have an actual empty query part,
-   * use an empty map for `queryParameters`.
-   *
-   * If both `query` and `queryParameters` are omitted or `null`,
-   * the URI has no query part.
-   *
-   * The fragment component is set through [fragment].
-   * It should be a valid URI fragment, but invalid characters other than
-   * general delimiters, are escaped if necessary.
-   * If `fragment` is omitted or `null`, the URI has no fragment part.
-   */
-  factory Uri(
-      {String? scheme,
-      String? userInfo,
-      String? host,
-      int? port,
-      String? path,
-      Iterable<String>? pathSegments,
-      String? query,
-      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
-      String? fragment}) = _Uri;
-
-  /**
-   * Creates a new `http` URI from authority, path and query.
-   *
-   * Examples:
-   *
-   * ```
-   * // http://example.org/path?q=dart.
-   * new Uri.http("example.org", "/path", { "q" : "dart" });
-   *
-   * // http://user:pass@localhost:8080
-   * new Uri.http("user:pass@localhost:8080", "");
-   *
-   * // http://example.org/a%20b
-   * new Uri.http("example.org", "a b");
-   *
-   * // http://example.org/a%252F
-   * new Uri.http("example.org", "/a%2F");
-   * ```
-   *
-   * The `scheme` is always set to `http`.
-   *
-   * The `userInfo`, `host` and `port` components are set from the
-   * [authority] argument. If `authority` is `null` or empty,
-   * the created `Uri` has no authority, and isn't directly usable
-   * as an HTTP URL, which must have a non-empty host.
-   *
-   * The `path` component is set from the [unencodedPath]
-   * argument. The path passed must not be encoded as this constructor
-   * encodes the path.
-   *
-   * The `query` component is set from the optional [queryParameters]
-   * argument.
-   */
-  factory Uri.http(String authority, String unencodedPath,
-      [Map<String, String>? queryParameters]) = _Uri.http;
-
-  /**
-   * Creates a new `https` URI from authority, path and query.
-   *
-   * This constructor is the same as [Uri.http] except for the scheme
-   * which is set to `https`.
-   */
-  factory Uri.https(String authority, String unencodedPath,
-      [Map<String, String>? queryParameters]) = _Uri.https;
-
-  /**
-   * Creates a new file URI from an absolute or relative file path.
-   *
-   * The file path is passed in [path].
-   *
-   * This path is interpreted using either Windows or non-Windows
-   * semantics.
-   *
-   * With non-Windows semantics the slash (`/`) is used to separate
-   * path segments in the input [path].
-   *
-   * With Windows semantics, backslash (`\`) and forward-slash (`/`)
-   * are used to separate path segments in the input [path],
-   * except if the path starts with `\\?\` in which case
-   * only backslash (`\`) separates path segments in [path].
-   *
-   * If the path starts with a path separator, an absolute URI (with the
-   * `file` scheme and an empty authority) is created.
-   * Otherwise a relative URI reference with no scheme or authority is created.
-   * One exception from this rule is that when Windows semantics is used
-   * and the path starts with a drive letter followed by a colon (":") and a
-   * path separator, then an absolute URI is created.
-   *
-   * The default for whether to use Windows or non-Windows semantics
-   * determined from the platform Dart is running on. When running in
-   * the standalone VM, this is detected by the VM based on the
-   * operating system. When running in a browser non-Windows semantics
-   * is always used.
-   *
-   * To override the automatic detection of which semantics to use pass
-   * a value for [windows]. Passing `true` will use Windows
-   * semantics and passing `false` will use non-Windows semantics.
-   *
-   * Examples using non-Windows semantics:
-   *
-   * ```
-   * // xxx/yyy
-   * new Uri.file("xxx/yyy", windows: false);
-   *
-   * // xxx/yyy/
-   * new Uri.file("xxx/yyy/", windows: false);
-   *
-   * // file:///xxx/yyy
-   * new Uri.file("/xxx/yyy", windows: false);
-   *
-   * // file:///xxx/yyy/
-   * new Uri.file("/xxx/yyy/", windows: false);
-   *
-   * // C%3A
-   * new Uri.file("C:", windows: false);
-   * ```
-   *
-   * Examples using Windows semantics:
-   *
-   * ```
-   * // xxx/yyy
-   * new Uri.file(r"xxx\yyy", windows: true);
-   *
-   * // xxx/yyy/
-   * new Uri.file(r"xxx\yyy\", windows: true);
-   *
-   * file:///xxx/yyy
-   * new Uri.file(r"\xxx\yyy", windows: true);
-   *
-   * file:///xxx/yyy/
-   * new Uri.file(r"\xxx\yyy/", windows: true);
-   *
-   * // file:///C:/xxx/yyy
-   * new Uri.file(r"C:\xxx\yyy", windows: true);
-   *
-   * // This throws an error. A path with a drive letter, but no following
-   * // path, is not allowed.
-   * new Uri.file(r"C:", windows: true);
-   *
-   * // This throws an error. A path with a drive letter is not absolute.
-   * new Uri.file(r"C:xxx\yyy", windows: true);
-   *
-   * // file://server/share/file
-   * new Uri.file(r"\\server\share\file", windows: true);
-   * ```
-   *
-   * If the path passed is not a valid file path, an error is thrown.
-   */
-  factory Uri.file(String path, {bool? windows}) = _Uri.file;
-
-  /**
-   * Like [Uri.file] except that a non-empty URI path ends in a slash.
-   *
-   * If [path] is not empty, and it doesn't end in a directory separator,
-   * then a slash is added to the returned URI's path.
-   * In all other cases, the result is the same as returned by `Uri.file`.
-   */
-  factory Uri.directory(String path, {bool? windows}) = _Uri.directory;
-
-  /**
-   * Creates a `data:` URI containing the [content] string.
-   *
-   * Converts the content to a bytes using [encoding] or the charset specified
-   * in [parameters] (defaulting to US-ASCII if not specified or unrecognized),
-   * then encodes the bytes into the resulting data URI.
-   *
-   * Defaults to encoding using percent-encoding (any non-ASCII or non-URI-valid
-   * bytes is replaced by a percent encoding). If [base64] is true, the bytes
-   * are instead encoded using [base64].
-   *
-   * If [encoding] is not provided and [parameters] has a `charset` entry,
-   * that name is looked up using [Encoding.getByName],
-   * and if the lookup returns an encoding, that encoding is used to convert
-   * [content] to bytes.
-   * If providing both an [encoding] and a charset in [parameters], they should
-   * agree, otherwise decoding won't be able to use the charset parameter
-   * to determine the encoding.
-   *
-   * If [mimeType] and/or [parameters] are supplied, they are added to the
-   * created URI. If any of these contain characters that are not allowed
-   * in the data URI, the character is percent-escaped. If the character is
-   * non-ASCII, it is first UTF-8 encoded and then the bytes are percent
-   * encoded. An omitted [mimeType] in a data URI means `text/plain`, just
-   * as an omitted `charset` parameter defaults to meaning `US-ASCII`.
-   *
-   * To read the content back, use [UriData.contentAsString].
-   */
-  factory Uri.dataFromString(String content,
-      {String? mimeType,
-      Encoding? encoding,
-      Map<String, String>? parameters,
-      bool base64 = false}) {
-    UriData data = UriData.fromString(content,
-        mimeType: mimeType,
-        encoding: encoding,
-        parameters: parameters,
-        base64: base64);
-    return data.uri;
-  }
-
-  /**
-   * Creates a `data:` URI containing an encoding of [bytes].
-   *
-   * Defaults to Base64 encoding the bytes, but if [percentEncoded]
-   * is `true`, the bytes will instead be percent encoded (any non-ASCII
-   * or non-valid-ASCII-character byte is replaced by a percent encoding).
-   *
-   * To read the bytes back, use [UriData.contentAsBytes].
-   *
-   * It defaults to having the mime-type `application/octet-stream`.
-   * The [mimeType] and [parameters] are added to the created URI.
-   * If any of these contain characters that are not allowed
-   * in the data URI, the character is percent-escaped. If the character is
-   * non-ASCII, it is first UTF-8 encoded and then the bytes are percent
-   * encoded.
-   */
-  factory Uri.dataFromBytes(List<int> bytes,
-      {String mimeType = "application/octet-stream",
-      Map<String, String>? parameters,
-      bool percentEncoded = false}) {
-    UriData data = UriData.fromBytes(bytes,
-        mimeType: mimeType,
-        parameters: parameters,
-        percentEncoded: percentEncoded);
-    return data.uri;
-  }
-
-  /**
-   * The scheme component of the URI.
-   *
-   * Returns the empty string if there is no scheme component.
-   *
-   * A URI scheme is case insensitive.
-   * The returned scheme is canonicalized to lowercase letters.
-   */
-  String get scheme;
-
-  /**
-   * Returns the authority component.
-   *
-   * The authority is formatted from the [userInfo], [host] and [port]
-   * parts.
-   *
-   * Returns the empty string if there is no authority component.
-   */
-  String get authority;
-
-  /**
-   * Returns the user info part of the authority component.
-   *
-   * Returns the empty string if there is no user info in the
-   * authority component.
-   */
-  String get userInfo;
-
-  /**
-   * Returns the host part of the authority component.
-   *
-   * Returns the empty string if there is no authority component and
-   * hence no host.
-   *
-   * If the host is an IP version 6 address, the surrounding `[` and `]` is
-   * removed.
-   *
-   * The host string is case-insensitive.
-   * The returned host name is canonicalized to lower-case
-   * with upper-case percent-escapes.
-   */
-  String get host;
-
-  /**
-   * Returns the port part of the authority component.
-   *
-   * Returns the default port if there is no port number in the authority
-   * component. That's 80 for http, 443 for https, and 0 for everything else.
-   */
-  int get port;
-
-  /**
-   * Returns the path component.
-   *
-   * The returned path is encoded. To get direct access to the decoded
-   * path use [pathSegments].
-   *
-   * Returns the empty string if there is no path component.
-   */
-  String get path;
-
-  /**
-   * Returns the query component. The returned query is encoded. To get
-   * direct access to the decoded query use [queryParameters].
-   *
-   * Returns the empty string if there is no query component.
-   */
-  String get query;
-
-  /**
-   * Returns the fragment identifier component.
-   *
-   * Returns the empty string if there is no fragment identifier
-   * component.
-   */
-  String get fragment;
-
-  /**
-   * Returns the URI path split into its segments. Each of the segments in the
-   * returned list have been decoded. If the path is empty the empty list will
-   * be returned. A leading slash `/` does not affect the segments returned.
-   *
-   * The returned list is unmodifiable and will throw [UnsupportedError] on any
-   * calls that would mutate it.
-   */
-  List<String> get pathSegments;
-
-  /**
-   * Returns the URI query split into a map according to the rules
-   * specified for FORM post in the [HTML 4.01 specification section
-   * 17.13.4](http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4 "HTML 4.01 section 17.13.4").
-   * Each key and value in the returned map has been decoded.
-   * If there is no query the empty map is returned.
-   *
-   * Keys in the query string that have no value are mapped to the
-   * empty string.
-   * If a key occurs more than once in the query string, it is mapped to
-   * an arbitrary choice of possible value.
-   * The [queryParametersAll] getter can provide a map
-   * that maps keys to all of their values.
-   *
-   * The returned map is unmodifiable.
-   */
-  Map<String, String> get queryParameters;
-
-  /**
-   * Returns the URI query split into a map according to the rules
-   * specified for FORM post in the [HTML 4.01 specification section
-   * 17.13.4](http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4 "HTML 4.01 section 17.13.4").
-   * Each key and value in the returned map has been decoded. If there is no
-   * query the empty map is returned.
-   *
-   * Keys are mapped to lists of their values. If a key occurs only once,
-   * its value is a singleton list. If a key occurs with no value, the
-   * empty string is used as the value for that occurrence.
-   *
-   * The returned map and the lists it contains are unmodifiable.
-   */
-  Map<String, List<String>> get queryParametersAll;
-
-  /**
-   * Returns whether the URI is absolute.
-   *
-   * A URI is an absolute URI in the sense of RFC 3986 if it has a scheme
-   * and no fragment.
-   */
-  bool get isAbsolute;
-
-  /**
-   * Returns whether the URI has a [scheme] component.
-   */
-  bool get hasScheme => scheme.isNotEmpty;
-
-  /**
-   * Returns whether the URI has an [authority] component.
-   */
-  bool get hasAuthority;
-
-  /**
-   * Returns whether the URI has an explicit port.
-   *
-   * If the port number is the default port number
-   * (zero for unrecognized schemes, with http (80) and https (443) being
-   * recognized),
-   * then the port is made implicit and omitted from the URI.
-   */
-  bool get hasPort;
-
-  /**
-   * Returns whether the URI has a query part.
-   */
-  bool get hasQuery;
-
-  /**
-   * Returns whether the URI has a fragment part.
-   */
-  bool get hasFragment;
-
-  /**
-   * Returns whether the URI has an empty path.
-   */
-  bool get hasEmptyPath;
-
-  /**
-   * Returns whether the URI has an absolute path (starting with '/').
-   */
-  bool get hasAbsolutePath;
-
-  /**
-   * Returns the origin of the URI in the form scheme://host:port for the
-   * schemes http and https.
-   *
-   * It is an error if the scheme is not "http" or "https", or if the host name
-   * is missing or empty.
-   *
-   * See: http://www.w3.org/TR/2011/WD-html5-20110405/origin-0.html#origin
-   */
-  String get origin;
-
-  /// Whether the scheme of this [Uri] is [scheme].
-  ///
-  /// The [scheme] should be the same as the one returned by [Uri.scheme],
-  /// but doesn't have to be case-normalized to lower-case characters.
-  ///
-  /// Example:
-  /// ```dart
-  /// var uri = Uri.parse("http://example.com/");
-  /// print(uri.isScheme("HTTP"));  // Prints true.
-  /// ```
-  ///
-  /// A `null` or empty [scheme] string matches a URI with no scheme
-  /// (one where [hasScheme] returns false).
-  bool isScheme(String scheme);
-
-  /**
-   * Returns the file path from a file URI.
-   *
-   * The returned path has either Windows or non-Windows
-   * semantics.
-   *
-   * For non-Windows semantics the slash ("/") is used to separate
-   * path segments.
-   *
-   * For Windows semantics the backslash ("\\") separator is used to
-   * separate path segments.
-   *
-   * If the URI is absolute the path starts with a path separator
-   * unless Windows semantics is used and the first path segment is a
-   * drive letter. When Windows semantics is used a host component in
-   * the uri in interpreted as a file server and a UNC path is
-   * returned.
-   *
-   * The default for whether to use Windows or non-Windows semantics
-   * determined from the platform Dart is running on. When running in
-   * the standalone VM this is detected by the VM based on the
-   * operating system. When running in a browser non-Windows semantics
-   * is always used.
-   *
-   * To override the automatic detection of which semantics to use pass
-   * a value for [windows]. Passing `true` will use Windows
-   * semantics and passing `false` will use non-Windows semantics.
-   *
-   * If the URI ends with a slash (i.e. the last path component is
-   * empty) the returned file path will also end with a slash.
-   *
-   * With Windows semantics URIs starting with a drive letter cannot
-   * be relative to the current drive on the designated drive. That is
-   * for the URI `file:///c:abc` calling `toFilePath` will throw as a
-   * path segment cannot contain colon on Windows.
-   *
-   * Examples using non-Windows semantics (resulting of calling
-   * toFilePath in comment):
-   *
-   *     Uri.parse("xxx/yyy");  // xxx/yyy
-   *     Uri.parse("xxx/yyy/");  // xxx/yyy/
-   *     Uri.parse("file:///xxx/yyy");  // /xxx/yyy
-   *     Uri.parse("file:///xxx/yyy/");  // /xxx/yyy/
-   *     Uri.parse("file:///C:");  // /C:
-   *     Uri.parse("file:///C:a");  // /C:a
-   *
-   * Examples using Windows semantics (resulting URI in comment):
-   *
-   *     Uri.parse("xxx/yyy");  // xxx\yyy
-   *     Uri.parse("xxx/yyy/");  // xxx\yyy\
-   *     Uri.parse("file:///xxx/yyy");  // \xxx\yyy
-   *     Uri.parse("file:///xxx/yyy/");  // \xxx\yyy\
-   *     Uri.parse("file:///C:/xxx/yyy");  // C:\xxx\yyy
-   *     Uri.parse("file:C:xxx/yyy");  // Throws as a path segment
-   *                                   // cannot contain colon on Windows.
-   *     Uri.parse("file://server/share/file");  // \\server\share\file
-   *
-   * If the URI is not a file URI calling this throws
-   * [UnsupportedError].
-   *
-   * If the URI cannot be converted to a file path calling this throws
-   * [UnsupportedError].
-   */
-  // TODO(lrn): Deprecate and move functionality to File class or similar.
-  // The core libraries should not worry about the platform.
-  String toFilePath({bool? windows});
-
-  /**
-   * Access the structure of a `data:` URI.
-   *
-   * Returns a [UriData] object for `data:` URIs and `null` for all other
-   * URIs.
-   * The [UriData] object can be used to access the media type and data
-   * of a `data:` URI.
-   */
-  UriData? get data;
-
-  /// Returns a hash code computed as `toString().hashCode`.
-  ///
-  /// This guarantees that URIs with the same normalized
-  int get hashCode;
-
-  /// A URI is equal to another URI with the same normalized representation.
-  bool operator ==(Object other);
-
-  /// Returns the normalized string representation of the URI.
-  String toString();
-
-  /**
-   * Returns a new `Uri` based on this one, but with some parts replaced.
-   *
-   * This method takes the same parameters as the [new Uri] constructor,
-   * and they have the same meaning.
-   *
-   * At most one of [path] and [pathSegments] must be provided.
-   * Likewise, at most one of [query] and [queryParameters] must be provided.
-   *
-   * Each part that is not provided will default to the corresponding
-   * value from this `Uri` instead.
-   *
-   * This method is different from [Uri.resolve] which overrides in a
-   * hierarchical manner,
-   * and can instead replace each part of a `Uri` individually.
-   *
-   * Example:
-   *
-   *     Uri uri1 = Uri.parse("a://b@c:4/d/e?f#g");
-   *     Uri uri2 = uri1.replace(scheme: "A", path: "D/E/E", fragment: "G");
-   *     print(uri2);  // prints "a://b@c:4/D/E/E?f#G"
-   *
-   * This method acts similarly to using the `new Uri` constructor with
-   * some of the arguments taken from this `Uri`. Example:
-   *
-   *     Uri uri3 = new Uri(
-   *         scheme: "A",
-   *         userInfo: uri1.userInfo,
-   *         host: uri1.host,
-   *         port: uri1.port,
-   *         path: "D/E/E",
-   *         query: uri1.query,
-   *         fragment: "G");
-   *     print(uri3);  // prints "a://b@c:4/D/E/E?f#G"
-   *     print(uri2 == uri3);  // prints true.
-   *
-   * Using this method can be seen as a shorthand for the `Uri` constructor
-   * call above, but may also be slightly faster because the parts taken
-   * from this `Uri` need not be checked for validity again.
-   */
-  Uri replace(
-      {String? scheme,
-      String? userInfo,
-      String? host,
-      int? port,
-      String? path,
-      Iterable<String>? pathSegments,
-      String? query,
-      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
-      String? fragment});
-
-  /**
-   * Returns a `Uri` that differs from this only in not having a fragment.
-   *
-   * If this `Uri` does not have a fragment, it is itself returned.
-   */
-  Uri removeFragment();
-
-  /**
-   * Resolve [reference] as an URI relative to `this`.
-   *
-   * First turn [reference] into a URI using [Uri.parse]. Then resolve the
-   * resulting URI relative to `this`.
-   *
-   * Returns the resolved URI.
-   *
-   * See [resolveUri] for details.
-   */
-  Uri resolve(String reference);
-
-  /**
-   * Resolve [reference] as an URI relative to `this`.
-   *
-   * Returns the resolved URI.
-   *
-   * The algorithm "Transform Reference" for resolving a reference is described
-   * in [RFC-3986 Section 5](http://tools.ietf.org/html/rfc3986#section-5 "RFC-1123").
-   *
-   * Updated to handle the case where the base URI is just a relative path -
-   * that is: when it has no scheme and no authority and the path does not start
-   * with a slash.
-   * In that case, the paths are combined without removing leading "..", and
-   * an empty path is not converted to "/".
-   */
-  Uri resolveUri(Uri reference);
-
-  /**
-   * Returns a URI where the path has been normalized.
-   *
-   * A normalized path does not contain `.` segments or non-leading `..`
-   * segments.
-   * Only a relative path with no scheme or authority may contain
-   * leading `..` segments,
-   * a path that starts with `/` will also drop any leading `..` segments.
-   *
-   * This uses the same normalization strategy as `new Uri().resolve(this)`.
-   *
-   * Does not change any part of the URI except the path.
-   *
-   * The default implementation of `Uri` always normalizes paths, so calling
-   * this function has no effect.
-   */
-  Uri normalizePath();
-
-  /**
-   * Creates a new `Uri` object by parsing a URI string.
-   *
-   * If [start] and [end] are provided, they must specify a valid substring
-   * of [uri], and only the substring from `start` to `end` is parsed as a URI.
-   *
-   * The [uri] must not be `null`.
-   * If the [uri] string is not valid as a URI or URI reference,
-   * a [FormatException] is thrown.
-   */
-  static Uri parse(String uri, [int start = 0, int? end]) {
-    // This parsing will not validate percent-encoding, IPv6, etc.
-    // When done splitting into parts, it will call, e.g., [_makeFragment]
-    // to do the final parsing.
-    //
-    // Important parts of the RFC 3986 used here:
-    // URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
-    //
-    // hier-part     = "//" authority path-abempty
-    //               / path-absolute
-    //               / path-rootless
-    //               / path-empty
-    //
-    // URI-reference = URI / relative-ref
-    //
-    // absolute-URI  = scheme ":" hier-part [ "?" query ]
-    //
-    // relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
-    //
-    // relative-part = "//" authority path-abempty
-    //               / path-absolute
-    //               / path-noscheme
-    //               / path-empty
-    //
-    // scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
-    //
-    // authority     = [ userinfo "@" ] host [ ":" port ]
-    // userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
-    // host          = IP-literal / IPv4address / reg-name
-    // IP-literal    = "[" ( IPv6address / IPv6addrz / IPvFuture ) "]"
-    // IPv6addrz     = IPv6address "%25" ZoneID
-    // ZoneID        = 1*( unreserved / pct-encoded )
-    // port          = *DIGIT
-    // reg-name      = *( unreserved / pct-encoded / sub-delims )
-    //
-    // path          = path-abempty    ; begins with "/" or is empty
-    //               / path-absolute   ; begins with "/" but not "//"
-    //               / path-noscheme   ; begins with a non-colon segment
-    //               / path-rootless   ; begins with a segment
-    //               / path-empty      ; zero characters
-    //
-    // path-abempty  = *( "/" segment )
-    // path-absolute = "/" [ segment-nz *( "/" segment ) ]
-    // path-noscheme = segment-nz-nc *( "/" segment )
-    // path-rootless = segment-nz *( "/" segment )
-    // path-empty    = 0<pchar>
-    //
-    // segment       = *pchar
-    // segment-nz    = 1*pchar
-    // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
-    //               ; non-zero-length segment without any colon ":"
-    //
-    // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
-    //
-    // query         = *( pchar / "/" / "?" )
-    //
-    // fragment      = *( pchar / "/" / "?" )
-    end ??= uri.length;
-
-    // Special case data:URIs. Ignore case when testing.
-    if (end >= start + 5) {
-      int dataDelta = _startsWithData(uri, start);
-      if (dataDelta == 0) {
-        // The case is right.
-        if (start > 0 || end < uri.length) uri = uri.substring(start, end);
-        return UriData._parse(uri, 5, null).uri;
-      } else if (dataDelta == 0x20) {
-        return UriData._parse(uri.substring(start + 5, end), 0, null).uri;
-      }
-      // Otherwise the URI doesn't start with "data:" or any case variant of it.
-    }
-
-    // The following index-normalization belongs with the scanning, but is
-    // easier to do here because we already have extracted variables from the
-    // indices list.
-    var indices = List<int>.filled(8, 0, growable: false);
-
-    // Set default values for each position.
-    // The value will either be correct in some cases where it isn't set
-    // by the scanner, or it is clearly recognizable as an unset value.
-    indices
-      ..[0] = 0
-      ..[_schemeEndIndex] = start - 1
-      ..[_hostStartIndex] = start - 1
-      ..[_notSimpleIndex] = start - 1
-      ..[_portStartIndex] = start
-      ..[_pathStartIndex] = start
-      ..[_queryStartIndex] = end
-      ..[_fragmentStartIndex] = end;
-    var state = _scan(uri, start, end, _uriStart, indices);
-    // Some states that should be non-simple, but the URI ended early.
-    // Paths that end at a ".." must be normalized to end in "../".
-    if (state >= _nonSimpleEndStates) {
-      indices[_notSimpleIndex] = end;
-    }
-    int schemeEnd = indices[_schemeEndIndex];
-    if (schemeEnd >= start) {
-      // Rescan the scheme part now that we know it's not a path.
-      state = _scan(uri, start, schemeEnd, _schemeStart, indices);
-      if (state == _schemeStart) {
-        // Empty scheme.
-        indices[_notSimpleIndex] = schemeEnd;
-      }
-    }
-    // The returned positions are limited by the scanners ability to write only
-    // one position per character, and only the current position.
-    // Scanning from left to right, we only know whether something is a scheme
-    // or a path when we see a `:` or `/`, and likewise we only know if the first
-    // `/` is part of the path or is leading an authority component when we see
-    // the next character.
-
-    int hostStart = indices[_hostStartIndex] + 1;
-    int portStart = indices[_portStartIndex];
-    int pathStart = indices[_pathStartIndex];
-    int queryStart = indices[_queryStartIndex];
-    int fragmentStart = indices[_fragmentStartIndex];
-
-    // We may discover the scheme while handling special cases.
-    String? scheme;
-
-    // Derive some positions that weren't set to normalize the indices.
-    if (fragmentStart < queryStart) queryStart = fragmentStart;
-    // If pathStart isn't set (it's before scheme end or host start), then
-    // the path is empty, or there is no authority part and the path
-    // starts with a non-simple character.
-    if (pathStart < hostStart) {
-      // There is an authority, but no path. The path would start with `/`
-      // if it was there.
-      pathStart = queryStart;
-    } else if (pathStart <= schemeEnd) {
-      // There is a scheme, but no authority.
-      pathStart = schemeEnd + 1;
-    }
-    // If there is an authority with no port, set the port position
-    // to be at the end of the authority (equal to pathStart).
-    // This also handles a ":" in a user-info component incorrectly setting
-    // the port start position.
-    if (portStart < hostStart) portStart = pathStart;
-
-    assert(hostStart == start || schemeEnd <= hostStart);
-    assert(hostStart <= portStart);
-    assert(schemeEnd <= pathStart);
-    assert(portStart <= pathStart);
-    assert(pathStart <= queryStart);
-    assert(queryStart <= fragmentStart);
-
-    bool isSimple = indices[_notSimpleIndex] < start;
-
-    if (isSimple) {
-      // Check/do normalizations that weren't detected by the scanner.
-      // This includes removal of empty port or userInfo,
-      // or scheme specific port and path normalizations.
-      if (hostStart > schemeEnd + 3) {
-        // Always be non-simple if URI contains user-info.
-        // The scanner doesn't set the not-simple position in this case because
-        // it's setting the host-start position instead.
-        isSimple = false;
-      } else if (portStart > start && portStart + 1 == pathStart) {
-        // If the port is empty, it should be omitted.
-        // Pathological case, don't bother correcting it.
-        isSimple = false;
-      } else if (queryStart < end &&
-              (queryStart == pathStart + 2 &&
-                  uri.startsWith("..", pathStart)) ||
-          (queryStart > pathStart + 2 &&
-              uri.startsWith("/..", queryStart - 3))) {
-        // The path ends in a ".." segment. This should be normalized to "../".
-        // We didn't detect this while scanning because a query or fragment was
-        // detected at the same time (which is why we only need to check this
-        // if there is something after the path).
-        isSimple = false;
-      } else {
-        // There are a few scheme-based normalizations that
-        // the scanner couldn't check.
-        // That means that the input is very close to simple, so just do
-        // the normalizations.
-        if (schemeEnd == start + 4) {
-          // Do scheme based normalizations for file, http.
-          if (uri.startsWith("file", start)) {
-            scheme = "file";
-            if (hostStart <= start) {
-              // File URIs should have an authority.
-              // Paths after an authority should be absolute.
-              String schemeAuth = "file://";
-              int delta = 2;
-              if (!uri.startsWith("/", pathStart)) {
-                schemeAuth = "file:///";
-                delta = 3;
-              }
-              uri = schemeAuth + uri.substring(pathStart, end);
-              schemeEnd -= start;
-              hostStart = 7;
-              portStart = 7;
-              pathStart = 7;
-              queryStart += delta - start;
-              fragmentStart += delta - start;
-              start = 0;
-              end = uri.length;
-            } else if (pathStart == queryStart) {
-              // Uri has authority and empty path. Add "/" as path.
-              if (start == 0 && end == uri.length) {
-                uri = uri.replaceRange(pathStart, queryStart, "/");
-                queryStart += 1;
-                fragmentStart += 1;
-                end += 1;
-              } else {
-                uri = "${uri.substring(start, pathStart)}/"
-                    "${uri.substring(queryStart, end)}";
-                schemeEnd -= start;
-                hostStart -= start;
-                portStart -= start;
-                pathStart -= start;
-                queryStart += 1 - start;
-                fragmentStart += 1 - start;
-                start = 0;
-                end = uri.length;
-              }
-            }
-          } else if (uri.startsWith("http", start)) {
-            scheme = "http";
-            // HTTP URIs should not have an explicit port of 80.
-            if (portStart > start &&
-                portStart + 3 == pathStart &&
-                uri.startsWith("80", portStart + 1)) {
-              if (start == 0 && end == uri.length) {
-                uri = uri.replaceRange(portStart, pathStart, "");
-                pathStart -= 3;
-                queryStart -= 3;
-                fragmentStart -= 3;
-                end -= 3;
-              } else {
-                uri = uri.substring(start, portStart) +
-                    uri.substring(pathStart, end);
-                schemeEnd -= start;
-                hostStart -= start;
-                portStart -= start;
-                pathStart -= 3 + start;
-                queryStart -= 3 + start;
-                fragmentStart -= 3 + start;
-                start = 0;
-                end = uri.length;
-              }
-            }
-          }
-        } else if (schemeEnd == start + 5 && uri.startsWith("https", start)) {
-          scheme = "https";
-          // HTTPS URIs should not have an explicit port of 443.
-          if (portStart > start &&
-              portStart + 4 == pathStart &&
-              uri.startsWith("443", portStart + 1)) {
-            if (start == 0 && end == uri.length) {
-              uri = uri.replaceRange(portStart, pathStart, "");
-              pathStart -= 4;
-              queryStart -= 4;
-              fragmentStart -= 4;
-              end -= 3;
-            } else {
-              uri = uri.substring(start, portStart) +
-                  uri.substring(pathStart, end);
-              schemeEnd -= start;
-              hostStart -= start;
-              portStart -= start;
-              pathStart -= 4 + start;
-              queryStart -= 4 + start;
-              fragmentStart -= 4 + start;
-              start = 0;
-              end = uri.length;
-            }
-          }
-        }
-      }
-    }
-
-    if (isSimple) {
-      if (start > 0 || end < uri.length) {
-        uri = uri.substring(start, end);
-        schemeEnd -= start;
-        hostStart -= start;
-        portStart -= start;
-        pathStart -= start;
-        queryStart -= start;
-        fragmentStart -= start;
-      }
-      return _SimpleUri(uri, schemeEnd, hostStart, portStart, pathStart,
-          queryStart, fragmentStart, scheme);
-    }
-
-    return _Uri.notSimple(uri, start, end, schemeEnd, hostStart, portStart,
-        pathStart, queryStart, fragmentStart, scheme);
-  }
-
-  /**
-   * Creates a new `Uri` object by parsing a URI string.
-   *
-   * If [start] and [end] are provided, they must specify a valid substring
-   * of [uri], and only the substring from `start` to `end` is parsed as a URI.
-   * The [uri] must not be `null`.
-   *
-   * Returns `null` if the [uri] string is not valid as a URI or URI reference.
-   */
-  static Uri? tryParse(String uri, [int start = 0, int? end]) {
-    // TODO: Optimize to avoid throwing-and-recatching.
-    try {
-      return parse(uri, start, end);
-    } on FormatException {
-      return null;
-    }
-  }
-
-  /**
-   * Encode the string [component] using percent-encoding to make it
-   * safe for literal use as a URI component.
-   *
-   * All characters except uppercase and lowercase letters, digits and
-   * the characters `-_.!~*'()` are percent-encoded. This is the
-   * set of characters specified in RFC 2396 and the which is
-   * specified for the encodeUriComponent in ECMA-262 version 5.1.
-   *
-   * When manually encoding path segments or query components remember
-   * to encode each part separately before building the path or query
-   * string.
-   *
-   * For encoding the query part consider using
-   * [encodeQueryComponent].
-   *
-   * To avoid the need for explicitly encoding use the [pathSegments]
-   * and [queryParameters] optional named arguments when constructing
-   * a [Uri].
-   */
-  static String encodeComponent(String component) {
-    return _Uri._uriEncode(_Uri._unreserved2396Table, component, utf8, false);
-  }
-
-  /**
-   * Encode the string [component] according to the HTML 4.01 rules
-   * for encoding the posting of a HTML form as a query string
-   * component.
-   *
-   * Encode the string [component] according to the HTML 4.01 rules
-   * for encoding the posting of a HTML form as a query string
-   * component.
-
-   * The component is first encoded to bytes using [encoding].
-   * The default is to use [utf8] encoding, which preserves all
-   * the characters that don't need encoding.
-
-   * Then the resulting bytes are "percent-encoded". This transforms
-   * spaces (U+0020) to a plus sign ('+') and all bytes that are not
-   * the ASCII decimal digits, letters or one of '-._~' are written as
-   * a percent sign '%' followed by the two-digit hexadecimal
-   * representation of the byte.
-
-   * Note that the set of characters which are percent-encoded is a
-   * superset of what HTML 4.01 requires, since it refers to RFC 1738
-   * for reserved characters.
-   *
-   * When manually encoding query components remember to encode each
-   * part separately before building the query string.
-   *
-   * To avoid the need for explicitly encoding the query use the
-   * [queryParameters] optional named arguments when constructing a
-   * [Uri].
-   *
-   * See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 for more
-   * details.
-   */
-  static String encodeQueryComponent(String component,
-      {Encoding encoding = utf8}) {
-    return _Uri._uriEncode(_Uri._unreservedTable, component, encoding, true);
-  }
-
-  /**
-   * Decodes the percent-encoding in [encodedComponent].
-   *
-   * Note that decoding a URI component might change its meaning as
-   * some of the decoded characters could be characters with are
-   * delimiters for a given URI component type. Always split a URI
-   * component using the delimiters for the component before decoding
-   * the individual parts.
-   *
-   * For handling the [path] and [query] components consider using
-   * [pathSegments] and [queryParameters] to get the separated and
-   * decoded component.
-   */
-  static String decodeComponent(String encodedComponent) {
-    return _Uri._uriDecode(
-        encodedComponent, 0, encodedComponent.length, utf8, false);
-  }
-
-  /**
-   * Decodes the percent-encoding in [encodedComponent], converting
-   * pluses to spaces.
-   *
-   * It will create a byte-list of the decoded characters, and then use
-   * [encoding] to decode the byte-list to a String. The default encoding is
-   * UTF-8.
-   */
-  static String decodeQueryComponent(String encodedComponent,
-      {Encoding encoding = utf8}) {
-    return _Uri._uriDecode(
-        encodedComponent, 0, encodedComponent.length, encoding, true);
-  }
-
-  /**
-   * Encode the string [uri] using percent-encoding to make it
-   * safe for literal use as a full URI.
-   *
-   * All characters except uppercase and lowercase letters, digits and
-   * the characters `!#$&'()*+,-./:;=?@_~` are percent-encoded. This
-   * is the set of characters specified in in ECMA-262 version 5.1 for
-   * the encodeURI function .
-   */
-  static String encodeFull(String uri) {
-    return _Uri._uriEncode(_Uri._encodeFullTable, uri, utf8, false);
-  }
-
-  /**
-   * Decodes the percent-encoding in [uri].
-   *
-   * Note that decoding a full URI might change its meaning as some of
-   * the decoded characters could be reserved characters. In most
-   * cases an encoded URI should be parsed into components using
-   * [Uri.parse] before decoding the separate components.
-   */
-  static String decodeFull(String uri) {
-    return _Uri._uriDecode(uri, 0, uri.length, utf8, false);
-  }
-
-  /**
-   * Returns the [query] split into a map according to the rules
-   * specified for FORM post in the [HTML 4.01 specification section
-   * 17.13.4](http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4 "HTML 4.01 section 17.13.4").
-   * Each key and value in the returned map has been decoded. If the [query]
-   * is the empty string an empty map is returned.
-   *
-   * Keys in the query string that have no value are mapped to the
-   * empty string.
-   *
-   * Each query component will be decoded using [encoding]. The default encoding
-   * is UTF-8.
-   */
-  static Map<String, String> splitQueryString(String query,
-      {Encoding encoding = utf8}) {
-    return query.split("&").fold({}, (map, element) {
-      int index = element.indexOf("=");
-      if (index == -1) {
-        if (element != "") {
-          map[decodeQueryComponent(element, encoding: encoding)] = "";
-        }
-      } else if (index != 0) {
-        var key = element.substring(0, index);
-        var value = element.substring(index + 1);
-        map[decodeQueryComponent(key, encoding: encoding)] =
-            decodeQueryComponent(value, encoding: encoding);
-      }
-      return map;
-    });
-  }
-
-  /**
-   * Parse the [host] as an IP version 4 (IPv4) address, returning the address
-   * as a list of 4 bytes in network byte order (big endian).
-   *
-   * Throws a [FormatException] if [host] is not a valid IPv4 address
-   * representation.
-   */
-  static List<int> parseIPv4Address(String host) =>
-      _parseIPv4Address(host, 0, host.length);
-
-  /// Implementation of [parseIPv4Address] that can work on a substring.
-  static List<int> _parseIPv4Address(String host, int start, int end) {
-    void error(String msg, int position) {
-      throw FormatException('Illegal IPv4 address, $msg', host, position);
-    }
-
-    var result = Uint8List(4);
-    int partIndex = 0;
-    int partStart = start;
-    for (int i = start; i < end; i++) {
-      int char = host.codeUnitAt(i);
-      if (char != _DOT) {
-        if (char ^ 0x30 > 9) {
-          // Fail on a non-digit character.
-          error("invalid character", i);
-        }
-      } else {
-        if (partIndex == 3) {
-          error('IPv4 address should contain exactly 4 parts', i);
-        }
-        int part = int.parse(host.substring(partStart, i));
-        if (part > 255) {
-          error("each part must be in the range 0..255", partStart);
-        }
-        result[partIndex++] = part;
-        partStart = i + 1;
-      }
-    }
-
-    if (partIndex != 3) {
-      error('IPv4 address should contain exactly 4 parts', end);
-    }
-
-    int part = int.parse(host.substring(partStart, end));
-    if (part > 255) {
-      error("each part must be in the range 0..255", partStart);
-    }
-    result[partIndex] = part;
-
-    return result;
-  }
-
-  /**
-   * Parse the [host] as an IP version 6 (IPv6) address, returning the address
-   * as a list of 16 bytes in network byte order (big endian).
-   *
-   * Throws a [FormatException] if [host] is not a valid IPv6 address
-   * representation.
-   *
-   * Acts on the substring from [start] to [end]. If [end] is omitted, it
-   * defaults ot the end of the string.
-   *
-   * Some examples of IPv6 addresses:
-   *  * `::1`
-   *  * `FEDC:BA98:7654:3210:FEDC:BA98:7654:3210`
-   *  * `3ffe:2a00:100:7031::1`
-   *  * `::FFFF:129.144.52.38`
-   *  * `2010:836B:4179::836B:4179`
-   */
-  static List<int> parseIPv6Address(String host, [int start = 0, int? end]) {
-    end ??= host.length;
-    // An IPv6 address consists of exactly 8 parts of 1-4 hex digits, separated
-    // by `:`'s, with the following exceptions:
-    //
-    //  - One (and only one) wildcard (`::`) may be present, representing a fill
-    //    of 0's. The IPv6 `::` is thus 16 bytes of `0`.
-    //  - The last two parts may be replaced by an IPv4 "dotted-quad" address.
-
-    // Helper function for reporting a badly formatted IPv6 address.
-    void error(String msg, [position]) {
-      throw FormatException('Illegal IPv6 address, $msg', host, position);
-    }
-
-    // Parse a hex block.
-    int parseHex(int start, int end) {
-      if (end - start > 4) {
-        error('an IPv6 part can only contain a maximum of 4 hex digits', start);
-      }
-      int value = int.parse(host.substring(start, end), radix: 16);
-      if (value < 0 || value > 0xFFFF) {
-        error('each part must be in the range of `0x0..0xFFFF`', start);
-      }
-      return value;
-    }
-
-    if (host.length < 2) error('address is too short');
-    List<int> parts = [];
-    bool wildcardSeen = false;
-    // Set if seeing a ".", suggesting that there is an IPv4 address.
-    bool seenDot = false;
-    int partStart = start;
-    // Parse all parts, except a potential last one.
-    for (int i = start; i < end; i++) {
-      int char = host.codeUnitAt(i);
-      if (char == _COLON) {
-        if (i == start) {
-          // If we see a `:` in the beginning, expect wildcard.
-          i++;
-          if (host.codeUnitAt(i) != _COLON) {
-            error('invalid start colon.', i);
-          }
-          partStart = i;
-        }
-        if (i == partStart) {
-          // Wildcard. We only allow one.
-          if (wildcardSeen) {
-            error('only one wildcard `::` is allowed', i);
-          }
-          wildcardSeen = true;
-          parts.add(-1);
-        } else {
-          // Found a single colon. Parse [partStart..i] as a hex entry.
-          parts.add(parseHex(partStart, i));
-        }
-        partStart = i + 1;
-      } else if (char == _DOT) {
-        seenDot = true;
-      }
-    }
-    if (parts.length == 0) error('too few parts');
-    bool atEnd = (partStart == end);
-    bool isLastWildcard = (parts.last == -1);
-    if (atEnd && !isLastWildcard) {
-      error('expected a part after last `:`', end);
-    }
-    if (!atEnd) {
-      if (!seenDot) {
-        parts.add(parseHex(partStart, end));
-      } else {
-        List<int> last = _parseIPv4Address(host, partStart, end);
-        parts.add(last[0] << 8 | last[1]);
-        parts.add(last[2] << 8 | last[3]);
-      }
-    }
-    if (wildcardSeen) {
-      if (parts.length > 7) {
-        error('an address with a wildcard must have less than 7 parts');
-      }
-    } else if (parts.length != 8) {
-      error('an address without a wildcard must contain exactly 8 parts');
-    }
-    List<int> bytes = Uint8List(16);
-    for (int i = 0, index = 0; i < parts.length; i++) {
-      int value = parts[i];
-      if (value == -1) {
-        int wildCardLength = 9 - parts.length;
-        for (int j = 0; j < wildCardLength; j++) {
-          bytes[index] = 0;
-          bytes[index + 1] = 0;
-          index += 2;
-        }
-      } else {
-        bytes[index] = value >> 8;
-        bytes[index + 1] = value & 0xff;
-        index += 2;
-      }
-    }
-    return bytes;
-  }
-}
-
-class _Uri implements Uri {
-  // We represent the missing scheme as an empty string.
-  // A valid scheme cannot be empty.
-  final String scheme;
-
-  /**
-   * The user-info part of the authority.
-   *
-   * Does not distinguish between an empty user-info and an absent one.
-   * The value is always non-null.
-   * Is considered absent if [_host] is `null`.
-   */
-  final String _userInfo;
-
-  /**
-   * The host name of the URI.
-   *
-   * Set to `null` if there is no authority in the URI.
-   * The host name is the only mandatory part of an authority, so we use
-   * it to mark whether an authority part was present or not.
-   */
-  final String? _host;
-
-  /**
-   * The port number part of the authority.
-   *
-   * The port. Set to null if there is no port. Normalized to null if
-   * the port is the default port for the scheme.
-   */
-  int? _port;
-
-  /**
-   * The path of the URI.
-   *
-   * Always non-null.
-   */
-  final String path;
-
-  /// The query content, or null if there is no query.
-  final String? _query;
-
-  // The fragment content, or null if there is no fragment.
-  final String? _fragment;
-
-  /// Cache of the full normalized text representation of the URI.
-  late final String _text = this._initializeText();
-
-  /// Cache of the list of path segments.
-  late final List<String> pathSegments = _computePathSegments(this.path);
-
-  /// Lazily computed and cached hashCode of [_text].
-  late final int hashCode = this._text.hashCode;
-
-  /// Cache the computed return value of [queryParameters].
-  late final Map<String, String> queryParameters =
-      UnmodifiableMapView<String, String>(Uri.splitQueryString(this.query));
-
-  /// Cache the computed return value of [queryParametersAll].
-  late final Map<String, List<String>> queryParametersAll =
-      _computeQueryParametersAll(this.query);
-
-  /// Internal non-verifying constructor. Only call with validated arguments.
-  ///
-  /// The components must be properly normalized.
-  ///
-  /// Use `null` for [_host] if there is no authority. In that case, always
-  /// pass `null` for [_port] and an empty string for [_userInfo] as well.
-  ///
-  /// Use `null` for [_port], [_query] and [_fragment] if there is
-  /// component of that type, and empty string for [_userInfo].
-  ///
-  /// The [path] and [scheme] are never empty.
-  _Uri._internal(this.scheme, this._userInfo, this._host, this._port, this.path,
-      this._query, this._fragment);
-
-  /// Create a [_Uri] from parts of [uri].
-  ///
-  /// The parameters specify the start/end of particular components of the URI.
-  /// The [scheme] may contain a string representing a normalized scheme
-  /// component if one has already been discovered.
-  factory _Uri.notSimple(
-      String uri,
-      int start,
-      int end,
-      int schemeEnd,
-      int hostStart,
-      int portStart,
-      int pathStart,
-      int queryStart,
-      int fragmentStart,
-      String? scheme) {
-    if (scheme == null) {
-      scheme = "";
-      if (schemeEnd > start) {
-        scheme = _makeScheme(uri, start, schemeEnd);
-      } else if (schemeEnd == start) {
-        _fail(uri, start, "Invalid empty scheme");
-      }
-    }
-    String userInfo = "";
-    String? host;
-    int? port;
-    if (hostStart > start) {
-      int userInfoStart = schemeEnd + 3;
-      if (userInfoStart < hostStart) {
-        userInfo = _makeUserInfo(uri, userInfoStart, hostStart - 1);
-      }
-      host = _makeHost(uri, hostStart, portStart, false);
-      if (portStart + 1 < pathStart) {
-        int portNumber =
-            int.tryParse(uri.substring(portStart + 1, pathStart)) ??
-                (throw FormatException("Invalid port", uri, portStart + 1));
-        port = _makePort(portNumber, scheme);
-      }
-    }
-    String path =
-        _makePath(uri, pathStart, queryStart, null, scheme, host != null);
-    String? query;
-    if (queryStart < fragmentStart) {
-      query = _makeQuery(uri, queryStart + 1, fragmentStart, null);
-    }
-    String? fragment;
-    if (fragmentStart < end) {
-      fragment = _makeFragment(uri, fragmentStart + 1, end);
-    }
-    return _Uri._internal(scheme, userInfo, host, port, path, query, fragment);
-  }
-
-  /// Implementation of [Uri.Uri].
-  factory _Uri(
-      {String? scheme,
-      String? userInfo,
-      String? host,
-      int? port,
-      String? path,
-      Iterable<String>? pathSegments,
-      String? query,
-      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
-      String? fragment}) {
-    if (scheme == null) {
-      scheme = "";
-    } else {
-      scheme = _makeScheme(scheme, 0, scheme.length);
-    }
-    userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo));
-    if (userInfo == null) {
-      // TODO(dart-lang/language#440): Remove when promotion works.
-      throw "unreachable";
-    }
-    host = _makeHost(host, 0, _stringOrNullLength(host), false);
-    // Special case this constructor for backwards compatibility.
-    if (query == "") query = null;
-    query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters);
-    fragment = _makeFragment(fragment, 0, _stringOrNullLength(fragment));
-    port = _makePort(port, scheme);
-    bool isFile = (scheme == "file");
-    if (host == null && (userInfo.isNotEmpty || port != null || isFile)) {
-      host = "";
-    }
-    bool hasAuthority = (host != null);
-    path = _makePath(
-        path, 0, _stringOrNullLength(path), pathSegments, scheme, hasAuthority);
-    if (path == null) {
-      // TODO(dart-lang/language#440): Remove when promotion works.
-      throw "unreachable";
-    }
-    if (scheme.isEmpty && host == null && !path.startsWith('/')) {
-      bool allowScheme = scheme.isNotEmpty || host != null;
-      path = _normalizeRelativePath(path, allowScheme);
-    } else {
-      path = _removeDotSegments(path);
-    }
-    if (host == null && path.startsWith("//")) {
-      host = "";
-    }
-    return _Uri._internal(scheme, userInfo, host, port, path, query, fragment);
-  }
-
-  /// Implementation of [Uri.http].
-  factory _Uri.http(String authority, String unencodedPath,
-      [Map<String, String>? queryParameters]) {
-    return _makeHttpUri("http", authority, unencodedPath, queryParameters);
-  }
-
-  /// Implementation of [Uri.https].
-  factory _Uri.https(String authority, String unencodedPath,
-      [Map<String, String>? queryParameters]) {
-    return _makeHttpUri("https", authority, unencodedPath, queryParameters);
-  }
-
-  String get authority {
-    if (!hasAuthority) return "";
-    var sb = StringBuffer();
-    _writeAuthority(sb);
-    return sb.toString();
-  }
-
-  String get userInfo => _userInfo;
-
-  String get host {
-    String? host = _host;
-    if (host == null) return "";
-    if (host.startsWith('[')) {
-      return host.substring(1, host.length - 1);
-    }
-    return host;
-  }
-
-  int get port {
-    return _port ?? _defaultPort(scheme);
-  }
-
-  /// The default port for the scheme of this Uri.
-  static int _defaultPort(String scheme) {
-    if (scheme == "http") return 80;
-    if (scheme == "https") return 443;
-    return 0;
-  }
-
-  String get query => _query ?? "";
-
-  String get fragment => _fragment ?? "";
-
-  bool isScheme(String scheme) {
-    String thisScheme = this.scheme;
-    if (scheme == null) return thisScheme.isEmpty;
-    if (scheme.length != thisScheme.length) return false;
-    return _compareScheme(scheme, thisScheme);
-  }
-
-  /// Compares scheme characters in [scheme] and at the start of [uri].
-  ///
-  /// Returns `true` if [scheme] represents the same scheme as the start of
-  /// [uri]. That means having the same characters, but possibly different case
-  /// for letters.
-  ///
-  /// This function doesn't check that the characters are valid URI scheme
-  /// characters. The [uri] is assumed to be valid, so if [scheme] matches
-  /// it, it has to be valid too.
-  ///
-  /// The length should be tested before calling this function,
-  /// so the scheme part of [uri] is known to have the same length as [scheme].
-  static bool _compareScheme(String scheme, String uri) {
-    for (int i = 0; i < scheme.length; i++) {
-      int schemeChar = scheme.codeUnitAt(i);
-      int uriChar = uri.codeUnitAt(i);
-      int delta = schemeChar ^ uriChar;
-      if (delta != 0) {
-        if (delta == 0x20) {
-          // Might be a case difference.
-          int lowerChar = uriChar | delta;
-          if (0x61 /*a*/ <= lowerChar && lowerChar <= 0x7a /*z*/) {
-            continue;
-          }
-        }
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /// Report a parse failure.
-  static Never _fail(String uri, int index, String message) {
-    throw FormatException(message, uri, index);
-  }
-
-  static _Uri _makeHttpUri(String scheme, String? authority,
-      String unencodedPath, Map<String, String>? queryParameters) {
-    var userInfo = "";
-    String? host;
-    int? port;
-
-    if (authority != null && authority.isNotEmpty) {
-      var hostStart = 0;
-      // Split off the user info.
-      for (int i = 0; i < authority.length; i++) {
-        const int atSign = 0x40;
-        if (authority.codeUnitAt(i) == atSign) {
-          userInfo = authority.substring(0, i);
-          hostStart = i + 1;
-          break;
-        }
-      }
-      var hostEnd = hostStart;
-      if (hostStart < authority.length &&
-          authority.codeUnitAt(hostStart) == _LEFT_BRACKET) {
-        // IPv6 host.
-        int escapeForZoneID = -1;
-        for (; hostEnd < authority.length; hostEnd++) {
-          int char = authority.codeUnitAt(hostEnd);
-          if (char == _PERCENT && escapeForZoneID < 0) {
-            escapeForZoneID = hostEnd;
-            if (authority.startsWith("25", hostEnd + 1)) {
-              hostEnd += 2; // Might as well skip the already checked escape.
-            }
-          } else if (char == _RIGHT_BRACKET) {
-            break;
-          }
-        }
-        if (hostEnd == authority.length) {
-          throw FormatException(
-              "Invalid IPv6 host entry.", authority, hostStart);
-        }
-        Uri.parseIPv6Address(authority, hostStart + 1,
-            (escapeForZoneID < 0) ? hostEnd : escapeForZoneID);
-        hostEnd++; // Skip the closing bracket.
-        if (hostEnd != authority.length &&
-            authority.codeUnitAt(hostEnd) != _COLON) {
-          throw FormatException("Invalid end of authority", authority, hostEnd);
-        }
-      }
-      // Split host and port.
-      for (; hostEnd < authority.length; hostEnd++) {
-        if (authority.codeUnitAt(hostEnd) == _COLON) {
-          var portString = authority.substring(hostEnd + 1);
-          // We allow the empty port - falling back to initial value.
-          if (portString.isNotEmpty) port = int.parse(portString);
-          break;
-        }
-      }
-      host = authority.substring(hostStart, hostEnd);
-    }
-    return _Uri(
-        scheme: scheme,
-        userInfo: userInfo,
-        host: host,
-        port: port,
-        pathSegments: unencodedPath.split("/"),
-        queryParameters: queryParameters);
-  }
-
-  /// Implementation of [Uri.file].
-  factory _Uri.file(String path, {bool? windows}) {
-    return (windows ?? _Uri._isWindows)
-        ? _makeWindowsFileUrl(path, false)
-        : _makeFileUri(path, false);
-  }
-
-  /// Implementation of [Uri.directory].
-  factory _Uri.directory(String path, {bool? windows}) {
-    return (windows ?? _Uri._isWindows)
-        ? _makeWindowsFileUrl(path, true)
-        : _makeFileUri(path, true);
-  }
-
-  /// Used internally in path-related constructors.
-  external static bool get _isWindows;
-
-  static void _checkNonWindowsPathReservedCharacters(
-      List<String> segments, bool argumentError) {
-    for (var segment in segments) {
-      if (segment.contains("/")) {
-        if (argumentError) {
-          throw ArgumentError("Illegal path character $segment");
-        } else {
-          throw UnsupportedError("Illegal path character $segment");
-        }
-      }
-    }
-  }
-
-  static void _checkWindowsPathReservedCharacters(
-      List<String> segments, bool argumentError,
-      [int firstSegment = 0]) {
-    for (var segment in segments.skip(firstSegment)) {
-      if (segment.contains(RegExp(r'["*/:<>?\\|]'))) {
-        if (argumentError) {
-          throw ArgumentError("Illegal character in path");
-        } else {
-          throw UnsupportedError("Illegal character in path: $segment");
-        }
-      }
-    }
-  }
-
-  static void _checkWindowsDriveLetter(int charCode, bool argumentError) {
-    if ((_UPPER_CASE_A <= charCode && charCode <= _UPPER_CASE_Z) ||
-        (_LOWER_CASE_A <= charCode && charCode <= _LOWER_CASE_Z)) {
-      return;
-    }
-    if (argumentError) {
-      throw ArgumentError(
-          "Illegal drive letter " + String.fromCharCode(charCode));
-    } else {
-      throw UnsupportedError(
-          "Illegal drive letter " + String.fromCharCode(charCode));
-    }
-  }
-
-  static Uri _makeFileUri(String path, bool slashTerminated) {
-    const String sep = "/";
-    var segments = path.split(sep);
-    if (slashTerminated && segments.isNotEmpty && segments.last.isNotEmpty) {
-      segments.add(""); // Extra separator at end.
-    }
-    if (path.startsWith(sep)) {
-      // Absolute file:// URI.
-      return Uri(scheme: "file", pathSegments: segments);
-    } else {
-      // Relative URI.
-      return Uri(pathSegments: segments);
-    }
-  }
-
-  static _makeWindowsFileUrl(String path, bool slashTerminated) {
-    if (path.startsWith(r"\\?\")) {
-      if (path.startsWith(r"UNC\", 4)) {
-        path = path.replaceRange(0, 7, r'\');
-      } else {
-        path = path.substring(4);
-        if (path.length < 3 ||
-            path.codeUnitAt(1) != _COLON ||
-            path.codeUnitAt(2) != _BACKSLASH) {
-          throw ArgumentError(
-              r"Windows paths with \\?\ prefix must be absolute");
-        }
-      }
-    } else {
-      path = path.replaceAll("/", r'\');
-    }
-    const String sep = r'\';
-    if (path.length > 1 && path.codeUnitAt(1) == _COLON) {
-      _checkWindowsDriveLetter(path.codeUnitAt(0), true);
-      if (path.length == 2 || path.codeUnitAt(2) != _BACKSLASH) {
-        throw ArgumentError("Windows paths with drive letter must be absolute");
-      }
-      // Absolute file://C:/ URI.
-      var pathSegments = path.split(sep);
-      if (slashTerminated && pathSegments.last.isNotEmpty) {
-        pathSegments.add(""); // Extra separator at end.
-      }
-      _checkWindowsPathReservedCharacters(pathSegments, true, 1);
-      return Uri(scheme: "file", pathSegments: pathSegments);
-    }
-
-    if (path.startsWith(sep)) {
-      if (path.startsWith(sep, 1)) {
-        // Absolute file:// URI with host.
-        int pathStart = path.indexOf(r'\', 2);
-        String hostPart =
-            (pathStart < 0) ? path.substring(2) : path.substring(2, pathStart);
-        String pathPart = (pathStart < 0) ? "" : path.substring(pathStart + 1);
-        var pathSegments = pathPart.split(sep);
-        _checkWindowsPathReservedCharacters(pathSegments, true);
-        if (slashTerminated && pathSegments.last.isNotEmpty) {
-          pathSegments.add(""); // Extra separator at end.
-        }
-        return Uri(scheme: "file", host: hostPart, pathSegments: pathSegments);
-      } else {
-        // Absolute file:// URI.
-        var pathSegments = path.split(sep);
-        if (slashTerminated && pathSegments.last.isNotEmpty) {
-          pathSegments.add(""); // Extra separator at end.
-        }
-        _checkWindowsPathReservedCharacters(pathSegments, true);
-        return Uri(scheme: "file", pathSegments: pathSegments);
-      }
-    } else {
-      // Relative URI.
-      var pathSegments = path.split(sep);
-      _checkWindowsPathReservedCharacters(pathSegments, true);
-      if (slashTerminated &&
-          pathSegments.isNotEmpty &&
-          pathSegments.last.isNotEmpty) {
-        pathSegments.add(""); // Extra separator at end.
-      }
-      return Uri(pathSegments: pathSegments);
-    }
-  }
-
-  Uri replace(
-      {String? scheme,
-      String? userInfo,
-      String? host,
-      int? port,
-      String? path,
-      Iterable<String>? pathSegments,
-      String? query,
-      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
-      String? fragment}) {
-    // Set to true if the scheme has (potentially) changed.
-    // In that case, the default port may also have changed and we need
-    // to check even the existing port.
-    bool schemeChanged = false;
-    if (scheme != null) {
-      scheme = _makeScheme(scheme, 0, scheme.length);
-      schemeChanged = (scheme != this.scheme);
-    } else {
-      scheme = this.scheme;
-    }
-
-    bool isFile = (scheme == "file");
-    if (userInfo != null) {
-      userInfo = _makeUserInfo(userInfo, 0, userInfo.length);
-    } else {
-      userInfo = this._userInfo;
-    }
-
-    if (port != null) {
-      port = _makePort(port, scheme);
-    } else {
-      port = this._port;
-      if (schemeChanged) {
-        // The default port might have changed.
-        port = _makePort(port, scheme);
-      }
-    }
-    if (host != null) {
-      host = _makeHost(host, 0, host.length, false);
-    } else if (this.hasAuthority) {
-      host = this._host;
-    } else if (userInfo.isNotEmpty || port != null || isFile) {
-      host = "";
-    }
-
-    bool hasAuthority = host != null;
-    if (path != null || pathSegments != null) {
-      path = _makePath(path, 0, _stringOrNullLength(path), pathSegments, scheme,
-          hasAuthority);
-    } else {
-      var currentPath = this.path;
-      if ((isFile || (hasAuthority && !currentPath.isEmpty)) &&
-          !currentPath.startsWith('/')) {
-        currentPath = "/" + currentPath;
-      }
-      path = currentPath;
-    }
-
-    if (query != null || queryParameters != null) {
-      query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters);
-    } else {
-      query = this._query;
-    }
-
-    if (fragment != null) {
-      fragment = _makeFragment(fragment, 0, fragment.length);
-    } else {
-      fragment = this._fragment;
-    }
-
-    return _Uri._internal(scheme, userInfo, host, port, path, query, fragment);
-  }
-
-  Uri removeFragment() {
-    if (!this.hasFragment) return this;
-    return _Uri._internal(scheme, _userInfo, _host, _port, path, _query, null);
-  }
-
-  static List<String> _computePathSegments(String pathToSplit) {
-    if (pathToSplit.isNotEmpty && pathToSplit.codeUnitAt(0) == _SLASH) {
-      pathToSplit = pathToSplit.substring(1);
-    }
-    return (pathToSplit.isEmpty)
-        ? const <String>[]
-        : List<String>.unmodifiable(
-            pathToSplit.split("/").map(Uri.decodeComponent));
-  }
-
-  static Map<String, List<String>> _computeQueryParametersAll(String? query) {
-    if (query == null || query.isEmpty) return const <String, List<String>>{};
-    Map<String, List<String>> queryParameterLists = _splitQueryStringAll(query);
-    queryParameterLists.updateAll(_toUnmodifiableStringList);
-    return Map<String, List<String>>.unmodifiable(queryParameterLists);
-  }
-
-  Uri normalizePath() {
-    String path = _normalizePath(this.path, scheme, hasAuthority);
-    if (identical(path, this.path)) return this;
-    return this.replace(path: path);
-  }
-
-  static int? _makePort(int? port, String scheme) {
-    // Perform scheme specific normalization.
-    if (port != null && port == _defaultPort(scheme)) return null;
-    return port;
-  }
-
-  /**
-   * Check and normalize a host name.
-   *
-   * If the host name starts and ends with '[' and ']', it is considered an
-   * IPv6 address. If [strictIPv6] is false, the address is also considered
-   * an IPv6 address if it contains any ':' character.
-   *
-   * If it is not an IPv6 address, it is case- and escape-normalized.
-   * This escapes all characters not valid in a reg-name,
-   * and converts all non-escape upper-case letters to lower-case.
-   */
-  static String? _makeHost(String? host, int start, int end, bool strictIPv6) {
-    // TODO(lrn): Should we normalize IPv6 addresses according to RFC 5952?
-    if (host == null) return null;
-    if (start == end) return "";
-    // Host is an IPv6 address if it starts with '[' or contains a colon.
-    if (host.codeUnitAt(start) == _LEFT_BRACKET) {
-      if (host.codeUnitAt(end - 1) != _RIGHT_BRACKET) {
-        _fail(host, start, 'Missing end `]` to match `[` in host');
-      }
-      String zoneID = "";
-      int index = _checkZoneID(host, start + 1, end - 1);
-      if (index < end - 1) {
-        int zoneIDstart =
-            (host.startsWith("25", index + 1)) ? index + 3 : index + 1;
-        zoneID = _normalizeZoneID(host, zoneIDstart, end - 1, "%25");
-      }
-      Uri.parseIPv6Address(host, start + 1, index);
-      // RFC 5952 requires hex digits to be lower case.
-      return host.substring(start, index).toLowerCase() + zoneID + ']';
-    }
-    if (!strictIPv6) {
-      // TODO(lrn): skip if too short to be a valid IPv6 address?
-      for (int i = start; i < end; i++) {
-        if (host.codeUnitAt(i) == _COLON) {
-          String zoneID = "";
-          int index = _checkZoneID(host, start, end);
-          if (index < end) {
-            int zoneIDstart =
-                (host.startsWith("25", index + 1)) ? index + 3 : index + 1;
-            zoneID = _normalizeZoneID(host, zoneIDstart, end, "%25");
-          }
-          Uri.parseIPv6Address(host, start, index);
-          return '[${host.substring(start, index)}' + zoneID + ']';
-        }
-      }
-    }
-    return _normalizeRegName(host, start, end);
-  }
-
-  /// RFC 6874 check for ZoneID
-  /// Return the index of first appeared `%`.
-  static int _checkZoneID(String host, int start, int end) {
-    int index = host.indexOf('%', start);
-    index = (index >= start && index < end) ? index : end;
-    return index;
-  }
-
-  static bool _isZoneIDChar(int char) {
-    return char < 127 && (_zoneIDTable[char >> 4] & (1 << (char & 0xf))) != 0;
-  }
-
-  /**
-   * Validates and does case- and percent-encoding normalization.
-   *
-   * The same as [_normalizeOrSubstring]
-   * except this function does not convert characters to lower case.
-   * The [host] must be an RFC6874 "ZoneID".
-   * ZoneID = 1*(unreserved / pct-encoded)
-   */
-  static String _normalizeZoneID(String host, int start, int end,
-      [String prefix = '']) {
-    StringBuffer? buffer;
-    if (prefix != '') {
-      buffer = StringBuffer(prefix);
-    }
-    int sectionStart = start;
-    int index = start;
-    // Whether all characters between sectionStart and index are normalized,
-    bool isNormalized = true;
-
-    while (index < end) {
-      int char = host.codeUnitAt(index);
-      if (char == _PERCENT) {
-        String? replacement = _normalizeEscape(host, index, true);
-        if (replacement == null && isNormalized) {
-          index += 3;
-          continue;
-        }
-        buffer ??= StringBuffer();
-        String slice = host.substring(sectionStart, index);
-        buffer.write(slice);
-        int sourceLength = 3;
-        if (replacement == null) {
-          replacement = host.substring(index, index + 3);
-        } else if (replacement == "%") {
-          _fail(host, index, "ZoneID should not contain % anymore");
-        }
-        buffer.write(replacement);
-        index += sourceLength;
-        sectionStart = index;
-        isNormalized = true;
-      } else if (_isZoneIDChar(char)) {
-        if (isNormalized && _UPPER_CASE_A <= char && _UPPER_CASE_Z >= char) {
-          // Put initial slice in buffer and continue in non-normalized mode
-          buffer ??= StringBuffer();
-          if (sectionStart < index) {
-            buffer.write(host.substring(sectionStart, index));
-            sectionStart = index;
-          }
-          isNormalized = false;
-        }
-        index++;
-      } else {
-        int sourceLength = 1;
-        if ((char & 0xFC00) == 0xD800 && (index + 1) < end) {
-          int tail = host.codeUnitAt(index + 1);
-          if ((tail & 0xFC00) == 0xDC00) {
-            char = 0x10000 | ((char & 0x3ff) << 10) | (tail & 0x3ff);
-            sourceLength = 2;
-          }
-        }
-        String slice = host.substring(sectionStart, index);
-        (buffer ??= StringBuffer())..write(slice)..write(_escapeChar(char));
-        index += sourceLength;
-        sectionStart = index;
-      }
-    }
-    if (buffer == null) return host.substring(start, end);
-    if (sectionStart < end) {
-      String slice = host.substring(sectionStart, end);
-      buffer.write(slice);
-    }
-    return buffer.toString();
-  }
-
-  static bool _isRegNameChar(int char) {
-    return char < 127 && (_regNameTable[char >> 4] & (1 << (char & 0xf))) != 0;
-  }
-
-  /**
-   * Validates and does case- and percent-encoding normalization.
-   *
-   * The [host] must be an RFC3986 "reg-name". It is converted
-   * to lower case, and percent escapes are converted to either
-   * lower case unreserved characters or upper case escapes.
-   */
-  static String _normalizeRegName(String host, int start, int end) {
-    StringBuffer? buffer;
-    int sectionStart = start;
-    int index = start;
-    // Whether all characters between sectionStart and index are normalized,
-    bool isNormalized = true;
-
-    while (index < end) {
-      int char = host.codeUnitAt(index);
-      if (char == _PERCENT) {
-        // The _regNameTable contains "%", so we check that first.
-        String? replacement = _normalizeEscape(host, index, true);
-        if (replacement == null && isNormalized) {
-          index += 3;
-          continue;
-        }
-        buffer ??= StringBuffer();
-        String slice = host.substring(sectionStart, index);
-        if (!isNormalized) slice = slice.toLowerCase();
-        buffer.write(slice);
-        int sourceLength = 3;
-        if (replacement == null) {
-          replacement = host.substring(index, index + 3);
-        } else if (replacement == "%") {
-          replacement = "%25";
-          sourceLength = 1;
-        }
-        buffer.write(replacement);
-        index += sourceLength;
-        sectionStart = index;
-        isNormalized = true;
-      } else if (_isRegNameChar(char)) {
-        if (isNormalized && _UPPER_CASE_A <= char && _UPPER_CASE_Z >= char) {
-          // Put initial slice in buffer and continue in non-normalized mode
-          buffer ??= StringBuffer();
-          if (sectionStart < index) {
-            buffer.write(host.substring(sectionStart, index));
-            sectionStart = index;
-          }
-          isNormalized = false;
-        }
-        index++;
-      } else if (_isGeneralDelimiter(char)) {
-        _fail(host, index, "Invalid character");
-      } else {
-        int sourceLength = 1;
-        if ((char & 0xFC00) == 0xD800 && (index + 1) < end) {
-          int tail = host.codeUnitAt(index + 1);
-          if ((tail & 0xFC00) == 0xDC00) {
-            char = 0x10000 | ((char & 0x3ff) << 10) | (tail & 0x3ff);
-            sourceLength = 2;
-          }
-        }
-        String slice = host.substring(sectionStart, index);
-        if (!isNormalized) slice = slice.toLowerCase();
-        (buffer ??= StringBuffer())..write(slice)..write(_escapeChar(char));
-        index += sourceLength;
-        sectionStart = index;
-      }
-    }
-    if (buffer == null) return host.substring(start, end);
-    if (sectionStart < end) {
-      String slice = host.substring(sectionStart, end);
-      if (!isNormalized) slice = slice.toLowerCase();
-      buffer.write(slice);
-    }
-    return buffer.toString();
-  }
-
-  /**
-   * Validates scheme characters and does case-normalization.
-   *
-   * Schemes are converted to lower case. They cannot contain escapes.
-   */
-  static String _makeScheme(String scheme, int start, int end) {
-    if (start == end) return "";
-    final int firstCodeUnit = scheme.codeUnitAt(start);
-    if (!_isAlphabeticCharacter(firstCodeUnit)) {
-      _fail(scheme, start, "Scheme not starting with alphabetic character");
-    }
-    bool containsUpperCase = false;
-    for (int i = start; i < end; i++) {
-      final int codeUnit = scheme.codeUnitAt(i);
-      if (!_isSchemeCharacter(codeUnit)) {
-        _fail(scheme, i, "Illegal scheme character");
-      }
-      if (_UPPER_CASE_A <= codeUnit && codeUnit <= _UPPER_CASE_Z) {
-        containsUpperCase = true;
-      }
-    }
-    scheme = scheme.substring(start, end);
-    if (containsUpperCase) scheme = scheme.toLowerCase();
-    return _canonicalizeScheme(scheme);
-  }
-
-  /// Canonicalize a few often-used scheme strings.
-  ///
-  /// This improves memory usage and makes comparison faster.
-  static String _canonicalizeScheme(String scheme) {
-    if (scheme == "http") return "http";
-    if (scheme == "file") return "file";
-    if (scheme == "https") return "https";
-    if (scheme == "package") return "package";
-    return scheme;
-  }
-
-  static String _makeUserInfo(String? userInfo, int start, int end) {
-    if (userInfo == null) return "";
-    return _normalizeOrSubstring(userInfo, start, end, _userinfoTable);
-  }
-
-  static String _makePath(String? path, int start, int end,
-      Iterable<String>? pathSegments, String scheme, bool hasAuthority) {
-    bool isFile = (scheme == "file");
-    bool ensureLeadingSlash = isFile || hasAuthority;
-    String result;
-    if (path == null) {
-      if (pathSegments == null) return isFile ? "/" : "";
-      result = pathSegments
-          .map((s) => _uriEncode(_pathCharTable, s, utf8, false))
-          .join("/");
-    } else if (pathSegments != null) {
-      throw ArgumentError('Both path and pathSegments specified');
-    } else {
-      result = _normalizeOrSubstring(path, start, end, _pathCharOrSlashTable,
-          escapeDelimiters: true);
-    }
-    if (result.isEmpty) {
-      if (isFile) return "/";
-    } else if (ensureLeadingSlash && !result.startsWith('/')) {
-      result = "/" + result;
-    }
-    result = _normalizePath(result, scheme, hasAuthority);
-    return result;
-  }
-
-  /// Performs path normalization (remove dot segments) on a path.
-  ///
-  /// If the URI has neither scheme nor authority, it's considered a
-  /// "pure path" and normalization won't remove leading ".." segments.
-  /// Otherwise it follows the RFC 3986 "remove dot segments" algorithm.
-  static String _normalizePath(String path, String scheme, bool hasAuthority) {
-    if (scheme.isEmpty && !hasAuthority && !path.startsWith('/')) {
-      return _normalizeRelativePath(path, scheme.isNotEmpty || hasAuthority);
-    }
-    return _removeDotSegments(path);
-  }
-
-  static String? _makeQuery(String? query, int start, int end,
-      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters) {
-    if (query != null) {
-      if (queryParameters != null) {
-        throw ArgumentError('Both query and queryParameters specified');
-      }
-      return _normalizeOrSubstring(query, start, end, _queryCharTable,
-          escapeDelimiters: true);
-    }
-    if (queryParameters == null) return null;
-
-    var result = StringBuffer();
-    var separator = "";
-
-    void writeParameter(String key, String? value) {
-      result.write(separator);
-      separator = "&";
-      result.write(Uri.encodeQueryComponent(key));
-      if (value != null && value.isNotEmpty) {
-        result.write("=");
-        result.write(Uri.encodeQueryComponent(value));
-      }
-    }
-
-    queryParameters.forEach((key, value) {
-      if (value == null || value is String) {
-        writeParameter(key, value);
-      } else {
-        Iterable values = value;
-        for (String value in values) {
-          writeParameter(key, value);
-        }
-      }
-    });
-    return result.toString();
-  }
-
-  static String? _makeFragment(String? fragment, int start, int end) {
-    if (fragment == null) return null;
-    return _normalizeOrSubstring(fragment, start, end, _queryCharTable,
-        escapeDelimiters: true);
-  }
-
-  /**
-   * Performs RFC 3986 Percent-Encoding Normalization.
-   *
-   * Returns a replacement string that should be replace the original escape.
-   * Returns null if no replacement is necessary because the escape is
-   * not for an unreserved character and is already non-lower-case.
-   *
-   * Returns "%" if the escape is invalid (not two valid hex digits following
-   * the percent sign). The calling code should replace the percent
-   * sign with "%25", but leave the following two characters unmodified.
-   *
-   * If [lowerCase] is true, a single character returned is always lower case,
-   */
-  static String? _normalizeEscape(String source, int index, bool lowerCase) {
-    assert(source.codeUnitAt(index) == _PERCENT);
-    if (index + 2 >= source.length) {
-      return "%"; // Marks the escape as invalid.
-    }
-    int firstDigit = source.codeUnitAt(index + 1);
-    int secondDigit = source.codeUnitAt(index + 2);
-    int firstDigitValue = hexDigitValue(firstDigit);
-    int secondDigitValue = hexDigitValue(secondDigit);
-    if (firstDigitValue < 0 || secondDigitValue < 0) {
-      return "%"; // Marks the escape as invalid.
-    }
-    int value = firstDigitValue * 16 + secondDigitValue;
-    if (_isUnreservedChar(value)) {
-      if (lowerCase && _UPPER_CASE_A <= value && _UPPER_CASE_Z >= value) {
-        value |= 0x20;
-      }
-      return String.fromCharCode(value);
-    }
-    if (firstDigit >= _LOWER_CASE_A || secondDigit >= _LOWER_CASE_A) {
-      // Either digit is lower case.
-      return source.substring(index, index + 3).toUpperCase();
-    }
-    // Escape is retained, and is already non-lower case, so return null to
-    // represent "no replacement necessary".
-    return null;
-  }
-
-  static String _escapeChar(int char) {
-    assert(char <= 0x10ffff); // It's a valid unicode code point.
-    List<int> codeUnits;
-    if (char < 0x80) {
-      // ASCII, a single percent encoded sequence.
-      codeUnits = Uint8List(3);
-      codeUnits[0] = _PERCENT;
-      codeUnits[1] = _hexDigits.codeUnitAt(char >> 4);
-      codeUnits[2] = _hexDigits.codeUnitAt(char & 0xf);
-    } else {
-      // Do UTF-8 encoding of character, then percent encode bytes.
-      int flag = 0xc0; // The high-bit markers on the first byte of UTF-8.
-      int encodedBytes = 2;
-      if (char > 0x7ff) {
-        flag = 0xe0;
-        encodedBytes = 3;
-        if (char > 0xffff) {
-          encodedBytes = 4;
-          flag = 0xf0;
-        }
-      }
-      codeUnits = Uint8List(3 * encodedBytes);
-      int index = 0;
-      while (--encodedBytes >= 0) {
-        int byte = ((char >> (6 * encodedBytes)) & 0x3f) | flag;
-        codeUnits[index] = _PERCENT;
-        codeUnits[index + 1] = _hexDigits.codeUnitAt(byte >> 4);
-        codeUnits[index + 2] = _hexDigits.codeUnitAt(byte & 0xf);
-        index += 3;
-        flag = 0x80; // Following bytes have only high bit set.
-      }
-    }
-    return String.fromCharCodes(codeUnits);
-  }
-
-  /**
-   * Normalizes using [_normalize] or returns substring of original.
-   *
-   * If [_normalize] returns `null` (original content is already normalized),
-   * this methods returns the substring if [component] from [start] to [end].
-   */
-  static String _normalizeOrSubstring(
-      String component, int start, int end, List<int> charTable,
-      {bool escapeDelimiters = false}) {
-    return _normalize(component, start, end, charTable,
-            escapeDelimiters: escapeDelimiters) ??
-        component.substring(start, end);
-  }
-
-  /**
-   * Runs through component checking that each character is valid and
-   * normalize percent escapes.
-   *
-   * Uses [charTable] to check if a non-`%` character is allowed.
-   * Each `%` character must be followed by two hex digits.
-   * If the hex-digits are lower case letters, they are converted to
-   * upper case.
-   *
-   * Returns `null` if the original content was already normalized.
-   */
-  static String? _normalize(
-      String component, int start, int end, List<int> charTable,
-      {bool escapeDelimiters = false}) {
-    StringBuffer? buffer;
-    int sectionStart = start;
-    int index = start;
-    // Loop while characters are valid and escapes correct and upper-case.
-    while (index < end) {
-      int char = component.codeUnitAt(index);
-      if (char < 127 && (charTable[char >> 4] & (1 << (char & 0x0f))) != 0) {
-        index++;
-      } else {
-        String? replacement;
-        int sourceLength;
-        if (char == _PERCENT) {
-          replacement = _normalizeEscape(component, index, false);
-          // Returns null if we should keep the existing escape.
-          if (replacement == null) {
-            index += 3;
-            continue;
-          }
-          // Returns "%" if we should escape the existing percent.
-          if ("%" == replacement) {
-            replacement = "%25";
-            sourceLength = 1;
-          } else {
-            sourceLength = 3;
-          }
-        } else if (!escapeDelimiters && _isGeneralDelimiter(char)) {
-          _fail(component, index, "Invalid character");
-          throw "unreachable"; // TODO(lrn): Remove when Never-returning functions are recognized as throwing.
-        } else {
-          sourceLength = 1;
-          if ((char & 0xFC00) == 0xD800) {
-            // Possible lead surrogate.
-            if (index + 1 < end) {
-              int tail = component.codeUnitAt(index + 1);
-              if ((tail & 0xFC00) == 0xDC00) {
-                // Tail surrogate.
-                sourceLength = 2;
-                char = 0x10000 | ((char & 0x3ff) << 10) | (tail & 0x3ff);
-              }
-            }
-          }
-          replacement = _escapeChar(char);
-        }
-        (buffer ??= StringBuffer())
-          ..write(component.substring(sectionStart, index))
-          ..write(replacement);
-        index += sourceLength;
-        sectionStart = index;
-      }
-    }
-    if (buffer == null) {
-      return null;
-    }
-    if (sectionStart < end) {
-      buffer.write(component.substring(sectionStart, end));
-    }
-    return buffer.toString();
-  }
-
-  static bool _isSchemeCharacter(int ch) {
-    return ch < 128 && ((_schemeTable[ch >> 4] & (1 << (ch & 0x0f))) != 0);
-  }
-
-  static bool _isGeneralDelimiter(int ch) {
-    return ch <= _RIGHT_BRACKET &&
-        ((_genDelimitersTable[ch >> 4] & (1 << (ch & 0x0f))) != 0);
-  }
-
-  /**
-   * Returns whether the URI is absolute.
-   */
-  bool get isAbsolute => scheme != "" && fragment == "";
-
-  String _mergePaths(String base, String reference) {
-    // Optimize for the case: absolute base, reference beginning with "../".
-    int backCount = 0;
-    int refStart = 0;
-    // Count number of "../" at beginning of reference.
-    while (reference.startsWith("../", refStart)) {
-      refStart += 3;
-      backCount++;
-    }
-
-    // Drop last segment - everything after last '/' of base.
-    int baseEnd = base.lastIndexOf('/');
-    // Drop extra segments for each leading "../" of reference.
-    while (baseEnd > 0 && backCount > 0) {
-      int newEnd = base.lastIndexOf('/', baseEnd - 1);
-      if (newEnd < 0) {
-        break;
-      }
-      int delta = baseEnd - newEnd;
-      // If we see a "." or ".." segment in base, stop here and let
-      // _removeDotSegments handle it.
-      if ((delta == 2 || delta == 3) &&
-          base.codeUnitAt(newEnd + 1) == _DOT &&
-          (delta == 2 || base.codeUnitAt(newEnd + 2) == _DOT)) {
-        break;
-      }
-      baseEnd = newEnd;
-      backCount--;
-    }
-    return base.replaceRange(
-        baseEnd + 1, null, reference.substring(refStart - 3 * backCount));
-  }
-
-  /// Make a guess at whether a path contains a `..` or `.` segment.
-  ///
-  /// This is a primitive test that can cause false positives.
-  /// It's only used to avoid a more expensive operation in the case where
-  /// it's not necessary.
-  static bool _mayContainDotSegments(String path) {
-    if (path.startsWith('.')) return true;
-    int index = path.indexOf("/.");
-    return index != -1;
-  }
-
-  /// Removes '.' and '..' segments from a path.
-  ///
-  /// Follows the RFC 2986 "remove dot segments" algorithm.
-  /// This algorithm is only used on paths of URIs with a scheme,
-  /// and it treats the path as if it is absolute (leading '..' are removed).
-  static String _removeDotSegments(String path) {
-    if (!_mayContainDotSegments(path)) return path;
-    assert(path.isNotEmpty); // An empty path would not have dot segments.
-    List<String> output = [];
-    bool appendSlash = false;
-    for (String segment in path.split("/")) {
-      appendSlash = false;
-      if (segment == "..") {
-        if (output.isNotEmpty) {
-          output.removeLast();
-          if (output.isEmpty) {
-            output.add("");
-          }
-        }
-        appendSlash = true;
-      } else if ("." == segment) {
-        appendSlash = true;
-      } else {
-        output.add(segment);
-      }
-    }
-    if (appendSlash) output.add("");
-    return output.join("/");
-  }
-
-  /// Removes all `.` segments and any non-leading `..` segments.
-  ///
-  /// If the path starts with something that looks like a scheme,
-  /// and [allowScheme] is false, the colon is escaped.
-  ///
-  /// Removing the ".." from a "bar/foo/.." sequence results in "bar/"
-  /// (trailing "/"). If the entire path is removed (because it contains as
-  /// many ".." segments as real segments), the result is "./".
-  /// This is different from an empty string, which represents "no path",
-  /// when you resolve it against a base URI with a path with a non-empty
-  /// final segment.
-  static String _normalizeRelativePath(String path, bool allowScheme) {
-    assert(!path.startsWith('/')); // Only get called for relative paths.
-    if (!_mayContainDotSegments(path)) {
-      if (!allowScheme) path = _escapeScheme(path);
-      return path;
-    }
-    assert(path.isNotEmpty); // An empty path would not have dot segments.
-    List<String> output = [];
-    bool appendSlash = false;
-    for (String segment in path.split("/")) {
-      appendSlash = false;
-      if (".." == segment) {
-        if (!output.isEmpty && output.last != "..") {
-          output.removeLast();
-          appendSlash = true;
-        } else {
-          output.add("..");
-        }
-      } else if ("." == segment) {
-        appendSlash = true;
-      } else {
-        output.add(segment);
-      }
-    }
-    if (output.isEmpty || (output.length == 1 && output[0].isEmpty)) {
-      return "./";
-    }
-    if (appendSlash || output.last == '..') output.add("");
-    if (!allowScheme) output[0] = _escapeScheme(output[0]);
-    return output.join("/");
-  }
-
-  /// If [path] starts with a valid scheme, escape the percent.
-  static String _escapeScheme(String path) {
-    if (path.length >= 2 && _isAlphabeticCharacter(path.codeUnitAt(0))) {
-      for (int i = 1; i < path.length; i++) {
-        int char = path.codeUnitAt(i);
-        if (char == _COLON) {
-          return "${path.substring(0, i)}%3A${path.substring(i + 1)}";
-        }
-        if (char > 127 ||
-            ((_schemeTable[char >> 4] & (1 << (char & 0x0f))) == 0)) {
-          break;
-        }
-      }
-    }
-    return path;
-  }
-
-  Uri resolve(String reference) {
-    return resolveUri(Uri.parse(reference));
-  }
-
-  Uri resolveUri(Uri reference) {
-    // From RFC 3986.
-    String targetScheme;
-    String targetUserInfo = "";
-    String? targetHost;
-    int? targetPort;
-    String targetPath;
-    String? targetQuery;
-    if (reference.scheme.isNotEmpty) {
-      targetScheme = reference.scheme;
-      if (reference.hasAuthority) {
-        targetUserInfo = reference.userInfo;
-        targetHost = reference.host;
-        targetPort = reference.hasPort ? reference.port : null;
-      }
-      targetPath = _removeDotSegments(reference.path);
-      if (reference.hasQuery) {
-        targetQuery = reference.query;
-      }
-    } else {
-      targetScheme = this.scheme;
-      if (reference.hasAuthority) {
-        targetUserInfo = reference.userInfo;
-        targetHost = reference.host;
-        targetPort =
-            _makePort(reference.hasPort ? reference.port : null, targetScheme);
-        targetPath = _removeDotSegments(reference.path);
-        if (reference.hasQuery) targetQuery = reference.query;
-      } else {
-        targetUserInfo = this._userInfo;
-        targetHost = this._host;
-        targetPort = this._port;
-        if (reference.path == "") {
-          targetPath = this.path;
-          if (reference.hasQuery) {
-            targetQuery = reference.query;
-          } else {
-            targetQuery = this._query;
-          }
-        } else {
-          if (reference.hasAbsolutePath) {
-            targetPath = _removeDotSegments(reference.path);
-          } else {
-            // This is the RFC 3986 behavior for merging.
-            if (this.hasEmptyPath) {
-              if (!this.hasAuthority) {
-                if (!this.hasScheme) {
-                  // Keep the path relative if no scheme or authority.
-                  targetPath = reference.path;
-                } else {
-                  // Remove leading dot-segments if the path is put
-                  // beneath a scheme.
-                  targetPath = _removeDotSegments(reference.path);
-                }
-              } else {
-                // RFC algorithm for base with authority and empty path.
-                targetPath = _removeDotSegments("/" + reference.path);
-              }
-            } else {
-              var mergedPath = _mergePaths(this.path, reference.path);
-              if (this.hasScheme || this.hasAuthority || this.hasAbsolutePath) {
-                targetPath = _removeDotSegments(mergedPath);
-              } else {
-                // Non-RFC 3986 behavior.
-                // If both base and reference are relative paths,
-                // allow the merged path to start with "..".
-                // The RFC only specifies the case where the base has a scheme.
-                targetPath = _normalizeRelativePath(
-                    mergedPath, this.hasScheme || this.hasAuthority);
-              }
-            }
-          }
-          if (reference.hasQuery) targetQuery = reference.query;
-        }
-      }
-    }
-    String? fragment = reference.hasFragment ? reference.fragment : null;
-    return _Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort,
-        targetPath, targetQuery, fragment);
-  }
-
-  bool get hasScheme => scheme.isNotEmpty;
-
-  bool get hasAuthority => _host != null;
-
-  bool get hasPort => _port != null;
-
-  bool get hasQuery => _query != null;
-
-  bool get hasFragment => _fragment != null;
-
-  bool get hasEmptyPath => path.isEmpty;
-
-  bool get hasAbsolutePath => path.startsWith('/');
-
-  String get origin {
-    if (scheme == "") {
-      throw StateError("Cannot use origin without a scheme: $this");
-    }
-    if (scheme != "http" && scheme != "https") {
-      throw StateError(
-          "Origin is only applicable schemes http and https: $this");
-    }
-    String? host = _host;
-    if (host == null || host == "") {
-      throw StateError(
-          "A $scheme: URI should have a non-empty host name: $this");
-    }
-    int? port = _port;
-    if (port == null) return "$scheme://$host";
-    return "$scheme://$host:$port";
-  }
-
-  String toFilePath({bool? windows}) {
-    if (scheme != "" && scheme != "file") {
-      throw UnsupportedError("Cannot extract a file path from a $scheme URI");
-    }
-    if (query != "") {
-      throw UnsupportedError(
-          "Cannot extract a file path from a URI with a query component");
-    }
-    if (fragment != "") {
-      throw UnsupportedError(
-          "Cannot extract a file path from a URI with a fragment component");
-    }
-    return (windows ?? _isWindows) ? _toWindowsFilePath(this) : _toFilePath();
-  }
-
-  String _toFilePath() {
-    if (hasAuthority && host != "") {
-      throw UnsupportedError(
-          "Cannot extract a non-Windows file path from a file URI "
-          "with an authority");
-    }
-    // Use path segments to have any escapes unescaped.
-    var pathSegments = this.pathSegments;
-    _checkNonWindowsPathReservedCharacters(pathSegments, false);
-    var result = StringBuffer();
-    if (hasAbsolutePath) result.write("/");
-    result.writeAll(pathSegments, "/");
-    return result.toString();
-  }
-
-  static String _toWindowsFilePath(Uri uri) {
-    bool hasDriveLetter = false;
-    var segments = uri.pathSegments;
-    if (segments.length > 0 &&
-        segments[0].length == 2 &&
-        segments[0].codeUnitAt(1) == _COLON) {
-      _checkWindowsDriveLetter(segments[0].codeUnitAt(0), false);
-      _checkWindowsPathReservedCharacters(segments, false, 1);
-      hasDriveLetter = true;
-    } else {
-      _checkWindowsPathReservedCharacters(segments, false, 0);
-    }
-    var result = StringBuffer();
-    if (uri.hasAbsolutePath && !hasDriveLetter) result.write(r"\");
-    if (uri.hasAuthority) {
-      var host = uri.host;
-      if (host.isNotEmpty) {
-        result.write(r"\");
-        result.write(host);
-        result.write(r"\");
-      }
-    }
-    result.writeAll(segments, r"\");
-    if (hasDriveLetter && segments.length == 1) result.write(r"\");
-    return result.toString();
-  }
-
-  void _writeAuthority(StringSink ss) {
-    if (_userInfo.isNotEmpty) {
-      ss.write(_userInfo);
-      ss.write("@");
-    }
-    if (_host != null) ss.write(_host);
-    if (_port != null) {
-      ss.write(":");
-      ss.write(_port);
-    }
-  }
-
-  /**
-   * Access the structure of a `data:` URI.
-   *
-   * Returns a [UriData] object for `data:` URIs and `null` for all other
-   * URIs.
-   * The [UriData] object can be used to access the media type and data
-   * of a `data:` URI.
-   */
-  UriData? get data => (scheme == "data") ? UriData.fromUri(this) : null;
-
-  String toString() => _text;
-
-  String _initializeText() {
-    StringBuffer sb = StringBuffer();
-    if (scheme.isNotEmpty) sb..write(scheme)..write(":");
-    if (hasAuthority || (scheme == "file")) {
-      // File URIS always have the authority, even if it is empty.
-      // The empty URI means "localhost".
-      sb.write("//");
-      _writeAuthority(sb);
-    }
-    sb.write(path);
-    if (_query != null) sb..write("?")..write(_query);
-    if (_fragment != null) sb..write("#")..write(_fragment);
-    return sb.toString();
-  }
-
-  bool operator ==(Object other) {
-    if (identical(this, other)) return true;
-    return other is Uri &&
-        scheme == other.scheme &&
-        hasAuthority == other.hasAuthority &&
-        userInfo == other.userInfo &&
-        host == other.host &&
-        port == other.port &&
-        path == other.path &&
-        hasQuery == other.hasQuery &&
-        query == other.query &&
-        hasFragment == other.hasFragment &&
-        fragment == other.fragment;
-  }
-
-  static List<String> _createList() => <String>[];
-
-  static Map<String, List<String>> _splitQueryStringAll(String query,
-      {Encoding encoding = utf8}) {
-    var result = <String, List<String>>{};
-    int i = 0;
-    int start = 0;
-    int equalsIndex = -1;
-
-    void parsePair(int start, int equalsIndex, int end) {
-      String key;
-      String value;
-      if (start == end) return;
-      if (equalsIndex < 0) {
-        key = _uriDecode(query, start, end, encoding, true);
-        value = "";
-      } else {
-        key = _uriDecode(query, start, equalsIndex, encoding, true);
-        value = _uriDecode(query, equalsIndex + 1, end, encoding, true);
-      }
-      result.putIfAbsent(key, _createList).add(value);
-    }
-
-    while (i < query.length) {
-      int char = query.codeUnitAt(i);
-      if (char == _EQUALS) {
-        if (equalsIndex < 0) equalsIndex = i;
-      } else if (char == _AMPERSAND) {
-        parsePair(start, equalsIndex, i);
-        start = i + 1;
-        equalsIndex = -1;
-      }
-      i++;
-    }
-    parsePair(start, equalsIndex, i);
-    return result;
-  }
-
-  external static String _uriEncode(List<int> canonicalTable, String text,
-      Encoding encoding, bool spaceToPlus);
-
-  /**
-   * Convert a byte (2 character hex sequence) in string [s] starting
-   * at position [pos] to its ordinal value
-   */
-  static int _hexCharPairToByte(String s, int pos) {
-    int byte = 0;
-    for (int i = 0; i < 2; i++) {
-      var charCode = s.codeUnitAt(pos + i);
-      if (0x30 <= charCode && charCode <= 0x39) {
-        byte = byte * 16 + charCode - 0x30;
-      } else {
-        // Check ranges A-F (0x41-0x46) and a-f (0x61-0x66).
-        charCode |= 0x20;
-        if (0x61 <= charCode && charCode <= 0x66) {
-          byte = byte * 16 + charCode - 0x57;
-        } else {
-          throw ArgumentError("Invalid URL encoding");
-        }
-      }
-    }
-    return byte;
-  }
-
-  /**
-   * Uri-decode a percent-encoded string.
-   *
-   * It unescapes the string [text] and returns the unescaped string.
-   *
-   * This function is similar to the JavaScript-function `decodeURI`.
-   *
-   * If [plusToSpace] is `true`, plus characters will be converted to spaces.
-   *
-   * The decoder will create a byte-list of the percent-encoded parts, and then
-   * decode the byte-list using [encoding]. The default encodings UTF-8.
-   */
-  static String _uriDecode(
-      String text, int start, int end, Encoding encoding, bool plusToSpace) {
-    assert(0 <= start);
-    assert(start <= end);
-    assert(end <= text.length);
-    // First check whether there is any characters which need special handling.
-    bool simple = true;
-    for (int i = start; i < end; i++) {
-      var codeUnit = text.codeUnitAt(i);
-      if (codeUnit > 127 ||
-          codeUnit == _PERCENT ||
-          (plusToSpace && codeUnit == _PLUS)) {
-        simple = false;
-        break;
-      }
-    }
-    List<int> bytes;
-    if (simple) {
-      if (utf8 == encoding || latin1 == encoding || ascii == encoding) {
-        return text.substring(start, end);
-      } else {
-        bytes = text.substring(start, end).codeUnits;
-      }
-    } else {
-      bytes = <int>[];
-      for (int i = start; i < end; i++) {
-        var codeUnit = text.codeUnitAt(i);
-        if (codeUnit > 127) {
-          throw ArgumentError("Illegal percent encoding in URI");
-        }
-        if (codeUnit == _PERCENT) {
-          if (i + 3 > text.length) {
-            throw ArgumentError('Truncated URI');
-          }
-          bytes.add(_hexCharPairToByte(text, i + 1));
-          i += 2;
-        } else if (plusToSpace && codeUnit == _PLUS) {
-          bytes.add(_SPACE);
-        } else {
-          bytes.add(codeUnit);
-        }
-      }
-    }
-    return encoding.decode(bytes);
-  }
-
-  static bool _isAlphabeticCharacter(int codeUnit) {
-    var lowerCase = codeUnit | 0x20;
-    return (_LOWER_CASE_A <= lowerCase && lowerCase <= _LOWER_CASE_Z);
-  }
-
-  static bool _isUnreservedChar(int char) {
-    return char < 127 &&
-        ((_unreservedTable[char >> 4] & (1 << (char & 0x0f))) != 0);
-  }
-
-  // Tables of char-codes organized as a bit vector of 128 bits where
-  // each bit indicate whether a character code on the 0-127 needs to
-  // be escaped or not.
-
-  // The unreserved characters of RFC 3986.
-  static const _unreservedTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                                   -.
-    0x6000, // 0x20 - 0x2f  0000000000000110
-    //                      0123456789
-    0x03ff, // 0x30 - 0x3f  1111111111000000
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // The unreserved characters of RFC 2396.
-  static const _unreserved2396Table = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !     '()*  -.
-    0x6782, // 0x20 - 0x2f  0100000111100110
-    //                      0123456789
-    0x03ff, // 0x30 - 0x3f  1111111111000000
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Table of reserved characters specified by ECMAScript 5.
-  static const _encodeFullTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       ! #$ &'()*+,-./
-    0xffda, // 0x20 - 0x2f  0101101111111111
-    //                      0123456789:; = ?
-    0xafff, // 0x30 - 0x3f  1111111111110101
-    //                      @ABCDEFGHIJKLMNO
-    0xffff, // 0x40 - 0x4f  1111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Characters allowed in the scheme.
-  static const _schemeTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                                 + -.
-    0x6800, // 0x20 - 0x2f  0000000000010110
-    //                      0123456789
-    0x03ff, // 0x30 - 0x3f  1111111111000000
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ
-    0x07ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz
-    0x07ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // General delimiter characters, RFC 3986 section 2.2.
-  // gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"
-  //
-  static const _genDelimitersTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                         #           /
-    0x8008, // 0x20 - 0x2f  0001000000000001
-    //                                :    ?
-    0x8400, // 0x30 - 0x3f  0000000000100001
-    //                      @
-    0x0001, // 0x40 - 0x4f  1000000000000000
-    //                                 [ ]
-    0x2800, // 0x50 - 0x5f  0000000000010100
-    //
-    0x0000, // 0x60 - 0x6f  0000000000000000
-    //
-    0x0000, // 0x70 - 0x7f  0000000000000000
-  ];
-
-  // Characters allowed in the userinfo as of RFC 3986.
-  // RFC 3986 Appendix A
-  // userinfo = *( unreserved / pct-encoded / sub-delims / ':')
-  static const _userinfoTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $ &'()*+,-.
-    0x7fd2, // 0x20 - 0x2f  0100101111111110
-    //                      0123456789:; =
-    0x2fff, // 0x30 - 0x3f  1111111111110100
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Characters allowed in the reg-name as of RFC 3986.
-  // RFC 3986 Appendix A
-  // reg-name = *( unreserved / pct-encoded / sub-delims )
-  static const _regNameTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $%&'()*+,-.
-    0x7ff2, // 0x20 - 0x2f  0100111111111110
-    //                      0123456789 ; =
-    0x2bff, // 0x30 - 0x3f  1111111111010100
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Characters allowed in the path as of RFC 3986.
-  // RFC 3986 section 3.3.
-  // pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
-  static const _pathCharTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $ &'()*+,-.
-    0x7fd2, // 0x20 - 0x2f  0100101111111110
-    //                      0123456789:; =
-    0x2fff, // 0x30 - 0x3f  1111111111110100
-    //                      @ABCDEFGHIJKLMNO
-    0xffff, // 0x40 - 0x4f  1111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Characters allowed in the path as of RFC 3986.
-  // RFC 3986 section 3.3 *and* slash.
-  static const _pathCharOrSlashTable = [
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $ &'()*+,-./
-    0xffd2, // 0x20 - 0x2f  0100101111111111
-    //                      0123456789:; =
-    0x2fff, // 0x30 - 0x3f  1111111111110100
-    //                      @ABCDEFGHIJKLMNO
-    0xffff, // 0x40 - 0x4f  1111111111111111
-
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Characters allowed in the query as of RFC 3986.
-  // RFC 3986 section 3.4.
-  // query = *( pchar / "/" / "?" )
-  static const _queryCharTable = [
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $ &'()*+,-./
-    0xffd2, // 0x20 - 0x2f  0100101111111111
-    //                      0123456789:; = ?
-    0xafff, // 0x30 - 0x3f  1111111111110101
-    //                      @ABCDEFGHIJKLMNO
-    0xffff, // 0x40 - 0x4f  1111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-
-  // Characters allowed in the ZoneID as of RFC 6874.
-  // ZoneID = 1*( unreserved / pct-encoded )
-  static const _zoneIDTable = <int>[
-    //                     LSB            MSB
-    //                      |              |
-    0x0000, // 0x00 - 0x0f  0000000000000000
-    0x0000, // 0x10 - 0x1f  0000000000000000
-    //                       !  $%&'()*+,-.
-    0x6000, // 0x20 - 0x2f  0000000000000110
-    //                      0123456789 ; =
-    0x03ff, // 0x30 - 0x3f  1111111111000000
-    //                       ABCDEFGHIJKLMNO
-    0xfffe, // 0x40 - 0x4f  0111111111111111
-    //                      PQRSTUVWXYZ    _
-    0x87ff, // 0x50 - 0x5f  1111111111100001
-    //                       abcdefghijklmno
-    0xfffe, // 0x60 - 0x6f  0111111111111111
-    //                      pqrstuvwxyz   ~
-    0x47ff, // 0x70 - 0x7f  1111111111100010
-  ];
-}
-
-// --------------------------------------------------------------------
-// Data URI
-// --------------------------------------------------------------------
-
-/**
- * A way to access the structure of a `data:` URI.
- *
- * Data URIs are non-hierarchical URIs that can contain any binary data.
- * They are defined by [RFC 2397](https://tools.ietf.org/html/rfc2397).
- *
- * This class allows parsing the URI text and extracting individual parts of the
- * URI, as well as building the URI text from structured parts.
- */
-class UriData {
-  static const int _noScheme = -1;
-  /**
-   * Contains the text content of a `data:` URI, with or without a
-   * leading `data:`.
-   *
-   * If [_separatorIndices] starts with `4` (the index of the `:`), then
-   * there is a leading `data:`, otherwise [_separatorIndices] starts with
-   * `-1`.
-   */
-  final String _text;
-
-  /**
-   * List of the separators (';', '=' and ',') in the text.
-   *
-   * Starts with the index of the `:` in `data:` of the mimeType.
-   * That is always either -1 or 4, depending on whether `_text` includes the
-   * `data:` scheme or not.
-   *
-   * The first speparator ends the mime type. We don't bother with finding
-   * the '/' inside the mime type.
-   *
-   * Each two separators after that marks a parameter key and value.
-   *
-   * If there is a single separator left, it ends the "base64" marker.
-   *
-   * So the following separators are found for a text:
-   * ```
-   * data:text/plain;foo=bar;base64,ARGLEBARGLE=
-   *     ^          ^   ^   ^      ^
-   * ```
-   */
-  final List<int> _separatorIndices;
-
-  /**
-   * Cache of the result returned by [uri].
-   */
-  Uri? _uriCache;
-
-  UriData._(this._text, this._separatorIndices, this._uriCache);
-
-  // Avoid shadowing by argument.
-  static const Base64Codec _base64 = base64;
-
-  /**
-   * Creates a `data:` URI containing the [content] string.
-   *
-   * Equivalent to `new Uri.dataFromString(...).data`, but may
-   * be more efficient if the [uri] itself isn't used.
-   */
-  factory UriData.fromString(String content,
-      {String? mimeType,
-      Encoding? encoding,
-      Map<String, String>? parameters,
-      bool base64 = false}) {
-    StringBuffer buffer = StringBuffer();
-    List<int> indices = [_noScheme];
-    String? charsetName = parameters?.["charset"];
-    String? encodingName;
-    if (encoding == null) {
-      if (charsetName != null) {
-        encoding = Encoding.getByName(charsetName);
-      }
-    } else if (charsetName == null) {
-      // Non-null only if parameters does not contain "charset".
-      encodingName = encoding.name;
-    }
-    encoding ??= ascii;
-    _writeUri(mimeType, encodingName, parameters, buffer, indices);
-    indices.add(buffer.length);
-    if (base64) {
-      buffer.write(';base64,');
-      indices.add(buffer.length - 1);
-      buffer.write(encoding.fuse(_base64).encode(content));
-    } else {
-      buffer.write(',');
-      _uriEncodeBytes(_uricTable, encoding.encode(content), buffer);
-    }
-    return UriData._(buffer.toString(), indices, null);
-  }
-
-  /**
-   * Creates a `data:` URI containing an encoding of [bytes].
-   *
-   * Equivalent to `new Uri.dataFromBytes(...).data`, but may
-   * be more efficient if the [uri] itself isn't used.
-   */
-  factory UriData.fromBytes(List<int> bytes,
-      {String mimeType = "application/octet-stream",
-      Map<String, String>? parameters,
-      bool percentEncoded = false}) {
-    StringBuffer buffer = StringBuffer();
-    List<int> indices = [_noScheme];
-    _writeUri(mimeType, null, parameters, buffer, indices);
-    indices.add(buffer.length);
-    if (percentEncoded) {
-      buffer.write(',');
-      _uriEncodeBytes(_uricTable, bytes, buffer);
-    } else {
-      buffer.write(';base64,');
-      indices.add(buffer.length - 1);
-      _base64.encoder
-          .startChunkedConversion(StringConversionSink.fromStringSink(buffer))
-          .addSlice(bytes, 0, bytes.length, true);
-    }
-
-    return UriData._(buffer.toString(), indices, null);
-  }
-
-  /**
-   * Creates a `DataUri` from a [Uri] which must have `data` as [Uri.scheme].
-   *
-   * The [uri] must have scheme `data` and no authority or fragment,
-   * and the path (concatenated with the query, if there is one) must be valid
-   * as data URI content with the same rules as [parse].
-   */
-  factory UriData.fromUri(Uri uri) {
-    if (uri.scheme != "data") {
-      throw ArgumentError.value(uri, "uri", "Scheme must be 'data'");
-    }
-    if (uri.hasAuthority) {
-      throw ArgumentError.value(uri, "uri", "Data uri must not have authority");
-    }
-    if (uri.hasFragment) {
-      throw ArgumentError.value(
-          uri, "uri", "Data uri must not have a fragment part");
-    }
-    if (!uri.hasQuery) {
-      return _parse(uri.path, 0, uri);
-    }
-    // Includes path and query (and leading "data:").
-    return _parse(uri.toString(), 5, uri);
-  }
-
-  /**
-   * Writes the initial part of a `data:` uri, from after the "data:"
-   * until just before the ',' before the data, or before a `;base64,`
-   * marker.
-   *
-   * Of an [indices] list is passed, separator indices are stored in that
-   * list.
-   */
-  static void _writeUri(
-      String? mimeType,
-      String? charsetName,
-      Map<String, String>? parameters,
-      StringBuffer buffer,
-      List<int>? indices) {
-    if (mimeType == null || mimeType == "text/plain") {
-      mimeType = "";
-    }
-
-    if (mimeType.isEmpty || identical(mimeType, "application/octet-stream")) {
-      buffer.write(mimeType); // Common cases need no escaping.
-    } else {
-      int slashIndex = _validateMimeType(mimeType);
-      if (slashIndex < 0) {
-        throw ArgumentError.value(mimeType, "mimeType", "Invalid MIME type");
-      }
-      buffer.write(_Uri._uriEncode(
-          _tokenCharTable, mimeType.substring(0, slashIndex), utf8, false));
-      buffer.write("/");
-      buffer.write(_Uri._uriEncode(
-          _tokenCharTable, mimeType.substring(slashIndex + 1), utf8, false));
-    }
-    if (charsetName != null) {
-      // TODO(39209): Use ?.. when sequences are properly supported.
-      if (indices != null) indices..add(buffer.length)..add(buffer.length + 8);
-      buffer.write(";charset=");
-      buffer.write(_Uri._uriEncode(_tokenCharTable, charsetName, utf8, false));
-    }
-    parameters?.forEach((key, value) {
-      if (key.isEmpty) {
-        throw ArgumentError.value("", "Parameter names must not be empty");
-      }
-      if (value.isEmpty) {
-        throw ArgumentError.value(
-            "", "Parameter values must not be empty", 'parameters["$key"]');
-      }
-      indices?.add(buffer.length);
-      buffer.write(';');
-      // Encode any non-RFC2045-token character and both '%' and '#'.
-      buffer.write(_Uri._uriEncode(_tokenCharTable, key, utf8, false));
-      indices?.add(buffer.length);
-      buffer.write('=');
-      buffer.write(_Uri._uriEncode(_tokenCharTable, value, utf8, false));
-    });
-  }
-
-  /**
-   * Checks mimeType is valid-ish (`token '/' token`).
-   *
-   * Returns the index of the slash, or -1 if the mime type is not
-   * considered valid.
-   *
-   * Currently only looks for slashes, all other characters will be
-   * percent-encoded as UTF-8 if necessary.
-   */
-  static int _validateMimeType(String mimeType) {
-    int slashIndex = -1;
-    for (int i = 0; i < mimeType.length; i++) {
-      var char = mimeType.codeUnitAt(i);
-      if (char != _SLASH) continue;
-      if (slashIndex < 0) {
-        slashIndex = i;
-        continue;
-      }
-      return -1;
-    }
-    return slashIndex;
-  }
-
-  /**
-   * Parses a string as a `data` URI.
-   *
-   * The string must have the format:
-   *
-   * ```
-   * 'data:' (type '/' subtype)? (';' attribute '=' value)* (';base64')? ',' data
-   * ````
-   *
-   * where `type`, `subtype`, `attribute` and `value` are specified in RFC-2045,
-   * and `data` is a sequence of URI-characters (RFC-2396 `uric`).
-   *
-   * This means that all the characters must be ASCII, but the URI may contain
-   * percent-escapes for non-ASCII byte values that need an interpretation
-   * to be converted to the corresponding string.
-   *
-   * Parsing checks that Base64 encoded data is valid, and it normalizes it
-   * to use the default Base64 alphabet and to use padding.
-   * Non-Base64 data is escaped using percent-escapes as necessary to make
-   * it valid, and existing escapes are case normalized.
-   *
-   * Accessing the individual parts may fail later if they turn out to have
-   * content that can't be decoded successfully as a string, for example if
-   * existing percent escapes represent bytes that cannot be decoded
-   * by the chosen [Encoding] (see [contentAsString]).
-   *
-   * A [FormatException] is thrown if [uri] is not a valid data URI.
-   */
-  static UriData parse(String uri) {
-    if (uri.length >= 5) {
-      int dataDelta = _startsWithData(uri, 0);
-      if (dataDelta == 0) {
-        // Exact match on "data:".
-        return _parse(uri, 5, null);
-      }
-      if (dataDelta == 0x20) {
-        // Starts with a non-normalized "data" scheme containing upper-case
-        // letters. Parse anyway, but throw away the scheme.
-        return _parse(uri.substring(5), 0, null);
-      }
-    }
-    throw FormatException("Does not start with 'data:'", uri, 0);
-  }
-
-  /**
-   * The [Uri] that this `UriData` is giving access to.
-   *
-   * Returns a `Uri` with scheme `data` and the remainder of the data URI
-   * as path.
-   */
-  Uri get uri {
-    return _uriCache ??= _computeUri();
-  }
-
-  Uri _computeUri() {
-    String path = _text;
-    String? query;
-    int colonIndex = _separatorIndices[0];
-    int queryIndex = _text.indexOf('?', colonIndex + 1);
-    int end = _text.length;
-    if (queryIndex >= 0) {
-      query = _Uri._normalizeOrSubstring(
-          _text, queryIndex + 1, end, _Uri._queryCharTable);
-      end = queryIndex;
-    }
-    path = _Uri._normalizeOrSubstring(
-        _text, colonIndex + 1, end, _Uri._pathCharOrSlashTable);
-    return _DataUri(this, path, query);
-  }
-
-  /**
-   * The MIME type of the data URI.
-   *
-   * A data URI consists of a "media type" followed by data.
-   * The media type starts with a MIME type and can be followed by
-   * extra parameters.
-   * If the MIME type representation in the URI text contains URI escapes,
-   * they are unescaped in the returned string.
-   * If the value contain non-ASCII percent escapes, they are decoded as UTF-8.
-   *
-   * Example:
-   *
-   *     data:text/plain;charset=utf-8,Hello%20World!
-   *
-   * This data URI has the media type `text/plain;charset=utf-8`, which is the
-   * MIME type `text/plain` with the parameter `charset` with value `utf-8`.
-   * See [RFC 2045](https://tools.ietf.org/html/rfc2045) for more detail.
-   *
-   * If the first part of the data URI is empty, it defaults to `text/plain`.
-   */
-  String get mimeType {
-    int start = _separatorIndices[0] + 1;
-    int end = _separatorIndices[1];
-    if (start == end) return "text/plain";
-    return _Uri._uriDecode(_text, start, end, utf8, false);
-  }
-
-  /**
-   * The charset parameter of the media type.
-   *
-   * If the parameters of the media type contains a `charset` parameter
-   * then this returns its value, otherwise it returns `US-ASCII`,
-   * which is the default charset for data URIs.
-   * If the value contain non-ASCII percent escapes, they are decoded as UTF-8.
-   *
-   * If the MIME type representation in the URI text contains URI escapes,
-   * they are unescaped in the returned string.
-   */
-  String get charset {
-    int parameterStart = 1;
-    int parameterEnd = _separatorIndices.length - 1; // The ',' before data.
-    if (isBase64) {
-      // There is a ";base64" separator, so subtract one for that as well.
-      parameterEnd -= 1;
-    }
-    for (int i = parameterStart; i < parameterEnd; i += 2) {
-      var keyStart = _separatorIndices[i] + 1;
-      var keyEnd = _separatorIndices[i + 1];
-      if (keyEnd == keyStart + 7 && _text.startsWith("charset", keyStart)) {
-        return _Uri._uriDecode(
-            _text, keyEnd + 1, _separatorIndices[i + 2], utf8, false);
-      }
-    }
-    return "US-ASCII";
-  }
-
-  /**
-   * Whether the data is Base64 encoded or not.
-   */
-  bool get isBase64 => _separatorIndices.length.isOdd;
-
-  /**
-   * The content part of the data URI, as its actual representation.
-   *
-   * This string may contain percent escapes.
-   */
-  String get contentText => _text.substring(_separatorIndices.last + 1);
-
-  /**
-   * The content part of the data URI as bytes.
-   *
-   * If the data is Base64 encoded, it will be decoded to bytes.
-   *
-   * If the data is not Base64 encoded, it will be decoded by unescaping
-   * percent-escaped characters and returning byte values of each unescaped
-   * character. The bytes will not be, e.g., UTF-8 decoded.
-   */
-  Uint8List contentAsBytes() {
-    String text = _text;
-    int start = _separatorIndices.last + 1;
-    if (isBase64) {
-      return base64.decoder.convert(text, start);
-    }
-
-    // Not base64, do percent-decoding and return the remaining bytes.
-    // Compute result size.
-    const int percent = 0x25;
-    int length = text.length - start;
-    for (int i = start; i < text.length; i++) {
-      var codeUnit = text.codeUnitAt(i);
-      if (codeUnit == percent) {
-        i += 2;
-        length -= 2;
-      }
-    }
-    // Fill result array.
-    Uint8List result = Uint8List(length);
-    if (length == text.length) {
-      result.setRange(0, length, text.codeUnits, start);
-      return result;
-    }
-    int index = 0;
-    for (int i = start; i < text.length; i++) {
-      var codeUnit = text.codeUnitAt(i);
-      if (codeUnit != percent) {
-        result[index++] = codeUnit;
-      } else {
-        if (i + 2 < text.length) {
-          int byte = parseHexByte(text, i + 1);
-          if (byte >= 0) {
-            result[index++] = byte;
-            i += 2;
-            continue;
-          }
-        }
-        throw FormatException("Invalid percent escape", text, i);
-      }
-    }
-    assert(index == result.length);
-    return result;
-  }
-
-  /**
-   * Returns a string created from the content of the data URI.
-   *
-   * If the content is Base64 encoded, it will be decoded to bytes and then
-   * decoded to a string using [encoding].
-   * If encoding is omitted, the value of a `charset` parameter is used
-   * if it is recognized by [Encoding.getByName], otherwise it defaults to
-   * the [ascii] encoding, which is the default encoding for data URIs
-   * that do not specify an encoding.
-   *
-   * If the content is not Base64 encoded, it will first have percent-escapes
-   * converted to bytes and then the character codes and byte values are
-   * decoded using [encoding].
-   */
-  String contentAsString({Encoding? encoding}) {
-    if (encoding == null) {
-      var charset = this.charset; // Returns "US-ASCII" if not present.
-      encoding = Encoding.getByName(charset);
-      if (encoding == null) {
-        throw UnsupportedError("Unknown charset: $charset");
-      }
-    }
-    String text = _text;
-    int start = _separatorIndices.last + 1;
-    if (isBase64) {
-      var converter = base64.decoder.fuse(encoding.decoder);
-      return converter.convert(text.substring(start));
-    }
-    return _Uri._uriDecode(text, start, text.length, encoding, false);
-  }
-
-  /**
-   * A map representing the parameters of the media type.
-   *
-   * A data URI may contain parameters between the MIME type and the
-   * data. This converts these parameters to a map from parameter name
-   * to parameter value.
-   * The map only contains parameters that actually occur in the URI.
-   * The `charset` parameter has a default value even if it doesn't occur
-   * in the URI, which is reflected by the [charset] getter. This means that
-   * [charset] may return a value even if `parameters["charset"]` is `null`.
-   *
-   * If the values contain non-ASCII values or percent escapes,
-   * they are decoded as UTF-8.
-   */
-  Map<String, String> get parameters {
-    var result = <String, String>{};
-    for (int i = 3; i < _separatorIndices.length; i += 2) {
-      var start = _separatorIndices[i - 2] + 1;
-      var equals = _separatorIndices[i - 1];
-      var end = _separatorIndices[i];
-      String key = _Uri._uriDecode(_text, start, equals, utf8, false);
-      String value = _Uri._uriDecode(_text, equals + 1, end, utf8, false);
-      result[key] = value;
-    }
-    return result;
-  }
-
-  static UriData _parse(String text, int start, Uri? sourceUri) {
-    assert(start == 0 || start == 5);
-    assert((start == 5) == text.startsWith("data:"));
-
-    /// Character codes.
-    const int comma = 0x2c;
-    const int slash = 0x2f;
-    const int semicolon = 0x3b;
-    const int equals = 0x3d;
-    List<int> indices = [start - 1];
-    int slashIndex = -1;
-    var char;
-    int i = start;
-    for (; i < text.length; i++) {
-      char = text.codeUnitAt(i);
-      if (char == comma || char == semicolon) break;
-      if (char == slash) {
-        if (slashIndex < 0) {
-          slashIndex = i;
-          continue;
-        }
-        throw FormatException("Invalid MIME type", text, i);
-      }
-    }
-    if (slashIndex < 0 && i > start) {
-      // An empty MIME type is allowed, but if non-empty it must contain
-      // exactly one slash.
-      throw FormatException("Invalid MIME type", text, i);
-    }
-    while (char != comma) {
-      // Parse parameters and/or "base64".
-      indices.add(i);
-      i++;
-      int equalsIndex = -1;
-      for (; i < text.length; i++) {
-        char = text.codeUnitAt(i);
-        if (char == equals) {
-          if (equalsIndex < 0) equalsIndex = i;
-        } else if (char == semicolon || char == comma) {
-          break;
-        }
-      }
-      if (equalsIndex >= 0) {
-        indices.add(equalsIndex);
-      } else {
-        // Have to be final "base64".
-        var lastSeparator = indices.last;
-        if (char != comma ||
-            i != lastSeparator + 7 /* "base64,".length */ ||
-            !text.startsWith("base64", lastSeparator + 1)) {
-          throw FormatException("Expecting '='", text, i);
-        }
-        break;
-      }
-    }
-    indices.add(i);
-    bool isBase64 = indices.length.isOdd;
-    if (isBase64) {
-      text = base64.normalize(text, i + 1, text.length);
-    } else {
-      // Validate "data" part, must only contain RFC 2396 'uric' characters
-      // (reserved, unreserved, or escape sequences).
-      // Normalize to this (throws on a fragment separator).
-      var data = _Uri._normalize(text, i + 1, text.length, _uricTable,
-          escapeDelimiters: true);
-      if (data != null) {
-        text = text.replaceRange(i + 1, text.length, data);
-      }
-    }
-    return UriData._(text, indices, sourceUri);
-  }
-
-  /**
-   * Like [Uri._uriEncode] but takes the input as bytes, not a string.
-   *
-   * Encodes into [buffer] instead of creating its own buffer.
-   */
-  static void _uriEncodeBytes(
-      List<int> canonicalTable, List<int> bytes, StringSink buffer) {
-    // Encode the string into bytes then generate an ASCII only string
-    // by percent encoding selected bytes.
-    int byteOr = 0;
-    for (int i = 0; i < bytes.length; i++) {
-      int byte = bytes[i];
-      byteOr |= byte;
-      if (byte < 128 &&
-          ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
-        buffer.writeCharCode(byte);
-      } else {
-        buffer.writeCharCode(_PERCENT);
-        buffer.writeCharCode(_hexDigits.codeUnitAt(byte >> 4));
-        buffer.writeCharCode(_hexDigits.codeUnitAt(byte & 0x0f));
-      }
-    }
-    if ((byteOr & ~0xFF) != 0) {
-      for (int i = 0; i < bytes.length; i++) {
-        var byte = bytes[i];
-        if (byte < 0 || byte > 255) {
-          throw ArgumentError.value(byte, "non-byte value");
-        }
-      }
-    }
-  }
-
-  String toString() =>
-      (_separatorIndices[0] == _noScheme) ? "data:$_text" : _text;
-
-  // Table of the `token` characters of RFC 2045 in a URI.
-  //
-  // A token is any US-ASCII character except SPACE, control characters and
-  // `tspecial` characters. The `tspecial` category is:
-  // '(', ')', '<', '>', '@', ',', ';', ':', '\', '"', '/', '[, ']', '?', '='.
-  //
-  // In a data URI, we also need to escape '%' and '#' characters.
-  static const _tokenCharTable = [
-    //                     LSB             MSB
-    //                      |               |
-    0x0000, // 0x00 - 0x0f  00000000 00000000
-    0x0000, // 0x10 - 0x1f  00000000 00000000
-    //                       !  $ &'   *+ -.
-    0x6cd2, // 0x20 - 0x2f  01001011 00110110
-    //                      01234567 89
-    0x03ff, // 0x30 - 0x3f  11111111 11000000
-    //                       ABCDEFG HIJKLMNO
-    0xfffe, // 0x40 - 0x4f  01111111 11111111
-    //                      PQRSTUVW XYZ   ^_
-    0xc7ff, // 0x50 - 0x5f  11111111 11100011
-    //                      `abcdefg hijklmno
-    0xffff, // 0x60 - 0x6f  11111111 11111111
-    //                      pqrstuvw xyz{|}~
-    0x7fff, // 0x70 - 0x7f  11111111 11111110
-  ];
-
-  // All non-escape RFC-2396 uric characters.
-  //
-  //  uric        =  reserved | unreserved | escaped
-  //  reserved    =  ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
-  //  unreserved  =  alphanum | mark
-  //  mark        =  "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
-  //
-  // This is the same characters as in a URI query (which is URI pchar plus '?')
-  static const _uricTable = _Uri._queryCharTable;
-}
-
-// --------------------------------------------------------------------
-// Constants used to read the scanner result.
-// The indices points into the table filled by [_scan] which contains
-// recognized positions in the scanned URI.
-// The `0` index is only used internally.
-
-/// Index of the position of that `:` after a scheme.
-const int _schemeEndIndex = 1;
-
-/// Index of the position of the character just before the host name.
-const int _hostStartIndex = 2;
-
-/// Index of the position of the `:` before a port value.
-const int _portStartIndex = 3;
-
-/// Index of the position of the first character of a path.
-const int _pathStartIndex = 4;
-
-/// Index of the position of the `?` before a query.
-const int _queryStartIndex = 5;
-
-/// Index of the position of the `#` before a fragment.
-const int _fragmentStartIndex = 6;
-
-/// Index of a position where the URI was determined to be "non-simple".
-const int _notSimpleIndex = 7;
-
-// Initial state for scanner.
-const int _uriStart = 00;
-
-// If scanning of a URI terminates in this state or above,
-// consider the URI non-simple
-const int _nonSimpleEndStates = 14;
-
-// Initial state for scheme validation.
-const int _schemeStart = 20;
-
-/// Transition tables used to scan a URI to determine its structure.
-///
-/// The tables represent a state machine with output.
-///
-/// To scan the URI, start in the [_uriStart] state, then read each character
-/// of the URI in order, from start to end, and for each character perform a
-/// transition to a new state while writing the current position into the output
-/// buffer at a designated index.
-///
-/// Each state, represented by an integer which is an index into
-/// [_scannerTables], has a set of transitions, one for each character.
-/// The transitions are encoded as a 5-bit integer representing the next state
-/// and a 3-bit index into the output table.
-///
-/// For URI scanning, only characters in the range U+0020 through U+007E are
-/// interesting, all characters outside that range are treated the same.
-/// The tables only contain 96 entries, representing that characters in the
-/// interesting range, plus one more to represent all values outside the range.
-/// The character entries are stored in one `Uint8List` per state, with the
-/// transition for a character at position `character ^ 0x60`,
-/// which maps the range U+0020 .. U+007F into positions 0 .. 95.
-/// All remaining characters are mapped to position 31 (`0x7f ^ 0x60`) which
-/// represents the transition for all remaining characters.
-final List<Uint8List> _scannerTables = _createTables();
-
-// ----------------------------------------------------------------------
-// Code to create the URI scanner table.
-
-/// Creates the tables for [_scannerTables] used by [Uri.parse].
-///
-/// See [_scannerTables] for the generated format.
-///
-/// The concrete tables are chosen as a trade-off between the number of states
-/// needed and the precision of the result.
-/// This allows definitely recognizing the general structure of the URI
-/// (presence and location of scheme, user-info, host, port, path, query and
-/// fragment) while at the same time detecting that some components are not
-/// in canonical form (anything containing a `%`, a host-name containing a
-/// capital letter). Since the scanner doesn't know whether something is a
-/// scheme or a path until it sees `:`, or user-info or host until it sees
-/// a `@`, a second pass is needed to validate the scheme and any user-info
-/// is considered non-canonical by default.
-///
-/// The states (starting from [_uriStart]) write positions while scanning
-/// a string from `start` to `end` as follows:
-///
-/// - [_schemeEndIndex]: Should be initialized to `start-1`.
-///   If the URI has a scheme, it is set to the position of the `:` after
-///   the scheme.
-/// - [_hostStartIndex]: Should be initialized to `start - 1`.
-///   If the URI has an authority, it is set to the character before the
-///   host name - either the second `/` in the `//` leading the authority,
-///   or the `@` after a user-info. Comparing this value to the scheme end
-///   position can be used to detect that there is a user-info component.
-/// - [_portStartIndex]: Should be initialized to `start`.
-///   Set to the position of the last `:` in an authority, and unchanged
-///   if there is no authority or no `:` in an authority.
-///   If this position is after the host start, there is a port, otherwise it
-///   is just marking a colon in the user-info component.
-/// - [_pathStartIndex]: Should be initialized to `start`.
-///   Is set to the first path character unless the path is empty.
-///   If the path is empty, the position is either unchanged (`start`) or
-///   the first slash of an authority. So, if the path start is before a
-///   host start or scheme end, the path is empty.
-/// - [_queryStartIndex]: Should be initialized to `end`.
-///   The position of the `?` leading a query if the URI contains a query.
-/// - [_fragmentStartIndex]: Should be initialized to `end`.
-///   The position of the `#` leading a fragment if the URI contains a fragment.
-/// - [_notSimpleIndex]: Should be initialized to `start - 1`.
-///   Set to another value if the URI is considered "not simple".
-///   This is elaborated below.
-///
-/// # Simple URIs
-/// A URI is considered "simple" if it is in a normalized form containing no
-/// escapes. This allows us to skip normalization and checking whether escapes
-/// are valid, and to extract components without worrying about unescaping.
-///
-/// The scanner computes a conservative approximation of being "simple".
-/// It rejects any URI with an escape, with a user-info component (mainly
-/// because they are rare and would increase the number of states in the
-/// scanner significantly), with an IPV6 host or with a capital letter in
-/// the scheme or host name (the scheme is handled in a second scan using
-/// a separate two-state table).
-/// Further, paths containing `..` or `.` path segments are considered
-/// non-simple except for pure relative paths (no scheme or authority) starting
-/// with a sequence of "../" segments.
-///
-/// The transition tables cannot detect a trailing ".." in the path,
-/// followed by a query or fragment, because the segment is not known to be
-/// complete until we are past it, and we then need to store the query/fragment
-/// start instead. This cast is checked manually post-scanning (such a path
-/// needs to be normalized to end in "../", so the URI shouldn't be considered
-/// simple).
-List<Uint8List> _createTables() {
-  // TODO(lrn): Use a precomputed table.
-
-  // Total number of states for the scanner.
-  const int stateCount = 22;
-
-  // States used to scan a URI from scratch.
-  const int schemeOrPath = 01;
-  const int authOrPath = 02;
-  const int authOrPathSlash = 03;
-  const int uinfoOrHost0 = 04;
-  const int uinfoOrHost = 05;
-  const int uinfoOrPort0 = 06;
-  const int uinfoOrPort = 07;
-  const int ipv6Host = 08;
-  const int relPathSeg = 09;
-  const int pathSeg = 10;
-  const int path = 11;
-  const int query = 12;
-  const int fragment = 13;
-  const int schemeOrPathDot = 14;
-  const int schemeOrPathDot2 = 15;
-  const int relPathSegDot = 16;
-  const int relPathSegDot2 = 17;
-  const int pathSegDot = 18;
-  const int pathSegDot2 = 19;
-
-  // States used to validate a scheme after its end position has been found.
-  const int scheme0 = _schemeStart;
-  const int scheme = 21;
-
-  // Constants encoding the write-index for the state transition into the top 5
-  // bits of a byte.
-  const int schemeEnd = _schemeEndIndex << 5;
-  const int hostStart = _hostStartIndex << 5;
-  const int portStart = _portStartIndex << 5;
-  const int pathStart = _pathStartIndex << 5;
-  const int queryStart = _queryStartIndex << 5;
-  const int fragmentStart = _fragmentStartIndex << 5;
-  const int notSimple = _notSimpleIndex << 5;
-
-  /// The `unreserved` characters of RFC 3986.
-  const unreserved =
-      "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~";
-
-  /// The `sub-delim` characters of RFC 3986.
-  const subDelims = r"!$&'()*+,;=";
-  // The `pchar` characters of RFC 3986: characters that may occur in a path,
-  // excluding escapes.
-  const pchar = "$unreserved$subDelims";
-
-  var tables = List<Uint8List>.generate(stateCount, (_) => Uint8List(96));
-
-  // Helper function which initialize the table for [state] with a default
-  // transition and returns the table.
-  Uint8List build(state, defaultTransition) =>
-      tables[state]..fillRange(0, 96, defaultTransition);
-
-  // Helper function which sets the transition for each character in [chars]
-  // to [transition] in the [target] table.
-  // The [chars] string must contain only characters in the U+0020 .. U+007E
-  // range.
-  void setChars(Uint8List target, String chars, int transition) {
-    for (int i = 0; i < chars.length; i++) {
-      var char = chars.codeUnitAt(i);
-      target[char ^ 0x60] = transition;
-    }
-  }
-
-  /// Helper function which sets the transition for all characters in the
-  /// range from `range[0]` to `range[1]` to [transition] in the [target] table.
-  ///
-  /// The [range] must be a two-character string where both characters are in
-  /// the U+0020 .. U+007E range and the former character must have a lower
-  /// code point than the latter.
-  void setRange(Uint8List target, String range, int transition) {
-    for (int i = range.codeUnitAt(0), n = range.codeUnitAt(1); i <= n; i++) {
-      target[i ^ 0x60] = transition;
-    }
-  }
-
-  // Create the transitions for each state.
-  var b;
-
-  // Validate as path, if it is a scheme, we handle it later.
-  b = build(_uriStart, schemeOrPath | notSimple);
-  setChars(b, pchar, schemeOrPath);
-  setChars(b, ".", schemeOrPathDot);
-  setChars(b, ":", authOrPath | schemeEnd); // Handle later.
-  setChars(b, "/", authOrPathSlash);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(schemeOrPathDot, schemeOrPath | notSimple);
-  setChars(b, pchar, schemeOrPath);
-  setChars(b, ".", schemeOrPathDot2);
-  setChars(b, ':', authOrPath | schemeEnd);
-  setChars(b, "/", pathSeg | notSimple);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(schemeOrPathDot2, schemeOrPath | notSimple);
-  setChars(b, pchar, schemeOrPath);
-  setChars(b, "%", schemeOrPath | notSimple);
-  setChars(b, ':', authOrPath | schemeEnd);
-  setChars(b, "/", relPathSeg);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(schemeOrPath, schemeOrPath | notSimple);
-  setChars(b, pchar, schemeOrPath);
-  setChars(b, ':', authOrPath | schemeEnd);
-  setChars(b, "/", pathSeg);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(authOrPath, path | notSimple);
-  setChars(b, pchar, path | pathStart);
-  setChars(b, "/", authOrPathSlash | pathStart);
-  setChars(b, ".", pathSegDot | pathStart);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(authOrPathSlash, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, "/", uinfoOrHost0 | hostStart);
-  setChars(b, ".", pathSegDot);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(uinfoOrHost0, uinfoOrHost | notSimple);
-  setChars(b, pchar, uinfoOrHost);
-  setRange(b, "AZ", uinfoOrHost | notSimple);
-  setChars(b, ":", uinfoOrPort0 | portStart);
-  setChars(b, "@", uinfoOrHost0 | hostStart);
-  setChars(b, "[", ipv6Host | notSimple);
-  setChars(b, "/", pathSeg | pathStart);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(uinfoOrHost, uinfoOrHost | notSimple);
-  setChars(b, pchar, uinfoOrHost);
-  setRange(b, "AZ", uinfoOrHost | notSimple);
-  setChars(b, ":", uinfoOrPort0 | portStart);
-  setChars(b, "@", uinfoOrHost0 | hostStart);
-  setChars(b, "/", pathSeg | pathStart);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(uinfoOrPort0, uinfoOrPort | notSimple);
-  setRange(b, "19", uinfoOrPort);
-  setChars(b, "@", uinfoOrHost0 | hostStart);
-  setChars(b, "/", pathSeg | pathStart);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(uinfoOrPort, uinfoOrPort | notSimple);
-  setRange(b, "09", uinfoOrPort);
-  setChars(b, "@", uinfoOrHost0 | hostStart);
-  setChars(b, "/", pathSeg | pathStart);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(ipv6Host, ipv6Host);
-  setChars(b, "]", uinfoOrHost);
-
-  b = build(relPathSeg, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, ".", relPathSegDot);
-  setChars(b, "/", pathSeg | notSimple);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(relPathSegDot, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, ".", relPathSegDot2);
-  setChars(b, "/", pathSeg | notSimple);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(relPathSegDot2, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, "/", relPathSeg);
-  setChars(b, "?", query | queryStart); // This should be non-simple.
-  setChars(b, "#", fragment | fragmentStart); // This should be non-simple.
-
-  b = build(pathSeg, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, ".", pathSegDot);
-  setChars(b, "/", pathSeg | notSimple);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(pathSegDot, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, ".", pathSegDot2);
-  setChars(b, "/", pathSeg | notSimple);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(pathSegDot2, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, "/", pathSeg | notSimple);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(path, path | notSimple);
-  setChars(b, pchar, path);
-  setChars(b, "/", pathSeg);
-  setChars(b, "?", query | queryStart);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(query, query | notSimple);
-  setChars(b, pchar, query);
-  setChars(b, "?", query);
-  setChars(b, "#", fragment | fragmentStart);
-
-  b = build(fragment, fragment | notSimple);
-  setChars(b, pchar, fragment);
-  setChars(b, "?", fragment);
-
-  // A separate two-state validator for lower-case scheme names.
-  // Any non-scheme character or upper-case letter is marked as non-simple.
-  b = build(scheme0, scheme | notSimple);
-  setRange(b, "az", scheme);
-
-  b = build(scheme, scheme | notSimple);
-  setRange(b, "az", scheme);
-  setRange(b, "09", scheme);
-  setChars(b, "+-.", scheme);
-
-  return tables;
-}
-
-// --------------------------------------------------------------------
-// Code that uses the URI scanner table.
-
-/// Scan a string using the [_scannerTables] state machine.
-///
-/// Scans [uri] from [start] to [end], starting in state [state] and
-/// writing output into [indices].
-///
-/// Returns the final state.
-int _scan(String uri, int start, int end, int state, List<int> indices) {
-  var tables = _scannerTables;
-  assert(end <= uri.length);
-  for (int i = start; i < end; i++) {
-    var table = tables[state];
-    // Xor with 0x60 to move range 0x20-0x7f into 0x00-0x5f
-    int char = uri.codeUnitAt(i) ^ 0x60;
-    // Use 0x1f (nee 0x7f) to represent all unhandled characters.
-    if (char > 0x5f) char = 0x1f;
-    int transition = table[char];
-    state = transition & 0x1f;
-    indices[transition >> 5] = i;
-  }
-  return state;
-}
-
-class _SimpleUri implements Uri {
-  final String _uri;
-  final int _schemeEnd;
-  final int _hostStart;
-  final int _portStart;
-  final int _pathStart;
-  final int _queryStart;
-  final int _fragmentStart;
-
-  /// The scheme is often used to distinguish URIs.
-  /// To make comparisons more efficient, we cache the value, and
-  /// canonicalize a few known types.
-  String? _schemeCache;
-  int? _hashCodeCache;
-
-  _SimpleUri(
-      this._uri,
-      this._schemeEnd,
-      this._hostStart,
-      this._portStart,
-      this._pathStart,
-      this._queryStart,
-      this._fragmentStart,
-      this._schemeCache);
-
-  bool get hasScheme => _schemeEnd > 0;
-  bool get hasAuthority => _hostStart > 0;
-  bool get hasUserInfo => _hostStart > _schemeEnd + 4;
-  bool get hasPort => _hostStart > 0 && _portStart + 1 < _pathStart;
-  bool get hasQuery => _queryStart < _fragmentStart;
-  bool get hasFragment => _fragmentStart < _uri.length;
-
-  bool get _isFile => _schemeEnd == 4 && _uri.startsWith("file");
-  bool get _isHttp => _schemeEnd == 4 && _uri.startsWith("http");
-  bool get _isHttps => _schemeEnd == 5 && _uri.startsWith("https");
-  bool get _isPackage => _schemeEnd == 7 && _uri.startsWith("package");
-
-  /// Like [isScheme] but expects argument to be case normalized.
-  bool _isScheme(String scheme) =>
-      _schemeEnd == scheme.length && _uri.startsWith(scheme);
-
-  bool get hasAbsolutePath => _uri.startsWith("/", _pathStart);
-  bool get hasEmptyPath => _pathStart == _queryStart;
-
-  bool get isAbsolute => hasScheme && !hasFragment;
-
-  bool isScheme(String scheme) {
-    if (scheme == null || scheme.isEmpty) return _schemeEnd < 0;
-    if (scheme.length != _schemeEnd) return false;
-    return _Uri._compareScheme(scheme, _uri);
-  }
-
-  String get scheme {
-    return _schemeCache ??= _computeScheme();
-  }
-
-  String _computeScheme() {
-    if (_schemeEnd <= 0) return "";
-    if (_isHttp) return "http";
-    if (_isHttps) return "https";
-    if (_isFile) return "file";
-    if (_isPackage) return "package";
-    return _uri.substring(0, _schemeEnd);
-  }
-
-  String get authority =>
-      _hostStart > 0 ? _uri.substring(_schemeEnd + 3, _pathStart) : "";
-  String get userInfo => (_hostStart > _schemeEnd + 3)
-      ? _uri.substring(_schemeEnd + 3, _hostStart - 1)
-      : "";
-  String get host =>
-      _hostStart > 0 ? _uri.substring(_hostStart, _portStart) : "";
-  int get port {
-    if (hasPort) return int.parse(_uri.substring(_portStart + 1, _pathStart));
-    if (_isHttp) return 80;
-    if (_isHttps) return 443;
-    return 0;
-  }
-
-  String get path => _uri.substring(_pathStart, _queryStart);
-  String get query => (_queryStart < _fragmentStart)
-      ? _uri.substring(_queryStart + 1, _fragmentStart)
-      : "";
-  String get fragment =>
-      (_fragmentStart < _uri.length) ? _uri.substring(_fragmentStart + 1) : "";
-
-  String get origin {
-    // Check original behavior - W3C spec is wonky!
-    bool isHttp = _isHttp;
-    if (_schemeEnd < 0) {
-      throw StateError("Cannot use origin without a scheme: $this");
-    }
-    if (!isHttp && !_isHttps) {
-      throw StateError(
-          "Origin is only applicable to schemes http and https: $this");
-    }
-    if (_hostStart == _portStart) {
-      throw StateError(
-          "A $scheme: URI should have a non-empty host name: $this");
-    }
-    if (_hostStart == _schemeEnd + 3) {
-      return _uri.substring(0, _pathStart);
-    }
-    // Need to drop anon-empty userInfo.
-    return _uri.substring(0, _schemeEnd + 3) +
-        _uri.substring(_hostStart, _pathStart);
-  }
-
-  List<String> get pathSegments {
-    int start = _pathStart;
-    int end = _queryStart;
-    if (_uri.startsWith("/", start)) start++;
-    if (start == end) return const <String>[];
-    List<String> parts = [];
-    for (int i = start; i < end; i++) {
-      var char = _uri.codeUnitAt(i);
-      if (char == _SLASH) {
-        parts.add(_uri.substring(start, i));
-        start = i + 1;
-      }
-    }
-    parts.add(_uri.substring(start, end));
-    return List<String>.unmodifiable(parts);
-  }
-
-  Map<String, String> get queryParameters {
-    if (!hasQuery) return const <String, String>{};
-    return UnmodifiableMapView<String, String>(Uri.splitQueryString(query));
-  }
-
-  Map<String, List<String>> get queryParametersAll {
-    if (!hasQuery) return const <String, List<String>>{};
-    Map<String, List<String>> queryParameterLists =
-        _Uri._splitQueryStringAll(query);
-    queryParameterLists.updateAll(_toUnmodifiableStringList);
-    return Map<String, List<String>>.unmodifiable(queryParameterLists);
-  }
-
-  bool _isPort(String port) {
-    int portDigitStart = _portStart + 1;
-    return portDigitStart + port.length == _pathStart &&
-        _uri.startsWith(port, portDigitStart);
-  }
-
-  Uri normalizePath() => this;
-
-  Uri removeFragment() {
-    if (!hasFragment) return this;
-    return _SimpleUri(_uri.substring(0, _fragmentStart), _schemeEnd, _hostStart,
-        _portStart, _pathStart, _queryStart, _fragmentStart, _schemeCache);
-  }
-
-  Uri replace(
-      {String? scheme,
-      String? userInfo,
-      String? host,
-      int? port,
-      String? path,
-      Iterable<String>? pathSegments,
-      String? query,
-      Map<String, dynamic /*String|Iterable<String>*/ >? queryParameters,
-      String? fragment}) {
-    bool schemeChanged = false;
-    if (scheme != null) {
-      scheme = _Uri._makeScheme(scheme, 0, scheme.length);
-      schemeChanged = !_isScheme(scheme);
-    } else {
-      scheme = this.scheme;
-    }
-    bool isFile = (scheme == "file");
-    if (userInfo != null) {
-      userInfo = _Uri._makeUserInfo(userInfo, 0, userInfo.length);
-    } else if (_hostStart > 0) {
-      userInfo = _uri.substring(_schemeEnd + 3, _hostStart);
-    } else {
-      userInfo = "";
-    }
-    if (port != null) {
-      port = _Uri._makePort(port, scheme);
-    } else {
-      port = this.hasPort ? this.port : null;
-      if (schemeChanged) {
-        // The default port might have changed.
-        port = _Uri._makePort(port, scheme);
-      }
-    }
-    if (host != null) {
-      host = _Uri._makeHost(host, 0, host.length, false);
-    } else if (_hostStart > 0) {
-      host = _uri.substring(_hostStart, _portStart);
-    } else if (userInfo.isNotEmpty || port != null || isFile) {
-      host = "";
-    }
-
-    bool hasAuthority = host != null;
-    if (path != null || pathSegments != null) {
-      path = _Uri._makePath(path, 0, _stringOrNullLength(path), pathSegments,
-          scheme, hasAuthority);
-    } else {
-      path = _uri.substring(_pathStart, _queryStart);
-      if ((isFile || (hasAuthority && !path.isEmpty)) &&
-          !path.startsWith('/')) {
-        path = "/" + path;
-      }
-    }
-
-    if (query != null || queryParameters != null) {
-      query = _Uri._makeQuery(
-          query, 0, _stringOrNullLength(query), queryParameters);
-    } else if (_queryStart < _fragmentStart) {
-      query = _uri.substring(_queryStart + 1, _fragmentStart);
-    }
-
-    if (fragment != null) {
-      fragment = _Uri._makeFragment(fragment, 0, fragment.length);
-    } else if (_fragmentStart < _uri.length) {
-      fragment = _uri.substring(_fragmentStart + 1);
-    }
-
-    return _Uri._internal(scheme, userInfo, host, port, path, query, fragment);
-  }
-
-  Uri resolve(String reference) {
-    return resolveUri(Uri.parse(reference));
-  }
-
-  Uri resolveUri(Uri reference) {
-    if (reference is _SimpleUri) {
-      return _simpleMerge(this, reference);
-    }
-    return _toNonSimple().resolveUri(reference);
-  }
-
-  // Merge two simple URIs. This should always result in a prefix of
-  // one concatenated with a suffix of the other, possibly with a `/` in
-  // the middle of two merged paths, which is again simple.
-  // In a few cases, there might be a need for extra normalization, when
-  // resolving on top of a known scheme.
-  Uri _simpleMerge(_SimpleUri base, _SimpleUri ref) {
-    if (ref.hasScheme) return ref;
-    if (ref.hasAuthority) {
-      if (!base.hasScheme) return ref;
-      bool isSimple = true;
-      if (base._isFile) {
-        isSimple = !ref.hasEmptyPath;
-      } else if (base._isHttp) {
-        isSimple = !ref._isPort("80");
-      } else if (base._isHttps) {
-        isSimple = !ref._isPort("443");
-      }
-      if (isSimple) {
-        var delta = base._schemeEnd + 1;
-        var newUri = base._uri.substring(0, base._schemeEnd + 1) +
-            ref._uri.substring(ref._schemeEnd + 1);
-        return _SimpleUri(
-            newUri,
-            base._schemeEnd,
-            ref._hostStart + delta,
-            ref._portStart + delta,
-            ref._pathStart + delta,
-            ref._queryStart + delta,
-            ref._fragmentStart + delta,
-            base._schemeCache);
-      } else {
-        // This will require normalization, so use the _Uri implementation.
-        return _toNonSimple().resolveUri(ref);
-      }
-    }
-    if (ref.hasEmptyPath) {
-      if (ref.hasQuery) {
-        int delta = base._queryStart - ref._queryStart;
-        var newUri = base._uri.substring(0, base._queryStart) +
-            ref._uri.substring(ref._queryStart);
-        return _SimpleUri(
-            newUri,
-            base._schemeEnd,
-            base._hostStart,
-            base._portStart,
-            base._pathStart,
-            ref._queryStart + delta,
-            ref._fragmentStart + delta,
-            base._schemeCache);
-      }
-      if (ref.hasFragment) {
-        int delta = base._fragmentStart - ref._fragmentStart;
-        var newUri = base._uri.substring(0, base._fragmentStart) +
-            ref._uri.substring(ref._fragmentStart);
-        return _SimpleUri(
-            newUri,
-            base._schemeEnd,
-            base._hostStart,
-            base._portStart,
-            base._pathStart,
-            base._queryStart,
-            ref._fragmentStart + delta,
-            base._schemeCache);
-      }
-      return base.removeFragment();
-    }
-    if (ref.hasAbsolutePath) {
-      var delta = base._pathStart - ref._pathStart;
-      var newUri = base._uri.substring(0, base._pathStart) +
-          ref._uri.substring(ref._pathStart);
-      return _SimpleUri(
-          newUri,
-          base._schemeEnd,
-          base._hostStart,
-          base._portStart,
-          base._pathStart,
-          ref._queryStart + delta,
-          ref._fragmentStart + delta,
-          base._schemeCache);
-    }
-    if (base.hasEmptyPath && base.hasAuthority) {
-      // ref has relative non-empty path.
-      // Add a "/" in front, then leading "/../" segments are folded to "/".
-      int refStart = ref._pathStart;
-      while (ref._uri.startsWith("../", refStart)) {
-        refStart += 3;
-      }
-      var delta = base._pathStart - refStart + 1;
-      var newUri = "${base._uri.substring(0, base._pathStart)}/"
-          "${ref._uri.substring(refStart)}";
-      return _SimpleUri(
-          newUri,
-          base._schemeEnd,
-          base._hostStart,
-          base._portStart,
-          base._pathStart,
-          ref._queryStart + delta,
-          ref._fragmentStart + delta,
-          base._schemeCache);
-    }
-    // Merge paths.
-
-    // The RFC 3986 algorithm merges the base path without its final segment
-    // (anything after the final "/", or everything if the base path doesn't
-    // contain any "/"), and the reference path.
-    // Then it removes "." and ".." segments using the remove-dot-segment
-    // algorithm.
-    // This code combines the two steps. It is simplified by knowing that
-    // the base path contains no "." or ".." segments, and the reference
-    // path can only contain leading ".." segments.
-
-    String baseUri = base._uri;
-    String refUri = ref._uri;
-    int baseStart = base._pathStart;
-    int baseEnd = base._queryStart;
-    while (baseUri.startsWith("../", baseStart)) baseStart += 3;
-    int refStart = ref._pathStart;
-    int refEnd = ref._queryStart;
-
-    /// Count of leading ".." segments in reference path.
-    /// The count is decremented when the segment is matched with a
-    /// segment of the base path, and both are then omitted from the result.
-    int backCount = 0;
-
-    /// Count "../" segments and advance `refStart` to after the segments.
-    while (refStart + 3 <= refEnd && refUri.startsWith("../", refStart)) {
-      refStart += 3;
-      backCount += 1;
-    }
-
-    // Extra slash inserted between base and reference path parts if
-    // the base path contains any slashes, or empty string if none.
-    // (We could use a slash from the base path in most cases, but not if
-    // we remove the entire base path).
-    String insert = "";
-
-    /// Remove segments from the base path.
-    /// Start with the segment trailing the last slash,
-    /// then remove segments for each leading "../" segment
-    /// from the reference path, or as many of them as are available.
-    while (baseEnd > baseStart) {
-      baseEnd--;
-      int char = baseUri.codeUnitAt(baseEnd);
-      if (char == _SLASH) {
-        insert = "/";
-        if (backCount == 0) break;
-        backCount--;
-      }
-    }
-
-    if (baseEnd == baseStart && !base.hasScheme && !base.hasAbsolutePath) {
-      // If the base is *just* a relative path (no scheme or authority),
-      // then merging with another relative path doesn't follow the
-      // RFC-3986 behavior.
-      // Don't need to check `base.hasAuthority` since the base path is
-      // non-empty - if there is an authority, a non-empty path is absolute.
-
-      // We reached the start of the base path, and want to stay relative,
-      // so don't insert a slash.
-      insert = "";
-      // If we reached the start of the base path with more "../" left over
-      // in the reference path, include those segments in the result.
-      refStart -= backCount * 3;
-    }
-
-    var delta = baseEnd - refStart + insert.length;
-    var newUri = "${base._uri.substring(0, baseEnd)}$insert"
-        "${ref._uri.substring(refStart)}";
-
-    return _SimpleUri(
-        newUri,
-        base._schemeEnd,
-        base._hostStart,
-        base._portStart,
-        base._pathStart,
-        ref._queryStart + delta,
-        ref._fragmentStart + delta,
-        base._schemeCache);
-  }
-
-  String toFilePath({bool? windows}) {
-    if (_schemeEnd >= 0 && !_isFile) {
-      throw UnsupportedError("Cannot extract a file path from a $scheme URI");
-    }
-    if (_queryStart < _uri.length) {
-      if (_queryStart < _fragmentStart) {
-        throw UnsupportedError(
-            "Cannot extract a file path from a URI with a query component");
-      }
-      throw UnsupportedError(
-          "Cannot extract a file path from a URI with a fragment component");
-    }
-    return (windows ?? _Uri._isWindows)
-        ? _Uri._toWindowsFilePath(this)
-        : _toFilePath();
-  }
-
-  String _toFilePath() {
-    if (_hostStart < _portStart) {
-      // Has authority and non-empty host.
-      throw UnsupportedError(
-          "Cannot extract a non-Windows file path from a file URI "
-          "with an authority");
-    }
-    return this.path;
-  }
-
-  UriData? get data {
-    assert(scheme != "data");
-    return null;
-  }
-
-  int get hashCode => _hashCodeCache ??= _uri.hashCode;
-
-  bool operator ==(Object other) {
-    if (identical(this, other)) return true;
-    return other is Uri && _uri == other.toString();
-  }
-
-  Uri _toNonSimple() {
-    return _Uri._internal(
-        this.scheme,
-        this.userInfo,
-        this.hasAuthority ? this.host : null,
-        this.hasPort ? this.port : null,
-        this.path,
-        this.hasQuery ? this.query : null,
-        this.hasFragment ? this.fragment : null);
-  }
-
-  String toString() => _uri;
-}
-
-/// Special [_Uri] created from an existing [UriData].
-class _DataUri extends _Uri {
-  final UriData _data;
-
-  _DataUri(this._data, String path, String? query)
-      : super._internal("data", "", null, null, path, query, null);
-
-  UriData? get data => _data;
-}
-
-/// Checks whether [text] starts with "data:" at position [start].
-///
-/// The text must be long enough to allow reading five characters
-/// from the [start] position.
-///
-/// Returns an integer value which is zero if text starts with all-lowercase
-/// "data:" and 0x20 if the text starts with "data:" that isn't all lower-case.
-/// All other values means the text starts with some other character.
-int _startsWithData(String text, int start) {
-  // Multiply by 3 to avoid a non-colon character making delta be 0x20.
-  int delta = (text.codeUnitAt(start + 4) ^ _COLON) * 3;
-  delta |= text.codeUnitAt(start) ^ 0x64 /*d*/;
-  delta |= text.codeUnitAt(start + 1) ^ 0x61 /*a*/;
-  delta |= text.codeUnitAt(start + 2) ^ 0x74 /*t*/;
-  delta |= text.codeUnitAt(start + 3) ^ 0x61 /*a*/;
-  return delta;
-}
-
-/// Helper function returning the length of a string, or `0` for `null`.
-int _stringOrNullLength(String? s) => (s == null) ? 0 : s.length;
-
-List<String> _toUnmodifiableStringList(String key, List<String> list) =>
-    List<String>.unmodifiable(list);
diff --git a/sdk_nnbd/lib/developer/developer.dart b/sdk_nnbd/lib/developer/developer.dart
deleted file mode 100644
index e9df841..0000000
--- a/sdk_nnbd/lib/developer/developer.dart
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2015, 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.
-
-/// Interact with developer tools such as the debugger and inspector.
-///
-/// This library is platform dependent and has separate implementations for
-/// both web and the Dart VM. A specific platform may not support all
-/// operations.
-///
-/// To use this library in your code:
-///
-///     import 'dart:developer';
-///
-/// {@category Core}
-library dart.developer;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:isolate' show Isolate, RawReceivePort, SendPort;
-
-part 'extension.dart';
-part 'profiler.dart';
-part 'service.dart';
-part 'timeline.dart';
-
-/// If [when] is true, stop the program as if a breakpoint were hit at the
-/// following statement.
-///
-/// Returns the value of [when]. Some debuggers may display [message].
-///
-/// NOTE: When invoked, the isolate will not return until a debugger
-/// continues execution. When running in the Dart VM, the behaviour is the same
-/// regardless of whether or not a debugger is connected. When compiled to
-/// JavaScript, this uses the "debugger" statement, and behaves exactly as
-/// that does.
-external bool debugger({bool when = true, String? message});
-
-/// Send a reference to [object] to any attached debuggers.
-///
-/// Debuggers may open an inspector on the object. Returns the argument.
-external Object? inspect(Object? object);
-
-/// Emit a log event.
-///
-/// This function was designed to map closely to the logging information
-/// collected by `package:logging`.
-///
-/// - [message] is the log message
-/// - [time] (optional) is the timestamp
-/// - [sequenceNumber] (optional) is a monotonically increasing sequence number
-/// - [level] (optional) is the severity level (a value between 0 and 2000); see
-///   the `package:logging` `Level` class for an overview of the possible values
-/// - [name] (optional) is the name of the source of the log message
-/// - [zone] (optional) the zone where the log was emitted
-/// - [error] (optional) an error object associated with this log event
-/// - [stackTrace] (optional) a stack trace associated with this log event
-external void log(
-  String message, {
-  DateTime? time,
-  int? sequenceNumber,
-  int level = 0,
-  String name = '',
-  Zone? zone,
-  Object? error,
-  StackTrace? stackTrace,
-});
diff --git a/sdk_nnbd/lib/developer/developer_sources.gni b/sdk_nnbd/lib/developer/developer_sources.gni
deleted file mode 100644
index df0dbc2..0000000
--- a/sdk_nnbd/lib/developer/developer_sources.gni
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2017, 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.
-
-developer_sdk_sources = [
-  "developer.dart",
-
-  # The above file needs to be first if additional parts are added to the lib.
-  "extension.dart",
-  "profiler.dart",
-  "service.dart",
-  "timeline.dart",
-]
diff --git a/sdk_nnbd/lib/developer/extension.dart b/sdk_nnbd/lib/developer/extension.dart
deleted file mode 100644
index 184a00f..0000000
--- a/sdk_nnbd/lib/developer/extension.dart
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart.developer;
-
-/// A response to a service protocol extension RPC.
-///
-/// If the RPC was successful, use [ServiceExtensionResponse.result], otherwise
-/// use [ServiceExtensionResponse.error].
-class ServiceExtensionResponse {
-  /// The result of a successful service protocol extension RPC.
-  final String? result;
-
-  /// The error code associated with a failed service protocol extension RPC.
-  final int? errorCode;
-
-  /// The details of a failed service protocol extension RPC.
-  final String? errorDetail;
-
-  /// Creates a successful response to a service protocol extension RPC.
-  ///
-  /// Requires [result] to be a JSON object encoded as a string. When forming
-  /// the JSON-RPC message [result] will be inlined directly.
-  ServiceExtensionResponse.result(String result)
-      : result = result,
-        errorCode = null,
-        errorDetail = null {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(result, "result");
-  }
-
-  /// Creates an error response to a service protocol extension RPC.
-  ///
-  /// Requires [errorCode] to be [invalidParams] or between [extensionErrorMin]
-  /// and [extensionErrorMax]. Requires [errorDetail] to be a JSON object
-  /// encoded as a string. When forming the JSON-RPC message [errorDetail] will
-  /// be inlined directly.
-  ServiceExtensionResponse.error(int errorCode, String errorDetail)
-      : result = null,
-        errorCode = errorCode,
-        errorDetail = errorDetail {
-    _validateErrorCode(errorCode);
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(errorDetail, "errorDetail");
-  }
-
-  /// Invalid method parameter(s) error code.
-  @deprecated
-  static const kInvalidParams = invalidParams;
-
-  /// Generic extension error code.
-  @deprecated
-  static const kExtensionError = extensionError;
-
-  /// Maximum extension provided error code.
-  @deprecated
-  static const kExtensionErrorMax = extensionErrorMax;
-
-  /// Minimum extension provided error code.
-  @deprecated
-  static const kExtensionErrorMin = extensionErrorMin;
-
-  /// Invalid method parameter(s) error code.
-  static const invalidParams = -32602;
-
-  /// Generic extension error code.
-  static const extensionError = -32000;
-
-  /// Maximum extension provided error code.
-  static const extensionErrorMax = -32000;
-
-  /// Minimum extension provided error code.
-  static const extensionErrorMin = -32016;
-
-  static String _errorCodeMessage(int errorCode) {
-    _validateErrorCode(errorCode);
-    if (errorCode == invalidParams) {
-      return "Invalid params";
-    }
-    return "Server error";
-  }
-
-  static _validateErrorCode(int errorCode) {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(errorCode, "errorCode");
-    if (errorCode == invalidParams) return;
-    if ((errorCode >= extensionErrorMin) && (errorCode <= extensionErrorMax)) {
-      return;
-    }
-    throw new ArgumentError.value(errorCode, "errorCode", "Out of range");
-  }
-
-  /// Determines if this response represents an error.
-  bool isError() => (errorCode != null) && (errorDetail != null);
-
-  // ignore: unused_element, called from runtime/lib/developer.dart
-  String _toString() {
-    return result ??
-        json.encode({
-          'code': errorCode!,
-          'message': _errorCodeMessage(errorCode!),
-          'data': {'details': errorDetail!}
-        });
-  }
-}
-
-/// A service protocol extension handler. Registered with [registerExtension].
-///
-/// Must complete to a [ServiceExtensionResponse]. [method] is the method name
-/// of the service protocol request, and [parameters] is a map holding the
-/// parameters to the service protocol request.
-///
-/// *NOTE*: all parameter names and values are encoded as strings.
-typedef Future<ServiceExtensionResponse> ServiceExtensionHandler(
-    String method, Map<String, String> parameters);
-
-/// Register a [ServiceExtensionHandler] that will be invoked in this isolate
-/// for [method]. *NOTE*: Service protocol extensions must be registered
-/// in each isolate.
-///
-/// *NOTE*: [method] must begin with 'ext.' and you should use the following
-/// structure to avoid conflicts with other packages: 'ext.package.command'.
-/// That is, immediately following the 'ext.' prefix, should be the registering
-/// package name followed by another period ('.') and then the command name.
-/// For example: 'ext.dart.io.getOpenFiles'.
-///
-/// Because service extensions are isolate specific, clients using extensions
-/// must always include an 'isolateId' parameter with each RPC.
-void registerExtension(String method, ServiceExtensionHandler handler) {
-  // TODO: When NNBD is complete, delete the following line.
-  ArgumentError.checkNotNull(method, 'method');
-  if (!method.startsWith('ext.')) {
-    throw new ArgumentError.value(method, 'method', 'Must begin with ext.');
-  }
-  if (_lookupExtension(method) != null) {
-    throw new ArgumentError('Extension already registered: $method');
-  }
-  // TODO: When NNBD is complete, delete the following line.
-  ArgumentError.checkNotNull(handler, 'handler');
-  _registerExtension(method, handler);
-}
-
-/// Post an event of [eventKind] with payload of [eventData] to the `Extension`
-/// event stream.
-void postEvent(String eventKind, Map eventData) {
-  // TODO: When NNBD is complete, delete the following two lines.
-  ArgumentError.checkNotNull(eventKind, 'eventKind');
-  ArgumentError.checkNotNull(eventData, 'eventData');
-  String eventDataAsString = json.encode(eventData);
-  _postEvent(eventKind, eventDataAsString);
-}
-
-external void _postEvent(String eventKind, String eventData);
-
-// Both of these functions are written inside C++ to avoid updating the data
-// structures in Dart, getting an OOB, and observing stale state. Do not move
-// these into Dart code unless you can ensure that the operations will can be
-// done atomically. Native code lives in vm/isolate.cc-
-// LookupServiceExtensionHandler and RegisterServiceExtensionHandler.
-external ServiceExtensionHandler? _lookupExtension(String method);
-external _registerExtension(String method, ServiceExtensionHandler handler);
diff --git a/sdk_nnbd/lib/developer/profiler.dart b/sdk_nnbd/lib/developer/profiler.dart
deleted file mode 100644
index 07fb625..0000000
--- a/sdk_nnbd/lib/developer/profiler.dart
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) 2014, 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.
-
-part of dart.developer;
-
-/// A UserTag can be used to group samples in the Observatory profiler.
-abstract class UserTag {
-  /// The maximum number of UserTag instances that can be created by a program.
-  static const MAX_USER_TAGS = 64;
-
-  external factory UserTag(String label);
-
-  /// Label of [this].
-  String get label;
-
-  /// Make [this] the current tag for the isolate. Returns the current tag
-  /// before setting.
-  UserTag makeCurrent();
-
-  /// The default [UserTag] with label 'Default'.
-  external static UserTag get defaultTag;
-}
-
-/// Returns the current [UserTag] for the isolate.
-external UserTag getCurrentTag();
-
-/// Abstract [Metric] class. Metric names must be unique, are hierarchical,
-/// and use periods as separators. For example, 'a.b.c'. Uniqueness is only
-/// enforced when a Metric is registered. The name of a metric cannot contain
-/// the slash ('/') character.
-abstract class Metric {
-  /// [name] of this metric.
-  final String name;
-
-  /// [description] of this metric.
-  final String description;
-
-  Metric(this.name, this.description) {
-    if ((name == 'vm') || name.contains('/')) {
-      throw new ArgumentError('Invalid Metric name.');
-    }
-  }
-
-  Map _toJSON();
-}
-
-/// A measured value with a min and max. Initial value is min. Value will
-/// be clamped to the interval [min, max].
-class Gauge extends Metric {
-  final double min;
-  final double max;
-
-  double _value;
-  double get value => _value;
-  set value(double v) {
-    if (v < min) {
-      v = min;
-    } else if (v > max) {
-      v = max;
-    }
-    _value = v;
-  }
-
-  Gauge(String name, String description, this.min, this.max)
-      : _value = min,
-        super(name, description) {
-    // TODO: When NNBD is complete, delete the following two lines.
-    ArgumentError.checkNotNull(min, 'min');
-    ArgumentError.checkNotNull(max, 'max');
-    if (!(min < max)) throw new ArgumentError('min must be less than max');
-  }
-
-  Map _toJSON() {
-    var map = {
-      'type': 'Gauge',
-      'id': 'metrics/$name',
-      'name': name,
-      'description': description,
-      'value': value,
-      'min': min,
-      'max': max,
-    };
-    return map;
-  }
-}
-
-/// A changing value. Initial value is 0.0.
-class Counter extends Metric {
-  Counter(String name, String description) : super(name, description);
-
-  double _value = 0.0;
-  double get value => _value;
-  set value(double v) {
-    _value = v;
-  }
-
-  Map _toJSON() {
-    var map = {
-      'type': 'Counter',
-      'id': 'metrics/$name',
-      'name': name,
-      'description': description,
-      'value': value,
-    };
-    return map;
-  }
-}
-
-class Metrics {
-  static final Map<String, Metric> _metrics = new Map<String, Metric>();
-
-  /// Register [Metric]s to make them visible to Observatory.
-  static void register(Metric metric) {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(metric, 'metric');
-    if (_metrics[metric.name] != null) {
-      throw new ArgumentError('Registered metrics have unique names');
-    }
-    _metrics[metric.name] = metric;
-  }
-
-  /// Deregister [Metric]s to make them not visible to Observatory.
-  static void deregister(Metric metric) {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(metric, 'metric');
-    _metrics.remove(metric.name);
-  }
-
-  // ignore: unused_element, called from native code
-  @pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
-  static String? _printMetric(String id) {
-    var metric = _metrics[id];
-    if (metric == null) {
-      return null;
-    }
-    return json.encode(metric._toJSON());
-  }
-
-  // ignore: unused_element, called from native code
-  @pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
-  static String _printMetrics() {
-    var metrics = [];
-    for (var metric in _metrics.values) {
-      metrics.add(metric._toJSON());
-    }
-    var map = {
-      'type': 'MetricList',
-      'metrics': metrics,
-    };
-    return json.encode(map);
-  }
-}
diff --git a/sdk_nnbd/lib/developer/service.dart b/sdk_nnbd/lib/developer/service.dart
deleted file mode 100644
index 6d90667..0000000
--- a/sdk_nnbd/lib/developer/service.dart
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2016, 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.
-
-part of dart.developer;
-
-/// Service protocol is the protocol that a client like the Observatory
-/// could use to access the services provided by the Dart VM for
-/// debugging and inspecting Dart programs. This class encapsulates the
-/// version number and Uri for accessing this service.
-class ServiceProtocolInfo {
-  /// The major version of the protocol. If the running Dart environment does
-  /// not support the service protocol, this is 0.
-  final int majorVersion = _getServiceMajorVersion();
-
-  /// The minor version of the protocol. If the running Dart environment does
-  /// not support the service protocol, this is 0.
-  final int minorVersion = _getServiceMinorVersion();
-
-  /// The Uri to access the service. If the web server is not running, this
-  /// will be null.
-  final Uri? serverUri;
-
-  ServiceProtocolInfo(this.serverUri);
-
-  String toString() {
-    if (serverUri != null) {
-      return 'Dart VM Service Protocol v$majorVersion.$minorVersion '
-          'listening on $serverUri';
-    } else {
-      return 'Dart VM Service Protocol v$majorVersion.$minorVersion';
-    }
-  }
-}
-
-/// Access information about the service protocol and control the web server
-/// that provides access to the services provided by the Dart VM for
-/// debugging and inspecting Dart programs.
-class Service {
-  /// Get information about the service protocol (version number and
-  /// Uri to access the service).
-  static Future<ServiceProtocolInfo> getInfo() async {
-    // Port to receive response from service isolate.
-    final RawReceivePort receivePort = new RawReceivePort();
-    final Completer<Uri?> uriCompleter = new Completer<Uri?>();
-    receivePort.handler = (Uri? uri) => uriCompleter.complete(uri);
-    // Request the information from the service isolate.
-    _getServerInfo(receivePort.sendPort);
-    // Await the response from the service isolate.
-    Uri? uri = await uriCompleter.future;
-    // Close the port.
-    receivePort.close();
-    return new ServiceProtocolInfo(uri);
-  }
-
-  /// Control the web server that the service protocol is accessed through.
-  /// The [enable] argument must be a boolean and is used as a toggle to
-  /// enable (true) or disable (false) the web server servicing requests.
-  static Future<ServiceProtocolInfo> controlWebServer(
-      {bool enable: false}) async {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(enable, 'enable');
-    // Port to receive response from service isolate.
-    final RawReceivePort receivePort = new RawReceivePort();
-    final Completer<Uri> uriCompleter = new Completer<Uri>();
-    receivePort.handler = (Uri uri) => uriCompleter.complete(uri);
-    // Request the information from the service isolate.
-    _webServerControl(receivePort.sendPort, enable);
-    // Await the response from the service isolate.
-    Uri uri = await uriCompleter.future;
-    // Close the port.
-    receivePort.close();
-    return new ServiceProtocolInfo(uri);
-  }
-
-  /// Returns a [String] token representing the ID of [isolate].
-  ///
-  /// Returns null if the running Dart environment does not support the service
-  /// protocol.
-  static String? getIsolateID(Isolate isolate) {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(isolate, 'isolate');
-    return _getIsolateIDFromSendPort(isolate.controlPort);
-  }
-}
-
-/// [sendPort] will receive a Uri or null.
-external void _getServerInfo(SendPort sendPort);
-
-/// [sendPort] will receive a Uri or null.
-external void _webServerControl(SendPort sendPort, bool enable);
-
-/// Returns the major version of the service protocol.
-external int _getServiceMajorVersion();
-
-/// Returns the minor version of the service protocol.
-external int _getServiceMinorVersion();
-
-/// Returns the service id for the isolate that owns [sendPort].
-external String? _getIsolateIDFromSendPort(SendPort sendPort);
diff --git a/sdk_nnbd/lib/developer/timeline.dart b/sdk_nnbd/lib/developer/timeline.dart
deleted file mode 100644
index cc9cf40..0000000
--- a/sdk_nnbd/lib/developer/timeline.dart
+++ /dev/null
@@ -1,385 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart.developer;
-
-const bool _hasTimeline =
-    const bool.fromEnvironment("dart.developer.timeline", defaultValue: true);
-
-/// A typedef for the function argument to [Timeline.timeSync].
-typedef TimelineSyncFunction<T> = T Function();
-
-// TODO: This typedef is not used.
-typedef Future TimelineAsyncFunction();
-
-/// A class to represent Flow events.
-///
-/// [Flow] objects are used to thread flow events between timeline slices,
-/// for example, those created with the [Timeline] class below. Adding
-/// [Flow] objects cause arrows to be drawn between slices in Chrome's trace
-/// viewer. The arrows start at e.g [Timeline] events that are passed a
-/// [Flow.begin] object, go through [Timeline] events that are passed a
-/// [Flow.step] object, and end at [Timeline] events that are passed a
-/// [Flow.end] object, all having the same [Flow.id]. For example:
-///
-/// ```dart
-/// var flow = Flow.begin();
-/// Timeline.timeSync('flow_test', () {
-///   doSomething();
-/// }, flow: flow);
-///
-/// Timeline.timeSync('flow_test', () {
-///   doSomething();
-/// }, flow: Flow.step(flow.id));
-///
-/// Timeline.timeSync('flow_test', () {
-///   doSomething();
-/// }, flow: Flow.end(flow.id));
-/// ```
-class Flow {
-  // These values must be kept in sync with the enum "EventType" in
-  // runtime/vm/timeline.h.
-  static const int _begin = 9;
-  static const int _step = 10;
-  static const int _end = 11;
-
-  final int _type;
-
-  /// The flow id of the flow event.
-  final int id;
-
-  Flow._(this._type, this.id);
-
-  /// A "begin" Flow event.
-  ///
-  /// When passed to a [Timeline] method, generates a "begin" Flow event.
-  /// If [id] is not provided, an id that conflicts with no other Dart-generated
-  /// flow id's will be generated.
-  static Flow begin({int? id}) {
-    return new Flow._(_begin, id ?? _getNextAsyncId());
-  }
-
-  /// A "step" Flow event.
-  ///
-  /// When passed to a [Timeline] method, generates a "step" Flow event.
-  /// The [id] argument is required. It can come either from another [Flow]
-  /// event, or some id that comes from the environment.
-  static Flow step(int id) => new Flow._(_step, id);
-
-  /// An "end" Flow event.
-  ///
-  /// When passed to a [Timeline] method, generates a "end" Flow event.
-  /// The [id] argument is required. It can come either from another [Flow]
-  /// event, or some id that comes from the environment.
-  static Flow end(int id) => new Flow._(_end, id);
-}
-
-/// Add to the timeline.
-///
-/// [Timeline]'s methods add synchronous events to the timeline. When
-/// generating a timeline in Chrome's tracing format, using [Timeline] generates
-/// "Complete" events. [Timeline]'s [startSync] and [finishSync] can be used
-/// explicitly, or implicitly by wrapping a closure in [timeSync]. For example:
-///
-/// ```dart
-/// Timeline.startSync("Doing Something");
-/// doSomething();
-/// Timeline.finishSync();
-/// ```
-///
-/// Or:
-///
-/// ```dart
-/// Timeline.timeSync("Doing Something", () {
-///   doSomething();
-/// });
-/// ```
-class Timeline {
-  /// Start a synchronous operation labeled [name]. Optionally takes
-  /// a [Map] of [arguments]. This slice may also optionally be associated with
-  /// a [Flow] event. This operation must be finished before
-  /// returning to the event queue.
-  static void startSync(String name, {Map? arguments, Flow? flow}) {
-    if (!_hasTimeline) return;
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(name, 'name');
-    if (!_isDartStreamEnabled()) {
-      // Push a null onto the stack and return.
-      _stack.add(null);
-      return;
-    }
-    var block = new _SyncBlock._(name);
-    if (arguments != null) {
-      block._arguments = arguments;
-    }
-    if (flow != null) {
-      block.flow = flow;
-    }
-    _stack.add(block);
-    block._startSync();
-  }
-
-  /// Finish the last synchronous operation that was started.
-  static void finishSync() {
-    if (!_hasTimeline) {
-      return;
-    }
-    if (_stack.length == 0) {
-      throw new StateError('Uneven calls to startSync and finishSync');
-    }
-    // Pop top item off of stack.
-    var block = _stack.removeLast();
-    if (block == null) {
-      // Dart stream was disabled when startSync was called.
-      return;
-    }
-    // Finish it.
-    block.finish();
-  }
-
-  /// Emit an instant event.
-  static void instantSync(String name, {Map? arguments}) {
-    if (!_hasTimeline) return;
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(name, 'name');
-    if (!_isDartStreamEnabled()) {
-      // Stream is disabled.
-      return;
-    }
-    Map? instantArguments;
-    if (arguments != null) {
-      instantArguments = new Map.from(arguments);
-    }
-    _reportInstantEvent('Dart', name, _argumentsAsJson(instantArguments));
-  }
-
-  /// A utility method to time a synchronous [function]. Internally calls
-  /// [function] bracketed by calls to [startSync] and [finishSync].
-  static T timeSync<T>(String name, TimelineSyncFunction<T> function,
-      {Map? arguments, Flow? flow}) {
-    startSync(name, arguments: arguments, flow: flow);
-    try {
-      return function();
-    } finally {
-      finishSync();
-    }
-  }
-
-  /// The current time stamp from the clock used by the timeline. Units are
-  /// microseconds.
-  ///
-  /// When run on the Dart VM, uses the same monotonic clock as the embedding
-  /// API's `Dart_TimelineGetMicros`.
-  static int get now => _getTraceClock();
-  static final List<_SyncBlock?> _stack = [];
-}
-
-/// An asynchronous task on the timeline. An asynchronous task can have many
-/// (nested) synchronous operations. Synchronous operations can live longer than
-/// the current isolate event. To pass a [TimelineTask] to another isolate,
-/// you must first call [pass] to get the task id and then construct a new
-/// [TimelineTask] in the other isolate.
-class TimelineTask {
-  /// Create a task. The task ID will be set by the system.
-  ///
-  /// If [parent] is provided, the parent's task ID is provided as argument
-  /// 'parentId' when [start] is called. In DevTools, this argument will result
-  /// in this [TimelineTask] being linked to the [parent] [TimelineTask].
-  ///
-  /// If [filterKey] is provided, a property named `filterKey` will be inserted
-  /// into the arguments of each event associated with this task. The
-  /// `filterKey` will be set to the value of [filterKey].
-  TimelineTask({TimelineTask? parent, String? filterKey})
-      : _parent = parent,
-        _filterKey = filterKey,
-        _taskId = _getNextAsyncId() {}
-
-  /// Create a task with an explicit [taskId]. This is useful if you are
-  /// passing a task from one isolate to another.
-  ///
-  /// Important note: only provide task IDs which have been obtained as a
-  /// result of invoking [TimelineTask.pass]. Specifying a custom ID can lead
-  /// to ID collisions, resulting in incorrect rendering of timeline events.
-  ///
-  /// If [filterKey] is provided, a property named `filterKey` will be inserted
-  /// into the arguments of each event associated with this task. The
-  /// `filterKey` will be set to the value of [filterKey].
-  TimelineTask.withTaskId(int taskId, {String? filterKey})
-      : _parent = null,
-        _filterKey = filterKey,
-        _taskId = taskId {
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(taskId, 'taskId');
-  }
-
-  /// Start a synchronous operation within this task named [name].
-  /// Optionally takes a [Map] of [arguments].
-  void start(String name, {Map? arguments}) {
-    if (!_hasTimeline) return;
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(name, 'name');
-    var block = new _AsyncBlock._(name, _taskId);
-    _stack.add(block);
-    // TODO(39115): Spurious error about collection literal ambiguity.
-    // TODO(39117): Spurious error about typing of `...?arguments`.
-    // TODO(39120): Spurious error even about `...arguments`.
-    // When these TODOs are done, we can use spread and if elements.
-    var map = <Object?, Object?>{};
-    if (arguments != null) {
-      for (var key in arguments.keys) {
-        map[key] = arguments[key];
-      }
-    }
-    if (_parent != null) map['parentId'] = _parent!._taskId.toRadixString(16);
-    if (_filterKey != null) map[_kFilterKey] = _filterKey;
-    block._start(map);
-  }
-
-  /// Emit an instant event for this task.
-  /// Optionally takes a [Map] of [arguments].
-  void instant(String name, {Map? arguments}) {
-    if (!_hasTimeline) return;
-    // TODO: When NNBD is complete, delete the following line.
-    ArgumentError.checkNotNull(name, 'name');
-    Map? instantArguments;
-    if (arguments != null) {
-      instantArguments = new Map.from(arguments);
-    }
-    if (_filterKey != null) {
-      instantArguments ??= {};
-      instantArguments[_kFilterKey] = _filterKey;
-    }
-    _reportTaskEvent(
-        _taskId, 'n', 'Dart', name, _argumentsAsJson(instantArguments));
-  }
-
-  /// Finish the last synchronous operation that was started.
-  /// Optionally takes a [Map] of [arguments].
-  void finish({Map? arguments}) {
-    if (!_hasTimeline) {
-      return;
-    }
-    if (_stack.length == 0) {
-      throw new StateError('Uneven calls to start and finish');
-    }
-    if (_filterKey != null) {
-      arguments ??= {};
-      arguments[_kFilterKey] = _filterKey;
-    }
-    // Pop top item off of stack.
-    var block = _stack.removeLast();
-    block._finish(arguments);
-  }
-
-  /// Retrieve the [TimelineTask]'s task id. Will throw an exception if the
-  /// stack is not empty.
-  int pass() {
-    if (_stack.length > 0) {
-      throw new StateError(
-          'You cannot pass a TimelineTask without finishing all started '
-          'operations');
-    }
-    int r = _taskId;
-    return r;
-  }
-
-  static const String _kFilterKey = 'filterKey';
-  final TimelineTask? _parent;
-  final String? _filterKey;
-  final int _taskId;
-  final List<_AsyncBlock> _stack = [];
-}
-
-/// An asynchronous block of time on the timeline. This block can be kept
-/// open across isolate messages.
-class _AsyncBlock {
-  /// The category this block belongs to.
-  final String category = 'Dart';
-
-  /// The name of this block.
-  final String name;
-
-  /// The asynchronous task id.
-  final int _taskId;
-
-  _AsyncBlock._(this.name, this._taskId);
-
-  // Emit the start event.
-  void _start(Map arguments) {
-    _reportTaskEvent(_taskId, 'b', category, name, _argumentsAsJson(arguments));
-  }
-
-  // Emit the finish event.
-  void _finish(Map? arguments) {
-    _reportTaskEvent(_taskId, 'e', category, name, _argumentsAsJson(arguments));
-  }
-}
-
-/// A synchronous block of time on the timeline. This block should not be
-/// kept open across isolate messages.
-class _SyncBlock {
-  /// The category this block belongs to.
-  final String category = 'Dart';
-
-  /// The name of this block.
-  final String name;
-
-  /// An (optional) set of arguments which will be serialized to JSON and
-  /// associated with this block.
-  Map? _arguments;
-
-  /// An (optional) flow event associated with this block.
-  Flow? _flow;
-
-  _SyncBlock._(this.name);
-
-  /// Start this block of time.
-  void _startSync() {
-    _reportTaskEvent(0, 'B', category, name, _argumentsAsJson(_arguments));
-  }
-
-  /// Finish this block of time. At this point, this block can no longer be
-  /// used.
-  void finish() {
-    // Report event to runtime.
-    _reportTaskEvent(0, 'E', category, name, _argumentsAsJson(_arguments));
-    if (_flow != null) {
-      _reportFlowEvent(category, "${_flow!.id}", _flow!._type, _flow!.id,
-          _argumentsAsJson(null));
-    }
-  }
-
-  void set flow(Flow f) {
-    _flow = f;
-  }
-}
-
-String _argumentsAsJson(Map? arguments) {
-  if ((arguments == null) || (arguments.length == 0)) {
-    // Fast path no arguments. Avoid calling jsonEncode.
-    return '{}';
-  }
-  return json.encode(arguments);
-}
-
-/// Returns true if the Dart Timeline stream is enabled.
-external bool _isDartStreamEnabled();
-
-/// Returns the next async task id.
-external int _getNextAsyncId();
-
-/// Returns the current value from the trace clock.
-external int _getTraceClock();
-
-/// Reports an event for a task.
-external void _reportTaskEvent(int taskId, String phase, String category,
-    String name, String argumentsAsJson);
-
-/// Reports a flow event.
-external void _reportFlowEvent(
-    String category, String name, int type, int id, String argumentsAsJson);
-
-/// Reports an instant event.
-external void _reportInstantEvent(
-    String category, String name, String argumentsAsJson);
diff --git a/sdk_nnbd/lib/ffi/annotations.dart b/sdk_nnbd/lib/ffi/annotations.dart
deleted file mode 100644
index f68e525..0000000
--- a/sdk_nnbd/lib/ffi/annotations.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.ffi;
-
-class DartRepresentationOf {
-  /// Represents the Dart type corresponding to a [NativeType].
-  ///
-  /// [Int8]                               -> [int]
-  /// [Int16]                              -> [int]
-  /// [Int32]                              -> [int]
-  /// [Int64]                              -> [int]
-  /// [Uint8]                              -> [int]
-  /// [Uint16]                             -> [int]
-  /// [Uint32]                             -> [int]
-  /// [Uint64]                             -> [int]
-  /// [IntPtr]                             -> [int]
-  /// [Double]                             -> [double]
-  /// [Float]                              -> [double]
-  /// [Pointer]<T>                         -> [Pointer]<T>
-  /// [NativeFunction]<T1 Function(T2, T3) -> S1 Function(S2, S3)
-  ///    where DartRepresentationOf(Tn) -> Sn
-  /// T extends Struct                  -> T
-  const DartRepresentationOf(String nativeType);
-}
-
-class Unsized {
-  const Unsized();
-}
-
-/// This [NativeType] does not have predefined size.
-///
-/// Unsized NativeTypes do not support [sizeOf] because their size is unknown.
-/// Consequently, [allocate], [Pointer.load], [Pointer.store], and
-/// [Pointer.elementAt] are not available.
-const unsized = const Unsized();
diff --git a/sdk_nnbd/lib/ffi/dynamic_library.dart b/sdk_nnbd/lib/ffi/dynamic_library.dart
deleted file mode 100644
index d11c945..0000000
--- a/sdk_nnbd/lib/ffi/dynamic_library.dart
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.ffi;
-
-/// Represents a dynamically loaded C library.
-class DynamicLibrary {
-  /// Creates a dynamic library holding all global symbols.
-  ///
-  /// Any symbol in a library currently loaded with global visibility (including
-  /// the executable itself) may be resolved in this library.
-  ///
-  /// This feature is not available on Windows, instead an exception is thrown.
-  external factory DynamicLibrary.process();
-
-  /// Creates a dynamic library representing the running executable.
-  external factory DynamicLibrary.executable();
-
-  /// Loads a dynamic library file with local visibility.
-  ///
-  /// Throws an [ArgumentError] if loading the dynamic library fails.
-  external factory DynamicLibrary.open(String name);
-
-  /// Looks up a symbol in the [DynamicLibrary] and returns its address in
-  /// memory. Equivalent of dlsym.
-  ///
-  /// Throws an [ArgumentError] if it fails to lookup the symbol.
-  external Pointer<T> lookup<T extends NativeType>(String symbolName);
-
-  /// Dynamic libraries are equal if they load the same library.
-  external bool operator ==(Object other);
-
-  /// The hash code for a DynamicLibrary only depends on the loaded library
-  external int get hashCode;
-
-  /// The handle to the dynamic library.
-  external Pointer<Void> get handle;
-}
-
-/// Methods which cannot be invoked dynamically.
-extension DynamicLibraryExtension on DynamicLibrary {
-  /// Helper that combines lookup and cast to a Dart function.
-  external F lookupFunction<T extends Function, F extends Function>(
-      String symbolName);
-}
diff --git a/sdk_nnbd/lib/ffi/ffi.dart b/sdk_nnbd/lib/ffi/ffi.dart
deleted file mode 100644
index 3b6e236..0000000
--- a/sdk_nnbd/lib/ffi/ffi.dart
+++ /dev/null
@@ -1,593 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file
-
-/**
- * Foreign Function Interface for interoperability with the C programming language.
- *
- * **NOTE**: Dart:FFI is in beta, and breaking API changes might still happen.
- *
- * For further details, please see: https://dart.dev/server/c-interop
- *
- * {@category VM}
- */
-library dart.ffi;
-
-import 'dart:isolate';
-import 'dart:typed_data';
-
-part "native_type.dart";
-part "annotations.dart";
-part "dynamic_library.dart";
-part "struct.dart";
-
-/// Number of bytes used by native type T.
-///
-/// Includes padding and alignment of structs.
-external int sizeOf<T extends NativeType>();
-
-/// Represents a pointer into the native C memory corresponding to "NULL", e.g.
-/// a pointer with address 0.
-final Pointer<Never> nullptr = Pointer.fromAddress(0);
-
-/// Represents a pointer into the native C memory. Cannot be extended.
-@pragma("vm:entry-point")
-class Pointer<T extends NativeType> extends NativeType {
-  /// Construction from raw integer.
-  external factory Pointer.fromAddress(int ptr);
-
-  /// Convert Dart function to a C function pointer, automatically marshalling
-  /// the arguments and return value
-  ///
-  /// If an exception is thrown while calling `f()`, the native function will
-  /// return `exceptionalReturn`, which must be assignable to return type of `f`.
-  ///
-  /// The returned function address can only be invoked on the mutator (main)
-  /// thread of the current isolate. It will abort the process if invoked on any
-  /// other thread.
-  ///
-  /// The pointer returned will remain alive for the duration of the current
-  /// isolate's lifetime. After the isolate it was created in is terminated,
-  /// invoking it from native code will cause undefined behavior.
-  ///
-  /// Does not accept dynamic invocations -- where the type of the receiver is
-  /// [dynamic].
-  external static Pointer<NativeFunction<T>> fromFunction<T extends Function>(
-      @DartRepresentationOf("T") Function f,
-      [Object? exceptionalReturn]);
-
-  /// Access to the raw pointer value.
-  /// On 32-bit systems, the upper 32-bits of the result are 0.
-  external int get address;
-
-  /// Pointer arithmetic (takes element size into account).
-  external Pointer<T> elementAt(int index);
-
-  /// Cast Pointer<T> to a Pointer<V>.
-  external Pointer<U> cast<U extends NativeType>();
-
-  /// Equality for Pointers only depends on their address.
-  bool operator ==(Object other) {
-    if (other is! Pointer) return false;
-    Pointer otherPointer = other;
-    return address == otherPointer.address;
-  }
-
-  /// The hash code for a Pointer only depends on its address.
-  int get hashCode {
-    return address.hashCode;
-  }
-}
-
-/// Extension on [Pointer] specialized for the type argument [NativeFunction].
-extension NativeFunctionPointer<NF extends Function>
-    on Pointer<NativeFunction<NF>> {
-  /// Convert to Dart function, automatically marshalling the arguments
-  /// and return value.
-  external DF asFunction<@DartRepresentationOf("NF") DF extends Function>();
-}
-
-//
-// The following code is generated, do not edit by hand.
-//
-// Code generated by `runtime/tools/ffi/sdk_lib_ffi_generator.dart`.
-//
-
-/// Extension on [Pointer] specialized for the type argument [Int8].
-extension Int8Pointer on Pointer<Int8> {
-  /// The 8-bit two's complement integer at [address].
-  ///
-  /// A Dart integer is truncated to 8 bits (as if by `.toSigned(8)`) before
-  /// being stored, and the 8-bit value is sign-extended when it is loaded.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 8-bit two's complement integer at `address + index`.
-  ///
-  /// A Dart integer is truncated to 8 bits (as if by `.toSigned(8)`) before
-  /// being stored, and the 8-bit value is sign-extended when it is loaded.
-  external int operator [](int index);
-
-  /// The 8-bit two's complement integer at `address + index`.
-  ///
-  /// A Dart integer is truncated to 8 bits (as if by `.toSigned(8)`) before
-  /// being stored, and the 8-bit value is sign-extended when it is loaded.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  external Int8List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Int16].
-extension Int16Pointer on Pointer<Int16> {
-  /// The 16-bit two's complement integer at [address].
-  ///
-  /// A Dart integer is truncated to 16 bits (as if by `.toSigned(16)`) before
-  /// being stored, and the 16-bit value is sign-extended when it is loaded.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 16-bit two's complement integer at `address + 2 * index`.
-  ///
-  /// A Dart integer is truncated to 16 bits (as if by `.toSigned(16)`) before
-  /// being stored, and the 16-bit value is sign-extended when it is loaded.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external int operator [](int index);
-
-  /// The 16-bit two's complement integer at `address + 2 * index`.
-  ///
-  /// A Dart integer is truncated to 16 bits (as if by `.toSigned(16)`) before
-  /// being stored, and the 16-bit value is sign-extended when it is loaded.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 2 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external Int16List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Int32].
-extension Int32Pointer on Pointer<Int32> {
-  /// The 32-bit two's complement integer at [address].
-  ///
-  /// A Dart integer is truncated to 32 bits (as if by `.toSigned(32)`) before
-  /// being stored, and the 32-bit value is sign-extended when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 32-bit two's complement integer at `address + 4 * index`.
-  ///
-  /// A Dart integer is truncated to 32 bits (as if by `.toSigned(32)`) before
-  /// being stored, and the 32-bit value is sign-extended when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external int operator [](int index);
-
-  /// The 32-bit two's complement integer at `address + 4 * index`.
-  ///
-  /// A Dart integer is truncated to 32 bits (as if by `.toSigned(32)`) before
-  /// being stored, and the 32-bit value is sign-extended when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 4 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external Int32List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Int64].
-extension Int64Pointer on Pointer<Int64> {
-  /// The 64-bit two's complement integer at [address].
-  ///
-  /// The [address] must be 8-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 64-bit two's complement integer at `address + 8 * index`.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external int operator [](int index);
-
-  /// The 64-bit two's complement integer at `address + 8 * index`.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 8 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external Int64List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Uint8].
-extension Uint8Pointer on Pointer<Uint8> {
-  /// The 8-bit unsigned integer at [address].
-  ///
-  /// A Dart integer is truncated to 8 bits (as if by `.toUnsigned(8)`) before
-  /// being stored, and the 8-bit value is zero-extended when it is loaded.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 8-bit unsigned integer at `address + index`.
-  ///
-  /// A Dart integer is truncated to 8 bits (as if by `.toUnsigned(8)`) before
-  /// being stored, and the 8-bit value is zero-extended when it is loaded.
-  external int operator [](int index);
-
-  /// The 8-bit unsigned integer at `address + index`.
-  ///
-  /// A Dart integer is truncated to 8 bits (as if by `.toUnsigned(8)`) before
-  /// being stored, and the 8-bit value is zero-extended when it is loaded.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  external Uint8List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Uint16].
-extension Uint16Pointer on Pointer<Uint16> {
-  /// The 16-bit unsigned integer at [address].
-  ///
-  /// A Dart integer is truncated to 16 bits (as if by `.toUnsigned(16)`) before
-  /// being stored, and the 16-bit value is zero-extended when it is loaded.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 16-bit unsigned integer at `address + 2 * index`.
-  ///
-  /// A Dart integer is truncated to 16 bits (as if by `.toUnsigned(16)`) before
-  /// being stored, and the 16-bit value is zero-extended when it is loaded.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external int operator [](int index);
-
-  /// The 16-bit unsigned integer at `address + 2 * index`.
-  ///
-  /// A Dart integer is truncated to 16 bits (as if by `.toUnsigned(16)`) before
-  /// being stored, and the 16-bit value is zero-extended when it is loaded.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 2 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 2-byte aligned.
-  external Uint16List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Uint32].
-extension Uint32Pointer on Pointer<Uint32> {
-  /// The 32-bit unsigned integer at [address].
-  ///
-  /// A Dart integer is truncated to 32 bits (as if by `.toUnsigned(32)`) before
-  /// being stored, and the 32-bit value is zero-extended when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 32-bit unsigned integer at `address + 4 * index`.
-  ///
-  /// A Dart integer is truncated to 32 bits (as if by `.toUnsigned(32)`) before
-  /// being stored, and the 32-bit value is zero-extended when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external int operator [](int index);
-
-  /// The 32-bit unsigned integer at `address + 4 * index`.
-  ///
-  /// A Dart integer is truncated to 32 bits (as if by `.toUnsigned(32)`) before
-  /// being stored, and the 32-bit value is zero-extended when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 4 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external Uint32List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Uint64].
-extension Uint64Pointer on Pointer<Uint64> {
-  /// The 64-bit unsigned integer at [address].
-  ///
-  /// The [address] must be 8-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 64-bit unsigned integer at `address + 8 * index`.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external int operator [](int index);
-
-  /// The 64-bit unsigned integer at `address + 8 * index`.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external void operator []=(int index, int value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 8 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external Uint64List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [IntPtr].
-extension IntPtrPointer on Pointer<IntPtr> {
-  /// The 32 or 64-bit two's complement integer at [address].
-  ///
-  /// On 32-bit platforms this is a 32-bit integer, and on 64-bit platforms
-  /// this is a 64-bit integer.
-  ///
-  /// On 32-bit platforms a Dart integer is truncated to 32 bits (as if by
-  /// `.toSigned(32)`) before being stored, and the 32-bit value is
-  /// sign-extended when it is loaded.
-  ///
-  /// On 32-bit platforms the [address] must be 4-byte aligned, and on 64-bit
-  /// platforms the [address] must be 8-byte aligned.
-  external int get value;
-
-  external void set value(int value);
-
-  /// The 32 or 64-bit two's complement integer at `address + (4 or 8) * index`.
-  ///
-  /// On 32-bit platforms this is a 32-bit integer, and on 64-bit platforms
-  /// this is a 64-bit integer.
-  ///
-  /// On 32-bit platforms a Dart integer is truncated to 32 bits (as if by
-  /// `.toSigned(32)`) before being stored, and the 32-bit value is
-  /// sign-extended when it is loaded.
-  ///
-  /// On 32-bit platforms the [address] must be 4-byte aligned, and on 64-bit
-  /// platforms the [address] must be 8-byte aligned.
-  external int operator [](int index);
-
-  /// The 32 or 64-bit two's complement integer at `address + (4 or 8) * index`.
-  ///
-  /// On 32-bit platforms this is a 32-bit integer, and on 64-bit platforms
-  /// this is a 64-bit integer.
-  ///
-  /// On 32-bit platforms a Dart integer is truncated to 32 bits (as if by
-  /// `.toSigned(32)`) before being stored, and the 32-bit value is
-  /// sign-extended when it is loaded.
-  ///
-  /// On 32-bit platforms the [address] must be 4-byte aligned, and on 64-bit
-  /// platforms the [address] must be 8-byte aligned.
-  external void operator []=(int index, int value);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Float].
-extension FloatPointer on Pointer<Float> {
-  /// The float at [address].
-  ///
-  /// A Dart double loses precision before being stored, and the float value is
-  /// converted to a double when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external double get value;
-
-  external void set value(double value);
-
-  /// The float at `address + 4 * index`.
-  ///
-  /// A Dart double loses precision before being stored, and the float value is
-  /// converted to a double when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external double operator [](int index);
-
-  /// The float at `address + 4 * index`.
-  ///
-  /// A Dart double loses precision before being stored, and the float value is
-  /// converted to a double when it is loaded.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external void operator []=(int index, double value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 4 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 4-byte aligned.
-  external Float32List asTypedList(int length);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Double].
-extension DoublePointer on Pointer<Double> {
-  /// The double at [address].
-  ///
-  /// The [address] must be 8-byte aligned.
-  external double get value;
-
-  external void set value(double value);
-
-  /// The double at `address + 8 * index`.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external double operator [](int index);
-
-  /// The double at `address + 8 * index`.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external void operator []=(int index, double value);
-
-  /// Creates a typed list view backed by memory in the address space.
-  ///
-  /// The returned view will allow access to the memory range from [address]
-  /// to `address + 8 * length`.
-  ///
-  /// The user has to ensure the memory range is accessible while using the
-  /// returned list.
-  ///
-  /// The [address] must be 8-byte aligned.
-  external Float64List asTypedList(int length);
-}
-
-//
-// End of generated code.
-//
-
-/// Extension on [Pointer] specialized for the type argument [Pointer].
-extension PointerPointer<T extends NativeType> on Pointer<Pointer<T>> {
-  /// The pointer at [address].
-  ///
-  /// A [Pointer] is unboxed before being stored (as if by `.address`), and the
-  /// pointer is boxed (as if by `Pointer.fromAddress`) when loaded.
-  ///
-  /// On 32-bit platforms the [address] must be 4-byte aligned, and on 64-bit
-  /// platforms the [address] must be 8-byte aligned.
-  external Pointer<T> get value;
-
-  external void set value(Pointer<T> value);
-
-  /// Load a Dart value from this location offset by [index].
-  ///
-  /// A [Pointer] is unboxed before being stored (as if by `.address`), and the
-  /// pointer is boxed (as if by `Pointer.fromAddress`) when loaded.
-  ///
-  /// On 32-bit platforms the [address] must be 4-byte aligned, and on 64-bit
-  /// platforms the [address] must be 8-byte aligned.
-  external Pointer<T> operator [](int index);
-
-  /// Store a Dart value into this location offset by [index].
-  ///
-  /// A [Pointer] is unboxed before being stored (as if by `.address`), and the
-  /// pointer is boxed (as if by `Pointer.fromAddress`) when loaded.
-  ///
-  /// On 32-bit platforms the [address] must be 4-byte aligned, and on 64-bit
-  /// platforms the [address] must be 8-byte aligned.
-  external void operator []=(int index, Pointer<T> value);
-}
-
-/// Extension on [Pointer] specialized for the type argument [Struct].
-extension StructPointer<T extends Struct> on Pointer<T> {
-  /// Creates a reference to access the fields of this struct backed by native
-  /// memory at [address].
-  ///
-  /// The [address] must be aligned according to the struct alignment rules of
-  /// the platform.
-  external T get ref;
-
-  /// Creates a reference to access the fields of this struct backed by native
-  /// memory at `address + sizeOf<T>() * index`.
-  ///
-  /// The [address] must be aligned according to the struct alignment rules of
-  /// the platform.
-  external T operator [](int index);
-}
-
-/// Extension to retrieve the native `Dart_Port` from a [SendPort].
-extension NativePort on SendPort {
-  /// The native port of this [SendPort].
-  ///
-  /// The returned native port can for example be used by C code to post
-  /// messages to the connected [ReceivePort] via `Dart_PostCObject()` - see
-  /// `dart_native_api.h`.
-  external int get nativePort;
-}
-
-/// Opaque, not exposing it's members.
-class Dart_CObject extends Struct {}
-
-typedef Dart_NativeMessageHandler = Void Function(Int64, Pointer<Dart_CObject>);
-
-/// Exposes function pointers to functions in `dart_native_api.h`.
-abstract class NativeApi {
-  /// A function pointer to
-  /// `bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message)`
-  /// in `dart_native_api.h`.
-  external static Pointer<
-          NativeFunction<Int8 Function(Int64, Pointer<Dart_CObject>)>>
-      get postCObject;
-
-  /// A function pointer to
-  /// ```
-  /// Dart_Port Dart_NewNativePort(const char* name,
-  ///                              Dart_NativeMessageHandler handler,
-  ///                              bool handle_concurrently)
-  /// ```
-  /// in `dart_native_api.h`.
-  external static Pointer<
-      NativeFunction<
-          Int64 Function(
-              Pointer<Uint8>,
-              Pointer<NativeFunction<Dart_NativeMessageHandler>>,
-              Int8)>> get newNativePort;
-
-  /// A function pointer to
-  /// `bool Dart_CloseNativePort(Dart_Port native_port_id)`
-  /// in `dart_native_api.h`.
-  external static Pointer<NativeFunction<Int8 Function(Int64)>>
-      get closeNativePort;
-}
diff --git a/sdk_nnbd/lib/ffi/ffi_sources.gni b/sdk_nnbd/lib/ffi/ffi_sources.gni
deleted file mode 100644
index 5b34b9c..0000000
--- a/sdk_nnbd/lib/ffi/ffi_sources.gni
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-ffi_sdk_sources = [
-  "ffi.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "annotations.dart",
-  "dynamic_library.dart",
-  "native_type.dart",
-  "struct.dart",
-]
diff --git a/sdk_nnbd/lib/ffi/native_type.dart b/sdk_nnbd/lib/ffi/native_type.dart
deleted file mode 100644
index e319342..0000000
--- a/sdk_nnbd/lib/ffi/native_type.dart
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.ffi;
-
-/// [NativeType]'s subtypes represent a native type in C.
-///
-/// [NativeType]'s subtypes are not constructible in the Dart code and serve
-/// purely as markers in type signatures.
-abstract class NativeType {
-  const NativeType();
-}
-
-/// [_NativeInteger]'s subtypes represent a native integer in C.
-///
-/// [_NativeInteger]'s subtypes are not constructible in the Dart code and serve
-/// purely as markers in type signatures.
-class _NativeInteger extends NativeType {
-  const _NativeInteger();
-}
-
-/// [_NativeDouble]'s subtypes represent a native float or double in C.
-///
-/// [_NativeDouble]'s subtypes are not constructible in the Dart code and serve
-/// purely as markers in type signatures.
-class _NativeDouble extends NativeType {
-  const _NativeDouble();
-}
-
-/// Represents a native signed 8 bit integer in C.
-///
-/// [Int8] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-class Int8 extends _NativeInteger {
-  const Int8();
-}
-
-/// Represents a native signed 16 bit integer in C.
-///
-/// [Int16] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-class Int16 extends _NativeInteger {
-  const Int16();
-}
-
-/// Represents a native signed 32 bit integer in C.
-///
-/// [Int32] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-class Int32 extends _NativeInteger {
-  const Int32();
-}
-
-/// Represents a native signed 64 bit integer in C.
-///
-/// [Int64] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-class Int64 extends _NativeInteger {
-  const Int64();
-}
-
-/// Represents a native unsigned 8 bit integer in C.
-///
-/// [Uint8] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-class Uint8 extends _NativeInteger {
-  const Uint8();
-}
-
-/// Represents a native unsigned 16 bit integer in C.
-///
-/// [Uint16] is not constructible in the Dart code and serves purely as marker
-/// in type signatures.
-class Uint16 extends _NativeInteger {
-  const Uint16();
-}
-
-/// Represents a native unsigned 32 bit integer in C.
-///
-/// [Uint32] is not constructible in the Dart code and serves purely as marker
-/// in type signatures.
-class Uint32 extends _NativeInteger {
-  const Uint32();
-}
-
-/// Represents a native unsigned 64 bit integer in C.
-///
-/// [Uint64] is not constructible in the Dart code and serves purely as marker
-/// in type signatures.
-class Uint64 extends _NativeInteger {
-  const Uint64();
-}
-
-/// Represents a native pointer-sized integer in C.
-///
-/// [IntPtr] is not constructible in the Dart code and serves purely as marker
-/// in type signatures.
-class IntPtr extends _NativeInteger {
-  const IntPtr();
-}
-
-/// Represents a native 32 bit float in C.
-///
-/// [Float] is not constructible in the Dart code and serves purely as marker
-/// in type signatures.
-class Float extends _NativeDouble {
-  const Float();
-}
-
-/// Represents a native 64 bit double in C.
-///
-/// [Double] is not constructible in the Dart code and serves purely as marker
-/// in type signatures.
-class Double extends _NativeDouble {
-  const Double();
-}
-
-/// Represents a void type in C.
-///
-/// [Void] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-@unsized
-abstract class Void extends NativeType {}
-
-/// Represents `Dart_Handle` in C.
-///
-/// [Handle] is not constructible in the Dart code and serves purely as marker in
-/// type signatures.
-abstract class Handle extends NativeType {}
-
-/// Represents a function type in C.
-///
-/// [NativeFunction] is not constructible in the Dart code and serves purely as
-/// marker in type signatures.
-@unsized
-abstract class NativeFunction<T extends Function> extends NativeType {}
diff --git a/sdk_nnbd/lib/ffi/struct.dart b/sdk_nnbd/lib/ffi/struct.dart
deleted file mode 100644
index c6605d8..0000000
--- a/sdk_nnbd/lib/ffi/struct.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.ffi;
-
-/// This class is extended to define structs.
-///
-/// Fields in a struct, annotated with a subtype of [NativeType], are
-/// automatically transformed into wrappers to access the fields of the struct
-/// in native memory.
-///
-/// All fields in a struct must either have a type which extends [NativeType] or
-/// else have an annotation indicating the corresponding native type (e.g.
-/// "@Int32()" for "int").
-///
-/// Instances of a subclass of [Struct] have reference semantics and are backed
-/// by native memory. The may allocated via allocation or loaded from a
-/// [Pointer], but not by a generative constructor.
-abstract class Struct extends NativeType {
-  final Pointer<Struct> _addressOf;
-
-  /// Construct a reference to the [nullptr].
-  ///
-  /// Use [StructPointer]'s `.ref` to gain references to native memory backed
-  /// structs.
-  Struct() : _addressOf = nullptr;
-
-  Struct._fromPointer(this._addressOf);
-}
-
-/// Extension on [Struct] specialized for it's subtypes.
-extension StructAddressOf<T extends Struct> on T {
-  /// Returns the address backing the reference.
-  Pointer<T> get addressOf => _addressOf as Pointer<T>;
-}
diff --git a/sdk_nnbd/lib/html/dart2js/html_dart2js.dart b/sdk_nnbd/lib/html/dart2js/html_dart2js.dart
deleted file mode 100644
index 04dcc3d..0000000
--- a/sdk_nnbd/lib/html/dart2js/html_dart2js.dart
+++ /dev/null
@@ -1,41043 +0,0 @@
-/**
- * HTML elements and other resources for web-based applications that need to
- * interact with the browser and the DOM (Document Object Model).
- *
- * This library includes DOM element types, CSS styling, local storage,
- * media, speech, events, and more.
- * To get started,
- * check out the [Element] class, the base class for many of the HTML
- * DOM types.
- *
- * For information on writing web apps with Dart, see https://webdev.dartlang.org.
- *
- * {@category Web}
- */
-library dart.dom.html;
-
-import 'dart:async';
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' hide Symbol;
-import 'dart:html_common';
-import 'dart:indexed_db';
-import "dart:convert";
-import 'dart:math';
-import 'dart:_native_typed_data';
-import 'dart:typed_data';
-import 'dart:svg' as svg;
-import 'dart:svg' show Matrix;
-import 'dart:svg' show SvgSvgElement;
-import 'dart:web_audio' as web_audio;
-import 'dart:web_audio' show AudioBuffer, AudioTrack, AudioTrackList;
-import 'dart:web_gl' as gl;
-import 'dart:web_gl' show RenderingContext, RenderingContext2;
-import 'dart:web_sql';
-import 'dart:_foreign_helper' show JS, JS_INTERCEPTOR_CONSTANT;
-// Copyright (c) 2012, 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.
-
-// DO NOT EDIT - unless you are editing documentation as per:
-// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
-// Auto-generated dart:html library.
-
-// Not actually used, but imported since dart:html can generate these objects.
-import 'dart:_js_helper'
-    show
-        convertDartClosureToJS,
-        Creates,
-        JavaScriptIndexingBehavior,
-        JSName,
-        Native,
-        Returns,
-        ForceInline,
-        findDispatchTagForInterceptorClass,
-        setNativeSubclassDispatchRecord,
-        makeLeafDispatchRecord,
-        registerGlobalObject,
-        applyExtension;
-import 'dart:_interceptors'
-    show
-        Interceptor,
-        JavaScriptFunction,
-        JSExtendableArray,
-        JSUInt31,
-        findInterceptorConstructorForType,
-        findConstructorForNativeSubclassType,
-        getNativeInterceptor,
-        setDispatchProperty;
-
-export 'dart:_internal' show HttpStatus;
-export 'dart:html_common' show promiseToFuture;
-export 'dart:math' show Rectangle, Point;
-
-/**
- * Top-level container for a web page, which is usually a browser tab or window.
- *
- * Each web page loaded in the browser has its own [Window], which is a
- * container for the web page.
- *
- * If the web page has any `<iframe>` elements, then each `<iframe>` has its own
- * [Window] object, which is accessible only to that `<iframe>`.
- *
- * See also:
- *
- *   * [Window](https://developer.mozilla.org/en-US/docs/Web/API/window) from MDN.
- */
-Window get window => JS('Window', 'window');
-
-/**
- * Root node for all content in a web page.
- */
-HtmlDocument get document =>
-    JS('returns:HtmlDocument;depends:none;effects:none;gvn:true', 'document');
-
-/// Convert a JS Promise to a Future<Map<String, dynamic>>.
-///
-/// On a successful result the native JS result will be converted to a Dart Map.
-/// See [convertNativeToDart_Dictionary]. On a rejected promise the error is
-/// forwarded without change.
-Future<Map<String, dynamic>?> promiseToFutureAsMap(jsPromise) =>
-    promiseToFuture(jsPromise).then(convertNativeToDart_Dictionary);
-
-// Workaround for tags like <cite> that lack their own Element subclass --
-// Dart issue 1990.
-@Native("HTMLElement")
-class HtmlElement extends Element implements NoncedElement {
-  factory HtmlElement() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  HtmlElement.created() : super.created();
-
-  // From NoncedElement
-  String? get nonce native;
-  set nonce(String? value) native;
-}
-
-/**
- * Emitted for any setlike IDL entry needs a callback signature.
- * Today there is only one.
- */
-typedef void FontFaceSetForEachCallback(
-    FontFace fontFace, FontFace fontFaceAgain, FontFaceSet set);
-
-WorkerGlobalScope get _workerSelf => JS('WorkerGlobalScope', 'self');
-// Copyright (c) 2012, 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.
-
-@Native("AbortPaymentEvent")
-class AbortPaymentEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory AbortPaymentEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AbortPaymentEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return AbortPaymentEvent._create_1(type, eventInitDict_1);
-  }
-  static AbortPaymentEvent _create_1(type, eventInitDict) => JS(
-      'AbortPaymentEvent', 'new AbortPaymentEvent(#,#)', type, eventInitDict);
-
-  void respondWith(Future paymentAbortedResponse) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AbsoluteOrientationSensor")
-class AbsoluteOrientationSensor extends OrientationSensor {
-  // To suppress missing implicit constructor warnings.
-  factory AbsoluteOrientationSensor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AbsoluteOrientationSensor([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return AbsoluteOrientationSensor._create_1(sensorOptions_1);
-    }
-    return AbsoluteOrientationSensor._create_2();
-  }
-  static AbsoluteOrientationSensor _create_1(sensorOptions) => JS(
-      'AbsoluteOrientationSensor',
-      'new AbsoluteOrientationSensor(#)',
-      sensorOptions);
-  static AbsoluteOrientationSensor _create_2() =>
-      JS('AbsoluteOrientationSensor', 'new AbsoluteOrientationSensor()');
-}
-// Copyright (c) 2013, 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.
-
-abstract class AbstractWorker extends Interceptor implements EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory AbstractWorker._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [AbstractWorker].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /// Stream of `error` events handled by this [AbstractWorker].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("Accelerometer")
-class Accelerometer extends Sensor {
-  // To suppress missing implicit constructor warnings.
-  factory Accelerometer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Accelerometer([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return Accelerometer._create_1(sensorOptions_1);
-    }
-    return Accelerometer._create_2();
-  }
-  static Accelerometer _create_1(sensorOptions) =>
-      JS('Accelerometer', 'new Accelerometer(#)', sensorOptions);
-  static Accelerometer _create_2() =>
-      JS('Accelerometer', 'new Accelerometer()');
-
-  num? get x native;
-
-  num? get y native;
-
-  num? get z native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AccessibleNode")
-class AccessibleNode extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory AccessibleNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> accessibleClickEvent =
-      const EventStreamProvider<Event>('accessibleclick');
-
-  static const EventStreamProvider<Event> accessibleContextMenuEvent =
-      const EventStreamProvider<Event>('accessiblecontextmenu');
-
-  static const EventStreamProvider<Event> accessibleDecrementEvent =
-      const EventStreamProvider<Event>('accessibledecrement');
-
-  static const EventStreamProvider<Event> accessibleFocusEvent =
-      const EventStreamProvider<Event>('accessiblefocus');
-
-  static const EventStreamProvider<Event> accessibleIncrementEvent =
-      const EventStreamProvider<Event>('accessibleincrement');
-
-  static const EventStreamProvider<Event> accessibleScrollIntoViewEvent =
-      const EventStreamProvider<Event>('accessiblescrollintoview');
-
-  factory AccessibleNode() {
-    return AccessibleNode._create_1();
-  }
-  static AccessibleNode _create_1() =>
-      JS('AccessibleNode', 'new AccessibleNode()');
-
-  AccessibleNode? get activeDescendant native;
-
-  set activeDescendant(AccessibleNode? value) native;
-
-  bool? get atomic native;
-
-  set atomic(bool? value) native;
-
-  String? get autocomplete native;
-
-  set autocomplete(String? value) native;
-
-  bool? get busy native;
-
-  set busy(bool? value) native;
-
-  String? get checked native;
-
-  set checked(String? value) native;
-
-  int? get colCount native;
-
-  set colCount(int? value) native;
-
-  int? get colIndex native;
-
-  set colIndex(int? value) native;
-
-  int? get colSpan native;
-
-  set colSpan(int? value) native;
-
-  AccessibleNodeList? get controls native;
-
-  set controls(AccessibleNodeList? value) native;
-
-  String? get current native;
-
-  set current(String? value) native;
-
-  AccessibleNodeList? get describedBy native;
-
-  set describedBy(AccessibleNodeList? value) native;
-
-  AccessibleNode? get details native;
-
-  set details(AccessibleNode? value) native;
-
-  bool? get disabled native;
-
-  set disabled(bool? value) native;
-
-  AccessibleNode? get errorMessage native;
-
-  set errorMessage(AccessibleNode? value) native;
-
-  bool? get expanded native;
-
-  set expanded(bool? value) native;
-
-  AccessibleNodeList? get flowTo native;
-
-  set flowTo(AccessibleNodeList? value) native;
-
-  String? get hasPopUp native;
-
-  set hasPopUp(String? value) native;
-
-  bool? get hidden native;
-
-  set hidden(bool? value) native;
-
-  String? get invalid native;
-
-  set invalid(String? value) native;
-
-  String? get keyShortcuts native;
-
-  set keyShortcuts(String? value) native;
-
-  String? get label native;
-
-  set label(String? value) native;
-
-  AccessibleNodeList? get labeledBy native;
-
-  set labeledBy(AccessibleNodeList? value) native;
-
-  int? get level native;
-
-  set level(int? value) native;
-
-  String? get live native;
-
-  set live(String? value) native;
-
-  bool? get modal native;
-
-  set modal(bool? value) native;
-
-  bool? get multiline native;
-
-  set multiline(bool? value) native;
-
-  bool? get multiselectable native;
-
-  set multiselectable(bool? value) native;
-
-  String? get orientation native;
-
-  set orientation(String? value) native;
-
-  AccessibleNodeList? get owns native;
-
-  set owns(AccessibleNodeList? value) native;
-
-  String? get placeholder native;
-
-  set placeholder(String? value) native;
-
-  int? get posInSet native;
-
-  set posInSet(int? value) native;
-
-  String? get pressed native;
-
-  set pressed(String? value) native;
-
-  bool? get readOnly native;
-
-  set readOnly(bool? value) native;
-
-  String? get relevant native;
-
-  set relevant(String? value) native;
-
-  bool? get required native;
-
-  set required(bool? value) native;
-
-  String? get role native;
-
-  set role(String? value) native;
-
-  String? get roleDescription native;
-
-  set roleDescription(String? value) native;
-
-  int? get rowCount native;
-
-  set rowCount(int? value) native;
-
-  int? get rowIndex native;
-
-  set rowIndex(int? value) native;
-
-  int? get rowSpan native;
-
-  set rowSpan(int? value) native;
-
-  bool? get selected native;
-
-  set selected(bool? value) native;
-
-  int? get setSize native;
-
-  set setSize(int? value) native;
-
-  String? get sort native;
-
-  set sort(String? value) native;
-
-  num? get valueMax native;
-
-  set valueMax(num? value) native;
-
-  num? get valueMin native;
-
-  set valueMin(num? value) native;
-
-  num? get valueNow native;
-
-  set valueNow(num? value) native;
-
-  String? get valueText native;
-
-  set valueText(String? value) native;
-
-  void appendChild(AccessibleNode child) native;
-
-  Stream<Event> get onAccessibleClick => accessibleClickEvent.forTarget(this);
-
-  Stream<Event> get onAccessibleContextMenu =>
-      accessibleContextMenuEvent.forTarget(this);
-
-  Stream<Event> get onAccessibleDecrement =>
-      accessibleDecrementEvent.forTarget(this);
-
-  Stream<Event> get onAccessibleFocus => accessibleFocusEvent.forTarget(this);
-
-  Stream<Event> get onAccessibleIncrement =>
-      accessibleIncrementEvent.forTarget(this);
-
-  Stream<Event> get onAccessibleScrollIntoView =>
-      accessibleScrollIntoViewEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("AccessibleNodeList")
-class AccessibleNodeList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AccessibleNodeList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AccessibleNodeList([List<AccessibleNode>? nodes]) {
-    if (nodes != null) {
-      return AccessibleNodeList._create_1(nodes);
-    }
-    return AccessibleNodeList._create_2();
-  }
-  static AccessibleNodeList _create_1(nodes) =>
-      JS('AccessibleNodeList', 'new AccessibleNodeList(#)', nodes);
-  static AccessibleNodeList _create_2() =>
-      JS('AccessibleNodeList', 'new AccessibleNodeList()');
-
-  int get length native;
-
-  set length(int value) native;
-
-  void __setter__(int index, AccessibleNode node) native;
-
-  void add(AccessibleNode node, AccessibleNode? before) native;
-
-  AccessibleNode? item(int index) native;
-
-  void remove(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AmbientLightSensor")
-class AmbientLightSensor extends Sensor {
-  // To suppress missing implicit constructor warnings.
-  factory AmbientLightSensor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AmbientLightSensor([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return AmbientLightSensor._create_1(sensorOptions_1);
-    }
-    return AmbientLightSensor._create_2();
-  }
-  static AmbientLightSensor _create_1(sensorOptions) =>
-      JS('AmbientLightSensor', 'new AmbientLightSensor(#)', sensorOptions);
-  static AmbientLightSensor _create_2() =>
-      JS('AmbientLightSensor', 'new AmbientLightSensor()');
-
-  num? get illuminance native;
-}
-// Copyright (c) 2015, 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.
-
-@Native("HTMLAnchorElement")
-class AnchorElement extends HtmlElement implements HtmlHyperlinkElementUtils {
-  // To suppress missing implicit constructor warnings.
-  factory AnchorElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnchorElement({String? href}) {
-    AnchorElement e = JS<AnchorElement>(
-        'returns:AnchorElement;creates:AnchorElement;new:true',
-        '#.createElement(#)',
-        document,
-        "a");
-    if (href != null) e.href = href;
-    return e;
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AnchorElement.created() : super.created();
-
-  String get download native;
-
-  set download(String value) native;
-
-  String get hreflang native;
-
-  set hreflang(String value) native;
-
-  String get referrerPolicy native;
-
-  set referrerPolicy(String value) native;
-
-  String get rel native;
-
-  set rel(String value) native;
-
-  String get target native;
-
-  set target(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  // From HTMLHyperlinkElementUtils
-
-  String get hash native;
-
-  set hash(String value) native;
-
-  String get host native;
-
-  set host(String value) native;
-
-  String get hostname native;
-
-  set hostname(String value) native;
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get origin native;
-
-  String get password native;
-
-  set password(String value) native;
-
-  String get pathname native;
-
-  set pathname(String value) native;
-
-  String get port native;
-
-  set port(String value) native;
-
-  String get protocol native;
-
-  set protocol(String value) native;
-
-  String get search native;
-
-  set search(String value) native;
-
-  String get username native;
-
-  set username(String value) native;
-
-  String toString() => JS('String', 'String(#)', this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("Animation")
-class Animation extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory Animation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> cancelEvent =
-      const EventStreamProvider<Event>('cancel');
-
-  static const EventStreamProvider<Event> finishEvent =
-      const EventStreamProvider<Event>('finish');
-
-  factory Animation(
-      [AnimationEffectReadOnly? effect, AnimationTimeline? timeline]) {
-    if (timeline != null) {
-      return Animation._create_1(effect, timeline);
-    }
-    if (effect != null) {
-      return Animation._create_2(effect);
-    }
-    return Animation._create_3();
-  }
-  static Animation _create_1(effect, timeline) =>
-      JS('Animation', 'new Animation(#,#)', effect, timeline);
-  static Animation _create_2(effect) =>
-      JS('Animation', 'new Animation(#)', effect);
-  static Animation _create_3() => JS('Animation', 'new Animation()');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(document.body.animate)');
-
-  num? get currentTime native;
-
-  set currentTime(num? value) native;
-
-  AnimationEffectReadOnly? get effect native;
-
-  set effect(AnimationEffectReadOnly? value) native;
-
-  Future<Animation> get finished =>
-      promiseToFuture<Animation>(JS("", "#.finished", this));
-
-  String get id native;
-
-  set id(String value) native;
-
-  String get playState native;
-
-  num get playbackRate native;
-
-  set playbackRate(num value) native;
-
-  Future<Animation> get ready =>
-      promiseToFuture<Animation>(JS("", "#.ready", this));
-
-  num? get startTime native;
-
-  set startTime(num? value) native;
-
-  AnimationTimeline? get timeline native;
-
-  void cancel() native;
-
-  void finish() native;
-
-  void pause() native;
-
-  void play() native;
-
-  void reverse() native;
-
-  Stream<Event> get onCancel => cancelEvent.forTarget(this);
-
-  Stream<Event> get onFinish => finishEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationEffectReadOnly")
-class AnimationEffectReadOnly extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationEffectReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  AnimationEffectTimingReadOnly get timing native;
-
-  Map getComputedTiming() {
-    return convertNativeToDart_Dictionary(_getComputedTiming_1())!;
-  }
-
-  @JSName('getComputedTiming')
-  _getComputedTiming_1() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationEffectTiming")
-class AnimationEffectTiming extends AnimationEffectTimingReadOnly {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationEffectTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // Shadowing definition.
-
-  num get delay native;
-
-  set delay(num value) native;
-
-  // Shadowing definition.
-
-  String get direction native;
-
-  set direction(String value) native;
-
-  // Shadowing definition.
-
-  @Returns('num|String|Null')
-  Object? get duration native;
-
-  set duration(Object? value) native;
-
-  // Shadowing definition.
-
-  String get easing native;
-
-  set easing(String value) native;
-
-  // Shadowing definition.
-
-  num get endDelay native;
-
-  set endDelay(num value) native;
-
-  // Shadowing definition.
-
-  String get fill native;
-
-  set fill(String value) native;
-
-  // Shadowing definition.
-
-  num get iterationStart native;
-
-  set iterationStart(num value) native;
-
-  // Shadowing definition.
-
-  num get iterations native;
-
-  set iterations(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationEffectTimingReadOnly")
-class AnimationEffectTimingReadOnly extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationEffectTimingReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get delay native;
-
-  String get direction native;
-
-  Object? get duration native;
-
-  String get easing native;
-
-  num get endDelay native;
-
-  String get fill native;
-
-  num get iterationStart native;
-
-  num get iterations native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationEvent")
-class AnimationEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnimationEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return AnimationEvent._create_1(type, eventInitDict_1);
-    }
-    return AnimationEvent._create_2(type);
-  }
-  static AnimationEvent _create_1(type, eventInitDict) =>
-      JS('AnimationEvent', 'new AnimationEvent(#,#)', type, eventInitDict);
-  static AnimationEvent _create_2(type) =>
-      JS('AnimationEvent', 'new AnimationEvent(#)', type);
-
-  String get animationName native;
-
-  num get elapsedTime native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationPlaybackEvent")
-class AnimationPlaybackEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationPlaybackEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnimationPlaybackEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return AnimationPlaybackEvent._create_1(type, eventInitDict_1);
-    }
-    return AnimationPlaybackEvent._create_2(type);
-  }
-  static AnimationPlaybackEvent _create_1(type, eventInitDict) => JS(
-      'AnimationPlaybackEvent',
-      'new AnimationPlaybackEvent(#,#)',
-      type,
-      eventInitDict);
-  static AnimationPlaybackEvent _create_2(type) =>
-      JS('AnimationPlaybackEvent', 'new AnimationPlaybackEvent(#)', type);
-
-  num? get currentTime native;
-
-  num? get timelineTime native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationTimeline")
-class AnimationTimeline extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationTimeline._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num? get currentTime native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AnimationWorkletGlobalScope")
-class AnimationWorkletGlobalScope extends WorkletGlobalScope {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationWorkletGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void registerAnimator(String name, Object animatorConstructor) native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * ApplicationCache is accessed via [Window.applicationCache].
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.OPERA)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("ApplicationCache,DOMApplicationCache,OfflineResourceList")
-class ApplicationCache extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory ApplicationCache._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `cached` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> cachedEvent =
-      const EventStreamProvider<Event>('cached');
-
-  /**
-   * Static factory designed to expose `checking` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> checkingEvent =
-      const EventStreamProvider<Event>('checking');
-
-  /**
-   * Static factory designed to expose `downloading` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> downloadingEvent =
-      const EventStreamProvider<Event>('downloading');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `noupdate` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> noUpdateEvent =
-      const EventStreamProvider<Event>('noupdate');
-
-  /**
-   * Static factory designed to expose `obsolete` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> obsoleteEvent =
-      const EventStreamProvider<Event>('obsolete');
-
-  /**
-   * Static factory designed to expose `progress` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> progressEvent =
-      const EventStreamProvider<ProgressEvent>('progress');
-
-  /**
-   * Static factory designed to expose `updateready` events to event
-   * handlers that are not necessarily instances of [ApplicationCache].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> updateReadyEvent =
-      const EventStreamProvider<Event>('updateready');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.applicationCache)');
-
-  static const int CHECKING = 2;
-
-  static const int DOWNLOADING = 3;
-
-  static const int IDLE = 1;
-
-  static const int OBSOLETE = 5;
-
-  static const int UNCACHED = 0;
-
-  static const int UPDATEREADY = 4;
-
-  int get status native;
-
-  void abort() native;
-
-  void swapCache() native;
-
-  void update() native;
-
-  /// Stream of `cached` events handled by this [ApplicationCache].
-  Stream<Event> get onCached => cachedEvent.forTarget(this);
-
-  /// Stream of `checking` events handled by this [ApplicationCache].
-  Stream<Event> get onChecking => checkingEvent.forTarget(this);
-
-  /// Stream of `downloading` events handled by this [ApplicationCache].
-  Stream<Event> get onDownloading => downloadingEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [ApplicationCache].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `noupdate` events handled by this [ApplicationCache].
-  Stream<Event> get onNoUpdate => noUpdateEvent.forTarget(this);
-
-  /// Stream of `obsolete` events handled by this [ApplicationCache].
-  Stream<Event> get onObsolete => obsoleteEvent.forTarget(this);
-
-  /// Stream of `progress` events handled by this [ApplicationCache].
-  Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
-
-  /// Stream of `updateready` events handled by this [ApplicationCache].
-  Stream<Event> get onUpdateReady => updateReadyEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("ApplicationCacheErrorEvent")
-class ApplicationCacheErrorEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory ApplicationCacheErrorEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ApplicationCacheErrorEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return ApplicationCacheErrorEvent._create_1(type, eventInitDict_1);
-    }
-    return ApplicationCacheErrorEvent._create_2(type);
-  }
-  static ApplicationCacheErrorEvent _create_1(type, eventInitDict) => JS(
-      'ApplicationCacheErrorEvent',
-      'new ApplicationCacheErrorEvent(#,#)',
-      type,
-      eventInitDict);
-  static ApplicationCacheErrorEvent _create_2(type) => JS(
-      'ApplicationCacheErrorEvent', 'new ApplicationCacheErrorEvent(#)', type);
-
-  String get message native;
-
-  String get reason native;
-
-  int get status native;
-
-  String get url native;
-}
-// Copyright (c) 2015, 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.
-
-/**
- * DOM Area Element, which links regions of an image map with a hyperlink.
- *
- * The element can also define an uninteractive region of the map.
- *
- * See also:
- *
- * * [`<area>`](https://developer.mozilla.org/en-US/docs/HTML/Element/area)
- * on MDN.
- */
-@Native("HTMLAreaElement")
-class AreaElement extends HtmlElement implements HtmlHyperlinkElementUtils {
-  // To suppress missing implicit constructor warnings.
-  factory AreaElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AreaElement() => JS<AreaElement>(
-      'returns:AreaElement;creates:AreaElement;new:true',
-      '#.createElement(#)',
-      document,
-      "area");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AreaElement.created() : super.created();
-
-  String get alt native;
-
-  set alt(String value) native;
-
-  String get coords native;
-
-  set coords(String value) native;
-
-  String get download native;
-
-  set download(String value) native;
-
-  String get referrerPolicy native;
-
-  set referrerPolicy(String value) native;
-
-  String get rel native;
-
-  set rel(String value) native;
-
-  String get shape native;
-
-  set shape(String value) native;
-
-  String get target native;
-
-  set target(String value) native;
-
-  // From HTMLHyperlinkElementUtils
-
-  String get hash native;
-
-  set hash(String value) native;
-
-  String get host native;
-
-  set host(String value) native;
-
-  String get hostname native;
-
-  set hostname(String value) native;
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get origin native;
-
-  String get password native;
-
-  set password(String value) native;
-
-  String get pathname native;
-
-  set pathname(String value) native;
-
-  String get port native;
-
-  set port(String value) native;
-
-  String get protocol native;
-
-  set protocol(String value) native;
-
-  String get search native;
-
-  set search(String value) native;
-
-  String get username native;
-
-  set username(String value) native;
-
-  String toString() => JS('String', 'String(#)', this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLAudioElement")
-class AudioElement extends MediaElement {
-  factory AudioElement._([String? src]) {
-    if (src != null) {
-      return AudioElement._create_1(src);
-    }
-    return AudioElement._create_2();
-  }
-  static AudioElement _create_1(src) => JS('AudioElement', 'new Audio(#)', src);
-  static AudioElement _create_2() => JS('AudioElement', 'new Audio()');
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AudioElement.created() : super.created();
-
-  factory AudioElement([String? src]) => new AudioElement._(src);
-}
-// Copyright (c) 2012, 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.
-
-@Native("AuthenticatorAssertionResponse")
-class AuthenticatorAssertionResponse extends AuthenticatorResponse {
-  // To suppress missing implicit constructor warnings.
-  factory AuthenticatorAssertionResponse._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ByteBuffer get authenticatorData native;
-
-  ByteBuffer get signature native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AuthenticatorAttestationResponse")
-class AuthenticatorAttestationResponse extends AuthenticatorResponse {
-  // To suppress missing implicit constructor warnings.
-  factory AuthenticatorAttestationResponse._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ByteBuffer get attestationObject native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AuthenticatorResponse")
-class AuthenticatorResponse extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AuthenticatorResponse._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('clientDataJSON')
-  ByteBuffer get clientDataJson native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLBRElement")
-class BRElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory BRElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BRElement() => JS<BRElement>(
-      'returns:BRElement;creates:BRElement;new:true',
-      '#.createElement(#)',
-      document,
-      "br");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  BRElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchClickEvent")
-class BackgroundFetchClickEvent extends BackgroundFetchEvent {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchClickEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BackgroundFetchClickEvent(String type, Map init) {
-    var init_1 = convertDartToNative_Dictionary(init);
-    return BackgroundFetchClickEvent._create_1(type, init_1);
-  }
-  static BackgroundFetchClickEvent _create_1(type, init) => JS(
-      'BackgroundFetchClickEvent',
-      'new BackgroundFetchClickEvent(#,#)',
-      type,
-      init);
-
-  String get state native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchEvent")
-class BackgroundFetchEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BackgroundFetchEvent(String type, Map init) {
-    var init_1 = convertDartToNative_Dictionary(init);
-    return BackgroundFetchEvent._create_1(type, init_1);
-  }
-  static BackgroundFetchEvent _create_1(type, init) =>
-      JS('BackgroundFetchEvent', 'new BackgroundFetchEvent(#,#)', type, init);
-
-  String get id native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchFailEvent")
-class BackgroundFetchFailEvent extends BackgroundFetchEvent {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchFailEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BackgroundFetchFailEvent(String type, Map init) {
-    var init_1 = convertDartToNative_Dictionary(init);
-    return BackgroundFetchFailEvent._create_1(type, init_1);
-  }
-  static BackgroundFetchFailEvent _create_1(type, init) => JS(
-      'BackgroundFetchFailEvent',
-      'new BackgroundFetchFailEvent(#,#)',
-      type,
-      init);
-
-  List<BackgroundFetchSettledFetch> get fetches native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchFetch")
-class BackgroundFetchFetch extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchFetch._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  _Request get request native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchManager")
-class BackgroundFetchManager extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<BackgroundFetchRegistration> fetch(String id, Object requests,
-      [Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<BackgroundFetchRegistration>(
-        JS("", "#.fetch(#, #, #)", this, id, requests, options_dict));
-  }
-
-  Future<BackgroundFetchRegistration> get(String id) =>
-      promiseToFuture<BackgroundFetchRegistration>(
-          JS("", "#.get(#)", this, id));
-
-  Future<List<dynamic>> getIds() =>
-      promiseToFuture<List<dynamic>>(JS("", "#.getIds()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchRegistration")
-class BackgroundFetchRegistration extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchRegistration._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get downloadTotal native;
-
-  int get downloaded native;
-
-  String get id native;
-
-  String get title native;
-
-  int get totalDownloadSize native;
-
-  int get uploadTotal native;
-
-  int get uploaded native;
-
-  Future<bool> abort() => promiseToFuture<bool>(JS("", "#.abort()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchSettledFetch")
-class BackgroundFetchSettledFetch extends BackgroundFetchFetch {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchSettledFetch._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BackgroundFetchSettledFetch(_Request request, _Response response) {
-    return BackgroundFetchSettledFetch._create_1(request, response);
-  }
-  static BackgroundFetchSettledFetch _create_1(request, response) => JS(
-      'BackgroundFetchSettledFetch',
-      'new BackgroundFetchSettledFetch(#,#)',
-      request,
-      response);
-
-  _Response? get response native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BackgroundFetchedEvent")
-class BackgroundFetchedEvent extends BackgroundFetchEvent {
-  // To suppress missing implicit constructor warnings.
-  factory BackgroundFetchedEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BackgroundFetchedEvent(String type, Map init) {
-    var init_1 = convertDartToNative_Dictionary(init);
-    return BackgroundFetchedEvent._create_1(type, init_1);
-  }
-  static BackgroundFetchedEvent _create_1(type, init) => JS(
-      'BackgroundFetchedEvent', 'new BackgroundFetchedEvent(#,#)', type, init);
-
-  List<BackgroundFetchSettledFetch> get fetches native;
-
-  Future updateUI(String title) =>
-      promiseToFuture(JS("", "#.updateUI(#)", this, title));
-}
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#barprop
-@deprecated // standard
-@Native("BarProp")
-class BarProp extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory BarProp._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get visible native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BarcodeDetector")
-class BarcodeDetector extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory BarcodeDetector._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BarcodeDetector() {
-    return BarcodeDetector._create_1();
-  }
-  static BarcodeDetector _create_1() =>
-      JS('BarcodeDetector', 'new BarcodeDetector()');
-
-  Future<List<dynamic>> detect(/*ImageBitmapSource*/ image) =>
-      promiseToFuture<List<dynamic>>(JS("", "#.detect(#)", this, image));
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLBaseElement")
-class BaseElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory BaseElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BaseElement() => JS<BaseElement>(
-      'returns:BaseElement;creates:BaseElement;new:true',
-      '#.createElement(#)',
-      document,
-      "base");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  BaseElement.created() : super.created();
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get target native;
-
-  set target(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BatteryManager")
-class BatteryManager extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory BatteryManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get charging native;
-
-  num get chargingTime native;
-
-  num get dischargingTime native;
-
-  num get level native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BeforeInstallPromptEvent")
-class BeforeInstallPromptEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory BeforeInstallPromptEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BeforeInstallPromptEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return BeforeInstallPromptEvent._create_1(type, eventInitDict_1);
-    }
-    return BeforeInstallPromptEvent._create_2(type);
-  }
-  static BeforeInstallPromptEvent _create_1(type, eventInitDict) => JS(
-      'BeforeInstallPromptEvent',
-      'new BeforeInstallPromptEvent(#,#)',
-      type,
-      eventInitDict);
-  static BeforeInstallPromptEvent _create_2(type) =>
-      JS('BeforeInstallPromptEvent', 'new BeforeInstallPromptEvent(#)', type);
-
-  List<String> get platforms native;
-
-  Future<Map<String, dynamic>?> get userChoice =>
-      promiseToFutureAsMap(JS("", "#.userChoice", this));
-
-  Future prompt() => promiseToFuture(JS("", "#.prompt()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("BeforeUnloadEvent")
-class BeforeUnloadEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory BeforeUnloadEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // Shadowing definition.
-
-  String get returnValue native;
-
-  set returnValue(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Blob")
-class Blob extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Blob._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get size native;
-
-  String get type native;
-
-  Blob slice([int? start, int? end, String? contentType]) native;
-
-  factory Blob(List blobParts, [String? type, String? endings]) {
-    // TODO: validate that blobParts is a JS Array and convert if not.
-    // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
-    // array to ArrayBuffer if it is a total view.
-    if (type == null && endings == null) {
-      return _create_1(blobParts);
-    }
-    var bag = _create_bag();
-    if (type != null) _bag_set(bag, 'type', type);
-    if (endings != null) _bag_set(bag, 'endings', endings);
-    return _create_2(blobParts, bag);
-  }
-
-  static _create_1(parts) => JS('Blob', 'new self.Blob(#)', parts);
-  static _create_2(parts, bag) => JS('Blob', 'new self.Blob(#, #)', parts, bag);
-
-  static _create_bag() => JS('var', '{}');
-  static _bag_set(bag, key, value) {
-    JS('void', '#[#] = #', bag, key, value);
-  }
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void BlobCallback(Blob? blob);
-// Copyright (c) 2012, 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.
-
-@Native("BlobEvent")
-class BlobEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory BlobEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BlobEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return BlobEvent._create_1(type, eventInitDict_1);
-  }
-  static BlobEvent _create_1(type, eventInitDict) =>
-      JS('BlobEvent', 'new BlobEvent(#,#)', type, eventInitDict);
-
-  Blob get data native;
-
-  num get timecode native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothRemoteGATTDescriptor")
-class BluetoothRemoteGattDescriptor extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory BluetoothRemoteGattDescriptor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  _BluetoothRemoteGATTCharacteristic get characteristic native;
-
-  String get uuid native;
-
-  ByteData? get value native;
-
-  Future readValue() => promiseToFuture(JS("", "#.readValue()", this));
-
-  Future writeValue(/*BufferSource*/ value) =>
-      promiseToFuture(JS("", "#.writeValue(#)", this, value));
-}
-// Copyright (c) 2012, 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.
-
-@Native("Body")
-class Body extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Body._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get bodyUsed native;
-
-  Future arrayBuffer() => promiseToFuture(JS("", "#.arrayBuffer()", this));
-
-  Future<Blob> blob() => promiseToFuture<Blob>(JS("", "#.blob()", this));
-
-  Future<FormData> formData() =>
-      promiseToFuture<FormData>(JS("", "#.formData()", this));
-
-  Future json() => promiseToFuture(JS("", "#.json()", this));
-
-  Future<String> text() => promiseToFuture<String>(JS("", "#.text()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLBodyElement")
-class BodyElement extends HtmlElement implements WindowEventHandlers {
-  // To suppress missing implicit constructor warnings.
-  factory BodyElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `blur` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> blurEvent =
-      const EventStreamProvider<Event>('blur');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `focus` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> focusEvent =
-      const EventStreamProvider<Event>('focus');
-
-  /**
-   * Static factory designed to expose `hashchange` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> hashChangeEvent =
-      const EventStreamProvider<Event>('hashchange');
-
-  /**
-   * Static factory designed to expose `load` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> loadEvent =
-      const EventStreamProvider<Event>('load');
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  /**
-   * Static factory designed to expose `offline` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> offlineEvent =
-      const EventStreamProvider<Event>('offline');
-
-  /**
-   * Static factory designed to expose `online` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> onlineEvent =
-      const EventStreamProvider<Event>('online');
-
-  /**
-   * Static factory designed to expose `popstate` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<PopStateEvent> popStateEvent =
-      const EventStreamProvider<PopStateEvent>('popstate');
-
-  /**
-   * Static factory designed to expose `resize` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> resizeEvent =
-      const EventStreamProvider<Event>('resize');
-
-  static const EventStreamProvider<Event> scrollEvent =
-      const EventStreamProvider<Event>('scroll');
-
-  /**
-   * Static factory designed to expose `storage` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<StorageEvent> storageEvent =
-      const EventStreamProvider<StorageEvent>('storage');
-
-  /**
-   * Static factory designed to expose `unload` events to event
-   * handlers that are not necessarily instances of [BodyElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> unloadEvent =
-      const EventStreamProvider<Event>('unload');
-
-  factory BodyElement() => JS<BodyElement>(
-      'returns:BodyElement;creates:BodyElement;new:true',
-      '#.createElement(#)',
-      document,
-      "body");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  BodyElement.created() : super.created();
-
-  /// Stream of `blur` events handled by this [BodyElement].
-  ElementStream<Event> get onBlur => blurEvent.forElement(this);
-
-  /// Stream of `error` events handled by this [BodyElement].
-  ElementStream<Event> get onError => errorEvent.forElement(this);
-
-  /// Stream of `focus` events handled by this [BodyElement].
-  ElementStream<Event> get onFocus => focusEvent.forElement(this);
-
-  /// Stream of `hashchange` events handled by this [BodyElement].
-  ElementStream<Event> get onHashChange => hashChangeEvent.forElement(this);
-
-  /// Stream of `load` events handled by this [BodyElement].
-  ElementStream<Event> get onLoad => loadEvent.forElement(this);
-
-  /// Stream of `message` events handled by this [BodyElement].
-  ElementStream<MessageEvent> get onMessage => messageEvent.forElement(this);
-
-  /// Stream of `offline` events handled by this [BodyElement].
-  ElementStream<Event> get onOffline => offlineEvent.forElement(this);
-
-  /// Stream of `online` events handled by this [BodyElement].
-  ElementStream<Event> get onOnline => onlineEvent.forElement(this);
-
-  /// Stream of `popstate` events handled by this [BodyElement].
-  ElementStream<PopStateEvent> get onPopState => popStateEvent.forElement(this);
-
-  /// Stream of `resize` events handled by this [BodyElement].
-  ElementStream<Event> get onResize => resizeEvent.forElement(this);
-
-  ElementStream<Event> get onScroll => scrollEvent.forElement(this);
-
-  /// Stream of `storage` events handled by this [BodyElement].
-  ElementStream<StorageEvent> get onStorage => storageEvent.forElement(this);
-
-  /// Stream of `unload` events handled by this [BodyElement].
-  ElementStream<Event> get onUnload => unloadEvent.forElement(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("BroadcastChannel")
-class BroadcastChannel extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory BroadcastChannel._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  factory BroadcastChannel(String name) {
-    return BroadcastChannel._create_1(name);
-  }
-  static BroadcastChannel _create_1(name) =>
-      JS('BroadcastChannel', 'new BroadcastChannel(#)', name);
-
-  String get name native;
-
-  void close() native;
-
-  void postMessage(Object message) native;
-
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("BudgetState")
-class BudgetState extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory BudgetState._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get budgetAt native;
-
-  int get time native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLButtonElement")
-class ButtonElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ButtonElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ButtonElement() => JS<ButtonElement>(
-      'returns:ButtonElement;creates:ButtonElement;new:true',
-      '#.createElement(#)',
-      document,
-      "button");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ButtonElement.created() : super.created();
-
-  bool get autofocus native;
-
-  set autofocus(bool value) native;
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  FormElement? get form native;
-
-  String get formAction native;
-
-  set formAction(String value) native;
-
-  String get formEnctype native;
-
-  set formEnctype(String value) native;
-
-  String get formMethod native;
-
-  set formMethod(String value) native;
-
-  bool get formNoValidate native;
-
-  set formNoValidate(bool value) native;
-
-  String get formTarget native;
-
-  set formTarget(String value) native;
-
-  @Unstable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  String get value native;
-
-  set value(String value) native;
-
-  bool get willValidate native;
-
-  bool checkValidity() native;
-
-  bool reportValidity() native;
-
-  void setCustomValidity(String error) native;
-}
-// Copyright (c) 2012, 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.
-
-// http://dom.spec.whatwg.org/#cdatasection
-@deprecated // deprecated
-@Native("CDATASection")
-class CDataSection extends Text {
-  // To suppress missing implicit constructor warnings.
-  factory CDataSection._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("CacheStorage")
-class CacheStorage extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CacheStorage._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future delete(String cacheName) =>
-      promiseToFuture(JS("", "#.delete(#)", this, cacheName));
-
-  Future has(String cacheName) =>
-      promiseToFuture(JS("", "#.has(#)", this, cacheName));
-
-  Future keys() => promiseToFuture(JS("", "#.keys()", this));
-
-  Future match(/*RequestInfo*/ request, [Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(
-        JS("", "#.match(#, #)", this, request, options_dict));
-  }
-
-  Future open(String cacheName) =>
-      promiseToFuture(JS("", "#.open(#)", this, cacheName));
-}
-// Copyright (c) 2012, 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.
-
-@Native("CanMakePaymentEvent")
-class CanMakePaymentEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory CanMakePaymentEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CanMakePaymentEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return CanMakePaymentEvent._create_1(type, eventInitDict_1);
-  }
-  static CanMakePaymentEvent _create_1(type, eventInitDict) => JS(
-      'CanMakePaymentEvent',
-      'new CanMakePaymentEvent(#,#)',
-      type,
-      eventInitDict);
-
-  List get methodData native;
-
-  List get modifiers native;
-
-  String get paymentRequestOrigin native;
-
-  String get topLevelOrigin native;
-
-  void respondWith(Future canMakePaymentResponse) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CanvasCaptureMediaStreamTrack")
-class CanvasCaptureMediaStreamTrack extends MediaStreamTrack {
-  // To suppress missing implicit constructor warnings.
-  factory CanvasCaptureMediaStreamTrack._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CanvasElement get canvas native;
-
-  void requestFrame() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLCanvasElement")
-class CanvasElement extends HtmlElement implements CanvasImageSource {
-  // To suppress missing implicit constructor warnings.
-  factory CanvasElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `webglcontextlost` events to event
-   * handlers that are not necessarily instances of [CanvasElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<gl.ContextEvent> webGlContextLostEvent =
-      const EventStreamProvider<gl.ContextEvent>('webglcontextlost');
-
-  /**
-   * Static factory designed to expose `webglcontextrestored` events to event
-   * handlers that are not necessarily instances of [CanvasElement].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<gl.ContextEvent> webGlContextRestoredEvent =
-      const EventStreamProvider<gl.ContextEvent>('webglcontextrestored');
-
-  factory CanvasElement({int? width, int? height}) {
-    CanvasElement e = JS<CanvasElement>(
-        'returns:CanvasElement;creates:CanvasElement;new:true',
-        '#.createElement(#)',
-        document,
-        "canvas");
-    if (width != null) e.width = width;
-    if (height != null) e.height = height;
-    return e;
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  CanvasElement.created() : super.created();
-
-  /// The height of this canvas element in CSS pixels.
-
-  int get height native;
-
-  set height(int value) native;
-
-  /// The width of this canvas element in CSS pixels.
-
-  int get width native;
-
-  set width(int value) native;
-
-  MediaStream captureStream([num? frameRate]) native;
-
-  @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
-  @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
-  Object? getContext(String contextId, [Map? attributes]) {
-    if (attributes != null) {
-      var attributes_1 = convertDartToNative_Dictionary(attributes);
-      return _getContext_1(contextId, attributes_1);
-    }
-    return _getContext_2(contextId);
-  }
-
-  @JSName('getContext')
-  @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
-  @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
-  Object? _getContext_1(contextId, attributes) native;
-  @JSName('getContext')
-  @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
-  @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
-  Object? _getContext_2(contextId) native;
-
-  @JSName('toDataURL')
-  String _toDataUrl(String? type, [arguments_OR_quality]) native;
-
-  OffscreenCanvas transferControlToOffscreen() native;
-
-  /// Stream of `webglcontextlost` events handled by this [CanvasElement].
-  ElementStream<gl.ContextEvent> get onWebGlContextLost =>
-      webGlContextLostEvent.forElement(this);
-
-  /// Stream of `webglcontextrestored` events handled by this [CanvasElement].
-  ElementStream<gl.ContextEvent> get onWebGlContextRestored =>
-      webGlContextRestoredEvent.forElement(this);
-
-  /** An API for drawing on this canvas. */
-  CanvasRenderingContext2D get context2D =>
-      JS('Null|CanvasRenderingContext2D', '#.getContext(#)', this, '2d');
-
-  /**
-   * Returns a new Web GL context for this canvas.
-   *
-   * ## Other resources
-   *
-   * * [WebGL fundamentals](http://www.html5rocks.com/en/tutorials/webgl/webgl_fundamentals/)
-   *   from HTML5Rocks.
-   * * [WebGL homepage](http://get.webgl.org/).
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  gl.RenderingContext getContext3d(
-      {alpha: true,
-      depth: true,
-      stencil: false,
-      antialias: true,
-      premultipliedAlpha: true,
-      preserveDrawingBuffer: false}) {
-    var options = {
-      'alpha': alpha,
-      'depth': depth,
-      'stencil': stencil,
-      'antialias': antialias,
-      'premultipliedAlpha': premultipliedAlpha,
-      'preserveDrawingBuffer': preserveDrawingBuffer,
-    };
-    var context = getContext('webgl', options);
-    if (context == null) {
-      context = getContext('experimental-webgl', options);
-    }
-    return context as gl.RenderingContext;
-  }
-
-  /**
-   * Returns a data URI containing a representation of the image in the
-   * format specified by type (defaults to 'image/png').
-   *
-   * Data Uri format is as follow
-   * `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
-   *
-   * Optional parameter [quality] in the range of 0.0 and 1.0 can be used when
-   * requesting [type] 'image/jpeg' or 'image/webp'. If [quality] is not passed
-   * the default value is used. Note: the default value varies by browser.
-   *
-   * If the height or width of this canvas element is 0, then 'data:' is
-   * returned, representing no data.
-   *
-   * If the type requested is not 'image/png', and the returned value is
-   * 'data:image/png', then the requested type is not supported.
-   *
-   * Example usage:
-   *
-   *     CanvasElement canvas = new CanvasElement();
-   *     var ctx = canvas.context2D
-   *     ..fillStyle = "rgb(200,0,0)"
-   *     ..fillRect(10, 10, 55, 50);
-   *     var dataUrl = canvas.toDataUrl("image/jpeg", 0.95);
-   *     // The Data Uri would look similar to
-   *     // 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
-   *     // AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
-   *     // 9TXL0Y4OHwAAAABJRU5ErkJggg=='
-   *     //Create a new image element from the data URI.
-   *     var img = new ImageElement();
-   *     img.src = dataUrl;
-   *     document.body.children.add(img);
-   *
-   * See also:
-   *
-   * * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wikipedia.
-   *
-   * * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanvasElement) from MDN.
-   *
-   * * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canvas-todataurl) from W3C.
-   */
-  String toDataUrl([String type = 'image/png', num? quality]) =>
-      _toDataUrl(type, quality);
-
-  @JSName('toBlob')
-  void _toBlob(BlobCallback callback, [String? type, Object? arguments]) native;
-
-  Future<Blob> toBlob([String? type, Object? arguments]) {
-    var completer = new Completer<Blob>();
-    _toBlob((value) {
-      completer.complete(value);
-    }, type, arguments);
-    return completer.future;
-  }
-}
-// Copyright (c) 2012, 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.
-
-/**
- * An opaque canvas object representing a gradient.
- *
- * Created by calling [createLinearGradient] or [createRadialGradient] on a
- * [CanvasRenderingContext2D] object.
- *
- * Example usage:
- *
- *     var canvas = new CanvasElement(width: 600, height: 600);
- *     var ctx = canvas.context2D;
- *     ctx.clearRect(0, 0, 600, 600);
- *     ctx.save();
- *     // Create radial gradient.
- *     CanvasGradient gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, 600);
- *     gradient.addColorStop(0, '#000');
- *     gradient.addColorStop(1, 'rgb(255, 255, 255)');
- *     // Assign gradients to fill.
- *     ctx.fillStyle = gradient;
- *     // Draw a rectangle with a gradient fill.
- *     ctx.fillRect(0, 0, 600, 600);
- *     ctx.save();
- *     document.body.children.add(canvas);
- *
- * See also:
- *
- * * [CanvasGradient](https://developer.mozilla.org/en-US/docs/DOM/CanvasGradient) from MDN.
- * * [CanvasGradient](https://html.spec.whatwg.org/multipage/scripting.html#canvasgradient)
- *   from WHATWG.
- * * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgradient) from W3C.
- */
-@Native("CanvasGradient")
-class CanvasGradient extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CanvasGradient._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Adds a color stop to this gradient at the offset.
-   *
-   * The [offset] can range between 0.0 and 1.0.
-   *
-   * See also:
-   *
-   * * [Multiple Color Stops](https://developer.mozilla.org/en-US/docs/CSS/linear-gradient#Gradient_with_multiple_color_stops) from MDN.
-   */
-  void addColorStop(num offset, String color) native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * An opaque object representing a pattern of image, canvas, or video.
- *
- * Created by calling [createPattern] on a [CanvasRenderingContext2D] object.
- *
- * Example usage:
- *
- *     var canvas = new CanvasElement(width: 600, height: 600);
- *     var ctx = canvas.context2D;
- *     var img = new ImageElement();
- *     // Image src needs to be loaded before pattern is applied.
- *     img.onLoad.listen((event) {
- *       // When the image is loaded, create a pattern
- *       // from the ImageElement.
- *       CanvasPattern pattern = ctx.createPattern(img, 'repeat');
- *       ctx.rect(0, 0, canvas.width, canvas.height);
- *       ctx.fillStyle = pattern;
- *       ctx.fill();
- *     });
- *     img.src = "images/foo.jpg";
- *     document.body.children.add(canvas);
- *
- * See also:
- * * [CanvasPattern](https://developer.mozilla.org/en-US/docs/DOM/CanvasPattern) from MDN.
- * * [CanvasPattern](https://html.spec.whatwg.org/multipage/scripting.html#canvaspattern)
- *   from WHATWG.
- * * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspattern) from W3C.
- */
-@Native("CanvasPattern")
-class CanvasPattern extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CanvasPattern._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void setTransform(Matrix transform) native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class CanvasRenderingContext {
-  CanvasElement get canvas;
-}
-
-@Native("CanvasRenderingContext2D")
-class CanvasRenderingContext2D extends Interceptor
-    implements CanvasRenderingContext {
-  // To suppress missing implicit constructor warnings.
-  factory CanvasRenderingContext2D._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CanvasElement get canvas native;
-
-  Matrix get currentTransform native;
-
-  set currentTransform(Matrix value) native;
-
-  String get direction native;
-
-  set direction(String value) native;
-
-  @Creates('String|CanvasGradient|CanvasPattern')
-  @Returns('String|CanvasGradient|CanvasPattern')
-  Object? get fillStyle native;
-
-  set fillStyle(Object? value) native;
-
-  String get filter native;
-
-  set filter(String value) native;
-
-  String get font native;
-
-  set font(String value) native;
-
-  num get globalAlpha native;
-
-  set globalAlpha(num value) native;
-
-  String get globalCompositeOperation native;
-
-  set globalCompositeOperation(String value) native;
-
-  /**
-   * Whether images and patterns on this canvas will be smoothed when this
-   * canvas is scaled.
-   *
-   * ## Other resources
-   *
-   * * [Image
-   *   smoothing](https://html.spec.whatwg.org/multipage/scripting.html#image-smoothing)
-   *   from WHATWG.
-   */
-
-  bool get imageSmoothingEnabled native;
-
-  set imageSmoothingEnabled(bool value) native;
-
-  String get imageSmoothingQuality native;
-
-  set imageSmoothingQuality(String value) native;
-
-  String get lineCap native;
-
-  set lineCap(String value) native;
-
-  String get lineJoin native;
-
-  set lineJoin(String value) native;
-
-  num get lineWidth native;
-
-  set lineWidth(num value) native;
-
-  num get miterLimit native;
-
-  set miterLimit(num value) native;
-
-  num get shadowBlur native;
-
-  set shadowBlur(num value) native;
-
-  String get shadowColor native;
-
-  set shadowColor(String value) native;
-
-  num get shadowOffsetX native;
-
-  set shadowOffsetX(num value) native;
-
-  num get shadowOffsetY native;
-
-  set shadowOffsetY(num value) native;
-
-  @Creates('String|CanvasGradient|CanvasPattern')
-  @Returns('String|CanvasGradient|CanvasPattern')
-  Object? get strokeStyle native;
-
-  set strokeStyle(Object? value) native;
-
-  String get textAlign native;
-
-  set textAlign(String value) native;
-
-  String get textBaseline native;
-
-  set textBaseline(String value) native;
-
-  void addHitRegion([Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      _addHitRegion_1(options_1);
-      return;
-    }
-    _addHitRegion_2();
-    return;
-  }
-
-  @JSName('addHitRegion')
-  void _addHitRegion_1(options) native;
-  @JSName('addHitRegion')
-  void _addHitRegion_2() native;
-
-  void beginPath() native;
-
-  void clearHitRegions() native;
-
-  void clearRect(num x, num y, num width, num height) native;
-
-  void clip([path_OR_winding, String? winding]) native;
-
-  @Creates('ImageData|=Object')
-  ImageData createImageData(data_OR_imagedata_OR_sw,
-      [int? sh_OR_sw,
-      imageDataColorSettings_OR_sh,
-      Map? imageDataColorSettings]) {
-    if ((data_OR_imagedata_OR_sw is ImageData) &&
-        sh_OR_sw == null &&
-        imageDataColorSettings_OR_sh == null &&
-        imageDataColorSettings == null) {
-      var imagedata_1 = convertDartToNative_ImageData(data_OR_imagedata_OR_sw);
-      return convertNativeToDart_ImageData(_createImageData_1(imagedata_1));
-    }
-    if (sh_OR_sw != null &&
-        (data_OR_imagedata_OR_sw is int) &&
-        imageDataColorSettings_OR_sh == null &&
-        imageDataColorSettings == null) {
-      return convertNativeToDart_ImageData(
-          _createImageData_2(data_OR_imagedata_OR_sw, sh_OR_sw));
-    }
-    if ((imageDataColorSettings_OR_sh is Map) &&
-        sh_OR_sw != null &&
-        (data_OR_imagedata_OR_sw is int) &&
-        imageDataColorSettings == null) {
-      var imageDataColorSettings_1 =
-          convertDartToNative_Dictionary(imageDataColorSettings_OR_sh);
-      return convertNativeToDart_ImageData(_createImageData_3(
-          data_OR_imagedata_OR_sw, sh_OR_sw, imageDataColorSettings_1));
-    }
-    if ((imageDataColorSettings_OR_sh is int) &&
-        sh_OR_sw != null &&
-        data_OR_imagedata_OR_sw != null &&
-        imageDataColorSettings == null) {
-      return convertNativeToDart_ImageData(_createImageData_4(
-          data_OR_imagedata_OR_sw, sh_OR_sw, imageDataColorSettings_OR_sh));
-    }
-    if (imageDataColorSettings != null &&
-        (imageDataColorSettings_OR_sh is int) &&
-        sh_OR_sw != null &&
-        data_OR_imagedata_OR_sw != null) {
-      var imageDataColorSettings_1 =
-          convertDartToNative_Dictionary(imageDataColorSettings);
-      return convertNativeToDart_ImageData(_createImageData_5(
-          data_OR_imagedata_OR_sw,
-          sh_OR_sw,
-          imageDataColorSettings_OR_sh,
-          imageDataColorSettings_1));
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('createImageData')
-  @Creates('ImageData|=Object')
-  _createImageData_1(imagedata) native;
-  @JSName('createImageData')
-  @Creates('ImageData|=Object')
-  _createImageData_2(int sw, sh) native;
-  @JSName('createImageData')
-  @Creates('ImageData|=Object')
-  _createImageData_3(int sw, sh, imageDataColorSettings) native;
-  @JSName('createImageData')
-  @Creates('ImageData|=Object')
-  _createImageData_4(data, sw, int? sh) native;
-  @JSName('createImageData')
-  @Creates('ImageData|=Object')
-  _createImageData_5(data, sw, int? sh, imageDataColorSettings) native;
-
-  CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
-
-  CanvasPattern? createPattern(Object image, String repetitionType) native;
-
-  CanvasGradient createRadialGradient(
-      num x0, num y0, num r0, num x1, num y1, num r1) native;
-
-  void drawFocusIfNeeded(element_OR_path, [Element? element]) native;
-
-  void fill([path_OR_winding, String? winding]) native;
-
-  void fillRect(num x, num y, num width, num height) native;
-
-  Map getContextAttributes() {
-    return convertNativeToDart_Dictionary(_getContextAttributes_1())!;
-  }
-
-  @JSName('getContextAttributes')
-  _getContextAttributes_1() native;
-
-  @Creates('ImageData|=Object')
-  ImageData getImageData(int sx, int sy, int sw, int sh) {
-    return convertNativeToDart_ImageData(_getImageData_1(sx, sy, sw, sh));
-  }
-
-  @JSName('getImageData')
-  @Creates('ImageData|=Object')
-  _getImageData_1(sx, sy, sw, sh) native;
-
-  @JSName('getLineDash')
-  List<num> _getLineDash() native;
-
-  bool isContextLost() native;
-
-  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String? winding])
-      native;
-
-  bool isPointInStroke(path_OR_x, num x_OR_y, [num? y]) native;
-
-  TextMetrics measureText(String text) native;
-
-  void putImageData(ImageData imagedata, int dx, int dy,
-      [int? dirtyX, int? dirtyY, int? dirtyWidth, int? dirtyHeight]) {
-    if (dirtyX == null &&
-        dirtyY == null &&
-        dirtyWidth == null &&
-        dirtyHeight == null) {
-      var imagedata_1 = convertDartToNative_ImageData(imagedata);
-      _putImageData_1(imagedata_1, dx, dy);
-      return;
-    }
-    if (dirtyHeight != null &&
-        dirtyWidth != null &&
-        dirtyY != null &&
-        dirtyX != null) {
-      var imagedata_1 = convertDartToNative_ImageData(imagedata);
-      _putImageData_2(
-          imagedata_1, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('putImageData')
-  void _putImageData_1(imagedata, dx, dy) native;
-  @JSName('putImageData')
-  void _putImageData_2(
-      imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) native;
-
-  void removeHitRegion(String id) native;
-
-  void resetTransform() native;
-
-  void restore() native;
-
-  void rotate(num angle) native;
-
-  void save() native;
-
-  void scale(num x, num y) native;
-
-  void scrollPathIntoView([Path2D? path]) native;
-
-  void setTransform(num a, num b, num c, num d, num e, num f) native;
-
-  void stroke([Path2D? path]) native;
-
-  void strokeRect(num x, num y, num width, num height) native;
-
-  void strokeText(String text, num x, num y, [num? maxWidth]) native;
-
-  void transform(num a, num b, num c, num d, num e, num f) native;
-
-  void translate(num x, num y) native;
-
-  // From CanvasPath
-
-  @JSName('arc')
-  void _arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool? anticlockwise) native;
-
-  void arcTo(num x1, num y1, num x2, num y2, num radius) native;
-
-  void bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y)
-      native;
-
-  void closePath() native;
-
-  void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool? anticlockwise) native;
-
-  void lineTo(num x, num y) native;
-
-  void moveTo(num x, num y) native;
-
-  void quadraticCurveTo(num cpx, num cpy, num x, num y) native;
-
-  void rect(num x, num y, num width, num height) native;
-
-  ImageData createImageDataFromImageData(ImageData imagedata) =>
-      JS('ImageData', '#.createImageData(#)', this, imagedata);
-
-  /**
-   * Sets the color used inside shapes.
-   * [r], [g], [b] are 0-255, [a] is 0-1.
-   */
-  void setFillColorRgb(int r, int g, int b, [num a = 1]) {
-    this.fillStyle = 'rgba($r, $g, $b, $a)';
-  }
-
-  /**
-   * Sets the color used inside shapes.
-   * [h] is in degrees, 0-360.
-   * [s], [l] are in percent, 0-100.
-   * [a] is 0-1.
-   */
-  void setFillColorHsl(int h, num s, num l, [num a = 1]) {
-    this.fillStyle = 'hsla($h, $s%, $l%, $a)';
-  }
-
-  /**
-   * Sets the color used for stroking shapes.
-   * [r], [g], [b] are 0-255, [a] is 0-1.
-   */
-  void setStrokeColorRgb(int r, int g, int b, [num a = 1]) {
-    this.strokeStyle = 'rgba($r, $g, $b, $a)';
-  }
-
-  /**
-   * Sets the color used for stroking shapes.
-   * [h] is in degrees, 0-360.
-   * [s], [l] are in percent, 0-100.
-   * [a] is 0-1.
-   */
-  void setStrokeColorHsl(int h, num s, num l, [num a = 1]) {
-    this.strokeStyle = 'hsla($h, $s%, $l%, $a)';
-  }
-
-  void arc(num x, num y, num radius, num startAngle, num endAngle,
-      [bool anticlockwise = false]) {
-    // TODO(terry): This should not be needed: dartbug.com/20939.
-    JS('void', '#.arc(#, #, #, #, #, #)', this, x, y, radius, startAngle,
-        endAngle, anticlockwise);
-  }
-
-  CanvasPattern createPatternFromImage(
-          ImageElement image, String repetitionType) =>
-      JS('CanvasPattern', '#.createPattern(#, #)', this, image, repetitionType);
-
-  /**
-   * Draws an image from a CanvasImageSource to an area of this canvas.
-   *
-   * The image will be drawn to an area of this canvas defined by
-   * [destRect]. [sourceRect] defines the region of the source image that is
-   * drawn.
-   * If [sourceRect] is not provided, then
-   * the entire rectangular image from [source] will be drawn to this context.
-   *
-   * If the image is larger than canvas
-   * will allow, the image will be clipped to fit the available space.
-   *
-   *     CanvasElement canvas = new CanvasElement(width: 600, height: 600);
-   *     CanvasRenderingContext2D ctx = canvas.context2D;
-   *     ImageElement img = document.query('img');
-   *     img.width = 100;
-   *     img.height = 100;
-   *
-   *     // Scale the image to 20x20.
-   *     ctx.drawImageToRect(img, new Rectangle(50, 50, 20, 20));
-   *
-   *     VideoElement video = document.query('video');
-   *     video.width = 100;
-   *     video.height = 100;
-   *     // Take the middle 20x20 pixels from the video and stretch them.
-   *     ctx.drawImageToRect(video, new Rectangle(50, 50, 100, 100),
-   *         sourceRect: new Rectangle(40, 40, 20, 20));
-   *
-   *     // Draw the top 100x20 pixels from the otherCanvas.
-   *     CanvasElement otherCanvas = document.query('canvas');
-   *     ctx.drawImageToRect(otherCanvas, new Rectangle(0, 0, 100, 20),
-   *         sourceRect: new Rectangle(0, 0, 100, 20));
-   *
-   * See also:
-   *
-   *   * [CanvasImageSource] for more information on what data is retrieved
-   * from [source].
-   *   * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
-   * from the WHATWG.
-   */
-  void drawImageToRect(CanvasImageSource source, Rectangle destRect,
-      {Rectangle? sourceRect}) {
-    if (sourceRect == null) {
-      drawImageScaled(
-          source, destRect.left, destRect.top, destRect.width, destRect.height);
-    } else {
-      drawImageScaledFromSource(
-          source,
-          sourceRect.left,
-          sourceRect.top,
-          sourceRect.width,
-          sourceRect.height,
-          destRect.left,
-          destRect.top,
-          destRect.width,
-          destRect.height);
-    }
-  }
-
-  /**
-   * Draws an image from a CanvasImageSource to this canvas.
-   *
-   * The entire image from [source] will be drawn to this context with its top
-   * left corner at the point ([destX], [destY]). If the image is
-   * larger than canvas will allow, the image will be clipped to fit the
-   * available space.
-   *
-   *     CanvasElement canvas = new CanvasElement(width: 600, height: 600);
-   *     CanvasRenderingContext2D ctx = canvas.context2D;
-   *     ImageElement img = document.query('img');
-   *
-   *     ctx.drawImage(img, 100, 100);
-   *
-   *     VideoElement video = document.query('video');
-   *     ctx.drawImage(video, 0, 0);
-   *
-   *     CanvasElement otherCanvas = document.query('canvas');
-   *     otherCanvas.width = 100;
-   *     otherCanvas.height = 100;
-   *     ctx.drawImage(otherCanvas, 590, 590); // will get clipped
-   *
-   * See also:
-   *
-   *   * [CanvasImageSource] for more information on what data is retrieved
-   * from [source].
-   *   * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
-   * from the WHATWG.
-   */
-  @JSName('drawImage')
-  void drawImage(CanvasImageSource source, num destX, num destY) native;
-
-  /**
-   * Draws an image from a CanvasImageSource to an area of this canvas.
-   *
-   * The image will be drawn to this context with its top left corner at the
-   * point ([destX], [destY]) and will be scaled to be [destWidth] wide and
-   * [destHeight] tall.
-   *
-   * If the image is larger than canvas
-   * will allow, the image will be clipped to fit the available space.
-   *
-   *     CanvasElement canvas = new CanvasElement(width: 600, height: 600);
-   *     CanvasRenderingContext2D ctx = canvas.context2D;
-   *     ImageElement img = document.query('img');
-   *     img.width = 100;
-   *     img.height = 100;
-   *
-   *     // Scale the image to 300x50 at the point (20, 20)
-   *     ctx.drawImageScaled(img, 20, 20, 300, 50);
-   *
-   * See also:
-   *
-   *   * [CanvasImageSource] for more information on what data is retrieved
-   * from [source].
-   *   * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
-   * from the WHATWG.
-   */
-  @JSName('drawImage')
-  void drawImageScaled(CanvasImageSource source, num destX, num destY,
-      num destWidth, num destHeight) native;
-
-  /**
-   * Draws an image from a CanvasImageSource to an area of this canvas.
-   *
-   * The image is a region of [source] that is [sourceWidth] wide and
-   * [destHeight] tall with top left corner at ([sourceX], [sourceY]).
-   * The image will be drawn to this context with its top left corner at the
-   * point ([destX], [destY]) and will be scaled to be [destWidth] wide and
-   * [destHeight] tall.
-   *
-   * If the image is larger than canvas
-   * will allow, the image will be clipped to fit the available space.
-   *
-   *     VideoElement video = document.query('video');
-   *     video.width = 100;
-   *     video.height = 100;
-   *     // Take the middle 20x20 pixels from the video and stretch them.
-   *     ctx.drawImageScaledFromSource(video, 40, 40, 20, 20, 50, 50, 100, 100);
-   *
-   *     // Draw the top 100x20 pixels from the otherCanvas to this one.
-   *     CanvasElement otherCanvas = document.query('canvas');
-   *     ctx.drawImageScaledFromSource(otherCanvas, 0, 0, 100, 20, 0, 0, 100, 20);
-   *
-   * See also:
-   *
-   *   * [CanvasImageSource] for more information on what data is retrieved
-   * from [source].
-   *   * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
-   * from the WHATWG.
-   */
-  @JSName('drawImage')
-  void drawImageScaledFromSource(
-      CanvasImageSource source,
-      num sourceX,
-      num sourceY,
-      num sourceWidth,
-      num sourceHeight,
-      num destX,
-      num destY,
-      num destWidth,
-      num destHeight) native;
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @SupportedBrowser(SupportedBrowser.IE, '11')
-  @Unstable()
-  // TODO(14316): Firefox has this functionality with mozDashOffset, but it
-  // needs to be polyfilled.
-  num get lineDashOffset =>
-      JS('num', '#.lineDashOffset || #.webkitLineDashOffset', this, this);
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @SupportedBrowser(SupportedBrowser.IE, '11')
-  @Unstable()
-  // TODO(14316): Firefox has this functionality with mozDashOffset, but it
-  // needs to be polyfilled.
-  set lineDashOffset(num value) {
-    JS(
-        'void',
-        'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
-            '#.webkitLineDashOffset = #',
-        this,
-        this,
-        value,
-        this,
-        value);
-  }
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @SupportedBrowser(SupportedBrowser.IE, '11')
-  @Unstable()
-  List<num> getLineDash() {
-    // TODO(14316): Firefox has this functionality with mozDash, but it's a bit
-    // different.
-    if (JS('bool', '!!#.getLineDash', this)) {
-      return JS('List<num>', '#.getLineDash()', this);
-    } else if (JS('bool', '!!#.webkitLineDash', this)) {
-      return JS('List<num>', '#.webkitLineDash', this);
-    }
-    return [];
-  }
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @SupportedBrowser(SupportedBrowser.IE, '11')
-  @Unstable()
-  void setLineDash(List<num> dash) {
-    // TODO(14316): Firefox has this functionality with mozDash, but it's a bit
-    // different.
-    if (JS('bool', '!!#.setLineDash', this)) {
-      JS('void', '#.setLineDash(#)', this, dash);
-    } else if (JS('bool', '!!#.webkitLineDash', this)) {
-      JS('void', '#.webkitLineDash = #', this, dash);
-    }
-  }
-
-  /**
-   * Draws text to the canvas.
-   *
-   * The text is drawn starting at coordinates ([x], [y]).
-   * If [maxWidth] is provided and the [text] is computed to be wider than
-   * [maxWidth], then the drawn text is scaled down horizontally to fit.
-   *
-   * The text uses the current [CanvasRenderingContext2D.font] property for font
-   * options, such as typeface and size, and the current
-   * [CanvasRenderingContext2D.fillStyle] for style options such as color.
-   * The current [CanvasRenderingContext2D.textAlign] and
-   * [CanvasRenderingContext2D.textBaseLine] properties are also applied to the
-   * drawn text.
-   */
-  void fillText(String text, num x, num y, [num? maxWidth]) {
-    if (maxWidth != null) {
-      JS('void', '#.fillText(#, #, #, #)', this, text, x, y, maxWidth);
-    } else {
-      JS('void', '#.fillText(#, #, #)', this, text, x, y);
-    }
-  }
-
-  /** Deprecated always returns 1.0 */
-  @deprecated
-  double get backingStorePixelRatio => 1.0;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CharacterData")
-class CharacterData extends Node
-    implements NonDocumentTypeChildNode, ChildNode {
-  // To suppress missing implicit constructor warnings.
-  factory CharacterData._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get data native;
-
-  set data(String value) native;
-
-  int get length native;
-
-  void appendData(String data) native;
-
-  void deleteData(int offset, int count) native;
-
-  void insertData(int offset, String data) native;
-
-  void replaceData(int offset, int count, String data) native;
-
-  String substringData(int offset, int count) native;
-
-  // From ChildNode
-
-  void after(Object nodes) native;
-
-  void before(Object nodes) native;
-
-  // From NonDocumentTypeChildNode
-
-  Element? get nextElementSibling native;
-
-  Element? get previousElementSibling native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class ChildNode extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ChildNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void after(Object nodes);
-
-  void before(Object nodes);
-
-  void remove();
-}
-// Copyright (c) 2012, 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.
-
-@Native("Client")
-class Client extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Client._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get frameType native;
-
-  String get id native;
-
-  String get type native;
-
-  String get url native;
-
-  void postMessage(Object message, [List<Object>? transfer]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Clients")
-class Clients extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Clients._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future claim() => promiseToFuture(JS("", "#.claim()", this));
-
-  Future get(String id) => promiseToFuture(JS("", "#.get(#)", this, id));
-
-  Future<List<dynamic>> matchAll([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<List<dynamic>>(
-        JS("", "#.matchAll(#)", this, options_dict));
-  }
-
-  Future<WindowClient> openWindow(String url) =>
-      promiseToFuture<WindowClient>(JS("", "#.openWindow(#)", this, url));
-}
-// Copyright (c) 2012, 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.
-
-@Native("ClipboardEvent")
-class ClipboardEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory ClipboardEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ClipboardEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return ClipboardEvent._create_1(type, eventInitDict_1);
-    }
-    return ClipboardEvent._create_2(type);
-  }
-  static ClipboardEvent _create_1(type, eventInitDict) =>
-      JS('ClipboardEvent', 'new ClipboardEvent(#,#)', type, eventInitDict);
-  static ClipboardEvent _create_2(type) =>
-      JS('ClipboardEvent', 'new ClipboardEvent(#)', type);
-
-  DataTransfer? get clipboardData native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CloseEvent")
-class CloseEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory CloseEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CloseEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return CloseEvent._create_1(type, eventInitDict_1);
-    }
-    return CloseEvent._create_2(type);
-  }
-  static CloseEvent _create_1(type, eventInitDict) =>
-      JS('CloseEvent', 'new CloseEvent(#,#)', type, eventInitDict);
-  static CloseEvent _create_2(type) =>
-      JS('CloseEvent', 'new CloseEvent(#)', type);
-
-  int get code native;
-
-  String get reason native;
-
-  bool get wasClean native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Comment")
-class Comment extends CharacterData {
-  factory Comment([String? data]) {
-    return JS('returns:Comment;depends:none;effects:none;new:true',
-        '#.createComment(#)', document, data == null ? "" : data);
-  }
-  // To suppress missing implicit constructor warnings.
-  factory Comment._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("CompositionEvent")
-class CompositionEvent extends UIEvent {
-  factory CompositionEvent(String type,
-      {bool canBubble: false,
-      bool cancelable: false,
-      Window? view,
-      String? data,
-      String? locale}) {
-    if (view == null) {
-      view = window;
-    }
-    CompositionEvent e =
-        document._createEvent("CompositionEvent") as CompositionEvent;
-
-    if (Device.isFirefox) {
-      // Firefox requires the locale parameter that isn't supported elsewhere.
-      JS('void', '#.initCompositionEvent(#, #, #, #, #, #)', e, type, canBubble,
-          cancelable, view, data, locale);
-    } else {
-      e._initCompositionEvent(type, canBubble, cancelable, view, data);
-    }
-
-    return e;
-  }
-
-  factory CompositionEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return CompositionEvent._create_1(type, eventInitDict_1);
-    }
-    return CompositionEvent._create_2(type);
-  }
-  static CompositionEvent _create_1(type, eventInitDict) =>
-      JS('CompositionEvent', 'new CompositionEvent(#,#)', type, eventInitDict);
-  static CompositionEvent _create_2(type) =>
-      JS('CompositionEvent', 'new CompositionEvent(#)', type);
-
-  String get data native;
-
-  @JSName('initCompositionEvent')
-  void _initCompositionEvent(String? type, bool? bubbles, bool? cancelable,
-      Window? view, String? data) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '26')
-@Native("HTMLContentElement")
-class ContentElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ContentElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ContentElement() =>
-      document.createElement("content") as ContentElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ContentElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('content');
-
-  String get select native;
-
-  set select(String value) native;
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getDistributedNodes() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CookieStore")
-class CookieStore extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CookieStore._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future getAll([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(JS("", "#.getAll(#)", this, options_dict));
-  }
-
-  Future set(String name, String value, [Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(
-        JS("", "#.set(#, #, #)", this, name, value, options_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("Coordinates")
-class Coordinates extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Coordinates._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get accuracy native;
-
-  num? get altitude native;
-
-  num? get altitudeAccuracy native;
-
-  num? get heading native;
-
-  num get latitude native;
-
-  num get longitude native;
-
-  num? get speed native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Credential")
-class Credential extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Credential._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get id native;
-
-  String get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CredentialUserData")
-class CredentialUserData extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CredentialUserData._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('iconURL')
-  String get iconUrl native;
-
-  String get name native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CredentialsContainer")
-class CredentialsContainer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CredentialsContainer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future create([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(JS("", "#.create(#)", this, options_dict));
-  }
-
-  Future get([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(JS("", "#.get(#)", this, options_dict));
-  }
-
-  Future preventSilentAccess() =>
-      promiseToFuture(JS("", "#.preventSilentAccess()", this));
-
-  Future requireUserMediation() =>
-      promiseToFuture(JS("", "#.requireUserMediation()", this));
-
-  Future store(Credential credential) =>
-      promiseToFuture(JS("", "#.store(#)", this, credential));
-}
-// Copyright (c) 2015, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("Crypto")
-class Crypto extends Interceptor {
-  TypedData getRandomValues(TypedData array) {
-    return _getRandomValues(array);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory Crypto._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      JS('bool', '!!(window.crypto && window.crypto.getRandomValues)');
-
-  _SubtleCrypto get subtle native;
-
-  @JSName('getRandomValues')
-  @Creates('TypedData')
-  @Returns('TypedData|Null')
-  TypedData _getRandomValues(TypedData array) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CryptoKey")
-class CryptoKey extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CryptoKey._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @Creates('Null')
-  Object get algorithm native;
-
-  bool get extractable native;
-
-  String get type native;
-
-  Object get usages native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSS")
-class Css extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Css._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static _Worklet get paintWorklet native;
-
-  static CssUnitValue Hz(num value) native;
-
-  static CssUnitValue ch(num value) native;
-
-  static CssUnitValue cm(num value) native;
-
-  static CssUnitValue deg(num value) native;
-
-  static CssUnitValue dpcm(num value) native;
-
-  static CssUnitValue dpi(num value) native;
-
-  static CssUnitValue dppx(num value) native;
-
-  static CssUnitValue em(num value) native;
-
-  static String escape(String ident) native;
-
-  static CssUnitValue ex(num value) native;
-
-  static CssUnitValue fr(num value) native;
-
-  static CssUnitValue grad(num value) native;
-
-  @JSName('in')
-  static CssUnitValue inch(num value) native;
-
-  static CssUnitValue kHz(num value) native;
-
-  static CssUnitValue mm(num value) native;
-
-  static CssUnitValue ms(num value) native;
-
-  static CssUnitValue number(num value) native;
-
-  static CssUnitValue pc(num value) native;
-
-  static CssUnitValue percent(num value) native;
-
-  static CssUnitValue pt(num value) native;
-
-  static CssUnitValue px(num value) native;
-
-  static CssUnitValue rad(num value) native;
-
-  static void registerProperty(Map descriptor) {
-    var descriptor_1 = convertDartToNative_Dictionary(descriptor);
-    _registerProperty_1(descriptor_1);
-    return;
-  }
-
-  @JSName('registerProperty')
-  static void _registerProperty_1(descriptor) native;
-
-  static CssUnitValue rem(num value) native;
-
-  static CssUnitValue s(num value) native;
-
-  static bool supports(String property, String value) native;
-
-  @JSName('supports')
-  static bool supportsCondition(String conditionText) native;
-
-  static CssUnitValue turn(num value) native;
-
-  static CssUnitValue vh(num value) native;
-
-  static CssUnitValue vmax(num value) native;
-
-  static CssUnitValue vmin(num value) native;
-
-  static CssUnitValue vw(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSCharsetRule")
-class CssCharsetRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssCharsetRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get encoding native;
-
-  set encoding(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSConditionRule")
-class CssConditionRule extends CssGroupingRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssConditionRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get conditionText native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSFontFaceRule")
-class CssFontFaceRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssFontFaceRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CssStyleDeclaration get style native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSGroupingRule")
-class CssGroupingRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssGroupingRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @Returns('_CssRuleList')
-  @Creates('_CssRuleList')
-  List<CssRule> get cssRules native;
-
-  void deleteRule(int index) native;
-
-  int insertRule(String rule, int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSImageValue")
-class CssImageValue extends CssResourceValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssImageValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num? get intrinsicHeight native;
-
-  num? get intrinsicRatio native;
-
-  num? get intrinsicWidth native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSImportRule")
-class CssImportRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssImportRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get href native;
-
-  MediaList get media native;
-
-  CssStyleSheet get styleSheet native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule")
-class CssKeyframeRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssKeyframeRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get keyText native;
-
-  set keyText(String value) native;
-
-  CssStyleDeclaration get style native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule")
-class CssKeyframesRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssKeyframesRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @Returns('_CssRuleList')
-  @Creates('_CssRuleList')
-  List<CssRule> get cssRules native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  CssKeyframeRule __getter__(int index) native;
-
-  void appendRule(String rule) native;
-
-  void deleteRule(String select) native;
-
-  CssKeyframeRule? findRule(String select) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSKeywordValue")
-class CssKeywordValue extends CssStyleValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssKeywordValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssKeywordValue(String keyword) {
-    return CssKeywordValue._create_1(keyword);
-  }
-  static CssKeywordValue _create_1(keyword) =>
-      JS('CssKeywordValue', 'new CSSKeywordValue(#)', keyword);
-
-  String get value native;
-
-  set value(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSMatrixComponent")
-class CssMatrixComponent extends CssTransformComponent {
-  // To suppress missing implicit constructor warnings.
-  factory CssMatrixComponent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssMatrixComponent(DomMatrixReadOnly matrix, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return CssMatrixComponent._create_1(matrix, options_1);
-    }
-    return CssMatrixComponent._create_2(matrix);
-  }
-  static CssMatrixComponent _create_1(matrix, options) =>
-      JS('CssMatrixComponent', 'new CSSMatrixComponent(#,#)', matrix, options);
-  static CssMatrixComponent _create_2(matrix) =>
-      JS('CssMatrixComponent', 'new CSSMatrixComponent(#)', matrix);
-
-  DomMatrix get matrix native;
-
-  set matrix(DomMatrix value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSMediaRule")
-class CssMediaRule extends CssConditionRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssMediaRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  MediaList get media native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSNamespaceRule")
-class CssNamespaceRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssNamespaceRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('namespaceURI')
-  String get namespaceUri native;
-
-  String get prefix native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSNumericValue")
-class CssNumericValue extends CssStyleValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssNumericValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CssNumericValue add(CssNumericValue value) native;
-
-  CssNumericValue div(num value) native;
-
-  CssNumericValue mul(num value) native;
-
-  static CssNumericValue parse(String cssText) native;
-
-  CssNumericValue sub(CssNumericValue value) native;
-
-  CssNumericValue to(String unit) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSPageRule")
-class CssPageRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssPageRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get selectorText native;
-
-  set selectorText(String value) native;
-
-  CssStyleDeclaration get style native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSPerspective")
-class CssPerspective extends CssTransformComponent {
-  // To suppress missing implicit constructor warnings.
-  factory CssPerspective._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssPerspective(CssNumericValue length) {
-    return CssPerspective._create_1(length);
-  }
-  static CssPerspective _create_1(length) =>
-      JS('CssPerspective', 'new CSSPerspective(#)', length);
-
-  CssNumericValue get length native;
-
-  set length(CssNumericValue value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSPositionValue")
-class CssPositionValue extends CssStyleValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssPositionValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssPositionValue(CssNumericValue x, CssNumericValue y) {
-    return CssPositionValue._create_1(x, y);
-  }
-  static CssPositionValue _create_1(x, y) =>
-      JS('CssPositionValue', 'new CSSPositionValue(#,#)', x, y);
-
-  CssNumericValue get x native;
-
-  set x(CssNumericValue value) native;
-
-  CssNumericValue get y native;
-
-  set y(CssNumericValue value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSResourceValue")
-class CssResourceValue extends CssStyleValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssResourceValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get state native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSRotation")
-class CssRotation extends CssTransformComponent {
-  // To suppress missing implicit constructor warnings.
-  factory CssRotation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssRotation(angleValue_OR_x,
-      [num? y, num? z, CssNumericValue? angle]) {
-    if ((angleValue_OR_x is CssNumericValue) &&
-        y == null &&
-        z == null &&
-        angle == null) {
-      return CssRotation._create_1(angleValue_OR_x);
-    }
-    if ((angle is CssNumericValue) &&
-        (z is num) &&
-        (y is num) &&
-        (angleValue_OR_x is num)) {
-      return CssRotation._create_2(angleValue_OR_x, y, z, angle);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static CssRotation _create_1(angleValue_OR_x) =>
-      JS('CssRotation', 'new CSSRotation(#)', angleValue_OR_x);
-  static CssRotation _create_2(angleValue_OR_x, y, z, angle) => JS(
-      'CssRotation', 'new CSSRotation(#,#,#,#)', angleValue_OR_x, y, z, angle);
-
-  CssNumericValue get angle native;
-
-  set angle(CssNumericValue value) native;
-
-  num get x native;
-
-  set x(num value) native;
-
-  num get y native;
-
-  set y(num value) native;
-
-  num get z native;
-
-  set z(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSRule")
-class CssRule extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CssRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int CHARSET_RULE = 2;
-
-  static const int FONT_FACE_RULE = 5;
-
-  static const int IMPORT_RULE = 3;
-
-  static const int KEYFRAMES_RULE = 7;
-
-  static const int KEYFRAME_RULE = 8;
-
-  static const int MEDIA_RULE = 4;
-
-  static const int NAMESPACE_RULE = 10;
-
-  static const int PAGE_RULE = 6;
-
-  static const int STYLE_RULE = 1;
-
-  static const int SUPPORTS_RULE = 12;
-
-  static const int VIEWPORT_RULE = 15;
-
-  String get cssText native;
-
-  set cssText(String value) native;
-
-  CssRule? get parentRule native;
-
-  CssStyleSheet? get parentStyleSheet native;
-
-  int get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSScale")
-class CssScale extends CssTransformComponent {
-  // To suppress missing implicit constructor warnings.
-  factory CssScale._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssScale(num x, num y, [num? z]) {
-    if ((y is num) && (x is num) && z == null) {
-      return CssScale._create_1(x, y);
-    }
-    if ((z is num) && (y is num) && (x is num)) {
-      return CssScale._create_2(x, y, z);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static CssScale _create_1(x, y) => JS('CssScale', 'new CSSScale(#,#)', x, y);
-  static CssScale _create_2(x, y, z) =>
-      JS('CssScale', 'new CSSScale(#,#,#)', x, y, z);
-
-  num get x native;
-
-  set x(num value) native;
-
-  num get y native;
-
-  set y(num value) native;
-
-  num get z native;
-
-  set z(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSSkew")
-class CssSkew extends CssTransformComponent {
-  // To suppress missing implicit constructor warnings.
-  factory CssSkew._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssSkew(CssNumericValue ax, CssNumericValue ay) {
-    return CssSkew._create_1(ax, ay);
-  }
-  static CssSkew _create_1(ax, ay) => JS('CssSkew', 'new CSSSkew(#,#)', ax, ay);
-
-  CssNumericValue get ax native;
-
-  set ax(CssNumericValue value) native;
-
-  CssNumericValue get ay native;
-
-  set ay(CssNumericValue value) native;
-}
-
-// Copyright (c) 2014, 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.
-
-// WARNING: DO NOT EDIT THIS TEMPLATE FILE.
-// The template file was generated by scripts/css_code_generator.py
-
-// Source of CSS properties:
-//   CSSPropertyNames.in
-
-@Native("CSSStyleDeclaration,MSStyleCSSProperties,CSS2Properties")
-class CssStyleDeclaration extends Interceptor with CssStyleDeclarationBase {
-  factory CssStyleDeclaration() => new CssStyleDeclaration.css('');
-
-  factory CssStyleDeclaration.css(String css) {
-    final style = new DivElement().style;
-    style.cssText = css;
-    return style;
-  }
-
-  /// Returns the value of the property if the provided *CSS* property
-  /// name is supported on this element and if the value is set. Otherwise
-  /// returns an empty string.
-  ///
-  /// Please note the property name uses camelCase, not-hyphens.
-  String getPropertyValue(String propertyName) {
-    return _getPropertyValueHelper(propertyName);
-  }
-
-  String _getPropertyValueHelper(String propertyName) {
-    return _getPropertyValue(_browserPropertyName(propertyName));
-  }
-
-  /**
-   * Returns true if the provided *CSS* property name is supported on this
-   * element.
-   *
-   * Please note the property name camelCase, not-hyphens. This
-   * method returns true if the property is accessible via an unprefixed _or_
-   * prefixed property.
-   */
-  bool supportsProperty(String propertyName) {
-    return _supportsProperty(propertyName) ||
-        _supportsProperty(_camelCase("${Device.cssPrefix}$propertyName"));
-  }
-
-  bool _supportsProperty(String propertyName) {
-    return JS('bool', '# in #', propertyName, this);
-  }
-
-  void setProperty(String propertyName, String? value, [String? priority]) {
-    return _setPropertyHelper(
-        _browserPropertyName(propertyName), value, priority);
-  }
-
-  String _browserPropertyName(String propertyName) {
-    String? name = _readCache(propertyName);
-    if (name is String) return name;
-    name = _supportedBrowserPropertyName(propertyName);
-    _writeCache(propertyName, name);
-    return name;
-  }
-
-  String _supportedBrowserPropertyName(String propertyName) {
-    if (_supportsProperty(_camelCase(propertyName))) {
-      return propertyName;
-    }
-    var prefixed = "${Device.cssPrefix}$propertyName";
-    if (_supportsProperty(prefixed)) {
-      return prefixed;
-    }
-    // May be a CSS variable, just use it as provided.
-    return propertyName;
-  }
-
-  static final _propertyCache = JS('', '{}');
-  static String? _readCache(String key) =>
-      JS('String|Null', '#[#]', _propertyCache, key);
-  static void _writeCache(String key, String value) {
-    JS('void', '#[#] = #', _propertyCache, key, value);
-  }
-
-  static String _camelCase(String hyphenated) {
-    var replacedMs = JS('String', r'#.replace(/^-ms-/, "ms-")', hyphenated);
-    return JS(
-        'String',
-        r'#.replace(/-([\da-z])/ig,'
-            r'function(_, letter) { return letter.toUpperCase();})',
-        replacedMs);
-  }
-
-  void _setPropertyHelper(String propertyName, String? value,
-      [String? priority]) {
-    if (value == null) value = '';
-    if (priority == null) priority = '';
-    JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
-  }
-
-  /**
-   * Checks to see if CSS Transitions are supported.
-   */
-  static bool get supportsTransitions {
-    return document.body!.style.supportsProperty('transition');
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory CssStyleDeclaration._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get cssFloat native;
-
-  set cssFloat(String? value) native;
-
-  String get cssText native;
-
-  set cssText(String value) native;
-
-  int get length native;
-
-  CssRule? get parentRule native;
-
-  String getPropertyPriority(String property) native;
-
-  @JSName('getPropertyValue')
-  String _getPropertyValue(String property) native;
-
-  String item(int index) native;
-
-  String removeProperty(String property) native;
-
-  /** Gets the value of "background" */
-  String get background => this._background;
-
-  /** Sets the value of "background" */
-  set background(String? value) {
-    _background = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('background')
-  String get _background native;
-
-  @JSName('background')
-  set _background(String value) native;
-
-  /** Gets the value of "background-attachment" */
-  String get backgroundAttachment => this._backgroundAttachment;
-
-  /** Sets the value of "background-attachment" */
-  set backgroundAttachment(String? value) {
-    _backgroundAttachment = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('backgroundAttachment')
-  String get _backgroundAttachment native;
-
-  @JSName('backgroundAttachment')
-  set _backgroundAttachment(String value) native;
-
-  /** Gets the value of "background-color" */
-  String get backgroundColor => this._backgroundColor;
-
-  /** Sets the value of "background-color" */
-  set backgroundColor(String? value) {
-    _backgroundColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('backgroundColor')
-  String get _backgroundColor native;
-
-  @JSName('backgroundColor')
-  set _backgroundColor(String value) native;
-
-  /** Gets the value of "background-image" */
-  String get backgroundImage => this._backgroundImage;
-
-  /** Sets the value of "background-image" */
-  set backgroundImage(String? value) {
-    _backgroundImage = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('backgroundImage')
-  String get _backgroundImage native;
-
-  @JSName('backgroundImage')
-  set _backgroundImage(String value) native;
-
-  /** Gets the value of "background-position" */
-  String get backgroundPosition => this._backgroundPosition;
-
-  /** Sets the value of "background-position" */
-  set backgroundPosition(String? value) {
-    _backgroundPosition = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('backgroundPosition')
-  String get _backgroundPosition native;
-
-  @JSName('backgroundPosition')
-  set _backgroundPosition(String value) native;
-
-  /** Gets the value of "background-repeat" */
-  String get backgroundRepeat => this._backgroundRepeat;
-
-  /** Sets the value of "background-repeat" */
-  set backgroundRepeat(String? value) {
-    _backgroundRepeat = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('backgroundRepeat')
-  String get _backgroundRepeat native;
-
-  @JSName('backgroundRepeat')
-  set _backgroundRepeat(String value) native;
-
-  /** Gets the value of "border" */
-  String get border => this._border;
-
-  /** Sets the value of "border" */
-  set border(String? value) {
-    _border = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('border')
-  String get _border native;
-
-  @JSName('border')
-  set _border(String value) native;
-
-  /** Gets the value of "border-bottom" */
-  String get borderBottom => this._borderBottom;
-
-  /** Sets the value of "border-bottom" */
-  set borderBottom(String? value) {
-    _borderBottom = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderBottom')
-  String get _borderBottom native;
-
-  @JSName('borderBottom')
-  set _borderBottom(String value) native;
-
-  /** Gets the value of "border-bottom-color" */
-  String get borderBottomColor => this._borderBottomColor;
-
-  /** Sets the value of "border-bottom-color" */
-  set borderBottomColor(String? value) {
-    _borderBottomColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderBottomColor')
-  String get _borderBottomColor native;
-
-  @JSName('borderBottomColor')
-  set _borderBottomColor(String value) native;
-
-  /** Gets the value of "border-bottom-style" */
-  String get borderBottomStyle => this._borderBottomStyle;
-
-  /** Sets the value of "border-bottom-style" */
-  set borderBottomStyle(String? value) {
-    _borderBottomStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderBottomStyle')
-  String get _borderBottomStyle native;
-
-  @JSName('borderBottomStyle')
-  set _borderBottomStyle(String value) native;
-
-  /** Gets the value of "border-bottom-width" */
-  String get borderBottomWidth => this._borderBottomWidth;
-
-  /** Sets the value of "border-bottom-width" */
-  set borderBottomWidth(String? value) {
-    _borderBottomWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderBottomWidth')
-  String get _borderBottomWidth native;
-
-  @JSName('borderBottomWidth')
-  set _borderBottomWidth(String value) native;
-
-  /** Gets the value of "border-collapse" */
-  String get borderCollapse => this._borderCollapse;
-
-  /** Sets the value of "border-collapse" */
-  set borderCollapse(String? value) {
-    _borderCollapse = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderCollapse')
-  String get _borderCollapse native;
-
-  @JSName('borderCollapse')
-  set _borderCollapse(String value) native;
-
-  /** Gets the value of "border-color" */
-  String get borderColor => this._borderColor;
-
-  /** Sets the value of "border-color" */
-  set borderColor(String? value) {
-    _borderColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderColor')
-  String get _borderColor native;
-
-  @JSName('borderColor')
-  set _borderColor(String value) native;
-
-  /** Gets the value of "border-left" */
-  String get borderLeft => this._borderLeft;
-
-  /** Sets the value of "border-left" */
-  set borderLeft(String? value) {
-    _borderLeft = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderLeft')
-  String get _borderLeft native;
-
-  @JSName('borderLeft')
-  set _borderLeft(String value) native;
-
-  /** Gets the value of "border-left-color" */
-  String get borderLeftColor => this._borderLeftColor;
-
-  /** Sets the value of "border-left-color" */
-  set borderLeftColor(String? value) {
-    _borderLeftColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderLeftColor')
-  String get _borderLeftColor native;
-
-  @JSName('borderLeftColor')
-  set _borderLeftColor(String value) native;
-
-  /** Gets the value of "border-left-style" */
-  String get borderLeftStyle => this._borderLeftStyle;
-
-  /** Sets the value of "border-left-style" */
-  set borderLeftStyle(String? value) {
-    _borderLeftStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderLeftStyle')
-  String get _borderLeftStyle native;
-
-  @JSName('borderLeftStyle')
-  set _borderLeftStyle(String value) native;
-
-  /** Gets the value of "border-left-width" */
-  String get borderLeftWidth => this._borderLeftWidth;
-
-  /** Sets the value of "border-left-width" */
-  set borderLeftWidth(String? value) {
-    _borderLeftWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderLeftWidth')
-  String get _borderLeftWidth native;
-
-  @JSName('borderLeftWidth')
-  set _borderLeftWidth(String value) native;
-
-  /** Gets the value of "border-right" */
-  String get borderRight => this._borderRight;
-
-  /** Sets the value of "border-right" */
-  set borderRight(String? value) {
-    _borderRight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderRight')
-  String get _borderRight native;
-
-  @JSName('borderRight')
-  set _borderRight(String value) native;
-
-  /** Gets the value of "border-right-color" */
-  String get borderRightColor => this._borderRightColor;
-
-  /** Sets the value of "border-right-color" */
-  set borderRightColor(String? value) {
-    _borderRightColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderRightColor')
-  String get _borderRightColor native;
-
-  @JSName('borderRightColor')
-  set _borderRightColor(String value) native;
-
-  /** Gets the value of "border-right-style" */
-  String get borderRightStyle => this._borderRightStyle;
-
-  /** Sets the value of "border-right-style" */
-  set borderRightStyle(String? value) {
-    _borderRightStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderRightStyle')
-  String get _borderRightStyle native;
-
-  @JSName('borderRightStyle')
-  set _borderRightStyle(String value) native;
-
-  /** Gets the value of "border-right-width" */
-  String get borderRightWidth => this._borderRightWidth;
-
-  /** Sets the value of "border-right-width" */
-  set borderRightWidth(String? value) {
-    _borderRightWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderRightWidth')
-  String get _borderRightWidth native;
-
-  @JSName('borderRightWidth')
-  set _borderRightWidth(String value) native;
-
-  /** Gets the value of "border-spacing" */
-  String get borderSpacing => this._borderSpacing;
-
-  /** Sets the value of "border-spacing" */
-  set borderSpacing(String? value) {
-    _borderSpacing = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderSpacing')
-  String get _borderSpacing native;
-
-  @JSName('borderSpacing')
-  set _borderSpacing(String value) native;
-
-  /** Gets the value of "border-style" */
-  String get borderStyle => this._borderStyle;
-
-  /** Sets the value of "border-style" */
-  set borderStyle(String? value) {
-    _borderStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderStyle')
-  String get _borderStyle native;
-
-  @JSName('borderStyle')
-  set _borderStyle(String value) native;
-
-  /** Gets the value of "border-top" */
-  String get borderTop => this._borderTop;
-
-  /** Sets the value of "border-top" */
-  set borderTop(String? value) {
-    _borderTop = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderTop')
-  String get _borderTop native;
-
-  @JSName('borderTop')
-  set _borderTop(String value) native;
-
-  /** Gets the value of "border-top-color" */
-  String get borderTopColor => this._borderTopColor;
-
-  /** Sets the value of "border-top-color" */
-  set borderTopColor(String? value) {
-    _borderTopColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderTopColor')
-  String get _borderTopColor native;
-
-  @JSName('borderTopColor')
-  set _borderTopColor(String value) native;
-
-  /** Gets the value of "border-top-style" */
-  String get borderTopStyle => this._borderTopStyle;
-
-  /** Sets the value of "border-top-style" */
-  set borderTopStyle(String? value) {
-    _borderTopStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderTopStyle')
-  String get _borderTopStyle native;
-
-  @JSName('borderTopStyle')
-  set _borderTopStyle(String value) native;
-
-  /** Gets the value of "border-top-width" */
-  String get borderTopWidth => this._borderTopWidth;
-
-  /** Sets the value of "border-top-width" */
-  set borderTopWidth(String? value) {
-    _borderTopWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderTopWidth')
-  String get _borderTopWidth native;
-
-  @JSName('borderTopWidth')
-  set _borderTopWidth(String value) native;
-
-  /** Gets the value of "border-width" */
-  String get borderWidth => this._borderWidth;
-
-  /** Sets the value of "border-width" */
-  set borderWidth(String? value) {
-    _borderWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('borderWidth')
-  String get _borderWidth native;
-
-  @JSName('borderWidth')
-  set _borderWidth(String value) native;
-
-  /** Gets the value of "bottom" */
-  String get bottom => this._bottom;
-
-  /** Sets the value of "bottom" */
-  set bottom(String? value) {
-    _bottom = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('bottom')
-  String get _bottom native;
-
-  @JSName('bottom')
-  set _bottom(String value) native;
-
-  /** Gets the value of "caption-side" */
-  String get captionSide => this._captionSide;
-
-  /** Sets the value of "caption-side" */
-  set captionSide(String? value) {
-    _captionSide = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('captionSide')
-  String get _captionSide native;
-
-  @JSName('captionSide')
-  set _captionSide(String value) native;
-
-  /** Gets the value of "clear" */
-  String get clear => this._clear;
-
-  /** Sets the value of "clear" */
-  set clear(String? value) {
-    _clear = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('clear')
-  String get _clear native;
-
-  @JSName('clear')
-  set _clear(String value) native;
-
-  /** Gets the value of "clip" */
-  String get clip => this._clip;
-
-  /** Sets the value of "clip" */
-  set clip(String? value) {
-    _clip = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('clip')
-  String get _clip native;
-
-  @JSName('clip')
-  set _clip(String value) native;
-
-  /** Gets the value of "color" */
-  String get color => this._color;
-
-  /** Sets the value of "color" */
-  set color(String? value) {
-    _color = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('color')
-  String get _color native;
-
-  @JSName('color')
-  set _color(String value) native;
-
-  /** Gets the value of "content" */
-  String get content => this._content;
-
-  /** Sets the value of "content" */
-  set content(String? value) {
-    _content = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('content')
-  String get _content native;
-
-  @JSName('content')
-  set _content(String value) native;
-
-  /** Gets the value of "cursor" */
-  String get cursor => this._cursor;
-
-  /** Sets the value of "cursor" */
-  set cursor(String? value) {
-    _cursor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('cursor')
-  String get _cursor native;
-
-  @JSName('cursor')
-  set _cursor(String value) native;
-
-  /** Gets the value of "direction" */
-  String get direction => this._direction;
-
-  /** Sets the value of "direction" */
-  set direction(String? value) {
-    _direction = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('direction')
-  String get _direction native;
-
-  @JSName('direction')
-  set _direction(String value) native;
-
-  /** Gets the value of "display" */
-  String get display => this._display;
-
-  /** Sets the value of "display" */
-  set display(String? value) {
-    _display = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('display')
-  String get _display native;
-
-  @JSName('display')
-  set _display(String value) native;
-
-  /** Gets the value of "empty-cells" */
-  String get emptyCells => this._emptyCells;
-
-  /** Sets the value of "empty-cells" */
-  set emptyCells(String? value) {
-    _emptyCells = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('emptyCells')
-  String get _emptyCells native;
-
-  @JSName('emptyCells')
-  set _emptyCells(String value) native;
-
-  /** Gets the value of "font" */
-  String get font => this._font;
-
-  /** Sets the value of "font" */
-  set font(String? value) {
-    _font = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('font')
-  String get _font native;
-
-  @JSName('font')
-  set _font(String value) native;
-
-  /** Gets the value of "font-family" */
-  String get fontFamily => this._fontFamily;
-
-  /** Sets the value of "font-family" */
-  set fontFamily(String? value) {
-    _fontFamily = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('fontFamily')
-  String get _fontFamily native;
-
-  @JSName('fontFamily')
-  set _fontFamily(String value) native;
-
-  /** Gets the value of "font-size" */
-  String get fontSize => this._fontSize;
-
-  /** Sets the value of "font-size" */
-  set fontSize(String? value) {
-    _fontSize = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('fontSize')
-  String get _fontSize native;
-
-  @JSName('fontSize')
-  set _fontSize(String value) native;
-
-  /** Gets the value of "font-style" */
-  String get fontStyle => this._fontStyle;
-
-  /** Sets the value of "font-style" */
-  set fontStyle(String? value) {
-    _fontStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('fontStyle')
-  String get _fontStyle native;
-
-  @JSName('fontStyle')
-  set _fontStyle(String value) native;
-
-  /** Gets the value of "font-variant" */
-  String get fontVariant => this._fontVariant;
-
-  /** Sets the value of "font-variant" */
-  set fontVariant(String? value) {
-    _fontVariant = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('fontVariant')
-  String get _fontVariant native;
-
-  @JSName('fontVariant')
-  set _fontVariant(String value) native;
-
-  /** Gets the value of "font-weight" */
-  String get fontWeight => this._fontWeight;
-
-  /** Sets the value of "font-weight" */
-  set fontWeight(String? value) {
-    _fontWeight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('fontWeight')
-  String get _fontWeight native;
-
-  @JSName('fontWeight')
-  set _fontWeight(String value) native;
-
-  /** Gets the value of "height" */
-  String get height => this._height;
-
-  /** Sets the value of "height" */
-  set height(String? value) {
-    _height = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('height')
-  String get _height native;
-
-  @JSName('height')
-  set _height(String value) native;
-
-  /** Gets the value of "left" */
-  String get left => this._left;
-
-  /** Sets the value of "left" */
-  set left(String? value) {
-    _left = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('left')
-  String get _left native;
-
-  @JSName('left')
-  set _left(String value) native;
-
-  /** Gets the value of "letter-spacing" */
-  String get letterSpacing => this._letterSpacing;
-
-  /** Sets the value of "letter-spacing" */
-  set letterSpacing(String? value) {
-    _letterSpacing = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('letterSpacing')
-  String get _letterSpacing native;
-
-  @JSName('letterSpacing')
-  set _letterSpacing(String value) native;
-
-  /** Gets the value of "line-height" */
-  String get lineHeight => this._lineHeight;
-
-  /** Sets the value of "line-height" */
-  set lineHeight(String? value) {
-    _lineHeight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('lineHeight')
-  String get _lineHeight native;
-
-  @JSName('lineHeight')
-  set _lineHeight(String value) native;
-
-  /** Gets the value of "list-style" */
-  String get listStyle => this._listStyle;
-
-  /** Sets the value of "list-style" */
-  set listStyle(String? value) {
-    _listStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('listStyle')
-  String get _listStyle native;
-
-  @JSName('listStyle')
-  set _listStyle(String value) native;
-
-  /** Gets the value of "list-style-image" */
-  String get listStyleImage => this._listStyleImage;
-
-  /** Sets the value of "list-style-image" */
-  set listStyleImage(String? value) {
-    _listStyleImage = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('listStyleImage')
-  String get _listStyleImage native;
-
-  @JSName('listStyleImage')
-  set _listStyleImage(String value) native;
-
-  /** Gets the value of "list-style-position" */
-  String get listStylePosition => this._listStylePosition;
-
-  /** Sets the value of "list-style-position" */
-  set listStylePosition(String? value) {
-    _listStylePosition = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('listStylePosition')
-  String get _listStylePosition native;
-
-  @JSName('listStylePosition')
-  set _listStylePosition(String value) native;
-
-  /** Gets the value of "list-style-type" */
-  String get listStyleType => this._listStyleType;
-
-  /** Sets the value of "list-style-type" */
-  set listStyleType(String? value) {
-    _listStyleType = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('listStyleType')
-  String get _listStyleType native;
-
-  @JSName('listStyleType')
-  set _listStyleType(String value) native;
-
-  /** Gets the value of "margin" */
-  String get margin => this._margin;
-
-  /** Sets the value of "margin" */
-  set margin(String? value) {
-    _margin = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('margin')
-  String get _margin native;
-
-  @JSName('margin')
-  set _margin(String value) native;
-
-  /** Gets the value of "margin-bottom" */
-  String get marginBottom => this._marginBottom;
-
-  /** Sets the value of "margin-bottom" */
-  set marginBottom(String? value) {
-    _marginBottom = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('marginBottom')
-  String get _marginBottom native;
-
-  @JSName('marginBottom')
-  set _marginBottom(String value) native;
-
-  /** Gets the value of "margin-left" */
-  String get marginLeft => this._marginLeft;
-
-  /** Sets the value of "margin-left" */
-  set marginLeft(String? value) {
-    _marginLeft = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('marginLeft')
-  String get _marginLeft native;
-
-  @JSName('marginLeft')
-  set _marginLeft(String value) native;
-
-  /** Gets the value of "margin-right" */
-  String get marginRight => this._marginRight;
-
-  /** Sets the value of "margin-right" */
-  set marginRight(String? value) {
-    _marginRight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('marginRight')
-  String get _marginRight native;
-
-  @JSName('marginRight')
-  set _marginRight(String value) native;
-
-  /** Gets the value of "margin-top" */
-  String get marginTop => this._marginTop;
-
-  /** Sets the value of "margin-top" */
-  set marginTop(String? value) {
-    _marginTop = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('marginTop')
-  String get _marginTop native;
-
-  @JSName('marginTop')
-  set _marginTop(String value) native;
-
-  /** Gets the value of "max-height" */
-  String get maxHeight => this._maxHeight;
-
-  /** Sets the value of "max-height" */
-  set maxHeight(String? value) {
-    _maxHeight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('maxHeight')
-  String get _maxHeight native;
-
-  @JSName('maxHeight')
-  set _maxHeight(String value) native;
-
-  /** Gets the value of "max-width" */
-  String get maxWidth => this._maxWidth;
-
-  /** Sets the value of "max-width" */
-  set maxWidth(String? value) {
-    _maxWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('maxWidth')
-  String get _maxWidth native;
-
-  @JSName('maxWidth')
-  set _maxWidth(String value) native;
-
-  /** Gets the value of "min-height" */
-  String get minHeight => this._minHeight;
-
-  /** Sets the value of "min-height" */
-  set minHeight(String? value) {
-    _minHeight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('minHeight')
-  String get _minHeight native;
-
-  @JSName('minHeight')
-  set _minHeight(String value) native;
-
-  /** Gets the value of "min-width" */
-  String get minWidth => this._minWidth;
-
-  /** Sets the value of "min-width" */
-  set minWidth(String? value) {
-    _minWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('minWidth')
-  String get _minWidth native;
-
-  @JSName('minWidth')
-  set _minWidth(String value) native;
-
-  /** Gets the value of "outline" */
-  String get outline => this._outline;
-
-  /** Sets the value of "outline" */
-  set outline(String? value) {
-    _outline = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('outline')
-  String get _outline native;
-
-  @JSName('outline')
-  set _outline(String value) native;
-
-  /** Gets the value of "outline-color" */
-  String get outlineColor => this._outlineColor;
-
-  /** Sets the value of "outline-color" */
-  set outlineColor(String? value) {
-    _outlineColor = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('outlineColor')
-  String get _outlineColor native;
-
-  @JSName('outlineColor')
-  set _outlineColor(String value) native;
-
-  /** Gets the value of "outline-style" */
-  String get outlineStyle => this._outlineStyle;
-
-  /** Sets the value of "outline-style" */
-  set outlineStyle(String? value) {
-    _outlineStyle = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('outlineStyle')
-  String get _outlineStyle native;
-
-  @JSName('outlineStyle')
-  set _outlineStyle(String value) native;
-
-  /** Gets the value of "outline-width" */
-  String get outlineWidth => this._outlineWidth;
-
-  /** Sets the value of "outline-width" */
-  set outlineWidth(String? value) {
-    _outlineWidth = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('outlineWidth')
-  String get _outlineWidth native;
-
-  @JSName('outlineWidth')
-  set _outlineWidth(String value) native;
-
-  /** Gets the value of "overflow" */
-  String get overflow => this._overflow;
-
-  /** Sets the value of "overflow" */
-  set overflow(String? value) {
-    _overflow = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('overflow')
-  String get _overflow native;
-
-  @JSName('overflow')
-  set _overflow(String value) native;
-
-  /** Gets the value of "padding" */
-  String get padding => this._padding;
-
-  /** Sets the value of "padding" */
-  set padding(String? value) {
-    _padding = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('padding')
-  String get _padding native;
-
-  @JSName('padding')
-  set _padding(String value) native;
-
-  /** Gets the value of "padding-bottom" */
-  String get paddingBottom => this._paddingBottom;
-
-  /** Sets the value of "padding-bottom" */
-  set paddingBottom(String? value) {
-    _paddingBottom = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('paddingBottom')
-  String get _paddingBottom native;
-
-  @JSName('paddingBottom')
-  set _paddingBottom(String value) native;
-
-  /** Gets the value of "padding-left" */
-  String get paddingLeft => this._paddingLeft;
-
-  /** Sets the value of "padding-left" */
-  set paddingLeft(String? value) {
-    _paddingLeft = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('paddingLeft')
-  String get _paddingLeft native;
-
-  @JSName('paddingLeft')
-  set _paddingLeft(String value) native;
-
-  /** Gets the value of "padding-right" */
-  String get paddingRight => this._paddingRight;
-
-  /** Sets the value of "padding-right" */
-  set paddingRight(String? value) {
-    _paddingRight = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('paddingRight')
-  String get _paddingRight native;
-
-  @JSName('paddingRight')
-  set _paddingRight(String value) native;
-
-  /** Gets the value of "padding-top" */
-  String get paddingTop => this._paddingTop;
-
-  /** Sets the value of "padding-top" */
-  set paddingTop(String? value) {
-    _paddingTop = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('paddingTop')
-  String get _paddingTop native;
-
-  @JSName('paddingTop')
-  set _paddingTop(String value) native;
-
-  /** Gets the value of "page-break-after" */
-  String get pageBreakAfter => this._pageBreakAfter;
-
-  /** Sets the value of "page-break-after" */
-  set pageBreakAfter(String? value) {
-    _pageBreakAfter = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('pageBreakAfter')
-  String get _pageBreakAfter native;
-
-  @JSName('pageBreakAfter')
-  set _pageBreakAfter(String value) native;
-
-  /** Gets the value of "page-break-before" */
-  String get pageBreakBefore => this._pageBreakBefore;
-
-  /** Sets the value of "page-break-before" */
-  set pageBreakBefore(String? value) {
-    _pageBreakBefore = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('pageBreakBefore')
-  String get _pageBreakBefore native;
-
-  @JSName('pageBreakBefore')
-  set _pageBreakBefore(String value) native;
-
-  /** Gets the value of "page-break-inside" */
-  String get pageBreakInside => this._pageBreakInside;
-
-  /** Sets the value of "page-break-inside" */
-  set pageBreakInside(String? value) {
-    _pageBreakInside = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('pageBreakInside')
-  String get _pageBreakInside native;
-
-  @JSName('pageBreakInside')
-  set _pageBreakInside(String value) native;
-
-  /** Gets the value of "position" */
-  String get position => this._position;
-
-  /** Sets the value of "position" */
-  set position(String? value) {
-    _position = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('position')
-  String get _position native;
-
-  @JSName('position')
-  set _position(String value) native;
-
-  /** Gets the value of "quotes" */
-  String get quotes => this._quotes;
-
-  /** Sets the value of "quotes" */
-  set quotes(String? value) {
-    _quotes = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('quotes')
-  String get _quotes native;
-
-  @JSName('quotes')
-  set _quotes(String value) native;
-
-  /** Gets the value of "right" */
-  String get right => this._right;
-
-  /** Sets the value of "right" */
-  set right(String? value) {
-    _right = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('right')
-  String get _right native;
-
-  @JSName('right')
-  set _right(String value) native;
-
-  /** Gets the value of "table-layout" */
-  String get tableLayout => this._tableLayout;
-
-  /** Sets the value of "table-layout" */
-  set tableLayout(String? value) {
-    _tableLayout = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('tableLayout')
-  String get _tableLayout native;
-
-  @JSName('tableLayout')
-  set _tableLayout(String value) native;
-
-  /** Gets the value of "text-align" */
-  String get textAlign => this._textAlign;
-
-  /** Sets the value of "text-align" */
-  set textAlign(String? value) {
-    _textAlign = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('textAlign')
-  String get _textAlign native;
-
-  @JSName('textAlign')
-  set _textAlign(String value) native;
-
-  /** Gets the value of "text-decoration" */
-  String get textDecoration => this._textDecoration;
-
-  /** Sets the value of "text-decoration" */
-  set textDecoration(String? value) {
-    _textDecoration = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('textDecoration')
-  String get _textDecoration native;
-
-  @JSName('textDecoration')
-  set _textDecoration(String value) native;
-
-  /** Gets the value of "text-indent" */
-  String get textIndent => this._textIndent;
-
-  /** Sets the value of "text-indent" */
-  set textIndent(String? value) {
-    _textIndent = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('textIndent')
-  String get _textIndent native;
-
-  @JSName('textIndent')
-  set _textIndent(String value) native;
-
-  /** Gets the value of "text-transform" */
-  String get textTransform => this._textTransform;
-
-  /** Sets the value of "text-transform" */
-  set textTransform(String? value) {
-    _textTransform = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('textTransform')
-  String get _textTransform native;
-
-  @JSName('textTransform')
-  set _textTransform(String value) native;
-
-  /** Gets the value of "top" */
-  String get top => this._top;
-
-  /** Sets the value of "top" */
-  set top(String? value) {
-    _top = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('top')
-  String get _top native;
-
-  @JSName('top')
-  set _top(String value) native;
-
-  /** Gets the value of "unicode-bidi" */
-  String get unicodeBidi => this._unicodeBidi;
-
-  /** Sets the value of "unicode-bidi" */
-  set unicodeBidi(String? value) {
-    _unicodeBidi = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('unicodeBidi')
-  String get _unicodeBidi native;
-
-  @JSName('unicodeBidi')
-  set _unicodeBidi(String value) native;
-
-  /** Gets the value of "vertical-align" */
-  String get verticalAlign => this._verticalAlign;
-
-  /** Sets the value of "vertical-align" */
-  set verticalAlign(String? value) {
-    _verticalAlign = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('verticalAlign')
-  String get _verticalAlign native;
-
-  @JSName('verticalAlign')
-  set _verticalAlign(String value) native;
-
-  /** Gets the value of "visibility" */
-  String get visibility => this._visibility;
-
-  /** Sets the value of "visibility" */
-  set visibility(String? value) {
-    _visibility = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('visibility')
-  String get _visibility native;
-
-  @JSName('visibility')
-  set _visibility(String value) native;
-
-  /** Gets the value of "white-space" */
-  String get whiteSpace => this._whiteSpace;
-
-  /** Sets the value of "white-space" */
-  set whiteSpace(String? value) {
-    _whiteSpace = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('whiteSpace')
-  String get _whiteSpace native;
-
-  @JSName('whiteSpace')
-  set _whiteSpace(String value) native;
-
-  /** Gets the value of "width" */
-  String get width => this._width;
-
-  /** Sets the value of "width" */
-  set width(String? value) {
-    _width = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('width')
-  String get _width native;
-
-  @JSName('width')
-  set _width(String value) native;
-
-  /** Gets the value of "word-spacing" */
-  String get wordSpacing => this._wordSpacing;
-
-  /** Sets the value of "word-spacing" */
-  set wordSpacing(String? value) {
-    _wordSpacing = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('wordSpacing')
-  String get _wordSpacing native;
-
-  @JSName('wordSpacing')
-  set _wordSpacing(String value) native;
-
-  /** Gets the value of "z-index" */
-  String get zIndex => this._zIndex;
-
-  /** Sets the value of "z-index" */
-  set zIndex(String? value) {
-    _zIndex = value == null ? '' : value;
-  }
-
-  @Returns('String')
-  @JSName('zIndex')
-  String get _zIndex native;
-
-  @JSName('zIndex')
-  set _zIndex(String value) native;
-}
-
-class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
-  final Iterable<Element> _elementIterable;
-  Iterable<CssStyleDeclaration>? _elementCssStyleDeclarationSetIterable;
-
-  _CssStyleDeclarationSet(this._elementIterable) {
-    _elementCssStyleDeclarationSetIterable =
-        new List.from(_elementIterable).map((e) => e.style);
-  }
-
-  String getPropertyValue(String propertyName) =>
-      _elementCssStyleDeclarationSetIterable!.first
-          .getPropertyValue(propertyName);
-
-  void setProperty(String propertyName, String? value, [String? priority]) {
-    _elementCssStyleDeclarationSetIterable!
-        .forEach((e) => e.setProperty(propertyName, value, priority));
-  }
-
-  void _setAll(String propertyName, String? value) {
-    value = value == null ? '' : value;
-    for (Element element in _elementIterable) {
-      JS('void', '#.style[#] = #', element, propertyName, value);
-    }
-  }
-
-  /** Sets the value of "background" */
-  set background(String value) {
-    _setAll('background', value);
-  }
-
-  /** Sets the value of "background-attachment" */
-  set backgroundAttachment(String value) {
-    _setAll('backgroundAttachment', value);
-  }
-
-  /** Sets the value of "background-color" */
-  set backgroundColor(String value) {
-    _setAll('backgroundColor', value);
-  }
-
-  /** Sets the value of "background-image" */
-  set backgroundImage(String value) {
-    _setAll('backgroundImage', value);
-  }
-
-  /** Sets the value of "background-position" */
-  set backgroundPosition(String value) {
-    _setAll('backgroundPosition', value);
-  }
-
-  /** Sets the value of "background-repeat" */
-  set backgroundRepeat(String value) {
-    _setAll('backgroundRepeat', value);
-  }
-
-  /** Sets the value of "border" */
-  set border(String value) {
-    _setAll('border', value);
-  }
-
-  /** Sets the value of "border-bottom" */
-  set borderBottom(String value) {
-    _setAll('borderBottom', value);
-  }
-
-  /** Sets the value of "border-bottom-color" */
-  set borderBottomColor(String value) {
-    _setAll('borderBottomColor', value);
-  }
-
-  /** Sets the value of "border-bottom-style" */
-  set borderBottomStyle(String value) {
-    _setAll('borderBottomStyle', value);
-  }
-
-  /** Sets the value of "border-bottom-width" */
-  set borderBottomWidth(String value) {
-    _setAll('borderBottomWidth', value);
-  }
-
-  /** Sets the value of "border-collapse" */
-  set borderCollapse(String value) {
-    _setAll('borderCollapse', value);
-  }
-
-  /** Sets the value of "border-color" */
-  set borderColor(String value) {
-    _setAll('borderColor', value);
-  }
-
-  /** Sets the value of "border-left" */
-  set borderLeft(String value) {
-    _setAll('borderLeft', value);
-  }
-
-  /** Sets the value of "border-left-color" */
-  set borderLeftColor(String value) {
-    _setAll('borderLeftColor', value);
-  }
-
-  /** Sets the value of "border-left-style" */
-  set borderLeftStyle(String value) {
-    _setAll('borderLeftStyle', value);
-  }
-
-  /** Sets the value of "border-left-width" */
-  set borderLeftWidth(String value) {
-    _setAll('borderLeftWidth', value);
-  }
-
-  /** Sets the value of "border-right" */
-  set borderRight(String value) {
-    _setAll('borderRight', value);
-  }
-
-  /** Sets the value of "border-right-color" */
-  set borderRightColor(String value) {
-    _setAll('borderRightColor', value);
-  }
-
-  /** Sets the value of "border-right-style" */
-  set borderRightStyle(String value) {
-    _setAll('borderRightStyle', value);
-  }
-
-  /** Sets the value of "border-right-width" */
-  set borderRightWidth(String value) {
-    _setAll('borderRightWidth', value);
-  }
-
-  /** Sets the value of "border-spacing" */
-  set borderSpacing(String value) {
-    _setAll('borderSpacing', value);
-  }
-
-  /** Sets the value of "border-style" */
-  set borderStyle(String value) {
-    _setAll('borderStyle', value);
-  }
-
-  /** Sets the value of "border-top" */
-  set borderTop(String value) {
-    _setAll('borderTop', value);
-  }
-
-  /** Sets the value of "border-top-color" */
-  set borderTopColor(String value) {
-    _setAll('borderTopColor', value);
-  }
-
-  /** Sets the value of "border-top-style" */
-  set borderTopStyle(String value) {
-    _setAll('borderTopStyle', value);
-  }
-
-  /** Sets the value of "border-top-width" */
-  set borderTopWidth(String value) {
-    _setAll('borderTopWidth', value);
-  }
-
-  /** Sets the value of "border-width" */
-  set borderWidth(String value) {
-    _setAll('borderWidth', value);
-  }
-
-  /** Sets the value of "bottom" */
-  set bottom(String value) {
-    _setAll('bottom', value);
-  }
-
-  /** Sets the value of "caption-side" */
-  set captionSide(String value) {
-    _setAll('captionSide', value);
-  }
-
-  /** Sets the value of "clear" */
-  set clear(String value) {
-    _setAll('clear', value);
-  }
-
-  /** Sets the value of "clip" */
-  set clip(String value) {
-    _setAll('clip', value);
-  }
-
-  /** Sets the value of "color" */
-  set color(String value) {
-    _setAll('color', value);
-  }
-
-  /** Sets the value of "content" */
-  set content(String value) {
-    _setAll('content', value);
-  }
-
-  /** Sets the value of "cursor" */
-  set cursor(String value) {
-    _setAll('cursor', value);
-  }
-
-  /** Sets the value of "direction" */
-  set direction(String value) {
-    _setAll('direction', value);
-  }
-
-  /** Sets the value of "display" */
-  set display(String value) {
-    _setAll('display', value);
-  }
-
-  /** Sets the value of "empty-cells" */
-  set emptyCells(String value) {
-    _setAll('emptyCells', value);
-  }
-
-  /** Sets the value of "font" */
-  set font(String value) {
-    _setAll('font', value);
-  }
-
-  /** Sets the value of "font-family" */
-  set fontFamily(String value) {
-    _setAll('fontFamily', value);
-  }
-
-  /** Sets the value of "font-size" */
-  set fontSize(String value) {
-    _setAll('fontSize', value);
-  }
-
-  /** Sets the value of "font-style" */
-  set fontStyle(String value) {
-    _setAll('fontStyle', value);
-  }
-
-  /** Sets the value of "font-variant" */
-  set fontVariant(String value) {
-    _setAll('fontVariant', value);
-  }
-
-  /** Sets the value of "font-weight" */
-  set fontWeight(String value) {
-    _setAll('fontWeight', value);
-  }
-
-  /** Sets the value of "height" */
-  set height(String value) {
-    _setAll('height', value);
-  }
-
-  /** Sets the value of "left" */
-  set left(String value) {
-    _setAll('left', value);
-  }
-
-  /** Sets the value of "letter-spacing" */
-  set letterSpacing(String value) {
-    _setAll('letterSpacing', value);
-  }
-
-  /** Sets the value of "line-height" */
-  set lineHeight(String value) {
-    _setAll('lineHeight', value);
-  }
-
-  /** Sets the value of "list-style" */
-  set listStyle(String value) {
-    _setAll('listStyle', value);
-  }
-
-  /** Sets the value of "list-style-image" */
-  set listStyleImage(String value) {
-    _setAll('listStyleImage', value);
-  }
-
-  /** Sets the value of "list-style-position" */
-  set listStylePosition(String value) {
-    _setAll('listStylePosition', value);
-  }
-
-  /** Sets the value of "list-style-type" */
-  set listStyleType(String value) {
-    _setAll('listStyleType', value);
-  }
-
-  /** Sets the value of "margin" */
-  set margin(String value) {
-    _setAll('margin', value);
-  }
-
-  /** Sets the value of "margin-bottom" */
-  set marginBottom(String value) {
-    _setAll('marginBottom', value);
-  }
-
-  /** Sets the value of "margin-left" */
-  set marginLeft(String value) {
-    _setAll('marginLeft', value);
-  }
-
-  /** Sets the value of "margin-right" */
-  set marginRight(String value) {
-    _setAll('marginRight', value);
-  }
-
-  /** Sets the value of "margin-top" */
-  set marginTop(String value) {
-    _setAll('marginTop', value);
-  }
-
-  /** Sets the value of "max-height" */
-  set maxHeight(String value) {
-    _setAll('maxHeight', value);
-  }
-
-  /** Sets the value of "max-width" */
-  set maxWidth(String value) {
-    _setAll('maxWidth', value);
-  }
-
-  /** Sets the value of "min-height" */
-  set minHeight(String value) {
-    _setAll('minHeight', value);
-  }
-
-  /** Sets the value of "min-width" */
-  set minWidth(String value) {
-    _setAll('minWidth', value);
-  }
-
-  /** Sets the value of "outline" */
-  set outline(String value) {
-    _setAll('outline', value);
-  }
-
-  /** Sets the value of "outline-color" */
-  set outlineColor(String value) {
-    _setAll('outlineColor', value);
-  }
-
-  /** Sets the value of "outline-style" */
-  set outlineStyle(String value) {
-    _setAll('outlineStyle', value);
-  }
-
-  /** Sets the value of "outline-width" */
-  set outlineWidth(String value) {
-    _setAll('outlineWidth', value);
-  }
-
-  /** Sets the value of "overflow" */
-  set overflow(String value) {
-    _setAll('overflow', value);
-  }
-
-  /** Sets the value of "padding" */
-  set padding(String value) {
-    _setAll('padding', value);
-  }
-
-  /** Sets the value of "padding-bottom" */
-  set paddingBottom(String value) {
-    _setAll('paddingBottom', value);
-  }
-
-  /** Sets the value of "padding-left" */
-  set paddingLeft(String value) {
-    _setAll('paddingLeft', value);
-  }
-
-  /** Sets the value of "padding-right" */
-  set paddingRight(String value) {
-    _setAll('paddingRight', value);
-  }
-
-  /** Sets the value of "padding-top" */
-  set paddingTop(String value) {
-    _setAll('paddingTop', value);
-  }
-
-  /** Sets the value of "page-break-after" */
-  set pageBreakAfter(String value) {
-    _setAll('pageBreakAfter', value);
-  }
-
-  /** Sets the value of "page-break-before" */
-  set pageBreakBefore(String value) {
-    _setAll('pageBreakBefore', value);
-  }
-
-  /** Sets the value of "page-break-inside" */
-  set pageBreakInside(String value) {
-    _setAll('pageBreakInside', value);
-  }
-
-  /** Sets the value of "position" */
-  set position(String value) {
-    _setAll('position', value);
-  }
-
-  /** Sets the value of "quotes" */
-  set quotes(String value) {
-    _setAll('quotes', value);
-  }
-
-  /** Sets the value of "right" */
-  set right(String value) {
-    _setAll('right', value);
-  }
-
-  /** Sets the value of "table-layout" */
-  set tableLayout(String value) {
-    _setAll('tableLayout', value);
-  }
-
-  /** Sets the value of "text-align" */
-  set textAlign(String value) {
-    _setAll('textAlign', value);
-  }
-
-  /** Sets the value of "text-decoration" */
-  set textDecoration(String value) {
-    _setAll('textDecoration', value);
-  }
-
-  /** Sets the value of "text-indent" */
-  set textIndent(String value) {
-    _setAll('textIndent', value);
-  }
-
-  /** Sets the value of "text-transform" */
-  set textTransform(String value) {
-    _setAll('textTransform', value);
-  }
-
-  /** Sets the value of "top" */
-  set top(String value) {
-    _setAll('top', value);
-  }
-
-  /** Sets the value of "unicode-bidi" */
-  set unicodeBidi(String value) {
-    _setAll('unicodeBidi', value);
-  }
-
-  /** Sets the value of "vertical-align" */
-  set verticalAlign(String value) {
-    _setAll('verticalAlign', value);
-  }
-
-  /** Sets the value of "visibility" */
-  set visibility(String value) {
-    _setAll('visibility', value);
-  }
-
-  /** Sets the value of "white-space" */
-  set whiteSpace(String value) {
-    _setAll('whiteSpace', value);
-  }
-
-  /** Sets the value of "width" */
-  set width(String value) {
-    _setAll('width', value);
-  }
-
-  /** Sets the value of "word-spacing" */
-  set wordSpacing(String value) {
-    _setAll('wordSpacing', value);
-  }
-
-  /** Sets the value of "z-index" */
-  set zIndex(String value) {
-    _setAll('zIndex', value);
-  }
-
-  // Important note: CssStyleDeclarationSet does NOT implement every method
-  // available in CssStyleDeclaration. Some of the methods don't make so much
-  // sense in terms of having a resonable value to return when you're
-  // considering a list of Elements. You will need to manually add any of the
-  // items in the MEMBERS set if you want that functionality.
-}
-
-abstract class CssStyleDeclarationBase {
-  String getPropertyValue(String propertyName);
-  void setProperty(String propertyName, String? value, [String? priority]);
-
-  /** Gets the value of "align-content" */
-  String get alignContent => getPropertyValue('align-content');
-
-  /** Sets the value of "align-content" */
-  set alignContent(String value) {
-    setProperty('align-content', value, '');
-  }
-
-  /** Gets the value of "align-items" */
-  String get alignItems => getPropertyValue('align-items');
-
-  /** Sets the value of "align-items" */
-  set alignItems(String value) {
-    setProperty('align-items', value, '');
-  }
-
-  /** Gets the value of "align-self" */
-  String get alignSelf => getPropertyValue('align-self');
-
-  /** Sets the value of "align-self" */
-  set alignSelf(String value) {
-    setProperty('align-self', value, '');
-  }
-
-  /** Gets the value of "animation" */
-  String get animation => getPropertyValue('animation');
-
-  /** Sets the value of "animation" */
-  set animation(String value) {
-    setProperty('animation', value, '');
-  }
-
-  /** Gets the value of "animation-delay" */
-  String get animationDelay => getPropertyValue('animation-delay');
-
-  /** Sets the value of "animation-delay" */
-  set animationDelay(String value) {
-    setProperty('animation-delay', value, '');
-  }
-
-  /** Gets the value of "animation-direction" */
-  String get animationDirection => getPropertyValue('animation-direction');
-
-  /** Sets the value of "animation-direction" */
-  set animationDirection(String value) {
-    setProperty('animation-direction', value, '');
-  }
-
-  /** Gets the value of "animation-duration" */
-  String get animationDuration => getPropertyValue('animation-duration');
-
-  /** Sets the value of "animation-duration" */
-  set animationDuration(String value) {
-    setProperty('animation-duration', value, '');
-  }
-
-  /** Gets the value of "animation-fill-mode" */
-  String get animationFillMode => getPropertyValue('animation-fill-mode');
-
-  /** Sets the value of "animation-fill-mode" */
-  set animationFillMode(String value) {
-    setProperty('animation-fill-mode', value, '');
-  }
-
-  /** Gets the value of "animation-iteration-count" */
-  String get animationIterationCount =>
-      getPropertyValue('animation-iteration-count');
-
-  /** Sets the value of "animation-iteration-count" */
-  set animationIterationCount(String value) {
-    setProperty('animation-iteration-count', value, '');
-  }
-
-  /** Gets the value of "animation-name" */
-  String get animationName => getPropertyValue('animation-name');
-
-  /** Sets the value of "animation-name" */
-  set animationName(String value) {
-    setProperty('animation-name', value, '');
-  }
-
-  /** Gets the value of "animation-play-state" */
-  String get animationPlayState => getPropertyValue('animation-play-state');
-
-  /** Sets the value of "animation-play-state" */
-  set animationPlayState(String value) {
-    setProperty('animation-play-state', value, '');
-  }
-
-  /** Gets the value of "animation-timing-function" */
-  String get animationTimingFunction =>
-      getPropertyValue('animation-timing-function');
-
-  /** Sets the value of "animation-timing-function" */
-  set animationTimingFunction(String value) {
-    setProperty('animation-timing-function', value, '');
-  }
-
-  /** Gets the value of "app-region" */
-  String get appRegion => getPropertyValue('app-region');
-
-  /** Sets the value of "app-region" */
-  set appRegion(String value) {
-    setProperty('app-region', value, '');
-  }
-
-  /** Gets the value of "appearance" */
-  String get appearance => getPropertyValue('appearance');
-
-  /** Sets the value of "appearance" */
-  set appearance(String value) {
-    setProperty('appearance', value, '');
-  }
-
-  /** Gets the value of "aspect-ratio" */
-  String get aspectRatio => getPropertyValue('aspect-ratio');
-
-  /** Sets the value of "aspect-ratio" */
-  set aspectRatio(String value) {
-    setProperty('aspect-ratio', value, '');
-  }
-
-  /** Gets the value of "backface-visibility" */
-  String get backfaceVisibility => getPropertyValue('backface-visibility');
-
-  /** Sets the value of "backface-visibility" */
-  set backfaceVisibility(String value) {
-    setProperty('backface-visibility', value, '');
-  }
-
-  /** Gets the value of "background" */
-  String get background => getPropertyValue('background');
-
-  /** Sets the value of "background" */
-  set background(String value) {
-    setProperty('background', value, '');
-  }
-
-  /** Gets the value of "background-attachment" */
-  String get backgroundAttachment => getPropertyValue('background-attachment');
-
-  /** Sets the value of "background-attachment" */
-  set backgroundAttachment(String value) {
-    setProperty('background-attachment', value, '');
-  }
-
-  /** Gets the value of "background-blend-mode" */
-  String get backgroundBlendMode => getPropertyValue('background-blend-mode');
-
-  /** Sets the value of "background-blend-mode" */
-  set backgroundBlendMode(String value) {
-    setProperty('background-blend-mode', value, '');
-  }
-
-  /** Gets the value of "background-clip" */
-  String get backgroundClip => getPropertyValue('background-clip');
-
-  /** Sets the value of "background-clip" */
-  set backgroundClip(String value) {
-    setProperty('background-clip', value, '');
-  }
-
-  /** Gets the value of "background-color" */
-  String get backgroundColor => getPropertyValue('background-color');
-
-  /** Sets the value of "background-color" */
-  set backgroundColor(String value) {
-    setProperty('background-color', value, '');
-  }
-
-  /** Gets the value of "background-composite" */
-  String get backgroundComposite => getPropertyValue('background-composite');
-
-  /** Sets the value of "background-composite" */
-  set backgroundComposite(String value) {
-    setProperty('background-composite', value, '');
-  }
-
-  /** Gets the value of "background-image" */
-  String get backgroundImage => getPropertyValue('background-image');
-
-  /** Sets the value of "background-image" */
-  set backgroundImage(String value) {
-    setProperty('background-image', value, '');
-  }
-
-  /** Gets the value of "background-origin" */
-  String get backgroundOrigin => getPropertyValue('background-origin');
-
-  /** Sets the value of "background-origin" */
-  set backgroundOrigin(String value) {
-    setProperty('background-origin', value, '');
-  }
-
-  /** Gets the value of "background-position" */
-  String get backgroundPosition => getPropertyValue('background-position');
-
-  /** Sets the value of "background-position" */
-  set backgroundPosition(String value) {
-    setProperty('background-position', value, '');
-  }
-
-  /** Gets the value of "background-position-x" */
-  String get backgroundPositionX => getPropertyValue('background-position-x');
-
-  /** Sets the value of "background-position-x" */
-  set backgroundPositionX(String value) {
-    setProperty('background-position-x', value, '');
-  }
-
-  /** Gets the value of "background-position-y" */
-  String get backgroundPositionY => getPropertyValue('background-position-y');
-
-  /** Sets the value of "background-position-y" */
-  set backgroundPositionY(String value) {
-    setProperty('background-position-y', value, '');
-  }
-
-  /** Gets the value of "background-repeat" */
-  String get backgroundRepeat => getPropertyValue('background-repeat');
-
-  /** Sets the value of "background-repeat" */
-  set backgroundRepeat(String value) {
-    setProperty('background-repeat', value, '');
-  }
-
-  /** Gets the value of "background-repeat-x" */
-  String get backgroundRepeatX => getPropertyValue('background-repeat-x');
-
-  /** Sets the value of "background-repeat-x" */
-  set backgroundRepeatX(String value) {
-    setProperty('background-repeat-x', value, '');
-  }
-
-  /** Gets the value of "background-repeat-y" */
-  String get backgroundRepeatY => getPropertyValue('background-repeat-y');
-
-  /** Sets the value of "background-repeat-y" */
-  set backgroundRepeatY(String value) {
-    setProperty('background-repeat-y', value, '');
-  }
-
-  /** Gets the value of "background-size" */
-  String get backgroundSize => getPropertyValue('background-size');
-
-  /** Sets the value of "background-size" */
-  set backgroundSize(String value) {
-    setProperty('background-size', value, '');
-  }
-
-  /** Gets the value of "border" */
-  String get border => getPropertyValue('border');
-
-  /** Sets the value of "border" */
-  set border(String value) {
-    setProperty('border', value, '');
-  }
-
-  /** Gets the value of "border-after" */
-  String get borderAfter => getPropertyValue('border-after');
-
-  /** Sets the value of "border-after" */
-  set borderAfter(String value) {
-    setProperty('border-after', value, '');
-  }
-
-  /** Gets the value of "border-after-color" */
-  String get borderAfterColor => getPropertyValue('border-after-color');
-
-  /** Sets the value of "border-after-color" */
-  set borderAfterColor(String value) {
-    setProperty('border-after-color', value, '');
-  }
-
-  /** Gets the value of "border-after-style" */
-  String get borderAfterStyle => getPropertyValue('border-after-style');
-
-  /** Sets the value of "border-after-style" */
-  set borderAfterStyle(String value) {
-    setProperty('border-after-style', value, '');
-  }
-
-  /** Gets the value of "border-after-width" */
-  String get borderAfterWidth => getPropertyValue('border-after-width');
-
-  /** Sets the value of "border-after-width" */
-  set borderAfterWidth(String value) {
-    setProperty('border-after-width', value, '');
-  }
-
-  /** Gets the value of "border-before" */
-  String get borderBefore => getPropertyValue('border-before');
-
-  /** Sets the value of "border-before" */
-  set borderBefore(String value) {
-    setProperty('border-before', value, '');
-  }
-
-  /** Gets the value of "border-before-color" */
-  String get borderBeforeColor => getPropertyValue('border-before-color');
-
-  /** Sets the value of "border-before-color" */
-  set borderBeforeColor(String value) {
-    setProperty('border-before-color', value, '');
-  }
-
-  /** Gets the value of "border-before-style" */
-  String get borderBeforeStyle => getPropertyValue('border-before-style');
-
-  /** Sets the value of "border-before-style" */
-  set borderBeforeStyle(String value) {
-    setProperty('border-before-style', value, '');
-  }
-
-  /** Gets the value of "border-before-width" */
-  String get borderBeforeWidth => getPropertyValue('border-before-width');
-
-  /** Sets the value of "border-before-width" */
-  set borderBeforeWidth(String value) {
-    setProperty('border-before-width', value, '');
-  }
-
-  /** Gets the value of "border-bottom" */
-  String get borderBottom => getPropertyValue('border-bottom');
-
-  /** Sets the value of "border-bottom" */
-  set borderBottom(String value) {
-    setProperty('border-bottom', value, '');
-  }
-
-  /** Gets the value of "border-bottom-color" */
-  String get borderBottomColor => getPropertyValue('border-bottom-color');
-
-  /** Sets the value of "border-bottom-color" */
-  set borderBottomColor(String value) {
-    setProperty('border-bottom-color', value, '');
-  }
-
-  /** Gets the value of "border-bottom-left-radius" */
-  String get borderBottomLeftRadius =>
-      getPropertyValue('border-bottom-left-radius');
-
-  /** Sets the value of "border-bottom-left-radius" */
-  set borderBottomLeftRadius(String value) {
-    setProperty('border-bottom-left-radius', value, '');
-  }
-
-  /** Gets the value of "border-bottom-right-radius" */
-  String get borderBottomRightRadius =>
-      getPropertyValue('border-bottom-right-radius');
-
-  /** Sets the value of "border-bottom-right-radius" */
-  set borderBottomRightRadius(String value) {
-    setProperty('border-bottom-right-radius', value, '');
-  }
-
-  /** Gets the value of "border-bottom-style" */
-  String get borderBottomStyle => getPropertyValue('border-bottom-style');
-
-  /** Sets the value of "border-bottom-style" */
-  set borderBottomStyle(String value) {
-    setProperty('border-bottom-style', value, '');
-  }
-
-  /** Gets the value of "border-bottom-width" */
-  String get borderBottomWidth => getPropertyValue('border-bottom-width');
-
-  /** Sets the value of "border-bottom-width" */
-  set borderBottomWidth(String value) {
-    setProperty('border-bottom-width', value, '');
-  }
-
-  /** Gets the value of "border-collapse" */
-  String get borderCollapse => getPropertyValue('border-collapse');
-
-  /** Sets the value of "border-collapse" */
-  set borderCollapse(String value) {
-    setProperty('border-collapse', value, '');
-  }
-
-  /** Gets the value of "border-color" */
-  String get borderColor => getPropertyValue('border-color');
-
-  /** Sets the value of "border-color" */
-  set borderColor(String value) {
-    setProperty('border-color', value, '');
-  }
-
-  /** Gets the value of "border-end" */
-  String get borderEnd => getPropertyValue('border-end');
-
-  /** Sets the value of "border-end" */
-  set borderEnd(String value) {
-    setProperty('border-end', value, '');
-  }
-
-  /** Gets the value of "border-end-color" */
-  String get borderEndColor => getPropertyValue('border-end-color');
-
-  /** Sets the value of "border-end-color" */
-  set borderEndColor(String value) {
-    setProperty('border-end-color', value, '');
-  }
-
-  /** Gets the value of "border-end-style" */
-  String get borderEndStyle => getPropertyValue('border-end-style');
-
-  /** Sets the value of "border-end-style" */
-  set borderEndStyle(String value) {
-    setProperty('border-end-style', value, '');
-  }
-
-  /** Gets the value of "border-end-width" */
-  String get borderEndWidth => getPropertyValue('border-end-width');
-
-  /** Sets the value of "border-end-width" */
-  set borderEndWidth(String value) {
-    setProperty('border-end-width', value, '');
-  }
-
-  /** Gets the value of "border-fit" */
-  String get borderFit => getPropertyValue('border-fit');
-
-  /** Sets the value of "border-fit" */
-  set borderFit(String value) {
-    setProperty('border-fit', value, '');
-  }
-
-  /** Gets the value of "border-horizontal-spacing" */
-  String get borderHorizontalSpacing =>
-      getPropertyValue('border-horizontal-spacing');
-
-  /** Sets the value of "border-horizontal-spacing" */
-  set borderHorizontalSpacing(String value) {
-    setProperty('border-horizontal-spacing', value, '');
-  }
-
-  /** Gets the value of "border-image" */
-  String get borderImage => getPropertyValue('border-image');
-
-  /** Sets the value of "border-image" */
-  set borderImage(String value) {
-    setProperty('border-image', value, '');
-  }
-
-  /** Gets the value of "border-image-outset" */
-  String get borderImageOutset => getPropertyValue('border-image-outset');
-
-  /** Sets the value of "border-image-outset" */
-  set borderImageOutset(String value) {
-    setProperty('border-image-outset', value, '');
-  }
-
-  /** Gets the value of "border-image-repeat" */
-  String get borderImageRepeat => getPropertyValue('border-image-repeat');
-
-  /** Sets the value of "border-image-repeat" */
-  set borderImageRepeat(String value) {
-    setProperty('border-image-repeat', value, '');
-  }
-
-  /** Gets the value of "border-image-slice" */
-  String get borderImageSlice => getPropertyValue('border-image-slice');
-
-  /** Sets the value of "border-image-slice" */
-  set borderImageSlice(String value) {
-    setProperty('border-image-slice', value, '');
-  }
-
-  /** Gets the value of "border-image-source" */
-  String get borderImageSource => getPropertyValue('border-image-source');
-
-  /** Sets the value of "border-image-source" */
-  set borderImageSource(String value) {
-    setProperty('border-image-source', value, '');
-  }
-
-  /** Gets the value of "border-image-width" */
-  String get borderImageWidth => getPropertyValue('border-image-width');
-
-  /** Sets the value of "border-image-width" */
-  set borderImageWidth(String value) {
-    setProperty('border-image-width', value, '');
-  }
-
-  /** Gets the value of "border-left" */
-  String get borderLeft => getPropertyValue('border-left');
-
-  /** Sets the value of "border-left" */
-  set borderLeft(String value) {
-    setProperty('border-left', value, '');
-  }
-
-  /** Gets the value of "border-left-color" */
-  String get borderLeftColor => getPropertyValue('border-left-color');
-
-  /** Sets the value of "border-left-color" */
-  set borderLeftColor(String value) {
-    setProperty('border-left-color', value, '');
-  }
-
-  /** Gets the value of "border-left-style" */
-  String get borderLeftStyle => getPropertyValue('border-left-style');
-
-  /** Sets the value of "border-left-style" */
-  set borderLeftStyle(String value) {
-    setProperty('border-left-style', value, '');
-  }
-
-  /** Gets the value of "border-left-width" */
-  String get borderLeftWidth => getPropertyValue('border-left-width');
-
-  /** Sets the value of "border-left-width" */
-  set borderLeftWidth(String value) {
-    setProperty('border-left-width', value, '');
-  }
-
-  /** Gets the value of "border-radius" */
-  String get borderRadius => getPropertyValue('border-radius');
-
-  /** Sets the value of "border-radius" */
-  set borderRadius(String value) {
-    setProperty('border-radius', value, '');
-  }
-
-  /** Gets the value of "border-right" */
-  String get borderRight => getPropertyValue('border-right');
-
-  /** Sets the value of "border-right" */
-  set borderRight(String value) {
-    setProperty('border-right', value, '');
-  }
-
-  /** Gets the value of "border-right-color" */
-  String get borderRightColor => getPropertyValue('border-right-color');
-
-  /** Sets the value of "border-right-color" */
-  set borderRightColor(String value) {
-    setProperty('border-right-color', value, '');
-  }
-
-  /** Gets the value of "border-right-style" */
-  String get borderRightStyle => getPropertyValue('border-right-style');
-
-  /** Sets the value of "border-right-style" */
-  set borderRightStyle(String value) {
-    setProperty('border-right-style', value, '');
-  }
-
-  /** Gets the value of "border-right-width" */
-  String get borderRightWidth => getPropertyValue('border-right-width');
-
-  /** Sets the value of "border-right-width" */
-  set borderRightWidth(String value) {
-    setProperty('border-right-width', value, '');
-  }
-
-  /** Gets the value of "border-spacing" */
-  String get borderSpacing => getPropertyValue('border-spacing');
-
-  /** Sets the value of "border-spacing" */
-  set borderSpacing(String value) {
-    setProperty('border-spacing', value, '');
-  }
-
-  /** Gets the value of "border-start" */
-  String get borderStart => getPropertyValue('border-start');
-
-  /** Sets the value of "border-start" */
-  set borderStart(String value) {
-    setProperty('border-start', value, '');
-  }
-
-  /** Gets the value of "border-start-color" */
-  String get borderStartColor => getPropertyValue('border-start-color');
-
-  /** Sets the value of "border-start-color" */
-  set borderStartColor(String value) {
-    setProperty('border-start-color', value, '');
-  }
-
-  /** Gets the value of "border-start-style" */
-  String get borderStartStyle => getPropertyValue('border-start-style');
-
-  /** Sets the value of "border-start-style" */
-  set borderStartStyle(String value) {
-    setProperty('border-start-style', value, '');
-  }
-
-  /** Gets the value of "border-start-width" */
-  String get borderStartWidth => getPropertyValue('border-start-width');
-
-  /** Sets the value of "border-start-width" */
-  set borderStartWidth(String value) {
-    setProperty('border-start-width', value, '');
-  }
-
-  /** Gets the value of "border-style" */
-  String get borderStyle => getPropertyValue('border-style');
-
-  /** Sets the value of "border-style" */
-  set borderStyle(String value) {
-    setProperty('border-style', value, '');
-  }
-
-  /** Gets the value of "border-top" */
-  String get borderTop => getPropertyValue('border-top');
-
-  /** Sets the value of "border-top" */
-  set borderTop(String value) {
-    setProperty('border-top', value, '');
-  }
-
-  /** Gets the value of "border-top-color" */
-  String get borderTopColor => getPropertyValue('border-top-color');
-
-  /** Sets the value of "border-top-color" */
-  set borderTopColor(String value) {
-    setProperty('border-top-color', value, '');
-  }
-
-  /** Gets the value of "border-top-left-radius" */
-  String get borderTopLeftRadius => getPropertyValue('border-top-left-radius');
-
-  /** Sets the value of "border-top-left-radius" */
-  set borderTopLeftRadius(String value) {
-    setProperty('border-top-left-radius', value, '');
-  }
-
-  /** Gets the value of "border-top-right-radius" */
-  String get borderTopRightRadius =>
-      getPropertyValue('border-top-right-radius');
-
-  /** Sets the value of "border-top-right-radius" */
-  set borderTopRightRadius(String value) {
-    setProperty('border-top-right-radius', value, '');
-  }
-
-  /** Gets the value of "border-top-style" */
-  String get borderTopStyle => getPropertyValue('border-top-style');
-
-  /** Sets the value of "border-top-style" */
-  set borderTopStyle(String value) {
-    setProperty('border-top-style', value, '');
-  }
-
-  /** Gets the value of "border-top-width" */
-  String get borderTopWidth => getPropertyValue('border-top-width');
-
-  /** Sets the value of "border-top-width" */
-  set borderTopWidth(String value) {
-    setProperty('border-top-width', value, '');
-  }
-
-  /** Gets the value of "border-vertical-spacing" */
-  String get borderVerticalSpacing =>
-      getPropertyValue('border-vertical-spacing');
-
-  /** Sets the value of "border-vertical-spacing" */
-  set borderVerticalSpacing(String value) {
-    setProperty('border-vertical-spacing', value, '');
-  }
-
-  /** Gets the value of "border-width" */
-  String get borderWidth => getPropertyValue('border-width');
-
-  /** Sets the value of "border-width" */
-  set borderWidth(String value) {
-    setProperty('border-width', value, '');
-  }
-
-  /** Gets the value of "bottom" */
-  String get bottom => getPropertyValue('bottom');
-
-  /** Sets the value of "bottom" */
-  set bottom(String value) {
-    setProperty('bottom', value, '');
-  }
-
-  /** Gets the value of "box-align" */
-  String get boxAlign => getPropertyValue('box-align');
-
-  /** Sets the value of "box-align" */
-  set boxAlign(String value) {
-    setProperty('box-align', value, '');
-  }
-
-  /** Gets the value of "box-decoration-break" */
-  String get boxDecorationBreak => getPropertyValue('box-decoration-break');
-
-  /** Sets the value of "box-decoration-break" */
-  set boxDecorationBreak(String value) {
-    setProperty('box-decoration-break', value, '');
-  }
-
-  /** Gets the value of "box-direction" */
-  String get boxDirection => getPropertyValue('box-direction');
-
-  /** Sets the value of "box-direction" */
-  set boxDirection(String value) {
-    setProperty('box-direction', value, '');
-  }
-
-  /** Gets the value of "box-flex" */
-  String get boxFlex => getPropertyValue('box-flex');
-
-  /** Sets the value of "box-flex" */
-  set boxFlex(String value) {
-    setProperty('box-flex', value, '');
-  }
-
-  /** Gets the value of "box-flex-group" */
-  String get boxFlexGroup => getPropertyValue('box-flex-group');
-
-  /** Sets the value of "box-flex-group" */
-  set boxFlexGroup(String value) {
-    setProperty('box-flex-group', value, '');
-  }
-
-  /** Gets the value of "box-lines" */
-  String get boxLines => getPropertyValue('box-lines');
-
-  /** Sets the value of "box-lines" */
-  set boxLines(String value) {
-    setProperty('box-lines', value, '');
-  }
-
-  /** Gets the value of "box-ordinal-group" */
-  String get boxOrdinalGroup => getPropertyValue('box-ordinal-group');
-
-  /** Sets the value of "box-ordinal-group" */
-  set boxOrdinalGroup(String value) {
-    setProperty('box-ordinal-group', value, '');
-  }
-
-  /** Gets the value of "box-orient" */
-  String get boxOrient => getPropertyValue('box-orient');
-
-  /** Sets the value of "box-orient" */
-  set boxOrient(String value) {
-    setProperty('box-orient', value, '');
-  }
-
-  /** Gets the value of "box-pack" */
-  String get boxPack => getPropertyValue('box-pack');
-
-  /** Sets the value of "box-pack" */
-  set boxPack(String value) {
-    setProperty('box-pack', value, '');
-  }
-
-  /** Gets the value of "box-reflect" */
-  String get boxReflect => getPropertyValue('box-reflect');
-
-  /** Sets the value of "box-reflect" */
-  set boxReflect(String value) {
-    setProperty('box-reflect', value, '');
-  }
-
-  /** Gets the value of "box-shadow" */
-  String get boxShadow => getPropertyValue('box-shadow');
-
-  /** Sets the value of "box-shadow" */
-  set boxShadow(String value) {
-    setProperty('box-shadow', value, '');
-  }
-
-  /** Gets the value of "box-sizing" */
-  String get boxSizing => getPropertyValue('box-sizing');
-
-  /** Sets the value of "box-sizing" */
-  set boxSizing(String value) {
-    setProperty('box-sizing', value, '');
-  }
-
-  /** Gets the value of "caption-side" */
-  String get captionSide => getPropertyValue('caption-side');
-
-  /** Sets the value of "caption-side" */
-  set captionSide(String value) {
-    setProperty('caption-side', value, '');
-  }
-
-  /** Gets the value of "clear" */
-  String get clear => getPropertyValue('clear');
-
-  /** Sets the value of "clear" */
-  set clear(String value) {
-    setProperty('clear', value, '');
-  }
-
-  /** Gets the value of "clip" */
-  String get clip => getPropertyValue('clip');
-
-  /** Sets the value of "clip" */
-  set clip(String value) {
-    setProperty('clip', value, '');
-  }
-
-  /** Gets the value of "clip-path" */
-  String get clipPath => getPropertyValue('clip-path');
-
-  /** Sets the value of "clip-path" */
-  set clipPath(String value) {
-    setProperty('clip-path', value, '');
-  }
-
-  /** Gets the value of "color" */
-  String get color => getPropertyValue('color');
-
-  /** Sets the value of "color" */
-  set color(String value) {
-    setProperty('color', value, '');
-  }
-
-  /** Gets the value of "column-break-after" */
-  String get columnBreakAfter => getPropertyValue('column-break-after');
-
-  /** Sets the value of "column-break-after" */
-  set columnBreakAfter(String value) {
-    setProperty('column-break-after', value, '');
-  }
-
-  /** Gets the value of "column-break-before" */
-  String get columnBreakBefore => getPropertyValue('column-break-before');
-
-  /** Sets the value of "column-break-before" */
-  set columnBreakBefore(String value) {
-    setProperty('column-break-before', value, '');
-  }
-
-  /** Gets the value of "column-break-inside" */
-  String get columnBreakInside => getPropertyValue('column-break-inside');
-
-  /** Sets the value of "column-break-inside" */
-  set columnBreakInside(String value) {
-    setProperty('column-break-inside', value, '');
-  }
-
-  /** Gets the value of "column-count" */
-  String get columnCount => getPropertyValue('column-count');
-
-  /** Sets the value of "column-count" */
-  set columnCount(String value) {
-    setProperty('column-count', value, '');
-  }
-
-  /** Gets the value of "column-fill" */
-  String get columnFill => getPropertyValue('column-fill');
-
-  /** Sets the value of "column-fill" */
-  set columnFill(String value) {
-    setProperty('column-fill', value, '');
-  }
-
-  /** Gets the value of "column-gap" */
-  String get columnGap => getPropertyValue('column-gap');
-
-  /** Sets the value of "column-gap" */
-  set columnGap(String value) {
-    setProperty('column-gap', value, '');
-  }
-
-  /** Gets the value of "column-rule" */
-  String get columnRule => getPropertyValue('column-rule');
-
-  /** Sets the value of "column-rule" */
-  set columnRule(String value) {
-    setProperty('column-rule', value, '');
-  }
-
-  /** Gets the value of "column-rule-color" */
-  String get columnRuleColor => getPropertyValue('column-rule-color');
-
-  /** Sets the value of "column-rule-color" */
-  set columnRuleColor(String value) {
-    setProperty('column-rule-color', value, '');
-  }
-
-  /** Gets the value of "column-rule-style" */
-  String get columnRuleStyle => getPropertyValue('column-rule-style');
-
-  /** Sets the value of "column-rule-style" */
-  set columnRuleStyle(String value) {
-    setProperty('column-rule-style', value, '');
-  }
-
-  /** Gets the value of "column-rule-width" */
-  String get columnRuleWidth => getPropertyValue('column-rule-width');
-
-  /** Sets the value of "column-rule-width" */
-  set columnRuleWidth(String value) {
-    setProperty('column-rule-width', value, '');
-  }
-
-  /** Gets the value of "column-span" */
-  String get columnSpan => getPropertyValue('column-span');
-
-  /** Sets the value of "column-span" */
-  set columnSpan(String value) {
-    setProperty('column-span', value, '');
-  }
-
-  /** Gets the value of "column-width" */
-  String get columnWidth => getPropertyValue('column-width');
-
-  /** Sets the value of "column-width" */
-  set columnWidth(String value) {
-    setProperty('column-width', value, '');
-  }
-
-  /** Gets the value of "columns" */
-  String get columns => getPropertyValue('columns');
-
-  /** Sets the value of "columns" */
-  set columns(String value) {
-    setProperty('columns', value, '');
-  }
-
-  /** Gets the value of "content" */
-  String get content => getPropertyValue('content');
-
-  /** Sets the value of "content" */
-  set content(String value) {
-    setProperty('content', value, '');
-  }
-
-  /** Gets the value of "counter-increment" */
-  String get counterIncrement => getPropertyValue('counter-increment');
-
-  /** Sets the value of "counter-increment" */
-  set counterIncrement(String value) {
-    setProperty('counter-increment', value, '');
-  }
-
-  /** Gets the value of "counter-reset" */
-  String get counterReset => getPropertyValue('counter-reset');
-
-  /** Sets the value of "counter-reset" */
-  set counterReset(String value) {
-    setProperty('counter-reset', value, '');
-  }
-
-  /** Gets the value of "cursor" */
-  String get cursor => getPropertyValue('cursor');
-
-  /** Sets the value of "cursor" */
-  set cursor(String value) {
-    setProperty('cursor', value, '');
-  }
-
-  /** Gets the value of "direction" */
-  String get direction => getPropertyValue('direction');
-
-  /** Sets the value of "direction" */
-  set direction(String value) {
-    setProperty('direction', value, '');
-  }
-
-  /** Gets the value of "display" */
-  String get display => getPropertyValue('display');
-
-  /** Sets the value of "display" */
-  set display(String value) {
-    setProperty('display', value, '');
-  }
-
-  /** Gets the value of "empty-cells" */
-  String get emptyCells => getPropertyValue('empty-cells');
-
-  /** Sets the value of "empty-cells" */
-  set emptyCells(String value) {
-    setProperty('empty-cells', value, '');
-  }
-
-  /** Gets the value of "filter" */
-  String get filter => getPropertyValue('filter');
-
-  /** Sets the value of "filter" */
-  set filter(String value) {
-    setProperty('filter', value, '');
-  }
-
-  /** Gets the value of "flex" */
-  String get flex => getPropertyValue('flex');
-
-  /** Sets the value of "flex" */
-  set flex(String value) {
-    setProperty('flex', value, '');
-  }
-
-  /** Gets the value of "flex-basis" */
-  String get flexBasis => getPropertyValue('flex-basis');
-
-  /** Sets the value of "flex-basis" */
-  set flexBasis(String value) {
-    setProperty('flex-basis', value, '');
-  }
-
-  /** Gets the value of "flex-direction" */
-  String get flexDirection => getPropertyValue('flex-direction');
-
-  /** Sets the value of "flex-direction" */
-  set flexDirection(String value) {
-    setProperty('flex-direction', value, '');
-  }
-
-  /** Gets the value of "flex-flow" */
-  String get flexFlow => getPropertyValue('flex-flow');
-
-  /** Sets the value of "flex-flow" */
-  set flexFlow(String value) {
-    setProperty('flex-flow', value, '');
-  }
-
-  /** Gets the value of "flex-grow" */
-  String get flexGrow => getPropertyValue('flex-grow');
-
-  /** Sets the value of "flex-grow" */
-  set flexGrow(String value) {
-    setProperty('flex-grow', value, '');
-  }
-
-  /** Gets the value of "flex-shrink" */
-  String get flexShrink => getPropertyValue('flex-shrink');
-
-  /** Sets the value of "flex-shrink" */
-  set flexShrink(String value) {
-    setProperty('flex-shrink', value, '');
-  }
-
-  /** Gets the value of "flex-wrap" */
-  String get flexWrap => getPropertyValue('flex-wrap');
-
-  /** Sets the value of "flex-wrap" */
-  set flexWrap(String value) {
-    setProperty('flex-wrap', value, '');
-  }
-
-  /** Gets the value of "float" */
-  String get float => getPropertyValue('float');
-
-  /** Sets the value of "float" */
-  set float(String value) {
-    setProperty('float', value, '');
-  }
-
-  /** Gets the value of "font" */
-  String get font => getPropertyValue('font');
-
-  /** Sets the value of "font" */
-  set font(String value) {
-    setProperty('font', value, '');
-  }
-
-  /** Gets the value of "font-family" */
-  String get fontFamily => getPropertyValue('font-family');
-
-  /** Sets the value of "font-family" */
-  set fontFamily(String value) {
-    setProperty('font-family', value, '');
-  }
-
-  /** Gets the value of "font-feature-settings" */
-  String get fontFeatureSettings => getPropertyValue('font-feature-settings');
-
-  /** Sets the value of "font-feature-settings" */
-  set fontFeatureSettings(String value) {
-    setProperty('font-feature-settings', value, '');
-  }
-
-  /** Gets the value of "font-kerning" */
-  String get fontKerning => getPropertyValue('font-kerning');
-
-  /** Sets the value of "font-kerning" */
-  set fontKerning(String value) {
-    setProperty('font-kerning', value, '');
-  }
-
-  /** Gets the value of "font-size" */
-  String get fontSize => getPropertyValue('font-size');
-
-  /** Sets the value of "font-size" */
-  set fontSize(String value) {
-    setProperty('font-size', value, '');
-  }
-
-  /** Gets the value of "font-size-delta" */
-  String get fontSizeDelta => getPropertyValue('font-size-delta');
-
-  /** Sets the value of "font-size-delta" */
-  set fontSizeDelta(String value) {
-    setProperty('font-size-delta', value, '');
-  }
-
-  /** Gets the value of "font-smoothing" */
-  String get fontSmoothing => getPropertyValue('font-smoothing');
-
-  /** Sets the value of "font-smoothing" */
-  set fontSmoothing(String value) {
-    setProperty('font-smoothing', value, '');
-  }
-
-  /** Gets the value of "font-stretch" */
-  String get fontStretch => getPropertyValue('font-stretch');
-
-  /** Sets the value of "font-stretch" */
-  set fontStretch(String value) {
-    setProperty('font-stretch', value, '');
-  }
-
-  /** Gets the value of "font-style" */
-  String get fontStyle => getPropertyValue('font-style');
-
-  /** Sets the value of "font-style" */
-  set fontStyle(String value) {
-    setProperty('font-style', value, '');
-  }
-
-  /** Gets the value of "font-variant" */
-  String get fontVariant => getPropertyValue('font-variant');
-
-  /** Sets the value of "font-variant" */
-  set fontVariant(String value) {
-    setProperty('font-variant', value, '');
-  }
-
-  /** Gets the value of "font-variant-ligatures" */
-  String get fontVariantLigatures => getPropertyValue('font-variant-ligatures');
-
-  /** Sets the value of "font-variant-ligatures" */
-  set fontVariantLigatures(String value) {
-    setProperty('font-variant-ligatures', value, '');
-  }
-
-  /** Gets the value of "font-weight" */
-  String get fontWeight => getPropertyValue('font-weight');
-
-  /** Sets the value of "font-weight" */
-  set fontWeight(String value) {
-    setProperty('font-weight', value, '');
-  }
-
-  /** Gets the value of "grid" */
-  String get grid => getPropertyValue('grid');
-
-  /** Sets the value of "grid" */
-  set grid(String value) {
-    setProperty('grid', value, '');
-  }
-
-  /** Gets the value of "grid-area" */
-  String get gridArea => getPropertyValue('grid-area');
-
-  /** Sets the value of "grid-area" */
-  set gridArea(String value) {
-    setProperty('grid-area', value, '');
-  }
-
-  /** Gets the value of "grid-auto-columns" */
-  String get gridAutoColumns => getPropertyValue('grid-auto-columns');
-
-  /** Sets the value of "grid-auto-columns" */
-  set gridAutoColumns(String value) {
-    setProperty('grid-auto-columns', value, '');
-  }
-
-  /** Gets the value of "grid-auto-flow" */
-  String get gridAutoFlow => getPropertyValue('grid-auto-flow');
-
-  /** Sets the value of "grid-auto-flow" */
-  set gridAutoFlow(String value) {
-    setProperty('grid-auto-flow', value, '');
-  }
-
-  /** Gets the value of "grid-auto-rows" */
-  String get gridAutoRows => getPropertyValue('grid-auto-rows');
-
-  /** Sets the value of "grid-auto-rows" */
-  set gridAutoRows(String value) {
-    setProperty('grid-auto-rows', value, '');
-  }
-
-  /** Gets the value of "grid-column" */
-  String get gridColumn => getPropertyValue('grid-column');
-
-  /** Sets the value of "grid-column" */
-  set gridColumn(String value) {
-    setProperty('grid-column', value, '');
-  }
-
-  /** Gets the value of "grid-column-end" */
-  String get gridColumnEnd => getPropertyValue('grid-column-end');
-
-  /** Sets the value of "grid-column-end" */
-  set gridColumnEnd(String value) {
-    setProperty('grid-column-end', value, '');
-  }
-
-  /** Gets the value of "grid-column-start" */
-  String get gridColumnStart => getPropertyValue('grid-column-start');
-
-  /** Sets the value of "grid-column-start" */
-  set gridColumnStart(String value) {
-    setProperty('grid-column-start', value, '');
-  }
-
-  /** Gets the value of "grid-row" */
-  String get gridRow => getPropertyValue('grid-row');
-
-  /** Sets the value of "grid-row" */
-  set gridRow(String value) {
-    setProperty('grid-row', value, '');
-  }
-
-  /** Gets the value of "grid-row-end" */
-  String get gridRowEnd => getPropertyValue('grid-row-end');
-
-  /** Sets the value of "grid-row-end" */
-  set gridRowEnd(String value) {
-    setProperty('grid-row-end', value, '');
-  }
-
-  /** Gets the value of "grid-row-start" */
-  String get gridRowStart => getPropertyValue('grid-row-start');
-
-  /** Sets the value of "grid-row-start" */
-  set gridRowStart(String value) {
-    setProperty('grid-row-start', value, '');
-  }
-
-  /** Gets the value of "grid-template" */
-  String get gridTemplate => getPropertyValue('grid-template');
-
-  /** Sets the value of "grid-template" */
-  set gridTemplate(String value) {
-    setProperty('grid-template', value, '');
-  }
-
-  /** Gets the value of "grid-template-areas" */
-  String get gridTemplateAreas => getPropertyValue('grid-template-areas');
-
-  /** Sets the value of "grid-template-areas" */
-  set gridTemplateAreas(String value) {
-    setProperty('grid-template-areas', value, '');
-  }
-
-  /** Gets the value of "grid-template-columns" */
-  String get gridTemplateColumns => getPropertyValue('grid-template-columns');
-
-  /** Sets the value of "grid-template-columns" */
-  set gridTemplateColumns(String value) {
-    setProperty('grid-template-columns', value, '');
-  }
-
-  /** Gets the value of "grid-template-rows" */
-  String get gridTemplateRows => getPropertyValue('grid-template-rows');
-
-  /** Sets the value of "grid-template-rows" */
-  set gridTemplateRows(String value) {
-    setProperty('grid-template-rows', value, '');
-  }
-
-  /** Gets the value of "height" */
-  String get height => getPropertyValue('height');
-
-  /** Sets the value of "height" */
-  set height(String value) {
-    setProperty('height', value, '');
-  }
-
-  /** Gets the value of "highlight" */
-  String get highlight => getPropertyValue('highlight');
-
-  /** Sets the value of "highlight" */
-  set highlight(String value) {
-    setProperty('highlight', value, '');
-  }
-
-  /** Gets the value of "hyphenate-character" */
-  String get hyphenateCharacter => getPropertyValue('hyphenate-character');
-
-  /** Sets the value of "hyphenate-character" */
-  set hyphenateCharacter(String value) {
-    setProperty('hyphenate-character', value, '');
-  }
-
-  /** Gets the value of "image-rendering" */
-  String get imageRendering => getPropertyValue('image-rendering');
-
-  /** Sets the value of "image-rendering" */
-  set imageRendering(String value) {
-    setProperty('image-rendering', value, '');
-  }
-
-  /** Gets the value of "isolation" */
-  String get isolation => getPropertyValue('isolation');
-
-  /** Sets the value of "isolation" */
-  set isolation(String value) {
-    setProperty('isolation', value, '');
-  }
-
-  /** Gets the value of "justify-content" */
-  String get justifyContent => getPropertyValue('justify-content');
-
-  /** Sets the value of "justify-content" */
-  set justifyContent(String value) {
-    setProperty('justify-content', value, '');
-  }
-
-  /** Gets the value of "justify-self" */
-  String get justifySelf => getPropertyValue('justify-self');
-
-  /** Sets the value of "justify-self" */
-  set justifySelf(String value) {
-    setProperty('justify-self', value, '');
-  }
-
-  /** Gets the value of "left" */
-  String get left => getPropertyValue('left');
-
-  /** Sets the value of "left" */
-  set left(String value) {
-    setProperty('left', value, '');
-  }
-
-  /** Gets the value of "letter-spacing" */
-  String get letterSpacing => getPropertyValue('letter-spacing');
-
-  /** Sets the value of "letter-spacing" */
-  set letterSpacing(String value) {
-    setProperty('letter-spacing', value, '');
-  }
-
-  /** Gets the value of "line-box-contain" */
-  String get lineBoxContain => getPropertyValue('line-box-contain');
-
-  /** Sets the value of "line-box-contain" */
-  set lineBoxContain(String value) {
-    setProperty('line-box-contain', value, '');
-  }
-
-  /** Gets the value of "line-break" */
-  String get lineBreak => getPropertyValue('line-break');
-
-  /** Sets the value of "line-break" */
-  set lineBreak(String value) {
-    setProperty('line-break', value, '');
-  }
-
-  /** Gets the value of "line-clamp" */
-  String get lineClamp => getPropertyValue('line-clamp');
-
-  /** Sets the value of "line-clamp" */
-  set lineClamp(String value) {
-    setProperty('line-clamp', value, '');
-  }
-
-  /** Gets the value of "line-height" */
-  String get lineHeight => getPropertyValue('line-height');
-
-  /** Sets the value of "line-height" */
-  set lineHeight(String value) {
-    setProperty('line-height', value, '');
-  }
-
-  /** Gets the value of "list-style" */
-  String get listStyle => getPropertyValue('list-style');
-
-  /** Sets the value of "list-style" */
-  set listStyle(String value) {
-    setProperty('list-style', value, '');
-  }
-
-  /** Gets the value of "list-style-image" */
-  String get listStyleImage => getPropertyValue('list-style-image');
-
-  /** Sets the value of "list-style-image" */
-  set listStyleImage(String value) {
-    setProperty('list-style-image', value, '');
-  }
-
-  /** Gets the value of "list-style-position" */
-  String get listStylePosition => getPropertyValue('list-style-position');
-
-  /** Sets the value of "list-style-position" */
-  set listStylePosition(String value) {
-    setProperty('list-style-position', value, '');
-  }
-
-  /** Gets the value of "list-style-type" */
-  String get listStyleType => getPropertyValue('list-style-type');
-
-  /** Sets the value of "list-style-type" */
-  set listStyleType(String value) {
-    setProperty('list-style-type', value, '');
-  }
-
-  /** Gets the value of "locale" */
-  String get locale => getPropertyValue('locale');
-
-  /** Sets the value of "locale" */
-  set locale(String value) {
-    setProperty('locale', value, '');
-  }
-
-  /** Gets the value of "logical-height" */
-  String get logicalHeight => getPropertyValue('logical-height');
-
-  /** Sets the value of "logical-height" */
-  set logicalHeight(String value) {
-    setProperty('logical-height', value, '');
-  }
-
-  /** Gets the value of "logical-width" */
-  String get logicalWidth => getPropertyValue('logical-width');
-
-  /** Sets the value of "logical-width" */
-  set logicalWidth(String value) {
-    setProperty('logical-width', value, '');
-  }
-
-  /** Gets the value of "margin" */
-  String get margin => getPropertyValue('margin');
-
-  /** Sets the value of "margin" */
-  set margin(String value) {
-    setProperty('margin', value, '');
-  }
-
-  /** Gets the value of "margin-after" */
-  String get marginAfter => getPropertyValue('margin-after');
-
-  /** Sets the value of "margin-after" */
-  set marginAfter(String value) {
-    setProperty('margin-after', value, '');
-  }
-
-  /** Gets the value of "margin-after-collapse" */
-  String get marginAfterCollapse => getPropertyValue('margin-after-collapse');
-
-  /** Sets the value of "margin-after-collapse" */
-  set marginAfterCollapse(String value) {
-    setProperty('margin-after-collapse', value, '');
-  }
-
-  /** Gets the value of "margin-before" */
-  String get marginBefore => getPropertyValue('margin-before');
-
-  /** Sets the value of "margin-before" */
-  set marginBefore(String value) {
-    setProperty('margin-before', value, '');
-  }
-
-  /** Gets the value of "margin-before-collapse" */
-  String get marginBeforeCollapse => getPropertyValue('margin-before-collapse');
-
-  /** Sets the value of "margin-before-collapse" */
-  set marginBeforeCollapse(String value) {
-    setProperty('margin-before-collapse', value, '');
-  }
-
-  /** Gets the value of "margin-bottom" */
-  String get marginBottom => getPropertyValue('margin-bottom');
-
-  /** Sets the value of "margin-bottom" */
-  set marginBottom(String value) {
-    setProperty('margin-bottom', value, '');
-  }
-
-  /** Gets the value of "margin-bottom-collapse" */
-  String get marginBottomCollapse => getPropertyValue('margin-bottom-collapse');
-
-  /** Sets the value of "margin-bottom-collapse" */
-  set marginBottomCollapse(String value) {
-    setProperty('margin-bottom-collapse', value, '');
-  }
-
-  /** Gets the value of "margin-collapse" */
-  String get marginCollapse => getPropertyValue('margin-collapse');
-
-  /** Sets the value of "margin-collapse" */
-  set marginCollapse(String value) {
-    setProperty('margin-collapse', value, '');
-  }
-
-  /** Gets the value of "margin-end" */
-  String get marginEnd => getPropertyValue('margin-end');
-
-  /** Sets the value of "margin-end" */
-  set marginEnd(String value) {
-    setProperty('margin-end', value, '');
-  }
-
-  /** Gets the value of "margin-left" */
-  String get marginLeft => getPropertyValue('margin-left');
-
-  /** Sets the value of "margin-left" */
-  set marginLeft(String value) {
-    setProperty('margin-left', value, '');
-  }
-
-  /** Gets the value of "margin-right" */
-  String get marginRight => getPropertyValue('margin-right');
-
-  /** Sets the value of "margin-right" */
-  set marginRight(String value) {
-    setProperty('margin-right', value, '');
-  }
-
-  /** Gets the value of "margin-start" */
-  String get marginStart => getPropertyValue('margin-start');
-
-  /** Sets the value of "margin-start" */
-  set marginStart(String value) {
-    setProperty('margin-start', value, '');
-  }
-
-  /** Gets the value of "margin-top" */
-  String get marginTop => getPropertyValue('margin-top');
-
-  /** Sets the value of "margin-top" */
-  set marginTop(String value) {
-    setProperty('margin-top', value, '');
-  }
-
-  /** Gets the value of "margin-top-collapse" */
-  String get marginTopCollapse => getPropertyValue('margin-top-collapse');
-
-  /** Sets the value of "margin-top-collapse" */
-  set marginTopCollapse(String value) {
-    setProperty('margin-top-collapse', value, '');
-  }
-
-  /** Gets the value of "mask" */
-  String get mask => getPropertyValue('mask');
-
-  /** Sets the value of "mask" */
-  set mask(String value) {
-    setProperty('mask', value, '');
-  }
-
-  /** Gets the value of "mask-box-image" */
-  String get maskBoxImage => getPropertyValue('mask-box-image');
-
-  /** Sets the value of "mask-box-image" */
-  set maskBoxImage(String value) {
-    setProperty('mask-box-image', value, '');
-  }
-
-  /** Gets the value of "mask-box-image-outset" */
-  String get maskBoxImageOutset => getPropertyValue('mask-box-image-outset');
-
-  /** Sets the value of "mask-box-image-outset" */
-  set maskBoxImageOutset(String value) {
-    setProperty('mask-box-image-outset', value, '');
-  }
-
-  /** Gets the value of "mask-box-image-repeat" */
-  String get maskBoxImageRepeat => getPropertyValue('mask-box-image-repeat');
-
-  /** Sets the value of "mask-box-image-repeat" */
-  set maskBoxImageRepeat(String value) {
-    setProperty('mask-box-image-repeat', value, '');
-  }
-
-  /** Gets the value of "mask-box-image-slice" */
-  String get maskBoxImageSlice => getPropertyValue('mask-box-image-slice');
-
-  /** Sets the value of "mask-box-image-slice" */
-  set maskBoxImageSlice(String value) {
-    setProperty('mask-box-image-slice', value, '');
-  }
-
-  /** Gets the value of "mask-box-image-source" */
-  String get maskBoxImageSource => getPropertyValue('mask-box-image-source');
-
-  /** Sets the value of "mask-box-image-source" */
-  set maskBoxImageSource(String value) {
-    setProperty('mask-box-image-source', value, '');
-  }
-
-  /** Gets the value of "mask-box-image-width" */
-  String get maskBoxImageWidth => getPropertyValue('mask-box-image-width');
-
-  /** Sets the value of "mask-box-image-width" */
-  set maskBoxImageWidth(String value) {
-    setProperty('mask-box-image-width', value, '');
-  }
-
-  /** Gets the value of "mask-clip" */
-  String get maskClip => getPropertyValue('mask-clip');
-
-  /** Sets the value of "mask-clip" */
-  set maskClip(String value) {
-    setProperty('mask-clip', value, '');
-  }
-
-  /** Gets the value of "mask-composite" */
-  String get maskComposite => getPropertyValue('mask-composite');
-
-  /** Sets the value of "mask-composite" */
-  set maskComposite(String value) {
-    setProperty('mask-composite', value, '');
-  }
-
-  /** Gets the value of "mask-image" */
-  String get maskImage => getPropertyValue('mask-image');
-
-  /** Sets the value of "mask-image" */
-  set maskImage(String value) {
-    setProperty('mask-image', value, '');
-  }
-
-  /** Gets the value of "mask-origin" */
-  String get maskOrigin => getPropertyValue('mask-origin');
-
-  /** Sets the value of "mask-origin" */
-  set maskOrigin(String value) {
-    setProperty('mask-origin', value, '');
-  }
-
-  /** Gets the value of "mask-position" */
-  String get maskPosition => getPropertyValue('mask-position');
-
-  /** Sets the value of "mask-position" */
-  set maskPosition(String value) {
-    setProperty('mask-position', value, '');
-  }
-
-  /** Gets the value of "mask-position-x" */
-  String get maskPositionX => getPropertyValue('mask-position-x');
-
-  /** Sets the value of "mask-position-x" */
-  set maskPositionX(String value) {
-    setProperty('mask-position-x', value, '');
-  }
-
-  /** Gets the value of "mask-position-y" */
-  String get maskPositionY => getPropertyValue('mask-position-y');
-
-  /** Sets the value of "mask-position-y" */
-  set maskPositionY(String value) {
-    setProperty('mask-position-y', value, '');
-  }
-
-  /** Gets the value of "mask-repeat" */
-  String get maskRepeat => getPropertyValue('mask-repeat');
-
-  /** Sets the value of "mask-repeat" */
-  set maskRepeat(String value) {
-    setProperty('mask-repeat', value, '');
-  }
-
-  /** Gets the value of "mask-repeat-x" */
-  String get maskRepeatX => getPropertyValue('mask-repeat-x');
-
-  /** Sets the value of "mask-repeat-x" */
-  set maskRepeatX(String value) {
-    setProperty('mask-repeat-x', value, '');
-  }
-
-  /** Gets the value of "mask-repeat-y" */
-  String get maskRepeatY => getPropertyValue('mask-repeat-y');
-
-  /** Sets the value of "mask-repeat-y" */
-  set maskRepeatY(String value) {
-    setProperty('mask-repeat-y', value, '');
-  }
-
-  /** Gets the value of "mask-size" */
-  String get maskSize => getPropertyValue('mask-size');
-
-  /** Sets the value of "mask-size" */
-  set maskSize(String value) {
-    setProperty('mask-size', value, '');
-  }
-
-  /** Gets the value of "mask-source-type" */
-  String get maskSourceType => getPropertyValue('mask-source-type');
-
-  /** Sets the value of "mask-source-type" */
-  set maskSourceType(String value) {
-    setProperty('mask-source-type', value, '');
-  }
-
-  /** Gets the value of "max-height" */
-  String get maxHeight => getPropertyValue('max-height');
-
-  /** Sets the value of "max-height" */
-  set maxHeight(String value) {
-    setProperty('max-height', value, '');
-  }
-
-  /** Gets the value of "max-logical-height" */
-  String get maxLogicalHeight => getPropertyValue('max-logical-height');
-
-  /** Sets the value of "max-logical-height" */
-  set maxLogicalHeight(String value) {
-    setProperty('max-logical-height', value, '');
-  }
-
-  /** Gets the value of "max-logical-width" */
-  String get maxLogicalWidth => getPropertyValue('max-logical-width');
-
-  /** Sets the value of "max-logical-width" */
-  set maxLogicalWidth(String value) {
-    setProperty('max-logical-width', value, '');
-  }
-
-  /** Gets the value of "max-width" */
-  String get maxWidth => getPropertyValue('max-width');
-
-  /** Sets the value of "max-width" */
-  set maxWidth(String value) {
-    setProperty('max-width', value, '');
-  }
-
-  /** Gets the value of "max-zoom" */
-  String get maxZoom => getPropertyValue('max-zoom');
-
-  /** Sets the value of "max-zoom" */
-  set maxZoom(String value) {
-    setProperty('max-zoom', value, '');
-  }
-
-  /** Gets the value of "min-height" */
-  String get minHeight => getPropertyValue('min-height');
-
-  /** Sets the value of "min-height" */
-  set minHeight(String value) {
-    setProperty('min-height', value, '');
-  }
-
-  /** Gets the value of "min-logical-height" */
-  String get minLogicalHeight => getPropertyValue('min-logical-height');
-
-  /** Sets the value of "min-logical-height" */
-  set minLogicalHeight(String value) {
-    setProperty('min-logical-height', value, '');
-  }
-
-  /** Gets the value of "min-logical-width" */
-  String get minLogicalWidth => getPropertyValue('min-logical-width');
-
-  /** Sets the value of "min-logical-width" */
-  set minLogicalWidth(String value) {
-    setProperty('min-logical-width', value, '');
-  }
-
-  /** Gets the value of "min-width" */
-  String get minWidth => getPropertyValue('min-width');
-
-  /** Sets the value of "min-width" */
-  set minWidth(String value) {
-    setProperty('min-width', value, '');
-  }
-
-  /** Gets the value of "min-zoom" */
-  String get minZoom => getPropertyValue('min-zoom');
-
-  /** Sets the value of "min-zoom" */
-  set minZoom(String value) {
-    setProperty('min-zoom', value, '');
-  }
-
-  /** Gets the value of "mix-blend-mode" */
-  String get mixBlendMode => getPropertyValue('mix-blend-mode');
-
-  /** Sets the value of "mix-blend-mode" */
-  set mixBlendMode(String value) {
-    setProperty('mix-blend-mode', value, '');
-  }
-
-  /** Gets the value of "object-fit" */
-  String get objectFit => getPropertyValue('object-fit');
-
-  /** Sets the value of "object-fit" */
-  set objectFit(String value) {
-    setProperty('object-fit', value, '');
-  }
-
-  /** Gets the value of "object-position" */
-  String get objectPosition => getPropertyValue('object-position');
-
-  /** Sets the value of "object-position" */
-  set objectPosition(String value) {
-    setProperty('object-position', value, '');
-  }
-
-  /** Gets the value of "opacity" */
-  String get opacity => getPropertyValue('opacity');
-
-  /** Sets the value of "opacity" */
-  set opacity(String value) {
-    setProperty('opacity', value, '');
-  }
-
-  /** Gets the value of "order" */
-  String get order => getPropertyValue('order');
-
-  /** Sets the value of "order" */
-  set order(String value) {
-    setProperty('order', value, '');
-  }
-
-  /** Gets the value of "orientation" */
-  String get orientation => getPropertyValue('orientation');
-
-  /** Sets the value of "orientation" */
-  set orientation(String value) {
-    setProperty('orientation', value, '');
-  }
-
-  /** Gets the value of "orphans" */
-  String get orphans => getPropertyValue('orphans');
-
-  /** Sets the value of "orphans" */
-  set orphans(String value) {
-    setProperty('orphans', value, '');
-  }
-
-  /** Gets the value of "outline" */
-  String get outline => getPropertyValue('outline');
-
-  /** Sets the value of "outline" */
-  set outline(String value) {
-    setProperty('outline', value, '');
-  }
-
-  /** Gets the value of "outline-color" */
-  String get outlineColor => getPropertyValue('outline-color');
-
-  /** Sets the value of "outline-color" */
-  set outlineColor(String value) {
-    setProperty('outline-color', value, '');
-  }
-
-  /** Gets the value of "outline-offset" */
-  String get outlineOffset => getPropertyValue('outline-offset');
-
-  /** Sets the value of "outline-offset" */
-  set outlineOffset(String value) {
-    setProperty('outline-offset', value, '');
-  }
-
-  /** Gets the value of "outline-style" */
-  String get outlineStyle => getPropertyValue('outline-style');
-
-  /** Sets the value of "outline-style" */
-  set outlineStyle(String value) {
-    setProperty('outline-style', value, '');
-  }
-
-  /** Gets the value of "outline-width" */
-  String get outlineWidth => getPropertyValue('outline-width');
-
-  /** Sets the value of "outline-width" */
-  set outlineWidth(String value) {
-    setProperty('outline-width', value, '');
-  }
-
-  /** Gets the value of "overflow" */
-  String get overflow => getPropertyValue('overflow');
-
-  /** Sets the value of "overflow" */
-  set overflow(String value) {
-    setProperty('overflow', value, '');
-  }
-
-  /** Gets the value of "overflow-wrap" */
-  String get overflowWrap => getPropertyValue('overflow-wrap');
-
-  /** Sets the value of "overflow-wrap" */
-  set overflowWrap(String value) {
-    setProperty('overflow-wrap', value, '');
-  }
-
-  /** Gets the value of "overflow-x" */
-  String get overflowX => getPropertyValue('overflow-x');
-
-  /** Sets the value of "overflow-x" */
-  set overflowX(String value) {
-    setProperty('overflow-x', value, '');
-  }
-
-  /** Gets the value of "overflow-y" */
-  String get overflowY => getPropertyValue('overflow-y');
-
-  /** Sets the value of "overflow-y" */
-  set overflowY(String value) {
-    setProperty('overflow-y', value, '');
-  }
-
-  /** Gets the value of "padding" */
-  String get padding => getPropertyValue('padding');
-
-  /** Sets the value of "padding" */
-  set padding(String value) {
-    setProperty('padding', value, '');
-  }
-
-  /** Gets the value of "padding-after" */
-  String get paddingAfter => getPropertyValue('padding-after');
-
-  /** Sets the value of "padding-after" */
-  set paddingAfter(String value) {
-    setProperty('padding-after', value, '');
-  }
-
-  /** Gets the value of "padding-before" */
-  String get paddingBefore => getPropertyValue('padding-before');
-
-  /** Sets the value of "padding-before" */
-  set paddingBefore(String value) {
-    setProperty('padding-before', value, '');
-  }
-
-  /** Gets the value of "padding-bottom" */
-  String get paddingBottom => getPropertyValue('padding-bottom');
-
-  /** Sets the value of "padding-bottom" */
-  set paddingBottom(String value) {
-    setProperty('padding-bottom', value, '');
-  }
-
-  /** Gets the value of "padding-end" */
-  String get paddingEnd => getPropertyValue('padding-end');
-
-  /** Sets the value of "padding-end" */
-  set paddingEnd(String value) {
-    setProperty('padding-end', value, '');
-  }
-
-  /** Gets the value of "padding-left" */
-  String get paddingLeft => getPropertyValue('padding-left');
-
-  /** Sets the value of "padding-left" */
-  set paddingLeft(String value) {
-    setProperty('padding-left', value, '');
-  }
-
-  /** Gets the value of "padding-right" */
-  String get paddingRight => getPropertyValue('padding-right');
-
-  /** Sets the value of "padding-right" */
-  set paddingRight(String value) {
-    setProperty('padding-right', value, '');
-  }
-
-  /** Gets the value of "padding-start" */
-  String get paddingStart => getPropertyValue('padding-start');
-
-  /** Sets the value of "padding-start" */
-  set paddingStart(String value) {
-    setProperty('padding-start', value, '');
-  }
-
-  /** Gets the value of "padding-top" */
-  String get paddingTop => getPropertyValue('padding-top');
-
-  /** Sets the value of "padding-top" */
-  set paddingTop(String value) {
-    setProperty('padding-top', value, '');
-  }
-
-  /** Gets the value of "page" */
-  String get page => getPropertyValue('page');
-
-  /** Sets the value of "page" */
-  set page(String value) {
-    setProperty('page', value, '');
-  }
-
-  /** Gets the value of "page-break-after" */
-  String get pageBreakAfter => getPropertyValue('page-break-after');
-
-  /** Sets the value of "page-break-after" */
-  set pageBreakAfter(String value) {
-    setProperty('page-break-after', value, '');
-  }
-
-  /** Gets the value of "page-break-before" */
-  String get pageBreakBefore => getPropertyValue('page-break-before');
-
-  /** Sets the value of "page-break-before" */
-  set pageBreakBefore(String value) {
-    setProperty('page-break-before', value, '');
-  }
-
-  /** Gets the value of "page-break-inside" */
-  String get pageBreakInside => getPropertyValue('page-break-inside');
-
-  /** Sets the value of "page-break-inside" */
-  set pageBreakInside(String value) {
-    setProperty('page-break-inside', value, '');
-  }
-
-  /** Gets the value of "perspective" */
-  String get perspective => getPropertyValue('perspective');
-
-  /** Sets the value of "perspective" */
-  set perspective(String value) {
-    setProperty('perspective', value, '');
-  }
-
-  /** Gets the value of "perspective-origin" */
-  String get perspectiveOrigin => getPropertyValue('perspective-origin');
-
-  /** Sets the value of "perspective-origin" */
-  set perspectiveOrigin(String value) {
-    setProperty('perspective-origin', value, '');
-  }
-
-  /** Gets the value of "perspective-origin-x" */
-  String get perspectiveOriginX => getPropertyValue('perspective-origin-x');
-
-  /** Sets the value of "perspective-origin-x" */
-  set perspectiveOriginX(String value) {
-    setProperty('perspective-origin-x', value, '');
-  }
-
-  /** Gets the value of "perspective-origin-y" */
-  String get perspectiveOriginY => getPropertyValue('perspective-origin-y');
-
-  /** Sets the value of "perspective-origin-y" */
-  set perspectiveOriginY(String value) {
-    setProperty('perspective-origin-y', value, '');
-  }
-
-  /** Gets the value of "pointer-events" */
-  String get pointerEvents => getPropertyValue('pointer-events');
-
-  /** Sets the value of "pointer-events" */
-  set pointerEvents(String value) {
-    setProperty('pointer-events', value, '');
-  }
-
-  /** Gets the value of "position" */
-  String get position => getPropertyValue('position');
-
-  /** Sets the value of "position" */
-  set position(String value) {
-    setProperty('position', value, '');
-  }
-
-  /** Gets the value of "print-color-adjust" */
-  String get printColorAdjust => getPropertyValue('print-color-adjust');
-
-  /** Sets the value of "print-color-adjust" */
-  set printColorAdjust(String value) {
-    setProperty('print-color-adjust', value, '');
-  }
-
-  /** Gets the value of "quotes" */
-  String get quotes => getPropertyValue('quotes');
-
-  /** Sets the value of "quotes" */
-  set quotes(String value) {
-    setProperty('quotes', value, '');
-  }
-
-  /** Gets the value of "resize" */
-  String get resize => getPropertyValue('resize');
-
-  /** Sets the value of "resize" */
-  set resize(String value) {
-    setProperty('resize', value, '');
-  }
-
-  /** Gets the value of "right" */
-  String get right => getPropertyValue('right');
-
-  /** Sets the value of "right" */
-  set right(String value) {
-    setProperty('right', value, '');
-  }
-
-  /** Gets the value of "rtl-ordering" */
-  String get rtlOrdering => getPropertyValue('rtl-ordering');
-
-  /** Sets the value of "rtl-ordering" */
-  set rtlOrdering(String value) {
-    setProperty('rtl-ordering', value, '');
-  }
-
-  /** Gets the value of "ruby-position" */
-  String get rubyPosition => getPropertyValue('ruby-position');
-
-  /** Sets the value of "ruby-position" */
-  set rubyPosition(String value) {
-    setProperty('ruby-position', value, '');
-  }
-
-  /** Gets the value of "scroll-behavior" */
-  String get scrollBehavior => getPropertyValue('scroll-behavior');
-
-  /** Sets the value of "scroll-behavior" */
-  set scrollBehavior(String value) {
-    setProperty('scroll-behavior', value, '');
-  }
-
-  /** Gets the value of "shape-image-threshold" */
-  String get shapeImageThreshold => getPropertyValue('shape-image-threshold');
-
-  /** Sets the value of "shape-image-threshold" */
-  set shapeImageThreshold(String value) {
-    setProperty('shape-image-threshold', value, '');
-  }
-
-  /** Gets the value of "shape-margin" */
-  String get shapeMargin => getPropertyValue('shape-margin');
-
-  /** Sets the value of "shape-margin" */
-  set shapeMargin(String value) {
-    setProperty('shape-margin', value, '');
-  }
-
-  /** Gets the value of "shape-outside" */
-  String get shapeOutside => getPropertyValue('shape-outside');
-
-  /** Sets the value of "shape-outside" */
-  set shapeOutside(String value) {
-    setProperty('shape-outside', value, '');
-  }
-
-  /** Gets the value of "size" */
-  String get size => getPropertyValue('size');
-
-  /** Sets the value of "size" */
-  set size(String value) {
-    setProperty('size', value, '');
-  }
-
-  /** Gets the value of "speak" */
-  String get speak => getPropertyValue('speak');
-
-  /** Sets the value of "speak" */
-  set speak(String value) {
-    setProperty('speak', value, '');
-  }
-
-  /** Gets the value of "src" */
-  String get src => getPropertyValue('src');
-
-  /** Sets the value of "src" */
-  set src(String value) {
-    setProperty('src', value, '');
-  }
-
-  /** Gets the value of "tab-size" */
-  String get tabSize => getPropertyValue('tab-size');
-
-  /** Sets the value of "tab-size" */
-  set tabSize(String value) {
-    setProperty('tab-size', value, '');
-  }
-
-  /** Gets the value of "table-layout" */
-  String get tableLayout => getPropertyValue('table-layout');
-
-  /** Sets the value of "table-layout" */
-  set tableLayout(String value) {
-    setProperty('table-layout', value, '');
-  }
-
-  /** Gets the value of "tap-highlight-color" */
-  String get tapHighlightColor => getPropertyValue('tap-highlight-color');
-
-  /** Sets the value of "tap-highlight-color" */
-  set tapHighlightColor(String value) {
-    setProperty('tap-highlight-color', value, '');
-  }
-
-  /** Gets the value of "text-align" */
-  String get textAlign => getPropertyValue('text-align');
-
-  /** Sets the value of "text-align" */
-  set textAlign(String value) {
-    setProperty('text-align', value, '');
-  }
-
-  /** Gets the value of "text-align-last" */
-  String get textAlignLast => getPropertyValue('text-align-last');
-
-  /** Sets the value of "text-align-last" */
-  set textAlignLast(String value) {
-    setProperty('text-align-last', value, '');
-  }
-
-  /** Gets the value of "text-combine" */
-  String get textCombine => getPropertyValue('text-combine');
-
-  /** Sets the value of "text-combine" */
-  set textCombine(String value) {
-    setProperty('text-combine', value, '');
-  }
-
-  /** Gets the value of "text-decoration" */
-  String get textDecoration => getPropertyValue('text-decoration');
-
-  /** Sets the value of "text-decoration" */
-  set textDecoration(String value) {
-    setProperty('text-decoration', value, '');
-  }
-
-  /** Gets the value of "text-decoration-color" */
-  String get textDecorationColor => getPropertyValue('text-decoration-color');
-
-  /** Sets the value of "text-decoration-color" */
-  set textDecorationColor(String value) {
-    setProperty('text-decoration-color', value, '');
-  }
-
-  /** Gets the value of "text-decoration-line" */
-  String get textDecorationLine => getPropertyValue('text-decoration-line');
-
-  /** Sets the value of "text-decoration-line" */
-  set textDecorationLine(String value) {
-    setProperty('text-decoration-line', value, '');
-  }
-
-  /** Gets the value of "text-decoration-style" */
-  String get textDecorationStyle => getPropertyValue('text-decoration-style');
-
-  /** Sets the value of "text-decoration-style" */
-  set textDecorationStyle(String value) {
-    setProperty('text-decoration-style', value, '');
-  }
-
-  /** Gets the value of "text-decorations-in-effect" */
-  String get textDecorationsInEffect =>
-      getPropertyValue('text-decorations-in-effect');
-
-  /** Sets the value of "text-decorations-in-effect" */
-  set textDecorationsInEffect(String value) {
-    setProperty('text-decorations-in-effect', value, '');
-  }
-
-  /** Gets the value of "text-emphasis" */
-  String get textEmphasis => getPropertyValue('text-emphasis');
-
-  /** Sets the value of "text-emphasis" */
-  set textEmphasis(String value) {
-    setProperty('text-emphasis', value, '');
-  }
-
-  /** Gets the value of "text-emphasis-color" */
-  String get textEmphasisColor => getPropertyValue('text-emphasis-color');
-
-  /** Sets the value of "text-emphasis-color" */
-  set textEmphasisColor(String value) {
-    setProperty('text-emphasis-color', value, '');
-  }
-
-  /** Gets the value of "text-emphasis-position" */
-  String get textEmphasisPosition => getPropertyValue('text-emphasis-position');
-
-  /** Sets the value of "text-emphasis-position" */
-  set textEmphasisPosition(String value) {
-    setProperty('text-emphasis-position', value, '');
-  }
-
-  /** Gets the value of "text-emphasis-style" */
-  String get textEmphasisStyle => getPropertyValue('text-emphasis-style');
-
-  /** Sets the value of "text-emphasis-style" */
-  set textEmphasisStyle(String value) {
-    setProperty('text-emphasis-style', value, '');
-  }
-
-  /** Gets the value of "text-fill-color" */
-  String get textFillColor => getPropertyValue('text-fill-color');
-
-  /** Sets the value of "text-fill-color" */
-  set textFillColor(String value) {
-    setProperty('text-fill-color', value, '');
-  }
-
-  /** Gets the value of "text-indent" */
-  String get textIndent => getPropertyValue('text-indent');
-
-  /** Sets the value of "text-indent" */
-  set textIndent(String value) {
-    setProperty('text-indent', value, '');
-  }
-
-  /** Gets the value of "text-justify" */
-  String get textJustify => getPropertyValue('text-justify');
-
-  /** Sets the value of "text-justify" */
-  set textJustify(String value) {
-    setProperty('text-justify', value, '');
-  }
-
-  /** Gets the value of "text-line-through-color" */
-  String get textLineThroughColor =>
-      getPropertyValue('text-line-through-color');
-
-  /** Sets the value of "text-line-through-color" */
-  set textLineThroughColor(String value) {
-    setProperty('text-line-through-color', value, '');
-  }
-
-  /** Gets the value of "text-line-through-mode" */
-  String get textLineThroughMode => getPropertyValue('text-line-through-mode');
-
-  /** Sets the value of "text-line-through-mode" */
-  set textLineThroughMode(String value) {
-    setProperty('text-line-through-mode', value, '');
-  }
-
-  /** Gets the value of "text-line-through-style" */
-  String get textLineThroughStyle =>
-      getPropertyValue('text-line-through-style');
-
-  /** Sets the value of "text-line-through-style" */
-  set textLineThroughStyle(String value) {
-    setProperty('text-line-through-style', value, '');
-  }
-
-  /** Gets the value of "text-line-through-width" */
-  String get textLineThroughWidth =>
-      getPropertyValue('text-line-through-width');
-
-  /** Sets the value of "text-line-through-width" */
-  set textLineThroughWidth(String value) {
-    setProperty('text-line-through-width', value, '');
-  }
-
-  /** Gets the value of "text-orientation" */
-  String get textOrientation => getPropertyValue('text-orientation');
-
-  /** Sets the value of "text-orientation" */
-  set textOrientation(String value) {
-    setProperty('text-orientation', value, '');
-  }
-
-  /** Gets the value of "text-overflow" */
-  String get textOverflow => getPropertyValue('text-overflow');
-
-  /** Sets the value of "text-overflow" */
-  set textOverflow(String value) {
-    setProperty('text-overflow', value, '');
-  }
-
-  /** Gets the value of "text-overline-color" */
-  String get textOverlineColor => getPropertyValue('text-overline-color');
-
-  /** Sets the value of "text-overline-color" */
-  set textOverlineColor(String value) {
-    setProperty('text-overline-color', value, '');
-  }
-
-  /** Gets the value of "text-overline-mode" */
-  String get textOverlineMode => getPropertyValue('text-overline-mode');
-
-  /** Sets the value of "text-overline-mode" */
-  set textOverlineMode(String value) {
-    setProperty('text-overline-mode', value, '');
-  }
-
-  /** Gets the value of "text-overline-style" */
-  String get textOverlineStyle => getPropertyValue('text-overline-style');
-
-  /** Sets the value of "text-overline-style" */
-  set textOverlineStyle(String value) {
-    setProperty('text-overline-style', value, '');
-  }
-
-  /** Gets the value of "text-overline-width" */
-  String get textOverlineWidth => getPropertyValue('text-overline-width');
-
-  /** Sets the value of "text-overline-width" */
-  set textOverlineWidth(String value) {
-    setProperty('text-overline-width', value, '');
-  }
-
-  /** Gets the value of "text-rendering" */
-  String get textRendering => getPropertyValue('text-rendering');
-
-  /** Sets the value of "text-rendering" */
-  set textRendering(String value) {
-    setProperty('text-rendering', value, '');
-  }
-
-  /** Gets the value of "text-security" */
-  String get textSecurity => getPropertyValue('text-security');
-
-  /** Sets the value of "text-security" */
-  set textSecurity(String value) {
-    setProperty('text-security', value, '');
-  }
-
-  /** Gets the value of "text-shadow" */
-  String get textShadow => getPropertyValue('text-shadow');
-
-  /** Sets the value of "text-shadow" */
-  set textShadow(String value) {
-    setProperty('text-shadow', value, '');
-  }
-
-  /** Gets the value of "text-stroke" */
-  String get textStroke => getPropertyValue('text-stroke');
-
-  /** Sets the value of "text-stroke" */
-  set textStroke(String value) {
-    setProperty('text-stroke', value, '');
-  }
-
-  /** Gets the value of "text-stroke-color" */
-  String get textStrokeColor => getPropertyValue('text-stroke-color');
-
-  /** Sets the value of "text-stroke-color" */
-  set textStrokeColor(String value) {
-    setProperty('text-stroke-color', value, '');
-  }
-
-  /** Gets the value of "text-stroke-width" */
-  String get textStrokeWidth => getPropertyValue('text-stroke-width');
-
-  /** Sets the value of "text-stroke-width" */
-  set textStrokeWidth(String value) {
-    setProperty('text-stroke-width', value, '');
-  }
-
-  /** Gets the value of "text-transform" */
-  String get textTransform => getPropertyValue('text-transform');
-
-  /** Sets the value of "text-transform" */
-  set textTransform(String value) {
-    setProperty('text-transform', value, '');
-  }
-
-  /** Gets the value of "text-underline-color" */
-  String get textUnderlineColor => getPropertyValue('text-underline-color');
-
-  /** Sets the value of "text-underline-color" */
-  set textUnderlineColor(String value) {
-    setProperty('text-underline-color', value, '');
-  }
-
-  /** Gets the value of "text-underline-mode" */
-  String get textUnderlineMode => getPropertyValue('text-underline-mode');
-
-  /** Sets the value of "text-underline-mode" */
-  set textUnderlineMode(String value) {
-    setProperty('text-underline-mode', value, '');
-  }
-
-  /** Gets the value of "text-underline-position" */
-  String get textUnderlinePosition =>
-      getPropertyValue('text-underline-position');
-
-  /** Sets the value of "text-underline-position" */
-  set textUnderlinePosition(String value) {
-    setProperty('text-underline-position', value, '');
-  }
-
-  /** Gets the value of "text-underline-style" */
-  String get textUnderlineStyle => getPropertyValue('text-underline-style');
-
-  /** Sets the value of "text-underline-style" */
-  set textUnderlineStyle(String value) {
-    setProperty('text-underline-style', value, '');
-  }
-
-  /** Gets the value of "text-underline-width" */
-  String get textUnderlineWidth => getPropertyValue('text-underline-width');
-
-  /** Sets the value of "text-underline-width" */
-  set textUnderlineWidth(String value) {
-    setProperty('text-underline-width', value, '');
-  }
-
-  /** Gets the value of "top" */
-  String get top => getPropertyValue('top');
-
-  /** Sets the value of "top" */
-  set top(String value) {
-    setProperty('top', value, '');
-  }
-
-  /** Gets the value of "touch-action" */
-  String get touchAction => getPropertyValue('touch-action');
-
-  /** Sets the value of "touch-action" */
-  set touchAction(String value) {
-    setProperty('touch-action', value, '');
-  }
-
-  /** Gets the value of "touch-action-delay" */
-  String get touchActionDelay => getPropertyValue('touch-action-delay');
-
-  /** Sets the value of "touch-action-delay" */
-  set touchActionDelay(String value) {
-    setProperty('touch-action-delay', value, '');
-  }
-
-  /** Gets the value of "transform" */
-  String get transform => getPropertyValue('transform');
-
-  /** Sets the value of "transform" */
-  set transform(String value) {
-    setProperty('transform', value, '');
-  }
-
-  /** Gets the value of "transform-origin" */
-  String get transformOrigin => getPropertyValue('transform-origin');
-
-  /** Sets the value of "transform-origin" */
-  set transformOrigin(String value) {
-    setProperty('transform-origin', value, '');
-  }
-
-  /** Gets the value of "transform-origin-x" */
-  String get transformOriginX => getPropertyValue('transform-origin-x');
-
-  /** Sets the value of "transform-origin-x" */
-  set transformOriginX(String value) {
-    setProperty('transform-origin-x', value, '');
-  }
-
-  /** Gets the value of "transform-origin-y" */
-  String get transformOriginY => getPropertyValue('transform-origin-y');
-
-  /** Sets the value of "transform-origin-y" */
-  set transformOriginY(String value) {
-    setProperty('transform-origin-y', value, '');
-  }
-
-  /** Gets the value of "transform-origin-z" */
-  String get transformOriginZ => getPropertyValue('transform-origin-z');
-
-  /** Sets the value of "transform-origin-z" */
-  set transformOriginZ(String value) {
-    setProperty('transform-origin-z', value, '');
-  }
-
-  /** Gets the value of "transform-style" */
-  String get transformStyle => getPropertyValue('transform-style');
-
-  /** Sets the value of "transform-style" */
-  set transformStyle(String value) {
-    setProperty('transform-style', value, '');
-  }
-
-  /** Gets the value of "transition" */ @SupportedBrowser(
-      SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  String get transition => getPropertyValue('transition');
-
-  /** Sets the value of "transition" */ @SupportedBrowser(
-      SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  set transition(String value) {
-    setProperty('transition', value, '');
-  }
-
-  /** Gets the value of "transition-delay" */
-  String get transitionDelay => getPropertyValue('transition-delay');
-
-  /** Sets the value of "transition-delay" */
-  set transitionDelay(String value) {
-    setProperty('transition-delay', value, '');
-  }
-
-  /** Gets the value of "transition-duration" */
-  String get transitionDuration => getPropertyValue('transition-duration');
-
-  /** Sets the value of "transition-duration" */
-  set transitionDuration(String value) {
-    setProperty('transition-duration', value, '');
-  }
-
-  /** Gets the value of "transition-property" */
-  String get transitionProperty => getPropertyValue('transition-property');
-
-  /** Sets the value of "transition-property" */
-  set transitionProperty(String value) {
-    setProperty('transition-property', value, '');
-  }
-
-  /** Gets the value of "transition-timing-function" */
-  String get transitionTimingFunction =>
-      getPropertyValue('transition-timing-function');
-
-  /** Sets the value of "transition-timing-function" */
-  set transitionTimingFunction(String value) {
-    setProperty('transition-timing-function', value, '');
-  }
-
-  /** Gets the value of "unicode-bidi" */
-  String get unicodeBidi => getPropertyValue('unicode-bidi');
-
-  /** Sets the value of "unicode-bidi" */
-  set unicodeBidi(String value) {
-    setProperty('unicode-bidi', value, '');
-  }
-
-  /** Gets the value of "unicode-range" */
-  String get unicodeRange => getPropertyValue('unicode-range');
-
-  /** Sets the value of "unicode-range" */
-  set unicodeRange(String value) {
-    setProperty('unicode-range', value, '');
-  }
-
-  /** Gets the value of "user-drag" */
-  String get userDrag => getPropertyValue('user-drag');
-
-  /** Sets the value of "user-drag" */
-  set userDrag(String value) {
-    setProperty('user-drag', value, '');
-  }
-
-  /** Gets the value of "user-modify" */
-  String get userModify => getPropertyValue('user-modify');
-
-  /** Sets the value of "user-modify" */
-  set userModify(String value) {
-    setProperty('user-modify', value, '');
-  }
-
-  /** Gets the value of "user-select" */
-  String get userSelect => getPropertyValue('user-select');
-
-  /** Sets the value of "user-select" */
-  set userSelect(String value) {
-    setProperty('user-select', value, '');
-  }
-
-  /** Gets the value of "user-zoom" */
-  String get userZoom => getPropertyValue('user-zoom');
-
-  /** Sets the value of "user-zoom" */
-  set userZoom(String value) {
-    setProperty('user-zoom', value, '');
-  }
-
-  /** Gets the value of "vertical-align" */
-  String get verticalAlign => getPropertyValue('vertical-align');
-
-  /** Sets the value of "vertical-align" */
-  set verticalAlign(String value) {
-    setProperty('vertical-align', value, '');
-  }
-
-  /** Gets the value of "visibility" */
-  String get visibility => getPropertyValue('visibility');
-
-  /** Sets the value of "visibility" */
-  set visibility(String value) {
-    setProperty('visibility', value, '');
-  }
-
-  /** Gets the value of "white-space" */
-  String get whiteSpace => getPropertyValue('white-space');
-
-  /** Sets the value of "white-space" */
-  set whiteSpace(String value) {
-    setProperty('white-space', value, '');
-  }
-
-  /** Gets the value of "widows" */
-  String get widows => getPropertyValue('widows');
-
-  /** Sets the value of "widows" */
-  set widows(String value) {
-    setProperty('widows', value, '');
-  }
-
-  /** Gets the value of "width" */
-  String get width => getPropertyValue('width');
-
-  /** Sets the value of "width" */
-  set width(String value) {
-    setProperty('width', value, '');
-  }
-
-  /** Gets the value of "will-change" */
-  String get willChange => getPropertyValue('will-change');
-
-  /** Sets the value of "will-change" */
-  set willChange(String value) {
-    setProperty('will-change', value, '');
-  }
-
-  /** Gets the value of "word-break" */
-  String get wordBreak => getPropertyValue('word-break');
-
-  /** Sets the value of "word-break" */
-  set wordBreak(String value) {
-    setProperty('word-break', value, '');
-  }
-
-  /** Gets the value of "word-spacing" */
-  String get wordSpacing => getPropertyValue('word-spacing');
-
-  /** Sets the value of "word-spacing" */
-  set wordSpacing(String value) {
-    setProperty('word-spacing', value, '');
-  }
-
-  /** Gets the value of "word-wrap" */
-  String get wordWrap => getPropertyValue('word-wrap');
-
-  /** Sets the value of "word-wrap" */
-  set wordWrap(String value) {
-    setProperty('word-wrap', value, '');
-  }
-
-  /** Gets the value of "wrap-flow" */
-  String get wrapFlow => getPropertyValue('wrap-flow');
-
-  /** Sets the value of "wrap-flow" */
-  set wrapFlow(String value) {
-    setProperty('wrap-flow', value, '');
-  }
-
-  /** Gets the value of "wrap-through" */
-  String get wrapThrough => getPropertyValue('wrap-through');
-
-  /** Sets the value of "wrap-through" */
-  set wrapThrough(String value) {
-    setProperty('wrap-through', value, '');
-  }
-
-  /** Gets the value of "writing-mode" */
-  String get writingMode => getPropertyValue('writing-mode');
-
-  /** Sets the value of "writing-mode" */
-  set writingMode(String value) {
-    setProperty('writing-mode', value, '');
-  }
-
-  /** Gets the value of "z-index" */
-  String get zIndex => getPropertyValue('z-index');
-
-  /** Sets the value of "z-index" */
-  set zIndex(String value) {
-    setProperty('z-index', value, '');
-  }
-
-  /** Gets the value of "zoom" */
-  String get zoom => getPropertyValue('zoom');
-
-  /** Sets the value of "zoom" */
-  set zoom(String value) {
-    setProperty('zoom', value, '');
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSStyleRule")
-class CssStyleRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssStyleRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get selectorText native;
-
-  set selectorText(String value) native;
-
-  CssStyleDeclaration get style native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSStyleSheet")
-class CssStyleSheet extends StyleSheet {
-  // To suppress missing implicit constructor warnings.
-  factory CssStyleSheet._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @Returns('_CssRuleList')
-  @Creates('_CssRuleList')
-  List<CssRule> get cssRules native;
-
-  CssRule? get ownerRule native;
-
-  @Returns('_CssRuleList')
-  @Creates('_CssRuleList')
-  List<CssRule> get rules native;
-
-  int addRule(String? selector, String? style, [int? index]) native;
-
-  void deleteRule(int index) native;
-
-  int insertRule(String rule, [int? index]) native;
-
-  void removeRule(int? index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSStyleValue")
-class CssStyleValue extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CssStyleValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static Object? parse(String property, String cssText) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSSupportsRule")
-class CssSupportsRule extends CssConditionRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssSupportsRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSTransformComponent")
-class CssTransformComponent extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CssTransformComponent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get is2D native;
-
-  set is2D(bool value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSTransformValue")
-class CssTransformValue extends CssStyleValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssTransformValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssTransformValue(
-      [List<CssTransformComponent>? transformComponents]) {
-    if (transformComponents == null) {
-      return CssTransformValue._create_1();
-    }
-    if ((transformComponents is List<CssTransformComponent>)) {
-      return CssTransformValue._create_2(transformComponents);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static CssTransformValue _create_1() =>
-      JS('CssTransformValue', 'new CSSTransformValue()');
-  static CssTransformValue _create_2(transformComponents) =>
-      JS('CssTransformValue', 'new CSSTransformValue(#)', transformComponents);
-
-  bool get is2D native;
-
-  int get length native;
-
-  CssTransformComponent componentAtIndex(int index) native;
-
-  DomMatrix toMatrix() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSTranslation")
-class CssTranslation extends CssTransformComponent {
-  // To suppress missing implicit constructor warnings.
-  factory CssTranslation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssTranslation(CssNumericValue x, CssNumericValue y,
-      [CssNumericValue? z]) {
-    if ((y is CssNumericValue) && (x is CssNumericValue) && z == null) {
-      return CssTranslation._create_1(x, y);
-    }
-    if ((z is CssNumericValue) &&
-        (y is CssNumericValue) &&
-        (x is CssNumericValue)) {
-      return CssTranslation._create_2(x, y, z);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static CssTranslation _create_1(x, y) =>
-      JS('CssTranslation', 'new CSSTranslation(#,#)', x, y);
-  static CssTranslation _create_2(x, y, z) =>
-      JS('CssTranslation', 'new CSSTranslation(#,#,#)', x, y, z);
-
-  CssNumericValue get x native;
-
-  set x(CssNumericValue value) native;
-
-  CssNumericValue get y native;
-
-  set y(CssNumericValue value) native;
-
-  CssNumericValue get z native;
-
-  set z(CssNumericValue value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSUnitValue")
-class CssUnitValue extends CssNumericValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssUnitValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssUnitValue(num value, String unit) {
-    return CssUnitValue._create_1(value, unit);
-  }
-  static CssUnitValue _create_1(value, unit) =>
-      JS('CssUnitValue', 'new CSSUnitValue(#,#)', value, unit);
-
-  String get type native;
-
-  String get unit native;
-
-  set unit(String value) native;
-
-  num get value native;
-
-  set value(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSUnparsedValue")
-class CssUnparsedValue extends CssStyleValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssUnparsedValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  Object? fragmentAtIndex(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSVariableReferenceValue")
-class CssVariableReferenceValue extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CssVariableReferenceValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CssUnparsedValue get fallback native;
-
-  String get variable native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSViewportRule")
-class CssViewportRule extends CssRule {
-  // To suppress missing implicit constructor warnings.
-  factory CssViewportRule._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CssStyleDeclaration get style native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSURLImageValue")
-class CssurlImageValue extends CssImageValue {
-  // To suppress missing implicit constructor warnings.
-  factory CssurlImageValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CssurlImageValue(String url) {
-    return CssurlImageValue._create_1(url);
-  }
-  static CssurlImageValue _create_1(url) =>
-      JS('CssurlImageValue', 'new CSSURLImageValue(#)', url);
-
-  String get url native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-custom-element-constructor-generation
-@deprecated // experimental
-typedef void CustomElementConstructor();
-// Copyright (c) 2012, 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.
-
-@Native("CustomElementRegistry")
-class CustomElementRegistry extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CustomElementRegistry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void define(String name, Object constructor, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      _define_1(name, constructor, options_1);
-      return;
-    }
-    _define_2(name, constructor);
-    return;
-  }
-
-  @JSName('define')
-  void _define_1(name, constructor, options) native;
-  @JSName('define')
-  void _define_2(name, constructor) native;
-
-  Object? get(String name) native;
-
-  Future whenDefined(String name) =>
-      promiseToFuture(JS("", "#.whenDefined(#)", this, name));
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("CustomEvent")
-class CustomEvent extends Event {
-  @Creates('Null') // Set from Dart code; does not instantiate a native type.
-  var _dartDetail;
-
-  factory CustomEvent(String type,
-      {bool canBubble: true, bool cancelable: true, Object? detail}) {
-    final CustomEvent e = document._createEvent('CustomEvent') as CustomEvent;
-
-    e._dartDetail = detail;
-
-    // Only try setting the detail if it's one of these types to avoid
-    // first-chance exceptions. Can expand this list in the future as needed.
-    if (detail is List || detail is Map || detail is String || detail is num) {
-      try {
-        detail = convertDartToNative_SerializedScriptValue(detail);
-        e._initCustomEvent(type, canBubble, cancelable, detail);
-      } catch (_) {
-        e._initCustomEvent(type, canBubble, cancelable, null);
-      }
-    } else {
-      e._initCustomEvent(type, canBubble, cancelable, null);
-    }
-
-    return e;
-  }
-
-  get detail {
-    if (_dartDetail != null) {
-      return _dartDetail;
-    }
-    return _detail;
-  }
-
-  factory CustomEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return CustomEvent._create_1(type, eventInitDict_1);
-    }
-    return CustomEvent._create_2(type);
-  }
-  static CustomEvent _create_1(type, eventInitDict) =>
-      JS('CustomEvent', 'new CustomEvent(#,#)', type, eventInitDict);
-  static CustomEvent _create_2(type) =>
-      JS('CustomEvent', 'new CustomEvent(#)', type);
-
-  dynamic get _detail =>
-      convertNativeToDart_SerializedScriptValue(this._get__detail);
-  @JSName('detail')
-  @Creates('Null')
-  dynamic get _get__detail native;
-
-  @JSName('initCustomEvent')
-  void _initCustomEvent(String type,
-      [bool? bubbles, bool? cancelable, Object? detail]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLDListElement")
-class DListElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory DListElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DListElement() => JS<DListElement>(
-      'returns:DListElement;creates:DListElement;new:true',
-      '#.createElement(#)',
-      document,
-      "dl");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DListElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLDataElement")
-class DataElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory DataElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DataElement.created() : super.created();
-
-  String get value native;
-
-  set value(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("HTMLDataListElement")
-class DataListElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory DataListElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DataListElement() =>
-      document.createElement("datalist") as DataListElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DataListElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('datalist');
-
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get options native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DataTransfer")
-class DataTransfer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DataTransfer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DataTransfer() {
-    return DataTransfer._create_1();
-  }
-  static DataTransfer _create_1() => JS('DataTransfer', 'new DataTransfer()');
-
-  String get dropEffect native;
-
-  set dropEffect(String value) native;
-
-  String get effectAllowed native;
-
-  set effectAllowed(String value) native;
-
-  @Returns('FileList')
-  @Creates('FileList')
-  List<File> get files native;
-
-  DataTransferItemList get items native;
-
-  List<String> get types native;
-
-  void clearData([String? format]) native;
-
-  String getData(String format) native;
-
-  void setData(String format, String data) native;
-
-  void setDragImage(Element image, int x, int y) native;
-}
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-@Native("DataTransferItem")
-class DataTransferItem extends Interceptor {
-  Entry getAsEntry() {
-    Entry entry = _webkitGetAsEntry() as Entry;
-
-    if (entry.isFile)
-      applyExtension('FileEntry', entry);
-    else if (entry.isDirectory)
-      applyExtension('DirectoryEntry', entry);
-    else
-      applyExtension('Entry', entry);
-
-    return entry;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory DataTransferItem._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get kind native;
-
-  String get type native;
-
-  File? getAsFile() native;
-
-  @JSName('webkitGetAsEntry')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  Entry? _webkitGetAsEntry() native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("DataTransferItemList")
-class DataTransferItemList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DataTransferItemList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  DataTransferItem? add(data_OR_file, [String? type]) native;
-
-  @JSName('add')
-  DataTransferItem? addData(String data, String type) native;
-
-  @JSName('add')
-  DataTransferItem? addFile(File file) native;
-
-  void clear() native;
-
-  DataTransferItem item(int index) native;
-
-  void remove(int index) native;
-
-  DataTransferItem operator [](int index) {
-    return JS('DataTransferItem', '#[#]', this, index);
-  }
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void DatabaseCallback(SqlDatabase database);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void DecodeErrorCallback(DomException error);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void DecodeSuccessCallback(AudioBuffer decodedData);
-// Copyright (c) 2012, 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.
-
-@Native("DedicatedWorkerGlobalScope")
-class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
-  // To suppress missing implicit constructor warnings.
-  factory DedicatedWorkerGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [DedicatedWorkerGlobalScope].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  static const int PERSISTENT = 1;
-
-  static const int TEMPORARY = 0;
-
-  void close() native;
-
-  void postMessage(/*any*/ message, [List<Object>? transfer]) {
-    if (transfer != null) {
-      var message_1 = convertDartToNative_SerializedScriptValue(message);
-      _postMessage_1(message_1, transfer);
-      return;
-    }
-    var message_1 = convertDartToNative_SerializedScriptValue(message);
-    _postMessage_2(message_1);
-    return;
-  }
-
-  @JSName('postMessage')
-  void _postMessage_1(message, List<Object> transfer) native;
-  @JSName('postMessage')
-  void _postMessage_2(message) native;
-
-  @JSName('webkitRequestFileSystem')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _webkitRequestFileSystem(int type, int size,
-      [_FileSystemCallback? successCallback,
-      _ErrorCallback? errorCallback]) native;
-
-  @JSName('webkitRequestFileSystemSync')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  _DOMFileSystemSync requestFileSystemSync(int type, int size) native;
-
-  @JSName('webkitResolveLocalFileSystemSyncURL')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  _EntrySync resolveLocalFileSystemSyncUrl(String url) native;
-
-  @JSName('webkitResolveLocalFileSystemURL')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _webkitResolveLocalFileSystemUrl(
-      String url, _EntryCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  /// Stream of `message` events handled by this [DedicatedWorkerGlobalScope].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  static DedicatedWorkerGlobalScope get instance {
-    return _workerSelf as DedicatedWorkerGlobalScope;
-  }
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("DeprecatedStorageInfo")
-class DeprecatedStorageInfo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DeprecatedStorageInfo._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int PERSISTENT = 1;
-
-  static const int TEMPORARY = 0;
-
-  void queryUsageAndQuota(int storageType,
-      [StorageUsageCallback? usageCallback,
-      StorageErrorCallback? errorCallback]) native;
-
-  void requestQuota(int storageType, int newQuotaInBytes,
-      [StorageQuotaCallback? quotaCallback,
-      StorageErrorCallback? errorCallback]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DeprecatedStorageQuota")
-class DeprecatedStorageQuota extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DeprecatedStorageQuota._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void queryUsageAndQuota(StorageUsageCallback usageCallback,
-      [StorageErrorCallback? errorCallback]) native;
-
-  void requestQuota(int newQuotaInBytes,
-      [StorageQuotaCallback? quotaCallback,
-      StorageErrorCallback? errorCallback]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DeprecationReport")
-class DeprecationReport extends ReportBody {
-  // To suppress missing implicit constructor warnings.
-  factory DeprecationReport._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get lineNumber native;
-
-  String get message native;
-
-  String get sourceFile native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("HTMLDetailsElement")
-class DetailsElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory DetailsElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DetailsElement() =>
-      document.createElement("details") as DetailsElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DetailsElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('details');
-
-  bool get open native;
-
-  set open(bool value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DetectedBarcode")
-class DetectedBarcode extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DetectedBarcode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DetectedBarcode() {
-    return DetectedBarcode._create_1();
-  }
-  static DetectedBarcode _create_1() =>
-      JS('DetectedBarcode', 'new DetectedBarcode()');
-
-  Rectangle get boundingBox native;
-
-  List get cornerPoints native;
-
-  String get rawValue native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DetectedFace")
-class DetectedFace extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DetectedFace._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DetectedFace() {
-    return DetectedFace._create_1();
-  }
-  static DetectedFace _create_1() => JS('DetectedFace', 'new DetectedFace()');
-
-  Rectangle get boundingBox native;
-
-  List get landmarks native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DetectedText")
-class DetectedText extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DetectedText._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DetectedText() {
-    return DetectedText._create_1();
-  }
-  static DetectedText _create_1() => JS('DetectedText', 'new DetectedText()');
-
-  Rectangle get boundingBox native;
-
-  List get cornerPoints native;
-
-  String get rawValue native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DeviceAcceleration")
-class DeviceAcceleration extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DeviceAcceleration._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num? get x native;
-
-  num? get y native;
-
-  num? get z native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DeviceMotionEvent")
-class DeviceMotionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory DeviceMotionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DeviceMotionEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return DeviceMotionEvent._create_1(type, eventInitDict_1);
-    }
-    return DeviceMotionEvent._create_2(type);
-  }
-  static DeviceMotionEvent _create_1(type, eventInitDict) => JS(
-      'DeviceMotionEvent', 'new DeviceMotionEvent(#,#)', type, eventInitDict);
-  static DeviceMotionEvent _create_2(type) =>
-      JS('DeviceMotionEvent', 'new DeviceMotionEvent(#)', type);
-
-  DeviceAcceleration? get acceleration native;
-
-  DeviceAcceleration? get accelerationIncludingGravity native;
-
-  num get interval native;
-
-  DeviceRotationRate? get rotationRate native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DeviceOrientationEvent")
-class DeviceOrientationEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory DeviceOrientationEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DeviceOrientationEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return DeviceOrientationEvent._create_1(type, eventInitDict_1);
-    }
-    return DeviceOrientationEvent._create_2(type);
-  }
-  static DeviceOrientationEvent _create_1(type, eventInitDict) => JS(
-      'DeviceOrientationEvent',
-      'new DeviceOrientationEvent(#,#)',
-      type,
-      eventInitDict);
-  static DeviceOrientationEvent _create_2(type) =>
-      JS('DeviceOrientationEvent', 'new DeviceOrientationEvent(#)', type);
-
-  bool get absolute native;
-
-  num? get alpha native;
-
-  num? get beta native;
-
-  num? get gamma native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DeviceRotationRate")
-class DeviceRotationRate extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DeviceRotationRate._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num? get alpha native;
-
-  num? get beta native;
-
-  num? get gamma native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("HTMLDialogElement")
-class DialogElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory DialogElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DialogElement.created() : super.created();
-
-  bool get open native;
-
-  set open(bool value) native;
-
-  String get returnValue native;
-
-  set returnValue(String value) native;
-
-  void close([String? returnValue]) native;
-
-  void show() native;
-
-  void showModal() native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("DirectoryEntry")
-class DirectoryEntry extends Entry {
-  /**
-   * Create a new directory with the specified `path`. If `exclusive` is true,
-   * the returned Future will complete with an error if a directory already
-   * exists with the specified `path`.
-   */
-  Future<Entry> createDirectory(String path, {bool exclusive: false}) {
-    return _getDirectory(path,
-        options: {'create': true, 'exclusive': exclusive});
-  }
-
-  DirectoryReader createReader() {
-    DirectoryReader reader = _createReader();
-    applyExtension('DirectoryReader', reader);
-    return reader;
-  }
-
-  /**
-   * Retrieve an already existing directory entry. The returned future will
-   * result in an error if a directory at `path` does not exist or if the item
-   * at `path` is not a directory.
-   */
-  Future<Entry> getDirectory(String path) {
-    return _getDirectory(path);
-  }
-
-  /**
-   * Create a new file with the specified `path`. If `exclusive` is true,
-   * the returned Future will complete with an error if a file already
-   * exists at the specified `path`.
-   */
-  Future<Entry> createFile(String path, {bool exclusive: false}) {
-    return _getFile(path, options: {'create': true, 'exclusive': exclusive});
-  }
-
-  /**
-   * Retrieve an already existing file entry. The returned future will
-   * result in an error if a file at `path` does not exist or if the item at
-   * `path` is not a file.
-   */
-  Future<Entry> getFile(String path) {
-    return _getFile(path);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory DirectoryEntry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('createReader')
-  DirectoryReader _createReader() native;
-
-  void __getDirectory(String? path,
-      [Map? options,
-      _EntryCallback? successCallback,
-      _ErrorCallback? errorCallback]) {
-    if (errorCallback != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      __getDirectory_1(path, options_1, successCallback, errorCallback);
-      return;
-    }
-    if (successCallback != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      __getDirectory_2(path, options_1, successCallback);
-      return;
-    }
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      __getDirectory_3(path, options_1);
-      return;
-    }
-    __getDirectory_4(path);
-    return;
-  }
-
-  @JSName('getDirectory')
-  void __getDirectory_1(path, options, _EntryCallback? successCallback,
-      _ErrorCallback? errorCallback) native;
-  @JSName('getDirectory')
-  void __getDirectory_2(path, options, _EntryCallback? successCallback) native;
-  @JSName('getDirectory')
-  void __getDirectory_3(path, options) native;
-  @JSName('getDirectory')
-  void __getDirectory_4(path) native;
-
-  @JSName('getDirectory')
-  Future<Entry> _getDirectory(String? path, {Map? options}) {
-    var completer = new Completer<Entry>();
-    __getDirectory(path, options, (value) {
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  void __getFile(String? path,
-      [Map? options,
-      _EntryCallback? successCallback,
-      _ErrorCallback? errorCallback]) {
-    if (errorCallback != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      __getFile_1(path, options_1, successCallback, errorCallback);
-      return;
-    }
-    if (successCallback != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      __getFile_2(path, options_1, successCallback);
-      return;
-    }
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      __getFile_3(path, options_1);
-      return;
-    }
-    __getFile_4(path);
-    return;
-  }
-
-  @JSName('getFile')
-  void __getFile_1(path, options, _EntryCallback? successCallback,
-      _ErrorCallback? errorCallback) native;
-  @JSName('getFile')
-  void __getFile_2(path, options, _EntryCallback? successCallback) native;
-  @JSName('getFile')
-  void __getFile_3(path, options) native;
-  @JSName('getFile')
-  void __getFile_4(path) native;
-
-  @JSName('getFile')
-  Future<Entry> _getFile(String? path, {Map? options}) {
-    var completer = new Completer<Entry>();
-    __getFile(path, options, (value) {
-      applyExtension('FileEntry', value);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('removeRecursively')
-  void _removeRecursively(VoidCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  @JSName('removeRecursively')
-  Future removeRecursively() {
-    var completer = new Completer();
-    _removeRecursively(() {
-      completer.complete();
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-}
-// Copyright (c) 2013, 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.
-
-@Native("DirectoryReader")
-class DirectoryReader extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DirectoryReader._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('readEntries')
-  void _readEntries(_EntriesCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  Future<List<Entry>> readEntries() {
-    var completer = new Completer<List<Entry>>();
-    _readEntries((values) {
-      values.forEach((value) {
-        applyExtension('Entry', value);
-        Entry entry = value as Entry;
-        if (entry.isFile)
-          applyExtension('FileEntry', entry);
-        else if (entry.isDirectory) applyExtension('DirectoryEntry', entry);
-      });
-      completer.complete(new List<Entry>.from(values));
-    }, (error) {
-      completer.completeError(error);
-    });
-
-    return completer.future;
-  }
-}
-// Copyright (c) 2012, 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.
-
-/**
- * A generic container for content on an HTML page;
- * corresponds to the &lt;div&gt; tag.
- *
- * The [DivElement] is a generic container and does not have any semantic
- * significance. It is functionally similar to [SpanElement].
- *
- * The [DivElement] is a block-level element, as opposed to [SpanElement],
- * which is an inline-level element.
- *
- * Example usage:
- *
- *     DivElement div = new DivElement();
- *     div.text = 'Here's my new DivElem
- *     document.body.elements.add(elem);
- *
- * See also:
- *
- * * [HTML `<div>` element](http://www.w3.org/TR/html-markup/div.html) from W3C.
- * * [Block-level element](http://www.w3.org/TR/CSS2/visuren.html#block-boxes) from W3C.
- * * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
- */
-@Native("HTMLDivElement")
-class DivElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory DivElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DivElement() => JS<DivElement>(
-      'returns:DivElement;creates:DivElement;new:true',
-      '#.createElement(#)',
-      document,
-      "div");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DivElement.created() : super.created();
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * The base class for all documents.
- *
- * Each web page loaded in the browser has its own [Document] object, which is
- * typically an [HtmlDocument].
- *
- * If you aren't comfortable with DOM concepts, see the Dart tutorial
- * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connect-dart-html/).
- */
-@Native("Document")
-class Document extends Node {
-  // To suppress missing implicit constructor warnings.
-  factory Document._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> pointerLockChangeEvent =
-      const EventStreamProvider<Event>('pointerlockchange');
-
-  static const EventStreamProvider<Event> pointerLockErrorEvent =
-      const EventStreamProvider<Event>('pointerlockerror');
-
-  /**
-   * Static factory designed to expose `readystatechange` events to event
-   * handlers that are not necessarily instances of [Document].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> readyStateChangeEvent =
-      const EventStreamProvider<Event>('readystatechange');
-
-  /**
-   * Static factory designed to expose `securitypolicyviolation` events to event
-   * handlers that are not necessarily instances of [Document].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SecurityPolicyViolationEvent>
-      securityPolicyViolationEvent =
-      const EventStreamProvider<SecurityPolicyViolationEvent>(
-          'securitypolicyviolation');
-
-  /**
-   * Static factory designed to expose `selectionchange` events to event
-   * handlers that are not necessarily instances of [Document].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> selectionChangeEvent =
-      const EventStreamProvider<Event>('selectionchange');
-
-  factory Document() {
-    return Document._create_1();
-  }
-  static Document _create_1() => JS('Document', 'new Document()');
-
-  String get addressSpace native;
-
-  @JSName('body')
-  HtmlElement? get _body native;
-
-  @JSName('body')
-  set _body(HtmlElement? value) native;
-
-  String get contentType native;
-
-  String get cookie native;
-
-  set cookie(String value) native;
-
-  ScriptElement? get currentScript native;
-
-  WindowBase? get window => _convertNativeToDart_Window(this._get_window);
-  @JSName('defaultView')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  @Creates('Window|=Object|Null')
-  @Returns('Window|=Object|Null')
-  dynamic get _get_window native;
-
-  Element? get documentElement native;
-
-  String get domain native;
-
-  bool get fullscreenEnabled native;
-
-  @JSName('head')
-  HeadElement? get _head native;
-
-  bool get hidden native;
-
-  DomImplementation get implementation native;
-
-  @JSName('lastModified')
-  String get _lastModified native;
-
-  String get origin native;
-
-  @JSName('preferredStylesheetSet')
-  String? get _preferredStylesheetSet native;
-
-  String get readyState native;
-
-  @JSName('referrer')
-  String get _referrer native;
-
-  SvgSvgElement get rootElement native;
-
-  Element? get rootScroller native;
-
-  set rootScroller(Element? value) native;
-
-  Element? get scrollingElement native;
-
-  @JSName('selectedStylesheetSet')
-  String? get _selectedStylesheetSet native;
-
-  @JSName('selectedStylesheetSet')
-  set _selectedStylesheetSet(String? value) native;
-
-  String get suborigin native;
-
-  DocumentTimeline get timeline native;
-
-  @JSName('title')
-  String get _title native;
-
-  @JSName('title')
-  set _title(String value) native;
-
-  @JSName('visibilityState')
-  String get _visibilityState native;
-
-  @JSName('webkitFullscreenElement')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  Element get _webkitFullscreenElement native;
-
-  @JSName('webkitFullscreenEnabled')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  bool get _webkitFullscreenEnabled native;
-
-  @JSName('webkitHidden')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  bool get _webkitHidden native;
-
-  @JSName('webkitVisibilityState')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  String get _webkitVisibilityState native;
-
-  Node adoptNode(Node node) native;
-
-  @JSName('caretRangeFromPoint')
-  Range _caretRangeFromPoint(int? x, int? y) native;
-
-  DocumentFragment createDocumentFragment() native;
-
-  @JSName('createElement')
-  Element _createElement(String localName_OR_tagName,
-      [options_OR_typeExtension]) native;
-
-  @JSName('createElementNS')
-  Element _createElementNS(String? namespaceURI, String qualifiedName,
-      [options_OR_typeExtension]) native;
-
-  @JSName('createEvent')
-  Event _createEvent(String eventType) native;
-
-  Range createRange() native;
-
-  @JSName('createTextNode')
-  Text _createTextNode(String data) native;
-
-  Touch _createTouch(Window view, EventTarget target, int identifier, num pageX,
-      num pageY, num screenX, num screenY,
-      [num? radiusX, num? radiusY, num? rotationAngle, num? force]) {
-    if (force != null) {
-      var target_1 = _convertDartToNative_EventTarget(target);
-      return _createTouch_1(view, target_1, identifier, pageX, pageY, screenX,
-          screenY, radiusX, radiusY, rotationAngle, force);
-    }
-    if (rotationAngle != null) {
-      var target_1 = _convertDartToNative_EventTarget(target);
-      return _createTouch_2(view, target_1, identifier, pageX, pageY, screenX,
-          screenY, radiusX, radiusY, rotationAngle);
-    }
-    if (radiusY != null) {
-      var target_1 = _convertDartToNative_EventTarget(target);
-      return _createTouch_3(view, target_1, identifier, pageX, pageY, screenX,
-          screenY, radiusX, radiusY);
-    }
-    if (radiusX != null) {
-      var target_1 = _convertDartToNative_EventTarget(target);
-      return _createTouch_4(
-          view, target_1, identifier, pageX, pageY, screenX, screenY, radiusX);
-    }
-    var target_1 = _convertDartToNative_EventTarget(target);
-    return _createTouch_5(
-        view, target_1, identifier, pageX, pageY, screenX, screenY);
-  }
-
-  @JSName('createTouch')
-  Touch _createTouch_1(Window view, target, identifier, pageX, pageY, screenX,
-      screenY, radiusX, radiusY, rotationAngle, force) native;
-  @JSName('createTouch')
-  Touch _createTouch_2(Window view, target, identifier, pageX, pageY, screenX,
-      screenY, radiusX, radiusY, rotationAngle) native;
-  @JSName('createTouch')
-  Touch _createTouch_3(Window view, target, identifier, pageX, pageY, screenX,
-      screenY, radiusX, radiusY) native;
-  @JSName('createTouch')
-  Touch _createTouch_4(Window view, target, identifier, pageX, pageY, screenX,
-      screenY, radiusX) native;
-  @JSName('createTouch')
-  Touch _createTouch_5(
-      Window view, target, identifier, pageX, pageY, screenX, screenY) native;
-
-  @JSName('createTouchList')
-  TouchList _createTouchList(Touch touches) native;
-
-  bool execCommand(String commandId, [bool? showUI, String? value]) native;
-
-  void exitFullscreen() native;
-
-  void exitPointerLock() native;
-
-  List<Animation> getAnimations() native;
-
-  @Creates('NodeList|HtmlCollection')
-  @Returns('NodeList|HtmlCollection')
-  List<Node> getElementsByClassName(String classNames) native;
-
-  @Creates('NodeList|HtmlCollection')
-  @Returns('NodeList|HtmlCollection')
-  List<Node> getElementsByName(String elementName) native;
-
-  @Creates('NodeList|HtmlCollection')
-  @Returns('NodeList|HtmlCollection')
-  List<Node> getElementsByTagName(String localName) native;
-
-  Node importNode(Node node, [bool? deep]) native;
-
-  bool queryCommandEnabled(String commandId) native;
-
-  bool queryCommandIndeterm(String commandId) native;
-
-  bool queryCommandState(String commandId) native;
-
-  bool queryCommandSupported(String commandId) native;
-
-  String queryCommandValue(String commandId) native;
-
-  Function registerElement2(String type, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return _registerElement2_1(type, options_1);
-    }
-    return _registerElement2_2(type);
-  }
-
-  @JSName('registerElement')
-  Function _registerElement2_1(type, options) native;
-  @JSName('registerElement')
-  Function _registerElement2_2(type) native;
-
-  @JSName('webkitExitFullscreen')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _webkitExitFullscreen() native;
-
-  // From NonElementParentNode
-
-  Element? getElementById(String elementId) native;
-
-  // From DocumentOrShadowRoot
-
-  Element? get activeElement native;
-
-  Element? get fullscreenElement native;
-
-  Element? get pointerLockElement native;
-
-  @JSName('styleSheets')
-  @Returns('_StyleSheetList')
-  @Creates('_StyleSheetList')
-  List<StyleSheet> get _styleSheets native;
-
-  @JSName('elementFromPoint')
-  Element? _elementFromPoint(int x, int y) native;
-
-  List<Element> elementsFromPoint(int x, int y) native;
-
-  // From FontFaceSource
-
-  FontFaceSet get fonts native;
-
-  // From ParentNode
-
-  @JSName('childElementCount')
-  int get _childElementCount native;
-
-  @JSName('children')
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get _children native;
-
-  @JSName('firstElementChild')
-  Element? get _firstElementChild native;
-
-  @JSName('lastElementChild')
-  Element? get _lastElementChild native;
-
-  /**
-   * Finds the first descendant element of this document that matches the
-   * specified group of selectors.
-   *
-   * Unless your webpage contains multiple documents, the top-level
-   * [querySelector]
-   * method behaves the same as this method, so you should use it instead to
-   * save typing a few characters.
-   *
-   * [selectors] should be a string using CSS selector syntax.
-   *
-   *     var element1 = document.querySelector('.className');
-   *     var element2 = document.querySelector('#id');
-   *
-   * For details about CSS selector syntax, see the
-   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
-   */
-  Element? querySelector(String selectors) native;
-
-  @JSName('querySelectorAll')
-  @Creates('NodeList')
-  @Returns('NodeList')
-  List<Node> _querySelectorAll(String selectors) native;
-
-  /// Stream of `abort` events handled by this [Document].
-  Stream<Event> get onAbort => Element.abortEvent.forTarget(this);
-
-  /// Stream of `beforecopy` events handled by this [Document].
-  Stream<Event> get onBeforeCopy => Element.beforeCopyEvent.forTarget(this);
-
-  /// Stream of `beforecut` events handled by this [Document].
-  Stream<Event> get onBeforeCut => Element.beforeCutEvent.forTarget(this);
-
-  /// Stream of `beforepaste` events handled by this [Document].
-  Stream<Event> get onBeforePaste => Element.beforePasteEvent.forTarget(this);
-
-  /// Stream of `blur` events handled by this [Document].
-  Stream<Event> get onBlur => Element.blurEvent.forTarget(this);
-
-  Stream<Event> get onCanPlay => Element.canPlayEvent.forTarget(this);
-
-  Stream<Event> get onCanPlayThrough =>
-      Element.canPlayThroughEvent.forTarget(this);
-
-  /// Stream of `change` events handled by this [Document].
-  Stream<Event> get onChange => Element.changeEvent.forTarget(this);
-
-  /// Stream of `click` events handled by this [Document].
-  Stream<MouseEvent> get onClick => Element.clickEvent.forTarget(this);
-
-  /// Stream of `contextmenu` events handled by this [Document].
-  Stream<MouseEvent> get onContextMenu =>
-      Element.contextMenuEvent.forTarget(this);
-
-  /// Stream of `copy` events handled by this [Document].
-  Stream<ClipboardEvent> get onCopy => Element.copyEvent.forTarget(this);
-
-  /// Stream of `cut` events handled by this [Document].
-  Stream<ClipboardEvent> get onCut => Element.cutEvent.forTarget(this);
-
-  /// Stream of `doubleclick` events handled by this [Document].
-  @DomName('Document.ondblclick')
-  Stream<Event> get onDoubleClick => Element.doubleClickEvent.forTarget(this);
-
-  /// Stream of `drag` events handled by this [Document].
-  Stream<MouseEvent> get onDrag => Element.dragEvent.forTarget(this);
-
-  /// Stream of `dragend` events handled by this [Document].
-  Stream<MouseEvent> get onDragEnd => Element.dragEndEvent.forTarget(this);
-
-  /// Stream of `dragenter` events handled by this [Document].
-  Stream<MouseEvent> get onDragEnter => Element.dragEnterEvent.forTarget(this);
-
-  /// Stream of `dragleave` events handled by this [Document].
-  Stream<MouseEvent> get onDragLeave => Element.dragLeaveEvent.forTarget(this);
-
-  /// Stream of `dragover` events handled by this [Document].
-  Stream<MouseEvent> get onDragOver => Element.dragOverEvent.forTarget(this);
-
-  /// Stream of `dragstart` events handled by this [Document].
-  Stream<MouseEvent> get onDragStart => Element.dragStartEvent.forTarget(this);
-
-  /// Stream of `drop` events handled by this [Document].
-  Stream<MouseEvent> get onDrop => Element.dropEvent.forTarget(this);
-
-  Stream<Event> get onDurationChange =>
-      Element.durationChangeEvent.forTarget(this);
-
-  Stream<Event> get onEmptied => Element.emptiedEvent.forTarget(this);
-
-  Stream<Event> get onEnded => Element.endedEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [Document].
-  Stream<Event> get onError => Element.errorEvent.forTarget(this);
-
-  /// Stream of `focus` events handled by this [Document].
-  Stream<Event> get onFocus => Element.focusEvent.forTarget(this);
-
-  /// Stream of `input` events handled by this [Document].
-  Stream<Event> get onInput => Element.inputEvent.forTarget(this);
-
-  /// Stream of `invalid` events handled by this [Document].
-  Stream<Event> get onInvalid => Element.invalidEvent.forTarget(this);
-
-  /// Stream of `keydown` events handled by this [Document].
-  Stream<KeyboardEvent> get onKeyDown => Element.keyDownEvent.forTarget(this);
-
-  /// Stream of `keypress` events handled by this [Document].
-  Stream<KeyboardEvent> get onKeyPress => Element.keyPressEvent.forTarget(this);
-
-  /// Stream of `keyup` events handled by this [Document].
-  Stream<KeyboardEvent> get onKeyUp => Element.keyUpEvent.forTarget(this);
-
-  /// Stream of `load` events handled by this [Document].
-  Stream<Event> get onLoad => Element.loadEvent.forTarget(this);
-
-  Stream<Event> get onLoadedData => Element.loadedDataEvent.forTarget(this);
-
-  Stream<Event> get onLoadedMetadata =>
-      Element.loadedMetadataEvent.forTarget(this);
-
-  /// Stream of `mousedown` events handled by this [Document].
-  Stream<MouseEvent> get onMouseDown => Element.mouseDownEvent.forTarget(this);
-
-  /// Stream of `mouseenter` events handled by this [Document].
-  Stream<MouseEvent> get onMouseEnter =>
-      Element.mouseEnterEvent.forTarget(this);
-
-  /// Stream of `mouseleave` events handled by this [Document].
-  Stream<MouseEvent> get onMouseLeave =>
-      Element.mouseLeaveEvent.forTarget(this);
-
-  /// Stream of `mousemove` events handled by this [Document].
-  Stream<MouseEvent> get onMouseMove => Element.mouseMoveEvent.forTarget(this);
-
-  /// Stream of `mouseout` events handled by this [Document].
-  Stream<MouseEvent> get onMouseOut => Element.mouseOutEvent.forTarget(this);
-
-  /// Stream of `mouseover` events handled by this [Document].
-  Stream<MouseEvent> get onMouseOver => Element.mouseOverEvent.forTarget(this);
-
-  /// Stream of `mouseup` events handled by this [Document].
-  Stream<MouseEvent> get onMouseUp => Element.mouseUpEvent.forTarget(this);
-
-  /// Stream of `mousewheel` events handled by this [Document].
-  Stream<WheelEvent> get onMouseWheel =>
-      Element.mouseWheelEvent.forTarget(this);
-
-  /// Stream of `paste` events handled by this [Document].
-  Stream<ClipboardEvent> get onPaste => Element.pasteEvent.forTarget(this);
-
-  Stream<Event> get onPause => Element.pauseEvent.forTarget(this);
-
-  Stream<Event> get onPlay => Element.playEvent.forTarget(this);
-
-  Stream<Event> get onPlaying => Element.playingEvent.forTarget(this);
-
-  Stream<Event> get onPointerLockChange =>
-      pointerLockChangeEvent.forTarget(this);
-
-  Stream<Event> get onPointerLockError => pointerLockErrorEvent.forTarget(this);
-
-  Stream<Event> get onRateChange => Element.rateChangeEvent.forTarget(this);
-
-  /// Stream of `readystatechange` events handled by this [Document].
-  Stream<Event> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
-
-  /// Stream of `reset` events handled by this [Document].
-  Stream<Event> get onReset => Element.resetEvent.forTarget(this);
-
-  Stream<Event> get onResize => Element.resizeEvent.forTarget(this);
-
-  /// Stream of `scroll` events handled by this [Document].
-  Stream<Event> get onScroll => Element.scrollEvent.forTarget(this);
-
-  /// Stream of `search` events handled by this [Document].
-  Stream<Event> get onSearch => Element.searchEvent.forTarget(this);
-
-  /// Stream of `securitypolicyviolation` events handled by this [Document].
-  Stream<SecurityPolicyViolationEvent> get onSecurityPolicyViolation =>
-      securityPolicyViolationEvent.forTarget(this);
-
-  Stream<Event> get onSeeked => Element.seekedEvent.forTarget(this);
-
-  Stream<Event> get onSeeking => Element.seekingEvent.forTarget(this);
-
-  /// Stream of `select` events handled by this [Document].
-  Stream<Event> get onSelect => Element.selectEvent.forTarget(this);
-
-  /// Stream of `selectionchange` events handled by this [Document].
-  Stream<Event> get onSelectionChange => selectionChangeEvent.forTarget(this);
-
-  /// Stream of `selectstart` events handled by this [Document].
-  Stream<Event> get onSelectStart => Element.selectStartEvent.forTarget(this);
-
-  Stream<Event> get onStalled => Element.stalledEvent.forTarget(this);
-
-  /// Stream of `submit` events handled by this [Document].
-  Stream<Event> get onSubmit => Element.submitEvent.forTarget(this);
-
-  Stream<Event> get onSuspend => Element.suspendEvent.forTarget(this);
-
-  Stream<Event> get onTimeUpdate => Element.timeUpdateEvent.forTarget(this);
-
-  /// Stream of `touchcancel` events handled by this [Document].
-  Stream<TouchEvent> get onTouchCancel =>
-      Element.touchCancelEvent.forTarget(this);
-
-  /// Stream of `touchend` events handled by this [Document].
-  Stream<TouchEvent> get onTouchEnd => Element.touchEndEvent.forTarget(this);
-
-  /// Stream of `touchmove` events handled by this [Document].
-  Stream<TouchEvent> get onTouchMove => Element.touchMoveEvent.forTarget(this);
-
-  /// Stream of `touchstart` events handled by this [Document].
-  Stream<TouchEvent> get onTouchStart =>
-      Element.touchStartEvent.forTarget(this);
-
-  Stream<Event> get onVolumeChange => Element.volumeChangeEvent.forTarget(this);
-
-  Stream<Event> get onWaiting => Element.waitingEvent.forTarget(this);
-
-  /// Stream of `fullscreenchange` events handled by this [Document].
-  Stream<Event> get onFullscreenChange =>
-      Element.fullscreenChangeEvent.forTarget(this);
-
-  /// Stream of `fullscreenerror` events handled by this [Document].
-  Stream<Event> get onFullscreenError =>
-      Element.fullscreenErrorEvent.forTarget(this);
-
-  /**
-   * Finds all descendant elements of this document that match the specified
-   * group of selectors.
-   *
-   * Unless your webpage contains multiple documents, the top-level
-   * [querySelectorAll]
-   * method behaves the same as this method, so you should use it instead to
-   * save typing a few characters.
-   *
-   * [selectors] should be a string using CSS selector syntax.
-   *
-   *     var items = document.querySelectorAll('.itemClassName');
-   *
-   * For details about CSS selector syntax, see the
-   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
-   */
-  ElementList<T> querySelectorAll<T extends Element>(String selectors) =>
-      new _FrozenElementList<T>._wrap(_querySelectorAll(selectors));
-
-  /// Checks if [registerElement] is supported on the current platform.
-  bool get supportsRegisterElement {
-    return JS('bool', '("registerElement" in #)', this);
-  }
-
-  /// *Deprecated*: use [supportsRegisterElement] instead.
-  @deprecated
-  bool get supportsRegister => supportsRegisterElement;
-
-  void registerElement(String tag, Type customElementClass,
-      {String? extendsTag}) {
-    registerElement2(
-        tag, {'prototype': customElementClass, 'extends': extendsTag});
-  }
-
-  @pragma('dart2js:tryInline') // Almost all call sites have one argument.
-  Element createElement(String tagName, [String? typeExtension]) {
-    return (typeExtension == null)
-        ? _createElement_2(tagName)
-        : _createElement(tagName, typeExtension);
-  }
-
-  // The two-argument version of this is automatically generated, but we need to
-  // omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
-  _createElement_2(String tagName) =>
-      JS('Element', '#.createElement(#)', this, tagName);
-
-  // The three-argument version of this is automatically generated, but we need to
-  // omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
-  _createElementNS_2(String namespaceURI, String qualifiedName) => JS(
-      'Element', '#.createElementNS(#, #)', this, namespaceURI, qualifiedName);
-
-  Element createElementNS(String namespaceURI, String qualifiedName,
-      [String? typeExtension]) {
-    return (typeExtension == null)
-        ? _createElementNS_2(namespaceURI, qualifiedName)
-        : _createElementNS(namespaceURI, qualifiedName, typeExtension);
-  }
-
-  NodeIterator _createNodeIterator(Node root,
-          [int? whatToShow, NodeFilter? filter]) =>
-      JS('NodeIterator', '#.createNodeIterator(#, #, #, false)', this, root,
-          whatToShow, filter);
-
-  TreeWalker _createTreeWalker(Node root,
-          [int? whatToShow, NodeFilter? filter]) =>
-      JS('TreeWalker', '#.createTreeWalker(#, #, #, false)', this, root,
-          whatToShow, filter);
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  String get visibilityState => JS(
-      'String',
-      '(#.visibilityState || #.mozVisibilityState || #.msVisibilityState ||'
-          '#.webkitVisibilityState)',
-      this,
-      this,
-      this,
-      this);
-}
-// Copyright (c) 2011, 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.
-
-@Native("DocumentFragment")
-class DocumentFragment extends Node
-    implements NonElementParentNode, ParentNode {
-  factory DocumentFragment() => document.createDocumentFragment();
-
-  factory DocumentFragment.html(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    return document.body!.createFragment(html,
-        validator: validator, treeSanitizer: treeSanitizer);
-  }
-
-  factory DocumentFragment.svg(String? svgContent,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    return new svg.SvgSvgElement().createFragment(svgContent,
-        validator: validator, treeSanitizer: treeSanitizer);
-  }
-
-  HtmlCollection get _children =>
-      throw new UnimplementedError('Use _docChildren instead');
-
-  // Native field is used only by Dart code so does not lead to instantiation
-  // of native classes
-  @Creates('Null')
-  List<Element>? _docChildren;
-
-  List<Element> get children {
-    if (_docChildren == null) {
-      _docChildren = new FilteredElementList(this);
-    }
-    return _docChildren!;
-  }
-
-  set children(List<Element> value) {
-    // Copy list first since we don't want liveness during iteration.
-    var copy = value.toList();
-    var children = this.children;
-    children.clear();
-    children.addAll(copy);
-  }
-
-  /**
-   * Finds all descendant elements of this document fragment that match the
-   * specified group of selectors.
-   *
-   * [selectors] should be a string using CSS selector syntax.
-   *
-   *     var items = document.querySelectorAll('.itemClassName');
-   *
-   * For details about CSS selector syntax, see the
-   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
-   */
-  ElementList<T> querySelectorAll<T extends Element>(String selectors) =>
-      new _FrozenElementList<T>._wrap(_querySelectorAll(selectors));
-
-  String get innerHtml {
-    final e = new DivElement();
-    e.append(this.clone(true));
-    return e.innerHtml;
-  }
-
-  set innerHtml(String? value) {
-    this.setInnerHtml(value);
-  }
-
-  void setInnerHtml(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    this.nodes.clear();
-    append(document.body!.createFragment(html,
-        validator: validator, treeSanitizer: treeSanitizer));
-  }
-
-  /**
-   * Adds the specified text as a text node after the last child of this
-   * document fragment.
-   */
-  void appendText(String text) {
-    this.append(new Text(text));
-  }
-
-  /**
-   * Parses the specified text as HTML and adds the resulting node after the
-   * last child of this document fragment.
-   */
-  void appendHtml(String text,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    this.append(new DocumentFragment.html(text,
-        validator: validator, treeSanitizer: treeSanitizer));
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory DocumentFragment._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // From NonElementParentNode
-
-  Element? getElementById(String elementId) native;
-
-  // From ParentNode
-
-  @JSName('childElementCount')
-  int get _childElementCount native;
-
-  @JSName('firstElementChild')
-  Element? get _firstElementChild native;
-
-  @JSName('lastElementChild')
-  Element? get _lastElementChild native;
-
-  /**
-   * Finds the first descendant element of this document fragment that matches
-   * the specified group of selectors.
-   *
-   * [selectors] should be a string using CSS selector syntax.
-   *
-   *     var element1 = fragment.querySelector('.className');
-   *     var element2 = fragment.querySelector('#id');
-   *
-   * For details about CSS selector syntax, see the
-   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
-   */
-  Element? querySelector(String selectors) native;
-
-  @JSName('querySelectorAll')
-  @Creates('NodeList')
-  @Returns('NodeList')
-  List<Node> _querySelectorAll(String selectors) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DocumentOrShadowRoot")
-class DocumentOrShadowRoot extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DocumentOrShadowRoot._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Element? get activeElement native;
-
-  Element? get fullscreenElement native;
-
-  Element? get pointerLockElement native;
-
-  @Returns('_StyleSheetList')
-  @Creates('_StyleSheetList')
-  List<StyleSheet> get styleSheets native;
-
-  Element? elementFromPoint(int x, int y) native;
-
-  List<Element> elementsFromPoint(int x, int y) native;
-
-  Selection? getSelection() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DocumentTimeline")
-class DocumentTimeline extends AnimationTimeline {
-  // To suppress missing implicit constructor warnings.
-  factory DocumentTimeline._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DocumentTimeline([Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return DocumentTimeline._create_1(options_1);
-    }
-    return DocumentTimeline._create_2();
-  }
-  static DocumentTimeline _create_1(options) =>
-      JS('DocumentTimeline', 'new DocumentTimeline(#)', options);
-  static DocumentTimeline _create_2() =>
-      JS('DocumentTimeline', 'new DocumentTimeline()');
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMError")
-class DomError extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomError(String name, [String? message]) {
-    if (message != null) {
-      return DomError._create_1(name, message);
-    }
-    return DomError._create_2(name);
-  }
-  static DomError _create_1(name, message) =>
-      JS('DomError', 'new DOMError(#,#)', name, message);
-  static DomError _create_2(name) => JS('DomError', 'new DOMError(#)', name);
-
-  String get message native;
-
-  String get name native;
-}
-// Copyright (c) 2013, 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.
-
-@Unstable()
-@Native("DOMException")
-class DomException extends Interceptor {
-  static const String INDEX_SIZE = 'IndexSizeError';
-  static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
-  static const String WRONG_DOCUMENT = 'WrongDocumentError';
-  static const String INVALID_CHARACTER = 'InvalidCharacterError';
-  static const String NO_MODIFICATION_ALLOWED = 'NoModificationAllowedError';
-  static const String NOT_FOUND = 'NotFoundError';
-  static const String NOT_SUPPORTED = 'NotSupportedError';
-  static const String INVALID_STATE = 'InvalidStateError';
-  static const String SYNTAX = 'SyntaxError';
-  static const String INVALID_MODIFICATION = 'InvalidModificationError';
-  static const String NAMESPACE = 'NamespaceError';
-  static const String INVALID_ACCESS = 'InvalidAccessError';
-  static const String TYPE_MISMATCH = 'TypeMismatchError';
-  static const String SECURITY = 'SecurityError';
-  static const String NETWORK = 'NetworkError';
-  static const String ABORT = 'AbortError';
-  static const String URL_MISMATCH = 'URLMismatchError';
-  static const String QUOTA_EXCEEDED = 'QuotaExceededError';
-  static const String TIMEOUT = 'TimeoutError';
-  static const String INVALID_NODE_TYPE = 'InvalidNodeTypeError';
-  static const String DATA_CLONE = 'DataCloneError';
-  static const String ENCODING = 'EncodingError';
-  static const String NOT_READABLE = 'NotReadableError';
-  static const String UNKNOWN = 'UnknownError';
-  static const String CONSTRAINT = 'ConstraintError';
-  static const String TRANSACTION_INACTIVE = 'TransactionInactiveError';
-  static const String READ_ONLY = 'ReadOnlyError';
-  static const String VERSION = 'VersionError';
-  static const String OPERATION = 'OperationError';
-  static const String NOT_ALLOWED = 'NotAllowedError';
-  // Is TypeError class derived from DomException but name is 'TypeError'
-  static const String TYPE_ERROR = 'TypeError';
-
-  String get name {
-    var errorName = JS('String', '#.name', this);
-    // Although Safari nightly has updated the name to SecurityError, Safari 5
-    // and 6 still return SECURITY_ERR.
-    if (Device.isWebKit && errorName == 'SECURITY_ERR') return 'SecurityError';
-    // Chrome release still uses old string, remove this line when Chrome stable
-    // also prints out SyntaxError.
-    if (Device.isWebKit && errorName == 'SYNTAX_ERR') return 'SyntaxError';
-    return errorName as String;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory DomException._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get message native;
-
-  String toString() => JS('String', 'String(#)', this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMImplementation")
-class DomImplementation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomImplementation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  XmlDocument createDocument(String? namespaceURI, String qualifiedName,
-      _DocumentType? doctype) native;
-
-  _DocumentType createDocumentType(
-      String qualifiedName, String publicId, String systemId) native;
-
-  @JSName('createHTMLDocument')
-  HtmlDocument createHtmlDocument([String? title]) native;
-
-  bool hasFeature() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Iterator")
-class DomIterator extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomIterator._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Object? next([Object? value]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMMatrix")
-class DomMatrix extends DomMatrixReadOnly {
-  // To suppress missing implicit constructor warnings.
-  factory DomMatrix._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomMatrix([Object? init]) {
-    if (init != null) {
-      return DomMatrix._create_1(init);
-    }
-    return DomMatrix._create_2();
-  }
-  static DomMatrix _create_1(init) => JS('DomMatrix', 'new DOMMatrix(#)', init);
-  static DomMatrix _create_2() => JS('DomMatrix', 'new DOMMatrix()');
-
-  // Shadowing definition.
-
-  num get a native;
-
-  set a(num value) native;
-
-  // Shadowing definition.
-
-  num get b native;
-
-  set b(num value) native;
-
-  // Shadowing definition.
-
-  num get c native;
-
-  set c(num value) native;
-
-  // Shadowing definition.
-
-  num get d native;
-
-  set d(num value) native;
-
-  // Shadowing definition.
-
-  num get e native;
-
-  set e(num value) native;
-
-  // Shadowing definition.
-
-  num get f native;
-
-  set f(num value) native;
-
-  // Shadowing definition.
-
-  num get m11 native;
-
-  set m11(num value) native;
-
-  // Shadowing definition.
-
-  num get m12 native;
-
-  set m12(num value) native;
-
-  // Shadowing definition.
-
-  num get m13 native;
-
-  set m13(num value) native;
-
-  // Shadowing definition.
-
-  num get m14 native;
-
-  set m14(num value) native;
-
-  // Shadowing definition.
-
-  num get m21 native;
-
-  set m21(num value) native;
-
-  // Shadowing definition.
-
-  num get m22 native;
-
-  set m22(num value) native;
-
-  // Shadowing definition.
-
-  num get m23 native;
-
-  set m23(num value) native;
-
-  // Shadowing definition.
-
-  num get m24 native;
-
-  set m24(num value) native;
-
-  // Shadowing definition.
-
-  num get m31 native;
-
-  set m31(num value) native;
-
-  // Shadowing definition.
-
-  num get m32 native;
-
-  set m32(num value) native;
-
-  // Shadowing definition.
-
-  num get m33 native;
-
-  set m33(num value) native;
-
-  // Shadowing definition.
-
-  num get m34 native;
-
-  set m34(num value) native;
-
-  // Shadowing definition.
-
-  num get m41 native;
-
-  set m41(num value) native;
-
-  // Shadowing definition.
-
-  num get m42 native;
-
-  set m42(num value) native;
-
-  // Shadowing definition.
-
-  num get m43 native;
-
-  set m43(num value) native;
-
-  // Shadowing definition.
-
-  num get m44 native;
-
-  set m44(num value) native;
-
-  static DomMatrix fromFloat32Array(Float32List array32) native;
-
-  static DomMatrix fromFloat64Array(Float64List array64) native;
-
-  static DomMatrix fromMatrix([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromMatrix_1(other_1);
-    }
-    return _fromMatrix_2();
-  }
-
-  @JSName('fromMatrix')
-  static DomMatrix _fromMatrix_1(other) native;
-  @JSName('fromMatrix')
-  static DomMatrix _fromMatrix_2() native;
-
-  DomMatrix invertSelf() native;
-
-  DomMatrix multiplySelf([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _multiplySelf_1(other_1);
-    }
-    return _multiplySelf_2();
-  }
-
-  @JSName('multiplySelf')
-  DomMatrix _multiplySelf_1(other) native;
-  @JSName('multiplySelf')
-  DomMatrix _multiplySelf_2() native;
-
-  DomMatrix preMultiplySelf([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _preMultiplySelf_1(other_1);
-    }
-    return _preMultiplySelf_2();
-  }
-
-  @JSName('preMultiplySelf')
-  DomMatrix _preMultiplySelf_1(other) native;
-  @JSName('preMultiplySelf')
-  DomMatrix _preMultiplySelf_2() native;
-
-  DomMatrix rotateAxisAngleSelf([num? x, num? y, num? z, num? angle]) native;
-
-  DomMatrix rotateFromVectorSelf([num? x, num? y]) native;
-
-  DomMatrix rotateSelf([num? rotX, num? rotY, num? rotZ]) native;
-
-  DomMatrix scale3dSelf([num? scale, num? originX, num? originY, num? originZ])
-      native;
-
-  DomMatrix scaleSelf(
-      [num? scaleX,
-      num? scaleY,
-      num? scaleZ,
-      num? originX,
-      num? originY,
-      num? originZ]) native;
-
-  DomMatrix setMatrixValue(String transformList) native;
-
-  DomMatrix skewXSelf([num? sx]) native;
-
-  DomMatrix skewYSelf([num? sy]) native;
-
-  DomMatrix translateSelf([num? tx, num? ty, num? tz]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMMatrixReadOnly")
-class DomMatrixReadOnly extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomMatrixReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomMatrixReadOnly([Object? init]) {
-    if (init != null) {
-      return DomMatrixReadOnly._create_1(init);
-    }
-    return DomMatrixReadOnly._create_2();
-  }
-  static DomMatrixReadOnly _create_1(init) =>
-      JS('DomMatrixReadOnly', 'new DOMMatrixReadOnly(#)', init);
-  static DomMatrixReadOnly _create_2() =>
-      JS('DomMatrixReadOnly', 'new DOMMatrixReadOnly()');
-
-  num get a native;
-
-  num get b native;
-
-  num get c native;
-
-  num get d native;
-
-  num get e native;
-
-  num get f native;
-
-  bool get is2D native;
-
-  bool get isIdentity native;
-
-  num get m11 native;
-
-  num get m12 native;
-
-  num get m13 native;
-
-  num get m14 native;
-
-  num get m21 native;
-
-  num get m22 native;
-
-  num get m23 native;
-
-  num get m24 native;
-
-  num get m31 native;
-
-  num get m32 native;
-
-  num get m33 native;
-
-  num get m34 native;
-
-  num get m41 native;
-
-  num get m42 native;
-
-  num get m43 native;
-
-  num get m44 native;
-
-  DomMatrix flipX() native;
-
-  DomMatrix flipY() native;
-
-  static DomMatrixReadOnly fromFloat32Array(Float32List array32) native;
-
-  static DomMatrixReadOnly fromFloat64Array(Float64List array64) native;
-
-  static DomMatrixReadOnly fromMatrix([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromMatrix_1(other_1);
-    }
-    return _fromMatrix_2();
-  }
-
-  @JSName('fromMatrix')
-  static DomMatrixReadOnly _fromMatrix_1(other) native;
-  @JSName('fromMatrix')
-  static DomMatrixReadOnly _fromMatrix_2() native;
-
-  DomMatrix inverse() native;
-
-  DomMatrix multiply([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _multiply_1(other_1);
-    }
-    return _multiply_2();
-  }
-
-  @JSName('multiply')
-  DomMatrix _multiply_1(other) native;
-  @JSName('multiply')
-  DomMatrix _multiply_2() native;
-
-  DomMatrix rotate([num? rotX, num? rotY, num? rotZ]) native;
-
-  DomMatrix rotateAxisAngle([num? x, num? y, num? z, num? angle]) native;
-
-  DomMatrix rotateFromVector([num? x, num? y]) native;
-
-  DomMatrix scale(
-      [num? scaleX,
-      num? scaleY,
-      num? scaleZ,
-      num? originX,
-      num? originY,
-      num? originZ]) native;
-
-  DomMatrix scale3d([num? scale, num? originX, num? originY, num? originZ])
-      native;
-
-  DomMatrix skewX([num? sx]) native;
-
-  DomMatrix skewY([num? sy]) native;
-
-  Float32List toFloat32Array() native;
-
-  Float64List toFloat64Array() native;
-
-  DomPoint transformPoint([Map? point]) {
-    if (point != null) {
-      var point_1 = convertDartToNative_Dictionary(point);
-      return _transformPoint_1(point_1);
-    }
-    return _transformPoint_2();
-  }
-
-  @JSName('transformPoint')
-  DomPoint _transformPoint_1(point) native;
-  @JSName('transformPoint')
-  DomPoint _transformPoint_2() native;
-
-  DomMatrix translate([num? tx, num? ty, num? tz]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMParser")
-class DomParser extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomParser._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomParser() {
-    return DomParser._create_1();
-  }
-  static DomParser _create_1() => JS('DomParser', 'new DOMParser()');
-
-  Document parseFromString(String str, String type) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMPoint")
-class DomPoint extends DomPointReadOnly {
-  // To suppress missing implicit constructor warnings.
-  factory DomPoint._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomPoint([num? x, num? y, num? z, num? w]) {
-    if (w != null) {
-      return DomPoint._create_1(x, y, z, w);
-    }
-    if (z != null) {
-      return DomPoint._create_2(x, y, z);
-    }
-    if (y != null) {
-      return DomPoint._create_3(x, y);
-    }
-    if (x != null) {
-      return DomPoint._create_4(x);
-    }
-    return DomPoint._create_5();
-  }
-  static DomPoint _create_1(x, y, z, w) =>
-      JS('DomPoint', 'new DOMPoint(#,#,#,#)', x, y, z, w);
-  static DomPoint _create_2(x, y, z) =>
-      JS('DomPoint', 'new DOMPoint(#,#,#)', x, y, z);
-  static DomPoint _create_3(x, y) => JS('DomPoint', 'new DOMPoint(#,#)', x, y);
-  static DomPoint _create_4(x) => JS('DomPoint', 'new DOMPoint(#)', x);
-  static DomPoint _create_5() => JS('DomPoint', 'new DOMPoint()');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      JS('bool', '!!(window.DOMPoint) || !!(window.WebKitPoint)');
-
-  // Shadowing definition.
-
-  num get w native;
-
-  set w(num value) native;
-
-  // Shadowing definition.
-
-  num get x native;
-
-  set x(num value) native;
-
-  // Shadowing definition.
-
-  num get y native;
-
-  set y(num value) native;
-
-  // Shadowing definition.
-
-  num get z native;
-
-  set z(num value) native;
-
-  static DomPoint fromPoint([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromPoint_1(other_1);
-    }
-    return _fromPoint_2();
-  }
-
-  @JSName('fromPoint')
-  static DomPoint _fromPoint_1(other) native;
-  @JSName('fromPoint')
-  static DomPoint _fromPoint_2() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMPointReadOnly")
-class DomPointReadOnly extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomPointReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomPointReadOnly([num? x, num? y, num? z, num? w]) {
-    if (w != null) {
-      return DomPointReadOnly._create_1(x, y, z, w);
-    }
-    if (z != null) {
-      return DomPointReadOnly._create_2(x, y, z);
-    }
-    if (y != null) {
-      return DomPointReadOnly._create_3(x, y);
-    }
-    if (x != null) {
-      return DomPointReadOnly._create_4(x);
-    }
-    return DomPointReadOnly._create_5();
-  }
-  static DomPointReadOnly _create_1(x, y, z, w) =>
-      JS('DomPointReadOnly', 'new DOMPointReadOnly(#,#,#,#)', x, y, z, w);
-  static DomPointReadOnly _create_2(x, y, z) =>
-      JS('DomPointReadOnly', 'new DOMPointReadOnly(#,#,#)', x, y, z);
-  static DomPointReadOnly _create_3(x, y) =>
-      JS('DomPointReadOnly', 'new DOMPointReadOnly(#,#)', x, y);
-  static DomPointReadOnly _create_4(x) =>
-      JS('DomPointReadOnly', 'new DOMPointReadOnly(#)', x);
-  static DomPointReadOnly _create_5() =>
-      JS('DomPointReadOnly', 'new DOMPointReadOnly()');
-
-  num get w native;
-
-  num get x native;
-
-  num get y native;
-
-  num get z native;
-
-  static DomPointReadOnly fromPoint([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromPoint_1(other_1);
-    }
-    return _fromPoint_2();
-  }
-
-  @JSName('fromPoint')
-  static DomPointReadOnly _fromPoint_1(other) native;
-  @JSName('fromPoint')
-  static DomPointReadOnly _fromPoint_2() native;
-
-  DomPoint matrixTransform([Map? matrix]) {
-    if (matrix != null) {
-      var matrix_1 = convertDartToNative_Dictionary(matrix);
-      return _matrixTransform_1(matrix_1);
-    }
-    return _matrixTransform_2();
-  }
-
-  @JSName('matrixTransform')
-  DomPoint _matrixTransform_1(matrix) native;
-  @JSName('matrixTransform')
-  DomPoint _matrixTransform_2() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMQuad")
-class DomQuad extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomQuad._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomQuad([Map? p1, Map? p2, Map? p3, Map? p4]) {
-    if (p4 != null) {
-      var p1_1 = convertDartToNative_Dictionary(p1);
-      var p2_2 = convertDartToNative_Dictionary(p2);
-      var p3_3 = convertDartToNative_Dictionary(p3);
-      var p4_4 = convertDartToNative_Dictionary(p4);
-      return DomQuad._create_1(p1_1, p2_2, p3_3, p4_4);
-    }
-    if (p3 != null) {
-      var p1_1 = convertDartToNative_Dictionary(p1);
-      var p2_2 = convertDartToNative_Dictionary(p2);
-      var p3_3 = convertDartToNative_Dictionary(p3);
-      return DomQuad._create_2(p1_1, p2_2, p3_3);
-    }
-    if (p2 != null) {
-      var p1_1 = convertDartToNative_Dictionary(p1);
-      var p2_2 = convertDartToNative_Dictionary(p2);
-      return DomQuad._create_3(p1_1, p2_2);
-    }
-    if (p1 != null) {
-      var p1_1 = convertDartToNative_Dictionary(p1);
-      return DomQuad._create_4(p1_1);
-    }
-    return DomQuad._create_5();
-  }
-  static DomQuad _create_1(p1, p2, p3, p4) =>
-      JS('DomQuad', 'new DOMQuad(#,#,#,#)', p1, p2, p3, p4);
-  static DomQuad _create_2(p1, p2, p3) =>
-      JS('DomQuad', 'new DOMQuad(#,#,#)', p1, p2, p3);
-  static DomQuad _create_3(p1, p2) => JS('DomQuad', 'new DOMQuad(#,#)', p1, p2);
-  static DomQuad _create_4(p1) => JS('DomQuad', 'new DOMQuad(#)', p1);
-  static DomQuad _create_5() => JS('DomQuad', 'new DOMQuad()');
-
-  DomPoint get p1 native;
-
-  DomPoint get p2 native;
-
-  DomPoint get p3 native;
-
-  DomPoint get p4 native;
-
-  static DomQuad fromQuad([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromQuad_1(other_1);
-    }
-    return _fromQuad_2();
-  }
-
-  @JSName('fromQuad')
-  static DomQuad _fromQuad_1(other) native;
-  @JSName('fromQuad')
-  static DomQuad _fromQuad_2() native;
-
-  static DomQuad fromRect([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromRect_1(other_1);
-    }
-    return _fromRect_2();
-  }
-
-  @JSName('fromRect')
-  static DomQuad _fromRect_1(other) native;
-  @JSName('fromRect')
-  static DomQuad _fromRect_2() native;
-
-  Rectangle getBounds() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ClientRectList,DOMRectList")
-class DomRectList extends Interceptor
-    with ListMixin<Rectangle>, ImmutableListMixin<Rectangle>
-    implements List<Rectangle>, JavaScriptIndexingBehavior<Rectangle> {
-  // To suppress missing implicit constructor warnings.
-  factory DomRectList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Rectangle operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Rectangle", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Rectangle value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Rectangle> mixins.
-  // Rectangle is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Rectangle get first {
-    if (this.length > 0) {
-      return JS('Rectangle', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Rectangle get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Rectangle', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Rectangle get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Rectangle', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Rectangle elementAt(int index) => this[index];
-  // -- end List<Rectangle> mixins.
-
-  Rectangle? item(int index) native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("DOMRectReadOnly")
-class DomRectReadOnly extends Interceptor implements Rectangle {
-  // NOTE! All code below should be common with RectangleBase.
-  String toString() {
-    return 'Rectangle ($left, $top) $width x $height';
-  }
-
-  bool operator ==(other) =>
-      other is Rectangle &&
-      left == other.left &&
-      top == other.top &&
-      width == other.width &&
-      height == other.height;
-
-  int get hashCode => _JenkinsSmiHash.hash4(
-      left.hashCode, top.hashCode, width.hashCode, height.hashCode);
-
-  /**
-   * Computes the intersection of `this` and [other].
-   *
-   * The intersection of two axis-aligned rectangles, if any, is always another
-   * axis-aligned rectangle.
-   *
-   * Returns the intersection of this and `other`, or null if they don't
-   * intersect.
-   */
-  Rectangle? intersection(Rectangle other) {
-    var x0 = max(left, other.left);
-    var x1 = min(left + width, other.left + other.width);
-
-    if (x0 <= x1) {
-      var y0 = max(top, other.top);
-      var y1 = min(top + height, other.top + other.height);
-
-      if (y0 <= y1) {
-        return new Rectangle(x0, y0, x1 - x0, y1 - y0);
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Returns true if `this` intersects [other].
-   */
-  bool intersects(Rectangle<num> other) {
-    return (left <= other.left + other.width &&
-        other.left <= left + width &&
-        top <= other.top + other.height &&
-        other.top <= top + height);
-  }
-
-  /**
-   * Returns a new rectangle which completely contains `this` and [other].
-   */
-  Rectangle boundingBox(Rectangle other) {
-    var right = max(this.left + this.width, other.left + other.width);
-    var bottom = max(this.top + this.height, other.top + other.height);
-
-    var left = min(this.left, other.left);
-    var top = min(this.top, other.top);
-
-    return new Rectangle(left, top, right - left, bottom - top);
-  }
-
-  /**
-   * Tests whether `this` entirely contains [another].
-   */
-  bool containsRectangle(Rectangle<num> another) {
-    return left <= another.left &&
-        left + width >= another.left + another.width &&
-        top <= another.top &&
-        top + height >= another.top + another.height;
-  }
-
-  /**
-   * Tests whether [another] is inside or along the edges of `this`.
-   */
-  bool containsPoint(Point<num> another) {
-    return another.x >= left &&
-        another.x <= left + width &&
-        another.y >= top &&
-        another.y <= top + height;
-  }
-
-  Point get topLeft => new Point(this.left, this.top);
-  Point get topRight => new Point(this.left + this.width, this.top);
-  Point get bottomRight =>
-      new Point(this.left + this.width, this.top + this.height);
-  Point get bottomLeft => new Point(this.left, this.top + this.height);
-
-  // To suppress missing implicit constructor warnings.
-  factory DomRectReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DomRectReadOnly([num? x, num? y, num? width, num? height]) {
-    if (height != null) {
-      return DomRectReadOnly._create_1(x, y, width, height);
-    }
-    if (width != null) {
-      return DomRectReadOnly._create_2(x, y, width);
-    }
-    if (y != null) {
-      return DomRectReadOnly._create_3(x, y);
-    }
-    if (x != null) {
-      return DomRectReadOnly._create_4(x);
-    }
-    return DomRectReadOnly._create_5();
-  }
-  static DomRectReadOnly _create_1(x, y, width, height) => JS(
-      'DomRectReadOnly', 'new DOMRectReadOnly(#,#,#,#)', x, y, width, height);
-  static DomRectReadOnly _create_2(x, y, width) =>
-      JS('DomRectReadOnly', 'new DOMRectReadOnly(#,#,#)', x, y, width);
-  static DomRectReadOnly _create_3(x, y) =>
-      JS('DomRectReadOnly', 'new DOMRectReadOnly(#,#)', x, y);
-  static DomRectReadOnly _create_4(x) =>
-      JS('DomRectReadOnly', 'new DOMRectReadOnly(#)', x);
-  static DomRectReadOnly _create_5() =>
-      JS('DomRectReadOnly', 'new DOMRectReadOnly()');
-
-  num get bottom native;
-
-  num get height native;
-
-  num get left native;
-
-  num get right native;
-
-  num get top native;
-
-  num get width native;
-
-  num get x native;
-
-  num get y native;
-
-  static DomRectReadOnly fromRect([Map? other]) {
-    if (other != null) {
-      var other_1 = convertDartToNative_Dictionary(other);
-      return _fromRect_1(other_1);
-    }
-    return _fromRect_2();
-  }
-
-  @JSName('fromRect')
-  static DomRectReadOnly _fromRect_1(other) native;
-  @JSName('fromRect')
-  static DomRectReadOnly _fromRect_2() native;
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("DOMStringList")
-class DomStringList extends Interceptor
-    with ListMixin<String>, ImmutableListMixin<String>
-    implements JavaScriptIndexingBehavior<String>, List<String> {
-  // To suppress missing implicit constructor warnings.
-  factory DomStringList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  String operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("String", "#[#]", this, index);
-  }
-
-  void operator []=(int index, String value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<String> mixins.
-  // String is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  String get first {
-    if (this.length > 0) {
-      return JS('String', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  String get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('String', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  String get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('String', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  String elementAt(int index) => this[index];
-  // -- end List<String> mixins.
-
-  String? item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMStringMap")
-class DomStringMap extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomStringMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void __delete__(String name) native;
-
-  void __setter__(String name, String value) native;
-
-  String item(String name) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DOMTokenList")
-class DomTokenList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DomTokenList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  String get value native;
-
-  set value(String value) native;
-
-  void add(String tokens) native;
-
-  bool contains(String token) native;
-
-  String? item(int index) native;
-
-  void remove(String tokens) native;
-
-  void replace(String token, String newToken) native;
-
-  bool supports(String token) native;
-
-  bool toggle(String token, [bool? force]) native;
-}
-// Copyright (c) 2012, 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.
-
-class _ChildrenElementList extends ListBase<Element>
-    implements NodeListWrapper {
-  // Raw Element.
-  final Element _element;
-  final HtmlCollection _childElements;
-
-  _ChildrenElementList._wrap(Element element)
-      : _childElements = element._children as HtmlCollection,
-        _element = element;
-
-  bool contains(Object? element) => _childElements.contains(element);
-
-  bool get isEmpty {
-    return _element._firstElementChild == null;
-  }
-
-  int get length {
-    return _childElements.length;
-  }
-
-  Element operator [](int index) {
-    return _childElements[index] as Element;
-  }
-
-  void operator []=(int index, Element value) {
-    _element._replaceChild(value, _childElements[index]);
-  }
-
-  set length(int newLength) {
-    // TODO(jacobr): remove children when length is reduced.
-    throw new UnsupportedError('Cannot resize element lists');
-  }
-
-  Element add(Element value) {
-    _element.append(value);
-    return value;
-  }
-
-  Iterator<Element> get iterator => toList().iterator;
-
-  void addAll(Iterable<Element> iterable) {
-    if (iterable is _ChildNodeListLazy) {
-      iterable = new List.from(iterable);
-    }
-
-    for (Element element in iterable) {
-      _element.append(element);
-    }
-  }
-
-  void sort([int compare(Element a, Element b)?]) {
-    throw new UnsupportedError('Cannot sort element lists');
-  }
-
-  void shuffle([Random? random]) {
-    throw new UnsupportedError('Cannot shuffle element lists');
-  }
-
-  void removeWhere(bool test(Element element)) {
-    _filter(test, false);
-  }
-
-  void retainWhere(bool test(Element element)) {
-    _filter(test, true);
-  }
-
-  void _filter(bool test(Element element), bool retainMatching) {
-    var removed;
-    if (retainMatching) {
-      removed = _element.children.where((e) => !test(e));
-    } else {
-      removed = _element.children.where(test);
-    }
-    for (var e in removed) e.remove();
-  }
-
-  void fillRange(int start, int end, [Element? fillValue]) {
-    throw new UnimplementedError();
-  }
-
-  void replaceRange(int start, int end, Iterable<Element> iterable) {
-    throw new UnimplementedError();
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnimplementedError();
-  }
-
-  void setRange(int start, int end, Iterable<Element> iterable,
-      [int skipCount = 0]) {
-    throw new UnimplementedError();
-  }
-
-  bool remove(Object? object) {
-    if (object is Element) {
-      Element element = object;
-      if (identical(element.parentNode, _element)) {
-        _element._removeChild(element);
-        return true;
-      }
-    }
-    return false;
-  }
-
-  void insert(int index, Element element) {
-    if (index < 0 || index > length) {
-      throw new RangeError.range(index, 0, length);
-    }
-    if (index == length) {
-      _element.append(element);
-    } else {
-      _element.insertBefore(element, this[index]);
-    }
-  }
-
-  void insertAll(int index, Iterable<Element> iterable) {
-    throw new UnimplementedError();
-  }
-
-  void setAll(int index, Iterable<Element> iterable) {
-    throw new UnimplementedError();
-  }
-
-  void clear() {
-    _element._clearChildren();
-  }
-
-  Element removeAt(int index) {
-    final result = this[index];
-    // TODO(41258): Remove null check after unfork/strong mode.
-    if (result != null) {
-      _element._removeChild(result);
-    }
-    return result;
-  }
-
-  Element removeLast() {
-    final result = this.last;
-    _element._removeChild(result);
-    return result;
-  }
-
-  Element get first {
-    Element? result = _element._firstElementChild;
-    if (result == null) throw new StateError("No elements");
-    return result;
-  }
-
-  Element get last {
-    Element? result = _element._lastElementChild;
-    if (result == null) throw new StateError("No elements");
-    return result;
-  }
-
-  Element get single {
-    if (length > 1) throw new StateError("More than one element");
-    return first;
-  }
-
-  List<Node> get rawList => _childElements;
-}
-
-/**
- * An immutable list containing HTML elements. This list contains some
- * additional methods when compared to regular lists for ease of CSS
- * manipulation on a group of elements.
- */
-abstract class ElementList<T extends Element> extends ListBase<T> {
-  /**
-   * The union of all CSS classes applied to the elements in this list.
-   *
-   * This set makes it easy to add, remove or toggle (add if not present, remove
-   * if present) the classes applied to a collection of elements.
-   *
-   *     htmlList.classes.add('selected');
-   *     htmlList.classes.toggle('isOnline');
-   *     htmlList.classes.remove('selected');
-   */
-  CssClassSet get classes;
-
-  /** Replace the classes with `value` for every element in this list. */
-  set classes(Iterable<String> value);
-
-  /**
-   * Access the union of all [CssStyleDeclaration]s that are associated with an
-   * [ElementList].
-   *
-   * Grouping the style objects all together provides easy editing of specific
-   * properties of a collection of elements. Setting a specific property value
-   * will set that property in all [Element]s in the [ElementList]. Getting a
-   * specific property value will return the value of the property of the first
-   * element in the [ElementList].
-   */
-  CssStyleDeclarationBase get style;
-
-  /**
-   * Access dimensions and position of the Elements in this list.
-   *
-   * Setting the height or width properties will set the height or width
-   * property for all elements in the list. This returns a rectangle with the
-   * dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Getting the height or width returns the height or width of the
-   * first Element in this list.
-   *
-   * Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not.
-   */
-  CssRect get contentEdge;
-
-  /**
-   * Access dimensions and position of the first Element's content + padding box
-   * in this list.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not. This
-   * can be used to retrieve jQuery's `innerHeight` value for an element. This
-   * is also a rectangle equalling the dimensions of clientHeight and
-   * clientWidth.
-   */
-  CssRect get paddingEdge;
-
-  /**
-   * Access dimensions and position of the first Element's content + padding +
-   * border box in this list.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not. This
-   * can be used to retrieve jQuery's `outerHeight` value for an element.
-   */
-  CssRect get borderEdge;
-
-  /**
-   * Access dimensions and position of the first Element's content + padding +
-   * border + margin box in this list.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not. This
-   * can be used to retrieve jQuery's `outerHeight` value for an element.
-   */
-  CssRect get marginEdge;
-
-  /// Stream of `abort` events handled by this [Element].
-  ElementStream<Event> get onAbort;
-
-  /// Stream of `beforecopy` events handled by this [Element].
-  ElementStream<Event> get onBeforeCopy;
-
-  /// Stream of `beforecut` events handled by this [Element].
-  ElementStream<Event> get onBeforeCut;
-
-  /// Stream of `beforepaste` events handled by this [Element].
-  ElementStream<Event> get onBeforePaste;
-
-  /// Stream of `blur` events handled by this [Element].
-  ElementStream<Event> get onBlur;
-
-  ElementStream<Event> get onCanPlay;
-
-  ElementStream<Event> get onCanPlayThrough;
-
-  /// Stream of `change` events handled by this [Element].
-  ElementStream<Event> get onChange;
-
-  /// Stream of `click` events handled by this [Element].
-  ElementStream<MouseEvent> get onClick;
-
-  /// Stream of `contextmenu` events handled by this [Element].
-  ElementStream<MouseEvent> get onContextMenu;
-
-  /// Stream of `copy` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onCopy;
-
-  /// Stream of `cut` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onCut;
-
-  /// Stream of `doubleclick` events handled by this [Element].
-  @DomName('Element.ondblclick')
-  ElementStream<Event> get onDoubleClick;
-
-  /**
-   * A stream of `drag` events fired when this element currently being dragged.
-   *
-   * A `drag` event is added to this stream as soon as the drag begins.
-   * A `drag` event is also added to this stream at intervals while the drag
-   * operation is still ongoing.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDrag;
-
-  /**
-   * A stream of `dragend` events fired when this element completes a drag
-   * operation.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragEnd;
-
-  /**
-   * A stream of `dragenter` events fired when a dragged object is first dragged
-   * over this element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragEnter;
-
-  /**
-   * A stream of `dragleave` events fired when an object being dragged over this
-   * element leaves this element's target area.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragLeave;
-
-  /**
-   * A stream of `dragover` events fired when a dragged object is currently
-   * being dragged over this element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragOver;
-
-  /**
-   * A stream of `dragstart` events fired when this element starts being
-   * dragged.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragStart;
-
-  /**
-   * A stream of `drop` events fired when a dragged object is dropped on this
-   * element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDrop;
-
-  ElementStream<Event> get onDurationChange;
-
-  ElementStream<Event> get onEmptied;
-
-  ElementStream<Event> get onEnded;
-
-  /// Stream of `error` events handled by this [Element].
-  ElementStream<Event> get onError;
-
-  /// Stream of `focus` events handled by this [Element].
-  ElementStream<Event> get onFocus;
-
-  /// Stream of `input` events handled by this [Element].
-  ElementStream<Event> get onInput;
-
-  /// Stream of `invalid` events handled by this [Element].
-  ElementStream<Event> get onInvalid;
-
-  /// Stream of `keydown` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyDown;
-
-  /// Stream of `keypress` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyPress;
-
-  /// Stream of `keyup` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyUp;
-
-  /// Stream of `load` events handled by this [Element].
-  ElementStream<Event> get onLoad;
-
-  ElementStream<Event> get onLoadedData;
-
-  ElementStream<Event> get onLoadedMetadata;
-
-  /// Stream of `mousedown` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseDown;
-
-  /// Stream of `mouseenter` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseEnter;
-
-  /// Stream of `mouseleave` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseLeave;
-
-  /// Stream of `mousemove` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseMove;
-
-  /// Stream of `mouseout` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseOut;
-
-  /// Stream of `mouseover` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseOver;
-
-  /// Stream of `mouseup` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseUp;
-
-  /// Stream of `mousewheel` events handled by this [Element].
-  ElementStream<WheelEvent> get onMouseWheel;
-
-  /// Stream of `paste` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onPaste;
-
-  ElementStream<Event> get onPause;
-
-  ElementStream<Event> get onPlay;
-
-  ElementStream<Event> get onPlaying;
-
-  ElementStream<Event> get onRateChange;
-
-  /// Stream of `reset` events handled by this [Element].
-  ElementStream<Event> get onReset;
-
-  ElementStream<Event> get onResize;
-
-  /// Stream of `scroll` events handled by this [Element].
-  ElementStream<Event> get onScroll;
-
-  /// Stream of `search` events handled by this [Element].
-  ElementStream<Event> get onSearch;
-
-  ElementStream<Event> get onSeeked;
-
-  ElementStream<Event> get onSeeking;
-
-  /// Stream of `select` events handled by this [Element].
-  ElementStream<Event> get onSelect;
-
-  /// Stream of `selectstart` events handled by this [Element].
-  ElementStream<Event> get onSelectStart;
-
-  ElementStream<Event> get onStalled;
-
-  /// Stream of `submit` events handled by this [Element].
-  ElementStream<Event> get onSubmit;
-
-  ElementStream<Event> get onSuspend;
-
-  ElementStream<Event> get onTimeUpdate;
-
-  /// Stream of `touchcancel` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchCancel;
-
-  /// Stream of `touchend` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchEnd;
-
-  /// Stream of `touchenter` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchEnter;
-
-  /// Stream of `touchleave` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchLeave;
-
-  /// Stream of `touchmove` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchMove;
-
-  /// Stream of `touchstart` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchStart;
-
-  /// Stream of `transitionend` events handled by this [Element].
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  ElementStream<TransitionEvent> get onTransitionEnd;
-
-  ElementStream<Event> get onVolumeChange;
-
-  ElementStream<Event> get onWaiting;
-
-  /// Stream of `fullscreenchange` events handled by this [Element].
-  ElementStream<Event> get onFullscreenChange;
-
-  /// Stream of `fullscreenerror` events handled by this [Element].
-  ElementStream<Event> get onFullscreenError;
-
-  ElementStream<WheelEvent> get onWheel;
-}
-
-// Wrapper over an immutable NodeList to make it implement ElementList.
-//
-// Clients are {`Document`, `DocumentFragment`}.`querySelectorAll` which are
-// declared to return `ElementList`.  This provides all the static analysis
-// benefit so there is no need for this class have a constrained type parameter.
-//
-class _FrozenElementList<E extends Element> extends ListBase<E>
-    implements ElementList<E>, NodeListWrapper {
-  final List<Node> _nodeList;
-
-  _FrozenElementList._wrap(this._nodeList) {
-    assert(this._nodeList.every((element) => element is E),
-        "Query expects only HTML elements of type $E but found ${this._nodeList.firstWhere((e) => e is! E)}");
-  }
-
-  int get length => _nodeList.length;
-
-  E operator [](int index) => _nodeList[index] as E;
-
-  void operator []=(int index, E value) {
-    throw new UnsupportedError('Cannot modify list');
-  }
-
-  set length(int newLength) {
-    throw new UnsupportedError('Cannot modify list');
-  }
-
-  void sort([Comparator<E>? compare]) {
-    throw new UnsupportedError('Cannot sort list');
-  }
-
-  void shuffle([Random? random]) {
-    throw new UnsupportedError('Cannot shuffle list');
-  }
-
-  E get first => _nodeList.first as E;
-
-  E get last => _nodeList.last as E;
-
-  E get single => _nodeList.single as E;
-
-  CssClassSet get classes => new _MultiElementCssClassSet(this);
-
-  CssStyleDeclarationBase get style => new _CssStyleDeclarationSet(this);
-
-  set classes(Iterable<String> value) {
-    // TODO(sra): This might be faster for Sets:
-    //
-    //     new _MultiElementCssClassSet(this).writeClasses(value)
-    //
-    // as the code below converts the Iterable[value] to a string multiple
-    // times.  Maybe compute the string and set className here.
-    forEach((e) => e.classes = value);
-  }
-
-  CssRect get contentEdge => new _ContentCssListRect(this);
-
-  CssRect get paddingEdge => this.first.paddingEdge;
-
-  CssRect get borderEdge => this.first.borderEdge;
-
-  CssRect get marginEdge => this.first.marginEdge;
-
-  List<Node> get rawList => _nodeList;
-
-  /// Stream of `abort` events handled by this [Element].
-  ElementStream<Event> get onAbort => Element.abortEvent._forElementList(this);
-
-  /// Stream of `beforecopy` events handled by this [Element].
-  ElementStream<Event> get onBeforeCopy =>
-      Element.beforeCopyEvent._forElementList(this);
-
-  /// Stream of `beforecut` events handled by this [Element].
-  ElementStream<Event> get onBeforeCut =>
-      Element.beforeCutEvent._forElementList(this);
-
-  /// Stream of `beforepaste` events handled by this [Element].
-  ElementStream<Event> get onBeforePaste =>
-      Element.beforePasteEvent._forElementList(this);
-
-  /// Stream of `blur` events handled by this [Element].
-  ElementStream<Event> get onBlur => Element.blurEvent._forElementList(this);
-
-  ElementStream<Event> get onCanPlay =>
-      Element.canPlayEvent._forElementList(this);
-
-  ElementStream<Event> get onCanPlayThrough =>
-      Element.canPlayThroughEvent._forElementList(this);
-
-  /// Stream of `change` events handled by this [Element].
-  ElementStream<Event> get onChange =>
-      Element.changeEvent._forElementList(this);
-
-  /// Stream of `click` events handled by this [Element].
-  ElementStream<MouseEvent> get onClick =>
-      Element.clickEvent._forElementList(this);
-
-  /// Stream of `contextmenu` events handled by this [Element].
-  ElementStream<MouseEvent> get onContextMenu =>
-      Element.contextMenuEvent._forElementList(this);
-
-  /// Stream of `copy` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onCopy =>
-      Element.copyEvent._forElementList(this);
-
-  /// Stream of `cut` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onCut =>
-      Element.cutEvent._forElementList(this);
-
-  /// Stream of `doubleclick` events handled by this [Element].
-  @DomName('Element.ondblclick')
-  ElementStream<Event> get onDoubleClick =>
-      Element.doubleClickEvent._forElementList(this);
-
-  /**
-   * A stream of `drag` events fired when this element currently being dragged.
-   *
-   * A `drag` event is added to this stream as soon as the drag begins.
-   * A `drag` event is also added to this stream at intervals while the drag
-   * operation is still ongoing.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDrag =>
-      Element.dragEvent._forElementList(this);
-
-  /**
-   * A stream of `dragend` events fired when this element completes a drag
-   * operation.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragEnd =>
-      Element.dragEndEvent._forElementList(this);
-
-  /**
-   * A stream of `dragenter` events fired when a dragged object is first dragged
-   * over this element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragEnter =>
-      Element.dragEnterEvent._forElementList(this);
-
-  /**
-   * A stream of `dragleave` events fired when an object being dragged over this
-   * element leaves this element's target area.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragLeave =>
-      Element.dragLeaveEvent._forElementList(this);
-
-  /**
-   * A stream of `dragover` events fired when a dragged object is currently
-   * being dragged over this element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragOver =>
-      Element.dragOverEvent._forElementList(this);
-
-  /**
-   * A stream of `dragstart` events fired when this element starts being
-   * dragged.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragStart =>
-      Element.dragStartEvent._forElementList(this);
-
-  /**
-   * A stream of `drop` events fired when a dragged object is dropped on this
-   * element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDrop =>
-      Element.dropEvent._forElementList(this);
-
-  ElementStream<Event> get onDurationChange =>
-      Element.durationChangeEvent._forElementList(this);
-
-  ElementStream<Event> get onEmptied =>
-      Element.emptiedEvent._forElementList(this);
-
-  ElementStream<Event> get onEnded => Element.endedEvent._forElementList(this);
-
-  /// Stream of `error` events handled by this [Element].
-  ElementStream<Event> get onError => Element.errorEvent._forElementList(this);
-
-  /// Stream of `focus` events handled by this [Element].
-  ElementStream<Event> get onFocus => Element.focusEvent._forElementList(this);
-
-  /// Stream of `input` events handled by this [Element].
-  ElementStream<Event> get onInput => Element.inputEvent._forElementList(this);
-
-  /// Stream of `invalid` events handled by this [Element].
-  ElementStream<Event> get onInvalid =>
-      Element.invalidEvent._forElementList(this);
-
-  /// Stream of `keydown` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyDown =>
-      Element.keyDownEvent._forElementList(this);
-
-  /// Stream of `keypress` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyPress =>
-      Element.keyPressEvent._forElementList(this);
-
-  /// Stream of `keyup` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyUp =>
-      Element.keyUpEvent._forElementList(this);
-
-  /// Stream of `load` events handled by this [Element].
-  ElementStream<Event> get onLoad => Element.loadEvent._forElementList(this);
-
-  ElementStream<Event> get onLoadedData =>
-      Element.loadedDataEvent._forElementList(this);
-
-  ElementStream<Event> get onLoadedMetadata =>
-      Element.loadedMetadataEvent._forElementList(this);
-
-  /// Stream of `mousedown` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseDown =>
-      Element.mouseDownEvent._forElementList(this);
-
-  /// Stream of `mouseenter` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseEnter =>
-      Element.mouseEnterEvent._forElementList(this);
-
-  /// Stream of `mouseleave` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseLeave =>
-      Element.mouseLeaveEvent._forElementList(this);
-
-  /// Stream of `mousemove` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseMove =>
-      Element.mouseMoveEvent._forElementList(this);
-
-  /// Stream of `mouseout` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseOut =>
-      Element.mouseOutEvent._forElementList(this);
-
-  /// Stream of `mouseover` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseOver =>
-      Element.mouseOverEvent._forElementList(this);
-
-  /// Stream of `mouseup` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseUp =>
-      Element.mouseUpEvent._forElementList(this);
-
-  /// Stream of `mousewheel` events handled by this [Element].
-  ElementStream<WheelEvent> get onMouseWheel =>
-      Element.mouseWheelEvent._forElementList(this);
-
-  /// Stream of `paste` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onPaste =>
-      Element.pasteEvent._forElementList(this);
-
-  ElementStream<Event> get onPause => Element.pauseEvent._forElementList(this);
-
-  ElementStream<Event> get onPlay => Element.playEvent._forElementList(this);
-
-  ElementStream<Event> get onPlaying =>
-      Element.playingEvent._forElementList(this);
-
-  ElementStream<Event> get onRateChange =>
-      Element.rateChangeEvent._forElementList(this);
-
-  /// Stream of `reset` events handled by this [Element].
-  ElementStream<Event> get onReset => Element.resetEvent._forElementList(this);
-
-  ElementStream<Event> get onResize =>
-      Element.resizeEvent._forElementList(this);
-
-  /// Stream of `scroll` events handled by this [Element].
-  ElementStream<Event> get onScroll =>
-      Element.scrollEvent._forElementList(this);
-
-  /// Stream of `search` events handled by this [Element].
-  ElementStream<Event> get onSearch =>
-      Element.searchEvent._forElementList(this);
-
-  ElementStream<Event> get onSeeked =>
-      Element.seekedEvent._forElementList(this);
-
-  ElementStream<Event> get onSeeking =>
-      Element.seekingEvent._forElementList(this);
-
-  /// Stream of `select` events handled by this [Element].
-  ElementStream<Event> get onSelect =>
-      Element.selectEvent._forElementList(this);
-
-  /// Stream of `selectstart` events handled by this [Element].
-  ElementStream<Event> get onSelectStart =>
-      Element.selectStartEvent._forElementList(this);
-
-  ElementStream<Event> get onStalled =>
-      Element.stalledEvent._forElementList(this);
-
-  /// Stream of `submit` events handled by this [Element].
-  ElementStream<Event> get onSubmit =>
-      Element.submitEvent._forElementList(this);
-
-  ElementStream<Event> get onSuspend =>
-      Element.suspendEvent._forElementList(this);
-
-  ElementStream<Event> get onTimeUpdate =>
-      Element.timeUpdateEvent._forElementList(this);
-
-  /// Stream of `touchcancel` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchCancel =>
-      Element.touchCancelEvent._forElementList(this);
-
-  /// Stream of `touchend` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchEnd =>
-      Element.touchEndEvent._forElementList(this);
-
-  /// Stream of `touchenter` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchEnter =>
-      Element.touchEnterEvent._forElementList(this);
-
-  /// Stream of `touchleave` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchLeave =>
-      Element.touchLeaveEvent._forElementList(this);
-
-  /// Stream of `touchmove` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchMove =>
-      Element.touchMoveEvent._forElementList(this);
-
-  /// Stream of `touchstart` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchStart =>
-      Element.touchStartEvent._forElementList(this);
-
-  /// Stream of `transitionend` events handled by this [Element].
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  ElementStream<TransitionEvent> get onTransitionEnd =>
-      Element.transitionEndEvent._forElementList(this);
-
-  ElementStream<Event> get onVolumeChange =>
-      Element.volumeChangeEvent._forElementList(this);
-
-  ElementStream<Event> get onWaiting =>
-      Element.waitingEvent._forElementList(this);
-
-  /// Stream of `fullscreenchange` events handled by this [Element].
-  ElementStream<Event> get onFullscreenChange =>
-      Element.fullscreenChangeEvent._forElementList(this);
-
-  /// Stream of `fullscreenerror` events handled by this [Element].
-  ElementStream<Event> get onFullscreenError =>
-      Element.fullscreenErrorEvent._forElementList(this);
-
-  ElementStream<WheelEvent> get onWheel =>
-      Element.wheelEvent._forElementList(this);
-}
-
-/**
- * An abstract class, which all HTML elements extend.
- */
-@Native("Element")
-class Element extends Node
-    implements
-        NonDocumentTypeChildNode,
-        GlobalEventHandlers,
-        ParentNode,
-        ChildNode {
-  /**
-   * Creates an HTML element from a valid fragment of HTML.
-   *
-   *     var element = new Element.html('<div class="foo">content</div>');
-   *
-   * The HTML fragment should contain only one single root element, any
-   * leading or trailing text nodes will be removed.
-   *
-   * The HTML fragment is parsed as if it occurred within the context of a
-   * `<body>` tag, this means that special elements such as `<caption>` which
-   * must be parsed within the scope of a `<table>` element will be dropped. Use
-   * [createFragment] to parse contextual HTML fragments.
-   *
-   * Unless a validator is provided this will perform the default validation
-   * and remove all scriptable elements and attributes.
-   *
-   * See also:
-   *
-   * * [NodeValidator]
-   *
-   */
-  factory Element.html(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    var fragment = document.body!.createFragment(html,
-        validator: validator, treeSanitizer: treeSanitizer);
-
-    return fragment.nodes.where((e) => e is Element).single as Element;
-  }
-
-  /**
-   * Custom element creation constructor.
-   *
-   * This constructor is used by the DOM when a custom element has been
-   * created. It can only be invoked by subclasses of Element from
-   * that classes created constructor.
-   *
-   *     class CustomElement extends Element {
-   *       factory CustomElement() => new Element.tag('x-custom');
-   *
-   *       CustomElement.created() : super.created() {
-   *          // Perform any element initialization.
-   *       }
-   *     }
-   *     document.registerElement('x-custom', CustomElement);
-   */
-  Element.created() : super._created();
-
-  /**
-   * Creates the HTML element specified by the tag name.
-   *
-   * This is similar to [Document.createElement].
-   * [tag] should be a valid HTML tag name. If [tag] is an unknown tag then
-   * this will create an [UnknownElement].
-   *
-   *     var divElement = new Element.tag('div');
-   *     print(divElement is DivElement); // 'true'
-   *     var myElement = new Element.tag('unknownTag');
-   *     print(myElement is UnknownElement); // 'true'
-   *
-   * For standard elements it is better to use the element type constructors:
-   *
-   *     var element = new DivElement();
-   *
-   * It is better to use e.g `new CanvasElement()` because the type of the
-   * expression is `CanvasElement`, whereas the type of `Element.tag` is the
-   * less specific `Element`.
-   *
-   * See also:
-   *
-   * * [isTagSupported]
-   */
-  factory Element.tag(String tag, [String? typeExtension]) =>
-      _ElementFactoryProvider.createElement_tag(tag, typeExtension);
-
-  /// Creates a new `<a>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('a')`.
-  factory Element.a() => new AnchorElement();
-
-  /// Creates a new `<article>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('article')`.
-  factory Element.article() => new Element.tag('article');
-
-  /// Creates a new `<aside>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('aside')`.
-  factory Element.aside() => new Element.tag('aside');
-
-  /// Creates a new `<audio>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('audio')`.
-  factory Element.audio() => new Element.tag('audio');
-
-  /// Creates a new `<br>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('br')`.
-  factory Element.br() => new BRElement();
-
-  /// Creates a new `<canvas>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('canvas')`.
-  factory Element.canvas() => new CanvasElement();
-
-  /// Creates a new `<div>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('div')`.
-  factory Element.div() => new DivElement();
-
-  /// Creates a new `<footer>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('footer')`.
-  factory Element.footer() => new Element.tag('footer');
-
-  /// Creates a new `<header>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('header')`.
-  factory Element.header() => new Element.tag('header');
-
-  /// Creates a new `<hr>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('hr')`.
-  factory Element.hr() => new Element.tag('hr');
-
-  /// Creates a new `<iframe>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('iframe')`.
-  factory Element.iframe() => new Element.tag('iframe');
-
-  /// Creates a new `<img>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('img')`.
-  factory Element.img() => new Element.tag('img');
-
-  /// Creates a new `<li>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('li')`.
-  factory Element.li() => new Element.tag('li');
-
-  /// Creates a new `<nav>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('nav')`.
-  factory Element.nav() => new Element.tag('nav');
-
-  /// Creates a new `<ol>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('ol')`.
-  factory Element.ol() => new Element.tag('ol');
-
-  /// Creates a new `<option>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('option')`.
-  factory Element.option() => new Element.tag('option');
-
-  /// Creates a new `<p>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('p')`.
-  factory Element.p() => new Element.tag('p');
-
-  /// Creates a new `<pre>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('pre')`.
-  factory Element.pre() => new Element.tag('pre');
-
-  /// Creates a new `<section>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('section')`.
-  factory Element.section() => new Element.tag('section');
-
-  /// Creates a new `<select>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('select')`.
-  factory Element.select() => new Element.tag('select');
-
-  /// Creates a new `<span>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('span')`.
-  factory Element.span() => new Element.tag('span');
-
-  /// Creates a new `<svg>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('svg')`.
-  factory Element.svg() => new Element.tag('svg');
-
-  /// Creates a new `<table>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('table')`.
-  factory Element.table() => new Element.tag('table');
-
-  /// Creates a new `<td>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('td')`.
-  factory Element.td() => new Element.tag('td');
-
-  /// Creates a new `<textarea>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('textarea')`.
-  factory Element.textarea() => new Element.tag('textarea');
-
-  /// Creates a new `<th>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('th')`.
-  factory Element.th() => new Element.tag('th');
-
-  /// Creates a new `<tr>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('tr')`.
-  factory Element.tr() => new Element.tag('tr');
-
-  /// Creates a new `<ul>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('ul')`.
-  factory Element.ul() => new Element.tag('ul');
-
-  /// Creates a new `<video>` element.
-  ///
-  /// This is equivalent to calling `new Element.tag('video')`.
-  factory Element.video() => new Element.tag('video');
-
-  /**
-   * All attributes on this element.
-   *
-   * Any modifications to the attribute map will automatically be applied to
-   * this element.
-   *
-   * This only includes attributes which are not in a namespace
-   * (such as 'xlink:href'), additional attributes can be accessed via
-   * [getNamespacedAttributes].
-   */
-  Map<String, String> get attributes => new _ElementAttributeMap(this);
-
-  set attributes(Map<String, String> value) {
-    Map<String, String> attributes = this.attributes;
-    attributes.clear();
-    for (String key in value.keys) {
-      attributes[key] = value[key]!;
-    }
-  }
-
-  @pragma('dart2js:tryInline')
-  String? getAttribute(String name) {
-    // TODO(41258): Delete this assertion after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    assert(name != null, 'Attribute name cannot be null');
-    return _getAttribute(name);
-  }
-
-  @pragma('dart2js:tryInline')
-  String? getAttributeNS(String? namespaceURI, String name) {
-    // TODO(41258): Delete this assertion after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    // [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
-    assert(name != null, 'Attribute name cannot be null');
-    return _getAttributeNS(namespaceURI, name);
-  }
-
-  @pragma('dart2js:tryInline')
-  bool hasAttribute(String name) {
-    // TODO(41258): Delete this assertion after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    assert(name != null, 'Attribute name cannot be null');
-    return _hasAttribute(name);
-  }
-
-  @pragma('dart2js:tryInline')
-  bool hasAttributeNS(String? namespaceURI, String name) {
-    // TODO(41258): Delete this assertion after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    // [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
-    assert(name != null, 'Attribute name cannot be null');
-    return _hasAttributeNS(namespaceURI, name);
-  }
-
-  @pragma('dart2js:tryInline')
-  void removeAttribute(String name) {
-    // TODO(41258): Delete this assertion after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    assert(name != null, 'Attribute name cannot be null');
-    _removeAttribute(name);
-  }
-
-  @pragma('dart2js:tryInline')
-  void removeAttributeNS(String? namespaceURI, String name) {
-    // TODO(41258): Delete this assertion after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    assert(name != null, 'Attribute name cannot be null');
-    _removeAttributeNS(namespaceURI, name);
-  }
-
-  @pragma('dart2js:tryInline')
-  void setAttribute(String name, String value) {
-    // TODO(41258): Delete these assertions after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    assert(name != null, 'Attribute name cannot be null');
-    // TODO(sra): assert(value != null, 'Attribute value cannot be null.');
-    _setAttribute(name, value);
-  }
-
-  @pragma('dart2js:tryInline')
-  void setAttributeNS(String? namespaceURI, String name, String value) {
-    // TODO(41258): Delete these assertions after forcing strong mode.
-    // Protect [name] against string conversion to "null" or "undefined".
-    assert(name != null, 'Attribute name cannot be null');
-    // TODO(sra): assert(value != null, 'Attribute value cannot be null.');
-    _setAttributeNS(namespaceURI, name, value);
-  }
-
-  /**
-   * List of the direct children of this element.
-   *
-   * This collection can be used to add and remove elements from the document.
-   *
-   *     var item = new DivElement();
-   *     item.text = 'Something';
-   *     document.body.children.add(item) // Item is now displayed on the page.
-   *     for (var element in document.body.children) {
-   *       element.style.background = 'red'; // Turns every child of body red.
-   *     }
-   */
-  List<Element> get children => new _ChildrenElementList._wrap(this);
-
-  set children(List<Element> value) {
-    // Copy list first since we don't want liveness during iteration.
-    var copy = value.toList();
-    var children = this.children;
-    children.clear();
-    children.addAll(copy);
-  }
-
-  /**
-   * Finds all descendent elements of this element that match the specified
-   * group of selectors.
-   *
-   * [selectors] should be a string using CSS selector syntax.
-   *
-   *     var items = element.querySelectorAll('.itemClassName');
-   *
-   * For details about CSS selector syntax, see the
-   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
-   */
-  ElementList<T> querySelectorAll<T extends Element>(String selectors) =>
-      new _FrozenElementList<T>._wrap(_querySelectorAll(selectors));
-
-  @JSName('setApplyScroll')
-  void _setApplyScroll(ScrollStateCallback scrollStateCallback,
-      String nativeScrollBehavior) native;
-
-  Future<ScrollState> setApplyScroll(String nativeScrollBehavior) {
-    var completer = new Completer<ScrollState>();
-    _setApplyScroll((value) {
-      completer.complete(value);
-    }, nativeScrollBehavior);
-    return completer.future;
-  }
-
-  @JSName('setDistributeScroll')
-  void _setDistributeScroll(ScrollStateCallback scrollStateCallback,
-      String nativeScrollBehavior) native;
-
-  Future<ScrollState> setDistributeScroll(String nativeScrollBehavior) {
-    var completer = new Completer<ScrollState>();
-    _setDistributeScroll((value) {
-      completer.complete(value);
-    }, nativeScrollBehavior);
-    return completer.future;
-  }
-
-  /**
-   * The set of CSS classes applied to this element.
-   *
-   * This set makes it easy to add, remove or toggle the classes applied to
-   * this element.
-   *
-   *     element.classes.add('selected');
-   *     element.classes.toggle('isOnline');
-   *     element.classes.remove('selected');
-   */
-  CssClassSet get classes => new _ElementCssClassSet(this);
-
-  set classes(Iterable<String> value) {
-    // TODO(sra): Do this without reading the classes in clear() and addAll(),
-    // or writing the classes in clear().
-    CssClassSet classSet = classes;
-    classSet.clear();
-    classSet.addAll(value);
-  }
-
-  /**
-   * Allows access to all custom data attributes (data-*) set on this element.
-   *
-   * The keys for the map must follow these rules:
-   *
-   * * The name must not begin with 'xml'.
-   * * The name cannot contain a semi-colon (';').
-   * * The name cannot contain any capital letters.
-   *
-   * Any keys from markup will be converted to camel-cased keys in the map.
-   *
-   * For example, HTML specified as:
-   *
-   *     <div data-my-random-value='value'></div>
-   *
-   * Would be accessed in Dart as:
-   *
-   *     var value = element.dataset['myRandomValue'];
-   *
-   * See also:
-   *
-   * * [Custom data
-   *   attributes](http://dev.w3.org/html5/spec-preview/global-attributes.html#custom-data-attribute)
-   */
-  Map<String, String> get dataset => new _DataAttributeMap(attributes);
-
-  set dataset(Map<String, String> value) {
-    final data = this.dataset;
-    data.clear();
-    for (String key in value.keys) {
-      data[key] = value[key]!;
-    }
-  }
-
-  /**
-   * Gets a map for manipulating the attributes of a particular namespace.
-   *
-   * This is primarily useful for SVG attributes such as xref:link.
-   */
-  Map<String, String> getNamespacedAttributes(String namespace) {
-    return new _NamespacedAttributeMap(this, namespace);
-  }
-
-  /**
-   * The set of all CSS values applied to this element, including inherited
-   * and default values.
-   *
-   * The computedStyle contains values that are inherited from other
-   * sources, such as parent elements or stylesheets. This differs from the
-   * [style] property, which contains only the values specified directly on this
-   * element.
-   *
-   * PseudoElement can be values such as `::after`, `::before`, `::marker`,
-   * `::line-marker`.
-   *
-   * See also:
-   *
-   * * [Cascade and Inheritance](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Cascade_and_inheritance)
-   *   from MDN.
-   * * [Pseudo-elements](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)
-   *   from MDN.
-   */
-  CssStyleDeclaration getComputedStyle([String? pseudoElement]) {
-    if (pseudoElement == null) {
-      pseudoElement = '';
-    }
-    // TODO(jacobr): last param should be null, see b/5045788
-    return window._getComputedStyle(this, pseudoElement);
-  }
-
-  /**
-   * Gets the position of this element relative to the client area of the page.
-   */
-  Rectangle get client =>
-      new Rectangle(clientLeft, clientTop, clientWidth, clientHeight);
-
-  /**
-   * Gets the offset of this element relative to its offsetParent.
-   */
-  Rectangle get offset =>
-      new Rectangle(offsetLeft, offsetTop, offsetWidth, offsetHeight);
-
-  /**
-   * Adds the specified text after the last child of this element.
-   */
-  void appendText(String text) {
-    this.append(new Text(text));
-  }
-
-  /**
-   * Parses the specified text as HTML and adds the resulting node after the
-   * last child of this element.
-   */
-  void appendHtml(String text,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    this.insertAdjacentHtml('beforeend', text,
-        validator: validator, treeSanitizer: treeSanitizer);
-  }
-
-  /**
-   * Checks to see if the tag name is supported by the current platform.
-   *
-   * The tag should be a valid HTML tag name.
-   */
-  static bool isTagSupported(String tag) {
-    var e = _ElementFactoryProvider.createElement_tag(tag, null);
-    return e is Element && !(e is UnknownElement);
-  }
-
-  /**
-   * Called by the DOM when this element has been inserted into the live
-   * document.
-   *
-   * More information can be found in the
-   * [Custom Elements](http://w3c.github.io/webcomponents/spec/custom/#dfn-attached-callback)
-   * draft specification.
-   */
-  void attached() {
-    // For the deprecation period, call the old callback.
-    enteredView();
-  }
-
-  /**
-   * Called by the DOM when this element has been removed from the live
-   * document.
-   *
-   * More information can be found in the
-   * [Custom Elements](http://w3c.github.io/webcomponents/spec/custom/#dfn-detached-callback)
-   * draft specification.
-   */
-  void detached() {
-    // For the deprecation period, call the old callback.
-    leftView();
-  }
-
-  /** *Deprecated*: override [attached] instead. */
-  @deprecated
-  void enteredView() {}
-
-  List<Rectangle> getClientRects() {
-    var value = _getClientRects();
-
-    // If no prototype we need one for the world to hookup to the proper Dart class.
-    var jsProto = JS('', '#.prototype', value);
-    if (jsProto == null) {
-      JS('', '#.prototype = Object.create(null)', value);
-    }
-
-    applyExtension('DOMRectList', value);
-
-    return value;
-  }
-
-  /** *Deprecated*: override [detached] instead. */
-  @deprecated
-  void leftView() {}
-
-  /**
-   * Creates a new AnimationEffect object whose target element is the object
-   * on which the method is called, and calls the play() method of the
-   * AnimationTimeline object of the document timeline of the node document
-   * of the element, passing the newly created AnimationEffect as the argument
-   * to the method. Returns an Animation for the effect.
-   *
-   * Examples
-   *
-   *     var animation = elem.animate([{"opacity": 75}, {"opacity": 0}], 200);
-   *
-   *     var animation = elem.animate([
-   *       {"transform": "translate(100px, -100%)"},
-   *       {"transform" : "translate(400px, 500px)"}
-   *     ], 1500);
-   *
-   * The [frames] parameter is an Iterable<Map>, where the
-   * map entries specify CSS animation effects. The
-   * [timing] paramter can be a double, representing the number of milliseconds
-   * for the transition, or a Map with fields corresponding to those
-   * of the [Timing] object.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME, '36')
-  Animation animate(Iterable<Map<String, dynamic>> frames, [timing]) {
-    if (frames is! Iterable || !(frames.every((x) => x is Map))) {
-      throw new ArgumentError("The frames parameter should be a List of Maps "
-          "with frame information");
-    }
-    var convertedFrames;
-    if (frames is Iterable) {
-      convertedFrames = frames.map(convertDartToNative_Dictionary).toList();
-    } else {
-      convertedFrames = frames;
-    }
-    var convertedTiming =
-        timing is Map ? convertDartToNative_Dictionary(timing) : timing;
-    return convertedTiming == null
-        ? _animate(convertedFrames)
-        : _animate(convertedFrames, convertedTiming);
-  }
-
-  @JSName('animate')
-  Animation _animate(Object effect, [timing]) native;
-  /**
-   * Called by the DOM whenever an attribute on this has been changed.
-   */
-  void attributeChanged(String name, String oldValue, String newValue) {}
-
-  @Returns('String')
-  // Non-null for Elements.
-  String get localName => JS('String', '#', _localName);
-
-  /**
-   * A URI that identifies the XML namespace of this element.
-   *
-   * `null` if no namespace URI is specified.
-   *
-   * ## Other resources
-   *
-   * * [Node.namespaceURI](http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSname)
-   *   from W3C.
-   */
-  String? get namespaceUri => _namespaceUri;
-
-  /**
-   * The string representation of this element.
-   *
-   * This is equivalent to reading the [localName] property.
-   */
-  String toString() => localName;
-
-  /**
-   * Scrolls this element into view.
-   *
-   * Only one of of the alignment options may be specified at a time.
-   *
-   * If no options are specified then this will attempt to scroll the minimum
-   * amount needed to bring the element into view.
-   *
-   * Note that alignCenter is currently only supported on WebKit platforms. If
-   * alignCenter is specified but not supported then this will fall back to
-   * alignTop.
-   *
-   * See also:
-   *
-   * * [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
-   *   from MDN.
-   * * [scrollIntoViewIfNeeded](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded)
-   *   from MDN.
-   */
-  void scrollIntoView([ScrollAlignment? alignment]) {
-    var hasScrollIntoViewIfNeeded = true;
-    hasScrollIntoViewIfNeeded =
-        JS('bool', '!!(#.scrollIntoViewIfNeeded)', this);
-    if (alignment == ScrollAlignment.TOP) {
-      this._scrollIntoView(true);
-    } else if (alignment == ScrollAlignment.BOTTOM) {
-      this._scrollIntoView(false);
-    } else if (hasScrollIntoViewIfNeeded) {
-      if (alignment == ScrollAlignment.CENTER) {
-        this._scrollIntoViewIfNeeded(true);
-      } else {
-        this._scrollIntoViewIfNeeded();
-      }
-    } else {
-      this._scrollIntoView();
-    }
-  }
-
-  /**
-   * Static factory designed to expose `mousewheel` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<WheelEvent> mouseWheelEvent =
-      const _CustomEventStreamProvider<WheelEvent>(
-          Element._determineMouseWheelEventType);
-
-  static String _determineMouseWheelEventType(EventTarget e) => 'wheel';
-
-  /**
-   * Static factory designed to expose `transitionend` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TransitionEvent> transitionEndEvent =
-      const _CustomEventStreamProvider<TransitionEvent>(
-          Element._determineTransitionEventType);
-
-  static String _determineTransitionEventType(EventTarget e) {
-    // Unfortunately the normal 'ontransitionend' style checks don't work here.
-    if (Device.isWebKit) {
-      return 'webkitTransitionEnd';
-    } else if (Device.isOpera) {
-      return 'oTransitionEnd';
-    }
-    return 'transitionend';
-  }
-
-  /**
-   * Inserts text into the DOM at the specified location.
-   *
-   * To see the possible values for [where], read the doc for
-   * [insertAdjacentHtml].
-   *
-   * See also:
-   *
-   * * [insertAdjacentHtml]
-   */
-  void insertAdjacentText(String where, String text) {
-    if (JS('bool', '!!#.insertAdjacentText', this)) {
-      _insertAdjacentText(where, text);
-    } else {
-      _insertAdjacentNode(where, new Text(text));
-    }
-  }
-
-  @JSName('insertAdjacentText')
-  void _insertAdjacentText(String where, String text) native;
-
-  /**
-   * Parses text as an HTML fragment and inserts it into the DOM at the
-   * specified location.
-   *
-   * The [where] parameter indicates where to insert the HTML fragment:
-   *
-   * * 'beforeBegin': Immediately before this element.
-   * * 'afterBegin': As the first child of this element.
-   * * 'beforeEnd': As the last child of this element.
-   * * 'afterEnd': Immediately after this element.
-   *
-   *     var html = '<div class="something">content</div>';
-   *     // Inserts as the first child
-   *     document.body.insertAdjacentHtml('afterBegin', html);
-   *     var createdElement = document.body.children[0];
-   *     print(createdElement.classes[0]); // Prints 'something'
-   *
-   * See also:
-   *
-   * * [insertAdjacentText]
-   * * [insertAdjacentElement]
-   */
-  void insertAdjacentHtml(String where, String html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
-      _insertAdjacentHtml(where, html);
-    } else {
-      _insertAdjacentNode(
-          where,
-          createFragment(html,
-              validator: validator, treeSanitizer: treeSanitizer));
-    }
-  }
-
-  @JSName('insertAdjacentHTML')
-  void _insertAdjacentHtml(String where, String text) native;
-
-  /**
-   * Inserts [element] into the DOM at the specified location.
-   *
-   * To see the possible values for [where], read the doc for
-   * [insertAdjacentHtml].
-   *
-   * See also:
-   *
-   * * [insertAdjacentHtml]
-   */
-  Element insertAdjacentElement(String where, Element element) {
-    if (JS('bool', '!!#.insertAdjacentElement', this)) {
-      _insertAdjacentElement(where, element);
-    } else {
-      _insertAdjacentNode(where, element);
-    }
-    return element;
-  }
-
-  @JSName('insertAdjacentElement')
-  void _insertAdjacentElement(String where, Element element) native;
-
-  void _insertAdjacentNode(String where, Node node) {
-    switch (where.toLowerCase()) {
-      case 'beforebegin':
-        this.parentNode!.insertBefore(node, this);
-        break;
-      case 'afterbegin':
-        var first = this.nodes.length > 0 ? this.nodes[0] : null;
-        this.insertBefore(node, first);
-        break;
-      case 'beforeend':
-        this.append(node);
-        break;
-      case 'afterend':
-        this.parentNode!.insertBefore(node, this.nextNode);
-        break;
-      default:
-        throw new ArgumentError("Invalid position ${where}");
-    }
-  }
-
-  /**
-   * Checks if this element matches the CSS selectors.
-   */
-  bool matches(String selectors) {
-    if (JS('bool', '!!#.matches', this)) {
-      return JS('bool', '#.matches(#)', this, selectors);
-    } else if (JS('bool', '!!#.webkitMatchesSelector', this)) {
-      return JS('bool', '#.webkitMatchesSelector(#)', this, selectors);
-    } else if (JS('bool', '!!#.mozMatchesSelector', this)) {
-      return JS('bool', '#.mozMatchesSelector(#)', this, selectors);
-    } else if (JS('bool', '!!#.msMatchesSelector', this)) {
-      return JS('bool', '#.msMatchesSelector(#)', this, selectors);
-    } else if (JS('bool', '!!#.oMatchesSelector', this)) {
-      return JS('bool', '#.oMatchesSelector(#)', this, selectors);
-    } else {
-      throw new UnsupportedError("Not supported on this platform");
-    }
-  }
-
-  /** Checks if this element or any of its parents match the CSS selectors. */
-  bool matchesWithAncestors(String selectors) {
-    var elem = this as Element?;
-    do {
-      if (elem!.matches(selectors)) return true;
-      elem = elem.parent;
-    } while (elem != null);
-    return false;
-  }
-
-  /**
-   * Creates a new shadow root for this shadow host.
-   *
-   * ## Other resources
-   *
-   * * [Shadow DOM 101](http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom/)
-   *   from HTML5Rocks.
-   * * [Shadow DOM specification](http://www.w3.org/TR/shadow-dom/) from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME, '25')
-  ShadowRoot createShadowRoot() {
-    return JS(
-        'ShadowRoot',
-        '(#.createShadowRoot || #.webkitCreateShadowRoot).call(#)',
-        this,
-        this,
-        this);
-  }
-
-  /**
-   * The shadow root of this shadow host.
-   *
-   * ## Other resources
-   *
-   * * [Shadow DOM 101](http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom/)
-   *   from HTML5Rocks.
-   * * [Shadow DOM specification](http://www.w3.org/TR/shadow-dom/)
-   *   from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME, '25')
-  ShadowRoot? get shadowRoot =>
-      JS('ShadowRoot|Null', '#.shadowRoot || #.webkitShadowRoot', this, this);
-
-  /**
-   * Access this element's content position.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not.
-   *
-   * _Important_ _note_: use of this method _will_ perform CSS calculations that
-   * can trigger a browser reflow. Therefore, use of this property _during_ an
-   * animation frame is discouraged. See also:
-   * [Browser Reflow](https://developers.google.com/speed/articles/reflow)
-   */
-  CssRect get contentEdge => new _ContentCssRect(this);
-
-  /**
-   * Access the dimensions and position of this element's content + padding box.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not. This
-   * can be used to retrieve jQuery's
-   * [innerHeight](http://api.jquery.com/innerHeight/) value for an element.
-   * This is also a rectangle equalling the dimensions of clientHeight and
-   * clientWidth.
-   *
-   * _Important_ _note_: use of this method _will_ perform CSS calculations that
-   * can trigger a browser reflow. Therefore, use of this property _during_ an
-   * animation frame is discouraged. See also:
-   * [Browser Reflow](https://developers.google.com/speed/articles/reflow)
-   */
-  CssRect get paddingEdge => new _PaddingCssRect(this);
-
-  /**
-   * Access the dimensions and position of this element's content + padding +
-   * border box.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not. This
-   * can be used to retrieve jQuery's
-   * [outerHeight](http://api.jquery.com/outerHeight/) value for an element.
-   *
-   * _Important_ _note_: use of this method _will_ perform CSS calculations that
-   * can trigger a browser reflow. Therefore, use of this property _during_ an
-   * animation frame is discouraged. See also:
-   * [Browser Reflow](https://developers.google.com/speed/articles/reflow)
-   */
-  CssRect get borderEdge => new _BorderCssRect(this);
-
-  /**
-   * Access the dimensions and position of this element's content + padding +
-   * border + margin box.
-   *
-   * This returns a rectangle with the dimensions actually available for content
-   * in this element, in pixels, regardless of this element's box-sizing
-   * property. Unlike [getBoundingClientRect], the dimensions of this rectangle
-   * will return the same numerical height if the element is hidden or not. This
-   * can be used to retrieve jQuery's
-   * [outerHeight](http://api.jquery.com/outerHeight/) value for an element.
-   *
-   * _Important_ _note_: use of this method will perform CSS calculations that
-   * can trigger a browser reflow. Therefore, use of this property _during_ an
-   * animation frame is discouraged. See also:
-   * [Browser Reflow](https://developers.google.com/speed/articles/reflow)
-   */
-  CssRect get marginEdge => new _MarginCssRect(this);
-
-  /**
-   * Provides the coordinates of the element relative to the top of the
-   * document.
-   *
-   * This method is the Dart equivalent to jQuery's
-   * [offset](http://api.jquery.com/offset/) method.
-   */
-  Point get documentOffset => offsetTo(document.documentElement!);
-
-  /**
-   * Provides the offset of this element's [borderEdge] relative to the
-   * specified [parent].
-   *
-   * This is the Dart equivalent of jQuery's
-   * [position](http://api.jquery.com/position/) method. Unlike jQuery's
-   * position, however, [parent] can be any parent element of `this`,
-   * rather than only `this`'s immediate [offsetParent]. If the specified
-   * element is _not_ an offset parent or transitive offset parent to this
-   * element, an [ArgumentError] is thrown.
-   */
-  Point offsetTo(Element parent) {
-    return Element._offsetToHelper(this, parent);
-  }
-
-  static Point _offsetToHelper(Element? current, Element parent) {
-    // We're hopping from _offsetParent_ to offsetParent (not just parent), so
-    // offsetParent, "tops out" at BODY. But people could conceivably pass in
-    // the document.documentElement and I want it to return an absolute offset,
-    // so we have the special case checking for HTML.
-    bool sameAsParent = identical(current, parent);
-    bool foundAsParent = sameAsParent || parent.tagName == 'HTML';
-    if (current == null || sameAsParent) {
-      if (foundAsParent) return new Point(0, 0);
-      throw new ArgumentError("Specified element is not a transitive offset "
-          "parent of this element.");
-    }
-    Element? parentOffset = current.offsetParent;
-    Point p = Element._offsetToHelper(parentOffset, parent);
-    return new Point(p.x + current.offsetLeft, p.y + current.offsetTop);
-  }
-
-  static HtmlDocument? _parseDocument;
-  static Range? _parseRange;
-  static NodeValidatorBuilder? _defaultValidator;
-  static _ValidatingTreeSanitizer? _defaultSanitizer;
-
-  /**
-   * Create a DocumentFragment from the HTML fragment and ensure that it follows
-   * the sanitization rules specified by the validator or treeSanitizer.
-   *
-   * If the default validation behavior is too restrictive then a new
-   * NodeValidator should be created, either extending or wrapping a default
-   * validator and overriding the validation APIs.
-   *
-   * The treeSanitizer is used to walk the generated node tree and sanitize it.
-   * A custom treeSanitizer can also be provided to perform special validation
-   * rules but since the API is more complex to implement this is discouraged.
-   *
-   * The returned tree is guaranteed to only contain nodes and attributes which
-   * are allowed by the provided validator.
-   *
-   * See also:
-   *
-   * * [NodeValidator]
-   * * [NodeTreeSanitizer]
-   */
-  DocumentFragment createFragment(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (treeSanitizer == null) {
-      if (validator == null) {
-        if (_defaultValidator == null) {
-          _defaultValidator = new NodeValidatorBuilder.common();
-        }
-        validator = _defaultValidator;
-      }
-      if (_defaultSanitizer == null) {
-        _defaultSanitizer = new _ValidatingTreeSanitizer(validator!);
-      } else {
-        _defaultSanitizer!.validator = validator!;
-      }
-      treeSanitizer = _defaultSanitizer;
-    } else if (validator != null) {
-      throw new ArgumentError(
-          'validator can only be passed if treeSanitizer is null');
-    }
-
-    if (_parseDocument == null) {
-      _parseDocument = document.implementation.createHtmlDocument('');
-      _parseRange = _parseDocument!.createRange();
-
-      // Workaround for Safari bug. Was also previously Chrome bug 229142
-      // - URIs are not resolved in new doc.
-      BaseElement base = _parseDocument!.createElement('base') as BaseElement;
-      base.href = document.baseUri;
-      _parseDocument!.head!.append(base);
-    }
-
-    // TODO(terry): Fixes Chromium 50 change no body after createHtmlDocument()
-    if (_parseDocument!.body == null) {
-      _parseDocument!.body =
-          _parseDocument!.createElement("body") as BodyElement;
-    }
-
-    var contextElement;
-    if (this is BodyElement) {
-      contextElement = _parseDocument!.body!;
-    } else {
-      contextElement = _parseDocument!.createElement(tagName);
-      _parseDocument!.body!.append(contextElement);
-    }
-    var fragment;
-    if (Range.supportsCreateContextualFragment &&
-        _canBeUsedToCreateContextualFragment) {
-      _parseRange!.selectNodeContents(contextElement);
-      // createContextualFragment expects a non-nullable html string.
-      // If null is passed, it gets converted to 'null' instead.
-      fragment = _parseRange!.createContextualFragment(html ?? 'null');
-    } else {
-      contextElement._innerHtml = html;
-
-      fragment = _parseDocument!.createDocumentFragment();
-      while (contextElement.firstChild != null) {
-        fragment.append(contextElement.firstChild);
-      }
-    }
-    if (contextElement != _parseDocument!.body) {
-      contextElement.remove();
-    }
-
-    treeSanitizer!.sanitizeTree(fragment);
-    // Copy the fragment over to the main document (fix for 14184)
-    document.adoptNode(fragment);
-
-    return fragment;
-  }
-
-  /** Test if createContextualFragment is supported for this element type */
-  bool get _canBeUsedToCreateContextualFragment =>
-      !_cannotBeUsedToCreateContextualFragment;
-
-  /** Test if createContextualFragment is NOT supported for this element type */
-  bool get _cannotBeUsedToCreateContextualFragment =>
-      _tagsForWhichCreateContextualFragmentIsNotSupported.contains(tagName);
-
-  /**
-   * A hard-coded list of the tag names for which createContextualFragment
-   * isn't supported.
-   */
-  static const _tagsForWhichCreateContextualFragmentIsNotSupported = const [
-    'HEAD',
-    'AREA',
-    'BASE',
-    'BASEFONT',
-    'BR',
-    'COL',
-    'COLGROUP',
-    'EMBED',
-    'FRAME',
-    'FRAMESET',
-    'HR',
-    'IMAGE',
-    'IMG',
-    'INPUT',
-    'ISINDEX',
-    'LINK',
-    'META',
-    'PARAM',
-    'SOURCE',
-    'STYLE',
-    'TITLE',
-    'WBR'
-  ];
-
-  /**
-   * Parses the HTML fragment and sets it as the contents of this element.
-   *
-   * This uses the default sanitization behavior to sanitize the HTML fragment,
-   * use [setInnerHtml] to override the default behavior.
-   */
-  set innerHtml(String? html) {
-    this.setInnerHtml(html);
-  }
-
-  /**
-   * Parses the HTML fragment and sets it as the contents of this element.
-   * This ensures that the generated content follows the sanitization rules
-   * specified by the validator or treeSanitizer.
-   *
-   * If the default validation behavior is too restrictive then a new
-   * NodeValidator should be created, either extending or wrapping a default
-   * validator and overriding the validation APIs.
-   *
-   * The treeSanitizer is used to walk the generated node tree and sanitize it.
-   * A custom treeSanitizer can also be provided to perform special validation
-   * rules but since the API is more complex to implement this is discouraged.
-   *
-   * The resulting tree is guaranteed to only contain nodes and attributes which
-   * are allowed by the provided validator.
-   *
-   * See also:
-   *
-   * * [NodeValidator]
-   * * [NodeTreeSanitizer]
-   */
-  void setInnerHtml(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    text = null;
-    if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
-      _innerHtml = html;
-    } else {
-      append(createFragment(html,
-          validator: validator, treeSanitizer: treeSanitizer));
-    }
-  }
-
-  String get innerHtml => _innerHtml;
-
-  @JSName('innerText')
-  String get innerText native;
-  set innerText(String value) native;
-
-  /**
-   * This is an ease-of-use accessor for event streams which should only be
-   * used when an explicit accessor is not available.
-   */
-  ElementEvents get on => new ElementEvents(this);
-
-  /**
-   * Verify if any of the attributes that we use in the sanitizer look unexpected,
-   * possibly indicating DOM clobbering attacks.
-   *
-   * Those attributes are: attributes, lastChild, children, previousNode and tagName.
-   */
-  static bool _hasCorruptedAttributes(Element element) {
-    return JS(
-        'bool',
-        r'''
-       (function(element) {
-         if (!(element.attributes instanceof NamedNodeMap)) {
-	   return true;
-	 }
-         // If something has corrupted the traversal we want to detect
-         // these on not only the children (tested below) but on the node itself
-         // in case it was bypassed.
-         if (element["id"] == 'lastChild' || element["name"] == 'lastChild' ||
-             element["id"] == 'previousSibling' || element["name"] == 'previousSibling' ||
-             element["id"] == 'children' || element["name"] == 'children') {
-           return true;
-         }
-	 var childNodes = element.childNodes;
-	 if (element.lastChild &&
-	     element.lastChild !== childNodes[childNodes.length -1]) {
-	   return true;
-	 }
-	 if (element.children) { // On Safari, children can apparently be null.
-  	   if (!((element.children instanceof HTMLCollection) ||
-               (element.children instanceof NodeList))) {
-	     return true;
-	   }
-	 }
-         var length = 0;
-         if (element.children) {
-           length = element.children.length;
-         }
-         for (var i = 0; i < length; i++) {
-           var child = element.children[i];
-           // On IE it seems like we sometimes don't see the clobbered attribute,
-           // perhaps as a result of an over-optimization. Also use another route
-           // to check of attributes, children, or lastChild are clobbered. It may
-           // seem silly to check children as we rely on children to do this iteration,
-           // but it seems possible that the access to children might see the real thing,
-           // allowing us to check for clobbering that may show up in other accesses.
-           if (child["id"] == 'attributes' || child["name"] == 'attributes' ||
-               child["id"] == 'lastChild'  || child["name"] == 'lastChild' ||
-               child["id"] == 'previousSibling'  || child["name"] == 'previousSibling' ||
-               child["id"] == 'children' || child["name"] == 'children') {
-             return true;
-           }
-         }
-	 return false;
-          })(#)''',
-        element);
-  }
-
-  /// A secondary check for corruption, needed on IE
-  static bool _hasCorruptedAttributesAdditionalCheck(Element element) {
-    return JS('bool', r'!(#.attributes instanceof NamedNodeMap)', element);
-  }
-
-  static String _safeTagName(element) {
-    String result = 'element tag unavailable';
-    try {
-      if (element.tagName is String) {
-        result = element.tagName;
-      }
-    } catch (e) {}
-    return result;
-  }
-
-  Element? get offsetParent native;
-
-  int get offsetHeight => JS<num>('num', '#.offsetHeight', this).round();
-
-  int get offsetLeft => JS<num>('num', '#.offsetLeft', this).round();
-
-  int get offsetTop => JS<num>('num', '#.offsetTop', this).round();
-
-  int get offsetWidth => JS<num>('num', '#.offsetWidth', this).round();
-
-  int get scrollHeight => JS<num>('num', '#.scrollHeight', this).round();
-  int get scrollLeft => JS<num>('num', '#.scrollLeft', this).round();
-
-  set scrollLeft(int value) {
-    JS("void", "#.scrollLeft = #", this, value.round());
-  }
-
-  int get scrollTop => JS<num>('num', '#.scrollTop', this).round();
-
-  set scrollTop(int value) {
-    JS("void", "#.scrollTop = #", this, value.round());
-  }
-
-  int get scrollWidth => JS<num>('num', '#.scrollWidth', this).round();
-
-  // To suppress missing implicit constructor warnings.
-  factory Element._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `abort` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> abortEvent =
-      const EventStreamProvider<Event>('abort');
-
-  /**
-   * Static factory designed to expose `beforecopy` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> beforeCopyEvent =
-      const EventStreamProvider<Event>('beforecopy');
-
-  /**
-   * Static factory designed to expose `beforecut` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> beforeCutEvent =
-      const EventStreamProvider<Event>('beforecut');
-
-  /**
-   * Static factory designed to expose `beforepaste` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> beforePasteEvent =
-      const EventStreamProvider<Event>('beforepaste');
-
-  /**
-   * Static factory designed to expose `blur` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> blurEvent =
-      const EventStreamProvider<Event>('blur');
-
-  static const EventStreamProvider<Event> canPlayEvent =
-      const EventStreamProvider<Event>('canplay');
-
-  static const EventStreamProvider<Event> canPlayThroughEvent =
-      const EventStreamProvider<Event>('canplaythrough');
-
-  /**
-   * Static factory designed to expose `change` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  /**
-   * Static factory designed to expose `click` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> clickEvent =
-      const EventStreamProvider<MouseEvent>('click');
-
-  /**
-   * Static factory designed to expose `contextmenu` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> contextMenuEvent =
-      const EventStreamProvider<MouseEvent>('contextmenu');
-
-  /**
-   * Static factory designed to expose `copy` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ClipboardEvent> copyEvent =
-      const EventStreamProvider<ClipboardEvent>('copy');
-
-  /**
-   * Static factory designed to expose `cut` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ClipboardEvent> cutEvent =
-      const EventStreamProvider<ClipboardEvent>('cut');
-
-  /**
-   * Static factory designed to expose `doubleclick` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @DomName('Element.dblclickEvent')
-  static const EventStreamProvider<Event> doubleClickEvent =
-      const EventStreamProvider<Event>('dblclick');
-
-  /**
-   * A stream of `drag` events fired when an element is currently being dragged.
-   *
-   * A `drag` event is added to this stream as soon as the drag begins.
-   * A `drag` event is also added to this stream at intervals while the drag
-   * operation is still ongoing.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dragEvent =
-      const EventStreamProvider<MouseEvent>('drag');
-
-  /**
-   * A stream of `dragend` events fired when an element completes a drag
-   * operation.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dragEndEvent =
-      const EventStreamProvider<MouseEvent>('dragend');
-
-  /**
-   * A stream of `dragenter` events fired when a dragged object is first dragged
-   * over an element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dragEnterEvent =
-      const EventStreamProvider<MouseEvent>('dragenter');
-
-  /**
-   * A stream of `dragleave` events fired when an object being dragged over an
-   * element leaves the element's target area.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dragLeaveEvent =
-      const EventStreamProvider<MouseEvent>('dragleave');
-
-  /**
-   * A stream of `dragover` events fired when a dragged object is currently
-   * being dragged over an element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dragOverEvent =
-      const EventStreamProvider<MouseEvent>('dragover');
-
-  /**
-   * A stream of `dragstart` events for a dragged element whose drag has begun.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dragStartEvent =
-      const EventStreamProvider<MouseEvent>('dragstart');
-
-  /**
-   * A stream of `drop` events fired when a dragged object is dropped on an
-   * element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  static const EventStreamProvider<MouseEvent> dropEvent =
-      const EventStreamProvider<MouseEvent>('drop');
-
-  static const EventStreamProvider<Event> durationChangeEvent =
-      const EventStreamProvider<Event>('durationchange');
-
-  static const EventStreamProvider<Event> emptiedEvent =
-      const EventStreamProvider<Event>('emptied');
-
-  static const EventStreamProvider<Event> endedEvent =
-      const EventStreamProvider<Event>('ended');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `focus` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> focusEvent =
-      const EventStreamProvider<Event>('focus');
-
-  /**
-   * Static factory designed to expose `input` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> inputEvent =
-      const EventStreamProvider<Event>('input');
-
-  /**
-   * Static factory designed to expose `invalid` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> invalidEvent =
-      const EventStreamProvider<Event>('invalid');
-
-  /**
-   * Static factory designed to expose `keydown` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<KeyboardEvent> keyDownEvent =
-      const EventStreamProvider<KeyboardEvent>('keydown');
-
-  /**
-   * Static factory designed to expose `keypress` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<KeyboardEvent> keyPressEvent =
-      const EventStreamProvider<KeyboardEvent>('keypress');
-
-  /**
-   * Static factory designed to expose `keyup` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<KeyboardEvent> keyUpEvent =
-      const EventStreamProvider<KeyboardEvent>('keyup');
-
-  /**
-   * Static factory designed to expose `load` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> loadEvent =
-      const EventStreamProvider<Event>('load');
-
-  static const EventStreamProvider<Event> loadedDataEvent =
-      const EventStreamProvider<Event>('loadeddata');
-
-  static const EventStreamProvider<Event> loadedMetadataEvent =
-      const EventStreamProvider<Event>('loadedmetadata');
-
-  /**
-   * Static factory designed to expose `mousedown` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseDownEvent =
-      const EventStreamProvider<MouseEvent>('mousedown');
-
-  /**
-   * Static factory designed to expose `mouseenter` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseEnterEvent =
-      const EventStreamProvider<MouseEvent>('mouseenter');
-
-  /**
-   * Static factory designed to expose `mouseleave` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseLeaveEvent =
-      const EventStreamProvider<MouseEvent>('mouseleave');
-
-  /**
-   * Static factory designed to expose `mousemove` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseMoveEvent =
-      const EventStreamProvider<MouseEvent>('mousemove');
-
-  /**
-   * Static factory designed to expose `mouseout` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseOutEvent =
-      const EventStreamProvider<MouseEvent>('mouseout');
-
-  /**
-   * Static factory designed to expose `mouseover` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseOverEvent =
-      const EventStreamProvider<MouseEvent>('mouseover');
-
-  /**
-   * Static factory designed to expose `mouseup` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MouseEvent> mouseUpEvent =
-      const EventStreamProvider<MouseEvent>('mouseup');
-
-  /**
-   * Static factory designed to expose `paste` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ClipboardEvent> pasteEvent =
-      const EventStreamProvider<ClipboardEvent>('paste');
-
-  static const EventStreamProvider<Event> pauseEvent =
-      const EventStreamProvider<Event>('pause');
-
-  static const EventStreamProvider<Event> playEvent =
-      const EventStreamProvider<Event>('play');
-
-  static const EventStreamProvider<Event> playingEvent =
-      const EventStreamProvider<Event>('playing');
-
-  static const EventStreamProvider<Event> rateChangeEvent =
-      const EventStreamProvider<Event>('ratechange');
-
-  /**
-   * Static factory designed to expose `reset` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> resetEvent =
-      const EventStreamProvider<Event>('reset');
-
-  static const EventStreamProvider<Event> resizeEvent =
-      const EventStreamProvider<Event>('resize');
-
-  /**
-   * Static factory designed to expose `scroll` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> scrollEvent =
-      const EventStreamProvider<Event>('scroll');
-
-  /**
-   * Static factory designed to expose `search` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> searchEvent =
-      const EventStreamProvider<Event>('search');
-
-  static const EventStreamProvider<Event> seekedEvent =
-      const EventStreamProvider<Event>('seeked');
-
-  static const EventStreamProvider<Event> seekingEvent =
-      const EventStreamProvider<Event>('seeking');
-
-  /**
-   * Static factory designed to expose `select` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> selectEvent =
-      const EventStreamProvider<Event>('select');
-
-  /**
-   * Static factory designed to expose `selectstart` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> selectStartEvent =
-      const EventStreamProvider<Event>('selectstart');
-
-  static const EventStreamProvider<Event> stalledEvent =
-      const EventStreamProvider<Event>('stalled');
-
-  /**
-   * Static factory designed to expose `submit` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> submitEvent =
-      const EventStreamProvider<Event>('submit');
-
-  static const EventStreamProvider<Event> suspendEvent =
-      const EventStreamProvider<Event>('suspend');
-
-  static const EventStreamProvider<Event> timeUpdateEvent =
-      const EventStreamProvider<Event>('timeupdate');
-
-  /**
-   * Static factory designed to expose `touchcancel` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TouchEvent> touchCancelEvent =
-      const EventStreamProvider<TouchEvent>('touchcancel');
-
-  /**
-   * Static factory designed to expose `touchend` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TouchEvent> touchEndEvent =
-      const EventStreamProvider<TouchEvent>('touchend');
-
-  /**
-   * Static factory designed to expose `touchenter` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TouchEvent> touchEnterEvent =
-      const EventStreamProvider<TouchEvent>('touchenter');
-
-  /**
-   * Static factory designed to expose `touchleave` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TouchEvent> touchLeaveEvent =
-      const EventStreamProvider<TouchEvent>('touchleave');
-
-  /**
-   * Static factory designed to expose `touchmove` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TouchEvent> touchMoveEvent =
-      const EventStreamProvider<TouchEvent>('touchmove');
-
-  /**
-   * Static factory designed to expose `touchstart` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TouchEvent> touchStartEvent =
-      const EventStreamProvider<TouchEvent>('touchstart');
-
-  static const EventStreamProvider<Event> volumeChangeEvent =
-      const EventStreamProvider<Event>('volumechange');
-
-  static const EventStreamProvider<Event> waitingEvent =
-      const EventStreamProvider<Event>('waiting');
-
-  /**
-   * Static factory designed to expose `fullscreenchange` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  static const EventStreamProvider<Event> fullscreenChangeEvent =
-      const EventStreamProvider<Event>('webkitfullscreenchange');
-
-  /**
-   * Static factory designed to expose `fullscreenerror` events to event
-   * handlers that are not necessarily instances of [Element].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  static const EventStreamProvider<Event> fullscreenErrorEvent =
-      const EventStreamProvider<Event>('webkitfullscreenerror');
-
-  static const EventStreamProvider<WheelEvent> wheelEvent =
-      const EventStreamProvider<WheelEvent>('wheel');
-
-  String get contentEditable native;
-
-  set contentEditable(String value) native;
-
-  String get dir native;
-
-  set dir(String value) native;
-
-  /**
-   * Indicates whether the element can be dragged and dropped.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-
-  bool get draggable native;
-
-  set draggable(bool value) native;
-
-  /**
-   * Indicates whether the element is not relevant to the page's current state.
-   *
-   * ## Other resources
-   *
-   * * [Hidden attribute
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute)
-   *   from WHATWG.
-   */
-
-  bool get hidden native;
-
-  set hidden(bool value) native;
-
-  bool get inert native;
-
-  set inert(bool value) native;
-
-  String get inputMode native;
-
-  set inputMode(String value) native;
-
-  bool get isContentEditable native;
-
-  String get lang native;
-
-  set lang(String value) native;
-
-  bool get spellcheck native;
-
-  set spellcheck(bool value) native;
-
-  CssStyleDeclaration get style native;
-
-  int get tabIndex native;
-
-  set tabIndex(int value) native;
-
-  String get title native;
-
-  set title(String value) native;
-
-  /**
-   * Specifies whether this element's text content changes when the page is
-   * localized.
-   *
-   * ## Other resources
-   *
-   * * [The translate
-   *   attribute](https://html.spec.whatwg.org/multipage/dom.html#the-translate-attribute)
-   *   from WHATWG.
-   */
-
-  bool get translate native;
-
-  set translate(bool value) native;
-
-  void blur() native;
-
-  void click() native;
-
-  void focus() native;
-
-  AccessibleNode? get accessibleNode native;
-
-  SlotElement? get assignedSlot native;
-
-  @JSName('attributes')
-  _NamedNodeMap get _attributes native;
-
-  String get className native;
-
-  set className(String value) native;
-
-  int get clientHeight native;
-
-  int get clientLeft native;
-
-  int get clientTop native;
-
-  int get clientWidth native;
-
-  String? get computedName native;
-
-  String? get computedRole native;
-
-  String get id native;
-
-  set id(String value) native;
-
-  @JSName('innerHTML')
-  String get _innerHtml native;
-
-  @JSName('innerHTML')
-  set _innerHtml(String? value) native;
-
-  @JSName('localName')
-  String get _localName native;
-
-  @JSName('namespaceURI')
-  String? get _namespaceUri native;
-
-  @JSName('outerHTML')
-  String get outerHtml native;
-
-  @JSName('scrollHeight')
-  int get _scrollHeight native;
-
-  @JSName('scrollLeft')
-  num get _scrollLeft native;
-
-  @JSName('scrollLeft')
-  set _scrollLeft(num value) native;
-
-  @JSName('scrollTop')
-  num get _scrollTop native;
-
-  @JSName('scrollTop')
-  set _scrollTop(num value) native;
-
-  @JSName('scrollWidth')
-  int get _scrollWidth native;
-
-  String get slot native;
-
-  set slot(String value) native;
-
-  StylePropertyMap get styleMap native;
-
-  String get tagName native;
-
-  ShadowRoot attachShadow(Map shadowRootInitDict) {
-    var shadowRootInitDict_1 =
-        convertDartToNative_Dictionary(shadowRootInitDict);
-    return _attachShadow_1(shadowRootInitDict_1);
-  }
-
-  @JSName('attachShadow')
-  ShadowRoot _attachShadow_1(shadowRootInitDict) native;
-
-  Element? closest(String selectors) native;
-
-  List<Animation> getAnimations() native;
-
-  @JSName('getAttribute')
-  String? _getAttribute(String name) native;
-
-  @JSName('getAttributeNS')
-  String? _getAttributeNS(String? namespaceURI, String localName) native;
-
-  List<String> getAttributeNames() native;
-
-  /**
-   * Returns the smallest bounding rectangle that encompasses this element's
-   * padding, scrollbar, and border.
-   *
-   * ## Other resources
-   *
-   * * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element.getBoundingClientRect)
-   *   from MDN.
-   * * [The getBoundingClientRect()
-   *   method](http://www.w3.org/TR/cssom-view/#the-getclientrects()-and-getboundingclientrect()-methods)
-   *   from W3C.
-   */
-  @Creates('_DomRect')
-  @Returns('_DomRect|Null')
-  Rectangle getBoundingClientRect() native;
-
-  @JSName('getClientRects')
-  /**
-   * Returns a list of bounding rectangles for each box associated with this
-   * element.
-   *
-   * ## Other resources
-   *
-   * * [Element.getClientRects](https://developer.mozilla.org/en-US/docs/Web/API/Element.getClientRects)
-   *   from MDN.
-   * * [The getClientRects()
-   *   method](http://www.w3.org/TR/cssom-view/#the-getclientrects()-and-getboundingclientrect()-methods)
-   *   from W3C.
-   */
-  @Creates('DomRectList')
-  @Returns('DomRectList|Null')
-  List<Rectangle> _getClientRects() native;
-
-  /**
-   * Returns a list of shadow DOM insertion points to which this element is
-   * distributed.
-   *
-   * ## Other resources
-   *
-   * * [Shadow DOM
-   *   specification](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html)
-   *   from W3C.
-   */
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getDestinationInsertionPoints() native;
-
-  /**
-   * Returns a list of nodes with the given class name inside this element.
-   *
-   * ## Other resources
-   *
-   * * [getElementsByClassName](https://developer.mozilla.org/en-US/docs/Web/API/document.getElementsByClassName)
-   *   from MDN.
-   * * [DOM specification](http://www.w3.org/TR/domcore/) from W3C.
-   */
-  @Creates('NodeList|HtmlCollection')
-  @Returns('NodeList|HtmlCollection')
-  List<Node> getElementsByClassName(String classNames) native;
-
-  @JSName('getElementsByTagName')
-  @Creates('NodeList|HtmlCollection')
-  @Returns('NodeList|HtmlCollection')
-  List<Node> _getElementsByTagName(String localName) native;
-
-  @JSName('hasAttribute')
-  bool _hasAttribute(String name) native;
-
-  @JSName('hasAttributeNS')
-  bool _hasAttributeNS(String? namespaceURI, String localName) native;
-
-  bool hasPointerCapture(int pointerId) native;
-
-  void releasePointerCapture(int pointerId) native;
-
-  @JSName('removeAttribute')
-  void _removeAttribute(String name) native;
-
-  @JSName('removeAttributeNS')
-  void _removeAttributeNS(String? namespaceURI, String localName) native;
-
-  void requestPointerLock() native;
-
-  void scroll([options_OR_x, num? y]) {
-    if (options_OR_x == null && y == null) {
-      _scroll_1();
-      return;
-    }
-    if ((options_OR_x is Map) && y == null) {
-      var options_1 = convertDartToNative_Dictionary(options_OR_x);
-      _scroll_2(options_1);
-      return;
-    }
-    if (y != null && (options_OR_x is num)) {
-      _scroll_3(options_OR_x, y);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('scroll')
-  void _scroll_1() native;
-  @JSName('scroll')
-  void _scroll_2(options) native;
-  @JSName('scroll')
-  void _scroll_3(num? x, y) native;
-
-  void scrollBy([options_OR_x, num? y]) {
-    if (options_OR_x == null && y == null) {
-      _scrollBy_1();
-      return;
-    }
-    if ((options_OR_x is Map) && y == null) {
-      var options_1 = convertDartToNative_Dictionary(options_OR_x);
-      _scrollBy_2(options_1);
-      return;
-    }
-    if (y != null && (options_OR_x is num)) {
-      _scrollBy_3(options_OR_x, y);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('scrollBy')
-  void _scrollBy_1() native;
-  @JSName('scrollBy')
-  void _scrollBy_2(options) native;
-  @JSName('scrollBy')
-  void _scrollBy_3(num? x, y) native;
-
-  @JSName('scrollIntoView')
-  void _scrollIntoView([Object? arg]) native;
-
-  @JSName('scrollIntoViewIfNeeded')
-  void _scrollIntoViewIfNeeded([bool? centerIfNeeded]) native;
-
-  void scrollTo([options_OR_x, num? y]) {
-    if (options_OR_x == null && y == null) {
-      _scrollTo_1();
-      return;
-    }
-    if ((options_OR_x is Map) && y == null) {
-      var options_1 = convertDartToNative_Dictionary(options_OR_x);
-      _scrollTo_2(options_1);
-      return;
-    }
-    if (y != null && (options_OR_x is num)) {
-      _scrollTo_3(options_OR_x, y);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('scrollTo')
-  void _scrollTo_1() native;
-  @JSName('scrollTo')
-  void _scrollTo_2(options) native;
-  @JSName('scrollTo')
-  void _scrollTo_3(num? x, y) native;
-
-  @JSName('setAttribute')
-  void _setAttribute(String name, String value) native;
-
-  @JSName('setAttributeNS')
-  void _setAttributeNS(String? namespaceURI, String name, String value) native;
-
-  void setPointerCapture(int pointerId) native;
-
-  @JSName('webkitRequestFullscreen')
-  /**
-   * Displays this element fullscreen.
-   *
-   * ## Other resources
-   *
-   * * [Fullscreen
-   *   API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API)
-   *   from MDN.
-   * * [Fullscreen specification](http://www.w3.org/TR/fullscreen/) from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void requestFullscreen() native;
-
-  // From ChildNode
-
-  void after(Object nodes) native;
-
-  void before(Object nodes) native;
-
-  // From NonDocumentTypeChildNode
-
-  Element? get nextElementSibling native;
-
-  Element? get previousElementSibling native;
-
-  // From ParentNode
-
-  @JSName('childElementCount')
-  int get _childElementCount native;
-
-  @JSName('children')
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get _children native;
-
-  @JSName('firstElementChild')
-  Element? get _firstElementChild native;
-
-  @JSName('lastElementChild')
-  Element? get _lastElementChild native;
-
-  /**
-   * Finds the first descendant element of this element that matches the
-   * specified group of selectors.
-   *
-   * [selectors] should be a string using CSS selector syntax.
-   *
-   *     // Gets the first descendant with the class 'classname'
-   *     var element = element.querySelector('.className');
-   *     // Gets the element with id 'id'
-   *     var element = element.querySelector('#id');
-   *     // Gets the first descendant [ImageElement]
-   *     var img = element.querySelector('img');
-   *
-   * For details about CSS selector syntax, see the
-   * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
-   */
-  Element? querySelector(String selectors) native;
-
-  @JSName('querySelectorAll')
-  @Creates('NodeList')
-  @Returns('NodeList')
-  List<Node> _querySelectorAll(String selectors) native;
-
-  /// Stream of `abort` events handled by this [Element].
-  ElementStream<Event> get onAbort => abortEvent.forElement(this);
-
-  /// Stream of `beforecopy` events handled by this [Element].
-  ElementStream<Event> get onBeforeCopy => beforeCopyEvent.forElement(this);
-
-  /// Stream of `beforecut` events handled by this [Element].
-  ElementStream<Event> get onBeforeCut => beforeCutEvent.forElement(this);
-
-  /// Stream of `beforepaste` events handled by this [Element].
-  ElementStream<Event> get onBeforePaste => beforePasteEvent.forElement(this);
-
-  /// Stream of `blur` events handled by this [Element].
-  ElementStream<Event> get onBlur => blurEvent.forElement(this);
-
-  ElementStream<Event> get onCanPlay => canPlayEvent.forElement(this);
-
-  ElementStream<Event> get onCanPlayThrough =>
-      canPlayThroughEvent.forElement(this);
-
-  /// Stream of `change` events handled by this [Element].
-  ElementStream<Event> get onChange => changeEvent.forElement(this);
-
-  /// Stream of `click` events handled by this [Element].
-  ElementStream<MouseEvent> get onClick => clickEvent.forElement(this);
-
-  /// Stream of `contextmenu` events handled by this [Element].
-  ElementStream<MouseEvent> get onContextMenu =>
-      contextMenuEvent.forElement(this);
-
-  /// Stream of `copy` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onCopy => copyEvent.forElement(this);
-
-  /// Stream of `cut` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onCut => cutEvent.forElement(this);
-
-  /// Stream of `doubleclick` events handled by this [Element].
-  @DomName('Element.ondblclick')
-  ElementStream<Event> get onDoubleClick => doubleClickEvent.forElement(this);
-
-  /**
-   * A stream of `drag` events fired when this element currently being dragged.
-   *
-   * A `drag` event is added to this stream as soon as the drag begins.
-   * A `drag` event is also added to this stream at intervals while the drag
-   * operation is still ongoing.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDrag => dragEvent.forElement(this);
-
-  /**
-   * A stream of `dragend` events fired when this element completes a drag
-   * operation.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragEnd => dragEndEvent.forElement(this);
-
-  /**
-   * A stream of `dragenter` events fired when a dragged object is first dragged
-   * over this element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragEnter => dragEnterEvent.forElement(this);
-
-  /**
-   * A stream of `dragleave` events fired when an object being dragged over this
-   * element leaves this element's target area.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragLeave => dragLeaveEvent.forElement(this);
-
-  /**
-   * A stream of `dragover` events fired when a dragged object is currently
-   * being dragged over this element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragOver => dragOverEvent.forElement(this);
-
-  /**
-   * A stream of `dragstart` events fired when this element starts being
-   * dragged.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDragStart => dragStartEvent.forElement(this);
-
-  /**
-   * A stream of `drop` events fired when a dragged object is dropped on this
-   * element.
-   *
-   * ## Other resources
-   *
-   * * [Drag and drop
-   *   sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/dnd/basics)
-   *   based on [the tutorial](http://www.html5rocks.com/en/tutorials/dnd/basics/)
-   *   from HTML5Rocks.
-   * * [Drag and drop
-   *   specification](https://html.spec.whatwg.org/multipage/interaction.html#dnd)
-   *   from WHATWG.
-   */
-  ElementStream<MouseEvent> get onDrop => dropEvent.forElement(this);
-
-  ElementStream<Event> get onDurationChange =>
-      durationChangeEvent.forElement(this);
-
-  ElementStream<Event> get onEmptied => emptiedEvent.forElement(this);
-
-  ElementStream<Event> get onEnded => endedEvent.forElement(this);
-
-  /// Stream of `error` events handled by this [Element].
-  ElementStream<Event> get onError => errorEvent.forElement(this);
-
-  /// Stream of `focus` events handled by this [Element].
-  ElementStream<Event> get onFocus => focusEvent.forElement(this);
-
-  /// Stream of `input` events handled by this [Element].
-  ElementStream<Event> get onInput => inputEvent.forElement(this);
-
-  /// Stream of `invalid` events handled by this [Element].
-  ElementStream<Event> get onInvalid => invalidEvent.forElement(this);
-
-  /// Stream of `keydown` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyDown => keyDownEvent.forElement(this);
-
-  /// Stream of `keypress` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyPress => keyPressEvent.forElement(this);
-
-  /// Stream of `keyup` events handled by this [Element].
-  ElementStream<KeyboardEvent> get onKeyUp => keyUpEvent.forElement(this);
-
-  /// Stream of `load` events handled by this [Element].
-  ElementStream<Event> get onLoad => loadEvent.forElement(this);
-
-  ElementStream<Event> get onLoadedData => loadedDataEvent.forElement(this);
-
-  ElementStream<Event> get onLoadedMetadata =>
-      loadedMetadataEvent.forElement(this);
-
-  /// Stream of `mousedown` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseDown => mouseDownEvent.forElement(this);
-
-  /// Stream of `mouseenter` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseEnter =>
-      mouseEnterEvent.forElement(this);
-
-  /// Stream of `mouseleave` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseLeave =>
-      mouseLeaveEvent.forElement(this);
-
-  /// Stream of `mousemove` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseMove => mouseMoveEvent.forElement(this);
-
-  /// Stream of `mouseout` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseOut => mouseOutEvent.forElement(this);
-
-  /// Stream of `mouseover` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseOver => mouseOverEvent.forElement(this);
-
-  /// Stream of `mouseup` events handled by this [Element].
-  ElementStream<MouseEvent> get onMouseUp => mouseUpEvent.forElement(this);
-
-  /// Stream of `mousewheel` events handled by this [Element].
-  ElementStream<WheelEvent> get onMouseWheel =>
-      mouseWheelEvent.forElement(this);
-
-  /// Stream of `paste` events handled by this [Element].
-  ElementStream<ClipboardEvent> get onPaste => pasteEvent.forElement(this);
-
-  ElementStream<Event> get onPause => pauseEvent.forElement(this);
-
-  ElementStream<Event> get onPlay => playEvent.forElement(this);
-
-  ElementStream<Event> get onPlaying => playingEvent.forElement(this);
-
-  ElementStream<Event> get onRateChange => rateChangeEvent.forElement(this);
-
-  /// Stream of `reset` events handled by this [Element].
-  ElementStream<Event> get onReset => resetEvent.forElement(this);
-
-  ElementStream<Event> get onResize => resizeEvent.forElement(this);
-
-  /// Stream of `scroll` events handled by this [Element].
-  ElementStream<Event> get onScroll => scrollEvent.forElement(this);
-
-  /// Stream of `search` events handled by this [Element].
-  ElementStream<Event> get onSearch => searchEvent.forElement(this);
-
-  ElementStream<Event> get onSeeked => seekedEvent.forElement(this);
-
-  ElementStream<Event> get onSeeking => seekingEvent.forElement(this);
-
-  /// Stream of `select` events handled by this [Element].
-  ElementStream<Event> get onSelect => selectEvent.forElement(this);
-
-  /// Stream of `selectstart` events handled by this [Element].
-  ElementStream<Event> get onSelectStart => selectStartEvent.forElement(this);
-
-  ElementStream<Event> get onStalled => stalledEvent.forElement(this);
-
-  /// Stream of `submit` events handled by this [Element].
-  ElementStream<Event> get onSubmit => submitEvent.forElement(this);
-
-  ElementStream<Event> get onSuspend => suspendEvent.forElement(this);
-
-  ElementStream<Event> get onTimeUpdate => timeUpdateEvent.forElement(this);
-
-  /// Stream of `touchcancel` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchCancel =>
-      touchCancelEvent.forElement(this);
-
-  /// Stream of `touchend` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchEnd => touchEndEvent.forElement(this);
-
-  /// Stream of `touchenter` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchEnter =>
-      touchEnterEvent.forElement(this);
-
-  /// Stream of `touchleave` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchLeave =>
-      touchLeaveEvent.forElement(this);
-
-  /// Stream of `touchmove` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchMove => touchMoveEvent.forElement(this);
-
-  /// Stream of `touchstart` events handled by this [Element].
-  ElementStream<TouchEvent> get onTouchStart =>
-      touchStartEvent.forElement(this);
-
-  /// Stream of `transitionend` events handled by this [Element].
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  ElementStream<TransitionEvent> get onTransitionEnd =>
-      transitionEndEvent.forElement(this);
-
-  ElementStream<Event> get onVolumeChange => volumeChangeEvent.forElement(this);
-
-  ElementStream<Event> get onWaiting => waitingEvent.forElement(this);
-
-  /// Stream of `fullscreenchange` events handled by this [Element].
-  ElementStream<Event> get onFullscreenChange =>
-      fullscreenChangeEvent.forElement(this);
-
-  /// Stream of `fullscreenerror` events handled by this [Element].
-  ElementStream<Event> get onFullscreenError =>
-      fullscreenErrorEvent.forElement(this);
-
-  ElementStream<WheelEvent> get onWheel => wheelEvent.forElement(this);
-}
-
-class _ElementFactoryProvider {
-  // Optimization to improve performance until the dart2js compiler inlines this
-  // method.
-  static dynamic createElement_tag(String tag, String? typeExtension) {
-    // Firefox may return a JS function for some types (Embed, Object).
-    if (typeExtension != null) {
-      return JS('Element|=Object', 'document.createElement(#, #)', tag,
-          typeExtension);
-    }
-    // Should be able to eliminate this and just call the two-arg version above
-    // with null typeExtension, but Chrome treats the tag as case-sensitive if
-    // typeExtension is null.
-    // https://code.google.com/p/chromium/issues/detail?id=282467
-    return JS('Element|=Object', 'document.createElement(#)', tag);
-  }
-}
-
-/**
- * Options for Element.scrollIntoView.
- */
-class ScrollAlignment {
-  final _value;
-  const ScrollAlignment._internal(this._value);
-  toString() => 'ScrollAlignment.$_value';
-
-  /// Attempt to align the element to the top of the scrollable area.
-  static const TOP = const ScrollAlignment._internal('TOP');
-
-  /// Attempt to center the element in the scrollable area.
-  static const CENTER = const ScrollAlignment._internal('CENTER');
-
-  /// Attempt to align the element to the bottom of the scrollable area.
-  static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("HTMLEmbedElement")
-class EmbedElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory EmbedElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory EmbedElement() => document.createElement("embed") as EmbedElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  EmbedElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('embed');
-
-  String get height native;
-
-  set height(String value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  String get width native;
-
-  set width(String value) native;
-
-  Node __getter__(String name) native;
-
-  void __setter__(String name, Node value) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _EntriesCallback(List entries);
-// Copyright (c) 2012, 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.
-
-@Native("Entry")
-class Entry extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Entry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  FileSystem get filesystem native;
-
-  String get fullPath native;
-
-  bool get isDirectory native;
-
-  bool get isFile native;
-
-  String get name native;
-
-  @JSName('copyTo')
-  void _copyTo(DirectoryEntry parent,
-      [String? name,
-      _EntryCallback? successCallback,
-      _ErrorCallback? errorCallback]) native;
-
-  @JSName('copyTo')
-  Future<Entry> copyTo(DirectoryEntry parent, {String? name}) {
-    var completer = new Completer<Entry>();
-    _copyTo(parent, name, (value) {
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('getMetadata')
-  void _getMetadata(MetadataCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  @JSName('getMetadata')
-  Future<Metadata> getMetadata() {
-    var completer = new Completer<Metadata>();
-    _getMetadata((value) {
-      applyExtension('Metadata', value);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('getParent')
-  void _getParent(
-      [_EntryCallback? successCallback, _ErrorCallback? errorCallback]) native;
-
-  @JSName('getParent')
-  Future<Entry> getParent() {
-    var completer = new Completer<Entry>();
-    _getParent((value) {
-      applyExtension('Entry', value);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('moveTo')
-  void _moveTo(DirectoryEntry parent,
-      [String? name,
-      _EntryCallback? successCallback,
-      _ErrorCallback? errorCallback]) native;
-
-  @JSName('moveTo')
-  Future<Entry> moveTo(DirectoryEntry parent, {String? name}) {
-    var completer = new Completer<Entry>();
-    _moveTo(parent, name, (value) {
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('remove')
-  void _remove(VoidCallback successCallback, [_ErrorCallback? errorCallback])
-      native;
-
-  @JSName('remove')
-  Future remove() {
-    var completer = new Completer();
-    _remove(() {
-      completer.complete();
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('toURL')
-  String toUrl() native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _EntryCallback(Entry entry);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _ErrorCallback(DomException error);
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("ErrorEvent")
-class ErrorEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory ErrorEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ErrorEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return ErrorEvent._create_1(type, eventInitDict_1);
-    }
-    return ErrorEvent._create_2(type);
-  }
-  static ErrorEvent _create_1(type, eventInitDict) =>
-      JS('ErrorEvent', 'new ErrorEvent(#,#)', type, eventInitDict);
-  static ErrorEvent _create_2(type) =>
-      JS('ErrorEvent', 'new ErrorEvent(#)', type);
-
-  int get colno native;
-
-  @Creates('Null')
-  Object? get error native;
-
-  String get filename native;
-
-  int get lineno native;
-
-  String get message native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("Event,InputEvent,SubmitEvent")
-class Event extends Interceptor {
-  // In JS, canBubble and cancelable are technically required parameters to
-  // init*Event. In practice, though, if they aren't provided they simply
-  // default to false (since that's Boolean(undefined)).
-  //
-  // Contrary to JS, we default canBubble and cancelable to true, since that's
-  // what people want most of the time anyway.
-  factory Event(String type, {bool canBubble: true, bool cancelable: true}) {
-    return new Event.eventType('Event', type,
-        canBubble: canBubble, cancelable: cancelable);
-  }
-
-  /**
-   * Creates a new Event object of the specified type.
-   *
-   * This is analogous to document.createEvent.
-   * Normally events should be created via their constructors, if available.
-   *
-   *     var e = new Event.type('MouseEvent', 'mousedown', true, true);
-   */
-  factory Event.eventType(String type, String name,
-      {bool canBubble: true, bool cancelable: true}) {
-    final Event e = document._createEvent(type);
-    e._initEvent(name, canBubble, cancelable);
-    return e;
-  }
-
-  /** The CSS selector involved with event delegation. */
-  String? get _selector native;
-  set _selector(String? value) native;
-
-  /**
-   * A pointer to the element whose CSS selector matched within which an event
-   * was fired. If this Event was not associated with any Event delegation,
-   * accessing this value will throw an [UnsupportedError].
-   */
-  Element get matchingTarget {
-    if (_selector == null) {
-      throw new UnsupportedError('Cannot call matchingTarget if this Event did'
-          ' not arise as a result of event delegation.');
-    }
-    Element? currentTarget = this.currentTarget as Element?;
-    Element? target = this.target as Element?;
-    var matchedTarget;
-    do {
-      if (target!.matches(_selector!)) return target;
-      target = target.parent;
-    } while (target != null && target != currentTarget!.parent);
-    throw new StateError('No selector matched for populating matchedTarget.');
-  }
-
-  List<EventTarget> get path =>
-      JS<bool>('bool', '!!#.composedPath', this) ? composedPath() : [];
-
-  factory Event._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return Event._create_1(type, eventInitDict_1);
-    }
-    return Event._create_2(type);
-  }
-  static Event _create_1(type, eventInitDict) =>
-      JS('Event', 'new Event(#,#)', type, eventInitDict);
-  static Event _create_2(type) => JS('Event', 'new Event(#)', type);
-
-  /**
-   * This event is being handled by the event target.
-   *
-   * ## Other resources
-   *
-   * * [Target phase](http://www.w3.org/TR/DOM-Level-3-Events/#target-phase)
-   *   from W3C.
-   */
-  static const int AT_TARGET = 2;
-
-  /**
-   * This event is bubbling up through the target's ancestors.
-   *
-   * ## Other resources
-   *
-   * * [Bubble phase](http://www.w3.org/TR/DOM-Level-3-Events/#bubble-phase)
-   *   from W3C.
-   */
-  static const int BUBBLING_PHASE = 3;
-
-  /**
-   * This event is propagating through the target's ancestors, starting from the
-   * document.
-   *
-   * ## Other resources
-   *
-   * * [Bubble phase](http://www.w3.org/TR/DOM-Level-3-Events/#bubble-phase)
-   *   from W3C.
-   */
-  static const int CAPTURING_PHASE = 1;
-
-  bool get bubbles native;
-
-  bool get cancelable native;
-
-  bool get composed native;
-
-  EventTarget? get currentTarget =>
-      _convertNativeToDart_EventTarget(this._get_currentTarget);
-  @JSName('currentTarget')
-  @Creates('Null')
-  @Returns('EventTarget|=Object|Null')
-  dynamic get _get_currentTarget native;
-
-  bool get defaultPrevented native;
-
-  int get eventPhase native;
-
-  bool get isTrusted native;
-
-  EventTarget? get target => _convertNativeToDart_EventTarget(this._get_target);
-  @JSName('target')
-  @Creates('Node')
-  @Returns('EventTarget|=Object')
-  dynamic get _get_target native;
-
-  num get timeStamp native;
-
-  String get type native;
-
-  List<EventTarget> composedPath() native;
-
-  @JSName('initEvent')
-  void _initEvent(String type, [bool? bubbles, bool? cancelable]) native;
-
-  void preventDefault() native;
-
-  void stopImmediatePropagation() native;
-
-  void stopPropagation() native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("EventSource")
-class EventSource extends EventTarget {
-  factory EventSource(String url, {withCredentials: false}) {
-    var parsedOptions = {
-      'withCredentials': withCredentials,
-    };
-    return EventSource._factoryEventSource(url, parsedOptions);
-  }
-  // To suppress missing implicit constructor warnings.
-  factory EventSource._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [EventSource].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [EventSource].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  /**
-   * Static factory designed to expose `open` events to event
-   * handlers that are not necessarily instances of [EventSource].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> openEvent =
-      const EventStreamProvider<Event>('open');
-
-  static EventSource _factoryEventSource(String url,
-      [Map? eventSourceInitDict]) {
-    if (eventSourceInitDict != null) {
-      var eventSourceInitDict_1 =
-          convertDartToNative_Dictionary(eventSourceInitDict);
-      return EventSource._create_1(url, eventSourceInitDict_1);
-    }
-    return EventSource._create_2(url);
-  }
-
-  static EventSource _create_1(url, eventSourceInitDict) =>
-      JS('EventSource', 'new EventSource(#,#)', url, eventSourceInitDict);
-  static EventSource _create_2(url) =>
-      JS('EventSource', 'new EventSource(#)', url);
-
-  static const int CLOSED = 2;
-
-  static const int CONNECTING = 0;
-
-  static const int OPEN = 1;
-
-  int get readyState native;
-
-  String get url native;
-
-  bool get withCredentials native;
-
-  void close() native;
-
-  /// Stream of `error` events handled by this [EventSource].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `message` events handled by this [EventSource].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  /// Stream of `open` events handled by this [EventSource].
-  Stream<Event> get onOpen => openEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Base class that supports listening for and dispatching browser events.
- *
- * Normally events are accessed via the Stream getter:
- *
- *     element.onMouseOver.listen((e) => print('Mouse over!'));
- *
- * To access bubbling events which are declared on one element, but may bubble
- * up to another element type (common for MediaElement events):
- *
- *     MediaElement.pauseEvent.forTarget(document.body).listen(...);
- *
- * To useCapture on events:
- *
- *     Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
- *
- * Custom events can be declared as:
- *
- *     class DataGenerator {
- *       static EventStreamProvider<Event> dataEvent =
- *           new EventStreamProvider('data');
- *     }
- *
- * Then listeners should access the event with:
- *
- *     DataGenerator.dataEvent.forTarget(element).listen(...);
- *
- * Custom events can also be accessed as:
- *
- *     element.on['some_event'].listen(...);
- *
- * This approach is generally discouraged as it loses the event typing and
- * some DOM events may have multiple platform-dependent event names under the
- * covers. By using the standard Stream getters you will get the platform
- * specific event name automatically.
- */
-class Events {
-  /* Raw event target. */
-  final EventTarget _ptr;
-
-  Events(this._ptr);
-
-  Stream<Event> operator [](String type) {
-    return new _EventStream(_ptr, type, false);
-  }
-}
-
-class ElementEvents extends Events {
-  static final webkitEvents = {
-    'animationend': 'webkitAnimationEnd',
-    'animationiteration': 'webkitAnimationIteration',
-    'animationstart': 'webkitAnimationStart',
-    'fullscreenchange': 'webkitfullscreenchange',
-    'fullscreenerror': 'webkitfullscreenerror',
-    'keyadded': 'webkitkeyadded',
-    'keyerror': 'webkitkeyerror',
-    'keymessage': 'webkitkeymessage',
-    'needkey': 'webkitneedkey',
-    'pointerlockchange': 'webkitpointerlockchange',
-    'pointerlockerror': 'webkitpointerlockerror',
-    'resourcetimingbufferfull': 'webkitresourcetimingbufferfull',
-    'transitionend': 'webkitTransitionEnd',
-    'speechchange': 'webkitSpeechChange'
-  };
-
-  ElementEvents(Element ptr) : super(ptr);
-
-  Stream<Event> operator [](String type) {
-    if (webkitEvents.keys.contains(type.toLowerCase())) {
-      if (Device.isWebKit) {
-        return new _ElementEventStreamImpl(
-            _ptr, webkitEvents[type.toLowerCase()], false);
-      }
-    }
-    return new _ElementEventStreamImpl(_ptr, type, false);
-  }
-}
-
-/**
- * Base class for all browser objects that support events.
- *
- * Use the [on] property to add, and remove events
- * for compile-time type checks and a more concise API.
- */
-@Native("EventTarget")
-class EventTarget extends Interceptor {
-  // Custom element created callback.
-  EventTarget._created();
-
-  /**
-   * This is an ease-of-use accessor for event streams which should only be
-   * used when an explicit accessor is not available.
-   */
-  Events get on => new Events(this);
-
-  void addEventListener(String type, EventListener? listener,
-      [bool? useCapture]) {
-    // TODO(leafp): This check is avoid a bug in our dispatch code when
-    // listener is null.  The browser treats this call as a no-op in this
-    // case, so it's fine to short-circuit it, but we should not have to.
-    if (listener != null) {
-      _addEventListener(type, listener, useCapture);
-    }
-  }
-
-  void removeEventListener(String type, EventListener? listener,
-      [bool? useCapture]) {
-    // TODO(leafp): This check is avoid a bug in our dispatch code when
-    // listener is null.  The browser treats this call as a no-op in this
-    // case, so it's fine to short-circuit it, but we should not have to.
-    if (listener != null) {
-      _removeEventListener(type, listener, useCapture);
-    }
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory EventTarget._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('addEventListener')
-  void _addEventListener(String type, EventListener? listener, [bool? options])
-      native;
-
-  bool dispatchEvent(Event event) native;
-
-  @JSName('removeEventListener')
-  void _removeEventListener(String type, EventListener? listener,
-      [bool? options]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ExtendableEvent")
-class ExtendableEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory ExtendableEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ExtendableEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return ExtendableEvent._create_1(type, eventInitDict_1);
-    }
-    return ExtendableEvent._create_2(type);
-  }
-  static ExtendableEvent _create_1(type, eventInitDict) =>
-      JS('ExtendableEvent', 'new ExtendableEvent(#,#)', type, eventInitDict);
-  static ExtendableEvent _create_2(type) =>
-      JS('ExtendableEvent', 'new ExtendableEvent(#)', type);
-
-  void waitUntil(Future f) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ExtendableMessageEvent")
-class ExtendableMessageEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory ExtendableMessageEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @annotation_Creates_SerializedScriptValue
-  @annotation_Returns_SerializedScriptValue
-  Object? get data native;
-
-  String get lastEventId native;
-
-  String get origin native;
-
-  List<MessagePort> get ports native;
-
-  @Creates('Client|ServiceWorker|MessagePort')
-  @Returns('Client|ServiceWorker|MessagePort|Null')
-  Object? get source native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("External")
-class External extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory External._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void AddSearchProvider() native;
-
-  void IsSearchProviderInstalled() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("FaceDetector")
-class FaceDetector extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FaceDetector._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FaceDetector([Map? faceDetectorOptions]) {
-    if (faceDetectorOptions != null) {
-      var faceDetectorOptions_1 =
-          convertDartToNative_Dictionary(faceDetectorOptions);
-      return FaceDetector._create_1(faceDetectorOptions_1);
-    }
-    return FaceDetector._create_2();
-  }
-  static FaceDetector _create_1(faceDetectorOptions) =>
-      JS('FaceDetector', 'new FaceDetector(#)', faceDetectorOptions);
-  static FaceDetector _create_2() => JS('FaceDetector', 'new FaceDetector()');
-
-  Future<List<dynamic>> detect(/*ImageBitmapSource*/ image) =>
-      promiseToFuture<List<dynamic>>(JS("", "#.detect(#)", this, image));
-}
-// Copyright (c) 2012, 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.
-
-@Native("FederatedCredential")
-class FederatedCredential extends Credential implements CredentialUserData {
-  // To suppress missing implicit constructor warnings.
-  factory FederatedCredential._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FederatedCredential(Map data) {
-    var data_1 = convertDartToNative_Dictionary(data);
-    return FederatedCredential._create_1(data_1);
-  }
-  static FederatedCredential _create_1(data) =>
-      JS('FederatedCredential', 'new FederatedCredential(#)', data);
-
-  String? get protocol native;
-
-  String get provider native;
-
-  // From CredentialUserData
-
-  @JSName('iconURL')
-  String get iconUrl native;
-
-  String get name native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("FetchEvent")
-class FetchEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory FetchEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FetchEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return FetchEvent._create_1(type, eventInitDict_1);
-  }
-  static FetchEvent _create_1(type, eventInitDict) =>
-      JS('FetchEvent', 'new FetchEvent(#,#)', type, eventInitDict);
-
-  String? get clientId native;
-
-  bool get isReload native;
-
-  Future get preloadResponse =>
-      promiseToFuture(JS("", "#.preloadResponse", this));
-
-  _Request get request native;
-
-  void respondWith(Future r) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("HTMLFieldSetElement")
-class FieldSetElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory FieldSetElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FieldSetElement() => JS<FieldSetElement>(
-      'returns:FieldSetElement;creates:FieldSetElement;new:true',
-      '#.createElement(#)',
-      document,
-      "fieldset");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FieldSetElement.created() : super.created();
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get elements native;
-
-  FormElement? get form native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get type native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  bool get willValidate native;
-
-  bool checkValidity() native;
-
-  bool reportValidity() native;
-
-  void setCustomValidity(String error) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("File")
-class File extends Blob {
-  // To suppress missing implicit constructor warnings.
-  factory File._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory File(List<Object> fileBits, String fileName, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return File._create_1(fileBits, fileName, options_1);
-    }
-    return File._create_2(fileBits, fileName);
-  }
-  static File _create_1(fileBits, fileName, options) =>
-      JS('File', 'new File(#,#,#)', fileBits, fileName, options);
-  static File _create_2(fileBits, fileName) =>
-      JS('File', 'new File(#,#)', fileBits, fileName);
-
-  int get lastModified native;
-
-  DateTime get lastModifiedDate =>
-      convertNativeToDart_DateTime(this._get_lastModifiedDate);
-  @JSName('lastModifiedDate')
-  @Creates('Null')
-  dynamic get _get_lastModifiedDate native;
-
-  String get name native;
-
-  @JSName('webkitRelativePath')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  String get relativePath native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _FileCallback(File? file);
-// Copyright (c) 2012, 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.
-
-@Native("FileEntry")
-class FileEntry extends Entry {
-  // To suppress missing implicit constructor warnings.
-  factory FileEntry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('createWriter')
-  void _createWriter(_FileWriterCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  @JSName('createWriter')
-  Future<FileWriter> createWriter() {
-    var completer = new Completer<FileWriter>();
-    _createWriter((value) {
-      applyExtension('FileWriter', value);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('file')
-  void _file(_FileCallback successCallback, [_ErrorCallback? errorCallback])
-      native;
-
-  @JSName('file')
-  Future<File> file() {
-    var completer = new Completer<File>();
-    _file((value) {
-      applyExtension('File', value);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("FileList")
-class FileList extends Interceptor
-    with ListMixin<File>, ImmutableListMixin<File>
-    implements List<File>, JavaScriptIndexingBehavior<File> {
-  // To suppress missing implicit constructor warnings.
-  factory FileList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  File operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("File", "#[#]", this, index);
-  }
-
-  void operator []=(int index, File value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<File> mixins.
-  // File is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  File get first {
-    if (this.length > 0) {
-      return JS('File', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  File get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('File', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  File get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('File', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  File elementAt(int index) => this[index];
-  // -- end List<File> mixins.
-
-  File? item(int index) native;
-}
-// Copyright (c) 2014, 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.
-
-@Native("FileReader")
-class FileReader extends EventTarget {
-  Object? get result {
-    var res = JS('Null|String|NativeByteBuffer', '#.result', this);
-    if (res is ByteBuffer) {
-      return new Uint8List.view(res);
-    }
-    return res;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory FileReader._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `abort` events to event
-   * handlers that are not necessarily instances of [FileReader].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> abortEvent =
-      const EventStreamProvider<ProgressEvent>('abort');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [FileReader].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> errorEvent =
-      const EventStreamProvider<ProgressEvent>('error');
-
-  /**
-   * Static factory designed to expose `load` events to event
-   * handlers that are not necessarily instances of [FileReader].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> loadEvent =
-      const EventStreamProvider<ProgressEvent>('load');
-
-  /**
-   * Static factory designed to expose `loadend` events to event
-   * handlers that are not necessarily instances of [FileReader].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> loadEndEvent =
-      const EventStreamProvider<ProgressEvent>('loadend');
-
-  /**
-   * Static factory designed to expose `loadstart` events to event
-   * handlers that are not necessarily instances of [FileReader].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> loadStartEvent =
-      const EventStreamProvider<ProgressEvent>('loadstart');
-
-  /**
-   * Static factory designed to expose `progress` events to event
-   * handlers that are not necessarily instances of [FileReader].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> progressEvent =
-      const EventStreamProvider<ProgressEvent>('progress');
-
-  factory FileReader() {
-    return FileReader._create_1();
-  }
-  static FileReader _create_1() => JS('FileReader', 'new FileReader()');
-
-  static const int DONE = 2;
-
-  static const int EMPTY = 0;
-
-  static const int LOADING = 1;
-
-  DomException? get error native;
-
-  int get readyState native;
-
-  void abort() native;
-
-  void readAsArrayBuffer(Blob blob) native;
-
-  @JSName('readAsDataURL')
-  void readAsDataUrl(Blob blob) native;
-
-  void readAsText(Blob blob, [String? label]) native;
-
-  /// Stream of `abort` events handled by this [FileReader].
-  Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [FileReader].
-  Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `load` events handled by this [FileReader].
-  Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
-
-  /// Stream of `loadend` events handled by this [FileReader].
-  Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
-
-  /// Stream of `loadstart` events handled by this [FileReader].
-  Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
-
-  /// Stream of `progress` events handled by this [FileReader].
-  Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("DOMFileSystem")
-class FileSystem extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FileSystem._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.webkitRequestFileSystem)');
-
-  String get name native;
-
-  DirectoryEntry get root native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _FileSystemCallback(FileSystem fileSystem);
-// Copyright (c) 2012, 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.
-
-@Native("FileWriter")
-class FileWriter extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory FileWriter._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `abort` events to event
-   * handlers that are not necessarily instances of [FileWriter].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> abortEvent =
-      const EventStreamProvider<ProgressEvent>('abort');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [FileWriter].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `progress` events to event
-   * handlers that are not necessarily instances of [FileWriter].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> progressEvent =
-      const EventStreamProvider<ProgressEvent>('progress');
-
-  /**
-   * Static factory designed to expose `write` events to event
-   * handlers that are not necessarily instances of [FileWriter].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> writeEvent =
-      const EventStreamProvider<ProgressEvent>('write');
-
-  /**
-   * Static factory designed to expose `writeend` events to event
-   * handlers that are not necessarily instances of [FileWriter].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> writeEndEvent =
-      const EventStreamProvider<ProgressEvent>('writeend');
-
-  /**
-   * Static factory designed to expose `writestart` events to event
-   * handlers that are not necessarily instances of [FileWriter].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> writeStartEvent =
-      const EventStreamProvider<ProgressEvent>('writestart');
-
-  static const int DONE = 2;
-
-  static const int INIT = 0;
-
-  static const int WRITING = 1;
-
-  DomException? get error native;
-
-  int get length native;
-
-  int get position native;
-
-  int get readyState native;
-
-  void abort() native;
-
-  void seek(int position) native;
-
-  void truncate(int size) native;
-
-  void write(Blob data) native;
-
-  /// Stream of `abort` events handled by this [FileWriter].
-  Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [FileWriter].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `progress` events handled by this [FileWriter].
-  Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
-
-  /// Stream of `write` events handled by this [FileWriter].
-  Stream<ProgressEvent> get onWrite => writeEvent.forTarget(this);
-
-  /// Stream of `writeend` events handled by this [FileWriter].
-  Stream<ProgressEvent> get onWriteEnd => writeEndEvent.forTarget(this);
-
-  /// Stream of `writestart` events handled by this [FileWriter].
-  Stream<ProgressEvent> get onWriteStart => writeStartEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _FileWriterCallback(FileWriter fileWriter);
-// Copyright (c) 2012, 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.
-
-@Native("FocusEvent")
-class FocusEvent extends UIEvent {
-  // To suppress missing implicit constructor warnings.
-  factory FocusEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FocusEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return FocusEvent._create_1(type, eventInitDict_1);
-    }
-    return FocusEvent._create_2(type);
-  }
-  static FocusEvent _create_1(type, eventInitDict) =>
-      JS('FocusEvent', 'new FocusEvent(#,#)', type, eventInitDict);
-  static FocusEvent _create_2(type) =>
-      JS('FocusEvent', 'new FocusEvent(#)', type);
-
-  EventTarget? get relatedTarget =>
-      _convertNativeToDart_EventTarget(this._get_relatedTarget);
-  @JSName('relatedTarget')
-  @Creates('Null')
-  dynamic get _get_relatedTarget native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("FontFace")
-class FontFace extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FontFace._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FontFace(String family, Object source, [Map? descriptors]) {
-    if (descriptors != null) {
-      var descriptors_1 = convertDartToNative_Dictionary(descriptors);
-      return FontFace._create_1(family, source, descriptors_1);
-    }
-    return FontFace._create_2(family, source);
-  }
-  static FontFace _create_1(family, source, descriptors) =>
-      JS('FontFace', 'new FontFace(#,#,#)', family, source, descriptors);
-  static FontFace _create_2(family, source) =>
-      JS('FontFace', 'new FontFace(#,#)', family, source);
-
-  String get display native;
-
-  set display(String value) native;
-
-  String get family native;
-
-  set family(String value) native;
-
-  String get featureSettings native;
-
-  set featureSettings(String value) native;
-
-  Future<FontFace> get loaded =>
-      promiseToFuture<FontFace>(JS("", "#.loaded", this));
-
-  String get status native;
-
-  String get stretch native;
-
-  set stretch(String value) native;
-
-  String get style native;
-
-  set style(String value) native;
-
-  String get unicodeRange native;
-
-  set unicodeRange(String value) native;
-
-  String get variant native;
-
-  set variant(String value) native;
-
-  String get weight native;
-
-  set weight(String value) native;
-
-  Future<FontFace> load() =>
-      promiseToFuture<FontFace>(JS("", "#.load()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("FontFaceSet")
-class FontFaceSet extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory FontFaceSet._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<FontFaceSetLoadEvent> loadingEvent =
-      const EventStreamProvider<FontFaceSetLoadEvent>('loading');
-
-  static const EventStreamProvider<FontFaceSetLoadEvent> loadingDoneEvent =
-      const EventStreamProvider<FontFaceSetLoadEvent>('loadingdone');
-
-  static const EventStreamProvider<FontFaceSetLoadEvent> loadingErrorEvent =
-      const EventStreamProvider<FontFaceSetLoadEvent>('loadingerror');
-
-  String get status native;
-
-  FontFaceSet add(FontFace arg) native;
-
-  bool check(String font, [String? text]) native;
-
-  void clear() native;
-
-  bool delete(FontFace arg) native;
-
-  void forEach(FontFaceSetForEachCallback callback, [Object? thisArg]) native;
-
-  bool has(FontFace arg) native;
-
-  Stream<FontFaceSetLoadEvent> get onLoading => loadingEvent.forTarget(this);
-
-  Stream<FontFaceSetLoadEvent> get onLoadingDone =>
-      loadingDoneEvent.forTarget(this);
-
-  Stream<FontFaceSetLoadEvent> get onLoadingError =>
-      loadingErrorEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("FontFaceSetLoadEvent")
-class FontFaceSetLoadEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory FontFaceSetLoadEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FontFaceSetLoadEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return FontFaceSetLoadEvent._create_1(type, eventInitDict_1);
-    }
-    return FontFaceSetLoadEvent._create_2(type);
-  }
-  static FontFaceSetLoadEvent _create_1(type, eventInitDict) => JS(
-      'FontFaceSetLoadEvent',
-      'new FontFaceSetLoadEvent(#,#)',
-      type,
-      eventInitDict);
-  static FontFaceSetLoadEvent _create_2(type) =>
-      JS('FontFaceSetLoadEvent', 'new FontFaceSetLoadEvent(#)', type);
-
-  List<FontFace> get fontfaces native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("FontFaceSource")
-class FontFaceSource extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FontFaceSource._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  FontFaceSet get fonts native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ForeignFetchEvent")
-class ForeignFetchEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory ForeignFetchEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ForeignFetchEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return ForeignFetchEvent._create_1(type, eventInitDict_1);
-  }
-  static ForeignFetchEvent _create_1(type, eventInitDict) => JS(
-      'ForeignFetchEvent', 'new ForeignFetchEvent(#,#)', type, eventInitDict);
-
-  String get origin native;
-
-  _Request get request native;
-
-  void respondWith(Future r) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("FormData")
-class FormData extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FormData._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FormData([FormElement? form]) {
-    if (form != null) {
-      return FormData._create_1(form);
-    }
-    return FormData._create_2();
-  }
-  static FormData _create_1(form) => JS('FormData', 'new FormData(#)', form);
-  static FormData _create_2() => JS('FormData', 'new FormData()');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.FormData)');
-
-  void append(String name, String value) native;
-
-  @JSName('append')
-  void appendBlob(String name, Blob value, [String? filename]) native;
-
-  void delete(String name) native;
-
-  Object? get(String name) native;
-
-  List<Object> getAll(String name) native;
-
-  bool has(String name) native;
-
-  void set(String name, value, [String? filename]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLFormElement")
-class FormElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory FormElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FormElement() => JS<FormElement>(
-      'returns:FormElement;creates:FormElement;new:true',
-      '#.createElement(#)',
-      document,
-      "form");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FormElement.created() : super.created();
-
-  String get acceptCharset native;
-
-  set acceptCharset(String value) native;
-
-  String get action native;
-
-  set action(String value) native;
-
-  String get autocomplete native;
-
-  set autocomplete(String value) native;
-
-  String get encoding native;
-
-  set encoding(String value) native;
-
-  String get enctype native;
-
-  set enctype(String value) native;
-
-  int get length native;
-
-  String get method native;
-
-  set method(String value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  bool get noValidate native;
-
-  set noValidate(bool value) native;
-
-  String get target native;
-
-  set target(String value) native;
-
-  Object? __getter__(String name) native;
-
-  bool checkValidity() native;
-
-  Element item(int index) native;
-
-  bool reportValidity() native;
-
-  void requestAutocomplete(Map? details) {
-    var details_1 = convertDartToNative_Dictionary(details);
-    _requestAutocomplete_1(details_1);
-    return;
-  }
-
-  @JSName('requestAutocomplete')
-  void _requestAutocomplete_1(details) native;
-
-  void reset() native;
-
-  void submit() native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void FrameRequestCallback(num highResTime);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void FunctionStringCallback(String data);
-// Copyright (c) 2012, 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.
-
-@Native("Gamepad")
-class Gamepad extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Gamepad._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<num> get axes native;
-
-  @Creates('JSExtendableArray|GamepadButton')
-  @Returns('JSExtendableArray')
-  List<GamepadButton> get buttons native;
-
-  bool get connected native;
-
-  int get displayId native;
-
-  String get hand native;
-
-  String get id native;
-
-  int get index native;
-
-  String get mapping native;
-
-  GamepadPose? get pose native;
-
-  int get timestamp native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("GamepadButton")
-class GamepadButton extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory GamepadButton._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get pressed native;
-
-  bool get touched native;
-
-  num get value native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("GamepadEvent")
-class GamepadEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory GamepadEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory GamepadEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return GamepadEvent._create_1(type, eventInitDict_1);
-    }
-    return GamepadEvent._create_2(type);
-  }
-  static GamepadEvent _create_1(type, eventInitDict) =>
-      JS('GamepadEvent', 'new GamepadEvent(#,#)', type, eventInitDict);
-  static GamepadEvent _create_2(type) =>
-      JS('GamepadEvent', 'new GamepadEvent(#)', type);
-
-  Gamepad get gamepad native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("GamepadPose")
-class GamepadPose extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory GamepadPose._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Float32List? get angularAcceleration native;
-
-  Float32List? get angularVelocity native;
-
-  bool get hasOrientation native;
-
-  bool get hasPosition native;
-
-  Float32List? get linearAcceleration native;
-
-  Float32List? get linearVelocity native;
-
-  Float32List? get orientation native;
-
-  Float32List? get position native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("Geolocation")
-class Geolocation extends Interceptor {
-  Future<Geoposition> getCurrentPosition(
-      {bool? enableHighAccuracy, Duration? timeout, Duration? maximumAge}) {
-    var options = {};
-    if (enableHighAccuracy != null) {
-      options['enableHighAccuracy'] = enableHighAccuracy;
-    }
-    if (timeout != null) {
-      options['timeout'] = timeout.inMilliseconds;
-    }
-    if (maximumAge != null) {
-      options['maximumAge'] = maximumAge.inMilliseconds;
-    }
-    var completer = new Completer<Geoposition>();
-    try {
-      _getCurrentPosition((position) {
-        completer.complete(_ensurePosition(position));
-      }, (error) {
-        completer.completeError(error);
-      }, options);
-    } catch (e, stacktrace) {
-      completer.completeError(e, stacktrace);
-    }
-    return completer.future;
-  }
-
-  Stream<Geoposition> watchPosition(
-      {bool? enableHighAccuracy, Duration? timeout, Duration? maximumAge}) {
-    var options = {};
-    if (enableHighAccuracy != null) {
-      options['enableHighAccuracy'] = enableHighAccuracy;
-    }
-    if (timeout != null) {
-      options['timeout'] = timeout.inMilliseconds;
-    }
-    if (maximumAge != null) {
-      options['maximumAge'] = maximumAge.inMilliseconds;
-    }
-
-    int? watchId;
-    StreamController<Geoposition> controller =
-        new StreamController<Geoposition>(
-            sync: true,
-            onCancel: () {
-              assert(watchId != null);
-              _clearWatch(watchId!);
-            });
-    controller.onListen = () {
-      assert(watchId == null);
-      watchId = _watchPosition((position) {
-        controller.add(_ensurePosition(position));
-      }, (error) {
-        controller.addError(error);
-      }, options);
-    };
-
-    return controller.stream;
-  }
-
-  Geoposition _ensurePosition(domPosition) {
-    try {
-      // Firefox may throw on this.
-      if (domPosition is Geoposition) {
-        return domPosition;
-      }
-    } catch (e) {}
-    return new _GeopositionWrapper(domPosition);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory Geolocation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('clearWatch')
-  void _clearWatch(int watchID) native;
-
-  void _getCurrentPosition(_PositionCallback successCallback,
-      [_PositionErrorCallback? errorCallback, Map? options]) {
-    if (options != null) {
-      var successCallback_1 = convertDartClosureToJS(successCallback, 1);
-      var options_2 = convertDartToNative_Dictionary(options);
-      _getCurrentPosition_1(successCallback_1, errorCallback, options_2);
-      return;
-    }
-    if (errorCallback != null) {
-      var successCallback_1 = convertDartClosureToJS(successCallback, 1);
-      _getCurrentPosition_2(successCallback_1, errorCallback);
-      return;
-    }
-    var successCallback_1 = convertDartClosureToJS(successCallback, 1);
-    _getCurrentPosition_3(successCallback_1);
-    return;
-  }
-
-  @JSName('getCurrentPosition')
-  void _getCurrentPosition_1(
-      successCallback, _PositionErrorCallback? errorCallback, options) native;
-  @JSName('getCurrentPosition')
-  void _getCurrentPosition_2(
-      successCallback, _PositionErrorCallback? errorCallback) native;
-  @JSName('getCurrentPosition')
-  void _getCurrentPosition_3(successCallback) native;
-
-  int _watchPosition(_PositionCallback successCallback,
-      [_PositionErrorCallback? errorCallback, Map? options]) {
-    if (options != null) {
-      var successCallback_1 = convertDartClosureToJS(successCallback, 1);
-      var options_2 = convertDartToNative_Dictionary(options);
-      return _watchPosition_1(successCallback_1, errorCallback, options_2);
-    }
-    if (errorCallback != null) {
-      var successCallback_1 = convertDartClosureToJS(successCallback, 1);
-      return _watchPosition_2(successCallback_1, errorCallback);
-    }
-    var successCallback_1 = convertDartClosureToJS(successCallback, 1);
-    return _watchPosition_3(successCallback_1);
-  }
-
-  @JSName('watchPosition')
-  int _watchPosition_1(
-      successCallback, _PositionErrorCallback? errorCallback, options) native;
-  @JSName('watchPosition')
-  int _watchPosition_2(successCallback, _PositionErrorCallback? errorCallback)
-      native;
-  @JSName('watchPosition')
-  int _watchPosition_3(successCallback) native;
-}
-
-/**
- * Wrapper for Firefox- it returns an object which we cannot map correctly.
- * Basically Firefox was returning a [xpconnect wrapped nsIDOMGeoPosition] but
- * which has further oddities.
- */
-class _GeopositionWrapper implements Geoposition {
-  var _ptr;
-  _GeopositionWrapper(this._ptr);
-
-  Coordinates get coords => JS('Coordinates', '#.coords', _ptr);
-  int get timestamp => JS('int', '#.timestamp', _ptr);
-}
-// Copyright (c) 2012, 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.
-
-@Native("Position")
-class Geoposition extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Geoposition._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Coordinates get coords native;
-
-  int get timestamp native;
-}
-// Copyright (c) 2012, 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.
-
-// We implement EventTarget and have stubs for its methods because it's tricky to
-// convince the scripts to make our instance methods abstract, and the bodies that
-// get generated require `this` to be an EventTarget.
-abstract class GlobalEventHandlers implements EventTarget {
-  void addEventListener(String type, dynamic listener(Event event)?,
-      [bool? useCapture]);
-  bool dispatchEvent(Event event);
-  void removeEventListener(String type, dynamic listener(Event event)?,
-      [bool? useCapture]);
-  Events get on;
-
-  // To suppress missing implicit constructor warnings.
-  factory GlobalEventHandlers._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> abortEvent =
-      const EventStreamProvider<Event>('abort');
-
-  static const EventStreamProvider<Event> blurEvent =
-      const EventStreamProvider<Event>('blur');
-
-  static const EventStreamProvider<Event> canPlayEvent =
-      const EventStreamProvider<Event>('canplay');
-
-  static const EventStreamProvider<Event> canPlayThroughEvent =
-      const EventStreamProvider<Event>('canplaythrough');
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  static const EventStreamProvider<MouseEvent> clickEvent =
-      const EventStreamProvider<MouseEvent>('click');
-
-  static const EventStreamProvider<MouseEvent> contextMenuEvent =
-      const EventStreamProvider<MouseEvent>('contextmenu');
-
-  @DomName('GlobalEventHandlers.dblclickEvent')
-  static const EventStreamProvider<Event> doubleClickEvent =
-      const EventStreamProvider<Event>('dblclick');
-
-  static const EventStreamProvider<MouseEvent> dragEvent =
-      const EventStreamProvider<MouseEvent>('drag');
-
-  static const EventStreamProvider<MouseEvent> dragEndEvent =
-      const EventStreamProvider<MouseEvent>('dragend');
-
-  static const EventStreamProvider<MouseEvent> dragEnterEvent =
-      const EventStreamProvider<MouseEvent>('dragenter');
-
-  static const EventStreamProvider<MouseEvent> dragLeaveEvent =
-      const EventStreamProvider<MouseEvent>('dragleave');
-
-  static const EventStreamProvider<MouseEvent> dragOverEvent =
-      const EventStreamProvider<MouseEvent>('dragover');
-
-  static const EventStreamProvider<MouseEvent> dragStartEvent =
-      const EventStreamProvider<MouseEvent>('dragstart');
-
-  static const EventStreamProvider<MouseEvent> dropEvent =
-      const EventStreamProvider<MouseEvent>('drop');
-
-  static const EventStreamProvider<Event> durationChangeEvent =
-      const EventStreamProvider<Event>('durationchange');
-
-  static const EventStreamProvider<Event> emptiedEvent =
-      const EventStreamProvider<Event>('emptied');
-
-  static const EventStreamProvider<Event> endedEvent =
-      const EventStreamProvider<Event>('ended');
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  static const EventStreamProvider<Event> focusEvent =
-      const EventStreamProvider<Event>('focus');
-
-  static const EventStreamProvider<Event> inputEvent =
-      const EventStreamProvider<Event>('input');
-
-  static const EventStreamProvider<Event> invalidEvent =
-      const EventStreamProvider<Event>('invalid');
-
-  static const EventStreamProvider<KeyboardEvent> keyDownEvent =
-      const EventStreamProvider<KeyboardEvent>('keydown');
-
-  static const EventStreamProvider<KeyboardEvent> keyPressEvent =
-      const EventStreamProvider<KeyboardEvent>('keypress');
-
-  static const EventStreamProvider<KeyboardEvent> keyUpEvent =
-      const EventStreamProvider<KeyboardEvent>('keyup');
-
-  static const EventStreamProvider<Event> loadEvent =
-      const EventStreamProvider<Event>('load');
-
-  static const EventStreamProvider<Event> loadedDataEvent =
-      const EventStreamProvider<Event>('loadeddata');
-
-  static const EventStreamProvider<Event> loadedMetadataEvent =
-      const EventStreamProvider<Event>('loadedmetadata');
-
-  static const EventStreamProvider<MouseEvent> mouseDownEvent =
-      const EventStreamProvider<MouseEvent>('mousedown');
-
-  static const EventStreamProvider<MouseEvent> mouseEnterEvent =
-      const EventStreamProvider<MouseEvent>('mouseenter');
-
-  static const EventStreamProvider<MouseEvent> mouseLeaveEvent =
-      const EventStreamProvider<MouseEvent>('mouseleave');
-
-  static const EventStreamProvider<MouseEvent> mouseMoveEvent =
-      const EventStreamProvider<MouseEvent>('mousemove');
-
-  static const EventStreamProvider<MouseEvent> mouseOutEvent =
-      const EventStreamProvider<MouseEvent>('mouseout');
-
-  static const EventStreamProvider<MouseEvent> mouseOverEvent =
-      const EventStreamProvider<MouseEvent>('mouseover');
-
-  static const EventStreamProvider<MouseEvent> mouseUpEvent =
-      const EventStreamProvider<MouseEvent>('mouseup');
-
-  static const EventStreamProvider<WheelEvent> mouseWheelEvent =
-      const EventStreamProvider<WheelEvent>('mousewheel');
-
-  static const EventStreamProvider<Event> pauseEvent =
-      const EventStreamProvider<Event>('pause');
-
-  static const EventStreamProvider<Event> playEvent =
-      const EventStreamProvider<Event>('play');
-
-  static const EventStreamProvider<Event> playingEvent =
-      const EventStreamProvider<Event>('playing');
-
-  static const EventStreamProvider<Event> rateChangeEvent =
-      const EventStreamProvider<Event>('ratechange');
-
-  static const EventStreamProvider<Event> resetEvent =
-      const EventStreamProvider<Event>('reset');
-
-  static const EventStreamProvider<Event> resizeEvent =
-      const EventStreamProvider<Event>('resize');
-
-  static const EventStreamProvider<Event> scrollEvent =
-      const EventStreamProvider<Event>('scroll');
-
-  static const EventStreamProvider<Event> seekedEvent =
-      const EventStreamProvider<Event>('seeked');
-
-  static const EventStreamProvider<Event> seekingEvent =
-      const EventStreamProvider<Event>('seeking');
-
-  static const EventStreamProvider<Event> selectEvent =
-      const EventStreamProvider<Event>('select');
-
-  static const EventStreamProvider<Event> stalledEvent =
-      const EventStreamProvider<Event>('stalled');
-
-  static const EventStreamProvider<Event> submitEvent =
-      const EventStreamProvider<Event>('submit');
-
-  static const EventStreamProvider<Event> suspendEvent =
-      const EventStreamProvider<Event>('suspend');
-
-  static const EventStreamProvider<Event> timeUpdateEvent =
-      const EventStreamProvider<Event>('timeupdate');
-
-  static const EventStreamProvider<TouchEvent> touchCancelEvent =
-      const EventStreamProvider<TouchEvent>('touchcancel');
-
-  static const EventStreamProvider<TouchEvent> touchEndEvent =
-      const EventStreamProvider<TouchEvent>('touchend');
-
-  static const EventStreamProvider<TouchEvent> touchMoveEvent =
-      const EventStreamProvider<TouchEvent>('touchmove');
-
-  static const EventStreamProvider<TouchEvent> touchStartEvent =
-      const EventStreamProvider<TouchEvent>('touchstart');
-
-  static const EventStreamProvider<Event> volumeChangeEvent =
-      const EventStreamProvider<Event>('volumechange');
-
-  static const EventStreamProvider<Event> waitingEvent =
-      const EventStreamProvider<Event>('waiting');
-
-  static const EventStreamProvider<WheelEvent> wheelEvent =
-      const EventStreamProvider<WheelEvent>('wheel');
-
-  Stream<Event> get onAbort => abortEvent.forTarget(this);
-
-  Stream<Event> get onBlur => blurEvent.forTarget(this);
-
-  Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
-
-  Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-
-  Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
-
-  Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
-
-  @DomName('GlobalEventHandlers.ondblclick')
-  Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
-
-  Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
-
-  Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
-
-  Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
-
-  Stream<Event> get onEnded => endedEvent.forTarget(this);
-
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  Stream<Event> get onFocus => focusEvent.forTarget(this);
-
-  Stream<Event> get onInput => inputEvent.forTarget(this);
-
-  Stream<Event> get onInvalid => invalidEvent.forTarget(this);
-
-  Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
-
-  Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
-
-  Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
-
-  Stream<Event> get onLoad => loadEvent.forTarget(this);
-
-  Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
-
-  Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseEnter => mouseEnterEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseLeave => mouseLeaveEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
-
-  Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
-
-  Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);
-
-  Stream<Event> get onPause => pauseEvent.forTarget(this);
-
-  Stream<Event> get onPlay => playEvent.forTarget(this);
-
-  Stream<Event> get onPlaying => playingEvent.forTarget(this);
-
-  Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
-
-  Stream<Event> get onReset => resetEvent.forTarget(this);
-
-  Stream<Event> get onResize => resizeEvent.forTarget(this);
-
-  Stream<Event> get onScroll => scrollEvent.forTarget(this);
-
-  Stream<Event> get onSeeked => seekedEvent.forTarget(this);
-
-  Stream<Event> get onSeeking => seekingEvent.forTarget(this);
-
-  Stream<Event> get onSelect => selectEvent.forTarget(this);
-
-  Stream<Event> get onStalled => stalledEvent.forTarget(this);
-
-  Stream<Event> get onSubmit => submitEvent.forTarget(this);
-
-  Stream<Event> get onSuspend => suspendEvent.forTarget(this);
-
-  Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
-
-  Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
-
-  Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
-
-  Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
-
-  Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
-
-  Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
-
-  Stream<Event> get onWaiting => waitingEvent.forTarget(this);
-
-  Stream<WheelEvent> get onWheel => wheelEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("Gyroscope")
-class Gyroscope extends Sensor {
-  // To suppress missing implicit constructor warnings.
-  factory Gyroscope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Gyroscope([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return Gyroscope._create_1(sensorOptions_1);
-    }
-    return Gyroscope._create_2();
-  }
-  static Gyroscope _create_1(sensorOptions) =>
-      JS('Gyroscope', 'new Gyroscope(#)', sensorOptions);
-  static Gyroscope _create_2() => JS('Gyroscope', 'new Gyroscope()');
-
-  num? get x native;
-
-  num? get y native;
-
-  num? get z native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * An `<hr>` tag.
- */
-@Native("HTMLHRElement")
-class HRElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory HRElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory HRElement() => JS<HRElement>(
-      'returns:HRElement;creates:HRElement;new:true',
-      '#.createElement(#)',
-      document,
-      "hr");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  HRElement.created() : super.created();
-
-  String get color native;
-
-  set color(String value) native;
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("HashChangeEvent")
-class HashChangeEvent extends Event {
-  factory HashChangeEvent(String type,
-      {bool canBubble: true,
-      bool cancelable: true,
-      String? oldUrl,
-      String? newUrl}) {
-    var options = {
-      'canBubble': canBubble,
-      'cancelable': cancelable,
-      'oldURL': oldUrl,
-      'newURL': newUrl,
-    };
-    return JS('HashChangeEvent', 'new HashChangeEvent(#, #)', type,
-        convertDartToNative_Dictionary(options));
-  }
-
-  factory HashChangeEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return HashChangeEvent._create_1(type, eventInitDict_1);
-    }
-    return HashChangeEvent._create_2(type);
-  }
-  static HashChangeEvent _create_1(type, eventInitDict) =>
-      JS('HashChangeEvent', 'new HashChangeEvent(#,#)', type, eventInitDict);
-  static HashChangeEvent _create_2(type) =>
-      JS('HashChangeEvent', 'new HashChangeEvent(#)', type);
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Device.isEventTypeSupported('HashChangeEvent');
-
-  @JSName('newURL')
-  String get newUrl native;
-
-  @JSName('oldURL')
-  String get oldUrl native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLHeadElement")
-class HeadElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory HeadElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory HeadElement() => JS<HeadElement>(
-      'returns:HeadElement;creates:HeadElement;new:true',
-      '#.createElement(#)',
-      document,
-      "head");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  HeadElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("Headers")
-class Headers extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Headers._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Headers([Object? init]) {
-    if (init != null) {
-      return Headers._create_1(init);
-    }
-    return Headers._create_2();
-  }
-  static Headers _create_1(init) => JS('Headers', 'new Headers(#)', init);
-  static Headers _create_2() => JS('Headers', 'new Headers()');
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLHeadingElement")
-class HeadingElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory HeadingElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory HeadingElement.h1() => JS<HeadingElement>(
-      'returns:HeadingElement;creates:HeadingElement;new:true',
-      '#.createElement(#)',
-      document,
-      "h1");
-
-  factory HeadingElement.h2() => JS<HeadingElement>(
-      'returns:HeadingElement;creates:HeadingElement;new:true',
-      '#.createElement(#)',
-      document,
-      "h2");
-
-  factory HeadingElement.h3() => JS<HeadingElement>(
-      'returns:HeadingElement;creates:HeadingElement;new:true',
-      '#.createElement(#)',
-      document,
-      "h3");
-
-  factory HeadingElement.h4() => JS<HeadingElement>(
-      'returns:HeadingElement;creates:HeadingElement;new:true',
-      '#.createElement(#)',
-      document,
-      "h4");
-
-  factory HeadingElement.h5() => JS<HeadingElement>(
-      'returns:HeadingElement;creates:HeadingElement;new:true',
-      '#.createElement(#)',
-      document,
-      "h5");
-
-  factory HeadingElement.h6() => JS<HeadingElement>(
-      'returns:HeadingElement;creates:HeadingElement;new:true',
-      '#.createElement(#)',
-      document,
-      "h6");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  HeadingElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("History")
-class History extends Interceptor implements HistoryBase {
-  /**
-   * Checks if the State APIs are supported on the current platform.
-   *
-   * See also:
-   *
-   * * [pushState]
-   * * [replaceState]
-   * * [state]
-   */
-  static bool get supportsState => JS('bool', '!!window.history.pushState');
-  // To suppress missing implicit constructor warnings.
-  factory History._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  String get scrollRestoration native;
-
-  set scrollRestoration(String value) native;
-
-  dynamic get state =>
-      convertNativeToDart_SerializedScriptValue(this._get_state);
-  @JSName('state')
-  @annotation_Creates_SerializedScriptValue
-  @annotation_Returns_SerializedScriptValue
-  dynamic get _get_state native;
-
-  void back() native;
-
-  void forward() native;
-
-  void go([int? delta]) native;
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void pushState(/*SerializedScriptValue*/ data, String title, String? url) {
-    var data_1 = convertDartToNative_SerializedScriptValue(data);
-    _pushState_1(data_1, title, url);
-    return;
-  }
-
-  @JSName('pushState')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _pushState_1(data, title, url) native;
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void replaceState(/*SerializedScriptValue*/ data, String title, String? url) {
-    var data_1 = convertDartToNative_SerializedScriptValue(data);
-    _replaceState_1(data_1, title, url);
-    return;
-  }
-
-  @JSName('replaceState')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _replaceState_1(data, title, url) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLCollection")
-class HtmlCollection extends Interceptor
-    with ListMixin<Node>, ImmutableListMixin<Node>
-    implements JavaScriptIndexingBehavior<Node>, List<Node> {
-  // To suppress missing implicit constructor warnings.
-  factory HtmlCollection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Node operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Node", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Node value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Node> mixins.
-  // Node is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Node get first {
-    if (this.length > 0) {
-      return JS('Node', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Node get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Node', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Node get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Node', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Node elementAt(int index) => this[index];
-  // -- end List<Node> mixins.
-
-  Node? item(int? index) native;
-
-  Object? namedItem(String name) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("HTMLDocument")
-class HtmlDocument extends Document {
-  // To suppress missing implicit constructor warnings.
-  factory HtmlDocument._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  BodyElement? get body native;
-  set body(BodyElement? value) native;
-
-  /// UNSTABLE: Chrome-only - create a Range from the given point.
-  @Unstable()
-  Range caretRangeFromPoint(int? x, int? y) {
-    return _caretRangeFromPoint(x, y);
-  }
-
-  Element? elementFromPoint(int x, int y) {
-    return _elementFromPoint(x, y);
-  }
-
-  HeadElement? get head => _head;
-
-  String get lastModified => _lastModified;
-
-  String? get preferredStylesheetSet => _preferredStylesheetSet;
-
-  String get referrer => _referrer;
-
-  String? get selectedStylesheetSet => _selectedStylesheetSet;
-  set selectedStylesheetSet(String? value) {
-    _selectedStylesheetSet = value;
-  }
-
-  List<StyleSheet> get styleSheets => _styleSheets;
-
-  String get title => _title;
-
-  set title(String value) {
-    _title = value;
-  }
-
-  /**
-   * Returns page to standard layout.
-   *
-   * Has no effect if the page is not in fullscreen mode.
-   *
-   * ## Other resources
-   *
-   * * [Fullscreen
-   *   API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API)
-   *   from MDN.
-   * * [Fullscreen specification](http://www.w3.org/TR/fullscreen/) from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void exitFullscreen() {
-    _webkitExitFullscreen();
-  }
-
-  /**
-   * Register a custom subclass of Element to be instantiatable by the DOM.
-   *
-   * This is necessary to allow the construction of any custom elements.
-   *
-   * The class being registered must either subclass HtmlElement or SvgElement.
-   * If they subclass these directly then they can be used as:
-   *
-   *     class FooElement extends HtmlElement{
-   *        void created() {
-   *          print('FooElement created!');
-   *        }
-   *     }
-   *
-   *     main() {
-   *       document.registerElement('x-foo', FooElement);
-   *       var myFoo = new Element.tag('x-foo');
-   *       // prints 'FooElement created!' to the console.
-   *     }
-   *
-   * The custom element can also be instantiated via HTML using the syntax
-   * `<x-foo></x-foo>`
-   *
-   * Other elements can be subclassed as well:
-   *
-   *     class BarElement extends InputElement{
-   *        void created() {
-   *          print('BarElement created!');
-   *        }
-   *     }
-   *
-   *     main() {
-   *       document.registerElement('x-bar', BarElement);
-   *       var myBar = new Element.tag('input', 'x-bar');
-   *       // prints 'BarElement created!' to the console.
-   *     }
-   *
-   * This custom element can also be instantiated via HTML using the syntax
-   * `<input is="x-bar"></input>`
-   *
-   */
-  Function registerElement2(String tag, [Map? options]) {
-    return _registerCustomElement(JS('', 'window'), this, tag, options);
-  }
-
-  /** *Deprecated*: use [registerElement] instead. */
-  @deprecated
-  void register(String tag, Type customElementClass, {String? extendsTag}) {
-    return registerElement(tag, customElementClass, extendsTag: extendsTag);
-  }
-
-  /**
-   * Static factory designed to expose `visibilitychange` events to event
-   * handlers that are not necessarily instances of [Document].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  static const EventStreamProvider<Event> visibilityChangeEvent =
-      const _CustomEventStreamProvider<Event>(
-          _determineVisibilityChangeEventType);
-
-  static String _determineVisibilityChangeEventType(EventTarget e) {
-    if (JS('bool', '(typeof #.hidden !== "undefined")', e)) {
-      // Opera 12.10 and Firefox 18 and later support
-      return 'visibilitychange';
-    } else if (JS('bool', '(typeof #.mozHidden !== "undefined")', e)) {
-      return 'mozvisibilitychange';
-    } else if (JS('bool', '(typeof #.msHidden !== "undefined")', e)) {
-      return 'msvisibilitychange';
-    } else if (JS('bool', '(typeof #.webkitHidden !== "undefined")', e)) {
-      return 'webkitvisibilitychange';
-    }
-    return 'visibilitychange';
-  }
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  Stream<Event> get onVisibilityChange => visibilityChangeEvent.forTarget(this);
-
-  /// Creates an element upgrader which can be used to change the Dart wrapper
-  /// type for elements.
-  ///
-  /// The type specified must be a subclass of HtmlElement, when an element is
-  /// upgraded then the created constructor will be invoked on that element.
-  ///
-  /// If the type is not a direct subclass of HtmlElement then the extendsTag
-  /// parameter must be provided.
-  ElementUpgrader createElementUpgrader(Type type, {String? extendsTag}) {
-    return new _JSElementUpgrader(this, type, extendsTag);
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLFormControlsCollection")
-class HtmlFormControlsCollection extends HtmlCollection {
-  // To suppress missing implicit constructor warnings.
-  factory HtmlFormControlsCollection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Object? namedItem(String name) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLHtmlElement")
-class HtmlHtmlElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory HtmlHtmlElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory HtmlHtmlElement() => JS<HtmlHtmlElement>(
-      'returns:HtmlHtmlElement;creates:HtmlHtmlElement;new:true',
-      '#.createElement(#)',
-      document,
-      "html");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  HtmlHtmlElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLHyperlinkElementUtils")
-class HtmlHyperlinkElementUtils extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory HtmlHyperlinkElementUtils._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get hash native;
-
-  set hash(String value) native;
-
-  String get host native;
-
-  set host(String value) native;
-
-  String get hostname native;
-
-  set hostname(String value) native;
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get origin native;
-
-  String get password native;
-
-  set password(String value) native;
-
-  String get pathname native;
-
-  set pathname(String value) native;
-
-  String get port native;
-
-  set port(String value) native;
-
-  String get protocol native;
-
-  set protocol(String value) native;
-
-  String get search native;
-
-  set search(String value) native;
-
-  String get username native;
-
-  set username(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLOptionsCollection")
-class HtmlOptionsCollection extends HtmlCollection {
-  // To suppress missing implicit constructor warnings.
-  factory HtmlOptionsCollection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('item')
-  Element? _item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-/**
-  * A client-side XHR request for getting data from a URL,
-  * formally known as XMLHttpRequest.
-  *
-  * HttpRequest can be used to obtain data from HTTP and FTP protocols,
-  * and is useful for AJAX-style page updates.
-  *
-  * The simplest way to get the contents of a text file, such as a
-  * JSON-formatted file, is with [getString].
-  * For example, the following code gets the contents of a JSON file
-  * and prints its length:
-  *
-  *     var path = 'myData.json';
-  *     HttpRequest.getString(path).then((String fileContents) {
-  *       print(fileContents.length);
-  *     }).catchError((error) {
-  *       print(error.toString());
-  *     });
-  *
-  * ## Fetching data from other servers
-  *
-  * For security reasons, browsers impose restrictions on requests
-  * made by embedded apps.
-  * With the default behavior of this class,
-  * the code making the request must be served from the same origin
-  * (domain name, port, and application layer protocol)
-  * as the requested resource.
-  * In the example above, the myData.json file must be co-located with the
-  * app that uses it.
-  * You might be able to
-  * [get around this restriction](http://www.dartlang.org/articles/json-web-service/#a-note-on-cors-and-httprequest)
-  * by using CORS headers or JSONP.
-  *
-  * ## Other resources
-  *
-  * * [Fetch Data Dynamically](https://www.dartlang.org/docs/tutorials/fetchdata/),
-  * a tutorial from _A Game of Darts_,
-  * shows two different ways to use HttpRequest to get a JSON file.
-  * * [Get Input from a Form](https://www.dartlang.org/docs/tutorials/forms/),
-  * another tutorial from _A Game of Darts_,
-  * shows using HttpRequest with a custom server.
-  * * [Dart article on using HttpRequests](http://www.dartlang.org/articles/json-web-service/#getting-data)
-  * * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest)
-  * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
- */
-@Native("XMLHttpRequest")
-class HttpRequest extends HttpRequestEventTarget {
-  /**
-   * Creates a GET request for the specified [url].
-   *
-   * This is similar to [request] but specialized for HTTP GET requests which
-   * return text content.
-   *
-   * To add query parameters, append them to the [url] following a `?`,
-   * joining each key to its value with `=` and separating key-value pairs with
-   * `&`.
-   *
-   *     var name = Uri.encodeQueryComponent('John');
-   *     var id = Uri.encodeQueryComponent('42');
-   *     HttpRequest.getString('users.json?name=$name&id=$id')
-   *       .then((String resp) {
-   *         // Do something with the response.
-   *     });
-   *
-   * See also:
-   *
-   * * [request]
-   */
-  static Future<String> getString(String url,
-      {bool? withCredentials, void onProgress(ProgressEvent e)?}) {
-    return request(url,
-            withCredentials: withCredentials, onProgress: onProgress)
-        .then((HttpRequest xhr) => xhr.responseText);
-  }
-
-  /**
-   * Makes a server POST request with the specified data encoded as form data.
-   *
-   * This is roughly the POST equivalent of [getString]. This method is similar
-   * to sending a [FormData] object with broader browser support but limited to
-   * String values.
-   *
-   * If [data] is supplied, the key/value pairs are URI encoded with
-   * [Uri.encodeQueryComponent] and converted into an HTTP query string.
-   *
-   * Unless otherwise specified, this method appends the following header:
-   *
-   *     Content-Type: application/x-www-form-urlencoded; charset=UTF-8
-   *
-   * Here's an example of using this method:
-   *
-   *     var data = { 'firstName' : 'John', 'lastName' : 'Doe' };
-   *     HttpRequest.postFormData('/send', data).then((HttpRequest resp) {
-   *       // Do something with the response.
-   *     });
-   *
-   * See also:
-   *
-   * * [request]
-   */
-  static Future<HttpRequest> postFormData(String url, Map<String, String> data,
-      {bool? withCredentials,
-      String? responseType,
-      Map<String, String>? requestHeaders,
-      void onProgress(ProgressEvent e)?}) {
-    var parts = [];
-    data.forEach((key, value) {
-      parts.add('${Uri.encodeQueryComponent(key)}='
-          '${Uri.encodeQueryComponent(value)}');
-    });
-    var formData = parts.join('&');
-
-    if (requestHeaders == null) {
-      requestHeaders = <String, String>{};
-    }
-    requestHeaders.putIfAbsent('Content-Type',
-        () => 'application/x-www-form-urlencoded; charset=UTF-8');
-
-    return request(url,
-        method: 'POST',
-        withCredentials: withCredentials,
-        responseType: responseType,
-        requestHeaders: requestHeaders,
-        sendData: formData,
-        onProgress: onProgress);
-  }
-
-  /**
-   * Creates and sends a URL request for the specified [url].
-   *
-   * By default `request` will perform an HTTP GET request, but a different
-   * method (`POST`, `PUT`, `DELETE`, etc) can be used by specifying the
-   * [method] parameter. (See also [HttpRequest.postFormData] for `POST`
-   * requests only.
-   *
-   * The Future is completed when the response is available.
-   *
-   * If specified, `sendData` will send data in the form of a [ByteBuffer],
-   * [Blob], [Document], [String], or [FormData] along with the HttpRequest.
-   *
-   * If specified, [responseType] sets the desired response format for the
-   * request. By default it is [String], but can also be 'arraybuffer', 'blob',
-   * 'document', 'json', or 'text'. See also [HttpRequest.responseType]
-   * for more information.
-   *
-   * The [withCredentials] parameter specified that credentials such as a cookie
-   * (already) set in the header or
-   * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2)
-   * should be specified for the request. Details to keep in mind when using
-   * credentials:
-   *
-   * * Using credentials is only useful for cross-origin requests.
-   * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildcard (*).
-   * * The `Access-Control-Allow-Credentials` header of `url` must be set to true.
-   * * If `Access-Control-Expose-Headers` has not been set to true, only a subset of all the response headers will be returned when calling [getAllRequestHeaders].
-   *
-   * The following is equivalent to the [getString] sample above:
-   *
-   *     var name = Uri.encodeQueryComponent('John');
-   *     var id = Uri.encodeQueryComponent('42');
-   *     HttpRequest.request('users.json?name=$name&id=$id')
-   *       .then((HttpRequest resp) {
-   *         // Do something with the response.
-   *     });
-   *
-   * Here's an example of submitting an entire form with [FormData].
-   *
-   *     var myForm = querySelector('form#myForm');
-   *     var data = new FormData(myForm);
-   *     HttpRequest.request('/submit', method: 'POST', sendData: data)
-   *       .then((HttpRequest resp) {
-   *         // Do something with the response.
-   *     });
-   *
-   * Note that requests for file:// URIs are only supported by Chrome extensions
-   * with appropriate permissions in their manifest. Requests to file:// URIs
-   * will also never fail- the Future will always complete successfully, even
-   * when the file cannot be found.
-   *
-   * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
-   */
-  static Future<HttpRequest> request(String url,
-      {String? method,
-      bool? withCredentials,
-      String? responseType,
-      String? mimeType,
-      Map<String, String>? requestHeaders,
-      sendData,
-      void onProgress(ProgressEvent e)?}) {
-    var completer = new Completer<HttpRequest>();
-
-    var xhr = new HttpRequest();
-    if (method == null) {
-      method = 'GET';
-    }
-    xhr.open(method, url, async: true);
-
-    if (withCredentials != null) {
-      xhr.withCredentials = withCredentials;
-    }
-
-    if (responseType != null) {
-      xhr.responseType = responseType;
-    }
-
-    if (mimeType != null) {
-      xhr.overrideMimeType(mimeType);
-    }
-
-    if (requestHeaders != null) {
-      requestHeaders.forEach((header, value) {
-        xhr.setRequestHeader(header, value);
-      });
-    }
-
-    if (onProgress != null) {
-      xhr.onProgress.listen(onProgress);
-    }
-
-    xhr.onLoad.listen((e) {
-      var accepted = xhr.status >= 200 && xhr.status < 300;
-      var fileUri = xhr.status == 0; // file:// URIs have status of 0.
-      var notModified = xhr.status == 304;
-      // Redirect status is specified up to 307, but others have been used in
-      // practice. Notably Google Drive uses 308 Resume Incomplete for
-      // resumable uploads, and it's also been used as a redirect. The
-      // redirect case will be handled by the browser before it gets to us,
-      // so if we see it we should pass it through to the user.
-      var unknownRedirect = xhr.status > 307 && xhr.status < 400;
-
-      if (accepted || fileUri || notModified || unknownRedirect) {
-        completer.complete(xhr);
-      } else {
-        completer.completeError(e);
-      }
-    });
-
-    xhr.onError.listen(completer.completeError);
-
-    if (sendData != null) {
-      xhr.send(sendData);
-    } else {
-      xhr.send();
-    }
-
-    return completer.future;
-  }
-
-  /**
-   * Checks to see if the Progress event is supported on the current platform.
-   */
-  static bool get supportsProgressEvent {
-    var xhr = new HttpRequest();
-    return JS('bool', '("onprogress" in #)', xhr);
-  }
-
-  /**
-   * Checks to see if the current platform supports making cross origin
-   * requests.
-   *
-   * Note that even if cross origin requests are supported, they still may fail
-   * if the destination server does not support CORS requests.
-   */
-  static bool get supportsCrossOrigin {
-    var xhr = new HttpRequest();
-    return JS('bool', '("withCredentials" in #)', xhr);
-  }
-
-  /**
-   * Checks to see if the LoadEnd event is supported on the current platform.
-   */
-  static bool get supportsLoadEndEvent {
-    var xhr = new HttpRequest();
-    return JS('bool', '("onloadend" in #)', xhr);
-  }
-
-  /**
-   * Checks to see if the overrideMimeType method is supported on the current
-   * platform.
-   */
-  static bool get supportsOverrideMimeType {
-    var xhr = new HttpRequest();
-    return JS('bool', '("overrideMimeType" in #)', xhr);
-  }
-
-  /**
-   * Makes a cross-origin request to the specified URL.
-   *
-   * This API provides a subset of [request] which works on IE9. If IE9
-   * cross-origin support is not required then [request] should be used instead.
-   */
-  static Future<String> requestCrossOrigin(String url,
-      {String? method, String? sendData}) {
-    if (supportsCrossOrigin) {
-      return request(url, method: method, sendData: sendData).then((xhr) {
-        return xhr.responseText;
-      });
-    }
-    var completer = new Completer<String>();
-    if (method == null) {
-      method = 'GET';
-    }
-    var xhr = JS('var', 'new XDomainRequest()');
-    JS('', '#.open(#, #)', xhr, method, url);
-    JS(
-        '',
-        '#.onload = #',
-        xhr,
-        convertDartClosureToJS((e) {
-          var response = JS('String', '#.responseText', xhr);
-          completer.complete(response as FutureOr<String>?);
-        }, 1));
-    JS(
-        '',
-        '#.onerror = #',
-        xhr,
-        convertDartClosureToJS((e) {
-          completer.completeError(e);
-        }, 1));
-
-    // IE9 RTM - XDomainRequest issued requests may abort if all event handlers
-    // not specified
-    // http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified
-    JS('', '#.onprogress = {}', xhr);
-    JS('', '#.ontimeout = {}', xhr);
-    JS('', '#.timeout = Number.MAX_VALUE', xhr);
-
-    if (sendData != null) {
-      JS('', '#.send(#)', xhr, sendData);
-    } else {
-      JS('', '#.send()', xhr);
-    }
-
-    return completer.future;
-  }
-
-  /**
-   * Returns all response headers as a key-value map.
-   *
-   * Multiple values for the same header key can be combined into one,
-   * separated by a comma and a space.
-   *
-   * See: http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
-   */
-  Map<String, String> get responseHeaders {
-    // from Closure's goog.net.Xhrio.getResponseHeaders.
-    var headers = <String, String>{};
-    var headersString = this.getAllResponseHeaders();
-    if (headersString == null) {
-      return headers;
-    }
-    var headersList = headersString.split('\r\n');
-    for (var header in headersList) {
-      if (header.isEmpty) {
-        continue;
-      }
-
-      var splitIdx = header.indexOf(': ');
-      if (splitIdx == -1) {
-        continue;
-      }
-      var key = header.substring(0, splitIdx).toLowerCase();
-      var value = header.substring(splitIdx + 2);
-      if (headers.containsKey(key)) {
-        headers[key] = '${headers[key]}, $value';
-      } else {
-        headers[key] = value;
-      }
-    }
-    return headers;
-  }
-
-  /**
-   * Specify the desired `url`, and `method` to use in making the request.
-   *
-   * By default the request is done asyncronously, with no user or password
-   * authentication information. If `async` is false, the request will be sent
-   * synchronously.
-   *
-   * Calling `open` again on a currently active request is equivalent to
-   * calling [abort].
-   *
-   * Note: Most simple HTTP requests can be accomplished using the [getString],
-   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
-   * `open` method is intended only for more complex HTTP requests where
-   * finer-grained control is needed.
-   */
-  void open(String method, String url,
-      {bool? async, String? user, String? password}) native;
-
-  // To suppress missing implicit constructor warnings.
-  factory HttpRequest._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `readystatechange` events to event
-   * handlers that are not necessarily instances of [HttpRequest].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> readyStateChangeEvent =
-      const EventStreamProvider<Event>('readystatechange');
-
-  /**
-   * General constructor for any type of request (GET, POST, etc).
-   *
-   * This call is used in conjunction with [open]:
-   *
-   *     var request = new HttpRequest();
-   *     request.open('GET', 'http://dartlang.org');
-   *     request.onLoad.listen((event) => print(
-   *         'Request complete ${event.target.reponseText}'));
-   *     request.send();
-   *
-   * is the (more verbose) equivalent of
-   *
-   *     HttpRequest.getString('http://dartlang.org').then(
-   *         (result) => print('Request complete: $result'));
-   */
-  factory HttpRequest() {
-    return HttpRequest._create_1();
-  }
-  static HttpRequest _create_1() => JS('HttpRequest', 'new XMLHttpRequest()');
-
-  static const int DONE = 4;
-
-  static const int HEADERS_RECEIVED = 2;
-
-  static const int LOADING = 3;
-
-  static const int OPENED = 1;
-
-  static const int UNSENT = 0;
-
-  /**
-   * Indicator of the current state of the request:
-   *
-   * <table>
-   *   <tr>
-   *     <td>Value</td>
-   *     <td>State</td>
-   *     <td>Meaning</td>
-   *   </tr>
-   *   <tr>
-   *     <td>0</td>
-   *     <td>unsent</td>
-   *     <td><code>open()</code> has not yet been called</td>
-   *   </tr>
-   *   <tr>
-   *     <td>1</td>
-   *     <td>opened</td>
-   *     <td><code>send()</code> has not yet been called</td>
-   *   </tr>
-   *   <tr>
-   *     <td>2</td>
-   *     <td>headers received</td>
-   *     <td><code>sent()</code> has been called; response headers and <code>status</code> are available</td>
-   *   </tr>
-   *   <tr>
-   *     <td>3</td> <td>loading</td> <td><code>responseText</code> holds some data</td>
-   *   </tr>
-   *   <tr>
-   *     <td>4</td> <td>done</td> <td>request is complete</td>
-   *   </tr>
-   * </table>
-   */
-
-  int get readyState native;
-
-  /**
-   * The data received as a reponse from the request.
-   *
-   * The data could be in the
-   * form of a [String], [ByteBuffer], [Document], [Blob], or json (also a
-   * [String]). `null` indicates request failure.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  dynamic get response => _convertNativeToDart_XHR_Response(this._get_response);
-  @JSName('response')
-  /**
-   * The data received as a reponse from the request.
-   *
-   * The data could be in the
-   * form of a [String], [ByteBuffer], [Document], [Blob], or json (also a
-   * [String]). `null` indicates request failure.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @Creates(
-      'NativeByteBuffer|Blob|Document|=Object|JSExtendableArray|String|num')
-  dynamic get _get_response native;
-
-  /**
-   * The response in String form or empty String on failure.
-   */
-
-  String get responseText native;
-
-  /**
-   * [String] telling the server the desired response format.
-   *
-   * Default is `String`.
-   * Other options are one of 'arraybuffer', 'blob', 'document', 'json',
-   * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
-   * `responseType` is set while performing a synchronous request.
-   *
-   * See also: [MDN
-   * responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype)
-   */
-
-  String get responseType native;
-
-  set responseType(String value) native;
-
-  @JSName('responseURL')
-  String get responseUrl native;
-
-  @JSName('responseXML')
-
-  /**
-   * The request response, or null on failure.
-   *
-   * The response is processed as
-   * `text/xml` stream, unless responseType = 'document' and the request is
-   * synchronous.
-   */
-
-  Document? get responseXml native;
-
-  /**
-   * The HTTP result code from the request (200, 404, etc).
-   * See also: [HTTP Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
-   */
-
-  int get status native;
-
-  /**
-   * The request response string (such as \"OK\").
-   * See also: [HTTP Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
-   */
-
-  String get statusText native;
-
-  /**
-   * Length of time in milliseconds before a request is automatically
-   * terminated.
-   *
-   * When the time has passed, a [TimeoutEvent] is dispatched.
-   *
-   * If [timeout] is set to 0, then the request will not time out.
-   *
-   * ## Other resources
-   *
-   * * [XMLHttpRequest.timeout](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-timeout)
-   *   from MDN.
-   * * [The timeout attribute](http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute)
-   *   from W3C.
-   */
-
-  int get timeout native;
-
-  set timeout(int value) native;
-
-  /**
-   * [EventTarget] that can hold listeners to track the progress of the request.
-   * The events fired will be members of [HttpRequestUploadEvents].
-   */
-  @Unstable()
-  HttpRequestUpload get upload native;
-
-  /**
-   * True if cross-site requests should use credentials such as cookies
-   * or authorization headers; false otherwise.
-   *
-   * This value is ignored for same-site requests.
-   */
-
-  bool get withCredentials native;
-
-  set withCredentials(bool value) native;
-
-  /**
-   * Stop the current request.
-   *
-   * The request can only be stopped if readyState is `HEADERS_RECEIVED` or
-   * `LOADING`. If this method is not in the process of being sent, the method
-   * has no effect.
-   */
-  void abort() native;
-
-  /**
-   * Retrieve all the response headers from a request.
-   *
-   * `null` if no headers have been received. For multipart requests,
-   * `getAllResponseHeaders` will return the response headers for the current
-   * part of the request.
-   *
-   * See also [HTTP response
-   * headers](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields)
-   * for a list of common response headers.
-   */
-  @Unstable()
-  String getAllResponseHeaders() native;
-
-  /**
-   * Return the response header named `header`, or null if not found.
-   *
-   * See also [HTTP response
-   * headers](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields)
-   * for a list of common response headers.
-   */
-  @Unstable()
-  String? getResponseHeader(String name) native;
-
-  /**
-   * Specify a particular MIME type (such as `text/xml`) desired for the
-   * response.
-   *
-   * This value must be set before the request has been sent. See also the list
-   * of [IANA Official MIME types](https://www.iana.org/assignments/media-types/media-types.xhtml).
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void overrideMimeType(String mime) native;
-
-  /**
-   * Send the request with any given `data`.
-   *
-   * Note: Most simple HTTP requests can be accomplished using the [getString],
-   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
-   * `send` method is intended only for more complex HTTP requests where
-   * finer-grained control is needed.
-   *
-   * ## Other resources
-   *
-   * * [XMLHttpRequest.send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send%28%29)
-   *   from MDN.
-   */
-  void send([body_OR_data]) native;
-
-  /**
-   * Sets the value of an HTTP request header.
-   *
-   * This method should be called after the request is opened, but before
-   * the request is sent.
-   *
-   * Multiple calls with the same header will combine all their values into a
-   * single header.
-   *
-   * ## Other resources
-   *
-   * * [XMLHttpRequest.setRequestHeader](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#setRequestHeader())
-   *   from MDN.
-   * * [The setRequestHeader()
-   *   method](http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method)
-   *   from W3C.
-   */
-  void setRequestHeader(String name, String value) native;
-
-  /// Stream of `readystatechange` events handled by this [HttpRequest].
-/**
-   * Event listeners to be notified every time the [HttpRequest]
-   * object's `readyState` changes values.
-   */
-  Stream<Event> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("XMLHttpRequestEventTarget")
-class HttpRequestEventTarget extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory HttpRequestEventTarget._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `abort` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> abortEvent =
-      const EventStreamProvider<ProgressEvent>('abort');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> errorEvent =
-      const EventStreamProvider<ProgressEvent>('error');
-
-  /**
-   * Static factory designed to expose `load` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> loadEvent =
-      const EventStreamProvider<ProgressEvent>('load');
-
-  /**
-   * Static factory designed to expose `loadend` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> loadEndEvent =
-      const EventStreamProvider<ProgressEvent>('loadend');
-
-  /**
-   * Static factory designed to expose `loadstart` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> loadStartEvent =
-      const EventStreamProvider<ProgressEvent>('loadstart');
-
-  /**
-   * Static factory designed to expose `progress` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> progressEvent =
-      const EventStreamProvider<ProgressEvent>('progress');
-
-  /**
-   * Static factory designed to expose `timeout` events to event
-   * handlers that are not necessarily instances of [HttpRequestEventTarget].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<ProgressEvent> timeoutEvent =
-      const EventStreamProvider<ProgressEvent>('timeout');
-
-  /// Stream of `abort` events handled by this [HttpRequestEventTarget].
-  Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [HttpRequestEventTarget].
-  Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `load` events handled by this [HttpRequestEventTarget].
-  Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
-
-  /// Stream of `loadend` events handled by this [HttpRequestEventTarget].
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
-
-  /// Stream of `loadstart` events handled by this [HttpRequestEventTarget].
-  Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
-
-  /// Stream of `progress` events handled by this [HttpRequestEventTarget].
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE, '10')
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
-
-  /// Stream of `timeout` events handled by this [HttpRequestEventTarget].
-  Stream<ProgressEvent> get onTimeout => timeoutEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("XMLHttpRequestUpload")
-class HttpRequestUpload extends HttpRequestEventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory HttpRequestUpload._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLIFrameElement")
-class IFrameElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory IFrameElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory IFrameElement() => JS<IFrameElement>(
-      'returns:IFrameElement;creates:IFrameElement;new:true',
-      '#.createElement(#)',
-      document,
-      "iframe");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  IFrameElement.created() : super.created();
-
-  String get allow native;
-
-  set allow(String value) native;
-
-  bool get allowFullscreen native;
-
-  set allowFullscreen(bool value) native;
-
-  bool get allowPaymentRequest native;
-
-  set allowPaymentRequest(bool value) native;
-
-  WindowBase? get contentWindow =>
-      _convertNativeToDart_Window(this._get_contentWindow);
-  @JSName('contentWindow')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_contentWindow native;
-
-  String get csp native;
-
-  set csp(String value) native;
-
-  String get height native;
-
-  set height(String value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get referrerPolicy native;
-
-  set referrerPolicy(String value) native;
-
-  DomTokenList get sandbox native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get srcdoc native;
-
-  set srcdoc(String value) native;
-
-  String get width native;
-
-  set width(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("IdleDeadline")
-class IdleDeadline extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory IdleDeadline._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get didTimeout native;
-
-  double timeRemaining() native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void IdleRequestCallback(IdleDeadline deadline);
-// Copyright (c) 2012, 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.
-
-@Native("ImageBitmap")
-class ImageBitmap extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ImageBitmap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get height native;
-
-  int get width native;
-
-  void close() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ImageBitmapRenderingContext")
-class ImageBitmapRenderingContext extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ImageBitmapRenderingContext._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CanvasElement get canvas native;
-
-  void transferFromImageBitmap(ImageBitmap? bitmap) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ImageCapture")
-class ImageCapture extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ImageCapture._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ImageCapture(MediaStreamTrack track) {
-    return ImageCapture._create_1(track);
-  }
-  static ImageCapture _create_1(track) =>
-      JS('ImageCapture', 'new ImageCapture(#)', track);
-
-  MediaStreamTrack get track native;
-
-  Future<PhotoCapabilities> getPhotoCapabilities() =>
-      promiseToFuture<PhotoCapabilities>(
-          JS("", "#.getPhotoCapabilities()", this));
-
-  Future<Map<String, dynamic>?> getPhotoSettings() =>
-      promiseToFutureAsMap(JS("", "#.getPhotoSettings()", this));
-
-  Future<ImageBitmap> grabFrame() =>
-      promiseToFuture<ImageBitmap>(JS("", "#.grabFrame()", this));
-
-  Future setOptions(Map photoSettings) {
-    var photoSettings_dict = convertDartToNative_Dictionary(photoSettings);
-    return promiseToFuture(JS("", "#.setOptions(#)", this, photoSettings_dict));
-  }
-
-  Future<Blob> takePhoto([Map? photoSettings]) {
-    var photoSettings_dict = null;
-    if (photoSettings != null) {
-      photoSettings_dict = convertDartToNative_Dictionary(photoSettings);
-    }
-    return promiseToFuture<Blob>(
-        JS("", "#.takePhoto(#)", this, photoSettings_dict));
-  }
-}
-// Copyright (c) 2013, 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.
-
-@Native("ImageData")
-class ImageData extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ImageData._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ImageData(data_OR_sw, int sh_OR_sw, [int? sh]) {
-    if ((sh_OR_sw is int) && (data_OR_sw is int) && sh == null) {
-      return ImageData._create_1(data_OR_sw, sh_OR_sw);
-    }
-    if ((sh_OR_sw is int) && (data_OR_sw is Uint8ClampedList) && sh == null) {
-      return ImageData._create_2(data_OR_sw, sh_OR_sw);
-    }
-    if ((sh is int) && (sh_OR_sw is int) && (data_OR_sw is Uint8ClampedList)) {
-      return ImageData._create_3(data_OR_sw, sh_OR_sw, sh);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static ImageData _create_1(data_OR_sw, sh_OR_sw) =>
-      JS('ImageData', 'new ImageData(#,#)', data_OR_sw, sh_OR_sw);
-  static ImageData _create_2(data_OR_sw, sh_OR_sw) =>
-      JS('ImageData', 'new ImageData(#,#)', data_OR_sw, sh_OR_sw);
-  static ImageData _create_3(data_OR_sw, sh_OR_sw, sh) =>
-      JS('ImageData', 'new ImageData(#,#,#)', data_OR_sw, sh_OR_sw, sh);
-
-  @Creates('NativeUint8ClampedList')
-  @Returns('NativeUint8ClampedList')
-  Uint8ClampedList get data native;
-
-  int get height native;
-
-  int get width native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLImageElement")
-class ImageElement extends HtmlElement implements CanvasImageSource {
-  // To suppress missing implicit constructor warnings.
-  factory ImageElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ImageElement({String? src, int? width, int? height}) {
-    ImageElement e = JS<ImageElement>(
-        'returns:ImageElement;creates:ImageElement;new:true',
-        '#.createElement(#)',
-        document,
-        "img");
-    if (src != null) e.src = src;
-    if (width != null) e.width = width;
-    if (height != null) e.height = height;
-    return e;
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ImageElement.created() : super.created();
-
-  String get alt native;
-
-  set alt(String value) native;
-
-  String get async native;
-
-  set async(String value) native;
-
-  bool get complete native;
-
-  String? get crossOrigin native;
-
-  set crossOrigin(String? value) native;
-
-  String get currentSrc native;
-
-  int get height native;
-
-  set height(int value) native;
-
-  bool get isMap native;
-
-  set isMap(bool value) native;
-
-  int get naturalHeight native;
-
-  int get naturalWidth native;
-
-  String get referrerPolicy native;
-
-  set referrerPolicy(String value) native;
-
-  String get sizes native;
-
-  set sizes(String value) native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get srcset native;
-
-  set srcset(String value) native;
-
-  String get useMap native;
-
-  set useMap(String value) native;
-
-  int get width native;
-
-  set width(int value) native;
-
-  Future decode() => promiseToFuture(JS("", "#.decode()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("InputDeviceCapabilities")
-class InputDeviceCapabilities extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory InputDeviceCapabilities._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory InputDeviceCapabilities([Map? deviceInitDict]) {
-    if (deviceInitDict != null) {
-      var deviceInitDict_1 = convertDartToNative_Dictionary(deviceInitDict);
-      return InputDeviceCapabilities._create_1(deviceInitDict_1);
-    }
-    return InputDeviceCapabilities._create_2();
-  }
-  static InputDeviceCapabilities _create_1(deviceInitDict) => JS(
-      'InputDeviceCapabilities',
-      'new InputDeviceCapabilities(#)',
-      deviceInitDict);
-  static InputDeviceCapabilities _create_2() =>
-      JS('InputDeviceCapabilities', 'new InputDeviceCapabilities()');
-
-  bool get firesTouchEvents native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLInputElement")
-class InputElement extends HtmlElement
-    implements
-        HiddenInputElement,
-        SearchInputElement,
-        TextInputElement,
-        UrlInputElement,
-        TelephoneInputElement,
-        EmailInputElement,
-        PasswordInputElement,
-        DateInputElement,
-        MonthInputElement,
-        WeekInputElement,
-        TimeInputElement,
-        LocalDateTimeInputElement,
-        NumberInputElement,
-        RangeInputElement,
-        CheckboxInputElement,
-        RadioButtonInputElement,
-        FileUploadInputElement,
-        SubmitButtonInputElement,
-        ImageButtonInputElement,
-        ResetButtonInputElement,
-        ButtonInputElement {
-  factory InputElement({String? type}) {
-    InputElement e = document.createElement("input") as InputElement;
-    if (type != null) {
-      try {
-        // IE throws an exception for unknown types.
-        e.type = type;
-      } catch (_) {}
-    }
-    return e;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory InputElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  InputElement.created() : super.created();
-
-  String get accept native;
-
-  set accept(String value) native;
-
-  String get alt native;
-
-  set alt(String value) native;
-
-  String get autocapitalize native;
-
-  set autocapitalize(String value) native;
-
-  String get autocomplete native;
-
-  set autocomplete(String value) native;
-
-  bool get autofocus native;
-
-  set autofocus(bool value) native;
-
-  String get capture native;
-
-  set capture(String value) native;
-
-  bool get checked native;
-
-  set checked(bool value) native;
-
-  bool get defaultChecked native;
-
-  set defaultChecked(bool value) native;
-
-  String get defaultValue native;
-
-  set defaultValue(String value) native;
-
-  String get dirName native;
-
-  set dirName(String value) native;
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  @Returns('FileList|Null')
-  @Creates('FileList')
-  List<File>? get files native;
-
-  set files(List<File>? value) native;
-
-  FormElement? get form native;
-
-  String get formAction native;
-
-  set formAction(String value) native;
-
-  String get formEnctype native;
-
-  set formEnctype(String value) native;
-
-  String get formMethod native;
-
-  set formMethod(String value) native;
-
-  bool get formNoValidate native;
-
-  set formNoValidate(bool value) native;
-
-  String get formTarget native;
-
-  set formTarget(String value) native;
-
-  int get height native;
-
-  set height(int value) native;
-
-  bool get incremental native;
-
-  set incremental(bool value) native;
-
-  bool get indeterminate native;
-
-  set indeterminate(bool value) native;
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  HtmlElement? get list native;
-
-  String get max native;
-
-  set max(String value) native;
-
-  int get maxLength native;
-
-  set maxLength(int value) native;
-
-  String get min native;
-
-  set min(String value) native;
-
-  int get minLength native;
-
-  set minLength(int value) native;
-
-  bool get multiple native;
-
-  set multiple(bool value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get pattern native;
-
-  set pattern(String value) native;
-
-  String get placeholder native;
-
-  set placeholder(String value) native;
-
-  bool get readOnly native;
-
-  set readOnly(bool value) native;
-
-  bool get required native;
-
-  set required(bool value) native;
-
-  String? get selectionDirection native;
-
-  set selectionDirection(String? value) native;
-
-  int? get selectionEnd native;
-
-  set selectionEnd(int? value) native;
-
-  int? get selectionStart native;
-
-  set selectionStart(int? value) native;
-
-  int get size native;
-
-  set size(int value) native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get step native;
-
-  set step(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  String get value native;
-
-  set value(String? value) native;
-
-  DateTime get valueAsDate =>
-      convertNativeToDart_DateTime(this._get_valueAsDate);
-  @JSName('valueAsDate')
-  @Creates('Null')
-  dynamic get _get_valueAsDate native;
-
-  set valueAsDate(DateTime? value) {
-    this._set_valueAsDate = convertDartToNative_DateTime(value!);
-  }
-
-  set _set_valueAsDate(/*dynamic*/ value) {
-    JS("void", "#.valueAsDate = #", this, value);
-  }
-
-  num get valueAsNumber native;
-
-  set valueAsNumber(num value) native;
-
-  @JSName('webkitEntries')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  List<Entry> get entries native;
-
-  @JSName('webkitdirectory')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  bool get directory native;
-
-  @JSName('webkitdirectory')
-  set directory(bool value) native;
-
-  int get width native;
-
-  set width(int value) native;
-
-  bool get willValidate native;
-
-  bool checkValidity() native;
-
-  bool reportValidity() native;
-
-  void select() native;
-
-  void setCustomValidity(String error) native;
-
-  void setRangeText(String replacement,
-      {int? start, int? end, String? selectionMode}) native;
-
-  void setSelectionRange(int start, int end, [String? direction]) native;
-
-  void stepDown([int? n]) native;
-
-  void stepUp([int? n]) native;
-}
-
-// Interfaces representing the InputElement APIs which are supported
-// for the various types of InputElement. From:
-// https://w3c.github.io/html/sec-forms.html#the-input-element.
-
-/**
- * Exposes the functionality common between all InputElement types.
- */
-abstract class InputElementBase implements Element {
-  bool get autofocus;
-  set autofocus(bool value);
-
-  bool get disabled;
-  set disabled(bool value);
-
-  bool get incremental;
-  set incremental(bool value);
-
-  bool get indeterminate;
-  set indeterminate(bool value);
-
-  String get name;
-  set name(String value);
-
-  String get value;
-  set value(String? value);
-
-  List<Node> get labels;
-
-  String get validationMessage;
-
-  ValidityState get validity;
-
-  bool get willValidate;
-
-  bool checkValidity();
-
-  void setCustomValidity(String error);
-}
-
-/**
- * Hidden input which is not intended to be seen or edited by the user.
- */
-abstract class HiddenInputElement implements InputElementBase {
-  factory HiddenInputElement() => new InputElement(type: 'hidden');
-}
-
-/**
- * Base interface for all inputs which involve text editing.
- */
-abstract class TextInputElementBase implements InputElementBase {
-  String get autocomplete;
-  set autocomplete(String value);
-
-  int get maxLength;
-  set maxLength(int value);
-
-  String get pattern;
-  set pattern(String value);
-
-  String get placeholder;
-  set placeholder(String value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  int get size;
-  set size(int value);
-
-  void select();
-
-  String? get selectionDirection;
-  set selectionDirection(String? value);
-
-  int? get selectionEnd;
-  set selectionEnd(int? value);
-
-  int? get selectionStart;
-  set selectionStart(int? value);
-
-  void setSelectionRange(int start, int end, [String? direction]);
-}
-
-/**
- * Similar to [TextInputElement], but on platforms where search is styled
- * differently this will get the search style.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class SearchInputElement implements TextInputElementBase {
-  factory SearchInputElement() => new InputElement(type: 'search');
-
-  String get dirName;
-  set dirName(String value);
-
-  Element? get list;
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'search')).type == 'search';
-  }
-}
-
-/**
- * A basic text input editor control.
- */
-abstract class TextInputElement implements TextInputElementBase {
-  factory TextInputElement() => new InputElement(type: 'text');
-
-  String get dirName;
-  set dirName(String value);
-
-  Element? get list;
-}
-
-/**
- * A control for editing an absolute URL.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class UrlInputElement implements TextInputElementBase {
-  factory UrlInputElement() => new InputElement(type: 'url');
-
-  Element? get list;
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'url')).type == 'url';
-  }
-}
-
-/**
- * Represents a control for editing a telephone number.
- *
- * This provides a single line of text with minimal formatting help since
- * there is a wide variety of telephone numbers.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class TelephoneInputElement implements TextInputElementBase {
-  factory TelephoneInputElement() => new InputElement(type: 'tel');
-
-  Element? get list;
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'tel')).type == 'tel';
-  }
-}
-
-/**
- * An e-mail address or list of e-mail addresses.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class EmailInputElement implements TextInputElementBase {
-  factory EmailInputElement() => new InputElement(type: 'email');
-
-  String get autocomplete;
-  set autocomplete(String value);
-
-  bool get autofocus;
-  set autofocus(bool value);
-
-  Element? get list;
-
-  int get maxLength;
-  set maxLength(int value);
-
-  bool get multiple;
-  set multiple(bool value);
-
-  String get pattern;
-  set pattern(String value);
-
-  String get placeholder;
-  set placeholder(String value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  int get size;
-  set size(int value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'email')).type == 'email';
-  }
-}
-
-/**
- * Text with no line breaks (sensitive information).
- */
-abstract class PasswordInputElement implements TextInputElementBase {
-  factory PasswordInputElement() => new InputElement(type: 'password');
-}
-
-/**
- * Base interface for all input element types which involve ranges.
- */
-abstract class RangeInputElementBase implements InputElementBase {
-  Element? get list;
-
-  String get max;
-  set max(String value);
-
-  String get min;
-  set min(String value);
-
-  String get step;
-  set step(String value);
-
-  num get valueAsNumber;
-  set valueAsNumber(num value);
-
-  void stepDown([int? n]);
-
-  void stepUp([int? n]);
-}
-
-/**
- * A date (year, month, day) with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-abstract class DateInputElement implements RangeInputElementBase {
-  factory DateInputElement() => new InputElement(type: 'date');
-
-  DateTime get valueAsDate;
-  set valueAsDate(DateTime value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'date')).type == 'date';
-  }
-}
-
-/**
- * A date consisting of a year and a month with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-abstract class MonthInputElement implements RangeInputElementBase {
-  factory MonthInputElement() => new InputElement(type: 'month');
-
-  DateTime get valueAsDate;
-  set valueAsDate(DateTime value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'month')).type == 'month';
-  }
-}
-
-/**
- * A date consisting of a week-year number and a week number with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-abstract class WeekInputElement implements RangeInputElementBase {
-  factory WeekInputElement() => new InputElement(type: 'week');
-
-  DateTime get valueAsDate;
-  set valueAsDate(DateTime value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'week')).type == 'week';
-  }
-}
-
-/**
- * A time (hour, minute, seconds, fractional seconds) with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-abstract class TimeInputElement implements RangeInputElementBase {
-  factory TimeInputElement() => new InputElement(type: 'time');
-
-  DateTime get valueAsDate;
-  set valueAsDate(DateTime value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'time')).type == 'time';
-  }
-}
-
-/**
- * A date and time (year, month, day, hour, minute, second, fraction of a
- * second) with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-abstract class LocalDateTimeInputElement implements RangeInputElementBase {
-  factory LocalDateTimeInputElement() =>
-      new InputElement(type: 'datetime-local');
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'datetime-local')).type == 'datetime-local';
-  }
-}
-
-/**
- * A numeric editor control.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class NumberInputElement implements RangeInputElementBase {
-  factory NumberInputElement() => new InputElement(type: 'number');
-
-  String get placeholder;
-  set placeholder(String value);
-
-  bool get readOnly;
-  set readOnly(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'number')).type == 'number';
-  }
-}
-
-/**
- * Similar to [NumberInputElement] but the browser may provide more optimal
- * styling (such as a slider control).
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-abstract class RangeInputElement implements RangeInputElementBase {
-  factory RangeInputElement() => new InputElement(type: 'range');
-
-  /// Returns true if this input type is supported on the current platform.
-  static bool get supported {
-    return (new InputElement(type: 'range')).type == 'range';
-  }
-}
-
-/**
- * A boolean editor control.
- *
- * Note that if [indeterminate] is set then this control is in a third
- * indeterminate state.
- */
-abstract class CheckboxInputElement implements InputElementBase {
-  factory CheckboxInputElement() => new InputElement(type: 'checkbox');
-
-  bool get checked;
-  set checked(bool value);
-
-  bool get required;
-  set required(bool value);
-}
-
-/**
- * A control that when used with other [ReadioButtonInputElement] controls
- * forms a radio button group in which only one control can be checked at a
- * time.
- *
- * Radio buttons are considered to be in the same radio button group if:
- *
- * * They are all of type 'radio'.
- * * They all have either the same [FormElement] owner, or no owner.
- * * Their name attributes contain the same name.
- */
-abstract class RadioButtonInputElement implements InputElementBase {
-  factory RadioButtonInputElement() => new InputElement(type: 'radio');
-
-  bool get checked;
-  set checked(bool value);
-
-  bool get required;
-  set required(bool value);
-}
-
-/**
- * A control for picking files from the user's computer.
- */
-abstract class FileUploadInputElement implements InputElementBase {
-  factory FileUploadInputElement() => new InputElement(type: 'file');
-
-  String get accept;
-  set accept(String value);
-
-  bool get multiple;
-  set multiple(bool value);
-
-  bool get required;
-  set required(bool value);
-
-  List<File>? files;
-}
-
-/**
- * A button, which when clicked, submits the form.
- */
-abstract class SubmitButtonInputElement implements InputElementBase {
-  factory SubmitButtonInputElement() => new InputElement(type: 'submit');
-
-  String get formAction;
-  set formAction(String value);
-
-  String get formEnctype;
-  set formEnctype(String value);
-
-  String get formMethod;
-  set formMethod(String value);
-
-  bool get formNoValidate;
-  set formNoValidate(bool value);
-
-  String get formTarget;
-  set formTarget(String value);
-}
-
-/**
- * Either an image which the user can select a coordinate to or a form
- * submit button.
- */
-abstract class ImageButtonInputElement implements InputElementBase {
-  factory ImageButtonInputElement() => new InputElement(type: 'image');
-
-  String get alt;
-  set alt(String value);
-
-  String get formAction;
-  set formAction(String value);
-
-  String get formEnctype;
-  set formEnctype(String value);
-
-  String get formMethod;
-  set formMethod(String value);
-
-  bool get formNoValidate;
-  set formNoValidate(bool value);
-
-  String get formTarget;
-  set formTarget(String value);
-
-  int get height;
-  set height(int value);
-
-  String get src;
-  set src(String value);
-
-  int get width;
-  set width(int value);
-}
-
-/**
- * A button, which when clicked, resets the form.
- */
-abstract class ResetButtonInputElement implements InputElementBase {
-  factory ResetButtonInputElement() => new InputElement(type: 'reset');
-}
-
-/**
- * A button, with no default behavior.
- */
-abstract class ButtonInputElement implements InputElementBase {
-  factory ButtonInputElement() => new InputElement(type: 'button');
-}
-// Copyright (c) 2012, 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.
-
-@Native("InstallEvent")
-class InstallEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory InstallEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory InstallEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return InstallEvent._create_1(type, eventInitDict_1);
-    }
-    return InstallEvent._create_2(type);
-  }
-  static InstallEvent _create_1(type, eventInitDict) =>
-      JS('InstallEvent', 'new InstallEvent(#,#)', type, eventInitDict);
-  static InstallEvent _create_2(type) =>
-      JS('InstallEvent', 'new InstallEvent(#)', type);
-
-  void registerForeignFetch(Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    _registerForeignFetch_1(options_1);
-    return;
-  }
-
-  @JSName('registerForeignFetch')
-  void _registerForeignFetch_1(options) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("IntersectionObserver")
-class IntersectionObserver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory IntersectionObserver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory IntersectionObserver(IntersectionObserverCallback callback,
-      [Map? options]) {
-    if (options != null) {
-      var callback_1 = convertDartClosureToJS(callback, 2);
-      var options_2 = convertDartToNative_Dictionary(options);
-      return IntersectionObserver._create_1(callback_1, options_2);
-    }
-    var callback_1 = convertDartClosureToJS(callback, 2);
-    return IntersectionObserver._create_2(callback_1);
-  }
-  static IntersectionObserver _create_1(callback, options) => JS(
-      'IntersectionObserver',
-      'new IntersectionObserver(#,#)',
-      callback,
-      options);
-  static IntersectionObserver _create_2(callback) =>
-      JS('IntersectionObserver', 'new IntersectionObserver(#)', callback);
-
-  Element? get root native;
-
-  String get rootMargin native;
-
-  List<num> get thresholds native;
-
-  void disconnect() native;
-
-  void observe(Element target) native;
-
-  List<IntersectionObserverEntry> takeRecords() native;
-
-  void unobserve(Element target) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void IntersectionObserverCallback(
-    List entries, IntersectionObserver observer);
-// Copyright (c) 2012, 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.
-
-@Native("IntersectionObserverEntry")
-class IntersectionObserverEntry extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory IntersectionObserverEntry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  DomRectReadOnly get boundingClientRect native;
-
-  num get intersectionRatio native;
-
-  DomRectReadOnly get intersectionRect native;
-
-  bool get isIntersecting native;
-
-  DomRectReadOnly? get rootBounds native;
-
-  Element get target native;
-
-  num get time native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("InterventionReport")
-class InterventionReport extends ReportBody {
-  // To suppress missing implicit constructor warnings.
-  factory InterventionReport._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get lineNumber native;
-
-  String get message native;
-
-  String get sourceFile native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * An event that describes user interaction with the keyboard.
- *
- * The [type] of the event identifies what kind of interaction occurred.
- *
- * See also:
- *
- * * [KeyboardEvent](https://developer.mozilla.org/en/DOM/KeyboardEvent) at MDN.
- */
-@Native("KeyboardEvent")
-class KeyboardEvent extends UIEvent {
-  /**
-   * Programmatically create a KeyboardEvent.
-   *
-   * Due to browser differences, keyCode, charCode, or keyIdentifier values
-   * cannot be specified in this base level constructor. This constructor
-   * enables the user to programmatically create and dispatch a [KeyboardEvent],
-   * but it will not contain any particular key content. For programmatically
-   * creating keyboard events with specific key value contents, see the custom
-   * Event [KeyEvent].
-   */
-  factory KeyboardEvent(String type,
-      {Window? view,
-      bool canBubble: true,
-      bool cancelable: true,
-      int? location,
-      int? keyLocation, // Legacy alias for location
-      bool ctrlKey: false,
-      bool altKey: false,
-      bool shiftKey: false,
-      bool metaKey: false}) {
-    if (view == null) {
-      view = window;
-    }
-    location ??= keyLocation ?? 1;
-    KeyboardEvent e = document._createEvent("KeyboardEvent") as KeyboardEvent;
-    e._initKeyboardEvent(type, canBubble, cancelable, view, "", location,
-        ctrlKey, altKey, shiftKey, metaKey);
-    return e;
-  }
-
-  void _initKeyboardEvent(
-      String type,
-      bool canBubble,
-      bool cancelable,
-      Window? view,
-      String keyIdentifier,
-      int? location,
-      bool ctrlKey,
-      bool altKey,
-      bool shiftKey,
-      bool metaKey) {
-    if (JS('bool', 'typeof(#.initKeyEvent) == "function"', this)) {
-      // initKeyEvent is only in Firefox (instead of initKeyboardEvent). It has
-      // a slightly different signature, and allows you to specify keyCode and
-      // charCode as the last two arguments, but we just set them as the default
-      // since they can't be specified in other browsers.
-      JS('void', '#.initKeyEvent(#, #, #, #, #, #, #, #, 0, 0)', this, type,
-          canBubble, cancelable, view, ctrlKey, altKey, shiftKey, metaKey);
-    } else {
-      // initKeyboardEvent is for all other browsers.
-      JS(
-          'void',
-          '#.initKeyboardEvent(#, #, #, #, #, #, #, #, #, #)',
-          this,
-          type,
-          canBubble,
-          cancelable,
-          view,
-          keyIdentifier,
-          location,
-          ctrlKey,
-          altKey,
-          shiftKey,
-          metaKey);
-    }
-  }
-
-  int get keyCode native;
-
-  int get charCode native;
-
-  int get which => _which;
-
-  factory KeyboardEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return KeyboardEvent._create_1(type, eventInitDict_1);
-    }
-    return KeyboardEvent._create_2(type);
-  }
-  static KeyboardEvent _create_1(type, eventInitDict) =>
-      JS('KeyboardEvent', 'new KeyboardEvent(#,#)', type, eventInitDict);
-  static KeyboardEvent _create_2(type) =>
-      JS('KeyboardEvent', 'new KeyboardEvent(#)', type);
-
-  static const int DOM_KEY_LOCATION_LEFT = 0x01;
-
-  static const int DOM_KEY_LOCATION_NUMPAD = 0x03;
-
-  static const int DOM_KEY_LOCATION_RIGHT = 0x02;
-
-  static const int DOM_KEY_LOCATION_STANDARD = 0x00;
-
-  bool get altKey native;
-
-  @JSName('charCode')
-  int get _charCode native;
-
-  String get code native;
-
-  bool get ctrlKey native;
-
-  bool get isComposing native;
-
-  String get key native;
-
-  @JSName('keyCode')
-  int get _keyCode native;
-
-  int get location native;
-
-  bool get metaKey native;
-
-  bool get repeat native;
-
-  bool get shiftKey native;
-
-  bool getModifierState(String keyArg) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("KeyframeEffect")
-class KeyframeEffect extends KeyframeEffectReadOnly {
-  // To suppress missing implicit constructor warnings.
-  factory KeyframeEffect._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory KeyframeEffect(Element? target, Object? effect, [Object? options]) {
-    if (options != null) {
-      return KeyframeEffect._create_1(target, effect, options);
-    }
-    return KeyframeEffect._create_2(target, effect);
-  }
-  static KeyframeEffect _create_1(target, effect, options) => JS(
-      'KeyframeEffect', 'new KeyframeEffect(#,#,#)', target, effect, options);
-  static KeyframeEffect _create_2(target, effect) =>
-      JS('KeyframeEffect', 'new KeyframeEffect(#,#)', target, effect);
-}
-// Copyright (c) 2012, 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.
-
-@Native("KeyframeEffectReadOnly")
-class KeyframeEffectReadOnly extends AnimationEffectReadOnly {
-  // To suppress missing implicit constructor warnings.
-  factory KeyframeEffectReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory KeyframeEffectReadOnly(Element? target, Object? effect,
-      [Object? options]) {
-    if (options != null) {
-      return KeyframeEffectReadOnly._create_1(target, effect, options);
-    }
-    return KeyframeEffectReadOnly._create_2(target, effect);
-  }
-  static KeyframeEffectReadOnly _create_1(target, effect, options) => JS(
-      'KeyframeEffectReadOnly',
-      'new KeyframeEffectReadOnly(#,#,#)',
-      target,
-      effect,
-      options);
-  static KeyframeEffectReadOnly _create_2(target, effect) => JS(
-      'KeyframeEffectReadOnly',
-      'new KeyframeEffectReadOnly(#,#)',
-      target,
-      effect);
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLLIElement")
-class LIElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory LIElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LIElement() => JS<LIElement>(
-      'returns:LIElement;creates:LIElement;new:true',
-      '#.createElement(#)',
-      document,
-      "li");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  LIElement.created() : super.created();
-
-  int get value native;
-
-  set value(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLLabelElement")
-class LabelElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory LabelElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LabelElement() => JS<LabelElement>(
-      'returns:LabelElement;creates:LabelElement;new:true',
-      '#.createElement(#)',
-      document,
-      "label");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  LabelElement.created() : super.created();
-
-  HtmlElement? get control native;
-
-  FormElement? get form native;
-
-  String get htmlFor native;
-
-  set htmlFor(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLLegendElement")
-class LegendElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory LegendElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LegendElement() => JS<LegendElement>(
-      'returns:LegendElement;creates:LegendElement;new:true',
-      '#.createElement(#)',
-      document,
-      "legend");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  LegendElement.created() : super.created();
-
-  FormElement? get form native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("LinearAccelerationSensor")
-class LinearAccelerationSensor extends Accelerometer {
-  // To suppress missing implicit constructor warnings.
-  factory LinearAccelerationSensor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LinearAccelerationSensor([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return LinearAccelerationSensor._create_1(sensorOptions_1);
-    }
-    return LinearAccelerationSensor._create_2();
-  }
-  static LinearAccelerationSensor _create_1(sensorOptions) => JS(
-      'LinearAccelerationSensor',
-      'new LinearAccelerationSensor(#)',
-      sensorOptions);
-  static LinearAccelerationSensor _create_2() =>
-      JS('LinearAccelerationSensor', 'new LinearAccelerationSensor()');
-}
-// Copyright (c) 2014, 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.
-
-@Native("HTMLLinkElement")
-class LinkElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory LinkElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LinkElement() => JS<LinkElement>(
-      'returns:LinkElement;creates:LinkElement;new:true',
-      '#.createElement(#)',
-      document,
-      "link");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  LinkElement.created() : super.created();
-
-  String get as native;
-
-  set as(String value) native;
-
-  String? get crossOrigin native;
-
-  set crossOrigin(String? value) native;
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get hreflang native;
-
-  set hreflang(String value) native;
-
-  Document? get import native;
-
-  String get integrity native;
-
-  set integrity(String value) native;
-
-  String get media native;
-
-  set media(String value) native;
-
-  String get referrerPolicy native;
-
-  set referrerPolicy(String value) native;
-
-  String get rel native;
-
-  set rel(String value) native;
-
-  DomTokenList get relList native;
-
-  String get scope native;
-
-  set scope(String value) native;
-
-  StyleSheet? get sheet native;
-
-  DomTokenList get sizes native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  /// Checks if HTML imports are supported on the current platform.
-  bool get supportsImport {
-    return JS('bool', '("import" in #)', this);
-  }
-}
-// Copyright (c) 2013, 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.
-
-@Native("Location")
-class Location extends Interceptor implements LocationBase {
-  // To suppress missing implicit constructor warnings.
-  factory Location._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @Returns('DomStringList')
-  @Creates('DomStringList')
-  List<String> get ancestorOrigins native;
-
-  String get hash native;
-
-  set hash(String value) native;
-
-  String get host native;
-
-  set host(String value) native;
-
-  String get hostname native;
-
-  set hostname(String value) native;
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get pathname native;
-
-  set pathname(String value) native;
-
-  String get port native;
-
-  set port(String value) native;
-
-  String get protocol native;
-
-  set protocol(String value) native;
-
-  String get search native;
-
-  set search(String value) native;
-
-  TrustedUrl get trustedHref native;
-
-  set trustedHref(TrustedUrl value) native;
-
-  void assign([String? url]) native;
-
-  void reload() native;
-
-  void replace(String? url) native;
-
-  String get origin {
-    if (JS('bool', '("origin" in #)', this)) {
-      return JS('String', '#.origin', this);
-    }
-    return '${this.protocol}//${this.host}';
-  }
-
-  String toString() => JS('String', 'String(#)', this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("Magnetometer")
-class Magnetometer extends Sensor {
-  // To suppress missing implicit constructor warnings.
-  factory Magnetometer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Magnetometer([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return Magnetometer._create_1(sensorOptions_1);
-    }
-    return Magnetometer._create_2();
-  }
-  static Magnetometer _create_1(sensorOptions) =>
-      JS('Magnetometer', 'new Magnetometer(#)', sensorOptions);
-  static Magnetometer _create_2() => JS('Magnetometer', 'new Magnetometer()');
-
-  num? get x native;
-
-  num? get y native;
-
-  num? get z native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLMapElement")
-class MapElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory MapElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MapElement() => JS<MapElement>(
-      'returns:MapElement;creates:MapElement;new:true',
-      '#.createElement(#)',
-      document,
-      "map");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MapElement.created() : super.created();
-
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get areas native;
-
-  String get name native;
-
-  set name(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaCapabilities")
-class MediaCapabilities extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaCapabilities._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<MediaCapabilitiesInfo> decodingInfo(Map configuration) {
-    var configuration_dict = convertDartToNative_Dictionary(configuration);
-    return promiseToFuture<MediaCapabilitiesInfo>(
-        JS("", "#.decodingInfo(#)", this, configuration_dict));
-  }
-
-  Future<MediaCapabilitiesInfo> encodingInfo(Map configuration) {
-    var configuration_dict = convertDartToNative_Dictionary(configuration);
-    return promiseToFuture<MediaCapabilitiesInfo>(
-        JS("", "#.encodingInfo(#)", this, configuration_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaCapabilitiesInfo")
-class MediaCapabilitiesInfo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaCapabilitiesInfo._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get powerEfficient native;
-
-  bool get smooth native;
-
-  bool get supported native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaDeviceInfo")
-class MediaDeviceInfo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaDeviceInfo._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get deviceId native;
-
-  String get groupId native;
-
-  String get kind native;
-
-  String get label native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaDevices")
-class MediaDevices extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaDevices._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<List<dynamic>> enumerateDevices() =>
-      promiseToFuture<List<dynamic>>(JS("", "#.enumerateDevices()", this));
-
-  Map getSupportedConstraints() {
-    return convertNativeToDart_Dictionary(_getSupportedConstraints_1())!;
-  }
-
-  @JSName('getSupportedConstraints')
-  _getSupportedConstraints_1() native;
-
-  Future<MediaStream> getUserMedia([Map? constraints]) {
-    var constraints_dict = null;
-    if (constraints != null) {
-      constraints_dict = convertDartToNative_Dictionary(constraints);
-    }
-    return promiseToFuture<MediaStream>(
-        JS("", "#.getUserMedia(#)", this, constraints_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("HTMLMediaElement")
-class MediaElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory MediaElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MediaElement.created() : super.created();
-
-  static const int HAVE_CURRENT_DATA = 2;
-
-  static const int HAVE_ENOUGH_DATA = 4;
-
-  static const int HAVE_FUTURE_DATA = 3;
-
-  static const int HAVE_METADATA = 1;
-
-  static const int HAVE_NOTHING = 0;
-
-  static const int NETWORK_EMPTY = 0;
-
-  static const int NETWORK_IDLE = 1;
-
-  static const int NETWORK_LOADING = 2;
-
-  static const int NETWORK_NO_SOURCE = 3;
-
-  AudioTrackList get audioTracks native;
-
-  bool get autoplay native;
-
-  set autoplay(bool value) native;
-
-  TimeRanges get buffered native;
-
-  bool get controls native;
-
-  set controls(bool value) native;
-
-  DomTokenList get controlsList native;
-
-  String? get crossOrigin native;
-
-  set crossOrigin(String? value) native;
-
-  String get currentSrc native;
-
-  num get currentTime native;
-
-  set currentTime(num value) native;
-
-  bool get defaultMuted native;
-
-  set defaultMuted(bool value) native;
-
-  num get defaultPlaybackRate native;
-
-  set defaultPlaybackRate(num value) native;
-
-  bool get disableRemotePlayback native;
-
-  set disableRemotePlayback(bool value) native;
-
-  num get duration native;
-
-  bool get ended native;
-
-  MediaError? get error native;
-
-  bool get loop native;
-
-  set loop(bool value) native;
-
-  MediaKeys get mediaKeys native;
-
-  bool get muted native;
-
-  set muted(bool value) native;
-
-  int get networkState native;
-
-  bool get paused native;
-
-  num get playbackRate native;
-
-  set playbackRate(num value) native;
-
-  TimeRanges get played native;
-
-  String get preload native;
-
-  set preload(String value) native;
-
-  int get readyState native;
-
-  RemotePlayback get remote native;
-
-  TimeRanges get seekable native;
-
-  bool get seeking native;
-
-  String get sinkId native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  MediaStream get srcObject native;
-
-  set srcObject(MediaStream value) native;
-
-  TextTrackList get textTracks native;
-
-  VideoTrackList get videoTracks native;
-
-  num get volume native;
-
-  set volume(num value) native;
-
-  @JSName('webkitAudioDecodedByteCount')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  int get audioDecodedByteCount native;
-
-  @JSName('webkitVideoDecodedByteCount')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  int get videoDecodedByteCount native;
-
-  TextTrack addTextTrack(String kind, [String? label, String? language]) native;
-
-  @Unstable()
-  String canPlayType(String? type, [String? keySystem]) native;
-
-  MediaStream captureStream() native;
-
-  void load() native;
-
-  void pause() native;
-
-  Future play() => promiseToFuture(JS("", "#.play()", this));
-
-  Future setMediaKeys(MediaKeys? mediaKeys) =>
-      promiseToFuture(JS("", "#.setMediaKeys(#)", this, mediaKeys));
-
-  Future setSinkId(String sinkId) =>
-      promiseToFuture(JS("", "#.setSinkId(#)", this, sinkId));
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaEncryptedEvent")
-class MediaEncryptedEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MediaEncryptedEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaEncryptedEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MediaEncryptedEvent._create_1(type, eventInitDict_1);
-    }
-    return MediaEncryptedEvent._create_2(type);
-  }
-  static MediaEncryptedEvent _create_1(type, eventInitDict) => JS(
-      'MediaEncryptedEvent',
-      'new MediaEncryptedEvent(#,#)',
-      type,
-      eventInitDict);
-  static MediaEncryptedEvent _create_2(type) =>
-      JS('MediaEncryptedEvent', 'new MediaEncryptedEvent(#)', type);
-
-  ByteBuffer? get initData native;
-
-  String get initDataType native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("MediaError")
-class MediaError extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int MEDIA_ERR_ABORTED = 1;
-
-  static const int MEDIA_ERR_DECODE = 3;
-
-  static const int MEDIA_ERR_NETWORK = 2;
-
-  static const int MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
-
-  int get code native;
-
-  String get message native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaKeyMessageEvent")
-class MediaKeyMessageEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MediaKeyMessageEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaKeyMessageEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return MediaKeyMessageEvent._create_1(type, eventInitDict_1);
-  }
-  static MediaKeyMessageEvent _create_1(type, eventInitDict) => JS(
-      'MediaKeyMessageEvent',
-      'new MediaKeyMessageEvent(#,#)',
-      type,
-      eventInitDict);
-
-  ByteBuffer get message native;
-
-  String get messageType native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaKeySession")
-class MediaKeySession extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaKeySession._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  Future<void> get closed => promiseToFuture<void>(JS("", "#.closed", this));
-
-  num get expiration native;
-
-  MediaKeyStatusMap get keyStatuses native;
-
-  String get sessionId native;
-
-  Future close() => promiseToFuture(JS("", "#.close()", this));
-
-  Future generateRequest(String initDataType, /*BufferSource*/ initData) =>
-      promiseToFuture(
-          JS("", "#.generateRequest(#, #)", this, initDataType, initData));
-
-  Future load(String sessionId) =>
-      promiseToFuture(JS("", "#.load(#)", this, sessionId));
-
-  Future remove() => promiseToFuture(JS("", "#.remove()", this));
-
-  @JSName('update')
-  Future _update(/*BufferSource*/ response) native;
-
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaKeyStatusMap")
-class MediaKeyStatusMap extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaKeyStatusMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get size native;
-
-  Object? get(/*BufferSource*/ keyId) native;
-
-  bool has(/*BufferSource*/ keyId) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaKeySystemAccess")
-class MediaKeySystemAccess extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaKeySystemAccess._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get keySystem native;
-
-  Future createMediaKeys() =>
-      promiseToFuture(JS("", "#.createMediaKeys()", this));
-
-  Map getConfiguration() {
-    return convertNativeToDart_Dictionary(_getConfiguration_1())!;
-  }
-
-  @JSName('getConfiguration')
-  _getConfiguration_1() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaKeys")
-class MediaKeys extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaKeys._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('createSession')
-  MediaKeySession _createSession([String? sessionType]) native;
-
-  Future getStatusForPolicy(MediaKeysPolicy policy) =>
-      promiseToFuture(JS("", "#.getStatusForPolicy(#)", this, policy));
-
-  Future setServerCertificate(/*BufferSource*/ serverCertificate) =>
-      promiseToFuture(
-          JS("", "#.setServerCertificate(#)", this, serverCertificate));
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaKeysPolicy")
-class MediaKeysPolicy extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaKeysPolicy._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaKeysPolicy(Map init) {
-    var init_1 = convertDartToNative_Dictionary(init);
-    return MediaKeysPolicy._create_1(init_1);
-  }
-  static MediaKeysPolicy _create_1(init) =>
-      JS('MediaKeysPolicy', 'new MediaKeysPolicy(#)', init);
-
-  String get minHdcpVersion native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("MediaList")
-class MediaList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  String? get mediaText native;
-
-  set mediaText(String? value) native;
-
-  void appendMedium(String medium) native;
-
-  void deleteMedium(String medium) native;
-
-  String? item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaMetadata")
-class MediaMetadata extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaMetadata._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaMetadata([Map? metadata]) {
-    if (metadata != null) {
-      var metadata_1 = convertDartToNative_Dictionary(metadata);
-      return MediaMetadata._create_1(metadata_1);
-    }
-    return MediaMetadata._create_2();
-  }
-  static MediaMetadata _create_1(metadata) =>
-      JS('MediaMetadata', 'new MediaMetadata(#)', metadata);
-  static MediaMetadata _create_2() =>
-      JS('MediaMetadata', 'new MediaMetadata()');
-
-  String get album native;
-
-  set album(String value) native;
-
-  String get artist native;
-
-  set artist(String value) native;
-
-  List get artwork native;
-
-  set artwork(List value) native;
-
-  String get title native;
-
-  set title(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("MediaQueryList")
-class MediaQueryList extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaQueryList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  bool get matches native;
-
-  String get media native;
-
-  void addListener(EventListener? listener) native;
-
-  void removeListener(EventListener? listener) native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaQueryListEvent")
-class MediaQueryListEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MediaQueryListEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaQueryListEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MediaQueryListEvent._create_1(type, eventInitDict_1);
-    }
-    return MediaQueryListEvent._create_2(type);
-  }
-  static MediaQueryListEvent _create_1(type, eventInitDict) => JS(
-      'MediaQueryListEvent',
-      'new MediaQueryListEvent(#,#)',
-      type,
-      eventInitDict);
-  static MediaQueryListEvent _create_2(type) =>
-      JS('MediaQueryListEvent', 'new MediaQueryListEvent(#)', type);
-
-  bool get matches native;
-
-  String get media native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaRecorder")
-class MediaRecorder extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaRecorder._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  static const EventStreamProvider<Event> pauseEvent =
-      const EventStreamProvider<Event>('pause');
-
-  factory MediaRecorder(MediaStream stream, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return MediaRecorder._create_1(stream, options_1);
-    }
-    return MediaRecorder._create_2(stream);
-  }
-  static MediaRecorder _create_1(stream, options) =>
-      JS('MediaRecorder', 'new MediaRecorder(#,#)', stream, options);
-  static MediaRecorder _create_2(stream) =>
-      JS('MediaRecorder', 'new MediaRecorder(#)', stream);
-
-  int get audioBitsPerSecond native;
-
-  String get mimeType native;
-
-  String get state native;
-
-  MediaStream get stream native;
-
-  int get videoBitsPerSecond native;
-
-  static bool isTypeSupported(String type) native;
-
-  void pause() native;
-
-  void requestData() native;
-
-  void resume() native;
-
-  void start([int? timeslice]) native;
-
-  void stop() native;
-
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  Stream<Event> get onPause => pauseEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaSession")
-class MediaSession extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaSession._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  MediaMetadata? get metadata native;
-
-  set metadata(MediaMetadata? value) native;
-
-  String get playbackState native;
-
-  set playbackState(String value) native;
-
-  void setActionHandler(String action, MediaSessionActionHandler? handler)
-      native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void MediaSessionActionHandler();
-// Copyright (c) 2012, 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.
-
-@Native("MediaSettingsRange")
-class MediaSettingsRange extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MediaSettingsRange._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get max native;
-
-  num get min native;
-
-  num get step native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE, '11')
-@Native("MediaSource")
-class MediaSource extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaSource._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaSource() {
-    return MediaSource._create_1();
-  }
-  static MediaSource _create_1() => JS('MediaSource', 'new MediaSource()');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.MediaSource)');
-
-  SourceBufferList get activeSourceBuffers native;
-
-  num get duration native;
-
-  set duration(num value) native;
-
-  String get readyState native;
-
-  SourceBufferList get sourceBuffers native;
-
-  SourceBuffer addSourceBuffer(String type) native;
-
-  void clearLiveSeekableRange() native;
-
-  void endOfStream([String? error]) native;
-
-  static bool isTypeSupported(String type) native;
-
-  void removeSourceBuffer(SourceBuffer buffer) native;
-
-  void setLiveSeekableRange(num start, num end) native;
-}
-// Copyright (c) 2013, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("MediaStream")
-class MediaStream extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaStream._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `addtrack` events to event
-   * handlers that are not necessarily instances of [MediaStream].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> addTrackEvent =
-      const EventStreamProvider<Event>('addtrack');
-
-  /**
-   * Static factory designed to expose `removetrack` events to event
-   * handlers that are not necessarily instances of [MediaStream].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> removeTrackEvent =
-      const EventStreamProvider<Event>('removetrack');
-
-  factory MediaStream([stream_OR_tracks]) {
-    if (stream_OR_tracks == null) {
-      return MediaStream._create_1();
-    }
-    if ((stream_OR_tracks is MediaStream)) {
-      return MediaStream._create_2(stream_OR_tracks);
-    }
-    if ((stream_OR_tracks is List<MediaStreamTrack>)) {
-      return MediaStream._create_3(stream_OR_tracks);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static MediaStream _create_1() => JS('MediaStream', 'new MediaStream()');
-  static MediaStream _create_2(stream_OR_tracks) =>
-      JS('MediaStream', 'new MediaStream(#)', stream_OR_tracks);
-  static MediaStream _create_3(stream_OR_tracks) =>
-      JS('MediaStream', 'new MediaStream(#)', stream_OR_tracks);
-
-  bool get active native;
-
-  String get id native;
-
-  void addTrack(MediaStreamTrack track) native;
-
-  MediaStream clone() native;
-
-  @Creates('JSExtendableArray|MediaStreamTrack')
-  @Returns('JSExtendableArray')
-  List<MediaStreamTrack> getAudioTracks() native;
-
-  MediaStreamTrack? getTrackById(String trackId) native;
-
-  List<MediaStreamTrack> getTracks() native;
-
-  @Creates('JSExtendableArray|MediaStreamTrack')
-  @Returns('JSExtendableArray')
-  List<MediaStreamTrack> getVideoTracks() native;
-
-  void removeTrack(MediaStreamTrack track) native;
-
-  /// Stream of `addtrack` events handled by this [MediaStream].
-  Stream<Event> get onAddTrack => addTrackEvent.forTarget(this);
-
-  /// Stream of `removetrack` events handled by this [MediaStream].
-  Stream<Event> get onRemoveTrack => removeTrackEvent.forTarget(this);
-
-  /**
-   * Checks if the MediaStream APIs are supported on the current platform.
-   *
-   * See also:
-   *
-   * * [Navigator.getUserMedia]
-   */
-  static bool get supported => JS(
-      'bool',
-      '''!!(#.getUserMedia || #.webkitGetUserMedia ||
-        #.mozGetUserMedia || #.msGetUserMedia)''',
-      window.navigator,
-      window.navigator,
-      window.navigator,
-      window.navigator);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("MediaStreamEvent")
-class MediaStreamEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MediaStreamEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaStreamEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MediaStreamEvent._create_1(type, eventInitDict_1);
-    }
-    return MediaStreamEvent._create_2(type);
-  }
-  static MediaStreamEvent _create_1(type, eventInitDict) =>
-      JS('MediaStreamEvent', 'new MediaStreamEvent(#,#)', type, eventInitDict);
-  static MediaStreamEvent _create_2(type) =>
-      JS('MediaStreamEvent', 'new MediaStreamEvent(#)', type);
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Device.isEventTypeSupported('MediaStreamEvent');
-
-  MediaStream? get stream native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("MediaStreamTrack")
-class MediaStreamTrack extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MediaStreamTrack._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `ended` events to event
-   * handlers that are not necessarily instances of [MediaStreamTrack].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> endedEvent =
-      const EventStreamProvider<Event>('ended');
-
-  /**
-   * Static factory designed to expose `mute` events to event
-   * handlers that are not necessarily instances of [MediaStreamTrack].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> muteEvent =
-      const EventStreamProvider<Event>('mute');
-
-  /**
-   * Static factory designed to expose `unmute` events to event
-   * handlers that are not necessarily instances of [MediaStreamTrack].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> unmuteEvent =
-      const EventStreamProvider<Event>('unmute');
-
-  String get contentHint native;
-
-  set contentHint(String value) native;
-
-  bool get enabled native;
-
-  set enabled(bool value) native;
-
-  String get id native;
-
-  String get kind native;
-
-  String get label native;
-
-  bool get muted native;
-
-  String get readyState native;
-
-  Future applyConstraints([Map? constraints]) {
-    var constraints_dict = null;
-    if (constraints != null) {
-      constraints_dict = convertDartToNative_Dictionary(constraints);
-    }
-    return promiseToFuture(
-        JS("", "#.applyConstraints(#)", this, constraints_dict));
-  }
-
-  MediaStreamTrack clone() native;
-
-  Map getCapabilities() {
-    return convertNativeToDart_Dictionary(_getCapabilities_1())!;
-  }
-
-  @JSName('getCapabilities')
-  _getCapabilities_1() native;
-
-  Map getConstraints() {
-    return convertNativeToDart_Dictionary(_getConstraints_1())!;
-  }
-
-  @JSName('getConstraints')
-  _getConstraints_1() native;
-
-  Map getSettings() {
-    return convertNativeToDart_Dictionary(_getSettings_1())!;
-  }
-
-  @JSName('getSettings')
-  _getSettings_1() native;
-
-  void stop() native;
-
-  /// Stream of `ended` events handled by this [MediaStreamTrack].
-  Stream<Event> get onEnded => endedEvent.forTarget(this);
-
-  /// Stream of `mute` events handled by this [MediaStreamTrack].
-  Stream<Event> get onMute => muteEvent.forTarget(this);
-
-  /// Stream of `unmute` events handled by this [MediaStreamTrack].
-  Stream<Event> get onUnmute => unmuteEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("MediaStreamTrackEvent")
-class MediaStreamTrackEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MediaStreamTrackEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaStreamTrackEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return MediaStreamTrackEvent._create_1(type, eventInitDict_1);
-  }
-  static MediaStreamTrackEvent _create_1(type, eventInitDict) => JS(
-      'MediaStreamTrackEvent',
-      'new MediaStreamTrackEvent(#,#)',
-      type,
-      eventInitDict);
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      Device.isEventTypeSupported('MediaStreamTrackEvent');
-
-  MediaStreamTrack get track native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MemoryInfo")
-class MemoryInfo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MemoryInfo._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get jsHeapSizeLimit native;
-
-  int get totalJSHeapSize native;
-
-  int get usedJSHeapSize native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * An HTML <menu> element.
- *
- * A <menu> element represents an unordered list of menu commands.
- *
- * See also:
- *
- *  * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
- *  * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
- */
-@Native("HTMLMenuElement")
-class MenuElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory MenuElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MenuElement() => JS<MenuElement>(
-      'returns:MenuElement;creates:MenuElement;new:true',
-      '#.createElement(#)',
-      document,
-      "menu");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MenuElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void MessageCallback(Map message);
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("MessageChannel")
-class MessageChannel extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MessageChannel._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MessageChannel() {
-    return MessageChannel._create_1();
-  }
-  static MessageChannel _create_1() =>
-      JS('MessageChannel', 'new MessageChannel()');
-
-  MessagePort get port1 native;
-
-  MessagePort get port2 native;
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("MessageEvent")
-class MessageEvent extends Event {
-  factory MessageEvent(String type,
-      {bool canBubble: false,
-      bool cancelable: false,
-      Object? data,
-      String? origin,
-      String? lastEventId,
-      Window? source,
-      List<MessagePort> messagePorts: const []}) {
-    if (source == null) {
-      source = window;
-    }
-    if (!Device.isIE) {
-      // TODO: This if check should be removed once IE
-      // implements the constructor.
-      return JS(
-          'MessageEvent',
-          'new MessageEvent(#, {bubbles: #, cancelable: #, data: #, origin: #, lastEventId: #, source: #, ports: #})',
-          type,
-          canBubble,
-          cancelable,
-          data,
-          origin,
-          lastEventId,
-          source,
-          messagePorts);
-    }
-    MessageEvent event = document._createEvent("MessageEvent") as MessageEvent;
-    event._initMessageEvent(type, canBubble, cancelable, data, origin,
-        lastEventId, source, messagePorts);
-    return event;
-  }
-
-  // TODO(alanknight): This really should be generated by the
-  // _OutputConversion in the systemnative.py script, but that doesn't
-  // use those conversions right now, so do this as a one-off.
-  dynamic get data => convertNativeToDart_SerializedScriptValue(this._get_data);
-
-  @JSName('data')
-  @annotation_Creates_SerializedScriptValue
-  @annotation_Returns_SerializedScriptValue
-  dynamic get _get_data native;
-
-  factory MessageEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MessageEvent._create_1(type, eventInitDict_1);
-    }
-    return MessageEvent._create_2(type);
-  }
-  static MessageEvent _create_1(type, eventInitDict) =>
-      JS('MessageEvent', 'new MessageEvent(#,#)', type, eventInitDict);
-  static MessageEvent _create_2(type) =>
-      JS('MessageEvent', 'new MessageEvent(#)', type);
-
-  @Unstable()
-  String get lastEventId native;
-
-  String get origin native;
-
-  @Unstable()
-  @Creates('JSExtendableArray')
-  List<MessagePort> get ports native;
-
-  EventTarget? get source => _convertNativeToDart_EventTarget(this._get_source);
-  @JSName('source')
-  @Creates('Null')
-  @Returns('EventTarget|=Object')
-  dynamic get _get_source native;
-
-  String get suborigin native;
-
-  void _initMessageEvent(
-      String? typeArg,
-      bool? canBubbleArg,
-      bool? cancelableArg,
-      Object? dataArg,
-      String? originArg,
-      String? lastEventIdArg,
-      EventTarget? sourceArg,
-      List<MessagePort>? portsArg) {
-    var sourceArg_1 = _convertDartToNative_EventTarget(sourceArg);
-    _initMessageEvent_1(typeArg, canBubbleArg, cancelableArg, dataArg,
-        originArg, lastEventIdArg, sourceArg_1, portsArg);
-    return;
-  }
-
-  @JSName('initMessageEvent')
-  void _initMessageEvent_1(typeArg, canBubbleArg, cancelableArg, dataArg,
-      originArg, lastEventIdArg, sourceArg, List<MessagePort>? portsArg) native;
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Unstable()
-@Native("MessagePort")
-class MessagePort extends EventTarget {
-  void addEventListener(String type, EventListener? listener,
-      [bool? useCapture]) {
-    // Messages posted to ports are initially paused, allowing listeners to be
-    // setup, start() needs to be explicitly invoked to begin handling messages.
-    if (type == 'message') {
-      _start();
-    }
-
-    super.addEventListener(type, listener, useCapture);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory MessagePort._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [MessagePort].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  void close() native;
-
-  void postMessage(/*any*/ message, [List<Object>? transfer]) {
-    if (transfer != null) {
-      var message_1 = convertDartToNative_SerializedScriptValue(message);
-      _postMessage_1(message_1, transfer);
-      return;
-    }
-    var message_1 = convertDartToNative_SerializedScriptValue(message);
-    _postMessage_2(message_1);
-    return;
-  }
-
-  @JSName('postMessage')
-  void _postMessage_1(message, List<Object> transfer) native;
-  @JSName('postMessage')
-  void _postMessage_2(message) native;
-
-  @JSName('start')
-  void _start() native;
-
-  /// Stream of `message` events handled by this [MessagePort].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("HTMLMetaElement")
-class MetaElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory MetaElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MetaElement() => JS<MetaElement>(
-      'returns:MetaElement;creates:MetaElement;new:true',
-      '#.createElement(#)',
-      document,
-      "meta");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MetaElement.created() : super.created();
-
-  String get content native;
-
-  set content(String value) native;
-
-  String get httpEquiv native;
-
-  set httpEquiv(String value) native;
-
-  String get name native;
-
-  set name(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Metadata")
-class Metadata extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Metadata._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  DateTime get modificationTime =>
-      convertNativeToDart_DateTime(this._get_modificationTime);
-  @JSName('modificationTime')
-  @Creates('Null')
-  dynamic get _get_modificationTime native;
-
-  int get size native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void MetadataCallback(Metadata metadata);
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("HTMLMeterElement")
-class MeterElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory MeterElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MeterElement() => document.createElement("meter") as MeterElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MeterElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('meter');
-
-  num get high native;
-
-  set high(num value) native;
-
-  @Unstable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  num get low native;
-
-  set low(num value) native;
-
-  num get max native;
-
-  set max(num value) native;
-
-  num get min native;
-
-  set min(num value) native;
-
-  num get optimum native;
-
-  set optimum(num value) native;
-
-  num get value native;
-
-  set value(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIAccess")
-class MidiAccess extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MidiAccess._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  MidiInputMap get inputs native;
-
-  MidiOutputMap get outputs native;
-
-  bool get sysexEnabled native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIConnectionEvent")
-class MidiConnectionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MidiConnectionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MidiConnectionEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MidiConnectionEvent._create_1(type, eventInitDict_1);
-    }
-    return MidiConnectionEvent._create_2(type);
-  }
-  static MidiConnectionEvent _create_1(type, eventInitDict) => JS(
-      'MidiConnectionEvent',
-      'new MIDIConnectionEvent(#,#)',
-      type,
-      eventInitDict);
-  static MidiConnectionEvent _create_2(type) =>
-      JS('MidiConnectionEvent', 'new MIDIConnectionEvent(#)', type);
-
-  MidiPort get port native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIInput")
-class MidiInput extends MidiPort {
-  // To suppress missing implicit constructor warnings.
-  factory MidiInput._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `midimessage` events to event
-   * handlers that are not necessarily instances of [MidiInput].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MidiMessageEvent> midiMessageEvent =
-      const EventStreamProvider<MidiMessageEvent>('midimessage');
-
-  /// Stream of `midimessage` events handled by this [MidiInput].
-  Stream<MidiMessageEvent> get onMidiMessage =>
-      midiMessageEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIInputMap")
-class MidiInputMap extends Interceptor with MapMixin<String, dynamic> {
-  // To suppress missing implicit constructor warnings.
-  factory MidiInputMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Map? _getItem(String key) =>
-      convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
-
-  void addAll(Map<String, dynamic> other) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool containsValue(dynamic value) => values.any((e) => e == value);
-
-  bool containsKey(dynamic key) => _getItem(key) != null;
-
-  Map? operator [](dynamic key) => _getItem(key);
-
-  void forEach(void f(String key, dynamic value)) {
-    var entries = JS('', '#.entries()', this);
-    while (true) {
-      var entry = JS('', '#.next()', entries);
-      if (JS('bool', '#.done', entry)) return;
-      f(JS('String', '#.value[0]', entry),
-          convertNativeToDart_Dictionary(JS('', '#.value[1]', entry)));
-    }
-  }
-
-  Iterable<String> get keys {
-    final keys = <String>[];
-    forEach((k, v) => keys.add(k));
-    return keys;
-  }
-
-  Iterable<Map> get values {
-    final values = <Map>[];
-    forEach((k, v) => values.add(v));
-    return values;
-  }
-
-  int get length => JS('int', '#.size', this);
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  void operator []=(String key, dynamic value) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  dynamic putIfAbsent(String key, dynamic ifAbsent()) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String remove(dynamic key) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIMessageEvent")
-class MidiMessageEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MidiMessageEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MidiMessageEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MidiMessageEvent._create_1(type, eventInitDict_1);
-    }
-    return MidiMessageEvent._create_2(type);
-  }
-  static MidiMessageEvent _create_1(type, eventInitDict) =>
-      JS('MidiMessageEvent', 'new MIDIMessageEvent(#,#)', type, eventInitDict);
-  static MidiMessageEvent _create_2(type) =>
-      JS('MidiMessageEvent', 'new MIDIMessageEvent(#)', type);
-
-  Uint8List get data native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIOutput")
-class MidiOutput extends MidiPort {
-  // To suppress missing implicit constructor warnings.
-  factory MidiOutput._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void send(Uint8List data, [num? timestamp]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIOutputMap")
-class MidiOutputMap extends Interceptor with MapMixin<String, dynamic> {
-  // To suppress missing implicit constructor warnings.
-  factory MidiOutputMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Map? _getItem(String key) =>
-      convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
-
-  void addAll(Map<String, dynamic> other) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool containsValue(dynamic value) => values.any((e) => e == value);
-
-  bool containsKey(dynamic key) => _getItem(key) != null;
-
-  Map? operator [](dynamic key) => _getItem(key);
-
-  void forEach(void f(String key, dynamic value)) {
-    var entries = JS('', '#.entries()', this);
-    while (true) {
-      var entry = JS('', '#.next()', entries);
-      if (JS('bool', '#.done', entry)) return;
-      f(JS('String', '#.value[0]', entry),
-          convertNativeToDart_Dictionary(JS('', '#.value[1]', entry)));
-    }
-  }
-
-  Iterable<String> get keys {
-    final keys = <String>[];
-    forEach((k, v) => keys.add(k));
-    return keys;
-  }
-
-  Iterable<Map> get values {
-    final values = <Map>[];
-    forEach((k, v) => values.add(v));
-    return values;
-  }
-
-  int get length => JS('int', '#.size', this);
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  void operator []=(String key, dynamic value) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  dynamic putIfAbsent(String key, dynamic ifAbsent()) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String remove(dynamic key) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("MIDIPort")
-class MidiPort extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory MidiPort._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get connection native;
-
-  String get id native;
-
-  String get manufacturer native;
-
-  String get name native;
-
-  String get state native;
-
-  String get type native;
-
-  String get version native;
-
-  Future close() => promiseToFuture(JS("", "#.close()", this));
-
-  Future open() => promiseToFuture(JS("", "#.open()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("MimeType")
-class MimeType extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MimeType._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get description native;
-
-  Plugin get enabledPlugin native;
-
-  String get suffixes native;
-
-  String get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MimeTypeArray")
-class MimeTypeArray extends Interceptor
-    with ListMixin<MimeType>, ImmutableListMixin<MimeType>
-    implements List<MimeType>, JavaScriptIndexingBehavior<MimeType> {
-  // To suppress missing implicit constructor warnings.
-  factory MimeTypeArray._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  MimeType operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("MimeType", "#[#]", this, index);
-  }
-
-  void operator []=(int index, MimeType value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<MimeType> mixins.
-  // MimeType is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  MimeType get first {
-    if (this.length > 0) {
-      return JS('MimeType', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  MimeType get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('MimeType', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  MimeType get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('MimeType', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  MimeType elementAt(int index) => this[index];
-  // -- end List<MimeType> mixins.
-
-  MimeType? item(int index) native;
-
-  MimeType? namedItem(String name) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("HTMLModElement")
-class ModElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ModElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ModElement.created() : super.created();
-
-  String get cite native;
-
-  set cite(String value) native;
-
-  String get dateTime native;
-
-  set dateTime(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void MojoWatchCallback(int result);
-// Copyright (c) 2012, 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.
-
-@Native("MouseEvent,DragEvent")
-class MouseEvent extends UIEvent {
-  factory MouseEvent(String type,
-      {Window? view,
-      int detail: 0,
-      int screenX: 0,
-      int screenY: 0,
-      int clientX: 0,
-      int clientY: 0,
-      int button: 0,
-      bool canBubble: true,
-      bool cancelable: true,
-      bool ctrlKey: false,
-      bool altKey: false,
-      bool shiftKey: false,
-      bool metaKey: false,
-      EventTarget? relatedTarget}) {
-    if (view == null) {
-      view = window;
-    }
-    MouseEvent event = document._createEvent('MouseEvent') as MouseEvent;
-    event._initMouseEvent(
-        type,
-        canBubble,
-        cancelable,
-        view,
-        detail,
-        screenX,
-        screenY,
-        clientX,
-        clientY,
-        ctrlKey,
-        altKey,
-        shiftKey,
-        metaKey,
-        button,
-        relatedTarget);
-    return event;
-  }
-
-  factory MouseEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return MouseEvent._create_1(type, eventInitDict_1);
-    }
-    return MouseEvent._create_2(type);
-  }
-  static MouseEvent _create_1(type, eventInitDict) =>
-      JS('MouseEvent', 'new MouseEvent(#,#)', type, eventInitDict);
-  static MouseEvent _create_2(type) =>
-      JS('MouseEvent', 'new MouseEvent(#)', type);
-
-  bool get altKey native;
-
-  int get button native;
-
-  int get buttons native;
-
-  @JSName('clientX')
-  num get _clientX native;
-
-  @JSName('clientY')
-  num get _clientY native;
-
-  bool get ctrlKey native;
-
-  /**
-   * The nonstandard way to access the element that the mouse comes
-   * from in the case of a `mouseover` event.
-   *
-   * This member is deprecated and not cross-browser compatible; use
-   * relatedTarget to get the same information in the standard way.
-   */
-  @deprecated
-  Node get fromElement native;
-
-  @JSName('layerX')
-  int get _layerX native;
-
-  @JSName('layerY')
-  int get _layerY native;
-
-  bool get metaKey native;
-
-  @JSName('movementX')
-  int get _movementX native;
-
-  @JSName('movementY')
-  int get _movementY native;
-
-  @JSName('pageX')
-  num get _pageX native;
-
-  @JSName('pageY')
-  num get _pageY native;
-
-  String? get region native;
-
-  EventTarget? get relatedTarget =>
-      _convertNativeToDart_EventTarget(this._get_relatedTarget);
-  @JSName('relatedTarget')
-  @Creates('Node')
-  @Returns('EventTarget|=Object|Null')
-  dynamic get _get_relatedTarget native;
-
-  @JSName('screenX')
-  num get _screenX native;
-
-  @JSName('screenY')
-  num get _screenY native;
-
-  bool get shiftKey native;
-
-  /**
-   * The nonstandard way to access the element that the mouse goes
-   * to in the case of a `mouseout` event.
-   *
-   * This member is deprecated and not cross-browser compatible; use
-   * relatedTarget to get the same information in the standard way.
-   */
-  @deprecated
-  Node get toElement native;
-
-  bool getModifierState(String keyArg) native;
-
-  void _initMouseEvent(
-      String? type,
-      bool? bubbles,
-      bool? cancelable,
-      Window? view,
-      int? detail,
-      int? screenX,
-      int? screenY,
-      int? clientX,
-      int? clientY,
-      bool? ctrlKey,
-      bool? altKey,
-      bool? shiftKey,
-      bool? metaKey,
-      int? button,
-      EventTarget? relatedTarget) {
-    var relatedTarget_1 = _convertDartToNative_EventTarget(relatedTarget);
-    _initMouseEvent_1(
-        type,
-        bubbles,
-        cancelable,
-        view,
-        detail,
-        screenX,
-        screenY,
-        clientX,
-        clientY,
-        ctrlKey,
-        altKey,
-        shiftKey,
-        metaKey,
-        button,
-        relatedTarget_1);
-    return;
-  }
-
-  @JSName('initMouseEvent')
-  void _initMouseEvent_1(
-      type,
-      bubbles,
-      cancelable,
-      Window? view,
-      detail,
-      screenX,
-      screenY,
-      clientX,
-      clientY,
-      ctrlKey,
-      altKey,
-      shiftKey,
-      metaKey,
-      button,
-      relatedTarget) native;
-
-  Point get client => new Point(_clientX, _clientY);
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  Point get movement => new Point(_movementX, _movementY);
-
-  /**
-   * The coordinates of the mouse pointer in target node coordinates.
-   *
-   * This value may vary between platforms if the target node moves
-   * after the event has fired or if the element has CSS transforms affecting
-   * it.
-   */
-  Point get offset {
-    if (JS('bool', '!!#.offsetX', this)) {
-      var x = JS('int', '#.offsetX', this);
-      var y = JS('int', '#.offsetY', this);
-      return new Point(x as num, y as num);
-    } else {
-      // Firefox does not support offsetX.
-      if (!(this.target is Element)) {
-        throw new UnsupportedError('offsetX is only supported on elements');
-      }
-      Element target = this.target as Element;
-      var point = (this.client - target.getBoundingClientRect().topLeft);
-      return new Point(point.x.toInt(), point.y.toInt());
-    }
-  }
-
-  Point get screen => new Point(_screenX, _screenY);
-
-  Point get layer => new Point(_layerX, _layerY);
-
-  Point get page => new Point(_pageX, _pageY);
-
-  DataTransfer get dataTransfer =>
-      JS('DataTransfer', "#['dataTransfer']", this);
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void MutationCallback(List mutations, MutationObserver observer);
-// Copyright (c) 2012, 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.
-
-// http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents
-@deprecated
-@Native("MutationEvent")
-class MutationEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory MutationEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int ADDITION = 2;
-
-  static const int MODIFICATION = 1;
-
-  static const int REMOVAL = 3;
-
-  int get attrChange native;
-
-  String get attrName native;
-
-  String get newValue native;
-
-  String get prevValue native;
-
-  Node? get relatedNode native;
-
-  void initMutationEvent(
-      String? type,
-      bool? bubbles,
-      bool? cancelable,
-      Node? relatedNode,
-      String? prevValue,
-      String? newValue,
-      String? attrName,
-      int? attrChange) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("MutationObserver,WebKitMutationObserver")
-class MutationObserver extends Interceptor {
-  void disconnect() native;
-
-  void _observe(Node target, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      _observe_1(target, options_1);
-      return;
-    }
-    _observe_2(target);
-    return;
-  }
-
-  @JSName('observe')
-  void _observe_1(Node target, options) native;
-  @JSName('observe')
-  void _observe_2(Node target) native;
-
-  List<MutationRecord> takeRecords() native;
-
-  /**
-   * Checks to see if the mutation observer API is supported on the current
-   * platform.
-   */
-  static bool get supported {
-    return JS(
-        'bool', '!!(window.MutationObserver || window.WebKitMutationObserver)');
-  }
-
-  /**
-   * Observes the target for the specified changes.
-   *
-   * Some requirements for the optional parameters:
-   *
-   * * Either childList, attributes or characterData must be true.
-   * * If attributeOldValue is true then attributes must also be true.
-   * * If attributeFilter is specified then attributes must be true.
-   * * If characterDataOldValue is true then characterData must be true.
-   */
-  void observe(Node target,
-      {bool? childList,
-      bool? attributes,
-      bool? characterData,
-      bool? subtree,
-      bool? attributeOldValue,
-      bool? characterDataOldValue,
-      List<String>? attributeFilter}) {
-    // Parse options into map of known type.
-    var parsedOptions = _createDict();
-
-    // Override options passed in the map with named optional arguments.
-    override(key, value) {
-      if (value != null) _add(parsedOptions, key, value);
-    }
-
-    override('childList', childList);
-    override('attributes', attributes);
-    override('characterData', characterData);
-    override('subtree', subtree);
-    override('attributeOldValue', attributeOldValue);
-    override('characterDataOldValue', characterDataOldValue);
-    if (attributeFilter != null) {
-      override('attributeFilter', _fixupList(attributeFilter));
-    }
-
-    _call(target, parsedOptions);
-  }
-
-  // TODO: Change to a set when const Sets are available.
-  static final _boolKeys = const {
-    'childList': true,
-    'attributes': true,
-    'characterData': true,
-    'subtree': true,
-    'attributeOldValue': true,
-    'characterDataOldValue': true
-  };
-
-  static _createDict() => JS('var', '{}');
-  static _add(m, String key, value) {
-    JS('void', '#[#] = #', m, key, value);
-  }
-
-  static _fixupList(list) => list; // TODO: Ensure is a JavaScript Array.
-
-  // Call native function with no conversions.
-  @JSName('observe')
-  void _call(target, options) native;
-
-  factory MutationObserver(MutationCallback callback) {
-    // Dummy statement to mark types as instantiated.
-    JS('MutationObserver|MutationRecord', '0');
-
-    return JS(
-        'MutationObserver',
-        'new(window.MutationObserver||window.WebKitMutationObserver||'
-            'window.MozMutationObserver)(#)',
-        convertDartClosureToJS(_wrapBinaryZone(callback), 2));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("MutationRecord")
-class MutationRecord extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory MutationRecord._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get addedNodes native;
-
-  String? get attributeName native;
-
-  String? get attributeNamespace native;
-
-  Node? get nextSibling native;
-
-  String? get oldValue native;
-
-  Node? get previousSibling native;
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get removedNodes native;
-
-  Node get target native;
-
-  String get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NavigationPreloadManager")
-class NavigationPreloadManager extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigationPreloadManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future disable() => promiseToFuture(JS("", "#.disable()", this));
-
-  Future enable() => promiseToFuture(JS("", "#.enable()", this));
-
-  Future<Map<String, dynamic>?> getState() =>
-      promiseToFutureAsMap(JS("", "#.getState()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("Navigator")
-class Navigator extends NavigatorConcurrentHardware
-    implements
-        NavigatorCookies,
-        NavigatorLanguage,
-        NavigatorOnLine,
-        NavigatorAutomationInformation,
-        NavigatorID {
-  List<Gamepad?> getGamepads() {
-    var gamepadList = _getGamepads();
-
-    // If no prototype we need one for the world to hookup to the proper Dart class.
-    var jsProto = JS('', '#.prototype', gamepadList);
-    if (jsProto == null) {
-      JS('', '#.prototype = Object.create(null)', gamepadList);
-    }
-
-    applyExtension('GamepadList', gamepadList);
-    return gamepadList;
-  }
-
-  String get language =>
-      JS('String', '#.language || #.userLanguage', this, this);
-
-  /**
-   * Gets a stream (video and or audio) from the local computer.
-   *
-   * Use [MediaStream.supported] to check if this is supported by the current
-   * platform. The arguments `audio` and `video` default to `false` (stream does
-   * not use audio or video, respectively).
-   *
-   * Simple example usage:
-   *
-   *     window.navigator.getUserMedia(audio: true, video: true).then((stream) {
-   *       var video = new VideoElement()
-   *         ..autoplay = true
-   *         ..src = Url.createObjectUrlFromStream(stream);
-   *       document.body.append(video);
-   *     });
-   *
-   * The user can also pass in Maps to the audio or video parameters to specify
-   * mandatory and optional constraints for the media stream. Not passing in a
-   * map, but passing in `true` will provide a MediaStream with audio or
-   * video capabilities, but without any additional constraints. The particular
-   * constraint names for audio and video are still in flux, but as of this
-   * writing, here is an example providing more constraints.
-   *
-   *     window.navigator.getUserMedia(
-   *         audio: true,
-   *         video: {'mandatory':
-   *                    { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 },
-   *                 'optional':
-   *                    [{ 'minFrameRate': 60 },
-   *                     { 'maxWidth': 640 }]
-   *     });
-   *
-   * See also:
-   * * [MediaStream.supported]
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  Future<MediaStream> getUserMedia({audio: false, video: false}) {
-    var completer = new Completer<MediaStream>();
-    var options = {'audio': audio, 'video': video};
-    _ensureGetUserMedia();
-    this._getUserMedia(convertDartToNative_SerializedScriptValue(options),
-        (stream) {
-      completer.complete(stream);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  _ensureGetUserMedia() {
-    if (JS('bool', '!(#.getUserMedia)', this)) {
-      JS(
-          'void',
-          '#.getUserMedia = '
-              '(#.getUserMedia || #.webkitGetUserMedia || #.mozGetUserMedia ||'
-              '#.msGetUserMedia)',
-          this,
-          this,
-          this,
-          this,
-          this);
-    }
-  }
-
-  @JSName('getUserMedia')
-  void _getUserMedia(options, _NavigatorUserMediaSuccessCallback success,
-      _NavigatorUserMediaErrorCallback error) native;
-
-  // To suppress missing implicit constructor warnings.
-  factory Navigator._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  _BudgetService get budget native;
-
-  _Clipboard get clipboard native;
-
-  NetworkInformation? get connection native;
-
-  CredentialsContainer get credentials native;
-
-  num? get deviceMemory native;
-
-  String? get doNotTrack native;
-
-  @Unstable()
-  Geolocation get geolocation native;
-
-  int get maxTouchPoints native;
-
-  MediaCapabilities get mediaCapabilities native;
-
-  MediaDevices get mediaDevices native;
-
-  MediaSession get mediaSession native;
-
-  MimeTypeArray get mimeTypes native;
-
-  _NFC get nfc native;
-
-  Permissions get permissions native;
-
-  Presentation get presentation native;
-
-  @Unstable()
-  String get productSub native;
-
-  ServiceWorkerContainer get serviceWorker native;
-
-  StorageManager get storage native;
-
-  @Unstable()
-  String get vendor native;
-
-  @Unstable()
-  String get vendorSub native;
-
-  VR get vr native;
-
-  @JSName('webkitPersistentStorage')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  DeprecatedStorageQuota get persistentStorage native;
-
-  @JSName('webkitTemporaryStorage')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  DeprecatedStorageQuota get temporaryStorage native;
-
-  void cancelKeyboardLock() native;
-
-  Future getBattery() => promiseToFuture(JS("", "#.getBattery()", this));
-
-  @JSName('getGamepads')
-  @Returns('_GamepadList')
-  @Creates('_GamepadList')
-  List<Gamepad?> _getGamepads() native;
-
-  Future<RelatedApplication> getInstalledRelatedApps() =>
-      promiseToFuture<RelatedApplication>(
-          JS("", "#.getInstalledRelatedApps()", this));
-
-  Future getVRDisplays() => promiseToFuture(JS("", "#.getVRDisplays()", this));
-
-  @Unstable()
-  void registerProtocolHandler(String scheme, String url, String title) native;
-
-  Future requestKeyboardLock([List<String>? keyCodes]) {
-    if (keyCodes != null) {
-      List keyCodes_1 = convertDartToNative_StringArray(keyCodes);
-      return _requestKeyboardLock_1(keyCodes_1);
-    }
-    return _requestKeyboardLock_2();
-  }
-
-  @JSName('requestKeyboardLock')
-  Future _requestKeyboardLock_1(List keyCodes) =>
-      promiseToFuture(JS("", "#.requestKeyboardLock(#)", this, keyCodes));
-  @JSName('requestKeyboardLock')
-  Future _requestKeyboardLock_2() =>
-      promiseToFuture(JS("", "#.requestKeyboardLock()", this));
-
-  @JSName('requestMIDIAccess')
-  Future requestMidiAccess([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(
-        JS("", "#.requestMIDIAccess(#)", this, options_dict));
-  }
-
-  Future requestMediaKeySystemAccess(
-          String keySystem, List<Map> supportedConfigurations) =>
-      promiseToFuture(JS("", "#.requestMediaKeySystemAccess(#, #)", this,
-          keySystem, supportedConfigurations));
-
-  bool sendBeacon(String url, Object? data) native;
-
-  Future share([Map? data]) {
-    var data_dict = null;
-    if (data != null) {
-      data_dict = convertDartToNative_Dictionary(data);
-    }
-    return promiseToFuture(JS("", "#.share(#)", this, data_dict));
-  }
-
-  // From NavigatorAutomationInformation
-
-  bool get webdriver native;
-
-  // From NavigatorCookies
-
-  @Unstable()
-  bool get cookieEnabled native;
-
-  // From NavigatorID
-
-  String get appCodeName native;
-
-  String get appName native;
-
-  String get appVersion native;
-
-  bool get dartEnabled native;
-
-  String get platform native;
-
-  @Unstable()
-  String get product native;
-
-  String get userAgent native;
-
-  // From NavigatorLanguage
-
-  List<String> get languages native;
-
-  // From NavigatorOnLine
-
-  @Unstable()
-  bool get onLine native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NavigatorAutomationInformation")
-class NavigatorAutomationInformation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorAutomationInformation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get webdriver native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NavigatorConcurrentHardware")
-class NavigatorConcurrentHardware extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorConcurrentHardware._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get hardwareConcurrency native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NavigatorCookies")
-class NavigatorCookies extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorCookies._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get cookieEnabled native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class NavigatorID extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorID._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get appCodeName native;
-
-  String get appName native;
-
-  String get appVersion native;
-
-  bool get dartEnabled native;
-
-  String get platform native;
-
-  String get product native;
-
-  String get userAgent native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class NavigatorLanguage extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorLanguage._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get language native;
-
-  List<String> get languages native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class NavigatorOnLine extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorOnLine._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get onLine native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NavigatorUserMediaError")
-class NavigatorUserMediaError extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NavigatorUserMediaError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get constraintName native;
-
-  String get message native;
-
-  String get name native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _NavigatorUserMediaSuccessCallback(MediaStream stream);
-// Copyright (c) 2012, 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.
-
-@Native("NetworkInformation")
-class NetworkInformation extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory NetworkInformation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  num? get downlink native;
-
-  num get downlinkMax native;
-
-  String get effectiveType native;
-
-  int get rtt native;
-
-  String get type native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Lazy implementation of the child nodes of an element that does not request
- * the actual child nodes of an element until strictly necessary greatly
- * improving performance for the typical cases where it is not required.
- */
-class _ChildNodeListLazy extends ListBase<Node> implements NodeListWrapper {
-  final Node _this;
-
-  _ChildNodeListLazy(this._this);
-
-  Node get first {
-    Node? result = JS('Node|Null', '#.firstChild', _this);
-    if (result == null) throw new StateError("No elements");
-    return result;
-  }
-
-  Node get last {
-    Node? result = JS('Node|Null', '#.lastChild', _this);
-    if (result == null) throw new StateError("No elements");
-    return result;
-  }
-
-  Node get single {
-    int l = this.length;
-    if (l == 0) throw new StateError("No elements");
-    if (l > 1) throw new StateError("More than one element");
-    return JS('Node|Null', '#.firstChild', _this)!;
-  }
-
-  void add(Node value) {
-    _this.append(value);
-  }
-
-  void addAll(Iterable<Node> iterable) {
-    if (iterable is _ChildNodeListLazy) {
-      _ChildNodeListLazy otherList = iterable;
-      if (!identical(otherList._this, _this)) {
-        // Optimized route for copying between nodes.
-        for (var i = 0, len = otherList.length; i < len; ++i) {
-          _this.append(otherList._this.firstChild!);
-        }
-      }
-      return;
-    }
-    for (Node node in iterable) {
-      _this.append(node);
-    }
-  }
-
-  void insert(int index, Node node) {
-    if (index < 0 || index > length) {
-      throw new RangeError.range(index, 0, length);
-    }
-    if (index == length) {
-      _this.append(node);
-    } else {
-      _this.insertBefore(node, this[index]);
-    }
-  }
-
-  void insertAll(int index, Iterable<Node> iterable) {
-    if (index == length) {
-      addAll(iterable);
-    } else {
-      var item = this[index];
-      _this.insertAllBefore(iterable, item);
-    }
-  }
-
-  void setAll(int index, Iterable<Node> iterable) {
-    throw new UnsupportedError("Cannot setAll on Node list");
-  }
-
-  Node removeLast() {
-    final result = last;
-    if (result != null) {
-      _this._removeChild(result);
-    }
-    return result;
-  }
-
-  Node removeAt(int index) {
-    var result = this[index];
-    if (result != null) {
-      _this._removeChild(result);
-    }
-    return result;
-  }
-
-  bool remove(Object? object) {
-    if (object is! Node) return false;
-    Node node = object;
-    if (!identical(_this, node.parentNode)) return false;
-    _this._removeChild(node);
-    return true;
-  }
-
-  void _filter(bool test(Node node), bool removeMatching) {
-    // This implementation of removeWhere/retainWhere is more efficient
-    // than the default in ListBase. Child nodes can be removed in constant
-    // time.
-    Node? child = _this.firstChild;
-    while (child != null) {
-      Node? nextChild = child.nextNode;
-      if (test(child) == removeMatching) {
-        _this._removeChild(child);
-      }
-      child = nextChild;
-    }
-  }
-
-  void removeWhere(bool test(Node node)) {
-    _filter(test, true);
-  }
-
-  void retainWhere(bool test(Node node)) {
-    _filter(test, false);
-  }
-
-  void clear() {
-    _this._clearChildren();
-  }
-
-  void operator []=(int index, Node value) {
-    _this._replaceChild(value, this[index]);
-  }
-
-  Iterator<Node> get iterator => _this.childNodes.iterator;
-
-  // From List<Node>:
-
-  // TODO(jacobr): this could be implemented for child node lists.
-  // The exception we throw here is misleading.
-  void sort([Comparator<Node>? compare]) {
-    throw new UnsupportedError("Cannot sort Node list");
-  }
-
-  void shuffle([Random? random]) {
-    throw new UnsupportedError("Cannot shuffle Node list");
-  }
-
-  // FIXME: implement these.
-  void setRange(int start, int end, Iterable<Node> iterable,
-      [int skipCount = 0]) {
-    throw new UnsupportedError("Cannot setRange on Node list");
-  }
-
-  void fillRange(int start, int end, [Node? fill]) {
-    throw new UnsupportedError("Cannot fillRange on Node list");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on Node list");
-  }
-  // -- end List<Node> mixins.
-
-  // TODO(jacobr): benchmark whether this is more efficient or whether caching
-  // a local copy of childNodes is more efficient.
-  int get length => _this.childNodes.length;
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot set length on immutable List.");
-  }
-
-  Node operator [](int index) => _this.childNodes[index];
-
-  List<Node> get rawList => _this.childNodes;
-}
-
-@Native("Node")
-class Node extends EventTarget {
-  // Custom element created callback.
-  Node._created() : super._created();
-
-  /**
-   * A modifiable list of this node's children.
-   */
-  List<Node> get nodes {
-    return new _ChildNodeListLazy(this);
-  }
-
-  set nodes(Iterable<Node> value) {
-    // Copy list first since we don't want liveness during iteration.
-    // TODO(jacobr): there is a better way to do this.
-    var copy = value.toList();
-    text = '';
-    for (Node node in copy) {
-      append(node);
-    }
-  }
-
-  /**
-   * Removes this node from the DOM.
-   */
-  void remove() {
-    // TODO(jacobr): should we throw an exception if parent is already null?
-    // TODO(vsm): Use the native remove when available.
-    if (this.parentNode != null) {
-      final Node parent = this.parentNode!;
-      parent._removeChild(this);
-    }
-  }
-
-  /**
-   * Replaces this node with another node.
-   */
-  Node replaceWith(Node otherNode) {
-    try {
-      final Node parent = this.parentNode!;
-      parent._replaceChild(otherNode, this);
-    } catch (e) {}
-    return this;
-  }
-
-  /**
-   * Inserts all of the nodes into this node directly before refChild.
-   *
-   * See also:
-   *
-   * * [insertBefore]
-   */
-  void insertAllBefore(Iterable<Node> newNodes, Node refChild) {
-    if (newNodes is _ChildNodeListLazy) {
-      _ChildNodeListLazy otherList = newNodes;
-      if (identical(otherList._this, this)) {
-        throw new ArgumentError(newNodes);
-      }
-
-      // Optimized route for copying between nodes.
-      for (var i = 0, len = otherList.length; i < len; ++i) {
-        this.insertBefore(otherList._this.firstChild!, refChild);
-      }
-    } else {
-      for (var node in newNodes) {
-        this.insertBefore(node, refChild);
-      }
-    }
-  }
-
-  void _clearChildren() {
-    while (firstChild != null) {
-      _removeChild(firstChild!);
-    }
-  }
-
-  /**
-   * Print out a String representation of this Node.
-   */
-  String toString() {
-    String? value = nodeValue; // Fetch DOM Node property once.
-    return value == null ? super.toString() : value;
-  }
-
-  /**
-   * A list of this node's children.
-   *
-   * ## Other resources
-   *
-   * * [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes)
-   *   from MDN.
-   */
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get childNodes native;
-
-  // To suppress missing implicit constructor warnings.
-  factory Node._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int ATTRIBUTE_NODE = 2;
-
-  static const int CDATA_SECTION_NODE = 4;
-
-  static const int COMMENT_NODE = 8;
-
-  static const int DOCUMENT_FRAGMENT_NODE = 11;
-
-  static const int DOCUMENT_NODE = 9;
-
-  static const int DOCUMENT_TYPE_NODE = 10;
-
-  static const int ELEMENT_NODE = 1;
-
-  static const int ENTITY_NODE = 6;
-
-  static const int ENTITY_REFERENCE_NODE = 5;
-
-  static const int NOTATION_NODE = 12;
-
-  static const int PROCESSING_INSTRUCTION_NODE = 7;
-
-  static const int TEXT_NODE = 3;
-
-  @JSName('baseURI')
-  String get baseUri native;
-
-  /**
-   * The first child of this node.
-   *
-   * ## Other resources
-   *
-   * * [Node.firstChild](https://developer.mozilla.org/en-US/docs/Web/API/Node.firstChild)
-   *   from MDN.
-   */
-
-  Node? get firstChild native;
-
-  bool get isConnected native;
-
-  /**
-   * The last child of this node.
-   *
-   * ## Other resources
-   *
-   * * [Node.lastChild](https://developer.mozilla.org/en-US/docs/Web/API/Node.lastChild)
-   *   from MDN.
-   */
-
-  Node? get lastChild native;
-
-  @JSName('nextSibling')
-
-  /**
-   * The next sibling node.
-   *
-   * ## Other resources
-   *
-   * * [Node.nextSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node.nextSibling)
-   *   from MDN.
-   */
-
-  Node? get nextNode native;
-
-  /**
-   * The name of this node.
-   *
-   * This varies by this node's [nodeType].
-   *
-   * ## Other resources
-   *
-   * * [Node.nodeName](https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeName)
-   *   from MDN. This page contains a table of [nodeName] values for each
-   *   [nodeType].
-   */
-
-  String get nodeName native;
-
-  /**
-   * The type of node.
-   *
-   * This value is one of:
-   *
-   * * [ATTRIBUTE_NODE] if this node is an attribute.
-   * * [CDATA_SECTION_NODE] if this node is a [CDataSection].
-   * * [COMMENT_NODE] if this node is a [Comment].
-   * * [DOCUMENT_FRAGMENT_NODE] if this node is a [DocumentFragment].
-   * * [DOCUMENT_NODE] if this node is a [Document].
-   * * [DOCUMENT_TYPE_NODE] if this node is a [DocumentType] node.
-   * * [ELEMENT_NODE] if this node is an [Element].
-   * * [ENTITY_NODE] if this node is an entity.
-   * * [ENTITY_REFERENCE_NODE] if this node is an entity reference.
-   * * [NOTATION_NODE] if this node is a notation.
-   * * [PROCESSING_INSTRUCTION_NODE] if this node is a [ProcessingInstruction].
-   * * [TEXT_NODE] if this node is a [Text] node.
-   *
-   * ## Other resources
-   *
-   * * [Node.nodeType](https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeType)
-   *   from MDN.
-   */
-
-  int get nodeType native;
-
-  /**
-   * The value of this node.
-   *
-   * This varies by this type's [nodeType].
-   *
-   * ## Other resources
-   *
-   * * [Node.nodeValue](https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeValue)
-   *   from MDN. This page contains a table of [nodeValue] values for each
-   *   [nodeType].
-   */
-
-  String? get nodeValue native;
-
-  /**
-   * The document this node belongs to.
-   *
-   * Returns null if this node does not belong to any document.
-   *
-   * ## Other resources
-   *
-   * * [Node.ownerDocument](https://developer.mozilla.org/en-US/docs/Web/API/Node.ownerDocument)
-   *   from MDN.
-   */
-
-  Document? get ownerDocument native;
-
-  @JSName('parentElement')
-
-  /**
-   * The parent element of this node.
-   *
-   * Returns null if this node either does not have a parent or its parent is
-   * not an element.
-   *
-   * ## Other resources
-   *
-   * * [Node.parentElement](https://developer.mozilla.org/en-US/docs/Web/API/Node.parentElement)
-   *   from W3C.
-   */
-
-  Element? get parent native;
-
-  /**
-   * The parent node of this node.
-   *
-   * ## Other resources
-   *
-   * * [Node.parentNode](https://developer.mozilla.org/en-US/docs/Web/API/Node.parentNode)
-   *   from MDN.
-   */
-
-  Node? get parentNode native;
-
-  @JSName('previousSibling')
-
-  /**
-   * The previous sibling node.
-   *
-   * ## Other resources
-   *
-   * * [Node.previousSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node.previousSibling)
-   *   from MDN.
-   */
-
-  Node? get previousNode native;
-
-  @JSName('textContent')
-
-  /**
-   * All text within this node and its descendents.
-   *
-   * ## Other resources
-   *
-   * * [Node.textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node.textContent)
-   *   from MDN.
-   */
-
-  String? get text native;
-
-  @JSName('textContent')
-  set text(String? value) native;
-
-  @JSName('appendChild')
-  /**
-   * Adds a node to the end of the child [nodes] list of this node.
-   *
-   * If the node already exists in this document, it will be removed from its
-   * current parent node, then added to this node.
-   *
-   * This method is more efficient than `nodes.add`, and is the preferred
-   * way of appending a child node.
-   */
-  Node append(Node node) native;
-
-  @JSName('cloneNode')
-  /**
-   * Returns a copy of this node.
-   *
-   * If [deep] is `true`, then all of this node's children and descendents are
-   * copied as well. If [deep] is `false`, then only this node is copied.
-   *
-   * ## Other resources
-   *
-   * * [Node.cloneNode](https://developer.mozilla.org/en-US/docs/Web/API/Node.cloneNode)
-   *   from MDN.
-   */
-  Node clone(bool? deep) native;
-
-  /**
-   * Returns true if this node contains the specified node.
-   *
-   * ## Other resources
-   *
-   * * [Node.contains](https://developer.mozilla.org/en-US/docs/Web/API/Node.contains)
-   *   from MDN.
-   */
-  bool contains(Node? other) native;
-
-  Node getRootNode([Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return _getRootNode_1(options_1);
-    }
-    return _getRootNode_2();
-  }
-
-  @JSName('getRootNode')
-  Node _getRootNode_1(options) native;
-  @JSName('getRootNode')
-  Node _getRootNode_2() native;
-
-  /**
-   * Returns true if this node has any children.
-   *
-   * ## Other resources
-   *
-   * * [Node.hasChildNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node.hasChildNodes)
-   *   from MDN.
-   */
-  bool hasChildNodes() native;
-
-  /**
-   * Inserts all of the nodes into this node directly before refChild.
-   *
-   * ## Other resources
-   *
-   * * [Node.insertBefore](https://developer.mozilla.org/en-US/docs/Web/API/Node.insertBefore)
-   *   from MDN.
-   */
-  Node insertBefore(Node node, Node? child) native;
-
-  @JSName('removeChild')
-  Node _removeChild(Node child) native;
-
-  @JSName('replaceChild')
-  Node _replaceChild(Node node, Node child) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("NodeFilter")
-class NodeFilter extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NodeFilter._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int FILTER_ACCEPT = 1;
-
-  static const int FILTER_REJECT = 2;
-
-  static const int FILTER_SKIP = 3;
-
-  static const int SHOW_ALL = 0xFFFFFFFF;
-
-  static const int SHOW_COMMENT = 0x80;
-
-  static const int SHOW_DOCUMENT = 0x100;
-
-  static const int SHOW_DOCUMENT_FRAGMENT = 0x400;
-
-  static const int SHOW_DOCUMENT_TYPE = 0x200;
-
-  static const int SHOW_ELEMENT = 0x1;
-
-  static const int SHOW_PROCESSING_INSTRUCTION = 0x40;
-
-  static const int SHOW_TEXT = 0x4;
-}
-// Copyright (c) 2013, 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.
-
-@Unstable()
-@Native("NodeIterator")
-class NodeIterator extends Interceptor {
-  factory NodeIterator(Node root, int whatToShow) {
-    return document._createNodeIterator(root, whatToShow, null);
-  }
-  // To suppress missing implicit constructor warnings.
-  factory NodeIterator._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get pointerBeforeReferenceNode native;
-
-  Node get referenceNode native;
-
-  Node get root native;
-
-  int get whatToShow native;
-
-  void detach() native;
-
-  Node? nextNode() native;
-
-  Node? previousNode() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NodeList,RadioNodeList")
-class NodeList extends Interceptor
-    with ListMixin<Node>, ImmutableListMixin<Node>
-    implements JavaScriptIndexingBehavior<Node>, List<Node> {
-  // To suppress missing implicit constructor warnings.
-  factory NodeList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Node operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Node", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Node value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Node> mixins.
-  // Node is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Node get first {
-    if (this.length > 0) {
-      return JS('Node', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Node get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Node', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Node get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Node', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Node elementAt(int index) => this[index];
-  // -- end List<Node> mixins.
-
-  @JSName('item')
-  Node? _item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NonDocumentTypeChildNode")
-class NonDocumentTypeChildNode extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NonDocumentTypeChildNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Element? get nextElementSibling native;
-
-  Element? get previousElementSibling native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NonElementParentNode")
-class NonElementParentNode extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NonElementParentNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Element? getElementById(String elementId) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("NoncedElement")
-class NoncedElement extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory NoncedElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String? get nonce native;
-
-  set nonce(String? value) native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("Notification")
-class Notification extends EventTarget {
-  factory Notification(String title,
-      {String? dir, String? body, String? lang, String? tag, String? icon}) {
-    var parsedOptions = {};
-    if (dir != null) parsedOptions['dir'] = dir;
-    if (body != null) parsedOptions['body'] = body;
-    if (lang != null) parsedOptions['lang'] = lang;
-    if (tag != null) parsedOptions['tag'] = tag;
-    if (icon != null) parsedOptions['icon'] = icon;
-    return Notification._factoryNotification(title, parsedOptions);
-  }
-  // To suppress missing implicit constructor warnings.
-  factory Notification._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `click` events to event
-   * handlers that are not necessarily instances of [Notification].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> clickEvent =
-      const EventStreamProvider<Event>('click');
-
-  /**
-   * Static factory designed to expose `close` events to event
-   * handlers that are not necessarily instances of [Notification].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> closeEvent =
-      const EventStreamProvider<Event>('close');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [Notification].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `show` events to event
-   * handlers that are not necessarily instances of [Notification].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> showEvent =
-      const EventStreamProvider<Event>('show');
-
-  static Notification _factoryNotification(String title, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return Notification._create_1(title, options_1);
-    }
-    return Notification._create_2(title);
-  }
-
-  static Notification _create_1(title, options) =>
-      JS('Notification', 'new Notification(#,#)', title, options);
-  static Notification _create_2(title) =>
-      JS('Notification', 'new Notification(#)', title);
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.Notification)');
-
-  List get actions native;
-
-  String get badge native;
-
-  String get body native;
-
-  @annotation_Creates_SerializedScriptValue
-  @annotation_Returns_SerializedScriptValue
-  Object? get data native;
-
-  String get dir native;
-
-  String get icon native;
-
-  String get image native;
-
-  String get lang native;
-
-  static int get maxActions native;
-
-  static String get permission native;
-
-  bool get renotify native;
-
-  bool get requireInteraction native;
-
-  bool get silent native;
-
-  String get tag native;
-
-  int get timestamp native;
-
-  String get title native;
-
-  List<int> get vibrate native;
-
-  void close() native;
-
-  @JSName('requestPermission')
-  static Future _requestPermission(
-      [_NotificationPermissionCallback? deprecatedCallback]) native;
-
-  @JSName('requestPermission')
-  static Future<String> requestPermission() {
-    var completer = new Completer<String>();
-    _requestPermission((value) {
-      completer.complete(value);
-    });
-    return completer.future;
-  }
-
-  /// Stream of `click` events handled by this [Notification].
-  Stream<Event> get onClick => clickEvent.forTarget(this);
-
-  /// Stream of `close` events handled by this [Notification].
-  Stream<Event> get onClose => closeEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [Notification].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `show` events handled by this [Notification].
-  Stream<Event> get onShow => showEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("NotificationEvent")
-class NotificationEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory NotificationEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory NotificationEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return NotificationEvent._create_1(type, eventInitDict_1);
-  }
-  static NotificationEvent _create_1(type, eventInitDict) => JS(
-      'NotificationEvent', 'new NotificationEvent(#,#)', type, eventInitDict);
-
-  String get action native;
-
-  Notification get notification native;
-
-  String? get reply native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _NotificationPermissionCallback(String permission);
-// Copyright (c) 2012, 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.
-
-@Native("HTMLOListElement")
-class OListElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory OListElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OListElement() => JS<OListElement>(
-      'returns:OListElement;creates:OListElement;new:true',
-      '#.createElement(#)',
-      document,
-      "ol");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  OListElement.created() : super.created();
-
-  bool get reversed native;
-
-  set reversed(bool value) native;
-
-  int get start native;
-
-  set start(int value) native;
-
-  String get type native;
-
-  set type(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("HTMLObjectElement")
-class ObjectElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ObjectElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ObjectElement() => document.createElement("object") as ObjectElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ObjectElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('object');
-
-  WindowBase? get contentWindow =>
-      _convertNativeToDart_Window(this._get_contentWindow);
-  @JSName('contentWindow')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_contentWindow native;
-
-  String get data native;
-
-  set data(String value) native;
-
-  FormElement? get form native;
-
-  String get height native;
-
-  set height(String value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  String get useMap native;
-
-  set useMap(String value) native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  String get width native;
-
-  set width(String value) native;
-
-  bool get willValidate native;
-
-  Node __getter__(String name) native;
-
-  void __setter__(String name, Node value) native;
-
-  bool checkValidity() native;
-
-  bool reportValidity() native;
-
-  void setCustomValidity(String error) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OffscreenCanvas")
-class OffscreenCanvas extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory OffscreenCanvas._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OffscreenCanvas(int width, int height) {
-    return OffscreenCanvas._create_1(width, height);
-  }
-  static OffscreenCanvas _create_1(width, height) =>
-      JS('OffscreenCanvas', 'new OffscreenCanvas(#,#)', width, height);
-
-  int get height native;
-
-  set height(int value) native;
-
-  int get width native;
-
-  set width(int value) native;
-
-  Future<Blob> convertToBlob([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<Blob>(
-        JS("", "#.convertToBlob(#)", this, options_dict));
-  }
-
-  Object? getContext(String contextType, [Map? attributes]) {
-    if (attributes != null) {
-      var attributes_1 = convertDartToNative_Dictionary(attributes);
-      return _getContext_1(contextType, attributes_1);
-    }
-    return _getContext_2(contextType);
-  }
-
-  @JSName('getContext')
-  Object? _getContext_1(contextType, attributes) native;
-  @JSName('getContext')
-  Object? _getContext_2(contextType) native;
-
-  ImageBitmap transferToImageBitmap() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OffscreenCanvasRenderingContext2D")
-class OffscreenCanvasRenderingContext2D extends Interceptor
-    implements _CanvasPath {
-  // To suppress missing implicit constructor warnings.
-  factory OffscreenCanvasRenderingContext2D._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  OffscreenCanvas get canvas native;
-
-  String get direction native;
-
-  set direction(String value) native;
-
-  Object? get fillStyle native;
-
-  set fillStyle(Object? value) native;
-
-  String get filter native;
-
-  set filter(String value) native;
-
-  String get font native;
-
-  set font(String value) native;
-
-  num get globalAlpha native;
-
-  set globalAlpha(num value) native;
-
-  String get globalCompositeOperation native;
-
-  set globalCompositeOperation(String value) native;
-
-  bool get imageSmoothingEnabled native;
-
-  set imageSmoothingEnabled(bool value) native;
-
-  String get imageSmoothingQuality native;
-
-  set imageSmoothingQuality(String value) native;
-
-  String get lineCap native;
-
-  set lineCap(String value) native;
-
-  num get lineDashOffset native;
-
-  set lineDashOffset(num value) native;
-
-  String get lineJoin native;
-
-  set lineJoin(String value) native;
-
-  num get lineWidth native;
-
-  set lineWidth(num value) native;
-
-  num get miterLimit native;
-
-  set miterLimit(num value) native;
-
-  num get shadowBlur native;
-
-  set shadowBlur(num value) native;
-
-  String get shadowColor native;
-
-  set shadowColor(String value) native;
-
-  num get shadowOffsetX native;
-
-  set shadowOffsetX(num value) native;
-
-  num get shadowOffsetY native;
-
-  set shadowOffsetY(num value) native;
-
-  Object? get strokeStyle native;
-
-  set strokeStyle(Object? value) native;
-
-  String get textAlign native;
-
-  set textAlign(String value) native;
-
-  String get textBaseline native;
-
-  set textBaseline(String value) native;
-
-  void beginPath() native;
-
-  void clearRect(num x, num y, num width, num height) native;
-
-  void clip([Path2D? path]) native;
-
-  Future commit() => promiseToFuture(JS("", "#.commit()", this));
-
-  ImageData createImageData(data_OR_imagedata_OR_sw,
-      [int? sh_OR_sw,
-      imageDataColorSettings_OR_sh,
-      Map? imageDataColorSettings]) {
-    if ((data_OR_imagedata_OR_sw is ImageData) &&
-        sh_OR_sw == null &&
-        imageDataColorSettings_OR_sh == null &&
-        imageDataColorSettings == null) {
-      var imagedata_1 = convertDartToNative_ImageData(data_OR_imagedata_OR_sw);
-      return convertNativeToDart_ImageData(_createImageData_1(imagedata_1));
-    }
-    if (sh_OR_sw != null &&
-        (data_OR_imagedata_OR_sw is int) &&
-        imageDataColorSettings_OR_sh == null &&
-        imageDataColorSettings == null) {
-      return convertNativeToDart_ImageData(
-          _createImageData_2(data_OR_imagedata_OR_sw, sh_OR_sw));
-    }
-    if ((imageDataColorSettings_OR_sh is Map) &&
-        sh_OR_sw != null &&
-        (data_OR_imagedata_OR_sw is int) &&
-        imageDataColorSettings == null) {
-      var imageDataColorSettings_1 =
-          convertDartToNative_Dictionary(imageDataColorSettings_OR_sh);
-      return convertNativeToDart_ImageData(_createImageData_3(
-          data_OR_imagedata_OR_sw, sh_OR_sw, imageDataColorSettings_1));
-    }
-    if (imageDataColorSettings != null &&
-        (imageDataColorSettings_OR_sh is int) &&
-        sh_OR_sw != null &&
-        data_OR_imagedata_OR_sw != null) {
-      var imageDataColorSettings_1 =
-          convertDartToNative_Dictionary(imageDataColorSettings);
-      return convertNativeToDart_ImageData(_createImageData_4(
-          data_OR_imagedata_OR_sw,
-          sh_OR_sw,
-          imageDataColorSettings_OR_sh,
-          imageDataColorSettings_1));
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('createImageData')
-  _createImageData_1(imagedata) native;
-  @JSName('createImageData')
-  _createImageData_2(int sw, sh) native;
-  @JSName('createImageData')
-  _createImageData_3(int sw, sh, imageDataColorSettings) native;
-  @JSName('createImageData')
-  _createImageData_4(data, sw, int? sh, imageDataColorSettings) native;
-
-  CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
-
-  CanvasPattern? createPattern(
-      /*CanvasImageSource*/ image, String repetitionType) native;
-
-  CanvasGradient createRadialGradient(
-      num x0, num y0, num r0, num x1, num y1, num r1) native;
-
-  void drawImage(/*CanvasImageSource*/ image, num sx_OR_x, num sy_OR_y,
-      [num? sw_OR_width,
-      num? height_OR_sh,
-      num? dx,
-      num? dy,
-      num? dw,
-      num? dh]) native;
-
-  void fill([path_OR_winding, String? winding]) native;
-
-  void fillRect(num x, num y, num width, num height) native;
-
-  void fillText(String text, num x, num y, [num? maxWidth]) native;
-
-  ImageData getImageData(int sx, int sy, int sw, int sh) {
-    return convertNativeToDart_ImageData(_getImageData_1(sx, sy, sw, sh));
-  }
-
-  @JSName('getImageData')
-  _getImageData_1(sx, sy, sw, sh) native;
-
-  List<num> getLineDash() native;
-
-  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String? winding])
-      native;
-
-  bool isPointInStroke(path_OR_x, num x_OR_y, [num? y]) native;
-
-  TextMetrics measureText(String text) native;
-
-  void putImageData(ImageData imagedata, int dx, int dy,
-      [int? dirtyX, int? dirtyY, int? dirtyWidth, int? dirtyHeight]) {
-    if (dirtyX == null &&
-        dirtyY == null &&
-        dirtyWidth == null &&
-        dirtyHeight == null) {
-      var imagedata_1 = convertDartToNative_ImageData(imagedata);
-      _putImageData_1(imagedata_1, dx, dy);
-      return;
-    }
-    if (dirtyHeight != null &&
-        dirtyWidth != null &&
-        dirtyY != null &&
-        dirtyX != null) {
-      var imagedata_1 = convertDartToNative_ImageData(imagedata);
-      _putImageData_2(
-          imagedata_1, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('putImageData')
-  void _putImageData_1(imagedata, dx, dy) native;
-  @JSName('putImageData')
-  void _putImageData_2(
-      imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) native;
-
-  void resetTransform() native;
-
-  void restore() native;
-
-  void rotate(num angle) native;
-
-  void save() native;
-
-  void scale(num x, num y) native;
-
-  void setLineDash(List<num> dash) native;
-
-  void setTransform(num a, num b, num c, num d, num e, num f) native;
-
-  void stroke([Path2D? path]) native;
-
-  void strokeRect(num x, num y, num width, num height) native;
-
-  void strokeText(String text, num x, num y, [num? maxWidth]) native;
-
-  void transform(num a, num b, num c, num d, num e, num f) native;
-
-  void translate(num x, num y) native;
-
-  // From CanvasPath
-
-  void arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool? anticlockwise) native;
-
-  void arcTo(num x1, num y1, num x2, num y2, num radius) native;
-
-  void bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y)
-      native;
-
-  void closePath() native;
-
-  void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool? anticlockwise) native;
-
-  void lineTo(num x, num y) native;
-
-  void moveTo(num x, num y) native;
-
-  void quadraticCurveTo(num cpx, num cpy, num x, num y) native;
-
-  void rect(num x, num y, num width, num height) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLOptGroupElement")
-class OptGroupElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory OptGroupElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OptGroupElement() => JS<OptGroupElement>(
-      'returns:OptGroupElement;creates:OptGroupElement;new:true',
-      '#.createElement(#)',
-      document,
-      "optgroup");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  OptGroupElement.created() : super.created();
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  String get label native;
-
-  set label(String value) native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("HTMLOptionElement")
-class OptionElement extends HtmlElement {
-  factory OptionElement(
-      {String data: '', String value: '', bool selected: false}) {
-    return new OptionElement._(data, value, null, selected);
-  }
-
-  factory OptionElement._(
-      [String? data, String? value, bool? defaultSelected, bool? selected]) {
-    if (selected != null) {
-      return OptionElement._create_1(data, value, defaultSelected, selected);
-    }
-    if (defaultSelected != null) {
-      return OptionElement._create_2(data, value, defaultSelected);
-    }
-    if (value != null) {
-      return OptionElement._create_3(data, value);
-    }
-    if (data != null) {
-      return OptionElement._create_4(data);
-    }
-    return OptionElement._create_5();
-  }
-  static OptionElement _create_1(data, value, defaultSelected, selected) => JS(
-      'OptionElement',
-      'new Option(#,#,#,#)',
-      data,
-      value,
-      defaultSelected,
-      selected);
-  static OptionElement _create_2(data, value, defaultSelected) =>
-      JS('OptionElement', 'new Option(#,#,#)', data, value, defaultSelected);
-  static OptionElement _create_3(data, value) =>
-      JS('OptionElement', 'new Option(#,#)', data, value);
-  static OptionElement _create_4(data) =>
-      JS('OptionElement', 'new Option(#)', data);
-  static OptionElement _create_5() => JS('OptionElement', 'new Option()');
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  OptionElement.created() : super.created();
-
-  bool get defaultSelected native;
-
-  set defaultSelected(bool value) native;
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  FormElement? get form native;
-
-  int get index native;
-
-  String get label native;
-
-  set label(String value) native;
-
-  bool get selected native;
-
-  set selected(bool value) native;
-
-  String get value native;
-
-  set value(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OrientationSensor")
-class OrientationSensor extends Sensor {
-  // To suppress missing implicit constructor warnings.
-  factory OrientationSensor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<num>? get quaternion native;
-
-  void populateMatrix(Object targetBuffer) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("HTMLOutputElement")
-class OutputElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory OutputElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OutputElement() => document.createElement("output") as OutputElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  OutputElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('output');
-
-  String get defaultValue native;
-
-  set defaultValue(String value) native;
-
-  FormElement? get form native;
-
-  DomTokenList get htmlFor native;
-
-  @Unstable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get type native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  String get value native;
-
-  set value(String value) native;
-
-  bool get willValidate native;
-
-  bool checkValidity() native;
-
-  bool reportValidity() native;
-
-  void setCustomValidity(String error) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OverconstrainedError")
-class OverconstrainedError extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OverconstrainedError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OverconstrainedError(String constraint, String message) {
-    return OverconstrainedError._create_1(constraint, message);
-  }
-  static OverconstrainedError _create_1(constraint, message) => JS(
-      'OverconstrainedError',
-      'new OverconstrainedError(#,#)',
-      constraint,
-      message);
-
-  String? get constraint native;
-
-  String? get message native;
-
-  String get name native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PageTransitionEvent")
-class PageTransitionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory PageTransitionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PageTransitionEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return PageTransitionEvent._create_1(type, eventInitDict_1);
-    }
-    return PageTransitionEvent._create_2(type);
-  }
-  static PageTransitionEvent _create_1(type, eventInitDict) => JS(
-      'PageTransitionEvent',
-      'new PageTransitionEvent(#,#)',
-      type,
-      eventInitDict);
-  static PageTransitionEvent _create_2(type) =>
-      JS('PageTransitionEvent', 'new PageTransitionEvent(#)', type);
-
-  bool get persisted native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaintRenderingContext2D")
-class PaintRenderingContext2D extends Interceptor implements _CanvasPath {
-  // To suppress missing implicit constructor warnings.
-  factory PaintRenderingContext2D._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Matrix get currentTransform native;
-
-  set currentTransform(Matrix value) native;
-
-  Object? get fillStyle native;
-
-  set fillStyle(Object? value) native;
-
-  String get filter native;
-
-  set filter(String value) native;
-
-  num get globalAlpha native;
-
-  set globalAlpha(num value) native;
-
-  String get globalCompositeOperation native;
-
-  set globalCompositeOperation(String value) native;
-
-  bool get imageSmoothingEnabled native;
-
-  set imageSmoothingEnabled(bool value) native;
-
-  String get imageSmoothingQuality native;
-
-  set imageSmoothingQuality(String value) native;
-
-  String get lineCap native;
-
-  set lineCap(String value) native;
-
-  num get lineDashOffset native;
-
-  set lineDashOffset(num value) native;
-
-  String get lineJoin native;
-
-  set lineJoin(String value) native;
-
-  num get lineWidth native;
-
-  set lineWidth(num value) native;
-
-  num get miterLimit native;
-
-  set miterLimit(num value) native;
-
-  num get shadowBlur native;
-
-  set shadowBlur(num value) native;
-
-  String get shadowColor native;
-
-  set shadowColor(String value) native;
-
-  num get shadowOffsetX native;
-
-  set shadowOffsetX(num value) native;
-
-  num get shadowOffsetY native;
-
-  set shadowOffsetY(num value) native;
-
-  Object? get strokeStyle native;
-
-  set strokeStyle(Object? value) native;
-
-  void beginPath() native;
-
-  void clearRect(num x, num y, num width, num height) native;
-
-  void clip([path_OR_winding, String? winding]) native;
-
-  CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
-
-  CanvasPattern? createPattern(
-      /*CanvasImageSource*/ image, String repetitionType) native;
-
-  CanvasGradient createRadialGradient(
-      num x0, num y0, num r0, num x1, num y1, num r1) native;
-
-  void drawImage(/*CanvasImageSource*/ image, num sx_OR_x, num sy_OR_y,
-      [num? sw_OR_width,
-      num? height_OR_sh,
-      num? dx,
-      num? dy,
-      num? dw,
-      num? dh]) native;
-
-  void fill([path_OR_winding, String? winding]) native;
-
-  void fillRect(num x, num y, num width, num height) native;
-
-  List<num> getLineDash() native;
-
-  bool isPointInPath(path_OR_x, num x_OR_y, [winding_OR_y, String? winding])
-      native;
-
-  bool isPointInStroke(path_OR_x, num x_OR_y, [num? y]) native;
-
-  void resetTransform() native;
-
-  void restore() native;
-
-  void rotate(num angle) native;
-
-  void save() native;
-
-  void scale(num x, num y) native;
-
-  void setLineDash(List<num> dash) native;
-
-  void setTransform(num a, num b, num c, num d, num e, num f) native;
-
-  void stroke([Path2D? path]) native;
-
-  void strokeRect(num x, num y, num width, num height) native;
-
-  void transform(num a, num b, num c, num d, num e, num f) native;
-
-  void translate(num x, num y) native;
-
-  // From CanvasPath
-
-  void arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool? anticlockwise) native;
-
-  void arcTo(num x1, num y1, num x2, num y2, num radius) native;
-
-  void bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y)
-      native;
-
-  void closePath() native;
-
-  void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool? anticlockwise) native;
-
-  void lineTo(num x, num y) native;
-
-  void moveTo(num x, num y) native;
-
-  void quadraticCurveTo(num cpx, num cpy, num x, num y) native;
-
-  void rect(num x, num y, num width, num height) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaintSize")
-class PaintSize extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PaintSize._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get height native;
-
-  num get width native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaintWorkletGlobalScope")
-class PaintWorkletGlobalScope extends WorkletGlobalScope {
-  // To suppress missing implicit constructor warnings.
-  factory PaintWorkletGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get devicePixelRatio native;
-
-  void registerPaint(String name, Object paintCtor) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLParagraphElement")
-class ParagraphElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ParagraphElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ParagraphElement() => JS<ParagraphElement>(
-      'returns:ParagraphElement;creates:ParagraphElement;new:true',
-      '#.createElement(#)',
-      document,
-      "p");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ParagraphElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("HTMLParamElement")
-class ParamElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ParamElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ParamElement() => JS<ParamElement>(
-      'returns:ParamElement;creates:ParamElement;new:true',
-      '#.createElement(#)',
-      document,
-      "param");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ParamElement.created() : super.created();
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get value native;
-
-  set value(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class ParentNode extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ParentNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get _childElementCount native;
-
-  List<Node> get _children native;
-
-  Element? get _firstElementChild native;
-
-  Element? get _lastElementChild native;
-
-  Element? querySelector(String selectors);
-
-  List<Node> _querySelectorAll(String selectors);
-}
-// Copyright (c) 2012, 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.
-
-@Native("PasswordCredential")
-class PasswordCredential extends Credential implements CredentialUserData {
-  // To suppress missing implicit constructor warnings.
-  factory PasswordCredential._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PasswordCredential(data_OR_form) {
-    if ((data_OR_form is Map)) {
-      var data_1 = convertDartToNative_Dictionary(data_OR_form);
-      return PasswordCredential._create_1(data_1);
-    }
-    if ((data_OR_form is FormElement)) {
-      return PasswordCredential._create_2(data_OR_form);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static PasswordCredential _create_1(data_OR_form) =>
-      JS('PasswordCredential', 'new PasswordCredential(#)', data_OR_form);
-  static PasswordCredential _create_2(data_OR_form) =>
-      JS('PasswordCredential', 'new PasswordCredential(#)', data_OR_form);
-
-  Object? get additionalData native;
-
-  set additionalData(Object? value) native;
-
-  String get idName native;
-
-  set idName(String value) native;
-
-  String get password native;
-
-  String get passwordName native;
-
-  set passwordName(String value) native;
-
-  // From CredentialUserData
-
-  @JSName('iconURL')
-  String get iconUrl native;
-
-  String get name native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Path2D")
-class Path2D extends Interceptor implements _CanvasPath {
-  // To suppress missing implicit constructor warnings.
-  factory Path2D._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Path2D([path_OR_text]) {
-    if (path_OR_text == null) {
-      return Path2D._create_1();
-    }
-    if ((path_OR_text is Path2D)) {
-      return Path2D._create_2(path_OR_text);
-    }
-    if ((path_OR_text is String)) {
-      return Path2D._create_3(path_OR_text);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static Path2D _create_1() => JS('Path2D', 'new Path2D()');
-  static Path2D _create_2(path_OR_text) =>
-      JS('Path2D', 'new Path2D(#)', path_OR_text);
-  static Path2D _create_3(path_OR_text) =>
-      JS('Path2D', 'new Path2D(#)', path_OR_text);
-
-  void addPath(Path2D path, [Matrix? transform]) native;
-
-  // From CanvasPath
-
-  void arc(num x, num y, num radius, num startAngle, num endAngle,
-      bool? anticlockwise) native;
-
-  void arcTo(num x1, num y1, num x2, num y2, num radius) native;
-
-  void bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y)
-      native;
-
-  void closePath() native;
-
-  void ellipse(num x, num y, num radiusX, num radiusY, num rotation,
-      num startAngle, num endAngle, bool? anticlockwise) native;
-
-  void lineTo(num x, num y) native;
-
-  void moveTo(num x, num y) native;
-
-  void quadraticCurveTo(num cpx, num cpy, num x, num y) native;
-
-  void rect(num x, num y, num width, num height) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaymentAddress")
-class PaymentAddress extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PaymentAddress._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<String> get addressLine native;
-
-  String get city native;
-
-  String get country native;
-
-  String get dependentLocality native;
-
-  String get languageCode native;
-
-  String get organization native;
-
-  String get phone native;
-
-  String get postalCode native;
-
-  String get recipient native;
-
-  String get region native;
-
-  String get sortingCode native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaymentInstruments")
-class PaymentInstruments extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PaymentInstruments._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future clear() => promiseToFuture(JS("", "#.clear()", this));
-
-  Future<bool> delete(String instrumentKey) =>
-      promiseToFuture<bool>(JS("", "#.delete(#)", this, instrumentKey));
-
-  Future<Map<String, dynamic>?> get(String instrumentKey) =>
-      promiseToFutureAsMap(JS("", "#.get(#)", this, instrumentKey));
-
-  Future has(String instrumentKey) =>
-      promiseToFuture(JS("", "#.has(#)", this, instrumentKey));
-
-  Future<List<dynamic>> keys() =>
-      promiseToFuture<List<dynamic>>(JS("", "#.keys()", this));
-
-  Future set(String instrumentKey, Map details) {
-    var details_dict = convertDartToNative_Dictionary(details);
-    return promiseToFuture(
-        JS("", "#.set(#, #)", this, instrumentKey, details_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaymentManager")
-class PaymentManager extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PaymentManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  PaymentInstruments get instruments native;
-
-  String get userHint native;
-
-  set userHint(String value) native;
-}
-// Copyright (c) 2015, 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.
-
-@Native("PaymentRequest")
-class PaymentRequest extends EventTarget {
-  factory PaymentRequest(List<Map> methodData, Map details, [Map? options]) {
-    var methodData_1 = [];
-    for (var i in methodData) {
-      methodData_1.add(convertDartToNative_Dictionary(i));
-    }
-    if (options != null) {
-      var details_1 = convertDartToNative_Dictionary(details);
-      var options_2 = convertDartToNative_Dictionary(options);
-      return PaymentRequest._create_1(methodData_1, details_1, options_2);
-    }
-    var details_1 = convertDartToNative_Dictionary(details);
-    return PaymentRequest._create_2(methodData_1, details_1);
-  }
-
-  static PaymentRequest _create_1(methodData, details, options) => JS(
-      'PaymentRequest',
-      'new PaymentRequest(#,#,#)',
-      methodData,
-      details,
-      options);
-  static PaymentRequest _create_2(methodData, details) =>
-      JS('PaymentRequest', 'new PaymentRequest(#,#)', methodData, details);
-
-  // To suppress missing implicit constructor warnings.
-  factory PaymentRequest._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get id native;
-
-  PaymentAddress? get shippingAddress native;
-
-  String? get shippingOption native;
-
-  String? get shippingType native;
-
-  Future abort() => promiseToFuture(JS("", "#.abort()", this));
-
-  Future<bool> canMakePayment() =>
-      promiseToFuture<bool>(JS("", "#.canMakePayment()", this));
-
-  Future<PaymentResponse> show() =>
-      promiseToFuture<PaymentResponse>(JS("", "#.show()", this));
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("PaymentRequestEvent")
-class PaymentRequestEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory PaymentRequestEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PaymentRequestEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return PaymentRequestEvent._create_1(type, eventInitDict_1);
-  }
-  static PaymentRequestEvent _create_1(type, eventInitDict) => JS(
-      'PaymentRequestEvent',
-      'new PaymentRequestEvent(#,#)',
-      type,
-      eventInitDict);
-
-  String get instrumentKey native;
-
-  List get methodData native;
-
-  List get modifiers native;
-
-  String get paymentRequestId native;
-
-  String get paymentRequestOrigin native;
-
-  String get topLevelOrigin native;
-
-  Object get total native;
-
-  Future<WindowClient> openWindow(String url) =>
-      promiseToFuture<WindowClient>(JS("", "#.openWindow(#)", this, url));
-
-  void respondWith(Future response) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaymentRequestUpdateEvent")
-class PaymentRequestUpdateEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory PaymentRequestUpdateEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PaymentRequestUpdateEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return PaymentRequestUpdateEvent._create_1(type, eventInitDict_1);
-    }
-    return PaymentRequestUpdateEvent._create_2(type);
-  }
-  static PaymentRequestUpdateEvent _create_1(type, eventInitDict) => JS(
-      'PaymentRequestUpdateEvent',
-      'new PaymentRequestUpdateEvent(#,#)',
-      type,
-      eventInitDict);
-  static PaymentRequestUpdateEvent _create_2(type) =>
-      JS('PaymentRequestUpdateEvent', 'new PaymentRequestUpdateEvent(#)', type);
-
-  void updateWith(Future detailsPromise) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PaymentResponse")
-class PaymentResponse extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PaymentResponse._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Object get details native;
-
-  String get methodName native;
-
-  String? get payerEmail native;
-
-  String? get payerName native;
-
-  String? get payerPhone native;
-
-  String get requestId native;
-
-  PaymentAddress? get shippingAddress native;
-
-  String? get shippingOption native;
-
-  Future complete([String? paymentResult]) =>
-      promiseToFuture(JS("", "#.complete(#)", this, paymentResult));
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE)
-@Native("Performance")
-class Performance extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory Performance._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.performance)');
-
-  MemoryInfo? get memory native;
-
-  PerformanceNavigation get navigation native;
-
-  num get timeOrigin native;
-
-  PerformanceTiming get timing native;
-
-  void clearMarks(String? markName) native;
-
-  void clearMeasures(String? measureName) native;
-
-  void clearResourceTimings() native;
-
-  List<PerformanceEntry> getEntries() native;
-
-  List<PerformanceEntry> getEntriesByName(String name, String? entryType)
-      native;
-
-  List<PerformanceEntry> getEntriesByType(String entryType) native;
-
-  void mark(String markName) native;
-
-  void measure(String measureName, String? startMark, String? endMark) native;
-
-  double now() native;
-
-  void setResourceTimingBufferSize(int maxSize) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceEntry")
-class PerformanceEntry extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceEntry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get duration native;
-
-  String get entryType native;
-
-  String get name native;
-
-  num get startTime native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceLongTaskTiming")
-class PerformanceLongTaskTiming extends PerformanceEntry {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceLongTaskTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<TaskAttributionTiming> get attribution native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceMark")
-class PerformanceMark extends PerformanceEntry {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceMark._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceMeasure")
-class PerformanceMeasure extends PerformanceEntry {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceMeasure._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("PerformanceNavigation")
-class PerformanceNavigation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceNavigation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int TYPE_BACK_FORWARD = 2;
-
-  static const int TYPE_NAVIGATE = 0;
-
-  static const int TYPE_RELOAD = 1;
-
-  static const int TYPE_RESERVED = 255;
-
-  int get redirectCount native;
-
-  int get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceNavigationTiming")
-class PerformanceNavigationTiming extends PerformanceResourceTiming {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceNavigationTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get domComplete native;
-
-  num get domContentLoadedEventEnd native;
-
-  num get domContentLoadedEventStart native;
-
-  num get domInteractive native;
-
-  num get loadEventEnd native;
-
-  num get loadEventStart native;
-
-  int get redirectCount native;
-
-  String get type native;
-
-  num get unloadEventEnd native;
-
-  num get unloadEventStart native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceObserver")
-class PerformanceObserver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceObserver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PerformanceObserver(PerformanceObserverCallback callback) {
-    var callback_1 = convertDartClosureToJS(callback, 2);
-    return PerformanceObserver._create_1(callback_1);
-  }
-  static PerformanceObserver _create_1(callback) =>
-      JS('PerformanceObserver', 'new PerformanceObserver(#)', callback);
-
-  void disconnect() native;
-
-  void observe(Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    _observe_1(options_1);
-    return;
-  }
-
-  @JSName('observe')
-  void _observe_1(options) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void PerformanceObserverCallback(
-    PerformanceObserverEntryList entries, PerformanceObserver observer);
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceObserverEntryList")
-class PerformanceObserverEntryList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceObserverEntryList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<PerformanceEntry> getEntries() native;
-
-  List<PerformanceEntry> getEntriesByName(String name, String? entryType)
-      native;
-
-  List<PerformanceEntry> getEntriesByType(String entryType) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformancePaintTiming")
-class PerformancePaintTiming extends PerformanceEntry {
-  // To suppress missing implicit constructor warnings.
-  factory PerformancePaintTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceResourceTiming")
-class PerformanceResourceTiming extends PerformanceEntry {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceResourceTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get connectEnd native;
-
-  num get connectStart native;
-
-  int get decodedBodySize native;
-
-  num get domainLookupEnd native;
-
-  num get domainLookupStart native;
-
-  int get encodedBodySize native;
-
-  num get fetchStart native;
-
-  String get initiatorType native;
-
-  String get nextHopProtocol native;
-
-  num get redirectEnd native;
-
-  num get redirectStart native;
-
-  num get requestStart native;
-
-  num get responseEnd native;
-
-  num get responseStart native;
-
-  num get secureConnectionStart native;
-
-  List<PerformanceServerTiming> get serverTiming native;
-
-  int get transferSize native;
-
-  num get workerStart native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PerformanceServerTiming")
-class PerformanceServerTiming extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceServerTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get description native;
-
-  num get duration native;
-
-  String get name native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("PerformanceTiming")
-class PerformanceTiming extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PerformanceTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get connectEnd native;
-
-  int get connectStart native;
-
-  int get domComplete native;
-
-  int get domContentLoadedEventEnd native;
-
-  int get domContentLoadedEventStart native;
-
-  int get domInteractive native;
-
-  int get domLoading native;
-
-  int get domainLookupEnd native;
-
-  int get domainLookupStart native;
-
-  int get fetchStart native;
-
-  int get loadEventEnd native;
-
-  int get loadEventStart native;
-
-  int get navigationStart native;
-
-  int get redirectEnd native;
-
-  int get redirectStart native;
-
-  int get requestStart native;
-
-  int get responseEnd native;
-
-  int get responseStart native;
-
-  int get secureConnectionStart native;
-
-  int get unloadEventEnd native;
-
-  int get unloadEventStart native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PermissionStatus")
-class PermissionStatus extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory PermissionStatus._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  String get state native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("Permissions")
-class Permissions extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Permissions._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<PermissionStatus> query(Map permission) {
-    var permission_dict = convertDartToNative_Dictionary(permission);
-    return promiseToFuture<PermissionStatus>(
-        JS("", "#.query(#)", this, permission_dict));
-  }
-
-  Future<PermissionStatus> request(Map permissions) {
-    var permissions_dict = convertDartToNative_Dictionary(permissions);
-    return promiseToFuture<PermissionStatus>(
-        JS("", "#.request(#)", this, permissions_dict));
-  }
-
-  Future<PermissionStatus> requestAll(List<Map> permissions) =>
-      promiseToFuture<PermissionStatus>(
-          JS("", "#.requestAll(#)", this, permissions));
-
-  Future<PermissionStatus> revoke(Map permission) {
-    var permission_dict = convertDartToNative_Dictionary(permission);
-    return promiseToFuture<PermissionStatus>(
-        JS("", "#.revoke(#)", this, permission_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("PhotoCapabilities")
-class PhotoCapabilities extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PhotoCapabilities._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List get fillLightMode native;
-
-  MediaSettingsRange get imageHeight native;
-
-  MediaSettingsRange get imageWidth native;
-
-  String get redEyeReduction native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLPictureElement")
-class PictureElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory PictureElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  PictureElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("Plugin")
-class Plugin extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Plugin._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get description native;
-
-  String get filename native;
-
-  int get length native;
-
-  String get name native;
-
-  MimeType? item(int index) native;
-
-  MimeType? namedItem(String name) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PluginArray")
-class PluginArray extends Interceptor
-    with ListMixin<Plugin>, ImmutableListMixin<Plugin>
-    implements JavaScriptIndexingBehavior<Plugin>, List<Plugin> {
-  // To suppress missing implicit constructor warnings.
-  factory PluginArray._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Plugin operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Plugin", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Plugin value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Plugin> mixins.
-  // Plugin is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Plugin get first {
-    if (this.length > 0) {
-      return JS('Plugin', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Plugin get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Plugin', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Plugin get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Plugin', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Plugin elementAt(int index) => this[index];
-  // -- end List<Plugin> mixins.
-
-  Plugin? item(int index) native;
-
-  Plugin? namedItem(String name) native;
-
-  void refresh(bool? reload) native;
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("PointerEvent")
-class PointerEvent extends MouseEvent {
-  // To suppress missing implicit constructor warnings.
-  factory PointerEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PointerEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return PointerEvent._create_1(type, eventInitDict_1);
-    }
-    return PointerEvent._create_2(type);
-  }
-  static PointerEvent _create_1(type, eventInitDict) =>
-      JS('PointerEvent', 'new PointerEvent(#,#)', type, eventInitDict);
-  static PointerEvent _create_2(type) =>
-      JS('PointerEvent', 'new PointerEvent(#)', type);
-
-  num get height native;
-
-  bool get isPrimary native;
-
-  int get pointerId native;
-
-  String get pointerType native;
-
-  num get pressure native;
-
-  num get tangentialPressure native;
-
-  int get tiltX native;
-
-  int get tiltY native;
-
-  int get twist native;
-
-  num get width native;
-
-  List<PointerEvent> getCoalescedEvents() native;
-
-  /**
-   * PointerEvent used for both touch and mouse.  To check if touch is supported
-   * call the property TouchEvent.supported
-   */
-  static bool get supported {
-    try {
-      return PointerEvent('pointerover') is PointerEvent;
-    } catch (_) {}
-    return false;
-  }
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("PopStateEvent")
-class PopStateEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory PopStateEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PopStateEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return PopStateEvent._create_1(type, eventInitDict_1);
-    }
-    return PopStateEvent._create_2(type);
-  }
-  static PopStateEvent _create_1(type, eventInitDict) =>
-      JS('PopStateEvent', 'new PopStateEvent(#,#)', type, eventInitDict);
-  static PopStateEvent _create_2(type) =>
-      JS('PopStateEvent', 'new PopStateEvent(#)', type);
-
-  dynamic get state =>
-      convertNativeToDart_SerializedScriptValue(this._get_state);
-  @JSName('state')
-  @annotation_Creates_SerializedScriptValue
-  @annotation_Returns_SerializedScriptValue
-  dynamic get _get_state native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Unstable()
-typedef void _PositionCallback(Geoposition position);
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("PositionError")
-class PositionError extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PositionError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int PERMISSION_DENIED = 1;
-
-  static const int POSITION_UNAVAILABLE = 2;
-
-  static const int TIMEOUT = 3;
-
-  int get code native;
-
-  String get message native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Unstable()
-typedef void _PositionErrorCallback(PositionError error);
-// Copyright (c) 2012, 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.
-
-@Native("HTMLPreElement")
-class PreElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory PreElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PreElement() => JS<PreElement>(
-      'returns:PreElement;creates:PreElement;new:true',
-      '#.createElement(#)',
-      document,
-      "pre");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  PreElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("Presentation")
-class Presentation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Presentation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  PresentationRequest? get defaultRequest native;
-
-  set defaultRequest(PresentationRequest? value) native;
-
-  PresentationReceiver? get receiver native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationAvailability")
-class PresentationAvailability extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationAvailability._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  bool get value native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationConnection")
-class PresentationConnection extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationConnection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  String get binaryType native;
-
-  set binaryType(String value) native;
-
-  String get id native;
-
-  String get state native;
-
-  String get url native;
-
-  void close() native;
-
-  void send(data_OR_message) native;
-
-  void terminate() native;
-
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationConnectionAvailableEvent")
-class PresentationConnectionAvailableEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationConnectionAvailableEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PresentationConnectionAvailableEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return PresentationConnectionAvailableEvent._create_1(
-        type, eventInitDict_1);
-  }
-  static PresentationConnectionAvailableEvent _create_1(type, eventInitDict) =>
-      JS('PresentationConnectionAvailableEvent',
-          'new PresentationConnectionAvailableEvent(#,#)', type, eventInitDict);
-
-  PresentationConnection get connection native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationConnectionCloseEvent")
-class PresentationConnectionCloseEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationConnectionCloseEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PresentationConnectionCloseEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return PresentationConnectionCloseEvent._create_1(type, eventInitDict_1);
-  }
-  static PresentationConnectionCloseEvent _create_1(type, eventInitDict) => JS(
-      'PresentationConnectionCloseEvent',
-      'new PresentationConnectionCloseEvent(#,#)',
-      type,
-      eventInitDict);
-
-  String get message native;
-
-  String get reason native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationConnectionList")
-class PresentationConnectionList extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationConnectionList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<PresentationConnection> get connections native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationReceiver")
-class PresentationReceiver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationReceiver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<PresentationConnectionList> get connectionList =>
-      promiseToFuture<PresentationConnectionList>(
-          JS("", "#.connectionList", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("PresentationRequest")
-class PresentationRequest extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory PresentationRequest._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PresentationRequest(url_OR_urls) {
-    if ((url_OR_urls is String)) {
-      return PresentationRequest._create_1(url_OR_urls);
-    }
-    if ((url_OR_urls is List<String>)) {
-      List urls_1 = convertDartToNative_StringArray(url_OR_urls);
-      return PresentationRequest._create_2(urls_1);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static PresentationRequest _create_1(url_OR_urls) =>
-      JS('PresentationRequest', 'new PresentationRequest(#)', url_OR_urls);
-  static PresentationRequest _create_2(url_OR_urls) =>
-      JS('PresentationRequest', 'new PresentationRequest(#)', url_OR_urls);
-
-  Future<PresentationAvailability> getAvailability() =>
-      promiseToFuture<PresentationAvailability>(
-          JS("", "#.getAvailability()", this));
-
-  Future<PresentationConnection> reconnect(String id) =>
-      promiseToFuture<PresentationConnection>(
-          JS("", "#.reconnect(#)", this, id));
-
-  Future<PresentationConnection> start() =>
-      promiseToFuture<PresentationConnection>(JS("", "#.start()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("ProcessingInstruction")
-class ProcessingInstruction extends CharacterData {
-  // To suppress missing implicit constructor warnings.
-  factory ProcessingInstruction._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  StyleSheet? get sheet native;
-
-  String get target native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("HTMLProgressElement")
-class ProgressElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ProgressElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ProgressElement() =>
-      document.createElement("progress") as ProgressElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ProgressElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('progress');
-
-  @Unstable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  num get max native;
-
-  set max(num value) native;
-
-  num get position native;
-
-  num get value native;
-
-  set value(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ProgressEvent")
-class ProgressEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory ProgressEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ProgressEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return ProgressEvent._create_1(type, eventInitDict_1);
-    }
-    return ProgressEvent._create_2(type);
-  }
-  static ProgressEvent _create_1(type, eventInitDict) =>
-      JS('ProgressEvent', 'new ProgressEvent(#,#)', type, eventInitDict);
-  static ProgressEvent _create_2(type) =>
-      JS('ProgressEvent', 'new ProgressEvent(#)', type);
-
-  bool get lengthComputable native;
-
-  int get loaded native;
-
-  int get total native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PromiseRejectionEvent")
-class PromiseRejectionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory PromiseRejectionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PromiseRejectionEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return PromiseRejectionEvent._create_1(type, eventInitDict_1);
-  }
-  static PromiseRejectionEvent _create_1(type, eventInitDict) => JS(
-      'PromiseRejectionEvent',
-      'new PromiseRejectionEvent(#,#)',
-      type,
-      eventInitDict);
-
-  Future get promise => promiseToFuture(JS("", "#.promise", this));
-
-  Object? get reason native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PublicKeyCredential")
-class PublicKeyCredential extends Credential {
-  // To suppress missing implicit constructor warnings.
-  factory PublicKeyCredential._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ByteBuffer get rawId native;
-
-  AuthenticatorResponse get response native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PushEvent")
-class PushEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory PushEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PushEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return PushEvent._create_1(type, eventInitDict_1);
-    }
-    return PushEvent._create_2(type);
-  }
-  static PushEvent _create_1(type, eventInitDict) =>
-      JS('PushEvent', 'new PushEvent(#,#)', type, eventInitDict);
-  static PushEvent _create_2(type) => JS('PushEvent', 'new PushEvent(#)', type);
-
-  PushMessageData? get data native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PushManager")
-class PushManager extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PushManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static List<String> get supportedContentEncodings native;
-
-  Future<PushSubscription> getSubscription() =>
-      promiseToFuture<PushSubscription>(JS("", "#.getSubscription()", this));
-
-  Future permissionState([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(JS("", "#.permissionState(#)", this, options_dict));
-  }
-
-  Future<PushSubscription> subscribe([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<PushSubscription>(
-        JS("", "#.subscribe(#)", this, options_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("PushMessageData")
-class PushMessageData extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PushMessageData._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ByteBuffer arrayBuffer() native;
-
-  Blob blob() native;
-
-  Object json() native;
-
-  String text() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PushSubscription")
-class PushSubscription extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PushSubscription._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get endpoint native;
-
-  int get expirationTime native;
-
-  PushSubscriptionOptions get options native;
-
-  ByteBuffer? getKey(String name) native;
-
-  Future<bool> unsubscribe() =>
-      promiseToFuture<bool>(JS("", "#.unsubscribe()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("PushSubscriptionOptions")
-class PushSubscriptionOptions extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PushSubscriptionOptions._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ByteBuffer? get applicationServerKey native;
-
-  bool get userVisibleOnly native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLQuoteElement")
-class QuoteElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory QuoteElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory QuoteElement() => JS<QuoteElement>(
-      'returns:QuoteElement;creates:QuoteElement;new:true',
-      '#.createElement(#)',
-      document,
-      "q");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  QuoteElement.created() : super.created();
-
-  String get cite native;
-
-  set cite(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void RtcPeerConnectionErrorCallback(DomException exception);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void _RtcSessionDescriptionCallback(RtcSessionDescription sdp);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void RtcStatsCallback(RtcStatsResponse response);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Unstable()
-@Native("Range")
-class Range extends Interceptor {
-  factory Range() => document.createRange();
-
-  factory Range.fromPoint(Point point) =>
-      document._caretRangeFromPoint(point.x.toInt(), point.y.toInt());
-  // To suppress missing implicit constructor warnings.
-  factory Range._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int END_TO_END = 2;
-
-  static const int END_TO_START = 3;
-
-  static const int START_TO_END = 1;
-
-  static const int START_TO_START = 0;
-
-  bool get collapsed native;
-
-  Node get commonAncestorContainer native;
-
-  Node get endContainer native;
-
-  int get endOffset native;
-
-  Node get startContainer native;
-
-  int get startOffset native;
-
-  DocumentFragment cloneContents() native;
-
-  Range cloneRange() native;
-
-  void collapse([bool? toStart]) native;
-
-  int compareBoundaryPoints(int how, Range sourceRange) native;
-
-  int comparePoint(Node node, int offset) native;
-
-  DocumentFragment createContextualFragment(String fragment) native;
-
-  void deleteContents() native;
-
-  void detach() native;
-
-  void expand(String? unit) native;
-
-  DocumentFragment extractContents() native;
-
-  Rectangle getBoundingClientRect() native;
-
-  @JSName('getClientRects')
-  @Returns('DomRectList')
-  @Creates('DomRectList')
-  List<Rectangle> _getClientRects() native;
-
-  void insertNode(Node node) native;
-
-  bool isPointInRange(Node node, int offset) native;
-
-  void selectNode(Node node) native;
-
-  void selectNodeContents(Node node) native;
-
-  void setEnd(Node node, int offset) native;
-
-  void setEndAfter(Node node) native;
-
-  void setEndBefore(Node node) native;
-
-  void setStart(Node node, int offset) native;
-
-  void setStartAfter(Node node) native;
-
-  void setStartBefore(Node node) native;
-
-  void surroundContents(Node newParent) native;
-
-  List<Rectangle> getClientRects() {
-    var value = _getClientRects();
-
-    // If no prototype we need one for the world to hookup to the proper Dart class.
-    var jsProto = JS('', '#.prototype', value);
-    if (jsProto == null) {
-      JS('', '#.prototype = Object.create(null)', value);
-    }
-
-    applyExtension('DOMRectList', value);
-
-    return value;
-  }
-
-  /**
-   * Checks if createContextualFragment is supported.
-   *
-   * See also:
-   *
-   * * [createContextualFragment]
-   */
-  static bool get supportsCreateContextualFragment =>
-      JS('bool', '("createContextualFragment" in window.Range.prototype)');
-}
-// Copyright (c) 2012, 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.
-
-@Native("RelatedApplication")
-class RelatedApplication extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RelatedApplication._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get id native;
-
-  String get platform native;
-
-  String get url native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RelativeOrientationSensor")
-class RelativeOrientationSensor extends OrientationSensor {
-  // To suppress missing implicit constructor warnings.
-  factory RelativeOrientationSensor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RelativeOrientationSensor([Map? sensorOptions]) {
-    if (sensorOptions != null) {
-      var sensorOptions_1 = convertDartToNative_Dictionary(sensorOptions);
-      return RelativeOrientationSensor._create_1(sensorOptions_1);
-    }
-    return RelativeOrientationSensor._create_2();
-  }
-  static RelativeOrientationSensor _create_1(sensorOptions) => JS(
-      'RelativeOrientationSensor',
-      'new RelativeOrientationSensor(#)',
-      sensorOptions);
-  static RelativeOrientationSensor _create_2() =>
-      JS('RelativeOrientationSensor', 'new RelativeOrientationSensor()');
-}
-// Copyright (c) 2012, 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.
-
-@Native("RemotePlayback")
-class RemotePlayback extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory RemotePlayback._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get state native;
-
-  Future cancelWatchAvailability([int? id]) =>
-      promiseToFuture(JS("", "#.cancelWatchAvailability(#)", this, id));
-
-  Future prompt() => promiseToFuture(JS("", "#.prompt()", this));
-
-  Future<int> watchAvailability(RemotePlaybackAvailabilityCallback callback) =>
-      promiseToFuture<int>(JS("", "#.watchAvailability(#)", this, callback));
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void RemotePlaybackAvailabilityCallback(bool available);
-// Copyright (c) 2012, 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.
-
-@Native("ReportBody")
-class ReportBody extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ReportBody._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("ReportingObserver")
-class ReportingObserver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ReportingObserver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ReportingObserver(ReportingObserverCallback callback) {
-    var callback_1 = convertDartClosureToJS(callback, 2);
-    return ReportingObserver._create_1(callback_1);
-  }
-  static ReportingObserver _create_1(callback) =>
-      JS('ReportingObserver', 'new ReportingObserver(#)', callback);
-
-  void disconnect() native;
-
-  void observe() native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void ReportingObserverCallback(
-    List reports, ReportingObserver observer);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void RequestAnimationFrameCallback(num highResTime);
-// Copyright (c) 2012, 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.
-
-@Native("ResizeObserver")
-class ResizeObserver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ResizeObserver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ResizeObserver(ResizeObserverCallback callback) {
-    var callback_1 = convertDartClosureToJS(callback, 2);
-    return ResizeObserver._create_1(callback_1);
-  }
-  static ResizeObserver _create_1(callback) =>
-      JS('ResizeObserver', 'new ResizeObserver(#)', callback);
-
-  void disconnect() native;
-
-  void observe(Element target) native;
-
-  void unobserve(Element target) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void ResizeObserverCallback(List entries, ResizeObserver observer);
-// Copyright (c) 2012, 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.
-
-@Native("ResizeObserverEntry")
-class ResizeObserverEntry extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ResizeObserverEntry._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  DomRectReadOnly get contentRect native;
-
-  Element get target native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCCertificate")
-class RtcCertificate extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RtcCertificate._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get expires native;
-
-  List<Map> getFingerprints() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCDataChannel,DataChannel")
-class RtcDataChannel extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory RtcDataChannel._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `close` events to event
-   * handlers that are not necessarily instances of [RtcDataChannel].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> closeEvent =
-      const EventStreamProvider<Event>('close');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [RtcDataChannel].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [RtcDataChannel].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  /**
-   * Static factory designed to expose `open` events to event
-   * handlers that are not necessarily instances of [RtcDataChannel].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> openEvent =
-      const EventStreamProvider<Event>('open');
-
-  String get binaryType native;
-
-  set binaryType(String value) native;
-
-  int get bufferedAmount native;
-
-  int get bufferedAmountLowThreshold native;
-
-  set bufferedAmountLowThreshold(int value) native;
-
-  int get id native;
-
-  String get label native;
-
-  int get maxRetransmitTime native;
-
-  int get maxRetransmits native;
-
-  bool get negotiated native;
-
-  bool get ordered native;
-
-  String get protocol native;
-
-  String get readyState native;
-
-  bool get reliable native;
-
-  void close() native;
-
-  void send(data) native;
-
-  @JSName('send')
-  void sendBlob(Blob data) native;
-
-  @JSName('send')
-  void sendByteBuffer(ByteBuffer data) native;
-
-  @JSName('send')
-  void sendString(String data) native;
-
-  @JSName('send')
-  void sendTypedData(TypedData data) native;
-
-  /// Stream of `close` events handled by this [RtcDataChannel].
-  Stream<Event> get onClose => closeEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [RtcDataChannel].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `message` events handled by this [RtcDataChannel].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  /// Stream of `open` events handled by this [RtcDataChannel].
-  Stream<Event> get onOpen => openEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCDataChannelEvent")
-class RtcDataChannelEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory RtcDataChannelEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RtcDataChannelEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return RtcDataChannelEvent._create_1(type, eventInitDict_1);
-  }
-  static RtcDataChannelEvent _create_1(type, eventInitDict) => JS(
-      'RtcDataChannelEvent',
-      'new RTCDataChannelEvent(#,#)',
-      type,
-      eventInitDict);
-
-  RtcDataChannel get channel native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCDTMFSender")
-class RtcDtmfSender extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory RtcDtmfSender._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `tonechange` events to event
-   * handlers that are not necessarily instances of [RtcDtmfSender].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<RtcDtmfToneChangeEvent> toneChangeEvent =
-      const EventStreamProvider<RtcDtmfToneChangeEvent>('tonechange');
-
-  @JSName('canInsertDTMF')
-  bool get canInsertDtmf native;
-
-  int get duration native;
-
-  int get interToneGap native;
-
-  String get toneBuffer native;
-
-  MediaStreamTrack get track native;
-
-  @JSName('insertDTMF')
-  void insertDtmf(String tones, [int? duration, int? interToneGap]) native;
-
-  /// Stream of `tonechange` events handled by this [RtcDtmfSender].
-  Stream<RtcDtmfToneChangeEvent> get onToneChange =>
-      toneChangeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCDTMFToneChangeEvent")
-class RtcDtmfToneChangeEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory RtcDtmfToneChangeEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RtcDtmfToneChangeEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return RtcDtmfToneChangeEvent._create_1(type, eventInitDict_1);
-  }
-  static RtcDtmfToneChangeEvent _create_1(type, eventInitDict) => JS(
-      'RtcDtmfToneChangeEvent',
-      'new RTCDTMFToneChangeEvent(#,#)',
-      type,
-      eventInitDict);
-
-  String get tone native;
-}
-// Copyright (c) 2013, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("RTCIceCandidate,mozRTCIceCandidate")
-class RtcIceCandidate extends Interceptor {
-  factory RtcIceCandidate(Map dictionary) {
-    var constructorName = JS('', 'window[#]', 'RTCIceCandidate');
-    return JS('RtcIceCandidate', 'new #(#)', constructorName,
-        convertDartToNative_SerializedScriptValue(dictionary));
-  }
-  // To suppress missing implicit constructor warnings.
-  factory RtcIceCandidate._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get candidate native;
-
-  set candidate(String value) native;
-
-  int get sdpMLineIndex native;
-
-  set sdpMLineIndex(int value) native;
-
-  String get sdpMid native;
-
-  set sdpMid(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCLegacyStatsReport")
-class RtcLegacyStatsReport extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RtcLegacyStatsReport._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get id native;
-
-  DateTime get timestamp => convertNativeToDart_DateTime(this._get_timestamp);
-  @JSName('timestamp')
-  dynamic get _get_timestamp native;
-
-  String get type native;
-
-  List<String> names() native;
-
-  String stat(String name) native;
-}
-// Copyright (c) 2013, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("RTCPeerConnection,webkitRTCPeerConnection,mozRTCPeerConnection")
-class RtcPeerConnection extends EventTarget {
-  factory RtcPeerConnection(Map rtcIceServers, [Map? mediaConstraints]) {
-    var constructorName =
-        JS('RtcPeerConnection', 'window[#]', 'RTCPeerConnection');
-    if (mediaConstraints != null) {
-      return JS(
-          'RtcPeerConnection',
-          'new #(#,#)',
-          constructorName,
-          convertDartToNative_SerializedScriptValue(rtcIceServers),
-          convertDartToNative_SerializedScriptValue(mediaConstraints));
-    } else {
-      return JS('RtcPeerConnection', 'new #(#)', constructorName,
-          convertDartToNative_SerializedScriptValue(rtcIceServers));
-    }
-  }
-
-  /**
-   * Checks if Real Time Communication (RTC) APIs are supported and enabled on
-   * the current platform.
-   */
-  static bool get supported {
-    // Currently in Firefox some of the RTC elements are defined but throw an
-    // error unless the user has specifically enabled them in their
-    // about:config. So we have to construct an element to actually test if RTC
-    // is supported at the given time.
-    try {
-      new RtcPeerConnection({
-        "iceServers": [
-          {"url": "stun:localhost"}
-        ]
-      });
-      return true;
-    } catch (_) {
-      return false;
-    }
-    return false;
-  }
-
-  /**
-  * Temporarily exposes _getStats and old getStats as getLegacyStats until Chrome fully supports
-  * new getStats API.
-  */
-  Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack? selector]) {
-    var completer = new Completer<RtcStatsResponse>();
-    _getStats((value) {
-      completer.complete(value);
-    }, selector);
-    return completer.future;
-  }
-
-  @JSName('getStats')
-  Future _getStats(
-      [RtcStatsCallback? successCallback, MediaStreamTrack? selector]) native;
-
-  static Future generateCertificate(/*AlgorithmIdentifier*/ keygenAlgorithm) =>
-      JS('dynamic', 'generateCertificate(#)', keygenAlgorithm);
-
-  // To suppress missing implicit constructor warnings.
-  factory RtcPeerConnection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `addstream` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MediaStreamEvent> addStreamEvent =
-      const EventStreamProvider<MediaStreamEvent>('addstream');
-
-  /**
-   * Static factory designed to expose `datachannel` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<RtcDataChannelEvent> dataChannelEvent =
-      const EventStreamProvider<RtcDataChannelEvent>('datachannel');
-
-  /**
-   * Static factory designed to expose `icecandidate` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<RtcPeerConnectionIceEvent>
-      iceCandidateEvent =
-      const EventStreamProvider<RtcPeerConnectionIceEvent>('icecandidate');
-
-  /**
-   * Static factory designed to expose `iceconnectionstatechange` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> iceConnectionStateChangeEvent =
-      const EventStreamProvider<Event>('iceconnectionstatechange');
-
-  /**
-   * Static factory designed to expose `negotiationneeded` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> negotiationNeededEvent =
-      const EventStreamProvider<Event>('negotiationneeded');
-
-  /**
-   * Static factory designed to expose `removestream` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MediaStreamEvent> removeStreamEvent =
-      const EventStreamProvider<MediaStreamEvent>('removestream');
-
-  /**
-   * Static factory designed to expose `signalingstatechange` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> signalingStateChangeEvent =
-      const EventStreamProvider<Event>('signalingstatechange');
-
-  /**
-   * Static factory designed to expose `track` events to event
-   * handlers that are not necessarily instances of [RtcPeerConnection].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<RtcTrackEvent> trackEvent =
-      const EventStreamProvider<RtcTrackEvent>('track');
-
-  String get iceConnectionState native;
-
-  String get iceGatheringState native;
-
-  RtcSessionDescription? get localDescription native;
-
-  RtcSessionDescription? get remoteDescription native;
-
-  String get signalingState native;
-
-  Future addIceCandidate(Object candidate,
-          [VoidCallback? successCallback,
-          RtcPeerConnectionErrorCallback? failureCallback]) =>
-      promiseToFuture(JS("", "#.addIceCandidate(#, #, #)", this, candidate,
-          successCallback, failureCallback));
-
-  void addStream(MediaStream? stream, [Map? mediaConstraints]) {
-    if (mediaConstraints != null) {
-      var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
-      _addStream_1(stream, mediaConstraints_1);
-      return;
-    }
-    _addStream_2(stream);
-    return;
-  }
-
-  @JSName('addStream')
-  void _addStream_1(MediaStream? stream, mediaConstraints) native;
-  @JSName('addStream')
-  void _addStream_2(MediaStream? stream) native;
-
-  RtcRtpSender addTrack(MediaStreamTrack track, MediaStream streams) native;
-
-  void close() native;
-
-  Future<RtcSessionDescription> createAnswer([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<RtcSessionDescription>(
-        JS("", "#.createAnswer(#)", this, options_dict));
-  }
-
-  @JSName('createDTMFSender')
-  RtcDtmfSender createDtmfSender(MediaStreamTrack track) native;
-
-  RtcDataChannel createDataChannel(String label, [Map? dataChannelDict]) {
-    if (dataChannelDict != null) {
-      var dataChannelDict_1 = convertDartToNative_Dictionary(dataChannelDict);
-      return _createDataChannel_1(label, dataChannelDict_1);
-    }
-    return _createDataChannel_2(label);
-  }
-
-  @JSName('createDataChannel')
-  RtcDataChannel _createDataChannel_1(label, dataChannelDict) native;
-  @JSName('createDataChannel')
-  RtcDataChannel _createDataChannel_2(label) native;
-
-  Future<RtcSessionDescription> createOffer([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<RtcSessionDescription>(
-        JS("", "#.createOffer(#)", this, options_dict));
-  }
-
-  List<MediaStream> getLocalStreams() native;
-
-  List<RtcRtpReceiver> getReceivers() native;
-
-  List<MediaStream> getRemoteStreams() native;
-
-  List<RtcRtpSender> getSenders() native;
-
-  Future<RtcStatsReport> getStats() =>
-      promiseToFuture<RtcStatsReport>(JS("", "#.getStats()", this));
-
-  void removeStream(MediaStream? stream) native;
-
-  void removeTrack(RtcRtpSender sender) native;
-
-  void setConfiguration(Map configuration) {
-    var configuration_1 = convertDartToNative_Dictionary(configuration);
-    _setConfiguration_1(configuration_1);
-    return;
-  }
-
-  @JSName('setConfiguration')
-  void _setConfiguration_1(configuration) native;
-
-  Future setLocalDescription(Map description) {
-    var description_dict = convertDartToNative_Dictionary(description);
-    return promiseToFuture(
-        JS("", "#.setLocalDescription(#)", this, description_dict));
-  }
-
-  Future setRemoteDescription(Map description) {
-    var description_dict = convertDartToNative_Dictionary(description);
-    return promiseToFuture(
-        JS("", "#.setRemoteDescription(#)", this, description_dict));
-  }
-
-  /// Stream of `addstream` events handled by this [RtcPeerConnection].
-  Stream<MediaStreamEvent> get onAddStream => addStreamEvent.forTarget(this);
-
-  /// Stream of `datachannel` events handled by this [RtcPeerConnection].
-  Stream<RtcDataChannelEvent> get onDataChannel =>
-      dataChannelEvent.forTarget(this);
-
-  /// Stream of `icecandidate` events handled by this [RtcPeerConnection].
-  Stream<RtcPeerConnectionIceEvent> get onIceCandidate =>
-      iceCandidateEvent.forTarget(this);
-
-  /// Stream of `iceconnectionstatechange` events handled by this [RtcPeerConnection].
-  Stream<Event> get onIceConnectionStateChange =>
-      iceConnectionStateChangeEvent.forTarget(this);
-
-  /// Stream of `negotiationneeded` events handled by this [RtcPeerConnection].
-  Stream<Event> get onNegotiationNeeded =>
-      negotiationNeededEvent.forTarget(this);
-
-  /// Stream of `removestream` events handled by this [RtcPeerConnection].
-  Stream<MediaStreamEvent> get onRemoveStream =>
-      removeStreamEvent.forTarget(this);
-
-  /// Stream of `signalingstatechange` events handled by this [RtcPeerConnection].
-  Stream<Event> get onSignalingStateChange =>
-      signalingStateChangeEvent.forTarget(this);
-
-  /// Stream of `track` events handled by this [RtcPeerConnection].
-  Stream<RtcTrackEvent> get onTrack => trackEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCPeerConnectionIceEvent")
-class RtcPeerConnectionIceEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory RtcPeerConnectionIceEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RtcPeerConnectionIceEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return RtcPeerConnectionIceEvent._create_1(type, eventInitDict_1);
-    }
-    return RtcPeerConnectionIceEvent._create_2(type);
-  }
-  static RtcPeerConnectionIceEvent _create_1(type, eventInitDict) => JS(
-      'RtcPeerConnectionIceEvent',
-      'new RTCPeerConnectionIceEvent(#,#)',
-      type,
-      eventInitDict);
-  static RtcPeerConnectionIceEvent _create_2(type) =>
-      JS('RtcPeerConnectionIceEvent', 'new RTCPeerConnectionIceEvent(#)', type);
-
-  RtcIceCandidate? get candidate native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCRtpContributingSource")
-class RtcRtpContributingSource extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RtcRtpContributingSource._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get source native;
-
-  num get timestamp native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCRtpReceiver")
-class RtcRtpReceiver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RtcRtpReceiver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  MediaStreamTrack get track native;
-
-  List<RtcRtpContributingSource> getContributingSources() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCRtpSender")
-class RtcRtpSender extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RtcRtpSender._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  MediaStreamTrack? get track native;
-}
-// Copyright (c) 2013, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("RTCSessionDescription,mozRTCSessionDescription")
-class RtcSessionDescription extends Interceptor {
-  factory RtcSessionDescription(Map dictionary) {
-    var constructorName = JS('', 'window[#]', 'RTCSessionDescription');
-    return JS('RtcSessionDescription', 'new #(#)', constructorName,
-        convertDartToNative_SerializedScriptValue(dictionary));
-  }
-  // To suppress missing implicit constructor warnings.
-  factory RtcSessionDescription._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String? get sdp native;
-
-  set sdp(String? value) native;
-
-  String? get type native;
-
-  set type(String? value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCStatsReport")
-class RtcStatsReport extends Interceptor with MapMixin<String, dynamic> {
-  // To suppress missing implicit constructor warnings.
-  factory RtcStatsReport._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Map? _getItem(String key) =>
-      convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
-
-  void addAll(Map<String, dynamic> other) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool containsValue(dynamic value) => values.any((e) => e == value);
-
-  bool containsKey(dynamic key) => _getItem(key) != null;
-
-  Map? operator [](dynamic key) => _getItem(key);
-
-  void forEach(void f(String key, dynamic value)) {
-    var entries = JS('', '#.entries()', this);
-    while (true) {
-      var entry = JS('', '#.next()', entries);
-      if (JS('bool', '#.done', entry)) return;
-      f(JS('String', '#.value[0]', entry),
-          convertNativeToDart_Dictionary(JS('', '#.value[1]', entry)));
-    }
-  }
-
-  Iterable<String> get keys {
-    final keys = <String>[];
-    forEach((k, v) => keys.add(k));
-    return keys;
-  }
-
-  Iterable<Map> get values {
-    final values = <Map>[];
-    forEach((k, v) => values.add(v));
-    return values;
-  }
-
-  int get length => JS('int', '#.size', this);
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  void operator []=(String key, dynamic value) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  dynamic putIfAbsent(String key, dynamic ifAbsent()) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String remove(dynamic key) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCStatsResponse")
-class RtcStatsResponse extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory RtcStatsResponse._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  RtcLegacyStatsReport namedItem(String? name) native;
-
-  List<RtcLegacyStatsReport> result() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("RTCTrackEvent")
-class RtcTrackEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory RtcTrackEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RtcTrackEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return RtcTrackEvent._create_1(type, eventInitDict_1);
-  }
-  static RtcTrackEvent _create_1(type, eventInitDict) =>
-      JS('RtcTrackEvent', 'new RTCTrackEvent(#,#)', type, eventInitDict);
-
-  RtcRtpReceiver get receiver native;
-
-  List<MediaStream> get streams native;
-
-  MediaStreamTrack get track native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("Screen")
-class Screen extends Interceptor {
-  Rectangle get available =>
-      new Rectangle(_availLeft, _availTop, _availWidth, _availHeight);
-  // To suppress missing implicit constructor warnings.
-  factory Screen._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('availHeight')
-  int get _availHeight native;
-
-  @JSName('availLeft')
-  int get _availLeft native;
-
-  @JSName('availTop')
-  int get _availTop native;
-
-  @JSName('availWidth')
-  int get _availWidth native;
-
-  int get colorDepth native;
-
-  int get height native;
-
-  bool get keepAwake native;
-
-  set keepAwake(bool value) native;
-
-  ScreenOrientation get orientation native;
-
-  int get pixelDepth native;
-
-  int get width native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ScreenOrientation")
-class ScreenOrientation extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory ScreenOrientation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  int get angle native;
-
-  String get type native;
-
-  Future lock(String orientation) =>
-      promiseToFuture(JS("", "#.lock(#)", this, orientation));
-
-  void unlock() native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLScriptElement")
-class ScriptElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ScriptElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ScriptElement() => JS<ScriptElement>(
-      'returns:ScriptElement;creates:ScriptElement;new:true',
-      '#.createElement(#)',
-      document,
-      "script");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ScriptElement.created() : super.created();
-
-  bool get async native;
-
-  set async(bool value) native;
-
-  String get charset native;
-
-  set charset(String value) native;
-
-  String? get crossOrigin native;
-
-  set crossOrigin(String? value) native;
-
-  bool get defer native;
-
-  set defer(bool value) native;
-
-  String get integrity native;
-
-  set integrity(String value) native;
-
-  bool get noModule native;
-
-  set noModule(bool value) native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ScrollState")
-class ScrollState extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ScrollState._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ScrollState([Map? scrollStateInit]) {
-    if (scrollStateInit != null) {
-      var scrollStateInit_1 = convertDartToNative_Dictionary(scrollStateInit);
-      return ScrollState._create_1(scrollStateInit_1);
-    }
-    return ScrollState._create_2();
-  }
-  static ScrollState _create_1(scrollStateInit) =>
-      JS('ScrollState', 'new ScrollState(#)', scrollStateInit);
-  static ScrollState _create_2() => JS('ScrollState', 'new ScrollState()');
-
-  num get deltaGranularity native;
-
-  num get deltaX native;
-
-  num get deltaY native;
-
-  bool get fromUserInput native;
-
-  bool get inInertialPhase native;
-
-  bool get isBeginning native;
-
-  bool get isDirectManipulation native;
-
-  bool get isEnding native;
-
-  int get positionX native;
-
-  int get positionY native;
-
-  num get velocityX native;
-
-  num get velocityY native;
-
-  void consumeDelta(num x, num y) native;
-
-  void distributeToScrollChainDescendant() native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void ScrollStateCallback(ScrollState scrollState);
-// Copyright (c) 2012, 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.
-
-@Native("ScrollTimeline")
-class ScrollTimeline extends AnimationTimeline {
-  // To suppress missing implicit constructor warnings.
-  factory ScrollTimeline._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ScrollTimeline([Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return ScrollTimeline._create_1(options_1);
-    }
-    return ScrollTimeline._create_2();
-  }
-  static ScrollTimeline _create_1(options) =>
-      JS('ScrollTimeline', 'new ScrollTimeline(#)', options);
-  static ScrollTimeline _create_2() =>
-      JS('ScrollTimeline', 'new ScrollTimeline()');
-
-  String get orientation native;
-
-  Element? get scrollSource native;
-
-  Object? get timeRange native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SecurityPolicyViolationEvent")
-class SecurityPolicyViolationEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory SecurityPolicyViolationEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SecurityPolicyViolationEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return SecurityPolicyViolationEvent._create_1(type, eventInitDict_1);
-    }
-    return SecurityPolicyViolationEvent._create_2(type);
-  }
-  static SecurityPolicyViolationEvent _create_1(type, eventInitDict) => JS(
-      'SecurityPolicyViolationEvent',
-      'new SecurityPolicyViolationEvent(#,#)',
-      type,
-      eventInitDict);
-  static SecurityPolicyViolationEvent _create_2(type) => JS(
-      'SecurityPolicyViolationEvent',
-      'new SecurityPolicyViolationEvent(#)',
-      type);
-
-  @JSName('blockedURI')
-  String get blockedUri native;
-
-  int get columnNumber native;
-
-  String get disposition native;
-
-  @JSName('documentURI')
-  String get documentUri native;
-
-  String get effectiveDirective native;
-
-  int get lineNumber native;
-
-  String get originalPolicy native;
-
-  String get referrer native;
-
-  String get sample native;
-
-  String get sourceFile native;
-
-  int get statusCode native;
-
-  String get violatedDirective native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLSelectElement")
-class SelectElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory SelectElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SelectElement() => JS<SelectElement>(
-      'returns:SelectElement;creates:SelectElement;new:true',
-      '#.createElement(#)',
-      document,
-      "select");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SelectElement.created() : super.created();
-
-  bool get autofocus native;
-
-  set autofocus(bool value) native;
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  FormElement? get form native;
-
-  @Unstable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  int get length native;
-
-  set length(int value) native;
-
-  bool get multiple native;
-
-  set multiple(bool value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  bool get required native;
-
-  set required(bool value) native;
-
-  int get selectedIndex native;
-
-  set selectedIndex(int value) native;
-
-  int get size native;
-
-  set size(int value) native;
-
-  String get type native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  String get value native;
-
-  set value(String value) native;
-
-  bool get willValidate native;
-
-  void __setter__(int index, OptionElement? option) native;
-
-  void add(Object element, Object? before) native;
-
-  bool checkValidity() native;
-
-  Element? item(int index) native;
-
-  OptionElement? namedItem(String name) native;
-
-  bool reportValidity() native;
-
-  void setCustomValidity(String error) native;
-
-  // Override default options, since IE returns SelectElement itself and it
-  // does not operate as a List.
-  List<OptionElement> get options {
-    dynamic options = this.querySelectorAll<OptionElement>('option');
-    return new UnmodifiableListView(options.toList());
-  }
-
-  List<OptionElement> get selectedOptions {
-    // IE does not change the selected flag for single-selection items.
-    if (this.multiple) {
-      var options = this.options.where((o) => o.selected).toList();
-      return new UnmodifiableListView(options);
-    } else {
-      return [this.options[this.selectedIndex]];
-    }
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("Selection")
-class Selection extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Selection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Node? get anchorNode native;
-
-  int get anchorOffset native;
-
-  Node? get baseNode native;
-
-  int get baseOffset native;
-
-  Node? get extentNode native;
-
-  int get extentOffset native;
-
-  Node? get focusNode native;
-
-  int get focusOffset native;
-
-  bool get isCollapsed native;
-
-  int get rangeCount native;
-
-  String get type native;
-
-  void addRange(Range range) native;
-
-  void collapse(Node? node, [int? offset]) native;
-
-  void collapseToEnd() native;
-
-  void collapseToStart() native;
-
-  bool containsNode(Node node, [bool? allowPartialContainment]) native;
-
-  void deleteFromDocument() native;
-
-  void empty() native;
-
-  void extend(Node node, [int? offset]) native;
-
-  Range getRangeAt(int index) native;
-
-  void modify(String? alter, String? direction, String? granularity) native;
-
-  void removeAllRanges() native;
-
-  void removeRange(Range range) native;
-
-  void selectAllChildren(Node node) native;
-
-  void setBaseAndExtent(Node? baseNode, int baseOffset, Node? extentNode,
-      int extentOffset) native;
-
-  void setPosition(Node? node, [int? offset]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Sensor")
-class Sensor extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory Sensor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  bool get activated native;
-
-  bool get hasReading native;
-
-  num get timestamp native;
-
-  void start() native;
-
-  void stop() native;
-
-  Stream<Event> get onError => errorEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("SensorErrorEvent")
-class SensorErrorEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory SensorErrorEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SensorErrorEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return SensorErrorEvent._create_1(type, eventInitDict_1);
-  }
-  static SensorErrorEvent _create_1(type, eventInitDict) =>
-      JS('SensorErrorEvent', 'new SensorErrorEvent(#,#)', type, eventInitDict);
-
-  DomException get error native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ServiceWorker")
-class ServiceWorker extends EventTarget implements AbstractWorker {
-  // To suppress missing implicit constructor warnings.
-  factory ServiceWorker._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  @JSName('scriptURL')
-  String get scriptUrl native;
-
-  String get state native;
-
-  void postMessage(/*any*/ message, [List<Object>? transfer]) {
-    if (transfer != null) {
-      var message_1 = convertDartToNative_SerializedScriptValue(message);
-      _postMessage_1(message_1, transfer);
-      return;
-    }
-    var message_1 = convertDartToNative_SerializedScriptValue(message);
-    _postMessage_2(message_1);
-    return;
-  }
-
-  @JSName('postMessage')
-  void _postMessage_1(message, List<Object>? transfer) native;
-  @JSName('postMessage')
-  void _postMessage_2(message) native;
-
-  Stream<Event> get onError => errorEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("ServiceWorkerContainer")
-class ServiceWorkerContainer extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory ServiceWorkerContainer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  ServiceWorker? get controller native;
-
-  Future<ServiceWorkerRegistration> get ready =>
-      promiseToFuture<ServiceWorkerRegistration>(JS("", "#.ready", this));
-
-  Future<ServiceWorkerRegistration> getRegistration([String? documentURL]) =>
-      promiseToFuture<ServiceWorkerRegistration>(
-          JS("", "#.getRegistration(#)", this, documentURL));
-
-  Future<List<dynamic>> getRegistrations() =>
-      promiseToFuture<List<dynamic>>(JS("", "#.getRegistrations()", this));
-
-  Future<ServiceWorkerRegistration> register(String url, [Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture<ServiceWorkerRegistration>(
-        JS("", "#.register(#, #)", this, url, options_dict));
-  }
-
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("ServiceWorkerGlobalScope")
-class ServiceWorkerGlobalScope extends WorkerGlobalScope {
-  // To suppress missing implicit constructor warnings.
-  factory ServiceWorkerGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> activateEvent =
-      const EventStreamProvider<Event>('activate');
-
-  static const EventStreamProvider<Event> fetchEvent =
-      const EventStreamProvider<Event>('fetch');
-
-  static const EventStreamProvider<ForeignFetchEvent> foreignfetchEvent =
-      const EventStreamProvider<ForeignFetchEvent>('foreignfetch');
-
-  static const EventStreamProvider<Event> installEvent =
-      const EventStreamProvider<Event>('install');
-
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  Clients get clients native;
-
-  ServiceWorkerRegistration get registration native;
-
-  Future skipWaiting() => promiseToFuture(JS("", "#.skipWaiting()", this));
-
-  Stream<Event> get onActivate => activateEvent.forTarget(this);
-
-  Stream<Event> get onFetch => fetchEvent.forTarget(this);
-
-  Stream<ForeignFetchEvent> get onForeignfetch =>
-      foreignfetchEvent.forTarget(this);
-
-  Stream<Event> get onInstall => installEvent.forTarget(this);
-
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  static ServiceWorkerGlobalScope get instance {
-    return _workerSelf as ServiceWorkerGlobalScope;
-  }
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("ServiceWorkerRegistration")
-class ServiceWorkerRegistration extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory ServiceWorkerRegistration._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ServiceWorker? get active native;
-
-  BackgroundFetchManager get backgroundFetch native;
-
-  ServiceWorker? get installing native;
-
-  NavigationPreloadManager get navigationPreload native;
-
-  PaymentManager get paymentManager native;
-
-  PushManager get pushManager native;
-
-  String get scope native;
-
-  SyncManager get sync native;
-
-  ServiceWorker? get waiting native;
-
-  Future<List<dynamic>> getNotifications([Map? filter]) {
-    var filter_dict = null;
-    if (filter != null) {
-      filter_dict = convertDartToNative_Dictionary(filter);
-    }
-    return promiseToFuture<List<dynamic>>(
-        JS("", "#.getNotifications(#)", this, filter_dict));
-  }
-
-  Future showNotification(String title, [Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(
-        JS("", "#.showNotification(#, #)", this, title, options_dict));
-  }
-
-  Future<bool> unregister() =>
-      promiseToFuture<bool>(JS("", "#.unregister()", this));
-
-  Future update() => promiseToFuture(JS("", "#.update()", this));
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '26')
-@Native("HTMLShadowElement")
-class ShadowElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory ShadowElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ShadowElement() => document.createElement("shadow") as ShadowElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ShadowElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('shadow');
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getDistributedNodes() native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '26')
-@Native("ShadowRoot")
-class ShadowRoot extends DocumentFragment implements DocumentOrShadowRoot {
-  // To suppress missing implicit constructor warnings.
-  factory ShadowRoot._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get delegatesFocus native;
-
-  Element get host native;
-
-  @JSName('innerHTML')
-  String get innerHtml native;
-
-  @JSName('innerHTML')
-  set innerHtml(String? value) native;
-
-  String get mode native;
-
-  ShadowRoot? get olderShadowRoot native;
-
-  // From DocumentOrShadowRoot
-
-  Element? get activeElement native;
-
-  Element? get fullscreenElement native;
-
-  Element? get pointerLockElement native;
-
-  @Returns('_StyleSheetList')
-  @Creates('_StyleSheetList')
-  List<StyleSheet> get styleSheets native;
-
-  Element? elementFromPoint(int x, int y) native;
-
-  List<Element> elementsFromPoint(int x, int y) native;
-
-  Selection? getSelection() native;
-
-  static bool get supported => JS(
-      'bool',
-      '!!(Element.prototype.createShadowRoot||'
-          'Element.prototype.webkitCreateShadowRoot)');
-
-  static bool _shadowRootDeprecationReported = false;
-  static void _shadowRootDeprecationReport() {
-    if (!_shadowRootDeprecationReported) {
-      window.console.warn('''
-ShadowRoot.resetStyleInheritance and ShadowRoot.applyAuthorStyles now deprecated in dart:html.
-Please remove them from your code.
-''');
-      _shadowRootDeprecationReported = true;
-    }
-  }
-
-  @deprecated
-  bool get resetStyleInheritance {
-    _shadowRootDeprecationReport();
-    // Default value from when it was specified.
-    return false;
-  }
-
-  @deprecated
-  set resetStyleInheritance(bool value) {
-    _shadowRootDeprecationReport();
-  }
-
-  @deprecated
-  bool get applyAuthorStyles {
-    _shadowRootDeprecationReport();
-    // Default value from when it was specified.
-    return false;
-  }
-
-  @deprecated
-  set applyAuthorStyles(bool value) {
-    _shadowRootDeprecationReport();
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("SharedArrayBuffer")
-class SharedArrayBuffer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SharedArrayBuffer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get byteLength native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SharedWorker")
-class SharedWorker extends EventTarget implements AbstractWorker {
-  // To suppress missing implicit constructor warnings.
-  factory SharedWorker._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  factory SharedWorker(String scriptURL, [String? name]) {
-    if (name != null) {
-      return SharedWorker._create_1(scriptURL, name);
-    }
-    return SharedWorker._create_2(scriptURL);
-  }
-  static SharedWorker _create_1(scriptURL, name) =>
-      JS('SharedWorker', 'new SharedWorker(#,#)', scriptURL, name);
-  static SharedWorker _create_2(scriptURL) =>
-      JS('SharedWorker', 'new SharedWorker(#)', scriptURL);
-
-  MessagePort get port native;
-
-  Stream<Event> get onError => errorEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("SharedWorkerGlobalScope")
-class SharedWorkerGlobalScope extends WorkerGlobalScope {
-  // To suppress missing implicit constructor warnings.
-  factory SharedWorkerGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `connect` events to event
-   * handlers that are not necessarily instances of [SharedWorkerGlobalScope].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> connectEvent =
-      const EventStreamProvider<Event>('connect');
-
-  static const int PERSISTENT = 1;
-
-  static const int TEMPORARY = 0;
-
-  String get name native;
-
-  void close() native;
-
-  @JSName('webkitRequestFileSystem')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _webkitRequestFileSystem(int type, int size,
-      [_FileSystemCallback? successCallback,
-      _ErrorCallback? errorCallback]) native;
-
-  @JSName('webkitRequestFileSystemSync')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  _DOMFileSystemSync requestFileSystemSync(int type, int size) native;
-
-  @JSName('webkitResolveLocalFileSystemSyncURL')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  _EntrySync resolveLocalFileSystemSyncUrl(String url) native;
-
-  @JSName('webkitResolveLocalFileSystemURL')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void _webkitResolveLocalFileSystemUrl(
-      String url, _EntryCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  /// Stream of `connect` events handled by this [SharedWorkerGlobalScope].
-  Stream<Event> get onConnect => connectEvent.forTarget(this);
-
-  static SharedWorkerGlobalScope get instance {
-    return _workerSelf as SharedWorkerGlobalScope;
-  }
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("HTMLSlotElement")
-class SlotElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory SlotElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SlotElement.created() : super.created();
-
-  String get name native;
-
-  set name(String value) native;
-
-  List<Node> assignedNodes([Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return _assignedNodes_1(options_1);
-    }
-    return _assignedNodes_2();
-  }
-
-  @JSName('assignedNodes')
-  List<Node> _assignedNodes_1(options) native;
-  @JSName('assignedNodes')
-  List<Node> _assignedNodes_2() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SourceBuffer")
-class SourceBuffer extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory SourceBuffer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> abortEvent =
-      const EventStreamProvider<Event>('abort');
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  num get appendWindowEnd native;
-
-  set appendWindowEnd(num value) native;
-
-  num get appendWindowStart native;
-
-  set appendWindowStart(num value) native;
-
-  AudioTrackList get audioTracks native;
-
-  TimeRanges get buffered native;
-
-  String get mode native;
-
-  set mode(String value) native;
-
-  num get timestampOffset native;
-
-  set timestampOffset(num value) native;
-
-  TrackDefaultList get trackDefaults native;
-
-  set trackDefaults(TrackDefaultList value) native;
-
-  bool get updating native;
-
-  VideoTrackList get videoTracks native;
-
-  void abort() native;
-
-  void appendBuffer(ByteBuffer data) native;
-
-  @JSName('appendBuffer')
-  void appendTypedData(TypedData data) native;
-
-  void remove(num start, num end) native;
-
-  Stream<Event> get onAbort => abortEvent.forTarget(this);
-
-  Stream<Event> get onError => errorEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("SourceBufferList")
-class SourceBufferList extends EventTarget
-    with ListMixin<SourceBuffer>, ImmutableListMixin<SourceBuffer>
-    implements JavaScriptIndexingBehavior<SourceBuffer>, List<SourceBuffer> {
-  // To suppress missing implicit constructor warnings.
-  factory SourceBufferList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  SourceBuffer operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("SourceBuffer", "#[#]", this, index);
-  }
-
-  void operator []=(int index, SourceBuffer value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<SourceBuffer> mixins.
-  // SourceBuffer is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  SourceBuffer get first {
-    if (this.length > 0) {
-      return JS('SourceBuffer', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  SourceBuffer get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('SourceBuffer', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  SourceBuffer get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('SourceBuffer', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  SourceBuffer elementAt(int index) => this[index];
-  // -- end List<SourceBuffer> mixins.
-
-  SourceBuffer item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLSourceElement")
-class SourceElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory SourceElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SourceElement() => JS<SourceElement>(
-      'returns:SourceElement;creates:SourceElement;new:true',
-      '#.createElement(#)',
-      document,
-      "source");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SourceElement.created() : super.created();
-
-  String get media native;
-
-  set media(String value) native;
-
-  String get sizes native;
-
-  set sizes(String value) native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get srcset native;
-
-  set srcset(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLSpanElement")
-class SpanElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory SpanElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SpanElement() => JS<SpanElement>(
-      'returns:SpanElement;creates:SpanElement;new:true',
-      '#.createElement(#)',
-      document,
-      "span");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SpanElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechGrammar")
-class SpeechGrammar extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechGrammar._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SpeechGrammar() {
-    return SpeechGrammar._create_1();
-  }
-  static SpeechGrammar _create_1() =>
-      JS('SpeechGrammar', 'new SpeechGrammar()');
-
-  String get src native;
-
-  set src(String value) native;
-
-  num get weight native;
-
-  set weight(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechGrammarList")
-class SpeechGrammarList extends Interceptor
-    with ListMixin<SpeechGrammar>, ImmutableListMixin<SpeechGrammar>
-    implements JavaScriptIndexingBehavior<SpeechGrammar>, List<SpeechGrammar> {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechGrammarList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SpeechGrammarList() {
-    return SpeechGrammarList._create_1();
-  }
-  static SpeechGrammarList _create_1() =>
-      JS('SpeechGrammarList', 'new SpeechGrammarList()');
-
-  int get length => JS("int", "#.length", this);
-
-  SpeechGrammar operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("SpeechGrammar", "#[#]", this, index);
-  }
-
-  void operator []=(int index, SpeechGrammar value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<SpeechGrammar> mixins.
-  // SpeechGrammar is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  SpeechGrammar get first {
-    if (this.length > 0) {
-      return JS('SpeechGrammar', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  SpeechGrammar get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('SpeechGrammar', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  SpeechGrammar get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('SpeechGrammar', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  SpeechGrammar elementAt(int index) => this[index];
-  // -- end List<SpeechGrammar> mixins.
-
-  void addFromString(String string, [num? weight]) native;
-
-  void addFromUri(String src, [num? weight]) native;
-
-  SpeechGrammar item(int index) native;
-}
-// Copyright (c) 2013, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Native("SpeechRecognition")
-class SpeechRecognition extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechRecognition._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `audioend` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> audioEndEvent =
-      const EventStreamProvider<Event>('audioend');
-
-  /**
-   * Static factory designed to expose `audiostart` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> audioStartEvent =
-      const EventStreamProvider<Event>('audiostart');
-
-  /**
-   * Static factory designed to expose `end` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> endEvent =
-      const EventStreamProvider<Event>('end');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechRecognitionError> errorEvent =
-      const EventStreamProvider<SpeechRecognitionError>('error');
-
-  /**
-   * Static factory designed to expose `nomatch` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechRecognitionEvent> noMatchEvent =
-      const EventStreamProvider<SpeechRecognitionEvent>('nomatch');
-
-  /**
-   * Static factory designed to expose `result` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechRecognitionEvent> resultEvent =
-      const EventStreamProvider<SpeechRecognitionEvent>('result');
-
-  /**
-   * Static factory designed to expose `soundend` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> soundEndEvent =
-      const EventStreamProvider<Event>('soundend');
-
-  /**
-   * Static factory designed to expose `soundstart` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> soundStartEvent =
-      const EventStreamProvider<Event>('soundstart');
-
-  /**
-   * Static factory designed to expose `speechend` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> speechEndEvent =
-      const EventStreamProvider<Event>('speechend');
-
-  /**
-   * Static factory designed to expose `speechstart` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> speechStartEvent =
-      const EventStreamProvider<Event>('speechstart');
-
-  /**
-   * Static factory designed to expose `start` events to event
-   * handlers that are not necessarily instances of [SpeechRecognition].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> startEvent =
-      const EventStreamProvider<Event>('start');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS(
-      'bool', '!!(window.SpeechRecognition || window.webkitSpeechRecognition)');
-
-  MediaStreamTrack? get audioTrack native;
-
-  set audioTrack(MediaStreamTrack? value) native;
-
-  bool get continuous native;
-
-  set continuous(bool value) native;
-
-  SpeechGrammarList get grammars native;
-
-  set grammars(SpeechGrammarList value) native;
-
-  bool get interimResults native;
-
-  set interimResults(bool value) native;
-
-  String get lang native;
-
-  set lang(String value) native;
-
-  int get maxAlternatives native;
-
-  set maxAlternatives(int value) native;
-
-  void abort() native;
-
-  void start() native;
-
-  void stop() native;
-
-  /// Stream of `audioend` events handled by this [SpeechRecognition].
-  Stream<Event> get onAudioEnd => audioEndEvent.forTarget(this);
-
-  /// Stream of `audiostart` events handled by this [SpeechRecognition].
-  Stream<Event> get onAudioStart => audioStartEvent.forTarget(this);
-
-  /// Stream of `end` events handled by this [SpeechRecognition].
-  Stream<Event> get onEnd => endEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [SpeechRecognition].
-  Stream<SpeechRecognitionError> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `nomatch` events handled by this [SpeechRecognition].
-  Stream<SpeechRecognitionEvent> get onNoMatch => noMatchEvent.forTarget(this);
-
-  /// Stream of `result` events handled by this [SpeechRecognition].
-  Stream<SpeechRecognitionEvent> get onResult => resultEvent.forTarget(this);
-
-  /// Stream of `soundend` events handled by this [SpeechRecognition].
-  Stream<Event> get onSoundEnd => soundEndEvent.forTarget(this);
-
-  /// Stream of `soundstart` events handled by this [SpeechRecognition].
-  Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
-
-  /// Stream of `speechend` events handled by this [SpeechRecognition].
-  Stream<Event> get onSpeechEnd => speechEndEvent.forTarget(this);
-
-  /// Stream of `speechstart` events handled by this [SpeechRecognition].
-  Stream<Event> get onSpeechStart => speechStartEvent.forTarget(this);
-
-  /// Stream of `start` events handled by this [SpeechRecognition].
-  Stream<Event> get onStart => startEvent.forTarget(this);
-
-  factory SpeechRecognition() {
-    return JS('SpeechRecognition',
-        'new (window.SpeechRecognition || window.webkitSpeechRecognition)()');
-  }
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Native("SpeechRecognitionAlternative")
-class SpeechRecognitionAlternative extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechRecognitionAlternative._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get confidence native;
-
-  String get transcript native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Native("SpeechRecognitionError")
-class SpeechRecognitionError extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechRecognitionError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SpeechRecognitionError(String type, [Map? initDict]) {
-    if (initDict != null) {
-      var initDict_1 = convertDartToNative_Dictionary(initDict);
-      return SpeechRecognitionError._create_1(type, initDict_1);
-    }
-    return SpeechRecognitionError._create_2(type);
-  }
-  static SpeechRecognitionError _create_1(type, initDict) => JS(
-      'SpeechRecognitionError',
-      'new SpeechRecognitionError(#,#)',
-      type,
-      initDict);
-  static SpeechRecognitionError _create_2(type) =>
-      JS('SpeechRecognitionError', 'new SpeechRecognitionError(#)', type);
-
-  String get error native;
-
-  String get message native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Native("SpeechRecognitionEvent")
-class SpeechRecognitionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechRecognitionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SpeechRecognitionEvent(String type, [Map? initDict]) {
-    if (initDict != null) {
-      var initDict_1 = convertDartToNative_Dictionary(initDict);
-      return SpeechRecognitionEvent._create_1(type, initDict_1);
-    }
-    return SpeechRecognitionEvent._create_2(type);
-  }
-  static SpeechRecognitionEvent _create_1(type, initDict) => JS(
-      'SpeechRecognitionEvent',
-      'new SpeechRecognitionEvent(#,#)',
-      type,
-      initDict);
-  static SpeechRecognitionEvent _create_2(type) =>
-      JS('SpeechRecognitionEvent', 'new SpeechRecognitionEvent(#)', type);
-
-  Document? get emma native;
-
-  Document? get interpretation native;
-
-  int get resultIndex native;
-
-  @Returns('_SpeechRecognitionResultList|Null')
-  @Creates('_SpeechRecognitionResultList')
-  List<SpeechRecognitionResult>? get results native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Native("SpeechRecognitionResult")
-class SpeechRecognitionResult extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechRecognitionResult._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get isFinal native;
-
-  int get length native;
-
-  SpeechRecognitionAlternative item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechSynthesis")
-class SpeechSynthesis extends EventTarget {
-  List<SpeechSynthesisVoice> getVoices() {
-    List<SpeechSynthesisVoice> voices = _getVoices();
-    if (voices.length > 0) applyExtension('SpeechSynthesisVoice', voices[0]);
-    return voices;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory SpeechSynthesis._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get paused native;
-
-  bool get pending native;
-
-  bool get speaking native;
-
-  void cancel() native;
-
-  @JSName('getVoices')
-  List<SpeechSynthesisVoice> _getVoices() native;
-
-  void pause() native;
-
-  void resume() native;
-
-  void speak(SpeechSynthesisUtterance utterance) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechSynthesisEvent")
-class SpeechSynthesisEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechSynthesisEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get charIndex native;
-
-  num get elapsedTime native;
-
-  String get name native;
-
-  SpeechSynthesisUtterance get utterance native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechSynthesisUtterance")
-class SpeechSynthesisUtterance extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechSynthesisUtterance._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `boundary` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechSynthesisEvent> boundaryEvent =
-      const EventStreamProvider<SpeechSynthesisEvent>('boundary');
-
-  /**
-   * Static factory designed to expose `end` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechSynthesisEvent> endEvent =
-      const EventStreamProvider<SpeechSynthesisEvent>('end');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `mark` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechSynthesisEvent> markEvent =
-      const EventStreamProvider<SpeechSynthesisEvent>('mark');
-
-  /**
-   * Static factory designed to expose `pause` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> pauseEvent =
-      const EventStreamProvider<Event>('pause');
-
-  /**
-   * Static factory designed to expose `resume` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechSynthesisEvent> resumeEvent =
-      const EventStreamProvider<SpeechSynthesisEvent>('resume');
-
-  /**
-   * Static factory designed to expose `start` events to event
-   * handlers that are not necessarily instances of [SpeechSynthesisUtterance].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<SpeechSynthesisEvent> startEvent =
-      const EventStreamProvider<SpeechSynthesisEvent>('start');
-
-  factory SpeechSynthesisUtterance([String? text]) {
-    if (text != null) {
-      return SpeechSynthesisUtterance._create_1(text);
-    }
-    return SpeechSynthesisUtterance._create_2();
-  }
-  static SpeechSynthesisUtterance _create_1(text) =>
-      JS('SpeechSynthesisUtterance', 'new SpeechSynthesisUtterance(#)', text);
-  static SpeechSynthesisUtterance _create_2() =>
-      JS('SpeechSynthesisUtterance', 'new SpeechSynthesisUtterance()');
-
-  String get lang native;
-
-  set lang(String value) native;
-
-  num get pitch native;
-
-  set pitch(num value) native;
-
-  num get rate native;
-
-  set rate(num value) native;
-
-  String get text native;
-
-  set text(String value) native;
-
-  SpeechSynthesisVoice? get voice native;
-
-  set voice(SpeechSynthesisVoice? value) native;
-
-  num get volume native;
-
-  set volume(num value) native;
-
-  /// Stream of `boundary` events handled by this [SpeechSynthesisUtterance].
-  Stream<SpeechSynthesisEvent> get onBoundary => boundaryEvent.forTarget(this);
-
-  /// Stream of `end` events handled by this [SpeechSynthesisUtterance].
-  Stream<SpeechSynthesisEvent> get onEnd => endEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [SpeechSynthesisUtterance].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `mark` events handled by this [SpeechSynthesisUtterance].
-  Stream<SpeechSynthesisEvent> get onMark => markEvent.forTarget(this);
-
-  /// Stream of `pause` events handled by this [SpeechSynthesisUtterance].
-  Stream<Event> get onPause => pauseEvent.forTarget(this);
-
-  /// Stream of `resume` events handled by this [SpeechSynthesisUtterance].
-  Stream<SpeechSynthesisEvent> get onResume => resumeEvent.forTarget(this);
-
-  /// Stream of `start` events handled by this [SpeechSynthesisUtterance].
-  Stream<SpeechSynthesisEvent> get onStart => startEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechSynthesisVoice")
-class SpeechSynthesisVoice extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SpeechSynthesisVoice._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('default')
-  bool get defaultValue native;
-
-  String get lang native;
-
-  bool get localService native;
-
-  String get name native;
-
-  @JSName('voiceURI')
-  String get voiceUri native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StaticRange")
-class StaticRange extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory StaticRange._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get collapsed native;
-
-  Node get endContainer native;
-
-  int get endOffset native;
-
-  Node get startContainer native;
-
-  int get startOffset native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * The type used by the
- * [Window.localStorage] and [Window.sessionStorage] properties.
- * Storage is implemented as a Map&lt;String, String>.
- *
- * To store and get values, use Dart's built-in map syntax:
- *
- *     window.localStorage['key1'] = 'val1';
- *     window.localStorage['key2'] = 'val2';
- *     window.localStorage['key3'] = 'val3';
- *     assert(window.localStorage['key3'] == 'val3');
- *
- * You can use [Map](http://api.dartlang.org/dart_core/Map.html) APIs
- * such as containsValue(), clear(), and length:
- *
- *     assert(window.localStorage.containsValue('does not exist') == false);
- *     window.localStorage.clear();
- *     assert(window.localStorage.length == 0);
- *
- * For more examples of using this API, see
- * [localstorage_test.dart](http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/tests/html/localstorage_test.dart).
- * For details on using the Map API, see the
- * [Maps](https://www.dartlang.org/guides/libraries/library-tour#maps)
- * section of the library tour.
- */
-@Unstable()
-@Native("Storage")
-class Storage extends Interceptor with MapMixin<String, String> {
-  void addAll(Map<String, String> other) {
-    other.forEach((k, v) {
-      this[k] = v;
-    });
-  }
-
-  // TODO(nweiz): update this when maps support lazy iteration
-  bool containsValue(Object? value) => values.any((e) => e == value);
-
-  bool containsKey(Object? key) => _getItem(key as String) != null;
-
-  String? operator [](Object? key) => _getItem(key as String);
-
-  void operator []=(String key, String value) {
-    _setItem(key, value);
-  }
-
-  String putIfAbsent(String key, String ifAbsent()) {
-    if (!containsKey(key)) this[key] = ifAbsent();
-    return this[key] as String;
-  }
-
-  String? remove(Object? key) {
-    final value = this[key];
-    _removeItem(key as String);
-    return value;
-  }
-
-  void clear() => _clear();
-
-  void forEach(void f(String key, String value)) {
-    for (var i = 0; true; i++) {
-      final key = _key(i);
-      if (key == null) return;
-
-      f(key, this[key]!);
-    }
-  }
-
-  Iterable<String> get keys {
-    final keys = <String>[];
-    forEach((k, v) => keys.add(k));
-    return keys;
-  }
-
-  Iterable<String> get values {
-    final values = <String>[];
-    forEach((k, v) => values.add(v));
-    return values;
-  }
-
-  int get length => _length;
-
-  bool get isEmpty => _key(0) == null;
-
-  bool get isNotEmpty => !isEmpty;
-  // To suppress missing implicit constructor warnings.
-  factory Storage._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('length')
-  int get _length native;
-
-  @JSName('clear')
-  void _clear() native;
-
-  @JSName('getItem')
-  String? _getItem(String key) native;
-
-  @JSName('key')
-  String? _key(int index) native;
-
-  @JSName('removeItem')
-  void _removeItem(String key) native;
-
-  @JSName('setItem')
-  void _setItem(String key, String value) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void StorageErrorCallback(DomError error);
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Unstable()
-@Native("StorageEvent")
-class StorageEvent extends Event {
-  factory StorageEvent(String type,
-      {bool canBubble: false,
-      bool cancelable: false,
-      String? key,
-      String? oldValue,
-      String? newValue,
-      String? url,
-      Storage? storageArea}) {
-    StorageEvent e = document._createEvent("StorageEvent") as StorageEvent;
-    e._initStorageEvent(
-        type, canBubble, cancelable, key, oldValue, newValue, url, storageArea);
-    return e;
-  }
-
-  factory StorageEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return StorageEvent._create_1(type, eventInitDict_1);
-    }
-    return StorageEvent._create_2(type);
-  }
-  static StorageEvent _create_1(type, eventInitDict) =>
-      JS('StorageEvent', 'new StorageEvent(#,#)', type, eventInitDict);
-  static StorageEvent _create_2(type) =>
-      JS('StorageEvent', 'new StorageEvent(#)', type);
-
-  String? get key native;
-
-  String? get newValue native;
-
-  String? get oldValue native;
-
-  Storage? get storageArea native;
-
-  String get url native;
-
-  @JSName('initStorageEvent')
-  void _initStorageEvent(
-      String? typeArg,
-      bool? canBubbleArg,
-      bool? cancelableArg,
-      String? keyArg,
-      String? oldValueArg,
-      String? newValueArg,
-      String? urlArg,
-      Storage? storageAreaArg) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StorageManager")
-class StorageManager extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory StorageManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<Map<String, dynamic>?> estimate() =>
-      promiseToFutureAsMap(JS("", "#.estimate()", this));
-
-  Future<bool> persist() => promiseToFuture<bool>(JS("", "#.persist()", this));
-
-  Future<bool> persisted() =>
-      promiseToFuture<bool>(JS("", "#.persisted()", this));
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void StorageQuotaCallback(int grantedQuotaInBytes);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void StorageUsageCallback(
-    int currentUsageInBytes, int currentQuotaInBytes);
-// Copyright (c) 2012, 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.
-
-@Native("HTMLStyleElement")
-class StyleElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory StyleElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory StyleElement() => JS<StyleElement>(
-      'returns:StyleElement;creates:StyleElement;new:true',
-      '#.createElement(#)',
-      document,
-      "style");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  StyleElement.created() : super.created();
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  String get media native;
-
-  set media(String value) native;
-
-  StyleSheet? get sheet native;
-
-  String get type native;
-
-  set type(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StyleMedia")
-class StyleMedia extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory StyleMedia._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get type native;
-
-  bool matchMedium(String? mediaquery) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StylePropertyMap")
-class StylePropertyMap extends StylePropertyMapReadonly {
-  // To suppress missing implicit constructor warnings.
-  factory StylePropertyMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void append(String property, Object value) native;
-
-  void delete(String property) native;
-
-  void set(String property, Object value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StylePropertyMapReadonly")
-class StylePropertyMapReadonly extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory StylePropertyMapReadonly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  CssStyleValue? get(String property) native;
-
-  List<CssStyleValue> getAll(String property) native;
-
-  List<String> getProperties() native;
-
-  bool has(String property) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StyleSheet")
-class StyleSheet extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory StyleSheet._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  String? get href native;
-
-  MediaList get media native;
-
-  Node? get ownerNode native;
-
-  StyleSheet? get parentStyleSheet native;
-
-  String? get title native;
-
-  String get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SyncEvent")
-class SyncEvent extends ExtendableEvent {
-  // To suppress missing implicit constructor warnings.
-  factory SyncEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SyncEvent(String type, Map init) {
-    var init_1 = convertDartToNative_Dictionary(init);
-    return SyncEvent._create_1(type, init_1);
-  }
-  static SyncEvent _create_1(type, init) =>
-      JS('SyncEvent', 'new SyncEvent(#,#)', type, init);
-
-  bool get lastChance native;
-
-  String get tag native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SyncManager")
-class SyncManager extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SyncManager._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<List<dynamic>> getTags() =>
-      promiseToFuture<List<dynamic>>(JS("", "#.getTags()", this));
-
-  Future register(String tag) =>
-      promiseToFuture(JS("", "#.register(#)", this, tag));
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLTableCaptionElement")
-class TableCaptionElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TableCaptionElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TableCaptionElement() => JS<TableCaptionElement>(
-      'returns:TableCaptionElement;creates:TableCaptionElement;new:true',
-      '#.createElement(#)',
-      document,
-      "caption");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TableCaptionElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native(
-    "HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement")
-class TableCellElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TableCellElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TableCellElement() => JS<TableCellElement>(
-      'returns:TableCellElement;creates:TableCellElement;new:true',
-      '#.createElement(#)',
-      document,
-      "td");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TableCellElement.created() : super.created();
-
-  int get cellIndex native;
-
-  int get colSpan native;
-
-  set colSpan(int value) native;
-
-  String get headers native;
-
-  set headers(String? value) native;
-
-  int get rowSpan native;
-
-  set rowSpan(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLTableColElement")
-class TableColElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TableColElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TableColElement() => JS<TableColElement>(
-      'returns:TableColElement;creates:TableColElement;new:true',
-      '#.createElement(#)',
-      document,
-      "col");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TableColElement.created() : super.created();
-
-  int get span native;
-
-  set span(int value) native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("HTMLTableElement")
-class TableElement extends HtmlElement {
-  List<TableSectionElement> get tBodies =>
-      new _WrappedList<TableSectionElement>(_tBodies);
-
-  List<TableRowElement> get rows => new _WrappedList<TableRowElement>(_rows);
-
-  TableRowElement addRow() {
-    return insertRow(-1);
-  }
-
-  TableCaptionElement createCaption() => _createCaption();
-  TableSectionElement createTBody() => _createTBody();
-  TableSectionElement createTFoot() => _createTFoot();
-  TableSectionElement createTHead() => _createTHead();
-  TableRowElement insertRow(int index) => _insertRow(index);
-
-  TableSectionElement _createTBody() {
-    if (JS('bool', '!!#.createTBody', this)) {
-      return this._nativeCreateTBody();
-    }
-    var tbody = new Element.tag('tbody');
-    this.children.add(tbody);
-    return tbody as TableSectionElement;
-  }
-
-  @JSName('createTBody')
-  TableSectionElement _nativeCreateTBody() native;
-
-  DocumentFragment createFragment(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (Range.supportsCreateContextualFragment) {
-      return super.createFragment(html,
-          validator: validator, treeSanitizer: treeSanitizer);
-    }
-    // IE9 workaround which does not support innerHTML on Table elements.
-    var contextualHtml = '<table>$html</table>';
-    var table = new Element.html(contextualHtml,
-        validator: validator, treeSanitizer: treeSanitizer);
-    var fragment = new DocumentFragment();
-    fragment.nodes.addAll(table.nodes);
-
-    return fragment;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory TableElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TableElement() => JS<TableElement>(
-      'returns:TableElement;creates:TableElement;new:true',
-      '#.createElement(#)',
-      document,
-      "table");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TableElement.created() : super.created();
-
-  TableCaptionElement? get caption native;
-
-  set caption(TableCaptionElement? value) native;
-
-  @JSName('rows')
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get _rows native;
-
-  @JSName('tBodies')
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get _tBodies native;
-
-  TableSectionElement? get tFoot native;
-
-  set tFoot(TableSectionElement? value) native;
-
-  TableSectionElement? get tHead native;
-
-  set tHead(TableSectionElement? value) native;
-
-  @JSName('createCaption')
-  TableCaptionElement _createCaption() native;
-
-  @JSName('createTFoot')
-  TableSectionElement _createTFoot() native;
-
-  @JSName('createTHead')
-  TableSectionElement _createTHead() native;
-
-  void deleteCaption() native;
-
-  void deleteRow(int index) native;
-
-  void deleteTFoot() native;
-
-  void deleteTHead() native;
-
-  @JSName('insertRow')
-  TableRowElement _insertRow([int? index]) native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("HTMLTableRowElement")
-class TableRowElement extends HtmlElement {
-  List<TableCellElement> get cells =>
-      new _WrappedList<TableCellElement>(_cells);
-
-  TableCellElement addCell() {
-    return insertCell(-1);
-  }
-
-  TableCellElement insertCell(int index) =>
-      _insertCell(index) as TableCellElement;
-
-  DocumentFragment createFragment(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (Range.supportsCreateContextualFragment) {
-      return super.createFragment(html,
-          validator: validator, treeSanitizer: treeSanitizer);
-    }
-    // IE9 workaround which does not support innerHTML on Table elements.
-    var fragment = new DocumentFragment();
-    var section = new TableElement()
-        .createFragment(html,
-            validator: validator, treeSanitizer: treeSanitizer)
-        .nodes
-        .single;
-    var row = section.nodes.single;
-    fragment.nodes.addAll(row.nodes);
-    return fragment;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory TableRowElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TableRowElement() => JS<TableRowElement>(
-      'returns:TableRowElement;creates:TableRowElement;new:true',
-      '#.createElement(#)',
-      document,
-      "tr");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TableRowElement.created() : super.created();
-
-  @JSName('cells')
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get _cells native;
-
-  int get rowIndex native;
-
-  int get sectionRowIndex native;
-
-  void deleteCell(int index) native;
-
-  @JSName('insertCell')
-  HtmlElement _insertCell([int? index]) native;
-}
-// Copyright (c) 2013, 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.
-
-@Native("HTMLTableSectionElement")
-class TableSectionElement extends HtmlElement {
-  List<TableRowElement> get rows => new _WrappedList<TableRowElement>(_rows);
-
-  TableRowElement addRow() {
-    return insertRow(-1);
-  }
-
-  TableRowElement insertRow(int index) => _insertRow(index) as TableRowElement;
-
-  DocumentFragment createFragment(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (Range.supportsCreateContextualFragment) {
-      return super.createFragment(html,
-          validator: validator, treeSanitizer: treeSanitizer);
-    }
-    // IE9 workaround which does not support innerHTML on Table elements.
-    var fragment = new DocumentFragment();
-    var section = new TableElement()
-        .createFragment(html,
-            validator: validator, treeSanitizer: treeSanitizer)
-        .nodes
-        .single;
-    fragment.nodes.addAll(section.nodes);
-    return fragment;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory TableSectionElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TableSectionElement.created() : super.created();
-
-  @JSName('rows')
-  @Returns('HtmlCollection')
-  @Creates('HtmlCollection')
-  List<Node> get _rows native;
-
-  void deleteRow(int index) native;
-
-  @JSName('insertRow')
-  HtmlElement _insertRow([int? index]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TaskAttributionTiming")
-class TaskAttributionTiming extends PerformanceEntry {
-  // To suppress missing implicit constructor warnings.
-  factory TaskAttributionTiming._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get containerId native;
-
-  String get containerName native;
-
-  String get containerSrc native;
-
-  String get containerType native;
-
-  @JSName('scriptURL')
-  String get scriptUrl native;
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("HTMLTemplateElement")
-class TemplateElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TemplateElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TemplateElement() =>
-      document.createElement("template") as TemplateElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TemplateElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('template');
-
-  DocumentFragment get content native;
-
-  /**
-   * An override to place the contents into content rather than as child nodes.
-   *
-   * See also:
-   *
-   * * <https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin>
-   */
-  void setInnerHtml(String? html,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    text = null;
-    content.nodes.clear();
-    var fragment = createFragment(html,
-        validator: validator, treeSanitizer: treeSanitizer);
-
-    content.append(fragment);
-  }
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("Text")
-class Text extends CharacterData {
-  factory Text(String data) => JS(
-      'returns:Text;depends:none;effects:none;new:true',
-      '#.createTextNode(#)',
-      document,
-      data);
-  // To suppress missing implicit constructor warnings.
-  factory Text._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  SlotElement? get assignedSlot native;
-
-  String get wholeText native;
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getDestinationInsertionPoints() native;
-
-  Text splitText(int offset) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLTextAreaElement")
-class TextAreaElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TextAreaElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TextAreaElement() => JS<TextAreaElement>(
-      'returns:TextAreaElement;creates:TextAreaElement;new:true',
-      '#.createElement(#)',
-      document,
-      "textarea");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TextAreaElement.created() : super.created();
-
-  String get autocapitalize native;
-
-  set autocapitalize(String value) native;
-
-  bool get autofocus native;
-
-  set autofocus(bool value) native;
-
-  int get cols native;
-
-  set cols(int value) native;
-
-  String get defaultValue native;
-
-  set defaultValue(String value) native;
-
-  String get dirName native;
-
-  set dirName(String value) native;
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  FormElement? get form native;
-
-  @Unstable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get labels native;
-
-  int get maxLength native;
-
-  set maxLength(int value) native;
-
-  int get minLength native;
-
-  set minLength(int value) native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  String get placeholder native;
-
-  set placeholder(String value) native;
-
-  bool get readOnly native;
-
-  set readOnly(bool value) native;
-
-  bool get required native;
-
-  set required(bool value) native;
-
-  int get rows native;
-
-  set rows(int value) native;
-
-  String get selectionDirection native;
-
-  set selectionDirection(String value) native;
-
-  int get selectionEnd native;
-
-  set selectionEnd(int value) native;
-
-  int get selectionStart native;
-
-  set selectionStart(int value) native;
-
-  int get textLength native;
-
-  String get type native;
-
-  String get validationMessage native;
-
-  ValidityState get validity native;
-
-  String get value native;
-
-  set value(String? value) native;
-
-  bool get willValidate native;
-
-  String get wrap native;
-
-  set wrap(String value) native;
-
-  bool checkValidity() native;
-
-  bool reportValidity() native;
-
-  void select() native;
-
-  void setCustomValidity(String error) native;
-
-  void setRangeText(String replacement,
-      {int? start, int? end, String? selectionMode}) native;
-
-  void setSelectionRange(int start, int end, [String? direction]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TextDetector")
-class TextDetector extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TextDetector._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TextDetector() {
-    return TextDetector._create_1();
-  }
-  static TextDetector _create_1() => JS('TextDetector', 'new TextDetector()');
-
-  Future<List<dynamic>> detect(/*ImageBitmapSource*/ image) =>
-      promiseToFuture<List<dynamic>>(JS("", "#.detect(#)", this, image));
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Unstable()
-@Native("TextEvent")
-class TextEvent extends UIEvent {
-  factory TextEvent(String type,
-      {bool canBubble: false,
-      bool cancelable: false,
-      Window? view,
-      String? data}) {
-    if (view == null) {
-      view = window;
-    }
-    TextEvent e = document._createEvent("TextEvent") as TextEvent;
-    e._initTextEvent(type, canBubble, cancelable, view, data);
-    return e;
-  }
-  // To suppress missing implicit constructor warnings.
-  factory TextEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get data native;
-
-  @JSName('initTextEvent')
-  void _initTextEvent(String? type, bool? bubbles, bool? cancelable,
-      Window? view, String? data) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TextMetrics")
-class TextMetrics extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TextMetrics._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get actualBoundingBoxAscent native;
-
-  num get actualBoundingBoxDescent native;
-
-  num get actualBoundingBoxLeft native;
-
-  num get actualBoundingBoxRight native;
-
-  num get alphabeticBaseline native;
-
-  num get emHeightAscent native;
-
-  num get emHeightDescent native;
-
-  num get fontBoundingBoxAscent native;
-
-  num get fontBoundingBoxDescent native;
-
-  num get hangingBaseline native;
-
-  num get ideographicBaseline native;
-
-  num get width native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TextTrack")
-class TextTrack extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory TextTrack._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `cuechange` events to event
-   * handlers that are not necessarily instances of [TextTrack].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> cueChangeEvent =
-      const EventStreamProvider<Event>('cuechange');
-
-  TextTrackCueList? get activeCues native;
-
-  TextTrackCueList? get cues native;
-
-  String get id native;
-
-  String get kind native;
-
-  String get label native;
-
-  String get language native;
-
-  String get mode native;
-
-  set mode(String value) native;
-
-  void addCue(TextTrackCue cue) native;
-
-  void removeCue(TextTrackCue cue) native;
-
-  /// Stream of `cuechange` events handled by this [TextTrack].
-  Stream<Event> get onCueChange => cueChangeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("TextTrackCue")
-class TextTrackCue extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory TextTrackCue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `enter` events to event
-   * handlers that are not necessarily instances of [TextTrackCue].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> enterEvent =
-      const EventStreamProvider<Event>('enter');
-
-  /**
-   * Static factory designed to expose `exit` events to event
-   * handlers that are not necessarily instances of [TextTrackCue].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> exitEvent =
-      const EventStreamProvider<Event>('exit');
-
-  num get endTime native;
-
-  set endTime(num value) native;
-
-  String get id native;
-
-  set id(String value) native;
-
-  bool get pauseOnExit native;
-
-  set pauseOnExit(bool value) native;
-
-  num get startTime native;
-
-  set startTime(num value) native;
-
-  TextTrack? get track native;
-
-  /// Stream of `enter` events handled by this [TextTrackCue].
-  Stream<Event> get onEnter => enterEvent.forTarget(this);
-
-  /// Stream of `exit` events handled by this [TextTrackCue].
-  Stream<Event> get onExit => exitEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("TextTrackCueList")
-class TextTrackCueList extends Interceptor
-    with ListMixin<TextTrackCue>, ImmutableListMixin<TextTrackCue>
-    implements List<TextTrackCue>, JavaScriptIndexingBehavior<TextTrackCue> {
-  // To suppress missing implicit constructor warnings.
-  factory TextTrackCueList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  TextTrackCue operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("TextTrackCue", "#[#]", this, index);
-  }
-
-  void operator []=(int index, TextTrackCue value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<TextTrackCue> mixins.
-  // TextTrackCue is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  TextTrackCue get first {
-    if (this.length > 0) {
-      return JS('TextTrackCue', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  TextTrackCue get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('TextTrackCue', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  TextTrackCue get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('TextTrackCue', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  TextTrackCue elementAt(int index) => this[index];
-  // -- end List<TextTrackCue> mixins.
-
-  TextTrackCue __getter__(int index) native;
-
-  TextTrackCue? getCueById(String id) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TextTrackList")
-class TextTrackList extends EventTarget
-    with ListMixin<TextTrack>, ImmutableListMixin<TextTrack>
-    implements List<TextTrack>, JavaScriptIndexingBehavior<TextTrack> {
-  // To suppress missing implicit constructor warnings.
-  factory TextTrackList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `addtrack` events to event
-   * handlers that are not necessarily instances of [TextTrackList].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<TrackEvent> addTrackEvent =
-      const EventStreamProvider<TrackEvent>('addtrack');
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  int get length => JS("int", "#.length", this);
-
-  TextTrack operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("TextTrack", "#[#]", this, index);
-  }
-
-  void operator []=(int index, TextTrack value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<TextTrack> mixins.
-  // TextTrack is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  TextTrack get first {
-    if (this.length > 0) {
-      return JS('TextTrack', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  TextTrack get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('TextTrack', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  TextTrack get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('TextTrack', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  TextTrack elementAt(int index) => this[index];
-  // -- end List<TextTrack> mixins.
-
-  TextTrack __getter__(int index) native;
-
-  TextTrack? getTrackById(String id) native;
-
-  /// Stream of `addtrack` events handled by this [TextTrackList].
-  Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLTimeElement")
-class TimeElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TimeElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TimeElement.created() : super.created();
-
-  String get dateTime native;
-
-  set dateTime(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("TimeRanges")
-class TimeRanges extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TimeRanges._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  double end(int index) native;
-
-  double start(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void TimeoutHandler();
-// Copyright (c) 2012, 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.
-
-@Native("HTMLTitleElement")
-class TitleElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TitleElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TitleElement() => JS<TitleElement>(
-      'returns:TitleElement;creates:TitleElement;new:true',
-      '#.createElement(#)',
-      document,
-      "title");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TitleElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("Touch")
-class Touch extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Touch._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Touch(Map initDict) {
-    var initDict_1 = convertDartToNative_Dictionary(initDict);
-    return Touch._create_1(initDict_1);
-  }
-  static Touch _create_1(initDict) => JS('Touch', 'new Touch(#)', initDict);
-
-  @JSName('clientX')
-  num get _clientX native;
-
-  @JSName('clientY')
-  num get _clientY native;
-
-  num get force native;
-
-  int get identifier native;
-
-  @JSName('pageX')
-  num get _pageX native;
-
-  @JSName('pageY')
-  num get _pageY native;
-
-  @JSName('radiusX')
-  num get _radiusX native;
-
-  @JSName('radiusY')
-  num get _radiusY native;
-
-  String? get region native;
-
-  num get rotationAngle native;
-
-  @JSName('screenX')
-  num get _screenX native;
-
-  @JSName('screenY')
-  num get _screenY native;
-
-  EventTarget? get target => _convertNativeToDart_EventTarget(this._get_target);
-  @JSName('target')
-  @Creates('Element|Document')
-  @Returns('Element|Document')
-  dynamic get _get_target native;
-
-// As of Chrome 37, these all changed from long to double.  This code
-// preserves backwards compatibility for the time being.
-  int get __clientX => JS<num>('num', '#.clientX', this).round();
-  int get __clientY => JS<num>('num', '#.clientY', this).round();
-  int get __screenX => JS<num>('num', '#.screenX', this).round();
-  int get __screenY => JS<num>('num', '#.screenY', this).round();
-  int get __pageX => JS<num>('num', '#.pageX', this).round();
-  int get __pageY => JS<num>('num', '#.pageY', this).round();
-  int get __radiusX => JS<num>('num', '#.radiusX', this).round();
-  int get __radiusY => JS<num>('num', '#.radiusY', this).round();
-
-  Point get client => new Point(__clientX, __clientY);
-
-  Point get page => new Point(__pageX, __pageY);
-
-  Point get screen => new Point(__screenX, __screenY);
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  int get radiusX => __radiusX;
-
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  int get radiusY => __radiusY;
-}
-// Copyright (c) 2013, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("TouchEvent")
-class TouchEvent extends UIEvent {
-  // To suppress missing implicit constructor warnings.
-  factory TouchEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TouchEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return TouchEvent._create_1(type, eventInitDict_1);
-    }
-    return TouchEvent._create_2(type);
-  }
-  static TouchEvent _create_1(type, eventInitDict) =>
-      JS('TouchEvent', 'new TouchEvent(#,#)', type, eventInitDict);
-  static TouchEvent _create_2(type) =>
-      JS('TouchEvent', 'new TouchEvent(#)', type);
-
-  bool get altKey native;
-
-  TouchList get changedTouches native;
-
-  bool get ctrlKey native;
-
-  bool get metaKey native;
-
-  bool get shiftKey native;
-
-  TouchList get targetTouches native;
-
-  TouchList get touches native;
-
-  /**
-   * Checks if touch events supported on the current platform.
-   */
-  static bool get supported {
-    try {
-      return TouchEvent('touches') is TouchEvent;
-    } catch (_) {}
-
-    return false;
-  }
-}
-// Copyright (c) 2013, 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.
-
-@Native("TouchList")
-class TouchList extends Interceptor
-    with ListMixin<Touch>, ImmutableListMixin<Touch>
-    implements JavaScriptIndexingBehavior<Touch>, List<Touch> {
-  // To suppress missing implicit constructor warnings.
-  factory TouchList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!document.createTouchList');
-
-  int get length => JS("int", "#.length", this);
-
-  Touch operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Touch", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Touch value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Touch> mixins.
-  // Touch is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Touch get first {
-    if (this.length > 0) {
-      return JS('Touch', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Touch get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Touch', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Touch get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Touch', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Touch elementAt(int index) => this[index];
-  // -- end List<Touch> mixins.
-
-  Touch? item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TrackDefault")
-class TrackDefault extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TrackDefault._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TrackDefault(
-      String type, String language, String label, List<String> kinds,
-      [String? byteStreamTrackID]) {
-    if (byteStreamTrackID != null) {
-      List kinds_1 = convertDartToNative_StringArray(kinds);
-      return TrackDefault._create_1(
-          type, language, label, kinds_1, byteStreamTrackID);
-    }
-    List kinds_1 = convertDartToNative_StringArray(kinds);
-    return TrackDefault._create_2(type, language, label, kinds_1);
-  }
-  static TrackDefault _create_1(
-          type, language, label, kinds, byteStreamTrackID) =>
-      JS('TrackDefault', 'new TrackDefault(#,#,#,#,#)', type, language, label,
-          kinds, byteStreamTrackID);
-  static TrackDefault _create_2(type, language, label, kinds) => JS(
-      'TrackDefault',
-      'new TrackDefault(#,#,#,#)',
-      type,
-      language,
-      label,
-      kinds);
-
-  String get byteStreamTrackID native;
-
-  Object get kinds native;
-
-  String get label native;
-
-  String get language native;
-
-  String get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TrackDefaultList")
-class TrackDefaultList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TrackDefaultList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TrackDefaultList([List<TrackDefault>? trackDefaults]) {
-    if (trackDefaults != null) {
-      return TrackDefaultList._create_1(trackDefaults);
-    }
-    return TrackDefaultList._create_2();
-  }
-  static TrackDefaultList _create_1(trackDefaults) =>
-      JS('TrackDefaultList', 'new TrackDefaultList(#)', trackDefaults);
-  static TrackDefaultList _create_2() =>
-      JS('TrackDefaultList', 'new TrackDefaultList()');
-
-  int get length native;
-
-  TrackDefault item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("HTMLTrackElement")
-class TrackElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory TrackElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TrackElement() => document.createElement("track") as TrackElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TrackElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => Element.isTagSupported('track');
-
-  static const int ERROR = 3;
-
-  static const int LOADED = 2;
-
-  static const int LOADING = 1;
-
-  static const int NONE = 0;
-
-  @JSName('default')
-  bool get defaultValue native;
-
-  @JSName('default')
-  set defaultValue(bool value) native;
-
-  String get kind native;
-
-  set kind(String value) native;
-
-  String get label native;
-
-  set label(String value) native;
-
-  int get readyState native;
-
-  String get src native;
-
-  set src(String value) native;
-
-  String get srclang native;
-
-  set srclang(String value) native;
-
-  TextTrack get track native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("TrackEvent")
-class TrackEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory TrackEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TrackEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return TrackEvent._create_1(type, eventInitDict_1);
-    }
-    return TrackEvent._create_2(type);
-  }
-  static TrackEvent _create_1(type, eventInitDict) =>
-      JS('TrackEvent', 'new TrackEvent(#,#)', type, eventInitDict);
-  static TrackEvent _create_2(type) =>
-      JS('TrackEvent', 'new TrackEvent(#)', type);
-
-  @Creates('Null')
-  Object? get track native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TransitionEvent,WebKitTransitionEvent")
-class TransitionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory TransitionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TransitionEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return TransitionEvent._create_1(type, eventInitDict_1);
-    }
-    return TransitionEvent._create_2(type);
-  }
-  static TransitionEvent _create_1(type, eventInitDict) =>
-      JS('TransitionEvent', 'new TransitionEvent(#,#)', type, eventInitDict);
-  static TransitionEvent _create_2(type) =>
-      JS('TransitionEvent', 'new TransitionEvent(#)', type);
-
-  num get elapsedTime native;
-
-  String get propertyName native;
-
-  String get pseudoElement native;
-}
-// Copyright (c) 2013, 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.
-
-@Unstable()
-@Native("TreeWalker")
-class TreeWalker extends Interceptor {
-  factory TreeWalker(Node root, int whatToShow) {
-    return document._createTreeWalker(root, whatToShow, null);
-  }
-  // To suppress missing implicit constructor warnings.
-  factory TreeWalker._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Node get currentNode native;
-
-  set currentNode(Node value) native;
-
-  NodeFilter? get filter native;
-
-  Node get root native;
-
-  int get whatToShow native;
-
-  Node? firstChild() native;
-
-  Node? lastChild() native;
-
-  Node? nextNode() native;
-
-  Node? nextSibling() native;
-
-  Node? parentNode() native;
-
-  Node? previousNode() native;
-
-  Node? previousSibling() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TrustedHTML")
-class TrustedHtml extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TrustedHtml._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static TrustedHtml escape(String html) native;
-
-  static TrustedHtml unsafelyCreate(String html) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TrustedScriptURL")
-class TrustedScriptUrl extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TrustedScriptUrl._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static TrustedScriptUrl unsafelyCreate(String url) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("TrustedURL")
-class TrustedUrl extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TrustedUrl._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static TrustedUrl create(String url) native;
-
-  static TrustedUrl unsafelyCreate(String url) native;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-@Native("UIEvent")
-class UIEvent extends Event {
-  // In JS, canBubble and cancelable are technically required parameters to
-  // init*Event. In practice, though, if they aren't provided they simply
-  // default to false (since that's Boolean(undefined)).
-  //
-  // Contrary to JS, we default canBubble and cancelable to true, since that's
-  // what people want most of the time anyway.
-  factory UIEvent(String type,
-      {Window? view,
-      int detail: 0,
-      bool canBubble: true,
-      bool cancelable: true}) {
-    if (view == null) {
-      view = window;
-    }
-    UIEvent e = document._createEvent("UIEvent") as UIEvent;
-    e._initUIEvent(type, canBubble, cancelable, view, detail);
-    return e;
-  }
-
-  factory UIEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return UIEvent._create_1(type, eventInitDict_1);
-    }
-    return UIEvent._create_2(type);
-  }
-  static UIEvent _create_1(type, eventInitDict) =>
-      JS('UIEvent', 'new UIEvent(#,#)', type, eventInitDict);
-  static UIEvent _create_2(type) => JS('UIEvent', 'new UIEvent(#)', type);
-
-  int get detail native;
-
-  InputDeviceCapabilities? get sourceCapabilities native;
-
-  WindowBase? get view => _convertNativeToDart_Window(this._get_view);
-  @JSName('view')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_view native;
-
-  @JSName('which')
-  @Unstable()
-  int get _which native;
-
-  @JSName('initUIEvent')
-  void _initUIEvent(String type, bool bubbles, bool cancelable, Window? view,
-      int detail) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLUListElement")
-class UListElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory UListElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory UListElement() => JS<UListElement>(
-      'returns:UListElement;creates:UListElement;new:true',
-      '#.createElement(#)',
-      document,
-      "ul");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  UListElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("UnderlyingSourceBase")
-class UnderlyingSourceBase extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory UnderlyingSourceBase._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future cancel(Object? reason) =>
-      promiseToFuture(JS("", "#.cancel(#)", this, reason));
-
-  void notifyLockAcquired() native;
-
-  void notifyLockReleased() native;
-
-  Future pull() => promiseToFuture(JS("", "#.pull()", this));
-
-  Future start(Object stream) =>
-      promiseToFuture(JS("", "#.start(#)", this, stream));
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLUnknownElement")
-class UnknownElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory UnknownElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  UnknownElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("URL")
-class Url extends Interceptor {
-  static String createObjectUrl(blob_OR_source_OR_stream) => JS(
-      'String',
-      '(self.URL || self.webkitURL).createObjectURL(#)',
-      blob_OR_source_OR_stream);
-
-  static String createObjectUrlFromSource(MediaSource source) =>
-      JS('String', '(self.URL || self.webkitURL).createObjectURL(#)', source);
-
-  static String createObjectUrlFromStream(MediaStream stream) =>
-      JS('String', '(self.URL || self.webkitURL).createObjectURL(#)', stream);
-
-  static String createObjectUrlFromBlob(Blob blob) =>
-      JS('String', '(self.URL || self.webkitURL).createObjectURL(#)', blob);
-
-  static void revokeObjectUrl(String url) =>
-      JS('void', '(self.URL || self.webkitURL).revokeObjectURL(#)', url);
-
-  String toString() => JS('String', 'String(#)', this);
-
-  // To suppress missing implicit constructor warnings.
-  factory Url._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get hash native;
-
-  set hash(String value) native;
-
-  String get host native;
-
-  set host(String value) native;
-
-  String get hostname native;
-
-  set hostname(String value) native;
-
-  String get href native;
-
-  set href(String value) native;
-
-  String get origin native;
-
-  String get password native;
-
-  set password(String value) native;
-
-  String get pathname native;
-
-  set pathname(String value) native;
-
-  String get port native;
-
-  set port(String value) native;
-
-  String get protocol native;
-
-  set protocol(String value) native;
-
-  String get search native;
-
-  set search(String value) native;
-
-  UrlSearchParams get searchParams native;
-
-  String get username native;
-
-  set username(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("URLSearchParams")
-class UrlSearchParams extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory UrlSearchParams._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory UrlSearchParams([Object? init]) {
-    if (init != null) {
-      return UrlSearchParams._create_1(init);
-    }
-    return UrlSearchParams._create_2();
-  }
-  static UrlSearchParams _create_1(init) =>
-      JS('UrlSearchParams', 'new URLSearchParams(#)', init);
-  static UrlSearchParams _create_2() =>
-      JS('UrlSearchParams', 'new URLSearchParams()');
-
-  void append(String name, String value) native;
-
-  void delete(String name) native;
-
-  String? get(String name) native;
-
-  List<String> getAll(String name) native;
-
-  bool has(String name) native;
-
-  void set(String name, String value) native;
-
-  void sort() native;
-}
-// Copyright (c) 2012, 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.
-
-abstract class UrlUtilsReadOnly extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory UrlUtilsReadOnly._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get hash native;
-
-  String get host native;
-
-  String get hostname native;
-
-  String get href native;
-
-  String get origin native;
-
-  String get pathname native;
-
-  String get port native;
-
-  String get protocol native;
-
-  String get search native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VR")
-class VR extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory VR._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future getDevices() => promiseToFuture(JS("", "#.getDevices()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRCoordinateSystem")
-class VRCoordinateSystem extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRCoordinateSystem._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Float32List? getTransformTo(VRCoordinateSystem other) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRDevice")
-class VRDevice extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory VRDevice._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get deviceName native;
-
-  bool get isExternal native;
-
-  Future requestSession([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(JS("", "#.requestSession(#)", this, options_dict));
-  }
-
-  Future supportsSession([Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(JS("", "#.supportsSession(#)", this, options_dict));
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRDeviceEvent")
-class VRDeviceEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory VRDeviceEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VRDeviceEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return VRDeviceEvent._create_1(type, eventInitDict_1);
-  }
-  static VRDeviceEvent _create_1(type, eventInitDict) =>
-      JS('VRDeviceEvent', 'new VRDeviceEvent(#,#)', type, eventInitDict);
-
-  VRDevice get device native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRDisplay")
-class VRDisplay extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory VRDisplay._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  VRDisplayCapabilities get capabilities native;
-
-  num get depthFar native;
-
-  set depthFar(num value) native;
-
-  num get depthNear native;
-
-  set depthNear(num value) native;
-
-  int get displayId native;
-
-  String get displayName native;
-
-  bool get isPresenting native;
-
-  VRStageParameters get stageParameters native;
-
-  void cancelAnimationFrame(int handle) native;
-
-  Future exitPresent() => promiseToFuture(JS("", "#.exitPresent()", this));
-
-  VREyeParameters getEyeParameters(String whichEye) native;
-
-  bool getFrameData(VRFrameData frameData) native;
-
-  List<Map> getLayers() native;
-
-  int requestAnimationFrame(FrameRequestCallback callback) native;
-
-  Future requestPresent(List<Map> layers) =>
-      promiseToFuture(JS("", "#.requestPresent(#)", this, layers));
-
-  void submitFrame() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRDisplayCapabilities")
-class VRDisplayCapabilities extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRDisplayCapabilities._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get canPresent native;
-
-  bool get hasExternalDisplay native;
-
-  bool get hasPosition native;
-
-  int get maxLayers native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRDisplayEvent")
-class VRDisplayEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory VRDisplayEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VRDisplayEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return VRDisplayEvent._create_1(type, eventInitDict_1);
-    }
-    return VRDisplayEvent._create_2(type);
-  }
-  static VRDisplayEvent _create_1(type, eventInitDict) =>
-      JS('VRDisplayEvent', 'new VRDisplayEvent(#,#)', type, eventInitDict);
-  static VRDisplayEvent _create_2(type) =>
-      JS('VRDisplayEvent', 'new VRDisplayEvent(#)', type);
-
-  VRDisplay get display native;
-
-  String get reason native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VREyeParameters")
-class VREyeParameters extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VREyeParameters._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Float32List get offset native;
-
-  int get renderHeight native;
-
-  int get renderWidth native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRFrameData")
-class VRFrameData extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRFrameData._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VRFrameData() {
-    return VRFrameData._create_1();
-  }
-  static VRFrameData _create_1() => JS('VRFrameData', 'new VRFrameData()');
-
-  Float32List get leftProjectionMatrix native;
-
-  Float32List get leftViewMatrix native;
-
-  VRPose get pose native;
-
-  Float32List get rightProjectionMatrix native;
-
-  Float32List get rightViewMatrix native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRFrameOfReference")
-class VRFrameOfReference extends VRCoordinateSystem {
-  // To suppress missing implicit constructor warnings.
-  factory VRFrameOfReference._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  VRStageBounds? get bounds native;
-
-  num get emulatedHeight native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRPose")
-class VRPose extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRPose._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Float32List? get angularAcceleration native;
-
-  Float32List? get angularVelocity native;
-
-  Float32List? get linearAcceleration native;
-
-  Float32List? get linearVelocity native;
-
-  Float32List? get orientation native;
-
-  Float32List? get position native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRSession")
-class VRSession extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory VRSession._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> blurEvent =
-      const EventStreamProvider<Event>('blur');
-
-  static const EventStreamProvider<Event> focusEvent =
-      const EventStreamProvider<Event>('focus');
-
-  num get depthFar native;
-
-  set depthFar(num value) native;
-
-  num get depthNear native;
-
-  set depthNear(num value) native;
-
-  VRDevice get device native;
-
-  bool get exclusive native;
-
-  Future end() => promiseToFuture(JS("", "#.end()", this));
-
-  Future requestFrameOfReference(String type, [Map? options]) {
-    var options_dict = null;
-    if (options != null) {
-      options_dict = convertDartToNative_Dictionary(options);
-    }
-    return promiseToFuture(
-        JS("", "#.requestFrameOfReference(#, #)", this, type, options_dict));
-  }
-
-  Stream<Event> get onBlur => blurEvent.forTarget(this);
-
-  Stream<Event> get onFocus => focusEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRSessionEvent")
-class VRSessionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory VRSessionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VRSessionEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return VRSessionEvent._create_1(type, eventInitDict_1);
-  }
-  static VRSessionEvent _create_1(type, eventInitDict) =>
-      JS('VRSessionEvent', 'new VRSessionEvent(#,#)', type, eventInitDict);
-
-  VRSession get session native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRStageBounds")
-class VRStageBounds extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRStageBounds._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  List<VRStageBoundsPoint> get geometry native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRStageBoundsPoint")
-class VRStageBoundsPoint extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRStageBoundsPoint._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get x native;
-
-  num get z native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VRStageParameters")
-class VRStageParameters extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VRStageParameters._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Float32List get sittingToStandingTransform native;
-
-  num get sizeX native;
-
-  num get sizeZ native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ValidityState")
-class ValidityState extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ValidityState._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get badInput native;
-
-  bool get customError native;
-
-  bool get patternMismatch native;
-
-  bool get rangeOverflow native;
-
-  bool get rangeUnderflow native;
-
-  bool get stepMismatch native;
-
-  bool get tooLong native;
-
-  bool get tooShort native;
-
-  bool get typeMismatch native;
-
-  bool get valid native;
-
-  bool get valueMissing native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("HTMLVideoElement")
-class VideoElement extends MediaElement implements CanvasImageSource {
-  // To suppress missing implicit constructor warnings.
-  factory VideoElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VideoElement() => JS<VideoElement>(
-      'returns:VideoElement;creates:VideoElement;new:true',
-      '#.createElement(#)',
-      document,
-      "video");
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  VideoElement.created() : super.created();
-
-  int get height native;
-
-  set height(int value) native;
-
-  String get poster native;
-
-  set poster(String value) native;
-
-  int get videoHeight native;
-
-  int get videoWidth native;
-
-  @JSName('webkitDecodedFrameCount')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  int get decodedFrameCount native;
-
-  @JSName('webkitDroppedFrameCount')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  int get droppedFrameCount native;
-
-  int get width native;
-
-  set width(int value) native;
-
-  VideoPlaybackQuality getVideoPlaybackQuality() native;
-
-  @JSName('webkitEnterFullscreen')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void enterFullscreen() native;
-
-  @JSName('webkitExitFullscreen')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  void exitFullscreen() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VideoPlaybackQuality")
-class VideoPlaybackQuality extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VideoPlaybackQuality._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get corruptedVideoFrames native;
-
-  num get creationTime native;
-
-  int get droppedVideoFrames native;
-
-  int get totalVideoFrames native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VideoTrack")
-class VideoTrack extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VideoTrack._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get id native;
-
-  String get kind native;
-
-  String get label native;
-
-  String get language native;
-
-  bool get selected native;
-
-  set selected(bool value) native;
-
-  SourceBuffer? get sourceBuffer native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VideoTrackList")
-class VideoTrackList extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory VideoTrackList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  int get length native;
-
-  int get selectedIndex native;
-
-  VideoTrack __getter__(int index) native;
-
-  VideoTrack? getTrackById(String id) native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("VisualViewport")
-class VisualViewport extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory VisualViewport._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> resizeEvent =
-      const EventStreamProvider<Event>('resize');
-
-  static const EventStreamProvider<Event> scrollEvent =
-      const EventStreamProvider<Event>('scroll');
-
-  num get height native;
-
-  num get offsetLeft native;
-
-  num get offsetTop native;
-
-  num get pageLeft native;
-
-  num get pageTop native;
-
-  num get scale native;
-
-  num get width native;
-
-  Stream<Event> get onResize => resizeEvent.forTarget(this);
-
-  Stream<Event> get onScroll => scrollEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void VoidCallback();
-// Copyright (c) 2012, 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.
-
-@Native("VTTCue")
-class VttCue extends TextTrackCue {
-  // To suppress missing implicit constructor warnings.
-  factory VttCue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VttCue(num startTime, num endTime, String text) {
-    return VttCue._create_1(startTime, endTime, text);
-  }
-  static VttCue _create_1(startTime, endTime, text) =>
-      JS('VttCue', 'new VTTCue(#,#,#)', startTime, endTime, text);
-
-  String get align native;
-
-  set align(String value) native;
-
-  @Creates('Null')
-  @Returns('num|String')
-  Object? get line native;
-
-  set line(Object? value) native;
-
-  @Creates('Null')
-  @Returns('num|String')
-  Object? get position native;
-
-  set position(Object? value) native;
-
-  VttRegion? get region native;
-
-  set region(VttRegion? value) native;
-
-  num get size native;
-
-  set size(num value) native;
-
-  bool get snapToLines native;
-
-  set snapToLines(bool value) native;
-
-  String get text native;
-
-  set text(String value) native;
-
-  String get vertical native;
-
-  set vertical(String value) native;
-
-  @JSName('getCueAsHTML')
-  DocumentFragment getCueAsHtml() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("VTTRegion")
-class VttRegion extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VttRegion._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VttRegion() {
-    return VttRegion._create_1();
-  }
-  static VttRegion _create_1() => JS('VttRegion', 'new VTTRegion()');
-
-  String get id native;
-
-  set id(String value) native;
-
-  int get lines native;
-
-  set lines(int value) native;
-
-  num get regionAnchorX native;
-
-  set regionAnchorX(num value) native;
-
-  num get regionAnchorY native;
-
-  set regionAnchorY(num value) native;
-
-  String get scroll native;
-
-  set scroll(String value) native;
-
-  num get viewportAnchorX native;
-
-  set viewportAnchorX(num value) native;
-
-  num get viewportAnchorY native;
-
-  set viewportAnchorY(num value) native;
-
-  num get width native;
-
-  set width(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Use the WebSocket interface to connect to a WebSocket,
- * and to send and receive data on that WebSocket.
- *
- * To use a WebSocket in your web app, first create a WebSocket object,
- * passing the WebSocket URL as an argument to the constructor.
- *
- *     var webSocket = new WebSocket('ws://127.0.0.1:1337/ws');
- *
- * To send data on the WebSocket, use the [send] method.
- *
- *     if (webSocket != null && webSocket.readyState == WebSocket.OPEN) {
- *       webSocket.send(data);
- *     } else {
- *       print('WebSocket not connected, message $data not sent');
- *     }
- *
- * To receive data on the WebSocket, register a listener for message events.
- *
- *     webSocket.onMessage.listen((MessageEvent e) {
- *       receivedData(e.data);
- *     });
- *
- * The message event handler receives a [MessageEvent] object
- * as its sole argument.
- * You can also define open, close, and error handlers,
- * as specified by [WebSocketEvents].
- *
- * For more information, see the
- * [WebSockets](http://www.dartlang.org/docs/library-tour/#html-websockets)
- * section of the library tour and
- * [Introducing WebSockets](http://www.html5rocks.com/en/tutorials/websockets/basics/),
- * an HTML5Rocks.com tutorial.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("WebSocket")
-class WebSocket extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory WebSocket._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `close` events to event
-   * handlers that are not necessarily instances of [WebSocket].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<CloseEvent> closeEvent =
-      const EventStreamProvider<CloseEvent>('close');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [WebSocket].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [WebSocket].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  /**
-   * Static factory designed to expose `open` events to event
-   * handlers that are not necessarily instances of [WebSocket].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> openEvent =
-      const EventStreamProvider<Event>('open');
-
-  factory WebSocket(String url, [Object? protocols]) {
-    if (protocols != null) {
-      return WebSocket._create_1(url, protocols);
-    }
-    return WebSocket._create_2(url);
-  }
-  static WebSocket _create_1(url, protocols) =>
-      JS('WebSocket', 'new WebSocket(#,#)', url, protocols);
-  static WebSocket _create_2(url) => JS('WebSocket', 'new WebSocket(#)', url);
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      JS('bool', 'typeof window.WebSocket != "undefined"');
-
-  static const int CLOSED = 3;
-
-  static const int CLOSING = 2;
-
-  static const int CONNECTING = 0;
-
-  static const int OPEN = 1;
-
-  String get binaryType native;
-
-  set binaryType(String value) native;
-
-  int get bufferedAmount native;
-
-  String get extensions native;
-
-  String get protocol native;
-
-  int get readyState native;
-
-  String get url native;
-
-  void close([int? code, String? reason]) native;
-
-  /**
-   * Transmit data to the server over this connection.
-   *
-   * This method accepts data of type [Blob], [ByteBuffer], [String], or
-   * [TypedData]. Named variants [sendBlob], [sendByteBuffer], [sendString],
-   * or [sendTypedData], in contrast, only accept data of the specified type.
-   */
-  void send(data) native;
-
-  @JSName('send')
-  /**
-   * Transmit data to the server over this connection.
-   *
-   * This method accepts data of type [Blob], [ByteBuffer], [String], or
-   * [TypedData]. Named variants [sendBlob], [sendByteBuffer], [sendString],
-   * or [sendTypedData], in contrast, only accept data of the specified type.
-   */
-  void sendBlob(Blob data) native;
-
-  @JSName('send')
-  /**
-   * Transmit data to the server over this connection.
-   *
-   * This method accepts data of type [Blob], [ByteBuffer], [String], or
-   * [TypedData]. Named variants [sendBlob], [sendByteBuffer], [sendString],
-   * or [sendTypedData], in contrast, only accept data of the specified type.
-   */
-  void sendByteBuffer(ByteBuffer data) native;
-
-  @JSName('send')
-  /**
-   * Transmit data to the server over this connection.
-   *
-   * This method accepts data of type [Blob], [ByteBuffer], [String], or
-   * [TypedData]. Named variants [sendBlob], [sendByteBuffer], [sendString],
-   * or [sendTypedData], in contrast, only accept data of the specified type.
-   */
-  void sendString(String data) native;
-
-  @JSName('send')
-  /**
-   * Transmit data to the server over this connection.
-   *
-   * This method accepts data of type [Blob], [ByteBuffer], [String], or
-   * [TypedData]. Named variants [sendBlob], [sendByteBuffer], [sendString],
-   * or [sendTypedData], in contrast, only accept data of the specified type.
-   */
-  void sendTypedData(TypedData data) native;
-
-  /// Stream of `close` events handled by this [WebSocket].
-  Stream<CloseEvent> get onClose => closeEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [WebSocket].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `message` events handled by this [WebSocket].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  /// Stream of `open` events handled by this [WebSocket].
-  Stream<Event> get onOpen => openEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("WheelEvent")
-class WheelEvent extends MouseEvent {
-  factory WheelEvent(String type,
-      {Window? view,
-      num deltaX: 0,
-      num deltaY: 0,
-      num deltaZ: 0,
-      int deltaMode: 0,
-      int detail: 0,
-      int screenX: 0,
-      int screenY: 0,
-      int clientX: 0,
-      int clientY: 0,
-      int button: 0,
-      bool canBubble: true,
-      bool cancelable: true,
-      bool ctrlKey: false,
-      bool altKey: false,
-      bool shiftKey: false,
-      bool metaKey: false,
-      EventTarget? relatedTarget}) {
-    var options = {
-      'view': view,
-      'deltaMode': deltaMode,
-      'deltaX': deltaX,
-      'deltaY': deltaY,
-      'deltaZ': deltaZ,
-      'detail': detail,
-      'screenX': screenX,
-      'screenY': screenY,
-      'clientX': clientX,
-      'clientY': clientY,
-      'button': button,
-      'bubbles': canBubble,
-      'cancelable': cancelable,
-      'ctrlKey': ctrlKey,
-      'altKey': altKey,
-      'shiftKey': shiftKey,
-      'metaKey': metaKey,
-      'relatedTarget': relatedTarget,
-    };
-
-    if (view == null) {
-      view = window;
-    }
-
-    return JS('WheelEvent', 'new WheelEvent(#, #)', type,
-        convertDartToNative_Dictionary(options));
-  }
-
-  factory WheelEvent._(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return WheelEvent._create_1(type, eventInitDict_1);
-    }
-    return WheelEvent._create_2(type);
-  }
-  static WheelEvent _create_1(type, eventInitDict) =>
-      JS('WheelEvent', 'new WheelEvent(#,#)', type, eventInitDict);
-  static WheelEvent _create_2(type) =>
-      JS('WheelEvent', 'new WheelEvent(#)', type);
-
-  static const int DOM_DELTA_LINE = 0x01;
-
-  static const int DOM_DELTA_PAGE = 0x02;
-
-  static const int DOM_DELTA_PIXEL = 0x00;
-
-  @JSName('deltaX')
-  num get _deltaX native;
-
-  @JSName('deltaY')
-  num get _deltaY native;
-
-  num get deltaZ native;
-
-  /**
-   * The amount that is expected to scroll vertically, in units determined by
-   * [deltaMode].
-   *
-   * See also:
-   *
-   * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
-   */
-  num get deltaY {
-    if (JS('bool', '#.deltaY !== undefined', this)) {
-      // W3C WheelEvent
-      return this._deltaY;
-    }
-    throw new UnsupportedError('deltaY is not supported');
-  }
-
-  /**
-   * The amount that is expected to scroll horizontally, in units determined by
-   * [deltaMode].
-   *
-   * See also:
-   *
-   * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
-   */
-  num get deltaX {
-    if (JS('bool', '#.deltaX !== undefined', this)) {
-      // W3C WheelEvent
-      return this._deltaX;
-    }
-    throw new UnsupportedError('deltaX is not supported');
-  }
-
-  int get deltaMode {
-    if (JS('bool', '!!(#.deltaMode)', this)) {
-      return JS('int', '#.deltaMode', this);
-    }
-    // If not available then we're poly-filling and doing pixel scroll.
-    return 0;
-  }
-
-  num get _wheelDelta => JS('num', '#.wheelDelta', this);
-  num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this);
-  num get _detail => JS('num', '#.detail', this);
-
-  bool get _hasInitMouseScrollEvent =>
-      JS('bool', '!!(#.initMouseScrollEvent)', this);
-
-  @JSName('initMouseScrollEvent')
-  void _initMouseScrollEvent(
-      String type,
-      bool canBubble,
-      bool cancelable,
-      Window view,
-      int detail,
-      int screenX,
-      int screenY,
-      int clientX,
-      int clientY,
-      bool ctrlKey,
-      bool altKey,
-      bool shiftKey,
-      bool metaKey,
-      int button,
-      EventTarget relatedTarget,
-      int axis) native;
-
-  bool get _hasInitWheelEvent => JS('bool', '!!(#.initWheelEvent)', this);
-  @JSName('initWheelEvent')
-  void _initWheelEvent(
-      String eventType,
-      bool canBubble,
-      bool cancelable,
-      Window view,
-      int detail,
-      int screenX,
-      int screenY,
-      int clientX,
-      int clientY,
-      int button,
-      EventTarget relatedTarget,
-      String modifiersList,
-      int deltaX,
-      int deltaY,
-      int deltaZ,
-      int deltaMode) native;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Top-level container for the current browser tab or window.
- *
- * In a web browser, each window has a [Window] object, but within the context
- * of a script, this object represents only the current window.
- * Each other window, tab, and iframe has its own [Window] object.
- *
- * Each window contains a [Document] object, which contains all of the window's
- * content.
- *
- * Use the top-level `window` object to access the current window.
- * For example:
- *
- *     // Draw a scene when the window repaints.
- *     drawScene(num delta) {...}
- *     window.animationFrame.then(drawScene);.
- *
- *     // Write to the console.
- *     window.console.log('Jinkies!');
- *     window.console.error('Jeepers!');
- *
- * **Note:** This class represents only the current window, while [WindowBase]
- * is a representation of any window, including other tabs, windows, and frames.
- *
- * ## See also
- *
- * * [WindowBase]
- *
- * ## Other resources
- *
- * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN.
- * * [Window](http://www.w3.org/TR/Window/) from the W3C.
- */
-@Native("Window,DOMWindow")
-class Window extends EventTarget
-    implements
-        WindowEventHandlers,
-        WindowBase,
-        GlobalEventHandlers,
-        _WindowTimers,
-        WindowBase64 {
-  /**
-   * Returns a Future that completes just before the window is about to
-   * repaint so the user can draw an animation frame.
-   *
-   * If you need to later cancel this animation, use [requestAnimationFrame]
-   * instead.
-   *
-   * The [Future] completes to a timestamp that represents a floating
-   * point value of the number of milliseconds that have elapsed since the page
-   * started to load (which is also the timestamp at this call to
-   * animationFrame).
-   *
-   * Note: The code that runs when the future completes should call
-   * [animationFrame] again for the animation to continue.
-   */
-  Future<num> get animationFrame {
-    var completer = new Completer<num>.sync();
-    requestAnimationFrame((time) {
-      completer.complete(time);
-    });
-    return completer.future;
-  }
-
-  /**
-   * The newest document in this window.
-   *
-   * ## Other resources
-   *
-   * * [Loading web
-   *   pages](https://html.spec.whatwg.org/multipage/browsers.html)
-   *   from WHATWG.
-   */
-  Document get document => JS('Document', '#.document', this);
-
-  WindowBase? _open2(url, name) =>
-      JS('Window|Null', '#.open(#,#)', this, url, name);
-
-  WindowBase? _open3(url, name, options) =>
-      JS('Window|Null', '#.open(#,#,#)', this, url, name, options);
-
-  /**
-   * Opens a new window.
-   *
-   * ## Other resources
-   *
-   * * [Window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window.open)
-   *   from MDN.
-   */
-  WindowBase open(String url, String name, [String? options]) {
-    if (options == null) {
-      return _DOMWindowCrossFrame._createSafe(_open2(url, name));
-    } else {
-      return _DOMWindowCrossFrame._createSafe(_open3(url, name, options));
-    }
-  }
-
-  // API level getter and setter for Location.
-  // TODO: The cross domain safe wrapper can be inserted here.
-  /**
-   * The current location of this window.
-   *
-   *     Location currentLocation = window.location;
-   *     print(currentLocation.href); // 'http://www.example.com:80/'
-   */
-  Location get location => _location;
-
-  // TODO: consider forcing users to do: window.location.assign('string').
-  /**
-   * Sets the window's location, which causes the browser to navigate to the new
-   * location.
-   */
-  set location(value) {
-    _location = value;
-  }
-
-  // Native getter and setter to access raw Location object.
-  dynamic get _location => JS('Location|Null', '#.location', this);
-  set _location(value) {
-    JS('void', '#.location = #', this, value);
-  }
-
-  /**
-   * Called to draw an animation frame and then request the window to repaint
-   * after [callback] has finished (creating the animation).
-   *
-   * Use this method only if you need to later call [cancelAnimationFrame]. If
-   * not, the preferred Dart idiom is to set animation frames by calling
-   * [animationFrame], which returns a Future.
-   *
-   * Returns a non-zero valued integer to represent the request id for this
-   * request. This value only needs to be saved if you intend to call
-   * [cancelAnimationFrame] so you can specify the particular animation to
-   * cancel.
-   *
-   * Note: The supplied [callback] needs to call [requestAnimationFrame] again
-   * for the animation to continue.
-   */
-  int requestAnimationFrame(FrameRequestCallback callback) {
-    _ensureRequestAnimationFrame();
-    return _requestAnimationFrame(_wrapZone(callback)!);
-  }
-
-  /**
-   * Cancels an animation frame request.
-   *
-   * ## Other resources
-   *
-   * * [Window.cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window.cancelAnimationFrame)
-   *   from MDN.
-   */
-  void cancelAnimationFrame(int id) {
-    _ensureRequestAnimationFrame();
-    _cancelAnimationFrame(id);
-  }
-
-  @JSName('requestAnimationFrame')
-  int _requestAnimationFrame(FrameRequestCallback callback) native;
-
-  @JSName('cancelAnimationFrame')
-  void _cancelAnimationFrame(int id) native;
-
-  _ensureRequestAnimationFrame() {
-    if (JS<bool>(
-        'bool',
-        '!!(#.requestAnimationFrame && #.cancelAnimationFrame)',
-        this,
-        this)) return;
-
-    JS(
-        'void',
-        r"""
-  (function($this) {
-   var vendors = ['ms', 'moz', 'webkit', 'o'];
-   for (var i = 0; i < vendors.length && !$this.requestAnimationFrame; ++i) {
-     $this.requestAnimationFrame = $this[vendors[i] + 'RequestAnimationFrame'];
-     $this.cancelAnimationFrame =
-         $this[vendors[i]+'CancelAnimationFrame'] ||
-         $this[vendors[i]+'CancelRequestAnimationFrame'];
-   }
-   if ($this.requestAnimationFrame && $this.cancelAnimationFrame) return;
-   $this.requestAnimationFrame = function(callback) {
-      return window.setTimeout(function() {
-        callback(Date.now());
-      }, 16 /* 16ms ~= 60fps */);
-   };
-   $this.cancelAnimationFrame = function(id) { clearTimeout(id); }
-  })(#)""",
-        this);
-  }
-
-  /**
-   * Gets an instance of the Indexed DB factory to being using Indexed DB.
-   *
-   * Use [indexed_db.IdbFactory.supported] to check if Indexed DB is supported on the
-   * current platform.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME, '23.0')
-  @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')
-  @SupportedBrowser(SupportedBrowser.IE, '10.0')
-  IdbFactory? get indexedDB => JS(
-      'IdbFactory|Null', // If not supported, returns null.
-      '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
-      this,
-      this,
-      this);
-
-  /// The debugging console for this window.
-  Console get console => Console._safeConsole;
-
-  /**
-   * Access a sandboxed file system of `size` bytes.
-   *
-   * If `persistent` is true, the application will request permission from the
-   * user to create lasting storage. This storage cannot be freed without the
-   * user's permission. Returns a [Future] whose value stores a reference to
-   * the sandboxed file system for use. Because the file system is sandboxed,
-   * applications cannot access file systems created in other web pages.
-   */
-  Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) {
-    return _requestFileSystem(persistent ? 1 : 0, size);
-  }
-
-  /**
-   * convertPointFromNodeToPage and convertPointFromPageToNode are removed.
-   * see http://dev.w3.org/csswg/cssom-view/#geometry
-   */
-  static bool get supportsPointConversions => DomPoint.supported;
-  // To suppress missing implicit constructor warnings.
-  factory Window._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `contentloaded` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> contentLoadedEvent =
-      const EventStreamProvider<Event>('DOMContentLoaded');
-
-  /**
-   * Static factory designed to expose `devicemotion` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<DeviceMotionEvent> deviceMotionEvent =
-      const EventStreamProvider<DeviceMotionEvent>('devicemotion');
-
-  /**
-   * Static factory designed to expose `deviceorientation` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<DeviceOrientationEvent>
-      deviceOrientationEvent =
-      const EventStreamProvider<DeviceOrientationEvent>('deviceorientation');
-
-  /**
-   * Static factory designed to expose `hashchange` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> hashChangeEvent =
-      const EventStreamProvider<Event>('hashchange');
-
-  static const EventStreamProvider<Event> loadStartEvent =
-      const EventStreamProvider<Event>('loadstart');
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  /**
-   * Static factory designed to expose `offline` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> offlineEvent =
-      const EventStreamProvider<Event>('offline');
-
-  /**
-   * Static factory designed to expose `online` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> onlineEvent =
-      const EventStreamProvider<Event>('online');
-
-  /**
-   * Static factory designed to expose `pagehide` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> pageHideEvent =
-      const EventStreamProvider<Event>('pagehide');
-
-  /**
-   * Static factory designed to expose `pageshow` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> pageShowEvent =
-      const EventStreamProvider<Event>('pageshow');
-
-  /**
-   * Static factory designed to expose `popstate` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<PopStateEvent> popStateEvent =
-      const EventStreamProvider<PopStateEvent>('popstate');
-
-  static const EventStreamProvider<Event> progressEvent =
-      const EventStreamProvider<Event>('progress');
-
-  /**
-   * Static factory designed to expose `storage` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<StorageEvent> storageEvent =
-      const EventStreamProvider<StorageEvent>('storage');
-
-  /**
-   * Static factory designed to expose `unload` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> unloadEvent =
-      const EventStreamProvider<Event>('unload');
-
-  /**
-   * Static factory designed to expose `animationend` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  static const EventStreamProvider<AnimationEvent> animationEndEvent =
-      const EventStreamProvider<AnimationEvent>('webkitAnimationEnd');
-
-  /**
-   * Static factory designed to expose `animationiteration` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  static const EventStreamProvider<AnimationEvent> animationIterationEvent =
-      const EventStreamProvider<AnimationEvent>('webkitAnimationIteration');
-
-  /**
-   * Static factory designed to expose `animationstart` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  static const EventStreamProvider<AnimationEvent> animationStartEvent =
-      const EventStreamProvider<AnimationEvent>('webkitAnimationStart');
-
-  /**
-   * Indicates that file system data cannot be cleared unless given user
-   * permission.
-   *
-   * ## Other resources
-   *
-   * * [Exploring the FileSystem
-   *   APIs](http://www.html5rocks.com/en/tutorials/file/filesystem/)
-   *   from HTML5Rocks.
-   * * [File API](http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem)
-   *   from W3C.
-   */
-  static const int PERSISTENT = 1;
-
-  /**
-   * Indicates that file system data can be cleared at any time.
-   *
-   * ## Other resources
-   *
-   * * [Exploring the FileSystem
-   *   APIs](http://www.html5rocks.com/en/tutorials/file/filesystem/) from HTML5Rocks.
-   * * [File API](http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem)
-   *   from W3C.
-   */
-  static const int TEMPORARY = 0;
-
-  _Worklet get animationWorklet native;
-
-  /**
-   * The application cache for this window.
-   *
-   * ## Other resources
-   *
-   * * [A beginner's guide to using the application
-   *   cache](http://www.html5rocks.com/en/tutorials/appcache/beginner)
-   *   from HTML5Rocks.
-   * * [Application cache
-   *   API](https://html.spec.whatwg.org/multipage/browsers.html#application-cache-api)
-   *   from WHATWG.
-   */
-
-  ApplicationCache get applicationCache native;
-
-  _Worklet get audioWorklet native;
-
-  CacheStorage get caches native;
-
-  bool get closed native;
-
-  CookieStore get cookieStore native;
-
-  /**
-   * Entrypoint for the browser's cryptographic functions.
-   *
-   * ## Other resources
-   *
-   * * [Web cryptography API](http://www.w3.org/TR/WebCryptoAPI/) from W3C.
-   */
-
-  Crypto get crypto native;
-
-  CustomElementRegistry get customElements native;
-
-  /// *Deprecated*.
-
-  String get defaultStatus native;
-
-  set defaultStatus(String value) native;
-
-  /// *Deprecated*.
-
-  String get defaultstatus native;
-
-  set defaultstatus(String value) native;
-
-  /**
-   * The ratio between physical pixels and logical CSS pixels.
-   *
-   * ## Other resources
-   *
-   * * [devicePixelRatio](http://www.quirksmode.org/blog/archives/2012/06/devicepixelrati.html)
-   *   from quirksmode.
-   * * [More about devicePixelRatio](http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html)
-   *   from quirksmode.
-   */
-
-  num get devicePixelRatio native;
-
-  External get external native;
-
-  /**
-   * The current session history for this window's newest document.
-   *
-   * ## Other resources
-   *
-   * * [Loading web pages](https://html.spec.whatwg.org/multipage/browsers.html)
-   *   from WHATWG.
-   */
-
-  History get history native;
-
-  /**
-   * The height of the viewport including scrollbars.
-   *
-   * ## Other resources
-   *
-   * * [Window.innerHeight](https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight)
-   *   from MDN.
-   */
-
-  int get innerHeight native;
-
-  /**
-   * The width of the viewport including scrollbars.
-   *
-   * ## Other resources
-   *
-   * * [Window.innerWidth](https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth)
-   *   from MDN.
-   */
-
-  int get innerWidth native;
-
-  bool get isSecureContext native;
-
-  /**
-   * Storage for this window that persists across sessions.
-   *
-   * ## Other resources
-   *
-   * * [DOM storage guide](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage)
-   *   from MDN.
-   * * [The past, present & future of local storage for web
-   *   applications](http://diveintohtml5.info/storage.html) from Dive Into HTML5.
-   * * [Local storage specification](http://www.w3.org/TR/webstorage/#the-localstorage-attribute)
-   *   from W3C.
-   */
-
-  Storage get localStorage native;
-
-  /**
-   * This window's location bar, which displays the URL.
-   *
-   * ## Other resources
-   *
-   * * [Browser interface
-   *   elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
-   *   from WHATWG.
-   */
-
-  BarProp get locationbar native;
-
-  /**
-   * This window's menu bar, which displays menu commands.
-   *
-   * ## Other resources
-   *
-   * * [Browser interface
-   *   elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
-   *   from WHATWG.
-   */
-
-  BarProp get menubar native;
-
-  /**
-   * The name of this window.
-   *
-   * ## Other resources
-   *
-   * * [Window.name](https://developer.mozilla.org/en-US/docs/Web/API/Window/name)
-   *   from MDN.
-   */
-
-  String get name native;
-
-  set name(String value) native;
-
-  /**
-   * The user agent accessing this window.
-   *
-   * ## Other resources
-   *
-   * * [The navigator
-   *   object](https://html.spec.whatwg.org/multipage/webappapis.html#the-navigator-object)
-   *   from WHATWG.
-   */
-
-  Navigator get navigator native;
-
-  /**
-   * Whether objects are drawn offscreen before being displayed.
-   *
-   * ## Other resources
-   *
-   * * [offscreenBuffering](https://webplatform.github.io/docs/dom/HTMLElement/offscreenBuffering/)
-   *   from WebPlatform.org.
-   */
-
-  bool get offscreenBuffering native;
-
-  WindowBase? get opener => _convertNativeToDart_Window(this._get_opener);
-  @JSName('opener')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_opener native;
-
-  set opener(WindowBase? value) native;
-
-  int get orientation native;
-
-  String get origin native;
-
-  /**
-   * The height of this window including all user interface elements.
-   *
-   * ## Other resources
-   *
-   * * [Window.outerHeight](https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight)
-   *   from MDN.
-   */
-
-  int get outerHeight native;
-
-  /**
-   * The width of the window including all user interface elements.
-   *
-   * ## Other resources
-   *
-   * * [Window.outerWidth](https://developer.mozilla.org/en-US/docs/Web/API/Window/outerWidth)
-   *   from MDN.
-   */
-
-  int get outerWidth native;
-
-  @JSName('pageXOffset')
-
-  /**
-   * The distance this window has been scrolled horizontally.
-   *
-   * This attribute is an alias for [scrollX].
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface
-   *   specification](http://www.w3.org/TR/cssom-view/#screen) from W3C.
-   * * [scrollX and
-   *   pageXOffset](https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollX)
-   *   from MDN.
-   */
-
-  num get _pageXOffset native;
-
-  @JSName('pageYOffset')
-
-  /**
-   * The distance this window has been scrolled vertically.
-   *
-   * This attribute is an alias for [scrollY].
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface
-   *   specification](http://www.w3.org/TR/cssom-view/#screen) from W3C.
-   * * [scrollY and
-   *   pageYOffset](https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY)
-   *   from MDN.
-   */
-
-  num get _pageYOffset native;
-
-  WindowBase? get parent => _convertNativeToDart_Window(this._get_parent);
-  @JSName('parent')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_parent native;
-
-  /**
-   * Timing and navigation data for this window.
-   *
-   * ## Other resources
-   *
-   * * [Measuring page load speed with navigation
-   *   timeing](http://www.html5rocks.com/en/tutorials/webperformance/basics/)
-   *   from HTML5Rocks.
-   * * [Navigation timing
-   *   specification](http://www.w3.org/TR/navigation-timing/) from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.FIREFOX)
-  @SupportedBrowser(SupportedBrowser.IE)
-  Performance get performance native;
-
-  /**
-   * Information about the screen displaying this window.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
-   *   from W3C.
-   */
-
-  Screen get screen native;
-
-  /**
-   * The distance from the left side of the screen to the left side of this
-   * window.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
-   *   from W3C.
-   */
-
-  int get screenLeft native;
-
-  /**
-   * The distance from the top of the screen to the top of this window.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
-   *   from W3C.
-   */
-
-  int get screenTop native;
-
-  /**
-   * The distance from the left side of the screen to the mouse pointer.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
-   *   from W3C.
-   */
-
-  int get screenX native;
-
-  /**
-   * The distance from the top of the screen to the mouse pointer.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
-   *   from W3C.
-   */
-
-  int get screenY native;
-
-  /**
-   * This window's scroll bars.
-   *
-   * ## Other resources
-   *
-   * * [Browser interface
-   *   elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
-   *   from WHATWG.
-   */
-
-  BarProp get scrollbars native;
-
-  /**
-   * The current window.
-   *
-   * ## Other resources
-   *
-   * * [Window.self](https://developer.mozilla.org/en-US/docs/Web/API/Window.self)
-   *   from MDN.
-   */
-  WindowBase? get self => _convertNativeToDart_Window(this._get_self);
-  @JSName('self')
-  /**
-   * The current window.
-   *
-   * ## Other resources
-   *
-   * * [Window.self](https://developer.mozilla.org/en-US/docs/Web/API/Window.self)
-   *   from MDN.
-   */
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_self native;
-
-  /**
-   * Storage for this window that is cleared when this session ends.
-   *
-   * ## Other resources
-   *
-   * * [DOM storage
-   *   guide](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage)
-   *   from MDN.
-   * * [The past, present & future of local storage for web
-   *   applications](http://diveintohtml5.info/storage.html) from Dive Into HTML5.
-   * * [Local storage
-   *   specification](http://www.w3.org/TR/webstorage/#dom-sessionstorage) from W3C.
-   */
-
-  Storage get sessionStorage native;
-
-  /**
-   * Access to speech synthesis in the browser.
-   *
-   * ## Other resources
-   *
-   * * [Web speech
-   *   specification](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section)
-   *   from W3C.
-   */
-
-  SpeechSynthesis get speechSynthesis native;
-
-  /// *Deprecated*.
-
-  String get status native;
-
-  set status(String value) native;
-
-  /**
-   * This window's status bar.
-   *
-   * ## Other resources
-   *
-   * * [Browser interface
-   *   elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
-   *   from WHATWG.
-   */
-
-  BarProp get statusbar native;
-
-  /**
-   * Access to CSS media queries.
-   *
-   * ## Other resources
-   *
-   * * [StyleMedia class
-   *   reference](https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/StyleMedia/)
-   *   from Safari Developer Library.
-   */
-
-  StyleMedia get styleMedia native;
-
-  /**
-   * This window's tool bar.
-   *
-   * ## Other resources
-   *
-   * * [Browser interface
-   *   elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
-   *   from WHATWG.
-   */
-
-  BarProp get toolbar native;
-
-  WindowBase? get top => _convertNativeToDart_Window(this._get_top);
-  @JSName('top')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_top native;
-
-  VisualViewport? get visualViewport native;
-
-  /**
-   * The current window.
-   *
-   * ## Other resources
-   *
-   * * [Window.window](https://developer.mozilla.org/en-US/docs/Web/API/Window.window)
-   *   from MDN.
-   */
-  WindowBase? get window => _convertNativeToDart_Window(this._get_window);
-  @JSName('window')
-  /**
-   * The current window.
-   *
-   * ## Other resources
-   *
-   * * [Window.window](https://developer.mozilla.org/en-US/docs/Web/API/Window.window)
-   *   from MDN.
-   */
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  dynamic get _get_window native;
-
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  WindowBase __getter__(index_OR_name) {
-    if ((index_OR_name is int)) {
-      return _convertNativeToDart_Window(__getter___1(index_OR_name))!;
-    }
-    if ((index_OR_name is String)) {
-      return _convertNativeToDart_Window(__getter___2(index_OR_name))!;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('__getter__')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  __getter___1(int index) native;
-  @JSName('__getter__')
-  @Creates('Window|=Object')
-  @Returns('Window|=Object')
-  __getter___2(String name) native;
-
-  /**
-   * Displays a modal alert to the user.
-   *
-   * ## Other resources
-   *
-   * * [User prompts](https://html.spec.whatwg.org/multipage/webappapis.html#user-prompts)
-   *   from WHATWG.
-   */
-  void alert([String? message]) native;
-
-  void cancelIdleCallback(int handle) native;
-
-  void close() native;
-
-  /**
-   * Displays a modal OK/Cancel prompt to the user.
-   *
-   * ## Other resources
-   *
-   * * [User prompts](https://html.spec.whatwg.org/multipage/webappapis.html#user-prompts)
-   *   from WHATWG.
-   */
-  bool confirm([String? message]) native;
-
-  Future fetch(/*RequestInfo*/ input, [Map? init]) {
-    var init_dict = null;
-    if (init != null) {
-      init_dict = convertDartToNative_Dictionary(init);
-    }
-    return promiseToFuture(JS("", "#.fetch(#, #)", this, input, init_dict));
-  }
-
-  /**
-   * Finds text in this window.
-   *
-   * ## Other resources
-   *
-   * * [Window.find](https://developer.mozilla.org/en-US/docs/Web/API/Window.find)
-   *   from MDN.
-   */
-  bool find(String? string, bool? caseSensitive, bool? backwards, bool? wrap,
-      bool? wholeWord, bool? searchInFrames, bool? showDialog) native;
-
-  @JSName('getComputedStyle')
-  CssStyleDeclaration _getComputedStyle(Element elt, [String? pseudoElt])
-      native;
-
-  StylePropertyMapReadonly getComputedStyleMap(
-      Element element, String? pseudoElement) native;
-
-  @JSName('getMatchedCSSRules')
-  /**
-   * Returns all CSS rules that apply to the element's pseudo-element.
-   */
-  @Returns('_CssRuleList')
-  @Creates('_CssRuleList')
-  List<CssRule> getMatchedCssRules(Element? element, String? pseudoElement)
-      native;
-
-  /**
-   * Returns the currently selected text.
-   *
-   * ## Other resources
-   *
-   * * [Window.getSelection](https://developer.mozilla.org/en-US/docs/Web/API/Window.getSelection)
-   *   from MDN.
-   */
-  Selection? getSelection() native;
-
-  /**
-   * Returns a list of media queries for the given query string.
-   *
-   * ## Other resources
-   *
-   * * [Testing media
-   *   queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Testing_media_queries)
-   *   from MDN.
-   * * [The MediaQueryList
-   *   specification](http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface) from W3C.
-   */
-  MediaQueryList matchMedia(String query) native;
-
-  /**
-   * Moves this window.
-   *
-   * x and y can be negative.
-   *
-   * ## Other resources
-   *
-   * * [Window.moveBy](https://developer.mozilla.org/en-US/docs/Web/API/Window.moveBy)
-   *   from MDN.
-   * * [Window.moveBy](http://dev.w3.org/csswg/cssom-view/#dom-window-moveby) from W3C.
-   */
-  void moveBy(int x, int y) native;
-
-  @JSName('moveTo')
-  void _moveTo(int x, int y) native;
-
-  @JSName('openDatabase')
-
-  /// *Deprecated.*
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @Creates('SqlDatabase')
-  SqlDatabase _openDatabase(
-      String name, String version, String displayName, int estimatedSize,
-      [DatabaseCallback? creationCallback]) native;
-
-  void postMessage(/*any*/ message, String targetOrigin,
-      [List<Object>? transfer]) {
-    if (transfer != null) {
-      var message_1 = convertDartToNative_SerializedScriptValue(message);
-      _postMessage_1(message_1, targetOrigin, transfer);
-      return;
-    }
-    var message_1 = convertDartToNative_SerializedScriptValue(message);
-    _postMessage_2(message_1, targetOrigin);
-    return;
-  }
-
-  @JSName('postMessage')
-  void _postMessage_1(message, targetOrigin, List<Object> transfer) native;
-  @JSName('postMessage')
-  void _postMessage_2(message, targetOrigin) native;
-
-  /**
-   * Opens the print dialog for this window.
-   *
-   * ## Other resources
-   *
-   * * [Window.print](https://developer.mozilla.org/en-US/docs/Web/API/Window.print)
-   *   from MDN.
-   */
-  void print() native;
-
-  int requestIdleCallback(IdleRequestCallback callback, [Map? options]) {
-    if (options != null) {
-      var callback_1 = convertDartClosureToJS(callback, 1);
-      var options_2 = convertDartToNative_Dictionary(options);
-      return _requestIdleCallback_1(callback_1, options_2);
-    }
-    var callback_1 = convertDartClosureToJS(callback, 1);
-    return _requestIdleCallback_2(callback_1);
-  }
-
-  @JSName('requestIdleCallback')
-  int _requestIdleCallback_1(callback, options) native;
-  @JSName('requestIdleCallback')
-  int _requestIdleCallback_2(callback) native;
-
-  /**
-   * Resizes this window by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.resizeBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeBy)
-   *   from MDN.
-   */
-  void resizeBy(int x, int y) native;
-
-  /**
-   * Resizes this window to a specific width and height.
-   *
-   * ## Other resources
-   *
-   * * [Window.resizeTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo)
-   *   from MDN.
-   */
-  void resizeTo(int x, int y) native;
-
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scrollTo].
-   *
-   * ## Other resources
-   *
-   * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
-   *   from MDN.
-   */
-  void scroll([options_OR_x, y, Map? scrollOptions]) {
-    if (options_OR_x == null && y == null && scrollOptions == null) {
-      _scroll_1();
-      return;
-    }
-    if ((options_OR_x is Map) && y == null && scrollOptions == null) {
-      var options_1 = convertDartToNative_Dictionary(options_OR_x);
-      _scroll_2(options_1);
-      return;
-    }
-    if ((y is num) && (options_OR_x is num) && scrollOptions == null) {
-      _scroll_3(options_OR_x, y);
-      return;
-    }
-    if ((y is int) && (options_OR_x is int) && scrollOptions == null) {
-      _scroll_4(options_OR_x, y);
-      return;
-    }
-    if (scrollOptions != null && (y is int) && (options_OR_x is int)) {
-      var scrollOptions_1 = convertDartToNative_Dictionary(scrollOptions);
-      _scroll_5(options_OR_x, y, scrollOptions_1);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('scroll')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scrollTo].
-   *
-   * ## Other resources
-   *
-   * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
-   *   from MDN.
-   */
-  void _scroll_1() native;
-  @JSName('scroll')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scrollTo].
-   *
-   * ## Other resources
-   *
-   * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
-   *   from MDN.
-   */
-  void _scroll_2(options) native;
-  @JSName('scroll')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scrollTo].
-   *
-   * ## Other resources
-   *
-   * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
-   *   from MDN.
-   */
-  void _scroll_3(num? x, num? y) native;
-  @JSName('scroll')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scrollTo].
-   *
-   * ## Other resources
-   *
-   * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
-   *   from MDN.
-   */
-  void _scroll_4(int? x, int? y) native;
-  @JSName('scroll')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scrollTo].
-   *
-   * ## Other resources
-   *
-   * * [Window.scroll](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll)
-   *   from MDN.
-   */
-  void _scroll_5(int? x, int? y, scrollOptions) native;
-
-  /**
-   * Scrolls the page horizontally and vertically by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
-   *   from MDN.
-   */
-  void scrollBy([options_OR_x, y, Map? scrollOptions]) {
-    if (options_OR_x == null && y == null && scrollOptions == null) {
-      _scrollBy_1();
-      return;
-    }
-    if ((options_OR_x is Map) && y == null && scrollOptions == null) {
-      var options_1 = convertDartToNative_Dictionary(options_OR_x);
-      _scrollBy_2(options_1);
-      return;
-    }
-    if ((y is num) && (options_OR_x is num) && scrollOptions == null) {
-      _scrollBy_3(options_OR_x, y);
-      return;
-    }
-    if ((y is int) && (options_OR_x is int) && scrollOptions == null) {
-      _scrollBy_4(options_OR_x, y);
-      return;
-    }
-    if (scrollOptions != null && (y is int) && (options_OR_x is int)) {
-      var scrollOptions_1 = convertDartToNative_Dictionary(scrollOptions);
-      _scrollBy_5(options_OR_x, y, scrollOptions_1);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('scrollBy')
-  /**
-   * Scrolls the page horizontally and vertically by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
-   *   from MDN.
-   */
-  void _scrollBy_1() native;
-  @JSName('scrollBy')
-  /**
-   * Scrolls the page horizontally and vertically by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
-   *   from MDN.
-   */
-  void _scrollBy_2(options) native;
-  @JSName('scrollBy')
-  /**
-   * Scrolls the page horizontally and vertically by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
-   *   from MDN.
-   */
-  void _scrollBy_3(num? x, num? y) native;
-  @JSName('scrollBy')
-  /**
-   * Scrolls the page horizontally and vertically by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
-   *   from MDN.
-   */
-  void _scrollBy_4(int? x, int? y) native;
-  @JSName('scrollBy')
-  /**
-   * Scrolls the page horizontally and vertically by an offset.
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollBy](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy)
-   *   from MDN.
-   */
-  void _scrollBy_5(int? x, int? y, scrollOptions) native;
-
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scroll].
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
-   *   from MDN.
-   */
-  void scrollTo([options_OR_x, y, Map? scrollOptions]) {
-    if (options_OR_x == null && y == null && scrollOptions == null) {
-      _scrollTo_1();
-      return;
-    }
-    if ((options_OR_x is Map) && y == null && scrollOptions == null) {
-      var options_1 = convertDartToNative_Dictionary(options_OR_x);
-      _scrollTo_2(options_1);
-      return;
-    }
-    if ((y is num) && (options_OR_x is num) && scrollOptions == null) {
-      _scrollTo_3(options_OR_x, y);
-      return;
-    }
-    if ((y is int) && (options_OR_x is int) && scrollOptions == null) {
-      _scrollTo_4(options_OR_x, y);
-      return;
-    }
-    if (scrollOptions != null && (y is int) && (options_OR_x is int)) {
-      var scrollOptions_1 = convertDartToNative_Dictionary(scrollOptions);
-      _scrollTo_5(options_OR_x, y, scrollOptions_1);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('scrollTo')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scroll].
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
-   *   from MDN.
-   */
-  void _scrollTo_1() native;
-  @JSName('scrollTo')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scroll].
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
-   *   from MDN.
-   */
-  void _scrollTo_2(options) native;
-  @JSName('scrollTo')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scroll].
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
-   *   from MDN.
-   */
-  void _scrollTo_3(num? x, num? y) native;
-  @JSName('scrollTo')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scroll].
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
-   *   from MDN.
-   */
-  void _scrollTo_4(int? x, int? y) native;
-  @JSName('scrollTo')
-  /**
-   * Scrolls the page horizontally and vertically to a specific point.
-   *
-   * This method is identical to [scroll].
-   *
-   * ## Other resources
-   *
-   * * [Window.scrollTo](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo)
-   *   from MDN.
-   */
-  void _scrollTo_5(int? x, int? y, scrollOptions) native;
-
-  /**
-   * Stops the window from loading.
-   *
-   * ## Other resources
-   *
-   * * [The Window
-   *   object](http://www.w3.org/html/wg/drafts/html/master/browsers.html#the-window-object)
-   *   from W3C.
-   */
-  void stop() native;
-
-  @JSName('webkitRequestFileSystem')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  void __requestFileSystem(
-      int type, int size, _FileSystemCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  @JSName('webkitRequestFileSystem')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  Future<FileSystem> _requestFileSystem(int type, int size) {
-    var completer = new Completer<FileSystem>();
-    __requestFileSystem(type, size, (value) {
-      applyExtension('DOMFileSystem', value);
-      applyExtension('DirectoryEntry', value.root);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('webkitResolveLocalFileSystemURL')
-  /**
-   * Asynchronously retrieves a local filesystem entry.
-   *
-   * ## Other resources
-   *
-   * * [Obtaining access to file system entry
-   *   points](http://www.w3.org/TR/file-system-api/#obtaining-access-to-file-system-entry-points)
-   * from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  void _resolveLocalFileSystemUrl(String url, _EntryCallback successCallback,
-      [_ErrorCallback? errorCallback]) native;
-
-  @JSName('webkitResolveLocalFileSystemURL')
-  /**
-   * Asynchronously retrieves a local filesystem entry.
-   *
-   * ## Other resources
-   *
-   * * [Obtaining access to file system entry
-   *   points](http://www.w3.org/TR/file-system-api/#obtaining-access-to-file-system-entry-points)
-   * from W3C.
-   */
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  Future<Entry> resolveLocalFileSystemUrl(String url) {
-    var completer = new Completer<Entry>();
-    _resolveLocalFileSystemUrl(url, (value) {
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  // From WindowBase64
-
-  String atob(String atob) native;
-
-  String btoa(String btoa) native;
-
-  // From WindowTimers
-
-  @JSName('setInterval')
-  int _setInterval_String(String handler, [int? timeout, Object? arguments])
-      native;
-
-  @JSName('setTimeout')
-  int _setTimeout_String(String handler, [int? timeout, Object? arguments])
-      native;
-
-  @JSName('clearInterval')
-  void _clearInterval([int? handle]) native;
-
-  @JSName('clearTimeout')
-  void _clearTimeout([int? handle]) native;
-
-  @JSName('setInterval')
-  int _setInterval(Object handler, [int? timeout]) native;
-
-  @JSName('setTimeout')
-  int _setTimeout(Object handler, [int? timeout]) native;
-
-  /// Stream of `contentloaded` events handled by this [Window].
-  Stream<Event> get onContentLoaded => contentLoadedEvent.forTarget(this);
-
-  /// Stream of `abort` events handled by this [Window].
-  Stream<Event> get onAbort => Element.abortEvent.forTarget(this);
-
-  /// Stream of `blur` events handled by this [Window].
-  Stream<Event> get onBlur => Element.blurEvent.forTarget(this);
-
-  Stream<Event> get onCanPlay => Element.canPlayEvent.forTarget(this);
-
-  Stream<Event> get onCanPlayThrough =>
-      Element.canPlayThroughEvent.forTarget(this);
-
-  /// Stream of `change` events handled by this [Window].
-  Stream<Event> get onChange => Element.changeEvent.forTarget(this);
-
-  /// Stream of `click` events handled by this [Window].
-  Stream<MouseEvent> get onClick => Element.clickEvent.forTarget(this);
-
-  /// Stream of `contextmenu` events handled by this [Window].
-  Stream<MouseEvent> get onContextMenu =>
-      Element.contextMenuEvent.forTarget(this);
-
-  /// Stream of `doubleclick` events handled by this [Window].
-  @DomName('Window.ondblclick')
-  Stream<Event> get onDoubleClick => Element.doubleClickEvent.forTarget(this);
-
-  /// Stream of `devicemotion` events handled by this [Window].
-  Stream<DeviceMotionEvent> get onDeviceMotion =>
-      deviceMotionEvent.forTarget(this);
-
-  /// Stream of `deviceorientation` events handled by this [Window].
-  Stream<DeviceOrientationEvent> get onDeviceOrientation =>
-      deviceOrientationEvent.forTarget(this);
-
-  /// Stream of `drag` events handled by this [Window].
-  Stream<MouseEvent> get onDrag => Element.dragEvent.forTarget(this);
-
-  /// Stream of `dragend` events handled by this [Window].
-  Stream<MouseEvent> get onDragEnd => Element.dragEndEvent.forTarget(this);
-
-  /// Stream of `dragenter` events handled by this [Window].
-  Stream<MouseEvent> get onDragEnter => Element.dragEnterEvent.forTarget(this);
-
-  /// Stream of `dragleave` events handled by this [Window].
-  Stream<MouseEvent> get onDragLeave => Element.dragLeaveEvent.forTarget(this);
-
-  /// Stream of `dragover` events handled by this [Window].
-  Stream<MouseEvent> get onDragOver => Element.dragOverEvent.forTarget(this);
-
-  /// Stream of `dragstart` events handled by this [Window].
-  Stream<MouseEvent> get onDragStart => Element.dragStartEvent.forTarget(this);
-
-  /// Stream of `drop` events handled by this [Window].
-  Stream<MouseEvent> get onDrop => Element.dropEvent.forTarget(this);
-
-  Stream<Event> get onDurationChange =>
-      Element.durationChangeEvent.forTarget(this);
-
-  Stream<Event> get onEmptied => Element.emptiedEvent.forTarget(this);
-
-  Stream<Event> get onEnded => Element.endedEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [Window].
-  Stream<Event> get onError => Element.errorEvent.forTarget(this);
-
-  /// Stream of `focus` events handled by this [Window].
-  Stream<Event> get onFocus => Element.focusEvent.forTarget(this);
-
-  /// Stream of `hashchange` events handled by this [Window].
-  Stream<Event> get onHashChange => hashChangeEvent.forTarget(this);
-
-  /// Stream of `input` events handled by this [Window].
-  Stream<Event> get onInput => Element.inputEvent.forTarget(this);
-
-  /// Stream of `invalid` events handled by this [Window].
-  Stream<Event> get onInvalid => Element.invalidEvent.forTarget(this);
-
-  /// Stream of `keydown` events handled by this [Window].
-  Stream<KeyboardEvent> get onKeyDown => Element.keyDownEvent.forTarget(this);
-
-  /// Stream of `keypress` events handled by this [Window].
-  Stream<KeyboardEvent> get onKeyPress => Element.keyPressEvent.forTarget(this);
-
-  /// Stream of `keyup` events handled by this [Window].
-  Stream<KeyboardEvent> get onKeyUp => Element.keyUpEvent.forTarget(this);
-
-  /// Stream of `load` events handled by this [Window].
-  Stream<Event> get onLoad => Element.loadEvent.forTarget(this);
-
-  Stream<Event> get onLoadedData => Element.loadedDataEvent.forTarget(this);
-
-  Stream<Event> get onLoadedMetadata =>
-      Element.loadedMetadataEvent.forTarget(this);
-
-  Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
-
-  /// Stream of `message` events handled by this [Window].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  /// Stream of `mousedown` events handled by this [Window].
-  Stream<MouseEvent> get onMouseDown => Element.mouseDownEvent.forTarget(this);
-
-  /// Stream of `mouseenter` events handled by this [Window].
-  Stream<MouseEvent> get onMouseEnter =>
-      Element.mouseEnterEvent.forTarget(this);
-
-  /// Stream of `mouseleave` events handled by this [Window].
-  Stream<MouseEvent> get onMouseLeave =>
-      Element.mouseLeaveEvent.forTarget(this);
-
-  /// Stream of `mousemove` events handled by this [Window].
-  Stream<MouseEvent> get onMouseMove => Element.mouseMoveEvent.forTarget(this);
-
-  /// Stream of `mouseout` events handled by this [Window].
-  Stream<MouseEvent> get onMouseOut => Element.mouseOutEvent.forTarget(this);
-
-  /// Stream of `mouseover` events handled by this [Window].
-  Stream<MouseEvent> get onMouseOver => Element.mouseOverEvent.forTarget(this);
-
-  /// Stream of `mouseup` events handled by this [Window].
-  Stream<MouseEvent> get onMouseUp => Element.mouseUpEvent.forTarget(this);
-
-  /// Stream of `mousewheel` events handled by this [Window].
-  Stream<WheelEvent> get onMouseWheel =>
-      Element.mouseWheelEvent.forTarget(this);
-
-  /// Stream of `offline` events handled by this [Window].
-  Stream<Event> get onOffline => offlineEvent.forTarget(this);
-
-  /// Stream of `online` events handled by this [Window].
-  Stream<Event> get onOnline => onlineEvent.forTarget(this);
-
-  /// Stream of `pagehide` events handled by this [Window].
-  Stream<Event> get onPageHide => pageHideEvent.forTarget(this);
-
-  /// Stream of `pageshow` events handled by this [Window].
-  Stream<Event> get onPageShow => pageShowEvent.forTarget(this);
-
-  Stream<Event> get onPause => Element.pauseEvent.forTarget(this);
-
-  Stream<Event> get onPlay => Element.playEvent.forTarget(this);
-
-  Stream<Event> get onPlaying => Element.playingEvent.forTarget(this);
-
-  /// Stream of `popstate` events handled by this [Window].
-  Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
-
-  Stream<Event> get onProgress => progressEvent.forTarget(this);
-
-  Stream<Event> get onRateChange => Element.rateChangeEvent.forTarget(this);
-
-  /// Stream of `reset` events handled by this [Window].
-  Stream<Event> get onReset => Element.resetEvent.forTarget(this);
-
-  /// Stream of `resize` events handled by this [Window].
-  Stream<Event> get onResize => Element.resizeEvent.forTarget(this);
-
-  /// Stream of `scroll` events handled by this [Window].
-  Stream<Event> get onScroll => Element.scrollEvent.forTarget(this);
-
-  /// Stream of `search` events handled by this [Window].
-  Stream<Event> get onSearch => Element.searchEvent.forTarget(this);
-
-  Stream<Event> get onSeeked => Element.seekedEvent.forTarget(this);
-
-  Stream<Event> get onSeeking => Element.seekingEvent.forTarget(this);
-
-  /// Stream of `select` events handled by this [Window].
-  Stream<Event> get onSelect => Element.selectEvent.forTarget(this);
-
-  Stream<Event> get onStalled => Element.stalledEvent.forTarget(this);
-
-  /// Stream of `storage` events handled by this [Window].
-  Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
-
-  /// Stream of `submit` events handled by this [Window].
-  Stream<Event> get onSubmit => Element.submitEvent.forTarget(this);
-
-  Stream<Event> get onSuspend => Element.suspendEvent.forTarget(this);
-
-  Stream<Event> get onTimeUpdate => Element.timeUpdateEvent.forTarget(this);
-
-  /// Stream of `touchcancel` events handled by this [Window].
-  Stream<TouchEvent> get onTouchCancel =>
-      Element.touchCancelEvent.forTarget(this);
-
-  /// Stream of `touchend` events handled by this [Window].
-  Stream<TouchEvent> get onTouchEnd => Element.touchEndEvent.forTarget(this);
-
-  /// Stream of `touchmove` events handled by this [Window].
-  Stream<TouchEvent> get onTouchMove => Element.touchMoveEvent.forTarget(this);
-
-  /// Stream of `touchstart` events handled by this [Window].
-  Stream<TouchEvent> get onTouchStart =>
-      Element.touchStartEvent.forTarget(this);
-
-  /// Stream of `transitionend` events handled by this [Window].
-  Stream<TransitionEvent> get onTransitionEnd =>
-      Element.transitionEndEvent.forTarget(this);
-
-  /// Stream of `unload` events handled by this [Window].
-  Stream<Event> get onUnload => unloadEvent.forTarget(this);
-
-  Stream<Event> get onVolumeChange => Element.volumeChangeEvent.forTarget(this);
-
-  Stream<Event> get onWaiting => Element.waitingEvent.forTarget(this);
-
-  /// Stream of `animationend` events handled by this [Window].
-  Stream<AnimationEvent> get onAnimationEnd =>
-      animationEndEvent.forTarget(this);
-
-  /// Stream of `animationiteration` events handled by this [Window].
-  Stream<AnimationEvent> get onAnimationIteration =>
-      animationIterationEvent.forTarget(this);
-
-  /// Stream of `animationstart` events handled by this [Window].
-  Stream<AnimationEvent> get onAnimationStart =>
-      animationStartEvent.forTarget(this);
-
-  /**
-   * Static factory designed to expose `beforeunload` events to event
-   * handlers that are not necessarily instances of [Window].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent =
-      const _BeforeUnloadEventStreamProvider('beforeunload');
-
-  /// Stream of `beforeunload` events handled by this [Window].
-  Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
-
-  /// Stream of `wheel` events handled by this [Window].
-  Stream<WheelEvent> get onWheel => Element.wheelEvent.forTarget(this);
-
-  /**
-   * Moves this window to a specific position.
-   *
-   * x and y can be negative.
-   *
-   * ## Other resources
-   *
-   * * [Window.moveTo](https://developer.mozilla.org/en-US/docs/Web/API/Window.moveTo)
-   *   from MDN.
-   * * [Window.moveTo](http://dev.w3.org/csswg/cssom-view/#dom-window-moveto)
-   *   from W3C.
-   */
-  void moveTo(Point p) {
-    _moveTo(p.x.toInt(), p.y.toInt());
-  }
-
-  @JSName('openDatabase')
-  @SupportedBrowser(SupportedBrowser.CHROME)
-  @SupportedBrowser(SupportedBrowser.SAFARI)
-  @Creates('SqlDatabase')
-  SqlDatabase openDatabase(
-      String name, String version, String displayName, int estimatedSize,
-      [DatabaseCallback? creationCallback]) {
-    var db;
-    if (creationCallback == null)
-      db = _openDatabase(name, version, displayName, estimatedSize);
-    else
-      db = _openDatabase(
-          name, version, displayName, estimatedSize, creationCallback);
-
-    applyExtension('Database', db);
-
-    return db;
-  }
-
-  int get pageXOffset => JS<num>('num', '#.pageXOffset', this).round();
-
-  int get pageYOffset => JS<num>('num', '#.pageYOffset', this).round();
-
-  /**
-   * The distance this window has been scrolled horizontally.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface
-   *   specification](http://www.w3.org/TR/cssom-view/#screen) from W3C.
-   * * [scrollX](https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollX)
-   *   from MDN.
-   */
-  int get scrollX => JS<bool>('bool', '("scrollX" in #)', this)
-      ? JS<num>('num', '#.scrollX', this).round()
-      : document.documentElement!.scrollLeft;
-
-  /**
-   * The distance this window has been scrolled vertically.
-   *
-   * ## Other resources
-   *
-   * * [The Screen interface
-   *   specification](http://www.w3.org/TR/cssom-view/#screen) from W3C.
-   * * [scrollY](https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY)
-   *   from MDN.
-   */
-  int get scrollY => JS<bool>('bool', '("scrollY" in #)', this)
-      ? JS<num>('num', '#.scrollY', this).round()
-      : document.documentElement!.scrollTop;
-}
-
-class _BeforeUnloadEvent extends _WrappedEvent implements BeforeUnloadEvent {
-  String _returnValue;
-
-  _BeforeUnloadEvent(Event base)
-      : _returnValue = '',
-        super(base);
-
-  String get returnValue => _returnValue;
-
-  set returnValue(String value) {
-    _returnValue = value;
-    // FF and IE use the value as the return value, Chrome will return this from
-    // the event callback function.
-    if (JS<bool>('bool', '("returnValue" in #)', wrapped)) {
-      JS('void', '#.returnValue = #', wrapped, value);
-    }
-  }
-}
-
-class _BeforeUnloadEventStreamProvider
-    implements EventStreamProvider<BeforeUnloadEvent> {
-  final String _eventType;
-
-  const _BeforeUnloadEventStreamProvider(this._eventType);
-
-  Stream<BeforeUnloadEvent> forTarget(EventTarget? e,
-      {bool useCapture: false}) {
-    // Specify the generic type for EventStream only in dart2js.
-    var stream = new _EventStream<BeforeUnloadEvent>(e, _eventType, useCapture);
-    var controller = new StreamController<BeforeUnloadEvent>(sync: true);
-
-    stream.listen((event) {
-      var wrapped = new _BeforeUnloadEvent(event);
-      controller.add(wrapped);
-    });
-
-    return controller.stream;
-  }
-
-  String getEventType(EventTarget target) {
-    return _eventType;
-  }
-
-  ElementStream<BeforeUnloadEvent> forElement(Element e,
-      {bool useCapture: false}) {
-    // Specify the generic type for _ElementEventStreamImpl only in dart2js.
-    return new _ElementEventStreamImpl<BeforeUnloadEvent>(
-        e, _eventType, useCapture);
-  }
-
-  ElementStream<BeforeUnloadEvent> _forElementList(ElementList<Element> e,
-      {bool useCapture: false}) {
-    // Specify the generic type for _ElementEventStreamImpl only in dart2js.
-    return new _ElementListEventStreamImpl<BeforeUnloadEvent>(
-        e, _eventType, useCapture);
-  }
-}
-// Copyright (c) 2012, 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.
-
-abstract class WindowBase64 extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory WindowBase64._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String atob(String atob);
-
-  String btoa(String btoa);
-}
-// Copyright (c) 2012, 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.
-
-@Native("WindowClient")
-class WindowClient extends Client {
-  // To suppress missing implicit constructor warnings.
-  factory WindowClient._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get focused native;
-
-  String get visibilityState native;
-
-  Future<WindowClient> focus() =>
-      promiseToFuture<WindowClient>(JS("", "#.focus()", this));
-
-  Future<WindowClient> navigate(String url) =>
-      promiseToFuture<WindowClient>(JS("", "#.navigate(#)", this, url));
-}
-// Copyright (c) 2012, 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.
-
-abstract class WindowEventHandlers extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory WindowEventHandlers._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> hashChangeEvent =
-      const EventStreamProvider<Event>('hashchange');
-
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  static const EventStreamProvider<Event> offlineEvent =
-      const EventStreamProvider<Event>('offline');
-
-  static const EventStreamProvider<Event> onlineEvent =
-      const EventStreamProvider<Event>('online');
-
-  static const EventStreamProvider<PopStateEvent> popStateEvent =
-      const EventStreamProvider<PopStateEvent>('popstate');
-
-  static const EventStreamProvider<StorageEvent> storageEvent =
-      const EventStreamProvider<StorageEvent>('storage');
-
-  static const EventStreamProvider<Event> unloadEvent =
-      const EventStreamProvider<Event>('unload');
-
-  Stream<Event> get onHashChange => hashChangeEvent.forTarget(this);
-
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-
-  Stream<Event> get onOffline => offlineEvent.forTarget(this);
-
-  Stream<Event> get onOnline => onlineEvent.forTarget(this);
-
-  Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
-
-  Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
-
-  Stream<Event> get onUnload => unloadEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("Worker")
-class Worker extends EventTarget implements AbstractWorker {
-  // To suppress missing implicit constructor warnings.
-  factory Worker._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [Worker].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `message` events to event
-   * handlers that are not necessarily instances of [Worker].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<MessageEvent> messageEvent =
-      const EventStreamProvider<MessageEvent>('message');
-
-  factory Worker(String scriptUrl) {
-    return Worker._create_1(scriptUrl);
-  }
-  static Worker _create_1(scriptUrl) =>
-      JS('Worker', 'new Worker(#)', scriptUrl);
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      JS('bool', '(typeof window.Worker != "undefined")');
-
-  void postMessage(/*any*/ message, [List<Object>? transfer]) {
-    if (transfer != null) {
-      var message_1 = convertDartToNative_SerializedScriptValue(message);
-      _postMessage_1(message_1, transfer);
-      return;
-    }
-    var message_1 = convertDartToNative_SerializedScriptValue(message);
-    _postMessage_2(message_1);
-    return;
-  }
-
-  @JSName('postMessage')
-  void _postMessage_1(message, List<Object>? transfer) native;
-  @JSName('postMessage')
-  void _postMessage_2(message) native;
-
-  void terminate() native;
-
-  /// Stream of `error` events handled by this [Worker].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `message` events handled by this [Worker].
-  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("WorkerGlobalScope")
-class WorkerGlobalScope extends EventTarget
-    implements _WindowTimers, WindowBase64 {
-  // To suppress missing implicit constructor warnings.
-  factory WorkerGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [WorkerGlobalScope].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  String get addressSpace native;
-
-  CacheStorage get caches native;
-
-  Crypto get crypto native;
-
-  IdbFactory get indexedDB native;
-
-  bool get isSecureContext native;
-
-  _WorkerLocation get location native;
-
-  _WorkerNavigator get navigator native;
-
-  String get origin native;
-
-  WorkerPerformance get performance native;
-
-  WorkerGlobalScope get self native;
-
-  Future fetch(/*RequestInfo*/ input, [Map? init]) {
-    var init_dict = null;
-    if (init != null) {
-      init_dict = convertDartToNative_Dictionary(init);
-    }
-    return promiseToFuture(JS("", "#.fetch(#, #)", this, input, init_dict));
-  }
-
-  void importScripts(String urls) native;
-
-  // From WindowBase64
-
-  String atob(String atob) native;
-
-  String btoa(String btoa) native;
-
-  // From WindowTimers
-
-  @JSName('setInterval')
-  int _setInterval_String(String handler, [int? timeout, Object? arguments])
-      native;
-
-  @JSName('setTimeout')
-  int _setTimeout_String(String handler, [int? timeout, Object? arguments])
-      native;
-
-  @JSName('clearInterval')
-  void _clearInterval([int? handle]) native;
-
-  @JSName('clearTimeout')
-  void _clearTimeout([int? handle]) native;
-
-  @JSName('setInterval')
-  int _setInterval(Object handler, [int? timeout]) native;
-
-  @JSName('setTimeout')
-  int _setTimeout(Object handler, [int? timeout]) native;
-
-  /// Stream of `error` events handled by this [WorkerGlobalScope].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  static WorkerGlobalScope get instance => _workerSelf;
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("WorkerPerformance")
-class WorkerPerformance extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory WorkerPerformance._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  MemoryInfo get memory native;
-
-  num get timeOrigin native;
-
-  void clearMarks(String? markName) native;
-
-  void clearMeasures(String? measureName) native;
-
-  void clearResourceTimings() native;
-
-  List<PerformanceEntry> getEntries() native;
-
-  List<PerformanceEntry> getEntriesByName(String name, String? entryType)
-      native;
-
-  List<PerformanceEntry> getEntriesByType(String entryType) native;
-
-  void mark(String markName) native;
-
-  void measure(String measureName, String? startMark, String? endMark) native;
-
-  double now() native;
-
-  void setResourceTimingBufferSize(int maxSize) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WorkletAnimation")
-class WorkletAnimation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory WorkletAnimation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory WorkletAnimation(
-      String animatorName,
-      List<KeyframeEffectReadOnly> effects,
-      List<Object> timelines,
-      /*SerializedScriptValue*/ options) {
-    var options_1 = convertDartToNative_SerializedScriptValue(options);
-    return WorkletAnimation._create_1(
-        animatorName, effects, timelines, options_1);
-  }
-  static WorkletAnimation _create_1(
-          animatorName, effects, timelines, options) =>
-      JS('WorkletAnimation', 'new WorkletAnimation(#,#,#,#)', animatorName,
-          effects, timelines, options);
-
-  String get playState native;
-
-  void cancel() native;
-
-  void play() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WorkletGlobalScope")
-class WorkletGlobalScope extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory WorkletGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
-@deprecated // experimental
-@Native("XPathEvaluator")
-class XPathEvaluator extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory XPathEvaluator._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory XPathEvaluator() {
-    return XPathEvaluator._create_1();
-  }
-  static XPathEvaluator _create_1() =>
-      JS('XPathEvaluator', 'new XPathEvaluator()');
-
-  XPathExpression createExpression(String expression, XPathNSResolver? resolver)
-      native;
-
-  XPathNSResolver createNSResolver(Node nodeResolver) native;
-
-  XPathResult evaluate(
-      String expression, Node contextNode, XPathNSResolver? resolver,
-      [int? type, Object? inResult]) native;
-}
-// Copyright (c) 2012, 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.
-
-// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
-@deprecated // experimental
-@Native("XPathExpression")
-class XPathExpression extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory XPathExpression._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  XPathResult evaluate(Node contextNode, [int? type, Object? inResult]) native;
-}
-// Copyright (c) 2012, 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.
-
-// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
-@deprecated // experimental
-@Native("XPathNSResolver")
-class XPathNSResolver extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory XPathNSResolver._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('lookupNamespaceURI')
-  String? lookupNamespaceUri(String? prefix) native;
-}
-// Copyright (c) 2012, 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.
-
-// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
-@deprecated // experimental
-@Native("XPathResult")
-class XPathResult extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory XPathResult._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int ANY_TYPE = 0;
-
-  static const int ANY_UNORDERED_NODE_TYPE = 8;
-
-  static const int BOOLEAN_TYPE = 3;
-
-  static const int FIRST_ORDERED_NODE_TYPE = 9;
-
-  static const int NUMBER_TYPE = 1;
-
-  static const int ORDERED_NODE_ITERATOR_TYPE = 5;
-
-  static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;
-
-  static const int STRING_TYPE = 2;
-
-  static const int UNORDERED_NODE_ITERATOR_TYPE = 4;
-
-  static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;
-
-  bool get booleanValue native;
-
-  bool get invalidIteratorState native;
-
-  num get numberValue native;
-
-  int get resultType native;
-
-  Node get singleNodeValue native;
-
-  int get snapshotLength native;
-
-  String get stringValue native;
-
-  Node? iterateNext() native;
-
-  Node? snapshotItem(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("XMLDocument")
-class XmlDocument extends Document {
-  // To suppress missing implicit constructor warnings.
-  factory XmlDocument._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-// http://domparsing.spec.whatwg.org/#the-xmlserializer-interface
-@deprecated // stable
-@Native("XMLSerializer")
-class XmlSerializer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory XmlSerializer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory XmlSerializer() {
-    return XmlSerializer._create_1();
-  }
-  static XmlSerializer _create_1() =>
-      JS('XmlSerializer', 'new XMLSerializer()');
-
-  String serializeToString(Node root) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@deprecated // nonstandard
-@Native("XSLTProcessor")
-class XsltProcessor extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory XsltProcessor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory XsltProcessor() {
-    return XsltProcessor._create_1();
-  }
-  static XsltProcessor _create_1() =>
-      JS('XsltProcessor', 'new XSLTProcessor()');
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.XSLTProcessor)');
-
-  void clearParameters() native;
-
-  String? getParameter(String? namespaceURI, String localName) native;
-
-  void importStylesheet(Node style) native;
-
-  void removeParameter(String? namespaceURI, String localName) native;
-
-  void reset() native;
-
-  void setParameter(String? namespaceURI, String localName, String value)
-      native;
-
-  Document? transformToDocument(Node source) native;
-
-  DocumentFragment? transformToFragment(Node source, Document output) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Attr")
-class _Attr extends Node {
-  // To suppress missing implicit constructor warnings.
-  factory _Attr._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('localName')
-  String get _localName native;
-
-  String get name native;
-
-  @JSName('namespaceURI')
-  String? get _namespaceUri native;
-
-  String get value native;
-
-  set value(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Bluetooth")
-abstract class _Bluetooth extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _Bluetooth._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothCharacteristicProperties")
-abstract class _BluetoothCharacteristicProperties extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _BluetoothCharacteristicProperties._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothDevice")
-abstract class _BluetoothDevice extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory _BluetoothDevice._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothRemoteGATTCharacteristic")
-abstract class _BluetoothRemoteGATTCharacteristic extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory _BluetoothRemoteGATTCharacteristic._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothRemoteGATTServer")
-abstract class _BluetoothRemoteGATTServer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _BluetoothRemoteGATTServer._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothRemoteGATTService")
-abstract class _BluetoothRemoteGATTService extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _BluetoothRemoteGATTService._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BluetoothUUID")
-abstract class _BluetoothUUID extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _BluetoothUUID._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BudgetService")
-class _BudgetService extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _BudgetService._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<BudgetState> getBudget() =>
-      promiseToFuture<BudgetState>(JS("", "#.getBudget()", this));
-
-  Future<double> getCost(String operation) =>
-      promiseToFuture<double>(JS("", "#.getCost(#)", this, operation));
-
-  Future<bool> reserve(String operation) =>
-      promiseToFuture<bool>(JS("", "#.reserve(#)", this, operation));
-}
-// Copyright (c) 2012, 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.
-
-@Native("Cache")
-abstract class _Cache extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _Cache._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-abstract class _CanvasPath extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _CanvasPath._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("Clipboard")
-class _Clipboard extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory _Clipboard._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future<DataTransfer> read() =>
-      promiseToFuture<DataTransfer>(JS("", "#.read()", this));
-
-  Future<String> readText() =>
-      promiseToFuture<String>(JS("", "#.readText()", this));
-
-  Future write(DataTransfer data) =>
-      promiseToFuture(JS("", "#.write(#)", this, data));
-
-  Future writeText(String data) =>
-      promiseToFuture(JS("", "#.writeText(#)", this, data));
-}
-// Copyright (c) 2012, 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.
-
-@Native("CSSRuleList")
-class _CssRuleList extends Interceptor
-    with ListMixin<CssRule>, ImmutableListMixin<CssRule>
-    implements JavaScriptIndexingBehavior<CssRule>, List<CssRule> {
-  // To suppress missing implicit constructor warnings.
-  factory _CssRuleList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  CssRule operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("CssRule", "#[#]", this, index);
-  }
-
-  void operator []=(int index, CssRule value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<CssRule> mixins.
-  // CssRule is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  CssRule get first {
-    if (this.length > 0) {
-      return JS('CssRule', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  CssRule get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('CssRule', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  CssRule get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('CssRule', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  CssRule elementAt(int index) => this[index];
-  // -- end List<CssRule> mixins.
-
-  CssRule? item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Native("DOMFileSystemSync")
-abstract class _DOMFileSystemSync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _DOMFileSystemSync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("DirectoryEntrySync")
-abstract class _DirectoryEntrySync extends _EntrySync {
-  // To suppress missing implicit constructor warnings.
-  factory _DirectoryEntrySync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("DirectoryReaderSync")
-abstract class _DirectoryReaderSync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _DirectoryReaderSync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-// http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
-@deprecated // stable
-@Native("DocumentType")
-abstract class _DocumentType extends Node implements ChildNode {
-  // To suppress missing implicit constructor warnings.
-  factory _DocumentType._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // From ChildNode
-
-}
-
-// Copyright (c) 2013, 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.
-
-@Native("ClientRect,DOMRect")
-class _DomRect extends DomRectReadOnly implements Rectangle {
-  // NOTE! All code below should be common with RectangleBase.
-  String toString() {
-    return 'Rectangle ($left, $top) $width x $height';
-  }
-
-  bool operator ==(other) =>
-      other is Rectangle &&
-      left == other.left &&
-      top == other.top &&
-      width == other.width &&
-      height == other.height;
-
-  int get hashCode => _JenkinsSmiHash.hash4(
-      left.hashCode, top.hashCode, width.hashCode, height.hashCode);
-
-  /**
-   * Computes the intersection of `this` and [other].
-   *
-   * The intersection of two axis-aligned rectangles, if any, is always another
-   * axis-aligned rectangle.
-   *
-   * Returns the intersection of this and `other`, or null if they don't
-   * intersect.
-   */
-  Rectangle? intersection(Rectangle other) {
-    var x0 = max(left, other.left);
-    var x1 = min(left + width, other.left + other.width);
-
-    if (x0 <= x1) {
-      var y0 = max(top, other.top);
-      var y1 = min(top + height, other.top + other.height);
-
-      if (y0 <= y1) {
-        return new Rectangle(x0, y0, x1 - x0, y1 - y0);
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Returns true if `this` intersects [other].
-   */
-  bool intersects(Rectangle<num> other) {
-    return (left <= other.left + other.width &&
-        other.left <= left + width &&
-        top <= other.top + other.height &&
-        other.top <= top + height);
-  }
-
-  /**
-   * Returns a new rectangle which completely contains `this` and [other].
-   */
-  Rectangle boundingBox(Rectangle other) {
-    var right = max(this.left + this.width, other.left + other.width);
-    var bottom = max(this.top + this.height, other.top + other.height);
-
-    var left = min(this.left, other.left);
-    var top = min(this.top, other.top);
-
-    return new Rectangle(left, top, right - left, bottom - top);
-  }
-
-  /**
-   * Tests whether `this` entirely contains [another].
-   */
-  bool containsRectangle(Rectangle<num> another) {
-    return left <= another.left &&
-        left + width >= another.left + another.width &&
-        top <= another.top &&
-        top + height >= another.top + another.height;
-  }
-
-  /**
-   * Tests whether [another] is inside or along the edges of `this`.
-   */
-  bool containsPoint(Point<num> another) {
-    return another.x >= left &&
-        another.x <= left + width &&
-        another.y >= top &&
-        another.y <= top + height;
-  }
-
-  Point get topLeft => new Point(this.left, this.top);
-  Point get topRight => new Point(this.left + this.width, this.top);
-  Point get bottomRight =>
-      new Point(this.left + this.width, this.top + this.height);
-  Point get bottomLeft => new Point(this.left, this.top + this.height);
-
-  // To suppress missing implicit constructor warnings.
-  factory _DomRect._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _DomRect([num? x, num? y, num? width, num? height]) {
-    if (height != null) {
-      return _DomRect._create_1(x, y, width, height);
-    }
-    if (width != null) {
-      return _DomRect._create_2(x, y, width);
-    }
-    if (y != null) {
-      return _DomRect._create_3(x, y);
-    }
-    if (x != null) {
-      return _DomRect._create_4(x);
-    }
-    return _DomRect._create_5();
-  }
-  static _DomRect _create_1(x, y, width, height) =>
-      JS('_DomRect', 'new DOMRect(#,#,#,#)', x, y, width, height);
-  static _DomRect _create_2(x, y, width) =>
-      JS('_DomRect', 'new DOMRect(#,#,#)', x, y, width);
-  static _DomRect _create_3(x, y) => JS('_DomRect', 'new DOMRect(#,#)', x, y);
-  static _DomRect _create_4(x) => JS('_DomRect', 'new DOMRect(#)', x);
-  static _DomRect _create_5() => JS('_DomRect', 'new DOMRect()');
-
-  // Shadowing definition.
-
-  num get height native;
-
-  set height(num value) native;
-
-  // Shadowing definition.
-
-  num get width native;
-
-  set width(num value) native;
-
-  // Shadowing definition.
-
-  num get x native;
-
-  set x(num value) native;
-
-  // Shadowing definition.
-
-  num get y native;
-
-  set y(num value) native;
-}
-
-/**
- * This is the [Jenkins hash function][1] but using masking to keep
- * values in SMI range.
- *
- * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
- *
- * Use:
- * Hash each value with the hash of the previous value, then get the final
- * hash by calling finish.
- *
- *     var hash = 0;
- *     for (var value in values) {
- *       hash = JenkinsSmiHash.combine(hash, value.hashCode);
- *     }
- *     hash = JenkinsSmiHash.finish(hash);
- */
-class _JenkinsSmiHash {
-  // TODO(11617): This class should be optimized and standardized elsewhere.
-
-  static int combine(int hash, int value) {
-    hash = 0x1fffffff & (hash + value);
-    hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-    return hash ^ (hash >> 6);
-  }
-
-  static int finish(int hash) {
-    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-    hash = hash ^ (hash >> 11);
-    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-  }
-
-  static int hash2(a, b) => finish(combine(combine(0, a), b));
-
-  static int hash4(a, b, c, d) =>
-      finish(combine(combine(combine(combine(0, a), b), c), d));
-}
-// Copyright (c) 2012, 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.
-
-@Native("EntrySync")
-abstract class _EntrySync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _EntrySync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("FileEntrySync")
-abstract class _FileEntrySync extends _EntrySync {
-  // To suppress missing implicit constructor warnings.
-  factory _FileEntrySync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("FileReaderSync")
-abstract class _FileReaderSync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _FileReaderSync._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _FileReaderSync() {
-    return _FileReaderSync._create_1();
-  }
-  static _FileReaderSync _create_1() =>
-      JS('_FileReaderSync', 'new FileReaderSync()');
-}
-// Copyright (c) 2012, 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.
-
-@Native("FileWriterSync")
-abstract class _FileWriterSync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _FileWriterSync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("GamepadList")
-class _GamepadList extends Interceptor
-    with ListMixin<Gamepad?>, ImmutableListMixin<Gamepad?>
-    implements List<Gamepad?>, JavaScriptIndexingBehavior<Gamepad?> {
-  // To suppress missing implicit constructor warnings.
-  factory _GamepadList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Gamepad? operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Gamepad|Null", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Gamepad? value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Gamepad?> mixins.
-  // Gamepad? is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Gamepad? get first {
-    if (this.length > 0) {
-      return JS('Gamepad|Null', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Gamepad? get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Gamepad|Null', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Gamepad? get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Gamepad|Null', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Gamepad? elementAt(int index) => this[index];
-  // -- end List<Gamepad?> mixins.
-
-  Gamepad item(int? index) native;
-}
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-all
-@deprecated // deprecated
-@Native("HTMLAllCollection")
-abstract class _HTMLAllCollection extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _HTMLAllCollection._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('item')
-  Element _item(int? index) native;
-}
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dir
-@deprecated // deprecated
-@Native("HTMLDirectoryElement")
-abstract class _HTMLDirectoryElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory _HTMLDirectoryElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _HTMLDirectoryElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlfontelement
-@deprecated // deprecated
-@Native("HTMLFontElement")
-abstract class _HTMLFontElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory _HTMLFontElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _HTMLFontElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlframeelement
-@deprecated // deprecated
-@Native("HTMLFrameElement")
-abstract class _HTMLFrameElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory _HTMLFrameElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _HTMLFrameElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#frameset
-@deprecated // deprecated
-@Native("HTMLFrameSetElement")
-abstract class _HTMLFrameSetElement extends HtmlElement
-    implements WindowEventHandlers {
-  // To suppress missing implicit constructor warnings.
-  factory _HTMLFrameSetElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _HTMLFrameSetElement.created() : super.created();
-}
-
-// Copyright (c) 2012, 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.
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-marquee-element
-@deprecated // deprecated
-@Native("HTMLMarqueeElement")
-abstract class _HTMLMarqueeElement extends HtmlElement {
-  // To suppress missing implicit constructor warnings.
-  factory _HTMLMarqueeElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _HTMLMarqueeElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("Mojo")
-abstract class _Mojo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _Mojo._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("MojoHandle")
-abstract class _MojoHandle extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _MojoHandle._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("MojoInterfaceInterceptor")
-abstract class _MojoInterfaceInterceptor extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory _MojoInterfaceInterceptor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _MojoInterfaceInterceptor(String interfaceName, [String? scope]) {
-    if (scope != null) {
-      return _MojoInterfaceInterceptor._create_1(interfaceName, scope);
-    }
-    return _MojoInterfaceInterceptor._create_2(interfaceName);
-  }
-  static _MojoInterfaceInterceptor _create_1(interfaceName, scope) => JS(
-      '_MojoInterfaceInterceptor',
-      'new MojoInterfaceInterceptor(#,#)',
-      interfaceName,
-      scope);
-  static _MojoInterfaceInterceptor _create_2(interfaceName) => JS(
-      '_MojoInterfaceInterceptor',
-      'new MojoInterfaceInterceptor(#)',
-      interfaceName);
-}
-// Copyright (c) 2012, 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.
-
-@Native("MojoInterfaceRequestEvent")
-abstract class _MojoInterfaceRequestEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory _MojoInterfaceRequestEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _MojoInterfaceRequestEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return _MojoInterfaceRequestEvent._create_1(type, eventInitDict_1);
-    }
-    return _MojoInterfaceRequestEvent._create_2(type);
-  }
-  static _MojoInterfaceRequestEvent _create_1(type, eventInitDict) => JS(
-      '_MojoInterfaceRequestEvent',
-      'new MojoInterfaceRequestEvent(#,#)',
-      type,
-      eventInitDict);
-  static _MojoInterfaceRequestEvent _create_2(type) => JS(
-      '_MojoInterfaceRequestEvent', 'new MojoInterfaceRequestEvent(#)', type);
-}
-// Copyright (c) 2012, 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.
-
-@Native("MojoWatcher")
-abstract class _MojoWatcher extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _MojoWatcher._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("NFC")
-abstract class _NFC extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _NFC._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-// http://dom.spec.whatwg.org/#namednodemap
-@deprecated // deprecated
-@Native("NamedNodeMap,MozNamedAttrMap")
-class _NamedNodeMap extends Interceptor
-    with ListMixin<Node>, ImmutableListMixin<Node>
-    implements JavaScriptIndexingBehavior<Node>, List<Node> {
-  // To suppress missing implicit constructor warnings.
-  factory _NamedNodeMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Node operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("Node", "#[#]", this, index);
-  }
-
-  void operator []=(int index, Node value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Node> mixins.
-  // Node is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Node get first {
-    if (this.length > 0) {
-      return JS('Node', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Node get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Node', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Node get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Node', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Node elementAt(int index) => this[index];
-  // -- end List<Node> mixins.
-
-  _Attr? getNamedItem(String name) native;
-
-  _Attr? getNamedItemNS(String? namespaceURI, String localName) native;
-
-  _Attr? item(int index) native;
-
-  _Attr removeNamedItem(String name) native;
-
-  _Attr removeNamedItemNS(String? namespaceURI, String localName) native;
-
-  _Attr? setNamedItem(_Attr attr) native;
-
-  _Attr? setNamedItemNS(_Attr attr) native;
-}
-// Copyright (c) 2012, 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.
-
-@deprecated // nonstandard
-@Native("PagePopupController")
-abstract class _PagePopupController extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _PagePopupController._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2013, 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.
-
-// Omit RadioNodeList for dart2js.  The Dart Form and FieldSet APIs don't
-// currently expose an API the returns RadioNodeList.  The only use of a
-// RadioNodeList is to get the selected value and it will be cleaner to
-// introduce a different API for that purpose.
-// Copyright (c) 2012, 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.
-
-@Native("Report")
-class _Report extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _Report._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  ReportBody? get body native;
-
-  String get type native;
-
-  String get url native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("Request")
-class _Request extends Body {
-  // To suppress missing implicit constructor warnings.
-  factory _Request._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _Request(Object input, [Map? requestInitDict]) {
-    if (requestInitDict != null) {
-      var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
-      return _Request._create_1(input, requestInitDict_1);
-    }
-    return _Request._create_2(input);
-  }
-  static _Request _create_1(input, requestInitDict) =>
-      JS('_Request', 'new Request(#,#)', input, requestInitDict);
-  static _Request _create_2(input) => JS('_Request', 'new Request(#)', input);
-
-  String get cache native;
-
-  String get credentials native;
-
-  Headers get headers native;
-
-  String get integrity native;
-
-  String get mode native;
-
-  String get redirect native;
-
-  String get referrer native;
-
-  String get referrerPolicy native;
-
-  String get url native;
-
-  _Request clone() native;
-}
-// Copyright (c) 2012, 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.
-
-// https://chromiumcodereview.appspot.com/14773025/
-@deprecated // experimental
-@Native("ResourceProgressEvent")
-abstract class _ResourceProgressEvent extends ProgressEvent {
-  // To suppress missing implicit constructor warnings.
-  factory _ResourceProgressEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("Response")
-abstract class _Response extends Body {
-  // To suppress missing implicit constructor warnings.
-  factory _Response._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _Response([Object? body, Map? init]) {
-    if (init != null) {
-      var init_1 = convertDartToNative_Dictionary(init);
-      return _Response._create_1(body, init_1);
-    }
-    if (body != null) {
-      return _Response._create_2(body);
-    }
-    return _Response._create_3();
-  }
-  static _Response _create_1(body, init) =>
-      JS('_Response', 'new Response(#,#)', body, init);
-  static _Response _create_2(body) => JS('_Response', 'new Response(#)', body);
-  static _Response _create_3() => JS('_Response', 'new Response()');
-}
-// Copyright (c) 2012, 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.
-
-@Native("SpeechRecognitionResultList")
-class _SpeechRecognitionResultList extends Interceptor
-    with
-        ListMixin<SpeechRecognitionResult>,
-        ImmutableListMixin<SpeechRecognitionResult>
-    implements
-        JavaScriptIndexingBehavior<SpeechRecognitionResult>,
-        List<SpeechRecognitionResult> {
-  // To suppress missing implicit constructor warnings.
-  factory _SpeechRecognitionResultList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  SpeechRecognitionResult operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("SpeechRecognitionResult", "#[#]", this, index);
-  }
-
-  void operator []=(int index, SpeechRecognitionResult value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<SpeechRecognitionResult> mixins.
-  // SpeechRecognitionResult is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  SpeechRecognitionResult get first {
-    if (this.length > 0) {
-      return JS('SpeechRecognitionResult', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  SpeechRecognitionResult get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('SpeechRecognitionResult', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  SpeechRecognitionResult get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('SpeechRecognitionResult', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  SpeechRecognitionResult elementAt(int index) => this[index];
-  // -- end List<SpeechRecognitionResult> mixins.
-
-  SpeechRecognitionResult item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("StyleSheetList")
-class _StyleSheetList extends Interceptor
-    with ListMixin<StyleSheet>, ImmutableListMixin<StyleSheet>
-    implements List<StyleSheet>, JavaScriptIndexingBehavior<StyleSheet> {
-  // To suppress missing implicit constructor warnings.
-  factory _StyleSheetList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  StyleSheet operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return JS("StyleSheet", "#[#]", this, index);
-  }
-
-  void operator []=(int index, StyleSheet value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<StyleSheet> mixins.
-  // StyleSheet is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  StyleSheet get first {
-    if (this.length > 0) {
-      return JS('StyleSheet', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  StyleSheet get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('StyleSheet', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  StyleSheet get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('StyleSheet', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  StyleSheet elementAt(int index) => this[index];
-  // -- end List<StyleSheet> mixins.
-
-  CssStyleSheet __getter__(String name) native;
-
-  StyleSheet? item(int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SubtleCrypto")
-abstract class _SubtleCrypto extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _SubtleCrypto._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("USB")
-abstract class _USB extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory _USB._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBAlternateInterface")
-abstract class _USBAlternateInterface extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBAlternateInterface._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBAlternateInterface(
-      _USBInterface deviceInterface, int alternateSetting) {
-    return _USBAlternateInterface._create_1(deviceInterface, alternateSetting);
-  }
-  static _USBAlternateInterface _create_1(deviceInterface, alternateSetting) =>
-      JS('_USBAlternateInterface', 'new USBAlternateInterface(#,#)',
-          deviceInterface, alternateSetting);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBConfiguration")
-abstract class _USBConfiguration extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBConfiguration._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBConfiguration(_USBDevice device, int configurationValue) {
-    return _USBConfiguration._create_1(device, configurationValue);
-  }
-  static _USBConfiguration _create_1(device, configurationValue) => JS(
-      '_USBConfiguration',
-      'new USBConfiguration(#,#)',
-      device,
-      configurationValue);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBConnectionEvent")
-abstract class _USBConnectionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory _USBConnectionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBConnectionEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return _USBConnectionEvent._create_1(type, eventInitDict_1);
-  }
-  static _USBConnectionEvent _create_1(type, eventInitDict) => JS(
-      '_USBConnectionEvent',
-      'new USBConnectionEvent(#,#)',
-      type,
-      eventInitDict);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBDevice")
-abstract class _USBDevice extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBDevice._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBEndpoint")
-abstract class _USBEndpoint extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBEndpoint._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBEndpoint(
-      _USBAlternateInterface alternate, int endpointNumber, String direction) {
-    return _USBEndpoint._create_1(alternate, endpointNumber, direction);
-  }
-  static _USBEndpoint _create_1(alternate, endpointNumber, direction) => JS(
-      '_USBEndpoint',
-      'new USBEndpoint(#,#,#)',
-      alternate,
-      endpointNumber,
-      direction);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBInTransferResult")
-abstract class _USBInTransferResult extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBInTransferResult._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBInTransferResult(String status, [ByteData? data]) {
-    if (data != null) {
-      return _USBInTransferResult._create_1(status, data);
-    }
-    return _USBInTransferResult._create_2(status);
-  }
-  static _USBInTransferResult _create_1(status, data) =>
-      JS('_USBInTransferResult', 'new USBInTransferResult(#,#)', status, data);
-  static _USBInTransferResult _create_2(status) =>
-      JS('_USBInTransferResult', 'new USBInTransferResult(#)', status);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBInterface")
-abstract class _USBInterface extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBInterface._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBInterface(_USBConfiguration configuration, int interfaceNumber) {
-    return _USBInterface._create_1(configuration, interfaceNumber);
-  }
-  static _USBInterface _create_1(configuration, interfaceNumber) => JS(
-      '_USBInterface', 'new USBInterface(#,#)', configuration, interfaceNumber);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBIsochronousInTransferPacket")
-abstract class _USBIsochronousInTransferPacket extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBIsochronousInTransferPacket._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBIsochronousInTransferPacket(String status, [ByteData? data]) {
-    if (data != null) {
-      return _USBIsochronousInTransferPacket._create_1(status, data);
-    }
-    return _USBIsochronousInTransferPacket._create_2(status);
-  }
-  static _USBIsochronousInTransferPacket _create_1(status, data) => JS(
-      '_USBIsochronousInTransferPacket',
-      'new USBIsochronousInTransferPacket(#,#)',
-      status,
-      data);
-  static _USBIsochronousInTransferPacket _create_2(status) => JS(
-      '_USBIsochronousInTransferPacket',
-      'new USBIsochronousInTransferPacket(#)',
-      status);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBIsochronousInTransferResult")
-abstract class _USBIsochronousInTransferResult extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBIsochronousInTransferResult._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBIsochronousInTransferResult(
-      List<_USBIsochronousInTransferPacket> packets,
-      [ByteData? data]) {
-    if (data != null) {
-      return _USBIsochronousInTransferResult._create_1(packets, data);
-    }
-    return _USBIsochronousInTransferResult._create_2(packets);
-  }
-  static _USBIsochronousInTransferResult _create_1(packets, data) => JS(
-      '_USBIsochronousInTransferResult',
-      'new USBIsochronousInTransferResult(#,#)',
-      packets,
-      data);
-  static _USBIsochronousInTransferResult _create_2(packets) => JS(
-      '_USBIsochronousInTransferResult',
-      'new USBIsochronousInTransferResult(#)',
-      packets);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBIsochronousOutTransferPacket")
-abstract class _USBIsochronousOutTransferPacket extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBIsochronousOutTransferPacket._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBIsochronousOutTransferPacket(String status, [int? bytesWritten]) {
-    if (bytesWritten != null) {
-      return _USBIsochronousOutTransferPacket._create_1(status, bytesWritten);
-    }
-    return _USBIsochronousOutTransferPacket._create_2(status);
-  }
-  static _USBIsochronousOutTransferPacket _create_1(status, bytesWritten) => JS(
-      '_USBIsochronousOutTransferPacket',
-      'new USBIsochronousOutTransferPacket(#,#)',
-      status,
-      bytesWritten);
-  static _USBIsochronousOutTransferPacket _create_2(status) => JS(
-      '_USBIsochronousOutTransferPacket',
-      'new USBIsochronousOutTransferPacket(#)',
-      status);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBIsochronousOutTransferResult")
-abstract class _USBIsochronousOutTransferResult extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBIsochronousOutTransferResult._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBIsochronousOutTransferResult(
-      List<_USBIsochronousOutTransferPacket> packets) {
-    return _USBIsochronousOutTransferResult._create_1(packets);
-  }
-  static _USBIsochronousOutTransferResult _create_1(packets) => JS(
-      '_USBIsochronousOutTransferResult',
-      'new USBIsochronousOutTransferResult(#)',
-      packets);
-}
-// Copyright (c) 2012, 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.
-
-@Native("USBOutTransferResult")
-abstract class _USBOutTransferResult extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _USBOutTransferResult._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _USBOutTransferResult(String status, [int? bytesWritten]) {
-    if (bytesWritten != null) {
-      return _USBOutTransferResult._create_1(status, bytesWritten);
-    }
-    return _USBOutTransferResult._create_2(status);
-  }
-  static _USBOutTransferResult _create_1(status, bytesWritten) => JS(
-      '_USBOutTransferResult',
-      'new USBOutTransferResult(#,#)',
-      status,
-      bytesWritten);
-  static _USBOutTransferResult _create_2(status) =>
-      JS('_USBOutTransferResult', 'new USBOutTransferResult(#)', status);
-}
-// Copyright (c) 2012, 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.
-
-abstract class _WindowTimers extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _WindowTimers._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int _setInterval_String(String handler, [int? timeout, Object? arguments]);
-
-  int _setTimeout_String(String handler, [int? timeout, Object? arguments]);
-
-  void _clearInterval([int? handle]);
-
-  void _clearTimeout([int? handle]);
-
-  int _setInterval(Object handler, [int? timeout]);
-
-  int _setTimeout(Object handler, [int? timeout]);
-}
-// Copyright (c) 2012, 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.
-
-@Native("WorkerLocation")
-abstract class _WorkerLocation extends Interceptor implements UrlUtilsReadOnly {
-  // To suppress missing implicit constructor warnings.
-  factory _WorkerLocation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // From URLUtilsReadOnly
-
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("WorkerNavigator")
-abstract class _WorkerNavigator extends NavigatorConcurrentHardware
-    implements NavigatorOnLine, NavigatorID {
-  // To suppress missing implicit constructor warnings.
-  factory _WorkerNavigator._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // From NavigatorID
-
-  // From NavigatorOnLine
-
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("Worklet")
-abstract class _Worklet extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _Worklet._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-abstract class _AttributeMap extends MapBase<String, String> {
-  final Element _element;
-
-  _AttributeMap(this._element);
-
-  void addAll(Map<String, String> other) {
-    other.forEach((k, v) {
-      this[k] = v;
-    });
-  }
-
-  Map<K, V> cast<K, V>() => Map.castFrom<String, String, K, V>(this);
-  bool containsValue(Object? value) {
-    for (var v in this.values) {
-      if (value == v) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  String putIfAbsent(String key, String ifAbsent()) {
-    if (!containsKey(key)) {
-      this[key] = ifAbsent();
-    }
-    return this[key] as String;
-  }
-
-  void clear() {
-    for (var key in keys) {
-      remove(key);
-    }
-  }
-
-  void forEach(void f(String key, String value)) {
-    for (var key in keys) {
-      var value = this[key];
-      f(key, value as String);
-    }
-  }
-
-  Iterable<String> get keys {
-    // TODO: generate a lazy collection instead.
-    var attributes = _element._attributes;
-    var keys = <String>[];
-    for (int i = 0, len = attributes.length; i < len; i++) {
-      _Attr attr = attributes[i] as _Attr;
-      if (_matches(attr)) {
-        keys.add(attr.name);
-      }
-    }
-    return keys;
-  }
-
-  Iterable<String> get values {
-    // TODO: generate a lazy collection instead.
-    var attributes = _element._attributes;
-    var values = <String>[];
-    for (int i = 0, len = attributes.length; i < len; i++) {
-      _Attr attr = attributes[i] as _Attr;
-      if (_matches(attr)) {
-        values.add(attr.value);
-      }
-    }
-    return values;
-  }
-
-  /**
-   * Returns true if there is no {key, value} pair in the map.
-   */
-  bool get isEmpty {
-    return length == 0;
-  }
-
-  /**
-   * Returns true if there is at least one {key, value} pair in the map.
-   */
-  bool get isNotEmpty => !isEmpty;
-
-  /**
-   * Checks to see if the node should be included in this map.
-   */
-  bool _matches(_Attr node);
-}
-
-/**
- * Wrapper to expose [Element.attributes] as a typed map.
- */
-class _ElementAttributeMap extends _AttributeMap {
-  _ElementAttributeMap(Element element) : super(element);
-
-  bool containsKey(Object? key) {
-    return key is String && _element._hasAttribute(key);
-  }
-
-  String? operator [](Object? key) {
-    return _element.getAttribute(key as String);
-  }
-
-  void operator []=(String key, String value) {
-    _element.setAttribute(key, value);
-  }
-
-  @pragma('dart2js:tryInline')
-  String? remove(Object? key) => key is String ? _remove(_element, key) : null;
-
-  /**
-   * The number of {key, value} pairs in the map.
-   */
-  int get length {
-    return keys.length;
-  }
-
-  bool _matches(_Attr node) => node._namespaceUri == null;
-
-  // Inline this because almost all call sites of [remove] do not use [value],
-  // and the annotations on the `getAttribute` call allow it to be removed.
-  @pragma('dart2js:tryInline')
-  static String? _remove(Element element, String key) {
-    String? value = JS(
-        // throws:null(1) is not accurate since [key] could be malformed, but
-        // [key] is checked again by `removeAttributeNS`.
-        'returns:String|Null;depends:all;effects:none;throws:null(1)',
-        '#.getAttribute(#)',
-        element,
-        key);
-    JS('', '#.removeAttribute(#)', element, key);
-    return value;
-  }
-}
-
-/**
- * Wrapper to expose namespaced attributes as a typed map.
- */
-class _NamespacedAttributeMap extends _AttributeMap {
-  final String? _namespace;
-
-  _NamespacedAttributeMap(Element element, this._namespace) : super(element);
-
-  bool containsKey(Object? key) {
-    return key is String && _element._hasAttributeNS(_namespace, key);
-  }
-
-  String? operator [](Object? key) {
-    return _element.getAttributeNS(_namespace, key as String);
-  }
-
-  void operator []=(String key, String value) {
-    _element.setAttributeNS(_namespace, key, value);
-  }
-
-  @pragma('dart2js:tryInline')
-  String? remove(Object? key) =>
-      key is String ? _remove(_namespace, _element, key) : null;
-
-  /**
-   * The number of {key, value} pairs in the map.
-   */
-  int get length {
-    return keys.length;
-  }
-
-  bool _matches(_Attr node) => node._namespaceUri == _namespace;
-
-  // Inline this because almost all call sites of [remove] do not use the
-  // returned [value], and the annotations on the `getAttributeNS` call allow it
-  // to be removed.
-  @pragma('dart2js:tryInline')
-  static String? _remove(String? namespace, Element element, String key) {
-    String? value = JS(
-        // throws:null(1) is not accurate since [key] could be malformed, but
-        // [key] is checked again by `removeAttributeNS`.
-        'returns:String|Null;depends:all;effects:none;throws:null(1)',
-        '#.getAttributeNS(#, #)',
-        element,
-        namespace,
-        key);
-    JS('', '#.removeAttributeNS(#, #)', element, namespace, key);
-    return value;
-  }
-}
-
-/**
- * Provides a Map abstraction on top of data-* attributes, similar to the
- * dataSet in the old DOM.
- */
-class _DataAttributeMap extends MapBase<String, String> {
-  final Map<String, String> _attributes;
-
-  _DataAttributeMap(this._attributes);
-
-  // interface Map
-
-  void addAll(Map<String, String> other) {
-    other.forEach((k, v) {
-      this[k] = v;
-    });
-  }
-
-  Map<K, V> cast<K, V>() => Map.castFrom<String, String, K, V>(this);
-  // TODO: Use lazy iterator when it is available on Map.
-  bool containsValue(Object? value) => values.any((v) => v == value);
-
-  bool containsKey(Object? key) =>
-      _attributes.containsKey(_attr(key as String));
-
-  String? operator [](Object? key) => _attributes[_attr(key as String)];
-
-  void operator []=(String key, String value) {
-    _attributes[_attr(key)] = value;
-  }
-
-  String putIfAbsent(String key, String ifAbsent()) =>
-      _attributes.putIfAbsent(_attr(key), ifAbsent);
-
-  String? remove(Object? key) => _attributes.remove(_attr(key as String));
-
-  void clear() {
-    // Needs to operate on a snapshot since we are mutating the collection.
-    for (String key in keys) {
-      remove(key);
-    }
-  }
-
-  void forEach(void f(String key, String value)) {
-    _attributes.forEach((String key, String value) {
-      if (_matches(key)) {
-        f(_strip(key), value);
-      }
-    });
-  }
-
-  Iterable<String> get keys {
-    final keys = <String>[];
-    _attributes.forEach((String key, String value) {
-      if (_matches(key)) {
-        keys.add(_strip(key));
-      }
-    });
-    return keys;
-  }
-
-  Iterable<String> get values {
-    final values = <String>[];
-    _attributes.forEach((String key, String value) {
-      if (_matches(key)) {
-        values.add(value);
-      }
-    });
-    return values;
-  }
-
-  int get length => keys.length;
-
-  // TODO: Use lazy iterator when it is available on Map.
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  // Helpers.
-  String _attr(String key) => 'data-${_toHyphenedName(key)}';
-  bool _matches(String key) => key.startsWith('data-');
-  String _strip(String key) => _toCamelCase(key.substring(5));
-
-  /**
-   * Converts a string name with hyphens into an identifier, by removing hyphens
-   * and capitalizing the following letter. Optionally [startUppercase] to
-   * capitalize the first letter.
-   */
-  String _toCamelCase(String hyphenedName, {bool startUppercase: false}) {
-    var segments = hyphenedName.split('-');
-    int start = startUppercase ? 0 : 1;
-    for (int i = start; i < segments.length; i++) {
-      var segment = segments[i];
-      if (segment.length > 0) {
-        // Character between 'a'..'z' mapped to 'A'..'Z'
-        segments[i] = '${segment[0].toUpperCase()}${segment.substring(1)}';
-      }
-    }
-    return segments.join('');
-  }
-
-  /** Reverse of [toCamelCase]. */
-  String _toHyphenedName(String word) {
-    var sb = new StringBuffer();
-    for (int i = 0; i < word.length; i++) {
-      var lower = word[i].toLowerCase();
-      if (word[i] != lower && i > 0) sb.write('-');
-      sb.write(lower);
-    }
-    return sb.toString();
-  }
-}
-// Copyright (c) 2012, 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.
-
-/**
- * An object that can be drawn to a 2D canvas rendering context.
- *
- * The image drawn to the canvas depends on the type of this object:
- *
- * * If this object is an [ImageElement], then this element's image is
- * drawn to the canvas. If this element is an animated image, then this
- * element's poster frame is drawn. If this element has no poster frame, then
- * the first frame of animation is drawn.
- *
- * * If this object is a [VideoElement], then the frame at this element's current
- * playback position is drawn to the canvas.
- *
- * * If this object is a [CanvasElement], then this element's bitmap is drawn to
- * the canvas.
- *
- * **Note:** Currently all versions of Internet Explorer do not support
- * drawing a video element to a canvas. You may also encounter problems drawing
- * a video to a canvas in Firefox if the source of the video is a data URL.
- *
- * ## See also
- *
- * * [CanvasRenderingContext2D.drawImage]
- * * [CanvasRenderingContext2D.drawImageToRect]
- * * [CanvasRenderingContext2D.drawImageScaled]
- * * [CanvasRenderingContext2D.drawImageScaledFromSource]
- *
- * ## Other resources
- *
- * * [Image sources for 2D rendering
- *   contexts](https://html.spec.whatwg.org/multipage/scripting.html#image-sources-for-2d-rendering-contexts)
- *   from WHATWG.
- * * [Drawing images](https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-drawimage)
- *   from WHATWG.
- */
-abstract class CanvasImageSource {}
-// Copyright (c) 2012, 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.
-
-/**
- * Top-level container for a browser tab or window.
- *
- * In a web browser, a [WindowBase] object represents any browser window. This
- * object contains the window's state and its relation to other
- * windows, such as which window opened this window.
- *
- * **Note:** This class represents any window, while [Window] is
- * used to access the properties and content of the current window or tab.
- *
- * ## See also
- *
- * * [Window]
- *
- * ## Other resources
- *
- * * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN.
- * * [Window](http://www.w3.org/TR/Window/) from the W3C.
- */
-abstract class WindowBase implements EventTarget {
-  // Fields.
-
-  /**
-   * The current location of this window.
-   *
-   *     Location currentLocation = window.location;
-   *     print(currentLocation.href); // 'http://www.example.com:80/'
-   */
-  LocationBase get location;
-
-  /**
-   * The current session history for this window.
-   *
-   * ## Other resources
-   *
-   * * [Session history and navigation
-   *   specification](https://html.spec.whatwg.org/multipage/browsers.html#history)
-   *   from WHATWG.
-   */
-  HistoryBase get history;
-
-  /**
-   * Indicates whether this window has been closed.
-   *
-   *     print(window.closed); // 'false'
-   *     window.close();
-   *     print(window.closed); // 'true'
-   */
-  bool get closed;
-
-  /**
-   * A reference to the window that opened this one.
-   *
-   *     Window thisWindow = window;
-   *     WindowBase otherWindow = thisWindow.open('http://www.example.com/', 'foo');
-   *     print(otherWindow.opener == thisWindow); // 'true'
-   */
-  WindowBase? get opener;
-
-  /**
-   * A reference to the parent of this window.
-   *
-   * If this [WindowBase] has no parent, [parent] will return a reference to
-   * the [WindowBase] itself.
-   *
-   *     IFrameElement myIFrame = new IFrameElement();
-   *     window.document.body.elements.add(myIFrame);
-   *     print(myIframe.contentWindow.parent == window) // 'true'
-   *
-   *     print(window.parent == window) // 'true'
-   */
-  WindowBase? get parent;
-
-  /**
-   * A reference to the topmost window in the window hierarchy.
-   *
-   * If this [WindowBase] is the topmost [WindowBase], [top] will return a
-   * reference to the [WindowBase] itself.
-   *
-   *     // Add an IFrame to the current window.
-   *     IFrameElement myIFrame = new IFrameElement();
-   *     window.document.body.elements.add(myIFrame);
-   *
-   *     // Add an IFrame inside of the other IFrame.
-   *     IFrameElement innerIFrame = new IFrameElement();
-   *     myIFrame.elements.add(innerIFrame);
-   *
-   *     print(myIframe.contentWindow.top == window) // 'true'
-   *     print(innerIFrame.contentWindow.top == window) // 'true'
-   *
-   *     print(window.top == window) // 'true'
-   */
-  WindowBase? get top;
-
-  // Methods.
-  /**
-   * Closes the window.
-   *
-   * This method should only succeed if the [WindowBase] object is
-   * **script-closeable** and the window calling [close] is allowed to navigate
-   * the window.
-   *
-   * A window is script-closeable if it is either a window
-   * that was opened by another window, or if it is a window with only one
-   * document in its history.
-   *
-   * A window might not be allowed to navigate, and therefore close, another
-   * window due to browser security features.
-   *
-   *     var other = window.open('http://www.example.com', 'foo');
-   *     // Closes other window, as it is script-closeable.
-   *     other.close();
-   *     print(other.closed); // 'true'
-   *
-   *     var newLocation = window.location
-   *         ..href = 'http://www.mysite.com';
-   *     window.location = newLocation;
-   *     // Does not close this window, as the history has changed.
-   *     window.close();
-   *     print(window.closed); // 'false'
-   *
-   * See also:
-   *
-   * * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-window-close) from the W3C
-   */
-  void close();
-
-  /**
-   * Sends a cross-origin message.
-   *
-   * ## Other resources
-   *
-   * * [window.postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage)
-   *   from MDN.
-   * * [Cross-document messaging](https://html.spec.whatwg.org/multipage/comms.html#web-messaging)
-   *   from WHATWG.
-   */
-  void postMessage(var message, String targetOrigin,
-      [List<MessagePort>? messagePorts]);
-}
-
-abstract class LocationBase {
-  void set href(String val);
-}
-
-abstract class HistoryBase {
-  void back();
-  void forward();
-  void go(int distance);
-}
-// Copyright (c) 2012, 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.
-
-/** A Set that stores the CSS class names for an element. */
-abstract class CssClassSet implements Set<String> {
-  /**
-   * Adds the class [value] to the element if it is not on it, removes it if it
-   * is.
-   *
-   * If [shouldAdd] is true, then we always add that [value] to the element. If
-   * [shouldAdd] is false then we always remove [value] from the element.
-   *
-   * If this corresponds to one element, returns `true` if [value] is present
-   * after the operation, and returns `false` if [value] is absent after the
-   * operation.
-   *
-   * If this CssClassSet corresponds to many elements, `false` is always
-   * returned.
-   *
-   * [value] must be a valid 'token' representing a single class, i.e. a
-   * non-empty string containing no whitespace.  To toggle multiple classes, use
-   * [toggleAll].
-   */
-  bool toggle(String value, [bool? shouldAdd]);
-
-  /**
-   * Returns [:true:] if classes cannot be added or removed from this
-   * [:CssClassSet:].
-   */
-  bool get frozen;
-
-  /**
-   * Determine if this element contains the class [value].
-   *
-   * This is the Dart equivalent of jQuery's
-   * [hasClass](http://api.jquery.com/hasClass/).
-   *
-   * [value] must be a valid 'token' representing a single class, i.e. a
-   * non-empty string containing no whitespace.
-   */
-  bool contains(Object? value);
-
-  /**
-   * Add the class [value] to element.
-   *
-   * [add] and [addAll] are the Dart equivalent of jQuery's
-   * [addClass](http://api.jquery.com/addClass/).
-   *
-   * If this CssClassSet corresponds to one element. Returns true if [value] was
-   * added to the set, otherwise false.
-   *
-   * If this CssClassSet corresponds to many elements, `false` is always
-   * returned.
-   *
-   * [value] must be a valid 'token' representing a single class, i.e. a
-   * non-empty string containing no whitespace.  To add multiple classes use
-   * [addAll].
-   */
-  bool add(String value);
-
-  /**
-   * Remove the class [value] from element, and return true on successful
-   * removal.
-   *
-   * [remove] and [removeAll] are the Dart equivalent of jQuery's
-   * [removeClass](http://api.jquery.com/removeClass/).
-   *
-   * [value] must be a valid 'token' representing a single class, i.e. a
-   * non-empty string containing no whitespace.  To remove multiple classes, use
-   * [removeAll].
-   */
-  bool remove(Object? value);
-
-  /**
-   * Add all classes specified in [iterable] to element.
-   *
-   * [add] and [addAll] are the Dart equivalent of jQuery's
-   * [addClass](http://api.jquery.com/addClass/).
-   *
-   * Each element of [iterable] must be a valid 'token' representing a single
-   * class, i.e. a non-empty string containing no whitespace.
-   */
-  void addAll(Iterable<String> iterable);
-
-  /**
-   * Remove all classes specified in [iterable] from element.
-   *
-   * [remove] and [removeAll] are the Dart equivalent of jQuery's
-   * [removeClass](http://api.jquery.com/removeClass/).
-   *
-   * Each element of [iterable] must be a valid 'token' representing a single
-   * class, i.e. a non-empty string containing no whitespace.
-   */
-  void removeAll(Iterable<Object?> iterable);
-
-  /**
-   * Toggles all classes specified in [iterable] on element.
-   *
-   * Iterate through [iterable]'s items, and add it if it is not on it, or
-   * remove it if it is. This is the Dart equivalent of jQuery's
-   * [toggleClass](http://api.jquery.com/toggleClass/).
-   * If [shouldAdd] is true, then we always add all the classes in [iterable]
-   * element. If [shouldAdd] is false then we always remove all the classes in
-   * [iterable] from the element.
-   *
-   * Each element of [iterable] must be a valid 'token' representing a single
-   * class, i.e. a non-empty string containing no whitespace.
-   */
-  void toggleAll(Iterable<String> iterable, [bool? shouldAdd]);
-}
-// Copyright (c) 2013, 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.
-
-/**
- * A rectangle representing all the content of the element in the
- * [box model](http://www.w3.org/TR/CSS2/box.html).
- */
-class _ContentCssRect extends CssRect {
-  _ContentCssRect(Element element) : super(element);
-
-  num get height =>
-      _element.offsetHeight + _addOrSubtractToBoxModel(_HEIGHT, _CONTENT);
-
-  num get width =>
-      _element.offsetWidth + _addOrSubtractToBoxModel(_WIDTH, _CONTENT);
-
-  /**
-   * Set the height to `newHeight`.
-   *
-   * newHeight can be either a [num] representing the height in pixels or a
-   * [Dimension] object. Values of newHeight that are less than zero are
-   * converted to effectively setting the height to 0. This is equivalent to the
-   * `height` function in jQuery and the calculated `height` CSS value,
-   * converted to a num in pixels.
-   */
-  set height(dynamic newHeight) {
-    if (newHeight is Dimension) {
-      Dimension newHeightAsDimension = newHeight;
-      if (newHeightAsDimension.value < 0) newHeight = new Dimension.px(0);
-      _element.style.height = newHeight.toString();
-    } else if (newHeight is num) {
-      if (newHeight < 0) newHeight = 0;
-      _element.style.height = '${newHeight}px';
-    } else {
-      throw new ArgumentError("newHeight is not a Dimension or num");
-    }
-  }
-
-  /**
-   * Set the current computed width in pixels of this element.
-   *
-   * newWidth can be either a [num] representing the width in pixels or a
-   * [Dimension] object. This is equivalent to the `width` function in jQuery
-   * and the calculated
-   * `width` CSS value, converted to a dimensionless num in pixels.
-   */
-  set width(dynamic newWidth) {
-    if (newWidth is Dimension) {
-      Dimension newWidthAsDimension = newWidth;
-      if (newWidthAsDimension.value < 0) newWidth = new Dimension.px(0);
-      _element.style.width = newWidth.toString();
-    } else if (newWidth is num) {
-      if (newWidth < 0) newWidth = 0;
-      _element.style.width = '${newWidth}px';
-    } else {
-      throw new ArgumentError("newWidth is not a Dimension or num");
-    }
-  }
-
-  num get left =>
-      _element.getBoundingClientRect().left -
-      _addOrSubtractToBoxModel(['left'], _CONTENT);
-  num get top =>
-      _element.getBoundingClientRect().top -
-      _addOrSubtractToBoxModel(['top'], _CONTENT);
-}
-
-/**
- * A list of element content rectangles in the
- * [box model](http://www.w3.org/TR/CSS2/box.html).
- */
-class _ContentCssListRect extends _ContentCssRect {
-  List<Element> _elementList;
-
-  _ContentCssListRect(List<Element> elementList)
-      : _elementList = elementList,
-        super(elementList.first);
-
-  /**
-   * Set the height to `newHeight`.
-   *
-   * Values of newHeight that are less than zero are converted to effectively
-   * setting the height to 0. This is equivalent to the `height`
-   * function in jQuery and the calculated `height` CSS value, converted to a
-   * num in pixels.
-   */
-  set height(newHeight) {
-    _elementList.forEach((e) => e.contentEdge.height = newHeight);
-  }
-
-  /**
-   * Set the current computed width in pixels of this element.
-   *
-   * This is equivalent to the `width` function in jQuery and the calculated
-   * `width` CSS value, converted to a dimensionless num in pixels.
-   */
-  set width(newWidth) {
-    _elementList.forEach((e) => e.contentEdge.width = newWidth);
-  }
-}
-
-/**
- * A rectangle representing the dimensions of the space occupied by the
- * element's content + padding in the
- * [box model](http://www.w3.org/TR/CSS2/box.html).
- */
-class _PaddingCssRect extends CssRect {
-  _PaddingCssRect(element) : super(element);
-  num get height =>
-      _element.offsetHeight + _addOrSubtractToBoxModel(_HEIGHT, _PADDING);
-  num get width =>
-      _element.offsetWidth + _addOrSubtractToBoxModel(_WIDTH, _PADDING);
-
-  num get left =>
-      _element.getBoundingClientRect().left -
-      _addOrSubtractToBoxModel(['left'], _PADDING);
-  num get top =>
-      _element.getBoundingClientRect().top -
-      _addOrSubtractToBoxModel(['top'], _PADDING);
-}
-
-/**
- * A rectangle representing the dimensions of the space occupied by the
- * element's content + padding + border in the
- * [box model](http://www.w3.org/TR/CSS2/box.html).
- */
-class _BorderCssRect extends CssRect {
-  _BorderCssRect(element) : super(element);
-  num get height => _element.offsetHeight;
-  num get width => _element.offsetWidth;
-
-  num get left => _element.getBoundingClientRect().left;
-  num get top => _element.getBoundingClientRect().top;
-}
-
-/**
- * A rectangle representing the dimensions of the space occupied by the
- * element's content + padding + border + margin in the
- * [box model](http://www.w3.org/TR/CSS2/box.html).
- */
-class _MarginCssRect extends CssRect {
-  _MarginCssRect(element) : super(element);
-  num get height =>
-      _element.offsetHeight + _addOrSubtractToBoxModel(_HEIGHT, _MARGIN);
-  num get width =>
-      _element.offsetWidth + _addOrSubtractToBoxModel(_WIDTH, _MARGIN);
-
-  num get left =>
-      _element.getBoundingClientRect().left -
-      _addOrSubtractToBoxModel(['left'], _MARGIN);
-  num get top =>
-      _element.getBoundingClientRect().top -
-      _addOrSubtractToBoxModel(['top'], _MARGIN);
-}
-
-/**
- * A class for representing CSS dimensions.
- *
- * In contrast to the more general purpose [Rectangle] class, this class's
- * values are mutable, so one can change the height of an element
- * programmatically.
- *
- * _Important_ _note_: use of these methods will perform CSS calculations that
- * can trigger a browser reflow. Therefore, use of these properties _during_ an
- * animation frame is discouraged. See also:
- * [Browser Reflow](https://developers.google.com/speed/articles/reflow)
- */
-abstract class CssRect implements Rectangle<num> {
-  Element _element;
-
-  CssRect(this._element);
-
-  num get left;
-
-  num get top;
-
-  /**
-   * The height of this rectangle.
-   *
-   * This is equivalent to the `height` function in jQuery and the calculated
-   * `height` CSS value, converted to a dimensionless num in pixels. Unlike
-   * [getBoundingClientRect], `height` will return the same numerical width if
-   * the element is hidden or not.
-   */
-  num get height;
-
-  /**
-   * The width of this rectangle.
-   *
-   * This is equivalent to the `width` function in jQuery and the calculated
-   * `width` CSS value, converted to a dimensionless num in pixels. Unlike
-   * [getBoundingClientRect], `width` will return the same numerical width if
-   * the element is hidden or not.
-   */
-  num get width;
-
-  /**
-   * Set the height to `newHeight`.
-   *
-   * newHeight can be either a [num] representing the height in pixels or a
-   * [Dimension] object. Values of newHeight that are less than zero are
-   * converted to effectively setting the height to 0. This is equivalent to the
-   * `height` function in jQuery and the calculated `height` CSS value,
-   * converted to a num in pixels.
-   *
-   * Note that only the content height can actually be set via this method.
-   */
-  set height(dynamic newHeight) {
-    throw new UnsupportedError("Can only set height for content rect.");
-  }
-
-  /**
-   * Set the current computed width in pixels of this element.
-   *
-   * newWidth can be either a [num] representing the width in pixels or a
-   * [Dimension] object. This is equivalent to the `width` function in jQuery
-   * and the calculated
-   * `width` CSS value, converted to a dimensionless num in pixels.
-   *
-   * Note that only the content width can be set via this method.
-   */
-  set width(dynamic newWidth) {
-    throw new UnsupportedError("Can only set width for content rect.");
-  }
-
-  /**
-   * Return a value that is used to modify the initial height or width
-   * measurement of an element. Depending on the value (ideally an enum) passed
-   * to augmentingMeasurement, we may need to add or subtract margin, padding,
-   * or border values, depending on the measurement we're trying to obtain.
-   */
-  num _addOrSubtractToBoxModel(
-      List<String> dimensions, String augmentingMeasurement) {
-    // getComputedStyle always returns pixel values (hence, computed), so we're
-    // always dealing with pixels in this method.
-    var styles = _element.getComputedStyle();
-
-    num val = 0;
-
-    for (String measurement in dimensions) {
-      // The border-box and default box model both exclude margin in the regular
-      // height/width calculation, so add it if we want it for this measurement.
-      if (augmentingMeasurement == _MARGIN) {
-        val += new Dimension.css(
-                styles.getPropertyValue('$augmentingMeasurement-$measurement'))
-            .value;
-      }
-
-      // The border-box includes padding and border, so remove it if we want
-      // just the content itself.
-      if (augmentingMeasurement == _CONTENT) {
-        val -= new Dimension.css(
-                styles.getPropertyValue('${_PADDING}-$measurement'))
-            .value;
-      }
-
-      // At this point, we don't wan't to augment with border or margin,
-      // so remove border.
-      if (augmentingMeasurement != _MARGIN) {
-        val -= new Dimension.css(
-                styles.getPropertyValue('border-${measurement}-width'))
-            .value;
-      }
-    }
-    return val;
-  }
-
-  // TODO(jacobr): these methods are duplicated from _RectangleBase in dart:math
-  // Ideally we would provide a RectangleMixin class that provides this
-  // implementation. In an ideal world we would exp
-  /** The x-coordinate of the right edge. */
-  num get right => left + width;
-  /** The y-coordinate of the bottom edge. */
-  num get bottom => top + height;
-
-  String toString() {
-    return 'Rectangle ($left, $top) $width x $height';
-  }
-
-  bool operator ==(other) =>
-      other is Rectangle &&
-      left == other.left &&
-      top == other.top &&
-      right == other.right &&
-      bottom == other.bottom;
-
-  int get hashCode => _JenkinsSmiHash.hash4(
-      left.hashCode, top.hashCode, right.hashCode, bottom.hashCode);
-
-  /**
-   * Computes the intersection of `this` and [other].
-   *
-   * The intersection of two axis-aligned rectangles, if any, is always another
-   * axis-aligned rectangle.
-   *
-   * Returns the intersection of this and `other`, or `null` if they don't
-   * intersect.
-   */
-  Rectangle<num>? intersection(Rectangle<num> other) {
-    var x0 = max(left, other.left);
-    var x1 = min(left + width, other.left + other.width);
-
-    if (x0 <= x1) {
-      var y0 = max(top, other.top);
-      var y1 = min(top + height, other.top + other.height);
-
-      if (y0 <= y1) {
-        return new Rectangle<num>(x0, y0, x1 - x0, y1 - y0);
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Returns true if `this` intersects [other].
-   */
-  bool intersects(Rectangle<num> other) {
-    return (left <= other.left + other.width &&
-        other.left <= left + width &&
-        top <= other.top + other.height &&
-        other.top <= top + height);
-  }
-
-  /**
-   * Returns a new rectangle which completely contains `this` and [other].
-   */
-  Rectangle<num> boundingBox(Rectangle<num> other) {
-    var right = max(this.left + this.width, other.left + other.width);
-    var bottom = max(this.top + this.height, other.top + other.height);
-
-    var left = min(this.left, other.left);
-    var top = min(this.top, other.top);
-
-    return new Rectangle<num>(left, top, right - left, bottom - top);
-  }
-
-  /**
-   * Tests whether `this` entirely contains [another].
-   */
-  bool containsRectangle(Rectangle<num> another) {
-    return left <= another.left &&
-        left + width >= another.left + another.width &&
-        top <= another.top &&
-        top + height >= another.top + another.height;
-  }
-
-  /**
-   * Tests whether [another] is inside or along the edges of `this`.
-   */
-  bool containsPoint(Point<num> another) {
-    return another.x >= left &&
-        another.x <= left + width &&
-        another.y >= top &&
-        another.y <= top + height;
-  }
-
-  Point<num> get topLeft => new Point<num>(this.left, this.top);
-  Point<num> get topRight => new Point<num>(this.left + this.width, this.top);
-  Point<num> get bottomRight =>
-      new Point<num>(this.left + this.width, this.top + this.height);
-  Point<num> get bottomLeft =>
-      new Point<num>(this.left, this.top + this.height);
-}
-
-final _HEIGHT = ['top', 'bottom'];
-final _WIDTH = ['right', 'left'];
-final _CONTENT = 'content';
-final _PADDING = 'padding';
-final _MARGIN = 'margin';
-// Copyright (c) 2015, 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.
-
-/**
- * A set (union) of the CSS classes that are present in a set of elements.
- * Implemented separately from _ElementCssClassSet for performance.
- */
-class _MultiElementCssClassSet extends CssClassSetImpl {
-  final Iterable<Element> _elementIterable;
-
-  // TODO(sra): Perhaps we should store the DomTokenList instead.
-  final List<CssClassSetImpl> _sets;
-
-  factory _MultiElementCssClassSet(Iterable<Element> elements) {
-    return new _MultiElementCssClassSet._(elements,
-        new List<CssClassSetImpl>.from(elements.map((Element e) => e.classes)));
-  }
-
-  _MultiElementCssClassSet._(this._elementIterable, this._sets);
-
-  Set<String> readClasses() {
-    var s = new LinkedHashSet<String>();
-    _sets.forEach((CssClassSetImpl e) => s.addAll(e.readClasses()));
-    return s;
-  }
-
-  void writeClasses(Set<String> s) {
-    var classes = s.join(' ');
-    for (Element e in _elementIterable) {
-      e.className = classes;
-    }
-  }
-
-  /**
-   * Helper method used to modify the set of css classes on this element.
-   *
-   *   f - callback with:
-   *   s - a Set of all the css class name currently on this element.
-   *
-   *   After f returns, the modified set is written to the
-   *       className property of this element.
-   */
-  modify(f(Set<String> s)) {
-    _sets.forEach((CssClassSetImpl e) => e.modify(f));
-  }
-
-  /**
-   * Adds the class [value] to the element if it is not on it, removes it if it
-   * is.
-   *
-   * TODO(sra): It seems wrong to collect a 'changed' flag like this when the
-   * underlying toggle returns an 'is set' flag.
-   */
-  bool toggle(String value, [bool? shouldAdd]) => _sets.fold(
-      false,
-      (bool changed, CssClassSetImpl e) =>
-          e.toggle(value, shouldAdd) || changed);
-
-  /**
-   * Remove the class [value] from element, and return true on successful
-   * removal.
-   *
-   * This is the Dart equivalent of jQuery's
-   * [removeClass](http://api.jquery.com/removeClass/).
-   */
-  bool remove(Object? value) => _sets.fold(
-      false, (bool changed, CssClassSetImpl e) => e.remove(value) || changed);
-}
-
-class _ElementCssClassSet extends CssClassSetImpl {
-  final Element _element;
-
-  _ElementCssClassSet(this._element);
-
-  Set<String> readClasses() {
-    var s = new LinkedHashSet<String>();
-    var classname = _element.className;
-
-    for (String name in classname.split(' ')) {
-      String trimmed = name.trim();
-      if (!trimmed.isEmpty) {
-        s.add(trimmed);
-      }
-    }
-    return s;
-  }
-
-  void writeClasses(Set<String> s) {
-    _element.className = s.join(' ');
-  }
-
-  int get length => _classListLength(_classListOf(_element));
-  bool get isEmpty => length == 0;
-  bool get isNotEmpty => length != 0;
-
-  void clear() {
-    _element.className = '';
-  }
-
-  bool contains(Object? value) {
-    return _contains(_element, value);
-  }
-
-  bool add(String value) {
-    return _add(_element, value);
-  }
-
-  bool remove(Object? value) {
-    return value is String && _remove(_element, value);
-  }
-
-  bool toggle(String value, [bool? shouldAdd]) {
-    return _toggle(_element, value, shouldAdd);
-  }
-
-  void addAll(Iterable<String> iterable) {
-    _addAll(_element, iterable);
-  }
-
-  void removeAll(Iterable<Object?> iterable) {
-    _removeAll(_element, iterable);
-  }
-
-  void retainAll(Iterable<Object?> iterable) {
-    _removeWhere(_element, iterable.toSet().contains, false);
-  }
-
-  void removeWhere(bool test(String name)) {
-    _removeWhere(_element, test, true);
-  }
-
-  void retainWhere(bool test(String name)) {
-    _removeWhere(_element, test, false);
-  }
-
-  static bool _contains(Element _element, Object? value) {
-    return value is String && _classListContains(_classListOf(_element), value);
-  }
-
-  @pragma('dart2js:tryInline')
-  static bool _add(Element _element, String value) {
-    DomTokenList list = _classListOf(_element);
-    // Compute returned result independently of action upon the set.
-    bool added = !_classListContainsBeforeAddOrRemove(list, value);
-    _classListAdd(list, value);
-    return added;
-  }
-
-  @pragma('dart2js:tryInline')
-  static bool _remove(Element _element, String value) {
-    DomTokenList list = _classListOf(_element);
-    bool removed = _classListContainsBeforeAddOrRemove(list, value);
-    _classListRemove(list, value);
-    return removed;
-  }
-
-  static bool _toggle(Element _element, String value, bool? shouldAdd) {
-    // There is no value that can be passed as the second argument of
-    // DomTokenList.toggle that behaves the same as passing one argument.
-    // `null` is seen as false, meaning 'remove'.
-    return shouldAdd == null
-        ? _toggleDefault(_element, value)
-        : _toggleOnOff(_element, value, shouldAdd);
-  }
-
-  static bool _toggleDefault(Element _element, String value) {
-    DomTokenList list = _classListOf(_element);
-    return _classListToggle1(list, value);
-  }
-
-  static bool _toggleOnOff(Element _element, String value, bool? shouldAdd) {
-    DomTokenList list = _classListOf(_element);
-    // IE's toggle does not take a second parameter. We would prefer:
-    //
-    //    return _classListToggle2(list, value, shouldAdd);
-    //
-    if (shouldAdd ?? false) {
-      _classListAdd(list, value);
-      return true;
-    } else {
-      _classListRemove(list, value);
-      return false;
-    }
-  }
-
-  static void _addAll(Element _element, Iterable<String> iterable) {
-    DomTokenList list = _classListOf(_element);
-    for (String value in iterable) {
-      _classListAdd(list, value);
-    }
-  }
-
-  static void _removeAll(Element _element, Iterable<Object?> iterable) {
-    DomTokenList list = _classListOf(_element);
-    for (Object? value in iterable) {
-      _classListRemove(list, value as String);
-    }
-  }
-
-  static void _removeWhere(
-      Element _element, bool test(String name), bool doRemove) {
-    DomTokenList list = _classListOf(_element);
-    int i = 0;
-    while (i < _classListLength(list)) {
-      String item = list.item(i)!;
-      if (doRemove == test(item)) {
-        _classListRemove(list, item);
-      } else {
-        ++i;
-      }
-    }
-  }
-
-  // A collection of static methods for DomTokenList. These methods are a
-  // work-around for the lack of annotations to express the full behaviour of
-  // the DomTokenList methods.
-
-  static DomTokenList _classListOf(Element e) => JS(
-      'returns:DomTokenList;creates:DomTokenList;effects:none;depends:all;',
-      '#.classList',
-      e);
-
-  static int _classListLength(DomTokenList list) =>
-      JS('returns:JSUInt31;effects:none;depends:all;', '#.length', list);
-
-  static bool _classListContains(DomTokenList list, String value) =>
-      JS('returns:bool;effects:none;depends:all', '#.contains(#)', list, value);
-
-  static bool _classListContainsBeforeAddOrRemove(
-          DomTokenList list, String value) =>
-      // 'throws:never' is a lie, since 'contains' will throw on an illegal
-      // token.  However, we always call this function immediately prior to
-      // add/remove/toggle with the same token.  Often the result of 'contains'
-      // is unused and the lie makes it possible for the 'contains' instruction
-      // to be removed.
-      JS('returns:bool;effects:none;depends:all;throws:null(1)',
-          '#.contains(#)', list, value);
-
-  static void _classListAdd(DomTokenList list, String value) {
-    // list.add(value);
-    JS('', '#.add(#)', list, value);
-  }
-
-  static void _classListRemove(DomTokenList list, String value) {
-    // list.remove(value);
-    JS('', '#.remove(#)', list, value);
-  }
-
-  static bool _classListToggle1(DomTokenList list, String value) {
-    return JS('bool', '#.toggle(#)', list, value);
-  }
-
-  static bool _classListToggle2(
-      DomTokenList list, String value, bool? shouldAdd) {
-    return JS('bool', '#.toggle(#, #)', list, value, shouldAdd);
-  }
-}
-
-/**
- * Class representing a
- * [length measurement](https://developer.mozilla.org/en-US/docs/Web/CSS/length)
- * in CSS.
- */
-class Dimension {
-  num _value;
-  String _unit;
-
-  /** Set this CSS Dimension to a percentage `value`. */
-  Dimension.percent(this._value) : _unit = '%';
-
-  /** Set this CSS Dimension to a pixel `value`. */
-  Dimension.px(this._value) : _unit = 'px';
-
-  /** Set this CSS Dimension to a pica `value`. */
-  Dimension.pc(this._value) : _unit = 'pc';
-
-  /** Set this CSS Dimension to a point `value`. */
-  Dimension.pt(this._value) : _unit = 'pt';
-
-  /** Set this CSS Dimension to an inch `value`. */
-  Dimension.inch(this._value) : _unit = 'in';
-
-  /** Set this CSS Dimension to a centimeter `value`. */
-  Dimension.cm(this._value) : _unit = 'cm';
-
-  /** Set this CSS Dimension to a millimeter `value`. */
-  Dimension.mm(this._value) : _unit = 'mm';
-
-  /**
-   * Set this CSS Dimension to the specified number of ems.
-   *
-   * 1em is equal to the current font size. (So 2ems is equal to double the font
-   * size). This is useful for producing website layouts that scale nicely with
-   * the user's desired font size.
-   */
-  Dimension.em(this._value) : _unit = 'em';
-
-  /**
-   * Set this CSS Dimension to the specified number of x-heights.
-   *
-   * One ex is equal to the x-height of a font's baseline to its mean line,
-   * generally the height of the letter "x" in the font, which is usually about
-   * half the font-size.
-   */
-  Dimension.ex(this._value) : _unit = 'ex';
-
-  /**
-   * Construct a Dimension object from the valid, simple CSS string `cssValue`
-   * that represents a distance measurement.
-   *
-   * This constructor is intended as a convenience method for working with
-   * simplistic CSS length measurements. Non-numeric values such as `auto` or
-   * `inherit` or invalid CSS will cause this constructor to throw a
-   * FormatError.
-   */
-  Dimension.css(String cssValue)
-      : _unit = '',
-        _value = 0 {
-    if (cssValue == '') cssValue = '0px';
-    if (cssValue.endsWith('%')) {
-      _unit = '%';
-    } else {
-      _unit = cssValue.substring(cssValue.length - 2);
-    }
-    if (cssValue.contains('.')) {
-      _value =
-          double.parse(cssValue.substring(0, cssValue.length - _unit.length));
-    } else {
-      _value = int.parse(cssValue.substring(0, cssValue.length - _unit.length));
-    }
-  }
-
-  /** Print out the CSS String representation of this value. */
-  String toString() {
-    return '${_value}${_unit}';
-  }
-
-  /** Return a unitless, numerical value of this CSS value. */
-  num get value => this._value;
-}
-// Copyright (c) 2011, 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.
-
-typedef EventListener(Event event);
-// Copyright (c) 2013, 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.
-
-/**
- * A factory to expose DOM events as Streams.
- */
-class EventStreamProvider<T extends Event> {
-  final String _eventType;
-
-  const EventStreamProvider(this._eventType);
-
-  /**
-   * Gets a [Stream] for this event type, on the specified target.
-   *
-   * This will always return a broadcast stream so multiple listeners can be
-   * used simultaneously.
-   *
-   * This may be used to capture DOM events:
-   *
-   *     Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
-   *
-   *     // Alternate method:
-   *     Element.keyDownEvent.forTarget(element).capture(...);
-   *
-   * Or for listening to an event which will bubble through the DOM tree:
-   *
-   *     MediaElement.pauseEvent.forTarget(document.body).listen(...);
-   *
-   * See also:
-   *
-   * * [EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
-   *   from MDN.
-   */
-  Stream<T> forTarget(EventTarget? e, {bool useCapture: false}) =>
-      new _EventStream<T>(e, _eventType, useCapture);
-
-  /**
-   * Gets an [ElementEventStream] for this event type, on the specified element.
-   *
-   * This will always return a broadcast stream so multiple listeners can be
-   * used simultaneously.
-   *
-   * This may be used to capture DOM events:
-   *
-   *     Element.keyDownEvent.forElement(element, useCapture: true).listen(...);
-   *
-   *     // Alternate method:
-   *     Element.keyDownEvent.forElement(element).capture(...);
-   *
-   * Or for listening to an event which will bubble through the DOM tree:
-   *
-   *     MediaElement.pauseEvent.forElement(document.body).listen(...);
-   *
-   * See also:
-   *
-   * * [EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
-   *   from MDN.
-   */
-  ElementStream<T> forElement(Element e, {bool useCapture: false}) {
-    return new _ElementEventStreamImpl<T>(e, _eventType, useCapture);
-  }
-
-  /**
-   * Gets an [ElementEventStream] for this event type, on the list of elements.
-   *
-   * This will always return a broadcast stream so multiple listeners can be
-   * used simultaneously.
-   *
-   * This may be used to capture DOM events:
-   *
-   *     Element.keyDownEvent._forElementList(element, useCapture: true).listen(...);
-   *
-   * See also:
-   *
-   * * [EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
-   *   from MDN.
-   */
-  ElementStream<T> _forElementList(ElementList<Element> e,
-      {bool useCapture: false}) {
-    return new _ElementListEventStreamImpl<T>(e, _eventType, useCapture);
-  }
-
-  /**
-   * Gets the type of the event which this would listen for on the specified
-   * event target.
-   *
-   * The target is necessary because some browsers may use different event names
-   * for the same purpose and the target allows differentiating browser support.
-   */
-  String getEventType(EventTarget target) {
-    return _eventType;
-  }
-}
-
-/** A specialized Stream available to [Element]s to enable event delegation. */
-abstract class ElementStream<T extends Event> implements Stream<T> {
-  /**
-   * Return a stream that only fires when the particular event fires for
-   * elements matching the specified CSS selector.
-   *
-   * This is the Dart equivalent to jQuery's
-   * [delegate](http://api.jquery.com/delegate/).
-   */
-  Stream<T> matches(String selector);
-
-  /**
-   * Adds a capturing subscription to this stream.
-   *
-   * If the target of the event is a descendant of the element from which this
-   * stream derives then [onData] is called before the event propagates down to
-   * the target. This is the opposite of bubbling behavior, where the event
-   * is first processed for the event target and then bubbles upward.
-   *
-   * ## Other resources
-   *
-   * * [Event Capture](http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture)
-   *   from the W3C DOM Events specification.
-   */
-  StreamSubscription<T> capture(void onData(T event));
-}
-
-/**
- * Adapter for exposing DOM events as Dart streams.
- */
-class _EventStream<T extends Event> extends Stream<T> {
-  final EventTarget? _target;
-  final String _eventType;
-  final bool _useCapture;
-
-  _EventStream(this._target, this._eventType, this._useCapture);
-
-  // DOM events are inherently multi-subscribers.
-  Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription)?,
-          void onCancel(StreamSubscription<T> subscription)?}) =>
-      this;
-  bool get isBroadcast => true;
-
-  // TODO(9757): Inlining should be smart and inline only when inlining would
-  // enable scalar replacement of an immediately allocated receiver.
-  @pragma('dart2js:tryInline')
-  StreamSubscription<T> listen(void onData(T event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return new _EventStreamSubscription<T>(
-        this._target, this._eventType, onData, this._useCapture);
-  }
-}
-
-bool _matchesWithAncestors(Event event, String selector) {
-  var target = event.target;
-  return target is Element ? target.matchesWithAncestors(selector) : false;
-}
-
-/**
- * Adapter for exposing DOM Element events as streams, while also allowing
- * event delegation.
- */
-class _ElementEventStreamImpl<T extends Event> extends _EventStream<T>
-    implements ElementStream<T> {
-  _ElementEventStreamImpl(target, eventType, useCapture)
-      : super(target, eventType, useCapture);
-
-  Stream<T> matches(String selector) =>
-      this.where((event) => _matchesWithAncestors(event, selector)).map((e) {
-        e._selector = selector;
-        return e;
-      });
-
-  StreamSubscription<T> capture(void onData(T event)) =>
-      new _EventStreamSubscription<T>(
-          this._target, this._eventType, onData, true);
-}
-
-/**
- * Adapter for exposing events on a collection of DOM Elements as streams,
- * while also allowing event delegation.
- */
-class _ElementListEventStreamImpl<T extends Event> extends Stream<T>
-    implements ElementStream<T> {
-  final Iterable<Element> _targetList;
-  final bool _useCapture;
-  final String _eventType;
-
-  _ElementListEventStreamImpl(
-      this._targetList, this._eventType, this._useCapture);
-
-  Stream<T> matches(String selector) =>
-      this.where((event) => _matchesWithAncestors(event, selector)).map((e) {
-        e._selector = selector;
-        return e;
-      });
-
-  // Delegate all regular Stream behavior to a wrapped Stream.
-  StreamSubscription<T> listen(void onData(T event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    var pool = new _StreamPool<T>.broadcast();
-    for (var target in _targetList) {
-      pool.add(new _EventStream<T>(target, _eventType, _useCapture));
-    }
-    return pool.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  StreamSubscription<T> capture(void onData(T event)) {
-    var pool = new _StreamPool<T>.broadcast();
-    for (var target in _targetList) {
-      pool.add(new _EventStream<T>(target, _eventType, true));
-    }
-    return pool.stream.listen(onData);
-  }
-
-  Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription)?,
-          void onCancel(StreamSubscription<T> subscription)?}) =>
-      this;
-  bool get isBroadcast => true;
-}
-
-// We would like this to just be EventListener<T> but that typdef cannot
-// use generics until dartbug/26276 is fixed.
-typedef _EventListener<T extends Event>(T event);
-
-class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
-  int _pauseCount = 0;
-  EventTarget? _target;
-  final String _eventType;
-  EventListener? _onData;
-  final bool _useCapture;
-
-  // TODO(leafp): It would be better to write this as
-  // _onData = onData == null ? null :
-  //   onData is void Function(Event)
-  //     ? _wrapZone<Event>(onData)
-  //     : _wrapZone<Event>((e) => onData(e as T))
-  // In order to support existing tests which pass the wrong type of events but
-  // use a more general listener, without causing as much slowdown for things
-  // which are typed correctly.  But this currently runs afoul of restrictions
-  // on is checks for compatibility with the VM.
-  _EventStreamSubscription(
-      this._target, this._eventType, void onData(T event)?, this._useCapture)
-      : _onData = onData == null
-            ? null
-            : _wrapZone<Event>((e) => (onData as dynamic)(e)) {
-    _tryResume();
-  }
-
-  Future cancel() {
-    // Check for strong mode. This function can no longer return null in strong
-    // mode, so only return null in weak mode to preserve synchronous timing.
-    // See issue 41653 for more details.
-    dynamic emptyFuture =
-        typeAcceptsNull<Event>() ? null : Future<void>.value();
-    if (_canceled) return emptyFuture as Future;
-
-    _unlisten();
-    // Clear out the target to indicate this is complete.
-    _target = null;
-    _onData = null;
-    return emptyFuture as Future;
-  }
-
-  bool get _canceled => _target == null;
-
-  void onData(void handleData(T event)?) {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
-    // Remove current event listener.
-    _unlisten();
-    _onData = handleData == null
-        ? null
-        : _wrapZone<Event>((e) => (handleData as dynamic)(e));
-    _tryResume();
-  }
-
-  /// Has no effect.
-  void onError(Function? handleError) {}
-
-  /// Has no effect.
-  void onDone(void handleDone()?) {}
-
-  void pause([Future? resumeSignal]) {
-    if (_canceled) return;
-    ++_pauseCount;
-    _unlisten();
-
-    if (resumeSignal != null) {
-      resumeSignal.whenComplete(resume);
-    }
-  }
-
-  bool get isPaused => _pauseCount > 0;
-
-  void resume() {
-    if (_canceled || !isPaused) return;
-    --_pauseCount;
-    _tryResume();
-  }
-
-  void _tryResume() {
-    if (_onData != null && !isPaused) {
-      _target!.addEventListener(_eventType, _onData, _useCapture);
-    }
-  }
-
-  void _unlisten() {
-    if (_onData != null) {
-      _target!.removeEventListener(_eventType, _onData, _useCapture);
-    }
-  }
-
-  Future<E> asFuture<E>([E? futureValue]) {
-    // We just need a future that will never succeed or fail.
-    var completer = new Completer<E>();
-    return completer.future;
-  }
-}
-
-/**
- * A stream of custom events, which enables the user to "fire" (add) their own
- * custom events to a stream.
- */
-abstract class CustomStream<T extends Event> implements Stream<T> {
-  /**
-   * Add the following custom event to the stream for dispatching to interested
-   * listeners.
-   */
-  void add(T event);
-}
-
-class _CustomEventStreamImpl<T extends Event> extends Stream<T>
-    implements CustomStream<T> {
-  StreamController<T> _streamController;
-  /** The type of event this stream is providing (e.g. "keydown"). */
-  String _type;
-
-  _CustomEventStreamImpl(String type)
-      : _type = type,
-        _streamController = new StreamController.broadcast(sync: true);
-
-  // Delegate all regular Stream behavior to our wrapped Stream.
-  StreamSubscription<T> listen(void onData(T event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _streamController.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Stream<T> asBroadcastStream(
-          {void onListen(StreamSubscription<T> subscription)?,
-          void onCancel(StreamSubscription<T> subscription)?}) =>
-      _streamController.stream;
-
-  bool get isBroadcast => true;
-
-  void add(T event) {
-    if (event.type == _type) _streamController.add(event);
-  }
-}
-
-class _CustomKeyEventStreamImpl extends _CustomEventStreamImpl<KeyEvent>
-    implements CustomStream<KeyEvent> {
-  _CustomKeyEventStreamImpl(String type) : super(type);
-
-  void add(KeyEvent event) {
-    if (event.type == _type) {
-      event.currentTarget!.dispatchEvent(event._parent);
-      _streamController.add(event);
-    }
-  }
-}
-
-/**
- * A pool of streams whose events are unified and emitted through a central
- * stream.
- */
-// TODO (efortuna): Remove this when Issue 12218 is addressed.
-class _StreamPool<T> {
-  StreamController<T>? _controller;
-
-  /// Subscriptions to the streams that make up the pool.
-  var _subscriptions = new Map<Stream<T>, StreamSubscription<T>>();
-
-  /**
-   * Creates a new stream pool where [stream] can be listened to more than
-   * once.
-   *
-   * Any events from buffered streams in the pool will be emitted immediately,
-   * regardless of whether [stream] has any subscribers.
-   */
-  _StreamPool.broadcast() {
-    _controller =
-        new StreamController<T>.broadcast(sync: true, onCancel: close);
-  }
-
-  /**
-   * The stream through which all events from streams in the pool are emitted.
-   */
-  Stream<T> get stream => _controller!.stream;
-
-  /**
-   * Adds [stream] as a member of this pool.
-   *
-   * Any events from [stream] will be emitted through [this.stream]. If
-   * [stream] is sync, they'll be emitted synchronously; if [stream] is async,
-   * they'll be emitted asynchronously.
-   */
-  void add(Stream<T> stream) {
-    if (_subscriptions.containsKey(stream)) return;
-    _subscriptions[stream] = stream.listen(_controller!.add,
-        onError: _controller!.addError, onDone: () => remove(stream));
-  }
-
-  /** Removes [stream] as a member of this pool. */
-  void remove(Stream<T> stream) {
-    var subscription = _subscriptions.remove(stream);
-    if (subscription != null) subscription.cancel();
-  }
-
-  /** Removes all streams from this pool and closes [stream]. */
-  void close() {
-    for (var subscription in _subscriptions.values) {
-      subscription.cancel();
-    }
-    _subscriptions.clear();
-    _controller!.close();
-  }
-}
-
-/**
- * A factory to expose DOM events as streams, where the DOM event name has to
- * be determined on the fly (for example, mouse wheel events).
- */
-class _CustomEventStreamProvider<T extends Event>
-    implements EventStreamProvider<T> {
-  final _eventTypeGetter;
-  const _CustomEventStreamProvider(this._eventTypeGetter);
-
-  Stream<T> forTarget(EventTarget? e, {bool useCapture: false}) {
-    return new _EventStream<T>(e, _eventTypeGetter(e), useCapture);
-  }
-
-  ElementStream<T> forElement(Element e, {bool useCapture: false}) {
-    return new _ElementEventStreamImpl<T>(e, _eventTypeGetter(e), useCapture);
-  }
-
-  ElementStream<T> _forElementList(ElementList<Element> e,
-      {bool useCapture: false}) {
-    return new _ElementListEventStreamImpl<T>(
-        e, _eventTypeGetter(e), useCapture);
-  }
-
-  String getEventType(EventTarget target) {
-    return _eventTypeGetter(target);
-  }
-
-  String get _eventType =>
-      throw new UnsupportedError('Access type through getEventType method.');
-}
-// DO NOT EDIT- this file is generated from running tool/generator.sh.
-
-// Copyright (c) 2013, 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.
-
-/**
- * A Dart DOM validator generated from Caja whitelists.
- *
- * This contains a whitelist of known HTML tagNames and attributes and will only
- * accept known good values.
- *
- * See also:
- *
- * * <https://code.google.com/p/google-caja/wiki/CajaWhitelists>
- */
-class _Html5NodeValidator implements NodeValidator {
-  static final Set<String> _allowedElements = new Set.from([
-    'A',
-    'ABBR',
-    'ACRONYM',
-    'ADDRESS',
-    'AREA',
-    'ARTICLE',
-    'ASIDE',
-    'AUDIO',
-    'B',
-    'BDI',
-    'BDO',
-    'BIG',
-    'BLOCKQUOTE',
-    'BR',
-    'BUTTON',
-    'CANVAS',
-    'CAPTION',
-    'CENTER',
-    'CITE',
-    'CODE',
-    'COL',
-    'COLGROUP',
-    'COMMAND',
-    'DATA',
-    'DATALIST',
-    'DD',
-    'DEL',
-    'DETAILS',
-    'DFN',
-    'DIR',
-    'DIV',
-    'DL',
-    'DT',
-    'EM',
-    'FIELDSET',
-    'FIGCAPTION',
-    'FIGURE',
-    'FONT',
-    'FOOTER',
-    'FORM',
-    'H1',
-    'H2',
-    'H3',
-    'H4',
-    'H5',
-    'H6',
-    'HEADER',
-    'HGROUP',
-    'HR',
-    'I',
-    'IFRAME',
-    'IMG',
-    'INPUT',
-    'INS',
-    'KBD',
-    'LABEL',
-    'LEGEND',
-    'LI',
-    'MAP',
-    'MARK',
-    'MENU',
-    'METER',
-    'NAV',
-    'NOBR',
-    'OL',
-    'OPTGROUP',
-    'OPTION',
-    'OUTPUT',
-    'P',
-    'PRE',
-    'PROGRESS',
-    'Q',
-    'S',
-    'SAMP',
-    'SECTION',
-    'SELECT',
-    'SMALL',
-    'SOURCE',
-    'SPAN',
-    'STRIKE',
-    'STRONG',
-    'SUB',
-    'SUMMARY',
-    'SUP',
-    'TABLE',
-    'TBODY',
-    'TD',
-    'TEXTAREA',
-    'TFOOT',
-    'TH',
-    'THEAD',
-    'TIME',
-    'TR',
-    'TRACK',
-    'TT',
-    'U',
-    'UL',
-    'VAR',
-    'VIDEO',
-    'WBR',
-  ]);
-
-  static const _standardAttributes = const <String>[
-    '*::class',
-    '*::dir',
-    '*::draggable',
-    '*::hidden',
-    '*::id',
-    '*::inert',
-    '*::itemprop',
-    '*::itemref',
-    '*::itemscope',
-    '*::lang',
-    '*::spellcheck',
-    '*::title',
-    '*::translate',
-    'A::accesskey',
-    'A::coords',
-    'A::hreflang',
-    'A::name',
-    'A::shape',
-    'A::tabindex',
-    'A::target',
-    'A::type',
-    'AREA::accesskey',
-    'AREA::alt',
-    'AREA::coords',
-    'AREA::nohref',
-    'AREA::shape',
-    'AREA::tabindex',
-    'AREA::target',
-    'AUDIO::controls',
-    'AUDIO::loop',
-    'AUDIO::mediagroup',
-    'AUDIO::muted',
-    'AUDIO::preload',
-    'BDO::dir',
-    'BODY::alink',
-    'BODY::bgcolor',
-    'BODY::link',
-    'BODY::text',
-    'BODY::vlink',
-    'BR::clear',
-    'BUTTON::accesskey',
-    'BUTTON::disabled',
-    'BUTTON::name',
-    'BUTTON::tabindex',
-    'BUTTON::type',
-    'BUTTON::value',
-    'CANVAS::height',
-    'CANVAS::width',
-    'CAPTION::align',
-    'COL::align',
-    'COL::char',
-    'COL::charoff',
-    'COL::span',
-    'COL::valign',
-    'COL::width',
-    'COLGROUP::align',
-    'COLGROUP::char',
-    'COLGROUP::charoff',
-    'COLGROUP::span',
-    'COLGROUP::valign',
-    'COLGROUP::width',
-    'COMMAND::checked',
-    'COMMAND::command',
-    'COMMAND::disabled',
-    'COMMAND::label',
-    'COMMAND::radiogroup',
-    'COMMAND::type',
-    'DATA::value',
-    'DEL::datetime',
-    'DETAILS::open',
-    'DIR::compact',
-    'DIV::align',
-    'DL::compact',
-    'FIELDSET::disabled',
-    'FONT::color',
-    'FONT::face',
-    'FONT::size',
-    'FORM::accept',
-    'FORM::autocomplete',
-    'FORM::enctype',
-    'FORM::method',
-    'FORM::name',
-    'FORM::novalidate',
-    'FORM::target',
-    'FRAME::name',
-    'H1::align',
-    'H2::align',
-    'H3::align',
-    'H4::align',
-    'H5::align',
-    'H6::align',
-    'HR::align',
-    'HR::noshade',
-    'HR::size',
-    'HR::width',
-    'HTML::version',
-    'IFRAME::align',
-    'IFRAME::frameborder',
-    'IFRAME::height',
-    'IFRAME::marginheight',
-    'IFRAME::marginwidth',
-    'IFRAME::width',
-    'IMG::align',
-    'IMG::alt',
-    'IMG::border',
-    'IMG::height',
-    'IMG::hspace',
-    'IMG::ismap',
-    'IMG::name',
-    'IMG::usemap',
-    'IMG::vspace',
-    'IMG::width',
-    'INPUT::accept',
-    'INPUT::accesskey',
-    'INPUT::align',
-    'INPUT::alt',
-    'INPUT::autocomplete',
-    'INPUT::autofocus',
-    'INPUT::checked',
-    'INPUT::disabled',
-    'INPUT::inputmode',
-    'INPUT::ismap',
-    'INPUT::list',
-    'INPUT::max',
-    'INPUT::maxlength',
-    'INPUT::min',
-    'INPUT::multiple',
-    'INPUT::name',
-    'INPUT::placeholder',
-    'INPUT::readonly',
-    'INPUT::required',
-    'INPUT::size',
-    'INPUT::step',
-    'INPUT::tabindex',
-    'INPUT::type',
-    'INPUT::usemap',
-    'INPUT::value',
-    'INS::datetime',
-    'KEYGEN::disabled',
-    'KEYGEN::keytype',
-    'KEYGEN::name',
-    'LABEL::accesskey',
-    'LABEL::for',
-    'LEGEND::accesskey',
-    'LEGEND::align',
-    'LI::type',
-    'LI::value',
-    'LINK::sizes',
-    'MAP::name',
-    'MENU::compact',
-    'MENU::label',
-    'MENU::type',
-    'METER::high',
-    'METER::low',
-    'METER::max',
-    'METER::min',
-    'METER::value',
-    'OBJECT::typemustmatch',
-    'OL::compact',
-    'OL::reversed',
-    'OL::start',
-    'OL::type',
-    'OPTGROUP::disabled',
-    'OPTGROUP::label',
-    'OPTION::disabled',
-    'OPTION::label',
-    'OPTION::selected',
-    'OPTION::value',
-    'OUTPUT::for',
-    'OUTPUT::name',
-    'P::align',
-    'PRE::width',
-    'PROGRESS::max',
-    'PROGRESS::min',
-    'PROGRESS::value',
-    'SELECT::autocomplete',
-    'SELECT::disabled',
-    'SELECT::multiple',
-    'SELECT::name',
-    'SELECT::required',
-    'SELECT::size',
-    'SELECT::tabindex',
-    'SOURCE::type',
-    'TABLE::align',
-    'TABLE::bgcolor',
-    'TABLE::border',
-    'TABLE::cellpadding',
-    'TABLE::cellspacing',
-    'TABLE::frame',
-    'TABLE::rules',
-    'TABLE::summary',
-    'TABLE::width',
-    'TBODY::align',
-    'TBODY::char',
-    'TBODY::charoff',
-    'TBODY::valign',
-    'TD::abbr',
-    'TD::align',
-    'TD::axis',
-    'TD::bgcolor',
-    'TD::char',
-    'TD::charoff',
-    'TD::colspan',
-    'TD::headers',
-    'TD::height',
-    'TD::nowrap',
-    'TD::rowspan',
-    'TD::scope',
-    'TD::valign',
-    'TD::width',
-    'TEXTAREA::accesskey',
-    'TEXTAREA::autocomplete',
-    'TEXTAREA::cols',
-    'TEXTAREA::disabled',
-    'TEXTAREA::inputmode',
-    'TEXTAREA::name',
-    'TEXTAREA::placeholder',
-    'TEXTAREA::readonly',
-    'TEXTAREA::required',
-    'TEXTAREA::rows',
-    'TEXTAREA::tabindex',
-    'TEXTAREA::wrap',
-    'TFOOT::align',
-    'TFOOT::char',
-    'TFOOT::charoff',
-    'TFOOT::valign',
-    'TH::abbr',
-    'TH::align',
-    'TH::axis',
-    'TH::bgcolor',
-    'TH::char',
-    'TH::charoff',
-    'TH::colspan',
-    'TH::headers',
-    'TH::height',
-    'TH::nowrap',
-    'TH::rowspan',
-    'TH::scope',
-    'TH::valign',
-    'TH::width',
-    'THEAD::align',
-    'THEAD::char',
-    'THEAD::charoff',
-    'THEAD::valign',
-    'TR::align',
-    'TR::bgcolor',
-    'TR::char',
-    'TR::charoff',
-    'TR::valign',
-    'TRACK::default',
-    'TRACK::kind',
-    'TRACK::label',
-    'TRACK::srclang',
-    'UL::compact',
-    'UL::type',
-    'VIDEO::controls',
-    'VIDEO::height',
-    'VIDEO::loop',
-    'VIDEO::mediagroup',
-    'VIDEO::muted',
-    'VIDEO::preload',
-    'VIDEO::width',
-  ];
-
-  static const _uriAttributes = const <String>[
-    'A::href',
-    'AREA::href',
-    'BLOCKQUOTE::cite',
-    'BODY::background',
-    'COMMAND::icon',
-    'DEL::cite',
-    'FORM::action',
-    'IMG::src',
-    'INPUT::src',
-    'INS::cite',
-    'Q::cite',
-    'VIDEO::poster',
-  ];
-
-  final UriPolicy uriPolicy;
-
-  static final Map<String, Function> _attributeValidators = {};
-
-  /**
-   * All known URI attributes will be validated against the UriPolicy, if
-   * [uriPolicy] is null then a default UriPolicy will be used.
-   */
-  _Html5NodeValidator({UriPolicy? uriPolicy})
-      : uriPolicy = uriPolicy ?? UriPolicy() {
-    if (_attributeValidators.isEmpty) {
-      for (var attr in _standardAttributes) {
-        _attributeValidators[attr] = _standardAttributeValidator;
-      }
-
-      for (var attr in _uriAttributes) {
-        _attributeValidators[attr] = _uriAttributeValidator;
-      }
-    }
-  }
-
-  bool allowsElement(Element element) {
-    return _allowedElements.contains(Element._safeTagName(element));
-  }
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = Element._safeTagName(element);
-    var validator = _attributeValidators['$tagName::$attributeName'];
-    if (validator == null) {
-      validator = _attributeValidators['*::$attributeName'];
-    }
-    if (validator == null) {
-      return false;
-    }
-    return validator(element, attributeName, value, this);
-  }
-
-  static bool _standardAttributeValidator(Element element, String attributeName,
-      String value, _Html5NodeValidator context) {
-    return true;
-  }
-
-  static bool _uriAttributeValidator(Element element, String attributeName,
-      String value, _Html5NodeValidator context) {
-    return context.uriPolicy.allowsUri(value);
-  }
-}
-// Copyright (c) 2012, 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.
-
-abstract class ImmutableListMixin<E> implements List<E> {
-  // From Iterable<$E>:
-  Iterator<E> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<E>(this);
-  }
-
-  // From List<E>:
-  void add(E value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void sort([int compare(E a, E b)?]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  void shuffle([Random? random]) {
-    throw new UnsupportedError("Cannot shuffle immutable List.");
-  }
-
-  void insert(int index, E element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  E removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  E removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  bool remove(Object? object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(E element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(E element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [E? fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Defines the keycode values for keys that are returned by
- * KeyboardEvent.keyCode.
- *
- * Important note: There is substantial divergence in how different browsers
- * handle keycodes and their variants in different locales/keyboard layouts. We
- * provide these constants to help make code processing keys more readable.
- */
-abstract class KeyCode {
-  // These constant names were borrowed from Closure's Keycode enumeration
-  // class.
-  // https://github.com/google/closure-library/blob/master/closure/goog/events/keycodes.js
-  static const int WIN_KEY_FF_LINUX = 0;
-  static const int MAC_ENTER = 3;
-  static const int BACKSPACE = 8;
-  static const int TAB = 9;
-  /** NUM_CENTER is also NUMLOCK for FF and Safari on Mac. */
-  static const int NUM_CENTER = 12;
-  static const int ENTER = 13;
-  static const int SHIFT = 16;
-  static const int CTRL = 17;
-  static const int ALT = 18;
-  static const int PAUSE = 19;
-  static const int CAPS_LOCK = 20;
-  static const int ESC = 27;
-  static const int SPACE = 32;
-  static const int PAGE_UP = 33;
-  static const int PAGE_DOWN = 34;
-  static const int END = 35;
-  static const int HOME = 36;
-  static const int LEFT = 37;
-  static const int UP = 38;
-  static const int RIGHT = 39;
-  static const int DOWN = 40;
-  static const int NUM_NORTH_EAST = 33;
-  static const int NUM_SOUTH_EAST = 34;
-  static const int NUM_SOUTH_WEST = 35;
-  static const int NUM_NORTH_WEST = 36;
-  static const int NUM_WEST = 37;
-  static const int NUM_NORTH = 38;
-  static const int NUM_EAST = 39;
-  static const int NUM_SOUTH = 40;
-  static const int PRINT_SCREEN = 44;
-  static const int INSERT = 45;
-  static const int NUM_INSERT = 45;
-  static const int DELETE = 46;
-  static const int NUM_DELETE = 46;
-  static const int ZERO = 48;
-  static const int ONE = 49;
-  static const int TWO = 50;
-  static const int THREE = 51;
-  static const int FOUR = 52;
-  static const int FIVE = 53;
-  static const int SIX = 54;
-  static const int SEVEN = 55;
-  static const int EIGHT = 56;
-  static const int NINE = 57;
-  static const int FF_SEMICOLON = 59;
-  static const int FF_EQUALS = 61;
-  /**
-   * CAUTION: The question mark is for US-keyboard layouts. It varies
-   * for other locales and keyboard layouts.
-   */
-  static const int QUESTION_MARK = 63;
-  static const int A = 65;
-  static const int B = 66;
-  static const int C = 67;
-  static const int D = 68;
-  static const int E = 69;
-  static const int F = 70;
-  static const int G = 71;
-  static const int H = 72;
-  static const int I = 73;
-  static const int J = 74;
-  static const int K = 75;
-  static const int L = 76;
-  static const int M = 77;
-  static const int N = 78;
-  static const int O = 79;
-  static const int P = 80;
-  static const int Q = 81;
-  static const int R = 82;
-  static const int S = 83;
-  static const int T = 84;
-  static const int U = 85;
-  static const int V = 86;
-  static const int W = 87;
-  static const int X = 88;
-  static const int Y = 89;
-  static const int Z = 90;
-  static const int META = 91;
-  static const int WIN_KEY_LEFT = 91;
-  static const int WIN_KEY_RIGHT = 92;
-  static const int CONTEXT_MENU = 93;
-  static const int NUM_ZERO = 96;
-  static const int NUM_ONE = 97;
-  static const int NUM_TWO = 98;
-  static const int NUM_THREE = 99;
-  static const int NUM_FOUR = 100;
-  static const int NUM_FIVE = 101;
-  static const int NUM_SIX = 102;
-  static const int NUM_SEVEN = 103;
-  static const int NUM_EIGHT = 104;
-  static const int NUM_NINE = 105;
-  static const int NUM_MULTIPLY = 106;
-  static const int NUM_PLUS = 107;
-  static const int NUM_MINUS = 109;
-  static const int NUM_PERIOD = 110;
-  static const int NUM_DIVISION = 111;
-  static const int F1 = 112;
-  static const int F2 = 113;
-  static const int F3 = 114;
-  static const int F4 = 115;
-  static const int F5 = 116;
-  static const int F6 = 117;
-  static const int F7 = 118;
-  static const int F8 = 119;
-  static const int F9 = 120;
-  static const int F10 = 121;
-  static const int F11 = 122;
-  static const int F12 = 123;
-  static const int NUMLOCK = 144;
-  static const int SCROLL_LOCK = 145;
-
-  // OS-specific media keys like volume controls and browser controls.
-  static const int FIRST_MEDIA_KEY = 166;
-  static const int LAST_MEDIA_KEY = 183;
-
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int SEMICOLON = 186;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int DASH = 189;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int EQUALS = 187;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int COMMA = 188;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int PERIOD = 190;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int SLASH = 191;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int APOSTROPHE = 192;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int TILDE = 192;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int SINGLE_QUOTE = 222;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int OPEN_SQUARE_BRACKET = 219;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int BACKSLASH = 220;
-  /**
-   * CAUTION: This constant requires localization for other locales and keyboard
-   * layouts.
-   */
-  static const int CLOSE_SQUARE_BRACKET = 221;
-  static const int WIN_KEY = 224;
-  static const int MAC_FF_META = 224;
-  static const int WIN_IME = 229;
-
-  /** A sentinel value if the keycode could not be determined. */
-  static const int UNKNOWN = -1;
-
-  /**
-   * Returns true if the keyCode produces a (US keyboard) character.
-   * Note: This does not (yet) cover characters on non-US keyboards (Russian,
-   * Hebrew, etc.).
-   */
-  static bool isCharacterKey(int keyCode) {
-    if ((keyCode >= ZERO && keyCode <= NINE) ||
-        (keyCode >= NUM_ZERO && keyCode <= NUM_MULTIPLY) ||
-        (keyCode >= A && keyCode <= Z)) {
-      return true;
-    }
-
-    // Safari sends zero key code for non-latin characters.
-    if (Device.isWebKit && keyCode == 0) {
-      return true;
-    }
-
-    return (keyCode == SPACE ||
-        keyCode == QUESTION_MARK ||
-        keyCode == NUM_PLUS ||
-        keyCode == NUM_MINUS ||
-        keyCode == NUM_PERIOD ||
-        keyCode == NUM_DIVISION ||
-        keyCode == SEMICOLON ||
-        keyCode == FF_SEMICOLON ||
-        keyCode == DASH ||
-        keyCode == EQUALS ||
-        keyCode == FF_EQUALS ||
-        keyCode == COMMA ||
-        keyCode == PERIOD ||
-        keyCode == SLASH ||
-        keyCode == APOSTROPHE ||
-        keyCode == SINGLE_QUOTE ||
-        keyCode == OPEN_SQUARE_BRACKET ||
-        keyCode == BACKSLASH ||
-        keyCode == CLOSE_SQUARE_BRACKET);
-  }
-
-  /**
-   * Experimental helper function for converting keyCodes to keyNames for the
-   * keyIdentifier attribute still used in browsers not updated with current
-   * spec. This is an imperfect conversion! It will need to be refined, but
-   * hopefully it can just completely go away once all the browsers update to
-   * follow the DOM3 spec.
-   */
-  static String _convertKeyCodeToKeyName(int keyCode) {
-    switch (keyCode) {
-      case KeyCode.ALT:
-        return _KeyName.ALT;
-      case KeyCode.BACKSPACE:
-        return _KeyName.BACKSPACE;
-      case KeyCode.CAPS_LOCK:
-        return _KeyName.CAPS_LOCK;
-      case KeyCode.CTRL:
-        return _KeyName.CONTROL;
-      case KeyCode.DELETE:
-        return _KeyName.DEL;
-      case KeyCode.DOWN:
-        return _KeyName.DOWN;
-      case KeyCode.END:
-        return _KeyName.END;
-      case KeyCode.ENTER:
-        return _KeyName.ENTER;
-      case KeyCode.ESC:
-        return _KeyName.ESC;
-      case KeyCode.F1:
-        return _KeyName.F1;
-      case KeyCode.F2:
-        return _KeyName.F2;
-      case KeyCode.F3:
-        return _KeyName.F3;
-      case KeyCode.F4:
-        return _KeyName.F4;
-      case KeyCode.F5:
-        return _KeyName.F5;
-      case KeyCode.F6:
-        return _KeyName.F6;
-      case KeyCode.F7:
-        return _KeyName.F7;
-      case KeyCode.F8:
-        return _KeyName.F8;
-      case KeyCode.F9:
-        return _KeyName.F9;
-      case KeyCode.F10:
-        return _KeyName.F10;
-      case KeyCode.F11:
-        return _KeyName.F11;
-      case KeyCode.F12:
-        return _KeyName.F12;
-      case KeyCode.HOME:
-        return _KeyName.HOME;
-      case KeyCode.INSERT:
-        return _KeyName.INSERT;
-      case KeyCode.LEFT:
-        return _KeyName.LEFT;
-      case KeyCode.META:
-        return _KeyName.META;
-      case KeyCode.NUMLOCK:
-        return _KeyName.NUM_LOCK;
-      case KeyCode.PAGE_DOWN:
-        return _KeyName.PAGE_DOWN;
-      case KeyCode.PAGE_UP:
-        return _KeyName.PAGE_UP;
-      case KeyCode.PAUSE:
-        return _KeyName.PAUSE;
-      case KeyCode.PRINT_SCREEN:
-        return _KeyName.PRINT_SCREEN;
-      case KeyCode.RIGHT:
-        return _KeyName.RIGHT;
-      case KeyCode.SCROLL_LOCK:
-        return _KeyName.SCROLL;
-      case KeyCode.SHIFT:
-        return _KeyName.SHIFT;
-      case KeyCode.SPACE:
-        return _KeyName.SPACEBAR;
-      case KeyCode.TAB:
-        return _KeyName.TAB;
-      case KeyCode.UP:
-        return _KeyName.UP;
-      case KeyCode.WIN_IME:
-      case KeyCode.WIN_KEY:
-      case KeyCode.WIN_KEY_LEFT:
-      case KeyCode.WIN_KEY_RIGHT:
-        return _KeyName.WIN;
-      default:
-        return _KeyName.UNIDENTIFIED;
-    }
-    return _KeyName.UNIDENTIFIED;
-  }
-}
-// Copyright (c) 2011, 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.
-
-/**
- * Defines the standard key locations returned by
- * KeyboardEvent.getKeyLocation.
- */
-abstract class KeyLocation {
-  /**
-   * The event key is not distinguished as the left or right version
-   * of the key, and did not originate from the numeric keypad (or did not
-   * originate with a virtual key corresponding to the numeric keypad).
-   */
-  static const int STANDARD = 0;
-
-  /**
-   * The event key is in the left key location.
-   */
-  static const int LEFT = 1;
-
-  /**
-   * The event key is in the right key location.
-   */
-  static const int RIGHT = 2;
-
-  /**
-   * The event key originated on the numeric keypad or with a virtual key
-   * corresponding to the numeric keypad.
-   */
-  static const int NUMPAD = 3;
-
-  /**
-   * The event key originated on a mobile device, either on a physical
-   * keypad or a virtual keyboard.
-   */
-  static const int MOBILE = 4;
-
-  /**
-   * The event key originated on a game controller or a joystick on a mobile
-   * device.
-   */
-  static const int JOYSTICK = 5;
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Defines the standard keyboard identifier names for keys that are returned
- * by KeyboardEvent.getKeyboardIdentifier when the key does not have a direct
- * unicode mapping.
- */
-abstract class _KeyName {
-  /** The Accept (Commit, OK) key */
-  static const String ACCEPT = "Accept";
-
-  /** The Add key */
-  static const String ADD = "Add";
-
-  /** The Again key */
-  static const String AGAIN = "Again";
-
-  /** The All Candidates key */
-  static const String ALL_CANDIDATES = "AllCandidates";
-
-  /** The Alphanumeric key */
-  static const String ALPHANUMERIC = "Alphanumeric";
-
-  /** The Alt (Menu) key */
-  static const String ALT = "Alt";
-
-  /** The Alt-Graph key */
-  static const String ALT_GRAPH = "AltGraph";
-
-  /** The Application key */
-  static const String APPS = "Apps";
-
-  /** The ATTN key */
-  static const String ATTN = "Attn";
-
-  /** The Browser Back key */
-  static const String BROWSER_BACK = "BrowserBack";
-
-  /** The Browser Favorites key */
-  static const String BROWSER_FAVORTIES = "BrowserFavorites";
-
-  /** The Browser Forward key */
-  static const String BROWSER_FORWARD = "BrowserForward";
-
-  /** The Browser Home key */
-  static const String BROWSER_NAME = "BrowserHome";
-
-  /** The Browser Refresh key */
-  static const String BROWSER_REFRESH = "BrowserRefresh";
-
-  /** The Browser Search key */
-  static const String BROWSER_SEARCH = "BrowserSearch";
-
-  /** The Browser Stop key */
-  static const String BROWSER_STOP = "BrowserStop";
-
-  /** The Camera key */
-  static const String CAMERA = "Camera";
-
-  /** The Caps Lock (Capital) key */
-  static const String CAPS_LOCK = "CapsLock";
-
-  /** The Clear key */
-  static const String CLEAR = "Clear";
-
-  /** The Code Input key */
-  static const String CODE_INPUT = "CodeInput";
-
-  /** The Compose key */
-  static const String COMPOSE = "Compose";
-
-  /** The Control (Ctrl) key */
-  static const String CONTROL = "Control";
-
-  /** The Crsel key */
-  static const String CRSEL = "Crsel";
-
-  /** The Convert key */
-  static const String CONVERT = "Convert";
-
-  /** The Copy key */
-  static const String COPY = "Copy";
-
-  /** The Cut key */
-  static const String CUT = "Cut";
-
-  /** The Decimal key */
-  static const String DECIMAL = "Decimal";
-
-  /** The Divide key */
-  static const String DIVIDE = "Divide";
-
-  /** The Down Arrow key */
-  static const String DOWN = "Down";
-
-  /** The diagonal Down-Left Arrow key */
-  static const String DOWN_LEFT = "DownLeft";
-
-  /** The diagonal Down-Right Arrow key */
-  static const String DOWN_RIGHT = "DownRight";
-
-  /** The Eject key */
-  static const String EJECT = "Eject";
-
-  /** The End key */
-  static const String END = "End";
-
-  /**
-   * The Enter key. Note: This key value must also be used for the Return
-   *  (Macintosh numpad) key
-   */
-  static const String ENTER = "Enter";
-
-  /** The Erase EOF key */
-  static const String ERASE_EOF = "EraseEof";
-
-  /** The Execute key */
-  static const String EXECUTE = "Execute";
-
-  /** The Exsel key */
-  static const String EXSEL = "Exsel";
-
-  /** The Function switch key */
-  static const String FN = "Fn";
-
-  /** The F1 key */
-  static const String F1 = "F1";
-
-  /** The F2 key */
-  static const String F2 = "F2";
-
-  /** The F3 key */
-  static const String F3 = "F3";
-
-  /** The F4 key */
-  static const String F4 = "F4";
-
-  /** The F5 key */
-  static const String F5 = "F5";
-
-  /** The F6 key */
-  static const String F6 = "F6";
-
-  /** The F7 key */
-  static const String F7 = "F7";
-
-  /** The F8 key */
-  static const String F8 = "F8";
-
-  /** The F9 key */
-  static const String F9 = "F9";
-
-  /** The F10 key */
-  static const String F10 = "F10";
-
-  /** The F11 key */
-  static const String F11 = "F11";
-
-  /** The F12 key */
-  static const String F12 = "F12";
-
-  /** The F13 key */
-  static const String F13 = "F13";
-
-  /** The F14 key */
-  static const String F14 = "F14";
-
-  /** The F15 key */
-  static const String F15 = "F15";
-
-  /** The F16 key */
-  static const String F16 = "F16";
-
-  /** The F17 key */
-  static const String F17 = "F17";
-
-  /** The F18 key */
-  static const String F18 = "F18";
-
-  /** The F19 key */
-  static const String F19 = "F19";
-
-  /** The F20 key */
-  static const String F20 = "F20";
-
-  /** The F21 key */
-  static const String F21 = "F21";
-
-  /** The F22 key */
-  static const String F22 = "F22";
-
-  /** The F23 key */
-  static const String F23 = "F23";
-
-  /** The F24 key */
-  static const String F24 = "F24";
-
-  /** The Final Mode (Final) key used on some asian keyboards */
-  static const String FINAL_MODE = "FinalMode";
-
-  /** The Find key */
-  static const String FIND = "Find";
-
-  /** The Full-Width Characters key */
-  static const String FULL_WIDTH = "FullWidth";
-
-  /** The Half-Width Characters key */
-  static const String HALF_WIDTH = "HalfWidth";
-
-  /** The Hangul (Korean characters) Mode key */
-  static const String HANGUL_MODE = "HangulMode";
-
-  /** The Hanja (Korean characters) Mode key */
-  static const String HANJA_MODE = "HanjaMode";
-
-  /** The Help key */
-  static const String HELP = "Help";
-
-  /** The Hiragana (Japanese Kana characters) key */
-  static const String HIRAGANA = "Hiragana";
-
-  /** The Home key */
-  static const String HOME = "Home";
-
-  /** The Insert (Ins) key */
-  static const String INSERT = "Insert";
-
-  /** The Japanese-Hiragana key */
-  static const String JAPANESE_HIRAGANA = "JapaneseHiragana";
-
-  /** The Japanese-Katakana key */
-  static const String JAPANESE_KATAKANA = "JapaneseKatakana";
-
-  /** The Japanese-Romaji key */
-  static const String JAPANESE_ROMAJI = "JapaneseRomaji";
-
-  /** The Junja Mode key */
-  static const String JUNJA_MODE = "JunjaMode";
-
-  /** The Kana Mode (Kana Lock) key */
-  static const String KANA_MODE = "KanaMode";
-
-  /**
-   * The Kanji (Japanese name for ideographic characters of Chinese origin)
-   * Mode key
-   */
-  static const String KANJI_MODE = "KanjiMode";
-
-  /** The Katakana (Japanese Kana characters) key */
-  static const String KATAKANA = "Katakana";
-
-  /** The Start Application One key */
-  static const String LAUNCH_APPLICATION_1 = "LaunchApplication1";
-
-  /** The Start Application Two key */
-  static const String LAUNCH_APPLICATION_2 = "LaunchApplication2";
-
-  /** The Start Mail key */
-  static const String LAUNCH_MAIL = "LaunchMail";
-
-  /** The Left Arrow key */
-  static const String LEFT = "Left";
-
-  /** The Menu key */
-  static const String MENU = "Menu";
-
-  /**
-   * The Meta key. Note: This key value shall be also used for the Apple
-   * Command key
-   */
-  static const String META = "Meta";
-
-  /** The Media Next Track key */
-  static const String MEDIA_NEXT_TRACK = "MediaNextTrack";
-
-  /** The Media Play Pause key */
-  static const String MEDIA_PAUSE_PLAY = "MediaPlayPause";
-
-  /** The Media Previous Track key */
-  static const String MEDIA_PREVIOUS_TRACK = "MediaPreviousTrack";
-
-  /** The Media Stop key */
-  static const String MEDIA_STOP = "MediaStop";
-
-  /** The Mode Change key */
-  static const String MODE_CHANGE = "ModeChange";
-
-  /** The Next Candidate function key */
-  static const String NEXT_CANDIDATE = "NextCandidate";
-
-  /** The Nonconvert (Don't Convert) key */
-  static const String NON_CONVERT = "Nonconvert";
-
-  /** The Number Lock key */
-  static const String NUM_LOCK = "NumLock";
-
-  /** The Page Down (Next) key */
-  static const String PAGE_DOWN = "PageDown";
-
-  /** The Page Up key */
-  static const String PAGE_UP = "PageUp";
-
-  /** The Paste key */
-  static const String PASTE = "Paste";
-
-  /** The Pause key */
-  static const String PAUSE = "Pause";
-
-  /** The Play key */
-  static const String PLAY = "Play";
-
-  /**
-   * The Power key. Note: Some devices may not expose this key to the
-   * operating environment
-   */
-  static const String POWER = "Power";
-
-  /** The Previous Candidate function key */
-  static const String PREVIOUS_CANDIDATE = "PreviousCandidate";
-
-  /** The Print Screen (PrintScrn, SnapShot) key */
-  static const String PRINT_SCREEN = "PrintScreen";
-
-  /** The Process key */
-  static const String PROCESS = "Process";
-
-  /** The Props key */
-  static const String PROPS = "Props";
-
-  /** The Right Arrow key */
-  static const String RIGHT = "Right";
-
-  /** The Roman Characters function key */
-  static const String ROMAN_CHARACTERS = "RomanCharacters";
-
-  /** The Scroll Lock key */
-  static const String SCROLL = "Scroll";
-
-  /** The Select key */
-  static const String SELECT = "Select";
-
-  /** The Select Media key */
-  static const String SELECT_MEDIA = "SelectMedia";
-
-  /** The Separator key */
-  static const String SEPARATOR = "Separator";
-
-  /** The Shift key */
-  static const String SHIFT = "Shift";
-
-  /** The Soft1 key */
-  static const String SOFT_1 = "Soft1";
-
-  /** The Soft2 key */
-  static const String SOFT_2 = "Soft2";
-
-  /** The Soft3 key */
-  static const String SOFT_3 = "Soft3";
-
-  /** The Soft4 key */
-  static const String SOFT_4 = "Soft4";
-
-  /** The Stop key */
-  static const String STOP = "Stop";
-
-  /** The Subtract key */
-  static const String SUBTRACT = "Subtract";
-
-  /** The Symbol Lock key */
-  static const String SYMBOL_LOCK = "SymbolLock";
-
-  /** The Up Arrow key */
-  static const String UP = "Up";
-
-  /** The diagonal Up-Left Arrow key */
-  static const String UP_LEFT = "UpLeft";
-
-  /** The diagonal Up-Right Arrow key */
-  static const String UP_RIGHT = "UpRight";
-
-  /** The Undo key */
-  static const String UNDO = "Undo";
-
-  /** The Volume Down key */
-  static const String VOLUME_DOWN = "VolumeDown";
-
-  /** The Volume Mute key */
-  static const String VOLUMN_MUTE = "VolumeMute";
-
-  /** The Volume Up key */
-  static const String VOLUMN_UP = "VolumeUp";
-
-  /** The Windows Logo key */
-  static const String WIN = "Win";
-
-  /** The Zoom key */
-  static const String ZOOM = "Zoom";
-
-  /**
-   * The Backspace (Back) key. Note: This key value shall be also used for the
-   * key labeled 'delete' MacOS keyboards when not modified by the 'Fn' key
-   */
-  static const String BACKSPACE = "Backspace";
-
-  /** The Horizontal Tabulation (Tab) key */
-  static const String TAB = "Tab";
-
-  /** The Cancel key */
-  static const String CANCEL = "Cancel";
-
-  /** The Escape (Esc) key */
-  static const String ESC = "Esc";
-
-  /** The Space (Spacebar) key:   */
-  static const String SPACEBAR = "Spacebar";
-
-  /**
-   * The Delete (Del) Key. Note: This key value shall be also used for the key
-   * labeled 'delete' MacOS keyboards when modified by the 'Fn' key
-   */
-  static const String DEL = "Del";
-
-  /** The Combining Grave Accent (Greek Varia, Dead Grave) key */
-  static const String DEAD_GRAVE = "DeadGrave";
-
-  /**
-   * The Combining Acute Accent (Stress Mark, Greek Oxia, Tonos, Dead Eacute)
-   * key
-   */
-  static const String DEAD_EACUTE = "DeadEacute";
-
-  /** The Combining Circumflex Accent (Hat, Dead Circumflex) key */
-  static const String DEAD_CIRCUMFLEX = "DeadCircumflex";
-
-  /** The Combining Tilde (Dead Tilde) key */
-  static const String DEAD_TILDE = "DeadTilde";
-
-  /** The Combining Macron (Long, Dead Macron) key */
-  static const String DEAD_MACRON = "DeadMacron";
-
-  /** The Combining Breve (Short, Dead Breve) key */
-  static const String DEAD_BREVE = "DeadBreve";
-
-  /** The Combining Dot Above (Derivative, Dead Above Dot) key */
-  static const String DEAD_ABOVE_DOT = "DeadAboveDot";
-
-  /**
-   * The Combining Diaeresis (Double Dot Abode, Umlaut, Greek Dialytika,
-   * Double Derivative, Dead Diaeresis) key
-   */
-  static const String DEAD_UMLAUT = "DeadUmlaut";
-
-  /** The Combining Ring Above (Dead Above Ring) key */
-  static const String DEAD_ABOVE_RING = "DeadAboveRing";
-
-  /** The Combining Double Acute Accent (Dead Doubleacute) key */
-  static const String DEAD_DOUBLEACUTE = "DeadDoubleacute";
-
-  /** The Combining Caron (Hacek, V Above, Dead Caron) key */
-  static const String DEAD_CARON = "DeadCaron";
-
-  /** The Combining Cedilla (Dead Cedilla) key */
-  static const String DEAD_CEDILLA = "DeadCedilla";
-
-  /** The Combining Ogonek (Nasal Hook, Dead Ogonek) key */
-  static const String DEAD_OGONEK = "DeadOgonek";
-
-  /**
-   * The Combining Greek Ypogegrammeni (Greek Non-Spacing Iota Below, Iota
-   * Subscript, Dead Iota) key
-   */
-  static const String DEAD_IOTA = "DeadIota";
-
-  /**
-   * The Combining Katakana-Hiragana Voiced Sound Mark (Dead Voiced Sound) key
-   */
-  static const String DEAD_VOICED_SOUND = "DeadVoicedSound";
-
-  /**
-   * The Combining Katakana-Hiragana Semi-Voiced Sound Mark (Dead Semivoiced
-   * Sound) key
-   */
-  static const String DEC_SEMIVOICED_SOUND = "DeadSemivoicedSound";
-
-  /**
-   * Key value used when an implementation is unable to identify another key
-   * value, due to either hardware, platform, or software constraints
-   */
-  static const String UNIDENTIFIED = "Unidentified";
-}
-// Copyright (c) 2012, 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.
-
-/**
- * Internal class that does the actual calculations to determine keyCode and
- * charCode for keydown, keypress, and keyup events for all browsers.
- */
-class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
-  // This code inspired by Closure's KeyHandling library.
-  // https://github.com/google/closure-library/blob/master/closure/goog/events/keyhandler.js
-
-  /**
-   * The set of keys that have been pressed down without seeing their
-   * corresponding keyup event.
-   */
-  final List<KeyEvent> _keyDownList = <KeyEvent>[];
-
-  /** The type of KeyEvent we are tracking (keyup, keydown, keypress). */
-  final String _type;
-
-  /** The element we are watching for events to happen on. */
-  final EventTarget? _target;
-
-  // The distance to shift from upper case alphabet Roman letters to lower case.
-  static final int _ROMAN_ALPHABET_OFFSET = "a".codeUnits[0] - "A".codeUnits[0];
-
-  /** Custom Stream (Controller) to produce KeyEvents for the stream. */
-  _CustomKeyEventStreamImpl _stream;
-
-  static const _EVENT_TYPE = 'KeyEvent';
-
-  /**
-   * An enumeration of key identifiers currently part of the W3C draft for DOM3
-   * and their mappings to keyCodes.
-   * https://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/keyset.html#KeySet-Set
-   */
-  static const Map<String, int> _keyIdentifier = const {
-    'Up': KeyCode.UP,
-    'Down': KeyCode.DOWN,
-    'Left': KeyCode.LEFT,
-    'Right': KeyCode.RIGHT,
-    'Enter': KeyCode.ENTER,
-    'F1': KeyCode.F1,
-    'F2': KeyCode.F2,
-    'F3': KeyCode.F3,
-    'F4': KeyCode.F4,
-    'F5': KeyCode.F5,
-    'F6': KeyCode.F6,
-    'F7': KeyCode.F7,
-    'F8': KeyCode.F8,
-    'F9': KeyCode.F9,
-    'F10': KeyCode.F10,
-    'F11': KeyCode.F11,
-    'F12': KeyCode.F12,
-    'U+007F': KeyCode.DELETE,
-    'Home': KeyCode.HOME,
-    'End': KeyCode.END,
-    'PageUp': KeyCode.PAGE_UP,
-    'PageDown': KeyCode.PAGE_DOWN,
-    'Insert': KeyCode.INSERT
-  };
-
-  /** Return a stream for KeyEvents for the specified target. */
-  // Note: this actually functions like a factory constructor.
-  CustomStream<KeyEvent> forTarget(EventTarget? e, {bool useCapture: false}) {
-    var handler =
-        new _KeyboardEventHandler.initializeAllEventListeners(_type, e);
-    return handler._stream;
-  }
-
-  /**
-   * General constructor, performs basic initialization for our improved
-   * KeyboardEvent controller.
-   */
-  _KeyboardEventHandler(this._type)
-      : _stream = new _CustomKeyEventStreamImpl('event'),
-        _target = null,
-        super(_EVENT_TYPE);
-
-  /**
-   * Hook up all event listeners under the covers so we can estimate keycodes
-   * and charcodes when they are not provided.
-   */
-  _KeyboardEventHandler.initializeAllEventListeners(this._type, this._target)
-      : _stream = new _CustomKeyEventStreamImpl(_type),
-        super(_EVENT_TYPE) {
-    Element.keyDownEvent
-        .forTarget(_target, useCapture: true)
-        .listen(processKeyDown);
-    Element.keyPressEvent
-        .forTarget(_target, useCapture: true)
-        .listen(processKeyPress);
-    Element.keyUpEvent
-        .forTarget(_target, useCapture: true)
-        .listen(processKeyUp);
-  }
-
-  /** Determine if caps lock is one of the currently depressed keys. */
-  bool get _capsLockOn =>
-      _keyDownList.any((var element) => element.keyCode == KeyCode.CAPS_LOCK);
-
-  /**
-   * Given the previously recorded keydown key codes, see if we can determine
-   * the keycode of this keypress [event]. (Generally browsers only provide
-   * charCode information for keypress events, but with a little
-   * reverse-engineering, we can also determine the keyCode.) Returns
-   * KeyCode.UNKNOWN if the keycode could not be determined.
-   */
-  int _determineKeyCodeForKeypress(KeyboardEvent event) {
-    // Note: This function is a work in progress. We'll expand this function
-    // once we get more information about other keyboards.
-    for (var prevEvent in _keyDownList) {
-      if (prevEvent._shadowCharCode == event.charCode) {
-        return prevEvent.keyCode;
-      }
-      if ((event.shiftKey || _capsLockOn) &&
-          event.charCode >= "A".codeUnits[0] &&
-          event.charCode <= "Z".codeUnits[0] &&
-          event.charCode + _ROMAN_ALPHABET_OFFSET ==
-              prevEvent._shadowCharCode) {
-        return prevEvent.keyCode;
-      }
-    }
-    return KeyCode.UNKNOWN;
-  }
-
-  /**
-   * Given the character code returned from a keyDown [event], try to ascertain
-   * and return the corresponding charCode for the character that was pressed.
-   * This information is not shown to the user, but used to help polyfill
-   * keypress events.
-   */
-  int _findCharCodeKeyDown(KeyboardEvent event) {
-    if (event.location == 3) {
-      // Numpad keys.
-      switch (event.keyCode) {
-        case KeyCode.NUM_ZERO:
-          // Even though this function returns _charCodes_, for some cases the
-          // KeyCode == the charCode we want, in which case we use the keycode
-          // constant for readability.
-          return KeyCode.ZERO;
-        case KeyCode.NUM_ONE:
-          return KeyCode.ONE;
-        case KeyCode.NUM_TWO:
-          return KeyCode.TWO;
-        case KeyCode.NUM_THREE:
-          return KeyCode.THREE;
-        case KeyCode.NUM_FOUR:
-          return KeyCode.FOUR;
-        case KeyCode.NUM_FIVE:
-          return KeyCode.FIVE;
-        case KeyCode.NUM_SIX:
-          return KeyCode.SIX;
-        case KeyCode.NUM_SEVEN:
-          return KeyCode.SEVEN;
-        case KeyCode.NUM_EIGHT:
-          return KeyCode.EIGHT;
-        case KeyCode.NUM_NINE:
-          return KeyCode.NINE;
-        case KeyCode.NUM_MULTIPLY:
-          return 42; // Char code for *
-        case KeyCode.NUM_PLUS:
-          return 43; // +
-        case KeyCode.NUM_MINUS:
-          return 45; // -
-        case KeyCode.NUM_PERIOD:
-          return 46; // .
-        case KeyCode.NUM_DIVISION:
-          return 47; // /
-      }
-    } else if (event.keyCode >= 65 && event.keyCode <= 90) {
-      // Set the "char code" for key down as the lower case letter. Again, this
-      // will not show up for the user, but will be helpful in estimating
-      // keyCode locations and other information during the keyPress event.
-      return event.keyCode + _ROMAN_ALPHABET_OFFSET;
-    }
-    switch (event.keyCode) {
-      case KeyCode.SEMICOLON:
-        return KeyCode.FF_SEMICOLON;
-      case KeyCode.EQUALS:
-        return KeyCode.FF_EQUALS;
-      case KeyCode.COMMA:
-        return 44; // Ascii value for ,
-      case KeyCode.DASH:
-        return 45; // -
-      case KeyCode.PERIOD:
-        return 46; // .
-      case KeyCode.SLASH:
-        return 47; // /
-      case KeyCode.APOSTROPHE:
-        return 96; // `
-      case KeyCode.OPEN_SQUARE_BRACKET:
-        return 91; // [
-      case KeyCode.BACKSLASH:
-        return 92; // \
-      case KeyCode.CLOSE_SQUARE_BRACKET:
-        return 93; // ]
-      case KeyCode.SINGLE_QUOTE:
-        return 39; // '
-    }
-    return event.keyCode;
-  }
-
-  /**
-   * Returns true if the key fires a keypress event in the current browser.
-   */
-  bool _firesKeyPressEvent(KeyEvent event) {
-    if (!Device.isIE && !Device.isWebKit) {
-      return true;
-    }
-
-    if (Device.userAgent.contains('Mac') && event.altKey) {
-      return KeyCode.isCharacterKey(event.keyCode);
-    }
-
-    // Alt but not AltGr which is represented as Alt+Ctrl.
-    if (event.altKey && !event.ctrlKey) {
-      return false;
-    }
-
-    // Saves Ctrl or Alt + key for IE and WebKit, which won't fire keypress.
-    if (!event.shiftKey &&
-        (_keyDownList.last.keyCode == KeyCode.CTRL ||
-            _keyDownList.last.keyCode == KeyCode.ALT ||
-            Device.userAgent.contains('Mac') &&
-                _keyDownList.last.keyCode == KeyCode.META)) {
-      return false;
-    }
-
-    // Some keys with Ctrl/Shift do not issue keypress in WebKit.
-    if (Device.isWebKit &&
-        event.ctrlKey &&
-        event.shiftKey &&
-        (event.keyCode == KeyCode.BACKSLASH ||
-            event.keyCode == KeyCode.OPEN_SQUARE_BRACKET ||
-            event.keyCode == KeyCode.CLOSE_SQUARE_BRACKET ||
-            event.keyCode == KeyCode.TILDE ||
-            event.keyCode == KeyCode.SEMICOLON ||
-            event.keyCode == KeyCode.DASH ||
-            event.keyCode == KeyCode.EQUALS ||
-            event.keyCode == KeyCode.COMMA ||
-            event.keyCode == KeyCode.PERIOD ||
-            event.keyCode == KeyCode.SLASH ||
-            event.keyCode == KeyCode.APOSTROPHE ||
-            event.keyCode == KeyCode.SINGLE_QUOTE)) {
-      return false;
-    }
-
-    switch (event.keyCode) {
-      case KeyCode.ENTER:
-        // IE9 does not fire keypress on ENTER.
-        return !Device.isIE;
-      case KeyCode.ESC:
-        return !Device.isWebKit;
-    }
-
-    return KeyCode.isCharacterKey(event.keyCode);
-  }
-
-  /**
-   * Normalize the keycodes to the IE KeyCodes (this is what Chrome, IE, and
-   * Opera all use).
-   */
-  int _normalizeKeyCodes(KeyboardEvent event) {
-    // Note: This may change once we get input about non-US keyboards.
-    if (Device.isFirefox) {
-      switch (event.keyCode) {
-        case KeyCode.FF_EQUALS:
-          return KeyCode.EQUALS;
-        case KeyCode.FF_SEMICOLON:
-          return KeyCode.SEMICOLON;
-        case KeyCode.MAC_FF_META:
-          return KeyCode.META;
-        case KeyCode.WIN_KEY_FF_LINUX:
-          return KeyCode.WIN_KEY;
-      }
-    }
-    return event.keyCode;
-  }
-
-  /** Handle keydown events. */
-  void processKeyDown(KeyboardEvent e) {
-    // Ctrl-Tab and Alt-Tab can cause the focus to be moved to another window
-    // before we've caught a key-up event.  If the last-key was one of these
-    // we reset the state.
-    if (_keyDownList.length > 0 &&
-        (_keyDownList.last.keyCode == KeyCode.CTRL && !e.ctrlKey ||
-            _keyDownList.last.keyCode == KeyCode.ALT && !e.altKey ||
-            Device.userAgent.contains('Mac') &&
-                _keyDownList.last.keyCode == KeyCode.META &&
-                !e.metaKey)) {
-      _keyDownList.clear();
-    }
-
-    var event = new KeyEvent.wrap(e);
-    event._shadowKeyCode = _normalizeKeyCodes(event);
-    // Technically a "keydown" event doesn't have a charCode. This is
-    // calculated nonetheless to provide us with more information in giving
-    // as much information as possible on keypress about keycode and also
-    // charCode.
-    event._shadowCharCode = _findCharCodeKeyDown(event);
-    if (_keyDownList.length > 0 &&
-        event.keyCode != _keyDownList.last.keyCode &&
-        !_firesKeyPressEvent(event)) {
-      // Some browsers have quirks not firing keypress events where all other
-      // browsers do. This makes them more consistent.
-      processKeyPress(e);
-    }
-    _keyDownList.add(event);
-    _stream.add(event);
-  }
-
-  /** Handle keypress events. */
-  void processKeyPress(KeyboardEvent event) {
-    var e = new KeyEvent.wrap(event);
-    // IE reports the character code in the keyCode field for keypress events.
-    // There are two exceptions however, Enter and Escape.
-    if (Device.isIE) {
-      if (e.keyCode == KeyCode.ENTER || e.keyCode == KeyCode.ESC) {
-        e._shadowCharCode = 0;
-      } else {
-        e._shadowCharCode = e.keyCode;
-      }
-    } else if (Device.isOpera) {
-      // Opera reports the character code in the keyCode field.
-      e._shadowCharCode = KeyCode.isCharacterKey(e.keyCode) ? e.keyCode : 0;
-    }
-    // Now we guesstimate about what the keycode is that was actually
-    // pressed, given previous keydown information.
-    e._shadowKeyCode = _determineKeyCodeForKeypress(e);
-
-    // Correct the key value for certain browser-specific quirks.
-    if (e._shadowKeyIdentifier != null &&
-        _keyIdentifier.containsKey(e._shadowKeyIdentifier)) {
-      // This is needed for Safari Windows because it currently doesn't give a
-      // keyCode/which for non printable keys.
-      e._shadowKeyCode = _keyIdentifier[e._shadowKeyIdentifier]!;
-    }
-    e._shadowAltKey = _keyDownList.any((var element) => element.altKey);
-    _stream.add(e);
-  }
-
-  /** Handle keyup events. */
-  void processKeyUp(KeyboardEvent event) {
-    var e = new KeyEvent.wrap(event);
-    KeyboardEvent? toRemove = null;
-    for (var key in _keyDownList) {
-      if (key.keyCode == e.keyCode) {
-        toRemove = key;
-      }
-    }
-    if (toRemove != null) {
-      _keyDownList.removeWhere((element) => element == toRemove);
-    } else if (_keyDownList.length > 0) {
-      // This happens when we've reached some international keyboard case we
-      // haven't accounted for or we haven't correctly eliminated all browser
-      // inconsistencies. Filing bugs on when this is reached is welcome!
-      _keyDownList.removeLast();
-    }
-    _stream.add(e);
-  }
-}
-
-/**
- * Records KeyboardEvents that occur on a particular element, and provides a
- * stream of outgoing KeyEvents with cross-browser consistent keyCode and
- * charCode values despite the fact that a multitude of browsers that have
- * varying keyboard default behavior.
- *
- * Example usage:
- *
- *     KeyboardEventStream.onKeyDown(document.body).listen(
- *         keydownHandlerTest);
- *
- * This class is very much a work in progress, and we'd love to get information
- * on how we can make this class work with as many international keyboards as
- * possible. Bugs welcome!
- */
-class KeyboardEventStream {
-  /** Named constructor to produce a stream for onKeyPress events. */
-  static CustomStream<KeyEvent> onKeyPress(EventTarget target) =>
-      new _KeyboardEventHandler('keypress').forTarget(target);
-
-  /** Named constructor to produce a stream for onKeyUp events. */
-  static CustomStream<KeyEvent> onKeyUp(EventTarget target) =>
-      new _KeyboardEventHandler('keyup').forTarget(target);
-
-  /** Named constructor to produce a stream for onKeyDown events. */
-  static CustomStream<KeyEvent> onKeyDown(EventTarget target) =>
-      new _KeyboardEventHandler('keydown').forTarget(target);
-}
-// Copyright (c) 2013, 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.
-
-/**
- * Class which helps construct standard node validation policies.
- *
- * By default this will not accept anything, but the 'allow*' functions can be
- * used to expand what types of elements or attributes are allowed.
- *
- * All allow functions are additive- elements will be accepted if they are
- * accepted by any specific rule.
- *
- * It is important to remember that sanitization is not just intended to prevent
- * cross-site scripting attacks, but also to prevent information from being
- * displayed in unexpected ways. For example something displaying basic
- * formatted text may not expect `<video>` tags to appear. In this case an
- * empty NodeValidatorBuilder with just [allowTextElements] might be
- * appropriate.
- */
-class NodeValidatorBuilder implements NodeValidator {
-  final List<NodeValidator> _validators = <NodeValidator>[];
-
-  NodeValidatorBuilder() {}
-
-  /**
-   * Creates a new NodeValidatorBuilder which accepts common constructs.
-   *
-   * By default this will accept HTML5 elements and attributes with the default
-   * [UriPolicy] and templating elements.
-   *
-   * Notable syntax which is filtered:
-   *
-   * * Only known-good HTML5 elements and attributes are allowed.
-   * * All URLs must be same-origin, use [allowNavigation] and [allowImages] to
-   * specify additional URI policies.
-   * * Inline-styles are not allowed.
-   * * Custom element tags are disallowed, use [allowCustomElement].
-   * * Custom tags extensions are disallowed, use [allowTagExtension].
-   * * SVG Elements are not allowed, use [allowSvg].
-   *
-   * For scenarios where the HTML should only contain formatted text
-   * [allowTextElements] is more appropriate.
-   *
-   * Use [allowSvg] to allow SVG elements.
-   */
-  NodeValidatorBuilder.common() {
-    allowHtml5();
-    allowTemplating();
-  }
-
-  /**
-   * Allows navigation elements- Form and Anchor tags, along with common
-   * attributes.
-   *
-   * The UriPolicy can be used to restrict the locations the navigation elements
-   * are allowed to direct to. By default this will use the default [UriPolicy].
-   */
-  void allowNavigation([UriPolicy? uriPolicy]) {
-    if (uriPolicy == null) {
-      uriPolicy = new UriPolicy();
-    }
-    add(new _SimpleNodeValidator.allowNavigation(uriPolicy));
-  }
-
-  /**
-   * Allows image elements.
-   *
-   * The UriPolicy can be used to restrict the locations the images may be
-   * loaded from. By default this will use the default [UriPolicy].
-   */
-  void allowImages([UriPolicy? uriPolicy]) {
-    if (uriPolicy == null) {
-      uriPolicy = new UriPolicy();
-    }
-    add(new _SimpleNodeValidator.allowImages(uriPolicy));
-  }
-
-  /**
-   * Allow basic text elements.
-   *
-   * This allows a subset of HTML5 elements, specifically just these tags and
-   * no attributes.
-   *
-   * * B
-   * * BLOCKQUOTE
-   * * BR
-   * * EM
-   * * H1
-   * * H2
-   * * H3
-   * * H4
-   * * H5
-   * * H6
-   * * HR
-   * * I
-   * * LI
-   * * OL
-   * * P
-   * * SPAN
-   * * UL
-   */
-  void allowTextElements() {
-    add(new _SimpleNodeValidator.allowTextElements());
-  }
-
-  /**
-   * Allow inline styles on elements.
-   *
-   * If [tagName] is not specified then this allows inline styles on all
-   * elements. Otherwise tagName limits the styles to the specified elements.
-   */
-  void allowInlineStyles({String? tagName}) {
-    if (tagName == null) {
-      tagName = '*';
-    } else {
-      tagName = tagName.toUpperCase();
-    }
-    add(new _SimpleNodeValidator(null, allowedAttributes: ['$tagName::style']));
-  }
-
-  /**
-   * Allow common safe HTML5 elements and attributes.
-   *
-   * This list is based off of the Caja whitelists at:
-   * https://code.google.com/p/google-caja/wiki/CajaWhitelists.
-   *
-   * Common things which are not allowed are script elements, style attributes
-   * and any script handlers.
-   */
-  void allowHtml5({UriPolicy? uriPolicy}) {
-    add(new _Html5NodeValidator(uriPolicy: uriPolicy));
-  }
-
-  /**
-   * Allow SVG elements and attributes except for known bad ones.
-   */
-  void allowSvg() {
-    add(new _SvgNodeValidator());
-  }
-
-  /**
-   * Allow custom elements with the specified tag name and specified attributes.
-   *
-   * This will allow the elements as custom tags (such as <x-foo></x-foo>),
-   * but will not allow tag extensions. Use [allowTagExtension] to allow
-   * tag extensions.
-   */
-  void allowCustomElement(String tagName,
-      {UriPolicy? uriPolicy,
-      Iterable<String>? attributes,
-      Iterable<String>? uriAttributes}) {
-    var tagNameUpper = tagName.toUpperCase();
-    var attrs = attributes
-        ?.map<String>((name) => '$tagNameUpper::${name.toLowerCase()}');
-    var uriAttrs = uriAttributes
-        ?.map<String>((name) => '$tagNameUpper::${name.toLowerCase()}');
-    if (uriPolicy == null) {
-      uriPolicy = new UriPolicy();
-    }
-
-    add(new _CustomElementNodeValidator(
-        uriPolicy, [tagNameUpper], attrs, uriAttrs, false, true));
-  }
-
-  /**
-   * Allow custom tag extensions with the specified type name and specified
-   * attributes.
-   *
-   * This will allow tag extensions (such as <div is="x-foo"></div>),
-   * but will not allow custom tags. Use [allowCustomElement] to allow
-   * custom tags.
-   */
-  void allowTagExtension(String tagName, String baseName,
-      {UriPolicy? uriPolicy,
-      Iterable<String>? attributes,
-      Iterable<String>? uriAttributes}) {
-    var baseNameUpper = baseName.toUpperCase();
-    var tagNameUpper = tagName.toUpperCase();
-    var attrs = attributes
-        ?.map<String>((name) => '$baseNameUpper::${name.toLowerCase()}');
-    var uriAttrs = uriAttributes
-        ?.map<String>((name) => '$baseNameUpper::${name.toLowerCase()}');
-    if (uriPolicy == null) {
-      uriPolicy = new UriPolicy();
-    }
-
-    add(new _CustomElementNodeValidator(uriPolicy,
-        [tagNameUpper, baseNameUpper], attrs, uriAttrs, true, false));
-  }
-
-  void allowElement(String tagName,
-      {UriPolicy? uriPolicy,
-      Iterable<String>? attributes,
-      Iterable<String>? uriAttributes}) {
-    allowCustomElement(tagName,
-        uriPolicy: uriPolicy,
-        attributes: attributes,
-        uriAttributes: uriAttributes);
-  }
-
-  /**
-   * Allow templating elements (such as <template> and template-related
-   * attributes.
-   *
-   * This still requires other validators to allow regular attributes to be
-   * bound (such as [allowHtml5]).
-   */
-  void allowTemplating() {
-    add(new _TemplatingNodeValidator());
-  }
-
-  /**
-   * Add an additional validator to the current list of validators.
-   *
-   * Elements and attributes will be accepted if they are accepted by any
-   * validators.
-   */
-  void add(NodeValidator validator) {
-    _validators.add(validator);
-  }
-
-  bool allowsElement(Element element) {
-    return _validators.any((v) => v.allowsElement(element));
-  }
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    return _validators
-        .any((v) => v.allowsAttribute(element, attributeName, value));
-  }
-}
-
-class _SimpleNodeValidator implements NodeValidator {
-  final Set<String> allowedElements = new Set<String>();
-  final Set<String> allowedAttributes = new Set<String>();
-  final Set<String> allowedUriAttributes = new Set<String>();
-  final UriPolicy? uriPolicy;
-
-  factory _SimpleNodeValidator.allowNavigation(UriPolicy uriPolicy) {
-    return new _SimpleNodeValidator(uriPolicy, allowedElements: const [
-      'A',
-      'FORM'
-    ], allowedAttributes: const [
-      'A::accesskey',
-      'A::coords',
-      'A::hreflang',
-      'A::name',
-      'A::shape',
-      'A::tabindex',
-      'A::target',
-      'A::type',
-      'FORM::accept',
-      'FORM::autocomplete',
-      'FORM::enctype',
-      'FORM::method',
-      'FORM::name',
-      'FORM::novalidate',
-      'FORM::target',
-    ], allowedUriAttributes: const [
-      'A::href',
-      'FORM::action',
-    ]);
-  }
-
-  factory _SimpleNodeValidator.allowImages(UriPolicy uriPolicy) {
-    return new _SimpleNodeValidator(uriPolicy, allowedElements: const [
-      'IMG'
-    ], allowedAttributes: const [
-      'IMG::align',
-      'IMG::alt',
-      'IMG::border',
-      'IMG::height',
-      'IMG::hspace',
-      'IMG::ismap',
-      'IMG::name',
-      'IMG::usemap',
-      'IMG::vspace',
-      'IMG::width',
-    ], allowedUriAttributes: const [
-      'IMG::src',
-    ]);
-  }
-
-  factory _SimpleNodeValidator.allowTextElements() {
-    return new _SimpleNodeValidator(null, allowedElements: const [
-      'B',
-      'BLOCKQUOTE',
-      'BR',
-      'EM',
-      'H1',
-      'H2',
-      'H3',
-      'H4',
-      'H5',
-      'H6',
-      'HR',
-      'I',
-      'LI',
-      'OL',
-      'P',
-      'SPAN',
-      'UL',
-    ]);
-  }
-
-  /**
-   * Elements must be uppercased tag names. For example `'IMG'`.
-   * Attributes must be uppercased tag name followed by :: followed by
-   * lowercase attribute name. For example `'IMG:src'`.
-   */
-  _SimpleNodeValidator(this.uriPolicy,
-      {Iterable<String>? allowedElements,
-      Iterable<String>? allowedAttributes,
-      Iterable<String>? allowedUriAttributes}) {
-    this.allowedElements.addAll(allowedElements ?? const []);
-    allowedAttributes = allowedAttributes ?? const [];
-    allowedUriAttributes = allowedUriAttributes ?? const [];
-    var legalAttributes = allowedAttributes
-        .where((x) => !_Html5NodeValidator._uriAttributes.contains(x));
-    var extraUriAttributes = allowedAttributes
-        .where((x) => _Html5NodeValidator._uriAttributes.contains(x));
-    this.allowedAttributes.addAll(legalAttributes);
-    this.allowedUriAttributes.addAll(allowedUriAttributes);
-    this.allowedUriAttributes.addAll(extraUriAttributes);
-  }
-
-  bool allowsElement(Element element) {
-    return allowedElements.contains(Element._safeTagName(element));
-  }
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = Element._safeTagName(element);
-    if (allowedUriAttributes.contains('$tagName::$attributeName')) {
-      return uriPolicy!.allowsUri(value);
-    } else if (allowedUriAttributes.contains('*::$attributeName')) {
-      return uriPolicy!.allowsUri(value);
-    } else if (allowedAttributes.contains('$tagName::$attributeName')) {
-      return true;
-    } else if (allowedAttributes.contains('*::$attributeName')) {
-      return true;
-    } else if (allowedAttributes.contains('$tagName::*')) {
-      return true;
-    } else if (allowedAttributes.contains('*::*')) {
-      return true;
-    }
-    return false;
-  }
-}
-
-class _CustomElementNodeValidator extends _SimpleNodeValidator {
-  final bool allowTypeExtension;
-  final bool allowCustomTag;
-
-  _CustomElementNodeValidator(
-      UriPolicy uriPolicy,
-      Iterable<String> allowedElements,
-      Iterable<String>? allowedAttributes,
-      Iterable<String>? allowedUriAttributes,
-      bool allowTypeExtension,
-      bool allowCustomTag)
-      : this.allowTypeExtension = allowTypeExtension == true,
-        this.allowCustomTag = allowCustomTag == true,
-        super(uriPolicy,
-            allowedElements: allowedElements,
-            allowedAttributes: allowedAttributes,
-            allowedUriAttributes: allowedUriAttributes);
-
-  bool allowsElement(Element element) {
-    if (allowTypeExtension) {
-      var isAttr = element.attributes['is'];
-      if (isAttr != null) {
-        return allowedElements.contains(isAttr.toUpperCase()) &&
-            allowedElements.contains(Element._safeTagName(element));
-      }
-    }
-    return allowCustomTag &&
-        allowedElements.contains(Element._safeTagName(element));
-  }
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    if (allowsElement(element)) {
-      if (allowTypeExtension &&
-          attributeName == 'is' &&
-          allowedElements.contains(value.toUpperCase())) {
-        return true;
-      }
-      return super.allowsAttribute(element, attributeName, value);
-    }
-    return false;
-  }
-}
-
-class _TemplatingNodeValidator extends _SimpleNodeValidator {
-  static const _TEMPLATE_ATTRS = const <String>[
-    'bind',
-    'if',
-    'ref',
-    'repeat',
-    'syntax'
-  ];
-
-  final Set<String> _templateAttrs;
-
-  _TemplatingNodeValidator()
-      : _templateAttrs = new Set<String>.from(_TEMPLATE_ATTRS),
-        super(null,
-            allowedElements: ['TEMPLATE'],
-            allowedAttributes:
-                _TEMPLATE_ATTRS.map((attr) => 'TEMPLATE::$attr')) {}
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    if (super.allowsAttribute(element, attributeName, value)) {
-      return true;
-    }
-
-    if (attributeName == 'template' && value == "") {
-      return true;
-    }
-
-    if (element.attributes['template'] == "") {
-      return _templateAttrs.contains(attributeName);
-    }
-    return false;
-  }
-}
-
-class _SvgNodeValidator implements NodeValidator {
-  bool allowsElement(Element element) {
-    if (element is svg.ScriptElement) {
-      return false;
-    }
-    // Firefox 37 has issues with creating foreign elements inside a
-    // foreignobject tag as SvgElement. We don't want foreignobject contents
-    // anyway, so just remove the whole tree outright. And we can't rely
-    // on IE recognizing the SvgForeignObject type, so go by tagName. Bug 23144
-    if (element is svg.SvgElement &&
-        Element._safeTagName(element) == 'foreignObject') {
-      return false;
-    }
-    if (element is svg.SvgElement) {
-      return true;
-    }
-    return false;
-  }
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    if (attributeName == 'is' || attributeName.startsWith('on')) {
-      return false;
-    }
-    return allowsElement(element);
-  }
-}
-// Copyright (c) 2011, 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.
-
-/**
- * Contains the set of standard values returned by HTMLDocument.getReadyState.
- */
-abstract class ReadyState {
-  /**
-   * Indicates the document is still loading and parsing.
-   */
-  static const String LOADING = "loading";
-
-  /**
-   * Indicates the document is finished parsing but is still loading
-   * subresources.
-   */
-  static const String INTERACTIVE = "interactive";
-
-  /**
-   * Indicates the document and all subresources have been loaded.
-   */
-  static const String COMPLETE = "complete";
-}
-// Copyright (c) 2013, 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.
-
-/**
- * A list which just wraps another list, for either intercepting list calls or
- * retyping the list (for example, from List<A> to List<B> where B extends A).
- */
-class _WrappedList<E extends Node> extends ListBase<E>
-    implements NodeListWrapper {
-  final List<Node> _list;
-
-  _WrappedList(this._list);
-
-  // Iterable APIs
-
-  Iterator<E> get iterator => new _WrappedIterator<E>(_list.iterator);
-
-  int get length => _list.length;
-
-  // Collection APIs
-
-  void add(E element) {
-    _list.add(element);
-  }
-
-  bool remove(Object? element) => _list.remove(element);
-
-  void clear() {
-    _list.clear();
-  }
-
-  // List APIs
-
-  E operator [](int index) => _list[index] as E;
-
-  void operator []=(int index, E value) {
-    _list[index] = value;
-  }
-
-  set length(int newLength) {
-    _list.length = newLength;
-  }
-
-  void sort([int compare(E a, E b)?]) {
-    if (compare == null) {
-      _list.sort();
-    } else {
-      _list.sort((Node a, Node b) => compare(a as E, b as E));
-    }
-  }
-
-  int indexOf(Object? element, [int start = 0]) =>
-      _list.indexOf(element as Node, start);
-
-  int lastIndexOf(Object? element, [int? start]) =>
-      _list.lastIndexOf(element as Node, start);
-
-  void insert(int index, E element) => _list.insert(index, element);
-
-  E removeAt(int index) => _list.removeAt(index) as E;
-
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    _list.setRange(start, end, iterable, skipCount);
-  }
-
-  void removeRange(int start, int end) {
-    _list.removeRange(start, end);
-  }
-
-  void replaceRange(int start, int end, Iterable<E> iterable) {
-    _list.replaceRange(start, end, iterable);
-  }
-
-  void fillRange(int start, int end, [E? fillValue]) {
-    _list.fillRange(start, end, fillValue);
-  }
-
-  List<Node> get rawList => _list;
-}
-
-/**
- * Iterator wrapper for _WrappedList.
- */
-class _WrappedIterator<E extends Node> implements Iterator<E> {
-  Iterator<Node> _iterator;
-
-  _WrappedIterator(this._iterator);
-
-  bool moveNext() {
-    return _iterator.moveNext();
-  }
-
-  E get current => _iterator.current as E;
-}
-// Copyright (c) 2012, 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.
-
-class _HttpRequestUtils {
-  // Helper for factory HttpRequest.get
-  static HttpRequest get(
-      String url, onComplete(HttpRequest request), bool withCredentials) {
-    final request = new HttpRequest();
-    request.open('GET', url, async: true);
-
-    request.withCredentials = withCredentials;
-
-    request.onReadyStateChange.listen((e) {
-      if (request.readyState == HttpRequest.DONE) {
-        onComplete(request);
-      }
-    });
-
-    request.send();
-
-    return request;
-  }
-}
-// Copyright (c) 2011, 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.
-
-// Iterator for arrays with fixed size.
-class FixedSizeListIterator<T> implements Iterator<T> {
-  final List<T> _array;
-  final int _length; // Cache array length for faster access.
-  int _position;
-  T? _current;
-
-  FixedSizeListIterator(List<T> array)
-      : _array = array,
-        _position = -1,
-        _length = array.length;
-
-  bool moveNext() {
-    int nextPosition = _position + 1;
-    if (nextPosition < _length) {
-      _current = _array[nextPosition];
-      _position = nextPosition;
-      return true;
-    }
-    _current = null;
-    _position = _length;
-    return false;
-  }
-
-  T get current => _current as T;
-}
-
-// Iterator for arrays with variable size.
-class _VariableSizeListIterator<T> implements Iterator<T> {
-  final List<T> _array;
-  int _position;
-  T? _current;
-
-  _VariableSizeListIterator(List<T> array)
-      : _array = array,
-        _position = -1;
-
-  bool moveNext() {
-    int nextPosition = _position + 1;
-    if (nextPosition < _array.length) {
-      _current = _array[nextPosition];
-      _position = nextPosition;
-      return true;
-    }
-    _current = null;
-    _position = _array.length;
-    return false;
-  }
-
-  T get current => _current as T;
-}
-// Copyright (c) 2017, 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.
-
-class Console {
-  const Console._safe();
-  static const Console _safeConsole = const Console._safe();
-
-  bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"');
-
-  MemoryInfo? get memory =>
-      _isConsoleDefined ? JS('MemoryInfo', 'window.console.memory') : null;
-
-  void assertCondition(bool condition, Object arg) => _isConsoleDefined
-      ? JS('void', 'window.console.assertCondition(#, #)', condition, arg)
-      : null;
-
-  void clear(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.clear(#)', arg) : null;
-
-  void count(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.count(#)', arg) : null;
-
-  void debug(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.debug(#)', arg) : null;
-
-  void dir(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.dir(#)', arg) : null;
-
-  void dirxml(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.dirxml(#)', arg) : null;
-
-  void error(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.error(#)', arg) : null;
-
-  void group(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.group(#)', arg) : null;
-
-  void groupCollapsed(Object arg) => _isConsoleDefined
-      ? JS('void', 'window.console.groupCollapsed(#)', arg)
-      : null;
-
-  void groupEnd() =>
-      _isConsoleDefined ? JS('void', 'window.console.groupEnd()') : null;
-
-  void info(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.info(#)', arg) : null;
-
-  void log(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.log(#)', arg) : null;
-
-  void markTimeline(Object arg) => _isConsoleDefined
-      ? JS('void', 'window.console.markTimeline(#)', arg)
-      : null;
-
-  void profile(String title) =>
-      _isConsoleDefined ? JS('void', 'window.console.profile(#)', title) : null;
-
-  void profileEnd(String title) => _isConsoleDefined
-      ? JS('void', 'window.console.profileEnd(#)', title)
-      : null;
-
-  void table(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.table(#)', arg) : null;
-
-  void time(String title) =>
-      _isConsoleDefined ? JS('void', 'window.console.time(#)', title) : null;
-
-  void timeEnd(String title) =>
-      _isConsoleDefined ? JS('void', 'window.console.timeEnd(#)', title) : null;
-
-  void timeStamp(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.timeStamp(#)', arg) : null;
-
-  void trace(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.trace(#)', arg) : null;
-
-  void warn(Object arg) =>
-      _isConsoleDefined ? JS('void', 'window.console.warn(#)', arg) : null;
-}
-// Copyright (c) 2012, 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.
-
-// Conversions for Window.  These check if the window is the local
-// window, and if it's not, wraps or unwraps it with a secure wrapper.
-// We need to test for EventTarget here as well as it's a base type.
-// We omit an unwrapper for Window as no methods take a non-local
-// window as a parameter.
-
-WindowBase? _convertNativeToDart_Window(win) {
-  if (win == null) return null;
-  return _DOMWindowCrossFrame._createSafe(win);
-}
-
-EventTarget? _convertNativeToDart_EventTarget(e) {
-  if (e == null) {
-    return null;
-  }
-  // Assume it's a Window if it contains the postMessage property.  It may be
-  // from a different frame - without a patched prototype - so we cannot
-  // rely on Dart type checking.
-  if (JS('bool', r'"postMessage" in #', e)) {
-    var window = _DOMWindowCrossFrame._createSafe(e);
-    // If it's a native window.
-    if (window is EventTarget) {
-      return window;
-    }
-    return null;
-  } else
-    return e;
-}
-
-EventTarget? _convertDartToNative_EventTarget(e) {
-  if (e is _DOMWindowCrossFrame) {
-    return e._window;
-  } else {
-    return e;
-  }
-}
-
-_convertNativeToDart_XHR_Response(o) {
-  if (o is Document) {
-    return o;
-  }
-  return convertNativeToDart_SerializedScriptValue(o);
-}
-// Copyright (c) 2013, 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.
-
-_callConstructor(constructor, interceptor) {
-  return (receiver) {
-    setNativeSubclassDispatchRecord(receiver, interceptor);
-
-    // Mirrors uses the constructor property to cache lookups, so we need it to
-    // be set correctly, including on IE where it is not automatically picked
-    // up from the __proto__.
-    JS('', '#.constructor = #.__proto__.constructor', receiver, receiver);
-    return JS('', '#(#)', constructor, receiver);
-  };
-}
-
-_callAttached(receiver) {
-  return receiver.attached();
-}
-
-_callDetached(receiver) {
-  return receiver.detached();
-}
-
-_callAttributeChanged(receiver, name, oldValue, newValue) {
-  return receiver.attributeChanged(name, oldValue, newValue);
-}
-
-_makeCallbackMethod(callback) {
-  return JS(
-      '',
-      '''((function(invokeCallback) {
-             return function() {
-               return invokeCallback(this);
-             };
-          })(#))''',
-      convertDartClosureToJS(callback, 1));
-}
-
-_makeCallbackMethod3(callback) {
-  return JS(
-      '',
-      '''((function(invokeCallback) {
-             return function(arg1, arg2, arg3) {
-               return invokeCallback(this, arg1, arg2, arg3);
-             };
-          })(#))''',
-      convertDartClosureToJS(callback, 4));
-}
-
-/// Checks whether the given [element] correctly extends from the native class
-/// with the given [baseClassName]. This method will throw if the base class
-/// doesn't match, except when the element extends from `template` and it's base
-/// class is `HTMLUnknownElement`. This exclusion is needed to support extension
-/// of template elements (used heavily in Polymer 1.0) on IE11 when using the
-/// webcomponents-lite.js polyfill.
-void _checkExtendsNativeClassOrTemplate(
-    Element element, String extendsTag, String baseClassName) {
-  if (!JS('bool', '(# instanceof window[#])', element, baseClassName) &&
-      !((extendsTag == 'template' &&
-          JS('bool', '(# instanceof window["HTMLUnknownElement"])',
-              element)))) {
-    throw new UnsupportedError('extendsTag does not match base native class');
-  }
-}
-
-Function _registerCustomElement(context, document, String tag, [Map? options]) {
-  // Function follows the same pattern as the following JavaScript code for
-  // registering a custom element.
-  //
-  //    var proto = Object.create(HTMLElement.prototype, {
-  //        createdCallback: {
-  //          value: function() {
-  //            window.console.log('here');
-  //          }
-  //        }
-  //    });
-  //    document.registerElement('x-foo', { prototype: proto });
-  //    ...
-  //    var e = document.createElement('x-foo');
-
-  var extendsTagName = '';
-  Type? type;
-  if (options != null) {
-    extendsTagName = options['extends'];
-    type = options['prototype'];
-  }
-
-  var interceptorClass = findInterceptorConstructorForType(type);
-  if (interceptorClass == null) {
-    throw new ArgumentError(type);
-  }
-
-  var interceptor = JS('=Object', '#.prototype', interceptorClass);
-
-  var constructor = findConstructorForNativeSubclassType(type, 'created');
-  if (constructor == null) {
-    throw new ArgumentError("$type has no constructor called 'created'");
-  }
-
-  // Workaround for 13190- use an article element to ensure that HTMLElement's
-  // interceptor is resolved correctly.
-  getNativeInterceptor(new Element.tag('article'));
-
-  String baseClassName = findDispatchTagForInterceptorClass(interceptorClass);
-  if (baseClassName == null) {
-    throw new ArgumentError(type);
-  }
-
-  if (extendsTagName == null) {
-    if (baseClassName != 'HTMLElement') {
-      throw new UnsupportedError('Class must provide extendsTag if base '
-          'native class is not HtmlElement');
-    }
-  } else {
-    var element = document.createElement(extendsTagName);
-    _checkExtendsNativeClassOrTemplate(element, extendsTagName, baseClassName);
-  }
-
-  var baseConstructor = JS('=Object', '#[#]', context, baseClassName);
-
-  var properties = JS('=Object', '{}');
-
-  JS(
-      'void',
-      '#.createdCallback = #',
-      properties,
-      JS('=Object', '{value: #}',
-          _makeCallbackMethod(_callConstructor(constructor, interceptor))));
-  JS('void', '#.attachedCallback = #', properties,
-      JS('=Object', '{value: #}', _makeCallbackMethod(_callAttached)));
-  JS('void', '#.detachedCallback = #', properties,
-      JS('=Object', '{value: #}', _makeCallbackMethod(_callDetached)));
-  JS('void', '#.attributeChangedCallback = #', properties,
-      JS('=Object', '{value: #}', _makeCallbackMethod3(_callAttributeChanged)));
-
-  var baseProto = JS('=Object', '#.prototype', baseConstructor);
-  var proto = JS('=Object', 'Object.create(#, #)', baseProto, properties);
-
-  setNativeSubclassDispatchRecord(proto, interceptor);
-
-  var opts = JS('=Object', '{prototype: #}', proto);
-
-  if (extendsTagName != null) {
-    JS('=Object', '#.extends = #', opts, extendsTagName);
-  }
-
-  return JS(
-      'JavaScriptFunction', '#.registerElement(#, #)', document, tag, opts);
-}
-
-//// Called by Element.created to do validation & initialization.
-void _initializeCustomElement(Element e) {
-  // TODO(blois): Add validation that this is only in response to an upgrade.
-}
-
-/// Dart2JS implementation of ElementUpgrader
-class _JSElementUpgrader implements ElementUpgrader {
-  var _interceptor;
-  var _constructor;
-  var _nativeType;
-
-  _JSElementUpgrader(Document document, Type type, String? extendsTag) {
-    var interceptorClass = findInterceptorConstructorForType(type);
-    if (interceptorClass == null) {
-      throw new ArgumentError(type);
-    }
-
-    _constructor = findConstructorForNativeSubclassType(type, 'created');
-    if (_constructor == null) {
-      throw new ArgumentError("$type has no constructor called 'created'");
-    }
-
-    // Workaround for 13190- use an article element to ensure that HTMLElement's
-    // interceptor is resolved correctly.
-    getNativeInterceptor(new Element.tag('article'));
-
-    var baseClassName = findDispatchTagForInterceptorClass(interceptorClass);
-    if (baseClassName == null) {
-      throw new ArgumentError(type);
-    }
-
-    if (extendsTag == null) {
-      if (baseClassName != 'HTMLElement') {
-        throw new UnsupportedError('Class must provide extendsTag if base '
-            'native class is not HtmlElement');
-      }
-      _nativeType = HtmlElement;
-    } else {
-      var element = document.createElement(extendsTag);
-      _checkExtendsNativeClassOrTemplate(element, extendsTag, baseClassName);
-      _nativeType = element.runtimeType;
-    }
-
-    _interceptor = JS('=Object', '#.prototype', interceptorClass);
-  }
-
-  Element upgrade(Element element) {
-    // Only exact type matches are supported- cannot be a subclass.
-    if (element.runtimeType != _nativeType) {
-      // Some browsers may represent non-upgraded elements <x-foo> as
-      // UnknownElement and not a plain HtmlElement.
-      if (_nativeType != HtmlElement || element.runtimeType != UnknownElement) {
-        throw new ArgumentError('element is not subclass of $_nativeType');
-      }
-    }
-
-    setNativeSubclassDispatchRecord(element, _interceptor);
-    JS('', '#(#)', _constructor, element);
-    return element;
-  }
-}
-// Copyright (c) 2012, 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.
-
-// TODO(vsm): Unify with Dartium version.
-class _DOMWindowCrossFrame implements WindowBase {
-  // Private window.  Note, this is a window in another frame, so it
-  // cannot be typed as "Window" as its prototype is not patched
-  // properly.  Its fields and methods can only be accessed via JavaScript.
-  final _window;
-
-  // Fields.
-  HistoryBase get history =>
-      _HistoryCrossFrame._createSafe(JS('HistoryBase', '#.history', _window));
-  LocationBase get location => _LocationCrossFrame._createSafe(
-      JS('LocationBase', '#.location', _window));
-
-  // TODO(vsm): Add frames to navigate subframes.  See 2312.
-
-  bool get closed => JS('bool', '#.closed', _window);
-
-  WindowBase get opener => _createSafe(JS('WindowBase', '#.opener', _window));
-
-  WindowBase get parent => _createSafe(JS('WindowBase', '#.parent', _window));
-
-  WindowBase get top => _createSafe(JS('WindowBase', '#.top', _window));
-
-  // Methods.
-  void close() => JS('void', '#.close()', _window);
-
-  void postMessage(var message, String targetOrigin, [List? messagePorts]) {
-    if (messagePorts == null) {
-      JS('void', '#.postMessage(#,#)', _window,
-          convertDartToNative_SerializedScriptValue(message), targetOrigin);
-    } else {
-      JS(
-          'void',
-          '#.postMessage(#,#,#)',
-          _window,
-          convertDartToNative_SerializedScriptValue(message),
-          targetOrigin,
-          messagePorts);
-    }
-  }
-
-  // Implementation support.
-  _DOMWindowCrossFrame(this._window);
-
-  static WindowBase _createSafe(w) {
-    if (identical(w, window)) {
-      return w;
-    } else {
-      // TODO(vsm): Cache or implement equality.
-      registerGlobalObject(w);
-      return new _DOMWindowCrossFrame(w);
-    }
-  }
-
-  // TODO(efortuna): Remove this method. dartbug.com/16814
-  Events get on => throw new UnsupportedError(
-      'You can only attach EventListeners to your own window.');
-  // TODO(efortuna): Remove this method. dartbug.com/16814
-  void _addEventListener(String? type, EventListener? listener,
-          [bool? useCapture]) =>
-      throw new UnsupportedError(
-          'You can only attach EventListeners to your own window.');
-  // TODO(efortuna): Remove this method. dartbug.com/16814
-  void addEventListener(String type, EventListener? listener,
-          [bool? useCapture]) =>
-      throw new UnsupportedError(
-          'You can only attach EventListeners to your own window.');
-  // TODO(efortuna): Remove this method. dartbug.com/16814
-  bool dispatchEvent(Event event) => throw new UnsupportedError(
-      'You can only attach EventListeners to your own window.');
-  // TODO(efortuna): Remove this method. dartbug.com/16814
-  void _removeEventListener(String? type, EventListener? listener,
-          [bool? useCapture]) =>
-      throw new UnsupportedError(
-          'You can only attach EventListeners to your own window.');
-  // TODO(efortuna): Remove this method. dartbug.com/16814
-  void removeEventListener(String type, EventListener? listener,
-          [bool? useCapture]) =>
-      throw new UnsupportedError(
-          'You can only attach EventListeners to your own window.');
-}
-
-class _LocationCrossFrame implements LocationBase {
-  // Private location.  Note, this is a location object in another frame, so it
-  // cannot be typed as "Location" as its prototype is not patched
-  // properly.  Its fields and methods can only be accessed via JavaScript.
-  var _location;
-
-  set href(String val) => _setHref(_location, val);
-  static void _setHref(location, val) {
-    JS('void', '#.href = #', location, val);
-  }
-
-  // Implementation support.
-  _LocationCrossFrame(this._location);
-
-  static LocationBase _createSafe(location) {
-    if (identical(location, window.location)) {
-      return location;
-    } else {
-      // TODO(vsm): Cache or implement equality.
-      return new _LocationCrossFrame(location);
-    }
-  }
-}
-
-class _HistoryCrossFrame implements HistoryBase {
-  // Private history.  Note, this is a history object in another frame, so it
-  // cannot be typed as "History" as its prototype is not patched
-  // properly.  Its fields and methods can only be accessed via JavaScript.
-  var _history;
-
-  void back() => JS('void', '#.back()', _history);
-
-  void forward() => JS('void', '#.forward()', _history);
-
-  void go(int distance) => JS('void', '#.go(#)', _history, distance);
-
-  // Implementation support.
-  _HistoryCrossFrame(this._history);
-
-  static HistoryBase _createSafe(h) {
-    if (identical(h, window.history)) {
-      return h;
-    } else {
-      // TODO(vsm): Cache or implement equality.
-      return new _HistoryCrossFrame(h);
-    }
-  }
-}
-
-/**
- * A custom KeyboardEvent that attempts to eliminate cross-browser
- * inconsistencies, and also provide both keyCode and charCode information
- * for all key events (when such information can be determined).
- *
- * KeyEvent tries to provide a higher level, more polished keyboard event
- * information on top of the "raw" [KeyboardEvent].
- *
- * The mechanics of using KeyEvents is a little different from the underlying
- * [KeyboardEvent]. To use KeyEvents, you need to create a stream and then add
- * KeyEvents to the stream, rather than using the [EventTarget.dispatchEvent].
- * Here's an example usage:
- *
- *     // Initialize a stream for the KeyEvents:
- *     var stream = KeyEvent.keyPressEvent.forTarget(document.body);
- *     // Start listening to the stream of KeyEvents.
- *     stream.listen((keyEvent) =>
- *         window.console.log('KeyPress event detected ${keyEvent.charCode}'));
- *     ...
- *     // Add a new KeyEvent of someone pressing the 'A' key to the stream so
- *     // listeners can know a KeyEvent happened.
- *     stream.add(new KeyEvent('keypress', keyCode: 65, charCode: 97));
- *
- * This class is very much a work in progress, and we'd love to get information
- * on how we can make this class work with as many international keyboards as
- * possible. Bugs welcome!
- */
-class KeyEvent extends _WrappedEvent implements KeyboardEvent {
-  /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */
-  KeyboardEvent _parent;
-
-  /** The "fixed" value of whether the alt key is being pressed. */
-  bool _shadowAltKey;
-
-  /** Calculated value of what the estimated charCode is for this event. */
-  int _shadowCharCode;
-
-  /** Calculated value of what the estimated keyCode is for this event. */
-  int _shadowKeyCode;
-
-  /** Calculated value of what the estimated keyCode is for this event. */
-  int get keyCode => _shadowKeyCode;
-
-  /** Calculated value of what the estimated charCode is for this event. */
-  int get charCode => this.type == 'keypress' ? _shadowCharCode : 0;
-
-  /** Calculated value of whether the alt key is pressed is for this event. */
-  bool get altKey => _shadowAltKey;
-
-  /** Calculated value of what the estimated keyCode is for this event. */
-  int get which => keyCode;
-
-  /** Accessor to the underlying keyCode value is the parent event. */
-  int get _realKeyCode => JS('int', '#.keyCode', _parent);
-
-  /** Accessor to the underlying charCode value is the parent event. */
-  int get _realCharCode => JS('int', '#.charCode', _parent);
-
-  /** Accessor to the underlying altKey value is the parent event. */
-  bool get _realAltKey => JS('bool', '#.altKey', _parent);
-
-  /** Shadows on top of the parent's currentTarget. */
-  EventTarget? _currentTarget;
-
-  InputDeviceCapabilities? get sourceCapabilities =>
-      JS('InputDeviceCapabilities', '#.sourceCapabilities', this);
-
-  /**
-   * The value we want to use for this object's dispatch. Created here so it is
-   * only invoked once.
-   */
-  static final _keyboardEventDispatchRecord = _makeRecord();
-
-  /** Helper to statically create the dispatch record. */
-  static _makeRecord() {
-    var interceptor = JS_INTERCEPTOR_CONSTANT(KeyboardEvent);
-    return makeLeafDispatchRecord(interceptor);
-  }
-
-  /** Construct a KeyEvent with [parent] as the event we're emulating. */
-  KeyEvent.wrap(KeyboardEvent parent)
-      : _parent = parent,
-        _shadowAltKey = false,
-        _shadowCharCode = 0,
-        _shadowKeyCode = 0,
-        super(parent) {
-    _parent = parent;
-    _shadowAltKey = _realAltKey;
-    _shadowCharCode = _realCharCode;
-    _shadowKeyCode = _realKeyCode;
-    _currentTarget = _parent.currentTarget;
-  }
-
-  /** Programmatically create a new KeyEvent (and KeyboardEvent). */
-  factory KeyEvent(String type,
-      {Window? view,
-      bool canBubble: true,
-      bool cancelable: true,
-      int keyCode: 0,
-      int charCode: 0,
-      int location: 1,
-      bool ctrlKey: false,
-      bool altKey: false,
-      bool shiftKey: false,
-      bool metaKey: false,
-      EventTarget? currentTarget}) {
-    if (view == null) {
-      view = window;
-    }
-
-    dynamic eventObj;
-
-    // Currently this works on everything but Safari. Safari throws an
-    // "Attempting to change access mechanism for an unconfigurable property"
-    // TypeError when trying to do the Object.defineProperty hack, so we avoid
-    // this branch if possible.
-    // Also, if we want this branch to work in FF, we also need to modify
-    // _initKeyboardEvent to also take charCode and keyCode values to
-    // initialize initKeyEvent.
-
-    eventObj = new Event.eventType('KeyboardEvent', type,
-        canBubble: canBubble, cancelable: cancelable);
-
-    // Chromium Hack
-    JS(
-        'void',
-        "Object.defineProperty(#, 'keyCode', {"
-            "  get : function() { return this.keyCodeVal; } })",
-        eventObj);
-    JS(
-        'void',
-        "Object.defineProperty(#, 'which', {"
-            "  get : function() { return this.keyCodeVal; } })",
-        eventObj);
-    JS(
-        'void',
-        "Object.defineProperty(#, 'charCode', {"
-            "  get : function() { return this.charCodeVal; } })",
-        eventObj);
-
-    var keyIdentifier = _convertToHexString(charCode, keyCode);
-    eventObj._initKeyboardEvent(type, canBubble, cancelable, view,
-        keyIdentifier, location, ctrlKey, altKey, shiftKey, metaKey);
-    JS('void', '#.keyCodeVal = #', eventObj, keyCode);
-    JS('void', '#.charCodeVal = #', eventObj, charCode);
-
-    // Tell dart2js that it smells like a KeyboardEvent!
-    setDispatchProperty(eventObj, _keyboardEventDispatchRecord);
-
-    var keyEvent = new KeyEvent.wrap(eventObj);
-    if (keyEvent._currentTarget == null) {
-      keyEvent._currentTarget = currentTarget == null ? window : currentTarget;
-    }
-    return keyEvent;
-  }
-
-  // Currently known to work on all browsers but IE.
-  static bool get canUseDispatchEvent => JS(
-      'bool',
-      '(typeof document.body.dispatchEvent == "function")'
-          '&& document.body.dispatchEvent.length > 0');
-
-  /** The currently registered target for this event. */
-  EventTarget? get currentTarget => _currentTarget;
-
-  // This is an experimental method to be sure.
-  static String _convertToHexString(int charCode, int keyCode) {
-    if (charCode != -1) {
-      var hex = charCode.toRadixString(16); // Convert to hexadecimal.
-      StringBuffer sb = new StringBuffer('U+');
-      for (int i = 0; i < 4 - hex.length; i++) sb.write('0');
-      sb.write(hex);
-      return sb.toString();
-    } else {
-      return KeyCode._convertKeyCodeToKeyName(keyCode);
-    }
-  }
-
-  // TODO(efortuna): If KeyEvent is sufficiently successful that we want to make
-  // it the default keyboard event handling, move these methods over to Element.
-  /** Accessor to provide a stream of KeyEvents on the desired target. */
-  static EventStreamProvider<KeyEvent> keyDownEvent =
-      new _KeyboardEventHandler('keydown');
-  /** Accessor to provide a stream of KeyEvents on the desired target. */
-  static EventStreamProvider<KeyEvent> keyUpEvent =
-      new _KeyboardEventHandler('keyup');
-  /** Accessor to provide a stream of KeyEvents on the desired target. */
-  static EventStreamProvider<KeyEvent> keyPressEvent =
-      new _KeyboardEventHandler('keypress');
-
-  String get code => _parent.code;
-  /** True if the ctrl key is pressed during this event. */
-  bool get ctrlKey => _parent.ctrlKey;
-  int get detail => _parent.detail;
-  bool get isComposing => _parent.isComposing;
-  String get key => _parent.key;
-  /**
-   * Accessor to the part of the keyboard that the key was pressed from (one of
-   * KeyLocation.STANDARD, KeyLocation.RIGHT, KeyLocation.LEFT,
-   * KeyLocation.NUMPAD, KeyLocation.MOBILE, KeyLocation.JOYSTICK).
-   */
-  int get location => _parent.location;
-  /** True if the Meta (or Mac command) key is pressed during this event. */
-  bool get metaKey => _parent.metaKey;
-  /** True if the shift key was pressed during this event. */
-  bool get shiftKey => _parent.shiftKey;
-  WindowBase? get view => _parent.view;
-  void _initUIEvent(
-      String type, bool canBubble, bool cancelable, Window? view, int detail) {
-    throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent.");
-  }
-
-  String get _shadowKeyIdentifier => JS('String', '#.keyIdentifier', _parent);
-
-  int get _charCode => charCode;
-  int get _keyCode => keyCode;
-  int get _which => which;
-
-  String get _keyIdentifier {
-    throw new UnsupportedError("keyIdentifier is unsupported.");
-  }
-
-  void _initKeyboardEvent(
-      String type,
-      bool canBubble,
-      bool cancelable,
-      Window? view,
-      String keyIdentifier,
-      int? location,
-      bool ctrlKey,
-      bool altKey,
-      bool shiftKey,
-      bool metaKey) {
-    throw new UnsupportedError(
-        "Cannot initialize a KeyboardEvent from a KeyEvent.");
-  }
-
-  bool getModifierState(String keyArgument) => throw new UnimplementedError();
-
-  bool get repeat => throw new UnimplementedError();
-  bool get isComposed => throw new UnimplementedError();
-  dynamic get _get_view => throw new UnimplementedError();
-}
-// Copyright (c) 2013, 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.
-
-class Platform {
-  /**
-   * Returns true if dart:typed_data types are supported on this
-   * browser.  If false, using these types will generate a runtime
-   * error.
-   */
-  static final bool supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
-
-  /**
-   * Returns true if SIMD types in dart:typed_data types are supported
-   * on this browser.  If false, using these types will generate a runtime
-   * error.
-   */
-  static final supportsSimd = false;
-}
-// Copyright (c) 2013, 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.
-
-/**
- * Helper class to implement custom events which wrap DOM events.
- */
-class _WrappedEvent implements Event {
-  final Event wrapped;
-
-  /** The CSS selector involved with event delegation. */
-  String? _selector;
-
-  _WrappedEvent(this.wrapped);
-
-  bool get bubbles => wrapped.bubbles;
-
-  bool get cancelable => wrapped.cancelable;
-
-  bool get composed => wrapped.composed;
-
-  EventTarget? get currentTarget => wrapped.currentTarget;
-
-  bool get defaultPrevented => wrapped.defaultPrevented;
-
-  int get eventPhase => wrapped.eventPhase;
-
-  bool get isTrusted => wrapped.isTrusted;
-
-  EventTarget? get target => wrapped.target;
-
-  double get timeStamp => wrapped.timeStamp as double;
-
-  String get type => wrapped.type;
-
-  void _initEvent(String type, [bool? bubbles, bool? cancelable]) {
-    throw new UnsupportedError('Cannot initialize this Event.');
-  }
-
-  void preventDefault() {
-    wrapped.preventDefault();
-  }
-
-  void stopImmediatePropagation() {
-    wrapped.stopImmediatePropagation();
-  }
-
-  void stopPropagation() {
-    wrapped.stopPropagation();
-  }
-
-  List<EventTarget> composedPath() => wrapped.composedPath();
-
-  /**
-   * A pointer to the element whose CSS selector matched within which an event
-   * was fired. If this Event was not associated with any Event delegation,
-   * accessing this value will throw an [UnsupportedError].
-   */
-  Element get matchingTarget {
-    if (_selector == null) {
-      throw new UnsupportedError('Cannot call matchingTarget if this Event did'
-          ' not arise as a result of event delegation.');
-    }
-    Element? currentTarget = this.currentTarget as Element?;
-    Element? target = this.target as Element?;
-    do {
-      if (target!.matches(_selector!)) return target;
-      target = target.parent;
-    } while (target != null && target != currentTarget!.parent);
-    throw new StateError('No selector matched for populating matchedTarget.');
-  }
-
-  /**
-   * This event's path, taking into account shadow DOM.
-   *
-   * ## Other resources
-   *
-   * * [Shadow DOM extensions to
-   *   Event](http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event)
-   *   from W3C.
-   */
-  // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#extensions-to-event
-  List<Node> get path => wrapped.path as List<Node>;
-
-  dynamic get _get_currentTarget => wrapped._get_currentTarget;
-
-  dynamic get _get_target => wrapped._get_target;
-}
-// Copyright (c) 2013, 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.
-
-void Function(T)? _wrapZone<T>(void Function(T)? callback) {
-  // For performance reasons avoid wrapping if we are in the root zone.
-  if (Zone.current == Zone.root) return callback;
-  if (callback == null) return null;
-  return Zone.current.bindUnaryCallbackGuarded(callback);
-}
-
-void Function(T1, T2)? _wrapBinaryZone<T1, T2>(
-    void Function(T1, T2)? callback) {
-  // For performance reasons avoid wrapping if we are in the root zone.
-  if (Zone.current == Zone.root) return callback;
-  if (callback == null) return null;
-  return Zone.current.bindBinaryCallbackGuarded(callback);
-}
-
-/**
- * Finds the first descendant element of this document that matches the
- * specified group of selectors.
- *
- * Unless your webpage contains multiple documents, the top-level
- * [querySelector]
- * method behaves the same as this method, so you should use it instead to
- * save typing a few characters.
- *
- * [selectors] should be a string using CSS selector syntax.
- *
- *     var element1 = document.querySelector('.className');
- *     var element2 = document.querySelector('#id');
- *
- * For details about CSS selector syntax, see the
- * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
- */
-Element? querySelector(String selectors) => document.querySelector(selectors);
-
-/**
- * Finds all descendant elements of this document that match the specified
- * group of selectors.
- *
- * Unless your webpage contains multiple documents, the top-level
- * [querySelectorAll]
- * method behaves the same as this method, so you should use it instead to
- * save typing a few characters.
- *
- * [selectors] should be a string using CSS selector syntax.
- *
- *     var items = document.querySelectorAll('.itemClassName');
- *
- * For details about CSS selector syntax, see the
- * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
- */
-ElementList<T> querySelectorAll<T extends Element>(String selectors) =>
-    document.querySelectorAll(selectors);
-
-/// A utility for changing the Dart wrapper type for elements.
-abstract class ElementUpgrader {
-  /// Upgrade the specified element to be of the Dart type this was created for.
-  ///
-  /// After upgrading the element passed in is invalid and the returned value
-  /// should be used instead.
-  Element upgrade(Element element);
-}
-// Copyright (c) 2013, 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.
-
-/**
- * Interface used to validate that only accepted elements and attributes are
- * allowed while parsing HTML strings into DOM nodes.
- *
- * In general, customization of validation behavior should be done via the
- * [NodeValidatorBuilder] class to mitigate the chances of incorrectly
- * implementing validation rules.
- */
-abstract class NodeValidator {
-  /**
-   * Construct a default NodeValidator which only accepts whitelisted HTML5
-   * elements and attributes.
-   *
-   * If a uriPolicy is not specified then the default uriPolicy will be used.
-   */
-  factory NodeValidator({UriPolicy? uriPolicy}) =>
-      new _Html5NodeValidator(uriPolicy: uriPolicy);
-
-  factory NodeValidator.throws(NodeValidator base) =>
-      new _ThrowsNodeValidator(base);
-
-  /**
-   * Returns true if the tagName is an accepted type.
-   */
-  bool allowsElement(Element element);
-
-  /**
-   * Returns true if the attribute is allowed.
-   *
-   * The attributeName parameter will always be in lowercase.
-   *
-   * See [allowsElement] for format of tagName.
-   */
-  bool allowsAttribute(Element element, String attributeName, String value);
-}
-
-/**
- * Performs sanitization of a node tree after construction to ensure that it
- * does not contain any disallowed elements or attributes.
- *
- * In general custom implementations of this class should not be necessary and
- * all validation customization should be done in custom NodeValidators, but
- * custom implementations of this class can be created to perform more complex
- * tree sanitization.
- */
-abstract class NodeTreeSanitizer {
-  /**
-   * Constructs a default tree sanitizer which will remove all elements and
-   * attributes which are not allowed by the provided validator.
-   */
-  factory NodeTreeSanitizer(NodeValidator validator) =>
-      new _ValidatingTreeSanitizer(validator);
-
-  /**
-   * Called with the root of the tree which is to be sanitized.
-   *
-   * This method needs to walk the entire tree and either remove elements and
-   * attributes which are not recognized as safe or throw an exception which
-   * will mark the entire tree as unsafe.
-   */
-  void sanitizeTree(Node node);
-
-  /**
-   * A sanitizer for trees that we trust. It does no validation and allows
-   * any elements. It is also more efficient, since it can pass the text
-   * directly through to the underlying APIs without creating a document
-   * fragment to be sanitized.
-   */
-  static const trusted = const _TrustedHtmlTreeSanitizer();
-}
-
-/**
- * A sanitizer for trees that we trust. It does no validation and allows
- * any elements.
- */
-class _TrustedHtmlTreeSanitizer implements NodeTreeSanitizer {
-  const _TrustedHtmlTreeSanitizer();
-
-  sanitizeTree(Node node) {}
-}
-
-/**
- * Defines the policy for what types of uris are allowed for particular
- * attribute values.
- *
- * This can be used to provide custom rules such as allowing all http:// URIs
- * for image attributes but only same-origin URIs for anchor tags.
- */
-abstract class UriPolicy {
-  /**
-   * Constructs the default UriPolicy which is to only allow Uris to the same
-   * origin as the application was launched from.
-   *
-   * This will block all ftp: mailto: URIs. It will also block accessing
-   * https://example.com if the app is running from http://example.com.
-   */
-  factory UriPolicy() => new _SameOriginUriPolicy();
-
-  /**
-   * Checks if the uri is allowed on the specified attribute.
-   *
-   * The uri provided may or may not be a relative path.
-   */
-  bool allowsUri(String uri);
-}
-
-/**
- * Allows URIs to the same origin as the current application was loaded from
- * (such as https://example.com:80).
- */
-class _SameOriginUriPolicy implements UriPolicy {
-  final AnchorElement _hiddenAnchor = new AnchorElement();
-  final Location _loc = window.location;
-
-  bool allowsUri(String uri) {
-    _hiddenAnchor.href = uri;
-    // IE leaves an empty hostname for same-origin URIs.
-    return (_hiddenAnchor.hostname == _loc.hostname &&
-            _hiddenAnchor.port == _loc.port &&
-            _hiddenAnchor.protocol == _loc.protocol) ||
-        (_hiddenAnchor.hostname == '' &&
-            _hiddenAnchor.port == '' &&
-            (_hiddenAnchor.protocol == ':' || _hiddenAnchor.protocol == ''));
-  }
-}
-
-class _ThrowsNodeValidator implements NodeValidator {
-  final NodeValidator validator;
-
-  _ThrowsNodeValidator(this.validator) {}
-
-  bool allowsElement(Element element) {
-    if (!validator.allowsElement(element)) {
-      throw new ArgumentError(Element._safeTagName(element));
-    }
-    return true;
-  }
-
-  bool allowsAttribute(Element element, String attributeName, String value) {
-    if (!validator.allowsAttribute(element, attributeName, value)) {
-      throw new ArgumentError(
-          '${Element._safeTagName(element)}[$attributeName="$value"]');
-    }
-    return true;
-  }
-}
-
-/**
- * Standard tree sanitizer which validates a node tree against the provided
- * validator and removes any nodes or attributes which are not allowed.
- */
-class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
-  NodeValidator validator;
-
-  /// Did we modify the tree by removing anything.
-  bool modifiedTree = false;
-  _ValidatingTreeSanitizer(this.validator) {}
-
-  void sanitizeTree(Node node) {
-    void walk(Node node, Node? parent) {
-      sanitizeNode(node, parent);
-
-      var child = node.lastChild;
-      while (null != child) {
-        Node? nextChild;
-        try {
-          // Child may be removed during the walk, and we may not even be able
-          // to get its previousNode. But it's also possible that previousNode
-          // (i.e. previousSibling) is being spoofed, so double-check it.
-          nextChild = child.previousNode;
-          if (nextChild != null && nextChild.nextNode != child) {
-            throw StateError("Corrupt HTML");
-          }
-        } catch (e) {
-          // Child appears bad, remove it. We want to check the rest of the
-          // children of node and, but we have no way of getting to the next
-          // child, so start again from the last child.
-          _removeNode(child, node);
-          child = null;
-          nextChild = node.lastChild;
-        }
-        if (child != null) walk(child, node);
-        child = nextChild;
-      }
-    }
-
-    modifiedTree = false;
-    walk(node, null);
-    while (modifiedTree) {
-      modifiedTree = false;
-      walk(node, null);
-    }
-  }
-
-  /// Aggressively try to remove node.
-  void _removeNode(Node node, Node? parent) {
-    // If we have the parent, it's presumably already passed more sanitization
-    // or is the fragment, so ask it to remove the child. And if that fails
-    // try to set the outer html.
-    modifiedTree = true;
-    if (parent == null || parent != node.parentNode) {
-      node.remove();
-    } else {
-      parent._removeChild(node);
-    }
-  }
-
-  /// Sanitize the element, assuming we can't trust anything about it.
-  void _sanitizeUntrustedElement(/* Element */ element, Node? parent) {
-    // If the _hasCorruptedAttributes does not successfully return false,
-    // then we consider it corrupted and remove.
-    // TODO(alanknight): This is a workaround because on Firefox
-    // embed/object
-    // tags typeof is "function", not "object". We don't recognize them, and
-    // can't call methods. This does mean that you can't explicitly allow an
-    // embed tag. The only thing that will let it through is a null
-    // sanitizer that doesn't traverse the tree at all. But sanitizing while
-    // allowing embeds seems quite unlikely. This is also the reason that we
-    // can't declare the type of element, as an embed won't pass any type
-    // check in dart2js.
-    var corrupted = true;
-    var attrs;
-    var isAttr;
-    try {
-      // If getting/indexing attributes throws, count that as corrupt.
-      attrs = element.attributes;
-      isAttr = attrs['is'];
-      var corruptedTest1 = Element._hasCorruptedAttributes(element);
-
-      // On IE, erratically, the hasCorruptedAttributes test can return false,
-      // even though it clearly is corrupted. A separate copy of the test
-      // inlining just the basic check seems to help.
-      corrupted = corruptedTest1
-          ? true
-          : Element._hasCorruptedAttributesAdditionalCheck(element);
-    } catch (e) {}
-    var elementText = 'element unprintable';
-    try {
-      elementText = element.toString();
-    } catch (e) {}
-    try {
-      var elementTagName = Element._safeTagName(element);
-      _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
-          attrs, isAttr);
-    } on ArgumentError {
-      // Thrown by _ThrowsNodeValidator
-      rethrow;
-    } catch (e) {
-      // Unexpected exception sanitizing -> remove
-      _removeNode(element, parent);
-      window.console.warn('Removing corrupted element $elementText');
-    }
-  }
-
-  /// Having done basic sanity checking on the element, and computed the
-  /// important attributes we want to check, remove it if it's not valid
-  /// or not allowed, either as a whole or particular attributes.
-  void _sanitizeElement(Element element, Node? parent, bool corrupted,
-      String text, String tag, Map attrs, String? isAttr) {
-    if (false != corrupted) {
-      _removeNode(element, parent);
-      window.console
-          .warn('Removing element due to corrupted attributes on <$text>');
-      return;
-    }
-    if (!validator.allowsElement(element)) {
-      _removeNode(element, parent);
-      window.console.warn('Removing disallowed element <$tag> from $parent');
-      return;
-    }
-
-    if (isAttr != null) {
-      if (!validator.allowsAttribute(element, 'is', isAttr)) {
-        _removeNode(element, parent);
-        window.console.warn('Removing disallowed type extension '
-            '<$tag is="$isAttr">');
-        return;
-      }
-    }
-
-    // TODO(blois): Need to be able to get all attributes, irrespective of
-    // XMLNS.
-    var keys = attrs.keys.toList();
-    for (var i = attrs.length - 1; i >= 0; --i) {
-      var name = keys[i];
-      if (!validator.allowsAttribute(
-          element, name.toLowerCase(), attrs[name])) {
-        window.console.warn('Removing disallowed attribute '
-            '<$tag $name="${attrs[name]}">');
-        attrs.remove(name);
-      }
-    }
-
-    if (element is TemplateElement) {
-      TemplateElement template = element;
-      sanitizeTree(template.content);
-    }
-  }
-
-  /// Sanitize the node and its children recursively.
-  void sanitizeNode(Node node, Node? parent) {
-    switch (node.nodeType) {
-      case Node.ELEMENT_NODE:
-        _sanitizeUntrustedElement(node, parent);
-        break;
-      case Node.COMMENT_NODE:
-      case Node.DOCUMENT_FRAGMENT_NODE:
-      case Node.TEXT_NODE:
-      case Node.CDATA_SECTION_NODE:
-        break;
-      default:
-        _removeNode(node, parent);
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/html/dartium/nativewrappers.dart b/sdk_nnbd/lib/html/dartium/nativewrappers.dart
deleted file mode 100644
index b6d2dc4..0000000
--- a/sdk_nnbd/lib/html/dartium/nativewrappers.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library nativewrappers;
-
-class NativeFieldWrapperClass1 {}
-
-class NativeFieldWrapperClass2 {}
-
-class NativeFieldWrapperClass3 {}
-
-class NativeFieldWrapperClass4 {}
diff --git a/sdk_nnbd/lib/html/html_common/conversions.dart b/sdk_nnbd/lib/html/html_common/conversions.dart
deleted file mode 100644
index 0b5459f..0000000
--- a/sdk_nnbd/lib/html/html_common/conversions.dart
+++ /dev/null
@@ -1,375 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Conversions for IDBKey.
-//
-// Per http://www.w3.org/TR/IndexedDB/#key-construct
-//
-// "A value is said to be a valid key if it is one of the following types: Array
-// JavaScript objects [ECMA-262], DOMString [WEBIDL], Date [ECMA-262] or float
-// [WEBIDL]. However Arrays are only valid keys if every item in the array is
-// defined and is a valid key (i.e. sparse arrays can not be valid keys) and if
-// the Array doesn't directly or indirectly contain itself. Any non-numeric
-// properties are ignored, and thus does not affect whether the Array is a valid
-// key. Additionally, if the value is of type float, it is only a valid key if
-// it is not NaN, and if the value is of type Date it is only a valid key if its
-// [[PrimitiveValue]] internal property, as defined by [ECMA-262], is not NaN."
-
-// What is required is to ensure that an Lists in the key are actually
-// JavaScript arrays, and any Dates are JavaScript Dates.
-
-// Conversions for Window.  These check if the window is the local
-// window, and if it's not, wraps or unwraps it with a secure wrapper.
-// We need to test for EventTarget here as well as it's a base type.
-// We omit an unwrapper for Window as no methods take a non-local
-// window as a parameter.
-
-part of html_common;
-
-/// Converts a Dart value into a JavaScript SerializedScriptValue.
-convertDartToNative_SerializedScriptValue(value) {
-  return convertDartToNative_PrepareForStructuredClone(value);
-}
-
-/// Since the source object may be viewed via a JavaScript event listener the
-/// original may not be modified.
-convertNativeToDart_SerializedScriptValue(object) {
-  return convertNativeToDart_AcceptStructuredClone(object, mustCopy: true);
-}
-
-/**
- * Converts a Dart value into a JavaScript SerializedScriptValue.  Returns the
- * original input or a functional 'copy'.  Does not mutate the original.
- *
- * The main transformation is the translation of Dart Maps are converted to
- * JavaScript Objects.
- *
- * The algorithm is essentially a dry-run of the structured clone algorithm
- * described at
- * http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#structured-clone
- * https://www.khronos.org/registry/typedarray/specs/latest/#9
- *
- * Since the result of this function is expected to be passed only to JavaScript
- * operations that perform the structured clone algorithm which does not mutate
- * its output, the result may share structure with the input [value].
- */
-abstract class _StructuredClone {
-  // TODO(sra): Replace slots with identity hash table.
-  var values = [];
-  var copies = []; // initially 'null', 'true' during initial DFS, then a copy.
-
-  int findSlot(value) {
-    int length = values.length;
-    for (int i = 0; i < length; i++) {
-      if (identical(values[i], value)) return i;
-    }
-    values.add(value);
-    copies.add(null);
-    return length;
-  }
-
-  readSlot(int i) => copies[i];
-  writeSlot(int i, x) {
-    copies[i] = x;
-  }
-
-  cleanupSlots() {} // Will be needed if we mark objects with a property.
-  bool cloneNotRequired(object);
-  JSObject newJsObject();
-  void forEachObjectKey(object, action(key, value));
-  void putIntoObject(object, key, value);
-  newJsMap();
-  List newJsList(length);
-  void putIntoMap(map, key, value);
-
-  // Returns the input, or a clone of the input.
-  walk(e) {
-    if (e == null) return e;
-    if (e is bool) return e;
-    if (e is num) return e;
-    if (e is String) return e;
-    if (e is DateTime) {
-      return convertDartToNative_DateTime(e);
-    }
-    if (e is RegExp) {
-      // TODO(sra).
-      throw new UnimplementedError('structured clone of RegExp');
-    }
-
-    // The browser's internal structured cloning algorithm will copy certain
-    // types of object, but it will copy only its own implementations and not
-    // just any Dart implementations of the interface.
-
-    // TODO(sra): The JavaScript objects suitable for direct cloning by the
-    // structured clone algorithm could be tagged with an private interface.
-
-    if (e is File) return e;
-    if (e is Blob) return e;
-    if (e is FileList) return e;
-
-    // TODO(sra): Firefox: How to convert _TypedImageData on the other end?
-    if (e is ImageData) return e;
-    if (cloneNotRequired(e)) return e;
-
-    if (e is Map) {
-      var slot = findSlot(e);
-      var copy = readSlot(slot);
-      if (copy != null) return copy;
-      copy = newJsMap();
-      writeSlot(slot, copy);
-      e.forEach((key, value) {
-        putIntoMap(copy, key, walk(value));
-      });
-      return copy;
-    }
-
-    if (e is List) {
-      // Since a JavaScript Array is an instance of Dart List it is tempting
-      // in dart2js to avoid making a copy of the list if there is no need
-      // to copy anything reachable from the array.  However, the list may have
-      // non-native properties or methods from interceptors and such, e.g.
-      // an immutability marker. So we  had to stop doing that.
-      var slot = findSlot(e);
-      var copy = JS('returns:List|Null;creates:;', '#', readSlot(slot));
-      if (copy != null) return copy;
-      copy = copyList(e, slot);
-      return copy;
-    }
-
-    if (e is JSObject) {
-      var slot = findSlot(e);
-      var copy = readSlot(slot);
-      if (copy != null) return copy;
-      copy = newJsObject();
-      writeSlot(slot, copy);
-      // TODO: Consider inlining this so we don't allocate a closure.
-      forEachObjectKey(e, (key, value) {
-        putIntoObject(copy, key, walk(value));
-      });
-      return copy;
-    }
-
-    throw new UnimplementedError('structured clone of other type');
-  }
-
-  List copyList(List e, int slot) {
-    int i = 0;
-    int length = e.length;
-    var copy = newJsList(length);
-    writeSlot(slot, copy);
-    for (; i < length; i++) {
-      copy[i] = walk(e[i]);
-    }
-    return copy;
-  }
-
-  convertDartToNative_PrepareForStructuredClone(value) {
-    var copy = walk(value);
-    cleanupSlots();
-    return copy;
-  }
-}
-
-/**
- * Converts a native value into a Dart object.
- *
- * If [mustCopy] is [:false:], may return the original input.  May mutate the
- * original input (but will be idempotent if mutation occurs).  It is assumed
- * that this conversion happens on native serializable script values such values
- * from native DOM calls.
- *
- * [object] is the result of a structured clone operation.
- *
- * If necessary, JavaScript Dates are converted into Dart Dates.
- *
- * If [mustCopy] is [:true:], the entire object is copied and the original input
- * is not mutated.  This should be the case where Dart and JavaScript code can
- * access the value, for example, via multiple event listeners for
- * MessageEvents.  Mutating the object to make it more 'Dart-like' would corrupt
- * the value as seen from the JavaScript listeners.
- */
-abstract class _AcceptStructuredClone {
-  // TODO(sra): Replace slots with identity hash table.
-  var values = [];
-  var copies = []; // initially 'null', 'true' during initial DFS, then a copy.
-  bool mustCopy = false;
-
-  int findSlot(value) {
-    int length = values.length;
-    for (int i = 0; i < length; i++) {
-      if (identicalInJs(values[i], value)) return i;
-    }
-    values.add(value);
-    copies.add(null);
-    return length;
-  }
-
-  /// Are the two objects identical, but taking into account that two JsObject
-  /// wrappers may not be identical, but their underlying Js Object might be.
-  bool identicalInJs(a, b);
-  readSlot(int i) => copies[i];
-  writeSlot(int i, x) {
-    copies[i] = x;
-  }
-
-  /// Iterate over the JS properties.
-  forEachJsField(object, action(key, value));
-
-  /// Create a new Dart list of the given length. May create a native List or
-  /// a JsArray, depending if we're in Dartium or dart2js.
-  List newDartList(length);
-
-  walk(e) {
-    if (e == null) return e;
-    if (e is bool) return e;
-    if (e is num) return e;
-    if (e is String) return e;
-
-    if (isJavaScriptDate(e)) {
-      return convertNativeToDart_DateTime(e);
-    }
-
-    if (isJavaScriptRegExp(e)) {
-      // TODO(sra).
-      throw new UnimplementedError('structured clone of RegExp');
-    }
-
-    if (isJavaScriptPromise(e)) {
-      return promiseToFuture(e);
-    }
-
-    if (isJavaScriptSimpleObject(e)) {
-      // TODO(sra): If mustCopy is false, swizzle the prototype for one of a Map
-      // implementation that uses the properties as storage.
-      var slot = findSlot(e);
-      var copy = readSlot(slot);
-      if (copy != null) return copy;
-      copy = {};
-
-      writeSlot(slot, copy);
-      forEachJsField(e, (key, value) => copy[key] = walk(value));
-      return copy;
-    }
-
-    if (isJavaScriptArray(e)) {
-      var l = JS<List>('returns:List;creates:;', '#', e);
-      var slot = findSlot(l);
-      var copy = JS<List?>('returns:List|Null;creates:;', '#', readSlot(slot));
-      if (copy != null) return copy;
-
-      int length = l.length;
-      // Since a JavaScript Array is an instance of Dart List, we can modify it
-      // in-place unless we must copy.
-      copy = mustCopy ? newDartList(length) : l;
-      writeSlot(slot, copy);
-
-      for (int i = 0; i < length; i++) {
-        copy[i] = walk(l[i]);
-      }
-      return copy;
-    }
-
-    // Assume anything else is already a valid Dart object, either by having
-    // already been processed, or e.g. a cloneable native class.
-    return e;
-  }
-
-  convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) {
-    this.mustCopy = mustCopy;
-    var copy = walk(object);
-    return copy;
-  }
-}
-
-// Conversions for ContextAttributes.
-//
-// On Firefox, the returned ContextAttributes is a plain object.
-class ContextAttributes {
-  bool alpha;
-  bool antialias;
-  bool depth;
-  bool premultipliedAlpha;
-  bool preserveDrawingBuffer;
-  bool stencil;
-  bool failIfMajorPerformanceCaveat;
-
-  ContextAttributes(
-      this.alpha,
-      this.antialias,
-      this.depth,
-      this.failIfMajorPerformanceCaveat,
-      this.premultipliedAlpha,
-      this.preserveDrawingBuffer,
-      this.stencil);
-}
-
-convertNativeToDart_ContextAttributes(nativeContextAttributes) {
-  // On Firefox the above test fails because ContextAttributes is a plain
-  // object so we create a _TypedContextAttributes.
-
-  return new ContextAttributes(
-      JS('var', '#.alpha', nativeContextAttributes),
-      JS('var', '#.antialias', nativeContextAttributes),
-      JS('var', '#.depth', nativeContextAttributes),
-      JS('var', '#.failIfMajorPerformanceCaveat', nativeContextAttributes),
-      JS('var', '#.premultipliedAlpha', nativeContextAttributes),
-      JS('var', '#.preserveDrawingBuffer', nativeContextAttributes),
-      JS('var', '#.stencil', nativeContextAttributes));
-}
-
-// Conversions for ImageData
-//
-// On Firefox, the returned ImageData is a plain object.
-
-class _TypedImageData implements ImageData {
-  final Uint8ClampedList data;
-  final int height;
-  final int width;
-
-  _TypedImageData(this.data, this.height, this.width);
-}
-
-ImageData convertNativeToDart_ImageData(nativeImageData) {
-  // None of the native getters that return ImageData are declared as returning
-  // [ImageData] since that is incorrect for FireFox, which returns a plain
-  // Object.  So we need something that tells the compiler that the ImageData
-  // class has been instantiated.
-  // TODO(sra): Remove this when all the ImageData returning APIs have been
-  // annotated as returning the union ImageData + Object.
-  JS('ImageData', '0');
-
-  if (nativeImageData is ImageData) {
-    // Fix for Issue 16069: on IE, the `data` field is a CanvasPixelArray which
-    // has Array as the constructor property.  This interferes with finding the
-    // correct interceptor.  Fix it by overwriting the constructor property.
-    var data = nativeImageData.data;
-    if (JS('bool', '#.constructor === Array', data)) {
-      if (JS('bool', 'typeof CanvasPixelArray !== "undefined"')) {
-        JS('void', '#.constructor = CanvasPixelArray', data);
-        // This TypedArray property is missing from CanvasPixelArray.
-        JS('void', '#.BYTES_PER_ELEMENT = 1', data);
-      }
-    }
-
-    return nativeImageData;
-  }
-
-  // On Firefox the above test fails because [nativeImageData] is a plain
-  // object.  So we create a _TypedImageData.
-
-  return new _TypedImageData(
-      JS('NativeUint8ClampedList', '#.data', nativeImageData),
-      JS('var', '#.height', nativeImageData),
-      JS('var', '#.width', nativeImageData));
-}
-
-// We can get rid of this conversion if _TypedImageData implements the fields
-// with native names.
-convertDartToNative_ImageData(ImageData imageData) {
-  if (imageData is _TypedImageData) {
-    return JS('', '{data: #, height: #, width: #}', imageData.data,
-        imageData.height, imageData.width);
-  }
-  return imageData;
-}
diff --git a/sdk_nnbd/lib/html/html_common/conversions_dart2js.dart b/sdk_nnbd/lib/html/html_common/conversions_dart2js.dart
deleted file mode 100644
index c1fb0be..0000000
--- a/sdk_nnbd/lib/html/html_common/conversions_dart2js.dart
+++ /dev/null
@@ -1,110 +0,0 @@
-part of html_common;
-
-/// Converts a JavaScript object with properties into a Dart Map.
-/// Not suitable for nested objects.
-Map<String, dynamic>? convertNativeToDart_Dictionary(object) {
-  if (object == null) return null;
-  var dict = <String, dynamic>{};
-  var keys = JS<JSExtendableArray>(
-      'JSExtendableArray', 'Object.getOwnPropertyNames(#)', object);
-  for (final key in keys) {
-    dict[key] = JS('var', '#[#]', object, key);
-  }
-  return dict;
-}
-
-/// Converts a flat Dart map into a JavaScript object with properties.
-convertDartToNative_Dictionary(Map? dict, [void postCreate(Object? f)?]) {
-  if (dict == null) return null;
-  var object = JS('var', '{}');
-  if (postCreate != null) {
-    postCreate(object);
-  }
-  dict.forEach((key, value) {
-    JS('void', '#[#] = #', object, key, value);
-  });
-  return object;
-}
-
-/**
- * Ensures that the input is a JavaScript Array.
- *
- * Creates a new JavaScript array if necessary, otherwise returns the original.
- */
-List convertDartToNative_StringArray(List<String> input) {
-  // TODO(sra).  Implement this.
-  return input;
-}
-
-DateTime convertNativeToDart_DateTime(date) {
-  int millisSinceEpoch = JS('int', '#.getTime()', date);
-  return new DateTime.fromMillisecondsSinceEpoch(millisSinceEpoch, isUtc: true);
-}
-
-convertDartToNative_DateTime(DateTime date) {
-  return JS('', 'new Date(#)', date.millisecondsSinceEpoch);
-}
-
-convertDartToNative_PrepareForStructuredClone(value) =>
-    new _StructuredCloneDart2Js()
-        .convertDartToNative_PrepareForStructuredClone(value);
-
-convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) =>
-    new _AcceptStructuredCloneDart2Js()
-        .convertNativeToDart_AcceptStructuredClone(object, mustCopy: mustCopy);
-
-class _StructuredCloneDart2Js extends _StructuredClone {
-  JSObject newJsObject() => JS('JSObject', '{}');
-
-  void forEachObjectKey(object, action(key, value)) {
-    for (final key
-        in JS('returns:JSExtendableArray;new:true', 'Object.keys(#)', object)) {
-      action(key, JS('var', '#[#]', object, key));
-    }
-  }
-
-  void putIntoObject(object, key, value) =>
-      JS('void', '#[#] = #', object, key, value);
-
-  newJsMap() => JS('var', '{}');
-  putIntoMap(map, key, value) => JS('void', '#[#] = #', map, key, value);
-  newJsList(length) => JS('JSExtendableArray', 'new Array(#)', length);
-  cloneNotRequired(e) =>
-      (e is NativeByteBuffer || e is NativeTypedData || e is MessagePort);
-}
-
-class _AcceptStructuredCloneDart2Js extends _AcceptStructuredClone {
-  List newJsList(length) => JS('JSExtendableArray', 'new Array(#)', length);
-  List newDartList(length) => newJsList(length);
-  bool identicalInJs(a, b) => identical(a, b);
-
-  void forEachJsField(object, action(key, value)) {
-    for (final key in JS('JSExtendableArray', 'Object.keys(#)', object)) {
-      action(key, JS('var', '#[#]', object, key));
-    }
-  }
-}
-
-bool isJavaScriptDate(value) => JS('bool', '# instanceof Date', value);
-bool isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value);
-bool isJavaScriptArray(value) => JS('bool', '# instanceof Array', value);
-bool isJavaScriptSimpleObject(value) {
-  var proto = JS('', 'Object.getPrototypeOf(#)', value);
-  return JS('bool', '# === Object.prototype', proto) ||
-      JS('bool', '# === null', proto);
-}
-
-bool isImmutableJavaScriptArray(value) =>
-    JS('bool', r'!!(#.immutable$list)', value);
-bool isJavaScriptPromise(value) =>
-    JS('bool', r'typeof Promise != "undefined" && # instanceof Promise', value);
-
-const String _serializedScriptValue = 'num|String|bool|'
-    'JSExtendableArray|=Object|'
-    'Blob|File|NativeByteBuffer|NativeTypedData|MessagePort'
-    // TODO(sra): Add Date, RegExp.
-    ;
-const annotation_Creates_SerializedScriptValue =
-    const Creates(_serializedScriptValue);
-const annotation_Returns_SerializedScriptValue =
-    const Returns(_serializedScriptValue);
diff --git a/sdk_nnbd/lib/html/html_common/css_class_set.dart b/sdk_nnbd/lib/html/html_common/css_class_set.dart
deleted file mode 100644
index ff15a4d..0000000
--- a/sdk_nnbd/lib/html/html_common/css_class_set.dart
+++ /dev/null
@@ -1,242 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of html_common;
-
-abstract class CssClassSetImpl extends SetBase<String> implements CssClassSet {
-  static final RegExp _validTokenRE = new RegExp(r'^\S+$');
-
-  String _validateToken(String value) {
-    if (_validTokenRE.hasMatch(value)) return value;
-    throw new ArgumentError.value(value, 'value', 'Not a valid class token');
-  }
-
-  String toString() {
-    return readClasses().join(' ');
-  }
-
-  /**
-   * Adds the class [value] to the element if it is not on it, removes it if it
-   * is.
-   *
-   * If [shouldAdd] is true, then we always add that [value] to the element. If
-   * [shouldAdd] is false then we always remove [value] from the element.
-   */
-  bool toggle(String value, [bool? shouldAdd]) {
-    _validateToken(value);
-    Set<String> s = readClasses();
-    bool result = false;
-    if (shouldAdd == null) shouldAdd = !s.contains(value);
-    if (shouldAdd) {
-      s.add(value);
-      result = true;
-    } else {
-      s.remove(value);
-    }
-    writeClasses(s);
-    return result;
-  }
-
-  /**
-   * Returns [:true:] if classes cannot be added or removed from this
-   * [:CssClassSet:].
-   */
-  bool get frozen => false;
-
-  // interface Iterable - BEGIN
-  Iterator<String> get iterator => readClasses().iterator;
-  // interface Iterable - END
-
-  // interface Collection - BEGIN
-  void forEach(void f(String element)) {
-    readClasses().forEach(f);
-  }
-
-  String join([String separator = ""]) => readClasses().join(separator);
-
-  Iterable<T> map<T>(T f(String e)) => readClasses().map<T>(f);
-
-  Iterable<String> where(bool f(String element)) => readClasses().where(f);
-
-  Iterable<T> expand<T>(Iterable<T> f(String element)) =>
-      readClasses().expand<T>(f);
-
-  bool every(bool f(String element)) => readClasses().every(f);
-
-  bool any(bool f(String element)) => readClasses().any(f);
-
-  bool get isEmpty => readClasses().isEmpty;
-
-  bool get isNotEmpty => readClasses().isNotEmpty;
-
-  int get length => readClasses().length;
-
-  String reduce(String combine(String value, String element)) {
-    return readClasses().reduce(combine);
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, String element)) {
-    return readClasses().fold<T>(initialValue, combine);
-  }
-
-  // interface Collection - END
-
-  // interface Set - BEGIN
-  /**
-   * Determine if this element contains the class [value].
-   *
-   * This is the Dart equivalent of jQuery's
-   * [hasClass](http://api.jquery.com/hasClass/).
-   */
-  bool contains(Object? value) {
-    if (value is! String) return false;
-    _validateToken(value);
-    return readClasses().contains(value);
-  }
-
-  /** Lookup from the Set interface. Not interesting for a String set. */
-  String? lookup(Object? value) => contains(value) ? value as String : null;
-
-  /**
-   * Add the class [value] to element.
-   *
-   * This is the Dart equivalent of jQuery's
-   * [addClass](http://api.jquery.com/addClass/).
-   */
-  bool add(String value) {
-    _validateToken(value);
-    // TODO - figure out if we need to do any validation here
-    // or if the browser natively does enough.
-    return modify((s) => s.add(value)) ?? false;
-  }
-
-  /**
-   * Remove the class [value] from element, and return true on successful
-   * removal.
-   *
-   * This is the Dart equivalent of jQuery's
-   * [removeClass](http://api.jquery.com/removeClass/).
-   */
-  bool remove(Object? value) {
-    if (value is! String) return false;
-    _validateToken(value);
-    Set<String> s = readClasses();
-    bool result = s.remove(value);
-    writeClasses(s);
-    return result;
-  }
-
-  /**
-   * Add all classes specified in [iterable] to element.
-   *
-   * This is the Dart equivalent of jQuery's
-   * [addClass](http://api.jquery.com/addClass/).
-   */
-  void addAll(Iterable<String> iterable) {
-    // TODO - see comment above about validation.
-    modify((s) => s.addAll(iterable.map(_validateToken)));
-  }
-
-  /**
-   * Remove all classes specified in [iterable] from element.
-   *
-   * This is the Dart equivalent of jQuery's
-   * [removeClass](http://api.jquery.com/removeClass/).
-   */
-  void removeAll(Iterable<Object?> iterable) {
-    modify((s) => s.removeAll(iterable));
-  }
-
-  /**
-   * Toggles all classes specified in [iterable] on element.
-   *
-   * Iterate through [iterable]'s items, and add it if it is not on it, or
-   * remove it if it is. This is the Dart equivalent of jQuery's
-   * [toggleClass](http://api.jquery.com/toggleClass/).
-   * If [shouldAdd] is true, then we always add all the classes in [iterable]
-   * element. If [shouldAdd] is false then we always remove all the classes in
-   * [iterable] from the element.
-   */
-  void toggleAll(Iterable<String> iterable, [bool? shouldAdd]) {
-    iterable.forEach((e) => toggle(e, shouldAdd));
-  }
-
-  void retainAll(Iterable<Object?> iterable) {
-    modify((s) => s.retainAll(iterable));
-  }
-
-  void removeWhere(bool test(String name)) {
-    modify((s) => s.removeWhere(test));
-  }
-
-  void retainWhere(bool test(String name)) {
-    modify((s) => s.retainWhere(test));
-  }
-
-  bool containsAll(Iterable<Object?> collection) =>
-      readClasses().containsAll(collection);
-
-  Set<String> intersection(Set<Object?> other) =>
-      readClasses().intersection(other);
-
-  Set<String> union(Set<String> other) => readClasses().union(other);
-
-  Set<String> difference(Set<Object?> other) => readClasses().difference(other);
-
-  String get first => readClasses().first;
-  String get last => readClasses().last;
-  String get single => readClasses().single;
-  List<String> toList({bool growable: true}) =>
-      readClasses().toList(growable: growable);
-  Set<String> toSet() => readClasses().toSet();
-  Iterable<String> take(int n) => readClasses().take(n);
-  Iterable<String> takeWhile(bool test(String value)) =>
-      readClasses().takeWhile(test);
-  Iterable<String> skip(int n) => readClasses().skip(n);
-  Iterable<String> skipWhile(bool test(String value)) =>
-      readClasses().skipWhile(test);
-  String firstWhere(bool test(String value), {String orElse()?}) =>
-      readClasses().firstWhere(test, orElse: orElse);
-  String lastWhere(bool test(String value), {String orElse()?}) =>
-      readClasses().lastWhere(test, orElse: orElse);
-  String singleWhere(bool test(String value), {String orElse()?}) =>
-      readClasses().singleWhere(test, orElse: orElse);
-  String elementAt(int index) => readClasses().elementAt(index);
-
-  void clear() {
-    // TODO(sra): Do this without reading the classes.
-    modify((s) => s.clear());
-  }
-  // interface Set - END
-
-  /**
-   * Helper method used to modify the set of css classes on this element.
-   *
-   *   f - callback with:
-   *   s - a Set of all the css class name currently on this element.
-   *
-   *   After f returns, the modified set is written to the
-   *       className property of this element.
-   */
-  modify(f(Set<String> s)) {
-    Set<String> s = readClasses();
-    var ret = f(s);
-    writeClasses(s);
-    return ret;
-  }
-
-  /**
-   * Read the class names from the Element class property,
-   * and put them into a set (duplicates are discarded).
-   * This is intended to be overridden by specific implementations.
-   */
-  Set<String> readClasses();
-
-  /**
-   * Join all the elements of a set into one string and write
-   * back to the element.
-   * This is intended to be overridden by specific implementations.
-   */
-  void writeClasses(Set<String> s);
-}
diff --git a/sdk_nnbd/lib/html/html_common/device.dart b/sdk_nnbd/lib/html/html_common/device.dart
deleted file mode 100644
index 57c37e6..0000000
--- a/sdk_nnbd/lib/html/html_common/device.dart
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of html_common;
-
-/**
- * Utils for device detection.
- */
-class Device {
-  /**
-   * Gets the browser's user agent. Using this function allows tests to inject
-   * the user agent.
- * Returns the user agent.
-   */
-  static String get userAgent => window.navigator.userAgent;
-
-  /**
-   * Determines if the current device is running Opera.
-   */
-  static final bool isOpera = userAgent.contains("Opera", 0);
-
-  /**
-   * Determines if the current device is running Internet Explorer.
-   */
-  static final bool isIE = !isOpera && userAgent.contains("Trident/", 0);
-
-  /**
-   * Determines if the current device is running Firefox.
-   */
-  static final bool isFirefox = userAgent.contains("Firefox", 0);
-
-  /**
-   * Determines if the current device is running WebKit.
-   */
-  static final bool isWebKit = !isOpera && userAgent.contains("WebKit", 0);
-
-  /**
-   * Gets the CSS property prefix for the current platform.
-   */
-  static final String cssPrefix = '-${propertyPrefix}-';
-
-  /**
-   * Prefix as used for JS property names.
-   */
-  static final String propertyPrefix =
-      isFirefox ? 'moz' : (isIE ? 'ms' : (isOpera ? 'o' : 'webkit'));
-
-  /**
-   * Checks to see if the event class is supported by the current platform.
-   */
-  static bool isEventTypeSupported(String eventType) {
-    // Browsers throw for unsupported event names.
-    try {
-      var e = new Event.eventType(eventType, '');
-      return e is Event;
-    } catch (_) {}
-    return false;
-  }
-}
diff --git a/sdk_nnbd/lib/html/html_common/filtered_element_list.dart b/sdk_nnbd/lib/html/html_common/filtered_element_list.dart
deleted file mode 100644
index 8bedca4..0000000
--- a/sdk_nnbd/lib/html/html_common/filtered_element_list.dart
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of html_common;
-
-/**
- * An indexable collection of a node's direct descendants in the document tree,
- * filtered so that only elements are in the collection.
- */
-class FilteredElementList extends ListBase<Element> implements NodeListWrapper {
-  final Node _node;
-  final List<Node> _childNodes;
-
-  /**
-   * Creates a collection of the elements that descend from a node.
-   *
-   * Example usage:
-   *
-   *     var filteredElements = new FilteredElementList(query("#container"));
-   *     // filteredElements is [a, b, c].
-   */
-  FilteredElementList(Node node)
-      : _childNodes = node.nodes,
-        _node = node;
-
-  // We can't memoize this, since it's possible that children will be messed
-  // with externally to this class.
-  Iterable<Element> get _iterable =>
-      _childNodes.where((n) => n is Element).map<Element>((n) => n as Element);
-  List<Element> get _filtered =>
-      new List<Element>.from(_iterable, growable: false);
-
-  void forEach(void f(Element element)) {
-    // This cannot use the iterator, because operations during iteration might
-    // modify the collection, e.g. addAll might append a node to another parent.
-    _filtered.forEach(f);
-  }
-
-  void operator []=(int index, Element value) {
-    this[index].replaceWith(value);
-  }
-
-  set length(int newLength) {
-    final len = this.length;
-    if (newLength >= len) {
-      return;
-    } else if (newLength < 0) {
-      throw new ArgumentError("Invalid list length");
-    }
-
-    removeRange(newLength, len);
-  }
-
-  void add(Element value) {
-    _childNodes.add(value);
-  }
-
-  void addAll(Iterable<Element> iterable) {
-    for (Element element in iterable) {
-      add(element);
-    }
-  }
-
-  bool contains(Object? needle) {
-    if (needle is! Element) return false;
-    Element element = needle;
-    return element.parentNode == _node;
-  }
-
-  Iterable<Element> get reversed => _filtered.reversed;
-
-  void sort([int compare(Element a, Element b)?]) {
-    throw new UnsupportedError('Cannot sort filtered list');
-  }
-
-  void setRange(int start, int end, Iterable<Element> iterable,
-      [int skipCount = 0]) {
-    throw new UnsupportedError('Cannot setRange on filtered list');
-  }
-
-  void fillRange(int start, int end, [Element? fillValue]) {
-    throw new UnsupportedError('Cannot fillRange on filtered list');
-  }
-
-  void replaceRange(int start, int end, Iterable<Element> iterable) {
-    throw new UnsupportedError('Cannot replaceRange on filtered list');
-  }
-
-  void removeRange(int start, int end) {
-    new List.from(_iterable.skip(start).take(end - start))
-        .forEach((el) => el.remove());
-  }
-
-  void clear() {
-    // Currently, ElementList#clear clears even non-element nodes, so we follow
-    // that behavior.
-    _childNodes.clear();
-  }
-
-  Element removeLast() {
-    final result = _iterable.last;
-    if (result != null) {
-      result.remove();
-    }
-    return result;
-  }
-
-  void insert(int index, Element value) {
-    if (index == length) {
-      add(value);
-    } else {
-      var element = _iterable.elementAt(index);
-      element.parentNode!.insertBefore(value, element);
-    }
-  }
-
-  void insertAll(int index, Iterable<Element> iterable) {
-    if (index == length) {
-      addAll(iterable);
-    } else {
-      var element = _iterable.elementAt(index);
-      element.parentNode!.insertAllBefore(iterable, element);
-    }
-  }
-
-  Element removeAt(int index) {
-    final result = this[index];
-    result.remove();
-    return result;
-  }
-
-  bool remove(Object? element) {
-    if (element is! Element) return false;
-    if (contains(element)) {
-      (element as Element).remove(); // Placate the type checker
-      return true;
-    } else {
-      return false;
-    }
-  }
-
-  int get length => _iterable.length;
-  Element operator [](int index) => _iterable.elementAt(index);
-  // This cannot use the iterator, because operations during iteration might
-  // modify the collection, e.g. addAll might append a node to another parent.
-  Iterator<Element> get iterator => _filtered.iterator;
-
-  List<Node> get rawList => _node.childNodes;
-}
diff --git a/sdk_nnbd/lib/html/html_common/html_common.dart b/sdk_nnbd/lib/html/html_common/html_common.dart
deleted file mode 100644
index 1fb9d52..0000000
--- a/sdk_nnbd/lib/html/html_common/html_common.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// 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.
-
-library html_common;
-
-import 'dart:async';
-import 'dart:collection';
-import 'dart:html';
-import 'dart:js' as js;
-import 'dart:_internal' show WhereIterable;
-import 'dart:nativewrappers';
-import 'dart:typed_data';
-import 'dart:web_gl' as gl;
-
-import 'dart:_js_helper';
-
-import 'dart:_metadata';
-export 'dart:_metadata';
-
-part 'css_class_set.dart';
-part 'device.dart';
-part 'filtered_element_list.dart';
-part 'lists.dart';
-part 'conversions.dart';
diff --git a/sdk_nnbd/lib/html/html_common/html_common_dart2js.dart b/sdk_nnbd/lib/html/html_common/html_common_dart2js.dart
deleted file mode 100644
index 3df2ccf..0000000
--- a/sdk_nnbd/lib/html/html_common/html_common_dart2js.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library html_common;
-
-import 'dart:async';
-import 'dart:collection';
-import 'dart:html';
-import 'dart:_internal' show WhereIterable;
-import 'dart:web_gl' as gl;
-import 'dart:typed_data';
-import 'dart:_native_typed_data';
-import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show Interceptor, JSExtendableArray, JSObject;
-
-import 'dart:js_util' show promiseToFuture;
-export 'dart:js_util' show promiseToFuture;
-
-import 'dart:_metadata';
-export 'dart:_metadata';
-
-part 'css_class_set.dart';
-part 'conversions.dart';
-part 'conversions_dart2js.dart';
-part 'device.dart';
-part 'filtered_element_list.dart';
-part 'lists.dart';
diff --git a/sdk_nnbd/lib/html/html_common/lists.dart b/sdk_nnbd/lib/html/html_common/lists.dart
deleted file mode 100644
index c7abc41..0000000
--- a/sdk_nnbd/lib/html/html_common/lists.dart
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of html_common;
-
-class Lists {
-  /**
-   * Returns the index in the array [a] of the given [element], starting
-   * the search at index [startIndex] to [endIndex] (exclusive).
-   * Returns -1 if [element] is not found.
-   */
-  static int indexOf(List a, Object element, int startIndex, int endIndex) {
-    if (startIndex >= a.length) {
-      return -1;
-    }
-    if (startIndex < 0) {
-      startIndex = 0;
-    }
-    for (int i = startIndex; i < endIndex; i++) {
-      if (a[i] == element) {
-        return i;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * Returns the last index in the array [a] of the given [element], starting
-   * the search at index [startIndex] to 0.
-   * Returns -1 if [element] is not found.
-   */
-  static int lastIndexOf(List a, Object element, int startIndex) {
-    if (startIndex < 0) {
-      return -1;
-    }
-    if (startIndex >= a.length) {
-      startIndex = a.length - 1;
-    }
-    for (int i = startIndex; i >= 0; i--) {
-      if (a[i] == element) {
-        return i;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * Returns a sub list copy of this list, from [start] to
-   * [end] ([end] not inclusive).
-   * Returns an empty list if [length] is 0.
-   * It is an error if indices are not valid for the list, or
-   * if [end] is before [start].
-   */
-  static List getRange(List a, int start, int end, List accumulator) {
-    if (start < 0) throw new RangeError.value(start);
-    if (end < start) throw new RangeError.value(end);
-    if (end > a.length) throw new RangeError.value(end);
-    for (int i = start; i < end; i++) {
-      accumulator.add(a[i]);
-    }
-    return accumulator;
-  }
-}
-
-/**
- * For accessing underlying node lists, for dart:js interop.
- */
-abstract class NodeListWrapper {
-  List<Node> get rawList;
-}
diff --git a/sdk_nnbd/lib/html/html_common/metadata.dart b/sdk_nnbd/lib/html/html_common/metadata.dart
deleted file mode 100644
index 8e2f616..0000000
--- a/sdk_nnbd/lib/html/html_common/metadata.dart
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library metadata;
-
-/**
- * An annotation used to mark a feature as only being supported by a subset
- * of the browsers that Dart supports by default.
- *
- * If an API is not annotated with [SupportedBrowser] then it is assumed to
- * work on all browsers Dart supports.
- */
-class SupportedBrowser {
-  static const String CHROME = "Chrome";
-  static const String FIREFOX = "Firefox";
-  static const String IE = "Internet Explorer";
-  static const String OPERA = "Opera";
-  static const String SAFARI = "Safari";
-
-  /// The name of the browser.
-  final String browserName;
-
-  /// The minimum version of the browser that supports the feature, or null
-  /// if supported on all versions.
-  final String? minimumVersion;
-
-  const SupportedBrowser(this.browserName, [this.minimumVersion]);
-}
-
-/**
- * An annotation used to mark an API as being experimental.
- *
- * An API is considered to be experimental if it is still going through the
- * process of stabilizing and is subject to change or removal.
- *
- * See also:
- *
- * * [W3C recommendation](http://en.wikipedia.org/wiki/W3C_recommendation)
- */
-class Experimental {
-  const Experimental();
-}
-
-/**
- * Annotation that specifies that a member is editable through generate files.
- *
- * This is used for API generation.
- *
- * [name] should be formatted as `interface.member`.
- */
-class DomName {
-  final String name;
-  const DomName(this.name);
-}
-
-/**
- * Metadata that specifies that that member is editable through generated
- * files.
- */
-class DocsEditable {
-  const DocsEditable();
-}
-
-/**
- * Annotation that indicates that an API is not expected to change but has
- * not undergone enough testing to be considered stable.
- */
-class Unstable {
-  const Unstable();
-}
diff --git a/sdk_nnbd/lib/html/html_sources.gni b/sdk_nnbd/lib/html/html_sources.gni
deleted file mode 100644
index 524b6dd..0000000
--- a/sdk_nnbd/lib/html/html_sources.gni
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-html_sdk_sources = [ "dart2js/html_dart2js.dart" ]
diff --git a/sdk_nnbd/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk_nnbd/lib/indexed_db/dart2js/indexed_db_dart2js.dart
deleted file mode 100644
index 4cb159b..0000000
--- a/sdk_nnbd/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ /dev/null
@@ -1,1299 +0,0 @@
-/**
- * A client-side key-value store with support for indexes.
- *
- * Many browsers support IndexedDB&mdash;a web standard for
- * an indexed database.
- * By storing data on the client in an IndexedDB,
- * a web app gets some advantages, such as faster performance and persistence.
- * To find out which browsers support IndexedDB,
- * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb)
- *
- * In IndexedDB, each record is identified by a unique index or key,
- * making data retrieval speedy.
- * You can store structured data,
- * such as images, arrays, and maps using IndexedDB.
- * The standard does not specify size limits for individual data items
- * or for the database itself, but browsers may impose storage limits.
- *
- * ## Using indexed_db
- *
- * The classes in this library provide an interface
- * to the browser's IndexedDB, if it has one.
- * To use this library in your code:
- *
- *     import 'dart:indexed_db';
- *
- * A web app can determine if the browser supports
- * IndexedDB with [IdbFactory.supported]:
- *
- *     if (IdbFactory.supported)
- *       // Use indexeddb.
- *     else
- *       // Find an alternative.
- *
- * Access to the browser's IndexedDB is provided by the app's top-level
- * [Window] object, which your code can refer to with `window.indexedDB`.
- * So, for example,
- * here's how to use window.indexedDB to open a database:
- *
- *     Future open() {
- *       return window.indexedDB.open('myIndexedDB',
- *           version: 1,
- *           onUpgradeNeeded: _initializeDatabase)
- *         .then(_loadFromDB);
- *     }
- *     void _initializeDatabase(VersionChangeEvent e) {
- *       ...
- *     }
- *     Future _loadFromDB(Database db) {
- *       ...
- *     }
- *
- *
- * All data in an IndexedDB is stored within an [ObjectStore].
- * To manipulate the database use [Transaction]s.
- *
- * ## Other resources
- *
- * Other options for client-side data storage include:
- *
- * * [Window.localStorage]&mdash;a
- * basic mechanism that stores data as a [Map],
- * and where both the keys and the values are strings.
- *
- * * [dart:web_sql]&mdash;a database that can be queried with SQL.
- * 
- * For a tutorial about using the indexed_db library with Dart,
- * check out
- * [Use IndexedDB](http://www.dartlang.org/docs/tutorials/indexeddb/).
- *
- * MDN provides [API
- * documentation](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API).
- *
- * {@category Web}
- */
-library dart.dom.indexed_db;
-
-import 'dart:async';
-import 'dart:html';
-import 'dart:html_common';
-import 'dart:_native_typed_data';
-import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, Returns, JSName, Native;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show Interceptor, JSExtendableArray;
-import 'dart:_js_helper' show convertDartClosureToJS;
-// Copyright (c) 2012, 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.
-
-// DO NOT EDIT - unless you are editing documentation as per:
-// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
-// Auto-generated dart:svg library.
-
-class _KeyRangeFactoryProvider {
-  static KeyRange createKeyRange_only(/*Key*/ value) =>
-      _only(_class(), _translateKey(value));
-
-  static KeyRange createKeyRange_lowerBound(
-          /*Key*/ bound,
-          [bool open = false]) =>
-      _lowerBound(_class(), _translateKey(bound), open);
-
-  static KeyRange createKeyRange_upperBound(
-          /*Key*/ bound,
-          [bool open = false]) =>
-      _upperBound(_class(), _translateKey(bound), open);
-
-  static KeyRange createKeyRange_bound(/*Key*/ lower, /*Key*/ upper,
-          [bool lowerOpen = false, bool upperOpen = false]) =>
-      _bound(_class(), _translateKey(lower), _translateKey(upper), lowerOpen,
-          upperOpen);
-
-  static var _cachedClass;
-
-  static _class() {
-    if (_cachedClass != null) return _cachedClass;
-    return _cachedClass = _uncachedClass();
-  }
-
-  static _uncachedClass() =>
-      JS('var', '''window.webkitIDBKeyRange || window.mozIDBKeyRange ||
-          window.msIDBKeyRange || window.IDBKeyRange''');
-
-  static _translateKey(idbkey) => idbkey; // TODO: fixme.
-
-  static KeyRange _only(cls, value) => JS('KeyRange', '#.only(#)', cls, value);
-
-  static KeyRange _lowerBound(cls, bound, open) =>
-      JS('KeyRange', '#.lowerBound(#, #)', cls, bound, open);
-
-  static KeyRange _upperBound(cls, bound, open) =>
-      JS('KeyRange', '#.upperBound(#, #)', cls, bound, open);
-
-  static KeyRange _bound(cls, lower, upper, lowerOpen, upperOpen) => JS(
-      'KeyRange',
-      '#.bound(#, #, #, #)',
-      cls,
-      lower,
-      upper,
-      lowerOpen,
-      upperOpen);
-}
-
-// Conversions for IDBKey.
-//
-// Per http://www.w3.org/TR/IndexedDB/#key-construct
-//
-// "A value is said to be a valid key if it is one of the following types: Array
-// JavaScript objects [ECMA-262], DOMString [WEBIDL], Date [ECMA-262] or float
-// [WEBIDL]. However Arrays are only valid keys if every item in the array is
-// defined and is a valid key (i.e. sparse arrays can not be valid keys) and if
-// the Array doesn't directly or indirectly contain itself. Any non-numeric
-// properties are ignored, and thus does not affect whether the Array is a valid
-// key. Additionally, if the value is of type float, it is only a valid key if
-// it is not NaN, and if the value is of type Date it is only a valid key if its
-// [[PrimitiveValue]] internal property, as defined by [ECMA-262], is not NaN."
-
-// What is required is to ensure that an Lists in the key are actually
-// JavaScript arrays, and any Dates are JavaScript Dates.
-
-/**
- * Converts a native IDBKey into a Dart object.
- *
- * May return the original input.  May mutate the original input (but will be
- * idempotent if mutation occurs).  It is assumed that this conversion happens
- * on native IDBKeys on all paths that return IDBKeys from native DOM calls.
- *
- * If necessary, JavaScript Dates are converted into Dart Dates.
- */
-_convertNativeToDart_IDBKey(nativeKey) {
-  containsDate(object) {
-    if (isJavaScriptDate(object)) return true;
-    if (object is List) {
-      for (int i = 0; i < object.length; i++) {
-        if (containsDate(object[i])) return true;
-      }
-    }
-    return false; // number, string.
-  }
-
-  if (containsDate(nativeKey)) {
-    throw new UnimplementedError('Key containing DateTime');
-  }
-  // TODO: Cache conversion somewhere?
-  return nativeKey;
-}
-
-/**
- * Converts a Dart object into a valid IDBKey.
- *
- * May return the original input.  Does not mutate input.
- *
- * If necessary, [dartKey] may be copied to ensure all lists are converted into
- * JavaScript Arrays and Dart Dates into JavaScript Dates.
- */
-_convertDartToNative_IDBKey(dartKey) {
-  // TODO: Implement.
-  return dartKey;
-}
-
-/// May modify original.  If so, action is idempotent.
-_convertNativeToDart_IDBAny(object) {
-  return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false);
-}
-
-// TODO(sra): Add DateTime.
-const String _idbKey = 'JSExtendableArray|=Object|num|String';
-const _annotation_Creates_IDBKey = const Creates(_idbKey);
-const _annotation_Returns_IDBKey = const Returns(_idbKey);
-// Copyright (c) 2013, 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.
-
-@Unstable()
-@Native("IDBCursor")
-class Cursor extends Interceptor {
-  Future delete() {
-    try {
-      return _completeRequest(_delete());
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future update(value) {
-    try {
-      return _completeRequest(_update(value));
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  @JSName('continue')
-  void next([Object? key]) {
-    if (key == null) {
-      JS('void', '#.continue()', this);
-    } else {
-      JS('void', '#.continue(#)', this, key);
-    }
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory Cursor._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get direction native;
-
-  @_annotation_Creates_IDBKey
-  @_annotation_Returns_IDBKey
-  Object? get key native;
-
-  @_annotation_Creates_IDBKey
-  @_annotation_Returns_IDBKey
-  Object? get primaryKey native;
-
-  @Creates('Null')
-  @Returns('ObjectStore|Index|Null')
-  Object? get source native;
-
-  void advance(int count) native;
-
-  void continuePrimaryKey(Object key, Object primaryKey) native;
-
-  @JSName('delete')
-  Request _delete() native;
-
-  Request _update(/*any*/ value) {
-    var value_1 = convertDartToNative_SerializedScriptValue(value);
-    return _update_1(value_1);
-  }
-
-  @JSName('update')
-  Request _update_1(value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("IDBCursorWithValue")
-class CursorWithValue extends Cursor {
-  // To suppress missing implicit constructor warnings.
-  factory CursorWithValue._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  dynamic get value => _convertNativeToDart_IDBAny(this._get_value);
-  @JSName('value')
-  @annotation_Creates_SerializedScriptValue
-  @annotation_Returns_SerializedScriptValue
-  dynamic get _get_value native;
-}
-// Copyright (c) 2013, 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.
-
-/**
- * An indexed database object for storing client-side data
- * in web apps.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX, '15')
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@Unstable()
-@Native("IDBDatabase")
-class Database extends EventTarget {
-  ObjectStore createObjectStore(String name, {keyPath, bool? autoIncrement}) {
-    var options = {};
-    if (keyPath != null) {
-      options['keyPath'] = keyPath;
-    }
-    if (autoIncrement != null) {
-      options['autoIncrement'] = autoIncrement;
-    }
-
-    return _createObjectStore(name, options);
-  }
-
-  Transaction transaction(storeName_OR_storeNames, String mode) {
-    if (mode != 'readonly' && mode != 'readwrite') {
-      throw new ArgumentError(mode);
-    }
-
-    // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
-    // and copy to JavaScript array if necessary.
-
-    // Try and create a transaction with a string mode.  Browsers that expect a
-    // numeric mode tend to convert the string into a number.  This fails
-    // silently, resulting in zero ('readonly').
-    return _transaction(storeName_OR_storeNames, mode);
-  }
-
-  Transaction transactionStore(String storeName, String mode) {
-    if (mode != 'readonly' && mode != 'readwrite') {
-      throw new ArgumentError(mode);
-    }
-    // Try and create a transaction with a string mode.  Browsers that expect a
-    // numeric mode tend to convert the string into a number.  This fails
-    // silently, resulting in zero ('readonly').
-    return _transaction(storeName, mode);
-  }
-
-  Transaction transactionList(List<String> storeNames, String mode) {
-    if (mode != 'readonly' && mode != 'readwrite') {
-      throw new ArgumentError(mode);
-    }
-    List storeNames_1 = convertDartToNative_StringArray(storeNames);
-    return _transaction(storeNames_1, mode);
-  }
-
-  Transaction transactionStores(DomStringList storeNames, String mode) {
-    if (mode != 'readonly' && mode != 'readwrite') {
-      throw new ArgumentError(mode);
-    }
-    return _transaction(storeNames, mode);
-  }
-
-  @JSName('transaction')
-  Transaction _transaction(stores, mode) native;
-
-  // To suppress missing implicit constructor warnings.
-  factory Database._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `abort` events to event
-   * handlers that are not necessarily instances of [Database].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> abortEvent =
-      const EventStreamProvider<Event>('abort');
-
-  /**
-   * Static factory designed to expose `close` events to event
-   * handlers that are not necessarily instances of [Database].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> closeEvent =
-      const EventStreamProvider<Event>('close');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [Database].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `versionchange` events to event
-   * handlers that are not necessarily instances of [Database].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<VersionChangeEvent> versionChangeEvent =
-      const EventStreamProvider<VersionChangeEvent>('versionchange');
-
-  String get name native;
-
-  @Returns('DomStringList')
-  @Creates('DomStringList')
-  List<String> get objectStoreNames native;
-
-  @Creates('int|String|Null')
-  @Returns('int|String|Null')
-  int get version native;
-
-  void close() native;
-
-  ObjectStore _createObjectStore(String name, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return _createObjectStore_1(name, options_1);
-    }
-    return _createObjectStore_2(name);
-  }
-
-  @JSName('createObjectStore')
-  ObjectStore _createObjectStore_1(name, options) native;
-  @JSName('createObjectStore')
-  ObjectStore _createObjectStore_2(name) native;
-
-  void deleteObjectStore(String name) native;
-
-  /// Stream of `abort` events handled by this [Database].
-  Stream<Event> get onAbort => abortEvent.forTarget(this);
-
-  /// Stream of `close` events handled by this [Database].
-  Stream<Event> get onClose => closeEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [Database].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `versionchange` events handled by this [Database].
-  Stream<VersionChangeEvent> get onVersionChange =>
-      versionChangeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void ObserverCallback(ObserverChanges changes);
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX, '15')
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@Unstable()
-@Native("IDBFactory")
-class IdbFactory extends Interceptor {
-  /**
-   * Checks to see if Indexed DB is supported on the current platform.
-   */
-  static bool get supported {
-    return JS(
-        'bool',
-        '!!(window.indexedDB || '
-            'window.webkitIndexedDB || '
-            'window.mozIndexedDB)');
-  }
-
-  Future<Database> open(String name,
-      {int? version,
-      void onUpgradeNeeded(VersionChangeEvent event)?,
-      void onBlocked(Event event)?}) {
-    if ((version == null) != (onUpgradeNeeded == null)) {
-      return new Future.error(new ArgumentError(
-          'version and onUpgradeNeeded must be specified together'));
-    }
-    try {
-      var request;
-      if (version != null) {
-        request = _open(name, version);
-      } else {
-        request = _open(name);
-      }
-
-      if (onUpgradeNeeded != null) {
-        request.onUpgradeNeeded.listen(onUpgradeNeeded);
-      }
-      if (onBlocked != null) {
-        request.onBlocked.listen(onBlocked);
-      }
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future<IdbFactory> deleteDatabase(String name, {void onBlocked(Event e)?}) {
-    try {
-      var request = _deleteDatabase(name);
-
-      if (onBlocked != null) {
-        request.onBlocked.listen(onBlocked);
-      }
-      var completer = new Completer<IdbFactory>.sync();
-      request.onSuccess.listen((e) {
-        completer.complete(this);
-      });
-      request.onError.listen(completer.completeError);
-      return completer.future;
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  /**
-   * Checks to see if getDatabaseNames is supported by the current platform.
-   * TODO(terry): Should be able to always return false?
-   */
-  bool get supportsDatabaseNames {
-    return supported &&
-        JS('bool', '!!(#.getDatabaseNames || #.webkitGetDatabaseNames)', this,
-            this);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory IdbFactory._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int cmp(Object first, Object second) native;
-
-  @JSName('deleteDatabase')
-  OpenDBRequest _deleteDatabase(String name) native;
-
-  @JSName('open')
-  @Returns('Request')
-  @Creates('Request')
-  @Creates('Database')
-  OpenDBRequest _open(String name, [int? version]) native;
-}
-
-/**
- * Ties a request to a completer, so the completer is completed when it succeeds
- * and errors out when the request errors.
- */
-Future<T> _completeRequest<T>(Request request) {
-  var completer = new Completer<T>.sync();
-  // TODO: make sure that completer.complete is synchronous as transactions
-  // may be committed if the result is not processed immediately.
-  request.onSuccess.listen((e) {
-    T result = request.result;
-    completer.complete(result);
-  });
-  request.onError.listen(completer.completeError);
-  return completer.future;
-}
-// Copyright (c) 2013, 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.
-
-@Unstable()
-@Native("IDBIndex")
-class Index extends Interceptor {
-  Future<int> count([key_OR_range]) {
-    try {
-      var request = _count(key_OR_range);
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future get(key) {
-    try {
-      var request = _get(key);
-
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future getKey(key) {
-    try {
-      var request = _getKey(key);
-
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  /**
-   * Creates a stream of cursors over the records in this object store.
-   *
-   * See also:
-   *
-   * * [ObjectStore.openCursor]
-   */
-  Stream<CursorWithValue> openCursor(
-      {key, KeyRange? range, String? direction, bool? autoAdvance}) {
-    var key_OR_range = null;
-    if (key != null) {
-      if (range != null) {
-        throw new ArgumentError('Cannot specify both key and range.');
-      }
-      key_OR_range = key;
-    } else {
-      key_OR_range = range;
-    }
-    var request;
-    if (direction == null) {
-      // FIXME: Passing in "next" should be unnecessary.
-      request = _openCursor(key_OR_range, "next");
-    } else {
-      request = _openCursor(key_OR_range, direction);
-    }
-    return ObjectStore._cursorStreamFromResult(request, autoAdvance);
-  }
-
-  /**
-   * Creates a stream of cursors over the records in this object store.
-   *
-   * See also:
-   *
-   * * [ObjectStore.openCursor]
-   */
-  Stream<Cursor> openKeyCursor(
-      {key, KeyRange? range, String? direction, bool? autoAdvance}) {
-    var key_OR_range = null;
-    if (key != null) {
-      if (range != null) {
-        throw new ArgumentError('Cannot specify both key and range.');
-      }
-      key_OR_range = key;
-    } else {
-      key_OR_range = range;
-    }
-    var request;
-    if (direction == null) {
-      // FIXME: Passing in "next" should be unnecessary.
-      request = _openKeyCursor(key_OR_range, "next");
-    } else {
-      request = _openKeyCursor(key_OR_range, direction);
-    }
-    return ObjectStore._cursorStreamFromResult(request, autoAdvance);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory Index._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @annotation_Creates_SerializedScriptValue
-  Object? get keyPath native;
-
-  bool get multiEntry native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  ObjectStore get objectStore native;
-
-  bool get unique native;
-
-  @JSName('count')
-  Request _count(Object? key) native;
-
-  @JSName('get')
-  @Returns('Request')
-  @Creates('Request')
-  @annotation_Creates_SerializedScriptValue
-  Request _get(Object key) native;
-
-  Request getAll(Object? query, [int? count]) native;
-
-  Request getAllKeys(Object? query, [int? count]) native;
-
-  @JSName('getKey')
-  @Returns('Request')
-  @Creates('Request')
-  @annotation_Creates_SerializedScriptValue
-  @Creates('ObjectStore')
-  Request _getKey(Object key) native;
-
-  @JSName('openCursor')
-  @Returns('Request')
-  @Creates('Request')
-  @Creates('Cursor')
-  Request _openCursor(Object? range, [String? direction]) native;
-
-  @JSName('openKeyCursor')
-  @Returns('Request')
-  @Creates('Request')
-  @Creates('Cursor')
-  Request _openKeyCursor(Object? range, [String? direction]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("IDBKeyRange")
-class KeyRange extends Interceptor {
-  factory KeyRange.only(/*Key*/ value) =>
-      _KeyRangeFactoryProvider.createKeyRange_only(value);
-
-  factory KeyRange.lowerBound(/*Key*/ bound, [bool open = false]) =>
-      _KeyRangeFactoryProvider.createKeyRange_lowerBound(bound, open);
-
-  factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) =>
-      _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open);
-
-  factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper,
-          [bool lowerOpen = false, bool upperOpen = false]) =>
-      _KeyRangeFactoryProvider.createKeyRange_bound(
-          lower, upper, lowerOpen, upperOpen);
-
-  // To suppress missing implicit constructor warnings.
-  factory KeyRange._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @annotation_Creates_SerializedScriptValue
-  Object? get lower native;
-
-  bool get lowerOpen native;
-
-  @annotation_Creates_SerializedScriptValue
-  Object? get upper native;
-
-  bool get upperOpen native;
-
-  @JSName('bound')
-  static KeyRange bound_(Object lower, Object upper,
-      [bool? lowerOpen, bool? upperOpen]) native;
-
-  bool includes(Object key) native;
-
-  @JSName('lowerBound')
-  static KeyRange lowerBound_(Object bound, [bool? open]) native;
-
-  @JSName('only')
-  static KeyRange only_(Object value) native;
-
-  @JSName('upperBound')
-  static KeyRange upperBound_(Object bound, [bool? open]) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("IDBObjectStore")
-class ObjectStore extends Interceptor {
-  Future add(value, [key]) {
-    try {
-      var request;
-      if (key != null) {
-        request = _add(value, key);
-      } else {
-        request = _add(value);
-      }
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future clear() {
-    try {
-      return _completeRequest(_clear());
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future delete(key_OR_keyRange) {
-    try {
-      return _completeRequest(_delete(key_OR_keyRange));
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future<int> count([key_OR_range]) {
-    try {
-      var request = _count(key_OR_range);
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future put(value, [key]) {
-    try {
-      var request;
-      if (key != null) {
-        request = _put(value, key);
-      } else {
-        request = _put(value);
-      }
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  Future getObject(key) {
-    try {
-      var request = _get(key);
-
-      return _completeRequest(request);
-    } catch (e, stacktrace) {
-      return new Future.error(e, stacktrace);
-    }
-  }
-
-  /**
-   * Creates a stream of cursors over the records in this object store.
-   *
-   * **The stream must be manually advanced by calling [Cursor.next] after
-   * each item or by specifying autoAdvance to be true.**
-   *
-   *     var cursors = objectStore.openCursor().listen(
-   *       (cursor) {
-   *         // ...some processing with the cursor
-   *         cursor.next(); // advance onto the next cursor.
-   *       },
-   *       onDone: () {
-   *         // called when there are no more cursors.
-   *         print('all done!');
-   *       });
-   *
-   * Asynchronous operations which are not related to the current transaction
-   * will cause the transaction to automatically be committed-- all processing
-   * must be done synchronously unless they are additional async requests to
-   * the current transaction.
-   */
-  Stream<CursorWithValue> openCursor(
-      {key, KeyRange? range, String? direction, bool? autoAdvance}) {
-    var key_OR_range = null;
-    if (key != null) {
-      if (range != null) {
-        throw new ArgumentError('Cannot specify both key and range.');
-      }
-      key_OR_range = key;
-    } else {
-      key_OR_range = range;
-    }
-
-    // TODO: try/catch this and return a stream with an immediate error.
-    var request;
-    if (direction == null) {
-      request = _openCursor(key_OR_range);
-    } else {
-      request = _openCursor(key_OR_range, direction);
-    }
-    return _cursorStreamFromResult(request, autoAdvance);
-  }
-
-  Index createIndex(String name, keyPath, {bool? unique, bool? multiEntry}) {
-    var options = {};
-    if (unique != null) {
-      options['unique'] = unique;
-    }
-    if (multiEntry != null) {
-      options['multiEntry'] = multiEntry;
-    }
-
-    return _createIndex(name, keyPath, options);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory ObjectStore._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get autoIncrement native;
-
-  @Returns('DomStringList')
-  @Creates('DomStringList')
-  List<String> get indexNames native;
-
-  @annotation_Creates_SerializedScriptValue
-  Object? get keyPath native;
-
-  String get name native;
-
-  set name(String value) native;
-
-  Transaction get transaction native;
-
-  @Returns('Request')
-  @Creates('Request')
-  @_annotation_Creates_IDBKey
-  Request _add(/*any*/ value, [/*any*/ key]) {
-    if (key != null) {
-      var value_1 = convertDartToNative_SerializedScriptValue(value);
-      var key_2 = convertDartToNative_SerializedScriptValue(key);
-      return _add_1(value_1, key_2);
-    }
-    var value_1 = convertDartToNative_SerializedScriptValue(value);
-    return _add_2(value_1);
-  }
-
-  @JSName('add')
-  @Returns('Request')
-  @Creates('Request')
-  @_annotation_Creates_IDBKey
-  Request _add_1(value, key) native;
-  @JSName('add')
-  @Returns('Request')
-  @Creates('Request')
-  @_annotation_Creates_IDBKey
-  Request _add_2(value) native;
-
-  @JSName('clear')
-  Request _clear() native;
-
-  @JSName('count')
-  Request _count(Object? key) native;
-
-  Index _createIndex(String name, Object keyPath, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return _createIndex_1(name, keyPath, options_1);
-    }
-    return _createIndex_2(name, keyPath);
-  }
-
-  @JSName('createIndex')
-  Index _createIndex_1(name, keyPath, options) native;
-  @JSName('createIndex')
-  Index _createIndex_2(name, keyPath) native;
-
-  @JSName('delete')
-  Request _delete(Object key) native;
-
-  void deleteIndex(String name) native;
-
-  @JSName('get')
-  @Returns('Request')
-  @Creates('Request')
-  @annotation_Creates_SerializedScriptValue
-  Request _get(Object key) native;
-
-  Request getAll(Object? query, [int? count]) native;
-
-  Request getAllKeys(Object? query, [int? count]) native;
-
-  Request getKey(Object key) native;
-
-  Index index(String name) native;
-
-  @JSName('openCursor')
-  @Returns('Request')
-  @Creates('Request')
-  @Creates('Cursor')
-  Request _openCursor(Object? range, [String? direction]) native;
-
-  Request openKeyCursor(Object? range, [String? direction]) native;
-
-  @Returns('Request')
-  @Creates('Request')
-  @_annotation_Creates_IDBKey
-  Request _put(/*any*/ value, [/*any*/ key]) {
-    if (key != null) {
-      var value_1 = convertDartToNative_SerializedScriptValue(value);
-      var key_2 = convertDartToNative_SerializedScriptValue(key);
-      return _put_1(value_1, key_2);
-    }
-    var value_1 = convertDartToNative_SerializedScriptValue(value);
-    return _put_2(value_1);
-  }
-
-  @JSName('put')
-  @Returns('Request')
-  @Creates('Request')
-  @_annotation_Creates_IDBKey
-  Request _put_1(value, key) native;
-  @JSName('put')
-  @Returns('Request')
-  @Creates('Request')
-  @_annotation_Creates_IDBKey
-  Request _put_2(value) native;
-
-  /**
-   * Helper for iterating over cursors in a request.
-   */
-  static Stream<T> _cursorStreamFromResult<T extends Cursor>(
-      Request request, bool? autoAdvance) {
-    // TODO: need to guarantee that the controller provides the values
-    // immediately as waiting until the next tick will cause the transaction to
-    // close.
-    var controller = new StreamController<T>(sync: true);
-
-    //TODO: Report stacktrace once issue 4061 is resolved.
-    request.onError.listen(controller.addError);
-
-    request.onSuccess.listen((e) {
-      T? cursor = request.result as dynamic;
-      if (cursor == null) {
-        controller.close();
-      } else {
-        controller.add(cursor);
-        if (autoAdvance == true && controller.hasListener) {
-          cursor.next();
-        }
-      }
-    });
-    return controller.stream;
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("IDBObservation")
-class Observation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Observation._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Object? get key native;
-
-  String get type native;
-
-  Object? get value native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("IDBObserver")
-class Observer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Observer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory Observer(ObserverCallback callback) {
-    var callback_1 = convertDartClosureToJS(callback, 1);
-    return Observer._create_1(callback_1);
-  }
-  static Observer _create_1(callback) =>
-      JS('Observer', 'new IDBObserver(#)', callback);
-
-  void observe(Database db, Transaction tx, Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    _observe_1(db, tx, options_1);
-    return;
-  }
-
-  @JSName('observe')
-  void _observe_1(Database db, Transaction tx, options) native;
-
-  void unobserve(Database db) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("IDBObserverChanges")
-class ObserverChanges extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ObserverChanges._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Database get database native;
-
-  Object? get records native;
-
-  Transaction get transaction native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("IDBOpenDBRequest,IDBVersionChangeRequest")
-class OpenDBRequest extends Request {
-  // To suppress missing implicit constructor warnings.
-  factory OpenDBRequest._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `blocked` events to event
-   * handlers that are not necessarily instances of [OpenDBRequest].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> blockedEvent =
-      const EventStreamProvider<Event>('blocked');
-
-  /**
-   * Static factory designed to expose `upgradeneeded` events to event
-   * handlers that are not necessarily instances of [OpenDBRequest].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent =
-      const EventStreamProvider<VersionChangeEvent>('upgradeneeded');
-
-  /// Stream of `blocked` events handled by this [OpenDBRequest].
-  Stream<Event> get onBlocked => blockedEvent.forTarget(this);
-
-  /// Stream of `upgradeneeded` events handled by this [OpenDBRequest].
-  Stream<VersionChangeEvent> get onUpgradeNeeded =>
-      upgradeNeededEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("IDBRequest")
-class Request extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory Request._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [Request].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  /**
-   * Static factory designed to expose `success` events to event
-   * handlers that are not necessarily instances of [Request].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> successEvent =
-      const EventStreamProvider<Event>('success');
-
-  DomException get error native;
-
-  String get readyState native;
-
-  dynamic get result => _convertNativeToDart_IDBAny(this._get_result);
-  @JSName('result')
-  @Creates('Null')
-  dynamic get _get_result native;
-
-  @Creates('Null')
-  Object? get source native;
-
-  Transaction get transaction native;
-
-  /// Stream of `error` events handled by this [Request].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-
-  /// Stream of `success` events handled by this [Request].
-  Stream<Event> get onSuccess => successEvent.forTarget(this);
-}
-// Copyright (c) 2013, 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.
-
-@Unstable()
-@Native("IDBTransaction")
-class Transaction extends EventTarget {
-  /**
-   * Provides a Future which will be completed once the transaction has
-   * completed.
-   *
-   * The future will error if an error occurrs on the transaction or if the
-   * transaction is aborted.
-   */
-  Future<Database> get completed {
-    var completer = new Completer<Database>();
-
-    this.onComplete.first.then((_) {
-      completer.complete(db);
-    });
-
-    this.onError.first.then((e) {
-      completer.completeError(e);
-    });
-
-    this.onAbort.first.then((e) {
-      // Avoid completing twice if an error occurs.
-      if (!completer.isCompleted) {
-        completer.completeError(e);
-      }
-    });
-
-    return completer.future;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory Transaction._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `abort` events to event
-   * handlers that are not necessarily instances of [Transaction].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> abortEvent =
-      const EventStreamProvider<Event>('abort');
-
-  /**
-   * Static factory designed to expose `complete` events to event
-   * handlers that are not necessarily instances of [Transaction].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> completeEvent =
-      const EventStreamProvider<Event>('complete');
-
-  /**
-   * Static factory designed to expose `error` events to event
-   * handlers that are not necessarily instances of [Transaction].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  Database get db native;
-
-  DomException get error native;
-
-  String get mode native;
-
-  @Returns('DomStringList')
-  @Creates('DomStringList')
-  List<String> get objectStoreNames native;
-
-  void abort() native;
-
-  ObjectStore objectStore(String name) native;
-
-  /// Stream of `abort` events handled by this [Transaction].
-  Stream<Event> get onAbort => abortEvent.forTarget(this);
-
-  /// Stream of `complete` events handled by this [Transaction].
-  Stream<Event> get onComplete => completeEvent.forTarget(this);
-
-  /// Stream of `error` events handled by this [Transaction].
-  Stream<Event> get onError => errorEvent.forTarget(this);
-}
-// Copyright (c) 2018, 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.
-
-@Unstable()
-@Native("IDBVersionChangeEvent")
-class VersionChangeEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory VersionChangeEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory VersionChangeEvent(String type, [Map? eventInitDict]) {
-    if (eventInitDict != null) {
-      var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-      return VersionChangeEvent._create_1(type, eventInitDict_1);
-    }
-    return VersionChangeEvent._create_2(type);
-  }
-  static VersionChangeEvent _create_1(type, eventInitDict) => JS(
-      'VersionChangeEvent',
-      'new IDBVersionChangeEvent(#,#)',
-      type,
-      eventInitDict);
-  static VersionChangeEvent _create_2(type) =>
-      JS('VersionChangeEvent', 'new IDBVersionChangeEvent(#)', type);
-
-  String get dataLoss native;
-
-  String get dataLossMessage native;
-
-  @Creates('int|String|Null')
-  @Returns('int|String|Null')
-  int? get newVersion native;
-
-  @Creates('int|String|Null')
-  @Returns('int|String|Null')
-  int get oldVersion native;
-
-  @JSName('target')
-  OpenDBRequest get target native;
-}
diff --git a/sdk_nnbd/lib/internal/async_cast.dart b/sdk_nnbd/lib/internal/async_cast.dart
deleted file mode 100644
index 306ada8..0000000
--- a/sdk_nnbd/lib/internal/async_cast.dart
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._internal;
-
-// Casting wrappers for asynchronous classes.
-
-class CastStream<S, T> extends Stream<T> {
-  final Stream<S> _source;
-  CastStream(this._source);
-  bool get isBroadcast => _source.isBroadcast;
-
-  StreamSubscription<T> listen(void Function(T data)? onData,
-      {Function? onError, void Function()? onDone, bool? cancelOnError}) {
-    return new CastStreamSubscription<S, T>(
-        _source.listen(null, onDone: onDone, cancelOnError: cancelOnError))
-      ..onData(onData)
-      ..onError(onError);
-  }
-
-  Stream<R> cast<R>() => new CastStream<S, R>(_source);
-}
-
-class CastStreamSubscription<S, T> implements StreamSubscription<T> {
-  final StreamSubscription<S> _source;
-
-  /// Zone where listen was called.
-  final Zone _zone = Zone.current;
-
-  /// User's data handler.
-  void Function(T)? _handleData;
-
-  /// Copy of _source's handleError so we can report errors in onData.
-  Function? _handleError;
-
-  CastStreamSubscription(this._source) {
-    _source.onData(_onData);
-  }
-
-  Future cancel() => _source.cancel();
-
-  void onData(void Function(T data)? handleData) {
-    _handleData = handleData == null
-        ? null
-        : _zone.registerUnaryCallback<dynamic, T>(handleData);
-  }
-
-  void onError(Function? handleError) {
-    _source.onError(handleError);
-    if (handleError == null) {
-      _handleError = null;
-    } else if (handleError is void Function(Object, StackTrace)) {
-      _handleError = _zone
-          .registerBinaryCallback<dynamic, Object, StackTrace>(handleError);
-    } else if (handleError is void Function(Object)) {
-      _handleError = _zone.registerUnaryCallback<dynamic, Object>(handleError);
-    } else {
-      throw ArgumentError("handleError callback must take either an Object "
-          "(the error), or both an Object (the error) and a StackTrace.");
-    }
-  }
-
-  void onDone(void handleDone()?) {
-    _source.onDone(handleDone);
-  }
-
-  void _onData(S data) {
-    if (_handleData == null) return;
-    T targetData;
-    try {
-      targetData = data as T;
-    } catch (error, stack) {
-      var handleError = _handleError;
-      if (handleError == null) {
-        _zone.handleUncaughtError(error, stack);
-      } else if (handleError is void Function(Object, StackTrace)) {
-        _zone.runBinaryGuarded<Object, StackTrace>(handleError, error, stack);
-      } else {
-        _zone.runUnaryGuarded<Object>(
-            handleError as void Function(Object), error);
-      }
-      return;
-    }
-    _zone.runUnaryGuarded(_handleData!, targetData);
-  }
-
-  void pause([Future? resumeSignal]) {
-    _source.pause(resumeSignal);
-  }
-
-  void resume() {
-    _source.resume();
-  }
-
-  bool get isPaused => _source.isPaused;
-
-  Future<E> asFuture<E>([E? futureValue]) => _source.asFuture<E>(futureValue);
-}
-
-class CastStreamTransformer<SS, ST, TS, TT>
-    extends StreamTransformerBase<TS, TT> {
-  final StreamTransformer<SS, ST> _source;
-  CastStreamTransformer(this._source);
-
-  StreamTransformer<RS, RT> cast<RS, RT>() =>
-      new CastStreamTransformer<SS, ST, RS, RT>(_source);
-  Stream<TT> bind(Stream<TS> stream) =>
-      _source.bind(stream.cast<SS>()).cast<TT>();
-}
-
-class CastConverter<SS, ST, TS, TT> extends Converter<TS, TT> {
-  final Converter<SS, ST> _source;
-  CastConverter(this._source);
-
-  TT convert(TS input) => _source.convert(input as SS) as TT;
-
-  // cast is inherited from Converter.
-
-  Stream<TT> bind(Stream<TS> stream) =>
-      _source.bind(stream.cast<SS>()).cast<TT>();
-
-  Converter<RS, RT> cast<RS, RT>() =>
-      new CastConverter<SS, ST, RS, RT>(_source);
-}
diff --git a/sdk_nnbd/lib/internal/cast.dart b/sdk_nnbd/lib/internal/cast.dart
deleted file mode 100644
index d99b687..0000000
--- a/sdk_nnbd/lib/internal/cast.dart
+++ /dev/null
@@ -1,363 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart._internal;
-
-// Casting wrappers for collection classes.
-
-abstract class _CastIterableBase<S, T> extends Iterable<T> {
-  Iterable<S> get _source;
-
-  Iterator<T> get iterator => new CastIterator<S, T>(_source.iterator);
-
-  // The following members use the default implementation on the
-  // throwing iterator. These are all operations that have no more efficient
-  // implementation than visiting every element in order,
-  // or that has no more efficient way to get the correct type (toList, toSet).
-  //
-  // * map
-  // * where
-  // * expand
-  // * forEach
-  // * reduce
-  // * fold
-  // * every
-  // * any
-  // * join
-  // * toList
-  // * toSet
-  // * skipWhile
-  // * takeWhile
-  // * firstWhere
-  // * singleWhere
-
-  int get length => _source.length;
-  bool get isEmpty => _source.isEmpty;
-  bool get isNotEmpty => _source.isNotEmpty;
-
-  Iterable<T> skip(int count) => new CastIterable<S, T>(_source.skip(count));
-  Iterable<T> take(int count) => new CastIterable<S, T>(_source.take(count));
-
-  T elementAt(int index) => _source.elementAt(index) as T;
-  T get first => _source.first as T;
-  T get last => _source.last as T;
-  T get single => _source.single as T;
-
-  bool contains(Object? other) => _source.contains(other);
-
-  // Might be implemented by testing backwards from the end,
-  // so use the _source's implementation.
-  T lastWhere(bool test(T element), {T Function()? orElse}) =>
-      _source.lastWhere((S element) => test(element as T),
-          orElse: (orElse == null) ? null : () => orElse() as S) as T;
-
-  String toString() => _source.toString();
-}
-
-class CastIterator<S, T> implements Iterator<T> {
-  Iterator<S> _source;
-  CastIterator(this._source);
-  bool moveNext() => _source.moveNext();
-  T get current => _source.current as T;
-}
-
-class CastIterable<S, T> extends _CastIterableBase<S, T> {
-  final Iterable<S> _source;
-
-  CastIterable._(this._source);
-
-  factory CastIterable(Iterable<S> source) {
-    if (source is EfficientLengthIterable<S>) {
-      return new _EfficientLengthCastIterable<S, T>(source);
-    }
-    return new CastIterable<S, T>._(source);
-  }
-
-  Iterable<R> cast<R>() => new CastIterable<S, R>(_source);
-}
-
-class _EfficientLengthCastIterable<S, T> extends CastIterable<S, T>
-    implements EfficientLengthIterable<T> {
-  _EfficientLengthCastIterable(EfficientLengthIterable<S> source)
-      : super._(source);
-}
-
-abstract class _CastListBase<S, T> extends _CastIterableBase<S, T>
-    with ListMixin<T> {
-  List<S> get _source;
-
-  // Using the default implementation from ListMixin:
-  // * reversed
-  // * shuffle
-  // * indexOf
-  // * lastIndexOf
-  // * clear
-  // * sublist
-  // * asMap
-
-  T operator [](int index) => _source[index] as T;
-
-  void operator []=(int index, T value) {
-    _source[index] = value as S;
-  }
-
-  void set length(int length) {
-    _source.length = length;
-  }
-
-  void add(T value) {
-    _source.add(value as S);
-  }
-
-  void addAll(Iterable<T> values) {
-    _source.addAll(new CastIterable<T, S>(values));
-  }
-
-  void sort([int Function(T v1, T v2)? compare]) {
-    _source.sort(
-        compare == null ? null : (S v1, S v2) => compare(v1 as T, v2 as T));
-  }
-
-  void shuffle([Random? random]) {
-    _source.shuffle(random);
-  }
-
-  void insert(int index, T element) {
-    _source.insert(index, element as S);
-  }
-
-  void insertAll(int index, Iterable<T> elements) {
-    _source.insertAll(index, new CastIterable<T, S>(elements));
-  }
-
-  void setAll(int index, Iterable<T> elements) {
-    _source.setAll(index, new CastIterable<T, S>(elements));
-  }
-
-  bool remove(Object? value) => _source.remove(value);
-
-  T removeAt(int index) => _source.removeAt(index) as T;
-
-  T removeLast() => _source.removeLast() as T;
-
-  void removeWhere(bool test(T element)) {
-    _source.removeWhere((S element) => test(element as T));
-  }
-
-  void retainWhere(bool test(T element)) {
-    _source.retainWhere((S element) => test(element as T));
-  }
-
-  Iterable<T> getRange(int start, int end) =>
-      new CastIterable<S, T>(_source.getRange(start, end));
-
-  void setRange(int start, int end, Iterable<T> iterable, [int skipCount = 0]) {
-    _source.setRange(start, end, new CastIterable<T, S>(iterable), skipCount);
-  }
-
-  void removeRange(int start, int end) {
-    _source.removeRange(start, end);
-  }
-
-  void fillRange(int start, int end, [T? fillValue]) {
-    _source.fillRange(start, end, fillValue as S);
-  }
-
-  void replaceRange(int start, int end, Iterable<T> replacement) {
-    _source.replaceRange(start, end, new CastIterable<T, S>(replacement));
-  }
-}
-
-class CastList<S, T> extends _CastListBase<S, T> {
-  final List<S> _source;
-  CastList(this._source);
-
-  List<R> cast<R>() => new CastList<S, R>(_source);
-}
-
-class CastSet<S, T> extends _CastIterableBase<S, T> implements Set<T> {
-  final Set<S> _source;
-
-  /// Creates a new empty set of the same *kind* as [_source],
-  /// but with `<R>` as type argument.
-  /// Used by [toSet] and [union].
-  final Set<R> Function<R>()? _emptySet;
-
-  CastSet(this._source, this._emptySet);
-
-  static Set<R> _defaultEmptySet<R>() => new Set<R>();
-
-  Set<R> cast<R>() => new CastSet<S, R>(_source, _emptySet);
-  bool add(T value) => _source.add(value as S);
-
-  void addAll(Iterable<T> elements) {
-    _source.addAll(new CastIterable<T, S>(elements));
-  }
-
-  bool remove(Object? object) => _source.remove(object);
-
-  void removeAll(Iterable<Object?> objects) {
-    _source.removeAll(objects);
-  }
-
-  void retainAll(Iterable<Object?> objects) {
-    _source.retainAll(objects);
-  }
-
-  void removeWhere(bool test(T element)) {
-    _source.removeWhere((S element) => test(element as T));
-  }
-
-  void retainWhere(bool test(T element)) {
-    _source.retainWhere((S element) => test(element as T));
-  }
-
-  bool containsAll(Iterable<Object?> objects) => _source.containsAll(objects);
-
-  Set<T> intersection(Set<Object?> other) {
-    if (_emptySet != null) return _conditionalAdd(other, true);
-    return new CastSet<S, T>(_source.intersection(other), null);
-  }
-
-  Set<T> difference(Set<Object?> other) {
-    if (_emptySet != null) return _conditionalAdd(other, false);
-    return new CastSet<S, T>(_source.difference(other), null);
-  }
-
-  Set<T> _conditionalAdd(Set<Object?> other, bool otherContains) {
-    var emptySet = _emptySet;
-    Set<T> result = (emptySet == null) ? new Set<T>() : emptySet<T>();
-    for (var element in _source) {
-      T castElement = element as T;
-      if (otherContains == other.contains(castElement)) result.add(castElement);
-    }
-    return result;
-  }
-
-  Set<T> union(Set<T> other) => _clone()..addAll(other);
-
-  void clear() {
-    _source.clear();
-  }
-
-  Set<T> _clone() {
-    var emptySet = _emptySet;
-    Set<T> result = (emptySet == null) ? new Set<T>() : emptySet<T>();
-    result.addAll(this);
-    return result;
-  }
-
-  Set<T> toSet() => _clone();
-
-  T lookup(Object? key) => _source.lookup(key) as T;
-}
-
-class CastMap<SK, SV, K, V> extends MapBase<K, V> {
-  final Map<SK, SV> _source;
-
-  CastMap(this._source);
-
-  Map<RK, RV> cast<RK, RV>() => new CastMap<SK, SV, RK, RV>(_source);
-
-  bool containsValue(Object? value) => _source.containsValue(value);
-
-  bool containsKey(Object? key) => _source.containsKey(key);
-
-  V? operator [](Object? key) => _source[key] as V?;
-
-  void operator []=(K key, V value) {
-    _source[key as SK] = value as SV;
-  }
-
-  V putIfAbsent(K key, V Function() ifAbsent) =>
-      _source.putIfAbsent(key as SK, () => ifAbsent() as SV) as V;
-
-  void addAll(Map<K, V> other) {
-    _source.addAll(new CastMap<K, V, SK, SV>(other));
-  }
-
-  V remove(Object? key) => _source.remove(key) as V;
-
-  void clear() {
-    _source.clear();
-  }
-
-  void forEach(void f(K key, V value)) {
-    _source.forEach((SK key, SV value) {
-      f(key as K, value as V);
-    });
-  }
-
-  Iterable<K> get keys => new CastIterable<SK, K>(_source.keys);
-
-  Iterable<V> get values => new CastIterable<SV, V>(_source.values);
-
-  int get length => _source.length;
-
-  bool get isEmpty => _source.isEmpty;
-
-  bool get isNotEmpty => _source.isNotEmpty;
-
-  V update(K key, V update(V value), {V Function()? ifAbsent}) {
-    return _source.update(key as SK, (SV value) => update(value as V) as SV,
-        ifAbsent: (ifAbsent == null) ? null : () => ifAbsent() as SV) as V;
-  }
-
-  void updateAll(V update(K key, V value)) {
-    _source.updateAll((SK key, SV value) => update(key as K, value as V) as SV);
-  }
-
-  Iterable<MapEntry<K, V>> get entries {
-    return _source.entries.map<MapEntry<K, V>>(
-        (MapEntry<SK, SV> e) => new MapEntry<K, V>(e.key as K, e.value as V));
-  }
-
-  void addEntries(Iterable<MapEntry<K, V>> entries) {
-    for (var entry in entries) {
-      _source[entry.key as SK] = entry.value as SV;
-    }
-  }
-
-  void removeWhere(bool test(K key, V value)) {
-    _source.removeWhere((SK key, SV value) => test(key as K, value as V));
-  }
-}
-
-class CastQueue<S, T> extends _CastIterableBase<S, T> implements Queue<T> {
-  final Queue<S> _source;
-  CastQueue(this._source);
-  Queue<R> cast<R>() => new CastQueue<S, R>(_source);
-
-  T removeFirst() => _source.removeFirst() as T;
-  T removeLast() => _source.removeLast() as T;
-
-  void add(T value) {
-    _source.add(value as S);
-  }
-
-  void addFirst(T value) {
-    _source.addFirst(value as S);
-  }
-
-  void addLast(T value) {
-    _source.addLast(value as S);
-  }
-
-  bool remove(Object? other) => _source.remove(other);
-  void addAll(Iterable<T> elements) {
-    _source.addAll(new CastIterable<T, S>(elements));
-  }
-
-  void removeWhere(bool test(T element)) {
-    _source.removeWhere((S element) => test(element as T));
-  }
-
-  void retainWhere(bool test(T element)) {
-    _source.retainWhere((S element) => test(element as T));
-  }
-
-  void clear() {
-    _source.clear();
-  }
-}
diff --git a/sdk_nnbd/lib/internal/errors.dart b/sdk_nnbd/lib/internal/errors.dart
deleted file mode 100644
index 9010622..0000000
--- a/sdk_nnbd/lib/internal/errors.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart._internal;
-
-class LateInitializationErrorImpl extends Error
-    implements LateInitializationError {
-  final String? _message;
-
-  LateInitializationErrorImpl([this._message]);
-
-  String toString() {
-    var message = _message;
-    return (message != null)
-        ? "LateInitializationError: $message"
-        : "LateInitializationError";
-  }
-}
diff --git a/sdk_nnbd/lib/internal/internal.dart b/sdk_nnbd/lib/internal/internal.dart
deleted file mode 100644
index dad3b05..0000000
--- a/sdk_nnbd/lib/internal/internal.dart
+++ /dev/null
@@ -1,431 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library dart._internal;
-
-import 'dart:collection';
-
-import 'dart:async'
-    show
-        Future,
-        Stream,
-        StreamSubscription,
-        StreamTransformer,
-        StreamTransformerBase,
-        Zone;
-import 'dart:convert' show Converter;
-import 'dart:core' hide Symbol;
-import 'dart:core' as core show Symbol;
-import 'dart:math' show Random;
-import 'dart:typed_data' show Uint8List;
-
-part 'async_cast.dart';
-part 'cast.dart';
-part 'errors.dart';
-part 'iterable.dart';
-part 'list.dart';
-part 'linked_list.dart';
-part 'print.dart';
-part 'sort.dart';
-part 'symbol.dart';
-
-// Returns true iff `null as T` will succeed based on the
-// execution mode.
-external bool typeAcceptsNull<T>();
-
-// Powers of 10 up to 10^22 are representable as doubles.
-// Powers of 10 above that are only approximate due to lack of precission.
-// Used by double-parsing.
-const POWERS_OF_TEN = const [
-  1.0, // 0
-  10.0,
-  100.0,
-  1000.0,
-  10000.0,
-  100000.0, // 5
-  1000000.0,
-  10000000.0,
-  100000000.0,
-  1000000000.0,
-  10000000000.0, // 10
-  100000000000.0,
-  1000000000000.0,
-  10000000000000.0,
-  100000000000000.0,
-  1000000000000000.0, // 15
-  10000000000000000.0,
-  100000000000000000.0,
-  1000000000000000000.0,
-  10000000000000000000.0,
-  100000000000000000000.0, // 20
-  1000000000000000000000.0,
-  10000000000000000000000.0,
-];
-
-/**
- * An [Iterable] of the UTF-16 code units of a [String] in index order.
- */
-class CodeUnits extends UnmodifiableListBase<int> {
-  /** The string that this is the code units of. */
-  final String _string;
-
-  CodeUnits(this._string);
-
-  int get length => _string.length;
-  int operator [](int i) => _string.codeUnitAt(i);
-
-  static String stringOf(CodeUnits u) => u._string;
-}
-
-/// Marks a function or library as having an external implementation ("native"
-/// in the Dart VM).
-///
-/// On a function, this provides a backend-specific String that can be used to
-/// identify the function's implementation.
-///
-/// On a library, it provides a Uri that can be used to locate the native
-/// library's implementation.
-class ExternalName {
-  final String name;
-  const ExternalName(this.name);
-}
-
-// Shared hex-parsing utilities.
-
-/// Parses a single hex-digit as code unit.
-///
-/// Returns a negative value if the character is not a valid hex-digit.
-int hexDigitValue(int char) {
-  assert(char >= 0 && char <= 0xFFFF);
-  const int digit0 = 0x30;
-  const int a = 0x61;
-  const int f = 0x66;
-  int digit = char ^ digit0;
-  if (digit <= 9) return digit;
-  int letter = (char | 0x20);
-  if (a <= letter && letter <= f) return letter - (a - 10);
-  return -1;
-}
-
-/// Parses two hex digits in a string.
-///
-/// Returns a negative value if either digit isn't valid.
-int parseHexByte(String source, int index) {
-  assert(index + 2 <= source.length);
-  int digit1 = hexDigitValue(source.codeUnitAt(index));
-  int digit2 = hexDigitValue(source.codeUnitAt(index + 1));
-  return digit1 * 16 + digit2 - (digit2 & 256);
-}
-
-/// Given an [instance] of some generic type [T], and [extract], a first-class
-/// generic function that takes the same number of type parameters as [T],
-/// invokes the function with the same type arguments that were passed to T
-/// when [instance] was constructed.
-///
-/// Example:
-///
-/// ```dart
-/// class Two<A, B> {}
-///
-/// print(extractTypeArguments<List>(<int>[], <T>() => new Set<T>()));
-/// // Prints: Instance of 'Set<int>'.
-///
-/// print(extractTypeArguments<Map>(<String, bool>{},
-///     <T, S>() => new Two<T, S>));
-/// // Prints: Instance of 'Two<String, bool>'.
-/// ```
-///
-/// The type argument T is important to choose which specific type parameter
-/// list in [instance]'s type hierarchy is being extracted. Consider:
-///
-/// ```dart
-/// class A<T> {}
-/// class B<T> {}
-///
-/// class C implements A<int>, B<String> {}
-///
-/// main() {
-///   var c = new C();
-///   print(extractTypeArguments<A>(c, <T>() => <T>[]));
-///   // Prints: Instance of 'List<int>'.
-///
-///   print(extractTypeArguments<B>(c, <T>() => <T>[]));
-///   // Prints: Instance of 'List<String>'.
-/// }
-/// ```
-///
-/// A caller must not:
-///
-/// *   Pass `null` for [instance].
-/// *   Use a non-class type (i.e. a function type) for [T].
-/// *   Use a non-generic type for [T].
-/// *   Pass an instance of a generic type and a function that don't both take
-///     the same number of type arguments:
-///
-///     ```dart
-///     extractTypeArguments<List>(<int>[], <T, S>() => null);
-///     ```
-///
-/// See this issue for more context:
-/// https://github.com/dart-lang/sdk/issues/31371
-external Object? extractTypeArguments<T>(T instance, Function extract);
-
-/// Annotation class marking the version where SDK API was added.
-///
-/// A `Since` annotation can be applied to a library declaration,
-/// any public declaration in a library, or in a class, or to
-/// an optional parameter.
-///
-/// It signifies that the export, member or parameter was *added* in
-/// that version.
-///
-/// When applied to a library declaration, it also a applies to
-/// all members declared or exported by that library.
-/// If applied to a class, it also applies to all members and constructors
-/// of that class.
-/// If applied to a class method, or parameter of such,
-/// any method implementing that interface method is also annotated.
-/// I multiple `Since` annotations apply to the same declaration or
-/// parameter, the latest version takes precendence.
-///
-/// Any use of a marked API may trigger a warning if the using code
-/// does not require an SDK version guaranteeing that the API is available,
-/// unless the API feature is also provided by something else.
-/// It is only a problem if an annotated feature is used, and the annotated
-/// API is the *only* thing providing the functionality.
-/// For example, using `Future` exported by `dart:core` is not a problem
-/// if the same library also imports `dart:async`, and using an optional
-/// parameter on an interface is not a problem if the same type also
-/// implements another interface providing the same parameter.
-///
-/// The version must be a semantic version (like `1.4.2` or `0.9.4-rec.4`),
-/// or the first two numbers of a semantic version (like `1.0` or `2.2`),
-/// representing a stable release, and equivalent to the semantic version
-/// you get by appending a `.0`.
-@Since("2.2")
-class Since {
-  final String version;
-  const Since(this.version);
-}
-
-/// A null-check function for function parameters in Null Safety enabled code.
-///
-/// Because Dart does not have full null safety
-/// until all legacy code has been removed from a program,
-/// a non-nullable parameter can still end up with a `null` value.
-/// This function can be used to guard those functions against null arguments.
-/// It throws a [TypeError] because we are really seeing the failure to
-/// assign `null` to a non-nullable type.
-///
-/// See http://dartbug.com/40614 for context.
-T checkNotNullable<T extends Object>(T value, String name) {
-  if ((value as dynamic) == null) {
-    throw NotNullableError<T>(name);
-  }
-  return value;
-}
-
-/// A [TypeError] thrown by [checkNotNullable].
-class NotNullableError<T> extends Error implements TypeError {
-  final String _name;
-  NotNullableError(this._name);
-  String toString() =>
-      "Null is not a valid value for the parameter '$_name' of type '$T'";
-}
-
-/// A function that returns the value or default value (if invoked with `null`
-/// value) for non-nullable function parameters in Null safety enabled code.
-///
-/// Because Dart does not have full null safety
-/// until all legacy code has been removed from a program,
-/// a non-nullable parameter can still end up with a `null` value.
-/// This function can be used to get a default value for a parameter
-/// when a `null` value is passed in for a non-nullable parameter.
-///
-/// TODO(40810) - Remove uses of this function when Dart has full null safety.
-T valueOfNonNullableParamWithDefault<T extends Object>(T value, T defaultVal) {
-  if ((value as dynamic) == null) {
-    return defaultVal;
-  } else {
-    return value;
-  }
-}
-
-/**
- * HTTP status codes.  Exported in dart:io and dart:html.
- */
-abstract class HttpStatus {
-  static const int continue_ = 100;
-  static const int switchingProtocols = 101;
-  @Since("2.1")
-  static const int processing = 102;
-  static const int ok = 200;
-  static const int created = 201;
-  static const int accepted = 202;
-  static const int nonAuthoritativeInformation = 203;
-  static const int noContent = 204;
-  static const int resetContent = 205;
-  static const int partialContent = 206;
-  @Since("2.1")
-  static const int multiStatus = 207;
-  @Since("2.1")
-  static const int alreadyReported = 208;
-  @Since("2.1")
-  static const int imUsed = 226;
-  static const int multipleChoices = 300;
-  static const int movedPermanently = 301;
-  static const int found = 302;
-  static const int movedTemporarily = 302; // Common alias for found.
-  static const int seeOther = 303;
-  static const int notModified = 304;
-  static const int useProxy = 305;
-  static const int temporaryRedirect = 307;
-  @Since("2.1")
-  static const int permanentRedirect = 308;
-  static const int badRequest = 400;
-  static const int unauthorized = 401;
-  static const int paymentRequired = 402;
-  static const int forbidden = 403;
-  static const int notFound = 404;
-  static const int methodNotAllowed = 405;
-  static const int notAcceptable = 406;
-  static const int proxyAuthenticationRequired = 407;
-  static const int requestTimeout = 408;
-  static const int conflict = 409;
-  static const int gone = 410;
-  static const int lengthRequired = 411;
-  static const int preconditionFailed = 412;
-  static const int requestEntityTooLarge = 413;
-  static const int requestUriTooLong = 414;
-  static const int unsupportedMediaType = 415;
-  static const int requestedRangeNotSatisfiable = 416;
-  static const int expectationFailed = 417;
-  @Since("2.1")
-  static const int misdirectedRequest = 421;
-  @Since("2.1")
-  static const int unprocessableEntity = 422;
-  @Since("2.1")
-  static const int locked = 423;
-  @Since("2.1")
-  static const int failedDependency = 424;
-  static const int upgradeRequired = 426;
-  @Since("2.1")
-  static const int preconditionRequired = 428;
-  @Since("2.1")
-  static const int tooManyRequests = 429;
-  @Since("2.1")
-  static const int requestHeaderFieldsTooLarge = 431;
-  @Since("2.1")
-  static const int connectionClosedWithoutResponse = 444;
-  @Since("2.1")
-  static const int unavailableForLegalReasons = 451;
-  @Since("2.1")
-  static const int clientClosedRequest = 499;
-  static const int internalServerError = 500;
-  static const int notImplemented = 501;
-  static const int badGateway = 502;
-  static const int serviceUnavailable = 503;
-  static const int gatewayTimeout = 504;
-  static const int httpVersionNotSupported = 505;
-  @Since("2.1")
-  static const int variantAlsoNegotiates = 506;
-  @Since("2.1")
-  static const int insufficientStorage = 507;
-  @Since("2.1")
-  static const int loopDetected = 508;
-  @Since("2.1")
-  static const int notExtended = 510;
-  @Since("2.1")
-  static const int networkAuthenticationRequired = 511;
-  // Client generated status code.
-  static const int networkConnectTimeoutError = 599;
-
-  @Deprecated("Use continue_ instead")
-  static const int CONTINUE = continue_;
-  @Deprecated("Use switchingProtocols instead")
-  static const int SWITCHING_PROTOCOLS = switchingProtocols;
-  @Deprecated("Use ok instead")
-  static const int OK = ok;
-  @Deprecated("Use created instead")
-  static const int CREATED = created;
-  @Deprecated("Use accepted instead")
-  static const int ACCEPTED = accepted;
-  @Deprecated("Use nonAuthoritativeInformation instead")
-  static const int NON_AUTHORITATIVE_INFORMATION = nonAuthoritativeInformation;
-  @Deprecated("Use noContent instead")
-  static const int NO_CONTENT = noContent;
-  @Deprecated("Use resetContent instead")
-  static const int RESET_CONTENT = resetContent;
-  @Deprecated("Use partialContent instead")
-  static const int PARTIAL_CONTENT = partialContent;
-  @Deprecated("Use multipleChoices instead")
-  static const int MULTIPLE_CHOICES = multipleChoices;
-  @Deprecated("Use movedPermanently instead")
-  static const int MOVED_PERMANENTLY = movedPermanently;
-  @Deprecated("Use found instead")
-  static const int FOUND = found;
-  @Deprecated("Use movedTemporarily instead")
-  static const int MOVED_TEMPORARILY = movedTemporarily;
-  @Deprecated("Use seeOther instead")
-  static const int SEE_OTHER = seeOther;
-  @Deprecated("Use notModified instead")
-  static const int NOT_MODIFIED = notModified;
-  @Deprecated("Use useProxy instead")
-  static const int USE_PROXY = useProxy;
-  @Deprecated("Use temporaryRedirect instead")
-  static const int TEMPORARY_REDIRECT = temporaryRedirect;
-  @Deprecated("Use badRequest instead")
-  static const int BAD_REQUEST = badRequest;
-  @Deprecated("Use unauthorized instead")
-  static const int UNAUTHORIZED = unauthorized;
-  @Deprecated("Use paymentRequired instead")
-  static const int PAYMENT_REQUIRED = paymentRequired;
-  @Deprecated("Use forbidden instead")
-  static const int FORBIDDEN = forbidden;
-  @Deprecated("Use notFound instead")
-  static const int NOT_FOUND = notFound;
-  @Deprecated("Use methodNotAllowed instead")
-  static const int METHOD_NOT_ALLOWED = methodNotAllowed;
-  @Deprecated("Use notAcceptable instead")
-  static const int NOT_ACCEPTABLE = notAcceptable;
-  @Deprecated("Use proxyAuthenticationRequired instead")
-  static const int PROXY_AUTHENTICATION_REQUIRED = proxyAuthenticationRequired;
-  @Deprecated("Use requestTimeout instead")
-  static const int REQUEST_TIMEOUT = requestTimeout;
-  @Deprecated("Use conflict instead")
-  static const int CONFLICT = conflict;
-  @Deprecated("Use gone instead")
-  static const int GONE = gone;
-  @Deprecated("Use lengthRequired instead")
-  static const int LENGTH_REQUIRED = lengthRequired;
-  @Deprecated("Use preconditionFailed instead")
-  static const int PRECONDITION_FAILED = preconditionFailed;
-  @Deprecated("Use requestEntityTooLarge instead")
-  static const int REQUEST_ENTITY_TOO_LARGE = requestEntityTooLarge;
-  @Deprecated("Use requestUriTooLong instead")
-  static const int REQUEST_URI_TOO_LONG = requestUriTooLong;
-  @Deprecated("Use unsupportedMediaType instead")
-  static const int UNSUPPORTED_MEDIA_TYPE = unsupportedMediaType;
-  @Deprecated("Use requestedRangeNotSatisfiable instead")
-  static const int REQUESTED_RANGE_NOT_SATISFIABLE =
-      requestedRangeNotSatisfiable;
-  @Deprecated("Use expectationFailed instead")
-  static const int EXPECTATION_FAILED = expectationFailed;
-  @Deprecated("Use upgradeRequired instead")
-  static const int UPGRADE_REQUIRED = upgradeRequired;
-  @Deprecated("Use internalServerError instead")
-  static const int INTERNAL_SERVER_ERROR = internalServerError;
-  @Deprecated("Use notImplemented instead")
-  static const int NOT_IMPLEMENTED = notImplemented;
-  @Deprecated("Use badGateway instead")
-  static const int BAD_GATEWAY = badGateway;
-  @Deprecated("Use serviceUnavailable instead")
-  static const int SERVICE_UNAVAILABLE = serviceUnavailable;
-  @Deprecated("Use gatewayTimeout instead")
-  static const int GATEWAY_TIMEOUT = gatewayTimeout;
-  @Deprecated("Use httpVersionNotSupported instead")
-  static const int HTTP_VERSION_NOT_SUPPORTED = httpVersionNotSupported;
-  @Deprecated("Use networkConnectTimeoutError instead")
-  static const int NETWORK_CONNECT_TIMEOUT_ERROR = networkConnectTimeoutError;
-}
diff --git a/sdk_nnbd/lib/internal/internal_sources.gni b/sdk_nnbd/lib/internal/internal_sources.gni
deleted file mode 100644
index 8510ab2..0000000
--- a/sdk_nnbd/lib/internal/internal_sources.gni
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# This file contains all sources for the dart:_internal library.
-internal_sdk_sources = [
-  "internal.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "async_cast.dart",
-  "cast.dart",
-  "errors.dart",
-  "iterable.dart",
-  "linked_list.dart",
-  "list.dart",
-  "print.dart",
-  "sort.dart",
-  "symbol.dart",
-]
diff --git a/sdk_nnbd/lib/internal/iterable.dart b/sdk_nnbd/lib/internal/iterable.dart
deleted file mode 100644
index 2817132..0000000
--- a/sdk_nnbd/lib/internal/iterable.dart
+++ /dev/null
@@ -1,894 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart._internal;
-
-/**
- * Marker interface for [Iterable] subclasses that have an efficient
- * [length] implementation.
- */
-abstract class EfficientLengthIterable<T> extends Iterable<T> {
-  const EfficientLengthIterable();
-  /**
-   * Returns the number of elements in the iterable.
-   *
-   * This is an efficient operation that doesn't require iterating through
-   * the elements.
-   */
-  int get length;
-}
-
-/**
- * An [Iterable] for classes that have efficient [length] and [elementAt].
- *
- * All other methods are implemented in terms of [length] and [elementAt],
- * including [iterator].
- */
-abstract class ListIterable<E> extends EfficientLengthIterable<E> {
-  int get length;
-  E elementAt(int i);
-
-  const ListIterable();
-
-  Iterator<E> get iterator => new ListIterator<E>(this);
-
-  void forEach(void action(E element)) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      action(elementAt(i));
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-  }
-
-  bool get isEmpty => length == 0;
-
-  E get first {
-    if (length == 0) throw IterableElementError.noElement();
-    return elementAt(0);
-  }
-
-  E get last {
-    if (length == 0) throw IterableElementError.noElement();
-    return elementAt(length - 1);
-  }
-
-  E get single {
-    if (length == 0) throw IterableElementError.noElement();
-    if (length > 1) throw IterableElementError.tooMany();
-    return elementAt(0);
-  }
-
-  bool contains(Object? element) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (elementAt(i) == element) return true;
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    return false;
-  }
-
-  bool every(bool test(E element)) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (!test(elementAt(i))) return false;
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    return true;
-  }
-
-  bool any(bool test(E element)) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      if (test(elementAt(i))) return true;
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    return false;
-  }
-
-  E firstWhere(bool test(E element), {E Function()? orElse}) {
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      E element = elementAt(i);
-      if (test(element)) return element;
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E element), {E Function()? orElse}) {
-    int length = this.length;
-    for (int i = length - 1; i >= 0; i--) {
-      E element = elementAt(i);
-      if (test(element)) return element;
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E element), {E Function()? orElse}) {
-    int length = this.length;
-    late E match;
-    bool matchFound = false;
-    for (int i = 0; i < length; i++) {
-      E element = elementAt(i);
-      if (test(element)) {
-        if (matchFound) {
-          throw IterableElementError.tooMany();
-        }
-        matchFound = true;
-        match = element;
-      }
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    if (matchFound) return match;
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  String join([String separator = ""]) {
-    int length = this.length;
-    if (!separator.isEmpty) {
-      if (length == 0) return "";
-      String first = "${elementAt(0)}";
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-      StringBuffer buffer = new StringBuffer(first);
-      for (int i = 1; i < length; i++) {
-        buffer.write(separator);
-        buffer.write(elementAt(i));
-        if (length != this.length) {
-          throw new ConcurrentModificationError(this);
-        }
-      }
-      return buffer.toString();
-    } else {
-      StringBuffer buffer = new StringBuffer();
-      for (int i = 0; i < length; i++) {
-        buffer.write(elementAt(i));
-        if (length != this.length) {
-          throw new ConcurrentModificationError(this);
-        }
-      }
-      return buffer.toString();
-    }
-  }
-
-  Iterable<E> where(bool test(E element)) => super.where(test);
-
-  Iterable<T> map<T>(T f(E element)) => new MappedListIterable<E, T>(this, f);
-
-  E reduce(E combine(E value, E element)) {
-    int length = this.length;
-    if (length == 0) throw IterableElementError.noElement();
-    E value = elementAt(0);
-    for (int i = 1; i < length; i++) {
-      value = combine(value, elementAt(i));
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    return value;
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    var value = initialValue;
-    int length = this.length;
-    for (int i = 0; i < length; i++) {
-      value = combine(value, elementAt(i));
-      if (length != this.length) {
-        throw new ConcurrentModificationError(this);
-      }
-    }
-    return value;
-  }
-
-  Iterable<E> skip(int count) => new SubListIterable<E>(this, count, null);
-
-  Iterable<E> skipWhile(bool test(E element)) => super.skipWhile(test);
-
-  Iterable<E> take(int count) => new SubListIterable<E>(this, 0, count);
-
-  Iterable<E> takeWhile(bool test(E element)) => super.takeWhile(test);
-
-  List<E> toList({bool growable: true}) => List<E>.of(this, growable: growable);
-
-  Set<E> toSet() {
-    Set<E> result = new Set<E>();
-    for (int i = 0; i < length; i++) {
-      result.add(elementAt(i));
-    }
-    return result;
-  }
-}
-
-class SubListIterable<E> extends ListIterable<E> {
-  final Iterable<E> _iterable; // Has efficient length and elementAt.
-  final int _start;
-  /** If null, represents the length of the iterable. */
-  final int? _endOrLength;
-
-  SubListIterable(this._iterable, this._start, this._endOrLength) {
-    RangeError.checkNotNegative(_start, "start");
-    int? endOrLength = _endOrLength;
-    if (endOrLength != null) {
-      RangeError.checkNotNegative(endOrLength, "end");
-      if (_start > endOrLength) {
-        throw new RangeError.range(_start, 0, endOrLength, "start");
-      }
-    }
-  }
-
-  int get _endIndex {
-    int length = _iterable.length;
-    int? endOrLength = _endOrLength;
-    if (endOrLength == null || endOrLength > length) return length;
-    return endOrLength;
-  }
-
-  int get _startIndex {
-    int length = _iterable.length;
-    if (_start > length) return length;
-    return _start;
-  }
-
-  int get length {
-    int length = _iterable.length;
-    if (_start >= length) return 0;
-    int? endOrLength = _endOrLength;
-    if (endOrLength == null || endOrLength >= length) {
-      return length - _start;
-    }
-    return endOrLength - _start;
-  }
-
-  E elementAt(int index) {
-    int realIndex = _startIndex + index;
-    if (index < 0 || realIndex >= _endIndex) {
-      throw new RangeError.index(index, this, "index");
-    }
-    return _iterable.elementAt(realIndex);
-  }
-
-  Iterable<E> skip(int count) {
-    RangeError.checkNotNegative(count, "count");
-    int newStart = _start + count;
-    int? endOrLength = _endOrLength;
-    if (endOrLength != null && newStart >= endOrLength) {
-      return new EmptyIterable<E>();
-    }
-    return new SubListIterable<E>(_iterable, newStart, _endOrLength);
-  }
-
-  Iterable<E> take(int count) {
-    RangeError.checkNotNegative(count, "count");
-    int? endOrLength = _endOrLength;
-    if (endOrLength == null) {
-      return new SubListIterable<E>(_iterable, _start, _start + count);
-    } else {
-      int newEnd = _start + count;
-      if (endOrLength < newEnd) return this;
-      return new SubListIterable<E>(_iterable, _start, newEnd);
-    }
-  }
-
-  List<E> toList({bool growable: true}) {
-    int start = _start;
-    int end = _iterable.length;
-    int? endOrLength = _endOrLength;
-    if (endOrLength != null && endOrLength < end) end = endOrLength;
-    int length = end - start;
-    if (length <= 0) return List<E>.empty(growable: growable);
-
-    List<E> result =
-        List<E>.filled(length, _iterable.elementAt(start), growable: growable);
-    for (int i = 1; i < length; i++) {
-      result[i] = _iterable.elementAt(start + i);
-      if (_iterable.length < end) throw new ConcurrentModificationError(this);
-    }
-    return result;
-  }
-}
-
-/**
- * An [Iterator] that iterates a list-like [Iterable].
- *
- * All iterations is done in terms of [Iterable.length] and
- * [Iterable.elementAt]. These operations are fast for list-like
- * iterables.
- */
-class ListIterator<E> implements Iterator<E> {
-  final Iterable<E> _iterable;
-  final int _length;
-  int _index;
-  E? _current;
-
-  ListIterator(Iterable<E> iterable)
-      : _iterable = iterable,
-        _length = iterable.length,
-        _index = 0;
-
-  E get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as E;
-  }
-
-  @pragma("vm:prefer-inline")
-  bool moveNext() {
-    int length = _iterable.length;
-    if (_length != length) {
-      throw new ConcurrentModificationError(_iterable);
-    }
-    if (_index >= length) {
-      _current = null;
-      return false;
-    }
-    _current = _iterable.elementAt(_index);
-    _index++;
-    return true;
-  }
-}
-
-typedef T _Transformation<S, T>(S value);
-
-class MappedIterable<S, T> extends Iterable<T> {
-  final Iterable<S> _iterable;
-  final _Transformation<S, T> _f;
-
-  factory MappedIterable(Iterable<S> iterable, T function(S value)) {
-    if (iterable is EfficientLengthIterable) {
-      return new EfficientLengthMappedIterable<S, T>(iterable, function);
-    }
-    return new MappedIterable<S, T>._(iterable, function);
-  }
-
-  MappedIterable._(this._iterable, this._f);
-
-  Iterator<T> get iterator => new MappedIterator<S, T>(_iterable.iterator, _f);
-
-  // Length related functions are independent of the mapping.
-  int get length => _iterable.length;
-  bool get isEmpty => _iterable.isEmpty;
-
-  // Index based lookup can be done before transforming.
-  T get first => _f(_iterable.first);
-  T get last => _f(_iterable.last);
-  T get single => _f(_iterable.single);
-  T elementAt(int index) => _f(_iterable.elementAt(index));
-}
-
-class EfficientLengthMappedIterable<S, T> extends MappedIterable<S, T>
-    implements EfficientLengthIterable<T> {
-  EfficientLengthMappedIterable(Iterable<S> iterable, T function(S value))
-      : super._(iterable, function);
-}
-
-class MappedIterator<S, T> extends Iterator<T> {
-  T? _current;
-  final Iterator<S> _iterator;
-  final _Transformation<S, T> _f;
-
-  MappedIterator(this._iterator, this._f);
-
-  bool moveNext() {
-    if (_iterator.moveNext()) {
-      _current = _f(_iterator.current);
-      return true;
-    }
-    _current = null;
-    return false;
-  }
-
-  T get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as T;
-  }
-}
-
-/**
- * Specialized alternative to [MappedIterable] for mapped [List]s.
- *
- * Expects efficient `length` and `elementAt` on the source iterable.
- */
-class MappedListIterable<S, T> extends ListIterable<T> {
-  final Iterable<S> _source;
-  final _Transformation<S, T> _f;
-
-  MappedListIterable(this._source, this._f);
-
-  int get length => _source.length;
-  T elementAt(int index) => _f(_source.elementAt(index));
-}
-
-typedef bool _ElementPredicate<E>(E element);
-
-class WhereIterable<E> extends Iterable<E> {
-  final Iterable<E> _iterable;
-  final _ElementPredicate<E> _f;
-
-  WhereIterable(this._iterable, this._f);
-
-  Iterator<E> get iterator => new WhereIterator<E>(_iterable.iterator, _f);
-
-  // Specialization of [Iterable.map] to non-EfficientLengthIterable.
-  Iterable<T> map<T>(T f(E element)) => new MappedIterable<E, T>._(this, f);
-}
-
-class WhereIterator<E> extends Iterator<E> {
-  final Iterator<E> _iterator;
-  final _ElementPredicate<E> _f;
-
-  WhereIterator(this._iterator, this._f);
-
-  bool moveNext() {
-    while (_iterator.moveNext()) {
-      if (_f(_iterator.current)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  E get current => _iterator.current;
-}
-
-typedef Iterable<T> _ExpandFunction<S, T>(S sourceElement);
-
-class ExpandIterable<S, T> extends Iterable<T> {
-  final Iterable<S> _iterable;
-  final _ExpandFunction<S, T> _f;
-
-  ExpandIterable(this._iterable, this._f);
-
-  Iterator<T> get iterator => new ExpandIterator<S, T>(_iterable.iterator, _f);
-}
-
-class ExpandIterator<S, T> implements Iterator<T> {
-  final Iterator<S> _iterator;
-  final _ExpandFunction<S, T> _f;
-  // Initialize _currentExpansion to an empty iterable. A null value
-  // marks the end of iteration, and we don't want to call _f before
-  // the first moveNext call.
-  Iterator<T>? _currentExpansion = const EmptyIterator<Never>();
-  T? _current;
-
-  ExpandIterator(this._iterator, this._f);
-
-  T get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as T;
-  }
-
-  bool moveNext() {
-    if (_currentExpansion == null) return false;
-    while (!_currentExpansion!.moveNext()) {
-      _current = null;
-      if (_iterator.moveNext()) {
-        // If _f throws, this ends iteration. Otherwise _currentExpansion and
-        // _current will be set again below.
-        _currentExpansion = null;
-        _currentExpansion = _f(_iterator.current).iterator;
-      } else {
-        return false;
-      }
-    }
-    _current = _currentExpansion!.current;
-    return true;
-  }
-}
-
-class TakeIterable<E> extends Iterable<E> {
-  final Iterable<E> _iterable;
-  final int _takeCount;
-
-  factory TakeIterable(Iterable<E> iterable, int takeCount) {
-    ArgumentError.checkNotNull(takeCount, "takeCount");
-    RangeError.checkNotNegative(takeCount, "takeCount");
-    if (iterable is EfficientLengthIterable) {
-      return new EfficientLengthTakeIterable<E>(iterable, takeCount);
-    }
-    return new TakeIterable<E>._(iterable, takeCount);
-  }
-
-  TakeIterable._(this._iterable, this._takeCount);
-
-  Iterator<E> get iterator {
-    return new TakeIterator<E>(_iterable.iterator, _takeCount);
-  }
-}
-
-class EfficientLengthTakeIterable<E> extends TakeIterable<E>
-    implements EfficientLengthIterable<E> {
-  EfficientLengthTakeIterable(Iterable<E> iterable, int takeCount)
-      : super._(iterable, takeCount);
-
-  int get length {
-    int iterableLength = _iterable.length;
-    if (iterableLength > _takeCount) return _takeCount;
-    return iterableLength;
-  }
-}
-
-class TakeIterator<E> extends Iterator<E> {
-  final Iterator<E> _iterator;
-  int _remaining;
-
-  TakeIterator(this._iterator, this._remaining) {
-    assert(_remaining >= 0);
-  }
-
-  bool moveNext() {
-    _remaining--;
-    if (_remaining >= 0) {
-      return _iterator.moveNext();
-    }
-    _remaining = -1;
-    return false;
-  }
-
-  E get current {
-    // Before NNBD, this returned null when iteration was complete. In order to
-    // avoid a hard breaking change, we return "null as E" in that case so that
-    // if strong checking is not enabled or E is nullable, the existing
-    // behavior is preserved.
-    if (_remaining < 0) return null as E;
-    return _iterator.current;
-  }
-}
-
-class TakeWhileIterable<E> extends Iterable<E> {
-  final Iterable<E> _iterable;
-  final _ElementPredicate<E> _f;
-
-  TakeWhileIterable(this._iterable, this._f);
-
-  Iterator<E> get iterator {
-    return new TakeWhileIterator<E>(_iterable.iterator, _f);
-  }
-}
-
-class TakeWhileIterator<E> extends Iterator<E> {
-  final Iterator<E> _iterator;
-  final _ElementPredicate<E> _f;
-  bool _isFinished = false;
-
-  TakeWhileIterator(this._iterator, this._f);
-
-  bool moveNext() {
-    if (_isFinished) return false;
-    if (!_iterator.moveNext() || !_f(_iterator.current)) {
-      _isFinished = true;
-      return false;
-    }
-    return true;
-  }
-
-  E get current {
-    if (_isFinished) return null as E;
-    return _iterator.current;
-  }
-}
-
-class SkipIterable<E> extends Iterable<E> {
-  final Iterable<E> _iterable;
-  final int _skipCount;
-
-  factory SkipIterable(Iterable<E> iterable, int count) {
-    if (iterable is EfficientLengthIterable) {
-      return new EfficientLengthSkipIterable<E>(iterable, count);
-    }
-    return new SkipIterable<E>._(iterable, _checkCount(count));
-  }
-
-  SkipIterable._(this._iterable, this._skipCount);
-
-  Iterable<E> skip(int count) {
-    return new SkipIterable<E>._(_iterable, _skipCount + _checkCount(count));
-  }
-
-  Iterator<E> get iterator {
-    return new SkipIterator<E>(_iterable.iterator, _skipCount);
-  }
-}
-
-class EfficientLengthSkipIterable<E> extends SkipIterable<E>
-    implements EfficientLengthIterable<E> {
-  factory EfficientLengthSkipIterable(Iterable<E> iterable, int count) {
-    return new EfficientLengthSkipIterable<E>._(iterable, _checkCount(count));
-  }
-
-  EfficientLengthSkipIterable._(Iterable<E> iterable, int count)
-      : super._(iterable, count);
-
-  int get length {
-    int length = _iterable.length - _skipCount;
-    if (length >= 0) return length;
-    return 0;
-  }
-
-  Iterable<E> skip(int count) {
-    return new EfficientLengthSkipIterable<E>._(
-        _iterable, _skipCount + _checkCount(count));
-  }
-}
-
-int _checkCount(int count) {
-  ArgumentError.checkNotNull(count, "count");
-  RangeError.checkNotNegative(count, "count");
-  return count;
-}
-
-class SkipIterator<E> extends Iterator<E> {
-  final Iterator<E> _iterator;
-  int _skipCount;
-
-  SkipIterator(this._iterator, this._skipCount) {
-    assert(_skipCount >= 0);
-  }
-
-  bool moveNext() {
-    for (int i = 0; i < _skipCount; i++) _iterator.moveNext();
-    _skipCount = 0;
-    return _iterator.moveNext();
-  }
-
-  E get current => _iterator.current;
-}
-
-class SkipWhileIterable<E> extends Iterable<E> {
-  final Iterable<E> _iterable;
-  final _ElementPredicate<E> _f;
-
-  SkipWhileIterable(this._iterable, this._f);
-
-  Iterator<E> get iterator {
-    return new SkipWhileIterator<E>(_iterable.iterator, _f);
-  }
-}
-
-class SkipWhileIterator<E> extends Iterator<E> {
-  final Iterator<E> _iterator;
-  final _ElementPredicate<E> _f;
-  bool _hasSkipped = false;
-
-  SkipWhileIterator(this._iterator, this._f);
-
-  bool moveNext() {
-    if (!_hasSkipped) {
-      _hasSkipped = true;
-      while (_iterator.moveNext()) {
-        if (!_f(_iterator.current)) return true;
-      }
-    }
-    return _iterator.moveNext();
-  }
-
-  E get current => _iterator.current;
-}
-
-/**
- * The always empty [Iterable].
- */
-class EmptyIterable<E> extends EfficientLengthIterable<E> {
-  const EmptyIterable();
-
-  Iterator<E> get iterator => const EmptyIterator<Never>();
-
-  void forEach(void action(E element)) {}
-
-  bool get isEmpty => true;
-
-  int get length => 0;
-
-  E get first {
-    throw IterableElementError.noElement();
-  }
-
-  E get last {
-    throw IterableElementError.noElement();
-  }
-
-  E get single {
-    throw IterableElementError.noElement();
-  }
-
-  E elementAt(int index) {
-    throw new RangeError.range(index, 0, 0, "index");
-  }
-
-  bool contains(Object? element) => false;
-
-  bool every(bool test(E element)) => true;
-
-  bool any(bool test(E element)) => false;
-
-  E firstWhere(bool test(E element), {E Function()? orElse}) {
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E lastWhere(bool test(E element), {E Function()? orElse}) {
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  E singleWhere(bool test(E element), {E Function()? orElse}) {
-    if (orElse != null) return orElse();
-    throw IterableElementError.noElement();
-  }
-
-  String join([String separator = ""]) => "";
-
-  Iterable<E> where(bool test(E element)) => this;
-
-  Iterable<T> map<T>(T f(E element)) => new EmptyIterable<T>();
-
-  E reduce(E combine(E value, E element)) {
-    throw IterableElementError.noElement();
-  }
-
-  T fold<T>(T initialValue, T combine(T previousValue, E element)) {
-    return initialValue;
-  }
-
-  Iterable<E> skip(int count) {
-    RangeError.checkNotNegative(count, "count");
-    return this;
-  }
-
-  Iterable<E> skipWhile(bool test(E element)) => this;
-
-  Iterable<E> take(int count) {
-    RangeError.checkNotNegative(count, "count");
-    return this;
-  }
-
-  Iterable<E> takeWhile(bool test(E element)) => this;
-
-  List<E> toList({bool growable: true}) => List<E>.empty(growable: growable);
-
-  Set<E> toSet() => new Set<E>();
-}
-
-/** The always empty iterator. */
-class EmptyIterator<E> implements Iterator<E> {
-  const EmptyIterator();
-  bool moveNext() => false;
-  E get current {
-    throw IterableElementError.noElement();
-  }
-}
-
-class FollowedByIterable<E> extends Iterable<E> {
-  final Iterable<E> _first;
-  final Iterable<E> _second;
-  FollowedByIterable(this._first, this._second);
-
-  factory FollowedByIterable.firstEfficient(
-      EfficientLengthIterable<E> first, Iterable<E> second) {
-    if (second is EfficientLengthIterable<E>) {
-      return new EfficientLengthFollowedByIterable<E>(first, second);
-    }
-    return new FollowedByIterable<E>(first, second);
-  }
-
-  Iterator<E> get iterator => new FollowedByIterator(_first, _second);
-
-  int get length => _first.length + _second.length;
-  bool get isEmpty => _first.isEmpty && _second.isEmpty;
-  bool get isNotEmpty => _first.isNotEmpty || _second.isNotEmpty;
-
-  // May be more efficient if either iterable is a Set.
-  bool contains(Object? value) =>
-      _first.contains(value) || _second.contains(value);
-
-  E get first {
-    var iterator = _first.iterator;
-    if (iterator.moveNext()) return iterator.current;
-    return _second.first;
-  }
-
-  E get last {
-    var iterator = _second.iterator;
-    if (iterator.moveNext()) {
-      E last = iterator.current;
-      while (iterator.moveNext()) last = iterator.current;
-      return last;
-    }
-    return _first.last;
-  }
-
-  // If linear sequences of `followedBy` becomes an issue, we can flatten
-  // into a list of iterables instead of a tree or spine.
-}
-
-class EfficientLengthFollowedByIterable<E> extends FollowedByIterable<E>
-    implements EfficientLengthIterable<E> {
-  EfficientLengthFollowedByIterable(
-      EfficientLengthIterable<E> first, EfficientLengthIterable<E> second)
-      : super(first, second);
-
-  E elementAt(int index) {
-    int firstLength = _first.length;
-    if (index < firstLength) return _first.elementAt(index);
-    return _second.elementAt(index - firstLength);
-  }
-
-  E get first {
-    if (_first.isNotEmpty) return _first.first;
-    return _second.first;
-  }
-
-  E get last {
-    if (_second.isNotEmpty) return _second.last;
-    return _first.last;
-  }
-}
-
-class FollowedByIterator<E> implements Iterator<E> {
-  Iterator<E> _currentIterator;
-  Iterable<E>? _nextIterable;
-
-  FollowedByIterator(Iterable<E> first, this._nextIterable)
-      : _currentIterator = first.iterator;
-
-  bool moveNext() {
-    if (_currentIterator.moveNext()) return true;
-    if (_nextIterable != null) {
-      _currentIterator = _nextIterable!.iterator;
-      _nextIterable = null;
-      return _currentIterator.moveNext();
-    }
-    return false;
-  }
-
-  E get current => _currentIterator.current;
-}
-
-class WhereTypeIterable<T> extends Iterable<T> {
-  final Iterable<Object?> _source;
-  WhereTypeIterable(this._source);
-  Iterator<T> get iterator => new WhereTypeIterator<T>(_source.iterator);
-}
-
-class WhereTypeIterator<T> implements Iterator<T> {
-  final Iterator<Object?> _source;
-  WhereTypeIterator(this._source);
-  bool moveNext() {
-    while (_source.moveNext()) {
-      if (_source.current is T) return true;
-    }
-    return false;
-  }
-
-  T get current => _source.current as T;
-}
-
-/**
- * Creates errors throw by [Iterable] when the element count is wrong.
- */
-abstract class IterableElementError {
-  /** Error thrown thrown by, e.g., [Iterable.first] when there is no result. */
-  static StateError noElement() => new StateError("No element");
-  /** Error thrown by, e.g., [Iterable.single] if there are too many results. */
-  static StateError tooMany() => new StateError("Too many elements");
-  /** Error thrown by, e.g., [List.setRange] if there are too few elements. */
-  static StateError tooFew() => new StateError("Too few elements");
-}
diff --git a/sdk_nnbd/lib/internal/linked_list.dart b/sdk_nnbd/lib/internal/linked_list.dart
deleted file mode 100644
index b5e5275..0000000
--- a/sdk_nnbd/lib/internal/linked_list.dart
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart._internal;
-
-/// A rudimentary linked list.
-class LinkedList<T extends LinkedListEntry<T>> extends IterableBase<T> {
-  T get first => _first as T;
-  T? _first;
-
-  T get last => _last as T;
-  T? _last;
-
-  int length = 0;
-
-  bool get isEmpty => length == 0;
-
-  /**
-   * Adds [newLast] to the end of this linked list.
-   */
-  void add(T newLast) {
-    assert(newLast._next == null && newLast._previous == null);
-    if (_last != null) {
-      assert(_last!._next == null);
-      _last!._next = newLast;
-    } else {
-      _first = newLast;
-    }
-    newLast._previous = _last;
-    _last = newLast;
-    _last!._list = this;
-    length++;
-  }
-
-  /**
-   * Adds [newFirst] to the beginning of this linked list.
-   */
-  void addFirst(T newFirst) {
-    if (_first != null) {
-      assert(_first!._previous == null);
-      _first!._previous = newFirst;
-    } else {
-      _last = newFirst;
-    }
-    newFirst._next = _first;
-    _first = newFirst;
-    _first!._list = this;
-    length++;
-  }
-
-  /**
-   * Removes the given [node] from this list.
-   *
-   * If the entry is not in this linked list nothing happens.
-   *
-   * Also see [LinkedListEntry.unlink].
-   */
-  void remove(T node) {
-    if (node._list != this) return;
-    length--;
-    if (node._previous == null) {
-      assert(identical(node, _first));
-      _first = node._next;
-    } else {
-      node._previous!._next = node._next;
-    }
-    if (node._next == null) {
-      assert(identical(node, _last));
-      _last = node._previous;
-    } else {
-      node._next!._previous = node._previous;
-    }
-    node._next = node._previous = null;
-    node._list = null;
-  }
-
-  Iterator<T> get iterator => new _LinkedListIterator<T>(this);
-}
-
-class LinkedListEntry<T extends LinkedListEntry<T>> {
-  T? _next;
-  T? _previous;
-  LinkedList<T>? _list;
-
-  /**
-   * Unlinks the element from its linked list.
-   *
-   * If the entry is not in a linked list, does nothing. Otherwise, this
-   * is equivalent to calling [LinkedList.remove] on the list this entry
-   * is currently in.
-   */
-  void unlink() {
-    _list?.remove(this as T);
-  }
-}
-
-class _LinkedListIterator<T extends LinkedListEntry<T>> implements Iterator<T> {
-  /// The current element of the iterator.
-  T? _current;
-
-  T get current {
-    final cur = _current;
-    return (cur != null) ? cur : cur as T;
-  }
-
-  /// The list the iterator iterates over.
-  ///
-  /// Set to [null] if the provided list was empty (indicating that there were
-  /// no entries to iterate over).
-  ///
-  /// Set to [null] as soon as [moveNext] was invoked (indicating that the
-  /// iterator has to work with [current] from now on.
-  LinkedList<T>? _list;
-
-  _LinkedListIterator(LinkedList<T> list) : _list = list {
-    if (list.length == 0) _list = null;
-  }
-
-  bool moveNext() {
-    // current is null if the iterator hasn't started iterating, or if the
-    // iteration is finished. In the first case, the [_list] field is not null.
-    if (_current == null) {
-      var list = _list;
-      if (list == null) return false;
-      assert(list.length > 0);
-      _current = list.first;
-      _list = null;
-      return true;
-    }
-    _current = _current!._next;
-    return _current != null;
-  }
-}
diff --git a/sdk_nnbd/lib/internal/list.dart b/sdk_nnbd/lib/internal/list.dart
deleted file mode 100644
index 0a8b6a9..0000000
--- a/sdk_nnbd/lib/internal/list.dart
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._internal;
-
-/**
- * Mixin that throws on the length changing operations of [List].
- *
- * Intended to mix-in on top of [ListMixin] for fixed-length lists.
- */
-abstract class FixedLengthListMixin<E> {
-  /** This operation is not supported by a fixed length list. */
-  set length(int newLength) {
-    throw new UnsupportedError(
-        "Cannot change the length of a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void add(E value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void insert(int index, E value) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void insertAll(int at, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void addAll(Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot add to a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  bool remove(Object? element) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void removeWhere(bool test(E element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void retainWhere(bool test(E element)) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void clear() {
-    throw new UnsupportedError("Cannot clear a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  E removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  E removeLast() {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-
-  /** This operation is not supported by a fixed length list. */
-  void replaceRange(int start, int end, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot remove from a fixed-length list");
-  }
-}
-
-/**
- * Mixin for an unmodifiable [List] class.
- *
- * This overrides all mutating methods with methods that throw.
- * This mixin is intended to be mixed in on top of [ListMixin] on
- * unmodifiable lists.
- */
-abstract class UnmodifiableListMixin<E> implements List<E> {
-  /** This operation is not supported by an unmodifiable list. */
-  void operator []=(int index, E value) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  set length(int newLength) {
-    throw new UnsupportedError(
-        "Cannot change the length of an unmodifiable list");
-  }
-
-  set first(E element) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  set last(E element) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void setAll(int at, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void add(E value) {
-    throw new UnsupportedError("Cannot add to an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void insert(int index, E element) {
-    throw new UnsupportedError("Cannot add to an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void insertAll(int at, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot add to an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void addAll(Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot add to an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  bool remove(Object? element) {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void removeWhere(bool test(E element)) {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void retainWhere(bool test(E element)) {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void sort([Comparator<E>? compare]) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void shuffle([Random? random]) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void clear() {
-    throw new UnsupportedError("Cannot clear an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  E removeAt(int index) {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  E removeLast() {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void replaceRange(int start, int end, Iterable<E> iterable) {
-    throw new UnsupportedError("Cannot remove from an unmodifiable list");
-  }
-
-  /** This operation is not supported by an unmodifiable list. */
-  void fillRange(int start, int end, [E? fillValue]) {
-    throw new UnsupportedError("Cannot modify an unmodifiable list");
-  }
-}
-
-/**
- * Abstract implementation of a fixed-length list.
- *
- * All operations are defined in terms of `length`, `operator[]` and
- * `operator[]=`, which need to be implemented.
- */
-abstract class FixedLengthListBase<E> = ListBase<E>
-    with FixedLengthListMixin<E>;
-
-/**
- * Abstract implementation of an unmodifiable list.
- *
- * All operations are defined in terms of `length` and `operator[]`,
- * which need to be implemented.
- */
-abstract class UnmodifiableListBase<E> = ListBase<E>
-    with UnmodifiableListMixin<E>;
-
-class _ListIndicesIterable extends ListIterable<int> {
-  List _backedList;
-
-  _ListIndicesIterable(this._backedList);
-
-  int get length => _backedList.length;
-  int elementAt(int index) {
-    RangeError.checkValidIndex(index, this);
-    return index;
-  }
-}
-
-class ListMapView<E> extends UnmodifiableMapBase<int, E> {
-  List<E> _values;
-
-  ListMapView(this._values);
-
-  E? operator [](Object? key) => containsKey(key) ? _values[key as int] : null;
-  int get length => _values.length;
-
-  Iterable<E> get values => new SubListIterable<E>(_values, 0, null);
-  Iterable<int> get keys => new _ListIndicesIterable(_values);
-
-  bool get isEmpty => _values.isEmpty;
-  bool get isNotEmpty => _values.isNotEmpty;
-  bool containsValue(Object? value) => _values.contains(value);
-  bool containsKey(Object? key) => key is int && key >= 0 && key < length;
-
-  void forEach(void f(int key, E value)) {
-    int length = _values.length;
-    for (int i = 0; i < length; i++) {
-      f(i, _values[i]);
-      if (length != _values.length) {
-        throw new ConcurrentModificationError(_values);
-      }
-    }
-  }
-}
-
-class ReversedListIterable<E> extends ListIterable<E> {
-  Iterable<E> _source;
-  ReversedListIterable(this._source);
-
-  int get length => _source.length;
-
-  E elementAt(int index) => _source.elementAt(_source.length - 1 - index);
-}
-
-/**
- * Creates errors thrown by unmodifiable lists when they are attempted modified.
- *
- * This class creates [UnsupportedError]s with specialized messages.
- */
-abstract class UnmodifiableListError {
-  /** Error thrown when trying to add elements to an unmodifiable list. */
-  static UnsupportedError add() =>
-      new UnsupportedError("Cannot add to unmodifiable List");
-
-  /** Error thrown when trying to add elements to an unmodifiable list. */
-  static UnsupportedError change() =>
-      new UnsupportedError("Cannot change the content of an unmodifiable List");
-
-  /** Error thrown when trying to change the length of an unmodifiable list. */
-  static UnsupportedError length() =>
-      new UnsupportedError("Cannot change length of unmodifiable List");
-
-  /** Error thrown when trying to remove elements from an unmodifiable list. */
-  static UnsupportedError remove() =>
-      new UnsupportedError("Cannot remove from unmodifiable List");
-}
-
-/**
- * Creates errors thrown by non-growable lists when they are attempted modified.
- *
- * This class creates [UnsupportedError]s with specialized messages.
- */
-abstract class NonGrowableListError {
-  /** Error thrown when trying to add elements to an non-growable list. */
-  static UnsupportedError add() =>
-      new UnsupportedError("Cannot add to non-growable List");
-
-  /** Error thrown when trying to change the length of an non-growable list. */
-  static UnsupportedError length() =>
-      new UnsupportedError("Cannot change length of non-growable List");
-
-  /** Error thrown when trying to remove elements from an non-growable list. */
-  static UnsupportedError remove() =>
-      new UnsupportedError("Cannot remove from non-growable List");
-}
-
-/**
- * Converts a growable list to a fixed length list with the same elements.
- *
- * For internal use only.
- * Only works on growable lists like the one created by `[]`.
- * May throw on any other list.
- *
- * The operation is efficient. It doesn't copy the elements, but converts
- * the existing list directly to a fixed length list.
- * That means that it is a destructive conversion.
- * The original list should not be used afterwards.
- *
- * The returned list may be the same list as the original,
- * or it may be a different list (according to [identical]).
- * The original list may have changed type to be a fixed list,
- * or become empty or been otherwise modified.
- * It will still be a valid object, so references to it will not, e.g., crash
- * the runtime if accessed, but no promises are made wrt. its contents.
- *
- * This unspecified behavior is the reason the function is not exposed to
- * users. We allow the underlying implementation to make the most efficient
- * conversion, at the cost of leaving the original list in an unspecified
- * state.
- */
-external List<T> makeListFixedLength<T>(List<T> growableList);
-
-/**
- * Converts a fixed-length list to an unmodifiable list.
- *
- * For internal use only.
- * Only works for core fixed-length lists as created by `new List(length)`,
- * or as returned by [makeListFixedLength].
- *
- * The operation is efficient. It doesn't copy the elements, but converts
- * the existing list directly to a fixed length list.
- * That means that it is a destructive conversion.
- * The original list should not be used afterwards.
- *
- * The unmodifiable list type is similar to the one used by const lists.
- */
-external List<T> makeFixedListUnmodifiable<T>(List<T> fixedLengthList);
diff --git a/sdk_nnbd/lib/internal/patch.dart b/sdk_nnbd/lib/internal/patch.dart
deleted file mode 100644
index 3fc9733..0000000
--- a/sdk_nnbd/lib/internal/patch.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of "dart:_internal";
-
-class _Patch {
-  const _Patch();
-}
-
-const _Patch patch = const _Patch();
diff --git a/sdk_nnbd/lib/internal/print.dart b/sdk_nnbd/lib/internal/print.dart
deleted file mode 100644
index 2028503..0000000
--- a/sdk_nnbd/lib/internal/print.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._internal;
-
-/**
- * This function is set by the first allocation of a Zone.
- *
- * Once the function is set the core `print` function calls this closure instead
- * of [printToConsole].
- *
- * This decouples the core library from the async library.
- */
-void Function(String)? printToZone = null;
-
-external void printToConsole(String line);
diff --git a/sdk_nnbd/lib/internal/sort.dart b/sdk_nnbd/lib/internal/sort.dart
deleted file mode 100644
index d6cca2e..0000000
--- a/sdk_nnbd/lib/internal/sort.dart
+++ /dev/null
@@ -1,385 +0,0 @@
-// Copyright (c) 2011, 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.
-
-part of dart._internal;
-
-/**
- * Dual-Pivot Quicksort algorithm.
- *
- * This class implements the dual-pivot quicksort algorithm as presented in
- * Vladimir Yaroslavskiy's paper.
- *
- * Some improvements have been copied from Android's implementation.
- */
-class Sort {
-  // When a list has less then [:_INSERTION_SORT_THRESHOLD:] elements it will
-  // be sorted by an insertion sort.
-  static const int _INSERTION_SORT_THRESHOLD = 32;
-
-  /**
-   * Sorts all elements of the given list [:a:] according to the given
-   * [:compare:] function.
-   *
-   * The [:compare:] function takes two arguments [:x:] and [:y:] and returns
-   *  -1 if [:x < y:],
-   *   0 if [:x == y:], and
-   *   1 if [:x > y:].
-   *
-   * The function's behavior must be consistent. It must not return different
-   * results for the same values.
-   */
-  static void sort<E>(List<E> a, int compare(E a, E b)) {
-    _doSort(a, 0, a.length - 1, compare);
-  }
-
-  /**
-   * Sorts all elements in the range [:from:] (inclusive) to [:to:] (exclusive)
-   * of the given list [:a:].
-   *
-   * If the given range is invalid an "OutOfRange" error is raised.
-   * TODO(floitsch): do we want an error?
-   *
-   * See [:sort:] for requirements of the [:compare:] function.
-   */
-  static void sortRange<E>(List<E> a, int from, int to, int compare(E a, E b)) {
-    if ((from < 0) || (to > a.length) || (to < from)) {
-      throw "OutOfRange";
-    }
-    _doSort(a, from, to - 1, compare);
-  }
-
-  /**
-   * Sorts the list in the interval [:left:] to [:right:] (both inclusive).
-   */
-  static void _doSort<E>(
-      List<E> a, int left, int right, int compare(E a, E b)) {
-    if ((right - left) <= _INSERTION_SORT_THRESHOLD) {
-      _insertionSort(a, left, right, compare);
-    } else {
-      _dualPivotQuicksort(a, left, right, compare);
-    }
-  }
-
-  static void _insertionSort<E>(
-      List<E> a, int left, int right, int compare(E a, E b)) {
-    for (int i = left + 1; i <= right; i++) {
-      var el = a[i];
-      int j = i;
-      while ((j > left) && (compare(a[j - 1], el) > 0)) {
-        a[j] = a[j - 1];
-        j--;
-      }
-      a[j] = el;
-    }
-  }
-
-  static void _dualPivotQuicksort<E>(
-      List<E> a, int left, int right, int compare(E a, E b)) {
-    assert(right - left > _INSERTION_SORT_THRESHOLD);
-
-    // Compute the two pivots by looking at 5 elements.
-    int sixth = (right - left + 1) ~/ 6;
-    int index1 = left + sixth;
-    int index5 = right - sixth;
-    int index3 = (left + right) ~/ 2; // The midpoint.
-    int index2 = index3 - sixth;
-    int index4 = index3 + sixth;
-
-    var el1 = a[index1];
-    var el2 = a[index2];
-    var el3 = a[index3];
-    var el4 = a[index4];
-    var el5 = a[index5];
-
-    // Sort the selected 5 elements using a sorting network.
-    if (compare(el1, el2) > 0) {
-      var t = el1;
-      el1 = el2;
-      el2 = t;
-    }
-    if (compare(el4, el5) > 0) {
-      var t = el4;
-      el4 = el5;
-      el5 = t;
-    }
-    if (compare(el1, el3) > 0) {
-      var t = el1;
-      el1 = el3;
-      el3 = t;
-    }
-    if (compare(el2, el3) > 0) {
-      var t = el2;
-      el2 = el3;
-      el3 = t;
-    }
-    if (compare(el1, el4) > 0) {
-      var t = el1;
-      el1 = el4;
-      el4 = t;
-    }
-    if (compare(el3, el4) > 0) {
-      var t = el3;
-      el3 = el4;
-      el4 = t;
-    }
-    if (compare(el2, el5) > 0) {
-      var t = el2;
-      el2 = el5;
-      el5 = t;
-    }
-    if (compare(el2, el3) > 0) {
-      var t = el2;
-      el2 = el3;
-      el3 = t;
-    }
-    if (compare(el4, el5) > 0) {
-      var t = el4;
-      el4 = el5;
-      el5 = t;
-    }
-
-    var pivot1 = el2;
-    var pivot2 = el4;
-
-    // el2 and el4 have been saved in the pivot variables. They will be written
-    // back, once the partitioning is finished.
-    a[index1] = el1;
-    a[index3] = el3;
-    a[index5] = el5;
-
-    a[index2] = a[left];
-    a[index4] = a[right];
-
-    int less = left + 1; // First element in the middle partition.
-    int great = right - 1; // Last element in the middle partition.
-
-    bool pivots_are_equal = (compare(pivot1, pivot2) == 0);
-    if (pivots_are_equal) {
-      var pivot = pivot1;
-      // Degenerated case where the partitioning becomes a Dutch national flag
-      // problem.
-      //
-      // [ |  < pivot  | == pivot | unpartitioned | > pivot  | ]
-      //  ^             ^          ^             ^            ^
-      // left         less         k           great         right
-      //
-      // a[left] and a[right] are undefined and are filled after the
-      // partitioning.
-      //
-      // Invariants:
-      //   1) for x in ]left, less[ : x < pivot.
-      //   2) for x in [less, k[ : x == pivot.
-      //   3) for x in ]great, right[ : x > pivot.
-      for (int k = less; k <= great; k++) {
-        var ak = a[k];
-        int comp = compare(ak, pivot);
-        if (comp == 0) continue;
-        if (comp < 0) {
-          if (k != less) {
-            a[k] = a[less];
-            a[less] = ak;
-          }
-          less++;
-        } else {
-          // comp > 0.
-          //
-          // Find the first element <= pivot in the range [k - 1, great] and
-          // put [:ak:] there. We know that such an element must exist:
-          // When k == less, then el3 (which is equal to pivot) lies in the
-          // interval. Otherwise a[k - 1] == pivot and the search stops at k-1.
-          // Note that in the latter case invariant 2 will be violated for a
-          // short amount of time. The invariant will be restored when the
-          // pivots are put into their final positions.
-          while (true) {
-            comp = compare(a[great], pivot);
-            if (comp > 0) {
-              great--;
-              // This is the only location in the while-loop where a new
-              // iteration is started.
-              continue;
-            } else if (comp < 0) {
-              // Triple exchange.
-              a[k] = a[less];
-              a[less++] = a[great];
-              a[great--] = ak;
-              break;
-            } else {
-              // comp == 0;
-              a[k] = a[great];
-              a[great--] = ak;
-              // Note: if great < k then we will exit the outer loop and fix
-              // invariant 2 (which we just violated).
-              break;
-            }
-          }
-        }
-      }
-    } else {
-      // We partition the list into three parts:
-      //  1. < pivot1
-      //  2. >= pivot1 && <= pivot2
-      //  3. > pivot2
-      //
-      // During the loop we have:
-      // [ | < pivot1 | >= pivot1 && <= pivot2 | unpartitioned  | > pivot2  | ]
-      //  ^            ^                        ^              ^             ^
-      // left         less                     k              great        right
-      //
-      // a[left] and a[right] are undefined and are filled after the
-      // partitioning.
-      //
-      // Invariants:
-      //   1. for x in ]left, less[ : x < pivot1
-      //   2. for x in [less, k[ : pivot1 <= x && x <= pivot2
-      //   3. for x in ]great, right[ : x > pivot2
-      for (int k = less; k <= great; k++) {
-        var ak = a[k];
-        int comp_pivot1 = compare(ak, pivot1);
-        if (comp_pivot1 < 0) {
-          if (k != less) {
-            a[k] = a[less];
-            a[less] = ak;
-          }
-          less++;
-        } else {
-          int comp_pivot2 = compare(ak, pivot2);
-          if (comp_pivot2 > 0) {
-            while (true) {
-              int comp = compare(a[great], pivot2);
-              if (comp > 0) {
-                great--;
-                if (great < k) break;
-                // This is the only location inside the loop where a new
-                // iteration is started.
-                continue;
-              } else {
-                // a[great] <= pivot2.
-                comp = compare(a[great], pivot1);
-                if (comp < 0) {
-                  // Triple exchange.
-                  a[k] = a[less];
-                  a[less++] = a[great];
-                  a[great--] = ak;
-                } else {
-                  // a[great] >= pivot1.
-                  a[k] = a[great];
-                  a[great--] = ak;
-                }
-                break;
-              }
-            }
-          }
-        }
-      }
-    }
-
-    // Move pivots into their final positions.
-    // We shrunk the list from both sides (a[left] and a[right] have
-    // meaningless values in them) and now we move elements from the first
-    // and third partition into these locations so that we can store the
-    // pivots.
-    a[left] = a[less - 1];
-    a[less - 1] = pivot1;
-    a[right] = a[great + 1];
-    a[great + 1] = pivot2;
-
-    // The list is now partitioned into three partitions:
-    // [ < pivot1   | >= pivot1 && <= pivot2   |  > pivot2   ]
-    //  ^            ^                        ^             ^
-    // left         less                     great        right
-
-    // Recursive descent. (Don't include the pivot values.)
-    _doSort(a, left, less - 2, compare);
-    _doSort(a, great + 2, right, compare);
-
-    if (pivots_are_equal) {
-      // All elements in the second partition are equal to the pivot. No
-      // need to sort them.
-      return;
-    }
-
-    // In theory it should be enough to call _doSort recursively on the second
-    // partition.
-    // The Android source however removes the pivot elements from the recursive
-    // call if the second partition is too large (more than 2/3 of the list).
-    if (less < index1 && great > index5) {
-      while (compare(a[less], pivot1) == 0) {
-        less++;
-      }
-      while (compare(a[great], pivot2) == 0) {
-        great--;
-      }
-
-      // Copy paste of the previous 3-way partitioning with adaptions.
-      //
-      // We partition the list into three parts:
-      //  1. == pivot1
-      //  2. > pivot1 && < pivot2
-      //  3. == pivot2
-      //
-      // During the loop we have:
-      // [ == pivot1 | > pivot1 && < pivot2 | unpartitioned  | == pivot2 ]
-      //              ^                      ^              ^
-      //            less                     k              great
-      //
-      // Invariants:
-      //   1. for x in [ *, less[ : x == pivot1
-      //   2. for x in [less, k[ : pivot1 < x && x < pivot2
-      //   3. for x in ]great, * ] : x == pivot2
-      for (int k = less; k <= great; k++) {
-        var ak = a[k];
-        int comp_pivot1 = compare(ak, pivot1);
-        if (comp_pivot1 == 0) {
-          if (k != less) {
-            a[k] = a[less];
-            a[less] = ak;
-          }
-          less++;
-        } else {
-          int comp_pivot2 = compare(ak, pivot2);
-          if (comp_pivot2 == 0) {
-            while (true) {
-              int comp = compare(a[great], pivot2);
-              if (comp == 0) {
-                great--;
-                if (great < k) break;
-                // This is the only location inside the loop where a new
-                // iteration is started.
-                continue;
-              } else {
-                // a[great] < pivot2.
-                comp = compare(a[great], pivot1);
-                if (comp < 0) {
-                  // Triple exchange.
-                  a[k] = a[less];
-                  a[less++] = a[great];
-                  a[great--] = ak;
-                } else {
-                  // a[great] == pivot1.
-                  a[k] = a[great];
-                  a[great--] = ak;
-                }
-                break;
-              }
-            }
-          }
-        }
-      }
-      // The second partition has now been cleared of pivot elements and looks
-      // as follows:
-      // [  *  |  > pivot1 && < pivot2  | * ]
-      //        ^                      ^
-      //       less                  great
-      // Sort the second partition using recursive descent.
-      _doSort(a, less, great, compare);
-    } else {
-      // The second partition looks as follows:
-      // [  *  |  >= pivot1 && <= pivot2  | * ]
-      //        ^                        ^
-      //       less                    great
-      // Simply sort it by recursive descent.
-      _doSort(a, less, great, compare);
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/internal/symbol.dart b/sdk_nnbd/lib/internal/symbol.dart
deleted file mode 100644
index bf48493..0000000
--- a/sdk_nnbd/lib/internal/symbol.dart
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._internal;
-
-/**
- * Implementation of [core.Symbol].  This class uses the same name as
- * a core class so a user can't tell the difference.
- *
- * The purpose of this class is to hide [_name] from user code, but
- * make it accessible to Dart platform code via the static method
- * [getName].
- */
-class Symbol implements core.Symbol {
-  final String _name;
-
-  /**
-   * Source of RegExp matching Dart reserved words.
-   *
-   * Reserved words are not allowed as identifiers.
-   */
-  static const String reservedWordRE =
-      r'(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|d(?:efault|o)|'
-      r'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|'
-      r'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|'
-      r'v(?:ar|oid)|w(?:hile|ith))';
-  /**
-   * Source of RegExp matching any public identifier.
-   *
-   * A public identifier is a valid identifier (not a reserved word)
-   * that doesn't start with '_'.
-   */
-  static const String publicIdentifierRE =
-      r'(?!' '$reservedWordRE' r'\b(?!\$))[a-zA-Z$][\w$]*';
-  /**
-   * Source of RegExp matching any identifier.
-   *
-   * It matches identifiers but not reserved words. The identifiers
-   * may start with '_'.
-   */
-  static const String identifierRE =
-      r'(?!' '$reservedWordRE' r'\b(?!\$))[a-zA-Z$_][\w$]*';
-  /**
-   * Source of RegExp matching a declarable operator names.
-   *
-   * The operators that can be declared using `operator` declarations are
-   * also the only ones allowed as symbols. The name of the operators is
-   * the same as the operator itself except for unary minus, where the name
-   * is "unary-".
-   */
-  static const String operatorRE =
-      r'(?:[\-+*/%&|^]|\[\]=?|==|~/?|<[<=]?|>[>=]?|unary-)';
-
-  // Grammar if symbols:
-  //    symbol ::= qualifiedName | <empty>
-  //    qualifiedName ::= publicIdentifier '.' qualifiedName | name
-  //    name ::= publicIdentifier
-  //           | publicIdentifier '='
-  //           | operator
-  // where publicIdentifier is any valid identifier (not a reserved word)
-  // that isn't private (doesn't start with '_').
-  //
-  // Railroad diagram of the accepted grammar:
-  //
-  //    /----------------\
-  //    |                |
-  //    |          /-[.]-/     /-[=]-\
-  //    \         /           /       \
-  //  -------[id]------------------------->
-  //       \                     /
-  //        \------[operator]---/
-  //            \              /
-  //             \------------/
-  //
-
-  /**
-   * RegExp that validates a non-empty non-private symbol.
-   *
-   * The empty symbol is handled before this regexp is used, and is not
-   * accepted.
-   */
-  static final RegExp publicSymbolPattern = new RegExp(
-      '^(?:$operatorRE\$|$publicIdentifierRE(?:=?\$|[.](?!\$)))+?\$');
-
-  // The grammar of symbols that may be private is the same as for public
-  // symbols, except that "publicIdentifier" is replaced by "identifier",
-  // which matches any identifier.
-
-  /**
-   * RegExp that validates a non-empty symbol.
-   *
-   * Private symbols are accepted.
-   *
-   * The empty symbol is handled before this regexp is used, and is not
-   * accepted.
-   */
-  static final RegExp symbolPattern =
-      new RegExp('^(?:$operatorRE\$|$identifierRE(?:=?\$|[.](?!\$)))+?\$');
-
-  external const Symbol(String name);
-
-  /**
-   * Platform-private method used by the mirror system to create
-   * otherwise invalid names.
-   */
-  const Symbol.unvalidated(this._name);
-
-  // This is called by dart2js.
-  Symbol.validated(String name) : this._name = validatePublicSymbol(name);
-
-  bool operator ==(Object other) => other is Symbol && _name == other._name;
-
-  external int get hashCode;
-
-  external toString();
-
-  /// Platform-private accessor which cannot be called from user libraries.
-  static String getName(Symbol symbol) => symbol._name;
-
-  static String validatePublicSymbol(String name) {
-    if (name.isEmpty || publicSymbolPattern.hasMatch(name)) return name;
-    if (name.startsWith('_')) {
-      // There may be other private parts in a qualified name than the first
-      // one, but this is a common case that deserves a specific error
-      // message.
-      throw new ArgumentError('"$name" is a private identifier');
-    }
-    throw new ArgumentError('"$name" is not a valid (qualified) symbol name');
-  }
-
-  /**
-   * Checks whether name is a valid symbol name.
-   *
-   * This test allows both private and non-private symbols.
-   */
-  static bool isValidSymbol(String name) {
-    return (name.isEmpty || symbolPattern.hasMatch(name));
-  }
-
-  external static String computeUnmangledName(Symbol symbol);
-}
diff --git a/sdk_nnbd/lib/io/bytes_builder.dart b/sdk_nnbd/lib/io/bytes_builder.dart
deleted file mode 100644
index 6f13693..0000000
--- a/sdk_nnbd/lib/io/bytes_builder.dart
+++ /dev/null
@@ -1,234 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * Builds a list of bytes, allowing bytes and lists of bytes to be added at the
- * end.
- *
- * Used to efficiently collect bytes and lists of bytes.
- */
-abstract class BytesBuilder {
-  /**
-   * Construct a new empty [BytesBuilder].
-   *
-   * If [copy] is true, the data is always copied when added to the list. If
-   * it [copy] is false, the data is only copied if needed. That means that if
-   * the lists are changed after added to the [BytesBuilder], it may effect the
-   * output. Default is `true`.
-   */
-  factory BytesBuilder({bool copy: true}) {
-    if (copy) {
-      return new _CopyingBytesBuilder();
-    } else {
-      return new _BytesBuilder();
-    }
-  }
-
-  /**
-   * Appends [bytes] to the current contents of the builder.
-   *
-   * Each value of [bytes] will be bit-representation truncated to the range
-   * 0 .. 255.
-   */
-  void add(List<int> bytes);
-
-  /**
-   * Append [byte] to the current contents of the builder.
-   *
-   * The [byte] will be bit-representation truncated to the range 0 .. 255.
-   */
-  void addByte(int byte);
-
-  /**
-   * Returns the contents of `this` and clears `this`.
-   *
-   * The list returned is a view of the internal buffer, limited to the
-   * [length].
-   */
-  Uint8List takeBytes();
-
-  /**
-   * Returns a copy of the current contents of the builder.
-   *
-   * Leaves the contents of the builder intact.
-   */
-  Uint8List toBytes();
-
-  /**
-   * The number of bytes in the builder.
-   */
-  int get length;
-
-  /**
-   * Returns `true` if the buffer is empty.
-   */
-  bool get isEmpty;
-
-  /**
-   * Returns `true` if the buffer is not empty.
-   */
-  bool get isNotEmpty;
-
-  /**
-   * Clear the contents of the builder.
-   */
-  void clear();
-}
-
-class _CopyingBytesBuilder implements BytesBuilder {
-  // Start with 1024 bytes.
-  static const int _initSize = 1024;
-
-  // Safe for reuse because a fixed-length empty list is immutable.
-  static final _emptyList = new Uint8List(0);
-
-  int _length = 0;
-  Uint8List _buffer;
-
-  _CopyingBytesBuilder([int initialCapacity = 0])
-      : _buffer = (initialCapacity <= 0)
-            ? _emptyList
-            : new Uint8List(_pow2roundup(initialCapacity));
-
-  void add(List<int> bytes) {
-    int bytesLength = bytes.length;
-    if (bytesLength == 0) return;
-    int required = _length + bytesLength;
-    if (_buffer.length < required) {
-      _grow(required);
-    }
-    assert(_buffer.length >= required);
-    if (bytes is Uint8List) {
-      _buffer.setRange(_length, required, bytes);
-    } else {
-      for (int i = 0; i < bytesLength; i++) {
-        _buffer[_length + i] = bytes[i];
-      }
-    }
-    _length = required;
-  }
-
-  void addByte(int byte) {
-    if (_buffer.length == _length) {
-      // The grow algorithm always at least doubles.
-      // If we added one to _length it would quadruple unnecessarily.
-      _grow(_length);
-    }
-    assert(_buffer.length > _length);
-    _buffer[_length] = byte;
-    _length++;
-  }
-
-  void _grow(int required) {
-    // We will create a list in the range of 2-4 times larger than
-    // required.
-    int newSize = required * 2;
-    if (newSize < _initSize) {
-      newSize = _initSize;
-    } else {
-      newSize = _pow2roundup(newSize);
-    }
-    var newBuffer = new Uint8List(newSize);
-    newBuffer.setRange(0, _buffer.length, _buffer);
-    _buffer = newBuffer;
-  }
-
-  Uint8List takeBytes() {
-    if (_length == 0) return _emptyList;
-    var buffer =
-        new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length);
-    clear();
-    return buffer;
-  }
-
-  Uint8List toBytes() {
-    if (_length == 0) return _emptyList;
-    return new Uint8List.fromList(
-        new Uint8List.view(_buffer.buffer, _buffer.offsetInBytes, _length));
-  }
-
-  int get length => _length;
-
-  bool get isEmpty => _length == 0;
-
-  bool get isNotEmpty => _length != 0;
-
-  void clear() {
-    _length = 0;
-    _buffer = _emptyList;
-  }
-
-  static int _pow2roundup(int x) {
-    assert(x > 0);
-    --x;
-    x |= x >> 1;
-    x |= x >> 2;
-    x |= x >> 4;
-    x |= x >> 8;
-    x |= x >> 16;
-    return x + 1;
-  }
-}
-
-class _BytesBuilder implements BytesBuilder {
-  int _length = 0;
-  final List<Uint8List> _chunks = [];
-
-  void add(List<int> bytes) {
-    Uint8List typedBytes;
-    if (bytes is Uint8List) {
-      typedBytes = bytes;
-    } else {
-      typedBytes = new Uint8List.fromList(bytes);
-    }
-    _chunks.add(typedBytes);
-    _length += typedBytes.length;
-  }
-
-  void addByte(int byte) {
-    _chunks.add(new Uint8List(1)..[0] = byte);
-    _length++;
-  }
-
-  Uint8List takeBytes() {
-    if (_length == 0) return _CopyingBytesBuilder._emptyList;
-    if (_chunks.length == 1) {
-      var buffer = _chunks[0];
-      clear();
-      return buffer;
-    }
-    var buffer = new Uint8List(_length);
-    int offset = 0;
-    for (var chunk in _chunks) {
-      buffer.setRange(offset, offset + chunk.length, chunk);
-      offset += chunk.length;
-    }
-    clear();
-    return buffer;
-  }
-
-  Uint8List toBytes() {
-    if (_length == 0) return _CopyingBytesBuilder._emptyList;
-    var buffer = new Uint8List(_length);
-    int offset = 0;
-    for (var chunk in _chunks) {
-      buffer.setRange(offset, offset + chunk.length, chunk);
-      offset += chunk.length;
-    }
-    return buffer;
-  }
-
-  int get length => _length;
-
-  bool get isEmpty => _length == 0;
-
-  bool get isNotEmpty => _length != 0;
-
-  void clear() {
-    _length = 0;
-    _chunks.clear();
-  }
-}
diff --git a/sdk_nnbd/lib/io/common.dart b/sdk_nnbd/lib/io/common.dart
deleted file mode 100644
index 9688d8d..0000000
--- a/sdk_nnbd/lib/io/common.dart
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-// Constants used when working with native ports.
-// These must match the constants in runtime/bin/dartutils.h class CObject.
-const int _successResponse = 0;
-const int _illegalArgumentResponse = 1;
-const int _osErrorResponse = 2;
-const int _fileClosedResponse = 3;
-
-const int _errorResponseErrorType = 0;
-const int _osErrorResponseErrorCode = 1;
-const int _osErrorResponseMessage = 2;
-
-// Functions used to receive exceptions from native ports.
-bool _isErrorResponse(response) =>
-    response is List && response[0] != _successResponse;
-
-/**
- * Returns an Exception or an Error
- */
-_exceptionFromResponse(response, String message, String path) {
-  assert(_isErrorResponse(response));
-  switch (response[_errorResponseErrorType]) {
-    case _illegalArgumentResponse:
-      return new ArgumentError("$message: $path");
-    case _osErrorResponse:
-      var err = new OSError(response[_osErrorResponseMessage],
-          response[_osErrorResponseErrorCode]);
-      return new FileSystemException(message, path, err);
-    case _fileClosedResponse:
-      return new FileSystemException("File closed", path);
-    default:
-      return new Exception("Unknown error");
-  }
-}
-
-/**
- * Base class for all IO related exceptions.
- */
-abstract class IOException implements Exception {
-  String toString() => "IOException";
-}
-
-/**
-  * An [OSError] object holds information about an error from the
-  * operating system.
-  */
-@pragma("vm:entry-point")
-class OSError implements Exception {
-  /** Constant used to indicate that no OS error code is available. */
-  static const int noErrorCode = -1;
-
-  /// Error message supplied by the operating system. This will be empty if no
-  /// message is associated with the error.
-  final String message;
-
-  /// Error code supplied by the operating system.
-  ///
-  /// Will have the value [OSError.noErrorCode] if there is no error code
-  /// associated with the error.
-  final int errorCode;
-
-  /** Creates an OSError object from a message and an errorCode. */
-  @pragma("vm:entry-point")
-  const OSError([this.message = "", this.errorCode = noErrorCode]);
-
-  /** Converts an OSError object to a string representation. */
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("OS Error");
-    if (message.isNotEmpty) {
-      sb..write(": ")..write(message);
-      if (errorCode != noErrorCode) {
-        sb..write(", errno = ")..write(errorCode.toString());
-      }
-    } else if (errorCode != noErrorCode) {
-      sb..write(": errno = ")..write(errorCode.toString());
-    }
-    return sb.toString();
-  }
-}
-
-// Object for holding a buffer and an offset.
-class _BufferAndStart {
-  List<int> buffer;
-  int start;
-  _BufferAndStart(this.buffer, this.start);
-}
-
-// Ensure that the input List can be serialized through a native port.
-// Only Int8List and Uint8List Lists are serialized directly.
-// All other lists are first copied into a Uint8List. This has the added
-// benefit that it is faster to access from the C code as well.
-_BufferAndStart _ensureFastAndSerializableByteData(
-    List<int> buffer, int start, int end) {
-  if (_isDirectIOCapableTypedList(buffer)) {
-    return new _BufferAndStart(buffer, start);
-  }
-  int length = end - start;
-  var newBuffer = new Uint8List(length);
-  newBuffer.setRange(0, length, buffer, start);
-  return new _BufferAndStart(newBuffer, 0);
-}
-
-// The VM will use ClassID to check whether buffer is Uint8List or Int8List.
-external bool _isDirectIOCapableTypedList(List<int> buffer);
-
-class _IOCrypto {
-  external static Uint8List getRandomBytes(int count);
-}
diff --git a/sdk_nnbd/lib/io/data_transformer.dart b/sdk_nnbd/lib/io/data_transformer.dart
deleted file mode 100644
index 4346a1a..0000000
--- a/sdk_nnbd/lib/io/data_transformer.dart
+++ /dev/null
@@ -1,678 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * Exposes ZLib options for input parameters.
- *
- * See http://www.zlib.net/manual.html for more documentation.
- */
-abstract class ZLibOption {
-  /// Minimal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
-  /// and [ZLibDecoder.windowBits].
-  static const int minWindowBits = 8;
-  @Deprecated("Use minWindowBits instead")
-  static const int MIN_WINDOW_BITS = 8;
-
-  /// Maximal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
-  /// and [ZLibDecoder.windowBits].
-  static const int maxWindowBits = 15;
-  @Deprecated("Use maxWindowBits instead")
-  static const int MAX_WINDOW_BITS = 15;
-
-  /// Default value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
-  /// and [ZLibDecoder.windowBits].
-  static const int defaultWindowBits = 15;
-  @Deprecated("Use defaultWindowBits instead")
-  static const int DEFAULT_WINDOW_BITS = 15;
-
-  /// Minimal value for [ZLibCodec.level] and [ZLibEncoder.level].
-  static const int minLevel = -1;
-  @Deprecated("Use minLevel instead")
-  static const int MIN_LEVEL = -1;
-
-  /// Maximal value for [ZLibCodec.level] and [ZLibEncoder.level]
-  static const int maxLevel = 9;
-  @Deprecated("Use maxLevel instead")
-  static const int MAX_LEVEL = 9;
-
-  /// Default value for [ZLibCodec.level] and [ZLibEncoder.level].
-  static const int defaultLevel = 6;
-  @Deprecated("Use defaultLevel instead")
-  static const int DEFAULT_LEVEL = 6;
-
-  /// Minimal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
-  static const int minMemLevel = 1;
-  @Deprecated("Use minMemLevel instead")
-  static const int MIN_MEM_LEVEL = 1;
-
-  /// Maximal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
-  static const int maxMemLevel = 9;
-  @Deprecated("Use maxMemLevel instead")
-  static const int MAX_MEM_LEVEL = 9;
-
-  /// Default value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
-  static const int defaultMemLevel = 8;
-  @Deprecated("Use defaultMemLevel instead")
-  static const int DEFAULT_MEM_LEVEL = 8;
-
-  /// Recommended strategy for data produced by a filter (or predictor)
-  static const int strategyFiltered = 1;
-  @Deprecated("Use strategyFiltered instead")
-  static const int STRATEGY_FILTERED = 1;
-
-  /// Use this strategy to force Huffman encoding only (no string match)
-  static const int strategyHuffmanOnly = 2;
-  @Deprecated("Use strategyHuffmanOnly instead")
-  static const int STRATEGY_HUFFMAN_ONLY = 2;
-
-  /// Use this strategy to limit match distances to one (run-length encoding)
-  static const int strategyRle = 3;
-  @Deprecated("Use strategyRle instead")
-  static const int STRATEGY_RLE = 3;
-
-  /// This strategy prevents the use of dynamic Huffman codes, allowing for a
-  /// simpler decoder
-  static const int strategyFixed = 4;
-  @Deprecated("Use strategyFixed instead")
-  static const int STRATEGY_FIXED = 4;
-
-  /// Recommended strategy for normal data
-  static const int strategyDefault = 0;
-  @Deprecated("Use strategyDefault instead")
-  static const int STRATEGY_DEFAULT = 0;
-}
-
-/**
- * An instance of the default implementation of the [ZLibCodec].
- */
-const ZLibCodec zlib = const ZLibCodec._default();
-@Deprecated("Use zlib instead")
-const ZLibCodec ZLIB = zlib;
-
-/**
- * The [ZLibCodec] encodes raw bytes to ZLib compressed bytes and decodes ZLib
- * compressed bytes to raw bytes.
- */
-class ZLibCodec extends Codec<List<int>, List<int>> {
-  /**
-   * When true, `GZip` frames will be added to the compressed data.
-   */
-  final bool gzip;
-
-  /**
-   * The compression-[level] can be set in the range of `-1..9`, with `6` being
-   * the default compression level. Levels above `6` will have higher
-   * compression rates at the cost of more CPU and memory usage. Levels below
-   * `6` will use less CPU and memory at the cost of lower compression rates.
-   */
-  final int level;
-
-  /**
-   * Specifies how much memory should be allocated for the internal compression
-   * state. `1` uses minimum memory but is slow and reduces compression ratio;
-   * `9` uses maximum memory for optimal speed. The default value is `8`.
-   *
-   * The memory requirements for deflate are (in bytes):
-   *
-   *     (1 << (windowBits + 2)) +  (1 << (memLevel + 9))
-   * that is: 128K for windowBits = 15 + 128K for memLevel = 8 (default values)
-   */
-  final int memLevel;
-
-  /**
-   * Tunes the compression algorithm. Use the value strategyDefault for normal
-   * data, strategyFiltered for data produced by a filter (or predictor),
-   * strategyHuffmanOnly to force Huffman encoding only (no string match), or
-   * strategyRle to limit match distances to one (run-length encoding).
-   */
-  final int strategy;
-
-  /**
-   * Base two logarithm of the window size (the size of the history buffer). It
-   * should be in the range 8..15. Larger values result in better compression at
-   * the expense of memory usage. The default value is 15
-   */
-  final int windowBits;
-
-  /**
-   * When true, deflate generates raw data with no zlib header or trailer, and
-   * will not compute an adler32 check value
-   */
-  final bool raw;
-
-  /**
-   * Initial compression dictionary.
-   *
-   * It should consist of strings (byte sequences) that are likely to be
-   * encountered later in the data to be compressed, with the most commonly used
-   * strings preferably put towards the end of the dictionary. Using a
-   * dictionary is most useful when the data to be compressed is short and can
-   * be predicted with good accuracy; the data can then be compressed better
-   * than with the default empty dictionary.
-   */
-  final List<int>? dictionary;
-
-  ZLibCodec(
-      {this.level: ZLibOption.defaultLevel,
-      this.windowBits: ZLibOption.defaultWindowBits,
-      this.memLevel: ZLibOption.defaultMemLevel,
-      this.strategy: ZLibOption.strategyDefault,
-      this.dictionary,
-      this.raw: false,
-      this.gzip: false}) {
-    _validateZLibeLevel(level);
-    _validateZLibMemLevel(memLevel);
-    _validateZLibStrategy(strategy);
-    _validateZLibWindowBits(windowBits);
-  }
-
-  const ZLibCodec._default()
-      : level = ZLibOption.defaultLevel,
-        windowBits = ZLibOption.defaultWindowBits,
-        memLevel = ZLibOption.defaultMemLevel,
-        strategy = ZLibOption.strategyDefault,
-        raw = false,
-        gzip = false,
-        dictionary = null;
-
-  /**
-   * Get a [ZLibEncoder] for encoding to `ZLib` compressed data.
-   */
-  ZLibEncoder get encoder => new ZLibEncoder(
-      gzip: false,
-      level: level,
-      windowBits: windowBits,
-      memLevel: memLevel,
-      strategy: strategy,
-      dictionary: dictionary,
-      raw: raw);
-
-  /**
-   * Get a [ZLibDecoder] for decoding `ZLib` compressed data.
-   */
-  ZLibDecoder get decoder =>
-      new ZLibDecoder(windowBits: windowBits, dictionary: dictionary, raw: raw);
-}
-
-/**
- * An instance of the default implementation of the [GZipCodec].
- */
-const GZipCodec gzip = const GZipCodec._default();
-@Deprecated("Use gzip instead")
-const GZipCodec GZIP = gzip;
-
-/**
- * The [GZipCodec] encodes raw bytes to GZip compressed bytes and decodes GZip
- * compressed bytes to raw bytes.
- *
- * The difference between [ZLibCodec] and [GZipCodec] is that the [GZipCodec]
- * wraps the `ZLib` compressed bytes in `GZip` frames.
- */
-class GZipCodec extends Codec<List<int>, List<int>> {
-  /**
-   * When true, `GZip` frames will be added to the compressed data.
-   */
-  final bool gzip;
-
-  /**
-   * The compression-[level] can be set in the range of `-1..9`, with `6` being
-   * the default compression level. Levels above `6` will have higher
-   * compression rates at the cost of more CPU and memory usage. Levels below
-   * `6` will use less CPU and memory at the cost of lower compression rates.
-   */
-  final int level;
-
-  /**
-   * Specifies how much memory should be allocated for the internal compression
-   * state. `1` uses minimum memory but is slow and reduces compression ratio;
-   * `9` uses maximum memory for optimal speed. The default value is `8`.
-   *
-   * The memory requirements for deflate are (in bytes):
-   *
-   *     (1 << (windowBits + 2)) +  (1 << (memLevel + 9))
-   * that is: 128K for windowBits = 15 + 128K for memLevel = 8 (default values)
-   */
-  final int memLevel;
-
-  /**
-   * Tunes the compression algorithm. Use the value
-   * [ZLibOption.strategyDefault] for normal data,
-   * [ZLibOption.strategyFiltered] for data produced by a filter
-   * (or predictor), [ZLibOption.strategyHuffmanOnly] to force Huffman
-   * encoding only (no string match), or [ZLibOption.strategyRle] to limit
-   * match distances to one (run-length encoding).
-   */
-  final int strategy;
-
-  /**
-   * Base two logarithm of the window size (the size of the history buffer). It
-   * should be in the range `8..15`. Larger values result in better compression
-   * at the expense of memory usage. The default value is `15`
-   */
-  final int windowBits;
-
-  /**
-   * Initial compression dictionary.
-   *
-   * It should consist of strings (byte sequences) that are likely to be
-   * encountered later in the data to be compressed, with the most commonly used
-   * strings preferably put towards the end of the dictionary. Using a
-   * dictionary is most useful when the data to be compressed is short and can
-   * be predicted with good accuracy; the data can then be compressed better
-   * than with the default empty dictionary.
-   */
-  final List<int>? dictionary;
-
-  /**
-   * When true, deflate generates raw data with no zlib header or trailer, and
-   * will not compute an adler32 check value
-   */
-  final bool raw;
-
-  GZipCodec(
-      {this.level: ZLibOption.defaultLevel,
-      this.windowBits: ZLibOption.defaultWindowBits,
-      this.memLevel: ZLibOption.defaultMemLevel,
-      this.strategy: ZLibOption.strategyDefault,
-      this.dictionary,
-      this.raw: false,
-      this.gzip: true}) {
-    _validateZLibeLevel(level);
-    _validateZLibMemLevel(memLevel);
-    _validateZLibStrategy(strategy);
-    _validateZLibWindowBits(windowBits);
-  }
-
-  const GZipCodec._default()
-      : level = ZLibOption.defaultLevel,
-        windowBits = ZLibOption.defaultWindowBits,
-        memLevel = ZLibOption.defaultMemLevel,
-        strategy = ZLibOption.strategyDefault,
-        raw = false,
-        gzip = true,
-        dictionary = null;
-
-  /**
-   * Get a [ZLibEncoder] for encoding to `GZip` compressed data.
-   */
-  ZLibEncoder get encoder => new ZLibEncoder(
-      gzip: true,
-      level: level,
-      windowBits: windowBits,
-      memLevel: memLevel,
-      strategy: strategy,
-      dictionary: dictionary,
-      raw: raw);
-
-  /**
-   * Get a [ZLibDecoder] for decoding `GZip` compressed data.
-   */
-  ZLibDecoder get decoder =>
-      new ZLibDecoder(windowBits: windowBits, dictionary: dictionary, raw: raw);
-}
-
-/**
- * The [ZLibEncoder] encoder is used by [ZLibCodec] and [GZipCodec] to compress
- * data.
- */
-class ZLibEncoder extends Converter<List<int>, List<int>> {
-  /**
-   * When true, `GZip` frames will be added to the compressed data.
-   */
-  final bool gzip;
-
-  /**
-   * The compression-[level] can be set in the range of `-1..9`, with `6` being
-   * the default compression level. Levels above `6` will have higher
-   * compression rates at the cost of more CPU and memory usage. Levels below
-   * `6` will use less CPU and memory at the cost of lower compression rates.
-   */
-  final int level;
-
-  /**
-   * Specifies how much memory should be allocated for the internal compression
-   * state. `1` uses minimum memory but is slow and reduces compression ratio;
-   * `9` uses maximum memory for optimal speed. The default value is `8`.
-   *
-   * The memory requirements for deflate are (in bytes):
-   *
-   *     (1 << (windowBits + 2)) +  (1 << (memLevel + 9))
-   * that is: 128K for windowBits = 15 + 128K for memLevel = 8 (default values)
-   */
-  final int memLevel;
-
-  /**
-   * Tunes the compression algorithm. Use the value
-   * [ZLibOption.strategyDefault] for normal data,
-   * [ZLibOption.strategyFiltered] for data produced by a filter
-   * (or predictor), [ZLibOption.strategyHuffmanOnly] to force Huffman
-   * encoding only (no string match), or [ZLibOption.strategyRle] to limit
-   * match distances to one (run-length encoding).
-   */
-  final int strategy;
-
-  /**
-   * Base two logarithm of the window size (the size of the history buffer). It
-   * should be in the range `8..15`. Larger values result in better compression
-   * at the expense of memory usage. The default value is `15`
-   */
-  final int windowBits;
-
-  /**
-   * Initial compression dictionary.
-   *
-   * It should consist of strings (byte sequences) that are likely to be
-   * encountered later in the data to be compressed, with the most commonly used
-   * strings preferably put towards the end of the dictionary. Using a
-   * dictionary is most useful when the data to be compressed is short and can
-   * be predicted with good accuracy; the data can then be compressed better
-   * than with the default empty dictionary.
-   */
-  final List<int>? dictionary;
-
-  /**
-   * When true, deflate generates raw data with no zlib header or trailer, and
-   * will not compute an adler32 check value
-   */
-  final bool raw;
-
-  ZLibEncoder(
-      {this.gzip: false,
-      this.level: ZLibOption.defaultLevel,
-      this.windowBits: ZLibOption.defaultWindowBits,
-      this.memLevel: ZLibOption.defaultMemLevel,
-      this.strategy: ZLibOption.strategyDefault,
-      this.dictionary,
-      this.raw: false}) {
-    _validateZLibeLevel(level);
-    _validateZLibMemLevel(memLevel);
-    _validateZLibStrategy(strategy);
-    _validateZLibWindowBits(windowBits);
-  }
-
-  /**
-   * Convert a list of bytes using the options given to the ZLibEncoder
-   * constructor.
-   */
-  List<int> convert(List<int> bytes) {
-    _BufferSink sink = new _BufferSink();
-    startChunkedConversion(sink)
-      ..add(bytes)
-      ..close();
-    return sink.builder.takeBytes();
-  }
-
-  /**
-   * Start a chunked conversion using the options given to the [ZLibEncoder]
-   * constructor. While it accepts any [Sink] taking [List<int>]'s,
-   * the optimal sink to be passed as [sink] is a [ByteConversionSink].
-   */
-  ByteConversionSink startChunkedConversion(Sink<List<int>> sink) {
-    if (sink is! ByteConversionSink) {
-      sink = new ByteConversionSink.from(sink);
-    }
-    return new _ZLibEncoderSink._(
-        sink, gzip, level, windowBits, memLevel, strategy, dictionary, raw);
-  }
-}
-
-/**
- * The [ZLibDecoder] is used by [ZLibCodec] and [GZipCodec] to decompress data.
- */
-class ZLibDecoder extends Converter<List<int>, List<int>> {
-  /**
-   * Base two logarithm of the window size (the size of the history buffer). It
-   * should be in the range `8..15`. Larger values result in better compression
-   * at the expense of memory usage. The default value is `15`.
-   */
-  final int windowBits;
-
-  /**
-   * Initial compression dictionary.
-   *
-   * It should consist of strings (byte sequences) that are likely to be
-   * encountered later in the data to be compressed, with the most commonly used
-   * strings preferably put towards the end of the dictionary. Using a
-   * dictionary is most useful when the data to be compressed is short and can
-   * be predicted with good accuracy; the data can then be compressed better
-   * than with the default empty dictionary.
-   */
-  final List<int>? dictionary;
-
-  /**
-   * When true, deflate generates raw data with no zlib header or trailer, and
-   * will not compute an adler32 check value
-   */
-  final bool raw;
-
-  ZLibDecoder(
-      {this.windowBits: ZLibOption.defaultWindowBits,
-      this.dictionary,
-      this.raw: false}) {
-    _validateZLibWindowBits(windowBits);
-  }
-
-  /**
-   * Convert a list of bytes using the options given to the [ZLibDecoder]
-   * constructor.
-   */
-  List<int> convert(List<int> bytes) {
-    _BufferSink sink = new _BufferSink();
-    startChunkedConversion(sink)
-      ..add(bytes)
-      ..close();
-    return sink.builder.takeBytes();
-  }
-
-  /**
-   * Start a chunked conversion. While it accepts any [Sink]
-   * taking [List<int>]'s, the optimal sink to be passed as [sink] is a
-   * [ByteConversionSink].
-   */
-  ByteConversionSink startChunkedConversion(Sink<List<int>> sink) {
-    if (sink is! ByteConversionSink) {
-      sink = new ByteConversionSink.from(sink);
-    }
-    return new _ZLibDecoderSink._(sink, windowBits, dictionary, raw);
-  }
-}
-
-/**
- * The [RawZLibFilter] class provides a low-level interface to zlib.
- */
-abstract class RawZLibFilter {
-  /**
-   * Returns a a [RawZLibFilter] whose [process] and [processed] methods
-   * compress data.
-   */
-  factory RawZLibFilter.deflateFilter({
-    bool gzip: false,
-    int level: ZLibOption.defaultLevel,
-    int windowBits: ZLibOption.defaultWindowBits,
-    int memLevel: ZLibOption.defaultMemLevel,
-    int strategy: ZLibOption.strategyDefault,
-    List<int>? dictionary,
-    bool raw: false,
-  }) {
-    return _makeZLibDeflateFilter(
-        gzip, level, windowBits, memLevel, strategy, dictionary, raw);
-  }
-
-  /**
-   * Returns a a [RawZLibFilter] whose [process] and [processed] methods
-   * decompress data.
-   */
-  factory RawZLibFilter.inflateFilter({
-    int windowBits: ZLibOption.defaultWindowBits,
-    List<int>? dictionary,
-    bool raw: false,
-  }) {
-    return _makeZLibInflateFilter(windowBits, dictionary, raw);
-  }
-
-  /**
-   * Call to process a chunk of data. A call to [process] should only be made
-   * when [processed] returns [:null:].
-   */
-  void process(List<int> data, int start, int end);
-
-  /**
-   * Get a chunk of processed data. When there are no more data available,
-   * [processed] will return [:null:]. Set [flush] to [:false:] for non-final
-   * calls to improve performance of some filters.
-   *
-   * The last call to [processed] should have [end] set to [:true:]. This will
-   * make sure an 'end' packet is written on the stream.
-   */
-  List<int>? processed({bool flush: true, bool end: false});
-
-  external static RawZLibFilter _makeZLibDeflateFilter(
-      bool gzip,
-      int level,
-      int windowBits,
-      int memLevel,
-      int strategy,
-      List<int>? dictionary,
-      bool raw);
-
-  external static RawZLibFilter _makeZLibInflateFilter(
-      int windowBits, List<int>? dictionary, bool raw);
-}
-
-class _BufferSink extends ByteConversionSink {
-  final BytesBuilder builder = new BytesBuilder(copy: false);
-
-  void add(List<int> chunk) {
-    builder.add(chunk);
-  }
-
-  void addSlice(List<int> chunk, int start, int end, bool isLast) {
-    if (chunk is Uint8List) {
-      Uint8List list = chunk;
-      builder.add(new Uint8List.view(
-          list.buffer, list.offsetInBytes + start, end - start));
-    } else {
-      builder.add(chunk.sublist(start, end));
-    }
-  }
-
-  void close() {}
-}
-
-class _ZLibEncoderSink extends _FilterSink {
-  _ZLibEncoderSink._(
-      ByteConversionSink sink,
-      bool gzip,
-      int level,
-      int windowBits,
-      int memLevel,
-      int strategy,
-      List<int>? dictionary,
-      bool raw)
-      : super(
-            sink,
-            RawZLibFilter._makeZLibDeflateFilter(
-                gzip, level, windowBits, memLevel, strategy, dictionary, raw));
-}
-
-class _ZLibDecoderSink extends _FilterSink {
-  _ZLibDecoderSink._(
-      ByteConversionSink sink, int windowBits, List<int>? dictionary, bool raw)
-      : super(sink,
-            RawZLibFilter._makeZLibInflateFilter(windowBits, dictionary, raw));
-}
-
-class _FilterSink extends ByteConversionSink {
-  final RawZLibFilter _filter;
-  final ByteConversionSink _sink;
-  bool _closed = false;
-  bool _empty = true;
-
-  _FilterSink(this._sink, this._filter);
-
-  void add(List<int> data) {
-    addSlice(data, 0, data.length, false);
-  }
-
-  void addSlice(List<int> data, int start, int end, bool isLast) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(end, "end");
-    if (_closed) return;
-    RangeError.checkValidRange(start, end, data.length);
-    try {
-      _empty = false;
-      _BufferAndStart bufferAndStart =
-          _ensureFastAndSerializableByteData(data, start, end);
-      _filter.process(bufferAndStart.buffer, bufferAndStart.start,
-          end - (start - bufferAndStart.start));
-      List<int>? out;
-      while (true) {
-        final out = _filter.processed(flush: false);
-        if (out == null) break;
-        _sink.add(out);
-      }
-    } catch (e) {
-      _closed = true;
-      rethrow;
-    }
-
-    if (isLast) close();
-  }
-
-  void close() {
-    if (_closed) return;
-    // Be sure to send process an empty chunk of data. Without this, the empty
-    // message would not have a GZip frame (if compressed with GZip).
-    if (_empty) _filter.process(const [], 0, 0);
-    try {
-      while (true) {
-        final out = _filter.processed(end: true);
-        if (out == null) break;
-        _sink.add(out);
-      }
-    } catch (e) {
-      // TODO(kevmoo): not sure why this isn't a try/finally
-      _closed = true;
-      throw e;
-    }
-    _closed = true;
-    _sink.close();
-  }
-}
-
-void _validateZLibWindowBits(int windowBits) {
-  if (ZLibOption.minWindowBits > windowBits ||
-      ZLibOption.maxWindowBits < windowBits) {
-    throw new RangeError.range(
-        windowBits, ZLibOption.minWindowBits, ZLibOption.maxWindowBits);
-  }
-}
-
-void _validateZLibeLevel(int level) {
-  if (ZLibOption.minLevel > level || ZLibOption.maxLevel < level) {
-    throw new RangeError.range(level, ZLibOption.minLevel, ZLibOption.maxLevel);
-  }
-}
-
-void _validateZLibMemLevel(int memLevel) {
-  if (ZLibOption.minMemLevel > memLevel || ZLibOption.maxMemLevel < memLevel) {
-    throw new RangeError.range(
-        memLevel, ZLibOption.minMemLevel, ZLibOption.maxMemLevel);
-  }
-}
-
-void _validateZLibStrategy(int strategy) {
-  const strategies = const <int>[
-    ZLibOption.strategyFiltered,
-    ZLibOption.strategyHuffmanOnly,
-    ZLibOption.strategyRle,
-    ZLibOption.strategyFixed,
-    ZLibOption.strategyDefault
-  ];
-  if (strategies.indexOf(strategy) == -1) {
-    throw new ArgumentError("Unsupported 'strategy'");
-  }
-}
diff --git a/sdk_nnbd/lib/io/directory.dart b/sdk_nnbd/lib/io/directory.dart
deleted file mode 100644
index 90e2159..0000000
--- a/sdk_nnbd/lib/io/directory.dart
+++ /dev/null
@@ -1,344 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-/**
- * A reference to a directory (or _folder_) on the file system.
- *
- * A Directory instance is an object holding a [path] on which operations can
- * be performed. The path to the directory can be [absolute] or relative.
- * You can get the parent directory using the getter [parent],
- * a property inherited from [FileSystemEntity].
- *
- * In addition to being used as an instance to access the file system,
- * Directory has a number of static properties, such as [systemTemp],
- * which gets the system's temporary directory, and the getter and setter
- * [current], which you can use to access or change the current directory.
- *
- * Create a new Directory object with a pathname to access the specified
- * directory on the file system from your program.
- *
- *     var myDir = new Directory('myDir');
- *
- * Most methods in this class occur in synchronous and asynchronous pairs,
- * for example, [create] and [createSync].
- * Unless you have a specific reason for using the synchronous version
- * of a method, prefer the asynchronous version to avoid blocking your program.
- *
- * ## Create a directory
- *
- * The following code sample creates a directory using the [create] method.
- * By setting the `recursive` parameter to true, you can create the
- * named directory and all its necessary parent directories,
- * if they do not already exist.
- *
- *     import 'dart:io';
- *
- *     void main() {
- *       // Creates dir/ and dir/subdir/.
- *       new Directory('dir/subdir').create(recursive: true)
- *         // The created directory is returned as a Future.
- *         .then((Directory directory) {
- *           print(directory.path);
- *       });
- *     }
- *
- * ## List a directory
- *
- * Use the [list] or [listSync] methods to get the files and directories
- * contained by a directory.
- * Set `recursive` to true to recursively list all subdirectories.
- * Set `followLinks` to true to follow symbolic links.
- * The list method returns a [Stream] that provides FileSystemEntity
- * objects. Use the listen callback function to process each object
- * as it become available.
- *
- *     import 'dart:io';
- *
- *     void main() {
- *       // Get the system temp directory.
- *       var systemTempDir = Directory.systemTemp;
- *
- *       // List directory contents, recursing into sub-directories,
- *       // but not following symbolic links.
- *       systemTempDir.list(recursive: true, followLinks: false)
- *         .listen((FileSystemEntity entity) {
- *           print(entity.path);
- *         });
- *     }
- *
- * ## The use of Futures
- *
- * I/O operations can block a program for some period of time while it waits for
- * the operation to complete. To avoid this, all
- * methods involving I/O have an asynchronous variant which returns a [Future].
- * This future completes when the I/O operation finishes. While the I/O
- * operation is in progress, the Dart program is not blocked,
- * and can perform other operations.
- *
- * For example,
- * the [exists] method, which determines whether the directory exists,
- * returns a boolean value using a Future.
- * Use `then` to register a callback function, which is called when
- * the value is ready.
- *
- *     import 'dart:io';
- *
- *     main() {
- *       final myDir = new Directory('dir');
- *       myDir.exists().then((isThere) {
- *         isThere ? print('exists') : print('non-existent');
- *       });
- *     }
- *
- *
- * In addition to exists, the [stat], [rename], and
- * other methods, return Futures.
- *
- * ## Other resources
- *
- * * [Dart by Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- *   provides additional task-oriented code samples that show how to use
- *   various API from the Directory class and the related [File] class.
- *
- * * [I/O for Command-Line
- *   Apps](https://www.dartlang.org/docs/dart-up-and-running/ch03.html#dartio---io-for-command-line-apps)
- *   a section from _A Tour of the Dart Libraries_ covers files and directories.
- *
- * * [Write Command-Line Apps](https://www.dartlang.org/docs/tutorials/cmdline/),
- *   a tutorial about writing command-line apps, includes information about
- *   files and directories.
- */
-@pragma("vm:entry-point")
-abstract class Directory implements FileSystemEntity {
-  /**
-   * Gets the path of this directory.
-   */
-  String get path;
-
-  /**
-   * Creates a [Directory] object.
-   *
-   * If [path] is a relative path, it will be interpreted relative to the
-   * current working directory (see [Directory.current]), when used.
-   *
-   * If [path] is an absolute path, it will be immune to changes to the
-   * current working directory.
-   */
-  @pragma("vm:entry-point")
-  factory Directory(String path) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return new _Directory(path);
-    }
-    return overrides.createDirectory(path);
-  }
-
-  @pragma("vm:entry-point")
-  factory Directory.fromRawPath(Uint8List path) {
-    // TODO(bkonyi): Handle overrides.
-    return new _Directory.fromRawPath(path);
-  }
-
-  /**
-   * Create a Directory object from a URI.
-   *
-   * If [uri] cannot reference a directory this throws [UnsupportedError].
-   */
-  factory Directory.fromUri(Uri uri) => new Directory(uri.toFilePath());
-
-  /**
-   * Creates a directory object pointing to the current working
-   * directory.
-   */
-  static Directory get current {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _Directory.current;
-    }
-    return overrides.getCurrentDirectory();
-  }
-
-  /**
-   * Returns a [Uri] representing the directory's location.
-   *
-   * The returned URI's scheme is always "file" if the entity's [path] is
-   * absolute, otherwise the scheme will be empty.
-   * The returned URI's path always ends in a slash ('/').
-   */
-  Uri get uri;
-
-  /**
-   * Sets the current working directory of the Dart process including
-   * all running isolates. The new value set can be either a [Directory]
-   * or a [String].
-   *
-   * The new value is passed to the OS's system call unchanged, so a
-   * relative path passed as the new working directory will be
-   * resolved by the OS.
-   *
-   * Note that setting the current working directory is a synchronous
-   * operation and that it changes the working directory of *all*
-   * isolates.
-   *
-   * Use this with care - especially when working with asynchronous
-   * operations and multiple isolates. Changing the working directory,
-   * while asynchronous operations are pending or when other isolates
-   * are working with the file system, can lead to unexpected results.
-   */
-  static void set current(path) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      _Directory.current = path;
-      return;
-    }
-    overrides.setCurrentDirectory(path);
-  }
-
-  /**
-   * Creates the directory with this name.
-   *
-   * If [recursive] is false, only the last directory in the path is
-   * created. If [recursive] is true, all non-existing path components
-   * are created. If the directory already exists nothing is done.
-   *
-   * Returns a [:Future<Directory>:] that completes with this
-   * directory once it has been created. If the directory cannot be
-   * created the future completes with an exception.
-   */
-  Future<Directory> create({bool recursive: false});
-
-  /**
-   * Synchronously creates the directory with this name.
-   *
-   * If [recursive] is false, only the last directory in the path is
-   * created. If [recursive] is true, all non-existing path components
-   * are created. If the directory already exists nothing is done.
-   *
-   * If the directory cannot be created an exception is thrown.
-   */
-  void createSync({bool recursive: false});
-
-  /**
-   * Gets the system temp directory.
-   *
-   * Gets the directory provided by the operating system for creating
-   * temporary files and directories in.
-   * The location of the system temp directory is platform-dependent,
-   * and may be set by an environment variable.
-   */
-  static Directory get systemTemp {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _Directory.systemTemp;
-    }
-    return overrides.getSystemTempDirectory();
-  }
-
-  /**
-   * Creates a temporary directory in this directory. Additional random
-   * characters are appended to [prefix] to produce a unique directory
-   * name. If [prefix] is missing or null, the empty string is used
-   * for [prefix].
-   *
-   * Returns a [:Future<Directory>:] that completes with the newly
-   * created temporary directory.
-   */
-  Future<Directory> createTemp([String? prefix]);
-
-  /**
-   * Synchronously creates a temporary directory in this directory.
-   * Additional random characters are appended to [prefix] to produce
-   * a unique directory name. If [prefix] is missing or null, the empty
-   * string is used for [prefix].
-   *
-   * Returns the newly created temporary directory.
-   */
-  Directory createTempSync([String? prefix]);
-
-  Future<String> resolveSymbolicLinks();
-
-  String resolveSymbolicLinksSync();
-
-  /**
-   * Renames this directory. Returns a [:Future<Directory>:] that completes
-   * with a [Directory] instance for the renamed directory.
-   *
-   * If newPath identifies an existing directory, that directory is
-   * replaced. If newPath identifies an existing file, the operation
-   * fails and the future completes with an exception.
-   */
-  Future<Directory> rename(String newPath);
-
-  /**
-   * Synchronously renames this directory. Returns a [Directory]
-   * instance for the renamed directory.
-   *
-   * If newPath identifies an existing directory, that directory is
-   * replaced. If newPath identifies an existing file the operation
-   * fails and an exception is thrown.
-   */
-  Directory renameSync(String newPath);
-
-  /**
-   * Returns a [Directory] instance whose path is the absolute path to [this].
-   *
-   * The absolute path is computed by prefixing
-   * a relative path with the current working directory, and returning
-   * an absolute path unchanged.
-   */
-  Directory get absolute;
-
-  /**
-   * Lists the sub-directories and files of this [Directory].
-   * Optionally recurses into sub-directories.
-   *
-   * If [followLinks] is false, then any symbolic links found
-   * are reported as [Link] objects, rather than as directories or files,
-   * and are not recursed into.
-   *
-   * If [followLinks] is true, then working links are reported as
-   * directories or files, depending on
-   * their type, and links to directories are recursed into.
-   * Broken links are reported as [Link] objects.
-   * If a symbolic link makes a loop in the file system, then a recursive
-   * listing will not follow a link twice in the
-   * same recursive descent, but will report it as a [Link]
-   * the second time it is seen.
-   *
-   * The result is a stream of [FileSystemEntity] objects
-   * for the directories, files, and links.
-   */
-  Stream<FileSystemEntity> list(
-      {bool recursive: false, bool followLinks: true});
-
-  /**
-   * Lists the sub-directories and files of this [Directory].
-   * Optionally recurses into sub-directories.
-   *
-   * If [followLinks] is false, then any symbolic links found
-   * are reported as [Link] objects, rather than as directories or files,
-   * and are not recursed into.
-   *
-   * If [followLinks] is true, then working links are reported as
-   * directories or files, depending on
-   * their type, and links to directories are recursed into.
-   * Broken links are reported as [Link] objects.
-   * If a link makes a loop in the file system, then a recursive
-   * listing will not follow a link twice in the
-   * same recursive descent, but will report it as a [Link]
-   * the second time it is seen.
-   *
-   * Returns a [List] containing [FileSystemEntity] objects for the
-   * directories, files, and links.
-   */
-  List<FileSystemEntity> listSync(
-      {bool recursive: false, bool followLinks: true});
-
-  /**
-   * Returns a human readable string for this Directory instance.
-   */
-  String toString();
-}
diff --git a/sdk_nnbd/lib/io/directory_impl.dart b/sdk_nnbd/lib/io/directory_impl.dart
deleted file mode 100644
index 9ca5b6c..0000000
--- a/sdk_nnbd/lib/io/directory_impl.dart
+++ /dev/null
@@ -1,449 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-class _Directory extends FileSystemEntity implements Directory {
-  final String _path;
-  final Uint8List _rawPath;
-
-  _Directory(String path)
-      : _path = _checkNotNull(path, "path"),
-        _rawPath = FileSystemEntity._toUtf8Array(path);
-
-  _Directory.fromRawPath(Uint8List rawPath)
-      : _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(
-            _checkNotNull(rawPath, "rawPath")),
-        _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
-
-  String get path => _path;
-
-  external static _current(_Namespace namespace);
-  external static _setCurrent(_Namespace namespace, Uint8List rawPath);
-  external static _createTemp(_Namespace namespace, Uint8List rawPath);
-  external static String _systemTemp(_Namespace namespace);
-  external static _exists(_Namespace namespace, Uint8List rawPath);
-  external static _create(_Namespace namespace, Uint8List rawPath);
-  external static _deleteNative(
-      _Namespace namespace, Uint8List rawPath, bool recursive);
-  external static _rename(
-      _Namespace namespace, Uint8List rawPath, String newPath);
-  external static void _fillWithDirectoryListing(
-      _Namespace namespace,
-      List<FileSystemEntity> list,
-      Uint8List rawPath,
-      bool recursive,
-      bool followLinks);
-
-  static Directory get current {
-    var result = _current(_Namespace._namespace);
-    if (result is OSError) {
-      throw new FileSystemException(
-          "Getting current working directory failed", "", result);
-    }
-    return new _Directory(result);
-  }
-
-  static void set current(path) {
-    late Uint8List _rawPath;
-    if (path is _Directory) {
-      // For our internal Directory implementation, go ahead and use the raw
-      // path.
-      _rawPath = path._rawPath;
-    } else if (path is Directory) {
-      // FIXME(bkonyi): package:file passes in instances of classes which do
-      // not have _path defined, so we will fallback to using the existing
-      // path String for now.
-      _rawPath = FileSystemEntity._toUtf8Array(path.path);
-    } else if (path is String) {
-      _rawPath = FileSystemEntity._toUtf8Array(path);
-    } else {
-      throw new ArgumentError('${Error.safeToString(path)} is not a String or'
-          ' Directory');
-    }
-    if (!_EmbedderConfig._mayChdir) {
-      throw new UnsupportedError(
-          "This embedder disallows setting Directory.current");
-    }
-    var result = _setCurrent(_Namespace._namespace, _rawPath);
-    if (result is ArgumentError) throw result;
-    if (result is OSError) {
-      throw new FileSystemException(
-          "Setting current working directory failed", path, result);
-    }
-  }
-
-  Uri get uri {
-    return new Uri.directory(path);
-  }
-
-  Future<bool> exists() {
-    return _File._dispatchWithNamespace(
-        _IOService.directoryExists, [null, _rawPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionOrErrorFromResponse(response, "Exists failed");
-      }
-      return response == 1;
-    });
-  }
-
-  bool existsSync() {
-    var result = _exists(_Namespace._namespace, _rawPath);
-    if (result is OSError) {
-      throw new FileSystemException("Exists failed", path, result);
-    }
-    return (result == 1);
-  }
-
-  Directory get absolute => new Directory(_absolutePath);
-
-  Future<Directory> create({bool recursive: false}) {
-    if (recursive) {
-      return exists().then((exists) {
-        if (exists) return this;
-        if (path != parent.path) {
-          return parent.create(recursive: true).then((_) {
-            return create();
-          });
-        } else {
-          return create();
-        }
-      });
-    } else {
-      return _File._dispatchWithNamespace(
-          _IOService.directoryCreate, [null, _rawPath]).then((response) {
-        if (_isErrorResponse(response)) {
-          throw _exceptionOrErrorFromResponse(response, "Creation failed");
-        }
-        return this;
-      });
-    }
-  }
-
-  void createSync({bool recursive: false}) {
-    if (recursive) {
-      if (existsSync()) return;
-      if (path != parent.path) {
-        parent.createSync(recursive: true);
-      }
-    }
-    var result = _create(_Namespace._namespace, _rawPath);
-    if (result is OSError) {
-      throw new FileSystemException("Creation failed", path, result);
-    }
-  }
-
-  static Directory get systemTemp =>
-      new Directory(_systemTemp(_Namespace._namespace));
-
-  Future<Directory> createTemp([String? prefix]) {
-    prefix ??= '';
-    if (path == '') {
-      throw new ArgumentError("Directory.createTemp called with an empty path. "
-          "To use the system temp directory, use Directory.systemTemp");
-    }
-    String fullPrefix;
-    // FIXME(bkonyi): here we're using `path` directly, which might cause
-    // issues if it is not UTF-8 encoded.
-    if (path.endsWith('/') || (Platform.isWindows && path.endsWith('\\'))) {
-      fullPrefix = "$path$prefix";
-    } else {
-      fullPrefix = "$path${Platform.pathSeparator}$prefix";
-    }
-    return _File._dispatchWithNamespace(_IOService.directoryCreateTemp,
-        [null, FileSystemEntity._toUtf8Array(fullPrefix)]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionOrErrorFromResponse(
-            response, "Creation of temporary directory failed");
-      }
-      return new Directory(response);
-    });
-  }
-
-  Directory createTempSync([String? prefix]) {
-    prefix ??= '';
-    if (path == '') {
-      throw new ArgumentError("Directory.createTemp called with an empty path. "
-          "To use the system temp directory, use Directory.systemTemp");
-    }
-    String fullPrefix;
-    // FIXME(bkonyi): here we're using `path` directly, which might cause
-    // issues if it is not UTF-8 encoded.
-    if (path.endsWith('/') || (Platform.isWindows && path.endsWith('\\'))) {
-      fullPrefix = "$path$prefix";
-    } else {
-      fullPrefix = "$path${Platform.pathSeparator}$prefix";
-    }
-    var result = _createTemp(
-        _Namespace._namespace, FileSystemEntity._toUtf8Array(fullPrefix));
-    if (result is OSError) {
-      throw new FileSystemException(
-          "Creation of temporary directory failed", fullPrefix, result);
-    }
-    return new Directory(result);
-  }
-
-  Future<Directory> _delete({bool recursive: false}) {
-    return _File._dispatchWithNamespace(
-            _IOService.directoryDelete, [null, _rawPath, recursive])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionOrErrorFromResponse(response, "Deletion failed");
-      }
-      return this;
-    });
-  }
-
-  void _deleteSync({bool recursive: false}) {
-    var result = _deleteNative(_Namespace._namespace, _rawPath, recursive);
-    if (result is OSError) {
-      throw new FileSystemException("Deletion failed", path, result);
-    }
-  }
-
-  Future<Directory> rename(String newPath) {
-    return _File._dispatchWithNamespace(
-        _IOService.directoryRename, [null, _rawPath, newPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionOrErrorFromResponse(response, "Rename failed");
-      }
-      return new Directory(newPath);
-    });
-  }
-
-  Directory renameSync(String newPath) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(newPath, "newPath");
-    var result = _rename(_Namespace._namespace, _rawPath, newPath);
-    if (result is OSError) {
-      throw new FileSystemException("Rename failed", path, result);
-    }
-    return new Directory(newPath);
-  }
-
-  Stream<FileSystemEntity> list(
-      {bool recursive: false, bool followLinks: true}) {
-    return new _AsyncDirectoryLister(
-            // FIXME(bkonyi): here we're using `path` directly, which might cause issues
-            // if it is not UTF-8 encoded.
-            FileSystemEntity._toUtf8Array(
-                FileSystemEntity._ensureTrailingPathSeparators(path)),
-            recursive,
-            followLinks)
-        .stream;
-  }
-
-  List<FileSystemEntity> listSync(
-      {bool recursive: false, bool followLinks: true}) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(recursive, "recursive");
-    ArgumentError.checkNotNull(followLinks, "followLinks");
-    var result = <FileSystemEntity>[];
-    _fillWithDirectoryListing(
-        _Namespace._namespace,
-        result,
-        // FIXME(bkonyi): here we're using `path` directly, which might cause issues
-        // if it is not UTF-8 encoded.
-        FileSystemEntity._toUtf8Array(
-            FileSystemEntity._ensureTrailingPathSeparators(path)),
-        recursive,
-        followLinks);
-    return result;
-  }
-
-  String toString() => "Directory: '$path'";
-
-  bool _isErrorResponse(response) =>
-      response is List && response[0] != _successResponse;
-
-  _exceptionOrErrorFromResponse(response, String message) {
-    assert(_isErrorResponse(response));
-    switch (response[_errorResponseErrorType]) {
-      case _illegalArgumentResponse:
-        return new ArgumentError();
-      case _osErrorResponse:
-        var err = new OSError(response[_osErrorResponseMessage],
-            response[_osErrorResponseErrorCode]);
-        return new FileSystemException(message, path, err);
-      default:
-        return new Exception("Unknown error");
-    }
-  }
-
-  // TODO(40614): Remove once non-nullability is sound.
-  static T _checkNotNull<T>(T t, String name) {
-    ArgumentError.checkNotNull(t, name);
-    return t;
-  }
-}
-
-abstract class _AsyncDirectoryListerOps {
-  external factory _AsyncDirectoryListerOps(int pointer);
-
-  int? getPointer();
-}
-
-class _AsyncDirectoryLister {
-  static const int listFile = 0;
-  static const int listDirectory = 1;
-  static const int listLink = 2;
-  static const int listError = 3;
-  static const int listDone = 4;
-
-  static const int responseType = 0;
-  static const int responsePath = 1;
-  static const int responseComplete = 1;
-  static const int responseError = 2;
-
-  final Uint8List rawPath;
-  final bool recursive;
-  final bool followLinks;
-
-  final controller = new StreamController<FileSystemEntity>(sync: true);
-  bool canceled = false;
-  bool nextRunning = false;
-  bool closed = false;
-  _AsyncDirectoryListerOps? _ops;
-  Completer closeCompleter = new Completer();
-
-  _AsyncDirectoryLister(this.rawPath, this.recursive, this.followLinks) {
-    controller
-      ..onListen = onListen
-      ..onResume = onResume
-      ..onCancel = onCancel;
-  }
-
-  // WARNING:
-  // Calling this function will increase the reference count on the native
-  // object that implements the async directory lister operations. It should
-  // only be called to pass the pointer to the IO Service, which will decrement
-  // the reference count when it is finished with it.
-  int? _pointer() {
-    return _ops?.getPointer();
-  }
-
-  Stream<FileSystemEntity> get stream => controller.stream;
-
-  void onListen() {
-    _File._dispatchWithNamespace(_IOService.directoryListStart,
-        [null, rawPath, recursive, followLinks]).then((response) {
-      if (response is int) {
-        _ops = new _AsyncDirectoryListerOps(response);
-        next();
-      } else if (response is Error) {
-        controller.addError(response, response.stackTrace);
-        close();
-      } else {
-        error(response);
-        close();
-      }
-    });
-  }
-
-  void onResume() {
-    if (!nextRunning) {
-      next();
-    }
-  }
-
-  Future onCancel() {
-    canceled = true;
-    // If we are active, but not requesting, close.
-    if (!nextRunning) {
-      close();
-    }
-
-    return closeCompleter.future;
-  }
-
-  void next() {
-    if (canceled) {
-      close();
-      return;
-    }
-    if (controller.isPaused || nextRunning) {
-      return;
-    }
-    var pointer = _pointer();
-    if (pointer == null) {
-      return;
-    }
-    nextRunning = true;
-    _IOService._dispatch(_IOService.directoryListNext, [pointer])
-        .then((result) {
-      nextRunning = false;
-      if (result is List) {
-        next();
-        assert(result.length % 2 == 0);
-        for (int i = 0; i < result.length; i++) {
-          assert(i % 2 == 0);
-          switch (result[i++]) {
-            case listFile:
-              controller.add(new File.fromRawPath(result[i]));
-              break;
-            case listDirectory:
-              controller.add(new Directory.fromRawPath(result[i]));
-              break;
-            case listLink:
-              controller.add(new Link.fromRawPath(result[i]));
-              break;
-            case listError:
-              error(result[i]);
-              break;
-            case listDone:
-              canceled = true;
-              return;
-          }
-        }
-      } else {
-        controller.addError(new FileSystemException("Internal error"));
-      }
-    });
-  }
-
-  void _cleanup() {
-    controller.close();
-    closeCompleter.complete();
-    _ops = null;
-  }
-
-  void close() {
-    if (closed) {
-      return;
-    }
-    if (nextRunning) {
-      return;
-    }
-    closed = true;
-
-    var pointer = _pointer();
-    if (pointer == null) {
-      _cleanup();
-    } else {
-      _IOService._dispatch(_IOService.directoryListStop, [pointer])
-          .whenComplete(_cleanup);
-    }
-  }
-
-  void error(message) {
-    var errorType = message[responseError][_errorResponseErrorType];
-    if (errorType == _illegalArgumentResponse) {
-      controller.addError(new ArgumentError());
-    } else if (errorType == _osErrorResponse) {
-      var responseErrorInfo = message[responseError];
-      var err = new OSError(responseErrorInfo[_osErrorResponseMessage],
-          responseErrorInfo[_osErrorResponseErrorCode]);
-      var errorPath = message[responsePath];
-      if (errorPath == null) {
-        errorPath = utf8.decode(rawPath, allowMalformed: true);
-      } else if (errorPath is Uint8List) {
-        errorPath = utf8.decode(message[responsePath], allowMalformed: true);
-      }
-      controller.addError(
-          new FileSystemException("Directory listing failed", errorPath, err));
-    } else {
-      controller.addError(new FileSystemException("Internal error"));
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/io/embedder_config.dart b/sdk_nnbd/lib/io/embedder_config.dart
deleted file mode 100644
index cbc94f7..0000000
--- a/sdk_nnbd/lib/io/embedder_config.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart.io;
-
-/// Embedder-specific, fine-grained dart:io configuration.
-///
-/// This class contains per-Isolate flags that an embedder can set to put
-/// fine-grained limitations on what process-visible operations Isolates are
-/// permitted to use (e.g. exit()). By default, the whole dart:io API is
-/// enabled. When a disallowed operation is attempted, an `UnsupportedError` is
-/// thrown.
-@pragma('vm:entry-point')
-abstract class _EmbedderConfig {
-  /// The Isolate may set Directory.current.
-  static bool _mayChdir = true;
-
-  /// The Isolate may call exit().
-  @pragma("vm:entry-point")
-  static bool _mayExit = true;
-
-  // The Isolate may set Stdin.echoMode.
-  @pragma('vm:entry-point')
-  static bool _maySetEchoMode = true;
-
-  // The Isolate may set Stdin.lineMode.
-  @pragma('vm:entry-point')
-  static bool _maySetLineMode = true;
-
-  /// The Isolate may call sleep().
-  @pragma('vm:entry-point')
-  static bool _maySleep = true;
-
-  // TODO(zra): Consider adding:
-  // - an option to disallow modifying SecurityContext.defaultContext
-  // - an option to disallow closing stdout and stderr.
-}
diff --git a/sdk_nnbd/lib/io/eventhandler.dart b/sdk_nnbd/lib/io/eventhandler.dart
deleted file mode 100644
index cfad310..0000000
--- a/sdk_nnbd/lib/io/eventhandler.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-class _EventHandler {
-  external static void _sendData(Object? sender, SendPort sendPort, int data);
-}
diff --git a/sdk_nnbd/lib/io/file.dart b/sdk_nnbd/lib/io/file.dart
deleted file mode 100644
index a4d5ef8..0000000
--- a/sdk_nnbd/lib/io/file.dart
+++ /dev/null
@@ -1,1012 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * The modes in which a File can be opened.
- */
-class FileMode {
-  /// The mode for opening a file only for reading.
-  static const read = const FileMode._internal(0);
-  @Deprecated("Use read instead")
-  static const READ = read;
-
-  /// Mode for opening a file for reading and writing. The file is
-  /// overwritten if it already exists. The file is created if it does not
-  /// already exist.
-  static const write = const FileMode._internal(1);
-  @Deprecated("Use write instead")
-  static const WRITE = write;
-
-  /// Mode for opening a file for reading and writing to the
-  /// end of it. The file is created if it does not already exist.
-  static const append = const FileMode._internal(2);
-  @Deprecated("Use append instead")
-  static const APPEND = append;
-
-  /// Mode for opening a file for writing *only*. The file is
-  /// overwritten if it already exists. The file is created if it does not
-  /// already exist.
-  static const writeOnly = const FileMode._internal(3);
-  @Deprecated("Use writeOnly instead")
-  static const WRITE_ONLY = writeOnly;
-
-  /// Mode for opening a file for writing *only* to the
-  /// end of it. The file is created if it does not already exist.
-  static const writeOnlyAppend = const FileMode._internal(4);
-  @Deprecated("Use writeOnlyAppend instead")
-  static const WRITE_ONLY_APPEND = writeOnlyAppend;
-
-  final int _mode;
-
-  const FileMode._internal(this._mode);
-}
-
-/// The mode for opening a file only for reading.
-@Deprecated("Use FileMode.read instead")
-const READ = FileMode.read;
-
-/// The mode for opening a file for reading and writing. The file is
-/// overwritten if it already exists. The file is created if it does not
-/// already exist.
-@Deprecated("Use FileMode.write instead")
-const WRITE = FileMode.write;
-
-/// The mode for opening a file for reading and writing to the
-/// end of it. The file is created if it does not already exist.
-@Deprecated("Use FileMode.append instead")
-const APPEND = FileMode.append;
-
-/// Mode for opening a file for writing *only*. The file is
-/// overwritten if it already exists. The file is created if it does not
-/// already exist.
-@Deprecated("Use FileMode.writeOnly instead")
-const WRITE_ONLY = FileMode.writeOnly;
-
-/// Mode for opening a file for writing *only* to the
-/// end of it. The file is created if it does not already exist.
-@Deprecated("Use FileMode.writeOnlyAppend instead")
-const WRITE_ONLY_APPEND = FileMode.writeOnlyAppend;
-
-/// Type of lock when requesting a lock on a file.
-class FileLock {
-  /// Shared file lock.
-  static const shared = const FileLock._internal(1);
-  @Deprecated("Use shared instead")
-  static const SHARED = shared;
-
-  /// Exclusive file lock.
-  static const exclusive = const FileLock._internal(2);
-  @Deprecated("Use exclusive instead")
-  static const EXCLUSIVE = exclusive;
-
-  /// Blocking shared file lock.
-  static const blockingShared = const FileLock._internal(3);
-  @Deprecated("Use blockingShared instead")
-  static const BLOCKING_SHARED = blockingShared;
-
-  /// Blocking exclusive file lock.
-  static const blockingExclusive = const FileLock._internal(4);
-  @Deprecated("Use blockingExclusive instead")
-  static const BLOCKING_EXCLUSIVE = blockingExclusive;
-
-  final int _type;
-
-  const FileLock._internal(this._type);
-}
-
-/**
- * A reference to a file on the file system.
- *
- * A File instance is an object that holds a [path] on which operations can
- * be performed.
- * You can get the parent directory of the file using the getter [parent],
- * a property inherited from [FileSystemEntity].
- *
- * Create a new File object with a pathname to access the specified file on the
- * file system from your program.
- *
- *     var myFile = new File('file.txt');
- *
- * The File class contains methods for manipulating files and their contents.
- * Using methods in this class, you can open and close files, read to and write
- * from them, create and delete them, and check for their existence.
- *
- * When reading or writing a file, you can use streams (with [openRead]),
- * random access operations (with [open]),
- * or convenience methods such as [readAsString],
- *
- * Most methods in this class occur in synchronous and asynchronous pairs,
- * for example, [readAsString] and [readAsStringSync].
- * Unless you have a specific reason for using the synchronous version
- * of a method, prefer the asynchronous version to avoid blocking your program.
- *
- * ## If path is a link
- *
- * If [path] is a symbolic link, rather than a file,
- * then the methods of File operate on the ultimate target of the
- * link, except for [delete] and [deleteSync], which operate on
- * the link.
- *
- * ## Read from a file
- *
- * The following code sample reads the entire contents from a file as a string
- * using the asynchronous [readAsString] method:
- *
- *     import 'dart:async';
- *     import 'dart:io';
- *
- *     void main() {
- *       new File('file.txt').readAsString().then((String contents) {
- *         print(contents);
- *       });
- *     }
- *
- * A more flexible and useful way to read a file is with a [Stream].
- * Open the file with [openRead], which returns a stream that
- * provides the data in the file as chunks of bytes.
- * Listen to the stream for data and process as needed.
- * You can use various transformers in succession to manipulate the
- * data into the required format or to prepare it for output.
- *
- * You might want to use a stream to read large files,
- * to manipulate the data with transformers,
- * or for compatibility with another API, such as [WebSocket]s.
- *
- *     import 'dart:io';
- *     import 'dart:convert';
- *     import 'dart:async';
- *
- *     main() {
- *       final file = new File('file.txt');
- *       Stream<List<int>> inputStream = file.openRead();
- *
- *       inputStream
- *         .transform(utf8.decoder)       // Decode bytes to UTF-8.
- *         .transform(new LineSplitter()) // Convert stream to individual lines.
- *         .listen((String line) {        // Process results.
- *             print('$line: ${line.length} bytes');
- *           },
- *           onDone: () { print('File is now closed.'); },
- *           onError: (e) { print(e.toString()); });
- *     }
- *
- * ## Write to a file
- *
- * To write a string to a file, use the [writeAsString] method:
- *
- *     import 'dart:io';
- *
- *     void main() {
- *       final filename = 'file.txt';
- *       new File(filename).writeAsString('some content')
- *         .then((File file) {
- *           // Do something with the file.
- *         });
- *     }
- *
- * You can also write to a file using a [Stream]. Open the file with
- * [openWrite], which returns an [IOSink] to which you can write data.
- * Be sure to close the sink with the [IOSink.close] method.
- *
- *     import 'dart:io';
- *
- *     void main() {
- *       var file = new File('file.txt');
- *       var sink = file.openWrite();
- *       sink.write('FILE ACCESSED ${new DateTime.now()}\n');
- *
- *       // Close the IOSink to free system resources.
- *       sink.close();
- *     }
- *
- * ## The use of Futures
- *
- * To avoid unintentional blocking of the program,
- * several methods use a [Future] to return a value. For example,
- * the [length] method, which gets the length of a file, returns a Future.
- * Use `then` to register a callback function, which is called when
- * the value is ready.
- *
- *     import 'dart:io';
- *
- *     main() {
- *       final file = new File('file.txt');
- *
- *       file.length().then((len) {
- *         print(len);
- *       });
- *     }
- *
- * In addition to length, the [exists], [lastModified], [stat], and
- * other methods, return Futures.
- *
- * ## Other resources
- *
- * * [Dart by Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- *   provides additional task-oriented code samples that show how to use
- *   various API from the Directory class and the related [File] class.
- *
- * * [I/O for Command-Line
- *   Apps](https://www.dartlang.org/docs/dart-up-and-running/ch03.html#dartio---io-for-command-line-apps)
- *   a section from _A Tour of the Dart Libraries_ covers files and directories.
- *
- * * [Write Command-Line Apps](https://www.dartlang.org/docs/tutorials/cmdline/),
- *   a tutorial about writing command-line apps, includes information about
- *   files and directories.
- */
-@pragma("vm:entry-point")
-abstract class File implements FileSystemEntity {
-  /**
-   * Creates a [File] object.
-   *
-   * If [path] is a relative path, it will be interpreted relative to the
-   * current working directory (see [Directory.current]), when used.
-   *
-   * If [path] is an absolute path, it will be immune to changes to the
-   * current working directory.
-   */
-  @pragma("vm:entry-point")
-  factory File(String path) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return new _File(path);
-    }
-    return overrides.createFile(path);
-  }
-
-  /**
-   * Create a File object from a URI.
-   *
-   * If [uri] cannot reference a file this throws [UnsupportedError].
-   */
-  factory File.fromUri(Uri uri) => new File(uri.toFilePath());
-
-  /**
-   * Creates a File object from a raw path, that is, a sequence of bytes
-   * as represented by the OS.
-   */
-  @pragma("vm:entry-point")
-  factory File.fromRawPath(Uint8List rawPath) {
-    // TODO(bkonyi): Handle overrides.
-    return new _File.fromRawPath(rawPath);
-  }
-
-  /**
-   * Create the file. Returns a `Future<File>` that completes with
-   * the file when it has been created.
-   *
-   * If [recursive] is false, the default, the file is created only if
-   * all directories in the path exist. If [recursive] is true, all
-   * non-existing path components are created.
-   *
-   * Existing files are left untouched by [create]. Calling [create] on an
-   * existing file might fail if there are restrictive permissions on
-   * the file.
-   *
-   * Completes the future with a [FileSystemException] if the operation fails.
-   */
-  Future<File> create({bool recursive: false});
-
-  /**
-   * Synchronously create the file. Existing files are left untouched
-   * by [createSync]. Calling [createSync] on an existing file might fail
-   * if there are restrictive permissions on the file.
-   *
-   * If [recursive] is false, the default, the file is created
-   * only if all directories in the path exist.
-   * If [recursive] is true, all non-existing path components are created.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void createSync({bool recursive: false});
-
-  /**
-   * Renames this file. Returns a `Future<File>` that completes
-   * with a [File] instance for the renamed file.
-   *
-   * If [newPath] identifies an existing file, that file is
-   * replaced. If [newPath] identifies an existing directory, the
-   * operation fails and the future completes with an exception.
-   */
-  Future<File> rename(String newPath);
-
-  /**
-   * Synchronously renames this file. Returns a [File]
-   * instance for the renamed file.
-   *
-   * If [newPath] identifies an existing file, that file is
-   * replaced. If [newPath] identifies an existing directory the
-   * operation fails and an exception is thrown.
-   */
-  File renameSync(String newPath);
-
-  /**
-   * Copy this file. Returns a `Future<File>` that completes
-   * with a [File] instance for the copied file.
-   *
-   * If [newPath] identifies an existing file, that file is
-   * replaced. If [newPath] identifies an existing directory, the
-   * operation fails and the future completes with an exception.
-   */
-  Future<File> copy(String newPath);
-
-  /**
-   * Synchronously copy this file. Returns a [File]
-   * instance for the copied file.
-   *
-   * If [newPath] identifies an existing file, that file is
-   * replaced. If [newPath] identifies an existing directory the
-   * operation fails and an exception is thrown.
-   */
-  File copySync(String newPath);
-
-  /**
-   * Get the length of the file. Returns a `Future<int>` that
-   * completes with the length in bytes.
-   */
-  Future<int> length();
-
-  /**
-   * Synchronously get the length of the file.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  int lengthSync();
-
-  /**
-   * Returns a [File] instance whose path is the absolute path to [this].
-   *
-   * The absolute path is computed by prefixing
-   * a relative path with the current working directory, and returning
-   * an absolute path unchanged.
-   */
-  File get absolute;
-
-/**
- * Get the last-accessed time of the file.
- *
- * Returns a `Future<DateTime>` that completes with the date and time when the
- * file was last accessed, if the information is available.
- *
- * Throws a [FileSystemException] if the operation fails.
- */
-  Future<DateTime> lastAccessed();
-
-/**
- * Get the last-accessed time of the file.
- *
- * Returns the date and time when the file was last accessed,
- * if the information is available. Blocks until the information can be returned
- * or it is determined that the information is not available.
- *
- * Throws a [FileSystemException] if the operation fails.
- */
-  DateTime lastAccessedSync();
-
-  /**
-   * Modifies the time the file was last accessed.
-   *
-   * Returns a [Future] that completes once the operation has completed.
-   *
-   * Throws a [FileSystemException] if the time cannot be set.
-   */
-  Future setLastAccessed(DateTime time);
-
-  /**
-   * Synchronously modifies the time the file was last accessed.
-   *
-   * Throws a [FileSystemException] if the time cannot be set.
-   */
-  void setLastAccessedSync(DateTime time);
-
-/**
- * Get the last-modified time of the file.
- *
- * Returns a `Future<DateTime>` that completes with the date and time when the
- * file was last modified, if the information is available.
- *
- * Throws a [FileSystemException] if the operation fails.
- */
-  Future<DateTime> lastModified();
-
-/**
- * Get the last-modified time of the file.
- *
- * Returns the date and time when the file was last modified,
- * if the information is available. Blocks until the information can be returned
- * or it is determined that the information is not available.
- *
- * Throws a [FileSystemException] if the operation fails.
- */
-  DateTime lastModifiedSync();
-
-  /**
-   * Modifies the time the file was last modified.
-   *
-   * Returns a [Future] that completes once the operation has completed.
-   *
-   * Throws a [FileSystemException] if the time cannot be set.
-   */
-  Future setLastModified(DateTime time);
-
-  /**
-   * Synchronously modifies the time the file was last modified.
-   *
-   * If the attributes cannot be set, throws a [FileSystemException].
-   */
-  void setLastModifiedSync(DateTime time);
-
-  /**
-   * Open the file for random access operations. Returns a
-   * `Future<RandomAccessFile>` that completes with the opened
-   * random access file. [RandomAccessFile]s must be closed using the
-   * [RandomAccessFile.close] method.
-   *
-   * Files can be opened in three modes:
-   *
-   * [FileMode.read]: open the file for reading.
-   *
-   * [FileMode.write]: open the file for both reading and writing and
-   * truncate the file to length zero. If the file does not exist the
-   * file is created.
-   *
-   * [FileMode.append]: same as [FileMode.write] except that the file is
-   * not truncated.
-   */
-  Future<RandomAccessFile> open({FileMode mode: FileMode.read});
-
-  /**
-   * Synchronously open the file for random access operations. The
-   * result is a [RandomAccessFile] on which random access operations
-   * can be performed. Opened [RandomAccessFile]s must be closed using
-   * the [RandomAccessFile.close] method.
-   *
-   * See [open] for information on the [mode] argument.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  RandomAccessFile openSync({FileMode mode: FileMode.read});
-
-  /**
-   * Create a new independent [Stream] for the contents of this file.
-   *
-   * If [start] is present, the file will be read from byte-offset [start].
-   * Otherwise from the beginning (index 0).
-   *
-   * If [end] is present, only up to byte-index [end] will be read. Otherwise,
-   * until end of file.
-   *
-   * In order to make sure that system resources are freed, the stream
-   * must be read to completion or the subscription on the stream must
-   * be cancelled.
-   */
-  Stream<List<int>> openRead([int? start, int? end]);
-
-  /**
-   * Creates a new independent [IOSink] for the file. The
-   * [IOSink] must be closed when no longer used, to free
-   * system resources.
-   *
-   * An [IOSink] for a file can be opened in two modes:
-   *
-   * * [FileMode.write]: truncates the file to length zero.
-   * * [FileMode.append]: sets the initial write position to the end
-   *   of the file.
-   *
-   *  When writing strings through the returned [IOSink] the encoding
-   *  specified using [encoding] will be used. The returned [IOSink]
-   *  has an `encoding` property which can be changed after the
-   *  [IOSink] has been created.
-   */
-  IOSink openWrite({FileMode mode: FileMode.write, Encoding encoding: utf8});
-
-  /**
-   * Read the entire file contents as a list of bytes. Returns a
-   * `Future<Uint8List>` that completes with the list of bytes that
-   * is the contents of the file.
-   */
-  Future<Uint8List> readAsBytes();
-
-  /**
-   * Synchronously read the entire file contents as a list of bytes.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  Uint8List readAsBytesSync();
-
-  /**
-   * Read the entire file contents as a string using the given
-   * [Encoding].
-   *
-   * Returns a `Future<String>` that completes with the string once
-   * the file contents has been read.
-   */
-  Future<String> readAsString({Encoding encoding: utf8});
-
-  /**
-   * Synchronously read the entire file contents as a string using the
-   * given [Encoding].
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  String readAsStringSync({Encoding encoding: utf8});
-
-  /**
-   * Read the entire file contents as lines of text using the given
-   * [Encoding].
-   *
-   * Returns a `Future<List<String>>` that completes with the lines
-   * once the file contents has been read.
-   */
-  Future<List<String>> readAsLines({Encoding encoding: utf8});
-
-  /**
-   * Synchronously read the entire file contents as lines of text
-   * using the given [Encoding].
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  List<String> readAsLinesSync({Encoding encoding: utf8});
-
-  /**
-   * Write a list of bytes to a file.
-   *
-   * Opens the file, writes the list of bytes to it, and closes the file.
-   * Returns a `Future<File>` that completes with this [File] object once
-   * the entire operation has completed.
-   *
-   * By default [writeAsBytes] creates the file for writing and truncates the
-   * file if it already exists. In order to append the bytes to an existing
-   * file, pass [FileMode.append] as the optional mode parameter.
-   *
-   * If the argument [flush] is set to `true`, the data written will be
-   * flushed to the file system before the returned future completes.
-   */
-  Future<File> writeAsBytes(List<int> bytes,
-      {FileMode mode: FileMode.write, bool flush: false});
-
-  /**
-   * Synchronously write a list of bytes to a file.
-   *
-   * Opens the file, writes the list of bytes to it and closes the file.
-   *
-   * By default [writeAsBytesSync] creates the file for writing and truncates
-   * the file if it already exists. In order to append the bytes to an existing
-   * file, pass [FileMode.append] as the optional mode parameter.
-   *
-   * If the [flush] argument is set to `true` data written will be
-   * flushed to the file system before returning.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void writeAsBytesSync(List<int> bytes,
-      {FileMode mode: FileMode.write, bool flush: false});
-
-  /**
-   * Write a string to a file.
-   *
-   * Opens the file, writes the string in the given encoding, and closes the
-   * file. Returns a `Future<File>` that completes with this [File] object
-   * once the entire operation has completed.
-   *
-   * By default [writeAsString] creates the file for writing and truncates the
-   * file if it already exists. In order to append the bytes to an existing
-   * file, pass [FileMode.append] as the optional mode parameter.
-   *
-   * If the argument [flush] is set to `true`, the data written will be
-   * flushed to the file system before the returned future completes.
-   *
-   */
-  Future<File> writeAsString(String contents,
-      {FileMode mode: FileMode.write,
-      Encoding encoding: utf8,
-      bool flush: false});
-
-  /**
-   * Synchronously write a string to a file.
-   *
-   * Opens the file, writes the string in the given encoding, and closes the
-   * file.
-   *
-   * By default [writeAsStringSync] creates the file for writing and
-   * truncates the file if it already exists. In order to append the bytes
-   * to an existing file, pass [FileMode.append] as the optional mode
-   * parameter.
-   *
-   * If the [flush] argument is set to `true` data written will be
-   * flushed to the file system before returning.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void writeAsStringSync(String contents,
-      {FileMode mode: FileMode.write,
-      Encoding encoding: utf8,
-      bool flush: false});
-
-  /**
-   * Get the path of the file.
-   */
-  String get path;
-}
-
-/**
- * `RandomAccessFile` provides random access to the data in a
- * file.
- *
- * `RandomAccessFile` objects are obtained by calling the
- * `open` method on a [File] object.
- *
- * A `RandomAccessFile` have both asynchronous and synchronous
- * methods. The asynchronous methods all return a `Future`
- * whereas the synchronous methods will return the result directly,
- * and block the current isolate until the result is ready.
- *
- * At most one asynchronous method can be pending on a given `RandomAccessFile`
- * instance at the time. If an asynchronous method is called when one is
- * already in progress a [FileSystemException] is thrown.
- *
- * If an asynchronous method is pending it is also not possible to call any
- * synchronous methods. This will also throw a [FileSystemException].
- */
-abstract class RandomAccessFile {
-  /**
-   * Closes the file. Returns a `Future` that
-   * completes when it has been closed.
-   */
-  Future<void> close();
-
-  /**
-   * Synchronously closes the file.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void closeSync();
-
-  /**
-   * Reads a byte from the file. Returns a `Future<int>` that
-   * completes with the byte, or with -1 if end-of-file has been reached.
-   */
-  Future<int> readByte();
-
-  /**
-   * Synchronously reads a single byte from the file. If end-of-file
-   * has been reached -1 is returned.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  int readByteSync();
-
-  /**
-   * Reads [bytes] bytes from a file and returns the result as a list of bytes.
-   */
-  Future<Uint8List> read(int bytes);
-
-  /**
-   * Synchronously reads a maximum of [bytes] bytes from a file and
-   * returns the result in a list of bytes.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  Uint8List readSync(int bytes);
-
-  /**
-   * Reads into an existing [List<int>] from the file. If [start] is present,
-   * the bytes will be filled into [buffer] from at index [start], otherwise
-   * index 0. If [end] is present, the [end] - [start] bytes will be read into
-   * [buffer], otherwise up to [buffer.length]. If [end] == [start] nothing
-   * happens.
-   *
-   * Returns a `Future<int>` that completes with the number of bytes read.
-   */
-  Future<int> readInto(List<int> buffer, [int start = 0, int? end]);
-
-  /**
-   * Synchronously reads into an existing [List<int>] from the file and returns
-   * the number of bytes read.
-   *
-   * If [start] is present, the bytes will be filled into [buffer] from at
-   * index [start], otherwise index 0.  If [end] is present, the
-   * [end] - [start] bytes will be read into [buffer], otherwise up to
-   * [buffer.length]. If [end] == [start] nothing happens.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  int readIntoSync(List<int> buffer, [int start = 0, int? end]);
-
-  /**
-   * Writes a single byte to the file. Returns a
-   * `Future<RandomAccessFile>` that completes with this
-   * RandomAccessFile when the write completes.
-   */
-  Future<RandomAccessFile> writeByte(int value);
-
-  /**
-   * Synchronously writes a single byte to the file. Returns the
-   * number of bytes successfully written.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  int writeByteSync(int value);
-
-  /**
-   * Writes from a [List<int>] to the file. It will read the buffer from index
-   * [start] to index [end]. If [start] is omitted, it'll start from index 0.
-   * If [end] is omitted, it will write to end of [buffer].
-   *
-   * Returns a `Future<RandomAccessFile>` that completes with this
-   * [RandomAccessFile] when the write completes.
-   */
-  Future<RandomAccessFile> writeFrom(List<int> buffer,
-      [int start = 0, int? end]);
-
-  /**
-   * Synchronously writes from a [List<int>] to the file. It will read the
-   * buffer from index [start] to index [end]. If [start] is omitted, it'll
-   * start from index 0. If [end] is omitted, it will write to the end of
-   * [buffer].
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void writeFromSync(List<int> buffer, [int start = 0, int? end]);
-
-  /**
-   * Writes a string to the file using the given [Encoding]. Returns a
-   * `Future<RandomAccessFile>` that completes with this
-   * RandomAccessFile when the write completes.
-   */
-  Future<RandomAccessFile> writeString(String string,
-      {Encoding encoding: utf8});
-
-  /**
-   * Synchronously writes a single string to the file using the given
-   * [Encoding].
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void writeStringSync(String string, {Encoding encoding: utf8});
-
-  /**
-   * Gets the current byte position in the file. Returns a
-   * `Future<int>` that completes with the position.
-   */
-  Future<int> position();
-
-  /**
-   * Synchronously gets the current byte position in the file.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  int positionSync();
-
-  /**
-   * Sets the byte position in the file. Returns a
-   * `Future<RandomAccessFile>` that completes with this
-   * RandomAccessFile when the position has been set.
-   */
-  Future<RandomAccessFile> setPosition(int position);
-
-  /**
-   * Synchronously sets the byte position in the file.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void setPositionSync(int position);
-
-  /**
-   * Truncates (or extends) the file to [length] bytes. Returns a
-   * `Future<RandomAccessFile>` that completes with this
-   * RandomAccessFile when the truncation has been performed.
-   */
-  Future<RandomAccessFile> truncate(int length);
-
-  /**
-   * Synchronously truncates (or extends) the file to [length] bytes.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void truncateSync(int length);
-
-  /**
-   * Gets the length of the file. Returns a `Future<int>` that
-   * completes with the length in bytes.
-   */
-  Future<int> length();
-
-  /**
-   * Synchronously gets the length of the file.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  int lengthSync();
-
-  /**
-   * Flushes the contents of the file to disk. Returns a
-   * `Future<RandomAccessFile>` that completes with this
-   * RandomAccessFile when the flush operation completes.
-   */
-  Future<RandomAccessFile> flush();
-
-  /**
-   * Synchronously flushes the contents of the file to disk.
-   *
-   * Throws a [FileSystemException] if the operation fails.
-   */
-  void flushSync();
-
-  /**
-   * Locks the file or part of the file.
-   *
-   * By default an exclusive lock will be obtained, but that can be overridden
-   * by the [mode] argument.
-   *
-   * Locks the byte range from [start] to [end] of the file, with the
-   * byte at position `end` not included. If no arguments are
-   * specified, the full file is locked, If only `start` is specified
-   * the file is locked from byte position `start` to the end of the
-   * file, no matter how large it grows. It is possible to specify an
-   * explicit value of `end` which is past the current length of the file.
-   *
-   * To obtain an exclusive lock on a file it must be opened for writing.
-   *
-   * If [mode] is [FileLock.exclusive] or [FileLock.shared], an error is
-   * signaled if the lock cannot be obtained. If [mode] is
-   * [FileLock.blockingExclusive] or [FileLock.blockingShared], the
-   * returned [Future] is resolved only when the lock has been obtained.
-   *
-   * *NOTE* file locking does have slight differences in behavior across
-   * platforms:
-   *
-   * On Linux and OS X this uses advisory locks, which have the
-   * surprising semantics that all locks associated with a given file
-   * are removed when *any* file descriptor for that file is closed by
-   * the process. Note that this does not actually lock the file for
-   * access. Also note that advisory locks are on a process
-   * level. This means that several isolates in the same process can
-   * obtain an exclusive lock on the same file.
-   *
-   * On Windows the regions used for lock and unlock needs to match. If that
-   * is not the case unlocking will result in the OS error "The segment is
-   * already unlocked".
-   */
-  Future<RandomAccessFile> lock(
-      [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]);
-
-  /**
-   * Synchronously locks the file or part of the file.
-   *
-   * By default an exclusive lock will be obtained, but that can be overridden
-   * by the [mode] argument.
-   *
-   * Locks the byte range from [start] to [end] of the file ,with the
-   * byte at position `end` not included. If no arguments are
-   * specified, the full file is locked, If only `start` is specified
-   * the file is locked from byte position `start` to the end of the
-   * file, no matter how large it grows. It is possible to specify an
-   * explicit value of `end` which is past the current length of the file.
-   *
-   * To obtain an exclusive lock on a file it must be opened for writing.
-   *
-   * If [mode] is [FileLock.exclusive] or [FileLock.shared], an exception is
-   * thrown if the lock cannot be obtained. If [mode] is
-   * [FileLock.blockingExclusive] or [FileLock.blockingShared], the
-   * call returns only after the lock has been obtained.
-   *
-   * *NOTE* file locking does have slight differences in behavior across
-   * platforms:
-   *
-   * On Linux and OS X this uses advisory locks, which have the
-   * surprising semantics that all locks associated with a given file
-   * are removed when *any* file descriptor for that file is closed by
-   * the process. Note that this does not actually lock the file for
-   * access. Also note that advisory locks are on a process
-   * level. This means that several isolates in the same process can
-   * obtain an exclusive lock on the same file.
-   *
-   * On Windows the regions used for lock and unlock needs to match. If that
-   * is not the case unlocking will result in the OS error "The segment is
-   * already unlocked".
-   *
-   */
-  void lockSync(
-      [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]);
-
-  /**
-   * Unlocks the file or part of the file.
-   *
-   * Unlocks the byte range from [start] to [end] of the file, with
-   * the byte at position `end` not included. If no arguments are
-   * specified, the full file is unlocked, If only `start` is
-   * specified the file is unlocked from byte position `start` to the
-   * end of the file.
-   *
-   * *NOTE* file locking does have slight differences in behavior across
-   * platforms:
-   *
-   * See [lock] for more details.
-   */
-  Future<RandomAccessFile> unlock([int start = 0, int end = -1]);
-
-  /**
-   * Synchronously unlocks the file or part of the file.
-   *
-   * Unlocks the byte range from [start] to [end] of the file, with
-   * the byte at position `end` not included. If no arguments are
-   * specified, the full file is unlocked, If only `start` is
-   * specified the file is unlocked from byte position `start` to the
-   * end of the file.
-   *
-   * *NOTE* file locking does have slight differences in behavior across
-   * platforms:
-   *
-   * See [lockSync] for more details.
-   */
-  void unlockSync([int start = 0, int end = -1]);
-
-  /**
-   * Returns a human-readable string for this RandomAccessFile instance.
-   */
-  String toString();
-
-  /**
-   * Gets the path of the file underlying this RandomAccessFile.
-   */
-  String get path;
-}
-
-/**
- * Exception thrown when a file operation fails.
- */
-@pragma("vm:entry-point")
-class FileSystemException implements IOException {
-  /**
-   * Message describing the error. This does not include any detailed
-   * information form the underlying OS error. Check [osError] for
-   * that information.
-   */
-  final String message;
-
-  /**
-   * The file system path on which the error occurred. Can be `null`
-   * if the exception does not relate directly to a file system path.
-   */
-  final String? path;
-
-  /**
-   * The underlying OS error. Can be `null` if the exception is not
-   * raised due to an OS error.
-   */
-  final OSError? osError;
-
-  /**
-   * Creates a new FileSystemException with an optional error message
-   * [message], optional file system path [path] and optional OS error
-   * [osError].
-   */
-  @pragma("vm:entry-point")
-  const FileSystemException([this.message = "", this.path = "", this.osError]);
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("FileSystemException");
-    if (message.isNotEmpty) {
-      sb.write(": $message");
-      if (path != null) {
-        sb.write(", path = '$path'");
-      }
-      if (osError != null) {
-        sb.write(" ($osError)");
-      }
-    } else if (osError != null) {
-      sb.write(": $osError");
-      if (path != null) {
-        sb.write(", path = '$path'");
-      }
-    } else if (path != null) {
-      sb.write(": $path");
-    }
-    return sb.toString();
-  }
-}
diff --git a/sdk_nnbd/lib/io/file_impl.dart b/sdk_nnbd/lib/io/file_impl.dart
deleted file mode 100644
index ee34b7d..0000000
--- a/sdk_nnbd/lib/io/file_impl.dart
+++ /dev/null
@@ -1,1090 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-// Read the file in blocks of size 64k.
-const int _blockSize = 64 * 1024;
-
-class _FileStream extends Stream<List<int>> {
-  // Stream controller.
-  late StreamController<Uint8List> _controller;
-
-  // Information about the underlying file.
-  String? _path;
-  late RandomAccessFile _openedFile;
-  int _position;
-  int? _end;
-  final Completer _closeCompleter = new Completer();
-
-  // Has the stream been paused or unsubscribed?
-  bool _unsubscribed = false;
-
-  // Is there a read currently in progress?
-  bool _readInProgress = true;
-  bool _closed = false;
-
-  bool _atEnd = false;
-
-  _FileStream(this._path, int? position, this._end) : _position = position ?? 0;
-
-  _FileStream.forStdin() : _position = 0;
-
-  StreamSubscription<Uint8List> listen(void onData(Uint8List event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    _controller = new StreamController<Uint8List>(
-        sync: true,
-        onListen: _start,
-        onResume: _readBlock,
-        onCancel: () {
-          _unsubscribed = true;
-          return _closeFile();
-        });
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  Future _closeFile() {
-    if (_readInProgress || _closed) {
-      return _closeCompleter.future;
-    }
-    _closed = true;
-
-    void done() {
-      _closeCompleter.complete();
-      _controller.close();
-    }
-
-    _openedFile.close().catchError(_controller.addError).whenComplete(done);
-    return _closeCompleter.future;
-  }
-
-  void _readBlock() {
-    // Don't start a new read if one is already in progress.
-    if (_readInProgress) return;
-    if (_atEnd) {
-      _closeFile();
-      return;
-    }
-    _readInProgress = true;
-    int readBytes = _blockSize;
-    final end = _end;
-    if (end != null) {
-      readBytes = min(readBytes, end - _position);
-      if (readBytes < 0) {
-        _readInProgress = false;
-        if (!_unsubscribed) {
-          _controller.addError(new RangeError("Bad end position: $end"));
-          _closeFile();
-          _unsubscribed = true;
-        }
-        return;
-      }
-    }
-    _openedFile.read(readBytes).then((block) {
-      _readInProgress = false;
-      if (_unsubscribed) {
-        _closeFile();
-        return;
-      }
-      _position += block.length;
-      if (block.length < readBytes || (_end != null && _position == _end)) {
-        _atEnd = true;
-      }
-      if (!_atEnd && !_controller.isPaused) {
-        _readBlock();
-      }
-      _controller.add(block);
-      if (_atEnd) {
-        _closeFile();
-      }
-    }).catchError((e, s) {
-      if (!_unsubscribed) {
-        _controller.addError(e, s);
-        _closeFile();
-        _unsubscribed = true;
-      }
-    });
-  }
-
-  void _start() {
-    if (_position < 0) {
-      _controller.addError(new RangeError("Bad start position: $_position"));
-      _controller.close();
-      _closeCompleter.complete();
-      return;
-    }
-
-    void onReady(RandomAccessFile file) {
-      _openedFile = file;
-      _readInProgress = false;
-      _readBlock();
-    }
-
-    void onOpenFile(RandomAccessFile file) {
-      if (_position > 0) {
-        file.setPosition(_position).then(onReady, onError: (e, s) {
-          _controller.addError(e, s);
-          _readInProgress = false;
-          _closeFile();
-        });
-      } else {
-        onReady(file);
-      }
-    }
-
-    void openFailed(error, stackTrace) {
-      _controller.addError(error, stackTrace);
-      _controller.close();
-      _closeCompleter.complete();
-    }
-
-    final path = _path;
-    if (path != null) {
-      new File(path)
-          .open(mode: FileMode.read)
-          .then(onOpenFile, onError: openFailed);
-    } else {
-      try {
-        onOpenFile(_File._openStdioSync(0));
-      } catch (e, s) {
-        openFailed(e, s);
-      }
-    }
-  }
-}
-
-class _FileStreamConsumer extends StreamConsumer<List<int>> {
-  File? _file;
-  Future<RandomAccessFile> _openFuture;
-
-  _FileStreamConsumer(File file, FileMode mode)
-      : _file = file,
-        _openFuture = file.open(mode: mode);
-
-  _FileStreamConsumer.fromStdio(int fd)
-      : _openFuture = new Future.value(_File._openStdioSync(fd));
-
-  Future<File?> addStream(Stream<List<int>> stream) {
-    Completer<File?> completer = new Completer<File?>.sync();
-    _openFuture.then((openedFile) {
-      late StreamSubscription<List<int>> _subscription;
-      void error(e, StackTrace stackTrace) {
-        _subscription.cancel();
-        openedFile.close();
-        completer.completeError(e, stackTrace);
-      }
-
-      _subscription = stream.listen((d) {
-        _subscription.pause();
-        try {
-          openedFile
-              .writeFrom(d, 0, d.length)
-              .then((_) => _subscription.resume(), onError: error);
-        } catch (e, stackTrace) {
-          error(e, stackTrace);
-        }
-      }, onDone: () {
-        completer.complete(_file);
-      }, onError: error, cancelOnError: true);
-    }).catchError(completer.completeError);
-    return completer.future;
-  }
-
-  Future<File?> close() =>
-      _openFuture.then((openedFile) => openedFile.close()).then((_) => _file);
-}
-
-// Class for encapsulating the native implementation of files.
-class _File extends FileSystemEntity implements File {
-  final String _path;
-  final Uint8List _rawPath;
-
-  _File(String path)
-      : _path = _checkNotNull(path, "path"),
-        _rawPath = FileSystemEntity._toUtf8Array(path);
-
-  _File.fromRawPath(Uint8List rawPath)
-      : _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(
-            _checkNotNull(rawPath, "rawPath")),
-        _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
-
-  String get path => _path;
-
-  // WARNING:
-  // Calling this function will increase the reference count on the native
-  // namespace object. It should only be called to pass the pointer to the
-  // IOService, which will decrement the reference count when it is finished
-  // with it.
-  static int _namespacePointer() => _Namespace._namespacePointer;
-
-  static Future _dispatchWithNamespace(int request, List data) {
-    data[0] = _namespacePointer();
-    return _IOService._dispatch(request, data);
-  }
-
-  Future<bool> exists() {
-    return _dispatchWithNamespace(_IOService.fileExists, [null, _rawPath])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Cannot check existence", path);
-      }
-      return response;
-    });
-  }
-
-  external static _exists(_Namespace namespace, Uint8List rawPath);
-
-  bool existsSync() {
-    var result = _exists(_Namespace._namespace, _rawPath);
-    throwIfError(result, "Cannot check existence of file", path);
-    return result;
-  }
-
-  File get absolute => new File(_absolutePath);
-
-  Future<File> create({bool recursive: false}) {
-    var result =
-        recursive ? parent.create(recursive: true) : new Future.value(null);
-    return result
-        .then((_) =>
-            _dispatchWithNamespace(_IOService.fileCreate, [null, _rawPath]))
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Cannot create file", path);
-      }
-      return this;
-    });
-  }
-
-  external static _create(_Namespace namespace, Uint8List rawPath);
-
-  external static _createLink(
-      _Namespace namespace, Uint8List rawPath, String target);
-
-  external static _linkTarget(_Namespace namespace, Uint8List rawPath);
-
-  void createSync({bool recursive: false}) {
-    if (recursive) {
-      parent.createSync(recursive: true);
-    }
-    var result = _create(_Namespace._namespace, _rawPath);
-    throwIfError(result, "Cannot create file", path);
-  }
-
-  Future<File> _delete({bool recursive: false}) {
-    if (recursive) {
-      return new Directory(path).delete(recursive: true).then((_) => this);
-    }
-    return _dispatchWithNamespace(_IOService.fileDelete, [null, _rawPath])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Cannot delete file", path);
-      }
-      return this;
-    });
-  }
-
-  external static _deleteNative(_Namespace namespace, Uint8List rawPath);
-
-  external static _deleteLinkNative(_Namespace namespace, Uint8List rawPath);
-
-  void _deleteSync({bool recursive: false}) {
-    if (recursive) {
-      return new Directory.fromRawPath(_rawPath).deleteSync(recursive: true);
-    }
-    var result = _deleteNative(_Namespace._namespace, _rawPath);
-    throwIfError(result, "Cannot delete file", path);
-  }
-
-  Future<File> rename(String newPath) {
-    return _dispatchWithNamespace(
-        _IOService.fileRename, [null, _rawPath, newPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot rename file to '$newPath'", path);
-      }
-      return new File(newPath);
-    });
-  }
-
-  external static _rename(
-      _Namespace namespace, Uint8List oldPath, String newPath);
-
-  external static _renameLink(
-      _Namespace namespace, Uint8List oldPath, String newPath);
-
-  File renameSync(String newPath) {
-    var result = _rename(_Namespace._namespace, _rawPath, newPath);
-    throwIfError(result, "Cannot rename file to '$newPath'", path);
-    return new File(newPath);
-  }
-
-  Future<File> copy(String newPath) {
-    return _dispatchWithNamespace(
-        _IOService.fileCopy, [null, _rawPath, newPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot copy file to '$newPath'", path);
-      }
-      return new File(newPath);
-    });
-  }
-
-  external static _copy(
-      _Namespace namespace, Uint8List oldPath, String newPath);
-
-  File copySync(String newPath) {
-    var result = _copy(_Namespace._namespace, _rawPath, newPath);
-    throwIfError(result, "Cannot copy file to '$newPath'", path);
-    return new File(newPath);
-  }
-
-  Future<RandomAccessFile> open({FileMode mode: FileMode.read}) {
-    if (mode != FileMode.read &&
-        mode != FileMode.write &&
-        mode != FileMode.append &&
-        mode != FileMode.writeOnly &&
-        mode != FileMode.writeOnlyAppend) {
-      return new Future.error(
-          new ArgumentError('Invalid file mode for this operation'));
-    }
-    return _dispatchWithNamespace(
-        _IOService.fileOpen, [null, _rawPath, mode._mode]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Cannot open file", path);
-      }
-      return new _RandomAccessFile(response, path);
-    });
-  }
-
-  Future<int> length() {
-    return _dispatchWithNamespace(
-        _IOService.fileLengthFromPath, [null, _rawPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot retrieve length of file", path);
-      }
-      return response;
-    });
-  }
-
-  external static _lengthFromPath(_Namespace namespace, Uint8List rawPath);
-
-  int lengthSync() {
-    var result = _lengthFromPath(_Namespace._namespace, _rawPath);
-    throwIfError(result, "Cannot retrieve length of file", path);
-    return result;
-  }
-
-  Future<DateTime> lastAccessed() {
-    return _dispatchWithNamespace(_IOService.fileLastAccessed, [null, _rawPath])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot retrieve access time", path);
-      }
-      return new DateTime.fromMillisecondsSinceEpoch(response);
-    });
-  }
-
-  external static _lastAccessed(_Namespace namespace, Uint8List rawPath);
-
-  DateTime lastAccessedSync() {
-    var ms = _lastAccessed(_Namespace._namespace, _rawPath);
-    throwIfError(ms, "Cannot retrieve access time", path);
-    return new DateTime.fromMillisecondsSinceEpoch(ms);
-  }
-
-  Future setLastAccessed(DateTime time) {
-    int millis = time.millisecondsSinceEpoch;
-    return _dispatchWithNamespace(
-            _IOService.fileSetLastAccessed, [null, _rawPath, millis])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Cannot set access time", path);
-      }
-      return null;
-    });
-  }
-
-  external static _setLastAccessed(
-      _Namespace namespace, Uint8List rawPath, int millis);
-
-  void setLastAccessedSync(DateTime time) {
-    int millis = time.millisecondsSinceEpoch;
-    var result = _setLastAccessed(_Namespace._namespace, _rawPath, millis);
-    if (result is OSError) {
-      throw new FileSystemException(
-          "Failed to set file access time", path, result);
-    }
-  }
-
-  Future<DateTime> lastModified() {
-    return _dispatchWithNamespace(_IOService.fileLastModified, [null, _rawPath])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot retrieve modification time", path);
-      }
-      return new DateTime.fromMillisecondsSinceEpoch(response);
-    });
-  }
-
-  external static _lastModified(_Namespace namespace, Uint8List rawPath);
-
-  DateTime lastModifiedSync() {
-    var ms = _lastModified(_Namespace._namespace, _rawPath);
-    throwIfError(ms, "Cannot retrieve modification time", path);
-    return new DateTime.fromMillisecondsSinceEpoch(ms);
-  }
-
-  Future setLastModified(DateTime time) {
-    int millis = time.millisecondsSinceEpoch;
-    return _dispatchWithNamespace(
-            _IOService.fileSetLastModified, [null, _rawPath, millis])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot set modification time", path);
-      }
-      return null;
-    });
-  }
-
-  external static _setLastModified(
-      _Namespace namespace, Uint8List rawPath, int millis);
-
-  void setLastModifiedSync(DateTime time) {
-    int millis = time.millisecondsSinceEpoch;
-    var result = _setLastModified(_Namespace._namespace, _rawPath, millis);
-    if (result is OSError) {
-      throw new FileSystemException(
-          "Failed to set file modification time", path, result);
-    }
-  }
-
-  external static _open(_Namespace namespace, Uint8List rawPath, int mode);
-
-  RandomAccessFile openSync({FileMode mode: FileMode.read}) {
-    if (mode != FileMode.read &&
-        mode != FileMode.write &&
-        mode != FileMode.append &&
-        mode != FileMode.writeOnly &&
-        mode != FileMode.writeOnlyAppend) {
-      throw new ArgumentError('Invalid file mode for this operation');
-    }
-    var id = _open(_Namespace._namespace, _rawPath, mode._mode);
-    throwIfError(id, "Cannot open file", path);
-    return new _RandomAccessFile(id, _path);
-  }
-
-  external static int _openStdio(int fd);
-
-  static RandomAccessFile _openStdioSync(int fd) {
-    var id = _openStdio(fd);
-    if (id == 0) {
-      throw new FileSystemException("Cannot open stdio file for: $fd");
-    }
-    return new _RandomAccessFile(id, "");
-  }
-
-  Stream<List<int>> openRead([int? start, int? end]) {
-    return new _FileStream(path, start, end);
-  }
-
-  IOSink openWrite({FileMode mode: FileMode.write, Encoding encoding: utf8}) {
-    if (mode != FileMode.write &&
-        mode != FileMode.append &&
-        mode != FileMode.writeOnly &&
-        mode != FileMode.writeOnlyAppend) {
-      throw new ArgumentError('Invalid file mode for this operation');
-    }
-    var consumer = new _FileStreamConsumer(this, mode);
-    return new IOSink(consumer, encoding: encoding);
-  }
-
-  Future<Uint8List> readAsBytes() {
-    Future<Uint8List> readDataChunked(RandomAccessFile file) {
-      var builder = new BytesBuilder(copy: false);
-      var completer = new Completer<Uint8List>();
-      void read() {
-        file.read(_blockSize).then((data) {
-          if (data.length > 0) {
-            builder.add(data);
-            read();
-          } else {
-            completer.complete(builder.takeBytes());
-          }
-        }, onError: completer.completeError);
-      }
-
-      read();
-      return completer.future;
-    }
-
-    return open().then((file) {
-      return file.length().then((length) {
-        if (length == 0) {
-          // May be character device, try to read it in chunks.
-          return readDataChunked(file);
-        }
-        return file.read(length);
-      }).whenComplete(file.close);
-    });
-  }
-
-  Uint8List readAsBytesSync() {
-    var opened = openSync();
-    try {
-      Uint8List data;
-      var length = opened.lengthSync();
-      if (length == 0) {
-        // May be character device, try to read it in chunks.
-        var builder = new BytesBuilder(copy: false);
-        do {
-          data = opened.readSync(_blockSize);
-          if (data.length > 0) builder.add(data);
-        } while (data.length > 0);
-        data = builder.takeBytes();
-      } else {
-        data = opened.readSync(length);
-      }
-      return data;
-    } finally {
-      opened.closeSync();
-    }
-  }
-
-  String _tryDecode(List<int> bytes, Encoding encoding) {
-    try {
-      return encoding.decode(bytes);
-    } catch (_) {
-      throw new FileSystemException(
-          "Failed to decode data using encoding '${encoding.name}'", path);
-    }
-  }
-
-  Future<String> readAsString({Encoding encoding: utf8}) {
-    // TODO(dart:io): If the change in async semantics to run synchronously
-    // until await lands, this is as efficient as
-    // return _tryDecode(await readAsBytes(), encoding);
-    var stack = StackTrace.current;
-    return readAsBytes().then((bytes) {
-      try {
-        return _tryDecode(bytes, encoding);
-      } catch (e) {
-        return new Future.error(e, stack);
-      }
-    });
-  }
-
-  String readAsStringSync({Encoding encoding: utf8}) =>
-      _tryDecode(readAsBytesSync(), encoding);
-
-  Future<List<String>> readAsLines({Encoding encoding: utf8}) =>
-      readAsString(encoding: encoding).then(const LineSplitter().convert);
-
-  List<String> readAsLinesSync({Encoding encoding: utf8}) =>
-      const LineSplitter().convert(readAsStringSync(encoding: encoding));
-
-  Future<File> writeAsBytes(List<int> bytes,
-      {FileMode mode: FileMode.write, bool flush: false}) {
-    return open(mode: mode).then((file) {
-      return file.writeFrom(bytes, 0, bytes.length).then<File>((_) {
-        if (flush) return file.flush().then((_) => this);
-        return this;
-      }).whenComplete(file.close);
-    });
-  }
-
-  void writeAsBytesSync(List<int> bytes,
-      {FileMode mode: FileMode.write, bool flush: false}) {
-    RandomAccessFile opened = openSync(mode: mode);
-    try {
-      opened.writeFromSync(bytes, 0, bytes.length);
-      if (flush) opened.flushSync();
-    } finally {
-      opened.closeSync();
-    }
-  }
-
-  Future<File> writeAsString(String contents,
-      {FileMode mode: FileMode.write,
-      Encoding encoding: utf8,
-      bool flush: false}) {
-    try {
-      return writeAsBytes(encoding.encode(contents), mode: mode, flush: flush);
-    } catch (e) {
-      return new Future.error(e);
-    }
-  }
-
-  void writeAsStringSync(String contents,
-      {FileMode mode: FileMode.write,
-      Encoding encoding: utf8,
-      bool flush: false}) {
-    writeAsBytesSync(encoding.encode(contents), mode: mode, flush: flush);
-  }
-
-  String toString() => "File: '$path'";
-
-  static throwIfError(Object result, String msg, String path) {
-    if (result is OSError) {
-      throw new FileSystemException(msg, path, result);
-    }
-  }
-
-  // TODO(40614): Remove once non-nullability is sound.
-  static T _checkNotNull<T>(T t, String name) {
-    ArgumentError.checkNotNull(t, name);
-    return t;
-  }
-}
-
-abstract class _RandomAccessFileOps {
-  external factory _RandomAccessFileOps(int pointer);
-
-  int getPointer();
-  int close();
-  readByte();
-  read(int bytes);
-  readInto(List<int> buffer, int start, int? end);
-  writeByte(int value);
-  writeFrom(List<int> buffer, int start, int? end);
-  position();
-  setPosition(int position);
-  truncate(int length);
-  length();
-  flush();
-  lock(int lock, int start, int end);
-}
-
-class _RandomAccessFile implements RandomAccessFile {
-  static bool _connectedResourceHandler = false;
-
-  final String path;
-
-  bool _asyncDispatched = false;
-
-  late _FileResourceInfo _resourceInfo;
-  _RandomAccessFileOps _ops;
-
-  _RandomAccessFile(int pointer, this.path)
-      : _ops = new _RandomAccessFileOps(pointer) {
-    _resourceInfo = new _FileResourceInfo(this);
-    _maybeConnectHandler();
-  }
-
-  void _maybePerformCleanup() {
-    if (closed) {
-      _FileResourceInfo.FileClosed(_resourceInfo);
-    }
-  }
-
-  _maybeConnectHandler() {
-    if (!_connectedResourceHandler) {
-      // TODO(ricow): We probably need to set these in some initialization code.
-      // We need to make sure that these are always available from the
-      // observatory even if no files (or sockets for the socket ones) are
-      // open.
-      registerExtension(
-          'ext.dart.io.getOpenFiles', _FileResourceInfo.getOpenFiles);
-      registerExtension(
-          'ext.dart.io.getFileByID', _FileResourceInfo.getFileInfoMapByID);
-      _connectedResourceHandler = true;
-    }
-  }
-
-  Future<void> close() {
-    return _dispatch(_IOService.fileClose, [null], markClosed: true)
-        .then((result) {
-      if (result == -1) {
-        throw new FileSystemException("Cannot close file", path);
-      }
-      closed = closed || (result == 0);
-      _maybePerformCleanup();
-    });
-  }
-
-  void closeSync() {
-    _checkAvailable();
-    var id = _ops.close();
-    if (id == -1) {
-      throw new FileSystemException("Cannot close file", path);
-    }
-    closed = closed || (id == 0);
-    _maybePerformCleanup();
-  }
-
-  Future<int> readByte() {
-    return _dispatch(_IOService.fileReadByte, [null]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "readByte failed", path);
-      }
-      _resourceInfo.addRead(1);
-      return response;
-    });
-  }
-
-  int readByteSync() {
-    _checkAvailable();
-    var result = _ops.readByte();
-    if (result is OSError) {
-      throw new FileSystemException("readByte failed", path, result);
-    }
-    _resourceInfo.addRead(1);
-    return result;
-  }
-
-  Future<Uint8List> read(int bytes) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(bytes, "bytes");
-    return _dispatch(_IOService.fileRead, [null, bytes]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "read failed", path);
-      }
-      _resourceInfo.addRead(response[1].length);
-      Uint8List result = response[1];
-      return result;
-    });
-  }
-
-  Uint8List readSync(int bytes) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(bytes, "bytes");
-    _checkAvailable();
-    var result = _ops.read(bytes);
-    if (result is OSError) {
-      throw new FileSystemException("readSync failed", path, result);
-    }
-    _resourceInfo.addRead(result.length);
-    return result;
-  }
-
-  Future<int> readInto(List<int> buffer, [int start = 0, int? end]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(buffer, "buffer");
-    end = RangeError.checkValidRange(start, end, buffer.length);
-    if (end == start) {
-      return new Future.value(0);
-    }
-    int length = end - start;
-    return _dispatch(_IOService.fileReadInto, [null, length]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "readInto failed", path);
-      }
-      int read = response[1];
-      List<int> data = response[2];
-      buffer.setRange(start, start + read, data);
-      _resourceInfo.addRead(read);
-      return read;
-    });
-  }
-
-  int readIntoSync(List<int> buffer, [int start = 0, int? end]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(buffer, "buffer");
-    _checkAvailable();
-    end = RangeError.checkValidRange(start, end, buffer.length);
-    if (end == start) {
-      return 0;
-    }
-    var result = _ops.readInto(buffer, start, end);
-    if (result is OSError) {
-      throw new FileSystemException("readInto failed", path, result);
-    }
-    _resourceInfo.addRead(result);
-    return result;
-  }
-
-  Future<RandomAccessFile> writeByte(int value) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(value, "value");
-    return _dispatch(_IOService.fileWriteByte, [null, value]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "writeByte failed", path);
-      }
-      _resourceInfo.addWrite(1);
-      return this;
-    });
-  }
-
-  int writeByteSync(int value) {
-    _checkAvailable();
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(value, "value");
-    var result = _ops.writeByte(value);
-    if (result is OSError) {
-      throw new FileSystemException("writeByte failed", path, result);
-    }
-    _resourceInfo.addWrite(1);
-    return result;
-  }
-
-  Future<RandomAccessFile> writeFrom(List<int> buffer,
-      [int start = 0, int? end]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(buffer, "buffer");
-    ArgumentError.checkNotNull(start, "start");
-    end = RangeError.checkValidRange(start, end, buffer.length);
-    if (end == start) {
-      return new Future.value(this);
-    }
-    _BufferAndStart result;
-    try {
-      result = _ensureFastAndSerializableByteData(buffer, start, end);
-    } catch (e) {
-      return new Future.error(e);
-    }
-
-    List request = new List<dynamic>.filled(4, null);
-    request[0] = null;
-    request[1] = result.buffer;
-    request[2] = result.start;
-    request[3] = end - (start - result.start);
-    return _dispatch(_IOService.fileWriteFrom, request).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "writeFrom failed", path);
-      }
-      _resourceInfo.addWrite(end! - (start - result.start));
-      return this;
-    });
-  }
-
-  void writeFromSync(List<int> buffer, [int start = 0, int? end]) {
-    _checkAvailable();
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(buffer, "buffer");
-    ArgumentError.checkNotNull(start, "start");
-    end = RangeError.checkValidRange(start, end, buffer.length);
-    if (end == start) {
-      return;
-    }
-    _BufferAndStart bufferAndStart =
-        _ensureFastAndSerializableByteData(buffer, start, end);
-    var result = _ops.writeFrom(bufferAndStart.buffer, bufferAndStart.start,
-        end - (start - bufferAndStart.start));
-    if (result is OSError) {
-      throw new FileSystemException("writeFrom failed", path, result);
-    }
-    _resourceInfo.addWrite(end - (start - bufferAndStart.start));
-  }
-
-  Future<RandomAccessFile> writeString(String string,
-      {Encoding encoding: utf8}) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(encoding, "encoding");
-    var data = encoding.encode(string);
-    return writeFrom(data, 0, data.length);
-  }
-
-  void writeStringSync(String string, {Encoding encoding: utf8}) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(encoding, "encoding");
-    var data = encoding.encode(string);
-    writeFromSync(data, 0, data.length);
-  }
-
-  Future<int> position() {
-    return _dispatch(_IOService.filePosition, [null]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "position failed", path);
-      }
-      return response;
-    });
-  }
-
-  int positionSync() {
-    _checkAvailable();
-    var result = _ops.position();
-    if (result is OSError) {
-      throw new FileSystemException("position failed", path, result);
-    }
-    return result;
-  }
-
-  Future<RandomAccessFile> setPosition(int position) {
-    return _dispatch(_IOService.fileSetPosition, [null, position])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "setPosition failed", path);
-      }
-      return this;
-    });
-  }
-
-  void setPositionSync(int position) {
-    _checkAvailable();
-    var result = _ops.setPosition(position);
-    if (result is OSError) {
-      throw new FileSystemException("setPosition failed", path, result);
-    }
-  }
-
-  Future<RandomAccessFile> truncate(int length) {
-    return _dispatch(_IOService.fileTruncate, [null, length]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "truncate failed", path);
-      }
-      return this;
-    });
-  }
-
-  void truncateSync(int length) {
-    _checkAvailable();
-    var result = _ops.truncate(length);
-    if (result is OSError) {
-      throw new FileSystemException("truncate failed", path, result);
-    }
-  }
-
-  Future<int> length() {
-    return _dispatch(_IOService.fileLength, [null]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "length failed", path);
-      }
-      return response;
-    });
-  }
-
-  int lengthSync() {
-    _checkAvailable();
-    var result = _ops.length();
-    if (result is OSError) {
-      throw new FileSystemException("length failed", path, result);
-    }
-    return result;
-  }
-
-  Future<RandomAccessFile> flush() {
-    return _dispatch(_IOService.fileFlush, [null]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "flush failed", path);
-      }
-      return this;
-    });
-  }
-
-  void flushSync() {
-    _checkAvailable();
-    var result = _ops.flush();
-    if (result is OSError) {
-      throw new FileSystemException("flush failed", path, result);
-    }
-  }
-
-  static const int lockUnlock = 0;
-  // static const int lockShared = 1;
-  // static const int lockExclusive = 2;
-  // static const int lockBlockingShared = 3;
-  // static const int lockBlockingExclusive = 4;
-
-  int _fileLockValue(FileLock fl) => fl._type;
-
-  Future<RandomAccessFile> lock(
-      [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(mode, "mode");
-    ArgumentError.checkNotNull(start, "start");
-    ArgumentError.checkNotNull(end, "end");
-    if ((start < 0) || (end < -1) || ((end != -1) && (start >= end))) {
-      throw new ArgumentError();
-    }
-    int lock = _fileLockValue(mode);
-    return _dispatch(_IOService.fileLock, [null, lock, start, end])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, 'lock failed', path);
-      }
-      return this;
-    });
-  }
-
-  Future<RandomAccessFile> unlock([int start = 0, int end = -1]) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(start, "start");
-    ArgumentError.checkNotNull(end, "end");
-    if (start == end) {
-      throw new ArgumentError();
-    }
-    return _dispatch(_IOService.fileLock, [null, lockUnlock, start, end])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, 'unlock failed', path);
-      }
-      return this;
-    });
-  }
-
-  void lockSync(
-      [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) {
-    _checkAvailable();
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(mode, "mode");
-    ArgumentError.checkNotNull(start, "start");
-    ArgumentError.checkNotNull(end, "end");
-    if ((start < 0) || (end < -1) || ((end != -1) && (start >= end))) {
-      throw new ArgumentError();
-    }
-    int lock = _fileLockValue(mode);
-    var result = _ops.lock(lock, start, end);
-    if (result is OSError) {
-      throw new FileSystemException('lock failed', path, result);
-    }
-  }
-
-  void unlockSync([int start = 0, int end = -1]) {
-    _checkAvailable();
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(start, "start");
-    ArgumentError.checkNotNull(end, "end");
-    if (start == end) {
-      throw new ArgumentError();
-    }
-    var result = _ops.lock(lockUnlock, start, end);
-    if (result is OSError) {
-      throw new FileSystemException('unlock failed', path, result);
-    }
-  }
-
-  bool closed = false;
-
-  // WARNING:
-  // Calling this function will increase the reference count on the native
-  // object that implements the file operations. It should only be called to
-  // pass the pointer to the IO Service, which will decrement the reference
-  // count when it is finished with it.
-  int _pointer() => _ops.getPointer();
-
-  Future _dispatch(int request, List data, {bool markClosed: false}) {
-    if (closed) {
-      return new Future.error(new FileSystemException("File closed", path));
-    }
-    if (_asyncDispatched) {
-      var msg = "An async operation is currently pending";
-      return new Future.error(new FileSystemException(msg, path));
-    }
-    if (markClosed) {
-      // Set closed to true to ensure that no more async requests can be issued
-      // for this file.
-      closed = true;
-    }
-    _asyncDispatched = true;
-    data[0] = _pointer();
-    return _IOService._dispatch(request, data).whenComplete(() {
-      _asyncDispatched = false;
-    });
-  }
-
-  void _checkAvailable() {
-    if (_asyncDispatched) {
-      throw new FileSystemException(
-          "An async operation is currently pending", path);
-    }
-    if (closed) {
-      throw new FileSystemException("File closed", path);
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/io/file_system_entity.dart b/sdk_nnbd/lib/io/file_system_entity.dart
deleted file mode 100644
index 0741583..0000000
--- a/sdk_nnbd/lib/io/file_system_entity.dart
+++ /dev/null
@@ -1,991 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * The type of an entity on the file system, such as a file, directory, or link.
- *
- * These constants are used by the [FileSystemEntity] class
- * to indicate the object's type.
- *
- */
-
-class FileSystemEntityType {
-  static const file = const FileSystemEntityType._internal(0);
-  @Deprecated("Use file instead")
-  static const FILE = file;
-
-  static const directory = const FileSystemEntityType._internal(1);
-  @Deprecated("Use directory instead")
-  static const DIRECTORY = directory;
-
-  static const link = const FileSystemEntityType._internal(2);
-  @Deprecated("Use link instead")
-  static const LINK = link;
-
-  static const notFound = const FileSystemEntityType._internal(3);
-  @Deprecated("Use notFound instead")
-  static const NOT_FOUND = notFound;
-
-  static const _typeList = const [
-    FileSystemEntityType.file,
-    FileSystemEntityType.directory,
-    FileSystemEntityType.link,
-    FileSystemEntityType.notFound,
-  ];
-  final int _type;
-
-  const FileSystemEntityType._internal(this._type);
-
-  static FileSystemEntityType _lookup(int type) => _typeList[type];
-  String toString() => const ['file', 'directory', 'link', 'notFound'][_type];
-}
-
-/**
- * A FileStat object represents the result of calling the POSIX stat() function
- * on a file system object.  It is an immutable object, representing the
- * snapshotted values returned by the stat() call.
- */
-class FileStat {
-  // These must agree with enum FileStat in file.h.
-  static const _type = 0;
-  static const _changedTime = 1;
-  static const _modifiedTime = 2;
-  static const _accessedTime = 3;
-  static const _mode = 4;
-  static const _size = 5;
-
-  static final _epoch = DateTime.fromMillisecondsSinceEpoch(0, isUtc: true);
-  static final _notFound = new FileStat._internal(
-      _epoch, _epoch, _epoch, FileSystemEntityType.notFound, 0, -1);
-
-  /**
-   * The time of the last change to the data or metadata of the file system
-   * object.
-   *
-   * On Windows platforms, this is instead the file creation time.
-   */
-  final DateTime changed;
-
-  /**
-   * The time of the last change to the data of the file system object.
-   */
-  final DateTime modified;
-
-  /**
-   * The time of the last access to the data of the file system object.
-   *
-   * On Windows platforms, this may have 1 day granularity, and be
-   * out of date by an hour.
-   */
-  final DateTime accessed;
-
-  /**
-   * The type of the underlying file system object.
-   *
-   * [FileSystemEntityType.notFound] if [stat] or [statSync] failed.
-   */
-  final FileSystemEntityType type;
-
-  /**
-   * The mode of the file system object.
-   *
-   * Permissions are encoded in the lower 16 bits of this number, and can be
-   * decoded using the [modeString] getter.
-   */
-  final int mode;
-
-  /**
-   * The size of the file system object.
-   */
-  final int size;
-
-  FileStat._internal(this.changed, this.modified, this.accessed, this.type,
-      this.mode, this.size);
-
-  external static _statSync(_Namespace namespace, String path);
-
-  /**
-   * Calls the operating system's `stat()` function (or equivalent) on [path].
-   *
-   * Returns a [FileStat] object containing the data returned by `stat()`.
-   * If the call fails, returns a [FileStat] object with [FileStat.type] set to
-   * [FileSystemEntityType.notFound] and the other fields invalid.
-   */
-  static FileStat statSync(String path) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _statSyncInternal(path);
-    }
-    return overrides.statSync(path);
-  }
-
-  static FileStat _statSyncInternal(String path) {
-    // Trailing path is not supported on Windows.
-    if (Platform.isWindows) {
-      path = FileSystemEntity._trimTrailingPathSeparators(path);
-    }
-    var data = _statSync(_Namespace._namespace, path);
-    if (data is OSError) return FileStat._notFound;
-    return new FileStat._internal(
-        new DateTime.fromMillisecondsSinceEpoch(data[_changedTime]),
-        new DateTime.fromMillisecondsSinceEpoch(data[_modifiedTime]),
-        new DateTime.fromMillisecondsSinceEpoch(data[_accessedTime]),
-        FileSystemEntityType._lookup(data[_type]),
-        data[_mode],
-        data[_size]);
-  }
-
-  /**
-   * Asynchronously calls the operating system's `stat()` function (or
-   * equivalent) on [path].
-   *
-   * Returns a [Future] which completes with the same results as [statSync].
-   */
-  static Future<FileStat> stat(String path) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _stat(path);
-    }
-    return overrides.stat(path);
-  }
-
-  static Future<FileStat> _stat(String path) {
-    // Trailing path is not supported on Windows.
-    if (Platform.isWindows) {
-      path = FileSystemEntity._trimTrailingPathSeparators(path);
-    }
-    return _File._dispatchWithNamespace(_IOService.fileStat, [null, path])
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        return FileStat._notFound;
-      }
-      // Unwrap the real list from the "I'm not an error" wrapper.
-      List data = response[1];
-      return new FileStat._internal(
-          new DateTime.fromMillisecondsSinceEpoch(data[_changedTime]),
-          new DateTime.fromMillisecondsSinceEpoch(data[_modifiedTime]),
-          new DateTime.fromMillisecondsSinceEpoch(data[_accessedTime]),
-          FileSystemEntityType._lookup(data[_type]),
-          data[_mode],
-          data[_size]);
-    });
-  }
-
-  String toString() => """
-FileStat: type $type
-          changed $changed
-          modified $modified
-          accessed $accessed
-          mode ${modeString()}
-          size $size""";
-
-  /**
-   * Returns the mode value as a human-readable string.
-   *
-   * The string is in the format "rwxrwxrwx", reflecting the user, group, and
-   * world permissions to read, write, and execute the file system object, with
-   * "-" replacing the letter for missing permissions.  Extra permission bits
-   * may be represented by prepending "(suid)", "(guid)", and/or "(sticky)" to
-   * the mode string.
-   */
-  String modeString() {
-    var permissions = mode & 0xFFF;
-    var codes = const ['---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx'];
-    var result = [];
-    if ((permissions & 0x800) != 0) result.add("(suid) ");
-    if ((permissions & 0x400) != 0) result.add("(guid) ");
-    if ((permissions & 0x200) != 0) result.add("(sticky) ");
-    result
-      ..add(codes[(permissions >> 6) & 0x7])
-      ..add(codes[(permissions >> 3) & 0x7])
-      ..add(codes[permissions & 0x7]);
-    return result.join();
-  }
-}
-
-/**
- * The common super class for [File], [Directory], and [Link] objects.
- *
- * [FileSystemEntity] objects are returned from directory listing
- * operations. To determine if a FileSystemEntity is a [File], a
- * [Directory], or a [Link] perform a type check:
- *
- *     if (entity is File) (entity as File).readAsStringSync();
- *
- * You can also use the [type] or [typeSync] methods to determine
- * the type of a file system object.
- *
- * Most methods in this class occur in synchronous and asynchronous pairs,
- * for example, [exists] and [existsSync].
- * Unless you have a specific reason for using the synchronous version
- * of a method, prefer the asynchronous version to avoid blocking your program.
- *
- * Here's the exists method in action:
- *
- *     entity.exists().then((isThere) {
- *       isThere ? print('exists') : print('non-existent');
- *     });
- *
- *
- * ## Other resources
- *
- * * [Dart by
- *   Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- *   provides additional task-oriented code samples that show how to use various
- *   API from the [Directory] class and the [File] class, both subclasses of
- *   FileSystemEntity.
- *
- * * [I/O for Command-Line
- *   Apps](https://www.dartlang.org/docs/dart-up-and-running/ch03.html#dartio---io-for-command-line-apps),
- *   a section from _A Tour of the Dart Libraries_ covers files and directories.
- *
- * * [Write Command-Line Apps](https://www.dartlang.org/docs/tutorials/cmdline/),
- *   a tutorial about writing command-line apps, includes information about
- *   files and directories.
- */
-abstract class FileSystemEntity {
-  String get _path;
-  Uint8List get _rawPath;
-
-  String get path;
-
-  /**
-   * Returns a [Uri] representing the file system entity's location.
-   *
-   * The returned URI's scheme is always "file" if the entity's [path] is
-   * absolute, otherwise the scheme will be empty.
-   */
-  Uri get uri => new Uri.file(path);
-
-  /**
-   * Checks whether the file system entity with this path exists. Returns
-   * a [:Future<bool>:] that completes with the result.
-   *
-   * Since FileSystemEntity is abstract, every FileSystemEntity object
-   * is actually an instance of one of the subclasses [File],
-   * [Directory], and [Link].  Calling [exists] on an instance of one
-   * of these subclasses checks whether the object exists in the file
-   * system object exists and is of the correct type (file, directory,
-   * or link).  To check whether a path points to an object on the
-   * file system, regardless of the object's type, use the [type]
-   * static method.
-   *
-   */
-  Future<bool> exists();
-
-  /**
-   * Synchronously checks whether the file system entity with this path
-   * exists.
-   *
-   * Since FileSystemEntity is abstract, every FileSystemEntity object
-   * is actually an instance of one of the subclasses [File],
-   * [Directory], and [Link].  Calling [existsSync] on an instance of
-   * one of these subclasses checks whether the object exists in the
-   * file system object exists and is of the correct type (file,
-   * directory, or link).  To check whether a path points to an object
-   * on the file system, regardless of the object's type, use the
-   * [typeSync] static method.
-   */
-  bool existsSync();
-
-  /**
-   * Renames this file system entity.
-   *
-   * Returns a `Future<FileSystemEntity>` that completes with a
-   * [FileSystemEntity] instance for the renamed file system entity.
-   *
-   * If [newPath] identifies an existing entity of the same type, that entity
-   * is replaced. If [newPath] identifies an existing entity of a different
-   * type, the operation fails and the future completes with an exception.
-   */
-  Future<FileSystemEntity> rename(String newPath);
-
-  /**
-   * Synchronously renames this file system entity.
-   *
-   * Returns a [FileSystemEntity] instance for the renamed entity.
-   *
-   * If [newPath] identifies an existing entity of the same type, that entity
-   * is replaced. If [newPath] identifies an existing entity of a different
-   * type, the operation fails and an exception is thrown.
-   */
-  FileSystemEntity renameSync(String newPath);
-
-  /**
-   * Resolves the path of a file system object relative to the
-   * current working directory.
-   *
-   * Resolves all symbolic links on the path and resolves all `..` and `.` path
-   * segments.
-   *
-   * [resolveSymbolicLinks] uses the operating system's native
-   * file system API to resolve the path, using the `realpath` function
-   * on linux and OS X, and the `GetFinalPathNameByHandle` function on
-   * Windows. If the path does not point to an existing file system object,
-   * `resolveSymbolicLinks` throws a `FileSystemException`.
-   *
-   * On Windows the `..` segments are resolved _before_ resolving the symbolic
-   * link, and on other platforms the symbolic links are _resolved to their
-   * target_ before applying a `..` that follows.
-   *
-   * To ensure the same behavior on all platforms resolve `..` segments before
-   * calling `resolveSymbolicLinks`. One way of doing this is with the `Uri`
-   * class:
-   *
-   *     var path = Uri.parse('.').resolveUri(new Uri.file(input)).toFilePath();
-   *     if (path == '') path = '.';
-   *     new File(path).resolveSymbolicLinks().then((resolved) {
-   *       print(resolved);
-   *     });
-   *
-   * since `Uri.resolve` removes `..` segments. This will result in the Windows
-   * behavior.
-   */
-  Future<String> resolveSymbolicLinks() {
-    return _File._dispatchWithNamespace(
-        _IOService.fileResolveSymbolicLinks, [null, _rawPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot resolve symbolic links", path);
-      }
-      return response;
-    });
-  }
-
-  /**
-   * Resolves the path of a file system object relative to the
-   * current working directory.
-   *
-   * Resolves all symbolic links on the path and resolves all `..` and `.` path
-   * segments.
-   *
-   * [resolveSymbolicLinksSync] uses the operating system's native
-   * file system API to resolve the path, using the `realpath` function
-   * on linux and OS X, and the `GetFinalPathNameByHandle` function on
-   * Windows. If the path does not point to an existing file system object,
-   * `resolveSymbolicLinksSync` throws a `FileSystemException`.
-   *
-   * On Windows the `..` segments are resolved _before_ resolving the symbolic
-   * link, and on other platforms the symbolic links are _resolved to their
-   * target_ before applying a `..` that follows.
-   *
-   * To ensure the same behavior on all platforms resolve `..` segments before
-   * calling `resolveSymbolicLinksSync`. One way of doing this is with the `Uri`
-   * class:
-   *
-   *     var path = Uri.parse('.').resolveUri(new Uri.file(input)).toFilePath();
-   *     if (path == '') path = '.';
-   *     var resolved = new File(path).resolveSymbolicLinksSync();
-   *     print(resolved);
-   *
-   * since `Uri.resolve` removes `..` segments. This will result in the Windows
-   * behavior.
-   */
-  String resolveSymbolicLinksSync() {
-    var result = _resolveSymbolicLinks(_Namespace._namespace, _rawPath);
-    _throwIfError(result, "Cannot resolve symbolic links", path);
-    return result;
-  }
-
-  /**
-   * Calls the operating system's stat() function on the [path] of this
-   * [FileSystemEntity].
-   *
-   * Identical to [:FileStat.stat(this.path):].
-   *
-   * Returns a [:Future<FileStat>:] object containing the data returned by
-   * stat().
-   *
-   * If the call fails, completes the future with a [FileStat] object
-   * with `.type` set to [FileSystemEntityType.notFound] and the other fields
-   * invalid.
-   */
-  Future<FileStat> stat() => FileStat.stat(path);
-
-  /**
-   * Synchronously calls the operating system's stat() function on the
-   * [path] of this [FileSystemEntity].
-   *
-   * Identical to [:FileStat.statSync(this.path):].
-   *
-   * Returns a [FileStat] object containing the data returned by stat().
-   *
-   * If the call fails, returns a [FileStat] object with `.type` set to
-   * [FileSystemEntityType.notFound] and the other fields invalid.
-   */
-  FileStat statSync() => FileStat.statSync(path);
-
-  /**
-   * Deletes this [FileSystemEntity].
-   *
-   * If the [FileSystemEntity] is a directory, and if [recursive] is false,
-   * the directory must be empty. Otherwise, if [recursive] is true, the
-   * directory and all sub-directories and files in the directories are
-   * deleted. Links are not followed when deleting recursively. Only the link
-   * is deleted, not its target.
-   *
-   * If [recursive] is true, the [FileSystemEntity] is deleted even if the type
-   * of the [FileSystemEntity] doesn't match the content of the file system.
-   * This behavior allows [delete] to be used to unconditionally delete any file
-   * system object.
-   *
-   * Returns a [:Future<FileSystemEntity>:] that completes with this
-   * [FileSystemEntity] when the deletion is done. If the [FileSystemEntity]
-   * cannot be deleted, the future completes with an exception.
-   */
-  Future<FileSystemEntity> delete({bool recursive: false}) =>
-      _delete(recursive: recursive);
-
-  /**
-   * Synchronously deletes this [FileSystemEntity].
-   *
-   * If the [FileSystemEntity] is a directory, and if [recursive] is false,
-   * the directory must be empty. Otherwise, if [recursive] is true, the
-   * directory and all sub-directories and files in the directories are
-   * deleted. Links are not followed when deleting recursively. Only the link
-   * is deleted, not its target.
-   *
-   * If [recursive] is true, the [FileSystemEntity] is deleted even if the type
-   * of the [FileSystemEntity] doesn't match the content of the file system.
-   * This behavior allows [deleteSync] to be used to unconditionally delete any
-   * file system object.
-   *
-   * Throws an exception if the [FileSystemEntity] cannot be deleted.
-   */
-  void deleteSync({bool recursive: false}) => _deleteSync(recursive: recursive);
-
-  /**
-   * Start watching the [FileSystemEntity] for changes.
-   *
-   * The implementation uses platform-dependent event-based APIs for receiving
-   * file-system notifications, thus behavior depends on the platform.
-   *
-   *   * `Windows`: Uses `ReadDirectoryChangesW`. The implementation only
-   *     supports watching directories. Recursive watching is supported.
-   *   * `Linux`: Uses `inotify`. The implementation supports watching both
-   *     files and directories. Recursive watching is not supported.
-   *     Note: When watching files directly, delete events might not happen
-   *     as expected.
-   *   * `OS X`: Uses `FSEvents`. The implementation supports watching both
-   *     files and directories. Recursive watching is supported.
-   *
-   * The system will start listening for events once the returned [Stream] is
-   * being listened to, not when the call to [watch] is issued.
-   *
-   * The returned value is an endless broadcast [Stream], that only stops when
-   * one of the following happens:
-   *
-   *   * The [Stream] is canceled, e.g. by calling `cancel` on the
-   *      [StreamSubscription].
-   *   * The [FileSystemEntity] being watched, is deleted.
-   *   * System Watcher exits unexpectedly. e.g. On `Windows` this happens when
-   *     buffer that receive events from `ReadDirectoryChangesW` overflows.
-   *
-   * Use `events` to specify what events to listen for. The constants in
-   * [FileSystemEvent] can be or'ed together to mix events. Default is
-   * [FileSystemEvent.ALL].
-   *
-   * A move event may be reported as seperate delete and create events.
-   */
-  Stream<FileSystemEvent> watch(
-      {int events: FileSystemEvent.all, bool recursive: false}) {
-    // FIXME(bkonyi): find a way to do this using the raw path.
-    final String trimmedPath = _trimTrailingPathSeparators(path);
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _FileSystemWatcher._watch(trimmedPath, events, recursive);
-    }
-    return overrides.fsWatch(trimmedPath, events, recursive);
-  }
-
-  Future<FileSystemEntity> _delete({bool recursive: false});
-  void _deleteSync({bool recursive: false});
-
-  static Future<bool> _identical(String path1, String path2) {
-    return _File._dispatchWithNamespace(
-        _IOService.fileIdentical, [null, path1, path2]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response,
-            "Error in FileSystemEntity.identical($path1, $path2)", "");
-      }
-      return response;
-    });
-  }
-
-  /**
-   * Checks whether two paths refer to the same object in the
-   * file system.
-   *
-   * Returns a [:Future<bool>:] that completes with the result.
-   *
-   * Comparing a link to its target returns false, as does comparing two links
-   * that point to the same target.  To check the target of a link, use
-   * Link.target explicitly to fetch it.  Directory links appearing
-   * inside a path are followed, though, to find the file system object.
-   *
-   * Completes the returned Future with an error if one of the paths points
-   * to an object that does not exist.
-   */
-  static Future<bool> identical(String path1, String path2) {
-    IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _identical(path1, path2);
-    }
-    return overrides.fseIdentical(path1, path2);
-  }
-
-  static final RegExp _absoluteWindowsPathPattern =
-      new RegExp(r'^(\\\\|[a-zA-Z]:[/\\])');
-
-  /**
-   * Returns a [bool] indicating whether this object's path is absolute.
-   *
-   * On Windows, a path is absolute if it starts with \\\\ or a drive letter
-   * between a and z (upper or lower case) followed by :\\ or :/.
-   * On non-Windows, a path is absolute if it starts with /.
-   */
-  bool get isAbsolute {
-    if (Platform.isWindows) {
-      return path.startsWith(_absoluteWindowsPathPattern);
-    } else {
-      return path.startsWith('/');
-    }
-  }
-
-  /**
-   * Returns a [FileSystemEntity] whose path is the absolute path to [this].
-   *
-   * The type of the returned instance is the type of [this].
-   *
-   * The absolute path is computed by prefixing
-   * a relative path with the current working directory, and returning
-   * an absolute path unchanged.
-   */
-  FileSystemEntity get absolute;
-
-  String get _absolutePath {
-    if (isAbsolute) return path;
-    String current = Directory.current.path;
-    if (current.endsWith('/') ||
-        (Platform.isWindows && current.endsWith('\\'))) {
-      return '$current$path';
-    } else {
-      return '$current${Platform.pathSeparator}$path';
-    }
-  }
-
-  Uint8List get _rawAbsolutePath {
-    if (isAbsolute) return _rawPath;
-    var current = Directory.current._rawPath.toList();
-    assert(current.last == 0);
-    current.removeLast(); // Remove null terminator.
-    if ((current.last == '/'.codeUnitAt(0)) ||
-        (Platform.isWindows && (current.last == '\\'.codeUnitAt(0)))) {
-      current.addAll(_rawPath);
-      return new Uint8List.fromList(current);
-    } else {
-      current.addAll(utf8.encode(Platform.pathSeparator));
-      current.addAll(_rawPath);
-      return new Uint8List.fromList(current);
-    }
-  }
-
-  static bool _identicalSync(String path1, String path2) {
-    var result = _identicalNative(_Namespace._namespace, path1, path2);
-    _throwIfError(result, 'Error in FileSystemEntity.identicalSync');
-    return result;
-  }
-
-  /**
-   * Synchronously checks whether two paths refer to the same object in the
-   * file system.
-   *
-   * Comparing a link to its target returns false, as does comparing two links
-   * that point to the same target.  To check the target of a link, use
-   * Link.target explicitly to fetch it.  Directory links appearing
-   * inside a path are followed, though, to find the file system object.
-   *
-   * Throws an error if one of the paths points to an object that does not
-   * exist.
-   */
-  static bool identicalSync(String path1, String path2) {
-    IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _identicalSync(path1, path2);
-    }
-    return overrides.fseIdenticalSync(path1, path2);
-  }
-
-  /**
-   * Test if [watch] is supported on the current system.
-   *
-   * OS X 10.6 and below is not supported.
-   */
-  static bool get isWatchSupported {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _FileSystemWatcher.isSupported;
-    }
-    return overrides.fsWatchIsSupported();
-  }
-
-  // The native methods which determine type of the FileSystemEntity require
-  // that the buffer provided is null terminated.
-  static Uint8List _toUtf8Array(String s) =>
-      _toNullTerminatedUtf8Array(utf8.encoder.convert(s));
-
-  static Uint8List _toNullTerminatedUtf8Array(Uint8List l) {
-    if (l.isNotEmpty && l.last != 0) {
-      final tmp = new Uint8List(l.length + 1);
-      tmp.setRange(0, l.length, l);
-      return tmp;
-    } else {
-      return l;
-    }
-  }
-
-  static String _toStringFromUtf8Array(Uint8List l) {
-    Uint8List nonNullTerminated = l;
-    if (l.last == 0) {
-      nonNullTerminated =
-          new Uint8List.view(l.buffer, l.offsetInBytes, l.length - 1);
-    }
-    return utf8.decode(nonNullTerminated, allowMalformed: true);
-  }
-
-  /**
-   * Finds the type of file system object that a path points to.
-   *
-   * Returns a [:Future<FileSystemEntityType>:] that completes with the same
-   * results as [typeSync].
-   */
-  static Future<FileSystemEntityType> type(String path,
-      {bool followLinks: true}) {
-    return _getType(_toUtf8Array(path), followLinks);
-  }
-
-  /**
-   * Synchronously finds the type of file system object that a path points to.
-   *
-   * Returns a [FileSystemEntityType].
-   *
-   * Returns [FileSystemEntityType.link] only if [followLinks] is false and if
-   * [path] points to a link.
-   *
-   * Returns [FileSystemEntityType.notFound] if [path] does not point to a file
-   * system object or if any other error occurs in looking up the path.
-   */
-  static FileSystemEntityType typeSync(String path, {bool followLinks: true}) {
-    return _getTypeSync(_toUtf8Array(path), followLinks);
-  }
-
-  /**
-   * Checks if type(path, followLinks: false) returns FileSystemEntityType.link.
-   */
-  static Future<bool> isLink(String path) => _isLinkRaw(_toUtf8Array(path));
-
-  static Future<bool> _isLinkRaw(Uint8List rawPath) => _getType(rawPath, false)
-      .then((type) => (type == FileSystemEntityType.link));
-
-  /**
-   * Checks if type(path) returns FileSystemEntityType.file.
-   */
-  static Future<bool> isFile(String path) => _getType(_toUtf8Array(path), true)
-      .then((type) => (type == FileSystemEntityType.file));
-
-  /**
-   * Checks if type(path) returns FileSystemEntityType.directory.
-   */
-  static Future<bool> isDirectory(String path) =>
-      _getType(_toUtf8Array(path), true)
-          .then((type) => (type == FileSystemEntityType.directory));
-
-  /**
-   * Synchronously checks if typeSync(path, followLinks: false) returns
-   * FileSystemEntityType.link.
-   */
-  static bool isLinkSync(String path) => _isLinkRawSync(_toUtf8Array(path));
-
-  static bool _isLinkRawSync(rawPath) =>
-      (_getTypeSync(rawPath, false) == FileSystemEntityType.link);
-
-  /**
-   * Synchronously checks if typeSync(path) returns
-   * FileSystemEntityType.file.
-   */
-  static bool isFileSync(String path) =>
-      (_getTypeSync(_toUtf8Array(path), true) == FileSystemEntityType.file);
-
-  /**
-   * Synchronously checks if typeSync(path) returns
-   * FileSystemEntityType.directory.
-   */
-  static bool isDirectorySync(String path) =>
-      (_getTypeSync(_toUtf8Array(path), true) ==
-          FileSystemEntityType.directory);
-
-  external static _getTypeNative(
-      _Namespace namespace, Uint8List rawPath, bool followLinks);
-  external static _identicalNative(
-      _Namespace namespace, String path1, String path2);
-  external static _resolveSymbolicLinks(_Namespace namespace, Uint8List path);
-
-  // Finds the next-to-last component when dividing at path separators.
-  static final RegExp _parentRegExp = Platform.isWindows
-      ? new RegExp(r'[^/\\][/\\]+[^/\\]')
-      : new RegExp(r'[^/]/+[^/]');
-
-  /**
-   * Removes the final path component of a path, using the platform's
-   * path separator to split the path.
-   *
-   * Will not remove the root component of a Windows path, like "C:\\" or
-   * "\\\\server_name\\". Ignores trailing path separators, and leaves no
-   * trailing path separators.
-   */
-  static String parentOf(String path) {
-    int rootEnd = -1;
-    if (Platform.isWindows) {
-      if (path.startsWith(_absoluteWindowsPathPattern)) {
-        // Root ends at first / or \ after the first two characters.
-        rootEnd = path.indexOf(new RegExp(r'[/\\]'), 2);
-        if (rootEnd == -1) return path;
-      } else if (path.startsWith('\\') || path.startsWith('/')) {
-        rootEnd = 0;
-      }
-    } else if (path.startsWith('/')) {
-      rootEnd = 0;
-    }
-    // Ignore trailing slashes.
-    // All non-trivial cases have separators between two non-separators.
-    int pos = path.lastIndexOf(_parentRegExp);
-    if (pos > rootEnd) {
-      return path.substring(0, pos + 1);
-    } else if (rootEnd > -1) {
-      return path.substring(0, rootEnd + 1);
-    } else {
-      return '.';
-    }
-  }
-
-  /**
-   * The directory containing [this].
-   */
-  Directory get parent => new Directory(parentOf(path));
-
-  static FileSystemEntityType _getTypeSyncHelper(
-      Uint8List rawPath, bool followLinks) {
-    var result = _getTypeNative(_Namespace._namespace, rawPath, followLinks);
-    _throwIfError(result, 'Error getting type of FileSystemEntity');
-    return FileSystemEntityType._lookup(result);
-  }
-
-  static FileSystemEntityType _getTypeSync(
-      Uint8List rawPath, bool followLinks) {
-    IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _getTypeSyncHelper(rawPath, followLinks);
-    }
-    return overrides.fseGetTypeSync(
-        utf8.decode(rawPath, allowMalformed: true), followLinks);
-  }
-
-  static Future<FileSystemEntityType> _getTypeRequest(
-      Uint8List rawPath, bool followLinks) {
-    return _File._dispatchWithNamespace(
-        _IOService.fileType, [null, rawPath, followLinks]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Error getting type",
-            utf8.decode(rawPath, allowMalformed: true));
-      }
-      return FileSystemEntityType._lookup(response);
-    });
-  }
-
-  static Future<FileSystemEntityType> _getType(
-      Uint8List rawPath, bool followLinks) {
-    IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return _getTypeRequest(rawPath, followLinks);
-    }
-    return overrides.fseGetType(
-        utf8.decode(rawPath, allowMalformed: true), followLinks);
-  }
-
-  static _throwIfError(Object result, String msg, [String? path]) {
-    if (result is OSError) {
-      throw new FileSystemException(msg, path, result);
-    } else if (result is ArgumentError) {
-      throw result;
-    }
-  }
-
-  // TODO(bkonyi): find a way to do this with raw paths.
-  static String _trimTrailingPathSeparators(String path) {
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(path, "path");
-    if (Platform.isWindows) {
-      while (path.length > 1 &&
-          (path.endsWith(Platform.pathSeparator) || path.endsWith('/'))) {
-        path = path.substring(0, path.length - 1);
-      }
-    } else {
-      while (path.length > 1 && path.endsWith(Platform.pathSeparator)) {
-        path = path.substring(0, path.length - 1);
-      }
-    }
-    return path;
-  }
-
-  // TODO(bkonyi): find a way to do this with raw paths.
-  static String _ensureTrailingPathSeparators(String path) {
-    if (path.isEmpty) path = '.';
-    if (Platform.isWindows) {
-      while (!path.endsWith(Platform.pathSeparator) && !path.endsWith('/')) {
-        path = "$path${Platform.pathSeparator}";
-      }
-    } else {
-      while (!path.endsWith(Platform.pathSeparator)) {
-        path = "$path${Platform.pathSeparator}";
-      }
-    }
-    return path;
-  }
-}
-
-/**
- * Base event class emitted by [FileSystemEntity.watch].
- */
-class FileSystemEvent {
-  /**
-   * Bitfield for [FileSystemEntity.watch], to enable [FileSystemCreateEvent]s.
-   */
-  static const int create = 1 << 0;
-  @Deprecated("Use create instead")
-  static const int CREATE = 1 << 0;
-
-  /**
-   * Bitfield for [FileSystemEntity.watch], to enable [FileSystemModifyEvent]s.
-   */
-  static const int modify = 1 << 1;
-  @Deprecated("Use modify instead")
-  static const int MODIFY = 1 << 1;
-
-  /**
-   * Bitfield for [FileSystemEntity.watch], to enable [FileSystemDeleteEvent]s.
-   */
-  static const int delete = 1 << 2;
-  @Deprecated("Use delete instead")
-  static const int DELETE = 1 << 2;
-
-  /**
-   * Bitfield for [FileSystemEntity.watch], to enable [FileSystemMoveEvent]s.
-   */
-  static const int move = 1 << 3;
-  @Deprecated("Use move instead")
-  static const int MOVE = 1 << 3;
-
-  /**
-   * Bitfield for [FileSystemEntity.watch], for enabling all of [create],
-   * [modify], [delete] and [move].
-   */
-  static const int all = create | modify | delete | move;
-  @Deprecated("Use all instead")
-  static const int ALL = create | modify | delete | move;
-
-  static const int _modifyAttributes = 1 << 4;
-  static const int _deleteSelf = 1 << 5;
-  static const int _isDir = 1 << 6;
-
-  /**
-   * The type of event. See [FileSystemEvent] for a list of events.
-   */
-  final int type;
-
-  /**
-   * The path that triggered the event.
-   *
-   * Depending on the platform and the FileSystemEntity, the path may be
-   * relative.
-   */
-  final String path;
-
-  /**
-   * Is `true` if the event target was a directory.
-   *
-   * Note that if the file has been deleted by the time the event has arrived,
-   * this will always be `false` on Windows. In particular, it will always be
-   * `false` for `delete` events.
-   */
-  final bool isDirectory;
-
-  FileSystemEvent._(this.type, this.path, this.isDirectory);
-}
-
-/**
- * File system event for newly created file system objects.
- */
-class FileSystemCreateEvent extends FileSystemEvent {
-  FileSystemCreateEvent._(path, isDirectory)
-      : super._(FileSystemEvent.create, path, isDirectory);
-
-  String toString() => "FileSystemCreateEvent('$path')";
-}
-
-/**
- * File system event for modifications of file system objects.
- */
-class FileSystemModifyEvent extends FileSystemEvent {
-  /**
-   * If the content was changed and not only the attributes, [contentChanged]
-   * is `true`.
-   */
-  final bool contentChanged;
-
-  FileSystemModifyEvent._(path, isDirectory, this.contentChanged)
-      : super._(FileSystemEvent.modify, path, isDirectory);
-
-  String toString() =>
-      "FileSystemModifyEvent('$path', contentChanged=$contentChanged)";
-}
-
-/**
- * File system event for deletion of file system objects.
- */
-class FileSystemDeleteEvent extends FileSystemEvent {
-  FileSystemDeleteEvent._(path, isDirectory)
-      : super._(FileSystemEvent.delete, path, isDirectory);
-
-  String toString() => "FileSystemDeleteEvent('$path')";
-}
-
-/**
- * File system event for moving of file system objects.
- */
-class FileSystemMoveEvent extends FileSystemEvent {
-  /**
-   * If the underlying implementation is able to identify the destination of
-   * the moved file, [destination] will be set. Otherwise, it will be `null`.
-   */
-  final String? destination;
-
-  FileSystemMoveEvent._(path, isDirectory, this.destination)
-      : super._(FileSystemEvent.move, path, isDirectory);
-
-  String toString() {
-    var buffer = new StringBuffer();
-    buffer.write("FileSystemMoveEvent('$path'");
-    if (destination != null) buffer.write(", '$destination'");
-    buffer.write(')');
-    return buffer.toString();
-  }
-}
-
-abstract class _FileSystemWatcher {
-  external static Stream<FileSystemEvent> _watch(
-      String path, int events, bool recursive);
-  external static bool get isSupported;
-}
diff --git a/sdk_nnbd/lib/io/io.dart b/sdk_nnbd/lib/io/io.dart
deleted file mode 100644
index 27cd6a3..0000000
--- a/sdk_nnbd/lib/io/io.dart
+++ /dev/null
@@ -1,229 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/**
- * File, socket, HTTP, and other I/O support for non-web applications.
- *
- * **Important:** Browser-based applications can't use this library.
- * Only servers, command-line scripts, and Flutter mobile apps can import
- * and use dart:io.
- *
- * This library allows you to work with files, directories,
- * sockets, processes, HTTP servers and clients, and more.
- * Many operations related to input and output are asynchronous
- * and are handled using [Future]s or [Stream]s, both of which
- * are defined in the [dart:async
- * library](../dart-async/dart-async-library.html).
- *
- * To use the dart:io library in your code:
- *
- *     import 'dart:io';
- *
- * For an introduction to I/O in Dart, see the [dart:io library
- * tour](https://www.dartlang.org/dart-vm/io-library-tour).
- *
- * ## File, Directory, and Link
- *
- * An instance of [File], [Directory], or [Link] represents a file,
- * directory, or link, respectively, in the native file system.
- *
- * You can manipulate the file system through objects of these types.
- * For example, you can rename a file or directory:
- *
- *     File myFile = new File('myFile.txt');
- *     myFile.rename('yourFile.txt').then((_) => print('file renamed'));
- *
- * Many methods provided by the File, Directory, and Link classes
- * run asynchronously and return a Future.
- *
- * ## FileSystemEntity
- *
- * File, Directory, and Link all extend [FileSystemEntity].
- * In addition to being the superclass for these classes,
- * FileSystemEntity has a number of static methods for working with paths.
- *
- * To get information about a path,
- * you can use the FileSystemEntity static methods
- * such as 'isDirectory', 'isFile', and 'exists'.
- * Because file system access involves I/O, these methods
- * are asynchronous and return a Future.
- *
- *     FileSystemEntity.isDirectory(myPath).then((isDir) {
- *       if (isDir) {
- *         print('$myPath is a directory');
- *       } else {
- *         print('$myPath is not a directory');
- *       }
- *     });
- *
- * ## HttpServer and HttpClient
- *
- * The classes [HttpServer] and [HttpClient]
- * provide HTTP server and HTTP client functionality.
- *
- * The [HttpServer] class provides the basic functionality for
- * implementing an HTTP server.
- * For some higher-level building-blocks, we recommend that you try
- * the [shelf](https://pub.dev/packages/shelf)
- * pub package, which contains
- * a set of high-level classes that, together with the [HttpServer] class
- * in this library, make it easier to implement HTTP servers.
- *
- * ## Process
- *
- * The [Process] class provides a way to run a process on
- * the native machine.
- * For example, the following code spawns a process that recursively lists
- * the files under `web`.
- *
- *     Process.start('ls', ['-R', 'web']).then((process) {
- *       stdout.addStream(process.stdout);
- *       stderr.addStream(process.stderr);
- *       process.exitCode.then(print);
- *     });
- *
- * Using `start()` returns a Future, which completes with a [Process] object
- * when the process has started. This [Process] object allows you to interact
- * with the process while it is running. Using `run()` returns a Future, which
- * completes with a [ProcessResult] object when the spawned process has
- * terminated. This [ProcessResult] object collects the output and exit code
- * from the process.
- *
- * When using `start()`,
- * you need to read all data coming on the stdout and stderr streams otherwise
- * the system resources will not be freed.
- *
- * ## WebSocket
- *
- * The [WebSocket] class provides support for the web socket protocol. This
- * allows full-duplex communications between client and server applications.
- *
- * A web socket server uses a normal HTTP server for accepting web socket
- * connections. The initial handshake is a HTTP request which is then upgraded to a
- * web socket connection.
- * The server upgrades the request using [WebSocketTransformer]
- * and listens for the data on the returned web socket.
- * For example, here's a mini server that listens for 'ws' data
- * on a WebSocket:
- *
- *     runZoned(() async {
- *       var server = await HttpServer.bind('127.0.0.1', 4040);
- *       server.listen((HttpRequest req) async {
- *         if (req.uri.path == '/ws') {
- *           var socket = await WebSocketTransformer.upgrade(req);
- *           socket.listen(handleMsg);
- *         }
- *       });
- *     }, onError: (e) => print("An error occurred."));
- *
- * The client connects to the WebSocket using the `connect()` method
- * and a URI that uses the Web Socket protocol.
- * The client can write to the WebSocket with the `add()` method.
- * For example,
- *
- *     var socket = await WebSocket.connect('ws://127.0.0.1:4040/ws');
- *     socket.add('Hello, World!');
- *
- * Check out the
- * [websocket_sample](https://github.com/dart-lang/dart-samples/tree/master/html5/web/websockets/basics)
- * app, which uses WebSockets to communicate with a server.
- *
- * ## Socket and ServerSocket
- *
- * Clients and servers use [Socket]s to communicate using the TCP protocol.
- * Use [ServerSocket] on the server side and [Socket] on the client.
- * The server creates a listening socket using the `bind()` method and
- * then listens for incoming connections on the socket. For example:
- *
- *     ServerSocket.bind('127.0.0.1', 4041)
- *       .then((serverSocket) {
- *         serverSocket.listen((socket) {
- *           socket.transform(utf8.decoder).listen(print);
- *         });
- *       });
- *
- * A client connects a Socket using the `connect()` method,
- * which returns a Future.
- * Using `write()`, `writeln()`, or `writeAll()` are the easiest ways to
- * send data over the socket.
- * For example:
- *
- *     Socket.connect('127.0.0.1', 4041).then((socket) {
- *       socket.write('Hello, World!');
- *     });
- *
- * Besides [Socket] and [ServerSocket], the [RawSocket] and
- * [RawServerSocket] classes are available for lower-level access
- * to async socket IO.
- *
- * ## Standard output, error, and input streams
- *
- * This library provides the standard output, error, and input
- * streams, named 'stdout', 'stderr', and 'stdin', respectively.
- *
- * The stdout and stderr streams are both [IOSink]s and have the same set
- * of methods and properties.
- *
- * To write a string to 'stdout':
- *
- *     stdout.writeln('Hello, World!');
- *
- * To write a list of objects to 'stderr':
- *
- *     stderr.writeAll([ 'That ', 'is ', 'an ', 'error.', '\n']);
- *
- * The standard input stream is a true [Stream], so it inherits
- * properties and methods from the Stream class.
- *
- * To read text synchronously from the command line
- * (the program blocks waiting for user to type information):
- *
- *      String inputText = stdin.readLineSync();
- *
- * {@category VM}
- */
-library dart.io;
-
-import 'dart:async';
-import 'dart:_internal' hide Symbol;
-import 'dart:collection'
-    show HashMap, HashSet, Queue, ListQueue, MapBase, UnmodifiableMapView;
-import 'dart:convert';
-import 'dart:developer' hide log;
-import 'dart:_http' show HttpClient;
-import 'dart:isolate';
-import 'dart:math';
-import 'dart:typed_data';
-
-export 'dart:_http';
-export 'dart:_internal' show HttpStatus;
-
-part 'bytes_builder.dart';
-part 'common.dart';
-part 'data_transformer.dart';
-part 'directory.dart';
-part 'directory_impl.dart';
-part 'embedder_config.dart';
-part 'eventhandler.dart';
-part 'file.dart';
-part 'file_impl.dart';
-part 'file_system_entity.dart';
-part 'io_resource_info.dart';
-part 'io_sink.dart';
-part 'io_service.dart';
-part 'link.dart';
-part 'namespace_impl.dart';
-part 'network_profiling.dart';
-part 'overrides.dart';
-part 'platform.dart';
-part 'platform_impl.dart';
-part 'process.dart';
-part 'secure_server_socket.dart';
-part 'secure_socket.dart';
-part 'security_context.dart';
-part 'service_object.dart';
-part 'socket.dart';
-part 'stdio.dart';
-part 'string_transformer.dart';
-part 'sync_socket.dart';
diff --git a/sdk_nnbd/lib/io/io_resource_info.dart b/sdk_nnbd/lib/io/io_resource_info.dart
deleted file mode 100644
index b916dd8..0000000
--- a/sdk_nnbd/lib/io/io_resource_info.dart
+++ /dev/null
@@ -1,280 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart.io;
-
-abstract class _IOResourceInfo {
-  final String type;
-  final int id;
-  String get name;
-  static int _count = 0;
-
-  static final Stopwatch _sw = new Stopwatch()..start();
-  static final _startTime = new DateTime.now().millisecondsSinceEpoch;
-
-  static double get timestamp => _startTime + _sw.elapsedMicroseconds / 1000;
-
-  _IOResourceInfo(this.type) : id = _IOResourceInfo.getNextID();
-
-  /// Get the full set of values for a specific implementation. This is normally
-  /// looked up based on an id from a referenceValueMap.
-  Map<String, dynamic> get fullValueMap;
-
-  /// The reference map, used to return a list of values, e.g., getting
-  /// all open sockets. The structure of this is shared among all subclasses.
-  Map<String, dynamic> get referenceValueMap => {
-        // The type for a reference object is prefixed with @ in observatory.
-        'type': '@$type',
-        'id': id,
-        'name': name,
-      };
-
-  static int getNextID() => _count++;
-}
-
-abstract class _ReadWriteResourceInfo extends _IOResourceInfo {
-  int totalRead;
-  int totalWritten;
-  int readCount;
-  int writeCount;
-  double lastRead;
-  double lastWrite;
-
-  // Not all call sites use this. In some cases, e.g., a socket, a read does
-  // not always mean that we actually read some bytes (we may do a read to see
-  // if there are some bytes available).
-  void addRead(int bytes) {
-    totalRead += bytes;
-    readCount++;
-    lastRead = _IOResourceInfo.timestamp;
-  }
-
-  // In cases where we read but did not necessarily get any bytes, use this to
-  // update the readCount and timestamp. Manually update totalRead if any bytes
-  // where actually read.
-  void didRead() {
-    addRead(0);
-  }
-
-  void addWrite(int bytes) {
-    totalWritten += bytes;
-    writeCount++;
-    lastWrite = _IOResourceInfo.timestamp;
-  }
-
-  _ReadWriteResourceInfo(String type)
-      : totalRead = 0,
-        totalWritten = 0,
-        readCount = 0,
-        writeCount = 0,
-        lastRead = 0.0,
-        lastWrite = 0.0,
-        super(type);
-
-  Map<String, dynamic> get fullValueMap => {
-        'type': type,
-        'id': id,
-        'name': name,
-        'totalRead': totalRead,
-        'totalWritten': totalWritten,
-        'readCount': readCount,
-        'writeCount': writeCount,
-        'lastRead': lastRead,
-        'lastWrite': lastWrite
-      };
-}
-
-class _FileResourceInfo extends _ReadWriteResourceInfo {
-  static const String _type = '_file';
-
-  final file;
-
-  static Map<int, _FileResourceInfo> openFiles =
-      new Map<int, _FileResourceInfo>();
-
-  _FileResourceInfo(this.file) : super(_type) {
-    FileOpened(this);
-  }
-
-  static FileOpened(_FileResourceInfo info) {
-    assert(!openFiles.containsKey(info.id));
-    openFiles[info.id] = info;
-  }
-
-  static FileClosed(_FileResourceInfo info) {
-    assert(openFiles.containsKey(info.id));
-    openFiles.remove(info.id);
-  }
-
-  static Iterable<Map<String, dynamic>> getOpenFilesList() {
-    return new List.from(openFiles.values.map((e) => e.referenceValueMap));
-  }
-
-  static Future<ServiceExtensionResponse> getOpenFiles(function, params) {
-    assert(function == 'ext.dart.io.getOpenFiles');
-    var data = {'type': '_openfiles', 'data': getOpenFilesList()};
-    var jsonValue = json.encode(data);
-    return new Future.value(new ServiceExtensionResponse.result(jsonValue));
-  }
-
-  Map<String, dynamic> getFileInfoMap() {
-    return fullValueMap;
-  }
-
-  static Future<ServiceExtensionResponse> getFileInfoMapByID(function, params) {
-    var id = int.parse(params['id']!);
-    var result =
-        openFiles.containsKey(id) ? openFiles[id]!.getFileInfoMap() : {};
-    var jsonValue = json.encode(result);
-    return new Future.value(new ServiceExtensionResponse.result(jsonValue));
-  }
-
-  String get name {
-    return '${file.path}';
-  }
-}
-
-class _ProcessResourceInfo extends _IOResourceInfo {
-  static const String _type = '_process';
-  final process;
-  final double startedAt;
-
-  static Map<int, _ProcessResourceInfo> startedProcesses =
-      new Map<int, _ProcessResourceInfo>();
-
-  _ProcessResourceInfo(this.process)
-      : startedAt = _IOResourceInfo.timestamp,
-        super(_type) {
-    ProcessStarted(this);
-  }
-
-  String get name => process._path;
-
-  void stopped() {
-    ProcessStopped(this);
-  }
-
-  Map<String, dynamic> get fullValueMap => {
-        'type': type,
-        'id': id,
-        'name': name,
-        'pid': process.pid,
-        'startedAt': startedAt,
-        'arguments': process._arguments,
-        'workingDirectory':
-            process._workingDirectory == null ? '.' : process._workingDirectory,
-      };
-
-  static ProcessStarted(_ProcessResourceInfo info) {
-    assert(!startedProcesses.containsKey(info.id));
-    startedProcesses[info.id] = info;
-  }
-
-  static ProcessStopped(_ProcessResourceInfo info) {
-    assert(startedProcesses.containsKey(info.id));
-    startedProcesses.remove(info.id);
-  }
-
-  static Iterable<Map<String, dynamic>> getStartedProcessesList() =>
-      new List.from(startedProcesses.values.map((e) => e.referenceValueMap));
-
-  static Future<ServiceExtensionResponse> getStartedProcesses(
-      String function, Map<String, String> params) {
-    assert(function == 'ext.dart.io.getProcesses');
-    var data = {'type': '_startedprocesses', 'data': getStartedProcessesList()};
-    var jsonValue = json.encode(data);
-    return new Future.value(new ServiceExtensionResponse.result(jsonValue));
-  }
-
-  static Future<ServiceExtensionResponse> getProcessInfoMapById(
-      String function, Map<String, String> params) {
-    var id = int.parse(params['id']!);
-    var result = startedProcesses.containsKey(id)
-        ? startedProcesses[id]!.fullValueMap
-        : {};
-    var jsonValue = json.encode(result);
-    return new Future.value(new ServiceExtensionResponse.result(jsonValue));
-  }
-}
-
-class _SocketResourceInfo extends _ReadWriteResourceInfo {
-  static const String _tcpString = 'TCP';
-  static const String _udpString = 'UDP';
-  static const String _type = '_socket';
-
-  final /*_NativeSocket|*/ socket;
-
-  static Map<int, _SocketResourceInfo> openSockets =
-      new Map<int, _SocketResourceInfo>();
-
-  _SocketResourceInfo(this.socket) : super(_type) {
-    SocketOpened(this);
-  }
-
-  String get name {
-    if (socket.isListening) {
-      return 'listening:${socket.address.host}:${socket.port}';
-    }
-    var remote = '';
-    try {
-      var remoteHost = socket.remoteAddress.host;
-      var remotePort = socket.remotePort;
-      remote = ' -> $remoteHost:$remotePort';
-    } catch (e) {} // ignored if we can't get the information
-    return '${socket.address.host}:${socket.port}$remote';
-  }
-
-  static Iterable<Map<String, dynamic>> getOpenSocketsList() {
-    return new List.from(openSockets.values.map((e) => e.referenceValueMap));
-  }
-
-  Map<String, dynamic> getSocketInfoMap() {
-    var result = fullValueMap;
-    result['socketType'] = socket.isTcp ? _tcpString : _udpString;
-    result['listening'] = socket.isListening;
-    result['host'] = socket.address.host;
-    result['port'] = socket.port;
-    if (!socket.isListening) {
-      try {
-        result['remoteHost'] = socket.remoteAddress.host;
-        result['remotePort'] = socket.remotePort;
-      } catch (e) {
-        // UDP.
-        result['remotePort'] = 'NA';
-        result['remoteHost'] = 'NA';
-      }
-    } else {
-      result['remotePort'] = 'NA';
-      result['remoteHost'] = 'NA';
-    }
-    result['addressType'] = socket.address.type.name;
-    return result;
-  }
-
-  static Future<ServiceExtensionResponse> getSocketInfoMapByID(
-      String function, Map<String, String> params) {
-    var id = int.parse(params['id']!);
-    var result =
-        openSockets.containsKey(id) ? openSockets[id]!.getSocketInfoMap() : {};
-    var jsonValue = json.encode(result);
-    return new Future.value(new ServiceExtensionResponse.result(jsonValue));
-  }
-
-  static Future<ServiceExtensionResponse> getOpenSockets(function, params) {
-    assert(function == 'ext.dart.io.getOpenSockets');
-    var data = {'type': '_opensockets', 'data': getOpenSocketsList()};
-    var jsonValue = json.encode(data);
-    return new Future.value(new ServiceExtensionResponse.result(jsonValue));
-  }
-
-  static SocketOpened(_SocketResourceInfo info) {
-    assert(!openSockets.containsKey(info.id));
-    openSockets[info.id] = info;
-  }
-
-  static SocketClosed(_SocketResourceInfo info) {
-    assert(openSockets.containsKey(info.id));
-    openSockets.remove(info.id);
-  }
-}
diff --git a/sdk_nnbd/lib/io/io_service.dart b/sdk_nnbd/lib/io/io_service.dart
deleted file mode 100644
index 7af382c..0000000
--- a/sdk_nnbd/lib/io/io_service.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-class _IOService {
-  // This list must be kept in sync with the list in runtime/bin/io_service.h
-  static const int fileExists = 0;
-  static const int fileCreate = 1;
-  static const int fileDelete = 2;
-  static const int fileRename = 3;
-  static const int fileCopy = 4;
-  static const int fileOpen = 5;
-  static const int fileResolveSymbolicLinks = 6;
-  static const int fileClose = 7;
-  static const int filePosition = 8;
-  static const int fileSetPosition = 9;
-  static const int fileTruncate = 10;
-  static const int fileLength = 11;
-  static const int fileLengthFromPath = 12;
-  static const int fileLastAccessed = 13;
-  static const int fileSetLastAccessed = 14;
-  static const int fileLastModified = 15;
-  static const int fileSetLastModified = 16;
-  static const int fileFlush = 17;
-  static const int fileReadByte = 18;
-  static const int fileWriteByte = 19;
-  static const int fileRead = 20;
-  static const int fileReadInto = 21;
-  static const int fileWriteFrom = 22;
-  static const int fileCreateLink = 23;
-  static const int fileDeleteLink = 24;
-  static const int fileRenameLink = 25;
-  static const int fileLinkTarget = 26;
-  static const int fileType = 27;
-  static const int fileIdentical = 28;
-  static const int fileStat = 29;
-  static const int fileLock = 30;
-  static const int socketLookup = 31;
-  static const int socketListInterfaces = 32;
-  static const int socketReverseLookup = 33;
-  static const int directoryCreate = 34;
-  static const int directoryDelete = 35;
-  static const int directoryExists = 36;
-  static const int directoryCreateTemp = 37;
-  static const int directoryListStart = 38;
-  static const int directoryListNext = 39;
-  static const int directoryListStop = 40;
-  static const int directoryRename = 41;
-  static const int sslProcessFilter = 42;
-
-  external static Future _dispatch(int request, List data);
-}
diff --git a/sdk_nnbd/lib/io/io_sink.dart b/sdk_nnbd/lib/io/io_sink.dart
deleted file mode 100644
index 622656a..0000000
--- a/sdk_nnbd/lib/io/io_sink.dart
+++ /dev/null
@@ -1,316 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * A combined byte and text output.
- *
- * An [IOSink] combines a [StreamSink] of bytes with a [StringSink],
- * and allows easy output of both bytes and text.
- *
- * Writing text ([write]) and adding bytes ([add]) may be interleaved freely.
- *
- * While a stream is being added using [addStream], any further attempts
- * to add or write to the [IOSink] will fail until the [addStream] completes.
- *
- * It is an error to add data to the [IOSink] after the sink is closed.
- */
-abstract class IOSink implements StreamSink<List<int>>, StringSink {
-  /**
-   * Create an [IOSink] that outputs to a [target] [StreamConsumer] of bytes.
-   *
-   * Text written to [StreamSink] methods is encoded to bytes using [encoding]
-   * before being output on [target].
-   */
-  factory IOSink(StreamConsumer<List<int>> target, {Encoding encoding: utf8}) =>
-      new _IOSinkImpl(target, encoding);
-
-  /**
-   * The [Encoding] used when writing strings. Depending on the
-   * underlying consumer this property might be mutable.
-   */
-  late Encoding encoding;
-
-  /**
-   * Adds byte [data] to the target consumer, ignoring [encoding].
-   *
-   * The [encoding] does not apply to this method, and the `data` list is passed
-   * directly to the target consumer as a stream event.
-   *
-   * This function must not be called when a stream is currently being added
-   * using [addStream].
-   *
-   * This operation is non-blocking. See [flush] or [done] for how to get any
-   * errors generated by this call.
-   *
-   * The data list should not be modified after it has been passed to `add`.
-   */
-  void add(List<int> data);
-
-  /**
-   * Converts [obj] to a String by invoking [Object.toString] and
-   * [add]s the encoding of the result to the target consumer.
-   *
-   * This operation is non-blocking. See [flush] or [done] for how to get any
-   * errors generated by this call.
-   */
-  void write(Object? obj);
-
-  /**
-   * Iterates over the given [objects] and [write]s them in sequence.
-   *
-   * If [separator] is provided, a `write` with the `separator` is performed
-   * between any two elements of objects.
-   *
-   * This operation is non-blocking. See [flush] or [done] for how to get any
-   * errors generated by this call.
-   */
-  void writeAll(Iterable objects, [String separator = ""]);
-
-  /**
-   * Converts [obj] to a String by invoking [Object.toString] and
-   * writes the result to `this`, followed by a newline.
-   *
-   * This operation is non-blocking. See [flush] or [done] for how to get any
-   * errors generated by this call.
-   */
-  void writeln([Object? obj = ""]);
-
-  /**
-   * Writes the character of [charCode].
-   *
-   * This method is equivalent to `write(new String.fromCharCode(charCode))`.
-   *
-   * This operation is non-blocking. See [flush] or [done] for how to get any
-   * errors generated by this call.
-   */
-  void writeCharCode(int charCode);
-
-  /**
-   * Passes the error to the target consumer as an error event.
-   *
-   * This function must not be called when a stream is currently being added
-   * using [addStream].
-   *
-   * This operation is non-blocking. See [flush] or [done] for how to get any
-   * errors generated by this call.
-   */
-  void addError(error, [StackTrace? stackTrace]);
-
-  /**
-   * Adds all elements of the given [stream] to `this`.
-   *
-   * Returns a [Future] that completes when
-   * all elements of the given [stream] are added to `this`.
-   *
-   * This function must not be called when a stream is currently being added
-   * using this function.
-   */
-  Future addStream(Stream<List<int>> stream);
-
-  /**
-   * Returns a [Future] that completes once all buffered data is accepted by the
-   * underlying [StreamConsumer].
-   *
-   * This method must not be called while an [addStream] is incomplete.
-   *
-   * NOTE: This is not necessarily the same as the data being flushed by the
-   * operating system.
-   */
-  Future flush();
-
-  /**
-   * Close the target consumer.
-   *
-   * NOTE: Writes to the [IOSink] may be buffered, and may not be flushed by
-   * a call to `close()`. To flush all buffered writes, call `flush()` before
-   * calling `close()`.
-   */
-  Future close();
-
-  /**
-   * Get a future that will complete when the consumer closes, or when an
-   * error occurs. This future is identical to the future returned by
-   * [close].
-   */
-  Future get done;
-}
-
-class _StreamSinkImpl<T> implements StreamSink<T> {
-  final StreamConsumer<T> _target;
-  final Completer _doneCompleter = new Completer();
-  StreamController<T>? _controllerInstance;
-  Completer? _controllerCompleter;
-  bool _isClosed = false;
-  bool _isBound = false;
-  bool _hasError = false;
-
-  _StreamSinkImpl(this._target);
-
-  void add(T data) {
-    if (_isClosed) {
-      throw StateError("StreamSink is closed");
-    }
-    _controller.add(data);
-  }
-
-  void addError(error, [StackTrace? stackTrace]) {
-    if (_isClosed) {
-      throw StateError("StreamSink is closed");
-    }
-    _controller.addError(error, stackTrace);
-  }
-
-  Future addStream(Stream<T> stream) {
-    if (_isBound) {
-      throw new StateError("StreamSink is already bound to a stream");
-    }
-    if (_hasError) return done;
-
-    _isBound = true;
-    var future = _controllerCompleter == null
-        ? _target.addStream(stream)
-        : _controllerCompleter!.future.then((_) => _target.addStream(stream));
-    _controllerInstance?.close();
-
-    // Wait for any pending events in [_controller] to be dispatched before
-    // adding [stream].
-    return future.whenComplete(() {
-      _isBound = false;
-    });
-  }
-
-  Future flush() {
-    if (_isBound) {
-      throw new StateError("StreamSink is bound to a stream");
-    }
-    if (_controllerInstance == null) return new Future.value(this);
-    // Adding an empty stream-controller will return a future that will complete
-    // when all data is done.
-    _isBound = true;
-    var future = _controllerCompleter!.future;
-    _controllerInstance!.close();
-    return future.whenComplete(() {
-      _isBound = false;
-    });
-  }
-
-  Future close() {
-    if (_isBound) {
-      throw new StateError("StreamSink is bound to a stream");
-    }
-    if (!_isClosed) {
-      _isClosed = true;
-      if (_controllerInstance != null) {
-        _controllerInstance!.close();
-      } else {
-        _closeTarget();
-      }
-    }
-    return done;
-  }
-
-  void _closeTarget() {
-    _target.close().then(_completeDoneValue, onError: _completeDoneError);
-  }
-
-  Future get done => _doneCompleter.future;
-
-  void _completeDoneValue(value) {
-    if (!_doneCompleter.isCompleted) {
-      _doneCompleter.complete(value);
-    }
-  }
-
-  void _completeDoneError(error, StackTrace? stackTrace) {
-    if (!_doneCompleter.isCompleted) {
-      _hasError = true;
-      _doneCompleter.completeError(error, stackTrace);
-    }
-  }
-
-  StreamController<T> get _controller {
-    if (_isBound) {
-      throw new StateError("StreamSink is bound to a stream");
-    }
-    if (_isClosed) {
-      throw new StateError("StreamSink is closed");
-    }
-    if (_controllerInstance == null) {
-      _controllerInstance = new StreamController<T>(sync: true);
-      _controllerCompleter = new Completer();
-      _target.addStream(_controller.stream).then((_) {
-        if (_isBound) {
-          // A new stream takes over - forward values to that stream.
-          _controllerCompleter!.complete(this);
-          _controllerCompleter = null;
-          _controllerInstance = null;
-        } else {
-          // No new stream, .close was called. Close _target.
-          _closeTarget();
-        }
-      }, onError: (error, stackTrace) {
-        if (_isBound) {
-          // A new stream takes over - forward errors to that stream.
-          _controllerCompleter!.completeError(error, stackTrace);
-          _controllerCompleter = null;
-          _controllerInstance = null;
-        } else {
-          // No new stream. No need to close target, as it has already
-          // failed.
-          _completeDoneError(error, stackTrace);
-        }
-      });
-    }
-    return _controllerInstance!;
-  }
-}
-
-class _IOSinkImpl extends _StreamSinkImpl<List<int>> implements IOSink {
-  Encoding _encoding;
-  bool _encodingMutable = true;
-
-  _IOSinkImpl(StreamConsumer<List<int>> target, this._encoding) : super(target);
-
-  Encoding get encoding => _encoding;
-
-  void set encoding(Encoding value) {
-    if (!_encodingMutable) {
-      throw new StateError("IOSink encoding is not mutable");
-    }
-    _encoding = value;
-  }
-
-  void write(Object? obj) {
-    String string = '$obj';
-    if (string.isEmpty) return;
-    add(_encoding.encode(string));
-  }
-
-  void writeAll(Iterable objects, [String separator = ""]) {
-    Iterator iterator = objects.iterator;
-    if (!iterator.moveNext()) return;
-    if (separator.isEmpty) {
-      do {
-        write(iterator.current);
-      } while (iterator.moveNext());
-    } else {
-      write(iterator.current);
-      while (iterator.moveNext()) {
-        write(separator);
-        write(iterator.current);
-      }
-    }
-  }
-
-  void writeln([Object? object = ""]) {
-    write(object);
-    write("\n");
-  }
-
-  void writeCharCode(int charCode) {
-    write(new String.fromCharCode(charCode));
-  }
-}
diff --git a/sdk_nnbd/lib/io/io_sources.gni b/sdk_nnbd/lib/io/io_sources.gni
deleted file mode 100644
index 59b2ca9..0000000
--- a/sdk_nnbd/lib/io/io_sources.gni
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2017, 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.
-
-io_sdk_sources = [
-  "io.dart",
-
-  # The above file needs to be first if additional parts are added to the lib.
-  "bytes_builder.dart",
-  "common.dart",
-  "data_transformer.dart",
-  "directory.dart",
-  "directory_impl.dart",
-  "embedder_config.dart",
-  "eventhandler.dart",
-  "file.dart",
-  "file_impl.dart",
-  "file_system_entity.dart",
-  "io_resource_info.dart",
-  "io_service.dart",
-  "io_sink.dart",
-  "link.dart",
-  "namespace_impl.dart",
-  "network_profiling.dart",
-  "overrides.dart",
-  "platform.dart",
-  "platform_impl.dart",
-  "process.dart",
-  "secure_server_socket.dart",
-  "secure_socket.dart",
-  "security_context.dart",
-  "service_object.dart",
-  "socket.dart",
-  "stdio.dart",
-  "string_transformer.dart",
-  "sync_socket.dart",
-]
diff --git a/sdk_nnbd/lib/io/link.dart b/sdk_nnbd/lib/io/link.dart
deleted file mode 100644
index 3f2896f..0000000
--- a/sdk_nnbd/lib/io/link.dart
+++ /dev/null
@@ -1,297 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * [Link] objects are references to filesystem links.
- *
- */
-@pragma("vm:entry-point")
-abstract class Link implements FileSystemEntity {
-  /**
-   * Creates a Link object.
-   */
-  @pragma("vm:entry-point")
-  factory Link(String path) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return new _Link(path);
-    }
-    return overrides.createLink(path);
-  }
-
-  @pragma("vm:entry-point")
-  factory Link.fromRawPath(Uint8List rawPath) {
-    // TODO(bkonyi): handle overrides
-    return new _Link.fromRawPath(rawPath);
-  }
-
-  /**
-   * Creates a [Link] object.
-   *
-   * If [path] is a relative path, it will be interpreted relative to the
-   * current working directory (see [Directory.current]), when used.
-   *
-   * If [path] is an absolute path, it will be immune to changes to the
-   * current working directory.
-   */
-  factory Link.fromUri(Uri uri) => new Link(uri.toFilePath());
-
-  /**
-   * Creates a symbolic link. Returns a [:Future<Link>:] that completes with
-   * the link when it has been created. If the link exists,
-   * the future will complete with an error.
-   *
-   * If [recursive] is false, the default, the link is created
-   * only if all directories in its path exist.
-   * If [recursive] is true, all non-existing path
-   * components are created. The directories in the path of [target] are
-   * not affected, unless they are also in [path].
-   *
-   * On the Windows platform, this call will create a true symbolic link
-   * instead of a Junction. In order to create a symbolic link on Windows, Dart
-   * must be run in Administrator mode or the system must have Developer Mode
-   * enabled, otherwise a [FileSystemException] will be raised with 
-   * `ERROR_PRIVILEGE_NOT_HELD` set as the errno when this call is made.
-   *
-   * On other platforms, the posix symlink() call is used to make a symbolic
-   * link containing the string [target].  If [target] is a relative path,
-   * it will be interpreted relative to the directory containing the link.
-   */
-  Future<Link> create(String target, {bool recursive: false});
-
-  /**
-   * Synchronously create the link. Calling [createSync] on an existing link
-   * will throw an exception.
-   *
-   * If [recursive] is false, the default, the link is created only if all
-   * directories in its path exist. If [recursive] is true, all
-   * non-existing path components are created. The directories in
-   * the path of [target] are not affected, unless they are also in [path].
-   *
-   * On the Windows platform, this call will create a true symbolic link
-   * instead of a Junction. In order to create a symbolic link on Windows, Dart
-   * must be run in Administrator mode or the system must have Developer Mode
-   * enabled, otherwise a [FileSystemException] will be raised with 
-   * `ERROR_PRIVILEGE_NOT_HELD` set as the errno when this call is made.
-   *
-   * On other platforms, the posix symlink() call is used to make a symbolic
-   * link containing the string [target].  If [target] is a relative path,
-   * it will be interpreted relative to the directory containing the link.
-   */
-  void createSync(String target, {bool recursive: false});
-
-  /**
-   * Synchronously updates the link. Calling [updateSync] on a non-existing link
-   * will throw an exception.
-   */
-  void updateSync(String target);
-
-  /**
-   * Updates the link. Returns a [:Future<Link>:] that completes with the
-   * link when it has been updated.  Calling [update] on a non-existing link
-   * will complete its returned future with an exception.
-   */
-  Future<Link> update(String target);
-
-  Future<String> resolveSymbolicLinks();
-
-  String resolveSymbolicLinksSync();
-
-  /**
-   * Renames this link. Returns a `Future<Link>` that completes
-   * with a [Link] instance for the renamed link.
-   *
-   * If [newPath] identifies an existing link, that link is
-   * replaced. If [newPath] identifies an existing file or directory,
-   * the operation fails and the future completes with an exception.
-   */
-  Future<Link> rename(String newPath);
-
-  /**
-   * Synchronously renames this link. Returns a [Link]
-   * instance for the renamed link.
-   *
-   * If [newPath] identifies an existing link, that link is
-   * replaced. If [newPath] identifies an existing file or directory
-   * the operation fails and an exception is thrown.
-   */
-  Link renameSync(String newPath);
-
-  /**
-   * Returns a [Link] instance whose path is the absolute path to [this].
-   *
-   * The absolute path is computed by prefixing
-   * a relative path with the current working directory, and returning
-   * an absolute path unchanged.
-   */
-  Link get absolute;
-
-  /**
-   * Gets the target of the link. Returns a future that completes with
-   * the path to the target.
-   *
-   * If the returned target is a relative path, it is relative to the
-   * directory containing the link.
-   *
-   * If the link does not exist, or is not a link, the future completes with
-   * a FileSystemException.
-   */
-  Future<String> target();
-
-  /**
-   * Synchronously gets the target of the link. Returns the path to the target.
-   *
-   * If the returned target is a relative path, it is relative to the
-   * directory containing the link.
-   *
-   * If the link does not exist, or is not a link, throws a FileSystemException.
-   */
-  String targetSync();
-}
-
-class _Link extends FileSystemEntity implements Link {
-  final String _path;
-  final Uint8List _rawPath;
-
-  _Link(String path)
-      : _path = path,
-        _rawPath = FileSystemEntity._toUtf8Array(path);
-
-  _Link.fromRawPath(Uint8List rawPath)
-      : _rawPath = FileSystemEntity._toNullTerminatedUtf8Array(rawPath),
-        _path = FileSystemEntity._toStringFromUtf8Array(rawPath);
-
-  String get path => _path;
-
-  String toString() => "Link: '$path'";
-
-  Future<bool> exists() => FileSystemEntity._isLinkRaw(_rawPath);
-
-  bool existsSync() => FileSystemEntity._isLinkRawSync(_rawPath);
-
-  Link get absolute => new Link.fromRawPath(_rawAbsolutePath);
-
-  Future<Link> create(String target, {bool recursive: false}) {
-    var result =
-        recursive ? parent.create(recursive: true) : new Future.value(null);
-    return result
-        .then((_) => _File._dispatchWithNamespace(
-            _IOService.fileCreateLink, [null, _rawPath, target]))
-        .then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot create link to target '$target'", path);
-      }
-      return this;
-    });
-  }
-
-  void createSync(String target, {bool recursive: false}) {
-    if (recursive) {
-      parent.createSync(recursive: true);
-    }
-    var result = _File._createLink(_Namespace._namespace, _rawPath, target);
-    throwIfError(result, "Cannot create link", path);
-  }
-
-  void updateSync(String target) {
-    // TODO(12414): Replace with atomic update, where supported by platform.
-    // Atomically changing a link can be done by creating the new link, with
-    // a different name, and using the rename() posix call to move it to
-    // the old name atomically.
-    deleteSync();
-    createSync(target);
-  }
-
-  Future<Link> update(String target) {
-    // TODO(12414): Replace with atomic update, where supported by platform.
-    // Atomically changing a link can be done by creating the new link, with
-    // a different name, and using the rename() posix call to move it to
-    // the old name atomically.
-    return delete().then<Link>((_) => create(target));
-  }
-
-  Future<Link> _delete({bool recursive: false}) {
-    if (recursive) {
-      return new Directory.fromRawPath(_rawPath)
-          .delete(recursive: true)
-          .then((_) => this);
-    }
-    return _File._dispatchWithNamespace(
-        _IOService.fileDeleteLink, [null, _rawPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(response, "Cannot delete link", path);
-      }
-      return this;
-    });
-  }
-
-  void _deleteSync({bool recursive: false}) {
-    if (recursive) {
-      return new Directory.fromRawPath(_rawPath).deleteSync(recursive: true);
-    }
-    var result = _File._deleteLinkNative(_Namespace._namespace, _rawPath);
-    throwIfError(result, "Cannot delete link", path);
-  }
-
-  Future<Link> rename(String newPath) {
-    return _File._dispatchWithNamespace(
-        _IOService.fileRenameLink, [null, _rawPath, newPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot rename link to '$newPath'", path);
-      }
-      return new Link(newPath);
-    });
-  }
-
-  Link renameSync(String newPath) {
-    var result = _File._renameLink(_Namespace._namespace, _rawPath, newPath);
-    throwIfError(result, "Cannot rename link '$path' to '$newPath'");
-    return new Link(newPath);
-  }
-
-  Future<String> target() {
-    return _File._dispatchWithNamespace(
-        _IOService.fileLinkTarget, [null, _rawPath]).then((response) {
-      if (_isErrorResponse(response)) {
-        throw _exceptionFromResponse(
-            response, "Cannot get target of link", path);
-      }
-      return response;
-    });
-  }
-
-  String targetSync() {
-    var result = _File._linkTarget(_Namespace._namespace, _rawPath);
-    throwIfError(result, "Cannot read link", path);
-    return result;
-  }
-
-  static throwIfError(Object? result, String msg, [String path = ""]) {
-    if (result is OSError) {
-      throw new FileSystemException(msg, path, result);
-    }
-  }
-
-  bool _isErrorResponse(response) {
-    return response is List && response[0] != _successResponse;
-  }
-
-  _exceptionFromResponse(response, String message, String path) {
-    assert(_isErrorResponse(response));
-    switch (response[_errorResponseErrorType]) {
-      case _illegalArgumentResponse:
-        return new ArgumentError();
-      case _osErrorResponse:
-        var err = new OSError(response[_osErrorResponseMessage],
-            response[_osErrorResponseErrorCode]);
-        return new FileSystemException(message, path, err);
-      default:
-        return new Exception("Unknown error");
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/io/namespace_impl.dart b/sdk_nnbd/lib/io/namespace_impl.dart
deleted file mode 100644
index 88987b6..0000000
--- a/sdk_nnbd/lib/io/namespace_impl.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart.io;
-
-// Each Isolate may run in a different "namespace", which provides the scope in
-// which file paths are resolved.
-abstract class _Namespace {
-  // This getter does not increase the reference count on the underlying native
-  // object. It cannot be passed in a dispatch message to the IOService thread.
-  external static _Namespace get _namespace;
-
-  // This getter does increase the reference count on the underlying native
-  // object. It must be passed in a dispatch message to the IOService thread.
-  external static int get _namespacePointer;
-
-  // This sets up the Isolate's namespace. It should be set up by the embedder.
-  // If it is not set up by the embedder, relative paths will be resolved
-  // relative to the process's current working directory and absolute paths will
-  // be left relative to the file system root.
-  @pragma("vm:entry-point")
-  external static void _setupNamespace(var namespace);
-}
diff --git a/sdk_nnbd/lib/io/network_profiling.dart b/sdk_nnbd/lib/io/network_profiling.dart
deleted file mode 100644
index 5032d72..0000000
--- a/sdk_nnbd/lib/io/network_profiling.dart
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.io;
-
-const int _versionMajor = 1;
-const int _versionMinor = 1;
-
-const String _tcpSocket = 'tcp';
-const String _udpSocket = 'udp';
-
-@pragma('vm:entry-point', !const bool.fromEnvironment("dart.vm.product"))
-abstract class _NetworkProfiling {
-  // Http relative RPCs
-  static const _kGetHttpEnableTimelineLogging =
-      'ext.dart.io.getHttpEnableTimelineLogging';
-  static const _kSetHttpEnableTimelineLogging =
-      'ext.dart.io.setHttpEnableTimelineLogging';
-  // Socket relative RPCs
-  static const _kClearSocketProfileRPC = 'ext.dart.io.clearSocketProfile';
-  static const _kGetSocketProfileRPC = 'ext.dart.io.getSocketProfile';
-  static const _kPauseSocketProfilingRPC = 'ext.dart.io.pauseSocketProfiling';
-  static const _kStartSocketProfilingRPC = 'ext.dart.io.startSocketProfiling';
-
-  // TODO(zichangguo): This version number represents the version of service
-  // extension of dart:io. Consider moving this out of web profiler class,
-  // if more methods added to dart:io,
-  static const _kGetVersionRPC = 'ext.dart.io.getVersion';
-
-  @pragma('vm:entry-point')
-  static void _registerServiceExtension() {
-    registerExtension(_kGetHttpEnableTimelineLogging, _serviceExtensionHandler);
-    registerExtension(_kSetHttpEnableTimelineLogging, _serviceExtensionHandler);
-    registerExtension(_kGetSocketProfileRPC, _serviceExtensionHandler);
-    registerExtension(_kStartSocketProfilingRPC, _serviceExtensionHandler);
-    registerExtension(_kPauseSocketProfilingRPC, _serviceExtensionHandler);
-    registerExtension(_kClearSocketProfileRPC, _serviceExtensionHandler);
-    registerExtension(_kGetVersionRPC, _serviceExtensionHandler);
-  }
-
-  static Future<ServiceExtensionResponse> _serviceExtensionHandler(
-      String method, Map<String, String> parameters) {
-    try {
-      String responseJson;
-      switch (method) {
-        case _kGetHttpEnableTimelineLogging:
-          responseJson = _getHttpEnableTimelineLogging();
-          break;
-        case _kSetHttpEnableTimelineLogging:
-          responseJson = _setHttpEnableTimelineLogging(parameters);
-          break;
-        case _kGetSocketProfileRPC:
-          responseJson = _SocketProfile.toJson();
-          break;
-        case _kStartSocketProfilingRPC:
-          responseJson = _SocketProfile.start();
-          break;
-        case _kPauseSocketProfilingRPC:
-          responseJson = _SocketProfile.pause();
-          break;
-        case _kClearSocketProfileRPC:
-          responseJson = _SocketProfile.clear();
-          break;
-        case _kGetVersionRPC:
-          responseJson = getVersion();
-          break;
-        default:
-          return Future.value(ServiceExtensionResponse.error(
-              ServiceExtensionResponse.extensionError,
-              'Method $method does not exist'));
-      }
-      return Future.value(ServiceExtensionResponse.result(responseJson));
-    } on dynamic catch (errorMessage) {
-      return Future.value(ServiceExtensionResponse.error(
-          ServiceExtensionResponse.invalidParams, errorMessage));
-    }
-  }
-
-  static String getVersion() => json.encode({
-        'type': 'Version',
-        'major': _versionMajor,
-        'minor': _versionMinor,
-      });
-}
-
-String _success() => json.encode({
-      'type': 'Success',
-    });
-
-String _invalidArgument(String argument, dynamic value) =>
-    "Value for parameter '$argument' is not valid: $value";
-
-String _missingArgument(String argument) => "Parameter '$argument' is required";
-
-String _getHttpEnableTimelineLogging() => json.encode({
-      'type': 'HttpTimelineLoggingState',
-      'enabled': HttpClient.enableTimelineLogging,
-    });
-
-String _setHttpEnableTimelineLogging(Map<String, String> parameters) {
-  const String kEnable = 'enable';
-  if (!parameters.containsKey(kEnable)) {
-    throw _missingArgument(kEnable);
-  }
-  final enable = parameters[kEnable]!.toLowerCase();
-  if (enable != 'true' && enable != 'false') {
-    throw _invalidArgument(kEnable, enable);
-  }
-  HttpClient.enableTimelineLogging = (enable == 'true');
-  return _success();
-}
-
-abstract class _SocketProfile {
-  static const _kType = 'SocketProfile';
-  static bool _enableSocketProfiling = false;
-  static Map<int, _SocketStatistic> _idToSocketStatistic = {};
-
-  static String toJson() => json.encode({
-        'type': _kType,
-        'sockets': _idToSocketStatistic.values.map((f) => f.toMap()).toList(),
-      });
-
-  static void collectNewSocket(
-      int id, String type, InternetAddress addr, int port) {
-    _SocketProfile.collectStatistic(id, _SocketProfileType.startTime);
-    _SocketProfile.collectStatistic(id, _SocketProfileType.socketType, type);
-    _SocketProfile.collectStatistic(id, _SocketProfileType.address, addr);
-    _SocketProfile.collectStatistic(id, _SocketProfileType.port, port);
-  }
-
-  static void collectStatistic(int id, _SocketProfileType type,
-      [dynamic object]) {
-    if (!_enableSocketProfiling) {
-      return;
-    }
-    // Skip socket that started before _enableSocketProfiling turned on.
-    if (!_idToSocketStatistic.containsKey(id) &&
-        type != _SocketProfileType.startTime) return;
-    _SocketStatistic stats = _idToSocketStatistic[id] ??= _SocketStatistic(id);
-    switch (type) {
-      case _SocketProfileType.startTime:
-        stats.startTime = Timeline.now;
-        break;
-      case _SocketProfileType.endTime:
-        stats.endTime = Timeline.now;
-        break;
-      case _SocketProfileType.address:
-        assert(object is InternetAddress);
-        stats.address = (object as InternetAddress).toString();
-        break;
-      case _SocketProfileType.port:
-        assert(object is int);
-        stats.port = object;
-        break;
-      case _SocketProfileType.socketType:
-        assert(object is String);
-        stats.socketType = object;
-        break;
-      case _SocketProfileType.readBytes:
-        if (object == null) return;
-        stats.readBytes += object as int;
-        stats.lastReadTime = Timeline.now;
-        break;
-      case _SocketProfileType.writeBytes:
-        if (object == null) return;
-        stats.writeBytes += object as int;
-        stats.lastWriteTime = Timeline.now;
-        break;
-      default:
-        throw ArgumentError('type ${type} does not exist');
-        break;
-    }
-  }
-
-  static String start() {
-    _enableSocketProfiling = true;
-    return _success();
-  }
-
-  static String pause() {
-    _enableSocketProfiling = false;
-    return _success();
-  }
-
-  // clear the storage if _idToSocketStatistic has been initialized.
-  static String clear() {
-    _idToSocketStatistic.clear();
-    return _success();
-  }
-}
-
-/// The [_SocketProfileType] is used as a parameter for
-/// [_SocketProfile.collectStatistic] to determine the type of statistic.
-enum _SocketProfileType {
-  startTime,
-  endTime,
-  address,
-  port,
-  socketType,
-  readBytes,
-  writeBytes
-}
-
-/// Socket statistic
-class _SocketStatistic {
-  final int id;
-  int? startTime;
-  int? endTime;
-  String? address;
-  int? port;
-  String? socketType;
-  int readBytes = 0;
-  int writeBytes = 0;
-  int? lastWriteTime;
-  int? lastReadTime;
-
-  _SocketStatistic(this.id);
-
-  Map<String, dynamic> toMap() {
-    final map = <String, dynamic>{
-      'id': id,
-    };
-    _setIfNotNull(map, 'startTime', startTime);
-    _setIfNotNull(map, 'endTime', endTime);
-    _setIfNotNull(map, 'address', address);
-    _setIfNotNull(map, 'port', port);
-    _setIfNotNull(map, 'socketType', socketType);
-    _setIfNotNull(map, 'readBytes', readBytes);
-    _setIfNotNull(map, 'writeBytes', writeBytes);
-    _setIfNotNull(map, 'lastWriteTime', lastWriteTime);
-    _setIfNotNull(map, 'lastReadTime', lastReadTime);
-    return map;
-  }
-
-  void _setIfNotNull(Map<String, dynamic> json, String key, Object? value) {
-    if (value == null) return;
-    json[key] = value;
-  }
-}
diff --git a/sdk_nnbd/lib/io/overrides.dart b/sdk_nnbd/lib/io/overrides.dart
deleted file mode 100644
index 4b7deaa..0000000
--- a/sdk_nnbd/lib/io/overrides.dart
+++ /dev/null
@@ -1,516 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart.io;
-
-final _ioOverridesToken = new Object();
-
-const _asyncRunZoned = runZoned;
-
-/// This class facilitates overriding various APIs of dart:io with mock
-/// implementations.
-///
-/// This abstract base class should be extended with overrides for the
-/// operations needed to construct mocks. The implementations in this base class
-/// default to the actual dart:io implementation. For example:
-///
-/// ```
-/// class MyDirectory implements Directory {
-///   ...
-///   // An implementation of the Directory interface
-///   ...
-/// }
-///
-/// main() {
-///   IOOverrides.runZoned(() {
-///     ...
-///     // Operations will use MyDirectory instead of dart:io's Directory
-///     // implementation whenever Directory is used.
-///     ...
-///   }, createDirectory: (String path) => new MyDirectory(path));
-/// }
-/// ```
-abstract class IOOverrides {
-  static IOOverrides? _global;
-
-  static IOOverrides? get current {
-    return Zone.current[_ioOverridesToken] ?? _global;
-  }
-
-  /// The [IOOverrides] to use in the root [Zone].
-  ///
-  /// These are the [IOOverrides] that will be used in the root Zone, and in
-  /// Zone's that do not set [IOOverrides] and whose ancestors up to the root
-  /// Zone do not set [IOOverrides].
-  static set global(IOOverrides? overrides) {
-    _global = overrides;
-  }
-
-  /// Runs [body] in a fresh [Zone] using the provided overrides.
-  ///
-  /// See the documentation on the corresponding methods of IOOverrides for
-  /// information about what the optional arguments do.
-  static R runZoned<R>(R body(),
-      {
-      // Directory
-      Directory Function(String)? createDirectory,
-      Directory Function()? getCurrentDirectory,
-      void Function(String)? setCurrentDirectory,
-      Directory Function()? getSystemTempDirectory,
-
-      // File
-      File Function(String)? createFile,
-
-      // FileStat
-      Future<FileStat> Function(String)? stat,
-      FileStat Function(String)? statSync,
-
-      // FileSystemEntity
-      Future<bool> Function(String, String)? fseIdentical,
-      bool Function(String, String)? fseIdenticalSync,
-      Future<FileSystemEntityType> Function(String, bool)? fseGetType,
-      FileSystemEntityType Function(String, bool)? fseGetTypeSync,
-
-      // _FileSystemWatcher
-      Stream<FileSystemEvent> Function(String, int, bool)? fsWatch,
-      bool Function()? fsWatchIsSupported,
-
-      // Link
-      Link Function(String)? createLink,
-
-      // Socket
-      Future<Socket> Function(dynamic, int,
-              {dynamic sourceAddress, Duration? timeout})?
-          socketConnect,
-      Future<ConnectionTask<Socket>> Function(dynamic, int,
-              {dynamic sourceAddress})?
-          socketStartConnect,
-
-      // ServerSocket
-      Future<ServerSocket> Function(dynamic, int,
-              {int backlog, bool v6Only, bool shared})?
-          serverSocketBind}) {
-    IOOverrides overrides = new _IOOverridesScope(
-      // Directory
-      createDirectory,
-      getCurrentDirectory,
-      setCurrentDirectory,
-      getSystemTempDirectory,
-
-      // File
-      createFile,
-
-      // FileStat
-      stat,
-      statSync,
-
-      // FileSystemEntity
-      fseIdentical,
-      fseIdenticalSync,
-      fseGetType,
-      fseGetTypeSync,
-
-      // _FileSystemWatcher
-      fsWatch,
-      fsWatchIsSupported,
-
-      // Link
-      createLink,
-
-      // Socket
-      socketConnect,
-      socketStartConnect,
-
-      // ServerSocket
-      serverSocketBind,
-    );
-    return _asyncRunZoned<R>(body, zoneValues: {_ioOverridesToken: overrides});
-  }
-
-  /// Runs [body] in a fresh [Zone] using the overrides found in [overrides].
-  ///
-  /// Note that [overrides] should be an instance of a class that extends
-  /// [IOOverrides].
-  static R runWithIOOverrides<R>(R body(), IOOverrides overrides) {
-    return _asyncRunZoned<R>(body, zoneValues: {_ioOverridesToken: overrides});
-  }
-
-  // Directory
-
-  /// Creates a new [Directory] object for the given [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `new Directory()` and `new Directory.fromUri()`.
-  Directory createDirectory(String path) => new _Directory(path);
-
-  /// Returns the current working directory.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// the static getter `Directory.current`
-  Directory getCurrentDirectory() => _Directory.current;
-
-  /// Sets the current working directory to be [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// the setter `Directory.current`.
-  void setCurrentDirectory(String path) {
-    _Directory.current = path;
-  }
-
-  /// Returns the system temporary directory.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `Directory.systemTemp`.
-  Directory getSystemTempDirectory() => _Directory.systemTemp;
-
-  // File
-
-  /// Creates a new [File] object for the given [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `new File()` and `new File.fromUri()`.
-  File createFile(String path) => new _File(path);
-
-  // FileStat
-
-  /// Asynchronously returns [FileStat] information for [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileStat.stat()`.
-  Future<FileStat> stat(String path) {
-    return FileStat._stat(path);
-  }
-
-  /// Returns [FileStat] information for [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileStat.statSync()`.
-  FileStat statSync(String path) {
-    return FileStat._statSyncInternal(path);
-  }
-
-  // FileSystemEntity
-
-  /// Asynchronously returns `true` if [path1] and [path2] are paths to the
-  /// same file system object.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileSystemEntity.identical`.
-  Future<bool> fseIdentical(String path1, String path2) {
-    return FileSystemEntity._identical(path1, path2);
-  }
-
-  /// Returns `true` if [path1] and [path2] are paths to the
-  /// same file system object.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileSystemEntity.identicalSync`.
-  bool fseIdenticalSync(String path1, String path2) {
-    return FileSystemEntity._identicalSync(path1, path2);
-  }
-
-  /// Asynchronously returns the [FileSystemEntityType] for [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileSystemEntity.type`.
-  Future<FileSystemEntityType> fseGetType(String path, bool followLinks) {
-    return FileSystemEntity._getTypeRequest(
-        utf8.encoder.convert(path), followLinks);
-  }
-
-  /// Returns the [FileSystemEntityType] for [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileSystemEntity.typeSync`.
-  FileSystemEntityType fseGetTypeSync(String path, bool followLinks) {
-    return FileSystemEntity._getTypeSyncHelper(
-        utf8.encoder.convert(path), followLinks);
-  }
-
-  // _FileSystemWatcher
-
-  /// Returns a [Stream] of [FileSystemEvent]s.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileSystemEntity.watch()`.
-  Stream<FileSystemEvent> fsWatch(String path, int events, bool recursive) {
-    return _FileSystemWatcher._watch(path, events, recursive);
-  }
-
-  /// Returns `true` when [FileSystemEntity.watch] is supported.
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `FileSystemEntity.isWatchSupported`.
-  bool fsWatchIsSupported() => _FileSystemWatcher.isSupported;
-
-  // Link
-
-  /// Returns a new [Link] object for the given [path].
-  ///
-  /// When this override is installed, this function overrides the behavior of
-  /// `new Link()` and `new Link.fromUri()`.
-  Link createLink(String path) => new _Link(path);
-
-  // Socket
-
-  /// Asynchronously returns a [Socket] connected to the given host and port.
-  ///
-  /// When this override is installed, this functions overrides the behavior of
-  /// `Socket.connect(...)`.
-  Future<Socket> socketConnect(host, int port,
-      {sourceAddress, Duration? timeout}) {
-    return Socket._connect(host, port,
-        sourceAddress: sourceAddress, timeout: timeout);
-  }
-
-  /// Asynchronously returns a [ConnectionTask] that connects to the given host
-  /// and port when successful.
-  ///
-  /// When this override is installed, this functions overrides the behavior of
-  /// `Socket.startConnect(...)`.
-  Future<ConnectionTask<Socket>> socketStartConnect(host, int port,
-      {sourceAddress}) {
-    return Socket._startConnect(host, port, sourceAddress: sourceAddress);
-  }
-
-  // ServerSocket
-
-  /// Asynchronously returns a [ServerSocket] that connects to the given address
-  /// and port when successful.
-  ///
-  /// When this override is installed, this functions overrides the behavior of
-  /// `ServerSocket.bind(...)`.
-  Future<ServerSocket> serverSocketBind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    return ServerSocket._bind(address, port,
-        backlog: backlog, v6Only: v6Only, shared: shared);
-  }
-}
-
-class _IOOverridesScope extends IOOverrides {
-  final IOOverrides? _previous = IOOverrides.current;
-
-  // Directory
-  Directory Function(String)? _createDirectory;
-  Directory Function()? _getCurrentDirectory;
-  void Function(String)? _setCurrentDirectory;
-  Directory Function()? _getSystemTempDirectory;
-
-  // File
-  File Function(String)? _createFile;
-
-  // FileStat
-  Future<FileStat> Function(String)? _stat;
-  FileStat Function(String)? _statSync;
-
-  // FileSystemEntity
-  Future<bool> Function(String, String)? _fseIdentical;
-  bool Function(String, String)? _fseIdenticalSync;
-  Future<FileSystemEntityType> Function(String, bool)? _fseGetType;
-  FileSystemEntityType Function(String, bool)? _fseGetTypeSync;
-
-  // _FileSystemWatcher
-  Stream<FileSystemEvent> Function(String, int, bool)? _fsWatch;
-  bool Function()? _fsWatchIsSupported;
-
-  // Link
-  Link Function(String)? _createLink;
-
-  // Socket
-  Future<Socket> Function(dynamic, int,
-      {dynamic sourceAddress, Duration? timeout})? _socketConnect;
-  Future<ConnectionTask<Socket>> Function(dynamic, int,
-      {dynamic sourceAddress})? _socketStartConnect;
-
-  // ServerSocket
-  Future<ServerSocket> Function(dynamic, int,
-      {int backlog, bool v6Only, bool shared})? _serverSocketBind;
-
-  _IOOverridesScope(
-    // Directory
-    this._createDirectory,
-    this._getCurrentDirectory,
-    this._setCurrentDirectory,
-    this._getSystemTempDirectory,
-
-    // File
-    this._createFile,
-
-    // FileStat
-    this._stat,
-    this._statSync,
-
-    // FileSystemEntity
-    this._fseIdentical,
-    this._fseIdenticalSync,
-    this._fseGetType,
-    this._fseGetTypeSync,
-
-    // _FileSystemWatcher
-    this._fsWatch,
-    this._fsWatchIsSupported,
-
-    // Link
-    this._createLink,
-
-    // Socket
-    this._socketConnect,
-    this._socketStartConnect,
-
-    // ServerSocket
-    this._serverSocketBind,
-  );
-
-  // Directory
-  @override
-  Directory createDirectory(String path) {
-    if (_createDirectory != null) return _createDirectory!(path);
-    if (_previous != null) return _previous!.createDirectory(path);
-    return super.createDirectory(path);
-  }
-
-  @override
-  Directory getCurrentDirectory() {
-    if (_getCurrentDirectory != null) return _getCurrentDirectory!();
-    if (_previous != null) return _previous!.getCurrentDirectory();
-    return super.getCurrentDirectory();
-  }
-
-  @override
-  void setCurrentDirectory(String path) {
-    if (_setCurrentDirectory != null)
-      _setCurrentDirectory!(path);
-    else if (_previous != null)
-      _previous!.setCurrentDirectory(path);
-    else
-      super.setCurrentDirectory(path);
-  }
-
-  @override
-  Directory getSystemTempDirectory() {
-    if (_getSystemTempDirectory != null) return _getSystemTempDirectory!();
-    if (_previous != null) return _previous!.getSystemTempDirectory();
-    return super.getSystemTempDirectory();
-  }
-
-  // File
-  @override
-  File createFile(String path) {
-    if (_createFile != null) return _createFile!(path);
-    if (_previous != null) return _previous!.createFile(path);
-    return super.createFile(path);
-  }
-
-  // FileStat
-  @override
-  Future<FileStat> stat(String path) {
-    if (_stat != null) return _stat!(path);
-    if (_previous != null) return _previous!.stat(path);
-    return super.stat(path);
-  }
-
-  @override
-  FileStat statSync(String path) {
-    if (_stat != null) return _statSync!(path);
-    if (_previous != null) return _previous!.statSync(path);
-    return super.statSync(path);
-  }
-
-  // FileSystemEntity
-  @override
-  Future<bool> fseIdentical(String path1, String path2) {
-    if (_fseIdentical != null) return _fseIdentical!(path1, path2);
-    if (_previous != null) return _previous!.fseIdentical(path1, path2);
-    return super.fseIdentical(path1, path2);
-  }
-
-  @override
-  bool fseIdenticalSync(String path1, String path2) {
-    if (_fseIdenticalSync != null) return _fseIdenticalSync!(path1, path2);
-    if (_previous != null) return _previous!.fseIdenticalSync(path1, path2);
-    return super.fseIdenticalSync(path1, path2);
-  }
-
-  @override
-  Future<FileSystemEntityType> fseGetType(String path, bool followLinks) {
-    if (_fseGetType != null) return _fseGetType!(path, followLinks);
-    if (_previous != null) return _previous!.fseGetType(path, followLinks);
-    return super.fseGetType(path, followLinks);
-  }
-
-  @override
-  FileSystemEntityType fseGetTypeSync(String path, bool followLinks) {
-    if (_fseGetTypeSync != null) return _fseGetTypeSync!(path, followLinks);
-    if (_previous != null) return _previous!.fseGetTypeSync(path, followLinks);
-    return super.fseGetTypeSync(path, followLinks);
-  }
-
-  // _FileSystemWatcher
-  @override
-  Stream<FileSystemEvent> fsWatch(String path, int events, bool recursive) {
-    if (_fsWatch != null) return _fsWatch!(path, events, recursive);
-    if (_previous != null) return _previous!.fsWatch(path, events, recursive);
-    return super.fsWatch(path, events, recursive);
-  }
-
-  @override
-  bool fsWatchIsSupported() {
-    if (_fsWatchIsSupported != null) return _fsWatchIsSupported!();
-    if (_previous != null) return _previous!.fsWatchIsSupported();
-    return super.fsWatchIsSupported();
-  }
-
-  // Link
-  @override
-  Link createLink(String path) {
-    if (_createLink != null) return _createLink!(path);
-    if (_previous != null) return _previous!.createLink(path);
-    return super.createLink(path);
-  }
-
-  // Socket
-  @override
-  Future<Socket> socketConnect(host, int port,
-      {sourceAddress, Duration? timeout}) {
-    if (_socketConnect != null) {
-      return _socketConnect!(host, port,
-          sourceAddress: sourceAddress, timeout: timeout);
-    }
-    if (_previous != null) {
-      return _previous!.socketConnect(host, port,
-          sourceAddress: sourceAddress, timeout: timeout);
-    }
-    return super.socketConnect(host, port,
-        sourceAddress: sourceAddress, timeout: timeout);
-  }
-
-  @override
-  Future<ConnectionTask<Socket>> socketStartConnect(host, int port,
-      {sourceAddress}) {
-    if (_socketStartConnect != null) {
-      return _socketStartConnect!(host, port, sourceAddress: sourceAddress);
-    }
-    if (_previous != null) {
-      return _previous!
-          .socketStartConnect(host, port, sourceAddress: sourceAddress);
-    }
-    return super.socketStartConnect(host, port, sourceAddress: sourceAddress);
-  }
-
-  // ServerSocket
-  @override
-  Future<ServerSocket> serverSocketBind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    if (_serverSocketBind != null) {
-      return _serverSocketBind!(address, port,
-          backlog: backlog, v6Only: v6Only, shared: shared);
-    }
-    if (_previous != null) {
-      return _previous!.serverSocketBind(address, port,
-          backlog: backlog, v6Only: v6Only, shared: shared);
-    }
-    return super.serverSocketBind(address, port,
-        backlog: backlog, v6Only: v6Only, shared: shared);
-  }
-}
diff --git a/sdk_nnbd/lib/io/platform.dart b/sdk_nnbd/lib/io/platform.dart
deleted file mode 100644
index 412e258..0000000
--- a/sdk_nnbd/lib/io/platform.dart
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-/**
- * Information about the environment in which the current program is running.
- *
- * Platform provides information such as the operating system,
- * the hostname of the computer, the value of environment variables,
- * the path to the running program,
- * and so on.
- *
- * ## Get the URI to the current Dart script
- *
- * Use the [script] getter to get the URI to the currently running
- * Dart script.
- *
- *     import 'dart:io' show Platform;
- *
- *     void main() {
- *       // Get the URI of the script being run.
- *       var uri = Platform.script;
- *       // Convert the URI to a path.
- *       var path = uri.toFilePath();
- *     }
- *
- * ## Get the value of an environment variable
- *
- * The [environment] getter returns a the names and values of environment
- * variables in a [Map] that contains key-value pairs of strings. The Map is
- * unmodifiable. This sample shows how to get the value of the `PATH`
- * environment variable.
- *
- *     import 'dart:io' show Platform;
- *
- *     void main() {
- *       Map<String, String> envVars = Platform.environment;
- *       print(envVars['PATH']);
- *     }
- *
- * ## Determine the OS
- *
- * You can get the name of the operating system as a string with the
- * [operatingSystem] getter. You can also use one of the static boolean
- * getters: [isMacOS], [isLinux], and [isWindows].
- *
- *     import 'dart:io' show Platform, stdout;
- *
- *     void main() {
- *       // Get the operating system as a string.
- *       String os = Platform.operatingSystem;
- *       // Or, use a predicate getter.
- *       if (Platform.isMacOS) {
- *         print('is a Mac');
- *       } else {
- *         print('is not a Mac');
- *       }
- *     }
- *
- * ## Other resources
- *
- * [Dart by Example](https://www.dartlang.org/dart-by-example/#dart-io-and-command-line-apps)
- * provides additional task-oriented code samples that show how to use
- * various API from the [dart:io] library.
- */
-class Platform {
-  static final _numberOfProcessors = _Platform.numberOfProcessors;
-  static final _pathSeparator = _Platform.pathSeparator;
-  static final _operatingSystem = _Platform.operatingSystem;
-  static final _operatingSystemVersion = _Platform.operatingSystemVersion;
-  static final _localHostname = _Platform.localHostname;
-  static final _version = _Platform.version;
-
-  /**
-   * The number of individual execution units of the machine.
-   */
-  static int get numberOfProcessors => _numberOfProcessors;
-
-  /**
-   * The path separator used by the operating system to separate
-   * components in file paths.
-   */
-  static String get pathSeparator => _pathSeparator;
-
-  /**
-   * Get the name of the current locale.
-   */
-  static String get localeName => _Platform.localeName();
-
-  /**
-   * A string representing the operating system or platform.
-   */
-  static String get operatingSystem => _operatingSystem;
-
-  /**
-   * A string representing the version of the operating system or platform.
-   */
-  static String get operatingSystemVersion => _operatingSystemVersion;
-
-  /**
-   * The local hostname for the system.
-   */
-  static String get localHostname => _localHostname;
-
-  /**
-   * Whether the operating system is a version of
-   * [Linux](https://en.wikipedia.org/wiki/Linux).
-   *
-   * This value is `false` if the operating system is a specialized
-   * version of Linux that identifies itself by a different name,
-   * for example Android (see [isAndroid]).
-   */
-  static final bool isLinux = (_operatingSystem == "linux");
-
-  /**
-   * Whether the operating system is a version of
-   * [macOS](https://en.wikipedia.org/wiki/MacOS).
-   */
-  static final bool isMacOS = (_operatingSystem == "macos");
-
-  /**
-   * Whether the operating system is a version of
-   * [Microsoft Windows](https://en.wikipedia.org/wiki/Microsoft_Windows).
-   */
-  static final bool isWindows = (_operatingSystem == "windows");
-
-  /**
-   * Whether the operating system is a version of
-   * [Android](https://en.wikipedia.org/wiki/Android_%28operating_system%29).
-   */
-  static final bool isAndroid = (_operatingSystem == "android");
-
-  /**
-   * Whether the operating system is a version of
-   * [iOS](https://en.wikipedia.org/wiki/IOS).
-   */
-  static final bool isIOS = (_operatingSystem == "ios");
-
-  /**
-   * Whether the operating system is a version of
-   * [Fuchsia](https://en.wikipedia.org/wiki/Google_Fuchsia).
-   */
-  static final bool isFuchsia = (_operatingSystem == "fuchsia");
-
-  /**
-   * The environment for this process as a map from string key to string value.
-   *
-   * The map is unmodifiable,
-   * and its content is retrieved from the operating system on its first use.
-   *
-   * Environment variables on Windows are case-insensitive,
-   * so on Windows the map is case-insensitive and will convert
-   * all keys to upper case.
-   * On other platforms, keys can be distinguished by case.
-   */
-  static Map<String, String> get environment => _Platform.environment;
-
-  /**
-   * The path of the executable used to run the script in this isolate.
-   *
-   * The literal path used to identify the script.
-   * This path might be relative or just be a name from which the executable
-   * was found by searching the system path.
-   *
-   * Use [resolvedExecutable] to get an absolute path to the executable.
-   */
-  static String get executable => _Platform.executable;
-
-  /**
-   * The path of the executable used to run the script in this
-   * isolate after it has been resolved by the OS.
-   *
-   * This is the absolute path, with all symlinks resolved, to the
-   * executable used to run the script.
-   */
-  static String get resolvedExecutable => _Platform.resolvedExecutable;
-
-  /**
-   * The absolute URI of the script being run in this isolate.
-   *
-   * If the script argument on the command line is relative,
-   * it is resolved to an absolute URI before fetching the script, and
-   * that absolute URI is returned.
-   *
-   * URI resolution only does string manipulation on the script path, and this
-   * may be different from the file system's path resolution behavior. For
-   * example, a symbolic link immediately followed by '..' will not be
-   * looked up.
-   *
-   * If the executable environment does not support [script],
-   * the URI is empty.
-   */
-  static Uri get script => _Platform.script;
-
-  /**
-   * The flags passed to the executable used to run the script in this isolate.
-   *
-   * These are the command-line flags to the executable that precedes
-   * the script name.
-   * Provides a new list every time the value is read.
-   */
-  static List<String> get executableArguments => _Platform.executableArguments;
-
-  /**
-   * This returns `null`, as `packages/` directories are no longer supported.
-   *
-   */
-  @Deprecated('packages/ directory resolution is not supported in Dart 2')
-  static String? get packageRoot => null; // TODO(mfairhurst): remove this
-
-  /**
-   * The `--packages` flag passed to the executable used to run the script
-   * in this isolate.
-   *
-   * If present, it specifies a file describing how Dart packages are looked up.
-   *
-   * Is `null` if there is no `--packages` flag.
-   */
-  static String? get packageConfig => _Platform.packageConfig;
-
-  /**
-   * The version of the current Dart runtime.
-   *
-   * The value is a [semantic versioning](http://semver.org)
-   * string representing the version of the current Dart runtime,
-   * possibly followed by whitespace and other version and
-   * build details.
-   */
-  static String get version => _version;
-}
diff --git a/sdk_nnbd/lib/io/platform_impl.dart b/sdk_nnbd/lib/io/platform_impl.dart
deleted file mode 100644
index 0251445..0000000
--- a/sdk_nnbd/lib/io/platform_impl.dart
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-class _Platform {
-  external static int _numberOfProcessors();
-  external static String _pathSeparator();
-  external static String _operatingSystem();
-  external static _operatingSystemVersion();
-  external static _localHostname();
-  external static _executable();
-  external static _resolvedExecutable();
-
-  /**
-   * Retrieve the entries of the process environment.
-   *
-   * The result is an [Iterable] of strings, where each string represents
-   * an environment entry.
-   *
-   * Environment entries should be strings containing
-   * a non-empty name and a value separated by a '=' character.
-   * The name does not contain a '=' character,
-   * so the name is everything up to the first '=' character.
-   * Values are everything after the first '=' character.
-   * A value may contain further '=' characters, and it may be empty.
-   *
-   * Returns an [OSError] if retrieving the environment fails.
-   */
-  external static _environment();
-  external static List<String> _executableArguments();
-  external static String? _packageConfig();
-  external static String _version();
-  external static String _localeName();
-  external static Uri _script();
-
-  static String executable = _executable();
-  static String resolvedExecutable = _resolvedExecutable();
-  static String? packageConfig = _packageConfig();
-
-  @pragma("vm:entry-point")
-  static String Function()? _localeClosure;
-  static String localeName() {
-    final result = (_localeClosure == null) ? _localeName() : _localeClosure!();
-    if (result is OSError) {
-      throw result;
-    }
-    return result;
-  }
-
-  // Cache the OS environment. This can be an OSError instance if
-  // retrieving the environment failed.
-  static var /*OSError?|Map<String,String>?*/ _environmentCache;
-
-  static int get numberOfProcessors => _numberOfProcessors();
-  static String get pathSeparator => _pathSeparator();
-  static String get operatingSystem => _operatingSystem();
-  static Uri get script => _script();
-
-  static String? _cachedOSVersion;
-  static String get operatingSystemVersion {
-    if (_cachedOSVersion == null) {
-      var result = _operatingSystemVersion();
-      if (result is OSError) {
-        throw result;
-      }
-      _cachedOSVersion = result;
-    }
-    return _cachedOSVersion!;
-  }
-
-  static String get localHostname {
-    var result = _localHostname();
-    if (result is OSError) {
-      throw result;
-    }
-    return result;
-  }
-
-  static List<String> get executableArguments => _executableArguments();
-
-  static Map<String, String> get environment {
-    if (_environmentCache == null) {
-      var env = _environment();
-      if (env is! OSError) {
-        var isWindows = operatingSystem == 'windows';
-        var result = isWindows
-            ? new _CaseInsensitiveStringMap<String>()
-            : new Map<String, String>();
-        for (var str in env) {
-          if (str == null) {
-            continue;
-          }
-          // The Strings returned by [_environment()] are expected to be
-          // valid environment entries, but exceptions have been seen
-          // (e.g., an entry of just '=' has been seen on OS/X).
-          // Invalid entries (lines without a '=' or with an empty name)
-          // are discarded.
-          var equalsIndex = str.indexOf('=');
-          if (equalsIndex > 0) {
-            result[str.substring(0, equalsIndex)] =
-                str.substring(equalsIndex + 1);
-          }
-        }
-        _environmentCache = new UnmodifiableMapView<String, String>(result);
-      } else {
-        _environmentCache = env;
-      }
-    }
-
-    if (_environmentCache is OSError) {
-      throw _environmentCache;
-    } else {
-      return _environmentCache!;
-    }
-  }
-
-  static String get version => _version();
-}
-
-// Environment variables are case-insensitive on Windows. In order
-// to reflect that we use a case-insensitive string map on Windows.
-class _CaseInsensitiveStringMap<V> extends MapBase<String, V> {
-  final Map<String, V> _map = new Map<String, V>();
-
-  bool containsKey(Object? key) =>
-      key is String && _map.containsKey(key.toUpperCase());
-  bool containsValue(Object? value) => _map.containsValue(value);
-  V? operator [](Object? key) => key is String ? _map[key.toUpperCase()] : null;
-  void operator []=(String key, V value) {
-    _map[key.toUpperCase()] = value;
-  }
-
-  V putIfAbsent(String key, V ifAbsent()) {
-    return _map.putIfAbsent(key.toUpperCase(), ifAbsent);
-  }
-
-  void addAll(Map<String, V> other) {
-    other.forEach((key, value) => this[key.toUpperCase()] = value);
-  }
-
-  V? remove(Object? key) =>
-      key is String ? _map.remove(key.toUpperCase()) : null;
-
-  void clear() {
-    _map.clear();
-  }
-
-  void forEach(void f(String key, V value)) {
-    _map.forEach(f);
-  }
-
-  Iterable<String> get keys => _map.keys;
-  Iterable<V> get values => _map.values;
-  int get length => _map.length;
-  bool get isEmpty => _map.isEmpty;
-  bool get isNotEmpty => _map.isNotEmpty;
-
-  Iterable<MapEntry<String, V>> get entries => _map.entries;
-
-  Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(String key, V value)) =>
-      _map.map(transform);
-
-  V update(String key, V update(V value), {V ifAbsent()?}) =>
-      _map.update(key.toUpperCase(), update, ifAbsent: ifAbsent);
-
-  void updateAll(V update(String key, V value)) {
-    _map.updateAll(update);
-  }
-
-  void removeWhere(bool test(String key, V value)) {
-    _map.removeWhere(test);
-  }
-
-  String toString() => _map.toString();
-}
diff --git a/sdk_nnbd/lib/io/process.dart b/sdk_nnbd/lib/io/process.dart
deleted file mode 100644
index e0d0b15..0000000
--- a/sdk_nnbd/lib/io/process.dart
+++ /dev/null
@@ -1,699 +0,0 @@
-// Copyright (c) 2014, 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.
-
-part of dart.io;
-
-// TODO(ager): The only reason for this class is that we
-// cannot patch a top-level at this point.
-class _ProcessUtils {
-  external static Never _exit(int status);
-  external static void _setExitCode(int status);
-  external static int _getExitCode();
-  external static void _sleep(int millis);
-  external static int _pid(Process? process);
-  external static Stream<ProcessSignal> _watchSignal(ProcessSignal signal);
-}
-
-/**
- * Exit the Dart VM process immediately with the given exit code.
- *
- * This does not wait for any asynchronous operations to terminate nor execute
- * `finally` blocks. Using [exit] is therefore very likely to lose data.
- *
- * While debugging, the VM will not respect the `--pause-isolates-on-exit`
- * flag if [exit] is called as invoking this method causes the Dart VM
- * process to shutdown immediately. To properly break on exit, consider
- * calling [debugger] from `dart:developer` or [Isolate.pause] from
- * `dart:isolate` on [Isolate.current] to pause the isolate before
- * invoking [exit].
- *
- * The handling of exit codes is platform specific.
- *
- * On Linux and OS X an exit code for normal termination will always
- * be in the range [0..255]. If an exit code outside this range is
- * set the actual exit code will be the lower 8 bits masked off and
- * treated as an unsigned value. E.g. using an exit code of -1 will
- * result in an actual exit code of 255 being reported.
- *
- * On Windows the exit code can be set to any 32-bit value. However
- * some of these values are reserved for reporting system errors like
- * crashes.
- *
- * Besides this the Dart executable itself uses an exit code of `254`
- * for reporting compile time errors and an exit code of `255` for
- * reporting runtime error (unhandled exception).
- *
- * Due to these facts it is recommended to only use exit codes in the
- * range [0..127] for communicating the result of running a Dart
- * program to the surrounding environment. This will avoid any
- * cross-platform issues.
- */
-Never exit(int code) {
-  ArgumentError.checkNotNull(code, "code");
-  if (!_EmbedderConfig._mayExit) {
-    throw new UnsupportedError(
-        "This embedder disallows calling dart:io's exit()");
-  }
-  _ProcessUtils._exit(code);
-}
-
-/**
- * Set the global exit code for the Dart VM.
- *
- * The exit code is global for the Dart VM and the last assignment to
- * exitCode from any isolate determines the exit code of the Dart VM
- * on normal termination.
- *
- * Default value is `0`.
- *
- * See [exit] for more information on how to chose a value for the
- * exit code.
- */
-void set exitCode(int code) {
-  ArgumentError.checkNotNull(code, "code");
-  _ProcessUtils._setExitCode(code);
-}
-
-/**
- * Get the global exit code for the Dart VM.
- *
- * The exit code is global for the Dart VM and the last assignment to
- * exitCode from any isolate determines the exit code of the Dart VM
- * on normal termination.
- *
- * See [exit] for more information on how to chose a value for the
- * exit code.
- */
-int get exitCode => _ProcessUtils._getExitCode();
-
-/**
- * Sleep for the duration specified in [duration].
- *
- * Use this with care, as no asynchronous operations can be processed
- * in a isolate while it is blocked in a [sleep] call.
- */
-void sleep(Duration duration) {
-  int milliseconds = duration.inMilliseconds;
-  if (milliseconds < 0) {
-    throw new ArgumentError("sleep: duration cannot be negative");
-  }
-  if (!_EmbedderConfig._maySleep) {
-    throw new UnsupportedError(
-        "This embedder disallows calling dart:io's sleep()");
-  }
-  _ProcessUtils._sleep(milliseconds);
-}
-
-/**
- * Returns the PID of the current process.
- */
-int get pid => _ProcessUtils._pid(null);
-
-/**
- * [ProcessInfo] provides methods for retrieving information about the
- * current process.
- */
-class ProcessInfo {
-  /**
-   * The current resident set size of memory for the process.
-   *
-   * Note that the meaning of this field is platform dependent. For example,
-   * some memory accounted for here may be shared with other processes, or if
-   * the same page is mapped into a process's address space, it may be counted
-   * twice.
-   */
-  external static int get currentRss;
-
-  /**
-   * The high-watermark in bytes for the resident set size of memory for the
-   * process.
-   *
-   * Note that the meaning of this field is platform dependent. For example,
-   * some memory accounted for here may be shared with other processes, or if
-   * the same page is mapped into a process's address space, it may be counted
-   * twice.
-   */
-  external static int get maxRss;
-}
-
-/**
- * Modes for running a new process.
- */
-class ProcessStartMode {
-  /// Normal child process.
-  static const normal = const ProcessStartMode._internal(0);
-  @Deprecated("Use normal instead")
-  static const NORMAL = normal;
-
-  /// Stdio handles are inherited by the child process.
-  static const inheritStdio = const ProcessStartMode._internal(1);
-  @Deprecated("Use inheritStdio instead")
-  static const INHERIT_STDIO = inheritStdio;
-
-  /// Detached child process with no open communication channel.
-  static const detached = const ProcessStartMode._internal(2);
-  @Deprecated("Use detached instead")
-  static const DETACHED = detached;
-
-  /// Detached child process with stdin, stdout and stderr still open
-  /// for communication with the child.
-  static const detachedWithStdio = const ProcessStartMode._internal(3);
-  @Deprecated("Use detachedWithStdio instead")
-  static const DETACHED_WITH_STDIO = detachedWithStdio;
-
-  static List<ProcessStartMode> get values => const <ProcessStartMode>[
-        normal,
-        inheritStdio,
-        detached,
-        detachedWithStdio
-      ];
-  String toString() =>
-      const ["normal", "inheritStdio", "detached", "detachedWithStdio"][_mode];
-
-  final int _mode;
-  const ProcessStartMode._internal(this._mode);
-}
-
-/**
- * The means to execute a program.
- *
- * Use the static [start] and [run] methods to start a new process.
- * The run method executes the process non-interactively to completion.
- * In contrast, the start method allows your code to interact with the
- * running process.
- *
- * ## Start a process with the run method
- *
- * The following code sample uses the run method to create a process
- * that runs the UNIX command `ls`, which lists the contents of a directory.
- * The run method completes with a [ProcessResult] object when the process
- * terminates. This provides access to the output and exit code from the
- * process. The run method does not return a Process object; this prevents your
- * code from interacting with the running process.
- *
- *     import 'dart:io';
- *
- *     main() {
- *       // List all files in the current directory in UNIX-like systems.
- *       Process.run('ls', ['-l']).then((ProcessResult results) {
- *         print(results.stdout);
- *       });
- *     }
- *
- * ## Start a process with the start method
- *
- * The following example uses start to create the process.
- * The start method returns a [Future] for a Process object.
- * When the future completes the process is started and
- * your code can interact with the
- * Process: writing to stdin, listening to stdout, and so on.
- *
- * The following sample starts the UNIX `cat` utility, which when given no
- * command-line arguments, echos its input.
- * The program writes to the process's standard input stream
- * and prints data from its standard output stream.
- *
- *     import 'dart:io';
- *     import 'dart:convert';
- *
- *     main() {
- *       Process.start('cat', []).then((Process process) {
- *         process.stdout
- *             .transform(utf8.decoder)
- *             .listen((data) { print(data); });
- *         process.stdin.writeln('Hello, world!');
- *         process.stdin.writeln('Hello, galaxy!');
- *         process.stdin.writeln('Hello, universe!');
- *       });
- *     }
- *
- * ## Standard I/O streams
- *
- * As seen in the previous code sample, you can interact with the Process's
- * standard output stream through the getter [stdout],
- * and you can interact with the Process's standard input stream through
- * the getter [stdin].
- * In addition, Process provides a getter [stderr] for using the Process's
- * standard error stream.
- *
- * A Process's streams are distinct from the top-level streams
- * for the current program.
- *
- * ## Exit codes
- *
- * Call the [exitCode] method to get the exit code of the process.
- * The exit code indicates whether the program terminated successfully
- * (usually indicated with an exit code of 0) or with an error.
- *
- * If the start method is used, the exitCode is available through a future
- * on the Process object (as shown in the example below).
- * If the run method is used, the exitCode is available
- * through a getter on the ProcessResult instance.
- *
- *     import 'dart:io';
- *
- *     main() {
- *       Process.start('ls', ['-l']).then((process) {
- *         // Get the exit code from the new process.
- *         process.exitCode.then((exitCode) {
- *           print('exit code: $exitCode');
- *         });
- *       });
- *     }
- *
- * ## Other resources
- *
- * [Dart by Example](https://www.dartlang.org/dart-by-example/#dart-io-and-command-line-apps)
- * provides additional task-oriented code samples that show how to use
- * various API from the [dart:io] library.
- */
-abstract class Process {
-  /**
-   * Returns a [:Future:] which completes with the exit code of the process
-   * when the process completes.
-   *
-   * The handling of exit codes is platform specific.
-   *
-   * On Linux and OS X a normal exit code will be a positive value in
-   * the range [0..255]. If the process was terminated due to a signal
-   * the exit code will be a negative value in the range [-255..-1],
-   * where the absolute value of the exit code is the signal
-   * number. For example, if a process crashes due to a segmentation
-   * violation the exit code will be -11, as the signal SIGSEGV has the
-   * number 11.
-   *
-   * On Windows a process can report any 32-bit value as an exit
-   * code. When returning the exit code this exit code is turned into
-   * a signed value. Some special values are used to report
-   * termination due to some system event. E.g. if a process crashes
-   * due to an access violation the 32-bit exit code is `0xc0000005`,
-   * which will be returned as the negative number `-1073741819`. To
-   * get the original 32-bit value use `(0x100000000 + exitCode) &
-   * 0xffffffff`.
-   *
-   * There is no guarantee that [stdout] and [stderr] have finished reporting
-   * the buffered output of the process when the returned future completes.
-   * To be sure that all output is captured,
-   * wait for the done event on the streams.
-   */
-  Future<int> get exitCode;
-
-  /**
-   * Starts a process running the [executable] with the specified
-   * [arguments]. Returns a [:Future<Process>:] that completes with a
-   * Process instance when the process has been successfully
-   * started. That [Process] object can be used to interact with the
-   * process. If the process cannot be started the returned [Future]
-   * completes with an exception.
-   *
-   * Use [workingDirectory] to set the working directory for the process. Note
-   * that the change of directory occurs before executing the process on some
-   * platforms, which may have impact when using relative paths for the
-   * executable and the arguments.
-   *
-   * Use [environment] to set the environment variables for the process. If not
-   * set the environment of the parent process is inherited. Currently, only
-   * US-ASCII environment variables are supported and errors are likely to occur
-   * if an environment variable with code-points outside the US-ASCII range is
-   * passed in.
-   *
-   * If [includeParentEnvironment] is `true`, the process's environment will
-   * include the parent process's environment, with [environment] taking
-   * precedence. Default is `true`.
-   *
-   * If [runInShell] is `true`, the process will be spawned through a system
-   * shell. On Linux and OS X, [:/bin/sh:] is used, while
-   * [:%WINDIR%\system32\cmd.exe:] is used on Windows.
-   *
-   * Users must read all data coming on the [stdout] and [stderr]
-   * streams of processes started with [:Process.start:]. If the user
-   * does not read all data on the streams the underlying system
-   * resources will not be released since there is still pending data.
-   *
-   * The following code uses `Process.start` to grep for `main` in the
-   * file `test.dart` on Linux.
-   *
-   *     Process.start('grep', ['-i', 'main', 'test.dart']).then((process) {
-   *       stdout.addStream(process.stdout);
-   *       stderr.addStream(process.stderr);
-   *     });
-   *
-   * If [mode] is [ProcessStartMode.normal] (the default) a child
-   * process will be started with `stdin`, `stdout` and `stderr`
-   * connected.
-   *
-   * If `mode` is [ProcessStartMode.detached] a detached process will
-   * be created. A detached process has no connection to its parent,
-   * and can keep running on its own when the parent dies. The only
-   * information available from a detached process is its `pid`. There
-   * is no connection to its `stdin`, `stdout` or `stderr`, nor will
-   * the process' exit code become available when it terminates.
-   *
-   * If `mode` is [ProcessStartMode.detachedWithStdio] a detached
-   * process will be created where the `stdin`, `stdout` and `stderr`
-   * are connected. The creator can communicate with the child through
-   * these. The detached process will keep running even if these
-   * communication channels are closed. The process' exit code will
-   * not become available when it terminated.
-   *
-   * The default value for `mode` is `ProcessStartMode.normal`.
-   */
-  external static Future<Process> start(
-      String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      ProcessStartMode mode: ProcessStartMode.normal});
-
-  /**
-   * Starts a process and runs it non-interactively to completion. The
-   * process run is [executable] with the specified [arguments].
-   *
-   * Use [workingDirectory] to set the working directory for the process. Note
-   * that the change of directory occurs before executing the process on some
-   * platforms, which may have impact when using relative paths for the
-   * executable and the arguments.
-   *
-   * Use [environment] to set the environment variables for the process. If not
-   * set the environment of the parent process is inherited. Currently, only
-   * US-ASCII environment variables are supported and errors are likely to occur
-   * if an environment variable with code-points outside the US-ASCII range is
-   * passed in.
-   *
-   * If [includeParentEnvironment] is `true`, the process's environment will
-   * include the parent process's environment, with [environment] taking
-   * precedence. Default is `true`.
-   *
-   * If [runInShell] is true, the process will be spawned through a system
-   * shell. On Linux and OS X, `/bin/sh` is used, while
-   * `%WINDIR%\system32\cmd.exe` is used on Windows.
-   *
-   * The encoding used for decoding `stdout` and `stderr` into text is
-   * controlled through [stdoutEncoding] and [stderrEncoding]. The
-   * default encoding is [systemEncoding]. If `null` is used no
-   * decoding will happen and the [ProcessResult] will hold binary
-   * data.
-   *
-   * Returns a `Future<ProcessResult>` that completes with the
-   * result of running the process, i.e., exit code, standard out and
-   * standard in.
-   *
-   * The following code uses `Process.run` to grep for `main` in the
-   * file `test.dart` on Linux.
-   *
-   *     Process.run('grep', ['-i', 'main', 'test.dart']).then((result) {
-   *       stdout.write(result.stdout);
-   *       stderr.write(result.stderr);
-   *     });
-   */
-  external static Future<ProcessResult> run(
-      String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      Encoding? stdoutEncoding: systemEncoding,
-      Encoding? stderrEncoding: systemEncoding});
-
-  /**
-   * Starts a process and runs it to completion. This is a synchronous
-   * call and will block until the child process terminates.
-   *
-   * The arguments are the same as for `Process.run`.
-   *
-   * Returns a `ProcessResult` with the result of running the process,
-   * i.e., exit code, standard out and standard in.
-   */
-  external static ProcessResult runSync(
-      String executable, List<String> arguments,
-      {String? workingDirectory,
-      Map<String, String>? environment,
-      bool includeParentEnvironment: true,
-      bool runInShell: false,
-      Encoding? stdoutEncoding: systemEncoding,
-      Encoding? stderrEncoding: systemEncoding});
-
-  /**
-   * Kills the process with id [pid].
-   *
-   * Where possible, sends the [signal] to the process with id
-   * `pid`. This includes Linux and OS X. The default signal is
-   * [ProcessSignal.sigterm] which will normally terminate the
-   * process.
-   *
-   * On platforms without signal support, including Windows, the call
-   * just terminates the process with id `pid` in a platform specific
-   * way, and the `signal` parameter is ignored.
-   *
-   * Returns `true` if the signal is successfully delivered to the
-   * process. Otherwise the signal could not be sent, usually meaning
-   * that the process is already dead.
-   */
-  external static bool killPid(int pid,
-      [ProcessSignal signal = ProcessSignal.sigterm]);
-
-  /**
-   * Returns the standard output stream of the process as a [:Stream:].
-   */
-  Stream<List<int>> get stdout;
-
-  /**
-   * Returns the standard error stream of the process as a [:Stream:].
-   */
-  Stream<List<int>> get stderr;
-
-  /**
-   * Returns the standard input stream of the process as an [IOSink].
-   */
-  IOSink get stdin;
-
-  /**
-   * Returns the process id of the process.
-   */
-  int get pid;
-
-  /**
-   * Kills the process.
-   *
-   * Where possible, sends the [signal] to the process. This includes
-   * Linux and OS X. The default signal is [ProcessSignal.sigterm]
-   * which will normally terminate the process.
-   *
-   * On platforms without signal support, including Windows, the call
-   * just terminates the process in a platform specific way, and the
-   * `signal` parameter is ignored.
-   *
-   * Returns `true` if the signal is successfully delivered to the
-   * process. Otherwise the signal could not be sent, usually meaning
-   * that the process is already dead.
-   */
-  bool kill([ProcessSignal signal = ProcessSignal.sigterm]);
-}
-
-/**
- * [ProcessResult] represents the result of running a non-interactive
- * process started with [Process.run] or [Process.runSync].
- */
-class ProcessResult {
-  /**
-   * Exit code for the process.
-   *
-   * See [Process.exitCode] for more information in the exit code
-   * value.
-   */
-  final int exitCode;
-
-  /**
-   * Standard output from the process. The value used for the
-   * `stdoutEncoding` argument to `Process.run` determines the type. If
-   * `null` was used this value is of type `List<int>` otherwise it is
-   * of type `String`.
-   */
-  final stdout;
-
-  /**
-   * Standard error from the process. The value used for the
-   * `stderrEncoding` argument to `Process.run` determines the type. If
-   * `null` was used this value is of type `List<int>`
-   * otherwise it is of type `String`.
-   */
-  final stderr;
-
-  /**
-   * Process id of the process.
-   */
-  final int pid;
-
-  ProcessResult(this.pid, this.exitCode, this.stdout, this.stderr);
-}
-
-/**
- * On Posix systems, [ProcessSignal] is used to send a specific signal
- * to a child process, see [:Process.kill:].
- *
- * Some [ProcessSignal]s can also be watched, as a way to intercept the default
- * signal handler and implement another. See [ProcessSignal.watch] for more
- * information.
- */
-class ProcessSignal {
-  static const ProcessSignal sighup = const ProcessSignal._(1, "SIGHUP");
-  static const ProcessSignal sigint = const ProcessSignal._(2, "SIGINT");
-  static const ProcessSignal sigquit = const ProcessSignal._(3, "SIGQUIT");
-  static const ProcessSignal sigill = const ProcessSignal._(4, "SIGILL");
-  static const ProcessSignal sigtrap = const ProcessSignal._(5, "SIGTRAP");
-  static const ProcessSignal sigabrt = const ProcessSignal._(6, "SIGABRT");
-  static const ProcessSignal sigbus = const ProcessSignal._(7, "SIGBUS");
-  static const ProcessSignal sigfpe = const ProcessSignal._(8, "SIGFPE");
-  static const ProcessSignal sigkill = const ProcessSignal._(9, "SIGKILL");
-  static const ProcessSignal sigusr1 = const ProcessSignal._(10, "SIGUSR1");
-  static const ProcessSignal sigsegv = const ProcessSignal._(11, "SIGSEGV");
-  static const ProcessSignal sigusr2 = const ProcessSignal._(12, "SIGUSR2");
-  static const ProcessSignal sigpipe = const ProcessSignal._(13, "SIGPIPE");
-  static const ProcessSignal sigalrm = const ProcessSignal._(14, "SIGALRM");
-  static const ProcessSignal sigterm = const ProcessSignal._(15, "SIGTERM");
-  static const ProcessSignal sigchld = const ProcessSignal._(17, "SIGCHLD");
-  static const ProcessSignal sigcont = const ProcessSignal._(18, "SIGCONT");
-  static const ProcessSignal sigstop = const ProcessSignal._(19, "SIGSTOP");
-  static const ProcessSignal sigtstp = const ProcessSignal._(20, "SIGTSTP");
-  static const ProcessSignal sigttin = const ProcessSignal._(21, "SIGTTIN");
-  static const ProcessSignal sigttou = const ProcessSignal._(22, "SIGTTOU");
-  static const ProcessSignal sigurg = const ProcessSignal._(23, "SIGURG");
-  static const ProcessSignal sigxcpu = const ProcessSignal._(24, "SIGXCPU");
-  static const ProcessSignal sigxfsz = const ProcessSignal._(25, "SIGXFSZ");
-  static const ProcessSignal sigvtalrm = const ProcessSignal._(26, "SIGVTALRM");
-  static const ProcessSignal sigprof = const ProcessSignal._(27, "SIGPROF");
-  static const ProcessSignal sigwinch = const ProcessSignal._(28, "SIGWINCH");
-  static const ProcessSignal sigpoll = const ProcessSignal._(29, "SIGPOLL");
-  static const ProcessSignal sigsys = const ProcessSignal._(31, "SIGSYS");
-
-  @Deprecated("Use sighup instead")
-  static const ProcessSignal SIGHUP = sighup;
-  @Deprecated("Use sigint instead")
-  static const ProcessSignal SIGINT = sigint;
-  @Deprecated("Use sigquit instead")
-  static const ProcessSignal SIGQUIT = sigquit;
-  @Deprecated("Use sigill instead")
-  static const ProcessSignal SIGILL = sigill;
-  @Deprecated("Use sigtrap instead")
-  static const ProcessSignal SIGTRAP = sigtrap;
-  @Deprecated("Use sigabrt instead")
-  static const ProcessSignal SIGABRT = sigabrt;
-  @Deprecated("Use sigbus instead")
-  static const ProcessSignal SIGBUS = sigbus;
-  @Deprecated("Use sigfpe instead")
-  static const ProcessSignal SIGFPE = sigfpe;
-  @Deprecated("Use sigkill instead")
-  static const ProcessSignal SIGKILL = sigkill;
-  @Deprecated("Use sigusr1 instead")
-  static const ProcessSignal SIGUSR1 = sigusr1;
-  @Deprecated("Use sigsegv instead")
-  static const ProcessSignal SIGSEGV = sigsegv;
-  @Deprecated("Use sigusr2 instead")
-  static const ProcessSignal SIGUSR2 = sigusr2;
-  @Deprecated("Use sigpipe instead")
-  static const ProcessSignal SIGPIPE = sigpipe;
-  @Deprecated("Use sigalrm instead")
-  static const ProcessSignal SIGALRM = sigalrm;
-  @Deprecated("Use sigterm instead")
-  static const ProcessSignal SIGTERM = sigterm;
-  @Deprecated("Use sigchld instead")
-  static const ProcessSignal SIGCHLD = sigchld;
-  @Deprecated("Use sigcont instead")
-  static const ProcessSignal SIGCONT = sigcont;
-  @Deprecated("Use sigstop instead")
-  static const ProcessSignal SIGSTOP = sigstop;
-  @Deprecated("Use sigtstp instead")
-  static const ProcessSignal SIGTSTP = sigtstp;
-  @Deprecated("Use sigttin instead")
-  static const ProcessSignal SIGTTIN = sigttin;
-  @Deprecated("Use sigttou instead")
-  static const ProcessSignal SIGTTOU = sigttou;
-  @Deprecated("Use sigurg instead")
-  static const ProcessSignal SIGURG = sigurg;
-  @Deprecated("Use sigxcpu instead")
-  static const ProcessSignal SIGXCPU = sigxcpu;
-  @Deprecated("Use sigxfsz instead")
-  static const ProcessSignal SIGXFSZ = sigxfsz;
-  @Deprecated("Use sigvtalrm instead")
-  static const ProcessSignal SIGVTALRM = sigvtalrm;
-  @Deprecated("Use sigprof instead")
-  static const ProcessSignal SIGPROF = sigprof;
-  @Deprecated("Use sigwinch instead")
-  static const ProcessSignal SIGWINCH = sigwinch;
-  @Deprecated("Use sigpoll instead")
-  static const ProcessSignal SIGPOLL = sigpoll;
-  @Deprecated("Use sigsys instead")
-  static const ProcessSignal SIGSYS = sigsys;
-
-  final int _signalNumber;
-  final String _name;
-
-  const ProcessSignal._(this._signalNumber, this._name);
-
-  String toString() => _name;
-
-  /**
-   * Watch for process signals.
-   *
-   * The following [ProcessSignal]s can be listened to:
-   *
-   *   * [ProcessSignal.sighup].
-   *   * [ProcessSignal.sigint]. Signal sent by e.g. CTRL-C.
-   *   * [ProcessSignal.sigterm]. Not available on Windows.
-   *   * [ProcessSignal.sigusr1]. Not available on Windows.
-   *   * [ProcessSignal.sigusr2]. Not available on Windows.
-   *   * [ProcessSignal.sigwinch]. Not available on Windows.
-   *
-   * Other signals are disallowed, as they may be used by the VM.
-   *
-   * A signal can be watched multiple times, from multiple isolates, where all
-   * callbacks are invoked when signaled, in no specific order.
-   */
-  Stream<ProcessSignal> watch() => _ProcessUtils._watchSignal(this);
-}
-
-class SignalException implements IOException {
-  final String message;
-  final osError;
-
-  const SignalException(this.message, [this.osError]);
-
-  String toString() {
-    var msg = "";
-    if (osError != null) {
-      msg = ", osError: $osError";
-    }
-    return "SignalException: $message$msg";
-  }
-}
-
-class ProcessException implements IOException {
-  /**
-   * Contains the executable provided for the process.
-   */
-  final String executable;
-
-  /**
-   * Contains the arguments provided for the process.
-   */
-  final List<String> arguments;
-
-  /**
-   * Contains the system message for the process exception if any.
-   */
-  final String message;
-
-  /**
-   * Contains the OS error code for the process exception if any.
-   */
-  final int errorCode;
-
-  const ProcessException(this.executable, this.arguments,
-      [this.message = "", this.errorCode = 0]);
-  String toString() {
-    var args = arguments.join(' ');
-    return "ProcessException: $message\n  Command: $executable $args";
-  }
-}
diff --git a/sdk_nnbd/lib/io/secure_server_socket.dart b/sdk_nnbd/lib/io/secure_server_socket.dart
deleted file mode 100644
index dbdcc28..0000000
--- a/sdk_nnbd/lib/io/secure_server_socket.dart
+++ /dev/null
@@ -1,287 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.io;
-
-/**
- * The [SecureServerSocket] is a server socket, providing a stream of high-level
- * [Socket]s.
- *
- * See [SecureSocket] for more info.
- */
-class SecureServerSocket extends Stream<SecureSocket> {
-  final RawSecureServerSocket _socket;
-
-  SecureServerSocket._(this._socket);
-
-  /**
-   * Returns a future for a [SecureServerSocket]. When the future
-   * completes the server socket is bound to the given [address] and
-   * [port] and has started listening on it.
-   *
-   * The [address] can either be a [String] or an
-   * [InternetAddress]. If [address] is a [String], [bind] will
-   * perform a [InternetAddress.lookup] and use the first value in the
-   * list. To listen on the loopback adapter, which will allow only
-   * incoming connections from the local host, use the value
-   * [InternetAddress.loopbackIPv4] or
-   * [InternetAddress.loopbackIPv6]. To allow for incoming
-   * connection from the network use either one of the values
-   * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
-   * bind to all interfaces or the IP address of a specific interface.
-   *
-   * If [port] has the value [:0:] an ephemeral port will be chosen by
-   * the system. The actual port used can be retrieved using the
-   * [port] getter.
-   *
-   * The optional argument [backlog] can be used to specify the listen
-   * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of [:0:] (the default) a reasonable value will be chosen by
-   * the system.
-   *
-   * Incoming client connections are promoted to secure connections, using
-   * the server certificate and key set in [context].
-   *
-   * [address] must be given as a numeric address, not a host name.
-   *
-   * To request or require that clients authenticate by providing an SSL (TLS)
-   * client certificate, set the optional parameter [requestClientCertificate]
-   * or [requireClientCertificate] to true.  Requiring a certificate implies
-   * requesting a certificate, so setting both is redundant.
-   * To check whether a client certificate was received, check
-   * SecureSocket.peerCertificate after connecting.  If no certificate
-   * was received, the result will be null.
-   *
-   * [supportedProtocols] is an optional list of protocols (in decreasing
-   * order of preference) to use during the ALPN protocol negogiation with
-   * clients.  Example values are "http/1.1" or "h2".  The selected protocol
-   * can be obtained via [SecureSocket.selectedProtocol].
-   *
-   * The optional argument [shared] specifies whether additional
-   * SecureServerSocket objects can bind to the same combination of `address`,
-   * `port` and `v6Only`.  If `shared` is `true` and more `SecureServerSocket`s
-   * from this isolate or other isolates are bound to the port, then the
-   * incoming connections will be distributed among all the bound
-   * `SecureServerSocket`s. Connections can be distributed over multiple
-   * isolates this way.
-   */
-  static Future<SecureServerSocket> bind(
-      address, int port, SecurityContext? context,
-      {int backlog: 0,
-      bool v6Only: false,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false,
-      List<String>? supportedProtocols,
-      bool shared: false}) {
-    return RawSecureServerSocket.bind(address, port, context,
-            backlog: backlog,
-            v6Only: v6Only,
-            requestClientCertificate: requestClientCertificate,
-            requireClientCertificate: requireClientCertificate,
-            supportedProtocols: supportedProtocols,
-            shared: shared)
-        .then((serverSocket) => new SecureServerSocket._(serverSocket));
-  }
-
-  StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _socket.map((rawSocket) => new SecureSocket._(rawSocket)).listen(
-        onData,
-        onError: onError,
-        onDone: onDone,
-        cancelOnError: cancelOnError);
-  }
-
-  /**
-   * Returns the port used by this socket.
-   */
-  int get port => _socket.port;
-
-  /**
-   * Returns the address used by this socket.
-   */
-  InternetAddress get address => _socket.address;
-
-  /**
-   * Closes the socket. The returned future completes when the socket
-   * is fully closed and is no longer bound.
-   */
-  Future<SecureServerSocket> close() => _socket.close().then((_) => this);
-
-  void set _owner(owner) {
-    _socket._owner = owner;
-  }
-}
-
-/**
- * The RawSecureServerSocket is a server socket, providing a stream of low-level
- * [RawSecureSocket]s.
- *
- * See [RawSecureSocket] for more info.
- */
-class RawSecureServerSocket extends Stream<RawSecureSocket> {
-  final RawServerSocket _socket;
-  late StreamController<RawSecureSocket> _controller;
-  StreamSubscription<RawSocket>? _subscription;
-  final SecurityContext? _context;
-  final bool requestClientCertificate;
-  final bool requireClientCertificate;
-  final List<String>? supportedProtocols;
-  bool _closed = false;
-
-  RawSecureServerSocket._(
-      this._socket,
-      this._context,
-      this.requestClientCertificate,
-      this.requireClientCertificate,
-      this.supportedProtocols) {
-    _controller = new StreamController<RawSecureSocket>(
-        sync: true,
-        onListen: _onSubscriptionStateChange,
-        onPause: _onPauseStateChange,
-        onResume: _onPauseStateChange,
-        onCancel: _onSubscriptionStateChange);
-  }
-
-  /**
-   * Returns a future for a [RawSecureServerSocket]. When the future
-   * completes the server socket is bound to the given [address] and
-   * [port] and has started listening on it.
-   *
-   * The [address] can either be a [String] or an
-   * [InternetAddress]. If [address] is a [String], [bind] will
-   * perform a [InternetAddress.lookup] and use the first value in the
-   * list. To listen on the loopback adapter, which will allow only
-   * incoming connections from the local host, use the value
-   * [InternetAddress.loopbackIPv4] or
-   * [InternetAddress.loopbackIPv6]. To allow for incoming
-   * connection from the network use either one of the values
-   * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
-   * bind to all interfaces or the IP address of a specific interface.
-   *
-   * If [port] has the value [:0:] an ephemeral port will be chosen by
-   * the system. The actual port used can be retrieved using the
-   * [port] getter.
-   *
-   * The optional argument [backlog] can be used to specify the listen
-   * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of [:0:] (the default) a reasonable value will be chosen by
-   * the system.
-   *
-   * Incoming client connections are promoted to secure connections,
-   * using the server certificate and key set in [context].
-   *
-   * [address] must be given as a numeric address, not a host name.
-   *
-   * To request or require that clients authenticate by providing an SSL (TLS)
-   * client certificate, set the optional parameters requestClientCertificate or
-   * requireClientCertificate to true.  Require implies request, so one doesn't
-   * need to specify both.  To check whether a client certificate was received,
-   * check SecureSocket.peerCertificate after connecting.  If no certificate
-   * was received, the result will be null.
-   *
-   * [supportedProtocols] is an optional list of protocols (in decreasing
-   * order of preference) to use during the ALPN protocol negotiation with
-   * clients.  Example values are "http/1.1" or "h2".  The selected protocol
-   * can be obtained via [RawSecureSocket.selectedProtocol].
-   *
-   * The optional argument [shared] specifies whether additional
-   * RawSecureServerSocket objects can bind to the same combination of
-   * `address`, `port` and `v6Only`.  If `shared` is `true` and more
-   * `RawSecureServerSocket`s from this isolate or other isolates are bound to
-   * the port, then the incoming connections will be distributed among all the
-   * bound `RawSecureServerSocket`s. Connections can be distributed over
-   * multiple isolates this way.
-   */
-  static Future<RawSecureServerSocket> bind(
-      address, int port, SecurityContext? context,
-      {int backlog: 0,
-      bool v6Only: false,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false,
-      List<String>? supportedProtocols,
-      bool shared: false}) {
-    return RawServerSocket.bind(address, port,
-            backlog: backlog, v6Only: v6Only, shared: shared)
-        .then((serverSocket) => new RawSecureServerSocket._(
-            serverSocket,
-            context,
-            requestClientCertificate,
-            requireClientCertificate,
-            supportedProtocols));
-  }
-
-  StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  /**
-   * Returns the port used by this socket.
-   */
-  int get port => _socket.port;
-
-  /**
-   * Returns the address used by this socket.
-   */
-  InternetAddress get address => _socket.address;
-
-  /**
-   * Closes the socket. The returned future completes when the socket
-   * is fully closed and is no longer bound.
-   */
-  Future<RawSecureServerSocket> close() {
-    _closed = true;
-    return _socket.close().then((_) => this);
-  }
-
-  void _onData(RawSocket connection) {
-    var remotePort;
-    try {
-      remotePort = connection.remotePort;
-    } catch (e) {
-      // If connection is already closed, remotePort throws an exception.
-      // Do nothing - connection is closed.
-      return;
-    }
-    _RawSecureSocket.connect(connection.address, remotePort, true, connection,
-            context: _context,
-            requestClientCertificate: requestClientCertificate,
-            requireClientCertificate: requireClientCertificate,
-            supportedProtocols: supportedProtocols)
-        .then((RawSecureSocket secureConnection) {
-      if (_closed) {
-        secureConnection.close();
-      } else {
-        _controller.add(secureConnection);
-      }
-    }).catchError((e, s) {
-      if (!_closed) {
-        _controller.addError(e, s);
-      }
-    });
-  }
-
-  void _onPauseStateChange() {
-    if (_controller.isPaused) {
-      _subscription!.pause();
-    } else {
-      _subscription!.resume();
-    }
-  }
-
-  void _onSubscriptionStateChange() {
-    if (_controller.hasListener) {
-      _subscription = _socket.listen(_onData,
-          onError: _controller.addError, onDone: _controller.close);
-    } else {
-      close();
-    }
-  }
-
-  void set _owner(owner) {
-    (_socket as dynamic)._owner = owner;
-  }
-}
diff --git a/sdk_nnbd/lib/io/secure_socket.dart b/sdk_nnbd/lib/io/secure_socket.dart
deleted file mode 100644
index 08e9bf7..0000000
--- a/sdk_nnbd/lib/io/secure_socket.dart
+++ /dev/null
@@ -1,1306 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * A high-level class for communicating securely over a TCP socket, using
- * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an
- * [IOSink] interface, making it ideal for using together with
- * other [Stream]s.
- */
-abstract class SecureSocket implements Socket {
-  external factory SecureSocket._(RawSecureSocket rawSocket);
-
-  /**
-   * Constructs a new secure client socket and connects it to the given
-   * [host] on port [port]. The returned Future will complete with a
-   * [SecureSocket] that is connected and ready for subscription.
-   *
-   * The certificate provided by the server is checked
-   * using the trusted certificates set in the SecurityContext object.
-   * The default SecurityContext object contains a built-in set of trusted
-   * root certificates for well-known certificate authorities.
-   *
-   * [onBadCertificate] is an optional handler for unverifiable certificates.
-   * The handler receives the [X509Certificate], and can inspect it and
-   * decide (or let the user decide) whether to accept
-   * the connection or not.  The handler should return true
-   * to continue the [SecureSocket] connection.
-   *
-   * [supportedProtocols] is an optional list of protocols (in decreasing
-   * order of preference) to use during the ALPN protocol negotiation with the
-   * server.  Example values are "http/1.1" or "h2".  The selected protocol
-   * can be obtained via [SecureSocket.selectedProtocol].
-   *
-   * The argument [timeout] is used to specify the maximum allowed time to wait
-   * for a connection to be established. If [timeout] is longer than the system
-   * level timeout duration, a timeout may occur sooner than specified in
-   * [timeout]. On timeout, a [SocketException] is thrown and all ongoing
-   * connection attempts to [host] are cancelled.
-
-   */
-  static Future<SecureSocket> connect(host, int port,
-      {SecurityContext? context,
-      bool onBadCertificate(X509Certificate certificate)?,
-      List<String>? supportedProtocols,
-      Duration? timeout}) {
-    return RawSecureSocket.connect(host, port,
-            context: context,
-            onBadCertificate: onBadCertificate,
-            supportedProtocols: supportedProtocols,
-            timeout: timeout)
-        .then((rawSocket) => new SecureSocket._(rawSocket));
-  }
-
-  /// Like [connect], but returns a [Future] that completes with a
-  /// [ConnectionTask] that can be cancelled if the [SecureSocket] is no
-  /// longer needed.
-  static Future<ConnectionTask<SecureSocket>> startConnect(host, int port,
-      {SecurityContext? context,
-      bool onBadCertificate(X509Certificate certificate)?,
-      List<String>? supportedProtocols}) {
-    return RawSecureSocket.startConnect(host, port,
-            context: context,
-            onBadCertificate: onBadCertificate,
-            supportedProtocols: supportedProtocols)
-        .then((rawState) {
-      Future<SecureSocket> socket =
-          rawState.socket.then((rawSocket) => new SecureSocket._(rawSocket));
-      return new ConnectionTask<SecureSocket>._(socket, rawState._onCancel);
-    });
-  }
-
-  /**
-   * Takes an already connected [socket] and starts client side TLS
-   * handshake to make the communication secure. When the returned
-   * future completes the [SecureSocket] has completed the TLS
-   * handshake. Using this function requires that the other end of the
-   * connection is prepared for TLS handshake.
-   *
-   * If the [socket] already has a subscription, this subscription
-   * will no longer receive and events. In most cases calling
-   * `pause` on this subscription before starting TLS handshake is
-   * the right thing to do.
-   *
-   * The given [socket] is closed and may not be used anymore.
-   *
-   * If the [host] argument is passed it will be used as the host name
-   * for the TLS handshake. If [host] is not passed the host name from
-   * the [socket] will be used. The [host] can be either a [String] or
-   * an [InternetAddress].
-   *
-   * [supportedProtocols] is an optional list of protocols (in decreasing
-   * order of preference) to use during the ALPN protocol negotiation with the
-   * server.  Example values are "http/1.1" or "h2".  The selected protocol
-   * can be obtained via [SecureSocket.selectedProtocol].
-   *
-   * Calling this function will _not_ cause a DNS host lookup. If the
-   * [host] passed is a [String] the [InternetAddress] for the
-   * resulting [SecureSocket] will have the passed in [host] as its
-   * host value and the internet address of the already connected
-   * socket as its address value.
-   *
-   * See [connect] for more information on the arguments.
-   *
-   */
-  static Future<SecureSocket> secure(Socket socket,
-      {host,
-      SecurityContext? context,
-      bool onBadCertificate(X509Certificate certificate)?,
-      @Since("2.6") List<String>? supportedProtocols}) {
-    return ((socket as dynamic /*_Socket*/)._detachRaw() as Future)
-        .then<RawSecureSocket>((detachedRaw) {
-      return RawSecureSocket.secure(detachedRaw[0] as RawSocket,
-          subscription: detachedRaw[1] as StreamSubscription<RawSocketEvent>?,
-          host: host,
-          context: context,
-          onBadCertificate: onBadCertificate,
-          supportedProtocols: supportedProtocols);
-    }).then<SecureSocket>((raw) => new SecureSocket._(raw));
-  }
-
-  /**
-   * Takes an already connected [socket] and starts server side TLS
-   * handshake to make the communication secure. When the returned
-   * future completes the [SecureSocket] has completed the TLS
-   * handshake. Using this function requires that the other end of the
-   * connection is going to start the TLS handshake.
-   *
-   * If the [socket] already has a subscription, this subscription
-   * will no longer receive and events. In most cases calling
-   * [:pause:] on this subscription before starting TLS handshake is
-   * the right thing to do.
-   *
-   * If some of the data of the TLS handshake has already been read
-   * from the socket this data can be passed in the [bufferedData]
-   * parameter. This data will be processed before any other data
-   * available on the socket.
-   *
-   * See [SecureServerSocket.bind] for more information on the
-   * arguments.
-   *
-   */
-  static Future<SecureSocket> secureServer(
-      Socket socket, SecurityContext? context,
-      {List<int>? bufferedData,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false,
-      List<String>? supportedProtocols}) {
-    return ((socket as dynamic /*_Socket*/)._detachRaw() as Future)
-        .then<RawSecureSocket>((detachedRaw) {
-      return RawSecureSocket.secureServer(detachedRaw[0] as RawSocket, context,
-          subscription: detachedRaw[1] as StreamSubscription<RawSocketEvent>?,
-          bufferedData: bufferedData,
-          requestClientCertificate: requestClientCertificate,
-          requireClientCertificate: requireClientCertificate,
-          supportedProtocols: supportedProtocols);
-    }).then<SecureSocket>((raw) => new SecureSocket._(raw));
-  }
-
-  /**
-   * Get the peer certificate for a connected SecureSocket.  If this
-   * SecureSocket is the server end of a secure socket connection,
-   * [peerCertificate] will return the client certificate, or null, if no
-   * client certificate was received.  If it is the client end,
-   * [peerCertificate] will return the server's certificate.
-   */
-  X509Certificate? get peerCertificate;
-
-  /**
-   * The protocol which was selected during ALPN protocol negotiation.
-   *
-   * Returns null if one of the peers does not have support for ALPN, did not
-   * specify a list of supported ALPN protocols or there was no common
-   * protocol between client and server.
-   */
-  String? get selectedProtocol;
-
-  /**
-   * Renegotiate an existing secure connection, renewing the session keys
-   * and possibly changing the connection properties.
-   *
-   * This repeats the SSL or TLS handshake, with options that allow clearing
-   * the session cache and requesting a client certificate.
-   */
-  void renegotiate(
-      {bool useSessionCache: true,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false});
-}
-
-/**
- * RawSecureSocket provides a secure (SSL or TLS) network connection.
- * Client connections to a server are provided by calling
- * RawSecureSocket.connect.  A secure server, created with
- * [RawSecureServerSocket], also returns RawSecureSocket objects representing
- * the server end of a secure connection.
- * The certificate provided by the server is checked
- * using the trusted certificates set in the SecurityContext object.
- * The default [SecurityContext] object contains a built-in set of trusted
- * root certificates for well-known certificate authorities.
- */
-abstract class RawSecureSocket implements RawSocket {
-  /**
-   * Constructs a new secure client socket and connect it to the given
-   * host on the given port. The returned [Future] is completed with the
-   * RawSecureSocket when it is connected and ready for subscription.
-   *
-   * The certificate provided by the server is checked using the trusted
-   * certificates set in the SecurityContext object If a certificate and key are
-   * set on the client, using [SecurityContext.useCertificateChain] and
-   * [SecurityContext.usePrivateKey], and the server asks for a client
-   * certificate, then that client certificate is sent to the server.
-   *
-   * [onBadCertificate] is an optional handler for unverifiable certificates.
-   * The handler receives the [X509Certificate], and can inspect it and
-   * decide (or let the user decide) whether to accept
-   * the connection or not.  The handler should return true
-   * to continue the [RawSecureSocket] connection.
-   *
-   * [supportedProtocols] is an optional list of protocols (in decreasing
-   * order of preference) to use during the ALPN protocol negotiation with the
-   * server.  Example values are "http/1.1" or "h2".  The selected protocol
-   * can be obtained via [RawSecureSocket.selectedProtocol].
-   */
-  static Future<RawSecureSocket> connect(host, int port,
-      {SecurityContext? context,
-      bool onBadCertificate(X509Certificate certificate)?,
-      List<String>? supportedProtocols,
-      Duration? timeout}) {
-    _RawSecureSocket._verifyFields(host, port, false, false);
-    return RawSocket.connect(host, port, timeout: timeout).then((socket) {
-      return secure(socket,
-          context: context,
-          onBadCertificate: onBadCertificate,
-          supportedProtocols: supportedProtocols);
-    });
-  }
-
-  /// Like [connect], but returns a [Future] that completes with a
-  /// [ConnectionTask] that can be cancelled if the [RawSecureSocket] is no
-  /// longer needed.
-  static Future<ConnectionTask<RawSecureSocket>> startConnect(host, int port,
-      {SecurityContext? context,
-      bool onBadCertificate(X509Certificate certificate)?,
-      List<String>? supportedProtocols}) {
-    return RawSocket.startConnect(host, port)
-        .then((ConnectionTask<RawSocket> rawState) {
-      Future<RawSecureSocket> socket = rawState.socket.then((rawSocket) {
-        return secure(rawSocket,
-            context: context,
-            onBadCertificate: onBadCertificate,
-            supportedProtocols: supportedProtocols);
-      });
-      return new ConnectionTask<RawSecureSocket>._(socket, rawState._onCancel);
-    });
-  }
-
-  /**
-   * Takes an already connected [socket] and starts client side TLS
-   * handshake to make the communication secure. When the returned
-   * future completes the [RawSecureSocket] has completed the TLS
-   * handshake. Using this function requires that the other end of the
-   * connection is prepared for TLS handshake.
-   *
-   * If the [socket] already has a subscription, pass the existing
-   * subscription in the [subscription] parameter. The [secure]
-   * operation will take over the subscription by replacing the
-   * handlers with it own secure processing. The caller must not touch
-   * this subscription anymore. Passing a paused subscription is an
-   * error.
-   *
-   * If the [host] argument is passed it will be used as the host name
-   * for the TLS handshake. If [host] is not passed the host name from
-   * the [socket] will be used. The [host] can be either a [String] or
-   * an [InternetAddress].
-   *
-   * [supportedProtocols] is an optional list of protocols (in decreasing
-   * order of preference) to use during the ALPN protocol negotiation with the
-   * server.  Example values are "http/1.1" or "h2".  The selected protocol
-   * can be obtained via [SecureSocket.selectedProtocol].
-   *
-   * Calling this function will _not_ cause a DNS host lookup. If the
-   * [host] passed is a [String] the [InternetAddress] for the
-   * resulting [SecureSocket] will have this passed in [host] as its
-   * host value and the internet address of the already connected
-   * socket as its address value.
-   *
-   * See [connect] for more information on the arguments.
-   *
-   */
-  static Future<RawSecureSocket> secure(RawSocket socket,
-      {StreamSubscription<RawSocketEvent>? subscription,
-      host,
-      SecurityContext? context,
-      bool onBadCertificate(X509Certificate certificate)?,
-      List<String>? supportedProtocols}) {
-    socket.readEventsEnabled = false;
-    socket.writeEventsEnabled = false;
-    return _RawSecureSocket.connect(
-        host != null ? host : socket.address.host, socket.port, false, socket,
-        subscription: subscription,
-        context: context,
-        onBadCertificate: onBadCertificate,
-        supportedProtocols: supportedProtocols);
-  }
-
-  /**
-   * Takes an already connected [socket] and starts server side TLS
-   * handshake to make the communication secure. When the returned
-   * future completes the [RawSecureSocket] has completed the TLS
-   * handshake. Using this function requires that the other end of the
-   * connection is going to start the TLS handshake.
-   *
-   * If the [socket] already has a subscription, pass the existing
-   * subscription in the [subscription] parameter. The [secureServer]
-   * operation will take over the subscription by replacing the
-   * handlers with it own secure processing. The caller must not touch
-   * this subscription anymore. Passing a paused subscription is an
-   * error.
-   *
-   * If some of the data of the TLS handshake has already been read
-   * from the socket this data can be passed in the [bufferedData]
-   * parameter. This data will be processed before any other data
-   * available on the socket.
-   *
-   * See [RawSecureServerSocket.bind] for more information on the
-   * arguments.
-   *
-   */
-  static Future<RawSecureSocket> secureServer(
-      RawSocket socket, SecurityContext? context,
-      {StreamSubscription<RawSocketEvent>? subscription,
-      List<int>? bufferedData,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false,
-      List<String>? supportedProtocols}) {
-    socket.readEventsEnabled = false;
-    socket.writeEventsEnabled = false;
-    return _RawSecureSocket.connect(
-        socket.address, socket.remotePort, true, socket,
-        context: context,
-        subscription: subscription,
-        bufferedData: bufferedData,
-        requestClientCertificate: requestClientCertificate,
-        requireClientCertificate: requireClientCertificate,
-        supportedProtocols: supportedProtocols);
-  }
-
-  /**
-   * Renegotiate an existing secure connection, renewing the session keys
-   * and possibly changing the connection properties.
-   *
-   * This repeats the SSL or TLS handshake, with options that allow clearing
-   * the session cache and requesting a client certificate.
-   */
-  void renegotiate(
-      {bool useSessionCache: true,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false});
-
-  /**
-   * Get the peer certificate for a connected RawSecureSocket.  If this
-   * RawSecureSocket is the server end of a secure socket connection,
-   * [peerCertificate] will return the client certificate, or null, if no
-   * client certificate was received.  If it is the client end,
-   * [peerCertificate] will return the server's certificate.
-   */
-  X509Certificate? get peerCertificate;
-
-  /**
-   * The protocol which was selected during protocol negotiation.
-   *
-   * Returns null if one of the peers does not have support for ALPN, did not
-   * specify a list of supported ALPN protocols or there was no common
-   * protocol between client and server.
-   */
-  String? get selectedProtocol;
-}
-
-/**
- * X509Certificate represents an SSL certificate, with accessors to
- * get the fields of the certificate.
- */
-@pragma("vm:entry-point")
-abstract class X509Certificate {
-  @pragma("vm:entry-point")
-  external factory X509Certificate._();
-
-  /// The DER encoded bytes of the certificate.
-  Uint8List get der;
-
-  /// The PEM encoded String of the certificate.
-  String get pem;
-
-  /// The SHA1 hash of the certificate.
-  Uint8List get sha1;
-
-  String get subject;
-  String get issuer;
-  DateTime get startValidity;
-  DateTime get endValidity;
-}
-
-class _FilterStatus {
-  bool progress = false; // The filter read or wrote data to the buffers.
-  bool readEmpty = true; // The read buffers and decryption filter are empty.
-  bool writeEmpty = true; // The write buffers and encryption filter are empty.
-  // These are set if a buffer changes state from empty or full.
-  bool readPlaintextNoLongerEmpty = false;
-  bool writePlaintextNoLongerFull = false;
-  bool readEncryptedNoLongerFull = false;
-  bool writeEncryptedNoLongerEmpty = false;
-
-  _FilterStatus();
-}
-
-class _RawSecureSocket extends Stream<RawSocketEvent>
-    implements RawSecureSocket {
-  // Status states
-  static const int handshakeStatus = 201;
-  static const int connectedStatus = 202;
-  static const int closedStatus = 203;
-
-  // Buffer identifiers.
-  // These must agree with those in the native C++ implementation.
-  static const int readPlaintextId = 0;
-  static const int writePlaintextId = 1;
-  static const int readEncryptedId = 2;
-  static const int writeEncryptedId = 3;
-  static const int bufferCount = 4;
-
-  // Is a buffer identifier for an encrypted buffer?
-  static bool _isBufferEncrypted(int identifier) =>
-      identifier >= readEncryptedId;
-
-  final RawSocket _socket;
-  final Completer<_RawSecureSocket> _handshakeComplete =
-      new Completer<_RawSecureSocket>();
-  final _controller = new StreamController<RawSocketEvent>(sync: true);
-  late final StreamSubscription<RawSocketEvent> _socketSubscription;
-  List<int>? _bufferedData;
-  int _bufferedDataIndex = 0;
-  final InternetAddress address;
-  final bool isServer;
-  final SecurityContext context;
-  final bool requestClientCertificate;
-  final bool requireClientCertificate;
-  final bool Function(X509Certificate certificate)? onBadCertificate;
-
-  var _status = handshakeStatus;
-  bool _writeEventsEnabled = true;
-  bool _readEventsEnabled = true;
-  int _pauseCount = 0;
-  bool _pendingReadEvent = false;
-  bool _socketClosedRead = false; // The network socket is closed for reading.
-  bool _socketClosedWrite = false; // The network socket is closed for writing.
-  bool _closedRead = false; // The secure socket has fired an onClosed event.
-  bool _closedWrite = false; // The secure socket has been closed for writing.
-  // The network socket is gone.
-  Completer<RawSecureSocket> _closeCompleter = new Completer<RawSecureSocket>();
-  _FilterStatus _filterStatus = new _FilterStatus();
-  bool _connectPending = true;
-  bool _filterPending = false;
-  bool _filterActive = false;
-
-  _SecureFilter? _secureFilter = new _SecureFilter._();
-  String? _selectedProtocol;
-
-  static Future<_RawSecureSocket> connect(
-      dynamic /*String|InternetAddress*/ host,
-      int requestedPort,
-      bool isServer,
-      RawSocket socket,
-      {SecurityContext? context,
-      StreamSubscription<RawSocketEvent>? subscription,
-      List<int>? bufferedData,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false,
-      bool onBadCertificate(X509Certificate certificate)?,
-      List<String>? supportedProtocols}) {
-    _verifyFields(host, requestedPort, requestClientCertificate,
-        requireClientCertificate);
-    if (host is InternetAddress) host = host.host;
-    InternetAddress address = socket.address;
-    if (host != null) {
-      address = InternetAddress._cloneWithNewHost(address, host);
-    }
-    return new _RawSecureSocket(
-            address,
-            requestedPort,
-            isServer,
-            context ?? SecurityContext.defaultContext,
-            socket,
-            subscription,
-            bufferedData,
-            requestClientCertificate,
-            requireClientCertificate,
-            onBadCertificate,
-            supportedProtocols)
-        ._handshakeComplete
-        .future;
-  }
-
-  _RawSecureSocket(
-      this.address,
-      int requestedPort,
-      this.isServer,
-      this.context,
-      this._socket,
-      StreamSubscription<RawSocketEvent>? subscription,
-      this._bufferedData,
-      this.requestClientCertificate,
-      this.requireClientCertificate,
-      this.onBadCertificate,
-      List<String>? supportedProtocols) {
-    _controller
-      ..onListen = _onSubscriptionStateChange
-      ..onPause = _onPauseStateChange
-      ..onResume = _onPauseStateChange
-      ..onCancel = _onSubscriptionStateChange;
-    // Throw an ArgumentError if any field is invalid.  After this, all
-    // errors will be reported through the future or the stream.
-    final secureFilter = _secureFilter!;
-    secureFilter.init();
-    secureFilter
-        .registerHandshakeCompleteCallback(_secureHandshakeCompleteHandler);
-    if (onBadCertificate != null) {
-      secureFilter.registerBadCertificateCallback(_onBadCertificateWrapper);
-    }
-    _socket.readEventsEnabled = true;
-    _socket.writeEventsEnabled = false;
-    if (subscription == null) {
-      // If a current subscription is provided use this otherwise
-      // create a new one.
-      _socketSubscription = _socket.listen(_eventDispatcher,
-          onError: _reportError, onDone: _doneHandler);
-    } else {
-      _socketSubscription = subscription;
-      if (_socketSubscription.isPaused) {
-        _socket.close();
-        throw new ArgumentError("Subscription passed to TLS upgrade is paused");
-      }
-      // If we are upgrading a socket that is already closed for read,
-      // report an error as if we received readClosed during the handshake.
-      dynamic s = _socket; // Cast to dynamic to avoid warning.
-      if (s._socket.closedReadEventSent) {
-        _eventDispatcher(RawSocketEvent.readClosed);
-      }
-      _socketSubscription
-        ..onData(_eventDispatcher)
-        ..onError(_reportError)
-        ..onDone(_doneHandler);
-    }
-    try {
-      var encodedProtocols =
-          SecurityContext._protocolsToLengthEncoding(supportedProtocols);
-      secureFilter.connect(
-          address.host,
-          context,
-          isServer,
-          requestClientCertificate || requireClientCertificate,
-          requireClientCertificate,
-          encodedProtocols);
-      _secureHandshake();
-    } catch (e, s) {
-      _reportError(e, s);
-    }
-  }
-
-  StreamSubscription<RawSocketEvent> listen(void onData(RawSocketEvent data)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    _sendWriteEvent();
-    return _controller.stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-
-  static void _verifyFields(host, int requestedPort,
-      bool requestClientCertificate, bool requireClientCertificate) {
-    if (host is! String && host is! InternetAddress) {
-      throw new ArgumentError("host is not a String or an InternetAddress");
-    }
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(requestedPort, "requestedPort");
-    if (requestedPort < 0 || requestedPort > 65535) {
-      throw ArgumentError("requestedPort is not in the range 0..65535");
-    }
-    // TODO(40614): Remove once non-nullability is sound.
-    ArgumentError.checkNotNull(
-        requestClientCertificate, "requestClientCertificate");
-    ArgumentError.checkNotNull(
-        requireClientCertificate, "requireClientCertificate");
-  }
-
-  int get port => _socket.port;
-
-  InternetAddress get remoteAddress => _socket.remoteAddress;
-
-  int get remotePort => _socket.remotePort;
-
-  void set _owner(owner) {
-    (_socket as dynamic)._owner = owner;
-  }
-
-  int available() {
-    return _status != connectedStatus
-        ? 0
-        : _secureFilter!.buffers![readPlaintextId].length;
-  }
-
-  Future<RawSecureSocket> close() {
-    shutdown(SocketDirection.both);
-    return _closeCompleter.future;
-  }
-
-  void _completeCloseCompleter([RawSocket? dummy]) {
-    if (!_closeCompleter.isCompleted) _closeCompleter.complete(this);
-  }
-
-  void _close() {
-    _closedWrite = true;
-    _closedRead = true;
-    _socket.close().then(_completeCloseCompleter);
-    _socketClosedWrite = true;
-    _socketClosedRead = true;
-    if (!_filterActive && _secureFilter != null) {
-      _secureFilter!.destroy();
-      _secureFilter = null;
-    }
-    if (_socketSubscription != null) {
-      _socketSubscription.cancel();
-    }
-    _controller.close();
-    _status = closedStatus;
-  }
-
-  void shutdown(SocketDirection direction) {
-    if (direction == SocketDirection.send ||
-        direction == SocketDirection.both) {
-      _closedWrite = true;
-      if (_filterStatus.writeEmpty) {
-        _socket.shutdown(SocketDirection.send);
-        _socketClosedWrite = true;
-        if (_closedRead) {
-          _close();
-        }
-      }
-    }
-    if (direction == SocketDirection.receive ||
-        direction == SocketDirection.both) {
-      _closedRead = true;
-      _socketClosedRead = true;
-      _socket.shutdown(SocketDirection.receive);
-      if (_socketClosedWrite) {
-        _close();
-      }
-    }
-  }
-
-  bool get writeEventsEnabled => _writeEventsEnabled;
-
-  void set writeEventsEnabled(bool value) {
-    _writeEventsEnabled = value;
-    if (value) {
-      Timer.run(() => _sendWriteEvent());
-    }
-  }
-
-  bool get readEventsEnabled => _readEventsEnabled;
-
-  void set readEventsEnabled(bool value) {
-    _readEventsEnabled = value;
-    _scheduleReadEvent();
-  }
-
-  Uint8List? read([int? length]) {
-    if (length != null && length < 0) {
-      throw new ArgumentError(
-          "Invalid length parameter in SecureSocket.read (length: $length)");
-    }
-    if (_closedRead) {
-      throw new SocketException("Reading from a closed socket");
-    }
-    if (_status != connectedStatus) {
-      return null;
-    }
-    var result = _secureFilter!.buffers![readPlaintextId].read(length);
-    _scheduleFilter();
-    return result;
-  }
-
-  static int _fixOffset(int? offset) => offset ?? 0;
-
-  // Write the data to the socket, and schedule the filter to encrypt it.
-  int write(List<int> data, [int offset = 0, int? bytes]) {
-    if (bytes != null && bytes < 0) {
-      throw new ArgumentError(
-          "Invalid bytes parameter in SecureSocket.read (bytes: $bytes)");
-    }
-    // TODO(40614): Remove once non-nullability is sound.
-    offset = _fixOffset(offset);
-    if (offset < 0) {
-      throw new ArgumentError(
-          "Invalid offset parameter in SecureSocket.read (offset: $offset)");
-    }
-    if (_closedWrite) {
-      _controller.addError(new SocketException("Writing to a closed socket"));
-      return 0;
-    }
-    if (_status != connectedStatus) return 0;
-    bytes ??= data.length - offset;
-
-    int written =
-        _secureFilter!.buffers![writePlaintextId].write(data, offset, bytes);
-    if (written > 0) {
-      _filterStatus.writeEmpty = false;
-    }
-    _scheduleFilter();
-    return written;
-  }
-
-  X509Certificate? get peerCertificate => _secureFilter!.peerCertificate;
-
-  String? get selectedProtocol => _selectedProtocol;
-
-  bool _onBadCertificateWrapper(X509Certificate certificate) {
-    if (onBadCertificate == null) return false;
-    return onBadCertificate!(certificate);
-  }
-
-  bool setOption(SocketOption option, bool enabled) {
-    return _socket.setOption(option, enabled);
-  }
-
-  Uint8List getRawOption(RawSocketOption option) {
-    return _socket.getRawOption(option);
-  }
-
-  void setRawOption(RawSocketOption option) {
-    _socket.setRawOption(option);
-  }
-
-  void _eventDispatcher(RawSocketEvent event) {
-    try {
-      if (event == RawSocketEvent.read) {
-        _readHandler();
-      } else if (event == RawSocketEvent.write) {
-        _writeHandler();
-      } else if (event == RawSocketEvent.readClosed) {
-        _closeHandler();
-      }
-    } catch (e, stackTrace) {
-      _reportError(e, stackTrace);
-    }
-  }
-
-  void _readHandler() {
-    _readSocket();
-    _scheduleFilter();
-  }
-
-  void _writeHandler() {
-    _writeSocket();
-    _scheduleFilter();
-  }
-
-  void _doneHandler() {
-    if (_filterStatus.readEmpty) {
-      _close();
-    }
-  }
-
-  void _reportError(e, [StackTrace? stackTrace]) {
-    if (_status == closedStatus) {
-      return;
-    } else if (_connectPending) {
-      // _connectPending is true until the handshake has completed, and the
-      // _handshakeComplete future returned from SecureSocket.connect has
-      // completed.  Before this point, we must complete it with an error.
-      _handshakeComplete.completeError(e, stackTrace);
-    } else {
-      _controller.addError(e, stackTrace);
-    }
-    _close();
-  }
-
-  void _closeHandler() {
-    if (_status == connectedStatus) {
-      if (_closedRead) return;
-      _socketClosedRead = true;
-      if (_filterStatus.readEmpty) {
-        _closedRead = true;
-        _controller.add(RawSocketEvent.readClosed);
-        if (_socketClosedWrite) {
-          _close();
-        }
-      } else {
-        _scheduleFilter();
-      }
-    } else if (_status == handshakeStatus) {
-      _socketClosedRead = true;
-      if (_filterStatus.readEmpty) {
-        _reportError(
-            new HandshakeException('Connection terminated during handshake'),
-            null);
-      } else {
-        _secureHandshake();
-      }
-    }
-  }
-
-  void _secureHandshake() {
-    try {
-      _secureFilter!.handshake();
-      _filterStatus.writeEmpty = false;
-      _readSocket();
-      _writeSocket();
-      _scheduleFilter();
-    } catch (e, stackTrace) {
-      _reportError(e, stackTrace);
-    }
-  }
-
-  void renegotiate(
-      {bool useSessionCache: true,
-      bool requestClientCertificate: false,
-      bool requireClientCertificate: false}) {
-    if (_status != connectedStatus) {
-      throw new HandshakeException(
-          "Called renegotiate on a non-connected socket");
-    }
-    _secureFilter!.renegotiate(
-        useSessionCache, requestClientCertificate, requireClientCertificate);
-    _status = handshakeStatus;
-    _filterStatus.writeEmpty = false;
-    _scheduleFilter();
-  }
-
-  void _secureHandshakeCompleteHandler() {
-    _status = connectedStatus;
-    if (_connectPending) {
-      _connectPending = false;
-      try {
-        _selectedProtocol = _secureFilter!.selectedProtocol();
-        // We don't want user code to run synchronously in this callback.
-        Timer.run(() => _handshakeComplete.complete(this));
-      } catch (error, stack) {
-        _handshakeComplete.completeError(error, stack);
-      }
-    }
-  }
-
-  void _onPauseStateChange() {
-    if (_controller.isPaused) {
-      _pauseCount++;
-    } else {
-      _pauseCount--;
-      if (_pauseCount == 0) {
-        _scheduleReadEvent();
-        _sendWriteEvent(); // Can send event synchronously.
-      }
-    }
-
-    if (!_socketClosedRead || !_socketClosedWrite) {
-      if (_controller.isPaused) {
-        _socketSubscription.pause();
-      } else {
-        _socketSubscription.resume();
-      }
-    }
-  }
-
-  void _onSubscriptionStateChange() {
-    if (_controller.hasListener) {
-      // TODO(ajohnsen): Do something here?
-    }
-  }
-
-  void _scheduleFilter() {
-    _filterPending = true;
-    _tryFilter();
-  }
-
-  void _tryFilter() {
-    if (_status == closedStatus) {
-      return;
-    }
-    if (_filterPending && !_filterActive) {
-      _filterActive = true;
-      _filterPending = false;
-      _pushAllFilterStages().then((status) {
-        _filterStatus = status;
-        _filterActive = false;
-        if (_status == closedStatus) {
-          _secureFilter!.destroy();
-          _secureFilter = null;
-          return;
-        }
-        _socket.readEventsEnabled = true;
-        if (_filterStatus.writeEmpty && _closedWrite && !_socketClosedWrite) {
-          // Checks for and handles all cases of partially closed sockets.
-          shutdown(SocketDirection.send);
-          if (_status == closedStatus) {
-            return;
-          }
-        }
-        if (_filterStatus.readEmpty && _socketClosedRead && !_closedRead) {
-          if (_status == handshakeStatus) {
-            _secureFilter!.handshake();
-            if (_status == handshakeStatus) {
-              throw new HandshakeException(
-                  'Connection terminated during handshake');
-            }
-          }
-          _closeHandler();
-        }
-        if (_status == closedStatus) {
-          return;
-        }
-        if (_filterStatus.progress) {
-          _filterPending = true;
-          if (_filterStatus.writeEncryptedNoLongerEmpty) {
-            _writeSocket();
-          }
-          if (_filterStatus.writePlaintextNoLongerFull) {
-            _sendWriteEvent();
-          }
-          if (_filterStatus.readEncryptedNoLongerFull) {
-            _readSocket();
-          }
-          if (_filterStatus.readPlaintextNoLongerEmpty) {
-            _scheduleReadEvent();
-          }
-          if (_status == handshakeStatus) {
-            _secureHandshake();
-          }
-        }
-        _tryFilter();
-      }).catchError(_reportError);
-    }
-  }
-
-  List<int>? _readSocketOrBufferedData(int bytes) {
-    final bufferedData = _bufferedData;
-    if (bufferedData != null) {
-      if (bytes > bufferedData.length - _bufferedDataIndex) {
-        bytes = bufferedData.length - _bufferedDataIndex;
-      }
-      var result =
-          bufferedData.sublist(_bufferedDataIndex, _bufferedDataIndex + bytes);
-      _bufferedDataIndex += bytes;
-      if (bufferedData.length == _bufferedDataIndex) {
-        _bufferedData = null;
-      }
-      return result;
-    } else if (!_socketClosedRead) {
-      return _socket.read(bytes);
-    } else {
-      return null;
-    }
-  }
-
-  void _readSocket() {
-    if (_status == closedStatus) return;
-    var buffer = _secureFilter!.buffers![readEncryptedId];
-    if (buffer.writeFromSource(_readSocketOrBufferedData) > 0) {
-      _filterStatus.readEmpty = false;
-    } else {
-      _socket.readEventsEnabled = false;
-    }
-  }
-
-  void _writeSocket() {
-    if (_socketClosedWrite) return;
-    var buffer = _secureFilter!.buffers![writeEncryptedId];
-    if (buffer.readToSocket(_socket)) {
-      // Returns true if blocked
-      _socket.writeEventsEnabled = true;
-    }
-  }
-
-  // If a read event should be sent, add it to the controller.
-  _scheduleReadEvent() {
-    if (!_pendingReadEvent &&
-        _readEventsEnabled &&
-        _pauseCount == 0 &&
-        _secureFilter != null &&
-        !_secureFilter!.buffers![readPlaintextId].isEmpty) {
-      _pendingReadEvent = true;
-      Timer.run(_sendReadEvent);
-    }
-  }
-
-  _sendReadEvent() {
-    _pendingReadEvent = false;
-    if (_status != closedStatus &&
-        _readEventsEnabled &&
-        _pauseCount == 0 &&
-        _secureFilter != null &&
-        !_secureFilter!.buffers![readPlaintextId].isEmpty) {
-      _controller.add(RawSocketEvent.read);
-      _scheduleReadEvent();
-    }
-  }
-
-  // If a write event should be sent, add it to the controller.
-  _sendWriteEvent() {
-    if (!_closedWrite &&
-        _writeEventsEnabled &&
-        _pauseCount == 0 &&
-        _secureFilter != null &&
-        _secureFilter!.buffers![writePlaintextId].free > 0) {
-      _writeEventsEnabled = false;
-      _controller.add(RawSocketEvent.write);
-    }
-  }
-
-  Future<_FilterStatus> _pushAllFilterStages() {
-    bool wasInHandshake = _status != connectedStatus;
-    List args = new List<dynamic>.filled(2 + bufferCount * 2, null);
-    args[0] = _secureFilter!._pointer();
-    args[1] = wasInHandshake;
-    var bufs = _secureFilter!.buffers!;
-    for (var i = 0; i < bufferCount; ++i) {
-      args[2 * i + 2] = bufs[i].start;
-      args[2 * i + 3] = bufs[i].end;
-    }
-
-    return _IOService._dispatch(_IOService.sslProcessFilter, args)
-        .then((response) {
-      if (response.length == 2) {
-        if (wasInHandshake) {
-          // If we're in handshake, throw a handshake error.
-          _reportError(
-              new HandshakeException('${response[1]} error ${response[0]}'),
-              null);
-        } else {
-          // If we're connected, throw a TLS error.
-          _reportError(
-              new TlsException('${response[1]} error ${response[0]}'), null);
-        }
-      }
-      int start(int index) => response[2 * index];
-      int end(int index) => response[2 * index + 1];
-
-      _FilterStatus status = new _FilterStatus();
-      // Compute writeEmpty as "write plaintext buffer and write encrypted
-      // buffer were empty when we started and are empty now".
-      status.writeEmpty = bufs[writePlaintextId].isEmpty &&
-          start(writeEncryptedId) == end(writeEncryptedId);
-      // If we were in handshake when this started, _writeEmpty may be false
-      // because the handshake wrote data after we checked.
-      if (wasInHandshake) status.writeEmpty = false;
-
-      // Compute readEmpty as "both read buffers were empty when we started
-      // and are empty now".
-      status.readEmpty = bufs[readEncryptedId].isEmpty &&
-          start(readPlaintextId) == end(readPlaintextId);
-
-      _ExternalBuffer buffer = bufs[writePlaintextId];
-      int new_start = start(writePlaintextId);
-      if (new_start != buffer.start) {
-        status.progress = true;
-        if (buffer.free == 0) {
-          status.writePlaintextNoLongerFull = true;
-        }
-        buffer.start = new_start;
-      }
-      buffer = bufs[readEncryptedId];
-      new_start = start(readEncryptedId);
-      if (new_start != buffer.start) {
-        status.progress = true;
-        if (buffer.free == 0) {
-          status.readEncryptedNoLongerFull = true;
-        }
-        buffer.start = new_start;
-      }
-      buffer = bufs[writeEncryptedId];
-      int new_end = end(writeEncryptedId);
-      if (new_end != buffer.end) {
-        status.progress = true;
-        if (buffer.length == 0) {
-          status.writeEncryptedNoLongerEmpty = true;
-        }
-        buffer.end = new_end;
-      }
-      buffer = bufs[readPlaintextId];
-      new_end = end(readPlaintextId);
-      if (new_end != buffer.end) {
-        status.progress = true;
-        if (buffer.length == 0) {
-          status.readPlaintextNoLongerEmpty = true;
-        }
-        buffer.end = new_end;
-      }
-      return status;
-    });
-  }
-}
-
-/**
- * A circular buffer backed by an external byte array.  Accessed from
- * both C++ and Dart code in an unsynchronized way, with one reading
- * and one writing.  All updates to start and end are done by Dart code.
- */
-class _ExternalBuffer {
-  // This will be an ExternalByteArray, backed by C allocated data.
-  @pragma("vm:entry-point", "set")
-  List<int>? data;
-
-  @pragma("vm:entry-point")
-  int start;
-
-  @pragma("vm:entry-point")
-  int end;
-
-  final int size;
-
-  _ExternalBuffer(int size)
-      : size = size,
-        start = size ~/ 2,
-        end = size ~/ 2;
-
-  void advanceStart(int bytes) {
-    assert(start > end || start + bytes <= end);
-    start += bytes;
-    if (start >= size) {
-      start -= size;
-      assert(start <= end);
-      assert(start < size);
-    }
-  }
-
-  void advanceEnd(int bytes) {
-    assert(start <= end || start > end + bytes);
-    end += bytes;
-    if (end >= size) {
-      end -= size;
-      assert(end < start);
-      assert(end < size);
-    }
-  }
-
-  bool get isEmpty => end == start;
-
-  int get length => start > end ? size + end - start : end - start;
-
-  int get linearLength => start > end ? size - start : end - start;
-
-  int get free => start > end ? start - end - 1 : size + start - end - 1;
-
-  int get linearFree {
-    if (start > end) return start - end - 1;
-    if (start == 0) return size - end - 1;
-    return size - end;
-  }
-
-  Uint8List? read(int? bytes) {
-    if (bytes == null) {
-      bytes = length;
-    } else {
-      bytes = min(bytes, length);
-    }
-    if (bytes == 0) return null;
-    Uint8List result = new Uint8List(bytes);
-    int bytesRead = 0;
-    // Loop over zero, one, or two linear data ranges.
-    while (bytesRead < bytes) {
-      int toRead = min(bytes - bytesRead, linearLength);
-      result.setRange(bytesRead, bytesRead + toRead, data!, start);
-      advanceStart(toRead);
-      bytesRead += toRead;
-    }
-    return result;
-  }
-
-  int write(List<int> inputData, int offset, int bytes) {
-    if (bytes > free) {
-      bytes = free;
-    }
-    int written = 0;
-    int toWrite = min(bytes, linearFree);
-    // Loop over zero, one, or two linear data ranges.
-    while (toWrite > 0) {
-      data!.setRange(end, end + toWrite, inputData, offset);
-      advanceEnd(toWrite);
-      offset += toWrite;
-      written += toWrite;
-      toWrite = min(bytes - written, linearFree);
-    }
-    return written;
-  }
-
-  int writeFromSource(List<int>? getData(int requested)) {
-    int written = 0;
-    int toWrite = linearFree;
-    // Loop over zero, one, or two linear data ranges.
-    while (toWrite > 0) {
-      // Source returns at most toWrite bytes, and it returns null when empty.
-      var inputData = getData(toWrite);
-      if (inputData == null || inputData.length == 0) break;
-      var len = inputData.length;
-      data!.setRange(end, end + len, inputData);
-      advanceEnd(len);
-      written += len;
-      toWrite = linearFree;
-    }
-    return written;
-  }
-
-  bool readToSocket(RawSocket socket) {
-    // Loop over zero, one, or two linear data ranges.
-    while (true) {
-      var toWrite = linearLength;
-      if (toWrite == 0) return false;
-      int bytes = socket.write(data!, start, toWrite);
-      advanceStart(bytes);
-      if (bytes < toWrite) {
-        // The socket has blocked while we have data to write.
-        return true;
-      }
-    }
-  }
-}
-
-abstract class _SecureFilter {
-  external factory _SecureFilter._();
-
-  void connect(
-      String hostName,
-      SecurityContext context,
-      bool isServer,
-      bool requestClientCertificate,
-      bool requireClientCertificate,
-      Uint8List protocols);
-  void destroy();
-  void handshake();
-  String? selectedProtocol();
-  void rehandshake();
-  void renegotiate(bool useSessionCache, bool requestClientCertificate,
-      bool requireClientCertificate);
-  void init();
-  X509Certificate? get peerCertificate;
-  int processBuffer(int bufferIndex);
-  void registerBadCertificateCallback(Function callback);
-  void registerHandshakeCompleteCallback(Function handshakeCompleteHandler);
-
-  // This call may cause a reference counted pointer in the native
-  // implementation to be retained. It should only be called when the resulting
-  // value is passed to the IO service through a call to dispatch().
-  int _pointer();
-
-  List<_ExternalBuffer>? get buffers;
-}
-
-/** A secure networking exception caused by a failure in the
- *  TLS/SSL protocol.
- */
-class TlsException implements IOException {
-  final String type;
-  final String message;
-  final OSError? osError;
-
-  @pragma("vm:entry-point")
-  const TlsException([String message = "", OSError? osError])
-      : this._("TlsException", message, osError);
-
-  const TlsException._(this.type, this.message, this.osError);
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write(type);
-    if (message.isNotEmpty) {
-      sb.write(": $message");
-      if (osError != null) {
-        sb.write(" ($osError)");
-      }
-    } else if (osError != null) {
-      sb.write(": $osError");
-    }
-    return sb.toString();
-  }
-}
-
-/**
- * An exception that happens in the handshake phase of establishing
- * a secure network connection.
- */
-@pragma("vm:entry-point")
-class HandshakeException extends TlsException {
-  @pragma("vm:entry-point")
-  const HandshakeException([String message = "", OSError? osError])
-      : super._("HandshakeException", message, osError);
-}
-
-/**
- * An exception that happens in the handshake phase of establishing
- * a secure network connection, when looking up or verifying a
- * certificate.
- */
-class CertificateException extends TlsException {
-  @pragma("vm:entry-point")
-  const CertificateException([String message = "", OSError? osError])
-      : super._("CertificateException", message, osError);
-}
diff --git a/sdk_nnbd/lib/io/security_context.dart b/sdk_nnbd/lib/io/security_context.dart
deleted file mode 100644
index e4fd5c6..0000000
--- a/sdk_nnbd/lib/io/security_context.dart
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart.io;
-
-/**
- * The object containing the certificates to trust when making
- * a secure client connection, and the certificate chain and
- * private key to serve from a secure server.
- *
- * The [SecureSocket]  and [SecureServerSocket] classes take a SecurityContext
- * as an argument to their connect and bind methods.
- *
- * Certificates and keys can be added to a SecurityContext from either PEM
- * or PKCS12 containers.
- *
- * iOS note: Some methods to add, remove, and inspect certificates are not yet
- * implemented. However, the platform's built-in trusted certificates can
- * be used, by way of [SecurityContext.defaultContext].
- */
-abstract class SecurityContext {
-  /**
-   * Creates a new [SecurityContext].
-   *
-   * By default, the created [SecurityContext] contains no keys or certificates.
-   * These can be added by calling the methods of this class.
-   *
-   * If `withTrustedRoots` is passed as `true`, the [SecurityContext] will be
-   * seeded by the trusted root certificates provided as explained below. To
-   * obtain a [SecurityContext] containing trusted root certificates,
-   * [SecurityContext.defaultContext] is usually sufficient, and should
-   * be used instead. However, if the [SecurityContext] containing the trusted
-   * root certificates must be modified per-connection, then `withTrustedRoots`
-   * should be used.
-   */
-  external factory SecurityContext({bool withTrustedRoots: false});
-
-  /**
-   * Secure networking classes with an optional `context` parameter
-   * use the [defaultContext] object if the parameter is omitted.
-   * This object can also be accessed, and modified, directly.
-   * Each isolate has a different [defaultContext] object.
-   * The [defaultContext] object uses a list of well-known trusted
-   * certificate authorities as its trusted roots. On Linux and Windows, this
-   * list is taken from Mozilla, who maintains it as part of Firefox. On,
-   * MacOS, iOS, and Android, this list comes from the trusted certificates
-   * stores built in to the platforms.
-   */
-  external static SecurityContext get defaultContext;
-
-  /**
-   * Sets the private key for a server certificate or client certificate.
-   *
-   * A secure connection using this SecurityContext will use this key with
-   * the server or client certificate to sign and decrypt messages.
-   * [file] is the path to a PEM or PKCS12 file containing an encrypted
-   * private key, encrypted with [password]. Assuming it is well-formatted, all
-   * other contents of [file] are ignored. An unencrypted file can be used,
-   * but this is not usual.
-   *
-   * NB: This function calls [File.readAsBytesSync], and will block on file IO.
-   * Prefer using [usePrivateKeyBytes].
-   *
-   * iOS note: Only PKCS12 data is supported. It should contain both the private
-   * key and the certificate chain. On iOS one call to [usePrivateKey] with this
-   * data is used instead of two calls to [useCertificateChain] and
-   * [usePrivateKey].
-   */
-  void usePrivateKey(String file, {String? password});
-
-  /**
-   * Sets the private key for a server certificate or client certificate.
-   *
-   * Like [usePrivateKey], but takes the contents of the file as a list
-   * of bytes.
-   */
-  void usePrivateKeyBytes(List<int> keyBytes, {String? password});
-
-  /**
-   * Sets the set of trusted X509 certificates used by [SecureSocket]
-   * client connections, when connecting to a secure server.
-   *
-   * [file] is the path to a PEM or PKCS12 file containing X509 certificates,
-   * usually root certificates from certificate authorities. For PKCS12 files,
-   * [password] is the password for the file. For PEM files, [password] is
-   * ignored. Assuming it is well-formatted, all other contents of [file] are
-   * ignored.
-   *
-   * NB: This function calls [File.readAsBytesSync], and will block on file IO.
-   * Prefer using [setTrustedCertificatesBytes].
-   *
-   * iOS note: On iOS, this call takes only the bytes for a single DER
-   * encoded X509 certificate. It may be called multiple times to add
-   * multiple trusted certificates to the context. A DER encoded certificate
-   * can be obtained from a PEM encoded certificate by using the openssl tool:
-   *
-   *   $ openssl x509 -outform der -in cert.pem -out cert.der
-   */
-  void setTrustedCertificates(String file, {String? password});
-
-  /**
-   * Sets the set of trusted X509 certificates used by [SecureSocket]
-   * client connections, when connecting to a secure server.
-   *
-   * Like [setTrustedCertificates] but takes the contents of the file.
-   */
-  void setTrustedCertificatesBytes(List<int> certBytes, {String? password});
-
-  /**
-   * Sets the chain of X509 certificates served by [SecureServerSocket]
-   * when making secure connections, including the server certificate.
-   *
-   * [file] is a PEM or PKCS12 file containing X509 certificates, starting with
-   * the root authority and intermediate authorities forming the signed
-   * chain to the server certificate, and ending with the server certificate.
-   * The private key for the server certificate is set by [usePrivateKey]. For
-   * PKCS12 files, [password] is the password for the file. For PEM files,
-   * [password] is ignored. Assuming it is well-formatted, all
-   * other contents of [file] are ignored.
-   *
-   * NB: This function calls [File.readAsBytesSync], and will block on file IO.
-   * Prefer using [useCertificateChainBytes].
-   *
-   * iOS note: As noted above, [usePrivateKey] does the job of both
-   * that call and this one. On iOS, this call is a no-op.
-   */
-  void useCertificateChain(String file, {String? password});
-
-  /**
-   * Sets the chain of X509 certificates served by [SecureServerSocket]
-   * when making secure connections, including the server certificate.
-   *
-   * Like [useCertificateChain] but takes the contents of the file.
-   */
-  void useCertificateChainBytes(List<int> chainBytes, {String? password});
-
-  /**
-   * Sets the list of authority names that a [SecureServerSocket] will advertise
-   * as accepted when requesting a client certificate from a connecting
-   * client.
-   *
-   * [file] is a PEM or PKCS12 file containing the accepted signing
-   * authority certificates - the authority names are extracted from the
-   * certificates. For PKCS12 files, [password] is the password for the file.
-   * For PEM files, [password] is ignored. Assuming it is well-formatted, all
-   * other contents of [file] are ignored.
-   *
-   * NB: This function calls [File.readAsBytesSync], and will block on file IO.
-   * Prefer using [setClientAuthoritiesBytes].
-   *
-   * iOS note: This call is not supported.
-   */
-  void setClientAuthorities(String file, {String? password});
-
-  /**
-   * Sets the list of authority names that a [SecureServerSocket] will advertise
-   * as accepted, when requesting a client certificate from a connecting
-   * client.
-   *
-   * Like [setClientAuthorities] but takes the contents of the file.
-   */
-  void setClientAuthoritiesBytes(List<int> authCertBytes, {String? password});
-
-  /**
-   * Whether the platform supports ALPN. This always returns true and will be
-   * removed in a future release.
-   */
-  @deprecated
-  external static bool get alpnSupported;
-
-  /**
-   * Sets the list of application-level protocols supported by a client
-   * connection or server connection. The ALPN (application level protocol
-   * negotiation) extension to TLS allows a client to send a list of
-   * protocols in the TLS client hello message, and the server to pick
-   * one and send the selected one back in its server hello message.
-   *
-   * Separate lists of protocols can be sent for client connections and
-   * for server connections, using the same SecurityContext.  The [isServer]
-   * boolean argument specifies whether to set the list for server connections
-   * or client connections.
-   */
-  void setAlpnProtocols(List<String> protocols, bool isServer);
-
-  /// Encodes a set of supported protocols for ALPN/NPN usage.
-  ///
-  /// The `protocols` list is expected to contain protocols in descending order
-  /// of preference.
-  ///
-  /// See RFC 7301 (https://tools.ietf.org/html/rfc7301) for the encoding of
-  /// `List<String> protocols`:
-  ///     opaque ProtocolName<1..2^8-1>;
-  ///
-  ///     struct {
-  ///         ProtocolName protocol_name_list<2..2^16-1>
-  ///     } ProtocolNameList;
-  ///
-  /// The encoding of the opaque `ProtocolName<lower..upper>` vector is
-  /// described in RFC 2246: 4.3 Vectors.
-  ///
-  /// Note: Even though this encoding scheme would allow a total
-  /// `ProtocolNameList` length of 65535, this limit cannot be reached. Testing
-  /// showed that more than ~ 2^14  bytes will fail to negotiate a protocol.
-  /// We will be conservative and support only messages up to (1<<13)-1 bytes.
-  static Uint8List _protocolsToLengthEncoding(List<String>? protocols) {
-    if (protocols == null || protocols.length == 0) {
-      return new Uint8List(0);
-    }
-    int protocolsLength = protocols.length;
-
-    // Calculate the number of bytes we will need if it is ASCII.
-    int expectedLength = protocolsLength;
-    for (int i = 0; i < protocolsLength; i++) {
-      int length = protocols[i].length;
-      if (length > 0 && length <= 255) {
-        expectedLength += length;
-      } else {
-        throw new ArgumentError(
-            'Length of protocol must be between 1 and 255 (was: $length).');
-      }
-    }
-
-    if (expectedLength >= (1 << 13)) {
-      throw new ArgumentError(
-          'The maximum message length supported is 2^13-1.');
-    }
-
-    // Try encoding the `List<String> protocols` array using fast ASCII path.
-    var bytes = new Uint8List(expectedLength);
-    int bytesOffset = 0;
-    for (int i = 0; i < protocolsLength; i++) {
-      String proto = protocols[i];
-
-      // Add length byte.
-      bytes[bytesOffset++] = proto.length;
-      int bits = 0;
-
-      // Add protocol bytes.
-      for (int j = 0; j < proto.length; j++) {
-        var char = proto.codeUnitAt(j);
-        bits |= char;
-        bytes[bytesOffset++] = char & 0xff;
-      }
-
-      // Go slow case if we have encountered anything non-ascii.
-      if (bits > 0x7f) {
-        return _protocolsToLengthEncodingNonAsciiBailout(protocols);
-      }
-    }
-    return bytes;
-  }
-
-  static Uint8List _protocolsToLengthEncodingNonAsciiBailout(
-      List<String> protocols) {
-    void addProtocol(List<int> outBytes, String protocol) {
-      var protocolBytes = utf8.encode(protocol);
-      var len = protocolBytes.length;
-
-      if (len > 255) {
-        throw new ArgumentError(
-            'Length of protocol must be between 1 and 255 (was: $len)');
-      }
-      // Add length byte.
-      outBytes.add(len);
-
-      // Add protocol bytes.
-      outBytes.addAll(protocolBytes);
-    }
-
-    List<int> bytes = [];
-    for (var i = 0; i < protocols.length; i++) {
-      addProtocol(bytes, protocols[i]);
-    }
-
-    if (bytes.length >= (1 << 13)) {
-      throw new ArgumentError(
-          'The maximum message length supported is 2^13-1.');
-    }
-
-    return new Uint8List.fromList(bytes);
-  }
-}
diff --git a/sdk_nnbd/lib/io/service_object.dart b/sdk_nnbd/lib/io/service_object.dart
deleted file mode 100644
index e6b1851..0000000
--- a/sdk_nnbd/lib/io/service_object.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2014, 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.
-
-part of dart.io;
-
-int _nextServiceId = 1;
-
-// TODO(ajohnsen): Use other way of getting a unique id.
-abstract class _ServiceObject {
-  int __serviceId = 0;
-  int get _serviceId {
-    if (__serviceId == 0) __serviceId = _nextServiceId++;
-    return __serviceId;
-  }
-
-  Map _toJSON(bool ref);
-
-  String get _servicePath => "$_serviceTypePath/$_serviceId";
-
-  String get _serviceTypePath;
-
-  String get _serviceTypeName;
-
-  String _serviceType(bool ref) {
-    if (ref) return "@$_serviceTypeName";
-    return _serviceTypeName;
-  }
-}
diff --git a/sdk_nnbd/lib/io/socket.dart b/sdk_nnbd/lib/io/socket.dart
deleted file mode 100644
index b5e814f..0000000
--- a/sdk_nnbd/lib/io/socket.dart
+++ /dev/null
@@ -1,1097 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/**
- * [InternetAddressType] is the type an [InternetAddress]. Currently,
- * IP version 4 (IPv4), IP version 6 (IPv6) and Unix domain address are
- * supported. Unix domain sockets are available only on Linux, MacOS and
- * Android.
- */
-class InternetAddressType {
-  static const InternetAddressType IPv4 = const InternetAddressType._(0);
-  static const InternetAddressType IPv6 = const InternetAddressType._(1);
-  @Since("2.8")
-  static const InternetAddressType unix = const InternetAddressType._(2);
-  static const InternetAddressType any = const InternetAddressType._(-1);
-
-  @Deprecated("Use IPv4 instead")
-  static const InternetAddressType IP_V4 = IPv4;
-  @Deprecated("Use IPv6 instead")
-  static const InternetAddressType IP_V6 = IPv6;
-  @Deprecated("Use any instead")
-  static const InternetAddressType ANY = any;
-
-  final int _value;
-
-  const InternetAddressType._(this._value);
-
-  factory InternetAddressType._from(int value) {
-    if (value == IPv4._value) return IPv4;
-    if (value == IPv6._value) return IPv6;
-    if (value == unix._value) return unix;
-    throw new ArgumentError("Invalid type: $value");
-  }
-
-  /**
-   * Get the name of the type, e.g. "IPv4" or "IPv6".
-   */
-  String get name {
-    switch (_value) {
-      case -1:
-        return "ANY";
-      case 0:
-        return "IPv4";
-      case 1:
-        return "IPv6";
-      case 2:
-        return "Unix";
-      default:
-        throw new ArgumentError("Invalid InternetAddress");
-    }
-  }
-
-  String toString() => "InternetAddressType: $name";
-}
-
-/**
- * An internet address or a Unix domain address.
- *
- * This object holds an internet address. If this internet address
- * is the result of a DNS lookup, the address also holds the hostname
- * used to make the lookup.
- * An Internet address combined with a port number represents an
- * endpoint to which a socket can connect or a listening socket can
- * bind.
- */
-abstract class InternetAddress {
-  /**
-   * IP version 4 loopback address. Use this address when listening on
-   * or connecting to the loopback adapter using IP version 4 (IPv4).
-   */
-  static InternetAddress get loopbackIPv4 => LOOPBACK_IP_V4;
-  @Deprecated("Use loopbackIPv4 instead")
-  external static InternetAddress get LOOPBACK_IP_V4;
-
-  /**
-   * IP version 6 loopback address. Use this address when listening on
-   * or connecting to the loopback adapter using IP version 6 (IPv6).
-   */
-  static InternetAddress get loopbackIPv6 => LOOPBACK_IP_V6;
-  @Deprecated("Use loopbackIPv6 instead")
-  external static InternetAddress get LOOPBACK_IP_V6;
-
-  /**
-   * IP version 4 any address. Use this address when listening on
-   * all adapters IP addresses using IP version 4 (IPv4).
-   */
-  static InternetAddress get anyIPv4 => ANY_IP_V4;
-  @Deprecated("Use anyIPv4 instead")
-  external static InternetAddress get ANY_IP_V4;
-
-  /**
-   * IP version 6 any address. Use this address when listening on
-   * all adapters IP addresses using IP version 6 (IPv6).
-   */
-  static InternetAddress get anyIPv6 => ANY_IP_V6;
-  @Deprecated("Use anyIPv6 instead")
-  external static InternetAddress get ANY_IP_V6;
-
-  /**
-   * The address family of the [InternetAddress].
-   */
-  InternetAddressType get type;
-
-  /**
-   * The numeric address of the host.
-   *
-   * For IPv4 addresses this is using the dotted-decimal notation.
-   * For IPv6 it is using the hexadecimal representation.
-   * For Unix domain addresses, this is a file path.
-   */
-  String get address;
-
-  /**
-   * The host used to lookup the address.
-   *
-   * If there is no host associated with the address this returns the [address].
-   */
-  String get host;
-
-  /**
-   * The raw address of this [InternetAddress].
-   *
-   * For an IP address, the result is either a 4 or 16 byte long list.
-   * For a Unix domain address, UTF-8 encoded byte sequences that represents
-   * [address] is returned.
-   *
-   * The returned list is a fresh copy, making it possible to change the list without
-   * modifying the [InternetAddress].
-   */
-  Uint8List get rawAddress;
-
-  /**
-   * Returns true if the [InternetAddress] is a loopback address.
-   */
-  bool get isLoopback;
-
-  /**
-   * Returns true if the [InternetAddress]s scope is a link-local.
-   */
-  bool get isLinkLocal;
-
-  /**
-   * Returns true if the [InternetAddress]s scope is multicast.
-   */
-  bool get isMulticast;
-
-  /**
-   * Creates a new [InternetAddress] from a numeric address or a file path.
-   *
-   * If [type] is [InternetAddressType.IPv4], [address] must be a numeric IPv4
-   * address (dotted-decimal notation).
-   * If [type] is [InternetAddressType.IPv6], [address] must be a numeric IPv6
-   * address (hexadecimal notation).
-   * If [type] is [InternetAddressType.unix], [address] must be a a valid file
-   * path.
-   * If [type] is omitted, [address] must be either a numeric IPv4 or IPv6
-   * address and the type is inferred from the format.
-   *
-   * To create a Unix domain address, [type] should be
-   * [InternetAddressType.unix] and [address] should be a string.
-   */
-  external factory InternetAddress(String address,
-      {@Since("2.8") InternetAddressType? type});
-
-  /**
-   * Creates a new [InternetAddress] from the provided raw address bytes.
-   *
-   * If the [type] is [InternetAddressType.IPv4], the [rawAddress] must have
-   * length 4.
-   * If the [type] is [InternetAddressType.IPv6], the [rawAddress] must have
-   * length 16.
-   * If the [type] is [InternetAddressType.IPv4], the [rawAddress] must be a
-   * valid UTF-8 encoded file path.
-   *
-   * If [type] is omitted, the [rawAddress] must have a length of either 4 or
-   * 16, in which case the type defaults to [InternetAddress.IPv4] or
-   * [InternetAddress.IPv6] respectively.
-   */
-  external factory InternetAddress.fromRawAddress(Uint8List rawAddress,
-      {@Since("2.8") InternetAddressType? type});
-
-  /**
-   * Perform a reverse DNS lookup on this [address]
-   *
-   * Returns a new [InternetAddress] with the same address, but where the [host]
-   * field set to the result of the lookup.
-   *
-   * If this address is Unix domain addresses, no lookup is performed and this
-   * address is returned directly.
-   */
-  Future<InternetAddress> reverse();
-
-  /**
-   * Lookup a host, returning a Future of a list of
-   * [InternetAddress]s. If [type] is [InternetAddressType.ANY], it
-   * will lookup both IP version 4 (IPv4) and IP version 6 (IPv6)
-   * addresses. If [type] is either [InternetAddressType.IPv4] or
-   * [InternetAddressType.IPv6] it will only lookup addresses of the
-   * specified type. The order of the list can, and most likely will,
-   * change over time.
-   */
-  external static Future<List<InternetAddress>> lookup(String host,
-      {InternetAddressType type: InternetAddressType.any});
-
-  /**
-   * Clones the given [address] with the new [host].
-   *
-   * The [address] must be an [InternetAddress] that was created with one
-   * of the static methods of this class.
-   */
-  external static InternetAddress _cloneWithNewHost(
-      InternetAddress address, String host);
-
-  /// Attempts to parse [address] as a numeric address.
-  ///
-  /// Returns `null` If [address] is not a numeric IPv4 (dotted-decimal
-  /// notation) or IPv6 (hexadecimal representation) address.
-  external static InternetAddress? tryParse(String address);
-}
-
-/**
- * A [NetworkInterface] represents an active network interface on the current
- * system. It contains a list of [InternetAddress]es that are bound to the
- * interface.
- */
-abstract class NetworkInterface {
-  /**
-   * Get the name of the [NetworkInterface].
-   */
-  String get name;
-
-  /**
-   * Get the index of the [NetworkInterface].
-   */
-  int get index;
-
-  /**
-   * Get a list of [InternetAddress]es currently bound to this
-   * [NetworkInterface].
-   */
-  List<InternetAddress> get addresses;
-
-  /**
-   * Whether [list] is supported.
-   *
-   * [list] is currently unsupported on Android.
-   */
-  external static bool get listSupported;
-
-  /**
-   * Query the system for [NetworkInterface]s.
-   *
-   * If [includeLoopback] is `true`, the returned list will include the
-   * loopback device. Default is `false`.
-   *
-   * If [includeLinkLocal] is `true`, the list of addresses of the returned
-   * [NetworkInterface]s, may include link local addresses. Default is `false`.
-   *
-   * If [type] is either [InternetAddressType.IPv4] or
-   * [InternetAddressType.IPv6] it will only lookup addresses of the
-   * specified type. Default is [InternetAddressType.any].
-   */
-  external static Future<List<NetworkInterface>> list(
-      {bool includeLoopback: false,
-      bool includeLinkLocal: false,
-      InternetAddressType type: InternetAddressType.any});
-}
-
-/**
- * A [RawServerSocket] represents a listening socket, and provides a
- * stream of low-level [RawSocket] objects, one for each connection
- * made to the listening socket.
- *
- * See [RawSocket] for more info.
- */
-abstract class RawServerSocket implements Stream<RawSocket> {
-  /**
-   * Returns a future for a [:RawServerSocket:]. When the future
-   * completes the server socket is bound to the given [address] and
-   * [port] and has started listening on it.
-   *
-   * The [address] can either be a [String] or an
-   * [InternetAddress]. If [address] is a [String], [bind] will
-   * perform a [InternetAddress.lookup] and use the first value in the
-   * list. To listen on the loopback adapter, which will allow only
-   * incoming connections from the local host, use the value
-   * [InternetAddress.loopbackIPv4] or
-   * [InternetAddress.loopbackIPv6]. To allow for incoming
-   * connection from the network use either one of the values
-   * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
-   * bind to all interfaces or the IP address of a specific interface.
-   *
-   * If an IP version 6 (IPv6) address is used, both IP version 6
-   * (IPv6) and version 4 (IPv4) connections will be accepted. To
-   * restrict this to version 6 (IPv6) only, use [v6Only] to set
-   * version 6 only.
-   *
-   * If [port] has the value [:0:] an ephemeral port will
-   * be chosen by the system. The actual port used can be retrieved
-   * using the [:port:] getter.
-   *
-   * The optional argument [backlog] can be used to specify the listen
-   * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of [:0:] (the default) a reasonable value will be chosen by
-   * the system.
-   *
-   * The optional argument [shared] specifies whether additional RawServerSocket
-   * objects can bind to the same combination of `address`, `port` and `v6Only`.
-   * If `shared` is `true` and more `RawServerSocket`s from this isolate or
-   * other isolates are bound to the port, then the incoming connections will be
-   * distributed among all the bound `RawServerSocket`s. Connections can be
-   * distributed over multiple isolates this way.
-   */
-  external static Future<RawServerSocket> bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false});
-
-  /**
-   * Returns the port used by this socket.
-   */
-  int get port;
-
-  /**
-   * Returns the address used by this socket.
-   */
-  InternetAddress get address;
-
-  /**
-   * Closes the socket. The returned future completes when the socket
-   * is fully closed and is no longer bound.
-   */
-  Future<RawServerSocket> close();
-}
-
-/**
- * A [ServerSocket] represents a listening socket, and provides a
- * stream of [Socket] objects, one for each connection made to the
- * listening socket.
- *
- * See [Socket] for more info.
- */
-abstract class ServerSocket implements Stream<Socket> {
-  /**
-   * Returns a future for a [:ServerSocket:]. When the future
-   * completes the server socket is bound to the given [address] and
-   * [port] and has started listening on it.
-   *
-   * The [address] can either be a [String] or an
-   * [InternetAddress]. If [address] is a [String], [bind] will
-   * perform a [InternetAddress.lookup] and use the first value in the
-   * list. To listen on the loopback adapter, which will allow only
-   * incoming connections from the local host, use the value
-   * [InternetAddress.loopbackIPv4] or
-   * [InternetAddress.loopbackIPv6]. To allow for incoming
-   * connection from the network use either one of the values
-   * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
-   * bind to all interfaces or the IP address of a specific interface.
-   *
-   * If an IP version 6 (IPv6) address is used, both IP version 6
-   * (IPv6) and version 4 (IPv4) connections will be accepted. To
-   * restrict this to version 6 (IPv6) only, use [v6Only] to set
-   * version 6 only.
-   *
-   * If [port] has the value [:0:] an ephemeral port will be chosen by
-   * the system. The actual port used can be retrieved using the
-   * [port] getter.
-   *
-   * The optional argument [backlog] can be used to specify the listen
-   * backlog for the underlying OS listen setup. If [backlog] has the
-   * value of [:0:] (the default) a reasonable value will be chosen by
-   * the system.
-   *
-   * The optional argument [shared] specifies whether additional ServerSocket
-   * objects can bind to the same combination of `address`, `port` and `v6Only`.
-   * If `shared` is `true` and more `ServerSocket`s from this isolate or other
-   * isolates are bound to the port, then the incoming connections will be
-   * distributed among all the bound `ServerSocket`s. Connections can be
-   * distributed over multiple isolates this way.
-   */
-  static Future<ServerSocket> bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false}) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return ServerSocket._bind(address, port,
-          backlog: backlog, v6Only: v6Only, shared: shared);
-    }
-    return overrides.serverSocketBind(address, port,
-        backlog: backlog, v6Only: v6Only, shared: shared);
-  }
-
-  external static Future<ServerSocket> _bind(address, int port,
-      {int backlog: 0, bool v6Only: false, bool shared: false});
-  /**
-   * Returns the port used by this socket.
-   */
-  int get port;
-
-  /**
-   * Returns the address used by this socket.
-   */
-  InternetAddress get address;
-
-  /**
-   * Closes the socket. The returned future completes when the socket
-   * is fully closed and is no longer bound.
-   */
-  Future<ServerSocket> close();
-}
-
-/**
- * The [SocketDirection] is used as a parameter to [Socket.close] and
- * [RawSocket.close] to close a socket in the specified direction(s).
- */
-class SocketDirection {
-  static const SocketDirection receive = const SocketDirection._(0);
-  static const SocketDirection send = const SocketDirection._(1);
-  static const SocketDirection both = const SocketDirection._(2);
-
-  @Deprecated("Use receive instead")
-  static const SocketDirection RECEIVE = receive;
-  @Deprecated("Use send instead")
-  static const SocketDirection SEND = send;
-  @Deprecated("Use both instead")
-  static const SocketDirection BOTH = both;
-
-  final _value;
-
-  const SocketDirection._(this._value);
-}
-
-/**
- * The [SocketOption] is used as a parameter to [Socket.setOption] and
- * [RawSocket.setOption] to set customize the behaviour of the underlying
- * socket.
- */
-class SocketOption {
-  /**
-   * Enable or disable no-delay on the socket. If tcpNoDelay is enabled, the
-   * socket will not buffer data internally, but instead write each data chunk
-   * as an individual TCP packet.
-   *
-   * tcpNoDelay is disabled by default.
-   */
-  static const SocketOption tcpNoDelay = const SocketOption._(0);
-  @Deprecated("Use tcpNoDelay instead")
-  static const SocketOption TCP_NODELAY = tcpNoDelay;
-
-  static const SocketOption _ipMulticastLoop = const SocketOption._(1);
-  static const SocketOption _ipMulticastHops = const SocketOption._(2);
-  static const SocketOption _ipMulticastIf = const SocketOption._(3);
-  static const SocketOption _ipBroadcast = const SocketOption._(4);
-
-  final _value;
-
-  const SocketOption._(this._value);
-}
-
-// Must be kept in sync with enum in socket.cc
-enum _RawSocketOptions {
-  SOL_SOCKET, // 0
-  IPPROTO_IP, // 1
-  IP_MULTICAST_IF, // 2
-  IPPROTO_IPV6, // 3
-  IPV6_MULTICAST_IF, // 4
-  IPPROTO_TCP, // 5
-  IPPROTO_UDP, // 6
-}
-
-/// The [RawSocketOption] is used as a parameter to [Socket.setRawOption] and
-/// [RawSocket.setRawOption] to set customize the behaviour of the underlying
-/// socket.
-///
-/// It allows for fine grained control of the socket options, and its values will
-/// be passed to the underlying platform's implementation of setsockopt and
-/// getsockopt.
-@Since("2.2")
-class RawSocketOption {
-  /// Creates a RawSocketOption for getRawOption andSetRawOption.
-  ///
-  /// The level and option arguments correspond to level and optname arguments
-  /// on the get/setsockopt native calls.
-  ///
-  /// The value argument and its length correspond to the optval and length
-  /// arguments on the native call.
-  ///
-  /// For a [getRawOption] call, the value parameter will be updated after a
-  /// successful call (although its length will not be changed).
-  ///
-  /// For a [setRawOption] call, the value parameter will be used set the
-  /// option.
-  const RawSocketOption(this.level, this.option, this.value);
-
-  /// Convenience constructor for creating an int based RawSocketOption.
-  factory RawSocketOption.fromInt(int level, int option, int value) {
-    final Uint8List list = Uint8List(4);
-    final buffer = ByteData.view(list.buffer, list.offsetInBytes);
-    buffer.setInt32(0, value, Endian.host);
-    return RawSocketOption(level, option, list);
-  }
-
-  /// Convenience constructor for creating a bool based RawSocketOption.
-  factory RawSocketOption.fromBool(int level, int option, bool value) =>
-      RawSocketOption.fromInt(level, option, value ? 1 : 0);
-
-  /// The level for the option to set or get.
-  ///
-  /// See also:
-  ///   * [RawSocketOption.levelSocket]
-  ///   * [RawSocketOption.levelIPv4]
-  ///   * [RawSocketOption.levelIPv6]
-  ///   * [RawSocketOption.levelTcp]
-  ///   * [RawSocketOption.levelUdp]
-  final int level;
-
-  /// The option to set or get.
-  final int option;
-
-  /// The raw data to set, or the array to write the current option value into.
-  ///
-  /// This list must be the correct length for the expected option. For most
-  /// options that take int or bool values, the length should be 4. For options
-  /// that expect a struct (such as an in_addr_t), the length should be the
-  /// correct length for that struct.
-  final Uint8List value;
-
-  /// Socket level option for SOL_SOCKET.
-  static int get levelSocket =>
-      _getOptionValue(_RawSocketOptions.SOL_SOCKET.index);
-
-  /// Socket level option for IPPROTO_IP.
-  static int get levelIPv4 =>
-      _getOptionValue(_RawSocketOptions.IPPROTO_IP.index);
-
-  /// Socket option for IP_MULTICAST_IF.
-  static int get IPv4MulticastInterface =>
-      _getOptionValue(_RawSocketOptions.IP_MULTICAST_IF.index);
-
-  /// Socket level option for IPPROTO_IPV6.
-  static int get levelIPv6 =>
-      _getOptionValue(_RawSocketOptions.IPPROTO_IPV6.index);
-
-  /// Socket option for IPV6_MULTICAST_IF.
-  static int get IPv6MulticastInterface =>
-      _getOptionValue(_RawSocketOptions.IPV6_MULTICAST_IF.index);
-
-  /// Socket level option for IPPROTO_TCP.
-  static int get levelTcp =>
-      _getOptionValue(_RawSocketOptions.IPPROTO_TCP.index);
-
-  /// Socket level option for IPPROTO_UDP.
-  static int get levelUdp =>
-      _getOptionValue(_RawSocketOptions.IPPROTO_UDP.index);
-
-  external static int _getOptionValue(int key);
-}
-
-/**
- * Events for the [RawSocket].
- */
-class RawSocketEvent {
-  static const RawSocketEvent read = const RawSocketEvent._(0);
-  static const RawSocketEvent write = const RawSocketEvent._(1);
-  static const RawSocketEvent readClosed = const RawSocketEvent._(2);
-  static const RawSocketEvent closed = const RawSocketEvent._(3);
-
-  @Deprecated("Use read instead")
-  static const RawSocketEvent READ = read;
-  @Deprecated("Use write instead")
-  static const RawSocketEvent WRITE = write;
-  @Deprecated("Use readClosed instead")
-  static const RawSocketEvent READ_CLOSED = readClosed;
-  @Deprecated("Use closed instead")
-  static const RawSocketEvent CLOSED = closed;
-
-  final int _value;
-
-  const RawSocketEvent._(this._value);
-  String toString() {
-    return const [
-      'RawSocketEvent.read',
-      'RawSocketEvent.write',
-      'RawSocketEvent.readClosed',
-      'RawSocketEvent.closed'
-    ][_value];
-  }
-}
-
-/// Returned by the `startConnect` methods on client-side socket types `S`,
-/// `ConnectionTask<S>` allows cancelling an attempt to connect to a host.
-class ConnectionTask<S> {
-  /// A `Future` that completes with value that `S.connect()` would return
-  /// unless [cancel] is called on this [ConnectionTask].
-  ///
-  /// If [cancel] is called, the `Future` completes with a [SocketException]
-  /// error whose message indicates that the connection attempt was cancelled.
-  final Future<S> socket;
-  final void Function() _onCancel;
-
-  ConnectionTask._(Future<S> this.socket, void Function() onCancel)
-      : _onCancel = onCancel;
-
-  /// Cancels the connection attempt.
-  ///
-  /// This also causes the [socket] `Future` to complete with a
-  /// [SocketException] error.
-  void cancel() {
-    _onCancel();
-  }
-}
-
-/**
- * A [RawSocket] is an unbuffered interface to a TCP socket.
- *
- * The raw socket delivers the data stream in the same chunks as the underlying
- * operating system.
- *
- * It is not the same as a
- * [POSIX raw socket](http://man7.org/linux/man-pages/man7/raw.7.html).
- */
-abstract class RawSocket implements Stream<RawSocketEvent> {
-  /**
-   * Set or get, if the [RawSocket] should listen for [RawSocketEvent.read]
-   * events. Default is [:true:].
-   */
-  bool get readEventsEnabled;
-  void set readEventsEnabled(bool value);
-
-  /**
-   * Set or get, if the [RawSocket] should listen for [RawSocketEvent.write]
-   * events. Default is [:true:].
-   * This is a one-shot listener, and writeEventsEnabled must be set
-   * to true again to receive another write event.
-   */
-  bool get writeEventsEnabled;
-  void set writeEventsEnabled(bool value);
-
-  /**
-   * Creates a new socket connection to the host and port and returns a [Future]
-   * that will complete with either a [RawSocket] once connected or an error
-   * if the host-lookup or connection failed.
-   *
-   * [host] can either be a [String] or an [InternetAddress]. If [host] is a
-   * [String], [connect] will perform a [InternetAddress.lookup] and try
-   * all returned [InternetAddress]es, until connected. Unless a
-   * connection was established, the error from the first failing connection is
-   * returned.
-   *
-   * The argument [sourceAddress] can be used to specify the local
-   * address to bind when making the connection. `sourceAddress` can either
-   * be a `String` or an `InternetAddress`. If a `String` is passed it must
-   * hold a numeric IP address.
-   *
-   * The argument [timeout] is used to specify the maximum allowed time to wait
-   * for a connection to be established. If [timeout] is longer than the system
-   * level timeout duration, a timeout may occur sooner than specified in
-   * [timeout]. On timeout, a [SocketException] is thrown and all ongoing
-   * connection attempts to [host] are cancelled.
-   */
-  external static Future<RawSocket> connect(host, int port,
-      {sourceAddress, Duration? timeout});
-
-  /// Like [connect], but returns a [Future] that completes with a
-  /// [ConnectionTask] that can be cancelled if the [RawSocket] is no
-  /// longer needed.
-  external static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
-      {sourceAddress});
-
-  /**
-   * Returns the number of received and non-read bytes in the socket that
-   * can be read.
-   */
-  int available();
-
-  /**
-   * Read up to [len] bytes from the socket. This function is
-   * non-blocking and will only return data if data is available. The
-   * number of bytes read can be less then [len] if fewer bytes are
-   * available for immediate reading. If no data is available [:null:]
-   * is returned.
-   */
-  Uint8List? read([int? len]);
-
-  /**
-   * Writes up to [count] bytes of the buffer from [offset] buffer offset to
-   * the socket. The number of successfully written bytes is returned. This
-   * function is non-blocking and will only write data if buffer space is
-   * available in the socket.
-   *
-   * The default value for [offset] is 0, and the default value for [count] is
-   * [:buffer.length - offset:].
-   */
-  int write(List<int> buffer, [int offset = 0, int? count]);
-
-  /**
-   * Returns the port used by this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   */
-  int get port;
-
-  /**
-   * Returns the remote port connected to by this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   */
-  int get remotePort;
-
-  /**
-   * Returns the [InternetAddress] used to connect this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   */
-  InternetAddress get address;
-
-  /**
-   * Returns the remote [InternetAddress] connected to by this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   */
-  InternetAddress get remoteAddress;
-
-  /**
-   * Closes the socket. Returns a Future that completes with [this] when the
-   * underlying connection is completely destroyed.
-   *
-   * Calling [close] will never throw an exception
-   * and calling it several times is supported. Calling [close] can result in
-   * a [RawSocketEvent.readClosed] event.
-   */
-  Future<RawSocket> close();
-
-  /**
-   * Shutdown the socket in the [direction]. Calling [shutdown] will never
-   * throw an exception and calling it several times is supported. Calling
-   * shutdown with either [SocketDirection.both] or [SocketDirection.receive]
-   * can result in a [RawSocketEvent.readClosed] event.
-   */
-  void shutdown(SocketDirection direction);
-
-  /**
-   * Use [setOption] to customize the [RawSocket]. See [SocketOption] for
-   * available options.
-   *
-   * Returns [:true:] if the option was set successfully, false otherwise.
-   */
-  bool setOption(SocketOption option, bool enabled);
-
-  /**
-   * Use [getRawOption] to get low level information about the [RawSocket]. See
-   * [RawSocketOption] for available options.
-   *
-   * Returns the [RawSocketOption.value] on success.
-   *
-   * Throws an [OSError] on failure.
-   */
-  @Since("2.2")
-  Uint8List getRawOption(RawSocketOption option);
-
-  /**
-   * Use [setRawOption] to customize the [RawSocket]. See [RawSocketOption] for
-   * available options.
-   *
-   * Throws an [OSError] on failure.
-   */
-  @Since("2.2")
-  void setRawOption(RawSocketOption option);
-}
-
-/**
- * A high-level class for communicating over a TCP socket.
- *
- * The [Socket] exposes both a [Stream] and a [IOSink] interface, making it
- * ideal for using together with other [Stream]s.
- */
-abstract class Socket implements Stream<Uint8List>, IOSink {
-  /**
-   * Creates a new socket connection to the host and port and returns a [Future]
-   * that will complete with either a [Socket] once connected or an error
-   * if the host-lookup or connection failed.
-   *
-   * [host] can either be a [String] or an [InternetAddress]. If [host] is a
-   * [String], [connect] will perform a [InternetAddress.lookup] and try
-   * all returned [InternetAddress]es, until connected. Unless a
-   * connection was established, the error from the first failing connection is
-   * returned.
-   *
-   * The argument [sourceAddress] can be used to specify the local
-   * address to bind when making the connection. `sourceAddress` can either
-   * be a `String` or an `InternetAddress`. If a `String` is passed it must
-   * hold a numeric IP address.
-   *
-   * The argument [timeout] is used to specify the maximum allowed time to wait
-   * for a connection to be established. If [timeout] is longer than the system
-   * level timeout duration, a timeout may occur sooner than specified in
-   * [timeout]. On timeout, a [SocketException] is thrown and all ongoing
-   * connection attempts to [host] are cancelled.
-   */
-  static Future<Socket> connect(host, int port,
-      {sourceAddress, Duration? timeout}) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return Socket._connect(host, port,
-          sourceAddress: sourceAddress, timeout: timeout);
-    }
-    return overrides.socketConnect(host, port,
-        sourceAddress: sourceAddress, timeout: timeout);
-  }
-
-  /// Like [connect], but returns a [Future] that completes with a
-  /// [ConnectionTask] that can be cancelled if the [Socket] is no
-  /// longer needed.
-  static Future<ConnectionTask<Socket>> startConnect(host, int port,
-      {sourceAddress}) {
-    final IOOverrides? overrides = IOOverrides.current;
-    if (overrides == null) {
-      return Socket._startConnect(host, port, sourceAddress: sourceAddress);
-    }
-    return overrides.socketStartConnect(host, port,
-        sourceAddress: sourceAddress);
-  }
-
-  external static Future<Socket> _connect(host, int port,
-      {sourceAddress, Duration? timeout});
-
-  external static Future<ConnectionTask<Socket>> _startConnect(host, int port,
-      {sourceAddress});
-
-  /**
-   * Destroy the socket in both directions. Calling [destroy] will make the
-   * send a close event on the stream and will no longer react on data being
-   * piped to it.
-   *
-   * Call [close](inherited from [IOSink]) to only close the [Socket]
-   * for sending data.
-   */
-  void destroy();
-
-  /**
-   * Use [setOption] to customize the [RawSocket]. See [SocketOption] for
-   * available options.
-   *
-   * Returns [:true:] if the option was set successfully, false otherwise.
-   *
-   * Throws a [SocketException] if the socket has been destroyed or upgraded to
-   * a secure socket.
-   */
-  bool setOption(SocketOption option, bool enabled);
-
-  /**
-   * Use [getRawOption] to get low level information about the [RawSocket]. See
-   * [RawSocketOption] for available options.
-   *
-   * Returns the [RawSocketOption.value] on success.
-   *
-   * Throws an [OSError] on failure and a [SocketException] if the socket has
-   * been destroyed or upgraded to a secure socket.
-   */
-  Uint8List getRawOption(RawSocketOption option);
-
-  /**
-   * Use [setRawOption] to customize the [RawSocket]. See [RawSocketOption] for
-   * available options.
-   *
-   * Throws an [OSError] on failure and a [SocketException] if the socket has
-   * been destroyed or upgraded to a secure socket.
-   */
-  void setRawOption(RawSocketOption option);
-
-  /**
-   * The port used by this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   * The port is 0 if the socket is a Unix domain socket.
-   */
-  int get port;
-
-  /**
-   * The remote port connected to by this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   * The port is 0 if the socket is a Unix domain socket.
-   */
-  int get remotePort;
-
-  /**
-   * The [InternetAddress] used to connect this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   */
-  InternetAddress get address;
-
-  /**
-   * The remote [InternetAddress] connected to by this socket.
-   *
-   * Throws a [SocketException] if the socket is closed.
-   */
-  InternetAddress get remoteAddress;
-
-  Future close();
-
-  Future get done;
-}
-
-/**
- * Datagram package. Data sent to and received from datagram sockets
- * contains the internet address and port of the destination or source
- * togeter with the data.
- */
-class Datagram {
-  Uint8List data;
-  InternetAddress address;
-  int port;
-
-  Datagram(this.data, this.address, this.port);
-}
-
-/**
- * A [RawDatagramSocket] is an unbuffered interface to a UDP socket.
- *
- * The raw datagram socket delivers the datagrams in the same chunks as the
- * underlying operating system. It's a [Stream] of [RawSocketEvent]s.
- *
- * Note that the event [RawSocketEvent.readClosed] will never be
- * received as an UDP socket cannot be closed by a remote peer.
- *
- * It is not the same as a
- * [POSIX raw socket](http://man7.org/linux/man-pages/man7/raw.7.html).
- */
-abstract class RawDatagramSocket extends Stream<RawSocketEvent> {
-  /**
-   * Set or get, if the [RawDatagramSocket] should listen for
-   * [RawSocketEvent.read] events. Default is [:true:].
-   */
-  bool get readEventsEnabled;
-  void set readEventsEnabled(bool value);
-
-  /**
-   * Set or get, if the [RawDatagramSocket] should listen for
-   * [RawSocketEvent.write] events. Default is [:true:].  This is a
-   * one-shot listener, and writeEventsEnabled must be set to true
-   * again to receive another write event.
-   */
-  bool get writeEventsEnabled;
-  void set writeEventsEnabled(bool value);
-
-  /**
-   * Set or get, whether multicast traffic is looped back to the host.
-   *
-   * By default multicast loopback is enabled.
-   */
-  bool get multicastLoopback;
-  void set multicastLoopback(bool value);
-
-  /**
-   * Set or get, the maximum network hops for multicast packages
-   * originating from this socket.
-   *
-   * For IPv4 this is referred to as TTL (time to live).
-   *
-   * By default this value is 1 causing multicast traffic to stay on
-   * the local network.
-   */
-  int get multicastHops;
-  void set multicastHops(int value);
-
-  /**
-   * Set or get, the network interface used for outgoing multicast packages.
-   *
-   * A value of `null`indicate that the system chooses the network
-   * interface to use.
-   *
-   * By default this value is `null`
-   */
-  @Deprecated("This property is not implemented. Use getRawOption and "
-      "setRawOption instead.")
-  NetworkInterface? multicastInterface;
-
-  /**
-   * Set or get, whether IPv4 broadcast is enabled.
-   *
-   * IPv4 broadcast needs to be enabled by the sender for sending IPv4
-   * broadcast packages. By default IPv4 broadcast is disabled.
-   *
-   * For IPv6 there is no general broadcast mechanism. Use multicast
-   * instead.
-   */
-  bool get broadcastEnabled;
-  void set broadcastEnabled(bool value);
-
-  /**
-   * Creates a new raw datagram socket binding it to an address and
-   * port.
-   */
-  external static Future<RawDatagramSocket> bind(host, int port,
-      {bool reuseAddress: true, bool reusePort: false, int ttl: 1});
-
-  /**
-   * Returns the port used by this socket.
-   */
-  int get port;
-
-  /**
-   * Returns the address used by this socket.
-   */
-  InternetAddress get address;
-
-  /**
-   * Close the datagram socket.
-   */
-  void close();
-
-  /**
-   * Send a datagram.
-   *
-   * Returns the number of bytes written. This will always be either
-   * the size of [buffer] or `0`.
-   */
-  int send(List<int> buffer, InternetAddress address, int port);
-
-  /**
-   * Receive a datagram. If there are no datagrams available `null` is
-   * returned.
-   *
-   * The maximum length of the datagram that can be received is 65503 bytes.
-   */
-  Datagram? receive();
-
-  /**
-   * Join a multicast group.
-   *
-   * If an error occur when trying to join the multicast group an
-   * exception is thrown.
-   */
-  void joinMulticast(InternetAddress group, [NetworkInterface? interface]);
-
-  /**
-   * Leave a multicast group.
-   *
-   * If an error occur when trying to join the multicase group an
-   * exception is thrown.
-   */
-  void leaveMulticast(InternetAddress group, [NetworkInterface? interface]);
-
-  /**
-   * Use [getRawOption] to get low level information about the [RawSocket]. See
-   * [RawSocketOption] for available options.
-   *
-   * Returns [RawSocketOption.value] on success.
-   *
-   * Throws an [OSError] on failure.
-   */
-  Uint8List getRawOption(RawSocketOption option);
-
-  /**
-   * Use [setRawOption] to customize the [RawSocket]. See [RawSocketOption] for
-   * available options.
-   *
-   * Throws an [OSError] on failure.
-   */
-  void setRawOption(RawSocketOption option);
-}
-
-class SocketException implements IOException {
-  final String message;
-  final OSError? osError;
-  final InternetAddress? address;
-  final int? port;
-
-  const SocketException(this.message, {this.osError, this.address, this.port});
-  const SocketException.closed()
-      : message = 'Socket has been closed',
-        osError = null,
-        address = null,
-        port = null;
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("SocketException");
-    if (message.isNotEmpty) {
-      sb.write(": $message");
-      if (osError != null) {
-        sb.write(" ($osError)");
-      }
-    } else if (osError != null) {
-      sb.write(": $osError");
-    }
-    if (address != null) {
-      sb.write(", address = ${address!.host}");
-    }
-    if (port != null) {
-      sb.write(", port = $port");
-    }
-    return sb.toString();
-  }
-}
diff --git a/sdk_nnbd/lib/io/stdio.dart b/sdk_nnbd/lib/io/stdio.dart
deleted file mode 100644
index a0034c6..0000000
--- a/sdk_nnbd/lib/io/stdio.dart
+++ /dev/null
@@ -1,483 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-// These match enum StdioHandleType in file.h
-const int _stdioHandleTypeTerminal = 0;
-const int _stdioHandleTypePipe = 1;
-const int _stdioHandleTypeFile = 2;
-const int _stdioHandleTypeSocket = 3;
-const int _stdioHandleTypeOther = 4;
-const int _stdioHandleTypeError = 5;
-
-class _StdStream extends Stream<List<int>> {
-  final Stream<List<int>> _stream;
-
-  _StdStream(this._stream);
-
-  StreamSubscription<List<int>> listen(void onData(List<int> event)?,
-      {Function? onError, void onDone()?, bool? cancelOnError}) {
-    return _stream.listen(onData,
-        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
-  }
-}
-
-/**
- * [Stdin] allows both synchronous and asynchronous reads from the standard
- * input stream.
- *
- * Mixing synchronous and asynchronous reads is undefined.
- */
-class Stdin extends _StdStream implements Stream<List<int>> {
-  int _fd;
-
-  Stdin._(Stream<List<int>> stream, this._fd) : super(stream);
-
-  /**
-   * Read a line from stdin.
-   *
-   * Blocks until a full line is available.
-   *
-   * Lines my be terminated by either `<CR><LF>` or `<LF>`. On Windows in cases
-   * where the [stdioType] of stdin is [StdioType.termimal] the terminator may
-   * also be a single `<CR>`.
-   *
-   * Input bytes are converted to a string by [encoding].
-   * If [encoding] is omitted, it defaults to [systemEncoding].
-   *
-   * If [retainNewlines] is `false`, the returned String will not include the
-   * final line terminator. If `true`, the returned String will include the line
-   * terminator. Default is `false`.
-   *
-   * If end-of-file is reached after any bytes have been read from stdin,
-   * that data is returned without a line terminator.
-   * Returns `null` if no bytes preceded the end of input.
-   */
-  String? readLineSync(
-      {Encoding encoding: systemEncoding, bool retainNewlines: false}) {
-    const CR = 13;
-    const LF = 10;
-    final List<int> line = <int>[];
-    // On Windows, if lineMode is disabled, only CR is received.
-    bool crIsNewline = Platform.isWindows &&
-        (stdioType(stdin) == StdioType.terminal) &&
-        !lineMode;
-    if (retainNewlines) {
-      int byte;
-      do {
-        byte = readByteSync();
-        if (byte < 0) {
-          break;
-        }
-        line.add(byte);
-      } while (byte != LF && !(byte == CR && crIsNewline));
-      if (line.isEmpty) {
-        return null;
-      }
-    } else if (crIsNewline) {
-      // CR and LF are both line terminators, neither is retained.
-      while (true) {
-        int byte = readByteSync();
-        if (byte < 0) {
-          if (line.isEmpty) return null;
-          break;
-        }
-        if (byte == LF || byte == CR) break;
-        line.add(byte);
-      }
-    } else {
-      // Case having to handle CR LF as a single unretained line terminator.
-      outer:
-      while (true) {
-        int byte = readByteSync();
-        if (byte == LF) break;
-        if (byte == CR) {
-          do {
-            byte = readByteSync();
-            if (byte == LF) break outer;
-
-            line.add(CR);
-          } while (byte == CR);
-          // Fall through and handle non-CR character.
-        }
-        if (byte < 0) {
-          if (line.isEmpty) return null;
-          break;
-        }
-        line.add(byte);
-      }
-    }
-    return encoding.decode(line);
-  }
-
-  /**
-   * Check if echo mode is enabled on [stdin].
-   */
-  external bool get echoMode;
-
-  /**
-   * Enable or disable echo mode on [stdin].
-   *
-   * If disabled, input from to console will not be echoed.
-   *
-   * Default depends on the parent process, but usually enabled.
-   *
-   * On Windows this mode can only be enabled if [lineMode] is enabled as well.
-   */
-  external void set echoMode(bool enabled);
-
-  /**
-   * Check if line mode is enabled on [stdin].
-   */
-  external bool get lineMode;
-
-  /**
-   * Enable or disable line mode on [stdin].
-   *
-   * If enabled, characters are delayed until a new-line character is entered.
-   * If disabled, characters will be available as typed.
-   *
-   * Default depends on the parent process, but usually enabled.
-   *
-   * On Windows this mode can only be disabled if [echoMode] is disabled as well.
-   */
-  external void set lineMode(bool enabled);
-
-  /**
-    * Whether connected to a terminal that supports ANSI escape sequences.
-    *
-    * Not all terminals are recognized, and not all recognized terminals can
-    * report whether they support ANSI escape sequences, so this value is a
-    * best-effort attempt at detecting the support.
-    *
-    * The actual escape sequence support may differ between terminals,
-    * with some terminals supporting more escape sequences than others,
-    * and some terminals even differing in behavior for the same escape
-    * sequence.
-    *
-    * The ANSI color selection is generally supported.
-    *
-    * Currently, a `TERM` environment variable containing the string `xterm`
-    * will be taken as evidence that ANSI escape sequences are supported.
-    * On Windows, only versions of Windows 10 after v.1511
-    * ("TH2", OS build 10586) will be detected as supporting the output of
-    * ANSI escape sequences, and only versions after v.1607 ("Anniversary
-    * Update", OS build 14393) will be detected as supporting the input of
-    * ANSI escape sequences.
-    */
-  external bool get supportsAnsiEscapes;
-
-  /**
-   * Synchronously read a byte from stdin. This call will block until a byte is
-   * available.
-   *
-   * If at end of file, -1 is returned.
-   */
-  external int readByteSync();
-
-  /**
-   * Returns true if there is a terminal attached to stdin.
-   */
-  bool get hasTerminal {
-    try {
-      return stdioType(this) == StdioType.terminal;
-    } on FileSystemException catch (_) {
-      // If stdioType throws a FileSystemException, then it is not hooked up to
-      // a terminal, probably because it is closed, but let other exception
-      // types bubble up.
-      return false;
-    }
-  }
-}
-
-/**
- * [Stdout] represents the [IOSink] for either `stdout` or `stderr`.
- *
- * It provides a *blocking* `IOSink`, so using this to write will block until
- * the output is written.
- *
- * In some situations this blocking behavior is undesirable as it does not
- * provide the same non-blocking behavior as dart:io in general exposes.
- * Use the property [nonBlocking] to get an `IOSink` which has the non-blocking
- * behavior.
- *
- * This class can also be used to check whether `stdout` or `stderr` is
- * connected to a terminal and query some terminal properties.
- *
- * The [addError] API is inherited from  [StreamSink] and calling it will result
- * in an unhandled asynchronous error unless there is an error handler on
- * [done].
- */
-class Stdout extends _StdSink implements IOSink {
-  final int _fd;
-  IOSink? _nonBlocking;
-
-  Stdout._(IOSink sink, this._fd) : super(sink);
-
-  /**
-   * Returns true if there is a terminal attached to stdout.
-   */
-  bool get hasTerminal => _hasTerminal(_fd);
-
-  /**
-   * Get the number of columns of the terminal.
-   *
-   * If no terminal is attached to stdout, a [StdoutException] is thrown. See
-   * [hasTerminal] for more info.
-   */
-  int get terminalColumns => _terminalColumns(_fd);
-
-  /**
-   * Get the number of lines of the terminal.
-   *
-   * If no terminal is attached to stdout, a [StdoutException] is thrown. See
-   * [hasTerminal] for more info.
-   */
-  int get terminalLines => _terminalLines(_fd);
-
-  /**
-    * Whether connected to a terminal that supports ANSI escape sequences.
-    *
-    * Not all terminals are recognized, and not all recognized terminals can
-    * report whether they support ANSI escape sequences, so this value is a
-    * best-effort attempt at detecting the support.
-    *
-    * The actual escape sequence support may differ between terminals,
-    * with some terminals supporting more escape sequences than others,
-    * and some terminals even differing in behavior for the same escape
-    * sequence.
-    *
-    * The ANSI color selection is generally supported.
-    *
-    * Currently, a `TERM` environment variable containing the string `xterm`
-    * will be taken as evidence that ANSI escape sequences are supported.
-    * On Windows, only versions of Windows 10 after v.1511
-    * ("TH2", OS build 10586) will be detected as supporting the output of
-    * ANSI escape sequences, and only versions after v.1607 ("Anniversary
-    * Update", OS build 14393) will be detected as supporting the input of
-    * ANSI escape sequences.
-    */
-  bool get supportsAnsiEscapes => _supportsAnsiEscapes(_fd);
-
-  external bool _hasTerminal(int fd);
-  external int _terminalColumns(int fd);
-  external int _terminalLines(int fd);
-  external static bool _supportsAnsiEscapes(int fd);
-
-  /**
-   * Get a non-blocking `IOSink`.
-   */
-  IOSink get nonBlocking {
-    return _nonBlocking ??= new IOSink(new _FileStreamConsumer.fromStdio(_fd));
-  }
-}
-
-class StdoutException implements IOException {
-  final String message;
-  final OSError? osError;
-
-  const StdoutException(this.message, [this.osError]);
-
-  String toString() {
-    return "StdoutException: $message${osError == null ? "" : ", $osError"}";
-  }
-}
-
-class StdinException implements IOException {
-  final String message;
-  final OSError? osError;
-
-  const StdinException(this.message, [this.osError]);
-
-  String toString() {
-    return "StdinException: $message${osError == null ? "" : ", $osError"}";
-  }
-}
-
-class _StdConsumer implements StreamConsumer<List<int>> {
-  final _file;
-
-  _StdConsumer(int fd) : _file = _File._openStdioSync(fd);
-
-  Future addStream(Stream<List<int>> stream) {
-    var completer = new Completer();
-    var sub;
-    sub = stream.listen((data) {
-      try {
-        _file.writeFromSync(data);
-      } catch (e, s) {
-        sub.cancel();
-        completer.completeError(e, s);
-      }
-    },
-        onError: completer.completeError,
-        onDone: completer.complete,
-        cancelOnError: true);
-    return completer.future;
-  }
-
-  Future close() {
-    _file.closeSync();
-    return new Future.value();
-  }
-}
-
-class _StdSink implements IOSink {
-  final IOSink _sink;
-
-  _StdSink(this._sink);
-
-  Encoding get encoding => _sink.encoding;
-  void set encoding(Encoding encoding) {
-    _sink.encoding = encoding;
-  }
-
-  void write(Object? object) {
-    _sink.write(object);
-  }
-
-  void writeln([Object? object = ""]) {
-    _sink.writeln(object);
-  }
-
-  void writeAll(Iterable objects, [String sep = ""]) {
-    _sink.writeAll(objects, sep);
-  }
-
-  void add(List<int> data) {
-    _sink.add(data);
-  }
-
-  void addError(error, [StackTrace? stackTrace]) {
-    _sink.addError(error, stackTrace);
-  }
-
-  void writeCharCode(int charCode) {
-    _sink.writeCharCode(charCode);
-  }
-
-  Future addStream(Stream<List<int>> stream) => _sink.addStream(stream);
-  Future flush() => _sink.flush();
-  Future close() => _sink.close();
-  Future get done => _sink.done;
-}
-
-/// The type of object a standard IO stream is attached to.
-class StdioType {
-  static const StdioType terminal = const StdioType._("terminal");
-  static const StdioType pipe = const StdioType._("pipe");
-  static const StdioType file = const StdioType._("file");
-  static const StdioType other = const StdioType._("other");
-
-  @Deprecated("Use terminal instead")
-  static const StdioType TERMINAL = terminal;
-  @Deprecated("Use pipe instead")
-  static const StdioType PIPE = pipe;
-  @Deprecated("Use file instead")
-  static const StdioType FILE = file;
-  @Deprecated("Use other instead")
-  static const StdioType OTHER = other;
-
-  final String name;
-  const StdioType._(this.name);
-  String toString() => "StdioType: $name";
-}
-
-Stdin? _stdin;
-Stdout? _stdout;
-Stdout? _stderr;
-
-// These may be set to different values by the embedder by calling
-// _setStdioFDs when initializing dart:io.
-int _stdinFD = 0;
-int _stdoutFD = 1;
-int _stderrFD = 2;
-
-@pragma('vm:entry-point', 'call')
-void _setStdioFDs(int stdin, int stdout, int stderr) {
-  _stdinFD = stdin;
-  _stdoutFD = stdout;
-  _stderrFD = stderr;
-}
-
-/// The standard input stream of data read by this program.
-Stdin get stdin {
-  return _stdin ??= _StdIOUtils._getStdioInputStream(_stdinFD);
-}
-
-/// The standard output stream of data written by this program.
-///
-/// The `addError` API is inherited from  `StreamSink` and calling it will
-/// result in an unhandled asynchronous error unless there is an error handler
-/// on `done`.
-Stdout get stdout {
-  return _stdout ??= _StdIOUtils._getStdioOutputStream(_stdoutFD);
-}
-
-/// The standard output stream of errors written by this program.
-///
-/// The `addError` API is inherited from  `StreamSink` and calling it will
-/// result in an unhandled asynchronous error unless there is an error handler
-/// on `done`.
-Stdout get stderr {
-  return _stderr ??= _StdIOUtils._getStdioOutputStream(_stderrFD);
-}
-
-/// For a stream, returns whether it is attached to a file, pipe, terminal, or
-/// something else.
-StdioType stdioType(object) {
-  if (object is _StdStream) {
-    object = object._stream;
-  } else if (object == stdout || object == stderr) {
-    int stdiofd = object == stdout ? _stdoutFD : _stderrFD;
-    final type = _StdIOUtils._getStdioHandleType(stdiofd);
-    if (type is OSError) {
-      throw FileSystemException(
-          "Failed to get type of stdio handle (fd $stdiofd)", "", type);
-    }
-    switch (type) {
-      case _stdioHandleTypeTerminal:
-        return StdioType.terminal;
-      case _stdioHandleTypePipe:
-        return StdioType.pipe;
-      case _stdioHandleTypeFile:
-        return StdioType.file;
-    }
-  }
-  if (object is _FileStream) {
-    return StdioType.file;
-  }
-  if (object is Socket) {
-    int? socketType = _StdIOUtils._socketType(object);
-    if (socketType == null) return StdioType.other;
-    switch (socketType) {
-      case _stdioHandleTypeTerminal:
-        return StdioType.terminal;
-      case _stdioHandleTypePipe:
-        return StdioType.pipe;
-      case _stdioHandleTypeFile:
-        return StdioType.file;
-    }
-  }
-  if (object is _IOSinkImpl) {
-    try {
-      if (object._target is _FileStreamConsumer) {
-        return StdioType.file;
-      }
-    } catch (e) {
-      // Only the interface implemented, _sink not available.
-    }
-  }
-  return StdioType.other;
-}
-
-class _StdIOUtils {
-  external static _getStdioOutputStream(int fd);
-  external static Stdin _getStdioInputStream(int fd);
-
-  /// Returns the socket type or `null` if [socket] is not a builtin socket.
-  external static int? _socketType(Socket socket);
-  external static _getStdioHandleType(int fd);
-}
diff --git a/sdk_nnbd/lib/io/string_transformer.dart b/sdk_nnbd/lib/io/string_transformer.dart
deleted file mode 100644
index f31c41e..0000000
--- a/sdk_nnbd/lib/io/string_transformer.dart
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.io;
-
-/// The current system encoding.
-///
-/// This is used for converting from bytes to and from Strings when
-/// communicating on stdin, stdout and stderr.
-///
-/// On Windows this will use the currently active code page for the conversion.
-/// On all other systems it will always use UTF-8.
-const SystemEncoding systemEncoding = const SystemEncoding();
-@Deprecated("Use systemEncoding instead")
-const SystemEncoding SYSTEM_ENCODING = const SystemEncoding();
-
-/// The system encoding is the current code page on Windows and UTF-8 on Linux
-/// and Mac.
-class SystemEncoding extends Encoding {
-  /// Creates a const SystemEncoding.
-  ///
-  /// Users should use the top-level constant, [systemEncoding].
-  const SystemEncoding();
-
-  String get name => 'system';
-
-  List<int> encode(String input) => encoder.convert(input);
-  String decode(List<int> encoded) => decoder.convert(encoded);
-
-  Converter<String, List<int>> get encoder {
-    if (Platform.operatingSystem == "windows") {
-      return const _WindowsCodePageEncoder();
-    } else {
-      return const Utf8Encoder();
-    }
-  }
-
-  Converter<List<int>, String> get decoder {
-    if (Platform.operatingSystem == "windows") {
-      return const _WindowsCodePageDecoder();
-    } else {
-      return const Utf8Decoder();
-    }
-  }
-}
-
-class _WindowsCodePageEncoder extends Converter<String, List<int>> {
-  const _WindowsCodePageEncoder();
-
-  List<int> convert(String input) {
-    List<int> encoded = _encodeString(input);
-    if (encoded == null) {
-      throw new FormatException("Invalid character for encoding");
-    }
-    return encoded;
-  }
-
-  /**
-   * Starts a chunked conversion.
-   */
-  StringConversionSink startChunkedConversion(Sink<List<int>> sink) {
-    return new _WindowsCodePageEncoderSink(sink);
-  }
-
-  external static List<int> _encodeString(String string);
-}
-
-class _WindowsCodePageEncoderSink extends StringConversionSinkBase {
-  // TODO(floitsch): provide more efficient conversions when the input is
-  // not a String.
-
-  final Sink<List<int>> _sink;
-
-  _WindowsCodePageEncoderSink(this._sink);
-
-  void close() {
-    _sink.close();
-  }
-
-  void add(String string) {
-    List<int> encoded = _WindowsCodePageEncoder._encodeString(string);
-    if (encoded == null) {
-      throw new FormatException("Invalid character for encoding");
-    }
-    _sink.add(encoded);
-  }
-
-  void addSlice(String source, int start, int end, bool isLast) {
-    if (start != 0 || end != source.length) {
-      source = source.substring(start, end);
-    }
-    add(source);
-    if (isLast) close();
-  }
-}
-
-class _WindowsCodePageDecoder extends Converter<List<int>, String> {
-  const _WindowsCodePageDecoder();
-
-  String convert(List<int> input) {
-    return _decodeBytes(input);
-  }
-
-  /**
-   * Starts a chunked conversion.
-   */
-  ByteConversionSink startChunkedConversion(Sink<String> sink) {
-    return new _WindowsCodePageDecoderSink(sink);
-  }
-
-  external static String _decodeBytes(List<int> bytes);
-}
-
-class _WindowsCodePageDecoderSink extends ByteConversionSinkBase {
-  // TODO(floitsch): provide more efficient conversions when the input is
-  // a slice.
-
-  final Sink<String> _sink;
-
-  _WindowsCodePageDecoderSink(this._sink);
-
-  void close() {
-    _sink.close();
-  }
-
-  void add(List<int> bytes) {
-    _sink.add(_WindowsCodePageDecoder._decodeBytes(bytes));
-  }
-}
diff --git a/sdk_nnbd/lib/io/sync_socket.dart b/sdk_nnbd/lib/io/sync_socket.dart
deleted file mode 100644
index 771edfd..0000000
--- a/sdk_nnbd/lib/io/sync_socket.dart
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart.io;
-
-/**
- * A low-level class for communicating synchronously over a TCP socket.
- *
- * Warning: [RawSynchronousSocket] should probably only be used to connect to
- * 'localhost'. The operations below will block the calling thread to wait for
- * a response from the network. The thread can process no other events while
- * waiting for these operations to complete. [RawSynchronousSocket] is not
- * suitable for applications that require high performance or asynchronous I/O
- * such as a server. Instead such applications should use the non-blocking
- * sockets and asynchronous operations in the Socket or RawSocket classes.
- */
-abstract class RawSynchronousSocket {
-  /**
-   * Creates a new socket connection and returns a [RawSynchronousSocket].
-   *
-   * [host] can either be a [String] or an [InternetAddress]. If [host] is a
-   * [String], [connectSync] will perform a [InternetAddress.lookup] and try
-   * all returned [InternetAddress]es, until connected. Unless a
-   * connection was established, the error from the first failing connection is
-   * returned.
-   */
-  external static RawSynchronousSocket connectSync(host, int port);
-
-  /**
-   * Returns the number of received and unread bytes in the socket that can be
-   * read.
-   */
-  int available();
-
-  /**
-   * Closes the [RawSynchronousSocket].
-   *
-   * Once [closeSync] has been called, attempting to call [readSync],
-   * [readIntoSync], [writeFromSync], [remoteAddress], and [remotePort] will
-   * cause a [SocketException] to be thrown.
-   */
-  void closeSync();
-
-  /**
-   * Reads into an existing [List<int>] from the socket into the range:
-   * [[start],[end]).
-   *
-   * Reads into an existing [List<int>] from the socket. If [start] is present,
-   * the bytes will be filled into [buffer] from index [start], otherwise index
-   * 0. If [end] is present, [end] - [start] bytes will be read into [buffer],
-   * otherwise up to [buffer.length]. If [end] == [start], no bytes are read.
-   * Returns the number of bytes read.
-   */
-  int readIntoSync(List<int> buffer, [int start = 0, int? end]);
-
-  /**
-   * Reads up to [bytes] bytes from the socket.
-   *
-   * Blocks and waits for a response of up to a specified number of bytes
-   * sent by the socket. [bytes] specifies the maximum number of bytes to
-   * be read. Returns the list of bytes read, which could be less than the
-   * value specified by [bytes].
-   */
-  List<int>? readSync(int bytes);
-
-  /**
-   * Shutdown a socket in the provided direction.
-   *
-   * Calling shutdown will never throw an exception and calling it several times
-   * is supported. If both [SocketDirection.RECEIVE] and [SocketDirection.SEND]
-   * directions are closed, the socket is closed completely, the same as if
-   * [closeSync] has been called.
-   */
-  void shutdown(SocketDirection direction);
-
-  /**
-   * Writes data from a specified range in a [List<int>] to the socket.
-   *
-   * Writes into the socket from a [List<int>]. If [start] is present, the bytes
-   * will be written to the socket starting from index [start]. If [start] is
-   * not present, the bytes will be written starting from index 0. If [end] is
-   * present, the [end] - [start] bytes will be written into the socket starting
-   * at index [start]. If [end] is not provided, [buffer.length] elements will
-   * be written to the socket starting from index [start]. If [end] == [start],
-   * nothing happens.
-   */
-  void writeFromSync(List<int> buffer, [int start = 0, int? end]);
-
-  /**
-   * The port used by this socket.
-   */
-  int get port;
-
-  /**
-   * The remote port connected to by this socket.
-   */
-  int get remotePort;
-
-  /**
-   * The [InternetAddress] used to connect this socket.
-   */
-  InternetAddress get address;
-
-  /**
-   * The remote [InternetAddress] connected to by this socket.
-   */
-  InternetAddress get remoteAddress;
-}
diff --git a/sdk_nnbd/lib/isolate/capability.dart b/sdk_nnbd/lib/isolate/capability.dart
deleted file mode 100644
index a51eec2..0000000
--- a/sdk_nnbd/lib/isolate/capability.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2014, 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.
-
-part of dart.isolate;
-
-/**
- * An unforgeable object that comes back as equal when passed through other
- * isolates.
- *
- * Sending a capability object to another isolate, and getting it back,
- * will produce an object that is equal to the original.
- * There is no other way to create objects equal to a capability object.
- *
- * Capabilities can be used as access guards: A remote isolate can send
- * a request for an operation, but it is only allowed if the request contains
- * the correct capability object.
- *
- * This allows exposing the same interface to multiple clients,
- * but restricting some operations to only those clients
- * that have also been given the corresponding capability.
- *
- * Capabilities can be used inside a single isolate,
- * but they have no advantage over
- * just using `new Object` to create a unique object,
- * and it offers no real security against other code
- * running in the same isolate.
- */
-class Capability {
-  /**
-   * Create a new unforgeable capability object.
-   */
-  external factory Capability();
-}
diff --git a/sdk_nnbd/lib/isolate/isolate.dart b/sdk_nnbd/lib/isolate/isolate.dart
deleted file mode 100644
index 881fd14..0000000
--- a/sdk_nnbd/lib/isolate/isolate.dart
+++ /dev/null
@@ -1,788 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/**
- * Concurrent programming using _isolates_:
- * independent workers that are similar to threads
- * but don't share memory,
- * communicating only via messages.
- *
- * To use this library in your code:
- *
- *     import 'dart:isolate';
- *
- * {@category VM}
- */
-library dart.isolate;
-
-import "dart:async";
-import "dart:_internal" show Since;
-import "dart:typed_data" show ByteBuffer, TypedData, Uint8List;
-
-part "capability.dart";
-
-/**
- * Thrown when an isolate cannot be created.
- */
-class IsolateSpawnException implements Exception {
-  /** Error message reported by the spawn operation. */
-  final String message;
-  @pragma("vm:entry-point")
-  IsolateSpawnException(this.message);
-  String toString() => "IsolateSpawnException: $message";
-}
-
-/**
- * An isolated Dart execution context.
- *
- * All Dart code runs in an isolate, and code can access classes and values
- * only from the same isolate. Different isolates can communicate by sending
- * values through ports (see [ReceivePort], [SendPort]).
- *
- * An `Isolate` object is a reference to an isolate, usually different from
- * the current isolate.
- * It represents, and can be used to control, the other isolate.
- *
- * When spawning a new isolate, the spawning isolate receives an `Isolate`
- * object representing the new isolate when the spawn operation succeeds.
- *
- * Isolates run code in its own event loop, and each event may run smaller tasks
- * in a nested microtask queue.
- *
- * An `Isolate` object allows other isolates to control the event loop
- * of the isolate that it represents, and to inspect the isolate,
- * for example by pausing the isolate or by getting events when the isolate
- * has an uncaught error.
- *
- * The [controlPort] identifies and gives access to controlling the isolate,
- * and the [pauseCapability] and [terminateCapability] guard access
- * to some control operations.
- * For example, calling [pause] on an `Isolate` object created without a
- * [pauseCapability], has no effect.
- *
- * The `Isolate` object provided by a spawn operation will have the
- * control port and capabilities needed to control the isolate.
- * New isolate objects can be created without some of these capabilities
- * if necessary, using the [Isolate.Isolate] constructor.
- *
- * An `Isolate` object cannot be sent over a `SendPort`, but the control port
- * and capabilities can be sent, and can be used to create a new functioning
- * `Isolate` object in the receiving port's isolate.
- */
-class Isolate {
-  /** Argument to `ping` and `kill`: Ask for immediate action. */
-  static const int immediate = 0;
-  /** Argument to `ping` and `kill`: Ask for action before the next event. */
-  static const int beforeNextEvent = 1;
-
-  /**
-   * Control port used to send control messages to the isolate.
-   *
-   * The control port identifies the isolate.
-   *
-   * An `Isolate` object allows sending control messages
-   * through the control port.
-   *
-   * Some control messages require a specific capability to be passed along
-   * with the message (see [pauseCapability] and [terminateCapability]),
-   * otherwise the message is ignored by the isolate.
-   */
-  final SendPort controlPort;
-
-  /**
-   * Capability granting the ability to pause the isolate.
-   *
-   * This capability is required by [pause].
-   * If the capability is `null`, or if it is not the correct pause capability
-   * of the isolate identified by [controlPort],
-   * then calls to [pause] will have no effect.
-   *
-   * If the isolate is spawned in a paused state, use this capability as
-   * argument to the [resume] method in order to resume the paused isolate.
-   */
-  final Capability? pauseCapability;
-
-  /**
-   * Capability granting the ability to terminate the isolate.
-   *
-   * This capability is required by [kill] and [setErrorsFatal].
-   * If the capability is `null`, or if it is not the correct termination
-   * capability of the isolate identified by [controlPort],
-   * then calls to those methods will have no effect.
-   */
-  final Capability? terminateCapability;
-
-  /**
-   * The name of the [Isolate] displayed for debug purposes.
-   *
-   * This can be set using the `debugName` parameter in [spawn] and [spawnUri].
-   *
-   * This name does not uniquely identify an isolate. Multiple isolates in the
-   * same process may have the same `debugName`.
-   *
-   * For a given isolate, this value will be the same as the values returned by
-   * `Dart_DebugName` in the C embedding API and the `debugName` property in
-   * [IsolateMirror].
-   */
-  @Since("2.3")
-  external String? get debugName;
-
-  /**
-   * Create a new [Isolate] object with a restricted set of capabilities.
-   *
-   * The port should be a control port for an isolate, as taken from
-   * another `Isolate` object.
-   *
-   * The capabilities should be the subset of the capabilities that are
-   * available to the original isolate.
-   * Capabilities of an isolate are locked to that isolate, and have no effect
-   * anywhere else, so the capabilities should come from the same isolate as
-   * the control port.
-   *
-   * Can also be used to create an [Isolate] object from a control port, and
-   * any available capabilities, that have been sent through a [SendPort].
-   *
-   * Example:
-   * ```dart
-   * Isolate isolate = findSomeIsolate();
-   * Isolate restrictedIsolate = new Isolate(isolate.controlPort);
-   * untrustedCode(restrictedIsolate);
-   * ```
-   * This example creates a new `Isolate` object that cannot be used to
-   * pause or terminate the isolate. All the untrusted code can do is to
-   * inspect the isolate and see uncaught errors or when it terminates.
-   */
-  Isolate(this.controlPort, {this.pauseCapability, this.terminateCapability});
-
-  /**
-   * Return an [Isolate] object representing the current isolate.
-   *
-   * The current isolate for code using [current]
-   * is the isolate running the code.
-   *
-   * The isolate object provides the capabilities required to inspect,
-   * pause or kill the isolate, and allows granting these capabilities
-   * to others.
-   *
-   * It is possible to pause the current isolate, but doing so *without*
-   * first passing the ability to resume it again to another isolate,
-   * is a sure way to hang your program.
-   */
-  external static Isolate get current;
-
-  /**
-   * The location of the package configuration of the current isolate, if any.
-   *
-   * This getter returns `null`, as the `packages/` directory is not supported
-   * in Dart 2.
-   */
-  @Deprecated('packages/ directory resolution is not supported in Dart 2.')
-  external static Future<Uri?> get packageRoot;
-
-  /**
-   * The package root of the current isolate, if any.
-   *
-   * If the isolate is using a [packageRoot] or the isolate has not been
-   * setup for package resolution, this getter returns `null`, otherwise it
-   * returns the package config URI.
-   */
-  external static Future<Uri?> get packageConfig;
-
-  /**
-   * Maps a package: URI to a non-package Uri.
-   *
-   * If there is no valid mapping from the package: URI in the current
-   * isolate, then this call returns `null`. Non-package: URIs are
-   * returned unmodified.
-   */
-  external static Future<Uri?> resolvePackageUri(Uri packageUri);
-
-  /**
-   * Creates and spawns an isolate that shares the same code as the current
-   * isolate.
-   *
-   * The argument [entryPoint] specifies the initial function to call
-   * in the spawned isolate.
-   * The entry-point function is invoked in the new isolate with [message]
-   * as the only argument.
-   *
-   * The function must be a top-level function or a static method
-   * that can be called with a single argument,
-   * that is, a compile-time constant function value
-   * which accepts at least one positional parameter
-   * and has at most one required positional parameter.
-   * The function may accept any number of optional parameters,
-   * as long as it *can* be called with just a single argument.
-   * The function must not be the value of a function expression
-   * or an instance method tear-off.
-   *
-   * Usually the initial [message] contains a [SendPort] so
-   * that the spawner and spawnee can communicate with each other.
-   *
-   * If the [paused] parameter is set to `true`,
-   * the isolate will start up in a paused state,
-   * just before calling the [entryPoint] function with the [message],
-   * as if by an initial call of `isolate.pause(isolate.pauseCapability)`.
-   * To resume the isolate, call `isolate.resume(isolate.pauseCapability)`.
-   *
-   * If the [errorsAreFatal], [onExit] and/or [onError] parameters are provided,
-   * the isolate will act as if, respectively, [setErrorsFatal],
-   * [addOnExitListener] and [addErrorListener] were called with the
-   * corresponding parameter and was processed before the isolate starts
-   * running.
-   *
-   * If [debugName] is provided, the spawned [Isolate] will be identifiable by
-   * this name in debuggers and logging.
-   *
-   * If [errorsAreFatal] is omitted, the platform may choose a default behavior
-   * or inherit the current isolate's behavior.
-   *
-   * You can also call the [setErrorsFatal], [addOnExitListener] and
-   * [addErrorListener] methods on the returned isolate, but unless the
-   * isolate was started as [paused], it may already have terminated
-   * before those methods can complete.
-   *
-   * Returns a future which will complete with an [Isolate] instance if the
-   * spawning succeeded. It will complete with an error otherwise.
-   */
-  external static Future<Isolate> spawn<T>(
-      void entryPoint(T message), T message,
-      {bool paused = false,
-      bool errorsAreFatal = true,
-      SendPort? onExit,
-      SendPort? onError,
-      @Since("2.3") String? debugName});
-
-  /**
-   * Creates and spawns an isolate that runs the code from the library with
-   * the specified URI.
-   *
-   * The isolate starts executing the top-level `main` function of the library
-   * with the given URI.
-   *
-   * The target `main` must be callable with zero, one or two arguments.
-   * Examples:
-   *
-   * * `main()`
-   * * `main(args)`
-   * * `main(args, message)`
-   *
-   * When present, the parameter `args` is set to the provided [args] list.
-   * When present, the parameter `message` is set to the initial [message].
-   *
-   * If the [paused] parameter is set to `true`,
-   * the isolate will start up in a paused state,
-   * as if by an initial call of `isolate.pause(isolate.pauseCapability)`.
-   * To resume the isolate, call `isolate.resume(isolate.pauseCapability)`.
-   *
-   * If the [errorsAreFatal], [onExit] and/or [onError] parameters are provided,
-   * the isolate will act as if, respectively, [setErrorsFatal],
-   * [addOnExitListener] and [addErrorListener] were called with the
-   * corresponding parameter and was processed before the isolate starts
-   * running.
-   *
-   * You can also call the [setErrorsFatal], [addOnExitListener] and
-   * [addErrorListener] methods on the returned isolate, but unless the
-   * isolate was started as [paused], it may already have terminated
-   * before those methods can complete.
-   *
-   * If the [checked] parameter is set to `true` or `false`,
-   * the new isolate will run code in checked mode (enabling asserts and type
-   * checks), respectively in production mode (disabling asserts and type
-   * checks), if possible. If the parameter is omitted, the new isolate will
-   * inherit the value from the current isolate.
-   *
-   * In Dart2 strong mode, the `checked` parameter only controls asserts, but
-   * not type checks.
-   *
-   * It may not always be possible to honor the `checked` parameter.
-   * If the isolate code was pre-compiled, it may not be possible to change
-   * the checked mode setting dynamically.
-   * In that case, the `checked` parameter is ignored.
-   *
-   * WARNING: The [checked] parameter is not implemented on all platforms yet.
-   *
-   * If the [packageConfig] parameter is provided, then it is used to find the
-   * location of a package resolution configuration file for the spawned
-   * isolate.
-   *
-   * If the [automaticPackageResolution] parameter is provided, then the
-   * location of the package sources in the spawned isolate is automatically
-   * determined.
-   *
-   * The [environment] is a mapping from strings to strings which the
-   * spawned isolate uses when looking up [String.fromEnvironment] values.
-   * The system may add its own entries to environment as well.
-   * If `environment` is omitted, the spawned isolate has the same environment
-   * declarations as the spawning isolate.
-   *
-   * WARNING: The [environment] parameter is not implemented on all
-   * platforms yet.
-   *
-   * If [debugName] is provided, the spawned [Isolate] will be identifiable by
-   * this name in debuggers and logging.
-   *
-   * Returns a future that will complete with an [Isolate] instance if the
-   * spawning succeeded. It will complete with an error otherwise.
-   */
-  external static Future<Isolate> spawnUri(
-      Uri uri,
-      List<String> args,
-      var message,
-      {bool paused = false,
-      SendPort? onExit,
-      SendPort? onError,
-      bool errorsAreFatal = true,
-      bool? checked,
-      Map<String, String>? environment,
-      @Deprecated('The packages/ dir is not supported in Dart 2')
-          Uri? packageRoot,
-      Uri? packageConfig,
-      bool automaticPackageResolution = false,
-      @Since("2.3")
-          String? debugName});
-
-  /**
-   * Requests the isolate to pause.
-   *
-   * When the isolate receives the pause command, it stops
-   * processing events from the event loop queue.
-   * It may still add new events to the queue in response to, e.g., timers
-   * or receive-port messages. When the isolate is resumed,
-   * it starts handling the already enqueued events.
-   *
-   * The pause request is sent through the isolate's command port,
-   * which bypasses the receiving isolate's event loop.
-   * The pause takes effect when it is received, pausing the event loop
-   * as it is at that time.
-   *
-   * The [resumeCapability] is used to identity the pause,
-   * and must be used again to end the pause using [resume].
-   * If [resumeCapability] is omitted, a new capability object is created
-   * and used instead.
-   *
-   * If an isolate is paused more than once using the same capability,
-   * only one resume with that capability is needed to end the pause.
-   *
-   * If an isolate is paused using more than one capability,
-   * each pause must be individually ended before the isolate resumes.
-   *
-   * Returns the capability that must be used to end the pause.
-   * This is either [resumeCapability], or a new capability when
-   * [resumeCapability] is omitted.
-   *
-   * If [pauseCapability] is `null`, or it's not the pause capability
-   * of the isolate identified by [controlPort],
-   * the pause request is ignored by the receiving isolate.
-   */
-  Capability pause([Capability? resumeCapability]) {
-    resumeCapability ??= new Capability();
-    _pause(resumeCapability);
-    return resumeCapability;
-  }
-
-  /** Internal implementation of [pause]. */
-  external void _pause(Capability resumeCapability);
-
-  /**
-   * Resumes a paused isolate.
-   *
-   * Sends a message to an isolate requesting that it ends a pause
-   * that was previously requested.
-   *
-   * When all active pause requests have been cancelled, the isolate
-   * will continue processing events and handling normal messages.
-   *
-   * If the [resumeCapability] is not one that has previously been used
-   * to pause the isolate, or it has already been used to resume from
-   * that pause, the resume call has no effect.
-   */
-  external void resume(Capability resumeCapability);
-
-  /**
-   * Requests an exit message on [responsePort] when the isolate terminates.
-   *
-   * The isolate will send [response] as a message on [responsePort] as the last
-   * thing before it terminates. It will run no further code after the message
-   * has been sent.
-   *
-   * Adding the same port more than once will only cause it to receive one exit
-   * message, using the last response value that was added,
-   * and it only needs to be removed once using [removeOnExitListener].
-   *
-   * If the isolate has terminated before it can receive this request,
-   * no exit message will be sent.
-   *
-   * The [response] object must follow the same restrictions as enforced by
-   * [SendPort.send].
-   * It is recommended to only use simple values that can be sent to all
-   * isolates, like `null`, booleans, numbers or strings.
-   *
-   * Since isolates run concurrently, it's possible for it to exit before the
-   * exit listener is established, and in that case no response will be
-   * sent on [responsePort].
-   * To avoid this, either use the corresponding parameter to the spawn
-   * function, or start the isolate paused, add the listener and
-   * then resume the isolate.
-   */
-  /* TODO(lrn): Can we do better? Can the system recognize this message and
-   * send a reply if the receiving isolate is dead?
-   */
-  external void addOnExitListener(SendPort responsePort, {Object? response});
-
-  /**
-   * Stops listening for exit messages from the isolate.
-   *
-   * Requests for the isolate to not send exit messages on [responsePort].
-   * If the isolate isn't expecting to send exit messages on [responsePort],
-   * because the port hasn't been added using [addOnExitListener],
-   * or because it has already been removed, the request is ignored.
-   *
-   * If the same port has been passed via [addOnExitListener] more than once,
-   * only one call to `removeOnExitListener` is needed to stop it from receiving
-   * exit messages.
-   *
-   * Closing the receive port that is associated with the [responsePort] does
-   * not stop the isolate from sending uncaught errors, they are just going to
-   * be lost.
-   *
-   * An exit message may still be sent if the isolate terminates
-   * before this request is received and processed.
-   */
-  external void removeOnExitListener(SendPort responsePort);
-
-  /**
-   * Sets whether uncaught errors will terminate the isolate.
-   *
-   * If errors are fatal, any uncaught error will terminate the isolate
-   * event loop and shut down the isolate.
-   *
-   * This call requires the [terminateCapability] for the isolate.
-   * If the capability is absent or incorrect, no change is made.
-   *
-   * Since isolates run concurrently, it's possible for the receiving isolate
-   * to exit due to an error, before a request, using this method, has been
-   * received and processed.
-   * To avoid this, either use the corresponding parameter to the spawn
-   * function, or start the isolate paused, set errors non-fatal and
-   * then resume the isolate.
-   */
-  external void setErrorsFatal(bool errorsAreFatal);
-
-  /**
-   * Requests the isolate to shut down.
-   *
-   * The isolate is requested to terminate itself.
-   * The [priority] argument specifies when this must happen.
-   *
-   * The [priority], when provided, must be one of [immediate] or
-   * [beforeNextEvent] (the default).
-   * The shutdown is performed at different times depending on the priority:
-   *
-   * * `immediate`: The isolate shuts down as soon as possible.
-   *     Control messages are handled in order, so all previously sent control
-   *     events from this isolate will all have been processed.
-   *     The shutdown should happen no later than if sent with
-   *     `beforeNextEvent`.
-   *     It may happen earlier if the system has a way to shut down cleanly
-   *     at an earlier time, even during the execution of another event.
-   * * `beforeNextEvent`: The shutdown is scheduled for the next time
-   *     control returns to the event loop of the receiving isolate,
-   *     after the current event, and any already scheduled control events,
-   *     are completed.
-   *
-   * If [terminateCapability] is `null`, or it's not the terminate capability
-   * of the isolate identified by [controlPort],
-   * the kill request is ignored by the receiving isolate.
-   */
-  external void kill({int priority = beforeNextEvent});
-
-  /**
-   * Requests that the isolate send [response] on the [responsePort].
-   *
-   * The [response] object must follow the same restrictions as enforced by
-   * [SendPort.send].
-   * It is recommended to only use simple values that can be sent to all
-   * isolates, like `null`, booleans, numbers or strings.
-   *
-   * If the isolate is alive, it will eventually send `response`
-   * (defaulting to `null`) on the response port.
-   *
-   * The [priority] must be one of [immediate] or [beforeNextEvent].
-   * The response is sent at different times depending on the ping type:
-   *
-   * * `immediate`: The isolate responds as soon as it receives the
-   *     control message. This is after any previous control message
-   *     from the same isolate has been received and processed,
-   *     but may be during execution of another event.
-   * * `beforeNextEvent`: The response is scheduled for the next time
-   *     control returns to the event loop of the receiving isolate,
-   *     after the current event, and any already scheduled control events,
-   *     are completed.
-   */
-  external void ping(SendPort responsePort,
-      {Object? response, int priority = immediate});
-
-  /**
-   * Requests that uncaught errors of the isolate are sent back to [port].
-   *
-   * The errors are sent back as two elements lists.
-   * The first element is a `String` representation of the error, usually
-   * created by calling `toString` on the error.
-   * The second element is a `String` representation of an accompanying
-   * stack trace, or `null` if no stack trace was provided.
-   * To convert this back to a [StackTrace] object, use [StackTrace.fromString].
-   *
-   * Listening using the same port more than once does nothing.
-   * A port will only receive each error once,
-   * and will only need to be removed once using [removeErrorListener].
-
-   * Closing the receive port that is associated with the port does not stop
-   * the isolate from sending uncaught errors, they are just going to be lost.
-   * Instead use [removeErrorListener] to stop receiving errors on [port].
-   *
-   * Since isolates run concurrently, it's possible for it to exit before the
-   * error listener is established. To avoid this, start the isolate paused,
-   * add the listener and then resume the isolate.
-   */
-  external void addErrorListener(SendPort port);
-
-  /**
-   * Stops listening for uncaught errors from the isolate.
-   *
-   * Requests for the isolate to not send uncaught errors on [port].
-   * If the isolate isn't expecting to send uncaught errors on [port],
-   * because the port hasn't been added using [addErrorListener],
-   * or because it has already been removed, the request is ignored.
-   *
-   * If the same port has been passed via [addErrorListener] more than once,
-   * only one call to `removeErrorListener` is needed to stop it from receiving
-   * uncaught errors.
-   *
-   * Uncaught errors message may still be sent by the isolate
-   * until this request is received and processed.
-   */
-  external void removeErrorListener(SendPort port);
-
-  /**
-   * Returns a broadcast stream of uncaught errors from the isolate.
-   *
-   * Each error is provided as an error event on the stream.
-   *
-   * The actual error object and stackTraces will not necessarily
-   * be the same object types as in the actual isolate, but they will
-   * always have the same [Object.toString] result.
-   *
-   * This stream is based on [addErrorListener] and [removeErrorListener].
-   */
-  Stream get errors {
-    StreamController controller = StreamController.broadcast(sync: true);
-    RawReceivePort? port;
-    void handleError(Object? message) {
-      var listMessage = message as List<Object?>;
-      var errorDescription = listMessage[0] as String;
-      var stackDescription = listMessage[1] as String;
-      var error = new RemoteError(errorDescription, stackDescription);
-      controller.addError(error, error.stackTrace);
-    }
-
-    controller.onListen = () {
-      RawReceivePort receivePort = new RawReceivePort(handleError);
-      port = receivePort;
-      this.addErrorListener(receivePort.sendPort);
-    };
-    controller.onCancel = () {
-      var listenPort = port!;
-      port = null;
-      this.removeErrorListener(listenPort.sendPort);
-      listenPort.close();
-    };
-    return controller.stream;
-  }
-}
-
-/**
- * Sends messages to its [ReceivePort]s.
- *
- * [SendPort]s are created from [ReceivePort]s. Any message sent through
- * a [SendPort] is delivered to its corresponding [ReceivePort]. There might be
- * many [SendPort]s for the same [ReceivePort].
- *
- * [SendPort]s can be transmitted to other isolates, and they preserve equality
- * when sent.
- */
-abstract class SendPort implements Capability {
-  /**
-   * Sends an asynchronous [message] through this send port, to its
-   * corresponding `ReceivePort`.
-   *
-   * The content of [message] can be: primitive values (null, num, bool, double,
-   * String), instances of [SendPort], and lists and maps whose elements are any
-   * of these. List and maps are also allowed to be cyclic.
-   *
-   * In the special circumstances when two isolates share the same code and are
-   * running in the same process (e.g. isolates created via [Isolate.spawn]), it
-   * is also possible to send object instances (which would be copied in the
-   * process). This is currently only supported by the dart vm.
-   *
-   * The send happens immediately and doesn't block.  The corresponding receive
-   * port can receive the message as soon as its isolate's event loop is ready
-   * to deliver it, independently of what the sending isolate is doing.
-   */
-  void send(Object? message);
-
-  /**
-   * Tests whether [other] is a [SendPort] pointing to the same
-   * [ReceivePort] as this one.
-   */
-  bool operator ==(var other);
-
-  /**
-   * Returns an immutable hash code for this send port that is
-   * consistent with the == operator.
-   */
-  int get hashCode;
-}
-
-/**
- * Together with [SendPort], the only means of communication between isolates.
- *
- * [ReceivePort]s have a `sendPort` getter which returns a [SendPort].
- * Any message that is sent through this [SendPort]
- * is delivered to the [ReceivePort] it has been created from. There, the
- * message is dispatched to the `ReceivePort`'s listener.
- *
- * A [ReceivePort] is a non-broadcast stream. This means that it buffers
- * incoming messages until a listener is registered. Only one listener can
- * receive messages. See [Stream.asBroadcastStream] for transforming the port
- * to a broadcast stream.
- *
- * A [ReceivePort] may have many [SendPort]s.
- */
-abstract class ReceivePort implements Stream<dynamic> {
-  /**
-   * Opens a long-lived port for receiving messages.
-   *
-   * A [ReceivePort] is a non-broadcast stream. This means that it buffers
-   * incoming messages until a listener is registered. Only one listener can
-   * receive messages. See [Stream.asBroadcastStream] for transforming the port
-   * to a broadcast stream.
-   *
-   * A receive port is closed by canceling its subscription.
-   */
-  external factory ReceivePort();
-
-  /**
-   * Creates a [ReceivePort] from a [RawReceivePort].
-   *
-   * The handler of the given [rawPort] is overwritten during the construction
-   * of the result.
-   */
-  external factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort);
-
-  /**
-   * Inherited from [Stream].
-   *
-   * Note that [onError] and [cancelOnError] are ignored since a ReceivePort
-   * will never receive an error.
-   *
-   * The [onDone] handler will be called when the stream closes.
-   * The stream closes when [close] is called.
-   */
-  StreamSubscription<dynamic> listen(void onData(var message)?,
-      {Function? onError, void onDone()?, bool? cancelOnError});
-
-  /**
-   * Closes `this`.
-   *
-   * If the stream has not been canceled yet, adds a close-event to the event
-   * queue and discards any further incoming messages.
-   *
-   * If the stream has already been canceled this method has no effect.
-   */
-  void close();
-
-  /**
-   * Returns a [SendPort] that sends to this receive port.
-   */
-  SendPort get sendPort;
-}
-
-abstract class RawReceivePort {
-  /**
-   * Opens a long-lived port for receiving messages.
-   *
-   * A [RawReceivePort] is low level and does not work with [Zone]s. It
-   * can not be paused. The data-handler must be set before the first
-   * event is received.
-   */
-  external factory RawReceivePort([Function? handler]);
-
-  /**
-   * Sets the handler that is invoked for every incoming message.
-   *
-   * The handler is invoked in the root-zone ([Zone.root]).
-   */
-  void set handler(Function? newHandler);
-
-  /**
-   * Closes the port.
-   *
-   * After a call to this method any incoming message is silently dropped.
-   */
-  void close();
-
-  /**
-   * Returns a [SendPort] that sends to this raw receive port.
-   */
-  SendPort get sendPort;
-}
-
-/**
- * Description of an error from another isolate.
- *
- * This error has the same `toString()` and `stackTrace.toString()` behavior
- * as the original error, but has no other features of the original error.
- */
-class RemoteError implements Error {
-  final String _description;
-  final StackTrace stackTrace;
-  RemoteError(String description, String stackDescription)
-      : _description = description,
-        stackTrace = new StackTrace.fromString(stackDescription);
-  String toString() => _description;
-}
-
-/**
- * An efficiently transferable sequence of byte values.
- *
- * A [TransferableTypedData] is created from a number of bytes.
- * This will take time proportional to the number of bytes.
- *
- * The [TransferableTypedData] can be moved between isolates, so
- * sending it through a send port will only take constant time.
- *
- * When sent this way, the local transferable can no longer be materialized,
- * and the received object is now the only way to materialize the data.
- */
-@Since("2.3.2")
-abstract class TransferableTypedData {
-  /**
-   * Creates a new [TransferableTypedData] containing the bytes of [list].
-   *
-   * It must be possible to create a single [Uint8List] containing the
-   * bytes, so if there are more bytes than what the platform allows in
-   * a single [Uint8List], then creation fails.
-   */
-  external factory TransferableTypedData.fromList(List<TypedData> list);
-
-  /**
-   * Creates a new [ByteBuffer] containing the bytes stored in this [TransferableTypedData].
-   *
-   * The [TransferableTypedData] is a cross-isolate single-use resource.
-   * This method must not be called more than once on the same underlying
-   * transferable bytes, even if the calls occur in different isolates.
-   */
-  ByteBuffer materialize();
-}
diff --git a/sdk_nnbd/lib/isolate/isolate_sources.gni b/sdk_nnbd/lib/isolate/isolate_sources.gni
deleted file mode 100644
index 8af8ba1..0000000
--- a/sdk_nnbd/lib/isolate/isolate_sources.gni
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2017, 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.
-
-isolate_sdk_sources = [
-  "isolate.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "capability.dart",
-]
diff --git a/sdk_nnbd/lib/js/_js.dart b/sdk_nnbd/lib/js/_js.dart
deleted file mode 100644
index aef7ef9..0000000
--- a/sdk_nnbd/lib/js/_js.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2018, 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.
-
-/// Helper library used by `dart:js`.
-///
-/// This library hides any logic that is specific to the web, and allows us to
-/// support `dart:js` for compiling to javascript on the server (e.g. to target
-/// nodejs).
-library dart._js;
-
-/// Whether `o` is a browser object such as `Blob`, `Event`, `KeyRange`,
-/// `ImageData`, `Node`, and `Window`.
-///
-/// On non-web targets, this function always returns false.
-external bool isBrowserObject(dynamic o);
-
-/// Convert a browser object to it's Dart counterpart. None of these types are
-/// wrapped, but this function is needed to inform dart2js about the possible
-/// types that are used and that therefore cannot be tree-shaken.
-external Object convertFromBrowserObject(dynamic o);
diff --git a/sdk_nnbd/lib/js/_js_annotations.dart b/sdk_nnbd/lib/js/_js_annotations.dart
deleted file mode 100644
index 8c8148d..0000000
--- a/sdk_nnbd/lib/js/_js_annotations.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// An implementation of the JS interop classes which are usable from the
-// Dart SDK. These types need to stay in-sync with
-// https://github.com/dart-lang/sdk/blob/master/pkg/js/lib/js.dart
-library _js_annotations;
-
-class JS {
-  final String name;
-  const JS([this.name]);
-}
-
-class _Anonymous {
-  const _Anonymous();
-}
-
-const _Anonymous anonymous = const _Anonymous();
diff --git a/sdk_nnbd/lib/js/_js_client.dart b/sdk_nnbd/lib/js/_js_client.dart
deleted file mode 100644
index de25540..0000000
--- a/sdk_nnbd/lib/js/_js_client.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:html' show Blob, Event, ImageData, Node, Window, WorkerGlobalScope;
-import 'dart:indexed_db' show KeyRange;
-import 'dart:_js_helper' show patch;
-import 'dart:_foreign_helper' show JS;
-
-@patch
-bool isBrowserObject(dynamic o) =>
-    o is Blob ||
-    o is Event ||
-    o is KeyRange ||
-    o is ImageData ||
-    o is Node ||
-    o is Window ||
-    o is WorkerGlobalScope;
-
-@patch
-Object convertFromBrowserObject(dynamic o) =>
-    JS('Blob|Event|KeyRange|ImageData|Node|Window|WorkerGlobalScope', '#', o);
diff --git a/sdk_nnbd/lib/js/_js_server.dart b/sdk_nnbd/lib/js/_js_server.dart
deleted file mode 100644
index b941d77..0000000
--- a/sdk_nnbd/lib/js/_js_server.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:_js_helper' show patch;
-
-@patch
-bool isBrowserObject(dynamic o) => false;
-
-@patch
-Object convertFromBrowserObject(dynamic o) => o;
diff --git a/sdk_nnbd/lib/js/js.dart b/sdk_nnbd/lib/js/js.dart
deleted file mode 100644
index 26a6141..0000000
--- a/sdk_nnbd/lib/js/js.dart
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Low-level support for interoperating with JavaScript.
-///
-/// You should usually use `package:js` instead of this library. For more
-/// information, see the [JS interop page](https://dart.dev/web/js-interop).
-///
-/// This library provides access to JavaScript objects from Dart, allowing
-/// Dart code to get and set properties, and call methods of JavaScript objects
-/// and invoke JavaScript functions. The library takes care of converting
-/// between Dart and JavaScript objects where possible, or providing proxies if
-/// conversion isn't possible.
-///
-/// This library does not make Dart objects usable from JavaScript, their
-/// methods and properties are not accessible, though it does allow Dart
-/// functions to be passed into and called from JavaScript.
-///
-/// [JsObject] is the core type and represents a proxy of a JavaScript object.
-/// JsObject gives access to the underlying JavaScript objects properties and
-/// methods. `JsObject`s can be acquired by calls to JavaScript, or they can be
-/// created from proxies to JavaScript constructors.
-///
-/// The top-level getter [context] provides a [JsObject] that represents the
-/// global object in JavaScript, usually `window`.
-///
-/// The following example shows an alert dialog via a JavaScript call to the
-/// global function `alert()`:
-///
-///     import 'dart:js';
-///
-///     main() => context.callMethod('alert', ['Hello from Dart!']);
-///
-/// This example shows how to create a [JsObject] from a JavaScript constructor
-/// and access its properties:
-///
-///     import 'dart:js';
-///
-///     main() {
-///       var object = JsObject(context['Object']);
-///       object['greeting'] = 'Hello';
-///       object['greet'] = (name) => "${object['greeting']} $name";
-///       var message = object.callMethod('greet', ['JavaScript']);
-///       context['console'].callMethod('log', [message]);
-///     }
-///
-/// ## Proxying and automatic conversion
-///
-/// When setting properties on a JsObject or passing arguments to a Javascript
-/// method or function, Dart objects are automatically converted or proxied to
-/// JavaScript objects. When accessing JavaScript properties, or when a Dart
-/// closure is invoked from JavaScript, the JavaScript objects are also
-/// converted to Dart.
-///
-/// Functions and closures are proxied in such a way that they are callable. A
-/// Dart closure assigned to a JavaScript property is proxied by a function in
-/// JavaScript. A JavaScript function accessed from Dart is proxied by a
-/// [JsFunction], which has a [JsFunction.apply] method to invoke it.
-///
-/// The following types are transferred directly and not proxied:
-///
-///   * Basic types: `null`, `bool`, `num`, `String`, `DateTime`
-///   * `TypedData`, including its subclasses like `Int32List`, but _not_
-///     `ByteBuffer`
-///   * When compiling for the web, also: `Blob`, `Event`, `ImageData`,
-///     `KeyRange`, `Node`, and `Window`.
-///
-/// ## Converting collections with JsObject.jsify()
-///
-/// To create a JavaScript collection from a Dart collection use the
-/// [JsObject.jsify] constructor, which converts Dart [Map]s and [Iterable]s
-/// into JavaScript Objects and Arrays.
-///
-/// The following expression creates a new JavaScript object with the properties
-/// `a` and `b` defined:
-///
-///     var jsMap = JsObject.jsify({'a': 1, 'b': 2});
-///
-/// This expression creates a JavaScript array:
-///
-///     var jsArray = JsObject.jsify([1, 2, 3]);
-///
-/// {@category Web}
-library dart.js;
-
-import 'dart:collection' show ListMixin;
-
-/// The JavaScript global object, usually `window`.
-external JsObject get context;
-
-/// A proxy on a JavaScript object.
-///
-/// The properties of the JavaScript object are accessible via the `[]` and
-/// `[]=` operators. Methods are callable via [callMethod].
-class JsObject {
-  /// Constructs a JavaScript object from its native [constructor] and returns
-  /// a proxy to it.
-  external factory JsObject(JsFunction constructor, [List? arguments]);
-
-  /// Constructs a [JsObject] that proxies a native Dart object; _for expert use
-  /// only_.
-  ///
-  /// Use this constructor only if you wish to get access to JavaScript
-  /// properties attached to a browser host object, such as a Node or Blob, that
-  /// is normally automatically converted into a native Dart object.
-  ///
-  /// An exception will be thrown if [object] has the type
-  /// `bool`, `num`, or `String`.
-  external factory JsObject.fromBrowserObject(Object object);
-
-  /// Recursively converts a JSON-like collection of Dart objects to a
-  /// collection of JavaScript objects and returns a [JsObject] proxy to it.
-  ///
-  /// [object] must be a [Map] or [Iterable], the contents of which are also
-  /// converted. Maps and Iterables are copied to a new JavaScript object.
-  /// Primitives and other transferable values are directly converted to their
-  /// JavaScript type, and all other objects are proxied.
-  external factory JsObject.jsify(Object object);
-
-  /// Returns the value associated with [property] from the proxied JavaScript
-  /// object.
-  ///
-  /// The type of [property] must be either [String] or [num].
-  external dynamic operator [](Object property);
-
-  // Sets the value associated with [property] on the proxied JavaScript
-  // object.
-  //
-  // The type of [property] must be either [String] or [num].
-  external void operator []=(Object property, Object? value);
-
-  int get hashCode => 0;
-
-  external bool operator ==(Object other);
-
-  /// Returns `true` if the JavaScript object contains the specified property
-  /// either directly or though its prototype chain.
-  ///
-  /// This is the equivalent of the `in` operator in JavaScript.
-  external bool hasProperty(Object property);
-
-  /// Removes [property] from the JavaScript object.
-  ///
-  /// This is the equivalent of the `delete` operator in JavaScript.
-  external void deleteProperty(Object property);
-
-  /// Returns `true` if the JavaScript object has [type] in its prototype chain.
-  ///
-  /// This is the equivalent of the `instanceof` operator in JavaScript.
-  external bool instanceof(JsFunction type);
-
-  /// Returns the result of the JavaScript objects `toString` method.
-  external String toString();
-
-  /// Calls [method] on the JavaScript object with the arguments [args] and
-  /// returns the result.
-  ///
-  /// The type of [method] must be either [String] or [num].
-  external dynamic callMethod(Object method, [List? args]);
-}
-
-/// A proxy on a JavaScript Function object.
-class JsFunction extends JsObject {
-  /// Returns a [JsFunction] that captures its 'this' binding and calls [f]
-  /// with the value of JavaScript `this` passed as the first argument.
-  external factory JsFunction.withThis(Function f);
-
-  /// Invokes the JavaScript function with arguments [args]. If [thisArg] is
-  /// supplied it is the value of `this` for the invocation.
-  external dynamic apply(List args, {thisArg});
-}
-
-/// A [List] that proxies a JavaScript array.
-class JsArray<E> extends JsObject with ListMixin<E> {
-  /// Creates an empty JavaScript array.
-  external factory JsArray();
-
-  /// Creates a new JavaScript array and initializes it to the contents of
-  /// [other].
-  external factory JsArray.from(Iterable<E> other);
-
-  // Methods required by ListMixin
-
-  external E operator [](Object index);
-
-  external void operator []=(Object index, E value);
-
-  external int get length;
-
-  external void set length(int length);
-
-  // Methods overridden for better performance
-
-  external void add(E value);
-
-  external void addAll(Iterable<E> iterable);
-
-  external void insert(int index, E element);
-
-  external E removeAt(int index);
-
-  external E removeLast();
-
-  external void removeRange(int start, int end);
-
-  external void setRange(int start, int end, Iterable<E> iterable,
-      [int skipCount = 0]);
-
-  external void sort([int compare(E a, E b)?]);
-}
-
-/// Returns a wrapper around function [f] that can be called from JavaScript
-/// using `package:js` JavaScript interop.
-///
-/// The calling conventions in Dart2Js differ from JavaScript and so, by
-/// default, it is not possible to call a Dart function directly. Wrapping with
-/// `allowInterop` creates a function that can be called from JavaScript or
-/// Dart. The semantics of the wrapped function are still more strict than
-/// JavaScript, and the function will throw if called with too many or too few
-/// arguments.
-///
-/// Calling this method repeatedly on a function will return the same result.
-external F allowInterop<F extends Function>(F f);
-
-/// Returns a wrapper around function [f] that can be called from JavaScript
-/// using `package:js` JavaScript interop, passing JavaScript `this` as the first
-/// argument.
-///
-/// See [allowInterop].
-///
-/// When called from Dart, [null] will be passed as the first argument.
-external Function allowInteropCaptureThis(Function f);
diff --git a/sdk_nnbd/lib/js/js_sources.gni b/sdk_nnbd/lib/js/js_sources.gni
deleted file mode 100644
index 6308b38..0000000
--- a/sdk_nnbd/lib/js/js_sources.gni
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-js_sdk_sources = [ "js.dart" ]
diff --git a/sdk_nnbd/lib/js_util/js_util.dart b/sdk_nnbd/lib/js_util/js_util.dart
deleted file mode 100644
index 605f6d6..0000000
--- a/sdk_nnbd/lib/js_util/js_util.dart
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright (c) 2016, 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.
-
-/// Utility methods to manipulate `package:js` annotated JavaScript interop
-/// objects in cases where the name to call is not known at runtime.
-///
-/// You should only use these methods when the same effect cannot be achieved
-/// with `@JS()` annotations.
-///
-/// {@category Web}
-library dart.js_util;
-
-import 'dart:_foreign_helper' show JS;
-import 'dart:collection' show HashMap;
-import 'dart:async' show Completer;
-import 'dart:_js_helper' show convertDartClosureToJS;
-
-/// Recursively converts a JSON-like collection to JavaScript compatible
-/// representation.
-///
-/// WARNING: performance of this method is much worse than other util
-/// methods in this library. Only use this method as a last resort. Prefer
-/// instead to use `@anonymous` `@JS()` annotated classes to create map-like
-/// objects for JS interop.
-///
-/// The argument must be a [Map] or [Iterable], the contents of which are also
-/// deeply converted. Maps are converted into JavaScript objects. Iterables are
-/// converted into arrays. Strings, numbers, bools, and `@JS()` annotated
-/// objects are passed through unmodified. Dart objects are also passed through
-/// unmodified, but their members aren't usable from JavaScript.
-dynamic jsify(Object object) {
-  if ((object is! Map) && (object is! Iterable)) {
-    throw ArgumentError("object must be a Map or Iterable");
-  }
-  return _convertDataTree(object);
-}
-
-Object _convertDataTree(Object data) {
-  var _convertedObjects = HashMap.identity();
-
-  Object? _convert(Object? o) {
-    if (_convertedObjects.containsKey(o)) {
-      return _convertedObjects[o];
-    }
-    if (o is Map) {
-      final convertedMap = JS('=Object', '{}');
-      _convertedObjects[o] = convertedMap;
-      for (var key in o.keys) {
-        JS('=Object', '#[#]=#', convertedMap, key, _convert(o[key]));
-      }
-      return convertedMap;
-    } else if (o is Iterable) {
-      var convertedList = [];
-      _convertedObjects[o] = convertedList;
-      convertedList.addAll(o.map(_convert));
-      return convertedList;
-    } else {
-      return o;
-    }
-  }
-
-  return _convert(data)!;
-}
-
-dynamic newObject() => JS('=Object', '{}');
-
-bool hasProperty(Object o, Object name) => JS('bool', '# in #', name, o);
-
-dynamic getProperty(Object o, Object name) =>
-    JS('Object|Null', '#[#]', o, name);
-
-dynamic setProperty(Object o, Object name, Object? value) =>
-    JS('', '#[#]=#', o, name, value);
-
-dynamic callMethod(Object o, String method, List<Object?> args) =>
-    JS('Object|Null', '#[#].apply(#, #)', o, method, o, args);
-
-/// Check whether [o] is an instance of [type].
-///
-/// The value in [type] is expected to be a JS-interop object that
-/// represents a valid JavaScript constructor function.
-bool instanceof(Object? o, Object type) =>
-    JS('bool', '# instanceof #', o, type);
-
-dynamic callConstructor(Object constr, List<Object?> arguments) {
-  if (arguments == null) {
-    return JS('Object', 'new #()', constr);
-  }
-
-  if (JS('bool', '# instanceof Array', arguments)) {
-    int argumentCount = JS('int', '#.length', arguments);
-    switch (argumentCount) {
-      case 0:
-        return JS('Object', 'new #()', constr);
-
-      case 1:
-        var arg0 = JS('', '#[0]', arguments);
-        return JS('Object', 'new #(#)', constr, arg0);
-
-      case 2:
-        var arg0 = JS('', '#[0]', arguments);
-        var arg1 = JS('', '#[1]', arguments);
-        return JS('Object', 'new #(#, #)', constr, arg0, arg1);
-
-      case 3:
-        var arg0 = JS('', '#[0]', arguments);
-        var arg1 = JS('', '#[1]', arguments);
-        var arg2 = JS('', '#[2]', arguments);
-        return JS('Object', 'new #(#, #, #)', constr, arg0, arg1, arg2);
-
-      case 4:
-        var arg0 = JS('', '#[0]', arguments);
-        var arg1 = JS('', '#[1]', arguments);
-        var arg2 = JS('', '#[2]', arguments);
-        var arg3 = JS('', '#[3]', arguments);
-        return JS(
-            'Object', 'new #(#, #, #, #)', constr, arg0, arg1, arg2, arg3);
-    }
-  }
-
-  // The following code solves the problem of invoking a JavaScript
-  // constructor with an unknown number arguments.
-  // First bind the constructor to the argument list using bind.apply().
-  // The first argument to bind() is the binding of 't', so add 'null' to
-  // the arguments list passed to apply().
-  // After that, use the JavaScript 'new' operator which overrides any binding
-  // of 'this' with the new instance.
-  var args = <dynamic>[null]..addAll(arguments);
-  var factoryFunction = JS('', '#.bind.apply(#, #)', constr, constr, args);
-  // Without this line, calling factoryFunction as a constructor throws
-  JS('String', 'String(#)', factoryFunction);
-  // This could return an UnknownJavaScriptObject, or a native
-  // object for which there is an interceptor
-  return JS('Object', 'new #()', factoryFunction);
-
-  // TODO(sra): Investigate:
-  //
-  //     var jsObj = JS('', 'Object.create(#.prototype)', constr);
-  //     JS('', '#.apply(#, #)', constr, jsObj,
-  //         []..addAll(arguments.map(_convertToJS)));
-  //     return _wrapToDart(jsObj);
-}
-
-/// Converts a JavaScript Promise to a Dart [Future].
-///
-/// ```dart
-/// @JS()
-/// external Promise<num> get threePromise; // Resolves to 3
-///
-/// final Future<num> threeFuture = promiseToFuture(threePromise);
-///
-/// final three = await threeFuture; // == 3
-/// ```
-Future<T> promiseToFuture<T>(Object jsPromise) {
-  final completer = Completer<T>();
-
-  final success = convertDartClosureToJS((r) => completer.complete(r), 1);
-  final error = convertDartClosureToJS((e) => completer.completeError(e), 1);
-
-  JS('', '#.then(#, #)', jsPromise, success, error);
-  return completer.future;
-}
diff --git a/sdk_nnbd/lib/js_util/js_util_sources.gni b/sdk_nnbd/lib/js_util/js_util_sources.gni
deleted file mode 100644
index d3ac6d2..0000000
--- a/sdk_nnbd/lib/js_util/js_util_sources.gni
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-js_util_sdk_sources = [ "js_util.dart" ]
diff --git a/sdk_nnbd/lib/libraries.json b/sdk_nnbd/lib/libraries.json
deleted file mode 100644
index 5d8d5d3..0000000
--- a/sdk_nnbd/lib/libraries.json
+++ /dev/null
@@ -1,494 +0,0 @@
-{
-  "comment:0": "NOTE: THIS FILE IS GENERATED. DO NOT EDIT.",
-  "comment:1": "Instead modify 'sdk_nnbd/lib/libraries.yaml' and follow the instructions therein.",
-  "none": {
-    "libraries": {}
-  },
-  "vm": {
-    "libraries": {
-      "_builtin": {
-        "uri": "_internal/vm/bin/builtin.dart"
-      },
-      "_internal": {
-        "uri": "internal/internal.dart",
-        "patches": [
-          "_internal/vm/lib/internal_patch.dart",
-          "_internal/vm/lib/class_id_fasta.dart",
-          "_internal/vm/lib/print_patch.dart",
-          "_internal/vm/lib/symbol_patch.dart",
-          "internal/patch.dart"
-        ]
-      },
-      "async": {
-        "uri": "async/async.dart",
-        "patches": [
-          "_internal/vm/lib/async_patch.dart",
-          "_internal/vm/lib/deferred_load_patch.dart",
-          "_internal/vm/lib/schedule_microtask_patch.dart",
-          "_internal/vm/lib/timer_patch.dart"
-        ]
-      },
-      "collection": {
-        "uri": "collection/collection.dart",
-        "patches": [
-          "_internal/vm/lib/collection_patch.dart",
-          "_internal/vm/lib/compact_hash.dart"
-        ]
-      },
-      "convert": {
-        "uri": "convert/convert.dart",
-        "patches": "_internal/vm/lib/convert_patch.dart"
-      },
-      "core": {
-        "uri": "core/core.dart",
-        "patches": [
-          "_internal/vm/lib/core_patch.dart",
-          "_internal/vm/lib/array.dart",
-          "_internal/vm/lib/array_patch.dart",
-          "_internal/vm/lib/bigint_patch.dart",
-          "_internal/vm/lib/bool_patch.dart",
-          "_internal/vm/lib/date_patch.dart",
-          "_internal/vm/lib/double.dart",
-          "_internal/vm/lib/double_patch.dart",
-          "_internal/vm/lib/errors_patch.dart",
-          "_internal/vm/lib/expando_patch.dart",
-          "_internal/vm/lib/function.dart",
-          "_internal/vm/lib/function_patch.dart",
-          "_internal/vm/lib/growable_array.dart",
-          "_internal/vm/lib/identical_patch.dart",
-          "_internal/vm/lib/immutable_map.dart",
-          "_internal/vm/lib/integers.dart",
-          "_internal/vm/lib/integers_patch.dart",
-          "_internal/vm/lib/invocation_mirror_patch.dart",
-          "_internal/vm/lib/lib_prefix.dart",
-          "_internal/vm/lib/map_patch.dart",
-          "_internal/vm/lib/null_patch.dart",
-          "_internal/vm/lib/object_patch.dart",
-          "_internal/vm/lib/regexp_patch.dart",
-          "_internal/vm/lib/stacktrace.dart",
-          "_internal/vm/lib/stopwatch_patch.dart",
-          "_internal/vm/lib/string_buffer_patch.dart",
-          "_internal/vm/lib/string_patch.dart",
-          "_internal/vm/lib/type_patch.dart",
-          "_internal/vm/lib/uri_patch.dart",
-          "_internal/vm/lib/weak_property.dart"
-        ]
-      },
-      "developer": {
-        "uri": "developer/developer.dart",
-        "patches": [
-          "_internal/vm/lib/developer.dart",
-          "_internal/vm/lib/profiler.dart",
-          "_internal/vm/lib/timeline.dart"
-        ]
-      },
-      "ffi": {
-        "uri": "ffi/ffi.dart",
-        "patches": [
-          "_internal/vm/lib/ffi_patch.dart",
-          "_internal/vm/lib/ffi_dynamic_library_patch.dart",
-          "_internal/vm/lib/ffi_native_type_patch.dart",
-          "_internal/vm/lib/ffi_struct_patch.dart"
-        ]
-      },
-      "wasm": {
-        "uri": "wasm/wasm.dart",
-        "patches": [
-          "_internal/vm/lib/wasm_patch.dart"
-        ]
-      },
-      "_http": {
-        "uri": "_http/http.dart"
-      },
-      "io": {
-        "uri": "io/io.dart",
-        "patches": [
-          "_internal/vm/bin/common_patch.dart",
-          "_internal/vm/bin/directory_patch.dart",
-          "_internal/vm/bin/eventhandler_patch.dart",
-          "_internal/vm/bin/file_patch.dart",
-          "_internal/vm/bin/file_system_entity_patch.dart",
-          "_internal/vm/bin/filter_patch.dart",
-          "_internal/vm/bin/io_service_patch.dart",
-          "_internal/vm/bin/namespace_patch.dart",
-          "_internal/vm/bin/platform_patch.dart",
-          "_internal/vm/bin/process_patch.dart",
-          "_internal/vm/bin/socket_patch.dart",
-          "_internal/vm/bin/stdio_patch.dart",
-          "_internal/vm/bin/secure_socket_patch.dart",
-          "_internal/vm/bin/sync_socket_patch.dart"
-        ]
-      },
-      "isolate": {
-        "uri": "isolate/isolate.dart",
-        "patches": [
-          "_internal/vm/lib/isolate_patch.dart",
-          "_internal/vm/lib/timer_impl.dart"
-        ]
-      },
-      "math": {
-        "uri": "math/math.dart",
-        "patches": "_internal/vm/lib/math_patch.dart"
-      },
-      "mirrors": {
-        "uri": "mirrors/mirrors.dart",
-        "patches": [
-          "_internal/vm/lib/mirrors_patch.dart",
-          "_internal/vm/lib/mirrors_impl.dart",
-          "_internal/vm/lib/mirror_reference.dart"
-        ]
-      },
-      "nativewrappers": {
-        "uri": "html/dartium/nativewrappers.dart"
-      },
-      "cli": {
-        "uri": "cli/cli.dart",
-        "patches": [
-          "_internal/vm/bin/cli_patch.dart"
-        ]
-      },
-      "typed_data": {
-        "uri": "typed_data/typed_data.dart",
-        "patches": "_internal/vm/lib/typed_data_patch.dart"
-      },
-      "_vmservice": {
-        "uri": "vmservice/vmservice.dart"
-      },
-      "vmservice_io": {
-        "uri": "_internal/vm/bin/vmservice_io.dart"
-      }
-    }
-  },
-  "dart2js": {
-    "libraries": {
-      "async": {
-        "uri": "async/async.dart",
-        "patches": "_internal/js_runtime/lib/async_patch.dart"
-      },
-      "collection": {
-        "uri": "collection/collection.dart",
-        "patches": "_internal/js_runtime/lib/collection_patch.dart"
-      },
-      "convert": {
-        "uri": "convert/convert.dart",
-        "patches": "_internal/js_runtime/lib/convert_patch.dart"
-      },
-      "core": {
-        "uri": "core/core.dart",
-        "patches": "_internal/js_runtime/lib/core_patch.dart"
-      },
-      "developer": {
-        "uri": "developer/developer.dart",
-        "patches": "_internal/js_runtime/lib/developer_patch.dart"
-      },
-      "html": {
-        "uri": "html/dart2js/html_dart2js.dart"
-      },
-      "html_common": {
-        "uri": "html/html_common/html_common_dart2js.dart"
-      },
-      "indexed_db": {
-        "uri": "indexed_db/dart2js/indexed_db_dart2js.dart"
-      },
-      "_http": {
-        "uri": "_http/http.dart"
-      },
-      "io": {
-        "uri": "io/io.dart",
-        "patches": "_internal/js_runtime/lib/io_patch.dart",
-        "supported": false
-      },
-      "isolate": {
-        "uri": "isolate/isolate.dart",
-        "patches": "_internal/js_runtime/lib/isolate_patch.dart",
-        "supported": false
-      },
-      "js": {
-        "uri": "js/js.dart",
-        "patches": "_internal/js_runtime/lib/js_patch.dart"
-      },
-      "_js": {
-        "uri": "js/_js.dart",
-        "patches": "js/_js_client.dart"
-      },
-      "_js_annotations": {
-        "uri": "js/_js_annotations.dart"
-      },
-      "js_util": {
-        "uri": "js_util/js_util.dart"
-      },
-      "math": {
-        "uri": "math/math.dart",
-        "patches": "_internal/js_runtime/lib/math_patch.dart"
-      },
-      "mirrors": {
-        "uri": "mirrors/mirrors.dart",
-        "patches": "_internal/js_runtime/lib/mirrors_patch_cfe.dart",
-        "supported": false
-      },
-      "typed_data": {
-        "uri": "typed_data/typed_data.dart",
-        "patches": "_internal/js_runtime/lib/typed_data_patch.dart"
-      },
-      "_native_typed_data": {
-        "uri": "_internal/js_runtime/lib/native_typed_data.dart"
-      },
-      "svg": {
-        "uri": "svg/dart2js/svg_dart2js.dart"
-      },
-      "web_audio": {
-        "uri": "web_audio/dart2js/web_audio_dart2js.dart"
-      },
-      "web_gl": {
-        "uri": "web_gl/dart2js/web_gl_dart2js.dart"
-      },
-      "web_sql": {
-        "uri": "web_sql/dart2js/web_sql_dart2js.dart"
-      },
-      "_internal": {
-        "uri": "internal/internal.dart",
-        "patches": "_internal/js_runtime/lib/internal_patch.dart"
-      },
-      "_js_helper": {
-        "uri": "_internal/js_runtime/lib/js_helper.dart"
-      },
-      "_rti": {
-        "uri": "_internal/js_runtime/lib/rti.dart"
-      },
-      "_interceptors": {
-        "uri": "_internal/js_runtime/lib/interceptors.dart"
-      },
-      "_foreign_helper": {
-        "uri": "_internal/js_runtime/lib/foreign_helper.dart"
-      },
-      "_js_names": {
-        "uri": "_internal/js_runtime/lib/js_names.dart"
-      },
-      "_js_primitives": {
-        "uri": "_internal/js_runtime/lib/js_primitives.dart"
-      },
-      "_js_embedded_names": {
-        "uri": "_internal/js_runtime/lib/shared/embedded_names.dart"
-      },
-      "_async_await_error_codes": {
-        "uri": "_internal/js_runtime/lib/shared/async_await_error_codes.dart"
-      },
-      "_recipe_syntax": {
-        "uri": "_internal/js_runtime/lib/shared/recipe_syntax.dart"
-      },
-      "_metadata": {
-        "uri": "html/html_common/metadata.dart"
-      }
-    }
-  },
-  "dart2js_server": {
-    "libraries": {
-      "async": {
-        "uri": "async/async.dart",
-        "patches": "_internal/js_runtime/lib/async_patch.dart"
-      },
-      "collection": {
-        "uri": "collection/collection.dart",
-        "patches": "_internal/js_runtime/lib/collection_patch.dart"
-      },
-      "convert": {
-        "uri": "convert/convert.dart",
-        "patches": "_internal/js_runtime/lib/convert_patch.dart"
-      },
-      "core": {
-        "uri": "core/core.dart",
-        "patches": "_internal/js_runtime/lib/core_patch.dart"
-      },
-      "developer": {
-        "uri": "developer/developer.dart",
-        "patches": "_internal/js_runtime/lib/developer_patch.dart"
-      },
-      "_http": {
-        "uri": "_http/http.dart"
-      },
-      "io": {
-        "uri": "io/io.dart",
-        "patches": "_internal/js_runtime/lib/io_patch.dart",
-        "supported": false
-      },
-      "isolate": {
-        "uri": "isolate/isolate.dart",
-        "patches": "_internal/js_runtime/lib/isolate_patch.dart",
-        "supported": false
-      },
-      "js": {
-        "uri": "js/js.dart",
-        "patches": "_internal/js_runtime/lib/js_patch.dart"
-      },
-      "_js": {
-        "uri": "js/_js.dart",
-        "patches": "js/_js_server.dart"
-      },
-      "_js_annotations": {
-        "uri": "js/_js_annotations.dart"
-      },
-      "js_util": {
-        "uri": "js_util/js_util.dart"
-      },
-      "math": {
-        "uri": "math/math.dart",
-        "patches": "_internal/js_runtime/lib/math_patch.dart"
-      },
-      "mirrors": {
-        "uri": "mirrors/mirrors.dart",
-        "patches": "_internal/js_runtime/lib/mirrors_patch_cfe.dart",
-        "supported": false
-      },
-      "typed_data": {
-        "uri": "typed_data/typed_data.dart",
-        "patches": "_internal/js_runtime/lib/typed_data_patch.dart"
-      },
-      "_native_typed_data": {
-        "uri": "_internal/js_runtime/lib/native_typed_data.dart"
-      },
-      "_internal": {
-        "uri": "internal/internal.dart",
-        "patches": "_internal/js_runtime/lib/internal_patch.dart"
-      },
-      "_js_helper": {
-        "uri": "_internal/js_runtime/lib/js_helper.dart"
-      },
-      "_rti": {
-        "uri": "_internal/js_runtime/lib/rti.dart"
-      },
-      "_interceptors": {
-        "uri": "_internal/js_runtime/lib/interceptors.dart"
-      },
-      "_foreign_helper": {
-        "uri": "_internal/js_runtime/lib/foreign_helper.dart"
-      },
-      "_js_names": {
-        "uri": "_internal/js_runtime/lib/js_names.dart"
-      },
-      "_js_primitives": {
-        "uri": "_internal/js_runtime/lib/js_primitives.dart"
-      },
-      "_js_embedded_names": {
-        "uri": "_internal/js_runtime/lib/shared/embedded_names.dart"
-      },
-      "_async_await_error_codes": {
-        "uri": "_internal/js_runtime/lib/shared/async_await_error_codes.dart"
-      },
-      "_recipe_syntax": {
-        "uri": "_internal/js_runtime/lib/shared/recipe_syntax.dart"
-      }
-    }
-  },
-  "dartdevc": {
-    "libraries": {
-      "_runtime": {
-        "uri": "_internal/js_dev_runtime/private/ddc_runtime/runtime.dart"
-      },
-      "_debugger": {
-        "uri": "_internal/js_dev_runtime/private/debugger.dart"
-      },
-      "_foreign_helper": {
-        "uri": "_internal/js_dev_runtime/private/foreign_helper.dart"
-      },
-      "_http": {
-        "uri": "_http/http.dart"
-      },
-      "_interceptors": {
-        "uri": "_internal/js_dev_runtime/private/interceptors.dart"
-      },
-      "_internal": {
-        "uri": "internal/internal.dart",
-        "patches": "_internal/js_dev_runtime/patch/internal_patch.dart"
-      },
-      "_isolate_helper": {
-        "uri": "_internal/js_dev_runtime/private/isolate_helper.dart"
-      },
-      "_js_annotations": {
-        "uri": "js/_js_annotations.dart"
-      },
-      "_js_helper": {
-        "uri": "_internal/js_dev_runtime/private/js_helper.dart"
-      },
-      "_js_primitives": {
-        "uri": "_internal/js_dev_runtime/private/js_primitives.dart"
-      },
-      "_metadata": {
-        "uri": "html/html_common/metadata.dart"
-      },
-      "_native_typed_data": {
-        "uri": "_internal/js_dev_runtime/private/native_typed_data.dart"
-      },
-      "async": {
-        "uri": "async/async.dart",
-        "patches": "_internal/js_dev_runtime/patch/async_patch.dart"
-      },
-      "collection": {
-        "uri": "collection/collection.dart",
-        "patches": "_internal/js_dev_runtime/patch/collection_patch.dart"
-      },
-      "convert": {
-        "uri": "convert/convert.dart",
-        "patches": "_internal/js_dev_runtime/patch/convert_patch.dart"
-      },
-      "core": {
-        "uri": "core/core.dart",
-        "patches": "_internal/js_dev_runtime/patch/core_patch.dart"
-      },
-      "developer": {
-        "uri": "developer/developer.dart",
-        "patches": "_internal/js_dev_runtime/patch/developer_patch.dart"
-      },
-      "io": {
-        "uri": "io/io.dart",
-        "patches": "_internal/js_dev_runtime/patch/io_patch.dart",
-        "supported": false
-      },
-      "isolate": {
-        "uri": "isolate/isolate.dart",
-        "patches": "_internal/js_dev_runtime/patch/isolate_patch.dart",
-        "supported": false
-      },
-      "mirrors": {
-        "uri": "mirrors/mirrors.dart",
-        "patches": "_internal/js_runtime/lib/mirrors_patch_cfe.dart",
-        "supported": false
-      },
-      "math": {
-        "uri": "math/math.dart",
-        "patches": "_internal/js_dev_runtime/patch/math_patch.dart"
-      },
-      "typed_data": {
-        "uri": "typed_data/typed_data.dart",
-        "patches": "_internal/js_dev_runtime/patch/typed_data_patch.dart"
-      },
-      "html": {
-        "uri": "html/dart2js/html_dart2js.dart"
-      },
-      "html_common": {
-        "uri": "html/html_common/html_common_dart2js.dart"
-      },
-      "indexed_db": {
-        "uri": "indexed_db/dart2js/indexed_db_dart2js.dart"
-      },
-      "js": {
-        "uri": "js/js.dart",
-        "patches": "_internal/js_dev_runtime/patch/js_patch.dart"
-      },
-      "js_util": {
-        "uri": "js_util/js_util.dart"
-      },
-      "svg": {
-        "uri": "svg/dart2js/svg_dart2js.dart"
-      },
-      "web_audio": {
-        "uri": "web_audio/dart2js/web_audio_dart2js.dart"
-      },
-      "web_gl": {
-        "uri": "web_gl/dart2js/web_gl_dart2js.dart"
-      },
-      "web_sql": {
-        "uri": "web_sql/dart2js/web_sql_dart2js.dart"
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/sdk_nnbd/lib/libraries.yaml b/sdk_nnbd/lib/libraries.yaml
deleted file mode 100644
index 14ea40e..0000000
--- a/sdk_nnbd/lib/libraries.yaml
+++ /dev/null
@@ -1,483 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# Note: if you edit this file, you must also generate libraries.json in this
-# directory:
-#
-#     python ./tools/yaml2json.py sdk_nnbd/lib/libraries.yaml sdk_nnbd/lib/libraries.json
-#
-# We currently have several different files that needs to be updated when
-# changing libraries, sources, and patch files.  See
-# https://github.com/dart-lang/sdk/issues/28836.
-
-none:
-  libraries: {}
-
-vm:
-  libraries:
-    _builtin:
-      uri: "_internal/vm/bin/builtin.dart"
-
-    _internal:
-      uri: "internal/internal.dart"
-      patches:
-        - "_internal/vm/lib/internal_patch.dart"
-        - "_internal/vm/lib/class_id_fasta.dart"
-        - "_internal/vm/lib/print_patch.dart"
-        - "_internal/vm/lib/symbol_patch.dart"
-        - "internal/patch.dart"
-
-    async:
-      uri: "async/async.dart"
-      patches:
-        - "_internal/vm/lib/async_patch.dart"
-        - "_internal/vm/lib/deferred_load_patch.dart"
-        - "_internal/vm/lib/schedule_microtask_patch.dart"
-        - "_internal/vm/lib/timer_patch.dart"
-
-    collection:
-      uri: "collection/collection.dart"
-      patches:
-        - "_internal/vm/lib/collection_patch.dart"
-        - "_internal/vm/lib/compact_hash.dart"
-
-    convert:
-      uri: "convert/convert.dart"
-      patches: "_internal/vm/lib/convert_patch.dart"
-
-    core:
-      uri: "core/core.dart"
-      patches:
-        - "_internal/vm/lib/core_patch.dart"
-        - "_internal/vm/lib/array.dart"
-        - "_internal/vm/lib/array_patch.dart"
-        - "_internal/vm/lib/bigint_patch.dart"
-        - "_internal/vm/lib/bool_patch.dart"
-        - "_internal/vm/lib/date_patch.dart"
-        - "_internal/vm/lib/double.dart"
-        - "_internal/vm/lib/double_patch.dart"
-        - "_internal/vm/lib/errors_patch.dart"
-        - "_internal/vm/lib/expando_patch.dart"
-        - "_internal/vm/lib/function.dart"
-        - "_internal/vm/lib/function_patch.dart"
-        - "_internal/vm/lib/growable_array.dart"
-        - "_internal/vm/lib/identical_patch.dart"
-        - "_internal/vm/lib/immutable_map.dart"
-        - "_internal/vm/lib/integers.dart"
-        - "_internal/vm/lib/integers_patch.dart"
-        - "_internal/vm/lib/invocation_mirror_patch.dart"
-        - "_internal/vm/lib/lib_prefix.dart"
-        - "_internal/vm/lib/map_patch.dart"
-        - "_internal/vm/lib/null_patch.dart"
-        - "_internal/vm/lib/object_patch.dart"
-        - "_internal/vm/lib/regexp_patch.dart"
-        - "_internal/vm/lib/stacktrace.dart"
-        - "_internal/vm/lib/stopwatch_patch.dart"
-        - "_internal/vm/lib/string_buffer_patch.dart"
-        - "_internal/vm/lib/string_patch.dart"
-        - "_internal/vm/lib/type_patch.dart"
-        - "_internal/vm/lib/uri_patch.dart"
-        - "_internal/vm/lib/weak_property.dart"
-
-    developer:
-      uri: "developer/developer.dart"
-      patches:
-        - "_internal/vm/lib/developer.dart"
-        - "_internal/vm/lib/profiler.dart"
-        - "_internal/vm/lib/timeline.dart"
-
-    ffi:
-      uri: "ffi/ffi.dart"
-      patches:
-        - "_internal/vm/lib/ffi_patch.dart"
-        - "_internal/vm/lib/ffi_dynamic_library_patch.dart"
-        - "_internal/vm/lib/ffi_native_type_patch.dart"
-        - "_internal/vm/lib/ffi_struct_patch.dart"
-
-    wasm:
-      uri: "wasm/wasm.dart"
-      patches:
-        - "_internal/vm/lib/wasm_patch.dart"
-
-    _http:
-      uri: "_http/http.dart"
-
-    io:
-      uri: "io/io.dart"
-      patches:
-        - "_internal/vm/bin/common_patch.dart"
-        - "_internal/vm/bin/directory_patch.dart"
-        - "_internal/vm/bin/eventhandler_patch.dart"
-        - "_internal/vm/bin/file_patch.dart"
-        - "_internal/vm/bin/file_system_entity_patch.dart"
-        - "_internal/vm/bin/filter_patch.dart"
-        - "_internal/vm/bin/io_service_patch.dart"
-        - "_internal/vm/bin/namespace_patch.dart"
-        - "_internal/vm/bin/platform_patch.dart"
-        - "_internal/vm/bin/process_patch.dart"
-        - "_internal/vm/bin/socket_patch.dart"
-        - "_internal/vm/bin/stdio_patch.dart"
-        - "_internal/vm/bin/secure_socket_patch.dart"
-        - "_internal/vm/bin/sync_socket_patch.dart"
-
-    isolate:
-      uri: "isolate/isolate.dart"
-      patches:
-        - "_internal/vm/lib/isolate_patch.dart"
-        - "_internal/vm/lib/timer_impl.dart"
-
-    math:
-      uri: "math/math.dart"
-      patches: "_internal/vm/lib/math_patch.dart"
-
-    mirrors:
-      uri: "mirrors/mirrors.dart"
-      patches:
-        - "_internal/vm/lib/mirrors_patch.dart"
-        - "_internal/vm/lib/mirrors_impl.dart"
-        - "_internal/vm/lib/mirror_reference.dart"
-
-    nativewrappers:
-      uri: "html/dartium/nativewrappers.dart"
-
-    cli:
-      uri: "cli/cli.dart"
-      patches:
-        - "_internal/vm/bin/cli_patch.dart"
-
-    typed_data:
-      uri: "typed_data/typed_data.dart"
-      patches: "_internal/vm/lib/typed_data_patch.dart"
-
-    _vmservice:
-      uri: "vmservice/vmservice.dart"
-
-    vmservice_io:
-      uri: "_internal/vm/bin/vmservice_io.dart"
-
-dart2js:
-  libraries:
-    async:
-      uri: "async/async.dart"
-      patches: "_internal/js_runtime/lib/async_patch.dart"
-
-    collection:
-      uri: "collection/collection.dart"
-      patches: "_internal/js_runtime/lib/collection_patch.dart"
-
-    convert:
-      uri: "convert/convert.dart"
-      patches: "_internal/js_runtime/lib/convert_patch.dart"
-
-    core:
-      uri: "core/core.dart"
-      patches: "_internal/js_runtime/lib/core_patch.dart"
-
-    developer:
-      uri: "developer/developer.dart"
-      patches: "_internal/js_runtime/lib/developer_patch.dart"
-
-    html:
-      uri: "html/dart2js/html_dart2js.dart"
-
-    html_common:
-      uri: "html/html_common/html_common_dart2js.dart"
-
-    indexed_db:
-      uri: "indexed_db/dart2js/indexed_db_dart2js.dart"
-
-    _http:
-      uri: "_http/http.dart"
-
-    io:
-      uri: "io/io.dart"
-      patches: "_internal/js_runtime/lib/io_patch.dart"
-      supported: false
-
-    isolate:
-      uri: "isolate/isolate.dart"
-      patches: "_internal/js_runtime/lib/isolate_patch.dart"
-      supported: false
-
-    js:
-      uri: "js/js.dart"
-      patches: "_internal/js_runtime/lib/js_patch.dart"
-
-    _js:
-      uri: "js/_js.dart"
-      patches: "js/_js_client.dart"
-
-    _js_annotations:
-      uri: "js/_js_annotations.dart"
-
-    js_util:
-      uri: "js_util/js_util.dart"
-
-    math:
-      uri: "math/math.dart"
-      patches: "_internal/js_runtime/lib/math_patch.dart"
-
-    mirrors:
-      uri: "mirrors/mirrors.dart"
-      patches: "_internal/js_runtime/lib/mirrors_patch_cfe.dart"
-      supported: false
-
-    typed_data:
-      uri: "typed_data/typed_data.dart"
-      patches: "_internal/js_runtime/lib/typed_data_patch.dart"
-
-    _native_typed_data:
-      uri: "_internal/js_runtime/lib/native_typed_data.dart"
-
-    svg:
-      uri: "svg/dart2js/svg_dart2js.dart"
-
-    web_audio:
-      uri: "web_audio/dart2js/web_audio_dart2js.dart"
-
-    web_gl:
-      uri: "web_gl/dart2js/web_gl_dart2js.dart"
-
-    web_sql:
-      uri: "web_sql/dart2js/web_sql_dart2js.dart"
-
-    _internal:
-      uri: "internal/internal.dart"
-      patches: "_internal/js_runtime/lib/internal_patch.dart"
-
-    _js_helper:
-      uri: "_internal/js_runtime/lib/js_helper.dart"
-
-    _rti:
-      uri: "_internal/js_runtime/lib/rti.dart"
-
-    _interceptors:
-      uri: "_internal/js_runtime/lib/interceptors.dart"
-
-    _foreign_helper:
-      uri: "_internal/js_runtime/lib/foreign_helper.dart"
-
-    _js_names:
-      uri: "_internal/js_runtime/lib/js_names.dart"
-
-    _js_primitives:
-      uri: "_internal/js_runtime/lib/js_primitives.dart"
-
-    _js_embedded_names:
-      uri: "_internal/js_runtime/lib/shared/embedded_names.dart"
-
-    _async_await_error_codes:
-      uri: "_internal/js_runtime/lib/shared/async_await_error_codes.dart"
-
-    _recipe_syntax:
-      uri: "_internal/js_runtime/lib/shared/recipe_syntax.dart"
-
-    _metadata:
-      uri: "html/html_common/metadata.dart"
-
-dart2js_server:
-  libraries:
-    async:
-      uri: "async/async.dart"
-      patches: "_internal/js_runtime/lib/async_patch.dart"
-
-    collection:
-      uri: "collection/collection.dart"
-      patches: "_internal/js_runtime/lib/collection_patch.dart"
-
-    convert:
-      uri: "convert/convert.dart"
-      patches: "_internal/js_runtime/lib/convert_patch.dart"
-
-    core:
-      uri: "core/core.dart"
-      patches: "_internal/js_runtime/lib/core_patch.dart"
-
-    developer:
-      uri: "developer/developer.dart"
-      patches: "_internal/js_runtime/lib/developer_patch.dart"
-
-    _http:
-      uri: "_http/http.dart"
-
-    io:
-      uri: "io/io.dart"
-      patches: "_internal/js_runtime/lib/io_patch.dart"
-      supported: false
-
-    isolate:
-      uri: "isolate/isolate.dart"
-      patches: "_internal/js_runtime/lib/isolate_patch.dart"
-      supported: false
-
-    js:
-      uri: "js/js.dart"
-      patches: "_internal/js_runtime/lib/js_patch.dart"
-
-    _js:
-      uri: "js/_js.dart"
-      patches: "js/_js_server.dart"
-
-    _js_annotations:
-      uri: "js/_js_annotations.dart"
-
-    js_util:
-      uri: "js_util/js_util.dart"
-
-    math:
-      uri: "math/math.dart"
-      patches: "_internal/js_runtime/lib/math_patch.dart"
-
-    mirrors:
-      uri: "mirrors/mirrors.dart"
-      patches: "_internal/js_runtime/lib/mirrors_patch_cfe.dart"
-      supported: false
-
-    typed_data:
-      uri: "typed_data/typed_data.dart"
-      patches: "_internal/js_runtime/lib/typed_data_patch.dart"
-
-    _native_typed_data:
-      uri: "_internal/js_runtime/lib/native_typed_data.dart"
-
-    _internal:
-      uri: "internal/internal.dart"
-      patches: "_internal/js_runtime/lib/internal_patch.dart"
-
-    _js_helper:
-      uri: "_internal/js_runtime/lib/js_helper.dart"
-
-    _rti:
-      uri: "_internal/js_runtime/lib/rti.dart"
-
-    _interceptors:
-      uri: "_internal/js_runtime/lib/interceptors.dart"
-
-    _foreign_helper:
-      uri: "_internal/js_runtime/lib/foreign_helper.dart"
-
-    _js_names:
-      uri: "_internal/js_runtime/lib/js_names.dart"
-
-    _js_primitives:
-      uri: "_internal/js_runtime/lib/js_primitives.dart"
-
-    _js_embedded_names:
-      uri: "_internal/js_runtime/lib/shared/embedded_names.dart"
-
-    _async_await_error_codes:
-      uri: "_internal/js_runtime/lib/shared/async_await_error_codes.dart"
-
-    _recipe_syntax:
-      uri: "_internal/js_runtime/lib/shared/recipe_syntax.dart"
-
-dartdevc:
-    libraries:
-      _runtime:
-        uri: "_internal/js_dev_runtime/private/ddc_runtime/runtime.dart"
-
-      _debugger:
-        uri: "_internal/js_dev_runtime/private/debugger.dart"
-
-      _foreign_helper:
-        uri: "_internal/js_dev_runtime/private/foreign_helper.dart"
-
-      _http:
-        uri: "_http/http.dart"
-
-      _interceptors:
-        uri: "_internal/js_dev_runtime/private/interceptors.dart"
-
-      _internal:
-        uri: "internal/internal.dart"
-        patches: "_internal/js_dev_runtime/patch/internal_patch.dart"
-
-      _isolate_helper:
-        uri: "_internal/js_dev_runtime/private/isolate_helper.dart"
-
-      _js_annotations:
-        uri: "js/_js_annotations.dart"
-
-      _js_helper:
-        uri: "_internal/js_dev_runtime/private/js_helper.dart"
-
-      _js_primitives:
-        uri: "_internal/js_dev_runtime/private/js_primitives.dart"
-
-      _metadata:
-        uri: "html/html_common/metadata.dart"
-
-      _native_typed_data:
-        uri: "_internal/js_dev_runtime/private/native_typed_data.dart"
-
-      async:
-        uri: "async/async.dart"
-        patches: "_internal/js_dev_runtime/patch/async_patch.dart"
-
-      collection:
-        uri: "collection/collection.dart"
-        patches: "_internal/js_dev_runtime/patch/collection_patch.dart"
-
-      convert:
-        uri: "convert/convert.dart"
-        patches: "_internal/js_dev_runtime/patch/convert_patch.dart"
-
-      core:
-        uri: "core/core.dart"
-        patches: "_internal/js_dev_runtime/patch/core_patch.dart"
-
-      developer:
-        uri: "developer/developer.dart"
-        patches: "_internal/js_dev_runtime/patch/developer_patch.dart"
-
-      io:
-        uri: "io/io.dart"
-        patches: "_internal/js_dev_runtime/patch/io_patch.dart"
-        supported: false
-
-      isolate:
-        uri: "isolate/isolate.dart"
-        patches: "_internal/js_dev_runtime/patch/isolate_patch.dart"
-        supported: false
-
-      mirrors:
-        uri: "mirrors/mirrors.dart"
-        patches: "_internal/js_runtime/lib/mirrors_patch_cfe.dart"
-        supported: false
-
-      math:
-        uri: "math/math.dart"
-        patches: "_internal/js_dev_runtime/patch/math_patch.dart"
-
-      typed_data:
-        uri: "typed_data/typed_data.dart"
-        patches: "_internal/js_dev_runtime/patch/typed_data_patch.dart"
-
-      html:
-        uri: "html/dart2js/html_dart2js.dart"
-
-      html_common:
-        uri: "html/html_common/html_common_dart2js.dart"
-
-      indexed_db:
-        uri: "indexed_db/dart2js/indexed_db_dart2js.dart"
-
-      js:
-        uri: "js/js.dart"
-        patches: "_internal/js_dev_runtime/patch/js_patch.dart"
-
-      js_util:
-        uri: "js_util/js_util.dart"
-
-      svg:
-        uri: "svg/dart2js/svg_dart2js.dart"
-
-      web_audio:
-        uri: "web_audio/dart2js/web_audio_dart2js.dart"
-
-      web_gl:
-        uri: "web_gl/dart2js/web_gl_dart2js.dart"
-
-      web_sql:
-        uri: "web_sql/dart2js/web_sql_dart2js.dart"
diff --git a/sdk_nnbd/lib/math/jenkins_smi_hash.dart b/sdk_nnbd/lib/math/jenkins_smi_hash.dart
deleted file mode 100644
index deca56c..0000000
--- a/sdk_nnbd/lib/math/jenkins_smi_hash.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.math;
-
-/// This is the [Jenkins hash function][1] but using masking to keep
-/// values in SMI range.
-///
-/// [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
-///
-/// Use:
-/// Hash each value with the hash of the previous value, then get the final
-/// hash by calling finish.
-///
-///     var hash = 0;
-///     for (var value in values) {
-///       hash = JenkinsSmiHash.combine(hash, value.hashCode);
-///     }
-///     hash = JenkinsSmiHash.finish(hash);
-class _JenkinsSmiHash {
-  // TODO(11617): This class should be optimized and standardized elsewhere.
-
-  static int combine(int hash, int value) {
-    hash = 0x1fffffff & (hash + value);
-    hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
-    return hash ^ (hash >> 6);
-  }
-
-  static int finish(int hash) {
-    hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
-    hash = hash ^ (hash >> 11);
-    return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-  }
-
-  static int hash2(int a, int b) => finish(combine(combine(0, a), b));
-
-  static int hash4(int a, int b, int c, int d) =>
-      finish(combine(combine(combine(combine(0, a), b), c), d));
-}
diff --git a/sdk_nnbd/lib/math/math.dart b/sdk_nnbd/lib/math/math.dart
deleted file mode 100644
index b335669..0000000
--- a/sdk_nnbd/lib/math/math.dart
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright (c) 2012, 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.
-
-/// Mathematical constants and functions, plus a random number generator.
-///
-/// To use this library in your code:
-///
-///     import 'dart:math';
-///
-/// {@category Core}
-library dart.math;
-
-part "jenkins_smi_hash.dart";
-part "point.dart";
-part "random.dart";
-part "rectangle.dart";
-
-/// Base of the natural logarithms.
-///
-/// Typically written as "e".
-const double e = 2.718281828459045;
-
-/// Natural logarithm of 10.
-///
-/// The natural logarithm of 10 is the number such that `pow(E, LN10) == 10`.
-/// This value is not exact, but it is the closest representable double to the
-/// exact mathematical value.
-const double ln10 = 2.302585092994046;
-
-/// Natural logarithm of 2.
-///
-/// The natural logarithm of 2 is the number such that `pow(E, LN2) == 2`.
-/// This value is not exact, but it is the closest representable double to the
-/// exact mathematical value.
-const double ln2 = 0.6931471805599453;
-
-/// Base-2 logarithm of [e].
-const double log2e = 1.4426950408889634;
-
-/// Base-10 logarithm of [e].
-const double log10e = 0.4342944819032518;
-
-/// The PI constant.
-const double pi = 3.1415926535897932;
-
-/// Square root of 1/2.
-const double sqrt1_2 = 0.7071067811865476;
-
-/// Square root of 2.
-const double sqrt2 = 1.4142135623730951;
-
-/// Returns the lesser of two numbers.
-///
-/// Returns NaN if either argument is NaN.
-/// The lesser of `-0.0` and `0.0` is `-0.0`.
-/// If the arguments are otherwise equal (including int and doubles with the
-/// same mathematical value) then it is unspecified which of the two arguments
-/// is returned.
-external T min<T extends num>(T a, T b);
-
-/// Returns the larger of two numbers.
-///
-/// Returns NaN if either argument is NaN.
-/// The larger of `-0.0` and `0.0` is `0.0`. If the arguments are
-/// otherwise equal (including int and doubles with the same mathematical value)
-/// then it is unspecified which of the two arguments is returned.
-external T max<T extends num>(T a, T b);
-
-/// A variant of [atan].
-///
-/// Converts both arguments to [double]s.
-///
-/// Returns the angle in radians between the positive x-axis
-/// and the vector ([b],[a]).
-/// The result is in the range -PI..PI.
-///
-/// If [b] is positive, this is the same as `atan(a/b)`.
-///
-/// The result is negative when [a] is negative (including when [a] is the
-/// double -0.0).
-///
-/// If [a] is equal to zero, the vector ([b],[a]) is considered parallel to
-/// the x-axis, even if [b] is also equal to zero. The sign of [b] determines
-/// the direction of the vector along the x-axis.
-///
-/// Returns NaN if either argument is NaN.
-external double atan2(num a, num b);
-
-/// Returns [x] to the power of [exponent].
-///
-/// If [x] is an [int] and [exponent] is a non-negative [int], the result is
-/// an [int], otherwise both arguments are converted to doubles first, and the
-/// result is a [double].
-///
-/// For integers, the power is always equal to the mathematical result of `x` to
-/// the power `exponent`, only limited by the available memory.
-///
-/// For doubles, `pow(x, y)` handles edge cases as follows:
-///
-/// - if `y` is zero (0.0 or -0.0), the result is always 1.0.
-/// - if `x` is 1.0, the result is always 1.0.
-/// - otherwise, if either `x` or `y` is NaN then the result is NaN.
-/// - if `x` is negative (but not -0.0) and `y` is a finite non-integer, the
-///   result is NaN.
-/// - if `x` is Infinity and `y` is negative, the result is 0.0.
-/// - if `x` is Infinity and `y` is positive, the result is Infinity.
-/// - if `x` is 0.0 and `y` is negative, the result is Infinity.
-/// - if `x` is 0.0 and `y` is positive, the result is 0.0.
-/// - if `x` is -Infinity or -0.0 and `y` is an odd integer, then the result is
-///   `-pow(-x ,y)`.
-/// - if `x` is -Infinity or -0.0 and `y` is not an odd integer, then the result
-///   is the same as `pow(-x , y)`.
-/// - if `y` is Infinity and the absolute value of `x` is less than 1, the
-///   result is 0.0.
-/// - if `y` is Infinity and `x` is -1, the result is 1.0.
-/// - if `y` is Infinity and the absolute value of `x` is greater than 1,
-///   the result is Infinity.
-/// - if `y` is -Infinity, the result is `1/pow(x, Infinity)`.
-///
-/// This corresponds to the `pow` function defined in the IEEE Standard
-/// 754-2008.
-///
-/// Notice that the result may overflow. If integers are represented as 64-bit
-/// numbers, an integer result may be truncated, and a double result may
-/// overflow to positive or negative [double.infinity].
-external num pow(num x, num exponent);
-
-/// Converts [radians] to a [double] and returns the sine of the value.
-///
-/// If [radians] is not a finite number, the result is NaN.
-external double sin(num radians);
-
-/// Converts [radians] to a [double] and returns the cosine of the value.
-///
-/// If [radians] is not a finite number, the result is NaN.
-external double cos(num radians);
-
-/// Converts [radians] to a [double] and returns the tangent of the value.
-///
-/// The tangent function is equivalent to `sin(radians)/cos(radians)` and may be
-/// infinite (positive or negative) when `cos(radians)` is equal to zero.
-/// If [radians] is not a finite number, the result is NaN.
-external double tan(num radians);
-
-/// Converts [x] to a [double] and returns its arc cosine in radians.
-///
-/// Returns a value in the range 0..PI, or NaN if [x] is outside
-/// the range -1..1.
-external double acos(num x);
-
-/// Converts [x] to a [double] and returns its arc sine in radians.
-///
-/// Returns a value in the range -PI/2..PI/2, or NaN if [x] is outside
-/// the range -1..1.
-external double asin(num x);
-
-/// Converts [x] to a [double] and returns its arc tangent in radians.
-///
-/// Returns a value in the range -PI/2..PI/2, or NaN if [x] is NaN.
-external double atan(num x);
-
-/// Converts [x] to a [double] and returns the positive square root of the
-/// value.
-///
-/// Returns -0.0 if [x] is -0.0, and NaN if [x] is otherwise negative or NaN.
-external double sqrt(num x);
-
-/// Converts [x] to a [double] and returns the natural exponent, [e],
-/// to the power [x].
-///
-/// Returns NaN if [x] is NaN.
-external double exp(num x);
-
-/// Converts [x] to a [double] and returns the natural logarithm of the value.
-///
-/// Returns negative infinity if [x] is equal to zero.
-/// Returns NaN if [x] is NaN or less than zero.
-external double log(num x);
diff --git a/sdk_nnbd/lib/math/math_sources.gni b/sdk_nnbd/lib/math/math_sources.gni
deleted file mode 100644
index ff8f3fa..0000000
--- a/sdk_nnbd/lib/math/math_sources.gni
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2017, 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.
-
-math_sdk_sources = [
-  "math.dart",
-
-  # The above file needs to be first as it lists the parts below.
-  "jenkins_smi_hash.dart",
-  "point.dart",
-  "random.dart",
-  "rectangle.dart",
-]
diff --git a/sdk_nnbd/lib/math/point.dart b/sdk_nnbd/lib/math/point.dart
deleted file mode 100644
index 4b0fed5..0000000
--- a/sdk_nnbd/lib/math/point.dart
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.math;
-
-/// A utility class for representing two-dimensional positions.
-class Point<T extends num> {
-  final T x;
-  final T y;
-
-  const Point(T x, T y)
-      : this.x = x,
-        this.y = y;
-
-  String toString() => 'Point($x, $y)';
-
-  /// Whether [other] is a point with the same coordinates as this point.
-  ///
-  /// Returns `true` if [other] is a [Point] with [x] and [y]
-  /// coordinates equal to the corresponding coordiantes of this point,
-  /// and `false` otherwise.
-  bool operator ==(Object other) =>
-      other is Point && x == other.x && y == other.y;
-
-  int get hashCode => _JenkinsSmiHash.hash2(x.hashCode, y.hashCode);
-
-  /// Add [other] to `this`, as if both points were vectors.
-  ///
-  /// Returns the resulting "vector" as a Point.
-  Point<T> operator +(Point<T> other) {
-    return Point<T>((x + other.x) as T, (y + other.y) as T);
-  }
-
-  /// Subtract [other] from `this`, as if both points were vectors.
-  ///
-  /// Returns the resulting "vector" as a Point.
-  Point<T> operator -(Point<T> other) {
-    return Point<T>((x - other.x) as T, (y - other.y) as T);
-  }
-
-  /// Scale this point by [factor] as if it were a vector.
-  ///
-  /// *Important* *Note*: This function accepts a `num` as its argument only so
-  /// that you can scale `Point<double>` objects by an `int` factor. Because the
-  /// `*` operator always returns the same type of `Point` as it is called on,
-  /// passing in a double [factor] on a `Point<int>` _causes_ _a_
-  /// _runtime_ _error_.
-  Point<T> operator *(num /*T|int*/ factor) {
-    return Point<T>((x * factor) as T, (y * factor) as T);
-  }
-
-  /// Get the straight line (Euclidean) distance between the origin (0, 0) and
-  /// this point.
-  double get magnitude => sqrt(x * x + y * y);
-
-  /// Returns the distance between `this` and [other].
-  double distanceTo(Point<T> other) {
-    var dx = x - other.x;
-    var dy = y - other.y;
-    return sqrt(dx * dx + dy * dy);
-  }
-
-  /// Returns the squared distance between `this` and [other].
-  ///
-  /// Squared distances can be used for comparisons when the actual value is not
-  /// required.
-  T squaredDistanceTo(Point<T> other) {
-    var dx = x - other.x;
-    var dy = y - other.y;
-    return (dx * dx + dy * dy) as T;
-  }
-}
diff --git a/sdk_nnbd/lib/math/random.dart b/sdk_nnbd/lib/math/random.dart
deleted file mode 100644
index fd75e12..0000000
--- a/sdk_nnbd/lib/math/random.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012, 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.
-
-part of dart.math;
-
-/// A generator of random bool, int, or double values.
-///
-/// The default implementation supplies a stream of pseudo-random bits that are
-/// not suitable for cryptographic purposes.
-///
-/// Use the [Random.secure]() constructor for cryptographic purposes.
-abstract class Random {
-  /// Creates a random number generator.
-  ///
-  /// The optional parameter [seed] is used to initialize the
-  /// internal state of the generator. The implementation of the
-  /// random stream can change between releases of the library.
-  external factory Random([int? seed]);
-
-  /// Creates a cryptographically secure random number generator.
-  ///
-  /// If the program cannot provide a cryptographically secure
-  /// source of random numbers, it throws an [UnsupportedError].
-  external factory Random.secure();
-
-  /// Generates a non-negative random integer uniformly distributed in the range
-  /// from 0, inclusive, to [max], exclusive.
-  ///
-  /// Implementation note: The default implementation supports [max] values
-  /// between 1 and (1<<32) inclusive.
-  int nextInt(int max);
-
-  /// Generates a non-negative random floating point value uniformly distributed
-  /// in the range from 0.0, inclusive, to 1.0, exclusive.
-  double nextDouble();
-
-  /// Generates a random boolean value.
-  bool nextBool();
-}
diff --git a/sdk_nnbd/lib/math/rectangle.dart b/sdk_nnbd/lib/math/rectangle.dart
deleted file mode 100644
index 09f27df..0000000
--- a/sdk_nnbd/lib/math/rectangle.dart
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart.math;
-
-/// A base class for representing two-dimensional axis-aligned rectangles.
-///
-/// This rectangle uses a left-handed Cartesian coordinate system, with x
-/// directed to the right and y directed down, as per the convention in 2D
-/// computer graphics.
-///
-/// See also:
-///    [W3C Coordinate Systems Specification](http://www.w3.org/TR/SVG/coords.html#InitialCoordinateSystem).
-///
-/// The rectangle is the set of points with representable coordinates greater
-/// than or equal to left/top, and with distance to left/top no greater than
-/// width/height (to the limit of the precision of the coordinates).
-abstract class _RectangleBase<T extends num> {
-  const _RectangleBase();
-
-  /// The x-coordinate of the left edge.
-  T get left;
-
-  /// The y-coordinate of the top edge.
-  T get top;
-
-  /// The width of the rectangle.
-  T get width;
-
-  /// The height of the rectangle.
-  T get height;
-
-  /// The x-coordinate of the right edge.
-  T get right => (left + width) as T;
-
-  /// The y-coordinate of the bottom edge.
-  T get bottom => (top + height) as T;
-
-  String toString() {
-    return 'Rectangle ($left, $top) $width x $height';
-  }
-
-  bool operator ==(Object other) =>
-      other is Rectangle &&
-      left == other.left &&
-      top == other.top &&
-      right == other.right &&
-      bottom == other.bottom;
-
-  int get hashCode => _JenkinsSmiHash.hash4(
-      left.hashCode, top.hashCode, right.hashCode, bottom.hashCode);
-
-  /// Computes the intersection of `this` and [other].
-  ///
-  /// The intersection of two axis-aligned rectangles, if any, is always another
-  /// axis-aligned rectangle.
-  ///
-  /// Returns the intersection of this and `other`, or `null` if they don't
-  /// intersect.
-  Rectangle<T>? intersection(Rectangle<T> other) {
-    var x0 = max(left, other.left);
-    var x1 = min(left + width, other.left + other.width);
-
-    if (x0 <= x1) {
-      var y0 = max(top, other.top);
-      var y1 = min(top + height, other.top + other.height);
-
-      if (y0 <= y1) {
-        return Rectangle<T>(x0, y0, (x1 - x0) as T, (y1 - y0) as T);
-      }
-    }
-    return null;
-  }
-
-  /// Returns true if `this` intersects [other].
-  bool intersects(Rectangle<num> other) {
-    return (left <= other.left + other.width &&
-        other.left <= left + width &&
-        top <= other.top + other.height &&
-        other.top <= top + height);
-  }
-
-  /// Returns a new rectangle which completely contains `this` and [other].
-  Rectangle<T> boundingBox(Rectangle<T> other) {
-    var right = max(this.left + this.width, other.left + other.width);
-    var bottom = max(this.top + this.height, other.top + other.height);
-
-    var left = min(this.left, other.left);
-    var top = min(this.top, other.top);
-
-    return Rectangle<T>(left, top, (right - left) as T, (bottom - top) as T);
-  }
-
-  /// Tests whether `this` entirely contains [another].
-  bool containsRectangle(Rectangle<num> another) {
-    return left <= another.left &&
-        left + width >= another.left + another.width &&
-        top <= another.top &&
-        top + height >= another.top + another.height;
-  }
-
-  /// Tests whether [another] is inside or along the edges of `this`.
-  bool containsPoint(Point<num> another) {
-    return another.x >= left &&
-        another.x <= left + width &&
-        another.y >= top &&
-        another.y <= top + height;
-  }
-
-  Point<T> get topLeft => Point<T>(this.left, this.top);
-  Point<T> get topRight => Point<T>((this.left + this.width) as T, this.top);
-  Point<T> get bottomRight =>
-      Point<T>((this.left + this.width) as T, (this.top + this.height) as T);
-  Point<T> get bottomLeft => Point<T>(this.left, (this.top + this.height) as T);
-}
-
-/// A class for representing two-dimensional rectangles whose properties are
-/// immutable.
-class Rectangle<T extends num> extends _RectangleBase<T> {
-  final T left;
-  final T top;
-  final T width;
-  final T height;
-
-  /// Create a rectangle spanned by `(left, top)` and
-  /// `(left+width, top+height)`.
-  ///
-  /// The rectangle contains the points
-  /// with x-coordinate between `left` and `left + width`, and
-  /// with y-coordinate between `top` and `top + height`, both inclusive.
-  ///
-  /// The `width` and `height` should be non-negative.
-  /// If `width` or `height` are negative, they are clamped to zero.
-  ///
-  /// If `width` and `height` are zero, the "rectangle" comprises only the
-  /// single point `(left, top)`.
-  const Rectangle(this.left, this.top, T width, T height)
-      : width = (width < 0) ? (-width * 0) as dynamic : width, // Inline _clampToZero<num>.
-        height = (height < 0) ? (-height * 0) as dynamic : height;
-
-  /// Create a rectangle spanned by the points [a] and [b];
-  ///
-  /// The rectangle contains the points
-  /// with x-coordinate between `a.x` and `b.x`, and
-  /// with y-coordinate between `a.y` and `b.y`, both inclusive.
-  ///
-  /// If the distance between `a.x` and `b.x` is not representable
-  /// (which can happen if one or both is a double),
-  /// the actual right edge might be slightly off from `max(a.x, b.x)`.
-  /// Similar for the y-coordinates and the bottom edge.
-  factory Rectangle.fromPoints(Point<T> a, Point<T> b) {
-    T left = min(a.x, b.x);
-    T width = (max(a.x, b.x) - left) as T;
-    T top = min(a.y, b.y);
-    T height = (max(a.y, b.y) - top) as T;
-    return Rectangle<T>(left, top, width, height);
-  }
-}
-
-/// A class for representing two-dimensional axis-aligned rectangles with
-/// mutable properties.
-class MutableRectangle<T extends num> extends _RectangleBase<T>
-    implements Rectangle<T> {
-  /// The x-coordinate of the left edge.
-  ///
-  /// Setting the value will move the rectangle without changing its width.
-  T left;
-
-  /// The y-coordinate of the left edge.
-  ///
-  /// Setting the value will move the rectangle without changing its height.
-  T top;
-  T _width;
-  T _height;
-
-  /// Create a mutable rectangle spanned by `(left, top)` and
-  /// `(left+width, top+height)`.
-  ///
-  /// The rectangle contains the points
-  /// with x-coordinate between `left` and `left + width`, and
-  /// with y-coordinate between `top` and `top + height`, both inclusive.
-  ///
-  /// The `width` and `height` should be non-negative.
-  /// If `width` or `height` are negative, they are clamped to zero.
-  ///
-  /// If `width` and `height` are zero, the "rectangle" comprises only the
-  /// single point `(left, top)`.
-  MutableRectangle(this.left, this.top, T width, T height)
-      : this._width = (width < 0) ? _clampToZero<T>(width) : width,
-        this._height = (height < 0) ? _clampToZero<T>(height) : height;
-
-  /// Create a mutable rectangle spanned by the points [a] and [b];
-  ///
-  /// The rectangle contains the points
-  /// with x-coordinate between `a.x` and `b.x`, and
-  /// with y-coordinate between `a.y` and `b.y`, both inclusive.
-  ///
-  /// If the distance between `a.x` and `b.x` is not representable
-  /// (which can happen if one or both is a double),
-  /// the actual right edge might be slightly off from `max(a.x, b.x)`.
-  /// Similar for the y-coordinates and the bottom edge.
-  factory MutableRectangle.fromPoints(Point<T> a, Point<T> b) {
-    T left = min(a.x, b.x);
-    T width = (max(a.x, b.x) - left) as T;
-    T top = min(a.y, b.y);
-    T height = (max(a.y, b.y) - top) as T;
-    return MutableRectangle<T>(left, top, width, height);
-  }
-
-  T get width => _width;
-
-  /// Sets the width of the rectangle.
-  ///
-  /// The width must be non-negative.
-  /// If a negative width is supplied, it is clamped to zero.
-  ///
-  /// Setting the value will change the right edge of the rectangle,
-  /// but will not change [left].
-  set width(T width) {
-    if (width < 0) width = _clampToZero<T>(width);
-    _width = width;
-  }
-
-  T get height => _height;
-
-  /// Sets the height of the rectangle.
-  ///
-  /// The height must be non-negative.
-  /// If a negative height is supplied, it is clamped to zero.
-  ///
-  /// Setting the value will change the bottom edge of the rectangle,
-  /// but will not change [top].
-  set height(T height) {
-    if (height < 0) height = _clampToZero<T>(height);
-    _height = height;
-  }
-}
-
-/// Converts a negative [int] or [double] to a zero-value of the same type.
-///
-/// Returns `0` if value is int, `0.0` if value is double.
-T _clampToZero<T extends num>(T value) {
-  assert(value < 0);
-  return (-value * 0) as T;
-}
diff --git a/sdk_nnbd/lib/mirrors/mirrors.dart b/sdk_nnbd/lib/mirrors/mirrors.dart
deleted file mode 100644
index 95a8aff..0000000
--- a/sdk_nnbd/lib/mirrors/mirrors.dart
+++ /dev/null
@@ -1,1475 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// For the purposes of the mirrors library, we adopt a naming
-// convention with respect to getters and setters.  Specifically, for
-// some variable or field...
-//
-//   var myField;
-//
-// ...the getter is named 'myField' and the setter is named
-// 'myField='.  This allows us to assign unique names to getters and
-// setters for the purposes of member lookup.
-
-/**
- * Basic reflection in Dart,
- * with support for introspection and dynamic invocation.
- *
- * *Introspection* is that subset of reflection by which a running
- * program can examine its own structure. For example, a function
- * that prints out the names of all the members of an arbitrary object.
- *
- * *Dynamic invocation* refers the ability to evaluate code that
- * has not been literally specified at compile time, such as calling a method
- * whose name is provided as an argument (because it is looked up
- * in a database, or provided interactively by the user).
- *
- * ## How to interpret this library's documentation
- *
- * As a rule, the names of Dart declarations are represented using
- * instances of class [Symbol]. Whenever the doc speaks of an object *s*
- * of class [Symbol] denoting a name, it means the string that
- * was used to construct *s*.
- *
- * The documentation frequently abuses notation with
- * Dart pseudo-code such as [:o.x(a):], where
- * o and a are defined to be objects; what is actually meant in these
- * cases is [:o'.x(a'):] where *o'* and *a'* are Dart variables
- * bound to *o* and *a* respectively. Furthermore, *o'* and *a'*
- * are assumed to be fresh variables (meaning that they are
- * distinct from any other variables in the program).
- *
- * Sometimes the documentation refers to *serializable* objects.
- * An object is serializable across isolates if and only if it is an instance of
- * num, bool, String, a list of objects that are serializable
- * across isolates, or a map with keys and values that are all serializable across
- * isolates.
- *
- * ## Status: Unstable
- *
- * The dart:mirrors library is unstable and its API might change slightly as a
- * result of user feedback. This library is platform dependent and therefore it
- * has implementations for both dart2js and the Dart VM. Both are under
- * development and may not support all operations yet.
- *
- * {@category VM}
- */
-library dart.mirrors;
-
-import 'dart:async' show Future;
-import "dart:_internal" show Since;
-
-/**
- * A [MirrorSystem] is the main interface used to reflect on a set of
- * associated libraries.
- *
- * At runtime each running isolate has a distinct [MirrorSystem].
- *
- * It is also possible to have a [MirrorSystem] which represents a set
- * of libraries which are not running -- perhaps at compile-time.  In
- * this case, all available reflective functionality would be
- * supported, but runtime functionality (such as invoking a function
- * or inspecting the contents of a variable) would fail dynamically.
- */
-abstract class MirrorSystem {
-  /**
-   * All libraries known to the mirror system, indexed by their URI.
-   *
-   * Returns an unmodifiable map of the libraries with [LibraryMirror.uri] as
-   * keys.
-   *
-   * For a runtime mirror system, only libraries which are currently loaded
-   * are included, and repeated calls of this method may return different maps
-   * as libraries are loaded.
-   */
-  Map<Uri, LibraryMirror> get libraries;
-
-  /**
-   * Returns the unique library named [libraryName] if it exists.
-   *
-   * If no unique library exists, an error is thrown.
-   */
-  external LibraryMirror findLibrary(Symbol libraryName);
-
-  /**
-   * A mirror on the isolate associated with this [MirrorSystem].
-   *
-   * This may be null if this mirror system is not running.
-   */
-  IsolateMirror get isolate;
-
-  /**
-   * A mirror on the [:dynamic:] type.
-   */
-  TypeMirror get dynamicType;
-
-  /**
-   * A mirror on the [:void:] type.
-   */
-  TypeMirror get voidType;
-
-  /**
-   * A mirror on the [:Never:] type.
-   */
-  @Since("2.8")
-  TypeMirror get neverType;
-
-  /**
-   * Returns the name of [symbol].
-   *
-   * The following text is non-normative:
-   *
-   * Using this method may result in larger output.  If possible, use
-   * [MirrorsUsed] to specify which symbols must be retained in clear text.
-   */
-  external static String getName(Symbol symbol);
-
-  /**
-   * Returns a symbol for [name].
-   *
-   * If [library] is not a [LibraryMirror] or if [name] is a private identifier
-   * and [library] is `null`, throws an [ArgumentError]. If [name] is a private
-   * identifier, the symbol returned is with respect to [library].
-   *
-   * The following text is non-normative:
-   *
-   * Using this method may result in larger output.  If possible, use
-   * the const constructor of [Symbol] or symbol literals.
-   */
-  external static Symbol getSymbol(String name, [LibraryMirror? library]);
-}
-
-/**
- * Returns a [MirrorSystem] for the current isolate.
- */
-external MirrorSystem currentMirrorSystem();
-
-/**
- * Reflects an instance.
- *
- * Returns an [InstanceMirror] reflecting [reflectee]. If [reflectee] is a
- * function or an instance of a class that has a [:call:] method, the returned
- * instance mirror will be a [ClosureMirror].
- *
- * Note that since one cannot obtain an object from another isolate, this
- * function can only be used to obtain  mirrors on objects of the current
- * isolate.
- */
-external InstanceMirror reflect(dynamic reflectee);
-
-/**
- * Reflects a class declaration.
- *
- * Let *C* be the original class declaration of the class represented by [key].
- * This function returns a [ClassMirror] reflecting *C*.
- *
- * If [key] is not an instance of [Type], then this function throws an
- * [ArgumentError]. If [key] is the Type for dynamic or a function typedef,
- * throws an [ArgumentError].
- *
- * Note that since one cannot obtain a [Type] object from another isolate, this
- * function can only be used to obtain class mirrors on classes of the current
- * isolate.
- */
-external ClassMirror reflectClass(Type key);
-
-/**
- * Reflects the type represented by [key].
- *
- * If [key] is not an instance of [Type], then this function throws an
- * [ArgumentError].
- *
- * Optionally takes a list of [typeArguments] for generic classes. If the list
- * is provided, then the [key] must be a generic class type, and the number of
- * the provided type arguments must be equal to the number of type variables
- * declared by the class.
- *
- * Note that since one cannot obtain a [Type] object from another isolate, this
- * function can only be used to obtain type mirrors on types of the current
- * isolate.
- */
-external TypeMirror reflectType(Type key, [List<Type>? typeArguments]);
-
-/**
- * A [Mirror] reflects some Dart language entity.
- *
- * Every [Mirror] originates from some [MirrorSystem].
- */
-abstract class Mirror {}
-
-/**
- * An [IsolateMirror] reflects an isolate.
- */
-abstract class IsolateMirror implements Mirror {
-  /**
-   * A unique name used to refer to the isolate in debugging messages.
-   */
-  String get debugName;
-
-  /**
-   * Whether this mirror reflects the currently running isolate.
-   */
-  bool get isCurrent;
-
-  /**
-   * The root library for the reflected isolate.
-   */
-  LibraryMirror get rootLibrary;
-
-  /**
-   * Whether [other] is an [IsolateMirror] on the same isolate as this mirror.
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. the isolate being reflected by this mirror is the same isolate being
-   *    reflected by [other].
-   */
-  bool operator ==(Object other);
-
-  /**
-   * Loads the library at the given uri into this isolate.
-   *
-   * WARNING: You are strongly encouraged to use Isolate.spawnUri instead when
-   * possible. IsolateMirror.loadUri should only be used when synchronous
-   * communication or shared state with dynamically loaded code is needed.
-   *
-   * If a library with the same canonicalized uri has already been loaded,
-   * the existing library will be returned. (The isolate will not load a new
-   * copy of the library.)
-   *
-   * This behavior is similar to the behavior of an import statement that
-   * appears in the root library, except that the import scope of the root
-   * library is not changed.
-   */
-  Future<LibraryMirror> loadUri(Uri uri);
-}
-
-/**
- * A [DeclarationMirror] reflects some entity declared in a Dart program.
- */
-abstract class DeclarationMirror implements Mirror {
-  /**
-   * The simple name for this Dart language entity.
-   *
-   * The simple name is in most cases the identifier name of the entity,
-   * such as 'myMethod' for a method, [:void myMethod() {...}:] or 'mylibrary'
-   * for a [:library 'mylibrary';:] declaration.
-   */
-  Symbol get simpleName;
-
-  /**
-   * The fully-qualified name for this Dart language entity.
-   *
-   * This name is qualified by the name of the owner. For instance,
-   * the qualified name of a method 'method' in class 'Class' in
-   * library 'library' is 'library.Class.method'.
-   *
-   * Returns a [Symbol] constructed from a string representing the
-   * fully qualified name of the reflectee.
-   * Let *o* be the [owner] of this mirror, let *r* be the reflectee of
-   * this mirror, let *p* be the fully qualified
-   * name of the reflectee of *o*, and let *s* be the simple name of *r*
-   * computed by [simpleName].
-   * The fully qualified name of *r* is the
-   * concatenation of *p*, '.', and *s*.
-   *
-   * Because an isolate can contain more than one library with the same name (at
-   * different URIs), a fully-qualified name does not uniquely identify any
-   * language entity.
-   */
-  Symbol get qualifiedName;
-
-  /**
-   * A mirror on the owner of this Dart language entity.
-   *
-   * The owner is the declaration immediately surrounding the reflectee:
-   *
-   * * For a library, the owner is [:null:].
-   * * For a class declaration, typedef or top level function or variable, the
-   *   owner is the enclosing library.
-   * * For a mixin application `S with M`, the owner is the owner of `M`.
-   * * For a constructor, the owner is the immediately enclosing class.
-   * * For a method, instance variable or a static variable, the owner is the
-   *   immediately enclosing class, unless the class is a mixin application
-   *   `S with M`, in which case the owner is `M`. Note that `M` may be an
-   *   invocation of a generic.
-   * * For a parameter, local variable or local function the owner is the
-   *   immediately enclosing function.
-   */
-  DeclarationMirror? get owner;
-
-  /**
-   * Whether this declaration is library private.
-   *
-   * Always returns `false` for a library declaration,
-   * otherwise returns `true` if the declaration's name starts with an
-   * underscore character (`_`), and `false` if it doesn't.
-   */
-  bool get isPrivate;
-
-  /**
-   * Whether this declaration is top-level.
-   *
-   * A declaration is considered top-level if its [owner] is a [LibraryMirror].
-   */
-  bool get isTopLevel;
-
-  /**
-   * The source location of this Dart language entity, or [:null:] if the
-   * entity is synthetic.
-   *
-   * If the reflectee is a variable, the returned location gives the position
-   * of the variable name at its point of declaration.
-   *
-   * If the reflectee is a library, class, typedef, function or type variable
-   * with associated metadata, the returned location gives the position of the
-   * first metadata declaration associated with the reflectee.
-   *
-   * Otherwise:
-   *
-   * If the reflectee is a library, the returned location gives the position of
-   * the keyword 'library' at the reflectee's point of declaration, if the
-   * reflectee is a named library, or the first character of the first line in
-   * the compilation unit defining the reflectee if the reflectee is anonymous.
-   *
-   * If the reflectee is an abstract class, the returned location gives the
-   * position of the keyword 'abstract' at the reflectee's point of declaration.
-   * Otherwise, if the reflectee is a class, the returned location gives the
-   * position of the keyword 'class' at the reflectee's point of declaration.
-   *
-   * If the reflectee is a typedef the returned location gives the position of
-   * the of the keyword 'typedef' at the reflectee's point of declaration.
-   *
-   * If the reflectee is a function with a declared return type, the returned
-   * location gives the position of the function's return type at the
-   * reflectee's point of declaration. Otherwise. the returned location gives
-   * the position of the function's name at the reflectee's point of
-   * declaration.
-   *
-   * This operation is optional and may throw an [UnsupportedError].
-   */
-  SourceLocation? get location;
-
-  /**
-   * A list of the metadata associated with this declaration.
-   *
-   * Let *D* be the declaration this mirror reflects.
-   * If *D* is decorated with annotations *A1, ..., An*
-   * where *n > 0*, then for each annotation *Ai* associated
-   * with *D, 1 <= i <= n*, let *ci* be the constant object
-   * specified by *Ai*. Then this method returns a list whose
-   * members are instance mirrors on *c1, ..., cn*.
-   * If no annotations are associated with *D*, then
-   * an empty list is returned.
-   *
-   * If evaluating any of *c1, ..., cn* would cause a
-   * compilation error
-   * the effect is the same as if a non-reflective compilation error
-   * had been encountered.
-   */
-  List<InstanceMirror> get metadata;
-}
-
-/**
- * An [ObjectMirror] is a common superinterface of [InstanceMirror],
- * [ClassMirror], and [LibraryMirror] that represents their shared
- * functionality.
- *
- * For the purposes of the mirrors library, these types are all
- * object-like, in that they support method invocation and field
- * access.  Real Dart objects are represented by the [InstanceMirror]
- * type.
- *
- * See [InstanceMirror], [ClassMirror], and [LibraryMirror].
- */
-abstract class ObjectMirror implements Mirror {
-  /**
-   * Invokes the named function and returns a mirror on the result.
-   *
-   * Let *o* be the object reflected by this mirror, let *f* be the simple name
-   * of the member denoted by [memberName], let *a1, ..., an* be the elements
-   * of [positionalArguments], let *k1, ..., km* be the identifiers denoted by
-   * the elements of [namedArguments.keys], and let *v1, ..., vm* be the
-   * elements of [namedArguments.values]. Then this method will perform the
-   * method invocation *o.f(a1, ..., an, k1: v1, ..., km: vm)* in a scope that
-   * has access to the private members of *o* (if *o* is a class or library) or
-   * the private members of the class of *o* (otherwise).
-   *
-   * If the invocation returns a result *r*, this method returns the result of
-   * calling [reflect]\(*r*\).
-   *
-   * If the invocation causes a compilation error the effect is the same as if
-   * a non-reflective compilation error had been encountered.
-   *
-   * If the invocation throws an exception *e* (that it does not catch), this
-   * method throws *e*.
-   */
-  InstanceMirror invoke(Symbol memberName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]);
-
-  /**
-   * Invokes a getter and returns a mirror on the result.
-   *
-   * The getter can be the implicit getter for a field or a user-defined getter
-   * method.
-   *
-   * Let *o* be the object reflected by this mirror,
-   * let *f* be the simple name of the getter denoted by [fieldName].
-   *
-   * Then this method will perform the getter invocation *o.f* in a scope that
-   * has access to the private members of *o* (if *o* is a class or library) or
-   * the private members of the class of *o* (otherwise).
-   *
-   * If this mirror is an [InstanceMirror], and [fieldName] denotes an instance
-   * method on its reflectee, the result of the invocation is an instance
-   * mirror on a closure corresponding to that method.
-   *
-   * If this mirror is a [LibraryMirror], and [fieldName] denotes a top-level
-   * method in the corresponding library, the result of the invocation is an
-   * instance mirror on a closure corresponding to that method.
-   *
-   * If this mirror is a [ClassMirror], and [fieldName] denotes a static method
-   * in the corresponding class, the result of the invocation is an instance
-   * mirror on a closure corresponding to that method.
-   *
-   * If the invocation returns a result *r*, this method returns the result of
-   * calling [reflect]\(*r*\).
-   *
-   * If the invocation causes a compilation error, the effect is the same as if
-   * a non-reflective compilation error had been encountered.
-   *
-   * If the invocation throws an exception *e* (that it does not catch), this
-   * method throws *e*.
-   */
-  // TODO(ahe): Remove stuff about scope and private members. [fieldName] is a
-  // capability giving access to private members.
-  InstanceMirror getField(Symbol fieldName);
-
-  /**
-   * Invokes a setter and returns a mirror on the result.
-   *
-   * The setter may be either the implicit setter for a non-final field or a
-   * user-defined setter method.
-   *
-   * Let *o* be the object reflected by this mirror,
-   * let *f* be the simple name of the getter denoted by [fieldName],
-   * and let *a* be the object bound to [value].
-   *
-   * Then this method will perform the setter invocation *o.f = a* in a scope
-   * that has access to the private members of *o* (if *o* is a class or
-   * library) or the private members of the class of *o* (otherwise).
-   *
-   * If the invocation returns a result *r*, this method returns the result of
-   * calling [reflect]\([value]\).
-   *
-   * If the invocation causes a compilation error, the effect is the same as if
-   * a non-reflective compilation error had been encountered.
-   *
-   * If the invocation throws an exception *e* (that it does not catch) this
-   * method throws *e*.
-   */
-  InstanceMirror setField(Symbol fieldName, dynamic value);
-
-  /**
-   * Performs [invocation] on the reflectee of this [ObjectMirror].
-   *
-   * Equivalent to
-   *
-   *     if (invocation.isGetter) {
-   *       return this.getField(invocation.memberName).reflectee;
-   *     } else if (invocation.isSetter) {
-   *       return this.setField(invocation.memberName,
-   *                            invocation.positionalArguments[0]).reflectee;
-   *     } else {
-   *       return this.invoke(invocation.memberName,
-   *                          invocation.positionalArguments,
-   *                          invocation.namedArguments).reflectee;
-   *     }
-   */
-  delegate(Invocation invocation);
-}
-
-/**
- * An [InstanceMirror] reflects an instance of a Dart language object.
- */
-abstract class InstanceMirror implements ObjectMirror {
-  /**
-   * A mirror on the type of the reflectee.
-   *
-   * Returns a mirror on the actual class of the reflectee.
-   * The class of the reflectee may differ from
-   * the object returned by invoking [runtimeType] on
-   * the reflectee.
-   */
-  ClassMirror get type;
-
-  /**
-   * Whether [reflectee] will return the instance reflected by this mirror.
-   *
-   * This will always be true in the local case (reflecting instances in the
-   * same isolate), but only true in the remote case if this mirror reflects a
-   * simple value.
-   *
-   * A value is simple if one of the following holds:
-   *
-   * * the value is [:null:]
-   * * the value is of type [num]
-   * * the value is of type [bool]
-   * * the value is of type [String]
-   */
-  bool get hasReflectee;
-
-  /**
-   * If the [InstanceMirror] reflects an instance it is meaningful to
-   * have a local reference to, we provide access to the actual
-   * instance here.
-   *
-   * If you access [reflectee] when [hasReflectee] is false, an
-   * exception is thrown.
-   */
-  dynamic get reflectee;
-
-  /**
-   * Whether this mirror is equal to [other].
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. either
-   *
-   *    a. [hasReflectee] is true and so is
-   *    [:identical(reflectee, other.reflectee):], or
-   *
-   *    b. the remote objects reflected by this mirror and by [other] are
-   *    identical.
-   */
-  bool operator ==(Object other);
-}
-
-/**
- * A [ClosureMirror] reflects a closure.
- *
- * A [ClosureMirror] provides the ability to execute its reflectee and
- * introspect its function.
- */
-abstract class ClosureMirror implements InstanceMirror {
-  /**
-   * A mirror on the function associated with this closure.
-   *
-   * The function associated with an implicit closure of a function is that
-   * function.
-   *
-   * The function associated with an instance of a class that has a [:call:]
-   * method is that [:call:] method.
-   *
-   * A Dart implementation might choose to create a class for each closure
-   * expression, in which case [:function:] would be the same as
-   * [:type.declarations[#call]:]. But the Dart language model does not require
-   * this. A more typical implementation involves a single closure class for
-   * each type signature, where the call method dispatches to a function held
-   * in the closure rather the call method
-   * directly implementing the closure body. So one cannot rely on closures from
-   * distinct closure expressions having distinct classes ([:type:]), but one
-   * can rely on them having distinct functions ([:function:]).
-   */
-  MethodMirror get function;
-
-  /**
-   * Executes the closure and returns a mirror on the result.
-   *
-   * Let *f* be the closure reflected by this mirror,
-   * let *a1, ..., an* be the elements of [positionalArguments],
-   * let *k1, ..., km* be the identifiers denoted by the elements of
-   * [namedArguments.keys],
-   * and let *v1, ..., vm* be the elements of [namedArguments.values].
-   *
-   * Then this method will perform the method invocation
-   * *f(a1, ..., an, k1: v1, ..., km: vm)*.
-   *
-   * If the invocation returns a result *r*, this method returns the result of
-   * calling [reflect]\(*r*\).
-   *
-   * If the invocation causes a compilation error, the effect is the same as if
-   * a non-reflective compilation error had been encountered.
-   *
-   * If the invocation throws an exception *e* (that it does not catch), this
-   * method throws *e*.
-   */
-  InstanceMirror apply(List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]);
-}
-
-/**
- * A [LibraryMirror] reflects a Dart language library, providing
- * access to the variables, functions, and classes of the
- * library.
- */
-abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
-  /**
-   * The absolute uri of the library.
-   */
-  Uri get uri;
-
-  /**
-   * Returns an immutable map of the declarations actually given in the library.
-   *
-   * This map includes all regular methods, getters, setters, fields, classes
-   * and typedefs actually declared in the library. The map is keyed by the
-   * simple names of the declarations.
-   */
-  Map<Symbol, DeclarationMirror> get declarations;
-
-  /**
-   * Whether this mirror is equal to [other].
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. The library being reflected by this mirror and the library being
-   *    reflected by [other] are the same library in the same isolate.
-   */
-  bool operator ==(Object other);
-
-  /**
-   * Returns a list of the imports and exports in this library;
-   */
-  List<LibraryDependencyMirror> get libraryDependencies;
-}
-
-/// A mirror on an import or export declaration.
-abstract class LibraryDependencyMirror implements Mirror {
-  /// Is `true` if this dependency is an import.
-  bool get isImport;
-
-  /// Is `true` if this dependency is an export.
-  bool get isExport;
-
-  /// Returns true iff this dependency is a deferred import. Otherwise returns
-  /// false.
-  bool get isDeferred;
-
-  /// Returns the library mirror of the library that imports or exports the
-  /// [targetLibrary].
-  LibraryMirror get sourceLibrary;
-
-  /// Returns the library mirror of the library that is imported or exported,
-  /// or null if the library is not loaded.
-  LibraryMirror? get targetLibrary;
-
-  /// Returns the prefix if this is a prefixed import and `null` otherwise.
-  Symbol? get prefix;
-
-  /// Returns the list of show/hide combinators on the import/export
-  /// declaration.
-  List<CombinatorMirror> get combinators;
-
-  /// Returns the source location for this import/export declaration.
-  SourceLocation? get location;
-
-  List<InstanceMirror> get metadata;
-
-  /// Returns a future that completes with a library mirror on the library being
-  /// imported or exported when it is loaded, and initiates a load of that
-  /// library if it is not loaded.
-  Future<LibraryMirror> loadLibrary();
-}
-
-/// A mirror on a show/hide combinator declared on a library dependency.
-abstract class CombinatorMirror implements Mirror {
-  /// The list of identifiers on the combinator.
-  List<Symbol> get identifiers;
-
-  /// Is `true` if this is a 'show' combinator.
-  bool get isShow;
-
-  /// Is `true` if this is a 'hide' combinator.
-  bool get isHide;
-}
-
-/**
- * A [TypeMirror] reflects a Dart language class, typedef,
- * function type or type variable.
- */
-abstract class TypeMirror implements DeclarationMirror {
-  /**
-   * Returns true if this mirror reflects dynamic, a non-generic class or
-   * typedef, or an instantiated generic class or typedef in the current
-   * isolate. Otherwise, returns false.
-   */
-  bool get hasReflectedType;
-
-  /**
-   * If [:hasReflectedType:] returns true, returns the corresponding [Type].
-   * Otherwise, an [UnsupportedError] is thrown.
-   */
-  Type get reflectedType;
-
-  /**
-   * An immutable list with mirrors for all type variables for this type.
-   *
-   * If this type is a generic declaration or an invocation of a generic
-   * declaration, the returned list contains mirrors on the type variables
-   * declared in the original declaration.
-   * Otherwise, the returned list is empty.
-   *
-   * This list preserves the order of declaration of the type variables.
-   */
-  List<TypeVariableMirror> get typeVariables;
-
-  /**
-   * An immutable list with mirrors for all type arguments for
-   * this type.
-   *
-   * If the reflectee is an invocation of a generic class,
-   * the type arguments are the bindings of its type parameters.
-   * If the reflectee is the original declaration of a generic,
-   * it has no type arguments and this method returns an empty list.
-   * If the reflectee is not generic, then
-   * it has no type arguments and this method returns an empty list.
-   *
-   * This list preserves the order of declaration of the type variables.
-   */
-  List<TypeMirror> get typeArguments;
-
-  /**
-   * Is this the original declaration of this type?
-   *
-   * For most classes, they are their own original declaration.  For
-   * generic classes, however, there is a distinction between the
-   * original class declaration, which has unbound type variables, and
-   * the instantiations of generic classes, which have bound type
-   * variables.
-   */
-  bool get isOriginalDeclaration;
-
-  /**
-   * A mirror on the original declaration of this type.
-   *
-   * For most classes, they are their own original declaration.  For
-   * generic classes, however, there is a distinction between the
-   * original class declaration, which has unbound type variables, and
-   * the instantiations of generic classes, which have bound type
-   * variables.
-   */
-  TypeMirror get originalDeclaration;
-
-  /**
-   * Checks the subtype relationship, denoted by `<:` in the language
-   * specification.
-   *
-   * This is the type relationship used in `is` test checks.
-   */
-  bool isSubtypeOf(TypeMirror other);
-
-  /**
-   * Checks the assignability relationship, denoted by `<=>` in the language
-   * specification.
-   *
-   * This is the type relationship tested on assignment in checked mode.
-   */
-  bool isAssignableTo(TypeMirror other);
-}
-
-/**
- * A [ClassMirror] reflects a Dart language class.
- */
-abstract class ClassMirror implements TypeMirror, ObjectMirror {
-  /**
-   * A mirror on the superclass on the reflectee.
-   *
-   * If this type is [:Object:], the superclass will be null.
-   */
-  ClassMirror? get superclass;
-
-  /**
-   * A list of mirrors on the superinterfaces of the reflectee.
-   */
-  List<ClassMirror> get superinterfaces;
-
-  /**
-   * Is the reflectee abstract?
-   */
-  bool get isAbstract;
-
-  /**
-   * Is the reflectee an enum?
-   */
-  bool get isEnum;
-
-  /**
-   * Returns an immutable map of the declarations actually given in the class
-   * declaration.
-   *
-   * This map includes all regular methods, getters, setters, fields,
-   * constructors and type variables actually declared in the class. Both
-   * static and instance members are included, but no inherited members are
-   * included. The map is keyed by the simple names of the declarations.
-   *
-   * This does not include inherited members.
-   */
-  Map<Symbol, DeclarationMirror> get declarations;
-
-  /**
-   * Returns a map of the methods, getters and setters of an instance of the
-   * class.
-   *
-   * The intent is to capture those members that constitute the API of an
-   * instance. Hence fields are not included, but the getters and setters
-   * implicitly introduced by fields are included. The map includes methods,
-   * getters and setters that are inherited as well as those introduced by the
-   * class itself.
-   *
-   * The map is keyed by the simple names of the members.
-   */
-  Map<Symbol, MethodMirror> get instanceMembers;
-
-  /**
-   * Returns a map of the static methods, getters and setters of the class.
-   *
-   * The intent is to capture those members that constitute the API of a class.
-   * Hence fields are not included, but the getters and setters implicitly
-   * introduced by fields are included.
-   *
-   * The map is keyed by the simple names of the members.
-   */
-  Map<Symbol, MethodMirror> get staticMembers;
-
-  /**
-   * The mixin of this class.
-   *
-   * If this class is the result of a mixin application of the form S with M,
-   * returns a class mirror on M. Otherwise returns a class mirror on
-   * the reflectee.
-   */
-  ClassMirror get mixin;
-
-  /**
-   * Invokes the named constructor and returns a mirror on the result.
-   *
-   * Let *c* be the class reflected by this mirror,
-   * let *a1, ..., an* be the elements of [positionalArguments],
-   * let *k1, ..., km* be the identifiers denoted by the elements of
-   * [namedArguments.keys],
-   * and let *v1, ..., vm* be the elements of [namedArguments.values].
-   *
-   * If [constructorName] was created from the empty string, then this method
-   * will execute the instance creation expression
-   * *new c(a1, ..., an, k1: v1, ..., km: vm)* in a scope that has access to
-   * the private members of *c*.
-   *
-   * Otherwise, let *f* be the simple name of the constructor denoted by
-   * [constructorName]. Then this method will execute the instance creation
-   * expression *new c.f(a1, ..., an, k1: v1, ..., km: vm)* in a scope that has
-   * access to the private members of *c*.
-   *
-   * In either case:
-   *
-   * * If the expression evaluates to a result *r*, this method returns the
-   *   result of calling [reflect]\(*r*\).
-   * * If evaluating the expression causes a compilation error, the effect is
-   *   the same as if a non-reflective compilation error had been encountered.
-   * * If evaluating the expression throws an exception *e* (that it does not
-   *   catch), this method throws *e*.
-   */
-  InstanceMirror newInstance(
-      Symbol constructorName, List<dynamic> positionalArguments,
-      [Map<Symbol, dynamic> namedArguments = const <Symbol, dynamic>{}]);
-
-  /**
-   * Whether this mirror is equal to [other].
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. This mirror and [other] reflect the same class.
-   *
-   * Note that if the reflected class is an invocation of a generic class, 2.
-   * implies that the reflected class and [other] have equal type arguments.
-   */
-  bool operator ==(Object other);
-
-  /**
-   * Returns whether the class denoted by the receiver is a subclass of the
-   * class denoted by the argument.
-   *
-   * Note that the subclass relationship is reflexive.
-   */
-  bool isSubclassOf(ClassMirror other);
-}
-
-/**
- * A [FunctionTypeMirror] represents the type of a function in the
- * Dart language.
- */
-abstract class FunctionTypeMirror implements ClassMirror {
-  /**
-   * Returns the return type of the reflectee.
-   */
-  TypeMirror get returnType;
-
-  /**
-   * Returns a list of the parameter types of the reflectee.
-   */
-  List<ParameterMirror> get parameters;
-
-  /**
-   * A mirror on the [:call:] method for the reflectee.
-   */
-  // This is only here because in the past the VM did not implement a call
-  // method on closures.
-  MethodMirror get callMethod;
-}
-
-/**
- * A [TypeVariableMirror] represents a type parameter of a generic type.
- */
-abstract class TypeVariableMirror extends TypeMirror {
-  /**
-   * A mirror on the type that is the upper bound of this type variable.
-   */
-  TypeMirror get upperBound;
-
-  /**
-   * Is the reflectee static?
-   *
-   * For the purposes of the mirrors library, type variables are considered
-   * non-static.
-   */
-  bool get isStatic;
-
-  /**
-   * Whether [other] is a [TypeVariableMirror] on the same type variable as this
-   * mirror.
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
-   */
-  bool operator ==(Object other);
-}
-
-/**
- * A [TypedefMirror] represents a typedef in a Dart language program.
- */
-abstract class TypedefMirror implements TypeMirror {
-  /**
-   * The defining type for this typedef.
-   *
-   * If the type referred to by the reflectee is a function type *F*, the
-   * result will be [:FunctionTypeMirror:] reflecting *F* which is abstract
-   * and has an abstract method [:call:] whose signature corresponds to *F*.
-   * For instance [:void f(int):] is the referent for [:typedef void f(int):].
-   */
-  FunctionTypeMirror get referent;
-}
-
-/**
- * A [MethodMirror] reflects a Dart language function, method,
- * constructor, getter, or setter.
- */
-abstract class MethodMirror implements DeclarationMirror {
-  /**
-   * A mirror on the return type for the reflectee.
-   */
-  TypeMirror get returnType;
-
-  /**
-   * The source code for the reflectee, if available. Otherwise null.
-   */
-  String? get source;
-
-  /**
-   * A list of mirrors on the parameters for the reflectee.
-   */
-  List<ParameterMirror> get parameters;
-
-  /**
-   * A function is considered non-static iff it is permited to refer to 'this'.
-   *
-   * Note that generative constructors are considered non-static, whereas
-   * factory constructors are considered static.
-   */
-  bool get isStatic;
-
-  /**
-   * Is the reflectee abstract?
-   */
-  bool get isAbstract;
-
-  /**
-   * Returns true if the reflectee is synthetic, and returns false otherwise.
-   *
-   * A reflectee is synthetic if it is a getter or setter implicitly introduced
-   * for a field or Type, or if it is a constructor that was implicitly
-   * introduced as a default constructor or as part of a mixin application.
-   */
-  bool get isSynthetic;
-
-  /**
-   * Is the reflectee a regular function or method?
-   *
-   * A function or method is regular if it is not a getter, setter, or
-   * constructor.  Note that operators, by this definition, are
-   * regular methods.
-   */
-  bool get isRegularMethod;
-
-  /**
-   * Is the reflectee an operator?
-   */
-  bool get isOperator;
-
-  /**
-   * Is the reflectee a getter?
-   */
-  bool get isGetter;
-
-  /**
-   * Is the reflectee a setter?
-   */
-  bool get isSetter;
-
-  /**
-   * Is the reflectee a constructor?
-   */
-  bool get isConstructor;
-
-  /**
-   * The constructor name for named constructors and factory methods.
-   *
-   * For unnamed constructors, this is the empty string.  For
-   * non-constructors, this is the empty string.
-   *
-   * For example, [:'bar':] is the constructor name for constructor
-   * [:Foo.bar:] of type [:Foo:].
-   */
-  Symbol get constructorName;
-
-  /**
-   * Is the reflectee a const constructor?
-   */
-  bool get isConstConstructor;
-
-  /**
-   * Is the reflectee a generative constructor?
-   */
-  bool get isGenerativeConstructor;
-
-  /**
-   * Is the reflectee a redirecting constructor?
-   */
-  bool get isRedirectingConstructor;
-
-  /**
-   * Is the reflectee a factory constructor?
-   */
-  bool get isFactoryConstructor;
-
-  /**
-   * Is the reflectee an extension method?
-   */
-  bool get isExtensionMember;
-
-  /**
-   * Whether this mirror is equal to [other].
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
-   */
-  bool operator ==(Object other);
-}
-
-/**
- * A [VariableMirror] reflects a Dart language variable declaration.
- */
-abstract class VariableMirror implements DeclarationMirror {
-  /**
-   * Returns a mirror on the type of the reflectee.
-   */
-  TypeMirror get type;
-
-  /**
-   * Returns [:true:] if the reflectee is a static variable.
-   * Otherwise returns [:false:].
-   *
-   * For the purposes of the mirror library, top-level variables are
-   * implicitly declared static.
-   */
-  bool get isStatic;
-
-  /**
-   * Returns [:true:] if the reflectee is a final variable.
-   * Otherwise returns [:false:].
-   */
-  bool get isFinal;
-
-  /**
-   * Returns [:true:] if the reflectee is declared [:const:].
-   * Otherwise returns [:false:].
-   */
-  bool get isConst;
-
-  /**
-   * Is the reflectee an extension member?
-   */
-  bool get isExtensionMember;
-
-  /**
-   * Whether this mirror is equal to [other].
-   *
-   * The equality holds if and only if
-   *
-   * 1. [other] is a mirror of the same kind, and
-   * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
-   */
-  bool operator ==(Object other);
-}
-
-/**
- * A [ParameterMirror] reflects a Dart formal parameter declaration.
- */
-abstract class ParameterMirror implements VariableMirror {
-  /**
-   * A mirror on the type of this parameter.
-   */
-  TypeMirror get type;
-
-  /**
-   * Returns [:true:] if the reflectee is an optional parameter.
-   * Otherwise returns [:false:].
-   */
-  bool get isOptional;
-
-  /**
-   * Returns [:true:] if the reflectee is a named parameter.
-   * Otherwise returns [:false:].
-   */
-  bool get isNamed;
-
-  /**
-   * Returns [:true:] if the reflectee has explicitly declared a default value.
-   * Otherwise returns [:false:].
-   */
-  bool get hasDefaultValue;
-
-  /**
-   * Returns the default value of an optional parameter.
-   *
-   * Returns an [InstanceMirror] on the (compile-time constant)
-   * default value for an optional parameter.
-   * If no default value is declared, it defaults to `null`
-   * and a mirror of `null` is returned.
-   *
-   * Returns `null` for a required parameter.
-   */
-  InstanceMirror? get defaultValue;
-}
-
-/**
- * A [SourceLocation] describes the span of an entity in Dart source code.
- */
-abstract class SourceLocation {
-  /**
-   * The 1-based line number for this source location.
-   *
-   * A value of 0 means that the line number is unknown.
-   */
-  int get line;
-
-  /**
-   * The 1-based column number for this source location.
-   *
-   * A value of 0 means that the column number is unknown.
-   */
-  int get column;
-
-  /**
-   * Returns the URI where the source originated.
-   */
-  Uri get sourceUri;
-}
-
-/**
- * Class used for encoding comments as metadata annotations.
- */
-class Comment {
-  /**
-   * The comment text as written in the source text.
-   */
-  final String text;
-
-  /**
-   * The comment text without the start, end, and padding text.
-   *
-   * For example, if [text] is [: /** Comment text. */ :] then the [trimmedText]
-   * is [: Comment text. :].
-   */
-  final String trimmedText;
-
-  /**
-   * Is [:true:] if this comment is a documentation comment.
-   *
-   * That is, that the comment is either enclosed in [: /** ... */ :] or starts
-   * with [: /// :].
-   */
-  final bool isDocComment;
-
-  const Comment(this.text, this.trimmedText, this.isDocComment);
-}
-
-/**
- * Annotation describing how "dart:mirrors" is used (EXPERIMENTAL).
- *
- * When used as metadata on an import of "dart:mirrors" in library *L*, this
- * class describes how "dart:mirrors" is used by library *L* unless overridden.
- * See [override].
- *
- * The following text is non-normative:
- *
- * In some scenarios, for example, when minifying Dart code, or when generating
- * JavaScript code from a Dart program, the size and performance of the output
- * can suffer from use of reflection.  In those cases, telling the compiler
- * what is used, can have a significant impact.
- *
- * Example usage:
- *
- *     @MirrorsUsed(symbols: 'foo')
- *     import 'dart:mirrors';
- *
- *     class Foo {
- *       noSuchMethod(Invocation invocation) {
- *         print(MirrorSystem.getName(invocation.memberName));
- *       }
- *     }
- *
- *     main() {
- *       new Foo().foo(); // Prints "foo".
- *       new Foo().bar(); // Might print an arbitrary (mangled) name, "bar".
- *     }
- *
- * For a detailed description of the parameters to the [MirrorsUsed] constructor
- * see the comments for [symbols], [targets], [metaTargets] and [override].
- *
- * An import of `dart:mirrors` may have multiple [MirrorsUsed] annotations. This
- * is particularly helpful to specify overrides for specific libraries. For
- * example:
- *
- *     @MirrorsUsed(targets: 'foo.Bar', override: 'foo')
- *     @MirrorsUsed(targets: 'Bar')
- *     import 'dart:mirrors';
- *
- * will ensure that the target `Bar` from the current library and from library
- * `foo` is available for reflection. See also [override].
- */
-@Deprecated("No longer has any effect. Will be removed in a later release.")
-class MirrorsUsed {
-  // Note: the fields of this class are untyped.  This is because the most
-  // convenient way to specify symbols today is using a single string. In
-  // some cases, a const list of classes might be convenient. Some
-  // might prefer to use a const list of symbols.
-
-  /**
-   * The list of strings passed to new [Symbol], and symbols that might be
-   * passed to [MirrorSystem.getName].
-   *
-   * Combined with the names of [targets], [metaTargets] and their members,
-   * this forms the complete list of strings passed to new [Symbol], and
-   * symbols that might be passed to [MirrorSystem.getName] by the library to
-   * which this metadata applies.
-   *
-   * The following text is non-normative:
-   *
-   * Dart2js currently supports the following formats to specify symbols:
-   *
-   * * A constant [List] of [String] constants representing symbol names,
-   *   e.g., `const ['foo', 'bar']`.
-   * * A single [String] constant whose value is a comma-separated list of
-   *   symbol names, e.g., `"foo, bar"`.
-   *
-   * Specifying the `symbols` field turns off the following warnings emitted by
-   * dart2js:
-   *
-   * * Using "MirrorSystem.getName" may result in larger output.
-   * * Using "new Symbol" may result in larger output.
-   *
-   * For example, if you're using [noSuchMethod] to interact with a database,
-   * extract all the possible column names and include them in this list.
-   * Similarly, if you're using [noSuchMethod] to interact with another
-   * language (JavaScript, for example) extract all the identifiers from the
-   * API you use and include them in this list.
-   *
-   * Note that specifying a symbol only ensures that the symbol will be
-   * available under that name at runtime. It does not mark targets with
-   * that name as available for reflection. See [targets] and [metaTargets]
-   * for that purpose.
-   */
-  final symbols;
-
-  /**
-   * A list of reflective targets.
-   *
-   * Combined with [metaTargets], this provides the complete list of reflective
-   * targets used by the library to which this metadata applies.
-   *
-   * The following text is non-normative:
-   *
-   * For now, there is no formal description of what a reflective target is.
-   * Informally, a target is a library, a class, a method or a field.
-   *
-   * Dart2js currently supports the following formats to specify targets:
-   *
-   * * A constant [List] containing [String] constants representing (qualified)
-   *   names of targets and Dart types.
-   * * A single [String] constant whose value is a comma-separated list of
-   *   (qualified) names.
-   * * A single Dart type.
-   *
-   * A (qualified) name is resolved to a target as follows:
-   *
-   * 1. If the qualified name matches a library name, the matching library is
-   *    the target.
-   * 2. Else, find the longest prefix of the name such that the prefix ends
-   *    just before a `.` and is a library name.
-   * 3. Use that library as current scope. If no matching prefix was found, use
-   *    the current library, i.e., the library where the [MirrorsUsed]
-   *    annotation was placed.
-   * 4. Split the remaining suffix (the entire name if no library name was
-   *    found in step 3) into a list of [String] using `.` as a
-   *    separator.
-   * 5. Select all targets in the current scope whose name matches a [String]
-   *    from the list.
-   *
-   * For example:
-   *
-   *     library my.library.one;
-   *
-   *     class A {
-   *       var aField;
-   *     }
-   *
-   *     library main;
-   *
-   *     @MirrorsUsed(targets: "my.library.one.A.aField")
-   *     import "dart:mirrors";
-   *
-   * The [MirrorsUsed] annotation specifies `A` and `aField` from library
-   * `my.library.one` as targets. This will mark the class `A` as a reflective
-   * target. The target specification for `aField` has no effect, as there is
-   * no target in `my.library.one` with that name.
-   *
-   * Note that everything within a target also is available for reflection.
-   * So, if a library is specified as target, all classes in that library
-   * become targets for reflection. Likewise, if a class is a target, all
-   * its methods and fields become targets for reflection. As a consequence,
-   * `aField` in the above example is also a reflective target.
-   *
-   */
-  final targets;
-
-  /**
-   * A list of classes that when used as metadata indicates a reflective
-   * target. See also [targets].
-   *
-   * The following text is non-normative:
-   *
-   * The format for specifying the list of classes is the same as used for
-   * specifying [targets]. However, as a library cannot be used as a metadata
-   * annotation in Dart, adding a library to the list of [metaTargets] has no
-   * effect. In particular, adding a library to [metaTargets] does not make
-   * the library's classes valid metadata annotations to enable reflection.
-   *
-   * If an instance of a class specified in [metaTargets] is used as
-   * metadata annotation on a library, class, field or method, that library,
-   * class, field or  method is added to the set of targets for reflection.
-   *
-   * Example usage:
-   *
-   *     library example;
-   *     @MirrorsUsed(metaTargets: "example.Reflectable")
-   *     import "dart:mirrors";
-   *
-   *     class Reflectable {
-   *       const Reflectable();
-   *     }
-   *
-   *     class Foo {
-   *       @Reflectable()
-   *       reflectableMethod() { ... }
-   *
-   *       nonReflectableMethod() { ... }
-   *     }
-   *
-   * In the above example. `reflectableMethod` is marked as reflectable by
-   * using the `Reflectable` class, which in turn is specified in the
-   * [metaTargets] annotation.
-   *
-   * The method `nonReflectableMethod` lacks a metadata annotation and thus
-   * will not be reflectable at runtime.
-   */
-  final metaTargets;
-
-  /**
-   * A list of library names or "*".
-   *
-   * When used as metadata on an import of "dart:mirrors", this metadata does
-   * not apply to the library in which the annotation is used, but instead
-   * applies to the other libraries (all libraries if "*" is used).
-   *
-   * The following text is non-normative:
-   *
-   * Dart2js currently supports the following formats to specify libraries:
-   *
-   * * A constant [List] containing [String] constants representing names of
-   *   libraries.
-   * * A single [String] constant whose value is a comma-separated list of
-   *   library names.
-   *
-   * Conceptually, a [MirrorsUsed] annotation with [override] has the same
-   * effect as placing the annotation directly on the import of `dart:mirrors`
-   * in each of the referenced libraries. Thus, if the library had no
-   * [MirrorsUsed] annotation before, its unconditional import of
-   * `dart:mirrors` is overridden by an annotated import.
-   *
-   * Note that, like multiple explicit [MirrorsUsed] annotations, using
-   * override on a library with an existing [MirrorsUsed] annotation is
-   * additive. That is, the overall set of reflective targets is the union
-   * of the reflective targets that arise from the original and the
-   * overriding [MirrorsUsed] annotations.
-   *
-   * The use of [override] is only meaningful for libraries that have an
-   * import of `dart:mirrors` without annotation because otherwise it would
-   * work exactly the same way without the [override] parameter.
-   *
-   * While the annotation will apply to the given target libraries, the
-   * [symbols], [targets] and [metaTargets] are still evaluated in the
-   * scope of the annotation. Thus, to select a target from library `foo`,
-   * a qualified name has to be used or, if the target is visible in the
-   * current scope, its type may be referenced.
-   *
-   * For example, the following code marks all targets in the library `foo`
-   * as reflectable that have a metadata annotation using the `Reflectable`
-   * class from the same library.
-   *
-   *     @MirrorsUsed(metaTargets: "foo.Reflectable", override: "foo")
-   *
-   * However, the following code would require the use of the `Reflectable`
-   * class from the current library, instead.
-   *
-   *     @MirrorsUsed(metaTargets: "Reflectable", override: "foo")
-   *
-   */
-  final override;
-
-  /**
-   * See the documentation for [MirrorsUsed.symbols], [MirrorsUsed.targets],
-   * [MirrorsUsed.metaTargets] and [MirrorsUsed.override] for documentation
-   * of the parameters.
-   */
-  const MirrorsUsed(
-      {this.symbols, this.targets, this.metaTargets, this.override});
-}
diff --git a/sdk_nnbd/lib/mirrors/mirrors_sources.gni b/sdk_nnbd/lib/mirrors/mirrors_sources.gni
deleted file mode 100644
index e019c34..0000000
--- a/sdk_nnbd/lib/mirrors/mirrors_sources.gni
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2017, 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.
-
-mirrors_sdk_sources = [
-  "mirrors.dart",
-  # The above file needs to be first if additional parts are added to the lib.
-]
diff --git a/sdk_nnbd/lib/svg/dart2js/svg_dart2js.dart b/sdk_nnbd/lib/svg/dart2js/svg_dart2js.dart
deleted file mode 100644
index ebb9015..0000000
--- a/sdk_nnbd/lib/svg/dart2js/svg_dart2js.dart
+++ /dev/null
@@ -1,4131 +0,0 @@
-/**
- * Scalable Vector Graphics:
- * Two-dimensional vector graphics with support for events and animation.
- *
- * For details about the features and syntax of SVG, a W3C standard,
- * refer to the
- * [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/).
- *
- * {@category Web}
- */
-library dart.dom.svg;
-
-import 'dart:async';
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' show FixedLengthListMixin;
-import 'dart:html';
-import 'dart:html_common';
-import 'dart:_js_helper' show Creates, Returns, JSName, Native;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show Interceptor;
-// DO NOT EDIT - unless you are editing documentation as per:
-// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
-// Auto-generated dart:svg library.
-
-// Copyright (c) 2012, 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.
-
-class _SvgElementFactoryProvider {
-  static SvgElement createSvgElement_tag(String tag) {
-    final Element temp =
-        document.createElementNS("http://www.w3.org/2000/svg", tag);
-    return temp as SvgElement;
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAElement")
-class AElement extends GraphicsElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory AElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("a") as AElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AElement.created() : super.created();
-
-  AnimatedString get target native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAngle")
-class Angle extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Angle._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int SVG_ANGLETYPE_DEG = 2;
-
-  static const int SVG_ANGLETYPE_GRAD = 4;
-
-  static const int SVG_ANGLETYPE_RAD = 3;
-
-  static const int SVG_ANGLETYPE_UNKNOWN = 0;
-
-  static const int SVG_ANGLETYPE_UNSPECIFIED = 1;
-
-  int get unitType native;
-
-  num get value native;
-
-  set value(num value) native;
-
-  String get valueAsString native;
-
-  set valueAsString(String value) native;
-
-  num get valueInSpecifiedUnits native;
-
-  set valueInSpecifiedUnits(num value) native;
-
-  void convertToSpecifiedUnits(int unitType) native;
-
-  void newValueSpecifiedUnits(int unitType, num valueInSpecifiedUnits) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGAnimateElement")
-class AnimateElement extends AnimationElement {
-  // To suppress missing implicit constructor warnings.
-  factory AnimateElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnimateElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animate")
-          as AnimateElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AnimateElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('animate') &&
-      (new SvgElement.tag('animate') is AnimateElement);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGAnimateMotionElement")
-class AnimateMotionElement extends AnimationElement {
-  // To suppress missing implicit constructor warnings.
-  factory AnimateMotionElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnimateMotionElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animateMotion")
-          as AnimateMotionElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AnimateMotionElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('animateMotion') &&
-      (new SvgElement.tag('animateMotion') is AnimateMotionElement);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGAnimateTransformElement")
-class AnimateTransformElement extends AnimationElement {
-  // To suppress missing implicit constructor warnings.
-  factory AnimateTransformElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnimateTransformElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animateTransform")
-          as AnimateTransformElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AnimateTransformElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('animateTransform') &&
-      (new SvgElement.tag('animateTransform') is AnimateTransformElement);
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedAngle")
-class AnimatedAngle extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedAngle._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Angle get animVal native;
-
-  Angle get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedBoolean")
-class AnimatedBoolean extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedBoolean._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get animVal native;
-
-  bool get baseVal native;
-
-  set baseVal(bool value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedEnumeration")
-class AnimatedEnumeration extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedEnumeration._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get animVal native;
-
-  int get baseVal native;
-
-  set baseVal(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedInteger")
-class AnimatedInteger extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedInteger._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get animVal native;
-
-  int get baseVal native;
-
-  set baseVal(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedLength")
-class AnimatedLength extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedLength._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Length get animVal native;
-
-  Length get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedLengthList")
-class AnimatedLengthList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedLengthList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  LengthList get animVal native;
-
-  LengthList get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedNumber")
-class AnimatedNumber extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedNumber._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get animVal native;
-
-  num get baseVal native;
-
-  set baseVal(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedNumberList")
-class AnimatedNumberList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedNumberList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  NumberList get animVal native;
-
-  NumberList get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedPreserveAspectRatio")
-class AnimatedPreserveAspectRatio extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedPreserveAspectRatio._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  PreserveAspectRatio get animVal native;
-
-  PreserveAspectRatio get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedRect")
-class AnimatedRect extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedRect._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Rect get animVal native;
-
-  Rect get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedString")
-class AnimatedString extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedString._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get animVal native;
-
-  String get baseVal native;
-
-  set baseVal(String value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimatedTransformList")
-class AnimatedTransformList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AnimatedTransformList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  TransformList get animVal native;
-
-  TransformList get baseVal native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGAnimationElement")
-class AnimationElement extends SvgElement implements Tests {
-  // To suppress missing implicit constructor warnings.
-  factory AnimationElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnimationElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("animation")
-          as AnimationElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  AnimationElement.created() : super.created();
-
-  SvgElement get targetElement native;
-
-  void beginElement() native;
-
-  void beginElementAt(num offset) native;
-
-  void endElement() native;
-
-  void endElementAt(num offset) native;
-
-  double getCurrentTime() native;
-
-  double getSimpleDuration() native;
-
-  double getStartTime() native;
-
-  // From SVGTests
-
-  StringList get requiredExtensions native;
-
-  StringList get systemLanguage native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGCircleElement")
-class CircleElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory CircleElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory CircleElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("circle")
-          as CircleElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  CircleElement.created() : super.created();
-
-  AnimatedLength get cx native;
-
-  AnimatedLength get cy native;
-
-  AnimatedLength get r native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGClipPathElement")
-class ClipPathElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory ClipPathElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ClipPathElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("clipPath")
-          as ClipPathElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ClipPathElement.created() : super.created();
-
-  AnimatedEnumeration get clipPathUnits native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGDefsElement")
-class DefsElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory DefsElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DefsElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("defs") as DefsElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DefsElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGDescElement")
-class DescElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory DescElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DescElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("desc") as DescElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DescElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("SVGDiscardElement")
-class DiscardElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory DiscardElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  DiscardElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGEllipseElement")
-class EllipseElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory EllipseElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory EllipseElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("ellipse")
-          as EllipseElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  EllipseElement.created() : super.created();
-
-  AnimatedLength get cx native;
-
-  AnimatedLength get cy native;
-
-  AnimatedLength get rx native;
-
-  AnimatedLength get ry native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEBlendElement")
-class FEBlendElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEBlendElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEBlendElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feBlend")
-          as FEBlendElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEBlendElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feBlend') &&
-      (new SvgElement.tag('feBlend') is FEBlendElement);
-
-  static const int SVG_FEBLEND_MODE_DARKEN = 4;
-
-  static const int SVG_FEBLEND_MODE_LIGHTEN = 5;
-
-  static const int SVG_FEBLEND_MODE_MULTIPLY = 2;
-
-  static const int SVG_FEBLEND_MODE_NORMAL = 1;
-
-  static const int SVG_FEBLEND_MODE_SCREEN = 3;
-
-  static const int SVG_FEBLEND_MODE_UNKNOWN = 0;
-
-  AnimatedString get in1 native;
-
-  AnimatedString get in2 native;
-
-  AnimatedEnumeration get mode native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEColorMatrixElement")
-class FEColorMatrixElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEColorMatrixElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEColorMatrixElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feColorMatrix")
-          as FEColorMatrixElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEColorMatrixElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feColorMatrix') &&
-      (new SvgElement.tag('feColorMatrix') is FEColorMatrixElement);
-
-  static const int SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
-
-  static const int SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
-
-  static const int SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
-
-  static const int SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
-
-  static const int SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
-
-  AnimatedString get in1 native;
-
-  AnimatedEnumeration get type native;
-
-  AnimatedNumberList get values native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEComponentTransferElement")
-class FEComponentTransferElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEComponentTransferElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEComponentTransferElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feComponentTransfer")
-          as FEComponentTransferElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEComponentTransferElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feComponentTransfer') &&
-      (new SvgElement.tag('feComponentTransfer') is FEComponentTransferElement);
-
-  AnimatedString get in1 native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGFECompositeElement")
-class FECompositeElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FECompositeElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FECompositeElement.created() : super.created();
-
-  static const int SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
-
-  static const int SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
-
-  static const int SVG_FECOMPOSITE_OPERATOR_IN = 2;
-
-  static const int SVG_FECOMPOSITE_OPERATOR_OUT = 3;
-
-  static const int SVG_FECOMPOSITE_OPERATOR_OVER = 1;
-
-  static const int SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
-
-  static const int SVG_FECOMPOSITE_OPERATOR_XOR = 5;
-
-  AnimatedString get in1 native;
-
-  AnimatedString get in2 native;
-
-  AnimatedNumber get k1 native;
-
-  AnimatedNumber get k2 native;
-
-  AnimatedNumber get k3 native;
-
-  AnimatedNumber get k4 native;
-
-  AnimatedEnumeration get operator native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEConvolveMatrixElement")
-class FEConvolveMatrixElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEConvolveMatrixElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEConvolveMatrixElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feConvolveMatrix")
-          as FEConvolveMatrixElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEConvolveMatrixElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feConvolveMatrix') &&
-      (new SvgElement.tag('feConvolveMatrix') is FEConvolveMatrixElement);
-
-  static const int SVG_EDGEMODE_DUPLICATE = 1;
-
-  static const int SVG_EDGEMODE_NONE = 3;
-
-  static const int SVG_EDGEMODE_UNKNOWN = 0;
-
-  static const int SVG_EDGEMODE_WRAP = 2;
-
-  AnimatedNumber get bias native;
-
-  AnimatedNumber get divisor native;
-
-  AnimatedEnumeration get edgeMode native;
-
-  AnimatedString get in1 native;
-
-  AnimatedNumberList get kernelMatrix native;
-
-  AnimatedNumber get kernelUnitLengthX native;
-
-  AnimatedNumber get kernelUnitLengthY native;
-
-  AnimatedInteger get orderX native;
-
-  AnimatedInteger get orderY native;
-
-  AnimatedBoolean get preserveAlpha native;
-
-  AnimatedInteger get targetX native;
-
-  AnimatedInteger get targetY native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEDiffuseLightingElement")
-class FEDiffuseLightingElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEDiffuseLightingElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEDiffuseLightingElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feDiffuseLighting")
-          as FEDiffuseLightingElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEDiffuseLightingElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feDiffuseLighting') &&
-      (new SvgElement.tag('feDiffuseLighting') is FEDiffuseLightingElement);
-
-  AnimatedNumber get diffuseConstant native;
-
-  AnimatedString get in1 native;
-
-  AnimatedNumber get kernelUnitLengthX native;
-
-  AnimatedNumber get kernelUnitLengthY native;
-
-  AnimatedNumber get surfaceScale native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEDisplacementMapElement")
-class FEDisplacementMapElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEDisplacementMapElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEDisplacementMapElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feDisplacementMap")
-          as FEDisplacementMapElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEDisplacementMapElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feDisplacementMap') &&
-      (new SvgElement.tag('feDisplacementMap') is FEDisplacementMapElement);
-
-  static const int SVG_CHANNEL_A = 4;
-
-  static const int SVG_CHANNEL_B = 3;
-
-  static const int SVG_CHANNEL_G = 2;
-
-  static const int SVG_CHANNEL_R = 1;
-
-  static const int SVG_CHANNEL_UNKNOWN = 0;
-
-  AnimatedString get in1 native;
-
-  AnimatedString get in2 native;
-
-  AnimatedNumber get scale native;
-
-  AnimatedEnumeration get xChannelSelector native;
-
-  AnimatedEnumeration get yChannelSelector native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEDistantLightElement")
-class FEDistantLightElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEDistantLightElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEDistantLightElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feDistantLight")
-          as FEDistantLightElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEDistantLightElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feDistantLight') &&
-      (new SvgElement.tag('feDistantLight') is FEDistantLightElement);
-
-  AnimatedNumber get azimuth native;
-
-  AnimatedNumber get elevation native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEFloodElement")
-class FEFloodElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEFloodElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEFloodElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFlood")
-          as FEFloodElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEFloodElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feFlood') &&
-      (new SvgElement.tag('feFlood') is FEFloodElement);
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEFuncAElement")
-class FEFuncAElement extends _SVGComponentTransferFunctionElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEFuncAElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEFuncAElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncA")
-          as FEFuncAElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEFuncAElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feFuncA') &&
-      (new SvgElement.tag('feFuncA') is FEFuncAElement);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEFuncBElement")
-class FEFuncBElement extends _SVGComponentTransferFunctionElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEFuncBElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEFuncBElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncB")
-          as FEFuncBElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEFuncBElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feFuncB') &&
-      (new SvgElement.tag('feFuncB') is FEFuncBElement);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEFuncGElement")
-class FEFuncGElement extends _SVGComponentTransferFunctionElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEFuncGElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEFuncGElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncG")
-          as FEFuncGElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEFuncGElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feFuncG') &&
-      (new SvgElement.tag('feFuncG') is FEFuncGElement);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEFuncRElement")
-class FEFuncRElement extends _SVGComponentTransferFunctionElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEFuncRElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEFuncRElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feFuncR")
-          as FEFuncRElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEFuncRElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feFuncR') &&
-      (new SvgElement.tag('feFuncR') is FEFuncRElement);
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEGaussianBlurElement")
-class FEGaussianBlurElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEGaussianBlurElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEGaussianBlurElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feGaussianBlur")
-          as FEGaussianBlurElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEGaussianBlurElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feGaussianBlur') &&
-      (new SvgElement.tag('feGaussianBlur') is FEGaussianBlurElement);
-
-  AnimatedString get in1 native;
-
-  AnimatedNumber get stdDeviationX native;
-
-  AnimatedNumber get stdDeviationY native;
-
-  void setStdDeviation(num stdDeviationX, num stdDeviationY) native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEImageElement")
-class FEImageElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes, UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory FEImageElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEImageElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feImage")
-          as FEImageElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEImageElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feImage') &&
-      (new SvgElement.tag('feImage') is FEImageElement);
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEMergeElement")
-class FEMergeElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEMergeElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEMergeElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feMerge")
-          as FEMergeElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEMergeElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feMerge') &&
-      (new SvgElement.tag('feMerge') is FEMergeElement);
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEMergeNodeElement")
-class FEMergeNodeElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEMergeNodeElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEMergeNodeElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feMergeNode")
-          as FEMergeNodeElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEMergeNodeElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feMergeNode') &&
-      (new SvgElement.tag('feMergeNode') is FEMergeNodeElement);
-
-  AnimatedString get in1 native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEMorphologyElement")
-class FEMorphologyElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEMorphologyElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEMorphologyElement.created() : super.created();
-
-  static const int SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
-
-  static const int SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
-
-  static const int SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
-
-  AnimatedString get in1 native;
-
-  AnimatedEnumeration get operator native;
-
-  AnimatedNumber get radiusX native;
-
-  AnimatedNumber get radiusY native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEOffsetElement")
-class FEOffsetElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FEOffsetElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEOffsetElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feOffset")
-          as FEOffsetElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEOffsetElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feOffset') &&
-      (new SvgElement.tag('feOffset') is FEOffsetElement);
-
-  AnimatedNumber get dx native;
-
-  AnimatedNumber get dy native;
-
-  AnimatedString get in1 native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFEPointLightElement")
-class FEPointLightElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory FEPointLightElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FEPointLightElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("fePointLight")
-          as FEPointLightElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FEPointLightElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('fePointLight') &&
-      (new SvgElement.tag('fePointLight') is FEPointLightElement);
-
-  AnimatedNumber get x native;
-
-  AnimatedNumber get y native;
-
-  AnimatedNumber get z native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFESpecularLightingElement")
-class FESpecularLightingElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FESpecularLightingElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FESpecularLightingElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feSpecularLighting")
-          as FESpecularLightingElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FESpecularLightingElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feSpecularLighting') &&
-      (new SvgElement.tag('feSpecularLighting') is FESpecularLightingElement);
-
-  AnimatedString get in1 native;
-
-  AnimatedNumber get kernelUnitLengthX native;
-
-  AnimatedNumber get kernelUnitLengthY native;
-
-  AnimatedNumber get specularConstant native;
-
-  AnimatedNumber get specularExponent native;
-
-  AnimatedNumber get surfaceScale native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFESpotLightElement")
-class FESpotLightElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory FESpotLightElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FESpotLightElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feSpotLight")
-          as FESpotLightElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FESpotLightElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feSpotLight') &&
-      (new SvgElement.tag('feSpotLight') is FESpotLightElement);
-
-  AnimatedNumber get limitingConeAngle native;
-
-  AnimatedNumber get pointsAtX native;
-
-  AnimatedNumber get pointsAtY native;
-
-  AnimatedNumber get pointsAtZ native;
-
-  AnimatedNumber get specularExponent native;
-
-  AnimatedNumber get x native;
-
-  AnimatedNumber get y native;
-
-  AnimatedNumber get z native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFETileElement")
-class FETileElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FETileElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FETileElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feTile")
-          as FETileElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FETileElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feTile') &&
-      (new SvgElement.tag('feTile') is FETileElement);
-
-  AnimatedString get in1 native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFETurbulenceElement")
-class FETurbulenceElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory FETurbulenceElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FETurbulenceElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("feTurbulence")
-          as FETurbulenceElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FETurbulenceElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('feTurbulence') &&
-      (new SvgElement.tag('feTurbulence') is FETurbulenceElement);
-
-  static const int SVG_STITCHTYPE_NOSTITCH = 2;
-
-  static const int SVG_STITCHTYPE_STITCH = 1;
-
-  static const int SVG_STITCHTYPE_UNKNOWN = 0;
-
-  static const int SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
-
-  static const int SVG_TURBULENCE_TYPE_TURBULENCE = 2;
-
-  static const int SVG_TURBULENCE_TYPE_UNKNOWN = 0;
-
-  AnimatedNumber get baseFrequencyX native;
-
-  AnimatedNumber get baseFrequencyY native;
-
-  AnimatedInteger get numOctaves native;
-
-  AnimatedNumber get seed native;
-
-  AnimatedEnumeration get stitchTiles native;
-
-  AnimatedEnumeration get type native;
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGFilterElement")
-class FilterElement extends SvgElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory FilterElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory FilterElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("filter")
-          as FilterElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  FilterElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('filter') &&
-      (new SvgElement.tag('filter') is FilterElement);
-
-  AnimatedEnumeration get filterUnits native;
-
-  AnimatedLength get height native;
-
-  AnimatedEnumeration get primitiveUnits native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-abstract class FilterPrimitiveStandardAttributes extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FilterPrimitiveStandardAttributes._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  AnimatedLength get height native;
-
-  AnimatedString get result native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-abstract class FitToViewBox extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory FitToViewBox._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedRect get viewBox native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGForeignObjectElement")
-class ForeignObjectElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory ForeignObjectElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ForeignObjectElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("foreignObject")
-          as ForeignObjectElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ForeignObjectElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('foreignObject') &&
-      (new SvgElement.tag('foreignObject') is ForeignObjectElement);
-
-  AnimatedLength get height native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGGElement")
-class GElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory GElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory GElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("g") as GElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  GElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("SVGGeometryElement")
-class GeometryElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory GeometryElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  GeometryElement.created() : super.created();
-
-  AnimatedNumber get pathLength native;
-
-  Point getPointAtLength(num distance) native;
-
-  double getTotalLength() native;
-
-  bool isPointInFill(Point point) native;
-
-  bool isPointInStroke(Point point) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SVGGraphicsElement")
-class GraphicsElement extends SvgElement implements Tests {
-  // To suppress missing implicit constructor warnings.
-  factory GraphicsElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  GraphicsElement.created() : super.created();
-
-  SvgElement get farthestViewportElement native;
-
-  SvgElement get nearestViewportElement native;
-
-  AnimatedTransformList get transform native;
-
-  Rect getBBox() native;
-
-  @JSName('getCTM')
-  Matrix getCtm() native;
-
-  @JSName('getScreenCTM')
-  Matrix getScreenCtm() native;
-
-  // From SVGTests
-
-  StringList get requiredExtensions native;
-
-  StringList get systemLanguage native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGImageElement")
-class ImageElement extends GraphicsElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory ImageElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ImageElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("image") as ImageElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ImageElement.created() : super.created();
-
-  String get async native;
-
-  set async(String value) native;
-
-  AnimatedLength get height native;
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  Future decode() => promiseToFuture(JS("", "#.decode()", this));
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGLength")
-class Length extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Length._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int SVG_LENGTHTYPE_CM = 6;
-
-  static const int SVG_LENGTHTYPE_EMS = 3;
-
-  static const int SVG_LENGTHTYPE_EXS = 4;
-
-  static const int SVG_LENGTHTYPE_IN = 8;
-
-  static const int SVG_LENGTHTYPE_MM = 7;
-
-  static const int SVG_LENGTHTYPE_NUMBER = 1;
-
-  static const int SVG_LENGTHTYPE_PC = 10;
-
-  static const int SVG_LENGTHTYPE_PERCENTAGE = 2;
-
-  static const int SVG_LENGTHTYPE_PT = 9;
-
-  static const int SVG_LENGTHTYPE_PX = 5;
-
-  static const int SVG_LENGTHTYPE_UNKNOWN = 0;
-
-  int get unitType native;
-
-  num get value native;
-
-  set value(num value) native;
-
-  String get valueAsString native;
-
-  set valueAsString(String value) native;
-
-  num get valueInSpecifiedUnits native;
-
-  set valueInSpecifiedUnits(num value) native;
-
-  void convertToSpecifiedUnits(int unitType) native;
-
-  void newValueSpecifiedUnits(int unitType, num valueInSpecifiedUnits) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGLengthList")
-class LengthList extends Interceptor
-    with ListMixin<Length>, ImmutableListMixin<Length>
-    implements List<Length> {
-  // To suppress missing implicit constructor warnings.
-  factory LengthList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  int get numberOfItems native;
-
-  Length operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return this.getItem(index);
-  }
-
-  void operator []=(int index, Length value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Length> mixins.
-  // Length is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Length get first {
-    if (this.length > 0) {
-      return JS('Length', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Length get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Length', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Length get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Length', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Length elementAt(int index) => this[index];
-  // -- end List<Length> mixins.
-
-  void __setter__(int index, Length newItem) native;
-
-  Length appendItem(Length newItem) native;
-
-  void clear() native;
-
-  Length getItem(int index) native;
-
-  Length initialize(Length newItem) native;
-
-  Length insertItemBefore(Length newItem, int index) native;
-
-  Length removeItem(int index) native;
-
-  Length replaceItem(Length newItem, int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGLineElement")
-class LineElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory LineElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LineElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("line") as LineElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  LineElement.created() : super.created();
-
-  AnimatedLength get x1 native;
-
-  AnimatedLength get x2 native;
-
-  AnimatedLength get y1 native;
-
-  AnimatedLength get y2 native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGLinearGradientElement")
-class LinearGradientElement extends _GradientElement {
-  // To suppress missing implicit constructor warnings.
-  factory LinearGradientElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory LinearGradientElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("linearGradient")
-          as LinearGradientElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  LinearGradientElement.created() : super.created();
-
-  AnimatedLength get x1 native;
-
-  AnimatedLength get x2 native;
-
-  AnimatedLength get y1 native;
-
-  AnimatedLength get y2 native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGMarkerElement")
-class MarkerElement extends SvgElement implements FitToViewBox {
-  // To suppress missing implicit constructor warnings.
-  factory MarkerElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MarkerElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("marker")
-          as MarkerElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MarkerElement.created() : super.created();
-
-  static const int SVG_MARKERUNITS_STROKEWIDTH = 2;
-
-  static const int SVG_MARKERUNITS_UNKNOWN = 0;
-
-  static const int SVG_MARKERUNITS_USERSPACEONUSE = 1;
-
-  static const int SVG_MARKER_ORIENT_ANGLE = 2;
-
-  static const int SVG_MARKER_ORIENT_AUTO = 1;
-
-  static const int SVG_MARKER_ORIENT_UNKNOWN = 0;
-
-  AnimatedLength get markerHeight native;
-
-  AnimatedEnumeration get markerUnits native;
-
-  AnimatedLength get markerWidth native;
-
-  AnimatedAngle get orientAngle native;
-
-  AnimatedEnumeration get orientType native;
-
-  AnimatedLength get refX native;
-
-  AnimatedLength get refY native;
-
-  void setOrientToAngle(Angle angle) native;
-
-  void setOrientToAuto() native;
-
-  // From SVGFitToViewBox
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedRect get viewBox native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGMaskElement")
-class MaskElement extends SvgElement implements Tests {
-  // To suppress missing implicit constructor warnings.
-  factory MaskElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MaskElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("mask") as MaskElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MaskElement.created() : super.created();
-
-  AnimatedLength get height native;
-
-  AnimatedEnumeration get maskContentUnits native;
-
-  AnimatedEnumeration get maskUnits native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  // From SVGTests
-
-  StringList get requiredExtensions native;
-
-  StringList get systemLanguage native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGMatrix")
-class Matrix extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Matrix._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get a native;
-
-  set a(num value) native;
-
-  num get b native;
-
-  set b(num value) native;
-
-  num get c native;
-
-  set c(num value) native;
-
-  num get d native;
-
-  set d(num value) native;
-
-  num get e native;
-
-  set e(num value) native;
-
-  num get f native;
-
-  set f(num value) native;
-
-  Matrix flipX() native;
-
-  Matrix flipY() native;
-
-  Matrix inverse() native;
-
-  Matrix multiply(Matrix secondMatrix) native;
-
-  Matrix rotate(num angle) native;
-
-  Matrix rotateFromVector(num x, num y) native;
-
-  Matrix scale(num scaleFactor) native;
-
-  Matrix scaleNonUniform(num scaleFactorX, num scaleFactorY) native;
-
-  Matrix skewX(num angle) native;
-
-  Matrix skewY(num angle) native;
-
-  Matrix translate(num x, num y) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGMetadataElement")
-class MetadataElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory MetadataElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  MetadataElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGNumber")
-class Number extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Number._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get value native;
-
-  set value(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGNumberList")
-class NumberList extends Interceptor
-    with ListMixin<Number>, ImmutableListMixin<Number>
-    implements List<Number> {
-  // To suppress missing implicit constructor warnings.
-  factory NumberList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  int get numberOfItems native;
-
-  Number operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return this.getItem(index);
-  }
-
-  void operator []=(int index, Number value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Number> mixins.
-  // Number is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Number get first {
-    if (this.length > 0) {
-      return JS('Number', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Number get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Number', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Number get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Number', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Number elementAt(int index) => this[index];
-  // -- end List<Number> mixins.
-
-  void __setter__(int index, Number newItem) native;
-
-  Number appendItem(Number newItem) native;
-
-  void clear() native;
-
-  Number getItem(int index) native;
-
-  Number initialize(Number newItem) native;
-
-  Number insertItemBefore(Number newItem, int index) native;
-
-  Number removeItem(int index) native;
-
-  Number replaceItem(Number newItem, int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPathElement")
-class PathElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory PathElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PathElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("path") as PathElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  PathElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPatternElement")
-class PatternElement extends SvgElement
-    implements FitToViewBox, UriReference, Tests {
-  // To suppress missing implicit constructor warnings.
-  factory PatternElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PatternElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("pattern")
-          as PatternElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  PatternElement.created() : super.created();
-
-  AnimatedLength get height native;
-
-  AnimatedEnumeration get patternContentUnits native;
-
-  AnimatedTransformList get patternTransform native;
-
-  AnimatedEnumeration get patternUnits native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  // From SVGFitToViewBox
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedRect get viewBox native;
-
-  // From SVGTests
-
-  StringList get requiredExtensions native;
-
-  StringList get systemLanguage native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPoint")
-class Point extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Point._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get x native;
-
-  set x(num value) native;
-
-  num get y native;
-
-  set y(num value) native;
-
-  Point matrixTransform(Matrix matrix) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPointList")
-class PointList extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PointList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length native;
-
-  int get numberOfItems native;
-
-  void __setter__(int index, Point newItem) native;
-
-  Point appendItem(Point newItem) native;
-
-  void clear() native;
-
-  Point getItem(int index) native;
-
-  Point initialize(Point newItem) native;
-
-  Point insertItemBefore(Point newItem, int index) native;
-
-  Point removeItem(int index) native;
-
-  Point replaceItem(Point newItem, int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPolygonElement")
-class PolygonElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory PolygonElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PolygonElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("polygon")
-          as PolygonElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  PolygonElement.created() : super.created();
-
-  PointList get animatedPoints native;
-
-  PointList get points native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPolylineElement")
-class PolylineElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory PolylineElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PolylineElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("polyline")
-          as PolylineElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  PolylineElement.created() : super.created();
-
-  PointList get animatedPoints native;
-
-  PointList get points native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGPreserveAspectRatio")
-class PreserveAspectRatio extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PreserveAspectRatio._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int SVG_MEETORSLICE_MEET = 1;
-
-  static const int SVG_MEETORSLICE_SLICE = 2;
-
-  static const int SVG_MEETORSLICE_UNKNOWN = 0;
-
-  static const int SVG_PRESERVEASPECTRATIO_NONE = 1;
-
-  static const int SVG_PRESERVEASPECTRATIO_UNKNOWN = 0;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMAXYMID = 7;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMIDYMID = 6;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMINYMAX = 8;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMINYMID = 5;
-
-  static const int SVG_PRESERVEASPECTRATIO_XMINYMIN = 2;
-
-  int get align native;
-
-  set align(int value) native;
-
-  int get meetOrSlice native;
-
-  set meetOrSlice(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGRadialGradientElement")
-class RadialGradientElement extends _GradientElement {
-  // To suppress missing implicit constructor warnings.
-  factory RadialGradientElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RadialGradientElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("radialGradient")
-          as RadialGradientElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  RadialGradientElement.created() : super.created();
-
-  AnimatedLength get cx native;
-
-  AnimatedLength get cy native;
-
-  AnimatedLength get fr native;
-
-  AnimatedLength get fx native;
-
-  AnimatedLength get fy native;
-
-  AnimatedLength get r native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGRect")
-class Rect extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Rect._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get height native;
-
-  set height(num value) native;
-
-  num get width native;
-
-  set width(num value) native;
-
-  num get x native;
-
-  set x(num value) native;
-
-  num get y native;
-
-  set y(num value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGRectElement")
-class RectElement extends GeometryElement {
-  // To suppress missing implicit constructor warnings.
-  factory RectElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory RectElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("rect") as RectElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  RectElement.created() : super.created();
-
-  AnimatedLength get height native;
-
-  AnimatedLength get rx native;
-
-  AnimatedLength get ry native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGScriptElement")
-class ScriptElement extends SvgElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory ScriptElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ScriptElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("script")
-          as ScriptElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ScriptElement.created() : super.created();
-
-  String get type native;
-
-  set type(String value) native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Unstable()
-@Native("SVGSetElement")
-class SetElement extends AnimationElement {
-  // To suppress missing implicit constructor warnings.
-  factory SetElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SetElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("set") as SetElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SetElement.created() : super.created();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      SvgElement.isTagSupported('set') &&
-      (new SvgElement.tag('set') is SetElement);
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGStopElement")
-class StopElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory StopElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory StopElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("stop") as StopElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  StopElement.created() : super.created();
-
-  @JSName('offset')
-  AnimatedNumber get gradientOffset native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGStringList")
-class StringList extends Interceptor
-    with ListMixin<String>, ImmutableListMixin<String>
-    implements List<String> {
-  // To suppress missing implicit constructor warnings.
-  factory StringList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  int get numberOfItems native;
-
-  String operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return this.getItem(index);
-  }
-
-  void operator []=(int index, String value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<String> mixins.
-  // String is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  String get first {
-    if (this.length > 0) {
-      return JS('String', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  String get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('String', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  String get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('String', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  String elementAt(int index) => this[index];
-  // -- end List<String> mixins.
-
-  void __setter__(int index, String newItem) native;
-
-  String appendItem(String newItem) native;
-
-  void clear() native;
-
-  String getItem(int index) native;
-
-  String initialize(String newItem) native;
-
-  String insertItemBefore(String item, int index) native;
-
-  String removeItem(int index) native;
-
-  String replaceItem(String newItem, int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SVGStyleElement")
-class StyleElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory StyleElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory StyleElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("style") as StyleElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  StyleElement.created() : super.created();
-
-  bool get disabled native;
-
-  set disabled(bool value) native;
-
-  String get media native;
-
-  set media(String value) native;
-
-  StyleSheet? get sheet native;
-
-  // Use implementation from Element.
-  // String get title native;
-  // void set title(String value) native;
-
-  String get type native;
-
-  set type(String value) native;
-}
-// Copyright (c) 2011, 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.
-
-class AttributeClassSet extends CssClassSetImpl {
-  final Element _element;
-
-  AttributeClassSet(this._element);
-
-  Set<String> readClasses() {
-    var classname = _element.attributes['class'];
-    if (classname is AnimatedString) {
-      classname = (classname as AnimatedString).baseVal;
-    }
-
-    Set<String> s = new LinkedHashSet<String>();
-    if (classname == null) {
-      return s;
-    }
-    for (String name in classname.split(' ')) {
-      String trimmed = name.trim();
-      if (!trimmed.isEmpty) {
-        s.add(trimmed);
-      }
-    }
-    return s;
-  }
-
-  void writeClasses(Set s) {
-    _element.setAttribute('class', s.join(' '));
-  }
-}
-
-@Unstable()
-@Native("SVGElement")
-class SvgElement extends Element implements GlobalEventHandlers, NoncedElement {
-  static final _START_TAG_REGEXP = new RegExp('<(\\w+)');
-
-  factory SvgElement.tag(String tag) =>
-      document.createElementNS("http://www.w3.org/2000/svg", tag) as SvgElement;
-  factory SvgElement.svg(String svg,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (validator == null && treeSanitizer == null) {
-      validator = new NodeValidatorBuilder.common()..allowSvg();
-    }
-
-    final match = _START_TAG_REGEXP.firstMatch(svg);
-    var parentElement;
-    if (match != null && match.group(1)!.toLowerCase() == 'svg') {
-      parentElement = document.body;
-    } else {
-      parentElement = new SvgSvgElement();
-    }
-    var fragment = parentElement.createFragment(svg,
-        validator: validator, treeSanitizer: treeSanitizer);
-    return fragment.nodes.where((e) => e is SvgElement).single;
-  }
-
-  CssClassSet get classes => new AttributeClassSet(this);
-
-  List<Element> get children => new FilteredElementList(this);
-
-  set children(List<Element> value) {
-    final children = this.children;
-    children.clear();
-    children.addAll(value);
-  }
-
-  String get outerHtml {
-    final container = new DivElement();
-    final SvgElement cloned = this.clone(true) as SvgElement;
-    container.children.add(cloned);
-    return container.innerHtml;
-  }
-
-  String get innerHtml {
-    final container = new DivElement();
-    final SvgElement cloned = this.clone(true) as SvgElement;
-    container.children.addAll(cloned.children);
-    return container.innerHtml;
-  }
-
-  set innerHtml(String? value) {
-    this.setInnerHtml(value);
-  }
-
-  DocumentFragment createFragment(String? svg,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    if (treeSanitizer == null) {
-      if (validator == null) {
-        validator = new NodeValidatorBuilder.common()..allowSvg();
-      }
-      treeSanitizer = new NodeTreeSanitizer(validator);
-    }
-
-    // We create a fragment which will parse in the HTML parser
-    var html = '<svg version="1.1">$svg</svg>';
-    var fragment =
-        document.body!.createFragment(html, treeSanitizer: treeSanitizer);
-
-    var svgFragment = new DocumentFragment();
-    // The root is the <svg/> element, need to pull out the contents.
-    var root = fragment.nodes.single;
-    while (root.firstChild != null) {
-      svgFragment.append(root.firstChild!);
-    }
-    return svgFragment;
-  }
-
-  // Unsupported methods inherited from Element.
-
-  void insertAdjacentText(String where, String text) {
-    throw new UnsupportedError("Cannot invoke insertAdjacentText on SVG.");
-  }
-
-  void insertAdjacentHtml(String where, String text,
-      {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
-    throw new UnsupportedError("Cannot invoke insertAdjacentHtml on SVG.");
-  }
-
-  Element insertAdjacentElement(String where, Element element) {
-    throw new UnsupportedError("Cannot invoke insertAdjacentElement on SVG.");
-  }
-
-  HtmlCollection get _children {
-    throw new UnsupportedError("Cannot get _children on SVG.");
-  }
-
-  bool get isContentEditable => false;
-  void click() {
-    throw new UnsupportedError("Cannot invoke click SVG.");
-  }
-
-  /**
-   * Checks to see if the SVG element type is supported by the current platform.
-   *
-   * The tag should be a valid SVG element tag name.
-   */
-  static bool isTagSupported(String tag) {
-    var e = new SvgElement.tag(tag);
-    return e is SvgElement && !(e is UnknownElement);
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory SvgElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> abortEvent =
-      const EventStreamProvider<Event>('abort');
-
-  static const EventStreamProvider<Event> blurEvent =
-      const EventStreamProvider<Event>('blur');
-
-  static const EventStreamProvider<Event> canPlayEvent =
-      const EventStreamProvider<Event>('canplay');
-
-  static const EventStreamProvider<Event> canPlayThroughEvent =
-      const EventStreamProvider<Event>('canplaythrough');
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  static const EventStreamProvider<MouseEvent> clickEvent =
-      const EventStreamProvider<MouseEvent>('click');
-
-  static const EventStreamProvider<MouseEvent> contextMenuEvent =
-      const EventStreamProvider<MouseEvent>('contextmenu');
-
-  @DomName('SVGElement.dblclickEvent')
-  static const EventStreamProvider<Event> doubleClickEvent =
-      const EventStreamProvider<Event>('dblclick');
-
-  static const EventStreamProvider<MouseEvent> dragEvent =
-      const EventStreamProvider<MouseEvent>('drag');
-
-  static const EventStreamProvider<MouseEvent> dragEndEvent =
-      const EventStreamProvider<MouseEvent>('dragend');
-
-  static const EventStreamProvider<MouseEvent> dragEnterEvent =
-      const EventStreamProvider<MouseEvent>('dragenter');
-
-  static const EventStreamProvider<MouseEvent> dragLeaveEvent =
-      const EventStreamProvider<MouseEvent>('dragleave');
-
-  static const EventStreamProvider<MouseEvent> dragOverEvent =
-      const EventStreamProvider<MouseEvent>('dragover');
-
-  static const EventStreamProvider<MouseEvent> dragStartEvent =
-      const EventStreamProvider<MouseEvent>('dragstart');
-
-  static const EventStreamProvider<MouseEvent> dropEvent =
-      const EventStreamProvider<MouseEvent>('drop');
-
-  static const EventStreamProvider<Event> durationChangeEvent =
-      const EventStreamProvider<Event>('durationchange');
-
-  static const EventStreamProvider<Event> emptiedEvent =
-      const EventStreamProvider<Event>('emptied');
-
-  static const EventStreamProvider<Event> endedEvent =
-      const EventStreamProvider<Event>('ended');
-
-  static const EventStreamProvider<Event> errorEvent =
-      const EventStreamProvider<Event>('error');
-
-  static const EventStreamProvider<Event> focusEvent =
-      const EventStreamProvider<Event>('focus');
-
-  static const EventStreamProvider<Event> inputEvent =
-      const EventStreamProvider<Event>('input');
-
-  static const EventStreamProvider<Event> invalidEvent =
-      const EventStreamProvider<Event>('invalid');
-
-  static const EventStreamProvider<KeyboardEvent> keyDownEvent =
-      const EventStreamProvider<KeyboardEvent>('keydown');
-
-  static const EventStreamProvider<KeyboardEvent> keyPressEvent =
-      const EventStreamProvider<KeyboardEvent>('keypress');
-
-  static const EventStreamProvider<KeyboardEvent> keyUpEvent =
-      const EventStreamProvider<KeyboardEvent>('keyup');
-
-  static const EventStreamProvider<Event> loadEvent =
-      const EventStreamProvider<Event>('load');
-
-  static const EventStreamProvider<Event> loadedDataEvent =
-      const EventStreamProvider<Event>('loadeddata');
-
-  static const EventStreamProvider<Event> loadedMetadataEvent =
-      const EventStreamProvider<Event>('loadedmetadata');
-
-  static const EventStreamProvider<MouseEvent> mouseDownEvent =
-      const EventStreamProvider<MouseEvent>('mousedown');
-
-  static const EventStreamProvider<MouseEvent> mouseEnterEvent =
-      const EventStreamProvider<MouseEvent>('mouseenter');
-
-  static const EventStreamProvider<MouseEvent> mouseLeaveEvent =
-      const EventStreamProvider<MouseEvent>('mouseleave');
-
-  static const EventStreamProvider<MouseEvent> mouseMoveEvent =
-      const EventStreamProvider<MouseEvent>('mousemove');
-
-  static const EventStreamProvider<MouseEvent> mouseOutEvent =
-      const EventStreamProvider<MouseEvent>('mouseout');
-
-  static const EventStreamProvider<MouseEvent> mouseOverEvent =
-      const EventStreamProvider<MouseEvent>('mouseover');
-
-  static const EventStreamProvider<MouseEvent> mouseUpEvent =
-      const EventStreamProvider<MouseEvent>('mouseup');
-
-  static const EventStreamProvider<WheelEvent> mouseWheelEvent =
-      const EventStreamProvider<WheelEvent>('mousewheel');
-
-  static const EventStreamProvider<Event> pauseEvent =
-      const EventStreamProvider<Event>('pause');
-
-  static const EventStreamProvider<Event> playEvent =
-      const EventStreamProvider<Event>('play');
-
-  static const EventStreamProvider<Event> playingEvent =
-      const EventStreamProvider<Event>('playing');
-
-  static const EventStreamProvider<Event> rateChangeEvent =
-      const EventStreamProvider<Event>('ratechange');
-
-  static const EventStreamProvider<Event> resetEvent =
-      const EventStreamProvider<Event>('reset');
-
-  static const EventStreamProvider<Event> resizeEvent =
-      const EventStreamProvider<Event>('resize');
-
-  static const EventStreamProvider<Event> scrollEvent =
-      const EventStreamProvider<Event>('scroll');
-
-  static const EventStreamProvider<Event> seekedEvent =
-      const EventStreamProvider<Event>('seeked');
-
-  static const EventStreamProvider<Event> seekingEvent =
-      const EventStreamProvider<Event>('seeking');
-
-  static const EventStreamProvider<Event> selectEvent =
-      const EventStreamProvider<Event>('select');
-
-  static const EventStreamProvider<Event> stalledEvent =
-      const EventStreamProvider<Event>('stalled');
-
-  static const EventStreamProvider<Event> submitEvent =
-      const EventStreamProvider<Event>('submit');
-
-  static const EventStreamProvider<Event> suspendEvent =
-      const EventStreamProvider<Event>('suspend');
-
-  static const EventStreamProvider<Event> timeUpdateEvent =
-      const EventStreamProvider<Event>('timeupdate');
-
-  static const EventStreamProvider<TouchEvent> touchCancelEvent =
-      const EventStreamProvider<TouchEvent>('touchcancel');
-
-  static const EventStreamProvider<TouchEvent> touchEndEvent =
-      const EventStreamProvider<TouchEvent>('touchend');
-
-  static const EventStreamProvider<TouchEvent> touchMoveEvent =
-      const EventStreamProvider<TouchEvent>('touchmove');
-
-  static const EventStreamProvider<TouchEvent> touchStartEvent =
-      const EventStreamProvider<TouchEvent>('touchstart');
-
-  static const EventStreamProvider<Event> volumeChangeEvent =
-      const EventStreamProvider<Event>('volumechange');
-
-  static const EventStreamProvider<Event> waitingEvent =
-      const EventStreamProvider<Event>('waiting');
-
-  static const EventStreamProvider<WheelEvent> wheelEvent =
-      const EventStreamProvider<WheelEvent>('wheel');
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SvgElement.created() : super.created();
-
-  // Shadowing definition.
-  @JSName('className')
-  AnimatedString get _svgClassName native;
-
-  @JSName('ownerSVGElement')
-  SvgSvgElement? get ownerSvgElement native;
-
-  // Use implementation from Element.
-  // CssStyleDeclaration get style native;
-  // void set style(CssStyleDeclaration value) native;
-
-  // Use implementation from Element.
-  // int get tabIndex native;
-  // void set tabIndex(int value) native;
-
-  SvgElement? get viewportElement native;
-
-  void blur() native;
-
-  void focus() native;
-
-  // From NoncedElement
-
-  String? get nonce native;
-
-  set nonce(String? value) native;
-
-  ElementStream<Event> get onAbort => abortEvent.forElement(this);
-
-  ElementStream<Event> get onBlur => blurEvent.forElement(this);
-
-  ElementStream<Event> get onCanPlay => canPlayEvent.forElement(this);
-
-  ElementStream<Event> get onCanPlayThrough =>
-      canPlayThroughEvent.forElement(this);
-
-  ElementStream<Event> get onChange => changeEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onClick => clickEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onContextMenu =>
-      contextMenuEvent.forElement(this);
-
-  @DomName('SVGElement.ondblclick')
-  ElementStream<Event> get onDoubleClick => doubleClickEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDrag => dragEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDragEnd => dragEndEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDragEnter => dragEnterEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDragLeave => dragLeaveEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDragOver => dragOverEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDragStart => dragStartEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onDrop => dropEvent.forElement(this);
-
-  ElementStream<Event> get onDurationChange =>
-      durationChangeEvent.forElement(this);
-
-  ElementStream<Event> get onEmptied => emptiedEvent.forElement(this);
-
-  ElementStream<Event> get onEnded => endedEvent.forElement(this);
-
-  ElementStream<Event> get onError => errorEvent.forElement(this);
-
-  ElementStream<Event> get onFocus => focusEvent.forElement(this);
-
-  ElementStream<Event> get onInput => inputEvent.forElement(this);
-
-  ElementStream<Event> get onInvalid => invalidEvent.forElement(this);
-
-  ElementStream<KeyboardEvent> get onKeyDown => keyDownEvent.forElement(this);
-
-  ElementStream<KeyboardEvent> get onKeyPress => keyPressEvent.forElement(this);
-
-  ElementStream<KeyboardEvent> get onKeyUp => keyUpEvent.forElement(this);
-
-  ElementStream<Event> get onLoad => loadEvent.forElement(this);
-
-  ElementStream<Event> get onLoadedData => loadedDataEvent.forElement(this);
-
-  ElementStream<Event> get onLoadedMetadata =>
-      loadedMetadataEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseDown => mouseDownEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseEnter =>
-      mouseEnterEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseLeave =>
-      mouseLeaveEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseMove => mouseMoveEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseOut => mouseOutEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseOver => mouseOverEvent.forElement(this);
-
-  ElementStream<MouseEvent> get onMouseUp => mouseUpEvent.forElement(this);
-
-  ElementStream<WheelEvent> get onMouseWheel =>
-      mouseWheelEvent.forElement(this);
-
-  ElementStream<Event> get onPause => pauseEvent.forElement(this);
-
-  ElementStream<Event> get onPlay => playEvent.forElement(this);
-
-  ElementStream<Event> get onPlaying => playingEvent.forElement(this);
-
-  ElementStream<Event> get onRateChange => rateChangeEvent.forElement(this);
-
-  ElementStream<Event> get onReset => resetEvent.forElement(this);
-
-  ElementStream<Event> get onResize => resizeEvent.forElement(this);
-
-  ElementStream<Event> get onScroll => scrollEvent.forElement(this);
-
-  ElementStream<Event> get onSeeked => seekedEvent.forElement(this);
-
-  ElementStream<Event> get onSeeking => seekingEvent.forElement(this);
-
-  ElementStream<Event> get onSelect => selectEvent.forElement(this);
-
-  ElementStream<Event> get onStalled => stalledEvent.forElement(this);
-
-  ElementStream<Event> get onSubmit => submitEvent.forElement(this);
-
-  ElementStream<Event> get onSuspend => suspendEvent.forElement(this);
-
-  ElementStream<Event> get onTimeUpdate => timeUpdateEvent.forElement(this);
-
-  ElementStream<TouchEvent> get onTouchCancel =>
-      touchCancelEvent.forElement(this);
-
-  ElementStream<TouchEvent> get onTouchEnd => touchEndEvent.forElement(this);
-
-  ElementStream<TouchEvent> get onTouchMove => touchMoveEvent.forElement(this);
-
-  ElementStream<TouchEvent> get onTouchStart =>
-      touchStartEvent.forElement(this);
-
-  ElementStream<Event> get onVolumeChange => volumeChangeEvent.forElement(this);
-
-  ElementStream<Event> get onWaiting => waitingEvent.forElement(this);
-
-  ElementStream<WheelEvent> get onWheel => wheelEvent.forElement(this);
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGSVGElement")
-class SvgSvgElement extends GraphicsElement
-    implements FitToViewBox, ZoomAndPan {
-  factory SvgSvgElement() {
-    final el = new SvgElement.tag("svg");
-    // The SVG spec requires the version attribute to match the spec version
-    el.attributes['version'] = "1.1";
-    return el as SvgSvgElement;
-  }
-
-  // To suppress missing implicit constructor warnings.
-  factory SvgSvgElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SvgSvgElement.created() : super.created();
-
-  num get currentScale native;
-
-  set currentScale(num value) native;
-
-  Point get currentTranslate native;
-
-  AnimatedLength get height native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  bool animationsPaused() native;
-
-  bool checkEnclosure(SvgElement element, Rect rect) native;
-
-  bool checkIntersection(SvgElement element, Rect rect) native;
-
-  @JSName('createSVGAngle')
-  Angle createSvgAngle() native;
-
-  @JSName('createSVGLength')
-  Length createSvgLength() native;
-
-  @JSName('createSVGMatrix')
-  Matrix createSvgMatrix() native;
-
-  @JSName('createSVGNumber')
-  Number createSvgNumber() native;
-
-  @JSName('createSVGPoint')
-  Point createSvgPoint() native;
-
-  @JSName('createSVGRect')
-  Rect createSvgRect() native;
-
-  @JSName('createSVGTransform')
-  Transform createSvgTransform() native;
-
-  @JSName('createSVGTransformFromMatrix')
-  Transform createSvgTransformFromMatrix(Matrix matrix) native;
-
-  void deselectAll() native;
-
-  void forceRedraw() native;
-
-  double getCurrentTime() native;
-
-  Element getElementById(String elementId) native;
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getEnclosureList(Rect rect, SvgElement? referenceElement) native;
-
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> getIntersectionList(Rect rect, SvgElement? referenceElement)
-      native;
-
-  void pauseAnimations() native;
-
-  void setCurrentTime(num seconds) native;
-
-  int suspendRedraw(int maxWaitMilliseconds) native;
-
-  void unpauseAnimations() native;
-
-  void unsuspendRedraw(int suspendHandleId) native;
-
-  void unsuspendRedrawAll() native;
-
-  // From SVGFitToViewBox
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedRect get viewBox native;
-
-  // From SVGZoomAndPan
-
-  int get zoomAndPan native;
-
-  set zoomAndPan(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGSwitchElement")
-class SwitchElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory SwitchElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SwitchElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("switch")
-          as SwitchElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SwitchElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGSymbolElement")
-class SymbolElement extends SvgElement implements FitToViewBox {
-  // To suppress missing implicit constructor warnings.
-  factory SymbolElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory SymbolElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("symbol")
-          as SymbolElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  SymbolElement.created() : super.created();
-
-  // From SVGFitToViewBox
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedRect get viewBox native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTSpanElement")
-class TSpanElement extends TextPositioningElement {
-  // To suppress missing implicit constructor warnings.
-  factory TSpanElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TSpanElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("tspan") as TSpanElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TSpanElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-abstract class Tests extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Tests._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  StringList get requiredExtensions native;
-
-  StringList get systemLanguage native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTextContentElement")
-class TextContentElement extends GraphicsElement {
-  // To suppress missing implicit constructor warnings.
-  factory TextContentElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TextContentElement.created() : super.created();
-
-  static const int LENGTHADJUST_SPACING = 1;
-
-  static const int LENGTHADJUST_SPACINGANDGLYPHS = 2;
-
-  static const int LENGTHADJUST_UNKNOWN = 0;
-
-  AnimatedEnumeration get lengthAdjust native;
-
-  AnimatedLength get textLength native;
-
-  int getCharNumAtPosition(Point point) native;
-
-  double getComputedTextLength() native;
-
-  Point getEndPositionOfChar(int charnum) native;
-
-  Rect getExtentOfChar(int charnum) native;
-
-  int getNumberOfChars() native;
-
-  double getRotationOfChar(int charnum) native;
-
-  Point getStartPositionOfChar(int charnum) native;
-
-  double getSubStringLength(int charnum, int nchars) native;
-
-  void selectSubString(int charnum, int nchars) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTextElement")
-class TextElement extends TextPositioningElement {
-  // To suppress missing implicit constructor warnings.
-  factory TextElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TextElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("text") as TextElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TextElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTextPathElement")
-class TextPathElement extends TextContentElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory TextPathElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TextPathElement.created() : super.created();
-
-  static const int TEXTPATH_METHODTYPE_ALIGN = 1;
-
-  static const int TEXTPATH_METHODTYPE_STRETCH = 2;
-
-  static const int TEXTPATH_METHODTYPE_UNKNOWN = 0;
-
-  static const int TEXTPATH_SPACINGTYPE_AUTO = 1;
-
-  static const int TEXTPATH_SPACINGTYPE_EXACT = 2;
-
-  static const int TEXTPATH_SPACINGTYPE_UNKNOWN = 0;
-
-  AnimatedEnumeration get method native;
-
-  AnimatedEnumeration get spacing native;
-
-  AnimatedLength get startOffset native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTextPositioningElement")
-class TextPositioningElement extends TextContentElement {
-  // To suppress missing implicit constructor warnings.
-  factory TextPositioningElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TextPositioningElement.created() : super.created();
-
-  AnimatedLengthList get dx native;
-
-  AnimatedLengthList get dy native;
-
-  AnimatedNumberList get rotate native;
-
-  AnimatedLengthList get x native;
-
-  AnimatedLengthList get y native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTitleElement")
-class TitleElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory TitleElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory TitleElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("title") as TitleElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  TitleElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTransform")
-class Transform extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Transform._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int SVG_TRANSFORM_MATRIX = 1;
-
-  static const int SVG_TRANSFORM_ROTATE = 4;
-
-  static const int SVG_TRANSFORM_SCALE = 3;
-
-  static const int SVG_TRANSFORM_SKEWX = 5;
-
-  static const int SVG_TRANSFORM_SKEWY = 6;
-
-  static const int SVG_TRANSFORM_TRANSLATE = 2;
-
-  static const int SVG_TRANSFORM_UNKNOWN = 0;
-
-  num get angle native;
-
-  Matrix get matrix native;
-
-  int get type native;
-
-  void setMatrix(Matrix matrix) native;
-
-  void setRotate(num angle, num cx, num cy) native;
-
-  void setScale(num sx, num sy) native;
-
-  void setSkewX(num angle) native;
-
-  void setSkewY(num angle) native;
-
-  void setTranslate(num tx, num ty) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGTransformList")
-class TransformList extends Interceptor
-    with ListMixin<Transform>, ImmutableListMixin<Transform>
-    implements List<Transform> {
-  // To suppress missing implicit constructor warnings.
-  factory TransformList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  int get numberOfItems native;
-
-  Transform operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return this.getItem(index);
-  }
-
-  void operator []=(int index, Transform value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Transform> mixins.
-  // Transform is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Transform get first {
-    if (this.length > 0) {
-      return JS('Transform', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Transform get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Transform', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Transform get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Transform', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Transform elementAt(int index) => this[index];
-  // -- end List<Transform> mixins.
-
-  void __setter__(int index, Transform newItem) native;
-
-  Transform appendItem(Transform newItem) native;
-
-  void clear() native;
-
-  Transform? consolidate() native;
-
-  @JSName('createSVGTransformFromMatrix')
-  Transform createSvgTransformFromMatrix(Matrix matrix) native;
-
-  Transform getItem(int index) native;
-
-  Transform initialize(Transform newItem) native;
-
-  Transform insertItemBefore(Transform newItem, int index) native;
-
-  Transform removeItem(int index) native;
-
-  Transform replaceItem(Transform newItem, int index) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGUnitTypes")
-class UnitTypes extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory UnitTypes._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
-
-  static const int SVG_UNIT_TYPE_UNKNOWN = 0;
-
-  static const int SVG_UNIT_TYPE_USERSPACEONUSE = 1;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-abstract class UriReference extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory UriReference._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGUseElement")
-class UseElement extends GraphicsElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory UseElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory UseElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("use") as UseElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  UseElement.created() : super.created();
-
-  AnimatedLength get height native;
-
-  AnimatedLength get width native;
-
-  AnimatedLength get x native;
-
-  AnimatedLength get y native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGViewElement")
-class ViewElement extends SvgElement implements FitToViewBox, ZoomAndPan {
-  // To suppress missing implicit constructor warnings.
-  factory ViewElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ViewElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("view") as ViewElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  ViewElement.created() : super.created();
-
-  // From SVGFitToViewBox
-
-  AnimatedPreserveAspectRatio get preserveAspectRatio native;
-
-  AnimatedRect get viewBox native;
-
-  // From SVGZoomAndPan
-
-  int get zoomAndPan native;
-
-  set zoomAndPan(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-abstract class ZoomAndPan extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ZoomAndPan._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int SVG_ZOOMANDPAN_DISABLE = 1;
-
-  static const int SVG_ZOOMANDPAN_MAGNIFY = 2;
-
-  static const int SVG_ZOOMANDPAN_UNKNOWN = 0;
-
-  int get zoomAndPan native;
-
-  set zoomAndPan(int value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGGradientElement")
-class _GradientElement extends SvgElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory _GradientElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _GradientElement.created() : super.created();
-
-  static const int SVG_SPREADMETHOD_PAD = 1;
-
-  static const int SVG_SPREADMETHOD_REFLECT = 2;
-
-  static const int SVG_SPREADMETHOD_REPEAT = 3;
-
-  static const int SVG_SPREADMETHOD_UNKNOWN = 0;
-
-  AnimatedTransformList get gradientTransform native;
-
-  AnimatedEnumeration get gradientUnits native;
-
-  AnimatedEnumeration get spreadMethod native;
-
-  // From SVGURIReference
-
-  AnimatedString get href native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("SVGComponentTransferFunctionElement")
-abstract class _SVGComponentTransferFunctionElement extends SvgElement {
-  // To suppress missing implicit constructor warnings.
-  factory _SVGComponentTransferFunctionElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _SVGComponentTransferFunctionElement.created() : super.created();
-}
-// Copyright (c) 2012, 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.
-
-@Native("SVGFEDropShadowElement")
-abstract class _SVGFEDropShadowElement extends SvgElement
-    implements FilterPrimitiveStandardAttributes {
-  // To suppress missing implicit constructor warnings.
-  factory _SVGFEDropShadowElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _SVGFEDropShadowElement.created() : super.created();
-
-  // From SVGFilterPrimitiveStandardAttributes
-
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("SVGMPathElement")
-abstract class _SVGMPathElement extends SvgElement implements UriReference {
-  // To suppress missing implicit constructor warnings.
-  factory _SVGMPathElement._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory _SVGMPathElement() =>
-      _SvgElementFactoryProvider.createSvgElement_tag("mpath")
-          as _SVGMPathElement;
-  /**
-   * Constructor instantiated by the DOM when a custom element has been created.
-   *
-   * This can only be called by subclasses from their created constructor.
-   */
-  _SVGMPathElement.created() : super.created();
-
-  // From SVGURIReference
-
-}
diff --git a/sdk_nnbd/lib/typed_data/typed_data.dart b/sdk_nnbd/lib/typed_data/typed_data.dart
deleted file mode 100644
index 8852ab8..0000000
--- a/sdk_nnbd/lib/typed_data/typed_data.dart
+++ /dev/null
@@ -1,3455 +0,0 @@
-// Copyright (c) 2013, 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.
-
-/// Lists that efficiently handle fixed sized data
-/// (for example, unsigned 8 byte integers) and SIMD numeric types.
-///
-/// To use this library in your code:
-///
-///     import 'dart:typed_data';
-///
-/// {@category Core}
-library dart.typed_data;
-
-import "dart:_internal" show Since, UnmodifiableListBase;
-
-part "unmodifiable_typed_data.dart";
-
-/**
- * A sequence of bytes underlying a typed data object.
- *
- * Used to process large quantities of binary or numerical data
- * more efficiently using a typed view.
- */
-abstract class ByteBuffer {
-  /**
-   * Returns the length of this byte buffer, in bytes.
-   */
-  int get lengthInBytes;
-
-  /**
-   * Creates a [Uint8List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Uint8List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes] and contains [length] bytes.
-   * If [length] is omitted, the range extends to the end of the buffer.
-   *
-   * The start index and length must describe a valid range of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length` must not be greater than [lengthInBytes].
-   */
-  Uint8List asUint8List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Int8List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Int8List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes] and contains [length] bytes.
-   * If [length] is omitted, the range extends to the end of the buffer.
-   *
-   * The start index and length must describe a valid range of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length` must not be greater than [lengthInBytes].
-   */
-  Int8List asInt8List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Uint8ClampedList] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Uint8ClampedList` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes] and contains [length] bytes.
-   * If [length] is omitted, the range extends to the end of the buffer.
-   *
-   * The start index and length must describe a valid range of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length` must not be greater than [lengthInBytes].
-   */
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Uint16List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Uint16List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 16-bit aligned,
-   * and contains [length] 16-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not even, the last byte can't be part of the view.
-   *
-   * The start index and length must describe a valid 16-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by two,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 2` must not be greater than [lengthInBytes].
-   */
-  Uint16List asUint16List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Int16List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Int16List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 16-bit aligned,
-   * and contains [length] 16-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not even, the last byte can't be part of the view.
-   *
-   * The start index and length must describe a valid 16-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by two,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 2` must not be greater than [lengthInBytes].
-   */
-  Int16List asInt16List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Uint32List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Uint32List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 32-bit aligned,
-   * and contains [length] 32-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by four, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 32-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by four,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
-   */
-  Uint32List asUint32List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Int32List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Int32List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 32-bit aligned,
-   * and contains [length] 32-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by four, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 32-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by four,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
-   */
-  Int32List asInt32List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Uint64List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Uint64List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 64-bit aligned,
-   * and contains [length] 64-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by eight, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 64-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by eight,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
-   */
-  Uint64List asUint64List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Int64List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Int64List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 64-bit aligned,
-   * and contains [length] 64-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by eight, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 64-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by eight,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
-   */
-  Int64List asInt64List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Int32x4List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Int32x4List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 128-bit aligned,
-   * and contains [length] 128-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by 16, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 128-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by sixteen,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
-   */
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Float32List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Float32List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 32-bit aligned,
-   * and contains [length] 32-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by four, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 32-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by four,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 4` must not be greater than [lengthInBytes].
-   */
-  Float32List asFloat32List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Float64List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Float64List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 64-bit aligned,
-   * and contains [length] 64-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by eight, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 64-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by eight,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 8` must not be greater than [lengthInBytes].
-   */
-  Float64List asFloat64List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Float32x4List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Float32x4List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 128-bit aligned,
-   * and contains [length] 128-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by 16, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 128-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by sixteen,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
-   */
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [Float64x2List] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `Float64x2List` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes], which must be 128-bit aligned,
-   * and contains [length] 128-bit integers.
-   * If [length] is omitted, the range extends as far towards the end of
-   * the buffer as possible -
-   * if [lengthInBytes] is not divisible by 16, the last bytes can't be part
-   * of the view.
-   *
-   * The start index and length must describe a valid 128-bit aligned range
-   * of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `offsetInBytes` must be divisible by sixteen,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length * 16` must not be greater than [lengthInBytes].
-   */
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]);
-
-  /**
-   * Creates a [ByteData] _view_ of a region of this byte buffer.
-   *
-   * The view is backed by the bytes of this byte buffer.
-   * Any changes made to the `ByteData` will also change the buffer,
-   * and vice versa.
-   *
-   * The viewed region start at [offsetInBytes] and contains [length] bytes.
-   * If [length] is omitted, the range extends to the end of the buffer.
-   *
-   * The start index and length must describe a valid range of the buffer:
-   *
-   * * `offsetInBytes` must not be negative,
-   * * `length` must not be negative, and
-   * * `offsetInBytes + length` must not be greater than [lengthInBytes].
-   */
-  ByteData asByteData([int offsetInBytes = 0, int? length]);
-}
-
-/**
- * A typed view of a sequence of bytes.
- */
-abstract class TypedData {
-  /**
-   * Returns the number of bytes in the representation of each element in this
-   * list.
-   */
-  int get elementSizeInBytes;
-
-  /**
-   * Returns the offset in bytes into the underlying byte buffer of this view.
-   */
-  int get offsetInBytes;
-
-  /**
-   * Returns the length of this view, in bytes.
-   */
-  int get lengthInBytes;
-
-  /**
-   * Returns the byte buffer associated with this object.
-   */
-  ByteBuffer get buffer;
-}
-
-abstract class _TypedIntList extends TypedData {
-  /**
-   * Returns the concatenation of this list and [other].
-   *
-   * If other is also a typed-data integer list, the returned list will
-   * be a type-data integer list capable of containing all the elements of
-   * this list and of [other].
-   * Otherwise the returned list will be a normal growable `List<int>`.
-   */
-  List<int> operator +(List<int> other);
-}
-
-abstract class _TypedFloatList extends TypedData {
-  /**
-   * Returns the concatenation of this list and [other].
-   *
-   * If other is also a typed-data floating point number list,
-   * the returned list will be a type-data float list capable of containing
-   * all the elements of this list and of [other].
-   * Otherwise the returned list will be a normal growable `List<double>`.
-   */
-  List<double> operator +(List<double> other);
-}
-
-/**
- * Describes endianness to be used when accessing or updating a
- * sequence of bytes.
- */
-class Endian {
-  final bool _littleEndian;
-  const Endian._(this._littleEndian);
-
-  static const Endian big = const Endian._(false);
-  static const Endian little = const Endian._(true);
-  static final Endian host =
-      (new ByteData.view(new Uint16List.fromList([1]).buffer)).getInt8(0) == 1
-          ? little
-          : big;
-}
-
-/**
- * A fixed-length, random-access sequence of bytes that also provides random
- * and unaligned access to the fixed-width integers and floating point
- * numbers represented by those bytes.
- *
- * `ByteData` may be used to pack and unpack data from external sources
- * (such as networks or files systems), and to process large quantities
- * of numerical data more efficiently than would be possible
- * with ordinary [List] implementations.
- * `ByteData` can save space, by eliminating the need for object headers,
- * and time, by eliminating the need for data copies.
- *
- * If data comes in as bytes, they can be converted to `ByteData` by
- * sharing the same buffer.
- * ```dart
- * Uint8List bytes = ...;
- * var blob = ByteData.sublistView(bytes);
- * if (blob.getUint32(0, Endian.little) == 0x04034b50) { // Zip file marker
- *   ...
- * }
- *
- * ```
- *
- * Finally, `ByteData` may be used to intentionally reinterpret the bytes
- * representing one arithmetic type as another.
- * For example this code fragment determine what 32-bit signed integer
- * is represented by the bytes of a 32-bit floating point number
- * (both stored as big endian):
- * ```dart
- * var bdata = new ByteData(8);
- * bdata.setFloat32(0, 3.04);
- * int huh = bdata.getInt32(0); // 0x40428f5c
- * ```
- */
-abstract class ByteData implements TypedData {
-  /**
-   * Creates a [ByteData] of the specified length (in elements), all of
-   * whose bytes are initially zero.
-   */
-  @pragma("vm:entry-point")
-  external factory ByteData(int length);
-
-  /**
-   * Creates an [ByteData] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [ByteData] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `ByteData.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * ByteData.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [ByteData.sublistView]
-   * which includes this computation:
-   * ```dart
-   * ByteData.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory ByteData.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asByteData(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [ByteData] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   */
-  @Since("2.8")
-  factory ByteData.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null)
-      throw "unreachable"; // TODO(38725): Remove when promotion works.
-    return data.buffer.asByteData(
-        data.offsetInBytes + start * elementSize, (end - start) * elementSize);
-  }
-
-  /**
-   * Returns the (possibly negative) integer represented by the byte at the
-   * specified [byteOffset] in this object, in two's complement binary
-   * representation.
-   *
-   * The return value will be between -128 and 127, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * greater than or equal to the length of this object.
-   */
-  int getInt8(int byteOffset);
-
-  /**
-   * Sets the byte at the specified [byteOffset] in this object to the
-   * two's complement binary representation of the specified [value], which
-   * must fit in a single byte.
-   *
-   * In other words, [value] must be between -128 and 127, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * greater than or equal to the length of this object.
-   */
-  void setInt8(int byteOffset, int value);
-
-  /**
-   * Returns the positive integer represented by the byte at the specified
-   * [byteOffset] in this object, in unsigned binary form.
-   *
-   * The return value will be between 0 and 255, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * greater than or equal to the length of this object.
-   */
-  int getUint8(int byteOffset);
-
-  /**
-   * Sets the byte at the specified [byteOffset] in this object to the
-   * unsigned binary representation of the specified [value], which must fit
-   * in a single byte.
-   *
-   * In other words, [value] must be between 0 and 255, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative,
-   * or greater than or equal to the length of this object.
-   */
-  void setUint8(int byteOffset, int value);
-
-  /**
-   * Returns the (possibly negative) integer represented by the two bytes at
-   * the specified [byteOffset] in this object, in two's complement binary
-   * form.
-   *
-   * The return value will be between -2<sup>15</sup> and 2<sup>15</sup> - 1,
-   * inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 2` is greater than the length of this object.
-   */
-  int getInt16(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the two bytes starting at the specified [byteOffset] in this
-   * object to the two's complement binary representation of the specified
-   * [value], which must fit in two bytes.
-   *
-   * In other words, [value] must lie
-   * between -2<sup>15</sup> and 2<sup>15</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 2` is greater than the length of this object.
-   */
-  void setInt16(int byteOffset, int value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the positive integer represented by the two bytes starting
-   * at the specified [byteOffset] in this object, in unsigned binary
-   * form.
-   *
-   * The return value will be between 0 and  2<sup>16</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 2` is greater than the length of this object.
-   */
-  int getUint16(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the two bytes starting at the specified [byteOffset] in this object
-   * to the unsigned binary representation of the specified [value],
-   * which must fit in two bytes.
-   *
-   * In other words, [value] must be between
-   * 0 and 2<sup>16</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 2` is greater than the length of this object.
-   */
-  void setUint16(int byteOffset, int value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the (possibly negative) integer represented by the four bytes at
-   * the specified [byteOffset] in this object, in two's complement binary
-   * form.
-   *
-   * The return value will be between -2<sup>31</sup> and 2<sup>31</sup> - 1,
-   * inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 4` is greater than the length of this object.
-   */
-  int getInt32(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the four bytes starting at the specified [byteOffset] in this
-   * object to the two's complement binary representation of the specified
-   * [value], which must fit in four bytes.
-   *
-   * In other words, [value] must lie
-   * between -2<sup>31</sup> and 2<sup>31</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 4` is greater than the length of this object.
-   */
-  void setInt32(int byteOffset, int value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the positive integer represented by the four bytes starting
-   * at the specified [byteOffset] in this object, in unsigned binary
-   * form.
-   *
-   * The return value will be between 0 and  2<sup>32</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 4` is greater than the length of this object.
-   */
-  int getUint32(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the four bytes starting at the specified [byteOffset] in this object
-   * to the unsigned binary representation of the specified [value],
-   * which must fit in four bytes.
-   *
-   * In other words, [value] must be between
-   * 0 and 2<sup>32</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 4` is greater than the length of this object.
-   */
-  void setUint32(int byteOffset, int value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the (possibly negative) integer represented by the eight bytes at
-   * the specified [byteOffset] in this object, in two's complement binary
-   * form.
-   *
-   * The return value will be between -2<sup>63</sup> and 2<sup>63</sup> - 1,
-   * inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 8` is greater than the length of this object.
-   */
-  int getInt64(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the eight bytes starting at the specified [byteOffset] in this
-   * object to the two's complement binary representation of the specified
-   * [value], which must fit in eight bytes.
-   *
-   * In other words, [value] must lie
-   * between -2<sup>63</sup> and 2<sup>63</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 8` is greater than the length of this object.
-   */
-  void setInt64(int byteOffset, int value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the positive integer represented by the eight bytes starting
-   * at the specified [byteOffset] in this object, in unsigned binary
-   * form.
-   *
-   * The return value will be between 0 and  2<sup>64</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 8` is greater than the length of this object.
-   */
-  int getUint64(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the eight bytes starting at the specified [byteOffset] in this object
-   * to the unsigned binary representation of the specified [value],
-   * which must fit in eight bytes.
-   *
-   * In other words, [value] must be between
-   * 0 and 2<sup>64</sup> - 1, inclusive.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 8` is greater than the length of this object.
-   */
-  void setUint64(int byteOffset, int value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the floating point number represented by the four bytes at
-   * the specified [byteOffset] in this object, in IEEE 754
-   * single-precision binary floating-point format (binary32).
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 4` is greater than the length of this object.
-   */
-  double getFloat32(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the four bytes starting at the specified [byteOffset] in this
-   * object to the IEEE 754 single-precision binary floating-point
-   * (binary32) representation of the specified [value].
-   *
-   * **Note that this method can lose precision.** The input [value] is
-   * a 64-bit floating point value, which will be converted to 32-bit
-   * floating point value by IEEE 754 rounding rules before it is stored.
-   * If [value] cannot be represented exactly as a binary32, it will be
-   * converted to the nearest binary32 value.  If two binary32 values are
-   * equally close, the one whose least significant bit is zero will be used.
-   * Note that finite (but large) values can be converted to infinity, and
-   * small non-zero values can be converted to zero.
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 4` is greater than the length of this object.
-   */
-  void setFloat32(int byteOffset, double value, [Endian endian = Endian.big]);
-
-  /**
-   * Returns the floating point number represented by the eight bytes at
-   * the specified [byteOffset] in this object, in IEEE 754
-   * double-precision binary floating-point format (binary64).
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 8` is greater than the length of this object.
-   */
-  double getFloat64(int byteOffset, [Endian endian = Endian.big]);
-
-  /**
-   * Sets the eight bytes starting at the specified [byteOffset] in this
-   * object to the IEEE 754 double-precision binary floating-point
-   * (binary64) representation of the specified [value].
-   *
-   * Throws [RangeError] if [byteOffset] is negative, or
-   * `byteOffset + 8` is greater than the length of this object.
-   */
-  void setFloat64(int byteOffset, double value, [Endian endian = Endian.big]);
-}
-
-/**
- * A fixed-length list of 8-bit signed integers.
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low eight bits,
- * interpreted as a signed 8-bit two's complement integer with values in the
- * range -128 to +127.
- */
-abstract class Int8List implements List<int>, _TypedIntList {
-  /**
-   * Creates an [Int8List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely [length] bytes.
-   */
-  external factory Int8List(int length);
-
-  /**
-   * Creates a [Int8List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely `elements.length`
-   * bytes.
-   */
-  external factory Int8List.fromList(List<int> elements);
-
-  /**
-   * Creates an [Int8List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Int8List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Int8List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Int8List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Int8List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Int8List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Int8List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asInt8List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Int8List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   */
-  @Since("2.8")
-  factory Int8List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    return data.buffer.asInt8List(
-        data.offsetInBytes + start * elementSize, (end - start) * elementSize);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is an `Int8List` containing the elements of this list at
-   * positions greater than or equal to [start] and less than [end] in the same
-   * order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Int8List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Int8List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Int8List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 1;
-}
-
-/**
- * A fixed-length list of 8-bit unsigned integers.
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low eight bits,
- * interpreted as an unsigned 8-bit integer with values in the
- * range 0 to 255.
- */
-abstract class Uint8List implements List<int>, _TypedIntList {
-  /**
-   * Creates a [Uint8List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely [length] bytes.
-   */
-  external factory Uint8List(int length);
-
-  /**
-   * Creates a [Uint8List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely `elements.length`
-   * bytes.
-   */
-  external factory Uint8List.fromList(List<int> elements);
-
-  /**
-   * Creates a [Uint8List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Uint8List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Uint8List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Uint8List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Uint8List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Uint8List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Uint8List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asUint8List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Uint8List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   */
-  @Since("2.8")
-  factory Uint8List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    return data.buffer.asUint8List(
-        data.offsetInBytes + start * elementSize, (end - start) * elementSize);
-  }
-
-  /**
-   * Returns a concatenation of this list and [other].
-   *
-   * If [other] is also a typed-data list, then the return list will be a
-   * typed data list capable of holding both unsigned 8-bit integers and
-   * the elements of [other], otherwise it'll be a normal list of integers.
-   */
-  List<int> operator +(List<int> other);
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Uint8List` containing the elements of this list at
-   * positions greater than or equal to [start] and less than [end] in the same
-   * order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Uint8List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Uint8List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Uint8List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 1;
-}
-
-/**
- * A fixed-length list of 8-bit unsigned integers.
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are clamped to an unsigned eight bit value.
- * That is, all values below zero are stored as zero
- * and all values above 255 are stored as 255.
- */
-abstract class Uint8ClampedList implements List<int>, _TypedIntList {
-  /**
-   * Creates a [Uint8ClampedList] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely [length] bytes.
-   */
-  external factory Uint8ClampedList(int length);
-
-  /**
-   * Creates a [Uint8ClampedList] of the same size as the [elements]
-   * list and copies over the values clamping when needed.
-   *
-   * Values are clamped to fit in the list when they are copied,
-   * the same way storing values clamps them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely `elements.length`
-   * bytes.
-   */
-  external factory Uint8ClampedList.fromList(List<int> elements);
-
-  /**
-   * Creates a [Uint8ClampedList] _view_ of the specified region in the
-   * specified byte [buffer].
-   *
-   * Changes in the [Uint8List] will be visible in the byte buffer
-   * and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Uint8ClampedList.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Uint8ClampedList.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Uint8ClampedList.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Uint8ClampedList.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Uint8ClampedList.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asUint8ClampedList(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Uint8ClampedList] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   */
-  @Since("2.8")
-  factory Uint8ClampedList.sublistView(TypedData data,
-      [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    return data.buffer.asUint8ClampedList(
-        data.offsetInBytes + start * elementSize, (end - start) * elementSize);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Uint8ClampedList` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Uint8ClampedList.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Uint8ClampedList
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Uint8ClampedList sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 1;
-}
-
-/**
- * A fixed-length list of 16-bit signed integers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low 16 bits,
- * interpreted as a signed 16-bit two's complement integer with values in the
- * range -32768 to +32767.
- */
-abstract class Int16List implements List<int>, _TypedIntList {
-  /**
-   * Creates an [Int16List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 2 bytes.
-   */
-  external factory Int16List(int length);
-
-  /**
-   * Creates a [Int16List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 2 bytes.
-   */
-  external factory Int16List.fromList(List<int> elements);
-
-  /**
-   * Creates an [Int16List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Int16List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Int16List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Int16List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Int16List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Int16List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Int16List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asInt16List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Int16List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of two.
-   */
-  @Since("2.8")
-  factory Int16List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asInt16List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is an `Int16List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Int16List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Int16List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Int16List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 2;
-}
-
-/**
- * A fixed-length list of 16-bit unsigned integers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low 16 bits,
- * interpreted as an unsigned 16-bit integer with values in the
- * range 0 to 65535.
- */
-abstract class Uint16List implements List<int>, _TypedIntList {
-  /**
-   * Creates a [Uint16List] of the specified length (in elements), all
-   * of whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 2 bytes.
-   */
-  external factory Uint16List(int length);
-
-  /**
-   * Creates a [Uint16List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 2 bytes.
-   */
-  external factory Uint16List.fromList(List<int> elements);
-
-  /**
-   * Creates a [Uint16List] _view_ of the specified region in
-   * the specified byte buffer.
-   *
-   * Changes in the [Uint16List] will be visible in the byte buffer
-   * and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Uint16List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Uint16List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Uint16List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Uint16List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Uint16List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asUint16List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Uint16List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of two.
-   */
-  @Since("2.8")
-  factory Uint16List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asUint16List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Uint16List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Uint16List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Uint16List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Uint16List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 2;
-}
-
-/**
- * A fixed-length list of 32-bit signed integers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low 32 bits,
- * interpreted as a signed 32-bit two's complement integer with values in the
- * range -2147483648 to 2147483647.
- */
-abstract class Int32List implements List<int>, _TypedIntList {
-  /**
-   * Creates an [Int32List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 4 bytes.
-   */
-  external factory Int32List(int length);
-
-  /**
-   * Creates a [Int32List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 4 bytes.
-   */
-  external factory Int32List.fromList(List<int> elements);
-
-  /**
-   * Creates an [Int32List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Int32List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Int32List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Int32List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Int32List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Int32List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Int32List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asInt32List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Int32List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of four.
-   */
-  @Since("2.8")
-  factory Int32List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asInt32List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is an `Int32List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Int32List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Int32List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Int32List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 4;
-}
-
-/**
- * A fixed-length list of 32-bit unsigned integers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low 32 bits,
- * interpreted as an unsigned 32-bit integer with values in the
- * range 0 to 4294967295.
- */
-abstract class Uint32List implements List<int>, _TypedIntList {
-  /**
-   * Creates a [Uint32List] of the specified length (in elements), all
-   * of whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 4 bytes.
-   */
-  external factory Uint32List(int length);
-
-  /**
-   * Creates a [Uint32List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 4 bytes.
-   */
-  external factory Uint32List.fromList(List<int> elements);
-
-  /**
-   * Creates a [Uint32List] _view_ of the specified region in
-   * the specified byte buffer.
-   *
-   * Changes in the [Uint32List] will be visible in the byte buffer
-   * and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Uint32List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Uint32List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Uint32List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Uint32List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Uint32List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asUint32List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Uint32List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of four.
-   */
-  @Since("2.8")
-  factory Uint32List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asUint32List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Uint32List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Uint32List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Uint32List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Uint32List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 4;
-}
-
-/**
- * A fixed-length list of 64-bit signed integers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low 64 bits,
- * interpreted as a signed 64-bit two's complement integer with values in the
- * range -9223372036854775808 to +9223372036854775807.
- */
-abstract class Int64List implements List<int>, _TypedIntList {
-  /**
-   * Creates an [Int64List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 8 bytes.
-   */
-  external factory Int64List(int length);
-
-  /**
-   * Creates a [Int64List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 8 bytes.
-   */
-  external factory Int64List.fromList(List<int> elements);
-
-  /**
-   * Creates an [Int64List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Int64List] will be visible in the byte buffer
-   * and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Int64List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Int64List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Int64List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Int64List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Int64List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asInt64List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Int64List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of eight.
-   */
-  @Since("2.8")
-  factory Int64List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asInt64List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is an `Int64List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Int64List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Int64List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Int64List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 8;
-}
-
-/**
- * A fixed-length list of 64-bit unsigned integers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation can be considerably
- * more space- and time-efficient than the default [List] implementation.
- *
- * Integers stored in the list are truncated to their low 64 bits,
- * interpreted as an unsigned 64-bit integer with values in the
- * range 0 to 18446744073709551615.
- */
-abstract class Uint64List implements List<int>, _TypedIntList {
-  /**
-   * Creates a [Uint64List] of the specified length (in elements), all
-   * of whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 8 bytes.
-   */
-  external factory Uint64List(int length);
-
-  /**
-   * Creates a [Uint64List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 8 bytes.
-   */
-  external factory Uint64List.fromList(List<int> elements);
-
-  /**
-   * Creates an [Uint64List] _view_ of the specified region in
-   * the specified byte buffer.
-   *
-   * Changes in the [Uint64List] will be visible in the byte buffer
-   * and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Uint64List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Uint64List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Uint64List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Uint64List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Uint64List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asUint64List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Uint64List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of eight.
-   */
-  @Since("2.8")
-  factory Uint64List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asUint64List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Uint64List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Uint64List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Uint64List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Uint64List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 8;
-}
-
-/**
- * A fixed-length list of IEEE 754 single-precision binary floating-point
- * numbers that is viewable as a [TypedData].
- *
- * For long lists, this
- * implementation can be considerably more space- and time-efficient than
- * the default [List] implementation.
- *
- * Double values stored in the list are converted to the nearest
- * single-precision value. Values read are converted to a double
- * value with the same value.
- */
-abstract class Float32List implements List<double>, _TypedFloatList {
-  /**
-   * Creates a [Float32List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 4 bytes.
-   */
-  external factory Float32List(int length);
-
-  /**
-   * Creates a [Float32List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * Values are truncated to fit in the list when they are copied,
-   * the same way storing values truncates them.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 4 bytes.
-   */
-  external factory Float32List.fromList(List<double> elements);
-
-  /**
-   * Creates a [Float32List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Float32List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Float32List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Float32List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Float32List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Float32List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Float32List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asFloat32List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Float32List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of four.
-   */
-  @Since("2.8")
-  factory Float32List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asFloat32List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Float32List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Float32List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Float32List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Float32List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 4;
-}
-
-/**
- * A fixed-length list of IEEE 754 double-precision binary floating-point
- * numbers  that is viewable as a [TypedData].
- *
- * For long lists, this
- * implementation can be considerably more space- and time-efficient than
- * the default [List] implementation.
- */
-abstract class Float64List implements List<double>, _TypedFloatList {
-  /**
-   * Creates a [Float64List] of the specified length (in elements), all of
-   * whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 8 bytes.
-   */
-  external factory Float64List(int length);
-
-  /**
-   * Creates a [Float64List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 8 bytes.
-   */
-  external factory Float64List.fromList(List<double> elements);
-
-  /**
-   * Creates a [Float64List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Float64List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Float64List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Float64List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Float64List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Float64List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Float64List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asFloat64List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Float64List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of eight.
-   */
-  @Since("2.8")
-  factory Float64List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asFloat64List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Float64List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Float64List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Float64List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Float64List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 8;
-}
-
-/**
- * A fixed-length list of Float32x4 numbers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation will be considerably more
- * space- and time-efficient than the default [List] implementation.
- */
-abstract class Float32x4List implements List<Float32x4>, TypedData {
-  /**
-   * Creates a [Float32x4List] of the specified length (in elements),
-   * all of whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 16 bytes.
-   */
-  external factory Float32x4List(int length);
-
-  /**
-   * Creates a [Float32x4List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 16 bytes.
-   */
-  external factory Float32x4List.fromList(List<Float32x4> elements);
-
-  /**
-   * Creates a [Float32x4List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Float32x4List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Float32x4List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Float32x4List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Float32x4List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Float32x4List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Float32x4List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asFloat32x4List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates a [Float32x4List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of sixteen.
-   */
-  @Since("2.8")
-  factory Float32x4List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asFloat32x4List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns the concatenation of this list and [other].
-   *
-   * If [other] is also a [Float32x4List], the result is a new [Float32x4List],
-   * otherwise the result is a normal growable `List<Float32x4>`.
-   */
-  List<Float32x4> operator +(List<Float32x4> other);
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Float32x4List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Float32x4List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Float32x4List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Float32x4List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 16;
-}
-
-/**
- * A fixed-length list of Int32x4 numbers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation will be considerably more
- * space- and time-efficient than the default [List] implementation.
- */
-abstract class Int32x4List implements List<Int32x4>, TypedData {
-  /**
-   * Creates a [Int32x4List] of the specified length (in elements),
-   * all of whose elements are initially zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 16 bytes.
-   */
-  external factory Int32x4List(int length);
-
-  /**
-   * Creates a [Int32x4List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 16 bytes.
-   */
-  external factory Int32x4List.fromList(List<Int32x4> elements);
-
-  /**
-   * Creates a [Int32x4List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Int32x4List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Int32x4List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Int32x4List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Int32x4List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Int32x4List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Int32x4List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asInt32x4List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Int32x4List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of sixteen.
-   */
-  @Since("2.8")
-  factory Int32x4List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asInt32x4List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns the concatenation of this list and [other].
-   *
-   * If [other] is also a [Int32x4List], the result is a new [Int32x4List],
-   * otherwise the result is a normal growable `List<Int32x4>`.
-   */
-  List<Int32x4> operator +(List<Int32x4> other);
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is an `Int32x4list` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Int32x4list.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Int32x4list
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Int32x4List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 16;
-}
-
-/**
- * A fixed-length list of Float64x2 numbers that is viewable as a
- * [TypedData].
- *
- * For long lists, this implementation will be considerably more
- * space- and time-efficient than the default [List] implementation.
- */
-abstract class Float64x2List implements List<Float64x2>, TypedData {
-  /**
-   * Creates a [Float64x2List] of the specified length (in elements),
-   * all of whose elements have all lanes set to zero.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * [length] times 16 bytes.
-   */
-  external factory Float64x2List(int length);
-
-  /**
-   * Creates a [Float64x2List] with the same length as the [elements] list
-   * and copies over the elements.
-   *
-   * The list is backed by a [ByteBuffer] containing precisely
-   * `elements.length` times 16 bytes.
-   */
-  external factory Float64x2List.fromList(List<Float64x2> elements);
-
-  /**
-   * Returns the concatenation of this list and [other].
-   *
-   * If [other] is also a [Float64x2List], the result is a new [Float64x2List],
-   * otherwise the result is a normal growable `List<Float64x2>`.
-   */
-  List<Float64x2> operator +(List<Float64x2> other);
-
-  /**
-   * Creates a [Float64x2List] _view_ of the specified region in [buffer].
-   *
-   * Changes in the [Float64x2List] will be visible in the byte
-   * buffer and vice versa.
-   * If the [offsetInBytes] index of the region is not specified,
-   * it defaults to zero (the first byte in the byte buffer).
-   * If the length is not specified, it defaults to `null`,
-   * which indicates that the view extends to the end of the byte buffer.
-   *
-   * Throws [RangeError] if [offsetInBytes] or [length] are negative, or
-   * if [offsetInBytes] + ([length] * elementSizeInBytes) is greater than
-   * the length of [buffer].
-   *
-   * Throws [ArgumentError] if [offsetInBytes] is not a multiple of
-   * [bytesPerElement].
-   *
-   * Note that when creating a view from a [TypedData] list or byte data,
-   * that list or byte data may itself be a view on a larger buffer
-   * with a [TypedData.offsetInBytes] greater than zero.
-   * Merely doing `Float64x2List.view(other.buffer, 0, count)` may not
-   * point to the bytes you intended. Instead you may need to do:
-   * ```dart
-   * Float64x2List.view(other.buffer, other.offsetInBytes, count)
-   * ```
-   * Alternatively, use [Float64x2List.sublistView]
-   * which includes this computation:
-   * ```dart
-   * Float64x2List.sublistView(other, 0, count);
-   * ```
-   * (The third argument is an end index rather than a length, so if
-   * you start from a position greater than zero, you need not
-   * reduce the count correspondingly).
-   */
-  factory Float64x2List.view(ByteBuffer buffer,
-      [int offsetInBytes = 0, int? length]) {
-    return buffer.asFloat64x2List(offsetInBytes, length);
-  }
-
-  /**
-   * Creates an [Float64x2List] view on a range of elements of [data].
-   *
-   * Creates a view on the range of `data.buffer` which corresponds
-   * to the elements of [data] from [start] until [end].
-   * If [data] is a typed data list, like [Uint16List], then the view is on
-   * the bytes of the elements with indices from [start] until [end].
-   * If [data] is a [ByteData], it's treated like a list of bytes.
-   *
-   * If provided, [start] and [end] must satisfy
-   *
-   * 0 &le; `start` &le; `end` &le; *elementCount*
-   *
-   * where *elementCount* is the number of elements in [data], which
-   * is the same as the [List.length] of a typed data list.
-   *
-   * If omitted, [start] defaults to zero and [end] to *elementCount*.
-   *
-   * The start and end indices of the range of bytes being viewed must be
-   * multiples of sixteen.
-   */
-  @Since("2.8")
-  factory Float64x2List.sublistView(TypedData data, [int start = 0, int? end]) {
-    int elementSize = data.elementSizeInBytes;
-    end = RangeError.checkValidRange(
-        start, end, data.lengthInBytes ~/ elementSize);
-    if (end == null) throw "unreachable"; // TODO(38725)
-    int byteLength = (end - start) * elementSize;
-    if (byteLength % bytesPerElement != 0) {
-      throw ArgumentError("The number of bytes to view must be a multiple of " +
-          "$bytesPerElement");
-    }
-    return data.buffer.asFloat64x2List(data.offsetInBytes + start * elementSize,
-        byteLength ~/ bytesPerElement);
-  }
-
-  /**
-   * Returns a new list containing the elements between [start] and [end].
-   *
-   * The new list is a `Float64x2List` containing the elements of this
-   * list at positions greater than or equal to [start] and less than [end] in
-   * the same order as they occur in this list.
-   *
-   * ```dart
-   * var numbers = Float64x2List.fromList([0, 1, 2, 3, 4]);
-   * print(numbers.sublist(1, 3)); // [1, 2]
-   * print(numbers.sublist(1, 3).runtimeType); // Float64x2List
-   * ```
-   *
-   * If [end] is omitted, it defaults to the [length] of this list.
-   *
-   * ```dart
-   * print(numbers.sublist(1)); // [1, 2, 3, 4]
-   * ```
-   *
-   * The `start` and `end` positions must satisfy the relations
-   * 0 ≤ `start` ≤ `end` ≤ `this.length`
-   * If `end` is equal to `start`, then the returned list is empty.
-   */
-  Float64x2List sublist(int start, [int? end]);
-
-  static const int bytesPerElement = 16;
-}
-
-/**
- * Float32x4 immutable value type and operations.
- *
- * Float32x4 stores 4 32-bit floating point values in "lanes".
- * The lanes are "x", "y", "z", and "w" respectively.
- */
-abstract class Float32x4 {
-  external factory Float32x4(double x, double y, double z, double w);
-  external factory Float32x4.splat(double v);
-  external factory Float32x4.zero();
-  external factory Float32x4.fromInt32x4Bits(Int32x4 x);
-
-  /// Sets the x and y lanes to their respective values in [v] and sets the z
-  /// and w lanes to 0.0.
-  external factory Float32x4.fromFloat64x2(Float64x2 v);
-
-  /// Addition operator.
-  Float32x4 operator +(Float32x4 other);
-
-  /// Negate operator.
-  Float32x4 operator -();
-
-  /// Subtraction operator.
-  Float32x4 operator -(Float32x4 other);
-
-  /// Multiplication operator.
-  Float32x4 operator *(Float32x4 other);
-
-  /// Division operator.
-  Float32x4 operator /(Float32x4 other);
-
-  /// Relational less than.
-  Int32x4 lessThan(Float32x4 other);
-
-  /// Relational less than or equal.
-  Int32x4 lessThanOrEqual(Float32x4 other);
-
-  /// Relational greater than.
-  Int32x4 greaterThan(Float32x4 other);
-
-  /// Relational greater than or equal.
-  Int32x4 greaterThanOrEqual(Float32x4 other);
-
-  /// Relational equal.
-  Int32x4 equal(Float32x4 other);
-
-  /// Relational not-equal.
-  Int32x4 notEqual(Float32x4 other);
-
-  /// Returns a copy of [this] each lane being scaled by [s].
-  /// Equivalent to this * new Float32x4.splat(s)
-  Float32x4 scale(double s);
-
-  /// Returns the lane-wise absolute value of this [Float32x4].
-  Float32x4 abs();
-
-  /// Lane-wise clamp [this] to be in the range [lowerLimit]-[upperLimit].
-  Float32x4 clamp(Float32x4 lowerLimit, Float32x4 upperLimit);
-
-  /// Extracted x value.
-  double get x;
-
-  /// Extracted y value.
-  double get y;
-
-  /// Extracted z value.
-  double get z;
-
-  /// Extracted w value.
-  double get w;
-
-  /// Extract the sign bits from each lane return them in the first 4 bits.
-  /// "x" lane is bit 0.
-  /// "y" lane is bit 1.
-  /// "z" lane is bit 2.
-  /// "w" lane is bit 3.
-  int get signMask;
-
-  /// Mask passed to [shuffle] or [shuffleMix].
-  static const int xxxx = 0x0;
-  static const int xxxy = 0x40;
-  static const int xxxz = 0x80;
-  static const int xxxw = 0xC0;
-  static const int xxyx = 0x10;
-  static const int xxyy = 0x50;
-  static const int xxyz = 0x90;
-  static const int xxyw = 0xD0;
-  static const int xxzx = 0x20;
-  static const int xxzy = 0x60;
-  static const int xxzz = 0xA0;
-  static const int xxzw = 0xE0;
-  static const int xxwx = 0x30;
-  static const int xxwy = 0x70;
-  static const int xxwz = 0xB0;
-  static const int xxww = 0xF0;
-  static const int xyxx = 0x4;
-  static const int xyxy = 0x44;
-  static const int xyxz = 0x84;
-  static const int xyxw = 0xC4;
-  static const int xyyx = 0x14;
-  static const int xyyy = 0x54;
-  static const int xyyz = 0x94;
-  static const int xyyw = 0xD4;
-  static const int xyzx = 0x24;
-  static const int xyzy = 0x64;
-  static const int xyzz = 0xA4;
-  static const int xyzw = 0xE4;
-  static const int xywx = 0x34;
-  static const int xywy = 0x74;
-  static const int xywz = 0xB4;
-  static const int xyww = 0xF4;
-  static const int xzxx = 0x8;
-  static const int xzxy = 0x48;
-  static const int xzxz = 0x88;
-  static const int xzxw = 0xC8;
-  static const int xzyx = 0x18;
-  static const int xzyy = 0x58;
-  static const int xzyz = 0x98;
-  static const int xzyw = 0xD8;
-  static const int xzzx = 0x28;
-  static const int xzzy = 0x68;
-  static const int xzzz = 0xA8;
-  static const int xzzw = 0xE8;
-  static const int xzwx = 0x38;
-  static const int xzwy = 0x78;
-  static const int xzwz = 0xB8;
-  static const int xzww = 0xF8;
-  static const int xwxx = 0xC;
-  static const int xwxy = 0x4C;
-  static const int xwxz = 0x8C;
-  static const int xwxw = 0xCC;
-  static const int xwyx = 0x1C;
-  static const int xwyy = 0x5C;
-  static const int xwyz = 0x9C;
-  static const int xwyw = 0xDC;
-  static const int xwzx = 0x2C;
-  static const int xwzy = 0x6C;
-  static const int xwzz = 0xAC;
-  static const int xwzw = 0xEC;
-  static const int xwwx = 0x3C;
-  static const int xwwy = 0x7C;
-  static const int xwwz = 0xBC;
-  static const int xwww = 0xFC;
-  static const int yxxx = 0x1;
-  static const int yxxy = 0x41;
-  static const int yxxz = 0x81;
-  static const int yxxw = 0xC1;
-  static const int yxyx = 0x11;
-  static const int yxyy = 0x51;
-  static const int yxyz = 0x91;
-  static const int yxyw = 0xD1;
-  static const int yxzx = 0x21;
-  static const int yxzy = 0x61;
-  static const int yxzz = 0xA1;
-  static const int yxzw = 0xE1;
-  static const int yxwx = 0x31;
-  static const int yxwy = 0x71;
-  static const int yxwz = 0xB1;
-  static const int yxww = 0xF1;
-  static const int yyxx = 0x5;
-  static const int yyxy = 0x45;
-  static const int yyxz = 0x85;
-  static const int yyxw = 0xC5;
-  static const int yyyx = 0x15;
-  static const int yyyy = 0x55;
-  static const int yyyz = 0x95;
-  static const int yyyw = 0xD5;
-  static const int yyzx = 0x25;
-  static const int yyzy = 0x65;
-  static const int yyzz = 0xA5;
-  static const int yyzw = 0xE5;
-  static const int yywx = 0x35;
-  static const int yywy = 0x75;
-  static const int yywz = 0xB5;
-  static const int yyww = 0xF5;
-  static const int yzxx = 0x9;
-  static const int yzxy = 0x49;
-  static const int yzxz = 0x89;
-  static const int yzxw = 0xC9;
-  static const int yzyx = 0x19;
-  static const int yzyy = 0x59;
-  static const int yzyz = 0x99;
-  static const int yzyw = 0xD9;
-  static const int yzzx = 0x29;
-  static const int yzzy = 0x69;
-  static const int yzzz = 0xA9;
-  static const int yzzw = 0xE9;
-  static const int yzwx = 0x39;
-  static const int yzwy = 0x79;
-  static const int yzwz = 0xB9;
-  static const int yzww = 0xF9;
-  static const int ywxx = 0xD;
-  static const int ywxy = 0x4D;
-  static const int ywxz = 0x8D;
-  static const int ywxw = 0xCD;
-  static const int ywyx = 0x1D;
-  static const int ywyy = 0x5D;
-  static const int ywyz = 0x9D;
-  static const int ywyw = 0xDD;
-  static const int ywzx = 0x2D;
-  static const int ywzy = 0x6D;
-  static const int ywzz = 0xAD;
-  static const int ywzw = 0xED;
-  static const int ywwx = 0x3D;
-  static const int ywwy = 0x7D;
-  static const int ywwz = 0xBD;
-  static const int ywww = 0xFD;
-  static const int zxxx = 0x2;
-  static const int zxxy = 0x42;
-  static const int zxxz = 0x82;
-  static const int zxxw = 0xC2;
-  static const int zxyx = 0x12;
-  static const int zxyy = 0x52;
-  static const int zxyz = 0x92;
-  static const int zxyw = 0xD2;
-  static const int zxzx = 0x22;
-  static const int zxzy = 0x62;
-  static const int zxzz = 0xA2;
-  static const int zxzw = 0xE2;
-  static const int zxwx = 0x32;
-  static const int zxwy = 0x72;
-  static const int zxwz = 0xB2;
-  static const int zxww = 0xF2;
-  static const int zyxx = 0x6;
-  static const int zyxy = 0x46;
-  static const int zyxz = 0x86;
-  static const int zyxw = 0xC6;
-  static const int zyyx = 0x16;
-  static const int zyyy = 0x56;
-  static const int zyyz = 0x96;
-  static const int zyyw = 0xD6;
-  static const int zyzx = 0x26;
-  static const int zyzy = 0x66;
-  static const int zyzz = 0xA6;
-  static const int zyzw = 0xE6;
-  static const int zywx = 0x36;
-  static const int zywy = 0x76;
-  static const int zywz = 0xB6;
-  static const int zyww = 0xF6;
-  static const int zzxx = 0xA;
-  static const int zzxy = 0x4A;
-  static const int zzxz = 0x8A;
-  static const int zzxw = 0xCA;
-  static const int zzyx = 0x1A;
-  static const int zzyy = 0x5A;
-  static const int zzyz = 0x9A;
-  static const int zzyw = 0xDA;
-  static const int zzzx = 0x2A;
-  static const int zzzy = 0x6A;
-  static const int zzzz = 0xAA;
-  static const int zzzw = 0xEA;
-  static const int zzwx = 0x3A;
-  static const int zzwy = 0x7A;
-  static const int zzwz = 0xBA;
-  static const int zzww = 0xFA;
-  static const int zwxx = 0xE;
-  static const int zwxy = 0x4E;
-  static const int zwxz = 0x8E;
-  static const int zwxw = 0xCE;
-  static const int zwyx = 0x1E;
-  static const int zwyy = 0x5E;
-  static const int zwyz = 0x9E;
-  static const int zwyw = 0xDE;
-  static const int zwzx = 0x2E;
-  static const int zwzy = 0x6E;
-  static const int zwzz = 0xAE;
-  static const int zwzw = 0xEE;
-  static const int zwwx = 0x3E;
-  static const int zwwy = 0x7E;
-  static const int zwwz = 0xBE;
-  static const int zwww = 0xFE;
-  static const int wxxx = 0x3;
-  static const int wxxy = 0x43;
-  static const int wxxz = 0x83;
-  static const int wxxw = 0xC3;
-  static const int wxyx = 0x13;
-  static const int wxyy = 0x53;
-  static const int wxyz = 0x93;
-  static const int wxyw = 0xD3;
-  static const int wxzx = 0x23;
-  static const int wxzy = 0x63;
-  static const int wxzz = 0xA3;
-  static const int wxzw = 0xE3;
-  static const int wxwx = 0x33;
-  static const int wxwy = 0x73;
-  static const int wxwz = 0xB3;
-  static const int wxww = 0xF3;
-  static const int wyxx = 0x7;
-  static const int wyxy = 0x47;
-  static const int wyxz = 0x87;
-  static const int wyxw = 0xC7;
-  static const int wyyx = 0x17;
-  static const int wyyy = 0x57;
-  static const int wyyz = 0x97;
-  static const int wyyw = 0xD7;
-  static const int wyzx = 0x27;
-  static const int wyzy = 0x67;
-  static const int wyzz = 0xA7;
-  static const int wyzw = 0xE7;
-  static const int wywx = 0x37;
-  static const int wywy = 0x77;
-  static const int wywz = 0xB7;
-  static const int wyww = 0xF7;
-  static const int wzxx = 0xB;
-  static const int wzxy = 0x4B;
-  static const int wzxz = 0x8B;
-  static const int wzxw = 0xCB;
-  static const int wzyx = 0x1B;
-  static const int wzyy = 0x5B;
-  static const int wzyz = 0x9B;
-  static const int wzyw = 0xDB;
-  static const int wzzx = 0x2B;
-  static const int wzzy = 0x6B;
-  static const int wzzz = 0xAB;
-  static const int wzzw = 0xEB;
-  static const int wzwx = 0x3B;
-  static const int wzwy = 0x7B;
-  static const int wzwz = 0xBB;
-  static const int wzww = 0xFB;
-  static const int wwxx = 0xF;
-  static const int wwxy = 0x4F;
-  static const int wwxz = 0x8F;
-  static const int wwxw = 0xCF;
-  static const int wwyx = 0x1F;
-  static const int wwyy = 0x5F;
-  static const int wwyz = 0x9F;
-  static const int wwyw = 0xDF;
-  static const int wwzx = 0x2F;
-  static const int wwzy = 0x6F;
-  static const int wwzz = 0xAF;
-  static const int wwzw = 0xEF;
-  static const int wwwx = 0x3F;
-  static const int wwwy = 0x7F;
-  static const int wwwz = 0xBF;
-  static const int wwww = 0xFF;
-
-  /// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
-  Float32x4 shuffle(int mask);
-
-  /// Shuffle the lane values in [this] and [other]. The returned
-  /// Float32x4 will have XY lanes from [this] and ZW lanes from [other].
-  /// Uses the same [mask] as [shuffle].
-  Float32x4 shuffleMix(Float32x4 other, int mask);
-
-  /// Returns a new [Float32x4] copied from [this] with a new x value.
-  Float32x4 withX(double x);
-
-  /// Returns a new [Float32x4] copied from [this] with a new y value.
-  Float32x4 withY(double y);
-
-  /// Returns a new [Float32x4] copied from [this] with a new z value.
-  Float32x4 withZ(double z);
-
-  /// Returns a new [Float32x4] copied from [this] with a new w value.
-  Float32x4 withW(double w);
-
-  /// Returns the lane-wise minimum value in [this] or [other].
-  Float32x4 min(Float32x4 other);
-
-  /// Returns the lane-wise maximum value in [this] or [other].
-  Float32x4 max(Float32x4 other);
-
-  /// Returns the square root of [this].
-  Float32x4 sqrt();
-
-  /// Returns the reciprocal of [this].
-  Float32x4 reciprocal();
-
-  /// Returns the square root of the reciprocal of [this].
-  Float32x4 reciprocalSqrt();
-}
-
-/**
- * Int32x4 and operations.
- *
- * Int32x4 stores 4 32-bit bit-masks in "lanes".
- * The lanes are "x", "y", "z", and "w" respectively.
- */
-abstract class Int32x4 {
-  external factory Int32x4(int x, int y, int z, int w);
-  external factory Int32x4.bool(bool x, bool y, bool z, bool w);
-  external factory Int32x4.fromFloat32x4Bits(Float32x4 x);
-
-  /// The bit-wise or operator.
-  Int32x4 operator |(Int32x4 other);
-
-  /// The bit-wise and operator.
-  Int32x4 operator &(Int32x4 other);
-
-  /// The bit-wise xor operator.
-  Int32x4 operator ^(Int32x4 other);
-
-  /// Addition operator.
-  Int32x4 operator +(Int32x4 other);
-
-  /// Subtraction operator.
-  Int32x4 operator -(Int32x4 other);
-
-  /// Extract 32-bit mask from x lane.
-  int get x;
-
-  /// Extract 32-bit mask from y lane.
-  int get y;
-
-  /// Extract 32-bit mask from z lane.
-  int get z;
-
-  /// Extract 32-bit mask from w lane.
-  int get w;
-
-  /// Extract the top bit from each lane return them in the first 4 bits.
-  /// "x" lane is bit 0.
-  /// "y" lane is bit 1.
-  /// "z" lane is bit 2.
-  /// "w" lane is bit 3.
-  int get signMask;
-
-  /// Mask passed to [shuffle] or [shuffleMix].
-  static const int xxxx = 0x0;
-  static const int xxxy = 0x40;
-  static const int xxxz = 0x80;
-  static const int xxxw = 0xC0;
-  static const int xxyx = 0x10;
-  static const int xxyy = 0x50;
-  static const int xxyz = 0x90;
-  static const int xxyw = 0xD0;
-  static const int xxzx = 0x20;
-  static const int xxzy = 0x60;
-  static const int xxzz = 0xA0;
-  static const int xxzw = 0xE0;
-  static const int xxwx = 0x30;
-  static const int xxwy = 0x70;
-  static const int xxwz = 0xB0;
-  static const int xxww = 0xF0;
-  static const int xyxx = 0x4;
-  static const int xyxy = 0x44;
-  static const int xyxz = 0x84;
-  static const int xyxw = 0xC4;
-  static const int xyyx = 0x14;
-  static const int xyyy = 0x54;
-  static const int xyyz = 0x94;
-  static const int xyyw = 0xD4;
-  static const int xyzx = 0x24;
-  static const int xyzy = 0x64;
-  static const int xyzz = 0xA4;
-  static const int xyzw = 0xE4;
-  static const int xywx = 0x34;
-  static const int xywy = 0x74;
-  static const int xywz = 0xB4;
-  static const int xyww = 0xF4;
-  static const int xzxx = 0x8;
-  static const int xzxy = 0x48;
-  static const int xzxz = 0x88;
-  static const int xzxw = 0xC8;
-  static const int xzyx = 0x18;
-  static const int xzyy = 0x58;
-  static const int xzyz = 0x98;
-  static const int xzyw = 0xD8;
-  static const int xzzx = 0x28;
-  static const int xzzy = 0x68;
-  static const int xzzz = 0xA8;
-  static const int xzzw = 0xE8;
-  static const int xzwx = 0x38;
-  static const int xzwy = 0x78;
-  static const int xzwz = 0xB8;
-  static const int xzww = 0xF8;
-  static const int xwxx = 0xC;
-  static const int xwxy = 0x4C;
-  static const int xwxz = 0x8C;
-  static const int xwxw = 0xCC;
-  static const int xwyx = 0x1C;
-  static const int xwyy = 0x5C;
-  static const int xwyz = 0x9C;
-  static const int xwyw = 0xDC;
-  static const int xwzx = 0x2C;
-  static const int xwzy = 0x6C;
-  static const int xwzz = 0xAC;
-  static const int xwzw = 0xEC;
-  static const int xwwx = 0x3C;
-  static const int xwwy = 0x7C;
-  static const int xwwz = 0xBC;
-  static const int xwww = 0xFC;
-  static const int yxxx = 0x1;
-  static const int yxxy = 0x41;
-  static const int yxxz = 0x81;
-  static const int yxxw = 0xC1;
-  static const int yxyx = 0x11;
-  static const int yxyy = 0x51;
-  static const int yxyz = 0x91;
-  static const int yxyw = 0xD1;
-  static const int yxzx = 0x21;
-  static const int yxzy = 0x61;
-  static const int yxzz = 0xA1;
-  static const int yxzw = 0xE1;
-  static const int yxwx = 0x31;
-  static const int yxwy = 0x71;
-  static const int yxwz = 0xB1;
-  static const int yxww = 0xF1;
-  static const int yyxx = 0x5;
-  static const int yyxy = 0x45;
-  static const int yyxz = 0x85;
-  static const int yyxw = 0xC5;
-  static const int yyyx = 0x15;
-  static const int yyyy = 0x55;
-  static const int yyyz = 0x95;
-  static const int yyyw = 0xD5;
-  static const int yyzx = 0x25;
-  static const int yyzy = 0x65;
-  static const int yyzz = 0xA5;
-  static const int yyzw = 0xE5;
-  static const int yywx = 0x35;
-  static const int yywy = 0x75;
-  static const int yywz = 0xB5;
-  static const int yyww = 0xF5;
-  static const int yzxx = 0x9;
-  static const int yzxy = 0x49;
-  static const int yzxz = 0x89;
-  static const int yzxw = 0xC9;
-  static const int yzyx = 0x19;
-  static const int yzyy = 0x59;
-  static const int yzyz = 0x99;
-  static const int yzyw = 0xD9;
-  static const int yzzx = 0x29;
-  static const int yzzy = 0x69;
-  static const int yzzz = 0xA9;
-  static const int yzzw = 0xE9;
-  static const int yzwx = 0x39;
-  static const int yzwy = 0x79;
-  static const int yzwz = 0xB9;
-  static const int yzww = 0xF9;
-  static const int ywxx = 0xD;
-  static const int ywxy = 0x4D;
-  static const int ywxz = 0x8D;
-  static const int ywxw = 0xCD;
-  static const int ywyx = 0x1D;
-  static const int ywyy = 0x5D;
-  static const int ywyz = 0x9D;
-  static const int ywyw = 0xDD;
-  static const int ywzx = 0x2D;
-  static const int ywzy = 0x6D;
-  static const int ywzz = 0xAD;
-  static const int ywzw = 0xED;
-  static const int ywwx = 0x3D;
-  static const int ywwy = 0x7D;
-  static const int ywwz = 0xBD;
-  static const int ywww = 0xFD;
-  static const int zxxx = 0x2;
-  static const int zxxy = 0x42;
-  static const int zxxz = 0x82;
-  static const int zxxw = 0xC2;
-  static const int zxyx = 0x12;
-  static const int zxyy = 0x52;
-  static const int zxyz = 0x92;
-  static const int zxyw = 0xD2;
-  static const int zxzx = 0x22;
-  static const int zxzy = 0x62;
-  static const int zxzz = 0xA2;
-  static const int zxzw = 0xE2;
-  static const int zxwx = 0x32;
-  static const int zxwy = 0x72;
-  static const int zxwz = 0xB2;
-  static const int zxww = 0xF2;
-  static const int zyxx = 0x6;
-  static const int zyxy = 0x46;
-  static const int zyxz = 0x86;
-  static const int zyxw = 0xC6;
-  static const int zyyx = 0x16;
-  static const int zyyy = 0x56;
-  static const int zyyz = 0x96;
-  static const int zyyw = 0xD6;
-  static const int zyzx = 0x26;
-  static const int zyzy = 0x66;
-  static const int zyzz = 0xA6;
-  static const int zyzw = 0xE6;
-  static const int zywx = 0x36;
-  static const int zywy = 0x76;
-  static const int zywz = 0xB6;
-  static const int zyww = 0xF6;
-  static const int zzxx = 0xA;
-  static const int zzxy = 0x4A;
-  static const int zzxz = 0x8A;
-  static const int zzxw = 0xCA;
-  static const int zzyx = 0x1A;
-  static const int zzyy = 0x5A;
-  static const int zzyz = 0x9A;
-  static const int zzyw = 0xDA;
-  static const int zzzx = 0x2A;
-  static const int zzzy = 0x6A;
-  static const int zzzz = 0xAA;
-  static const int zzzw = 0xEA;
-  static const int zzwx = 0x3A;
-  static const int zzwy = 0x7A;
-  static const int zzwz = 0xBA;
-  static const int zzww = 0xFA;
-  static const int zwxx = 0xE;
-  static const int zwxy = 0x4E;
-  static const int zwxz = 0x8E;
-  static const int zwxw = 0xCE;
-  static const int zwyx = 0x1E;
-  static const int zwyy = 0x5E;
-  static const int zwyz = 0x9E;
-  static const int zwyw = 0xDE;
-  static const int zwzx = 0x2E;
-  static const int zwzy = 0x6E;
-  static const int zwzz = 0xAE;
-  static const int zwzw = 0xEE;
-  static const int zwwx = 0x3E;
-  static const int zwwy = 0x7E;
-  static const int zwwz = 0xBE;
-  static const int zwww = 0xFE;
-  static const int wxxx = 0x3;
-  static const int wxxy = 0x43;
-  static const int wxxz = 0x83;
-  static const int wxxw = 0xC3;
-  static const int wxyx = 0x13;
-  static const int wxyy = 0x53;
-  static const int wxyz = 0x93;
-  static const int wxyw = 0xD3;
-  static const int wxzx = 0x23;
-  static const int wxzy = 0x63;
-  static const int wxzz = 0xA3;
-  static const int wxzw = 0xE3;
-  static const int wxwx = 0x33;
-  static const int wxwy = 0x73;
-  static const int wxwz = 0xB3;
-  static const int wxww = 0xF3;
-  static const int wyxx = 0x7;
-  static const int wyxy = 0x47;
-  static const int wyxz = 0x87;
-  static const int wyxw = 0xC7;
-  static const int wyyx = 0x17;
-  static const int wyyy = 0x57;
-  static const int wyyz = 0x97;
-  static const int wyyw = 0xD7;
-  static const int wyzx = 0x27;
-  static const int wyzy = 0x67;
-  static const int wyzz = 0xA7;
-  static const int wyzw = 0xE7;
-  static const int wywx = 0x37;
-  static const int wywy = 0x77;
-  static const int wywz = 0xB7;
-  static const int wyww = 0xF7;
-  static const int wzxx = 0xB;
-  static const int wzxy = 0x4B;
-  static const int wzxz = 0x8B;
-  static const int wzxw = 0xCB;
-  static const int wzyx = 0x1B;
-  static const int wzyy = 0x5B;
-  static const int wzyz = 0x9B;
-  static const int wzyw = 0xDB;
-  static const int wzzx = 0x2B;
-  static const int wzzy = 0x6B;
-  static const int wzzz = 0xAB;
-  static const int wzzw = 0xEB;
-  static const int wzwx = 0x3B;
-  static const int wzwy = 0x7B;
-  static const int wzwz = 0xBB;
-  static const int wzww = 0xFB;
-  static const int wwxx = 0xF;
-  static const int wwxy = 0x4F;
-  static const int wwxz = 0x8F;
-  static const int wwxw = 0xCF;
-  static const int wwyx = 0x1F;
-  static const int wwyy = 0x5F;
-  static const int wwyz = 0x9F;
-  static const int wwyw = 0xDF;
-  static const int wwzx = 0x2F;
-  static const int wwzy = 0x6F;
-  static const int wwzz = 0xAF;
-  static const int wwzw = 0xEF;
-  static const int wwwx = 0x3F;
-  static const int wwwy = 0x7F;
-  static const int wwwz = 0xBF;
-  static const int wwww = 0xFF;
-
-  /// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
-  Int32x4 shuffle(int mask);
-
-  /// Shuffle the lane values in [this] and [other]. The returned
-  /// Int32x4 will have XY lanes from [this] and ZW lanes from [other].
-  /// Uses the same [mask] as [shuffle].
-  Int32x4 shuffleMix(Int32x4 other, int mask);
-
-  /// Returns a new [Int32x4] copied from [this] with a new x value.
-  Int32x4 withX(int x);
-
-  /// Returns a new [Int32x4] copied from [this] with a new y value.
-  Int32x4 withY(int y);
-
-  /// Returns a new [Int32x4] copied from [this] with a new z value.
-  Int32x4 withZ(int z);
-
-  /// Returns a new [Int32x4] copied from [this] with a new w value.
-  Int32x4 withW(int w);
-
-  /// Extracted x value. Returns false for 0, true for any other value.
-  bool get flagX;
-
-  /// Extracted y value. Returns false for 0, true for any other value.
-  bool get flagY;
-
-  /// Extracted z value. Returns false for 0, true for any other value.
-  bool get flagZ;
-
-  /// Extracted w value. Returns false for 0, true for any other value.
-  bool get flagW;
-
-  /// Returns a new [Int32x4] copied from [this] with a new x value.
-  Int32x4 withFlagX(bool x);
-
-  /// Returns a new [Int32x4] copied from [this] with a new y value.
-  Int32x4 withFlagY(bool y);
-
-  /// Returns a new [Int32x4] copied from [this] with a new z value.
-  Int32x4 withFlagZ(bool z);
-
-  /// Returns a new [Int32x4] copied from [this] with a new w value.
-  Int32x4 withFlagW(bool w);
-
-  /// Merge [trueValue] and [falseValue] based on [this]' bit mask:
-  /// Select bit from [trueValue] when bit in [this] is on.
-  /// Select bit from [falseValue] when bit in [this] is off.
-  Float32x4 select(Float32x4 trueValue, Float32x4 falseValue);
-}
-
-/**
- * Float64x2 immutable value type and operations.
- *
- * Float64x2 stores 2 64-bit floating point values in "lanes".
- * The lanes are "x" and "y" respectively.
- */
-abstract class Float64x2 {
-  external factory Float64x2(double x, double y);
-  external factory Float64x2.splat(double v);
-  external factory Float64x2.zero();
-
-  /// Uses the "x" and "y" lanes from [v].
-  external factory Float64x2.fromFloat32x4(Float32x4 v);
-
-  /// Addition operator.
-  Float64x2 operator +(Float64x2 other);
-
-  /// Negate operator.
-  Float64x2 operator -();
-
-  /// Subtraction operator.
-  Float64x2 operator -(Float64x2 other);
-
-  /// Multiplication operator.
-  Float64x2 operator *(Float64x2 other);
-
-  /// Division operator.
-  Float64x2 operator /(Float64x2 other);
-
-  /// Returns a copy of [this] each lane being scaled by [s].
-  /// Equivalent to this * new Float64x2.splat(s)
-  Float64x2 scale(double s);
-
-  /// Returns the lane-wise absolute value of this [Float64x2].
-  Float64x2 abs();
-
-  /// Lane-wise clamp [this] to be in the range [lowerLimit]-[upperLimit].
-  Float64x2 clamp(Float64x2 lowerLimit, Float64x2 upperLimit);
-
-  /// Extracted x value.
-  double get x;
-
-  /// Extracted y value.
-  double get y;
-
-  /// Extract the sign bits from each lane return them in the first 2 bits.
-  /// "x" lane is bit 0.
-  /// "y" lane is bit 1.
-  int get signMask;
-
-  /// Returns a new [Float64x2] copied from [this] with a new x value.
-  Float64x2 withX(double x);
-
-  /// Returns a new [Float64x2] copied from [this] with a new y value.
-  Float64x2 withY(double y);
-
-  /// Returns the lane-wise minimum value in [this] or [other].
-  Float64x2 min(Float64x2 other);
-
-  /// Returns the lane-wise maximum value in [this] or [other].
-  Float64x2 max(Float64x2 other);
-
-  /// Returns the lane-wise square root of [this].
-  Float64x2 sqrt();
-}
diff --git a/sdk_nnbd/lib/typed_data/typed_data_sources.gni b/sdk_nnbd/lib/typed_data/typed_data_sources.gni
deleted file mode 100644
index 00459f3..0000000
--- a/sdk_nnbd/lib/typed_data/typed_data_sources.gni
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2017, 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.
-
-typed_data_sdk_sources = [
-  "typed_data.dart",
-
-  # The above file needs to be first if additional parts are added to the lib.
-  "unmodifiable_typed_data.dart",
-]
diff --git a/sdk_nnbd/lib/typed_data/unmodifiable_typed_data.dart b/sdk_nnbd/lib/typed_data/unmodifiable_typed_data.dart
deleted file mode 100644
index 30bdf51..0000000
--- a/sdk_nnbd/lib/typed_data/unmodifiable_typed_data.dart
+++ /dev/null
@@ -1,342 +0,0 @@
-// Copyright (c) 2018, 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.
-
-part of dart.typed_data;
-
-/**
- * A read-only view of a [ByteBuffer].
- */
-class UnmodifiableByteBufferView implements ByteBuffer {
-  final ByteBuffer _data;
-
-  UnmodifiableByteBufferView(ByteBuffer data) : _data = data;
-
-  int get lengthInBytes => _data.lengthInBytes;
-
-  Uint8List asUint8List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableUint8ListView(_data.asUint8List(offsetInBytes, length));
-
-  Int8List asInt8List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableInt8ListView(_data.asInt8List(offsetInBytes, length));
-
-  Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableUint8ClampedListView(
-          _data.asUint8ClampedList(offsetInBytes, length));
-
-  Uint16List asUint16List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableUint16ListView(_data.asUint16List(offsetInBytes, length));
-
-  Int16List asInt16List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableInt16ListView(_data.asInt16List(offsetInBytes, length));
-
-  Uint32List asUint32List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableUint32ListView(_data.asUint32List(offsetInBytes, length));
-
-  Int32List asInt32List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableInt32ListView(_data.asInt32List(offsetInBytes, length));
-
-  Uint64List asUint64List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableUint64ListView(_data.asUint64List(offsetInBytes, length));
-
-  Int64List asInt64List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableInt64ListView(_data.asInt64List(offsetInBytes, length));
-
-  Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableInt32x4ListView(
-          _data.asInt32x4List(offsetInBytes, length));
-
-  Float32List asFloat32List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableFloat32ListView(
-          _data.asFloat32List(offsetInBytes, length));
-
-  Float64List asFloat64List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableFloat64ListView(
-          _data.asFloat64List(offsetInBytes, length));
-
-  Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableFloat32x4ListView(
-          _data.asFloat32x4List(offsetInBytes, length));
-
-  Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableFloat64x2ListView(
-          _data.asFloat64x2List(offsetInBytes, length));
-
-  ByteData asByteData([int offsetInBytes = 0, int? length]) =>
-      new UnmodifiableByteDataView(_data.asByteData(offsetInBytes, length));
-}
-
-/**
- * A read-only view of a [ByteData].
- */
-class UnmodifiableByteDataView implements ByteData {
-  final ByteData _data;
-
-  UnmodifiableByteDataView(ByteData data) : _data = data;
-
-  int getInt8(int byteOffset) => _data.getInt8(byteOffset);
-
-  void setInt8(int byteOffset, int value) => _unsupported();
-
-  int getUint8(int byteOffset) => _data.getUint8(byteOffset);
-
-  void setUint8(int byteOffset, int value) => _unsupported();
-
-  int getInt16(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getInt16(byteOffset, endian);
-
-  void setInt16(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  int getUint16(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getUint16(byteOffset, endian);
-
-  void setUint16(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  int getInt32(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getInt32(byteOffset, endian);
-
-  void setInt32(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  int getUint32(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getUint32(byteOffset, endian);
-
-  void setUint32(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  int getInt64(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getInt64(byteOffset, endian);
-
-  void setInt64(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  int getUint64(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getUint64(byteOffset, endian);
-
-  void setUint64(int byteOffset, int value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  double getFloat32(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getFloat32(byteOffset, endian);
-
-  void setFloat32(int byteOffset, double value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  double getFloat64(int byteOffset, [Endian endian = Endian.big]) =>
-      _data.getFloat64(byteOffset, endian);
-
-  void setFloat64(int byteOffset, double value, [Endian endian = Endian.big]) =>
-      _unsupported();
-
-  int get elementSizeInBytes => _data.elementSizeInBytes;
-
-  int get offsetInBytes => _data.offsetInBytes;
-
-  int get lengthInBytes => _data.lengthInBytes;
-
-  ByteBuffer get buffer => new UnmodifiableByteBufferView(_data.buffer);
-
-  void _unsupported() {
-    throw new UnsupportedError(
-        "An UnmodifiableByteDataView may not be modified");
-  }
-}
-
-abstract class _UnmodifiableListMixin<N, L extends List<N>,
-    TD extends TypedData> {
-  L get _list;
-  TD get _data => (_list as TD);
-
-  int get length => _list.length;
-
-  N operator [](int index) => _list[index];
-
-  int get elementSizeInBytes => _data.elementSizeInBytes;
-
-  int get offsetInBytes => _data.offsetInBytes;
-
-  int get lengthInBytes => _data.lengthInBytes;
-
-  ByteBuffer get buffer => new UnmodifiableByteBufferView(_data.buffer);
-
-  L _createList(int length);
-
-  L sublist(int start, [int? end]) {
-    // NNBD: Spurious error at `end`, `checkValidRange` is legacy.
-    int endIndex = RangeError.checkValidRange(start, end!, length);
-    int sublistLength = endIndex - start;
-    L result = _createList(sublistLength);
-    result.setRange(0, sublistLength, _list, start);
-    return result;
-  }
-}
-
-/**
- * View of a [Uint8List] that disallows modification.
- */
-class UnmodifiableUint8ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Uint8List, Uint8List>
-    implements Uint8List {
-  final Uint8List _list;
-  UnmodifiableUint8ListView(Uint8List list) : _list = list;
-
-  Uint8List _createList(int length) => Uint8List(length);
-}
-
-/**
- * View of a [Int8List] that disallows modification.
- */
-class UnmodifiableInt8ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Int8List, Int8List>
-    implements Int8List {
-  final Int8List _list;
-  UnmodifiableInt8ListView(Int8List list) : _list = list;
-
-  Int8List _createList(int length) => Int8List(length);
-}
-
-/**
- * View of a [Uint8ClampedList] that disallows modification.
- */
-class UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Uint8ClampedList, Uint8ClampedList>
-    implements Uint8ClampedList {
-  final Uint8ClampedList _list;
-  UnmodifiableUint8ClampedListView(Uint8ClampedList list) : _list = list;
-
-  Uint8ClampedList _createList(int length) => Uint8ClampedList(length);
-}
-
-/**
- * View of a [Uint16List] that disallows modification.
- */
-class UnmodifiableUint16ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Uint16List, Uint16List>
-    implements Uint16List {
-  final Uint16List _list;
-  UnmodifiableUint16ListView(Uint16List list) : _list = list;
-
-  Uint16List _createList(int length) => Uint16List(length);
-}
-
-/**
- * View of a [Int16List] that disallows modification.
- */
-class UnmodifiableInt16ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Int16List, Int16List>
-    implements Int16List {
-  final Int16List _list;
-  UnmodifiableInt16ListView(Int16List list) : _list = list;
-
-  Int16List _createList(int length) => Int16List(length);
-}
-
-/**
- * View of a [Uint32List] that disallows modification.
- */
-class UnmodifiableUint32ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Uint32List, Uint32List>
-    implements Uint32List {
-  final Uint32List _list;
-  UnmodifiableUint32ListView(Uint32List list) : _list = list;
-
-  Uint32List _createList(int length) => Uint32List(length);
-}
-
-/**
- * View of a [Int32List] that disallows modification.
- */
-class UnmodifiableInt32ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Int32List, Int32List>
-    implements Int32List {
-  final Int32List _list;
-  UnmodifiableInt32ListView(Int32List list) : _list = list;
-
-  Int32List _createList(int length) => Int32List(length);
-}
-
-/**
- * View of a [Uint64List] that disallows modification.
- */
-class UnmodifiableUint64ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Uint64List, Uint64List>
-    implements Uint64List {
-  final Uint64List _list;
-  UnmodifiableUint64ListView(Uint64List list) : _list = list;
-
-  Uint64List _createList(int length) => Uint64List(length);
-}
-
-/**
- * View of a [Int64List] that disallows modification.
- */
-class UnmodifiableInt64ListView extends UnmodifiableListBase<int>
-    with _UnmodifiableListMixin<int, Int64List, Int64List>
-    implements Int64List {
-  final Int64List _list;
-  UnmodifiableInt64ListView(Int64List list) : _list = list;
-
-  Int64List _createList(int length) => Int64List(length);
-}
-
-/**
- * View of a [Int32x4List] that disallows modification.
- */
-class UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
-    with _UnmodifiableListMixin<Int32x4, Int32x4List, Int32x4List>
-    implements Int32x4List {
-  final Int32x4List _list;
-  UnmodifiableInt32x4ListView(Int32x4List list) : _list = list;
-
-  Int32x4List _createList(int length) => Int32x4List(length);
-}
-
-/**
- * View of a [Float32x4List] that disallows modification.
- */
-class UnmodifiableFloat32x4ListView extends UnmodifiableListBase<Float32x4>
-    with _UnmodifiableListMixin<Float32x4, Float32x4List, Float32x4List>
-    implements Float32x4List {
-  final Float32x4List _list;
-  UnmodifiableFloat32x4ListView(Float32x4List list) : _list = list;
-
-  Float32x4List _createList(int length) => Float32x4List(length);
-}
-
-/**
- * View of a [Float64x2List] that disallows modification.
- */
-class UnmodifiableFloat64x2ListView extends UnmodifiableListBase<Float64x2>
-    with _UnmodifiableListMixin<Float64x2, Float64x2List, Float64x2List>
-    implements Float64x2List {
-  final Float64x2List _list;
-  UnmodifiableFloat64x2ListView(Float64x2List list) : _list = list;
-
-  Float64x2List _createList(int length) => Float64x2List(length);
-}
-
-/**
- * View of a [Float32List] that disallows modification.
- */
-class UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
-    with _UnmodifiableListMixin<double, Float32List, Float32List>
-    implements Float32List {
-  final Float32List _list;
-  UnmodifiableFloat32ListView(Float32List list) : _list = list;
-
-  Float32List _createList(int length) => Float32List(length);
-}
-
-/**
- * View of a [Float64List] that disallows modification.
- */
-class UnmodifiableFloat64ListView extends UnmodifiableListBase<double>
-    with _UnmodifiableListMixin<double, Float64List, Float64List>
-    implements Float64List {
-  final Float64List _list;
-  UnmodifiableFloat64ListView(Float64List list) : _list = list;
-
-  Float64List _createList(int length) => Float64List(length);
-}
diff --git a/sdk_nnbd/lib/vmservice/asset.dart b/sdk_nnbd/lib/vmservice/asset.dart
deleted file mode 100644
index a29984e..0000000
--- a/sdk_nnbd/lib/vmservice/asset.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2015, 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.
-
-part of dart._vmservice;
-
-class Asset {
-  final String name;
-  final Uint8List data;
-
-  Asset(this.name, this.data);
-
-  String get mimeType {
-    final extensionStart = name.lastIndexOf('.');
-    final extension = name.substring(extensionStart + 1);
-    switch (extension) {
-      case 'html':
-        return 'text/html; charset=UTF-8';
-      case 'dart':
-        return 'application/dart; charset=UTF-8';
-      case 'js':
-        return 'application/javascript; charset=UTF-8';
-      case 'css':
-        return 'text/css; charset=UTF-8';
-      case 'gif':
-        return 'image/gif';
-      case 'png':
-        return 'image/png';
-      case 'jpg':
-        return 'image/jpeg';
-      case 'jpeg':
-        return 'image/jpeg';
-      case 'svg':
-        return 'image/svg+xml';
-      default:
-        return 'text/plain';
-    }
-  }
-
-  static Map<String, Asset>? request() {
-    Uint8List? tarBytes = _requestAssets();
-    if (tarBytes == null) {
-      return null;
-    }
-    List assetList = _decodeAssets(tarBytes);
-    Map<String, Asset> assets = new HashMap<String, Asset>();
-    for (int i = 0; i < assetList.length; i += 2) {
-      final a = Asset(assetList[i], assetList[i + 1]);
-      assets[a.name] = a;
-    }
-    return assets;
-  }
-
-  String toString() => '$name ($mimeType)';
-}
-
-List _decodeAssets(Uint8List data) native 'VMService_DecodeAssets';
-
-Map<String, Asset>? _assets;
-Map<String, Asset> get assets {
-  if (_assets == null) {
-    try {
-      _assets = Asset.request();
-    } catch (e) {
-      print('Could not load Observatory assets: $e');
-    }
-  }
-  return _assets!;
-}
diff --git a/sdk_nnbd/lib/vmservice/client.dart b/sdk_nnbd/lib/vmservice/client.dart
deleted file mode 100644
index 65a72ba..0000000
--- a/sdk_nnbd/lib/vmservice/client.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._vmservice;
-
-typedef void ClientServiceHandle(Message? response);
-
-// A service client.
-abstract class Client {
-  final VMService service;
-  final bool sendEvents;
-
-  static int _idCounter = 0;
-  final int _id = ++_idCounter;
-
-  String get defaultClientName => 'client$_id';
-
-  String get name => _name;
-  set name(String? n) => _name = (n ?? defaultClientName);
-  late String _name;
-
-  /// A set streamIds which describes the streams the client is connected to
-  final streams = <String>{};
-
-  /// Services registered and their aliases
-  /// key: service
-  /// value: alias
-  final services = <String, String>{};
-
-  /// Callbacks registered for service invocations set to the client
-  /// key: RPC id used for the request
-  /// value: callback that should be invoked
-  final serviceHandles = <String, ClientServiceHandle>{};
-
-  Client(this.service, {this.sendEvents = true}) {
-    _name = defaultClientName;
-    service._addClient(this);
-  }
-
-  // Disconnects the client.
-  disconnect();
-
-  /// When implementing, call [close] when the network connection closes.
-  void close() => service._removeClient(this);
-
-  /// Call to process a request. Response will be posted with 'seq'.
-  void onRequest(Message message) =>
-      // In JSON-RPC 2.0 messages with and id are Request and must be answered
-      // http://www.jsonrpc.org/specification#notification
-      service.routeRequest(service, message).then(post);
-
-  void onResponse(Message message) => service.routeResponse(message);
-
-  /// Call to process a notification. Response will not be posted.
-  void onNotification(Message message) =>
-      // In JSON-RPC 2.0 messages without an id are Notification
-      // and should not be answered
-      // http://www.jsonrpc.org/specification#notification
-      service.routeRequest(service, message);
-
-  // Sends a result to the client. Implemented in subclasses.
-  //
-  // Null can be passed as response to a JSON-RPC notification to close the
-  // connection.
-  void post(Response? result);
-
-  Map<String, dynamic> toJson() => {};
-}
diff --git a/sdk_nnbd/lib/vmservice/constants.dart b/sdk_nnbd/lib/vmservice/constants.dart
deleted file mode 100644
index 914576b..0000000
--- a/sdk_nnbd/lib/vmservice/constants.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._vmservice;
-
-// These must be kept in sync with runtime/vm/service.cc.
-class Constants {
-  static const int SERVICE_EXIT_MESSAGE_ID = 0;
-  static const int ISOLATE_STARTUP_MESSAGE_ID = 1;
-  static const int ISOLATE_SHUTDOWN_MESSAGE_ID = 2;
-  static const int WEB_SERVER_CONTROL_MESSAGE_ID = 3;
-  static const int SERVER_INFO_MESSAGE_ID = 4;
-
-  /// Signals an RPC coming from native code (instead of from a websocket
-  /// connection).  These calls are limited to simple request-response and do
-  /// not allow arbitrary json-rpc messages.
-  ///
-  /// The messages are an array of length 3:
-  ///   (METHOD_CALL_FROM_NATIVE, String jsonRequest, PortId replyPort).
-  static const int METHOD_CALL_FROM_NATIVE = 5;
-}
diff --git a/sdk_nnbd/lib/vmservice/devfs.dart b/sdk_nnbd/lib/vmservice/devfs.dart
deleted file mode 100644
index 3463d6c..0000000
--- a/sdk_nnbd/lib/vmservice/devfs.dart
+++ /dev/null
@@ -1,394 +0,0 @@
-// Copyright (c) 2016, 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.
-
-part of dart._vmservice;
-
-String _encodeDevFSDisabledError(Message message) =>
-    encodeRpcError(message, kFeatureDisabled,
-        details: 'DevFS is not supported by this Dart implementation');
-
-String _encodeFileSystemAlreadyExistsError(Message message, String fsName) =>
-    encodeRpcError(message, kFileSystemAlreadyExists,
-        details: "${message.method}: file system '${fsName}' already exists");
-
-String _encodeFileSystemDoesNotExistError(Message message, String fsName) =>
-    encodeRpcError(message, kFileSystemDoesNotExist,
-        details: "${message.method}: file system '${fsName}' does not exist");
-
-class _FileSystem {
-  _FileSystem(this.name, this.uri);
-
-  final String name;
-  final Uri uri;
-
-  Uri? resolvePath(String path) {
-    if (path.startsWith('/')) {
-      path = path.substring(1);
-    }
-    if (path.isEmpty) {
-      return null;
-    }
-    Uri pathUri;
-    try {
-      pathUri = Uri.file(path);
-      // ignore: unused_catch_clause
-    } on FormatException catch (_) {
-      return null;
-    }
-
-    return resolve(pathUri);
-  }
-
-  Uri? resolve(Uri pathUri) {
-    try {
-      // Make sure that this pathUri can be converted to a file path.
-      pathUri.toFilePath();
-      // ignore: unused_catch_clause
-    } on UnsupportedError catch (_) {
-      return null;
-    }
-
-    final resolvedUri = uri.resolveUri(pathUri);
-    if (!resolvedUri.toString().startsWith(uri.toString())) {
-      // Resolved uri must be within the filesystem's base uri.
-      return null;
-    }
-    return resolvedUri;
-  }
-
-  Map<String, String> toMap() => {
-        'type': 'FileSystem',
-        'name': name,
-        'uri': uri.toString(),
-      };
-}
-
-class DevFS {
-  DevFS();
-
-  final _fsMap = <String, _FileSystem>{};
-
-  final _rpcNames = <String>{
-    '_listDevFS',
-    '_createDevFS',
-    '_deleteDevFS',
-    '_readDevFSFile',
-    '_writeDevFSFile',
-    '_writeDevFSFiles',
-    '_listDevFSFiles',
-  };
-
-  void cleanup() {
-    final deleteDir = VMServiceEmbedderHooks.deleteDir;
-    if (deleteDir == null) {
-      return;
-    }
-    final deletions = <Future>[
-      for (final fs in _fsMap.values) deleteDir(fs.uri),
-    ];
-    Future.wait(deletions);
-    _fsMap.clear();
-  }
-
-  bool shouldHandleMessage(Message message) =>
-      _rpcNames.contains(message.method);
-
-  Future<String> handleMessage(Message message) async {
-    switch (message.method!) {
-      case '_listDevFS':
-        return _listDevFS(message);
-      case '_createDevFS':
-        return _createDevFS(message);
-      case '_deleteDevFS':
-        return _deleteDevFS(message);
-      case '_readDevFSFile':
-        return _readDevFSFile(message);
-      case '_writeDevFSFile':
-        return _writeDevFSFile(message);
-      case '_writeDevFSFiles':
-        return _writeDevFSFiles(message);
-      case '_listDevFSFiles':
-        return _listDevFSFiles(message);
-      default:
-        return encodeRpcError(message, kInternalError,
-            details: 'Unexpected rpc ${message.method}');
-    }
-  }
-
-  Future<String> handlePutStream(
-      Object? fsName, Object? path, Uri? fsUri, Stream<List<int>> bytes) async {
-    // A dummy Message for error message construction.
-    final message = Message.forMethod('_writeDevFSFile');
-    final writeStreamFile = VMServiceEmbedderHooks.writeStreamFile;
-    if (writeStreamFile == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    var fs = _fsMap[fsName];
-    if (fs == null) {
-      return _encodeFileSystemDoesNotExistError(message, fsName);
-    }
-    Uri? uri = fsUri;
-    if (uri == null) {
-      if (path == null) {
-        return encodeMissingParamError(message, 'path');
-      }
-      if (path is! String) {
-        return encodeInvalidParamError(message, 'path');
-      }
-      uri = fs.resolvePath(path);
-      if (uri == null) {
-        return encodeInvalidParamError(message, 'path');
-      }
-    } else {
-      uri = fs.resolve(uri);
-      if (uri == null) {
-        return encodeInvalidParamError(message, 'uri');
-      }
-    }
-    await writeStreamFile(uri, bytes);
-    return encodeSuccess(message);
-  }
-
-  Future<String> _listDevFS(Message message) async {
-    final result = <String, dynamic>{};
-    result['type'] = 'FileSystemList';
-    result['fsNames'] = _fsMap.keys.toList();
-    return encodeResult(message, result);
-  }
-
-  Future<String> _createDevFS(Message message) async {
-    final createTempDir = VMServiceEmbedderHooks.createTempDir;
-    if (createTempDir == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    final fsName = message.params['fsName'];
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    _FileSystem? fs = _fsMap[fsName];
-    if (fs != null) {
-      return _encodeFileSystemAlreadyExistsError(message, fsName);
-    }
-    final tempDir = await createTempDir(fsName);
-    fs = _FileSystem(fsName, tempDir);
-    _fsMap[fsName] = fs;
-    return encodeResult(message, fs.toMap());
-  }
-
-  Future<String> _deleteDevFS(Message message) async {
-    final deleteDir = VMServiceEmbedderHooks.deleteDir;
-    if (deleteDir == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    final fsName = message.params['fsName'];
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    final fs = _fsMap.remove(fsName);
-    if (fs == null) {
-      return _encodeFileSystemDoesNotExistError(message, fsName);
-    }
-    await deleteDir(fs.uri);
-    return encodeSuccess(message);
-  }
-
-  Future<String> _readDevFSFile(Message message) async {
-    final readFile = VMServiceEmbedderHooks.readFile;
-    if (readFile == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    final fsName = message.params['fsName'];
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    final fs = _fsMap[fsName];
-    if (fs == null) {
-      return _encodeFileSystemDoesNotExistError(message, fsName);
-    }
-    Uri? uri;
-    if (message.params['uri'] != null) {
-      try {
-        final uriParam = message.params['uri'];
-        if (uriParam is! String) {
-          return encodeInvalidParamError(message, 'uri');
-        }
-        final parsedUri = Uri.parse(uriParam);
-        uri = fs.resolve(parsedUri);
-        if (uri == null) {
-          return encodeInvalidParamError(message, 'uri');
-        }
-      } catch (e) {
-        return encodeInvalidParamError(message, 'uri');
-      }
-    } else {
-      final path = message.params['path'];
-      if (path == null) {
-        return encodeMissingParamError(message, 'path');
-      }
-      if (path is! String) {
-        return encodeInvalidParamError(message, 'path');
-      }
-      uri = fs.resolvePath(path);
-      if (uri == null) {
-        return encodeInvalidParamError(message, 'path');
-      }
-    }
-    try {
-      final bytes = await readFile(uri);
-      final result = {'type': 'FSFile', 'fileContents': base64.encode(bytes)};
-      return encodeResult(message, result);
-    } catch (e) {
-      return encodeRpcError(message, kFileDoesNotExist,
-          details: '_readDevFSFile: $e');
-    }
-  }
-
-  Future<String> _writeDevFSFile(Message message) async {
-    final writeFile = VMServiceEmbedderHooks.writeFile;
-    if (writeFile == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    final fsName = message.params['fsName'];
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    final fs = _fsMap[fsName];
-    if (fs == null) {
-      return _encodeFileSystemDoesNotExistError(message, fsName);
-    }
-    Uri? uri;
-    if (message.params['uri'] != null) {
-      try {
-        final uriParam = message.params['uri'];
-        if (uriParam is! String) {
-          return encodeInvalidParamError(message, 'uri');
-        }
-        final parsedUri = Uri.parse(uriParam);
-        uri = fs.resolve(parsedUri);
-        if (uri == null) {
-          return encodeInvalidParamError(message, 'uri');
-        }
-      } catch (e) {
-        return encodeInvalidParamError(message, 'uri');
-      }
-    } else {
-      final path = message.params['path'];
-      if (path == null) {
-        return encodeMissingParamError(message, 'path');
-      }
-      if (path is! String) {
-        return encodeInvalidParamError(message, 'path');
-      }
-      uri = fs.resolvePath(path);
-      if (uri == null) {
-        return encodeInvalidParamError(message, 'path');
-      }
-    }
-    final fileContents = message.params['fileContents'];
-    if (fileContents == null) {
-      return encodeMissingParamError(message, 'fileContents');
-    }
-    if (fileContents is! String) {
-      return encodeInvalidParamError(message, 'fileContents');
-    }
-    final decodedFileContents = base64.decode(fileContents);
-
-    await writeFile(uri, decodedFileContents);
-    return encodeSuccess(message);
-  }
-
-  Future<String> _writeDevFSFiles(Message message) async {
-    final writeFile = VMServiceEmbedderHooks.writeFile;
-    if (writeFile == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    final fsName = message.params['fsName'];
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    final fs = _fsMap[fsName];
-    if (fs == null) {
-      return _encodeFileSystemDoesNotExistError(message, fsName);
-    }
-    final files = message.params['files'];
-    if (files == null) {
-      return encodeMissingParamError(message, 'files');
-    }
-    if (files is! List) {
-      return encodeInvalidParamError(message, 'files');
-    }
-    final uris = <Uri>[];
-    for (int i = 0; i < files.length; i++) {
-      final fileInfo = files[i];
-      if (fileInfo is! List ||
-          fileInfo.length != 2 ||
-          fileInfo[0] is! String ||
-          fileInfo[1] is! String) {
-        return encodeRpcError(message, kInvalidParams,
-            details: "${message.method}: invalid 'files' parameter "
-                "at index ${i}: ${fileInfo}");
-      }
-      final uri = fs.resolvePath(fileInfo[0]);
-      if (uri == null) {
-        return encodeRpcError(message, kInvalidParams,
-            details: "${message.method}: invalid 'files' parameter "
-                "at index ${i}: ${fileInfo}");
-      }
-      uris.add(uri);
-    }
-    final pendingWrites = <Future>[];
-    for (int i = 0; i < uris.length; i++) {
-      final decodedFileContents = base64.decode(files[i][1]);
-      pendingWrites.add(writeFile(uris[i], decodedFileContents));
-    }
-    await Future.wait(pendingWrites);
-    return encodeSuccess(message);
-  }
-
-  Future<String> _listDevFSFiles(Message message) async {
-    final listFiles = VMServiceEmbedderHooks.listFiles;
-    if (listFiles == null) {
-      return _encodeDevFSDisabledError(message);
-    }
-    final fsName = message.params['fsName'];
-    if (fsName == null) {
-      return encodeMissingParamError(message, 'fsName');
-    }
-    if (fsName is! String) {
-      return encodeInvalidParamError(message, 'fsName');
-    }
-    final fs = _fsMap[fsName];
-    if (fs == null) {
-      return _encodeFileSystemDoesNotExistError(message, fsName);
-    }
-    final fileList = await listFiles(fs.uri);
-    // Remove any url-encoding in the filenames.
-    for (int i = 0; i < fileList.length; i++) {
-      fileList[i]['name'] = Uri.decodeFull(fileList[i]['name']);
-    }
-    final result = <String, dynamic>{'type': 'FSFileList', 'files': fileList};
-    return encodeResult(message, result);
-  }
-}
diff --git a/sdk_nnbd/lib/vmservice/message.dart b/sdk_nnbd/lib/vmservice/message.dart
deleted file mode 100644
index ee29fe3..0000000
--- a/sdk_nnbd/lib/vmservice/message.dart
+++ /dev/null
@@ -1,254 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._vmservice;
-
-enum MessageType { Request, Notification, Response }
-
-class Message {
-  final _completer = Completer<Response>.sync();
-  bool get completed => _completer.isCompleted;
-
-  /// Future of response.
-  Future<Response> get response => _completer.future;
-  Client? client;
-
-  // Is a notification message (no serial)
-  final MessageType type;
-
-  // Client-side identifier for this message.
-  final serial;
-
-  final String? method;
-
-  final params = <String, dynamic>{};
-  final result = {};
-  final error = {};
-
-  factory Message.fromJsonRpc(Client? client, Map map) {
-    if (map.containsKey('id')) {
-      final id = map['id'];
-      if (id != null && id is! num && id is! String) {
-        throw Exception("'id' must be a number, string, or null.");
-      }
-      if (map.containsKey('method')) {
-        return Message._fromJsonRpcRequest(client, map);
-      }
-      if (map.containsKey('result')) {
-        return Message._fromJsonRpcResult(client, map);
-      }
-      if (map.containsKey('error')) {
-        return Message._fromJsonRpcError(client, map);
-      }
-    } else if (map.containsKey('method')) {
-      return Message._fromJsonRpcNotification(client, map);
-    }
-    throw Exception('Invalid message format');
-  }
-
-  // http://www.jsonrpc.org/specification#request_object
-  Message._fromJsonRpcRequest(Client? client, Map map)
-      : client = client,
-        type = MessageType.Request,
-        serial = map['id'],
-        method = map['method'] {
-    if (map['params'] != null) {
-      params.addAll(map['params']);
-    }
-  }
-
-  // http://www.jsonrpc.org/specification#notification
-  Message._fromJsonRpcNotification(Client? client, Map map)
-      : client = client,
-        type = MessageType.Notification,
-        method = map['method'],
-        serial = null {
-    if (map['params'] != null) {
-      params.addAll(map['params']);
-    }
-  }
-
-  // http://www.jsonrpc.org/specification#response_object
-  Message._fromJsonRpcResult(Client? client, Map map)
-      : client = client,
-        type = MessageType.Response,
-        serial = map['id'],
-        method = null {
-    result.addAll(map['result']);
-  }
-
-  // http://www.jsonrpc.org/specification#response_object
-  Message._fromJsonRpcError(Client? client, Map map)
-      : client = client,
-        type = MessageType.Response,
-        serial = map['id'],
-        method = null {
-    error.addAll(map['error']);
-  }
-
-  static String _methodNameFromUri(Uri uri) {
-    if (uri == null || uri.pathSegments.length == 0) {
-      return '';
-    }
-    return uri.pathSegments[0];
-  }
-
-  Message.forMethod(String method)
-      : client = null,
-        method = method,
-        type = MessageType.Request,
-        serial = '';
-
-  Message.fromUri(this.client, Uri uri)
-      : type = MessageType.Request,
-        serial = '',
-        method = _methodNameFromUri(uri) {
-    params.addAll(uri.queryParameters);
-  }
-
-  Message.forIsolate(this.client, Uri uri, RunningIsolate isolate)
-      : type = MessageType.Request,
-        serial = '',
-        method = _methodNameFromUri(uri) {
-    params.addAll(uri.queryParameters);
-    params['isolateId'] = isolate.serviceId;
-  }
-
-  Uri toUri() => Uri(path: method!, queryParameters: params);
-
-  dynamic toJson() => throw 'unsupported';
-
-  Map<String, dynamic> forwardToJson([Map<String, dynamic>? overloads]) {
-    final json = <String, dynamic>{'jsonrpc': '2.0', 'id': serial};
-    switch (type) {
-      case MessageType.Request:
-      case MessageType.Notification:
-        json['method'] = method;
-        if (params.isNotEmpty) {
-          json['params'] = params;
-        }
-        break;
-      case MessageType.Response:
-        if (result.isNotEmpty) {
-          json['result'] = result;
-        }
-        if (error.isNotEmpty) {
-          json['error'] = error;
-        }
-    }
-    if (overloads != null) {
-      json.addAll(overloads);
-    }
-    return json;
-  }
-
-  // Calls toString on all non-String elements of [list]. We do this so all
-  // elements in the list are strings, making consumption by C++ simpler.
-  // This has a side effect that boolean literal values like true become 'true'
-  // and thus indistinguishable from the string literal 'true'.
-  List<String> _makeAllString(List list) {
-    var new_list = List<String>.filled(list.length, "");
-    for (var i = 0; i < list.length; i++) {
-      new_list[i] = list[i].toString();
-    }
-    return new_list;
-  }
-
-  Future<Response> sendToIsolate(SendPort sendPort) {
-    final receivePort = RawReceivePort();
-    receivePort.handler = (value) {
-      receivePort.close();
-      _setResponseFromPort(value);
-    };
-    final keys = _makeAllString(params.keys.toList(growable: false));
-    final values = _makeAllString(params.values.toList(growable: false));
-    final request = List<dynamic>.filled(6, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = receivePort.sendPort
-      ..[2] = serial
-      ..[3] = method
-      ..[4] = keys
-      ..[5] = values;
-    if (!sendIsolateServiceMessage(sendPort, request)) {
-      receivePort.close();
-      _completer.complete(Response.internalError(
-          'could not send message [${serial}] to isolate'));
-    }
-    return _completer.future;
-  }
-
-  // We currently support two ways of passing parameters from Dart code to C
-  // code. The original way always converts the parameters to strings before
-  // passing them over. Our goal is to convert all C handlers to take the
-  // parameters as Dart objects but until the conversion is complete, we
-  // maintain the list of supported methods below.
-  bool _methodNeedsObjectParameters(String method) {
-    switch (method) {
-      case '_listDevFS':
-      case '_listDevFSFiles':
-      case '_createDevFS':
-      case '_deleteDevFS':
-      case '_writeDevFSFile':
-      case '_writeDevFSFiles':
-      case '_readDevFSFile':
-      case '_spawnUri':
-        return true;
-      default:
-        return false;
-    }
-  }
-
-  Future<Response> sendToVM() {
-    final receivePort = RawReceivePort();
-    receivePort.handler = (value) {
-      receivePort.close();
-      _setResponseFromPort(value);
-    };
-    var keys = params.keys.toList(growable: false);
-    var values = params.values.toList(growable: false);
-    if (!_methodNeedsObjectParameters(method!)) {
-      keys = _makeAllString(keys);
-      values = _makeAllString(values);
-    }
-    final request = List<dynamic>.filled(6, null)
-      ..[0] = 0 // Make room for OOB message type.
-      ..[1] = receivePort.sendPort
-      ..[2] = serial
-      ..[3] = method
-      ..[4] = keys
-      ..[5] = values;
-
-    if (_methodNeedsObjectParameters(method!)) {
-      // We use a different method invocation path here.
-      sendObjectRootServiceMessage(request);
-    } else {
-      sendRootServiceMessage(request);
-    }
-
-    return _completer.future;
-  }
-
-  void _setResponseFromPort(dynamic response) {
-    if (response == null) {
-      // We should only have a null response for Notifications.
-      assert(type == MessageType.Notification);
-      return null;
-    }
-    _completer.complete(Response.from(response));
-  }
-
-  void setResponse(String response) =>
-      _completer.complete(Response(ResponsePayloadKind.String, response));
-
-  void setErrorResponse(int code, String details) =>
-      setResponse(encodeRpcError(this, code, details: '$method: $details'));
-}
-
-bool sendIsolateServiceMessage(SendPort sp, List m)
-    native 'VMService_SendIsolateServiceMessage';
-
-void sendRootServiceMessage(List m) native 'VMService_SendRootServiceMessage';
-
-void sendObjectRootServiceMessage(List m)
-    native 'VMService_SendObjectRootServiceMessage';
diff --git a/sdk_nnbd/lib/vmservice/message_router.dart b/sdk_nnbd/lib/vmservice/message_router.dart
deleted file mode 100644
index 2ca8d4f..0000000
--- a/sdk_nnbd/lib/vmservice/message_router.dart
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._vmservice;
-
-abstract class MessageRouter {
-  Future<Response?> routeRequest(VMService service, Message message);
-  void routeResponse(Message message);
-}
-
-enum ResponsePayloadKind {
-  /// Response payload is a Dart string.
-  String,
-
-  /// Response payload is a binary (Uint8List).
-  Binary,
-
-  /// Response payload is a string encoded as UTF8 bytes (Uint8List).
-  Utf8String,
-}
-
-class Response {
-  final ResponsePayloadKind kind;
-  final payload;
-
-  /// Construct response object with the given [payload] and [kind].
-  Response(this.kind, this.payload) {
-    assert(() {
-      switch (kind) {
-        case ResponsePayloadKind.String:
-          return payload is String;
-        case ResponsePayloadKind.Binary:
-        case ResponsePayloadKind.Utf8String:
-          return payload is Uint8List;
-        default:
-          return false;
-      }
-    }());
-  }
-
-  /// Construct a string response from the given [value] by encoding it
-  /// as JSON.
-  Response.json(Object value)
-      : this(ResponsePayloadKind.String, json.encode(value));
-
-  factory Response.internalError(String message) => Response.json({
-        'type': 'ServiceError',
-        'id': '',
-        'kind': 'InternalError',
-        'message': message,
-      });
-
-  /// Construct response from the response [value] which can be either:
-  ///     String: a string
-  ///     Binary: a Uint8List
-  ///     Utf8String: a single element list containing Uint8List
-  factory Response.from(Object value) {
-    if (value is String) {
-      return Response(ResponsePayloadKind.String, value);
-    } else if (value is Uint8List) {
-      return Response(ResponsePayloadKind.Binary, value);
-    } else if (value is List) {
-      assert(value.length == 1);
-      return Response(ResponsePayloadKind.Utf8String, value[0] as Uint8List);
-    } else if (value is Response) {
-      return value;
-    } else {
-      throw 'Unrecognized response: ${value}';
-    }
-  }
-
-  /// Decode JSON contained in this response.
-  dynamic decodeJson() {
-    switch (kind) {
-      case ResponsePayloadKind.String:
-        return json.decode(payload);
-      case ResponsePayloadKind.Utf8String:
-        return json.fuse(utf8).decode(payload);
-      case ResponsePayloadKind.Binary:
-        throw 'Binary responses can not be decoded';
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/vmservice/named_lookup.dart b/sdk_nnbd/lib/vmservice/named_lookup.dart
deleted file mode 100644
index d611c3d..0000000
--- a/sdk_nnbd/lib/vmservice/named_lookup.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2017, 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.
-
-part of dart._vmservice;
-
-/// Set like containes which automatically generated String ids for its items
-class NamedLookup<E extends Object> extends Object with IterableMixin<E> {
-  final IdGenerator _generator;
-  final _elements = <String, E>{};
-  final _ids = <E, String>{};
-
-  NamedLookup({String prologue = ''})
-      : _generator = IdGenerator(prologue: prologue);
-
-  void add(E e) {
-    final id = _generator.newId();
-    _elements[id] = e;
-    _ids[e] = id;
-  }
-
-  void remove(E e) {
-    final id = _ids.remove(e)!;
-    _elements.remove(id);
-    _generator.release(id);
-  }
-
-  E operator [](String id) => _elements[id]!;
-  String keyOf(E e) => _ids[e]!;
-
-  Iterator<E> get iterator => _ids.keys.iterator;
-}
-
-/// Generator for unique ids which recycles expired ones
-class IdGenerator {
-  /// Fixed initial part of the id
-  final String prologue;
-  // Ids in use
-  final _used = <String>{};
-
-  /// Ids that has been released (use these before generate new ones)
-  final _free = <String>{};
-
-  /// Next id to generate if no one can be recycled (first use _free);
-  int _next = 0;
-
-  IdGenerator({this.prologue = ''});
-
-  /// Returns a new Id (possibly recycled)
-  String newId() {
-    var id;
-    if (_free.isEmpty) {
-      id = prologue + (_next++).toString();
-    } else {
-      id = _free.first;
-    }
-    _free.remove(id);
-    _used.add(id);
-    return id;
-  }
-
-  /// Releases the id and mark it for recycle
-  void release(String id) {
-    if (_used.remove(id)) {
-      _free.add(id);
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/vmservice/running_isolate.dart b/sdk_nnbd/lib/vmservice/running_isolate.dart
deleted file mode 100644
index 029c6aa..0000000
--- a/sdk_nnbd/lib/vmservice/running_isolate.dart
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._vmservice;
-
-class RunningIsolate implements MessageRouter {
-  final int portId;
-  final SendPort sendPort;
-  final String name;
-  final Set<String> _resumeApprovalsByName = {};
-
-  RunningIsolate(this.portId, this.sendPort, this.name);
-
-  String get serviceId => 'isolates/$portId';
-
-  static const kInvalidPauseEvent = -1;
-  static const kPauseOnStartMask = 1 << 0;
-  static const kPauseOnReloadMask = 1 << 1;
-  static const kPauseOnExitMask = 1 << 2;
-  static const kDefaultResumePermissionMask =
-      kPauseOnStartMask | kPauseOnReloadMask | kPauseOnExitMask;
-
-  /// Resumes the isolate if all clients which need to approve a resume have
-  /// done so. Called when the last client of a given name disconnects or
-  /// changes name to ensure we don't deadlock waiting for approval to resume
-  /// from a disconnected client.
-  Future<void> maybeResumeAfterClientChange(
-      VMService service, String disconnectedClientName) async {
-    // Remove approvals from the disconnected client.
-    _resumeApprovalsByName.remove(disconnectedClientName);
-
-    // If we've received approval to resume from all clients who care, clear
-    // approval state and resume.
-    var pauseType;
-    try {
-      pauseType = await _isolatePauseType(service, portId.toString());
-    } catch (_errorResponse) {
-      // ignore errors when attempting to retrieve isolate pause type
-      return;
-    }
-    if (pauseType != kInvalidPauseEvent &&
-        _shouldResume(service, null, pauseType)) {
-      _resumeApprovalsByName.clear();
-      await Message.forMethod('resume')
-        ..params.addAll({
-          'isolateId': portId,
-        })
-        ..sendToIsolate(sendPort);
-    }
-  }
-
-  bool _shouldResume(VMService service, Client? client, int pauseType) {
-    if (client != null) {
-      // Mark the approval by the client.
-      _resumeApprovalsByName.add(client.name);
-    }
-    final requiredClientApprovals = <String>{};
-    final permissions = service.clientResumePermissions;
-
-    // Determine which clients require approval for this pause type.
-    permissions.forEach((name, clientNamePermissions) {
-      if (clientNamePermissions.permissionsMask & pauseType != 0) {
-        requiredClientApprovals.add(name);
-      }
-    });
-
-    // We require at least a single client to resume, even if that client
-    // doesn't require resume approval.
-    if (_resumeApprovalsByName.isEmpty) {
-      return false;
-    }
-
-    // If all the required approvals are present, we should resume.
-    return _resumeApprovalsByName.containsAll(requiredClientApprovals);
-  }
-
-  Future<int> _isolatePauseType(VMService service, String isolateId) async {
-    final getIsolateMessage = Message.forMethod('getIsolate')
-      ..params.addAll({
-        'isolateId': isolateId,
-      });
-    final Response result = await routeRequest(service, getIsolateMessage);
-    final resultJson = result.decodeJson();
-    if (resultJson['result'] == null ||
-        resultJson['result']['pauseEvent'] == null) {
-      // Failed to send getIsolate message(due to isolate being de-registered
-      // for example).
-      throw result;
-    }
-    final pauseEvent = resultJson['result']['pauseEvent'];
-    const pauseEvents = <String, int>{
-      'PauseStart': kPauseOnStartMask,
-      'PausePostRequest': kPauseOnReloadMask,
-      'PauseExit': kPauseOnExitMask,
-    };
-    final kind = pauseEvent['kind'];
-    return pauseEvents[kind] ?? kInvalidPauseEvent;
-  }
-
-  Future<Response> _routeResumeRequest(
-      VMService service, Message message) async {
-    // If we've received approval to resume from all clients who care, clear
-    // approval state and resume.
-    var pauseType;
-    try {
-      pauseType = await _isolatePauseType(service, message.params['isolateId']);
-    } on Response catch (errorResponse) {
-      return errorResponse;
-    }
-    if (pauseType == kInvalidPauseEvent ||
-        _shouldResume(service, message.client, pauseType)) {
-      _resumeApprovalsByName.clear();
-      return message.sendToIsolate(sendPort);
-    }
-
-    // We're still awaiting some approvals. Simply return success, but don't
-    // resume yet.
-    return Response(ResponsePayloadKind.String, encodeSuccess(message));
-  }
-
-  @override
-  Future<Response> routeRequest(VMService service, Message message) {
-    if (message.method == 'resume') {
-      return _routeResumeRequest(service, message);
-    }
-    // Send message to isolate.
-    return message.sendToIsolate(sendPort);
-  }
-
-  @override
-  void routeResponse(Message message) {}
-}
diff --git a/sdk_nnbd/lib/vmservice/running_isolates.dart b/sdk_nnbd/lib/vmservice/running_isolates.dart
deleted file mode 100644
index 20ab8a2..0000000
--- a/sdk_nnbd/lib/vmservice/running_isolates.dart
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright (c) 2013, 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.
-
-part of dart._vmservice;
-
-class RunningIsolates implements MessageRouter {
-  final isolates = <int, RunningIsolate>{};
-  int? _rootPortId;
-
-  RunningIsolates();
-
-  void isolateStartup(int portId, SendPort sp, String name) {
-    if (_rootPortId == null) {
-      _rootPortId = portId;
-    }
-    var ri = RunningIsolate(portId, sp, name);
-    isolates[portId] = ri;
-  }
-
-  void isolateShutdown(int portId, SendPort sp) {
-    if (_rootPortId == portId) {
-      _rootPortId = null;
-    }
-    isolates.remove(portId);
-  }
-
-  @override
-  Future<Response> routeRequest(VMService service, Message message) {
-    String isolateParam = message.params['isolateId']!;
-    int isolateId;
-    if (!isolateParam.startsWith('isolates/')) {
-      message.setErrorResponse(
-          kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
-      return message.response;
-    }
-    isolateParam = isolateParam.substring('isolates/'.length);
-    if (isolateParam == 'root') {
-      isolateId = _rootPortId!;
-    } else {
-      try {
-        isolateId = int.parse(isolateParam);
-      } catch (e) {
-        message.setErrorResponse(
-            kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
-        return message.response;
-      }
-    }
-    final isolate = isolates[isolateId];
-    if (isolate == null) {
-      // There is some chance that this isolate may have lived before,
-      // so return a sentinel rather than an error.
-      final result = <String, String>{
-        'type': 'Sentinel',
-        'kind': 'Collected',
-        'valueAsString': '<collected>',
-      };
-      message.setResponse(encodeResult(message, result));
-      return message.response;
-    }
-
-    if (message.method == 'evaluateInFrame' || message.method == 'evaluate') {
-      return _Evaluator(message, isolate, service).run();
-    } else {
-      return isolate.routeRequest(service, message);
-    }
-  }
-
-  @override
-  void routeResponse(Message message) {}
-}
-
-/// Class that knows how to orchestrate expression evaluation in dart2 world.
-class _Evaluator {
-  _Evaluator(this._message, this._isolate, this._service);
-
-  Future<Response> run() async {
-    if (_service.ddsUri != null) {
-      return Response.from(encodeRpcError(
-        _message,
-        kInternalError,
-        details: 'Fell through to VM Service expression evaluation when a DDS '
-            'instance was connected. Please file an issue on GitHub.',
-      ));
-    }
-    final buildScopeResponse = await _buildScope();
-    final responseJson = buildScopeResponse.decodeJson();
-
-    if (responseJson.containsKey('error')) {
-      return Response.from(encodeCompilationError(
-          _message, responseJson['error']['data']['details']));
-    }
-
-    String kernelBase64;
-    try {
-      kernelBase64 = await _compileExpression(responseJson['result']);
-    } catch (e) {
-      return Response.from(encodeCompilationError(_message, e.toString()));
-    }
-    return await _evaluateCompiledExpression(kernelBase64);
-  }
-
-  Message _message;
-  RunningIsolate _isolate;
-  VMService _service;
-
-  Future<Response> _buildScope() {
-    final params = _setupParams();
-    params['isolateId'] = _message.params['isolateId'];
-    final buildScopeParams = <String, dynamic>{
-      'method': '_buildExpressionEvaluationScope',
-      'id': _message.serial,
-      'params': params,
-    };
-    if (_message.params['scope'] != null) {
-      buildScopeParams['params']['scope'] = _message.params['scope'];
-    }
-    final buildScope =
-        Message._fromJsonRpcRequest(_message.client!, buildScopeParams);
-
-    // Decode the JSON and and insert it into the map. The map key
-    // is the request Uri.
-    return _isolate.routeRequest(_service, buildScope);
-  }
-
-  Future<String> _compileExpression(
-      Map<String, dynamic> buildScopeResponseResult) {
-    Client? externalClient =
-        _service._findFirstClientThatHandlesService('compileExpression');
-
-    final compileParams = <String, dynamic>{
-      'isolateId': _message.params['isolateId']!,
-      'expression': _message.params['expression']!,
-      'definitions': buildScopeResponseResult['param_names']!,
-      'typeDefinitions': buildScopeResponseResult['type_params_names']!,
-      'libraryUri': buildScopeResponseResult['libraryUri']!,
-      'isStatic': buildScopeResponseResult['isStatic']!,
-    };
-    final klass = buildScopeResponseResult['klass'];
-    if (klass != null) {
-      compileParams['klass'] = klass;
-    }
-    if (externalClient != null) {
-      final compileExpression = Message.forMethod('compileExpression');
-      compileExpression.client = externalClient;
-      compileExpression.params.addAll(compileParams);
-
-      final id = _service._serviceRequests.newId();
-      final oldId = _message.serial;
-      final completer = Completer<String>();
-      externalClient.serviceHandles[id] = (Message? m) {
-        if (m != null) {
-          completer.complete(json.encode(m.forwardToJson({'id': oldId})));
-        } else {
-          completer.complete(encodeRpcError(_message, kServiceDisappeared));
-        }
-      };
-      externalClient.post(Response.json(compileExpression
-          .forwardToJson({'id': id, 'method': 'compileExpression'})));
-      return completer.future.then((s) => jsonDecode(s)).then((json) {
-        final Map<String, dynamic> jsonMap = json;
-        if (jsonMap.containsKey('error')) {
-          throw jsonMap['error'];
-        }
-        return jsonMap['result']['result']['kernelBytes'];
-      });
-    } else {
-      // fallback to compile using kernel service
-      final compileExpressionParams = <String, dynamic>{
-        'method': '_compileExpression',
-        'id': _message.serial,
-        'params': compileParams,
-      };
-      final compileExpression = Message._fromJsonRpcRequest(
-          _message.client!, compileExpressionParams);
-
-      return _isolate
-          .routeRequest(_service, compileExpression)
-          .then((response) => response.decodeJson())
-          .then((json) {
-        if (json['result'] != null) {
-          return json['result']['kernelBytes'];
-        }
-        throw json['error']['data']['details'];
-      });
-    }
-  }
-
-  Future<Response> _evaluateCompiledExpression(String kernelBase64) {
-    if (kernelBase64.isNotEmpty) {
-      final params = _setupParams();
-      params['isolateId'] = _message.params['isolateId'];
-      params['kernelBytes'] = kernelBase64;
-      params['disableBreakpoints'] = _message.params['disableBreakpoints'];
-      final runParams = <String, dynamic>{
-        'method': '_evaluateCompiledExpression',
-        'id': _message.serial,
-        'params': params,
-      };
-      if (_message.params['scope'] != null) {
-        runParams['params']['scope'] = _message.params['scope'];
-      }
-      final runExpression =
-          Message._fromJsonRpcRequest(_message.client!, runParams);
-      return _isolate.routeRequest(_service, runExpression); // _message
-    } else {
-      // empty kernel indicates dart1 mode
-      return _isolate.routeRequest(_service, _message);
-    }
-  }
-
-  Map<String, dynamic> _setupParams() {
-    if (_message.method == 'evaluateInFrame') {
-      return <String, dynamic>{'frameIndex': _message.params['frameIndex']};
-    } else {
-      assert(_message.method == 'evaluate');
-      return <String, dynamic>{'targetId': _message.params['targetId']};
-    }
-  }
-}
diff --git a/sdk_nnbd/lib/vmservice/vmservice.dart b/sdk_nnbd/lib/vmservice/vmservice.dart
deleted file mode 100644
index 23f555b..0000000
--- a/sdk_nnbd/lib/vmservice/vmservice.dart
+++ /dev/null
@@ -1,821 +0,0 @@
-// Copyright (c) 2015, 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.
-
-library dart._vmservice;
-
-import 'dart:async';
-import 'dart:collection';
-import 'dart:convert';
-import 'dart:isolate';
-import 'dart:math';
-import 'dart:typed_data';
-
-part 'asset.dart';
-part 'client.dart';
-part 'devfs.dart';
-part 'constants.dart';
-part 'running_isolate.dart';
-part 'running_isolates.dart';
-part 'message.dart';
-part 'message_router.dart';
-part 'named_lookup.dart';
-
-final isolateControlPort = RawReceivePort();
-final scriptLoadPort = RawReceivePort();
-
-abstract class IsolateEmbedderData {
-  void cleanup();
-}
-
-String _makeAuthToken() {
-  final kTokenByteSize = 8;
-  Uint8List bytes = Uint8List(kTokenByteSize);
-  Random random = Random.secure();
-  for (int i = 0; i < kTokenByteSize; i++) {
-    bytes[i] = random.nextInt(256);
-  }
-  return base64Url.encode(bytes);
-}
-
-// The randomly generated auth token used to access the VM service.
-final serviceAuthToken = _makeAuthToken();
-
-// This is for use by the embedder. It is a map from the isolateId to
-// anything implementing IsolateEmbedderData. When an isolate goes away,
-// the cleanup method will be invoked after being removed from the map.
-final isolateEmbedderData = <int, IsolateEmbedderData>{};
-
-// These must be kept in sync with the declarations in vm/json_stream.h and
-// pkg/dds/lib/src/rpc_error_codes.dart.
-const kParseError = -32700;
-const kInvalidRequest = -32600;
-const kMethodNotFound = -32601;
-const kInvalidParams = -32602;
-const kInternalError = -32603;
-
-const kExtensionError = -32000;
-
-const kFeatureDisabled = 100;
-const kCannotAddBreakpoint = 102;
-const kStreamAlreadySubscribed = 103;
-const kStreamNotSubscribed = 104;
-const kIsolateMustBeRunnable = 105;
-const kIsolateMustBePaused = 106;
-const kCannotResume = 107;
-const kIsolateIsReloading = 108;
-const kIsolateReloadBarred = 109;
-const kIsolateMustHaveReloaded = 110;
-const kServiceAlreadyRegistered = 111;
-const kServiceDisappeared = 112;
-const kExpressionCompilationError = 113;
-const kInvalidTimelineRequest = 114;
-
-// Experimental (used in private rpcs).
-const kFileSystemAlreadyExists = 1001;
-const kFileSystemDoesNotExist = 1002;
-const kFileDoesNotExist = 1003;
-
-final _errorMessages = <int, String>{
-  kInvalidParams: 'Invalid params',
-  kInternalError: 'Internal error',
-  kFeatureDisabled: 'Feature is disabled',
-  kStreamAlreadySubscribed: 'Stream already subscribed',
-  kStreamNotSubscribed: 'Stream not subscribed',
-  kFileSystemAlreadyExists: 'File system already exists',
-  kFileSystemDoesNotExist: 'File system does not exist',
-  kFileDoesNotExist: 'File does not exist',
-  kServiceAlreadyRegistered: 'Service already registered',
-  kServiceDisappeared: 'Service has disappeared',
-  kExpressionCompilationError: 'Expression compilation error',
-  kInvalidTimelineRequest: 'The timeline related request could not be completed'
-      'due to the current configuration',
-};
-
-String encodeRpcError(Message message, int code, {String? details}) {
-  final response = <String, dynamic>{
-    'jsonrpc': '2.0',
-    'id': message.serial,
-    'error': {
-      'code': code,
-      'message': _errorMessages[code],
-    },
-  };
-  if (details != null) {
-    response['error']['data'] = <String, String>{
-      'details': details,
-    };
-  }
-  return json.encode(response);
-}
-
-String encodeMissingParamError(Message message, String param) =>
-    encodeRpcError(message, kInvalidParams,
-        details: "${message.method} expects the '${param}' parameter");
-
-String encodeInvalidParamError(Message message, String param) {
-  final value = message.params[param];
-  return encodeRpcError(message, kInvalidParams,
-      details: "${message.method}: invalid '${param}' parameter: ${value}");
-}
-
-String encodeCompilationError(Message message, String diagnostic) =>
-    encodeRpcError(message, kExpressionCompilationError, details: diagnostic);
-
-String encodeResult(Message message, Map result) => json.encode({
-      'jsonrpc': '2.0',
-      'id': message.serial,
-      'result': result,
-    });
-
-String encodeSuccess(Message message) =>
-    encodeResult(message, {'type': 'Success'});
-
-const shortDelay = Duration(milliseconds: 10);
-
-/// Called when the server should be started.
-typedef Future ServerStartCallback();
-
-/// Called when the server should be stopped.
-typedef Future ServerStopCallback();
-
-/// Called when the service is exiting.
-typedef Future CleanupCallback();
-
-/// Called to create a temporary directory
-typedef Future<Uri> CreateTempDirCallback(String base);
-
-/// Called to delete a directory
-typedef Future DeleteDirCallback(Uri path);
-
-/// Called to write a file.
-typedef Future WriteFileCallback(Uri path, List<int> bytes);
-
-/// Called to write a stream into a file.
-typedef Future WriteStreamFileCallback(Uri path, Stream<List<int>> bytes);
-
-/// Called to read a file.
-typedef Future<List<int>> ReadFileCallback(Uri path);
-
-/// Called to list all files under some path.
-typedef Future<List<Map<String, dynamic>>> ListFilesCallback(Uri path);
-
-/// Called when we need information about the server.
-typedef Future<Uri> ServerInformamessage_routertionCallback();
-
-/// Called when we need information about the server.
-typedef Uri? ServerInformationCallback();
-
-/// Called when we want to [enable] or disable the web server.
-typedef Future<Uri?> WebServerControlCallback(bool enable);
-
-/// Called when we want to [enable] or disable new websocket connections to the
-/// server.
-typedef void WebServerAcceptNewWebSocketConnectionsCallback(bool enable);
-
-/// Hooks that are setup by the embedder.
-class VMServiceEmbedderHooks {
-  static ServerStartCallback? serverStart;
-  static ServerStopCallback? serverStop;
-  static CleanupCallback? cleanup;
-  static CreateTempDirCallback? createTempDir;
-  static DeleteDirCallback? deleteDir;
-  static WriteFileCallback? writeFile;
-  static WriteStreamFileCallback? writeStreamFile;
-  static ReadFileCallback? readFile;
-  static ListFilesCallback? listFiles;
-  static ServerInformationCallback? serverInformation;
-  static WebServerControlCallback? webServerControl;
-  static WebServerAcceptNewWebSocketConnectionsCallback?
-      acceptNewWebSocketConnections;
-}
-
-class _ClientResumePermissions {
-  final List<Client> clients = [];
-  int permissionsMask = 0;
-}
-
-class VMService extends MessageRouter {
-  static VMService? _instance;
-
-  static const serviceNamespace = 's';
-
-  /// Collection of currently connected clients.
-  final clients = NamedLookup<Client>(prologue: serviceNamespace);
-  final _serviceRequests = IdGenerator(prologue: 'sr');
-
-  /// Mapping of client names to all clients of that name and their resume
-  /// permissions.
-  final Map<String, _ClientResumePermissions> clientResumePermissions = {};
-
-  /// Collection of currently running isolates.
-  final runningIsolates = RunningIsolates();
-
-  /// Flag to indicate VM service is exiting.
-  bool isExiting = false;
-
-  /// A port used to receive events from the VM.
-  final RawReceivePort eventPort;
-
-  final devfs = DevFS();
-
-  Uri? get ddsUri => _ddsUri;
-  Uri? _ddsUri;
-
-  Future<String> _yieldControlToDDS(Message message) async {
-    final acceptNewWebSocketConnections =
-        VMServiceEmbedderHooks.acceptNewWebSocketConnections;
-    if (acceptNewWebSocketConnections == null) {
-      return encodeRpcError(message, kFeatureDisabled,
-          details:
-              'Embedder does not support yielding to a VM service intermediary.');
-    }
-    final uri = message.params['uri'];
-    if (uri == null) {
-      return encodeMissingParamError(message, 'uri');
-    }
-    // DDS can only take control if there is no other clients connected
-    // directly to the VM service.
-    if (clients.length > 1) {
-      return encodeRpcError(message, kFeatureDisabled,
-          details:
-              'Existing VM service clients prevent DDS from taking control.');
-    }
-    acceptNewWebSocketConnections(false);
-    _ddsUri = Uri.parse(uri);
-    return encodeSuccess(message);
-  }
-
-  void _clearClientName(Client client) {
-    final name = client.name;
-    client.name = null;
-    final clientsForName = clientResumePermissions[name];
-    if (clientsForName != null) {
-      clientsForName.clients.remove(client);
-      // If this was the last client with a given name, cleanup resume
-      // permissions.
-      if (clientsForName.clients.isEmpty) {
-        clientResumePermissions.remove(name);
-
-        // Check to see if we need to resume any isolates now that the last
-        // client of a given name has disconnected or changed names.
-        //
-        // An isolate will be resumed in this situation if:
-        //
-        // 1) This client required resume approvals for the current pause event
-        // associated with the isolate and all other required resume approvals
-        // have been provided by other clients.
-        //
-        // OR
-        //
-        // 2) This client required resume approvals for the current pause event
-        // associated with the isolate, no other clients require resume approvals
-        // for the current pause event, and at least one client has issued a resume
-        // request.
-        runningIsolates.isolates.forEach((_, isolate) async =>
-            await isolate.maybeResumeAfterClientChange(this, name));
-      }
-    }
-  }
-
-  /// Sets the name associated with a [Client].
-  ///
-  /// If any resume approvals were set for this client previously they will
-  /// need to be reset after a name change.
-  String _setClientName(Message message) {
-    final client = message.client!;
-    if (!message.params.containsKey('name')) {
-      return encodeRpcError(message, kInvalidParams,
-          details: "setClientName: missing required parameter 'name'");
-    }
-    final name = message.params['name'];
-    if (name is! String) {
-      return encodeRpcError(message, kInvalidParams,
-          details: "setClientName: invalid 'name' parameter: $name");
-    }
-    _setClientNameHelper(client, name);
-    return encodeSuccess(message);
-  }
-
-  void _setClientNameHelper(Client client, String name) {
-    _clearClientName(client);
-    name = name.isEmpty ? client.defaultClientName : name;
-    client.name = name;
-    clientResumePermissions.putIfAbsent(
-        client.name, () => _ClientResumePermissions());
-    clientResumePermissions[name]!.clients.add(client);
-  }
-
-  String _getClientName(Message message) => encodeResult(message, {
-        'type': 'ClientName',
-        'name': message.client!.name,
-      });
-
-  String _requirePermissionToResume(Message message) {
-    bool parsePermission(String argName) {
-      final arg = message.params[argName];
-      if (arg == null) {
-        return false;
-      }
-      if (arg is! bool) {
-        throw encodeRpcError(message, kInvalidParams,
-            details: "requirePermissionToResume: invalid '$argName': $arg");
-      }
-      return arg;
-    }
-
-    final client = message.client!;
-    int pauseTypeMask = 0;
-    try {
-      if (parsePermission('onPauseStart')) {
-        pauseTypeMask |= RunningIsolate.kPauseOnStartMask;
-      }
-      if (parsePermission('onPauseReload')) {
-        pauseTypeMask |= RunningIsolate.kPauseOnReloadMask;
-      }
-      if (parsePermission('onPauseExit')) {
-        pauseTypeMask |= RunningIsolate.kPauseOnExitMask;
-      }
-    } on dynamic catch (rpcError) {
-      return rpcError;
-    }
-
-    clientResumePermissions[client.name]!.permissionsMask = pauseTypeMask;
-    return encodeSuccess(message);
-  }
-
-  void _addClient(Client client) {
-    assert(client.streams.isEmpty);
-    assert(client.services.isEmpty);
-    clients.add(client);
-  }
-
-  void _removeClient(Client client) {
-    final namespace = clients.keyOf(client);
-    clients.remove(client);
-    for (final streamId in client.streams) {
-      if (!_isAnyClientSubscribed(streamId)) {
-        _vmCancelStream(streamId);
-      }
-    }
-
-    // Clean up client approvals state.
-    _clearClientName(client);
-
-    for (final service in client.services.keys) {
-      _eventMessageHandler(
-          'Service',
-          Response.json({
-            'jsonrpc': '2.0',
-            'method': 'streamNotify',
-            'params': {
-              'streamId': 'Service',
-              'event': {
-                'type': 'Event',
-                'kind': 'ServiceUnregistered',
-                'timestamp': DateTime.now().millisecondsSinceEpoch,
-                'service': service,
-                'method': namespace + '.' + service,
-              }
-            }
-          }));
-    }
-    // Complete all requests as failed
-    for (final handle in client.serviceHandles.values) {
-      handle(null);
-    }
-    if (clients.isEmpty) {
-      // If DDS was connected, we are in single client mode and need to
-      // allow for new websocket connections.
-      final acceptNewWebSocketConnections =
-          VMServiceEmbedderHooks.acceptNewWebSocketConnections;
-      if (_ddsUri != null && acceptNewWebSocketConnections != null) {
-        acceptNewWebSocketConnections(true);
-        _ddsUri = null;
-      }
-    }
-  }
-
-  void _eventMessageHandler(String streamId, Response event) {
-    for (final client in clients) {
-      if (client.sendEvents && client.streams.contains(streamId)) {
-        client.post(event);
-      }
-    }
-  }
-
-  void _controlMessageHandler(int code, int portId, SendPort sp, String name) {
-    switch (code) {
-      case Constants.ISOLATE_STARTUP_MESSAGE_ID:
-        runningIsolates.isolateStartup(portId, sp, name);
-        break;
-      case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID:
-        runningIsolates.isolateShutdown(portId, sp);
-        isolateEmbedderData.remove(portId)?.cleanup();
-        break;
-    }
-  }
-
-  Future<void> _serverMessageHandler(int code, SendPort sp, bool enable) async {
-    switch (code) {
-      case Constants.WEB_SERVER_CONTROL_MESSAGE_ID:
-        final webServerControl = VMServiceEmbedderHooks.webServerControl;
-        if (webServerControl == null) {
-          sp.send(null);
-          return;
-        }
-        final uri = await webServerControl(enable);
-        sp.send(uri);
-        break;
-      case Constants.SERVER_INFO_MESSAGE_ID:
-        final serverInformation = VMServiceEmbedderHooks.serverInformation;
-        if (serverInformation == null) {
-          sp.send(null);
-          return;
-        }
-        final uri = await serverInformation();
-        sp.send(uri);
-        break;
-    }
-  }
-
-  Future<void> _handleNativeRpcCall(message, SendPort replyPort) async {
-    // Keep in sync with 'runtime/vm/service_isolate.cc:InvokeServiceRpc'.
-    Response response;
-
-    try {
-      final rpc = Message.fromJsonRpc(
-          null, json.decode(utf8.decode(message as List<int>)));
-      if (rpc.type != MessageType.Request) {
-        response = Response.internalError(
-            'The client sent a non-request json-rpc message.');
-      } else {
-        response = (await routeRequest(this, rpc))!;
-      }
-    } catch (exception) {
-      response = Response.internalError(
-          'The rpc call resulted in exception: $exception.');
-    }
-    late List<int> bytes;
-    switch (response.kind) {
-      case ResponsePayloadKind.String:
-        bytes = utf8.encode(response.payload);
-        bytes = bytes is Uint8List ? bytes : Uint8List.fromList(bytes);
-        break;
-      case ResponsePayloadKind.Binary:
-      case ResponsePayloadKind.Utf8String:
-        bytes = response.payload as Uint8List;
-        break;
-    }
-    replyPort.send(bytes);
-  }
-
-  Future _exit() async {
-    isExiting = true;
-
-    final serverStop = VMServiceEmbedderHooks.serverStop;
-    // Stop the server.
-    if (serverStop != null) {
-      await serverStop();
-    }
-
-    // Close receive ports.
-    isolateControlPort.close();
-    scriptLoadPort.close();
-
-    // Create a copy of the set as a list because client.disconnect() will
-    // alter the connected clients set.
-    final clientsList = clients.toList();
-    for (final client in clientsList) {
-      client.disconnect();
-    }
-    devfs.cleanup();
-    final cleanup = VMServiceEmbedderHooks.cleanup;
-    if (cleanup != null) {
-      await cleanup();
-    }
-
-    // Notify the VM that we have exited.
-    _onExit();
-  }
-
-  void messageHandler(message) {
-    if (message is List) {
-      if (message.length == 2) {
-        // This is an event.
-        _eventMessageHandler(message[0], Response.from(message[1]));
-        return;
-      }
-      if (message.length == 1) {
-        // This is a control message directing the vm service to exit.
-        assert(message[0] == Constants.SERVICE_EXIT_MESSAGE_ID);
-        _exit();
-        return;
-      }
-      if (message.length == 3) {
-        final opcode = message[0];
-        if (opcode == Constants.METHOD_CALL_FROM_NATIVE) {
-          _handleNativeRpcCall(message[1], message[2]);
-          return;
-        } else {
-          // This is a message interacting with the web server.
-          assert((opcode == Constants.WEB_SERVER_CONTROL_MESSAGE_ID) ||
-              (opcode == Constants.SERVER_INFO_MESSAGE_ID));
-          _serverMessageHandler(message[0], message[1], message[2]);
-          return;
-        }
-      }
-      if (message.length == 4) {
-        // This is a message informing us of the birth or death of an
-        // isolate.
-        _controlMessageHandler(message[0], message[1], message[2], message[3]);
-        return;
-      }
-    }
-    print('Internal vm-service error: ignoring illegal message: $message');
-  }
-
-  VMService._internal() : eventPort = isolateControlPort {
-    eventPort.handler = messageHandler;
-  }
-
-  factory VMService() {
-    VMService? instance = VMService._instance;
-    if (instance == null) {
-      instance = VMService._internal();
-      VMService._instance = instance;
-      _onStart();
-    }
-    return instance;
-  }
-
-  bool _isAnyClientSubscribed(String streamId) {
-    for (final client in clients) {
-      if (client.streams.contains(streamId)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  Client? _findFirstClientThatHandlesService(String service) {
-    if (clients != null) {
-      for (Client c in clients) {
-        if (c.services.containsKey(service)) {
-          return c;
-        }
-      }
-    }
-    return null;
-  }
-
-  static const kServiceStream = 'Service';
-  static const serviceStreams = <String>[kServiceStream];
-
-  Future<String> _streamListen(Message message) async {
-    final client = message.client!;
-    final streamId = message.params['streamId']!;
-
-    if (client.streams.contains(streamId)) {
-      return encodeRpcError(message, kStreamAlreadySubscribed);
-    }
-    if (!_isAnyClientSubscribed(streamId)) {
-      if (!serviceStreams.contains(streamId) && !_vmListenStream(streamId)) {
-        return encodeRpcError(message, kInvalidParams,
-            details: "streamListen: invalid 'streamId' parameter: ${streamId}");
-      }
-    }
-
-    // Some streams can generate events or side effects after registration
-    switch (streamId) {
-      case kServiceStream:
-        for (Client c in clients) {
-          if (c == client) continue;
-          for (String service in c.services.keys) {
-            _sendServiceRegisteredEvent(c, service, target: client);
-          }
-        }
-        ;
-        break;
-    }
-
-    client.streams.add(streamId);
-    return encodeSuccess(message);
-  }
-
-  Future<String> _streamCancel(Message message) async {
-    final client = message.client!;
-    final streamId = message.params['streamId']!;
-
-    if (!client.streams.contains(streamId)) {
-      return encodeRpcError(message, kStreamNotSubscribed);
-    }
-    client.streams.remove(streamId);
-    if (!serviceStreams.contains(streamId) &&
-        !_isAnyClientSubscribed(streamId)) {
-      _vmCancelStream(streamId);
-    }
-
-    return encodeSuccess(message);
-  }
-
-  static bool _hasNamespace(String method) =>
-      method.contains('.') &&
-      _getNamespace(method).startsWith(serviceNamespace);
-  static String _getNamespace(String method) => method.split('.').first;
-  static String _getMethod(String method) => method.split('.').last;
-
-  Future<String> _registerService(Message message) async {
-    final client = message.client!;
-    final service = message.params['service'];
-    final alias = message.params['alias'];
-
-    if (service is! String || service == '') {
-      return encodeRpcError(message, kInvalidParams,
-          details: "registerService: invalid 'service' parameter: ${service}");
-    }
-    if (alias is! String || alias == '') {
-      return encodeRpcError(message, kInvalidParams,
-          details: "registerService: invalid 'alias' parameter: ${alias}");
-    }
-    if (client.services.containsKey(service)) {
-      return encodeRpcError(message, kServiceAlreadyRegistered);
-    }
-    client.services[service] = alias;
-
-    bool removed = false;
-    try {
-      // Do not send streaming events to the client which registers the service
-      removed = client.streams.remove(kServiceStream);
-      await _sendServiceRegisteredEvent(client, service);
-    } finally {
-      if (removed) client.streams.add(kServiceStream);
-    }
-
-    return encodeSuccess(message);
-  }
-
-  Future<void> _sendServiceRegisteredEvent(Client client, String service,
-      {Client? target}) async {
-    final namespace = clients.keyOf(client);
-    final alias = client.services[service];
-    final event = Response.json({
-      'jsonrpc': '2.0',
-      'method': 'streamNotify',
-      'params': {
-        'streamId': kServiceStream,
-        'event': {
-          'type': 'Event',
-          'kind': 'ServiceRegistered',
-          'timestamp': DateTime.now().millisecondsSinceEpoch,
-          'service': service,
-          'method': namespace + '.' + service,
-          'alias': alias
-        }
-      }
-    });
-    if (target == null) {
-      _eventMessageHandler(kServiceStream, event);
-    } else {
-      target.post(event);
-    }
-  }
-
-  Future<String> _handleService(Message message) async {
-    final namespace = _getNamespace(message.method!);
-    final method = _getMethod(message.method!);
-    final client = clients[namespace];
-    if (client != null) {
-      if (client.services.containsKey(method)) {
-        final id = _serviceRequests.newId();
-        final oldId = message.serial;
-        final completer = Completer<String>();
-        client.serviceHandles[id] = (Message? m) {
-          if (m != null) {
-            completer.complete(json.encode(m.forwardToJson({'id': oldId})));
-          } else {
-            completer.complete(encodeRpcError(message, kServiceDisappeared));
-          }
-        };
-        client.post(
-            Response.json(message.forwardToJson({'id': id, 'method': method})));
-        return completer.future;
-      }
-    }
-    return encodeRpcError(message, kMethodNotFound,
-        details: 'Unknown service: ${message.method}');
-  }
-
-  Future<String> _getSupportedProtocols(Message message) async {
-    final version = json.decode(
-      utf8.decode(
-        (await Message.forMethod('getVersion').sendToVM()).payload,
-      ),
-    )['result'];
-    final protocols = {
-      'type': 'ProtocolList',
-      'protocols': [
-        {
-          'protocolName': 'VM Service',
-          'major': version['major'],
-          'minor': version['minor'],
-        },
-      ],
-    };
-    return encodeResult(message, protocols);
-  }
-
-  Future<Response?> routeRequest(VMService _, Message message) async {
-    final response = await _routeRequestImpl(message);
-    if (response == null) {
-      // We should only have a null response for Notifications.
-      assert(message.type == MessageType.Notification);
-      return null;
-    }
-    return Response.from(response);
-  }
-
-  Future _routeRequestImpl(Message message) async {
-    try {
-      if (message.completed) {
-        return await message.response;
-      }
-      if (message.method == '_yieldControlToDDS') {
-        return await _yieldControlToDDS(message);
-      }
-      if (message.method == 'streamListen') {
-        return await _streamListen(message);
-      }
-      if (message.method == 'streamCancel') {
-        return await _streamCancel(message);
-      }
-      if (message.method == 'registerService') {
-        return await _registerService(message);
-      }
-      if (message.method == 'setClientName') {
-        return _setClientName(message);
-      }
-      if (message.method == 'getClientName') {
-        return _getClientName(message);
-      }
-      if (message.method == 'requirePermissionToResume') {
-        return _requirePermissionToResume(message);
-      }
-      if (message.method == 'getSupportedProtocols') {
-        return await _getSupportedProtocols(message);
-      }
-      if (devfs.shouldHandleMessage(message)) {
-        return await devfs.handleMessage(message);
-      }
-      if (_hasNamespace(message.method!)) {
-        return await _handleService(message);
-      }
-      if (message.params['isolateId'] != null) {
-        return await runningIsolates.routeRequest(this, message);
-      }
-      return await message.sendToVM();
-    } catch (e, st) {
-      message.setErrorResponse(kInternalError, 'Unexpected exception:$e\n$st');
-      return message.response;
-    }
-  }
-
-  void routeResponse(message) {
-    final client = message.client!;
-    if (client.serviceHandles.containsKey(message.serial)) {
-      client.serviceHandles.remove(message.serial)!(message);
-      _serviceRequests.release(message.serial);
-    }
-  }
-}
-
-@pragma('vm:entry-point',
-    const bool.fromEnvironment('dart.vm.product') ? false : 'call')
-RawReceivePort boot() {
-  // Return the port we expect isolate control messages on.
-  return isolateControlPort;
-}
-
-@pragma('vm:entry-point', !const bool.fromEnvironment('dart.vm.product'))
-// ignore: unused_element
-void _registerIsolate(int port_id, SendPort sp, String name) =>
-    VMService().runningIsolates.isolateStartup(port_id, sp, name);
-
-/// Notify the VM that the service is running.
-void _onStart() native 'VMService_OnStart';
-
-/// Notify the VM that the service is no longer running.
-void _onExit() native 'VMService_OnExit';
-
-/// Notify the VM that the server's address has changed.
-void onServerAddressChange(String? address)
-    native 'VMService_OnServerAddressChange';
-
-/// Subscribe to a service stream.
-bool _vmListenStream(String streamId) native 'VMService_ListenStream';
-
-/// Cancel a subscription to a service stream.
-void _vmCancelStream(String streamId) native 'VMService_CancelStream';
-
-/// Get the bytes to the tar archive.
-Uint8List _requestAssets() native 'VMService_RequestAssets';
diff --git a/sdk_nnbd/lib/vmservice/vmservice_sources.gni b/sdk_nnbd/lib/vmservice/vmservice_sources.gni
deleted file mode 100644
index 742f6e8..0000000
--- a/sdk_nnbd/lib/vmservice/vmservice_sources.gni
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# Sources that make up the library "dart:_vmservice".
-vmservice_sdk_sources = [
-  "vmservice.dart",
-
-  # The above file needs to be first as it imports required libraries.
-  "asset.dart",
-  "client.dart",
-  "constants.dart",
-  "devfs.dart",
-  "message.dart",
-  "message_router.dart",
-  "named_lookup.dart",
-  "running_isolate.dart",
-  "running_isolates.dart",
-]
diff --git a/sdk_nnbd/lib/vmservice_libraries.json b/sdk_nnbd/lib/vmservice_libraries.json
deleted file mode 100644
index d0b1297..0000000
--- a/sdk_nnbd/lib/vmservice_libraries.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "comment:0": "NOTE: THIS FILE IS GENERATED. DO NOT EDIT.",
-  "comment:1": "Instead modify 'sdk_nnbd/lib/vmservice_libraries.yaml' and follow the instructions therein.",
-  "vm": {
-    "libraries": {
-      "_vmservice": {
-        "uri": "vmservice/vmservice.dart"
-      },
-      "vmservice_io": {
-        "uri": "_internal/vm/bin/vmservice_io.dart"
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/sdk_nnbd/lib/vmservice_libraries.yaml b/sdk_nnbd/lib/vmservice_libraries.yaml
deleted file mode 100644
index 169d6af..0000000
--- a/sdk_nnbd/lib/vmservice_libraries.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2017, 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.
-
-# Note: if you edit this file, you must also edit libraries.json in this
-# directory:
-#
-#     python ./tools/yaml2json.py sdk/lib/vmservice_libraries.yaml sdk/lib/vmservice_libraries.json
-#
-# We currently have several different files that needs to be updated when
-# changing libraries, sources, and patch files.  See
-# https://github.com/dart-lang/sdk/issues/28836.
-
-vm:
-  libraries:
-    _vmservice:
-      uri: "vmservice/vmservice.dart"
-
-    vmservice_io:
-      uri: "_internal/vm/bin/vmservice_io.dart"
diff --git a/sdk_nnbd/lib/wasm/wasm.dart b/sdk_nnbd/lib/wasm/wasm.dart
deleted file mode 100644
index 768445e..0000000
--- a/sdk_nnbd/lib/wasm/wasm.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// {@category VM}
-/// {@nodoc}
-library dart.wasm;
-
-import 'dart:typed_data';
-
-// Represents the WASM 32-bit int type.
-class Int32 {}
-
-// Represents the WASM 64-bit int type.
-class Int64 {}
-
-// Represents the WASM 32-bit float type.
-class Float {}
-
-// Represents the WASM 64-bit float type.
-class Double {}
-
-// Represents the return type of a void function in WASM.
-class Void {}
-
-// WasmModule is a compiled module that can be instantiated.
-abstract class WasmModule {
-  // Compile a module.
-  external factory WasmModule(Uint8List data);
-
-  // Instantiate the module with the given imports.
-  WasmInstance instantiate(WasmImports imports);
-
-  // Describes the imports and exports that the module expects, for debugging.
-  String describe();
-}
-
-// WasmImports holds all the imports for a WasmInstance.
-abstract class WasmImports {
-  // Create an imports object.
-  external factory WasmImports();
-
-  // Add a global variable to the imports.
-  void addGlobal<T>(String moduleName, String name, num value, bool mutable);
-
-  // Add a memory to the imports.
-  void addMemory(String moduleName, String name, WasmMemory memory);
-
-  // Add a function to the imports.
-  void addFunction<T extends Function>(
-      String moduleName, String name, Function fn);
-}
-
-// WasmMemory is a sandbox for a WasmInstance to run in.
-abstract class WasmMemory {
-  // Create a new memory with the given number of initial pages, and optional
-  // maximum number of pages.
-  external factory WasmMemory(int initialPages, [int? maxPages]);
-
-  // The WASM spec defines the page size as 64KiB.
-  static const int kPageSizeInBytes = 64 * 1024;
-
-  // Returns the length of the memory in pages.
-  int get lengthInPages;
-
-  // Returns the length of the memory in bytes.
-  int get lengthInBytes;
-
-  // Returns the byte at the given index.
-  int operator [](int index);
-
-  // Sets the byte at the iven index to value.
-  void operator []=(int index, int value);
-
-  // Grow the memory by deltaPages. Returns the number of pages before resizing.
-  int grow(int deltaPages);
-}
-
-// WasmInstance is an instantiated WasmModule.
-abstract class WasmInstance {
-  // Find an exported function with the given signature.
-  WasmFunction<T> lookupFunction<T extends Function>(String name);
-
-  // Returns this instance's memory.
-  WasmMemory get memory;
-}
-
-// WasmFunction is a callable function in a WasmInstance.
-abstract class WasmFunction<T extends Function> {
-  num call(List<num> args);
-}
diff --git a/sdk_nnbd/lib/wasm/wasm_sources.gni b/sdk_nnbd/lib/wasm/wasm_sources.gni
deleted file mode 100644
index e63af2d..0000000
--- a/sdk_nnbd/lib/wasm/wasm_sources.gni
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-wasm_sdk_sources = [ "wasm.dart" ]
diff --git a/sdk_nnbd/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk_nnbd/lib/web_audio/dart2js/web_audio_dart2js.dart
deleted file mode 100644
index 146e158..0000000
--- a/sdk_nnbd/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ /dev/null
@@ -1,1302 +0,0 @@
-/**
- * High-fidelity audio programming in the browser.
- *
- * {@category Web}
- */
-library dart.dom.web_audio;
-
-import 'dart:async';
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' show FixedLengthListMixin;
-import 'dart:html';
-import 'dart:html_common';
-import 'dart:_native_typed_data';
-import 'dart:typed_data';
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show Interceptor;
-// DO NOT EDIT - unless you are editing documentation as per:
-// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
-// Auto-generated dart:audio library.
-
-import 'dart:_js_helper'
-    show
-        Creates,
-        JavaScriptIndexingBehavior,
-        JSName,
-        Native,
-        Returns,
-        convertDartClosureToJS;
-
-// Copyright (c) 2012, 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.
-
-@Native("AnalyserNode,RealtimeAnalyserNode")
-class AnalyserNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory AnalyserNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AnalyserNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return AnalyserNode._create_1(context, options_1);
-    }
-    return AnalyserNode._create_2(context);
-  }
-  static AnalyserNode _create_1(context, options) =>
-      JS('AnalyserNode', 'new AnalyserNode(#,#)', context, options);
-  static AnalyserNode _create_2(context) =>
-      JS('AnalyserNode', 'new AnalyserNode(#)', context);
-
-  int get fftSize native;
-
-  set fftSize(int value) native;
-
-  int get frequencyBinCount native;
-
-  num get maxDecibels native;
-
-  set maxDecibels(num value) native;
-
-  num get minDecibels native;
-
-  set minDecibels(num value) native;
-
-  num get smoothingTimeConstant native;
-
-  set smoothingTimeConstant(num value) native;
-
-  void getByteFrequencyData(Uint8List array) native;
-
-  void getByteTimeDomainData(Uint8List array) native;
-
-  void getFloatFrequencyData(Float32List array) native;
-
-  void getFloatTimeDomainData(Float32List array) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioBuffer")
-class AudioBuffer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AudioBuffer._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AudioBuffer(Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    return AudioBuffer._create_1(options_1);
-  }
-  static AudioBuffer _create_1(options) =>
-      JS('AudioBuffer', 'new AudioBuffer(#)', options);
-
-  num get duration native;
-
-  int get length native;
-
-  int get numberOfChannels native;
-
-  num get sampleRate native;
-
-  void copyFromChannel(Float32List destination, int channelNumber,
-      [int? startInChannel]) native;
-
-  void copyToChannel(Float32List source, int channelNumber,
-      [int? startInChannel]) native;
-
-  Float32List getChannelData(int channelIndex) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@Native("AudioBufferSourceNode")
-class AudioBufferSourceNode extends AudioScheduledSourceNode {
-  // To suppress missing implicit constructor warnings.
-  factory AudioBufferSourceNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AudioBufferSourceNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return AudioBufferSourceNode._create_1(context, options_1);
-    }
-    return AudioBufferSourceNode._create_2(context);
-  }
-  static AudioBufferSourceNode _create_1(context, options) => JS(
-      'AudioBufferSourceNode',
-      'new AudioBufferSourceNode(#,#)',
-      context,
-      options);
-  static AudioBufferSourceNode _create_2(context) =>
-      JS('AudioBufferSourceNode', 'new AudioBufferSourceNode(#)', context);
-
-  AudioBuffer? get buffer native;
-
-  set buffer(AudioBuffer? value) native;
-
-  AudioParam get detune native;
-
-  bool get loop native;
-
-  set loop(bool value) native;
-
-  num get loopEnd native;
-
-  set loopEnd(num value) native;
-
-  num get loopStart native;
-
-  set loopStart(num value) native;
-
-  AudioParam get playbackRate native;
-
-  void start([num? when, num? grainOffset, num? grainDuration]) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@Native("AudioContext,webkitAudioContext")
-class AudioContext extends BaseAudioContext {
-  // To suppress missing implicit constructor warnings.
-  factory AudioContext._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported =>
-      JS('bool', '!!(window.AudioContext || window.webkitAudioContext)');
-
-  num get baseLatency native;
-
-  Future close() => promiseToFuture(JS("", "#.close()", this));
-
-  Map getOutputTimestamp() {
-    return convertNativeToDart_Dictionary(_getOutputTimestamp_1())!;
-  }
-
-  @JSName('getOutputTimestamp')
-  _getOutputTimestamp_1() native;
-
-  Future suspend() => promiseToFuture(JS("", "#.suspend()", this));
-
-  factory AudioContext() => JS('AudioContext',
-      'new (window.AudioContext || window.webkitAudioContext)()');
-
-  GainNode createGain() {
-    if (JS('bool', '#.createGain !== undefined', this)) {
-      return JS('GainNode', '#.createGain()', this);
-    } else {
-      return JS('GainNode', '#.createGainNode()', this);
-    }
-  }
-
-  ScriptProcessorNode createScriptProcessor(
-      [int? bufferSize,
-      int? numberOfInputChannels,
-      int? numberOfOutputChannels]) {
-    var function = JS(
-        '=Object',
-        '#.createScriptProcessor || '
-            '#.createJavaScriptNode',
-        this,
-        this);
-    if (numberOfOutputChannels != null) {
-      return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this,
-          bufferSize, numberOfInputChannels, numberOfOutputChannels);
-    } else if (numberOfInputChannels != null) {
-      return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this,
-          bufferSize, numberOfInputChannels);
-    } else if (bufferSize != null) {
-      return JS(
-          'ScriptProcessorNode', '#.call(#, #)', function, this, bufferSize);
-    } else {
-      return JS('ScriptProcessorNode', '#.call(#)', function, this);
-    }
-  }
-
-  @JSName('decodeAudioData')
-  Future<AudioBuffer> _decodeAudioData(ByteBuffer audioData,
-      [DecodeSuccessCallback? successCallback,
-      DecodeErrorCallback? errorCallback]) native;
-
-  Future<AudioBuffer> decodeAudioData(ByteBuffer audioData,
-      [DecodeSuccessCallback? successCallback,
-      DecodeErrorCallback? errorCallback]) {
-    if (successCallback != null && errorCallback != null) {
-      return _decodeAudioData(audioData, successCallback, errorCallback);
-    }
-
-    var completer = new Completer<AudioBuffer>();
-    _decodeAudioData(audioData, (value) {
-      completer.complete(value);
-    }, (error) {
-      if (error == null) {
-        completer.completeError('');
-      } else {
-        completer.completeError(error);
-      }
-    });
-    return completer.future;
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioDestinationNode")
-class AudioDestinationNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory AudioDestinationNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get maxChannelCount native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioListener")
-class AudioListener extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AudioListener._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  AudioParam get forwardX native;
-
-  AudioParam get forwardY native;
-
-  AudioParam get forwardZ native;
-
-  AudioParam get positionX native;
-
-  AudioParam get positionY native;
-
-  AudioParam get positionZ native;
-
-  AudioParam get upX native;
-
-  AudioParam get upY native;
-
-  AudioParam get upZ native;
-
-  void setOrientation(num x, num y, num z, num xUp, num yUp, num zUp) native;
-
-  void setPosition(num x, num y, num z) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioNode")
-class AudioNode extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory AudioNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get channelCount native;
-
-  set channelCount(int value) native;
-
-  String get channelCountMode native;
-
-  set channelCountMode(String value) native;
-
-  String get channelInterpretation native;
-
-  set channelInterpretation(String value) native;
-
-  BaseAudioContext get context native;
-
-  int get numberOfInputs native;
-
-  int get numberOfOutputs native;
-
-  @JSName('connect')
-  AudioNode _connect(destination, [int? output, int? input]) native;
-
-  void disconnect([destination_OR_output, int? output, int? input]) native;
-
-  void connectNode(AudioNode destination, [int output = 0, int input = 0]) {
-    _connect(destination, output, input);
-  }
-
-  void connectParam(AudioParam destination, [int output = 0]) {
-    _connect(destination, output);
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioParam")
-class AudioParam extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AudioParam._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get defaultValue native;
-
-  num get maxValue native;
-
-  num get minValue native;
-
-  num get value native;
-
-  set value(num value) native;
-
-  AudioParam cancelAndHoldAtTime(num startTime) native;
-
-  AudioParam cancelScheduledValues(num startTime) native;
-
-  AudioParam exponentialRampToValueAtTime(num value, num time) native;
-
-  AudioParam linearRampToValueAtTime(num value, num time) native;
-
-  AudioParam setTargetAtTime(num target, num time, num timeConstant) native;
-
-  AudioParam setValueAtTime(num value, num time) native;
-
-  AudioParam setValueCurveAtTime(List<num> values, num time, num duration)
-      native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioParamMap")
-class AudioParamMap extends Interceptor with MapMixin<String, dynamic> {
-  // To suppress missing implicit constructor warnings.
-  factory AudioParamMap._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Map? _getItem(String key) =>
-      convertNativeToDart_Dictionary(JS('', '#.get(#)', this, key));
-
-  void addAll(Map<String, dynamic> other) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool containsValue(dynamic value) => values.any((e) => e == value);
-
-  bool containsKey(dynamic key) => _getItem(key) != null;
-
-  Map? operator [](dynamic key) => _getItem(key);
-
-  void forEach(void f(String key, dynamic value)) {
-    var entries = JS('', '#.entries()', this);
-    while (true) {
-      var entry = JS('', '#.next()', entries);
-      if (JS('bool', '#.done', entry)) return;
-      f(JS('String', '#.value[0]', entry),
-          convertNativeToDart_Dictionary(JS('', '#.value[1]', entry)));
-    }
-  }
-
-  Iterable<String> get keys {
-    final keys = <String>[];
-    forEach((k, v) => keys.add(k));
-    return keys;
-  }
-
-  Iterable<Map> get values {
-    final values = <Map>[];
-    forEach((k, v) => values.add(v));
-    return values;
-  }
-
-  int get length => JS('int', '#.size', this);
-
-  bool get isEmpty => length == 0;
-
-  bool get isNotEmpty => !isEmpty;
-
-  void operator []=(String key, dynamic value) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  dynamic putIfAbsent(String key, dynamic ifAbsent()) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String remove(dynamic key) {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioProcessingEvent")
-class AudioProcessingEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory AudioProcessingEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AudioProcessingEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return AudioProcessingEvent._create_1(type, eventInitDict_1);
-  }
-  static AudioProcessingEvent _create_1(type, eventInitDict) => JS(
-      'AudioProcessingEvent',
-      'new AudioProcessingEvent(#,#)',
-      type,
-      eventInitDict);
-
-  AudioBuffer get inputBuffer native;
-
-  AudioBuffer get outputBuffer native;
-
-  num get playbackTime native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioScheduledSourceNode")
-class AudioScheduledSourceNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory AudioScheduledSourceNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> endedEvent =
-      const EventStreamProvider<Event>('ended');
-
-  @JSName('start')
-  void start2([num? when]) native;
-
-  void stop([num? when]) native;
-
-  Stream<Event> get onEnded => endedEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioTrack")
-class AudioTrack extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AudioTrack._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get enabled native;
-
-  set enabled(bool value) native;
-
-  String get id native;
-
-  String get kind native;
-
-  String get label native;
-
-  String get language native;
-
-  SourceBuffer? get sourceBuffer native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioTrackList")
-class AudioTrackList extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory AudioTrackList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const EventStreamProvider<Event> changeEvent =
-      const EventStreamProvider<Event>('change');
-
-  int get length native;
-
-  AudioTrack __getter__(int index) native;
-
-  AudioTrack? getTrackById(String id) native;
-
-  Stream<Event> get onChange => changeEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioWorkletGlobalScope")
-class AudioWorkletGlobalScope extends WorkletGlobalScope {
-  // To suppress missing implicit constructor warnings.
-  factory AudioWorkletGlobalScope._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get currentTime native;
-
-  num get sampleRate native;
-
-  void registerProcessor(String name, Object processorConstructor) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioWorkletNode")
-class AudioWorkletNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory AudioWorkletNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory AudioWorkletNode(BaseAudioContext context, String name,
-      [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return AudioWorkletNode._create_1(context, name, options_1);
-    }
-    return AudioWorkletNode._create_2(context, name);
-  }
-  static AudioWorkletNode _create_1(context, name, options) => JS(
-      'AudioWorkletNode',
-      'new AudioWorkletNode(#,#,#)',
-      context,
-      name,
-      options);
-  static AudioWorkletNode _create_2(context, name) =>
-      JS('AudioWorkletNode', 'new AudioWorkletNode(#,#)', context, name);
-
-  AudioParamMap get parameters native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("AudioWorkletProcessor")
-class AudioWorkletProcessor extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AudioWorkletProcessor._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("BaseAudioContext")
-class BaseAudioContext extends EventTarget {
-  // To suppress missing implicit constructor warnings.
-  factory BaseAudioContext._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  num get currentTime native;
-
-  AudioDestinationNode get destination native;
-
-  AudioListener get listener native;
-
-  num get sampleRate native;
-
-  String get state native;
-
-  AnalyserNode createAnalyser() native;
-
-  BiquadFilterNode createBiquadFilter() native;
-
-  AudioBuffer createBuffer(
-      int numberOfChannels, int numberOfFrames, num sampleRate) native;
-
-  AudioBufferSourceNode createBufferSource() native;
-
-  ChannelMergerNode createChannelMerger([int? numberOfInputs]) native;
-
-  ChannelSplitterNode createChannelSplitter([int? numberOfOutputs]) native;
-
-  ConstantSourceNode createConstantSource() native;
-
-  ConvolverNode createConvolver() native;
-
-  DelayNode createDelay([num? maxDelayTime]) native;
-
-  DynamicsCompressorNode createDynamicsCompressor() native;
-
-  GainNode createGain() native;
-
-  @JSName('createIIRFilter')
-  IirFilterNode createIirFilter(List<num> feedForward, List<num> feedBack)
-      native;
-
-  MediaElementAudioSourceNode createMediaElementSource(
-      MediaElement mediaElement) native;
-
-  MediaStreamAudioDestinationNode createMediaStreamDestination() native;
-
-  MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream)
-      native;
-
-  OscillatorNode createOscillator() native;
-
-  PannerNode createPanner() native;
-
-  PeriodicWave createPeriodicWave(List<num> real, List<num> imag,
-      [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return _createPeriodicWave_1(real, imag, options_1);
-    }
-    return _createPeriodicWave_2(real, imag);
-  }
-
-  @JSName('createPeriodicWave')
-  PeriodicWave _createPeriodicWave_1(List<num> real, List<num> imag, options)
-      native;
-  @JSName('createPeriodicWave')
-  PeriodicWave _createPeriodicWave_2(List<num> real, List<num> imag) native;
-
-  ScriptProcessorNode createScriptProcessor(
-      [int? bufferSize,
-      int? numberOfInputChannels,
-      int? numberOfOutputChannels]) native;
-
-  StereoPannerNode createStereoPanner() native;
-
-  WaveShaperNode createWaveShaper() native;
-
-  Future<AudioBuffer> decodeAudioData(ByteBuffer audioData,
-          [DecodeSuccessCallback? successCallback,
-          DecodeErrorCallback? errorCallback]) =>
-      promiseToFuture<AudioBuffer>(JS("", "#.decodeAudioData(#, #, #)", this,
-          audioData, successCallback, errorCallback));
-
-  Future resume() => promiseToFuture(JS("", "#.resume()", this));
-}
-// Copyright (c) 2012, 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.
-
-@Native("BiquadFilterNode")
-class BiquadFilterNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory BiquadFilterNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory BiquadFilterNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return BiquadFilterNode._create_1(context, options_1);
-    }
-    return BiquadFilterNode._create_2(context);
-  }
-  static BiquadFilterNode _create_1(context, options) =>
-      JS('BiquadFilterNode', 'new BiquadFilterNode(#,#)', context, options);
-  static BiquadFilterNode _create_2(context) =>
-      JS('BiquadFilterNode', 'new BiquadFilterNode(#)', context);
-
-  AudioParam get Q native;
-
-  AudioParam get detune native;
-
-  AudioParam get frequency native;
-
-  AudioParam get gain native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  void getFrequencyResponse(Float32List frequencyHz, Float32List magResponse,
-      Float32List phaseResponse) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ChannelMergerNode,AudioChannelMerger")
-class ChannelMergerNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory ChannelMergerNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ChannelMergerNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return ChannelMergerNode._create_1(context, options_1);
-    }
-    return ChannelMergerNode._create_2(context);
-  }
-  static ChannelMergerNode _create_1(context, options) =>
-      JS('ChannelMergerNode', 'new ChannelMergerNode(#,#)', context, options);
-  static ChannelMergerNode _create_2(context) =>
-      JS('ChannelMergerNode', 'new ChannelMergerNode(#)', context);
-}
-// Copyright (c) 2012, 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.
-
-@Native("ChannelSplitterNode,AudioChannelSplitter")
-class ChannelSplitterNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory ChannelSplitterNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ChannelSplitterNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return ChannelSplitterNode._create_1(context, options_1);
-    }
-    return ChannelSplitterNode._create_2(context);
-  }
-  static ChannelSplitterNode _create_1(context, options) => JS(
-      'ChannelSplitterNode', 'new ChannelSplitterNode(#,#)', context, options);
-  static ChannelSplitterNode _create_2(context) =>
-      JS('ChannelSplitterNode', 'new ChannelSplitterNode(#)', context);
-}
-// Copyright (c) 2012, 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.
-
-@Native("ConstantSourceNode")
-class ConstantSourceNode extends AudioScheduledSourceNode {
-  // To suppress missing implicit constructor warnings.
-  factory ConstantSourceNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ConstantSourceNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return ConstantSourceNode._create_1(context, options_1);
-    }
-    return ConstantSourceNode._create_2(context);
-  }
-  static ConstantSourceNode _create_1(context, options) =>
-      JS('ConstantSourceNode', 'new ConstantSourceNode(#,#)', context, options);
-  static ConstantSourceNode _create_2(context) =>
-      JS('ConstantSourceNode', 'new ConstantSourceNode(#)', context);
-
-  AudioParam get offset native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ConvolverNode")
-class ConvolverNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory ConvolverNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ConvolverNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return ConvolverNode._create_1(context, options_1);
-    }
-    return ConvolverNode._create_2(context);
-  }
-  static ConvolverNode _create_1(context, options) =>
-      JS('ConvolverNode', 'new ConvolverNode(#,#)', context, options);
-  static ConvolverNode _create_2(context) =>
-      JS('ConvolverNode', 'new ConvolverNode(#)', context);
-
-  AudioBuffer? get buffer native;
-
-  set buffer(AudioBuffer? value) native;
-
-  bool get normalize native;
-
-  set normalize(bool value) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DelayNode")
-class DelayNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory DelayNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DelayNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return DelayNode._create_1(context, options_1);
-    }
-    return DelayNode._create_2(context);
-  }
-  static DelayNode _create_1(context, options) =>
-      JS('DelayNode', 'new DelayNode(#,#)', context, options);
-  static DelayNode _create_2(context) =>
-      JS('DelayNode', 'new DelayNode(#)', context);
-
-  AudioParam get delayTime native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("DynamicsCompressorNode")
-class DynamicsCompressorNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory DynamicsCompressorNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory DynamicsCompressorNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return DynamicsCompressorNode._create_1(context, options_1);
-    }
-    return DynamicsCompressorNode._create_2(context);
-  }
-  static DynamicsCompressorNode _create_1(context, options) => JS(
-      'DynamicsCompressorNode',
-      'new DynamicsCompressorNode(#,#)',
-      context,
-      options);
-  static DynamicsCompressorNode _create_2(context) =>
-      JS('DynamicsCompressorNode', 'new DynamicsCompressorNode(#)', context);
-
-  AudioParam get attack native;
-
-  AudioParam get knee native;
-
-  AudioParam get ratio native;
-
-  num get reduction native;
-
-  AudioParam get release native;
-
-  AudioParam get threshold native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("GainNode,AudioGainNode")
-class GainNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory GainNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory GainNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return GainNode._create_1(context, options_1);
-    }
-    return GainNode._create_2(context);
-  }
-  static GainNode _create_1(context, options) =>
-      JS('GainNode', 'new GainNode(#,#)', context, options);
-  static GainNode _create_2(context) =>
-      JS('GainNode', 'new GainNode(#)', context);
-
-  AudioParam get gain native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("IIRFilterNode")
-class IirFilterNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory IirFilterNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory IirFilterNode(BaseAudioContext context, Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    return IirFilterNode._create_1(context, options_1);
-  }
-  static IirFilterNode _create_1(context, options) =>
-      JS('IirFilterNode', 'new IIRFilterNode(#,#)', context, options);
-
-  void getFrequencyResponse(Float32List frequencyHz, Float32List magResponse,
-      Float32List phaseResponse) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaElementAudioSourceNode")
-class MediaElementAudioSourceNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory MediaElementAudioSourceNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaElementAudioSourceNode(BaseAudioContext context, Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    return MediaElementAudioSourceNode._create_1(context, options_1);
-  }
-  static MediaElementAudioSourceNode _create_1(context, options) => JS(
-      'MediaElementAudioSourceNode',
-      'new MediaElementAudioSourceNode(#,#)',
-      context,
-      options);
-
-  MediaElement get mediaElement native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaStreamAudioDestinationNode")
-class MediaStreamAudioDestinationNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory MediaStreamAudioDestinationNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaStreamAudioDestinationNode(BaseAudioContext context,
-      [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return MediaStreamAudioDestinationNode._create_1(context, options_1);
-    }
-    return MediaStreamAudioDestinationNode._create_2(context);
-  }
-  static MediaStreamAudioDestinationNode _create_1(context, options) => JS(
-      'MediaStreamAudioDestinationNode',
-      'new MediaStreamAudioDestinationNode(#,#)',
-      context,
-      options);
-  static MediaStreamAudioDestinationNode _create_2(context) => JS(
-      'MediaStreamAudioDestinationNode',
-      'new MediaStreamAudioDestinationNode(#)',
-      context);
-
-  MediaStream get stream native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("MediaStreamAudioSourceNode")
-class MediaStreamAudioSourceNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory MediaStreamAudioSourceNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory MediaStreamAudioSourceNode(BaseAudioContext context, Map options) {
-    var options_1 = convertDartToNative_Dictionary(options);
-    return MediaStreamAudioSourceNode._create_1(context, options_1);
-  }
-  static MediaStreamAudioSourceNode _create_1(context, options) => JS(
-      'MediaStreamAudioSourceNode',
-      'new MediaStreamAudioSourceNode(#,#)',
-      context,
-      options);
-
-  MediaStream get mediaStream native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OfflineAudioCompletionEvent")
-class OfflineAudioCompletionEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory OfflineAudioCompletionEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OfflineAudioCompletionEvent(String type, Map eventInitDict) {
-    var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
-    return OfflineAudioCompletionEvent._create_1(type, eventInitDict_1);
-  }
-  static OfflineAudioCompletionEvent _create_1(type, eventInitDict) => JS(
-      'OfflineAudioCompletionEvent',
-      'new OfflineAudioCompletionEvent(#,#)',
-      type,
-      eventInitDict);
-
-  AudioBuffer get renderedBuffer native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OfflineAudioContext")
-class OfflineAudioContext extends BaseAudioContext {
-  // To suppress missing implicit constructor warnings.
-  factory OfflineAudioContext._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OfflineAudioContext(numberOfChannels_OR_options,
-      [int? numberOfFrames, num? sampleRate]) {
-    if ((sampleRate is num) &&
-        (numberOfFrames is int) &&
-        (numberOfChannels_OR_options is int)) {
-      return OfflineAudioContext._create_1(
-          numberOfChannels_OR_options, numberOfFrames, sampleRate);
-    }
-    if ((numberOfChannels_OR_options is Map) &&
-        numberOfFrames == null &&
-        sampleRate == null) {
-      var options_1 =
-          convertDartToNative_Dictionary(numberOfChannels_OR_options);
-      return OfflineAudioContext._create_2(options_1);
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  static OfflineAudioContext _create_1(
-          numberOfChannels_OR_options, numberOfFrames, sampleRate) =>
-      JS('OfflineAudioContext', 'new OfflineAudioContext(#,#,#)',
-          numberOfChannels_OR_options, numberOfFrames, sampleRate);
-  static OfflineAudioContext _create_2(numberOfChannels_OR_options) => JS(
-      'OfflineAudioContext',
-      'new OfflineAudioContext(#)',
-      numberOfChannels_OR_options);
-
-  int get length native;
-
-  Future<AudioBuffer> startRendering() =>
-      promiseToFuture<AudioBuffer>(JS("", "#.startRendering()", this));
-
-  @JSName('suspend')
-  Future suspendFor(num suspendTime) =>
-      promiseToFuture(JS("", "#.suspend(#)", this, suspendTime));
-}
-// Copyright (c) 2012, 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.
-
-@Native("OscillatorNode,Oscillator")
-class OscillatorNode extends AudioScheduledSourceNode {
-  // To suppress missing implicit constructor warnings.
-  factory OscillatorNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory OscillatorNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return OscillatorNode._create_1(context, options_1);
-    }
-    return OscillatorNode._create_2(context);
-  }
-  static OscillatorNode _create_1(context, options) =>
-      JS('OscillatorNode', 'new OscillatorNode(#,#)', context, options);
-  static OscillatorNode _create_2(context) =>
-      JS('OscillatorNode', 'new OscillatorNode(#)', context);
-
-  AudioParam get detune native;
-
-  AudioParam get frequency native;
-
-  String get type native;
-
-  set type(String value) native;
-
-  void setPeriodicWave(PeriodicWave periodicWave) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PannerNode,AudioPannerNode,webkitAudioPannerNode")
-class PannerNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory PannerNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PannerNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return PannerNode._create_1(context, options_1);
-    }
-    return PannerNode._create_2(context);
-  }
-  static PannerNode _create_1(context, options) =>
-      JS('PannerNode', 'new PannerNode(#,#)', context, options);
-  static PannerNode _create_2(context) =>
-      JS('PannerNode', 'new PannerNode(#)', context);
-
-  num get coneInnerAngle native;
-
-  set coneInnerAngle(num value) native;
-
-  num get coneOuterAngle native;
-
-  set coneOuterAngle(num value) native;
-
-  num get coneOuterGain native;
-
-  set coneOuterGain(num value) native;
-
-  String get distanceModel native;
-
-  set distanceModel(String value) native;
-
-  num get maxDistance native;
-
-  set maxDistance(num value) native;
-
-  AudioParam get orientationX native;
-
-  AudioParam get orientationY native;
-
-  AudioParam get orientationZ native;
-
-  String get panningModel native;
-
-  set panningModel(String value) native;
-
-  AudioParam get positionX native;
-
-  AudioParam get positionY native;
-
-  AudioParam get positionZ native;
-
-  num get refDistance native;
-
-  set refDistance(num value) native;
-
-  num get rolloffFactor native;
-
-  set rolloffFactor(num value) native;
-
-  void setOrientation(num x, num y, num z) native;
-
-  void setPosition(num x, num y, num z) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("PeriodicWave")
-class PeriodicWave extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory PeriodicWave._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory PeriodicWave(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return PeriodicWave._create_1(context, options_1);
-    }
-    return PeriodicWave._create_2(context);
-  }
-  static PeriodicWave _create_1(context, options) =>
-      JS('PeriodicWave', 'new PeriodicWave(#,#)', context, options);
-  static PeriodicWave _create_2(context) =>
-      JS('PeriodicWave', 'new PeriodicWave(#)', context);
-}
-// Copyright (c) 2012, 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.
-
-@Native("ScriptProcessorNode,JavaScriptAudioNode")
-class ScriptProcessorNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory ScriptProcessorNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /**
-   * Static factory designed to expose `audioprocess` events to event
-   * handlers that are not necessarily instances of [ScriptProcessorNode].
-   *
-   * See [EventStreamProvider] for usage information.
-   */
-  static const EventStreamProvider<AudioProcessingEvent> audioProcessEvent =
-      const EventStreamProvider<AudioProcessingEvent>('audioprocess');
-
-  int get bufferSize native;
-
-  void setEventListener(EventListener eventListener) native;
-
-  /// Stream of `audioprocess` events handled by this [ScriptProcessorNode].
-/**
-   * Get a Stream that fires events when AudioProcessingEvents occur.
-   * This particular stream is special in that it only allows one listener to a
-   * given stream. Converting the returned Stream [asBroadcast] will likely ruin
-   * the soft-real-time properties which which these events are fired and can
-   * be processed.
-   */
-  Stream<AudioProcessingEvent> get onAudioProcess =>
-      audioProcessEvent.forTarget(this);
-}
-// Copyright (c) 2012, 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.
-
-@Native("StereoPannerNode")
-class StereoPannerNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory StereoPannerNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory StereoPannerNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return StereoPannerNode._create_1(context, options_1);
-    }
-    return StereoPannerNode._create_2(context);
-  }
-  static StereoPannerNode _create_1(context, options) =>
-      JS('StereoPannerNode', 'new StereoPannerNode(#,#)', context, options);
-  static StereoPannerNode _create_2(context) =>
-      JS('StereoPannerNode', 'new StereoPannerNode(#)', context);
-
-  AudioParam get pan native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WaveShaperNode")
-class WaveShaperNode extends AudioNode {
-  // To suppress missing implicit constructor warnings.
-  factory WaveShaperNode._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory WaveShaperNode(BaseAudioContext context, [Map? options]) {
-    if (options != null) {
-      var options_1 = convertDartToNative_Dictionary(options);
-      return WaveShaperNode._create_1(context, options_1);
-    }
-    return WaveShaperNode._create_2(context);
-  }
-  static WaveShaperNode _create_1(context, options) =>
-      JS('WaveShaperNode', 'new WaveShaperNode(#,#)', context, options);
-  static WaveShaperNode _create_2(context) =>
-      JS('WaveShaperNode', 'new WaveShaperNode(#)', context);
-
-  Float32List? get curve native;
-
-  set curve(Float32List? value) native;
-
-  String get oversample native;
-
-  set oversample(String value) native;
-}
diff --git a/sdk_nnbd/lib/web_gl/dart2js/web_gl_dart2js.dart b/sdk_nnbd/lib/web_gl/dart2js/web_gl_dart2js.dart
deleted file mode 100644
index 53671df..0000000
--- a/sdk_nnbd/lib/web_gl/dart2js/web_gl_dart2js.dart
+++ /dev/null
@@ -1,4182 +0,0 @@
-/**
- * 3D programming in the browser.
- *
- * {@category Web}
- */
-library dart.dom.web_gl;
-
-import 'dart:async';
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' show FixedLengthListMixin;
-import 'dart:html';
-import 'dart:html_common';
-import 'dart:_native_typed_data';
-import 'dart:typed_data';
-import 'dart:_js_helper'
-    show Creates, JSName, Native, Returns, convertDartClosureToJS;
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show Interceptor, JSExtendableArray;
-// DO NOT EDIT - unless you are editing documentation as per:
-// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
-// Auto-generated dart:web_gl library.
-
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("WebGLActiveInfo")
-class ActiveInfo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ActiveInfo._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String get name native;
-
-  int get size native;
-
-  int get type native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("ANGLEInstancedArrays,ANGLE_instanced_arrays")
-class AngleInstancedArrays extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory AngleInstancedArrays._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
-
-  @JSName('drawArraysInstancedANGLE')
-  void drawArraysInstancedAngle(int mode, int first, int count, int primcount)
-      native;
-
-  @JSName('drawElementsInstancedANGLE')
-  void drawElementsInstancedAngle(
-      int mode, int count, int type, int offset, int primcount) native;
-
-  @JSName('vertexAttribDivisorANGLE')
-  void vertexAttribDivisorAngle(int index, int divisor) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("WebGLBuffer")
-class Buffer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Buffer._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2013, 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.
-
-@Native("WebGLCanvas")
-class Canvas extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Canvas._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('canvas')
-  CanvasElement get canvas native;
-
-  @JSName('canvas')
-  OffscreenCanvas get offscreenCanvas native;
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("WebGLColorBufferFloat")
-class ColorBufferFloat extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ColorBufferFloat._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTextureASTC")
-class CompressedTextureAstc extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTextureAstc._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
-
-  static const int COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
-
-  static const int COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
-
-  static const int COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
-
-  static const int COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
-
-  static const int COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
-
-  static const int COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
-
-  static const int COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
-
-  static const int COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
-
-  static const int COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
-
-  static const int COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
-
-  static const int COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
-
-  static const int COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
-
-  static const int COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTextureATC,WEBGL_compressed_texture_atc")
-class CompressedTextureAtc extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTextureAtc._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
-
-  static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
-
-  static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTextureETC1,WEBGL_compressed_texture_etc1")
-class CompressedTextureETC1 extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTextureETC1._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTextureETC")
-class CompressedTextureEtc extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTextureEtc._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_R11_EAC = 0x9270;
-
-  static const int COMPRESSED_RG11_EAC = 0x9272;
-
-  static const int COMPRESSED_RGB8_ETC2 = 0x9274;
-
-  static const int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
-
-  static const int COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
-
-  static const int COMPRESSED_SIGNED_R11_EAC = 0x9271;
-
-  static const int COMPRESSED_SIGNED_RG11_EAC = 0x9273;
-
-  static const int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
-
-  static const int COMPRESSED_SRGB8_ETC2 = 0x9275;
-
-  static const int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTexturePVRTC,WEBGL_compressed_texture_pvrtc")
-class CompressedTexturePvrtc extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTexturePvrtc._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
-
-  static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
-
-  static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
-
-  static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTextureS3TC,WEBGL_compressed_texture_s3tc")
-class CompressedTextureS3TC extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTextureS3TC._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
-
-  static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
-
-  static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-
-  static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLCompressedTextureS3TCsRGB")
-class CompressedTextureS3TCsRgb extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory CompressedTextureS3TCsRgb._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
-
-  static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
-
-  static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
-
-  static const int COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("WebGLContextEvent")
-class ContextEvent extends Event {
-  // To suppress missing implicit constructor warnings.
-  factory ContextEvent._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  factory ContextEvent(String type, [Map? eventInit]) {
-    if (eventInit != null) {
-      var eventInit_1 = convertDartToNative_Dictionary(eventInit);
-      return ContextEvent._create_1(type, eventInit_1);
-    }
-    return ContextEvent._create_2(type);
-  }
-  static ContextEvent _create_1(type, eventInit) =>
-      JS('ContextEvent', 'new WebGLContextEvent(#,#)', type, eventInit);
-  static ContextEvent _create_2(type) =>
-      JS('ContextEvent', 'new WebGLContextEvent(#)', type);
-
-  String get statusMessage native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLDebugRendererInfo,WEBGL_debug_renderer_info")
-class DebugRendererInfo extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DebugRendererInfo._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int UNMASKED_RENDERER_WEBGL = 0x9246;
-
-  static const int UNMASKED_VENDOR_WEBGL = 0x9245;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLDebugShaders,WEBGL_debug_shaders")
-class DebugShaders extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DebugShaders._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  String? getTranslatedShaderSource(Shader shader) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLDepthTexture,WEBGL_depth_texture")
-class DepthTexture extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DepthTexture._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLDrawBuffers,WEBGL_draw_buffers")
-class DrawBuffers extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory DrawBuffers._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('drawBuffersWEBGL')
-  void drawBuffersWebgl(List<int> buffers) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTsRGB,EXT_sRGB")
-class EXTsRgb extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory EXTsRgb._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
-
-  static const int SRGB8_ALPHA8_EXT = 0x8C43;
-
-  static const int SRGB_ALPHA_EXT = 0x8C42;
-
-  static const int SRGB_EXT = 0x8C40;
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTBlendMinMax,EXT_blend_minmax")
-class ExtBlendMinMax extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtBlendMinMax._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int MAX_EXT = 0x8008;
-
-  static const int MIN_EXT = 0x8007;
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTColorBufferFloat")
-class ExtColorBufferFloat extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtColorBufferFloat._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTColorBufferHalfFloat")
-class ExtColorBufferHalfFloat extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtColorBufferHalfFloat._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTDisjointTimerQuery")
-class ExtDisjointTimerQuery extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtDisjointTimerQuery._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int CURRENT_QUERY_EXT = 0x8865;
-
-  static const int GPU_DISJOINT_EXT = 0x8FBB;
-
-  static const int QUERY_COUNTER_BITS_EXT = 0x8864;
-
-  static const int QUERY_RESULT_AVAILABLE_EXT = 0x8867;
-
-  static const int QUERY_RESULT_EXT = 0x8866;
-
-  static const int TIMESTAMP_EXT = 0x8E28;
-
-  static const int TIME_ELAPSED_EXT = 0x88BF;
-
-  @JSName('beginQueryEXT')
-  void beginQueryExt(int target, TimerQueryExt query) native;
-
-  @JSName('createQueryEXT')
-  TimerQueryExt createQueryExt() native;
-
-  @JSName('deleteQueryEXT')
-  void deleteQueryExt(TimerQueryExt? query) native;
-
-  @JSName('endQueryEXT')
-  void endQueryExt(int target) native;
-
-  @JSName('getQueryEXT')
-  Object? getQueryExt(int target, int pname) native;
-
-  @JSName('getQueryObjectEXT')
-  Object? getQueryObjectExt(TimerQueryExt query, int pname) native;
-
-  @JSName('isQueryEXT')
-  bool isQueryExt(TimerQueryExt? query) native;
-
-  @JSName('queryCounterEXT')
-  void queryCounterExt(TimerQueryExt query, int target) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTDisjointTimerQueryWebGL2")
-class ExtDisjointTimerQueryWebGL2 extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtDisjointTimerQueryWebGL2._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int GPU_DISJOINT_EXT = 0x8FBB;
-
-  static const int QUERY_COUNTER_BITS_EXT = 0x8864;
-
-  static const int TIMESTAMP_EXT = 0x8E28;
-
-  static const int TIME_ELAPSED_EXT = 0x88BF;
-
-  @JSName('queryCounterEXT')
-  void queryCounterExt(Query query, int target) native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTFragDepth,EXT_frag_depth")
-class ExtFragDepth extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtFragDepth._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTShaderTextureLOD,EXT_shader_texture_lod")
-class ExtShaderTextureLod extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtShaderTextureLod._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("EXTTextureFilterAnisotropic,EXT_texture_filter_anisotropic")
-class ExtTextureFilterAnisotropic extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ExtTextureFilterAnisotropic._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
-
-  static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("WebGLFramebuffer")
-class Framebuffer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Framebuffer._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLGetBufferSubDataAsync")
-class GetBufferSubDataAsync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory GetBufferSubDataAsync._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Future getBufferSubDataAsync(int target, int srcByteOffset, TypedData dstData,
-          [int? dstOffset, int? length]) =>
-      promiseToFuture(JS("", "#.getBufferSubDataAsync(#, #, #, #, #)", this,
-          target, srcByteOffset, dstData, dstOffset, length));
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLLoseContext,WebGLExtensionLoseContext,WEBGL_lose_context")
-class LoseContext extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory LoseContext._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  void loseContext() native;
-
-  void restoreContext() native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESElementIndexUint,OES_element_index_uint")
-class OesElementIndexUint extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesElementIndexUint._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESStandardDerivatives,OES_standard_derivatives")
-class OesStandardDerivatives extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesStandardDerivatives._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESTextureFloat,OES_texture_float")
-class OesTextureFloat extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesTextureFloat._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESTextureFloatLinear,OES_texture_float_linear")
-class OesTextureFloatLinear extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesTextureFloatLinear._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESTextureHalfFloat,OES_texture_half_float")
-class OesTextureHalfFloat extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesTextureHalfFloat._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int HALF_FLOAT_OES = 0x8D61;
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESTextureHalfFloatLinear,OES_texture_half_float_linear")
-class OesTextureHalfFloatLinear extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesTextureHalfFloatLinear._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("OESVertexArrayObject,OES_vertex_array_object")
-class OesVertexArrayObject extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory OesVertexArrayObject._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
-
-  @JSName('bindVertexArrayOES')
-  void bindVertexArray(VertexArrayObjectOes? arrayObject) native;
-
-  @JSName('createVertexArrayOES')
-  VertexArrayObjectOes createVertexArray() native;
-
-  @JSName('deleteVertexArrayOES')
-  void deleteVertexArray(VertexArrayObjectOes? arrayObject) native;
-
-  @JSName('isVertexArrayOES')
-  bool isVertexArray(VertexArrayObjectOes? arrayObject) native;
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("WebGLProgram")
-class Program extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Program._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLQuery")
-class Query extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Query._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Unstable()
-@Native("WebGLRenderbuffer")
-class Renderbuffer extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Renderbuffer._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2013, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@Unstable()
-@Native("WebGLRenderingContext")
-class RenderingContext extends Interceptor implements CanvasRenderingContext {
-  // To suppress missing implicit constructor warnings.
-  factory RenderingContext._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');
-
-  CanvasElement get canvas native;
-
-  // From WebGLRenderingContextBase
-
-  int get drawingBufferHeight native;
-
-  int get drawingBufferWidth native;
-
-  void activeTexture(int texture) native;
-
-  void attachShader(Program program, Shader shader) native;
-
-  void bindAttribLocation(Program program, int index, String name) native;
-
-  void bindBuffer(int target, Buffer? buffer) native;
-
-  void bindFramebuffer(int target, Framebuffer? framebuffer) native;
-
-  void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
-
-  void bindTexture(int target, Texture? texture) native;
-
-  void blendColor(num red, num green, num blue, num alpha) native;
-
-  void blendEquation(int mode) native;
-
-  void blendEquationSeparate(int modeRGB, int modeAlpha) native;
-
-  void blendFunc(int sfactor, int dfactor) native;
-
-  void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
-      native;
-
-  void bufferData(int target, data_OR_size, int usage) native;
-
-  void bufferSubData(int target, int offset, data) native;
-
-  int checkFramebufferStatus(int target) native;
-
-  void clear(int mask) native;
-
-  void clearColor(num red, num green, num blue, num alpha) native;
-
-  void clearDepth(num depth) native;
-
-  void clearStencil(int s) native;
-
-  void colorMask(bool red, bool green, bool blue, bool alpha) native;
-
-  Future commit() => promiseToFuture(JS("", "#.commit()", this));
-
-  void compileShader(Shader shader) native;
-
-  void compressedTexImage2D(int target, int level, int internalformat,
-      int width, int height, int border, TypedData data) native;
-
-  void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
-      int width, int height, int format, TypedData data) native;
-
-  void copyTexImage2D(int target, int level, int internalformat, int x, int y,
-      int width, int height, int border) native;
-
-  void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x,
-      int y, int width, int height) native;
-
-  Buffer createBuffer() native;
-
-  Framebuffer createFramebuffer() native;
-
-  Program createProgram() native;
-
-  Renderbuffer createRenderbuffer() native;
-
-  Shader createShader(int type) native;
-
-  Texture createTexture() native;
-
-  void cullFace(int mode) native;
-
-  void deleteBuffer(Buffer? buffer) native;
-
-  void deleteFramebuffer(Framebuffer? framebuffer) native;
-
-  void deleteProgram(Program? program) native;
-
-  void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
-
-  void deleteShader(Shader? shader) native;
-
-  void deleteTexture(Texture? texture) native;
-
-  void depthFunc(int func) native;
-
-  void depthMask(bool flag) native;
-
-  void depthRange(num zNear, num zFar) native;
-
-  void detachShader(Program program, Shader shader) native;
-
-  void disable(int cap) native;
-
-  void disableVertexAttribArray(int index) native;
-
-  void drawArrays(int mode, int first, int count) native;
-
-  void drawElements(int mode, int count, int type, int offset) native;
-
-  void enable(int cap) native;
-
-  void enableVertexAttribArray(int index) native;
-
-  void finish() native;
-
-  void flush() native;
-
-  void framebufferRenderbuffer(int target, int attachment,
-      int renderbuffertarget, Renderbuffer? renderbuffer) native;
-
-  void framebufferTexture2D(int target, int attachment, int textarget,
-      Texture? texture, int level) native;
-
-  void frontFace(int mode) native;
-
-  void generateMipmap(int target) native;
-
-  ActiveInfo getActiveAttrib(Program program, int index) native;
-
-  ActiveInfo getActiveUniform(Program program, int index) native;
-
-  List<Shader>? getAttachedShaders(Program program) native;
-
-  int getAttribLocation(Program program, String name) native;
-
-  @Creates('int|Null')
-  @Returns('int|Null')
-  Object? getBufferParameter(int target, int pname) native;
-
-  @Creates('ContextAttributes|Null')
-  Map? getContextAttributes() {
-    return convertNativeToDart_Dictionary(_getContextAttributes_1());
-  }
-
-  @JSName('getContextAttributes')
-  @Creates('ContextAttributes|Null')
-  _getContextAttributes_1() native;
-
-  int getError() native;
-
-  Object? getExtension(String name) native;
-
-  @Creates('int|Renderbuffer|Texture|Null')
-  @Returns('int|Renderbuffer|Texture|Null')
-  Object? getFramebufferAttachmentParameter(
-      int target, int attachment, int pname) native;
-
-  @Creates(
-      'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
-  @Returns(
-      'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
-  Object? getParameter(int pname) native;
-
-  String? getProgramInfoLog(Program program) native;
-
-  @Creates('int|bool|Null')
-  @Returns('int|bool|Null')
-  Object? getProgramParameter(Program program, int pname) native;
-
-  @Creates('int|Null')
-  @Returns('int|Null')
-  Object? getRenderbufferParameter(int target, int pname) native;
-
-  String? getShaderInfoLog(Shader shader) native;
-
-  @Creates('int|bool|Null')
-  @Returns('int|bool|Null')
-  Object? getShaderParameter(Shader shader, int pname) native;
-
-  ShaderPrecisionFormat getShaderPrecisionFormat(
-      int shadertype, int precisiontype) native;
-
-  String? getShaderSource(Shader shader) native;
-
-  List<String>? getSupportedExtensions() native;
-
-  @Creates('int|Null')
-  @Returns('int|Null')
-  Object? getTexParameter(int target, int pname) native;
-
-  @Creates(
-      'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
-  @Returns(
-      'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
-  Object? getUniform(Program program, UniformLocation location) native;
-
-  UniformLocation getUniformLocation(Program program, String name) native;
-
-  @Creates('Null|num|bool|NativeFloat32List|Buffer')
-  @Returns('Null|num|bool|NativeFloat32List|Buffer')
-  Object? getVertexAttrib(int index, int pname) native;
-
-  int getVertexAttribOffset(int index, int pname) native;
-
-  void hint(int target, int mode) native;
-
-  bool isBuffer(Buffer? buffer) native;
-
-  bool isContextLost() native;
-
-  bool isEnabled(int cap) native;
-
-  bool isFramebuffer(Framebuffer? framebuffer) native;
-
-  bool isProgram(Program? program) native;
-
-  bool isRenderbuffer(Renderbuffer? renderbuffer) native;
-
-  bool isShader(Shader? shader) native;
-
-  bool isTexture(Texture? texture) native;
-
-  void lineWidth(num width) native;
-
-  void linkProgram(Program program) native;
-
-  void pixelStorei(int pname, int param) native;
-
-  void polygonOffset(num factor, num units) native;
-
-  @JSName('readPixels')
-  void _readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData? pixels) native;
-
-  void renderbufferStorage(
-      int target, int internalformat, int width, int height) native;
-
-  void sampleCoverage(num value, bool invert) native;
-
-  void scissor(int x, int y, int width, int height) native;
-
-  void shaderSource(Shader shader, String string) native;
-
-  void stencilFunc(int func, int ref, int mask) native;
-
-  void stencilFuncSeparate(int face, int func, int ref, int mask) native;
-
-  void stencilMask(int mask) native;
-
-  void stencilMaskSeparate(int face, int mask) native;
-
-  void stencilOp(int fail, int zfail, int zpass) native;
-
-  void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
-
-  void texImage2D(
-      int target,
-      int level,
-      int internalformat,
-      int format_OR_width,
-      int height_OR_type,
-      bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
-      [int? format,
-      int? type,
-      TypedData? pixels]) {
-    if (type != null &&
-        format != null &&
-        (bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
-      _texImage2D_1(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
-          format,
-          type,
-          pixels);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      var pixels_1 = convertDartToNative_ImageData(
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      _texImage2D_2(target, level, internalformat, format_OR_width,
-          height_OR_type, pixels_1);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is ImageElement) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_3(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is CanvasElement) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_4(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is VideoElement) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_5(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is ImageBitmap) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_6(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texImage2D')
-  void _texImage2D_1(target, level, internalformat, width, height, int border,
-      format, type, TypedData? pixels) native;
-  @JSName('texImage2D')
-  void _texImage2D_2(target, level, internalformat, format, type, pixels)
-      native;
-  @JSName('texImage2D')
-  void _texImage2D_3(
-      target, level, internalformat, format, type, ImageElement image) native;
-  @JSName('texImage2D')
-  void _texImage2D_4(
-      target, level, internalformat, format, type, CanvasElement canvas) native;
-  @JSName('texImage2D')
-  void _texImage2D_5(
-      target, level, internalformat, format, type, VideoElement video) native;
-  @JSName('texImage2D')
-  void _texImage2D_6(
-      target, level, internalformat, format, type, ImageBitmap bitmap) native;
-
-  void texParameterf(int target, int pname, num param) native;
-
-  void texParameteri(int target, int pname, int param) native;
-
-  void texSubImage2D(
-      int target,
-      int level,
-      int xoffset,
-      int yoffset,
-      int format_OR_width,
-      int height_OR_type,
-      bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
-      [int? type,
-      TypedData? pixels]) {
-    if (type != null &&
-        (bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is int)) {
-      _texSubImage2D_1(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
-          type,
-          pixels);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData) &&
-        type == null &&
-        pixels == null) {
-      var pixels_1 = convertDartToNative_ImageData(
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width,
-          height_OR_type, pixels_1);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is ImageElement) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_3(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is CanvasElement) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_4(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is VideoElement) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_5(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is ImageBitmap) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_6(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texSubImage2D')
-  void _texSubImage2D_1(target, level, xoffset, yoffset, width, height,
-      int format, type, TypedData? pixels) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels)
-      native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_3(
-      target, level, xoffset, yoffset, format, type, ImageElement image) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_4(target, level, xoffset, yoffset, format, type,
-      CanvasElement canvas) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_5(
-      target, level, xoffset, yoffset, format, type, VideoElement video) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_6(
-      target, level, xoffset, yoffset, format, type, ImageBitmap bitmap) native;
-
-  void uniform1f(UniformLocation? location, num x) native;
-
-  void uniform1fv(UniformLocation? location, v) native;
-
-  void uniform1i(UniformLocation? location, int x) native;
-
-  void uniform1iv(UniformLocation? location, v) native;
-
-  void uniform2f(UniformLocation? location, num x, num y) native;
-
-  void uniform2fv(UniformLocation? location, v) native;
-
-  void uniform2i(UniformLocation? location, int x, int y) native;
-
-  void uniform2iv(UniformLocation? location, v) native;
-
-  void uniform3f(UniformLocation? location, num x, num y, num z) native;
-
-  void uniform3fv(UniformLocation? location, v) native;
-
-  void uniform3i(UniformLocation? location, int x, int y, int z) native;
-
-  void uniform3iv(UniformLocation? location, v) native;
-
-  void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
-
-  void uniform4fv(UniformLocation? location, v) native;
-
-  void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
-
-  void uniform4iv(UniformLocation? location, v) native;
-
-  void uniformMatrix2fv(UniformLocation? location, bool transpose, array)
-      native;
-
-  void uniformMatrix3fv(UniformLocation? location, bool transpose, array)
-      native;
-
-  void uniformMatrix4fv(UniformLocation? location, bool transpose, array)
-      native;
-
-  void useProgram(Program? program) native;
-
-  void validateProgram(Program program) native;
-
-  void vertexAttrib1f(int indx, num x) native;
-
-  void vertexAttrib1fv(int indx, values) native;
-
-  void vertexAttrib2f(int indx, num x, num y) native;
-
-  void vertexAttrib2fv(int indx, values) native;
-
-  void vertexAttrib3f(int indx, num x, num y, num z) native;
-
-  void vertexAttrib3fv(int indx, values) native;
-
-  void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
-
-  void vertexAttrib4fv(int indx, values) native;
-
-  void vertexAttribPointer(int indx, int size, int type, bool normalized,
-      int stride, int offset) native;
-
-  void viewport(int x, int y, int width, int height) native;
-
-  void readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData? pixels) {
-    _readPixels(x, y, width, height, format, type, pixels);
-  }
-
-  /**
-   * Sets the currently bound texture to [data].
-   *
-   * [data] can be either an [ImageElement], a
-   * [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object.
-   *
-   * This is deprecated in favor of [texImage2D].
-   */
-  @Deprecated("Use texImage2D")
-  void texImage2DUntyped(int targetTexture, int levelOfDetail,
-      int internalFormat, int format, int type, data) {
-    texImage2D(
-        targetTexture, levelOfDetail, internalFormat, format, type, data);
-  }
-
-  /**
-   * Sets the currently bound texture to [data].
-   *
-   * This is deprecated in favour of [texImage2D].
-   */
-  @Deprecated("Use texImage2D")
-  void texImage2DTyped(int targetTexture, int levelOfDetail, int internalFormat,
-      int width, int height, int border, int format, int type, TypedData data) {
-    texImage2D(targetTexture, levelOfDetail, internalFormat, width, height,
-        border, format, type, data);
-  }
-
-  /**
-   * Updates a sub-rectangle of the currently bound texture to [data].
-   *
-   * [data] can be either an [ImageElement], a
-   * [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object.
-   *
-   */
-  @Deprecated("Use texSubImage2D")
-  void texSubImage2DUntyped(int targetTexture, int levelOfDetail, int xOffset,
-      int yOffset, int format, int type, data) {
-    texSubImage2D(
-        targetTexture, levelOfDetail, xOffset, yOffset, format, type, data);
-  }
-
-  /**
-   * Updates a sub-rectangle of the currently bound texture to [data].
-   */
-  @Deprecated("Use texSubImage2D")
-  void texSubImage2DTyped(
-      int targetTexture,
-      int levelOfDetail,
-      int xOffset,
-      int yOffset,
-      int width,
-      int height,
-      int border,
-      int format,
-      int type,
-      TypedData data) {
-    texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, width, height,
-        format, type, data);
-  }
-
-  /**
-   * Set the bufferData to [data].
-   */
-  @Deprecated("Use bufferData")
-  void bufferDataTyped(int target, TypedData data, int usage) {
-    bufferData(target, data, usage);
-  }
-
-  /**
-   * Set the bufferSubData to [data].
-   */
-  @Deprecated("Use bufferSubData")
-  void bufferSubDataTyped(int target, int offset, TypedData data) {
-    bufferSubData(target, offset, data);
-  }
-}
-// Copyright (c) 2013, 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.
-
-@Native("WebGL2RenderingContext")
-class RenderingContext2 extends Interceptor
-    implements _WebGL2RenderingContextBase, _WebGLRenderingContextBase {
-  // To suppress missing implicit constructor warnings.
-  factory RenderingContext2._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  Canvas get canvas native;
-
-  // From WebGL2RenderingContextBase
-
-  void beginQuery(int target, Query query) native;
-
-  void beginTransformFeedback(int primitiveMode) native;
-
-  void bindBufferBase(int target, int index, Buffer? buffer) native;
-
-  void bindBufferRange(
-      int target, int index, Buffer? buffer, int offset, int size) native;
-
-  void bindSampler(int unit, Sampler? sampler) native;
-
-  void bindTransformFeedback(int target, TransformFeedback? feedback) native;
-
-  void bindVertexArray(VertexArrayObject? vertexArray) native;
-
-  void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0,
-      int dstY0, int dstX1, int dstY1, int mask, int filter) native;
-
-  @JSName('bufferData')
-  void bufferData2(int target, TypedData srcData, int usage, int srcOffset,
-      [int? length]) native;
-
-  @JSName('bufferSubData')
-  void bufferSubData2(
-      int target, int dstByteOffset, TypedData srcData, int srcOffset,
-      [int? length]) native;
-
-  void clearBufferfi(int buffer, int drawbuffer, num depth, int stencil) native;
-
-  void clearBufferfv(int buffer, int drawbuffer, value, [int? srcOffset])
-      native;
-
-  void clearBufferiv(int buffer, int drawbuffer, value, [int? srcOffset])
-      native;
-
-  void clearBufferuiv(int buffer, int drawbuffer, value, [int? srcOffset])
-      native;
-
-  int clientWaitSync(Sync sync, int flags, int timeout) native;
-
-  @JSName('compressedTexImage2D')
-  void compressedTexImage2D2(int target, int level, int internalformat,
-      int width, int height, int border, TypedData data, int srcOffset,
-      [int? srcLengthOverride]) native;
-
-  @JSName('compressedTexImage2D')
-  void compressedTexImage2D3(int target, int level, int internalformat,
-      int width, int height, int border, int imageSize, int offset) native;
-
-  void compressedTexImage3D(int target, int level, int internalformat,
-      int width, int height, int depth, int border, TypedData data,
-      [int? srcOffset, int? srcLengthOverride]) native;
-
-  @JSName('compressedTexImage3D')
-  void compressedTexImage3D2(
-      int target,
-      int level,
-      int internalformat,
-      int width,
-      int height,
-      int depth,
-      int border,
-      int imageSize,
-      int offset) native;
-
-  @JSName('compressedTexSubImage2D')
-  void compressedTexSubImage2D2(int target, int level, int xoffset, int yoffset,
-      int width, int height, int format, TypedData data, int srcOffset,
-      [int? srcLengthOverride]) native;
-
-  @JSName('compressedTexSubImage2D')
-  void compressedTexSubImage2D3(int target, int level, int xoffset, int yoffset,
-      int width, int height, int format, int imageSize, int offset) native;
-
-  void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset,
-      int zoffset, int width, int height, int depth, int format, TypedData data,
-      [int? srcOffset, int? srcLengthOverride]) native;
-
-  @JSName('compressedTexSubImage3D')
-  void compressedTexSubImage3D2(
-      int target,
-      int level,
-      int xoffset,
-      int yoffset,
-      int zoffset,
-      int width,
-      int height,
-      int depth,
-      int format,
-      int imageSize,
-      int offset) native;
-
-  void copyBufferSubData(int readTarget, int writeTarget, int readOffset,
-      int writeOffset, int size) native;
-
-  void copyTexSubImage3D(int target, int level, int xoffset, int yoffset,
-      int zoffset, int x, int y, int width, int height) native;
-
-  Query? createQuery() native;
-
-  Sampler? createSampler() native;
-
-  TransformFeedback? createTransformFeedback() native;
-
-  VertexArrayObject? createVertexArray() native;
-
-  void deleteQuery(Query? query) native;
-
-  void deleteSampler(Sampler? sampler) native;
-
-  void deleteSync(Sync? sync) native;
-
-  void deleteTransformFeedback(TransformFeedback? feedback) native;
-
-  void deleteVertexArray(VertexArrayObject? vertexArray) native;
-
-  void drawArraysInstanced(int mode, int first, int count, int instanceCount)
-      native;
-
-  void drawBuffers(List<int> buffers) native;
-
-  void drawElementsInstanced(
-      int mode, int count, int type, int offset, int instanceCount) native;
-
-  void drawRangeElements(
-      int mode, int start, int end, int count, int type, int offset) native;
-
-  void endQuery(int target) native;
-
-  void endTransformFeedback() native;
-
-  Sync? fenceSync(int condition, int flags) native;
-
-  void framebufferTextureLayer(int target, int attachment, Texture? texture,
-      int level, int layer) native;
-
-  String? getActiveUniformBlockName(Program program, int uniformBlockIndex)
-      native;
-
-  Object? getActiveUniformBlockParameter(
-      Program program, int uniformBlockIndex, int pname) native;
-
-  Object? getActiveUniforms(
-      Program program, List<int> uniformIndices, int pname) native;
-
-  void getBufferSubData(int target, int srcByteOffset, TypedData dstData,
-      [int? dstOffset, int? length]) native;
-
-  int getFragDataLocation(Program program, String name) native;
-
-  Object? getIndexedParameter(int target, int index) native;
-
-  Object? getInternalformatParameter(int target, int internalformat, int pname)
-      native;
-
-  Object? getQuery(int target, int pname) native;
-
-  Object? getQueryParameter(Query query, int pname) native;
-
-  Object? getSamplerParameter(Sampler sampler, int pname) native;
-
-  Object? getSyncParameter(Sync sync, int pname) native;
-
-  ActiveInfo? getTransformFeedbackVarying(Program program, int index) native;
-
-  int getUniformBlockIndex(Program program, String uniformBlockName) native;
-
-  List<int>? getUniformIndices(Program program, List<String> uniformNames) {
-    List uniformNames_1 = convertDartToNative_StringArray(uniformNames);
-    return _getUniformIndices_1(program, uniformNames_1);
-  }
-
-  @JSName('getUniformIndices')
-  List<int>? _getUniformIndices_1(Program program, List uniformNames) native;
-
-  void invalidateFramebuffer(int target, List<int> attachments) native;
-
-  void invalidateSubFramebuffer(int target, List<int> attachments, int x, int y,
-      int width, int height) native;
-
-  bool isQuery(Query? query) native;
-
-  bool isSampler(Sampler? sampler) native;
-
-  bool isSync(Sync? sync) native;
-
-  bool isTransformFeedback(TransformFeedback? feedback) native;
-
-  bool isVertexArray(VertexArrayObject? vertexArray) native;
-
-  void pauseTransformFeedback() native;
-
-  void readBuffer(int mode) native;
-
-  @JSName('readPixels')
-  void readPixels2(int x, int y, int width, int height, int format, int type,
-      dstData_OR_offset,
-      [int? offset]) native;
-
-  void renderbufferStorageMultisample(int target, int samples,
-      int internalformat, int width, int height) native;
-
-  void resumeTransformFeedback() native;
-
-  void samplerParameterf(Sampler sampler, int pname, num param) native;
-
-  void samplerParameteri(Sampler sampler, int pname, int param) native;
-
-  void texImage2D2(
-      int target,
-      int level,
-      int internalformat,
-      int width,
-      int height,
-      int border,
-      int format,
-      int type,
-      bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
-      [int? srcOffset]) {
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is int) &&
-        srcOffset == null) {
-      _texImage2D2_1(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is ImageData) &&
-        srcOffset == null) {
-      var data_1 = convertDartToNative_ImageData(
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      _texImage2D2_2(target, level, internalformat, width, height, border,
-          format, type, data_1);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is ImageElement) &&
-        srcOffset == null) {
-      _texImage2D2_3(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is CanvasElement) &&
-        srcOffset == null) {
-      _texImage2D2_4(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is VideoElement) &&
-        srcOffset == null) {
-      _texImage2D2_5(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is ImageBitmap) &&
-        srcOffset == null) {
-      _texImage2D2_6(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if (srcOffset != null &&
-        (bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is TypedData)) {
-      _texImage2D2_7(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
-          srcOffset);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texImage2D')
-  void _texImage2D2_1(target, level, internalformat, width, height, border,
-      format, type, int offset) native;
-  @JSName('texImage2D')
-  void _texImage2D2_2(target, level, internalformat, width, height, border,
-      format, type, data) native;
-  @JSName('texImage2D')
-  void _texImage2D2_3(target, level, internalformat, width, height, border,
-      format, type, ImageElement image) native;
-  @JSName('texImage2D')
-  void _texImage2D2_4(target, level, internalformat, width, height, border,
-      format, type, CanvasElement canvas) native;
-  @JSName('texImage2D')
-  void _texImage2D2_5(target, level, internalformat, width, height, border,
-      format, type, VideoElement video) native;
-  @JSName('texImage2D')
-  void _texImage2D2_6(target, level, internalformat, width, height, border,
-      format, type, ImageBitmap bitmap) native;
-  @JSName('texImage2D')
-  void _texImage2D2_7(target, level, internalformat, width, height, border,
-      format, type, TypedData srcData, srcOffset) native;
-
-  void texImage3D(
-      int target,
-      int level,
-      int internalformat,
-      int width,
-      int height,
-      int depth,
-      int border,
-      int format,
-      int type,
-      bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
-      [int? srcOffset]) {
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is int) &&
-        srcOffset == null) {
-      _texImage3D_1(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is ImageData) &&
-        srcOffset == null) {
-      var data_1 = convertDartToNative_ImageData(
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      _texImage3D_2(target, level, internalformat, width, height, depth, border,
-          format, type, data_1);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is ImageElement) &&
-        srcOffset == null) {
-      _texImage3D_3(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is CanvasElement) &&
-        srcOffset == null) {
-      _texImage3D_4(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is VideoElement) &&
-        srcOffset == null) {
-      _texImage3D_5(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is ImageBitmap) &&
-        srcOffset == null) {
-      _texImage3D_6(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-                is TypedData ||
-            bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video ==
-                null) &&
-        srcOffset == null) {
-      _texImage3D_7(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if (srcOffset != null &&
-        (bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is TypedData)) {
-      _texImage3D_8(
-          target,
-          level,
-          internalformat,
-          width,
-          height,
-          depth,
-          border,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
-          srcOffset);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texImage3D')
-  void _texImage3D_1(target, level, internalformat, width, height, depth,
-      border, format, type, int offset) native;
-  @JSName('texImage3D')
-  void _texImage3D_2(target, level, internalformat, width, height, depth,
-      border, format, type, data) native;
-  @JSName('texImage3D')
-  void _texImage3D_3(target, level, internalformat, width, height, depth,
-      border, format, type, ImageElement image) native;
-  @JSName('texImage3D')
-  void _texImage3D_4(target, level, internalformat, width, height, depth,
-      border, format, type, CanvasElement canvas) native;
-  @JSName('texImage3D')
-  void _texImage3D_5(target, level, internalformat, width, height, depth,
-      border, format, type, VideoElement video) native;
-  @JSName('texImage3D')
-  void _texImage3D_6(target, level, internalformat, width, height, depth,
-      border, format, type, ImageBitmap bitmap) native;
-  @JSName('texImage3D')
-  void _texImage3D_7(target, level, internalformat, width, height, depth,
-      border, format, type, TypedData? pixels) native;
-  @JSName('texImage3D')
-  void _texImage3D_8(target, level, internalformat, width, height, depth,
-      border, format, type, TypedData pixels, srcOffset) native;
-
-  void texStorage2D(
-      int target, int levels, int internalformat, int width, int height) native;
-
-  void texStorage3D(int target, int levels, int internalformat, int width,
-      int height, int depth) native;
-
-  void texSubImage2D2(
-      int target,
-      int level,
-      int xoffset,
-      int yoffset,
-      int width,
-      int height,
-      int format,
-      int type,
-      bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
-      [int? srcOffset]) {
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is int) &&
-        srcOffset == null) {
-      _texSubImage2D2_1(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          width,
-          height,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is ImageData) &&
-        srcOffset == null) {
-      var data_1 = convertDartToNative_ImageData(
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      _texSubImage2D2_2(
-          target, level, xoffset, yoffset, width, height, format, type, data_1);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is ImageElement) &&
-        srcOffset == null) {
-      _texSubImage2D2_3(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          width,
-          height,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is CanvasElement) &&
-        srcOffset == null) {
-      _texSubImage2D2_4(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          width,
-          height,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is VideoElement) &&
-        srcOffset == null) {
-      _texSubImage2D2_5(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          width,
-          height,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is ImageBitmap) &&
-        srcOffset == null) {
-      _texSubImage2D2_6(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          width,
-          height,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
-      return;
-    }
-    if (srcOffset != null &&
-        (bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
-            is TypedData)) {
-      _texSubImage2D2_7(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          width,
-          height,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
-          srcOffset);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_1(target, level, xoffset, yoffset, width, height, format,
-      type, int offset) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_2(target, level, xoffset, yoffset, width, height, format,
-      type, data) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_3(target, level, xoffset, yoffset, width, height, format,
-      type, ImageElement image) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_4(target, level, xoffset, yoffset, width, height, format,
-      type, CanvasElement canvas) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_5(target, level, xoffset, yoffset, width, height, format,
-      type, VideoElement video) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_6(target, level, xoffset, yoffset, width, height, format,
-      type, ImageBitmap bitmap) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D2_7(target, level, xoffset, yoffset, width, height, format,
-      type, TypedData srcData, srcOffset) native;
-
-  void texSubImage3D(
-      int target,
-      int level,
-      int xoffset,
-      int yoffset,
-      int zoffset,
-      int width,
-      int height,
-      int depth,
-      int format,
-      int type,
-      bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
-      [int? srcOffset]) {
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is int) &&
-        srcOffset == null) {
-      _texSubImage3D_1(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is ImageData) &&
-        srcOffset == null) {
-      var data_1 = convertDartToNative_ImageData(
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      _texSubImage3D_2(target, level, xoffset, yoffset, zoffset, width, height,
-          depth, format, type, data_1);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is ImageElement) &&
-        srcOffset == null) {
-      _texSubImage3D_3(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is CanvasElement) &&
-        srcOffset == null) {
-      _texSubImage3D_4(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is VideoElement) &&
-        srcOffset == null) {
-      _texSubImage3D_5(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is ImageBitmap) &&
-        srcOffset == null) {
-      _texSubImage3D_6(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is TypedData) &&
-        srcOffset == null) {
-      _texSubImage3D_7(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
-      return;
-    }
-    if (srcOffset != null &&
-        (bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
-            is TypedData)) {
-      _texSubImage3D_8(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          zoffset,
-          width,
-          height,
-          depth,
-          format,
-          type,
-          bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
-          srcOffset);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texSubImage3D')
-  void _texSubImage3D_1(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, int offset) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_2(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, data) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_3(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, ImageElement image) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_4(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, CanvasElement canvas) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_5(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, VideoElement video) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_6(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, ImageBitmap bitmap) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_7(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, TypedData pixels) native;
-  @JSName('texSubImage3D')
-  void _texSubImage3D_8(target, level, xoffset, yoffset, zoffset, width, height,
-      depth, format, type, TypedData pixels, srcOffset) native;
-
-  void transformFeedbackVaryings(
-      Program program, List<String> varyings, int bufferMode) {
-    List varyings_1 = convertDartToNative_StringArray(varyings);
-    _transformFeedbackVaryings_1(program, varyings_1, bufferMode);
-    return;
-  }
-
-  @JSName('transformFeedbackVaryings')
-  void _transformFeedbackVaryings_1(Program program, List varyings, bufferMode)
-      native;
-
-  @JSName('uniform1fv')
-  void uniform1fv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  @JSName('uniform1iv')
-  void uniform1iv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniform1ui(UniformLocation? location, int v0) native;
-
-  void uniform1uiv(UniformLocation? location, v,
-      [int? srcOffset, int? srcLength]) native;
-
-  @JSName('uniform2fv')
-  void uniform2fv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  @JSName('uniform2iv')
-  void uniform2iv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniform2ui(UniformLocation? location, int v0, int v1) native;
-
-  void uniform2uiv(UniformLocation? location, v,
-      [int? srcOffset, int? srcLength]) native;
-
-  @JSName('uniform3fv')
-  void uniform3fv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  @JSName('uniform3iv')
-  void uniform3iv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniform3ui(UniformLocation? location, int v0, int v1, int v2) native;
-
-  void uniform3uiv(UniformLocation? location, v,
-      [int? srcOffset, int? srcLength]) native;
-
-  @JSName('uniform4fv')
-  void uniform4fv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  @JSName('uniform4iv')
-  void uniform4iv2(UniformLocation? location, v, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniform4ui(UniformLocation? location, int v0, int v1, int v2, int v3)
-      native;
-
-  void uniform4uiv(UniformLocation? location, v,
-      [int? srcOffset, int? srcLength]) native;
-
-  void uniformBlockBinding(
-      Program program, int uniformBlockIndex, int uniformBlockBinding) native;
-
-  @JSName('uniformMatrix2fv')
-  void uniformMatrix2fv2(
-      UniformLocation? location, bool transpose, array, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniformMatrix2x3fv(UniformLocation? location, bool transpose, value,
-      [int? srcOffset, int? srcLength]) native;
-
-  void uniformMatrix2x4fv(UniformLocation? location, bool transpose, value,
-      [int? srcOffset, int? srcLength]) native;
-
-  @JSName('uniformMatrix3fv')
-  void uniformMatrix3fv2(
-      UniformLocation? location, bool transpose, array, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniformMatrix3x2fv(UniformLocation? location, bool transpose, value,
-      [int? srcOffset, int? srcLength]) native;
-
-  void uniformMatrix3x4fv(UniformLocation? location, bool transpose, value,
-      [int? srcOffset, int? srcLength]) native;
-
-  @JSName('uniformMatrix4fv')
-  void uniformMatrix4fv2(
-      UniformLocation? location, bool transpose, array, int srcOffset,
-      [int? srcLength]) native;
-
-  void uniformMatrix4x2fv(UniformLocation? location, bool transpose, value,
-      [int? srcOffset, int? srcLength]) native;
-
-  void uniformMatrix4x3fv(UniformLocation? location, bool transpose, value,
-      [int? srcOffset, int? srcLength]) native;
-
-  void vertexAttribDivisor(int index, int divisor) native;
-
-  void vertexAttribI4i(int index, int x, int y, int z, int w) native;
-
-  void vertexAttribI4iv(int index, v) native;
-
-  void vertexAttribI4ui(int index, int x, int y, int z, int w) native;
-
-  void vertexAttribI4uiv(int index, v) native;
-
-  void vertexAttribIPointer(
-      int index, int size, int type, int stride, int offset) native;
-
-  void waitSync(Sync sync, int flags, int timeout) native;
-
-  // From WebGLRenderingContextBase
-
-  int get drawingBufferHeight native;
-
-  int get drawingBufferWidth native;
-
-  void activeTexture(int texture) native;
-
-  void attachShader(Program program, Shader shader) native;
-
-  void bindAttribLocation(Program program, int index, String name) native;
-
-  void bindBuffer(int target, Buffer? buffer) native;
-
-  void bindFramebuffer(int target, Framebuffer? framebuffer) native;
-
-  void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
-
-  void bindTexture(int target, Texture? texture) native;
-
-  void blendColor(num red, num green, num blue, num alpha) native;
-
-  void blendEquation(int mode) native;
-
-  void blendEquationSeparate(int modeRGB, int modeAlpha) native;
-
-  void blendFunc(int sfactor, int dfactor) native;
-
-  void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
-      native;
-
-  void bufferData(int target, data_OR_size, int usage) native;
-
-  void bufferSubData(int target, int offset, data) native;
-
-  int checkFramebufferStatus(int target) native;
-
-  void clear(int mask) native;
-
-  void clearColor(num red, num green, num blue, num alpha) native;
-
-  void clearDepth(num depth) native;
-
-  void clearStencil(int s) native;
-
-  void colorMask(bool red, bool green, bool blue, bool alpha) native;
-
-  Future commit() => promiseToFuture(JS("", "#.commit()", this));
-
-  void compileShader(Shader shader) native;
-
-  void compressedTexImage2D(int target, int level, int internalformat,
-      int width, int height, int border, TypedData data) native;
-
-  void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
-      int width, int height, int format, TypedData data) native;
-
-  void copyTexImage2D(int target, int level, int internalformat, int x, int y,
-      int width, int height, int border) native;
-
-  void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x,
-      int y, int width, int height) native;
-
-  Buffer createBuffer() native;
-
-  Framebuffer createFramebuffer() native;
-
-  Program createProgram() native;
-
-  Renderbuffer createRenderbuffer() native;
-
-  Shader createShader(int type) native;
-
-  Texture createTexture() native;
-
-  void cullFace(int mode) native;
-
-  void deleteBuffer(Buffer? buffer) native;
-
-  void deleteFramebuffer(Framebuffer? framebuffer) native;
-
-  void deleteProgram(Program? program) native;
-
-  void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
-
-  void deleteShader(Shader? shader) native;
-
-  void deleteTexture(Texture? texture) native;
-
-  void depthFunc(int func) native;
-
-  void depthMask(bool flag) native;
-
-  void depthRange(num zNear, num zFar) native;
-
-  void detachShader(Program program, Shader shader) native;
-
-  void disable(int cap) native;
-
-  void disableVertexAttribArray(int index) native;
-
-  void drawArrays(int mode, int first, int count) native;
-
-  void drawElements(int mode, int count, int type, int offset) native;
-
-  void enable(int cap) native;
-
-  void enableVertexAttribArray(int index) native;
-
-  void finish() native;
-
-  void flush() native;
-
-  void framebufferRenderbuffer(int target, int attachment,
-      int renderbuffertarget, Renderbuffer? renderbuffer) native;
-
-  void framebufferTexture2D(int target, int attachment, int textarget,
-      Texture? texture, int level) native;
-
-  void frontFace(int mode) native;
-
-  void generateMipmap(int target) native;
-
-  ActiveInfo getActiveAttrib(Program program, int index) native;
-
-  ActiveInfo getActiveUniform(Program program, int index) native;
-
-  List<Shader>? getAttachedShaders(Program program) native;
-
-  int getAttribLocation(Program program, String name) native;
-
-  Object? getBufferParameter(int target, int pname) native;
-
-  Map? getContextAttributes() {
-    return convertNativeToDart_Dictionary(_getContextAttributes_1());
-  }
-
-  @JSName('getContextAttributes')
-  _getContextAttributes_1() native;
-
-  int getError() native;
-
-  Object? getExtension(String name) native;
-
-  Object? getFramebufferAttachmentParameter(
-      int target, int attachment, int pname) native;
-
-  Object? getParameter(int pname) native;
-
-  String? getProgramInfoLog(Program program) native;
-
-  Object? getProgramParameter(Program program, int pname) native;
-
-  Object? getRenderbufferParameter(int target, int pname) native;
-
-  String? getShaderInfoLog(Shader shader) native;
-
-  Object? getShaderParameter(Shader shader, int pname) native;
-
-  ShaderPrecisionFormat getShaderPrecisionFormat(
-      int shadertype, int precisiontype) native;
-
-  String? getShaderSource(Shader shader) native;
-
-  List<String>? getSupportedExtensions() native;
-
-  Object? getTexParameter(int target, int pname) native;
-
-  Object? getUniform(Program program, UniformLocation location) native;
-
-  UniformLocation getUniformLocation(Program program, String name) native;
-
-  Object? getVertexAttrib(int index, int pname) native;
-
-  int getVertexAttribOffset(int index, int pname) native;
-
-  void hint(int target, int mode) native;
-
-  bool isBuffer(Buffer? buffer) native;
-
-  bool isContextLost() native;
-
-  bool isEnabled(int cap) native;
-
-  bool isFramebuffer(Framebuffer? framebuffer) native;
-
-  bool isProgram(Program? program) native;
-
-  bool isRenderbuffer(Renderbuffer? renderbuffer) native;
-
-  bool isShader(Shader? shader) native;
-
-  bool isTexture(Texture? texture) native;
-
-  void lineWidth(num width) native;
-
-  void linkProgram(Program program) native;
-
-  void pixelStorei(int pname, int param) native;
-
-  void polygonOffset(num factor, num units) native;
-
-  @JSName('readPixels')
-  void _readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData? pixels) native;
-
-  void renderbufferStorage(
-      int target, int internalformat, int width, int height) native;
-
-  void sampleCoverage(num value, bool invert) native;
-
-  void scissor(int x, int y, int width, int height) native;
-
-  void shaderSource(Shader shader, String string) native;
-
-  void stencilFunc(int func, int ref, int mask) native;
-
-  void stencilFuncSeparate(int face, int func, int ref, int mask) native;
-
-  void stencilMask(int mask) native;
-
-  void stencilMaskSeparate(int face, int mask) native;
-
-  void stencilOp(int fail, int zfail, int zpass) native;
-
-  void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
-
-  void texImage2D(
-      int target,
-      int level,
-      int internalformat,
-      int format_OR_width,
-      int height_OR_type,
-      bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
-      [int? format,
-      int? type,
-      TypedData? pixels]) {
-    if (type != null &&
-        format != null &&
-        (bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
-      _texImage2D_1(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
-          format,
-          type,
-          pixels);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      var pixels_1 = convertDartToNative_ImageData(
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      _texImage2D_2(target, level, internalformat, format_OR_width,
-          height_OR_type, pixels_1);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is ImageElement) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_3(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is CanvasElement) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_4(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is VideoElement) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_5(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
-            is ImageBitmap) &&
-        format == null &&
-        type == null &&
-        pixels == null) {
-      _texImage2D_6(
-          target,
-          level,
-          internalformat,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texImage2D')
-  void _texImage2D_1(target, level, internalformat, width, height, int border,
-      format, type, TypedData? pixels) native;
-  @JSName('texImage2D')
-  void _texImage2D_2(target, level, internalformat, format, type, pixels)
-      native;
-  @JSName('texImage2D')
-  void _texImage2D_3(
-      target, level, internalformat, format, type, ImageElement image) native;
-  @JSName('texImage2D')
-  void _texImage2D_4(
-      target, level, internalformat, format, type, CanvasElement canvas) native;
-  @JSName('texImage2D')
-  void _texImage2D_5(
-      target, level, internalformat, format, type, VideoElement video) native;
-  @JSName('texImage2D')
-  void _texImage2D_6(
-      target, level, internalformat, format, type, ImageBitmap bitmap) native;
-
-  void texParameterf(int target, int pname, num param) native;
-
-  void texParameteri(int target, int pname, int param) native;
-
-  void texSubImage2D(
-      int target,
-      int level,
-      int xoffset,
-      int yoffset,
-      int format_OR_width,
-      int height_OR_type,
-      bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
-      [int? type,
-      TypedData? pixels]) {
-    if (type != null &&
-        (bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is int)) {
-      _texSubImage2D_1(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
-          type,
-          pixels);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData) &&
-        type == null &&
-        pixels == null) {
-      var pixels_1 = convertDartToNative_ImageData(
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width,
-          height_OR_type, pixels_1);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is ImageElement) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_3(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is CanvasElement) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_4(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is VideoElement) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_5(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
-            is ImageBitmap) &&
-        type == null &&
-        pixels == null) {
-      _texSubImage2D_6(
-          target,
-          level,
-          xoffset,
-          yoffset,
-          format_OR_width,
-          height_OR_type,
-          bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @JSName('texSubImage2D')
-  void _texSubImage2D_1(target, level, xoffset, yoffset, width, height,
-      int format, type, TypedData? pixels) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels)
-      native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_3(
-      target, level, xoffset, yoffset, format, type, ImageElement image) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_4(target, level, xoffset, yoffset, format, type,
-      CanvasElement canvas) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_5(
-      target, level, xoffset, yoffset, format, type, VideoElement video) native;
-  @JSName('texSubImage2D')
-  void _texSubImage2D_6(
-      target, level, xoffset, yoffset, format, type, ImageBitmap bitmap) native;
-
-  void uniform1f(UniformLocation? location, num x) native;
-
-  void uniform1fv(UniformLocation? location, v) native;
-
-  void uniform1i(UniformLocation? location, int x) native;
-
-  void uniform1iv(UniformLocation? location, v) native;
-
-  void uniform2f(UniformLocation? location, num x, num y) native;
-
-  void uniform2fv(UniformLocation? location, v) native;
-
-  void uniform2i(UniformLocation? location, int x, int y) native;
-
-  void uniform2iv(UniformLocation? location, v) native;
-
-  void uniform3f(UniformLocation? location, num x, num y, num z) native;
-
-  void uniform3fv(UniformLocation? location, v) native;
-
-  void uniform3i(UniformLocation? location, int x, int y, int z) native;
-
-  void uniform3iv(UniformLocation? location, v) native;
-
-  void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
-
-  void uniform4fv(UniformLocation? location, v) native;
-
-  void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
-
-  void uniform4iv(UniformLocation? location, v) native;
-
-  void uniformMatrix2fv(UniformLocation? location, bool transpose, array)
-      native;
-
-  void uniformMatrix3fv(UniformLocation? location, bool transpose, array)
-      native;
-
-  void uniformMatrix4fv(UniformLocation? location, bool transpose, array)
-      native;
-
-  void useProgram(Program? program) native;
-
-  void validateProgram(Program program) native;
-
-  void vertexAttrib1f(int indx, num x) native;
-
-  void vertexAttrib1fv(int indx, values) native;
-
-  void vertexAttrib2f(int indx, num x, num y) native;
-
-  void vertexAttrib2fv(int indx, values) native;
-
-  void vertexAttrib3f(int indx, num x, num y, num z) native;
-
-  void vertexAttrib3fv(int indx, values) native;
-
-  void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
-
-  void vertexAttrib4fv(int indx, values) native;
-
-  void vertexAttribPointer(int indx, int size, int type, bool normalized,
-      int stride, int offset) native;
-
-  void viewport(int x, int y, int width, int height) native;
-
-  void readPixels(int x, int y, int width, int height, int format, int type,
-      TypedData pixels) {
-    _readPixels(x, y, width, height, format, type, pixels);
-  }
-}
-
-// Copyright (c) 2012, 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.
-
-@Native("WebGLSampler")
-class Sampler extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Sampler._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLShader")
-class Shader extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Shader._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLShaderPrecisionFormat")
-class ShaderPrecisionFormat extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory ShaderPrecisionFormat._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get precision native;
-
-  int get rangeMax native;
-
-  int get rangeMin native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLSync")
-class Sync extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Sync._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLTexture")
-class Texture extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory Texture._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  bool get lastUploadedVideoFrameWasSkipped native;
-
-  int get lastUploadedVideoHeight native;
-
-  num get lastUploadedVideoTimestamp native;
-
-  int get lastUploadedVideoWidth native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLTimerQueryEXT")
-class TimerQueryExt extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TimerQueryExt._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLTransformFeedback")
-class TransformFeedback extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory TransformFeedback._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLUniformLocation")
-class UniformLocation extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory UniformLocation._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLVertexArrayObject")
-class VertexArrayObject extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VertexArrayObject._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGLVertexArrayObjectOES")
-class VertexArrayObjectOes extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory VertexArrayObjectOes._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
-// Copyright (c) 2018, 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.
-
-/// Amalgamation of the WebGL constants from the IDL interfaces in
-/// WebGLRenderingContextBase, WebGL2RenderingContextBase, & WebGLDrawBuffers.
-/// Because the RenderingContextBase interfaces are hidden they would be
-/// replicated in more than one class (e.g., RenderingContext and
-/// RenderingContext2) to prevent that duplication these 600+ constants are
-/// defined in one abstract class (WebGL).
-@Native("WebGL")
-abstract class WebGL {
-  // To suppress missing implicit constructor warnings.
-  factory WebGL._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int ACTIVE_ATTRIBUTES = 0x8B89;
-
-  static const int ACTIVE_TEXTURE = 0x84E0;
-
-  static const int ACTIVE_UNIFORMS = 0x8B86;
-
-  static const int ACTIVE_UNIFORM_BLOCKS = 0x8A36;
-
-  static const int ALIASED_LINE_WIDTH_RANGE = 0x846E;
-
-  static const int ALIASED_POINT_SIZE_RANGE = 0x846D;
-
-  static const int ALPHA = 0x1906;
-
-  static const int ALPHA_BITS = 0x0D55;
-
-  static const int ALREADY_SIGNALED = 0x911A;
-
-  static const int ALWAYS = 0x0207;
-
-  static const int ANY_SAMPLES_PASSED = 0x8C2F;
-
-  static const int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
-
-  static const int ARRAY_BUFFER = 0x8892;
-
-  static const int ARRAY_BUFFER_BINDING = 0x8894;
-
-  static const int ATTACHED_SHADERS = 0x8B85;
-
-  static const int BACK = 0x0405;
-
-  static const int BLEND = 0x0BE2;
-
-  static const int BLEND_COLOR = 0x8005;
-
-  static const int BLEND_DST_ALPHA = 0x80CA;
-
-  static const int BLEND_DST_RGB = 0x80C8;
-
-  static const int BLEND_EQUATION = 0x8009;
-
-  static const int BLEND_EQUATION_ALPHA = 0x883D;
-
-  static const int BLEND_EQUATION_RGB = 0x8009;
-
-  static const int BLEND_SRC_ALPHA = 0x80CB;
-
-  static const int BLEND_SRC_RGB = 0x80C9;
-
-  static const int BLUE_BITS = 0x0D54;
-
-  static const int BOOL = 0x8B56;
-
-  static const int BOOL_VEC2 = 0x8B57;
-
-  static const int BOOL_VEC3 = 0x8B58;
-
-  static const int BOOL_VEC4 = 0x8B59;
-
-  static const int BROWSER_DEFAULT_WEBGL = 0x9244;
-
-  static const int BUFFER_SIZE = 0x8764;
-
-  static const int BUFFER_USAGE = 0x8765;
-
-  static const int BYTE = 0x1400;
-
-  static const int CCW = 0x0901;
-
-  static const int CLAMP_TO_EDGE = 0x812F;
-
-  static const int COLOR = 0x1800;
-
-  static const int COLOR_ATTACHMENT0 = 0x8CE0;
-
-  static const int COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
-
-  static const int COLOR_ATTACHMENT1 = 0x8CE1;
-
-  static const int COLOR_ATTACHMENT10 = 0x8CEA;
-
-  static const int COLOR_ATTACHMENT10_WEBGL = 0x8CEA;
-
-  static const int COLOR_ATTACHMENT11 = 0x8CEB;
-
-  static const int COLOR_ATTACHMENT11_WEBGL = 0x8CEB;
-
-  static const int COLOR_ATTACHMENT12 = 0x8CEC;
-
-  static const int COLOR_ATTACHMENT12_WEBGL = 0x8CEC;
-
-  static const int COLOR_ATTACHMENT13 = 0x8CED;
-
-  static const int COLOR_ATTACHMENT13_WEBGL = 0x8CED;
-
-  static const int COLOR_ATTACHMENT14 = 0x8CEE;
-
-  static const int COLOR_ATTACHMENT14_WEBGL = 0x8CEE;
-
-  static const int COLOR_ATTACHMENT15 = 0x8CEF;
-
-  static const int COLOR_ATTACHMENT15_WEBGL = 0x8CEF;
-
-  static const int COLOR_ATTACHMENT1_WEBGL = 0x8CE1;
-
-  static const int COLOR_ATTACHMENT2 = 0x8CE2;
-
-  static const int COLOR_ATTACHMENT2_WEBGL = 0x8CE2;
-
-  static const int COLOR_ATTACHMENT3 = 0x8CE3;
-
-  static const int COLOR_ATTACHMENT3_WEBGL = 0x8CE3;
-
-  static const int COLOR_ATTACHMENT4 = 0x8CE4;
-
-  static const int COLOR_ATTACHMENT4_WEBGL = 0x8CE4;
-
-  static const int COLOR_ATTACHMENT5 = 0x8CE5;
-
-  static const int COLOR_ATTACHMENT5_WEBGL = 0x8CE5;
-
-  static const int COLOR_ATTACHMENT6 = 0x8CE6;
-
-  static const int COLOR_ATTACHMENT6_WEBGL = 0x8CE6;
-
-  static const int COLOR_ATTACHMENT7 = 0x8CE7;
-
-  static const int COLOR_ATTACHMENT7_WEBGL = 0x8CE7;
-
-  static const int COLOR_ATTACHMENT8 = 0x8CE8;
-
-  static const int COLOR_ATTACHMENT8_WEBGL = 0x8CE8;
-
-  static const int COLOR_ATTACHMENT9 = 0x8CE9;
-
-  static const int COLOR_ATTACHMENT9_WEBGL = 0x8CE9;
-
-  static const int COLOR_BUFFER_BIT = 0x00004000;
-
-  static const int COLOR_CLEAR_VALUE = 0x0C22;
-
-  static const int COLOR_WRITEMASK = 0x0C23;
-
-  static const int COMPARE_REF_TO_TEXTURE = 0x884E;
-
-  static const int COMPILE_STATUS = 0x8B81;
-
-  static const int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
-  static const int CONDITION_SATISFIED = 0x911C;
-
-  static const int CONSTANT_ALPHA = 0x8003;
-
-  static const int CONSTANT_COLOR = 0x8001;
-
-  static const int CONTEXT_LOST_WEBGL = 0x9242;
-
-  static const int COPY_READ_BUFFER = 0x8F36;
-
-  static const int COPY_READ_BUFFER_BINDING = 0x8F36;
-
-  static const int COPY_WRITE_BUFFER = 0x8F37;
-
-  static const int COPY_WRITE_BUFFER_BINDING = 0x8F37;
-
-  static const int CULL_FACE = 0x0B44;
-
-  static const int CULL_FACE_MODE = 0x0B45;
-
-  static const int CURRENT_PROGRAM = 0x8B8D;
-
-  static const int CURRENT_QUERY = 0x8865;
-
-  static const int CURRENT_VERTEX_ATTRIB = 0x8626;
-
-  static const int CW = 0x0900;
-
-  static const int DECR = 0x1E03;
-
-  static const int DECR_WRAP = 0x8508;
-
-  static const int DELETE_STATUS = 0x8B80;
-
-  static const int DEPTH = 0x1801;
-
-  static const int DEPTH24_STENCIL8 = 0x88F0;
-
-  static const int DEPTH32F_STENCIL8 = 0x8CAD;
-
-  static const int DEPTH_ATTACHMENT = 0x8D00;
-
-  static const int DEPTH_BITS = 0x0D56;
-
-  static const int DEPTH_BUFFER_BIT = 0x00000100;
-
-  static const int DEPTH_CLEAR_VALUE = 0x0B73;
-
-  static const int DEPTH_COMPONENT = 0x1902;
-
-  static const int DEPTH_COMPONENT16 = 0x81A5;
-
-  static const int DEPTH_COMPONENT24 = 0x81A6;
-
-  static const int DEPTH_COMPONENT32F = 0x8CAC;
-
-  static const int DEPTH_FUNC = 0x0B74;
-
-  static const int DEPTH_RANGE = 0x0B70;
-
-  static const int DEPTH_STENCIL = 0x84F9;
-
-  static const int DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
-  static const int DEPTH_TEST = 0x0B71;
-
-  static const int DEPTH_WRITEMASK = 0x0B72;
-
-  static const int DITHER = 0x0BD0;
-
-  static const int DONT_CARE = 0x1100;
-
-  static const int DRAW_BUFFER0 = 0x8825;
-
-  static const int DRAW_BUFFER0_WEBGL = 0x8825;
-
-  static const int DRAW_BUFFER1 = 0x8826;
-
-  static const int DRAW_BUFFER10 = 0x882F;
-
-  static const int DRAW_BUFFER10_WEBGL = 0x882F;
-
-  static const int DRAW_BUFFER11 = 0x8830;
-
-  static const int DRAW_BUFFER11_WEBGL = 0x8830;
-
-  static const int DRAW_BUFFER12 = 0x8831;
-
-  static const int DRAW_BUFFER12_WEBGL = 0x8831;
-
-  static const int DRAW_BUFFER13 = 0x8832;
-
-  static const int DRAW_BUFFER13_WEBGL = 0x8832;
-
-  static const int DRAW_BUFFER14 = 0x8833;
-
-  static const int DRAW_BUFFER14_WEBGL = 0x8833;
-
-  static const int DRAW_BUFFER15 = 0x8834;
-
-  static const int DRAW_BUFFER15_WEBGL = 0x8834;
-
-  static const int DRAW_BUFFER1_WEBGL = 0x8826;
-
-  static const int DRAW_BUFFER2 = 0x8827;
-
-  static const int DRAW_BUFFER2_WEBGL = 0x8827;
-
-  static const int DRAW_BUFFER3 = 0x8828;
-
-  static const int DRAW_BUFFER3_WEBGL = 0x8828;
-
-  static const int DRAW_BUFFER4 = 0x8829;
-
-  static const int DRAW_BUFFER4_WEBGL = 0x8829;
-
-  static const int DRAW_BUFFER5 = 0x882A;
-
-  static const int DRAW_BUFFER5_WEBGL = 0x882A;
-
-  static const int DRAW_BUFFER6 = 0x882B;
-
-  static const int DRAW_BUFFER6_WEBGL = 0x882B;
-
-  static const int DRAW_BUFFER7 = 0x882C;
-
-  static const int DRAW_BUFFER7_WEBGL = 0x882C;
-
-  static const int DRAW_BUFFER8 = 0x882D;
-
-  static const int DRAW_BUFFER8_WEBGL = 0x882D;
-
-  static const int DRAW_BUFFER9 = 0x882E;
-
-  static const int DRAW_BUFFER9_WEBGL = 0x882E;
-
-  static const int DRAW_FRAMEBUFFER = 0x8CA9;
-
-  static const int DRAW_FRAMEBUFFER_BINDING = 0x8CA6;
-
-  static const int DST_ALPHA = 0x0304;
-
-  static const int DST_COLOR = 0x0306;
-
-  static const int DYNAMIC_COPY = 0x88EA;
-
-  static const int DYNAMIC_DRAW = 0x88E8;
-
-  static const int DYNAMIC_READ = 0x88E9;
-
-  static const int ELEMENT_ARRAY_BUFFER = 0x8893;
-
-  static const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
-
-  static const int EQUAL = 0x0202;
-
-  static const int FASTEST = 0x1101;
-
-  static const int FLOAT = 0x1406;
-
-  static const int FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
-
-  static const int FLOAT_MAT2 = 0x8B5A;
-
-  static const int FLOAT_MAT2x3 = 0x8B65;
-
-  static const int FLOAT_MAT2x4 = 0x8B66;
-
-  static const int FLOAT_MAT3 = 0x8B5B;
-
-  static const int FLOAT_MAT3x2 = 0x8B67;
-
-  static const int FLOAT_MAT3x4 = 0x8B68;
-
-  static const int FLOAT_MAT4 = 0x8B5C;
-
-  static const int FLOAT_MAT4x2 = 0x8B69;
-
-  static const int FLOAT_MAT4x3 = 0x8B6A;
-
-  static const int FLOAT_VEC2 = 0x8B50;
-
-  static const int FLOAT_VEC3 = 0x8B51;
-
-  static const int FLOAT_VEC4 = 0x8B52;
-
-  static const int FRAGMENT_SHADER = 0x8B30;
-
-  static const int FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
-
-  static const int FRAMEBUFFER = 0x8D40;
-
-  static const int FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
-
-  static const int FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
-
-  static const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
-
-  static const int FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
-
-  static const int FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
-
-  static const int FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
-
-  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
-
-  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
-
-  static const int FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
-
-  static const int FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
-
-  static const int FRAMEBUFFER_BINDING = 0x8CA6;
-
-  static const int FRAMEBUFFER_COMPLETE = 0x8CD5;
-
-  static const int FRAMEBUFFER_DEFAULT = 0x8218;
-
-  static const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
-
-  static const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
-
-  static const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
-
-  static const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
-
-  static const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
-  static const int FRONT = 0x0404;
-
-  static const int FRONT_AND_BACK = 0x0408;
-
-  static const int FRONT_FACE = 0x0B46;
-
-  static const int FUNC_ADD = 0x8006;
-
-  static const int FUNC_REVERSE_SUBTRACT = 0x800B;
-
-  static const int FUNC_SUBTRACT = 0x800A;
-
-  static const int GENERATE_MIPMAP_HINT = 0x8192;
-
-  static const int GEQUAL = 0x0206;
-
-  static const int GREATER = 0x0204;
-
-  static const int GREEN_BITS = 0x0D53;
-
-  static const int HALF_FLOAT = 0x140B;
-
-  static const int HIGH_FLOAT = 0x8DF2;
-
-  static const int HIGH_INT = 0x8DF5;
-
-  static const int IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
-
-  static const int IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
-
-  static const int INCR = 0x1E02;
-
-  static const int INCR_WRAP = 0x8507;
-
-  static const int INT = 0x1404;
-
-  static const int INTERLEAVED_ATTRIBS = 0x8C8C;
-
-  static const int INT_2_10_10_10_REV = 0x8D9F;
-
-  static const int INT_SAMPLER_2D = 0x8DCA;
-
-  static const int INT_SAMPLER_2D_ARRAY = 0x8DCF;
-
-  static const int INT_SAMPLER_3D = 0x8DCB;
-
-  static const int INT_SAMPLER_CUBE = 0x8DCC;
-
-  static const int INT_VEC2 = 0x8B53;
-
-  static const int INT_VEC3 = 0x8B54;
-
-  static const int INT_VEC4 = 0x8B55;
-
-  static const int INVALID_ENUM = 0x0500;
-
-  static const int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
-  static const int INVALID_INDEX = 0xFFFFFFFF;
-
-  static const int INVALID_OPERATION = 0x0502;
-
-  static const int INVALID_VALUE = 0x0501;
-
-  static const int INVERT = 0x150A;
-
-  static const int KEEP = 0x1E00;
-
-  static const int LEQUAL = 0x0203;
-
-  static const int LESS = 0x0201;
-
-  static const int LINEAR = 0x2601;
-
-  static const int LINEAR_MIPMAP_LINEAR = 0x2703;
-
-  static const int LINEAR_MIPMAP_NEAREST = 0x2701;
-
-  static const int LINES = 0x0001;
-
-  static const int LINE_LOOP = 0x0002;
-
-  static const int LINE_STRIP = 0x0003;
-
-  static const int LINE_WIDTH = 0x0B21;
-
-  static const int LINK_STATUS = 0x8B82;
-
-  static const int LOW_FLOAT = 0x8DF0;
-
-  static const int LOW_INT = 0x8DF3;
-
-  static const int LUMINANCE = 0x1909;
-
-  static const int LUMINANCE_ALPHA = 0x190A;
-
-  static const int MAX = 0x8008;
-
-  static const int MAX_3D_TEXTURE_SIZE = 0x8073;
-
-  static const int MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
-
-  static const int MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247;
-
-  static const int MAX_COLOR_ATTACHMENTS = 0x8CDF;
-
-  static const int MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;
-
-  static const int MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
-
-  static const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
-
-  static const int MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
-
-  static const int MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
-
-  static const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
-  static const int MAX_DRAW_BUFFERS = 0x8824;
-
-  static const int MAX_DRAW_BUFFERS_WEBGL = 0x8824;
-
-  static const int MAX_ELEMENTS_INDICES = 0x80E9;
-
-  static const int MAX_ELEMENTS_VERTICES = 0x80E8;
-
-  static const int MAX_ELEMENT_INDEX = 0x8D6B;
-
-  static const int MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
-
-  static const int MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
-
-  static const int MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
-
-  static const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
-
-  static const int MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
-
-  static const int MAX_RENDERBUFFER_SIZE = 0x84E8;
-
-  static const int MAX_SAMPLES = 0x8D57;
-
-  static const int MAX_SERVER_WAIT_TIMEOUT = 0x9111;
-
-  static const int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
-
-  static const int MAX_TEXTURE_LOD_BIAS = 0x84FD;
-
-  static const int MAX_TEXTURE_SIZE = 0x0D33;
-
-  static const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
-
-  static const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
-
-  static const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
-
-  static const int MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
-
-  static const int MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
-
-  static const int MAX_VARYING_COMPONENTS = 0x8B4B;
-
-  static const int MAX_VARYING_VECTORS = 0x8DFC;
-
-  static const int MAX_VERTEX_ATTRIBS = 0x8869;
-
-  static const int MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
-
-  static const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
-
-  static const int MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
-
-  static const int MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
-
-  static const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
-
-  static const int MAX_VIEWPORT_DIMS = 0x0D3A;
-
-  static const int MEDIUM_FLOAT = 0x8DF1;
-
-  static const int MEDIUM_INT = 0x8DF4;
-
-  static const int MIN = 0x8007;
-
-  static const int MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
-
-  static const int MIRRORED_REPEAT = 0x8370;
-
-  static const int NEAREST = 0x2600;
-
-  static const int NEAREST_MIPMAP_LINEAR = 0x2702;
-
-  static const int NEAREST_MIPMAP_NEAREST = 0x2700;
-
-  static const int NEVER = 0x0200;
-
-  static const int NICEST = 0x1102;
-
-  static const int NONE = 0;
-
-  static const int NOTEQUAL = 0x0205;
-
-  static const int NO_ERROR = 0;
-
-  static const int OBJECT_TYPE = 0x9112;
-
-  static const int ONE = 1;
-
-  static const int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
-
-  static const int ONE_MINUS_CONSTANT_COLOR = 0x8002;
-
-  static const int ONE_MINUS_DST_ALPHA = 0x0305;
-
-  static const int ONE_MINUS_DST_COLOR = 0x0307;
-
-  static const int ONE_MINUS_SRC_ALPHA = 0x0303;
-
-  static const int ONE_MINUS_SRC_COLOR = 0x0301;
-
-  static const int OUT_OF_MEMORY = 0x0505;
-
-  static const int PACK_ALIGNMENT = 0x0D05;
-
-  static const int PACK_ROW_LENGTH = 0x0D02;
-
-  static const int PACK_SKIP_PIXELS = 0x0D04;
-
-  static const int PACK_SKIP_ROWS = 0x0D03;
-
-  static const int PIXEL_PACK_BUFFER = 0x88EB;
-
-  static const int PIXEL_PACK_BUFFER_BINDING = 0x88ED;
-
-  static const int PIXEL_UNPACK_BUFFER = 0x88EC;
-
-  static const int PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
-
-  static const int POINTS = 0x0000;
-
-  static const int POLYGON_OFFSET_FACTOR = 0x8038;
-
-  static const int POLYGON_OFFSET_FILL = 0x8037;
-
-  static const int POLYGON_OFFSET_UNITS = 0x2A00;
-
-  static const int QUERY_RESULT = 0x8866;
-
-  static const int QUERY_RESULT_AVAILABLE = 0x8867;
-
-  static const int R11F_G11F_B10F = 0x8C3A;
-
-  static const int R16F = 0x822D;
-
-  static const int R16I = 0x8233;
-
-  static const int R16UI = 0x8234;
-
-  static const int R32F = 0x822E;
-
-  static const int R32I = 0x8235;
-
-  static const int R32UI = 0x8236;
-
-  static const int R8 = 0x8229;
-
-  static const int R8I = 0x8231;
-
-  static const int R8UI = 0x8232;
-
-  static const int R8_SNORM = 0x8F94;
-
-  static const int RASTERIZER_DISCARD = 0x8C89;
-
-  static const int READ_BUFFER = 0x0C02;
-
-  static const int READ_FRAMEBUFFER = 0x8CA8;
-
-  static const int READ_FRAMEBUFFER_BINDING = 0x8CAA;
-
-  static const int RED = 0x1903;
-
-  static const int RED_BITS = 0x0D52;
-
-  static const int RED_INTEGER = 0x8D94;
-
-  static const int RENDERBUFFER = 0x8D41;
-
-  static const int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
-
-  static const int RENDERBUFFER_BINDING = 0x8CA7;
-
-  static const int RENDERBUFFER_BLUE_SIZE = 0x8D52;
-
-  static const int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
-
-  static const int RENDERBUFFER_GREEN_SIZE = 0x8D51;
-
-  static const int RENDERBUFFER_HEIGHT = 0x8D43;
-
-  static const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
-
-  static const int RENDERBUFFER_RED_SIZE = 0x8D50;
-
-  static const int RENDERBUFFER_SAMPLES = 0x8CAB;
-
-  static const int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
-  static const int RENDERBUFFER_WIDTH = 0x8D42;
-
-  static const int RENDERER = 0x1F01;
-
-  static const int REPEAT = 0x2901;
-
-  static const int REPLACE = 0x1E01;
-
-  static const int RG = 0x8227;
-
-  static const int RG16F = 0x822F;
-
-  static const int RG16I = 0x8239;
-
-  static const int RG16UI = 0x823A;
-
-  static const int RG32F = 0x8230;
-
-  static const int RG32I = 0x823B;
-
-  static const int RG32UI = 0x823C;
-
-  static const int RG8 = 0x822B;
-
-  static const int RG8I = 0x8237;
-
-  static const int RG8UI = 0x8238;
-
-  static const int RG8_SNORM = 0x8F95;
-
-  static const int RGB = 0x1907;
-
-  static const int RGB10_A2 = 0x8059;
-
-  static const int RGB10_A2UI = 0x906F;
-
-  static const int RGB16F = 0x881B;
-
-  static const int RGB16I = 0x8D89;
-
-  static const int RGB16UI = 0x8D77;
-
-  static const int RGB32F = 0x8815;
-
-  static const int RGB32I = 0x8D83;
-
-  static const int RGB32UI = 0x8D71;
-
-  static const int RGB565 = 0x8D62;
-
-  static const int RGB5_A1 = 0x8057;
-
-  static const int RGB8 = 0x8051;
-
-  static const int RGB8I = 0x8D8F;
-
-  static const int RGB8UI = 0x8D7D;
-
-  static const int RGB8_SNORM = 0x8F96;
-
-  static const int RGB9_E5 = 0x8C3D;
-
-  static const int RGBA = 0x1908;
-
-  static const int RGBA16F = 0x881A;
-
-  static const int RGBA16I = 0x8D88;
-
-  static const int RGBA16UI = 0x8D76;
-
-  static const int RGBA32F = 0x8814;
-
-  static const int RGBA32I = 0x8D82;
-
-  static const int RGBA32UI = 0x8D70;
-
-  static const int RGBA4 = 0x8056;
-
-  static const int RGBA8 = 0x8058;
-
-  static const int RGBA8I = 0x8D8E;
-
-  static const int RGBA8UI = 0x8D7C;
-
-  static const int RGBA8_SNORM = 0x8F97;
-
-  static const int RGBA_INTEGER = 0x8D99;
-
-  static const int RGB_INTEGER = 0x8D98;
-
-  static const int RG_INTEGER = 0x8228;
-
-  static const int SAMPLER_2D = 0x8B5E;
-
-  static const int SAMPLER_2D_ARRAY = 0x8DC1;
-
-  static const int SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
-
-  static const int SAMPLER_2D_SHADOW = 0x8B62;
-
-  static const int SAMPLER_3D = 0x8B5F;
-
-  static const int SAMPLER_BINDING = 0x8919;
-
-  static const int SAMPLER_CUBE = 0x8B60;
-
-  static const int SAMPLER_CUBE_SHADOW = 0x8DC5;
-
-  static const int SAMPLES = 0x80A9;
-
-  static const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
-
-  static const int SAMPLE_BUFFERS = 0x80A8;
-
-  static const int SAMPLE_COVERAGE = 0x80A0;
-
-  static const int SAMPLE_COVERAGE_INVERT = 0x80AB;
-
-  static const int SAMPLE_COVERAGE_VALUE = 0x80AA;
-
-  static const int SCISSOR_BOX = 0x0C10;
-
-  static const int SCISSOR_TEST = 0x0C11;
-
-  static const int SEPARATE_ATTRIBS = 0x8C8D;
-
-  static const int SHADER_TYPE = 0x8B4F;
-
-  static const int SHADING_LANGUAGE_VERSION = 0x8B8C;
-
-  static const int SHORT = 0x1402;
-
-  static const int SIGNALED = 0x9119;
-
-  static const int SIGNED_NORMALIZED = 0x8F9C;
-
-  static const int SRC_ALPHA = 0x0302;
-
-  static const int SRC_ALPHA_SATURATE = 0x0308;
-
-  static const int SRC_COLOR = 0x0300;
-
-  static const int SRGB = 0x8C40;
-
-  static const int SRGB8 = 0x8C41;
-
-  static const int SRGB8_ALPHA8 = 0x8C43;
-
-  static const int STATIC_COPY = 0x88E6;
-
-  static const int STATIC_DRAW = 0x88E4;
-
-  static const int STATIC_READ = 0x88E5;
-
-  static const int STENCIL = 0x1802;
-
-  static const int STENCIL_ATTACHMENT = 0x8D20;
-
-  static const int STENCIL_BACK_FAIL = 0x8801;
-
-  static const int STENCIL_BACK_FUNC = 0x8800;
-
-  static const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
-
-  static const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
-
-  static const int STENCIL_BACK_REF = 0x8CA3;
-
-  static const int STENCIL_BACK_VALUE_MASK = 0x8CA4;
-
-  static const int STENCIL_BACK_WRITEMASK = 0x8CA5;
-
-  static const int STENCIL_BITS = 0x0D57;
-
-  static const int STENCIL_BUFFER_BIT = 0x00000400;
-
-  static const int STENCIL_CLEAR_VALUE = 0x0B91;
-
-  static const int STENCIL_FAIL = 0x0B94;
-
-  static const int STENCIL_FUNC = 0x0B92;
-
-  static const int STENCIL_INDEX8 = 0x8D48;
-
-  static const int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
-
-  static const int STENCIL_PASS_DEPTH_PASS = 0x0B96;
-
-  static const int STENCIL_REF = 0x0B97;
-
-  static const int STENCIL_TEST = 0x0B90;
-
-  static const int STENCIL_VALUE_MASK = 0x0B93;
-
-  static const int STENCIL_WRITEMASK = 0x0B98;
-
-  static const int STREAM_COPY = 0x88E2;
-
-  static const int STREAM_DRAW = 0x88E0;
-
-  static const int STREAM_READ = 0x88E1;
-
-  static const int SUBPIXEL_BITS = 0x0D50;
-
-  static const int SYNC_CONDITION = 0x9113;
-
-  static const int SYNC_FENCE = 0x9116;
-
-  static const int SYNC_FLAGS = 0x9115;
-
-  static const int SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
-
-  static const int SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
-
-  static const int SYNC_STATUS = 0x9114;
-
-  static const int TEXTURE = 0x1702;
-
-  static const int TEXTURE0 = 0x84C0;
-
-  static const int TEXTURE1 = 0x84C1;
-
-  static const int TEXTURE10 = 0x84CA;
-
-  static const int TEXTURE11 = 0x84CB;
-
-  static const int TEXTURE12 = 0x84CC;
-
-  static const int TEXTURE13 = 0x84CD;
-
-  static const int TEXTURE14 = 0x84CE;
-
-  static const int TEXTURE15 = 0x84CF;
-
-  static const int TEXTURE16 = 0x84D0;
-
-  static const int TEXTURE17 = 0x84D1;
-
-  static const int TEXTURE18 = 0x84D2;
-
-  static const int TEXTURE19 = 0x84D3;
-
-  static const int TEXTURE2 = 0x84C2;
-
-  static const int TEXTURE20 = 0x84D4;
-
-  static const int TEXTURE21 = 0x84D5;
-
-  static const int TEXTURE22 = 0x84D6;
-
-  static const int TEXTURE23 = 0x84D7;
-
-  static const int TEXTURE24 = 0x84D8;
-
-  static const int TEXTURE25 = 0x84D9;
-
-  static const int TEXTURE26 = 0x84DA;
-
-  static const int TEXTURE27 = 0x84DB;
-
-  static const int TEXTURE28 = 0x84DC;
-
-  static const int TEXTURE29 = 0x84DD;
-
-  static const int TEXTURE3 = 0x84C3;
-
-  static const int TEXTURE30 = 0x84DE;
-
-  static const int TEXTURE31 = 0x84DF;
-
-  static const int TEXTURE4 = 0x84C4;
-
-  static const int TEXTURE5 = 0x84C5;
-
-  static const int TEXTURE6 = 0x84C6;
-
-  static const int TEXTURE7 = 0x84C7;
-
-  static const int TEXTURE8 = 0x84C8;
-
-  static const int TEXTURE9 = 0x84C9;
-
-  static const int TEXTURE_2D = 0x0DE1;
-
-  static const int TEXTURE_2D_ARRAY = 0x8C1A;
-
-  static const int TEXTURE_3D = 0x806F;
-
-  static const int TEXTURE_BASE_LEVEL = 0x813C;
-
-  static const int TEXTURE_BINDING_2D = 0x8069;
-
-  static const int TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
-
-  static const int TEXTURE_BINDING_3D = 0x806A;
-
-  static const int TEXTURE_BINDING_CUBE_MAP = 0x8514;
-
-  static const int TEXTURE_COMPARE_FUNC = 0x884D;
-
-  static const int TEXTURE_COMPARE_MODE = 0x884C;
-
-  static const int TEXTURE_CUBE_MAP = 0x8513;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
-
-  static const int TEXTURE_IMMUTABLE_FORMAT = 0x912F;
-
-  static const int TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
-
-  static const int TEXTURE_MAG_FILTER = 0x2800;
-
-  static const int TEXTURE_MAX_LEVEL = 0x813D;
-
-  static const int TEXTURE_MAX_LOD = 0x813B;
-
-  static const int TEXTURE_MIN_FILTER = 0x2801;
-
-  static const int TEXTURE_MIN_LOD = 0x813A;
-
-  static const int TEXTURE_WRAP_R = 0x8072;
-
-  static const int TEXTURE_WRAP_S = 0x2802;
-
-  static const int TEXTURE_WRAP_T = 0x2803;
-
-  static const int TIMEOUT_EXPIRED = 0x911B;
-
-  static const int TIMEOUT_IGNORED = -1;
-
-  static const int TRANSFORM_FEEDBACK = 0x8E22;
-
-  static const int TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
-
-  static const int TRANSFORM_FEEDBACK_BINDING = 0x8E25;
-
-  static const int TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
-
-  static const int TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
-
-  static const int TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
-
-  static const int TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
-
-  static const int TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
-
-  static const int TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
-
-  static const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
-
-  static const int TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
-
-  static const int TRIANGLES = 0x0004;
-
-  static const int TRIANGLE_FAN = 0x0006;
-
-  static const int TRIANGLE_STRIP = 0x0005;
-
-  static const int UNIFORM_ARRAY_STRIDE = 0x8A3C;
-
-  static const int UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
-
-  static const int UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
-
-  static const int UNIFORM_BLOCK_BINDING = 0x8A3F;
-
-  static const int UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
-
-  static const int UNIFORM_BLOCK_INDEX = 0x8A3A;
-
-  static const int UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
-
-  static const int UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
-
-  static const int UNIFORM_BUFFER = 0x8A11;
-
-  static const int UNIFORM_BUFFER_BINDING = 0x8A28;
-
-  static const int UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
-
-  static const int UNIFORM_BUFFER_SIZE = 0x8A2A;
-
-  static const int UNIFORM_BUFFER_START = 0x8A29;
-
-  static const int UNIFORM_IS_ROW_MAJOR = 0x8A3E;
-
-  static const int UNIFORM_MATRIX_STRIDE = 0x8A3D;
-
-  static const int UNIFORM_OFFSET = 0x8A3B;
-
-  static const int UNIFORM_SIZE = 0x8A38;
-
-  static const int UNIFORM_TYPE = 0x8A37;
-
-  static const int UNPACK_ALIGNMENT = 0x0CF5;
-
-  static const int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
-
-  static const int UNPACK_FLIP_Y_WEBGL = 0x9240;
-
-  static const int UNPACK_IMAGE_HEIGHT = 0x806E;
-
-  static const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
-
-  static const int UNPACK_ROW_LENGTH = 0x0CF2;
-
-  static const int UNPACK_SKIP_IMAGES = 0x806D;
-
-  static const int UNPACK_SKIP_PIXELS = 0x0CF4;
-
-  static const int UNPACK_SKIP_ROWS = 0x0CF3;
-
-  static const int UNSIGNALED = 0x9118;
-
-  static const int UNSIGNED_BYTE = 0x1401;
-
-  static const int UNSIGNED_INT = 0x1405;
-
-  static const int UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
-
-  static const int UNSIGNED_INT_24_8 = 0x84FA;
-
-  static const int UNSIGNED_INT_2_10_10_10_REV = 0x8368;
-
-  static const int UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
-
-  static const int UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
-
-  static const int UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
-
-  static const int UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
-
-  static const int UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
-
-  static const int UNSIGNED_INT_VEC2 = 0x8DC6;
-
-  static const int UNSIGNED_INT_VEC3 = 0x8DC7;
-
-  static const int UNSIGNED_INT_VEC4 = 0x8DC8;
-
-  static const int UNSIGNED_NORMALIZED = 0x8C17;
-
-  static const int UNSIGNED_SHORT = 0x1403;
-
-  static const int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
-
-  static const int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
-
-  static const int UNSIGNED_SHORT_5_6_5 = 0x8363;
-
-  static const int VALIDATE_STATUS = 0x8B83;
-
-  static const int VENDOR = 0x1F00;
-
-  static const int VERSION = 0x1F02;
-
-  static const int VERTEX_ARRAY_BINDING = 0x85B5;
-
-  static const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-
-  static const int VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
-
-  static const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
-
-  static const int VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
-
-  static const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
-
-  static const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
-
-  static const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
-
-  static const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
-
-  static const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
-
-  static const int VERTEX_SHADER = 0x8B31;
-
-  static const int VIEWPORT = 0x0BA2;
-
-  static const int WAIT_FAILED = 0x911D;
-
-  static const int ZERO = 0;
-}
-// Copyright (c) 2012, 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.
-
-@Native("WebGL2RenderingContextBase")
-abstract class _WebGL2RenderingContextBase extends Interceptor
-    implements _WebGLRenderingContextBase {
-  // To suppress missing implicit constructor warnings.
-  factory _WebGL2RenderingContextBase._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  // From WebGLRenderingContextBase
-}
-// Copyright (c) 2012, 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.
-
-abstract class _WebGLRenderingContextBase extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory _WebGLRenderingContextBase._() {
-    throw new UnsupportedError("Not supported");
-  }
-}
diff --git a/sdk_nnbd/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk_nnbd/lib/web_sql/dart2js/web_sql_dart2js.dart
deleted file mode 100644
index f97b55e..0000000
--- a/sdk_nnbd/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ /dev/null
@@ -1,307 +0,0 @@
-/**
- * An API for storing data in the browser that can be queried with SQL.
- *
- * **Caution:** this specification is no longer actively maintained by the Web
- * Applications Working Group and may be removed at any time.
- * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase/)
- * for more information.
- *
- * The [dart:indexed_db] APIs is a recommended alternatives.
- *
- * {@category Web}
- */
-library dart.dom.web_sql;
-
-import 'dart:async';
-import 'dart:collection' hide LinkedList, LinkedListEntry;
-import 'dart:_internal' show FixedLengthListMixin;
-import 'dart:html';
-import 'dart:html_common';
-import 'dart:_foreign_helper' show JS;
-import 'dart:_interceptors' show Interceptor;
-// DO NOT EDIT - unless you are editing documentation as per:
-// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
-// Auto-generated dart:audio library.
-
-import 'dart:_js_helper'
-    show
-        applyExtension,
-        convertDartClosureToJS,
-        Creates,
-        JSName,
-        Native,
-        JavaScriptIndexingBehavior,
-        Returns;
-
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void SqlStatementCallback(
-    SqlTransaction transaction, SqlResultSet resultSet);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void SqlStatementErrorCallback(
-    SqlTransaction transaction, SqlError error);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void SqlTransactionCallback(SqlTransaction transaction);
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-typedef void SqlTransactionErrorCallback(SqlError error);
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Native("Database")
-class SqlDatabase extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SqlDatabase._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.openDatabase)');
-
-  String get version native;
-
-  @JSName('changeVersion')
-  /**
-   * Atomically update the database version to [newVersion], asynchronously
-   * running [callback] on the [SqlTransaction] representing this
-   * [changeVersion] transaction.
-   *
-   * If [callback] runs successfully, then [successCallback] is called.
-   * Otherwise, [errorCallback] is called.
-   *
-   * [oldVersion] should match the database's current [version] exactly.
-   *
-   * See also:
-   *
-   * * [Database.changeVersion](http://www.w3.org/TR/webdatabase/#dom-database-changeversion) from W3C.
-   */
-  void _changeVersion(String oldVersion, String newVersion,
-      [SqlTransactionCallback? callback,
-      SqlTransactionErrorCallback? errorCallback,
-      VoidCallback? successCallback]) native;
-
-  @JSName('changeVersion')
-  /**
-   * Atomically update the database version to [newVersion], asynchronously
-   * running [callback] on the [SqlTransaction] representing this
-   * [changeVersion] transaction.
-   *
-   * If [callback] runs successfully, then [successCallback] is called.
-   * Otherwise, [errorCallback] is called.
-   *
-   * [oldVersion] should match the database's current [version] exactly.
-   *
-   * See also:
-   *
-   * * [Database.changeVersion](http://www.w3.org/TR/webdatabase/#dom-database-changeversion) from W3C.
-   */
-  Future<SqlTransaction> changeVersion(String oldVersion, String newVersion) {
-    var completer = new Completer<SqlTransaction>();
-    _changeVersion(oldVersion, newVersion, (value) {
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  @JSName('readTransaction')
-  void _readTransaction(SqlTransactionCallback callback,
-      [SqlTransactionErrorCallback? errorCallback,
-      VoidCallback? successCallback]) native;
-
-  @JSName('readTransaction')
-  Future<SqlTransaction> readTransaction() {
-    var completer = new Completer<SqlTransaction>();
-    _readTransaction((value) {
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-
-  void transaction(SqlTransactionCallback callback,
-      [SqlTransactionErrorCallback? errorCallback,
-      VoidCallback? successCallback]) native;
-
-  @JSName('transaction')
-  Future<SqlTransaction> transaction_future() {
-    var completer = new Completer<SqlTransaction>();
-    transaction((value) {
-      applyExtension('SQLTransaction', value);
-      completer.complete(value);
-    }, (error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-}
-// Copyright (c) 2012, 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.
-
-@Native("SQLError")
-class SqlError extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SqlError._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  static const int CONSTRAINT_ERR = 6;
-
-  static const int DATABASE_ERR = 1;
-
-  static const int QUOTA_ERR = 4;
-
-  static const int SYNTAX_ERR = 5;
-
-  static const int TIMEOUT_ERR = 7;
-
-  static const int TOO_LARGE_ERR = 3;
-
-  static const int UNKNOWN_ERR = 0;
-
-  static const int VERSION_ERR = 2;
-
-  int get code native;
-
-  String get message native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SQLResultSet")
-class SqlResultSet extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SqlResultSet._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get insertId native;
-
-  SqlResultSetRowList get rows native;
-
-  int get rowsAffected native;
-}
-// Copyright (c) 2012, 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.
-
-@Native("SQLResultSetRowList")
-class SqlResultSetRowList extends Interceptor
-    with ListMixin<Map>, ImmutableListMixin<Map>
-    implements List<Map> {
-  // To suppress missing implicit constructor warnings.
-  factory SqlResultSetRowList._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  int get length => JS("int", "#.length", this);
-
-  Map operator [](int index) {
-    if (JS("bool", "# >>> 0 !== # || # >= #", index, index, index, length))
-      throw new RangeError.index(index, this);
-    return this.item(index)!;
-  }
-
-  void operator []=(int index, Map value) {
-    throw new UnsupportedError("Cannot assign element of immutable List.");
-  }
-  // -- start List<Map> mixins.
-  // Map is the element type.
-
-  set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  Map get first {
-    if (this.length > 0) {
-      return JS('Map', '#[0]', this);
-    }
-    throw new StateError("No elements");
-  }
-
-  Map get last {
-    int len = this.length;
-    if (len > 0) {
-      return JS('Map', '#[#]', this, len - 1);
-    }
-    throw new StateError("No elements");
-  }
-
-  Map get single {
-    int len = this.length;
-    if (len == 1) {
-      return JS('Map', '#[0]', this);
-    }
-    if (len == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  Map elementAt(int index) => this[index];
-  // -- end List<Map> mixins.
-
-  Map? item(int index) {
-    return convertNativeToDart_Dictionary(_item_1(index));
-  }
-
-  @JSName('item')
-  _item_1(index) native;
-}
-// Copyright (c) 2012, 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.
-
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-// http://www.w3.org/TR/webdatabase/#sqltransaction
-@deprecated // deprecated
-@Native("SQLTransaction")
-class SqlTransaction extends Interceptor {
-  // To suppress missing implicit constructor warnings.
-  factory SqlTransaction._() {
-    throw new UnsupportedError("Not supported");
-  }
-
-  @JSName('executeSql')
-  void _executeSql(String sqlStatement,
-      [List? arguments,
-      SqlStatementCallback? callback,
-      SqlStatementErrorCallback? errorCallback]) native;
-
-  @JSName('executeSql')
-  Future<SqlResultSet> executeSql(String sqlStatement, [List? arguments]) {
-    var completer = new Completer<SqlResultSet>();
-    _executeSql(sqlStatement, arguments, (transaction, resultSet) {
-      applyExtension('SQLResultSet', resultSet);
-      applyExtension('SQLResultSetRowList', resultSet.rows);
-      completer.complete(resultSet);
-    }, (transaction, error) {
-      completer.completeError(error);
-    });
-    return completer.future;
-  }
-}
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index 9aea031..c63f78e 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -2,12 +2,9 @@
 # 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.
 
-Language/Classes/Constructors/*: Skip # Not migrated to NNBD
-Language/Classes/Constructors/Constant_Constructors/*: Skip # Not migrated to NNBD
 Language/Classes/Constructors/Factories/*: Skip # Not migrated to NNBD
 Language/Classes/Constructors/Generative_Constructors/*: Skip # Not migrated to NNBD
-Language/Classes/Instance_Methods/Operators/*: Skip # Not migrated to NNBD
-Language/Classes/Superclasses/Inheritance_and_Overriding/*: Skip # Not migrated to NNBD
+Language/Classes/Superclasses/Inheritance_and_Overriding/inheritance_t07: Skip # Type aliases are not fully implemented
 Language/Enums/*: Skip # Not migrated to NNBD:
 Language/Errors_and_Warnings/*: Skip # Not migrated to NNBD
 Language/Expressions/Assignable_Expressions/*: Skip # Not migrated to NNBD
@@ -101,7 +98,6 @@
 LanguageFeatures/Simple-bounds/static/*: Skip # Not migrated to NNBD
 LanguageFeatures/Simple-bounds/static/type-aliases/*: Skip # Not migrated to NNBD
 LanguageFeatures/Spread-collections/*: Skip # Not migrated to NNBD
-LanguageFeatures/Subtyping/*: Skip # Not migrated to NNBD
 LanguageFeatures/Super-bounded-types/*: Skip # Not migrated to NNBD
 LanguageFeatures/Super-mixins/*: Skip # Not migrated to NNBD
 LanguageFeatures/Triple-Shift/*: Skip # Not migrated to NNBD
@@ -309,6 +305,16 @@
 LibTest/typed_data/Uint8List/*: Skip # Not migrated to NNBD
 Utils/tests/Expect/*: Skip # Not migrated to NNBD
 
+[ $compiler == dart2analyzer ]
+Language/Classes/Instance_Methods/Operators/allowed_names_t01: Skip # Triple shift is not fully implemented
+Language/Classes/Instance_Methods/Operators/arity_1_t19: Skip # Triple shift is not fully implemented (https://github.com/dart-lang/sdk/issues/42353)
+LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t02: Skip # Type aliases are not supported by analyzer
+LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t04: Skip # Type aliases are not supported by analyzer
+LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t06: Skip # Type aliases are not supported by analyzer
+
+[ $compiler == fasta ]
+Language/Classes/Superclasses/Inheritance_and_Overriding/inheritance_t10 : Skip # Type aliases are not fully implemented
+
 [ $compiler != fasta ]
 Language/Classes/Abstract_Instance_Members/inherited_t13: Skip # github.com/dart-lang/language/issues/115
 Language/Classes/Abstract_Instance_Members/inherited_t14: Skip # github.com/dart-lang/language/issues/115
diff --git a/tests/dart2js/internal/lax_runtime_type_closure_to_string1_test.dart b/tests/dart2js/internal/lax_runtime_type_closure_to_string1_test.dart
index 40b9f69..aed91ee 100644
--- a/tests/dart2js/internal/lax_runtime_type_closure_to_string1_test.dart
+++ b/tests/dart2js/internal/lax_runtime_type_closure_to_string1_test.dart
@@ -18,11 +18,7 @@
   var toString = '${local1.runtimeType}';
   if ('$Object' == 'Object') {
     // `true` if non-minified.
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      Expect.equals("Closure", toString);
-    } else {
-      Expect.equals("main_local1", toString);
-    }
+    Expect.equals("Closure", toString);
   }
   print(toString);
   local2(0);
diff --git a/tests/dart2js/internal/lax_runtime_type_closure_to_string2_test.dart b/tests/dart2js/internal/lax_runtime_type_closure_to_string2_test.dart
index 6425113..341a137 100644
--- a/tests/dart2js/internal/lax_runtime_type_closure_to_string2_test.dart
+++ b/tests/dart2js/internal/lax_runtime_type_closure_to_string2_test.dart
@@ -18,11 +18,7 @@
   var toString = '${local1.runtimeType}';
   if ('$Object' == 'Object') {
     // `true` if non-minified.
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      Expect.equals("Closure", toString);
-    } else {
-      Expect.equals("main_local1", toString);
-    }
+    Expect.equals("Closure", toString);
   }
   print(toString);
   local2(0);
diff --git a/tests/dart2js/internal/lax_runtime_type_closure_to_string7_test.dart b/tests/dart2js/internal/lax_runtime_type_closure_to_string7_test.dart
index 6d77543..652ac67 100644
--- a/tests/dart2js/internal/lax_runtime_type_closure_to_string7_test.dart
+++ b/tests/dart2js/internal/lax_runtime_type_closure_to_string7_test.dart
@@ -19,11 +19,7 @@
   var toString = '${local1.runtimeType}';
   if ('$Object' == 'Object') {
     // `true` if non-minified.
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      Expect.equals("Closure", toString);
-    } else {
-      Expect.equals("test_local1", toString);
-    }
+    Expect.equals("Closure", toString);
   }
   print(toString);
   local2(0);
diff --git a/tests/dart2js/internal/mock_libraries.dart b/tests/dart2js/internal/mock_libraries.dart
index 1667032..9580cff 100644
--- a/tests/dart2js/internal/mock_libraries.dart
+++ b/tests/dart2js/internal/mock_libraries.dart
@@ -265,7 +265,6 @@
   'RuntimeFunctionType': 'class RuntimeFunctionType {}',
   'RuntimeTypeGeneric': 'class RuntimeTypeGeneric {}',
   'RuntimeTypePlain': 'class RuntimeTypePlain {}',
-  'runtimeTypeToString': 'runtimeTypeToString(type, {onTypeVariable(i)}) {}',
   'S': 'S() {}',
   'setRuntimeTypeInfo': 'setRuntimeTypeInfo(a, b) {}',
   'stringSuperNativeTypeCast': 'stringSuperNativeTypeCast(value) {}',
@@ -289,7 +288,6 @@
   'throwRuntimeError': 'throwRuntimeError(message) {}',
   'throwUnsupportedError': 'throwUnsupportedError(message) {}',
   'throwTypeError': 'throwTypeError(message) {}',
-  'TypeImpl': 'class TypeImpl {}',
   'TypeVariable': '''class TypeVariable {
     final Type owner;
     final String name;
diff --git a/tests/dart2js/native/field_type2_test.dart b/tests/dart2js/native/field_type2_test.dart
index 3bc2e10..fdf77bb 100644
--- a/tests/dart2js/native/field_type2_test.dart
+++ b/tests/dart2js/native/field_type2_test.dart
@@ -9,7 +9,7 @@
 
 @Native("Node")
 class Node {
-  final parentNode;
+  get parentNode native;
 }
 
 makeNode(parent) native;
diff --git a/tests/dart2js/native/field_type_test.dart b/tests/dart2js/native/field_type_test.dart
index 8e2e83d..e488855 100644
--- a/tests/dart2js/native/field_type_test.dart
+++ b/tests/dart2js/native/field_type_test.dart
@@ -10,7 +10,7 @@
 
 @Native("Node")
 class Node {
-  final Node parentNode;
+  Node get parentNode native;
 
   ModelSource _modelSource; // If null, inherited from parent.
 
diff --git a/tests/dart2js/native/native_exceptions1_frog_test.dart b/tests/dart2js/native/native_exceptions1_frog_test.dart
index 497a80c..fbef012 100644
--- a/tests/dart2js/native/native_exceptions1_frog_test.dart
+++ b/tests/dart2js/native/native_exceptions1_frog_test.dart
@@ -20,7 +20,7 @@
 class E {
   E._used() native; // Bogus native constructor, called only from fake body.
 
-  final int code;
+  int get code native;
 }
 
 // Type with exception-throwing methods.
diff --git a/tests/dart2js/native/native_mixin_with_plain_test.dart b/tests/dart2js/native/native_mixin_with_plain_test.dart
index aea5e67..5130caa 100644
--- a/tests/dart2js/native/native_mixin_with_plain_test.dart
+++ b/tests/dart2js/native/native_mixin_with_plain_test.dart
@@ -9,7 +9,7 @@
 
 @Native("A")
 class A {
-  final String aa;
+  String get aa native;
   foo() => "A-foo $aa";
   baz() => "A-baz $aa";
 }
diff --git a/tests/dart2js/native/native_window1_frog_test.dart b/tests/dart2js/native/native_window1_frog_test.dart
index f47b66d..c8636e0 100644
--- a/tests/dart2js/native/native_window1_frog_test.dart
+++ b/tests/dart2js/native/native_window1_frog_test.dart
@@ -5,14 +5,14 @@
 import "native_testing.dart";
 
 abstract class Window {
-  final int document;
+  int get document native;
 }
 
 // Defining this global object makes Frog eager on optimizing
 // call sites where the receiver is typed 'Window'.
 @Native("@*DOMWindow")
 class _DOMWindowJs implements Window {
-  final int document;
+  int get document native;
 }
 
 class Win implements Window {
diff --git a/tests/dart2js/native/native_window2_frog_test.dart b/tests/dart2js/native/native_window2_frog_test.dart
index 143c1e6..33ae6d4 100644
--- a/tests/dart2js/native/native_window2_frog_test.dart
+++ b/tests/dart2js/native/native_window2_frog_test.dart
@@ -5,14 +5,14 @@
 import "native_testing.dart";
 
 abstract class Window {
-  final int document;
+  int get document native;
 }
 
 // Defining this global object makes Frog eager on optimizing
 // call sites where the receiver is typed 'Window'.
 @Native("@*DOMWindow")
 class _DOMWindowJs implements Window {
-  final int document;
+  int get document native;
 }
 
 class Win implements Window {
diff --git a/tests/dart2js/native/subclassing_constructor_1_test.dart b/tests/dart2js/native/subclassing_constructor_1_test.dart
index bf989a7..45934f8 100644
--- a/tests/dart2js/native/subclassing_constructor_1_test.dart
+++ b/tests/dart2js/native/subclassing_constructor_1_test.dart
@@ -17,8 +17,8 @@
 @Native("A")
 class A {
   final a1 = log(101); // Only initialized IF named constructor called.
-  final a2; // Initialized by native constructor.
-  final a3; // Initialized only by A.two.
+  get a2 native; // Initialized by native constructor.
+  var a3; // Initialized only by A.two.
   var a4 = log(104);
 
   A.one();
@@ -37,7 +37,7 @@
 }
 
 class B extends A {
-  final b1;
+  var b1;
   final b2 = log(202);
   var b3;
 
diff --git a/tests/dart2js_2/internal/lax_runtime_type_closure_to_string1_test.dart b/tests/dart2js_2/internal/lax_runtime_type_closure_to_string1_test.dart
index fccddbf..51d90d5 100644
--- a/tests/dart2js_2/internal/lax_runtime_type_closure_to_string1_test.dart
+++ b/tests/dart2js_2/internal/lax_runtime_type_closure_to_string1_test.dart
@@ -20,11 +20,7 @@
   var toString = '${local1.runtimeType}';
   if ('$Object' == 'Object') {
     // `true` if non-minified.
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      Expect.equals("Closure", toString);
-    } else {
-      Expect.equals("main_local1", toString);
-    }
+    Expect.equals("Closure", toString);
   }
   print(toString);
   local2(0);
diff --git a/tests/dart2js_2/internal/lax_runtime_type_closure_to_string2_test.dart b/tests/dart2js_2/internal/lax_runtime_type_closure_to_string2_test.dart
index 1fb26ab..abff2a3 100644
--- a/tests/dart2js_2/internal/lax_runtime_type_closure_to_string2_test.dart
+++ b/tests/dart2js_2/internal/lax_runtime_type_closure_to_string2_test.dart
@@ -20,11 +20,7 @@
   var toString = '${local1.runtimeType}';
   if ('$Object' == 'Object') {
     // `true` if non-minified.
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      Expect.equals("Closure", toString);
-    } else {
-      Expect.equals("main_local1", toString);
-    }
+    Expect.equals("Closure", toString);
   }
   print(toString);
   local2(0);
diff --git a/tests/dart2js_2/internal/lax_runtime_type_closure_to_string7_test.dart b/tests/dart2js_2/internal/lax_runtime_type_closure_to_string7_test.dart
index 2fe0294..4c2fe3a 100644
--- a/tests/dart2js_2/internal/lax_runtime_type_closure_to_string7_test.dart
+++ b/tests/dart2js_2/internal/lax_runtime_type_closure_to_string7_test.dart
@@ -21,11 +21,7 @@
   var toString = '${local1.runtimeType}';
   if ('$Object' == 'Object') {
     // `true` if non-minified.
-    if (JS_GET_FLAG('USE_NEW_RTI')) {
-      Expect.equals("Closure", toString);
-    } else {
-      Expect.equals("test_local1", toString);
-    }
+    Expect.equals("Closure", toString);
   }
   print(toString);
   local2(0);
diff --git a/tests/dart2js_2/internal/mock_libraries.dart b/tests/dart2js_2/internal/mock_libraries.dart
index 74088da..262b185 100644
--- a/tests/dart2js_2/internal/mock_libraries.dart
+++ b/tests/dart2js_2/internal/mock_libraries.dart
@@ -199,15 +199,10 @@
       }''',
   'getFallThroughError': 'getFallThroughError() {}',
   'getIsolateAffinityTag': 'getIsolateAffinityTag(_) {}',
-  'getRuntimeTypeArgumentIntercepted':
-      'getRuntimeTypeArgumentIntercepted(interceptor, target, substitutionName, index) {}',
-  'getRuntimeTypeArgument':
-      'getRuntimeTypeArgument(target, substitutionName, index) {}',
   'getRuntimeTypeArguments':
       'getRuntimeTypeArguments(target, substitutionName) {}',
   'getRuntimeTypeInfo': 'getRuntimeTypeInfo(a) {}',
   'getTraceFromException': 'getTraceFromException(exception) {}',
-  'getTypeArgumentByIndex': 'getTypeArgumentByIndex(target, index) {}',
   'GeneralConstantMap': 'class GeneralConstantMap {}',
   'iae': 'iae(x) { throw x; } ioore(x) { throw x; }',
   'Instantiation1': 'class Instantiation1<T1> extends Closure {}',
@@ -236,7 +231,6 @@
   'RuntimeFunctionType': 'class RuntimeFunctionType {}',
   'RuntimeTypeGeneric': 'class RuntimeTypeGeneric {}',
   'RuntimeTypePlain': 'class RuntimeTypePlain {}',
-  'runtimeTypeToString': 'runtimeTypeToString(type, {onTypeVariable(i)}) {}',
   'S': 'S() {}',
   'setRuntimeTypeInfo': 'setRuntimeTypeInfo(a, b) {}',
   'subtypeOfRuntimeTypeCast': 'subtypeOfRuntimeTypeCast(object, type) {}',
@@ -252,8 +246,6 @@
       'throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {}',
   'throwRuntimeError': 'throwRuntimeError(message) {}',
   'throwUnsupportedError': 'throwUnsupportedError(message) {}',
-  'throwTypeError': 'throwTypeError(message) {}',
-  'TypeImpl': 'class TypeImpl {}',
   'TypeVariable': '''class TypeVariable {
     final Type owner;
     final String name;
diff --git a/tests/dart2js_2/native/field_type2_test.dart b/tests/dart2js_2/native/field_type2_test.dart
index abf0d94..2a9ff0c 100644
--- a/tests/dart2js_2/native/field_type2_test.dart
+++ b/tests/dart2js_2/native/field_type2_test.dart
@@ -11,7 +11,7 @@
 
 @Native("Node")
 class Node {
-  final parentNode;
+  get parentNode native;
 }
 
 makeNode(parent) native;
diff --git a/tests/dart2js_2/native/field_type_test.dart b/tests/dart2js_2/native/field_type_test.dart
index e59ad72..7ce0db3 100644
--- a/tests/dart2js_2/native/field_type_test.dart
+++ b/tests/dart2js_2/native/field_type_test.dart
@@ -12,7 +12,7 @@
 
 @Native("Node")
 class Node {
-  final Node parentNode;
+  Node get parentNode native;
 
   ModelSource _modelSource; // If null, inherited from parent.
 
diff --git a/tests/dart2js_2/native/native_exceptions1_frog_test.dart b/tests/dart2js_2/native/native_exceptions1_frog_test.dart
index 084075e..8617219 100644
--- a/tests/dart2js_2/native/native_exceptions1_frog_test.dart
+++ b/tests/dart2js_2/native/native_exceptions1_frog_test.dart
@@ -22,7 +22,7 @@
 class E {
   E._used() native; // Bogus native constructor, called only from fake body.
 
-  final int code;
+  int get code native;
 }
 
 // Type with exception-throwing methods.
diff --git a/tests/dart2js_2/native/native_mixin_with_plain_test.dart b/tests/dart2js_2/native/native_mixin_with_plain_test.dart
index d3ad80c..a7bd565 100644
--- a/tests/dart2js_2/native/native_mixin_with_plain_test.dart
+++ b/tests/dart2js_2/native/native_mixin_with_plain_test.dart
@@ -11,7 +11,7 @@
 
 @Native("A")
 class A {
-  final String aa;
+  String get aa native;
   foo() => "A-foo $aa";
   baz() => "A-baz $aa";
 }
diff --git a/tests/dart2js_2/native/native_window1_frog_test.dart b/tests/dart2js_2/native/native_window1_frog_test.dart
index add29bc..094a271 100644
--- a/tests/dart2js_2/native/native_window1_frog_test.dart
+++ b/tests/dart2js_2/native/native_window1_frog_test.dart
@@ -7,14 +7,14 @@
 import "native_testing.dart";
 
 abstract class Window {
-  final int document;
+  int get document native;
 }
 
 // Defining this global object makes Frog eager on optimizing
 // call sites where the receiver is typed 'Window'.
 @Native("@*DOMWindow")
 class _DOMWindowJs implements Window {
-  final int document;
+  int get document native;
 }
 
 class Win implements Window {
diff --git a/tests/dart2js_2/native/native_window2_frog_test.dart b/tests/dart2js_2/native/native_window2_frog_test.dart
index 5593517..d97771d 100644
--- a/tests/dart2js_2/native/native_window2_frog_test.dart
+++ b/tests/dart2js_2/native/native_window2_frog_test.dart
@@ -7,14 +7,14 @@
 import "native_testing.dart";
 
 abstract class Window {
-  final int document;
+  int get document native;
 }
 
 // Defining this global object makes Frog eager on optimizing
 // call sites where the receiver is typed 'Window'.
 @Native("@*DOMWindow")
 class _DOMWindowJs implements Window {
-  final int document;
+  int get document native;
 }
 
 class Win implements Window {
diff --git a/tests/dart2js_2/native/subclassing_constructor_1_test.dart b/tests/dart2js_2/native/subclassing_constructor_1_test.dart
index ebf8929..d70e1e3 100644
--- a/tests/dart2js_2/native/subclassing_constructor_1_test.dart
+++ b/tests/dart2js_2/native/subclassing_constructor_1_test.dart
@@ -19,8 +19,8 @@
 @Native("A")
 class A {
   final a1 = log(101); // Only initialized IF named constructor called.
-  final a2; // Initialized by native constructor.
-  final a3; // Initialized only by A.two.
+  get a2 native; // Initialized by native constructor.
+  var a3; // Initialized only by A.two.
   var a4 = log(104);
 
   A.one();
@@ -39,7 +39,7 @@
 }
 
 class B extends A {
-  final b1;
+  var b1;
   final b2 = log(202);
   var b3;
 
diff --git a/tests/language/class/override_inference_error_test.dart b/tests/language/class/override_inference_error_test.dart
index f5dc514..65bcae6 100644
--- a/tests/language/class/override_inference_error_test.dart
+++ b/tests/language/class/override_inference_error_test.dart
@@ -172,7 +172,7 @@
 class CInvalid9 implements IReq {
   // Do not inherit `required` if there is no type.
   void foo({x}) {}
-  //       ^
+  //        ^
   // [analyzer] COMPILE_TIME_ERROR.MISSING_DEFAULT_VALUE_FOR_PARAMETER
   // [cfe] unspecified
 }
diff --git a/tests/language/class/override_inference_test.dart b/tests/language/class/override_inference_test.dart
index 8bbd678..0057594 100644
--- a/tests/language/class/override_inference_test.dart
+++ b/tests/language/class/override_inference_test.dart
@@ -94,7 +94,7 @@
     x = intVar;
     var xList = [x];
     listIntVar = xList;
-    return itVar;
+    return intVar;
   }
 }
 
diff --git a/tests/language/covariant/subtyping_test.dart b/tests/language/covariant/subtyping_test.dart
index da7af10..51aa58f 100644
--- a/tests/language/covariant/subtyping_test.dart
+++ b/tests/language/covariant/subtyping_test.dart
@@ -175,14 +175,14 @@
   test(GenericMethodBounds<Object?> g) {
     Expect.throwsTypeError(() => g.foo<String>());
     Expect.throwsTypeError(() => g.foo());
-    Expect.equals(g.foo<Null>().t, Null);
+    Expect.equals(g.foo<Never>().t, Never);
     Expect.equals(g.foo<int>().t, int);
     Expect.isFalse(g.foo<int>() is GenericMethodBounds<double>);
     g.bar<Function(Object?)>();
     dynamic d = g;
     d.bar<Function(num)>();
     Expect.throwsTypeError(() => d.bar<Function(String)>());
-    Expect.throwsTypeError(() => d.bar<Function(Null)>());
+    Expect.throwsTypeError(() => d.bar<Function(Never)>());
   }
 
   test(new GenericMethodBounds<num>());
@@ -202,7 +202,7 @@
   ClassF<int> cc = new ClassF<int>();
   ClassF<Object> ca = cc; // An upcast, per covariance.
   F<Object> f = ca;
-  void f2(Object x) {}
+  void f2(Object? x) {}
   Expect.equals(f.runtimeType, f2.runtimeType);
   Expect.throwsTypeError(() => f(new Object()));
 }
@@ -219,18 +219,18 @@
 
 testTearOffRuntimeType() {
   expectRTTI(tearoff, type) => Expect.equals('${tearoff.runtimeType}', type,
-      'covariant params should reify with Object as their type');
+      'covariant params should reify with Object? as their type');
 
   TearOff<num> t = new TearOff<int>();
-  expectRTTI(t.method1, '(Object) => dynamic');
+  expectRTTI(t.method1, '(Object?) => dynamic');
 
   expectRTTI(t.method2, '((int) => dynamic) => dynamic');
-  expectRTTI(t.method3, '(Object) => dynamic');
+  expectRTTI(t.method3, '(Object?) => dynamic');
 
-  expectRTTI(t.method4, '(Object) => dynamic');
+  expectRTTI(t.method4, '(Object?) => dynamic');
   expectRTTI(t.method5, '((() => int) => dynamic) => dynamic');
   expectRTTI(t.method6, '(() => (int) => dynamic) => dynamic');
-  expectRTTI(t.method7, '(Object) => dynamic');
+  expectRTTI(t.method7, '(Object?) => dynamic');
 }
 
 main() {
diff --git a/tests/language/factory/return_type_checked_test.dart b/tests/language/factory/return_type_checked_test.dart
index bff29b4..c882f4f 100644
--- a/tests/language/factory/return_type_checked_test.dart
+++ b/tests/language/factory/return_type_checked_test.dart
@@ -7,7 +7,7 @@
 class A {
   factory A() => 42;
   //             ^^
-  // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE_FROM_CLOSURE
+  // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE
   // [cfe] A value of type 'int' can't be assigned to a variable of type 'A'.
 }
 
diff --git a/tests/language/override/inheritance_generic_test.dart b/tests/language/override/inheritance_generic_test.dart
index dd0481d..6256bc8 100644
--- a/tests/language/override/inheritance_generic_test.dart
+++ b/tests/language/override/inheritance_generic_test.dart
@@ -3,11 +3,11 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class A<T> {
-  method1(T t) => null; //# 01: ok
-  method2(T t) => null; //# 02: compile-time error
-  method4(T t) => null; //# 04: compile-time error
-  method5(T t) => null; //# 05: ok
-  method7(T t) => null; //# 07: compile-time error
+  void method1(T t) => null; //# 01: ok
+  void method2(T t) => null; //# 02: compile-time error
+  void method4(T t) => null; //# 04: compile-time error
+  void method5(T t) => null; //# 05: ok
+  void method7(T t) => null; //# 07: compile-time error
 }
 
 class B<S> extends A
@@ -16,26 +16,26 @@
 <S> //# 04: continued
 <S> //# 05: continued
 {
-  method1(S s) => null; //# 01: continued
-  method2(int i) => null; //# 02: continued
-  method3(S s) => null; //# 03: ok
-  method4(int i) => null; //# 04: continued
-  method6(S s) => null; //# 06: compile-time error
+  void method1(S s) => null; //# 01: continued
+  void method2(int i) => null; //# 02: continued
+  void method3(S s) => null; //# 03: ok
+  void method4(int i) => null; //# 04: continued
+  void method6(S s) => null; //# 06: compile-time error
 }
 
 abstract class I<U> {
-  method3(U u) => null; //# 03: continued
-  method6(U u) => null; //# 06: continued
-  method7(U u) => null; //# 07: continued
-  method8(U u) => null; //# 08: compile-time error
-  method9(U u) => null; //# 09: compile-time error
-  method10(U u) => null; //# 10: compile-time error
+  void method3(U u) => null; //# 03: continued
+  void method6(U u) => null; //# 06: continued
+  void method7(U u) => null; //# 07: continued
+  void method8(U u) => null; //# 08: compile-time error
+  void method9(U u) => null; //# 09: compile-time error
+  void method10(U u) => null; //# 10: compile-time error
 }
 
 abstract class J<V> {
-  method8(V v) => null; //# 08: continued
-  method9(V v) => null; //# 09: continued
-  method10(V v) => null; //# 10: continued
+  void method8(V v) => null; //# 08: continued
+  void method9(V v) => null; //# 09: continued
+  void method10(V v) => null; //# 10: continued
 }
 
 abstract class Class<W> extends B
@@ -57,16 +57,16 @@
 <num> //# 09: continued
 <num> //# 10: continued
 {
-  method3(num i) => null; //# 03: continued
-  method5(W w) => null; //# 05: continued
-  method6(int i) => null; //# 06: continued
-  method7(double d) => null; //# 07: continued
-  method8(double d) => null; //# 08: continued
+  void method3(num i) => null; //# 03: continued
+  void method5(W w) => null; //# 05: continued
+  void method6(int i) => null; //# 06: continued
+  void method7(double d) => null; //# 07: continued
+  void method8(double d) => null; //# 08: continued
 }
 
 class SubClass extends Class {
-  method9(double d) => null; //# 09: continued
-  method10(String s) => null; //# 10: continued
+  void method9(double d) => null; //# 09: continued
+  void method10(String s) => null; //# 10: continued
 }
 
 main() {
diff --git a/tests/language/static/call_wrong_argument_count_test.dart b/tests/language/static/call_wrong_argument_count_test.dart
new file mode 100644
index 0000000..575c486
--- /dev/null
+++ b/tests/language/static/call_wrong_argument_count_test.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Test mismatch in argument counts.
+class Niesen {
+  static int goodCall(int a, int b, int c) {
+    return a + b;
+  }
+}
+
+main() {
+  Niesen.goodCall(1, 2, 3);
+
+  Niesen.goodCall(1, 2, 3, 4);
+  //             ^^^^^^^^^^^^
+  // [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS
+  // [cfe] Too many positional arguments: 3 allowed, but 4 found.
+}
diff --git a/tests/language/static/closure_identical_test.dart b/tests/language/static/closure_identical_test.dart
new file mode 100644
index 0000000..aa176a4
--- /dev/null
+++ b/tests/language/static/closure_identical_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2013, 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:expect/expect.dart";
+
+var foo = main;
+
+main() {
+  Expect.equals(main, main);
+  Expect.identical(main, main);
+  Expect.equals(main.hashCode, main.hashCode);
+
+  Expect.equals(main, foo);
+  Expect.identical(main, foo);
+  Expect.equals(main.hashCode, foo.hashCode);
+}
diff --git a/tests/language/static/const_field_reserved_name_test.dart b/tests/language/static/const_field_reserved_name_test.dart
new file mode 100644
index 0000000..1de0168
--- /dev/null
+++ b/tests/language/static/const_field_reserved_name_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2016, 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.
+
+// Dart test for testing redefinition of reserved names as static const fields.
+// Issue https://github.com/dart-archive/dev_compiler/issues/587
+
+import "package:expect/expect.dart";
+
+class Field {
+  static const name = 'Foo';
+}
+
+class StaticConstFieldReservedNameTest {
+  static testMain() {
+    Expect.equals('Foo', Field.name);
+  }
+}
+
+class Foo {
+  int get foo => 42;
+  static final baz = new Foo();
+}
+
+class Bar extends Foo {
+  get foo => 123;
+  Bar.baz();
+}
+
+void main() {
+  StaticConstFieldReservedNameTest.testMain();
+
+  // Regression test for https://github.com/dart-lang/sdk/issues/33621
+  Expect.equals(Bar.baz().foo, 123);
+}
diff --git a/tests/language/static/const_field_test.dart b/tests/language/static/const_field_test.dart
new file mode 100644
index 0000000..2a6547e
--- /dev/null
+++ b/tests/language/static/const_field_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2011, 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.
+// Dart test program for testing static const fields.
+
+import "package:expect/expect.dart";
+
+abstract class Spain {
+  static const AG = "Antoni Gaudi";
+  static const SD = "Salvador Dali";
+}
+
+abstract class Switzerland {
+  static const AG = "Alberto Giacometti";
+  static const LC = "Le Corbusier";
+}
+
+class A implements Switzerland {
+  const A() : n = 5;
+  final n;
+  static const a = const A();
+  static const b = 3 + 5;
+  static const c = A.b + 7;
+  static const d = const A();
+  static const s1 = "hula";
+  static const s2 = "hula";
+  static const s3 = "hop";
+  static const d1 = 1.1;
+  static const d2 = 0.55 + 0.55;
+  static const artist2 = Switzerland.AG;
+  static const architect1 = Spain.AG;
+  static const array1 = const <int>[1, 2];
+  static const map1 = const {
+    "Monday": 1,
+    "Tuesday": 2,
+  };
+}
+
+class StaticFinalFieldTest {
+  static testMain() {
+    Expect.equals(15, A.c);
+    Expect.equals(8, A.b);
+    Expect.equals(5, A.a.n);
+    Expect.equals(true, identical(8, A.b));
+    Expect.equals(true, identical(A.a, A.d));
+    Expect.equals(true, identical(A.s1, A.s2));
+    Expect.equals(false, identical(A.s1, A.s3));
+    Expect.equals(false, identical(A.s1, A.b));
+    Expect.equals(true, identical(A.d1, A.d2));
+    Expect.equals(true, Spain.SD == "Salvador Dali");
+    Expect.equals(true, A.artist2 == "Alberto Giacometti");
+    Expect.equals(true, A.architect1 == "Antoni Gaudi");
+    Expect.equals(2, A.map1["Tuesday"]);
+  }
+}
+
+main() {
+  StaticFinalFieldTest.testMain();
+}
diff --git a/tests/language/static/field1_runtime_test.dart b/tests/language/static/field1_runtime_test.dart
new file mode 100644
index 0000000..6db193e
--- /dev/null
+++ b/tests/language/static/field1_runtime_test.dart
@@ -0,0 +1,25 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2011, 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.
+// Test that a static field cannot be read as an instance field.
+
+class Foo {
+  Foo() {}
+  static var x;
+}
+
+class StaticField1Test {
+  static testMain() {
+    if (false) {
+      var foo = new Foo();
+
+    }
+  }
+}
+
+main() {
+  StaticField1Test.testMain();
+}
diff --git a/tests/language/static/field1_test.dart b/tests/language/static/field1_test.dart
new file mode 100644
index 0000000..e4e1472
--- /dev/null
+++ b/tests/language/static/field1_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2011, 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.
+// Test that a static field cannot be read as an instance field.
+
+class Foo {
+  Foo() {}
+  static var x;
+}
+
+class StaticField1Test {
+  static testMain() {
+    if (false) {
+      var foo = new Foo();
+      var x = foo.x;
+      //          ^
+      // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER
+      // [cfe] The getter 'x' isn't defined for the class 'Foo'.
+    }
+  }
+}
+
+main() {
+  StaticField1Test.testMain();
+}
diff --git a/tests/language/static/field1a_runtime_test.dart b/tests/language/static/field1a_runtime_test.dart
new file mode 100644
index 0000000..1f6b798
--- /dev/null
+++ b/tests/language/static/field1a_runtime_test.dart
@@ -0,0 +1,25 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2011, 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.
+// Test that a static method cannot be read as an instance field.
+
+class Foo {
+  Foo() {}
+  static void m() {}
+}
+
+class StaticField1aTest {
+  static testMain() {
+    if (false) {
+      var foo = new Foo();
+
+    }
+  }
+}
+
+main() {
+  StaticField1aTest.testMain();
+}
diff --git a/tests/language/static/field1a_test.dart b/tests/language/static/field1a_test.dart
new file mode 100644
index 0000000..9d7f2f2
--- /dev/null
+++ b/tests/language/static/field1a_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2011, 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.
+// Test that a static method cannot be read as an instance field.
+
+class Foo {
+  Foo() {}
+  static void m() {}
+}
+
+class StaticField1aTest {
+  static testMain() {
+    if (false) {
+      var foo = new Foo();
+      var m = foo.m;
+      //          ^
+      // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER
+      // [cfe] The getter 'm' isn't defined for the class 'Foo'.
+    }
+  }
+}
+
+main() {
+  StaticField1aTest.testMain();
+}
diff --git a/tests/language/static/field3_runtime_test.dart b/tests/language/static/field3_runtime_test.dart
new file mode 100644
index 0000000..d2c9f3a
--- /dev/null
+++ b/tests/language/static/field3_runtime_test.dart
@@ -0,0 +1,22 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2011, 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.
+// Test that an instance field cannot be read as a static field.
+
+class Foo {
+  Foo() {}
+  var x;
+  void m() {}
+}
+
+main() {
+  if (false) {
+
+
+
+
+  }
+}
diff --git a/tests/language/static/field3_test.dart b/tests/language/static/field3_test.dart
new file mode 100644
index 0000000..7436df1
--- /dev/null
+++ b/tests/language/static/field3_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2011, 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.
+// Test that an instance field cannot be read as a static field.
+
+class Foo {
+  Foo() {}
+  var x;
+  void m() {}
+}
+
+main() {
+  if (false) {
+    var x = Foo.x;
+    //          ^
+    // [analyzer] STATIC_WARNING.STATIC_ACCESS_TO_INSTANCE_MEMBER
+    // [cfe] Getter not found: 'x'.
+    var m = Foo.m;
+    //          ^
+    // [analyzer] STATIC_WARNING.STATIC_ACCESS_TO_INSTANCE_MEMBER
+    // [cfe] Getter not found: 'm'.
+    Foo.m = 1;
+    //  ^
+    // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER
+    // [cfe] Setter not found: 'm'.
+    Foo.x = 1;
+    //  ^
+    // [analyzer] STATIC_WARNING.STATIC_ACCESS_TO_INSTANCE_MEMBER
+    // [cfe] Setter not found: 'x'.
+  }
+}
diff --git a/tests/language/static/field_override1_test.dart b/tests/language/static/field_override1_test.dart
new file mode 100644
index 0000000..a51682f
--- /dev/null
+++ b/tests/language/static/field_override1_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2016, 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:expect/expect.dart';
+
+class Foo {
+  static int get x => 42;
+}
+
+class Bar extends Foo {
+  static int x = 12;
+}
+
+void main() {
+  Expect.equals(12, Bar.x);
+}
diff --git a/tests/language/static/field_override2_test.dart b/tests/language/static/field_override2_test.dart
new file mode 100644
index 0000000..98e8e11
--- /dev/null
+++ b/tests/language/static/field_override2_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2016, 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:expect/expect.dart';
+
+class Foo {
+  static int get x => 42;
+  static void set x(value) {}
+}
+
+class Bar extends Foo {
+  static int x = 12;
+}
+
+void main() {
+  Expect.equals(12, Bar.x);
+}
diff --git a/tests/language/static/field_override3_test.dart b/tests/language/static/field_override3_test.dart
new file mode 100644
index 0000000..44c70fd
--- /dev/null
+++ b/tests/language/static/field_override3_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2016, 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:expect/expect.dart';
+
+class Foo {
+  static int x = 42;
+}
+
+class Bar extends Foo {
+  static int x = 12;
+}
+
+void main() {
+  Expect.equals(12, Bar.x);
+}
diff --git a/tests/language/static/field_test.dart b/tests/language/static/field_test.dart
new file mode 100644
index 0000000..ed054f6
--- /dev/null
+++ b/tests/language/static/field_test.dart
@@ -0,0 +1,114 @@
+// Copyright (c) 2012, 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.
+// Dart test program for testing setting/getting/initializing static fields.
+
+import "package:expect/expect.dart";
+
+class First {
+  First() {}
+  static var a;
+  static var b;
+  static const int c = 1;
+  static setValues() {
+    a = 24;
+    b = 10;
+    return a + b + c;
+  }
+}
+
+class InitializerTest {
+  static var one;
+  static var two = 2;
+  static var three = 2;
+
+  static checkValueOfThree() {
+    // We need to keep this check separate to prevent three from
+    // getting initialized before the += is executed.
+    Expect.equals(3, three);
+  }
+
+  static void testStaticFieldInitialization() {
+    Expect.equals(null, one);
+    Expect.equals(2, two);
+    one = 11;
+    two = 22;
+    Expect.equals(11, one);
+    Expect.equals(22, two);
+
+    // Assignment operators exercise a different code path.  Make sure
+    // that initialization works here as well.
+    three += 1;
+    checkValueOfThree();
+  }
+}
+
+class StaticFieldTest {
+  static testMain() {
+    First.a = 3;
+    First.b = First.a;
+    Expect.equals(3, First.a);
+    Expect.equals(First.a, First.b);
+    First.b = (First.a = 10);
+    Expect.equals(10, First.a);
+    Expect.equals(10, First.b);
+    First.b = First.a = 15;
+    Expect.equals(15, First.a);
+    Expect.equals(15, First.b);
+    Expect.equals(35, First.setValues());
+    Expect.equals(24, First.a);
+    Expect.equals(10, First.b);
+  }
+}
+
+class StaticField1RunNegativeTest {
+  static // //# 01: compile-time error
+  var x;
+  testMain() {
+    var foo = new StaticField1RunNegativeTest();
+    print(x); // Used to compile 'x' and force any errors.
+    var result = foo.x;
+  }
+}
+
+class StaticField1aRunNegativeTest {
+  static // //# 02: compile-time error, runtime error
+  void m() {}
+
+  testMain() {
+    var foo = new StaticField1aRunNegativeTest();
+    print(m); // Used to compile 'm' and force any errors.
+    var result = foo.m;
+  }
+}
+
+class StaticField2RunNegativeTest {
+  static //# 03:  compile-time error
+  var x;
+
+  testMain() {
+    var foo = new StaticField2RunNegativeTest();
+    print(x); // Used to compile 'x' and force any errors.
+    foo.x = 1;
+  }
+}
+
+class StaticField2aRunNegativeTest {
+  static //  //# 04: compile-time error
+  void m() {}
+
+  testMain() {
+    var foo = new StaticField2aRunNegativeTest();
+    print(m); // Used to compile 'm' and force any errors.
+    foo.m = 1; //# 04:continued
+  }
+}
+
+main() {
+  StaticFieldTest.testMain();
+  InitializerTest.testStaticFieldInitialization();
+  new StaticField1RunNegativeTest().testMain();
+  new StaticField1aRunNegativeTest().testMain();
+  new StaticField2RunNegativeTest().testMain();
+  new StaticField2aRunNegativeTest().testMain();
+}
diff --git a/tests/language/static/final_field2_runtime_test.dart b/tests/language/static/final_field2_runtime_test.dart
new file mode 100644
index 0000000..b69448d
--- /dev/null
+++ b/tests/language/static/final_field2_runtime_test.dart
@@ -0,0 +1,25 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2011, 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.
+// Disallow re-assignment of a final static variable.
+
+class A {
+  static const x = 1;
+}
+
+class B {
+  const B() : n = 5;
+  final n;
+
+  static const b = 3 + 5;
+}
+
+main() {
+
+  new B();
+  print(B.b);
+
+}
diff --git a/tests/language/static/final_field2_test.dart b/tests/language/static/final_field2_test.dart
new file mode 100644
index 0000000..0755461
--- /dev/null
+++ b/tests/language/static/final_field2_test.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2011, 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.
+// Disallow re-assignment of a final static variable.
+
+class A {
+  static const x = 1;
+}
+
+class B {
+  const B() : n = 5;
+  final n;
+  static const a;
+  //           ^
+  // [analyzer] COMPILE_TIME_ERROR.CONST_NOT_INITIALIZED
+  // [cfe] The const variable 'a' must be initialized.
+  static const b = 3 + 5;
+}
+
+main() {
+  A.x = 2;
+//^^^
+// [analyzer] STATIC_WARNING.ASSIGNMENT_TO_CONST
+//  ^
+// [cfe] Setter not found: 'x'.
+  new B();
+  print(B.b);
+  print(B.a);
+}
diff --git a/tests/language/static/getter_no_setter1_runtime_test.dart b/tests/language/static/getter_no_setter1_runtime_test.dart
new file mode 100644
index 0000000..13567db
--- /dev/null
+++ b/tests/language/static/getter_no_setter1_runtime_test.dart
@@ -0,0 +1,20 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2015, 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:expect/expect.dart';
+
+class Class {
+  static int get getter => 0;
+
+  method() {
+
+  }
+}
+
+main() {
+  new Class().method();
+}
diff --git a/tests/language/static/getter_no_setter1_test.dart b/tests/language/static/getter_no_setter1_test.dart
new file mode 100644
index 0000000..a173b2f
--- /dev/null
+++ b/tests/language/static/getter_no_setter1_test.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2015, 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:expect/expect.dart';
+
+class Class {
+  static int get getter => 0;
+
+  method() {
+    getter++;
+//  ^^^^^^
+// [analyzer] STATIC_WARNING.ASSIGNMENT_TO_FINAL_NO_SETTER
+// [cfe] Setter not found: 'getter'.
+  }
+}
+
+main() {
+  new Class().method();
+}
diff --git a/tests/language/static/getter_no_setter2_runtime_test.dart b/tests/language/static/getter_no_setter2_runtime_test.dart
new file mode 100644
index 0000000..82663cb
--- /dev/null
+++ b/tests/language/static/getter_no_setter2_runtime_test.dart
@@ -0,0 +1,22 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2015, 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:expect/expect.dart';
+
+class Class {
+  static int get getter => 0;
+
+  method() {
+
+  }
+
+  noSuchMethod(i) => 42;
+}
+
+main() {
+  new Class().method();
+}
diff --git a/tests/language/static/getter_no_setter2_test.dart b/tests/language/static/getter_no_setter2_test.dart
new file mode 100644
index 0000000..d10cedb
--- /dev/null
+++ b/tests/language/static/getter_no_setter2_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2015, 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:expect/expect.dart';
+
+class Class {
+  static int get getter => 0;
+
+  method() {
+    getter++;
+//  ^^^^^^
+// [analyzer] STATIC_WARNING.ASSIGNMENT_TO_FINAL_NO_SETTER
+// [cfe] Setter not found: 'getter'.
+  }
+
+  noSuchMethod(i) => 42;
+}
+
+main() {
+  new Class().method();
+}
diff --git a/tests/language/static/implicit_closure_test.dart b/tests/language/static/implicit_closure_test.dart
new file mode 100644
index 0000000..3b16a5d
--- /dev/null
+++ b/tests/language/static/implicit_closure_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2011, 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.
+// Dart test program for testing invocation of implicit closures.
+// VMOptions=
+// VMOptions=--use_slow_path
+
+import "package:expect/expect.dart";
+
+class First {
+  First() {}
+  static int get a {
+    return 10;
+  }
+
+  static var b;
+  static int foo() {
+    return 30;
+  }
+}
+
+class StaticImplicitClosureTest {
+  static void testMain() {
+    Function func = () => 20;
+    Expect.equals(10, First.a);
+    First.b = First.a;
+    Expect.equals(10, First.b);
+    First.b = func;
+    Expect.equals(20, First.b());
+    Function fa = First.foo;
+    Expect.equals(30, fa());
+  }
+}
+
+main() {
+  StaticImplicitClosureTest.testMain();
+}
diff --git a/tests/language/static/initializer_type_error_test.dart b/tests/language/static/initializer_type_error_test.dart
new file mode 100644
index 0000000..493e6ae
--- /dev/null
+++ b/tests/language/static/initializer_type_error_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2012, 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:expect/expect.dart";
+
+int x = "milou";  /*@compile-error=unspecified*/
+
+bool readXThrows() {
+  try {
+    var y = x;
+    return false;
+  } catch (e) {
+    x = 5; // Make sure we do not throw exception a second time.
+    return true;
+  }
+}
+
+main() {
+  int numExceptions = 0;
+  for (int i = 0; i < 8; i++) {
+    if (readXThrows()) {
+      numExceptions++;
+    }
+  }
+  Expect.equals(1, numExceptions);
+}
diff --git a/tests/language/static/inline_test.dart b/tests/language/static/inline_test.dart
new file mode 100644
index 0000000..2a9b788
--- /dev/null
+++ b/tests/language/static/inline_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2012, 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:expect/expect.dart";
+
+// Test inlining of assignments in parameter passing. If [StringScanner.charAt]
+// is inlined, the argument expression [: ++byteOffset :] should not be
+// duplicated.
+
+class StringScanner {
+  static String string = 'az9';
+  int byteOffset = -1;
+
+  int nextByte(foo) {
+    if (foo) return -2;
+    return charAt(++byteOffset);
+  }
+
+  static int charAt(index) =>
+      (string.length > index) ? string.codeUnitAt(index) : -1;
+}
+
+void main() {
+  var scanner = new StringScanner();
+  Expect.equals(0x61, scanner.nextByte(false)); // Expect a.
+  Expect.equals(0x7A, scanner.nextByte(false)); // Expect z.
+  Expect.equals(0x39, scanner.nextByte(false)); // Expect 9.
+  Expect.equals(-1, scanner.nextByte(false));
+}
diff --git a/tests/language/static/parameter_test.dart b/tests/language/static/parameter_test.dart
new file mode 100644
index 0000000..24ccbf7
--- /dev/null
+++ b/tests/language/static/parameter_test.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2013, 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.
+
+foo(x
+    , static int y // //# 01: syntax error
+    , final static y // //# 02: syntax error
+    , {static y} // //# 03: syntax error
+    , [static y] // //# 04: syntax error
+    ) {}
+
+class C {
+  bar(x
+      , static int y // //# 05: syntax error
+      , final static y // //# 06: syntax error
+      , {static y} // //# 07: syntax error
+      , [static y] // //# 08: syntax error
+      ) {}
+
+  static baz(x
+      , static int y // //# 09: syntax error
+      , final static y // //# 10: syntax error
+      , {static y} // //# 11: syntax error
+      , [static y] // //# 12: syntax error
+      ) {}
+}
+
+main() {
+  foo(1
+      , 1 // //# 01: continued
+      , 1 // //# 02: continued
+      , y: 1 // //# 03: continued
+      , 1 // //# 04: continued
+      );
+  new C().bar(1
+      , 1 // //# 05: continued
+      , 1 // //# 06: continued
+      , y: 1 // //# 07: continued
+      , 1 // //# 08: continued
+      );
+  C.baz(1
+      , 1 // //# 09: continued
+      , 1 // //# 10: continued
+      , y: 1 // //# 11: continued
+      , 1 // //# 12: continued
+      );
+}
diff --git a/tests/language/static/postfix_operator_test.dart b/tests/language/static/postfix_operator_test.dart
new file mode 100644
index 0000000..c16817a
--- /dev/null
+++ b/tests/language/static/postfix_operator_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2012, 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:expect/expect.dart";
+
+int a = 0;
+int b = 0;
+
+withTryFinally() {
+  bool inIt = false;
+  // Do a try/finally to potentially force a non-optimizing compiler.
+  try {
+    if (a++ == 0) {
+      inIt = true;
+    }
+  } finally {}
+  Expect.isTrue(inIt);
+}
+
+withoutTryFinally() {
+  bool inIt = false;
+  if (b++ == 0) {
+    inIt = true;
+  }
+  Expect.isTrue(inIt);
+}
+
+main() {
+  withTryFinally();
+  withoutTryFinally();
+}
diff --git a/tests/language/static/setter_conflicts_test.dart b/tests/language/static/setter_conflicts_test.dart
new file mode 100644
index 0000000..c8e4395
--- /dev/null
+++ b/tests/language/static/setter_conflicts_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2018, 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.
+
+class C {
+  static set foo(int x) {}
+
+  int foo(int x) => x; //# 01: compile-time error
+  static int foo(int x) => x; //# 02: compile-time error
+
+  int foo = 3; //# 03: compile-time error
+  final int foo = 4; //# 04: compile-time error
+  static int foo = 5; //# 05: compile-time error
+  static final int foo = 6; //# 06: ok
+
+  int get foo => 7; //# 07: compile-time error
+  static int get foo => 8; //# 08: ok
+
+  set foo(int x) {} //# 09: compile-time error
+  static set foo(int x) {} //# 10: compile-time error
+
+  C.foo(int x) {} //# 11: compile-time error
+  factory C.foo(int x) => null; //# 12: compile-time error
+}
+
+main() {}
diff --git a/tests/language/static/setter_get_runtime_test.dart b/tests/language/static/setter_get_runtime_test.dart
new file mode 100644
index 0000000..b04380c
--- /dev/null
+++ b/tests/language/static/setter_get_runtime_test.dart
@@ -0,0 +1,18 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2015, 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:expect/expect.dart';
+
+class Class {
+  static set o(_) {}
+
+  noSuchMethod(_) => 42;
+}
+
+main() {
+
+}
diff --git a/tests/language/static/setter_get_test.dart b/tests/language/static/setter_get_test.dart
new file mode 100644
index 0000000..44796cc
--- /dev/null
+++ b/tests/language/static/setter_get_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2015, 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:expect/expect.dart';
+
+class Class {
+  static set o(_) {}
+  m() => o;
+  //     ^
+  // [analyzer] STATIC_WARNING.UNDEFINED_IDENTIFIER
+  // [cfe] Getter not found: 'o'.
+  noSuchMethod(_) => 42;
+}
+
+main() {
+  Expect.throws(() => new Class().m());
+}
diff --git a/tests/language/static/top_level_runtime_test.dart b/tests/language/static/top_level_runtime_test.dart
new file mode 100644
index 0000000..0c0b8ce
--- /dev/null
+++ b/tests/language/static/top_level_runtime_test.dart
@@ -0,0 +1,18 @@
+// TODO(multitest): This was automatically migrated from a multitest and may
+// contain strange or dead code.
+
+// Copyright (c) 2011, 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.
+
+
+
+
+
+
+
+
+
+
+
+void main() {}
diff --git a/tests/language/static/top_level_test.dart b/tests/language/static/top_level_test.dart
new file mode 100644
index 0000000..8d788cf
--- /dev/null
+++ b/tests/language/static/top_level_test.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2011, 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.
+
+static method() { }
+// [error line 5, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+static var field;
+// [error line 9, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+static const finalField = 42;
+// [error line 13, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+static const constant = 123;
+// [error line 17, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+
+static int typedMethod() => 87;
+// [error line 22, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+static int typedField = -1;
+// [error line 26, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+static const int typedFinalField = 99;
+// [error line 30, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+static const int typedConstant = 1;
+// [error line 34, column 1, length 6]
+// [analyzer] SYNTACTIC_ERROR.EXTRANEOUS_MODIFIER
+// [cfe] Can't have modifier 'static' here.
+
+void main() {}
diff --git a/tests/language/subtyping_static/README.md b/tests/language/subtyping_static/README.md
new file mode 100644
index 0000000..c634811
--- /dev/null
+++ b/tests/language/subtyping_static/README.md
@@ -0,0 +1,4 @@
+# Feature tests for static analysis involving subtyping
+
+This directory was created in order to hold tests pertaining to the
+static analysis of Dart where it involves subtyping.
diff --git a/tests/language/subtyping_static/future_or_subtype_test.dart b/tests/language/subtyping_static/future_or_subtype_test.dart
new file mode 100644
index 0000000..888ab60
--- /dev/null
+++ b/tests/language/subtyping_static/future_or_subtype_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+class A implements Future<Future<A>> {
+  @override
+  noSuchMethod(Invocation _) {}
+}
+
+void main() {
+  Expect.notSubtype<A, Future<A>>();
+  Expect.subtype<FutureOr<A>, FutureOr<Future<A>>>();
+}
diff --git a/tests/language/vm/regress_flutter_55345_test.dart b/tests/language/vm/regress_flutter_55345_test.dart
new file mode 100644
index 0000000..3fbe990
--- /dev/null
+++ b/tests/language/vm/regress_flutter_55345_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Verifies that references to deduplicated mixins are properly updated.
+// Regression test for https://github.com/flutter/flutter/issues/55345.
+
+class Diagnosticable {}
+
+class SomeClass with Diagnosticable {}
+
+class State<T> with Diagnosticable {}
+
+class StateA extends State {}
+
+class StateB extends State<int> {}
+
+StateA? a = StateA();
+StateB? b = StateB();
+
+List<T> foo<T>(T x) {
+  print(T);
+  return <T>[x];
+}
+
+T Function<S extends T>(T) bar<T>(T x) {
+  print(T);
+
+  return <S extends T>(T y) {
+    print(S);
+    print(y);
+    return y;
+  };
+}
+
+main() {
+  var x2 = a ?? b;
+  var x3 = foo(x2);
+  var x4 = bar(x3);
+  x4(x3);
+}
diff --git a/tests/language_2/factory/return_type_checked_test.dart b/tests/language_2/factory/return_type_checked_test.dart
index bff29b4..c882f4f 100644
--- a/tests/language_2/factory/return_type_checked_test.dart
+++ b/tests/language_2/factory/return_type_checked_test.dart
@@ -7,7 +7,7 @@
 class A {
   factory A() => 42;
   //             ^^
-  // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE_FROM_CLOSURE
+  // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE
   // [cfe] A value of type 'int' can't be assigned to a variable of type 'A'.
 }
 
diff --git a/tests/language_2/override/inheritance_generic_test.dart b/tests/language_2/override/inheritance_generic_test.dart
index dd0481d..6256bc8 100644
--- a/tests/language_2/override/inheritance_generic_test.dart
+++ b/tests/language_2/override/inheritance_generic_test.dart
@@ -3,11 +3,11 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class A<T> {
-  method1(T t) => null; //# 01: ok
-  method2(T t) => null; //# 02: compile-time error
-  method4(T t) => null; //# 04: compile-time error
-  method5(T t) => null; //# 05: ok
-  method7(T t) => null; //# 07: compile-time error
+  void method1(T t) => null; //# 01: ok
+  void method2(T t) => null; //# 02: compile-time error
+  void method4(T t) => null; //# 04: compile-time error
+  void method5(T t) => null; //# 05: ok
+  void method7(T t) => null; //# 07: compile-time error
 }
 
 class B<S> extends A
@@ -16,26 +16,26 @@
 <S> //# 04: continued
 <S> //# 05: continued
 {
-  method1(S s) => null; //# 01: continued
-  method2(int i) => null; //# 02: continued
-  method3(S s) => null; //# 03: ok
-  method4(int i) => null; //# 04: continued
-  method6(S s) => null; //# 06: compile-time error
+  void method1(S s) => null; //# 01: continued
+  void method2(int i) => null; //# 02: continued
+  void method3(S s) => null; //# 03: ok
+  void method4(int i) => null; //# 04: continued
+  void method6(S s) => null; //# 06: compile-time error
 }
 
 abstract class I<U> {
-  method3(U u) => null; //# 03: continued
-  method6(U u) => null; //# 06: continued
-  method7(U u) => null; //# 07: continued
-  method8(U u) => null; //# 08: compile-time error
-  method9(U u) => null; //# 09: compile-time error
-  method10(U u) => null; //# 10: compile-time error
+  void method3(U u) => null; //# 03: continued
+  void method6(U u) => null; //# 06: continued
+  void method7(U u) => null; //# 07: continued
+  void method8(U u) => null; //# 08: compile-time error
+  void method9(U u) => null; //# 09: compile-time error
+  void method10(U u) => null; //# 10: compile-time error
 }
 
 abstract class J<V> {
-  method8(V v) => null; //# 08: continued
-  method9(V v) => null; //# 09: continued
-  method10(V v) => null; //# 10: continued
+  void method8(V v) => null; //# 08: continued
+  void method9(V v) => null; //# 09: continued
+  void method10(V v) => null; //# 10: continued
 }
 
 abstract class Class<W> extends B
@@ -57,16 +57,16 @@
 <num> //# 09: continued
 <num> //# 10: continued
 {
-  method3(num i) => null; //# 03: continued
-  method5(W w) => null; //# 05: continued
-  method6(int i) => null; //# 06: continued
-  method7(double d) => null; //# 07: continued
-  method8(double d) => null; //# 08: continued
+  void method3(num i) => null; //# 03: continued
+  void method5(W w) => null; //# 05: continued
+  void method6(int i) => null; //# 06: continued
+  void method7(double d) => null; //# 07: continued
+  void method8(double d) => null; //# 08: continued
 }
 
 class SubClass extends Class {
-  method9(double d) => null; //# 09: continued
-  method10(String s) => null; //# 10: continued
+  void method9(double d) => null; //# 09: continued
+  void method10(String s) => null; //# 10: continued
 }
 
 main() {
diff --git a/tests/standalone/io/http_client_connect_test.dart b/tests/standalone/io/http_client_connect_test.dart
index 698a9f6..b82812b 100644
--- a/tests/standalone/io/http_client_connect_test.dart
+++ b/tests/standalone/io/http_client_connect_test.dart
@@ -285,19 +285,27 @@
   });
 }
 
-void testMaxConnectionsWithFailure() async {
-  var client = new HttpClient();
+Future<void> testMaxConnectionsWithFailure() async {
+  // When DNS lookup failed, counter for connecting doesn't decrement which
+  // prevents the following connections.
+  final client = HttpClient();
   client.maxConnectionsPerHost = 1;
   try {
-    await client.getUrl(Uri.parse('http://mydomainismissing'));
-  } catch (e) {}
-  try {
-    await client.getUrl(Uri.parse('http://mydomainismissing'));
+    await client.getUrl(Uri.parse('http://domain.invalid'));
   } catch (e) {
-    return;
+    if (e is! SocketException) {
+      Expect.fail("Unexpected exception $e is thrown");
+    }
   }
-
-  Expect.fail('second call should also fail');
+  try {
+    await client.getUrl(Uri.parse('http://domain.invalid'));
+    Expect.fail("Calls exceed client's maxConnectionsPerHost should throw "
+        "exceptions as well");
+  } catch (e) {
+    if (e is! SocketException) {
+      Expect.fail("Unexpected exception $e is thrown");
+    }
+  }
 }
 
 void main() {
diff --git a/tests/standalone/io/http_cookie_date_test.dart b/tests/standalone/io/http_cookie_date_test.dart
index fd5de9a..54996f0 100644
--- a/tests/standalone/io/http_cookie_date_test.dart
+++ b/tests/standalone/io/http_cookie_date_test.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.6
-
 library dart._http;
 
 import "dart:async";
@@ -13,8 +11,12 @@
 import "dart:io";
 import "dart:math";
 import "dart:typed_data";
+
 import "package:expect/expect.dart";
 
+import "../../../sdk/lib/internal/internal.dart"
+    show Since, valueOfNonNullableParamWithDefault, HttpStatus;
+
 part "../../../sdk/lib/_http/crypto.dart";
 part "../../../sdk/lib/_http/embedder_config.dart";
 part "../../../sdk/lib/_http/http_impl.dart";
diff --git a/tests/standalone/io/http_headers_test.dart b/tests/standalone/io/http_headers_test.dart
index 37f1aa4..11e0f89 100644
--- a/tests/standalone/io/http_headers_test.dart
+++ b/tests/standalone/io/http_headers_test.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.6
-
 library dart._http;
 
 import "dart:async";
@@ -14,8 +12,12 @@
 import "dart:isolate";
 import "dart:math";
 import "dart:typed_data";
+
 import "package:expect/expect.dart";
 
+import "../../../sdk/lib/internal/internal.dart"
+    show Since, valueOfNonNullableParamWithDefault, HttpStatus;
+
 part "../../../sdk/lib/_http/crypto.dart";
 part "../../../sdk/lib/_http/embedder_config.dart";
 part "../../../sdk/lib/_http/http_impl.dart";
@@ -28,34 +30,34 @@
   _HttpHeaders headers = new _HttpHeaders("1.1");
   Expect.isNull(headers[HttpHeaders.pragmaHeader]);
   headers.add(HttpHeaders.pragmaHeader, "pragma1");
-  Expect.equals(1, headers[HttpHeaders.pragmaHeader].length);
-  Expect.equals(1, headers["pragma"].length);
-  Expect.equals(1, headers["Pragma"].length);
-  Expect.equals(1, headers["pragma"].length);
+  Expect.equals(1, headers[HttpHeaders.pragmaHeader]!.length);
+  Expect.equals(1, headers["pragma"]!.length);
+  Expect.equals(1, headers["Pragma"]!.length);
+  Expect.equals(1, headers["pragma"]!.length);
   Expect.equals("pragma1", headers.value(HttpHeaders.pragmaHeader));
 
   headers.add(HttpHeaders.pragmaHeader, "pragma2");
-  Expect.equals(2, headers[HttpHeaders.pragmaHeader].length);
+  Expect.equals(2, headers[HttpHeaders.pragmaHeader]!.length);
   Expect.throws(
       () => headers.value(HttpHeaders.pragmaHeader), (e) => e is HttpException);
 
   headers.add(HttpHeaders.pragmaHeader, ["pragma3", "pragma4"]);
   Expect.listEquals(["pragma1", "pragma2", "pragma3", "pragma4"],
-      headers[HttpHeaders.pragmaHeader]);
+      headers[HttpHeaders.pragmaHeader]!);
 
   headers.remove(HttpHeaders.pragmaHeader, "pragma3");
-  Expect.equals(3, headers[HttpHeaders.pragmaHeader].length);
+  Expect.equals(3, headers[HttpHeaders.pragmaHeader]!.length);
   Expect.listEquals(
-      ["pragma1", "pragma2", "pragma4"], headers[HttpHeaders.pragmaHeader]);
+      ["pragma1", "pragma2", "pragma4"], headers[HttpHeaders.pragmaHeader]!);
 
   headers.remove(HttpHeaders.pragmaHeader, "pragma3");
-  Expect.equals(3, headers[HttpHeaders.pragmaHeader].length);
+  Expect.equals(3, headers[HttpHeaders.pragmaHeader]!.length);
 
   headers.set(HttpHeaders.pragmaHeader, "pragma5");
-  Expect.equals(1, headers[HttpHeaders.pragmaHeader].length);
+  Expect.equals(1, headers[HttpHeaders.pragmaHeader]!.length);
 
   headers.set(HttpHeaders.pragmaHeader, ["pragma6", "pragma7"]);
-  Expect.equals(2, headers[HttpHeaders.pragmaHeader].length);
+  Expect.equals(2, headers[HttpHeaders.pragmaHeader]!.length);
 
   headers.removeAll(HttpHeaders.pragmaHeader);
   Expect.isNull(headers[HttpHeaders.pragmaHeader]);
@@ -72,13 +74,13 @@
   headers.date = date1;
   Expect.equals(date1, headers.date);
   Expect.equals(httpDate1, headers.value(HttpHeaders.dateHeader));
-  Expect.equals(1, headers[HttpHeaders.dateHeader].length);
+  Expect.equals(1, headers[HttpHeaders.dateHeader]!.length);
   headers.add(HttpHeaders.dateHeader, httpDate2);
-  Expect.equals(1, headers[HttpHeaders.dateHeader].length);
+  Expect.equals(1, headers[HttpHeaders.dateHeader]!.length);
   Expect.equals(date2, headers.date);
   Expect.equals(httpDate2, headers.value(HttpHeaders.dateHeader));
   headers.set(HttpHeaders.dateHeader, httpDate1);
-  Expect.equals(1, headers[HttpHeaders.dateHeader].length);
+  Expect.equals(1, headers[HttpHeaders.dateHeader]!.length);
   Expect.equals(date1, headers.date);
   Expect.equals(httpDate1, headers.value(HttpHeaders.dateHeader));
 
@@ -98,13 +100,13 @@
   headers.expires = date1;
   Expect.equals(date1, headers.expires);
   Expect.equals(httpDate1, headers.value(HttpHeaders.expiresHeader));
-  Expect.equals(1, headers[HttpHeaders.expiresHeader].length);
+  Expect.equals(1, headers[HttpHeaders.expiresHeader]!.length);
   headers.add(HttpHeaders.expiresHeader, httpDate2);
-  Expect.equals(1, headers[HttpHeaders.expiresHeader].length);
+  Expect.equals(1, headers[HttpHeaders.expiresHeader]!.length);
   Expect.equals(date2, headers.expires);
   Expect.equals(httpDate2, headers.value(HttpHeaders.expiresHeader));
   headers.set(HttpHeaders.expiresHeader, httpDate1);
-  Expect.equals(1, headers[HttpHeaders.expiresHeader].length);
+  Expect.equals(1, headers[HttpHeaders.expiresHeader]!.length);
   Expect.equals(date1, headers.expires);
   Expect.equals(httpDate1, headers.value(HttpHeaders.expiresHeader));
 
@@ -124,13 +126,13 @@
   headers.ifModifiedSince = date1;
   Expect.equals(date1, headers.ifModifiedSince);
   Expect.equals(httpDate1, headers.value(HttpHeaders.ifModifiedSinceHeader));
-  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader].length);
+  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader]!.length);
   headers.add(HttpHeaders.ifModifiedSinceHeader, httpDate2);
-  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader].length);
+  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader]!.length);
   Expect.equals(date2, headers.ifModifiedSince);
   Expect.equals(httpDate2, headers.value(HttpHeaders.ifModifiedSinceHeader));
   headers.set(HttpHeaders.ifModifiedSinceHeader, httpDate1);
-  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader].length);
+  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader]!.length);
   Expect.equals(date1, headers.ifModifiedSince);
   Expect.equals(httpDate1, headers.value(HttpHeaders.ifModifiedSinceHeader));
 
@@ -156,7 +158,7 @@
   Expect.equals(host, headers.host);
   Expect.equals(HttpClient.defaultHttpPort, headers.port);
   headers.add(HttpHeaders.hostHeader, "$host:4567");
-  Expect.equals(1, headers[HttpHeaders.hostHeader].length);
+  Expect.equals(1, headers[HttpHeaders.hostHeader]!.length);
   Expect.equals(host, headers.host);
   Expect.equals(4567, headers.port);
 
@@ -247,11 +249,11 @@
 
 void testHeaderValue() {
   void check(HeaderValue headerValue, String value,
-      [Map<String, String> parameters]) {
+      [Map<String, String?>? parameters]) {
     Expect.equals(value, headerValue.value);
     if (parameters != null) {
       Expect.equals(parameters.length, headerValue.parameters.length);
-      parameters.forEach((String name, String value) {
+      parameters.forEach((String name, String? value) {
         Expect.equals(value, headerValue.parameters[name]);
       });
     } else {
@@ -327,13 +329,13 @@
 
 void testContentType() {
   void check(ContentType contentType, String primaryType, String subType,
-      [Map<String, String> parameters]) {
+      [Map<String, String?>? parameters]) {
     Expect.equals(primaryType, contentType.primaryType);
     Expect.equals(subType, contentType.subType);
     Expect.equals("$primaryType/$subType", contentType.value);
     if (parameters != null) {
       Expect.equals(parameters.length, contentType.parameters.length);
-      parameters.forEach((String name, String value) {
+      parameters.forEach((String name, String? value) {
         Expect.equals(value, contentType.parameters[name]);
       });
     } else {
@@ -423,13 +425,13 @@
 void testContentTypeCache() {
   _HttpHeaders headers = new _HttpHeaders("1.1");
   headers.set(HttpHeaders.contentTypeHeader, "text/html");
-  Expect.equals("text", headers.contentType.primaryType);
-  Expect.equals("html", headers.contentType.subType);
-  Expect.equals("text/html", headers.contentType.value);
+  Expect.equals("text", headers.contentType?.primaryType);
+  Expect.equals("html", headers.contentType?.subType);
+  Expect.equals("text/html", headers.contentType?.value);
   headers.set(HttpHeaders.contentTypeHeader, "text/plain; charset=utf-8");
-  Expect.equals("text", headers.contentType.primaryType);
-  Expect.equals("plain", headers.contentType.subType);
-  Expect.equals("text/plain", headers.contentType.value);
+  Expect.equals("text", headers.contentType?.primaryType);
+  Expect.equals("plain", headers.contentType?.subType);
+  Expect.equals("text/plain", headers.contentType?.value);
   headers.removeAll(HttpHeaders.contentTypeHeader);
   Expect.isNull(headers.contentType);
 }
@@ -626,10 +628,10 @@
 void testLowercaseAdd() {
   _HttpHeaders headers = new _HttpHeaders("1.1");
   headers.add('A', 'a');
-  Expect.equals(headers['a'][0], headers['A'][0]);
-  Expect.equals(headers['A'][0], 'a');
+  Expect.equals(headers['a']![0], headers['A']![0]);
+  Expect.equals(headers['A']![0], 'a');
   headers.add('Foo', 'Foo', preserveHeaderCase: true);
-  Expect.equals(headers['Foo'][0], 'Foo');
+  Expect.equals(headers['Foo']![0], 'Foo');
   // Header field is Foo.
   Expect.isTrue(headers.toString().contains('Foo:'));
 
@@ -650,14 +652,14 @@
   // 'Test' should override 'test' entity
   headers.set('TEST', 'upper cases', preserveHeaderCase: true);
   Expect.isTrue(headers.toString().contains('TEST: upper cases'));
-  Expect.equals(1, headers['test'].length);
-  Expect.equals(headers['test'][0], 'upper cases');
+  Expect.equals(1, headers['test']!.length);
+  Expect.equals(headers['test']![0], 'upper cases');
 
   // Latest header will be stored.
   headers.set('Test', 'mixed cases', preserveHeaderCase: true);
   Expect.isTrue(headers.toString().contains('Test: mixed cases'));
-  Expect.equals(1, headers['test'].length);
-  Expect.equals(headers['test'][0], 'mixed cases');
+  Expect.equals(1, headers['test']!.length);
+  Expect.equals(headers['test']![0], 'mixed cases');
 }
 
 void testForEach() {
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart
index c6400b6..0830f77 100644
--- a/tests/standalone/io/http_parser_test.dart
+++ b/tests/standalone/io/http_parser_test.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.6
-
 library dart._http;
 
 import "dart:async";
@@ -14,8 +12,12 @@
 import "dart:isolate";
 import "dart:math";
 import "dart:typed_data";
+
 import "package:expect/expect.dart";
 
+import "../../../sdk/lib/internal/internal.dart"
+    show Since, valueOfNonNullableParamWithDefault, HttpStatus;
+
 part "../../../sdk/lib/_http/crypto.dart";
 part "../../../sdk/lib/_http/embedder_config.dart";
 part "../../../sdk/lib/_http/http_impl.dart";
@@ -36,26 +38,25 @@
       String request, String expectedMethod, String expectedUri,
       {int expectedTransferLength: 0,
       int expectedBytesReceived: 0,
-      Map<String, String> expectedHeaders: null,
+      Map<String, String>? expectedHeaders: null,
       bool chunked: false,
       bool upgrade: false,
       int unparsedLength: 0,
       bool connectionClose: false,
       String expectedVersion: "1.1"}) {
-    StreamController<Uint8List> controller;
+    late StreamController<Uint8List> controller;
     void reset() {
       _HttpParser httpParser = new _HttpParser.requestParser();
       controller = new StreamController(sync: true);
       var port1 = new ReceivePort();
       var port2 = new ReceivePort();
 
-      String method;
-      Uri uri;
-      _HttpHeaders headers;
-      int contentLength;
-      int bytesReceived;
-      int unparsedBytesReceived;
-      bool upgraded;
+      String? method = null;
+      Uri? uri = null;
+      _HttpHeaders? headers = null;
+      int bytesReceived = 0;
+      int unparsedBytesReceived = 0;
+      bool upgraded = false;
 
       httpParser.listenToStream(controller.stream);
       var subscription = httpParser.listen((incoming) {
@@ -72,7 +73,7 @@
         }
         if (expectedHeaders != null) {
           expectedHeaders.forEach((String name, String value) =>
-              Expect.equals(value, headers[name][0]));
+              Expect.equals(value, headers![name]![0]));
         }
         incoming.listen((List<int> data) {
           Expect.isFalse(upgraded);
@@ -81,7 +82,7 @@
           port2.close();
           Expect.equals(expectedMethod, method);
           Expect.stringEquals(expectedUri, uri.toString());
-          Expect.equals(expectedVersion, headers.protocolVersion);
+          Expect.equals(expectedVersion, headers!.protocolVersion);
           if (upgrade) {
             Expect.equals(0, bytesReceived);
             // port1 is closed by the listener on the detached data.
@@ -104,13 +105,6 @@
           port1.close();
         });
       });
-
-      method = null;
-      uri = null;
-      headers = null;
-      bytesReceived = 0;
-      unparsedBytesReceived = 0;
-      upgraded = false;
     }
 
     void testWrite(List<int> requestData, [int chunkSize = -1]) {
@@ -118,7 +112,7 @@
       reset();
       for (int pos = 0; pos < requestData.length; pos += chunkSize) {
         int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
+        controller.add(requestData.sublist(pos, end) as Uint8List);
       }
       controller.close();
     }
@@ -135,7 +129,7 @@
       String request, String expectedMethod, String expectedUri,
       {int expectedTransferLength: 0,
       int expectedBytesReceived: 0,
-      Map<String, String> expectedHeaders: null,
+      Map<String, String>? expectedHeaders: null,
       bool chunked: false,
       bool upgrade: false,
       int unparsedLength: 0,
@@ -164,8 +158,8 @@
 
   static void _testParseInvalidRequest(String request) {
     _HttpParser httpParser;
-    bool errorCalled;
-    StreamController<Uint8List> controller;
+    bool errorCalled = false;
+    late StreamController<Uint8List> controller;
 
     void reset() {
       httpParser = new _HttpParser.requestParser();
@@ -192,7 +186,7 @@
           pos < requestData.length && !errorCalled;
           pos += chunkSize) {
         int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
+        controller.add(requestData.sublist(pos, end) as Uint8List);
       }
       controller.close();
     }
@@ -209,27 +203,27 @@
       String response, int expectedStatusCode, String expectedReasonPhrase,
       {int expectedTransferLength: 0,
       int expectedBytesReceived: 0,
-      Map<String, String> expectedHeaders: null,
+      Map<String, String>? expectedHeaders: null,
       bool chunked: false,
       bool close: false,
-      String responseToMethod: null,
+      String? responseToMethod: null,
       bool connectionClose: false,
       bool upgrade: false,
       int unparsedLength: 0,
       String expectedVersion: "1.1"}) {
-    StreamController<Uint8List> controller;
+    late StreamController<Uint8List> controller;
     bool upgraded;
 
     void reset() {
       _HttpParser httpParser;
-      bool headersCompleteCalled;
-      bool dataEndCalled;
-      bool dataEndClose;
-      int statusCode;
-      String reasonPhrase;
-      _HttpHeaders headers;
-      int contentLength;
-      int bytesReceived;
+      bool headersCompleteCalled = false;
+      bool dataEndCalled = false;
+      bool? dataEndClose = null;
+      int statusCode = -1;
+      String? reasonPhrase = null;
+      _HttpHeaders? headers = null;
+      int bytesReceived = 0;
+
       httpParser = new _HttpParser.responseParser();
       controller = new StreamController(sync: true);
       var port = new ReceivePort();
@@ -240,7 +234,7 @@
       void whenDone() {
         doneCallCount++;
         if (doneCallCount < 2) return;
-        Expect.equals(expectedVersion, headers.protocolVersion);
+        Expect.equals(expectedVersion, headers!.protocolVersion);
         Expect.equals(expectedStatusCode, statusCode);
         Expect.equals(expectedReasonPhrase, reasonPhrase);
         Expect.isTrue(headersCompleteCalled);
@@ -254,7 +248,7 @@
 
       var subscription = httpParser.listen((incoming) {
         port.close();
-        statusCode = incoming.statusCode;
+        statusCode = incoming.statusCode!;
         reasonPhrase = incoming.reasonPhrase;
         headers = incoming.headers;
         Expect.isFalse(headersCompleteCalled);
@@ -265,7 +259,7 @@
         }
         if (expectedHeaders != null) {
           expectedHeaders.forEach((String name, String value) {
-            Expect.equals(value, headers[name][0]);
+            Expect.equals(value, headers![name]![0]);
           });
         }
         Expect.equals(upgrade, httpParser.upgrade);
@@ -279,14 +273,6 @@
           whenDone();
         });
       }, onDone: whenDone);
-
-      headersCompleteCalled = false;
-      dataEndCalled = false;
-      dataEndClose = null;
-      statusCode = -1;
-      reasonPhrase = null;
-      headers = null;
-      bytesReceived = 0;
     }
 
     void testWrite(List<int> requestData, [int chunkSize = -1]) {
@@ -294,7 +280,7 @@
       reset();
       for (int pos = 0; pos < requestData.length; pos += chunkSize) {
         int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
+        controller.add(requestData.sublist(pos, end) as Uint8List);
       }
       if (close) controller.close();
     }
@@ -337,7 +323,7 @@
           pos < requestData.length && !errorCalled;
           pos += chunkSize) {
         int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
+        controller.add(requestData.sublist(pos, end) as Uint8List);
       }
       controller.close();
     }
diff --git a/tests/standalone/io/web_socket_error_test.dart b/tests/standalone/io/web_socket_error_test.dart
index 659ee7f..a7fdd0e 100644
--- a/tests/standalone/io/web_socket_error_test.dart
+++ b/tests/standalone/io/web_socket_error_test.dart
@@ -9,8 +9,6 @@
 // OtherResources=certificates/server_chain.pem
 // OtherResources=certificates/server_key.pem
 
-// @dart = 2.6
-
 library dart._http;
 
 import "dart:async";
@@ -20,7 +18,6 @@
 
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
-import "package:path/path.dart";
 
 part "../../../sdk/lib/_http/crypto.dart";
 
@@ -44,7 +41,7 @@
 class SecurityConfiguration {
   final bool secure;
 
-  SecurityConfiguration({bool this.secure});
+  SecurityConfiguration({required bool this.secure});
 
   Future<HttpServer> createServer({int backlog: 0}) => secure
       ? HttpServer.bindSecure(HOST_NAME, 0, serverContext, backlog: backlog)
@@ -61,7 +58,7 @@
         response.statusCode = HttpStatus.switchingProtocols;
         response.headers.set(HttpHeaders.connectionHeader, "upgrade");
         response.headers.set(HttpHeaders.upgradeHeader, "websocket");
-        String key = request.headers.value("Sec-WebSocket-Key");
+        String? key = request.headers.value("Sec-WebSocket-Key");
         _SHA1 sha1 = new _SHA1();
         sha1.add("$key$webSocketGUID".codeUnits);
         String accept = _CryptoUtils.bytesToBase64(sha1.close());
diff --git a/tests/standalone/io/web_socket_ping_test.dart b/tests/standalone/io/web_socket_ping_test.dart
index ef6169d..672e48f 100644
--- a/tests/standalone/io/web_socket_ping_test.dart
+++ b/tests/standalone/io/web_socket_ping_test.dart
@@ -7,16 +7,15 @@
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
 
-// @dart = 2.6
-
 library dart._http;
 
-import "package:expect/expect.dart";
 import "dart:async";
 import "dart:io";
 import "dart:math";
 import "dart:typed_data";
 
+import "package:expect/expect.dart";
+
 part "../../../sdk/lib/_http/crypto.dart";
 
 const String webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
@@ -29,7 +28,7 @@
       response.statusCode = HttpStatus.switchingProtocols;
       response.headers.set(HttpHeaders.connectionHeader, "upgrade");
       response.headers.set(HttpHeaders.upgradeHeader, "websocket");
-      String key = request.headers.value("Sec-WebSocket-Key");
+      String? key = request.headers.value("Sec-WebSocket-Key");
       _SHA1 sha1 = new _SHA1();
       sha1.add("$key$webSocketGUID".codeUnits);
       String accept = _CryptoUtils.bytesToBase64(sha1.close());
diff --git a/tests/standalone/io/web_socket_protocol_processor_test.dart b/tests/standalone/io/web_socket_protocol_processor_test.dart
index f7460e2..344a0b9 100644
--- a/tests/standalone/io/web_socket_protocol_processor_test.dart
+++ b/tests/standalone/io/web_socket_protocol_processor_test.dart
@@ -2,12 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.6
-
 library dart._http;
 
-import "package:async_helper/async_helper.dart";
-import "package:expect/expect.dart";
 import "dart:async";
 import "dart:collection";
 import "dart:convert";
@@ -17,6 +13,12 @@
 import "dart:typed_data";
 import "dart:isolate";
 
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
+import "../../../sdk/lib/internal/internal.dart"
+    show Since, valueOfNonNullableParamWithDefault, HttpStatus;
+
 part "../../../sdk/lib/_http/crypto.dart";
 part "../../../sdk/lib/_http/embedder_config.dart";
 part "../../../sdk/lib/_http/http_impl.dart";
@@ -35,16 +37,16 @@
 // collect the message and expect it to be equal to the
 // expectedMessage field when fully received.
 class WebSocketMessageCollector {
-  List<int> expectedMessage;
+  List<int>? expectedMessage;
 
   int messageCount = 0;
 
   var data;
 
-  Function onClosed;
+  void Function()? onClosed;
 
   WebSocketMessageCollector(Stream stream,
-      [List<int> this.expectedMessage = null]) {
+      [List<int>? this.expectedMessage = null]) {
     stream.listen(onMessageData, onDone: onClosed, onError: onError);
   }
 
@@ -52,7 +54,7 @@
     if (buffer is String) {
       buffer = utf8.encode(buffer);
     }
-    Expect.listEquals(expectedMessage, buffer);
+    Expect.listEquals(expectedMessage!, buffer);
     messageCount++;
     data = buffer;
   }
@@ -69,7 +71,7 @@
 const int FRAME_OPCODE_BINARY = 2;
 
 // Function for building a web socket frame.
-List<int> createFrame(bool fin, int opcode, int maskingKey, List<int> data,
+List<int> createFrame(bool fin, int opcode, int? maskingKey, List<int> data,
     int offset, int count) {
   int frameSize = 2;
   if (count > 125) frameSize += 2;
@@ -145,8 +147,7 @@
 
   void runTest(int from, int to, int step) {
     for (int messageLength = from; messageLength < to; messageLength += step) {
-      List<int> message = new List<int>(messageLength);
-      for (int i = 0; i < messageLength; i++) message[i] = i & 0x7F;
+      List<int> message = [for (int i = 0; i < messageLength; i++) i & 0x7F];
       testMessage(FRAME_OPCODE_TEXT, message);
       for (int i = 0; i < messageLength; i++) message[i] = i & 0xFF;
       testMessage(FRAME_OPCODE_BINARY, message);
@@ -206,8 +207,7 @@
 
   void runTest(int from, int to, int step) {
     for (int messageLength = from; messageLength < to; messageLength += step) {
-      List<int> message = new List<int>(messageLength);
-      for (int i = 0; i < messageLength; i++) message[i] = i & 0x7F;
+      List<int> message = [for (int i = 0; i < messageLength; i++) i & 0x7F];
       testMessageFragmentation(FRAME_OPCODE_TEXT, message);
       for (int i = 0; i < messageLength; i++) message[i] = i & 0xFF;
       testMessageFragmentation(FRAME_OPCODE_BINARY, message);
diff --git a/tests/standalone_2/dwarf_stack_trace_test.dart b/tests/standalone_2/dwarf_stack_trace_test.dart
index 8af577b..dac3e58 100644
--- a/tests/standalone_2/dwarf_stack_trace_test.dart
+++ b/tests/standalone_2/dwarf_stack_trace_test.dart
@@ -71,9 +71,14 @@
   final absolutes = absoluteAddresses(rawLines);
   final relocatedAddresses = absolutes.map((a) => a - dsoBase);
   final explicits = explicitVirtualAddresses(rawLines);
-  Expect.deepEquals(relocatedAddresses, virtualAddresses);
-  // Explicits will be empty if not generating ELF snapshots directly.
+
+  // Explicits will be empty if not generating ELF snapshots directly, which
+  // means we can't depend on virtual addresses in the snapshot lining up with
+  // those in the separate debugging information.
   if (explicits.isNotEmpty) {
+    // Direct-to-ELF snapshots should have a build ID.
+    Expect.isNotNull(dwarf.buildId);
+    Expect.deepEquals(relocatedAddresses, virtualAddresses);
     Expect.deepEquals(explicits, virtualAddresses);
   }
 
diff --git a/tests/standalone_2/io/http_client_connect_test.dart b/tests/standalone_2/io/http_client_connect_test.dart
index 4bd9d3a..6de515b 100644
--- a/tests/standalone_2/io/http_client_connect_test.dart
+++ b/tests/standalone_2/io/http_client_connect_test.dart
@@ -283,19 +283,27 @@
   });
 }
 
-void testMaxConnectionsWithFailure() async {
-  var client = new HttpClient();
+Future<void> testMaxConnectionsWithFailure() async {
+  // When DNS lookup failed, counter for connecting doesn't decrement which
+  // prevents the following connections.
+  final client = HttpClient();
   client.maxConnectionsPerHost = 1;
   try {
-    await client.getUrl(Uri.parse('http://mydomainismissing'));
-  } catch (e) {}
-  try {
-    await client.getUrl(Uri.parse('http://mydomainismissing'));
+    await client.getUrl(Uri.parse('http://domain.invalid'));
   } catch (e) {
-    return;
+    if (e is! SocketException) {
+      Expect.fail("Unexpected exception $e is thrown");
+    }
   }
-
-  Expect.fail('second call should also fail');
+  try {
+    await client.getUrl(Uri.parse('http://domain.invalid'));
+    Expect.fail("Calls exceed client's maxConnectionsPerHost should throw "
+        "exceptions as well");
+  } catch (e) {
+    if (e is! SocketException) {
+      Expect.fail("Unexpected exception $e is thrown");
+    }
+  }
 }
 
 void main() {
diff --git a/tests/standalone_2/io/http_cookie_date_test.dart b/tests/standalone_2/io/http_cookie_date_test.dart
deleted file mode 100644
index fd5de9a..0000000
--- a/tests/standalone_2/io/http_cookie_date_test.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// @dart = 2.6
-
-library dart._http;
-
-import "dart:async";
-import "dart:collection";
-import "dart:convert";
-import "dart:developer";
-import "dart:io";
-import "dart:math";
-import "dart:typed_data";
-import "package:expect/expect.dart";
-
-part "../../../sdk/lib/_http/crypto.dart";
-part "../../../sdk/lib/_http/embedder_config.dart";
-part "../../../sdk/lib/_http/http_impl.dart";
-part "../../../sdk/lib/_http/http_date.dart";
-part "../../../sdk/lib/_http/http_parser.dart";
-part "../../../sdk/lib/_http/http_headers.dart";
-part "../../../sdk/lib/_http/http_session.dart";
-
-void testParseHttpCookieDate() {
-  Expect.throws(() => HttpDate._parseCookieDate(""));
-
-  test(int year, int month, int day, int hours, int minutes, int seconds,
-      String formatted) {
-    DateTime date =
-        new DateTime.utc(year, month, day, hours, minutes, seconds, 0);
-    Expect.equals(date, HttpDate._parseCookieDate(formatted));
-  }
-
-  test(2012, DateTime.june, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt");
-  test(2021, DateTime.june, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT");
-  test(2021, DateTime.january, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT");
-  test(2013, DateTime.january, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT");
-  test(1970, DateTime.january, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT");
-}
-
-void main() {
-  testParseHttpCookieDate();
-}
diff --git a/tests/standalone_2/io/http_headers_test.dart b/tests/standalone_2/io/http_headers_test.dart
deleted file mode 100644
index b8989f9..0000000
--- a/tests/standalone_2/io/http_headers_test.dart
+++ /dev/null
@@ -1,726 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// @dart = 2.6
-
-library dart._http;
-
-import "dart:async";
-import "dart:collection";
-import "dart:convert";
-import "dart:developer";
-import "dart:io";
-import "dart:isolate";
-import "dart:math";
-import "dart:typed_data";
-import "package:expect/expect.dart";
-
-part "../../../sdk/lib/_http/crypto.dart";
-part "../../../sdk/lib/_http/embedder_config.dart";
-part "../../../sdk/lib/_http/http_impl.dart";
-part "../../../sdk/lib/_http/http_date.dart";
-part "../../../sdk/lib/_http/http_parser.dart";
-part "../../../sdk/lib/_http/http_headers.dart";
-part "../../../sdk/lib/_http/http_session.dart";
-
-void testMultiValue() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  Expect.isNull(headers[HttpHeaders.pragmaHeader]);
-  headers.add(HttpHeaders.pragmaHeader, "pragma1");
-  Expect.equals(1, headers[HttpHeaders.pragmaHeader].length);
-  Expect.equals(1, headers["pragma"].length);
-  Expect.equals(1, headers["Pragma"].length);
-  Expect.equals(1, headers["pragma"].length);
-  Expect.equals("pragma1", headers.value(HttpHeaders.pragmaHeader));
-
-  headers.add(HttpHeaders.pragmaHeader, "pragma2");
-  Expect.equals(2, headers[HttpHeaders.pragmaHeader].length);
-  Expect.throws(
-      () => headers.value(HttpHeaders.pragmaHeader), (e) => e is HttpException);
-
-  headers.add(HttpHeaders.pragmaHeader, ["pragma3", "pragma4"]);
-  Expect.listEquals(["pragma1", "pragma2", "pragma3", "pragma4"],
-      headers[HttpHeaders.pragmaHeader]);
-
-  headers.remove(HttpHeaders.pragmaHeader, "pragma3");
-  Expect.equals(3, headers[HttpHeaders.pragmaHeader].length);
-  Expect.listEquals(
-      ["pragma1", "pragma2", "pragma4"], headers[HttpHeaders.pragmaHeader]);
-
-  headers.remove(HttpHeaders.pragmaHeader, "pragma3");
-  Expect.equals(3, headers[HttpHeaders.pragmaHeader].length);
-
-  headers.set(HttpHeaders.pragmaHeader, "pragma5");
-  Expect.equals(1, headers[HttpHeaders.pragmaHeader].length);
-
-  headers.set(HttpHeaders.pragmaHeader, ["pragma6", "pragma7"]);
-  Expect.equals(2, headers[HttpHeaders.pragmaHeader].length);
-
-  headers.removeAll(HttpHeaders.pragmaHeader);
-  Expect.isNull(headers[HttpHeaders.pragmaHeader]);
-}
-
-void testDate() {
-  DateTime date1 = new DateTime.utc(1999, DateTime.june, 11, 18, 46, 53, 0);
-  String httpDate1 = "Fri, 11 Jun 1999 18:46:53 GMT";
-  DateTime date2 = new DateTime.utc(2000, DateTime.august, 16, 12, 34, 56, 0);
-  String httpDate2 = "Wed, 16 Aug 2000 12:34:56 GMT";
-
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  Expect.isNull(headers.date);
-  headers.date = date1;
-  Expect.equals(date1, headers.date);
-  Expect.equals(httpDate1, headers.value(HttpHeaders.dateHeader));
-  Expect.equals(1, headers[HttpHeaders.dateHeader].length);
-  headers.add(HttpHeaders.dateHeader, httpDate2);
-  Expect.equals(1, headers[HttpHeaders.dateHeader].length);
-  Expect.equals(date2, headers.date);
-  Expect.equals(httpDate2, headers.value(HttpHeaders.dateHeader));
-  headers.set(HttpHeaders.dateHeader, httpDate1);
-  Expect.equals(1, headers[HttpHeaders.dateHeader].length);
-  Expect.equals(date1, headers.date);
-  Expect.equals(httpDate1, headers.value(HttpHeaders.dateHeader));
-
-  headers.set(HttpHeaders.dateHeader, "xxx");
-  Expect.equals("xxx", headers.value(HttpHeaders.dateHeader));
-  Expect.equals(null, headers.date);
-}
-
-void testExpires() {
-  DateTime date1 = new DateTime.utc(1999, DateTime.june, 11, 18, 46, 53, 0);
-  String httpDate1 = "Fri, 11 Jun 1999 18:46:53 GMT";
-  DateTime date2 = new DateTime.utc(2000, DateTime.august, 16, 12, 34, 56, 0);
-  String httpDate2 = "Wed, 16 Aug 2000 12:34:56 GMT";
-
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  Expect.isNull(headers.expires);
-  headers.expires = date1;
-  Expect.equals(date1, headers.expires);
-  Expect.equals(httpDate1, headers.value(HttpHeaders.expiresHeader));
-  Expect.equals(1, headers[HttpHeaders.expiresHeader].length);
-  headers.add(HttpHeaders.expiresHeader, httpDate2);
-  Expect.equals(1, headers[HttpHeaders.expiresHeader].length);
-  Expect.equals(date2, headers.expires);
-  Expect.equals(httpDate2, headers.value(HttpHeaders.expiresHeader));
-  headers.set(HttpHeaders.expiresHeader, httpDate1);
-  Expect.equals(1, headers[HttpHeaders.expiresHeader].length);
-  Expect.equals(date1, headers.expires);
-  Expect.equals(httpDate1, headers.value(HttpHeaders.expiresHeader));
-
-  headers.set(HttpHeaders.expiresHeader, "xxx");
-  Expect.equals("xxx", headers.value(HttpHeaders.expiresHeader));
-  Expect.equals(null, headers.expires);
-}
-
-void testIfModifiedSince() {
-  DateTime date1 = new DateTime.utc(1999, DateTime.june, 11, 18, 46, 53, 0);
-  String httpDate1 = "Fri, 11 Jun 1999 18:46:53 GMT";
-  DateTime date2 = new DateTime.utc(2000, DateTime.august, 16, 12, 34, 56, 0);
-  String httpDate2 = "Wed, 16 Aug 2000 12:34:56 GMT";
-
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  Expect.isNull(headers.ifModifiedSince);
-  headers.ifModifiedSince = date1;
-  Expect.equals(date1, headers.ifModifiedSince);
-  Expect.equals(httpDate1, headers.value(HttpHeaders.ifModifiedSinceHeader));
-  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader].length);
-  headers.add(HttpHeaders.ifModifiedSinceHeader, httpDate2);
-  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader].length);
-  Expect.equals(date2, headers.ifModifiedSince);
-  Expect.equals(httpDate2, headers.value(HttpHeaders.ifModifiedSinceHeader));
-  headers.set(HttpHeaders.ifModifiedSinceHeader, httpDate1);
-  Expect.equals(1, headers[HttpHeaders.ifModifiedSinceHeader].length);
-  Expect.equals(date1, headers.ifModifiedSince);
-  Expect.equals(httpDate1, headers.value(HttpHeaders.ifModifiedSinceHeader));
-
-  headers.set(HttpHeaders.ifModifiedSinceHeader, "xxx");
-  Expect.equals("xxx", headers.value(HttpHeaders.ifModifiedSinceHeader));
-  Expect.equals(null, headers.ifModifiedSince);
-}
-
-void testHost() {
-  String host = "www.google.com";
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  Expect.isNull(headers.host);
-  Expect.isNull(headers.port);
-  headers.host = host;
-  Expect.equals(host, headers.value(HttpHeaders.hostHeader));
-  headers.port = 1234;
-  Expect.equals("$host:1234", headers.value(HttpHeaders.hostHeader));
-  headers.port = HttpClient.defaultHttpPort;
-  Expect.equals(host, headers.value(HttpHeaders.hostHeader));
-
-  headers = new _HttpHeaders("1.1");
-  headers.add(HttpHeaders.hostHeader, host);
-  Expect.equals(host, headers.host);
-  Expect.equals(HttpClient.defaultHttpPort, headers.port);
-  headers.add(HttpHeaders.hostHeader, "$host:4567");
-  Expect.equals(1, headers[HttpHeaders.hostHeader].length);
-  Expect.equals(host, headers.host);
-  Expect.equals(4567, headers.port);
-
-  headers = new _HttpHeaders("1.1");
-  headers.add(HttpHeaders.hostHeader, "$host:xxx");
-  Expect.equals("$host:xxx", headers.value(HttpHeaders.hostHeader));
-  Expect.equals(host, headers.host);
-  Expect.isNull(headers.port);
-
-  headers = new _HttpHeaders("1.1");
-  headers.add(HttpHeaders.hostHeader, ":1234");
-  Expect.equals(":1234", headers.value(HttpHeaders.hostHeader));
-  Expect.isNull(headers.host);
-  Expect.equals(1234, headers.port);
-}
-
-void testTransferEncoding() {
-  expectChunked(headers) {
-    Expect.listEquals(headers['transfer-encoding'], ['chunked']);
-    Expect.isTrue(headers.chunkedTransferEncoding);
-  }
-
-  expectNonChunked(headers) {
-    Expect.isNull(headers['transfer-encoding']);
-    Expect.isFalse(headers.chunkedTransferEncoding);
-  }
-
-  _HttpHeaders headers;
-
-  headers = new _HttpHeaders("1.1");
-  headers.chunkedTransferEncoding = true;
-  expectChunked(headers);
-  headers.set('transfer-encoding', ['chunked']);
-  expectChunked(headers);
-
-  headers = new _HttpHeaders("1.1");
-  headers.set('transfer-encoding', ['chunked']);
-  expectChunked(headers);
-  headers.chunkedTransferEncoding = true;
-  expectChunked(headers);
-
-  headers = new _HttpHeaders("1.1");
-  headers.chunkedTransferEncoding = true;
-  headers.chunkedTransferEncoding = false;
-  expectNonChunked(headers);
-
-  headers = new _HttpHeaders("1.1");
-  headers.chunkedTransferEncoding = true;
-  headers.remove('transfer-encoding', 'chunked');
-  expectNonChunked(headers);
-
-  headers = new _HttpHeaders("1.1");
-  headers.set('transfer-encoding', ['chunked']);
-  headers.chunkedTransferEncoding = false;
-  expectNonChunked(headers);
-
-  headers = new _HttpHeaders("1.1");
-  headers.set('transfer-encoding', ['chunked']);
-  headers.remove('transfer-encoding', 'chunked');
-  expectNonChunked(headers);
-}
-
-void testEnumeration() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  Expect.isNull(headers[HttpHeaders.pragmaHeader]);
-  headers.add("My-Header-1", "value 1");
-  headers.add("My-Header-2", "value 2");
-  headers.add("My-Header-1", "value 3");
-  bool myHeader1 = false;
-  bool myHeader2 = false;
-  int totalValues = 0;
-  headers.forEach((String name, List<String> values) {
-    totalValues += values.length;
-    if (name == "my-header-1") {
-      myHeader1 = true;
-      Expect.isTrue(values.indexOf("value 1") != -1);
-      Expect.isTrue(values.indexOf("value 3") != -1);
-    }
-    if (name == "my-header-2") {
-      myHeader2 = true;
-      Expect.isTrue(values.indexOf("value 2") != -1);
-    }
-  });
-  Expect.isTrue(myHeader1);
-  Expect.isTrue(myHeader2);
-  Expect.equals(3, totalValues);
-}
-
-void testHeaderValue() {
-  void check(HeaderValue headerValue, String value,
-      [Map<String, String> parameters]) {
-    Expect.equals(value, headerValue.value);
-    if (parameters != null) {
-      Expect.equals(parameters.length, headerValue.parameters.length);
-      parameters.forEach((String name, String value) {
-        Expect.equals(value, headerValue.parameters[name]);
-      });
-    } else {
-      Expect.equals(0, headerValue.parameters.length);
-    }
-  }
-
-  HeaderValue headerValue;
-  headerValue = HeaderValue.parse("");
-  check(headerValue, "", {});
-  headerValue = HeaderValue.parse(";");
-  check(headerValue, "", {});
-  headerValue = HeaderValue.parse(";;");
-  check(headerValue, "", {});
-  headerValue = HeaderValue.parse("v;a");
-  check(headerValue, "v", {"a": null});
-  headerValue = HeaderValue.parse("v;a=");
-  check(headerValue, "v", {"a": ""});
-  Expect.throws(() => HeaderValue.parse("v;a=\""), (e) => e is HttpException);
-  headerValue = HeaderValue.parse("v;a=\"\"");
-  check(headerValue, "v", {"a": ""});
-  Expect.throws(() => HeaderValue.parse("v;a=\"\\"), (e) => e is HttpException);
-  Expect.throws(
-      () => HeaderValue.parse("v;a=\";b=\"c\""), (e) => e is HttpException);
-  Expect.throws(() => HeaderValue.parse("v;a=b c"), (e) => e is HttpException);
-  headerValue = HeaderValue.parse("æ;ø=å");
-  check(headerValue, "æ", {"ø": "å"});
-  headerValue =
-      HeaderValue.parse("xxx; aaa=bbb; ccc=\"\\\";\\a\"; ddd=\"    \"");
-  check(headerValue, "xxx", {"aaa": "bbb", "ccc": '\";a', "ddd": "    "});
-  headerValue =
-      new HeaderValue("xxx", {"aaa": "bbb", "ccc": '\";a', "ddd": "    "});
-  check(headerValue, "xxx", {"aaa": "bbb", "ccc": '\";a', "ddd": "    "});
-
-  headerValue = HeaderValue.parse("attachment; filename=genome.jpeg;"
-      "modification-date=\"Wed, 12 February 1997 16:29:51 -0500\"");
-  var parameters = {
-    "filename": "genome.jpeg",
-    "modification-date": "Wed, 12 February 1997 16:29:51 -0500"
-  };
-  check(headerValue, "attachment", parameters);
-  headerValue = new HeaderValue("attachment", parameters);
-  check(headerValue, "attachment", parameters);
-  headerValue = HeaderValue.parse("  attachment  ;filename=genome.jpeg  ;"
-      "modification-date = \"Wed, 12 February 1997 16:29:51 -0500\"");
-  check(headerValue, "attachment", parameters);
-  headerValue = HeaderValue.parse("xxx; aaa; bbb; ccc");
-  check(headerValue, "xxx", {"aaa": null, "bbb": null, "ccc": null});
-  headerValue = HeaderValue.parse("v; a=A; b=B, V; c=C", valueSeparator: ";");
-  check(headerValue, "v", {});
-  headerValue = HeaderValue.parse("v; a=A; b=B, V; c=C", valueSeparator: ";");
-  check(headerValue, "v", {});
-  headerValue = HeaderValue.parse("v; a=A; b=B, V; c=C", valueSeparator: ",");
-  check(headerValue, "v", {"a": "A", "b": "B"});
-  Expect.throws(() => HeaderValue.parse("v; a=A; b=B, V; c=C"));
-
-  Expect.equals("", HeaderValue().toString());
-  Expect.equals("", HeaderValue("").toString());
-  Expect.equals("v", HeaderValue("v").toString());
-  Expect.equals("v", HeaderValue("v", null).toString());
-  Expect.equals("v", HeaderValue("v", {}).toString());
-  Expect.equals("v; ", HeaderValue("v", {"": null}).toString());
-  Expect.equals("v; a", HeaderValue("v", {"a": null}).toString());
-  Expect.equals("v; a; b", HeaderValue("v", {"a": null, "b": null}).toString());
-  Expect.equals(
-      "v; a; b=c", HeaderValue("v", {"a": null, "b": "c"}).toString());
-  Expect.equals(
-      "v; a=c; b", HeaderValue("v", {"a": "c", "b": null}).toString());
-  Expect.equals("v; a=\"\"", HeaderValue("v", {"a": ""}).toString());
-  Expect.equals("v; a=\"b c\"", HeaderValue("v", {"a": "b c"}).toString());
-  Expect.equals("v; a=\",\"", HeaderValue("v", {"a": ","}).toString());
-  Expect.equals(
-      "v; a=\"\\\\\\\"\"", HeaderValue("v", {"a": "\\\""}).toString());
-  Expect.equals("v; a=\"ø\"", HeaderValue("v", {"a": "ø"}).toString());
-}
-
-void testContentType() {
-  void check(ContentType contentType, String primaryType, String subType,
-      [Map<String, String> parameters]) {
-    Expect.equals(primaryType, contentType.primaryType);
-    Expect.equals(subType, contentType.subType);
-    Expect.equals("$primaryType/$subType", contentType.value);
-    if (parameters != null) {
-      Expect.equals(parameters.length, contentType.parameters.length);
-      parameters.forEach((String name, String value) {
-        Expect.equals(value, contentType.parameters[name]);
-      });
-    } else {
-      Expect.equals(0, contentType.parameters.length);
-    }
-  }
-
-  ContentType contentType;
-  contentType = new ContentType("", "");
-  Expect.equals("", contentType.primaryType);
-  Expect.equals("", contentType.subType);
-  Expect.equals("/", contentType.value);
-  Expect.throwsUnsupportedError(() => contentType.parameters["xxx"] = "yyy");
-
-  contentType = ContentType.parse("text/html");
-  check(contentType, "text", "html");
-  Expect.equals("text/html", contentType.toString());
-  contentType = new ContentType("text", "html", charset: "utf-8");
-  check(contentType, "text", "html", {"charset": "utf-8"});
-  Expect.equals("text/html; charset=utf-8", contentType.toString());
-  Expect.throwsUnsupportedError(() => contentType.parameters["xxx"] = "yyy");
-
-  contentType = new ContentType("text", "html",
-      parameters: {"CHARSET": "UTF-8", "xxx": "YYY"});
-  check(contentType, "text", "html", {"charset": "utf-8", "xxx": "YYY"});
-  String s = contentType.toString();
-  bool expectedToString = (s == "text/html; charset=utf-8; xxx=YYY" ||
-      s == "text/html; xxx=YYY; charset=utf-8");
-  Expect.isTrue(expectedToString);
-  contentType = ContentType.parse("text/html; CHARSET=UTF-8; xxx=YYY");
-  check(contentType, "text", "html", {"charset": "utf-8", "xxx": "YYY"});
-  Expect.throwsUnsupportedError(() => contentType.parameters["xxx"] = "yyy");
-
-  contentType = new ContentType("text", "html",
-      charset: "ISO-8859-1", parameters: {"CHARSET": "UTF-8", "xxx": "yyy"});
-  check(contentType, "text", "html", {"charset": "iso-8859-1", "xxx": "yyy"});
-  s = contentType.toString();
-  expectedToString = (s == "text/html; charset=iso-8859-1; xxx=yyy" ||
-      s == "text/html; xxx=yyy; charset=iso-8859-1");
-  Expect.isTrue(expectedToString);
-
-  contentType = ContentType.parse("text/html");
-  check(contentType, "text", "html");
-  contentType = ContentType.parse(" text/html  ");
-  check(contentType, "text", "html");
-  contentType = ContentType.parse("text/html; charset=utf-8");
-  check(contentType, "text", "html", {"charset": "utf-8"});
-  contentType = ContentType.parse("  text/html  ;  charset  =  utf-8  ");
-  check(contentType, "text", "html", {"charset": "utf-8"});
-  contentType = ContentType.parse("text/html; charset=utf-8; xxx=yyy");
-  check(contentType, "text", "html", {"charset": "utf-8", "xxx": "yyy"});
-  contentType =
-      ContentType.parse("  text/html  ;  charset  =  utf-8  ;  xxx=yyy  ");
-  check(contentType, "text", "html", {"charset": "utf-8", "xxx": "yyy"});
-  contentType = ContentType.parse('text/html; charset=utf-8; xxx="yyy"');
-  check(contentType, "text", "html", {"charset": "utf-8", "xxx": "yyy"});
-  contentType =
-      ContentType.parse("  text/html  ;  charset  =  utf-8  ;  xxx=yyy  ");
-  check(contentType, "text", "html", {"charset": "utf-8", "xxx": "yyy"});
-
-  contentType = ContentType.parse("text/html; charset=;");
-  check(contentType, "text", "html", {"charset": ""});
-  contentType = ContentType.parse("text/html; charset;");
-  check(contentType, "text", "html", {"charset": null});
-
-  // Test builtin content types.
-  check(ContentType.text, "text", "plain", {"charset": "utf-8"});
-  check(ContentType.html, "text", "html", {"charset": "utf-8"});
-  check(ContentType.json, "application", "json", {"charset": "utf-8"});
-  check(ContentType.binary, "application", "octet-stream");
-}
-
-void testKnownContentTypes() {
-  // Well known content types used by the VM service.
-  ContentType.parse('text/html; charset=UTF-8');
-  ContentType.parse('application/dart; charset=UTF-8');
-  ContentType.parse('application/javascript; charset=UTF-8');
-  ContentType.parse('text/css; charset=UTF-8');
-  ContentType.parse('image/gif');
-  ContentType.parse('image/png');
-  ContentType.parse('image/jpeg');
-  ContentType.parse('image/jpeg');
-  ContentType.parse('image/svg+xml');
-  ContentType.parse('text/plain');
-}
-
-void testContentTypeCache() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.set(HttpHeaders.contentTypeHeader, "text/html");
-  Expect.equals("text", headers.contentType.primaryType);
-  Expect.equals("html", headers.contentType.subType);
-  Expect.equals("text/html", headers.contentType.value);
-  headers.set(HttpHeaders.contentTypeHeader, "text/plain; charset=utf-8");
-  Expect.equals("text", headers.contentType.primaryType);
-  Expect.equals("plain", headers.contentType.subType);
-  Expect.equals("text/plain", headers.contentType.value);
-  headers.removeAll(HttpHeaders.contentTypeHeader);
-  Expect.isNull(headers.contentType);
-}
-
-void testCookie() {
-  test(String name, String value) {
-    void checkCookiesEquals(a, b) {
-      Expect.equals(a.name, b.name);
-      Expect.equals(a.value, b.value);
-      Expect.equals(a.expires, b.expires);
-      Expect.equals(a.toString(), b.toString());
-    }
-
-    void checkCookie(cookie, s) {
-      Expect.equals(s, cookie.toString());
-      var c = new _Cookie.fromSetCookieValue(s);
-      checkCookiesEquals(cookie, c);
-    }
-
-    Cookie cookie;
-    cookie = new Cookie(name, value);
-    Expect.equals("$name=$value; HttpOnly", cookie.toString());
-    DateTime date = new DateTime.utc(2014, DateTime.january, 5, 23, 59, 59, 0);
-    cookie.expires = date;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
-        "; HttpOnly");
-    cookie.maxAge = 567;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
-        "; Max-Age=567"
-        "; HttpOnly");
-    cookie.domain = "example.com";
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
-        "; Max-Age=567"
-        "; Domain=example.com"
-        "; HttpOnly");
-    cookie.path = "/xxx";
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
-        "; Max-Age=567"
-        "; Domain=example.com"
-        "; Path=/xxx"
-        "; HttpOnly");
-    cookie.secure = true;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
-        "; Max-Age=567"
-        "; Domain=example.com"
-        "; Path=/xxx"
-        "; Secure"
-        "; HttpOnly");
-    cookie.httpOnly = false;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
-        "; Max-Age=567"
-        "; Domain=example.com"
-        "; Path=/xxx"
-        "; Secure");
-    cookie.expires = null;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Max-Age=567"
-        "; Domain=example.com"
-        "; Path=/xxx"
-        "; Secure");
-    cookie.maxAge = null;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Domain=example.com"
-        "; Path=/xxx"
-        "; Secure");
-    cookie.domain = null;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Path=/xxx"
-        "; Secure");
-    cookie.path = null;
-    checkCookie(
-        cookie,
-        "$name=$value"
-        "; Secure");
-    cookie.secure = false;
-    checkCookie(cookie, "$name=$value");
-  }
-
-  test("name", "value");
-  test("abc", "def");
-  test("ABC", "DEF");
-  test("Abc", "Def");
-  test("SID", "sJdkjKSJD12343kjKj78");
-}
-
-void testInvalidCookie() {
-  Expect.throws(() => new _Cookie.fromSetCookieValue(""));
-  Expect.throws(() => new _Cookie.fromSetCookieValue("="));
-  Expect.throws(() => new _Cookie.fromSetCookieValue("=xxx"));
-  Expect.throws(() => new _Cookie.fromSetCookieValue("xxx"));
-  Expect.throws(
-      () => new _Cookie.fromSetCookieValue("xxx=yyy; expires=12 jan 2013"));
-  Expect.throws(() => new _Cookie.fromSetCookieValue("x x = y y"));
-  Expect.throws(() => new _Cookie("[4", "y"));
-  Expect.throws(() => new _Cookie("4", "y\""));
-
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.set(
-      'Cookie', 'DARTSESSID=d3d6fdd78d51aaaf2924c32e991f4349; undefined');
-  Expect.equals('DARTSESSID', headers._parseCookies().single.name);
-  Expect.equals(
-      'd3d6fdd78d51aaaf2924c32e991f4349', headers._parseCookies().single.value);
-}
-
-void testHeaderLists() {
-  HttpHeaders.generalHeaders.forEach((x) => null);
-  HttpHeaders.entityHeaders.forEach((x) => null);
-  HttpHeaders.responseHeaders.forEach((x) => null);
-  HttpHeaders.requestHeaders.forEach((x) => null);
-}
-
-void testInvalidFieldName() {
-  void test(String field) {
-    _HttpHeaders headers = new _HttpHeaders("1.1");
-    Expect.throwsFormatException(() => headers.add(field, "value"));
-    Expect.throwsFormatException(() => headers.set(field, "value"));
-    Expect.throwsFormatException(() => headers.remove(field, "value"));
-    Expect.throwsFormatException(() => headers.removeAll(field));
-  }
-
-  test('\r');
-  test('\n');
-  test(',');
-  test('test\x00');
-}
-
-void testInvalidFieldValue() {
-  void test(value, {bool remove: true}) {
-    _HttpHeaders headers = new _HttpHeaders("1.1");
-    Expect.throwsFormatException(() => headers.add("field", value));
-    Expect.throwsFormatException(() => headers.set("field", value));
-    if (remove) {
-      Expect.throwsFormatException(() => headers.remove("field", value));
-    }
-  }
-
-  test('\r');
-  test('\n');
-  test('test\x00');
-  // Test we handle other types correctly.
-  test(new StringBuffer('\x00'), remove: false);
-}
-
-void testClear() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.add("a", "b");
-  headers.contentLength = 7;
-  headers.chunkedTransferEncoding = true;
-  headers.clear();
-  Expect.isNull(headers["a"]);
-  Expect.equals(headers.contentLength, -1);
-  Expect.isFalse(headers.chunkedTransferEncoding);
-}
-
-void testFolding() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.add("a", "b");
-  headers.add("a", "c");
-  headers.add("a", "d");
-  // no folding by default
-  Expect.isTrue(headers.toString().contains('b, c, d'));
-  // Header name should be case insensitive
-  headers.noFolding('A');
-  var str = headers.toString();
-  Expect.isTrue(str.contains(': b'));
-  Expect.isTrue(str.contains(': c'));
-  Expect.isTrue(str.contains(': d'));
-}
-
-void testLowercaseAdd() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.add('A', 'a');
-  Expect.equals(headers['a'][0], headers['A'][0]);
-  Expect.equals(headers['A'][0], 'a');
-  headers.add('Foo', 'Foo', preserveHeaderCase: true);
-  Expect.equals(headers['Foo'][0], 'Foo');
-  // Header field is Foo.
-  Expect.isTrue(headers.toString().contains('Foo:'));
-
-  headers.add('FOo', 'FOo', preserveHeaderCase: true);
-  // Header field changes to FOo.
-  Expect.isTrue(headers.toString().contains('FOo:'));
-
-  headers.add('FOO', 'FOO', preserveHeaderCase: false);
-  // Header field
-  Expect.isTrue(!headers.toString().contains('Foo:'));
-  Expect.isTrue(!headers.toString().contains('FOo:'));
-  Expect.isTrue(headers.toString().contains('FOO'));
-}
-
-void testLowercaseSet() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.add('test', 'lower cases');
-  // 'Test' should override 'test' entity
-  headers.set('TEST', 'upper cases', preserveHeaderCase: true);
-  Expect.isTrue(headers.toString().contains('TEST: upper cases'));
-  Expect.equals(1, headers['test'].length);
-  Expect.equals(headers['test'][0], 'upper cases');
-
-  // Latest header will be stored.
-  headers.set('Test', 'mixed cases', preserveHeaderCase: true);
-  Expect.isTrue(headers.toString().contains('Test: mixed cases'));
-  Expect.equals(1, headers['test'].length);
-  Expect.equals(headers['test'][0], 'mixed cases');
-}
-
-void testForEach() {
-  _HttpHeaders headers = new _HttpHeaders("1.1");
-  headers.add('header1', 'value 1');
-  headers.add('header2', 'value 2');
-  headers.add('HEADER1', 'value 3', preserveHeaderCase: true);
-  headers.add('HEADER3', 'value 4', preserveHeaderCase: true);
-
-  BytesBuilder builder = BytesBuilder();
-  headers._build(builder);
-
-  Expect.isTrue(utf8.decode(builder.toBytes()).contains('HEADER1'));
-
-  bool myHeader1 = false;
-  bool myHeader2 = false;
-  bool myHeader3 = false;
-  int totalValues = 0;
-  headers.forEach((String name, List<String> values) {
-    totalValues += values.length;
-    if (name == "HEADER1") {
-      myHeader1 = true;
-      Expect.isTrue(values.indexOf("value 1") != -1);
-      Expect.isTrue(values.indexOf("value 3") != -1);
-    }
-    if (name == "header2") {
-      myHeader2 = true;
-      Expect.isTrue(values.indexOf("value 2") != -1);
-    }
-    if (name == "HEADER3") {
-      myHeader3 = true;
-      Expect.isTrue(values.indexOf("value 4") != -1);
-    }
-  });
-  Expect.isTrue(myHeader1);
-  Expect.isTrue(myHeader2);
-  Expect.isTrue(myHeader3);
-  Expect.equals(4, totalValues);
-}
-
-main() {
-  testMultiValue();
-  testDate();
-  testExpires();
-  testIfModifiedSince();
-  testHost();
-  testTransferEncoding();
-  testEnumeration();
-  testHeaderValue();
-  testContentType();
-  testKnownContentTypes();
-  testContentTypeCache();
-  testCookie();
-  testInvalidCookie();
-  testHeaderLists();
-  testInvalidFieldName();
-  testInvalidFieldValue();
-  testClear();
-  testFolding();
-  testLowercaseAdd();
-  testLowercaseSet();
-  testForEach();
-}
diff --git a/tests/standalone_2/io/http_parser_test.dart b/tests/standalone_2/io/http_parser_test.dart
deleted file mode 100644
index c6400b6..0000000
--- a/tests/standalone_2/io/http_parser_test.dart
+++ /dev/null
@@ -1,849 +0,0 @@
-// Copyright (c) 2013, 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.
-
-// @dart = 2.6
-
-library dart._http;
-
-import "dart:async";
-import "dart:collection";
-import "dart:convert";
-import "dart:developer";
-import "dart:io";
-import "dart:isolate";
-import "dart:math";
-import "dart:typed_data";
-import "package:expect/expect.dart";
-
-part "../../../sdk/lib/_http/crypto.dart";
-part "../../../sdk/lib/_http/embedder_config.dart";
-part "../../../sdk/lib/_http/http_impl.dart";
-part "../../../sdk/lib/_http/http_date.dart";
-part "../../../sdk/lib/_http/http_parser.dart";
-part "../../../sdk/lib/_http/http_headers.dart";
-part "../../../sdk/lib/_http/http_session.dart";
-
-class HttpParserTest {
-  static void runAllTests() {
-    testParseRequest();
-    testParseResponse();
-    testParseInvalidRequest();
-    testParseInvalidResponse();
-  }
-
-  static void _testParseRequest(
-      String request, String expectedMethod, String expectedUri,
-      {int expectedTransferLength: 0,
-      int expectedBytesReceived: 0,
-      Map<String, String> expectedHeaders: null,
-      bool chunked: false,
-      bool upgrade: false,
-      int unparsedLength: 0,
-      bool connectionClose: false,
-      String expectedVersion: "1.1"}) {
-    StreamController<Uint8List> controller;
-    void reset() {
-      _HttpParser httpParser = new _HttpParser.requestParser();
-      controller = new StreamController(sync: true);
-      var port1 = new ReceivePort();
-      var port2 = new ReceivePort();
-
-      String method;
-      Uri uri;
-      _HttpHeaders headers;
-      int contentLength;
-      int bytesReceived;
-      int unparsedBytesReceived;
-      bool upgraded;
-
-      httpParser.listenToStream(controller.stream);
-      var subscription = httpParser.listen((incoming) {
-        method = incoming.method;
-        uri = incoming.uri;
-        headers = incoming.headers;
-        upgraded = incoming.upgraded;
-        Expect.equals(upgrade, upgraded);
-
-        if (!chunked) {
-          Expect.equals(expectedTransferLength, incoming.transferLength);
-        } else {
-          Expect.equals(-1, incoming.transferLength);
-        }
-        if (expectedHeaders != null) {
-          expectedHeaders.forEach((String name, String value) =>
-              Expect.equals(value, headers[name][0]));
-        }
-        incoming.listen((List<int> data) {
-          Expect.isFalse(upgraded);
-          bytesReceived += data.length;
-        }, onDone: () {
-          port2.close();
-          Expect.equals(expectedMethod, method);
-          Expect.stringEquals(expectedUri, uri.toString());
-          Expect.equals(expectedVersion, headers.protocolVersion);
-          if (upgrade) {
-            Expect.equals(0, bytesReceived);
-            // port1 is closed by the listener on the detached data.
-          } else {
-            Expect.equals(expectedBytesReceived, bytesReceived);
-          }
-        });
-
-        if (upgraded) {
-          port1.close();
-          httpParser.detachIncoming().listen((List<int> data) {
-            unparsedBytesReceived += data.length;
-          }, onDone: () {
-            Expect.equals(unparsedLength, unparsedBytesReceived);
-            port2.close();
-          });
-        }
-
-        incoming.dataDone.then((_) {
-          port1.close();
-        });
-      });
-
-      method = null;
-      uri = null;
-      headers = null;
-      bytesReceived = 0;
-      unparsedBytesReceived = 0;
-      upgraded = false;
-    }
-
-    void testWrite(List<int> requestData, [int chunkSize = -1]) {
-      if (chunkSize == -1) chunkSize = requestData.length;
-      reset();
-      for (int pos = 0; pos < requestData.length; pos += chunkSize) {
-        int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
-      }
-      controller.close();
-    }
-
-    // Test parsing the request three times delivering the data in
-    // different chunks.
-    List<int> requestData = new Uint8List.fromList(request.codeUnits);
-    testWrite(requestData);
-    testWrite(requestData, 10);
-    testWrite(requestData, 1);
-  }
-
-  static void _testParseRequestLean(
-      String request, String expectedMethod, String expectedUri,
-      {int expectedTransferLength: 0,
-      int expectedBytesReceived: 0,
-      Map<String, String> expectedHeaders: null,
-      bool chunked: false,
-      bool upgrade: false,
-      int unparsedLength: 0,
-      bool connectionClose: false,
-      String expectedVersion: "1.1"}) {
-    _testParseRequest(request, expectedMethod, expectedUri,
-        expectedTransferLength: expectedTransferLength,
-        expectedBytesReceived: expectedBytesReceived,
-        expectedHeaders: expectedHeaders,
-        chunked: chunked,
-        upgrade: upgrade,
-        unparsedLength: unparsedLength,
-        connectionClose: connectionClose,
-        expectedVersion: expectedVersion);
-    // Same test but with only \n instead of \r\n terminating each header line.
-    _testParseRequest(request.replaceAll('\r', ''), expectedMethod, expectedUri,
-        expectedTransferLength: expectedTransferLength,
-        expectedBytesReceived: expectedBytesReceived,
-        expectedHeaders: expectedHeaders,
-        chunked: chunked,
-        upgrade: upgrade,
-        unparsedLength: unparsedLength,
-        connectionClose: connectionClose,
-        expectedVersion: expectedVersion);
-  }
-
-  static void _testParseInvalidRequest(String request) {
-    _HttpParser httpParser;
-    bool errorCalled;
-    StreamController<Uint8List> controller;
-
-    void reset() {
-      httpParser = new _HttpParser.requestParser();
-      controller = new StreamController(sync: true);
-      var port = new ReceivePort();
-      httpParser.listenToStream(controller.stream);
-      var subscription = httpParser.listen((incoming) {
-        Expect.fail("Expected request");
-      });
-      subscription.onError((e) {
-        errorCalled = true;
-      });
-      subscription.onDone(() {
-        port.close();
-        Expect.isTrue(errorCalled);
-      });
-      errorCalled = false;
-    }
-
-    void testWrite(List<int> requestData, [int chunkSize = -1]) {
-      if (chunkSize == -1) chunkSize = requestData.length;
-      reset();
-      for (int pos = 0;
-          pos < requestData.length && !errorCalled;
-          pos += chunkSize) {
-        int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
-      }
-      controller.close();
-    }
-
-    // Test parsing the request three times delivering the data in
-    // different chunks.
-    List<int> requestData = new Uint8List.fromList(request.codeUnits);
-    testWrite(requestData);
-    testWrite(requestData, 10);
-    testWrite(requestData, 1);
-  }
-
-  static void _testParseResponse(
-      String response, int expectedStatusCode, String expectedReasonPhrase,
-      {int expectedTransferLength: 0,
-      int expectedBytesReceived: 0,
-      Map<String, String> expectedHeaders: null,
-      bool chunked: false,
-      bool close: false,
-      String responseToMethod: null,
-      bool connectionClose: false,
-      bool upgrade: false,
-      int unparsedLength: 0,
-      String expectedVersion: "1.1"}) {
-    StreamController<Uint8List> controller;
-    bool upgraded;
-
-    void reset() {
-      _HttpParser httpParser;
-      bool headersCompleteCalled;
-      bool dataEndCalled;
-      bool dataEndClose;
-      int statusCode;
-      String reasonPhrase;
-      _HttpHeaders headers;
-      int contentLength;
-      int bytesReceived;
-      httpParser = new _HttpParser.responseParser();
-      controller = new StreamController(sync: true);
-      var port = new ReceivePort();
-      httpParser.listenToStream(controller.stream);
-      int doneCallCount = 0;
-      // Called when done parsing entire message and done parsing body.
-      // Only executed when both are done.
-      void whenDone() {
-        doneCallCount++;
-        if (doneCallCount < 2) return;
-        Expect.equals(expectedVersion, headers.protocolVersion);
-        Expect.equals(expectedStatusCode, statusCode);
-        Expect.equals(expectedReasonPhrase, reasonPhrase);
-        Expect.isTrue(headersCompleteCalled);
-        Expect.equals(expectedBytesReceived, bytesReceived);
-        if (!upgrade) {
-          Expect.isTrue(dataEndCalled);
-          if (close) Expect.isTrue(dataEndClose);
-          Expect.equals(dataEndClose, connectionClose);
-        }
-      }
-
-      var subscription = httpParser.listen((incoming) {
-        port.close();
-        statusCode = incoming.statusCode;
-        reasonPhrase = incoming.reasonPhrase;
-        headers = incoming.headers;
-        Expect.isFalse(headersCompleteCalled);
-        if (!chunked && !close) {
-          Expect.equals(expectedTransferLength, incoming.transferLength);
-        } else {
-          Expect.equals(-1, incoming.transferLength);
-        }
-        if (expectedHeaders != null) {
-          expectedHeaders.forEach((String name, String value) {
-            Expect.equals(value, headers[name][0]);
-          });
-        }
-        Expect.equals(upgrade, httpParser.upgrade);
-        headersCompleteCalled = true;
-        incoming.listen((List<int> data) {
-          Expect.isTrue(headersCompleteCalled);
-          bytesReceived += data.length;
-        }, onDone: () {
-          dataEndCalled = true;
-          dataEndClose = close;
-          whenDone();
-        });
-      }, onDone: whenDone);
-
-      headersCompleteCalled = false;
-      dataEndCalled = false;
-      dataEndClose = null;
-      statusCode = -1;
-      reasonPhrase = null;
-      headers = null;
-      bytesReceived = 0;
-    }
-
-    void testWrite(List<int> requestData, [int chunkSize = -1]) {
-      if (chunkSize == -1) chunkSize = requestData.length;
-      reset();
-      for (int pos = 0; pos < requestData.length; pos += chunkSize) {
-        int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
-      }
-      if (close) controller.close();
-    }
-
-    // Test parsing the request three times delivering the data in
-    // different chunks.
-    List<int> responseData = new Uint8List.fromList(response.codeUnits);
-    testWrite(responseData);
-    testWrite(responseData, 10);
-    testWrite(responseData, 1);
-  }
-
-  static void _testParseInvalidResponse(String response, [bool close = false]) {
-    void testWrite(List<int> requestData, [int chunkSize = -1]) {
-      _HttpParser httpParser = new _HttpParser.responseParser();
-      StreamController<Uint8List> controller = new StreamController(sync: true);
-      bool errorCalled = false;
-
-      if (chunkSize == -1) chunkSize = requestData.length;
-
-      var port = new ReceivePort();
-      httpParser.listenToStream(controller.stream);
-      var subscription = httpParser.listen((incoming) {
-        incoming.listen((data) {}, onError: (e) {
-          Expect.isFalse(errorCalled);
-          errorCalled = true;
-        });
-      });
-      subscription.onError((e) {
-        Expect.isFalse(errorCalled);
-        errorCalled = true;
-      });
-      subscription.onDone(() {
-        port.close();
-        Expect.isTrue(errorCalled);
-      });
-
-      errorCalled = false;
-      for (int pos = 0;
-          pos < requestData.length && !errorCalled;
-          pos += chunkSize) {
-        int end = min(requestData.length, pos + chunkSize);
-        controller.add(requestData.sublist(pos, end));
-      }
-      controller.close();
-    }
-
-    // Test parsing the request three times delivering the data in
-    // different chunks.
-    List<int> responseData = new Uint8List.fromList(response.codeUnits);
-    testWrite(responseData);
-    testWrite(responseData, 10);
-    testWrite(responseData, 1);
-  }
-
-  static void testParseRequest() {
-    String request;
-    Map<String, String> headers;
-    var methods = [
-      // RFC 2616 methods.
-      "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT",
-      // WebDAV methods from RFC 4918.
-      "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK",
-      // WebDAV methods from RFC 5323.
-      "SEARCH",
-      // Methods with HTTP prefix.
-      "H", "HT", "HTT", "HTTP", "HX", "HTX", "HTTX", "HTTPX"
-    ];
-    methods = ['GET'];
-    methods.forEach((method) {
-      request = "$method / HTTP/1.1\r\n\r\n";
-      _testParseRequestLean(request, method, "/");
-      request = "$method /index.html HTTP/1.1\r\n\r\n";
-      _testParseRequestLean(request, method, "/index.html");
-    });
-    request = "GET / HTTP/1.0\r\n\r\n";
-    _testParseRequestLean(request, "GET", "/",
-        expectedVersion: "1.0", connectionClose: true);
-
-    request = "GET / HTTP/1.0\r\nConnection: keep-alive\r\n\r\n";
-    _testParseRequestLean(request, "GET", "/", expectedVersion: "1.0");
-
-    request = """
-POST /test HTTP/1.1\r
-AAA: AAA\r
-\r
-""";
-    _testParseRequestLean(request, "POST", "/test");
-
-    request = """
-POST /test HTTP/1.1\r
-\r
-""";
-    _testParseRequestLean(request, "POST", "/test");
-
-    request = """
-POST /test HTTP/1.1\r
-Header-A: AAA\r
-X-Header-B: bbb\r
-\r
-""";
-    headers = new Map();
-    headers["header-a"] = "AAA";
-    headers["x-header-b"] = "bbb";
-    _testParseRequestLean(request, "POST", "/test", expectedHeaders: headers);
-
-    request = """
-POST /test HTTP/1.1\r
-Empty-Header-1:\r
-Empty-Header-2:\r
-        \r
-\r
-""";
-    headers = new Map();
-    headers["empty-header-1"] = "";
-    headers["empty-header-2"] = "";
-    _testParseRequestLean(request, "POST", "/test", expectedHeaders: headers);
-
-    request = """
-POST /test HTTP/1.1\r
-Header-A:   AAA\r
-X-Header-B:\t \t bbb\r
-\r
-""";
-    headers = new Map();
-    headers["header-a"] = "AAA";
-    headers["x-header-b"] = "bbb";
-    _testParseRequestLean(request, "POST", "/test", expectedHeaders: headers);
-
-    request = """
-POST /test HTTP/1.1\r
-Header-A:   AA\r
- A\r
-X-Header-B:           b\r
-  b\r
-\t    b\r
-\r
-""";
-
-    headers = new Map();
-    headers["header-a"] = "AAA";
-    headers["x-header-b"] = "bbb";
-    _testParseRequestLean(request, "POST", "/test", expectedHeaders: headers);
-
-    // _testParseRequestLean encodes the request as ISO-8859-1. Test that the
-    // HTTP parser decodes header values as ISO-8859-1.
-    request = """
-POST /test HTTP/1.1\r
-latin1:   blåbærgrød\r
-\r
-""";
-
-    headers = new Map();
-    headers["latin1"] = "blåbærgrød";
-    _testParseRequestLean(request, "POST", "/test", expectedHeaders: headers);
-
-    request = """
-POST /test HTTP/1.1\r
-Content-Length: 10\r
-\r
-0123456789""";
-    _testParseRequestLean(request, "POST", "/test",
-        expectedTransferLength: 10, expectedBytesReceived: 10);
-
-    // Test connection close header.
-    request = "GET /test HTTP/1.1\r\nConnection: close\r\n\r\n";
-    _testParseRequest(request, "GET", "/test", connectionClose: true);
-
-    // Test chunked encoding.
-    request = """
-POST /test HTTP/1.1\r
-Transfer-Encoding: chunked\r
-\r
-5\r
-01234\r
-5\r
-56789\r
-0\r\n\r\n""";
-    _testParseRequest(request, "POST", "/test",
-        expectedTransferLength: -1, expectedBytesReceived: 10, chunked: true);
-
-    // Test mixing chunked encoding and content length (content length
-    // is ignored).
-    request = """
-POST /test HTTP/1.1\r
-Content-Length: 7\r
-Transfer-Encoding: chunked\r
-\r
-5\r
-01234\r
-5\r
-56789\r
-0\r\n\r\n""";
-    _testParseRequest(request, "POST", "/test",
-        expectedTransferLength: -1, expectedBytesReceived: 10, chunked: true);
-
-    // Test mixing chunked encoding and content length (content length
-    // is ignored).
-    request = """
-POST /test HTTP/1.1\r
-Transfer-Encoding: chunked\r
-Content-Length: 3\r
-\r
-5\r
-01234\r
-5\r
-56789\r
-0\r\n\r\n""";
-    _testParseRequest(request, "POST", "/test",
-        expectedTransferLength: -1, expectedBytesReceived: 10, chunked: true);
-
-    // Test upper and lower case hex digits in chunked encoding.
-    request = """
-POST /test HTTP/1.1\r
-Transfer-Encoding: chunked\r
-\r
-1E\r
-012345678901234567890123456789\r
-1e\r
-012345678901234567890123456789\r
-0\r\n\r\n""";
-    _testParseRequest(request, "POST", "/test",
-        expectedTransferLength: -1, expectedBytesReceived: 60, chunked: true);
-
-    // Test chunk extensions in chunked encoding.
-    request = """
-POST /test HTTP/1.1\r
-Transfer-Encoding: chunked\r
-\r
-1E;xxx\r
-012345678901234567890123456789\r
-1E;yyy=zzz\r
-012345678901234567890123456789\r
-0\r\n\r\n""";
-    _testParseRequest(request, "POST", "/test",
-        expectedTransferLength: -1, expectedBytesReceived: 60, chunked: true);
-
-    // Test HTTP upgrade.
-    request = """
-GET /irc HTTP/1.1\r
-Upgrade: irc/1.2\r
-Connection: Upgrade\r
-\r\n\x01\x01\x01\x01\x01\x02\x02\x02\x02\xFF""";
-    headers = new Map();
-    headers["upgrade"] = "irc/1.2";
-    _testParseRequest(request, "GET", "/irc",
-        expectedHeaders: headers, upgrade: true, unparsedLength: 10);
-
-    // Test HTTP upgrade with protocol data.
-    request = """
-GET /irc HTTP/1.1\r
-Upgrade: irc/1.2\r
-Connection: Upgrade\r
-\r\n""";
-    headers = new Map();
-    headers["upgrade"] = "irc/1.2";
-    _testParseRequest(request, "GET", "/irc",
-        expectedHeaders: headers, upgrade: true);
-
-    // Test websocket upgrade.
-    request = """
-GET /chat HTTP/1.1\r
-Host: server.example.com\r
-Upgrade: websocket\r
-Connection: Upgrade\r
-Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r
-Origin: http://example.com\r
-Sec-WebSocket-Version: 13\r
-\r\n""";
-    headers = new Map();
-    headers["host"] = "server.example.com";
-    headers["upgrade"] = "websocket";
-    headers["sec-websocket-key"] = "dGhlIHNhbXBsZSBub25jZQ==";
-    headers["origin"] = "http://example.com";
-    headers["sec-websocket-version"] = "13";
-    _testParseRequest(request, "GET", "/chat",
-        expectedHeaders: headers, upgrade: true);
-
-    // Test websocket upgrade with protocol data. NOTE: When using the
-    // WebSocket protocol this should never happen as the client
-    // should not send protocol data before processing the request
-    // part of the opening handshake. However the HTTP parser should
-    // still handle this.
-    request = """
-GET /chat HTTP/1.1\r
-Host: server.example.com\r
-Upgrade: websocket\r
-Connection: Upgrade\r
-Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r
-Origin: http://example.com\r
-Sec-WebSocket-Version: 13\r
-\r\n0123456""";
-    headers = new Map();
-    headers["host"] = "server.example.com";
-    headers["upgrade"] = "websocket";
-    headers["sec-websocket-key"] = "dGhlIHNhbXBsZSBub25jZQ==";
-    headers["origin"] = "http://example.com";
-    headers["sec-websocket-version"] = "13";
-    _testParseRequest(request, "GET", "/chat",
-        expectedHeaders: headers, upgrade: true, unparsedLength: 7);
-  }
-
-  static void testParseResponse() {
-    String response;
-    Map<String, String> headers;
-    response = "HTTP/1.1 100 Continue\r\nContent-Length: 0\r\n\r\n";
-    _testParseResponse(response, 100, "Continue");
-
-    response = "HTTP/1.1 100 Continue\r\nContent-Length: 0\r\n\r\n";
-    _testParseResponse(response, 100, "Continue");
-
-    response = "HTTP/1.1 100 Continue\r\nContent-Length: 10\r\n\r\n";
-    _testParseResponse(response, 100, "Continue",
-        expectedTransferLength: 10, expectedBytesReceived: 0);
-
-    response = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n"
-        "Connection: Close\r\n\r\n";
-    _testParseResponse(response, 200, "OK", connectionClose: true);
-
-    response = "HTTP/1.0 200 OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseResponse(response, 200, "OK",
-        expectedVersion: "1.0", connectionClose: true);
-
-    response = "HTTP/1.0 200 OK\r\nContent-Length: 0\r\n"
-        "Connection: Keep-Alive\r\n\r\n";
-    _testParseResponse(response, 200, "OK", expectedVersion: "1.0");
-
-    response = "HTTP/1.1 204 No Content\r\nContent-Length: 11\r\n\r\n";
-    _testParseResponse(response, 204, "No Content",
-        expectedTransferLength: 11, expectedBytesReceived: 0);
-
-    response = "HTTP/1.1 304 Not Modified\r\nContent-Length: 12\r\n\r\n";
-    _testParseResponse(response, 304, "Not Modified",
-        expectedTransferLength: 12, expectedBytesReceived: 0);
-
-    response = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseResponse(response, 200, "OK");
-
-    response = "HTTP/1.1 404 Not found\r\nContent-Length: 0\r\n\r\n";
-    _testParseResponse(response, 404, "Not found");
-
-    response = "HTTP/1.1 500 Server error\r\nContent-Length: 0\r\n\r\n";
-    _testParseResponse(response, 500, "Server error");
-
-    // Test response to HEAD request.
-    response = """
-HTTP/1.1 200 OK\r
-Content-Length: 20\r
-Content-Type: text/html\r
-\r\n""";
-    headers = new Map();
-    headers["content-length"] = "20";
-    headers["content-type"] = "text/html";
-    _testParseResponse(response, 200, "OK",
-        responseToMethod: "HEAD",
-        expectedTransferLength: 20,
-        expectedBytesReceived: 0,
-        expectedHeaders: headers);
-
-    // _testParseRequestLean encodes the request as ISO-8859-1. Test that the
-    // HTTP parser decodes header values as ISO-8859-1.
-    response = """
-HTTP/1.1 200 OK\r
-Content-Length: 0\r
-test-latin1: blåbærgrød\r
-\r\n""";
-    headers = new Map();
-    headers["content-length"] = "0";
-    headers["test-latin1"] = "blåbærgrød";
-    _testParseResponse(response, 200, "OK", expectedHeaders: headers);
-
-    // Test content.
-    response = """
-HTTP/1.1 200 OK\r
-Content-Length: 20\r
-\r
-01234567890123456789""";
-    _testParseResponse(response, 200, "OK",
-        expectedTransferLength: 20, expectedBytesReceived: 20);
-
-    // Test upper and lower case hex digits in chunked encoding.
-    response = """
-HTTP/1.1 200 OK\r
-Transfer-Encoding: chunked\r
-\r
-1A\r
-01234567890123456789012345\r
-1f\r
-0123456789012345678901234567890\r
-0\r\n\r\n""";
-    _testParseResponse(response, 200, "OK",
-        expectedTransferLength: -1, expectedBytesReceived: 57, chunked: true);
-
-    // Test connection close header.
-    response = """
-HTTP/1.1 200 OK\r
-Content-Length: 0\r
-Connection: close\r
-\r\n""";
-    _testParseResponse(response, 200, "OK", connectionClose: true);
-
-    // Test HTTP response without any transfer length indications
-    // where closing the connections indicates end of body.
-    response = """
-HTTP/1.1 200 OK\r
-\r
-01234567890123456789012345
-0123456789012345678901234567890
-""";
-    _testParseResponse(response, 200, "OK",
-        expectedTransferLength: -1,
-        expectedBytesReceived: 59,
-        close: true,
-        connectionClose: true);
-
-    // Test HTTP upgrade.
-    response = """
-HTTP/1.1 101 Switching Protocols\r
-Upgrade: irc/1.2\r
-Connection: Upgrade\r
-\r\n""";
-    headers = new Map();
-    headers["upgrade"] = "irc/1.2";
-    _testParseResponse(response, 101, "Switching Protocols",
-        expectedHeaders: headers, upgrade: true);
-
-    // Test HTTP upgrade with protocol data.
-    response = """
-HTTP/1.1 101 Switching Protocols\r
-Upgrade: irc/1.2\r
-Connection: Upgrade\r
-\r\n\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\xA0\xB0\xC0\xD0\xE0\xF0""";
-    headers = new Map();
-    headers["upgrade"] = "irc/1.2";
-    _testParseResponse(response, 101, "Switching Protocols",
-        expectedHeaders: headers, upgrade: true, unparsedLength: 16);
-
-    // Test websocket upgrade.
-    response = """
-HTTP/1.1 101 Switching Protocols\r
-Upgrade: websocket\r
-Connection: Upgrade\r
-Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r
-\r\n""";
-    headers = new Map();
-    headers["upgrade"] = "websocket";
-    headers["sec-websocket-accept"] = "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=";
-    _testParseResponse(response, 101, "Switching Protocols",
-        expectedHeaders: headers, upgrade: true);
-
-    // Test websocket upgrade with protocol data.
-    response = """
-HTTP/1.1 101 Switching Protocols\r
-Upgrade: websocket\r
-Connection: Upgrade\r
-Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r
-\r\nABCD""";
-    headers = new Map();
-    headers["upgrade"] = "websocket";
-    headers["sec-websocket-accept"] = "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=";
-    _testParseResponse(response, 101, "Switching Protocols",
-        expectedHeaders: headers, upgrade: true, unparsedLength: 4);
-  }
-
-  static void testParseInvalidRequest() {
-    String request;
-    request = "GET /\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "GET / \r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "/ HTTP/1.1\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "GET HTTP/1.1\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = " / HTTP/1.1\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "@ / HTTP/1.1\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "GET / TTP/1.1\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "GET / HTTP/1.\r\n\r\n";
-    _testParseInvalidRequest(request);
-
-    request = "GET / HTTP/1.1\r\nKeep-Alive: False\r\nbadheader\r\n\r\n";
-    _testParseInvalidRequest(request);
-  }
-
-  static void testParseInvalidResponse() {
-    String response;
-
-    response = "HTTP/1.1\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 \r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 200\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 200 \r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 20A OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "200 OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1. 200 OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 200 O\rK\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 000 OK\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 999 Server Error\r\nContent-Length: 0\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 200 OK\r\nContent-Length: x\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = "HTTP/1.1 200 OK\r\nbadheader\r\n\r\n";
-    _testParseInvalidResponse(response);
-
-    response = """
-HTTP/1.1 200 OK\r
-Transfer-Encoding: chunked\r
-\r
-1A\r
-01234567890123456789012345\r
-1g\r
-0123456789012345678901234567890\r
-0\r\n\r\n""";
-    _testParseInvalidResponse(response);
-  }
-}
-
-void main() {
-  HttpParserTest.runAllTests();
-}
diff --git a/tests/standalone_2/io/web_socket_error_test.dart b/tests/standalone_2/io/web_socket_error_test.dart
deleted file mode 100644
index 659ee7f..0000000
--- a/tests/standalone_2/io/web_socket_error_test.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2013, 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.
-//
-// VMOptions=
-// VMOptions=--short_socket_read
-// VMOptions=--short_socket_write
-// VMOptions=--short_socket_read --short_socket_write
-// OtherResources=certificates/server_chain.pem
-// OtherResources=certificates/server_key.pem
-
-// @dart = 2.6
-
-library dart._http;
-
-import "dart:async";
-import "dart:io";
-import "dart:math";
-import "dart:typed_data";
-
-import "package:async_helper/async_helper.dart";
-import "package:expect/expect.dart";
-import "package:path/path.dart";
-
-part "../../../sdk/lib/_http/crypto.dart";
-
-const String webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
-const String CERT_NAME = 'localhost_cert';
-const String HOST_NAME = 'localhost';
-
-String localFile(path) => Platform.script.resolve(path).toFilePath();
-
-SecurityContext serverContext = new SecurityContext()
-  ..useCertificateChain(localFile('certificates/server_chain.pem'))
-  ..usePrivateKey(localFile('certificates/server_key.pem'),
-      password: 'dartdart');
-
-SecurityContext clientContext = new SecurityContext()
-  ..setTrustedCertificates(localFile('certificates/trusted_certs.pem'));
-
-/**
- * A SecurityConfiguration lets us run the tests over HTTP or HTTPS.
- */
-class SecurityConfiguration {
-  final bool secure;
-
-  SecurityConfiguration({bool this.secure});
-
-  Future<HttpServer> createServer({int backlog: 0}) => secure
-      ? HttpServer.bindSecure(HOST_NAME, 0, serverContext, backlog: backlog)
-      : HttpServer.bind(HOST_NAME, 0, backlog: backlog);
-
-  Future<WebSocket> createClient(int port) =>
-      // TODO(whesse): Add a client context argument to WebSocket.connect.
-      WebSocket.connect('${secure ? "wss" : "ws"}://$HOST_NAME:$port/');
-
-  void testForceCloseServerEnd(int totalConnections) {
-    createServer().then((server) {
-      server.listen((request) {
-        var response = request.response;
-        response.statusCode = HttpStatus.switchingProtocols;
-        response.headers.set(HttpHeaders.connectionHeader, "upgrade");
-        response.headers.set(HttpHeaders.upgradeHeader, "websocket");
-        String key = request.headers.value("Sec-WebSocket-Key");
-        _SHA1 sha1 = new _SHA1();
-        sha1.add("$key$webSocketGUID".codeUnits);
-        String accept = _CryptoUtils.bytesToBase64(sha1.close());
-        response.headers.add("Sec-WebSocket-Accept", accept);
-        response.headers.contentLength = 0;
-        response.detachSocket().then((socket) {
-          socket.destroy();
-        });
-      });
-
-      int closeCount = 0;
-      for (int i = 0; i < totalConnections; i++) {
-        createClient(server.port).then((webSocket) {
-          webSocket.add("Hello, world!");
-          webSocket.listen((message) {
-            Expect.fail("unexpected message");
-          }, onDone: () {
-            closeCount++;
-            if (closeCount == totalConnections) {
-              server.close();
-            }
-          });
-        });
-      }
-    });
-  }
-
-  void runTests() {
-    testForceCloseServerEnd(10);
-  }
-}
-
-main() {
-  asyncStart();
-  new SecurityConfiguration(secure: false).runTests();
-  // TODO(whesse): WebSocket.connect needs an optional context: parameter
-  // new SecurityConfiguration(secure: true).runTests();
-  asyncEnd();
-}
diff --git a/tests/standalone_2/io/web_socket_ping_test.dart b/tests/standalone_2/io/web_socket_ping_test.dart
deleted file mode 100644
index ef6169d..0000000
--- a/tests/standalone_2/io/web_socket_ping_test.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2013, 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.
-//
-// VMOptions=
-// VMOptions=--short_socket_read
-// VMOptions=--short_socket_write
-// VMOptions=--short_socket_read --short_socket_write
-
-// @dart = 2.6
-
-library dart._http;
-
-import "package:expect/expect.dart";
-import "dart:async";
-import "dart:io";
-import "dart:math";
-import "dart:typed_data";
-
-part "../../../sdk/lib/_http/crypto.dart";
-
-const String webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
-
-void testPing(int totalConnections) {
-  HttpServer.bind('localhost', 0).then((server) {
-    int closed = 0;
-    server.listen((request) {
-      var response = request.response;
-      response.statusCode = HttpStatus.switchingProtocols;
-      response.headers.set(HttpHeaders.connectionHeader, "upgrade");
-      response.headers.set(HttpHeaders.upgradeHeader, "websocket");
-      String key = request.headers.value("Sec-WebSocket-Key");
-      _SHA1 sha1 = new _SHA1();
-      sha1.add("$key$webSocketGUID".codeUnits);
-      String accept = _CryptoUtils.bytesToBase64(sha1.close());
-      response.headers.add("Sec-WebSocket-Accept", accept);
-      response.headers.contentLength = 0;
-      response.detachSocket().then((socket) {
-        socket.destroy();
-      });
-    });
-
-    int closeCount = 0;
-    for (int i = 0; i < totalConnections; i++) {
-      WebSocket.connect('ws://localhost:${server.port}').then((webSocket) {
-        webSocket.pingInterval = const Duration(milliseconds: 100);
-        webSocket.listen((message) {
-          Expect.fail("unexpected message");
-        }, onDone: () {
-          closeCount++;
-          if (closeCount == totalConnections) {
-            server.close();
-          }
-        });
-      });
-    }
-  });
-}
-
-void main() {
-  testPing(10);
-}
diff --git a/tests/standalone_2/io/web_socket_protocol_processor_test.dart b/tests/standalone_2/io/web_socket_protocol_processor_test.dart
deleted file mode 100644
index f7460e2..0000000
--- a/tests/standalone_2/io/web_socket_protocol_processor_test.dart
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// @dart = 2.6
-
-library dart._http;
-
-import "package:async_helper/async_helper.dart";
-import "package:expect/expect.dart";
-import "dart:async";
-import "dart:collection";
-import "dart:convert";
-import "dart:developer";
-import "dart:io";
-import "dart:math";
-import "dart:typed_data";
-import "dart:isolate";
-
-part "../../../sdk/lib/_http/crypto.dart";
-part "../../../sdk/lib/_http/embedder_config.dart";
-part "../../../sdk/lib/_http/http_impl.dart";
-part "../../../sdk/lib/_http/http_date.dart";
-part "../../../sdk/lib/_http/http_parser.dart";
-part "../../../sdk/lib/_http/http_headers.dart";
-part "../../../sdk/lib/_http/http_session.dart";
-part "../../../sdk/lib/_http/websocket.dart";
-part "../../../sdk/lib/_http/websocket_impl.dart";
-
-class WebSocketFrame {
-  WebSocketFrame(int opcode, List<int> data);
-}
-
-// Class that when hooked up to the web socket protocol transformer will
-// collect the message and expect it to be equal to the
-// expectedMessage field when fully received.
-class WebSocketMessageCollector {
-  List<int> expectedMessage;
-
-  int messageCount = 0;
-
-  var data;
-
-  Function onClosed;
-
-  WebSocketMessageCollector(Stream stream,
-      [List<int> this.expectedMessage = null]) {
-    stream.listen(onMessageData, onDone: onClosed, onError: onError);
-  }
-
-  void onMessageData(buffer) {
-    if (buffer is String) {
-      buffer = utf8.encode(buffer);
-    }
-    Expect.listEquals(expectedMessage, buffer);
-    messageCount++;
-    data = buffer;
-  }
-
-  void onError(e, trace) {
-    String msg = "Unexpected error $e";
-    if (trace != null) msg += "\nStackTrace: $trace";
-    Expect.fail(msg);
-  }
-}
-
-// Web socket constants.
-const int FRAME_OPCODE_TEXT = 1;
-const int FRAME_OPCODE_BINARY = 2;
-
-// Function for building a web socket frame.
-List<int> createFrame(bool fin, int opcode, int maskingKey, List<int> data,
-    int offset, int count) {
-  int frameSize = 2;
-  if (count > 125) frameSize += 2;
-  if (count > 65535) frameSize += 6;
-  frameSize += count;
-  // No masking.
-  assert(maskingKey == null);
-  List<int> frame = new Uint8List(frameSize);
-  int frameIndex = 0;
-  frame[frameIndex++] = (fin ? 0x80 : 0x00) | opcode;
-  if (count < 126) {
-    frame[frameIndex++] = count;
-  } else if (count < 65536) {
-    frame[frameIndex++] = 126;
-    frame[frameIndex++] = count >> 8;
-    frame[frameIndex++] = count & 0xFF;
-  } else {
-    frame[frameIndex++] = 127;
-    for (int i = 0; i < 8; i++) {
-      frame[frameIndex++] = count >> ((7 - i) * 8) & 0xFF;
-    }
-  }
-  frame.setRange(frameIndex, frameIndex + count, data, offset);
-  return frame;
-}
-
-// Test processing messages which are sent in a single frame.
-void testFullMessages() {
-  void testMessage(int opcode, List<int> message) {
-    int messageCount = 0;
-    // Use the same web socket protocol transformer for all frames.
-    var transformer = new _WebSocketProtocolTransformer();
-    var controller = new StreamController<List<int>>(sync: true);
-    WebSocketMessageCollector mc = new WebSocketMessageCollector(
-        controller.stream.transform(transformer), message);
-
-    List<int> frame =
-        createFrame(true, opcode, null, message, 0, message.length);
-
-    // Update the transformer with one big chunk.
-    messageCount++;
-    controller.add(frame);
-    mc.onClosed = () {
-      Expect.isNotNull(mc.data);
-      Expect.equals(0, transformer._state);
-
-      mc.data = null;
-
-      // Only run this part on small messages.
-      if (message.length < 1000) {
-        // Update the transformer one byte at the time.
-        messageCount++;
-        for (int i = 0; i < frame.length; i++) {
-          controller.add(<int>[frame[i]]);
-        }
-        Expect.equals(0, transformer._state);
-        Expect.isNotNull(mc.data);
-        mc.data = null;
-
-        // Update the transformer two bytes at the time.
-        messageCount++;
-        for (int i = 0; i < frame.length; i += 2) {
-          controller.add(frame.sublist(i, min(i + 2, frame.length)));
-        }
-        Expect.equals(0, transformer._state);
-        Expect.isNotNull(mc.data);
-      }
-      Expect.equals(messageCount, mc.messageCount);
-      print("Messages test, messages $messageCount");
-    };
-    controller.close();
-  }
-
-  void runTest(int from, int to, int step) {
-    for (int messageLength = from; messageLength < to; messageLength += step) {
-      List<int> message = new List<int>(messageLength);
-      for (int i = 0; i < messageLength; i++) message[i] = i & 0x7F;
-      testMessage(FRAME_OPCODE_TEXT, message);
-      for (int i = 0; i < messageLength; i++) message[i] = i & 0xFF;
-      testMessage(FRAME_OPCODE_BINARY, message);
-    }
-  }
-
-  // Test different message sizes.
-  runTest(0, 10, 1);
-  runTest(120, 130, 1);
-  runTest(0, 1000, 100);
-  runTest(65534, 65537, 1);
-}
-
-// Test processing of frames which are split into fragments.
-void testFragmentedMessages() {
-  // Use the same web socket protocol transformer for all frames.
-  var transformer = new _WebSocketProtocolTransformer();
-  var controller = new StreamController<List<int>>(sync: true);
-  WebSocketMessageCollector mc =
-      new WebSocketMessageCollector(controller.stream.transform(transformer));
-
-  int messageCount = 0;
-  int frameCount = 0;
-
-  void testFragmentMessage(int opcode, List<int> message, int fragmentSize) {
-    messageCount++;
-    int messageIndex = 0;
-    int remaining = message.length;
-    bool firstFrame = true;
-    bool lastFrame = false;
-    while (!lastFrame) {
-      int payloadSize = min(fragmentSize, remaining);
-      lastFrame = payloadSize == remaining;
-      List<int> frame = createFrame(lastFrame, firstFrame ? opcode : 0x00, null,
-          message, messageIndex, payloadSize);
-      frameCount++;
-      messageIndex += payloadSize;
-      controller.add(frame);
-      remaining -= payloadSize;
-      firstFrame = false;
-    }
-  }
-
-  void testMessageFragmentation(int opcode, List<int> message) {
-    mc.expectedMessage = message;
-
-    // Test with fragmenting the message in different fragment sizes.
-    if (message.length <= 10) {
-      for (int i = 1; i < 10; i++) {
-        testFragmentMessage(opcode, message, i);
-      }
-    } else {
-      testFragmentMessage(opcode, message, 10);
-      testFragmentMessage(opcode, message, 100);
-    }
-  }
-
-  void runTest(int from, int to, int step) {
-    for (int messageLength = from; messageLength < to; messageLength += step) {
-      List<int> message = new List<int>(messageLength);
-      for (int i = 0; i < messageLength; i++) message[i] = i & 0x7F;
-      testMessageFragmentation(FRAME_OPCODE_TEXT, message);
-      for (int i = 0; i < messageLength; i++) message[i] = i & 0xFF;
-      testMessageFragmentation(FRAME_OPCODE_BINARY, message);
-    }
-  }
-
-  // Test different message sizes.
-  runTest(0, 10, 1);
-  runTest(120, 130, 1);
-  runTest(0, 1000, 100);
-  runTest(65534, 65537, 1);
-  print("Fragment messages test, messages $messageCount, frames $frameCount");
-  Expect.equals(messageCount, mc.messageCount);
-}
-
-void testUnmaskedMessage() {
-  var transformer = new _WebSocketProtocolTransformer(true);
-  var controller = new StreamController<List<int>>(sync: true);
-  asyncStart();
-  controller.stream.transform(transformer).listen((_) {}, onError: (e) {
-    asyncEnd();
-  });
-  var message = new Uint8List(10);
-  List<int> frame =
-      createFrame(true, FRAME_OPCODE_BINARY, null, message, 0, message.length);
-  controller.add(frame);
-}
-
-void main() {
-  testFullMessages();
-  testFragmentedMessages();
-  testUnmaskedMessage();
-}
diff --git a/tools/VERSION b/tools/VERSION
index 0bc4f82..c51350b02 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -33,7 +33,7 @@
 MAJOR 2
 MINOR 9
 PATCH 0
-PRERELEASE 16
+PRERELEASE 17
 PRERELEASE_PATCH 0
 ABI_VERSION 37
 OLDEST_SUPPORTED_ABI_VERSION 37
diff --git a/tools/bots/bot.py b/tools/bots/bot.py
index 4f7b4c5..8c23405 100644
--- a/tools/bots/bot.py
+++ b/tools/bots/bot.py
@@ -45,9 +45,7 @@
     on several different runtimes.
   - builder_tag: A tag indicating a special builder setup.
   - cps_ir: Run the compiler with the cps based backend
-  - use_nnbd: Whether to use the NNBD fork of the SDK.
   """
-    # TODO: Remove use_nnbd when the fork is merged back in.
 
     def __init__(self,
                  compiler,
@@ -66,8 +64,7 @@
                  dart2js_full=False,
                  builder_tag=None,
                  batch=False,
-                 cps_ir=False,
-                 use_nnbd=False):
+                 cps_ir=False):
         self.compiler = compiler
         self.runtime = runtime
         self.mode = mode
@@ -84,7 +81,6 @@
         self.builder_tag = builder_tag
         self.batch = batch
         self.cps_ir = cps_ir
-        self.use_nnbd = use_nnbd
         if (arch == None):
             self.arch = 'ia32'
         else:
@@ -272,20 +268,12 @@
     """
   Runs the test package's runner on the package at 'path'.
   """
-    # TODO(38701): Once bots are set up to run NNBD configurations, update
-    # the various name parsing functions to detect that and pass "use_nnbd" to
-    # the BuildInfo() constructor.
 
     sdk_bin = os.path.join(
         bot_utils.DART_DIR,
-        utils.GetBuildSdkBin(BUILD_OS, build_info.mode, build_info.arch,
-                             build_info.use_nnbd))
+        utils.GetBuildSdkBin(BUILD_OS, build_info.mode, build_info.arch))
 
-    build_root = utils.GetBuildRoot(
-        BUILD_OS,
-        build_info.mode,
-        build_info.arch,
-        use_nnbd=build_info.use_nnbd)
+    build_root = utils.GetBuildRoot(BUILD_OS, build_info.mode, build_info.arch)
 
     dart_name = 'dart.exe' if build_info.system == 'windows' else 'dart'
     dart_bin = os.path.join(sdk_bin, dart_name)
diff --git a/tools/bots/flutter/compile_flutter.sh b/tools/bots/flutter/compile_flutter.sh
index cf54870..192e3a1 100755
--- a/tools/bots/flutter/compile_flutter.sh
+++ b/tools/bots/flutter/compile_flutter.sh
@@ -81,7 +81,7 @@
     --nnbd-agnostic \
     --single-root-scheme=org-dartlang-sdk \
     --single-root-base=$checkout/ \
-    org-dartlang-sdk:///sdk_nnbd/lib/libraries.json \
+    org-dartlang-sdk:///sdk/lib/libraries.json \
     vm_outline_strong.dill \
     vm_platform_strong.dill \
     vm_outline_strong.dill
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index bdc666c..315b0c2 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -17,7 +17,7 @@
       "out/ReleaseX64/dart-sdk/",
       "xcodebuild/ReleaseX64/dart-sdk/"
     ],
-    "dart2js": [
+    "web_platform": [
       ".packages",
       ".dart_tool/package_config.json",
       "out/ReleaseIA32/dart-sdk/",
@@ -27,7 +27,7 @@
       "runtime/tests/",
       "samples-dev/",
       "samples/",
-      "sdk_nnbd/",
+      "sdk/",
       "tests/.dart_tool/package_config.json",
       "tests/angular/",
       "tests/co19_2/co19_2-analyzer.status",
@@ -42,9 +42,11 @@
       "tests/co19/co19-dartdevc.status",
       "tests/co19/co19-kernel.status",
       "tests/co19/co19-runtime.status",
+      "tests/compiler/",
       "tests/corelib_2/",
       "tests/dart2js_2/",
       "tests/kernel/",
+      "tests/language/",
       "tests/language_2/",
       "tests/lib_2/",
       "tests/light_unittest.dart",
@@ -62,7 +64,7 @@
       "xcodebuild/ReleaseX64/dart-sdk/",
       "xcodebuild/ReleaseX64/gen/utils/dartdevc/"
     ],
-    "dart2js_nnbd": [
+    "web_platform_nnbd": [
       ".packages",
       ".dart_tool/package_config.json",
       "out/ReleaseIA32/dart-sdk/",
@@ -72,7 +74,7 @@
       "runtime/tests/",
       "samples-dev/",
       "samples/",
-      "sdk_nnbd/",
+      "sdk/",
       "tests/.dart_tool/package_config.json",
       "tests/angular/",
       "tests/co19/co19-analyzer.status",
@@ -81,10 +83,12 @@
       "tests/co19/co19-dartdevc.status",
       "tests/co19/co19-kernel.status",
       "tests/co19/co19-runtime.status",
+      "tests/compiler/",
       "tests/corelib/",
       "tests/dart2js/",
       "tests/kernel/",
       "tests/language/",
+      "tests/language_2/",
       "tests/lib/",
       "tests/light_unittest.dart",
       "tests/search/",
@@ -99,7 +103,7 @@
       "xcodebuild/ReleaseX64/dart-sdk/",
       "xcodebuild/ReleaseX64/gen/utils/dartdevc/"
     ],
-    "dart2js_hostasserts": [
+    "web_platform_hostasserts": [
       ".packages",
       ".dart_tool/package_config.json",
       "out/ReleaseIA32/dart",
@@ -127,9 +131,11 @@
       "tests/co19_2/co19_2-dartdevc.status",
       "tests/co19_2/co19_2-kernel.status",
       "tests/co19_2/co19_2-runtime.status",
+      "tests/compiler/",
       "tests/corelib_2/",
       "tests/dart2js_2/",
       "tests/kernel/",
+      "tests/language/",
       "tests/language_2/",
       "tests/lib_2/",
       "tests/light_unittest.dart",
@@ -149,51 +155,7 @@
       "xcodebuild/ReleaseX64/dart2js_platform.dill",
       "xcodebuild/ReleaseX64/dart2js_platform_strong.dill"
     ],
-    "dart2js_hostasserts_prennbd": [
-      ".packages",
-      ".dart_tool/package_config.json",
-      "out/ReleaseX64Legacy/dart",
-      "out/ReleaseX64Legacy/dart2js_platform.dill",
-      "out/ReleaseX64Legacy/dart2js_platform_strong.dill",
-      "pkg/",
-      "runtime/tests/",
-      "samples-dev/",
-      "samples/",
-      "sdk/",
-      "tests/.dart_tool/package_config.json",
-      "tests/angular/",
-      "tests/co19/co19-analyzer.status",
-      "tests/co19/co19-co19.status",
-      "tests/co19/co19-dart2js.status",
-      "tests/co19/co19-dartdevc.status",
-      "tests/co19/co19-kernel.status",
-      "tests/co19/co19-runtime.status",
-      "tests/co19_2/co19_2-analyzer.status",
-      "tests/co19_2/co19_2-co19.status",
-      "tests/co19_2/co19_2-dart2js.status",
-      "tests/co19_2/co19_2-dartdevc.status",
-      "tests/co19_2/co19_2-kernel.status",
-      "tests/co19_2/co19_2-runtime.status",
-      "tests/corelib_2/",
-      "tests/dart2js_2/",
-      "tests/kernel/",
-      "tests/language_2/",
-      "tests/lib_2/",
-      "tests/light_unittest.dart",
-      "tests/search/",
-      "tests/standalone_2/",
-      "tests/ffi/",
-      "tests/ffi_2/",
-      "third_party/d8/",
-      "third_party/pkg/",
-      "third_party/pkg_tested/",
-      "third_party/requirejs/",
-      "tools/",
-      "xcodebuild/ReleaseX64Legacy/dart",
-      "xcodebuild/ReleaseX64Legacy/dart2js_platform.dill",
-      "xcodebuild/ReleaseX64Legacy/dart2js_platform_strong.dill"
-    ],
-    "dart2js_hostasserts_nnbd": [
+    "web_platform_hostasserts_nnbd": [
       ".packages",
       ".dart_tool/package_config.json",
       "out/ReleaseX64/dart",
@@ -205,7 +167,6 @@
       "samples-dev/",
       "samples/",
       "sdk/",
-      "sdk_nnbd/",
       "tests/.dart_tool/package_config.json",
       "tests/angular/",
       "tests/co19/co19-analyzer.status",
@@ -214,10 +175,12 @@
       "tests/co19/co19-dartdevc.status",
       "tests/co19/co19-kernel.status",
       "tests/co19/co19-runtime.status",
+      "tests/compiler/",
       "tests/corelib/",
       "tests/dart2js/",
       "tests/kernel/",
       "tests/language/",
+      "tests/language_2/",
       "tests/lib/",
       "tests/light_unittest.dart",
       "tests/search/",
@@ -242,7 +205,6 @@
       "samples-dev/",
       "samples/",
       "sdk/",
-      "sdk_nnbd/",
       "tests/.dart_tool/package_config.json",
       "tests/angular/",
       "tests/co19/co19-analyzer.status",
@@ -402,7 +364,6 @@
       "pkg/vm/",
       "runtime/",
       "sdk/",
-      "sdk_nnbd/",
       ".dart_tool/package_config.json",
       ".packages",
       ".vpython"
@@ -608,17 +569,6 @@
         "host-checked": true
       }
     },
-    "dart2js-hostasserts-prennbd-(linux|win)-x64-(d8|chrome)": {
-      "options": {
-        "builder-tag": "dart2js-prennbd",
-        "dart2js-options": [
-          "--libraries-spec=sdk/lib/libraries.json",
-          "--platform-binaries=out/ReleaseX64Legacy/"
-        ],
-        "timeout": 240,
-        "host-checked": true
-      }
-    },
     "dart2js-hostasserts-weak-(linux|win)-x64-(d8|chrome)": {
       "options": {
         "builder-tag": "dart2js-weak",
@@ -627,7 +577,7 @@
         ],
         "dart2js-options": [
           "--no-sound-null-safety",
-          "--libraries-spec=sdk_nnbd/lib/libraries.json",
+          "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=out/ReleaseX64/"
         ],
         "timeout": 240,
@@ -642,7 +592,7 @@
         ],
         "dart2js-options": [
           "--no-sound-null-safety",
-          "--libraries-spec=sdk_nnbd/lib/libraries.json",
+          "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=xcodebuild/ReleaseX64/"
         ],
         "timeout": 240,
@@ -657,7 +607,7 @@
         ],
         "dart2js-options": [
           "--sound-null-safety",
-          "--libraries-spec=sdk_nnbd/lib/libraries.json",
+          "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=out/ReleaseX64/"
         ],
         "timeout": 240,
@@ -672,7 +622,7 @@
         ],
         "dart2js-options": [
           "--sound-null-safety",
-          "--libraries-spec=sdk_nnbd/lib/libraries.json",
+          "--libraries-spec=sdk/lib/libraries.json",
           "--platform-binaries=xcodebuild/ReleaseX64/"
         ],
         "timeout": 240,
@@ -1376,7 +1326,7 @@
             "co19"
           ],
           "fileset": "vm-kernel",
-          "shards": 1
+          "shards": 2
         },
         {
           "name": "co19 nnbd tests in strong mode",
@@ -1385,7 +1335,7 @@
             "co19"
           ],
           "fileset": "vm-kernel",
-          "shards": 1
+          "shards": 2
         },
         {
           "name": "vm nnbd tests in weak mode with asserts",
@@ -1965,7 +1915,7 @@
             "co19_2"
           ],
           "shards": 6,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "ddc kernel tests",
@@ -2049,7 +1999,7 @@
             "co19_2"
           ],
           "shards": 6,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "ddc kernel tests",
@@ -2107,7 +2057,7 @@
             "dartdevc_native"
           ],
           "shards": 5,
-          "fileset": "dart2js_nnbd"
+          "fileset": "web_platform_nnbd"
         },
         {
           "name": "ddc nnbd weak co19 tests",
@@ -2116,7 +2066,7 @@
             "co19"
           ],
           "shards": 2,
-          "fileset": "dart2js_nnbd"
+          "fileset": "web_platform_nnbd"
         },
         {
           "name": "ddc nnbd strong tests",
@@ -2348,7 +2298,7 @@
             "--exclude_suite=observatory_ui"
           ],
           "shards": 6,
-          "fileset": "dart2js_hostasserts"
+          "fileset": "web_platform_hostasserts"
         },
         {
           "name": "dart2js co19_2 tests",
@@ -2358,7 +2308,7 @@
             "co19_2"
           ],
           "shards": 6,
-          "fileset": "dart2js_hostasserts"
+          "fileset": "web_platform_hostasserts"
         },
         {
           "name": "dart2js package tests",
@@ -2388,37 +2338,6 @@
     },
     {
       "builders": [
-        "dart2js-rti-linux-x64-d8"
-      ],
-      "meta": {
-        "description": "dart2js-d8 tests without null safety"
-      },
-      "steps": [
-        {
-          "name": "build dart",
-          "script": "tools/build.py",
-          "arguments": [
-            "--no-nnbd",
-            "create_sdk",
-            "dart2js_bot"
-          ]
-        },
-        {
-          "name": "dart2js pre nnbd tests",
-          "arguments": [
-            "-ndart2js-hostasserts-prennbd-linux-x64-d8",
-            "--dart2js-batch",
-            "language_2",
-            "corelib_2",
-            "dart2js_2"
-          ],
-          "shards": 6,
-          "fileset": "dart2js_hostasserts_prennbd"
-        }
-      ]
-    },
-    {
-      "builders": [
         "dart2js-strong-linux-x64-chrome",
         "dart2js-strong-linux-x64-firefox",
         "dart2js-strong-mac-x64-chrome",
@@ -2448,7 +2367,7 @@
             "--exclude_suite=observatory_ui"
           ],
           "shards": 6,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "dart2js co19_2 tests",
@@ -2459,7 +2378,7 @@
             "co19_2"
           ],
           "shards": 6,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "dart2js package tests",
@@ -2513,7 +2432,7 @@
             "--exclude_suite=observatory_ui"
           ],
           "shards": 6,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "dart2js package tests",
@@ -2547,7 +2466,7 @@
             "--exclude_suite=observatory_ui"
           ],
           "shards": 6,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "dart2js production extra tests",
@@ -2583,7 +2502,7 @@
             "--exclude_suite=observatory_ui"
           ],
           "shards": 4,
-          "fileset": "dart2js"
+          "fileset": "web_platform"
         },
         {
           "name": "dart2js package tests",
@@ -2650,7 +2569,7 @@
             "kernel"
           ],
           "shards": 6,
-          "fileset": "dart2js_hostasserts_nnbd"
+          "fileset": "web_platform_hostasserts_nnbd"
         },
         {
           "name": "dart2js legacy weak lib tests",
@@ -2660,7 +2579,7 @@
             "lib"
           ],
           "shards": 3,
-          "fileset": "dart2js_hostasserts_nnbd"
+          "fileset": "web_platform_hostasserts_nnbd"
         },
         {
           "name": "dart2js legacy weak co19 tests",
@@ -2670,7 +2589,7 @@
             "co19"
           ],
           "shards": 6,
-          "fileset": "dart2js_hostasserts_nnbd"
+          "fileset": "web_platform_hostasserts_nnbd"
         },
         {
           "name": "dart2js nnbd strong tests",
@@ -2683,7 +2602,7 @@
             "kernel"
           ],
           "shards": 6,
-          "fileset": "dart2js_hostasserts_nnbd"
+          "fileset": "web_platform_hostasserts_nnbd"
         },
         {
           "name": "dart2js nnbd strong lib tests",
@@ -2693,7 +2612,7 @@
             "lib"
           ],
           "shards": 3,
-          "fileset": "dart2js_hostasserts_nnbd"
+          "fileset": "web_platform_hostasserts_nnbd"
         },
         {
           "name": "dart2js nnbd strong co19 tests",
@@ -2703,7 +2622,7 @@
             "co19"
           ],
           "shards": 6,
-          "fileset": "dart2js_hostasserts_nnbd"
+          "fileset": "web_platform_hostasserts_nnbd"
         },
         {
           "name": "dart2js nnbd unit tests",
diff --git a/tools/bots/try_benchmarks.sh b/tools/bots/try_benchmarks.sh
index f05959f..14523e0 100755
--- a/tools/bots/try_benchmarks.sh
+++ b/tools/bots/try_benchmarks.sh
@@ -153,7 +153,6 @@
       out/ReleaseIA32/gen_kernel_bytecode.dill \
       out/ReleaseIA32/run_vm_tests \
       sdk \
-      sdk_nnbd \
       samples-dev/swarm \
       third_party/pkg \
       third_party/pkg_tested \
@@ -292,7 +291,6 @@
       third_party/firefox_jsshell/linux/ \
       out/ReleaseX64/dart_precompiled_runtime \
       sdk \
-      sdk_nnbd \
       samples-dev/swarm \
       third_party/pkg \
       third_party/pkg_tested \
diff --git a/tools/build.py b/tools/build.py
index 895c698..0a49af9 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -67,14 +67,6 @@
         help='Build variants (comma-separated).',
         metavar='[all,none,asan,lsan,msan,tsan,ubsan]',
         default='none')
-    # TODO(38701): Remove this option once the NNBD SDK is stable/performant
-    # and there is no need to build a legacy version of the SDK for comparison
-    # purposes.
-    result.add_option(
-        "--no-nnbd",
-        help='Build the Legacy (pre NNBD) version of the SDK.',
-        default=False,
-        action='store_true')
     result.add_option(
         "-v",
         "--verbose",
@@ -219,7 +211,7 @@
     return True
 
 
-def RunGNIfNeeded(out_dir, target_os, mode, arch, dont_use_nnbd, sanitizer):
+def RunGNIfNeeded(out_dir, target_os, mode, arch, sanitizer):
     if os.path.isfile(os.path.join(out_dir, 'args.gn')):
         return
     gn_os = 'host' if target_os == HOST_OS else target_os
@@ -236,8 +228,6 @@
         gn_os,
         '-v',
     ]
-    if dont_use_nnbd:
-        gn_command.append('--no-nnbd')
 
     process = subprocess.Popen(gn_command)
     process.wait()
@@ -291,14 +281,12 @@
 
 # Returns a tuple (build_config, command to run, whether goma is used)
 def BuildOneConfig(options, targets, target_os, mode, arch, sanitizer):
-    build_config = utils.GetBuildConf(mode, arch, target_os, sanitizer,
-                                      options.no_nnbd)
-    out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os, sanitizer,
-                                 options.no_nnbd)
+    build_config = utils.GetBuildConf(mode, arch, target_os, sanitizer)
+    out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os, sanitizer)
     using_goma = False
     # TODO(zra): Remove auto-run of gn, replace with prompt for user to run
     # gn.py manually.
-    RunGNIfNeeded(out_dir, target_os, mode, arch, options.no_nnbd, sanitizer)
+    RunGNIfNeeded(out_dir, target_os, mode, arch, sanitizer)
     command = ['ninja', '-C', out_dir]
     if options.verbose:
         command += ['-v']
diff --git a/tools/dom/scripts/dartdomgenerator.py b/tools/dom/scripts/dartdomgenerator.py
index 211004f..d4711a7 100755
--- a/tools/dom/scripts/dartdomgenerator.py
+++ b/tools/dom/scripts/dartdomgenerator.py
@@ -354,13 +354,12 @@
 
     if 'htmldart2js' in systems:
         _logger.info('Generating dart2js single files.')
-        sdk_dir = 'sdk_nnbd' if options.nnbd else 'sdk'
 
         for library_name in HTML_LIBRARY_NAMES:
             source = os.path.join(dart2js_output_dir,
                                   '%s_dart2js.dart' % library_name)
             GenerateSingleFile(
-                source, os.path.join('..', '..', '..', sdk_dir, 'lib',
+                source, os.path.join('..', '..', '..', 'sdk', 'lib',
                                      library_name, 'dart2js'))
 
     print '\nGenerating single file %s seconds' % round(
diff --git a/tools/generate_idefiles.py b/tools/generate_idefiles.py
index a7b89d8..b7131c8 100755
--- a/tools/generate_idefiles.py
+++ b/tools/generate_idefiles.py
@@ -96,7 +96,6 @@
     - runtime/**
     - samples-dev/swarm/**
     - sdk/lib/**
-    - sdk_nnbd/lib/**
     - tests/**
     - third_party/observatory_pub_packages/**
     - third_party/pkg/**
diff --git a/tools/gn.py b/tools/gn.py
index f0cd314..c9335f4 100755
--- a/tools/gn.py
+++ b/tools/gn.py
@@ -51,11 +51,8 @@
     return args.split()
 
 
-# TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant and
-# there is no need to build a legacy version of the SDK for comparison purposes.
-def GetOutDir(mode, arch, target_os, sanitizer, dont_use_nnbd):
-    return utils.GetBuildRoot(HOST_OS, mode, arch, target_os, sanitizer,
-                              dont_use_nnbd)
+def GetOutDir(mode, arch, target_os, sanitizer):
+    return utils.GetBuildRoot(HOST_OS, mode, arch, target_os, sanitizer)
 
 
 def ToCommandLine(gn_args):
@@ -145,9 +142,7 @@
     return True
 
 
-# TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant and
-# there is no need to build a legacy version of the SDK for comparison purposes.
-def ToGnArgs(args, mode, arch, target_os, sanitizer, dont_use_nnbd):
+def ToGnArgs(args, mode, arch, target_os, sanitizer):
     gn_args = {}
 
     host_os = HostOsForGn(HOST_OS)
@@ -268,8 +263,6 @@
         gn_args['dart_debug_optimization_level'] = args.debug_opt_level
         gn_args['debug_optimization_level'] = args.debug_opt_level
 
-    gn_args['dont_use_nnbd'] = dont_use_nnbd
-
     return gn_args
 
 
@@ -378,14 +371,6 @@
         help='Build variants (comma-separated).',
         metavar='[all,none,asan,lsan,msan,tsan,ubsan]',
         default='none')
-    # TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant
-    # and there is no need to build a legacy version of the SDK for
-    # comparison purposes.
-    common_group.add_argument(
-        "--no-nnbd",
-        help='Use the NNBD fork of the SDK.',
-        default=False,
-        action='store_true')
     common_group.add_argument(
         "-v",
         "--verbose",
@@ -508,15 +493,13 @@
         for mode in args.mode:
             for arch in args.arch:
                 for sanitizer in args.sanitizer:
-                    out_dir = GetOutDir(mode, arch, target_os, sanitizer,
-                                        args.no_nnbd)
+                    out_dir = GetOutDir(mode, arch, target_os, sanitizer)
                     # TODO(infra): Re-enable --check. Many targets fail to use
                     # public_deps to re-expose header files to their dependents.
                     # See dartbug.com/32364
                     command = [gn, 'gen', out_dir]
                     gn_args = ToCommandLine(
-                        ToGnArgs(args, mode, arch, target_os, sanitizer,
-                                 args.no_nnbd))
+                        ToGnArgs(args, mode, arch, target_os, sanitizer))
                     gn_args += GetGNArgs(args)
                     if args.verbose:
                         print("gn gen --check in %s" % out_dir)
diff --git a/tools/utils.py b/tools/utils.py
index 9097006..3971ef1 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -310,51 +310,33 @@
             (target_os != GuessOS()))
 
 
-# TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant and
-# there is no need to build a legacy version of the SDK for comparison purposes.
-def GetBuildConf(mode, arch, conf_os=None, sanitizer=None, dont_use_nnbd=False):
-    nnbd = "Legacy" if dont_use_nnbd else ""
+def GetBuildConf(mode, arch, conf_os=None, sanitizer=None):
     if conf_os == 'android':
-        return '%s%s%s%s' % (GetBuildMode(mode), conf_os.title(), arch.upper(),
-                             nnbd)
+        return '%s%s%s' % (GetBuildMode(mode), conf_os.title(), arch.upper())
     else:
         # Ask for a cross build if the host and target architectures don't match.
         host_arch = ARCH_GUESS
         cross_build = ''
         if GetArchFamily(host_arch) != GetArchFamily(arch):
             cross_build = 'X'
-        return '%s%s%s%s%s' % (GetBuildMode(mode), GetBuildSanitizer(sanitizer),
-                               cross_build, arch.upper(), nnbd)
+        return '%s%s%s%s' % (GetBuildMode(mode), GetBuildSanitizer(sanitizer),
+                             cross_build, arch.upper())
 
 
 def GetBuildDir(host_os):
     return BUILD_ROOT[host_os]
 
 
-# TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant and
-# there is no need to build a legacy version of the SDK for comparison purposes.
-def GetBuildRoot(host_os,
-                 mode=None,
-                 arch=None,
-                 target_os=None,
-                 sanitizer=None,
-                 dont_use_nnbd=False):
+def GetBuildRoot(host_os, mode=None, arch=None, target_os=None, sanitizer=None):
     build_root = GetBuildDir(host_os)
     if mode:
         build_root = os.path.join(
-            build_root,
-            GetBuildConf(mode, arch, target_os, sanitizer, dont_use_nnbd))
+            build_root, GetBuildConf(mode, arch, target_os, sanitizer))
     return build_root
 
 
-# TODO(38701): Remove dont_use_nnbd once the NNBD SDK is stable/performant and
-# there is no need to build a legacy version of the SDK for comparison purposes.
-def GetBuildSdkBin(host_os,
-                   mode=None,
-                   arch=None,
-                   target_os=None,
-                   dont_use_nnbd=False):
-    build_root = GetBuildRoot(host_os, mode, arch, target_os, dont_use_nnbd)
+def GetBuildSdkBin(host_os, mode=None, arch=None, target_os=None):
+    build_root = GetBuildRoot(host_os, mode, arch, target_os)
     return os.path.join(build_root, 'dart-sdk', 'bin')
 
 
diff --git a/utils/compiler/BUILD.gn b/utils/compiler/BUILD.gn
index 060279d..f8b41bd 100644
--- a/utils/compiler/BUILD.gn
+++ b/utils/compiler/BUILD.gn
@@ -46,11 +46,7 @@
   args = [ "--output_dir=$output_dir" ]
 }
 
-if (dont_use_nnbd) {
-  sdk_root = "../../sdk"
-} else {
-  sdk_root = "../../sdk_nnbd"
-}
+sdk_root = "../../sdk"
 
 application_snapshot("dart2js") {
   deps = [
@@ -91,11 +87,8 @@
     "--target=dart2js",
     "--no-defines",
     "dart:core",
+    "--enable-experiment=non-nullable",
   ]
-
-  if (!dont_use_nnbd) {
-    args += [ "--enable-experiment=non-nullable" ]
-  }
 }
 compile_platform("compile_dart2js_nnbd_strong_platform") {
   single_root_scheme = "org-dartlang-sdk"
@@ -111,14 +104,9 @@
     "--target=dart2js",
     "--no-defines",
     "dart:core",
+    "--enable-experiment=non-nullable",
+    "--nnbd-strong",
   ]
-
-  if (!dont_use_nnbd) {
-    args += [
-      "--enable-experiment=non-nullable",
-      "--nnbd-strong",
-    ]
-  }
 }
 compile_platform("compile_dart2js_server_platform") {
   single_root_scheme = "org-dartlang-sdk"
@@ -134,11 +122,8 @@
     "--target=dart2js_server",
     "--no-defines",
     "dart:core",
+    "--enable-experiment=non-nullable",
   ]
-
-  if (!dont_use_nnbd) {
-    args += [ "--enable-experiment=non-nullable" ]
-  }
 }
 compile_platform("compile_dart2js_server_nnbd_strong_platform") {
   single_root_scheme = "org-dartlang-sdk"
@@ -154,12 +139,7 @@
     "--target=dart2js_server",
     "--no-defines",
     "dart:core",
+    "--enable-experiment=non-nullable",
+    "--nnbd-strong",
   ]
-
-  if (!dont_use_nnbd) {
-    args += [
-      "--enable-experiment=non-nullable",
-      "--nnbd-strong",
-    ]
-  }
 }
diff --git a/utils/dartanalyzer/BUILD.gn b/utils/dartanalyzer/BUILD.gn
index 59e462f..f1d9b01 100644
--- a/utils/dartanalyzer/BUILD.gn
+++ b/utils/dartanalyzer/BUILD.gn
@@ -44,17 +44,9 @@
   inputs = sdk_lib_files + analyzer_files
   output = "$root_gen_dir/strong.sum"
   outputs = [ output ]
-  if (!dont_use_nnbd) {
-    args = [
-      "build",
-      rebase_path(output),
-      rebase_path("../../sdk_nnbd"),
-    ]
-  } else {
-    args = [
-      "build",
-      rebase_path(output),
-      rebase_path("../../sdk"),
-    ]
-  }
+  args = [
+    "build",
+    rebase_path(output),
+    rebase_path("../../sdk"),
+  ]
 }
diff --git a/utils/dartdevc/BUILD.gn b/utils/dartdevc/BUILD.gn
index d5c4f0e..71fc422 100644
--- a/utils/dartdevc/BUILD.gn
+++ b/utils/dartdevc/BUILD.gn
@@ -38,12 +38,7 @@
   inputs = [ sdk_outline_dill ]
 }
 
-# TODO(#38701) Cleanup after merging the forked SDK into mainline.
-if (dont_use_nnbd) {
-  sdk_root = "../../sdk"
-} else {
-  sdk_root = "../../sdk_nnbd"
-}
+sdk_root = "../../sdk"
 
 sdk_lib_files = exec_script("../../tools/list_dart_files.py",
                             [
@@ -131,11 +126,6 @@
     "--out",
     rebase_path("$patched_sdk_dir/"),
   ]
-
-  # TODO(#38701) Cleanup after merging the forked SDK into mainline.
-  if (dont_use_nnbd) {
-    args += [ "--no-nnbd" ]
-  }
 }
 
 # Builds everything needed to run dartdevc tests using test.dart.
@@ -150,9 +140,7 @@
 
   # TODO(nshahan) Temporarily here until we decide if we are going to include
   # in the create_sdk target.
-  if (!dont_use_nnbd) {
-    deps += [ "../../sdk_nnbd:copy_dev_compiler_outline_sound" ]
-  }
+  deps += [ "../../sdk:copy_dev_compiler_outline_sound" ]
 }
 
 # Builds everything needed to run dartdevc tests locally using test.dart without
@@ -266,11 +254,7 @@
       args += invoker.args
     }
 
-    # TODO(38701): Cleanup don't_use_nnbd clause after merging the forked SDK
-    # into mainline.
-    if (invoker.sound_null_safety || !dont_use_nnbd) {
-      args += [ "--enable-experiment=non-nullable" ]
-    }
+    args += [ "--enable-experiment=non-nullable" ]
 
     if (invoker.sound_null_safety) {
       args += [ "--sound-null-safety" ]
@@ -334,11 +318,11 @@
     args = [
       "--target=dartdevc",
       "dart:core",
+      "--enable-experiment=non-nullable",
     ]
 
     if (invoker.sound_null_safety) {
       args += [
-        "--enable-experiment=non-nullable",
         "--nnbd-strong",
       ]
 
@@ -347,10 +331,6 @@
         sdk_outline_sound_dill,
       ]
     } else {
-      # TODO(38701): Cleanup after merging the forked SDK into mainline.
-      if (!dont_use_nnbd) {
-        args += [ "--enable-experiment=non-nullable" ]
-      }
 
       outputs = [
         sdk_full_dill,
@@ -431,14 +411,9 @@
       "-o",
       rebase_path("$js_gen_dir/legacy/dart_sdk.js"),
       rebase_path("$platform_input"),
+      "--enable-experiment=non-nullable",
     ]
 
-    # TODO(38701): Cleanup don't_use_nnbd clause after merging the forked SDK
-    # into mainline.
-    if (invoker.sound_null_safety || !dont_use_nnbd) {
-      args += [ "--enable-experiment=non-nullable" ]
-    }
-
     if (invoker.sound_null_safety) {
       args += [ "--sound-null-safety" ]
     }